@yuriai/web 0.2.38-beta.3 → 0.2.38-beta.5

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 (211) hide show
  1. package/dist/assets/{AgentAvatar-CAC4rKO_.js → AgentAvatar-CfpejA-o.js} +1 -1
  2. package/dist/assets/AssistantContactStatus-_0PxmEHN.js +3 -0
  3. package/dist/assets/AssistantUnreadBadge-O-9phsEJ.js +1 -0
  4. package/dist/assets/AssistantView-CqFwkHDU.js +1 -0
  5. package/dist/assets/DiagramView-qYMnnPzv.js +1 -0
  6. package/dist/assets/{FadeInOnReveal--aVey7kZ.js → FadeInOnReveal-B6GGwaY7.js} +1 -1
  7. package/dist/assets/GuiPluginPage-D8Tl5eZe.js +1 -0
  8. package/dist/assets/GuiPluginSurface-CxcYHPiw.js +1 -0
  9. package/dist/assets/GuiPluginWindow-BuGtfRjB.js +1 -0
  10. package/dist/assets/{Icon-h0JiZMjp.js → Icon-AqWbQ-aO.js} +1 -1
  11. package/dist/assets/ImageLoadingPlaceholder-BaWRq0Oj.js +1 -0
  12. package/dist/assets/LoadingImage-CsNAJ7VA.js +1 -0
  13. package/dist/assets/MarkdownRenderer-BdfXY4lC.js +2 -0
  14. package/dist/assets/{MarkdownRendererImpl-MYwBFYBA.js → MarkdownRendererImpl-Dk1Ph8dy.js} +3 -3
  15. package/dist/assets/MarkstreamRendererImpl-DyPRvrql.js +3 -0
  16. package/dist/assets/MobileDetailNavigation-EEjgCwp2.js +1 -0
  17. package/dist/assets/MobileResizableSheet-CBHcyf1Z.js +1 -0
  18. package/dist/assets/MobileShareBridge-Dswz4WUo.js +3 -0
  19. package/dist/assets/MobileTabPageHeader-D3SrcPki.js +2 -0
  20. package/dist/assets/MultiRunWindow-CVicaUFS.js +1 -0
  21. package/dist/assets/OnboardingScreen-DRunDbYQ.js +1 -0
  22. package/dist/assets/{OverlayScrollbar-DMbq1jNO.js → OverlayScrollbar-D5p2e1RO.js} +1 -1
  23. package/dist/assets/SettingsView-U-pIjcB4.js +29 -0
  24. package/dist/assets/SettingsWindow-hd-ADhd3.js +1 -0
  25. package/dist/assets/SetupTourDialog-Cahv5gkl.js +1 -0
  26. package/dist/assets/TerminalView-D2ouVtum.js +8 -0
  27. package/dist/assets/ToolOutputDialog-CNm-8Knm.js +10 -0
  28. package/dist/assets/VoiceSettings-BUo82XOD.js +2 -0
  29. package/dist/assets/YuriLogo-DcoYyXzq.js +1 -0
  30. package/dist/assets/YuriWordmark-Dlsq3scd.js +1 -0
  31. package/dist/assets/appThemeRegistry-BbpJh1HH.js +1 -0
  32. package/dist/assets/{assistant-attachment-cache-C-SlEpSB.js → assistant-attachment-cache-Cmzt4xXE.js} +1 -1
  33. package/dist/assets/bootstrap-BhC95qVC.js +1 -0
  34. package/dist/assets/{capgoAdapter-C1AUTwaK.js → capgoAdapter-gTKxaGbj.js} +1 -1
  35. package/dist/assets/{checkbox-DR7tyhFb.js → checkbox-BQ_mKqEF.js} +1 -1
  36. package/dist/assets/{collapsible-C8DgipZf.js → collapsible-Dr6Y1Igi.js} +1 -1
  37. package/dist/assets/{context-menu-BfLJgbjE.js → context-menu-Dfu9gzKB.js} +1 -1
  38. package/dist/assets/desktopHosts-DovfbQPm.js +1 -0
  39. package/dist/assets/desktopRelayRestore-D4pbpNKN.js +1 -0
  40. package/dist/assets/device-DNG0cNwQ.js +2 -0
  41. package/dist/assets/{diagram-0lT2w7uS.js → diagram-B_HmL8LL.js} +1 -1
  42. package/dist/assets/dialog-pjai4m5O.js +1 -0
  43. package/dist/assets/{es-CrVDn7XV.js → es-30Wqm-Bx.js} +1 -1
  44. package/dist/assets/{fileMentionTouchSelection-BhQqAWYa.js → fileMentionTouchSelection-DxRRqdQ2.js} +1 -1
  45. package/dist/assets/{fileQueries-BaEKb7SZ.js → fileQueries-D9l0crnM.js} +1 -1
  46. package/dist/assets/fileReferenceActions-BRF8f7uA.js +1 -0
  47. package/dist/assets/{fileReferenceParser-BayaidRM.js → fileReferenceParser-1HHDBUum.js} +1 -1
  48. package/dist/assets/{fr-CCwt5AOu.js → fr-BbWLXNYa.js} +1 -1
  49. package/dist/assets/{gitApi-CWUhy6kY.js → gitApi-Dj03_3PE.js} +8 -8
  50. package/dist/assets/gitApiHttp-B1mApXwC.js +9 -0
  51. package/dist/assets/{gui-CFdPKvfq.js → gui-DN2sVP96.js} +1 -1
  52. package/dist/assets/{historyImportQueries-BrhVXQhP.js → historyImportQueries-DkB2_92i.js} +1 -1
  53. package/dist/assets/host-kMLXU0hK.js +1 -0
  54. package/dist/assets/i18n-BU14awhU.js +1 -0
  55. package/dist/assets/image-loading-DEXNCcCm.js +1 -0
  56. package/dist/assets/{input-Baq2dV0C.js → input-BlKTIfXo.js} +1 -1
  57. package/dist/assets/insertionBoundaries-Dmg74pH8.js +1 -0
  58. package/dist/assets/{ja-BfwjUNPc.js → ja-BI7m9bgW.js} +1 -1
  59. package/dist/assets/{ko-CZQZFkal.js → ko-B89SVFZa.js} +1 -1
  60. package/dist/assets/main-B0RPbUtx.js +2 -0
  61. package/dist/assets/main-D1vPyHl8.js +169 -0
  62. package/dist/assets/{markdownHeightCache-BEb1XAlf.js → markdownHeightCache-Ct6RXQq8.js} +1 -1
  63. package/dist/assets/mcpQueries-DqfD7_kv.js +1 -0
  64. package/dist/assets/miniChat-xjOkZhpT.js +2 -0
  65. package/dist/assets/mobile-8PDO4RhV.js +2 -0
  66. package/dist/assets/mobile-html-network-CPZnAlje.js +2 -0
  67. package/dist/assets/mobile-network-bridge-B_h92A-9.js +1 -0
  68. package/dist/assets/mobileBackNavigation-CnA0UqIL.js +1 -0
  69. package/dist/assets/mobileConnections-DMkh6DCw.js +2 -0
  70. package/dist/assets/modulepreload-polyfill-P2Xu9kJm.js +1 -0
  71. package/dist/assets/multirun-DsNq2b4Z.js +3 -0
  72. package/dist/assets/native-config-DpErLDXn.js +1 -0
  73. package/dist/assets/pages-CYkE04ml.js +1 -0
  74. package/dist/assets/path-utils-jGozTg9d.js +1 -0
  75. package/dist/assets/pathNormalization-ewtPqJWn.js +1 -0
  76. package/dist/assets/{pl-B6C3vXqv.js → pl-B55Lf3HE.js} +1 -1
  77. package/dist/assets/platform-DMsFWy1a.js +1 -0
  78. package/dist/assets/projectMeta-C3NpB0dz.js +1 -0
  79. package/dist/assets/{pt-BR-BUDTNopP.js → pt-BR-CFZj-ECy.js} +1 -1
  80. package/dist/assets/pwa-DCktk4PB.js +2 -0
  81. package/dist/assets/queue-abort-optimistic-BA_Hnkq2.js +1 -0
  82. package/dist/assets/react-Bch1-zoe.js +1 -0
  83. package/dist/assets/readiness-_wHN9DvW.js +1 -0
  84. package/dist/assets/reasoning-projection-client-BEhVknv9.js +1 -0
  85. package/dist/assets/renderElectronMiniChatApp-Cp7Nw-Bb.js +2 -0
  86. package/dist/assets/renderMobileApp-C0aEpXl8.js +29 -0
  87. package/dist/assets/{runtime-auth-Bh3htXtG.js → runtime-auth-mjIpsk3N.js} +1 -1
  88. package/dist/assets/runtime-fetch-DKZOpfzo.js +1 -0
  89. package/dist/assets/runtime-file-download-DMY1k1af.js +1 -0
  90. package/dist/assets/runtime-file-resource-CL7EVzOG.js +2 -0
  91. package/dist/assets/runtime-switch-BMjl5Y5W.js +1 -0
  92. package/dist/assets/runtimeAPIRegistry-C2VogTny.js +1 -0
  93. package/dist/assets/runtimeConfig-DySpB2Ms.js +2 -0
  94. package/dist/assets/runtimeEndpointReset-CTX1Lp2P.js +149 -0
  95. package/dist/assets/{scheduledTaskNavigation-C8tBjNoP.js → scheduledTaskNavigation-PH-etFzZ.js} +1 -1
  96. package/dist/assets/select-dzuHSnKA.js +1 -0
  97. package/dist/assets/sessionLookup-CEo8HV6T.js +1 -0
  98. package/dist/assets/sortable-tabs-strip-CQipbMoB.js +1 -0
  99. package/dist/assets/{speechSettingsQueries-C4eOkV7q.js → speechSettingsQueries-grq8zufg.js} +1 -1
  100. package/dist/assets/src-ByI2s7WK.css +2 -0
  101. package/dist/assets/{store-Myt_Fv8d.js → store-BNNIbb4k.js} +3 -3
  102. package/dist/assets/terminalApi-BXKIVBPo.js +1 -0
  103. package/dist/assets/textarea-C1IkHndn.js +1 -0
  104. package/dist/assets/{tooltip-CxneNjeR.js → tooltip-UtVoXY1Q.js} +1 -1
  105. package/dist/assets/{types-hxNDOWGs.js → types-9U-qp6Dn.js} +1 -1
  106. package/dist/assets/{uk-Ct9y1Y2t.js → uk-CS2c4Dtj.js} +1 -1
  107. package/dist/assets/{useAppFontEffects-C9muit_c.js → useAppFontEffects-ji7bphac.js} +50 -50
  108. package/dist/assets/{useAssistantUIStore-CVSFSgJV.js → useAssistantUIStore-Du8puXWz.js} +1 -1
  109. package/dist/assets/useDesktopWindowControlsLayout-B0tAK_6s.js +1 -0
  110. package/dist/assets/useDictation-CyWtsxSn.js +1 -0
  111. package/dist/assets/useEffectiveDirectory-D5CBpzcV.js +1 -0
  112. package/dist/assets/{useFontPreferences-DqBoLHp6.js → useFontPreferences-CAdw6cBK.js} +1 -1
  113. package/dist/assets/useMobileHtmlPreviewStore-C03uVLfX.js +1 -0
  114. package/dist/assets/useMobileNavigationStore-C90n-pQY.js +17 -0
  115. package/dist/assets/usePluginsStore-BdCWVg9s.js +1 -0
  116. package/dist/assets/useStreamingTextThrottle-CDpeNtel.js +1 -0
  117. package/dist/assets/useUIStore-BF882_0b.js +1 -0
  118. package/dist/assets/useWorkerHighlightedLines-BFi-QWq2.js +7 -0
  119. package/dist/assets/{zh-CN-BegPizz4.js → zh-CN-BpiwUUs4.js} +1 -1
  120. package/dist/assets/{zh-TW-4xftqQQG.js → zh-TW-Bl9CnlGi.js} +1 -1
  121. package/dist/index.html +26 -21
  122. package/dist/mini-chat.html +26 -21
  123. package/dist/mobile.html +4 -32
  124. package/package.json +1 -1
  125. package/server/index.js +10 -0
  126. package/server/lib/gui-customization/skill/references/global-pages.md +18 -3
  127. package/server/lib/gui-network/DOCUMENTATION.md +123 -0
  128. package/server/lib/gui-network/native-ios.test.js +127 -0
  129. package/server/lib/gui-network/runtime.js +146 -0
  130. package/server/lib/gui-network/runtime.test.js +129 -0
  131. package/server/lib/preview/proxy-runtime.js +1 -1
  132. package/server/lib/preview/proxy-runtime.test.js +4 -0
  133. package/server/lib/relay/DOCUMENTATION.md +5 -0
  134. package/server/lib/relay/tunnel-host.js +2 -1
  135. package/server/lib/ui-auth/DOCUMENTATION.md +8 -0
  136. package/server/lib/ui-auth/ui-auth.js +6 -0
  137. package/server/lib/ui-auth/ui-auth.test.js +10 -0
  138. package/dist/assets/AssistantContactStatus-Co_TnYMc.js +0 -3
  139. package/dist/assets/AssistantUnreadBadge-DqJFhaNg.js +0 -1
  140. package/dist/assets/AssistantView-D6fdLgFj.js +0 -1
  141. package/dist/assets/DiagramView-tx4upWOs.js +0 -1
  142. package/dist/assets/GuiPluginSurface-Bd3v_5A8.js +0 -1
  143. package/dist/assets/GuiPluginWindow-fy3lT5ns.js +0 -1
  144. package/dist/assets/ImageLoadingPlaceholder-A2tjfBfo.js +0 -1
  145. package/dist/assets/LoadingImage-C4DsIEui.js +0 -1
  146. package/dist/assets/MarkdownRenderer-BfAZBFzv.js +0 -2
  147. package/dist/assets/MarkstreamRendererImpl-13XA9vlX.js +0 -3
  148. package/dist/assets/MobileDetailNavigation-UU1cGYp2.js +0 -1
  149. package/dist/assets/MobileResizableSheet-nUZzBOmQ.js +0 -1
  150. package/dist/assets/MobileShareBridge-IWtj1SYy.js +0 -4
  151. package/dist/assets/MobileTabPageHeader-Diplic-W.js +0 -2
  152. package/dist/assets/MultiRunWindow-CHdpFi_v.js +0 -1
  153. package/dist/assets/OnboardingScreen-CeQxPD6C.js +0 -1
  154. package/dist/assets/SettingsView-CxHpCSsu.js +0 -29
  155. package/dist/assets/SettingsWindow-DEEHLurG.js +0 -1
  156. package/dist/assets/SetupTourDialog-5w42fqYN.js +0 -1
  157. package/dist/assets/TerminalView-DAx8JZmn.js +0 -8
  158. package/dist/assets/ToolOutputDialog-CbGuK5bP.css +0 -1
  159. package/dist/assets/ToolOutputDialog-CoKt-9rk.js +0 -10
  160. package/dist/assets/VoiceSettings-BFCJ8d-d.js +0 -2
  161. package/dist/assets/YuriLogo-BFawEKZ2.js +0 -1
  162. package/dist/assets/YuriWordmark-CJ8qJ14A.js +0 -1
  163. package/dist/assets/appThemeRegistry-CbyMACnN.js +0 -1
  164. package/dist/assets/bootstrap-BzeQds0D.js +0 -9
  165. package/dist/assets/desktop-Brp3xDpd.js +0 -1
  166. package/dist/assets/desktopHosts-qQ2Rz26_.js +0 -1
  167. package/dist/assets/desktopRelayRestore-DifJHAur.js +0 -1
  168. package/dist/assets/device-Db_TcRdX.js +0 -2
  169. package/dist/assets/dialog-Kz0pw-SO.js +0 -1
  170. package/dist/assets/fileReferenceActions-D06_lyuL.js +0 -1
  171. package/dist/assets/host-D_6AN-1g.js +0 -1
  172. package/dist/assets/image-loading-D1DfK_bJ.js +0 -1
  173. package/dist/assets/insertionBoundaries-Bfzw2QQw.js +0 -1
  174. package/dist/assets/main-CeqfStCn.js +0 -2
  175. package/dist/assets/main-c0X9U5aG.js +0 -169
  176. package/dist/assets/mcpQueries-DtBlC0VK.js +0 -1
  177. package/dist/assets/miniChat-TSOpbP39.js +0 -2
  178. package/dist/assets/mobile-W2QaGheB.js +0 -2
  179. package/dist/assets/mobileBackNavigation-Dy-OW7DB.js +0 -1
  180. package/dist/assets/multirun-O7LH-36l.js +0 -3
  181. package/dist/assets/native-config-CGAqvpqz.js +0 -1
  182. package/dist/assets/path-utils-HRmerlyU.js +0 -1
  183. package/dist/assets/platform-Dids8J9D.js +0 -1
  184. package/dist/assets/projectMeta-B2LbasoM.js +0 -1
  185. package/dist/assets/pwa-BHki-tGS.js +0 -2
  186. package/dist/assets/queue-abort-optimistic-DaJr8CmG.js +0 -1
  187. package/dist/assets/react-a6PrrNTm.js +0 -1
  188. package/dist/assets/readiness-DqfcV8R2.js +0 -1
  189. package/dist/assets/renderElectronMiniChatApp-Dlt2LoM5.js +0 -2
  190. package/dist/assets/renderMobileApp-BqUbrWSg.js +0 -28
  191. package/dist/assets/runtime-fetch-9B8F_rKW.js +0 -1
  192. package/dist/assets/runtime-file-download-D4WGSMk-.js +0 -1
  193. package/dist/assets/runtime-file-resource-tDTBpJT_.js +0 -2
  194. package/dist/assets/runtime-switch-ibQIZnws.js +0 -1
  195. package/dist/assets/runtimeConfig-k2t218IT.js +0 -2
  196. package/dist/assets/runtimeEndpointReset-_8oYno9l.js +0 -149
  197. package/dist/assets/select-DV9UcboH.js +0 -1
  198. package/dist/assets/sessionLookup-BBH2jvTL.js +0 -1
  199. package/dist/assets/sortable-tabs-strip-M-5RVko_.js +0 -1
  200. package/dist/assets/src-Bc4Nf__6.css +0 -2
  201. package/dist/assets/terminalApi-BXf0a2VZ.js +0 -1
  202. package/dist/assets/textarea-DWw42WmZ.js +0 -1
  203. package/dist/assets/url-DO6Zrx1P.js +0 -1
  204. package/dist/assets/useDesktopWindowControlsLayout-3SlaV4G-.js +0 -1
  205. package/dist/assets/useDictation-CgUBTlk5.js +0 -1
  206. package/dist/assets/useEffectiveDirectory-Dn3Z6Sbz.js +0 -1
  207. package/dist/assets/useMobileNavigationStore-ywElU2fl.js +0 -17
  208. package/dist/assets/usePluginsStore-BD47b67P.js +0 -1
  209. package/dist/assets/useStreamingTextThrottle-BDPkHk3Z.js +0 -1
  210. package/dist/assets/useUIStore-BsCfUWQw.js +0 -1
  211. package/dist/assets/useWorkerHighlightedLines-D9HhL0-T.js +0 -7
