@arbidocs/blocks 0.5.113 → 0.5.115

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/{ConnectedCallDock-VCJ6Q7WE.cjs → ConnectedCallDock-WER7R222.cjs} +27 -27
  2. package/dist/{ConnectedCallDock-VCJ6Q7WE.cjs.map → ConnectedCallDock-WER7R222.cjs.map} +1 -1
  3. package/dist/{ConnectedCallRoom-BUI3ILJD.cjs → ConnectedCallRoom-T7OBQTYP.cjs} +19 -19
  4. package/dist/{ConnectedCallRoom-BUI3ILJD.cjs.map → ConnectedCallRoom-T7OBQTYP.cjs.map} +1 -1
  5. package/dist/{ConnectedMailInviteCard-P65MQM6J.cjs → ConnectedMailInviteCard-EINB3THA.cjs} +5 -5
  6. package/dist/{ConnectedMailInviteCard-P65MQM6J.cjs.map → ConnectedMailInviteCard-EINB3THA.cjs.map} +1 -1
  7. package/dist/{ConnectedNativeDocxComparison-JO2H4QIP.cjs → ConnectedNativeDocxComparison-YXMYJWXY.cjs} +24 -24
  8. package/dist/{ConnectedNativeDocxComparison-JO2H4QIP.cjs.map → ConnectedNativeDocxComparison-YXMYJWXY.cjs.map} +1 -1
  9. package/dist/{ConnectedProductionSetDialog-BSPM4NQC.cjs → ConnectedProductionSetDialog-LHB4VQWC.cjs} +9 -9
  10. package/dist/{ConnectedProductionSetDialog-BSPM4NQC.cjs.map → ConnectedProductionSetDialog-LHB4VQWC.cjs.map} +1 -1
  11. package/dist/{ConnectedStreamedWordArtifact-DMQEJFCA.cjs → ConnectedStreamedWordArtifact-2RTCHVPI.cjs} +24 -24
  12. package/dist/{ConnectedStreamedWordArtifact-DMQEJFCA.cjs.map → ConnectedStreamedWordArtifact-2RTCHVPI.cjs.map} +1 -1
  13. package/dist/{DocumentReviewCard-UBE2DVAC.cjs → DocumentReviewCard-ZSBZBGFK.cjs} +23 -23
  14. package/dist/{DocumentReviewCard-UBE2DVAC.cjs.map → DocumentReviewCard-ZSBZBGFK.cjs.map} +1 -1
  15. package/dist/{FilesViewerDialog-EBYRA3ZZ.cjs → FilesViewerDialog-I5QIHQZT.cjs} +55 -55
  16. package/dist/{FilesViewerDialog-EBYRA3ZZ.cjs.map → FilesViewerDialog-I5QIHQZT.cjs.map} +1 -1
  17. package/dist/{NativeDocxEditor-EJEIJDOC.cjs → NativeDocxEditor-H6TAEVGY.cjs} +6 -6
  18. package/dist/{NativeDocxEditor-EJEIJDOC.cjs.map → NativeDocxEditor-H6TAEVGY.cjs.map} +1 -1
  19. package/dist/{WorkspaceTableView-BO2OJO7A.cjs → WorkspaceTableView-J3C6VH4T.cjs} +9 -9
  20. package/dist/{WorkspaceTableView-BO2OJO7A.cjs.map → WorkspaceTableView-J3C6VH4T.cjs.map} +1 -1
  21. package/dist/agents/index.cjs +298 -298
  22. package/dist/{ai-EMNMGDAN.cjs → ai-IM4A23YT.cjs} +27 -27
  23. package/dist/ai-IM4A23YT.cjs.map +1 -0
  24. package/dist/calls/index.cjs +149 -149
  25. package/dist/chat/DraftingDocChip.d.ts +3 -1
  26. package/dist/chat/DraftingDocChip.js +7 -4
  27. package/dist/chat/DraftingDocChip.js.map +2 -2
  28. package/dist/chat/index.cjs +65 -65
  29. package/dist/{chunk-AJVZYRAJ.cjs → chunk-24EDG4PC.cjs} +68 -68
  30. package/dist/{chunk-AJVZYRAJ.cjs.map → chunk-24EDG4PC.cjs.map} +1 -1
  31. package/dist/{chunk-GTTDJMWX.cjs → chunk-325GVZE6.cjs} +6 -6
  32. package/dist/{chunk-GTTDJMWX.cjs.map → chunk-325GVZE6.cjs.map} +1 -1
  33. package/dist/{chunk-HM5L4SBC.cjs → chunk-3A7QWUAW.cjs} +3 -3
  34. package/dist/{chunk-HM5L4SBC.cjs.map → chunk-3A7QWUAW.cjs.map} +1 -1
  35. package/dist/{chunk-ET3NVY27.cjs → chunk-42TURFHF.cjs} +5 -5
  36. package/dist/{chunk-ET3NVY27.cjs.map → chunk-42TURFHF.cjs.map} +1 -1
  37. package/dist/{chunk-J2RXQVVF.cjs → chunk-4EK7TAP7.cjs} +5 -5
  38. package/dist/{chunk-J2RXQVVF.cjs.map → chunk-4EK7TAP7.cjs.map} +1 -1
  39. package/dist/{chunk-BHTEKYWJ.cjs → chunk-557MJ4IH.cjs} +23 -23
  40. package/dist/{chunk-BHTEKYWJ.cjs.map → chunk-557MJ4IH.cjs.map} +1 -1
  41. package/dist/{chunk-Y45VRNSZ.cjs → chunk-57NHXEU2.cjs} +4 -4
  42. package/dist/{chunk-Y45VRNSZ.cjs.map → chunk-57NHXEU2.cjs.map} +1 -1
  43. package/dist/{chunk-MUA5PJGX.cjs → chunk-5SKHK3BG.cjs} +4 -4
  44. package/dist/{chunk-MUA5PJGX.cjs.map → chunk-5SKHK3BG.cjs.map} +1 -1
  45. package/dist/{chunk-AFXDLDPU.cjs → chunk-5UYFLFNR.cjs} +4 -4
  46. package/dist/{chunk-AFXDLDPU.cjs.map → chunk-5UYFLFNR.cjs.map} +1 -1
  47. package/dist/{chunk-OTG5T5Z5.cjs → chunk-6UTKM5AB.cjs} +5 -5
  48. package/dist/{chunk-OTG5T5Z5.cjs.map → chunk-6UTKM5AB.cjs.map} +1 -1
  49. package/dist/{chunk-H5OLHP2U.cjs → chunk-7OPOPYV6.cjs} +3 -3
  50. package/dist/{chunk-H5OLHP2U.cjs.map → chunk-7OPOPYV6.cjs.map} +1 -1
  51. package/dist/{chunk-MQANCZOD.cjs → chunk-A3T3IC3K.cjs} +78 -78
  52. package/dist/{chunk-MQANCZOD.cjs.map → chunk-A3T3IC3K.cjs.map} +1 -1
  53. package/dist/{chunk-5VCID67B.cjs → chunk-B3LZITVF.cjs} +12 -12
  54. package/dist/{chunk-5VCID67B.cjs.map → chunk-B3LZITVF.cjs.map} +1 -1
  55. package/dist/{chunk-OZWYCRRK.cjs → chunk-BQ5RIWWT.cjs} +30 -30
  56. package/dist/{chunk-OZWYCRRK.cjs.map → chunk-BQ5RIWWT.cjs.map} +1 -1
  57. package/dist/chunk-CIHERNDO.cjs +18 -0
  58. package/dist/{chunk-L52N2LVE.cjs.map → chunk-CIHERNDO.cjs.map} +1 -1
  59. package/dist/{chunk-NP4EWPIP.cjs → chunk-CJYWHUZR.cjs} +6 -6
  60. package/dist/{chunk-NP4EWPIP.cjs.map → chunk-CJYWHUZR.cjs.map} +1 -1
  61. package/dist/{chunk-6W4X4EFI.cjs → chunk-CMGNRMPA.cjs} +5 -5
  62. package/dist/{chunk-6W4X4EFI.cjs.map → chunk-CMGNRMPA.cjs.map} +1 -1
  63. package/dist/{chunk-YONJRX6N.cjs → chunk-CPG7II4E.cjs} +28 -28
  64. package/dist/{chunk-YONJRX6N.cjs.map → chunk-CPG7II4E.cjs.map} +1 -1
  65. package/dist/{chunk-GGBNUDLK.cjs → chunk-CPR6EHG7.cjs} +70 -70
  66. package/dist/{chunk-GGBNUDLK.cjs.map → chunk-CPR6EHG7.cjs.map} +1 -1
  67. package/dist/{chunk-DZWIVRYP.cjs → chunk-DDIW4HLU.cjs} +36 -36
  68. package/dist/{chunk-DZWIVRYP.cjs.map → chunk-DDIW4HLU.cjs.map} +1 -1
  69. package/dist/{chunk-Z3VNKPPH.cjs → chunk-E3Y7RI3J.cjs} +4 -4
  70. package/dist/{chunk-Z3VNKPPH.cjs.map → chunk-E3Y7RI3J.cjs.map} +1 -1
  71. package/dist/{chunk-WT7CCCIN.cjs → chunk-GNX3FBBX.cjs} +4 -4
  72. package/dist/{chunk-WT7CCCIN.cjs.map → chunk-GNX3FBBX.cjs.map} +1 -1
  73. package/dist/{chunk-IIWJQEBC.cjs → chunk-H7PHOTX2.cjs} +10 -10
  74. package/dist/{chunk-IIWJQEBC.cjs.map → chunk-H7PHOTX2.cjs.map} +1 -1
  75. package/dist/{chunk-LQHXUSWZ.cjs → chunk-HQDR43JC.cjs} +6 -6
  76. package/dist/{chunk-LQHXUSWZ.cjs.map → chunk-HQDR43JC.cjs.map} +1 -1
  77. package/dist/{chunk-6LQN4BMX.cjs → chunk-IDCD5TEZ.cjs} +5 -5
  78. package/dist/{chunk-6LQN4BMX.cjs.map → chunk-IDCD5TEZ.cjs.map} +1 -1
  79. package/dist/{chunk-INEPPS4H.cjs → chunk-IW7CDJTA.cjs} +4 -4
  80. package/dist/{chunk-INEPPS4H.cjs.map → chunk-IW7CDJTA.cjs.map} +1 -1
  81. package/dist/{chunk-6YOZKXV6.cjs → chunk-JR2YSBD5.cjs} +4 -4
  82. package/dist/{chunk-6YOZKXV6.cjs.map → chunk-JR2YSBD5.cjs.map} +1 -1
  83. package/dist/{chunk-ZFKWCGA5.cjs → chunk-JV5TVUOU.cjs} +4 -4
  84. package/dist/{chunk-ZFKWCGA5.cjs.map → chunk-JV5TVUOU.cjs.map} +1 -1
  85. package/dist/{chunk-IFOGBMAE.cjs → chunk-KLMNCBLY.cjs} +9 -6
  86. package/dist/chunk-KLMNCBLY.cjs.map +1 -0
  87. package/dist/{chunk-JDI7E4RI.cjs → chunk-KTQOGT2L.cjs} +14 -14
  88. package/dist/{chunk-JDI7E4RI.cjs.map → chunk-KTQOGT2L.cjs.map} +1 -1
  89. package/dist/{chunk-OKHKJ5ML.cjs → chunk-KXIRVKCJ.cjs} +11 -11
  90. package/dist/{chunk-OKHKJ5ML.cjs.map → chunk-KXIRVKCJ.cjs.map} +1 -1
  91. package/dist/{chunk-4ED7CNOX.cjs → chunk-M6IKVKU5.cjs} +40 -3
  92. package/dist/chunk-M6IKVKU5.cjs.map +1 -0
  93. package/dist/{chunk-XKDUPU7B.cjs → chunk-NJCK6V6U.cjs} +4 -4
  94. package/dist/{chunk-XKDUPU7B.cjs.map → chunk-NJCK6V6U.cjs.map} +1 -1
  95. package/dist/{chunk-OVKJ7OVZ.cjs → chunk-NNUK5ZM7.cjs} +6 -6
  96. package/dist/{chunk-OVKJ7OVZ.cjs.map → chunk-NNUK5ZM7.cjs.map} +1 -1
  97. package/dist/{chunk-MJHIBCF7.cjs → chunk-NY3YUCOW.cjs} +4 -4
  98. package/dist/{chunk-MJHIBCF7.cjs.map → chunk-NY3YUCOW.cjs.map} +1 -1
  99. package/dist/{chunk-R4TP3VS3.cjs → chunk-OEREKAAP.cjs} +101 -101
  100. package/dist/{chunk-R4TP3VS3.cjs.map → chunk-OEREKAAP.cjs.map} +1 -1
  101. package/dist/{chunk-ENUZ35NR.cjs → chunk-P5AQYC4D.cjs} +4 -4
  102. package/dist/{chunk-ENUZ35NR.cjs.map → chunk-P5AQYC4D.cjs.map} +1 -1
  103. package/dist/{chunk-ZZZ6AZDR.cjs → chunk-P77YTTJ3.cjs} +4 -4
  104. package/dist/{chunk-ZZZ6AZDR.cjs.map → chunk-P77YTTJ3.cjs.map} +1 -1
  105. package/dist/{chunk-5I2VUNZR.cjs → chunk-PGJYD67F.cjs} +6 -6
  106. package/dist/{chunk-5I2VUNZR.cjs.map → chunk-PGJYD67F.cjs.map} +1 -1
  107. package/dist/{chunk-BYN7UMC5.cjs → chunk-PL7HUTM3.cjs} +8 -8
  108. package/dist/{chunk-BYN7UMC5.cjs.map → chunk-PL7HUTM3.cjs.map} +1 -1
  109. package/dist/{chunk-T7J352JD.cjs → chunk-QMIHLJMH.cjs} +6 -6
  110. package/dist/{chunk-T7J352JD.cjs.map → chunk-QMIHLJMH.cjs.map} +1 -1
  111. package/dist/{chunk-WJP6ICDM.cjs → chunk-R7CJEIA5.cjs} +4 -4
  112. package/dist/{chunk-WJP6ICDM.cjs.map → chunk-R7CJEIA5.cjs.map} +1 -1
  113. package/dist/{chunk-IE677C4I.cjs → chunk-SBWIA4PL.cjs} +21 -21
  114. package/dist/{chunk-IE677C4I.cjs.map → chunk-SBWIA4PL.cjs.map} +1 -1
  115. package/dist/{chunk-GVTKFVXH.cjs → chunk-SGYSDABK.cjs} +6 -6
  116. package/dist/{chunk-GVTKFVXH.cjs.map → chunk-SGYSDABK.cjs.map} +1 -1
  117. package/dist/{chunk-PIB7K7HI.cjs → chunk-T23UTIRI.cjs} +8 -8
  118. package/dist/{chunk-PIB7K7HI.cjs.map → chunk-T23UTIRI.cjs.map} +1 -1
  119. package/dist/{chunk-E4BLRF2L.cjs → chunk-TDO5UWXF.cjs} +5 -5
  120. package/dist/{chunk-E4BLRF2L.cjs.map → chunk-TDO5UWXF.cjs.map} +1 -1
  121. package/dist/{chunk-U5T46QCS.cjs → chunk-TKHCIHE2.cjs} +3 -3
  122. package/dist/chunk-TKHCIHE2.cjs.map +1 -0
  123. package/dist/{chunk-4IOYQLKG.cjs → chunk-TP5PGWIO.cjs} +3 -3
  124. package/dist/{chunk-4IOYQLKG.cjs.map → chunk-TP5PGWIO.cjs.map} +1 -1
  125. package/dist/{chunk-A4Z5CTLF.cjs → chunk-TT4IF52H.cjs} +39 -39
  126. package/dist/{chunk-A4Z5CTLF.cjs.map → chunk-TT4IF52H.cjs.map} +1 -1
  127. package/dist/{chunk-WIAWHETB.cjs → chunk-ULPTSXXO.cjs} +4 -4
  128. package/dist/{chunk-WIAWHETB.cjs.map → chunk-ULPTSXXO.cjs.map} +1 -1
  129. package/dist/{chunk-K5MYEWD5.cjs → chunk-UZHWXKS6.cjs} +7 -7
  130. package/dist/{chunk-K5MYEWD5.cjs.map → chunk-UZHWXKS6.cjs.map} +1 -1
  131. package/dist/{chunk-XW524KUX.cjs → chunk-VJCSEMXT.cjs} +4 -4
  132. package/dist/{chunk-XW524KUX.cjs.map → chunk-VJCSEMXT.cjs.map} +1 -1
  133. package/dist/{chunk-B5442TKX.cjs → chunk-VRK3IQAP.cjs} +4 -4
  134. package/dist/{chunk-B5442TKX.cjs.map → chunk-VRK3IQAP.cjs.map} +1 -1
  135. package/dist/{chunk-MYRKL3JO.cjs → chunk-VWTOIGX4.cjs} +4 -4
  136. package/dist/{chunk-MYRKL3JO.cjs.map → chunk-VWTOIGX4.cjs.map} +1 -1
  137. package/dist/{chunk-KZKGZ7IG.cjs → chunk-WAV762GP.cjs} +14 -14
  138. package/dist/{chunk-KZKGZ7IG.cjs.map → chunk-WAV762GP.cjs.map} +1 -1
  139. package/dist/{chunk-DMNX556N.cjs → chunk-WR2SF44W.cjs} +10 -10
  140. package/dist/{chunk-DMNX556N.cjs.map → chunk-WR2SF44W.cjs.map} +1 -1
  141. package/dist/{chunk-M2D4POJV.cjs → chunk-WXUU3COI.cjs} +9 -9
  142. package/dist/{chunk-M2D4POJV.cjs.map → chunk-WXUU3COI.cjs.map} +1 -1
  143. package/dist/{chunk-FGEBA3TL.cjs → chunk-X5LANJDZ.cjs} +26 -26
  144. package/dist/{chunk-FGEBA3TL.cjs.map → chunk-X5LANJDZ.cjs.map} +1 -1
  145. package/dist/{chunk-MY7Q3QE2.cjs → chunk-XKVPSOKP.cjs} +4 -4
  146. package/dist/{chunk-MY7Q3QE2.cjs.map → chunk-XKVPSOKP.cjs.map} +1 -1
  147. package/dist/{chunk-ONZOVO2B.cjs → chunk-Y24V6HPR.cjs} +24 -24
  148. package/dist/{chunk-ONZOVO2B.cjs.map → chunk-Y24V6HPR.cjs.map} +1 -1
  149. package/dist/{chunk-KGGSBJMU.cjs → chunk-YGXOKB5Z.cjs} +4 -4
  150. package/dist/{chunk-KGGSBJMU.cjs.map → chunk-YGXOKB5Z.cjs.map} +1 -1
  151. package/dist/{chunk-YAPXIANR.cjs → chunk-YVCOQHCE.cjs} +5 -5
  152. package/dist/{chunk-YAPXIANR.cjs.map → chunk-YVCOQHCE.cjs.map} +1 -1
  153. package/dist/{chunk-LCNKKSN3.cjs → chunk-ZTXQIIFV.cjs} +6 -6
  154. package/dist/{chunk-LCNKKSN3.cjs.map → chunk-ZTXQIIFV.cjs.map} +1 -1
  155. package/dist/citations/index.cjs +8 -8
  156. package/dist/connect/docx.cjs +28 -28
  157. package/dist/connect/index.cjs +1683 -1497
  158. package/dist/connect/index.cjs.map +1 -1
  159. package/dist/connect/viewer.cjs +41 -41
  160. package/dist/connection/ConnectedWorkflowBuilder.d.ts +11 -0
  161. package/dist/connection/ConnectedWorkflowBuilder.js +42 -3
  162. package/dist/connection/ConnectedWorkflowBuilder.js.map +2 -2
  163. package/dist/connection/conversation/ConnectedConversation.js +143 -55
  164. package/dist/connection/conversation/ConnectedConversation.js.map +2 -2
  165. package/dist/connection/conversation/ConnectedConversationPage.js +36 -2
  166. package/dist/connection/conversation/ConnectedConversationPage.js.map +2 -2
  167. package/dist/connection/conversation/ConversationSendButton.d.ts +1 -0
  168. package/dist/connection/conversation/ConversationSendButton.js +3 -2
  169. package/dist/connection/conversation/ConversationSendButton.js.map +2 -2
  170. package/dist/connection/conversation/DocumentTargetNotice.d.ts +7 -0
  171. package/dist/connection/conversation/DocumentTargetNotice.js +45 -0
  172. package/dist/connection/conversation/DocumentTargetNotice.js.map +7 -0
  173. package/dist/connection/conversation/documentSwitch.d.ts +9 -0
  174. package/dist/connection/conversation/documentSwitch.js +40 -0
  175. package/dist/connection/conversation/documentSwitch.js.map +7 -0
  176. package/dist/connection/workflows/ConnectedWorkflowsPage.js +10 -3
  177. package/dist/connection/workflows/ConnectedWorkflowsPage.js.map +2 -2
  178. package/dist/connection/workflows/useWorkflowsPageState.d.ts +1 -0
  179. package/dist/connection/workflows/useWorkflowsPageState.js.map +2 -2
  180. package/dist/dashboards/index.cjs +23 -23
  181. package/dist/docx/NativeDocxEditor.js +3 -1
  182. package/dist/docx/NativeDocxEditor.js.map +2 -2
  183. package/dist/docx/index.cjs +38 -38
  184. package/dist/docx/signatures/SignatureFields.d.ts +2 -0
  185. package/dist/docx/signatures/SignatureFields.js +40 -2
  186. package/dist/docx/signatures/SignatureFields.js.map +2 -2
  187. package/dist/embed/index.cjs +50 -50
  188. package/dist/facts/index.cjs +44 -44
  189. package/dist/files/index.cjs +226 -226
  190. package/dist/home/index.cjs +32 -32
  191. package/dist/index.cjs +1694 -1694
  192. package/dist/provider/environment.d.ts +5 -0
  193. package/dist/provider/environment.js +1 -1
  194. package/dist/provider/environment.js.map +2 -2
  195. package/dist/provider/requests.d.ts +2 -0
  196. package/dist/provider/requests.js.map +2 -2
  197. package/dist/retrieval/index.cjs +4 -4
  198. package/dist/settings/index.cjs +147 -147
  199. package/dist/shell/index.cjs +91 -91
  200. package/dist/studio/index.cjs +42 -42
  201. package/dist/styles.css +1 -1
  202. package/dist/workflow-canvas/index.cjs +116 -74
  203. package/dist/workflow-canvas/index.cjs.map +1 -1
  204. package/dist/workspaces/index.cjs +27 -27
  205. package/node_modules/@arbidocs/coedit/package.json +1 -1
  206. package/package.json +5 -5
  207. package/dist/ai-EMNMGDAN.cjs.map +0 -1
  208. package/dist/chunk-4ED7CNOX.cjs.map +0 -1
  209. package/dist/chunk-IFOGBMAE.cjs.map +0 -1
  210. package/dist/chunk-L52N2LVE.cjs +0 -18
  211. package/dist/chunk-U5T46QCS.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/shell/ShellSidebar.tsx","../src/lib/use-close-on-escape.ts","../src/lib/sidebar-mode.ts","../src/shell/use-sidebar-controller.ts","../src/shell/SidebarRowAction.tsx","../src/shell/AskField.tsx","../src/shell/ActionCluster.tsx","../src/shell/StatusRow.tsx","../src/shell/OfflinePill.tsx","../src/shell/RemoteControlPill.tsx","../src/shell/TipCard.tsx","../src/shell/DockZone.tsx","../src/shell/PanelModeSwitcher.tsx","../src/shell/panel-windows.ts","../src/shell/panel-host.ts","../src/shell/PanelPortal.tsx"],"names":["jsxs","Sidebar","jsx","useRef","useEffect","useState","useControllableState","useIsPhone","useIsNarrow","useIsTouchScreen","useCallback","useContext","SidebarRowHoverContext","cn","BlocksTooltipProvider","Tooltip","TooltipTrigger","TooltipContent","testIdOr","Sparkles","Button","Search","ArrowUp","X","useId","STATUS_ROW_TONES","STATUS_ROW_BASE_CLASS","WifiOff","TriangleAlert","RefreshCw","MousePointerClick","Lightbulb","Pencil","ChevronLeft","ChevronRight","containerWidth","useMediaQuery","ExternalLink","PanelRight","PictureInPicture2","useHost","createPortal","PortalContainerProvider","DEFAULT_OVERLAY_ZONE_ID"],"mappings":";;;;;;;;;;;;;;;;AAyCO,SAAS,YAAA,CAAa;AAAA,EAC3B,UA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c,QAAA,CAAS,cAAA,CAAeC,yCAAuB,CAAA;AACnE,IAAA,OAAOF,qBAAA;AAAA,sBACLvC,cAAAA;AAAA,QAAC,YAAA;AAAA,QAAA;AAAA,UACC,OAAA;AAAA,UACA,SAAA;AAAA,UACA,OAAA;AAAA,UACA,YAAA;AAAA,UACA,QAAQ,WAAA,KAAgB,IAAA;AAAA,UAEvB;AAAA;AAAA,OACH;AAAA,MACA,eAAe,QAAA,CAAS;AAAA,KAC1B;AAAA,EACF;AAGA,EAAA,IAAI,SAAS,MAAA,EAAQ;AACnB,IAAA,MAAM,QAAA,GAAW,QAAA,CAAS,cAAA,CAAe,WAAW,CAAA;AACpD,IAAA,IAAI,QAAA,EAAU;AACZ,MAAA,OAAOuC,qBAAA,CAAa,UAAU,QAAQ,CAAA;AAAA,IACxC;AAAA,EACF;AAGA,EAAA,MAAM,QAAA,GAAW,QAAA,CAAS,cAAA,CAAe,WAAW,CAAA;AACpD,EAAA,IAAI,QAAA,EAAU;AACZ,IAAA,OAAOA,qBAAA,CAAa,UAAU,QAAQ,CAAA;AAAA,EACxC;AAGA,EAAA,OAAO,IAAA;AACT","file":"chunk-5VCID67B.cjs","sourcesContent":["import type { ReactNode } from 'react'\nimport { Sidebar, type SidebarRootProps } from './Sidebar'\nimport type { SidebarController } from './use-sidebar-controller'\nimport type { NavItem, NavSection } from './types'\n\nexport interface ShellSidebarProps extends Pick<\n SidebarRootProps,\n 'className' | 'aria-label' | 'labels' | 'backdropTestId'\n> {\n /** From `useSidebarController`: layout, hover/pin/drawer behaviour. */\n controller: SidebarController\n /** Brand mark of the phone drawer's header (logo + close). Omit for no drawer header. */\n drawerLogo?: ReactNode\n /** `data-testid` of the drawer's close button. */\n drawerCloseTestId?: string\n /** Top block (workspace switcher, ask field, pin toggle). Read `controller.expanded` for the rail. */\n header?: ReactNode\n /** Rows as data. */\n items?: NavItem[]\n /** Labelled groups of rows as data, after `items`. */\n sections?: NavSection[]\n navClassName?: string\n /**\n * Width-bound cards at the top of the footer (smart tips, notices): shown only once the panel\n * has settled open, and gone the instant it starts to close.\n */\n tips?: ReactNode\n /** The rest of the footer (status rows, account rows). */\n footer?: ReactNode\n /** Root `data-testid` (default `sidebar`). */\n 'data-testid'?: string\n}\n\n/**\n * The whole sidebar from a controller and data: `Sidebar.Root` in the resolved mode, the phone\n * drawer header, the header slot, the nav rows/groups and the footer. Renders nothing while the\n * layout is hidden (a phone with the drawer closed), so no clipped rows carry duplicate test ids.\n *\n * const sidebar = useSidebarController({ isPinned, onPinnedChange: setPinned })\n * <ShellSidebar controller={sidebar} header={…} items={nav} footer={…} />\n */\nexport function ShellSidebar({\n controller,\n drawerLogo,\n drawerCloseTestId,\n header,\n items,\n sections,\n navClassName,\n tips,\n footer,\n ...rootProps\n}: ShellSidebarProps) {\n if (controller.layout.hidden) return null\n return (\n <Sidebar.Root {...controller.rootProps} {...rootProps}>\n {controller.isDrawer && drawerLogo && (\n <Sidebar.DrawerHeader\n logo={drawerLogo}\n onClose={controller.closeDrawer}\n data-testid={drawerCloseTestId}\n />\n )}\n {header && <Sidebar.Header>{header}</Sidebar.Header>}\n <Sidebar.Nav items={items} sections={sections} className={navClassName} />\n {(tips || footer) && (\n <Sidebar.Footer>\n {controller.tipsVisible && tips}\n {footer}\n </Sidebar.Footer>\n )}\n </Sidebar.Root>\n )\n}\n","import { useEffect, useRef } from 'react'\n\n/**\n * While `isActive`, Escape calls `onClose`. For surfaces that float over the page without being a\n * modal (no backdrop, no focus trap), so nothing else closes them from the keyboard. An Escape a\n * dialog already handled (`defaultPrevented`) is left alone so one press closes one layer.\n */\nexport function useCloseOnEscape(isActive: boolean, onClose: () => void): void {\n const onCloseRef = useRef(onClose)\n useEffect(() => {\n onCloseRef.current = onClose\n })\n\n useEffect(() => {\n if (!isActive) return\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Escape' && !e.defaultPrevented) onCloseRef.current()\n }\n document.addEventListener('keydown', onKeyDown)\n return () => document.removeEventListener('keydown', onKeyDown)\n }, [isActive])\n}\n","import { useEffect, useRef, useState } from 'react'\n\n/**\n * Headless sidebar behaviour (no DOM, no store): how the sidebar lays out for a given set of\n * inputs, and the settle timing that keeps labels/tips from squeezing during the width transition.\n *\n * - `drawer` small-screen off-canvas panel (opened by the app bar's menu button)\n * - `collapsed` hidden (width 0): a phone with the drawer closed, or `isCollapsed`\n * - `pinned` full width, inline, pushes the content\n * - `rail` icon strip that floats open to full width while hovered\n */\nexport type SidebarMode = 'drawer' | 'collapsed' | 'pinned' | 'rail'\n\nexport interface SidebarModeInput {\n isSmallScreen: boolean\n /** The phone drawer was requested open. */\n isDrawerRequested: boolean\n isCollapsed: boolean\n isPinned: boolean\n isHovering: boolean\n /**\n * Tablet-width viewport (above the phone drawer breakpoint but too narrow to give the content a\n * usable column next to a 255px panel): pinning is ignored and the sidebar stays an icon rail.\n */\n isNarrow?: boolean\n}\n\nexport interface SidebarLayout {\n mode: SidebarMode\n /** Labels should be shown (the panel is, or is becoming, full width). */\n expanded: boolean\n /** Phones: nothing is rendered until the drawer opens. */\n hidden: boolean\n /** Hover state that actually applies (never on touch-sized screens). */\n hovering: boolean\n}\n\nexport function resolveSidebarLayout(input: SidebarModeInput): SidebarLayout {\n const { isSmallScreen, isDrawerRequested, isCollapsed, isPinned, isHovering } = input\n const canPin = isPinned && !isSmallScreen && !input.isNarrow\n const drawerOpen = isSmallScreen && isDrawerRequested\n // Small screens are drawer-only: when it is closed the panel is fully off-canvas\n // regardless of pinning (pinning is a desktop concept), and hover never expands.\n const effectiveCollapsed = isCollapsed || (isSmallScreen && !drawerOpen)\n const hovering = isHovering && !isSmallScreen\n\n let mode: SidebarMode\n if (drawerOpen) mode = 'drawer'\n else if (effectiveCollapsed) mode = 'collapsed'\n else if (canPin) mode = 'pinned'\n else mode = 'rail'\n\n // `hovering`, not `isHovering`: a stale hover flag must not report a hidden phone sidebar as expanded.\n const expanded = drawerOpen || (!effectiveCollapsed && (canPin || hovering))\n\n return { mode, expanded, hidden: isSmallScreen && !drawerOpen, hovering }\n}\n\n/**\n * Settle timing around the width transition (default 300ms):\n * - `labelsExpanded` switches on immediately but off only after the transition, so labels do not\n * snap to icon-only while the panel is still wide;\n * - `tipsVisible` is the opposite: width-bound content (a tip card) appears only once the panel\n * has fully opened and disappears the instant collapse starts.\n */\nexport function useSidebarSettle(expanded: boolean, settleMs = 300) {\n const [labelsExpanded, setLabelsExpanded] = useState(expanded)\n const [tipsVisible, setTipsVisible] = useState(expanded)\n const labelsTimer = useRef<ReturnType<typeof setTimeout> | null>(null)\n const tipsTimer = useRef<ReturnType<typeof setTimeout> | null>(null)\n\n useEffect(() => {\n if (labelsTimer.current) clearTimeout(labelsTimer.current)\n if (expanded) setLabelsExpanded(true)\n else labelsTimer.current = setTimeout(() => setLabelsExpanded(false), settleMs)\n return () => {\n if (labelsTimer.current) clearTimeout(labelsTimer.current)\n }\n }, [expanded, settleMs])\n\n useEffect(() => {\n if (tipsTimer.current) clearTimeout(tipsTimer.current)\n if (expanded) tipsTimer.current = setTimeout(() => setTipsVisible(true), settleMs)\n else setTipsVisible(false)\n return () => {\n if (tipsTimer.current) clearTimeout(tipsTimer.current)\n }\n }, [expanded, settleMs])\n\n return { labelsExpanded, tipsVisible }\n}\n","import { useCallback, useEffect, useRef, type PointerEvent } from 'react'\nimport { useControllableState } from '../lib/useControllableState'\nimport { useCloseOnEscape } from '../lib/use-close-on-escape'\nimport { useIsNarrow, useIsPhone, useIsTouchScreen } from '../lib/use-media-query'\nimport { resolveSidebarLayout, useSidebarSettle, type SidebarLayout } from '../lib/sidebar-mode'\nimport type { SidebarRootProps } from './Sidebar'\n\nexport interface UseSidebarControllerOptions {\n /** Pinned open (desktop). Controlled when set; otherwise kept here, seeded by `defaultPinned`. */\n isPinned?: boolean\n /** Default `true`. */\n defaultPinned?: boolean\n onPinnedChange?: (isPinned: boolean) => void\n /** The rail is floated open (hover, or its toggle at a narrow width). Controlled when set. */\n isHovering?: boolean\n onHoveringChange?: (isHovering: boolean) => void\n /** The phone drawer is open. Controlled when set (the app bar's menu button opens it). */\n isDrawerOpen?: boolean\n onDrawerOpenChange?: (isDrawerOpen: boolean) => void\n /**\n * Keep the sidebar a rail even when pinned, on top of the tablet width (for example while a\n * docked panel squeezes the content). The stored pin is left untouched.\n */\n forceRail?: boolean\n /**\n * Which rails expand on pointer enter. The default ignores narrow and emulated touch hover;\n * `all` retains hover expansion for a host whose narrow rail has no separate expand button.\n */\n hoverExpansion?: 'desktop-pointer' | 'all'\n}\n\n/** The `Sidebar.Root` props the controller resolves. */\nexport type SidebarControllerRootProps = Pick<\n SidebarRootProps,\n | 'mode'\n | 'expanded'\n | 'isHovering'\n | 'onBackdropClick'\n | 'hasRailBackdrop'\n | 'onPointerEnter'\n | 'onPointerLeave'\n>\n\nexport interface SidebarController {\n layout: SidebarLayout\n /** Labels shown (settled: they stay on until the closing transition ends). */\n expanded: boolean\n /** Width-bound content (tips, notices) may show: on once fully open, off as closing starts. */\n tipsVisible: boolean\n /** The phone drawer is showing. */\n isDrawer: boolean\n isSmallScreen: boolean\n /** Tablet width (or `forceRail`): pinning is ignored and the sidebar stays a rail. */\n isNarrow: boolean\n /** The pin as it applies (always off while narrow). */\n isPinned: boolean\n /** Spread onto `Sidebar.Root` (or pass the controller to `ShellSidebar`). */\n rootProps: SidebarControllerRootProps\n openDrawer: () => void\n closeDrawer: () => void\n /** The pin toggle: pins/unpins, or floats the rail open/closed while narrow. */\n togglePin: () => void\n /** Open from the rail (its ask button): pins, or floats the rail open while narrow. */\n expand: () => void\n /** After a nav row is chosen: closes the drawer, and a floated rail the pointer has left. */\n afterNavigate: () => void\n}\n\n// A menu opened from the rail (the account menu) is positioned against the sidebar's current\n// layout. Hovering that menu from the content would expand the rail, re-anchor the menu under\n// the pointer and move the item being clicked, so hover does not expand the rail while one is open.\nconst isMenuOpen = () =>\n typeof document !== 'undefined' &&\n document.querySelector('[role=\"menu\"][data-state=\"open\"]') !== null\n\n/**\n * Sidebar behaviour as one hook, shared by every shell: resolves the layout (drawer / pinned /\n * rail) for the viewport, settles labels and tips around the width transition, and owns the hover,\n * pin and drawer rules:\n * - touch: the rail opens only through its toggle, never by the pointer enter of a tap;\n * - narrow: a pointer drifting over the rail does not float the labels over the content;\n * - Escape closes a floated rail; the drawer closes itself when the viewport grows past a phone;\n * - choosing a row closes the drawer, and a floated rail unless the pointer is still over it.\n *\n * State is controlled per field (`isPinned`, `isHovering`, `isDrawerOpen`) so an app can keep it\n * in its own store, or uncontrolled for a shell that does not care.\n */\nexport function useSidebarController(options: UseSidebarControllerOptions = {}): SidebarController {\n const [storedPinned, setPinned] = useControllableState(\n options.isPinned,\n options.defaultPinned ?? true,\n options.onPinnedChange\n )\n const [isHovering, setHovering] = useControllableState(\n options.isHovering,\n false,\n options.onHoveringChange\n )\n const [isDrawerOpen, setDrawerOpen] = useControllableState(\n options.isDrawerOpen,\n false,\n options.onDrawerOpenChange\n )\n\n const isSmallScreen = useIsPhone()\n const isNarrow = useIsNarrow() || !!options.forceRail\n const isTouch = useIsTouchScreen()\n\n const layout = resolveSidebarLayout({\n isSmallScreen,\n isDrawerRequested: isDrawerOpen,\n isCollapsed: false,\n isPinned: storedPinned,\n isHovering,\n isNarrow,\n })\n const isDrawer = layout.mode === 'drawer'\n const { labelsExpanded, tipsVisible } = useSidebarSettle(layout.expanded)\n\n // Whether the pointer is physically over the sidebar (decides if navigating closes the rail).\n const isPointerOver = useRef(false)\n\n const closeDrawer = useCallback(() => setDrawerOpen(false), [setDrawerOpen])\n const openDrawer = useCallback(() => setDrawerOpen(true), [setDrawerOpen])\n\n // The floated rail has no modal behaviour (the drawer gets Escape from `Sidebar.Root`).\n useCloseOnEscape(layout.mode === 'rail' && layout.hovering, () => setHovering(false))\n\n // A drawer left open when the viewport grows past a phone (rotate/resize) would be a stuck overlay.\n useEffect(() => {\n if (isDrawerOpen && !isSmallScreen) setDrawerOpen(false)\n }, [isDrawerOpen, isSmallScreen, setDrawerOpen])\n\n const onPointerEnter = (event: PointerEvent<HTMLElement>) => {\n // Primary-input media queries can report touch even while a mouse is in use.\n if (event.pointerType !== 'mouse' && options.hoverExpansion !== 'all') return\n isPointerOver.current = true\n if (\n !isSmallScreen &&\n (!isNarrow || options.hoverExpansion === 'all') &&\n (!isMenuOpen() || options.hoverExpansion === 'all')\n )\n setHovering(true)\n }\n const onPointerLeave = (event: PointerEvent<HTMLElement>) => {\n if (event.pointerType !== 'mouse' && options.hoverExpansion !== 'all') return\n isPointerOver.current = false\n if (!isSmallScreen) setHovering(false)\n }\n\n return {\n layout,\n expanded: labelsExpanded,\n tipsVisible,\n isDrawer,\n isSmallScreen,\n isNarrow,\n isPinned: storedPinned && !isNarrow,\n rootProps: {\n mode: layout.mode,\n expanded: labelsExpanded,\n isHovering: layout.hovering,\n onBackdropClick: isDrawer ? closeDrawer : () => setHovering(false),\n hasRailBackdrop: isTouch,\n onPointerEnter,\n onPointerLeave,\n },\n openDrawer,\n closeDrawer,\n togglePin: () => (isNarrow ? setHovering(!isHovering) : setPinned(!storedPinned)),\n expand: () => (isNarrow ? setHovering(true) : setPinned(true)),\n afterNavigate: () => {\n if (!isPointerOver.current && !storedPinned) setHovering(false)\n if (isDrawer) closeDrawer()\n },\n }\n}\n","import { useContext, type ReactNode } from 'react'\nimport { cn, Tooltip, TooltipContent, TooltipTrigger } from '@arbidocs/react/ui'\nimport { BlocksTooltipProvider } from '../provider/TooltipScope'\nimport { SidebarRowHoverContext } from './Sidebar'\n\nexport type SidebarRowActionPulse = 'active' | 'success' | 'error'\n\nexport interface SidebarRowActionProps {\n /** The row this control sits on is selected: the glyph takes the selection ink. */\n active?: boolean\n onClick?: () => void\n /** Tooltip text and accessible label. */\n label: string\n /**\n * Demand attention while the row is idle: `active` pulses primary (work in progress),\n * `success` pulses green (just finished), `error` is a steady red alert. A selected row wins.\n */\n pulse?: SidebarRowActionPulse | null\n 'data-testid'?: string\n children: ReactNode\n}\n\nconst PULSE_STYLES: Record<SidebarRowActionPulse, string> = {\n active: 'animate-pulse-attention text-primary',\n success: 'animate-pulse-attention text-green-text',\n // Steady (not animated) so a failure stays put and reads as a standing alert.\n error: 'text-red-text opacity-100',\n}\n\n/**\n * The secondary control at the right edge of a sidebar row: a small muted glyph. Always visible\n * (touch has no hover); hovering or focusing the row only brightens it a tone, through\n * SidebarRowHoverContext. Stops propagation so it never triggers the row's own click.\n */\nexport function SidebarRowAction({\n active = false,\n onClick,\n label,\n pulse = null,\n 'data-testid': testId,\n children,\n}: SidebarRowActionProps) {\n const rowHovered = useContext(SidebarRowHoverContext)\n\n const tone = active\n ? 'text-accent-foreground hover:bg-background/60'\n : pulse\n ? `${PULSE_STYLES[pulse]} hover:bg-muted`\n : cn(\n 'text-muted-foreground hover:bg-muted hover:text-foreground',\n rowHovered ? 'opacity-100' : 'opacity-70'\n )\n\n return (\n <BlocksTooltipProvider>\n <Tooltip>\n <TooltipTrigger asChild onFocusCapture={(e) => e.stopPropagation()}>\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation()\n onClick?.()\n }}\n aria-label={label}\n data-slot=\"sidebar-row-action\"\n data-testid={testId}\n className={cn('rounded-md p-1 transition-colors pointer-coarse:p-2.5', tone)}\n >\n {children}\n </button>\n </TooltipTrigger>\n <TooltipContent side=\"right\">{label}</TooltipContent>\n </Tooltip>\n </BlocksTooltipProvider>\n )\n}\n","import type { InputHTMLAttributes, KeyboardEvent, ReactNode, Ref } from 'react'\nimport { ArrowUp, Search, Sparkles, X } from 'lucide-react'\nimport { Button, cn } from '@arbidocs/react/ui'\nimport { testIdOr } from '../chat/test-id'\n\n/** Fixed strings of the ask field, its trigger and the expanded row. */\nexport interface AskFieldLabels {\n /** Input placeholder (the `placeholder` prop wins). */\n placeholder: string\n /** The input's accessible name. */\n inputLabel: string\n search: string\n askAi: string\n /** The icon-only trigger. */\n askOrSearch: string\n closeSearch: string\n}\n\nexport const DEFAULT_ASK_FIELD_LABELS: AskFieldLabels = {\n placeholder: 'Ask or search…',\n inputLabel: 'Ask AI or search your documents',\n search: 'Search',\n askAi: 'Ask AI',\n askOrSearch: 'Ask AI or search',\n closeSearch: 'Close search',\n}\n\nexport interface AskFieldProps {\n value: string\n onValueChange: (value: string) => void\n /** Enter / the arrow button: ask AI. */\n onAsk: (text: string) => void\n /** The magnifier button: semantic search. */\n onSearch: (text: string) => void\n /** Intercept keys first (e.g. a slash menu); call `preventDefault` to stop the default Enter-asks. */\n onInputKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void\n /** Rendered just under the field at its width (a slash/autocomplete menu). */\n menu?: ReactNode\n inputRef?: Ref<HTMLInputElement>\n /** Extra attributes for the input, e.g. the combobox props of `useListKeyNav` for a slash menu. */\n inputProps?: InputHTMLAttributes<HTMLInputElement>\n placeholder?: string\n labels?: Partial<AskFieldLabels>\n autoFocus?: boolean\n className?: string\n /** Root id (default `workspace-ask-bar`); the input/search/submit ids are `<root>-input|search|submit`. */\n 'data-testid'?: string\n}\n\n/**\n * The compact one-line ask/search field: sparkle, input, then two icon doors (Search, Ask AI).\n * Text and the menu are controlled by the host, so the same field serves the sidebar, the phone\n * app bar and any custom shell.\n */\nexport function AskField({\n value,\n onValueChange,\n onAsk,\n onSearch,\n onInputKeyDown,\n menu,\n inputRef,\n inputProps,\n placeholder,\n labels,\n autoFocus = false,\n className,\n 'data-testid': testIdProp,\n}: AskFieldProps) {\n const testId = testIdOr(testIdProp, { testId: 'workspace-ask-bar' })\n const l = { ...DEFAULT_ASK_FIELD_LABELS, ...labels }\n const isEmpty = !value.trim()\n const submit = (handler: (text: string) => void) => {\n const text = value.trim()\n if (text) handler(text)\n }\n\n return (\n <div className={cn('relative', className)} data-slot=\"ask-field\" data-testid={testId}>\n {menu && <div className=\"absolute inset-x-0 top-9 z-30\">{menu}</div>}\n <div\n role=\"search\"\n className=\"flex h-9 items-center gap-0.5 rounded-md border border-border bg-background pl-2.5 pr-0.5 transition-colors focus-within:border-primary focus-within:ring-3 focus-within:ring-primary pointer-coarse:h-11\"\n >\n <Sparkles aria-hidden=\"true\" className=\"size-4 shrink-0 text-ai-ink\" />\n <input\n {...inputProps}\n ref={inputRef}\n type=\"text\"\n value={value}\n onChange={(e) => onValueChange(e.target.value)}\n onKeyDown={(e) => {\n onInputKeyDown?.(e)\n // Enter asks (not mid-IME-composition). A plain div, not a <form>.\n if (e.defaultPrevented) return\n if (e.key === 'Enter' && !e.nativeEvent.isComposing) {\n e.preventDefault()\n submit(onAsk)\n }\n }}\n placeholder={placeholder ?? l.placeholder}\n aria-label={l.inputLabel}\n autoFocus={autoFocus}\n className=\"ml-1.5 h-8 min-w-0 flex-1 bg-transparent pointer-coarse:h-11 text-sm text-foreground outline-none placeholder:text-muted-foreground\"\n data-testid={`${testId}-input`}\n />\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n disabled={isEmpty}\n onClick={() => submit(onSearch)}\n title={l.search}\n aria-label={l.search}\n className=\"size-7 shrink-0 text-muted-foreground hover:text-foreground pointer-coarse:size-10\"\n data-testid={`${testId}-search`}\n >\n <Search className=\"size-4\" />\n </Button>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n disabled={isEmpty}\n onClick={() => submit(onAsk)}\n title={l.askAi}\n aria-label={l.askAi}\n className=\"!inline-flex size-7 shrink-0 text-ai-ink hover:bg-ai-soft hover:text-ai-ink pointer-coarse:size-10\"\n data-testid={`${testId}-submit`}\n >\n <ArrowUp className=\"size-4\" />\n </Button>\n </div>\n </div>\n )\n}\n\nexport interface AskTriggerProps {\n /** Opens the ask field (or the palette): one action that asks AI and searches. */\n onClick: () => void\n /** `rail`: the icon-only sidebar's bordered tile; `appbar`: the phone app bar's bare icon. */\n variant?: 'rail' | 'appbar'\n labels?: Partial<Pick<AskFieldLabels, 'askOrSearch'>>\n 'data-testid'?: string\n}\n\n/** The icon that stands in for the field where there is no room for it. */\nexport function AskTrigger({\n onClick,\n variant = 'rail',\n labels,\n 'data-testid': testId,\n}: AskTriggerProps) {\n const text = labels?.askOrSearch ?? DEFAULT_ASK_FIELD_LABELS.askOrSearch\n return (\n <button\n type=\"button\"\n onClick={onClick}\n title={text}\n aria-label={text}\n data-slot=\"ask-trigger\"\n data-testid={testId}\n className={cn(\n 'flex items-center justify-center rounded-md text-ai-ink transition-colors hover:bg-ai-soft',\n variant === 'rail'\n ? 'h-9 w-12 border border-border bg-background pointer-coarse:h-11'\n : 'size-11'\n )}\n >\n <Sparkles className={variant === 'rail' ? 'size-4' : 'size-5'} />\n </button>\n )\n}\n\nexport interface AskRowProps {\n /** The field (an AskField). */\n children: ReactNode\n onClose: () => void\n labels?: Partial<Pick<AskFieldLabels, 'closeSearch'>>\n /** Row id (default `workspace-ask-bar-expanded`). */\n 'data-testid'?: string\n /** Collapse button id (default `workspace-ask-bar-collapse`). */\n collapseTestId?: string\n}\n\n/** The phone's expanded ask row: takes over the app bar so there is room to type; Escape closes. */\nexport function AskRow({\n children,\n onClose,\n labels,\n 'data-testid': testId,\n collapseTestId,\n}: AskRowProps) {\n return (\n <div\n className=\"flex h-14 flex-shrink-0 items-center gap-1 bg-background px-3 pt-safe\"\n data-slot=\"ask-row\"\n data-testid={testIdOr(testId, { testId: 'workspace-ask-bar-expanded' })}\n onKeyDown={(e) => {\n if (e.key === 'Escape' && !e.defaultPrevented) onClose()\n }}\n >\n <div className=\"min-w-0 flex-1\">{children}</div>\n <button\n type=\"button\"\n onClick={onClose}\n aria-label={labels?.closeSearch ?? DEFAULT_ASK_FIELD_LABELS.closeSearch}\n data-testid={testIdOr(collapseTestId, { testId: 'workspace-ask-bar-collapse' })}\n className=\"flex size-11 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground\"\n >\n <X className=\"size-5\" />\n </button>\n </div>\n )\n}\n","import { useId, type MouseEvent, type ReactNode } from 'react'\nimport type { ShellActionLayout } from './types'\n\nexport interface ActionClusterProps {\n /**\n * `bar`: one row for a page header or phone app bar (status, bell, contacts, account).\n * `sidebar`: the bottom of the expanded sidebar: the bell and contacts rows stacked above the\n * account row.\n * `rail`: the same stack on the icon-only rail (same order, icon-only rows).\n * `drawer`: the phone drawer's rows (bell and contacts only; the app bar carries the account).\n */\n layout?: ShellActionLayout\n /** Status pill (remote control); `bar` only. Other layouts show status in their own rows. */\n status?: ReactNode\n /** Report a problem (bug icon), first in the cluster. */\n report?: ReactNode\n /** Notification bell (the kit's NotificationBell, or a `Sidebar.BadgeRow`). */\n mail?: ReactNode\n /** Calendar entry (a `Sidebar.BadgeRow`), right after mail. */\n calendar?: ReactNode\n /** Databases entry (a `Sidebar.BadgeRow`), right after calendar. */\n databases?: ReactNode\n bell?: ReactNode\n /** Contacts / messages entry with its own badge (a `Sidebar.BadgeRow`). */\n contacts?: ReactNode\n /** Account menu (the kit's UserMenu). */\n account?: ReactNode\n /**\n * Names the cluster: the group's accessible name in every layout, and a visible heading above\n * the rows in the `drawer` layout (where phones otherwise get unlabelled rows).\n */\n label?: string\n 'data-testid'?: string\n}\n\n/**\n * The account area: notifications, contacts and the account menu, in one of four placements. In\n * the sidebar and on the rail the two badge rows are stacked above the account row in the same\n * order, so nothing moves when the rail expands; the account menu holds everything else (help,\n * settings, tips, processing).\n */\nexport function ActionCluster({\n layout = 'bar',\n status,\n report,\n mail,\n calendar,\n databases,\n bell,\n contacts,\n account,\n label,\n 'data-testid': testId = 'sidebar-actions',\n}: ActionClusterProps) {\n const labelId = useId()\n // Dashboard's content area resets focus on click, and Radix PORTALS bubble through the React\n // tree: stop clicks here or a dropdown item (e.g. \"View all\") would un-focus the panel it opened.\n const stop = (e: MouseEvent) => e.stopPropagation()\n\n if (layout === 'sidebar' || layout === 'rail' || layout === 'drawer') {\n const rail = layout === 'rail'\n return (\n <div\n className={rail ? 'flex flex-col items-center gap-0.5' : 'flex flex-col gap-0.5'}\n onClick={stop}\n role={label ? 'group' : undefined}\n aria-labelledby={label && layout === 'drawer' ? labelId : undefined}\n aria-label={label && layout !== 'drawer' ? label : undefined}\n data-slot=\"action-cluster\"\n data-layout={layout}\n data-testid={testId}\n >\n {label && layout === 'drawer' && (\n <p\n id={labelId}\n className=\"px-3 pb-1 pt-2 text-xs font-semibold uppercase tracking-wider text-muted-foreground\"\n data-slot=\"action-cluster-label\"\n >\n {label}\n </p>\n )}\n {bell}\n {mail}\n {calendar}\n {databases}\n {contacts}\n {report}\n {account && layout !== 'drawer' && (\n <div className={rail ? 'mt-1' : 'mt-1 min-w-0'}>{account}</div>\n )}\n </div>\n )\n }\n\n return (\n <div\n className=\"flex items-center gap-1\"\n onClick={stop}\n role={label ? 'group' : undefined}\n aria-label={label}\n data-slot=\"action-cluster\"\n >\n {status}\n {report}\n {mail}\n {calendar}\n {databases}\n {bell}\n {contacts}\n {account}\n </div>\n )\n}\n","import { X } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { STATUS_ROW_BASE_CLASS, STATUS_ROW_TONES } from './status-row-styles'\n\nexport type StatusRowTone = 'progress' | 'success' | 'error'\n\nexport interface StatusRowProps {\n tone: StatusRowTone\n /** e.g. \"Processing 3 files…\". Always the accessible name; hidden visually when `compact`. */\n label: string\n /** Opens the thing the status is about (the processing panel). */\n onClick: () => void\n /** Icon-only (the collapsed rail). */\n compact?: boolean\n 'data-testid'?: string\n}\n\n/**\n * A live status line for the sidebar footer: a spinner and a short sentence that opens the\n * thing it reports on. The host renders it ONLY while the state is relevant (work running,\n * something failed), so a quiet app shows nothing. Announced politely to screen readers.\n */\nexport function StatusRow({\n tone,\n label,\n onClick,\n compact = false,\n 'data-testid': testId,\n}: StatusRowProps) {\n const { className, Icon, spin } = STATUS_ROW_TONES[tone]\n return (\n <div role=\"status\" data-slot=\"status-row\" className={cn(compact && 'flex justify-center')}>\n <button\n type=\"button\"\n onClick={onClick}\n aria-label={label}\n title={label}\n data-testid={testId}\n data-tone={tone}\n className={cn(\n STATUS_ROW_BASE_CLASS,\n compact ? 'size-9 justify-center pointer-coarse:size-11' : 'w-full px-2.5 py-1.5',\n className\n )}\n >\n <Icon\n className={cn('size-4 shrink-0', spin && 'animate-spin motion-reduce:animate-none')}\n />\n {!compact && <span className=\"min-w-0 flex-1 truncate text-left\">{label}</span>}\n </button>\n </div>\n )\n}\n\n/** Short live state at a navigation row's right edge, replacing inventory counts. */\nexport function StatusBadge({\n tone,\n label,\n onClick,\n onDismiss,\n 'data-testid': testId,\n}: {\n tone: StatusRowTone\n label: string\n onClick?: () => void\n onDismiss?: () => void\n 'data-testid'?: string\n}) {\n const className = cn(\n 'rounded-md px-1.5 py-0.5 text-xs font-medium whitespace-nowrap',\n STATUS_ROW_TONES[tone].className\n )\n return (\n <span\n role=\"status\"\n className={cn(\n 'ml-auto inline-flex items-center rounded-md',\n STATUS_ROW_TONES[tone].className\n )}\n data-testid={testId}\n data-tone={tone}\n >\n {onClick ? (\n <button\n type=\"button\"\n title={label}\n className={className}\n onClick={(event) => {\n event.stopPropagation()\n onClick()\n }}\n onKeyDown={(event) => event.stopPropagation()}\n >\n {label}\n </button>\n ) : (\n <span className={className}>{label}</span>\n )}\n {onDismiss && (\n <button\n type=\"button\"\n aria-label={`Dismiss ${label}`}\n title=\"Dismiss\"\n className=\"mr-1 rounded-sm p-0.5 opacity-60 hover:opacity-100 focus-visible:ring-2 focus-visible:ring-ring\"\n onClick={(event) => {\n event.stopPropagation()\n onDismiss()\n }}\n onKeyDown={(event) => event.stopPropagation()}\n >\n <X className=\"size-3\" />\n </button>\n )}\n </span>\n )\n}\n","import { RefreshCw, TriangleAlert, WifiOff } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { testIdOr } from '../chat/test-id'\nimport { SidebarRowHoverContext } from './Sidebar'\nimport { SidebarRowAction } from './SidebarRowAction'\n\nexport type OfflinePillTone = 'offline' | 'failed' | 'syncing'\n\n/** Fixed strings of the offline pill. */\nexport interface OfflinePillLabels {\n reconnect: string\n}\n\nexport const DEFAULT_OFFLINE_PILL_LABELS: OfflinePillLabels = {\n reconnect: 'Reconnect',\n}\n\nexport interface OfflinePillProps {\n tone: OfflinePillTone\n /** e.g. \"Offline · 3 pending\", \"2 failed to sync\", \"Syncing 4…\". */\n label: string\n /** Icon-only (the collapsed rail / app bar). */\n compact?: boolean\n /** Opens the pending-changes list. */\n onOpen: () => void\n /** Offered beside the pill (only when not compact); pass it only while it can do something. */\n onReconnect?: () => void\n labels?: Partial<OfflinePillLabels>\n /** Pill button id (default `offline-sync-status`). */\n 'data-testid'?: string\n /** Reconnect button id (default `offline-reconnect-button`). */\n reconnectTestId?: string\n}\n\nconst TONES: Record<OfflinePillTone, { className: string; Icon: typeof WifiOff }> = {\n offline: { className: 'bg-yellow-bg text-yellow-text', Icon: WifiOff },\n failed: { className: 'bg-red-bg text-red-text', Icon: TriangleAlert },\n syncing: { className: 'bg-blue-bg text-blue-text', Icon: RefreshCw },\n}\n\n/**\n * Connection + sync indicator: a status pill that opens the pending-changes list, plus an\n * optional Reconnect button beside it. The app renders it only when there is something to say\n * (offline, or changes waiting/failing), so online-and-synced stays clean.\n */\nexport function OfflinePill({\n tone,\n label,\n compact = false,\n onOpen,\n onReconnect,\n labels,\n 'data-testid': testId,\n reconnectTestId,\n}: OfflinePillProps) {\n const { className, Icon } = TONES[tone]\n return (\n <div\n className={cn('flex items-center gap-1', compact && 'justify-center')}\n data-slot=\"offline-pill\"\n >\n <button\n type=\"button\"\n data-testid={testIdOr(testId, { testId: 'offline-sync-status' })}\n aria-label={label}\n title={label}\n onClick={onOpen}\n className={cn(\n 'flex min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-md px-2.5 py-1.5 text-sm font-medium transition-colors hover:brightness-95 pointer-coarse:min-h-11',\n compact && 'flex-none justify-center',\n className\n )}\n >\n <Icon className={cn('size-4 shrink-0', tone === 'syncing' && 'animate-spin')} />\n {!compact && <span className=\"truncate\">{label}</span>}\n </button>\n {!compact && onReconnect && (\n // Forced visible (context true): there is no row to hover.\n <SidebarRowHoverContext.Provider value={true}>\n <SidebarRowAction\n label={labels?.reconnect ?? DEFAULT_OFFLINE_PILL_LABELS.reconnect}\n onClick={onReconnect}\n data-testid={testIdOr(reconnectTestId, { testId: 'offline-reconnect-button' })}\n >\n <RefreshCw className=\"size-5\" />\n </SidebarRowAction>\n </SidebarRowHoverContext.Provider>\n )}\n </div>\n )\n}\n","import { MousePointerClick, X } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { testIdOr } from '../chat/test-id'\n\n/** Fixed strings of the remote-control pill. */\nexport interface RemoteControlPillLabels {\n /** The disable button (the `disableLabel` prop wins). */\n turnOffRemoteControl: string\n}\n\nexport const DEFAULT_REMOTE_CONTROL_PILL_LABELS: RemoteControlPillLabels = {\n turnOffRemoteControl: 'Turn off remote control',\n}\n\nexport interface RemoteControlPillProps {\n /** A run is actively driving the screen (tinted + pulsing). */\n isActive: boolean\n label: string\n onDisable: () => void\n disableLabel?: string\n labels?: Partial<RemoteControlPillLabels>\n /** Root id (default `remote-control-indicator`). */\n 'data-testid'?: string\n /** Disable button id (default `remote-control-indicator-disable`). */\n disableTestId?: string\n}\n\n/**\n * Persistent, unobtrusive status pill shown while remote control is on or a run is executing,\n * with a one-click disable. The app decides when to mount it.\n */\nexport function RemoteControlPill({\n isActive,\n label,\n onDisable,\n disableLabel: disableLabelProp,\n labels,\n 'data-testid': testId,\n disableTestId,\n}: RemoteControlPillProps) {\n const disableLabel =\n disableLabelProp ??\n labels?.turnOffRemoteControl ??\n DEFAULT_REMOTE_CONTROL_PILL_LABELS.turnOffRemoteControl\n return (\n <div\n data-slot=\"remote-control-pill\"\n // Remote control's own control: a remote run never acts inside it.\n data-remote-control-surface=\"\"\n data-testid={testIdOr(testId, { testId: 'remote-control-indicator' })}\n className={cn(\n 'flex min-w-0 max-w-full items-center gap-1.5 rounded-full py-1 pl-2.5 pr-1 text-xs font-medium',\n isActive ? 'bg-accent text-accent-foreground' : 'bg-muted text-muted-foreground'\n )}\n >\n <MousePointerClick className={cn('size-3.5 shrink-0', isActive && 'animate-pulse')} />\n <span className=\"min-w-0 max-w-[16rem] truncate\">{label}</span>\n <button\n type=\"button\"\n onClick={onDisable}\n title={disableLabel}\n aria-label={disableLabel}\n data-testid={testIdOr(disableTestId, { testId: 'remote-control-indicator-disable' })}\n className=\"flex size-5 shrink-0 items-center justify-center rounded-full transition-colors hover:bg-foreground/10 hover:text-foreground pointer-coarse:size-8\"\n >\n <X className=\"size-3.5\" />\n </button>\n </div>\n )\n}\n","import type { ReactNode } from 'react'\nimport { ChevronLeft, ChevronRight, Lightbulb, Pencil, X } from 'lucide-react'\nimport { Button, cn } from '@arbidocs/react/ui'\nimport { testIdOr } from '../chat/test-id'\n\n/** Fixed strings of the tip card. */\nexport interface TipCardLabels {\n /** Default CTA text (the `ctaLabel` prop wins). */\n showMe: string\n previousTip: string\n nextTip: string\n editTip: string\n /** The card's heading and accessible name. */\n tip: string\n /** The dismiss button: it turns tips off (they come back from the account menu). */\n hideTips: string\n /** \"1 of 3\". */\n position: (index: number, count: number) => string\n}\n\nexport const DEFAULT_TIP_CARD_LABELS: TipCardLabels = {\n showMe: 'Show me',\n previousTip: 'Previous tip',\n nextTip: 'Next tip',\n editTip: 'Edit tip',\n tip: 'Tip',\n hideTips: 'Hide tips',\n position: (index, count) => `${index} of ${count}`,\n}\n\nexport interface TipCardProps {\n /** The tip text: one sentence. */\n message: ReactNode\n /** Which tip is showing (0-based) out of `count`; the pager appears when `count` > 1. */\n index?: number\n count?: number\n onPrev?: () => void\n onNext?: () => void\n /** The single primary action; omit when the tip has none. */\n ctaLabel?: string\n onCta?: () => void\n /** Turns tips off. The card is dismissible so it never becomes permanent furniture. */\n onDismiss?: () => void\n /** Dev-only edit affordance: the host passes it only in development builds. */\n onEdit?: () => void\n /** Hover pauses the host's tip rotation (desktop enhancement). */\n onHoverChange?: (hovered: boolean) => void\n labels?: Partial<TipCardLabels>\n className?: string\n /** Card id (default `tip-row`). */\n testId?: string\n /** Control ids; defaults are the current ids. */\n testIds?: Partial<Record<'prev' | 'next' | 'cta' | 'edit' | 'dismiss', string>>\n}\n\nconst ICON_BUTTON =\n 'flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:size-11'\n\n/**\n * The Smart Tips card: a compact muted tile. Header (bulb, \"Tip\", dismiss), one sentence, then\n * ONE primary action with a quiet \"n of m\" pager. It is shown only while tips are on and a tip\n * applies; the host owns which tip is current, rotation and the on/off preference.\n */\nexport function TipCard({\n message,\n index = 0,\n count = 1,\n onPrev,\n onNext,\n ctaLabel,\n onCta,\n onDismiss,\n onEdit,\n onHoverChange,\n labels,\n className,\n testId,\n testIds,\n}: TipCardProps) {\n const l = { ...DEFAULT_TIP_CARD_LABELS, ...labels }\n const hasMany = count > 1\n\n return (\n <section\n data-slot=\"tip-card\"\n aria-label={l.tip}\n className={cn('min-w-0 rounded-lg bg-muted p-3 text-sm', className)}\n onMouseEnter={() => onHoverChange?.(true)}\n onMouseLeave={() => onHoverChange?.(false)}\n data-testid={testIdOr(testId, { testId: 'tip-row' })}\n >\n <div className=\"-my-1 flex items-center gap-1.5 text-xs font-medium text-muted-foreground\">\n <Lightbulb className=\"size-4 shrink-0 text-primary\" aria-hidden />\n <span>{l.tip}</span>\n <span className=\"-mr-1.5 ml-auto flex items-center\">\n {onEdit && (\n <button\n type=\"button\"\n onClick={onEdit}\n aria-label={l.editTip}\n title={l.editTip}\n className={cn(ICON_BUTTON, 'text-red-text hover:bg-red-bg hover:text-red-text')}\n data-testid={testIdOr(testIds?.edit, { testId: 'tip-edit' })}\n >\n <Pencil className=\"size-3.5\" />\n </button>\n )}\n {onDismiss && (\n <button\n type=\"button\"\n onClick={onDismiss}\n aria-label={l.hideTips}\n title={l.hideTips}\n className={ICON_BUTTON}\n data-testid={testIdOr(testIds?.dismiss, { testId: 'tip-dismiss' })}\n >\n <X className=\"size-4\" />\n </button>\n )}\n </span>\n </div>\n <p className=\"mt-2 text-foreground\">{message}</p>\n {(onCta || hasMany) && (\n <div className=\"mt-3 flex items-center justify-between gap-2\">\n {onCta ? (\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n onClick={onCta}\n className=\"font-medium text-primary\"\n data-testid={testIdOr(testIds?.cta, { testId: 'page-header-info-cta' })}\n >\n {ctaLabel ?? l.showMe}\n </Button>\n ) : (\n <span />\n )}\n {hasMany && (\n <span className=\"-mr-1.5 flex items-center text-xs text-muted-foreground\">\n <button\n type=\"button\"\n onClick={onPrev}\n aria-label={l.previousTip}\n title={l.previousTip}\n className={ICON_BUTTON}\n data-testid={testIdOr(testIds?.prev, { testId: 'tip-prev' })}\n >\n <ChevronLeft className=\"size-4\" />\n </button>\n <span className=\"min-w-10 text-center tabular-nums\" aria-live=\"polite\">\n {l.position(index + 1, count)}\n </span>\n <button\n type=\"button\"\n onClick={onNext}\n aria-label={l.nextTip}\n title={l.nextTip}\n className={ICON_BUTTON}\n data-testid={testIdOr(testIds?.next, { testId: 'tip-next' })}\n >\n <ChevronRight className=\"size-4\" />\n </button>\n </span>\n )}\n </div>\n )}\n </section>\n )\n}\n","/**\n * DockZone Component\n *\n * Layout wrapper that provides a resizable right-hand panel area (#dock-zone)\n * where panels in 'docked' mode render via PanelPortal.\n *\n * Uses MutationObserver on the #dock-zone element to detect when content is\n * portaled in/out, so the split layout appears only when a panel is actually\n * mounted — not just when the store says a panel prefers 'docked' mode.\n *\n * The dock zone reads its initial width from the child's data-dock-width\n * attribute (pixels). If absent, defaults to 50% of the container.\n *\n * Below MOBILE_BREAKPOINT_PX, MIN_MAIN_PX + MIN_DOCK_PX (500px combined)\n * can't both fit — the clamp math still ran unconditionally and squeezed the\n * dock pane down to whatever sliver was left (as little as ~90px on a 390px\n * phone), rendering both panes as unusable slivers instead of showing either\n * one properly. Below that width this becomes a single full-width view that\n * swaps between main and docked content instead of splitting — same\n * principle as the Document Viewer's own view-swap (Edit ⇄ Track Changes).\n */\n\nimport { useCallback, useEffect, useRef, useState } from 'react'\nimport { cn } from '@arbidocs/react/ui'\n\nconst MIN_DOCK_PX = 200\nconst MIN_MAIN_PX = 300\n// Standard right-panel width — matches the overlay sheet (sm:w-[34rem]) so a\n// panel is the same size whether it's pinned or floating. Pinned stays\n// draggable from here; floating is fixed.\nconst DEFAULT_DOCK_PX = 544\nconst MOBILE_BREAKPOINT_PX = 640\n\ninterface DockZoneProps {\n children: React.ReactNode\n 'data-testid'?: string\n}\n\nexport function DockZone({ children, ...props }: DockZoneProps) {\n const [hasDockedContent, setHasDockedContent] = useState(false)\n const [dockWidth, setDockWidth] = useState<number | null>(null)\n const [isResizing, setIsResizing] = useState(false)\n const [dragPosition, setDragPosition] = useState<number | null>(null)\n const [containerWidth, setContainerWidth] = useState(0)\n const containerRef = useRef<HTMLDivElement>(null)\n const dockZoneRef = useRef<HTMLDivElement>(null)\n\n useEffect(() => {\n const el = containerRef.current\n if (!el) return\n const observer = new ResizeObserver((entries) => {\n const width = entries[0]?.contentRect.width\n if (width !== undefined) setContainerWidth(width)\n })\n observer.observe(el)\n return () => observer.disconnect()\n }, [])\n\n const isMobile = containerWidth > 0 && containerWidth < MOBILE_BREAKPOINT_PX\n\n // Observe dock-zone children to know when content is actually portaled in\n // Also read initial width from the child's data-dock-width attribute\n useEffect(() => {\n const el = dockZoneRef.current\n if (!el) return\n\n const update = () => {\n const hasChildren = el.children.length > 0\n setHasDockedContent(hasChildren)\n if (hasChildren) {\n const requestedWidth = el.firstElementChild?.getAttribute('data-dock-width')\n if (requestedWidth) {\n setDockWidth(parseInt(requestedWidth, 10))\n }\n }\n }\n\n const observer = new MutationObserver(update)\n update()\n observer.observe(el, { childList: true })\n return () => observer.disconnect()\n }, [])\n\n const handleMouseDown = useCallback(() => {\n setIsResizing(true)\n setDragPosition(null)\n }, [])\n\n const handleMouseMove = useCallback(\n (e: MouseEvent) => {\n if (!isResizing || !containerRef.current) return\n const rect = containerRef.current.getBoundingClientRect()\n const x = e.clientX - rect.left\n // Clamp so neither pane gets too small\n const clamped = Math.min(Math.max(x, MIN_MAIN_PX), rect.width - MIN_DOCK_PX)\n setDragPosition(clamped)\n },\n [isResizing]\n )\n\n const handleMouseUp = useCallback(() => {\n if (dragPosition !== null && containerRef.current) {\n const containerWidth = containerRef.current.getBoundingClientRect().width\n setDockWidth(containerWidth - dragPosition)\n }\n setIsResizing(false)\n setDragPosition(null)\n }, [dragPosition])\n\n useEffect(() => {\n if (!isResizing) return\n document.addEventListener('mousemove', handleMouseMove)\n document.addEventListener('mouseup', handleMouseUp)\n document.body.style.cursor = 'col-resize'\n document.body.style.userSelect = 'none'\n return () => {\n document.removeEventListener('mousemove', handleMouseMove)\n document.removeEventListener('mouseup', handleMouseUp)\n document.body.style.cursor = ''\n document.body.style.userSelect = ''\n }\n }, [isResizing, handleMouseMove, handleMouseUp])\n\n // Below the mobile breakpoint there's no room to split at all — MIN_MAIN_PX\n // + MIN_DOCK_PX alone is 500px, wider than most phones. Show whichever\n // side is active at full width instead of squeezing both into slivers.\n const effectiveDockWidth =\n hasDockedContent && containerWidth > 0\n ? isMobile\n ? containerWidth\n : Math.min(\n Math.max(dockWidth ?? DEFAULT_DOCK_PX, MIN_DOCK_PX),\n containerWidth - MIN_MAIN_PX\n )\n : 0\n const mainHidden = isMobile && hasDockedContent\n\n return (\n <div ref={containerRef} className=\"h-full relative flex\" data-testid={props['data-testid']}>\n <div\n style={{\n width: mainHidden ? 0 : `calc(100% - ${effectiveDockWidth}px)`,\n // Reserve gutter space so the vertical scrollbar doesn't appear and\n // disappear as streaming content crosses the viewport boundary —\n // that toggle reflows the layout and reads as a screen-wide flicker.\n scrollbarGutter: 'stable',\n }}\n className={cn(\n // The CSS container for the page's @-variants (PageContainer must not be one; see there).\n '@container h-full overflow-auto',\n hasDockedContent && !isMobile && 'border-r',\n mainHidden && 'overflow-hidden',\n // Animate opening only. On close the portaled content has already\n // unmounted, so animating leaves an empty strip shrinking while the\n // page behind reflows — reads as flicker over heavy content like the\n // documents grid. Snap closed instead. Resizing is also instant so\n // the divider doesn't lag the cursor.\n hasDockedContent && !isResizing && 'transition-[width] duration-300 ease-in-out'\n )}\n aria-hidden={mainHidden}\n inert={mainHidden}\n data-scroll-container\n >\n {children}\n </div>\n\n {/* Wide grab zone with a visible grip, so the divider is findable and forgiving to hit */}\n {hasDockedContent && !isMobile && (\n <div\n className=\"group flex w-2 flex-shrink-0 cursor-col-resize items-center justify-center\"\n onMouseDown={handleMouseDown}\n data-testid=\"dock-resize-handle\"\n >\n <div className=\"h-12 w-1 rounded-full bg-muted-foreground/40 transition-colors group-hover:bg-primary\" />\n </div>\n )}\n\n <div\n ref={dockZoneRef}\n id=\"dock-zone\"\n style={{ width: effectiveDockWidth }}\n className={cn(\n 'h-full overflow-hidden flex-shrink-0',\n hasDockedContent && !isResizing && 'transition-[width] duration-300 ease-in-out'\n )}\n />\n\n {isResizing && dragPosition !== null && (\n <div\n className=\"absolute top-0 bottom-0 w-0.5 bg-primary z-50 pointer-events-none\"\n style={{ left: dragPosition }}\n />\n )}\n {isResizing && <div className=\"absolute inset-0 z-40 cursor-col-resize\" />}\n </div>\n )\n}\n","/**\n * PanelModeSwitcher Component\n *\n * User-selectable placements are: popped out, docked, or overlay. `main` is\n * NOT user-selectable — the system decides which surfaces render full-width\n * (e.g. the DM modal); the user just moves floating panels between popout /\n * docked / overlay. The switcher shows a button for each placement you're not\n * currently in (plus close):\n * - Popout/pop-in toggle (unless disablePopout).\n * - Split-screen button (when not docked).\n * - Float-as-overlay button (when not overlay).\n * - Popout mode shows just the pop-in toggle (the window has its own close).\n */\n\nimport { Button, Tooltip, TooltipContent, TooltipTrigger } from '@arbidocs/react/ui'\nimport { ExternalLink, PanelRight, PictureInPicture2, X } from 'lucide-react'\nimport type { MouseEvent, ReactNode } from 'react'\nimport type { ArbiPanelMode as PanelMode } from '@arbidocs/react'\nimport { useIsPhone, useMediaQuery } from '../lib/use-media-query'\n\nconst btnClass = 'h-7 w-7 p-0 text-muted-foreground hover:text-foreground'\n\ninterface SwitcherButtonProps {\n label: string\n /** True when rendered inside a popout window (see note below). */\n inPopout?: boolean\n onClick: (event: MouseEvent) => void\n testId: string\n children: ReactNode\n}\n\n// Icon-only buttons get a visible tooltip with their label, so the icon's meaning\n// is readable on hover and on keyboard focus. Radix tooltips portal into the main\n// window, which would misplace them inside a popout window, so there we fall back\n// to a native title.\nfunction SwitcherButton({\n label,\n inPopout = false,\n onClick,\n testId,\n children,\n}: SwitcherButtonProps) {\n const button = (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className={btnClass}\n aria-label={label}\n title={inPopout ? label : undefined}\n onClick={onClick}\n data-testid={testId}\n >\n {children}\n </Button>\n )\n if (inPopout) return button\n return (\n <Tooltip>\n <TooltipTrigger asChild>{button}</TooltipTrigger>\n <TooltipContent>{label}</TooltipContent>\n </Tooltip>\n )\n}\n\n// \"Open in new window\" (popout) and \"Float as overlay\" are desktop-only\n// window-management concepts — a tablet has no multi-window/overlay chrome to\n// pop into. 1024px mirrors the common tablet/small-laptop cutoff (Tailwind's\n// `lg`), the usual convention for viewport-driven chrome (as opposed to\n// DocumentViewer's container-width ResizeObserver, which fits ITS OWN toolbar buttons reflowing inside a panel\n// that can be split narrow on a wide desktop — PanelModeSwitcher instead needs\n// to know the actual device class, since popping into \"a new window\" or\n// \"floating overlay\" is meaningless on a touch tablet regardless of how the\n// panel happens to be sized in that moment). Deliberately separate from\n// `useIsPhone` (640px, phones only): this only needs to hide these two\n// buttons, not collapse the whole switcher, at tablet widths.\nconst TABLET_AND_BELOW_QUERY = '(max-width: 1024px)'\n\ninterface PanelModeSwitcherProps {\n mode: PanelMode\n onModeChange: (mode: PanelMode) => void\n onClose?: () => void\n /** When true, hides the popout button (e.g. for panels whose content breaks in a popup window) */\n disablePopout?: boolean\n /**\n * Override the close-button data-testid. Defaults to `dialog-close-button`\n * for backwards compatibility. Use a panel-specific value (e.g.\n * `close-viewer-button`) when there are multiple PanelModeSwitchers in the\n * DOM at once and tests need to disambiguate.\n */\n closeTestId?: string\n}\n\nexport function PanelModeSwitcher({\n mode,\n onModeChange,\n onClose,\n disablePopout,\n closeTestId = 'dialog-close-button',\n}: PanelModeSwitcherProps) {\n const isPopout = mode === 'popout'\n const isSmallScreen = useIsPhone()\n const isTabletAndBelow = useMediaQuery(TABLET_AND_BELOW_QUERY)\n\n // Closing is not a click into the panel: the panel's own click handler would focus the panel\n // that just closed, and the page's nav would lose its active row.\n const closeButton = onClose && (\n <SwitcherButton\n label=\"Close (Esc)\"\n onClick={(event) => {\n event.stopPropagation()\n onClose()\n }}\n testId={closeTestId}\n >\n <X className=\"w-3.5 h-3.5\" />\n </SwitcherButton>\n )\n\n // Phones: every panel is an overlay and mode-switching is disabled, so only\n // the close ✕ is meaningful.\n if (isSmallScreen) {\n return <div className=\"flex items-center gap-0.5 flex-shrink-0\">{closeButton}</div>\n }\n\n return (\n <div className=\"flex items-center gap-0.5 flex-shrink-0\">\n {/* Popout / pop-in toggle — hidden when disablePopout is set, or on\n tablet-and-below where \"a new window\" isn't a real concept. */}\n {!disablePopout && !isTabletAndBelow && (\n <SwitcherButton\n label={isPopout ? 'Pop back in' : 'Open in new window'}\n inPopout={isPopout}\n onClick={() => onModeChange(isPopout ? 'docked' : 'popout')}\n testId={isPopout ? 'pop-into-main-window-button' : 'open-in-new-window-button'}\n >\n <ExternalLink className=\"w-3.5 h-3.5\" />\n </SwitcherButton>\n )}\n\n {/* Split-screen (docked to the side) — shown when not already in it */}\n {!isPopout && mode !== 'docked' && (\n <SwitcherButton\n label=\"Split screen\"\n onClick={() => onModeChange('docked')}\n testId=\"dock-panel-button\"\n >\n <PanelRight className=\"w-3.5 h-3.5\" />\n </SwitcherButton>\n )}\n\n {/* Float as an overlay sheet — shown when not already an overlay, and\n not on tablet-and-below (no floating-window chrome to speak of). */}\n {!isPopout && mode !== 'overlay' && !isTabletAndBelow && (\n <SwitcherButton\n label=\"Float as overlay\"\n onClick={() => onModeChange('overlay')}\n testId=\"overlay-panel-button\"\n >\n <PictureInPicture2 className=\"w-3.5 h-3.5\" />\n </SwitcherButton>\n )}\n\n {/* All non-popout modes: ✕ to close */}\n {!isPopout && closeButton}\n </div>\n )\n}\n","/**\n * Window Manager for Pop-out Panels\n *\n * Handles creating, managing, and communicating with popup windows\n */\n\ninterface PopupWindow {\n id: string\n window: Window\n panelId: string\n rootElement: HTMLElement | null\n onClose?: () => void\n}\n\n/** Window lifecycle port; hosts may share or replace the browser implementation. */\nexport interface PanelWindows {\n createPopupWindow(panelId: string, onClose?: () => void, title?: string): string | null\n getWindow(windowId: string): Window | null\n getRootElement(windowId: string): HTMLElement | null\n focusPanelWindow(panelId: string): boolean\n clearOnClose(windowId: string): void\n closeWindow(windowId: string): void\n closeAllWindows(): void\n}\n\nclass PanelWindowManager implements PanelWindows {\n constructor(private readonly defaultTitle = 'Panel') {}\n private windows = new Map<string, PopupWindow>()\n\n createPopupWindow(panelId: string, onClose?: () => void, title?: string): string | null {\n const windowId = `panel-window-${panelId}`\n\n // Check if window already exists\n if (this.windows.has(windowId)) {\n const existing = this.windows.get(windowId)\n if (existing && !existing.window.closed) {\n existing.window.focus()\n return windowId\n } else {\n // Clean up closed window\n this.windows.delete(windowId)\n }\n }\n\n // Position popup in the right half of the screen\n const currentWidth = window.outerWidth\n const currentHeight = window.outerHeight\n const currentLeft = window.screenX ?? window.screenLeft ?? 0\n const currentTop = window.screenY ?? window.screenTop ?? 0\n\n // Calculate popup position (right half)\n const halfWidth = Math.floor(currentWidth / 2)\n const popupWidth = halfWidth\n const popupHeight = currentHeight\n const left = currentLeft + halfWidth\n const top = currentTop\n\n const popup = window.open(\n '',\n windowId,\n `width=${popupWidth},height=${popupHeight},left=${left},top=${top},scrollbars=yes,resizable=yes,menubar=no,toolbar=no,location=no,status=no`\n )\n\n if (!popup) {\n console.error('Failed to create popup window - popup blocked?')\n return null\n }\n\n // Set up the popup window HTML with proper CSS links\n const mainDocument = document\n const stylesheets = Array.from(\n mainDocument.head.querySelectorAll('link[rel=\"stylesheet\"], style')\n )\n .map((el) => el.outerHTML)\n .join('\\n')\n\n popup.document.write(`\n <!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title></title>\n <!-- about:blank has no base, so copied @font-face / asset URLs (e.g.\n /assets/font.woff2) would resolve against nothing and render as\n tofu squares. Anchor relative URLs to the app origin. -->\n <base href=\"${window.location.origin}/\">\n ${stylesheets}\n <style>\n body {\n margin: 0;\n padding: 0;\n font-family: system-ui, -apple-system, sans-serif;\n }\n #panel-root {\n width: 100%;\n height: 100vh;\n overflow: hidden;\n }\n * {\n box-sizing: border-box;\n }\n </style>\n </head>\n <body>\n <div id=\"panel-root\"></div>\n </body>\n </html>\n `)\n popup.document.close()\n // A host title is text, even when it contains HTML delimiters.\n popup.document.title = title || this.defaultTitle\n\n // Belt-and-suspenders: re-register the parent's already-loaded web fonts in\n // the popup's FontFaceSet, so glyphs render even if a copied @font-face\n // doesn't re-fetch. Best-effort — engines that reject a cross-document add\n // just fall back to the <base>-anchored @font-face rules above.\n try {\n mainDocument.fonts.forEach((font) => {\n try {\n popup.document.fonts.add(font)\n } catch {\n /* ignore per-font failures */\n }\n })\n } catch {\n /* FontFaceSet unavailable — ignore */\n }\n\n // Get root element after DOM is ready\n const rootElement = popup.document.getElementById('panel-root')\n\n // Store window reference\n const popupWindow: PopupWindow = {\n id: windowId,\n window: popup,\n panelId,\n rootElement,\n onClose,\n }\n this.windows.set(windowId, popupWindow)\n\n // Handle window close — read onClose from the map entry so clearOnClose() works\n const closeCheckInterval = setInterval(() => {\n if (popup.closed) {\n clearInterval(closeCheckInterval)\n const entry = this.windows.get(windowId)\n this.windows.delete(windowId)\n entry?.onClose?.()\n }\n }, 200)\n\n return windowId\n }\n\n getWindow(windowId: string): Window | null {\n const popup = this.windows.get(windowId)\n return popup && !popup.window.closed ? popup.window : null\n }\n\n getRootElement(windowId: string): HTMLElement | null {\n const popup = this.windows.get(windowId)\n return popup && !popup.window.closed ? popup.rootElement : null\n }\n\n /** Focus the popup window for a given panel ID. Returns true if focused. */\n focusPanelWindow(panelId: string): boolean {\n const windowId = `panel-window-panel-${panelId}`\n const popup = this.windows.get(windowId)\n if (popup && !popup.window.closed) {\n popup.window.focus()\n return true\n }\n return false\n }\n\n /** Remove the onClose callback so it won't fire when the window is closed programmatically. */\n clearOnClose(windowId: string): void {\n const popup = this.windows.get(windowId)\n if (popup) {\n popup.onClose = undefined\n }\n }\n\n closeWindow(windowId: string): void {\n const popup = this.windows.get(windowId)\n if (popup && !popup.window.closed) {\n popup.window.close()\n }\n this.windows.delete(windowId)\n }\n\n closeAllWindows(): void {\n for (const [, popup] of this.windows) {\n if (!popup.window.closed) {\n popup.window.close()\n }\n }\n this.windows.clear()\n }\n}\n\n/** A window registry shared by the host's panel controls and portal layer. */\nexport function createPanelWindowManager(options: { defaultTitle?: string } = {}) {\n return new PanelWindowManager(options.defaultTitle)\n}\n","import { useHost } from '../provider/host'\nimport { createPanelWindowManager, type PanelWindows } from './panel-windows'\n\n/** Browser windows and site-specific titles shared by a host's panel controls. */\nexport interface PanelHostSupport {\n windows?: PanelWindows\n popoutTitle?: (title: string) => string\n}\n\nconst defaultWindows = createPanelWindowManager()\nconst titleOnly = (title: string) => title\n\n/** Panel support from the existing ArbiHost; standalone panels share the browser defaults. */\nexport function usePanelHostSupport(): Required<PanelHostSupport> {\n const { panels } = useHost()\n return {\n windows: panels?.windows ?? defaultWindows,\n popoutTitle: panels?.popoutTitle ?? titleOnly,\n }\n}\n","/**\n * PanelPortal Component\n *\n * Thin portal layer that renders children into the right target based on panel mode:\n * - docked: portal to #dock-zone element\n * - overlay: portal to <body> as a slide-out sheet over a backdrop\n * - popout: portal to a separate browser window\n * - main: portal to #main-zone element\n *\n * Manages popup window lifecycle for popout mode.\n * Content-agnostic — just handles where things render.\n */\n\nimport { useCallback, useEffect, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\nimport { DEFAULT_OVERLAY_ZONE_ID } from './Shell'\nimport { usePanelHostSupport } from './panel-host'\nimport { PortalContainerProvider } from '@arbidocs/react/ui'\nimport type { FloatingPanelMode as PanelMode } from '../settings/FloatingPanel'\n\n// Overlay sheet sizing — defaults match the docked width (DEFAULT_DOCK_PX) so a\n// panel is the same size whether pinned or floating, and stays draggable here.\nconst OVERLAY_DEFAULT_PX = 544\nconst OVERLAY_MIN_PX = 360\n\nexport interface PanelPortalProps {\n panelId: string\n mode: PanelMode\n isOpen: boolean\n /** True while the overlay is animating out before unmounting. */\n isExiting?: boolean\n /** Called when popup window is closed externally (user closes the window) */\n onPopupClosed?: () => void\n /** Dismisses the panel — used by the overlay backdrop. */\n onClose?: () => void\n /** Window title for popout mode */\n popoutTitle?: string\n /** Initial overlay width in px (defaults to OVERLAY_DEFAULT_PX). */\n defaultWidth?: number\n children: React.ReactNode\n}\n\n/**\n * Overlay sheet — a slide-out panel over the still-visible page, resizable by\n * dragging its left edge. Slides in on mount and out (via isExiting) before\n * unmounting, mirroring the left sidebar's animation.\n */\nfunction OverlaySheet({\n panelId,\n isExiting,\n onClose,\n defaultWidth,\n scoped,\n children,\n}: {\n panelId: string\n isExiting?: boolean\n onClose?: () => void\n defaultWidth?: number\n /** Rendered inside the layout's overlay zone (below the topbar) rather than\n * over the whole viewport. */\n scoped?: boolean\n children: React.ReactNode\n}) {\n const [width, setWidth] = useState(defaultWidth ?? OVERLAY_DEFAULT_PX)\n const [isResizing, setIsResizing] = useState(false)\n // Live cursor position while dragging. The panel keeps its committed `width`\n // during the drag — only this thin preview line moves — so the heavy panel\n // content never reflows mid-drag (matching DockZone's split-screen handle).\n // The width is committed once on mouse-up.\n const [dragWidth, setDragWidth] = useState<number | null>(null)\n const dragWidthRef = useRef<number | null>(null)\n // Once the slide-in has played we drop the entry class, so later re-renders\n // don't restart the animation.\n const [hasEntered, setHasEntered] = useState(false)\n\n const handleResizeStart = useCallback((e: React.MouseEvent) => {\n e.preventDefault()\n setHasEntered(true)\n setIsResizing(true)\n setDragWidth(null)\n dragWidthRef.current = null\n }, [])\n\n useEffect(() => {\n if (!isResizing) return\n const handleMouseMove = (e: MouseEvent) => {\n // Anchored to the right edge — width grows as the cursor moves left.\n const max = window.innerWidth * 0.92\n const next = Math.min(Math.max(window.innerWidth - e.clientX, OVERLAY_MIN_PX), max)\n dragWidthRef.current = next\n setDragWidth(next)\n }\n const handleMouseUp = () => {\n if (dragWidthRef.current !== null) setWidth(dragWidthRef.current)\n setIsResizing(false)\n setDragWidth(null)\n dragWidthRef.current = null\n }\n document.addEventListener('mousemove', handleMouseMove)\n document.addEventListener('mouseup', handleMouseUp)\n document.body.style.cursor = 'col-resize'\n document.body.style.userSelect = 'none'\n return () => {\n document.removeEventListener('mousemove', handleMouseMove)\n document.removeEventListener('mouseup', handleMouseUp)\n document.body.style.cursor = ''\n document.body.style.userSelect = ''\n }\n }, [isResizing])\n\n return (\n // Scoped: absolute within the layout's overlay zone (below the topbar).\n // Unscoped fallback: fixed over the whole viewport, as before.\n <div\n className={scoped ? 'absolute inset-0 z-40' : 'fixed inset-0 z-50'}\n data-testid={`${panelId}-overlay`}\n >\n {/* In dark mode a 40% black veil crushes the light page text behind the sheet to\n mid-grey, so the veil is lighter there and the page stays readable underneath. */}\n <div\n className={`absolute inset-0 bg-black/40 dark:bg-black/20 duration-200 ${\n // fill-mode-forwards holds the exit end-state — without it the\n // element snaps back fully visible for the frames between the\n // animation finishing and React unmounting it (a flicker).\n isExiting ? 'animate-out fade-out fill-mode-forwards' : 'animate-in fade-in'\n }`}\n onClick={onClose}\n aria-hidden=\"true\"\n data-testid={`${panelId}-overlay-backdrop`}\n />\n <div\n style={{ width }}\n onAnimationEnd={() => !isExiting && setHasEntered(true)}\n className={`absolute right-0 top-0 bottom-0 flex max-w-[92vw] flex-col border-l max-sm:!w-full max-sm:!max-w-full max-sm:border-l-0 border-border bg-muted shadow-2xl duration-200 ${\n isExiting\n ? 'animate-out slide-out-to-right fill-mode-forwards'\n : // Suppress the slide transform once entered so it doesn't replay.\n hasEntered\n ? ''\n : 'animate-in slide-in-from-right'\n }`}\n >\n {/* Drag handle on the left edge to resize the sheet. */}\n <div\n className=\"absolute left-0 top-0 bottom-0 z-10 w-1.5 -translate-x-1/2 cursor-col-resize hover:bg-primary/40\"\n onMouseDown={handleResizeStart}\n data-testid={`${panelId}-overlay-resize-handle`}\n />\n {children}\n </div>\n\n {/* Preview line — tracks the cursor during the drag; the panel resizes\n to this position only on release. */}\n {isResizing && dragWidth !== null && (\n <div\n className=\"absolute top-0 bottom-0 z-[60] w-0.5 bg-primary pointer-events-none\"\n style={{ right: dragWidth }}\n />\n )}\n {/* Transparent capture layer so the drag isn't interrupted by elements\n (iframes, the grid) swallowing pointer events. */}\n {isResizing && <div className=\"absolute inset-0 z-[55] cursor-col-resize\" />}\n </div>\n )\n}\n\nexport function PanelPortal({\n panelId,\n mode,\n isOpen,\n isExiting,\n onPopupClosed,\n onClose,\n popoutTitle,\n defaultWidth,\n children,\n}: PanelPortalProps) {\n const { windows: windowManager } = usePanelHostSupport()\n const [popupRoot, setPopupRoot] = useState<HTMLElement | null>(null)\n const popupWindowIdRef = useRef<string | null>(null)\n\n // Open popup window when switching to popout mode\n useEffect(() => {\n if (!isOpen || mode !== 'popout') {\n // Close popup if we're leaving popout mode (intentional mode switch, not user closing)\n if (popupWindowIdRef.current) {\n // Clear the onClose callback before closing so it doesn't trigger onPopupClosed\n windowManager.clearOnClose(popupWindowIdRef.current)\n windowManager.closeWindow(popupWindowIdRef.current)\n popupWindowIdRef.current = null\n setPopupRoot(null)\n }\n return\n }\n\n // Already have a popup open\n if (popupWindowIdRef.current) return\n\n const windowId = windowManager.createPopupWindow(\n `panel-${panelId}`,\n () => {\n popupWindowIdRef.current = null\n setPopupRoot(null)\n onPopupClosed?.()\n },\n popoutTitle || panelId\n )\n\n if (windowId) {\n const rootElement = windowManager.getRootElement(windowId)\n if (rootElement) {\n popupWindowIdRef.current = windowId\n setPopupRoot(rootElement)\n windowManager.getWindow(windowId)?.focus()\n }\n }\n }, [isOpen, mode, panelId, popoutTitle, onPopupClosed, windowManager])\n\n // Clean up on unmount\n useEffect(() => {\n return () => {\n if (popupWindowIdRef.current) {\n windowManager.closeWindow(popupWindowIdRef.current)\n }\n }\n }, [windowManager])\n\n if (!isOpen && !isExiting) return null\n\n // Popout: render into popup window. Its dialogs and menus open there too, not in the window\n // behind it (where the Sign dialog used to open, out of sight).\n if (mode === 'popout' && popupRoot) {\n return createPortal(\n <PortalContainerProvider container={popupRoot}>{children}</PortalContainerProvider>,\n popupRoot\n )\n }\n\n // Overlay: a slide-out sheet over the still-visible page. Rendered into the\n // layout's #app-overlay-zone — the content region BELOW the app topbar — so\n // the bar stays visible and interactive above every overlay. Falls back to\n // <body> (viewport-covering) when no zone is mounted (e.g. embedded shells).\n if (mode === 'overlay') {\n const overlayZone = document.getElementById(DEFAULT_OVERLAY_ZONE_ID)\n return createPortal(\n <OverlaySheet\n panelId={panelId}\n isExiting={isExiting}\n onClose={onClose}\n defaultWidth={defaultWidth}\n scoped={overlayZone !== null}\n >\n {children}\n </OverlaySheet>,\n overlayZone ?? document.body\n )\n }\n\n // Main: render into main content zone\n if (mode === 'main') {\n const mainZone = document.getElementById('main-zone')\n if (mainZone) {\n return createPortal(children, mainZone)\n }\n }\n\n // Docked: render into dock zone\n const dockZone = document.getElementById('dock-zone')\n if (dockZone) {\n return createPortal(children, dockZone)\n }\n\n // No target zone mounted yet — render nothing\n return null\n}\n"]}
1
+ {"version":3,"sources":["../src/shell/ShellSidebar.tsx","../src/lib/use-close-on-escape.ts","../src/lib/sidebar-mode.ts","../src/shell/use-sidebar-controller.ts","../src/shell/SidebarRowAction.tsx","../src/shell/AskField.tsx","../src/shell/ActionCluster.tsx","../src/shell/StatusRow.tsx","../src/shell/OfflinePill.tsx","../src/shell/RemoteControlPill.tsx","../src/shell/TipCard.tsx","../src/shell/DockZone.tsx","../src/shell/PanelModeSwitcher.tsx","../src/shell/panel-windows.ts","../src/shell/panel-host.ts","../src/shell/PanelPortal.tsx"],"names":["jsxs","Sidebar","jsx","useRef","useEffect","useState","useControllableState","useIsPhone","useIsNarrow","useIsTouchScreen","useCallback","useContext","SidebarRowHoverContext","cn","BlocksTooltipProvider","Tooltip","TooltipTrigger","TooltipContent","testIdOr","Sparkles","Button","Search","ArrowUp","X","useId","STATUS_ROW_TONES","STATUS_ROW_BASE_CLASS","WifiOff","TriangleAlert","RefreshCw","MousePointerClick","Lightbulb","Pencil","ChevronLeft","ChevronRight","containerWidth","useMediaQuery","ExternalLink","PanelRight","PictureInPicture2","useHost","createPortal","PortalContainerProvider","DEFAULT_OVERLAY_ZONE_ID"],"mappings":";;;;;;;;;;;;;;;;AAyCO,SAAS,YAAA,CAAa;AAAA,EAC3B,UAAA;AAAA,EACA,UAAA;AAAA,EACA,iBAAA;AAAA,EACA,MAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,YAAA;AAAA,EACA,IAAA;AAAA,EACA,MAAA;AAAA,EACA,GAAG;AACL,CAAA,EAAsB;AACpB,EAAA,IAAI,UAAA,CAAW,MAAA,CAAO,MAAA,EAAQ,OAAO,IAAA;AACrC,EAAA,uBACEA,eAAA,CAACC,0BAAQ,IAAA,EAAR,EAAc,GAAG,UAAA,CAAW,SAAA,EAAY,GAAG,SAAA,EACzC,QAAA,EAAA;AAAA,IAAA,UAAA,CAAW,YAAY,UAAA,oBACtBC,cAAA;AAAA,MAACD,yBAAA,CAAQ,YAAA;AAAA,MAAR;AAAA,QACC,IAAA,EAAM,UAAA;AAAA,QACN,SAAS,UAAA,CAAW,WAAA;AAAA,QACpB,aAAA,EAAa;AAAA;AAAA,KACf;AAAA,IAED,MAAA,oBAAUC,cAAA,CAACD,yBAAA,CAAQ,MAAA,EAAR,EAAgB,QAAA,EAAA,MAAA,EAAO,CAAA;AAAA,mCAClCA,yBAAA,CAAQ,GAAA,EAAR,EAAY,KAAA,EAAc,QAAA,EAAoB,WAAW,YAAA,EAAc,CAAA;AAAA,IAAA,CACtE,IAAA,IAAQ,MAAA,qBACRD,eAAA,CAACC,yBAAA,CA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,CAAA;AAAA,MACpD;AAAA,IACF,CAAA;AAAA,EACF,CAAA,EAAG,CAAC,aAAa,CAAC,CAAA;AAElB,EAAA,IAAI,CAAC,MAAA,IAAU,CAAC,SAAA,EAAW,OAAO,IAAA;AAIlC,EAAA,IAAI,IAAA,KAAS,YAAY,SAAA,EAAW;AAClC,IAAA,OAAOqC,qBAAA;AAAA,sBACLvC,cAAAA,CAACwC,0BAAA,EAAA,EAAwB,SAAA,EAAW,WAAY,QAAA,EAAS,CAAA;AAAA,MACzD;AAAA,KACF;AAAA,EACF;AAMA,EAAA,IAAI,SAAS,SAAA,EAAW;AACtB,IAAA,MAAM,WAAA,GAAc,QAAA,CAAS,cAAA,CAAeC,yCAAuB,CAAA;AACnE,IAAA,OAAOF,qBAAA;AAAA,sBACLvC,cAAAA;AAAA,QAAC,YAAA;AAAA,QAAA;AAAA,UACC,OAAA;AAAA,UACA,SAAA;AAAA,UACA,OAAA;AAAA,UACA,YAAA;AAAA,UACA,QAAQ,WAAA,KAAgB,IAAA;AAAA,UAEvB;AAAA;AAAA,OACH;AAAA,MACA,eAAe,QAAA,CAAS;AAAA,KAC1B;AAAA,EACF;AAGA,EAAA,IAAI,SAAS,MAAA,EAAQ;AACnB,IAAA,MAAM,QAAA,GAAW,QAAA,CAAS,cAAA,CAAe,WAAW,CAAA;AACpD,IAAA,IAAI,QAAA,EAAU;AACZ,MAAA,OAAOuC,qBAAA,CAAa,UAAU,QAAQ,CAAA;AAAA,IACxC;AAAA,EACF;AAGA,EAAA,MAAM,QAAA,GAAW,QAAA,CAAS,cAAA,CAAe,WAAW,CAAA;AACpD,EAAA,IAAI,QAAA,EAAU;AACZ,IAAA,OAAOA,qBAAA,CAAa,UAAU,QAAQ,CAAA;AAAA,EACxC;AAGA,EAAA,OAAO,IAAA;AACT","file":"chunk-B3LZITVF.cjs","sourcesContent":["import type { ReactNode } from 'react'\nimport { Sidebar, type SidebarRootProps } from './Sidebar'\nimport type { SidebarController } from './use-sidebar-controller'\nimport type { NavItem, NavSection } from './types'\n\nexport interface ShellSidebarProps extends Pick<\n SidebarRootProps,\n 'className' | 'aria-label' | 'labels' | 'backdropTestId'\n> {\n /** From `useSidebarController`: layout, hover/pin/drawer behaviour. */\n controller: SidebarController\n /** Brand mark of the phone drawer's header (logo + close). Omit for no drawer header. */\n drawerLogo?: ReactNode\n /** `data-testid` of the drawer's close button. */\n drawerCloseTestId?: string\n /** Top block (workspace switcher, ask field, pin toggle). Read `controller.expanded` for the rail. */\n header?: ReactNode\n /** Rows as data. */\n items?: NavItem[]\n /** Labelled groups of rows as data, after `items`. */\n sections?: NavSection[]\n navClassName?: string\n /**\n * Width-bound cards at the top of the footer (smart tips, notices): shown only once the panel\n * has settled open, and gone the instant it starts to close.\n */\n tips?: ReactNode\n /** The rest of the footer (status rows, account rows). */\n footer?: ReactNode\n /** Root `data-testid` (default `sidebar`). */\n 'data-testid'?: string\n}\n\n/**\n * The whole sidebar from a controller and data: `Sidebar.Root` in the resolved mode, the phone\n * drawer header, the header slot, the nav rows/groups and the footer. Renders nothing while the\n * layout is hidden (a phone with the drawer closed), so no clipped rows carry duplicate test ids.\n *\n * const sidebar = useSidebarController({ isPinned, onPinnedChange: setPinned })\n * <ShellSidebar controller={sidebar} header={…} items={nav} footer={…} />\n */\nexport function ShellSidebar({\n controller,\n drawerLogo,\n drawerCloseTestId,\n header,\n items,\n sections,\n navClassName,\n tips,\n footer,\n ...rootProps\n}: ShellSidebarProps) {\n if (controller.layout.hidden) return null\n return (\n <Sidebar.Root {...controller.rootProps} {...rootProps}>\n {controller.isDrawer && drawerLogo && (\n <Sidebar.DrawerHeader\n logo={drawerLogo}\n onClose={controller.closeDrawer}\n data-testid={drawerCloseTestId}\n />\n )}\n {header && <Sidebar.Header>{header}</Sidebar.Header>}\n <Sidebar.Nav items={items} sections={sections} className={navClassName} />\n {(tips || footer) && (\n <Sidebar.Footer>\n {controller.tipsVisible && tips}\n {footer}\n </Sidebar.Footer>\n )}\n </Sidebar.Root>\n )\n}\n","import { useEffect, useRef } from 'react'\n\n/**\n * While `isActive`, Escape calls `onClose`. For surfaces that float over the page without being a\n * modal (no backdrop, no focus trap), so nothing else closes them from the keyboard. An Escape a\n * dialog already handled (`defaultPrevented`) is left alone so one press closes one layer.\n */\nexport function useCloseOnEscape(isActive: boolean, onClose: () => void): void {\n const onCloseRef = useRef(onClose)\n useEffect(() => {\n onCloseRef.current = onClose\n })\n\n useEffect(() => {\n if (!isActive) return\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Escape' && !e.defaultPrevented) onCloseRef.current()\n }\n document.addEventListener('keydown', onKeyDown)\n return () => document.removeEventListener('keydown', onKeyDown)\n }, [isActive])\n}\n","import { useEffect, useRef, useState } from 'react'\n\n/**\n * Headless sidebar behaviour (no DOM, no store): how the sidebar lays out for a given set of\n * inputs, and the settle timing that keeps labels/tips from squeezing during the width transition.\n *\n * - `drawer` small-screen off-canvas panel (opened by the app bar's menu button)\n * - `collapsed` hidden (width 0): a phone with the drawer closed, or `isCollapsed`\n * - `pinned` full width, inline, pushes the content\n * - `rail` icon strip that floats open to full width while hovered\n */\nexport type SidebarMode = 'drawer' | 'collapsed' | 'pinned' | 'rail'\n\nexport interface SidebarModeInput {\n isSmallScreen: boolean\n /** The phone drawer was requested open. */\n isDrawerRequested: boolean\n isCollapsed: boolean\n isPinned: boolean\n isHovering: boolean\n /**\n * Tablet-width viewport (above the phone drawer breakpoint but too narrow to give the content a\n * usable column next to a 255px panel): pinning is ignored and the sidebar stays an icon rail.\n */\n isNarrow?: boolean\n}\n\nexport interface SidebarLayout {\n mode: SidebarMode\n /** Labels should be shown (the panel is, or is becoming, full width). */\n expanded: boolean\n /** Phones: nothing is rendered until the drawer opens. */\n hidden: boolean\n /** Hover state that actually applies (never on touch-sized screens). */\n hovering: boolean\n}\n\nexport function resolveSidebarLayout(input: SidebarModeInput): SidebarLayout {\n const { isSmallScreen, isDrawerRequested, isCollapsed, isPinned, isHovering } = input\n const canPin = isPinned && !isSmallScreen && !input.isNarrow\n const drawerOpen = isSmallScreen && isDrawerRequested\n // Small screens are drawer-only: when it is closed the panel is fully off-canvas\n // regardless of pinning (pinning is a desktop concept), and hover never expands.\n const effectiveCollapsed = isCollapsed || (isSmallScreen && !drawerOpen)\n const hovering = isHovering && !isSmallScreen\n\n let mode: SidebarMode\n if (drawerOpen) mode = 'drawer'\n else if (effectiveCollapsed) mode = 'collapsed'\n else if (canPin) mode = 'pinned'\n else mode = 'rail'\n\n // `hovering`, not `isHovering`: a stale hover flag must not report a hidden phone sidebar as expanded.\n const expanded = drawerOpen || (!effectiveCollapsed && (canPin || hovering))\n\n return { mode, expanded, hidden: isSmallScreen && !drawerOpen, hovering }\n}\n\n/**\n * Settle timing around the width transition (default 300ms):\n * - `labelsExpanded` switches on immediately but off only after the transition, so labels do not\n * snap to icon-only while the panel is still wide;\n * - `tipsVisible` is the opposite: width-bound content (a tip card) appears only once the panel\n * has fully opened and disappears the instant collapse starts.\n */\nexport function useSidebarSettle(expanded: boolean, settleMs = 300) {\n const [labelsExpanded, setLabelsExpanded] = useState(expanded)\n const [tipsVisible, setTipsVisible] = useState(expanded)\n const labelsTimer = useRef<ReturnType<typeof setTimeout> | null>(null)\n const tipsTimer = useRef<ReturnType<typeof setTimeout> | null>(null)\n\n useEffect(() => {\n if (labelsTimer.current) clearTimeout(labelsTimer.current)\n if (expanded) setLabelsExpanded(true)\n else labelsTimer.current = setTimeout(() => setLabelsExpanded(false), settleMs)\n return () => {\n if (labelsTimer.current) clearTimeout(labelsTimer.current)\n }\n }, [expanded, settleMs])\n\n useEffect(() => {\n if (tipsTimer.current) clearTimeout(tipsTimer.current)\n if (expanded) tipsTimer.current = setTimeout(() => setTipsVisible(true), settleMs)\n else setTipsVisible(false)\n return () => {\n if (tipsTimer.current) clearTimeout(tipsTimer.current)\n }\n }, [expanded, settleMs])\n\n return { labelsExpanded, tipsVisible }\n}\n","import { useCallback, useEffect, useRef, type PointerEvent } from 'react'\nimport { useControllableState } from '../lib/useControllableState'\nimport { useCloseOnEscape } from '../lib/use-close-on-escape'\nimport { useIsNarrow, useIsPhone, useIsTouchScreen } from '../lib/use-media-query'\nimport { resolveSidebarLayout, useSidebarSettle, type SidebarLayout } from '../lib/sidebar-mode'\nimport type { SidebarRootProps } from './Sidebar'\n\nexport interface UseSidebarControllerOptions {\n /** Pinned open (desktop). Controlled when set; otherwise kept here, seeded by `defaultPinned`. */\n isPinned?: boolean\n /** Default `true`. */\n defaultPinned?: boolean\n onPinnedChange?: (isPinned: boolean) => void\n /** The rail is floated open (hover, or its toggle at a narrow width). Controlled when set. */\n isHovering?: boolean\n onHoveringChange?: (isHovering: boolean) => void\n /** The phone drawer is open. Controlled when set (the app bar's menu button opens it). */\n isDrawerOpen?: boolean\n onDrawerOpenChange?: (isDrawerOpen: boolean) => void\n /**\n * Keep the sidebar a rail even when pinned, on top of the tablet width (for example while a\n * docked panel squeezes the content). The stored pin is left untouched.\n */\n forceRail?: boolean\n /**\n * Which rails expand on pointer enter. The default ignores narrow and emulated touch hover;\n * `all` retains hover expansion for a host whose narrow rail has no separate expand button.\n */\n hoverExpansion?: 'desktop-pointer' | 'all'\n}\n\n/** The `Sidebar.Root` props the controller resolves. */\nexport type SidebarControllerRootProps = Pick<\n SidebarRootProps,\n | 'mode'\n | 'expanded'\n | 'isHovering'\n | 'onBackdropClick'\n | 'hasRailBackdrop'\n | 'onPointerEnter'\n | 'onPointerLeave'\n>\n\nexport interface SidebarController {\n layout: SidebarLayout\n /** Labels shown (settled: they stay on until the closing transition ends). */\n expanded: boolean\n /** Width-bound content (tips, notices) may show: on once fully open, off as closing starts. */\n tipsVisible: boolean\n /** The phone drawer is showing. */\n isDrawer: boolean\n isSmallScreen: boolean\n /** Tablet width (or `forceRail`): pinning is ignored and the sidebar stays a rail. */\n isNarrow: boolean\n /** The pin as it applies (always off while narrow). */\n isPinned: boolean\n /** Spread onto `Sidebar.Root` (or pass the controller to `ShellSidebar`). */\n rootProps: SidebarControllerRootProps\n openDrawer: () => void\n closeDrawer: () => void\n /** The pin toggle: pins/unpins, or floats the rail open/closed while narrow. */\n togglePin: () => void\n /** Open from the rail (its ask button): pins, or floats the rail open while narrow. */\n expand: () => void\n /** After a nav row is chosen: closes the drawer, and a floated rail the pointer has left. */\n afterNavigate: () => void\n}\n\n// A menu opened from the rail (the account menu) is positioned against the sidebar's current\n// layout. Hovering that menu from the content would expand the rail, re-anchor the menu under\n// the pointer and move the item being clicked, so hover does not expand the rail while one is open.\nconst isMenuOpen = () =>\n typeof document !== 'undefined' &&\n document.querySelector('[role=\"menu\"][data-state=\"open\"]') !== null\n\n/**\n * Sidebar behaviour as one hook, shared by every shell: resolves the layout (drawer / pinned /\n * rail) for the viewport, settles labels and tips around the width transition, and owns the hover,\n * pin and drawer rules:\n * - touch: the rail opens only through its toggle, never by the pointer enter of a tap;\n * - narrow: a pointer drifting over the rail does not float the labels over the content;\n * - Escape closes a floated rail; the drawer closes itself when the viewport grows past a phone;\n * - choosing a row closes the drawer, and a floated rail unless the pointer is still over it.\n *\n * State is controlled per field (`isPinned`, `isHovering`, `isDrawerOpen`) so an app can keep it\n * in its own store, or uncontrolled for a shell that does not care.\n */\nexport function useSidebarController(options: UseSidebarControllerOptions = {}): SidebarController {\n const [storedPinned, setPinned] = useControllableState(\n options.isPinned,\n options.defaultPinned ?? true,\n options.onPinnedChange\n )\n const [isHovering, setHovering] = useControllableState(\n options.isHovering,\n false,\n options.onHoveringChange\n )\n const [isDrawerOpen, setDrawerOpen] = useControllableState(\n options.isDrawerOpen,\n false,\n options.onDrawerOpenChange\n )\n\n const isSmallScreen = useIsPhone()\n const isNarrow = useIsNarrow() || !!options.forceRail\n const isTouch = useIsTouchScreen()\n\n const layout = resolveSidebarLayout({\n isSmallScreen,\n isDrawerRequested: isDrawerOpen,\n isCollapsed: false,\n isPinned: storedPinned,\n isHovering,\n isNarrow,\n })\n const isDrawer = layout.mode === 'drawer'\n const { labelsExpanded, tipsVisible } = useSidebarSettle(layout.expanded)\n\n // Whether the pointer is physically over the sidebar (decides if navigating closes the rail).\n const isPointerOver = useRef(false)\n\n const closeDrawer = useCallback(() => setDrawerOpen(false), [setDrawerOpen])\n const openDrawer = useCallback(() => setDrawerOpen(true), [setDrawerOpen])\n\n // The floated rail has no modal behaviour (the drawer gets Escape from `Sidebar.Root`).\n useCloseOnEscape(layout.mode === 'rail' && layout.hovering, () => setHovering(false))\n\n // A drawer left open when the viewport grows past a phone (rotate/resize) would be a stuck overlay.\n useEffect(() => {\n if (isDrawerOpen && !isSmallScreen) setDrawerOpen(false)\n }, [isDrawerOpen, isSmallScreen, setDrawerOpen])\n\n const onPointerEnter = (event: PointerEvent<HTMLElement>) => {\n // Primary-input media queries can report touch even while a mouse is in use.\n if (event.pointerType !== 'mouse' && options.hoverExpansion !== 'all') return\n isPointerOver.current = true\n if (\n !isSmallScreen &&\n (!isNarrow || options.hoverExpansion === 'all') &&\n (!isMenuOpen() || options.hoverExpansion === 'all')\n )\n setHovering(true)\n }\n const onPointerLeave = (event: PointerEvent<HTMLElement>) => {\n if (event.pointerType !== 'mouse' && options.hoverExpansion !== 'all') return\n isPointerOver.current = false\n if (!isSmallScreen) setHovering(false)\n }\n\n return {\n layout,\n expanded: labelsExpanded,\n tipsVisible,\n isDrawer,\n isSmallScreen,\n isNarrow,\n isPinned: storedPinned && !isNarrow,\n rootProps: {\n mode: layout.mode,\n expanded: labelsExpanded,\n isHovering: layout.hovering,\n onBackdropClick: isDrawer ? closeDrawer : () => setHovering(false),\n hasRailBackdrop: isTouch,\n onPointerEnter,\n onPointerLeave,\n },\n openDrawer,\n closeDrawer,\n togglePin: () => (isNarrow ? setHovering(!isHovering) : setPinned(!storedPinned)),\n expand: () => (isNarrow ? setHovering(true) : setPinned(true)),\n afterNavigate: () => {\n if (!isPointerOver.current && !storedPinned) setHovering(false)\n if (isDrawer) closeDrawer()\n },\n }\n}\n","import { useContext, type ReactNode } from 'react'\nimport { cn, Tooltip, TooltipContent, TooltipTrigger } from '@arbidocs/react/ui'\nimport { BlocksTooltipProvider } from '../provider/TooltipScope'\nimport { SidebarRowHoverContext } from './Sidebar'\n\nexport type SidebarRowActionPulse = 'active' | 'success' | 'error'\n\nexport interface SidebarRowActionProps {\n /** The row this control sits on is selected: the glyph takes the selection ink. */\n active?: boolean\n onClick?: () => void\n /** Tooltip text and accessible label. */\n label: string\n /**\n * Demand attention while the row is idle: `active` pulses primary (work in progress),\n * `success` pulses green (just finished), `error` is a steady red alert. A selected row wins.\n */\n pulse?: SidebarRowActionPulse | null\n 'data-testid'?: string\n children: ReactNode\n}\n\nconst PULSE_STYLES: Record<SidebarRowActionPulse, string> = {\n active: 'animate-pulse-attention text-primary',\n success: 'animate-pulse-attention text-green-text',\n // Steady (not animated) so a failure stays put and reads as a standing alert.\n error: 'text-red-text opacity-100',\n}\n\n/**\n * The secondary control at the right edge of a sidebar row: a small muted glyph. Always visible\n * (touch has no hover); hovering or focusing the row only brightens it a tone, through\n * SidebarRowHoverContext. Stops propagation so it never triggers the row's own click.\n */\nexport function SidebarRowAction({\n active = false,\n onClick,\n label,\n pulse = null,\n 'data-testid': testId,\n children,\n}: SidebarRowActionProps) {\n const rowHovered = useContext(SidebarRowHoverContext)\n\n const tone = active\n ? 'text-accent-foreground hover:bg-background/60'\n : pulse\n ? `${PULSE_STYLES[pulse]} hover:bg-muted`\n : cn(\n 'text-muted-foreground hover:bg-muted hover:text-foreground',\n rowHovered ? 'opacity-100' : 'opacity-70'\n )\n\n return (\n <BlocksTooltipProvider>\n <Tooltip>\n <TooltipTrigger asChild onFocusCapture={(e) => e.stopPropagation()}>\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation()\n onClick?.()\n }}\n aria-label={label}\n data-slot=\"sidebar-row-action\"\n data-testid={testId}\n className={cn('rounded-md p-1 transition-colors pointer-coarse:p-2.5', tone)}\n >\n {children}\n </button>\n </TooltipTrigger>\n <TooltipContent side=\"right\">{label}</TooltipContent>\n </Tooltip>\n </BlocksTooltipProvider>\n )\n}\n","import type { InputHTMLAttributes, KeyboardEvent, ReactNode, Ref } from 'react'\nimport { ArrowUp, Search, Sparkles, X } from 'lucide-react'\nimport { Button, cn } from '@arbidocs/react/ui'\nimport { testIdOr } from '../chat/test-id'\n\n/** Fixed strings of the ask field, its trigger and the expanded row. */\nexport interface AskFieldLabels {\n /** Input placeholder (the `placeholder` prop wins). */\n placeholder: string\n /** The input's accessible name. */\n inputLabel: string\n search: string\n askAi: string\n /** The icon-only trigger. */\n askOrSearch: string\n closeSearch: string\n}\n\nexport const DEFAULT_ASK_FIELD_LABELS: AskFieldLabels = {\n placeholder: 'Ask or search…',\n inputLabel: 'Ask AI or search your documents',\n search: 'Search',\n askAi: 'Ask AI',\n askOrSearch: 'Ask AI or search',\n closeSearch: 'Close search',\n}\n\nexport interface AskFieldProps {\n value: string\n onValueChange: (value: string) => void\n /** Enter / the arrow button: ask AI. */\n onAsk: (text: string) => void\n /** The magnifier button: semantic search. */\n onSearch: (text: string) => void\n /** Intercept keys first (e.g. a slash menu); call `preventDefault` to stop the default Enter-asks. */\n onInputKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void\n /** Rendered just under the field at its width (a slash/autocomplete menu). */\n menu?: ReactNode\n inputRef?: Ref<HTMLInputElement>\n /** Extra attributes for the input, e.g. the combobox props of `useListKeyNav` for a slash menu. */\n inputProps?: InputHTMLAttributes<HTMLInputElement>\n placeholder?: string\n labels?: Partial<AskFieldLabels>\n autoFocus?: boolean\n className?: string\n /** Root id (default `workspace-ask-bar`); the input/search/submit ids are `<root>-input|search|submit`. */\n 'data-testid'?: string\n}\n\n/**\n * The compact one-line ask/search field: sparkle, input, then two icon doors (Search, Ask AI).\n * Text and the menu are controlled by the host, so the same field serves the sidebar, the phone\n * app bar and any custom shell.\n */\nexport function AskField({\n value,\n onValueChange,\n onAsk,\n onSearch,\n onInputKeyDown,\n menu,\n inputRef,\n inputProps,\n placeholder,\n labels,\n autoFocus = false,\n className,\n 'data-testid': testIdProp,\n}: AskFieldProps) {\n const testId = testIdOr(testIdProp, { testId: 'workspace-ask-bar' })\n const l = { ...DEFAULT_ASK_FIELD_LABELS, ...labels }\n const isEmpty = !value.trim()\n const submit = (handler: (text: string) => void) => {\n const text = value.trim()\n if (text) handler(text)\n }\n\n return (\n <div className={cn('relative', className)} data-slot=\"ask-field\" data-testid={testId}>\n {menu && <div className=\"absolute inset-x-0 top-9 z-30\">{menu}</div>}\n <div\n role=\"search\"\n className=\"flex h-9 items-center gap-0.5 rounded-md border border-border bg-background pl-2.5 pr-0.5 transition-colors focus-within:border-primary focus-within:ring-3 focus-within:ring-primary pointer-coarse:h-11\"\n >\n <Sparkles aria-hidden=\"true\" className=\"size-4 shrink-0 text-ai-ink\" />\n <input\n {...inputProps}\n ref={inputRef}\n type=\"text\"\n value={value}\n onChange={(e) => onValueChange(e.target.value)}\n onKeyDown={(e) => {\n onInputKeyDown?.(e)\n // Enter asks (not mid-IME-composition). A plain div, not a <form>.\n if (e.defaultPrevented) return\n if (e.key === 'Enter' && !e.nativeEvent.isComposing) {\n e.preventDefault()\n submit(onAsk)\n }\n }}\n placeholder={placeholder ?? l.placeholder}\n aria-label={l.inputLabel}\n autoFocus={autoFocus}\n className=\"ml-1.5 h-8 min-w-0 flex-1 bg-transparent pointer-coarse:h-11 text-sm text-foreground outline-none placeholder:text-muted-foreground\"\n data-testid={`${testId}-input`}\n />\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n disabled={isEmpty}\n onClick={() => submit(onSearch)}\n title={l.search}\n aria-label={l.search}\n className=\"size-7 shrink-0 text-muted-foreground hover:text-foreground pointer-coarse:size-10\"\n data-testid={`${testId}-search`}\n >\n <Search className=\"size-4\" />\n </Button>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n disabled={isEmpty}\n onClick={() => submit(onAsk)}\n title={l.askAi}\n aria-label={l.askAi}\n className=\"!inline-flex size-7 shrink-0 text-ai-ink hover:bg-ai-soft hover:text-ai-ink pointer-coarse:size-10\"\n data-testid={`${testId}-submit`}\n >\n <ArrowUp className=\"size-4\" />\n </Button>\n </div>\n </div>\n )\n}\n\nexport interface AskTriggerProps {\n /** Opens the ask field (or the palette): one action that asks AI and searches. */\n onClick: () => void\n /** `rail`: the icon-only sidebar's bordered tile; `appbar`: the phone app bar's bare icon. */\n variant?: 'rail' | 'appbar'\n labels?: Partial<Pick<AskFieldLabels, 'askOrSearch'>>\n 'data-testid'?: string\n}\n\n/** The icon that stands in for the field where there is no room for it. */\nexport function AskTrigger({\n onClick,\n variant = 'rail',\n labels,\n 'data-testid': testId,\n}: AskTriggerProps) {\n const text = labels?.askOrSearch ?? DEFAULT_ASK_FIELD_LABELS.askOrSearch\n return (\n <button\n type=\"button\"\n onClick={onClick}\n title={text}\n aria-label={text}\n data-slot=\"ask-trigger\"\n data-testid={testId}\n className={cn(\n 'flex items-center justify-center rounded-md text-ai-ink transition-colors hover:bg-ai-soft',\n variant === 'rail'\n ? 'h-9 w-12 border border-border bg-background pointer-coarse:h-11'\n : 'size-11'\n )}\n >\n <Sparkles className={variant === 'rail' ? 'size-4' : 'size-5'} />\n </button>\n )\n}\n\nexport interface AskRowProps {\n /** The field (an AskField). */\n children: ReactNode\n onClose: () => void\n labels?: Partial<Pick<AskFieldLabels, 'closeSearch'>>\n /** Row id (default `workspace-ask-bar-expanded`). */\n 'data-testid'?: string\n /** Collapse button id (default `workspace-ask-bar-collapse`). */\n collapseTestId?: string\n}\n\n/** The phone's expanded ask row: takes over the app bar so there is room to type; Escape closes. */\nexport function AskRow({\n children,\n onClose,\n labels,\n 'data-testid': testId,\n collapseTestId,\n}: AskRowProps) {\n return (\n <div\n className=\"flex h-14 flex-shrink-0 items-center gap-1 bg-background px-3 pt-safe\"\n data-slot=\"ask-row\"\n data-testid={testIdOr(testId, { testId: 'workspace-ask-bar-expanded' })}\n onKeyDown={(e) => {\n if (e.key === 'Escape' && !e.defaultPrevented) onClose()\n }}\n >\n <div className=\"min-w-0 flex-1\">{children}</div>\n <button\n type=\"button\"\n onClick={onClose}\n aria-label={labels?.closeSearch ?? DEFAULT_ASK_FIELD_LABELS.closeSearch}\n data-testid={testIdOr(collapseTestId, { testId: 'workspace-ask-bar-collapse' })}\n className=\"flex size-11 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground\"\n >\n <X className=\"size-5\" />\n </button>\n </div>\n )\n}\n","import { useId, type MouseEvent, type ReactNode } from 'react'\nimport type { ShellActionLayout } from './types'\n\nexport interface ActionClusterProps {\n /**\n * `bar`: one row for a page header or phone app bar (status, bell, contacts, account).\n * `sidebar`: the bottom of the expanded sidebar: the bell and contacts rows stacked above the\n * account row.\n * `rail`: the same stack on the icon-only rail (same order, icon-only rows).\n * `drawer`: the phone drawer's rows (bell and contacts only; the app bar carries the account).\n */\n layout?: ShellActionLayout\n /** Status pill (remote control); `bar` only. Other layouts show status in their own rows. */\n status?: ReactNode\n /** Report a problem (bug icon), first in the cluster. */\n report?: ReactNode\n /** Notification bell (the kit's NotificationBell, or a `Sidebar.BadgeRow`). */\n mail?: ReactNode\n /** Calendar entry (a `Sidebar.BadgeRow`), right after mail. */\n calendar?: ReactNode\n /** Databases entry (a `Sidebar.BadgeRow`), right after calendar. */\n databases?: ReactNode\n bell?: ReactNode\n /** Contacts / messages entry with its own badge (a `Sidebar.BadgeRow`). */\n contacts?: ReactNode\n /** Account menu (the kit's UserMenu). */\n account?: ReactNode\n /**\n * Names the cluster: the group's accessible name in every layout, and a visible heading above\n * the rows in the `drawer` layout (where phones otherwise get unlabelled rows).\n */\n label?: string\n 'data-testid'?: string\n}\n\n/**\n * The account area: notifications, contacts and the account menu, in one of four placements. In\n * the sidebar and on the rail the two badge rows are stacked above the account row in the same\n * order, so nothing moves when the rail expands; the account menu holds everything else (help,\n * settings, tips, processing).\n */\nexport function ActionCluster({\n layout = 'bar',\n status,\n report,\n mail,\n calendar,\n databases,\n bell,\n contacts,\n account,\n label,\n 'data-testid': testId = 'sidebar-actions',\n}: ActionClusterProps) {\n const labelId = useId()\n // Dashboard's content area resets focus on click, and Radix PORTALS bubble through the React\n // tree: stop clicks here or a dropdown item (e.g. \"View all\") would un-focus the panel it opened.\n const stop = (e: MouseEvent) => e.stopPropagation()\n\n if (layout === 'sidebar' || layout === 'rail' || layout === 'drawer') {\n const rail = layout === 'rail'\n return (\n <div\n className={rail ? 'flex flex-col items-center gap-0.5' : 'flex flex-col gap-0.5'}\n onClick={stop}\n role={label ? 'group' : undefined}\n aria-labelledby={label && layout === 'drawer' ? labelId : undefined}\n aria-label={label && layout !== 'drawer' ? label : undefined}\n data-slot=\"action-cluster\"\n data-layout={layout}\n data-testid={testId}\n >\n {label && layout === 'drawer' && (\n <p\n id={labelId}\n className=\"px-3 pb-1 pt-2 text-xs font-semibold uppercase tracking-wider text-muted-foreground\"\n data-slot=\"action-cluster-label\"\n >\n {label}\n </p>\n )}\n {bell}\n {mail}\n {calendar}\n {databases}\n {contacts}\n {report}\n {account && layout !== 'drawer' && (\n <div className={rail ? 'mt-1' : 'mt-1 min-w-0'}>{account}</div>\n )}\n </div>\n )\n }\n\n return (\n <div\n className=\"flex items-center gap-1\"\n onClick={stop}\n role={label ? 'group' : undefined}\n aria-label={label}\n data-slot=\"action-cluster\"\n >\n {status}\n {report}\n {mail}\n {calendar}\n {databases}\n {bell}\n {contacts}\n {account}\n </div>\n )\n}\n","import { X } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { STATUS_ROW_BASE_CLASS, STATUS_ROW_TONES } from './status-row-styles'\n\nexport type StatusRowTone = 'progress' | 'success' | 'error'\n\nexport interface StatusRowProps {\n tone: StatusRowTone\n /** e.g. \"Processing 3 files…\". Always the accessible name; hidden visually when `compact`. */\n label: string\n /** Opens the thing the status is about (the processing panel). */\n onClick: () => void\n /** Icon-only (the collapsed rail). */\n compact?: boolean\n 'data-testid'?: string\n}\n\n/**\n * A live status line for the sidebar footer: a spinner and a short sentence that opens the\n * thing it reports on. The host renders it ONLY while the state is relevant (work running,\n * something failed), so a quiet app shows nothing. Announced politely to screen readers.\n */\nexport function StatusRow({\n tone,\n label,\n onClick,\n compact = false,\n 'data-testid': testId,\n}: StatusRowProps) {\n const { className, Icon, spin } = STATUS_ROW_TONES[tone]\n return (\n <div role=\"status\" data-slot=\"status-row\" className={cn(compact && 'flex justify-center')}>\n <button\n type=\"button\"\n onClick={onClick}\n aria-label={label}\n title={label}\n data-testid={testId}\n data-tone={tone}\n className={cn(\n STATUS_ROW_BASE_CLASS,\n compact ? 'size-9 justify-center pointer-coarse:size-11' : 'w-full px-2.5 py-1.5',\n className\n )}\n >\n <Icon\n className={cn('size-4 shrink-0', spin && 'animate-spin motion-reduce:animate-none')}\n />\n {!compact && <span className=\"min-w-0 flex-1 truncate text-left\">{label}</span>}\n </button>\n </div>\n )\n}\n\n/** Short live state at a navigation row's right edge, replacing inventory counts. */\nexport function StatusBadge({\n tone,\n label,\n onClick,\n onDismiss,\n 'data-testid': testId,\n}: {\n tone: StatusRowTone\n label: string\n onClick?: () => void\n onDismiss?: () => void\n 'data-testid'?: string\n}) {\n const className = cn(\n 'rounded-md px-1.5 py-0.5 text-xs font-medium whitespace-nowrap',\n STATUS_ROW_TONES[tone].className\n )\n return (\n <span\n role=\"status\"\n className={cn(\n 'ml-auto inline-flex items-center rounded-md',\n STATUS_ROW_TONES[tone].className\n )}\n data-testid={testId}\n data-tone={tone}\n >\n {onClick ? (\n <button\n type=\"button\"\n title={label}\n className={className}\n onClick={(event) => {\n event.stopPropagation()\n onClick()\n }}\n onKeyDown={(event) => event.stopPropagation()}\n >\n {label}\n </button>\n ) : (\n <span className={className}>{label}</span>\n )}\n {onDismiss && (\n <button\n type=\"button\"\n aria-label={`Dismiss ${label}`}\n title=\"Dismiss\"\n className=\"mr-1 rounded-sm p-0.5 opacity-60 hover:opacity-100 focus-visible:ring-2 focus-visible:ring-ring\"\n onClick={(event) => {\n event.stopPropagation()\n onDismiss()\n }}\n onKeyDown={(event) => event.stopPropagation()}\n >\n <X className=\"size-3\" />\n </button>\n )}\n </span>\n )\n}\n","import { RefreshCw, TriangleAlert, WifiOff } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { testIdOr } from '../chat/test-id'\nimport { SidebarRowHoverContext } from './Sidebar'\nimport { SidebarRowAction } from './SidebarRowAction'\n\nexport type OfflinePillTone = 'offline' | 'failed' | 'syncing'\n\n/** Fixed strings of the offline pill. */\nexport interface OfflinePillLabels {\n reconnect: string\n}\n\nexport const DEFAULT_OFFLINE_PILL_LABELS: OfflinePillLabels = {\n reconnect: 'Reconnect',\n}\n\nexport interface OfflinePillProps {\n tone: OfflinePillTone\n /** e.g. \"Offline · 3 pending\", \"2 failed to sync\", \"Syncing 4…\". */\n label: string\n /** Icon-only (the collapsed rail / app bar). */\n compact?: boolean\n /** Opens the pending-changes list. */\n onOpen: () => void\n /** Offered beside the pill (only when not compact); pass it only while it can do something. */\n onReconnect?: () => void\n labels?: Partial<OfflinePillLabels>\n /** Pill button id (default `offline-sync-status`). */\n 'data-testid'?: string\n /** Reconnect button id (default `offline-reconnect-button`). */\n reconnectTestId?: string\n}\n\nconst TONES: Record<OfflinePillTone, { className: string; Icon: typeof WifiOff }> = {\n offline: { className: 'bg-yellow-bg text-yellow-text', Icon: WifiOff },\n failed: { className: 'bg-red-bg text-red-text', Icon: TriangleAlert },\n syncing: { className: 'bg-blue-bg text-blue-text', Icon: RefreshCw },\n}\n\n/**\n * Connection + sync indicator: a status pill that opens the pending-changes list, plus an\n * optional Reconnect button beside it. The app renders it only when there is something to say\n * (offline, or changes waiting/failing), so online-and-synced stays clean.\n */\nexport function OfflinePill({\n tone,\n label,\n compact = false,\n onOpen,\n onReconnect,\n labels,\n 'data-testid': testId,\n reconnectTestId,\n}: OfflinePillProps) {\n const { className, Icon } = TONES[tone]\n return (\n <div\n className={cn('flex items-center gap-1', compact && 'justify-center')}\n data-slot=\"offline-pill\"\n >\n <button\n type=\"button\"\n data-testid={testIdOr(testId, { testId: 'offline-sync-status' })}\n aria-label={label}\n title={label}\n onClick={onOpen}\n className={cn(\n 'flex min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-md px-2.5 py-1.5 text-sm font-medium transition-colors hover:brightness-95 pointer-coarse:min-h-11',\n compact && 'flex-none justify-center',\n className\n )}\n >\n <Icon className={cn('size-4 shrink-0', tone === 'syncing' && 'animate-spin')} />\n {!compact && <span className=\"truncate\">{label}</span>}\n </button>\n {!compact && onReconnect && (\n // Forced visible (context true): there is no row to hover.\n <SidebarRowHoverContext.Provider value={true}>\n <SidebarRowAction\n label={labels?.reconnect ?? DEFAULT_OFFLINE_PILL_LABELS.reconnect}\n onClick={onReconnect}\n data-testid={testIdOr(reconnectTestId, { testId: 'offline-reconnect-button' })}\n >\n <RefreshCw className=\"size-5\" />\n </SidebarRowAction>\n </SidebarRowHoverContext.Provider>\n )}\n </div>\n )\n}\n","import { MousePointerClick, X } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { testIdOr } from '../chat/test-id'\n\n/** Fixed strings of the remote-control pill. */\nexport interface RemoteControlPillLabels {\n /** The disable button (the `disableLabel` prop wins). */\n turnOffRemoteControl: string\n}\n\nexport const DEFAULT_REMOTE_CONTROL_PILL_LABELS: RemoteControlPillLabels = {\n turnOffRemoteControl: 'Turn off remote control',\n}\n\nexport interface RemoteControlPillProps {\n /** A run is actively driving the screen (tinted + pulsing). */\n isActive: boolean\n label: string\n onDisable: () => void\n disableLabel?: string\n labels?: Partial<RemoteControlPillLabels>\n /** Root id (default `remote-control-indicator`). */\n 'data-testid'?: string\n /** Disable button id (default `remote-control-indicator-disable`). */\n disableTestId?: string\n}\n\n/**\n * Persistent, unobtrusive status pill shown while remote control is on or a run is executing,\n * with a one-click disable. The app decides when to mount it.\n */\nexport function RemoteControlPill({\n isActive,\n label,\n onDisable,\n disableLabel: disableLabelProp,\n labels,\n 'data-testid': testId,\n disableTestId,\n}: RemoteControlPillProps) {\n const disableLabel =\n disableLabelProp ??\n labels?.turnOffRemoteControl ??\n DEFAULT_REMOTE_CONTROL_PILL_LABELS.turnOffRemoteControl\n return (\n <div\n data-slot=\"remote-control-pill\"\n // Remote control's own control: a remote run never acts inside it.\n data-remote-control-surface=\"\"\n data-testid={testIdOr(testId, { testId: 'remote-control-indicator' })}\n className={cn(\n 'flex min-w-0 max-w-full items-center gap-1.5 rounded-full py-1 pl-2.5 pr-1 text-xs font-medium',\n isActive ? 'bg-accent text-accent-foreground' : 'bg-muted text-muted-foreground'\n )}\n >\n <MousePointerClick className={cn('size-3.5 shrink-0', isActive && 'animate-pulse')} />\n <span className=\"min-w-0 max-w-[16rem] truncate\">{label}</span>\n <button\n type=\"button\"\n onClick={onDisable}\n title={disableLabel}\n aria-label={disableLabel}\n data-testid={testIdOr(disableTestId, { testId: 'remote-control-indicator-disable' })}\n className=\"flex size-5 shrink-0 items-center justify-center rounded-full transition-colors hover:bg-foreground/10 hover:text-foreground pointer-coarse:size-8\"\n >\n <X className=\"size-3.5\" />\n </button>\n </div>\n )\n}\n","import type { ReactNode } from 'react'\nimport { ChevronLeft, ChevronRight, Lightbulb, Pencil, X } from 'lucide-react'\nimport { Button, cn } from '@arbidocs/react/ui'\nimport { testIdOr } from '../chat/test-id'\n\n/** Fixed strings of the tip card. */\nexport interface TipCardLabels {\n /** Default CTA text (the `ctaLabel` prop wins). */\n showMe: string\n previousTip: string\n nextTip: string\n editTip: string\n /** The card's heading and accessible name. */\n tip: string\n /** The dismiss button: it turns tips off (they come back from the account menu). */\n hideTips: string\n /** \"1 of 3\". */\n position: (index: number, count: number) => string\n}\n\nexport const DEFAULT_TIP_CARD_LABELS: TipCardLabels = {\n showMe: 'Show me',\n previousTip: 'Previous tip',\n nextTip: 'Next tip',\n editTip: 'Edit tip',\n tip: 'Tip',\n hideTips: 'Hide tips',\n position: (index, count) => `${index} of ${count}`,\n}\n\nexport interface TipCardProps {\n /** The tip text: one sentence. */\n message: ReactNode\n /** Which tip is showing (0-based) out of `count`; the pager appears when `count` > 1. */\n index?: number\n count?: number\n onPrev?: () => void\n onNext?: () => void\n /** The single primary action; omit when the tip has none. */\n ctaLabel?: string\n onCta?: () => void\n /** Turns tips off. The card is dismissible so it never becomes permanent furniture. */\n onDismiss?: () => void\n /** Dev-only edit affordance: the host passes it only in development builds. */\n onEdit?: () => void\n /** Hover pauses the host's tip rotation (desktop enhancement). */\n onHoverChange?: (hovered: boolean) => void\n labels?: Partial<TipCardLabels>\n className?: string\n /** Card id (default `tip-row`). */\n testId?: string\n /** Control ids; defaults are the current ids. */\n testIds?: Partial<Record<'prev' | 'next' | 'cta' | 'edit' | 'dismiss', string>>\n}\n\nconst ICON_BUTTON =\n 'flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:size-11'\n\n/**\n * The Smart Tips card: a compact muted tile. Header (bulb, \"Tip\", dismiss), one sentence, then\n * ONE primary action with a quiet \"n of m\" pager. It is shown only while tips are on and a tip\n * applies; the host owns which tip is current, rotation and the on/off preference.\n */\nexport function TipCard({\n message,\n index = 0,\n count = 1,\n onPrev,\n onNext,\n ctaLabel,\n onCta,\n onDismiss,\n onEdit,\n onHoverChange,\n labels,\n className,\n testId,\n testIds,\n}: TipCardProps) {\n const l = { ...DEFAULT_TIP_CARD_LABELS, ...labels }\n const hasMany = count > 1\n\n return (\n <section\n data-slot=\"tip-card\"\n aria-label={l.tip}\n className={cn('min-w-0 rounded-lg bg-muted p-3 text-sm', className)}\n onMouseEnter={() => onHoverChange?.(true)}\n onMouseLeave={() => onHoverChange?.(false)}\n data-testid={testIdOr(testId, { testId: 'tip-row' })}\n >\n <div className=\"-my-1 flex items-center gap-1.5 text-xs font-medium text-muted-foreground\">\n <Lightbulb className=\"size-4 shrink-0 text-primary\" aria-hidden />\n <span>{l.tip}</span>\n <span className=\"-mr-1.5 ml-auto flex items-center\">\n {onEdit && (\n <button\n type=\"button\"\n onClick={onEdit}\n aria-label={l.editTip}\n title={l.editTip}\n className={cn(ICON_BUTTON, 'text-red-text hover:bg-red-bg hover:text-red-text')}\n data-testid={testIdOr(testIds?.edit, { testId: 'tip-edit' })}\n >\n <Pencil className=\"size-3.5\" />\n </button>\n )}\n {onDismiss && (\n <button\n type=\"button\"\n onClick={onDismiss}\n aria-label={l.hideTips}\n title={l.hideTips}\n className={ICON_BUTTON}\n data-testid={testIdOr(testIds?.dismiss, { testId: 'tip-dismiss' })}\n >\n <X className=\"size-4\" />\n </button>\n )}\n </span>\n </div>\n <p className=\"mt-2 text-foreground\">{message}</p>\n {(onCta || hasMany) && (\n <div className=\"mt-3 flex items-center justify-between gap-2\">\n {onCta ? (\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n onClick={onCta}\n className=\"font-medium text-primary\"\n data-testid={testIdOr(testIds?.cta, { testId: 'page-header-info-cta' })}\n >\n {ctaLabel ?? l.showMe}\n </Button>\n ) : (\n <span />\n )}\n {hasMany && (\n <span className=\"-mr-1.5 flex items-center text-xs text-muted-foreground\">\n <button\n type=\"button\"\n onClick={onPrev}\n aria-label={l.previousTip}\n title={l.previousTip}\n className={ICON_BUTTON}\n data-testid={testIdOr(testIds?.prev, { testId: 'tip-prev' })}\n >\n <ChevronLeft className=\"size-4\" />\n </button>\n <span className=\"min-w-10 text-center tabular-nums\" aria-live=\"polite\">\n {l.position(index + 1, count)}\n </span>\n <button\n type=\"button\"\n onClick={onNext}\n aria-label={l.nextTip}\n title={l.nextTip}\n className={ICON_BUTTON}\n data-testid={testIdOr(testIds?.next, { testId: 'tip-next' })}\n >\n <ChevronRight className=\"size-4\" />\n </button>\n </span>\n )}\n </div>\n )}\n </section>\n )\n}\n","/**\n * DockZone Component\n *\n * Layout wrapper that provides a resizable right-hand panel area (#dock-zone)\n * where panels in 'docked' mode render via PanelPortal.\n *\n * Uses MutationObserver on the #dock-zone element to detect when content is\n * portaled in/out, so the split layout appears only when a panel is actually\n * mounted — not just when the store says a panel prefers 'docked' mode.\n *\n * The dock zone reads its initial width from the child's data-dock-width\n * attribute (pixels). If absent, defaults to 50% of the container.\n *\n * Below MOBILE_BREAKPOINT_PX, MIN_MAIN_PX + MIN_DOCK_PX (500px combined)\n * can't both fit — the clamp math still ran unconditionally and squeezed the\n * dock pane down to whatever sliver was left (as little as ~90px on a 390px\n * phone), rendering both panes as unusable slivers instead of showing either\n * one properly. Below that width this becomes a single full-width view that\n * swaps between main and docked content instead of splitting — same\n * principle as the Document Viewer's own view-swap (Edit ⇄ Track Changes).\n */\n\nimport { useCallback, useEffect, useRef, useState } from 'react'\nimport { cn } from '@arbidocs/react/ui'\n\nconst MIN_DOCK_PX = 200\nconst MIN_MAIN_PX = 300\n// Standard right-panel width — matches the overlay sheet (sm:w-[34rem]) so a\n// panel is the same size whether it's pinned or floating. Pinned stays\n// draggable from here; floating is fixed.\nconst DEFAULT_DOCK_PX = 544\nconst MOBILE_BREAKPOINT_PX = 640\n\ninterface DockZoneProps {\n children: React.ReactNode\n 'data-testid'?: string\n}\n\nexport function DockZone({ children, ...props }: DockZoneProps) {\n const [hasDockedContent, setHasDockedContent] = useState(false)\n const [dockWidth, setDockWidth] = useState<number | null>(null)\n const [isResizing, setIsResizing] = useState(false)\n const [dragPosition, setDragPosition] = useState<number | null>(null)\n const [containerWidth, setContainerWidth] = useState(0)\n const containerRef = useRef<HTMLDivElement>(null)\n const dockZoneRef = useRef<HTMLDivElement>(null)\n\n useEffect(() => {\n const el = containerRef.current\n if (!el) return\n const observer = new ResizeObserver((entries) => {\n const width = entries[0]?.contentRect.width\n if (width !== undefined) setContainerWidth(width)\n })\n observer.observe(el)\n return () => observer.disconnect()\n }, [])\n\n const isMobile = containerWidth > 0 && containerWidth < MOBILE_BREAKPOINT_PX\n\n // Observe dock-zone children to know when content is actually portaled in\n // Also read initial width from the child's data-dock-width attribute\n useEffect(() => {\n const el = dockZoneRef.current\n if (!el) return\n\n const update = () => {\n const hasChildren = el.children.length > 0\n setHasDockedContent(hasChildren)\n if (hasChildren) {\n const requestedWidth = el.firstElementChild?.getAttribute('data-dock-width')\n if (requestedWidth) {\n setDockWidth(parseInt(requestedWidth, 10))\n }\n }\n }\n\n const observer = new MutationObserver(update)\n update()\n observer.observe(el, { childList: true })\n return () => observer.disconnect()\n }, [])\n\n const handleMouseDown = useCallback(() => {\n setIsResizing(true)\n setDragPosition(null)\n }, [])\n\n const handleMouseMove = useCallback(\n (e: MouseEvent) => {\n if (!isResizing || !containerRef.current) return\n const rect = containerRef.current.getBoundingClientRect()\n const x = e.clientX - rect.left\n // Clamp so neither pane gets too small\n const clamped = Math.min(Math.max(x, MIN_MAIN_PX), rect.width - MIN_DOCK_PX)\n setDragPosition(clamped)\n },\n [isResizing]\n )\n\n const handleMouseUp = useCallback(() => {\n if (dragPosition !== null && containerRef.current) {\n const containerWidth = containerRef.current.getBoundingClientRect().width\n setDockWidth(containerWidth - dragPosition)\n }\n setIsResizing(false)\n setDragPosition(null)\n }, [dragPosition])\n\n useEffect(() => {\n if (!isResizing) return\n document.addEventListener('mousemove', handleMouseMove)\n document.addEventListener('mouseup', handleMouseUp)\n document.body.style.cursor = 'col-resize'\n document.body.style.userSelect = 'none'\n return () => {\n document.removeEventListener('mousemove', handleMouseMove)\n document.removeEventListener('mouseup', handleMouseUp)\n document.body.style.cursor = ''\n document.body.style.userSelect = ''\n }\n }, [isResizing, handleMouseMove, handleMouseUp])\n\n // Below the mobile breakpoint there's no room to split at all — MIN_MAIN_PX\n // + MIN_DOCK_PX alone is 500px, wider than most phones. Show whichever\n // side is active at full width instead of squeezing both into slivers.\n const effectiveDockWidth =\n hasDockedContent && containerWidth > 0\n ? isMobile\n ? containerWidth\n : Math.min(\n Math.max(dockWidth ?? DEFAULT_DOCK_PX, MIN_DOCK_PX),\n containerWidth - MIN_MAIN_PX\n )\n : 0\n const mainHidden = isMobile && hasDockedContent\n\n return (\n <div ref={containerRef} className=\"h-full relative flex\" data-testid={props['data-testid']}>\n <div\n style={{\n width: mainHidden ? 0 : `calc(100% - ${effectiveDockWidth}px)`,\n // Reserve gutter space so the vertical scrollbar doesn't appear and\n // disappear as streaming content crosses the viewport boundary —\n // that toggle reflows the layout and reads as a screen-wide flicker.\n scrollbarGutter: 'stable',\n }}\n className={cn(\n // The CSS container for the page's @-variants (PageContainer must not be one; see there).\n '@container h-full overflow-auto',\n hasDockedContent && !isMobile && 'border-r',\n mainHidden && 'overflow-hidden',\n // Animate opening only. On close the portaled content has already\n // unmounted, so animating leaves an empty strip shrinking while the\n // page behind reflows — reads as flicker over heavy content like the\n // documents grid. Snap closed instead. Resizing is also instant so\n // the divider doesn't lag the cursor.\n hasDockedContent && !isResizing && 'transition-[width] duration-300 ease-in-out'\n )}\n aria-hidden={mainHidden}\n inert={mainHidden}\n data-scroll-container\n >\n {children}\n </div>\n\n {/* Wide grab zone with a visible grip, so the divider is findable and forgiving to hit */}\n {hasDockedContent && !isMobile && (\n <div\n className=\"group flex w-2 flex-shrink-0 cursor-col-resize items-center justify-center\"\n onMouseDown={handleMouseDown}\n data-testid=\"dock-resize-handle\"\n >\n <div className=\"h-12 w-1 rounded-full bg-muted-foreground/40 transition-colors group-hover:bg-primary\" />\n </div>\n )}\n\n <div\n ref={dockZoneRef}\n id=\"dock-zone\"\n style={{ width: effectiveDockWidth }}\n className={cn(\n 'h-full overflow-hidden flex-shrink-0',\n hasDockedContent && !isResizing && 'transition-[width] duration-300 ease-in-out'\n )}\n />\n\n {isResizing && dragPosition !== null && (\n <div\n className=\"absolute top-0 bottom-0 w-0.5 bg-primary z-50 pointer-events-none\"\n style={{ left: dragPosition }}\n />\n )}\n {isResizing && <div className=\"absolute inset-0 z-40 cursor-col-resize\" />}\n </div>\n )\n}\n","/**\n * PanelModeSwitcher Component\n *\n * User-selectable placements are: popped out, docked, or overlay. `main` is\n * NOT user-selectable — the system decides which surfaces render full-width\n * (e.g. the DM modal); the user just moves floating panels between popout /\n * docked / overlay. The switcher shows a button for each placement you're not\n * currently in (plus close):\n * - Popout/pop-in toggle (unless disablePopout).\n * - Split-screen button (when not docked).\n * - Float-as-overlay button (when not overlay).\n * - Popout mode shows just the pop-in toggle (the window has its own close).\n */\n\nimport { Button, Tooltip, TooltipContent, TooltipTrigger } from '@arbidocs/react/ui'\nimport { ExternalLink, PanelRight, PictureInPicture2, X } from 'lucide-react'\nimport type { MouseEvent, ReactNode } from 'react'\nimport type { ArbiPanelMode as PanelMode } from '@arbidocs/react'\nimport { useIsPhone, useMediaQuery } from '../lib/use-media-query'\n\nconst btnClass = 'h-7 w-7 p-0 text-muted-foreground hover:text-foreground'\n\ninterface SwitcherButtonProps {\n label: string\n /** True when rendered inside a popout window (see note below). */\n inPopout?: boolean\n onClick: (event: MouseEvent) => void\n testId: string\n children: ReactNode\n}\n\n// Icon-only buttons get a visible tooltip with their label, so the icon's meaning\n// is readable on hover and on keyboard focus. Radix tooltips portal into the main\n// window, which would misplace them inside a popout window, so there we fall back\n// to a native title.\nfunction SwitcherButton({\n label,\n inPopout = false,\n onClick,\n testId,\n children,\n}: SwitcherButtonProps) {\n const button = (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className={btnClass}\n aria-label={label}\n title={inPopout ? label : undefined}\n onClick={onClick}\n data-testid={testId}\n >\n {children}\n </Button>\n )\n if (inPopout) return button\n return (\n <Tooltip>\n <TooltipTrigger asChild>{button}</TooltipTrigger>\n <TooltipContent>{label}</TooltipContent>\n </Tooltip>\n )\n}\n\n// \"Open in new window\" (popout) and \"Float as overlay\" are desktop-only\n// window-management concepts — a tablet has no multi-window/overlay chrome to\n// pop into. 1024px mirrors the common tablet/small-laptop cutoff (Tailwind's\n// `lg`), the usual convention for viewport-driven chrome (as opposed to\n// DocumentViewer's container-width ResizeObserver, which fits ITS OWN toolbar buttons reflowing inside a panel\n// that can be split narrow on a wide desktop — PanelModeSwitcher instead needs\n// to know the actual device class, since popping into \"a new window\" or\n// \"floating overlay\" is meaningless on a touch tablet regardless of how the\n// panel happens to be sized in that moment). Deliberately separate from\n// `useIsPhone` (640px, phones only): this only needs to hide these two\n// buttons, not collapse the whole switcher, at tablet widths.\nconst TABLET_AND_BELOW_QUERY = '(max-width: 1024px)'\n\ninterface PanelModeSwitcherProps {\n mode: PanelMode\n onModeChange: (mode: PanelMode) => void\n onClose?: () => void\n /** When true, hides the popout button (e.g. for panels whose content breaks in a popup window) */\n disablePopout?: boolean\n /**\n * Override the close-button data-testid. Defaults to `dialog-close-button`\n * for backwards compatibility. Use a panel-specific value (e.g.\n * `close-viewer-button`) when there are multiple PanelModeSwitchers in the\n * DOM at once and tests need to disambiguate.\n */\n closeTestId?: string\n}\n\nexport function PanelModeSwitcher({\n mode,\n onModeChange,\n onClose,\n disablePopout,\n closeTestId = 'dialog-close-button',\n}: PanelModeSwitcherProps) {\n const isPopout = mode === 'popout'\n const isSmallScreen = useIsPhone()\n const isTabletAndBelow = useMediaQuery(TABLET_AND_BELOW_QUERY)\n\n // Closing is not a click into the panel: the panel's own click handler would focus the panel\n // that just closed, and the page's nav would lose its active row.\n const closeButton = onClose && (\n <SwitcherButton\n label=\"Close (Esc)\"\n onClick={(event) => {\n event.stopPropagation()\n onClose()\n }}\n testId={closeTestId}\n >\n <X className=\"w-3.5 h-3.5\" />\n </SwitcherButton>\n )\n\n // Phones: every panel is an overlay and mode-switching is disabled, so only\n // the close ✕ is meaningful.\n if (isSmallScreen) {\n return <div className=\"flex items-center gap-0.5 flex-shrink-0\">{closeButton}</div>\n }\n\n return (\n <div className=\"flex items-center gap-0.5 flex-shrink-0\">\n {/* Popout / pop-in toggle — hidden when disablePopout is set, or on\n tablet-and-below where \"a new window\" isn't a real concept. */}\n {!disablePopout && !isTabletAndBelow && (\n <SwitcherButton\n label={isPopout ? 'Pop back in' : 'Open in new window'}\n inPopout={isPopout}\n onClick={() => onModeChange(isPopout ? 'docked' : 'popout')}\n testId={isPopout ? 'pop-into-main-window-button' : 'open-in-new-window-button'}\n >\n <ExternalLink className=\"w-3.5 h-3.5\" />\n </SwitcherButton>\n )}\n\n {/* Split-screen (docked to the side) — shown when not already in it */}\n {!isPopout && mode !== 'docked' && (\n <SwitcherButton\n label=\"Split screen\"\n onClick={() => onModeChange('docked')}\n testId=\"dock-panel-button\"\n >\n <PanelRight className=\"w-3.5 h-3.5\" />\n </SwitcherButton>\n )}\n\n {/* Float as an overlay sheet — shown when not already an overlay, and\n not on tablet-and-below (no floating-window chrome to speak of). */}\n {!isPopout && mode !== 'overlay' && !isTabletAndBelow && (\n <SwitcherButton\n label=\"Float as overlay\"\n onClick={() => onModeChange('overlay')}\n testId=\"overlay-panel-button\"\n >\n <PictureInPicture2 className=\"w-3.5 h-3.5\" />\n </SwitcherButton>\n )}\n\n {/* All non-popout modes: ✕ to close */}\n {!isPopout && closeButton}\n </div>\n )\n}\n","/**\n * Window Manager for Pop-out Panels\n *\n * Handles creating, managing, and communicating with popup windows\n */\n\ninterface PopupWindow {\n id: string\n window: Window\n panelId: string\n rootElement: HTMLElement | null\n onClose?: () => void\n}\n\n/** Window lifecycle port; hosts may share or replace the browser implementation. */\nexport interface PanelWindows {\n createPopupWindow(panelId: string, onClose?: () => void, title?: string): string | null\n getWindow(windowId: string): Window | null\n getRootElement(windowId: string): HTMLElement | null\n focusPanelWindow(panelId: string): boolean\n clearOnClose(windowId: string): void\n closeWindow(windowId: string): void\n closeAllWindows(): void\n}\n\nclass PanelWindowManager implements PanelWindows {\n constructor(private readonly defaultTitle = 'Panel') {}\n private windows = new Map<string, PopupWindow>()\n\n createPopupWindow(panelId: string, onClose?: () => void, title?: string): string | null {\n const windowId = `panel-window-${panelId}`\n\n // Check if window already exists\n if (this.windows.has(windowId)) {\n const existing = this.windows.get(windowId)\n if (existing && !existing.window.closed) {\n existing.window.focus()\n return windowId\n } else {\n // Clean up closed window\n this.windows.delete(windowId)\n }\n }\n\n // Position popup in the right half of the screen\n const currentWidth = window.outerWidth\n const currentHeight = window.outerHeight\n const currentLeft = window.screenX ?? window.screenLeft ?? 0\n const currentTop = window.screenY ?? window.screenTop ?? 0\n\n // Calculate popup position (right half)\n const halfWidth = Math.floor(currentWidth / 2)\n const popupWidth = halfWidth\n const popupHeight = currentHeight\n const left = currentLeft + halfWidth\n const top = currentTop\n\n const popup = window.open(\n '',\n windowId,\n `width=${popupWidth},height=${popupHeight},left=${left},top=${top},scrollbars=yes,resizable=yes,menubar=no,toolbar=no,location=no,status=no`\n )\n\n if (!popup) {\n console.error('Failed to create popup window - popup blocked?')\n return null\n }\n\n // Set up the popup window HTML with proper CSS links\n const mainDocument = document\n const stylesheets = Array.from(\n mainDocument.head.querySelectorAll('link[rel=\"stylesheet\"], style')\n )\n .map((el) => el.outerHTML)\n .join('\\n')\n\n popup.document.write(`\n <!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title></title>\n <!-- about:blank has no base, so copied @font-face / asset URLs (e.g.\n /assets/font.woff2) would resolve against nothing and render as\n tofu squares. Anchor relative URLs to the app origin. -->\n <base href=\"${window.location.origin}/\">\n ${stylesheets}\n <style>\n body {\n margin: 0;\n padding: 0;\n font-family: system-ui, -apple-system, sans-serif;\n }\n #panel-root {\n width: 100%;\n height: 100vh;\n overflow: hidden;\n }\n * {\n box-sizing: border-box;\n }\n </style>\n </head>\n <body>\n <div id=\"panel-root\"></div>\n </body>\n </html>\n `)\n popup.document.close()\n // A host title is text, even when it contains HTML delimiters.\n popup.document.title = title || this.defaultTitle\n\n // Belt-and-suspenders: re-register the parent's already-loaded web fonts in\n // the popup's FontFaceSet, so glyphs render even if a copied @font-face\n // doesn't re-fetch. Best-effort — engines that reject a cross-document add\n // just fall back to the <base>-anchored @font-face rules above.\n try {\n mainDocument.fonts.forEach((font) => {\n try {\n popup.document.fonts.add(font)\n } catch {\n /* ignore per-font failures */\n }\n })\n } catch {\n /* FontFaceSet unavailable — ignore */\n }\n\n // Get root element after DOM is ready\n const rootElement = popup.document.getElementById('panel-root')\n\n // Store window reference\n const popupWindow: PopupWindow = {\n id: windowId,\n window: popup,\n panelId,\n rootElement,\n onClose,\n }\n this.windows.set(windowId, popupWindow)\n\n // Handle window close — read onClose from the map entry so clearOnClose() works\n const closeCheckInterval = setInterval(() => {\n if (popup.closed) {\n clearInterval(closeCheckInterval)\n const entry = this.windows.get(windowId)\n this.windows.delete(windowId)\n entry?.onClose?.()\n }\n }, 200)\n\n return windowId\n }\n\n getWindow(windowId: string): Window | null {\n const popup = this.windows.get(windowId)\n return popup && !popup.window.closed ? popup.window : null\n }\n\n getRootElement(windowId: string): HTMLElement | null {\n const popup = this.windows.get(windowId)\n return popup && !popup.window.closed ? popup.rootElement : null\n }\n\n /** Focus the popup window for a given panel ID. Returns true if focused. */\n focusPanelWindow(panelId: string): boolean {\n const windowId = `panel-window-panel-${panelId}`\n const popup = this.windows.get(windowId)\n if (popup && !popup.window.closed) {\n popup.window.focus()\n return true\n }\n return false\n }\n\n /** Remove the onClose callback so it won't fire when the window is closed programmatically. */\n clearOnClose(windowId: string): void {\n const popup = this.windows.get(windowId)\n if (popup) {\n popup.onClose = undefined\n }\n }\n\n closeWindow(windowId: string): void {\n const popup = this.windows.get(windowId)\n if (popup && !popup.window.closed) {\n popup.window.close()\n }\n this.windows.delete(windowId)\n }\n\n closeAllWindows(): void {\n for (const [, popup] of this.windows) {\n if (!popup.window.closed) {\n popup.window.close()\n }\n }\n this.windows.clear()\n }\n}\n\n/** A window registry shared by the host's panel controls and portal layer. */\nexport function createPanelWindowManager(options: { defaultTitle?: string } = {}) {\n return new PanelWindowManager(options.defaultTitle)\n}\n","import { useHost } from '../provider/host'\nimport { createPanelWindowManager, type PanelWindows } from './panel-windows'\n\n/** Browser windows and site-specific titles shared by a host's panel controls. */\nexport interface PanelHostSupport {\n windows?: PanelWindows\n popoutTitle?: (title: string) => string\n}\n\nconst defaultWindows = createPanelWindowManager()\nconst titleOnly = (title: string) => title\n\n/** Panel support from the existing ArbiHost; standalone panels share the browser defaults. */\nexport function usePanelHostSupport(): Required<PanelHostSupport> {\n const { panels } = useHost()\n return {\n windows: panels?.windows ?? defaultWindows,\n popoutTitle: panels?.popoutTitle ?? titleOnly,\n }\n}\n","/**\n * PanelPortal Component\n *\n * Thin portal layer that renders children into the right target based on panel mode:\n * - docked: portal to #dock-zone element\n * - overlay: portal to <body> as a slide-out sheet over a backdrop\n * - popout: portal to a separate browser window\n * - main: portal to #main-zone element\n *\n * Manages popup window lifecycle for popout mode.\n * Content-agnostic — just handles where things render.\n */\n\nimport { useCallback, useEffect, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\nimport { DEFAULT_OVERLAY_ZONE_ID } from './Shell'\nimport { usePanelHostSupport } from './panel-host'\nimport { PortalContainerProvider } from '@arbidocs/react/ui'\nimport type { FloatingPanelMode as PanelMode } from '../settings/FloatingPanel'\n\n// Overlay sheet sizing — defaults match the docked width (DEFAULT_DOCK_PX) so a\n// panel is the same size whether pinned or floating, and stays draggable here.\nconst OVERLAY_DEFAULT_PX = 544\nconst OVERLAY_MIN_PX = 360\n\nexport interface PanelPortalProps {\n panelId: string\n mode: PanelMode\n isOpen: boolean\n /** True while the overlay is animating out before unmounting. */\n isExiting?: boolean\n /** Called when popup window is closed externally (user closes the window) */\n onPopupClosed?: () => void\n /** Dismisses the panel — used by the overlay backdrop. */\n onClose?: () => void\n /** Window title for popout mode */\n popoutTitle?: string\n /** Initial overlay width in px (defaults to OVERLAY_DEFAULT_PX). */\n defaultWidth?: number\n children: React.ReactNode\n}\n\n/**\n * Overlay sheet — a slide-out panel over the still-visible page, resizable by\n * dragging its left edge. Slides in on mount and out (via isExiting) before\n * unmounting, mirroring the left sidebar's animation.\n */\nfunction OverlaySheet({\n panelId,\n isExiting,\n onClose,\n defaultWidth,\n scoped,\n children,\n}: {\n panelId: string\n isExiting?: boolean\n onClose?: () => void\n defaultWidth?: number\n /** Rendered inside the layout's overlay zone (below the topbar) rather than\n * over the whole viewport. */\n scoped?: boolean\n children: React.ReactNode\n}) {\n const [width, setWidth] = useState(defaultWidth ?? OVERLAY_DEFAULT_PX)\n const [isResizing, setIsResizing] = useState(false)\n // Live cursor position while dragging. The panel keeps its committed `width`\n // during the drag — only this thin preview line moves — so the heavy panel\n // content never reflows mid-drag (matching DockZone's split-screen handle).\n // The width is committed once on mouse-up.\n const [dragWidth, setDragWidth] = useState<number | null>(null)\n const dragWidthRef = useRef<number | null>(null)\n // Once the slide-in has played we drop the entry class, so later re-renders\n // don't restart the animation.\n const [hasEntered, setHasEntered] = useState(false)\n\n const handleResizeStart = useCallback((e: React.MouseEvent) => {\n e.preventDefault()\n setHasEntered(true)\n setIsResizing(true)\n setDragWidth(null)\n dragWidthRef.current = null\n }, [])\n\n useEffect(() => {\n if (!isResizing) return\n const handleMouseMove = (e: MouseEvent) => {\n // Anchored to the right edge — width grows as the cursor moves left.\n const max = window.innerWidth * 0.92\n const next = Math.min(Math.max(window.innerWidth - e.clientX, OVERLAY_MIN_PX), max)\n dragWidthRef.current = next\n setDragWidth(next)\n }\n const handleMouseUp = () => {\n if (dragWidthRef.current !== null) setWidth(dragWidthRef.current)\n setIsResizing(false)\n setDragWidth(null)\n dragWidthRef.current = null\n }\n document.addEventListener('mousemove', handleMouseMove)\n document.addEventListener('mouseup', handleMouseUp)\n document.body.style.cursor = 'col-resize'\n document.body.style.userSelect = 'none'\n return () => {\n document.removeEventListener('mousemove', handleMouseMove)\n document.removeEventListener('mouseup', handleMouseUp)\n document.body.style.cursor = ''\n document.body.style.userSelect = ''\n }\n }, [isResizing])\n\n return (\n // Scoped: absolute within the layout's overlay zone (below the topbar).\n // Unscoped fallback: fixed over the whole viewport, as before.\n <div\n className={scoped ? 'absolute inset-0 z-40' : 'fixed inset-0 z-50'}\n data-testid={`${panelId}-overlay`}\n >\n {/* In dark mode a 40% black veil crushes the light page text behind the sheet to\n mid-grey, so the veil is lighter there and the page stays readable underneath. */}\n <div\n className={`absolute inset-0 bg-black/40 dark:bg-black/20 duration-200 ${\n // fill-mode-forwards holds the exit end-state — without it the\n // element snaps back fully visible for the frames between the\n // animation finishing and React unmounting it (a flicker).\n isExiting ? 'animate-out fade-out fill-mode-forwards' : 'animate-in fade-in'\n }`}\n onClick={onClose}\n aria-hidden=\"true\"\n data-testid={`${panelId}-overlay-backdrop`}\n />\n <div\n style={{ width }}\n onAnimationEnd={() => !isExiting && setHasEntered(true)}\n className={`absolute right-0 top-0 bottom-0 flex max-w-[92vw] flex-col border-l max-sm:!w-full max-sm:!max-w-full max-sm:border-l-0 border-border bg-muted shadow-2xl duration-200 ${\n isExiting\n ? 'animate-out slide-out-to-right fill-mode-forwards'\n : // Suppress the slide transform once entered so it doesn't replay.\n hasEntered\n ? ''\n : 'animate-in slide-in-from-right'\n }`}\n >\n {/* Drag handle on the left edge to resize the sheet. */}\n <div\n className=\"absolute left-0 top-0 bottom-0 z-10 w-1.5 -translate-x-1/2 cursor-col-resize hover:bg-primary/40\"\n onMouseDown={handleResizeStart}\n data-testid={`${panelId}-overlay-resize-handle`}\n />\n {children}\n </div>\n\n {/* Preview line — tracks the cursor during the drag; the panel resizes\n to this position only on release. */}\n {isResizing && dragWidth !== null && (\n <div\n className=\"absolute top-0 bottom-0 z-[60] w-0.5 bg-primary pointer-events-none\"\n style={{ right: dragWidth }}\n />\n )}\n {/* Transparent capture layer so the drag isn't interrupted by elements\n (iframes, the grid) swallowing pointer events. */}\n {isResizing && <div className=\"absolute inset-0 z-[55] cursor-col-resize\" />}\n </div>\n )\n}\n\nexport function PanelPortal({\n panelId,\n mode,\n isOpen,\n isExiting,\n onPopupClosed,\n onClose,\n popoutTitle,\n defaultWidth,\n children,\n}: PanelPortalProps) {\n const { windows: windowManager } = usePanelHostSupport()\n const [popupRoot, setPopupRoot] = useState<HTMLElement | null>(null)\n const popupWindowIdRef = useRef<string | null>(null)\n\n // Open popup window when switching to popout mode\n useEffect(() => {\n if (!isOpen || mode !== 'popout') {\n // Close popup if we're leaving popout mode (intentional mode switch, not user closing)\n if (popupWindowIdRef.current) {\n // Clear the onClose callback before closing so it doesn't trigger onPopupClosed\n windowManager.clearOnClose(popupWindowIdRef.current)\n windowManager.closeWindow(popupWindowIdRef.current)\n popupWindowIdRef.current = null\n setPopupRoot(null)\n }\n return\n }\n\n // Already have a popup open\n if (popupWindowIdRef.current) return\n\n const windowId = windowManager.createPopupWindow(\n `panel-${panelId}`,\n () => {\n popupWindowIdRef.current = null\n setPopupRoot(null)\n onPopupClosed?.()\n },\n popoutTitle || panelId\n )\n\n if (windowId) {\n const rootElement = windowManager.getRootElement(windowId)\n if (rootElement) {\n popupWindowIdRef.current = windowId\n setPopupRoot(rootElement)\n windowManager.getWindow(windowId)?.focus()\n }\n }\n }, [isOpen, mode, panelId, popoutTitle, onPopupClosed, windowManager])\n\n // Clean up on unmount\n useEffect(() => {\n return () => {\n if (popupWindowIdRef.current) {\n windowManager.closeWindow(popupWindowIdRef.current)\n }\n }\n }, [windowManager])\n\n if (!isOpen && !isExiting) return null\n\n // Popout: render into popup window. Its dialogs and menus open there too, not in the window\n // behind it (where the Sign dialog used to open, out of sight).\n if (mode === 'popout' && popupRoot) {\n return createPortal(\n <PortalContainerProvider container={popupRoot}>{children}</PortalContainerProvider>,\n popupRoot\n )\n }\n\n // Overlay: a slide-out sheet over the still-visible page. Rendered into the\n // layout's #app-overlay-zone — the content region BELOW the app topbar — so\n // the bar stays visible and interactive above every overlay. Falls back to\n // <body> (viewport-covering) when no zone is mounted (e.g. embedded shells).\n if (mode === 'overlay') {\n const overlayZone = document.getElementById(DEFAULT_OVERLAY_ZONE_ID)\n return createPortal(\n <OverlaySheet\n panelId={panelId}\n isExiting={isExiting}\n onClose={onClose}\n defaultWidth={defaultWidth}\n scoped={overlayZone !== null}\n >\n {children}\n </OverlaySheet>,\n overlayZone ?? document.body\n )\n }\n\n // Main: render into main content zone\n if (mode === 'main') {\n const mainZone = document.getElementById('main-zone')\n if (mainZone) {\n return createPortal(children, mainZone)\n }\n }\n\n // Docked: render into dock zone\n const dockZone = document.getElementById('dock-zone')\n if (dockZone) {\n return createPortal(children, dockZone)\n }\n\n // No target zone mounted yet — render nothing\n return null\n}\n"]}