@kabmo-labs/kabmo 0.45.1 → 0.46.1

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 (369) hide show
  1. package/dist/client/index.html +1 -1
  2. package/dist/client/index.js +412 -412
  3. package/dist/client/static/js/{CsvGrid-eqmctwyq.js → CsvGrid-qdkmv8bj.js} +2 -2
  4. package/dist/client/static/js/{DocxView-rjrshmzf.js → DocxView-k84ns803.js} +3 -3
  5. package/dist/client/static/js/{DrawioView-za569srw.js → DrawioView-r1n717f7.js} +2 -2
  6. package/dist/client/static/js/ImageView-jkrdrq8v.js +1 -0
  7. package/dist/client/static/js/LayoutWrapper-sh634350.js +2 -0
  8. package/dist/client/static/js/Modal-xe6h99jn.js +59 -0
  9. package/dist/client/static/js/{PdfView-2m78d4jz.js → PdfView-ffg4mccg.js} +1 -1
  10. package/dist/client/static/js/{SessionsView-54awmse0.js → SessionsView-cdcbsee9.js} +1 -1
  11. package/dist/client/static/js/{SheetView-xfvjdh24.js → SheetView-89sscpz6.js} +19 -19
  12. package/dist/client/static/js/{SvgPreview-yfjrfb40.js → SvgPreview-68c0ccbv.js} +1 -1
  13. package/dist/client/static/js/{abnfDiagram-O67JEVCF-tmsa3b36.js → abnfDiagram-O67JEVCF-h3a5s259.js} +1 -1
  14. package/dist/client/static/js/architecture-7GRP2DOG-pvb4d65d.js +1 -0
  15. package/dist/client/static/js/{architectureDiagram-NJMV4G6O-a5effrpz.js → architectureDiagram-NJMV4G6O-983p0jgn.js} +3 -3
  16. package/dist/client/static/js/{astro-56b0as3q.js → astro-hyj5wege.js} +1 -1
  17. package/dist/client/static/js/bash-8d8z8zrg.js +1 -0
  18. package/dist/client/static/js/{blockDiagram-BEXU5L5S-3q2kf22c.js → blockDiagram-BEXU5L5S-16pse5mh.js} +5 -5
  19. package/dist/client/static/js/c-acmn1zc9.js +1 -0
  20. package/dist/client/static/js/{c4Diagram-YGBWAQC7-mkw3jvf6.js → c4Diagram-YGBWAQC7-mvnb00zt.js} +3 -3
  21. package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-fw9bs1za.js → classDiagram-v2-NBCMYWYE-kmpd91xb.js} +7 -7
  22. package/dist/client/static/js/{cose-bilkent-JH36ORCC-eqjrpps4.js → cose-bilkent-JH36ORCC-3ek5r5se.js} +1 -1
  23. package/dist/client/static/js/cpp-620mvjkk.js +1 -0
  24. package/dist/client/static/js/css-bt76kxbq.js +1 -0
  25. package/dist/client/static/js/css-drfs4n12.js +1 -0
  26. package/dist/client/static/js/cynefin-OW5HDTMX-gmx4vean.js +1 -0
  27. package/dist/client/static/js/{cynefinDiagram-VND7K2PF-4w61hq3e.js → cynefinDiagram-VND7K2PF-jkbh84zn.js} +1 -1
  28. package/dist/client/static/js/{dagre-6A5THRUB-t52jdfr1.js → dagre-6A5THRUB-4fdc0sgn.js} +2 -2
  29. package/dist/client/static/js/{diagram-22UHCM2B-448hyxaz.js → diagram-22UHCM2B-hbk61nq9.js} +18 -18
  30. package/dist/client/static/js/{diagram-3UASUU5V-350k213a.js → diagram-3UASUU5V-hfpbr9qh.js} +1 -1
  31. package/dist/client/static/js/{diagram-ATOU4E4O-9davjeyb.js → diagram-ATOU4E4O-fn0nt71a.js} +3 -3
  32. package/dist/client/static/js/{diagram-CDSNMT55-034wwghk.js → diagram-CDSNMT55-ssswxjeb.js} +4 -4
  33. package/dist/client/static/js/{diagram-MLGK6HIB-kzzd4ecm.js → diagram-MLGK6HIB-whnzxv6f.js} +2 -2
  34. package/dist/client/static/js/{diagram-MPIPVDR6-rsky4e3s.js → diagram-MPIPVDR6-hk1chzxk.js} +2 -2
  35. package/dist/client/static/js/{dockerfile-68b0e6b6.js → dockerfile-zmsj8r4g.js} +1 -1
  36. package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-7bm1e394.js → ebnfDiagram-ZINNZB2B-q1vkg5mr.js} +1 -1
  37. package/dist/client/static/js/{elixir-12pgbgtq.js → elixir-80wq7gak.js} +1 -1
  38. package/dist/client/static/js/{elk-276RUBZZ-4xjp4rgh.js → elk-276RUBZZ-kt98vg8j.js} +1 -1
  39. package/dist/client/static/js/{erDiagram-OPXOYQCR-v52qmcrv.js → erDiagram-OPXOYQCR-ey3avsn9.js} +9 -9
  40. package/dist/client/static/js/{erlang-811btv6p.js → erlang-814e8qy5.js} +1 -1
  41. package/dist/client/static/js/eventmodeling-NTZA5JFV-vrnheyh7.js +1 -0
  42. package/dist/client/static/js/flowDiagram-KWPJA3E3-7gvtpn3d.js +1 -0
  43. package/dist/client/static/js/{ganttDiagram-FUAMR5RP-1r1fn18p.js → ganttDiagram-FUAMR5RP-a9k1at43.js} +4 -4
  44. package/dist/client/static/js/gitGraph-4MIJSDKK-n6wnc8st.js +1 -0
  45. package/dist/client/static/js/{gitGraphDiagram-X574FWY7-zt5cwg83.js → gitGraphDiagram-X574FWY7-gnekjfym.js} +13 -13
  46. package/dist/client/static/js/graphql-j1a6zp7m.js +1 -0
  47. package/dist/client/static/js/html-m0megrvb.js +1 -0
  48. package/dist/client/static/js/{index-qt9jc4ck.js → index-19x11s5w.js} +2 -2
  49. package/dist/client/static/js/{index-0gmw2bt3.js → index-1ax52p0q.js} +2 -2
  50. package/dist/client/static/js/{index-2b1wnvez.js → index-1c2jvnyh.js} +2 -2
  51. package/dist/client/static/js/index-2a6qp9y6.js +2 -0
  52. package/dist/client/static/js/{index-gcwmpfr4.js → index-2ks0m8ss.js} +2 -2
  53. package/dist/client/static/js/{index-pfj3sd1n.js → index-33qxg79j.js} +7 -7
  54. package/dist/client/static/js/{index-bcpyxt97.js → index-3x7h2eqj.js} +2 -2
  55. package/dist/client/static/js/{index-q36gq3yz.js → index-4cag7w6k.js} +198 -198
  56. package/dist/client/static/js/{index-03j5j1j0.js → index-561gkvve.js} +2 -2
  57. package/dist/client/static/js/{index-m9s7r4z9.js → index-5ka2tyf9.js} +3 -3
  58. package/dist/client/static/js/{index-f51jxezc.js → index-5wz0y88c.js} +2 -2
  59. package/dist/client/static/js/{index-frqq7yen.js → index-60v30k5h.js} +64 -64
  60. package/dist/client/static/js/{index-x2wvq4ae.js → index-64sqfr4a.js} +2 -2
  61. package/dist/client/static/js/{index-xgv501v0.js → index-65afr75v.js} +2 -2
  62. package/dist/client/static/js/index-83rkg916.js +2 -0
  63. package/dist/client/static/js/{index-ga6492qc.js → index-84fyq5a6.js} +1 -1
  64. package/dist/client/static/js/{index-2tmnqqzt.js → index-8g7q8mz4.js} +3 -3
  65. package/dist/client/static/js/{index-mnh8nptt.js → index-9vv7wr1n.js} +2 -2
  66. package/dist/client/static/js/{index-gzafyqsr.js → index-abs635a1.js} +56 -56
  67. package/dist/client/static/js/{index-j50y0z44.js → index-amsa0tfs.js} +1 -1
  68. package/dist/client/static/js/index-atq9q1s7.js +1 -0
  69. package/dist/client/static/js/{index-8ps5gdwz.js → index-b2e5pwx7.js} +5 -5
  70. package/dist/client/static/js/{index-cza9mnxx.js → index-b5dfvget.js} +6 -6
  71. package/dist/client/static/js/{index-zwx3vbf0.js → index-bsr7wmj2.js} +1 -1
  72. package/dist/client/static/js/{index-ex3w7t7s.js → index-c9e417cs.js} +2 -2
  73. package/dist/client/static/js/{index-fbct0jcf.js → index-d23eacf2.js} +2 -2
  74. package/dist/client/static/js/{index-wqrdgt1g.js → index-dn7hg4em.js} +2 -2
  75. package/dist/client/static/js/index-dpy3ewrn.css +1 -0
  76. package/dist/client/static/js/index-dt6q3rws.js +12 -0
  77. package/dist/client/static/js/{index-3h2mr90j.js → index-dxvtjn6a.js} +2 -2
  78. package/dist/client/static/js/{index-127se1a3.js → index-e9cxje00.js} +19 -19
  79. package/dist/client/static/js/{index-6sqmhdyv.js → index-fj5rsp5v.js} +2 -2
  80. package/dist/client/static/js/{index-c7vbr57m.js → index-fzngzhww.js} +2 -2
  81. package/dist/client/static/js/{index-n1ga63de.js → index-g7s0wsag.js} +2 -2
  82. package/dist/client/static/js/{index-x0kgnkv3.js → index-hgzntg2j.js} +2 -2
  83. package/dist/client/static/js/{index-jaqjvk22.js → index-hkz2mz34.js} +2 -2
  84. package/dist/client/static/js/{index-gzp4j2h5.js → index-hnb66d3s.js} +2 -2
  85. package/dist/client/static/js/{index-9zwtpazh.js → index-kb14dhrx.js} +2 -2
  86. package/dist/client/static/js/{index-snjtkfkq.js → index-kbhrvep8.js} +6 -6
  87. package/dist/client/static/js/{index-vgcm2g0g.js → index-kty4ncsr.js} +2 -2
  88. package/dist/client/static/js/index-m4k054wz.js +4 -0
  89. package/dist/client/static/js/{index-pxq4v81r.js → index-nw5mvcaj.js} +2 -2
  90. package/dist/client/static/js/index-pavvxrsz.js +1 -0
  91. package/dist/client/static/js/index-q9ytjey8.js +1 -0
  92. package/dist/client/static/js/{index-8dtp7mt0.js → index-qf3y3ahx.js} +2 -2
  93. package/dist/client/static/js/{index-as1wptfa.js → index-qfxn7yh5.js} +2 -2
  94. package/dist/client/static/js/{index-e6any867.js → index-sa1675y0.js} +2 -2
  95. package/dist/client/static/js/{index-ehg2ftnp.js → index-trvqvb1v.js} +2 -2
  96. package/dist/client/static/js/{index-1nwwvv29.js → index-vjmg7kn5.js} +2 -2
  97. package/dist/client/static/js/index-vkqb4dnt.js +1 -0
  98. package/dist/client/static/js/{index-nzhwd6t3.js → index-wbws16ag.js} +2 -2
  99. package/dist/client/static/js/{index-528x5x8c.js → index-wrcdc9vz.js} +1 -1
  100. package/dist/client/static/js/{index-2zntn964.js → index-x9r7zfp4.js} +2 -2
  101. package/dist/client/static/js/{index-mhnwyra0.js → index-xq5f3nxa.js} +2 -2
  102. package/dist/client/static/js/index-xwjbq003.js +2 -0
  103. package/dist/client/static/js/{index-2gbfke1a.js → index-yf93db65.js} +1 -1
  104. package/dist/client/static/js/{index-tkfxnnr5.js → index-ykm7a3cp.js} +2 -2
  105. package/dist/client/static/js/{index-t0yv1375.js → index-z0fkfphe.js} +2 -2
  106. package/dist/client/static/js/{index-84vmdg3k.js → index-z25ss7xj.js} +1 -1
  107. package/dist/client/static/js/{index-dmv2zasz.js → index-z4530r3c.js} +2 -2
  108. package/dist/client/static/js/info-A6RAGUB7-1xtdxjz2.js +1 -0
  109. package/dist/client/static/js/{infoDiagram-VRGFBTTK-yd4zwrtv.js → infoDiagram-VRGFBTTK-r1p25738.js} +2 -2
  110. package/dist/client/static/js/ini-5f4zqtqr.js +1 -0
  111. package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-7sjp09d4.js → ishikawaDiagram-OU5B5YK6-afgrqdrt.js} +3 -3
  112. package/dist/client/static/js/java-jj41mty3.js +1 -0
  113. package/dist/client/static/js/javascript-n9w9p97f.js +1 -0
  114. package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-qh9jk7qk.js → journeyDiagram-ZHPQQLJL-hepa4wk7.js} +5 -5
  115. package/dist/client/static/js/json-rnh2h17x.js +1 -0
  116. package/dist/client/static/js/jsx-4gecrt29.js +1 -0
  117. package/dist/client/static/js/{julia-mgsev9df.js → julia-yv2j8qd0.js} +1 -1
  118. package/dist/client/static/js/{kanban-definition-PNTS6WVX-cjc8k0jk.js → kanban-definition-PNTS6WVX-jysft8ya.js} +5 -5
  119. package/dist/client/static/js/lua-zszaw2f7.js +1 -0
  120. package/dist/client/static/js/markdown-nm6gw4v4.js +1 -0
  121. package/dist/client/static/js/{mermaid.core-vw0b7r0k.js → mermaid.core-0m90b0s8.js} +7 -7
  122. package/dist/client/static/js/{mindmap-definition-NLK3R4M7-jyhtpt1z.js → mindmap-definition-NLK3R4M7-x2rrzpvr.js} +8 -8
  123. package/dist/client/static/js/one-dark-pro-09d8p5vy.js +1 -0
  124. package/dist/client/static/js/one-light-g3ednt6p.js +1 -0
  125. package/dist/client/static/js/packet-AYTQ26CC-zm1r82x5.js +1 -0
  126. package/dist/client/static/js/{pegDiagram-GJSIUBJH-80ygdd29.js → pegDiagram-GJSIUBJH-z7vb7f1z.js} +1 -1
  127. package/dist/client/static/js/{perl-6n93vjsa.js → perl-917pjq5a.js} +1 -1
  128. package/dist/client/static/js/{php-w23nmbtc.js → php-hwz75qzt.js} +1 -1
  129. package/dist/client/static/js/pie-WAS4IAKB-sqa7321j.js +1 -0
  130. package/dist/client/static/js/{pieDiagram-5QR66LMP-6vgh7ntn.js → pieDiagram-5QR66LMP-jqv6v4e6.js} +3 -3
  131. package/dist/client/static/js/properties-rkptax7r.js +1 -0
  132. package/dist/client/static/js/python-qf1se1mj.js +1 -0
  133. package/dist/client/static/js/{quadrantDiagram-O4NWA36T-k5byajmm.js → quadrantDiagram-O4NWA36T-w2h8yxrv.js} +6 -6
  134. package/dist/client/static/js/r-ms0cygq2.js +1 -0
  135. package/dist/client/static/js/radar-RG4KPBEZ-z3z82syp.js +1 -0
  136. package/dist/client/static/js/railroad-74A4TZTK-z6swcqq2.js +1 -0
  137. package/dist/client/static/js/railroad-abnf-HS5TGJTU-33km6py4.js +1 -0
  138. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-1zbf1xmq.js +1 -0
  139. package/dist/client/static/js/railroad-peg-WCYAUIDC-wte1xzzy.js +1 -0
  140. package/dist/client/static/js/{railroadDiagram-XR7U4H2S-qffrkk7g.js → railroadDiagram-XR7U4H2S-nd09yac3.js} +1 -1
  141. package/dist/client/static/js/{requirementDiagram-PLB6GJNP-r80w7tdp.js → requirementDiagram-PLB6GJNP-t61zxh5v.js} +10 -10
  142. package/dist/client/static/js/{ruby-ag3b3t9t.js → ruby-er7ayhte.js} +1 -1
  143. package/dist/client/static/js/{rust-a9jcfy2e.js → rust-avnkhh0p.js} +1 -1
  144. package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-g9qdy74b.js → sankeyDiagram-IPEJSGJF-2f7h2cmw.js} +4 -4
  145. package/dist/client/static/js/{sass-x0eez0kp.js → sass-n47tt136.js} +1 -1
  146. package/dist/client/static/js/{scss-qycakpjn.js → scss-kvev49ga.js} +1 -1
  147. package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-nywg1eq3.js → sequenceDiagram-PO4LG4MO-kfb5d7zd.js} +19 -19
  148. package/dist/client/static/js/{sizeCapture-INFHLROL-m5pks027.js → sizeCapture-INFHLROL-amfg19se.js} +1 -1
  149. package/dist/client/static/js/sql-hd42h8wx.js +1 -0
  150. package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-xzzv780w.js → stateDiagram-v2-GCMORJYK-k5hx7btx.js} +3 -3
  151. package/dist/client/static/js/{svelte-tg19by0f.js → svelte-2pmz35vx.js} +1 -1
  152. package/dist/client/static/js/{swimlanes-2SLR337P-n4q5ad13.js → swimlanes-2SLR337P-wv3rp8kk.js} +1 -1
  153. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-6y8zdbm4.js +8 -0
  154. package/dist/client/static/js/{timeline-definition-EJHVYXUP-j9pde7sa.js → timeline-definition-EJHVYXUP-0re95wtn.js} +6 -6
  155. package/dist/client/static/js/treeView-Q6P3EWNA-pvgx6n22.js +1 -0
  156. package/dist/client/static/js/treemap-WGGIJYW6-3n9zm628.js +1 -0
  157. package/dist/client/static/js/tsx-gx7td06z.js +1 -0
  158. package/dist/client/static/js/typescript-1a808spn.js +1 -0
  159. package/dist/client/static/js/{usecaseDiagram-POWQR4AR-ehnc0600.js → usecaseDiagram-POWQR4AR-yrje14qp.js} +44 -44
  160. package/dist/client/static/js/{vennDiagram-UO4OBE2U-cp4kj6kw.js → vennDiagram-UO4OBE2U-jxkmrfy5.js} +7 -7
  161. package/dist/client/static/js/{vue-mhj4sme0.js → vue-d5gpjfgn.js} +1 -1
  162. package/dist/client/static/js/wardley-WFR3VGLG-7m07ewc4.js +1 -0
  163. package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-eegf1jpw.js → wardleyDiagram-VNRHLVJA-d3v2m9b1.js} +3 -3
  164. package/dist/client/static/js/xml-3117mxd9.js +1 -0
  165. package/dist/client/static/js/{xychartDiagram-PMCCYNJV-zkkqfyex.js → xychartDiagram-PMCCYNJV-9a1s1rjt.js} +5 -5
  166. package/dist/client/static/js/yaml-dmvh8vyt.js +1 -0
  167. package/extensions/kabmo-modes/index.ts +1 -1
  168. package/extensions/kabmo-modes/parked.test.ts +2 -2
  169. package/extensions/kabmo-modes/parked.ts +10 -9
  170. package/extensions/kabmo-modes/plan.test.ts +4 -4
  171. package/extensions/kabmo-modes/plan.ts +6 -6
  172. package/extensions/kabmo-modes/session.ts +2 -2
  173. package/package.json +1 -1
  174. package/src/client/components/common/FolderPicker.tsx +1 -1
  175. package/src/client/components/common/Modal.tsx +8 -3
  176. package/src/client/components/common/NotificationPermissionDialog.test.tsx +8 -3
  177. package/src/client/components/common/NotificationPermissionDialog.tsx +7 -9
  178. package/src/client/components/common/PWAInstallButton.tsx +1 -1
  179. package/src/client/components/common/header-panel-buttons/index.tsx +5 -1
  180. package/src/client/components/common/shell-update-button/Modal.tsx +31 -36
  181. package/src/client/components/common/shell-update-button/index.test.tsx +5 -2
  182. package/src/client/components/layout/desktop-layout/LeftColumn.tsx +16 -0
  183. package/src/client/components/layout/desktop-layout/RightColumn.test.tsx +204 -0
  184. package/src/client/components/layout/desktop-layout/RightColumn.tsx +52 -15
  185. package/src/client/components/layout/session-sidebar/OverflowMenu.tsx +1 -1
  186. package/src/client/components/layout/session-sidebar/about-modal/index.tsx +4 -6
  187. package/src/client/components/layout/session-sidebar/new-workspace-modal/index.tsx +1 -1
  188. package/src/client/components/layout/session-sidebar/scheduler-modal/index.tsx +1 -1
  189. package/src/client/components/mobile/LayoutWrapper.tsx +9 -43
  190. package/src/client/components/mobile/RightSidebar.tsx +31 -12
  191. package/src/client/components/mobile/SessionSidebar.tsx +112 -137
  192. package/src/client/components/mobile/drawer-strip.tsx +85 -0
  193. package/src/client/components/mobile/left-drawer-nav.test.tsx +350 -0
  194. package/src/client/components/mobile/mobile-drawer-reveals.test.tsx +194 -0
  195. package/src/client/components/mobile/mobile-drawer-reveals.ts +138 -0
  196. package/src/client/components/mobile/mobile-main-view/Header.tsx +12 -24
  197. package/src/client/components/mobile/mobile-right-sidebar/Action.tsx +57 -0
  198. package/src/client/components/mobile/mobile-right-sidebar/Chrome.tsx +14 -87
  199. package/src/client/components/mobile/mobile-right-sidebar/FullDiff.tsx +2 -7
  200. package/src/client/components/mobile/mobile-right-sidebar/Header.test.tsx +157 -0
  201. package/src/client/components/mobile/mobile-right-sidebar/Header.tsx +109 -105
  202. package/src/client/components/mobile/mobile-right-sidebar/OutlineButton.tsx +1 -1
  203. package/src/client/components/mobile/mobile-right-sidebar/Overflow.tsx +95 -0
  204. package/src/client/components/mobile/mobile-session-sidebar/Body.tsx +212 -0
  205. package/src/client/components/mobile/mobile-session-sidebar/Header.tsx +7 -9
  206. package/src/client/components/mobile/mobile-session-sidebar/Toolbar.tsx +2 -2
  207. package/src/client/components/mobile/mobile-session-sidebar/use-dock.ts +29 -8
  208. package/src/client/components/mobile/mobile-session-sidebar/use-drawer-tabs.ts +97 -0
  209. package/src/client/components/settings/Band.test.tsx +83 -0
  210. package/src/client/components/settings/Band.tsx +96 -0
  211. package/src/client/components/settings/Modal.tsx +44 -69
  212. package/src/client/components/settings/apply-side-effects.ts +15 -4
  213. package/src/client/components/settings/band-height.test.tsx +16 -3
  214. package/src/client/components/settings/categories/AppearanceSettings.test.tsx +35 -9
  215. package/src/client/components/settings/categories/AppearanceSettings.tsx +2 -0
  216. package/src/client/components/settings/categories/ChatSettings.test.tsx +32 -9
  217. package/src/client/components/settings/categories/ChatSettings.tsx +2 -0
  218. package/src/client/components/settings/categories/NotificationSettings.tsx +1 -1
  219. package/src/client/components/settings/categories/appearance-settings/PanelNavSection.tsx +40 -223
  220. package/src/client/components/settings/categories/appearance-settings/nav-choice.tsx +176 -0
  221. package/src/client/components/settings/categories/appearance-settings/nav-miniatures.tsx +93 -0
  222. package/src/client/components/settings/categories/connect-settings/PairDialog.tsx +1 -1
  223. package/src/client/components/settings/categories/mcp-settings/ImportModal.tsx +1 -1
  224. package/src/client/components/settings/categories/notification-settings/PermissionNotice.tsx +1 -1
  225. package/src/client/components/settings/categories/provider-settings/DeleteProviderModal.tsx +1 -1
  226. package/src/client/components/settings/categories/provider-settings/LogoutProviderModal.tsx +1 -1
  227. package/src/client/components/settings/drill.tsx +113 -0
  228. package/src/client/components/settings/master-detail/GroupDetail.tsx +14 -6
  229. package/src/client/components/settings/master-detail/GroupSidebar.tsx +9 -1
  230. package/src/client/components/settings/master-detail/index.tsx +45 -25
  231. package/src/client/components/workspace/chat-timeline/MessageList.test.ts +11 -0
  232. package/src/client/components/workspace/chat-timeline/MessageList.tsx +29 -21
  233. package/src/client/components/workspace/chat-timeline/MobileTurnJump.tsx +1 -1
  234. package/src/client/components/workspace/chat-timeline/NewChatModal.tsx +1 -1
  235. package/src/client/components/workspace/chat-timeline/SystemNotice.tsx +4 -0
  236. package/src/client/components/workspace/chat-timeline/ToolCallingSection.test.ts +23 -6
  237. package/src/client/components/workspace/chat-timeline/UndoConfirmModal.tsx +1 -1
  238. package/src/client/components/workspace/chat-timeline/chat-input/AttachmentToolbar.tsx +19 -2
  239. package/src/client/components/workspace/chat-timeline/chat-input/GoalModal.tsx +1 -1
  240. package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.tsx +1 -1
  241. package/src/client/components/workspace/chat-timeline/index.tsx +5 -9
  242. package/src/client/components/workspace/chat-timeline/plan-review/index.tsx +1 -1
  243. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FormAsk.test.tsx +4 -4
  244. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FormDialog.test.tsx +127 -0
  245. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FormDialog.tsx +225 -0
  246. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OrphanAsks.test.tsx +5 -4
  247. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OrphanAsks.tsx +1 -1
  248. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/PluginPendingInteractions.test.ts +2 -2
  249. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/index.test.ts +4 -3
  250. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/index.tsx +40 -4
  251. package/src/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/Footer.tsx +1 -1
  252. package/src/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/index.tsx +1 -1
  253. package/src/client/components/workspace/chat-timeline/tool-renderers/index.tsx +5 -1
  254. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/AstEdit.tsx +8 -3
  255. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Lsp.tsx +5 -0
  256. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Mcp.tsx +16 -7
  257. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Resolve.tsx +16 -4
  258. package/src/client/components/workspace/chat-timeline/tool-renderers/registry.ts +37 -12
  259. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/card-header.ts +4 -3
  260. package/src/client/components/workspace/diff-panel/index.tsx +1 -1
  261. package/src/client/components/workspace/editor/SaveDeletedFileModal.tsx +1 -1
  262. package/src/client/components/workspace/file-explorer/ArchiveModals.tsx +1 -1
  263. package/src/client/components/workspace/file-explorer/Modals.tsx +4 -4
  264. package/src/client/components/workspace/git-panel/Modals.tsx +1 -1
  265. package/src/client/components/workspace/model-dropdown/CloseButton.tsx +38 -0
  266. package/src/client/components/workspace/model-dropdown/Fullscreen.tsx +16 -25
  267. package/src/client/components/workspace/model-dropdown/HarnessTabs.tsx +30 -9
  268. package/src/client/components/workspace/model-dropdown/Header.tsx +33 -21
  269. package/src/client/components/workspace/model-dropdown/Panel.tsx +19 -4
  270. package/src/client/components/workspace/model-dropdown/picker-close.test.tsx +139 -0
  271. package/src/client/components/workspace/model-dropdown/placement.test.tsx +9 -7
  272. package/src/client/components/workspace/terminal-panel/RealtimeTerminalView.tsx +1 -1
  273. package/src/client/components/workspace/wiki-panel/NavModal.tsx +1 -1
  274. package/src/client/data/settings/omp-schema.json +103 -42
  275. package/src/client/hooks/chat/timeline/ask-form-frame.ts +33 -0
  276. package/src/client/hooks/chat/timeline/ask-frame-asks.ts +68 -0
  277. package/src/client/hooks/chat/timeline/ask-frame-buckets.ts +77 -0
  278. package/src/client/hooks/chat/timeline/ask-frames-context.ts +68 -0
  279. package/src/client/hooks/chat/timeline/ask-frames-form.test.ts +170 -0
  280. package/src/client/hooks/chat/timeline/ask-frames.test.ts +1 -1
  281. package/src/client/hooks/chat/timeline/ask-frames.ts +36 -93
  282. package/src/client/hooks/chat/timeline/row-measure.ts +75 -0
  283. package/src/client/hooks/chat/timeline/row-window.test.ts +41 -21
  284. package/src/client/hooks/chat/timeline/row-window.ts +6 -24
  285. package/src/client/hooks/workspace/left-dock.ts +19 -0
  286. package/src/client/hooks/workspace/mobile-panel-nav.ts +90 -0
  287. package/src/client/hooks/workspace/panel-nav.test.ts +42 -21
  288. package/src/client/hooks/workspace/panel-tabs-reveal.test.tsx +286 -0
  289. package/src/client/hooks/workspace/panel-tabs-reveal.ts +174 -0
  290. package/src/client/hooks/workspace/panel-tabs.ts +22 -4
  291. package/src/client/hooks/workspace/session-state/index.test.tsx +145 -0
  292. package/src/client/hooks/workspace/session-state/index.ts +28 -16
  293. package/src/client/lib/ui/phone-row.test.ts +52 -0
  294. package/src/client/lib/ui/phone-row.ts +71 -0
  295. package/src/client/press-state.test.ts +179 -0
  296. package/src/client/tailwind.css +146 -0
  297. package/src/server/lib/bundler/titlebar-css.test.ts +10 -1
  298. package/src/server/lib/omp/rpc/constants.test.ts +6 -1
  299. package/src/shared/lib/chat/ask-form/data.ts +155 -0
  300. package/src/shared/lib/chat/ask-form/fields.ts +4 -0
  301. package/src/shared/lib/chat/ask-form/index.ts +8 -0
  302. package/src/shared/lib/chat/ask-form/types.ts +12 -0
  303. package/src/shared/lib/chat/timeline/tool-verbs.ts +28 -1
  304. package/src/shared/lib/chat/tool/tool-commands.test.ts +102 -0
  305. package/src/shared/lib/chat/tool/tool-commands.ts +124 -0
  306. package/src/shared/lib/omp/config/schema-releases.test.ts +34 -1
  307. package/src/shared/lib/omp/dialog-methods.ts +6 -0
  308. package/src/shared/lib/omp/session/wait-idle.ts +7 -3
  309. package/src/shared/lib/settings/defaults.ts +3 -2
  310. package/src/shared/lib/workspace/panel-nav.test.ts +26 -19
  311. package/src/shared/lib/workspace/panel-nav.ts +20 -9
  312. package/src/shared/types/omp/agent.ts +20 -3
  313. package/src/shared/types/settings/state.ts +17 -5
  314. package/dist/client/static/js/ImageView-6ksvyzqv.js +0 -1
  315. package/dist/client/static/js/LayoutWrapper-px60417t.js +0 -2
  316. package/dist/client/static/js/Modal-yv1718s1.js +0 -59
  317. package/dist/client/static/js/architecture-7GRP2DOG-bch3nye9.js +0 -1
  318. package/dist/client/static/js/bash-mevzaywf.js +0 -1
  319. package/dist/client/static/js/c-y1y6v00q.js +0 -1
  320. package/dist/client/static/js/cpp-wk9z0c5g.js +0 -1
  321. package/dist/client/static/js/css-3w3p9s67.js +0 -1
  322. package/dist/client/static/js/css-g85rwzty.js +0 -1
  323. package/dist/client/static/js/cynefin-OW5HDTMX-vqy5jtnk.js +0 -1
  324. package/dist/client/static/js/eventmodeling-NTZA5JFV-65ph4s3m.js +0 -1
  325. package/dist/client/static/js/flowDiagram-KWPJA3E3-hekt0qsb.js +0 -1
  326. package/dist/client/static/js/gitGraph-4MIJSDKK-t45ekjb6.js +0 -1
  327. package/dist/client/static/js/graphql-027z8sc0.js +0 -1
  328. package/dist/client/static/js/html-fqda6wxx.js +0 -1
  329. package/dist/client/static/js/index-252br0k2.js +0 -1
  330. package/dist/client/static/js/index-6bm4pw90.css +0 -1
  331. package/dist/client/static/js/index-80qxk9hx.js +0 -1
  332. package/dist/client/static/js/index-9674dxb4.js +0 -1
  333. package/dist/client/static/js/index-9k4121z4.js +0 -4
  334. package/dist/client/static/js/index-b6454rme.js +0 -12
  335. package/dist/client/static/js/index-ck0fd3aj.js +0 -2
  336. package/dist/client/static/js/index-jdf1tks1.js +0 -2
  337. package/dist/client/static/js/index-q58e8x6j.js +0 -1
  338. package/dist/client/static/js/info-A6RAGUB7-mw29xbwf.js +0 -1
  339. package/dist/client/static/js/ini-3cx6tmv4.js +0 -1
  340. package/dist/client/static/js/java-zs6qh1dm.js +0 -1
  341. package/dist/client/static/js/javascript-b9mkygak.js +0 -1
  342. package/dist/client/static/js/json-qn73s8xb.js +0 -1
  343. package/dist/client/static/js/jsx-gahhfczw.js +0 -1
  344. package/dist/client/static/js/lua-d8enp14s.js +0 -1
  345. package/dist/client/static/js/markdown-qetaj4vp.js +0 -1
  346. package/dist/client/static/js/one-dark-pro-axkq0m3s.js +0 -1
  347. package/dist/client/static/js/one-light-pncb08qd.js +0 -1
  348. package/dist/client/static/js/packet-AYTQ26CC-md85wpjq.js +0 -1
  349. package/dist/client/static/js/pie-WAS4IAKB-4grcqnp8.js +0 -1
  350. package/dist/client/static/js/properties-g6tpq003.js +0 -1
  351. package/dist/client/static/js/python-cy06fzhg.js +0 -1
  352. package/dist/client/static/js/r-vw8berfv.js +0 -1
  353. package/dist/client/static/js/radar-RG4KPBEZ-7j9prhg1.js +0 -1
  354. package/dist/client/static/js/railroad-74A4TZTK-g8x2jps1.js +0 -1
  355. package/dist/client/static/js/railroad-abnf-HS5TGJTU-cbg7k68h.js +0 -1
  356. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-xfvjk9f8.js +0 -1
  357. package/dist/client/static/js/railroad-peg-WCYAUIDC-7w97805z.js +0 -1
  358. package/dist/client/static/js/sql-bwnasywx.js +0 -1
  359. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-253nz20y.js +0 -8
  360. package/dist/client/static/js/treeView-Q6P3EWNA-xhf1r6c3.js +0 -1
  361. package/dist/client/static/js/treemap-WGGIJYW6-4n3j7ekq.js +0 -1
  362. package/dist/client/static/js/tsx-3dzv8h6k.js +0 -1
  363. package/dist/client/static/js/typescript-44vs0wn4.js +0 -1
  364. package/dist/client/static/js/wardley-WFR3VGLG-fb0py35r.js +0 -1
  365. package/dist/client/static/js/xml-yvv5fn3k.js +0 -1
  366. package/dist/client/static/js/yaml-avewh7n5.js +0 -1
  367. package/src/client/hooks/workspace/mobile-right-panel-nav.ts +0 -63
  368. package/src/shared/lib/ui/safe-area.test.ts +0 -28
  369. package/src/shared/lib/ui/safe-area.ts +0 -42