@@ -0,0 +1,3 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ToolOutputDialog-CNm-8Knm.js","assets/rolldown-runtime-hePW80VL.js","assets/runtime-auth-mjIpsk3N.js","assets/runtime-switch-BMjl5Y5W.js","assets/runtime-fetch-DKZOpfzo.js","assets/reasoning-projection-client-BEhVknv9.js","assets/platform-DMsFWy1a.js","assets/runtimeAPIRegistry-C2VogTny.js","assets/vendor-base-ui-CzHs0bHY.js","assets/useUIStore-BF882_0b.js","assets/vendor-zustand-vDaAPGfl.js","assets/brand-storage-bootstrap-D4BW3w-M.js","assets/brand-storage-migration-Bhz6UOBJ.js","assets/useMobileHtmlPreviewStore-C03uVLfX.js","assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js","assets/vendor-react-DlzBev0S.js","assets/vendor-tanstack-react-query-B-Wpqq5J.js","assets/vendor-tanstack-query-core-Y_YoRHtC.js","assets/runtime-file-resource-CL7EVzOG.js","assets/fileQueries-D9l0crnM.js","assets/runtime-file-store-BVRgEtI-.js","assets/path-utils-jGozTg9d.js","assets/runtime-file-download-DMY1k1af.js","assets/vendor-pierre-diffs-BFiZ3IhI.js","assets/vendor-hast-util-to-html-Bw_SgZ1t.js","assets/vendor-character-entities-legacy-Wut6vMuj.js","assets/vendor-character-entities-html4-DlN_yAFd.js","assets/vendor-ccount-CyGsA0u7.js","assets/vendor-comma-separated-tokens-B9ouxNNS.js","assets/vendor-oniguruma-to-es-CrHzjjSU.js","assets/vendor-oniguruma-parser-D2DIvhSP.js","assets/vendor-diff-Dq7CZNim.js","assets/vendor-lru_map-BMOrLc9L.js","assets/vendor-reactuses-core-CuTmqEMK.js","assets/vendor-lodash-es-BS45jPoZ.js","assets/vendor-js-cookie-hSOiFTtX.js","assets/i18n-BU14awhU.js","assets/bootstrap-BhC95qVC.js","assets/runtime-ead7P81A.js","assets/store-BNNIbb4k.js","assets/tour-DDI0Zg7l.js","assets/useMobileNavigationStore-C90n-pQY.js","assets/gitApiHttp-B1mApXwC.js","assets/vendor-opencode-client-cQ47ywrT.js","assets/vendor-effect-X1Hqc7ba.js","assets/vendor-pathe-vBmvQE8f.js","assets/pathNormalization-ewtPqJWn.js","assets/vendor-sonner-BEHGipm5.js","assets/useAssistantUIStore-Du8puXWz.js","assets/vendor-zod-DZzbCm1s.js","assets/vendor-opencode-schema-DWT45VBX.js","assets/vendor-class-variance-authority-BLUaYARZ.js","assets/vendor-tailwind-merge-BicNWLTg.js","assets/useThemeSystem-CNzUUkFn.js","assets/vendor-framer-motion-DDMKlXiP.js","assets/Icon-AqWbQ-aO.js","assets/dialog-pjai4m5O.js","assets/dialog-CTYD3Sbr.css","assets/tap-LkQum5bB.js","assets/themes-BgDJcxRc.js","assets/MarkdownRenderer-BdfXY4lC.js","assets/useEffectiveDirectory-D5CBpzcV.js","assets/markdownHeightCache-Ct6RXQq8.js","assets/dualLimitLru-D8Sphgua.js","assets/MobileWindowStack-DGLdgoGr.js","assets/appThemeRegistry-BbpJh1HH.js","assets/agentColors-DWSbQXy2.js","assets/rasterizePng-056Poix7.js","assets/toolHelpers-iEHVHQ9p.js","assets/image-loading-DEXNCcCm.js","assets/image-loading-D9Z_BASK.css","assets/ImageLoadingPlaceholder-BaWRq0Oj.js","assets/vendor-tanstack-react-virtual-DSFNK3qc.js","assets/useWorkerHighlightedLines-BFi-QWq2.js","assets/markdownTheme-CHNl6tUv.js","assets/markdown-worker-oBGEB9Eg.js","assets/mobileBackNavigation-CnA0UqIL.js","assets/touch-gestures-CErgaXZ7.js"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,n}from"./runtime-switch-BMjl5Y5W.js";import{n as r,r as i}from"./platform-DMsFWy1a.js";import{a}from"./vendor-zustand-vDaAPGfl.js";import{d as o,f as s,g as c,h as l,m as u,ot as d,p as f,st as p,u as m}from"./vendor-base-ui-CzHs0bHY.js";import{Cn as h,Ir as g,Sn as _,Tn as v,hn as y,mn as b,vn as x,xn as S}from"./gitApiHttp-B1mApXwC.js";import{r as C}from"./useUIStore-BF882_0b.js";import{n as w}from"./vendor-react-DlzBev0S.js";import{s as T}from"./vendor-tanstack-react-query-B-Wpqq5J.js";import{o as E}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{r as D}from"./bootstrap-BhC95qVC.js";import{a as O,f as k,i as A,o as j,p as ee,r as M}from"./vendor-reactuses-core-CuTmqEMK.js";import{t as te}from"./i18n-BU14awhU.js";import{N as ne,T as N,_ as P,f as re,g as ie,h as F,j as I,n as L,r as R,u as z,v as B,w as V}from"./MobileDetailNavigation-EEjgCwp2.js";import{Ba as ae,Ct as oe,Jn as H,K as U,Kn as W,oi as se,or as G,s as K,si as ce}from"./useMobileNavigationStore-C90n-pQY.js";import{n as le}from"./useAssistantUIStore-Du8puXWz.js";import{a as ue,r as de}from"./MobileShareBridge-Dswz4WUo.js";import{a as fe}from"./fileMentionAutocompleteState-BZJqfgae.js";import{o as pe,p as me,t as he}from"./AgentAvatar-CfpejA-o.js";import{d as ge,o as _e,t as ve}from"./vendor-framer-motion-DDMKlXiP.js";import{n as q}from"./Icon-AqWbQ-aO.js";import{t as ye}from"./scheduledTaskNavigation-PH-etFzZ.js";import{a as J,i as be,t as xe}from"./MarkdownRenderer-BdfXY4lC.js";import{D as Se,E as Y,O as Ce,a as we,c as Te,d as Ee,f as De,g as Oe,h as ke,l as Ae,m as je,o as X,s as Me,t as Ne,u as Pe,w as Fe,x as Ie}from"./sessionLookup-CEo8HV6T.js";import{a as Le,n as Re,r as ze,t as Be}from"./fileMentionTouchSelection-DxRRqdQ2.js";import{c as Ve,s as He}from"./image-loading-DEXNCcCm.js";import{t as Ue}from"./ImageLoadingPlaceholder-BaWRq0Oj.js";import{t as We}from"./LoadingImage-CsNAJ7VA.js";import{n as Ge}from"./textarea-C1IkHndn.js";import{t as Ke}from"./vendor-motion-C9oiAdx-.js";import{i as qe,n as Je,r as Ye}from"./assistant-attachment-cache-Cmzt4xXE.js";var Z=w(),Q=e(p(),1),$=d();function Xe(e){let i=(0,Z.c)(12),{assistantID:a,position:o}=e,s=Q.useRef(null),c=Q.useRef(!1),l;i[0]===Symbol.for(`react.memo_cache_sentinel`)?(l={busy:!1,done:!1,retryAt:0},i[0]=l):l=i[0];let u=Q.useRef(l),[d]=Q.useState(nt),f;i[1]!==a||i[2]!==o||i[3]!==d?(f=()=>{let e=s.current;if(!e||!c.current||u.current.busy||u.current.done||Date.now()<u.current.retryAt||d.transport!==t()||d.generation!==n()||document.visibilityState!==`visible`||(r()?!document.documentElement.classList.contains(`yuri-native-app-active`):!document.hasFocus())||e.parentElement?.closest(`[inert], [aria-hidden="true"]`))return;let i=e.closest(`[data-assistant-contact-transcript]`);if(!i||i.scrollHeight-i.scrollTop-i.clientHeight>2)return;let l=e.getBoundingClientRect(),f=i.getBoundingClientRect(),p=window.visualViewport,m=p?.offsetTop??0,h=m+(p?.height??window.innerHeight);l.height<=0||l.width<=0||l.bottom>Math.min(f.bottom,h)||l.top<Math.max(f.top,m)||l.right<=Math.max(f.left,0)||l.left>=Math.min(f.right,window.innerWidth)||(u.current.busy=!0,z(a,o).then(()=>{u.current.done=!0}).catch(()=>{u.current.retryAt=Date.now()+15e3}).finally(()=>{u.current.busy=!1}))},i[1]=a,i[2]=o,i[3]=d,i[4]=f):f=i[4];let p=M(f),m;i[5]===p?m=i[6]:(m=e=>{c.current=e.some(tt),p()},i[5]=p,i[6]=m);let h;i[7]===Symbol.for(`react.memo_cache_sentinel`)?(h={threshold:1},i[7]=h):h=i[7],O(s,M(m),h),A(`visibilitychange`,p,et),A(`focus`,p,$e),A(`resize`,p,Qe);let g,_;i[8]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>s.current?.closest(`[data-assistant-contact-transcript]`),_={passive:!0},i[8]=g,i[9]=_):(g=i[8],_=i[9]),A(`scroll`,p,g,_);let v;i[10]===Symbol.for(`react.memo_cache_sentinel`)?(v={attributes:!0,attributeFilter:[`class`]},i[10]=v):v=i[10],k(p,Ze,v),j(p,15e3);let y;return i[11]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(`span`,{ref:s,"aria-hidden":`true`,className:`absolute bottom-0 left-0 block h-px w-px`,"data-assistant-read-marker":``}),i[11]=y):y=i[11],y}function Ze(){return document.documentElement}function Qe(){return window.visualViewport}function $e(){return window}function et(){return document}function tt(e){return e.isIntersecting&&e.intersectionRatio===1}function nt(){return{transport:t(),generation:n()}}var rt=()=>{},it=Q.memo(Ce),at=e=>e?.directories.flatMap(({directory:e,sessions:t})=>e?t.filter(e=>!e.time.archived).map(t=>({...t,directory:e||t.location?.directory||t.directory||``})).filter(e=>e.directory.length>0):[])??null,ot=Q.forwardRef(({query:e,isMobile:t,listId:n,onHighlightChange:r,onSelect:i,onClose:a},o)=>{let{t:s}=te(),c=Ve(),l=T({...ce(c),select:at}),u=Q.useMemo(()=>fe({sessions:l.data??[],currentSessionId:null,searchQuery:e,limit:e.trim()?10:3}),[l.data,e]),[d,f]=Q.useState({query:e,index:0}),p=Math.min(d.query===e?d.index:0,Math.max(0,u.length-1)),m=Q.useRef(null),h=Q.useRef([]),g=Q.useMemo(Be,[]);A(`pointerdown`,e=>{e.target instanceof Node&&!m.current?.contains(e.target)&&a()},void 0,{capture:!0}),Q.useLayoutEffect(()=>{h.current[p]?.scrollIntoView?.({block:`nearest`})},[p]),Q.useLayoutEffect(()=>{r(u.length?`${n}-${p}`:void 0)},[p,n,u.length,r]);let _=M(t=>{if(t===`Escape`){a();return}u.length&&(t===`ArrowDown`&&f({query:e,index:(p+1)%u.length}),t===`ArrowUp`&&f({query:e,index:(p-1+u.length)%u.length}),(t===`Enter`||t===`Tab`)&&i(u[p]))});return Q.useImperativeHandle(o,()=>({keyDown:_}),[_]),(0,$.jsxs)(Re,{ref:m,isMobile:t,className:`max-w-[640px] max-h-64`,children:[(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 px-3 py-1`,children:[(0,$.jsx)(`span`,{className:`min-w-0 flex-1 text-[length:calc(var(--text-meta)*0.875)] leading-4 text-muted-foreground`,children:s(`assistants.contact.sessionMention.scope`)}),(0,$.jsx)(W,{type:`button`,size:`xs`,variant:`ghost`,"aria-label":s(`dialog.common.actions.close`),onClick:a,children:(0,$.jsx)(q,{name:`close`,className:`size-4`})})]}),l.isPending?(0,$.jsx)(`p`,{role:`status`,className:`px-3 py-2 typography-meta text-muted-foreground`,children:s(`common.loading`)}):null,l.isError?(0,$.jsxs)(`div`,{role:`alert`,className:`px-3 py-2 typography-meta text-[var(--status-error)]`,children:[s(`assistants.contact.sessionMention.loadFailed`),(0,$.jsx)(W,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>void l.refetch(),children:s(`chat.history.retry`)})]}):null,l.isSuccess&&!u.length?(0,$.jsx)(`p`,{role:`status`,className:`px-3 py-2 typography-meta text-muted-foreground`,children:s(l.data===null?`common.unavailable`:`sessions.sidebar.empty.noMatches.title`)}):null,(0,$.jsx)(Ge,{preventOverscroll:!0,outerClassName:`flex-1 min-h-0`,className:`px-0`,children:(0,$.jsx)(`div`,{id:n,role:`listbox`,"aria-label":s(`chat.fileMentionAutocomplete.groups.sessions`),className:`p-1.5`,children:u.map((r,a)=>(0,$.jsxs)(`div`,{id:`${n}-${a}`,role:`option`,"aria-selected":a===p,ref:e=>{h.current[a]=e},className:H(`flex min-h-10 cursor-pointer items-center gap-2 rounded-md px-1.5 py-1 typography-ui-label`,ze(t,a===p)),onMouseDown:e=>e.preventDefault(),onMouseMove:()=>f({query:e,index:a}),onPointerDown:e=>{e.pointerType===`touch`&&g.pointerDown(e.clientX,e.clientY)},onPointerMove:e=>{e.pointerType===`touch`&&g.pointerMove(e.clientX,e.clientY)},onPointerUp:e=>{e.pointerType===`touch`&&g.pointerUp(()=>i(r))&&(e.preventDefault(),e.stopPropagation())},onPointerCancel:()=>g.pointerCancel(),onClick:()=>g.click(()=>i(r)),children:[(0,$.jsx)(q,{name:`chat-thread`,className:`size-4 shrink-0 text-muted-foreground`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`div`,{className:`truncate font-medium leading-5`,title:r.title,children:r.title||s(`chat.fileMentionAutocomplete.untitledSession`)}),(0,$.jsx)(`div`,{className:`truncate text-[length:calc(var(--text-meta)*0.875)] leading-4 text-muted-foreground`,title:r.directory,children:r.directory})]})]},`${r.directory}:${r.id}`))})}),t?null:(0,$.jsx)(`div`,{className:`mx-1.5 shrink-0 border-t px-1.5 py-1 text-[length:calc(var(--text-meta)*0.875)] leading-4 text-muted-foreground`,children:s(`chat.autocomplete.keyboardHint`)})]})}),st=e=>{let t=(0,Z.c)(121),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({active:n,onChange:r,onVoiceSend:i,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let{t:o}=te(),s=Q.useRef(null),c=n&&!!a.isMobile&&!!i,l;t[5]===c?l=t[6]:(l={available:c},t[5]=c,t[6]=l);let{enabled:u,hint:d,onHintChange:f}=Se(l),p;t[7]!==d||t[8]!==a.placeholder||t[9]!==o?(p=d===null?a.placeholder:o(d===`recording`?`chat.dictation.releaseSend`:d===`cancelling`?`chat.dictation.releaseCancel`:d===`editing`?`chat.dictation.releaseEdit`:`chat.dictation.processing`),t[7]=d,t[8]=a.placeholder,t[9]=o,t[10]=p):p=t[10];let m=p,v;t[11]===a.value?v=t[12]:(v=()=>({canonical:a.value,document:x(a.value,new Map)}),t[11]=a.value,t[12]=v);let[C,w]=Q.useState(v),T;t[13]!==C.canonical||t[14]!==C.document||t[15]!==a.value?(T=C.canonical===a.value?C.document:x(a.value,new Map),t[13]=C.canonical,t[14]=C.document,t[15]=a.value,t[16]=T):T=t[16];let E=T,[D,O]=Q.useState(0),[k,A]=Q.useState(!0),[j,ee]=Q.useState(!1),[ne,N]=Q.useState(),P=Q.useRef(null),re=Q.useRef(null),ie=Q.useRef(null),F=Q.useRef(null),I;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(I=Te(),t[17]=I):I=t[17];let L=Q.useRef(I),R=Q.useId(),z;t[18]!==n||t[19]!==j||t[20]!==D||t[21]!==k||t[22]!==E.text||t[23]!==a.disabled||t[24]!==a.pending?(z=n&&!a.pending&&!a.disabled&&!k&&!j?Le({text:E.text,cursor:D}):null,t[18]=n,t[19]=j,t[20]=D,t[21]=k,t[22]=E.text,t[23]=a.disabled,t[24]=a.pending,t[25]=z):z=t[25];let B=z,V=B?.kind===`mention`?B:null,ae;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(ae=()=>{F.current!==null&&(P.current?.focus({preventScroll:!0}),P.current?.setSelectionRange(F.current,F.current),F.current=null)},t[26]=ae):ae=t[26];let oe;t[27]===E?oe=t[28]:(oe=[E],t[27]=E,t[28]=oe),Q.useLayoutEffect(ae,oe);let U;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(U=()=>A(!0),t[29]=U):U=t[29];let W=M(U),se;t[30]!==j||t[31]!==D||t[32]!==E||t[33]!==r?(se=(e,t,n)=>{let i=n===void 0||n,a=h(e);a.ok&&(i&&(L.current=Ae(L.current,{before:Me(E,[],{start:P.current?.selectionStart??D,end:P.current?.selectionEnd??D}),after:Me(e,[],{start:t,end:t})})),j||(F.current=t),O(t),w({canonical:a.text,document:e}),r(a.text))},t[30]=j,t[31]=D,t[32]=E,t[33]=r,t[34]=se):se=t[34];let G=M(se),K;t[35]!==G||t[36]!==E||t[37]!==V||t[38]!==o?(K=e=>{if(!V)return;let t=e.title||o(`chat.fileMentionAutocomplete.untitledSession`),n=y(E,V.tokenStart,V.tokenEnd,{id:`session:${e.id}:${crypto.randomUUID()}`,kind:`session`,sessionId:e.id,display:g({trigger:`@`,icon:`chat-thread`,label:t})},{inlineBoundaries:!0,padDocumentEdges:!0}),r=n.caret+ +(n.document.text[n.caret]===` `);A(!0),G(n.document,r)},t[35]=G,t[36]=E,t[37]=V,t[38]=o,t[39]=K):K=t[39];let ce=M(K),le;t[40]!==n||t[41]!==G||t[42]!==E||t[43]!==a.disabled||t[44]!==a.pending?(le=e=>{if(!n||a.pending||a.disabled||!e.trim())return;let t=E.text?`${E.text} ${e}`:e,r=S(E,t,t.length,t.length);G(r.document,r.caret),A(!0)},t[40]=n,t[41]=G,t[42]=E,t[43]=a.disabled,t[44]=a.pending,t[45]=le):le=t[45];let ue=M(le),de;t[46]!==n||t[47]!==E.text||t[48]!==ue||t[49]!==r||t[50]!==i||t[51]!==a.disabled||t[52]!==a.pending?(de=e=>{if(!(!n||a.pending||a.disabled||!e.trim())){if(E.text){ue(e);return}r(e),i?.(e)}},t[46]=n,t[47]=E.text,t[48]=ue,t[49]=r,t[50]=i,t[51]=a.disabled,t[52]=a.pending,t[53]=de):de=t[53];let fe=M(de),pe;t[54]!==G||t[55]!==E?(pe=(e,t)=>{let n=e.currentTarget;if(n.selectionStart===n.selectionEnd||!e.clipboardData||!E.references.some(e=>e.start<n.selectionEnd&&e.end>n.selectionStart))return;let r=b(n.selectionStart,n.selectionEnd,E.references)??{start:n.selectionStart,end:n.selectionEnd},i=h({text:E.text.slice(r.start,r.end),references:E.references.filter(e=>e.start>=r.start&&e.end<=r.end).map(e=>({...e,start:e.start-r.start,end:e.end-r.start}))});if(i.ok&&(e.preventDefault(),e.clipboardData.setData(`text/plain`,i.text),t)){let e=S(E,E.text.slice(0,r.start)+E.text.slice(r.end),r.start,r.start);G(e.document,e.caret)}},t[54]=G,t[55]=E,t[56]=pe):pe=t[56];let me=M(pe),he;t[57]!==E.references||t[58]!==E.text?(he=Oe(E.text,E.references.map(ct))?.map(lt),t[57]=E.references,t[58]=E.text,t[59]=he):he=t[59];let ge=he,_e=u&&E.text.length===0?`true`:void 0,ve;t[60]!==u||t[61]!==ue||t[62]!==a.disabled||t[63]!==a.pending||t[64]!==fe||t[65]!==f?(ve=u&&(0,$.jsx)(it,{containerRef:s,disabled:!!(a.pending||a.disabled),onInsert:ue,onSend:fe,onRelease:rt,onHintChange:f}),t[60]=u,t[61]=ue,t[62]=a.disabled,t[63]=a.pending,t[64]=fe,t[65]=f,t[66]=ve):ve=t[66];let q=E.text,ye=a.pending,J;t[67]===a?J=t[68]:(J=()=>{a.pending||a.onSubmit()},t[67]=a,t[68]=J);let be=a.layout===`inline`?`py-3 leading-6`:`pt-4 pb-2`,xe=a.layout===`inline`&&a.isMobile&&`pl-2`,Y;t[69]!==a.textLayoutClassName||t[70]!==be||t[71]!==xe?(Y=H(`whitespace-pre-wrap break-words overflow-hidden px-3 typography-markdown md:typography-ui-label`,be,xe,a.textLayoutClassName),t[69]=a.textLayoutClassName,t[70]=be,t[71]=xe,t[72]=Y):Y=t[72];let Ce;t[73]!==G||t[74]!==E?(Ce=(e,t)=>{let n=S(E,e,t?.target.selectionStart??e.length,t?.target.selectionEnd??e.length);G(n.document,n.caret),A(t?.nativeEvent?.inputType===`insertFromPaste`)},t[73]=G,t[74]=E,t[75]=Ce):Ce=t[75];let we=V?R:void 0,De=V?ne:void 0,ke;t[76]===a.textareaProps?ke=t[77]:(ke=e=>{a.textareaProps?.onScroll?.(e),re.current&&(re.current.scrollTop=e.currentTarget.scrollTop,re.current.scrollLeft=e.currentTarget.scrollLeft)},t[76]=a.textareaProps,t[77]=ke);let je,X;t[78]!==me||t[79]!==a.textareaProps?(je=e=>{a.textareaProps?.onCopy?.(e),e.defaultPrevented||me(e,!1)},X=e=>{a.textareaProps?.onCut?.(e),e.defaultPrevented||me(e,!0)},t[78]=me,t[79]=a.textareaProps,t[80]=je,t[81]=X):(je=t[80],X=t[81]);let Ne;t[82]===a.textareaProps?Ne=t[83]:(Ne=e=>{O(e.currentTarget.selectionStart),a.textareaProps?.onSelect?.(e)},t[82]=a.textareaProps,t[83]=Ne);let Re,ze;t[84]===Symbol.for(`react.memo_cache_sentinel`)?(Re=()=>{ee(!0)},ze=e=>{ee(!1),O(e.currentTarget.selectionStart)},t[84]=Re,t[85]=ze):(Re=t[84],ze=t[85]);let Be;t[86]!==G||t[87]!==j||t[88]!==E||t[89]!==V||t[90]!==a.textareaProps?(Be=e=>{if(a.textareaProps?.onKeyDown?.(e),!(e.defaultPrevented||Fe(e))){if(j){e.key===`Enter`&&e.preventDefault();return}if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`z`){let t=e.shiftKey?Pe(L.current,E):Ee(L.current,E);t&&(e.preventDefault(),L.current=t.history,G(t.snapshot.document,t.snapshot.selection.end,!1),A(!0));return}if(e.key===`Backspace`||e.key===`Delete`){let t=_(E,{key:e.key,selectionStart:e.currentTarget.selectionStart,selectionEnd:e.currentTarget.selectionEnd,altKey:e.altKey});if(t){e.preventDefault(),G(t.document,t.caret),A(!0);return}}V&&[`ArrowDown`,`ArrowUp`,`Enter`,`Tab`,`Escape`].includes(e.key)&&(e.preventDefault(),e.stopPropagation(),ie.current?.keyDown(e.key))}},t[86]=G,t[87]=j,t[88]=E,t[89]=V,t[90]=a.textareaProps,t[91]=Be):Be=t[91];let Ve;t[92]!==a.textareaProps||t[93]!==we||t[94]!==De||t[95]!==ke||t[96]!==je||t[97]!==X||t[98]!==Ne||t[99]!==Be?(Ve={...a.textareaProps,"aria-controls":we,"aria-activedescendant":De,"aria-autocomplete":`list`,onScroll:ke,onCopy:je,onCut:X,onSelect:Ne,onCompositionStart:Re,onCompositionEnd:ze,onKeyDown:Be},t[92]=a.textareaProps,t[93]=we,t[94]=De,t[95]=ke,t[96]=je,t[97]=X,t[98]=Ne,t[99]=Be,t[100]=Ve):Ve=t[100];let He;t[101]!==W||t[102]!==R||t[103]!==V||t[104]!==a.isMobile||t[105]!==ce?(He=V?(0,$.jsx)(ot,{ref:ie,query:V.query,isMobile:a.isMobile??!1,listId:R,onHighlightChange:N,onSelect:ce,onClose:W}):null,t[101]=W,t[102]=R,t[103]=V,t[104]=a.isMobile,t[105]=ce,t[106]=He):He=t[106];let Ue;t[107]!==E.text||t[108]!==ge||t[109]!==m||t[110]!==a||t[111]!==J||t[112]!==Y||t[113]!==Ce||t[114]!==Ve||t[115]!==He?(Ue=(0,$.jsx)(Ie,{...a,value:q,pending:ye,placeholder:m,disableInputWhilePending:!1,inputRef:P,onSubmit:J,highlightedContent:ge,highlightRef:re,textLayoutClassName:Y,onChange:Ce,textareaProps:Ve,children:He}),t[107]=E.text,t[108]=ge,t[109]=m,t[110]=a,t[111]=J,t[112]=Y,t[113]=Ce,t[114]=Ve,t[115]=He,t[116]=Ue):Ue=t[116];let We;return t[117]!==_e||t[118]!==ve||t[119]!==Ue?(We=(0,$.jsxs)(`div`,{ref:s,className:`yuri-hold-to-talk-container`,"data-hold-to-talk-empty":_e,children:[ve,Ue]}),t[117]=_e,t[118]=ve,t[119]=Ue,t[120]=We):We=t[120],We};function ct(e){return{start:e.start,end:e.end,priority:103,...v(e)}}function lt(e,t){return(0,$.jsx)(`span`,{className:e.className,children:e.visual?(0,$.jsx)(ke,{visual:e.visual,text:e.text}):e.text},`${t}-${e.text.length}`)}var ut=`rounded-[1.35rem] border border-border/40 cursor-zoom-in`;function dt({assistantID:e,descriptor:t,onShowPopup:n}){let{t:r}=te(),i=Ve(),{attachmentID:a,sha256:o,size:s,mime:c,filename:l}=t,u=Q.useMemo(()=>({type:`file`,attachmentID:a,sha256:o,size:s,mime:c,filename:l}),[a,o,s,c,l]),d=c.startsWith(`image/`),f=be(l??``,c),[p,m]=Q.useState(0),[h,g]=Q.useState(``),[_,v]=Q.useState(!1),[y,b]=Q.useState(!1),x=Q.useRef(null),S=Q.useRef([]);Q.useEffect(()=>{g(``),v(!1);let t=new AbortController,n;return d&&Ye(e,u,{signal:t.signal}).then(e=>{if(t.signal.aborted){e.release();return}n=e.release,g(e.url)}).catch(()=>{t.signal.aborted||v(!0)}),()=>{t.abort(),n?.()}},[e,u,i,d,p]),Q.useEffect(()=>()=>{x.current?.abort(),S.current.forEach(e=>URL.revokeObjectURL(e)),S.current=[]},[e,u,i]);let C=M(async(t=!1)=>{if(x.current)return;let i=new AbortController;x.current=i,b(!0),v(!1);try{let a=await Je(e,u,{signal:i.signal});if(i.signal.aborted)return;S.current.forEach(e=>URL.revokeObjectURL(e));let o=URL.createObjectURL(a);if(S.current=[o],t&&n){n({open:!0,title:l||r(`assistants.contact.attachment.file`),content:``,video:{url:o,mimeType:c,filename:l}});return}let s=document.createElement(`a`);s.href=o,s.download=l||r(`assistants.contact.attachment.file`),document.body.appendChild(s),s.click(),s.remove()}catch{i.signal.aborted||v(!0)}finally{x.current===i&&(x.current=null),i.signal.aborted||b(!1)}}),w=l||r(d?`assistants.contact.attachment.image`:`assistants.contact.attachment.file`),T=M(e=>{!n||!h||n({open:!0,title:w,content:``,metadata:{tool:`image-preview`,filename:w,mime:c},previewSource:e.currentTarget,image:{url:h,mimeType:c,filename:w,size:s,gallery:[{url:h,mimeType:c,filename:w,size:s}],index:0}})});return d&&h&&!_?(0,$.jsx)(We,{src:h,alt:w,contentFrame:!0,className:ut,onError:()=>v(!0),onClick:T,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),T(e))},role:`button`,tabIndex:0,"data-assistant-contact-image":``}):d&&!_?(0,$.jsx)(Ue,{className:`h-[var(--yuri-content-image-height)] w-[min(20rem,100%)] rounded-[1.35rem]`}):(0,$.jsxs)(`div`,{className:`flex max-w-full flex-col gap-1 rounded-[1.25rem] bg-[var(--surface-muted)] px-3.5 py-2.5 ring-1 ring-inset ring-[var(--surface-subtle)]`,"data-assistant-contact-file":``,children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,$.jsx)(q,{name:`file-text`,className:`size-4 shrink-0 text-muted-foreground`}),(0,$.jsx)(`span`,{className:`truncate typography-ui`,children:w})]}),_?(0,$.jsx)(`p`,{role:`alert`,className:`typography-micro text-[var(--status-error)]`,children:r(`assistants.contact.attachment.loadFailed`)}):null,d&&!_||y?(0,$.jsx)(`span`,{role:`status`,className:`typography-micro text-muted-foreground`,children:r(`common.loading`)}):(0,$.jsx)(W,{type:`button`,size:`sm`,variant:`ghost`,onClick:d?()=>m(e=>e+1):()=>void C(f&&!!n),children:r(_?`chat.history.retry`:f&&n?`contextPanel.mode.preview`:`assistants.contact.attachment.download`)})]})}function ft(e){let t=(0,Z.c)(39),{part:n,onShowPopup:r}=e,{t:i}=te(),a=/^(?:https?:|data:|blob:)/i.test(n.url)?n.url:``,o=He(a,``),[s,c]=Q.useState(!1),l;t[0]!==n.filename||t[1]!==i?(l=n.filename||i(`assistants.contact.attachment.image`),t[0]=n.filename,t[1]=i,t[2]=l):l=t[2];let u=l,d;t[3]!==u||t[4]!==r||t[5]!==o?(d=e=>{!r||!o||r({open:!0,title:u,content:``,metadata:{tool:`image-preview`,filename:u},previewSource:e.currentTarget,image:{url:o,filename:u,gallery:[{url:o,filename:u}],index:0}})},t[3]=u,t[4]=r,t[5]=o,t[6]=d):d=t[6];let f=M(d);if(be(a,n.mime)&&a&&r){let e;t[7]!==r||t[8]!==n.filename||t[9]!==n.mime||t[10]!==a||t[11]!==i?(e=()=>r({open:!0,title:n.filename||i(`assistants.contact.attachment.file`),content:``,video:{url:a,filename:n.filename,mimeType:n.mime}}),t[7]=r,t[8]=n.filename,t[9]=n.mime,t[10]=a,t[11]=i,t[12]=e):e=t[12];let o;t[13]!==n.filename||t[14]!==i?(o=n.filename||i(`contextPanel.mode.preview`),t[13]=n.filename,t[14]=i,t[15]=o):o=t[15];let s;return t[16]!==e||t[17]!==o?(s=(0,$.jsx)(W,{variant:`secondary`,size:`sm`,onClick:e,children:o}),t[16]=e,t[17]=o,t[18]=s):s=t[18],s}if(n.mime.startsWith(`image/`)&&o&&!s){let e;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(e=()=>c(!0),t[19]=e):e=t[19];let n;t[20]===f?n=t[21]:(n=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),f(e))},t[20]=f,t[21]=n);let r;return t[22]!==u||t[23]!==f||t[24]!==o||t[25]!==n?(r=(0,$.jsx)(We,{src:o,alt:u,contentFrame:!0,className:ut,onError:e,onClick:f,onKeyDown:n,role:`button`,tabIndex:0,"data-assistant-contact-image":``}),t[22]=u,t[23]=f,t[24]=o,t[25]=n,t[26]=r):r=t[26],r}let p;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(q,{name:`file-text`,className:`size-4 shrink-0 text-muted-foreground`}),t[27]=p):p=t[27];let m;t[28]!==n.filename||t[29]!==i?(m=n.filename||i(`assistants.contact.attachment.file`),t[28]=n.filename,t[29]=i,t[30]=m):m=t[30];let h;t[31]===m?h=t[32]:(h=(0,$.jsx)(`span`,{className:`truncate typography-ui`,children:m}),t[31]=m,t[32]=h);let g;t[33]!==s||t[34]!==i?(g=s?(0,$.jsx)(W,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>c(!1),children:i(`chat.history.retry`)}):null,t[33]=s,t[34]=i,t[35]=g):g=t[35];let _;return t[36]!==h||t[37]!==g?(_=(0,$.jsxs)(`div`,{className:`flex max-w-full items-center gap-2.5 rounded-[1.25rem] bg-[var(--surface-muted)] px-3.5 py-2.5`,"data-assistant-contact-file":``,children:[p,h,g]}),t[36]=h,t[37]=g,t[38]=_):_=t[38],_}function pt(e){let t=(0,Z.c)(5),{assistantID:n,part:r,onShowPopup:i}=e,a=Ve(),o;return t[0]!==n||t[1]!==i||t[2]!==r||t[3]!==a?(o=`attachmentID`in r?(0,$.jsx)(dt,{assistantID:n,descriptor:r,onShowPopup:i},`${a}:${n}:${r.attachmentID}:${r.sha256}`):(0,$.jsx)(ft,{part:r,onShowPopup:i},`${a}:${r.url}`),t[0]=n,t[1]=i,t[2]=r,t[3]=a,t[4]=o):o=t[4],o}var mt=Q.memo(e=>{let t=(0,Z.c)(32),{turn:n,retryDisabled:r,onRetry:i}=e,{t:a}=te(),d;t[0]===a?d=t[1]:(d=a(`assistants.contact.sendError.viewDetails`),t[0]=a,t[1]=d);let p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(q,{name:`exclamation-fill`,className:`size-[18px] text-[var(--status-error)]`,"data-assistant-contact-error-dot":``}),t[2]=p):p=t[2];let h;t[3]===d?h=t[4]:(h=(0,$.jsx)(l,{type:`button`,"aria-label":d,"data-assistant-contact-send-error":``,className:`absolute right-full top-1/2 mr-1.5 flex size-9 -translate-y-1/2 cursor-pointer items-center justify-center rounded-md border-0 bg-transparent p-0 shadow-none outline-none focus-visible:opacity-70`,children:p}),t[3]=d,t[4]=h);let g;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(g={side:`flip`,align:`shift`,fallbackAxisSide:`end`},t[5]=g):g=t[5];let _;t[6]===a?_=t[7]:(_=a(`assistants.contact.sendError.title`),t[6]=a,t[7]=_);let v;t[8]===_?v=t[9]:(v=(0,$.jsx)(o,{className:`typography-ui-label font-medium`,children:_}),t[8]=_,t[9]=v);let y;t[10]!==a||t[11]!==n.error?(y=n.error||a(`assistants.contact.sendFailed`),t[10]=a,t[11]=n.error,t[12]=y):y=t[12];let b;t[13]===y?b=t[14]:(b=(0,$.jsx)(m,{role:`alert`,className:`mt-2 max-h-48 overflow-y-auto whitespace-pre-wrap typography-meta leading-relaxed [overflow-wrap:anywhere]`,children:y}),t[13]=y,t[14]=b);let x;t[15]!==i||t[16]!==n.messageID?(x=()=>i(n.messageID),t[15]=i,t[16]=n.messageID,t[17]=x):x=t[17];let S;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(q,{name:`refresh`,className:`size-3`}),t[18]=S):S=t[18];let C;t[19]===a?C=t[20]:(C=a(`chat.history.retry`),t[19]=a,t[20]=C);let w;t[21]!==r||t[22]!==C||t[23]!==x?(w=(0,$.jsx)(`div`,{className:`mt-4 flex justify-end`,children:(0,$.jsxs)(W,{type:`button`,size:`xs`,disabled:r,onClick:x,children:[S,C]})}),t[21]=r,t[22]=C,t[23]=x,t[24]=w):w=t[24];let T;t[25]!==w||t[26]!==v||t[27]!==b?(T=(0,$.jsx)(u,{children:(0,$.jsx)(f,{side:`left`,align:`center`,sideOffset:6,collisionPadding:12,collisionAvoidance:g,className:`z-50`,children:(0,$.jsxs)(s,{className:`yuri-mobile-overlay-surface w-72 max-w-[calc(100vw-2rem)] rounded-xl p-4 text-foreground outline-none`,"data-assistant-contact-send-error-popup":``,children:[v,b,w]})})}),t[25]=w,t[26]=v,t[27]=b,t[28]=T):T=t[28];let E;return t[29]!==T||t[30]!==h?(E=(0,$.jsxs)(c,{children:[h,T]}),t[29]=T,t[30]=h,t[31]=E):E=t[31],E});function ht(e){let t=(0,Z.c)(7),{children:n,failedTurn:r,retryDisabled:i,onRetry:a}=e,o;t[0]!==r||t[1]!==a||t[2]!==i?(o=r?.status===`failed`?(0,$.jsx)(mt,{turn:r,retryDisabled:i,onRetry:a}):null,t[0]=r,t[1]=a,t[2]=i,t[3]=o):o=t[3];let s;return t[4]!==n||t[5]!==o?(s=(0,$.jsxs)(`div`,{className:`relative min-w-0 max-w-full`,"data-assistant-contact-user-part":``,children:[n,o]}),t[4]=n,t[5]=o,t[6]=s):s=t[6],s}var gt=[],_t=e=>e.flatMap(e=>e.type===`text`&&e.text.trim()?[e.text]:[]).join(`
3
+ `),vt=(e,t,n,r=Date.now())=>({assistantID:e,messageID:t,parts:n,status:`sending`,createdAt:r}),yt=(e,t)=>{let n=e.filter(e=>e.assistantID===t);return n.length===e.length?e:n},bt=(e,t)=>{let n=e.filter(e=>e.assistantID===t);return n.length===e.length?e:n},xt=(e,t,n,r)=>({messageID:t?`${e.turnID}:preview:${t.bubbleIndex}`:`${e.turnID}:preview:${r}`,assistantID:e.assistantID,role:`assistant`,turnID:e.turnID,bubbleIndex:t?.bubbleIndex??0,createdAt:t?.occurredAt??e.occurredAt,ordinal:n,status:r,fromAssistantID:null,fromAssistantName:null,parts:t?[{type:`text`,text:t.text}]:[],text:t?.text??``,cards:[]}),St=(e,t,n)=>{let r=e.bubbles.filter(e=>!t.has(e.bubbleIndex)).map((t,r)=>xt(e,t,n+r,t.done?`complete`:`streaming`));return e.status===`failed`?[...r,xt(e,null,n+r.length,`failed`)]:e.status===`admitted`||e.status===`streaming`?[...r,xt(e,null,n+r.length,`admitted`)]:r},Ct=(e,t,n,r=[])=>{let i=new Set(e.map(e=>e.messageID)),a=t.flatMap((t,r)=>t.assistantID!==n||i.has(t.messageID)?[]:[{messageID:t.messageID,assistantID:n,role:`user`,turnID:t.messageID,bubbleIndex:0,createdAt:t.createdAt,ordinal:e.length+r,status:t.status,fromAssistantID:null,fromAssistantName:null,parts:[...t.parts],text:_t(t.parts),cards:[]}]),o=a.length===0?e:[...e,...a],s=r.filter(e=>e.assistantID===n);if(s.length===0)return o;let c=new Map,l=new Map;o.forEach((e,t)=>{if(c.set(e.turnID,t),e.role!==`assistant`||e.messageID.includes(`:preview:`))return;let n=l.get(e.turnID)??new Set;n.add(e.bubbleIndex),l.set(e.turnID,n)});let u=new Map,d=[];for(let e of s){let t=St(e,l.get(e.turnID)??new Set,o.length+d.length);if(t.length===0)continue;let n=c.get(e.turnID);if(n===void 0){if(e.status===`failed`&&o.some(t=>t.turnID!==e.turnID))continue;d.push(...t);continue}let r=u.get(n)??[];r.push(...t),u.set(n,r)}return u.size===0&&d.length===0?o:o.flatMap((e,t)=>[e,...u.get(t)??[]]).concat(d)},wt=(e,t)=>{let n=new Set(t.map(e=>e.messageID)),r=e.filter(e=>!n.has(e.messageID));return r.length===e.length?e:r},Tt=(e,t)=>e.map(e=>e.messageID===t?{...e,status:`admitted`}:e),Et=(e,t,n,r=Date.now())=>{let i=e.filter(e=>e.assistantID!==t||e.status!==`failed`||e.turnID===n);return i.some(e=>e.assistantID===t&&e.turnID===n)?i.length===e.length?e:i:[...i,{assistantID:t,turnID:n,status:`admitted`,bubbles:[],occurredAt:r}]},Dt=(e,t,n)=>!t?.turnID||!t.assistantID||n?.has(t.turnID)?e:Et(e,t.assistantID,t.turnID,t.admittedAt),Ot=(e,t)=>{let n=t.assistantID,r=t.pendingSendTurnIDs??new Set,i=t.settledTurnIDs??new Set,a=typeof t.snapshotRevision==`number`&&Number.isFinite(t.snapshotRevision)?t.snapshotRevision:null,o=t.admissionRevisionByTurnID instanceof Map?t.admissionRevisionByTurnID:new Map(Object.entries(t.admissionRevisionByTurnID??{}).map(([e,t])=>[e,Number(t)])),s=t.occurredAt??Date.now(),c=t.activeContactTurn&&t.activeContactTurn.turnID?t.activeContactTurn:null,l=!!(t.serverWorking||c),u=Dt(e,c?{assistantID:n,turnID:c.turnID,admittedAt:c.admittedAt}:null,i),d=Array.isArray(t.messages)?t.messages:[];for(let e of d)e.role===`assistant`&&e.status===`error`&&(r.has(e.turnID)||i.has(e.turnID)||(u=At(u,{assistantID:n,turnID:e.turnID,status:`error`,error:e.text||`upstream_error`,occurredAt:s})));if(u=jt(u,d),l){let t=u.filter(e=>{if(e.assistantID!==n||e.status!==`admitted`&&e.status!==`streaming`||r.has(e.turnID)||c&&e.turnID===c.turnID)return!0;let t=o.get(e.turnID);return typeof t==`number`&&a!=null&&a<t?!0:typeof t==`number`&&a!=null&&a>=t&&e.turnID!==c?.turnID?!1:!c||e.turnID===c.turnID});return t.length===e.length&&t.every((t,n)=>t===e[n])?e:t}if(a==null)return u.length===e.length&&u.every((t,n)=>t===e[n])?e:u;let f=u.filter(e=>{if(e.assistantID!==n||e.status!==`admitted`&&e.status!==`streaming`||r.has(e.turnID))return!0;if(i.has(e.turnID))return!1;let t=o.get(e.turnID);return typeof t==`number`&&a<t});return f.length===e.length&&f.every((t,n)=>t===e[n])?e:f.length===u.length?u:f},kt=(e,t)=>Et(e,t.assistantID,t.turnID,t.occurredAt).map(e=>{if(e.assistantID!==t.assistantID||e.turnID!==t.turnID||e.status===`failed`||e.status===`complete`)return e;let n=e.bubbles.find(e=>e.bubbleIndex===t.bubbleIndex);if(n?.done)return e;let r=n?{...n,text:`${n.text}${t.delta}`,done:t.done,occurredAt:t.occurredAt}:{bubbleIndex:t.bubbleIndex,text:t.delta,done:t.done,occurredAt:t.occurredAt},i=n?e.bubbles.map(e=>e.bubbleIndex===t.bubbleIndex?r:e):[...e.bubbles,r].sort((e,t)=>e.bubbleIndex-t.bubbleIndex);return{...e,status:`streaming`,bubbles:i}}),At=(e,t,n={})=>n.requireExisting&&!e.some(e=>e.assistantID===t.assistantID&&e.turnID===t.turnID)?e:Et(e,t.assistantID,t.turnID,t.occurredAt).map(e=>e.assistantID!==t.assistantID||e.turnID!==t.turnID||e.status===`complete`||e.status===`failed`?e:{...e,status:t.status===`error`?`failed`:`complete`,...t.error?{error:t.error}:{}}),jt=(e,t)=>{let n=new Set(t.map(e=>e.turnID).filter(Boolean)),r=t.length>0?t[t.length-1]?.turnID??null:null,i=[...e].reverse().find(e=>e.status===`admitted`||e.status===`streaming`)?.turnID??r,a=new Set(t.flatMap(e=>e.role===`assistant`?[e.turnID]:[])),o=e.filter(e=>e.status===`admitted`||e.status===`streaming`||!(e.status===`complete`&&a.has(e.turnID)||!n.has(e.turnID)||e.status===`failed`&&(i&&i!==e.turnID||r&&r!==e.turnID)));return o.length===e.length?e:o},Mt=(e,t,n)=>e.map(e=>e.messageID===t?{...e,status:`failed`,error:n}:e),Nt=(e,t)=>e instanceof I?e.code===`no_provider`?t.noProvider:e.code===`admission_timeout`||e.code===`generate_timeout`?t.timedOut:e.message&&e.message!==e.code?e.message:`${t.sendFailed}\n\n${e.code} (HTTP ${e.status})`:ne(e)?t.timedOut:e instanceof Error&&e.message.trim()?e.message:t.sendFailed,Pt=()=>{let e=!1;return{tryAcquire:()=>!e&&(e=!0,!0),release:()=>{e=!1}}},Ft=e=>{let t=e.text.trim();if(e.sending||!t&&e.attachments.length===0||!e.gate.tryAcquire())return{ok:!1};let n=[...t?[{type:`text`,text:t}]:[],...e.attachments.map(e=>({type:`file`,mime:e.mime,url:e.url,filename:e.name}))],r=e.createMessageID();return{ok:!0,messageID:r,parts:n,turn:vt(e.assistantID,r,n,e.createdAt)}},It=e=>e.some(e=>e.status===`sending`),Lt=e=>e.some(e=>e.status===`admitted`||e.status===`streaming`),Rt=a(e=>({workingByID:{},setWorking:(t,n)=>e(e=>({workingByID:{...e.workingByID,[t]:n}}))})),zt=({sending:e=!1,processing:t=!1,serverWorking:n=!1})=>e||t||n,Bt=(e,t)=>{let n=(0,Z.c)(5),r=t!==void 0&&t,i;n[0]===e?i=n[1]:(i=t=>!!t.workingByID[e],n[0]=e,n[1]=i);let a=Rt(i),o;return n[2]!==a||n[3]!==r?(o=zt({processing:a,serverWorking:r}),n[2]=a,n[3]=r,n[4]=o):o=n[4],o},Vt=e=>{let t=(0,Z.c)(25),{name:n,avatarSeed:r,size:i,label:a,working:o,showWorkingDot:s,className:c,hoverTarget:l,followPointer:u,blinkOnMount:d}=e,f=i===void 0?24:i,p=s===void 0||s,m=d===void 0||d,{t:h}=te(),g;t[0]!==n||t[1]!==o?(g=e=>o!==void 0&&!!e.workingByID[n],t[0]=n,t[1]=o,t[2]=g):g=t[2];let _=Rt(g),v=!!(o||_),y=`calc(${f}px * var(--dpt-n, 1))`,b;t[3]===c?b=t[4]:(b=H(`relative inline-block shrink-0 align-middle leading-none`,c),t[3]=c,t[4]=b);let x;t[5]===y?x=t[6]:(x={width:y,minWidth:y,maxWidth:y,height:y,minHeight:y,maxHeight:y},t[5]=y,t[6]=x);let S=o===void 0?void 0:v?`working`:`idle`,C=r??n,w;t[7]!==m||t[8]!==u||t[9]!==l||t[10]!==a||t[11]!==n||t[12]!==f||t[13]!==S||t[14]!==C?(w=(0,$.jsx)(he,{kind:`assistant`,motion:S,name:C,size:f,label:a,hoverTarget:l,followPointer:u,animationKey:n,blinkOnMount:m}),t[7]=m,t[8]=u,t[9]=l,t[10]=a,t[11]=n,t[12]=f,t[13]=S,t[14]=C,t[15]=w):w=t[15];let T;t[16]!==p||t[17]!==h||t[18]!==o?(T=o&&p?(0,$.jsx)(`span`,{className:`pointer-events-none absolute right-0 bottom-0 size-2.5 translate-x-0.5 translate-y-0.5 rounded-full bg-[var(--status-success)] ring-2 ring-background`,"data-assistant-working-dot":``,"aria-label":h(`assistants.contact.working`)}):null,t[16]=p,t[17]=h,t[18]=o,t[19]=T):T=t[19];let E;return t[20]!==T||t[21]!==b||t[22]!==x||t[23]!==w?(E=(0,$.jsxs)(`span`,{className:b,style:x,"data-assistant-working-avatar":``,children:[w,T]}),t[20]=T,t[21]=b,t[22]=x,t[23]=w,t[24]=E):E=t[24],E};function Ht(e){let t=(0,Z.c)(6),{value:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(q,{name:`brain`,weight:`medium`,className:`size-3.5 shrink-0`}),t[0]=r):r=t[0];let i;t[1]===n?i=t[2]:(i=(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:n}),t[1]=n,t[2]=i);let a;return t[3]!==i||t[4]!==n?(a=(0,$.jsxs)(`p`,{"data-contact-card-model":``,className:`flex min-w-0 flex-1 items-center gap-1.5 text-[0.75em] leading-4 text-muted-foreground`,title:n,children:[r,i]}),t[3]=i,t[4]=n,t[5]=a):a=t[5],a}var Ut=Q.createContext(null),Wt=[`grid h-[calc(148px*var(--padding-scale,1))] w-[19rem] min-w-0 max-w-full shrink-0 grid-rows-[calc(40px*var(--padding-scale,1))_calc(20px*var(--padding-scale,1))_calc(20px*var(--padding-scale,1))_calc(48px*var(--padding-scale,1))] content-start cursor-pointer rounded-[1.35rem] bg-[var(--surface-muted)]`,`px-4 py-2.5 text-left typography-ui-label transition-colors duration-150 motion-reduce:transition-none`,`hover:bg-interactive-hover/45`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]`].join(` `),Gt=Wt,Kt=Wt,qt=`row-start-1 mb-2 flex h-8 min-w-0 items-center gap-2`,Jt=`row-start-2 min-w-0 self-start truncate font-medium leading-5 text-foreground`,Yt=`row-start-4 flex h-12 min-w-0 flex-col justify-center`;function Xt(e,t){(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())}var Zt=e=>{let t=(0,Z.c)(36),{card:n,assistant:r,active:a}=e,o=a===void 0||a,{t:s}=te(),c=Y(),l;t[0]===c?l=t[1]:(l=c&&!i(),t[0]=c,t[1]=l);let u=!!l,d=n.name,f=`${n.providerID}/${n.modelID}`,p=Q.useContext(Ut),m;t[2]!==n.assistantID||t[3]!==u||t[4]!==p?(m=()=>{if(p)return p({assistantID:n.assistantID});if(u){K.getState().openAssistant(n.assistantID);return}le(n.assistantID)},t[2]=n.assistantID,t[3]=u,t[4]=p,t[5]=m):m=t[5];let h=M(m),g;t[6]===h?g=t[7]:(g=e=>{Xt(e,h)},t[6]=h,t[7]=g);let _=M(g),v;t[8]!==s||t[9]!==d?(v=s(`assistants.contact.card.assistant.aria`,{name:d}),t[8]=s,t[9]=d,t[10]=v):v=t[10];let y=r?.avatarSeed,b=o?!!(r?.working||r?.activeContactTurn):void 0,x;t[11]!==n.assistantID||t[12]!==y||t[13]!==b?(x=(0,$.jsx)(`span`,{className:`relative inline-block shrink-0 leading-none`,"aria-hidden":!0,children:(0,$.jsx)(Vt,{name:n.assistantID,avatarSeed:y,size:32,working:b,showWorkingDot:!1,followPointer:!1})}),t[11]=n.assistantID,t[12]=y,t[13]=b,t[14]=x):x=t[14];let S;t[15]===s?S=t[16]:(S=s(`assistants.contact.card.assistant.label`),t[15]=s,t[16]=S);let C;t[17]===S?C=t[18]:(C=(0,$.jsx)(`span`,{className:`min-w-0 truncate text-[0.8em] leading-4 text-muted-foreground`,children:S}),t[17]=S,t[18]=C);let w;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsx)(q,{name:`arrow-right-s`,weight:`medium`,className:`ml-auto size-4 shrink-0 text-muted-foreground`}),t[19]=w):w=t[19];let T;t[20]!==C||t[21]!==x?(T=(0,$.jsxs)(`div`,{className:qt,children:[x,C,w]}),t[20]=C,t[21]=x,t[22]=T):T=t[22];let E;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(E=H(Jt,`row-span-2 self-center`),t[23]=E):E=t[23];let D;t[24]===d?D=t[25]:(D=(0,$.jsx)(`h3`,{className:E,title:d,children:d}),t[24]=d,t[25]=D);let O;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(O=H(Yt,`justify-end pb-1`),t[26]=O):O=t[26];let k;t[27]===f?k=t[28]:(k=(0,$.jsx)(`div`,{className:O,children:(0,$.jsx)(`div`,{className:`flex h-4 min-w-0 items-center`,children:(0,$.jsx)(Ht,{value:f})})}),t[27]=f,t[28]=k);let A;return t[29]!==_||t[30]!==h||t[31]!==T||t[32]!==D||t[33]!==k||t[34]!==v?(A=(0,$.jsxs)(`article`,{className:Gt,role:`button`,tabIndex:0,"aria-label":v,"data-assistant-contact-card":`assistant`,onClick:h,onKeyDown:_,children:[T,D,k]}),t[29]=_,t[30]=h,t[31]=T,t[32]=D,t[33]=k,t[34]=v,t[35]=A):A=t[35],A},Qt=e=>!!(e&&typeof e==`object`&&!Array.isArray(e)),$t=e=>typeof e==`string`&&/^([01]\d|2[0-3]):[0-5]\d$/.test(e),en=e=>typeof e==`number`&&Number.isInteger(e)&&e>=0&&e<=6,tn=e=>e.kind===`cron`?e.cron===void 0:e.kind===`once`?e.date===void 0:e.kind===`weekly`?e.times===void 0||e.weekdays===void 0:e.kind===`daily`&&e.times===void 0,nn=e=>{if(!Qt(e)||e.timezone!==void 0&&typeof e.timezone!=`string`)return!1;if(e.kind===`cron`)return typeof e.cron==`string`&&!!e.cron.trim();if(e.kind===`once`)return typeof e.date==`string`&&/^\d{4}-\d{2}-\d{2}$/.test(e.date)&&$t(e.time);let t=Array.isArray(e.times)&&e.times.length>0&&e.times.every($t);return e.kind===`daily`?t||$t(e.time):e.kind===`weekly`&&(t||$t(e.time))&&Array.isArray(e.weekdays)&&e.weekdays.length>0&&e.weekdays.every(en)},rn=(e,t)=>{if(!tn(e)||!nn(t?.schedule))return e;let n=t.schedule;return{...e,kind:n.kind,time:n.time??n.times?.[0]??null,timezone:n.timezone??e.timezone,cron:n.cron??null,date:n.date??null,times:n.times??null,weekdays:n.weekdays??null}},an=(e,t)=>{let n=e.kind===`daily`||e.kind===`weekly`||e.kind===`once`||e.kind===`cron`?t(`sessions.scheduledTasks.editor.scheduleType.${e.kind}`):e.kind||``,r=[...new Set((e.times?.length?e.times:e.time?[e.time]:[]).filter($t))].sort(),i=r.join(`, `),a=n,o=r.length===1;if(e.kind===`cron`)i=e.cron?.trim()||n,a=e.cron?.trim()?n:``,o=!1;else if(e.kind===`once`)i=[e.date?.trim(),i].filter(Boolean).join(` `),o=!1;else if(e.kind===`weekly`&&e.weekdays?.length){let n=[`sun`,`mon`,`tue`,`wed`,`thu`,`fri`,`sat`];a=[...new Set(e.weekdays.filter(en))].sort((e,t)=>e-t).map(e=>t(`sessions.scheduledTasks.dialog.schedule.weekdayShort.${n[e]}`)).join(`, `)}return{value:i||t(`assistants.contact.card.schedule.timeUnavailable`),cadence:a,clock:o,timezone:e.timezone}},on=e=>{let t=(0,Z.c)(44),{card:n,task:r}=e,{t:i}=te(),a=n.name,o;t[0]!==n||t[1]!==i||t[2]!==r?(o=an(rn(n,r),i),t[0]=n,t[1]=i,t[2]=r,t[3]=o):o=t[3];let s=o,c;t[4]===n.prompt?c=t[5]:(c=n.prompt?.trim(),t[4]=n.prompt,t[5]=c);let l=c,u=Q.useContext(Ut),d;t[6]!==n.projectID||t[7]!==n.taskID||t[8]!==u?(d=()=>{if(u)return u({projectID:n.projectID,taskID:n.taskID});ye(n.projectID,n.taskID)},t[6]=n.projectID,t[7]=n.taskID,t[8]=u,t[9]=d):d=t[9];let f=M(d),p;t[10]===f?p=t[11]:(p=e=>{Xt(e,f)},t[10]=f,t[11]=p);let m=M(p),h;t[12]!==i||t[13]!==a?(h=i(`assistants.contact.card.schedule.aria`,{name:a}),t[12]=i,t[13]=a,t[14]=h):h=t[14];let g;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(q,{name:`calendar`,weight:`medium`,className:`size-4 shrink-0`}),t[15]=g):g=t[15];let _;t[16]===i?_=t[17]:(_=i(`assistants.contact.card.schedule.label`),t[16]=i,t[17]=_);let v;t[18]===_?v=t[19]:(v=(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-[0.8em] leading-4 text-muted-foreground`,children:[g,(0,$.jsx)(`span`,{className:`truncate`,children:_})]}),t[18]=_,t[19]=v);let y;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(q,{name:`arrow-right-s`,weight:`medium`,className:`ml-auto size-4 shrink-0 text-muted-foreground`}),t[20]=y):y=t[20];let b;t[21]===v?b=t[22]:(b=(0,$.jsxs)(`div`,{className:qt,children:[v,y]}),t[21]=v,t[22]=b);let x;t[23]===a?x=t[24]:(x=(0,$.jsx)(`h3`,{className:Jt,title:a,children:a}),t[23]=a,t[24]=x);let S;t[25]===l?S=t[26]:(S=l?(0,$.jsx)(`p`,{className:`row-start-3 mt-1 min-w-0 truncate text-[0.8em] leading-4 text-muted-foreground`,title:l,children:l}):null,t[25]=l,t[26]=S);let C;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(C=H(Yt,`justify-end`),t[27]=C):C=t[27];let w;t[28]===s.cadence?w=t[29]:(w=s.cadence?(0,$.jsx)(`span`,{"data-contact-schedule-cadence":``,className:`min-w-0 max-w-[36%] flex-[0_1_auto] truncate text-[0.75em] leading-4 text-muted-foreground`,title:s.cadence,children:s.cadence}):null,t[28]=s.cadence,t[29]=w);let T=`min-w-0 flex-[0_1_auto] truncate leading-[22px] text-foreground tabular-nums ${s.clock?`text-[1.25em] font-normal tracking-[-0.3px]`:`text-[0.85em]`}`,E;t[30]!==s.value||t[31]!==T?(E=(0,$.jsx)(`p`,{className:T,title:s.value,children:s.value}),t[30]=s.value,t[31]=T,t[32]=E):E=t[32];let D;t[33]!==w||t[34]!==E?(D=(0,$.jsx)(`div`,{className:C,children:(0,$.jsxs)(`div`,{"data-contact-schedule-time":``,className:`flex min-w-0 flex-none items-baseline gap-1.5`,children:[w,E]})}),t[33]=w,t[34]=E,t[35]=D):D=t[35];let O;return t[36]!==m||t[37]!==f||t[38]!==b||t[39]!==x||t[40]!==S||t[41]!==D||t[42]!==h?(O=(0,$.jsxs)(`article`,{className:Gt,role:`button`,tabIndex:0,"aria-label":h,"data-assistant-contact-card":`schedule`,onClick:f,onKeyDown:m,children:[b,x,S,D]}),t[36]=m,t[37]=f,t[38]=b,t[39]=x,t[40]=S,t[41]=D,t[42]=h,t[43]=O):O=t[43],O},sn=(e,t)=>t===`cancelled`?t:e===`busy`||e===`retry`?e:t===`error`||t===`question`||t===`complete`||t===`busy`||t===`retry`?t:e===`idle`?`complete`:t===`idle`?t:t||`busy`,cn=e=>e===`cancelled`?`assistants.contact.card.session.status.cancelled`:e===`busy`?`assistants.contact.card.session.status.busy`:e===`retry`?`assistants.contact.card.session.status.retry`:e===`idle`?`assistants.contact.card.session.status.idle`:e===`complete`?`assistants.contact.card.session.status.complete`:e===`error`?`assistants.contact.card.session.status.error`:e===`question`?`assistants.contact.card.session.status.question`:null,ln=e=>e===`busy`?`text-[var(--status-info)]`:e===`retry`||e===`question`?`text-[var(--status-warning)]`:e===`error`?`text-[var(--status-error)]`:e===`idle`||e===`complete`?`text-[var(--status-success)]`:`text-muted-foreground`,un=e=>e.split(/[/\\]/u).filter(Boolean).at(-1)||e,dn=e=>{let t=(0,Z.c)(57),{card:n}=e,{t:r}=te(),a=Y(),o;t[0]===a?o=t[1]:(o=a&&!i(),t[0]=a,t[1]=o);let s=!!o,c;t[2]===n.sessionID?c=t[3]:(c=e=>e.activeSessions.find(e=>e.id===n.sessionID)??e.archivedSessions.find(e=>e.id===n.sessionID)??null,t[2]=n.sessionID,t[3]=c);let l=se(c),u=U(n.sessionID),d=(typeof l?.title==`string`&&l.title.trim()?l.title.trim():null)||n.title||r(`assistants.contact.card.session.untitled`),f=sn(u?.type,n.status),p=cn(f),m;t[4]!==n.directory||t[5]!==l?(m=typeof l?.directory==`string`&&l.directory.trim()?l.directory.trim():n.directory,t[4]=n.directory,t[5]=l,t[6]=m):m=t[6];let h=m,g;t[7]===h?g=t[8]:(g=un(h),t[7]=h,t[8]=g);let _=g,v=G(h).data?.current?.trim()||null,y;t[9]===l?y=t[10]:(y=X(l),t[9]=l,t[10]=y);let b=y,x=f===`complete`||f===`idle`?we(l):null,S=Q.useContext(Ut),w;t[11]!==n.directory||t[12]!==n.sessionID||t[13]!==s||t[14]!==S?(w=()=>{let e=Ne(n.sessionID)?.directory||n.directory;if(S)return S({sessionId:n.sessionID,directory:e});oe(n.sessionID,e,{phoneShell:s,switchToChat:!0}),s||C.getState().setActiveMainTab(`chat`)},t[11]=n.directory,t[12]=n.sessionID,t[13]=s,t[14]=S,t[15]=w):w=t[15];let T=M(w),E;t[16]===T?E=t[17]:(E=e=>{Xt(e,T)},t[16]=T,t[17]=E);let D=M(E),O=Kt,k=r(`assistants.contact.card.session.aria`,{title:d}),A;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,$.jsx)(q,{name:`chat-thread`,weight:`medium`,className:`size-4 shrink-0`}),t[18]=A):A=t[18];let j;t[19]===r?j=t[20]:(j=r(`assistants.contact.card.session.label`),t[19]=r,t[20]=j);let ee;t[21]===j?ee=t[22]:(ee=(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-[0.8em] leading-4 text-muted-foreground`,children:[A,(0,$.jsx)(`span`,{className:`truncate`,children:j})]}),t[21]=j,t[22]=ee);let ne=p?(0,$.jsxs)(`span`,{"data-assistant-session-status":``,className:H(`ml-auto inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap text-[0.75em] leading-4`,ln(f)),children:[(0,$.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full bg-current`,"aria-hidden":!0}),r(p)]}):null,N;t[23]!==ee||t[24]!==ne?(N=(0,$.jsxs)(`div`,{className:qt,children:[ee,ne]}),t[23]=ee,t[24]=ne,t[25]=N):N=t[25];let P;t[26]===d?P=t[27]:(P=(0,$.jsx)(`h3`,{className:Jt,title:d,children:d}),t[26]=d,t[27]=P);let re=H(`flex min-w-0 items-center gap-1.5 text-foreground`,v&&`max-w-[45%] shrink-0`),ie;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,$.jsx)(q,{name:`folder`,weight:`medium`,className:`size-3.5 shrink-0 text-muted-foreground`}),t[28]=ie):ie=t[28];let F;t[29]===_?F=t[30]:(F=(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:_}),t[29]=_,t[30]=F);let I;t[31]!==h||t[32]!==re||t[33]!==F?(I=(0,$.jsxs)(`p`,{className:re,title:h,children:[ie,F]}),t[31]=h,t[32]=re,t[33]=F,t[34]=I):I=t[34];let L;t[35]===v?L=t[36]:(L=v?(0,$.jsxs)(`p`,{"data-contact-session-branch":``,className:`flex min-w-0 items-center gap-1 text-muted-foreground`,title:v,children:[(0,$.jsx)(q,{name:`git-branch`,weight:`medium`,className:`size-3 shrink-0`}),(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:v})]}):null,t[35]=v,t[36]=L);let R;t[37]!==I||t[38]!==L?(R=(0,$.jsxs)(`div`,{"data-contact-session-project":``,className:`flex h-4 min-w-0 flex-none items-center gap-2 text-[0.8em] leading-4`,children:[I,L]}),t[37]=I,t[38]=L,t[39]=R):R=t[39];let z=x?(0,$.jsxs)(`p`,{"data-contact-session-changes":``,className:`flex h-4 min-w-0 flex-none items-center gap-1.5 overflow-hidden whitespace-nowrap text-[0.8em] leading-4 text-muted-foreground tabular-nums`,children:[(0,$.jsx)(q,{name:`code`,weight:`medium`,className:`size-3.5 shrink-0`}),x.additions===void 0?null:(0,$.jsxs)(`span`,{className:`text-[var(--status-success)]`,children:[`+`,x.additions]}),x.deletions===void 0?null:(0,$.jsxs)(`span`,{className:`text-[var(--status-error)]`,children:[`−`,x.deletions]}),x.files===void 0?null:(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:x.files===1?r(`assistants.contact.card.session.changes.filesSingle`,{count:x.files}):r(`assistants.contact.card.session.changes.filesPlural`,{count:x.files})})]}):null,B;t[40]===b?B=t[41]:(B=b?(0,$.jsx)(Ht,{value:b}):null,t[40]=b,t[41]=B);let V;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,$.jsx)(q,{name:`arrow-right-s`,weight:`medium`,className:`ml-auto size-4 shrink-0 text-muted-foreground`}),t[42]=V):V=t[42];let ae;t[43]===B?ae=t[44]:(ae=(0,$.jsxs)(`div`,{"data-contact-session-bottom":``,className:`mt-auto flex h-4 min-w-0 flex-none items-center gap-2`,children:[B,V]}),t[43]=B,t[44]=ae);let W;t[45]!==R||t[46]!==z||t[47]!==ae?(W=(0,$.jsxs)(`div`,{"data-contact-session-details":``,className:`row-start-3 row-end-5 flex min-w-0 flex-col gap-1.5 py-1`,children:[R,z,ae]}),t[45]=R,t[46]=z,t[47]=ae,t[48]=W):W=t[48];let K;return t[49]!==D||t[50]!==T||t[51]!==k||t[52]!==N||t[53]!==P||t[54]!==W||t[55]!==O?(K=(0,$.jsxs)(`article`,{className:O,role:`button`,tabIndex:0,"aria-label":k,"data-assistant-contact-card":`session`,onClick:T,onKeyDown:D,children:[N,P,W]}),t[49]=D,t[50]=T,t[51]=k,t[52]=N,t[53]=P,t[54]=W,t[55]=O,t[56]=K):K=t[56],K},fn=3e5,pn=(e,t)=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate();function mn(e){let t=new Map,n=null;for(let r of e){if(!(r.status===`error`||r.status===`failed`||r.parts.some(e=>e.type!==`text`||e.text.trim()&&!e.text.trim().startsWith(`yuri.settle.`)&&!e.text.trim().startsWith(`oc.settle.`))))continue;let e=new Date(r.createdAt);Number.isFinite(e.getTime())&&((!n||!pn(n,e)||e.getTime()-n.getTime()>fn)&&t.set(r.messageID,r.createdAt),n=e)}return t}function hn(e,t,n){let r=new Intl.DateTimeFormat(e,{hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`}),i=new Intl.DateTimeFormat(e,{month:`long`,day:`numeric`}),a=new Intl.DateTimeFormat(e,{year:`numeric`,month:`long`,day:`numeric`});return e=>{let o=new Date(e);return`${pn(o,n)?t:(o.getFullYear()===n.getFullYear()?i:a).format(o)} ${r.format(o)}`}}var gn=2,_n=1500,vn=e=>({scrollTop:e.scrollTop,scrollHeight:e.scrollHeight,clientHeight:e.clientHeight}),yn=e=>e.scrollHeight-e.scrollTop-e.clientHeight,bn=e=>yn(e)<=gn,xn=(e,t)=>{let n=t instanceof Element?t:t instanceof Node?t.parentElement:null;for(;n&&n!==e;){if(n instanceof HTMLElement&&n.scrollHeight>n.clientHeight+1&&n.scrollTop+n.clientHeight<n.scrollHeight-1)return!0;n=n.parentElement}return!1},Sn=e=>e.altKey||e.ctrlKey||e.metaKey?!1:e.key===`ArrowDown`||e.key===`PageDown`||e.key===`End`,Cn=({active:e,assistantID:t,contentRevision:n,onLoadEarlier:r})=>{let i=Q.useRef(null),[a,o]=Q.useState(null),[s,c]=Q.useState(null),l=Q.useRef(!0),u=Q.useRef(null),d=Q.useRef(null),f=Q.useRef(null),p=Q.useRef(0),m=Q.useRef(null),h=Q.useRef(null),g=Q.useRef(e);g.current=e;let _=ve(),v=Q.useRef(!1),y=Q.useRef(null),b=Q.useRef(null),x=M(()=>{y.current?.stop(),y.current=null,b.current=null}),S=Q.useMemo(()=>e=>{i.current=e,o(t=>t===e?t:e)},[]),C=Q.useMemo(()=>e=>{c(t=>t===e?t:e)},[]),w=M(()=>{let e=i.current;if(!e||!g.current||l.current)return;let t=e.getBoundingClientRect().top,n=Array.from(e.querySelectorAll(`[data-message-id]`)).find(e=>e.getBoundingClientRect().bottom>t);u.current=n?{id:n.dataset.messageId,offset:n.getBoundingClientRect().top-t,scrollTop:e.scrollTop}:null}),T=M(()=>{let e=i.current,t=u.current;if(!e||!g.current||l.current)return;if(!t){w();return}let n=e.scrollTop-t.scrollTop;if(Math.abs(n)>.5&&m.current){p.current=e.scrollTop,w();return}let r=Array.from(e.querySelectorAll(`[data-message-id]`)).find(e=>e.dataset.messageId===t.id);if(!r){w();return}let a=r.getBoundingClientRect().top-e.getBoundingClientRect().top-(t.offset-n);Math.abs(a)>.5&&(e.scrollTop+=a),p.current=e.scrollTop,u.current={id:t.id,offset:r.getBoundingClientRect().top-e.getBoundingClientRect().top,scrollTop:e.scrollTop}}),E=M(()=>{x(),l.current=!1,p.current=i.current?.scrollTop??0,w()}),D=Q.useRef(null),O=M(e=>{let t=i.current;!g.current||!t||(D.current=e??null,l.current=!0,u.current=null,h.current=null,p.current=t.scrollTop)}),k=M(()=>{if(!g.current||!l.current)return!1;let e=i.current;if(!e)return!1;let t=vn(e),n=Math.min(p.current,Math.max(0,t.scrollHeight-t.clientHeight));if(t.scrollTop<n-.5)return x(),l.current=!1,p.current=t.scrollTop,w(),!1;let r=!v.current;if(r&&e.querySelector(`[data-message-id]`)&&(v.current=!0),bn(t))return x(),p.current=t.scrollTop,!1;let a=Math.max(0,t.scrollHeight-t.clientHeight);if(!r&&!_){if(b.current===a)return!1;x(),b.current=a;let t=D.current;return D.current=null,y.current=_e(e.scrollTop,a,{duration:t?.duration??.22,ease:t?[...t.ease]:`easeOut`,onUpdate:t=>{if(!g.current||!l.current||i.current!==e)return;let n=Math.max(0,e.scrollHeight-e.clientHeight);if(e.scrollTop<Math.min(p.current,n)-.5){l.current=!1,x(),p.current=e.scrollTop,w();return}e.scrollTop=Math.min(Math.max(e.scrollTop,t),n),p.current=e.scrollTop},onComplete:()=>{y.current=null,b.current=null}}),!0}return x(),e.scrollTop=a,p.current=e.scrollTop,!0}),j=M(e=>{h.current={direction:e,expiresAt:performance.now()+_n}}),te=M(()=>{let e=h.current;return e?performance.now()>e.expiresAt?(h.current=null,null):e.direction:null}),ne=M(()=>{x(),l.current=!1,w()}),N=M(()=>{if(!g.current)return;let e=i.current;if(!e)return;let t=vn(e),n=t.scrollTop>p.current,a=Math.min(p.current,Math.max(0,t.scrollHeight-t.clientHeight));if(p.current=t.scrollTop,l.current){t.scrollTop<a-.5&&ne();return}let o=te();T(),t.scrollTop<=80&&o===`up`&&r?.(),n&&bn(t)&&(o===`down`||o===`scrollbar`)&&(l.current=!0)}),P=M(e=>{let t=i.current;if(!(!t||e.deltaY===0)){if(e.deltaY<0){if(je(t,e.target))return;j(`up`),ne(),t.scrollTop<=80&&r?.();return}xn(t,e.target)||j(`down`)}}),re=M(e=>{h.current=null;let t=e.touches.item(0);m.current=t?{x:t.clientX,y:t.clientY,deltaX:0,deltaY:0}:null}),ie=M(e=>{let t=i.current,n=e.touches.item(0);if(!t||!n){m.current=null;return}let a=m.current;if(!a)return;let o=n.clientY-a.y,s=o*a.deltaY<0,c=(s?0:a.deltaX)+n.clientX-a.x,l=(s?0:a.deltaY)+o;if(m.current={x:n.clientX,y:n.clientY,deltaX:c,deltaY:l},!(Math.abs(c)>=Math.abs(l))){if(l>0&&je(t,e.target)||l<0&&xn(t,e.target)){m.current.deltaX=0,m.current.deltaY=0;return}j(l>0?`up`:`down`),l>2&&(ne(),t.scrollTop<=80&&r?.())}}),F=M(()=>{m.current=null}),I=M(e=>{if(De(e)){j(`up`),ne(),(i.current?.scrollTop??1/0)<=80&&r?.();return}Sn(e)&&j(`down`)}),L=M(e=>{let t=i.current;e.pointerType===`mouse`&&e.target===t&&j(`scrollbar`)});Q.useLayoutEffect(()=>{let n=e?t:null,r=i.current;(d.current!==n||f.current!==r)&&(x(),v.current=!1,d.current=n,f.current=r,l.current=!0,u.current=null,h.current=null,m.current=null,p.current=r?.scrollTop??0),e&&(k(),T())},[e,t,n,a,_]),Q.useLayoutEffect(()=>()=>{x()},[e,t,a,x]);let R=Q.useMemo(()=>()=>void 0,[]),z=e&&a?a:R,B=Q.useMemo(()=>({passive:!0}),[]);A(`scroll`,N,z,B),A(`wheel`,P,z,B),A(`touchstart`,re,z,B),A(`touchmove`,ie,z,B),A(`touchend`,F,z,B),A(`touchcancel`,F,z,B),A(`keydown`,I,z),A(`pointerdown`,L,z,B);let V=Q.useRef(null),ae=M(()=>{let e=i.current;V.current=e&&g.current?{element:e,top:e.scrollTop,height:e.clientHeight}:null}),oe=M(()=>{let e=i.current,t=V.current;!e||t?.element!==e||t.height===e.clientHeight||(V.current=null,x(),e.scrollTop=Math.max(0,t.top+t.height-e.clientHeight),p.current=e.scrollTop,l.current?k():w())});A(`yuri:keyboard-native-layout`,ae,e&&typeof window<`u`?window:R);let H=M(()=>{k(),T()}),U=typeof ResizeObserver<`u`;return ee(U&&e?s:null,H),ee(U&&e?a:null,oe),{scrollRef:S,contentRef:C,preparePrepend:E,followLatest:O}},wn=.3,Tn=[.19919472913616398,.010644531250000006,.27920937042459737,.91025390625],En=[.23,1,.32,1],Dn=ge(...Tn),On=ge(...En),kn=.15,An=.1,jn=.08,Mn=e=>({left:e.left,top:e.top,width:e.width,height:e.height}),Nn=e=>Number.parseFloat(e)||0,Pn=(e,t,n)=>e+(t-e)*n,Fn=e=>[e.borderTopLeftRadius,e.borderTopRightRadius,e.borderBottomRightRadius,e.borderBottomLeftRadius],In=e=>{let t=e.getBoundingClientRect(),n=window.getComputedStyle(e),r=t.left+Nn(n.borderLeftWidth)+Nn(n.paddingLeft),i=t.top+Nn(n.borderTopWidth)+Nn(n.paddingTop);return{left:r,top:i,width:t.right-Nn(n.borderRightWidth)-Nn(n.paddingRight)-r,height:t.bottom-Nn(n.borderBottomWidth)-Nn(n.paddingBottom)-i}},Ln=e=>({color:e.color,fontFamily:e.fontFamily,fontSize:e.fontSize,fontWeight:e.fontWeight,fontFeatureSettings:e.fontFeatureSettings,letterSpacing:e.letterSpacing,lineHeight:e.lineHeight,whiteSpace:`pre-wrap`,overflowWrap:`anywhere`}),Rn=(e,t,n=!1)=>{if(!t.value.trim())return null;let r=window.getComputedStyle(e),i=In(t),a=t.parentElement?.querySelector(`[data-composer-highlight]`),o=Ln(window.getComputedStyle(t));return a&&(o.color=window.getComputedStyle(a).color),{compact:n,background:Mn(e.getBoundingClientRect()),backgroundColor:r.backgroundColor,radii:Fn(r),text:t.value,textBox:{...i,top:i.top-t.scrollTop},textStyle:o}},zn=e=>{let t=document.createElement(`div`);return Object.assign(t.style,{position:`absolute`,pointerEvents:`none`,margin:`0px`,...e}),t},Bn=(e,t,n,r)=>(e.style.opacity=String(t),_e(e,{opacity:[t,n]},{duration:r,ease:`linear`})),Vn=(e,t,n=t,r)=>{let i=window.getComputedStyle(t),a=Fn(i),o=Mn(t.getBoundingClientRect()),s=In(t),c=e.compact?{...e.background,left:e.textBox.left-Nn(i.paddingLeft),width:Math.min(e.background.width,Math.max(120,o.width+32))}:e.background,l={left:c.left,top:c.top+c.height-o.height},u={x:e.textBox.left-l.left-(s.left-o.left),y:e.textBox.top-l.top-(s.top-o.top)},d=zn({position:`fixed`,left:`0px`,top:`0px`,overflow:`hidden`,zIndex:`60`,willChange:`transform, width, height`});d.setAttribute(`aria-hidden`,`true`),d.setAttribute(`data-assistant-contact-send-flight`,``),d.style.backgroundColor=e.backgroundColor;let f=zn({...e.textStyle,left:`0px`,top:`0px`,width:`${e.textBox.width}px`});f.textContent=e.text;let p=zn({...Ln(i),left:`0px`,top:`0px`,width:`${s.width}px`});p.textContent=t.textContent??``,d.append(f,p);let m=n=>{let r=Dn(n),i=On(n),m=Mn(t.getBoundingClientRect()),h=c,g=Pn(h.left,m.left,i),_=Pn(h.left+h.width,m.left+m.width,i),v=Pn(h.top+h.height,m.top+m.height,r),y=Pn(h.height,m.height,r),b=v-y;d.style.transform=`translate3d(${g}px, ${b}px, 0)`,d.style.width=`${_-g}px`,d.style.height=`${y}px`,d.style.borderRadius=a.map((t,n)=>`${Pn(Nn(e.radii[n]),Nn(t),r)}px`).join(` `);let x=m.left+(l.left-o.left)*(1-i),S=m.top+(l.top-o.top)*(1-r),C=`translate3d(${x+(s.left-o.left)+u.x*(1-r)-g}px, ${S+(s.top-o.top)+u.y*(1-r)-b}px, 0)`;f.style.transform=C,p.style.transform=C},h=!1,g=[],_=()=>{h||(h=!0,g.forEach(e=>e.stop()),d.remove(),n.style.visibility=``,r?.())};return n.style.visibility=`hidden`,m(0),document.body.appendChild(d),g.push(_e(d,{backgroundColor:[e.backgroundColor,i.backgroundColor]},{duration:kn,ease:`linear`}),Bn(f,1,0,An),Bn(p,0,1,jn),_e(0,1,{duration:wn,ease:`linear`,onUpdate:m,onComplete:_})),_},Hn=64,Un=e=>{if(!e)return[];let t=Array.from(e.files||[]);return t.length>0?t:Array.from(e.items||[]).filter(e=>e.kind===`file`).map(e=>e.getAsFile()).filter(e=>e instanceof File)},Wn=e=>Array.from(e?.files||[]),Gn=async(e,t=D)=>{let n=[],r=0;for(let i of Array.from(e||[])){if(!i||i.size<=0)continue;if(i.size>26214400){r+=1;continue}let e=URL.createObjectURL(i);n.push({id:t(),url:e,name:i.name.trim()||`attachment`,mime:i.type.trim()||`application/octet-stream`,file:i})}return{attachments:n,skippedTooLarge:r}},Kn=(e,t)=>{let n=[...e,...t];for(let e of n.slice(Hn))e.url.startsWith(`blob:`)&&URL.revokeObjectURL(e.url);return n.slice(0,Hn)},qn=J(()=>E(()=>import(`./ToolOutputDialog-CNm-8Knm.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77]))),Jn=e=>e.trim().startsWith(`yuri.settle.`)||e.trim().startsWith(`oc.settle.`),Yn=e=>e.status===`error`||e.status===`failed`&&e.messageID.endsWith(`:preview:failed`),Xn=e=>e.role===`assistant`&&e.status!==`error`&&e.parts.some(e=>e.type===`text`)?`${e.turnID}:assistant:${e.bubbleIndex}`:e.messageID,Zn=({assistant:e,warning:t,active:n,overlayHeader:r=!1})=>{let{t:i,locale:a}=te(),o=Ve(),s=C(e=>e.isMobile),c=F(),l=B(),u=ie(e.id,n),d=C(e=>e.isSettingsDialogOpen),f=n&&!d&&!u.hasMessageGap?V(e,u.data):null,p=ue(e.name).displayName||e.name,m=pe(me(e.avatarSeed??e.id).color),h=(e,t)=>{let n=e?l.data?.assistants.find(t=>t.id===e):void 0;return n?ue(n.name).displayName||n.name:t||i(`assistants.contact.peer.unknown`)},[g,_]=Q.useState(``),[v,y]=Q.useState([]),b=Q.useRef(new Map),x=Q.useRef(new Map),S=Q.useRef(new AbortController);Q.useEffect(()=>{let e=new AbortController;return S.current=e,()=>e.abort()},[e.id,o]);let w=Q.useRef(new Set),[T,E]=Q.useState([]);Q.useEffect(()=>{let e=new Set(v.map(e=>e.url));for(let t of b.current.values())for(let n of t.attachments)e.add(n.url);for(let t of w.current)e.has(t)||URL.revokeObjectURL(t);w.current=e},[v,T]),Q.useEffect(()=>()=>{for(let e of w.current)URL.revokeObjectURL(e)},[]);let[O,k]=Q.useState([]),[A,j]=Q.useState(null),[ee,ne]=Q.useState({open:!1,title:``,content:``}),N=C(e=>e.setImagePreviewOpen),L=M(e=>{(e.image||e.mermaid||e.video)&&(ne(e),N(!0))}),z=M(e=>{ne(t=>({...t,open:e})),N(e)});Q.useEffect(()=>()=>{N(!1)},[N]),Q.useEffect(()=>{x.current.clear(),b.current.clear(),E([]),k([]),j(null)},[o]);let oe=Q.useMemo(()=>Pt(),[]),U=Q.useRef(new Set),se=Q.useRef(new Map),G=Rt(e=>e.setWorking),K=u.data?.messages??gt,ce=Q.useMemo(()=>K.some(e=>e.parts.some(e=>e.type===`card`&&e.cardType===`schedule`&&tn(e))),[K]),le=P(e.id,n&&ce),fe=Q.useMemo(()=>{let e=new Map;for(let t of le.data?.tasks??[]){if(!t.task)continue;let n=e.get(t.projectID);n||(n=new Map,e.set(t.projectID,n)),n.set(t.taskID,t.task)}return e},[le.data]),he=yt(T,e.id),ge=bt(O,e.id),_e=Ct(K,he,e.id,ge).filter(e=>{if(e.status===`admitted`&&e.messageID.endsWith(`:preview:admitted`))return!1;let t=Array.isArray(e.parts)?e.parts:[];return t.length===0||t.some(e=>!(e.type===`text`&&Jn(e.text)))}),ye=_e.length-1;for(;ye>=0&&Yn(_e[ye]);)--ye;let J=_e.filter((e,t)=>!Yn(e)||t>ye),be=mn(J),Se=ve(),Y=`${o}:${e.id}`,Ce=Q.useRef(null),we=Ce.current,Te=we?.lastID?J.findIndex(e=>Xn(e)===we.lastID):-1,Ee=n&&!Se&&we?.scope===Y&&we.ready&&(we.lastID===null||Te>=0);Q.useLayoutEffect(()=>{let e=J.at(-1);Ce.current={scope:Y,ready:n&&u.isSuccess,lastID:e?Xn(e):null}});let De=new Date().toDateString(),Oe=i(`common.date.today`),ke=Q.useMemo(()=>hn(a,Oe,new Date(De)),[a,Oe,De]),Ae=It(he),je=Lt(ge),X=!!(e.working||e.activeContactTurn),Me=l.data?.revision??null,Ne=ge.reduce((e,t)=>e+t.bubbles.reduce((e,t)=>e+t.text.length,0),0),Pe=new Map(ge.map(e=>[e.turnID,e])),Fe=Q.useRef(!1),Ie=M(async(e=!1)=>{if(!(!n||Fe.current||u.isFetchingPreviousPage||u.isFillingMessageGap)&&!(e&&u.previousPageError)&&!(!u.hasPreviousPage&&!u.hasMessageGap)){Fe.current=!0,ze();try{u.hasMessageGap?await u.retryMessageGap():await u.fetchPreviousPage()}catch{}finally{Fe.current=!1}}}),{scrollRef:Le,contentRef:Re,preparePrepend:ze,followLatest:Be}=Cn({active:n,assistantID:e.id,contentRevision:`${J[0]?.messageID}:${J.length}:${Ne}:${u.isFetchingPreviousPage}:${u.hasPreviousPage}:${u.isFillingMessageGap}`,onLoadEarlier:()=>{Ie(!0)}}),He=Q.useRef(null),Ue=Q.useRef(null),We=Q.useRef(null),Ge=Q.useRef(null),Je=Q.useRef(null),[Ye,Z]=Q.useState(null),Ze=()=>{let e=Ue.current?.querySelector(`[data-assistant-contact-composer-surface]`),t=e?.querySelector(`textarea`);return e&&t?Rn(e,t,!s):null};Q.useLayoutEffect(()=>{let e=We.current;if(!e)return;We.current=null;let t=Array.from(He.current?.querySelectorAll(`[data-message-id]`)??[]).find(t=>t.dataset.messageId===e.messageID)?.querySelector(`[data-assistant-contact-text]`),n=()=>Z(t=>t?.messageID===e.messageID?null:t);if(!t){n();return}Je.current?.(),Je.current=Vn(e.source,t,t,n)}),Q.useEffect(()=>()=>{We.current=null,Je.current?.(),Je.current=null},[n,e.id,o]),Q.useEffect(()=>{j(null),b.current.clear(),x.current.clear(),U.current.clear(),se.current=new Map,E(t=>yt(t,e.id)),k(t=>bt(t,e.id)),ne({open:!1,title:``,content:``}),N(!1)},[e.id,N]),Q.useEffect(()=>{for(let e of K){let t=b.current.get(e.messageID);if(t){for(let e of t.attachments)x.current.delete(`${t.assistantID}:${e.id}`);b.current.delete(e.messageID)}}E(e=>wt(e,K))},[K]),Q.useEffect(()=>{let t=new Set(he.filter(e=>e.status===`sending`).map(e=>e.messageID));k(n=>Ot(n,{assistantID:e.id,activeContactTurn:e.activeContactTurn?{turnID:e.activeContactTurn.turnID,admittedAt:e.activeContactTurn.admittedAt}:null,serverWorking:X,snapshotRevision:Me,admissionRevisionByTurnID:se.current,pendingSendTurnIDs:t,messages:K,settledTurnIDs:U.current}))},[e.activeContactTurn,e.id,K,he,X,Me]),Q.useEffect(()=>{G(e.id,Ae||je||X)},[e.id,je,Ae,X,G]),Q.useEffect(()=>{let t=e.id;return()=>{G(t,!1)}},[e.id,G]);let Qe=M(t=>{if(!(!(`assistantID`in t)||t.assistantID!==e.id)){if(t.type===`contact-turn-start`){U.current.delete(t.turnID),k(e=>Et(e,t.assistantID,t.turnID,t.occurredAt));return}if(t.type===`contact-bubble-delta`){if(U.current.has(t.turnID))return;k(e=>kt(e,t));return}t.type===`contact-turn-end`&&(U.current.add(t.turnID),k(e=>jt(At(e,t,{requireExisting:!0}),K)))}});Q.useEffect(()=>{if(n)return ae(Qe)},[n,e.id]);let $e=M(async e=>{if(Ae)return;let t=S.current,n=await Gn(e);if(t.signal.aborted){n.attachments.forEach(e=>URL.revokeObjectURL(e.url));return}n.skippedTooLarge>0&&j(i(`assistants.contact.attachment.tooLarge`)),n.attachments.length!==0&&y(e=>Kn(e,n.attachments))}),et=M(e=>{let t=Un(e.clipboardData);t.length!==0&&(e.preventDefault(),$e(t))}),tt=M(e=>{Array.from(e.dataTransfer?.types??[]).includes(`Files`)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`)}),nt=M(e=>{let t=Wn(e.dataTransfer);t.length!==0&&(e.preventDefault(),$e(t))}),rt=M(async(t,r)=>{let a=S.current,o=e.id,s=r?b.current.get(r):void 0;if(r&&(!s||s.assistantID!==o))return;let l=s?.text??t??g,u=s?.attachments??v,d=Ft({gate:oe,sending:It(he),text:l,attachments:u,assistantID:o,createMessageID:()=>r||`yuri_contact_${D()}`});if(!d.ok)return;G(o,!0),b.current.set(d.messageID,{assistantID:o,text:l,attachments:u});let f=u.length===0&&t===void 0&&!r&&n&&!Se?Ze():null;We.current=f?{messageID:d.messageID,source:f}:null,Z(f?{scope:Y,messageID:d.messageID}:null),Ge.current=f?d.messageID:Ge.current,r||(Be(f?{duration:wn,ease:Tn}:void 0),_(e=>e===l?``:e),y(e=>e.filter(e=>!u.includes(e)))),E(e=>e.some(e=>e.messageID===d.messageID)?e.map(e=>e.messageID===d.messageID?{...d.turn,createdAt:e.createdAt}:e):[...e,d.turn]),j(null);let m=()=>{u.forEach(e=>x.current.delete(`${o}:${e.id}`)),b.current.delete(d.messageID)};try{let t=[];for(let e of u){let n=`${o}:${e.id}`,r=x.current.get(n);if(!r){if(r=await qe(o,e.file,e.id,a.signal),a.signal.aborted)return;x.current.set(n,r)}t.push(r)}if(a.signal.aborted)return;let n=[...d.parts.filter(e=>e.type===`text`),...t];E(e=>e.map(e=>e.messageID===d.messageID?{...e,parts:n}:e));let r=await re(o,d.messageID,{parts:n});if(a.signal.aborted)return;m(),typeof r.revision==`number`&&se.current.set(d.messageID,r.revision),E(e=>Tt(e,d.messageID)),U.current.has(d.messageID)||k(e=>Et(e,o,d.messageID)),c.data?.serverInstanceID&&de({serverInstanceID:c.data.serverInstanceID,assistantID:o,name:p,avatarSeed:e.avatarSeed??o}).catch(()=>void 0)}catch(e){if(a.signal.aborted)return;if(e instanceof I&&e.code===`admission_timeout`)try{let e=await R(o,d.messageID);if(a.signal.aborted)return;if(e){m(),typeof e.revision==`number`&&se.current.set(d.messageID,e.revision),E(e=>Tt(e,d.messageID)),U.current.has(d.messageID)||k(e=>Et(e,o,d.messageID));return}}catch{}let t=Nt(e,{noProvider:i(`assistants.contact.noProvider`),sendFailed:i(`assistants.contact.sendFailed`),timedOut:i(`assistants.contact.timedOut`)});E(e=>Mt(e,d.messageID,t))}finally{oe.release()}}),it=M(e=>{rt(void 0,e)}),at=u.isError&&J.length===0,ot=u.isSuccess&&J.length===0,ct=new Map(he.map(e=>[e.messageID,e]));return(0,$.jsxs)(`div`,{ref:He,className:`flex min-h-0 flex-1 flex-col bg-background`,children:[(0,$.jsxs)(`div`,{ref:Le,className:H(`min-h-0 flex-1 overflow-x-hidden overflow-y-auto px-4 sm:px-8`,s&&`pb-11`,r?`pt-[calc(max(0.625rem,var(--yuri-safe-area-top,0px))+var(--yuri-mobile-detail-navigation-height)+1.25rem)]`:`pt-5 sm:pt-7`),style:{overflowAnchor:`none`,overscrollBehavior:`contain`,overscrollBehaviorY:`contain`},"data-assistant-contact-transcript":``,children:[t?(0,$.jsx)(`p`,{className:`mb-3 typography-micro text-[var(--status-warning)]`,children:t}):null,at?(0,$.jsxs)(`div`,{ref:Re,className:`mx-auto flex h-full min-h-56 max-w-xs flex-col items-center justify-center pb-16 text-center`,"data-assistant-contact-error":``,children:[(0,$.jsxs)(`div`,{className:`relative`,children:[(0,$.jsx)(Vt,{name:e.id,avatarSeed:e.avatarSeed,size:44,label:p,working:n?X:void 0,showWorkingDot:!1,followPointer:!1}),(0,$.jsx)(`span`,{"aria-hidden":!0,className:`absolute -right-1 -bottom-1 flex size-5 items-center justify-center rounded-full bg-[var(--surface-elevated)] text-[var(--status-error)] ring-2 ring-background`,children:(0,$.jsx)(q,{name:`error-warning`,className:`size-3`})})]}),(0,$.jsx)(`p`,{className:`mt-4 typography-ui-label font-medium text-foreground`,children:p}),(0,$.jsx)(`p`,{className:`mt-1.5 typography-ui leading-6 text-muted-foreground`,children:i(`assistants.contact.loadFailed`)}),(0,$.jsx)(W,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>void u.refetch(),children:i(`chat.history.retry`)})]}):ot?(0,$.jsxs)(`div`,{ref:Re,className:`mx-auto flex h-full min-h-56 max-w-sm flex-col items-center justify-center pb-16 text-center`,"data-assistant-contact-empty":``,children:[(0,$.jsx)(Vt,{name:e.id,avatarSeed:e.avatarSeed,size:48,label:p,className:`opacity-90`,working:n?X:void 0,showWorkingDot:!1,followPointer:!1}),(0,$.jsx)(`p`,{className:`mt-5 typography-ui-header font-medium tracking-[-0.01em] text-foreground`,children:i(`assistants.conversation.emptyTitle`,{name:p})}),(0,$.jsx)(`p`,{className:`mt-2 max-w-xs typography-ui leading-6 text-muted-foreground/80`,children:i(`assistants.contact.empty`)})]}):(0,$.jsxs)(`div`,{ref:Re,className:`relative mx-auto flex w-full max-w-[42rem] flex-col pb-12`,"data-assistant-contact-content":``,children:[u.isPending?(0,$.jsx)(`p`,{role:`status`,className:`py-3 text-center typography-micro text-muted-foreground`,children:i(`common.loading`)}):null,u.hasPreviousPage||u.hasMessageGap?(0,$.jsxs)(`div`,{className:`mb-3 flex flex-col items-center gap-1`,"data-assistant-contact-pagination":``,"aria-busy":u.isFetchingPreviousPage||u.isFillingMessageGap,children:[u.previousPageError?(0,$.jsx)(`p`,{role:`alert`,className:`typography-micro text-[var(--status-error)]`,children:i(`chat.history.loadOlderFailed`)}):null,u.hasMessageGap?(0,$.jsx)(`p`,{role:`status`,className:`typography-micro text-muted-foreground`,children:i(`assistants.contact.history.gap`)}):null,(0,$.jsx)(W,{type:`button`,size:`sm`,variant:`ghost`,disabled:u.isFetchingPreviousPage||u.isFillingMessageGap,onClick:()=>void Ie(),children:i(u.isFetchingPreviousPage||u.isFillingMessageGap?`chat.history.loadingMore`:u.previousPageError||u.hasMessageGap?`chat.history.retry`:`chat.history.loadOlder`)})]}):null,J.map((t,r)=>{let a=`${Y}:${Xn(t)}`,c=r>0?J[r-1]:null,u=be.get(t.messageID),d=u!==void 0,g=d?(0,$.jsx)(`div`,{className:`flex w-full justify-center px-4 pt-7 pb-4 first:pt-1`,"data-assistant-contact-time":``,children:(0,$.jsx)(`time`,{dateTime:new Date(u).toISOString(),className:`text-[11px] font-normal leading-4 tabular-nums text-muted-foreground/70`,children:ke(u)})}):null,_=t.role===`user`,v=t.role===`peer`,y=t.role===`assistant`&&!d&&c?.role===`assistant`&&c.turnID===t.turnID,b=c?.turnID!==t.turnID,x=!_&&(v||!y),S=v?h(t.fromAssistantID,t.fromAssistantName):p,C=v&&t.fromAssistantID?l.data?.assistants.find(e=>e.id===t.fromAssistantID):e,w=ct.get(t.messageID),T=Pe.get(t.turnID),E=t.status===`failed`&&t.messageID.endsWith(`:preview:failed`),D=(e,t)=>_?(0,$.jsx)(ht,{failedTurn:n?w:void 0,retryDisabled:Ae,onRetry:it,children:e},t):e;return t.status===`error`||E?(0,$.jsxs)(Q.Fragment,{children:[g,(0,$.jsxs)(`div`,{"data-message-id":t.messageID,"data-assistant-contact-error":``,className:H(`relative px-1`,!d&&`mt-3`),children:[(0,$.jsx)(`p`,{role:`alert`,className:`whitespace-pre-wrap text-center text-[11px] font-normal leading-4 text-muted-foreground [overflow-wrap:anywhere]`,children:t.text||T?.error||i(`assistants.contact.sendFailed`)}),f?.messageID===t.messageID?(0,$.jsx)(Xe,{assistantID:e.id,position:f},`${o}:${e.id}:${f.generation}:${f.ordinal}`):null]})]},a):(0,$.jsxs)(Q.Fragment,{children:[g,(0,$.jsxs)(Ke.div,{"data-message-id":t.messageID,initial:Ee&&r>Te&&t.messageID!==Ge.current?{opacity:0,y:4}:!1,animate:{opacity:1,y:0},transition:{duration:Se?0:.18,ease:`easeOut`},className:H(`flex w-full`,_?`justify-end`:`justify-start`,d?`mt-0`:b?`mt-6 first:mt-0`:y?`mt-1.5`:`mt-3`),"data-assistant-contact-role":t.role,"data-assistant-contact-turn-status":w?.status??t.status,"data-assistant-contact-run-start":t.role===`assistant`&&!y?``:void 0,children:[_?null:(0,$.jsx)(`div`,{className:`mr-2.5 flex w-9 shrink-0 justify-center pt-0.5`,children:x?(0,$.jsx)(Vt,{name:C?.id||t.fromAssistantID||e.id,avatarSeed:C?.avatarSeed??(t.fromAssistantID?void 0:e.avatarSeed),size:32,label:S,working:n?!!(C?.working||C?.activeContactTurn):void 0,showWorkingDot:!1,followPointer:!1}):(0,$.jsx)(`span`,{className:`size-8`,"aria-hidden":!0})}),(0,$.jsxs)(`div`,{className:H(`relative flex min-w-0 flex-col gap-1.5`,_?`max-w-[min(82%,30rem)] items-end`:`max-w-[min(84%,34rem)] items-start`),children:[v?(0,$.jsx)(`span`,{className:`mb-0.5 px-1 typography-micro text-muted-foreground/75`,children:i(`assistants.contact.peer.from`,{name:S})}):null,t.parts.map((r,o)=>{if(r.type===`card`&&r.cardType===`session`)return(0,$.jsx)(dn,{card:r},`${a}:card:${o}`);if(r.type===`card`&&r.cardType===`assistant`)return(0,$.jsx)(Zt,{card:r,assistant:l.data?.assistants.find(e=>e.id===r.assistantID),active:n},`${a}:card:${o}`);if(r.type===`card`&&r.cardType===`schedule`)return(0,$.jsx)(on,{card:r,task:fe.get(r.projectID)?.get(r.taskID)},`${a}:card:${o}`);if(r.type===`file`)return D((0,$.jsx)(pt,{assistantID:e.id,part:r,onShowPopup:L},`${a}:file:${o}`),`${a}:file:${o}`);if(r.type===`text`&&Jn(r.text))return null;if(r.type===`text`&&(r.text.trim()||t.status===`streaming`)){let e=!_,n=e&&/^!\[(?:\\.|[^\]\\\n])*\]\(\s*(?:<[^>\n]+>|[^\s()]+)(?:\s+"[^"\n]*")?\s*\)$/.test(r.text.trim());return D((0,$.jsx)(`div`,{"aria-label":v?i(`assistants.contact.peer.aria`,{name:S}):void 0,"data-assistant-contact-text":``,"data-assistant-contact-media":n||void 0,style:_?{backgroundColor:m.background,color:m.foreground}:void 0,className:H(`min-w-0 max-w-full [overflow-wrap:anywhere] rounded-[1.35rem] typography-markdown leading-6`,s&&!n&&`touch-manipulation [-webkit-user-select:all] [user-select:all]`,n?`p-0`:`px-4 py-2.5`,e?null:`whitespace-pre-wrap`,n?`text-foreground`:_?`rounded-[1.15rem] rounded-br-lg`:v?`rounded-[1.25rem] border border-dashed border-border/50 bg-[var(--surface-muted)]/70 text-foreground`:`bg-[var(--surface-muted)] text-foreground`),children:e?(0,$.jsx)(xe,{content:r.text,messageId:a,isAnimated:!1,isStreaming:t.status===`streaming`,variant:`assistant`,enableFileReferences:!1,onShowPopup:L,className:`w-full min-w-0 [overflow-wrap:anywhere]`}):r.text},`${a}:text:${o}`),`${a}:text:${o}`)}return null}),w?.status===`sending`?(0,$.jsx)(`p`,{className:`absolute right-1 top-full mt-1 typography-micro text-muted-foreground/75`,children:i(`assistants.contact.sending`)}):null,f?.messageID===t.messageID?(0,$.jsx)(Xe,{assistantID:e.id,position:f},`${o}:${e.id}:${f.generation}:${f.ordinal}`):null]})]})]},a)}),(0,$.jsx)(`div`,{className:`pointer-events-none absolute bottom-1 left-[2.875rem] flex h-10 items-center`,"data-assistant-contact-status-slot":``,children:!Ae&&Ye?.scope!==Y&&(je||X)?(0,$.jsxs)(Ke.div,{role:`status`,"aria-label":i(`assistants.contact.processing`),initial:!Se&&{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{duration:Se?0:.18,ease:`easeOut`},className:`relative inline-flex h-9 origin-bottom-left items-center gap-1 rounded-[1.35rem] bg-[var(--surface-muted)] px-4 text-muted-foreground/70`,"data-assistant-contact-processing":``,children:[(0,$.jsx)(`div`,{className:`absolute -left-[2.875rem] top-0.5 flex w-9 justify-center`,"data-assistant-contact-processing-avatar":``,children:(0,$.jsx)(Vt,{name:e.id,avatarSeed:e.avatarSeed,size:32,label:p,working:n?X:void 0,showWorkingDot:!1,followPointer:!1})}),(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 animate-pulse rounded-full bg-current [animation-delay:-0.45s] [animation-duration:1.4s] motion-reduce:animate-none`}),(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 animate-pulse rounded-full bg-current [animation-delay:-0.22s] [animation-duration:1.4s] motion-reduce:animate-none`}),(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 animate-pulse rounded-full bg-current [animation-duration:1.4s] motion-reduce:animate-none`})]}):null})]})]}),(0,$.jsxs)(`footer`,{ref:Ue,className:`relative z-10 shrink-0 bg-background pt-1`,"data-assistant-contact-composer":``,children:[A?(0,$.jsx)(`div`,{className:`chat-input-column mb-2`,children:(0,$.jsx)(`p`,{role:`alert`,className:`typography-micro text-[var(--status-error)]`,children:A})}):null,(0,$.jsx)(`form`,{className:H(`relative w-full pt-1.5 pb-4`,s&&`bottom-safe-area yuri-mobile-composer`),onSubmit:e=>{e.preventDefault(),rt()},onDragOver:tt,onDrop:nt,children:(0,$.jsx)(`div`,{className:`chat-input-column relative overflow-visible`,children:(0,$.jsx)(st,{active:n,layout:`inline`,value:g,attachments:v,pending:Ae,isMobile:s,placeholder:i(`assistants.contact.placeholder`,{name:p}),sendLabel:i(`assistants.contact.send`),addFilesLabel:i(`assistants.contact.addFiles`),removeAttachmentLabel:i(`assistants.contact.removeAttachment`),fileAccept:`*/*`,onChange:e=>_(e),onVoiceSend:e=>{rt(e)},onSubmit:()=>{rt()},onAddFiles:e=>{$e(e)},onRemoveAttachment:t=>{Ae||(x.current.delete(`${e.id}:${t}`),y(e=>e.filter(e=>e.id!==t)))},onPaste:et,onDragOver:tt,onDrop:nt,className:H(`relative z-10`,s&&`yuri-mobile-composer-surface`),style:{borderRadius:`1.5rem`},"data-assistant-contact-composer-surface":``,textareaProps:{"aria-label":i(`assistants.contact.placeholder`,{name:p})}},`${o}:${e.id}`)})})]}),ee.open?(0,$.jsx)(Q.Suspense,{fallback:null,children:(0,$.jsx)(qn,{popup:ee,onOpenChange:z,isMobile:s})}):null]})},Qn=e=>{for(let t=e.messages.length-1;t>=0;t--){let n=e.messages[t];if(n.parts.some(N)&&Number.isFinite(new Date(n.createdAt).getTime()))return{timestamp:n.createdAt,empty:!1}}return{timestamp:void 0,empty:e.generation>=0&&e.olderComplete&&!e.hasMessageGap}},$n=(e,t)=>{let n=(0,Z.c)(5),r;n[0]!==e||n[1]!==t?(r=L(e,t),n[0]=e,n[1]=t,n[2]=r):r=n[2];let i;return n[3]===r?i=n[4]:(i={...r,enabled:!1,select:Qn},n[3]=r,n[4]=i),T(i)},er=Q.memo(e=>{let t=(0,Z.c)(17),{assistantID:n,serverWorking:r,lastContactAt:i}=e,{t:a,locale:o}=te(),s=Bt(n,r),c=$n(n,Ve()),l;t[0]!==c||t[1]!==i?(l=i!==void 0&&Number.isFinite(new Date(i).getTime())?i:c.data?.timestamp,t[0]=c,t[1]=i,t[2]=l):l=t[2];let u=l,d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=new Date().toDateString(),t[3]=d):d=t[3];let f=d,p;t[4]===a?p=t[5]:(p=a(`common.date.today`),t[4]=a,t[5]=p);let m=p,h;bb0:{if(u===void 0){h=null;break bb0}let e;t[6]!==o||t[7]!==u||t[8]!==m?(e=hn(o,m,new Date(f))(u),t[6]=o,t[7]=u,t[8]=m,t[9]=e):e=t[9],h=e}let g=h,_;t[10]!==c||t[11]!==g||t[12]!==a||t[13]!==s?(_=s?a(`assistants.conversation.typing`):g?a(`assistants.conversation.lastContact`,{time:g}):c.data?.empty?a(`assistants.conversation.neverContacted`):c.isError?a(`assistants.contact.loadFailed`):a(`common.loading`),t[10]=c,t[11]=g,t[12]=a,t[13]=s,t[14]=_):_=t[14];let v=_,y;return t[15]===v?y=t[16]:(y=(0,$.jsx)(`span`,{className:`mt-1 block truncate typography-micro font-normal leading-4 text-muted-foreground/70`,"aria-live":`polite`,title:v,children:v}),t[15]=v,t[16]=y),y});export{Bt as a,Vt as i,Zn as n,Ut as r,er as t};
@@ -0,0 +1 @@
1
+ import{ot as e}from"./vendor-base-ui-CzHs0bHY.js";import{n as t}from"./vendor-react-DlzBev0S.js";import{t as n}from"./i18n-BU14awhU.js";import{y as r}from"./MobileDetailNavigation-EEjgCwp2.js";import{Jn as i}from"./useMobileNavigationStore-C90n-pQY.js";function a(e){return[...e].sort((e,t)=>{let n=e.latestMessagePreview?.createdAt??-1/0,r=t.latestMessagePreview?.createdAt??-1/0;return n===r?0:r-n})}function o(e){let t;for(let n of e)n.pinnedAt!=null&&(!t||n.pinnedAt>t.pinnedAt)&&(t=n);return{pinned:t?[t]:[],unpinned:a(e.filter(e=>e!==t))}}var s=t(),c=e();function l(e){let t=(0,s.c)(10),{count:r,className:a}=e,{t:o}=n();if(!(r>0))return null;let l;t[0]===a?l=t[1]:(l=i(`inline-flex h-[18px] min-w-[18px] shrink-0 items-center justify-center rounded-full bg-[var(--assistant-unread-fill)] px-1.5 typography-micro font-semibold leading-none text-[var(--assistant-unread-foreground)] tabular-nums`,a),t[0]=a,t[1]=l);let u;t[2]!==r||t[3]!==o?(u=o(`assistants.unread.label`,{count:r}),t[2]=r,t[3]=o,t[4]=u):u=t[4];let d=r>99?`99+`:r,f;return t[5]!==r||t[6]!==l||t[7]!==u||t[8]!==d?(f=(0,c.jsx)(`span`,{className:l,"aria-label":u,"data-assistant-unread-count":r,children:d}),t[5]=r,t[6]=l,t[7]=u,t[8]=d,t[9]=f):f=t[9],f}function u(e){let t=(0,s.c)(3),{className:n}=e,i=r(),a;return t[0]!==n||t[1]!==i?(a=(0,c.jsx)(l,{count:i,className:n}),t[0]=n,t[1]=i,t[2]=a):a=t[2],a}export{a as i,l as n,o as r,u as t};
@@ -0,0 +1 @@
1
+ import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{c as n,w as r}from"./runtime-auth-mjIpsk3N.js";import{c as i,i as a,t as o}from"./runtime-switch-BMjl5Y5W.js";import{S as s,a as c}from"./platform-DMsFWy1a.js";import{ot as l,st as u}from"./vendor-base-ui-CzHs0bHY.js";import{r as d}from"./useUIStore-BF882_0b.js";import{n as f}from"./vendor-react-DlzBev0S.js";import{n as p}from"./vendor-tanstack-react-query-B-Wpqq5J.js";import{r as m}from"./vendor-sonner-BEHGipm5.js";import{r as h}from"./vendor-reactuses-core-CuTmqEMK.js";import{t as g}from"./i18n-BU14awhU.js";import{a as _,h as v,l as y,m as b,s as x,t as S,v as C}from"./MobileDetailNavigation-EEjgCwp2.js";import{Jn as w,Kn as T}from"./useMobileNavigationStore-C90n-pQY.js";import{i as E,r as D}from"./useAssistantUIStore-Du8puXWz.js";import{a as O}from"./MobileShareBridge-Dswz4WUo.js";import{n as k}from"./Icon-AqWbQ-aO.js";import{a as A,i as j,n as M,o as N,r as P,t as F}from"./dialog-pjai4m5O.js";import{r as ee}from"./device-DNG0cNwQ.js";import{E as te}from"./sessionLookup-CEo8HV6T.js";import{a as ne,i as re,n as ie,t as ae}from"./AssistantContactStatus-_0PxmEHN.js";import{n as I,r as oe}from"./AssistantUnreadBadge-O-9phsEJ.js";import{a as L,i as se,n as ce,r as R,t as z}from"./context-menu-Dfu9gzKB.js";var B=t(u(),1),V=f(),le=()=>c()&&!r(),ue=async e=>{if(!le())throw Error(`Assistant Mini Chat requires a direct desktop connection`);await s(`desktop_open_assistant_mini_chat_window`,{assistantID:e,apiBaseUrl:o(),clientToken:n()})},H=l();function U(e){let t=(0,V.c)(49),{assistant:n,trigger:r,onEdit:i,onDelete:o,doubleClickMiniChat:s}=e,c=s!==void 0&&s,{t:l}=g(),u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=a(),t[0]=u):u=t[0];let d;t[1]===n.id?d=t[2]:(d=[u,`assistants`,n.id,`pin`],t[1]=n.id,t[2]=d);let f;t[3]===n?f=t[4]:(f=()=>b(n,{pinned:n.pinnedAt==null}),t[3]=n,t[4]=f);let h;t[5]===l?h=t[6]:(h=()=>m.error(l(`assistants.menu.pinError`)),t[5]=l,t[6]=h);let _;t[7]!==d||t[8]!==f||t[9]!==h?(_={mutationKey:d,mutationFn:f,onError:h},t[7]=d,t[8]=f,t[9]=h,t[10]=_):_=t[10];let v=p(_),y;t[11]!==n.id||t[12]!==l?(y=()=>{ue(n.id).catch(()=>m.error(l(`miniChat.actions.failed`)))},t[11]=n.id,t[12]=l,t[13]=y):y=t[13];let x=y,S=r,C;t[14]!==S||t[15]!==c||t[16]!==x||t[17]!==r?(C=c?B.cloneElement(S,{onDoubleClick:e=>{S.props.onDoubleClick?.(e),!e.defaultPrevented&&le()&&x()}}):r,t[14]=S,t[15]=c,t[16]=x,t[17]=r,t[18]=C):C=t[18];let w;t[19]===C?w=t[20]:(w=(0,H.jsx)(L,{render:C}),t[19]=C,t[20]=w);let T;t[21]!==n.pinnedAt||t[22]!==v||t[23]!==l?(T=n.pinnedAt===void 0?null:(0,H.jsxs)(R,{disabled:v.isPending,onClick:()=>v.mutate(),children:[(0,H.jsx)(k,{name:n.pinnedAt==null?`pushpin-2`:`unpin`,className:`size-4`}),l(n.pinnedAt==null?`assistants.menu.pin`:`assistants.menu.unpin`)]}),t[21]=n.pinnedAt,t[22]=v,t[23]=l,t[24]=T):T=t[24];let E;t[25]!==x||t[26]!==l?(E=le()?(0,H.jsxs)(R,{onClick:x,children:[(0,H.jsx)(k,{name:`external-link`,className:`size-4`}),l(`sessions.sidebar.session.menu.openMiniChatWindow`)]}):null,t[25]=x,t[26]=l,t[27]=E):E=t[27];let D;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,H.jsx)(k,{name:`edit`,className:`size-4`}),t[28]=D):D=t[28];let O;t[29]===l?O=t[30]:(O=l(`assistants.menu.edit`),t[29]=l,t[30]=O);let A;t[31]!==i||t[32]!==O?(A=(0,H.jsxs)(R,{onClick:i,children:[D,O]}),t[31]=i,t[32]=O,t[33]=A):A=t[33];let j;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,H.jsx)(se,{}),t[34]=j):j=t[34];let M;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,H.jsx)(k,{name:`delete-bin`,className:`size-4 text-inherit`}),t[35]=M):M=t[35];let N;t[36]===l?N=t[37]:(N=l(`assistants.settings.delete`),t[36]=l,t[37]=N);let P;t[38]!==o||t[39]!==N?(P=(0,H.jsxs)(R,{onClick:o,className:`text-[var(--status-error)] focus:text-[var(--status-error)] data-[highlighted]:text-[var(--status-error)]`,children:[M,N]}),t[38]=o,t[39]=N,t[40]=P):P=t[40];let F;t[41]!==T||t[42]!==E||t[43]!==A||t[44]!==P?(F=(0,H.jsxs)(ce,{className:`min-w-[10rem]`,children:[T,E,A,j,P]}),t[41]=T,t[42]=E,t[43]=A,t[44]=P,t[45]=F):F=t[45];let ee;return t[46]!==F||t[47]!==w?(ee=(0,H.jsxs)(z,{children:[w,F]}),t[46]=F,t[47]=w,t[48]=ee):ee=t[48],ee}function de(e){let t=(0,V.c)(38),{assistant:n,selected:r,onSelect:i,onEdit:a,onDelete:o}=e,s=B.useRef(null),c=ne(n.id,n.working),l;t[0]===n.name?l=t[1]:(l=O(n.name).displayName||n.name,t[0]=n.name,t[1]=l);let u=l,d;t[2]!==n.id||t[3]!==a?(d=()=>a(n.id),t[2]=n.id,t[3]=a,t[4]=d):d=t[4];let f;t[5]!==n||t[6]!==o?(f=()=>o(n),t[5]=n,t[6]=o,t[7]=f):f=t[7];let p=n.id,m;t[8]!==n.id||t[9]!==i?(m=()=>i(n.id),t[8]=n.id,t[9]=i,t[10]=m):m=t[10];let h=r?`bg-[var(--surface-muted)]`:`hover:bg-interactive-hover`,g;t[11]===h?g=t[12]:(g=w(`flex w-full min-w-0 max-w-28 flex-col items-center gap-2 rounded-2xl px-2 py-3 text-center outline-none transition-colors focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)] active:bg-interactive-active motion-reduce:transition-none`,h),t[11]=h,t[12]=g);let _;t[13]!==n.avatarSeed||t[14]!==n.id||t[15]!==u||t[16]!==c?(_=(0,H.jsx)(re,{name:n.id,avatarSeed:n.avatarSeed,size:64,label:u,working:c,hoverTarget:s}),t[13]=n.avatarSeed,t[14]=n.id,t[15]=u,t[16]=c,t[17]=_):_=t[17];let v=n.unreadCount??0,y;t[18]===v?y=t[19]:(y=(0,H.jsx)(I,{count:v,className:`absolute -right-1 -top-1`}),t[18]=v,t[19]=y);let b;t[20]!==y||t[21]!==_?(b=(0,H.jsxs)(`span`,{className:`relative`,children:[_,y]}),t[20]=y,t[21]=_,t[22]=b):b=t[22];let x;t[23]===u?x=t[24]:(x=(0,H.jsx)(`span`,{className:`w-full truncate typography-ui-label font-medium leading-5`,children:u}),t[23]=u,t[24]=x);let S;t[25]!==n.id||t[26]!==u||t[27]!==r||t[28]!==b||t[29]!==x||t[30]!==m||t[31]!==g?(S=(0,H.jsxs)(`button`,{ref:s,type:`button`,role:`option`,"aria-selected":r,title:u,"data-assistant-pinned":p,"data-mobile-press-feedback":`soft`,onClick:m,className:g,children:[b,x]}),t[25]=n.id,t[26]=u,t[27]=r,t[28]=b,t[29]=x,t[30]=m,t[31]=g,t[32]=S):S=t[32];let C;return t[33]!==n||t[34]!==S||t[35]!==d||t[36]!==f?(C=(0,H.jsx)(U,{assistant:n,doubleClickMiniChat:!0,onEdit:d,onDelete:f,trigger:S}),t[33]=n,t[34]=S,t[35]=d,t[36]=f,t[37]=C):C=t[37],C}function fe(e){let t=(0,V.c)(16),{contacts:n,selectedAssistantID:r,onSelect:i,onEdit:a,onDelete:o}=e,{t:s}=g();if(n.length===0)return null;let c;t[0]===s?c=t[1]:(c=s(`assistants.list.pinned`),t[0]=s,t[1]=c);let l;if(t[2]!==n||t[3]!==o||t[4]!==a||t[5]!==i||t[6]!==r){let e;t[8]!==o||t[9]!==a||t[10]!==i||t[11]!==r?(e=e=>(0,H.jsx)(de,{assistant:e,selected:e.id===r,onSelect:i,onEdit:a,onDelete:o},e.id),t[8]=o,t[9]=a,t[10]=i,t[11]=r,t[12]=e):e=t[12],l=n.map(e),t[2]=n,t[3]=o,t[4]=a,t[5]=i,t[6]=r,t[7]=l}else l=t[7];let u;return t[13]!==c||t[14]!==l?(u=(0,H.jsx)(`div`,{role:`group`,"aria-label":c,className:`yuri-assistant-pinned-contacts grid grid-cols-1 justify-items-center gap-2 pb-3 pt-2`,children:l}),t[13]=c,t[14]=l,t[15]=u):u=t[15],u}function pe({snapshot:e,rowClassName:t,compact:n=!1,mobile:r=!1}){let{t:i}=g(),[a,o]=B.useState(!1),s=B.useRef(!1),c=h(async()=>{if(!s.current){s.current=!0,o(!0);try{(await y(e)).failed&&m.error(i(`assistants.unread.markAllFailed`))}catch{m.error(i(`assistants.unread.markAllFailed`))}finally{s.current=!1,o(!1)}}}),l=e.assistants.some(e=>(e.unreadCount??0)>0);return!n&&!l?null:(0,H.jsx)(`div`,{className:t,style:n&&!l?{visibility:`hidden`}:void 0,children:(0,H.jsx)(T,{type:`button`,variant:r?`mobileGlass`:`ghost`,size:r?`mobileIcon`:`icon`,onClick:c,"aria-label":i(`assistants.unread.markAll`),title:i(`assistants.unread.markAll`),disabled:a||!e.assistants.some(e=>(e.unreadCount??0)>0&&e.readTip),"aria-busy":a,children:(0,H.jsx)(k,{name:`check-double`,className:r?`size-5`:`size-4`})})})}async function me(e){await _(e);let t=E.getState().defaultShareAssistant;if(t?.assistantID!==e.id)return;let n=await x();n.serverInstanceID&&t.serverInstanceID===n.serverInstanceID&&E.getState().setDefaultShareAssistant(null)}function he({assistant:e,open:t,onOpenChange:n,onDeleted:r}){let{t:i}=g(),[a,o]=B.useState(!1),s=e?O(e.name).displayName||e.name:``,c=h(e=>{a&&!e||n(e)}),l=h(()=>{a||n(!1)}),u=h(async()=>{if(!(!e||a)){o(!0);try{await me(e),r?.(e.id),n(!1),m.success(i(`assistants.settings.toast.deleted`))}catch{m.error(i(`assistants.settings.toast.deleteFailed`))}finally{o(!1)}}});return(0,H.jsx)(F,{open:t&&e!==null,onOpenChange:c,children:(0,H.jsxs)(M,{className:`max-w-md`,children:[(0,H.jsxs)(A,{children:[(0,H.jsx)(N,{children:i(`assistants.settings.delete`)}),(0,H.jsx)(P,{children:i(`assistants.settings.deleteConfirm`,{name:s})})]}),(0,H.jsxs)(j,{children:[(0,H.jsx)(T,{size:`sm`,variant:`ghost`,onClick:l,disabled:a,children:i(`settings.common.actions.cancel`)}),(0,H.jsx)(T,{size:`sm`,variant:`destructive`,onClick:u,disabled:a,children:i(`settings.common.actions.delete`)})]})]})})}var W=`block min-w-0 max-w-full truncate typography-micro text-muted-foreground`,ge={image:`assistants.contact.attachment.image`,file:`assistants.contact.attachment.file`,session:`assistants.contact.card.session.untitled`,assistant:`assistants.title`,schedule:`assistants.settings.scheduledTasks.title`};function _e(e,t){return e?.text.replace(/\s+/gu,` `).trim()||t(e?.fallbackKind?ge[e.fallbackKind]:`assistants.contact.empty`)}var ve=e=>e.capabilityPending?`loading`:e.capabilityError||e.supported!==!0||e.capabilityEnabled!==!0?`unavailable`:e.snapshotPending?`loading`:e.snapshotEnabled===!0?e.assistantCount===0?`onboarding`:e.hasAssistant?`ready`:e.snapshotSettled?`unavailable`:`loading`:`unavailable`,ye=e({AssistantView:()=>G}),be=e=>{let t=(0,V.c)(21),{assistant:n,onBack:r,onOpenSettings:i}=e,{t:a}=g(),o=te(),s;t[0]===n?s=t[1]:(s=n?O(n.name):null,t[0]=n,t[1]=s);let c=s,l=n&&c?c.displayName||n.name:``,u;t[2]!==n||t[3]!==o||t[4]!==i?(u=()=>{if(n){if(i){i(n.id);return}D(n.id,o?{openMobileSettings:o.openSettings}:void 0)}},t[2]=n,t[3]=o,t[4]=i,t[5]=u):u=t[5];let d=h(u),f;t[6]!==n||t[7]!==l||t[8]!==a?(f=n?(0,H.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-2.5`,children:[(0,H.jsx)(re,{name:n.id,avatarSeed:n.avatarSeed,size:40,label:l,working:!!(n.working||n.activeContactTurn),showWorkingDot:!1}),(0,H.jsxs)(`span`,{className:`min-w-0`,children:[(0,H.jsx)(`span`,{className:`block truncate font-medium leading-5 tracking-[-0.01em]`,children:l||a(`assistants.title`)}),(0,H.jsx)(ae,{assistantID:n.id,serverWorking:!!(n.working||n.activeContactTurn),lastContactAt:n.latestMessagePreview?.createdAt})]})]}):l||a(`assistants.title`),t[6]=n,t[7]=l,t[8]=a,t[9]=f):f=t[9];let p;t[10]===a?p=t[11]:(p=a(`assistants.actions.backToChat`),t[10]=a,t[11]=p);let m;t[12]!==n||t[13]!==d||t[14]!==a?(m=n?[{icon:`settings-3`,ariaLabel:a(`assistants.conversation.openSettings`),onClick:d}]:[],t[12]=n,t[13]=d,t[14]=a,t[15]=m):m=t[15];let _;return t[16]!==r||t[17]!==f||t[18]!==p||t[19]!==m?(_=(0,H.jsx)(S,{title:f,backAriaLabel:p,onBack:r,actions:m,overlay:!0}),t[16]=r,t[17]=f,t[18]=p,t[19]=m,t[20]=_):_=t[20],_},xe=e=>{let t=(0,V.c)(34),{assistant:n,avatarSeed:r,unreadCount:i,summary:a,assistantID:o,displayName:s,selected:c,onSelect:l,onEdit:u,onDelete:d,serverWorking:f}=e,p=ne(o,f!==void 0&&f),m=B.useRef(null),g;t[0]===l?g=t[1]:(g=()=>l(),t[0]=l,t[1]=g);let _=h(g),v=c?`border-border/50 bg-[var(--surface-elevated)]`:`border-transparent hover:bg-interactive-hover`,y;t[2]===v?y=t[3]:(y=w(`flex w-full min-h-11 items-center gap-3 rounded-xl border px-3 py-3 text-left outline-none transition-[background-color,border-color,opacity] duration-150 ease-out active:bg-interactive-active focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)] motion-reduce:transition-none`,v),t[2]=v,t[3]=y);let b;t[4]!==o||t[5]!==r||t[6]!==s||t[7]!==p?(b=(0,H.jsx)(re,{name:o,avatarSeed:r,size:44,label:s,working:p,hoverTarget:m}),t[4]=o,t[5]=r,t[6]=s,t[7]=p,t[8]=b):b=t[8];let x=c?`font-semibold`:`font-medium`,S;t[9]===x?S=t[10]:(S=w(`block truncate typography-ui-label leading-5`,x),t[9]=x,t[10]=S);let C;t[11]!==s||t[12]!==S?(C=(0,H.jsx)(`span`,{className:S,children:s}),t[11]=s,t[12]=S,t[13]=C):C=t[13];let T;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(T=w(W,`mt-1 text-[length:calc(var(--text-micro)*0.9)] leading-5`),t[14]=T):T=t[14];let E;t[15]===a?E=t[16]:(E=(0,H.jsx)(`span`,{className:T,children:a}),t[15]=a,t[16]=E);let D;t[17]!==E||t[18]!==C?(D=(0,H.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[C,E]}),t[17]=E,t[18]=C,t[19]=D):D=t[19];let O;t[20]===i?O=t[21]:(O=(0,H.jsx)(I,{count:i,className:`h-3.5 min-w-3.5 px-1 text-[10px]`}),t[20]=i,t[21]=O);let k;t[22]!==_||t[23]!==c||t[24]!==D||t[25]!==O||t[26]!==y||t[27]!==b?(k=(0,H.jsxs)(`button`,{ref:m,type:`button`,role:`option`,"aria-selected":c,onClick:_,className:y,children:[b,D,O]}),t[22]=_,t[23]=c,t[24]=D,t[25]=O,t[26]=y,t[27]=b,t[28]=k):k=t[28];let A;return t[29]!==n||t[30]!==d||t[31]!==u||t[32]!==k?(A=(0,H.jsx)(U,{assistant:n,doubleClickMiniChat:!0,onEdit:u,onDelete:d,trigger:k}),t[29]=n,t[30]=d,t[31]=u,t[32]=k,t[33]=A):A=t[33],A},G=e=>{let t=(0,V.c)(117),{activeOverride:n,onMobileBack:r,onMobileOpenSettings:o}=e,{t:s}=g(),{isMobile:c}=ee(),l=te(),u=B.useSyncExternalStore(i,a,a),f=d(Se),p=n??f,_=d(Ce),y=c||_,b=v(),x=C(),S=x.data;S?.assistants;let A;t[0]===S?.assistants?A=t[1]:(A=S?.assistants??[],t[0]=S?.assistants,t[1]=A);let j;t[2]===A?j=t[3]:(j=oe(A),t[2]=A,t[3]=j);let M=j,N;t[4]===u?N=t[5]:(N=e=>e.assistantByTransport[u]??null,t[4]=u,t[5]=N);let P=E(N),F=E(we),ne=E(Te),I;t[6]!==P||t[7]!==S?.assistants?(I=S?.assistants.find(e=>e.id===P)??null,t[6]=P,t[7]=S?.assistants,t[8]=I):I=t[8];let L=I,se;t[9]!==F||t[10]!==P||t[11]!==S?(se=()=>{!P&&S?.assistants[0]&&F(S.assistants[0].id)},t[9]=F,t[10]=P,t[11]=S,t[12]=se):se=t[12];let ce=S?.assistants,R;t[13]!==F||t[14]!==P||t[15]!==ce?(R=[F,P,ce],t[13]=F,t[14]=P,t[15]=ce,t[16]=R):R=t[16],B.useEffect(se,R);let z;t[17]!==L||t[18]!==F||t[19]!==P||t[20]!==S?.assistants||t[21]!==x.isSuccess?(z=()=>{x.isSuccess&&P&&!L&&F(S?.assistants[0]?.id??null)},t[17]=L,t[18]=F,t[19]=P,t[20]=S?.assistants,t[21]=x.isSuccess,t[22]=z):z=t[22];let U=S?.assistants,de;t[23]!==L||t[24]!==F||t[25]!==P||t[26]!==x.isSuccess||t[27]!==U?(de=[L,F,P,U,x.isSuccess],t[23]=L,t[24]=F,t[25]=P,t[26]=x.isSuccess,t[27]=U,t[28]=de):de=t[28],B.useEffect(z,de);let me;t[29]!==l||t[30]!==ne?(me=()=>{if(ne(),l){l.openSettings();return}let e=d.getState();e.setSettingsPage(`assistants`),e.setSettingsDialogOpen(!0)},t[29]=l,t[30]=ne,t[31]=me):me=t[31];let W=h(me),ge;t[32]===l?ge=t[33]:(ge=e=>{D(e,l?{openMobileSettings:l.openSettings}:void 0)},t[32]=l,t[33]=ge);let ye=h(ge),G;t[34]!==L||t[35]!==l?(G=()=>{L&&D(L.id,l?{openMobileSettings:l.openSettings}:void 0)},t[34]=L,t[35]=l,t[36]=G):G=t[36];let De=h(G),[Oe,ke]=B.useState(null),Ae;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=e=>{ke(e)},t[37]=Ae):Ae=t[37];let je=h(Ae),Me;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(Me=e=>{e||ke(null)},t[38]=Me):Me=t[38];let Ne=h(Me),Pe=h(Ee),Fe;t[39]!==r||t[40]!==Pe?(Fe=()=>{if(r){r();return}Pe()},t[39]=r,t[40]=Pe,t[41]=Fe):Fe=t[41];let K=h(Fe),Ie=ve({capabilityPending:b.isPending,snapshotPending:x.isPending,capabilityError:b.isError,supported:b.data?.supported,capabilityEnabled:b.data?.enabled,snapshotEnabled:S?.enabled,snapshotSettled:x.isSuccess,assistantCount:S?.assistants.length??0,hasAssistant:!!L}),Le;t[42]!==L||t[43]!==K||t[44]!==y||t[45]!==o?(Le=(e,t,n,r)=>(0,H.jsxs)(`div`,{className:`relative flex h-full min-h-0 flex-col`,children:[y?(0,H.jsx)(be,{assistant:L,onBack:K,onOpenSettings:o}):null,(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center px-6 pt-[calc(max(0.25rem,var(--yuri-safe-area-top,0px))+var(--yuri-mobile-detail-navigation-height,3.5rem))] text-center`,children:[(0,H.jsx)(k,{name:e,className:`size-6 text-muted-foreground`}),(0,H.jsx)(`h1`,{className:`mt-4 typography-ui-header font-semibold`,children:t}),n?(0,H.jsx)(`p`,{className:`mt-2 max-w-md typography-ui text-muted-foreground`,children:n}):null,r?(0,H.jsx)(`div`,{className:`mt-5`,children:r}):null]})]}),t[42]=L,t[43]=K,t[44]=y,t[45]=o,t[46]=Le):Le=t[46];let q=Le;if(Ie===`loading`){let e;t[47]!==L||t[48]!==K||t[49]!==y||t[50]!==o?(e=y?(0,H.jsx)(be,{assistant:L,onBack:K,onOpenSettings:o}):null,t[47]=L,t[48]=K,t[49]=y,t[50]=o,t[51]=e):e=t[51];let n;t[52]===s?n=t[53]:(n=s(`common.loading`),t[52]=s,t[53]=n);let r;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,H.jsx)(k,{name:`loader-4`,className:`size-6 animate-spin text-muted-foreground`}),t[54]=r):r=t[54];let i;t[55]===n?i=t[56]:(i=(0,H.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center px-6 pt-[calc(max(0.25rem,var(--yuri-safe-area-top,0px))+var(--yuri-mobile-detail-navigation-height,3.5rem))] text-center`,"aria-busy":`true`,"aria-label":n,"data-assistant-workspace-loading":``,children:r}),t[55]=n,t[56]=i);let a;return t[57]!==e||t[58]!==i?(a=(0,H.jsxs)(`div`,{className:`relative flex h-full min-h-0 flex-col`,children:[e,i]}),t[57]=e,t[58]=i,t[59]=a):a=t[59],a}if(Ie===`unavailable`){let e;return t[60]!==q||t[61]!==s?(e=q(`cloud-off`,s(`assistants.state.unavailable`)),t[60]=q,t[61]=s,t[62]=e):e=t[62],e}if(Ie===`onboarding`){let e;if(t[63]!==W||t[64]!==q||t[65]!==s){let n=s(`assistants.onboarding.title`),r=s(`assistants.onboarding.description`),i;t[67]===s?i=t[68]:(i=s(`assistants.onboarding.action`),t[67]=s,t[68]=i);let a;t[69]!==W||t[70]!==i?(a=(0,H.jsx)(T,{onClick:W,children:i}),t[69]=W,t[70]=i,t[71]=a):a=t[71],e=q(`ai-agent`,n,r,a),t[63]=W,t[64]=q,t[65]=s,t[66]=e}else e=t[66];return e}if(!S||!L){let e;return t[72]!==q||t[73]!==s?(e=q(`cloud-off`,s(`assistants.state.unavailable`)),t[72]=q,t[73]=s,t[74]=e):e=t[74],e}let Re;t[75]===L.name?Re=t[76]:(Re=O(L.name),t[75]=L.name,t[76]=Re);let ze=Re,Be;t[77]!==x.isError||t[78]!==s?(Be=x.isError?s(`assistants.state.staleSnapshot`):null,t[77]=x.isError,t[78]=s,t[79]=Be):Be=t[79];let Ve=Be,J;t[80]!==M||t[81]!==y||t[82]!==W||t[83]!==ye||t[84]!==je||t[85]!==F||t[86]!==P||t[87]!==S||t[88]!==s?(J=y?null:(0,H.jsxs)(`section`,{className:`flex h-full min-h-0 w-[clamp(16rem,22vw,20rem)] shrink-0 flex-col overflow-hidden`,children:[(0,H.jsxs)(`header`,{className:`flex shrink-0 items-center gap-3 px-4 pb-1 pt-4 sm:px-5`,children:[(0,H.jsx)(`h1`,{className:`min-w-0 truncate typography-ui-label font-semibold text-foreground`,children:s(`assistants.title`)}),(0,H.jsx)(pe,{snapshot:S,compact:!0,rowClassName:`flex min-w-0 flex-1 justify-end`}),(0,H.jsx)(T,{type:`button`,variant:`mobileGlass`,size:`mobileIcon`,className:`size-8 min-h-0 min-w-0 !shadow-[0_0_0_0.5px_rgb(0_0_0/0.08),0_1px_2px_rgb(0_0_0/0.05)] dark:!shadow-[var(--yuri-mobile-glass-shadow)]`,"aria-label":s(`assistants.settings.create`),onClick:W,children:(0,H.jsx)(k,{name:`add`,className:`size-4`})})]}),(0,H.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-3 pb-4 sm:px-4`,role:`listbox`,"aria-label":s(`assistants.listAria`),children:[(0,H.jsx)(fe,{contacts:M.pinned,selectedAssistantID:P,onSelect:F,onEdit:ye,onDelete:je}),(0,H.jsx)(`div`,{className:`flex flex-col gap-1 pt-1`,children:M.unpinned.map(e=>{let t=e.id===P,n=O(e.name);return(0,H.jsx)(xe,{assistant:e,assistantID:e.id,avatarSeed:e.avatarSeed,unreadCount:e.unreadCount??0,summary:_e(e.latestMessagePreview,s),displayName:n.displayName,selected:t,assignedSessionIDs:e.assignedSessionIDs,serverWorking:e.working,onSelect:()=>F(e.id),onEdit:()=>ye(e.id),onDelete:()=>je(e)},e.id)})})]})]}),t[80]=M,t[81]=y,t[82]=W,t[83]=ye,t[84]=je,t[85]=F,t[86]=P,t[87]=S,t[88]=s,t[89]=J):J=t[89];let He=Oe!==null,Y;t[90]!==Oe||t[91]!==Ne||t[92]!==He?(Y=(0,H.jsx)(he,{assistant:Oe,open:He,onOpenChange:Ne}),t[90]=Oe,t[91]=Ne,t[92]=He,t[93]=Y):Y=t[93];let Ue=!y&&`border-l border-[var(--surface-subtle)]`,X;t[94]===Ue?X=t[95]:(X=w(`relative flex min-h-0 min-w-0 flex-1 flex-col overflow-clip bg-background`,Ue),t[94]=Ue,t[95]=X);let Z;t[96]!==L||t[97]!==K||t[98]!==y||t[99]!==o||t[100]!==De||t[101]!==ze||t[102]!==s?(Z=y?(0,H.jsx)(be,{assistant:L,onBack:K,onOpenSettings:o}):(0,H.jsxs)(`header`,{className:`flex h-16 shrink-0 items-center gap-3.5 border-b border-[var(--surface-subtle)]/70 px-5 sm:px-7`,children:[(0,H.jsx)(re,{name:L.id,avatarSeed:L.avatarSeed,size:40,label:ze.displayName||L.name,working:!!(L.working||L.activeContactTurn),showWorkingDot:!1}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(`div`,{className:`truncate typography-ui-label font-semibold leading-5 tracking-[-0.01em] text-foreground`,children:ze.displayName}),(0,H.jsx)(ae,{assistantID:L.id,serverWorking:!!(L.working||L.activeContactTurn),lastContactAt:L.latestMessagePreview?.createdAt})]}),le()?(0,H.jsx)(T,{type:`button`,variant:`ghost`,size:`icon`,className:`text-muted-foreground/65`,onClick:()=>{ue(L.id).catch(()=>m.error(s(`miniChat.actions.failed`)))},"aria-label":s(`sessions.sidebar.session.menu.openMiniChatWindow`),title:s(`sessions.sidebar.session.menu.openMiniChatWindow`),children:(0,H.jsx)(k,{name:`external-link`,className:`size-4`})}):null,(0,H.jsx)(T,{type:`button`,variant:`ghost`,size:`icon`,className:`size-8 shrink-0 rounded-full text-muted-foreground/65 transition-colors hover:text-foreground`,onClick:De,"aria-label":s(`assistants.conversation.openSettings`),children:(0,H.jsx)(k,{name:`settings-3`,className:`size-4`})})]}),t[96]=L,t[97]=K,t[98]=y,t[99]=o,t[100]=De,t[101]=ze,t[102]=s,t[103]=Z):Z=t[103];let Q;t[104]!==p||t[105]!==L||t[106]!==y||t[107]!==Ve?(Q=(0,H.jsx)(ie,{assistant:L,warning:Ve,active:p,overlayHeader:y}),t[104]=p,t[105]=L,t[106]=y,t[107]=Ve,t[108]=Q):Q=t[108];let $;t[109]!==X||t[110]!==Z||t[111]!==Q?($=(0,H.jsxs)(`div`,{className:X,children:[Z,Q]}),t[109]=X,t[110]=Z,t[111]=Q,t[112]=$):$=t[112];let We;return t[113]!==J||t[114]!==Y||t[115]!==$?(We=(0,H.jsxs)(`div`,{className:`relative flex h-full min-h-0 overflow-clip bg-background`,"data-presentation":`workspace`,children:[J,Y,$]}),t[113]=J,t[114]=Y,t[115]=$,t[116]=We):We=t[116],We};function Se(e){return e.activeMainTab===`assistant`}function Ce(e){return e.isMobile}function we(e){return e.selectAssistant}function Te(e){return e.requestCreate}function Ee(){d.getState().setActiveMainTab(`chat`)}export{he as a,U as c,_e as i,ye as n,pe as o,W as r,fe as s,G as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./runtime-switch-BMjl5Y5W.js";import{ot as n,st as r}from"./vendor-base-ui-CzHs0bHY.js";import{r as i}from"./useUIStore-BF882_0b.js";import{l as a}from"./vendor-tanstack-react-query-B-Wpqq5J.js";import{a as o,i as s,t as c,u as l}from"./fileQueries-D9l0crnM.js";import{r as u}from"./vendor-sonner-BEHGipm5.js";import{t as d}from"./i18n-BU14awhU.js";import{n as f}from"./Icon-AqWbQ-aO.js";import{n as p}from"./useEffectiveDirectory-D5CBpzcV.js";import{t as m}from"./diagram-B_HmL8LL.js";var h=e(r(),1),g=n();function _(){let{t:e}=d(),{files:n}=l(),r=a(),_=p()??null,v=t(),[y,b]=h.useState(null),[x,S]=h.useState(``),C=h.useRef(null),w=h.useRef(!1),T=h.useRef(null),E=h.useRef(0),D=h.useRef(Promise.resolve()),O=i(e=>e.pendingDiagramFile),k=o({scopeDirectory:_,path:y},{enabled:!!y});if(y&&(T.current?.path!==y||T.current.transport!==v||T.current.scopeDirectory!==_)){let e=E.current+1;E.current=e,T.current={path:y,generation:e,transport:v,scopeDirectory:_}}h.useEffect(()=>(w.current=!0,()=>{w.current=!1,E.current+=1}),[]),h.useEffect(()=>{if(!O)return;let e=i.getState().consumePendingDiagramFile();if(e){let t=E.current+1;E.current=t,T.current={path:e,generation:t,transport:v,scopeDirectory:_},b(e)}},[_,O,v]),h.useEffect(()=>{let e=T.current;if(!(!e||e.path!==y||e.transport!==v||e.scopeDirectory!==_)){if(k.data!==void 0){S(k.data);return}k.isError&&S(``)}},[_,y,k.data,k.isError,v]);let A=h.useCallback(async()=>{let t=C.current?.getXml(),i=T.current,a=n?.writeFile;if(!y||!a||!t||t===x||i?.path!==y)return;let{path:o,generation:l,scopeDirectory:d,transport:f}=i,p=D.current.then(async()=>{try{if(!(await a(o,t))?.success)throw Error(e(`filesView.toast.writeFileFailed`));let n={scopeDirectory:d,path:o};await r.cancelQueries({queryKey:c(n,f),exact:!0}),s(r,n,f,t);let i=T.current;w.current&&i?.path===o&&i.generation===l&&i.transport===f&&i.scopeDirectory===d&&S(t)}catch(t){u.error(t instanceof Error?t.message:e(`filesView.toast.saveFailed`))}});D.current=p.catch(()=>void 0),await p},[y,n,r,e,x]),j=y?y.split(`/`).pop()||y:``;return y?k.isPending?(0,g.jsx)(`div`,{className:`flex h-full items-center justify-center p-3`,children:(0,g.jsx)(f,{name:`loader-4`,className:`size-4 animate-spin`})}):(0,g.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,g.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border/30 px-3 py-1.5`,children:[(0,g.jsx)(f,{name:`file`,className:`size-4 shrink-0 text-muted-foreground`}),(0,g.jsx)(`span`,{className:`typography-ui text-muted-foreground truncate flex-1`,children:j}),(0,g.jsx)(`button`,{type:`button`,onClick:()=>void A(),className:`size-6 flex items-center justify-center rounded-md text-foreground hover:bg-interactive-hover/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,title:e(`filesView.diagram.saveDiagram`),children:(0,g.jsx)(f,{name:`save-3`,className:`size-4`})}),(0,g.jsx)(`button`,{type:`button`,onClick:()=>i.getState().setActiveMainTab(`chat`),className:`size-6 flex items-center justify-center rounded-md text-muted-foreground hover:bg-interactive-hover/50 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,title:e(`filesView.diagram.closeDiagramView`),children:(0,g.jsx)(f,{name:`close`,className:`size-4`})})]}),(0,g.jsx)(`div`,{className:`flex-1 min-h-0`,children:(0,g.jsx)(m,{ref:C,xml:x,className:`h-full`})})]}):(0,g.jsx)(`div`,{className:`flex h-full items-center justify-center p-3`,children:(0,g.jsx)(`div`,{className:`typography-ui text-muted-foreground`,children:e(`filesView.editor.pickFileFromTree`)})})}export{_ as DiagramView};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{ot as t,st as n}from"./vendor-base-ui-CzHs0bHY.js";import{n as r}from"./vendor-react-DlzBev0S.js";import{Jn as i}from"./useMobileNavigationStore-ywElU2fl.js";var a=`#yuri-skill:`,o=`#yuri-agent:`,s=e=>`https://opencode.ai/docs/agents/#${encodeURIComponent(e)}`,c=e=>`${a}${encodeURIComponent(e)}`,l=e=>`${o}${encodeURIComponent(e)}`,u=e=>{let t=[a,`#openchamber-skill:`].find(t=>e?.startsWith(t));if(!t||!e)return null;try{return decodeURIComponent(e.slice(t.length))}catch{return null}},d=e=>{let t=[o,`#openchamber-agent:`].find(t=>e?.startsWith(t));if(!t||!e)return null;try{return decodeURIComponent(e.slice(t.length))}catch{return null}},f=[`user-blocking`,`visible`,`background`],p=e=>{let t={"user-blocking":{head:null,tail:null},visible:{head:null,tail:null},background:{head:null,tail:null}},n=Math.max(1,Math.floor(e.maxTasksPerFrame)),r=Math.max(1,e.frameBudgetMs),i=null,a=!1,o=0,s=e=>{let n=t[e.priority];e.previous=n.tail,n.tail?n.tail.next=e:n.head=e,n.tail=e},c=e=>{let n=t[e.priority];e.previous?e.previous.next=e.next:n.head=e.next,e.next?e.next.previous=e.previous:n.tail=e.previous,e.next=null,e.previous=null},l=()=>{for(let e of f){let n=t[e].head;if(n)return c(n),n.consumed=!0,--o,n}return null},u=()=>{i===null&&o!==0&&(i=e.requestFrame(d))},d=()=>{i=null;let t=e.now(),a=0;for(;o>0&&a<n;){let n=l();if(!n||(n.run(),a+=1,e.now()-t>=r))break}u()},p=()=>{i!==null||a||o===0||(a=!0,i=e.requestFrame(()=>{i=null,a=!1,u()}))};return{enqueue(t,n){let r={cancelled:!1,consumed:!1,next:null,previous:null,priority:n?.priority??`background`,run:t};return s(r),o+=1,!a&&i===null&&p(),()=>{r.cancelled||r.consumed||(r.cancelled=!0,c(r),--o,o===0&&(i!==null&&(e.cancelFrame(i),i=null),a=!1))}},clear(){for(let e of f){let n=t[e],r=n.head;for(;r;){let e=r.next;r.cancelled=!0,r.next=null,r.previous=null,r=e}n.head=null,n.tail=null}o=0,i!==null&&(e.cancelFrame(i),i=null),a=!1}}},m=null,h=()=>typeof window>`u`?null:m||(m=p({requestFrame:e=>window.requestAnimationFrame(e),cancelFrame:e=>window.cancelAnimationFrame(e),now:()=>performance.now(),maxTasksPerFrame:2,frameBudgetMs:6}),m),g=(e,t)=>{let n=h();return n?n.enqueue(e,t):(e(),()=>{})},_={textThrottleMs:20,markdownPaceMs:64},v={textThrottleMs:100,markdownPaceMs:128},y=e=>e===`android`?v:_,b=r(),x=e(n(),1),S=t(),C=x.createContext(!1),w=e=>{let t=(0,b.c)(3),{disabled:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,S.jsx)(C.Provider,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i},T=e=>{let t=(0,b.c)(8),{children:n,className:r}=e,[a,o]=x.useState(!1),s,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{let e=null,t=()=>o(!0);return typeof window<`u`&&typeof window.requestAnimationFrame==`function`?e=window.requestAnimationFrame(t):t(),()=>{e!==null&&typeof window<`u`&&typeof window.cancelAnimationFrame==`function`&&window.cancelAnimationFrame(e)}},c=[],t[0]=s,t[1]=c):(s=t[0],c=t[1]),x.useEffect(s,c);let l=a?`opacity-100 translate-y-0`:`opacity-0 translate-y-2`,u;t[2]!==r||t[3]!==l?(u=i(`w-full transition-all duration-300 ease-out`,l,r),t[2]=r,t[3]=l,t[4]=u):u=t[4];let d;return t[5]!==n||t[6]!==u?(d=(0,S.jsx)(`div`,{className:u,children:n}),t[5]=n,t[6]=u,t[7]=d):d=t[7],d},E=e=>{let t=(0,b.c)(5),{children:n,className:r,skipAnimation:i,forceAnimation:a,ignoreContextDisabled:o,respectReducedMotion:s}=e,c=a!==void 0&&a,l=o!==void 0&&o,u=s!==void 0&&s,d=x.useContext(C),f=u&&typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;if(!c||i||!l&&d||f){let e;return t[0]===n?e=t[1]:(e=(0,S.jsx)(S.Fragment,{children:n}),t[0]=n,t[1]=e),e}let p;return t[2]!==n||t[3]!==r?(p=(0,S.jsx)(T,{className:r,children:n}),t[2]=n,t[3]=r,t[4]=p):p=t[4],p};export{l as a,d as c,g as i,u as l,E as n,s as o,y as r,c as s,w as t};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{ot as t,st as n}from"./vendor-base-ui-CzHs0bHY.js";import{n as r}from"./vendor-react-DlzBev0S.js";import{Jn as i}from"./useMobileNavigationStore-C90n-pQY.js";var a=`#yuri-skill:`,o=`#yuri-agent:`,s=e=>`https://opencode.ai/docs/agents/#${encodeURIComponent(e)}`,c=e=>`${a}${encodeURIComponent(e)}`,l=e=>`${o}${encodeURIComponent(e)}`,u=e=>{let t=[a,`#openchamber-skill:`].find(t=>e?.startsWith(t));if(!t||!e)return null;try{return decodeURIComponent(e.slice(t.length))}catch{return null}},d=e=>{let t=[o,`#openchamber-agent:`].find(t=>e?.startsWith(t));if(!t||!e)return null;try{return decodeURIComponent(e.slice(t.length))}catch{return null}},f=[`user-blocking`,`visible`,`background`],p=e=>{let t={"user-blocking":{head:null,tail:null},visible:{head:null,tail:null},background:{head:null,tail:null}},n=Math.max(1,Math.floor(e.maxTasksPerFrame)),r=Math.max(1,e.frameBudgetMs),i=null,a=!1,o=0,s=e=>{let n=t[e.priority];e.previous=n.tail,n.tail?n.tail.next=e:n.head=e,n.tail=e},c=e=>{let n=t[e.priority];e.previous?e.previous.next=e.next:n.head=e.next,e.next?e.next.previous=e.previous:n.tail=e.previous,e.next=null,e.previous=null},l=()=>{for(let e of f){let n=t[e].head;if(n)return c(n),n.consumed=!0,--o,n}return null},u=()=>{i===null&&o!==0&&(i=e.requestFrame(d))},d=()=>{i=null;let t=e.now(),a=0;for(;o>0&&a<n;){let n=l();if(!n||(n.run(),a+=1,e.now()-t>=r))break}u()},p=()=>{i!==null||a||o===0||(a=!0,i=e.requestFrame(()=>{i=null,a=!1,u()}))};return{enqueue(t,n){let r={cancelled:!1,consumed:!1,next:null,previous:null,priority:n?.priority??`background`,run:t};return s(r),o+=1,!a&&i===null&&p(),()=>{r.cancelled||r.consumed||(r.cancelled=!0,c(r),--o,o===0&&(i!==null&&(e.cancelFrame(i),i=null),a=!1))}},clear(){for(let e of f){let n=t[e],r=n.head;for(;r;){let e=r.next;r.cancelled=!0,r.next=null,r.previous=null,r=e}n.head=null,n.tail=null}o=0,i!==null&&(e.cancelFrame(i),i=null),a=!1}}},m=null,h=()=>typeof window>`u`?null:m||(m=p({requestFrame:e=>window.requestAnimationFrame(e),cancelFrame:e=>window.cancelAnimationFrame(e),now:()=>performance.now(),maxTasksPerFrame:2,frameBudgetMs:6}),m),g=(e,t)=>{let n=h();return n?n.enqueue(e,t):(e(),()=>{})},_={textThrottleMs:20,markdownPaceMs:64},v={textThrottleMs:100,markdownPaceMs:128},y=e=>e===`android`?v:_,b=r(),x=e(n(),1),S=t(),C=x.createContext(!1),w=e=>{let t=(0,b.c)(3),{disabled:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,S.jsx)(C.Provider,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i},T=e=>{let t=(0,b.c)(8),{children:n,className:r}=e,[a,o]=x.useState(!1),s,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{let e=null,t=()=>o(!0);return typeof window<`u`&&typeof window.requestAnimationFrame==`function`?e=window.requestAnimationFrame(t):t(),()=>{e!==null&&typeof window<`u`&&typeof window.cancelAnimationFrame==`function`&&window.cancelAnimationFrame(e)}},c=[],t[0]=s,t[1]=c):(s=t[0],c=t[1]),x.useEffect(s,c);let l=a?`opacity-100 translate-y-0`:`opacity-0 translate-y-2`,u;t[2]!==r||t[3]!==l?(u=i(`w-full transition-all duration-300 ease-out`,l,r),t[2]=r,t[3]=l,t[4]=u):u=t[4];let d;return t[5]!==n||t[6]!==u?(d=(0,S.jsx)(`div`,{className:u,children:n}),t[5]=n,t[6]=u,t[7]=d):d=t[7],d},E=e=>{let t=(0,b.c)(5),{children:n,className:r,skipAnimation:i,forceAnimation:a,ignoreContextDisabled:o,respectReducedMotion:s}=e,c=a!==void 0&&a,l=o!==void 0&&o,u=s!==void 0&&s,d=x.useContext(C),f=u&&typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;if(!c||i||!l&&d||f){let e;return t[0]===n?e=t[1]:(e=(0,S.jsx)(S.Fragment,{children:n}),t[0]=n,t[1]=e),e}let p;return t[2]!==n||t[3]!==r?(p=(0,S.jsx)(T,{className:r,children:n}),t[2]=n,t[3]=r,t[4]=p):p=t[4],p};export{l as a,d as c,g as i,u as l,E as n,s as o,y as r,c as s,w as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t}from"./platform-DMsFWy1a.js";import{ot as n,st as r}from"./vendor-base-ui-CzHs0bHY.js";import{r as i}from"./useUIStore-BF882_0b.js";import{n as a}from"./vendor-react-DlzBev0S.js";import{t as o}from"./i18n-BU14awhU.js";import{Jn as s,Kn as c}from"./useMobileNavigationStore-C90n-pQY.js";import{n as l}from"./Icon-AqWbQ-aO.js";import{a as u,o as d}from"./react-Bch1-zoe.js";import{i as f,n as p}from"./readiness-_wHN9DvW.js";import{i as m}from"./pages-CYkE04ml.js";var h=e(r(),1),g=a(),_=n();function v(e){let t=(0,g.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({children:n,className:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=s(`relative isolate flex min-h-0 flex-1 flex-col overflow-hidden rounded-xl bg-background shadow-sm [--background:oklch(from_var(--surface-background)_min(1,calc(l_+_0.015))_c_h)] dark:[--background:color-mix(in_srgb,var(--surface-foreground)_4%,var(--surface-background))]`,r),t[4]=r,t[5]=a);let o;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,_.jsx)(`span`,{"aria-hidden":`true`,"data-workspace-surface-ring":!0,className:`pointer-events-none absolute inset-0 z-50 rounded-[inherit] ring-1 ring-inset ring-[var(--interactive-border)]`}),t[6]=o):o=t[6];let c;return t[7]!==n||t[8]!==i||t[9]!==a?(c=(0,_.jsxs)(`section`,{...i,"data-workspace-surface":!0,className:a,children:[n,o]}),t[7]=n,t[8]=i,t[9]=a,t[10]=c):c=t[10],c}function y(){let e=(0,g.c)(33),{host:n,snapshot:r,inventory:a,error:s,loading:y,requested:S,requestLoad:C,refresh:w}=u(),{t:T}=o(),E=i(x),D=i(b),O,k;e[0]!==C||e[1]!==S?(O=()=>{S||C()},k=[S,C],e[0]=C,e[1]=S,e[2]=O,e[3]=k):(O=e[2],k=e[3]),h.useEffect(O,k);let A=r.pages,j,M,N,P,F,I;if(e[4]!==s||e[5]!==n||e[6]!==a||e[7]!==D||e[8]!==E||e[9]!==y||e[10]!==w||e[11]!==S||e[12]!==r.pages||e[13]!==r.plugins||e[14]!==T){I=Symbol.for(`react.early_return_sentinel`);bb0:{let i;e[21]===E?i=e[22]:(i=e=>e.key===E,e[21]=E,e[22]=i);let o=A.find(i),u=r.plugins.find(e=>e.id===o?.pluginId)?.revision,h=m(E),g=r.plugins.some(e=>e.id===h&&e.status===`failed`)||a.some(e=>e.id===h&&e.error)||!o&&!!s;if(D){let r=!t()||s===`unsupported`?(0,_.jsx)(f,{message:T(`guiPlugins.mobile.unsupported`)}):n&&o?(0,_.jsx)(d,{fallback:(0,_.jsx)(f,{message:T(`guiPlugins.error`)}),children:(0,_.jsx)(p,{host:n,kind:`page`,contributionKey:o.key,revision:u})},JSON.stringify([o.key,u])):g?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(f,{message:T(s===`relay_required`?`guiPlugins.mobile.relayRequired`:s===`relay_unavailable`?`guiPlugins.mobile.networkFailed`:`guiPlugins.error`)}),s?(0,_.jsx)(c,{className:`m-4 self-center`,onClick:w,children:T(`guiPlugins.mobile.retry`)}):null]}):y||!S?(0,_.jsxs)(`div`,{role:`status`,className:`flex min-h-0 flex-1 items-center justify-center gap-2 text-muted-foreground`,children:[(0,_.jsx)(l,{name:`loader-4`,className:`size-4 animate-spin motion-reduce:animate-none`}),T(`guiPlugins.loading`)]}):null,i;e[23]===r?i=e[24]:(i=(0,_.jsx)(`div`,{"data-gui-plugin-page":!0,className:`flex min-h-0 min-w-0 flex-1 flex-col`,"data-mobile-edge-to-edge-preview":`true`,children:r}),e[23]=r,e[24]=i),I=i;break bb0}P=!0,F=`flex h-full min-h-0 min-w-0 flex-col py-1.5 pl-1 pr-1.5 text-foreground`,j=v,M=!0,N=n&&o?(0,_.jsx)(d,{fallback:(0,_.jsx)(f,{message:T(`guiPlugins.error`)}),children:(0,_.jsx)(p,{host:n,kind:`page`,contributionKey:o.key,revision:u})},JSON.stringify([o.key,u])):g?(0,_.jsx)(f,{message:T(`guiPlugins.error`)}):null}e[4]=s,e[5]=n,e[6]=a,e[7]=D,e[8]=E,e[9]=y,e[10]=w,e[11]=S,e[12]=r.pages,e[13]=r.plugins,e[14]=T,e[15]=j,e[16]=M,e[17]=N,e[18]=P,e[19]=F,e[20]=I}else j=e[15],M=e[16],N=e[17],P=e[18],F=e[19],I=e[20];if(I!==Symbol.for(`react.early_return_sentinel`))return I;let L;e[25]!==j||e[26]!==M||e[27]!==N?(L=(0,_.jsx)(j,{"data-gui-plugin-page-surface":M,children:N}),e[25]=j,e[26]=M,e[27]=N,e[28]=L):L=e[28];let R;return e[29]!==P||e[30]!==F||e[31]!==L?(R=(0,_.jsx)(`div`,{"data-gui-plugin-page":P,className:F,children:L}),e[29]=P,e[30]=F,e[31]=L,e[32]=R):R=e[32],R}function b(e){return e.isMobile}function x(e){return e.activeGuiPage}export{v as n,y as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{ot as t,st as n}from"./vendor-base-ui-CzHs0bHY.js";import{r}from"./useUIStore-BF882_0b.js";import{n as i}from"./vendor-react-DlzBev0S.js";import{t as a}from"./i18n-BU14awhU.js";import{Kn as o}from"./useMobileNavigationStore-C90n-pQY.js";import{a as s}from"./react-Bch1-zoe.js";import{r as c}from"./device-DNG0cNwQ.js";import{n as l,r as u,t as d}from"./readiness-_wHN9DvW.js";import{t as f}from"./GuiPluginWindow-BuGtfRjB.js";import{t as p}from"./GuiPluginPage-D8Tl5eZe.js";import{i as m}from"./pages-CYkE04ml.js";var h=i(),g=e(n(),1),_=t();function v(){let e=(0,h.c)(57),{host:t,snapshot:n,inventory:i,error:v,loading:S,requested:C}=s(),{t:w}=a(),{isMobile:T}=c(),E=r(x),D;if(e[0]!==E||e[1]!==n.pages){let t;e[3]===E?t=e[4]:(t=e=>e.key===E,e[3]=E,e[4]=t),D=n.pages.find(t),e[0]=E,e[1]=n.pages,e[2]=D}else D=e[2];let O=D,k;e[5]===E?k=e[6]:(k=m(E),e[5]=E,e[6]=k);let A=k,j;e[7]!==v||e[8]!==i||e[9]!==A||e[10]!==n.plugins?(j=!!v||n.plugins.some(e=>e.id===A&&e.status===`failed`)||i.some(e=>e.id===A&&e.error),e[7]=v,e[8]=i,e[9]=A,e[10]=n.plugins,e[11]=j):j=e[11];let M=j,N,P;e[12]!==M||e[13]!==T||e[14]!==S||e[15]!==O||e[16]!==E||e[17]!==C?(N=()=>{T&&E&&C&&!S&&!O&&!M&&r.getState().closeGuiPage()},P=[T,E,C,S,O,M],e[12]=M,e[13]=T,e[14]=S,e[15]=O,e[16]=E,e[17]=C,e[18]=N,e[19]=P):(N=e[18],P=e[19]),g.useEffect(N,P);let[F]=g.useState(b),I,L,R,z,B,V,H,U;if(e[20]!==F||e[21]!==t||e[22]!==T||e[23]!==O?.title||e[24]!==E||e[25]!==n.activePanel||e[26]!==n.panels||e[27]!==n.plugins||e[28]!==w){let r;e[37]===n.activePanel?r=e[38]:(r=e=>e.key===n.activePanel&&!e.inline,e[37]=n.activePanel,e[38]=r);let i=n.panels.find(r);e[39]!==T||e[40]!==O?.title||e[41]!==E||e[42]!==w?(R=T&&E?(0,_.jsx)(f,{id:`gui-plugin-page`,open:!0,title:O?.title??w(`guiPlugins.title`),onClose:y,children:(0,_.jsx)(p,{})}):null,e[39]=T,e[40]=O?.title,e[41]=E,e[42]=w,e[43]=R):R=e[43],I=f,z=`gui-plugin-panel`,B=!!(t&&i),V=i?.title??w(`guiPlugins.title`),e[44]===t?H=e[45]:(H=()=>t?.hidePanel(),e[44]=t,e[45]=H),U=T&&i?(0,_.jsx)(u,{target:F}):null,L=t&&i?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(`div`,{className:`flex shrink-0 flex-wrap gap-1`,"aria-label":w(`guiPlugins.panels`),children:n.panels.map(e=>(0,_.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[(0,_.jsx)(o,{variant:`chip`,size:`sm`,"aria-pressed":e.key===i.key,onClick:()=>t.selectPanel(e.key),className:`max-w-64 truncate`,children:e.title}),(0,_.jsx)(o,{variant:`ghost`,size:`xs`,"aria-label":w(`guiPlugins.closePanel`,{title:e.title}),onClick:()=>t.closePanel(e.key),children:w(`guiPlugins.close`)})]},e.key))}),(0,_.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,"data-mobile-edge-to-edge-preview":`true`,children:(0,_.jsx)(l,{host:t,contributionKey:i.key,kind:`panel`,actions:T?F:void 0,revision:d(n.plugins,i.pluginId)})})]}):null,e[20]=F,e[21]=t,e[22]=T,e[23]=O?.title,e[24]=E,e[25]=n.activePanel,e[26]=n.panels,e[27]=n.plugins,e[28]=w,e[29]=I,e[30]=L,e[31]=R,e[32]=z,e[33]=B,e[34]=V,e[35]=H,e[36]=U}else I=e[29],L=e[30],R=e[31],z=e[32],B=e[33],V=e[34],H=e[35],U=e[36];let W;e[46]!==I||e[47]!==L||e[48]!==z||e[49]!==B||e[50]!==V||e[51]!==H||e[52]!==U?(W=(0,_.jsx)(I,{id:z,open:B,title:V,onClose:H,actions:U,children:L}),e[46]=I,e[47]=L,e[48]=z,e[49]=B,e[50]=V,e[51]=H,e[52]=U,e[53]=W):W=e[53];let G;return e[54]!==R||e[55]!==W?(G=(0,_.jsxs)(_.Fragment,{children:[R,W]}),e[54]=R,e[55]=W,e[56]=G):G=e[56],G}function y(){return r.getState().closeGuiPage()}function b(){return document.createElement(`div`)}function x(e){return e.activeMainTab===`plugin`?e.activeGuiPage:null}export{v as GuiPluginSurface};
@@ -0,0 +1 @@
1
+ import{ot as e}from"./vendor-base-ui-CzHs0bHY.js";import{n as t}from"./vendor-react-DlzBev0S.js";import{t as n}from"./i18n-BU14awhU.js";import{a as r,n as i,o as a,t as o}from"./dialog-pjai4m5O.js";import{r as s}from"./device-DNG0cNwQ.js";import{t as c}from"./MobileResizableSheet-CBHcyf1Z.js";var l=t(),u=e();function d(e){let t=(0,l.c)(24),{id:d,open:f,title:p,onClose:m,children:h,actions:g}=e,{isMobile:_}=s(),{t:v}=n(),y;t[0]===m?y=t[1]:(y=e=>{e||m()},t[0]=m,t[1]=y);let b=y;if(_){let e;t[2]===v?e=t[3]:(e=v(`guiPlugins.close`),t[2]=v,t[3]=e);let n;t[4]===v?n=t[5]:(n=v(`guiPlugins.resize`),t[4]=v,t[5]=n);let r;return t[6]!==g||t[7]!==h||t[8]!==d||t[9]!==b||t[10]!==f||t[11]!==e||t[12]!==n||t[13]!==p?(r=(0,u.jsx)(c,{id:d,open:f,onOpenChange:b,title:p,ariaLabel:p,closeAriaLabel:e,resizeAriaLabel:n,trailing:g,initiallyExpanded:!0,compactHeader:!0,showCloseButton:!1,children:h}),t[6]=g,t[7]=h,t[8]=d,t[9]=b,t[10]=f,t[11]=e,t[12]=n,t[13]=p,t[14]=r):r=t[14],r}let x;t[15]===p?x=t[16]:(x=(0,u.jsx)(r,{children:(0,u.jsx)(a,{children:p})}),t[15]=p,t[16]=x);let S;t[17]!==h||t[18]!==x?(S=(0,u.jsxs)(i,{className:`flex h-[80dvh] max-w-5xl flex-col overflow-hidden`,"aria-describedby":void 0,children:[x,h]}),t[17]=h,t[18]=x,t[19]=S):S=t[19];let C;return t[20]!==b||t[21]!==f||t[22]!==S?(C=(0,u.jsx)(o,{open:f,onOpenChange:b,children:S}),t[20]=b,t[21]=f,t[22]=S,t[23]=C):C=t[23],C}export{d as t};