@nextclaw/ui 0.20.1 → 0.20.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/assets/{api-BBFMpRGl.js → api-DvpQWjTS.js} +3 -3
  3. package/dist/assets/{appearance-settings-page-C1Erayzl.js → appearance-settings-page-U0m0ktu3.js} +1 -1
  4. package/dist/assets/{book-open-BhTIpBKg.js → book-open-DRofSTWr.js} +1 -1
  5. package/dist/assets/channels-list-page-BURQarD0.js +8 -0
  6. package/dist/assets/{config-split-page-By7p-4X-.js → config-split-page-BrAQYTIl.js} +1 -1
  7. package/dist/assets/{confirm-dialog-xpl1Yl7r.js → confirm-dialog-DDJomLnO.js} +1 -1
  8. package/dist/assets/{createLucideIcon-B_8khHn8.js → createLucideIcon-DzkNHr5Z.js} +1 -1
  9. package/dist/assets/{desktop-update-config-CGFfa7-Z.js → desktop-update-config-BzZFhMv9.js} +1 -1
  10. package/dist/assets/{dist-CXN62DSs.js → dist-DXbLo2b1.js} +1 -1
  11. package/dist/assets/{dist-DdE-kCbi.js → dist-NskPB_yW.js} +1 -1
  12. package/dist/assets/doc-browser-DB22tQKU.js +1 -0
  13. package/dist/assets/{doc-browser-context-B8NCuMv5.js → doc-browser-context-CnKV4gJy.js} +1 -1
  14. package/dist/assets/doc-browser-sJjw9fl5.js +1 -0
  15. package/dist/assets/{extensions-CMctxyTf.js → extensions-DvlFMpAs.js} +1 -1
  16. package/dist/assets/{form-actions-BFgTdxqI.js → form-actions-UnPEZBkx.js} +1 -1
  17. package/dist/assets/index-Dc_ZMkmo.css +1 -0
  18. package/dist/assets/index-N1HnesBp.js +109 -0
  19. package/dist/assets/loader-circle-BlPXxgDB.js +1 -0
  20. package/dist/assets/mcp-marketplace-page-BIgFTbMq.js +9 -0
  21. package/dist/assets/mcp-marketplace-page-CZN4ovdK.js +1 -0
  22. package/dist/assets/model-config-page-CnSm7kfa.js +1 -0
  23. package/dist/assets/{navigation-link-BwWrm4k1.js → navigation-link-NjUdG6Vp.js} +1 -1
  24. package/dist/assets/plus-DVXol9Q5.js +1 -0
  25. package/dist/assets/privacy-settings-page-DVn2HU7W.js +1 -0
  26. package/dist/assets/providers-config-page-CzHJS3eg.js +1 -0
  27. package/dist/assets/react-DCVbGroo.js +8 -0
  28. package/dist/assets/{refresh-cw-B7NmPJ_Z.js → refresh-cw-CkeninE0.js} +1 -1
  29. package/dist/assets/remote-B2lsJF1c.js +1 -0
  30. package/dist/assets/{rotate-cw-B0ajMaHu.js → rotate-cw-DP33PuXU.js} +1 -1
  31. package/dist/assets/runtime-config-page-D69buyGp.js +1 -0
  32. package/dist/assets/{save-DWnYYpgQ.js → save-Cw2Xz-pB.js} +1 -1
  33. package/dist/assets/{search-D6pX7FC-.js → search-C2CFAVvd.js} +1 -1
  34. package/dist/assets/{search-config-page-Cx3o_675.js → search-config-page-dqNT0Swf.js} +1 -1
  35. package/dist/assets/{secrets-config-page-tyFl7Rvt.js → secrets-config-page-De6J3wVx.js} +2 -2
  36. package/dist/assets/security-config-Dcu9C4OL.js +1 -0
  37. package/dist/assets/{select-qEtFTWB5.js → select-DSuMhwVP.js} +1 -1
  38. package/dist/assets/skeleton-QoWydNLp.js +1 -0
  39. package/dist/assets/{tag-chip-vcjAYdV_.js → tag-chip-DFBLgsGf.js} +1 -1
  40. package/dist/assets/x-BXvAzpjb.js +1 -0
  41. package/dist/index.html +21 -21
  42. package/package.json +7 -7
  43. package/src/features/chat/components/layout/__tests__/chat-sidebar-read-state.test.tsx +4 -3
  44. package/src/features/chat/components/layout/__tests__/chat-sidebar-session-area.test.tsx +11 -4
  45. package/src/features/chat/components/layout/__tests__/chat-sidebar.test.tsx +17 -17
  46. package/src/features/chat/components/layout/chat-sidebar-desktop-layout.tsx +17 -5
  47. package/src/features/chat/components/layout/chat-sidebar.tsx +28 -21
  48. package/src/features/chat/features/conversation/hooks/__tests__/use-session-conversation-controller.test.tsx +41 -1
  49. package/src/features/chat/features/conversation/hooks/use-session-pending-input-actions.ts +22 -4
  50. package/src/features/chat/features/message/utils/__tests__/chat-message-trigger-details.utils.test.ts +35 -0
  51. package/src/features/chat/features/ncp/hooks/__tests__/use-ncp-agent-runtime-queue.test.tsx +50 -0
  52. package/src/features/chat/features/ncp/hooks/__tests__/use-ncp-session-list-view.test.tsx +24 -3
  53. package/src/features/chat/features/ncp/hooks/use-ncp-session-list-view.ts +35 -19
  54. package/src/features/chat/features/session/components/__tests__/chat-sidebar-project-groups.test.tsx +26 -2
  55. package/src/features/chat/features/session/components/__tests__/chat-sidebar-session-item.test.tsx +55 -27
  56. package/src/features/chat/features/session/components/chat-sidebar-context-card.tsx +60 -0
  57. package/src/features/chat/features/session/components/chat-sidebar-project-groups.tsx +95 -54
  58. package/src/features/chat/features/session/components/chat-sidebar-session-entry.tsx +9 -8
  59. package/src/features/chat/features/session/components/chat-sidebar-session-item.tsx +141 -95
  60. package/src/features/chat/features/session/components/chat-sidebar-session-list.tsx +11 -2
  61. package/src/features/chat/features/session/hooks/use-chat-sidebar-context-counts.ts +40 -0
  62. package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-file-preview.test.tsx +16 -9
  63. package/src/features/chat/features/workspace/components/__tests__/workspace-markdown-outline.test.tsx +128 -0
  64. package/src/features/chat/features/workspace/components/chat-session-workspace-file-breadcrumbs.tsx +3 -0
  65. package/src/features/chat/features/workspace/components/chat-session-workspace-file-preview.tsx +20 -2
  66. package/src/features/chat/features/workspace/components/workspace-markdown-outline.tsx +156 -0
  67. package/src/features/settings/pages/__tests__/privacy-settings-page.test.tsx +14 -5
  68. package/src/features/settings/pages/privacy-settings-page.tsx +38 -2
  69. package/src/shared/components/ui/actions/icon-action-button.tsx +1 -8
  70. package/src/shared/components/ui/tooltip.tsx +16 -1
  71. package/src/shared/hooks/use-config.ts +11 -0
  72. package/src/shared/lib/api/types.ts +8 -0
  73. package/src/shared/lib/api/utils/config.utils.ts +5 -0
  74. package/src/shared/lib/i18n/locales/en-US/chat.json +7 -0
  75. package/src/shared/lib/i18n/locales/en-US/core.json +17 -9
  76. package/src/shared/lib/i18n/locales/zh-CN/chat.json +7 -0
  77. package/src/shared/lib/i18n/locales/zh-CN/core.json +17 -9
  78. package/dist/assets/channels-list-page-OTCkjMOW.js +0 -8
  79. package/dist/assets/doc-browser-5xrHcQ2z.js +0 -1
  80. package/dist/assets/doc-browser-c2yO477-.js +0 -1
  81. package/dist/assets/index-DUCA8m2w.js +0 -109
  82. package/dist/assets/index-QrdUWHfm.css +0 -1
  83. package/dist/assets/loader-circle-CbdTrSp3.js +0 -1
  84. package/dist/assets/mcp-marketplace-page-DGve0muV.js +0 -9
  85. package/dist/assets/mcp-marketplace-page-_37VzG2q.js +0 -1
  86. package/dist/assets/model-config-page-DyC5H0bu.js +0 -1
  87. package/dist/assets/plus-DbeE4r-Q.js +0 -1
  88. package/dist/assets/privacy-settings-page--MOnhAZ6.js +0 -1
  89. package/dist/assets/providers-config-page-ChL3FUvK.js +0 -1
  90. package/dist/assets/react-DVMmnPWz.js +0 -8
  91. package/dist/assets/remote-DFoxj4ls.js +0 -1
  92. package/dist/assets/runtime-config-page-BQdT3nmd.js +0 -1
  93. package/dist/assets/security-config-CUTUm6JT.js +0 -1
  94. package/dist/assets/skeleton-7MYPzn8w.js +0 -1
  95. package/dist/assets/x-DThaS5ZL.js +0 -1
@@ -44,6 +44,7 @@
44
44
  "chatWorkspaceBack": "Back in workspace",
45
45
  "chatWorkspaceForward": "Forward in workspace",
46
46
  "chatWorkspaceRefreshFile": "Refresh preview",
47
+ "chatWorkspaceMarkdownOutline": "Document outline",
47
48
  "chatWorkspaceMaximizePanel": "Maximize workspace panel",
48
49
  "chatWorkspaceRestorePanel": "Restore workspace panel",
49
50
  "chatWorkspaceClosePanel": "Close workspace panel",
@@ -594,6 +595,12 @@
594
595
  "chatSidebarUnpinProject": "Unpin project",
595
596
  "chatSidebarExpandProject": "Expand project",
596
597
  "chatSidebarCollapseProject": "Collapse project",
598
+ "chatSidebarContextSessions": "Sessions",
599
+ "chatSidebarContextProject": "Project",
600
+ "chatSidebarContextPath": "Path",
601
+ "chatSidebarContextChildSessions": "Child sessions",
602
+ "chatSidebarContextScheduledTasks": "Scheduled tasks",
603
+ "chatSidebarContextNoProject": "No project",
597
604
  "chatSidebarProjectViewEmpty": "No projects yet",
598
605
  "chatBackgroundReplyFallbackTitle": "New reply",
599
606
  "chatBackgroundReplyFallbackPreview": "A reply is ready. Open the session to view it.",
@@ -302,11 +302,11 @@
302
302
  "authLogoutAction": "Sign Out This Tab",
303
303
  "authSessionMemoryNotice": "Sessions are stored only in server memory for now. You will need to sign in again after the NextClaw UI process restarts.",
304
304
  "privacyPageTitle": "Privacy & Analytics",
305
- "privacyPageDescription": "Choose whether to share minimal product activity and keep team or test installations separate.",
306
- "productAnalyticsSectionTitle": "Product activity analytics",
307
- "productAnalyticsSectionDescription": "Disabled by default. Changes apply immediately without restarting NextClaw.",
308
- "productAnalyticsEnabledTitle": "Share product activity",
309
- "productAnalyticsEnabledDescription": "When enabled, share only whether an Agent request was submitted and whether it succeeded.",
305
+ "privacyPageDescription": "Review and control NextClaw's anonymous usage analytics.",
306
+ "productAnalyticsSectionTitle": "Anonymous usage analytics",
307
+ "productAnalyticsSectionDescription": "Enabled by default. Changes apply immediately without restarting NextClaw.",
308
+ "productAnalyticsEnabledTitle": "Send anonymous usage analytics",
309
+ "productAnalyticsEnabledDescription": "Shares only whether use succeeded, the date window, OS category, version, and release channel.",
310
310
  "productAnalyticsAudienceTitle": "Analytics audience",
311
311
  "productAnalyticsAudienceDescription": "Team members and testers should choose the matching category so they stay out of external-user metrics.",
312
312
  "productAnalyticsAudienceExternal": "External user",
@@ -314,11 +314,19 @@
314
314
  "productAnalyticsAudienceQa": "QA testing",
315
315
  "productAnalyticsDataTitle": "Data scope",
316
316
  "productAnalyticsCollectedTitle": "What is shared",
317
- "productAnalyticsCollectedDescription": "Event type, time, random installation identifier, environment, release channel, operating-system category, and product version. Signed-in installations are linked to the platform account.",
317
+ "productAnalyticsCollectedDescription": "Active or successful state, day/week/month window, analytics audience, environment, release channel, OS category, product version, and a random one-time receipt.",
318
318
  "productAnalyticsExcludedTitle": "What is never shared",
319
- "productAnalyticsExcludedDescription": "Messages, prompts, replies, tool arguments, session or project identifiers, file paths, URLs, device fingerprints, and diagnostic logs are never shared.",
320
- "productAnalyticsAnonymousTitle": "How signed-out use is counted",
321
- "productAnalyticsAnonymousDescription": "NextClaw creates a random installation identifier only after you enable sharing. It represents one installation, not an exact person, and does not use hardware identifiers.",
319
+ "productAnalyticsExcludedDescription": "Accounts, login tokens, persistent installation or device identifiers, messages, prompts, replies, tool arguments, session or project identifiers, file paths, URLs, IP addresses, User-Agent, and diagnostic logs are never shared.",
320
+ "productAnalyticsAnonymousTitle": "How anonymous counting works",
321
+ "productAnalyticsAnonymousDescription": "Each day, calendar week, and calendar month uses an unrelated random one-time receipt. Turning analytics off clears pending local receipts; anonymous server aggregates cannot be traced back to an installation for deletion.",
322
+ "productAnalyticsStatusSectionTitle": "Delivery status",
323
+ "productAnalyticsStatusTitle": "Anonymous analytics status",
324
+ "productAnalyticsStatusLoading": "Loading delivery status…",
325
+ "productAnalyticsStatusNever": "No delivery has been attempted. This updates after the first real Agent use.",
326
+ "productAnalyticsLastAttemptLabel": "Last attempt",
327
+ "productAnalyticsLastSuccessLabel": "Last success",
328
+ "productAnalyticsPendingLabel": "pending receipts",
329
+ "productAnalyticsLastErrorTitle": "Last error",
322
330
  "dmScope": "DM Scope",
323
331
  "dmScopeHelp": "Control how direct-message sessions are isolated.",
324
332
  "defaultContextTokens": "Default Context Tokens",
@@ -44,6 +44,7 @@
44
44
  "chatWorkspaceBack": "工作区后退",
45
45
  "chatWorkspaceForward": "工作区前进",
46
46
  "chatWorkspaceRefreshFile": "刷新预览",
47
+ "chatWorkspaceMarkdownOutline": "文档目录",
47
48
  "chatWorkspaceMaximizePanel": "最大化工作区侧栏",
48
49
  "chatWorkspaceRestorePanel": "还原工作区侧栏",
49
50
  "chatWorkspaceClosePanel": "关闭工作区侧栏",
@@ -594,6 +595,12 @@
594
595
  "chatSidebarUnpinProject": "取消置顶项目",
595
596
  "chatSidebarExpandProject": "展开项目",
596
597
  "chatSidebarCollapseProject": "收起项目",
598
+ "chatSidebarContextSessions": "会话",
599
+ "chatSidebarContextProject": "项目",
600
+ "chatSidebarContextPath": "路径",
601
+ "chatSidebarContextChildSessions": "子会话",
602
+ "chatSidebarContextScheduledTasks": "定时任务",
603
+ "chatSidebarContextNoProject": "未关联项目",
597
604
  "chatSidebarProjectViewEmpty": "还没有项目",
598
605
  "chatBackgroundReplyFallbackTitle": "有新回复",
599
606
  "chatBackgroundReplyFallbackPreview": "回复已完成,点击查看。",
@@ -302,11 +302,11 @@
302
302
  "authLogoutAction": "退出当前标签页",
303
303
  "authSessionMemoryNotice": "当前版本的会话只保存在服务端内存里。NextClaw UI 进程重启后,需要重新登录。",
304
304
  "privacyPageTitle": "隐私与统计",
