@lemoncat7/dsh-theme-xiaohei 0.4.6 → 0.5.0

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 (232) hide show
  1. package/README.md +15 -9
  2. package/THIRD_PARTY_NOTICES.md +13 -1
  3. package/docs/dsh-021-compatibility.md +23 -0
  4. package/docs/releases/0.5.0.md +24 -0
  5. package/docs/rift-interaction.md +35 -0
  6. package/docs/rift-preview.md +39 -0
  7. package/lib/client.companion.js +3 -4
  8. package/lib/client.decorations.js +224 -51
  9. package/lib/client.js +532 -2405
  10. package/lib/index.d.ts +1 -2
  11. package/lib/index.js +393 -11
  12. package/lib/rift/boot.d.ts +6 -0
  13. package/package.json +29 -19
  14. package/lib/appearance.d.ts +0 -12
  15. package/lib/appearance.js +0 -42
  16. package/lib/blink.d.ts +0 -4
  17. package/lib/blink.js +0 -110
  18. package/lib/bloub-heixiu/ambient.d.ts +0 -3
  19. package/lib/bloub-heixiu/ambient.js +0 -12
  20. package/lib/bloub-heixiu/character.d.ts +0 -33
  21. package/lib/bloub-heixiu/character.js +0 -124
  22. package/lib/bloub-heixiu/effects.d.ts +0 -4
  23. package/lib/bloub-heixiu/effects.js +0 -91
  24. package/lib/bloub-heixiu/flight.d.ts +0 -15
  25. package/lib/bloub-heixiu/flight.js +0 -66
  26. package/lib/bloub-heixiu/follow.d.ts +0 -13
  27. package/lib/bloub-heixiu/follow.js +0 -23
  28. package/lib/bloub-heixiu/layout.d.ts +0 -34
  29. package/lib/bloub-heixiu/layout.js +0 -26
  30. package/lib/bloub-heixiu/renderer.d.ts +0 -16
  31. package/lib/bloub-heixiu/renderer.js +0 -94
  32. package/lib/bloub-heixiu/runtime.d.ts +0 -6
  33. package/lib/bloub-heixiu/runtime.js +0 -440
  34. package/lib/bloub-heixiu/signals.d.ts +0 -17
  35. package/lib/bloub-heixiu/signals.js +0 -55
  36. package/lib/bloub-heixiu/styles.d.ts +0 -2
  37. package/lib/bloub-heixiu/styles.js +0 -98
  38. package/lib/boot-appearance.d.ts +0 -10
  39. package/lib/boot-appearance.js +0 -47
  40. package/lib/boot-loader.d.ts +0 -5
  41. package/lib/boot-loader.js +0 -158
  42. package/lib/chrome/accessibility.d.ts +0 -3
  43. package/lib/chrome/accessibility.js +0 -69
  44. package/lib/chrome/blink.d.ts +0 -3
  45. package/lib/chrome/blink.js +0 -15
  46. package/lib/chrome/composer-avatar.d.ts +0 -10
  47. package/lib/chrome/composer-avatar.js +0 -599
  48. package/lib/chrome/composer-send-heixiu.d.ts +0 -3
  49. package/lib/chrome/composer-send-heixiu.js +0 -143
  50. package/lib/chrome/composer.d.ts +0 -3
  51. package/lib/chrome/composer.js +0 -135
  52. package/lib/chrome/controls.d.ts +0 -8
  53. package/lib/chrome/controls.js +0 -348
  54. package/lib/chrome/conversation-messages.d.ts +0 -3
  55. package/lib/chrome/conversation-messages.js +0 -329
  56. package/lib/chrome/conversation-submissions.d.ts +0 -3
  57. package/lib/chrome/conversation-submissions.js +0 -68
  58. package/lib/chrome/conversation.d.ts +0 -3
  59. package/lib/chrome/conversation.js +0 -67
  60. package/lib/chrome/frames.d.ts +0 -6
  61. package/lib/chrome/frames.js +0 -134
  62. package/lib/chrome/gaze.d.ts +0 -3
  63. package/lib/chrome/gaze.js +0 -103
  64. package/lib/chrome/identity.d.ts +0 -6
  65. package/lib/chrome/identity.js +0 -47
  66. package/lib/chrome/overlays.d.ts +0 -3
  67. package/lib/chrome/overlays.js +0 -104
  68. package/lib/chrome/portal.d.ts +0 -6
  69. package/lib/chrome/portal.js +0 -169
  70. package/lib/chrome/reactions.d.ts +0 -3
  71. package/lib/chrome/reactions.js +0 -85
  72. package/lib/chrome/sidebar.d.ts +0 -3
  73. package/lib/chrome/sidebar.js +0 -313
  74. package/lib/chrome/tokens.d.ts +0 -3
  75. package/lib/chrome/tokens.js +0 -224
  76. package/lib/chrome/workspace.d.ts +0 -3
  77. package/lib/chrome/workspace.js +0 -94
  78. package/lib/chrome.d.ts +0 -10
  79. package/lib/chrome.js +0 -46
  80. package/lib/client-entry.d.ts +0 -3
  81. package/lib/client-entry.js +0 -3
  82. package/lib/client.d.ts +0 -10
  83. package/lib/client.pose-chin-dark.js +0 -4
  84. package/lib/client.pose-chin-light.js +0 -4
  85. package/lib/client.pose-doze-dark.js +0 -4
  86. package/lib/client.pose-doze-light.js +0 -4
  87. package/lib/client.pose-halfpeek-dark.js +0 -4
  88. package/lib/client.pose-halfpeek-light.js +0 -4
  89. package/lib/client.pose-peek-dark.js +0 -4
  90. package/lib/client.pose-peek-light.js +0 -4
  91. package/lib/client.pose-seated-dark.js +0 -4
  92. package/lib/client.pose-seated-light.js +0 -4
  93. package/lib/client.rig-chin-dark.js +0 -4
  94. package/lib/client.rig-chin-light.js +0 -4
  95. package/lib/client.rig-halfpeek-dark.js +0 -4
  96. package/lib/client.rig-halfpeek-light.js +0 -4
  97. package/lib/client.rig-peek-dark.js +0 -4
  98. package/lib/client.rig-peek-light.js +0 -4
  99. package/lib/client.rig-seated-dark.js +0 -4
  100. package/lib/client.rig-seated-light.js +0 -4
  101. package/lib/companion-entry.d.ts +0 -3
  102. package/lib/companion-entry.js +0 -3
  103. package/lib/composer-avatar.d.ts +0 -18
  104. package/lib/composer-avatar.js +0 -441
  105. package/lib/composer-draft-preview.d.ts +0 -4
  106. package/lib/composer-draft-preview.js +0 -8
  107. package/lib/composer-send-heixiu.d.ts +0 -8
  108. package/lib/composer-send-heixiu.js +0 -133
  109. package/lib/current-session.d.ts +0 -6
  110. package/lib/current-session.js +0 -5
  111. package/lib/decorations-entry.d.ts +0 -3
  112. package/lib/decorations-entry.js +0 -18
  113. package/lib/deferred-companion.d.ts +0 -5
  114. package/lib/deferred-companion.js +0 -9
  115. package/lib/deferred-decorations.d.ts +0 -3
  116. package/lib/deferred-decorations.js +0 -51
  117. package/lib/gaze.d.ts +0 -4
  118. package/lib/gaze.js +0 -230
  119. package/lib/generated-backgrounds.d.ts +0 -14
  120. package/lib/generated-backgrounds.js +0 -14
  121. package/lib/generated-character-motion.d.ts +0 -4
  122. package/lib/generated-character-motion.js +0 -2
  123. package/lib/generated-identity.d.ts +0 -6
  124. package/lib/generated-identity.js +0 -6
  125. package/lib/generated-keyart.d.ts +0 -34
  126. package/lib/generated-keyart.js +0 -34
  127. package/lib/generated-loading-assets.d.ts +0 -4
  128. package/lib/generated-loading-assets.js +0 -4
  129. package/lib/heixiu-interactions.d.ts +0 -10
  130. package/lib/heixiu-interactions.js +0 -161
  131. package/lib/host-contract.d.ts +0 -9
  132. package/lib/host-contract.js +0 -13
  133. package/lib/host-dom.d.ts +0 -11
  134. package/lib/host-dom.js +0 -72
  135. package/lib/loading-heixiu.d.ts +0 -8
  136. package/lib/loading-heixiu.js +0 -287
  137. package/lib/metallic-brand-mark.d.ts +0 -10
  138. package/lib/metallic-brand-mark.js +0 -296
  139. package/lib/plugin.d.ts +0 -6
  140. package/lib/plugin.js +0 -60
  141. package/lib/portal.d.ts +0 -40
  142. package/lib/portal.js +0 -225
  143. package/lib/reactions.d.ts +0 -20
  144. package/lib/reactions.js +0 -380
  145. package/lib/scene/avatar-model.d.ts +0 -6
  146. package/lib/scene/avatar-model.js +0 -646
  147. package/lib/scene/avatar-motion.d.ts +0 -3
  148. package/lib/scene/avatar-motion.js +0 -799
  149. package/lib/scene/character-assets.d.ts +0 -13
  150. package/lib/scene/character-assets.js +0 -26
  151. package/lib/scene/character-expression.d.ts +0 -4
  152. package/lib/scene/character-expression.js +0 -15
  153. package/lib/scene/character-eye-material.d.ts +0 -13
  154. package/lib/scene/character-eye-material.js +0 -88
  155. package/lib/scene/character-eye-renderer.d.ts +0 -5
  156. package/lib/scene/character-eye-renderer.js +0 -80
  157. package/lib/scene/character-eye-rig.d.ts +0 -20
  158. package/lib/scene/character-eye-rig.js +0 -35
  159. package/lib/scene/character-gaze.d.ts +0 -16
  160. package/lib/scene/character-gaze.js +0 -36
  161. package/lib/scene/character-idle.d.ts +0 -17
  162. package/lib/scene/character-idle.js +0 -65
  163. package/lib/scene/character-layout.d.ts +0 -24
  164. package/lib/scene/character-layout.js +0 -51
  165. package/lib/scene/character-motion-clock.d.ts +0 -18
  166. package/lib/scene/character-motion-clock.js +0 -70
  167. package/lib/scene/character-motion-types.d.ts +0 -12
  168. package/lib/scene/character-motion-types.js +0 -2
  169. package/lib/scene/character-motion.d.ts +0 -6
  170. package/lib/scene/character-motion.js +0 -187
  171. package/lib/scene/character-poses.d.ts +0 -26
  172. package/lib/scene/character-poses.js +0 -11
  173. package/lib/scene/character-rig-renderer.d.ts +0 -5
  174. package/lib/scene/character-rig-renderer.js +0 -95
  175. package/lib/scene/character-rig.d.ts +0 -22
  176. package/lib/scene/character-rig.js +0 -61
  177. package/lib/scene/heixiu-feedback.d.ts +0 -3
  178. package/lib/scene/heixiu-feedback.js +0 -64
  179. package/lib/scene/heixiu-interactions.d.ts +0 -3
  180. package/lib/scene/heixiu-interactions.js +0 -92
  181. package/lib/scene/ids.d.ts +0 -5
  182. package/lib/scene/ids.js +0 -5
  183. package/lib/scene/pointer-bridge.d.ts +0 -21
  184. package/lib/scene/pointer-bridge.js +0 -155
  185. package/lib/scene/runtime.d.ts +0 -12
  186. package/lib/scene/runtime.js +0 -74
  187. package/lib/scene/state-transitions.d.ts +0 -3
  188. package/lib/scene/state-transitions.js +0 -37
  189. package/lib/scene/styles.d.ts +0 -5
  190. package/lib/scene/styles.js +0 -69
  191. package/lib/scene/sylva-performance.d.ts +0 -11
  192. package/lib/scene/sylva-performance.js +0 -58
  193. package/lib/scene/wallpaper-character-styles.d.ts +0 -3
  194. package/lib/scene/wallpaper-character-styles.js +0 -49
  195. package/lib/scene/wallpaper-character.d.ts +0 -5
  196. package/lib/scene/wallpaper-character.js +0 -222
  197. package/lib/scene.d.ts +0 -8
  198. package/lib/scene.js +0 -8
  199. package/lib/sidebar-glass.d.ts +0 -16
  200. package/lib/sidebar-glass.js +0 -168
  201. package/lib/sidebar-heixiu-escape.d.ts +0 -44
  202. package/lib/sidebar-heixiu-escape.js +0 -340
  203. package/lib/sidebar-heixiu-roaming.d.ts +0 -27
  204. package/lib/sidebar-heixiu-roaming.js +0 -310
  205. package/lib/sidebar-reveal.d.ts +0 -8
  206. package/lib/sidebar-reveal.js +0 -59
  207. package/lib/state.d.ts +0 -21
  208. package/lib/state.js +0 -123
  209. package/lib/theme.d.ts +0 -19
  210. package/lib/theme.js +0 -188
  211. package/lib/vendor/bloub/decor.d.ts +0 -114
  212. package/lib/vendor/bloub/decor.js +0 -198
  213. package/lib/vendor/bloub/engine.d.ts +0 -213
  214. package/lib/vendor/bloub/engine.js +0 -452
  215. package/lib/vendor/bloub/expressions.d.ts +0 -35
  216. package/lib/vendor/bloub/expressions.js +0 -143
  217. package/lib/vendor/bloub/eyefit.d.ts +0 -75
  218. package/lib/vendor/bloub/eyefit.js +0 -393
  219. package/lib/vendor/bloub/face.d.ts +0 -63
  220. package/lib/vendor/bloub/face.js +0 -106
  221. package/lib/vendor/bloub/math.d.ts +0 -22
  222. package/lib/vendor/bloub/math.js +0 -36
  223. package/lib/vendor/bloub/profiles.d.ts +0 -8
  224. package/lib/vendor/bloub/profiles.js +0 -20
  225. package/lib/vendor/bloub/repere.d.ts +0 -30
  226. package/lib/vendor/bloub/repere.js +0 -32
  227. package/lib/vendor/bloub/shape.d.ts +0 -80
  228. package/lib/vendor/bloub/shape.js +0 -268
  229. package/lib/vendor/bloub/skins.d.ts +0 -36
  230. package/lib/vendor/bloub/skins.js +0 -74
  231. package/lib/vendor/bloub/states.d.ts +0 -87
  232. package/lib/vendor/bloub/states.js +0 -468
