termdock 1.4.352 → 1.4.353

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 (389) hide show
  1. package/dist/client/assets/{AndroidMirrorView-DkOZxYLg.js → AndroidMirrorView-C39BgFa_.js} +1 -1
  2. package/dist/client/assets/AndroidMirrorView-C39BgFa_.js.br +0 -0
  3. package/dist/client/assets/AndroidMirrorView-C39BgFa_.js.gz +0 -0
  4. package/dist/client/assets/{App-DqRkfVSm.js → App-AjjtXg93.js} +7 -7
  5. package/dist/client/assets/App-AjjtXg93.js.br +0 -0
  6. package/dist/client/assets/{App-DqRkfVSm.js.gz → App-AjjtXg93.js.gz} +0 -0
  7. package/dist/client/assets/{ArchitecturePanel-m9GKl3cl.js → ArchitecturePanel-Xi_R4Tso.js} +2 -2
  8. package/dist/client/assets/ArchitecturePanel-Xi_R4Tso.js.br +0 -0
  9. package/dist/client/assets/ArchitecturePanel-Xi_R4Tso.js.gz +0 -0
  10. package/dist/client/assets/{ChangeWalkthroughPanel-HZ0zvFvi.js → ChangeWalkthroughPanel-BH1Una8m.js} +1 -1
  11. package/dist/client/assets/ChangeWalkthroughPanel-BH1Una8m.js.br +0 -0
  12. package/dist/client/assets/ChangeWalkthroughPanel-BH1Una8m.js.gz +0 -0
  13. package/dist/client/assets/{CollaborationMainWorkspace-B4OMk92m.js → CollaborationMainWorkspace-CA9ZGT5N.js} +1 -1
  14. package/dist/client/assets/CollaborationMainWorkspace-CA9ZGT5N.js.br +0 -0
  15. package/dist/client/assets/CollaborationMainWorkspace-CA9ZGT5N.js.gz +0 -0
  16. package/dist/client/assets/{CollaborationTaskContent-Cbg3iH6E.js → CollaborationTaskContent-D_NDzA-t.js} +1 -1
  17. package/dist/client/assets/{ComputerControlView-CSs54lf0.js → ComputerControlView-BGvF5NeQ.js} +3 -3
  18. package/dist/client/assets/ComputerControlView-BGvF5NeQ.js.br +0 -0
  19. package/dist/client/assets/ComputerControlView-BGvF5NeQ.js.gz +0 -0
  20. package/dist/client/assets/{DagPlayground-yoS2llnB.js → DagPlayground-CKqB6zap.js} +1 -1
  21. package/dist/client/assets/DagPlayground-CKqB6zap.js.br +0 -0
  22. package/dist/client/assets/DagPlayground-CKqB6zap.js.gz +0 -0
  23. package/dist/client/assets/{DiffLab-Dj1MT9pY.js → DiffLab-CDt8EP6I.js} +1 -1
  24. package/dist/client/assets/DiffLab-CDt8EP6I.js.br +0 -0
  25. package/dist/client/assets/DiffLab-CDt8EP6I.js.gz +0 -0
  26. package/dist/client/assets/{DiffReview-BX2S9hNp.js → DiffReview-YADkwVd6.js} +1 -1
  27. package/dist/client/assets/DiffReview-YADkwVd6.js.br +0 -0
  28. package/dist/client/assets/DiffReview-YADkwVd6.js.gz +0 -0
  29. package/dist/client/assets/{DiffReviewLab-DqI14GEk.js → DiffReviewLab-YqgsRn_K.js} +1 -1
  30. package/dist/client/assets/DiffReviewLab-YqgsRn_K.js.br +0 -0
  31. package/dist/client/assets/DiffReviewLab-YqgsRn_K.js.gz +0 -0
  32. package/dist/client/assets/{DiffViewer-AZvdDGfH.js → DiffViewer-CT5_YwM2.js} +1 -1
  33. package/dist/client/assets/DiffViewer-CT5_YwM2.js.br +0 -0
  34. package/dist/client/assets/DiffViewer-CT5_YwM2.js.gz +0 -0
  35. package/dist/client/assets/{GitLoadingSkeleton-CBPykkZP.js → GitLoadingSkeleton-DfWzAnA2.js} +1 -1
  36. package/dist/client/assets/GitLoadingSkeleton-DfWzAnA2.js.br +0 -0
  37. package/dist/client/assets/GitLoadingSkeleton-DfWzAnA2.js.gz +0 -0
  38. package/dist/client/assets/{MarkdownPreview-DpvTnKkj.js → MarkdownPreview-DHLp5cqt.js} +2 -2
  39. package/dist/client/assets/MarkdownPreview-DHLp5cqt.js.br +0 -0
  40. package/dist/client/assets/MarkdownPreview-DHLp5cqt.js.gz +0 -0
  41. package/dist/client/assets/{ModelPreview-Du_AyPr9.js → ModelPreview-DymFzc55.js} +1 -1
  42. package/dist/client/assets/ModelPreview-DymFzc55.js.br +0 -0
  43. package/dist/client/assets/ModelPreview-DymFzc55.js.gz +0 -0
  44. package/dist/client/assets/{RecordingSaveDialog-CtXaGgIo.js → RecordingSaveDialog-CxSN76bp.js} +1 -1
  45. package/dist/client/assets/RecordingSaveDialog-CxSN76bp.js.br +0 -0
  46. package/dist/client/assets/RecordingSaveDialog-CxSN76bp.js.gz +0 -0
  47. package/dist/client/assets/{RightSidebar-DU3gwdzg.js → RightSidebar-eIuDnhJn.js} +3 -3
  48. package/dist/client/assets/RightSidebar-eIuDnhJn.js.br +0 -0
  49. package/dist/client/assets/RightSidebar-eIuDnhJn.js.gz +0 -0
  50. package/dist/client/assets/{SessionChatView-CxfwJMuK.js → SessionChatView-C5wXAt7h.js} +5 -5
  51. package/dist/client/assets/SessionChatView-C5wXAt7h.js.br +0 -0
  52. package/dist/client/assets/SessionChatView-C5wXAt7h.js.gz +0 -0
  53. package/dist/client/assets/SessionResourceSidebar-Czai5Bt3.js +2 -0
  54. package/dist/client/assets/SessionResourceSidebar-Czai5Bt3.js.br +0 -0
  55. package/dist/client/assets/SessionResourceSidebar-Czai5Bt3.js.gz +0 -0
  56. package/dist/client/assets/{TodoWorkspace-j9BLgk94.js → TodoWorkspace-BftnnEU0.js} +1 -1
  57. package/dist/client/assets/TodoWorkspace-BftnnEU0.js.br +0 -0
  58. package/dist/client/assets/TodoWorkspace-BftnnEU0.js.gz +0 -0
  59. package/dist/client/assets/{abnfDiagram-VCTEODGH-LfmMIpPX.js → abnfDiagram-VCTEODGH-DI1Y-QAP.js} +1 -1
  60. package/dist/client/assets/abnfDiagram-VCTEODGH-DI1Y-QAP.js.br +0 -0
  61. package/dist/client/assets/abnfDiagram-VCTEODGH-DI1Y-QAP.js.gz +0 -0
  62. package/dist/client/assets/{app-BMJesFDU.js → app-DvMXSNN7.js} +5 -5
  63. package/dist/client/assets/app-DvMXSNN7.js.br +0 -0
  64. package/dist/client/assets/app-DvMXSNN7.js.gz +0 -0
  65. package/dist/client/assets/{arc-DMzcmH2U.js → arc-QdJAJx_D.js} +1 -1
  66. package/dist/client/assets/arc-QdJAJx_D.js.br +0 -0
  67. package/dist/client/assets/arc-QdJAJx_D.js.gz +0 -0
  68. package/dist/client/assets/{architectureDiagram-5GKGNRK7-CphS_S5Q.js → architectureDiagram-5GKGNRK7-Bw2CvoGg.js} +1 -1
  69. package/dist/client/assets/architectureDiagram-5GKGNRK7-Bw2CvoGg.js.br +0 -0
  70. package/dist/client/assets/architectureDiagram-5GKGNRK7-Bw2CvoGg.js.gz +0 -0
  71. package/dist/client/assets/{arrow-down-D-WZS308.js → arrow-down-CZKuaGwN.js} +1 -1
  72. package/dist/client/assets/{arrow-up-CelbB9FE.js → arrow-up-CYLC6_to.js} +1 -1
  73. package/dist/client/assets/{blockDiagram-I7D4REHJ-Dx_4qkcL.js → blockDiagram-I7D4REHJ-CM2GI6sC.js} +1 -1
  74. package/dist/client/assets/blockDiagram-I7D4REHJ-CM2GI6sC.js.br +0 -0
  75. package/dist/client/assets/blockDiagram-I7D4REHJ-CM2GI6sC.js.gz +0 -0
  76. package/dist/client/assets/{c4Diagram-7LVT6UL2-DiGdnPo4.js → c4Diagram-7LVT6UL2-BAB2TKr4.js} +1 -1
  77. package/dist/client/assets/c4Diagram-7LVT6UL2-BAB2TKr4.js.br +0 -0
  78. package/dist/client/assets/c4Diagram-7LVT6UL2-BAB2TKr4.js.gz +0 -0
  79. package/dist/client/assets/channel-CcDRt0AM.js +1 -0
  80. package/dist/client/assets/{chevron-left-5sk7gL3u.js → chevron-left-BNby2AjR.js} +1 -1
  81. package/dist/client/assets/{chunk-2Q5K7J3B-M50KNmR8.js → chunk-2Q5K7J3B-DI2pKKMQ.js} +1 -1
  82. package/dist/client/assets/{chunk-5VM5RSS4-wXVM-Max.js → chunk-5VM5RSS4-D5l5zyYl.js} +1 -1
  83. package/dist/client/assets/{chunk-F27PBJKO-BfQILS9u.js → chunk-F27PBJKO-Japl432v.js} +1 -1
  84. package/dist/client/assets/chunk-F27PBJKO-Japl432v.js.br +0 -0
  85. package/dist/client/assets/chunk-F27PBJKO-Japl432v.js.gz +0 -0
  86. package/dist/client/assets/{chunk-IMKFNOWR-D111Jpl3.js → chunk-IMKFNOWR-CDJoLgpw.js} +1 -1
  87. package/dist/client/assets/chunk-IMKFNOWR-CDJoLgpw.js.br +0 -0
  88. package/dist/client/assets/chunk-IMKFNOWR-CDJoLgpw.js.gz +0 -0
  89. package/dist/client/assets/{chunk-JWPE2WC7-BBDyly5c.js → chunk-JWPE2WC7-BQ2cpPDE.js} +1 -1
  90. package/dist/client/assets/{chunk-POPQ4Y6H-BaI-_yc7.js → chunk-POPQ4Y6H-CWjI0yRx.js} +1 -1
  91. package/dist/client/assets/{chunk-SVP7TREG-BvQafCMJ.js → chunk-SVP7TREG-BzEphMpl.js} +1 -1
  92. package/dist/client/assets/chunk-SVP7TREG-BzEphMpl.js.br +0 -0
  93. package/dist/client/assets/chunk-SVP7TREG-BzEphMpl.js.gz +0 -0
  94. package/dist/client/assets/{chunk-TICWLB2K-CQXPwGBz.js → chunk-TICWLB2K-B2hsw7jN.js} +1 -1
  95. package/dist/client/assets/chunk-TICWLB2K-B2hsw7jN.js.br +0 -0
  96. package/dist/client/assets/chunk-TICWLB2K-B2hsw7jN.js.gz +0 -0
  97. package/dist/client/assets/{chunk-XXDRQBXY-CmwZc4xV.js → chunk-XXDRQBXY-BEWjHo7s.js} +1 -1
  98. package/dist/client/assets/classDiagram-ZZMXUADV-Dz0qH9Hg.js +1 -0
  99. package/dist/client/assets/classDiagram-v2-VYDZK3BY-Dz0qH9Hg.js +1 -0
  100. package/dist/client/assets/{clipboard-uSv3AiJM.js → clipboard-6kE6vzDi.js} +1 -1
  101. package/dist/client/assets/{clipboardText-5puxqqm_.js → clipboardText-B7202UNa.js} +1 -1
  102. package/dist/client/assets/clipboardText-B7202UNa.js.br +0 -0
  103. package/dist/client/assets/clipboardText-B7202UNa.js.gz +0 -0
  104. package/dist/client/assets/{cose-bilkent-JH36ORCC-CqWarkUj.js → cose-bilkent-JH36ORCC-DpS77pec.js} +1 -1
  105. package/dist/client/assets/cose-bilkent-JH36ORCC-DpS77pec.js.br +0 -0
  106. package/dist/client/assets/cose-bilkent-JH36ORCC-DpS77pec.js.gz +0 -0
  107. package/dist/client/assets/{cynefin-OW5HDTMX-CFW2ifig.js → cynefin-OW5HDTMX-D1y5kNwR.js} +1 -1
  108. package/dist/client/assets/cynefin-OW5HDTMX-D1y5kNwR.js.br +0 -0
  109. package/dist/client/assets/cynefin-OW5HDTMX-D1y5kNwR.js.gz +0 -0
  110. package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-yggxM55S.js → cynefinDiagram-5FMLGOSQ-CqTCLyMC.js} +1 -1
  111. package/dist/client/assets/cynefinDiagram-5FMLGOSQ-CqTCLyMC.js.br +0 -0
  112. package/dist/client/assets/cynefinDiagram-5FMLGOSQ-CqTCLyMC.js.gz +0 -0
  113. package/dist/client/assets/{dagre-GXQ25YYZ-inq7o--x.js → dagre-GXQ25YYZ-DkJ-kRn6.js} +1 -1
  114. package/dist/client/assets/dagre-GXQ25YYZ-DkJ-kRn6.js.br +0 -0
  115. package/dist/client/assets/dagre-GXQ25YYZ-DkJ-kRn6.js.gz +0 -0
  116. package/dist/client/assets/{diagram-S7CK7UJ4-BUXMnyQN.js → diagram-S7CK7UJ4-DenrrE_C.js} +1 -1
  117. package/dist/client/assets/diagram-S7CK7UJ4-DenrrE_C.js.br +0 -0
  118. package/dist/client/assets/diagram-S7CK7UJ4-DenrrE_C.js.gz +0 -0
  119. package/dist/client/assets/{diagram-UQ7AKVKN-BJbw-Imf.js → diagram-UQ7AKVKN-B2ikSD8K.js} +1 -1
  120. package/dist/client/assets/diagram-UQ7AKVKN-B2ikSD8K.js.br +0 -0
  121. package/dist/client/assets/diagram-UQ7AKVKN-B2ikSD8K.js.gz +0 -0
  122. package/dist/client/assets/{diagram-VSXAHHWV-CSfl8yS7.js → diagram-VSXAHHWV-CQcNoZDC.js} +1 -1
  123. package/dist/client/assets/diagram-VSXAHHWV-CQcNoZDC.js.br +0 -0
  124. package/dist/client/assets/diagram-VSXAHHWV-CQcNoZDC.js.gz +0 -0
  125. package/dist/client/assets/{diagram-VX7I27RA-zV-Vrv89.js → diagram-VX7I27RA-Cq3FaI-1.js} +1 -1
  126. package/dist/client/assets/diagram-VX7I27RA-Cq3FaI-1.js.br +0 -0
  127. package/dist/client/assets/diagram-VX7I27RA-Cq3FaI-1.js.gz +0 -0
  128. package/dist/client/assets/{diagram-Z3DM3KII-CRnE-snw.js → diagram-Z3DM3KII-BcWReLM8.js} +1 -1
  129. package/dist/client/assets/diagram-Z3DM3KII-BcWReLM8.js.br +0 -0
  130. package/dist/client/assets/diagram-Z3DM3KII-BcWReLM8.js.gz +0 -0
  131. package/dist/client/assets/{ebnfDiagram-PWID7BFC-CE30oImc.js → ebnfDiagram-PWID7BFC-DwwFkjaL.js} +1 -1
  132. package/dist/client/assets/ebnfDiagram-PWID7BFC-DwwFkjaL.js.br +0 -0
  133. package/dist/client/assets/ebnfDiagram-PWID7BFC-DwwFkjaL.js.gz +0 -0
  134. package/dist/client/assets/{erDiagram-RLTQ6QDP-D-5bIySI.js → erDiagram-RLTQ6QDP-B1MNvouo.js} +1 -1
  135. package/dist/client/assets/erDiagram-RLTQ6QDP-B1MNvouo.js.br +0 -0
  136. package/dist/client/assets/erDiagram-RLTQ6QDP-B1MNvouo.js.gz +0 -0
  137. package/dist/client/assets/{flowDiagram-HODETNUW-E_jPKtQR.js → flowDiagram-HODETNUW-B_tIl0Vb.js} +1 -1
  138. package/dist/client/assets/flowDiagram-HODETNUW-B_tIl0Vb.js.br +0 -0
  139. package/dist/client/assets/flowDiagram-HODETNUW-B_tIl0Vb.js.gz +0 -0
  140. package/dist/client/assets/{ganttDiagram-EL5Y4UJY-BWvLOUzC.js → ganttDiagram-EL5Y4UJY-CV0YyZHk.js} +1 -1
  141. package/dist/client/assets/ganttDiagram-EL5Y4UJY-CV0YyZHk.js.br +0 -0
  142. package/dist/client/assets/ganttDiagram-EL5Y4UJY-CV0YyZHk.js.gz +0 -0
  143. package/dist/client/assets/{git-compare-BlcHEuBI.js → git-compare-CGiJqTYP.js} +1 -1
  144. package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-nOlVCBmL.js → gitGraphDiagram-WWUBYQGX-DZvnSoyE.js} +1 -1
  145. package/dist/client/assets/gitGraphDiagram-WWUBYQGX-DZvnSoyE.js.br +0 -0
  146. package/dist/client/assets/gitGraphDiagram-WWUBYQGX-DZvnSoyE.js.gz +0 -0
  147. package/dist/client/assets/{infoDiagram-27XIBGKW-CjVm9Lzz.js → infoDiagram-27XIBGKW-G1OS50nR.js} +1 -1
  148. package/dist/client/assets/{ishikawaDiagram-5VMMS53U-DmVMaGVp.js → ishikawaDiagram-5VMMS53U-C0-s6pfy.js} +1 -1
  149. package/dist/client/assets/ishikawaDiagram-5VMMS53U-C0-s6pfy.js.br +0 -0
  150. package/dist/client/assets/ishikawaDiagram-5VMMS53U-C0-s6pfy.js.gz +0 -0
  151. package/dist/client/assets/{journeyDiagram-3NMN7TZE-DLwkoAy9.js → journeyDiagram-3NMN7TZE-B-9Omdit.js} +1 -1
  152. package/dist/client/assets/journeyDiagram-3NMN7TZE-B-9Omdit.js.br +0 -0
  153. package/dist/client/assets/journeyDiagram-3NMN7TZE-B-9Omdit.js.gz +0 -0
  154. package/dist/client/assets/{kanban-definition-UXKFOSKX-GWkp_QiO.js → kanban-definition-UXKFOSKX-BS_qXegp.js} +1 -1
  155. package/dist/client/assets/kanban-definition-UXKFOSKX-BS_qXegp.js.br +0 -0
  156. package/dist/client/assets/kanban-definition-UXKFOSKX-BS_qXegp.js.gz +0 -0
  157. package/dist/client/assets/{layout-DFg5a61y.js → layout-0NYin1Qz.js} +1 -1
  158. package/dist/client/assets/layout-0NYin1Qz.js.br +0 -0
  159. package/dist/client/assets/layout-0NYin1Qz.js.gz +0 -0
  160. package/dist/client/assets/{linear-B0OdJLe1.js → linear-CTVKrsxK.js} +1 -1
  161. package/dist/client/assets/linear-CTVKrsxK.js.br +0 -0
  162. package/dist/client/assets/linear-CTVKrsxK.js.gz +0 -0
  163. package/dist/client/assets/{link-BnxdKJ7b.js → link-C5oPMHMJ.js} +1 -1
  164. package/dist/client/assets/link-C5oPMHMJ.js.br +0 -0
  165. package/dist/client/assets/link-C5oPMHMJ.js.gz +0 -0
  166. package/dist/client/assets/{list-tree-Bou8VSzi.js → list-tree-BPg9QdiM.js} +1 -1
  167. package/dist/client/assets/{loader-circle-q7h8uwFI.js → loader-circle-CTtHKNWd.js} +1 -1
  168. package/dist/client/assets/{maximize-2-BGTBw-Ku.js → maximize-2-32OfQ0kG.js} +1 -1
  169. package/dist/client/assets/{mermaid.core-DQA3ykXv.js → mermaid.core-BgCZP9ke.js} +5 -5
  170. package/dist/client/assets/mermaid.core-BgCZP9ke.js.br +0 -0
  171. package/dist/client/assets/mermaid.core-BgCZP9ke.js.gz +0 -0
  172. package/dist/client/assets/{mindmap-definition-YA3MSWOX-DsZAVAGP.js → mindmap-definition-YA3MSWOX-BjSZRjkg.js} +1 -1
  173. package/dist/client/assets/mindmap-definition-YA3MSWOX-BjSZRjkg.js.br +0 -0
  174. package/dist/client/assets/mindmap-definition-YA3MSWOX-BjSZRjkg.js.gz +0 -0
  175. package/dist/client/assets/{passwordBootstrap-CEZSL94g.js → passwordBootstrap-CXQgj5nw.js} +1 -1
  176. package/dist/client/assets/passwordBootstrap-CXQgj5nw.js.br +0 -0
  177. package/dist/client/assets/passwordBootstrap-CXQgj5nw.js.gz +0 -0
  178. package/dist/client/assets/{pegDiagram-XKGWAZYB-C3ar01Lf.js → pegDiagram-XKGWAZYB-qDU0sU6m.js} +1 -1
  179. package/dist/client/assets/pegDiagram-XKGWAZYB-qDU0sU6m.js.br +0 -0
  180. package/dist/client/assets/pegDiagram-XKGWAZYB-qDU0sU6m.js.gz +0 -0
  181. package/dist/client/assets/{pieDiagram-E7YTZNPT-C8LIa9gE.js → pieDiagram-E7YTZNPT-CZF3MEOJ.js} +1 -1
  182. package/dist/client/assets/pieDiagram-E7YTZNPT-CZF3MEOJ.js.br +0 -0
  183. package/dist/client/assets/pieDiagram-E7YTZNPT-CZF3MEOJ.js.gz +0 -0
  184. package/dist/client/assets/{quadrantDiagram-AXDQQJYC-BuRJ1f9F.js → quadrantDiagram-AXDQQJYC-DcZW4RMG.js} +1 -1
  185. package/dist/client/assets/quadrantDiagram-AXDQQJYC-DcZW4RMG.js.br +0 -0
  186. package/dist/client/assets/quadrantDiagram-AXDQQJYC-DcZW4RMG.js.gz +0 -0
  187. package/dist/client/assets/{quote-qXNI_NTi.js → quote-CuTMveNr.js} +1 -1
  188. package/dist/client/assets/{railroadDiagram-O6MQD6OU-D7iZy3dO.js → railroadDiagram-O6MQD6OU-DtQROK31.js} +1 -1
  189. package/dist/client/assets/railroadDiagram-O6MQD6OU-DtQROK31.js.br +0 -0
  190. package/dist/client/assets/railroadDiagram-O6MQD6OU-DtQROK31.js.gz +0 -0
  191. package/dist/client/assets/{rdpSession-DUBlG26K.js → rdpSession-a1ZvAyiW.js} +1 -1
  192. package/dist/client/assets/rdpSession-a1ZvAyiW.js.br +0 -0
  193. package/dist/client/assets/rdpSession-a1ZvAyiW.js.gz +0 -0
  194. package/dist/client/assets/{requirementDiagram-BXWQKSXE-DhY8g8qK.js → requirementDiagram-BXWQKSXE-B8yR39lm.js} +1 -1
  195. package/dist/client/assets/requirementDiagram-BXWQKSXE-B8yR39lm.js.br +0 -0
  196. package/dist/client/assets/requirementDiagram-BXWQKSXE-B8yR39lm.js.gz +0 -0
  197. package/dist/client/assets/{sankeyDiagram-P5KCCOFB-DDA_LQcg.js → sankeyDiagram-P5KCCOFB-D27zuIFg.js} +1 -1
  198. package/dist/client/assets/sankeyDiagram-P5KCCOFB-D27zuIFg.js.br +0 -0
  199. package/dist/client/assets/sankeyDiagram-P5KCCOFB-D27zuIFg.js.gz +0 -0
  200. package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-bWgfdfwY.js → sequenceDiagram-WJ2MYXX4-BI3gSsUa.js} +1 -1
  201. package/dist/client/assets/sequenceDiagram-WJ2MYXX4-BI3gSsUa.js.br +0 -0
  202. package/dist/client/assets/sequenceDiagram-WJ2MYXX4-BI3gSsUa.js.gz +0 -0
  203. package/dist/client/assets/{settings-2-B-sr3wQM.js → settings-2-GFFo5UwO.js} +1 -1
  204. package/dist/client/assets/{sizeCapture-INFHLROL-BYxi7e0R.js → sizeCapture-INFHLROL-NBzIIRER.js} +1 -1
  205. package/dist/client/assets/sizeCapture-INFHLROL-NBzIIRER.js.br +0 -0
  206. package/dist/client/assets/sizeCapture-INFHLROL-NBzIIRER.js.gz +0 -0
  207. package/dist/client/assets/{sparkles-CCLflSFy.js → sparkles-ZXBp-KvJ.js} +1 -1
  208. package/dist/client/assets/{stateDiagram-D77RDMKH-6vqC2h36.js → stateDiagram-D77RDMKH-D-D0FB4D.js} +1 -1
  209. package/dist/client/assets/stateDiagram-D77RDMKH-D-D0FB4D.js.br +0 -0
  210. package/dist/client/assets/stateDiagram-D77RDMKH-D-D0FB4D.js.gz +0 -0
  211. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-Dk-QpCnJ.js +1 -0
  212. package/dist/client/assets/{sun-B9_TfxlA.js → sun-CO5F9zS4.js} +1 -1
  213. package/dist/client/assets/{swimlanes-42K2YHIH-B4qrXam7.js → swimlanes-42K2YHIH-CH_jxbV3.js} +1 -1
  214. package/dist/client/assets/swimlanes-42K2YHIH-CH_jxbV3.js.br +0 -0
  215. package/dist/client/assets/swimlanes-42K2YHIH-CH_jxbV3.js.gz +0 -0
  216. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-C4E5FOdv.js +8 -0
  217. package/dist/client/assets/{syntaxHighlight-bcOB6oww.js → syntaxHighlight-C9PKWUqs.js} +1 -1
  218. package/dist/client/assets/syntaxHighlight-C9PKWUqs.js.br +0 -0
  219. package/dist/client/assets/syntaxHighlight-C9PKWUqs.js.gz +0 -0
  220. package/dist/client/assets/{timeline-definition-24CTP7MA-D0_004MF.js → timeline-definition-24CTP7MA-DuiaCBON.js} +1 -1
  221. package/dist/client/assets/timeline-definition-24CTP7MA-DuiaCBON.js.br +0 -0
  222. package/dist/client/assets/timeline-definition-24CTP7MA-DuiaCBON.js.gz +0 -0
  223. package/dist/client/assets/{triangle-alert-D3w7mA17.js → triangle-alert-CuGUScPU.js} +1 -1
  224. package/dist/client/assets/{unplug-BSblgecr.js → unplug-C0pb-BKU.js} +1 -1
  225. package/dist/client/assets/{vennDiagram-4TSXK5OY-Bqrx-47p.js → vennDiagram-4TSXK5OY-DUEZFEzo.js} +1 -1
  226. package/dist/client/assets/vennDiagram-4TSXK5OY-DUEZFEzo.js.br +0 -0
  227. package/dist/client/assets/vennDiagram-4TSXK5OY-DUEZFEzo.js.gz +0 -0
  228. package/dist/client/assets/{videoCompression-df1Ej3AR.js → videoCompression-JAcp0atl.js} +1 -1
  229. package/dist/client/assets/videoCompression-JAcp0atl.js.br +0 -0
  230. package/dist/client/assets/videoCompression-JAcp0atl.js.gz +0 -0
  231. package/dist/client/assets/{wardleyDiagram-VM6X3IG4-C4LCUdfd.js → wardleyDiagram-VM6X3IG4-CnHmIbot.js} +1 -1
  232. package/dist/client/assets/wardleyDiagram-VM6X3IG4-CnHmIbot.js.br +0 -0
  233. package/dist/client/assets/wardleyDiagram-VM6X3IG4-CnHmIbot.js.gz +0 -0
  234. package/dist/client/assets/{xychartDiagram-S5SC5T6Z-E5AQcZVI.js → xychartDiagram-S5SC5T6Z-CDAoHQTr.js} +1 -1
  235. package/dist/client/assets/xychartDiagram-S5SC5T6Z-CDAoHQTr.js.br +0 -0
  236. package/dist/client/assets/xychartDiagram-S5SC5T6Z-CDAoHQTr.js.gz +0 -0
  237. package/dist/client/index.html +1 -1
  238. package/dist/client/index.html.br +0 -0
  239. package/dist/client/index.html.gz +0 -0
  240. package/dist/client/sw.js +1 -1
  241. package/dist/client/sw.js.br +0 -0
  242. package/dist/client/sw.js.gz +0 -0
  243. package/package.json +1 -1
  244. package/runtime-manifest.json +2 -2
  245. package/dist/client/assets/AndroidMirrorView-DkOZxYLg.js.br +0 -0
  246. package/dist/client/assets/AndroidMirrorView-DkOZxYLg.js.gz +0 -0
  247. package/dist/client/assets/App-DqRkfVSm.js.br +0 -0
  248. package/dist/client/assets/ArchitecturePanel-m9GKl3cl.js.br +0 -0
  249. package/dist/client/assets/ArchitecturePanel-m9GKl3cl.js.gz +0 -0
  250. package/dist/client/assets/ChangeWalkthroughPanel-HZ0zvFvi.js.br +0 -0
  251. package/dist/client/assets/ChangeWalkthroughPanel-HZ0zvFvi.js.gz +0 -0
  252. package/dist/client/assets/CollaborationMainWorkspace-B4OMk92m.js.br +0 -0
  253. package/dist/client/assets/CollaborationMainWorkspace-B4OMk92m.js.gz +0 -0
  254. package/dist/client/assets/ComputerControlView-CSs54lf0.js.br +0 -0
  255. package/dist/client/assets/ComputerControlView-CSs54lf0.js.gz +0 -0
  256. package/dist/client/assets/DagPlayground-yoS2llnB.js.br +0 -0
  257. package/dist/client/assets/DagPlayground-yoS2llnB.js.gz +0 -0
  258. package/dist/client/assets/DiffLab-Dj1MT9pY.js.br +0 -0
  259. package/dist/client/assets/DiffLab-Dj1MT9pY.js.gz +0 -0
  260. package/dist/client/assets/DiffReview-BX2S9hNp.js.br +0 -0
  261. package/dist/client/assets/DiffReview-BX2S9hNp.js.gz +0 -0
  262. package/dist/client/assets/DiffReviewLab-DqI14GEk.js.br +0 -0
  263. package/dist/client/assets/DiffReviewLab-DqI14GEk.js.gz +0 -0
  264. package/dist/client/assets/DiffViewer-AZvdDGfH.js.br +0 -0
  265. package/dist/client/assets/DiffViewer-AZvdDGfH.js.gz +0 -0
  266. package/dist/client/assets/GitLoadingSkeleton-CBPykkZP.js.br +0 -0
  267. package/dist/client/assets/GitLoadingSkeleton-CBPykkZP.js.gz +0 -0
  268. package/dist/client/assets/MarkdownPreview-DpvTnKkj.js.br +0 -0
  269. package/dist/client/assets/MarkdownPreview-DpvTnKkj.js.gz +0 -0
  270. package/dist/client/assets/ModelPreview-Du_AyPr9.js.br +0 -0
  271. package/dist/client/assets/ModelPreview-Du_AyPr9.js.gz +0 -0
  272. package/dist/client/assets/RecordingSaveDialog-CtXaGgIo.js.br +0 -0
  273. package/dist/client/assets/RecordingSaveDialog-CtXaGgIo.js.gz +0 -0
  274. package/dist/client/assets/RightSidebar-DU3gwdzg.js.br +0 -0
  275. package/dist/client/assets/RightSidebar-DU3gwdzg.js.gz +0 -0
  276. package/dist/client/assets/SessionChatView-CxfwJMuK.js.br +0 -0
  277. package/dist/client/assets/SessionChatView-CxfwJMuK.js.gz +0 -0
  278. package/dist/client/assets/SessionResourceSidebar-B31PU57J.js +0 -2
  279. package/dist/client/assets/SessionResourceSidebar-B31PU57J.js.br +0 -0
  280. package/dist/client/assets/SessionResourceSidebar-B31PU57J.js.gz +0 -0
  281. package/dist/client/assets/TodoWorkspace-j9BLgk94.js.br +0 -0
  282. package/dist/client/assets/TodoWorkspace-j9BLgk94.js.gz +0 -0
  283. package/dist/client/assets/abnfDiagram-VCTEODGH-LfmMIpPX.js.br +0 -0
  284. package/dist/client/assets/abnfDiagram-VCTEODGH-LfmMIpPX.js.gz +0 -0
  285. package/dist/client/assets/app-BMJesFDU.js.br +0 -0
  286. package/dist/client/assets/app-BMJesFDU.js.gz +0 -0
  287. package/dist/client/assets/arc-DMzcmH2U.js.br +0 -0
  288. package/dist/client/assets/arc-DMzcmH2U.js.gz +0 -0
  289. package/dist/client/assets/architectureDiagram-5GKGNRK7-CphS_S5Q.js.br +0 -0
  290. package/dist/client/assets/architectureDiagram-5GKGNRK7-CphS_S5Q.js.gz +0 -0
  291. package/dist/client/assets/blockDiagram-I7D4REHJ-Dx_4qkcL.js.br +0 -0
  292. package/dist/client/assets/blockDiagram-I7D4REHJ-Dx_4qkcL.js.gz +0 -0
  293. package/dist/client/assets/c4Diagram-7LVT6UL2-DiGdnPo4.js.br +0 -0
  294. package/dist/client/assets/c4Diagram-7LVT6UL2-DiGdnPo4.js.gz +0 -0
  295. package/dist/client/assets/channel-BxAJ9Qmh.js +0 -1
  296. package/dist/client/assets/chunk-F27PBJKO-BfQILS9u.js.br +0 -0
  297. package/dist/client/assets/chunk-F27PBJKO-BfQILS9u.js.gz +0 -0
  298. package/dist/client/assets/chunk-IMKFNOWR-D111Jpl3.js.br +0 -0
  299. package/dist/client/assets/chunk-IMKFNOWR-D111Jpl3.js.gz +0 -0
  300. package/dist/client/assets/chunk-SVP7TREG-BvQafCMJ.js.br +0 -0
  301. package/dist/client/assets/chunk-SVP7TREG-BvQafCMJ.js.gz +0 -0
  302. package/dist/client/assets/chunk-TICWLB2K-CQXPwGBz.js.br +0 -0
  303. package/dist/client/assets/chunk-TICWLB2K-CQXPwGBz.js.gz +0 -0
  304. package/dist/client/assets/classDiagram-ZZMXUADV-D0oXVFxd.js +0 -1
  305. package/dist/client/assets/classDiagram-v2-VYDZK3BY-D0oXVFxd.js +0 -1
  306. package/dist/client/assets/clipboardText-5puxqqm_.js.br +0 -0
  307. package/dist/client/assets/clipboardText-5puxqqm_.js.gz +0 -0
  308. package/dist/client/assets/cose-bilkent-JH36ORCC-CqWarkUj.js.br +0 -0
  309. package/dist/client/assets/cose-bilkent-JH36ORCC-CqWarkUj.js.gz +0 -0
  310. package/dist/client/assets/cynefin-OW5HDTMX-CFW2ifig.js.br +0 -0
  311. package/dist/client/assets/cynefin-OW5HDTMX-CFW2ifig.js.gz +0 -0
  312. package/dist/client/assets/cynefinDiagram-5FMLGOSQ-yggxM55S.js.br +0 -0
  313. package/dist/client/assets/cynefinDiagram-5FMLGOSQ-yggxM55S.js.gz +0 -0
  314. package/dist/client/assets/dagre-GXQ25YYZ-inq7o--x.js.br +0 -0
  315. package/dist/client/assets/dagre-GXQ25YYZ-inq7o--x.js.gz +0 -0
  316. package/dist/client/assets/diagram-S7CK7UJ4-BUXMnyQN.js.br +0 -0
  317. package/dist/client/assets/diagram-S7CK7UJ4-BUXMnyQN.js.gz +0 -0
  318. package/dist/client/assets/diagram-UQ7AKVKN-BJbw-Imf.js.br +0 -0
  319. package/dist/client/assets/diagram-UQ7AKVKN-BJbw-Imf.js.gz +0 -0
  320. package/dist/client/assets/diagram-VSXAHHWV-CSfl8yS7.js.br +0 -0
  321. package/dist/client/assets/diagram-VSXAHHWV-CSfl8yS7.js.gz +0 -0
  322. package/dist/client/assets/diagram-VX7I27RA-zV-Vrv89.js.br +0 -0
  323. package/dist/client/assets/diagram-VX7I27RA-zV-Vrv89.js.gz +0 -0
  324. package/dist/client/assets/diagram-Z3DM3KII-CRnE-snw.js.br +0 -0
  325. package/dist/client/assets/diagram-Z3DM3KII-CRnE-snw.js.gz +0 -0
  326. package/dist/client/assets/ebnfDiagram-PWID7BFC-CE30oImc.js.br +0 -0
  327. package/dist/client/assets/ebnfDiagram-PWID7BFC-CE30oImc.js.gz +0 -0
  328. package/dist/client/assets/erDiagram-RLTQ6QDP-D-5bIySI.js.br +0 -0
  329. package/dist/client/assets/erDiagram-RLTQ6QDP-D-5bIySI.js.gz +0 -0
  330. package/dist/client/assets/flowDiagram-HODETNUW-E_jPKtQR.js.br +0 -0
  331. package/dist/client/assets/flowDiagram-HODETNUW-E_jPKtQR.js.gz +0 -0
  332. package/dist/client/assets/ganttDiagram-EL5Y4UJY-BWvLOUzC.js.br +0 -0
  333. package/dist/client/assets/ganttDiagram-EL5Y4UJY-BWvLOUzC.js.gz +0 -0
  334. package/dist/client/assets/gitGraphDiagram-WWUBYQGX-nOlVCBmL.js.br +0 -0
  335. package/dist/client/assets/gitGraphDiagram-WWUBYQGX-nOlVCBmL.js.gz +0 -0
  336. package/dist/client/assets/ishikawaDiagram-5VMMS53U-DmVMaGVp.js.br +0 -0
  337. package/dist/client/assets/ishikawaDiagram-5VMMS53U-DmVMaGVp.js.gz +0 -0
  338. package/dist/client/assets/journeyDiagram-3NMN7TZE-DLwkoAy9.js.br +0 -0
  339. package/dist/client/assets/journeyDiagram-3NMN7TZE-DLwkoAy9.js.gz +0 -0
  340. package/dist/client/assets/kanban-definition-UXKFOSKX-GWkp_QiO.js.br +0 -0
  341. package/dist/client/assets/kanban-definition-UXKFOSKX-GWkp_QiO.js.gz +0 -0
  342. package/dist/client/assets/layout-DFg5a61y.js.br +0 -0
  343. package/dist/client/assets/layout-DFg5a61y.js.gz +0 -0
  344. package/dist/client/assets/linear-B0OdJLe1.js.br +0 -0
  345. package/dist/client/assets/linear-B0OdJLe1.js.gz +0 -0
  346. package/dist/client/assets/link-BnxdKJ7b.js.br +0 -0
  347. package/dist/client/assets/link-BnxdKJ7b.js.gz +0 -0
  348. package/dist/client/assets/mermaid.core-DQA3ykXv.js.br +0 -0
  349. package/dist/client/assets/mermaid.core-DQA3ykXv.js.gz +0 -0
  350. package/dist/client/assets/mindmap-definition-YA3MSWOX-DsZAVAGP.js.br +0 -0
  351. package/dist/client/assets/mindmap-definition-YA3MSWOX-DsZAVAGP.js.gz +0 -0
  352. package/dist/client/assets/passwordBootstrap-CEZSL94g.js.br +0 -0
  353. package/dist/client/assets/passwordBootstrap-CEZSL94g.js.gz +0 -0
  354. package/dist/client/assets/pegDiagram-XKGWAZYB-C3ar01Lf.js.br +0 -0
  355. package/dist/client/assets/pegDiagram-XKGWAZYB-C3ar01Lf.js.gz +0 -0
  356. package/dist/client/assets/pieDiagram-E7YTZNPT-C8LIa9gE.js.br +0 -0
  357. package/dist/client/assets/pieDiagram-E7YTZNPT-C8LIa9gE.js.gz +0 -0
  358. package/dist/client/assets/quadrantDiagram-AXDQQJYC-BuRJ1f9F.js.br +0 -0
  359. package/dist/client/assets/quadrantDiagram-AXDQQJYC-BuRJ1f9F.js.gz +0 -0
  360. package/dist/client/assets/railroadDiagram-O6MQD6OU-D7iZy3dO.js.br +0 -0
  361. package/dist/client/assets/railroadDiagram-O6MQD6OU-D7iZy3dO.js.gz +0 -0
  362. package/dist/client/assets/rdpSession-DUBlG26K.js.br +0 -0
  363. package/dist/client/assets/rdpSession-DUBlG26K.js.gz +0 -0
  364. package/dist/client/assets/requirementDiagram-BXWQKSXE-DhY8g8qK.js.br +0 -0
  365. package/dist/client/assets/requirementDiagram-BXWQKSXE-DhY8g8qK.js.gz +0 -0
  366. package/dist/client/assets/sankeyDiagram-P5KCCOFB-DDA_LQcg.js.br +0 -0
  367. package/dist/client/assets/sankeyDiagram-P5KCCOFB-DDA_LQcg.js.gz +0 -0
  368. package/dist/client/assets/sequenceDiagram-WJ2MYXX4-bWgfdfwY.js.br +0 -0
  369. package/dist/client/assets/sequenceDiagram-WJ2MYXX4-bWgfdfwY.js.gz +0 -0
  370. package/dist/client/assets/sizeCapture-INFHLROL-BYxi7e0R.js.br +0 -0
  371. package/dist/client/assets/sizeCapture-INFHLROL-BYxi7e0R.js.gz +0 -0
  372. package/dist/client/assets/stateDiagram-D77RDMKH-6vqC2h36.js.br +0 -0
  373. package/dist/client/assets/stateDiagram-D77RDMKH-6vqC2h36.js.gz +0 -0
  374. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-Bb23lB9W.js +0 -1
  375. package/dist/client/assets/swimlanes-42K2YHIH-B4qrXam7.js.br +0 -0
  376. package/dist/client/assets/swimlanes-42K2YHIH-B4qrXam7.js.gz +0 -0
  377. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-CQ1XJUVU.js +0 -8
  378. package/dist/client/assets/syntaxHighlight-bcOB6oww.js.br +0 -0
  379. package/dist/client/assets/syntaxHighlight-bcOB6oww.js.gz +0 -0
  380. package/dist/client/assets/timeline-definition-24CTP7MA-D0_004MF.js.br +0 -0
  381. package/dist/client/assets/timeline-definition-24CTP7MA-D0_004MF.js.gz +0 -0
  382. package/dist/client/assets/vennDiagram-4TSXK5OY-Bqrx-47p.js.br +0 -0
  383. package/dist/client/assets/vennDiagram-4TSXK5OY-Bqrx-47p.js.gz +0 -0
  384. package/dist/client/assets/videoCompression-df1Ej3AR.js.br +0 -0
  385. package/dist/client/assets/videoCompression-df1Ej3AR.js.gz +0 -0
  386. package/dist/client/assets/wardleyDiagram-VM6X3IG4-C4LCUdfd.js.br +0 -0
  387. package/dist/client/assets/wardleyDiagram-VM6X3IG4-C4LCUdfd.js.gz +0 -0
  388. package/dist/client/assets/xychartDiagram-S5SC5T6Z-E5AQcZVI.js.br +0 -0
  389. package/dist/client/assets/xychartDiagram-S5SC5T6Z-E5AQcZVI.js.gz +0 -0