@@ -0,0 +1,4 @@
1
+ import{d,n,o,K,i,u,a,le,e,s,E,ne,De,Ee,m,L,_,at,Ze,f,B,se,ot,On,Vt,pn,me,qe,wo,zn,ci,Br,Ca,P,D,U,Xn,b,x,Ag,Ie,Xr,qp,it,ue,Z,ut,be,Et,Qt,Rt,ta,Ke,tt,un,Ya,ra,pl,Th,Ve,fs,Qm,dd,Mc,Ta,Rm,Qo,Ro,Fo,It,Fm,gs,As,Pc,Dh,Nh,Lm,hs,Lo,Mo,Mm,Po,Pm,Qh,Om,Rh,$m,zm,Um,Fh,Gm,fl,$e,bs,gl,jm,md,Lh,Oc,fd,qm}from"./index-4cag7w6k.js";var Gn={name:"arrow-up-down",size:24,node:[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]},_s=s(Gn);var Kn={name:"calendar",size:24,node:[["path",{d:"M8 2v3",key:"1ioesn"}],["path",{d:"M16 2v3",key:"otl347"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}],["path",{d:"M3 9h18",key:"1pudct"}]]},Qa=s(Kn);var jn={name:"check-check",size:24,node:[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]},ft=s(jn);var Zn={name:"list-checks",size:24,node:[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]]},Fr=s(Zn);async function Yn(t){let r=await t.json().catch(()=>null);if(!t.ok||!r||r.error)return null;return{tasks:r.tasks??[],serverTimeZone:r.serverTimeZone??""}}function ht(t){let[r,l]=n([]),[c,p]=n(""),[h,g]=n(!1),[v,S]=n(null),y=a(async()=>{g(!0);try{let R=await Yn(await fetch("/api/schedule"));if(R){if(l(R.tasks),R.serverTimeZone)p(R.serverTimeZone);S(null)}else S("Could not load scheduled tasks.")}catch(R){S(R instanceof Error?R.message:String(R))}finally{g(!1)}},[]),N=Ie(Ag,{enabled:t});o(()=>{if(!N.data)return;if(l(N.data.tasks),N.data.serverTimeZone)p(N.data.serverTimeZone);g(!1),S(null)},[N.data]);let w=a(async(R,A)=>{try{let O=await fetch(R,A),M=await O.json().catch(()=>null);if(!O.ok||!M||M.error){let q=M?.error??`HTTP ${O.status}`;return S(q),q}if(M.tasks)l(M.tasks);return S(null),null}catch(O){let M=O instanceof Error?O.message:String(O);return S(M),M}},[]),C=a(async(R)=>await w("/api/schedule",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(R)}),[w]),T=a(async(R,A)=>w(`/api/schedule?id=${encodeURIComponent(R)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(A)}),[w]),k=a(async(R)=>w(`/api/schedule?id=${encodeURIComponent(R)}`,{method:"DELETE"}),[w]),I=a(async(R)=>await w(`/api/schedule?id=${encodeURIComponent(R)}&run=now`,{method:"POST"}),[w]),F=a(async(R)=>{try{let A=await fetch(`/api/schedule/${encodeURIComponent(R)}/runs`),O=await A.json().catch(()=>null);return A.ok?O?.runs??[]:[]}catch{return[]}},[]);return{tasks:r,serverTimeZone:c,loading:h,error:v,refresh:y,create:C,patch:T,remove:k,runNow:I,loadRuns:F}}function yu(){let t=Ie(Ag);return u(()=>(t.data?.tasks??[]).filter((r)=>r.enabled).length,[t.data])}var gt=new Map;function xt(t){let r=gt.get(t);if(!r)r=new Intl.DateTimeFormat("en-US",{timeZone:t,hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}),gt.set(t,r);return r}function St(t){if(!t)return!1;try{return xt(t),!0}catch{return!1}}function kt(){return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}function Pe(t,r){let l=xt(r).formatToParts(new Date(t)),c=(p)=>{let h=l.find((g)=>g.type===p);return h?Number(h.value):0};return{year:c("year"),month:c("month"),day:c("day"),hour:c("hour"),minute:c("minute"),second:c("second")}}function bt(t,r){let l=Pe(t,r);return Date.UTC(l.year,l.month-1,l.day,l.hour,l.minute,l.second)-Math.floor(t/1000)*1000}function et(t,r,l,c,p,h){let g=Date.UTC(t,r-1,l,c,p),v=bt(g,h),S=g-v,y=bt(S,h);if(y!==v)S=g-y;let N=Pe(S,h);if(N.year!==t||N.month!==r||N.day!==l||N.hour!==c||N.minute!==p)return null;return S}var Vn=60000,qn={s:1000,sec:1000,secs:1000,second:1000,seconds:1000,m:60000,min:60000,mins:60000,minute:60000,minutes:60000,h:3600000,hr:3600000,hrs:3600000,hour:3600000,hours:3600000,d:86400000,day:86400000,days:86400000,w:604800000,week:604800000,weeks:604800000};function vt(t){let r=t.trim().toLowerCase();if(!r)return null;if(/^\d+(\.\d+)?$/.test(r)){let h=Number(r);return h>0?Math.round(h*60000):null}let l=r.match(/(\d+(?:\.\d+)?)\s*([a-z]+)/g);if(!l)return null;if(l.join("").replace(/\s+/g,"").length!==r.replace(/\s+/g,"").length)return null;let p=0;for(let h of l){let g=h.match(/^(\d+(?:\.\d+)?)\s*([a-z]+)$/);if(!g)return null;let v=qn[g[2]];if(!v)return null;p+=Number(g[1])*v}return p>0?Math.round(p):null}var Jn=[[0,59],[0,23],[1,31],[1,12],[0,7]];function Qn(t,r,l){let c=new Set;for(let p of t.split(",")){let[h,g]=p.split("/"),v=g===void 0?1:Number(g);if(!Number.isInteger(v)||v<1)return null;let S,y;if(h==="*")S=r,y=l;else if(h.includes("-")){let[N,w]=h.split("-");S=Number(N),y=Number(w)}else S=Number(h),y=g===void 0?S:l;if(!Number.isInteger(S)||!Number.isInteger(y))return null;if(S<r||y>l||S>y)return null;for(let N=S;N<=y;N+=v)c.add(N)}return c.size?[...c].sort((p,h)=>p-h):null}function eo(t){let r=t.trim().split(/\s+/);if(r.length!==5)return null;let l=r.map((S,y)=>{let[N,w]=Jn[y];return Qn(S,N,w)});if(l.some((S)=>S===null))return null;let[c,p,h,g,v]=l;return{minutes:c,hours:p,daysOfMonth:h,months:g,daysOfWeek:[...new Set(v.map((S)=>S===7?0:S))].sort((S,y)=>S-y),domRestricted:r[2].trim()!=="*",dowRestricted:r[4].trim()!=="*"}}function to(t,r,l,c){let p=new Date(Date.UTC(r,l-1,c)).getUTCDay(),h=t.daysOfMonth.includes(c),g=t.daysOfWeek.includes(p);if(t.domRestricted&&t.dowRestricted)return h||g;if(t.domRestricted)return h;if(t.dowRestricted)return g;return!0}function no(t,r,l){let c=l&&St(l)?l:kt(),p=Pe(r.getTime(),c),h=Date.UTC(p.year+8,p.month-1,p.day);for(let g=Date.UTC(p.year,p.month-1,p.day);g<=h;){let v=new Date(g),S=v.getUTCFullYear(),y=v.getUTCMonth()+1,N=v.getUTCDate();if(!t.months.includes(y)){g=Date.UTC(S,y,1);continue}if(to(t,S,y,N))for(let w of t.hours)for(let C of t.minutes){let T=et(S,y,N,w,C,c);if(T!==null&&T>r.getTime())return T}g=Date.UTC(S,y-1,N+1)}return null}var oo=/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?$/;function yt(t,r){let l=t.trim();if(!l)return null;if(/^\d+$/.test(l)){let p=Number(l);return p>0?p:null}if(r){let p=l.match(oo);if(p){let[,h,g,v,S,y,N,w]=p,C=et(Number(h),Number(g),Number(v),Number(S),Number(y),r);if(C===null)return null;let T=(N?Number(N)*1000:0)+(w?Number(w.padEnd(3,"0")):0);return C+T}}let c=Date.parse(l);return Number.isNaN(c)?null:c}function wt(t,r,l=Date.now(),c){if(!r.trim())return{ok:!1,error:"Enter a schedule."};if(t==="once"){let g=yt(r,c);if(g===null)return{ok:!1,error:"Use an ISO timestamp, e.g. 2026-10-01T09:00."};if(g<=l)return{ok:!1,error:"That time is already in the past."};return{ok:!0,nextRunAt:g}}if(t==="every"){let g=vt(r);if(g===null)return{ok:!1,error:"Use a duration, e.g. 30m, 1h30m, 2 days."};if(g<Vn)return{ok:!1,error:"The shortest interval is 1 minute."};return{ok:!0,nextRunAt:l+g}}let p=eo(r);if(!p)return{ok:!1,error:"Use 5 fields: minute hour day-of-month month day-of-week."};let h=no(p,new Date(l),c);if(h===null)return{ok:!1,error:"That expression never matches a date."};return{ok:!0,nextRunAt:h}}function Nt(t,r,l){let c=r.trim();if(t==="once"){let p=yt(c,l);return p===null?c:`Once at ${new Date(p).toLocaleString(void 0,l?{timeZone:l}:void 0)}`}if(t==="every"){let p=vt(c);return p===null?c:`Every ${nt(p)}`}return`Cron ${c}`}function nt(t){let r=Math.round(t/1000),l=Math.floor(r/86400),c=Math.floor(r%86400/3600),p=Math.floor(r%3600/60),h=r%60,g=[];if(l)g.push(`${l}d`);if(c)g.push(`${c}h`);if(p)g.push(`${p}m`);if(h&&!l)g.push(`${h}s`);return g.length?g.join(" "):"0s"}var so={"always-ask":"Ask before writes",write:"Auto-write, ask before exec",yolo:"Auto-run everything"};function st(t){return`${t.provider}/${t.id}`}function ro(t){if(!Array.isArray(t))return[];let r=[];for(let l of t){if(!l||typeof l!=="object")continue;if(!("id"in l)||typeof l.id!=="string")continue;if(!("name"in l)||typeof l.name!=="string")continue;if(!("provider"in l)||typeof l.provider!=="string")continue;let c="thinkingLevels"in l&&Array.isArray(l.thinkingLevels)?l.thinkingLevels.filter((p)=>typeof p==="string"):void 0;r.push({id:l.id,name:l.name,provider:l.provider,...c?{thinkingLevels:c}:{}})}return r}function Tt({harness:t,model:r,onHarnessChange:l,onModelChange:c}){let{harnesses:p}=un(),h=Ya((k)=>{let I=Array.isArray(k.modelList)&&k.modelList.length>0?k.modelList:k.models;return ro(I)}),g=fs(p,t,h??[]),v=g.models,S=r?v.find((k)=>k.provider===r.provider&&k.id===r.modelId):void 0,y=Mc(S?.thinkingLevels),N=Qm(p,t),w=(k)=>{if(!k){c(null);return}let I=v.find((F)=>st(F)===k);if(!I)return;c({provider:I.provider,modelId:I.id,thinkingLevel:"auto",accessMode:r?.accessMode??"always-ask"})},C=(k)=>{if(!r)return;c({...r,thinkingLevel:k})},T=(k)=>{if(!r)return;c({...r,accessMode:k})};return e("div",{className:"space-y-2",children:[e("div",{className:"grid grid-cols-2 gap-2",children:[e("div",{children:[e("label",{className:"block font-semibold mb-1 text-ink",children:"Harness"}),e("select",{value:t,onChange:(k)=>l(k.currentTarget.value),className:"w-full bg-paper border border-ink/20 rounded px-2 py-1.5 outline-none focus:border-ink/50 text-xs",children:[!N.some((k)=>k.id===t)&&e("option",{value:t,children:t}),N.map((k)=>e("option",{value:k.id,children:k.label},k.id))]})]}),e("div",{children:[e("label",{className:"block font-semibold mb-1 text-ink",children:"Model"}),e("select",{value:r?`${r.provider}/${r.modelId}`:"",onChange:(k)=>w(k.currentTarget.value),className:"w-full bg-paper border border-ink/20 rounded px-2 py-1.5 outline-none focus:border-ink/50 text-xs",children:[e("option",{value:"",children:t==="omp-rpc"?"Default (composer selection)":"Harness default"}),r&&!v.some((k)=>k.provider===r.provider&&k.id===r.modelId)&&e("option",{value:`${r.provider}/${r.modelId}`,children:[r.provider,"/",r.modelId]}),v.map((k)=>e("option",{value:st(k),children:[k.name," · ",k.provider]},st(k)))]})]})]}),e("div",{className:"grid grid-cols-2 gap-2",children:[e("div",{children:[e("label",{className:"block font-semibold mb-1 text-ink",children:"Thinking"}),e("select",{value:r?.thinkingLevel??"auto",disabled:!r||y.length===0,onChange:(k)=>C(k.currentTarget.value),className:"w-full bg-paper border border-ink/20 rounded px-2 py-1.5 outline-none focus:border-ink/50 text-xs disabled:opacity-40",children:[e("option",{value:"auto",children:"Auto"}),r&&r.thinkingLevel!=="auto"&&!y.includes(r.thinkingLevel)&&e("option",{value:r.thinkingLevel,children:r.thinkingLevel}),y.map((k)=>e("option",{value:k,children:k},k))]})]}),e("div",{children:[e("label",{className:"block font-semibold mb-1 text-ink",children:"Access"}),e("select",{value:r?.accessMode??"always-ask",disabled:!r,onChange:(k)=>T(k.currentTarget.value),className:"w-full bg-paper border border-ink/20 rounded px-2 py-1.5 outline-none focus:border-ink/50 text-xs disabled:opacity-40",children:dd.map((k)=>e("option",{value:k,children:so[k]},k))})]})]}),g.blocked&&e("p",{className:"text-[11px] text-error",children:g.blocked}),g.unprobed&&e("p",{className:"text-[11px] text-ink/40",children:"This harness has not been probed yet; its models appear after a status check."})]})}var Ct={once:"Once",every:"Every",cron:"Cron"},io={once:"An ISO timestamp, e.g. 2026-10-01T09:00",every:"A duration, e.g. 30m, 1h30m, 2 days",cron:"5 fields: minute hour day-of-month month day-of-week"},ao={once:"2026-10-01T09:00",every:"1h30m",cron:"0 9 * * 1-5"};function lo(t){let r=t-Date.now();if(r<=0)return"due now";let l=Math.round(r/60000);if(l<60)return`in ${l}m`;let c=Math.round(l/60);if(c<24)return`in ${c}h`;return`in ${Math.round(c/24)}d`}var Fe=null;function co(){if(Fe)return Fe;let t=Intl,r=[];try{r=t.supportedValuesOf?.("timeZone")??[]}catch{r=[]}return Fe=r.length?r:["UTC"],Fe}function uo(t){let r=co();return t&&!r.includes(t)?[t,...r]:r}function Ot({folders:t,initial:r,activeSessionId:l,serverTimeZone:c,busy:p,onSubmit:h,onCancel:g}){let[v,S]=n(""),[y,N]=n(""),[w,C]=n("every"),[T,k]=n("1h"),[I,F]=n("omp-rpc"),[R,A]=n(null),O=c||Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC",[M,q]=n(O),[ee,X]=n(null),[re,ae]=n(!1);o(()=>{S(r?.name??""),N(r?.prompt??""),C(r?.kind??"every"),k(r?.spec??"1h"),F(r?.harness??"omp-rpc"),A(r?.model??null),q(r?.timezone??O),X(r?.folderId??null),ae(Boolean(r?.sessionId))},[r?.id,O]);let Y=wt(w,T,Date.now(),M),V=Boolean(y.trim())&&Y.ok&&!p,pe=()=>{if(!V||!Y.ok)return;h({name:v.trim(),prompt:y.trim(),kind:w,spec:T.trim(),harness:I,timezone:M,folderId:ee,sessionId:re?r?.sessionId??l:null,model:R})};return e("div",{className:"space-y-3 text-xs",children:[e("div",{children:[e("label",{className:"block font-semibold mb-1 text-ink",children:["Name ",e("span",{className:"text-ink/40 font-normal",children:"(optional)"})]}),e("input",{type:"text",value:v,onInput:(W)=>S(W.currentTarget.value),placeholder:"Morning standup digest",className:"w-full bg-paper border border-ink/20 rounded px-2.5 py-1.5 outline-none focus:border-ink/50 text-xs"})]}),e("div",{children:[e("label",{className:"block font-semibold mb-1 text-ink",children:"Prompt"}),e("textarea",{value:y,onInput:(W)=>N(W.currentTarget.value),placeholder:"Describe the task, ask a question, or paste commands…",rows:4,className:"w-full bg-paper border border-ink/20 rounded px-2.5 py-1.5 outline-none focus:border-ink/50 text-xs resize-y min-h-[80px]"})]}),e("div",{className:"flex items-end gap-2",children:[e("div",{className:"w-28 flex-shrink-0",children:[e("label",{className:"block font-semibold mb-1 text-ink",children:"Schedule"}),e("select",{value:w,onChange:(W)=>C(W.currentTarget.value),className:"w-full bg-paper border border-ink/20 rounded px-2 py-1.5 outline-none focus:border-ink/50 text-xs",children:Object.keys(Ct).map((W)=>e("option",{value:W,children:Ct[W]},W))})]}),e("div",{className:"flex-1",children:[e("label",{className:"block font-semibold mb-1 text-ink",children:"When"}),e("input",{type:"text",value:T,onInput:(W)=>k(W.currentTarget.value),placeholder:ao[w],className:`w-full bg-paper border rounded px-2.5 py-1.5 outline-none text-xs font-mono ${Y.ok?"border-ink/20 focus:border-ink/50":"border-error/50 focus:border-error"}`})]})]}),e("p",{className:`text-[11px] ${Y.ok?"text-ink/50":"text-error"}`,children:Y.ok?`Next run ${lo(Y.nextRunAt)} · ${new Date(Y.nextRunAt).toLocaleString(void 0,{timeZone:M})} · ${M}`:Y.error}),e("p",{className:"text-[11px] text-ink/40",children:io[w]}),e("div",{className:"grid grid-cols-2 gap-2",children:[e("div",{children:[e("label",{className:"block font-semibold mb-1 text-ink",children:"Timezone"}),e("select",{value:M,onChange:(W)=>q(W.currentTarget.value),className:"w-full bg-paper border border-ink/20 rounded px-2 py-1.5 outline-none focus:border-ink/50 text-xs",children:uo(M).map((W)=>e("option",{value:W,children:W},W))})]}),e("div",{children:[e("label",{className:"block font-semibold mb-1 text-ink",children:"Run in"}),e("select",{value:ee===null?"":String(ee),onChange:(W)=>X(W.currentTarget.value?Number(W.currentTarget.value):null),className:"w-full bg-paper border border-ink/20 rounded px-2 py-1.5 outline-none focus:border-ink/50 text-xs",children:[e("option",{value:"",children:"Server default directory"}),t.map((W)=>e("option",{value:W.id,children:W.name},W.id))]})]})]}),e(Tt,{harness:I,model:R,onHarnessChange:(W)=>{F(W),A(null)},onModelChange:A}),e("label",{className:`flex items-center gap-2 text-[11px] ${l?"text-ink/70":"text-ink/35"}`,children:[e("input",{type:"checkbox",checked:re,disabled:!l,onChange:(W)=>ae(W.currentTarget.checked),className:`${be} accent-ink`}),e("span",{children:"Resume the open session each run"})]}),e("div",{className:"flex justify-end gap-2 pt-1",children:[e("button",{type:"button",onClick:g,disabled:p,className:"px-3 py-1.5 text-xs font-medium text-ink/60 hover:text-ink transition-colors",children:"Cancel"}),e("button",{type:"button",onClick:pe,disabled:!V,className:"inline-flex items-center gap-1.5 px-4 py-1.5 text-xs font-medium bg-ink text-canvas rounded hover:bg-ink/90 transition-colors disabled:opacity-40",children:[p&&e(m,{size:12,className:"animate-spin"}),r?"Save changes":"Schedule task"]})]})]})}function po(t){return t===null?"–":new Date(t).toLocaleString()}function mo(t){if(t.name)return t.name;let r=t.prompt.replace(/\s+/g," ").trim();return r.length>60?`${r.slice(0,57)}…`:r||"(empty prompt)"}function At({tasks:t,loading:r,pending:l,onRunNow:c,onToggleEnabled:p,onEdit:h,onDelete:g,loadRuns:v}){let[S,y]=n(null),[N,w]=n([]),[C,T]=n(!1);if(o(()=>{if(!S)return;let k=!0;return T(!0),v(S).then((I)=>{if(!k)return;w(I),T(!1)}),()=>{k=!1}},[S,v]),t.length===0)return e("div",{className:"px-3 py-8 text-center text-[11px] text-ink/50 border border-dashed border-ink/15 rounded-lg",children:r?"Loading…":"No scheduled tasks yet. Create one above."});return e("ul",{className:"space-y-2",children:t.map((k)=>{let I=l===k.id,F=S===k.id;return e("li",{className:"border border-ink/10 rounded-lg bg-paper",children:[e("div",{className:"flex items-start gap-2 p-2.5",children:[e("span",{className:"mt-0.5 shrink-0","aria-hidden":"true",children:!k.enabled?e(wo,{size:14,className:"text-ink/40"}):k.lastStatus==="error"?e(E,{size:14,className:"text-error"}):k.lastStatus==="success"?e(ne,{size:14,className:"text-ink/60"}):e(On,{size:14,className:"text-ink/60"})}),e("div",{className:"min-w-0 flex-1",children:[e("p",{className:"text-xs font-medium text-ink truncate",children:mo(k)}),e("p",{className:"text-[11px] text-ink/60 mt-0.5",children:[Nt(k.kind,k.spec,k.timezone),k.kind!=="every"&&e(d,{children:[e("span",{className:"text-ink/30",children:" · "}),k.timezone]}),e("span",{className:"text-ink/30",children:" · "}),!k.enabled?k.kind==="once"&&k.lastRunAt!==null?"Ran once, with no next run":"Paused":`Next ${po(k.nextRunAt)}`]}),k.cwd&&e("p",{className:"text-[10.5px] text-ink/40 font-mono truncate mt-0.5",children:k.cwd}),e("p",{className:"text-[10.5px] text-ink/40 truncate mt-0.5",children:[k.harness,k.model&&` · ${k.model.provider}/${k.model.modelId}`]}),k.sessionId&&e("p",{className:"text-[10.5px] text-ink/40 font-mono truncate mt-0.5",children:["resumes ",k.sessionId.slice(0,8)]}),k.lastStatus==="error"&&k.lastError&&e("p",{className:"text-[10.5px] text-error mt-0.5 break-words",children:k.lastError}),k.runCount>0&&e("p",{className:"text-[10.5px] text-ink/40 mt-0.5",children:["Fired ",k.runCount,"×"]})]}),e("div",{className:"flex items-center gap-1 shrink-0",children:[e("button",{type:"button",title:"Run now","aria-label":"Run now",disabled:I,onClick:()=>c(k.id),className:"p-1.5 rounded hover:bg-ink/5 text-ink/60 hover:text-ink transition-colors disabled:opacity-40",children:I?e(m,{size:13,className:"animate-spin"}):e(Ca,{size:13})}),e("button",{type:"button",title:k.enabled?"Pause":"Resume","aria-label":k.enabled?"Pause":"Resume","aria-pressed":k.enabled,disabled:I,onClick:()=>p(k),className:"p-1.5 rounded hover:bg-ink/5 text-ink/60 hover:text-ink transition-colors disabled:opacity-40",children:k.enabled?e(wo,{size:13}):e(Ca,{size:13})}),e("button",{type:"button",title:"Edit","aria-label":"Edit",disabled:I,onClick:()=>h(k),className:"p-1.5 rounded hover:bg-ink/5 text-ink/60 hover:text-ink transition-colors disabled:opacity-40",children:e(zn,{size:13})}),e("button",{type:"button",title:"Delete","aria-label":"Delete",disabled:I,onClick:()=>g(k.id),className:"p-1.5 rounded hover:bg-ink/5 text-ink/60 hover:text-error transition-colors disabled:opacity-40",children:e(L,{size:13})})]})]}),e("button",{type:"button",onClick:()=>y(F?null:k.id),"aria-expanded":F,className:"w-full text-left px-2.5 py-1.5 border-t border-ink/5 text-[10.5px] text-ink/50 hover:text-ink transition-colors",children:F?"Hide run history":"Run history"}),F&&e("div",{className:"px-2.5 pb-2.5 space-y-1",children:[C&&e("p",{className:"text-[10.5px] text-ink/40",children:"Loading…"}),!C&&N.length===0&&e("p",{className:"text-[10.5px] text-ink/40",children:"This task has not run yet."}),!C&&N.map((R)=>e("div",{className:"flex items-start gap-2 text-[10.5px]",children:[e("span",{className:"w-16 shrink-0 text-ink/50",children:new Date(R.startedAt).toLocaleTimeString()}),e("span",{className:`w-14 shrink-0 font-medium ${R.status==="error"?"text-error":R.status==="running"?"text-ink/60":"text-ink/70"}`,children:R.status}),e("span",{className:"w-12 shrink-0 text-ink/40",children:R.finishedAt===null?"…":nt(R.finishedAt-R.startedAt)}),e("span",{className:"min-w-0 flex-1 text-ink/60 break-words",children:[R.detail||"–",R.sessionId&&e("span",{className:"block font-mono text-[10px] text-ink/40",children:["session ",R.sessionId.slice(0,8)]})]})]},R.id))]})]},k.id)})})}function Pt(){let[t,r]=n([]);return o(()=>{let l=!0;return fetch("/api/settings/projects").then((c)=>c.json()).then((c)=>{if(!l)return;r((c.projects??[]).filter((p)=>typeof p.folderId==="number").map((p)=>({id:p.folderId,name:p.name})))}).catch((c)=>console.error("Failed to load workspace folders:",c)),()=>{l=!1}},[]),t}function vu({isOpen:t,onClose:r,activeSessionId:l=null,onToast:c}){let p=ht(t),h=Pt(),[g,v]=n(null),[S,y]=n(!1),[N,w]=n(!1),[C,T]=n(null);if(o(()=>{if(t)return;v(null),y(!1),w(!1),T(null)},[t]),o(()=>{let O=(M)=>{if(M.key!=="Escape"||N)return;if(M.preventDefault(),g||S){v(null),y(!1);return}r()};return window.addEventListener("keydown",O),()=>window.removeEventListener("keydown",O)},[r,N,g,S]),!t)return null;let k=async(O)=>{w(!0);let M=g?await p.patch(g.id,O):await p.create(O);if(w(!1),M){c?.(M,"error");return}c?.(g?"Scheduled task updated.":"Scheduled task created.","success"),v(null),y(!1)},I=async(O)=>{T(O.id);let M=await p.patch(O.id,{enabled:!O.enabled});if(T(null),M)c?.(M,"error")},F=async(O)=>{T(O);let M=await p.runNow(O);if(T(null),M){c?.(M,"error");return}c?.("Task dispatched. Open the session to watch it run.","success")},R=async(O)=>{T(O);let M=await p.remove(O);if(T(null),M){c?.(M,"error");return}if(g?.id===O)v(null)},A=g!==null||S;return e("div",{className:"fixed inset-0 modal-scrim backdrop-blur-[2px] z-50 flex items-center justify-center modal-safe",onClick:N?void 0:r,role:"dialog","aria-modal":"true","aria-label":"Scheduled tasks",children:e("div",{className:"glass-overlay bg-paper border border-ink/15 rounded-xl shadow-2xl w-[min(94vw,640px)] max-h-[88vh] flex flex-col overflow-hidden text-ink",onClick:(O)=>O.stopPropagation(),children:[e("div",{className:"flex items-center justify-between px-4 py-3 border-b border-ink/10",children:[e("div",{className:"flex items-center gap-2",children:[e(Qa,{size:15}),e("h3",{className:"font-semibold text-sm",children:"Scheduled Tasks"})]}),e("button",{type:"button",onClick:r,"aria-label":"Close",className:"p-1.5 -m-1.5 rounded text-ink/50 hover:text-ink hover:bg-ink/5 transition-colors",children:e(b,{size:16})})]}),e("div",{className:"p-4 overflow-y-auto space-y-4",children:[p.error&&!A&&e("p",{className:"text-[11px] text-error border border-error/30 bg-error/5 rounded px-2.5 py-1.5",children:p.error}),A?e(Ot,{folders:h,initial:g,activeSessionId:l,serverTimeZone:p.serverTimeZone,busy:N,onSubmit:k,onCancel:()=>{v(null),y(!1)}}):e("button",{type:"button",onClick:()=>y(!0),className:"w-full py-2 rounded-lg border border-dashed border-ink/20 text-xs font-medium text-ink/70 hover:text-ink hover:border-ink/40 transition-colors",children:"+ New scheduled task"}),!A&&e(At,{tasks:p.tasks,loading:p.loading,pending:C,onRunNow:F,onToggleEnabled:I,onEdit:(O)=>v({id:O.id,name:O.name,prompt:O.prompt,kind:O.kind,spec:O.spec,harness:O.harness,timezone:O.timezone,folderId:O.folderId,sessionId:O.sessionId,model:O.model}),onDelete:R,loadRuns:p.loadRuns})]})]})})}var rt=["A-Z","Z-A","LATEST_SESSION","LATEST_ADDED"],Dt={"A-Z":"A-Z","Z-A":"Z-A",LATEST_SESSION:"Latest Session",LATEST_ADDED:"Latest Added"};function jo({variant:t,sortOption:r,onSortChange:l}){if(t==="mobile")return e(d,{children:[e("div",{className:"px-2 py-1 text-[10px] uppercase font-bold text-ink/40 font-mono",children:"Sort Workspaces"}),rt.map((c)=>e("button",{type:"button",onClick:()=>l(c),className:`w-full text-left px-2.5 py-1.5 rounded-lg flex items-center justify-between transition-colors ${r===c?"bg-ink/10 font-semibold text-ink":"hover:bg-ink/5 text-ink/80"}`,children:[e("span",{children:c.replace("_"," ")}),r===c&&e(f,{size:13,className:"text-ink"})]},c))]});return e(d,{children:[e("div",{className:"px-3 py-1 text-[10px] uppercase font-bold text-ink/40 tracking-wider",children:"Sort Workspaces"}),rt.map((c)=>e("div",{className:`px-3 py-1.5 text-xs cursor-pointer flex items-center justify-between ${r===c?"bg-ink/5 text-ink font-medium":"text-ink/70 hover:bg-ink/5 hover:text-ink"}`,onClick:()=>l(c),children:[e("span",{children:Dt[c]}),r===c&&e("div",{className:"w-1.5 h-1.5 rounded-full bg-ink"})]},c))]})}function ku({actions:t,sortHidden:r,sortOption:l,onSortChange:c,layout:p="desktop"}){let h=p==="mobile",[g,v]=n(!1),S=i(null);ue(S,()=>v(!1)),o(()=>{if(!g)return;let N=(w)=>{if(w.key==="Escape")v(!1)};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[g]);let y=(N)=>{v(!1),N.onSelect()};return e("div",{className:"relative shrink-0",ref:S,children:[e("button",{type:"button",title:"More sidebar actions","aria-label":"More sidebar actions","aria-haspopup":"menu","aria-expanded":g,onClick:()=>v(!g),className:`inline-flex items-center justify-center transition-colors cursor-pointer ${h?"w-9.5 h-9.5 rounded-xl border shadow-xs":"w-7 h-7 rounded border"} ${g?"border-ink/30 bg-ink/10 text-ink":"border-ink/15 bg-paper text-ink/70 hover:bg-ink/5 hover:text-ink"}`,children:e(Ee,{size:h?16:14})}),g&&e("div",{role:"menu",className:`glass-popover absolute right-0 top-full mt-2 w-52 bg-paper border border-ink/15 shadow-lg z-50 py-1 text-xs ${h?"rounded-xl p-2":"rounded-lg"}`,children:[t.map((N)=>e("button",{type:"button",role:"menuitem",onClick:()=>y(N),"aria-pressed":N.active,className:`w-full text-left flex items-center gap-2 transition-colors ${h?"px-2.5 py-1.5 rounded-lg":"px-3 py-1.5"} ${N.active?"bg-ink/5 text-ink font-medium":"text-ink/75 hover:bg-ink/5 hover:text-ink"}`,children:[e(N.icon,{size:13}),e("span",{children:N.label})]},N.id)),r&&e("div",{className:"mt-1 border-t border-ink/10 pt-1",children:e(jo,{variant:p,sortOption:l,onSortChange:c})})]})]})}function Ss(t){let r=i(null),[l,c]=n(0);return K(()=>{let p=r.current;if(!p)return;let h=()=>c(Math.max(0,p.clientWidth-t));if(h(),typeof ResizeObserver>"u")return;let g=new ResizeObserver(h);return g.observe(p),()=>g.disconnect()},[t]),{ref:r,width:l}}var $d=["new-workspace","refresh","search","select","archive","scheduler","sort"];var Wg=8;function Kg(t){let r=$d.length;if(!(t>0))return r;let l=t-112-6-8;if(r*28+(r-1)*6<=l)return r;let p=Math.floor((l-28-8)/34);return Math.max(2,Math.min(r,p))}var fo=38,ho=8,go=126,bo=1,zd=["new-workspace","refresh","archive","sort","scheduler","select"];function Vg(t){let r=zd.length;if(!(t>0))return r;let l=fo+ho,c=Math.floor((t-go)/l);if(c>=r)return r;return Math.max(bo,Math.min(r,c-1))}var Ft="inline-flex max-w-full shrink-0 items-center border font-medium transition-colors cursor-pointer",xo="border-ink bg-ink text-paper",So="border-ink/15 text-ink/60 hover:border-ink/30 hover:text-ink",_t="w-full px-2.5 py-1.5 flex items-center gap-2 text-left hover:bg-ink/5 cursor-pointer",Bt="bg-ink/10 font-semibold text-ink",Lt="text-ink/75";function Ts({options:t,value:r,onChange:l,form:c="chip",touch:p=!1}){let[h,g]=n(null),v=r&&!t.some((w)=>w.harness===r)?[{harness:r,label:ta(r),count:0},...t]:t;if(v.length<2&&!r)return null;let S=r?v.find((w)=>w.harness===r):void 0,y=S?S.label:"All harnesses",N=c==="icon"?e("button",{type:"button","aria-haspopup":"menu","aria-expanded":h!==null,"aria-label":`Filter by harness: ${y}`,title:r?`Harness: ${y}`:"Filter by harness",onClick:(w)=>g(h?null:Et(w.currentTarget)),className:`${Ft} h-[22px] w-[22px] justify-center rounded-md ${r?"border-ink bg-ink text-paper":"border-ink/15 text-ink/55 hover:border-ink/30 hover:text-ink"}`,children:S?e(Ke,{harness:S.harness,size:tt.compact,inherit:!0,decorative:!0}):e(Ze,{size:13})}):e("button",{type:"button","aria-haspopup":"menu","aria-expanded":h!==null,title:"Filter by harness",onClick:(w)=>g(h?null:Et(w.currentTarget)),className:`${Ft} gap-1 rounded-full ${p?"px-2 py-1 text-xs":"px-2 py-0.5 text-[11px]"} ${r?xo:So}`,children:[S?e(Ke,{harness:S.harness,size:tt.compact,inherit:!0,decorative:!0}):null,e("span",{className:"max-w-[9rem] truncate",children:y}),S?e("span",{className:"font-mono tabular-nums opacity-70",children:S.count}):null,e(B,{size:11,className:"shrink-0 opacity-60"})]});return e(d,{children:[N,e(Qt,{anchor:h,align:"start",ariaLabel:"Filter by harness",className:"w-56 bg-paper border border-ink/15 rounded-lg shadow-xl py-1 text-xs",onClose:()=>g(null),children:[e("button",{type:"button",onClick:()=>{l(null),g(null)},className:`${_t} ${!r?Bt:Lt}`,children:[e("span",{className:"flex-1 truncate",children:"All harnesses"}),!r?e(f,{size:12}):null]}),v.map((w)=>{let C=w.harness===r;return e("button",{type:"button",onClick:()=>{l(w.harness),g(null)},className:`${_t} ${C?Bt:Lt}`,children:[e(Ke,{harness:w.harness,size:tt.compact,decorative:!0}),e("span",{className:"flex-1 truncate",children:w.label}),e("span",{className:"font-mono tabular-nums text-ink/50",children:w.count}),C?e(f,{size:12}):null]},w.harness)})]})]})}function Ds(t=5,r=7){let[l,c]=n(t),p=a(()=>c((g)=>g+r),[r]),h=a(()=>c(t),[t]);return{visibleCount:l,showMore:p,showLess:h,canShowLess:l>t}}function Ns(t,r,l){let[c,p]=n(!1),h=ut(),g=ut(),{handleArchive:v,handleRename:S,handleRenameWithAi:y}=Rm(r,l),N=()=>{if(typeof t.id!=="number")return;h.submit({isPinned:String(!t.isPinned)},{method:"POST",action:`/api/folders/${t.id}/pin`}),r()},w=()=>{if(typeof t.id!=="number")return;g.submit({},{method:"POST",action:`/api/folders/${t.id}/delete`}),p(!1),r()},C=t.project_path?()=>{(async()=>{try{let T=await fetch(`/api/folders/${encodeURIComponent(String(t.id))}/open`,{method:"POST"}),k=await T.json().catch(()=>({}));if(!T.ok)l?.(k.error||`Could not open the folder (HTTP ${T.status})`)}catch(T){l?.(T instanceof Error?T.message:String(T))}})()}:void 0;return{confirmDelete:c,requestDelete:()=>p(!0),cancelDelete:()=>p(!1),handlePin:N,handleOpenFolder:C,handleDelete:w,handleArchive:v,handleRename:S,handleRenameWithAi:y}}function Lr({checked:t,indeterminate:r=!1,label:l,onChange:c,size:p="sm"}){let h=i(null);return o(()=>{if(h.current)h.current.indeterminate=r},[r]),e("input",{ref:h,type:"checkbox",checked:t,"aria-label":l,onChange:c,onClick:(g)=>g.stopPropagation(),className:`${be} shrink-0 accent-ink cursor-pointer ${p==="md"?"w-3.5 h-3.5":"w-3 h-3"}`})}function ko(t){let r=t.branch||(t.detached?"detached":"worktree");return t.status==="missing"?`${r} · ${"missing"}`:r}function vo(t){if(t.status==="missing")return`Worktree folder is missing: ${t.path}`;return t.detached?`Detached HEAD in worktree ${t.path}`:`Runs in worktree ${t.path}`}function Qs({worktree:t}){let r=t.status==="missing";return e("span",{className:`flex min-w-0 items-center gap-1 truncate text-[10px] font-normal ${r?"text-warning":"text-ink/45"}`,title:vo(t),"data-worktree-status":t.status,children:[e("span",{"aria-hidden":"true",className:"shrink-0 font-mono",children:"⑂"}),e("span",{className:"truncate",children:ko(t)})]})}var yo=1000,_e=new Set,Re=null;function No(){let t=Date.now();for(let r of _e)r(t)}function To(t){if(_e.add(t),Re===null)Re=setInterval(No,yo);return()=>{if(_e.delete(t),_e.size===0&&Re!==null)clearInterval(Re),Re=null}}function Mt(t=!0){let[r,l]=n(()=>Date.now());return o(()=>{if(!t)return;return To(l)},[t]),r}function Rs(t,r=Date.now()){if(t===null||t===void 0||t==="")return null;let l=typeof t==="number"?t:Date.parse(t);if(Number.isNaN(l))return null;let c=Math.round((r-l)/1000);if(c<45)return"now";let p=Math.round(c/60);if(p<60)return`${p}m`;let h=Math.round(p/60);if(h<24)return`${h}h`;let g=Math.round(h/24);if(g<7)return`${g}d`;let v=Math.round(g/7);if(v<5)return`${v}w`;let S=new Date(l),y=S.getFullYear()===new Date(r).getFullYear(),N=S.getDate(),w=S.toLocaleString("en-US",{month:"short"});return y?`${N} ${w}`:`${N} ${w} ${S.getFullYear()}`}function qo(t){if(t===null||t===void 0||t==="")return null;let r=typeof t==="number"?t:Date.parse(t);if(Number.isNaN(r))return null;return new Date(r).toLocaleString("en-US",{weekday:"short",day:"numeric",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"})}function $t(t){if(!Number.isFinite(t)||t<1000)return"0s";return Mm(t)??"0s"}function Wt({startedAt:t,className:r}){let l=Mt(),c=$t(Math.max(0,l-t)),p=u(()=>qo(t),[t]);return e("span",{role:"timer",className:`tabular-nums ${r??""}`,title:p?`Started ${p}`:void 0,"aria-label":`Running for ${c}`,children:c})}var Co="text-ink/40",Io="text-ink/80";function Fs({timeAgo:t,timeTitle:r,runStartedAt:l,className:c,restingClassName:p=Co}){if(l!==void 0)return e(Wt,{startedAt:l,className:`${c} ${Io}`});if(!t)return null;return e("span",{className:`${c} ${p}`,title:r??void 0,children:t})}var Ls="bg-ink/10 text-ink ring-1 ring-inset ring-ink/20";function Ms({variant:t,isPinned:r=!1,onOpenFolder:l,onSelectSessions:c,onNewWorktree:p,confirmDelete:h,onPin:g,onDelete:v,onRequestDelete:S,onCancelDelete:y}){if(t==="mobile")return h?e(d,{children:[e("div",{className:"px-3 py-2 text-ink/80 font-medium",children:"Delete workspace?"}),e("button",{type:"button",onClick:v,className:"w-full text-left px-3 py-2 hover:bg-error/10 text-error flex items-center space-x-2",children:[e(L,{size:13}),e("span",{children:"Yes, delete"})]}),e("button",{type:"button",onClick:y,className:"w-full text-left px-3 py-2 hover:bg-ink/5 text-ink/70",children:"Cancel"})]}):e(d,{children:[l&&e("button",{type:"button",onClick:l,className:"w-full text-left px-3 py-2 hover:bg-ink/5 text-ink/80 flex items-center space-x-2",children:[e(Vt,{size:13}),e("span",{children:"Go to Explorer"})]}),e("button",{type:"button",onClick:g,className:"w-full text-left px-3 py-2 hover:bg-ink/5 text-ink/80 flex items-center space-x-2",children:[r?e(ci,{size:13}):e(Br,{size:13}),e("span",{children:r?"Unpin Workspace":"Pin Workspace"})]}),c&&e("button",{type:"button",onClick:c,className:"w-full text-left px-3 py-2 hover:bg-ink/5 text-ink/80 flex items-center space-x-2",children:[e(Fr,{size:13}),e("span",{children:"Select sessions"})]}),p&&e("button",{type:"button",onClick:p,className:"w-full text-left px-3 py-2 hover:bg-ink/5 text-ink/80 flex items-center space-x-2",children:[e(me,{size:13}),e("span",{children:"New worktree…"})]}),e("button",{type:"button",onClick:S,className:"w-full text-left px-3 py-2 hover:bg-error/10 text-error flex items-center space-x-2",children:[e(L,{size:13}),e("span",{children:"Delete Workspace"})]})]});return h?e(d,{children:[e("div",{className:"px-3 py-1.5 text-xs text-ink/80 font-medium",children:"Delete workspace?"}),e("button",{type:"button",onClick:v,className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 cursor-pointer flex items-center space-x-2 text-error",children:[e(L,{size:12}),e("span",{children:"Yes, delete"})]}),e("button",{type:"button",onClick:y,className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 cursor-pointer flex items-center space-x-2 text-ink/70",children:e("span",{children:"Cancel"})})]}):e(d,{children:[l&&e("button",{type:"button",onClick:l,className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 cursor-pointer flex items-center space-x-2 text-ink/80",children:[e(Vt,{size:12}),e("span",{children:"Go to Explorer"})]}),e("button",{type:"button",onClick:g,className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 cursor-pointer flex items-center space-x-2 text-ink/80",children:[r?e(ci,{size:12}):e(Br,{size:12}),e("span",{children:r?"Unpin Workspace":"Pin Workspace"})]}),c&&e("button",{type:"button",onClick:c,className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 cursor-pointer flex items-center space-x-2 text-ink/80",children:[e(Fr,{size:12}),e("span",{children:"Select sessions"})]}),p&&e("button",{type:"button",onClick:p,className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 cursor-pointer flex items-center space-x-2 text-ink/80",children:[e(me,{size:12}),e("span",{children:"New worktree…"})]}),e("button",{type:"button",onClick:S,className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 cursor-pointer flex items-center space-x-2 text-error",children:[e(L,{size:12}),e("span",{children:"Delete Workspace"})]})]})}function Be({ancestors:t,isLast:r,first:l,style:c}){let p=c.insetPx+c.slotWidth/2,h=c.slotWidth/2+c.markGap+c.glyph/2,g=h+c.insetPx-p,v=2,S=p-1,y=l?r?{left:S,top:-6,height:"calc(50% + 6px)"}:{left:S,top:-6,bottom:-2}:r?{left:S,top:0,height:"50%"}:{left:S,top:0,bottom:-2};return e(d,{children:[t.map((N,w)=>e("span",{"data-guide":"ancestor","data-continues":N?void 0:"true","aria-hidden":"true",className:"relative shrink-0",style:{width:h},children:!N&&e("span",{className:"absolute z-10 bg-ink/40",style:{left:S,top:0,bottom:-2,width:2}})},w)),e("span",{"data-guide":"connector","data-last":r?"true":void 0,"data-first":l?"true":void 0,"aria-hidden":"true",className:"relative shrink-0",style:{width:h},children:[e("span",{className:"absolute z-10 bg-ink/40",style:{width:2,...y}}),e("span",{className:"absolute z-10 bg-ink/40",style:{left:S,top:"calc(50% - 1px)",width:g+1,height:2}})]})]})}function zt({subagent:t,sessionId:r,style:l,running:c}){let[p]=le(),h=t.id===p.get("subagent"),g=Qh(t),v=t.task??t.assignment??t.description??g;return e("div",{className:"group/subagent-row flex items-center",children:[e("button",{type:"button",title:v,onClick:()=>window.dispatchEvent(new CustomEvent("omp:view-subagent",{detail:{sessionId:r,subagent:t}})),className:`flex-1 min-w-0 flex items-center text-left text-xs rounded-md ${l.inset} ${l.padding} cursor-pointer transition-colors select-none ${h?"bg-ink/10 font-medium text-ink":"text-ink/70 hover:text-ink hover:bg-ink/5"}`,children:[e("span",{"data-testid":"subagent-status-slot",className:"w-4 h-4 flex items-center justify-center shrink-0",children:e(Pm,{status:t.status,live:c,size:11})}),e("span",{className:"w-2 shrink-0"}),e("span",{"data-testid":"subagent-mark",className:"mr-1.5 flex shrink-0 items-center text-ink/55",children:e(Ze,{size:l.glyph,"aria-hidden":"true"})}),e("span",{className:"flex-1 min-w-0 truncate leading-snug",children:g})]}),c&&e("button",{type:"button",title:"Stop this subagent","aria-label":"Stop this subagent",onClick:()=>void Om(r,t.id),className:"touch-visible shrink-0 mr-1 w-5 h-5 flex items-center justify-center rounded text-ink/40 hover:text-error hover:bg-error/5 opacity-0 group-hover/subagent-row:opacity-100 transition-opacity cursor-pointer",children:e(Xn,{size:10})})]})}var Oo={pending:"started",running:"started",completed:"completed",failed:"failed",aborted:"aborted"};function Ao(t,r){return t.map((l)=>{if(r.id!==void 0){if(l.id!==r.id)return l}else if(r.index===void 0||r.index<0||l.index!==r.index)return l;let c=r.status&&l.status==="started"?Oo[r.status]??l.status:l.status;return{...l,status:c,progress:{...l.progress,...r},lastUpdate:Date.now()}})}function Ht(t,r,l){let[c,p]=n([]),[h,g]=n(!1);return o(()=>{if(!l)return;let v=!1;return p([]),g(!0),Rh(t).then((S)=>{if(v||!S)return;let y=S.map($m);p((N)=>Gm(N,y))}).finally(()=>{if(!v)g(!1)}),()=>{v=!0}},[t,l]),o(()=>{if(!l||!r)return;let v=!1,S=Date.now(),y=(C)=>C.sessionId===t?C.payload:null,N=fl("subagent_lifecycle",(C)=>{let T=zm(y(C));if(T)p((k)=>Gm(k,[T]))}),w=fl("subagent_progress",(C)=>{let T=Um(y(C));if(T)p((k)=>Ao(k,T))});return fetch(`/api/agent/${encodeURIComponent(t)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"get_subagents"})}).then((C)=>C.ok?C.json():null).then((C)=>{if(v||!x(C))return;let T="data"in C?C.data:C;p((k)=>Gm(k,Fh(T),S))}).catch(()=>{}),()=>{v=!0,N(),w()}},[l,r,t]),{subagents:c,isLoading:h}}function Ps(t,r,l,c,p=!1){let h=String(t.id);return{expandable:(r.get(h)?.length??0)>0||Boolean(t.hasSubagents),isExpanded:l.has(h),onToggleExpand:()=>c(h),isChild:p}}function Bi({parentId:t,hasSubagents:r,childrenOf:l,expandedIds:c,onToggle:p,activeSessionId:h,renderSession:g,style:v,ancestors:S=[]}){let y=l.get(t)??[],{subagents:N,isLoading:w}=Ht(t,h===t,r),C=[...y.map((T)=>({kind:"session",session:T})),...N.map((T)=>({kind:"subagent",subagent:T}))];if(C.length===0){if(!w)return null;return e("div",{"data-testid":"session-branch",className:"space-y-0.5",children:e("div",{className:"flex items-stretch",children:[e(Be,{ancestors:S,isLast:!0,first:!0,style:v}),e("div",{className:`flex min-w-0 flex-1 items-center text-xs italic text-ink/40 ${v.inset} ${v.padding}`,children:"Loading subagents…"})]})})}return e("div",{"data-testid":"session-branch",className:"space-y-0.5",children:C.map((T,k)=>{let I=k===C.length-1;if(T.kind==="subagent")return e("div",{className:"flex items-stretch",children:[e(Be,{ancestors:S,isLast:I,first:k===0,style:v}),e("div",{className:"min-w-0 flex-1",children:e(zt,{subagent:T.subagent,sessionId:t,style:v,running:h===t&&T.subagent.status==="started"})})]},`subagent:${T.subagent.id}`);let F=String(T.session.id),A={expandable:(l.get(F)?.length??0)>0||Boolean(T.session.hasSubagents),isExpanded:c.has(F),onToggleExpand:()=>p(F),isChild:!0};return e(d,{children:[e("div",{className:"flex items-stretch",children:[e(Be,{ancestors:S,isLast:I,first:k===0,style:v}),e("div",{className:"min-w-0 flex-1",children:g(T.session,A)})]}),A.isExpanded&&e(Bi,{parentId:F,hasSubagents:Boolean(T.session.hasSubagents),childrenOf:l,expandedIds:c,onToggle:p,activeSessionId:h,renderSession:g,style:v,ancestors:[...S,I]})]},F)})})}function Ho(t){let r=new Set(t.map((p)=>String(p.id))),l=new Map,c=[];for(let p of t){let h=p.parentSessionId;if(!h||!r.has(h)||h===String(p.id)){c.push(p);continue}let g=l.get(h);if(g)g.push(p);else l.set(h,[p])}return{roots:c,childrenOf:l}}function lt(t,r,l=1,c=new Set){if(c.has(t))return[];c.add(t);let p=[];for(let h of r.get(t)??[]){if(c.has(String(h.id)))continue;p.push({session:h,depth:l}),p.push(...lt(String(h.id),r,l+1,c))}return p}function Ut(t,r){return t.includes(r)?t.filter((l)=>l!==r):[...t,r]}function Gt(t,r){let l=new Set(t),c=r.filter((p)=>l.has(p)).length;return{count:c,all:r.length>0&&c===r.length,some:c>0&&c<r.length}}function Le(t,r){return t.filter((l)=>r?l.is_archived===1:l.is_archived!==1).map((l)=>String(l.id))}function Kt(t,r){let l=new Set(r);return t.filter((c)=>l.has(c))}function Xt(t,r,{activeSessionId:l,sessionStatus:c={}}){if(t.length<=r)return{rendered:t,hiddenCount:0};let p=new Set;for(let y of t){let N=String(y.id);if((l!==null?String(l)===N:y.is_active===1)||c[N]==="stream"||Boolean(y.awaitingInput))p.add(N)}let h=Ho(t),g=new Set,v=0;for(let y=0;y<h.roots.length;y+=1){let N=h.roots[y],w=String(N.id),C=lt(w,h.childrenOf),T=p.has(w)||C.some((k)=>p.has(String(k.session.id)));if(y<r||T){g.add(w);for(let k of C)g.add(String(k.session.id))}else v+=1}return{rendered:t.filter((y)=>g.has(String(y.id))),hiddenCount:v}}function jt(t,r){return t.mode==="workspace"||t.mode==="session"&&t.scopeFolderId===r}function Zt(t,r){return t.mode==="session"&&t.scopeFolderId===r}function Os({batch:t,folder:r,sessions:l,showArchived:c,visibleCount:p,activeSessionId:h,sessionStatus:g}){let v=t?jt(t,r.id):!1,S=t?Zt(t,r.id):!1,y=S?Le(l,c):v?[String(r.id)]:[],N=t&&v?t.summaryOf(y):null,w=Xt(l,p,{activeSessionId:h,sessionStatus:g});return{folderCheckbox:v,sessionCheckboxes:S,folderSummary:N,selectableIds:y,toggleFolderSelection:()=>{if(!t)return;if(v&&!S){t.toggle(String(r.id));return}if(!S)return;if(N?.all)t.unselectAllOf(y);else t.selectAllOf(y)},rendered:S?l:w.rendered,hiddenCount:S?0:w.hiddenCount}}function $s({touch:t=!1,onRetry:r,refreshing:l=!1}){return e("div",{role:"alert",className:`flex flex-col items-center justify-center gap-2 px-4 text-center ${t?"py-10":"py-8"}`,children:[e("span",{className:"flex h-8 w-8 items-center justify-center rounded-md border border-ink/10 bg-ink/5 text-muted",children:e(_,{size:15,"aria-hidden":"true"})}),e("p",{className:"text-xs font-semibold text-ink",children:"The session list could not be loaded."}),e("p",{className:`text-muted leading-relaxed ${t?"text-xs":"text-[11px]"}`,children:"The live connection closed before the first reply arrived. Your sessions are still on disk; they are not shown here because this tab never received them."}),e("button",{type:"button",onClick:r,disabled:l,"aria-busy":l,className:`mt-1 inline-flex items-center gap-1.5 rounded-md border border-ink/20 bg-paper px-2.5 font-medium text-ink transition-colors hover:bg-ink/5 disabled:opacity-60 ${t?"h-11 text-sm":"h-7 text-xs"}`,children:[e(D,{size:13,className:l?"animate-spin":void 0,"aria-hidden":"true"}),"Try again"]})]})}function Yt({value:t,onChange:r,touch:l=!1}){return e("div",{className:l?"px-3 pt-3 pb-2":"px-3 pt-2 pb-2",children:e("div",{className:`flex items-center gap-1.5 rounded-lg border border-ink/10 bg-ink/[0.04] px-2 transition-colors focus-within:border-ink/30 focus-within:bg-paper ${l?"h-9":"h-7"}`,children:[e(U,{size:l?15:13,"aria-hidden":"true",className:"shrink-0 text-ink/35"}),e("input",{type:"search",value:t,onChange:(c)=>r(c.currentTarget.value),placeholder:"Search workspaces & sessions","aria-label":"Search workspaces and sessions",className:`kabmo-search-field min-w-0 flex-1 bg-transparent text-ink outline-none placeholder:text-ink/40 ${l?"text-[13px]":"text-xs"}`}),t.length>0&&e("button",{type:"button",onClick:()=>r(""),title:"Clear search","aria-label":"Clear search",className:"-mr-0.5 shrink-0 rounded p-0.5 text-ink/40 transition-colors cursor-pointer hover:bg-ink/10 hover:text-ink",children:e(b,{size:l?14:12})})]})})}var Ne={all:32,running:69,runningCount:14,archived:79,select:66};function Eo(t,r){let l=[Ne.all,Ne.running+(t>0?Ne.runningCount:0),Ne.archived,...r?[Ne.select]:[]];return l.reduce((c,p)=>c+p,0)+(l.length-1)*4}var Me={chip:105,icon:22};function qt(t,r){if(!(t>0))return{select:"mini",harness:"icon",wrap:!1};let l=Eo(r,!1),c=(p,h)=>l+8+p+h<=t;if(c(Me.chip,Ne.select))return{select:"chip",harness:"chip",wrap:!1};if(c(Me.chip,28))return{select:"button",harness:"chip",wrap:!1};if(c(Me.icon,28))return{select:"button",harness:"icon",wrap:!1};if(c(Me.icon,22))return{select:"mini",harness:"icon",wrap:!1};return{select:"mini",harness:"icon",wrap:!0}}var We="inline-flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-[11px] font-medium transition-colors cursor-pointer",ct="border-ink bg-ink text-paper",ze="border-ink/15 text-ink/60 hover:border-ink/30 hover:text-ink",Do=(t)=>t?"Cancel":"Select";function Jt({focus:t,onFocusChange:r,runningCount:l,showArchived:c,onToggleArchived:p,harnessFilter:h,onHarnessFilterChange:g,harnessOptions:v,selecting:S,onToggleSelect:y}){let{ref:N,width:w}=Ss(0),C=qt(w,l),T=S?e(b,{size:10}):e(Fr,{size:10}),k=e(Ts,{options:v,value:h,onChange:g,form:C.wrap?"chip":C.harness});return e("div",{className:"px-3 pb-2",children:e("div",{ref:N,className:`flex items-center gap-1 ${C.wrap?"flex-wrap":"flex-nowrap"}`,children:[e("div",{className:"flex shrink-0 items-center gap-1",role:"group","aria-label":"Session filters",children:[e("button",{type:"button",onClick:()=>r("all"),"aria-pressed":t==="all",className:`${We} ${t==="all"?ct:ze}`,children:"All"}),e("button",{type:"button",onClick:()=>r("running"),"aria-pressed":t==="running",title:l>0?`${l} running or waiting`:"Nothing running",className:`${We} ${t==="running"?ct:ze}`,children:[e("span",{"aria-hidden":"true",className:`h-1.5 w-1.5 rounded-full ${l>0?"bg-current":"bg-current opacity-30"}`}),"Running",l>0&&e("span",{className:"font-mono tabular-nums opacity-70",children:l})]}),e("button",{type:"button",onClick:p,"aria-pressed":c,title:c?"Hide archived sessions":"Show archived sessions",className:`${We} ${c?"border-warning/40 bg-warning/10 text-warning hover:bg-warning/15":ze}`,children:[e(at,{size:10}),"Archived"]})]}),C.wrap?null:k,C.select==="chip"?e("button",{type:"button",onClick:y,"aria-pressed":S,title:S?"Cancel selection":"Select workspaces",className:`${We} ml-auto ${S?ct:ze}`,children:[T,Do(S)]}):e("button",{type:"button",onClick:y,title:S?"Cancel selection":"Select workspaces","aria-label":S?"Cancel selection":"Select workspaces","aria-pressed":S,className:`ml-auto inline-flex shrink-0 items-center justify-center rounded-md transition-colors cursor-pointer ${C.select==="mini"?"h-[22px] w-[22px]":"h-7 w-7"} ${S?"bg-ink/10 text-ink":"text-ink/55 hover:bg-ink/[0.06] hover:text-ink"}`,children:S?e(b,{size:C.select==="mini"?12:14}):e(Fr,{size:C.select==="mini"?12:14})}),C.wrap?k:null]})})}var _o="shrink-0 inline-flex items-center justify-center rounded-md text-ink/55 transition-colors cursor-pointer hover:bg-ink/[0.06] hover:text-ink",Bo="bg-ink/10 text-ink",en={"A-Z":"A–Z","Z-A":"Z–A",LATEST_SESSION:"Latest chat",LATEST_ADDED:"Latest added"};function tn({onNewSession:t,onNewWorkspace:r,onScheduler:l,scheduledCount:c,onRefresh:p,refreshing:h,sortOption:g,optionsOpen:v,onToggleOptions:S,onCloseOptions:y,onSortChange:N,touch:w=!1}){let C=`${_o} ${w?$e.mobile:$e.desktop}`,T=c>0?`Scheduled tasks (${c} armed)`:"Scheduled tasks";return e("div",{className:`flex items-center ${gl} px-3 pb-2`,children:[e("button",{type:"button",onClick:t,title:"New Session","aria-label":"New Session",className:`flex min-w-0 flex-1 items-center justify-center gap-1.5 rounded-md bg-ink px-2 font-semibold text-canvas transition-colors cursor-pointer hover:bg-ink/90 ${w?"h-9 text-[13px]":"h-7 text-xs"}`,children:[e(P,{size:w?16:14,className:"shrink-0"}),e("span",{className:"truncate",children:"New Session"})]}),e("div",{className:`flex shrink-0 items-center ${bs}`,children:[e("button",{type:"button",onClick:r,title:"New Workspace","aria-label":"New Workspace",className:C,children:e(pn,{size:w?16:14})}),e("button",{type:"button",onClick:l,title:T,"aria-label":c>0?`Scheduled tasks, ${c} armed`:"Scheduled tasks",className:`relative ${C}`,children:[e(Qa,{size:w?16:14}),c>0&&e("span",{className:"absolute right-0.5 top-0.5 min-w-[10px] rounded-full bg-ink px-[2px] text-center text-[7px] font-semibold leading-[10px] text-canvas",children:c>9?"9+":c})]}),e("button",{type:"button",onClick:p,title:"Refresh sessions","aria-label":"Refresh sessions","aria-busy":h,className:C,children:e(D,{size:w?16:14,className:h?"animate-spin":""})}),e("div",{className:"relative",children:[e("button",{type:"button",onClick:S,title:`Sort: ${en[g]}`,"aria-label":`Sort workspaces, currently ${en[g]}`,"aria-haspopup":"menu","aria-expanded":v,className:`${C} ${v||g!=="A-Z"?Bo:""}`,children:e(_s,{size:w?16:14})}),v&&e("div",{className:"glass-popover absolute right-0 top-full z-50 mt-1 w-48 rounded-lg border border-ink/15 bg-paper py-1 shadow-lg",onMouseLeave:y,children:e(jo,{variant:"desktop",sortOption:g,onSortChange:N})})]})]})]})}function nn({title:t,status:r,awaitingInput:l=!1,renaming:c=!1,waitingFor:p,expandable:h=!1,isExpanded:g=!1,onToggleExpand:v,child:S=!1,selectable:y=!1,selected:N=!1,onToggleSelect:w,touch:C=!1}){if(y)return e("span",{className:"flex shrink-0 items-center",children:[e(Lr,{checked:N,label:`Select ${t}`,onChange:()=>w?.()}),e("span",{className:"w-2 shrink-0"})]});let T=C?14:13,k=Boolean(p),I=l||r==="stream"||k,F=Boolean(h&&v)&&!I&&!c,R=Boolean(c||l||k||r)&&!F;return e(d,{children:[e("span",{className:`relative shrink-0 ${C?"w-[18px] h-5":"w-4 h-4"}`,children:[h&&v&&e("button",{type:"button",onClick:(A)=>{A.stopPropagation(),v(A)},title:g?"Collapse sessions and subagents":"Expand sessions and subagents","aria-expanded":g,"aria-label":g?"Collapse sessions and subagents":"Expand sessions and subagents",className:`peer absolute inset-0 flex items-center justify-center rounded cursor-pointer transition-opacity ${F?"text-ink/55 hover:text-ink":"text-ink/40 opacity-0 hover:text-ink group-hover/item:opacity-100 focus-visible:opacity-100"}`,children:g?e(B,{size:T}):e(se,{size:T})}),R&&e("span",{className:`pointer-events-none absolute inset-0 flex items-center justify-center text-ink/60 transition-opacity ${h?"group-hover/item:opacity-0 peer-focus-visible:opacity-0":""}`,children:c?e("span",{role:"status","aria-label":"Generating a name…",children:e(m,{size:T-1,className:"animate-spin"})}):l?e(De,{size:T-1,className:"animate-pulse text-warning"}):k?e("span",{role:"status","aria-label":`Waiting for ${p?.title??"another session"}`,children:e(qe,{size:T-1,className:"animate-pulse"})}):r==="stream"?e("span",{role:"status","aria-label":"Running",children:e(m,{size:T-1,className:"animate-spin"})}):e(f,{size:T-1})}),S&&!(h&&v)&&!R&&e("span",{"data-testid":"child-indicator","aria-hidden":"true",className:"pointer-events-none absolute inset-0 flex items-center justify-center text-ink/35",children:e(me,{size:T-1,"aria-hidden":"true"})})]}),e("span",{className:"w-2 shrink-0"})]})}function on({timeAgo:t,timeTitle:r,runStartedAt:l,onOpenMenu:c,menuOpen:p=!1,touch:h=!1}){let g=(S)=>e(Fs,{timeAgo:t,timeTitle:r,runStartedAt:l,className:S});if(!c)return g("ml-2 shrink-0 font-mono text-[10px]");let v=e("button",{type:"button",onClick:c,title:"Session actions","aria-label":"Session actions","aria-haspopup":"menu","aria-expanded":p,className:`shrink-0 rounded text-ink/40 hover:bg-ink/10 hover:text-ink cursor-pointer ${h?"p-1.5":"p-1"} ${h?"":"opacity-0 transition-opacity group-hover/item:opacity-100 group-focus-within/item:opacity-100 focus-visible:opacity-100"}`,children:e(Ee,{size:h?16:14})});if(h)return e("span",{className:"ml-1 flex shrink-0 items-center gap-0.5",children:[g("font-mono text-[10px]"),v]});return e("span",{className:"relative ml-2 flex h-4 min-w-8 shrink-0 items-center justify-end pr-1",children:[g("whitespace-nowrap font-mono text-[10px] leading-none transition-opacity group-hover/item:opacity-0 group-focus-within/item:opacity-0"),e("span",{className:"absolute right-0 -my-1 flex",children:v})]})}function sn(t){return{inset:t?"pl-1 pr-1":"pl-1 pr-[3px]",insetPx:4,slotWidth:t?18:16,markGap:8,padding:t?"py-0.5":"py-[7px]",glyph:t?tt.touch:tt.compact}}function rn({sessionId:t,title:r,harness:l,isActive:c=!1,isArchived:p=!1,status:h,awaitingInput:g=!1,timeAgo:v,timeTitle:S,runStartedAt:y,worktree:N,waitingFor:w,expandable:C=!1,isExpanded:T=!1,onToggleExpand:k,isChild:I=!1,folderId:F,onClick:R,onRename:A,onRenameWithAi:O,onArchive:M,onDelete:q,onCancelWait:ee,selectable:X=!1,selected:re=!1,onToggleSelect:ae,density:Y="compact"}){let V=Y==="touch",pe=Ta(t),W=Lo(),{isEditing:ge,draft:fe,setDraft:ce,inputRef:J,startRename:ke,handleKeyDown:ve,handleBlur:te}=Fo(r,A),oe=Boolean(A||M||q||ee),Q=W.anchor!==null,ye=Boolean(w),ie=r.charAt(0).toUpperCase()+r.slice(1);if(ge)return e("div",{className:`flex w-full items-center rounded-lg bg-ink/10 ${V?"px-2 py-1.5":"px-2 py-1"}`,children:e("input",{ref:J,autoFocus:!0,value:fe,onChange:(he)=>ce(he.currentTarget.value),onClick:(he)=>he.stopPropagation(),onKeyDown:ve,onBlur:te,"aria-label":"Session name",className:"min-w-0 flex-1 rounded border border-ink/25 bg-paper px-2 py-0.5 text-xs text-ink outline-none focus:border-ink/50"})});return e(d,{children:[e("div",{"data-testid":"session-item","data-session-id":String(t),"data-selected":X&&re?"true":void 0,"data-menu-open":Q?"true":void 0,onClick:X?ae:R,onContextMenu:oe&&!X?W.openAtCursor:void 0,className:`group/item relative flex w-full items-center rounded-lg text-xs transition-colors select-none cursor-pointer ${V?"py-0.5 pl-1 pr-1":"py-[7px] pl-1 pr-[3px]"} ${X&&re||Q?Ls:c?"bg-ink/[0.08] font-medium text-ink":"text-ink/75 hover:bg-ink/[0.04] hover:text-ink"}`,children:[c&&!X&&e("span",{"aria-hidden":"true",className:"absolute left-0 top-1.5 bottom-1.5 w-[2px] rounded-full bg-ink"}),e(nn,{title:r,status:h,awaitingInput:g,renaming:pe,waitingFor:w,expandable:C,isExpanded:T,onToggleExpand:k,child:I,selectable:X,selected:re,onToggleSelect:ae,touch:V}),l&&e("span",{className:"mr-1.5 flex shrink-0 items-center",children:e(Ke,{harness:l,size:V?tt.touch:tt.compact})}),e("span",{className:`flex min-w-0 flex-1 flex-col leading-snug ${p?"text-ink/45":""}`,children:[e("span",{className:"min-w-0 truncate",children:ie}),ye&&e("span",{className:"truncate text-[10px] font-normal text-ink/40",children:["waiting for ",w?.title??"another session"]}),N&&e(Qs,{worktree:N})]}),e(on,{timeAgo:v,timeTitle:S,runStartedAt:y,touch:V,menuOpen:Q,onOpenMenu:oe&&!X?W.openBelow:void 0})]}),W.anchor&&e(Mo,{anchor:W.anchor,sessionId:t,...l?{harness:l}:{},...F!==void 0?{folderId:F}:{},isArchived:p,onRename:A?ke:void 0,onRenameWithAi:O,onArchive:M,onDelete:q,onCancelWait:ee,onClose:W.close})]})}function $o(t){let r=t.parentElement;while(r){let l=getComputedStyle(r);if(/(auto|scroll|overlay)/.test(l.overflowY))return r;r=r.parentElement}return null}function an(t){let[r,l]=n(!1);return o(()=>{let c=t.current;if(!c)return;let p=$o(c),h=!1,g=()=>{h=!1;let y=p?p.getBoundingClientRect():{top:0},N=p?p.scrollTop>0:window.scrollY>0,w=c.getBoundingClientRect();l(N&&w.top<=y.top+0.5&&w.bottom>y.top)},v=()=>{if(h)return;h=!0,requestAnimationFrame(g)};g();let S=typeof ResizeObserver>"u"?null:new ResizeObserver(v);if(S?.observe(c),p)S?.observe(p);return(p??window).addEventListener("scroll",v,{passive:!0}),window.addEventListener("resize",v),()=>{h=!1,S?.disconnect(),(p??window).removeEventListener("scroll",v),window.removeEventListener("resize",v)}},[t]),r}function ln({folder:t,isOpen:r,onToggleFolder:l,sessionCount:c,checkbox:p,batchActive:h,showMenu:g,onToggleMenu:v,onCloseMenu:S,onNewSession:y,menu:N,touch:w=!1}){let C=ra(t.icon),T=t.accentColor||void 0,k=i(null),[I,F]=n(null),R=i(null),A=an(R);return e("div",{ref:R,"data-stuck":A?"":void 0,className:`group/ws sticky top-0 z-10 -mx-1 flex items-center gap-1 rounded-md px-1 text-xs font-semibold text-ink ${w?"h-8 bg-canvas glass-sticky":"h-[26px] bg-paper glass-sticky"}`,children:[e("button",{type:"button",onClick:h?void 0:l,"aria-expanded":r,"aria-label":`${t.name}${r?", collapse":", expand"}`,className:"flex h-full min-w-0 flex-1 items-center gap-2 rounded-md px-1 text-left cursor-pointer hover:bg-ink/[0.04]",children:[p?e(Lr,{size:"md",checked:p.checked,indeterminate:p.indeterminate,label:p.label,onChange:p.onChange}):e("span",{className:`relative flex shrink-0 items-center justify-center ${w?"h-[18px] w-[18px]":"h-4 w-4"}`,children:t.customIconUrl?e("img",{src:t.customIconUrl,alt:"",className:"h-[15px] w-[15px] shrink-0 rounded-xs object-contain",referrerPolicy:"no-referrer"}):e(C,{size:15,className:"project-accent-mark text-ink/70",style:pl(T)})}),e("span",{className:"glass-sticky-label truncate text-[13px] font-semibold tracking-tight",children:t.name}),t.isPinned&&e(Br,{size:10,className:"shrink-0 text-ink/45"}),T&&!p&&e("span",{"aria-hidden":"true",className:"h-1.5 w-1.5 shrink-0 rounded-full",style:{backgroundColor:T}}),e("span",{className:"glass-sticky-label shrink-0 font-mono text-[10px] font-normal tabular-nums text-ink/35",children:c}),e("span",{className:"ml-auto shrink-0 text-ink/40",children:r?e(B,{size:w?14:12}):e(se,{size:w?14:12})})]}),!h&&e("div",{className:`flex shrink-0 items-center gap-0.5 ${w?"pr-1":"pr-[3px]"}`,children:[e("button",{type:"button",title:"New Session","aria-label":`New session in ${t.name}`,onClick:(O)=>{O.stopPropagation(),y()},className:`flex items-center justify-center rounded text-ink/40 transition-colors cursor-pointer hover:bg-ink/10 hover:text-ink ${w?"h-7 w-7":"h-[22px] w-[22px]"}`,children:e(P,{size:w?15:12})}),e("div",{className:"relative flex items-center",children:[e("button",{ref:k,type:"button",title:`Options for ${t.name}`,"aria-label":`Options for ${t.name}`,"aria-haspopup":"menu","aria-expanded":g,onClick:(O)=>{if(O.stopPropagation(),k.current)F(Et(k.current));v()},className:`flex items-center justify-center rounded text-ink/40 transition-colors cursor-pointer hover:bg-ink/10 hover:text-ink ${w?"h-7 w-7":"h-[22px] w-[22px]"}`,children:e(Ee,{size:w?15:12})}),e(Qt,{anchor:g&&N?I:null,align:"end",ariaLabel:`Options for ${t.name}`,className:"glass-popover w-44 rounded-md border border-ink/15 bg-paper py-1 text-xs shadow-lg",onClose:S,children:N})]})]})]})}function cn({hiddenCount:t,canShowLess:r,onShowMore:l,onShowLess:c}){if(t<=0&&!r)return null;return e("div",{className:"flex items-center gap-1 pl-6",children:[t>0&&e("button",{type:"button",onClick:l,className:"min-w-0 truncate rounded-md px-1 py-1 text-[11px] text-ink/45 transition-colors cursor-pointer hover:bg-ink/[0.04] hover:text-ink/80",children:[e(B,{size:11,className:"mr-1 inline align-[-2px]"}),t," more"]}),r&&e("button",{type:"button",onClick:c,className:"ml-auto shrink-0 rounded-md px-1 py-1 text-[11px] text-ink/45 transition-colors cursor-pointer hover:bg-ink/[0.04] hover:text-ink/80",children:[e(ot,{size:11,className:"mr-1 inline align-[-2px]"}),"Less"]})]})}function dn({folder:t,activeSessionId:r,sessionStatus:l,showArchived:c,forceExpanded:p=!1,density:h="compact",batch:g,onSelectSession:v,onNewSessionForFolder:S,onNewWorktreeSession:y,onToast:N,onStartSessionSelection:w,onCancelWait:C}){let[T,k]=n(t.isExpanded||!1),[I,F]=n(!1),[R,A]=n(!1),{visibleCount:O,showMore:M,showLess:q,canShowLess:ee}=Ds(),[X]=le(),re=X.get("subagent"),ae=X.get("sessionId"),{expandedSessionIds:Y,toggleSession:V}=hs(),{refresh:pe,runStartedAtMap:W}=Ve(),ge=ut(),{confirmDelete:fe,requestDelete:ce,cancelDelete:J,handlePin:ke,handleDelete:ve,handleArchive:te,handleRename:oe,handleRenameWithAi:Q,handleOpenFolder:ye}=Ns(t,pe,N),ie=Qo();o(()=>{if(typeof t.isExpanded==="boolean")k(t.isExpanded)},[t.isExpanded]);let he=()=>{F(!1),J()},je=()=>{let z=!T;if(k(z),typeof t.id!=="number")return;ge.submit({isExpanded:String(z)},{method:"POST",action:`/api/folders/${t.id}/toggle`})},Te=t.sessions.filter((z)=>c?z.is_archived===1:z.is_archived!==1),{folderCheckbox:Ae,sessionCheckboxes:Ce,folderSummary:xe,toggleFolderSelection:Ye,rendered:Je,hiddenCount:H}=Os({batch:g,folder:t,sessions:Te,showArchived:c,visibleCount:O,activeSessionId:r,sessionStatus:l}),j=Ho(Je),G=p||T||Ce,Oe=(z,we)=>{let de=String(z.id),mt=r===null?z.is_active===1:String(r)===de,Hn=mt&&ae===de&&Boolean(re),Qe=It(de);return e(rn,{sessionId:z.id,title:z.title,harness:z.harness,folderId:z.folder_id,density:h,isActive:mt&&!Hn,isArchived:z.is_archived===1,status:l[de],awaitingInput:Boolean(z.awaitingInput),timeAgo:Rs(z.updated_at??z.created_at),timeTitle:qo(z.updated_at??z.created_at),runStartedAt:l[de]==="stream"?W[de]:void 0,worktree:z.worktree,waitingFor:z.waitingFor?{title:z.waitingFor.title}:void 0,expandable:we.expandable,isChild:we.isChild,isExpanded:we.isExpanded,onToggleExpand:we.onToggleExpand,onClick:()=>v(z.id),onArchive:()=>te(z),onDelete:Qe?void 0:()=>ie.requestDelete(z),onRename:Qe?void 0:(Un)=>void oe(z,Un),onRenameWithAi:Qe?void 0:()=>void Q(z),onCancelWait:z.waitingFor?()=>C?.(z.waitingFor.waitId):void 0,selectable:Ce,selected:Boolean(g?.selected.includes(de)),onToggleSelect:g?()=>g.toggle(de):void 0})},Wn=(z)=>Ps(z,j.childrenOf,Y,V),pt=Boolean(y&&t.project_path);return e("div",{className:"space-y-0.5",children:[e(ln,{folder:t,isOpen:G,onToggleFolder:je,sessionCount:Te.length,checkbox:Ae&&xe?{checked:xe.all,indeterminate:xe.some,label:`Select ${t.name}`,onChange:Ye}:null,batchActive:Boolean(g),showMenu:I,onToggleMenu:()=>F((z)=>!z),onCloseMenu:he,onNewSession:()=>S(t.id),touch:h==="touch",menu:e(Ms,{variant:"desktop",isPinned:t.isPinned,onOpenFolder:ye?()=>{ye(),F(!1)}:void 0,onSelectSessions:w?()=>{F(!1),w(t.id)}:void 0,onNewWorktree:pt?()=>{F(!1),A(!0)}:void 0,confirmDelete:fe,onPin:()=>{ke(),F(!1)},onDelete:()=>{ve(),F(!1)},onRequestDelete:ce,onCancelDelete:J})}),G&&e("div",{className:"space-y-0.5",children:[j.roots.map((z)=>{let we=String(z.id),de=Wn(z);return e("div",{className:"space-y-0.5",children:[Oe(z,de),de.isExpanded&&e(Bi,{parentId:we,hasSubagents:Boolean(z.hasSubagents),childrenOf:j.childrenOf,expandedIds:Y,onToggle:V,activeSessionId:r===null?null:String(r),renderSession:Oe,style:sn(h==="touch")})]},z.id)}),!Ce&&e(cn,{hiddenCount:H,canShowLess:ee,onShowMore:M,onShowLess:q}),Te.length===0&&e("div",{className:"px-1 py-1 pl-6 text-[11px] italic text-ink/40",children:c?"No archived sessions.":"No sessions."})]}),e(Ro,{session:ie.pending,isDeleting:ie.isDeleting,error:ie.error,onClose:ie.cancelDelete,onConfirm:()=>void ie.confirmDelete()}),pt&&e(Po,{isOpen:R,onClose:()=>A(!1),root:t.project_path??null,folderId:t.id,folderName:t.name,onCreated:(z)=>{A(!1),y?.(t.id,z.path)}})]})}var Wo=[3,2];function mn({touch:t=!1}){return e("div",{className:"space-y-3","aria-hidden":"true",children:Wo.map((r,l)=>e("div",{className:"space-y-0.5",children:[e("div",{className:`flex items-center gap-2 px-1 ${t?"h-8":"h-[26px]"}`,children:[e("span",{className:`animate-pulse rounded-sm bg-ink/10 ${t?"h-[18px] w-[18px]":"h-4 w-4"}`}),e("span",{className:"h-3 w-24 animate-pulse rounded bg-ink/10"})]}),Array.from({length:r},(c,p)=>e("div",{className:`flex items-center gap-2 pl-1 pr-2 ${t?"h-8":"h-[31px]"}`,children:[e("span",{className:`shrink-0 animate-pulse rounded-full bg-ink/10 ${t?"h-[18px] w-[18px]":"h-4 w-4"}`}),e("span",{className:"h-3 animate-pulse rounded bg-ink/10",style:{width:`${58-p%3*12}%`}})]},p))]},l))})}function fn(t,r){if(t.awaitingInput)return!0;if(t.waitingFor)return!0;return r==="stream"}function hn(t,{focus:r,statusOf:l}){if(r==="all")return t;return t.map((c)=>({...c,sessions:c.sessions.filter((p)=>fn(p,l(String(p.id))))})).filter((c)=>c.sessions.length>0)}function gn(t,r){let l=0;for(let c of t)for(let p of c.sessions)if(fn(p,r(String(p.id))))l+=1;return l}function xu({className:t="",folders:r,initializing:l,failed:c,activeSessionId:p,sessionStatus:h,searchQuery:g,onSearchChange:v,showArchived:S,onToggleArchived:y,sortOption:N,optionsOpen:w,onToggleOptions:C,onCloseOptions:T,onSortChange:k,harnessFilter:I,onHarnessFilterChange:F,harnessOptions:R,onRefresh:A,refreshing:O,scheduledCount:M,onNewSession:q,onNewWorkspace:ee,onScheduler:X,onSelectSession:re,onNewSessionForFolder:ae,onNewWorktreeSession:Y,onToast:V,onCancelWait:pe,batch:W,onSelectWorkspaces:ge,onStartSessionSelection:fe,touch:ce=!1}){let[J,ke]=n("all"),ve=u(()=>gn(r,(Q)=>h[Q]),[r,h]),te=u(()=>hn(r,{focus:J,statusOf:(Q)=>h[Q]}),[r,J,h]),oe=Boolean(W);return e("div",{className:`flex flex-col ${t}`,children:[e(Yt,{value:g,onChange:v,touch:ce}),e(Jt,{focus:J,onFocusChange:ke,runningCount:ve,showArchived:S,onToggleArchived:y,harnessFilter:I,onHarnessFilterChange:F,harnessOptions:R,selecting:oe,onToggleSelect:ge}),e(tn,{onNewSession:q,onNewWorkspace:ee,onScheduler:X,scheduledCount:M,onRefresh:A,refreshing:O,sortOption:N,optionsOpen:w,onToggleOptions:C,onCloseOptions:T,onSortChange:k,touch:ce}),e("div",{className:"mt-1 flex-1 scrollbar-overlay-container pl-2 session-list-gutter pb-3",children:c?e($s,{touch:ce,onRetry:A,refreshing:O}):l?e(mn,{touch:ce}):te.length===0?e("div",{className:"px-1 py-8 text-center text-[11px] leading-relaxed text-muted",children:J==="running"?"Nothing is running right now.":g?"No workspace or chat matches that search.":I?`No chats on ${ta(I)}.`:"No workspaces yet."}):e("div",{className:"space-y-3",children:te.map((Q)=>e(dn,{folder:Q,activeSessionId:p,sessionStatus:h,showArchived:S,forceExpanded:g.trim().length>0,density:ce?"touch":"compact",batch:W,onSelectSession:re,onNewSessionForFolder:ae,onNewWorktreeSession:Y,onToast:V,onStartSessionSelection:fe,onCancelWait:pe},Q.id))})})]})}function zo(t){if(!t)return Number.NaN;let r=Date.parse(t);return Number.isFinite(r)?r:Number.NaN}function bn(t){let r=Number.NEGATIVE_INFINITY;for(let l of t.sessions??[]){let c=zo(l.updated_at??l.created_at);if(c>r)r=c}return r}function xn(t){let r=Number.NEGATIVE_INFINITY;for(let l of t.sessions??[]){let c=Number(l.id);if(Number.isFinite(c)&&c>r)r=c}return r}function Se(t){let r=Number(t.id);return Number.isFinite(r)?r:Number.NEGATIVE_INFINITY}function He(t,r){if(t===r)return 0;return t>r?-1:1}function Sn(t,r){if(t===r)return 0;return t>r?1:-1}function Uo(t,r,l){let c=Boolean(t.isPinned),p=Boolean(r.isPinned);if(c!==p)return c?-1:1;switch(l){case"Z-A":{let h=r.name.localeCompare(t.name);return h!==0?h:Sn(Se(t),Se(r))}case"LATEST_SESSION":{let h=He(bn(t),bn(r));if(h!==0)return h;let g=He(xn(t),xn(r));if(g!==0)return g;let v=He(Se(t),Se(r));return v!==0?v:t.name.localeCompare(r.name)}case"LATEST_ADDED":{let h=He(Se(t),Se(r));return h!==0?h:t.name.localeCompare(r.name)}case"A-Z":default:{let h=t.name.localeCompare(r.name);return h!==0?h:Sn(Se(t),Se(r))}}}function kn(t,r){return[...t].sort((l,c)=>Uo(l,c,r))}var Go=["A-Z","Z-A","LATEST_SESSION","LATEST_ADDED"],vn="LATEST_SESSION";function yn(t){return typeof t==="string"&&Go.includes(t)}function wn(t,r,l){if(r.length===0||t.length===0)return t;let c=new Set;for(let g of t)for(let v of g.sessions??[])c.add(String(v.id));let p=r.filter((g)=>!c.has(String(g.id)));if(p.length===0)return t;let h=t;for(let g of p){let v=Tn(h,g,l);if(!v)continue;let S=new Date(g.createdAt).toISOString(),y={id:g.id,folder_id:v.id,title:g.title??l.titleFor?.(String(g.id))??Fm(g.id),created_at:S,updated_at:S,...g.parentSessionId?{parentSessionId:g.parentSessionId}:{},...g.harness?{harness:g.harness}:{},...g.waiting?{waitingFor:{waitId:g.waiting.waitId,sessionId:g.waiting.dependsOn,title:g.waiting.dependsOnTitle}}:{}};h=h.map((N)=>N.id===v.id?{...N,isExpanded:!0,sessions:[y,...N.sessions??[]]}:N)}return h}function Nn(t,r,l){if(r.length===0||t.length===0)return[];let c=new Set;for(let p of r){let h=Tn(t,p,l);if(h)c.add(String(h.id))}return[...c]}function Tn(t,r,l){if(r.folderId!==null&&r.folderId!==void 0){let c=t.find((p)=>String(p.id)===String(r.folderId));if(c)return c}if(l.activeId){let c=t.find((p)=>(p.sessions??[]).some((h)=>String(h.id)===String(l.activeId)));if(c)return c}if(l.urlFolderId){let c=t.find((p)=>String(p.id)===String(l.urlFolderId));if(c)return c}return t[0]}function Cn(t,r,l){if(!r.trim())return t;let c=r.toLowerCase(),p=(h)=>h.title.toLowerCase().includes(c)||String(h.id).toLowerCase().includes(c);if(l)return t.filter((h)=>{let g=h.name.toLowerCase().includes(c),v=h.sessions?.some(p);return g||v}).map((h)=>{let g=h.sessions?.filter((v)=>h.name.toLowerCase().includes(c)||p(v));return{...h,sessions:g,isExpanded:!0}});return t.map((h)=>{let g=h.name.toLowerCase().includes(c),v=(h.sessions||[]).filter(p);if(g)return h;return{...h,sessions:v}}).filter((h)=>h.sessions&&h.sessions.length>0)}async function Ud(t,r){try{return(await fetch(`/api/folders/${encodeURIComponent(String(t))}/toggle`,{method:"POST",body:new URLSearchParams({isExpanded:String(r)})})).ok}catch(l){return console.error("Failed to save workspace expansion:",l),!1}}function In(t,r){return t.find((l)=>(l.sessions??[]).some((c)=>String(c.id)===r))}function Rn(t){let{folders:r,initializing:l,runningIds:c,pendingEntries:p,activeId:h,urlFolderId:g}=t,v=u(()=>{let y=new Set;for(let N of c){let w=In(r,N);if(w)y.add(String(w.id))}return y},[r,c]),S=i({running:new Set,pending:new Set});return o(()=>{if(l||r.length===0)return;let y=S.current,N=new Set,w=new Set,C=new Set;for(let k of c){if(y.running.has(k)){N.add(k);continue}let I=In(r,k);if(!I)continue;N.add(k),C.add(String(I.id))}let T={activeId:h,urlFolderId:g};for(let k of p){let I=String(k.id);if(y.pending.has(I)){w.add(I);continue}w.add(I);for(let F of Nn(r,[k],T))C.add(F)}y.running=N,y.pending=w;for(let k of C){let I=r.find((F)=>String(F.id)===k);if(!I||I.isExpanded)continue;Ud(k,!0)}},[l,r,c,p,h,g]),v}function An(t){let r=new Map;for(let l of t)for(let c of l.sessions){if(!c.harness)continue;r.set(c.harness,(r.get(c.harness)??0)+1)}return[...r].map(([l,c])=>({harness:l,label:ta(l),count:c})).sort((l,c)=>c.count-l.count||l.label.localeCompare(c.label))}function Pn(t,r){if(!r)return t;return t.map((l)=>({...l,sessions:l.sessions.filter((c)=>c.harness===r)})).filter((l)=>l.sessions.length>0)}var Ko=200;function wu(t={},r={}){let{expandSearchMatches:l=!1,onSelectSession:c,onAfterSelect:p}=r,{folders:h,initializing:g,failed:v,refresh:S,refreshNow:y,refreshing:N,isRefreshing:w,markSeen:C,hasSeen:T,streamStatusMap:k,titleHint:I}=Ve(),[F,R]=le(),A=F.get("sessionId"),O=F.get("folderId"),M=A?Number.isNaN(Number(A))?A:Number(A):null,q=i(S);q.current=S;let ee=a(()=>q.current(),[]),[X,re]=n(""),[ae,Y]=n(!1),[V,pe]=n(null),[W,ge]=n(!1),[fe,ce]=n(()=>yn(t.omp_sidebar_sort)?t.omp_sidebar_sort:vn),J=i(null),ke=a((H)=>{if(J.current)clearTimeout(J.current);J.current=setTimeout(()=>{it("omp_sidebar_sort",H)},Ko)},[]);o(()=>()=>{if(J.current)clearTimeout(J.current)},[]);let ve=(H)=>{ce(H),ge(!1),ke(H)},te=k;Th(te,M,ee,T);let oe=Lm(),{prompts:Q,loaded:ye}=Oc(),ie=u(()=>new Set(Object.entries(te).filter(([,H])=>H==="stream").map(([H])=>H)),[te]),he=Rn({folders:h,initializing:g,runningIds:ie,pendingEntries:oe,activeId:A,urlFolderId:O});o(()=>{if(!A||g)return;if(h.some((H)=>(H.sessions??[]).some((j)=>String(j.id)===A)))return;Dh(A,O,te[A]==="stream")},[A,h,g,O,te]),o(()=>{if(g||!ye)return;for(let H of oe){let j=String(H.id),G=Q.find((Oe)=>Oe.pendingId===j&&Oe.status==="waiting");if(!G||H.waiting?.waitId===G.id)continue;jm(j,{waitId:G.id,dependsOn:G.dependsOn,dependsOnTitle:G.dependsOnTitle})}},[oe,Q,ye,g]);let[je,Te]=n(0),Ae=oe.map((H)=>String(H.id)).join(`
2
+ `);o(()=>{let H=()=>Te((G)=>G+1),j=Ae.split(`
3
+ `).filter(Boolean).flatMap((G)=>[Xr(G,gs,H),Xr(G,As,H)]);return()=>{for(let G of j)G()}},[Ae]),o(()=>{if(g)return;let H=new Set;for(let j of h)for(let G of j.sessions??[])H.add(String(G.id));Nh({listed:H,running:ie,activeId:A})},[h,g,ie,A,je]);let Ce=(H)=>{if(C(H),c)c(H);else R((j)=>{let G=Rt(j);if(G.set("sessionId",H.toString()),G.has("subagent"))G.delete("subagent");return G},{replace:!0});p?.()},xe=u(()=>wn(h,oe,{activeId:A,urlFolderId:O,titleFor:I}),[h,oe,A,O,I]),Ye=u(()=>An(xe),[xe]),Je=u(()=>{let H=Cn(xe,X,l);if(H=Pn(H,V),he.size>0)H=H.map((j)=>he.has(String(j.id))?{...j,isExpanded:!0}:j);return kn(H,fe)},[xe,X,V,fe,l,he]);return{folders:h,initializing:g,failed:v,refresh:ee,refreshNow:y,refreshing:N,isRefreshing:w,activeSessionId:M,sessionParam:A,searchQuery:X,setSearchQuery:re,showArchived:ae,setShowArchived:Y,optionsOpen:W,setOptionsOpen:ge,sortOption:fe,handleSortChange:ve,harnessFilter:V,setHarnessFilter:pe,harnessOptions:Ye,processedFolders:Je,sessionStatus:te,handleSelectSession:Ce}}function Cu({onNotice:t}={}){let{prompts:r}=Oc(),[,l]=le(),c=i(t);c.current=t;let p=i(new Set);o(()=>{let h=new URLSearchParams(window.location.search).get("sessionId");for(let g of r){let{pendingId:v,targetSessionId:S}=g,y=v?Lh(v):null,N=Boolean(v)&&(Boolean(y)||h===v),w=Boolean(S)&&h===S;if(!v&&!S)continue;let C=`${g.id}:${g.status}`;if(p.current.has(C))continue;if(g.status==="dispatched"&&g.sessionId){if(p.current.add(C),v&&N)Pc(v,g.sessionId,g.folderId),l((T)=>{if(T.get("sessionId")!==v)return T;let k=Rt(T);return k.set("sessionId",g.sessionId),k},{replace:!0}),c.current?.("Waiting finished — your prompt is now running in a new session.","success");else if(S&&w)c.current?.("Waiting finished — your prompt is now running in this chat.","success");continue}if(g.status==="error"){if(p.current.add(C),!N&&!w)continue;if(fd(g),v)md(v);c.current?.(`The prompt you held was not sent: ${g.error??"the dispatch failed."} Your draft is back in the composer.`,"error");continue}if(g.status==="cancelled"){if(p.current.add(C),!N&&!w)continue;if(fd(g),v)md(v)}}},[r,l])}function En(){let[t,r]=n(null),[l,c]=n(null),[p,h]=n([]),g=a((C,T)=>{r(C),c(C==="session"?T??null:null),h([])},[]),v=a(()=>{r(null),c(null),h([])},[]),S=a((C)=>{h((T)=>Ut(T,C))},[]),y=a((C)=>{h((T)=>[...new Set([...T,...C])])},[]),N=a((C)=>{h((T)=>{let k=new Set(C);return T.filter((I)=>!k.has(I))})},[]),w=a((C)=>Gt(p,C),[p]);return u(()=>({mode:t,scopeFolderId:l,selected:p,begin:g,end:v,toggle:S,selectAllOf:y,unselectAllOf:N,summaryOf:w}),[t,l,p,g,v,S,y,N,w])}var Ue=500,Dn=200;function Ge(t,r){if(!Number.isSafeInteger(r)||r<1)throw Error(`chunkIds needs a positive integer limit, got ${r}`);let l=[];for(let c=0;c<t.length;c+=r)l.push(t.slice(c,c+r));return l}var Xe={removed:[],refused:[]};async function Xo(t,r){try{let l=await fetch(t,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({ids:r})}),c=await l.json().catch(()=>null);if(!l.ok)return{...Xe,error:c?.error||`Could not delete (HTTP ${l.status}).`};return{removed:Array.isArray(c?.removed)?c.removed:[],refused:Array.isArray(c?.refused)?c.refused:[]}}catch(l){return{...Xe,error:l instanceof Error?l.message:"Could not reach the server."}}}async function Fn(t,r,l,c){let p=[],h=[],g,v=0;for(let S of Ge(r,l)){let y=await Xo(t,S);p.push(...y.removed),h.push(...y.refused),g??=y.error,v+=S.length,c?.({done:v,total:r.length})}return{removed:p,refused:h,...g?{error:g}:{}}}function _n(t,r){if(t.length===0)return Promise.resolve({...Xe});return Fn("/api/sessions/batch-delete",t,Ue,r)}function Bn(t,r){if(t.length===0)return Promise.resolve({...Xe});return Fn("/api/folders/batch-delete",t,Dn,r)}function Ln(t){let[r,l]=n([]),[c,p]=n(!1),[h,g]=n(null),[v,S]=n(null),[y,N]=le(),w=a((k)=>{g(null),S(null),l([...k])},[]),C=a(()=>{g(null),S(null),l([])},[]),T=a(async(k)=>{if(r.length===0||c)return null;p(!0),g(null);let I=r;S({done:0,total:I.length});let F=(A)=>S(A),R=k==="workspace"?await Bn(I,F):await _n(I,F);if(k==="session"&&R.removed.length>0){for(let O of R.removed)qp(O);let A=y.get("sessionId");if(A&&R.removed.includes(A))N((O)=>{let M=Rt(O);return M.delete("sessionId"),M.delete("subagent"),M},{replace:!0})}if(R.removed.length>0)t();if(g(R),S(null),p(!1),R.removed.length===I.length)l([]);return R},[r,c,y,N,t]);return{pending:r,isDeleting:c,outcome:h,progress:v,request:w,cancel:C,confirm:T}}var dt={archived:[],refused:[]};async function Zo(t,r){try{let l=await fetch(t,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({ids:r})}),c=await l.json().catch(()=>null);if(!l.ok)return{...dt,error:c?.error||`Could not archive (HTTP ${l.status}).`};return{archived:Array.isArray(c?.archived)?c.archived:[],refused:Array.isArray(c?.refused)?c.refused:[]}}catch(l){return{...dt,error:l instanceof Error?l.message:"Could not reach the server."}}}async function Mn(t){if(t.length===0)return{...dt};let r=[],l=[],c;for(let p of Ge(t,Ue)){let h=await Zo("/api/sessions/batch-archive",p);r.push(...h.archived),l.push(...h.refused),c??=h.error}return{archived:r,refused:l,...c?{error:c}:{}}}function Eu(t){if(t.error)return{message:t.error,tone:"error"};let r=t.archived.length,l=t.refused.length;if(r===0&&l===0)return null;if(l===0)return{message:`Archived ${r} ${r===1?"session":"sessions"}.`,tone:"success"};if(r===0)return{message:`${l} ${l===1?"session":"sessions"} could not be archived.`,tone:"error"};return{message:`Archived ${r} ${r===1?"session":"sessions"}; ${l} refused.`,tone:"warning"}}function $n(t){let[r,l]=n(!1),c=a(async(p)=>{if(p.length===0||r)return null;l(!0);let h=await Mn(p);if(h.archived.length>0)t();return l(!1),h},[r,t]);return{isArchiving:r,archive:c}}function Bu(t,r,l){let c=En(),p=Ln(l),h=$n(l),g=c.scopeFolderId===null?null:t.find((w)=>w.id===c.scopeFolderId)??null,v=c.mode==="workspace"?t.map((w)=>String(w.id)):c.mode==="session"?Le(g?.sessions??[],r):[],S=Kt(c.selected,v),y=c.mode?{mode:c.mode,scopeFolderId:c.scopeFolderId,selected:c.selected,toggle:c.toggle,selectAllOf:c.selectAllOf,unselectAllOf:c.unselectAllOf,summaryOf:c.summaryOf}:void 0,N=a(()=>{if(c.mode==="workspace")c.end();else c.begin("workspace")},[c]);return{selection:c,deleteRun:p,archiveRun:h,binding:y,scopeFolder:g,available:v,selected:S,toggleWorkspaceSelection:N}}function Iu({mode:t,count:r,total:l,busy:c,archiving:p=!1,scopeLabel:h,onSelectAll:g,onUnselectAll:v,onDelete:S,onArchive:y,onCancel:N,drawer:w=!1}){let C=t==="workspace"?"workspace":"session",T=r===1?C:`${C}s`,k=t==="session"&&h?` in ${h}`:"",I=c||p,F=I||r===0,R=t==="session"&&Boolean(y),A="min-w-0 w-full h-7 flex items-center justify-center gap-1 px-2 rounded border text-[11px] font-medium transition-colors cursor-pointer disabled:opacity-40",O="border-ink/20 text-ink hover:bg-ink/5";return e("div",{"data-testid":"batch-action-bar",className:`border-t border-ink/15 bg-paper ${w?"px-3":"px-2.5"} py-2 flex flex-col gap-1.5 flex-shrink-0`,children:[e("div",{className:"flex items-center justify-between gap-2 text-[11px]",children:[e("span",{className:"min-w-0 truncate text-ink/70",children:[e("span",{className:"font-semibold text-ink",children:r})," ","of ",l," ",l===1?C:`${C}s`," selected",k]}),e("button",{type:"button",onClick:N,disabled:I,title:"Cancel selection","aria-label":"Cancel selection",className:"shrink-0 w-5 h-5 flex items-center justify-center rounded text-ink/50 hover:text-ink hover:bg-ink/10 transition-colors cursor-pointer disabled:opacity-50",children:e(b,{size:13})})]}),e("div",{className:`grid gap-1.5 ${R?"grid-cols-2":"grid-cols-3"}`,children:[e("button",{type:"button",onClick:g,disabled:I||l===0||r===l,className:"min-w-0 w-full h-7 flex items-center justify-center gap-1 px-2 rounded border text-[11px] font-medium transition-colors cursor-pointer disabled:opacity-40 border-ink/20 text-ink hover:bg-ink/5",children:[e(ft,{size:12,className:"shrink-0"}),e("span",{className:"truncate",children:"Select all"})]}),e("button",{type:"button",onClick:v,disabled:I||r===0,className:"min-w-0 w-full h-7 flex items-center justify-center gap-1 px-2 rounded border text-[11px] font-medium transition-colors cursor-pointer disabled:opacity-40 border-ink/20 text-ink hover:bg-ink/5",children:e("span",{className:"truncate",children:"Unselect all"})}),R&&e("button",{type:"button",onClick:y,disabled:F,className:"min-w-0 w-full h-7 flex items-center justify-center gap-1 px-2 rounded border text-[11px] font-medium transition-colors cursor-pointer disabled:opacity-40 border-ink/20 text-ink hover:bg-ink/5",children:p?e(d,{children:[e(m,{size:12,className:"animate-spin shrink-0"}),e("span",{className:"truncate",children:"Archiving…"})]}):e(d,{children:[e(at,{size:12,className:"shrink-0"}),e("span",{className:"truncate",children:["Archive ",r>0?`${r} ${T}`:T]})]})}),e("button",{type:"button",onClick:S,disabled:F,className:"min-w-0 w-full h-7 flex items-center justify-center gap-1 px-2 rounded bg-error text-canvas text-[11px] font-semibold hover:opacity-90 transition-opacity cursor-pointer disabled:opacity-40",children:c?e(d,{children:[e(m,{size:12,className:"animate-spin shrink-0"}),e("span",{className:"truncate",children:"Deleting…"})]}):e(d,{children:[e(L,{size:12,className:"shrink-0"}),e("span",{className:"truncate",children:["Delete ",r>0?`${r} ${T}`:T]})]})})]})]})}function _u({mode:t,count:r,scopeLabel:l,isDeleting:c,progress:p=null,outcome:h,onClose:g,onConfirm:v}){if(o(()=>{let I=(F)=>{if(F.key!=="Escape"||c)return;F.preventDefault(),g()};return window.addEventListener("keydown",I),()=>window.removeEventListener("keydown",I)},[g,c]),r===0)return null;let S=t==="session",y=S?"session":"workspace",N=r===1?y:`${y}s`,w=S&&l?` in ${l}`:"",C=!c&&h!==null,T=h?.removed.length??0,k=h?.refused??[];return e(Z,{onClose:c?()=>{}:g,zClass:"z-[70]",maxWidthClass:"max-w-[460px]",header:e("div",{className:"flex items-center gap-3 min-w-0",children:[e(L,{size:16,className:"text-error shrink-0"}),e("div",{className:"min-w-0",children:[e("h2",{className:"text-sm font-semibold text-ink",children:["Delete ",r," ",N,"?"]}),e("p",{className:"text-[11px] text-ink/50 truncate",children:w?w.trim():"Selected rows"})]})]}),footer:e("div",{className:"flex items-center justify-end gap-2 px-5 py-3.5 border-t border-ink/10",children:[e("button",{type:"button",onClick:g,disabled:c,className:"px-3.5 py-1.5 rounded-md border border-ink/20 text-xs font-medium text-ink hover:bg-ink/5 transition-colors cursor-pointer disabled:opacity-50",children:C?"Close":"Cancel"}),e("button",{type:"button",onClick:v,disabled:c||C,className:"px-3.5 py-1.5 rounded-md bg-error text-canvas text-xs font-medium hover:opacity-90 transition-opacity cursor-pointer disabled:opacity-50 flex items-center gap-1.5",children:c?e(d,{children:[e(m,{size:13,className:"animate-spin"}),e("span",{children:"Deleting…"})]}):e(d,{children:[e(L,{size:13}),e("span",{children:["Delete ",r," ",N]})]})})]}),children:e("div",{className:"px-5 py-4 space-y-3",children:[c&&e("div",{className:"space-y-1.5","data-testid":"batch-delete-progress",children:[e("div",{className:"flex items-center justify-between text-[11px] text-ink/60",children:[e("span",{children:["Deleting ",p?.done??0," of ",r,"…"]}),e("span",{children:[Math.round((p?.done??0)/Math.max(1,r)*100),"%"]})]}),e(qm,{percent:(p?.done??0)/Math.max(1,r)*100,label:`Deleting ${r} ${N}`,tone:"error"})]}),S?e("ul",{className:"text-[11.5px] leading-relaxed text-ink/70 space-y-1.5",children:[e("li",{children:["Each transcript is removed from"," ",e("span",{className:"font-mono text-ink",children:"~/.omp/agent/sessions"})," — the conversations are gone from the sidebar and from oh-my-pi."]}),e("li",{children:"Chats that ran on another agent (opencode, dsh, …) are removed from that agent's own history too; one the agent cannot delete is refused, not silently forgotten."}),e("li",{children:"Their subagent transcripts, side questions, queued messages and saved layout go too."}),e("li",{children:"A session that is mid-run is refused rather than interrupted; stop it and delete again."})]}):e("ul",{className:"text-[11.5px] leading-relaxed text-ink/70 space-y-1.5",children:[e("li",{children:"The workspaces are removed from this sidebar."}),e("li",{children:["Their directories and every transcript on disk are left alone — re-add a workspace with"," ",e("span",{className:"font-mono text-ink",children:"New Workspace"})," when you want it back."]})]}),h?.error?e("div",{className:"flex items-start gap-2 px-3 py-2 rounded-md border border-error/30 bg-error/5 text-[11px] text-ink/75",children:[e(_,{size:13,className:"mt-0.5 shrink-0 text-error"}),e("span",{children:h.error})]}):C?e("div",{className:"flex items-start gap-2 px-3 py-2 rounded-md border border-ink/15 bg-ink/5 text-[11px] text-ink/75",children:e("span",{children:["Removed ",T," ",T===1?y:`${y}s`,k.length>0?`, ${k.length} refused:`:"."]})}):e("div",{className:"flex items-start gap-2 px-3 py-2 rounded-md border border-error/30 bg-error/5 text-[11px] text-ink/75",children:[e(_,{size:13,className:"mt-0.5 shrink-0 text-error"}),e("span",{children:S?"This cannot be undone from the UI. Archive a session instead to keep its transcript.":"This removes the sidebar entry only. The folder itself is not deleted."})]}),k.length>0&&e("ul",{className:"max-h-40 overflow-y-auto scrollbar-overlay-container space-y-1 text-[11px] text-ink/70",children:k.map((I)=>e("li",{className:"flex items-start gap-1.5",children:[e("span",{className:"font-mono text-ink/50 shrink-0 max-w-[7rem] truncate",title:I.id,children:I.id}),e("span",{className:"min-w-0",children:I.error})]},I.id))})]})})}
4
+ export{_s,Qa,Fr,yu,vu,jo,ku,Ss,$d,Wg,Kg,zd,Vg,Ts,Ds,Ns,Lr,Qs,Rs,qo,Fs,Ls,Ms,Ps,Bi,Ho,Os,$s,xu,Ud,wu,Cu,Eu,Bu,Iu,_u};
@@ -1,2 +1,2 @@
1
- var e=Object.freeze(JSON.parse('{"displayName":"Shell","name":"shellscript","patterns":[{"include":"#initial_context"}],"repository":{"alias_statement":{"begin":"[\\\\t ]*+(alias)[\\\\t ]*+((?:((?<!\\\\w)-\\\\w+)\\\\b[\\\\t ]*+)*)[\\\\t ]*+((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(?:(\\\\[)((?:(?:\\\\$?(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)|@)|\\\\*)|(-?\\\\d+))(]))?(?:(?:(=)|(\\\\+=))|(-=))","beginCaptures":{"1":{"name":"storage.type.alias.shell"},"2":{"patterns":[{"match":"(?<!\\\\w)-\\\\w+\\\\b","name":"string.unquoted.argument.shell constant.other.option.shell"}]},"3":{"name":"string.unquoted.argument.shell constant.other.option.shell"},"4":{"name":"variable.other.assignment.shell"},"5":{"name":"punctuation.definition.array.access.shell"},"6":{"name":"variable.other.assignment.shell"},"7":{"name":"constant.numeric.shell constant.numeric.integer.shell"},"8":{"name":"punctuation.definition.array.access.shell"},"9":{"name":"keyword.operator.assignment.shell"},"10":{"name":"keyword.operator.assignment.compound.shell"},"11":{"name":"keyword.operator.assignment.compound.shell"}},"end":"(?=[\\\\t ]|$)|(?:(?:(?:(;)|(&&))|(\\\\|\\\\|))|(&))","endCaptures":{"1":{"name":"punctuation.terminator.statement.semicolon.shell"},"2":{"name":"punctuation.separator.statement.and.shell"},"3":{"name":"punctuation.separator.statement.or.shell"},"4":{"name":"punctuation.separator.statement.background.shell"}},"name":"meta.expression.assignment.alias.shell","patterns":[{"include":"#normal_context"}]},"argument":{"begin":"[\\\\t ]++(?![\\\\n#\\\\&(\\\\[|]|$|;)","beginCaptures":{},"end":"(?=[\\\\t \\\\&;|]|$|[\\\\n)`])","endCaptures":{},"name":"meta.argument.shell","patterns":[{"include":"#argument_context"},{"include":"#line_continuation"}]},"argument_context":{"patterns":[{"captures":{"1":{"name":"string.unquoted.argument.shell","patterns":[{"match":"\\\\*","name":"variable.language.special.wildcard.shell"},{"include":"#variable"},{"include":"#numeric_literal"},{"captures":{"1":{"name":"constant.language.$1.shell"}},"match":"(?<!\\\\w)\\\\b(true|false)\\\\b(?!\\\\w)"}]}},"match":"[\\\\t ]*+([^\\\\t\\\\n \\"$\\\\&-);<>\\\\\\\\`|]+(?!>))"},{"include":"#normal_context"}]},"arithmetic_double":{"patterns":[{"begin":"\\\\(\\\\(","beginCaptures":{"0":{"name":"punctuation.section.arithmetic.double.shell"}},"end":"\\\\)\\\\s*\\\\)","endCaptures":{"0":{"name":"punctuation.section.arithmetic.double.shell"}},"name":"meta.arithmetic.shell","patterns":[{"include":"#math"},{"include":"#string"}]}]},"arithmetic_no_dollar":{"patterns":[{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.section.arithmetic.single.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.arithmetic.single.shell"}},"name":"meta.arithmetic.shell","patterns":[{"include":"#math"},{"include":"#string"}]}]},"array_access_inline":{"captures":{"1":{"name":"punctuation.section.array.shell"},"2":{"patterns":[{"include":"#special_expansion"},{"include":"#string"},{"include":"#variable"}]},"3":{"name":"punctuation.section.array.shell"}},"match":"(\\\\[)([^]\\\\[]+)(])"},"array_value":{"begin":"[\\\\t ]*+((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(?:(\\\\[)((?:(?:\\\\$?(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)|@)|\\\\*)|(-?\\\\d+))(]))?(?:(?:(=)|(\\\\+=))|(-=))[\\\\t ]*+(\\\\()","beginCaptures":{"1":{"name":"variable.other.assignment.shell"},"2":{"name":"punctuation.definition.array.access.shell"},"3":{"name":"variable.other.assignment.shell"},"4":{"name":"constant.numeric.shell constant.numeric.integer.shell"},"5":{"name":"punctuation.definition.array.access.shell"},"6":{"name":"keyword.operator.assignment.shell"},"7":{"name":"keyword.operator.assignment.compound.shell"},"8":{"name":"keyword.operator.assignment.compound.shell"},"9":{"name":"punctuation.definition.array.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.array.shell"}},"patterns":[{"include":"#comment"},{"captures":{"1":{"name":"variable.other.assignment.array.shell entity.other.attribute-name.shell"},"2":{"name":"keyword.operator.assignment.shell punctuation.definition.assignment.shell"}},"match":"((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(=)"},{"captures":{"1":{"name":"punctuation.definition.bracket.named-array.shell"},"2":{"name":"string.unquoted.shell entity.other.attribute-name.bracket.shell"},"3":{"name":"punctuation.definition.bracket.named-array.shell"},"4":{"name":"punctuation.definition.assignment.shell"}},"match":"(\\\\[)(.+?)(])(=)"},{"include":"#normal_context"},{"include":"#simple_unquoted"}]},"assignment_statement":{"patterns":[{"include":"#array_value"},{"include":"#modified_assignment_statement"},{"include":"#normal_assignment_statement"}]},"basic_command_name":{"captures":{"1":{"name":"storage.modifier.$1.shell"},"2":{"name":"entity.name.function.call.shell entity.name.command.shell","patterns":[{"match":"(?<!\\\\w)(?:continue|return|break)(?!\\\\w)","name":"keyword.control.$0.shell"},{"match":"(?<!\\\\w)(?:unfunction|continue|autoload|unsetopt|bindkey|builtin|getopts|command|declare|unalias|history|unlimit|typeset|suspend|source|printf|unhash|disown|ulimit|return|which|alias|break|false|print|shift|times|umask|unset|read|type|exec|eval|wait|echo|dirs|jobs|kill|hash|stat|exit|test|trap|true|let|set|pwd|cd|fg|bg|fc|[.:])(?!/)(?!\\\\w)(?!-)","name":"support.function.builtin.shell"},{"include":"#variable"}]}},"match":"(?![\\\\n!#\\\\&()<>\\\\[{|]|$|[\\\\t ;])(?!nocorrect |nocorrect\\\\t|nocorrect$|readonly |readonly\\\\t|readonly$|function |function\\\\t|function$|foreach |foreach\\\\t|foreach$|coproc |coproc\\\\t|coproc$|logout |logout\\\\t|logout$|export |export\\\\t|export$|select |select\\\\t|select$|repeat |repeat\\\\t|repeat$|pushd |pushd\\\\t|pushd$|until |until\\\\t|until$|while |while\\\\t|while$|local |local\\\\t|local$|case |case\\\\t|case$|done |done\\\\t|done$|elif |elif\\\\t|elif$|else |else\\\\t|else$|esac |esac\\\\t|esac$|popd |popd\\\\t|popd$|then |then\\\\t|then$|time |time\\\\t|time$|for |for\\\\t|for$|end |end\\\\t|end$|fi |fi\\\\t|fi$|do |do\\\\t|do$|in |in\\\\t|in$|if |if\\\\t|if$)(?:((?<=^|[\\\\t \\\\&;])(?:readonly|declare|typeset|export|local)(?=[\\\\t \\\\&;]|$))|((?![\\"\']|\\\\\\\\\\\\n?$)[^\\\\t\\\\n\\\\r !\\"\'<>]+?))(?:(?=[\\\\t ])|(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\))","name":"meta.statement.command.name.basic.shell"},"block_comment":{"begin":"\\\\s*+(/\\\\*)","beginCaptures":{"1":{"name":"punctuation.definition.comment.begin.shell"}},"end":"\\\\*/","endCaptures":{"0":{"name":"punctuation.definition.comment.end.shell"}},"name":"comment.block.shell"},"boolean":{"match":"\\\\b(?:true|false)\\\\b","name":"constant.language.$0.shell"},"case_statement":{"begin":"\\\\b(case)\\\\b[\\\\t ]*+(.+?)[\\\\t ]*+\\\\b(in)\\\\b","beginCaptures":{"1":{"name":"keyword.control.case.shell"},"2":{"patterns":[{"include":"#initial_context"}]},"3":{"name":"keyword.control.in.shell"}},"end":"\\\\besac\\\\b","endCaptures":{"0":{"name":"keyword.control.esac.shell"}},"name":"meta.case.shell","patterns":[{"include":"#comment"},{"captures":{"1":{"name":"keyword.operator.pattern.case.default.shell"}},"match":"[\\\\t ]*+(\\\\* *\\\\))"},{"begin":"(?<!\\\\))(?![\\\\t ]*+(?:esac\\\\b|$))","beginCaptures":{},"end":"(?=\\\\besac\\\\b)|(\\\\))","endCaptures":{"1":{"name":"keyword.operator.pattern.case.shell"}},"name":"meta.case.entry.pattern.shell","patterns":[{"include":"#case_statement_context"}]},{"begin":"(?<=\\\\))","beginCaptures":{},"end":"(;;)|(?=\\\\besac\\\\b)","endCaptures":{"1":{"name":"punctuation.terminator.statement.case.shell"}},"name":"meta.case.entry.body.shell","patterns":[{"include":"#typical_statements"},{"include":"#initial_context"}]}]},"case_statement_context":{"patterns":[{"match":"\\\\*","name":"variable.language.special.quantifier.star.shell keyword.operator.quantifier.star.shell punctuation.definition.arbitrary-repetition.shell punctuation.definition.regex.arbitrary-repetition.shell"},{"match":"\\\\+","name":"variable.language.special.quantifier.plus.shell keyword.operator.quantifier.plus.shell punctuation.definition.arbitrary-repetition.shell punctuation.definition.regex.arbitrary-repetition.shell"},{"match":"\\\\?","name":"variable.language.special.quantifier.question.shell keyword.operator.quantifier.question.shell punctuation.definition.arbitrary-repetition.shell punctuation.definition.regex.arbitrary-repetition.shell"},{"match":"@","name":"variable.language.special.at.shell keyword.operator.at.shell punctuation.definition.regex.at.shell"},{"match":"\\\\|","name":"keyword.operator.orvariable.language.special.or.shell keyword.operator.alternation.ruby.shell punctuation.definition.regex.alternation.shell punctuation.separator.regex.alternation.shell"},{"match":"\\\\\\\\.","name":"constant.character.escape.shell"},{"match":"(?<=\\\\tin| in|[\\\\t ]|;;)\\\\(","name":"keyword.operator.pattern.case.shell"},{"begin":"(?<=\\\\S)(\\\\()","beginCaptures":{"1":{"name":"punctuation.definition.group.shell punctuation.definition.regex.group.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.definition.regex.group.shell"}},"name":"meta.parenthese.shell","patterns":[{"include":"#case_statement_context"}]},{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.character-class.shell"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.character-class.shell"}},"name":"string.regexp.character-class.shell","patterns":[{"match":"\\\\\\\\.","name":"constant.character.escape.shell"}]},{"include":"#string"},{"match":"[^\\\\t\\\\n )*?@\\\\[|]","name":"string.unquoted.pattern.shell string.regexp.unquoted.shell"}]},"command_name_range":{"begin":"\\\\G","beginCaptures":{},"end":"(?=[\\\\t \\\\&;|]|$|[\\\\n)`])|(?=<)","endCaptures":{},"name":"meta.statement.command.name.shell","patterns":[{"match":"(?<!\\\\w)(?:continue|return|break)(?!\\\\w)","name":"entity.name.function.call.shell entity.name.command.shell keyword.control.$0.shell"},{"match":"(?<!\\\\w)(?:unfunction|continue|autoload|unsetopt|bindkey|builtin|getopts|command|declare|unalias|history|unlimit|typeset|suspend|source|printf|unhash|disown|ulimit|return|which|alias|break|false|print|shift|times|umask|unset|read|type|exec|eval|wait|echo|dirs|jobs|kill|hash|stat|exit|test|trap|true|let|set|pwd|cd|fg|bg|fc|[.:])(?!/)(?!\\\\w)(?!-)","name":"entity.name.function.call.shell entity.name.command.shell support.function.builtin.shell"},{"include":"#variable"},{"captures":{"1":{"name":"entity.name.function.call.shell entity.name.command.shell"}},"match":"(?<!\\\\w)(?<=\\\\G|[\\"\')}])([^\\\\t\\\\n\\\\r \\"\\\\&\');->`{|]+)"},{"begin":"(?:\\\\G|(?<![\\\\t\\\\n #\\\\&;{|]))(\\\\$?)((\\")|(\'))","beginCaptures":{"1":{"name":"meta.statement.command.name.quoted.shell punctuation.definition.string.shell entity.name.function.call.shell entity.name.command.shell"},"2":{},"3":{"name":"meta.statement.command.name.quoted.shell string.quoted.double.shell punctuation.definition.string.begin.shell entity.name.function.call.shell entity.name.command.shell"},"4":{"name":"meta.statement.command.name.quoted.shell string.quoted.single.shell punctuation.definition.string.begin.shell entity.name.function.call.shell entity.name.command.shell"}},"end":"(?<!\\\\G)(?<=\\\\2)","endCaptures":{},"patterns":[{"include":"#continuation_of_single_quoted_command_name"},{"include":"#continuation_of_double_quoted_command_name"}]},{"include":"#line_continuation"},{"include":"#simple_unquoted"}]},"command_statement":{"begin":"[\\\\t ]*+(?![\\\\n!#\\\\&()<>\\\\[{|]|$|[\\\\t ;])(?!nocorrect |nocorrect\\\\t|nocorrect$|readonly |readonly\\\\t|readonly$|function |function\\\\t|function$|foreach |foreach\\\\t|foreach$|coproc |coproc\\\\t|coproc$|logout |logout\\\\t|logout$|export |export\\\\t|export$|select |select\\\\t|select$|repeat |repeat\\\\t|repeat$|pushd |pushd\\\\t|pushd$|until |until\\\\t|until$|while |while\\\\t|while$|local |local\\\\t|local$|case |case\\\\t|case$|done |done\\\\t|done$|elif |elif\\\\t|elif$|else |else\\\\t|else$|esac |esac\\\\t|esac$|popd |popd\\\\t|popd$|then |then\\\\t|then$|time |time\\\\t|time$|for |for\\\\t|for$|end |end\\\\t|end$|fi |fi\\\\t|fi$|do |do\\\\t|do$|in |in\\\\t|in$|if |if\\\\t|if$)(?!\\\\\\\\\\\\n?$)","beginCaptures":{},"end":"(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.statement.command.shell","patterns":[{"include":"#command_name_range"},{"include":"#line_continuation"},{"include":"#option"},{"include":"#argument"},{"include":"#string"},{"include":"#heredoc"}]},"comment":{"captures":{"1":{"name":"comment.line.number-sign.shell meta.shebang.shell"},"2":{"name":"punctuation.definition.comment.shebang.shell"},"3":{"name":"comment.line.number-sign.shell"},"4":{"name":"punctuation.definition.comment.shell"}},"match":"(?:^|[\\\\t ]++)(?:((#!).*)|((#).*))"},"comments":{"patterns":[{"include":"#block_comment"},{"include":"#line_comment"}]},"compound-command":{"patterns":[{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"name":"meta.scope.logical-expression.shell","patterns":[{"include":"#logical-expression"},{"include":"#initial_context"}]},{"begin":"(?<=\\\\s|^)\\\\{(?=\\\\s|$)","beginCaptures":{"0":{"name":"punctuation.definition.group.shell"}},"end":"(?<=^|;)\\\\s*(})","endCaptures":{"1":{"name":"punctuation.definition.group.shell"}},"name":"meta.scope.group.shell","patterns":[{"include":"#initial_context"}]}]},"continuation_of_double_quoted_command_name":{"begin":"\\\\G(?<=\\")","beginCaptures":{},"contentName":"meta.statement.command.name.continuation string.quoted.double entity.name.function.call entity.name.command","end":"\\"","endCaptures":{"0":{"name":"string.quoted.double.shell punctuation.definition.string.end.shell entity.name.function.call.shell entity.name.command.shell"}},"patterns":[{"match":"\\\\\\\\[\\\\n\\"$\\\\\\\\`]","name":"constant.character.escape.shell"},{"include":"#variable"},{"include":"#interpolation"}]},"continuation_of_single_quoted_command_name":{"begin":"\\\\G(?<=\')","beginCaptures":{},"contentName":"meta.statement.command.name.continuation string.quoted.single entity.name.function.call entity.name.command","end":"\'","endCaptures":{"0":{"name":"string.quoted.single.shell punctuation.definition.string.end.shell entity.name.function.call.shell entity.name.command.shell"}}},"custom_command_names":{"patterns":[]},"custom_commands":{"patterns":[]},"double_quote_context":{"patterns":[{"match":"\\\\\\\\[\\\\n\\"$\\\\\\\\`]","name":"constant.character.escape.shell"},{"include":"#variable"},{"include":"#interpolation"}]},"double_quote_escape_char":{"match":"\\\\\\\\[\\\\n\\"$\\\\\\\\`]","name":"constant.character.escape.shell"},"floating_keyword":{"patterns":[{"match":"(?<=^|[\\\\t \\\\&;])(?:then|elif|else|done|end|do|if|fi)(?=[\\\\t \\\\&;]|$)","name":"keyword.control.$0.shell"}]},"for_statement":{"patterns":[{"begin":"\\\\b(for)\\\\b[\\\\t ]*+((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))[\\\\t ]*+\\\\b(in)\\\\b","beginCaptures":{"1":{"name":"keyword.control.for.shell"},"2":{"name":"variable.other.for.shell"},"3":{"name":"keyword.control.in.shell"}},"end":"(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.for.in.shell","patterns":[{"include":"#string"},{"include":"#simple_unquoted"},{"include":"#normal_context"}]},{"begin":"\\\\b(for)\\\\b","beginCaptures":{"1":{"name":"keyword.control.for.shell"}},"end":"(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.for.shell","patterns":[{"include":"#arithmetic_double"},{"include":"#normal_context"}]}]},"function_definition":{"applyEndPatternLast":1,"begin":"[\\\\t ]*+(?:\\\\b(function)\\\\b[\\\\t ]*+([^\\\\t\\\\n\\\\r \\"\'()=]+)(?:(\\\\()[\\\\t ]*+(\\\\)))?|([^\\\\t\\\\n\\\\r \\"\'()=]+)[\\\\t ]*+(\\\\()[\\\\t ]*+(\\\\)))","beginCaptures":{"1":{"name":"storage.type.function.shell"},"2":{"name":"entity.name.function.shell"},"3":{"name":"punctuation.definition.arguments.shell"},"4":{"name":"punctuation.definition.arguments.shell"},"5":{"name":"entity.name.function.shell"},"6":{"name":"punctuation.definition.arguments.shell"},"7":{"name":"punctuation.definition.arguments.shell"}},"end":"(?<=[)}])","endCaptures":{},"name":"meta.function.shell","patterns":[{"match":"\\\\G[\\\\t\\\\n ]"},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.section.function.definition.shell"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.section.function.definition.shell"}},"name":"meta.function.body.shell","patterns":[{"include":"#initial_context"}]},{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.section.function.definition.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.section.function.definition.shell"}},"name":"meta.function.body.shell","patterns":[{"include":"#initial_context"}]},{"include":"#initial_context"}]},"heredoc":{"patterns":[{"begin":"((?<!<)<<-)[\\\\t ]*+([\\"\'])[\\\\t ]*+([^\\"\']+?)(?=[\\"\\\\&\';<\\\\s])(\\\\2)(.*)","beginCaptures":{"1":{"name":"keyword.operator.heredoc.shell"},"2":{"name":"punctuation.definition.string.heredoc.quote.shell"},"3":{"name":"punctuation.definition.string.heredoc.delimiter.shell"},"4":{"name":"punctuation.definition.string.heredoc.quote.shell"},"5":{"patterns":[{"include":"#redirect_fix"},{"include":"#typical_statements"}]}},"contentName":"string.quoted.heredoc.indent.$3","end":"^\\\\t*\\\\3(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"punctuation.definition.string.heredoc.$0.shell"}},"patterns":[]},{"begin":"((?<!<)<<(?!<))[\\\\t ]*+([\\"\'])[\\\\t ]*+([^\\"\']+?)(?=[\\"\\\\&\';<\\\\s])(\\\\2)(.*)","beginCaptures":{"1":{"name":"keyword.operator.heredoc.shell"},"2":{"name":"punctuation.definition.string.heredoc.quote.shell"},"3":{"name":"punctuation.definition.string.heredoc.delimiter.shell"},"4":{"name":"punctuation.definition.string.heredoc.quote.shell"},"5":{"patterns":[{"include":"#redirect_fix"},{"include":"#typical_statements"}]}},"contentName":"string.quoted.heredoc.no-indent.$3","end":"^\\\\3(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"punctuation.definition.string.heredoc.delimiter.shell"}},"patterns":[]},{"begin":"((?<!<)<<-)[\\\\t ]*+([^\\\\t \\"\']+)(?=[\\"\\\\&\';<\\\\s])(.*)","beginCaptures":{"1":{"name":"keyword.operator.heredoc.shell"},"2":{"name":"punctuation.definition.string.heredoc.delimiter.shell"},"3":{"patterns":[{"include":"#redirect_fix"},{"include":"#typical_statements"}]}},"contentName":"string.unquoted.heredoc.indent.$2","end":"^\\\\t*\\\\2(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"punctuation.definition.string.heredoc.delimiter.shell"}},"patterns":[{"include":"#double_quote_escape_char"},{"include":"#variable"},{"include":"#interpolation"}]},{"begin":"((?<!<)<<(?!<))[\\\\t ]*+([^\\\\t \\"\']+)(?=[\\"\\\\&\';<\\\\s])(.*)","beginCaptures":{"1":{"name":"keyword.operator.heredoc.shell"},"2":{"name":"punctuation.definition.string.heredoc.delimiter.shell"},"3":{"patterns":[{"include":"#redirect_fix"},{"include":"#typical_statements"}]}},"contentName":"string.unquoted.heredoc.no-indent.$2","end":"^\\\\2(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"punctuation.definition.string.heredoc.delimiter.shell"}},"patterns":[{"include":"#double_quote_escape_char"},{"include":"#variable"},{"include":"#interpolation"}]}]},"herestring":{"patterns":[{"begin":"(<<<)\\\\s*((\'))","beginCaptures":{"1":{"name":"keyword.operator.herestring.shell"},"2":{"name":"string.quoted.single.shell"},"3":{"name":"punctuation.definition.string.begin.shell"}},"contentName":"string.quoted.single.shell","end":"(\')","endCaptures":{"0":{"name":"string.quoted.single.shell"},"1":{"name":"punctuation.definition.string.end.shell"}},"name":"meta.herestring.shell"},{"begin":"(<<<)\\\\s*((\\"))","beginCaptures":{"1":{"name":"keyword.operator.herestring.shell"},"2":{"name":"string.quoted.double.shell"},"3":{"name":"punctuation.definition.string.begin.shell"}},"contentName":"string.quoted.double.shell","end":"(\\")","endCaptures":{"0":{"name":"string.quoted.double.shell"},"1":{"name":"punctuation.definition.string.end.shell"}},"name":"meta.herestring.shell","patterns":[{"include":"#double_quote_context"}]},{"captures":{"1":{"name":"keyword.operator.herestring.shell"},"2":{"name":"string.unquoted.herestring.shell","patterns":[{"include":"#initial_context"}]}},"match":"(<<<)\\\\s*(([^)\\\\\\\\\\\\s]|\\\\\\\\.)+)","name":"meta.herestring.shell"}]},"initial_context":{"patterns":[{"include":"#comment"},{"include":"#pipeline"},{"include":"#normal_statement_seperator"},{"include":"#logical_expression_double"},{"include":"#logical_expression_single"},{"include":"#assignment_statement"},{"include":"#case_statement"},{"include":"#for_statement"},{"include":"#loop"},{"include":"#function_definition"},{"include":"#line_continuation"},{"include":"#arithmetic_double"},{"include":"#misc_ranges"},{"include":"#variable"},{"include":"#interpolation"},{"include":"#heredoc"},{"include":"#herestring"},{"include":"#redirection"},{"include":"#pathname"},{"include":"#floating_keyword"},{"include":"#alias_statement"},{"include":"#normal_statement"},{"include":"#string"},{"include":"#support"}]},"inline_comment":{"captures":{"1":{"name":"comment.block.shell punctuation.definition.comment.begin.shell"},"2":{"name":"comment.block.shell"},"3":{"patterns":[{"match":"\\\\*/","name":"comment.block.shell punctuation.definition.comment.end.shell"},{"match":"\\\\*","name":"comment.block.shell"}]}},"match":"(/\\\\*)((?:[^*]|\\\\*++[^/])*+(\\\\*++/))"},"interpolation":{"patterns":[{"include":"#arithmetic_dollar"},{"include":"#subshell_dollar"},{"begin":"`","beginCaptures":{"0":{"name":"punctuation.definition.evaluation.backticks.shell"}},"end":"`","endCaptures":{"0":{"name":"punctuation.definition.evaluation.backticks.shell"}},"name":"string.interpolated.backtick.shell","patterns":[{"match":"\\\\\\\\[$\\\\\\\\`]","name":"constant.character.escape.shell"},{"begin":"(?<=\\\\W)(?=#)(?!#\\\\{)","beginCaptures":{"1":{"name":"punctuation.whitespace.comment.leading.shell"}},"end":"(?!\\\\G)","patterns":[{"begin":"#","beginCaptures":{"0":{"name":"punctuation.definition.comment.shell"}},"end":"(?=`)","name":"comment.line.number-sign.shell"}]},{"include":"#initial_context"}]}]},"keyword":{"patterns":[{"match":"(?<=^|[\\\\&;\\\\s])(then|else|elif|fi|for|in|do|done|select|continue|esac|while|until|return)(?=[\\\\&;\\\\s]|$)","name":"keyword.control.shell"},{"match":"(?<=^|[\\\\&;\\\\s])(?:export|declare|typeset|local|readonly)(?=[\\\\&;\\\\s]|$)","name":"storage.modifier.shell"}]},"line_comment":{"begin":"\\\\s*+(//)","beginCaptures":{"1":{"name":"punctuation.definition.comment.shell"}},"end":"(?<=\\\\n)(?<!\\\\\\\\\\\\n)","endCaptures":{},"name":"comment.line.double-slash.shell","patterns":[{"include":"#line_continuation_character"}]},"line_continuation":{"match":"\\\\\\\\(?=\\\\n)","name":"constant.character.escape.line-continuation.shell"},"logical-expression":{"patterns":[{"include":"#arithmetic_no_dollar"},{"match":"=[=~]?|!=?|[<>]|&&|\\\\|\\\\|","name":"keyword.operator.logical.shell"},{"match":"(?<!\\\\S)-(nt|ot|ef|eq|ne|l[et]|g[et]|[GLNOSa-hknopr-uwxz])\\\\b","name":"keyword.operator.logical.shell"}]},"logical_expression_context":{"patterns":[{"include":"#regex_comparison"},{"include":"#arithmetic_no_dollar"},{"include":"#logical-expression"},{"include":"#logical_expression_single"},{"include":"#logical_expression_double"},{"include":"#comment"},{"include":"#boolean"},{"include":"#redirect_number"},{"include":"#numeric_literal"},{"include":"#pipeline"},{"include":"#normal_statement_seperator"},{"include":"#string"},{"include":"#variable"},{"include":"#interpolation"},{"include":"#heredoc"},{"include":"#herestring"},{"include":"#pathname"},{"include":"#floating_keyword"},{"include":"#support"}]},"logical_expression_double":{"begin":"\\\\[\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"end":"]]","endCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"name":"meta.scope.logical-expression.shell","patterns":[{"include":"#logical_expression_context"}]},"logical_expression_single":{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"name":"meta.scope.logical-expression.shell","patterns":[{"include":"#logical_expression_context"}]},"loop":{"patterns":[{"begin":"(?<=^|[\\\\&;\\\\s])(for)\\\\s+(.+?)\\\\s+(in)(?=[\\\\&;\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.control.shell"},"2":{"name":"variable.other.loop.shell","patterns":[{"include":"#string"}]},"3":{"name":"keyword.control.shell"}},"end":"(?<=^|[\\\\&;\\\\s])done(?=[\\\\&;\\\\s]|$|\\\\))","endCaptures":{"0":{"name":"keyword.control.shell"}},"name":"meta.scope.for-in-loop.shell","patterns":[{"include":"#initial_context"}]},{"begin":"(?<=^|[\\\\&;\\\\s])(while|until)(?=[\\\\&;\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.control.shell"}},"end":"(?<=^|[\\\\&;\\\\s])done(?=[\\\\&;\\\\s]|$|\\\\))","endCaptures":{"0":{"name":"keyword.control.shell"}},"name":"meta.scope.while-loop.shell","patterns":[{"include":"#initial_context"}]},{"begin":"(?<=^|[\\\\&;\\\\s])(select)\\\\s+((?:[^\\\\\\\\\\\\s]|\\\\\\\\.)+)(?=[\\\\&;\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.control.shell"},"2":{"name":"variable.other.loop.shell"}},"end":"(?<=^|[\\\\&;\\\\s])(done)(?=[\\\\&;\\\\s]|$|\\\\))","endCaptures":{"1":{"name":"keyword.control.shell"}},"name":"meta.scope.select-block.shell","patterns":[{"include":"#initial_context"}]},{"begin":"(?<=^|[\\\\&;\\\\s])if(?=[\\\\&;\\\\s]|$)","beginCaptures":{"0":{"name":"keyword.control.if.shell"}},"end":"(?<=^|[\\\\&;\\\\s])fi(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"keyword.control.fi.shell"}},"name":"meta.scope.if-block.shell","patterns":[{"include":"#initial_context"}]}]},"math":{"patterns":[{"include":"#variable"},{"match":"\\\\+{1,2}|-{1,2}|[!~]|\\\\*{1,2}|[%/]|<[<=]?|>[=>]?|==|!=|^|\\\\|{1,2}|&{1,2}|[,:=?]|[-%\\\\&*+/^|]=|<<=|>>=","name":"keyword.operator.arithmetic.shell"},{"match":"0[Xx]\\\\h+","name":"constant.numeric.hex.shell"},{"match":";","name":"punctuation.separator.semicolon.range"},{"match":"0\\\\d+","name":"constant.numeric.octal.shell"},{"match":"\\\\d{1,2}#[0-9@-Z_a-z]+","name":"constant.numeric.other.shell"},{"match":"\\\\d+","name":"constant.numeric.integer.shell"},{"match":"(?<!\\\\w)[0-9A-Z_a-z]+(?!\\\\w)","name":"variable.other.normal.shell"}]},"math_operators":{"patterns":[{"match":"\\\\+{1,2}|-{1,2}|[!~]|\\\\*{1,2}|[%/]|<[<=]?|>[=>]?|==|!=|^|\\\\|{1,2}|&{1,2}|[,:=?]|[-%\\\\&*+/^|]=|<<=|>>=","name":"keyword.operator.arithmetic.shell"},{"match":"0[Xx]\\\\h+","name":"constant.numeric.hex.shell"},{"match":"0\\\\d+","name":"constant.numeric.octal.shell"},{"match":"\\\\d{1,2}#[0-9@-Z_a-z]+","name":"constant.numeric.other.shell"},{"match":"\\\\d+","name":"constant.numeric.integer.shell"}]},"misc_ranges":{"patterns":[{"include":"#logical_expression_single"},{"include":"#logical_expression_double"},{"include":"#subshell_dollar"},{"begin":"(?<![^\\\\t ])(\\\\{)(?![$\\\\w])","beginCaptures":{"1":{"name":"punctuation.definition.group.shell"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.group.shell"}},"name":"meta.scope.group.shell","patterns":[{"include":"#initial_context"}]}]},"modified_assignment_statement":{"begin":"(?<=^|[\\\\t \\\\&;])(?:readonly|declare|typeset|export|local)(?=[\\\\t \\\\&;]|$)","beginCaptures":{"0":{"name":"storage.modifier.$0.shell"}},"end":"(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.statement.shell meta.expression.assignment.modified.shell","patterns":[{"match":"(?<!\\\\w)-\\\\w+\\\\b","name":"string.unquoted.argument.shell constant.other.option.shell"},{"include":"#array_value"},{"captures":{"1":{"name":"variable.other.assignment.shell"},"2":{"name":"punctuation.definition.array.access.shell"},"3":{"name":"variable.other.assignment.shell"},"4":{"name":"constant.numeric.shell constant.numeric.integer.shell"},"5":{"name":"punctuation.definition.array.access.shell"},"6":{"name":"keyword.operator.assignment.shell"},"7":{"name":"keyword.operator.assignment.compound.shell"},"8":{"name":"keyword.operator.assignment.compound.shell"},"9":{"name":"constant.numeric.shell constant.numeric.hex.shell"},"10":{"name":"constant.numeric.shell constant.numeric.octal.shell"},"11":{"name":"constant.numeric.shell constant.numeric.other.shell"},"12":{"name":"constant.numeric.shell constant.numeric.decimal.shell"},"13":{"name":"constant.numeric.shell constant.numeric.version.shell"},"14":{"name":"constant.numeric.shell constant.numeric.integer.shell"}},"match":"((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(?:(\\\\[)((?:(?:\\\\$?(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)|@)|\\\\*)|(-?\\\\d+))(]))?(?:(?:(=)|(\\\\+=))|(-=))?(?:(?<=[\\\\t =]|^|[(\\\\[{])(?:(?:(?:(?:(?:(0[Xx]\\\\h+)|(0\\\\d+))|(\\\\d{1,2}#[0-9@-Z_a-z]+))|(-?\\\\d+\\\\.\\\\d+))|(-?\\\\d+(?:\\\\.\\\\d+)+))|(-?\\\\d+))(?=[\\\\t ]|$|[);}]))?"},{"include":"#normal_context"}]},"modifiers":{"match":"(?<=^|[\\\\t \\\\&;])(?:readonly|declare|typeset|export|local)(?=[\\\\t \\\\&;]|$)","name":"storage.modifier.$0.shell"},"normal_assignment_statement":{"begin":"[\\\\t ]*+((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(?:(\\\\[)((?:(?:\\\\$?(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)|@)|\\\\*)|(-?\\\\d+))(]))?(?:(?:(=)|(\\\\+=))|(-=))","beginCaptures":{"1":{"name":"variable.other.assignment.shell"},"2":{"name":"punctuation.definition.array.access.shell"},"3":{"name":"variable.other.assignment.shell"},"4":{"name":"constant.numeric.shell constant.numeric.integer.shell"},"5":{"name":"punctuation.definition.array.access.shell"},"6":{"name":"keyword.operator.assignment.shell"},"7":{"name":"keyword.operator.assignment.compound.shell"},"8":{"name":"keyword.operator.assignment.compound.shell"}},"end":"(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.expression.assignment.shell","patterns":[{"include":"#comment"},{"include":"#string"},{"include":"#normal_assignment_statement"},{"begin":"(?<=[\\\\t ])(?![\\\\t ]|\\\\w+=)","beginCaptures":{},"end":"(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.statement.command.env.shell","patterns":[{"include":"#command_name_range"},{"include":"#line_continuation"},{"include":"#option"},{"include":"#argument"},{"include":"#string"}]},{"include":"#simple_unquoted"},{"include":"#normal_context"}]},"normal_context":{"patterns":[{"include":"#comment"},{"include":"#pipeline"},{"include":"#normal_statement_seperator"},{"include":"#misc_ranges"},{"include":"#boolean"},{"include":"#redirect_number"},{"include":"#numeric_literal"},{"include":"#string"},{"include":"#variable"},{"include":"#interpolation"},{"include":"#heredoc"},{"include":"#herestring"},{"include":"#redirection"},{"include":"#pathname"},{"include":"#floating_keyword"},{"include":"#support"},{"include":"#parenthese"}]},"normal_statement":{"begin":"(?!^[\\\\t ]*+$)(?:(?<=(?:^until| until|\\\\tuntil|^while| while|\\\\twhile|^elif| elif|\\\\telif|^else| else|\\\\telse|^then| then|\\\\tthen|^do| do|\\\\tdo|^if| if|\\\\tif) )|(?<=^|[!\\\\&(;`{|]))[\\\\t ]*+(?!nocorrect\\\\W|nocorrect\\\\$|function\\\\W|function\\\\$|foreach\\\\W|foreach\\\\$|repeat\\\\W|repeat\\\\$|logout\\\\W|logout\\\\$|coproc\\\\W|coproc\\\\$|select\\\\W|select\\\\$|while\\\\W|while\\\\$|pushd\\\\W|pushd\\\\$|until\\\\W|until\\\\$|case\\\\W|case\\\\$|done\\\\W|done\\\\$|elif\\\\W|elif\\\\$|else\\\\W|else\\\\$|esac\\\\W|esac\\\\$|popd\\\\W|popd\\\\$|then\\\\W|then\\\\$|time\\\\W|time\\\\$|for\\\\W|for\\\\$|end\\\\W|end\\\\$|fi\\\\W|fi\\\\$|do\\\\W|do\\\\$|in\\\\W|in\\\\$|if\\\\W|if\\\\$)","beginCaptures":{},"end":"(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.statement.shell","patterns":[{"include":"#typical_statements"}]},"normal_statement_seperator":{"captures":{"1":{"name":"punctuation.terminator.statement.semicolon.shell"},"2":{"name":"punctuation.separator.statement.and.shell"},"3":{"name":"punctuation.separator.statement.or.shell"},"4":{"name":"punctuation.separator.statement.background.shell"}},"match":"(?:(?:(;)|(&&))|(\\\\|\\\\|))|(&)"},"numeric_literal":{"captures":{"1":{"name":"constant.numeric.shell constant.numeric.hex.shell"},"2":{"name":"constant.numeric.shell constant.numeric.octal.shell"},"3":{"name":"constant.numeric.shell constant.numeric.other.shell"},"4":{"name":"constant.numeric.shell constant.numeric.decimal.shell"},"5":{"name":"constant.numeric.shell constant.numeric.version.shell"},"6":{"name":"constant.numeric.shell constant.numeric.integer.shell"}},"match":"(?<=[\\\\t =]|^|[(\\\\[{])(?:(?:(?:(?:(?:(0[Xx]\\\\h+)|(0\\\\d+))|(\\\\d{1,2}#[0-9@-Z_a-z]+))|(-?\\\\d+\\\\.\\\\d+))|(-?\\\\d+(?:\\\\.\\\\d+)+))|(-?\\\\d+))(?=[\\\\t ]|$|[);}])"},"option":{"begin":"[\\\\t ]++(-)((?![\\\\n!#\\\\&()<>\\\\[{|]|$|[\\\\t ;]))","beginCaptures":{"1":{"name":"string.unquoted.argument.shell constant.other.option.dash.shell"},"2":{"name":"string.unquoted.argument.shell constant.other.option.shell"}},"contentName":"string.unquoted.argument constant.other.option","end":"(?=[\\\\t ])|(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"patterns":[{"include":"#option_context"}]},"option_context":{"patterns":[{"include":"#misc_ranges"},{"include":"#string"},{"include":"#variable"},{"include":"#interpolation"},{"include":"#heredoc"},{"include":"#herestring"},{"include":"#redirection"},{"include":"#pathname"},{"include":"#floating_keyword"},{"include":"#support"}]},"parenthese":{"patterns":[{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.section.parenthese.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.parenthese.shell"}},"name":"meta.parenthese.group.shell","patterns":[{"include":"#initial_context"}]}]},"pathname":{"patterns":[{"match":"(?<=[:=\\\\s]|^)~","name":"keyword.operator.tilde.shell"},{"match":"[*?]","name":"keyword.operator.glob.shell"},{"begin":"([!*+?@])(\\\\()","beginCaptures":{"1":{"name":"keyword.operator.extglob.shell"},"2":{"name":"punctuation.definition.extglob.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.extglob.shell"}},"name":"meta.structure.extglob.shell","patterns":[{"include":"#initial_context"}]}]},"pipeline":{"patterns":[{"match":"(?<=^|[\\\\&;\\\\s])(time)(?=[\\\\&;\\\\s]|$)","name":"keyword.other.shell"},{"match":"[!|]","name":"keyword.operator.pipe.shell"}]},"redirect_fix":{"captures":{"1":{"name":"keyword.operator.redirect.shell"},"2":{"name":"string.unquoted.argument.shell"}},"match":"(>>?)[\\\\t ]*+([^\\\\t\\\\n \\"$\\\\&-);<>\\\\\\\\`|]+)"},"redirect_number":{"captures":{"1":{"name":"keyword.operator.redirect.stdout.shell"},"2":{"name":"keyword.operator.redirect.stderr.shell"},"3":{"name":"keyword.operator.redirect.$3.shell"}},"match":"(?<=[\\\\t ])(?:(1)|(2)|(\\\\d+))(?=>)"},"redirection":{"patterns":[{"begin":"[<>]\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.string.end.shell"}},"name":"string.interpolated.process-substitution.shell","patterns":[{"include":"#initial_context"}]},{"match":"(?<![<>])(&>|\\\\d*>&\\\\d*|\\\\d*(>>|[<>])|\\\\d*<&|\\\\d*<>)(?![<>])","name":"keyword.operator.redirect.shell"}]},"regex_comparison":{"match":"=~","name":"keyword.operator.logical.regex.shell"},"regexp":{"patterns":[{"match":".+"}]},"simple_options":{"captures":{"0":{"patterns":[{"captures":{"1":{"name":"string.unquoted.argument.shell constant.other.option.dash.shell"},"2":{"name":"string.unquoted.argument.shell constant.other.option.shell"}},"match":"[\\\\t ]++(-)(\\\\w+)"}]}},"match":"(?:[\\\\t ]++-\\\\w+)*"},"simple_unquoted":{"match":"[^\\\\t\\\\n \\"$\\\\&-);<>\\\\\\\\`|]","name":"string.unquoted.shell"},"special_expansion":{"match":"!|:[-=?]?|[*@]|##?|%%|[%/]","name":"keyword.operator.expansion.shell"},"start_of_command":{"match":"[\\\\t ]*+(?![\\\\n!#\\\\&()<>\\\\[{|]|$|[\\\\t ;])(?!nocorrect |nocorrect\\\\t|nocorrect$|readonly |readonly\\\\t|readonly$|function |function\\\\t|function$|foreach |foreach\\\\t|foreach$|coproc |coproc\\\\t|coproc$|logout |logout\\\\t|logout$|export |export\\\\t|export$|select |select\\\\t|select$|repeat |repeat\\\\t|repeat$|pushd |pushd\\\\t|pushd$|until |until\\\\t|until$|while |while\\\\t|while$|local |local\\\\t|local$|case |case\\\\t|case$|done |done\\\\t|done$|elif |elif\\\\t|elif$|else |else\\\\t|else$|esac |esac\\\\t|esac$|popd |popd\\\\t|popd$|then |then\\\\t|then$|time |time\\\\t|time$|for |for\\\\t|for$|end |end\\\\t|end$|fi |fi\\\\t|fi$|do |do\\\\t|do$|in |in\\\\t|in$|if |if\\\\t|if$)(?!\\\\\\\\\\\\n?$)"},"string":{"patterns":[{"match":"\\\\\\\\.","name":"constant.character.escape.shell"},{"begin":"\'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.shell"}},"end":"\'","endCaptures":{"0":{"name":"punctuation.definition.string.end.shell"}},"name":"string.quoted.single.shell"},{"begin":"\\\\$?\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.shell"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.shell"}},"name":"string.quoted.double.shell","patterns":[{"match":"\\\\\\\\[\\\\n\\"$\\\\\\\\`]","name":"constant.character.escape.shell"},{"include":"#variable"},{"include":"#interpolation"}]},{"begin":"\\\\$\'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.shell"}},"end":"\'","endCaptures":{"0":{"name":"punctuation.definition.string.end.shell"}},"name":"string.quoted.single.dollar.shell","patterns":[{"match":"\\\\\\\\[\'\\\\\\\\abefnrtv]","name":"constant.character.escape.ansi-c.shell"},{"match":"\\\\\\\\[0-9]{3}\\"","name":"constant.character.escape.octal.shell"},{"match":"\\\\\\\\x\\\\h{2}\\"","name":"constant.character.escape.hex.shell"},{"match":"\\\\\\\\c.\\"","name":"constant.character.escape.control-char.shell"}]}]},"subshell_dollar":{"patterns":[{"begin":"\\\\$\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.subshell.single.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.subshell.single.shell"}},"name":"meta.scope.subshell","patterns":[{"include":"#parenthese"},{"include":"#initial_context"}]}]},"support":{"patterns":[{"match":"(?<=^|[\\\\&;\\\\s])[.:](?=[\\\\&;\\\\s]|$)","name":"support.function.builtin.shell"}]},"typical_statements":{"patterns":[{"include":"#assignment_statement"},{"include":"#case_statement"},{"include":"#for_statement"},{"include":"#while_statement"},{"include":"#function_definition"},{"include":"#command_statement"},{"include":"#line_continuation"},{"include":"#arithmetic_double"},{"include":"#normal_context"}]},"variable":{"patterns":[{"captures":{"1":{"name":"punctuation.definition.variable.shell variable.parameter.positional.all.shell"},"2":{"name":"variable.parameter.positional.all.shell"}},"match":"(\\\\$)(@(?!\\\\w))"},{"captures":{"1":{"name":"punctuation.definition.variable.shell variable.parameter.positional.shell"},"2":{"name":"variable.parameter.positional.shell"}},"match":"(\\\\$)([0-9](?!\\\\w))"},{"captures":{"1":{"name":"punctuation.definition.variable.shell variable.language.special.shell"},"2":{"name":"variable.language.special.shell"}},"match":"(\\\\$)([-!#$*0?_](?!\\\\w))"},{"begin":"(\\\\$)(\\\\{)[\\\\t ]*+(?=\\\\d)","beginCaptures":{"1":{"name":"punctuation.definition.variable.shell variable.parameter.positional.shell"},"2":{"name":"punctuation.section.bracket.curly.variable.begin.shell punctuation.definition.variable.shell variable.parameter.positional.shell"}},"contentName":"meta.parameter-expansion","end":"}","endCaptures":{"0":{"name":"punctuation.section.bracket.curly.variable.end.shell punctuation.definition.variable.shell variable.parameter.positional.shell"}},"patterns":[{"include":"#special_expansion"},{"include":"#array_access_inline"},{"match":"[0-9]+","name":"variable.parameter.positional.shell"},{"match":"(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)","name":"variable.other.normal.shell"},{"include":"#variable"},{"include":"#string"}]},{"begin":"(\\\\$)(\\\\{)","beginCaptures":{"1":{"name":"punctuation.definition.variable.shell"},"2":{"name":"punctuation.section.bracket.curly.variable.begin.shell punctuation.definition.variable.shell"}},"contentName":"meta.parameter-expansion","end":"}","endCaptures":{"0":{"name":"punctuation.section.bracket.curly.variable.end.shell punctuation.definition.variable.shell"}},"patterns":[{"include":"#special_expansion"},{"include":"#array_access_inline"},{"match":"(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)","name":"variable.other.normal.shell"},{"include":"#variable"},{"include":"#string"}]},{"captures":{"1":{"name":"punctuation.definition.variable.shell variable.other.normal.shell"},"2":{"name":"variable.other.normal.shell"}},"match":"(\\\\$)(\\\\w+(?!\\\\w))"}]},"while_statement":{"patterns":[{"begin":"\\\\b(while)\\\\b","beginCaptures":{"1":{"name":"keyword.control.while.shell"}},"end":"(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.while.shell","patterns":[{"include":"#line_continuation"},{"include":"#math_operators"},{"include":"#option"},{"include":"#simple_unquoted"},{"include":"#normal_context"},{"include":"#string"}]}]}},"scopeName":"source.shell","aliases":["bash","sh","shell","zsh"]}')),Lp=[e];
2
- export{Lp};
1
+ var e=Object.freeze(JSON.parse('{"displayName":"Shell","name":"shellscript","patterns":[{"include":"#initial_context"}],"repository":{"alias_statement":{"begin":"[\\\\t ]*+(alias)[\\\\t ]*+((?:((?<!\\\\w)-\\\\w+)\\\\b[\\\\t ]*+)*)[\\\\t ]*+((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(?:(\\\\[)((?:(?:\\\\$?(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)|@)|\\\\*)|(-?\\\\d+))(]))?(?:(?:(=)|(\\\\+=))|(-=))","beginCaptures":{"1":{"name":"storage.type.alias.shell"},"2":{"patterns":[{"match":"(?<!\\\\w)-\\\\w+\\\\b","name":"string.unquoted.argument.shell constant.other.option.shell"}]},"3":{"name":"string.unquoted.argument.shell constant.other.option.shell"},"4":{"name":"variable.other.assignment.shell"},"5":{"name":"punctuation.definition.array.access.shell"},"6":{"name":"variable.other.assignment.shell"},"7":{"name":"constant.numeric.shell constant.numeric.integer.shell"},"8":{"name":"punctuation.definition.array.access.shell"},"9":{"name":"keyword.operator.assignment.shell"},"10":{"name":"keyword.operator.assignment.compound.shell"},"11":{"name":"keyword.operator.assignment.compound.shell"}},"end":"(?=[\\\\t ]|$)|(?:(?:(?:(;)|(&&))|(\\\\|\\\\|))|(&))","endCaptures":{"1":{"name":"punctuation.terminator.statement.semicolon.shell"},"2":{"name":"punctuation.separator.statement.and.shell"},"3":{"name":"punctuation.separator.statement.or.shell"},"4":{"name":"punctuation.separator.statement.background.shell"}},"name":"meta.expression.assignment.alias.shell","patterns":[{"include":"#normal_context"}]},"argument":{"begin":"[\\\\t ]++(?![\\\\n#\\\\&(\\\\[|]|$|;)","beginCaptures":{},"end":"(?=[\\\\t \\\\&;|]|$|[\\\\n)`])","endCaptures":{},"name":"meta.argument.shell","patterns":[{"include":"#argument_context"},{"include":"#line_continuation"}]},"argument_context":{"patterns":[{"captures":{"1":{"name":"string.unquoted.argument.shell","patterns":[{"match":"\\\\*","name":"variable.language.special.wildcard.shell"},{"include":"#variable"},{"include":"#numeric_literal"},{"captures":{"1":{"name":"constant.language.$1.shell"}},"match":"(?<!\\\\w)\\\\b(true|false)\\\\b(?!\\\\w)"}]}},"match":"[\\\\t ]*+([^\\\\t\\\\n \\"$\\\\&-);<>\\\\\\\\`|]+(?!>))"},{"include":"#normal_context"}]},"arithmetic_double":{"patterns":[{"begin":"\\\\(\\\\(","beginCaptures":{"0":{"name":"punctuation.section.arithmetic.double.shell"}},"end":"\\\\)\\\\s*\\\\)","endCaptures":{"0":{"name":"punctuation.section.arithmetic.double.shell"}},"name":"meta.arithmetic.shell","patterns":[{"include":"#math"},{"include":"#string"}]}]},"arithmetic_no_dollar":{"patterns":[{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.section.arithmetic.single.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.arithmetic.single.shell"}},"name":"meta.arithmetic.shell","patterns":[{"include":"#math"},{"include":"#string"}]}]},"array_access_inline":{"captures":{"1":{"name":"punctuation.section.array.shell"},"2":{"patterns":[{"include":"#special_expansion"},{"include":"#string"},{"include":"#variable"}]},"3":{"name":"punctuation.section.array.shell"}},"match":"(\\\\[)([^]\\\\[]+)(])"},"array_value":{"begin":"[\\\\t ]*+((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(?:(\\\\[)((?:(?:\\\\$?(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)|@)|\\\\*)|(-?\\\\d+))(]))?(?:(?:(=)|(\\\\+=))|(-=))[\\\\t ]*+(\\\\()","beginCaptures":{"1":{"name":"variable.other.assignment.shell"},"2":{"name":"punctuation.definition.array.access.shell"},"3":{"name":"variable.other.assignment.shell"},"4":{"name":"constant.numeric.shell constant.numeric.integer.shell"},"5":{"name":"punctuation.definition.array.access.shell"},"6":{"name":"keyword.operator.assignment.shell"},"7":{"name":"keyword.operator.assignment.compound.shell"},"8":{"name":"keyword.operator.assignment.compound.shell"},"9":{"name":"punctuation.definition.array.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.array.shell"}},"patterns":[{"include":"#comment"},{"captures":{"1":{"name":"variable.other.assignment.array.shell entity.other.attribute-name.shell"},"2":{"name":"keyword.operator.assignment.shell punctuation.definition.assignment.shell"}},"match":"((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(=)"},{"captures":{"1":{"name":"punctuation.definition.bracket.named-array.shell"},"2":{"name":"string.unquoted.shell entity.other.attribute-name.bracket.shell"},"3":{"name":"punctuation.definition.bracket.named-array.shell"},"4":{"name":"punctuation.definition.assignment.shell"}},"match":"(\\\\[)(.+?)(])(=)"},{"include":"#normal_context"},{"include":"#simple_unquoted"}]},"assignment_statement":{"patterns":[{"include":"#array_value"},{"include":"#modified_assignment_statement"},{"include":"#normal_assignment_statement"}]},"basic_command_name":{"captures":{"1":{"name":"storage.modifier.$1.shell"},"2":{"name":"entity.name.function.call.shell entity.name.command.shell","patterns":[{"match":"(?<!\\\\w)(?:continue|return|break)(?!\\\\w)","name":"keyword.control.$0.shell"},{"match":"(?<!\\\\w)(?:unfunction|continue|autoload|unsetopt|bindkey|builtin|getopts|command|declare|unalias|history|unlimit|typeset|suspend|source|printf|unhash|disown|ulimit|return|which|alias|break|false|print|shift|times|umask|unset|read|type|exec|eval|wait|echo|dirs|jobs|kill|hash|stat|exit|test|trap|true|let|set|pwd|cd|fg|bg|fc|[.:])(?!/)(?!\\\\w)(?!-)","name":"support.function.builtin.shell"},{"include":"#variable"}]}},"match":"(?![\\\\n!#\\\\&()<>\\\\[{|]|$|[\\\\t ;])(?!nocorrect |nocorrect\\\\t|nocorrect$|readonly |readonly\\\\t|readonly$|function |function\\\\t|function$|foreach |foreach\\\\t|foreach$|coproc |coproc\\\\t|coproc$|logout |logout\\\\t|logout$|export |export\\\\t|export$|select |select\\\\t|select$|repeat |repeat\\\\t|repeat$|pushd |pushd\\\\t|pushd$|until |until\\\\t|until$|while |while\\\\t|while$|local |local\\\\t|local$|case |case\\\\t|case$|done |done\\\\t|done$|elif |elif\\\\t|elif$|else |else\\\\t|else$|esac |esac\\\\t|esac$|popd |popd\\\\t|popd$|then |then\\\\t|then$|time |time\\\\t|time$|for |for\\\\t|for$|end |end\\\\t|end$|fi |fi\\\\t|fi$|do |do\\\\t|do$|in |in\\\\t|in$|if |if\\\\t|if$)(?:((?<=^|[\\\\t \\\\&;])(?:readonly|declare|typeset|export|local)(?=[\\\\t \\\\&;]|$))|((?![\\"\']|\\\\\\\\\\\\n?$)[^\\\\t\\\\n\\\\r !\\"\'<>]+?))(?:(?=[\\\\t ])|(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\))","name":"meta.statement.command.name.basic.shell"},"block_comment":{"begin":"\\\\s*+(/\\\\*)","beginCaptures":{"1":{"name":"punctuation.definition.comment.begin.shell"}},"end":"\\\\*/","endCaptures":{"0":{"name":"punctuation.definition.comment.end.shell"}},"name":"comment.block.shell"},"boolean":{"match":"\\\\b(?:true|false)\\\\b","name":"constant.language.$0.shell"},"case_statement":{"begin":"\\\\b(case)\\\\b[\\\\t ]*+(.+?)[\\\\t ]*+\\\\b(in)\\\\b","beginCaptures":{"1":{"name":"keyword.control.case.shell"},"2":{"patterns":[{"include":"#initial_context"}]},"3":{"name":"keyword.control.in.shell"}},"end":"\\\\besac\\\\b","endCaptures":{"0":{"name":"keyword.control.esac.shell"}},"name":"meta.case.shell","patterns":[{"include":"#comment"},{"captures":{"1":{"name":"keyword.operator.pattern.case.default.shell"}},"match":"[\\\\t ]*+(\\\\* *\\\\))"},{"begin":"(?<!\\\\))(?![\\\\t ]*+(?:esac\\\\b|$))","beginCaptures":{},"end":"(?=\\\\besac\\\\b)|(\\\\))","endCaptures":{"1":{"name":"keyword.operator.pattern.case.shell"}},"name":"meta.case.entry.pattern.shell","patterns":[{"include":"#case_statement_context"}]},{"begin":"(?<=\\\\))","beginCaptures":{},"end":"(;;)|(?=\\\\besac\\\\b)","endCaptures":{"1":{"name":"punctuation.terminator.statement.case.shell"}},"name":"meta.case.entry.body.shell","patterns":[{"include":"#typical_statements"},{"include":"#initial_context"}]}]},"case_statement_context":{"patterns":[{"match":"\\\\*","name":"variable.language.special.quantifier.star.shell keyword.operator.quantifier.star.shell punctuation.definition.arbitrary-repetition.shell punctuation.definition.regex.arbitrary-repetition.shell"},{"match":"\\\\+","name":"variable.language.special.quantifier.plus.shell keyword.operator.quantifier.plus.shell punctuation.definition.arbitrary-repetition.shell punctuation.definition.regex.arbitrary-repetition.shell"},{"match":"\\\\?","name":"variable.language.special.quantifier.question.shell keyword.operator.quantifier.question.shell punctuation.definition.arbitrary-repetition.shell punctuation.definition.regex.arbitrary-repetition.shell"},{"match":"@","name":"variable.language.special.at.shell keyword.operator.at.shell punctuation.definition.regex.at.shell"},{"match":"\\\\|","name":"keyword.operator.orvariable.language.special.or.shell keyword.operator.alternation.ruby.shell punctuation.definition.regex.alternation.shell punctuation.separator.regex.alternation.shell"},{"match":"\\\\\\\\.","name":"constant.character.escape.shell"},{"match":"(?<=\\\\tin| in|[\\\\t ]|;;)\\\\(","name":"keyword.operator.pattern.case.shell"},{"begin":"(?<=\\\\S)(\\\\()","beginCaptures":{"1":{"name":"punctuation.definition.group.shell punctuation.definition.regex.group.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.definition.regex.group.shell"}},"name":"meta.parenthese.shell","patterns":[{"include":"#case_statement_context"}]},{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.character-class.shell"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.character-class.shell"}},"name":"string.regexp.character-class.shell","patterns":[{"match":"\\\\\\\\.","name":"constant.character.escape.shell"}]},{"include":"#string"},{"match":"[^\\\\t\\\\n )*?@\\\\[|]","name":"string.unquoted.pattern.shell string.regexp.unquoted.shell"}]},"command_name_range":{"begin":"\\\\G","beginCaptures":{},"end":"(?=[\\\\t \\\\&;|]|$|[\\\\n)`])|(?=<)","endCaptures":{},"name":"meta.statement.command.name.shell","patterns":[{"match":"(?<!\\\\w)(?:continue|return|break)(?!\\\\w)","name":"entity.name.function.call.shell entity.name.command.shell keyword.control.$0.shell"},{"match":"(?<!\\\\w)(?:unfunction|continue|autoload|unsetopt|bindkey|builtin|getopts|command|declare|unalias|history|unlimit|typeset|suspend|source|printf|unhash|disown|ulimit|return|which|alias|break|false|print|shift|times|umask|unset|read|type|exec|eval|wait|echo|dirs|jobs|kill|hash|stat|exit|test|trap|true|let|set|pwd|cd|fg|bg|fc|[.:])(?!/)(?!\\\\w)(?!-)","name":"entity.name.function.call.shell entity.name.command.shell support.function.builtin.shell"},{"include":"#variable"},{"captures":{"1":{"name":"entity.name.function.call.shell entity.name.command.shell"}},"match":"(?<!\\\\w)(?<=\\\\G|[\\"\')}])([^\\\\t\\\\n\\\\r \\"\\\\&\');->`{|]+)"},{"begin":"(?:\\\\G|(?<![\\\\t\\\\n #\\\\&;{|]))(\\\\$?)((\\")|(\'))","beginCaptures":{"1":{"name":"meta.statement.command.name.quoted.shell punctuation.definition.string.shell entity.name.function.call.shell entity.name.command.shell"},"2":{},"3":{"name":"meta.statement.command.name.quoted.shell string.quoted.double.shell punctuation.definition.string.begin.shell entity.name.function.call.shell entity.name.command.shell"},"4":{"name":"meta.statement.command.name.quoted.shell string.quoted.single.shell punctuation.definition.string.begin.shell entity.name.function.call.shell entity.name.command.shell"}},"end":"(?<!\\\\G)(?<=\\\\2)","endCaptures":{},"patterns":[{"include":"#continuation_of_single_quoted_command_name"},{"include":"#continuation_of_double_quoted_command_name"}]},{"include":"#line_continuation"},{"include":"#simple_unquoted"}]},"command_statement":{"begin":"[\\\\t ]*+(?![\\\\n!#\\\\&()<>\\\\[{|]|$|[\\\\t ;])(?!nocorrect |nocorrect\\\\t|nocorrect$|readonly |readonly\\\\t|readonly$|function |function\\\\t|function$|foreach |foreach\\\\t|foreach$|coproc |coproc\\\\t|coproc$|logout |logout\\\\t|logout$|export |export\\\\t|export$|select |select\\\\t|select$|repeat |repeat\\\\t|repeat$|pushd |pushd\\\\t|pushd$|until |until\\\\t|until$|while |while\\\\t|while$|local |local\\\\t|local$|case |case\\\\t|case$|done |done\\\\t|done$|elif |elif\\\\t|elif$|else |else\\\\t|else$|esac |esac\\\\t|esac$|popd |popd\\\\t|popd$|then |then\\\\t|then$|time |time\\\\t|time$|for |for\\\\t|for$|end |end\\\\t|end$|fi |fi\\\\t|fi$|do |do\\\\t|do$|in |in\\\\t|in$|if |if\\\\t|if$)(?!\\\\\\\\\\\\n?$)","beginCaptures":{},"end":"(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.statement.command.shell","patterns":[{"include":"#command_name_range"},{"include":"#line_continuation"},{"include":"#option"},{"include":"#argument"},{"include":"#string"},{"include":"#heredoc"}]},"comment":{"captures":{"1":{"name":"comment.line.number-sign.shell meta.shebang.shell"},"2":{"name":"punctuation.definition.comment.shebang.shell"},"3":{"name":"comment.line.number-sign.shell"},"4":{"name":"punctuation.definition.comment.shell"}},"match":"(?:^|[\\\\t ]++)(?:((#!).*)|((#).*))"},"comments":{"patterns":[{"include":"#block_comment"},{"include":"#line_comment"}]},"compound-command":{"patterns":[{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"name":"meta.scope.logical-expression.shell","patterns":[{"include":"#logical-expression"},{"include":"#initial_context"}]},{"begin":"(?<=\\\\s|^)\\\\{(?=\\\\s|$)","beginCaptures":{"0":{"name":"punctuation.definition.group.shell"}},"end":"(?<=^|;)\\\\s*(})","endCaptures":{"1":{"name":"punctuation.definition.group.shell"}},"name":"meta.scope.group.shell","patterns":[{"include":"#initial_context"}]}]},"continuation_of_double_quoted_command_name":{"begin":"\\\\G(?<=\\")","beginCaptures":{},"contentName":"meta.statement.command.name.continuation string.quoted.double entity.name.function.call entity.name.command","end":"\\"","endCaptures":{"0":{"name":"string.quoted.double.shell punctuation.definition.string.end.shell entity.name.function.call.shell entity.name.command.shell"}},"patterns":[{"match":"\\\\\\\\[\\\\n\\"$\\\\\\\\`]","name":"constant.character.escape.shell"},{"include":"#variable"},{"include":"#interpolation"}]},"continuation_of_single_quoted_command_name":{"begin":"\\\\G(?<=\')","beginCaptures":{},"contentName":"meta.statement.command.name.continuation string.quoted.single entity.name.function.call entity.name.command","end":"\'","endCaptures":{"0":{"name":"string.quoted.single.shell punctuation.definition.string.end.shell entity.name.function.call.shell entity.name.command.shell"}}},"custom_command_names":{"patterns":[]},"custom_commands":{"patterns":[]},"double_quote_context":{"patterns":[{"match":"\\\\\\\\[\\\\n\\"$\\\\\\\\`]","name":"constant.character.escape.shell"},{"include":"#variable"},{"include":"#interpolation"}]},"double_quote_escape_char":{"match":"\\\\\\\\[\\\\n\\"$\\\\\\\\`]","name":"constant.character.escape.shell"},"floating_keyword":{"patterns":[{"match":"(?<=^|[\\\\t \\\\&;])(?:then|elif|else|done|end|do|if|fi)(?=[\\\\t \\\\&;]|$)","name":"keyword.control.$0.shell"}]},"for_statement":{"patterns":[{"begin":"\\\\b(for)\\\\b[\\\\t ]*+((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))[\\\\t ]*+\\\\b(in)\\\\b","beginCaptures":{"1":{"name":"keyword.control.for.shell"},"2":{"name":"variable.other.for.shell"},"3":{"name":"keyword.control.in.shell"}},"end":"(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.for.in.shell","patterns":[{"include":"#string"},{"include":"#simple_unquoted"},{"include":"#normal_context"}]},{"begin":"\\\\b(for)\\\\b","beginCaptures":{"1":{"name":"keyword.control.for.shell"}},"end":"(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.for.shell","patterns":[{"include":"#arithmetic_double"},{"include":"#normal_context"}]}]},"function_definition":{"applyEndPatternLast":1,"begin":"[\\\\t ]*+(?:\\\\b(function)\\\\b[\\\\t ]*+([^\\\\t\\\\n\\\\r \\"\'()=]+)(?:(\\\\()[\\\\t ]*+(\\\\)))?|([^\\\\t\\\\n\\\\r \\"\'()=]+)[\\\\t ]*+(\\\\()[\\\\t ]*+(\\\\)))","beginCaptures":{"1":{"name":"storage.type.function.shell"},"2":{"name":"entity.name.function.shell"},"3":{"name":"punctuation.definition.arguments.shell"},"4":{"name":"punctuation.definition.arguments.shell"},"5":{"name":"entity.name.function.shell"},"6":{"name":"punctuation.definition.arguments.shell"},"7":{"name":"punctuation.definition.arguments.shell"}},"end":"(?<=[)}])","endCaptures":{},"name":"meta.function.shell","patterns":[{"match":"\\\\G[\\\\t\\\\n ]"},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.section.function.definition.shell"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.section.function.definition.shell"}},"name":"meta.function.body.shell","patterns":[{"include":"#initial_context"}]},{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.section.function.definition.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.section.function.definition.shell"}},"name":"meta.function.body.shell","patterns":[{"include":"#initial_context"}]},{"include":"#initial_context"}]},"heredoc":{"patterns":[{"begin":"((?<!<)<<-)[\\\\t ]*+([\\"\'])[\\\\t ]*+([^\\"\']+?)(?=[\\"\\\\&\';<\\\\s])(\\\\2)(.*)","beginCaptures":{"1":{"name":"keyword.operator.heredoc.shell"},"2":{"name":"punctuation.definition.string.heredoc.quote.shell"},"3":{"name":"punctuation.definition.string.heredoc.delimiter.shell"},"4":{"name":"punctuation.definition.string.heredoc.quote.shell"},"5":{"patterns":[{"include":"#redirect_fix"},{"include":"#typical_statements"}]}},"contentName":"string.quoted.heredoc.indent.$3","end":"^\\\\t*\\\\3(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"punctuation.definition.string.heredoc.$0.shell"}},"patterns":[]},{"begin":"((?<!<)<<(?!<))[\\\\t ]*+([\\"\'])[\\\\t ]*+([^\\"\']+?)(?=[\\"\\\\&\';<\\\\s])(\\\\2)(.*)","beginCaptures":{"1":{"name":"keyword.operator.heredoc.shell"},"2":{"name":"punctuation.definition.string.heredoc.quote.shell"},"3":{"name":"punctuation.definition.string.heredoc.delimiter.shell"},"4":{"name":"punctuation.definition.string.heredoc.quote.shell"},"5":{"patterns":[{"include":"#redirect_fix"},{"include":"#typical_statements"}]}},"contentName":"string.quoted.heredoc.no-indent.$3","end":"^\\\\3(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"punctuation.definition.string.heredoc.delimiter.shell"}},"patterns":[]},{"begin":"((?<!<)<<-)[\\\\t ]*+([^\\\\t \\"\']+)(?=[\\"\\\\&\';<\\\\s])(.*)","beginCaptures":{"1":{"name":"keyword.operator.heredoc.shell"},"2":{"name":"punctuation.definition.string.heredoc.delimiter.shell"},"3":{"patterns":[{"include":"#redirect_fix"},{"include":"#typical_statements"}]}},"contentName":"string.unquoted.heredoc.indent.$2","end":"^\\\\t*\\\\2(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"punctuation.definition.string.heredoc.delimiter.shell"}},"patterns":[{"include":"#double_quote_escape_char"},{"include":"#variable"},{"include":"#interpolation"}]},{"begin":"((?<!<)<<(?!<))[\\\\t ]*+([^\\\\t \\"\']+)(?=[\\"\\\\&\';<\\\\s])(.*)","beginCaptures":{"1":{"name":"keyword.operator.heredoc.shell"},"2":{"name":"punctuation.definition.string.heredoc.delimiter.shell"},"3":{"patterns":[{"include":"#redirect_fix"},{"include":"#typical_statements"}]}},"contentName":"string.unquoted.heredoc.no-indent.$2","end":"^\\\\2(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"punctuation.definition.string.heredoc.delimiter.shell"}},"patterns":[{"include":"#double_quote_escape_char"},{"include":"#variable"},{"include":"#interpolation"}]}]},"herestring":{"patterns":[{"begin":"(<<<)\\\\s*((\'))","beginCaptures":{"1":{"name":"keyword.operator.herestring.shell"},"2":{"name":"string.quoted.single.shell"},"3":{"name":"punctuation.definition.string.begin.shell"}},"contentName":"string.quoted.single.shell","end":"(\')","endCaptures":{"0":{"name":"string.quoted.single.shell"},"1":{"name":"punctuation.definition.string.end.shell"}},"name":"meta.herestring.shell"},{"begin":"(<<<)\\\\s*((\\"))","beginCaptures":{"1":{"name":"keyword.operator.herestring.shell"},"2":{"name":"string.quoted.double.shell"},"3":{"name":"punctuation.definition.string.begin.shell"}},"contentName":"string.quoted.double.shell","end":"(\\")","endCaptures":{"0":{"name":"string.quoted.double.shell"},"1":{"name":"punctuation.definition.string.end.shell"}},"name":"meta.herestring.shell","patterns":[{"include":"#double_quote_context"}]},{"captures":{"1":{"name":"keyword.operator.herestring.shell"},"2":{"name":"string.unquoted.herestring.shell","patterns":[{"include":"#initial_context"}]}},"match":"(<<<)\\\\s*(([^)\\\\\\\\\\\\s]|\\\\\\\\.)+)","name":"meta.herestring.shell"}]},"initial_context":{"patterns":[{"include":"#comment"},{"include":"#pipeline"},{"include":"#normal_statement_seperator"},{"include":"#logical_expression_double"},{"include":"#logical_expression_single"},{"include":"#assignment_statement"},{"include":"#case_statement"},{"include":"#for_statement"},{"include":"#loop"},{"include":"#function_definition"},{"include":"#line_continuation"},{"include":"#arithmetic_double"},{"include":"#misc_ranges"},{"include":"#variable"},{"include":"#interpolation"},{"include":"#heredoc"},{"include":"#herestring"},{"include":"#redirection"},{"include":"#pathname"},{"include":"#floating_keyword"},{"include":"#alias_statement"},{"include":"#normal_statement"},{"include":"#string"},{"include":"#support"}]},"inline_comment":{"captures":{"1":{"name":"comment.block.shell punctuation.definition.comment.begin.shell"},"2":{"name":"comment.block.shell"},"3":{"patterns":[{"match":"\\\\*/","name":"comment.block.shell punctuation.definition.comment.end.shell"},{"match":"\\\\*","name":"comment.block.shell"}]}},"match":"(/\\\\*)((?:[^*]|\\\\*++[^/])*+(\\\\*++/))"},"interpolation":{"patterns":[{"include":"#arithmetic_dollar"},{"include":"#subshell_dollar"},{"begin":"`","beginCaptures":{"0":{"name":"punctuation.definition.evaluation.backticks.shell"}},"end":"`","endCaptures":{"0":{"name":"punctuation.definition.evaluation.backticks.shell"}},"name":"string.interpolated.backtick.shell","patterns":[{"match":"\\\\\\\\[$\\\\\\\\`]","name":"constant.character.escape.shell"},{"begin":"(?<=\\\\W)(?=#)(?!#\\\\{)","beginCaptures":{"1":{"name":"punctuation.whitespace.comment.leading.shell"}},"end":"(?!\\\\G)","patterns":[{"begin":"#","beginCaptures":{"0":{"name":"punctuation.definition.comment.shell"}},"end":"(?=`)","name":"comment.line.number-sign.shell"}]},{"include":"#initial_context"}]}]},"keyword":{"patterns":[{"match":"(?<=^|[\\\\&;\\\\s])(then|else|elif|fi|for|in|do|done|select|continue|esac|while|until|return)(?=[\\\\&;\\\\s]|$)","name":"keyword.control.shell"},{"match":"(?<=^|[\\\\&;\\\\s])(?:export|declare|typeset|local|readonly)(?=[\\\\&;\\\\s]|$)","name":"storage.modifier.shell"}]},"line_comment":{"begin":"\\\\s*+(//)","beginCaptures":{"1":{"name":"punctuation.definition.comment.shell"}},"end":"(?<=\\\\n)(?<!\\\\\\\\\\\\n)","endCaptures":{},"name":"comment.line.double-slash.shell","patterns":[{"include":"#line_continuation_character"}]},"line_continuation":{"match":"\\\\\\\\(?=\\\\n)","name":"constant.character.escape.line-continuation.shell"},"logical-expression":{"patterns":[{"include":"#arithmetic_no_dollar"},{"match":"=[=~]?|!=?|[<>]|&&|\\\\|\\\\|","name":"keyword.operator.logical.shell"},{"match":"(?<!\\\\S)-(nt|ot|ef|eq|ne|l[et]|g[et]|[GLNOSa-hknopr-uwxz])\\\\b","name":"keyword.operator.logical.shell"}]},"logical_expression_context":{"patterns":[{"include":"#regex_comparison"},{"include":"#arithmetic_no_dollar"},{"include":"#logical-expression"},{"include":"#logical_expression_single"},{"include":"#logical_expression_double"},{"include":"#comment"},{"include":"#boolean"},{"include":"#redirect_number"},{"include":"#numeric_literal"},{"include":"#pipeline"},{"include":"#normal_statement_seperator"},{"include":"#string"},{"include":"#variable"},{"include":"#interpolation"},{"include":"#heredoc"},{"include":"#herestring"},{"include":"#pathname"},{"include":"#floating_keyword"},{"include":"#support"}]},"logical_expression_double":{"begin":"\\\\[\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"end":"]]","endCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"name":"meta.scope.logical-expression.shell","patterns":[{"include":"#logical_expression_context"}]},"logical_expression_single":{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"name":"meta.scope.logical-expression.shell","patterns":[{"include":"#logical_expression_context"}]},"loop":{"patterns":[{"begin":"(?<=^|[\\\\&;\\\\s])(for)\\\\s+(.+?)\\\\s+(in)(?=[\\\\&;\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.control.shell"},"2":{"name":"variable.other.loop.shell","patterns":[{"include":"#string"}]},"3":{"name":"keyword.control.shell"}},"end":"(?<=^|[\\\\&;\\\\s])done(?=[\\\\&;\\\\s]|$|\\\\))","endCaptures":{"0":{"name":"keyword.control.shell"}},"name":"meta.scope.for-in-loop.shell","patterns":[{"include":"#initial_context"}]},{"begin":"(?<=^|[\\\\&;\\\\s])(while|until)(?=[\\\\&;\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.control.shell"}},"end":"(?<=^|[\\\\&;\\\\s])done(?=[\\\\&;\\\\s]|$|\\\\))","endCaptures":{"0":{"name":"keyword.control.shell"}},"name":"meta.scope.while-loop.shell","patterns":[{"include":"#initial_context"}]},{"begin":"(?<=^|[\\\\&;\\\\s])(select)\\\\s+((?:[^\\\\\\\\\\\\s]|\\\\\\\\.)+)(?=[\\\\&;\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.control.shell"},"2":{"name":"variable.other.loop.shell"}},"end":"(?<=^|[\\\\&;\\\\s])(done)(?=[\\\\&;\\\\s]|$|\\\\))","endCaptures":{"1":{"name":"keyword.control.shell"}},"name":"meta.scope.select-block.shell","patterns":[{"include":"#initial_context"}]},{"begin":"(?<=^|[\\\\&;\\\\s])if(?=[\\\\&;\\\\s]|$)","beginCaptures":{"0":{"name":"keyword.control.if.shell"}},"end":"(?<=^|[\\\\&;\\\\s])fi(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"keyword.control.fi.shell"}},"name":"meta.scope.if-block.shell","patterns":[{"include":"#initial_context"}]}]},"math":{"patterns":[{"include":"#variable"},{"match":"\\\\+{1,2}|-{1,2}|[!~]|\\\\*{1,2}|[%/]|<[<=]?|>[=>]?|==|!=|^|\\\\|{1,2}|&{1,2}|[,:=?]|[-%\\\\&*+/^|]=|<<=|>>=","name":"keyword.operator.arithmetic.shell"},{"match":"0[Xx]\\\\h+","name":"constant.numeric.hex.shell"},{"match":";","name":"punctuation.separator.semicolon.range"},{"match":"0\\\\d+","name":"constant.numeric.octal.shell"},{"match":"\\\\d{1,2}#[0-9@-Z_a-z]+","name":"constant.numeric.other.shell"},{"match":"\\\\d+","name":"constant.numeric.integer.shell"},{"match":"(?<!\\\\w)[0-9A-Z_a-z]+(?!\\\\w)","name":"variable.other.normal.shell"}]},"math_operators":{"patterns":[{"match":"\\\\+{1,2}|-{1,2}|[!~]|\\\\*{1,2}|[%/]|<[<=]?|>[=>]?|==|!=|^|\\\\|{1,2}|&{1,2}|[,:=?]|[-%\\\\&*+/^|]=|<<=|>>=","name":"keyword.operator.arithmetic.shell"},{"match":"0[Xx]\\\\h+","name":"constant.numeric.hex.shell"},{"match":"0\\\\d+","name":"constant.numeric.octal.shell"},{"match":"\\\\d{1,2}#[0-9@-Z_a-z]+","name":"constant.numeric.other.shell"},{"match":"\\\\d+","name":"constant.numeric.integer.shell"}]},"misc_ranges":{"patterns":[{"include":"#logical_expression_single"},{"include":"#logical_expression_double"},{"include":"#subshell_dollar"},{"begin":"(?<![^\\\\t ])(\\\\{)(?![$\\\\w])","beginCaptures":{"1":{"name":"punctuation.definition.group.shell"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.group.shell"}},"name":"meta.scope.group.shell","patterns":[{"include":"#initial_context"}]}]},"modified_assignment_statement":{"begin":"(?<=^|[\\\\t \\\\&;])(?:readonly|declare|typeset|export|local)(?=[\\\\t \\\\&;]|$)","beginCaptures":{"0":{"name":"storage.modifier.$0.shell"}},"end":"(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.statement.shell meta.expression.assignment.modified.shell","patterns":[{"match":"(?<!\\\\w)-\\\\w+\\\\b","name":"string.unquoted.argument.shell constant.other.option.shell"},{"include":"#array_value"},{"captures":{"1":{"name":"variable.other.assignment.shell"},"2":{"name":"punctuation.definition.array.access.shell"},"3":{"name":"variable.other.assignment.shell"},"4":{"name":"constant.numeric.shell constant.numeric.integer.shell"},"5":{"name":"punctuation.definition.array.access.shell"},"6":{"name":"keyword.operator.assignment.shell"},"7":{"name":"keyword.operator.assignment.compound.shell"},"8":{"name":"keyword.operator.assignment.compound.shell"},"9":{"name":"constant.numeric.shell constant.numeric.hex.shell"},"10":{"name":"constant.numeric.shell constant.numeric.octal.shell"},"11":{"name":"constant.numeric.shell constant.numeric.other.shell"},"12":{"name":"constant.numeric.shell constant.numeric.decimal.shell"},"13":{"name":"constant.numeric.shell constant.numeric.version.shell"},"14":{"name":"constant.numeric.shell constant.numeric.integer.shell"}},"match":"((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(?:(\\\\[)((?:(?:\\\\$?(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)|@)|\\\\*)|(-?\\\\d+))(]))?(?:(?:(=)|(\\\\+=))|(-=))?(?:(?<=[\\\\t =]|^|[(\\\\[{])(?:(?:(?:(?:(?:(0[Xx]\\\\h+)|(0\\\\d+))|(\\\\d{1,2}#[0-9@-Z_a-z]+))|(-?\\\\d+\\\\.\\\\d+))|(-?\\\\d+(?:\\\\.\\\\d+)+))|(-?\\\\d+))(?=[\\\\t ]|$|[);}]))?"},{"include":"#normal_context"}]},"modifiers":{"match":"(?<=^|[\\\\t \\\\&;])(?:readonly|declare|typeset|export|local)(?=[\\\\t \\\\&;]|$)","name":"storage.modifier.$0.shell"},"normal_assignment_statement":{"begin":"[\\\\t ]*+((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(?:(\\\\[)((?:(?:\\\\$?(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)|@)|\\\\*)|(-?\\\\d+))(]))?(?:(?:(=)|(\\\\+=))|(-=))","beginCaptures":{"1":{"name":"variable.other.assignment.shell"},"2":{"name":"punctuation.definition.array.access.shell"},"3":{"name":"variable.other.assignment.shell"},"4":{"name":"constant.numeric.shell constant.numeric.integer.shell"},"5":{"name":"punctuation.definition.array.access.shell"},"6":{"name":"keyword.operator.assignment.shell"},"7":{"name":"keyword.operator.assignment.compound.shell"},"8":{"name":"keyword.operator.assignment.compound.shell"}},"end":"(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.expression.assignment.shell","patterns":[{"include":"#comment"},{"include":"#string"},{"include":"#normal_assignment_statement"},{"begin":"(?<=[\\\\t ])(?![\\\\t ]|\\\\w+=)","beginCaptures":{},"end":"(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.statement.command.env.shell","patterns":[{"include":"#command_name_range"},{"include":"#line_continuation"},{"include":"#option"},{"include":"#argument"},{"include":"#string"}]},{"include":"#simple_unquoted"},{"include":"#normal_context"}]},"normal_context":{"patterns":[{"include":"#comment"},{"include":"#pipeline"},{"include":"#normal_statement_seperator"},{"include":"#misc_ranges"},{"include":"#boolean"},{"include":"#redirect_number"},{"include":"#numeric_literal"},{"include":"#string"},{"include":"#variable"},{"include":"#interpolation"},{"include":"#heredoc"},{"include":"#herestring"},{"include":"#redirection"},{"include":"#pathname"},{"include":"#floating_keyword"},{"include":"#support"},{"include":"#parenthese"}]},"normal_statement":{"begin":"(?!^[\\\\t ]*+$)(?:(?<=(?:^until| until|\\\\tuntil|^while| while|\\\\twhile|^elif| elif|\\\\telif|^else| else|\\\\telse|^then| then|\\\\tthen|^do| do|\\\\tdo|^if| if|\\\\tif) )|(?<=^|[!\\\\&(;`{|]))[\\\\t ]*+(?!nocorrect\\\\W|nocorrect\\\\$|function\\\\W|function\\\\$|foreach\\\\W|foreach\\\\$|repeat\\\\W|repeat\\\\$|logout\\\\W|logout\\\\$|coproc\\\\W|coproc\\\\$|select\\\\W|select\\\\$|while\\\\W|while\\\\$|pushd\\\\W|pushd\\\\$|until\\\\W|until\\\\$|case\\\\W|case\\\\$|done\\\\W|done\\\\$|elif\\\\W|elif\\\\$|else\\\\W|else\\\\$|esac\\\\W|esac\\\\$|popd\\\\W|popd\\\\$|then\\\\W|then\\\\$|time\\\\W|time\\\\$|for\\\\W|for\\\\$|end\\\\W|end\\\\$|fi\\\\W|fi\\\\$|do\\\\W|do\\\\$|in\\\\W|in\\\\$|if\\\\W|if\\\\$)","beginCaptures":{},"end":"(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.statement.shell","patterns":[{"include":"#typical_statements"}]},"normal_statement_seperator":{"captures":{"1":{"name":"punctuation.terminator.statement.semicolon.shell"},"2":{"name":"punctuation.separator.statement.and.shell"},"3":{"name":"punctuation.separator.statement.or.shell"},"4":{"name":"punctuation.separator.statement.background.shell"}},"match":"(?:(?:(;)|(&&))|(\\\\|\\\\|))|(&)"},"numeric_literal":{"captures":{"1":{"name":"constant.numeric.shell constant.numeric.hex.shell"},"2":{"name":"constant.numeric.shell constant.numeric.octal.shell"},"3":{"name":"constant.numeric.shell constant.numeric.other.shell"},"4":{"name":"constant.numeric.shell constant.numeric.decimal.shell"},"5":{"name":"constant.numeric.shell constant.numeric.version.shell"},"6":{"name":"constant.numeric.shell constant.numeric.integer.shell"}},"match":"(?<=[\\\\t =]|^|[(\\\\[{])(?:(?:(?:(?:(?:(0[Xx]\\\\h+)|(0\\\\d+))|(\\\\d{1,2}#[0-9@-Z_a-z]+))|(-?\\\\d+\\\\.\\\\d+))|(-?\\\\d+(?:\\\\.\\\\d+)+))|(-?\\\\d+))(?=[\\\\t ]|$|[);}])"},"option":{"begin":"[\\\\t ]++(-)((?![\\\\n!#\\\\&()<>\\\\[{|]|$|[\\\\t ;]))","beginCaptures":{"1":{"name":"string.unquoted.argument.shell constant.other.option.dash.shell"},"2":{"name":"string.unquoted.argument.shell constant.other.option.shell"}},"contentName":"string.unquoted.argument constant.other.option","end":"(?=[\\\\t ])|(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"patterns":[{"include":"#option_context"}]},"option_context":{"patterns":[{"include":"#misc_ranges"},{"include":"#string"},{"include":"#variable"},{"include":"#interpolation"},{"include":"#heredoc"},{"include":"#herestring"},{"include":"#redirection"},{"include":"#pathname"},{"include":"#floating_keyword"},{"include":"#support"}]},"parenthese":{"patterns":[{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.section.parenthese.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.parenthese.shell"}},"name":"meta.parenthese.group.shell","patterns":[{"include":"#initial_context"}]}]},"pathname":{"patterns":[{"match":"(?<=[:=\\\\s]|^)~","name":"keyword.operator.tilde.shell"},{"match":"[*?]","name":"keyword.operator.glob.shell"},{"begin":"([!*+?@])(\\\\()","beginCaptures":{"1":{"name":"keyword.operator.extglob.shell"},"2":{"name":"punctuation.definition.extglob.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.extglob.shell"}},"name":"meta.structure.extglob.shell","patterns":[{"include":"#initial_context"}]}]},"pipeline":{"patterns":[{"match":"(?<=^|[\\\\&;\\\\s])(time)(?=[\\\\&;\\\\s]|$)","name":"keyword.other.shell"},{"match":"[!|]","name":"keyword.operator.pipe.shell"}]},"redirect_fix":{"captures":{"1":{"name":"keyword.operator.redirect.shell"},"2":{"name":"string.unquoted.argument.shell"}},"match":"(>>?)[\\\\t ]*+([^\\\\t\\\\n \\"$\\\\&-);<>\\\\\\\\`|]+)"},"redirect_number":{"captures":{"1":{"name":"keyword.operator.redirect.stdout.shell"},"2":{"name":"keyword.operator.redirect.stderr.shell"},"3":{"name":"keyword.operator.redirect.$3.shell"}},"match":"(?<=[\\\\t ])(?:(1)|(2)|(\\\\d+))(?=>)"},"redirection":{"patterns":[{"begin":"[<>]\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.string.end.shell"}},"name":"string.interpolated.process-substitution.shell","patterns":[{"include":"#initial_context"}]},{"match":"(?<![<>])(&>|\\\\d*>&\\\\d*|\\\\d*(>>|[<>])|\\\\d*<&|\\\\d*<>)(?![<>])","name":"keyword.operator.redirect.shell"}]},"regex_comparison":{"match":"=~","name":"keyword.operator.logical.regex.shell"},"regexp":{"patterns":[{"match":".+"}]},"simple_options":{"captures":{"0":{"patterns":[{"captures":{"1":{"name":"string.unquoted.argument.shell constant.other.option.dash.shell"},"2":{"name":"string.unquoted.argument.shell constant.other.option.shell"}},"match":"[\\\\t ]++(-)(\\\\w+)"}]}},"match":"(?:[\\\\t ]++-\\\\w+)*"},"simple_unquoted":{"match":"[^\\\\t\\\\n \\"$\\\\&-);<>\\\\\\\\`|]","name":"string.unquoted.shell"},"special_expansion":{"match":"!|:[-=?]?|[*@]|##?|%%|[%/]","name":"keyword.operator.expansion.shell"},"start_of_command":{"match":"[\\\\t ]*+(?![\\\\n!#\\\\&()<>\\\\[{|]|$|[\\\\t ;])(?!nocorrect |nocorrect\\\\t|nocorrect$|readonly |readonly\\\\t|readonly$|function |function\\\\t|function$|foreach |foreach\\\\t|foreach$|coproc |coproc\\\\t|coproc$|logout |logout\\\\t|logout$|export |export\\\\t|export$|select |select\\\\t|select$|repeat |repeat\\\\t|repeat$|pushd |pushd\\\\t|pushd$|until |until\\\\t|until$|while |while\\\\t|while$|local |local\\\\t|local$|case |case\\\\t|case$|done |done\\\\t|done$|elif |elif\\\\t|elif$|else |else\\\\t|else$|esac |esac\\\\t|esac$|popd |popd\\\\t|popd$|then |then\\\\t|then$|time |time\\\\t|time$|for |for\\\\t|for$|end |end\\\\t|end$|fi |fi\\\\t|fi$|do |do\\\\t|do$|in |in\\\\t|in$|if |if\\\\t|if$)(?!\\\\\\\\\\\\n?$)"},"string":{"patterns":[{"match":"\\\\\\\\.","name":"constant.character.escape.shell"},{"begin":"\'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.shell"}},"end":"\'","endCaptures":{"0":{"name":"punctuation.definition.string.end.shell"}},"name":"string.quoted.single.shell"},{"begin":"\\\\$?\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.shell"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.shell"}},"name":"string.quoted.double.shell","patterns":[{"match":"\\\\\\\\[\\\\n\\"$\\\\\\\\`]","name":"constant.character.escape.shell"},{"include":"#variable"},{"include":"#interpolation"}]},{"begin":"\\\\$\'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.shell"}},"end":"\'","endCaptures":{"0":{"name":"punctuation.definition.string.end.shell"}},"name":"string.quoted.single.dollar.shell","patterns":[{"match":"\\\\\\\\[\'\\\\\\\\abefnrtv]","name":"constant.character.escape.ansi-c.shell"},{"match":"\\\\\\\\[0-9]{3}\\"","name":"constant.character.escape.octal.shell"},{"match":"\\\\\\\\x\\\\h{2}\\"","name":"constant.character.escape.hex.shell"},{"match":"\\\\\\\\c.\\"","name":"constant.character.escape.control-char.shell"}]}]},"subshell_dollar":{"patterns":[{"begin":"\\\\$\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.subshell.single.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.subshell.single.shell"}},"name":"meta.scope.subshell","patterns":[{"include":"#parenthese"},{"include":"#initial_context"}]}]},"support":{"patterns":[{"match":"(?<=^|[\\\\&;\\\\s])[.:](?=[\\\\&;\\\\s]|$)","name":"support.function.builtin.shell"}]},"typical_statements":{"patterns":[{"include":"#assignment_statement"},{"include":"#case_statement"},{"include":"#for_statement"},{"include":"#while_statement"},{"include":"#function_definition"},{"include":"#command_statement"},{"include":"#line_continuation"},{"include":"#arithmetic_double"},{"include":"#normal_context"}]},"variable":{"patterns":[{"captures":{"1":{"name":"punctuation.definition.variable.shell variable.parameter.positional.all.shell"},"2":{"name":"variable.parameter.positional.all.shell"}},"match":"(\\\\$)(@(?!\\\\w))"},{"captures":{"1":{"name":"punctuation.definition.variable.shell variable.parameter.positional.shell"},"2":{"name":"variable.parameter.positional.shell"}},"match":"(\\\\$)([0-9](?!\\\\w))"},{"captures":{"1":{"name":"punctuation.definition.variable.shell variable.language.special.shell"},"2":{"name":"variable.language.special.shell"}},"match":"(\\\\$)([-!#$*0?_](?!\\\\w))"},{"begin":"(\\\\$)(\\\\{)[\\\\t ]*+(?=\\\\d)","beginCaptures":{"1":{"name":"punctuation.definition.variable.shell variable.parameter.positional.shell"},"2":{"name":"punctuation.section.bracket.curly.variable.begin.shell punctuation.definition.variable.shell variable.parameter.positional.shell"}},"contentName":"meta.parameter-expansion","end":"}","endCaptures":{"0":{"name":"punctuation.section.bracket.curly.variable.end.shell punctuation.definition.variable.shell variable.parameter.positional.shell"}},"patterns":[{"include":"#special_expansion"},{"include":"#array_access_inline"},{"match":"[0-9]+","name":"variable.parameter.positional.shell"},{"match":"(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)","name":"variable.other.normal.shell"},{"include":"#variable"},{"include":"#string"}]},{"begin":"(\\\\$)(\\\\{)","beginCaptures":{"1":{"name":"punctuation.definition.variable.shell"},"2":{"name":"punctuation.section.bracket.curly.variable.begin.shell punctuation.definition.variable.shell"}},"contentName":"meta.parameter-expansion","end":"}","endCaptures":{"0":{"name":"punctuation.section.bracket.curly.variable.end.shell punctuation.definition.variable.shell"}},"patterns":[{"include":"#special_expansion"},{"include":"#array_access_inline"},{"match":"(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)","name":"variable.other.normal.shell"},{"include":"#variable"},{"include":"#string"}]},{"captures":{"1":{"name":"punctuation.definition.variable.shell variable.other.normal.shell"},"2":{"name":"variable.other.normal.shell"}},"match":"(\\\\$)(\\\\w+(?!\\\\w))"}]},"while_statement":{"patterns":[{"begin":"\\\\b(while)\\\\b","beginCaptures":{"1":{"name":"keyword.control.while.shell"}},"end":"(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.while.shell","patterns":[{"include":"#line_continuation"},{"include":"#math_operators"},{"include":"#option"},{"include":"#simple_unquoted"},{"include":"#normal_context"},{"include":"#string"}]}]}},"scopeName":"source.shell","aliases":["bash","sh","shell","zsh"]}')),Up=[e];
2
+ export{Up};
@@ -0,0 +1 @@
1
+ import{d,n,o,i,u,a,e,E,m,an,on,Be,Yr,U,bA,Ie,S,gr,Ar,bt,st,Z,J}from"./index-4cag7w6k.js";import{kr}from"./index-c9e417cs.js";function B({sections:c,selected:t,onSelect:l}){let[r,f]=n(""),x=u(()=>{let p=r.trim().toLowerCase();if(!p)return c;return c.map((h)=>({...h,links:h.links.filter((s)=>s.label.toLowerCase().includes(p)||(s.path??s.target).toLowerCase().includes(p))})).filter((h)=>h.links.length>0)},[c,r]),k=c.some((p)=>p.links.length>0);return e("div",{className:"flex h-full min-h-0 w-full flex-col bg-canvas/40",children:[e("div",{className:"flex items-center gap-1.5 border-b border-ink/10 px-2 py-1.5 flex-shrink-0",children:[e(U,{size:11,className:"flex-shrink-0 text-ink/40"}),e("input",{type:"text",value:r,onChange:(p)=>f(p.currentTarget.value),placeholder:"Filter pages…",title:"Filter wiki pages",className:"w-full min-w-0 bg-transparent text-xs text-ink outline-none placeholder-ink/40"}),r&&e("button",{type:"button",onClick:()=>f(""),title:"Clear filter",className:"flex-shrink-0 text-ink/40 hover:text-ink",children:"×"})]}),e("div",{className:"flex-1 min-h-0 overflow-y-auto scrollbar-overlay-container",children:x.length===0?e("p",{className:"px-3 py-2 text-[11px] italic text-ink/40",children:k?"No page matches the filter":"This wiki has no pages"}):x.map((p,h)=>e("div",{className:"py-0.5",children:[p.title&&e("div",{className:"px-2.5 py-1 text-[10px] font-semibold uppercase tracking-wider text-ink/40",children:p.title}),p.links.map((s,g)=>{let b=s.path!==null&&s.path===t,w=`${s.path??s.target}-${g}`;if(s.path)return e("button",{type:"button",onClick:()=>l(s.path),title:s.path,"aria-current":b?"page":void 0,className:`flex w-full items-center gap-1 px-2.5 py-1 text-left text-xs transition-colors ${b?"bg-ink/8 font-medium text-ink":"text-ink/70 hover:bg-ink/5 hover:text-ink"}`,children:e("span",{className:"truncate",children:s.label})},w);if(s.url)return e("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",title:s.url,className:"flex w-full items-center gap-1 px-2.5 py-1 text-left text-xs text-ink/70 hover:bg-ink/5 hover:text-ink",children:[e("span",{className:"truncate",children:s.label}),e(Be,{size:10,className:"flex-shrink-0 text-ink/30"})]},w);return e("div",{title:`Not in this wiki: ${s.target}`,className:"flex w-full items-center px-2.5 py-1 text-left text-xs text-ink/35 line-through decoration-ink/20",children:e("span",{className:"truncate",children:s.label})},w)}),p.notes.map((s,g)=>e("p",{className:"px-2.5 py-0.5 text-[10px] leading-snug text-ink/50",children:s},`note-${g}`))]},`${p.title??"links"}-${h}`))})]})}function j({open:c,onClick:t}){return e("button",{type:"button",onClick:t,title:"Browse wiki pages","aria-label":"Browse wiki pages","aria-expanded":c,className:"absolute bottom-3 right-3 z-20 flex h-9 w-9 items-center justify-center rounded-full border border-ink/20 bg-paper text-ink/60 shadow-sm transition-all hover:bg-ink/5 hover:text-ink",children:e(Yr,{size:16})})}function V({open:c,sections:t,selected:l,onSelect:r,onClose:f}){if(o(()=>{if(!c)return;let x=(k)=>{if(k.key==="Escape")f()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[c,f]),!c)return null;return e(Z,{onClose:f,maxWidthClass:"max-w-sm",zClass:"z-[70]",ariaLabel:"Wiki pages",header:e("div",{className:"flex min-w-0 items-center gap-2",children:[e(Yr,{size:15,className:"flex-shrink-0 text-ink/50"}),e("span",{className:"text-sm font-medium",children:"Wiki pages"})]}),children:e("div",{className:"flex h-[60vh] min-h-0 flex-col",children:e(B,{sections:t,selected:l,onSelect:(x)=>{r(x),f()}})})})}function re(c,t){if(!c.webUrl)return null;let r=(t.split("/").pop()??t).replace(/\.(md|markdown)$/i,"");return c.provider==="gitlab"?`${c.webUrl.replace(/\/home$/,"")}/${encodeURIComponent(t.replace(/\.(md|markdown)$/i,""))}`:`${c.webUrl}/${encodeURIComponent(r)}`}function G({repo:c,entries:t,path:l,page:r,isLoading:f,error:x,rootPath:k,repoScope:p,onNavigate:h,onBack:s}){let g=re(c,l),b=u(()=>({path:l,entries:t,root:k,repo:p}),[l,t,k,p]);return e("div",{className:"flex h-full min-h-0 w-full flex-col bg-paper",children:[e("div",{className:"flex flex-shrink-0 items-center gap-1.5 border-b border-ink/10 px-2.5 py-1.5",children:[s&&e("button",{type:"button",onClick:s,title:"Back to the page list","aria-label":"Back to the page list",className:"flex-shrink-0 rounded p-1 text-ink/60 hover:bg-ink/5 hover:text-ink @[520px]:hidden",children:e(an,{size:13})}),e("span",{className:"min-w-0 flex-1 truncate text-[11px] text-ink/50",title:l,children:l}),f&&e(m,{size:12,className:"flex-shrink-0 animate-spin text-ink/40"}),g&&e("a",{href:g,target:"_blank",rel:"noopener noreferrer",title:"Open this page on the wiki host","aria-label":"Open this page on the wiki host",className:"flex-shrink-0 rounded p-1 text-ink/60 hover:bg-ink/5 hover:text-ink",children:e(Be,{size:13})})]}),e("div",{className:"flex-1 min-h-0 overflow-y-auto scrollbar-overlay-container",children:x?e("div",{className:"flex flex-col items-center gap-2 px-6 py-8 text-center",children:[e(E,{size:16,className:"text-error"}),e("p",{className:"text-xs text-error",children:x})]}):!r?e("div",{className:"px-6 py-8 text-center text-xs text-ink/40",children:f?"Loading page…":"No page selected"}):e("article",{className:"mx-auto max-w-4xl px-5 py-4",children:[e(J,{content:r.content,className:"max-w-none",wikiScope:b,onWikiNavigate:h}),r.truncated&&e("p",{className:"mt-4 border-t border-ink/10 pt-2 text-[11px] text-ink/50",children:"This page is longer than the reader's budget and was cut off."})]})})]})}function O(c,t){return`${c??""}\x00${t}`}function H(c,t){let l=new URLSearchParams;if(c)l.set("root",c);if(t&&t!==".")l.set("repo",t);return l}function X(c){let{rootPath:t,repo:l,enabled:r,active:f,revisionKey:x=0}=c,k=O(t,l),[p,h]=n(null),s=i(k);s.current=k;let g=Ie(bA(k),{enabled:r&&f}),{refresh:b}=g;o(()=>{h(null)},[k]);let w=a((R)=>{if(!r)return;if(!R?.force){b();return}let W=s.current,L=H(t,l);L.set("refresh","1"),fetch(`/api/wiki?${L.toString()}`).then(async(N)=>{let y=await N.json();if(!N.ok)throw Error(y?.error||`Wiki request failed (${N.status})`)}).then(()=>{if(s.current!==W)return;h(null),b()}).catch((N)=>{if(s.current!==W)return;h(N instanceof Error?N.message:"Failed to load the wiki")})},[r,t,l,b]);return o(()=>{if(x>0)b()},[x]),{data:g.data,isLoading:g.isLoading,refreshing:g.refreshing,error:p,reload:w}}function Q(c){let{rootPath:t,repo:l,path:r,enabled:f,active:x,revisionKey:k=0}=c,p=`${O(t,l)}\x00${r??""}`,[h,s]=n({scope:p,data:null}),[g,b]=n(!1),[w,R]=n(null),W=i(0);return o(()=>{if(!f||!x||!r){s({scope:p,data:null}),R(null);return}let L=++W.current;b(!0);let N=H(t,l);N.set("path",r),fetch(`/api/wiki/page?${N.toString()}`).then(async(y)=>{let _=await y.json();if(!y.ok)throw Error(_?.error||`Page request failed (${y.status})`);return _}).then((y)=>{if(W.current!==L)return;s({scope:p,data:y}),R(null)}).catch((y)=>{if(W.current!==L)return;R(y instanceof Error?y.message:"Failed to load the page")}).finally(()=>{if(W.current===L)b(!1)})},[p,t,l,r,f,x,k]),{data:h.scope===p?h.data:null,isLoading:g,error:w}}function Y(c){let t=[];for(let l of c){if(!l.isMarkdown)continue;let r=t[t.length-1],f={label:l.title,target:l.path,path:l.path,url:null};if(r&&r.title===(l.folder||"Pages")){r.links.push(f);continue}t.push({title:l.folder||"Pages",links:[f],notes:[]})}return t}var oe={"no-remote":"This repository has no origin remote, so there is no wiki to find.","unsupported-remote":"The origin remote is not a URL a wiki can be derived from.","no-wiki":"This project has no wiki (or Kabmo cannot read it).",unreachable:"The wiki could not be reached."};function qe({className:c="",enabled:t=!0,active:l=!0,rootPath:r,refreshKey:f=0,layout:x="desktop"}){let k=x==="phone",{activeRepo:p,setActiveRepo:h}=gr(r),{repos:s,scanning:g,rescan:b}=Ar(r,t),w=O(r,p),[R,W]=S("wiki.selectedPage",null),[L,N]=n(!1),[y,_]=n(!1),[ee,te]=n(0),v=X({rootPath:r,repo:p,enabled:t,active:l,revisionKey:f}),M=v.data?.entries??[],z=u(()=>M.filter((C)=>C.isMarkdown),[M]),I=u(()=>v.data?.sidebar??Y(M),[v.data?.sidebar,M]),ie=u(()=>I.some((C)=>C.links.length>0),[I]),A=R&&R.scope===w?R.path:null,T=u(()=>{if(A&&z.some((F)=>F.path===A))return A;return(z.find((F)=>F.title.toLowerCase()==="home")??z[0])?.path??null},[A,z]),D=Q({rootPath:r,repo:p,path:T,enabled:t,active:l,revisionKey:ee});o(()=>{if(!T||T===A)return;W({scope:w,path:T})},[T,A,w,W]),o(()=>{N(!1),_(!1)},[w]);let q=(C)=>{if(W({scope:w,path:C}),!k)_(!0)},ne=()=>{v.reload({force:!0}),te((C)=>C+1)},P=v.data?.repo??null,K=v.data&&!P?v.data:null;if(!t)return e("div",{className:`flex h-full flex-col items-center justify-center bg-paper text-ink/40 ${c}`,children:e("span",{className:"text-xs font-mono text-muted",children:"No session selected"})});return e("div",{className:`@container flex h-full min-h-0 w-full flex-col bg-paper text-xs text-ink ${c}`,children:[e(bt,{left:e(d,{children:[e(kr,{rootPath:r,activeRepo:p,onSelectRepo:h,repos:s,scanning:g,onRefreshRepos:b}),P&&e("span",{className:"flex-shrink-0 rounded border border-ink/15 bg-ink/5 px-1.5 py-0.5 font-mono text-[10px] uppercase tracking-wider text-ink/60",title:`${P.host}/${P.slug} · ${P.revision.slice(0,8)}`,children:P.provider})]}),right:e(d,{children:[P?.webUrl&&e("a",{href:P.webUrl,target:"_blank",rel:"noopener noreferrer",title:"Open the wiki on its host","aria-label":"Open the wiki on its host",className:"rounded p-1 text-ink/60 hover:bg-ink/5 hover:text-ink",children:e(Be,{size:13})}),e(st,{label:"Re-fetch the wiki",onClick:ne,busy:v.isLoading||v.refreshing,disabled:v.isLoading})]})}),v.error&&!v.data?e("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[e(E,{size:16,className:"text-error"}),e("p",{className:"text-error",children:v.error}),e("button",{type:"button",onClick:()=>v.reload(),className:"text-[11px] font-semibold text-ink/70 underline underline-offset-2 hover:text-ink",children:"Try again"})]}):!v.data?e("div",{className:"flex flex-1 items-center justify-center gap-2 text-ink/40",children:[e(m,{size:14,className:"animate-spin"}),e("span",{children:"Reading the wiki…"})]}):K?e("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[e(on,{size:18,className:"text-ink/30"}),e("p",{className:"max-w-sm text-[11px] leading-relaxed text-ink/60",children:oe[K.reason??"no-wiki"]}),K.detail&&e("p",{className:"max-w-sm break-words font-mono text-[10px] text-ink/40",children:K.detail})]}):e("div",{className:"flex min-h-0 flex-1 flex-col @[520px]:flex-row-reverse",children:[e("div",{className:`${k?"hidden":y?"hidden @[520px]:flex":"flex"} min-h-0 w-full flex-col @[520px]:w-52 @[520px]:flex-shrink-0 @[520px]:border-l @[520px]:border-ink/10`,children:e(B,{sections:I,selected:T,onSelect:q})}),e("div",{className:`relative min-w-0 min-h-0 flex-1 ${k?"flex":y?"flex":"hidden @[520px]:flex"} flex-col`,children:[P&&T?e(G,{repo:P,entries:M,path:T,page:D.data,isLoading:D.isLoading,error:D.error,rootPath:r,repoScope:p,onNavigate:q,onBack:k?void 0:()=>_(!1)}):e("div",{className:"flex h-full items-center justify-center px-6 text-center text-[11px] text-ink/40",children:"This wiki has no markdown pages."}),k&&ie&&e(j,{open:L,onClick:()=>N(!0)}),e(V,{open:L,sections:I,selected:T,onSelect:q,onClose:()=>N(!1)})]})]})]})}export{qe as WikiPanel};