305
- "privacyPageDescription": "选择是否分享最小化的产品活跃数据,并把团队自用与测试设备分开。",
306
- "productAnalyticsSectionTitle": "产品活跃统计",
307
- "productAnalyticsSectionDescription": "默认关闭。修改后立即生效,不需要重启 NextClaw。",
308
- "productAnalyticsEnabledTitle": "分享产品活跃数据",
309
- "productAnalyticsEnabledDescription": "开启后,只分享是否提交过 Agent 请求以及请求是否成功。",
305
+ "privacyPageDescription": "查看和控制 NextClaw 的匿名使用统计。",
306
+ "productAnalyticsSectionTitle": "匿名使用统计",
307
+ "productAnalyticsSectionDescription": "默认开启。修改后立即生效,不需要重启 NextClaw。",
308
+ "productAnalyticsEnabledTitle": "发送匿名使用统计",
309
+ "productAnalyticsEnabledDescription": "只发送是否使用成功、日期周期、系统类别、版本和发布通道。",
310
310
  "productAnalyticsAudienceTitle": "统计人群",
311
311
  "productAnalyticsAudienceDescription": "团队成员和测试人员请选择对应分类,避免进入外部用户指标。",
312
312
  "productAnalyticsAudienceExternal": "外部用户",
@@ -314,11 +314,19 @@
314
314
  "productAnalyticsAudienceQa": "QA 测试",
315
315
  "productAnalyticsDataTitle": "数据范围",
316
316
  "productAnalyticsCollectedTitle": "会分享什么",
317
- "productAnalyticsCollectedDescription": "事件类型、时间、随机安装标识、运行环境、发布通道、系统类别和产品版本。登录后,安装会与平台账号归并。",
317
+ "productAnalyticsCollectedDescription": "活动或成功状态、日/周/月周期、统计人群、运行环境、发布通道、系统类别、产品版本和随机单次回执。",
318
318
  "productAnalyticsExcludedTitle": "不会分享什么",
319
- "productAnalyticsExcludedDescription": "不会分享消息、提示词、回复、工具参数、会话与项目标识、文件路径、URL、设备指纹或诊断日志。",
320
- "productAnalyticsAnonymousTitle": "未登录时如何统计",
321
- "productAnalyticsAnonymousDescription": "NextClaw 使用启用后生成的随机安装标识。它只代表一个安装,不等于精确人数,也不会读取硬件标识。",
319
+ "productAnalyticsExcludedDescription": "不会分享账号、登录令牌、长期安装或设备标识、消息、提示词、回复、工具参数、会话与项目标识、文件路径、URL、IP、User-Agent 或诊断日志。",
320
+ "productAnalyticsAnonymousTitle": "如何匿名计数",
321
+ "productAnalyticsAnonymousDescription": "每个日、自然周和自然月使用互不关联的随机单次回执。关闭后会清除本地待发送回执;服务端匿名汇总无法按安装反查或删除。",
322
+ "productAnalyticsStatusSectionTitle": "发送状态",
323
+ "productAnalyticsStatusTitle": "匿名统计状态",
324
+ "productAnalyticsStatusLoading": "正在读取发送状态…",
325
+ "productAnalyticsStatusNever": "尚未尝试发送。首次真实使用 Agent 后会更新。",
326
+ "productAnalyticsLastAttemptLabel": "最近尝试",
327
+ "productAnalyticsLastSuccessLabel": "最近成功",
328
+ "productAnalyticsPendingLabel": "条待发送回执",
329
+ "productAnalyticsLastErrorTitle": "最近错误",
322
330
  "dmScope": "私聊范围",
323
331
  "dmScopeHelp": "控制私聊会话如何隔离。",
324
332
  "defaultContextTokens": "默认上下文额度",