@@ -1 +1 @@
1
- import{aQ as Se,e5 as oe,cb as s,e6 as we,a0 as Ie,o as Pe,C as Fe,ed as Xe,s as Oe,de as ze,aX as Be,ao as He}from"./app-BMJesFDU.js";import{R as Ge,b as r,r as Me}from"./dnd-BCFAPC0L.js";import{u as be}from"./use-gesture-react.esm-DYpdiE_k.js";import{S as $e,c as Ke,h as Ue,r as qe,y as Ve,b as Ye,u as Ze}from"./gestureArbiter-DszagC-d.js";import{A as Qe}from"./arrow-up-CelbB9FE.js";const Je=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],We=Se("folder-tree",Je);const et=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],yt=Se("upload",et),xe={dampingRatio:.8,response:.3},tt=.998;function rt(n,a,u,f){const o=2*Math.PI/Math.max(n.response,.001),E=a-f,g=u,l=n.dampingRatio;if(Math.abs(l-1)<1e-4){const m=E,k=g+o*E;return{value:y=>f+(m+k*y)*Math.exp(-o*y),velocity:y=>(k-o*(m+k*y))*Math.exp(-o*y)}}if(l<1){const m=o*Math.sqrt(1-l*l),k=E,y=(g+l*o*E)/m;return{value:h=>f+Math.exp(-l*o*h)*(k*Math.cos(m*h)+y*Math.sin(m*h)),velocity:h=>Math.exp(-l*o*h)*((y*m-l*o*k)*Math.cos(m*h)-(k*m+l*o*y)*Math.sin(m*h))}}const x=o*Math.sqrt(l*l-1),d=-l*o+x,p=-l*o-x,S=(g-p*E)/(d-p),j=E-S;return{value:m=>f+S*Math.exp(d*m)+j*Math.exp(p*m),velocity:m=>S*d*Math.exp(d*m)+j*p*Math.exp(p*m)}}function nt(n,a=tt){return n/1e3*(a/(1-a))}function ge(n,a,u=.55){return n*a*u/(a+u*Math.abs(n))}function st(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}const ot=.1,at=5;function ct(n,a,u,f,o){const E=rt(n,a,u,f),g=1e3/60,l=240,x=[];for(let d=0;d<l;d++){const p=d*g/1e3,S=E.value(p),j=E.velocity(p);if(x.push(o?o(S):S),d>0&&Math.abs(S-f)<ot&&Math.abs(j)<at)break}return x.push(o?o(f):f),{frames:x,durationMs:(x.length-1)*g,solver:E}}const it='input:not([type="hidden"]), textarea, select, [contenteditable]:not([contenteditable="false"])';function lt(){if(typeof document>"u")return;const n=document.activeElement;n instanceof HTMLElement&&n.matches(it)&&n.blur()}const ut=18,ye=8,ve={touch:ye,pen:ye},dt=500,re=200,ke=50,ft=`[${$e}]`;function ne(n,a,u){return Math.min(u,Math.max(a,n))}function Re(n){if(!n||typeof n!="object")return!1;const a=n;return typeof a.pointerType=="string"?a.pointerType==="touch"||a.pointerType==="pen":typeof a.type=="string"&&a.type.startsWith("touch")}function Ee(n){if(!n||typeof n!="object")return!1;const a=n.target;return a instanceof Element&&!!a.closest(ft)}function K(...n){typeof window<"u"&&window.__SIDEBAR_DEBUG__&&console.log("[Sidebar]",...n)}const vt=Ge.forwardRef(function({side:a,isOpen:u,drawerWidthPx:f,onClose:o,onOpen:E,children:g,pinned:l=!1},x){const{t:d}=oe(),p=a==="left",S=p?-f:f,j=r.useRef(null),m=r.useRef(null),k=r.useRef(u?0:S),y=r.useRef(null),h=r.useRef(null),T=r.useRef(0),D=r.useRef(null),_=r.useRef(null),v=r.useRef(!1),R=r.useRef(null),N=r.useRef(!1),M=r.useRef([]),F=r.useRef(null),Ce=r.useRef(k.current),Te=r.useRef(u?1:0),X=r.useRef(u);X.current=u;const O=r.useRef(S);O.current=S;const Q=r.useRef(f);Q.current=f;const J=r.useRef(p);J.current=p;const ae=r.useRef(o);ae.current=o;const W=r.useRef(E);W.current=E;const ce=r.useCallback(e=>{j.current=e,typeof x=="function"?x(e):x&&(x.current=e)},[x]),ie=r.useCallback(()=>{h.current!==null&&(window.cancelAnimationFrame(h.current),h.current=null),y.current=null},[]),U=r.useCallback(e=>{const t=Q.current;return J.current?(e+t)/t:(t-e)/t},[]),le=r.useCallback(e=>{const t=m.current;t&&(t.style.opacity=String(ne(U(e),0,1)))},[U]),A=r.useCallback(e=>{k.current=e;const t=j.current;t&&(t.style.transform=`translateX(${e}px)`,le(e))},[le]),q=r.useCallback(e=>{y.current=e,h.current===null&&(h.current=window.requestAnimationFrame(()=>{h.current=null;const t=y.current;y.current=null,t!==null&&A(t)}))},[A]),z=r.useCallback(()=>{h.current!==null&&(window.cancelAnimationFrame(h.current),h.current=null);const e=y.current;y.current=null,e!==null&&A(e)},[A]),$=r.useCallback(e=>{const t=O.current;return ne(e,Math.min(0,t),Math.max(0,t))},[]),B=r.useCallback(()=>{const e=D.current;if(!e)return null;D.current=null;const t=(performance.now()-e.startTime)/1e3,c={value:e.solver.value(t),velocity:e.solver.velocity(t)};return e.animations.forEach(i=>i.cancel()),c},[]),L=r.useCallback(()=>{_.current!==null&&(window.clearTimeout(_.current),_.current=null)},[]),ee=r.useCallback(()=>{F.current?.(),F.current=null},[]),V=r.useCallback(()=>{z(),L();const e=B();e&&A($(e.value));const t=j.current,c=m.current;t?.getAnimations().forEach(i=>i.cancel()),t&&(t.style.transition="none",t.style.opacity="1"),c?.getAnimations().forEach(i=>i.cancel()),c&&(c.style.transition="none")},[A,L,$,z,B]),Y=r.useCallback((e,t)=>{z(),L();const c=j.current,i=m.current,b=e?0:O.current;i&&(i.style.pointerEvents=e?"auto":"none");const w=B(),C=w?$(w.value):k.current,H=t?.velocity??w?.velocity??0;if(st())return k.current=b,c&&(c.style.transition=`opacity ${re}ms ease`,c.style.opacity=e?"1":"0",c.style.transform=`translateX(${b}px)`),i&&(i.style.transition=`opacity ${re}ms ease`,i.style.opacity=e?"1":"0"),re;c&&(c.style.transition="none",c.style.opacity="1"),i&&(i.style.transition="none");const I=Math.abs(t?.velocity??0)>dt,{frames:G,durationMs:Z,solver:De}=ct({dampingRatio:I?xe.dampingRatio:1,response:xe.response},C,H,b,$);if(!c||Math.abs(C-b)<.5&&Math.abs(H)<5)return A(b),0;const te=c.animate(G.map(P=>({transform:`translateX(${P}px)`})),{duration:Z,easing:"linear",fill:"forwards"}),he=[te];return i&&he.push(i.animate(G.map(P=>({opacity:String(ne(U(P),0,1))})),{duration:Z,easing:"linear",fill:"forwards"})),D.current={solver:De,startTime:performance.now(),target:b,animations:he},K("spring start",{startX:C,startVelocity:H,targetX:b,frames:G.length,durationMs:Z}),te.onfinish=()=>{const P=D.current;!P||!P.animations.includes(te)||(D.current=null,A(b),P.animations.forEach(Le=>Le.cancel()),K("spring finish",{targetX:b}))},Z},[A,L,$,z,U,B]),ue=r.useCallback(e=>{z();const t=e,c=0,i=O.current,b=k.current+nt(t),w=Math.abs(b-c)<=Math.abs(b-i);K("decideSnap",{velocity:t,currentX:k.current,projected:b,shouldOpen:w});const C=Y(w,{velocity:t});return w&&!X.current?_.current=window.setTimeout(()=>{_.current=null,W.current?.()},C+ke):!w&&X.current&&(_.current=window.setTimeout(()=>{_.current=null,ae.current()},C+ke)),w},[Y,z]),de=r.useCallback(e=>{const t=O.current,c=Math.min(0,t),i=Math.max(0,t),b=Q.current;return e<c?c-ge(c-e,b):e>i?i+ge(e-i,b):e},[]),fe=r.useCallback(e=>{const t=M.current,c=performance.now();t.push({t:c,x:e});const i=c-120;for(;t.length>0&&t[0].t<i;)t.shift()},[]),pe=r.useCallback(()=>{const e=M.current;if(e.length<2)return 0;const t=e[e.length-1];if(performance.now()-t.t>60)return 0;const c=e[0],i=(t.t-c.t)/1e3;return i<.016?0:(t.x-c.x)/i},[]);r.useEffect(()=>{L();const e=D.current,t=u?0:O.current;e&&e.target===t||Y(u)},[u,Y,L]),r.useEffect(()=>{V(),q(X.current?0:S)},[S,V,q]),r.useEffect(()=>()=>{ie(),L(),B(),ee()},[L,ie,ee,B]);const _e=be(({active:e,cancel:t,first:c,last:i,movement:[b],event:w})=>{if(K("bindPanel",{active:e,first:c,last:i,mx:b}),!Re(w)){t();return}if(c){if(ee(),v.current=!1,R.current=null,M.current=[],Ee(w)){t();return}const C=j.current,H=C?Ke(w.target,C):null;if(!H||Ue()){t();return}const I=qe(H,b,J.current?-1:1);if(K("arbitrate",{owner:I.kind,mx:b}),I.kind==="swiper"){F.current=Ve(I.instance),t();return}if(I.kind==="scroller"){const G=Ye(I.element);if(G)R.current=G;else{t();return}}R.current||(v.current=!0,V(),T.current=k.current)}if(!e){R.current=null,v.current&&(v.current=!1,ue(pe()));return}if(R.current){Ze(R.current,b);return}if(v.current){const C=de(T.current+b);fe(C),q(C)}},{axis:"x",axisThreshold:ve,filterTaps:!0,pointer:{touch:!0}}),Ne=be(({active:e,cancel:t,first:c,movement:[i],event:b})=>{if(!Re(b)){t();return}if(X.current){t();return}if(c&&(N.current=!0,M.current=[],V(),T.current=k.current),!e){N.current&&(N.current=!1,ue(pe())&&lt());return}if(N.current){const w=de(T.current+i);fe(w),q(w)}},{axis:"x",axisThreshold:ve,filterTaps:!0,pointer:{touch:!0}}),Ae=r.useCallback(e=>{e.preventDefault(),e.stopPropagation(),X.current||W.current?.()},[]);if(l)return s.jsx("aside",{ref:ce,"data-sidebar":a,"data-sidebar-pinned":"true",className:"relative flex h-full min-h-0 w-full flex-col app-chrome-bg",children:g});const me=_e();return s.jsxs(s.Fragment,{children:[s.jsx("div",{...Ne(),style:{position:"fixed",top:"1.5rem",bottom:"10rem",...p?{left:0}:{right:0},width:ut,zIndex:"var(--z-chrome-hint)",touchAction:"none",pointerEvents:u?"none":"auto"},onClick:Ae,"aria-label":d(p?"sidebar.openLeftSidebar":"sidebar.openRightSidebar")}),s.jsx("div",{ref:m,"data-sidebar-backdrop":a,className:"fixed inset-0 z-sidebar-backdrop bg-[var(--app-backdrop)] cursor-default",style:{opacity:Te.current,pointerEvents:u?"auto":"none",transition:"none",willChange:"opacity"},onClick:o,"aria-label":d("sidebar.closeSidebar")}),s.jsx("aside",{...me,onClickCapture:e=>{Ee(e)||me.onClickCapture?.(e)},ref:ce,"data-sidebar":a,className:`fixed inset-y-0 z-sidebar-panel flex flex-col chrome-glow-panel will-change-transform ${p?"border-r border-border":"border-l border-border/15"}`,style:{...p?{left:0}:{right:0},width:f,maxWidth:p?"94vw":"95vw",transform:`translateX(${Ce.current}px)`,transition:"none",touchAction:"pan-y",pointerEvents:u?"auto":"none",paddingTop:"var(--safe-top-inset, env(safe-area-inset-top, 0px))",paddingBottom:"var(--safe-bottom-inset, env(safe-area-inset-bottom, 0px))",...p?{paddingLeft:"var(--safe-left-inset, env(safe-area-inset-left, 0px))"}:{paddingRight:"var(--safe-right-inset, env(safe-area-inset-right, 0px))"}},children:g})]})});function se(n){return n.trim().replace(/\/+$/,"")||"/"}function pt(n){const a=se(n);if(a==="/")return"/";const u=a.lastIndexOf("/");return u<=0?"/":a.slice(0,u)}function je({open:n,initialPath:a,title:u,labels:f,onCancel:o,onConfirm:E}){const{t:g}=oe(),l={hint:f?.hint??g("sidebar.directoryPickerHint"),cancel:f?.cancel??g("common.cancel"),confirm:f?.confirm??g("sidebar.useThisFolder"),close:f?.close??g("common.close"),parent:f?.parent??g("rightSidebar.parentFolder")},x=r.useRef(null);we(x,n,o);const[d,p]=r.useState(()=>se(a));return r.useEffect(()=>{n&&p(se(a))},[a,n]),r.useEffect(()=>{if(!n)return;const S=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=S}},[n]),n?Me.createPortal(s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",className:"fixed inset-0 z-modal-backdrop cursor-default bg-[var(--app-backdrop)] backdrop-blur-sm",onClick:o,"aria-label":l.cancel}),s.jsxs("section",{ref:x,tabIndex:-1,role:"dialog","aria-modal":"true","aria-labelledby":"directory-picker-title",className:"fixed bottom-[max(0.75rem,env(safe-area-inset-bottom,0px))] left-[max(0.75rem,env(safe-area-inset-left,0px))] right-[max(0.75rem,env(safe-area-inset-right,0px))] top-[max(0.75rem,env(safe-area-inset-top,0px))] z-modal-panel flex flex-col overflow-hidden rounded-2xl border border-border/15 bg-surface shadow-[0_28px_70px_var(--app-shadow-strong),0_14px_32px_var(--app-shadow-soft)] sm:bottom-auto sm:left-1/2 sm:right-auto sm:top-1/2 sm:h-[min(72svh,36rem)] sm:w-[min(36rem,calc(100vw-2rem))] sm:-translate-x-1/2 sm:-translate-y-1/2",children:[s.jsxs("header",{className:"flex shrink-0 items-center gap-3 border-b border-border/15 px-4 py-3",children:[s.jsx("span",{className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-primary/15 text-primary",children:s.jsx(We,{size:15})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("h2",{id:"directory-picker-title",className:"text-[13px] font-semibold text-foreground",children:u}),s.jsx("p",{className:"mt-0.5 text-[10px] text-muted-foreground",children:l.hint})]}),s.jsx("button",{type:"button",onClick:o,className:"inline-flex h-9 w-9 items-center justify-center rounded-lg text-muted-foreground transition hover:bg-surface-2 hover:text-foreground","aria-label":l.close,children:s.jsx(Ie,{size:15})})]}),s.jsxs("div",{className:"flex min-h-11 shrink-0 items-center gap-2 border-b border-border/15 px-3 py-1.5",children:[s.jsx("button",{type:"button",disabled:d==="/",onClick:()=>p(pt(d)),className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-lg text-muted-foreground transition hover:bg-surface-2 hover:text-foreground disabled:opacity-30","aria-label":l.parent,children:s.jsx(Qe,{size:14})}),s.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[10.5px] text-foreground",title:d,children:d})]}),s.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto overscroll-contain py-1",children:s.jsx(Pe,{rootPath:d,directoriesOnly:!0,onFileSelect:()=>{},onDirectoryRoot:p,selectedFilePath:a||null})}),s.jsxs("footer",{className:"flex shrink-0 items-center justify-end gap-2 border-t border-border/15 bg-surface-elevated px-3 py-3",children:[s.jsx("button",{type:"button",onClick:o,className:"min-h-10 rounded-lg bg-surface-2 px-4 text-[11px] font-medium text-foreground transition hover:bg-surface",children:l.cancel}),s.jsxs("button",{type:"button",onClick:()=>E(d),className:"inline-flex min-h-10 items-center gap-1.5 rounded-lg bg-primary px-4 text-[11px] font-semibold text-primary-foreground transition hover:bg-primary/90",children:[s.jsx(Fe,{size:13}),l.confirm]})]})]})]}),document.body):null}const kt=Object.freeze(Object.defineProperty({__proto__:null,DirectoryPickerDialog:je},Symbol.toStringTag,{value:"Module"}));function Rt({file:n,initialPath:a,onInsert:u,onDone:f}){const{t:o}=oe(),E=Xe(),[g,l]=r.useState(!1),[x,d]=r.useState(!1),[p,S]=r.useState(!1),[j,m]=r.useState(!1),[k,y]=r.useState(null),h=r.useRef(!1),T=r.useRef(null);we(T,!g,()=>{});const D=async()=>{if(!h.current){h.current=!0,d(!0),m(!0);try{await Be(n.id),f()}catch(v){y(v instanceof Error?v.message:String(v))}finally{h.current=!1,d(!1),m(!1)}}};r.useEffect(()=>{if(g)return;T.current?.focus();const v=R=>{if(R.stopPropagation(),R.key==="Escape"&&R.preventDefault(),R.key!=="Tab")return;const N=Array.from(T.current?.querySelectorAll("button:not(:disabled)")??[]),M=N[0],F=N.at(-1);R.shiftKey&&(document.activeElement===M||document.activeElement===T.current)?(R.preventDefault(),F?.focus()):!R.shiftKey&&document.activeElement===F&&(R.preventDefault(),M?.focus())};return document.addEventListener("keydown",v,!0),()=>document.removeEventListener("keydown",v,!0)},[g]);const _=async(v,R)=>{if(h.current)return;const N=He(R);h.current=!0,d(!0),S(v!==void 0),l(!1),y(null);try{const M=await ze(n.id,v);if(v===void 0&&(!N()||await u(M.path,R)===!1))throw new Error(o("android.captureUnavailable"));f()}catch(M){y(M instanceof Error?M.message:String(M))}finally{h.current=!1,d(!1)}};return g?s.jsx(je,{open:!0,initialPath:a||"/",title:o("android.recordingSave"),onCancel:()=>l(!1),onConfirm:v=>{_(v)}}):Me.createPortal(s.jsx("div",{className:"fixed inset-0 z-modal-panel flex items-center justify-center bg-[var(--app-backdrop)] p-4",children:s.jsxs("div",{ref:T,role:"dialog","aria-modal":"true","aria-labelledby":"recording-save-title",tabIndex:-1,"aria-busy":x,className:"w-full max-w-sm rounded-xl border border-border bg-surface p-4 text-foreground shadow-xl outline-none",children:[s.jsx("h2",{id:"recording-save-title",className:"text-sm font-semibold",children:o("android.recordingConfirm")}),s.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:o("android.recordingSaveHint")}),s.jsxs("p",{className:"mt-2 break-all text-xs text-muted-foreground",children:[n.name," · ",(n.size/1024/1024).toFixed(1)," MB"]}),(k||n.error)&&s.jsx("p",{role:"alert",className:"mt-3 break-words text-xs text-destructive",children:k||n.error}),x&&s.jsxs("p",{role:"status",className:"mt-3 flex items-center gap-2 text-sm text-primary",children:[s.jsx(Oe,{size:16,className:"animate-spin"}),j?`${o("android.recordingDiscard")}…`:o(p?"android.recordingSaving":"android.captureInserting")]}),s.jsxs("div",{className:"mt-4 flex flex-col gap-2",children:[s.jsx("button",{type:"button",disabled:x||n.status!=="ready",onClick:v=>{_(void 0,v.currentTarget)},className:"min-h-10 rounded-lg bg-primary px-3 text-sm text-primary-foreground disabled:opacity-40",children:o("android.recordingInsert")}),!E&&s.jsx("button",{type:"button",disabled:x||n.status!=="ready",onClick:()=>l(!0),className:"min-h-10 rounded-lg bg-surface-2 px-3 text-sm disabled:opacity-40",children:o("android.recordingSave")}),s.jsx("button",{type:"button",disabled:x,onClick:()=>{D()},className:"min-h-10 rounded-lg px-3 text-sm text-muted-foreground disabled:opacity-40",children:o("android.recordingDiscard")})]})]})}),document.body)}export{je as D,Rt as R,vt as S,yt as U,kt as a};
1
+ import{aQ as Se,e5 as oe,cb as s,e6 as we,a0 as Ie,o as Pe,C as Fe,ed as Xe,s as Oe,de as ze,aX as Be,ao as He}from"./app-DvMXSNN7.js";import{R as Ge,b as r,r as Me}from"./dnd-BCFAPC0L.js";import{u as be}from"./use-gesture-react.esm-DYpdiE_k.js";import{S as $e,c as Ke,h as Ue,r as qe,y as Ve,b as Ye,u as Ze}from"./gestureArbiter-DszagC-d.js";import{A as Qe}from"./arrow-up-CYLC6_to.js";const Je=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],We=Se("folder-tree",Je);const et=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],yt=Se("upload",et),xe={dampingRatio:.8,response:.3},tt=.998;function rt(n,a,u,f){const o=2*Math.PI/Math.max(n.response,.001),E=a-f,g=u,l=n.dampingRatio;if(Math.abs(l-1)<1e-4){const m=E,k=g+o*E;return{value:y=>f+(m+k*y)*Math.exp(-o*y),velocity:y=>(k-o*(m+k*y))*Math.exp(-o*y)}}if(l<1){const m=o*Math.sqrt(1-l*l),k=E,y=(g+l*o*E)/m;return{value:h=>f+Math.exp(-l*o*h)*(k*Math.cos(m*h)+y*Math.sin(m*h)),velocity:h=>Math.exp(-l*o*h)*((y*m-l*o*k)*Math.cos(m*h)-(k*m+l*o*y)*Math.sin(m*h))}}const x=o*Math.sqrt(l*l-1),d=-l*o+x,p=-l*o-x,S=(g-p*E)/(d-p),j=E-S;return{value:m=>f+S*Math.exp(d*m)+j*Math.exp(p*m),velocity:m=>S*d*Math.exp(d*m)+j*p*Math.exp(p*m)}}function nt(n,a=tt){return n/1e3*(a/(1-a))}function ge(n,a,u=.55){return n*a*u/(a+u*Math.abs(n))}function st(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}const ot=.1,at=5;function ct(n,a,u,f,o){const E=rt(n,a,u,f),g=1e3/60,l=240,x=[];for(let d=0;d<l;d++){const p=d*g/1e3,S=E.value(p),j=E.velocity(p);if(x.push(o?o(S):S),d>0&&Math.abs(S-f)<ot&&Math.abs(j)<at)break}return x.push(o?o(f):f),{frames:x,durationMs:(x.length-1)*g,solver:E}}const it='input:not([type="hidden"]), textarea, select, [contenteditable]:not([contenteditable="false"])';function lt(){if(typeof document>"u")return;const n=document.activeElement;n instanceof HTMLElement&&n.matches(it)&&n.blur()}const ut=18,ye=8,ve={touch:ye,pen:ye},dt=500,re=200,ke=50,ft=`[${$e}]`;function ne(n,a,u){return Math.min(u,Math.max(a,n))}function Re(n){if(!n||typeof n!="object")return!1;const a=n;return typeof a.pointerType=="string"?a.pointerType==="touch"||a.pointerType==="pen":typeof a.type=="string"&&a.type.startsWith("touch")}function Ee(n){if(!n||typeof n!="object")return!1;const a=n.target;return a instanceof Element&&!!a.closest(ft)}function K(...n){typeof window<"u"&&window.__SIDEBAR_DEBUG__&&console.log("[Sidebar]",...n)}const vt=Ge.forwardRef(function({side:a,isOpen:u,drawerWidthPx:f,onClose:o,onOpen:E,children:g,pinned:l=!1},x){const{t:d}=oe(),p=a==="left",S=p?-f:f,j=r.useRef(null),m=r.useRef(null),k=r.useRef(u?0:S),y=r.useRef(null),h=r.useRef(null),T=r.useRef(0),D=r.useRef(null),_=r.useRef(null),v=r.useRef(!1),R=r.useRef(null),N=r.useRef(!1),M=r.useRef([]),F=r.useRef(null),Ce=r.useRef(k.current),Te=r.useRef(u?1:0),X=r.useRef(u);X.current=u;const O=r.useRef(S);O.current=S;const Q=r.useRef(f);Q.current=f;const J=r.useRef(p);J.current=p;const ae=r.useRef(o);ae.current=o;const W=r.useRef(E);W.current=E;const ce=r.useCallback(e=>{j.current=e,typeof x=="function"?x(e):x&&(x.current=e)},[x]),ie=r.useCallback(()=>{h.current!==null&&(window.cancelAnimationFrame(h.current),h.current=null),y.current=null},[]),U=r.useCallback(e=>{const t=Q.current;return J.current?(e+t)/t:(t-e)/t},[]),le=r.useCallback(e=>{const t=m.current;t&&(t.style.opacity=String(ne(U(e),0,1)))},[U]),A=r.useCallback(e=>{k.current=e;const t=j.current;t&&(t.style.transform=`translateX(${e}px)`,le(e))},[le]),q=r.useCallback(e=>{y.current=e,h.current===null&&(h.current=window.requestAnimationFrame(()=>{h.current=null;const t=y.current;y.current=null,t!==null&&A(t)}))},[A]),z=r.useCallback(()=>{h.current!==null&&(window.cancelAnimationFrame(h.current),h.current=null);const e=y.current;y.current=null,e!==null&&A(e)},[A]),$=r.useCallback(e=>{const t=O.current;return ne(e,Math.min(0,t),Math.max(0,t))},[]),B=r.useCallback(()=>{const e=D.current;if(!e)return null;D.current=null;const t=(performance.now()-e.startTime)/1e3,c={value:e.solver.value(t),velocity:e.solver.velocity(t)};return e.animations.forEach(i=>i.cancel()),c},[]),L=r.useCallback(()=>{_.current!==null&&(window.clearTimeout(_.current),_.current=null)},[]),ee=r.useCallback(()=>{F.current?.(),F.current=null},[]),V=r.useCallback(()=>{z(),L();const e=B();e&&A($(e.value));const t=j.current,c=m.current;t?.getAnimations().forEach(i=>i.cancel()),t&&(t.style.transition="none",t.style.opacity="1"),c?.getAnimations().forEach(i=>i.cancel()),c&&(c.style.transition="none")},[A,L,$,z,B]),Y=r.useCallback((e,t)=>{z(),L();const c=j.current,i=m.current,b=e?0:O.current;i&&(i.style.pointerEvents=e?"auto":"none");const w=B(),C=w?$(w.value):k.current,H=t?.velocity??w?.velocity??0;if(st())return k.current=b,c&&(c.style.transition=`opacity ${re}ms ease`,c.style.opacity=e?"1":"0",c.style.transform=`translateX(${b}px)`),i&&(i.style.transition=`opacity ${re}ms ease`,i.style.opacity=e?"1":"0"),re;c&&(c.style.transition="none",c.style.opacity="1"),i&&(i.style.transition="none");const I=Math.abs(t?.velocity??0)>dt,{frames:G,durationMs:Z,solver:De}=ct({dampingRatio:I?xe.dampingRatio:1,response:xe.response},C,H,b,$);if(!c||Math.abs(C-b)<.5&&Math.abs(H)<5)return A(b),0;const te=c.animate(G.map(P=>({transform:`translateX(${P}px)`})),{duration:Z,easing:"linear",fill:"forwards"}),he=[te];return i&&he.push(i.animate(G.map(P=>({opacity:String(ne(U(P),0,1))})),{duration:Z,easing:"linear",fill:"forwards"})),D.current={solver:De,startTime:performance.now(),target:b,animations:he},K("spring start",{startX:C,startVelocity:H,targetX:b,frames:G.length,durationMs:Z}),te.onfinish=()=>{const P=D.current;!P||!P.animations.includes(te)||(D.current=null,A(b),P.animations.forEach(Le=>Le.cancel()),K("spring finish",{targetX:b}))},Z},[A,L,$,z,U,B]),ue=r.useCallback(e=>{z();const t=e,c=0,i=O.current,b=k.current+nt(t),w=Math.abs(b-c)<=Math.abs(b-i);K("decideSnap",{velocity:t,currentX:k.current,projected:b,shouldOpen:w});const C=Y(w,{velocity:t});return w&&!X.current?_.current=window.setTimeout(()=>{_.current=null,W.current?.()},C+ke):!w&&X.current&&(_.current=window.setTimeout(()=>{_.current=null,ae.current()},C+ke)),w},[Y,z]),de=r.useCallback(e=>{const t=O.current,c=Math.min(0,t),i=Math.max(0,t),b=Q.current;return e<c?c-ge(c-e,b):e>i?i+ge(e-i,b):e},[]),fe=r.useCallback(e=>{const t=M.current,c=performance.now();t.push({t:c,x:e});const i=c-120;for(;t.length>0&&t[0].t<i;)t.shift()},[]),pe=r.useCallback(()=>{const e=M.current;if(e.length<2)return 0;const t=e[e.length-1];if(performance.now()-t.t>60)return 0;const c=e[0],i=(t.t-c.t)/1e3;return i<.016?0:(t.x-c.x)/i},[]);r.useEffect(()=>{L();const e=D.current,t=u?0:O.current;e&&e.target===t||Y(u)},[u,Y,L]),r.useEffect(()=>{V(),q(X.current?0:S)},[S,V,q]),r.useEffect(()=>()=>{ie(),L(),B(),ee()},[L,ie,ee,B]);const _e=be(({active:e,cancel:t,first:c,last:i,movement:[b],event:w})=>{if(K("bindPanel",{active:e,first:c,last:i,mx:b}),!Re(w)){t();return}if(c){if(ee(),v.current=!1,R.current=null,M.current=[],Ee(w)){t();return}const C=j.current,H=C?Ke(w.target,C):null;if(!H||Ue()){t();return}const I=qe(H,b,J.current?-1:1);if(K("arbitrate",{owner:I.kind,mx:b}),I.kind==="swiper"){F.current=Ve(I.instance),t();return}if(I.kind==="scroller"){const G=Ye(I.element);if(G)R.current=G;else{t();return}}R.current||(v.current=!0,V(),T.current=k.current)}if(!e){R.current=null,v.current&&(v.current=!1,ue(pe()));return}if(R.current){Ze(R.current,b);return}if(v.current){const C=de(T.current+b);fe(C),q(C)}},{axis:"x",axisThreshold:ve,filterTaps:!0,pointer:{touch:!0}}),Ne=be(({active:e,cancel:t,first:c,movement:[i],event:b})=>{if(!Re(b)){t();return}if(X.current){t();return}if(c&&(N.current=!0,M.current=[],V(),T.current=k.current),!e){N.current&&(N.current=!1,ue(pe())&&lt());return}if(N.current){const w=de(T.current+i);fe(w),q(w)}},{axis:"x",axisThreshold:ve,filterTaps:!0,pointer:{touch:!0}}),Ae=r.useCallback(e=>{e.preventDefault(),e.stopPropagation(),X.current||W.current?.()},[]);if(l)return s.jsx("aside",{ref:ce,"data-sidebar":a,"data-sidebar-pinned":"true",className:"relative flex h-full min-h-0 w-full flex-col app-chrome-bg",children:g});const me=_e();return s.jsxs(s.Fragment,{children:[s.jsx("div",{...Ne(),style:{position:"fixed",top:"1.5rem",bottom:"10rem",...p?{left:0}:{right:0},width:ut,zIndex:"var(--z-chrome-hint)",touchAction:"none",pointerEvents:u?"none":"auto"},onClick:Ae,"aria-label":d(p?"sidebar.openLeftSidebar":"sidebar.openRightSidebar")}),s.jsx("div",{ref:m,"data-sidebar-backdrop":a,className:"fixed inset-0 z-sidebar-backdrop bg-[var(--app-backdrop)] cursor-default",style:{opacity:Te.current,pointerEvents:u?"auto":"none",transition:"none",willChange:"opacity"},onClick:o,"aria-label":d("sidebar.closeSidebar")}),s.jsx("aside",{...me,onClickCapture:e=>{Ee(e)||me.onClickCapture?.(e)},ref:ce,"data-sidebar":a,className:`fixed inset-y-0 z-sidebar-panel flex flex-col chrome-glow-panel will-change-transform ${p?"border-r border-border":"border-l border-border/15"}`,style:{...p?{left:0}:{right:0},width:f,maxWidth:p?"94vw":"95vw",transform:`translateX(${Ce.current}px)`,transition:"none",touchAction:"pan-y",pointerEvents:u?"auto":"none",paddingTop:"var(--safe-top-inset, env(safe-area-inset-top, 0px))",paddingBottom:"var(--safe-bottom-inset, env(safe-area-inset-bottom, 0px))",...p?{paddingLeft:"var(--safe-left-inset, env(safe-area-inset-left, 0px))"}:{paddingRight:"var(--safe-right-inset, env(safe-area-inset-right, 0px))"}},children:g})]})});function se(n){return n.trim().replace(/\/+$/,"")||"/"}function pt(n){const a=se(n);if(a==="/")return"/";const u=a.lastIndexOf("/");return u<=0?"/":a.slice(0,u)}function je({open:n,initialPath:a,title:u,labels:f,onCancel:o,onConfirm:E}){const{t:g}=oe(),l={hint:f?.hint??g("sidebar.directoryPickerHint"),cancel:f?.cancel??g("common.cancel"),confirm:f?.confirm??g("sidebar.useThisFolder"),close:f?.close??g("common.close"),parent:f?.parent??g("rightSidebar.parentFolder")},x=r.useRef(null);we(x,n,o);const[d,p]=r.useState(()=>se(a));return r.useEffect(()=>{n&&p(se(a))},[a,n]),r.useEffect(()=>{if(!n)return;const S=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=S}},[n]),n?Me.createPortal(s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",className:"fixed inset-0 z-modal-backdrop cursor-default bg-[var(--app-backdrop)] backdrop-blur-sm",onClick:o,"aria-label":l.cancel}),s.jsxs("section",{ref:x,tabIndex:-1,role:"dialog","aria-modal":"true","aria-labelledby":"directory-picker-title",className:"fixed bottom-[max(0.75rem,env(safe-area-inset-bottom,0px))] left-[max(0.75rem,env(safe-area-inset-left,0px))] right-[max(0.75rem,env(safe-area-inset-right,0px))] top-[max(0.75rem,env(safe-area-inset-top,0px))] z-modal-panel flex flex-col overflow-hidden rounded-2xl border border-border/15 bg-surface shadow-[0_28px_70px_var(--app-shadow-strong),0_14px_32px_var(--app-shadow-soft)] sm:bottom-auto sm:left-1/2 sm:right-auto sm:top-1/2 sm:h-[min(72svh,36rem)] sm:w-[min(36rem,calc(100vw-2rem))] sm:-translate-x-1/2 sm:-translate-y-1/2",children:[s.jsxs("header",{className:"flex shrink-0 items-center gap-3 border-b border-border/15 px-4 py-3",children:[s.jsx("span",{className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-primary/15 text-primary",children:s.jsx(We,{size:15})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("h2",{id:"directory-picker-title",className:"text-[13px] font-semibold text-foreground",children:u}),s.jsx("p",{className:"mt-0.5 text-[10px] text-muted-foreground",children:l.hint})]}),s.jsx("button",{type:"button",onClick:o,className:"inline-flex h-9 w-9 items-center justify-center rounded-lg text-muted-foreground transition hover:bg-surface-2 hover:text-foreground","aria-label":l.close,children:s.jsx(Ie,{size:15})})]}),s.jsxs("div",{className:"flex min-h-11 shrink-0 items-center gap-2 border-b border-border/15 px-3 py-1.5",children:[s.jsx("button",{type:"button",disabled:d==="/",onClick:()=>p(pt(d)),className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-lg text-muted-foreground transition hover:bg-surface-2 hover:text-foreground disabled:opacity-30","aria-label":l.parent,children:s.jsx(Qe,{size:14})}),s.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[10.5px] text-foreground",title:d,children:d})]}),s.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto overscroll-contain py-1",children:s.jsx(Pe,{rootPath:d,directoriesOnly:!0,onFileSelect:()=>{},onDirectoryRoot:p,selectedFilePath:a||null})}),s.jsxs("footer",{className:"flex shrink-0 items-center justify-end gap-2 border-t border-border/15 bg-surface-elevated px-3 py-3",children:[s.jsx("button",{type:"button",onClick:o,className:"min-h-10 rounded-lg bg-surface-2 px-4 text-[11px] font-medium text-foreground transition hover:bg-surface",children:l.cancel}),s.jsxs("button",{type:"button",onClick:()=>E(d),className:"inline-flex min-h-10 items-center gap-1.5 rounded-lg bg-primary px-4 text-[11px] font-semibold text-primary-foreground transition hover:bg-primary/90",children:[s.jsx(Fe,{size:13}),l.confirm]})]})]})]}),document.body):null}const kt=Object.freeze(Object.defineProperty({__proto__:null,DirectoryPickerDialog:je},Symbol.toStringTag,{value:"Module"}));function Rt({file:n,initialPath:a,onInsert:u,onDone:f}){const{t:o}=oe(),E=Xe(),[g,l]=r.useState(!1),[x,d]=r.useState(!1),[p,S]=r.useState(!1),[j,m]=r.useState(!1),[k,y]=r.useState(null),h=r.useRef(!1),T=r.useRef(null);we(T,!g,()=>{});const D=async()=>{if(!h.current){h.current=!0,d(!0),m(!0);try{await Be(n.id),f()}catch(v){y(v instanceof Error?v.message:String(v))}finally{h.current=!1,d(!1),m(!1)}}};r.useEffect(()=>{if(g)return;T.current?.focus();const v=R=>{if(R.stopPropagation(),R.key==="Escape"&&R.preventDefault(),R.key!=="Tab")return;const N=Array.from(T.current?.querySelectorAll("button:not(:disabled)")??[]),M=N[0],F=N.at(-1);R.shiftKey&&(document.activeElement===M||document.activeElement===T.current)?(R.preventDefault(),F?.focus()):!R.shiftKey&&document.activeElement===F&&(R.preventDefault(),M?.focus())};return document.addEventListener("keydown",v,!0),()=>document.removeEventListener("keydown",v,!0)},[g]);const _=async(v,R)=>{if(h.current)return;const N=He(R);h.current=!0,d(!0),S(v!==void 0),l(!1),y(null);try{const M=await ze(n.id,v);if(v===void 0&&(!N()||await u(M.path,R)===!1))throw new Error(o("android.captureUnavailable"));f()}catch(M){y(M instanceof Error?M.message:String(M))}finally{h.current=!1,d(!1)}};return g?s.jsx(je,{open:!0,initialPath:a||"/",title:o("android.recordingSave"),onCancel:()=>l(!1),onConfirm:v=>{_(v)}}):Me.createPortal(s.jsx("div",{className:"fixed inset-0 z-modal-panel flex items-center justify-center bg-[var(--app-backdrop)] p-4",children:s.jsxs("div",{ref:T,role:"dialog","aria-modal":"true","aria-labelledby":"recording-save-title",tabIndex:-1,"aria-busy":x,className:"w-full max-w-sm rounded-xl border border-border bg-surface p-4 text-foreground shadow-xl outline-none",children:[s.jsx("h2",{id:"recording-save-title",className:"text-sm font-semibold",children:o("android.recordingConfirm")}),s.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:o("android.recordingSaveHint")}),s.jsxs("p",{className:"mt-2 break-all text-xs text-muted-foreground",children:[n.name," · ",(n.size/1024/1024).toFixed(1)," MB"]}),(k||n.error)&&s.jsx("p",{role:"alert",className:"mt-3 break-words text-xs text-destructive",children:k||n.error}),x&&s.jsxs("p",{role:"status",className:"mt-3 flex items-center gap-2 text-sm text-primary",children:[s.jsx(Oe,{size:16,className:"animate-spin"}),j?`${o("android.recordingDiscard")}…`:o(p?"android.recordingSaving":"android.captureInserting")]}),s.jsxs("div",{className:"mt-4 flex flex-col gap-2",children:[s.jsx("button",{type:"button",disabled:x||n.status!=="ready",onClick:v=>{_(void 0,v.currentTarget)},className:"min-h-10 rounded-lg bg-primary px-3 text-sm text-primary-foreground disabled:opacity-40",children:o("android.recordingInsert")}),!E&&s.jsx("button",{type:"button",disabled:x||n.status!=="ready",onClick:()=>l(!0),className:"min-h-10 rounded-lg bg-surface-2 px-3 text-sm disabled:opacity-40",children:o("android.recordingSave")}),s.jsx("button",{type:"button",disabled:x,onClick:()=>{D()},className:"min-h-10 rounded-lg px-3 text-sm text-muted-foreground disabled:opacity-40",children:o("android.recordingDiscard")})]})]})}),document.body)}export{je as D,Rt as R,vt as S,yt as U,kt as a};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ModelPreview-Du_AyPr9.js","assets/app-BMJesFDU.js","assets/react-XDCjal2T.js","assets/dnd-BCFAPC0L.js","assets/terminal-Dea8wJF3.js","assets/index-CA1fR_jI.css","assets/GitLoadingSkeleton-CBPykkZP.js","assets/sun-B9_TfxlA.js","assets/list-tree-Bou8VSzi.js","assets/AndroidMirrorView-DkOZxYLg.js","assets/v4-EwEgHOG0.js","assets/RecordingSaveDialog-CtXaGgIo.js","assets/use-gesture-react.esm-DYpdiE_k.js","assets/gestureArbiter-DszagC-d.js","assets/arrow-up-CelbB9FE.js","assets/unplug-BSblgecr.js","assets/quote-qXNI_NTi.js","assets/MarkdownPreview-DpvTnKkj.js","assets/swiper-DJjq1TYT.js","assets/swiper-C2J0D0kV.css","assets/syntaxHighlight-bcOB6oww.js","assets/DiffReview-BX2S9hNp.js","assets/sparkles-CCLflSFy.js","assets/DiffViewer-AZvdDGfH.js","assets/git-compare-BlcHEuBI.js","assets/DiffViewer-T3uj2-aP.css","assets/triangle-alert-D3w7mA17.js","assets/ChangeWalkthroughPanel-HZ0zvFvi.js","assets/chevron-left-5sk7gL3u.js","assets/maximize-2-BGTBw-Ku.js","assets/loader-circle-q7h8uwFI.js","assets/arrow-down-D-WZS308.js","assets/ArchitecturePanel-m9GKl3cl.js","assets/link-BnxdKJ7b.js","assets/purify.es-4eNOHKSq.js","assets/ArchitecturePanel-B_BDrrfR.css","assets/ComputerControlView-CSs54lf0.js","assets/clipboard-uSv3AiJM.js","assets/settings-2-B-sr3wQM.js"])))=>i.map(i=>d[i]);
2
- import{aQ as Dr,e5 as _t,cb as t,m as po,cl as Qd,p as Gi,s as lt,F as eh,g as ds,a0 as Xt,ee as U,el as Pt,cB as ct,c as mo,bF as Zd,C as go,f as sa,W as co,e0 as Zs,e1 as Wi,X as Zc,cY as eu,dO as th,dk as rh,b0 as nh,L as bo,R as uo,bX as sh,an as Ws,b9 as ah,e8 as tu,c3 as oh,c5 as ih,c6 as lh,c7 as ch,c4 as qs,bp as dh,E as uh,u as fh,b$ as hh,cD as ph,cG as mh,cH as gh,bS as bh,cE as ed,am as yt,af as ru,ah as xh,j as vh,l as yh,t as Ri,ag as wh,e3 as ji,bR as td,bj as rd,bf as kh,bt as Ci,bu as nd,em as ra,b6 as Ks,bv as Sh,cr as Rh,dL as sd,bm as jh,d_ as Ch,ao as Ni,d9 as Nh,ef as Xr,d0 as An,ai as Ph,aj as ad,by as Eh,aw as od,av as Ah,bg as id,bl as Th,br as ld,dc as Mh,a8 as cd,i as dd,G as Pi,z as ro,b as Lh,w as ud,O as fd,r as Ih,o as hd,ak as $h,a1 as sl,d1 as Fh,ej as Dh,H as _h}from"./app-BMJesFDU.js";import{u as Bh,j as Ei,Z as Uh,a as nu,F as Oh,M as Hh,_ as zh,c as Gh,d as Wh,e as qh,g as Kh,f as Vh,h as Yh,r as Xh,s as Jh}from"./MarkdownPreview-DpvTnKkj.js";import{b as n,r as Qr}from"./dnd-BCFAPC0L.js";import{b as Qh,a as Zh,P as ep,d as tp,S as us,c as rp,N as pd,e as np,C as sp,G as ap,A as op}from"./GitLoadingSkeleton-CBPykkZP.js";import{S as ip,a as md}from"./swiper-DJjq1TYT.js";import{S as lp,U as cp}from"./RecordingSaveDialog-CtXaGgIo.js";import{A as al}from"./arrow-up-CelbB9FE.js";import{D as qi,C as na,f as dp,n as up}from"./DiffReview-BX2S9hNp.js";import{T as fp,G as br}from"./triangle-alert-D3w7mA17.js";import{S as aa}from"./sparkles-CCLflSFy.js";import{C as su,M as au}from"./ChangeWalkthroughPanel-HZ0zvFvi.js";import{R as ou,S as gd,V as hp,e as pp,M as mp,A as Ai,u as gp,g as bp,i as bd,H as xd,b as xp}from"./AndroidMirrorView-DkOZxYLg.js";import{u as vp}from"./DiffViewer-AZvdDGfH.js";import{r as yp,s as wp,l as kp,a as vd,g as Ki,b as Sp,h as Rp}from"./syntaxHighlight-bcOB6oww.js";import{L as yd}from"./loader-circle-q7h8uwFI.js";import{a as wd,S as kd}from"./gestureArbiter-DszagC-d.js";import{M as iu}from"./maximize-2-BGTBw-Ku.js";import{L as jp}from"./list-tree-Bou8VSzi.js";import{A as Cp}from"./arrow-down-D-WZS308.js";import{G as lu}from"./git-compare-BlcHEuBI.js";const Np=[["path",{d:"m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16",key:"d5nyq2"}],["path",{d:"M22 9v7",key:"pvm9v3"}],["path",{d:"M3.304 13h6.392",key:"1q3zxz"}],["circle",{cx:"18.5",cy:"12.5",r:"3.5",key:"z97x68"}]],Pp=Dr("case-sensitive",Np);const Ep=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Ap=Dr("eye-off",Ep);const Tp=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Vi=Dr("eye",Tp);const Mp=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Yi=Dr("file-text",Mp);const Lp=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],Ip=Dr("funnel",Lp);const $p=[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]],Fp=Dr("image-plus",$p);const Dp=[["path",{d:"M17 3v10",key:"15fgeh"}],["path",{d:"m12.67 5.5 8.66 5",key:"1gpheq"}],["path",{d:"m12.67 10.5 8.66-5",key:"1dkfa6"}],["path",{d:"M9 17a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2v-2z",key:"swwfx4"}]],_p=Dr("regex",Dp);const Bp=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]],Up=Dr("scan",Bp);const Op=[["circle",{cx:"7",cy:"12",r:"3",key:"12clwm"}],["path",{d:"M10 9v6",key:"17i7lo"}],["circle",{cx:"17",cy:"12",r:"3",key:"gl7c2s"}],["path",{d:"M14 7v8",key:"dl84cr"}],["path",{d:"M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1",key:"lt2kga"}]],Hp=Dr("whole-word",Op);function Sd({children:r,actions:a}){const{t:i}=_t(),[c,f]=n.useState(!1),p=n.useId(),g=n.useRef(null),k=n.useRef(null),m=()=>{f(!1),g.current?.focus({preventScroll:!0})};return n.useLayoutEffect(()=>{if(!c)return;const x=g.current,w=k.current;if(!x||!w)return;const R=window.visualViewport,b=()=>{const P=x.getBoundingClientRect(),$=(R?.offsetLeft??0)+8,D=(R?.offsetTop??0)+8,te=Math.max(0,(R?.width??window.innerWidth)-16),M=D+(R?.height??window.innerHeight)-16,I=Math.min(240,te),H=Math.max(0,P.top-D-6),Y=Math.max(0,M-P.bottom-6),be=w.scrollHeight>Y&&H>Y;Object.assign(w.style,{width:`${I}px`,left:`${Math.max($,Math.min(P.right-I,$+te-I))}px`,top:`${be?P.top-6:P.bottom+6}px`,maxHeight:`${be?H:Y}px`,transform:be?"translateY(-100%)":"none"})};b();const A=typeof ResizeObserver>"u"?null:new ResizeObserver(b);return A?.observe(x),A?.observe(w),window.addEventListener("resize",b),window.addEventListener("scroll",b,!0),R?.addEventListener("resize",b),R?.addEventListener("scroll",b),()=>{A?.disconnect(),window.removeEventListener("resize",b),window.removeEventListener("scroll",b,!0),R?.removeEventListener("resize",b),R?.removeEventListener("scroll",b)}},[c]),n.useEffect(()=>{if(!c)return;k.current?.querySelector("button:not(:disabled)")?.focus({preventScroll:!0});const x=w=>{w.target instanceof Node&&!g.current?.contains(w.target)&&!k.current?.contains(w.target)&&f(!1)};return document.addEventListener("pointerdown",x),()=>document.removeEventListener("pointerdown",x)},[c]),t.jsxs("div",{className:"mt-2",children:[t.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1.5",children:[r,t.jsxs("button",{ref:g,type:"button","aria-haspopup":"menu","aria-expanded":c,"aria-controls":c?p:void 0,onClick:()=>f(x=>!x),onKeyDown:x=>{(x.key==="ArrowDown"||x.key==="ArrowUp")&&(x.preventDefault(),f(!0))},className:`ml-auto inline-flex h-8 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md px-2 text-[11px] font-medium transition focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary ${c?"bg-surface-2 text-foreground":"text-muted-foreground hover:bg-surface-2 hover:text-foreground"}`,children:[t.jsx(po,{size:14}),i("sidebar.moreActions")]})]}),typeof document<"u"&&Qr.createPortal(t.jsx("div",{ref:k,id:p,hidden:!c,role:"menu","data-sidebar-gesture-ignore":!0,"aria-label":i("sidebar.moreActions"),className:"fixed z-menu-panel overflow-y-auto overscroll-contain rounded-lg border border-border/30 bg-surface p-1 shadow-[0_8px_24px_var(--app-shadow-soft)]",onKeyDown:x=>{if(!x.currentTarget.contains(x.target))return;const w=[...x.currentTarget.querySelectorAll("button:not(:disabled)")],R=w.indexOf(document.activeElement);let b;if(x.key==="Escape"){x.preventDefault(),x.stopPropagation(),m();return}if(x.key==="Tab"){m();return}if(x.key==="ArrowDown")b=(R+1)%w.length;else if(x.key==="ArrowUp")b=(R-1+w.length)%w.length;else if(x.key==="Home")b=0;else if(x.key==="End")b=w.length-1;else return;x.preventDefault(),w[b]?.focus({preventScroll:!0})},children:a(m)}),document.body)]})}const Ti="a[href],button,input,select,textarea,[tabindex],[contenteditable],iframe,summary,audio[controls],video[controls]",is=n.memo(function({active:a,mounted:i=!0,fallback:c=null,children:f}){const p=n.useRef(null);return n.useLayoutEffect(()=>{const g=p.current;if(!g||a)return;const k=new Map,m=R=>{k.has(R)||(k.set(R,R.inert),R.inert=!0)},x=R=>{R instanceof HTMLElement&&R.matches(Ti)&&m(R),R.querySelectorAll(Ti).forEach(m)};x(g);const w=new MutationObserver(R=>{for(const b of R)b.type==="attributes"?b.target instanceof HTMLElement&&b.target.matches(Ti)&&m(b.target):b.addedNodes.forEach(A=>{A instanceof Element&&x(A)})});return w.observe(g,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabindex","href","contenteditable","controls"]}),()=>{w.disconnect();for(const[R,b]of k)R.inert=b}},[a,i]),t.jsx("div",{ref:p,className:"absolute inset-0 min-h-0 overflow-hidden bg-surface text-foreground",style:a?void 0:{clipPath:"inset(100%)"},"aria-hidden":!a,children:i?typeof f=="function"?f():f:c})},(r,a)=>!r.active&&!a.active&&r.mounted===a.mounted);async function zp(r){let a;try{await Promise.race([r(),new Promise(i=>{a=setTimeout(i,3e3)})])}catch{}finally{clearTimeout(a)}}function Gp({active:r,rootPath:a,loading:i,delay:c,lastStartedRoot:f,load:p}){n.useEffect(()=>{if(!r||!a||i||f.current===a)return;const g=window.setTimeout(()=>{f.current=a,p(a)},c);return()=>window.clearTimeout(g)},[r,a,i,c,f,p])}function Wp({rootPath:r,paths:a,disabled:i,onChange:c}){const{t:f}=_t(),[p,g]=n.useState(""),[k,m]=n.useState(0),[x,w]=n.useState(null),[R,b]=n.useState(!1),[A,P]=n.useState(!1),$=`${r.replace(/[\\/]+$/,"")}/${p}`;n.useEffect(()=>{const I=new AbortController;return w(null),b(!1),Qd($,I.signal,!0,"pick_git_ignore_exception").then(H=>{I.signal.aborted||w({directory:p,entries:H.entries,truncated:!!H.truncated})}).catch(()=>{I.signal.aborted||b(!0)}),()=>I.abort()},[$,p,k]);const D=I=>{w(null),b(!1),g(I)},te=x?.directory===p,M=I=>{if(I.length>200){P(!0);return}P(!1),c(I)};return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"overflow-hidden rounded-lg border border-border/30 bg-surface-2",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 p-2",children:[t.jsx("button",{type:"button",disabled:i||!p,onClick:()=>D(p.slice(0,Math.max(0,p.lastIndexOf("/")))),"aria-label":f("rightSidebar.parentFolder"),className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-surface-elevated hover:text-foreground disabled:opacity-30",children:t.jsx(al,{size:14})}),t.jsx("button",{type:"button",disabled:i||!p,onClick:()=>D(""),"aria-label":f("rightSidebar.backToProjectRoot"),className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-surface-elevated hover:text-foreground disabled:opacity-30",children:t.jsx(Gi,{size:14})}),t.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs",title:$,children:p||"./"})]}),t.jsxs("div",{className:"h-56 overflow-y-auto overscroll-contain p-1",role:"group","aria-label":f("rightSidebar.gitIgnoreExceptionsPaths"),"aria-busy":!te&&!R,children:[R?t.jsxs("div",{className:"flex flex-col items-center gap-2 p-4 text-center text-xs",children:[t.jsx("p",{role:"alert",className:"text-destructive",children:f("rightSidebar.gitIgnoreExceptionsLoadFailed")}),t.jsx("button",{type:"button",disabled:i,onClick:()=>{b(!1),m(I=>I+1)},className:"rounded-md px-3 py-2 text-primary hover:bg-surface-elevated disabled:opacity-40",children:f("common.retry")})]}):te?x.entries.length===0?t.jsx("p",{className:"p-4 text-center text-xs text-muted-foreground",children:f("rightSidebar.gitIgnoreExceptionsEmptyDirectory")}):x.entries.map(I=>{const H=p?`${p}/${I.name}`:I.name,Y=H+(I.type==="directory"?"/":""),be=a.includes(Y)||a.includes(H),_=a.some(ae=>ae.endsWith("/")&&H.startsWith(ae)),o=I.type==="directory"?Gi:eh;return t.jsxs("div",{className:"flex items-center gap-1 rounded-md hover:bg-surface-elevated",children:[t.jsxs("label",{className:"flex min-h-10 min-w-0 flex-1 cursor-pointer items-center gap-2 px-2 text-xs",children:[t.jsx("input",{type:"checkbox",checked:be||_,disabled:i||_,onChange:()=>M(be?a.filter(ae=>ae!==Y&&ae!==H):[...a,Y]),className:"h-4 w-4 shrink-0 accent-[var(--primary)] disabled:opacity-40"}),t.jsx(o,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsx("span",{className:"truncate",title:I.name,children:I.name})]}),I.type==="directory"&&t.jsx("button",{type:"button",disabled:i,onClick:()=>D(H),"aria-label":f("rightSidebar.gitIgnoreExceptionsOpenDirectory",{name:I.name}),className:"inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-surface hover:text-foreground disabled:opacity-40",children:t.jsx(ds,{size:15})})]},I.name)}):t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(lt,{size:18})}),te&&x.truncated&&t.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:f("rightSidebar.gitIgnoreExceptionsTruncated")})]})]}),t.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs",children:[t.jsx("span",{className:"font-medium",children:f("rightSidebar.gitIgnoreExceptionsSelected",{count:a.length})}),t.jsx("button",{type:"button",disabled:i||a.length===0,onClick:()=>M([]),className:"rounded-md px-2 py-1 text-muted-foreground hover:bg-surface-2 hover:text-foreground disabled:opacity-40",children:f("rightSidebar.gitIgnoreExceptionsClear")})]}),a.length>0&&t.jsx("ul",{className:"max-h-24 overflow-y-auto overscroll-contain",children:a.map(I=>t.jsxs("li",{className:"flex items-center gap-2 rounded-md pl-2 text-xs hover:bg-surface-2",children:[t.jsx("span",{className:"min-w-0 flex-1 truncate font-mono",title:I,children:I}),t.jsx("button",{type:"button",disabled:i,onClick:()=>M(a.filter(H=>H!==I)),"aria-label":f("rightSidebar.gitIgnoreExceptionsRemove",{path:I}),className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-surface-elevated hover:text-foreground disabled:opacity-40",children:t.jsx(Xt,{size:13})})]},I))}),A&&t.jsx("p",{role:"alert",className:"text-xs text-destructive",children:f("rightSidebar.gitIgnoreExceptionsInvalid")})]})}function qp({rootPath:r,disabled:a,pressed:i,saving:c,onToggle:f}){const{t:p}=_t(),g=n.useId(),k=n.useRef(null),m=n.useRef(null),x=n.useRef(null),w=n.useRef(null),R=n.useRef(!1),[b,A]=n.useState(!1),[P,$]=n.useState([]),[D,te]=n.useState(!1),[M,I]=n.useState(null),H=U(W=>W.setGitIgnoreExceptions),Y=()=>{x.current!==null&&clearTimeout(x.current),x.current=null,w.current=null},be=()=>{Y(),!(a||D||!r)&&($([...U.getState().gitIgnoreExceptions[r]??[]]),I(null),A(!0))},_=()=>{D||A(!1)},o=W=>{Y(),R.current=!1,!(W.button!==0||!W.isPrimary||a)&&(W.currentTarget.setPointerCapture(W.pointerId),w.current={x:W.clientX,y:W.clientY},x.current=setTimeout(()=>{R.current=!0,be()},450))};n.useEffect(()=>(A(!1),Y(),Y),[r]),n.useEffect(()=>{if(b)return m.current?.focus(),()=>k.current?.focus()},[b]);const ae=p(i?"rightSidebar.showGitIgnoredFiles":"rightSidebar.hideGitIgnoredFiles");return t.jsxs(t.Fragment,{children:[t.jsx("button",{ref:k,type:"button",disabled:a||D,"aria-pressed":i,"aria-label":ae,"aria-description":p("rightSidebar.gitIgnoreConfigureHint"),title:`${ae} · ${p("rightSidebar.gitIgnoreConfigureHint")}`,onClick:W=>{if(R.current&&W.detail!==0){R.current=!1,W.preventDefault();return}f()},onContextMenu:W=>{W.preventDefault(),R.current=!0,b||be()},onPointerDown:o,onPointerMove:W=>{const he=w.current;he&&Math.hypot(W.clientX-he.x,W.clientY-he.y)>10&&Y()},onPointerUp:Y,onPointerCancel:Y,onLostPointerCapture:Y,className:`inline-flex h-7 w-7 shrink-0 select-none items-center justify-center rounded-md transition active:scale-95 disabled:cursor-not-allowed disabled:opacity-35 [-webkit-touch-callout:none] ${i?"bg-surface-2 text-primary hover:bg-surface-elevated":"text-muted-foreground hover:bg-surface-2 hover:text-foreground"}`,children:c?t.jsx(lt,{size:14}):t.jsx(Ip,{size:14})}),b&&Qr.createPortal(t.jsx("div",{className:"fixed inset-0 z-modal-backdrop flex items-center justify-center bg-[var(--app-backdrop)] p-3 backdrop-blur-sm",onClick:_,children:t.jsxs("form",{ref:m,role:"dialog",tabIndex:-1,"aria-modal":"true","aria-labelledby":`${g}-title`,"aria-describedby":`${g}-hint`,className:"relative z-modal-panel flex max-h-[80dvh] w-full max-w-lg flex-col gap-3 overflow-y-auto rounded-xl border border-border/20 bg-surface p-4 text-foreground shadow-2xl",onClick:W=>W.stopPropagation(),onKeyDown:W=>{if(W.key==="Escape"&&(W.preventDefault(),W.stopPropagation(),_()),W.key==="Tab"){const he=Array.from(m.current?.querySelectorAll("button:not(:disabled), input:not(:disabled)")??[]);if(!he.length){W.preventDefault(),m.current?.focus();return}const G=he[0],le=he[he.length-1];W.shiftKey&&document.activeElement===G&&(W.preventDefault(),le?.focus()),document.activeElement===m.current?(W.preventDefault(),(W.shiftKey?le:G)?.focus()):!W.shiftKey&&document.activeElement===le&&(W.preventDefault(),G?.focus())}},onSubmit:W=>{if(W.preventDefault(),!(!r||D)){if(P.length>200){I(p("rightSidebar.gitIgnoreExceptionsInvalid"));return}te(!0),I(null),H(r,P).then(()=>A(!1)).catch(()=>I(p("rightSidebar.gitIgnoreExceptionsSaveFailed"))).finally(()=>te(!1))}},children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx("h2",{id:`${g}-title`,className:"text-sm font-medium",children:p("rightSidebar.gitIgnoreExceptionsTitle")}),t.jsx("button",{type:"button",disabled:D,onClick:_,"aria-label":p("common.close"),className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-surface-2 hover:text-foreground disabled:opacity-40",children:t.jsx(Xt,{size:16})})]}),t.jsx("p",{className:"truncate text-xs text-muted-foreground",title:r??void 0,children:r}),t.jsx("p",{id:`${g}-hint`,className:"text-xs leading-relaxed text-muted-foreground",children:p("rightSidebar.gitIgnoreExceptionsHint")}),t.jsx("p",{className:"text-xs font-medium",children:p("rightSidebar.gitIgnoreExceptionsPaths")}),r&&t.jsx(Wp,{rootPath:r,paths:P,onChange:$,disabled:D}),M&&t.jsx("p",{role:"alert",className:"text-xs text-destructive",children:M}),t.jsxs("div",{className:"flex justify-end gap-2",children:[t.jsx("button",{type:"button",disabled:D,onClick:_,className:"rounded-lg px-3 py-2 text-xs text-muted-foreground hover:bg-surface-2 disabled:opacity-40",children:p("common.cancel")}),t.jsxs("button",{type:"submit",disabled:D,className:"inline-flex items-center gap-2 rounded-lg bg-primary px-3 py-2 text-xs font-medium text-primary-foreground disabled:opacity-50",children:[D&&t.jsx(lt,{size:13}),p("common.save")]})]})]})}),document.body)]})}function Kp(r,a,i){try{const c=r instanceof HTMLImageElement?r.naturalWidth:r.width,f=r instanceof HTMLImageElement?r.naturalHeight:r.height;if(!c||!f)return Promise.resolve(null);const p=r instanceof HTMLImageElement?1400/Math.max(c,f):Math.min(1,1400/Math.max(c,f)),g=document.createElement("canvas");g.width=Math.max(1,Math.round(c*p)),g.height=Math.max(1,Math.round(f*p));const k=g.getContext("2d");if(!k)return Promise.resolve(null);const m=getComputedStyle(document.documentElement);if(k.fillStyle=m.getPropertyValue("--surface").trim()||"white",k.fillRect(0,0,g.width,g.height),k.drawImage(r,0,0,g.width,g.height),i){const x=Math.max(10,Math.min(16,g.width/35));k.font=`${x}px sans-serif`;const w=[];let R="";for(const b of i.split(" "))R&&k.measureText(`${R} ${b}`).width>g.width-20?(w.push(R),R=b):R=R?`${R} ${b}`:b;R&&w.push(R),k.fillStyle=m.getPropertyValue("--surface").trim()||"white",k.fillRect(0,0,g.width,w.length*(x+4)+12),k.fillStyle=m.getPropertyValue("--foreground").trim()||"black",w.forEach((b,A)=>k.fillText(b,10,8+x+A*(x+4)))}if(a){const x=a.xPercent*g.width/100,w=a.yPercent*g.height/100,R=Math.max(4,Math.min(12,Math.min(g.width,g.height)*.015)),b=R*1.6;k.strokeStyle=m.getPropertyValue("--primary").trim()||"black",k.lineWidth=Math.max(1,R/3),k.beginPath(),k.arc(x,w,R,0,Math.PI*2),k.stroke(),k.beginPath(),k.moveTo(x-b,w),k.lineTo(x+b,w),k.moveTo(x,w-b),k.lineTo(x,w+b),k.stroke()}return new Promise(x=>g.toBlob(x,"image/png"))}catch{return Promise.resolve(null)}}function Vp(r,a,i,c){return[r.trim(),a.trim(),c?`截图:${c}`:""].filter(Boolean).join(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ModelPreview-DymFzc55.js","assets/app-DvMXSNN7.js","assets/react-XDCjal2T.js","assets/dnd-BCFAPC0L.js","assets/terminal-Dea8wJF3.js","assets/index-CA1fR_jI.css","assets/GitLoadingSkeleton-DfWzAnA2.js","assets/sun-CO5F9zS4.js","assets/list-tree-BPg9QdiM.js","assets/AndroidMirrorView-C39BgFa_.js","assets/v4-EwEgHOG0.js","assets/RecordingSaveDialog-CxSN76bp.js","assets/use-gesture-react.esm-DYpdiE_k.js","assets/gestureArbiter-DszagC-d.js","assets/arrow-up-CYLC6_to.js","assets/unplug-C0pb-BKU.js","assets/quote-CuTMveNr.js","assets/MarkdownPreview-DHLp5cqt.js","assets/swiper-DJjq1TYT.js","assets/swiper-C2J0D0kV.css","assets/syntaxHighlight-C9PKWUqs.js","assets/DiffReview-YADkwVd6.js","assets/sparkles-ZXBp-KvJ.js","assets/DiffViewer-CT5_YwM2.js","assets/git-compare-CGiJqTYP.js","assets/DiffViewer-T3uj2-aP.css","assets/triangle-alert-CuGUScPU.js","assets/ChangeWalkthroughPanel-BH1Una8m.js","assets/chevron-left-BNby2AjR.js","assets/maximize-2-32OfQ0kG.js","assets/loader-circle-CTtHKNWd.js","assets/arrow-down-CZKuaGwN.js","assets/ArchitecturePanel-Xi_R4Tso.js","assets/link-C5oPMHMJ.js","assets/purify.es-4eNOHKSq.js","assets/ArchitecturePanel-B_BDrrfR.css","assets/ComputerControlView-BGvF5NeQ.js","assets/clipboard-6kE6vzDi.js","assets/settings-2-GFFo5UwO.js"])))=>i.map(i=>d[i]);
2
+ import{aQ as Dr,e5 as _t,cb as t,m as po,cl as Qd,p as Gi,s as lt,F as eh,g as ds,a0 as Xt,ee as U,el as Pt,cB as ct,c as mo,bF as Zd,C as go,f as sa,W as co,e0 as Zs,e1 as Wi,X as Zc,cY as eu,dO as th,dk as rh,b0 as nh,L as bo,R as uo,bX as sh,an as Ws,b9 as ah,e8 as tu,c3 as oh,c5 as ih,c6 as lh,c7 as ch,c4 as qs,bp as dh,E as uh,u as fh,b$ as hh,cD as ph,cG as mh,cH as gh,bS as bh,cE as ed,am as yt,af as ru,ah as xh,j as vh,l as yh,t as Ri,ag as wh,e3 as ji,bR as td,bj as rd,bf as kh,bt as Ci,bu as nd,em as ra,b6 as Ks,bv as Sh,cr as Rh,dL as sd,bm as jh,d_ as Ch,ao as Ni,d9 as Nh,ef as Xr,d0 as An,ai as Ph,aj as ad,by as Eh,aw as od,av as Ah,bg as id,bl as Th,br as ld,dc as Mh,a8 as cd,i as dd,G as Pi,z as ro,b as Lh,w as ud,O as fd,r as Ih,o as hd,ak as $h,a1 as sl,d1 as Fh,ej as Dh,H as _h}from"./app-DvMXSNN7.js";import{u as Bh,j as Ei,Z as Uh,a as nu,F as Oh,M as Hh,_ as zh,c as Gh,d as Wh,e as qh,g as Kh,f as Vh,h as Yh,r as Xh,s as Jh}from"./MarkdownPreview-DHLp5cqt.js";import{b as n,r as Qr}from"./dnd-BCFAPC0L.js";import{b as Qh,a as Zh,P as ep,d as tp,S as us,c as rp,N as pd,e as np,C as sp,G as ap,A as op}from"./GitLoadingSkeleton-DfWzAnA2.js";import{S as ip,a as md}from"./swiper-DJjq1TYT.js";import{S as lp,U as cp}from"./RecordingSaveDialog-CxSN76bp.js";import{A as al}from"./arrow-up-CYLC6_to.js";import{D as qi,C as na,f as dp,n as up}from"./DiffReview-YADkwVd6.js";import{T as fp,G as br}from"./triangle-alert-CuGUScPU.js";import{S as aa}from"./sparkles-ZXBp-KvJ.js";import{C as su,M as au}from"./ChangeWalkthroughPanel-BH1Una8m.js";import{R as ou,S as gd,V as hp,e as pp,M as mp,A as Ai,u as gp,g as bp,i as bd,H as xd,b as xp}from"./AndroidMirrorView-C39BgFa_.js";import{u as vp}from"./DiffViewer-CT5_YwM2.js";import{r as yp,s as wp,l as kp,a as vd,g as Ki,b as Sp,h as Rp}from"./syntaxHighlight-C9PKWUqs.js";import{L as yd}from"./loader-circle-CTtHKNWd.js";import{a as wd,S as kd}from"./gestureArbiter-DszagC-d.js";import{M as iu}from"./maximize-2-32OfQ0kG.js";import{L as jp}from"./list-tree-BPg9QdiM.js";import{A as Cp}from"./arrow-down-CZKuaGwN.js";import{G as lu}from"./git-compare-CGiJqTYP.js";const Np=[["path",{d:"m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16",key:"d5nyq2"}],["path",{d:"M22 9v7",key:"pvm9v3"}],["path",{d:"M3.304 13h6.392",key:"1q3zxz"}],["circle",{cx:"18.5",cy:"12.5",r:"3.5",key:"z97x68"}]],Pp=Dr("case-sensitive",Np);const Ep=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Ap=Dr("eye-off",Ep);const Tp=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Vi=Dr("eye",Tp);const Mp=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Yi=Dr("file-text",Mp);const Lp=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],Ip=Dr("funnel",Lp);const $p=[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]],Fp=Dr("image-plus",$p);const Dp=[["path",{d:"M17 3v10",key:"15fgeh"}],["path",{d:"m12.67 5.5 8.66 5",key:"1gpheq"}],["path",{d:"m12.67 10.5 8.66-5",key:"1dkfa6"}],["path",{d:"M9 17a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2v-2z",key:"swwfx4"}]],_p=Dr("regex",Dp);const Bp=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]],Up=Dr("scan",Bp);const Op=[["circle",{cx:"7",cy:"12",r:"3",key:"12clwm"}],["path",{d:"M10 9v6",key:"17i7lo"}],["circle",{cx:"17",cy:"12",r:"3",key:"gl7c2s"}],["path",{d:"M14 7v8",key:"dl84cr"}],["path",{d:"M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1",key:"lt2kga"}]],Hp=Dr("whole-word",Op);function Sd({children:r,actions:a}){const{t:i}=_t(),[c,f]=n.useState(!1),p=n.useId(),g=n.useRef(null),k=n.useRef(null),m=()=>{f(!1),g.current?.focus({preventScroll:!0})};return n.useLayoutEffect(()=>{if(!c)return;const x=g.current,w=k.current;if(!x||!w)return;const R=window.visualViewport,b=()=>{const P=x.getBoundingClientRect(),$=(R?.offsetLeft??0)+8,D=(R?.offsetTop??0)+8,te=Math.max(0,(R?.width??window.innerWidth)-16),M=D+(R?.height??window.innerHeight)-16,I=Math.min(240,te),H=Math.max(0,P.top-D-6),Y=Math.max(0,M-P.bottom-6),be=w.scrollHeight>Y&&H>Y;Object.assign(w.style,{width:`${I}px`,left:`${Math.max($,Math.min(P.right-I,$+te-I))}px`,top:`${be?P.top-6:P.bottom+6}px`,maxHeight:`${be?H:Y}px`,transform:be?"translateY(-100%)":"none"})};b();const A=typeof ResizeObserver>"u"?null:new ResizeObserver(b);return A?.observe(x),A?.observe(w),window.addEventListener("resize",b),window.addEventListener("scroll",b,!0),R?.addEventListener("resize",b),R?.addEventListener("scroll",b),()=>{A?.disconnect(),window.removeEventListener("resize",b),window.removeEventListener("scroll",b,!0),R?.removeEventListener("resize",b),R?.removeEventListener("scroll",b)}},[c]),n.useEffect(()=>{if(!c)return;k.current?.querySelector("button:not(:disabled)")?.focus({preventScroll:!0});const x=w=>{w.target instanceof Node&&!g.current?.contains(w.target)&&!k.current?.contains(w.target)&&f(!1)};return document.addEventListener("pointerdown",x),()=>document.removeEventListener("pointerdown",x)},[c]),t.jsxs("div",{className:"mt-2",children:[t.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1.5",children:[r,t.jsxs("button",{ref:g,type:"button","aria-haspopup":"menu","aria-expanded":c,"aria-controls":c?p:void 0,onClick:()=>f(x=>!x),onKeyDown:x=>{(x.key==="ArrowDown"||x.key==="ArrowUp")&&(x.preventDefault(),f(!0))},className:`ml-auto inline-flex h-8 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md px-2 text-[11px] font-medium transition focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary ${c?"bg-surface-2 text-foreground":"text-muted-foreground hover:bg-surface-2 hover:text-foreground"}`,children:[t.jsx(po,{size:14}),i("sidebar.moreActions")]})]}),typeof document<"u"&&Qr.createPortal(t.jsx("div",{ref:k,id:p,hidden:!c,role:"menu","data-sidebar-gesture-ignore":!0,"aria-label":i("sidebar.moreActions"),className:"fixed z-menu-panel overflow-y-auto overscroll-contain rounded-lg border border-border/30 bg-surface p-1 shadow-[0_8px_24px_var(--app-shadow-soft)]",onKeyDown:x=>{if(!x.currentTarget.contains(x.target))return;const w=[...x.currentTarget.querySelectorAll("button:not(:disabled)")],R=w.indexOf(document.activeElement);let b;if(x.key==="Escape"){x.preventDefault(),x.stopPropagation(),m();return}if(x.key==="Tab"){m();return}if(x.key==="ArrowDown")b=(R+1)%w.length;else if(x.key==="ArrowUp")b=(R-1+w.length)%w.length;else if(x.key==="Home")b=0;else if(x.key==="End")b=w.length-1;else return;x.preventDefault(),w[b]?.focus({preventScroll:!0})},children:a(m)}),document.body)]})}const Ti="a[href],button,input,select,textarea,[tabindex],[contenteditable],iframe,summary,audio[controls],video[controls]",is=n.memo(function({active:a,mounted:i=!0,fallback:c=null,children:f}){const p=n.useRef(null);return n.useLayoutEffect(()=>{const g=p.current;if(!g||a)return;const k=new Map,m=R=>{k.has(R)||(k.set(R,R.inert),R.inert=!0)},x=R=>{R instanceof HTMLElement&&R.matches(Ti)&&m(R),R.querySelectorAll(Ti).forEach(m)};x(g);const w=new MutationObserver(R=>{for(const b of R)b.type==="attributes"?b.target instanceof HTMLElement&&b.target.matches(Ti)&&m(b.target):b.addedNodes.forEach(A=>{A instanceof Element&&x(A)})});return w.observe(g,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabindex","href","contenteditable","controls"]}),()=>{w.disconnect();for(const[R,b]of k)R.inert=b}},[a,i]),t.jsx("div",{ref:p,className:"absolute inset-0 min-h-0 overflow-hidden bg-surface text-foreground",style:a?void 0:{clipPath:"inset(100%)"},"aria-hidden":!a,children:i?typeof f=="function"?f():f:c})},(r,a)=>!r.active&&!a.active&&r.mounted===a.mounted);async function zp(r){let a;try{await Promise.race([r(),new Promise(i=>{a=setTimeout(i,3e3)})])}catch{}finally{clearTimeout(a)}}function Gp({active:r,rootPath:a,loading:i,delay:c,lastStartedRoot:f,load:p}){n.useEffect(()=>{if(!r||!a||i||f.current===a)return;const g=window.setTimeout(()=>{f.current=a,p(a)},c);return()=>window.clearTimeout(g)},[r,a,i,c,f,p])}function Wp({rootPath:r,paths:a,disabled:i,onChange:c}){const{t:f}=_t(),[p,g]=n.useState(""),[k,m]=n.useState(0),[x,w]=n.useState(null),[R,b]=n.useState(!1),[A,P]=n.useState(!1),$=`${r.replace(/[\\/]+$/,"")}/${p}`;n.useEffect(()=>{const I=new AbortController;return w(null),b(!1),Qd($,I.signal,!0,"pick_git_ignore_exception").then(H=>{I.signal.aborted||w({directory:p,entries:H.entries,truncated:!!H.truncated})}).catch(()=>{I.signal.aborted||b(!0)}),()=>I.abort()},[$,p,k]);const D=I=>{w(null),b(!1),g(I)},te=x?.directory===p,M=I=>{if(I.length>200){P(!0);return}P(!1),c(I)};return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"overflow-hidden rounded-lg border border-border/30 bg-surface-2",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 p-2",children:[t.jsx("button",{type:"button",disabled:i||!p,onClick:()=>D(p.slice(0,Math.max(0,p.lastIndexOf("/")))),"aria-label":f("rightSidebar.parentFolder"),className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-surface-elevated hover:text-foreground disabled:opacity-30",children:t.jsx(al,{size:14})}),t.jsx("button",{type:"button",disabled:i||!p,onClick:()=>D(""),"aria-label":f("rightSidebar.backToProjectRoot"),className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-surface-elevated hover:text-foreground disabled:opacity-30",children:t.jsx(Gi,{size:14})}),t.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs",title:$,children:p||"./"})]}),t.jsxs("div",{className:"h-56 overflow-y-auto overscroll-contain p-1",role:"group","aria-label":f("rightSidebar.gitIgnoreExceptionsPaths"),"aria-busy":!te&&!R,children:[R?t.jsxs("div",{className:"flex flex-col items-center gap-2 p-4 text-center text-xs",children:[t.jsx("p",{role:"alert",className:"text-destructive",children:f("rightSidebar.gitIgnoreExceptionsLoadFailed")}),t.jsx("button",{type:"button",disabled:i,onClick:()=>{b(!1),m(I=>I+1)},className:"rounded-md px-3 py-2 text-primary hover:bg-surface-elevated disabled:opacity-40",children:f("common.retry")})]}):te?x.entries.length===0?t.jsx("p",{className:"p-4 text-center text-xs text-muted-foreground",children:f("rightSidebar.gitIgnoreExceptionsEmptyDirectory")}):x.entries.map(I=>{const H=p?`${p}/${I.name}`:I.name,Y=H+(I.type==="directory"?"/":""),be=a.includes(Y)||a.includes(H),_=a.some(ae=>ae.endsWith("/")&&H.startsWith(ae)),o=I.type==="directory"?Gi:eh;return t.jsxs("div",{className:"flex items-center gap-1 rounded-md hover:bg-surface-elevated",children:[t.jsxs("label",{className:"flex min-h-10 min-w-0 flex-1 cursor-pointer items-center gap-2 px-2 text-xs",children:[t.jsx("input",{type:"checkbox",checked:be||_,disabled:i||_,onChange:()=>M(be?a.filter(ae=>ae!==Y&&ae!==H):[...a,Y]),className:"h-4 w-4 shrink-0 accent-[var(--primary)] disabled:opacity-40"}),t.jsx(o,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsx("span",{className:"truncate",title:I.name,children:I.name})]}),I.type==="directory"&&t.jsx("button",{type:"button",disabled:i,onClick:()=>D(H),"aria-label":f("rightSidebar.gitIgnoreExceptionsOpenDirectory",{name:I.name}),className:"inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-surface hover:text-foreground disabled:opacity-40",children:t.jsx(ds,{size:15})})]},I.name)}):t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(lt,{size:18})}),te&&x.truncated&&t.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:f("rightSidebar.gitIgnoreExceptionsTruncated")})]})]}),t.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs",children:[t.jsx("span",{className:"font-medium",children:f("rightSidebar.gitIgnoreExceptionsSelected",{count:a.length})}),t.jsx("button",{type:"button",disabled:i||a.length===0,onClick:()=>M([]),className:"rounded-md px-2 py-1 text-muted-foreground hover:bg-surface-2 hover:text-foreground disabled:opacity-40",children:f("rightSidebar.gitIgnoreExceptionsClear")})]}),a.length>0&&t.jsx("ul",{className:"max-h-24 overflow-y-auto overscroll-contain",children:a.map(I=>t.jsxs("li",{className:"flex items-center gap-2 rounded-md pl-2 text-xs hover:bg-surface-2",children:[t.jsx("span",{className:"min-w-0 flex-1 truncate font-mono",title:I,children:I}),t.jsx("button",{type:"button",disabled:i,onClick:()=>M(a.filter(H=>H!==I)),"aria-label":f("rightSidebar.gitIgnoreExceptionsRemove",{path:I}),className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-surface-elevated hover:text-foreground disabled:opacity-40",children:t.jsx(Xt,{size:13})})]},I))}),A&&t.jsx("p",{role:"alert",className:"text-xs text-destructive",children:f("rightSidebar.gitIgnoreExceptionsInvalid")})]})}function qp({rootPath:r,disabled:a,pressed:i,saving:c,onToggle:f}){const{t:p}=_t(),g=n.useId(),k=n.useRef(null),m=n.useRef(null),x=n.useRef(null),w=n.useRef(null),R=n.useRef(!1),[b,A]=n.useState(!1),[P,$]=n.useState([]),[D,te]=n.useState(!1),[M,I]=n.useState(null),H=U(W=>W.setGitIgnoreExceptions),Y=()=>{x.current!==null&&clearTimeout(x.current),x.current=null,w.current=null},be=()=>{Y(),!(a||D||!r)&&($([...U.getState().gitIgnoreExceptions[r]??[]]),I(null),A(!0))},_=()=>{D||A(!1)},o=W=>{Y(),R.current=!1,!(W.button!==0||!W.isPrimary||a)&&(W.currentTarget.setPointerCapture(W.pointerId),w.current={x:W.clientX,y:W.clientY},x.current=setTimeout(()=>{R.current=!0,be()},450))};n.useEffect(()=>(A(!1),Y(),Y),[r]),n.useEffect(()=>{if(b)return m.current?.focus(),()=>k.current?.focus()},[b]);const ae=p(i?"rightSidebar.showGitIgnoredFiles":"rightSidebar.hideGitIgnoredFiles");return t.jsxs(t.Fragment,{children:[t.jsx("button",{ref:k,type:"button",disabled:a||D,"aria-pressed":i,"aria-label":ae,"aria-description":p("rightSidebar.gitIgnoreConfigureHint"),title:`${ae} · ${p("rightSidebar.gitIgnoreConfigureHint")}`,onClick:W=>{if(R.current&&W.detail!==0){R.current=!1,W.preventDefault();return}f()},onContextMenu:W=>{W.preventDefault(),R.current=!0,b||be()},onPointerDown:o,onPointerMove:W=>{const he=w.current;he&&Math.hypot(W.clientX-he.x,W.clientY-he.y)>10&&Y()},onPointerUp:Y,onPointerCancel:Y,onLostPointerCapture:Y,className:`inline-flex h-7 w-7 shrink-0 select-none items-center justify-center rounded-md transition active:scale-95 disabled:cursor-not-allowed disabled:opacity-35 [-webkit-touch-callout:none] ${i?"bg-surface-2 text-primary hover:bg-surface-elevated":"text-muted-foreground hover:bg-surface-2 hover:text-foreground"}`,children:c?t.jsx(lt,{size:14}):t.jsx(Ip,{size:14})}),b&&Qr.createPortal(t.jsx("div",{className:"fixed inset-0 z-modal-backdrop flex items-center justify-center bg-[var(--app-backdrop)] p-3 backdrop-blur-sm",onClick:_,children:t.jsxs("form",{ref:m,role:"dialog",tabIndex:-1,"aria-modal":"true","aria-labelledby":`${g}-title`,"aria-describedby":`${g}-hint`,className:"relative z-modal-panel flex max-h-[80dvh] w-full max-w-lg flex-col gap-3 overflow-y-auto rounded-xl border border-border/20 bg-surface p-4 text-foreground shadow-2xl",onClick:W=>W.stopPropagation(),onKeyDown:W=>{if(W.key==="Escape"&&(W.preventDefault(),W.stopPropagation(),_()),W.key==="Tab"){const he=Array.from(m.current?.querySelectorAll("button:not(:disabled), input:not(:disabled)")??[]);if(!he.length){W.preventDefault(),m.current?.focus();return}const G=he[0],le=he[he.length-1];W.shiftKey&&document.activeElement===G&&(W.preventDefault(),le?.focus()),document.activeElement===m.current?(W.preventDefault(),(W.shiftKey?le:G)?.focus()):!W.shiftKey&&document.activeElement===le&&(W.preventDefault(),G?.focus())}},onSubmit:W=>{if(W.preventDefault(),!(!r||D)){if(P.length>200){I(p("rightSidebar.gitIgnoreExceptionsInvalid"));return}te(!0),I(null),H(r,P).then(()=>A(!1)).catch(()=>I(p("rightSidebar.gitIgnoreExceptionsSaveFailed"))).finally(()=>te(!1))}},children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx("h2",{id:`${g}-title`,className:"text-sm font-medium",children:p("rightSidebar.gitIgnoreExceptionsTitle")}),t.jsx("button",{type:"button",disabled:D,onClick:_,"aria-label":p("common.close"),className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-surface-2 hover:text-foreground disabled:opacity-40",children:t.jsx(Xt,{size:16})})]}),t.jsx("p",{className:"truncate text-xs text-muted-foreground",title:r??void 0,children:r}),t.jsx("p",{id:`${g}-hint`,className:"text-xs leading-relaxed text-muted-foreground",children:p("rightSidebar.gitIgnoreExceptionsHint")}),t.jsx("p",{className:"text-xs font-medium",children:p("rightSidebar.gitIgnoreExceptionsPaths")}),r&&t.jsx(Wp,{rootPath:r,paths:P,onChange:$,disabled:D}),M&&t.jsx("p",{role:"alert",className:"text-xs text-destructive",children:M}),t.jsxs("div",{className:"flex justify-end gap-2",children:[t.jsx("button",{type:"button",disabled:D,onClick:_,className:"rounded-lg px-3 py-2 text-xs text-muted-foreground hover:bg-surface-2 disabled:opacity-40",children:p("common.cancel")}),t.jsxs("button",{type:"submit",disabled:D,className:"inline-flex items-center gap-2 rounded-lg bg-primary px-3 py-2 text-xs font-medium text-primary-foreground disabled:opacity-50",children:[D&&t.jsx(lt,{size:13}),p("common.save")]})]})]})}),document.body)]})}function Kp(r,a,i){try{const c=r instanceof HTMLImageElement?r.naturalWidth:r.width,f=r instanceof HTMLImageElement?r.naturalHeight:r.height;if(!c||!f)return Promise.resolve(null);const p=r instanceof HTMLImageElement?1400/Math.max(c,f):Math.min(1,1400/Math.max(c,f)),g=document.createElement("canvas");g.width=Math.max(1,Math.round(c*p)),g.height=Math.max(1,Math.round(f*p));const k=g.getContext("2d");if(!k)return Promise.resolve(null);const m=getComputedStyle(document.documentElement);if(k.fillStyle=m.getPropertyValue("--surface").trim()||"white",k.fillRect(0,0,g.width,g.height),k.drawImage(r,0,0,g.width,g.height),i){const x=Math.max(10,Math.min(16,g.width/35));k.font=`${x}px sans-serif`;const w=[];let R="";for(const b of i.split(" "))R&&k.measureText(`${R} ${b}`).width>g.width-20?(w.push(R),R=b):R=R?`${R} ${b}`:b;R&&w.push(R),k.fillStyle=m.getPropertyValue("--surface").trim()||"white",k.fillRect(0,0,g.width,w.length*(x+4)+12),k.fillStyle=m.getPropertyValue("--foreground").trim()||"black",w.forEach((b,A)=>k.fillText(b,10,8+x+A*(x+4)))}if(a){const x=a.xPercent*g.width/100,w=a.yPercent*g.height/100,R=Math.max(4,Math.min(12,Math.min(g.width,g.height)*.015)),b=R*1.6;k.strokeStyle=m.getPropertyValue("--primary").trim()||"black",k.lineWidth=Math.max(1,R/3),k.beginPath(),k.arc(x,w,R,0,Math.PI*2),k.stroke(),k.beginPath(),k.moveTo(x-b,w),k.lineTo(x+b,w),k.moveTo(x,w-b),k.lineTo(x,w+b),k.stroke()}return new Promise(x=>g.toBlob(x,"image/png"))}catch{return Promise.resolve(null)}}function Vp(r,a,i,c){return[r.trim(),a.trim(),c?`截图:${c}`:""].filter(Boolean).join(`
3
3
  `)}function Ab(r,a,i){const c=a*Math.PI/360,f=Math.min(c,Math.atan(Math.tan(c)*Math.max(i,.05)));return Math.max(r,1e-6)/Math.sin(f)*1.15}async function Yp(r,a,i,c){if(!i?.snapshot)return c.isCurrent()?await c.insert(r,a):!1;const f=new Date().toISOString(),p=new AbortController;let g,k;try{k=await Promise.race([(async()=>{const m=await i.snapshot;if(!(!m||p.signal.aborted||!c.isCurrent()))return c.upload(new File([m],`termdock-review-${crypto.randomUUID()}.png`,{type:"image/png"}),p.signal)})(),new Promise(m=>{g=setTimeout(()=>{p.abort(),m(void 0)},3e3)})])}catch{}finally{clearTimeout(g),p.abort()}return c.isCurrent()?await c.insert(k?Vp(r,"",f,k):r,a):!1}function Xp(r,a){return r===a||a.endsWith(`/${r}`)||r.endsWith(`/${a}`)}function Rd(r,a){return`${r??""}\0${a}`}function Jp(r,a,i){if(!r||r.length===0||!i)return{explained:0,stale:0};const c=Rd(a,i);let f=0,p=0;for(const g of r){const k=[g.filePath,g.newPath,g.oldPath].filter(x=>typeof x=="string"&&x.length>0);(k.some(x=>Rd(g.repoRoot,x)===c)||k.some(x=>Xp(x,i)))&&(f+=1)}return{explained:f,stale:p}}function Qp({status:r}){if(!r)return null;const a=r.stale>0&&r.explained===0;if(!(r.explained>0||r.stale>0))return null;const c=a?"AI audit explanation is stale":"AI audit explanation available";return t.jsx("span",{className:`inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full ${a?"bg-[color:var(--warning)]/15 text-[color:var(--warning)]":"bg-accent/10 text-accent"}`,title:c,"aria-label":c,children:a?t.jsx(fp,{size:10}):t.jsx(aa,{size:10})})}function Xi({changeStatus:r,auditStatus:a,renderChangeBadge:i}){return t.jsxs("span",{className:"inline-flex items-center gap-1",children:[i(r),t.jsx(Qp,{status:a})]})}const cu="termdock:right-sidebar:diff-change-list-mode:v1";function Zp(r){return r==="list"||r==="tree"}function em(){return ct(cu,Zp)??"tree"}function tm(r){for(const a of r){const i=a.hunk;if(i.oldPath&&i.newPath&&i.oldPath!==i.newPath)return"renamed";if(i.oldPath===null&&i.newPath)return"added";if(i.oldPath&&i.newPath===null)return"deleted"}return"modified"}function rm(r){const a=new Map;for(const c of r){const f=a.get(c.hunk.filePath)??{key:c.hunk.filePath,filePath:c.hunk.filePath,items:[],additions:0,deletions:0,explained:0,stale:0,changeType:"modified"};f.items.push(c),f.additions+=c.hunk.additions,f.deletions+=c.hunk.deletions,c.current&&(f.explained+=1),c.stale&&(f.stale+=1),a.set(c.hunk.filePath,f)}const i=Array.from(a.values()).sort((c,f)=>c.filePath.localeCompare(f.filePath));for(const c of i)c.changeType=tm(c.items);return i}function nm(r){const a=r.filePath.split("/").pop()??r.filePath;return{key:r.key,path:r.filePath,displayName:a,displayDir:r.filePath.includes("/")?r.filePath.slice(0,-a.length-1):"",status:r.changeType,title:r.filePath}}function sm(r,a){const i=r.filter(p=>p.trim().length>0);if(i.length<=1)return i[0]??"";const c=[],f=new Set;for(const[p,g]of i.entries()){const k=g.split(`
4
4
  `),m=k.findIndex(R=>R.startsWith("@@ "));if(m<0){c.push(...k);continue}p===0&&c.push(...k.slice(0,m));const x=a[p];let w=m;for(;w>=0&&w<k.length;){const R=k.findIndex((te,M)=>M>w&&te.startsWith("@@ ")),b=R>=0?R:k.length,A=k.slice(w,b),P=A[0]??"",$=x?P===x:!0,D=P||x||A.join(`
5
5
  `);$&&!f.has(D)&&(c.push(...A),f.add(D)),w=R}}return c.join(`
@@ -1635,7 +1635,7 @@ function installPreviewRuntime(capability, base, externalOrigins, shimUrl) {
1635
1635
  `,ao="/api/terminal/fs/preview/",Ym=8*1024*1024,Xm=32*1024*1024,Jm=128,Qm="data:,";function Nt(r){throw new Error(r)}function Zm(r){return JSON.stringify(r).replace(/</g,"\\u003c")}async function Ad(r,a,i){let c="",f=0;for(const p of r.matchAll(a))c+=r.slice(f,p.index)+await i(p),f=p.index+p[0].length;return c+r.slice(f)}async function pu(r,a){const i=a.origin??location.origin,c=new URL(r,i);(c.origin!==i||!Ws(c.pathname)?.startsWith(ao))&&Nt("预览地址不是有效的本地文件入口");const f=crypto.randomUUID(),p=`https://termdock-preview.invalid/${f}/`,g=[],k=F=>{!g.includes(F)&&g.length<20&&g.push(F)},m=new Set,x=[],w=new Set,R=new Map,b=new Map;let A=0,P=!1;const $=new Set,D=()=>{P=!0;for(const F of[...$])F();m.clear(),x.length=0};async function te(F){F.ok||Nt(`预览资源读取失败(${F.status})`);const ee=F.body?.getReader(),C=[];let L=0;try{if(ee)for(;;){const pe=await ee.read();if(pe.done)break;L+=pe.value.byteLength,A+=pe.value.byteLength,(L>Ym||A>Xm)&&Nt("预览资源超出大小限制"),C.push(pe.value)}}catch(pe){throw await ee?.cancel().catch(()=>{}),pe}finally{ee?.releaseLock()}const q=new Uint8Array(L);let ne=0;for(const pe of C)q.set(pe,ne),ne+=pe.length;return{bytes:q,type:F.headers.get("content-type")??"application/octet-stream",status:F.status}}let M=c,I;for(let F=0;F<4;F++){const ee=await a.fetch(M.pathname+M.search,{signal:a.signal,redirect:"manual"});if(![301,302,303,307,308].includes(ee.status)){I=ee;break}const C=ee.headers.get("location");await ee.body?.cancel(),C||Nt("预览重定向缺少目标");const L=new URL(C,M);(L.origin!==i||!Ws(L.pathname)?.startsWith(ao))&&Nt("预览重定向越出文件范围"),M=L}I||Nt("预览重定向次数过多");const H=Ws(M.pathname),Y=H.slice(ao.length).split("/");/^[a-f0-9]{32}$/.test(Y[0])||Nt("服务未提供有效的预览资源授权");const be=Ws(c.pathname).slice(ao.length).split("/");/^[a-f0-9]{32}$/.test(be[0])&&be.shift(),be.join("/").replace(/\/$/,"")!==Y.slice(1).join("/").replace(/\/$/,"")&&Nt("预览重定向改变了文件范围");const _=H.endsWith("/")?H:H.slice(0,H.lastIndexOf("/")+1),o=new URL(M.pathname.endsWith("/")?M.pathname:M.pathname.slice(0,M.pathname.lastIndexOf("/")+1),i);function ae(F,ee){const C=new URL(F,ee);return C.origin!==i?null:(Ws(C.pathname)?.startsWith(_)||Nt("已阻止预览访问目录之外的资源"),C)}function W(F){const ee=new URL(F,p);(ee.origin!==new URL(p).origin||!ee.pathname.startsWith(new URL(p).pathname))&&Nt("已阻止预览访问服务接口或目录之外的资源");const C=ee.pathname.slice(new URL(p).pathname.length)+ee.search;return ae(C,o)??Nt("预览资源无效")}function he(F){const ee=F.pathname+F.search,C=R.get(ee);if(C)return C;if(P||a.signal?.aborted)return Promise.reject(new Error("预览已关闭"));if(R.size>=Jm)return Promise.reject(new Error("预览资源数量超出限制"));const L=a.fetch(ee,{signal:a.signal,redirect:"manual"}).then(te);return R.set(ee,L),L}function G(F,ee){P&&Nt("预览已关闭");const C=`termdock-resource-${f}-${x.length}`;return x.push({token:C,data:F,type:ee}),m.add(C),C}async function le(F,ee,C,L=new Set){if(!F||F.startsWith("#")||/^data:(?:image|font)\//i.test(F)&&C==="resource")return F;try{const q=ae(F,ee);if(!q){const Pe=new URL(F,ee);return(Pe.protocol!=="https:"||Pe.username||Pe.password||Pe.origin===new URL(p).origin)&&Nt("已阻止不安全的外部资源"),w.add(Pe.origin),Pe.href}const ne=`${C}:${q.href}`;(L.has(ne)||L.size>=8)&&Nt("预览资源存在循环或过深引用");const pe=b.get(ne);if(pe)return pe;const Ne=new Set(L);Ne.add(ne);const we=(async()=>{const Pe=await he(q);return C==="css"?G(await j(new TextDecoder().decode(Pe.bytes),q,Ne),"text/css"):C==="script"?G(Pe.bytes,"text/javascript"):G(Pe.bytes,Pe.type)})();return b.set(ne,we),await we}catch(q){return k(q instanceof Error?q.message:"部分预览资源未能加载"),Qm}}async function j(F,ee,C){return F=await Ad(F,/@import\s+(?:url\(\s*)?["']([^"']+)["']\s*\)?([^;]*);/gi,async L=>`@import url("${await le(L[1],ee,"css",C)}")${L[2]};`),Ad(F,/url\(\s*(?:"([^"]*)"|'([^']*)'|([^)]*))\s*\)/gi,async L=>{const q=(L[1]??L[2]??L[3]).trim();return m.has(q)?L[0]:`url("${await le(q,ee,"resource",C)}")`})}try{const F=await te(I),ee=G(Km,"text/javascript"),C=new DOMParser().parseFromString(new TextDecoder().decode(F.bytes),"text/html");C.querySelectorAll("base,meta[http-equiv],iframe,frame,object,embed").forEach(O=>O.remove());for(const O of C.querySelectorAll("*")){if(O.removeAttribute("ping"),O.removeAttribute("srcdoc"),O.hasAttribute("style")&&O.setAttribute("style",await j(O.getAttribute("style"),M,new Set)),O.tagName==="STYLE"&&(O.textContent=await j(O.textContent??"",M,new Set)),O.tagName==="A"||O.tagName==="AREA"){const ue=O.getAttribute("href");try{if(ue&&!ue.startsWith("#")){const oe=ae(ue,M);if(oe)O.setAttribute("href",new URL(oe.pathname.slice(o.pathname.length)+oe.search+oe.hash,p).href);else{const Fe=new URL(ue,M);if(Fe.protocol!=="https:"){O.removeAttribute("href");continue}w.add(Fe.origin),O.setAttribute("href",Fe.href)}}}catch(oe){O.removeAttribute("href"),k(oe instanceof Error?oe.message:"预览链接无法加载")}}for(const ue of["data","manifest"])O.removeAttribute(ue);if(O.tagName==="SCRIPT"&&O.getAttribute("type")==="module"){O.setAttribute("type","module-shim");const ue=O.getAttribute("src");if(ue){const oe=ae(ue,M);if(oe)O.setAttribute("src",new URL(oe.pathname.slice(o.pathname.length)+oe.search,p).href);else{const Fe=new URL(ue,M);if(Fe.protocol!=="https:"){O.remove();continue}w.add(Fe.origin),O.setAttribute("src",Fe.href)}}continue}if(O.tagName==="SCRIPT"&&O.getAttribute("type")==="importmap"){O.setAttribute("type","importmap-shim");continue}if(O.tagName==="LINK"){const ue=(O.getAttribute("rel")??"").toLowerCase();if(!["stylesheet","icon"].includes(ue)){O.remove();continue}const oe=O.getAttribute("href");oe&&O.setAttribute("href",await le(oe,M,ue==="stylesheet"?"css":"resource"))}if(O.hasAttribute("src")&&O.setAttribute("src",await le(O.getAttribute("src"),M,O.tagName==="SCRIPT"?"script":"resource")),O.hasAttribute("poster")&&O.setAttribute("poster",await le(O.getAttribute("poster"),M,"resource")),O.hasAttribute("srcset")){const ue=O.getAttribute("srcset");/data:/i.test(ue)?(O.removeAttribute("srcset"),k("混合内嵌图片候选暂不支持安全预览")):O.setAttribute("srcset",(await Promise.all(ue.split(",").map(async oe=>{const[Fe,...Ie]=oe.trim().split(/\s+/);return`${await le(Fe,M,"resource")} ${Ie.join(" ")}`}))).join(", "))}O.setAttribute("referrerpolicy","no-referrer"),O.removeAttribute("integrity"),O.removeAttribute("crossorigin")}const L=[...w].join(" "),q=C.createElement("meta");q.httpEquiv="Content-Security-Policy",q.content=`default-src 'none'; script-src 'unsafe-inline' 'wasm-unsafe-eval' blob: ${L}; style-src 'unsafe-inline' blob: ${L}; img-src blob: data: ${L}; font-src blob: data: ${L}; media-src blob: data: ${L}; connect-src blob: ${L} ${[...w].map(O=>O.replace(/^https:/,"wss:")).join(" ")}; worker-src blob:; frame-src 'none'; object-src 'none'; base-uri https://termdock-preview.invalid; form-action 'none'`;const ne=C.createElement("base");ne.href=p;const pe=C.createElement("meta");pe.name="referrer",pe.content="no-referrer";const Ne=C.createElement("script");Ne.textContent=Vm+`
1636
1636
  installPreviewRuntime(`+[f,p,[...w],ee].map(Zm).join(",")+");";const we=C.createElement("script");we.src=ee,C.head.prepend(q,pe,ne,Ne,we);const Pe=`<!doctype html>
1637
1637
  `+C.documentElement.outerHTML;return{html:Pe,shellUrl:`/preview-shell.html#${f}`,errors:g,attach(O,ue){const oe=new Set,Fe=E=>{if(E.source!==O.contentWindow||E.data?.capability!==f)return;if(E.data.type==="preview-ready"){O.contentWindow?.postMessage({type:"preview-init",capability:f,html:Pe,resources:x},"*");return}if(E.data.type==="preview-error"){ue("部分动态内容被安全预览限制");return}if(E.data.type==="preview-navigate"){(async()=>{const ge=W(String(E.data.url)),De=await pu(ge.pathname+ge.search,a);if(P){De.dispose();return}const Ve=De.attach(O,ue);$.add(()=>{Ve(),De.dispose()}),O.src=De.shellUrl.replace("#","?navigation="+crypto.randomUUID()+"#")})().catch(ge=>ue(ge instanceof Error?ge.message:"无法打开预览页面"));return}if(E.data.type==="preview-external"){try{const ge=new URL(String(E.data.url));ge.protocol==="https:"&&w.has(ge.origin)&&window.open(ge.href,"_blank","noopener,noreferrer")}catch{}return}if(E.data.type!=="preview-fetch"||E.ports.length!==1)return;const xe=E.ports[0];if(oe.size>=8||!["GET","HEAD"].includes(E.data.method)){xe.postMessage({error:"预览仅允许读取已授权目录资源"}),xe.close();return}oe.add(xe),(async()=>{const ge=W(String(E.data.url)),De=await he(ge);if(!oe.has(xe)||P)return;const Ve=E.data.method==="HEAD"?new Uint8Array:De.bytes.slice();xe.postMessage({status:De.status,headers:{"content-type":De.type},data:Ve.buffer},[Ve.buffer])})().catch(()=>{xe.postMessage({error:"预览资源不在授权范围或无法加载"}),ue("部分动态资源不可用或超出预览目录")}).finally(()=>{oe.delete(xe),xe.close()})};window.addEventListener("message",Fe);const Ie=()=>{window.removeEventListener("message",Fe);for(const E of oe)E.close();oe.clear(),$.delete(Ie)};return $.add(Ie),Ie},dispose:D}}catch(F){throw D(),F}}const eg=n.forwardRef(function({src:a,title:i,exitFullscreenLabel:c,onFullscreenChange:f},p){const g=n.useRef(null),[k,m]=n.useState(null),[x,w]=n.useState(),[R,b]=n.useState("");n.useEffect(()=>{const H=new AbortController;let Y;return w(void 0),b(""),(async()=>{const be=await ah();if(Y=await pu(a,{fetch:(_,o)=>be.fetch(_,o),signal:H.signal}),H.signal.aborted){Y.dispose();return}w(Y),Y.errors.length&&b(Y.errors.join(";"))})().catch(be=>{H.signal.aborted||b(be instanceof Error?be.message:"安全预览加载失败")}),()=>{H.abort(),Y?.dispose()}},[a]),n.useEffect(()=>{if(!(!x||!k))return x.attach(k,b)},[x,k]);const[A,P]=n.useState(!1),[$,D]=n.useState(!1),te=A||$;n.useEffect(()=>{f?.(te)},[te,f]),n.useEffect(()=>{const H=()=>{P(document.fullscreenElement===g.current)};return document.addEventListener("fullscreenchange",H),()=>document.removeEventListener("fullscreenchange",H)},[]),n.useEffect(()=>{if(!$)return;const H=Y=>{Y.key==="Escape"&&D(!1)};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[$]);const M=n.useCallback(async()=>{const H=g.current;if(H){if($){D(!1);return}if(document.fullscreenElement===H){await document.exitFullscreen();return}if(H.requestFullscreen&&document.fullscreenEnabled!==!1)try{await H.requestFullscreen();return}catch{}D(!0)}},[$]);n.useImperativeHandle(p,()=>({toggleFullscreen:M}),[M]);const I=t.jsxs("div",{ref:g,"data-html-preview-frame":!0,className:te?"fixed inset-0 z-modal-panel flex min-h-0 flex-col overflow-hidden bg-surface pt-[env(safe-area-inset-top,0px)] text-foreground":"flex h-full min-h-0 flex-col overflow-hidden bg-surface",children:[te&&t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between gap-3 border-b border-border/15 bg-[var(--chrome-bg)] px-3",children:[t.jsx("span",{className:"min-w-0 truncate text-[12px] font-semibold",children:i}),t.jsx("button",{type:"button",onClick:()=>{M()},"aria-label":c,title:`${c} (Esc)`,className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-surface-2 text-muted-foreground transition hover:bg-surface-elevated hover:text-foreground active:scale-95",children:t.jsx(au,{size:15})})]}),R&&t.jsx("div",{role:"status",className:"shrink-0 border-b border-border px-3 py-2 text-xs text-muted-foreground",children:R}),!x&&!R&&t.jsx("div",{role:"status",className:"p-3 text-xs text-muted-foreground",children:"正在安全加载预览资源…"}),t.jsx("iframe",{ref:m,src:x?.shellUrl,referrerPolicy:"no-referrer",title:i,sandbox:"allow-scripts",className:"block min-h-0 w-full flex-1 border-0 bg-white"})]});return $?Qr.createPortal(I,document.body):I}),mu="termdock-file-search-match",Zi="termdock-file-search-current";function tg(r,a,i){return!!(a&&r?.isConnected&&!i.defaultPrevented&&!r.closest('[inert], [aria-hidden="true"], [hidden]')&&i.target instanceof Node&&r.contains(i.target))}function rg(r){const a=r.metaKey||r.ctrlKey,i=r.key.toLocaleLowerCase();return a&&i==="f"?"open":a&&i==="g"||r.key==="F3"?r.shiftKey?"previous":"next":r.key==="Escape"?"close":null}function ng(r){return r.parentElement?.closest("[data-markdown-preview-block-start], [data-file-preview-line]")??null}function sg(r,a){const i=a.trim().toLocaleLowerCase();if(!i)return[];const c=[];let f="",p=null;const g=document.createTreeWalker(r,NodeFilter.SHOW_TEXT);for(let w=g.nextNode();w;w=g.nextNode()){if(!(w instanceof Text)||!w.data)continue;const R=ng(w);if(!R)continue;p&&p!==R&&(f+=`
1638
- `);const b=f.length;f+=w.data,c.push({node:w,start:b,end:f.length,group:R}),p=R}const k=f.toLocaleLowerCase(),m=[];let x=0;for(;x<=k.length-i.length;){const w=k.indexOf(i,x);if(w<0)break;const R=w+i.length,b=c.find(P=>P.start<=w&&P.end>w),A=c.find(P=>P.start<R&&P.end>=R);if(b&&A&&b.group===A.group){const P=document.createRange();P.setStart(b.node,w-b.start),P.setEnd(A.node,R-A.start),m.push(P)}x=w+Math.max(i.length,1)}return m}function gu(){return typeof CSS<"u"&&CSS.highlights?CSS.highlights:null}let xo;function Td(r){return xo===r}function oo(r){if(r&&xo!==r)return;const a=gu();a?.delete(mu),a?.delete(Zi),xo=void 0}function Ii(r,a,i){const c=gu();if(!c||typeof Highlight>"u")return;xo=i,c.set(mu,new Highlight(...r));const f=r[a];f?c.set(Zi,new Highlight(f)):c.delete(Zi)}function Md(r){r?.startContainer.parentElement?.scrollIntoView({block:"center",inline:"nearest",behavior:"smooth"})}function ag(r){return Array.from(new Set(r.split(/[\n,]/).map(a=>a.trim().replace(/^!+/,"")).filter(Boolean))).slice(0,24)}function og(r,a){const i=a.trim();return!i||i==="."?r:/^(?:[/\\]|[A-Za-z]:[/\\])/.test(i)?i.replace(/[\\/]+$/,""):`${r.replace(/[\\/]+$/,"")}/${i.replace(/^\.?[\\/]+/,"").replace(/[\\/]+$/,"")}`}function ig(r,a){if(a===r)return".";const i=`${r.replace(/[\\/]+$/,"")}/`;return a.startsWith(i)?a.slice(i.length):a}function bu(r,a,i){return a?r:Qr.createPortal(r,i)}const ol="termdock:right-sidebar:file-tree-scroll:v1",il="termdock:right-sidebar:file-preview-reading-state:v1",ea="termdock:right-sidebar:file-tree-width:v1",xu="termdock:right-sidebar:markdown-view-mode:v1",vu="termdock:right-sidebar:diff-change-list-mode:v1",yu="termdock:right-sidebar:diff-wrap:v1",wu="termdock:diff-viewer:view-type:v1",ku="termdock:right-sidebar:file-search-mode:v1",$i="termdock:right-sidebar:collapsed-git-repo-groups:v1",Ld="termdock:right-sidebar:collapsed-diff-directories:v1",Fi="termdock:right-sidebar:branch-audit-module-open:v1",Su="termdock:right-sidebar:branch-audit-module:v1",lg=150,Id="termdock:right-sidebar:context-draft-enabled:v1",$d="termdock:right-sidebar:context-draft-collapsed:v1",Fd="termdock:right-sidebar:context-draft-auto-collapse:v1",Di="termdock:right-sidebar:context-draft-text:v1",cg=300,dg=20,ug=120,fg=250,hg=250,pg=120,mg=700,_i=600,gg=6e4;function Vs(r){return!!(r&&U.getState().nestedGitScanRoots[r])}const Dd=[2e3,5e3,15e3,3e4],bg=320,xg=500,vg=20,yg=12e3,el=300,_d=240,wg=560,Bd=n.lazy(()=>sl(()=>import("./ModelPreview-Du_AyPr9.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]))),kg=n.lazy(()=>sl(()=>import("./ArchitecturePanel-m9GKl3cl.js"),__vite__mapDeps([32,1,2,3,4,5,33,11,12,13,14,23,20,24,25,34,17,18,19,8,9,10,15,22,6,21,26,27,28,29,30,31,35])).then(r=>({default:r.ArchitecturePanel}))),Sg=n.lazy(()=>sl(()=>import("./ComputerControlView-CSs54lf0.js").then(r=>r.a),__vite__mapDeps([36,1,2,3,4,5,28,30,15,37,29,38])));function Ru(r,a,i){return r&&!a?"unified":i}const Rg=new Set([".md",".markdown",".mdown",".mkdn",".mkd"]);function jg(r){return r==="preview"||r==="source"}function Cg(r){return r==="list"||r==="tree"||r==="ai"}function Ud(){return ct(xu,jg)??"preview"}function Ng(){return ct(vu,Cg)??"tree"}function ta(r){return typeof r=="boolean"}function Pg(r){return typeof r=="string"}function Eg(){return ct(yu,ta)??!0}function Ag(r){return r==="unified"||r==="split"}function Tg(){return ct(wu,Ag)??"unified"}function Mg(r){return r==="name"||r==="content"||r==="regex"}function Lg(){return ct(ku,Mg)??"name"}function ju(r){return r.repositories??(r.context?.root?[{id:r.context.root,root:r.context.root,relativeRoot:".",name:gt(r.context.root)||r.context.root,depth:0,nested:!1,available:r.available,files:r.files,context:r.context,error:r.error}]:[])}function Ig(r,a){if(!a)return null;const i=new Set((r.repoFilters??[]).map(c=>c.root));return i.has(a)?a:i.size>0?null:(r.repositories??[]).some(c=>c.root===a)?a:null}function tl(r){return!r.activeGitRepoRoot&&(r.groupCount>1||r.label!==r.rootName)}function Cu(...r){const a=new Set;for(const i of r)for(const c of i)a.add(c.root);return a}function rl(r){return Array.isArray(r)&&r.every(a=>typeof a=="string")}function Od(r){const a=ct(r,rl);return a?new Set(a):new Set}function Bi(r,a){Pt(r,[...a])}function $g(r){if(!r||typeof r!="object"||Array.isArray(r))return!1;const a=r;return typeof a.filePath=="string"&&typeof a.hunkHeader=="string"&&typeof a.hunkIndex=="number"&&typeof a.fingerprint=="string"&&typeof a.additions=="number"&&typeof a.deletions=="number"&&typeof a.diff=="string"&&(a.oldPath===void 0||a.oldPath===null||typeof a.oldPath=="string")&&(a.newPath===void 0||a.newPath===null||typeof a.newPath=="string")&&(a.source===void 0||a.source==="committed"||a.source==="uncommitted"||a.source==="unknown")&&(a.commit===void 0||a.commit===null||typeof a.commit=="string")}function Fg(r){if(!r||typeof r!="object"||Array.isArray(r))return!1;const a=r;return typeof a.available=="boolean"&&(a.repoRoot===void 0||typeof a.repoRoot=="string")&&(a.workspaceRoot===void 0||typeof a.workspaceRoot=="string")&&(a.baseRef===void 0||typeof a.baseRef=="string")&&(a.baseBranch===void 0||typeof a.baseBranch=="string")&&(a.currentBranch===void 0||a.currentBranch===null||typeof a.currentBranch=="string")&&(a.headRef===void 0||a.headRef===null||typeof a.headRef=="string")&&(a.diffFingerprint===void 0||typeof a.diffFingerprint=="string")&&(a.stat===void 0||typeof a.stat=="string")&&(a.files===void 0||rl(a.files))&&(a.hunks===void 0||Array.isArray(a.hunks)&&a.hunks.every($g))&&(a.commits===void 0||rl(a.commits))&&(a.commitCount===void 0||typeof a.commitCount=="number")&&(a.diff===void 0||typeof a.diff=="string")&&(a.truncated===void 0||typeof a.truncated=="boolean")&&(a.error===void 0||typeof a.error=="string")}function Dg(r){if(!r||typeof r!="object"||Array.isArray(r))return!1;const a=r;return typeof a.key=="string"&&Fg(a.diff)&&typeof a.repoLabel=="string"&&typeof a.createdAt=="number"}function _g(r){return!r||typeof r!="object"||Array.isArray(r)?!1:Object.values(r).every(a=>{if(!a||typeof a!="object"||Array.isArray(a))return!1;const i=a;return Array.isArray(i.selectedRepoRoots)&&i.selectedRepoRoots.every(c=>typeof c=="string")&&!!i.repoTargetBranches&&typeof i.repoTargetBranches=="object"&&!Array.isArray(i.repoTargetBranches)&&Object.values(i.repoTargetBranches).every(c=>typeof c=="string")&&(i.repoBaseBranches===void 0||!!i.repoBaseBranches&&typeof i.repoBaseBranches=="object"&&!Array.isArray(i.repoBaseBranches)&&Object.values(i.repoBaseBranches).every(c=>typeof c=="string"))&&(i.previewEntries===void 0||Array.isArray(i.previewEntries)&&i.previewEntries.every(Dg))&&(i.selectedPreviewKey===void 0||i.selectedPreviewKey===null||typeof i.selectedPreviewKey=="string")&&(i.selectedPreviewFileKey===void 0||i.selectedPreviewFileKey===null||typeof i.selectedPreviewFileKey=="string")&&(i.previewDetailOpen===void 0||typeof i.previewDetailOpen=="boolean")&&(i.previewScrollTops===void 0||!!i.previewScrollTops&&typeof i.previewScrollTops=="object"&&!Array.isArray(i.previewScrollTops)&&Object.values(i.previewScrollTops).every(c=>typeof c=="number"))&&(i.previewMobileSlideIndex===void 0||typeof i.previewMobileSlideIndex=="number")&&(i.repoIncludeUncommitted===void 0||!!i.repoIncludeUncommitted&&typeof i.repoIncludeUncommitted=="object"&&!Array.isArray(i.repoIncludeUncommitted)&&Object.values(i.repoIncludeUncommitted).every(c=>typeof c=="boolean"))&&(i.includeUncommitted===void 0||typeof i.includeUncommitted=="boolean")&&typeof i.updatedAt=="number"})}function Hd(){return ct(Su,_g)??{}}function zd(r){return[r.repoRoot,r.baseRef,r.branchName??"",r.headRef??"",r.diffFingerprint??""].join("\0")}function Gd(r){const a=r?.trim()??"",i=a.indexOf("/");return i>=0?a.slice(i+1):a}function Nu(r,a){const i=r?.trim(),c=a?.trim();return!i||!c?!1:i===c||Gd(i)===Gd(c)}function Wd(r){const a=r?.branch??null;return[r?.upstream,...r?.remoteBranches??[],...r?.branches??[]].find(c=>c&&!Nu(c,a))??""}function nl(r,a){const i=Math.max(_d,a-320),c=Math.min(wg,i);return Math.min(c,Math.max(_d,r))}function Bg(r){return typeof r=="number"&&Number.isFinite(r)}function Ug(r){return nl(ct(ea,Bg)??el,r)}function Pu(r){const a=r.split(/[\\/]/).pop()??r,i=a.lastIndexOf(".");return i>=0?a.slice(i).toLowerCase():""}function Ys(r){return Rg.has(Pu(r))}function cs({label:r,value:a,options:i,placeholder:c,searchPlaceholder:f,emptyText:p,disabled:g,onChange:k}){const{t:m}=_t(),[x,w]=n.useState(!1),[R,b]=n.useState(""),[A,P]=n.useState(null),$=n.useRef(null),D=n.useRef(null),te=R.trim().toLowerCase(),M=n.useMemo(()=>te?i.filter(_=>`${_.label} ${_.meta??""}`.toLowerCase().includes(te)):i,[te,i]),I=i.find(_=>_.value===a),H=()=>{const _=R.trim();_&&(k(_),w(!1),b(""))},Y=n.useCallback(()=>{const _=$.current?.getBoundingClientRect();if(!_)return!1;const o=12,ae=Math.max(220,Math.min(_.width,window.innerWidth-o*2)),W=Math.min(Math.max(o,_.left),window.innerWidth-ae-o),he=window.innerHeight-_.bottom-o,G=_.top-o,le=he>=180||he>=G,j=Math.max(96,(le?he:G)-4),F=Math.min(320,j);return P({left:W,top:le?_.bottom+4:Math.max(o,_.top-F-4),width:ae,maxHeight:F}),!0},[]),be=()=>{Y(),w(!0)};return n.useEffect(()=>{if(!x)return;let _=0;const o=()=>{_||(_=window.requestAnimationFrame(()=>{_=0,Y()}))},ae=W=>{const he=W.target;he instanceof Node&&($.current?.contains(he)||D.current?.contains(he)||(w(!1),b("")))};return window.addEventListener("resize",o),window.addEventListener("scroll",o,!0),document.addEventListener("pointerdown",ae,!0),()=>{_&&window.cancelAnimationFrame(_),window.removeEventListener("resize",o),window.removeEventListener("scroll",o,!0),document.removeEventListener("pointerdown",ae,!0)}},[x,Y]),t.jsxs("div",{className:"relative min-w-0",children:[t.jsxs("button",{ref:$,type:"button",disabled:g,onClick:()=>{if(!g){if(b(""),x){w(!1);return}be()}},className:"group flex w-full items-center justify-between gap-2 min-h-10 rounded-md border border-transparent bg-surface-2 px-3 py-2 text-left transition hover:bg-surface-elevated focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",children:[t.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-3",children:[t.jsx("span",{className:"shrink-0 text-[11px] text-muted-foreground",children:r}),t.jsx("span",{className:`min-w-0 flex-1 truncate text-[13px] ${a?"text-foreground":"text-muted-foreground/70"}`,children:I?.label??(a||c)})]}),t.jsx(sa,{size:13,className:`shrink-0 text-muted-foreground transition group-hover:text-foreground ${x?"rotate-180":""}`})]}),x&&!g&&typeof document<"u"&&Qr.createPortal(t.jsxs("div",{ref:D,className:"fixed z-popover overflow-hidden rounded-lg border border-border/15 bg-surface shadow-lg",onClick:_=>_.stopPropagation(),style:{left:A?.left??12,top:A?.top??12,width:A?.width??260,maxHeight:A?.maxHeight??320},children:[t.jsx("div",{className:"border-b border-border/10 p-1.5",children:t.jsxs("div",{className:"flex items-center gap-1.5 rounded-md bg-surface-2 px-2 py-1.5",children:[t.jsx(us,{size:12,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{autoFocus:!0,value:R,onChange:_=>b(_.target.value),onKeyDown:_=>{if(_.key==="Escape"){_.preventDefault(),w(!1),b("");return}_.key==="Enter"&&(_.preventDefault(),H())},onBlur:()=>{R.trim()&&M.length===0&&H()},placeholder:f,className:"min-w-0 flex-1 bg-transparent text-[12px] text-foreground outline-none placeholder:text-muted-foreground/70"})]})}),t.jsxs("div",{className:"overflow-y-auto p-1",style:{maxHeight:Math.max(96,(A?.maxHeight??320)-46)},children:[R.trim()&&!i.some(_=>_.value===R.trim())&&t.jsxs("button",{type:"button",onMouseDown:_=>_.preventDefault(),onClick:H,className:"mb-1 flex w-full items-center justify-between gap-2 rounded-md bg-primary/10 px-2 py-1.5 text-left text-[12px] font-medium text-primary transition hover:bg-primary/15",children:[t.jsx("span",{className:"min-w-0 truncate",children:R.trim()}),t.jsx("span",{className:"shrink-0 text-[10px] text-primary/75",children:m("common.use")})]}),M.length>0?M.map(_=>t.jsxs("button",{type:"button",onClick:()=>{k(_.value),w(!1),b("")},className:`flex w-full items-center justify-between gap-2 rounded-md px-2 py-1.5 text-left text-[12px] transition hover:bg-surface-2 ${_.value===a?"bg-accent/10 text-accent":"text-foreground"}`,children:[t.jsx("span",{className:"min-w-0 truncate font-medium",children:_.label}),_.meta&&t.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:_.meta})]},_.value)):t.jsx("div",{className:"px-2 py-2 text-[11px] text-muted-foreground",children:p})]})]}),document.body)]})}function qd({open:r,onOpenChange:a,showScopePicker:i,selectedAll:c,repos:f,selectedRoots:p,onToggleRepo:g,onGenerate:k,onSecondaryAction:m,disabled:x,generateDisabled:w,secondaryDisabled:R,inserted:b,buttonLabel:A,insertedLabel:P,title:$,ariaLabel:D,scopeTitle:te,scopeLabel:M,allLabel:I,generateLabel:H,secondaryLabel:Y,secondaryTitle:be,secondaryLoading:_,loading:o,error:ae,statusTitle:W,extraContent:he,renderRepoExtra:G,menuItem:le=!1}){return t.jsxs("div",{className:le?"relative w-full":"relative inline-flex shrink-0",children:[t.jsxs("button",{type:"button",role:le?"menuitem":void 0,tabIndex:le?-1:void 0,onClick:j=>{i?a(!r):w||k(j.currentTarget)},disabled:x,className:`relative flex items-center rounded-md transition disabled:cursor-not-allowed disabled:opacity-50 ${le?"min-h-10 w-full gap-2.5 px-2.5 text-left text-[12px] focus:bg-surface-2 focus:outline-none [@media(pointer:coarse)]:min-h-11":"h-7 shrink-0 justify-center gap-1 px-2 text-[11px] font-medium active:scale-95"} ${ae?"text-destructive hover:bg-destructive/5":b?"bg-surface-elevated text-foreground":le?"text-foreground hover:bg-surface-2":"text-muted-foreground hover:bg-surface-2 hover:text-foreground"}`,"aria-label":D,title:W??(i?`${te}: ${M}`:$),children:[o?t.jsx(lt,{size:le?15:13,className:"shrink-0 animate-spin"}):t.jsx(aa,{size:le?15:13,className:le?"shrink-0 text-muted-foreground":void 0}),t.jsx("span",{className:le?"min-w-0 flex-1":void 0,children:b?P:A}),i&&(le?t.jsx(ds,{size:13,className:"shrink-0 text-muted-foreground"}):t.jsx(sa,{size:11,className:`shrink-0 transition ${r?"rotate-180":""}`})),ae&&t.jsx("span",{className:"absolute right-0.5 top-0.5 size-1.5 rounded-full bg-destructive"})]}),i&&r&&typeof document<"u"&&Qr.createPortal(t.jsx("div",{className:"fixed inset-0 z-modal-backdrop bg-[var(--app-backdrop)] px-3 py-6 backdrop-blur-sm animate-fade-in",onClick:()=>a(!1),children:t.jsxs("div",{className:"fixed left-1/2 top-1/2 z-modal-panel flex max-h-[min(82vh,36rem)] w-[calc(100vw-1.5rem)] max-w-[42rem] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-border/20 bg-surface text-[11px] shadow-2xl",onClick:j=>j.stopPropagation(),children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-border/15 px-3 py-2",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"text-[12px] font-semibold text-foreground",children:te}),t.jsx("div",{className:"mt-0.5 truncate text-[10px] text-muted-foreground",children:M})]}),t.jsx("button",{type:"button",onClick:()=>a(!1),className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-surface-2 text-muted-foreground transition hover:bg-surface-elevated hover:text-foreground active:scale-95","aria-label":"Close",children:t.jsx(Xt,{size:14})})]}),t.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto p-2",children:[he,t.jsxs("button",{type:"button",onClick:()=>g(null),className:`flex w-full items-center justify-between gap-2 rounded-md px-2 py-1.5 text-left font-medium transition ${c?"bg-primary/15 text-primary":"text-muted-foreground hover:bg-surface-2 hover:text-foreground"}`,children:[t.jsx("span",{className:"truncate",children:I}),c&&t.jsx("span",{className:"text-[10px]",children:"✓"})]}),f.map(j=>{const F=p.includes(j.root);return t.jsxs("div",{className:`mt-1 rounded-md transition ${F?"bg-primary/15 text-primary":""}`,children:[t.jsxs("button",{type:"button",onClick:()=>g(j.root),className:`flex w-full items-center justify-between gap-2 rounded-md px-2 py-1.5 text-left font-medium transition ${F?"text-primary":"text-muted-foreground hover:bg-surface-2 hover:text-foreground"}`,title:j.root,children:[t.jsxs("span",{className:"min-w-0",children:[t.jsx("span",{className:"block truncate",children:j.label}),j.branch&&t.jsx("span",{className:"block truncate text-[9px] opacity-70",children:j.branch})]}),F&&t.jsx("span",{className:"text-[10px]",children:"✓"})]}),G&&(c||F)&&t.jsx("div",{className:"px-2 pb-2",children:G(j)})]},j.root)})]}),t.jsxs("div",{className:`grid grid-cols-1 gap-1.5 border-t border-border/15 p-2 ${m&&Y?"sm:grid-cols-2":""}`,children:[m&&Y&&t.jsxs("button",{type:"button",onClick:()=>{R||(a(!1),m())},disabled:R,className:"flex h-7 w-full items-center justify-center gap-1 rounded-md bg-surface-2 px-2 text-[11px] font-semibold text-muted-foreground transition hover:bg-surface-elevated hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50 active:scale-95",title:be,children:[_?t.jsx(lt,{size:12,className:"animate-spin"}):t.jsx(lu,{size:12}),Y]}),t.jsxs("button",{type:"button",onClick:async j=>{if(w)return;await k(j.currentTarget)!==!1&&a(!1)},disabled:w,className:"flex h-7 w-full items-center justify-center gap-1 rounded-md bg-primary/15 px-2 text-[11px] font-semibold text-primary transition hover:bg-primary/25 disabled:cursor-not-allowed disabled:opacity-50 active:scale-95",title:$,children:[t.jsx(aa,{size:12}),H]})]})]})}),document.body)]})}function Og(r){if(!r||typeof r!="object"||Array.isArray(r))return!1;for(const a of Object.values(r)){if(!a||typeof a!="object"||Array.isArray(a))return!1;const i=a;if(typeof i.top!="number"||!Number.isFinite(i.top)||typeof i.updatedAt!="number"||!Number.isFinite(i.updatedAt))return!1}return!0}function Eu(){return ct(ol,Og)??{}}function Hg(r,a){const i=Eu(),c=Object.entries({...i,[r]:{top:a,updatedAt:Date.now()}}).sort(([,f],[,p])=>p.updatedAt-f.updatedAt).slice(0,dg);ra(ol,Object.fromEntries(c),fg)}function zg(r){if(!r||typeof r!="object"||Array.isArray(r))return!1;const a=r;return typeof a.start=="number"&&Number.isFinite(a.start)&&typeof a.end=="number"&&Number.isFinite(a.end)&&a.start>=1&&a.end>=a.start}function Gg(r){if(!r||typeof r!="object"||Array.isArray(r))return!1;for(const a of Object.values(r)){if(!a||typeof a!="object"||Array.isArray(a))return!1;const i=a;if(typeof i.top!="number"||!Number.isFinite(i.top)||i.left!==void 0&&(typeof i.left!="number"||!Number.isFinite(i.left))||i.markdownTop!==void 0&&(typeof i.markdownTop!="number"||!Number.isFinite(i.markdownTop))||i.lineRange!==void 0&&i.lineRange!==null&&!zg(i.lineRange)||typeof i.updatedAt!="number"||!Number.isFinite(i.updatedAt))return!1}return!0}function ll(r,a){if(!a)return null;const i=r&&!a.startsWith("/")?`${r}/${a}`:a;return r?`${r}::${i}`:i}function Au(){return ct(il,Gg)??{}}function Kd(r,a){const i=ll(r,a);return i?Au()[i]??null:null}function Ui(r,a,i){const c=ll(r,a);if(!c)return;const f=Au(),p=f[c]??{top:0,left:0,markdownTop:0,lineRange:null,updatedAt:Date.now()},g=Object.entries({...f,[c]:{...p,...i,updatedAt:Date.now()}}).sort(([,k],[,m])=>m.updatedAt-k.updatedAt).slice(0,ug);ra(il,Object.fromEntries(g),hg)}function Oi({slow:r}){return t.jsx(ap,{slow:r})}function io({message:r,onRetry:a}){const{t:i}=_t();return t.jsxs("div",{className:"mx-3 mt-3 overflow-hidden rounded-xl border border-destructive/20 bg-destructive/5 px-4 py-5 text-center text-sm text-destructive",children:[t.jsx("div",{className:"font-medium",children:i("rightSidebar.gitChangesLoadFailed")}),t.jsx("div",{className:"mt-1 break-words text-xs opacity-85",children:r}),t.jsx("button",{type:"button",onClick:a,className:"mt-3 rounded-full bg-destructive/10 px-3 py-1.5 text-xs font-semibold text-destructive transition hover:bg-destructive/15 active:scale-95",children:i("rightSidebar.retryGitChanges")})]})}function ho(r,a){const i=a&&r.startsWith(`${a}/`)?r.slice(a.length+1):r,c=i.split("/").filter(Boolean);return{name:c.pop()||i,dir:c.join("/")}}function gt(r){if(!r)return"";const a=r.replace(/\/+$/,"");return a.split("/").pop()||a||"/"}function lo(r){if(!r)return null;const a=r.replace(/\/+$/,"")||"/";if(a==="/")return null;const i=a.slice(0,a.lastIndexOf("/"))||"/";return i===a?null:i}function Wg(r,a,i){return Ki(r,a,i)}function Tu(r){const a=new Map;for(const i of r)a.set(cl(i),i);return a}function Mu(r,a){const i=new Map(r);for(const c of a)i.set(cl(c),c);return i}function Vd(r,a){let i=0;for(const c of r){const f=ut(c,a);f&&a&&f!==a&&(i+=1)}return i}function qg(r){return r.reduce((a,i)=>a+(i.staged?1:0),0)}function Kg(r,a){return Array.from(Mu(Tu(r),a).values()).sort((i,c)=>i.path.localeCompare(c.path))}function Vg(r,a){const i=r.relativeRoot==="."?gt(a??r.root)||r.name||r.root:r.relativeRoot||r.name||gt(r.root)||r.root;return{root:r.root,label:i,branch:r.context?.branch??null,count:r.files.length,staged:qg(r.files)}}function Lu(r,a){const i=gt(a??"")||a||"";return r.map(c=>Vg(c,a)).sort((c,f)=>i&&c.label===i?-1:i&&f.label===i?1:c.label.localeCompare(f.label))}function Iu(r,a,i,c,f){const p=ju(i),g=p.find($=>$.root===c)??p[0]??null,k=a.find($=>$.root===c)??null,m=k?.relativeRoot??g?.relativeRoot??".",x=k?.name??g?.name??(gt(c)||c),w=(g?.files??i.files).map($=>({...$,repoRoot:c,repoRelativeRoot:m,repoName:x})),R=g?.context??i.context,b={...k??g??{id:c,root:c,relativeRoot:m,name:x,depth:0,nested:!!(f&&c!==f),available:i.available,files:[],context:null},...g??{},id:k?.id??g?.id??c,root:c,displayRoot:k?.displayRoot??g?.displayRoot,relativeRoot:m,name:x,depth:k?.depth??g?.depth??0,nested:k?.nested??g?.nested??!!(f&&c!==f),available:g?.available??i.available,deferred:g?.deferred??!1,files:w,context:R?{...R,root:c,changedFiles:w.map($=>({path:$.path,absolutePath:$.absolutePath,status:$.status}))}:null,untrackedDeferred:g?.untrackedDeferred??i.untrackedDeferred,error:g?.error??i.error},A=k?a.map($=>$.root===c?b:$):[...a,b];return{files:Array.from(r).filter($=>ut($,f)!==c).concat(w),repositories:A,repoFilters:Lu(A,f)}}function ut(r,a){return r.repoRoot??a}function cl(r){return`${r.repoRoot??""}\0${r.path}`}function xr(r){return r.absolutePath||r.path}function Hi(r){return cl(r)}function Yg(r){return r.repoRelativeRoot&&r.repoRelativeRoot!=="."?r.repoRelativeRoot:r.repoName??""}function Yd(r){return r.reduce((a,i)=>a+(i.staged?1:0),0)}function Xd(r){const a={added:0,modified:0,deleted:0,renamed:0,copied:0,untracked:0,conflicted:0,staged:0,other:0};for(const i of r)i.status==="added"?a.added+=1:i.status==="modified"?a.modified+=1:i.status==="deleted"?a.deleted+=1:i.status==="renamed"?a.renamed+=1:i.status==="copied"?a.copied+=1:i.status==="untracked"?a.untracked+=1:i.status==="conflicted"?a.conflicted+=1:a.other+=1,i.staged&&(a.staged+=1);return a}function Xs(r){let a=0;const i=r??"root";for(let c=0;c<i.length;c+=1)a=Math.imul(a^i.charCodeAt(c),16777619);return`right-sidebar-git-bundle:${(a>>>0).toString(36)}`}function Js(r,a){return typeof r!="number"||!Number.isFinite(r)||r<=0?null:new Intl.DateTimeFormat(a==="zh"?"zh-CN":"en",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(r))}function vr(r){return r instanceof DOMException&&r.name==="AbortError"}function Xg(r){const a=r.error??r.context?.error??"";return a.includes("request was cancelled")||a.includes("IO_REQUEST_CANCELLED")}function Jd(r){return r?.available===!1&&r.code==="NOT_GIT_REPOSITORY"}function Jg({actions:r,running:a,completed:i}){const{t:c}=_t(),[f,p]=n.useState(!1),g=n.useRef(null),k=r.find(x=>a?.action===x.key),m=r.find(x=>i?.action===x.key);return r.length===0?null:(n.useEffect(()=>{if(!f)return;const x=R=>{const b=R.target;b instanceof Node&&g.current?.contains(b)||p(!1)},w=R=>{R.key==="Escape"&&p(!1)};return document.addEventListener("pointerdown",x),document.addEventListener("keydown",w),()=>{document.removeEventListener("pointerdown",x),document.removeEventListener("keydown",w)}},[f]),t.jsxs("div",{ref:g,className:"relative shrink-0",children:[t.jsx("button",{type:"button",onClick:x=>{x.stopPropagation(),p(w=>!w)},disabled:r.every(x=>x.disabled)&&!a&&!i,className:`inline-flex h-6 min-w-6 shrink-0 items-center justify-center rounded-md transition active:scale-95 disabled:opacity-50 ${f?"bg-surface-elevated text-foreground":m?"bg-accent/10 text-accent":"bg-surface-2 text-muted-foreground hover:bg-surface-elevated hover:text-foreground"}`,title:k?.label??m?.label??c("rightSidebar.gitQuickActions"),children:k?t.jsx(lt,{size:13,className:"animate-spin"}):m?t.jsx("span",{className:"text-[12px] font-semibold",children:"✓"}):t.jsx(po,{size:14})}),f&&t.jsx("div",{className:"absolute right-0 top-[calc(100%+2px)] z-30 w-44 overflow-hidden rounded-xl border border-border/15 bg-surface/98 p-1 text-[12px] shadow-xl shadow-[0_18px_48px_var(--app-shadow-soft)] backdrop-blur animate-fade-in",children:r.map(x=>{const w=a?.action===x.key,R=i?.action===x.key;return t.jsxs("button",{type:"button",onClick:b=>{b.stopPropagation(),x.onClick(),p(!1)},disabled:x.disabled||!!a,className:`flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left font-medium transition active:scale-[0.99] disabled:opacity-50 ${R?"bg-accent/10 text-accent":x.destructive?"text-destructive hover:bg-destructive/10":"text-foreground hover:bg-surface-2"}`,children:[t.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center",children:w?t.jsx(lt,{size:13,className:"animate-spin"}):R?"✓":null}),t.jsx("span",{className:"min-w-0 flex-1 truncate",children:x.label})]},x.key)})})]}))}function Qg(r){const a=window.getComputedStyle(r).overflowY;return(a==="auto"||a==="scroll")&&r.scrollHeight>r.clientHeight+1}function $u(r){let a=r;for(;a;){if(a.classList.contains("termdock-diff-stream-scroller")&&Qg(a))return a;a=a.parentElement}return r.closest(".termdock-diff-stream-scroller")}function fs(r){return r.getClientRects().length>0&&window.getComputedStyle(r).visibility!=="hidden"}const zi=new WeakMap;function vo(r){const a=zi.get(r);a!==void 0&&window.clearTimeout(a),r.classList.remove("diff-walkthrough-target"),r.offsetWidth,r.classList.add("diff-walkthrough-target");const i=window.setTimeout(()=>{r.classList.remove("diff-walkthrough-target"),zi.delete(r)},1700);zi.set(r,i)}function Zg(r){const a=CSS.escape(r),i=[`[data-diff-stream-item="${a}"]`,`[data-diff-selection-path="${a}"]`,`[data-diff-absolute-path="${a}"]`].join(","),c=Array.from(document.querySelectorAll(".termdock-diff-stream-scroller"));let f=null;for(const k of c){if(!fs(k))continue;const m=k.querySelector(i);if(m&&fs(m)){f=m;break}}if(f??=Array.from(document.querySelectorAll(i)).find(fs)??null,!f)return;const p=$u(f);if(!p){f.scrollIntoView({block:"start",behavior:"smooth"}),vo(f);return}const g=f.getBoundingClientRect().top-p.getBoundingClientRect().top+p.scrollTop;p.scrollTo({top:Math.max(0,g),behavior:"instant"}),vo(f)}function Tn(r){const a=CSS.escape(r.filePath),i=typeof r.sectionIndex=="number"?String(r.sectionIndex):null,c=typeof r.hunkIndex=="number"?String(r.hunkIndex):null,f=r.sectionFingerprint?CSS.escape(r.sectionFingerprint):null,p=r.hunkFingerprint?CSS.escape(r.hunkFingerprint):null,g=[i!==null&&f?`[data-diff-section-audit="${a}"][data-diff-section-index="${i}"][data-diff-section-fingerprint="${f}"]`:null,i!==null&&f?`[data-diff-section-anchor="${a}"][data-diff-section-index="${i}"][data-diff-section-fingerprint="${f}"]`:null,i!==null?`[data-diff-section-audit="${a}"][data-diff-section-index="${i}"]`:null,i!==null?`[data-diff-section-anchor="${a}"][data-diff-section-index="${i}"]`:null,c!==null&&p?`[data-diff-hunk-anchor="${a}"][data-diff-hunk-index="${c}"][data-diff-hunk-fingerprint="${p}"]`:null,c!==null?`[data-diff-hunk-anchor="${a}"][data-diff-hunk-index="${c}"]`:null,`[data-diff-file-path="${a}"]`].filter(P=>!!P),k=Array.from(document.querySelectorAll(".termdock-diff-stream-scroller"));let m=null;for(const P of k)if(fs(P)){for(const $ of g){const D=P.querySelector($);if(D&&fs(D)){m=D;break}}if(m)break}if(m??=g.flatMap(P=>Array.from(document.querySelectorAll(P))).find(fs)??null,!m){Zg(r.filePath);return}const x=$u(m);if(!x){m.scrollIntoView({block:"center",behavior:"smooth"}),vo(m);return}const w=m.getBoundingClientRect(),R=x.getBoundingClientRect(),A=w.top-R.top+x.scrollTop-Math.max(24,(x.clientHeight-w.height)/2);x.scrollTo({top:Math.max(0,A),behavior:"instant"}),vo(m)}let eb=0,tb=0,rb=0,nb=0,sb=0;function st(r,a={}){if(typeof window>"u")return;const i=JSON.stringify({level:r==="error"||r==="empty_bundle"?"warn":"info",message:`GIT_BUNDLE ${r}`,data:{seq:++tb,ts:Date.now(),...a}});fetch("/api/client-log",{method:"POST",headers:{"Content-Type":"application/json"},body:i,keepalive:!0}).catch(()=>{})}function Qs(r,a={}){if(typeof window>"u")return;const i=JSON.stringify({level:"info",message:`DIFF_INTERACTION ${r}`,data:{seq:++nb,ts:Date.now(),...a}});fetch("/api/client-log",{method:"POST",headers:{"Content-Type":"application/json"},body:i,keepalive:!0}).catch(()=>{})}function ab(){return`diff-ui-${Date.now().toString(36)}-${(++sb).toString(36)}`}function ob(r){return r instanceof Element?r.closest("[data-diff-selection-path]"):null}function ib(r){const a=r.target instanceof HTMLElement?r.target:null;return{eventType:r.type,button:r.button,pointerType:r instanceof globalThis.PointerEvent?r.pointerType:void 0,targetTag:a?.tagName,targetClass:a?.className,targetText:a?.textContent?.slice(0,80)}}function yo({onReviewReference:r,filePath:a,active:i=!0,onInsertReference:c,onInsertText:f,onInsertFeature:p,onReferenceCopied:g,onClose:k,onDirectoryLinkOpen:m,isMobile:x,markdownOutlineOpen:w,markdownOutlineCloseSignal:R,onOpenMarkdownOutline:b,onCloseMarkdownOutline:A,markdownImageLightboxOpen:P,markdownImageLightboxCloseSignal:$,onOpenMarkdownImageLightbox:D,onCloseMarkdownImageLightbox:te,lineRange:M,onLineRangeChange:I,insertedReferenceKey:H,copiedReferenceKey:Y,scrollToLine:be,onScrollToLineHandled:_}){const{t:o}=_t(),ae=n.useRef(null),W=n.useRef({}),he=n.useRef(i);he.current=i,n.useEffect(()=>{i||ae.current?.querySelectorAll("video").forEach(S=>S.pause())},[i]);const G=U(S=>S.rootPath),le=U(S=>S.selectFile),[j,F]=n.useState({kind:"idle"}),[ee,C]=n.useState("schematic"),[L,q]=n.useState(null),ne=n.useRef(null),[pe,Ne]=n.useState(null),we=n.useRef(new Map),Pe=n.useRef(null),[O,ue]=n.useState(null),[oe,Fe]=n.useState(()=>Ud()),[Ie,E]=n.useState(()=>Pd(G,a)),xe=n.useRef(null),[ge,De]=n.useState(!1),[Ve,Ae]=n.useState(null),[Jt,Be]=n.useState(0),[ft,Ue]=n.useState([]),[Qt,me]=n.useState(null),dt=n.useRef(null),at=n.useRef(a),[bt,Oe]=n.useState(null),V=km(G&&a&&!a.startsWith("/")?`${G}/${a}`:a,i),[ye,Ze]=n.useState(!1),[wt,ir]=n.useState(""),[N,Q]=n.useState([]),[ke,Ye]=n.useState(0),ht=n.useRef(null),yr=tu(g),kt=ll(G,a);n.useEffect(()=>{if(at.current===a)return;at.current=a;const S=a&&G&&!a.startsWith("/")?`${G}/${a}`:a;if(dt.current===S){dt.current=null;return}dt.current=null,Ue([]),me(null),Ze(!1),ir("")},[a,G]);const St=a?G&&!a.startsWith("/")?`${G}/${a}`:a:null,Mn=U(S=>St?(S.fileChangeVersions.get(St)??0)+S.fileWatchEpoch:S.fileWatchEpoch),hs=n.useRef(null),wr=n.useRef(null),[Bt,Zr]=n.useState(0),Zt=n.useCallback(()=>Zr(S=>S+1),[]);n.useEffect(()=>{const S=ne.current;return ne.current=null,q(null),S&&URL.revokeObjectURL(S.objectUrl),()=>{const T=ne.current;ne.current=null,T&&URL.revokeObjectURL(T.objectUrl)}},[St,Mn,Bt]),n.useEffect(()=>{if(!a){hs.current=null,F({kind:"idle"});return}const S=G&&!a.startsWith("/")?`${G}/${a}`:a,T=new AbortController,ce=++eb,Se=`right-sidebar-file-preview:${ce}`,Je=performance.now();let Te=!1;const ze=(K,We={})=>{Te||(Te=!0,Ei("end",{loadingId:ce,reason:K,durationMs:Math.round(performance.now()-Je),filePath:a,fullPath:S,rootPath:G,...We}))};let Me=null;const Ge=oh(S),ot=Ge?S.toLowerCase().endsWith(".kicad_pcb")?ee==="schematic"?"pcb-front":ee:"schematic":ee,Fn=!Ge&&ih(S),cr=!Ge&&!Fn&&lh(S),ys=!Ge&&!Fn&&!cr&&ch(S),an=Ys(S),on=qs(S),Gr=Ge?"eda":Fn?"image":cr?"model3d":ys?"video":"text",ln=hs.current!==S;if(hs.current=S,ln){Ei("start",{loadingId:ce,filePath:a,fullPath:S,rootPath:G,mode:Gr,externalVersion:Mn}),F({kind:"loading",mode:Gr}),wr.current=null;const K=Kd(G,a);I(K?.lineRange??null),Fe(an?Ud():"source"),E(on?Pd(G,a):"source"),Ge&&C(dh(S))}ln||F(K=>K.kind==="error"?{kind:"loading",mode:Gr}:K);const cn=window.setTimeout(()=>{Te||T.signal.aborted||Ei("still_active",{loadingId:ce,filePath:a,fullPath:S,rootPath:G,mode:Gr,durationMs:Math.round(performance.now()-Je),isPathChange:ln})},3e3),ws=window.setTimeout(()=>{if(Te||T.signal.aborted)return;const K=Ge?o("rightSidebar.edaTimeout"):cr?o("rightSidebar.model3dTimeout"):"File preview timed out. Try the file again or refresh the directory.";T.abort(new DOMException(K,"TimeoutError")),F({kind:"error",message:K}),ze("stuck_timeout",{error:K})},Ge?uh+5e3:cr?fh+5e3:hh(S)?35e3:yg);if(Ge){const K=ot==="pcb-3d"?ne.current:null;K?(F(K),ze("eda_3d_client_cache_hit",{bytes:K.meta.size,view:K.view,mimeType:K.meta.mimeType})):ph(S,ot,T.signal,"view_file",Se).then(We=>{if(T.signal.aborted)return;Me=URL.createObjectURL(We.blob);const Tt={kind:"eda",sourcePath:We.path||S,objectUrl:Me,view:We.view,meta:{size:We.size,mimeType:We.mimeType,modified:We.modified}};if(We.view==="pcb-3d"){const dr=ne.current;dr&&dr.objectUrl!==Me&&URL.revokeObjectURL(dr.objectUrl),ne.current=Tt,q(Tt),Me=null}F(Tt),ze("eda_loaded",{bytes:We.size,view:We.view,mimeType:We.mimeType})}).catch(We=>{T.signal.aborted||(F({kind:"error",message:We instanceof Error&&/timed out/i.test(We.message)?o("rightSidebar.edaTimeout"):We instanceof Error?We.message:o("rightSidebar.edaLoadFailed")}),ze("error",{error:We instanceof Error?We.message:String(We)}))})}else if(Fn)mh(S,T.signal,"view_file",Se).then(K=>{Me=URL.createObjectURL(K.blob),F({kind:"image",objectUrl:Me,meta:{size:K.size,mimeType:K.mimeType,modified:K.modified}}),ze("image_loaded",{bytes:K.size,mimeType:K.mimeType})}).catch(K=>{T.signal.aborted||(F({kind:"error",message:K instanceof Error?K.message:o("rightSidebar.imageLoadFailed")}),ze("error",{error:K instanceof Error?K.message:String(K)}))});else if(cr)gh(S,T.signal,"view_file",Se).then(K=>{T.signal.aborted||(Me=URL.createObjectURL(K.blob),F({kind:"model3d",sourcePath:K.path||S,objectUrl:Me,ext:K.ext,meta:{size:K.size,mimeType:K.mimeType,modified:K.modified}}),ze("model3d_loaded",{bytes:K.size,ext:K.ext}))}).catch(K=>{T.signal.aborted||(F({kind:"error",message:K instanceof Error&&(K.name==="TimeoutError"||/timed out/i.test(K.message))?o("rightSidebar.model3dTimeout"):K instanceof Error?K.message:o("rightSidebar.model3dLoadFailed")}),ze("error",{error:K instanceof Error?K.message:String(K)}))});else if(ys){const K=bh(S)??"",We=$h(S);F(Tt=>Tt.kind==="video"&&Tt.url===We?Tt:{kind:"video",url:We,meta:{size:null,mimeType:K,modified:null}}),ze("video_ready",{mimeType:K})}else ed(S,T.signal,"view_file",Se).then(K=>{if(!T.signal.aborted){if(K.binary){F({kind:"binary"});return}F({kind:"text",content:K.content,sourcePath:K.path||S,meta:{size:K.size,truncated:K.truncated}}),ze("text_loaded",{bytes:K.size,truncated:!!K.truncated})}}).catch(K=>{T.signal.aborted||(F({kind:"error",message:K instanceof Error?K.message:"Failed to read file"}),ze("error",{error:K instanceof Error?K.message:String(K)}))});return()=>{T.abort(),yt(Se),window.clearTimeout(cn),window.clearTimeout(ws),Me&&URL.revokeObjectURL(Me),ze("cleanup")}},[a,G,Mn,Bt,I,o,ee]),n.useEffect(()=>{if(j.kind!=="model3d"||!a){Ne(null);return}let S=!1;const T=a.lastIndexOf("/"),ce=T>=0?a.slice(T+1):a,Se=T>=0?a.slice(0,T):"",Je=Se.lastIndexOf("/"),Te=Je>=0?Se.slice(0,Je):"",ze=ce.replace(/\.(stl|glb|gltf)$/i,""),Me=`${Te?`${Te}/`:""}features/${ze}.json`;return ed(Me).then(Ge=>{if(!S)try{const ot=JSON.parse(Ge.content);Ne(ot.version===1&&Array.isArray(ot.features)&&ot.features.length>0?ot.features:null)}catch{Ne(null)}}).catch(()=>{S||Ne(null)}),()=>{S=!0}},[j,a]),n.useEffect(()=>{if(j.kind!=="text"){Oe(null);return}const S=G&&a&&!a.startsWith("/")?`${G}/${a}`:a,T=yp(S),ce=j.content,Se=Ys(S??"")&&oe==="preview",Je=qs(S??"")&&Ie==="preview";if(!T||Se||Je||!wp(ce)){Oe(null);return}let Te=!1;const ze=Me=>{if(Te||!Me.registered(T)){Te||Oe(null);return}try{Oe(Sp(Me,ce,T))}catch{Oe(null)}};return Ve?ze(Ve):(Oe(null),kp().then(Me=>{Te||(Ae(Me),ze(Me))}).catch(()=>{})),()=>{Te=!0}},[j,Ve,a,G,oe,Ie]),n.useLayoutEffect(()=>{if(!kt||j.kind!=="text")return;const S=`${kt}:${oe}:${Ie}`;if(wr.current===S)return;const T=Kd(G,a);if(wr.current=S,!T)return;const ce=requestAnimationFrame(()=>{const Se=Pe.current;if(!Se)return;const Je=oe==="preview"?T.markdownTop??T.top:T.top;Se.scrollTo({top:Math.max(0,Je??0),left:Math.max(0,T.left??0)}),Be(oe==="preview"?Math.max(0,Je??0):0)});return()=>cancelAnimationFrame(ce)},[a,oe,Ie,j.kind,kt,G]),n.useEffect(()=>{kt&&Ui(G,a,{lineRange:M})},[a,M,kt,G]),n.useEffect(()=>{if(be==null||j.kind!=="text")return;ue(null),I({start:be,end:be});const S=be,T=requestAnimationFrame(()=>{const ce=we.current.get(S);ce&&ce.scrollIntoView({block:"center"}),_?.()});return()=>cancelAnimationFrame(T)},[be,j,I,_]);const Ln=n.useCallback(S=>{const T=Pe.current;if(!T)return!1;const ce=typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(S):S.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),Se=T.querySelector(`#${ce}`);return Se?(Se.scrollIntoView({block:"start"}),!0):!1},[]);n.useEffect(()=>{const S=G&&a&&!a.startsWith("/")?`${G}/${a}`:a,T=j.kind==="text"&&Ys(S??"")&&oe==="preview";if(!Qt||!T)return;const ce=requestAnimationFrame(()=>{Ln(Qt)&&me(null)});return()=>cancelAnimationFrame(ce)},[a,Ln,oe,Qt,j,G]),n.useLayoutEffect(()=>{const S=Pe.current;if(!S||!M){ue(null);return}if(O)return;const T=j.kind==="image"||j.kind==="loading"&&j.mode==="image",ce=G&&a&&!a.startsWith("/")?`${G}/${a}`:a,Se=j.kind==="text"&&Ys(ce??"")&&oe==="preview",Je=j.kind==="text"&&qs(ce??"")&&Ie==="preview";if(j.kind!=="text"||T||Se||Je){ue(null);return}const Te=()=>{const Me=we.current.get(M.end);if(!Me||!S){ue(null);return}const Ge=Me.offsetTop+Me.offsetHeight/2,ot=S.scrollLeft+Math.max(8,S.clientWidth-120);ue({top:Ge,left:ot})};Te();const ze=new ResizeObserver(()=>Te());return ze.observe(S),()=>ze.disconnect()},[M,O,j,oe,Ie,a,G,bt]);const kr=j.kind==="text"&&!(qs(St??"")&&Ie==="preview")&&!St?.toLowerCase().endsWith(".csv")&&!St?.toLowerCase().endsWith(".kicad_pro")&&!St?.toLowerCase().endsWith(".kicad_prl"),In=n.useCallback(()=>{Ze(!1),ir(""),Q([]),Ye(0),oo(W.current)},[]),en=n.useCallback(()=>{!i||!kr||(Ze(!0),requestAnimationFrame(()=>{const S=ae.current;!he.current||!S?.isConnected||S.closest('[inert], [aria-hidden="true"], [hidden]')||S.getClientRects().length===0||getComputedStyle(S).visibility==="hidden"||!S.contains(document.activeElement)||(ht.current?.focus(),ht.current?.select())}))},[i,kr]),_r=n.useCallback(S=>{Ye(T=>N.length===0?0:(T+S+N.length)%N.length)},[N.length]),Ut=n.useCallback(S=>{if(S.nativeEvent.isComposing||!tg(ae.current,i,S))return;const T=rg(S);if(T==="open"&&kr){S.preventDefault(),en();return}ye&&(T==="close"?(S.preventDefault(),In()):(T==="next"||T==="previous")&&(S.preventDefault(),_r(T==="previous"?-1:1)))},[i,In,ye,_r,en,kr]);if(n.useLayoutEffect(()=>{if(oo(W.current),!i||!ye||!wt.trim()||!Pe.current){Q([]),Ye(0);return}const S=sg(Pe.current,wt);return Q(S),Ye(0),(ae.current?.contains(document.activeElement)||Td(W.current))&&(Ii(S,0,W.current),Md(S[0])),()=>oo(W.current)},[i,ye,wt,bt,oe,j]),n.useEffect(()=>{!i||!ye||!wt.trim()||!ae.current?.contains(document.activeElement)&&!Td(W.current)||(Ii(N,ke,W.current),Md(N[ke]))},[i,ke,N,ye,wt]),n.useEffect(()=>()=>oo(W.current),[]),!a)return t.jsx("div",{className:"mx-3 mt-3 overflow-hidden rounded-xl border border-border/15 bg-surface-2 px-4 py-8 text-center text-sm text-muted-foreground",children:o("rightSidebar.selectFilePrompt")});const He=G&&!a.startsWith("/")?`${G}/${a}`:a,Et=ho(He,G),Sr=ru(He,G),Rr=j.kind==="text"&&j.content?j.content.split(`
1638
+ `);const b=f.length;f+=w.data,c.push({node:w,start:b,end:f.length,group:R}),p=R}const k=f.toLocaleLowerCase(),m=[];let x=0;for(;x<=k.length-i.length;){const w=k.indexOf(i,x);if(w<0)break;const R=w+i.length,b=c.find(P=>P.start<=w&&P.end>w),A=c.find(P=>P.start<R&&P.end>=R);if(b&&A&&b.group===A.group){const P=document.createRange();P.setStart(b.node,w-b.start),P.setEnd(A.node,R-A.start),m.push(P)}x=w+Math.max(i.length,1)}return m}function gu(){return typeof CSS<"u"&&CSS.highlights?CSS.highlights:null}let xo;function Td(r){return xo===r}function oo(r){if(r&&xo!==r)return;const a=gu();a?.delete(mu),a?.delete(Zi),xo=void 0}function Ii(r,a,i){const c=gu();if(!c||typeof Highlight>"u")return;xo=i,c.set(mu,new Highlight(...r));const f=r[a];f?c.set(Zi,new Highlight(f)):c.delete(Zi)}function Md(r){r?.startContainer.parentElement?.scrollIntoView({block:"center",inline:"nearest",behavior:"smooth"})}function ag(r){return Array.from(new Set(r.split(/[\n,]/).map(a=>a.trim().replace(/^!+/,"")).filter(Boolean))).slice(0,24)}function og(r,a){const i=a.trim();return!i||i==="."?r:/^(?:[/\\]|[A-Za-z]:[/\\])/.test(i)?i.replace(/[\\/]+$/,""):`${r.replace(/[\\/]+$/,"")}/${i.replace(/^\.?[\\/]+/,"").replace(/[\\/]+$/,"")}`}function ig(r,a){if(a===r)return".";const i=`${r.replace(/[\\/]+$/,"")}/`;return a.startsWith(i)?a.slice(i.length):a}function bu(r,a,i){return a?r:Qr.createPortal(r,i)}const ol="termdock:right-sidebar:file-tree-scroll:v1",il="termdock:right-sidebar:file-preview-reading-state:v1",ea="termdock:right-sidebar:file-tree-width:v1",xu="termdock:right-sidebar:markdown-view-mode:v1",vu="termdock:right-sidebar:diff-change-list-mode:v1",yu="termdock:right-sidebar:diff-wrap:v1",wu="termdock:diff-viewer:view-type:v1",ku="termdock:right-sidebar:file-search-mode:v1",$i="termdock:right-sidebar:collapsed-git-repo-groups:v1",Ld="termdock:right-sidebar:collapsed-diff-directories:v1",Fi="termdock:right-sidebar:branch-audit-module-open:v1",Su="termdock:right-sidebar:branch-audit-module:v1",lg=150,Id="termdock:right-sidebar:context-draft-enabled:v1",$d="termdock:right-sidebar:context-draft-collapsed:v1",Fd="termdock:right-sidebar:context-draft-auto-collapse:v1",Di="termdock:right-sidebar:context-draft-text:v1",cg=300,dg=20,ug=120,fg=250,hg=250,pg=120,mg=700,_i=600,gg=6e4;function Vs(r){return!!(r&&U.getState().nestedGitScanRoots[r])}const Dd=[2e3,5e3,15e3,3e4],bg=320,xg=500,vg=20,yg=12e3,el=300,_d=240,wg=560,Bd=n.lazy(()=>sl(()=>import("./ModelPreview-DymFzc55.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]))),kg=n.lazy(()=>sl(()=>import("./ArchitecturePanel-Xi_R4Tso.js"),__vite__mapDeps([32,1,2,3,4,5,33,11,12,13,14,23,20,24,25,34,17,18,19,8,9,10,15,22,6,21,26,27,28,29,30,31,35])).then(r=>({default:r.ArchitecturePanel}))),Sg=n.lazy(()=>sl(()=>import("./ComputerControlView-BGvF5NeQ.js").then(r=>r.a),__vite__mapDeps([36,1,2,3,4,5,28,30,15,37,29,38])));function Ru(r,a,i){return r&&!a?"unified":i}const Rg=new Set([".md",".markdown",".mdown",".mkdn",".mkd"]);function jg(r){return r==="preview"||r==="source"}function Cg(r){return r==="list"||r==="tree"||r==="ai"}function Ud(){return ct(xu,jg)??"preview"}function Ng(){return ct(vu,Cg)??"tree"}function ta(r){return typeof r=="boolean"}function Pg(r){return typeof r=="string"}function Eg(){return ct(yu,ta)??!0}function Ag(r){return r==="unified"||r==="split"}function Tg(){return ct(wu,Ag)??"unified"}function Mg(r){return r==="name"||r==="content"||r==="regex"}function Lg(){return ct(ku,Mg)??"name"}function ju(r){return r.repositories??(r.context?.root?[{id:r.context.root,root:r.context.root,relativeRoot:".",name:gt(r.context.root)||r.context.root,depth:0,nested:!1,available:r.available,files:r.files,context:r.context,error:r.error}]:[])}function Ig(r,a){if(!a)return null;const i=new Set((r.repoFilters??[]).map(c=>c.root));return i.has(a)?a:i.size>0?null:(r.repositories??[]).some(c=>c.root===a)?a:null}function tl(r){return!r.activeGitRepoRoot&&(r.groupCount>1||r.label!==r.rootName)}function Cu(...r){const a=new Set;for(const i of r)for(const c of i)a.add(c.root);return a}function rl(r){return Array.isArray(r)&&r.every(a=>typeof a=="string")}function Od(r){const a=ct(r,rl);return a?new Set(a):new Set}function Bi(r,a){Pt(r,[...a])}function $g(r){if(!r||typeof r!="object"||Array.isArray(r))return!1;const a=r;return typeof a.filePath=="string"&&typeof a.hunkHeader=="string"&&typeof a.hunkIndex=="number"&&typeof a.fingerprint=="string"&&typeof a.additions=="number"&&typeof a.deletions=="number"&&typeof a.diff=="string"&&(a.oldPath===void 0||a.oldPath===null||typeof a.oldPath=="string")&&(a.newPath===void 0||a.newPath===null||typeof a.newPath=="string")&&(a.source===void 0||a.source==="committed"||a.source==="uncommitted"||a.source==="unknown")&&(a.commit===void 0||a.commit===null||typeof a.commit=="string")}function Fg(r){if(!r||typeof r!="object"||Array.isArray(r))return!1;const a=r;return typeof a.available=="boolean"&&(a.repoRoot===void 0||typeof a.repoRoot=="string")&&(a.workspaceRoot===void 0||typeof a.workspaceRoot=="string")&&(a.baseRef===void 0||typeof a.baseRef=="string")&&(a.baseBranch===void 0||typeof a.baseBranch=="string")&&(a.currentBranch===void 0||a.currentBranch===null||typeof a.currentBranch=="string")&&(a.headRef===void 0||a.headRef===null||typeof a.headRef=="string")&&(a.diffFingerprint===void 0||typeof a.diffFingerprint=="string")&&(a.stat===void 0||typeof a.stat=="string")&&(a.files===void 0||rl(a.files))&&(a.hunks===void 0||Array.isArray(a.hunks)&&a.hunks.every($g))&&(a.commits===void 0||rl(a.commits))&&(a.commitCount===void 0||typeof a.commitCount=="number")&&(a.diff===void 0||typeof a.diff=="string")&&(a.truncated===void 0||typeof a.truncated=="boolean")&&(a.error===void 0||typeof a.error=="string")}function Dg(r){if(!r||typeof r!="object"||Array.isArray(r))return!1;const a=r;return typeof a.key=="string"&&Fg(a.diff)&&typeof a.repoLabel=="string"&&typeof a.createdAt=="number"}function _g(r){return!r||typeof r!="object"||Array.isArray(r)?!1:Object.values(r).every(a=>{if(!a||typeof a!="object"||Array.isArray(a))return!1;const i=a;return Array.isArray(i.selectedRepoRoots)&&i.selectedRepoRoots.every(c=>typeof c=="string")&&!!i.repoTargetBranches&&typeof i.repoTargetBranches=="object"&&!Array.isArray(i.repoTargetBranches)&&Object.values(i.repoTargetBranches).every(c=>typeof c=="string")&&(i.repoBaseBranches===void 0||!!i.repoBaseBranches&&typeof i.repoBaseBranches=="object"&&!Array.isArray(i.repoBaseBranches)&&Object.values(i.repoBaseBranches).every(c=>typeof c=="string"))&&(i.previewEntries===void 0||Array.isArray(i.previewEntries)&&i.previewEntries.every(Dg))&&(i.selectedPreviewKey===void 0||i.selectedPreviewKey===null||typeof i.selectedPreviewKey=="string")&&(i.selectedPreviewFileKey===void 0||i.selectedPreviewFileKey===null||typeof i.selectedPreviewFileKey=="string")&&(i.previewDetailOpen===void 0||typeof i.previewDetailOpen=="boolean")&&(i.previewScrollTops===void 0||!!i.previewScrollTops&&typeof i.previewScrollTops=="object"&&!Array.isArray(i.previewScrollTops)&&Object.values(i.previewScrollTops).every(c=>typeof c=="number"))&&(i.previewMobileSlideIndex===void 0||typeof i.previewMobileSlideIndex=="number")&&(i.repoIncludeUncommitted===void 0||!!i.repoIncludeUncommitted&&typeof i.repoIncludeUncommitted=="object"&&!Array.isArray(i.repoIncludeUncommitted)&&Object.values(i.repoIncludeUncommitted).every(c=>typeof c=="boolean"))&&(i.includeUncommitted===void 0||typeof i.includeUncommitted=="boolean")&&typeof i.updatedAt=="number"})}function Hd(){return ct(Su,_g)??{}}function zd(r){return[r.repoRoot,r.baseRef,r.branchName??"",r.headRef??"",r.diffFingerprint??""].join("\0")}function Gd(r){const a=r?.trim()??"",i=a.indexOf("/");return i>=0?a.slice(i+1):a}function Nu(r,a){const i=r?.trim(),c=a?.trim();return!i||!c?!1:i===c||Gd(i)===Gd(c)}function Wd(r){const a=r?.branch??null;return[r?.upstream,...r?.remoteBranches??[],...r?.branches??[]].find(c=>c&&!Nu(c,a))??""}function nl(r,a){const i=Math.max(_d,a-320),c=Math.min(wg,i);return Math.min(c,Math.max(_d,r))}function Bg(r){return typeof r=="number"&&Number.isFinite(r)}function Ug(r){return nl(ct(ea,Bg)??el,r)}function Pu(r){const a=r.split(/[\\/]/).pop()??r,i=a.lastIndexOf(".");return i>=0?a.slice(i).toLowerCase():""}function Ys(r){return Rg.has(Pu(r))}function cs({label:r,value:a,options:i,placeholder:c,searchPlaceholder:f,emptyText:p,disabled:g,onChange:k}){const{t:m}=_t(),[x,w]=n.useState(!1),[R,b]=n.useState(""),[A,P]=n.useState(null),$=n.useRef(null),D=n.useRef(null),te=R.trim().toLowerCase(),M=n.useMemo(()=>te?i.filter(_=>`${_.label} ${_.meta??""}`.toLowerCase().includes(te)):i,[te,i]),I=i.find(_=>_.value===a),H=()=>{const _=R.trim();_&&(k(_),w(!1),b(""))},Y=n.useCallback(()=>{const _=$.current?.getBoundingClientRect();if(!_)return!1;const o=12,ae=Math.max(220,Math.min(_.width,window.innerWidth-o*2)),W=Math.min(Math.max(o,_.left),window.innerWidth-ae-o),he=window.innerHeight-_.bottom-o,G=_.top-o,le=he>=180||he>=G,j=Math.max(96,(le?he:G)-4),F=Math.min(320,j);return P({left:W,top:le?_.bottom+4:Math.max(o,_.top-F-4),width:ae,maxHeight:F}),!0},[]),be=()=>{Y(),w(!0)};return n.useEffect(()=>{if(!x)return;let _=0;const o=()=>{_||(_=window.requestAnimationFrame(()=>{_=0,Y()}))},ae=W=>{const he=W.target;he instanceof Node&&($.current?.contains(he)||D.current?.contains(he)||(w(!1),b("")))};return window.addEventListener("resize",o),window.addEventListener("scroll",o,!0),document.addEventListener("pointerdown",ae,!0),()=>{_&&window.cancelAnimationFrame(_),window.removeEventListener("resize",o),window.removeEventListener("scroll",o,!0),document.removeEventListener("pointerdown",ae,!0)}},[x,Y]),t.jsxs("div",{className:"relative min-w-0",children:[t.jsxs("button",{ref:$,type:"button",disabled:g,onClick:()=>{if(!g){if(b(""),x){w(!1);return}be()}},className:"group flex w-full items-center justify-between gap-2 min-h-10 rounded-md border border-transparent bg-surface-2 px-3 py-2 text-left transition hover:bg-surface-elevated focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",children:[t.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-3",children:[t.jsx("span",{className:"shrink-0 text-[11px] text-muted-foreground",children:r}),t.jsx("span",{className:`min-w-0 flex-1 truncate text-[13px] ${a?"text-foreground":"text-muted-foreground/70"}`,children:I?.label??(a||c)})]}),t.jsx(sa,{size:13,className:`shrink-0 text-muted-foreground transition group-hover:text-foreground ${x?"rotate-180":""}`})]}),x&&!g&&typeof document<"u"&&Qr.createPortal(t.jsxs("div",{ref:D,className:"fixed z-popover overflow-hidden rounded-lg border border-border/15 bg-surface shadow-lg",onClick:_=>_.stopPropagation(),style:{left:A?.left??12,top:A?.top??12,width:A?.width??260,maxHeight:A?.maxHeight??320},children:[t.jsx("div",{className:"border-b border-border/10 p-1.5",children:t.jsxs("div",{className:"flex items-center gap-1.5 rounded-md bg-surface-2 px-2 py-1.5",children:[t.jsx(us,{size:12,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{autoFocus:!0,value:R,onChange:_=>b(_.target.value),onKeyDown:_=>{if(_.key==="Escape"){_.preventDefault(),w(!1),b("");return}_.key==="Enter"&&(_.preventDefault(),H())},onBlur:()=>{R.trim()&&M.length===0&&H()},placeholder:f,className:"min-w-0 flex-1 bg-transparent text-[12px] text-foreground outline-none placeholder:text-muted-foreground/70"})]})}),t.jsxs("div",{className:"overflow-y-auto p-1",style:{maxHeight:Math.max(96,(A?.maxHeight??320)-46)},children:[R.trim()&&!i.some(_=>_.value===R.trim())&&t.jsxs("button",{type:"button",onMouseDown:_=>_.preventDefault(),onClick:H,className:"mb-1 flex w-full items-center justify-between gap-2 rounded-md bg-primary/10 px-2 py-1.5 text-left text-[12px] font-medium text-primary transition hover:bg-primary/15",children:[t.jsx("span",{className:"min-w-0 truncate",children:R.trim()}),t.jsx("span",{className:"shrink-0 text-[10px] text-primary/75",children:m("common.use")})]}),M.length>0?M.map(_=>t.jsxs("button",{type:"button",onClick:()=>{k(_.value),w(!1),b("")},className:`flex w-full items-center justify-between gap-2 rounded-md px-2 py-1.5 text-left text-[12px] transition hover:bg-surface-2 ${_.value===a?"bg-accent/10 text-accent":"text-foreground"}`,children:[t.jsx("span",{className:"min-w-0 truncate font-medium",children:_.label}),_.meta&&t.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:_.meta})]},_.value)):t.jsx("div",{className:"px-2 py-2 text-[11px] text-muted-foreground",children:p})]})]}),document.body)]})}function qd({open:r,onOpenChange:a,showScopePicker:i,selectedAll:c,repos:f,selectedRoots:p,onToggleRepo:g,onGenerate:k,onSecondaryAction:m,disabled:x,generateDisabled:w,secondaryDisabled:R,inserted:b,buttonLabel:A,insertedLabel:P,title:$,ariaLabel:D,scopeTitle:te,scopeLabel:M,allLabel:I,generateLabel:H,secondaryLabel:Y,secondaryTitle:be,secondaryLoading:_,loading:o,error:ae,statusTitle:W,extraContent:he,renderRepoExtra:G,menuItem:le=!1}){return t.jsxs("div",{className:le?"relative w-full":"relative inline-flex shrink-0",children:[t.jsxs("button",{type:"button",role:le?"menuitem":void 0,tabIndex:le?-1:void 0,onClick:j=>{i?a(!r):w||k(j.currentTarget)},disabled:x,className:`relative flex items-center rounded-md transition disabled:cursor-not-allowed disabled:opacity-50 ${le?"min-h-10 w-full gap-2.5 px-2.5 text-left text-[12px] focus:bg-surface-2 focus:outline-none [@media(pointer:coarse)]:min-h-11":"h-7 shrink-0 justify-center gap-1 px-2 text-[11px] font-medium active:scale-95"} ${ae?"text-destructive hover:bg-destructive/5":b?"bg-surface-elevated text-foreground":le?"text-foreground hover:bg-surface-2":"text-muted-foreground hover:bg-surface-2 hover:text-foreground"}`,"aria-label":D,title:W??(i?`${te}: ${M}`:$),children:[o?t.jsx(lt,{size:le?15:13,className:"shrink-0 animate-spin"}):t.jsx(aa,{size:le?15:13,className:le?"shrink-0 text-muted-foreground":void 0}),t.jsx("span",{className:le?"min-w-0 flex-1":void 0,children:b?P:A}),i&&(le?t.jsx(ds,{size:13,className:"shrink-0 text-muted-foreground"}):t.jsx(sa,{size:11,className:`shrink-0 transition ${r?"rotate-180":""}`})),ae&&t.jsx("span",{className:"absolute right-0.5 top-0.5 size-1.5 rounded-full bg-destructive"})]}),i&&r&&typeof document<"u"&&Qr.createPortal(t.jsx("div",{className:"fixed inset-0 z-modal-backdrop bg-[var(--app-backdrop)] px-3 py-6 backdrop-blur-sm animate-fade-in",onClick:()=>a(!1),children:t.jsxs("div",{className:"fixed left-1/2 top-1/2 z-modal-panel flex max-h-[min(82vh,36rem)] w-[calc(100vw-1.5rem)] max-w-[42rem] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-border/20 bg-surface text-[11px] shadow-2xl",onClick:j=>j.stopPropagation(),children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-border/15 px-3 py-2",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"text-[12px] font-semibold text-foreground",children:te}),t.jsx("div",{className:"mt-0.5 truncate text-[10px] text-muted-foreground",children:M})]}),t.jsx("button",{type:"button",onClick:()=>a(!1),className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-surface-2 text-muted-foreground transition hover:bg-surface-elevated hover:text-foreground active:scale-95","aria-label":"Close",children:t.jsx(Xt,{size:14})})]}),t.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto p-2",children:[he,t.jsxs("button",{type:"button",onClick:()=>g(null),className:`flex w-full items-center justify-between gap-2 rounded-md px-2 py-1.5 text-left font-medium transition ${c?"bg-primary/15 text-primary":"text-muted-foreground hover:bg-surface-2 hover:text-foreground"}`,children:[t.jsx("span",{className:"truncate",children:I}),c&&t.jsx("span",{className:"text-[10px]",children:"✓"})]}),f.map(j=>{const F=p.includes(j.root);return t.jsxs("div",{className:`mt-1 rounded-md transition ${F?"bg-primary/15 text-primary":""}`,children:[t.jsxs("button",{type:"button",onClick:()=>g(j.root),className:`flex w-full items-center justify-between gap-2 rounded-md px-2 py-1.5 text-left font-medium transition ${F?"text-primary":"text-muted-foreground hover:bg-surface-2 hover:text-foreground"}`,title:j.root,children:[t.jsxs("span",{className:"min-w-0",children:[t.jsx("span",{className:"block truncate",children:j.label}),j.branch&&t.jsx("span",{className:"block truncate text-[9px] opacity-70",children:j.branch})]}),F&&t.jsx("span",{className:"text-[10px]",children:"✓"})]}),G&&(c||F)&&t.jsx("div",{className:"px-2 pb-2",children:G(j)})]},j.root)})]}),t.jsxs("div",{className:`grid grid-cols-1 gap-1.5 border-t border-border/15 p-2 ${m&&Y?"sm:grid-cols-2":""}`,children:[m&&Y&&t.jsxs("button",{type:"button",onClick:()=>{R||(a(!1),m())},disabled:R,className:"flex h-7 w-full items-center justify-center gap-1 rounded-md bg-surface-2 px-2 text-[11px] font-semibold text-muted-foreground transition hover:bg-surface-elevated hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50 active:scale-95",title:be,children:[_?t.jsx(lt,{size:12,className:"animate-spin"}):t.jsx(lu,{size:12}),Y]}),t.jsxs("button",{type:"button",onClick:async j=>{if(w)return;await k(j.currentTarget)!==!1&&a(!1)},disabled:w,className:"flex h-7 w-full items-center justify-center gap-1 rounded-md bg-primary/15 px-2 text-[11px] font-semibold text-primary transition hover:bg-primary/25 disabled:cursor-not-allowed disabled:opacity-50 active:scale-95",title:$,children:[t.jsx(aa,{size:12}),H]})]})]})}),document.body)]})}function Og(r){if(!r||typeof r!="object"||Array.isArray(r))return!1;for(const a of Object.values(r)){if(!a||typeof a!="object"||Array.isArray(a))return!1;const i=a;if(typeof i.top!="number"||!Number.isFinite(i.top)||typeof i.updatedAt!="number"||!Number.isFinite(i.updatedAt))return!1}return!0}function Eu(){return ct(ol,Og)??{}}function Hg(r,a){const i=Eu(),c=Object.entries({...i,[r]:{top:a,updatedAt:Date.now()}}).sort(([,f],[,p])=>p.updatedAt-f.updatedAt).slice(0,dg);ra(ol,Object.fromEntries(c),fg)}function zg(r){if(!r||typeof r!="object"||Array.isArray(r))return!1;const a=r;return typeof a.start=="number"&&Number.isFinite(a.start)&&typeof a.end=="number"&&Number.isFinite(a.end)&&a.start>=1&&a.end>=a.start}function Gg(r){if(!r||typeof r!="object"||Array.isArray(r))return!1;for(const a of Object.values(r)){if(!a||typeof a!="object"||Array.isArray(a))return!1;const i=a;if(typeof i.top!="number"||!Number.isFinite(i.top)||i.left!==void 0&&(typeof i.left!="number"||!Number.isFinite(i.left))||i.markdownTop!==void 0&&(typeof i.markdownTop!="number"||!Number.isFinite(i.markdownTop))||i.lineRange!==void 0&&i.lineRange!==null&&!zg(i.lineRange)||typeof i.updatedAt!="number"||!Number.isFinite(i.updatedAt))return!1}return!0}function ll(r,a){if(!a)return null;const i=r&&!a.startsWith("/")?`${r}/${a}`:a;return r?`${r}::${i}`:i}function Au(){return ct(il,Gg)??{}}function Kd(r,a){const i=ll(r,a);return i?Au()[i]??null:null}function Ui(r,a,i){const c=ll(r,a);if(!c)return;const f=Au(),p=f[c]??{top:0,left:0,markdownTop:0,lineRange:null,updatedAt:Date.now()},g=Object.entries({...f,[c]:{...p,...i,updatedAt:Date.now()}}).sort(([,k],[,m])=>m.updatedAt-k.updatedAt).slice(0,ug);ra(il,Object.fromEntries(g),hg)}function Oi({slow:r}){return t.jsx(ap,{slow:r})}function io({message:r,onRetry:a}){const{t:i}=_t();return t.jsxs("div",{className:"mx-3 mt-3 overflow-hidden rounded-xl border border-destructive/20 bg-destructive/5 px-4 py-5 text-center text-sm text-destructive",children:[t.jsx("div",{className:"font-medium",children:i("rightSidebar.gitChangesLoadFailed")}),t.jsx("div",{className:"mt-1 break-words text-xs opacity-85",children:r}),t.jsx("button",{type:"button",onClick:a,className:"mt-3 rounded-full bg-destructive/10 px-3 py-1.5 text-xs font-semibold text-destructive transition hover:bg-destructive/15 active:scale-95",children:i("rightSidebar.retryGitChanges")})]})}function ho(r,a){const i=a&&r.startsWith(`${a}/`)?r.slice(a.length+1):r,c=i.split("/").filter(Boolean);return{name:c.pop()||i,dir:c.join("/")}}function gt(r){if(!r)return"";const a=r.replace(/\/+$/,"");return a.split("/").pop()||a||"/"}function lo(r){if(!r)return null;const a=r.replace(/\/+$/,"")||"/";if(a==="/")return null;const i=a.slice(0,a.lastIndexOf("/"))||"/";return i===a?null:i}function Wg(r,a,i){return Ki(r,a,i)}function Tu(r){const a=new Map;for(const i of r)a.set(cl(i),i);return a}function Mu(r,a){const i=new Map(r);for(const c of a)i.set(cl(c),c);return i}function Vd(r,a){let i=0;for(const c of r){const f=ut(c,a);f&&a&&f!==a&&(i+=1)}return i}function qg(r){return r.reduce((a,i)=>a+(i.staged?1:0),0)}function Kg(r,a){return Array.from(Mu(Tu(r),a).values()).sort((i,c)=>i.path.localeCompare(c.path))}function Vg(r,a){const i=r.relativeRoot==="."?gt(a??r.root)||r.name||r.root:r.relativeRoot||r.name||gt(r.root)||r.root;return{root:r.root,label:i,branch:r.context?.branch??null,count:r.files.length,staged:qg(r.files)}}function Lu(r,a){const i=gt(a??"")||a||"";return r.map(c=>Vg(c,a)).sort((c,f)=>i&&c.label===i?-1:i&&f.label===i?1:c.label.localeCompare(f.label))}function Iu(r,a,i,c,f){const p=ju(i),g=p.find($=>$.root===c)??p[0]??null,k=a.find($=>$.root===c)??null,m=k?.relativeRoot??g?.relativeRoot??".",x=k?.name??g?.name??(gt(c)||c),w=(g?.files??i.files).map($=>({...$,repoRoot:c,repoRelativeRoot:m,repoName:x})),R=g?.context??i.context,b={...k??g??{id:c,root:c,relativeRoot:m,name:x,depth:0,nested:!!(f&&c!==f),available:i.available,files:[],context:null},...g??{},id:k?.id??g?.id??c,root:c,displayRoot:k?.displayRoot??g?.displayRoot,relativeRoot:m,name:x,depth:k?.depth??g?.depth??0,nested:k?.nested??g?.nested??!!(f&&c!==f),available:g?.available??i.available,deferred:g?.deferred??!1,files:w,context:R?{...R,root:c,changedFiles:w.map($=>({path:$.path,absolutePath:$.absolutePath,status:$.status}))}:null,untrackedDeferred:g?.untrackedDeferred??i.untrackedDeferred,error:g?.error??i.error},A=k?a.map($=>$.root===c?b:$):[...a,b];return{files:Array.from(r).filter($=>ut($,f)!==c).concat(w),repositories:A,repoFilters:Lu(A,f)}}function ut(r,a){return r.repoRoot??a}function cl(r){return`${r.repoRoot??""}\0${r.path}`}function xr(r){return r.absolutePath||r.path}function Hi(r){return cl(r)}function Yg(r){return r.repoRelativeRoot&&r.repoRelativeRoot!=="."?r.repoRelativeRoot:r.repoName??""}function Yd(r){return r.reduce((a,i)=>a+(i.staged?1:0),0)}function Xd(r){const a={added:0,modified:0,deleted:0,renamed:0,copied:0,untracked:0,conflicted:0,staged:0,other:0};for(const i of r)i.status==="added"?a.added+=1:i.status==="modified"?a.modified+=1:i.status==="deleted"?a.deleted+=1:i.status==="renamed"?a.renamed+=1:i.status==="copied"?a.copied+=1:i.status==="untracked"?a.untracked+=1:i.status==="conflicted"?a.conflicted+=1:a.other+=1,i.staged&&(a.staged+=1);return a}function Xs(r){let a=0;const i=r??"root";for(let c=0;c<i.length;c+=1)a=Math.imul(a^i.charCodeAt(c),16777619);return`right-sidebar-git-bundle:${(a>>>0).toString(36)}`}function Js(r,a){return typeof r!="number"||!Number.isFinite(r)||r<=0?null:new Intl.DateTimeFormat(a==="zh"?"zh-CN":"en",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(r))}function vr(r){return r instanceof DOMException&&r.name==="AbortError"}function Xg(r){const a=r.error??r.context?.error??"";return a.includes("request was cancelled")||a.includes("IO_REQUEST_CANCELLED")}function Jd(r){return r?.available===!1&&r.code==="NOT_GIT_REPOSITORY"}function Jg({actions:r,running:a,completed:i}){const{t:c}=_t(),[f,p]=n.useState(!1),g=n.useRef(null),k=r.find(x=>a?.action===x.key),m=r.find(x=>i?.action===x.key);return r.length===0?null:(n.useEffect(()=>{if(!f)return;const x=R=>{const b=R.target;b instanceof Node&&g.current?.contains(b)||p(!1)},w=R=>{R.key==="Escape"&&p(!1)};return document.addEventListener("pointerdown",x),document.addEventListener("keydown",w),()=>{document.removeEventListener("pointerdown",x),document.removeEventListener("keydown",w)}},[f]),t.jsxs("div",{ref:g,className:"relative shrink-0",children:[t.jsx("button",{type:"button",onClick:x=>{x.stopPropagation(),p(w=>!w)},disabled:r.every(x=>x.disabled)&&!a&&!i,className:`inline-flex h-6 min-w-6 shrink-0 items-center justify-center rounded-md transition active:scale-95 disabled:opacity-50 ${f?"bg-surface-elevated text-foreground":m?"bg-accent/10 text-accent":"bg-surface-2 text-muted-foreground hover:bg-surface-elevated hover:text-foreground"}`,title:k?.label??m?.label??c("rightSidebar.gitQuickActions"),children:k?t.jsx(lt,{size:13,className:"animate-spin"}):m?t.jsx("span",{className:"text-[12px] font-semibold",children:"✓"}):t.jsx(po,{size:14})}),f&&t.jsx("div",{className:"absolute right-0 top-[calc(100%+2px)] z-30 w-44 overflow-hidden rounded-xl border border-border/15 bg-surface/98 p-1 text-[12px] shadow-xl shadow-[0_18px_48px_var(--app-shadow-soft)] backdrop-blur animate-fade-in",children:r.map(x=>{const w=a?.action===x.key,R=i?.action===x.key;return t.jsxs("button",{type:"button",onClick:b=>{b.stopPropagation(),x.onClick(),p(!1)},disabled:x.disabled||!!a,className:`flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left font-medium transition active:scale-[0.99] disabled:opacity-50 ${R?"bg-accent/10 text-accent":x.destructive?"text-destructive hover:bg-destructive/10":"text-foreground hover:bg-surface-2"}`,children:[t.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center",children:w?t.jsx(lt,{size:13,className:"animate-spin"}):R?"✓":null}),t.jsx("span",{className:"min-w-0 flex-1 truncate",children:x.label})]},x.key)})})]}))}function Qg(r){const a=window.getComputedStyle(r).overflowY;return(a==="auto"||a==="scroll")&&r.scrollHeight>r.clientHeight+1}function $u(r){let a=r;for(;a;){if(a.classList.contains("termdock-diff-stream-scroller")&&Qg(a))return a;a=a.parentElement}return r.closest(".termdock-diff-stream-scroller")}function fs(r){return r.getClientRects().length>0&&window.getComputedStyle(r).visibility!=="hidden"}const zi=new WeakMap;function vo(r){const a=zi.get(r);a!==void 0&&window.clearTimeout(a),r.classList.remove("diff-walkthrough-target"),r.offsetWidth,r.classList.add("diff-walkthrough-target");const i=window.setTimeout(()=>{r.classList.remove("diff-walkthrough-target"),zi.delete(r)},1700);zi.set(r,i)}function Zg(r){const a=CSS.escape(r),i=[`[data-diff-stream-item="${a}"]`,`[data-diff-selection-path="${a}"]`,`[data-diff-absolute-path="${a}"]`].join(","),c=Array.from(document.querySelectorAll(".termdock-diff-stream-scroller"));let f=null;for(const k of c){if(!fs(k))continue;const m=k.querySelector(i);if(m&&fs(m)){f=m;break}}if(f??=Array.from(document.querySelectorAll(i)).find(fs)??null,!f)return;const p=$u(f);if(!p){f.scrollIntoView({block:"start",behavior:"smooth"}),vo(f);return}const g=f.getBoundingClientRect().top-p.getBoundingClientRect().top+p.scrollTop;p.scrollTo({top:Math.max(0,g),behavior:"instant"}),vo(f)}function Tn(r){const a=CSS.escape(r.filePath),i=typeof r.sectionIndex=="number"?String(r.sectionIndex):null,c=typeof r.hunkIndex=="number"?String(r.hunkIndex):null,f=r.sectionFingerprint?CSS.escape(r.sectionFingerprint):null,p=r.hunkFingerprint?CSS.escape(r.hunkFingerprint):null,g=[i!==null&&f?`[data-diff-section-audit="${a}"][data-diff-section-index="${i}"][data-diff-section-fingerprint="${f}"]`:null,i!==null&&f?`[data-diff-section-anchor="${a}"][data-diff-section-index="${i}"][data-diff-section-fingerprint="${f}"]`:null,i!==null?`[data-diff-section-audit="${a}"][data-diff-section-index="${i}"]`:null,i!==null?`[data-diff-section-anchor="${a}"][data-diff-section-index="${i}"]`:null,c!==null&&p?`[data-diff-hunk-anchor="${a}"][data-diff-hunk-index="${c}"][data-diff-hunk-fingerprint="${p}"]`:null,c!==null?`[data-diff-hunk-anchor="${a}"][data-diff-hunk-index="${c}"]`:null,`[data-diff-file-path="${a}"]`].filter(P=>!!P),k=Array.from(document.querySelectorAll(".termdock-diff-stream-scroller"));let m=null;for(const P of k)if(fs(P)){for(const $ of g){const D=P.querySelector($);if(D&&fs(D)){m=D;break}}if(m)break}if(m??=g.flatMap(P=>Array.from(document.querySelectorAll(P))).find(fs)??null,!m){Zg(r.filePath);return}const x=$u(m);if(!x){m.scrollIntoView({block:"center",behavior:"smooth"}),vo(m);return}const w=m.getBoundingClientRect(),R=x.getBoundingClientRect(),A=w.top-R.top+x.scrollTop-Math.max(24,(x.clientHeight-w.height)/2);x.scrollTo({top:Math.max(0,A),behavior:"instant"}),vo(m)}let eb=0,tb=0,rb=0,nb=0,sb=0;function st(r,a={}){if(typeof window>"u")return;const i=JSON.stringify({level:r==="error"||r==="empty_bundle"?"warn":"info",message:`GIT_BUNDLE ${r}`,data:{seq:++tb,ts:Date.now(),...a}});fetch("/api/client-log",{method:"POST",headers:{"Content-Type":"application/json"},body:i,keepalive:!0}).catch(()=>{})}function Qs(r,a={}){if(typeof window>"u")return;const i=JSON.stringify({level:"info",message:`DIFF_INTERACTION ${r}`,data:{seq:++nb,ts:Date.now(),...a}});fetch("/api/client-log",{method:"POST",headers:{"Content-Type":"application/json"},body:i,keepalive:!0}).catch(()=>{})}function ab(){return`diff-ui-${Date.now().toString(36)}-${(++sb).toString(36)}`}function ob(r){return r instanceof Element?r.closest("[data-diff-selection-path]"):null}function ib(r){const a=r.target instanceof HTMLElement?r.target:null;return{eventType:r.type,button:r.button,pointerType:r instanceof globalThis.PointerEvent?r.pointerType:void 0,targetTag:a?.tagName,targetClass:a?.className,targetText:a?.textContent?.slice(0,80)}}function yo({onReviewReference:r,filePath:a,active:i=!0,onInsertReference:c,onInsertText:f,onInsertFeature:p,onReferenceCopied:g,onClose:k,onDirectoryLinkOpen:m,isMobile:x,markdownOutlineOpen:w,markdownOutlineCloseSignal:R,onOpenMarkdownOutline:b,onCloseMarkdownOutline:A,markdownImageLightboxOpen:P,markdownImageLightboxCloseSignal:$,onOpenMarkdownImageLightbox:D,onCloseMarkdownImageLightbox:te,lineRange:M,onLineRangeChange:I,insertedReferenceKey:H,copiedReferenceKey:Y,scrollToLine:be,onScrollToLineHandled:_}){const{t:o}=_t(),ae=n.useRef(null),W=n.useRef({}),he=n.useRef(i);he.current=i,n.useEffect(()=>{i||ae.current?.querySelectorAll("video").forEach(S=>S.pause())},[i]);const G=U(S=>S.rootPath),le=U(S=>S.selectFile),[j,F]=n.useState({kind:"idle"}),[ee,C]=n.useState("schematic"),[L,q]=n.useState(null),ne=n.useRef(null),[pe,Ne]=n.useState(null),we=n.useRef(new Map),Pe=n.useRef(null),[O,ue]=n.useState(null),[oe,Fe]=n.useState(()=>Ud()),[Ie,E]=n.useState(()=>Pd(G,a)),xe=n.useRef(null),[ge,De]=n.useState(!1),[Ve,Ae]=n.useState(null),[Jt,Be]=n.useState(0),[ft,Ue]=n.useState([]),[Qt,me]=n.useState(null),dt=n.useRef(null),at=n.useRef(a),[bt,Oe]=n.useState(null),V=km(G&&a&&!a.startsWith("/")?`${G}/${a}`:a,i),[ye,Ze]=n.useState(!1),[wt,ir]=n.useState(""),[N,Q]=n.useState([]),[ke,Ye]=n.useState(0),ht=n.useRef(null),yr=tu(g),kt=ll(G,a);n.useEffect(()=>{if(at.current===a)return;at.current=a;const S=a&&G&&!a.startsWith("/")?`${G}/${a}`:a;if(dt.current===S){dt.current=null;return}dt.current=null,Ue([]),me(null),Ze(!1),ir("")},[a,G]);const St=a?G&&!a.startsWith("/")?`${G}/${a}`:a:null,Mn=U(S=>St?(S.fileChangeVersions.get(St)??0)+S.fileWatchEpoch:S.fileWatchEpoch),hs=n.useRef(null),wr=n.useRef(null),[Bt,Zr]=n.useState(0),Zt=n.useCallback(()=>Zr(S=>S+1),[]);n.useEffect(()=>{const S=ne.current;return ne.current=null,q(null),S&&URL.revokeObjectURL(S.objectUrl),()=>{const T=ne.current;ne.current=null,T&&URL.revokeObjectURL(T.objectUrl)}},[St,Mn,Bt]),n.useEffect(()=>{if(!a){hs.current=null,F({kind:"idle"});return}const S=G&&!a.startsWith("/")?`${G}/${a}`:a,T=new AbortController,ce=++eb,Se=`right-sidebar-file-preview:${ce}`,Je=performance.now();let Te=!1;const ze=(K,We={})=>{Te||(Te=!0,Ei("end",{loadingId:ce,reason:K,durationMs:Math.round(performance.now()-Je),filePath:a,fullPath:S,rootPath:G,...We}))};let Me=null;const Ge=oh(S),ot=Ge?S.toLowerCase().endsWith(".kicad_pcb")?ee==="schematic"?"pcb-front":ee:"schematic":ee,Fn=!Ge&&ih(S),cr=!Ge&&!Fn&&lh(S),ys=!Ge&&!Fn&&!cr&&ch(S),an=Ys(S),on=qs(S),Gr=Ge?"eda":Fn?"image":cr?"model3d":ys?"video":"text",ln=hs.current!==S;if(hs.current=S,ln){Ei("start",{loadingId:ce,filePath:a,fullPath:S,rootPath:G,mode:Gr,externalVersion:Mn}),F({kind:"loading",mode:Gr}),wr.current=null;const K=Kd(G,a);I(K?.lineRange??null),Fe(an?Ud():"source"),E(on?Pd(G,a):"source"),Ge&&C(dh(S))}ln||F(K=>K.kind==="error"?{kind:"loading",mode:Gr}:K);const cn=window.setTimeout(()=>{Te||T.signal.aborted||Ei("still_active",{loadingId:ce,filePath:a,fullPath:S,rootPath:G,mode:Gr,durationMs:Math.round(performance.now()-Je),isPathChange:ln})},3e3),ws=window.setTimeout(()=>{if(Te||T.signal.aborted)return;const K=Ge?o("rightSidebar.edaTimeout"):cr?o("rightSidebar.model3dTimeout"):"File preview timed out. Try the file again or refresh the directory.";T.abort(new DOMException(K,"TimeoutError")),F({kind:"error",message:K}),ze("stuck_timeout",{error:K})},Ge?uh+5e3:cr?fh+5e3:hh(S)?35e3:yg);if(Ge){const K=ot==="pcb-3d"?ne.current:null;K?(F(K),ze("eda_3d_client_cache_hit",{bytes:K.meta.size,view:K.view,mimeType:K.meta.mimeType})):ph(S,ot,T.signal,"view_file",Se).then(We=>{if(T.signal.aborted)return;Me=URL.createObjectURL(We.blob);const Tt={kind:"eda",sourcePath:We.path||S,objectUrl:Me,view:We.view,meta:{size:We.size,mimeType:We.mimeType,modified:We.modified}};if(We.view==="pcb-3d"){const dr=ne.current;dr&&dr.objectUrl!==Me&&URL.revokeObjectURL(dr.objectUrl),ne.current=Tt,q(Tt),Me=null}F(Tt),ze("eda_loaded",{bytes:We.size,view:We.view,mimeType:We.mimeType})}).catch(We=>{T.signal.aborted||(F({kind:"error",message:We instanceof Error&&/timed out/i.test(We.message)?o("rightSidebar.edaTimeout"):We instanceof Error?We.message:o("rightSidebar.edaLoadFailed")}),ze("error",{error:We instanceof Error?We.message:String(We)}))})}else if(Fn)mh(S,T.signal,"view_file",Se).then(K=>{Me=URL.createObjectURL(K.blob),F({kind:"image",objectUrl:Me,meta:{size:K.size,mimeType:K.mimeType,modified:K.modified}}),ze("image_loaded",{bytes:K.size,mimeType:K.mimeType})}).catch(K=>{T.signal.aborted||(F({kind:"error",message:K instanceof Error?K.message:o("rightSidebar.imageLoadFailed")}),ze("error",{error:K instanceof Error?K.message:String(K)}))});else if(cr)gh(S,T.signal,"view_file",Se).then(K=>{T.signal.aborted||(Me=URL.createObjectURL(K.blob),F({kind:"model3d",sourcePath:K.path||S,objectUrl:Me,ext:K.ext,meta:{size:K.size,mimeType:K.mimeType,modified:K.modified}}),ze("model3d_loaded",{bytes:K.size,ext:K.ext}))}).catch(K=>{T.signal.aborted||(F({kind:"error",message:K instanceof Error&&(K.name==="TimeoutError"||/timed out/i.test(K.message))?o("rightSidebar.model3dTimeout"):K instanceof Error?K.message:o("rightSidebar.model3dLoadFailed")}),ze("error",{error:K instanceof Error?K.message:String(K)}))});else if(ys){const K=bh(S)??"",We=$h(S);F(Tt=>Tt.kind==="video"&&Tt.url===We?Tt:{kind:"video",url:We,meta:{size:null,mimeType:K,modified:null}}),ze("video_ready",{mimeType:K})}else ed(S,T.signal,"view_file",Se).then(K=>{if(!T.signal.aborted){if(K.binary){F({kind:"binary"});return}F({kind:"text",content:K.content,sourcePath:K.path||S,meta:{size:K.size,truncated:K.truncated}}),ze("text_loaded",{bytes:K.size,truncated:!!K.truncated})}}).catch(K=>{T.signal.aborted||(F({kind:"error",message:K instanceof Error?K.message:"Failed to read file"}),ze("error",{error:K instanceof Error?K.message:String(K)}))});return()=>{T.abort(),yt(Se),window.clearTimeout(cn),window.clearTimeout(ws),Me&&URL.revokeObjectURL(Me),ze("cleanup")}},[a,G,Mn,Bt,I,o,ee]),n.useEffect(()=>{if(j.kind!=="model3d"||!a){Ne(null);return}let S=!1;const T=a.lastIndexOf("/"),ce=T>=0?a.slice(T+1):a,Se=T>=0?a.slice(0,T):"",Je=Se.lastIndexOf("/"),Te=Je>=0?Se.slice(0,Je):"",ze=ce.replace(/\.(stl|glb|gltf)$/i,""),Me=`${Te?`${Te}/`:""}features/${ze}.json`;return ed(Me).then(Ge=>{if(!S)try{const ot=JSON.parse(Ge.content);Ne(ot.version===1&&Array.isArray(ot.features)&&ot.features.length>0?ot.features:null)}catch{Ne(null)}}).catch(()=>{S||Ne(null)}),()=>{S=!0}},[j,a]),n.useEffect(()=>{if(j.kind!=="text"){Oe(null);return}const S=G&&a&&!a.startsWith("/")?`${G}/${a}`:a,T=yp(S),ce=j.content,Se=Ys(S??"")&&oe==="preview",Je=qs(S??"")&&Ie==="preview";if(!T||Se||Je||!wp(ce)){Oe(null);return}let Te=!1;const ze=Me=>{if(Te||!Me.registered(T)){Te||Oe(null);return}try{Oe(Sp(Me,ce,T))}catch{Oe(null)}};return Ve?ze(Ve):(Oe(null),kp().then(Me=>{Te||(Ae(Me),ze(Me))}).catch(()=>{})),()=>{Te=!0}},[j,Ve,a,G,oe,Ie]),n.useLayoutEffect(()=>{if(!kt||j.kind!=="text")return;const S=`${kt}:${oe}:${Ie}`;if(wr.current===S)return;const T=Kd(G,a);if(wr.current=S,!T)return;const ce=requestAnimationFrame(()=>{const Se=Pe.current;if(!Se)return;const Je=oe==="preview"?T.markdownTop??T.top:T.top;Se.scrollTo({top:Math.max(0,Je??0),left:Math.max(0,T.left??0)}),Be(oe==="preview"?Math.max(0,Je??0):0)});return()=>cancelAnimationFrame(ce)},[a,oe,Ie,j.kind,kt,G]),n.useEffect(()=>{kt&&Ui(G,a,{lineRange:M})},[a,M,kt,G]),n.useEffect(()=>{if(be==null||j.kind!=="text")return;ue(null),I({start:be,end:be});const S=be,T=requestAnimationFrame(()=>{const ce=we.current.get(S);ce&&ce.scrollIntoView({block:"center"}),_?.()});return()=>cancelAnimationFrame(T)},[be,j,I,_]);const Ln=n.useCallback(S=>{const T=Pe.current;if(!T)return!1;const ce=typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(S):S.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),Se=T.querySelector(`#${ce}`);return Se?(Se.scrollIntoView({block:"start"}),!0):!1},[]);n.useEffect(()=>{const S=G&&a&&!a.startsWith("/")?`${G}/${a}`:a,T=j.kind==="text"&&Ys(S??"")&&oe==="preview";if(!Qt||!T)return;const ce=requestAnimationFrame(()=>{Ln(Qt)&&me(null)});return()=>cancelAnimationFrame(ce)},[a,Ln,oe,Qt,j,G]),n.useLayoutEffect(()=>{const S=Pe.current;if(!S||!M){ue(null);return}if(O)return;const T=j.kind==="image"||j.kind==="loading"&&j.mode==="image",ce=G&&a&&!a.startsWith("/")?`${G}/${a}`:a,Se=j.kind==="text"&&Ys(ce??"")&&oe==="preview",Je=j.kind==="text"&&qs(ce??"")&&Ie==="preview";if(j.kind!=="text"||T||Se||Je){ue(null);return}const Te=()=>{const Me=we.current.get(M.end);if(!Me||!S){ue(null);return}const Ge=Me.offsetTop+Me.offsetHeight/2,ot=S.scrollLeft+Math.max(8,S.clientWidth-120);ue({top:Ge,left:ot})};Te();const ze=new ResizeObserver(()=>Te());return ze.observe(S),()=>ze.disconnect()},[M,O,j,oe,Ie,a,G,bt]);const kr=j.kind==="text"&&!(qs(St??"")&&Ie==="preview")&&!St?.toLowerCase().endsWith(".csv")&&!St?.toLowerCase().endsWith(".kicad_pro")&&!St?.toLowerCase().endsWith(".kicad_prl"),In=n.useCallback(()=>{Ze(!1),ir(""),Q([]),Ye(0),oo(W.current)},[]),en=n.useCallback(()=>{!i||!kr||(Ze(!0),requestAnimationFrame(()=>{const S=ae.current;!he.current||!S?.isConnected||S.closest('[inert], [aria-hidden="true"], [hidden]')||S.getClientRects().length===0||getComputedStyle(S).visibility==="hidden"||!S.contains(document.activeElement)||(ht.current?.focus(),ht.current?.select())}))},[i,kr]),_r=n.useCallback(S=>{Ye(T=>N.length===0?0:(T+S+N.length)%N.length)},[N.length]),Ut=n.useCallback(S=>{if(S.nativeEvent.isComposing||!tg(ae.current,i,S))return;const T=rg(S);if(T==="open"&&kr){S.preventDefault(),en();return}ye&&(T==="close"?(S.preventDefault(),In()):(T==="next"||T==="previous")&&(S.preventDefault(),_r(T==="previous"?-1:1)))},[i,In,ye,_r,en,kr]);if(n.useLayoutEffect(()=>{if(oo(W.current),!i||!ye||!wt.trim()||!Pe.current){Q([]),Ye(0);return}const S=sg(Pe.current,wt);return Q(S),Ye(0),(ae.current?.contains(document.activeElement)||Td(W.current))&&(Ii(S,0,W.current),Md(S[0])),()=>oo(W.current)},[i,ye,wt,bt,oe,j]),n.useEffect(()=>{!i||!ye||!wt.trim()||!ae.current?.contains(document.activeElement)&&!Td(W.current)||(Ii(N,ke,W.current),Md(N[ke]))},[i,ke,N,ye,wt]),n.useEffect(()=>()=>oo(W.current),[]),!a)return t.jsx("div",{className:"mx-3 mt-3 overflow-hidden rounded-xl border border-border/15 bg-surface-2 px-4 py-8 text-center text-sm text-muted-foreground",children:o("rightSidebar.selectFilePrompt")});const He=G&&!a.startsWith("/")?`${G}/${a}`:a,Et=ho(He,G),Sr=ru(He,G),Rr=j.kind==="text"&&j.content?j.content.split(`
1639
1639
  `):[],oa=Math.max(2,String(Rr.length).length)+1,jr=j.kind==="text"||j.kind==="image"||j.kind==="model3d"||j.kind==="video"||j.kind==="eda"?j.meta:null,Cr=Ys(He),ia=He.toLowerCase().endsWith(".csv"),At=He.toLowerCase().endsWith(".kicad_pro"),ps=He.toLowerCase().endsWith(".kicad_prl"),Ot=j.kind==="text"&&Cr&&oe==="preview",la=qs(He),Ht=j.kind==="text"&&la&&Ie==="preview",ca=j.kind==="image"||j.kind==="loading"&&j.mode==="image",ko=j.kind==="model3d"||j.kind==="loading"&&j.mode==="model3d",xt=j.kind==="video"||j.kind==="loading"&&j.mode==="video",tn=j.kind==="eda"||j.kind==="loading"&&j.mode==="eda",ms=j.kind==="text"?j.sourcePath:He,Br=xh(ms,G,M),Ur=(()=>{if(!M||j.kind!=="text"||Rr.length===0)return Br;const S=[];for(let Se=M.start;Se<=M.end;Se+=1)S.push(`${Se} ${Rr[Se-1]??""}`);const T=Pu(He).replace(/^\./,""),ce="```";return`${Br}
1640
1640
  ${ce}${T}
1641
1641
  ${S.join(`