package/README.md CHANGED
@@ -1,19 +1,22 @@
1
- # Xiaohei Night for DSH
1
+ # 界隙 / RIFT · Xiaohei for DSH
2
2
 
3
- 基于 DeepSeek Harness 官方主题接口的非官方粉丝主题。以低饱和天空、日夜光线和小黑角色提供陪伴感,保留原生工作台布局。
3
+ 基于 DeepSeek Harness 官方主题接口的非官方粉丝主题。当前版本 **0.5.0**,适配 **DSH 0.2.1-rc.2**:白发人形小黑、淡蓝玻璃材质与空间裂隙场景,联动侧栏、会话、输入与执行状态。保留耳朵和呆毛动态及嘿咻,身体、手臂、衣服与建筑保持静止。支持完整界隙、柔和渐变和纯色专注三种整体外观;高清装饰延迟加载,后台自动暂停。
4
4
 
5
5
  [![npm](https://img.shields.io/npm/v/%40lemoncat7%2Fdsh-theme-xiaohei)](https://www.npmjs.com/package/@lemoncat7/dsh-theme-xiaohei)
6
6
 
7
7
  ## 功能
8
8
 
9
- - Light / Dark / System 主题,语义颜色与半透明材质。
10
- - 随空间调整的角色姿态与轻量互动,不遮挡消息或侧栏操作。
11
- - 可拖动交互的嘿咻装饰,以及会话运行和结束的只读状态提示。
12
- - 响应式布局,减少动态、增强对比度、强制颜色和打印模式降级。
9
+ - 跟随 DSH 的 Light / Dark / System,不更改用户主题偏好。
10
+ - 全新生成式场景,耳朵、呆毛动态与裂隙流光;不是 Live2D 或全身骨骼动画。
11
+ - 深浅模式使用独立场景,淡蓝玻璃侧栏与上栏、渐隐阅读底统一配色;失焦即静止。
12
+ - 运行时强化裂隙能量,本轮结束时短暂回落,不读取对话正文、不修改任务状态。
13
+ - 左栏“界隙动效”开关;失焦、后台、减少动态、窄屏和省流模式自动静止。
14
+ - 原生侧栏、草稿预览、聊天阅读区、输入框、菜单与弹窗使用统一语义材质。
15
+ - 项目光感、会话裂隙标记、聚焦展开的首页印记、局部碎片反馈与执行状态关联;侧栏收起后联动仍然可用。
13
16
 
14
17
  ## 安装
15
18
 
16
- 适配 DeepSeek Harness **0.2.0-rc.2**(宿主仍为 RC),需要 Node.js **^22.19.0 或 >=24.0.0**。其他宿主版本请先查阅[兼容说明](docs/dsh-020-compatibility.md)和对应版本的发布说明。
19
+ 适配 DeepSeek Harness **0.2.1-rc.2**(宿主仍为 RC),需要 Node.js **^22.19.0 或 >=24.0.0**。其他宿主版本请先查阅[兼容说明](docs/dsh-021-compatibility.md)和对应版本的发布说明。
17
20
 
18
21
  ```bash
19
22
  dsh plugin --profile web add @lemoncat7/dsh-theme-xiaohei@latest
@@ -21,14 +24,17 @@ dsh plugin --profile web add @lemoncat7/dsh-theme-xiaohei@latest
21
24
 
22
25
  安装或升级后重启对应的 DSH Profile;`web` 请按实际使用的 Profile 调整。
23
26
 
24
- 安装后在 DSH 的主题设置中选择 Xiaohei Night;「跟随系统」采用当前设备或浏览器的配色偏好。卸载后由 DSH 恢复原始主题。
27
+ 安装后沿用 DSH 的浅色 / 深色 / 跟随系统设置。卸载后由 DSH 恢复原始主题。
25
28
 
26
29
  ## 使用边界
27
30
 
28
- 主题不修改官方核心代码,不读取对话正文,也不代替业务插件提供布局或授权能力。角色状态提示只表示本轮结束,不保证任务成功。人物动画不是完整 Live2D;移动端软键盘兼容仍需真机验收。
31
+ 主题不修改官方核心代码,不读取对话正文,也不代替业务插件提供布局或授权能力。角色状态提示只表示本轮结束,不保证任务成功。移动端软键盘与 macOS / Windows 桌面端仍需真机验收。
29
32
 
30
33
  ## 文档
31
34
 
35
+ - [0.5.0-rift.11 基线与构建说明](docs/rift-baseline.md)
36
+ - [界隙预览说明](docs/rift-preview.md)
37
+ - [交互重构与验收边界](docs/rift-interaction.md)
32
38
  - [效果、开发与扩展接入](docs/usage.md)
33
39
  - [第三方许可](THIRD_PARTY_NOTICES.md)
34
40
  - [版本与发布说明](https://github.com/lemoncat7/dsh-theme-xiaohei/releases)
@@ -1,4 +1,16 @@
1
- # bloub
1
+ # 当前界隙预览
2
+
3
+ 0.5.0-rift.1 的发布入口、装饰模块与启动背景不打包旧版 bloub、MetallicPaint、森林素材或角色姿态图集。旧源码仍留在开发分支供历史比较,下方许可证对应这些历史源码。
4
+
5
+ 新场景由用户指定的 DSH 生图插件生成,模型为已配置的 gpt-image-2.5,经过一轮参考图修改;未打包官方宣传图。罗小黑角色权利属于其权利人,本项目为非官方同人主题,代码许可证不构成角色授权。
6
+
7
+ React Bits 的 DarkVeil、LightPillar、ElectricBorder、StaggeredMenu 仅用于调研动效思路;本预览没有复制这些组件源码。其上游采用 MIT + Commons Clause,后续若直接采用代码需另行保留相应条款。
8
+
9
+ 0.5.0-rift.6 的两侧御金碎片流参考了 React Bits AeroShards 的视觉方向,并比较了 Particles / Antigravity / Ribbons。当前实现是独立编写的 WebGL 点精灵着色器,未复制上游源码,也未引入 vgpu 或 WebGPU 依赖。
10
+
11
+ 0.5.0-rift.7 已移除上述两侧碎片流;0.5.0-rift.8 进一步移除独立虹膜贴片,改为直接采样原图、在眼睑内平滑衰减的连续形变。保留原画头部轮廓、局部背景边缘修补,以及经用户授权的 DSH 生图插件生成的闭眼局部素材。浅深色闭眼素材使用已配置的 gpt-image-2.5,仅保留眼部区域,未打包新的整幅生成图。建筑/衣摆位移、光尘和动作控制器独立编写,不使用 React Bits 源码。
12
+
13
+ # 历史源码:bloub
2
14
 
3
15
  Source: https://github.com/jeremy-prt/bloub
4
16
  Revision: b4bb3c1b5f93c7b87a2e8d620f667c4093d97749
@@ -0,0 +1,23 @@
1
+ # DSH 0.2.1-rc.2 兼容适配
2
+
3
+ 本版本:0.5.0-rift.19。宿主目标:DSH 0.2.1-rc.2;旧版 DSH 请继续使用原插件版本。
4
+
5
+ 基于现有罗小黑 Rift 主题适配新版依赖;不重做视觉效果,不回退已确认的衣角、嘿咻与侧栏交互。
6
+
7
+ 所有 DSH 构建依赖固定为 0.2.1-rc.2,运行时 peerDependencies 与 engines.dsh 明确包含该预发布版本。不能仅根据声明判定兼容;升级前需在无生产凭据、无真实渠道的隔离容器验证。
8
+
9
+ 本次不修改 DSH 核心源码,不迁移或清理生产会话与插件数据。
10
+
11
+ ## 刷新与交互反馈补充修复
12
+
13
+ - 背景 WebGL/图集尚未就绪或不可用时,仍保留轻量界面反馈;减少动态、用户暂停、后台/失焦策略继续有效。
14
+ - 会话/目录行、原生 `data-files-entry` 文件按钮及实际输入卡片恢复轮廓向外扩散,不缩放控件本身。装饰层挂在 body,在 900ms 内跟随真实控件的位置与尺寸,不继承 shell.overlay 的坐标偏移;连续触发替换旧轮廓,失焦、暂停、减少动态和卸载均清理。
15
+ - 适配原生 `hidden="until-found"` 折叠:只清除外层的背景、边框、内边距与伪元素,避免回答结束后留下 24px 空白气泡;不改 `display`,保留页面搜索、原生展开和最终答复。
16
+ - 动效分块下载失败最多重试三次,成功只挂载一次,卸载取消重试并忽略迟到结果;失败保留静态背景。
17
+ - 页面从浏览器历史缓存恢复时重新同步焦点与动画状态。
18
+
19
+ 验证:主题测试 161 项通过、1 项已有跳过;浏览器契约验证浅深色轮廓坐标、变换祖先、输入框尺寸变化、连续触发及销毁,以及浅深色 × 手机/桌面折叠容器不留空白、展开内容正常、回写与元数据仍为纯文字。
20
+
21
+ 新版网页端默认工作步骤展示为“详细”(进行中展开、历史收起)。希望执行时就归入过程折叠项,可在 DSH 通用设置选择“标准”;主题不篡改宿主的展示偏好。
22
+
23
+ 轮廓细节恢复:沿用旧版左上、右下两个 4×32px 斜切粗块,分别向左上/右下移动并在 850ms 内淡出;与轮廓共用定位和销毁流程,不额外移动原生控件。
@@ -0,0 +1,24 @@
1
+ # 0.5.0 · 界隙主题 · DSH 0.2.1-rc.2
2
+
3
+ ## 兼容要求
4
+
5
+ - 适配 DSH **0.2.1-rc.2**,声明范围 `^0.2.1-rc.2`。
6
+ - Node.js **^22.19.0 或 >=24.0.0**。旧宿主请保留对应旧版主题。
7
+ - 更新后重启 DSH Profile 并刷新页面;无需修改官方核心代码。
8
+
9
+ ## 本版更新
10
+
11
+ - 白发人形小黑与深浅独立场景,淡蓝玻璃上栏、侧栏及会话材质。
12
+ - 完整界隙、柔和渐变、纯色专注切换整套外观,而不只替换壁纸。
13
+ - 保留耳朵、呆毛和嘿咻动态,固定身体、手臂、衣服与建筑。
14
+ - 恢复金属质感标志、轮廓扩散交互,调整首屏加载及外观偏好衔接。
15
+ - 修正会话元信息、工具区与回写状态的主题表现。
16
+ - 装饰独立延迟加载,后台暂停;减少重复背景绘制、相同尺寸画布重置及无变化的区域更新。
17
+
18
+ ## 验证与边界
19
+
20
+ - Node.js 22 构建及测试:189 项通过,1 项跳过。
21
+ - 本次性能修复已部署,容器健康检查通过,线上浏览器构建哈希与本地一致。
22
+ - 未量化用户浏览器刷新提速;不同 GPU、移动端与桌面端仍需实际体验验证。
23
+
24
+ [项目说明](https://github.com/lemoncat7/dsh-theme-xiaohei#readme)
@@ -0,0 +1,35 @@
1
+ # 界隙 React 交互重构 · 0.5.0-rift.2
2
+
3
+ 此版回应“只有背景变化,侧栏、选中、展开和对话缺少特色”的反馈,不替换或复制 DSH 的业务组件。React Bits 的局部光感、分层入场和边缘能量作为交互参考;没有复制其源码,也没有宣称使用其商业许可。
4
+
5
+ ## 视觉与联动
6
+
7
+ | 表面 | 静态身份 | 交互与关联 |
8
+ | --- | --- | --- |
9
+ | 左栏 | 斜向银纹、领域边界、斜切新会话入口 | 项目悬停光感;展开态边缘;展开时局部碎片 |
10
+ | 会话行 | 斜切选中边界、持续可见的裂隙定位 | 切换局部脉冲;当前会话执行时边线流动 |
11
+ | 首页印记 | 分裂的金属几何 | 输入聚焦时分开,失焦时合拢 |
12
+ | 输入框 | 双层金属边缘、异形圆角、独立工具栏 | 聚焦外缘聚光,开始执行时释放,完成时短暂回落 |
13
+ | 消息 | 用户为右侧重边界,助手为左侧裂隙与阅读层 | 原生消息、草稿、发送回显同族设计;空节点不产生幽灵空白 |
14
+ | 工具与代码 | 收纳在独立的低层级执行面板 | 保留原生 running / ok / error,错误不染成成功色 |
15
+ | 右栏 | 反向边缘、展开面与活动标签 | 保留文件、预览、操作与宿主布局;局部展开反馈 |
16
+ | 菜单与弹窗 | 斜切圆角、角部光照、统一输入与按钮边界 | 原生焦点/ESC/确认流程不变 |
17
+ | 背景 | 原有新制白发人形场景 | 聚焦和导航触发裂隙脉冲,执行增强能量,不再独自循环 |
18
+
19
+ ## 结构
20
+
21
+ - `field.tsx`:React 局部反馈挂到官方 `shell.overlay`。侧栏内仅保留 `RiftResonance` 状态仪表,收起侧栏不会卸载交互桥。
22
+ - `interaction.ts`:委托 click / focus / pointer 事件;只有当前悬停行在一个 RAF 内写入坐标。只观察根节点的语义状态属性,不按流式文本扫描整棵 DOM。
23
+ - `ui-styles.ts`:以官方 data-slot、data-row-key、ARIA 为主,少量 rc.2 class 后缀仅用于无公开 hook 的原生结构。
24
+ - `runtime.ts`:接收仅在内存里的 `xiaohei/rift-signal`。不通过 gateway、不追加 session 日志、不生成任何新工具调用。
25
+ - `@deepseek-ai/dsh-client-ui-layout` 只作为开发期类型依赖,实际 React 与 slots 由宿主提供。
26
+
27
+ 不移动鼠标指针,不拦截点击/拖拽,不向宿主固定弹窗祖先添加 transform/filter。装饰均 pointer-events:none。操作正确性不依赖 animationend;快速连续操作覆盖前一次动效,卸载时取消计时器、帧和监听。
28
+
29
+ ## 验收
30
+
31
+ 遵循 ui-ux-pro-max 的状态可辨识、可取消动画、可访问性与帧预算检查,不采用其与本工作台不匹配的营销页推荐。
32
+
33
+ 自动化覆盖输入聚焦、导航与展开、开始/完成状态去重、暂停/隐藏抑制、pointer 更新合并与完整卸载。浏览器验证真实 DSH 的原生项目、新会话选中、未发送草稿、收起侧栏后的聚焦联动、设置弹窗、深浅色及窄屏。消息与工具使用 rc.2 渲染结构的本地 DOM 契约样例验证,样例不提交给服务器;不将其称为实际模型生成验收。
34
+
35
+ 仍需真实 macOS / Windows Desktop 显卡和各用户的历史会话验收。此版不是 Live2D,也不提供角色完整骨骼动画。
@@ -0,0 +1,39 @@
1
+ # 界隙预览 0.5.0-rift.1
2
+
3
+ 适配 DSH 0.2.0-rc.2。本地构建预览,尚未发布 npm 或合入 main。
4
+
5
+ ## 独立实现
6
+
7
+ - `src/rift/plugin.ts`:原生 slots、主题 token、会话状态绑定。
8
+ - `palette.ts` / `styles.ts`:石墨 / 冷瓷配色与统一界面材质。
9
+ - `runtime.ts`:装饰生命周期、可见性、偏好、上下文丢失和调度。
10
+ - `renderer.ts`:单 WebGL pass、局部形变和裂隙能量,没有全屏光线步进或 bloom 链。
11
+ - `motion.ts`:纯状态、画面尺寸与采样映射。
12
+ - `boot.ts`:首屏静态背景,无脚本、轮询或全树观察器。
13
+ - `scripts/build-rift.mjs`:只发布当前入口和场景 chunk,构建时拒绝旧视觉模块进入依赖图。
14
+
15
+ 必要的宿主适配(主题跟随、会话状态、延迟加载、草稿投影)沿用;旧视觉源码保留但不进入当前发布包。未改 DSH 核心或其他插件。
16
+
17
+ ## 动作边界
18
+
19
+ 原画为全新生成式二维场景,局部 UV 形变带来发梢、衣角和金属碎片的小幅运动。裂隙在执行中增强,进入或本轮结束时短暂脉冲。这不是完整角色骨骼动作,也不冒充 Live2D。
20
+
21
+ 关闭动效、失焦、页面隐藏、减少动态、窄屏(760px 以下)及省流模式不运行持续绘制;缺少 WebGL 或上下文丢失时保留静态图。恢复不补播后台积压动作。每帧最多约 120 万像素,非 Retina 全分辨率;空闲目标 12 fps、执行目标 24 fps。
22
+
23
+ ## 资源与交互
24
+
25
+ 场景 WebP 78,268 字节,保留详细原稿于工作区 output/imagegen/xiaohei-rift-20261017。正式包只使用压缩场景,不包含旧图片图集。
26
+
27
+ 左栏底部“界隙动效”只控制主题装饰。键盘焦点、原生 hover、会话选择、模型切换、工作区选择和业务插件权限均由宿主负责。装饰层不接受指针事件,不对宿主祖先设置 transform / filter / backdrop-filter,不改变固定弹窗的定位坐标系。
28
+
29
+ 浅色使用冷瓷阅读面与原色场景,深色使用石墨面板;聊天时增加阅读背景,空白首页保留场景。长窗口适配人物位置、底部渐隐;窄屏优先保证输入与阅读。
30
+
31
+ ## 验证
32
+
33
+ 自动化覆盖:新入口无旧资源、启动背景幂等、调度门控、像素预算、两套文本与按钮对比度、无 WebGL 回退与清理,以及现有宿主适配回归。
34
+
35
+ 浏览器验收覆盖:真实 DSH 页面、深浅色、动效暂停/恢复、减少动态、失焦、窄屏、设置弹窗、只读打开既有会话。仅模拟运行状态用于动效测试,不提交测试消息,不触发模型或伙伴任务。
36
+
37
+ 无物理 macOS / Windows Desktop 真机验收;使用的是相同的 DSH 原生 chunk 和 slots 机制,没有新增浏览器专属 HTTP 接口。
38
+
39
+ 采用 ui-ux-pro-max 的可访问性和性能检查约束;未采用其不匹配工作台的营销页模板。部署时先备份主题与安装元数据,健康检查或页面验收失败则回滚该主题。
@@ -1,4 +1,4 @@
1
- window.__ModuleLoader__.load({ id: "@lemoncat7/dsh-theme-xiaohei", chunk: "client.companion.js", factory: (require) => { var module = { exports: {} }; var exports = module.exports;
1
+ window.__ModuleLoader__.load({id:"@lemoncat7/dsh-theme-xiaohei",chunk:"client.companion.js",factory:(require)=>{var module={exports:{}};var exports=module.exports;
2
2
  "use strict";var Je=Object.defineProperty;var Fn=Object.getOwnPropertyDescriptor;var Cn=Object.getOwnPropertyNames;var zn=Object.prototype.hasOwnProperty;var Dn=(e,n)=>{for(var t in n)Je(e,t,{get:n[t],enumerable:!0})},Nn=(e,n,t,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of Cn(n))!zn.call(e,o)&&o!==t&&Je(e,o,{get:()=>n[o],enumerable:!(i=Fn(n,o))||i.enumerable});return e};var Xn=e=>Nn(Je({},"__esModule",{value:!0}),e);var So={};Dn(So,{installComposerBloub:()=>An});module.exports=Xn(So);var $=Math.PI*2,I=(e,n=0,t=1)=>e<n?n:e>t?t:e,w=(e,n,t)=>e+(n-e)*t,_={easeOutCubic:e=>1-(1-e)**3,easeInOutCubic:e=>e<.5?4*e**3:1-(-2*e+2)**3/2,easeOutQuint:e=>1-(1-e)**5};function Q(e,n,t=0){let i=e/n*$;return .55*Math.sin(i+t)+.3*Math.sin(2*i+t*1.7+1.1)+.15*Math.sin(3*i+t*2.3+2.4)}function he(e){let n=e>>>0;return()=>{n=n+1831565813>>>0;let t=Math.imul(n^n>>>15,1|n);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}}var b=e=>Math.round(e*100)/100;function et(e,n=.55,t=.62){let i=(e%360+360)%360,o=(1-Math.abs(2*t-1))*n,s=o*(1-Math.abs(i/60%2-1)),r=t-o/2,[a,c,u]=i<60?[o,s,0]:i<120?[s,o,0]:i<180?[0,o,s]:i<240?[0,s,o]:i<300?[s,0,o]:[o,0,s],l=p=>Math.round((p+r)*255).toString(16).padStart(2,"0");return`#${l(a)}${l(c)}${l(u)}`}function Rt(e,n,t,i,o=1){let s=e.phase+n*e.speed*$,r=Math.cos(e.tilt),a=Math.sin(e.tilt),c=Math.sqrt(Math.max(0,1-e.k*e.k)),u=64,l=e.sweep*$,p="",m="",f=null;for(let h=0;h<=u;h++){let x=s+h/u*l,y=Math.cos(x),d=Math.sin(x),v=e.a*(y*r+d*-a*e.k)+e.cx,k=e.a*(y*a+d*r*e.k)+e.cy,A=e.a*d*c<0,B=b(v*t),S=b(k*t),F=A!==f?"M":"L";A?m+=`${F}${B} ${S}`:p+=`${F}${B} ${S}`,f=A}let g=Math.cos(e.tilt)*e.a*t,M=Math.sin(e.tilt)*e.a*t;return{id:i,front:p,back:m,width:e.width*t,opacity:o,grad:{x1:b(e.cx*t-g),y1:b(e.cy*t-M),x2:b(e.cx*t+g),y2:b(e.cy*t+M),stops:[et(e.hue),et(e.hue+e.hueSpan*.5),et(e.hue+e.hueSpan)]}}}var W=he(659918),tt=Array.from({length:6},(e,n)=>({a:1.3+W()*.1,k:.05+W()*.4,tilt:n/6*Math.PI+W()*.5,speed:3+W()*.7,phase:W()*$,sweep:.6+W()*.25,hue:n*360/6+W()*30,hueSpan:60+W()*60,width:.05+W()*.012,cx:0,cy:.1})),Tt=Array.from({length:4},(e,n)=>({a:.78+n*.2,k:.05+n*.02,tilt:-.62+n*.05,speed:.3,phase:.06*n,sweep:.4,hue:95+n*62,hueSpan:100,width:.05,cx:0,cy:-.12})),nt=[-.557,-.013,.532],ot=.165,it=1.25,Ht=he(48879),Gn=Array.from({length:5},(e,n)=>({birth:n*.2,angle:Ht()*$,rho:.58+Ht()*.18}));function $t(e,n){let t=[];for(let i of Gn){let o=e-i.birth;if(o<0||o>.62)continue;let s=i.rho*Math.pow(.75,o*10),r=i.angle+o*100*Math.PI/180;t.push({x:Math.cos(r)*s*n,y:Math.sin(r)*s*n,r:(.04+.028*I(o/.55))*n,depth:I(1-s/.8),opacity:I(o/.06)*I((.62-o)/.08)})}return t}var Ot=he(49383),Bt=Array.from({length:4},(e,n)=>{let t=n-1.5;return{a:.85*(1+t*.03),k:.15/.85*(1+t*.16),tilt:34*Math.PI/180+t*.035,speed:210/360,phase:-n*.045+Ot()*.012,sweep:.34,hue:n*85+Ot()*20,hueSpan:80,width:.095,cx:0,cy:0}}),Lt=.129;var _t=-42,rt=1.003,Ft=.15,Ct=1.14,zt=.054;var Me=15.46,we=.186,ve=.412,Se={yaw:28.49,pitch:28.62,roll:-13},Te=e=>e*Math.PI/180;function $e(e,n,t){let i=Math.cos(t),o=Math.sin(t);return[[e[0]*i+n[0]*o,e[1]*i+n[1]*o,e[2]*i+n[2]*o],[n[0]*i-e[0]*o,n[1]*i-e[1]*o,n[2]*i-e[2]*o]]}function Be(e,n,t=Me){let i=[0,0,1],o=[1,0,0],s=[0,1,0];[i,o]=$e(i,o,Te(e.yaw)),[s,i]=$e(s,i,Te(e.pitch)),[o,s]=$e(o,s,Te(e.roll));let r=a=>{let[c,u]=$e(i,o,Te(t*a));return{x:c[0]*n,y:c[1]*n,a:u[0],b:u[1],c:s[0],d:s[1],depth:c[2]}};return[r(-1),r(1)]}var Dt=he(24301),Nt=(()=>{let e=[],n=1.4;for(;n<900;)e.push(n),n+=1.9+Dt()*2.7,Dt()<.18&&(e.push(n),n+=.24);return e})(),Un=.18;function Yn(e){e=(e%900+900)%900;for(let n=0;n<Nt.length;n++){let t=Nt[n];if(e<t)break;let i=(e-t)/Un;if(i>=0&&i<=1)return i<.45?1-i/.45:(i-.45)/.55}return 1}function Le(e,n={}){let{wander:t=1,blink:i=!0,float:o=!0}=n;return{dYaw:(Q(e,11.3,.4)*5.5+Q(e,3.7,2.1)*1.6)*t,dPitch:(Q(e,9.1,1.3)*4.2+Q(e,4.3,.7)*1.3)*t,dRoll:Q(e,13.7,3.2)*2.2*t,lid:i?Yn(e):1,driftX:o?Q(e,7.9,1.9)*.006:0,driftY:o?Q(e,5.3,.3)*.007:0,breath:o?1+Math.sin(e/3.4*Math.PI*2)*.005:1}}function Xt(e){return .06+.94*I(e)}var V=(e,n,t=0,i=1)=>({w:e,h:n,tilt:t,open:i}),U=(e,n,t=0,i=1)=>[V(e,n,t,i),V(e,n,-t,i)],st=[{id:"neutre",gaze:{...Se},split:Me,eyes:[V(we,ve),V(we,ve)]},{id:"attentif",gaze:{yaw:4,pitch:5,roll:-4},split:16,eyes:U(.21,.44)},{id:"surpris",gaze:{yaw:3,pitch:-3,roll:0},split:19,eyes:U(.45,.47)},{id:"excite",gaze:{yaw:6,pitch:-14,roll:0},split:19.5,eyes:U(.4,.56,-10)},{id:"heureux",gaze:{yaw:5,pitch:9,roll:0},split:17,eyes:U(.27,.17,14)},{id:"hilare",gaze:{yaw:4,pitch:14,roll:0},split:18,eyes:U(.34,.13,20)},{id:"colere",gaze:{yaw:3,pitch:7,roll:0},split:17,eyes:U(.34,.15,30)},{id:"triste",gaze:{yaw:3,pitch:-13,roll:0},split:16,eyes:U(.22,.4,-28)},{id:"effraye",gaze:{yaw:2,pitch:-20,roll:0},split:20.5,eyes:U(.4,.6)},{id:"mefiant",gaze:{yaw:12,pitch:6,roll:-6},split:16,eyes:[V(.21,.4),V(.22,.15)]},{id:"confus",gaze:{yaw:-14,pitch:3,roll:8},split:16.5,eyes:[V(.2,.44,-18),V(.28,.17,14)]},{id:"curieux",gaze:{yaw:16,pitch:-9,roll:-15},split:16.5,eyes:[V(.24,.46,-8),V(.2,.38,-8)]},{id:"fier",gaze:{yaw:5,pitch:17,roll:0},split:17,eyes:U(.3,.15,18)},{id:"timide",gaze:{yaw:-19,pitch:-14,roll:-7},split:14,eyes:U(.17,.3)},{id:"blase",gaze:{yaw:-22,pitch:2,roll:0},split:16,eyes:U(.3,.12)},{id:"somnolent",gaze:{yaw:6,pitch:-9,roll:-3},split:16,eyes:U(.2,.42,0,.42)}],$o=new Map(st.map(e=>[e.id,e]));var Gt=(e,n,t)=>({w:w(e.w,n.w,t),h:w(e.h,n.h,t),tilt:w(e.tilt??0,n.tilt??0,t),open:w(e.open,n.open,t)});function Ut(e,n,t){return{id:n.id,gaze:{yaw:w(e.gaze.yaw,n.gaze.yaw,t),pitch:w(e.gaze.pitch,n.gaze.pitch,t),roll:w(e.gaze.roll,n.gaze.roll,t)},split:w(e.split,n.split,t),eyes:[Gt(e.eyes[0],n.eyes[0],t),Gt(e.eyes[1],n.eyes[1],t)]}}var Yt={egg:[.8369,.8424,.8497,.8585,.8674,.8775,.8878,.8983,.9089,.9185,.9288,.9374,.9445,.9504,.9543,.9559,.9555,.9519,.9466,.9389,.9302,.9193,.9085,.8969,.8852,.8734,.8625,.8513,.8411,.8325,.8243,.8179,.8137,.8112,.8102,.8128,.8178,.8262,.8374,.8518,.8702,.8922,.9169,.9446,.9741,1.0023,1.0267,1.0433,1.0481,1.0393,1.0216,.997,.9697,.9418,.9169,.8949,.876,.8604,.849,.8394,.8337,.8314,.8305,.8326],hexagon:[.921,.9282,.9441,.9706,.9984,1.0059,.9896,.9562,.929,.9124,.9047,.9058,.9157,.9349,.9642,.9873,.9882,.9665,.9336,.9105,.8968,.8918,.8955,.908,.9293,.9611,.982,.9812,.959,.9282,.9089,.8978,.8964,.9026,.9189,.9439,.9778,.999,.9964,.9713,.9439,.9274,.9196,.9206,.9308,.9502,.9799,1.0121,1.0226,1.0071,.9752,.951,.9366,.9316,.9351,.9485,.9711,1.0026,1.0213,1.0155,.9863,.9547,.9347,.9232],triangle:[.7819,.8211,.8747,.944,1.0223,1.096,1.1401,1.134,1.0808,1.0047,.9265,.8603,.8104,.773,.745,.7273,.7151,.7118,.7148,.7245,.7427,.768,.8037,.8518,.9148,.9876,1.0583,1.1073,1.1109,1.0667,.994,.9164,.8482,.7948,.7555,.7261,.7056,.6925,.6859,.6869,.6938,.7084,.7305,.7615,.804,.8595,.9311,1.0092,1.0791,1.1171,1.1054,1.0501,.9779,.905,.845,.799,.7656,.7413,.7258,.716,.7146,.7204,.733,.7528]};var at=Array.from({length:64},(e,n)=>n/64*$),_e=at.map(Math.cos),Fe=at.map(Math.sin);function Ce(e,n={}){return{radii:[...Yt[e]],rot:0,cx:0,cy:0,sx:1,sy:1,...n}}function re(e,n={}){return{radii:new Array(64).fill(e),rot:0,cx:0,cy:0,sx:1,sy:1,...n}}function Vt(e,n,t,i){let o=i??{radii:new Array(64),rot:0,cx:0,cy:0,sx:1,sy:1};for(let r=0;r<64;r++)o.radii[r]=w(e.radii[r]??1,n.radii[r]??1,t);let s=n.rot-e.rot;for(;s>Math.PI;)s-=$;for(;s<-Math.PI;)s+=$;return o.rot=e.rot+s*t,o.cx=w(e.cx,n.cx,t),o.cy=w(e.cy,n.cy,t),o.sx=w(e.sx,n.sx,t),o.sy=w(e.sy,n.sy,t),o}function Ie(e,n,t=[]){let i=Math.cos(e.rot),o=Math.sin(e.rot);for(let s=0;s<64;s++){let r=e.radii[s]??1,a=r*(_e[s]??0),c=r*(Fe[s]??0),u=a*i-c*o,l=a*o+c*i,p=t[s]??{x:0,y:0};p.x=(u*e.sx+e.cx)*n,p.y=(l*e.sy+e.cy)*n,t[s]=p}return t.length=64,t}function qt(e,n=1/6){let t=e.length;if(t<3)return"";let i=e[0],o=`M${b(i.x)} ${b(i.y)}`;for(let s=0;s<t;s++){let r=e[(s-1+t)%t],a=e[s],c=e[(s+1)%t],u=e[(s+2)%t],l=a.x+(c.x-r.x)*n,p=a.y+(c.y-r.y)*n,m=c.x-(u.x-a.x)*n,f=c.y-(u.y-a.y)*n;o+=`C${b(l)} ${b(p)} ${b(m)} ${b(f)} ${b(c.x)} ${b(c.y)}`}return`${o}Z`}function se(e,n,t){let i=new Array(64).fill(0),o=e.length;for(let s=0;s<64;s++){let r=_e[s]??0,a=Fe[s]??0,c=0;for(let u=0;u<o;u++){let l=e[u],p=e[(u+1)%o],m=p.x-l.x,f=p.y-l.y,g=r*f-a*m;if(Math.abs(g)<1e-9)continue;let M=l.x-n,h=l.y-t,x=(M*f-h*m)/g,y=(M*a-h*r)/g;x>c&&y>=0&&y<=1&&(c=x)}i[s]=c}return i}function ae(e,n,t,i,o,s,r=96){let a=i-e,c=o-n,u=Math.hypot(a,c)||1e-6,l=Math.atan2(c,a),p=Math.acos(Math.max(-1,Math.min(1,(t-s)/u))),m=[];for(let f=0;f<=r/2;f++){let g=l+p+($-2*p)*f/(r/2);m.push({x:e+Math.cos(g)*t,y:n+Math.sin(g)*t})}for(let f=0;f<=r/2;f++){let g=l-p+2*p*f/(r/2);m.push({x:i+Math.cos(g)*s,y:o+Math.sin(g)*s})}return m}function ze(e,n){let t=e.length,i=(n/$%1+1)%1*t,o=Math.floor(i);return w(e[o%t]??1,e[(o+1)%t]??1,i-o)}function De(e,n=1,t=1){return at.map((i,o)=>{let s=Math.abs((_e[o]??0)/n)**e,r=Math.abs((Fe[o]??0)/t)**e;return(s+r)**(-1/e)})}function Wt(e){let n=new Array(64).fill(0);for(let t=0;t<64;t++){let i=_e[t]??0,o=Fe[t]??0,s=0;for(let r of e){let a=i*r.x+o*r.y,c=a*a-(r.x*r.x+r.y*r.y-r.r*r.r);if(c<0)continue;let u=a+Math.sqrt(c);u>s&&(s=u)}n[t]=s}return n}function Vn(e,n,t=10){let i=e.length,o=[],s=(r,a)=>{let c=a.x-r.x,u=a.y-r.y,l=Math.hypot(c,u)||1;return Math.atan2(-c/l,u/l)};for(let r=0;r<i;r++){let a=e[(r-1+i)%i],c=e[r],u=e[(r+1)%i],l=s(a,c),m=s(c,u)-l;for(;m>Math.PI;)m-=$;for(;m<-Math.PI;)m+=$;for(let f=0;f<=t;f++){let g=l+m*f/t;o.push({x:c.x+Math.cos(g)*n,y:c.y+Math.sin(g)*n})}}return o}function ct(e,n,t,i=0){let o=i*Math.PI/180,s=Array.from({length:e},(r,a)=>{let c=o+a/e*$;return{x:Math.cos(c)*(n-t),y:Math.sin(c)*(n-t)}});return se(Vn(s,t),0,0)}function Kt(e,n=1){if(e.length<3)return"";let t="";for(let i=0;i<e.length;i++){let o=e[i];t+=`${i===0?"M":"L"}${b(o.x*n)} ${b(o.y*n)}`}return`${t}Z`}function jt(e,n){let t=Math.max(e,.01)/2,i=Math.max(n,.01)/2,o=Math.min(t,i);return`M${b(-t)} ${b(-i+o)}A${b(o)} ${b(o)} 0 0 1 ${b(-t+o)} ${b(-i)}L${b(t-o)} ${b(-i)}A${b(o)} ${b(o)} 0 0 1 ${b(t)} ${b(-i+o)}L${b(t)} ${b(i-o)}A${b(o)} ${b(o)} 0 0 1 ${b(t-o)} ${b(i)}L${b(-t+o)} ${b(i)}A${b(o)} ${b(o)} 0 0 1 ${b(-t)} ${b(i-o)}Z`}function Ne(e,n=1){let t=Math.max(...e);if(t<=0)return e;let i=n/t;return e.map(o=>o*i)}var qn=Array.from({length:64},(e,n)=>n/64*Math.PI*2),Wn=Ne(qn.map(e=>1+.075*Math.cos(2*e+.5)+.035*Math.cos(3*e+2.1)),1.02),Kn=Ne(Wt([{x:-.44,y:.2,r:.54},{x:.46,y:.2,r:.5},{x:.02,y:.3,r:.6},{x:-.24,y:-.3,r:.48},{x:.3,y:-.24,r:.44}]),1.02),jn=Ne(se(ae(0,.28,.66,0,-.96,.05),0,0),1.04),Qn=se(ae(-.42,0,.62,.42,0,.62),0,0),Xe=[{id:"cercle",radii:new Array(64).fill(1)},{id:"galet",radii:Wn},{id:"squircle",radii:Ne(De(4.2),1.15)},{id:"capsule",radii:Qn},{id:"triangle",radii:ct(3,1.12,.34,-90)},{id:"hexagone",radii:ct(6,1.04,.26,0)},{id:"nuage",radii:Kn},{id:"goutte",radii:jn}],No=new Map(Xe.map(e=>[e.id,e]));var Zn=[{id:"encre",hex:"#0a0a0c"},{id:"brun",hex:"#8b5e3c"},{id:"rouge",hex:"#e8483f"},{id:"orange",hex:"#f08a24"},{id:"ambre",hex:"#f0b429"},{id:"vert",hex:"#3ecf8e"},{id:"turquoise",hex:"#2fbfa0"},{id:"bleu",hex:"#3b93f0"},{id:"violet",hex:"#8b5cf6"},{id:"rose",hex:"#e152b0"},{id:"gris",hex:"#a3a3a3"},{id:"creme",hex:"#f1efe9"}],Xo=new Map(Zn.map(e=>[e.id,e]));var ce=(e,n)=>[{w:e,h:n,open:1},{w:e,h:n,open:1}];function z(e={}){return{sil:re(1),offX:0,offY:0,gaze:{...Se},split:Me,eyes:ce(we,ve),eyeAlpha:1,bodyAlpha:1,dots:[],arcs:[],notif:null,dotsBehind:!1,...e}}var en=-.1875,Jn=se(ae(0,-.505,.132,0,.13,.075),0,en),eo=se(ae(0,-.2535,.1345,0,.2535,.1345),0,0),to=(e={})=>({radii:[...Jn],rot:0,cx:0,cy:en,sx:1,sy:1,...e}),no=(e={})=>({radii:[...eo],rot:0,cx:0,cy:0,sx:1,sy:1,...e}),oo=Kt(ae(0,0,.118,0,.172,.012)),Qt=.213;function Zt(e){return Ce("triangle",{rot:e,cx:-Qt*Math.sin(e),cy:Qt*Math.cos(e)})}function Jt(e,n){let t=((e-n*.5)/1.5%1+1)%1,i=t<.5?.5-.5*Math.cos(t*$):0;return I(i*2)}var ut=[{id:"idle",duration:2.4,morph:.45,blinkIn:!1,baseFace:!0,baseBody:!0,pose:()=>z()},{id:"thinking",duration:2.6,morph:.4,baseFace:!1,baseBody:!1,blinkIn:!0,pose:e=>{let n=Jt(e,1),t=.3+.7*_.easeOutCubic(I(e/.3));return z({sil:re(ot*(1+(it-1)*n),{cx:nt[1]}),eyeAlpha:0,dots:[0,2].map(i=>{let o=Jt(e,i);return{x:nt[i]*t,y:0,r:ot*(1+(it-1)*o),opacity:.55+.45*o}})})}},{id:"wink",duration:1.6,morph:.3,blinkIn:!0,baseFace:!1,baseBody:!0,pose:()=>z({gaze:{yaw:-5.37,pitch:4.55,roll:6.7},split:16.25,eyes:[{w:.236,h:.464,open:1},{w:.447,h:.089,open:1}]})},{id:"wide",duration:1.8,morph:.55,blinkIn:!0,baseFace:!1,baseBody:!0,pose:()=>z({gaze:{yaw:6.92,pitch:-21.96,roll:11.6},split:18.43,eyes:ce(.356,.875)})},{id:"alert",duration:2.4,minDuration:2,morph:.45,baseFace:!1,baseBody:!1,blinkIn:!1,pose:e=>{let n=I(e/1.5),t=_.easeInOutCubic(n)*.82-.087,i=e>1.6?I((e-1.6)/.4):0,o=t*(1-i)+.1*i,s=Math.sin(e*2.5*$)*.005,r=17.7*Math.PI/180;return z({sil:no({rot:r,cx:o,cy:-.325-s}),eyeAlpha:0,dots:[{x:o-Math.sin(r)*.58,y:-.325+Math.cos(r)*.58+s*2.8,r:.118,d:oo,rot:r*180/Math.PI,opacity:1}]})}},{id:"notify",duration:2.2,morph:.5,blinkIn:!0,baseFace:!1,baseBody:!0,pose:e=>{let n=I(e/.45),t=1+(Ct-1)*Math.sin(n*Math.PI)*(1-n*.35),i=Ft*(n<1?t:1),o=_t*Math.PI/180;return z({gaze:{yaw:-21.94,pitch:-5.82,roll:-12.2},split:18.89,eyes:ce(.505,.498),notif:{x:Math.cos(o)*rt,y:Math.sin(o)*rt,r:i,notch:i+zt}})}},{id:"exclaim",duration:2,morph:.45,baseFace:!1,baseBody:!1,blinkIn:!1,pose:()=>z({sil:to(),eyeAlpha:0,dots:[{x:-.012,y:.526,r:.113,opacity:1}]})},{id:"sleep",duration:2.4,morph:.5,baseFace:!1,baseBody:!1,blinkIn:!1,pose:e=>z({sil:re(.1585,{cy:.11+Math.sin(e*($/.6))*.19}),eyeAlpha:0})},{id:"egg",duration:1.8,morph:.4,baseFace:!1,baseBody:!1,blinkIn:!0,pose:()=>z({sil:Ce("egg"),gaze:{yaw:19.97,pitch:26.01,roll:-17.1},split:11.07,eyes:ce(.164,.385)})},{id:"hexagon",duration:1.6,morph:.4,baseFace:!1,baseBody:!1,blinkIn:!0,pose:()=>z({sil:Ce("hexagon"),gaze:{yaw:23.11,pitch:24.42,roll:-13.3},split:13.37,eyes:ce(.177,.411)})},{id:"play",duration:2,morph:.5,baseFace:!1,baseBody:!1,blinkIn:!0,pose:e=>{let n=I(e/.35)*I((2.2-e)/.5);return z({sil:Zt(0),gaze:{yaw:12,pitch:-8,roll:-6},split:15,eyes:ce(.18,.34),arcs:Tt.map((t,i)=>({id:`sw${i}`,seed:{...t,cx:.45-e*.42},t:e,opacity:n}))})}},{id:"orbit",duration:3.4,minDuration:2.5,morph:.6,baseFace:!1,baseBody:!1,blinkIn:!1,pose:e=>{let n=_.easeInOutCubic(I(e/.35)),t=-$*1.25*e*n,i=_.easeInOutCubic(I((e-1.6)/.9)),o=Zt(t),s=re(1,{rot:t}),r={radii:o.radii.map((c,u)=>c+(s.radii[u]-c)*i),rot:t,cx:o.cx*(1-i),cy:o.cy*(1-i),sx:1,sy:1},a=I(e/.8)*I((3.6-e)/.9);return z({sil:r,gaze:{yaw:Se.yaw+Math.sin(e*6.5)*65*(1-i),pitch:-4+i*32,roll:-13},eyes:ce(.18,.34+i*.07),arcs:tt.map((c,u)=>({id:`rg${u}`,seed:c,t:e,opacity:a*I((e-u*.13)/.3)}))})}},{id:"swirl",duration:1.3,minDuration:1.3,morph:.3,baseFace:!0,baseBody:!0,blinkIn:!0,pose:e=>z({arcs:tt.slice(0,3).map((n,t)=>({id:`sw${t}`,seed:n,t:e,opacity:I((e-t*.06)/.14)*I((1.22-e)/.34)}))})},{id:"burst",duration:2.6,minDuration:2.4,morph:.4,baseFace:!1,baseBody:!1,blinkIn:!1,pose:e=>{let n=1-.834*_.easeOutQuint(I(e/.7)),t=_.easeOutQuint(I((e-1.7)/.7));return z({sil:re(n+(1-n)*t),eyeAlpha:I((e-1.85)/.4),dots:$t(e,1),dotsBehind:!0})}},{id:"comet",duration:2.4,minDuration:2.4,morph:.45,baseFace:!1,baseBody:!1,blinkIn:!1,pose:e=>{let n=1-(1-Lt)*_.easeOutQuint(I(e/.55)),t=_.easeOutQuint(I((e-1.85)/.6)),i=I((e-.15)/.25)*I((1.95-e)/.3);return z({sil:re(n+(1-n)*t,{cy:Math.sin(I(e/1.7)*Math.PI)*.035}),eyeAlpha:I((e-2)/.35),arcs:Bt.map((o,s)=>({id:`cm${s}`,seed:o,t:e,opacity:i}))})}}],Z=new Map(ut.map(e=>[e.id,e]));var K=100,tn=5.5+1.6,nn=4.2+1.3,io=.006,ro=.007;function on(e,n,t){let i=[],o=Be(e.gaze,K,e.split);for(let s=0;s<2;s++){let r=o[s];if(r.depth<=.02)continue;let a=e.eyes[s],c=(a.tilt??0)*Math.PI/180,u=Math.cos(c),l=Math.sin(c),p=r.a*u+r.c*l,m=r.b*u+r.d*l,f=-r.a*l+r.c*u,g=-r.b*l+r.d*u,M=Math.max(a.w*K,.01)/2,h=Math.max(a.h*K,.01)/2,x=Math.min(M,h),y=h>M,d=y?h-x:M-x,v=ze(t,Math.atan2(r.y,r.x)-n.rot);i.push({x:r.x*v,y:r.y*v,ax:(y?f:p)*d,ay:(y?g:m)*d,r:x,m:[p,m,f,g]})}return i}function so(e,n,t,i,o){let s=i-n,r=o-t,a=s*s+r*r,c=1/0,u=0,l=0;for(let m=0;m<e.length;m++){let f=e[m],g=a>0?((f.x-n)*s+(f.y-t)*r)/a:0;g=g<0?0:g>1?1:g;let M=n+g*s-f.x,h=t+g*r-f.y,x=M*M+h*h;x<c&&(c=x,u=M,l=h)}let p=Math.sqrt(c);return{d:p,ux:p>1e-9?u/p:0,uy:p>1e-9?l/p:0}}var ao=Math.hypot(io,ro)*K;function rn(e,n,t,i){let o=1/0,s=0,r=0;for(let a of n){let c=a.x+t,u=a.y+i,l=so(e,c-a.ax,u-a.ay,c+a.ax,u+a.ay),[p,m,f,g]=a.m,M=a.r*Math.hypot(p*l.ux+m*l.uy,f*l.ux+g*l.uy)+ao;l.d-M<o&&(o=l.d-M,s=l.ux,r=l.uy)}return{marge:o,ux:s,uy:r}}var sn=12,co=8;function uo(e){if(!e.length)return{x:0,y:0};let n=(x,y)=>{let d=1/0;for(let v of e)d=Math.min(d,rn(v.contour,v.empreintes,x,y).marge);return d},t=1/0;for(let x of e)t=Math.min(t,rn(x.calContour,x.reference,0,0).marge);let i=0,o=0,s=e[0].empreintes;for(let x of s)i-=x.x/s.length,o-=x.y/s.length;let r=Math.max(.35*K,Math.hypot(i,o)*1.25);t=Math.min(t,n(i,o));let a=n(0,0);if(a>=t&&a>=0)return{x:0,y:0};let c=Math.max(t,0),u=0,l=0,p=1/0,m=0,f=0,g=a;for(let x=0;x<sn;x++){let y=x/sn*Math.PI*2,d=Math.cos(y),v=Math.sin(y);if(n(d*r,v*r)<c){for(let A of[.3,.6,1]){let B=n(d*r*A,v*r*A);B>g&&(g=B,m=d*r*A,f=v*r*A)}continue}let k=0,R=r;for(let A=0;A<co;A++){let B=(k+R)/2;n(d*B,v*B)>=c?R=B:k=B}R<p&&(p=R,u=d*R,l=v*R)}let M=p===1/0?m:u,h=p===1/0?f:l;return{x:+(M/K).toFixed(6),y:+(h/K).toFixed(6)}}function lo(e,n,t){return e.baseFace&&t?{gaze:t.gaze,split:t.split,eyes:t.eyes}:{gaze:n.gaze,split:n.split,eyes:n.eyes}}function po(e){let n=i=>JSON.stringify([i.gaze,i.split,i.eyes,i.sil.rot,i.sil.cx,i.sil.cy,i.sil.sx,i.sil.sy]);if(n(e.pose(0))===n(e.pose(e.duration)))return[0];let t=3;return Array.from({length:t},(i,o)=>o/(t-1)*e.duration)}function ho(e,n,t){let i=[];for(let o of po(e)){let s=e.pose(o),r=Ie({...s.sil,radii:n},K),a=Ie(s.sil,K),c=lo(e,s,t),u=[];for(let l of[-tn,tn])for(let p of[-nn,nn])u.push({...c,gaze:{yaw:c.gaze.yaw+l,pitch:c.gaze.pitch+p,roll:c.gaze.roll}});for(let l of u)i.push({empreintes:on(l,s.sil,n),reference:on(l,s.sil,s.sil.radii),contour:r,calContour:a})}return uo(i)}var lt={x:0,y:0},pt=(e,n)=>`${e}|${n??""}`;function mo(){return new Map(Xe.map(e=>{let n=new Map;for(let t of ut){if(!t.baseBody)continue;let i=t.baseFace?[null,...st]:[null];for(let o of i)n.set(pt(t.id,o?.id??null),ho(t,e.radii,o))}return[e.radii,n]}))}var fo,xo=new Set(Xe.map(e=>e.radii));function ht(e,n,t){if(!e||!xo.has(e))return lt;let i=(fo??=mo()).get(e);return i?i.get(pt(n,t))??i.get(pt(n,null))??lt:lt}var dt={yaw:0,pitch:0,mix:0,spin:0,wander:1},bo=(e,n,t)=>({yaw:w(e.yaw,n.yaw,t),pitch:w(e.pitch,n.pitch,t),mix:w(e.mix,n.mix,t),spin:w(e.spin,n.spin,t),wander:w(e.wander,n.wander,t)}),an=(e,n,t)=>({w:w(e.w,n.w,t),h:w(e.h,n.h,t),open:w(e.open,n.open,t),tilt:w(e.tilt??0,n.tilt??0,t)});function cn(e,n,t){let i=1-t;return{sil:Vt(e.sil,n.sil,t),offX:w(e.offX,n.offX,t),offY:w(e.offY,n.offY,t),gaze:{yaw:w(e.gaze.yaw,n.gaze.yaw,t),pitch:w(e.gaze.pitch,n.gaze.pitch,t),roll:w(e.gaze.roll,n.gaze.roll,t)},split:w(e.split,n.split,t),eyes:[an(e.eyes[0],n.eyes[0],t),an(e.eyes[1],n.eyes[1],t)],eyeAlpha:w(e.eyeAlpha,n.eyeAlpha,t),bodyAlpha:w(e.bodyAlpha,n.bodyAlpha,t),dots:[...e.dots.map(o=>({...o,opacity:o.opacity*i})),...n.dots.map(o=>({...o,opacity:o.opacity*t}))],arcs:[...e.arcs.map(o=>({...o,id:`a${o.id}`,opacity:o.opacity*i})),...n.arcs.map(o=>({...o,id:`b${o.id}`,opacity:o.opacity*t}))],notif:e.notif&&n.notif?{x:w(e.notif.x,n.notif.x,t),y:w(e.notif.y,n.notif.y,t),r:w(e.notif.r,n.notif.r,t),notch:w(e.notif.notch,n.notif.notch,t)}:n.notif?{...n.notif,r:n.notif.r*t,notch:n.notif.notch*t}:e.notif?{...e.notif,r:e.notif.r*i,notch:e.notif.notch*i}:null,dotsBehind:t<.5?e.dotsBehind:n.dotsBehind}}var Ge=class e{scale;cur;prev=null;departFige=null;tCur=0;tPrev=0;blinkAt=-10;pts=[];shape=null;shapePrev=null;shapeAt=-10;expr=null;exprPrev=null;exprAt=-10;look=dt;lookPrev=dt;lookAt=-10;lookMorph=.24;static SHAPE_MORPH=.45;static LOOK_MORPH=.24;constructor(n=100,t="idle",i=null,o=null){this.scale=n,this.cur=t,this.shape=i,this.expr=o}setExpression(n,t=0){n!==this.expr&&(this.exprPrev=this.expr,this.expr=n,this.exprAt=t)}exprAtTime(n){let t=this.expr,i=this.exprPrev;if(!t||!i)return t;let o=(n-this.exprAt)/e.SHAPE_MORPH;return o>=1?t:Ut(i,t,_.easeOutQuint(I(o)))}setShape(n,t=0){n!==this.shape&&(this.shapePrev=this.shape,this.shape=n,this.shapeAt=t)}shapeAtTime(n){let t=this.shape,i=this.shapePrev;if(!t||!i)return t;let o=(n-this.shapeAt)/e.SHAPE_MORPH;if(o>=1)return t;let s=_.easeOutQuint(I(o));return t.map((r,a)=>w(i[a]??r,r,s))}setLook(n,t,i=e.LOOK_MORPH){n&&!Number.isFinite(n.yaw+n.pitch+n.mix+n.spin+n.wander)||(this.lookPrev=this.lookAtTime(t),this.look=n??dt,this.lookAt=t,this.lookMorph=i)}lookAtTime(n){let t=(n-this.lookAt)/this.lookMorph;return t>=1?this.look:bo(this.lookPrev,this.look,_.easeOutQuint(I(t)))}posed(n,t,i,o){let s=n.pose(t);return n.baseBody&&i&&(s={...s,sil:{...s.sil,radii:i}}),n.baseFace&&o&&(s={...s,gaze:o.gaze,split:o.split,eyes:o.eyes}),s}decalageAtTime(n,t){let i=(s,r,a,c)=>{if(a===c)return c;let u=(n-s)/r;if(u>=1)return c;let l=_.easeOutQuint(I(u));return{x:w(a.x,c.x,l),y:w(a.y,c.y,l)}},o=s=>i(this.exprAt,e.SHAPE_MORPH,ht(s,t,this.exprPrev?.id??null),ht(s,t,this.expr?.id??null));return i(this.shapeAt,e.SHAPE_MORPH,o(this.shapePrev),o(this.shape))}get state(){return this.cur}reset(n,t){this.cur=n,this.prev=null,this.departFige=null,this.tCur=t,this.tPrev=t,this.blinkAt=-10}origine(n,t,i){if(this.departFige)return this.departFige;if(!this.prev)return null;let o=Z.get(this.prev);return this.posed(o,Math.max(0,n-this.tPrev),t,i)}poseComposee(n){let t=Z.get(this.cur),i=this.shapeAtTime(n),o=this.exprAtTime(n),s=this.posed(t,Math.max(0,n-this.tCur),i,o),r=n-this.tCur;if(r>=t.morph)return s;let a=this.origine(n,i,o);return a?cn(a,s,_.easeOutQuint(I(r/t.morph))):s}setState(n,t){if(n===this.cur)return;let i=Z.get(this.cur).morph,o=this.prev!==null&&t-this.tCur<i;this.departFige=o?this.poseComposee(t):null,this.prev=this.cur,this.tPrev=this.tCur,this.cur=n,this.tCur=t,Z.get(n)?.blinkIn&&(this.blinkAt=t)}sample(n){let t=this.scale,i=Z.get(this.cur),o=this.shapeAtTime(n),s=this.exprAtTime(n),r=this.posed(i,Math.max(0,n-this.tCur),o,s),a=this.decalageAtTime(n,this.cur),c=n-this.tCur,u=c<i.morph?this.origine(n,o,s):null;if(u){let O=_.easeOutQuint(I(c/i.morph));r=cn(u,r,O);let N=this.prev;if(N){let H=this.decalageAtTime(n,N);a={x:w(H.x,a.x,O),y:w(H.y,a.y,O)}}}let l=r.eyeAlpha>.01,p=this.lookAtTime(n),m=Le(n,{wander:l?p.wander:0,blink:l}),f={yaw:w(r.gaze.yaw,p.yaw,p.mix)+m.dYaw-p.spin,pitch:w(r.gaze.pitch,p.pitch,p.mix)+m.dPitch,roll:r.gaze.roll+m.dRoll},g=I((n-this.blinkAt)/.2),M=g<1?Math.abs(g*2-1):1,h=Math.min(m.lid,M),x=r.offX+m.driftX,y=r.offY+m.driftY,d={...r.sil,cx:r.sil.cx+x,cy:r.sil.cy+y,sy:r.sil.sy*m.breath},v=qt(Ie(d,t,this.pts)),k=(O,N)=>ze(r.sil.radii,Math.atan2(N,O)-r.sil.rot),R=[];if(r.eyeAlpha>.01){let O=Be(f,t,r.split);for(let N=0;N<2;N++){let H=O[N];if(H.depth<=.02)continue;let q=r.eyes[N],J=k(H.x,H.y),de=(q.tilt??0)*Math.PI/180,D=Math.cos(de),ee=Math.sin(de),me=H.a*D+H.c*ee,j=H.b*D+H.d*ee,te=-H.a*ee+H.c*D,fe=-H.b*ee+H.d*D,xe=Xt(Math.min(h,q.open));R.push({width:q.w*t,height:q.h*t,openMatrix:`matrix(${b(me)},${b(j)},${b(te)},${b(fe)},${b(H.x*J+(x+a.x)*t)},${b(H.y*J+(y+a.y)*t)})`,lid:Math.min(h,q.open),d:jt(q.w*t,q.h*t),matrix:`matrix(${b(me)},${b(j*xe)},${b(te)},${b(fe*xe)},${b(H.x*J+(x+a.x)*t)},${b(H.y*J+(y+a.y)*t)})`,alpha:r.eyeAlpha*I(H.depth/.12)})}}let A=r.dots.filter(O=>O.opacity>.01&&O.r>5e-4).map(O=>({...O,x:(O.x+x)*t,y:(O.y+y)*t,r:O.r*t})),B=r.notif?k(r.notif.x,r.notif.y):1,S=r.notif?(r.notif.x*B+x)*t:0,F=r.notif?(r.notif.y*B+y)*t:0,Y=r.notif?{x:S,y:F,r:r.notif.r*t}:null,T=r.notif?{x:S,y:F,r:r.notif.notch*t}:null;return{bodyPath:v,bodyAlpha:r.bodyAlpha,eyes:R,dots:A,dotsBehind:r.dotsBehind,arcs:r.arcs.filter(O=>O.opacity>.01).map(O=>Rt(O.seed,O.t,t,O.id,O.opacity)),notif:Y,notch:T}}};var ke=new WeakMap;function un(e,n){let t=e.defaultView;if(e.body===void 0||t===null||typeof t.MutationObserver!="function")return()=>{};let i=ke.get(e);if(i===void 0){let s=new Set,r={listeners:s,queued:!1,records:[]},a=()=>{if(r.queued=!1,delete r.frame,ke.get(e)!==r)return;let c=r.records;r.records=[];for(let u of[...s])try{u(c)}catch(l){t.setTimeout(()=>{throw l},0)}};r.observer=new t.MutationObserver((c=[])=>{r.records.push(...c),!r.queued&&(r.queued=!0,typeof t.requestAnimationFrame=="function"?r.frame=t.requestAnimationFrame(a):queueMicrotask(a))}),r.observer.observe(e.body,{childList:!0,subtree:!0}),ke.set(e,r),i=r}i.listeners.add(n);let o=!0;return()=>{if(!o)return;o=!1;let s=ke.get(e);s!==void 0&&(s.listeners.delete(n),!(s.listeners.size>0)&&(s.observer?.disconnect(),s.frame!==void 0&&t.cancelAnimationFrame(s.frame),ke.delete(e)))}}var mt="[data-slot='sidebar']",Pe={sidebar:mt,sidebarShell:`#root ${mt} > div`,sidebarColumn:`#root :has(> ${mt})`,composerCard:"#root [data-composer-card='true']",composerHeroMark:"#root .xiaohei-brand-mark[data-brand-context='hero']",composerHeroRow:"[class*='_headline']"};var Ue=De(2.2,1,.89).map((e,n,t)=>{let i=n/t.length*Math.PI*2,o=(s,r,a)=>{let c=Math.atan2(Math.sin(i-s),Math.cos(i-s));return a*Math.exp(-.5*(c/r)**2)};return e*(1+.016*Math.sin(i))+o(6.12,.12,.065)+o(3.3,.12,.065)+o(4.04,.1,.025)}),hn={id:"neutre",gaze:{yaw:0,pitch:-7,roll:-2},split:26,eyes:[{w:.355,h:.48,open:1},{w:.34,h:.465,open:1}]},ft=Math.max(...Ue.map((e,n)=>e*Math.sin(n/Ue.length*Math.PI*2)))*100,ue={x:0,y:0,sx:1,sy:1,roll:0,lid:1,cheer:0},Ve=["greet","hop","wiggle"],ln=e=>{let n=Math.max(0,Math.min(1,e));return n*n*(3-2*n)},yo=e=>({...ue,...e}),go=Object.keys(ue);function pn(e,n,t){if(n===0||n===e.length-1)return 0;let i=e[n-1],o=e[n],s=e[n+1],r=o.at-i.at,a=s.at-o.at,c=(o.pose[t]-i.pose[t])/r,u=(s.pose[t]-o.pose[t])/a;if(c*u<=0)return 0;let l=2*a+r,p=a+2*r;return(l+p)/(l/c+p/u)}var Ye=class{start=0;keys=[];hover=0;hoverAt=0;hoverFrom=0;hoverTo=0;get end(){return this.start+(this.keys.at(-1)?.at??0)}reset(){this.keys=[],this.hover=this.hoverFrom=this.hoverTo=0}settle(n){let t=this.track(n);this.start=n,this.keys=[{at:0,pose:t},{at:.22,pose:{...ue}}],this.aim(0,n)}aim(n,t){this.hover=this.hoverFrom+(this.hoverTo-this.hoverFrom)*ln((t-this.hoverAt)/.28),this.hoverFrom=this.hover,this.hoverTo=Math.max(-1,Math.min(1,n)),this.hoverAt=t}track(n){if(!this.keys.length||n>=this.end)return{...ue};let t=Math.max(0,n-this.start),i=this.keys[0];for(let o=1;o<this.keys.length;o++){let s=this.keys[o];if(t<=s.at){let r=s.at-i.at,a=(t-i.at)/r,c=a*a,u=c*a,l={...i.pose};for(let p of go)l[p]=(2*u-3*c+1)*i.pose[p]+(-2*u+3*c)*s.pose[p]+(u-2*c+a)*r*pn(this.keys,o-1,p)+(u-c)*r*pn(this.keys,o,p);return l}i=s}return{...ue}}play(n,t,i=1){let o=this.track(t),s=i<0?-1:1,r=[{at:0,pose:o}],a=(c,u)=>r.push({at:c,pose:yo(u)});n==="greet"?(a(.09,{lid:.25,sy:.99,cheer:.35}),a(.16,{lid:0,sy:.985,cheer:.35,roll:-2*s}),a(.26,{y:-2,sy:1.005,roll:1*s}),a(.43,{y:-7,sx:.99,sy:1.015,roll:3*s}),a(.67,{sx:1.018,sy:.982,roll:-1*s}),a(.95,{})):n==="hop"?(a(.12,{sx:1.065,sy:.94,lid:.85,roll:-2*s}),a(.23,{sx:.97,sy:1.045,y:-14,roll:2*s}),a(.4,{sx:.99,sy:1.02,y:-28,roll:3*s}),a(.57,{sy:1.015,y:-14,roll:1*s}),a(.69,{sx:1.06,sy:.94,lid:.55,cheer:.3}),a(.8,{sx:.985,sy:1.02}),a(1.02,{})):(a(.18,{x:-2*s,roll:-7*s}),a(.38,{x:2*s,roll:7*s}),a(.55,{x:-1*s,roll:-3*s,lid:.3,cheer:.2}),a(.64,{roll:-1*s,lid:0,cheer:.2}),a(.78,{}),a(.96,{})),this.start=t,this.keys=r}sample(n){let t=this.track(n);return this.hover=this.hoverFrom+(this.hoverTo-this.hoverFrom)*ln((n-this.hoverAt)/.28),t.roll+=this.hover*5,t.x+=this.hover*4,t}};var Eo="http://www.w3.org/2000/svg";function dn(e,n,t,i,o,s){let r=h=>e.createElementNS(Eo,h),a=(h,x)=>{for(let[y,d]of Object.entries(x)){let v=String(d);h.getAttribute(y)!==v&&h.setAttribute(y,v)}},c=r("g"),u=r("g");i.append(c),o.append(u);let l=r("mask"),p=r("rect"),m=r("circle"),f=r("circle");a(l,{id:`${n}-notification`,maskUnits:"userSpaceOnUse",x:-200,y:-200,width:400,height:400,"mask-type":"luminance"}),a(p,{x:-200,y:-200,width:400,height:400,fill:"white"}),a(m,{fill:"black",r:0,"data-heixiu-notch":""}),a(f,{fill:"#dca964",display:"none","data-heixiu-notification":""}),l.append(p,m),t.append(l),o.append(f);let g=Array.from({length:12},()=>{let h=r("path");return a(h,{display:"none","data-heixiu-particle":""}),u.append(h),h}),M=Array.from({length:12},(h,x)=>{let y=r("linearGradient"),d=r("path"),v=r("path");a(y,{id:`${n}-arc-${x}`,gradientUnits:"userSpaceOnUse"});let k=Array.from({length:3},()=>r("stop"));y.append(...k),t.append(y);for(let R of[d,v])a(R,{fill:"none","stroke-linecap":"round",stroke:`url(#${n}-arc-${x})`,display:"none","data-heixiu-orbit":""});return i.append(d),o.append(v),{gradient:y,back:d,fore:v,stops:k}});return h=>{h.notif&&h.notch?(a(s,{mask:`url(#${n}-notification)`}),a(m,{cx:h.notch.x,cy:h.notch.y,r:h.notch.r}),a(f,{display:"inline",cx:h.notif.x,cy:h.notif.y,r:h.notif.r})):(s.getAttribute("mask")&&s.removeAttribute("mask"),a(m,{r:0}),a(f,{display:"none"}));for(let[x,y]of g.entries()){let d=h.dots[x];if(!d){a(y,{display:"none"});continue}let v=h.dotsBehind?c:u;y.parentNode!==v&&v.append(y);let k=d.r;a(y,{display:"inline",d:d.d??`M${-k} 0a${k} ${k} 0 1 0 ${k*2} 0a${k} ${k} 0 1 0 ${-k*2} 0`,transform:`translate(${d.x} ${d.y}) rotate(${d.rot??0}) scale(${d.d?100:1})`,fill:d.color??"var(--heixiu-ink)",opacity:d.opacity*(d.depth??1)})}for(let[x,y]of M.entries()){let d=h.arcs[x];if(!d){a(y.back,{display:"none"}),a(y.fore,{display:"none"});continue}a(y.gradient,{x1:d.grad.x1,y1:d.grad.y1,x2:d.grad.x2,y2:d.grad.y2});for(let[v,k]of y.stops.entries())a(k,{offset:v/2,"stop-color":d.grad.stops[Math.min(v,d.grad.stops.length-1)]??"#ddd"});for(let[v,k]of[[y.back,d.back],[y.fore,d.front]])a(v,{display:"inline",d:k,"stroke-width":d.width,opacity:d.opacity})}}}var Mo="http://www.w3.org/2000/svg",wo=0;function mn(e,n){let t=Math.max(0,Math.min(1,(e-20)/12));return{rx:Math.max(.01,Math.min(e,38)*(1+.15*t)),ry:Math.max(.01,Math.min(n,62)*.96)}}function vo(e){if(e.length!==2)return 1;let n=e.map(l=>l.openMatrix.slice(7,-1).split(/[ ,]+/).map(Number)),[t,i]=n;if(!t||!i||t.length!==6||i.length!==6||[...t,...i].some(l=>!Number.isFinite(l)))return 1;let o=i[4]-t[4],s=i[5]-t[5],r=Math.hypot(o,s);if(r<1)return .1;let a=o/r,c=s/r,u=e.reduce((l,p,m)=>{let f=n[m],{rx:g,ry:M}=mn(p.width,p.height);return l+Math.hypot(g*(f[0]*a+f[1]*c),M*(f[2]*a+f[3]*c))},0);return Math.min(1,Math.max(.1,(r-10)/Math.max(1,u)))}function fn(e){let n=h=>e.createElementNS(Mo,h),t=(h,x)=>{for(let[y,d]of Object.entries(x)){let v=String(d);h.getAttribute(y)!==v&&h.setAttribute(y,v)}},i=n("svg"),o=n("defs"),s=n("clipPath"),r=n("path"),a=`xiaohei-bloub-${++wo}`;t(i,{viewBox:`${-158} ${-158} ${316} ${316}`,"aria-hidden":"true",focusable:"false"}),t(s,{id:`${a}-body`,clipPathUnits:"userSpaceOnUse"}),s.append(r),o.append(s);let c=n("g"),u=n("path"),l=n("g");t(u,{fill:"var(--heixiu-ink)",stroke:"var(--heixiu-outline)","stroke-width":1.2,"data-heixiu-body":""}),t(l,{"clip-path":`url(#${a}-body)`,fill:"none",stroke:"#f5f3db","stroke-width":10.5});let p=[n("path"),n("path")];for(let h of p)t(h,{"data-heixiu-eye":"","stroke-linecap":"round","stroke-linejoin":"round"});l.append(...p),c.append(u,l);let m=n("g");t(m,{"data-heixiu-character":""}),m.append(c),i.append(o,m);let f;function g(){if(f)return;let h=n("g"),x=n("g");m.insertBefore(h,c),m.append(x),f=dn(e,a,o,h,x,c)}function M(h,x=ue){t(m,{transform:`translate(${x.x} ${x.y+ft}) rotate(${x.roll}) scale(${x.sx} ${x.sy}) translate(0 ${-ft})`}),t(u,{d:h.bodyPath}),t(r,{d:h.bodyPath}),t(c,{opacity:h.bodyAlpha});let y=vo(h.eyes);for(let[d,v]of p.entries()){let k=h.eyes[d];if(!k){t(v,{opacity:0});continue}let R=mn(k.width,k.height),A=R.rx*y,B=R.ry*y,S=Math.max(0,Math.min(k.lid,x.lid)),F=-A*.26*x.cheer*(1-S),Y=F-B*S*1.3333,T=F+B*S*1.3333,O=`M${-A} 0C${-A} ${Y} ${A} ${Y} ${A} 0C${A} ${T} ${-A} ${T} ${-A} 0Z`;t(v,{d:O,transform:k.openMatrix,opacity:k.alpha,"stroke-width":Math.min(10.5,A*.28)})}f?.(h)}return{svg:i,render:M,prepareEffects:g}}function xn(e,n,t){let i=t>760&&e-n>=114;return{mode:i?"outside":"compact",size:i?96:52}}function bn(e,n,t,i){if(e.width<=0||e.height<=0||e.top+e.height>n.top)return;let o=i<=760?52:96,s=Math.max(t+6,e.left-o-(o===52?10:24));return{size:o,left:s-n.left,top:e.top+e.height/2-o/2-n.top}}function yn(e,n,t,i){let o=i?.size??t.size;return i?{left:e.left+n.left+i.left,top:e.top+n.top+i.top,width:o,height:o}:t.mode==="compact"?{left:e.left+n.left+4,top:e.top+n.top+6,width:o,height:o}:{left:e.left+n.left-18-o,top:e.top+e.height/2-o/2,width:o,height:o}}function gn(e,n){return!Number.isFinite(e)||!Number.isFinite(n)?{yaw:0,pitch:-7,mix:1,spin:0,wander:.35}:{yaw:Math.max(-14,Math.min(14,e/16)),pitch:-7-Math.max(-31,Math.min(9,n/16)),mix:1,spin:0,wander:0}}function En(e,n,t){if(!Number.isFinite(e)||!Number.isFinite(n))return{x:0,y:0};let i=Math.hypot(e,n),o=t?90:140;if(i>=o)return{x:0,y:0};let s=Math.max(0,Math.min(1,(i-o*.5)/(o*.5))),r=1-s*s*(3-2*s),a=Math.max(t?32:50,i);return{x:e/a*(t?2:5)*r,y:n/a*(t?1.5:3.5)*r}}var Mn=e=>({left:e.left,top:e.top,width:e.width,height:e.height});function wn(e){let n,t,i=()=>n?.playState==="running",o=()=>Math.max(0,Math.min(1,n?.effect?.getComputedTiming().progress??0)),s=(c,u)=>["left","top","width","height"].every(l=>Math.abs(c[l]-u[l])<1);function r(c){if(!i()||!t)return c;let u=o(),l=p=>t.from[p]+(t.to[p]-t.from[p])*u;return{left:l("left"),top:l("top"),width:l("width"),height:l("height")}}function a(){n&&(n.onfinish=null,n.cancel(),n=void 0),t=void 0,e.dataset.flying="false"}return{get active(){return i()},capture:r,target(c){if(!i()||!t)return c;let u=o(),{from:l,to:p}=t,m=l.width/p.width*(1-u)+u,f=c.width/m,g=c.height/m,M=(l.left+l.width/2-p.left-p.width/2)*(1-u),h=(l.top+l.height/2-p.top-p.height/2)*(1-u);return{left:c.left-M+(c.width-f)/2,top:c.top-h+(c.height-g)/2,width:f,height:g}},move(c,u,l){if(!l&&i()&&t&&s(t.to,u))return;let p=i()&&t?Math.max(80,t.duration-Number(n.currentTime??0)):950;if(a(),!c||l||typeof e.animate!="function"||!c.width||!u.width)return;let m=c.left+c.width/2-u.left-u.width/2,f=c.top+c.height/2-u.top-u.height/2;if(Math.hypot(m,f)<4&&Math.abs(c.width-u.width)<1)return;t={from:Mn(c),to:Mn(u),duration:p},n=e.animate([{transform:`translate(${m}px, ${f}px) scale(${c.width/u.width})`},{transform:"translate(0px, 0px) scale(1)"}],{duration:p,easing:"cubic-bezier(.22,.75,.2,1)"}),e.dataset.flying="true";let g=n;g.onfinish=()=>{n===g&&a()}},cancel:a}}var vn=e=>Number.isFinite(e)?Math.max(0,Math.min(.999999,e)):.5;function Sn(e=Math.random){return 2e4+Math.floor(vn(e())*2e4)}function In(e,n,t=Math.random){if(e<=1)return 0;let i=n>=0&&n<e,o=Math.floor(vn(t())*(i?e-1:e));return i&&o>=n?o+1:o}var kn=`
3
3
  #root [data-composer-card] > button.xiaohei-bloub {
4
4
  all: unset;
@@ -95,6 +95,5 @@ window.__ModuleLoader__.load({ id: "@lemoncat7/dsh-theme-xiaohei", chunk: "clien
95
95
  #root [data-composer-card] > button.xiaohei-bloub { display: none; }
96
96
  #root [data-composer-card][data-heixiu-dock='compact'] { padding-inline-start: 12px !important; }
97
97
  }
98
- `;var Pn=["burst","egg","orbit","hexagon","wink","wide","exclaim","alert","sleep","thinking","notify"],xt=["burst","egg","orbit","hexagon","wink","wide","sleep"];function An(e=typeof document>"u"?void 0:document,n){let t=e?.defaultView;if(!e||!t)return()=>{};let i=e.createElement("style");i.textContent=kn,e.head.append(i);let o=e.createElement("button");o.className="xiaohei-bloub",o.type="button",o.setAttribute("aria-label","\u9017\u9017\u563F\u54BB"),o.title="\u5355\u51FB\u9017\u9017\u563F\u54BB \xB7 \u53CC\u51FB\u8F6E\u6362\u53D8\u5F62\uFF08\u952E\u76D8 Shift+Enter\uFF09";let s=fn(e),r=e.createElement("span");r.className="xiaohei-bloub-drift",r.append(s.svg),o.append(r);let a=wn(o),c=new Ge(100,"idle",Ue,hn),u=new Ye,l={yaw:0,pitch:-7,mix:1,spin:0,wander:.35},p=l;c.setLook(l,0),s.render(c.sample(0));let m=!1,f=!1,g=!0,M=null,h=null,x=null,y=null,d,v,k,R,A,B=-1/0,S=0,F,Y=2.5,T=0,O=0,N=1,H=!1,q=0,J="",de="",D,ee=-1,me=-1/0,j=n?.getSnapshot(),te,fe=t.innerWidth,xe=t.innerHeight,be=t.matchMedia("(prefers-reduced-motion: reduce)"),le=typeof t.ResizeObserver=="function"?new t.ResizeObserver(()=>{g=!0,ye()}):void 0,bt=typeof t.IntersectionObserver=="function"?new t.IntersectionObserver(E=>{let P=E.find(L=>L.target===o);P&&(f=P.isIntersecting,pe())}):void 0;function Ae(){o.dataset.floating="false",He(0,0),D!==void 0&&t.clearTimeout(D),D=void 0,a.cancel(),k!==void 0&&t.cancelAnimationFrame(k),A!==void 0&&t.clearTimeout(A),R!==void 0&&t.clearTimeout(R),k=void 0,A=void 0,R=void 0,F=void 0}function He(E,P){let L=En(E,P,t.innerWidth<=760||M?.dataset.heixiuDock==="compact"),G=`${L.x.toFixed(3)}px`,ie=`${L.y.toFixed(3)}px`;G!==J&&(o.style.setProperty("--heixiu-follow-x",G),J=G),ie!==de&&(o.style.setProperty("--heixiu-follow-y",ie),de=ie)}function X(){return!m&&f&&!!M?.isConnected&&!e.hidden&&!be.matches}function Oe(E=Sn()){D!==void 0&&t.clearTimeout(D),D=void 0,X()&&(D=t.setTimeout(()=>{if(D=void 0,!!X()){if(T||j?.running||a.active||Date.now()-me<5e3){Oe(5e3);return}oe(xt[In(xt.length,ee)],"ambient")}},E))}function ne(E){Y=Math.max(Y,S+E),!(!X()||k!==void 0||A!==void 0)&&(R!==void 0&&t.clearTimeout(R),R=void 0,F=void 0,k=t.requestAnimationFrame(yt))}function yt(E){if(k=void 0,!X()){Ae();return}F!==void 0&&(S+=Math.min(.05,Math.max(0,(E-F)/1e3))),F=E,T&&S>=T&&(H=!1,c.setLook(p,S),T=0,c.setState("idle",S),o.dataset.action="idle",Y=Math.max(Y,S+.65),j?.running&&oe("thinking","session",!0)),s.render(c.sample(S),u.sample(S)),S<Y||T||Le(S).lid<.99?A=t.setTimeout(()=>{A=void 0,X()&&(k=t.requestAnimationFrame(yt))},1e3/30):(F=void 0,R=t.setTimeout(()=>{R=void 0,ne(1)},8e3))}function pe(){X()?(o.dataset.floating="true",ne(1),j?.running&&!T&&oe("thinking","session",!0),D===void 0&&Oe()):(Ae(),be.matches&&(c.reset("idle",S),c.setLook(l,S,.001),T=0,H=!1,u.reset(),S+=1,s.render(c.sample(S)),o.dataset.action="idle"))}function Hn(){if(v=void 0,m)return;let E=e.querySelector(Pe.composerCard),P=e.querySelector(Pe.sidebarShell),L=e.querySelector(Pe.composerHeroMark),G=!1;if((M!==E||h!==P||x!==L)&&(M?.removeAttribute("data-heixiu-dock"),le?.disconnect(),y?.removeAttribute("data-heixiu-hero-row"),M=E,h=P,x=L,g=!0,y=x?.closest(Pe.composerHeroRow)??null,y?.setAttribute("data-heixiu-hero-row",""),M&&le?.observe(M),h&&le?.observe(h),x&&le?.observe(x),y&&le?.observe(y),G=!0),!M){o.remove(),f=!1,Ae();return}if(o.parentElement!==M||M.lastElementChild===o){let Qe=[...M.children].reverse().find(Ze=>Ze!==o);o.hidden=!0,M.insertBefore(o,Qe??null),bt?.observe(o),g=!0,G=!0}if(G){ye();return}if(!g)return;g=!1;let ie=a.active,Tn=fe!==t.innerWidth||xe!==t.innerHeight,$n=a.capture(d),ge=M.getBoundingClientRect(),Bn={left:M.clientLeft||0,top:M.clientTop||0},St=h?.getBoundingClientRect().right??0,It=xn(ge.left,St,t.innerWidth),kt=x?.getBoundingClientRect(),Re=kt&&bn(kt,ge,St,t.innerWidth),Ln=yn(ge,Bn,It,Re||void 0);if(He(0,0),Re)for(let[Qe,Ze]of Object.entries(Re)){let Pt=`--heixiu-welcome-${Qe}`,At=`${Ze}px`;o.style.getPropertyValue(Pt)!==At&&o.style.setProperty(Pt,At)}let Ee=Re?"welcome":It.mode,_n=!Tn&&(ie||!!te&&te!==Ee&&(te==="welcome"||Ee==="welcome"));te=Ee,fe=t.innerWidth,xe=t.innerHeight,M.dataset.heixiuDock!==Ee&&(M.dataset.heixiuDock=Ee),d=Ln,o.hidden=!1,f=ge.width>0&&ge.height>0&&d.top+d.height>0&&d.top<t.innerHeight,pe(),X()&&_n?a.move($n,d,be.matches):a.cancel()}function ye(){m||v!==void 0||(v=t.requestAnimationFrame(Hn))}let gt=E=>{if(!X()||a.active||!d?.width)return;if(E.pointerType==="touch"){We();return}if(E.timeStamp-B<1e3/30)return;B=E.timeStamp;let P=E.clientX-(d.left+d.width/2),L=E.clientY-(d.top+d.height/2);He(P,L),p=gn(P,L),!H&&(N=P<0?-1:1,u.aim(Math.abs(P)<90&&Math.abs(L)<90?P/60:0,S),c.setLook(p,S),ne(.8))},We=()=>{He(0,0),p=l,X()&&!H&&(u.aim(0,S),c.setLook(l,S),ne(.8))},Et=E=>{if(E.stopPropagation(),!X()||E.detail>1||H&&E.detail>0)return;let P=O++%(Ve.length+1);if(P===Ve.length){oe("exclaim","manual");return}let L=Ve[P];H=!1,c.setState("idle",S),c.setLook(p,S),u.play(L,S,N),o.dataset.action=L,o.dataset.actionSource="manual",Oe(),T=u.end,ne(T-S+.65)};function oe(E,P,L=!1){let G=Z.get(E);s.prepareEffects(),u.settle(S),H=!0,c.setLook(null,S),c.setState(E,S),o.dataset.action=E,ee=xt.findIndex(ie=>ie===E),o.dataset.actionSource=P,T=L?1/0:S+Math.max(G.duration,G.minDuration??0),ne(Math.max(G.duration,G.minDuration??0)+.65),Oe()}let Ke=E=>{E.stopPropagation(),X()&&oe(Pn[q++%Pn.length],"manual")},Mt=E=>{E.key==="Enter"&&E.shiftKey&&(E.preventDefault(),E.repeat||Ke(E))},je=()=>{g=!0,ye()},wt=E=>{M?.contains(E.target)&&(me=Date.now())},On=n?.subscribe(()=>{let E=n.getSnapshot(),P=E.sessionId!==j?.sessionId;if(j=E,o.dataset.sessionState=E.running?"running":"idle",!X()){(T===1/0||o.dataset.actionSource==="session"||P)&&(T=0,H=!1,c.setState("idle",S),c.setLook(p,S),o.dataset.action="idle");return}(P||T===1/0&&!E.running)&&(T=0,H=!1,c.setState("idle",S),c.setLook(p,S),o.dataset.action="idle",ne(.65)),!P&&E.notice?oe(E.notice,"session"):E.running&&(!T||o.dataset.actionSource!=="session")&&oe("thinking","session",!0)})??(()=>{}),Rn=un(e,E=>{E.length&&E.every(P=>(P.target.nodeType===1?P.target:P.target.parentElement)?.closest("[data-chat-flow], .xiaohei-bloub"))||ye()}),vt=E=>{let P=E.target;(P===e||P===t||P instanceof t.Element&&(P.contains(M)||P.contains(h)))&&je()};return e.addEventListener("pointermove",gt,{passive:!0}),e.addEventListener("pointerleave",We),e.addEventListener("visibilitychange",pe),e.addEventListener("input",wt,{passive:!0}),o.addEventListener("click",Et),o.addEventListener("dblclick",Ke),o.addEventListener("keydown",Mt),t.addEventListener("resize",je,{passive:!0}),t.addEventListener("scroll",vt,{passive:!0,capture:!0}),be.addEventListener("change",pe),ye(),()=>{m=!0,Ae(),Rn(),On(),le?.disconnect(),bt?.disconnect(),v!==void 0&&t.cancelAnimationFrame(v),e.removeEventListener("pointermove",gt),e.removeEventListener("pointerleave",We),e.removeEventListener("visibilitychange",pe),o.removeEventListener("click",Et),e.removeEventListener("input",wt),o.removeEventListener("dblclick",Ke),o.removeEventListener("keydown",Mt),t.removeEventListener("resize",je),t.removeEventListener("scroll",vt,!0),be.removeEventListener("change",pe),y?.removeAttribute("data-heixiu-hero-row"),M?.removeAttribute("data-heixiu-dock"),o.remove(),i.remove()}}
99
- return module.exports; } });
100
- //# sourceMappingURL=client.companion.js.map
98
+ `;var Pn=["burst","egg","orbit","hexagon","wink","wide","exclaim","alert","sleep","thinking","notify"],xt=["burst","egg","orbit","hexagon","wink","wide","sleep"];function An(e=typeof document>"u"?void 0:document,n){let t=e?.defaultView;if(!e||!t)return()=>{};let i=e.createElement("style");i.textContent=kn,e.head.append(i);let o=e.createElement("button");o.className="xiaohei-bloub",o.type="button",o.setAttribute("aria-label","逗逗嘿咻"),o.title="单击逗逗嘿咻 · 双击轮换变形(键盘 Shift+Enter)";let s=fn(e),r=e.createElement("span");r.className="xiaohei-bloub-drift",r.append(s.svg),o.append(r);let a=wn(o),c=new Ge(100,"idle",Ue,hn),u=new Ye,l={yaw:0,pitch:-7,mix:1,spin:0,wander:.35},p=l;c.setLook(l,0),s.render(c.sample(0));let m=!1,f=!1,g=!0,M=null,h=null,x=null,y=null,d,v,k,R,A,B=-1/0,S=0,F,Y=2.5,T=0,O=0,N=1,H=!1,q=0,J="",de="",D,ee=-1,me=-1/0,j=n?.getSnapshot(),te,fe=t.innerWidth,xe=t.innerHeight,be=t.matchMedia("(prefers-reduced-motion: reduce)"),le=typeof t.ResizeObserver=="function"?new t.ResizeObserver(()=>{g=!0,ye()}):void 0,bt=typeof t.IntersectionObserver=="function"?new t.IntersectionObserver(E=>{let P=E.find(L=>L.target===o);P&&(f=P.isIntersecting,pe())}):void 0;function Ae(){o.dataset.floating="false",He(0,0),D!==void 0&&t.clearTimeout(D),D=void 0,a.cancel(),k!==void 0&&t.cancelAnimationFrame(k),A!==void 0&&t.clearTimeout(A),R!==void 0&&t.clearTimeout(R),k=void 0,A=void 0,R=void 0,F=void 0}function He(E,P){let L=En(E,P,t.innerWidth<=760||M?.dataset.heixiuDock==="compact"),G=`${L.x.toFixed(3)}px`,ie=`${L.y.toFixed(3)}px`;G!==J&&(o.style.setProperty("--heixiu-follow-x",G),J=G),ie!==de&&(o.style.setProperty("--heixiu-follow-y",ie),de=ie)}function X(){return!m&&f&&!!M?.isConnected&&!e.hidden&&!be.matches}function Oe(E=Sn()){D!==void 0&&t.clearTimeout(D),D=void 0,X()&&(D=t.setTimeout(()=>{if(D=void 0,!!X()){if(T||j?.running||a.active||Date.now()-me<5e3){Oe(5e3);return}oe(xt[In(xt.length,ee)],"ambient")}},E))}function ne(E){Y=Math.max(Y,S+E),!(!X()||k!==void 0||A!==void 0)&&(R!==void 0&&t.clearTimeout(R),R=void 0,F=void 0,k=t.requestAnimationFrame(yt))}function yt(E){if(k=void 0,!X()){Ae();return}F!==void 0&&(S+=Math.min(.05,Math.max(0,(E-F)/1e3))),F=E,T&&S>=T&&(H=!1,c.setLook(p,S),T=0,c.setState("idle",S),o.dataset.action="idle",Y=Math.max(Y,S+.65),j?.running&&oe("thinking","session",!0)),s.render(c.sample(S),u.sample(S)),S<Y||T||Le(S).lid<.99?A=t.setTimeout(()=>{A=void 0,X()&&(k=t.requestAnimationFrame(yt))},1e3/30):(F=void 0,R=t.setTimeout(()=>{R=void 0,ne(1)},8e3))}function pe(){X()?(o.dataset.floating="true",ne(1),j?.running&&!T&&oe("thinking","session",!0),D===void 0&&Oe()):(Ae(),be.matches&&(c.reset("idle",S),c.setLook(l,S,.001),T=0,H=!1,u.reset(),S+=1,s.render(c.sample(S)),o.dataset.action="idle"))}function Hn(){if(v=void 0,m)return;let E=e.querySelector(Pe.composerCard),P=e.querySelector(Pe.sidebarShell),L=e.querySelector(Pe.composerHeroMark),G=!1;if((M!==E||h!==P||x!==L)&&(M?.removeAttribute("data-heixiu-dock"),le?.disconnect(),y?.removeAttribute("data-heixiu-hero-row"),M=E,h=P,x=L,g=!0,y=x?.closest(Pe.composerHeroRow)??null,y?.setAttribute("data-heixiu-hero-row",""),M&&le?.observe(M),h&&le?.observe(h),x&&le?.observe(x),y&&le?.observe(y),G=!0),!M){o.remove(),f=!1,Ae();return}if(o.parentElement!==M||M.lastElementChild===o){let Qe=[...M.children].reverse().find(Ze=>Ze!==o);o.hidden=!0,M.insertBefore(o,Qe??null),bt?.observe(o),g=!0,G=!0}if(G){ye();return}if(!g)return;g=!1;let ie=a.active,Tn=fe!==t.innerWidth||xe!==t.innerHeight,$n=a.capture(d),ge=M.getBoundingClientRect(),Bn={left:M.clientLeft||0,top:M.clientTop||0},St=h?.getBoundingClientRect().right??0,It=xn(ge.left,St,t.innerWidth),kt=x?.getBoundingClientRect(),Re=kt&&bn(kt,ge,St,t.innerWidth),Ln=yn(ge,Bn,It,Re||void 0);if(He(0,0),Re)for(let[Qe,Ze]of Object.entries(Re)){let Pt=`--heixiu-welcome-${Qe}`,At=`${Ze}px`;o.style.getPropertyValue(Pt)!==At&&o.style.setProperty(Pt,At)}let Ee=Re?"welcome":It.mode,_n=!Tn&&(ie||!!te&&te!==Ee&&(te==="welcome"||Ee==="welcome"));te=Ee,fe=t.innerWidth,xe=t.innerHeight,M.dataset.heixiuDock!==Ee&&(M.dataset.heixiuDock=Ee),d=Ln,o.hidden=!1,f=ge.width>0&&ge.height>0&&d.top+d.height>0&&d.top<t.innerHeight,pe(),X()&&_n?a.move($n,d,be.matches):a.cancel()}function ye(){m||v!==void 0||(v=t.requestAnimationFrame(Hn))}let gt=E=>{if(!X()||a.active||!d?.width)return;if(E.pointerType==="touch"){We();return}if(E.timeStamp-B<1e3/30)return;B=E.timeStamp;let P=E.clientX-(d.left+d.width/2),L=E.clientY-(d.top+d.height/2);He(P,L),p=gn(P,L),!H&&(N=P<0?-1:1,u.aim(Math.abs(P)<90&&Math.abs(L)<90?P/60:0,S),c.setLook(p,S),ne(.8))},We=()=>{He(0,0),p=l,X()&&!H&&(u.aim(0,S),c.setLook(l,S),ne(.8))},Et=E=>{if(E.stopPropagation(),!X()||E.detail>1||H&&E.detail>0)return;let P=O++%(Ve.length+1);if(P===Ve.length){oe("exclaim","manual");return}let L=Ve[P];H=!1,c.setState("idle",S),c.setLook(p,S),u.play(L,S,N),o.dataset.action=L,o.dataset.actionSource="manual",Oe(),T=u.end,ne(T-S+.65)};function oe(E,P,L=!1){let G=Z.get(E);s.prepareEffects(),u.settle(S),H=!0,c.setLook(null,S),c.setState(E,S),o.dataset.action=E,ee=xt.findIndex(ie=>ie===E),o.dataset.actionSource=P,T=L?1/0:S+Math.max(G.duration,G.minDuration??0),ne(Math.max(G.duration,G.minDuration??0)+.65),Oe()}let Ke=E=>{E.stopPropagation(),X()&&oe(Pn[q++%Pn.length],"manual")},Mt=E=>{E.key==="Enter"&&E.shiftKey&&(E.preventDefault(),E.repeat||Ke(E))},je=()=>{g=!0,ye()},wt=E=>{M?.contains(E.target)&&(me=Date.now())},On=n?.subscribe(()=>{let E=n.getSnapshot(),P=E.sessionId!==j?.sessionId;if(j=E,o.dataset.sessionState=E.running?"running":"idle",!X()){(T===1/0||o.dataset.actionSource==="session"||P)&&(T=0,H=!1,c.setState("idle",S),c.setLook(p,S),o.dataset.action="idle");return}(P||T===1/0&&!E.running)&&(T=0,H=!1,c.setState("idle",S),c.setLook(p,S),o.dataset.action="idle",ne(.65)),!P&&E.notice?oe(E.notice,"session"):E.running&&(!T||o.dataset.actionSource!=="session")&&oe("thinking","session",!0)})??(()=>{}),Rn=un(e,E=>{E.length&&E.every(P=>(P.target.nodeType===1?P.target:P.target.parentElement)?.closest("[data-chat-flow], .xiaohei-bloub"))||ye()}),vt=E=>{let P=E.target;(P===e||P===t||P instanceof t.Element&&(P.contains(M)||P.contains(h)))&&je()};return e.addEventListener("pointermove",gt,{passive:!0}),e.addEventListener("pointerleave",We),e.addEventListener("visibilitychange",pe),e.addEventListener("input",wt,{passive:!0}),o.addEventListener("click",Et),o.addEventListener("dblclick",Ke),o.addEventListener("keydown",Mt),t.addEventListener("resize",je,{passive:!0}),t.addEventListener("scroll",vt,{passive:!0,capture:!0}),be.addEventListener("change",pe),ye(),()=>{m=!0,Ae(),Rn(),On(),le?.disconnect(),bt?.disconnect(),v!==void 0&&t.cancelAnimationFrame(v),e.removeEventListener("pointermove",gt),e.removeEventListener("pointerleave",We),e.removeEventListener("visibilitychange",pe),o.removeEventListener("click",Et),e.removeEventListener("input",wt),o.removeEventListener("dblclick",Ke),o.removeEventListener("keydown",Mt),t.removeEventListener("resize",je),t.removeEventListener("scroll",vt,!0),be.removeEventListener("change",pe),y?.removeAttribute("data-heixiu-hero-row"),M?.removeAttribute("data-heixiu-dock"),o.remove(),i.remove()}}
99
+ return module.exports;}});