@@ -1,8 +0,0 @@
1
- import{i as e,t}from"./chunk-DseTPa7n.js";import{B as n,F as r,H as i,L as a,a as o,r as s,s as c}from"./react-DVMmnPWz.js";import{n as l,t as u}from"./navigation-link-BwWrm4k1.js";import{Dn as d,Dt as f,Nt as p,Ot as m,cn as h,gn as g,hn as _,in as v,kt as y,ln as b,mn as x,sn as S,zt as C}from"./api-BBFMpRGl.js";import{C as w,a as T,i as E,n as D,r as O,t as ee}from"./select-qEtFTWB5.js";import{t as k}from"./createLucideIcon-B_8khHn8.js";import{t as te}from"./search-D6pX7FC-.js";import{t as ne}from"./book-open-BhTIpBKg.js";import{t as re}from"./loader-circle-CbdTrSp3.js";import{t as ie}from"./x-DThaS5ZL.js";import{t as ae}from"./tag-chip-vcjAYdV_.js";import{B as A,C as oe,H as j,L as M,R as N,V as se,c as ce,ct as le,d as ue,dt as de,gt as fe,h as pe,ht as me,l as P,u as F,vt as he,z as I}from"./index-DUCA8m2w.js";import{t as ge}from"./form-actions-BFgTdxqI.js";import{t as L}from"./config-hints-nV5HPOvq.js";import{a as _e,c as R,i as ve,l as ye,n as be,o as z,r as xe,s as Se,t as Ce}from"./config-split-page-By7p-4X-.js";var we=k(`Hash`,[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]),Te=k(`Mail`,[[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}],[`path`,{d:`m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7`,key:`1ocrg3`}]]),B=k(`MessageCircleMore`,[[`path`,{d:`M7.9 20A9 9 0 1 0 4 16.1L2 22Z`,key:`vv11sd`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}]]),V=k(`QrCode`,[[`rect`,{width:`5`,height:`5`,x:`3`,y:`3`,rx:`1`,key:`1tu5fj`}],[`rect`,{width:`5`,height:`5`,x:`16`,y:`3`,rx:`1`,key:`1v8r4q`}],[`rect`,{width:`5`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`1x03jg`}],[`path`,{d:`M21 16h-3a2 2 0 0 0-2 2v3`,key:`177gqh`}],[`path`,{d:`M21 21v.01`,key:`ents32`}],[`path`,{d:`M12 7v3a2 2 0 0 1-2 2H7`,key:`8crl2c`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M12 3h.01`,key:`n36tog`}],[`path`,{d:`M12 16v.01`,key:`133mhm`}],[`path`,{d:`M16 12h1`,key:`1slzba`}],[`path`,{d:`M21 12v.01`,key:`1lwtk9`}],[`path`,{d:`M12 21v-1`,key:`1880an`}]]),Ee=k(`ToggleLeft`,[[`rect`,{width:`20`,height:`12`,x:`2`,y:`6`,rx:`6`,ry:`6`,key:`f2vt7d`}],[`circle`,{cx:`8`,cy:`12`,r:`2`,key:`1nvbw3`}]]),H=e(i(),1),U=n();function De({value:e,onChange:t,className:n,placeholder:r=``}){let[i,s]=(0,H.useState)(``),c=n=>{n.key===`Enter`&&i.trim()?(n.preventDefault(),t([...e,i.trim()]),s(``)):n.key===`Backspace`&&!i&&e.length>0&&t(e.slice(0,-1))},l=n=>{t(e.filter((e,t)=>t!==n))};return(0,U.jsxs)(`div`,{className:a(`flex min-h-[42px] flex-wrap gap-2 rounded-xl border border-gray-200/80 bg-white p-2`,n),children:[e.map((e,t)=>(0,U.jsxs)(ae,{tone:`info`,className:`gap-1 px-2 py-1 text-sm`,children:[e,(0,U.jsx)(`button`,{type:`button`,onClick:()=>l(t),className:`transition-colors hover:text-rose-200`,children:(0,U.jsx)(ie,{className:`h-3 w-3`})})]},t)),(0,U.jsx)(`input`,{type:`text`,value:i,onChange:e=>s(e.target.value),onKeyDown:c,className:`flex-1 outline-none min-w-[100px] bg-transparent text-sm`,placeholder:r||o(`enterTag`)})]})}function Oe(e){return e.includes(`token`)||e.includes(`secret`)||e.includes(`password`)?(0,U.jsx)(fe,{className:`h-3.5 w-3.5 text-gray-500`}):e.includes(`url`)||e.includes(`host`)?(0,U.jsx)(he,{className:`h-3.5 w-3.5 text-gray-500`}):e.includes(`email`)||e.includes(`mail`)?(0,U.jsx)(Te,{className:`h-3.5 w-3.5 text-gray-500`}):e.includes(`id`)||e.includes(`from`)?(0,U.jsx)(we,{className:`h-3.5 w-3.5 text-gray-500`}):e===`enabled`||e===`consentGranted`?(0,U.jsx)(Ee,{className:`h-3.5 w-3.5 text-gray-500`}):(0,U.jsx)(de,{className:`h-3.5 w-3.5 text-gray-500`})}function ke({channelName:e,fields:t,formData:n,jsonDrafts:r,setJsonDrafts:i,updateField:a,uiHints:s}){return(0,U.jsx)(U.Fragment,{children:t.map(t=>{let c=L(`channels.${e}.${t.name}`,s),l=c?.label??t.label,u=c?.placeholder;return(0,U.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,U.jsxs)(S,{htmlFor:t.name,className:`flex items-center gap-2 text-sm font-medium text-gray-900`,children:[Oe(t.name),l]}),t.type===`boolean`&&(0,U.jsxs)(`div`,{className:`flex items-center justify-between rounded-xl bg-gray-50 p-3`,children:[(0,U.jsx)(`span`,{className:`text-sm text-gray-500`,children:n[t.name]?o(`enabled`):o(`disabled`)}),(0,U.jsx)(C,{id:t.name,checked:n[t.name]||!1,onCheckedChange:e=>a(t.name,e),className:`data-[state=checked]:bg-emerald-500`})]}),(t.type===`text`||t.type===`email`)&&(0,U.jsx)(h,{id:t.name,type:t.type,value:n[t.name]||``,onChange:e=>a(t.name,e.target.value),placeholder:u,className:`rounded-xl`}),t.type===`password`&&(0,U.jsx)(h,{id:t.name,type:`password`,value:n[t.name]||``,onChange:e=>a(t.name,e.target.value),placeholder:u??o(`leaveBlankToKeepUnchanged`),className:`rounded-xl`}),t.type===`number`&&(0,U.jsx)(h,{id:t.name,type:`number`,value:n[t.name]||0,onChange:e=>a(t.name,parseInt(e.target.value,10)||0),placeholder:u,className:`rounded-xl`}),t.type===`tags`&&(0,U.jsx)(De,{value:n[t.name]||[],onChange:e=>a(t.name,e)}),t.type===`select`&&(0,U.jsxs)(ee,{value:n[t.name]||``,onValueChange:e=>a(t.name,e),children:[(0,U.jsx)(E,{className:`rounded-xl`,children:(0,U.jsx)(T,{})}),(0,U.jsx)(D,{children:(t.options??[]).map(e=>(0,U.jsx)(O,{value:e.value,children:e.label},e.value))})]}),t.type===`json`&&(0,U.jsx)(`textarea`,{id:t.name,value:r[t.name]??`{}`,onChange:e=>i(n=>({...n,[t.name]:e.target.value})),className:`min-h-[120px] w-full resize-none rounded-lg border border-gray-200 bg-white px-3 py-2 text-xs font-mono`})]},t.name)})})}var Ae=t(((e,t)=>{t.exports=function(){return typeof Promise==`function`&&Promise.prototype&&Promise.prototype.then}})),W=t((e=>{var t,n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(e){if(!e)throw Error(`"version" cannot be null or undefined`);if(e<1||e>40)throw Error(`"version" should be in range from 1 to 40`);return e*4+17},e.getSymbolTotalCodewords=function(e){return n[e]},e.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t},e.setToSJISFunction=function(e){if(typeof e!=`function`)throw Error(`"toSJISFunc" is not a valid function.`);t=e},e.isKanjiModeEnabled=function(){return t!==void 0},e.toSJIS=function(e){return t(e)}})),G=t((e=>{e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`l`:case`low`:return e.L;case`m`:case`medium`:return e.M;case`q`:case`quartile`:return e.Q;case`h`:case`high`:return e.H;default:throw Error(`Unknown EC Level: `+t)}}e.isValid=function(e){return e&&e.bit!==void 0&&e.bit>=0&&e.bit<4},e.from=function(n,r){if(e.isValid(n))return n;try{return t(n)}catch{return r}}})),je=t(((e,t)=>{function n(){this.buffer=[],this.length=0}n.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},t.exports=n})),Me=t(((e,t)=>{function n(e){if(!e||e<1)throw Error(`BitMatrix size must be defined and greater than 0`);this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}n.prototype.set=function(e,t,n,r){let i=e*this.size+t;this.data[i]=n,r&&(this.reservedBit[i]=!0)},n.prototype.get=function(e,t){return this.data[e*this.size+t]},n.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},n.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},t.exports=n})),Ne=t((e=>{var t=W().getSymbolSize;e.getRowColCoords=function(e){if(e===1)return[];let n=Math.floor(e/7)+2,r=t(e),i=r===145?26:Math.ceil((r-13)/(2*n-2))*2,a=[r-7];for(let e=1;e<n-1;e++)a[e]=a[e-1]-i;return a.push(6),a.reverse()},e.getPositions=function(t){let n=[],r=e.getRowColCoords(t),i=r.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)e===0&&t===0||e===0&&t===i-1||e===i-1&&t===0||n.push([r[e],r[t]]);return n}})),Pe=t((e=>{var t=W().getSymbolSize,n=7;e.getPositions=function(e){let r=t(e);return[[0,0],[r-n,0],[0,r-n]]}})),Fe=t((e=>{e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(e){return e!=null&&e!==``&&!isNaN(e)&&e>=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){let n=e.size,r=0,i=0,a=0,o=null,s=null;for(let c=0;c<n;c++){i=a=0,o=s=null;for(let l=0;l<n;l++){let n=e.get(c,l);n===o?i++:(i>=5&&(r+=t.N1+(i-5)),o=n,i=1),n=e.get(l,c),n===s?a++:(a>=5&&(r+=t.N1+(a-5)),s=n,a=1)}i>=5&&(r+=t.N1+(i-5)),a>=5&&(r+=t.N1+(a-5))}return r},e.getPenaltyN2=function(e){let n=e.size,r=0;for(let t=0;t<n-1;t++)for(let i=0;i<n-1;i++){let n=e.get(t,i)+e.get(t,i+1)+e.get(t+1,i)+e.get(t+1,i+1);(n===4||n===0)&&r++}return r*t.N2},e.getPenaltyN3=function(e){let n=e.size,r=0,i=0,a=0;for(let t=0;t<n;t++){i=a=0;for(let o=0;o<n;o++)i=i<<1&2047|e.get(t,o),o>=10&&(i===1488||i===93)&&r++,a=a<<1&2047|e.get(o,t),o>=10&&(a===1488||a===93)&&r++}return r*t.N3},e.getPenaltyN4=function(e){let n=0,r=e.data.length;for(let t=0;t<r;t++)n+=e.data[t];return Math.abs(Math.ceil(n*100/r/5)-10)*t.N4};function n(t,n,r){switch(t){case e.Patterns.PATTERN000:return(n+r)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return r%3==0;case e.Patterns.PATTERN011:return(n+r)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case e.Patterns.PATTERN101:return n*r%2+n*r%3==0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw Error(`bad maskPattern:`+t)}}e.applyMask=function(e,t){let r=t.size;for(let i=0;i<r;i++)for(let a=0;a<r;a++)t.isReserved(a,i)||t.xor(a,i,n(e,a,i))},e.getBestMask=function(t,n){let r=Object.keys(e.Patterns).length,i=0,a=1/0;for(let o=0;o<r;o++){n(o),e.applyMask(o,t);let r=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(o,t),r<a&&(a=r,i=o)}return i}})),K=t((e=>{var t=G(),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(e,r){switch(r){case t.L:return n[(e-1)*4+0];case t.M:return n[(e-1)*4+1];case t.Q:return n[(e-1)*4+2];case t.H:return n[(e-1)*4+3];default:return}},e.getTotalCodewordsCount=function(e,n){switch(n){case t.L:return r[(e-1)*4+0];case t.M:return r[(e-1)*4+1];case t.Q:return r[(e-1)*4+2];case t.H:return r[(e-1)*4+3];default:return}}})),Ie=t((e=>{var t=new Uint8Array(512),n=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)t[r]=e,n[e]=r,e<<=1,e&256&&(e^=285);for(let e=255;e<512;e++)t[e]=t[e-255]})(),e.log=function(e){if(e<1)throw Error(`log(`+e+`)`);return n[e]},e.exp=function(e){return t[e]},e.mul=function(e,r){return e===0||r===0?0:t[n[e]+n[r]]}})),Le=t((e=>{var t=Ie();e.mul=function(e,n){let r=new Uint8Array(e.length+n.length-1);for(let i=0;i<e.length;i++)for(let a=0;a<n.length;a++)r[i+a]^=t.mul(e[i],n[a]);return r},e.mod=function(e,n){let r=new Uint8Array(e);for(;r.length-n.length>=0;){let e=r[0];for(let i=0;i<n.length;i++)r[i]^=t.mul(n[i],e);let i=0;for(;i<r.length&&r[i]===0;)i++;r=r.slice(i)}return r},e.generateECPolynomial=function(n){let r=new Uint8Array([1]);for(let i=0;i<n;i++)r=e.mul(r,new Uint8Array([1,t.exp(i)]));return r}})),Re=t(((e,t)=>{var n=Le();function r(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}r.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},r.prototype.encode=function(e){if(!this.genPoly)throw Error(`Encoder not initialized`);let t=new Uint8Array(e.length+this.degree);t.set(e);let r=n.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){let e=new Uint8Array(this.degree);return e.set(r,i),e}return r},t.exports=r})),q=t((e=>{e.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}})),ze=t((e=>{var t=`[0-9]+`,n=`[A-Z $%*+\\-./:]+`,r=`(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+`;r=r.replace(/u/g,`\\u`);var i=`(?:(?![A-Z0-9 $%*+\\-./:]|`+r+`)(?:.|[\r
2
- ]))+`;e.KANJI=new RegExp(r,`g`),e.BYTE_KANJI=RegExp(`[^A-Z0-9 $%*+\\-./:]+`,`g`),e.BYTE=new RegExp(i,`g`),e.NUMERIC=new RegExp(t,`g`),e.ALPHANUMERIC=new RegExp(n,`g`);var a=RegExp(`^`+r+`$`),o=RegExp(`^`+t+`$`),s=RegExp(`^[A-Z0-9 $%*+\\-./:]+$`);e.testKanji=function(e){return a.test(e)},e.testNumeric=function(e){return o.test(e)},e.testAlphanumeric=function(e){return s.test(e)}})),J=t((e=>{var t=q(),n=ze();e.NUMERIC={id:`Numeric`,bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:`Alphanumeric`,bit:2,ccBits:[9,11,13]},e.BYTE={id:`Byte`,bit:4,ccBits:[8,16,16]},e.KANJI={id:`Kanji`,bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(e,n){if(!e.ccBits)throw Error(`Invalid mode: `+e);if(!t.isValid(n))throw Error(`Invalid version: `+n);return n>=1&&n<10?e.ccBits[0]:n<27?e.ccBits[1]:e.ccBits[2]},e.getBestModeForData=function(t){return n.testNumeric(t)?e.NUMERIC:n.testAlphanumeric(t)?e.ALPHANUMERIC:n.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(e){if(e&&e.id)return e.id;throw Error(`Invalid mode`)},e.isValid=function(e){return e&&e.bit&&e.ccBits};function r(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`numeric`:return e.NUMERIC;case`alphanumeric`:return e.ALPHANUMERIC;case`kanji`:return e.KANJI;case`byte`:return e.BYTE;default:throw Error(`Unknown mode: `+t)}}e.from=function(t,n){if(e.isValid(t))return t;try{return r(t)}catch{return n}}})),Be=t((e=>{var t=W(),n=K(),r=G(),i=J(),a=q(),o=7973,s=t.getBCHDigit(o);function c(t,n,r){for(let i=1;i<=40;i++)if(n<=e.getCapacity(i,r,t))return i}function l(e,t){return i.getCharCountIndicator(e,t)+4}function u(e,t){let n=0;return e.forEach(function(e){let r=l(e.mode,t);n+=r+e.getBitsLength()}),n}function d(t,n){for(let r=1;r<=40;r++)if(u(t,r)<=e.getCapacity(r,n,i.MIXED))return r}e.from=function(e,t){return a.isValid(e)?parseInt(e,10):t},e.getCapacity=function(e,r,o){if(!a.isValid(e))throw Error(`Invalid QR Code version`);o===void 0&&(o=i.BYTE);let s=(t.getSymbolTotalCodewords(e)-n.getTotalCodewordsCount(e,r))*8;if(o===i.MIXED)return s;let c=s-l(o,e);switch(o){case i.NUMERIC:return Math.floor(c/10*3);case i.ALPHANUMERIC:return Math.floor(c/11*2);case i.KANJI:return Math.floor(c/13);case i.BYTE:default:return Math.floor(c/8)}},e.getBestVersionForData=function(e,t){let n,i=r.from(t,r.M);if(Array.isArray(e)){if(e.length>1)return d(e,i);if(e.length===0)return 1;n=e[0]}else n=e;return c(n.mode,n.getLength(),i)},e.getEncodedBits=function(e){if(!a.isValid(e)||e<7)throw Error(`Invalid QR Code version`);let n=e<<12;for(;t.getBCHDigit(n)-s>=0;)n^=o<<t.getBCHDigit(n)-s;return e<<12|n}})),Ve=t((e=>{var t=W(),n=1335,r=21522,i=t.getBCHDigit(n);e.getEncodedBits=function(e,a){let o=e.bit<<3|a,s=o<<10;for(;t.getBCHDigit(s)-i>=0;)s^=n<<t.getBCHDigit(s)-i;return(o<<10|s)^r}})),He=t(((e,t)=>{var n=J();function r(e){this.mode=n.NUMERIC,this.data=e.toString()}r.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){let t,n,r;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),r=parseInt(n,10),e.put(r,10);let i=this.data.length-t;i>0&&(n=this.data.substr(t),r=parseInt(n,10),e.put(r,i*3+1))},t.exports=r})),Ue=t(((e,t)=>{var n=J(),r=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.split(``);function i(e){this.mode=n.ALPHANUMERIC,this.data=e}i.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let n=r.indexOf(this.data[t])*45;n+=r.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(r.indexOf(this.data[t]),6)},t.exports=i})),We=t(((e,t)=>{var n=J();function r(e){this.mode=n.BYTE,typeof e==`string`?this.data=new TextEncoder().encode(e):this.data=new Uint8Array(e)}r.getBitsLength=function(e){return e*8},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)},t.exports=r})),Ge=t(((e,t)=>{var n=J(),r=W();function i(e){this.mode=n.KANJI,this.data=e}i.getBitsLength=function(e){return e*13},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let n=r.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw Error(`Invalid SJIS character: `+this.data[t]+`
3
- Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}},t.exports=i})),Ke=t(((e,t)=>{var n={single_source_shortest_paths:function(e,t,r){var i={},a={};a[t]=0;var o=n.PriorityQueue.make();o.push(t,0);for(var s,c,l,u,d,f,p,m,h;!o.empty();)for(l in s=o.pop(),c=s.value,u=s.cost,d=e[c]||{},d)d.hasOwnProperty(l)&&(f=d[l],p=u+f,m=a[l],h=a[l]===void 0,(h||m>p)&&(a[l]=p,o.push(l,p),i[l]=c));if(r!==void 0&&a[r]===void 0){var g=[`Could not find a path from `,t,` to `,r,`.`].join(``);throw Error(g)}return i},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],r=t;r;)n.push(r),e[r],r=e[r];return n.reverse(),n},find_path:function(e,t,r){var i=n.single_source_shortest_paths(e,t,r);return n.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(e){var t=n.PriorityQueue,r={},i;for(i in e||={},t)t.hasOwnProperty(i)&&(r[i]=t[i]);return r.queue=[],r.sorter=e.sorter||t.default_sorter,r},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var n={value:e,cost:t};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t!==void 0&&(t.exports=n)})),qe=t((e=>{var t=J(),n=He(),r=Ue(),i=We(),a=Ge(),o=ze(),s=W(),c=Ke();function l(e){return unescape(encodeURIComponent(e)).length}function u(e,t,n){let r=[],i;for(;(i=e.exec(n))!==null;)r.push({data:i[0],index:i.index,mode:t,length:i[0].length});return r}function d(e){let n=u(o.NUMERIC,t.NUMERIC,e),r=u(o.ALPHANUMERIC,t.ALPHANUMERIC,e),i,a;return s.isKanjiModeEnabled()?(i=u(o.BYTE,t.BYTE,e),a=u(o.KANJI,t.KANJI,e)):(i=u(o.BYTE_KANJI,t.BYTE,e),a=[]),n.concat(r,i,a).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function f(e,o){switch(o){case t.NUMERIC:return n.getBitsLength(e);case t.ALPHANUMERIC:return r.getBitsLength(e);case t.KANJI:return a.getBitsLength(e);case t.BYTE:return i.getBitsLength(e)}}function p(e){return e.reduce(function(e,t){let n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[])}function m(e){let n=[];for(let r=0;r<e.length;r++){let i=e[r];switch(i.mode){case t.NUMERIC:n.push([i,{data:i.data,mode:t.ALPHANUMERIC,length:i.length},{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.ALPHANUMERIC:n.push([i,{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.KANJI:n.push([i,{data:i.data,mode:t.BYTE,length:l(i.data)}]);break;case t.BYTE:n.push([{data:i.data,mode:t.BYTE,length:l(i.data)}])}}return n}function h(e,n){let r={},i={start:{}},a=[`start`];for(let o=0;o<e.length;o++){let s=e[o],c=[];for(let e=0;e<s.length;e++){let l=s[e],u=``+o+e;c.push(u),r[u]={node:l,lastCount:0},i[u]={};for(let e=0;e<a.length;e++){let o=a[e];r[o]&&r[o].node.mode===l.mode?(i[o][u]=f(r[o].lastCount+l.length,l.mode)-f(r[o].lastCount,l.mode),r[o].lastCount+=l.length):(r[o]&&(r[o].lastCount=l.length),i[o][u]=f(l.length,l.mode)+4+t.getCharCountIndicator(l.mode,n))}}a=c}for(let e=0;e<a.length;e++)i[a[e]].end=0;return{map:i,table:r}}function g(e,o){let c,l=t.getBestModeForData(e);if(c=t.from(o,l),c!==t.BYTE&&c.bit<l.bit)throw Error(`"`+e+`" cannot be encoded with mode `+t.toString(c)+`.
4
- Suggested mode is: `+t.toString(l));switch(c===t.KANJI&&!s.isKanjiModeEnabled()&&(c=t.BYTE),c){case t.NUMERIC:return new n(e);case t.ALPHANUMERIC:return new r(e);case t.KANJI:return new a(e);case t.BYTE:return new i(e)}}e.fromArray=function(e){return e.reduce(function(e,t){return typeof t==`string`?e.push(g(t,null)):t.data&&e.push(g(t.data,t.mode)),e},[])},e.fromString=function(t,n){let r=h(m(d(t,s.isKanjiModeEnabled())),n),i=c.find_path(r.map,`start`,`end`),a=[];for(let e=1;e<i.length-1;e++)a.push(r.table[i[e]].node);return e.fromArray(p(a))},e.rawSplit=function(t){return e.fromArray(d(t,s.isKanjiModeEnabled()))}})),Je=t((e=>{var t=W(),n=G(),r=je(),i=Me(),a=Ne(),o=Pe(),s=Fe(),c=K(),l=Re(),u=Be(),d=Ve(),f=J(),p=qe();function m(e,t){let n=e.size,r=o.getPositions(t);for(let t=0;t<r.length;t++){let i=r[t][0],a=r[t][1];for(let t=-1;t<=7;t++)if(!(i+t<=-1||n<=i+t))for(let r=-1;r<=7;r++)a+r<=-1||n<=a+r||(t>=0&&t<=6&&(r===0||r===6)||r>=0&&r<=6&&(t===0||t===6)||t>=2&&t<=4&&r>=2&&r<=4?e.set(i+t,a+r,!0,!0):e.set(i+t,a+r,!1,!0))}}function h(e){let t=e.size;for(let n=8;n<t-8;n++){let t=n%2==0;e.set(n,6,t,!0),e.set(6,n,t,!0)}}function g(e,t){let n=a.getPositions(t);for(let t=0;t<n.length;t++){let r=n[t][0],i=n[t][1];for(let t=-2;t<=2;t++)for(let n=-2;n<=2;n++)t===-2||t===2||n===-2||n===2||t===0&&n===0?e.set(r+t,i+n,!0,!0):e.set(r+t,i+n,!1,!0)}}function _(e,t){let n=e.size,r=u.getEncodedBits(t),i,a,o;for(let t=0;t<18;t++)i=Math.floor(t/3),a=t%3+n-8-3,o=(r>>t&1)==1,e.set(i,a,o,!0),e.set(a,i,o,!0)}function v(e,t,n){let r=e.size,i=d.getEncodedBits(t,n),a,o;for(a=0;a<15;a++)o=(i>>a&1)==1,a<6?e.set(a,8,o,!0):a<8?e.set(a+1,8,o,!0):e.set(r-15+a,8,o,!0),a<8?e.set(8,r-a-1,o,!0):a<9?e.set(8,15-a-1+1,o,!0):e.set(8,15-a-1,o,!0);e.set(r-8,8,1,!0)}function y(e,t){let n=e.size,r=-1,i=n-1,a=7,o=0;for(let s=n-1;s>0;s-=2)for(s===6&&s--;;){for(let n=0;n<2;n++)if(!e.isReserved(i,s-n)){let r=!1;o<t.length&&(r=(t[o]>>>a&1)==1),e.set(i,s-n,r),a--,a===-1&&(o++,a=7)}if(i+=r,i<0||n<=i){i-=r,r=-r;break}}}function b(e,n,i){let a=new r;i.forEach(function(t){a.put(t.mode.bit,4),a.put(t.getLength(),f.getCharCountIndicator(t.mode,e)),t.write(a)});let o=(t.getSymbolTotalCodewords(e)-c.getTotalCodewordsCount(e,n))*8;for(a.getLengthInBits()+4<=o&&a.put(0,4);a.getLengthInBits()%8!=0;)a.putBit(0);let s=(o-a.getLengthInBits())/8;for(let e=0;e<s;e++)a.put(e%2?17:236,8);return x(a,e,n)}function x(e,n,r){let i=t.getSymbolTotalCodewords(n),a=i-c.getTotalCodewordsCount(n,r),o=c.getBlocksCount(n,r),s=o-i%o,u=Math.floor(i/o),d=Math.floor(a/o),f=d+1,p=u-d,m=new l(p),h=0,g=Array(o),_=Array(o),v=0,y=new Uint8Array(e.buffer);for(let e=0;e<o;e++){let t=e<s?d:f;g[e]=y.slice(h,h+t),_[e]=m.encode(g[e]),h+=t,v=Math.max(v,t)}let b=new Uint8Array(i),x=0,S,C;for(S=0;S<v;S++)for(C=0;C<o;C++)S<g[C].length&&(b[x++]=g[C][S]);for(S=0;S<p;S++)for(C=0;C<o;C++)b[x++]=_[C][S];return b}function S(e,n,r,a){let o;if(Array.isArray(e))o=p.fromArray(e);else if(typeof e==`string`){let t=n;if(!t){let n=p.rawSplit(e);t=u.getBestVersionForData(n,r)}o=p.fromString(e,t||40)}else throw Error(`Invalid data`);let c=u.getBestVersionForData(o,r);if(!c)throw Error(`The amount of data is too big to be stored in a QR Code`);if(!n)n=c;else if(n<c)throw Error(`
5
- The chosen QR Code version cannot contain this amount of data.
6
- Minimum version required to store current data is: `+c+`.
7
- `);let l=b(n,r,o),d=new i(t.getSymbolSize(n));return m(d,n),h(d),g(d,n),v(d,r,0),n>=7&&_(d,n),y(d,l),isNaN(a)&&(a=s.getBestMask(d,v.bind(null,d,r))),s.applyMask(a,d),v(d,r,a),{modules:d,version:n,errorCorrectionLevel:r,maskPattern:a,segments:o}}e.create=function(e,r){if(e===void 0||e===``)throw Error(`No input text`);let i=n.M,a,o;return r!==void 0&&(i=n.from(r.errorCorrectionLevel,n.M),a=u.from(r.version),o=s.from(r.maskPattern),r.toSJISFunc&&t.setToSJISFunction(r.toSJISFunc)),S(e,a,i,o)}})),Ye=t((e=>{function t(e){if(typeof e==`number`&&(e=e.toString()),typeof e!=`string`)throw Error(`Color should be defined as hex string`);let t=e.slice().replace(`#`,``).split(``);if(t.length<3||t.length===5||t.length>8)throw Error(`Invalid hex color: `+e);(t.length===3||t.length===4)&&(t=Array.prototype.concat.apply([],t.map(function(e){return[e,e]}))),t.length===6&&t.push(`F`,`F`);let n=parseInt(t.join(``),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:`#`+t.slice(0,6).join(``)}}e.getOptions=function(e){e||={},e.color||={};let n=e.margin===void 0||e.margin===null||e.margin<0?4:e.margin,r=e.width&&e.width>=21?e.width:void 0,i=e.scale||4;return{width:r,scale:r?4:i,margin:n,color:{dark:t(e.color.dark||`#000000ff`),light:t(e.color.light||`#ffffffff`)},type:e.type,rendererOpts:e.rendererOpts||{}}},e.getScale=function(e,t){return t.width&&t.width>=e+t.margin*2?t.width/(e+t.margin*2):t.scale},e.getImageWidth=function(t,n){let r=e.getScale(t,n);return Math.floor((t+n.margin*2)*r)},e.qrToImageData=function(t,n,r){let i=n.modules.size,a=n.modules.data,o=e.getScale(i,r),s=Math.floor((i+r.margin*2)*o),c=r.margin*o,l=[r.color.light,r.color.dark];for(let e=0;e<s;e++)for(let n=0;n<s;n++){let u=(e*s+n)*4,d=r.color.light;if(e>=c&&n>=c&&e<s-c&&n<s-c){let t=Math.floor((e-c)/o),r=Math.floor((n-c)/o);d=l[a[t*i+r]?1:0]}t[u++]=d.r,t[u++]=d.g,t[u++]=d.b,t[u]=d.a}}})),Xe=t((e=>{var t=Ye();function n(e,t,n){e.clearRect(0,0,t.width,t.height),t.style||={},t.height=n,t.width=n,t.style.height=n+`px`,t.style.width=n+`px`}function r(){try{return document.createElement(`canvas`)}catch{throw Error(`You need to specify a canvas element`)}}e.render=function(e,i,a){let o=a,s=i;o===void 0&&(!i||!i.getContext)&&(o=i,i=void 0),i||(s=r()),o=t.getOptions(o);let c=t.getImageWidth(e.modules.size,o),l=s.getContext(`2d`),u=l.createImageData(c,c);return t.qrToImageData(u.data,e,o),n(l,s,c),l.putImageData(u,0,0),s},e.renderToDataURL=function(t,n,r){let i=r;i===void 0&&(!n||!n.getContext)&&(i=n,n=void 0),i||={};let a=e.render(t,n,i),o=i.type||`image/png`,s=i.rendererOpts||{};return a.toDataURL(o,s.quality)}})),Ze=t((e=>{var t=Ye();function n(e,t){let n=e.a/255,r=t+`="`+e.hex+`"`;return n<1?r+` `+t+`-opacity="`+n.toFixed(2).slice(1)+`"`:r}function r(e,t,n){let r=e+t;return n!==void 0&&(r+=` `+n),r}function i(e,t,n){let i=``,a=0,o=!1,s=0;for(let c=0;c<e.length;c++){let l=Math.floor(c%t),u=Math.floor(c/t);!l&&!o&&(o=!0),e[c]?(s++,c>0&&l>0&&e[c-1]||(i+=o?r(`M`,l+n,.5+u+n):r(`m`,a,0),a=0,o=!1),l+1<t&&e[c+1]||(i+=r(`h`,s),s=0)):a++}return i}e.render=function(e,r,a){let o=t.getOptions(r),s=e.modules.size,c=e.modules.data,l=s+o.margin*2,u=o.color.light.a?`<path `+n(o.color.light,`fill`)+` d="M0 0h`+l+`v`+l+`H0z"/>`:``,d=`<path `+n(o.color.dark,`stroke`)+` d="`+i(c,s,o.margin)+`"/>`,f=`viewBox="0 0 `+l+` `+l+`"`,p=`<svg xmlns="http://www.w3.org/2000/svg" `+(o.width?`width="`+o.width+`" height="`+o.width+`" `:``)+f+` shape-rendering="crispEdges">`+u+d+`</svg>
8
- `;return typeof a==`function`&&a(null,p),p}})),Qe=t((e=>{var t=Ae(),n=Je(),r=Xe(),i=Ze();function a(e,r,i,a,o){let s=[].slice.call(arguments,1),c=s.length,l=typeof s[c-1]==`function`;if(!l&&!t())throw Error(`Callback required as last argument`);if(l){if(c<2)throw Error(`Too few arguments provided`);c===2?(o=i,i=r,r=a=void 0):c===3&&(r.getContext&&o===void 0?(o=a,a=void 0):(o=a,a=i,i=r,r=void 0))}else{if(c<1)throw Error(`Too few arguments provided`);return c===1?(i=r,r=a=void 0):c===2&&!r.getContext&&(a=i,i=r,r=void 0),new Promise(function(t,o){try{t(e(n.create(i,a),r,a))}catch(e){o(e)}})}try{let t=n.create(i,a);o(null,e(t,r,a))}catch(e){o(e)}}e.create=n.create,e.toCanvas=a.bind(null,r.render),e.toDataURL=a.bind(null,r.renderToDataURL),e.toString=a.bind(null,function(e,t,n){return i.render(e,n)})}))();function $e(){return _({mutationFn:({channel:e,data:t})=>y(e,t)})}function et(){return _({mutationFn:({channel:e,data:t})=>m(e,t)})}function tt(){return _({mutationFn:({channel:e,data:t})=>f(e,t)})}var nt={weixin:{title:`weixinAuthTitle`,description:`weixinAuthDescription`,hint:`weixinAuthHint`,capabilityHint:`weixinAuthCapabilityHint`,disabledHint:`weixinAuthDisabledHint`,connect:`weixinAuthConnect`,qrAlt:`weixinAuthQrAlt`,scanPrompt:`weixinAuthScanPrompt`,readyTitle:`weixinAuthReadyTitle`,readyDescription:`weixinAuthReadyDescription`,advancedTitle:`weixinAuthAdvancedTitle`,advancedDescription:`weixinAuthAdvancedDescription`},feishu:{title:`feishuAuthTitle`,description:`feishuAuthDescription`,hint:`feishuAuthHint`,capabilityHint:`feishuAuthCapabilityHint`,disabledHint:`feishuAuthDisabledHint`,connect:`feishuAuthConnect`,qrAlt:`feishuAuthQrAlt`,scanPrompt:`feishuAuthScanPrompt`,readyTitle:`feishuAuthReadyTitle`,readyDescription:`feishuAuthReadyDescription`,advancedTitle:`feishuAuthAdvancedTitle`,advancedDescription:`feishuAuthAdvancedDescription`,domainLabel:`feishuAuthDomain`}};function rt(e){let{accounts:t}=e,n=new Set;if(typeof e.defaultAccountId==`string`&&e.defaultAccountId.trim()&&n.add(e.defaultAccountId.trim()),t&&typeof t==`object`&&!Array.isArray(t))for(let e of Object.keys(t)){let t=e.trim();t&&n.add(t)}return[...n]}function it(e,t){if(typeof e.baseUrl==`string`&&e.baseUrl.trim())return e.baseUrl.trim();if(typeof t.baseUrl==`string`&&t.baseUrl.trim())return t.baseUrl.trim()}function at(e,t){return(typeof e.domain==`string`?e.domain.trim():``)||(typeof t.domain==`string`?t.domain.trim():``)||void 0}function ot(e,t){return at(e,t)===`lark`?`lark`:`feishu`}function st(e){return e===`lark`?`https://open.larksuite.com/app`:`https://open.feishu.cn/app`}function ct(e,t){return g({queryKey:[`channel-qr`,e,t],enabled:!!t,queryFn:()=>(0,Qe.toDataURL)(t,{errorCorrectionLevel:`M`,margin:1,width:480})}).data??null}function lt({activeSession:e,baseUrl:t,channelEnabled:n,copy:r,connectButtonLabel:i,connectedAccountIds:s,disabled:c,domain:l,handleStartAuth:u,hasConnectedAccount:d,primaryAccountId:f,statusLabel:p}){return(0,U.jsxs)(`div`,{className:`space-y-3`,children:[(0,U.jsxs)(`div`,{className:`inline-flex items-center gap-2 rounded-full bg-white/90 px-3 py-1 text-xs font-medium text-primary shadow-sm`,children:[(0,U.jsx)(V,{className:`h-3.5 w-3.5`}),o(r.title)]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h4`,{className:`text-base font-semibold text-gray-900`,children:o(r.description)}),(0,U.jsx)(`p`,{className:`mt-1 text-sm text-gray-600`,children:o(r.hint)})]}),(0,U.jsxs)(`div`,{className:a(`inline-flex w-fit items-center gap-2 rounded-full px-3 py-1 text-xs font-medium`,e?`bg-amber-50 text-amber-700`:d?`bg-emerald-50 text-emerald-700`:`bg-gray-100 text-gray-600`),children:[e?(0,U.jsx)(re,{className:`h-3.5 w-3.5 animate-spin`}):(0,U.jsx)(B,{className:`h-3.5 w-3.5`}),p]}),(0,U.jsxs)(`div`,{className:`space-y-1 text-sm text-gray-600`,children:[(0,U.jsx)(`p`,{children:o(n||!d?r.capabilityHint:r.disabledHint)}),f?(0,U.jsxs)(`p`,{children:[o(`weixinAuthPrimaryAccount`),`: `,(0,U.jsx)(`span`,{className:`font-mono text-xs text-gray-900`,children:f})]}):null,s.length>1?(0,U.jsxs)(`p`,{children:[o(`weixinAuthConnectedAccounts`),`: `,(0,U.jsx)(`span`,{className:`font-mono text-xs text-gray-900`,children:s.join(`, `)})]}):null,t?(0,U.jsxs)(`p`,{children:[o(`weixinAuthBaseUrl`),`: `,(0,U.jsx)(`span`,{className:`font-mono text-xs text-gray-900`,children:t})]}):null,l&&r.domainLabel?(0,U.jsxs)(`p`,{children:[o(r.domainLabel),`: `,(0,U.jsx)(`span`,{className:`font-mono text-xs text-gray-900`,children:l})]}):null]}),(0,U.jsx)(b,{type:`button`,onClick:()=>void u(),disabled:c,className:`rounded-xl`,children:i})]})}function ut({activeSession:e,authMessage:t,copy:n,qrDataUrl:r}){return(0,U.jsx)(`div`,{className:`w-full max-w-sm rounded-2xl border border-dashed border-primary/25 bg-white/85 p-4 shadow-sm`,children:e?(0,U.jsxs)(`div`,{className:`space-y-3`,children:[(0,U.jsx)(`div`,{className:`overflow-hidden rounded-2xl border border-gray-100 bg-white p-3`,children:r?(0,U.jsx)(`img`,{src:r,alt:o(n.qrAlt),className:`mx-auto aspect-square w-full max-w-[240px] object-contain`}):(0,U.jsx)(`div`,{className:`flex aspect-square w-full items-center justify-center rounded-xl bg-gray-50 text-gray-500`,children:(0,U.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-center`,children:[(0,U.jsx)(re,{className:`h-5 w-5 animate-spin`}),(0,U.jsx)(`p`,{className:`text-xs`,children:o(`weixinAuthStarting`)})]})})}),(0,U.jsxs)(`div`,{className:`space-y-1 text-xs text-gray-500`,children:[(0,U.jsx)(`p`,{children:t||e.note||o(n.scanPrompt)}),(0,U.jsxs)(`p`,{children:[o(`weixinAuthExpiresAt`),`: `,s(e.expiresAt)]})]}),(0,U.jsx)(u,{href:e.qrCodeUrl,external:!0,size:`xs`,children:o(`weixinAuthOpenQr`)})]}):(0,U.jsxs)(`div`,{className:`flex min-h-[280px] flex-col items-center justify-center rounded-2xl bg-gray-50/80 px-6 text-center`,children:[(0,U.jsx)(V,{className:`h-9 w-9 text-gray-300`}),(0,U.jsx)(`p`,{className:`mt-3 text-sm font-medium text-gray-700`,children:o(n.readyTitle)}),(0,U.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-gray-500`,children:o(n.readyDescription)})]})})}function dt({channelConfig:e,channelEnabled:t,channelName:n,disabled:r,formData:i}){let a=d(),s=$e(),c=et(),[l,u]=(0,H.useState)(null),[f,p]=(0,H.useState)(null),[m,h]=(0,H.useState)(!1),g=(0,H.useMemo)(()=>rt(e),[e]),_=g[0],v=it(i,e),y=n===`feishu`?at(i,e):void 0,b=g.length>0,S=b&&!m?null:l,C=ct(n,S?.qrCodeUrl),w=nt[n];(0,H.useEffect)(()=>{if(!S)return;let e=!1,t=null,r=async()=>{try{let i=await c.mutateAsync({channel:n,data:{sessionId:S.sessionId}});if(e)return;if(p(i),i.status===`authorized`){await a.invalidateQueries({queryKey:[`config`]}),await a.invalidateQueries({queryKey:[`config-meta`]}),x.success(i.message||o(`weixinAuthAuthorized`)),u(null);return}if(i.status===`expired`||i.status===`error`){x.error(i.message||o(`weixinAuthRetryRequired`)),u(null);return}t=setTimeout(r,i.nextPollMs??S.intervalMs)}catch(t){e||(x.error(`${o(`error`)}: ${t instanceof Error?t.message:String(t)}`),u(null))}};return t=setTimeout(r,S.intervalMs),()=>{e=!0,t&&clearTimeout(t)}},[n,S,c,a]);let T=async()=>{try{let e=await s.mutateAsync({channel:n,data:{baseUrl:v,domain:y,accountId:typeof i.defaultAccountId==`string`&&i.defaultAccountId.trim()?i.defaultAccountId.trim():void 0}});h(b),u(e),p({channel:n,status:`pending`,message:e.note,nextPollMs:e.intervalMs})}catch(e){x.error(`${o(`error`)}: ${e instanceof Error?e.message:String(e)}`)}},E=S?f?.status===`scanned`?o(`weixinAuthScanned`):o(`weixinAuthWaiting`):o(b?t?`weixinAuthAuthorized`:`weixinAuthConnectedDisabled`:`weixinAuthNotConnected`),D=s.isPending?o(`weixinAuthStarting`):o(S?`weixinAuthWaiting`:b?`weixinAuthReconnect`:w.connect),O=b?o(`weixinAuthAuthorized`):f?.message;return(0,U.jsx)(`section`,{className:`rounded-2xl border border-primary/20 bg-gradient-to-br from-primary-50/70 via-white to-emerald-50/60 p-5`,children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between`,children:[(0,U.jsx)(lt,{activeSession:S,baseUrl:v,channelEnabled:t,copy:w,connectButtonLabel:D,connectedAccountIds:g,disabled:r||s.isPending||!!S,domain:y,handleStartAuth:T,hasConnectedAccount:b,primaryAccountId:_,statusLabel:E}),(0,U.jsx)(ut,{activeSession:S,authMessage:O,copy:w,qrDataUrl:C})]})})}function ft({channelConfig:e,disabled:t,formData:n}){let r=d(),i=tt(),[a,s]=(0,H.useState)(()=>ot(n,e)),[c,l]=(0,H.useState)(``),[f,p]=(0,H.useState)(``),m=st(a),g=!!(c.trim()&&f.trim())&&!t&&!i.isPending,_=async()=>{try{let e=await i.mutateAsync({channel:`feishu`,data:{domain:a,fields:{appId:c.trim(),appSecret:f.trim()}}});await r.invalidateQueries({queryKey:[`config`]}),await r.invalidateQueries({queryKey:[`config-meta`]}),x.success(e.message||o(`feishuExistingAgentConnectSuccess`)),p(``)}catch(e){x.error(`${o(`error`)}: ${e instanceof Error?e.message:String(e)}`)}};return(0,U.jsx)(`section`,{className:`rounded-2xl border border-primary/20 bg-white p-5`,children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between`,children:[(0,U.jsxs)(`div`,{className:`max-w-xl space-y-3`,children:[(0,U.jsxs)(`div`,{className:`inline-flex items-center gap-2 rounded-full bg-gray-100 px-3 py-1 text-xs font-medium text-gray-700`,children:[(0,U.jsx)(B,{className:`h-3.5 w-3.5`}),o(`feishuExistingAgentTitle`)]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h4`,{className:`text-base font-semibold text-gray-900`,children:o(`feishuExistingAgentDescription`)}),(0,U.jsx)(`p`,{className:`mt-1 text-sm text-gray-600`,children:o(`feishuExistingAgentHint`)})]}),(0,U.jsx)(u,{href:m,external:!0,children:o(a===`lark`?`feishuExistingAgentOpenLarkList`:`feishuExistingAgentOpenFeishuList`)})]}),(0,U.jsxs)(`div`,{className:`w-full max-w-sm space-y-4`,children:[(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsx)(S,{htmlFor:`feishu-existing-platform`,children:o(`feishuPlatform`)}),(0,U.jsxs)(ee,{value:a,onValueChange:e=>s(e===`lark`?`lark`:`feishu`),children:[(0,U.jsx)(E,{id:`feishu-existing-platform`,className:`rounded-xl`,children:(0,U.jsx)(T,{})}),(0,U.jsxs)(D,{children:[(0,U.jsx)(O,{value:`feishu`,children:`Feishu`}),(0,U.jsx)(O,{value:`lark`,children:`Lark`})]})]})]}),(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsx)(S,{htmlFor:`feishu-existing-app-id`,children:`App ID`}),(0,U.jsx)(h,{id:`feishu-existing-app-id`,value:c,onChange:e=>l(e.target.value),className:`rounded-xl`})]}),(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsx)(S,{htmlFor:`feishu-existing-app-secret`,children:`App Secret`}),(0,U.jsx)(h,{id:`feishu-existing-app-secret`,type:`password`,value:f,onChange:e=>p(e.target.value),className:`rounded-xl`})]}),(0,U.jsx)(b,{type:`button`,onClick:()=>void _(),disabled:!g,className:`w-full rounded-xl`,children:i.isPending?o(`feishuExistingAgentConnecting`):o(`feishuExistingAgentConnect`)})]})]})})}function pt(e){let[t,n]=(0,H.useState)(`create`);return(0,U.jsxs)(M,{value:t,onValueChange:e=>n(e===`existing`?`existing`:`create`),children:[(0,U.jsxs)(I,{children:[(0,U.jsx)(A,{value:`create`,children:o(`feishuAuthCreateNew`)}),(0,U.jsx)(A,{value:`existing`,children:o(`feishuAuthConnectExisting`)})]}),(0,U.jsx)(N,{value:`create`,className:`mt-4`,children:(0,U.jsx)(dt,{...e,channelName:`feishu`})}),(0,U.jsx)(N,{value:`existing`,className:`mt-4`,children:(0,U.jsx)(ft,{...e})})]})}var mt=[{value:`pairing`,label:`pairing`},{value:`allowlist`,label:`allowlist`},{value:`open`,label:`open`},{value:`disabled`,label:`disabled`}],Y=[{value:`open`,label:`open`},{value:`allowlist`,label:`allowlist`},{value:`disabled`,label:`disabled`}],ht=[{value:`feishu`,label:`feishu`},{value:`lark`,label:`lark`}],gt=[{value:`off`,label:`off`},{value:`partial`,label:`partial`},{value:`block`,label:`block`},{value:`progress`,label:`progress`}];function _t(){return{fields:[{name:`enabled`,type:`boolean`,label:o(`enabled`),section:`primary`},{name:`defaultAccountId`,type:`text`,label:o(`defaultAccountId`)},{name:`domain`,type:`select`,label:o(`feishuAuthDomain`),options:ht},{name:`allowFrom`,type:`tags`,label:o(`allowFrom`)},{name:`groupPolicy`,type:`select`,label:o(`groupPolicy`),options:Y},{name:`requireMention`,type:`boolean`,label:o(`requireMention`)},{name:`accounts`,type:`json`,label:o(`accountsJson`)}],layout:[{type:`fields`,section:`primary`},{type:`custom`,sectionId:`feishu-auth`},{type:`fields`,section:`advanced`,collapsible:{title:o(`feishuAuthAdvancedTitle`),description:o(`feishuAuthAdvancedDescription`)}}]}}function vt(){return{telegram:{fields:[{name:`enabled`,type:`boolean`,label:o(`enabled`)},{name:`token`,type:`password`,label:o(`botToken`)},{name:`allowFrom`,type:`tags`,label:o(`allowFrom`)},{name:`proxy`,type:`text`,label:o(`proxy`)},{name:`accountId`,type:`text`,label:o(`accountId`)},{name:`dmPolicy`,type:`select`,label:o(`dmPolicy`),options:mt},{name:`groupPolicy`,type:`select`,label:o(`groupPolicy`),options:Y},{name:`groupAllowFrom`,type:`tags`,label:o(`groupAllowFrom`)},{name:`requireMention`,type:`boolean`,label:o(`requireMention`)},{name:`mentionPatterns`,type:`tags`,label:o(`mentionPatterns`)},{name:`groups`,type:`json`,label:o(`groupRulesJson`)}]},discord:{fields:[{name:`enabled`,type:`boolean`,label:o(`enabled`)},{name:`token`,type:`password`,label:o(`botToken`)},{name:`allowBots`,type:`boolean`,label:o(`allowBotMessages`)},{name:`allowFrom`,type:`tags`,label:o(`allowFrom`)},{name:`gatewayUrl`,type:`text`,label:o(`gatewayUrl`)},{name:`intents`,type:`number`,label:o(`intents`)},{name:`proxy`,type:`text`,label:o(`proxy`)},{name:`mediaMaxMb`,type:`number`,label:o(`attachmentMaxSizeMb`)},{name:`streaming`,type:`select`,label:o(`streamingMode`),options:gt},{name:`draftChunk`,type:`json`,label:o(`draftChunkingJson`)},{name:`textChunkLimit`,type:`number`,label:o(`textChunkLimit`)},{name:`accountId`,type:`text`,label:o(`accountId`)},{name:`dmPolicy`,type:`select`,label:o(`dmPolicy`),options:mt},{name:`groupPolicy`,type:`select`,label:o(`groupPolicy`),options:Y},{name:`groupAllowFrom`,type:`tags`,label:o(`groupAllowFrom`)},{name:`requireMention`,type:`boolean`,label:o(`requireMention`)},{name:`mentionPatterns`,type:`tags`,label:o(`mentionPatterns`)},{name:`groups`,type:`json`,label:o(`groupRulesJson`)}]},whatsapp:{fields:[{name:`enabled`,type:`boolean`,label:o(`enabled`)},{name:`bridgeUrl`,type:`text`,label:o(`bridgeUrl`)},{name:`allowFrom`,type:`tags`,label:o(`allowFrom`)}]},feishu:_t(),dingtalk:{fields:[{name:`enabled`,type:`boolean`,label:o(`enabled`)},{name:`clientId`,type:`text`,label:o(`clientId`)},{name:`clientSecret`,type:`password`,label:o(`clientSecret`)},{name:`allowFrom`,type:`tags`,label:o(`allowFrom`)}]},wecom:{fields:[{name:`enabled`,type:`boolean`,label:o(`enabled`)},{name:`corpId`,type:`text`,label:o(`corpId`)},{name:`agentId`,type:`text`,label:o(`agentId`)},{name:`secret`,type:`password`,label:o(`secret`)},{name:`token`,type:`password`,label:o(`token`)},{name:`callbackPort`,type:`number`,label:o(`callbackPort`)},{name:`callbackPath`,type:`text`,label:o(`callbackPath`)},{name:`allowFrom`,type:`tags`,label:o(`allowFrom`)}]},weixin:{fields:[{name:`enabled`,type:`boolean`,label:o(`enabled`),section:`primary`},{name:`defaultAccountId`,type:`text`,label:o(`defaultAccountId`)},{name:`baseUrl`,type:`text`,label:o(`baseUrl`)},{name:`pollTimeoutMs`,type:`number`,label:o(`pollTimeoutMs`)},{name:`allowFrom`,type:`tags`,label:o(`allowFrom`)},{name:`accounts`,type:`json`,label:o(`accountsJson`)}],layout:[{type:`fields`,section:`primary`},{type:`custom`,sectionId:`weixin-auth`},{type:`fields`,section:`advanced`,collapsible:{title:o(`weixinAuthAdvancedTitle`),description:o(`weixinAuthAdvancedDescription`)}}]},slack:{fields:[{name:`enabled`,type:`boolean`,label:o(`enabled`)},{name:`mode`,type:`text`,label:o(`mode`)},{name:`webhookPath`,type:`text`,label:o(`webhookPath`)},{name:`allowBots`,type:`boolean`,label:o(`allowBotMessages`)},{name:`botToken`,type:`password`,label:o(`botToken`)},{name:`appToken`,type:`password`,label:o(`appToken`)}]},email:{fields:[{name:`enabled`,type:`boolean`,label:o(`enabled`)},{name:`consentGranted`,type:`boolean`,label:o(`consentGranted`)},{name:`imapHost`,type:`text`,label:o(`imapHost`)},{name:`imapPort`,type:`number`,label:o(`imapPort`)},{name:`imapUsername`,type:`text`,label:o(`imapUsername`)},{name:`imapPassword`,type:`password`,label:o(`imapPassword`)},{name:`fromAddress`,type:`email`,label:o(`fromAddress`)}]},qq:{fields:[{name:`enabled`,type:`boolean`,label:o(`enabled`)},{name:`appId`,type:`text`,label:o(`appId`)},{name:`secret`,type:`password`,label:o(`appSecret`)},{name:`markdownSupport`,type:`boolean`,label:o(`markdownSupport`)},{name:`allowFrom`,type:`tags`,label:o(`allowFrom`)}]}}}function yt(e){let t=c();return e.tutorialUrls?.[t]||e.tutorialUrls?.default||e.tutorialUrl}var bt=[],xt=[{type:`fields`,section:`all`}],X=new Set,Z=new Map,Q=null;function $(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function St(e,t){let n={...e};for(let[e,r]of Object.entries(t))n[e]=$(n[e])&&$(r)?St(n[e],r):r;return n}function Ct(e,t){let n={},r=n,i=e.split(`.`);for(let e=0;e<i.length-1;e+=1)r[i[e]]={},r=r[i[e]];return r[i[i.length-1]]=t,n}function wt(e,t){return t===`all`?e:e.filter(e=>t===`primary`?e.section===`primary`:e.section!==`primary`)}function Tt(e,t){let n={};return t.filter(e=>e.type===`json`).forEach(t=>{n[t.name]=JSON.stringify(e[t.name]??{},null,2)}),n}function Et(){Q||=p.eventBus.on(r.channelConfigApplyStatus,e=>{Z.set(e.channel,e.status===`started`?{status:`applying`}:e.status===`succeeded`?{status:`applied`}:{status:`failed`,message:e.message}),X.forEach(e=>e())})}function Dt(e){return X.add(e),Et(),()=>{X.delete(e),!X.size&&Q&&(Q(),Q=null,Z.clear())}}function Ot(e){return(0,H.useSyncExternalStore)(Dt,()=>e?Z.get(e)??null:null,()=>null)}function kt(e){return e?e.status===`applying`?{className:`text-amber-600`,label:o(`channelConfigApplying`)}:e.status===`applied`?{className:`text-emerald-600`,label:o(`channelConfigApplied`)}:{className:`text-red-600`,label:`${o(`channelConfigApplyFailed`)}${e.message?`: ${e.message}`:``}`}:null}function At({channelApplyStatus:e,channelLabel:t,channelName:n,enabled:r,tutorialUrl:i}){return(0,U.jsx)(R,{className:`px-5 py-4`,children:(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsx)(se,{name:n,src:j(n),className:a(`h-9 w-9 rounded-lg bg-background/80`,r&&`ring-1 ring-primary/20`),imgClassName:`h-5 w-5 object-contain`,fallback:(0,U.jsx)(`span`,{className:`text-sm font-semibold uppercase text-muted-foreground`,children:n[0]})}),(0,U.jsx)(`h3`,{className:`truncate text-lg font-semibold text-foreground capitalize`,children:t})]}),(0,U.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:o(`channelsFormDescription`)}),e?(0,U.jsx)(`p`,{className:a(`mt-2 text-xs font-medium`,e.className),children:e.label}):null,i?(0,U.jsx)(u,{href:i,external:!0,icon:ne,size:`xs`,className:`mt-2`,children:o(`channelsGuideTitle`)}):null]}),(0,U.jsx)(le,{status:r?`active`:`inactive`,label:o(r?`statusActive`:`statusInactive`)})]})})}function jt({channelConfig:e,channelName:t,disabled:n,enabled:r,fields:i,formData:a,jsonDrafts:o,layoutBlocks:s,setJsonDrafts:c,uiHints:l,updateField:u}){return(0,U.jsx)(U.Fragment,{children:s.map((s,d)=>{if(s.type===`fields`){let e=wt(i,s.section);if(e.length===0)return null;let n=(0,U.jsx)(ke,{channelName:t,fields:e,formData:a,jsonDrafts:o,setJsonDrafts:c,updateField:u,uiHints:l});return s.collapsible?(0,U.jsxs)(`details`,{className:`group rounded-xl bg-muted/35`,children:[(0,U.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-3 px-4 py-3 text-sm font-medium text-foreground`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{children:s.collapsible.title}),s.collapsible.description?(0,U.jsx)(`p`,{className:`mt-1 text-xs font-normal text-muted-foreground`,children:s.collapsible.description}):null]}),(0,U.jsx)(w,{className:`h-4 w-4 text-muted-foreground transition-transform group-open:rotate-180`})]}),(0,U.jsx)(`div`,{className:`space-y-5 border-t border-border/45 px-4 py-4`,children:n})]},`${s.type}-${s.section}-${d}`):(0,U.jsx)(`div`,{children:n},`${s.type}-${s.section}-${d}`)}return s.sectionId===`feishu-auth`?(0,U.jsx)(pt,{channelConfig:e,formData:a,channelEnabled:r,disabled:n},`${s.type}-${s.sectionId}-${d}`):s.sectionId===`weixin-auth`?(0,U.jsx)(dt,{channelConfig:e,formData:a,channelName:`weixin`,channelEnabled:r,disabled:n},`${s.type}-${s.sectionId}-${d}`):null})})}function Mt({actions:e,channelConfig:t,channelLabel:n,channelName:r,fields:i,layoutBlocks:a,tutorialUrl:s,uiHints:c}){let l=oe(),u=pe(),[d,f]=(0,H.useState)(()=>({...t})),[p,m]=(0,H.useState)(()=>Tt(t,i)),[h,g]=(0,H.useState)(null),_=kt(Ot(r)),v=typeof d.enabled==`boolean`?d.enabled:!!t.enabled,y=l.isPending||!!h,S=(e,t)=>f(n=>({...n,[e]:t})),C=e=>{e.preventDefault();let t={...d};for(let e of i){if(e.type===`password`){let n=t[e.name];(typeof n!=`string`||n.length===0)&&delete t[e.name]}if(e.type===`json`)try{t[e.name]=(p[e.name]??``).trim()?JSON.parse(p[e.name]):{}}catch{x.error(`${o(`invalidJson`)}: ${e.name}`);return}}l.mutate({channel:r,data:t})},w=e=>{if(!$(e?.channels)||!$(e.channels[r]))return;let t=e.channels[r];f(e=>St(e,t)),m(e=>{let n={...e},r=!1;for(let e of i)e.type!==`json`||!Object.prototype.hasOwnProperty.call(t,e.name)||(n[e.name]=JSON.stringify(t[e.name]??{},null,2),r=!0);return r?n:e})},T=async e=>{g(e.id);try{let t=`channels.${r}`,n={...d};e.saveBeforeRun&&(n={...n,...e.savePatch??{}},f(n),await l.mutateAsync({channel:r,data:n}));let i=await u.mutateAsync({actionId:e.id,data:{scope:t,draftConfig:Ct(t,n)}});w(i.patch),i.ok?x.success(i.message||o(`success`)):x.error(i.message||o(`error`))}catch(e){x.error(`${o(`error`)}: ${e instanceof Error?e.message:String(e)}`)}finally{g(null)}};return(0,U.jsxs)(be,{children:[(0,U.jsx)(At,{channelName:r,channelLabel:n,enabled:v,tutorialUrl:s,channelApplyStatus:_}),(0,U.jsxs)(`form`,{onSubmit:C,className:`flex min-h-0 flex-1 flex-col`,children:[(0,U.jsx)(z,{className:`space-y-5 px-5 py-4`,children:(0,U.jsx)(jt,{channelConfig:t,channelName:r,enabled:v,fields:i,formData:d,jsonDrafts:p,layoutBlocks:a,setJsonDrafts:m,uiHints:c,updateField:S,disabled:y})}),(0,U.jsx)(Se,{children:(0,U.jsxs)(ge,{align:`between`,children:[(0,U.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:e.filter(e=>e.trigger===`manual`).map(e=>(0,U.jsx)(b,{type:`button`,size:`sm`,onClick:()=>void T(e),disabled:y,variant:`secondary`,children:h===e.id?o(`connecting`):e.title},e.id))}),(0,U.jsx)(b,{type:`submit`,size:`sm`,disabled:y,children:l.isPending?o(`saving`):o(`save`)})]})})]})]})}function Nt({channelName:e}){let{data:t}=P(),{data:n}=F(),{data:r}=ue(),i=e?t?.channels[e]??null:null,a=n?.channels.find(t=>t.name===e),s=(0,H.useMemo)(()=>vt()[e||``],[e]);if(!e||!a||!i)return(0,U.jsx)(xe,{children:(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{className:`text-base font-semibold text-foreground`,children:o(`channelsSelectTitle`)}),(0,U.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:o(`channelsSelectDescription`)})]})});let c=s?.fields??bt,l=s?.layout??xt,u=r?.uiHints,d=L(`channels.${e}`,u)?.label??e,f=yt(a),p=JSON.stringify({channelName:e,channelConfig:i,jsonFields:c.filter(e=>e.type===`json`).map(e=>e.name)});return(0,U.jsx)(Mt,{actions:r?.actions?.filter(t=>t.scope===`channels.${e}`)??[],channelConfig:i,channelLabel:d,channelName:e,fields:c,layoutBlocks:l,tutorialUrl:f,uiHints:u},p)}var Pt={telegram:`channelDescTelegram`,slack:`channelDescSlack`,email:`channelDescEmail`,webhook:`channelDescWebhook`,discord:`channelDescDiscord`,feishu:`channelDescFeishu`,weixin:`channelDescWeixin`},Ft=[`weixin`,`feishu`,`discord`,`qq`];function It(e){let t=new Map(Ft.map((e,t)=>[e,t]));return e.map((e,t)=>({channel:e,index:t})).sort((e,n)=>{let r=t.get(e.channel.name)??1/0,i=t.get(n.channel.name)??1/0;return r===i?e.index-n.index:r-i}).map(({channel:e})=>e)}function Lt(){let{isMobile:e}=ce(),{data:t}=P(),{data:n}=F(),{data:r}=ue(),[i,s]=(0,H.useState)(`enabled`),[c,u]=(0,H.useState)(null),[d,f]=(0,H.useState)(``),p=(0,H.useMemo)(()=>It(n?.channels??[]),[n?.channels]),m=t?.channels,g=(0,H.useMemo)(()=>{let e=d.trim().toLowerCase();return p.filter(e=>i!==`enabled`||!!m?.[e.name]?.enabled).filter(t=>e?(t.displayName||t.name).toLowerCase().includes(e)||t.name.toLowerCase().includes(e):!0)},[i,m,p,d]),_=c&&g.some(e=>e.name===c)?c:e?null:g[0]?.name??null;return!t||!n?(0,U.jsx)(v,{title:o(`channelsPageTitle`),description:o(`channelsPageDescription`),layout:`split`,children:(0,U.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:o(`channelsLoading`)})}):(0,U.jsx)(v,{title:o(`channelsPageTitle`),description:o(`channelsPageDescription`),layout:`split`,children:(0,U.jsxs)(_e,{className:`md:min-h-0`,compactView:c?`detail`:`list`,onMobileBack:()=>u(null),mobileListLabel:o(`channelsPageTitle`),children:[(0,U.jsxs)(ye,{children:[(0,U.jsx)(R,{className:`px-4 pt-4`,children:(0,U.jsx)(M,{value:i,onValueChange:s,children:(0,U.jsxs)(I,{className:`mb-0 h-auto gap-3 border-b-0 bg-transparent p-0`,children:[(0,U.jsxs)(A,{value:`enabled`,className:`gap-1.5 px-0 pb-3`,children:[o(`channelsTabEnabled`),(0,U.jsx)(`span`,{className:`text-[11px] font-medium text-gray-500`,children:p.filter(e=>m?.[e.name]?.enabled).length})]}),(0,U.jsxs)(A,{value:`all`,className:`gap-1.5 px-0 pb-3`,children:[o(`channelsTabAll`),(0,U.jsx)(`span`,{className:`text-[11px] font-medium text-gray-500`,children:p.length})]})]})})}),(0,U.jsx)(`div`,{className:`border-b border-border/55 px-4 py-3`,children:(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsx)(te,{className:`pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground/70`}),(0,U.jsx)(h,{value:d,onChange:e=>f(e.target.value),placeholder:o(`channelsFilterPlaceholder`),className:`h-10 rounded-xl pl-9`})]})}),(0,U.jsxs)(z,{className:`space-y-2 p-3`,children:[g.map(e=>{let n=!!t.channels[e.name]?.enabled,i=yt(e),s=L(`channels.${e.name}`,r?.uiHints)?.help||o(Pt[e.name]||`channelDescriptionDefault`);return(0,U.jsx)(Ce,{onClick:()=>u(e.name),active:_===e.name,children:(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,U.jsx)(se,{name:e.name,src:j(e.name),className:a(`h-10 w-10 rounded-lg bg-background/80`,n&&`ring-1 ring-primary/20`),imgClassName:`h-5 w-5 object-contain`,fallback:(0,U.jsx)(`span`,{className:`text-sm font-semibold uppercase text-muted-foreground`,children:e.name[0]})}),(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`p`,{className:`truncate text-sm font-semibold text-foreground`,children:e.displayName||e.name}),(0,U.jsx)(`p`,{className:`line-clamp-1 text-[11px] text-muted-foreground`,children:s})]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[i?(0,U.jsx)(`a`,{href:i,onClick:e=>e.stopPropagation(),className:`inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground/45 transition-colors hover:bg-muted hover:text-foreground`,title:o(`channelsGuideTitle`),children:(0,U.jsx)(l,{className:`h-3.5 w-3.5`})}):null,(0,U.jsx)(le,{status:n?`active`:`inactive`,label:o(n?`statusActive`:`statusInactive`),className:`min-w-[56px] justify-center`})]})]})},e.name)}),g.length===0?(0,U.jsx)(ve,{icon:me,title:o(`channelsNoMatch`)}):null]})]}),(0,U.jsx)(Nt,{channelName:_??void 0})]})})}export{Lt as ChannelsList};
@@ -1 +0,0 @@
1
- import{i as e}from"./chunk-DseTPa7n.js";import{B as t,H as n,L as r,S as i,V as a,a as o,m as s}from"./react-DVMmnPWz.js";import{t as c}from"./navigation-link-BwWrm4k1.js";import{a as l,b as u,c as d,d as f,h as p,i as m,l as h,m as g,o as _,p as v,r as y,s as b,t as x,v as S,y as C}from"./dist-CXN62DSs.js";import{t as w}from"./dist-DdE-kCbi.js";import{t as T}from"./createLucideIcon-B_8khHn8.js";import{n as ee,t as te}from"./search-D6pX7FC-.js";import{t as E}from"./book-open-BhTIpBKg.js";import{t as D}from"./plus-DbeE4r-Q.js";import{t as O}from"./refresh-cw-B7NmPJ_Z.js";import{t as k}from"./x-DThaS5ZL.js";import{_ as ne,d as re,g as A,m as j,n as ie,p as ae}from"./doc-browser-context-B8NCuMv5.js";var M=T(`AppWindow`,[[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}],[`path`,{d:`M10 4v4`,key:`pp8u80`}],[`path`,{d:`M2 8h20`,key:`d11cs7`}],[`path`,{d:`M6 4v4`,key:`1svtjw`}]]),N=T(`ArrowRight`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),P=T(`Boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),F=T(`EllipsisVertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),I=T(`Github`,[[`path`,{d:`M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4`,key:`tonef`}],[`path`,{d:`M9 18c-4.51 2-5-2-7-2`,key:`9comsn`}]]),oe=T(`GripVertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),se=T(`PanelRightOpen`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]),ce=T(`PictureInPicture2`,[[`path`,{d:`M21 9V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h4`,key:`daa4of`}],[`rect`,{width:`10`,height:`7`,x:`12`,y:`13`,rx:`2`,key:`1nb8gs`}]]),le=T(`PinOff`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]),L=T(`Pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),R=e(n(),1),z=t(),[B,ue]=S(`Tooltip`,[b]),V=b(),de=`TooltipProvider`,fe=700,pe=`tooltip.open`,[me,H]=B(de),U=e=>{let{__scopeTooltip:t,delayDuration:n=fe,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=R.useRef(!0),s=R.useRef(!1),c=R.useRef(0);return R.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,z.jsx)(me,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:R.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:R.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:R.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};U.displayName=de;var W=`Tooltip`,[he,G]=B(W),K=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=H(W,e.__scopeTooltip),l=V(t),[u,d]=R.useState(null),f=p(),m=R.useRef(0),h=o??c.disableHoverableContent,v=s??c.delayDuration,y=R.useRef(!1),[b,x]=g({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(pe))):c.onClose(),a?.(e)},caller:W}),S=R.useMemo(()=>b?y.current?`delayed-open`:`instant-open`:`closed`,[b]),C=R.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y.current=!1,x(!0)},[x]),w=R.useCallback(()=>{window.clearTimeout(m.current),m.current=0,x(!1)},[x]),T=R.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{y.current=!0,x(!0),m.current=0},v)},[v,x]);return R.useEffect(()=>()=>{m.current&&=(window.clearTimeout(m.current),0)},[]),(0,z.jsx)(_,{...l,children:(0,z.jsx)(he,{scope:t,contentId:f,open:b,stateAttribute:S,trigger:u,onTriggerChange:d,onTriggerEnter:R.useCallback(()=>{c.isOpenDelayedRef.current?T():C()},[c.isOpenDelayedRef,T,C]),onTriggerLeave:R.useCallback(()=>{h?w():(window.clearTimeout(m.current),m.current=0)},[w,h]),onOpen:C,onClose:w,disableHoverableContent:h,children:n})})};K.displayName=W;var q=`TooltipTrigger`,ge=R.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=G(q,n),a=H(q,n),o=V(n),s=C(t,R.useRef(null),i.onTriggerChange),c=R.useRef(!1),l=R.useRef(!1),d=R.useCallback(()=>c.current=!1,[]);return R.useEffect(()=>()=>document.removeEventListener(`pointerup`,d),[d]),(0,z.jsx)(y,{asChild:!0,...o,children:(0,z.jsx)(f.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:u(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:u(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:u(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,d,{once:!0})}),onFocus:u(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:u(e.onBlur,i.onClose),onClick:u(e.onClick,i.onClose)})})});ge.displayName=q;var J=`TooltipPortal`,[_e,ve]=B(J,{forceMount:void 0}),ye=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=G(J,t);return(0,z.jsx)(_e,{scope:t,forceMount:n,children:(0,z.jsx)(w,{present:n||a.open,children:(0,z.jsx)(d,{asChild:!0,container:i,children:r})})})};ye.displayName=J;var Y=`TooltipContent`,be=R.forwardRef((e,t)=>{let n=ve(Y,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=G(Y,e.__scopeTooltip);return(0,z.jsx)(w,{present:r||o.open,children:o.disableHoverableContent?(0,z.jsx)(Te,{side:i,...a,ref:t}):(0,z.jsx)(xe,{side:i,...a,ref:t})})}),xe=R.forwardRef((e,t)=>{let n=G(Y,e.__scopeTooltip),r=H(Y,e.__scopeTooltip),i=R.useRef(null),a=C(t,i),[o,s]=R.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=R.useCallback(()=>{s(null),d(!1)},[d]),p=R.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=ke(r,Oe(r,n.getBoundingClientRect())),a=Ae(t.getBoundingClientRect());s(Me([...i,...a])),d(!0)},[d]);return R.useEffect(()=>()=>f(),[f]),R.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),R.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!je(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,z.jsx)(Te,{...e,ref:a})}),[Se,Ce]=B(W,{isInside:!1}),we=v(`TooltipContent`),Te=R.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=G(Y,n),u=V(n),{onClose:d}=c;return R.useEffect(()=>(document.addEventListener(pe,d),()=>document.removeEventListener(pe,d)),[d]),R.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&d()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,d]),(0,z.jsx)(h,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,z.jsxs)(l,{"data-state":c.stateAttribute,...u,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,z.jsx)(we,{children:r}),(0,z.jsx)(Se,{scope:n,isInside:!0,children:(0,z.jsx)(x,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});be.displayName=Y;var Ee=`TooltipArrow`,De=R.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=V(n);return Ce(Ee,n).isInside?null:(0,z.jsx)(m,{...i,...r,ref:t})});De.displayName=Ee;function Oe(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function ke(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Ae(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function je(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Me(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),Ne(t)}function Ne(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Pe=U,Fe=K,Ie=ge,Le=ye,Re=be,ze=Pe,Be=Fe,Ve=Ie,X=R.forwardRef(({className:e,sideOffset:t=4,...n},i)=>(0,z.jsx)(Le,{children:(0,z.jsx)(Re,{ref:i,sideOffset:t,className:r(`z-[var(--z-tooltip,10150)] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...n})}));X.displayName=Re.displayName;var He={sm:`h-6 w-6 rounded-md p-1`,md:`h-7 w-7 rounded-md p-1.5`,lg:`h-8 w-8 rounded-lg p-1.5`},Ue={default:`text-muted-foreground hover:bg-[var(--interaction-hover)] hover:text-accent-foreground disabled:text-muted-foreground/45 disabled:hover:bg-transparent disabled:hover:text-muted-foreground/45`,surface:`text-muted-foreground hover:bg-gray-200/60 hover:text-gray-900 active:bg-gray-200/80 disabled:text-muted-foreground/45 disabled:hover:bg-transparent disabled:hover:text-muted-foreground/45`,strong:`text-muted-foreground hover:bg-black/10 hover:text-foreground disabled:text-muted-foreground/45 disabled:hover:bg-transparent disabled:hover:text-muted-foreground/45`},Z=R.forwardRef(({className:e,disabled:t=!1,icon:n,label:i,size:a=`md`,tone:o=`default`,tooltip:s,tooltipSide:c=`bottom`,...l},u)=>{let d=(0,z.jsx)(`button`,{...l,ref:u,type:`button`,disabled:t,"aria-label":i,className:r(`inline-flex shrink-0 items-center justify-center transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border disabled:cursor-not-allowed`,He[a],Ue[o],e),children:n}),f=s===!1?null:s??i;return f?(0,z.jsx)(ze,{delayDuration:250,children:(0,z.jsxs)(Be,{disableHoverableContent:!0,children:[(0,z.jsx)(Ve,{asChild:!0,onFocus:e=>{e.currentTarget.matches(`:focus-visible`)||e.preventDefault()},children:t?(0,z.jsx)(`span`,{className:`inline-flex`,children:d}):d}),(0,z.jsx)(X,{side:c,className:`text-xs`,children:f})]})}):d});Z.displayName=`IconActionButton`;var We=e(a(),1),Ge=(0,R.createContext)(null),Ke=8;function qe({groups:e,label:t,onClose:n,position:i}){let a=(0,R.useRef)(null);(0,R.useLayoutEffect)(()=>{let e=a.current;if(!e)return;let t=e.getBoundingClientRect(),n=i.align===`end`?i.x-t.width:i.x,r=Math.max(Ke,Math.min(n,window.innerWidth-t.width-Ke)),o=Math.max(Ke,Math.min(i.y,window.innerHeight-t.height-Ke));e.style.left=`${r}px`,e.style.top=`${o}px`,e.querySelector(`[role="menuitem"]:not(:disabled)`)?.focus()},[i]);let o=e=>{let t=Array.from(a.current?.querySelectorAll(`[role="menuitem"]:not(:disabled)`)??[]);if(t.length===0)return;let n=t.indexOf(document.activeElement);t[n<0?0:(n+e+t.length)%t.length]?.focus()};return(0,We.createPortal)((0,z.jsx)(`div`,{className:`fixed inset-0 z-[var(--z-tooltip)]`,onContextMenu:e=>e.preventDefault(),onPointerDown:()=>n(!0),children:(0,z.jsx)(`div`,{ref:a,role:`menu`,"aria-label":t,className:`fixed min-w-52 max-w-72 overflow-hidden rounded-xl border border-border bg-popover p-1 text-popover-foreground shadow-[0_18px_48px_-20px_rgba(15,23,42,0.42)]`,style:{left:i.x,top:i.y},onPointerDown:e=>e.stopPropagation(),onKeyDown:e=>{if(e.key===`Escape`)e.preventDefault(),n(!0);else if(e.key===`ArrowDown`)e.preventDefault(),o(1);else if(e.key===`ArrowUp`)e.preventDefault(),o(-1);else if(e.key===`Home`||e.key===`End`){e.preventDefault();let t=a.current?.querySelectorAll(`[role="menuitem"]:not(:disabled)`);t?.[e.key===`Home`?0:t.length-1]?.focus()}},children:e.map((e,t)=>(0,z.jsxs)(`div`,{role:`group`,children:[t>0?(0,z.jsx)(`div`,{className:`my-1 h-px bg-border`}):null,e.items.map(e=>{let t=r(`flex h-8 w-full items-center gap-2 rounded-lg px-2.5 text-left text-[13px] font-medium outline-none transition-colors`,e.destructive?`text-destructive hover:bg-destructive/10 focus-visible:bg-destructive/10`:`text-foreground hover:bg-muted focus-visible:bg-muted`,`disabled:pointer-events-none disabled:opacity-45`),i=(0,z.jsxs)(z.Fragment,{children:[e.icon?(0,z.jsx)(`span`,{className:r(`inline-flex h-4 w-4 shrink-0 items-center justify-center`,e.destructive?`text-destructive`:`text-muted-foreground`),children:e.icon}):null,(0,z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label})]});return e.href?(0,z.jsx)(`a`,{role:`menuitem`,className:t,href:e.href,download:e.download,onClick:()=>{e.onSelect?.(),n(!1)},children:i},e.key):(0,z.jsx)(`button`,{type:`button`,role:`menuitem`,disabled:e.disabled,className:t,onClick:()=>{e.onSelect?.(),n(e.restoreFocus!==!1)},children:i},e.key)})]},e.key))})}),document.body)}function Je({children:e,groups:t,label:n}){let[r,i]=(0,R.useState)(null),a=t.filter(e=>e.items.length>0),o=e=>{let t=r?.trigger;i(null),e&&t&&window.setTimeout(()=>t.isConnected&&t.focus(),0)},s=e=>{if(r?.trigger===e){o(!0);return}if(a.length===0)return;let t=e.getBoundingClientRect();i({align:`end`,x:t.right,y:t.bottom,trigger:e})},c=(0,R.cloneElement)(e,{"data-context-menu-open":r?``:void 0,onContextMenu:t=>{if(e.props.onContextMenu?.(t),t.defaultPrevented||a.length===0)return;t.preventDefault();let n=t.currentTarget,r=n.getBoundingClientRect();i({align:`start`,x:t.clientX||r.left,y:t.clientY||r.bottom,trigger:n})}});return(0,z.jsxs)(Ge.Provider,{value:{isOpen:!!r,toggleFromButton:s},children:[c,r?(0,z.jsx)(qe,{groups:a,label:n,position:r,onClose:o}):null]})}function Ye({children:e}){let t=(0,R.useContext)(Ge);if(!t)throw Error(`ContextMenuTrigger must be rendered inside ContextMenu`);return(0,R.cloneElement)(e,{"aria-expanded":t.isOpen,"aria-haspopup":`menu`,onClick:n=>{e.props.onClick?.(n),!n.defaultPrevented&&(n.stopPropagation(),t.toggleFromButton(n.currentTarget))}})}function Xe(e,t){e.stopPropagation(),t()}function Ze(e){return(0,z.jsx)(Z,{...e,size:`sm`,tone:`strong`})}function Qe({tab:e}){if(!e.menuGroups?.some(e=>e.items.length>0))return null;let t=e.menuLabel??e.label;return(0,z.jsx)(`div`,{className:`flex shrink-0`,children:(0,z.jsx)(Ye,{children:(0,z.jsx)(Ze,{icon:(0,z.jsx)(F,{className:`h-3.5 w-3.5`}),label:t})})})}function $e({tab:e}){let t=e.menuGroups?.some(e=>e.items.length>0)??!1,n=!!(e.onClose&&e.closePlacement!==`leading-hover`),i=n?(0,z.jsx)(Ze,{icon:(0,z.jsx)(k,{className:`h-3.5 w-3.5`}),label:e.closeLabel??``,tooltip:e.closeLabel??null,onClick:t=>Xe(t,e.onClose)}):null;return!t&&!n?null:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{"aria-hidden":`true`,"data-compact-tab-trailing-spacer":``,className:r(`shrink-0`,t&&n?`w-[50px]`:`w-6`)}),(0,z.jsxs)(`div`,{"data-compact-tab-trailing-actions":``,className:r(`pointer-events-none absolute inset-y-0 right-1 z-10 flex items-center gap-0.5 opacity-0`,`group-hover:pointer-events-auto group-hover:opacity-100 group-focus-within:pointer-events-auto group-focus-within:opacity-100`,`group-data-[context-menu-open]:pointer-events-auto group-data-[context-menu-open]:opacity-100`),children:[t?(0,z.jsx)(Qe,{tab:e}):null,i]})]})}function et({tab:e}){return!e.onClose||e.closePlacement!==`leading-hover`?null:(0,z.jsx)(`div`,{"data-compact-tab-leading-actions":``,className:r(`pointer-events-none absolute inset-y-0 left-1 z-10 flex items-center opacity-0`,`group-hover:pointer-events-auto group-hover:opacity-100 group-focus-within:pointer-events-auto group-focus-within:opacity-100`),children:(0,z.jsx)(Ze,{icon:(0,z.jsx)(k,{className:`h-3.5 w-3.5`}),label:e.closeLabel??``,tooltip:e.closeLabel??null,onClick:t=>Xe(t,e.onClose)})})}function tt({labelClassName:e,tab:t}){let n=!!(t.onClose&&t.closePlacement===`leading-hover`),i=(0,z.jsxs)(`button`,{type:`button`,onClick:t.onSelect,"aria-label":t.label,className:`flex min-w-0 flex-1 items-center gap-1.5 text-left`,children:[t.leadingIcon||n?(0,z.jsx)(`span`,{"data-compact-tab-leading-slot":``,className:r(`inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center`,n&&`group-hover:opacity-0 group-focus-within:opacity-0`),children:t.leadingIcon}):null,(0,z.jsx)(`span`,{className:r(`min-w-0 truncate text-[12px] font-medium`,e,t.labelClassName),children:t.label}),t.badge,t.unreadIndicator]}),a=t.tooltip??t.label;return a?(0,z.jsx)(ze,{delayDuration:250,children:(0,z.jsxs)(Be,{children:[(0,z.jsx)(Ve,{asChild:!0,children:i}),(0,z.jsx)(X,{side:`bottom`,className:`text-xs`,children:a})]})}):i}function nt({activeTabClassName:e,inactiveTabClassName:t,itemRef:n,labelClassName:i,tab:a,tabBaseClassName:o}){let s=(0,z.jsxs)(`div`,{ref:n,"data-compact-tab-item":``,onClick:e=>e.target===e.currentTarget&&a.onSelect(),className:r(o??`flex max-w-[180px] cursor-pointer items-center gap-1.5 border-r border-gray-200/70 border-b-2 px-2.5 py-2 transition-colors`,`group relative`,a.active?e??`border-b-primary bg-white text-gray-900`:t??`border-b-transparent bg-gray-50/85 text-gray-500 hover:bg-gray-100`),children:[(0,z.jsx)(tt,{tab:a,labelClassName:i}),(0,z.jsx)(et,{tab:a}),(0,z.jsx)($e,{tab:a})]});return a.menuGroups?.some(e=>e.items.length>0)?(0,z.jsx)(Je,{groups:a.menuGroups,label:a.menuLabel??a.label,children:s}):s}function rt({actionButtonClassName:e,actions:t,actionsClassName:n,actionsTestId:i,className:a,onPointerDown:o,onScrollPointerDown:s,scrollClassName:c,scrollTestId:l,tabs:u,tabsClassName:d,testId:f,...p}){let m=R.useCallback(e=>{e?.scrollIntoView?.({block:`nearest`,inline:`nearest`})},[]);return(0,z.jsxs)(`div`,{"data-testid":f,className:r(`flex min-w-0 items-stretch border-b border-gray-200/70 bg-gray-50/85`,a),onPointerDown:o,children:[(0,z.jsx)(`div`,{className:r(`min-w-0 flex-1 overflow-x-auto overflow-y-hidden`,c),onPointerDown:s,children:(0,z.jsx)(`div`,{"data-testid":l,className:r(`flex min-w-max items-stretch`,d),children:u.map(e=>(0,z.jsx)(nt,{itemRef:e.active?m:void 0,tab:e,...p},e.key))})}),(0,z.jsx)(`div`,{className:r(`flex shrink-0 items-center gap-1`,n),"data-testid":i,onPointerDown:e=>e.stopPropagation(),children:t.map(t=>(0,z.jsx)(Z,{icon:t.icon,label:t.label,disabled:t.disabled,onClick:t.onClick,className:e},t.key))})]})}function it(){return(0,z.jsx)(`div`,{className:`flex h-full items-center justify-center bg-background px-5 py-6`,children:(0,z.jsxs)(`div`,{className:`flex max-w-[260px] flex-col items-center gap-3 text-center`,children:[(0,z.jsx)(`span`,{className:`flex h-12 w-12 items-center justify-center rounded-lg border border-border bg-muted text-muted-foreground shadow-[0_1px_2px_rgba(30,20,10,0.04)]`,children:(0,z.jsx)(P,{className:`h-5 w-5`})}),(0,z.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:o(`docBrowserHomeTitle`)})]})})}function at(e){if(!e||typeof e!=`object`)return!1;let t=e;return t.kind===`document`?!0:t.kind===`element`&&Array.isArray(t.path)&&t.path.length>0&&t.path.length<=30&&t.path.every(e=>typeof e?.index==`number`&&Number.isInteger(e.index)&&e.index>=0&&e.index<=1e3&&typeof e.tagName==`string`&&e.tagName.length>0&&e.tagName.length<=32)}function ot(e){if(!e||typeof e!=`object`)return!1;let t=e;return t.type===s.scrollMessageType&&t.version===s.version&&at(t.target)&&typeof t.x==`number`&&Number.isFinite(t.x)&&t.x>=0&&typeof t.y==`number`&&Number.isFinite(t.y)&&t.y>=0}function st({currentTab:e,iframeRef:t,isEnabled:n,tabs:r}){let i=(0,R.useRef)(new Map);return(0,R.useEffect)(()=>{let e=new Set(r.map(e=>e.id));for(let t of i.current.keys())e.has(t)||i.current.delete(t)},[r]),(0,R.useEffect)(()=>{if(!e||!n)return;let r=n=>{n.source!==t.current?.contentWindow||!ot(n.data)||i.current.set(e.id,{currentUrl:e.currentUrl,target:n.data.target,x:n.data.x,y:n.data.y})};return window.addEventListener(`message`,r),()=>window.removeEventListener(`message`,r)},[e,t,n]),(0,R.useCallback)(()=>{if(!e||!n)return;let r=i.current.get(e.id);!r||r.currentUrl!==e.currentUrl||t.current?.contentWindow?.postMessage({type:s.restoreScrollMessageType,version:s.version,target:r.target,x:r.x,y:r.y},`*`)},[e,t,n])}function ct({isVisible:e,onRefresh:t,onSubmit:n,onUrlInputChange:r,placeholder:i,urlInput:a}){return e?(0,z.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border/70 bg-card px-3.5 py-2 shrink-0`,children:[(0,z.jsxs)(`form`,{onSubmit:n,className:`flex-1 relative`,children:[(0,z.jsx)(te,{className:`absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/70`}),(0,z.jsx)(`input`,{type:`text`,value:a,onChange:e=>r(e.target.value),"aria-label":o(`docBrowserAddressLabel`),placeholder:i,className:`h-8 w-full rounded-lg border border-border/75 bg-background pl-8 pr-3 text-xs text-foreground transition-colors placeholder:text-muted-foreground/55 focus:outline-none focus:ring-0`})]}),(0,z.jsx)(Z,{icon:(0,z.jsx)(O,{className:`h-3.5 w-3.5`}),label:o(`docBrowserRefresh`),onClick:t})]}):null}function lt({currentTab:e,currentUrl:t,customContent:n,iframeRef:r,iframeInstanceId:a,iframeSandbox:o,isDragging:s,isResizing:c,onIframeLoad:l,onIframePointerOver:u}){return(0,z.jsxs)(`div`,{className:`flex-1 relative overflow-hidden`,children:[n||(0,z.jsx)(`iframe`,{ref:r,src:t,name:i(e?.contentParams),className:`absolute inset-0 w-full h-full border-0`,title:e?.title||`NextClaw Docs`,sandbox:o,tabIndex:u?0:void 0,onLoad:l,onPointerOver:u,allow:`clipboard-read; clipboard-write`,allowFullScreen:!0},a),(c||s)&&(0,z.jsx)(`div`,{className:`absolute inset-0 z-10`})]})}function ut(e){try{let t=new URL(e,window.location.origin);return t.protocol===`http:`||t.protocol===`https:`}catch{return!1}}function dt({currentUrl:e,isVisible:t}){if(!t||!ut(e))return null;let n=A(e)?o(`docBrowserOpenExternal`):o(`docBrowserOpenInBrowser`);return(0,z.jsx)(`div`,{className:`flex items-center justify-between border-t border-border/70 bg-muted/55 px-4 py-2 shrink-0`,children:(0,z.jsx)(c,{href:e,external:!0,iconPosition:`trailing`,size:`xs`,"data-doc-external":!0,children:n})})}var ft={apps:P,docs:E,github:I,"new-tab":D,"panel-app":M,"service-apps":M};function pt({fallbackIcon:e,url:t}){let[n,r]=(0,R.useState)(!1);return n?(0,z.jsx)(e,{className:`h-3.5 w-3.5 text-muted-foreground`,"aria-hidden":`true`}):(0,z.jsx)(`img`,{src:t,alt:``,className:`h-3.5 w-3.5 rounded-sm object-cover`,onError:()=>r(!0)})}function mt({tab:e}){let{dockIcon:t}=e,n=e.kind===`docs`?E:e.kind===`home`?D:e.kind===`apps`?P:M,r=t?.type===`builtin`?ft[t.name]??n:n;return t?.type===`url`?(0,z.jsx)(pt,{fallbackIcon:n,url:t.url},t.url):t?.type===`text`?(0,z.jsx)(`span`,{className:`max-w-3.5 truncate text-[10px] font-semibold leading-none`,"aria-hidden":`true`,children:t.value}):(0,z.jsx)(r,{className:`h-3.5 w-3.5 text-muted-foreground`,"aria-hidden":`true`})}function ht(e){return e instanceof Element&&!!e.closest(`button, a, input, textarea, select, [data-compact-tab-item]`)}function gt({tabs:e,activeTabId:t,canGoBack:n,canGoForward:i,isDocked:a,isFullscreen:s,dockState:c,onGoBack:l,onGoForward:u,onOpenNewTab:d,onToggleDock:f,onSetActiveTab:p,onCloseTab:m,onClose:h,onDragStart:g,onToggleMode:_,getTabMenuGroups:v}){let y=o(`docBrowserBack`),b=o(`docBrowserClose`),x=o(`docBrowserCloseTab`),S=c?.isDocked?c.removable?o(`sideDockUnpinCurrent`):o(`sideDockBuiltInDocked`):o(`sideDockPinCurrent`),C=o(`docBrowserForward`),w=o(a?`docBrowserFloatMode`:`docBrowserDockMode`),T=o(`docBrowserNewTab`);return(0,z.jsx)(rt,{testId:`doc-browser-tab-strip`,actionsTestId:`doc-browser-tab-actions`,tabs:e.map(e=>({key:e.id,label:e.title||o(`docBrowserTabUntitled`),active:e.id===t,tooltip:e.title,leadingIcon:(0,z.jsx)(mt,{tab:e}),closeLabel:x,closePlacement:`leading-hover`,onSelect:()=>p(e.id),onClose:()=>m(e.id),menuLabel:o(`docBrowserTabMoreActions`),menuGroups:v?.(e)})),actions:[{key:`back`,disabled:!n,icon:(0,z.jsx)(ee,{className:`h-3.5 w-3.5`}),label:y,onClick:l},{key:`forward`,disabled:!i,icon:(0,z.jsx)(N,{className:`h-3.5 w-3.5`}),label:C,onClick:u},{key:`new-tab`,icon:(0,z.jsx)(D,{className:`h-3.5 w-3.5`}),label:T,onClick:d},...c?.canDock?[{key:`dock`,disabled:c.isDocked&&!c.removable,icon:c.isDocked&&c.removable?(0,z.jsx)(le,{className:`h-3.5 w-3.5`}):(0,z.jsx)(L,{className:`h-3.5 w-3.5`}),label:S,onClick:()=>f?.()}]:[],...s?[]:[{key:`mode`,icon:a?(0,z.jsx)(ce,{className:`h-3.5 w-3.5`}):(0,z.jsx)(se,{className:`h-3.5 w-3.5`}),label:w,onClick:_}],{key:`close`,icon:(0,z.jsx)(k,{className:`h-3.5 w-3.5`}),label:b,onClick:h}],className:r(`h-10 gap-1.5 border-border/50 bg-card/80 px-2 shrink-0 select-none`,s&&`h-[calc(env(safe-area-inset-top,0px)+2.5rem)] pt-[env(safe-area-inset-top,0px)]`),scrollClassName:r(`doc-browser-tab-scrollbar flex h-full items-center gap-0.5`,!a&&!s&&`cursor-grab active:cursor-grabbing`),tabsClassName:`items-center gap-0.5`,actionsClassName:`h-full items-center gap-0.5`,actionButtonClassName:`rounded-md p-1.5 text-muted-foreground hover:bg-muted/60 hover:text-foreground disabled:opacity-50`,tabBaseClassName:`inline-flex cursor-pointer items-center gap-0.5 h-7 px-2 rounded-md text-xs max-w-[220px] shrink-0 transition-colors`,activeTabClassName:`bg-muted/80 text-foreground`,inactiveTabClassName:`text-muted-foreground hover:bg-muted/45 hover:text-foreground`,labelClassName:`px-0.5 text-xs font-normal`,onPointerDown:!a&&!s?g:void 0,onScrollPointerDown:e=>{if(ht(e.target)){e.stopPropagation();return}!a&&!s&&(e.stopPropagation(),g(e))}})}var Q=40,_t=360,vt=400;function $(e,t,n){return Math.min(n,Math.max(t,e))}function yt(e,t){return e.split(`-`).includes(t)}function bt(){return{x:Math.max(Q,window.innerWidth-520),y:80,w:480,h:600}}function xt(e,t,n){return{...e,x:$(e.x+t,Q,window.innerWidth-Q-e.w),y:$(e.y+n,Q,window.innerHeight-Q-e.h)}}function St(e,t,n,r){let i=t.x+t.w,a=t.y+t.h,o=yt(e,`left`)?$(t.x+n,Q,i-_t):t.x,s=yt(e,`right`)?$(i+n,o+_t,window.innerWidth-Q):i,c=yt(e,`top`)?$(t.y+r,Q,a-vt):t.y,l=yt(e,`bottom`)?$(a+r,c+vt,window.innerHeight-Q):a;return{x:o,y:c,w:s-o,h:l-c}}function Ct({children:e,className:t,style:n,defaultWidth:i=420,minWidth:a=320,maxWidth:o=860,onWidthCommit:s,overlay:c=!1,overlayScope:l=`viewport`,width:u,...d}){let f=(0,R.useRef)(null),p=(0,R.useRef)(u??i),[m,h]=(0,R.useState)(!1),[g,_]=(0,R.useState)(null),[v,y]=(0,R.useState)(i),b=g??u??v,x=c?l===`container`?`absolute inset-0 z-30`:`fixed inset-0 z-40`:`border-l border-border`,S=e=>{if(c)return;e.preventDefault(),e.stopPropagation(),e.currentTarget.setPointerCapture?.(e.pointerId),h(!0),p.current=b,f.current={startX:e.clientX,startWidth:b};let t=e=>{let t=f.current;if(!t)return;let n=t.startWidth+t.startX-e.clientX,r=Math.max(a,Math.min(o,n));p.current=r,_(r)},n=()=>{u===void 0&&y(p.current),s?.(p.current),_(null),h(!1),f.current=null,window.removeEventListener(`pointermove`,t),window.removeEventListener(`pointerup`,n),window.removeEventListener(`pointercancel`,n)};window.addEventListener(`pointermove`,t),window.addEventListener(`pointerup`,n),window.addEventListener(`pointercancel`,n)};return(0,z.jsxs)(`aside`,{...d,className:r(`relative flex h-full min-h-0 shrink-0 overflow-hidden bg-card text-card-foreground`,x,t),style:c?n:{...n,width:b},children:[(0,z.jsx)(`div`,{className:`flex h-full min-h-0 w-full flex-col overflow-hidden`,children:e}),c?null:(0,z.jsx)(`div`,{className:`absolute left-0 top-0 z-30 h-full w-3 cursor-ew-resize transition-colors hover:bg-primary/10`,"data-testid":`resizable-right-panel-handle`,onPointerDown:S}),m?(0,z.jsx)(`div`,{className:`absolute inset-0 z-10 cursor-ew-resize`,"data-testid":`resizable-right-panel-resize-shield`}):null]})}var wt=`allow-same-origin allow-scripts allow-popups allow-forms`;function Tt(e,t){if(e.startsWith(`/`))try{return new URL(e,t).toString()}catch{return e}return/^[a-z][a-z\d+.-]*:\/\//i.test(e)||e===`about:blank`?e:/^(localhost|127\.|0\.0\.0\.0|\[::1\])(?::|\/|$)/i.test(e)?`http://${e}`:`https://${e}`}function Et(e,t){if(!t)return wt;let n=e?.getIframeSandbox?.(t);return n===void 0?t.kind===`content`?void 0:wt:n}function Dt(e,t,n){return(0,R.useCallback)(()=>{if(n?.canDock){if(n.isDocked){n.removable&&e?.unpinTab(t);return}e?.pinTab(t)}},[t,e,n])}function Ot({activeTabId:e,currentUrl:t,isAddressToolbarTab:n,isContentTab:r,isDocsTab:i,navigate:a}){let o=`${e}:${t}:${r?`content`:`docs`}`,[s,c]=(0,R.useState)(null),l=(()=>{if(!n)return``;if(r)return t;try{return new URL(t).pathname}catch{return t}})(),u=s?.key===o?s.value:l,d=(0,R.useCallback)(e=>c({key:o,value:e}),[o]);return{handleUrlSubmit:(0,R.useCallback)(e=>{if(e.preventDefault(),!n)return;let r=u.trim();r&&(i&&r.startsWith(`/`)?a(j(r)):i&&r.startsWith(`http`)?a(r):a(i?j(`/${r}`):Tt(r,t)))},[t,n,i,a,u]),setUrlInput:d,urlInput:u}}function kt({customTabRenderers:e={},displayMode:t=`desktop`,dockControls:n,getTabMenuGroups:i}){let{isOpen:a,mode:s,dockedWidth:c,tabs:l,activeTabId:u,activeHistory:d,activeHistoryIndex:f,currentTab:p,open:m,openTarget:h,openNewTab:g,close:_,toggleMode:v,setDockedWidth:y,goBack:b,goForward:x,navigate:S,syncUrl:C,setActiveTab:w,closeTab:T}=ie(),[ee,te]=(0,R.useState)(0),[E,D]=(0,R.useState)(bt),[O,k]=(0,R.useState)(null),A=(0,R.useRef)(null),j=p?.currentUrl??ae(),M=p?.navVersion??0,N=`${u}:${M}:${ee}`,P=(0,R.useRef)(null),F=(0,R.useRef)(M),I=p?.kind===`docs`,se=p?.kind===re,ce=f>0,le=f<d.length-1,L=p?e[p.kind]:void 0,B=n?.getDockState(p),ue=p?.kind===`content`,V=I||ue,de=st({currentTab:p,iframeRef:A,isEnabled:L?.supportsScrollRestoration===!0,tabs:l}),{handleUrlSubmit:fe,setUrlInput:pe,urlInput:me}=Ot({activeTabId:u,currentUrl:j,isAddressToolbarTab:V,isContentTab:ue,isDocsTab:I,navigate:S});(0,R.useEffect)(()=>{if(!I){P.current=null;return}if(M!==F.current){F.current=M,P.current=ne(j);return}if(A.current?.contentWindow)try{let e=new URL(j).pathname;P.current=ne(j),A.current.contentWindow.postMessage({type:`docs-navigate`,path:e},`*`)}catch{}},[j,M,I]),(0,R.useEffect)(()=>{let e=e=>{if(I&&e.data?.type===`docs-route-change`&&typeof e.data.url==`string`){let t=ne(e.data.url);if(P.current&&t!==P.current)return;P.current=null,C(e.data.url)}};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},[j,C,I]),(0,R.useEffect)(()=>{if(!p||!L?.onIframeMessage)return;let e=e=>{L.onIframeMessage?.({event:e,iframe:A.current,iframeInstanceId:N,tab:p})};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},[p,L,N]);let H=(0,R.useCallback)(e=>{e.preventDefault(),k({kind:`drag`,startX:e.clientX,startY:e.clientY,startRect:E})},[E]),U=(0,R.useCallback)(e=>t=>{t.preventDefault(),t.stopPropagation(),k({kind:`resize`,edge:e,startX:t.clientX,startY:t.clientY,startRect:E})},[E]);(0,R.useEffect)(()=>{if(!O)return;let e=e=>{let{startRect:t,startX:n,startY:r}=O,i=e.clientX-n,a=e.clientY-r;if(O.kind===`drag`){D(xt(t,i,a));return}D(St(O.edge,t,i,a))},t=()=>k(null);return window.addEventListener(`pointermove`,e),window.addEventListener(`pointerup`,t),window.addEventListener(`pointercancel`,t),()=>{window.removeEventListener(`pointermove`,e),window.removeEventListener(`pointerup`,t),window.removeEventListener(`pointercancel`,t)}},[O]);let W=(0,R.useCallback)(()=>{te(e=>e+1)},[]),he=Dt(n,p,B);if(!a)return null;let G=s===`docked`,K=t===`fullscreen`,q=p?{currentUrl:j,open:m,openTarget:h,refreshIframe:W,tab:p}:void 0,ge=q?L?.renderToolbar?.(q):null,J=q?L?.renderContent?.(q)??(se?(0,z.jsx)(it,{}):null):null,_e=Et(L,p),ve=(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(gt,{tabs:l,activeTabId:u,canGoBack:ce,canGoForward:le,dockState:B,isDocked:G,isFullscreen:K,onGoBack:b,onGoForward:x,onOpenNewTab:g,onToggleDock:he,onSetActiveTab:w,onCloseTab:T,onClose:_,onDragStart:H,onToggleMode:v,getTabMenuGroups:i}),(0,z.jsx)(ct,{isVisible:V,onRefresh:W,onSubmit:fe,onUrlInputChange:pe,placeholder:o(I?`docBrowserSearchPlaceholder`:`docBrowserAddressPlaceholder`),urlInput:me}),ge,(0,z.jsx)(lt,{currentTab:p,currentUrl:j,customContent:J,iframeRef:A,iframeInstanceId:N,iframeSandbox:_e,isDragging:O?.kind===`drag`,isResizing:O?.kind===`resize`,onIframeLoad:de,onIframePointerOver:L?.onIframePointerOver}),(0,z.jsx)(dt,{currentUrl:j,isVisible:I||ue})]});return G&&!K?(0,z.jsx)(Ct,{"data-testid":`doc-browser-panel`,defaultWidth:c,width:c,minWidth:320,maxWidth:860,onWidthCommit:y,children:ve}):(0,z.jsxs)(`div`,{"data-testid":`doc-browser-panel`,className:r(`relative flex flex-col overflow-hidden bg-card text-card-foreground`,K?`fixed inset-0 z-[var(--z-floating-panel)] h-[100dvh] w-screen rounded-none border-0 shadow-2xl`:`rounded-2xl border border-border shadow-2xl`),style:K?void 0:{position:`fixed`,left:E.x,top:E.y,width:E.w,height:E.h,zIndex:`var(--z-floating-panel)`},children:[ve,!G&&!K&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`div`,{className:`absolute top-0 left-0 h-3 w-full cursor-ns-resize z-20 hover:bg-primary/10 transition-colors`,"data-testid":`doc-browser-resize-top`,onPointerDown:U(`top`)}),(0,z.jsx)(`div`,{className:`absolute top-0 left-0 w-3 h-full cursor-ew-resize z-20 hover:bg-primary/10 transition-colors`,"data-testid":`doc-browser-resize-left`,onPointerDown:U(`left`)}),(0,z.jsx)(`div`,{className:`absolute top-0 right-0 w-3 h-full cursor-ew-resize z-20 hover:bg-primary/10 transition-colors`,"data-testid":`doc-browser-resize-right`,onPointerDown:U(`right`)}),(0,z.jsx)(`div`,{className:`absolute bottom-0 left-0 h-3 w-full cursor-ns-resize z-20 hover:bg-primary/10 transition-colors`,"data-testid":`doc-browser-resize-bottom`,onPointerDown:U(`bottom`)}),(0,z.jsx)(`div`,{className:`absolute top-0 left-0 z-30 h-4 w-4 cursor-nw-resize hover:bg-primary/10 transition-colors`,"data-testid":`doc-browser-resize-top-left`,onPointerDown:U(`top-left`)}),(0,z.jsx)(`div`,{className:`absolute top-0 right-0 z-30 h-4 w-4 cursor-ne-resize hover:bg-primary/10 transition-colors`,"data-testid":`doc-browser-resize-top-right`,onPointerDown:U(`top-right`)}),(0,z.jsx)(`div`,{className:`absolute bottom-0 left-0 z-30 h-4 w-4 cursor-sw-resize hover:bg-primary/10 transition-colors`,"data-testid":`doc-browser-resize-bottom-left`,onPointerDown:U(`bottom-left`)}),(0,z.jsx)(`div`,{className:`absolute bottom-0 right-0 z-30 flex h-4 w-4 cursor-se-resize items-center justify-center text-muted-foreground/45 transition-colors hover:text-muted-foreground`,"data-testid":`doc-browser-resize-bottom-right`,onPointerDown:U(`bottom-right`),children:(0,z.jsx)(oe,{className:`w-3 h-3 rotate-[-45deg]`})})]})]})}export{M as S,se as _,Ye as a,P as b,X as c,Re as d,Le as f,L as g,Ie as h,Je as i,ze as l,Fe as m,Ct as n,Z as o,Pe as p,rt as r,Be as s,kt as t,Ve as u,I as v,N as x,F as y};
@@ -1 +0,0 @@
1
- import{t as e}from"./doc-browser-5xrHcQ2z.js";export{e as DocBrowser};