@jayjiang/open-cc 0.2.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 (459) hide show
  1. package/LICENSE +8 -0
  2. package/README.md +107 -0
  3. package/dist/chunk-00dxqxqj.js +227 -0
  4. package/dist/chunk-01p8hhsp.js +154 -0
  5. package/dist/chunk-02wy0m47.js +152 -0
  6. package/dist/chunk-0465tnzh.js +110 -0
  7. package/dist/chunk-054mjk62.js +678 -0
  8. package/dist/chunk-06saje2v.js +39 -0
  9. package/dist/chunk-0731m51q.js +8 -0
  10. package/dist/chunk-09y0jvtm.js +165 -0
  11. package/dist/chunk-0fkqze0v.js +113 -0
  12. package/dist/chunk-0hn525br.js +1920 -0
  13. package/dist/chunk-0hneh9ha.js +123 -0
  14. package/dist/chunk-0paqc2yw.js +15 -0
  15. package/dist/chunk-0rkbrabt.js +32 -0
  16. package/dist/chunk-0scs4rpx.js +96 -0
  17. package/dist/chunk-0vkfrmqm.js +690 -0
  18. package/dist/chunk-0w2byc95.js +38 -0
  19. package/dist/chunk-0xjaqda8.js +1124 -0
  20. package/dist/chunk-0y3vcsv4.js +92 -0
  21. package/dist/chunk-0yb4dz9c.js +26840 -0
  22. package/dist/chunk-10fdxge0.js +121 -0
  23. package/dist/chunk-1141xmr4.js +8 -0
  24. package/dist/chunk-14vffdmg.js +38 -0
  25. package/dist/chunk-178ykx7k.js +1493 -0
  26. package/dist/chunk-1bhva2z9.js +128 -0
  27. package/dist/chunk-1c8z1b5v.js +16 -0
  28. package/dist/chunk-1cbn5kxf.js +7 -0
  29. package/dist/chunk-1che51a5.js +1585 -0
  30. package/dist/chunk-1h2famwb.js +49 -0
  31. package/dist/chunk-1jrkpnbn.js +71 -0
  32. package/dist/chunk-1k4j1xcf.js +154 -0
  33. package/dist/chunk-1mm9d8p4.js +70 -0
  34. package/dist/chunk-1n3gnn2t.js +41 -0
  35. package/dist/chunk-1nqaq1rs.js +654 -0
  36. package/dist/chunk-1p2j9g3w.js +998 -0
  37. package/dist/chunk-1p7jfcee.js +533 -0
  38. package/dist/chunk-1pg8s12r.js +338 -0
  39. package/dist/chunk-1qjb22fx.js +109 -0
  40. package/dist/chunk-1yzc16qa.js +39 -0
  41. package/dist/chunk-20gm89wf.js +208 -0
  42. package/dist/chunk-238g70xa.js +36 -0
  43. package/dist/chunk-26k0324b.js +751 -0
  44. package/dist/chunk-27xc1csx.js +104 -0
  45. package/dist/chunk-2a42s11t.js +412 -0
  46. package/dist/chunk-2bhq4emw.js +10476 -0
  47. package/dist/chunk-2eykm0j0.js +20 -0
  48. package/dist/chunk-2gzv8nrw.js +205 -0
  49. package/dist/chunk-2k995y2x.js +880 -0
  50. package/dist/chunk-2kpzaa7w.js +401 -0
  51. package/dist/chunk-2nayx6q1.js +63 -0
  52. package/dist/chunk-2qhs9n36.js +151 -0
  53. package/dist/chunk-2s5f2nnw.js +603 -0
  54. package/dist/chunk-2y54j9ew.js +174394 -0
  55. package/dist/chunk-2zcaw1jd.js +2343 -0
  56. package/dist/chunk-30chpfyc.js +15275 -0
  57. package/dist/chunk-30k39xd2.js +28 -0
  58. package/dist/chunk-30rst83v.js +168 -0
  59. package/dist/chunk-36z5enc4.js +160 -0
  60. package/dist/chunk-3c25bcsw.js +17 -0
  61. package/dist/chunk-3c4qja3e.js +63 -0
  62. package/dist/chunk-3ccx8k84.js +102 -0
  63. package/dist/chunk-3envnthj.js +157 -0
  64. package/dist/chunk-3h8a89gy.js +46 -0
  65. package/dist/chunk-3kadbep2.js +6956 -0
  66. package/dist/chunk-3kd79cnk.js +15 -0
  67. package/dist/chunk-3m45xtza.js +1188 -0
  68. package/dist/chunk-3q50xe1j.js +17 -0
  69. package/dist/chunk-3w6s9m5w.js +16 -0
  70. package/dist/chunk-3x0408tc.js +42 -0
  71. package/dist/chunk-3z7ae04g.js +372 -0
  72. package/dist/chunk-40tedt0y.js +275 -0
  73. package/dist/chunk-44q8kegv.js +811 -0
  74. package/dist/chunk-47gy6qkp.js +328 -0
  75. package/dist/chunk-495d85x1.js +8066 -0
  76. package/dist/chunk-4axcksrv.js +129 -0
  77. package/dist/chunk-4e1271a8.js +106 -0
  78. package/dist/chunk-4g3v8y12.js +23 -0
  79. package/dist/chunk-4g5mrzm0.js +220 -0
  80. package/dist/chunk-4jm600zv.js +13 -0
  81. package/dist/chunk-4n989n6h.js +153 -0
  82. package/dist/chunk-4qedx22a.js +44 -0
  83. package/dist/chunk-4rze71rx.js +116 -0
  84. package/dist/chunk-4wbhvcag.js +91 -0
  85. package/dist/chunk-4zfkzkt6.js +37 -0
  86. package/dist/chunk-55wgxwa9.js +13877 -0
  87. package/dist/chunk-56ta4h0b.js +154 -0
  88. package/dist/chunk-58a0x39g.js +89 -0
  89. package/dist/chunk-5dbk24zg.js +890 -0
  90. package/dist/chunk-5gzg4q1k.js +99 -0
  91. package/dist/chunk-5k2gdxnr.js +336 -0
  92. package/dist/chunk-5kp252z6.js +202 -0
  93. package/dist/chunk-5p2ssw3d.js +825 -0
  94. package/dist/chunk-5w33j8gy.js +1580 -0
  95. package/dist/chunk-5ywjzvm8.js +61 -0
  96. package/dist/chunk-5ztxx8gd.js +80 -0
  97. package/dist/chunk-62vwr0y5.js +117 -0
  98. package/dist/chunk-6b8ksqmf.js +1153 -0
  99. package/dist/chunk-6bd8brc4.js +48 -0
  100. package/dist/chunk-6cpqmd4r.js +132 -0
  101. package/dist/chunk-6dj5t602.js +341 -0
  102. package/dist/chunk-6g62sjpf.js +328 -0
  103. package/dist/chunk-6gr3c3w9.js +378 -0
  104. package/dist/chunk-6h9n8qbr.js +1170 -0
  105. package/dist/chunk-6kpbgc5w.js +23 -0
  106. package/dist/chunk-6n2qgm9v.js +8 -0
  107. package/dist/chunk-6n6jfmce.js +2833 -0
  108. package/dist/chunk-6q2x8zeg.js +802 -0
  109. package/dist/chunk-6tnekwtp.js +849 -0
  110. package/dist/chunk-6tq2v3rk.js +186 -0
  111. package/dist/chunk-6vphqqd1.js +27 -0
  112. package/dist/chunk-6wkdqk81.js +444 -0
  113. package/dist/chunk-7226mgjt.js +195 -0
  114. package/dist/chunk-72fey14y.js +565 -0
  115. package/dist/chunk-73fgm72g.js +698 -0
  116. package/dist/chunk-73fhat5j.js +212 -0
  117. package/dist/chunk-73rpbt04.js +1947 -0
  118. package/dist/chunk-743znc5c.js +56 -0
  119. package/dist/chunk-760252na.js +101 -0
  120. package/dist/chunk-76t2h5v2.js +495 -0
  121. package/dist/chunk-7739pg2c.js +4261 -0
  122. package/dist/chunk-789khc7a.js +96 -0
  123. package/dist/chunk-78mma1s7.js +88 -0
  124. package/dist/chunk-7aw745vx.js +40175 -0
  125. package/dist/chunk-7azp8c8y.js +584 -0
  126. package/dist/chunk-7m2nd8da.js +110 -0
  127. package/dist/chunk-7pemewz2.js +726 -0
  128. package/dist/chunk-7rjyn5d3.js +125 -0
  129. package/dist/chunk-7v0wq9nk.js +93 -0
  130. package/dist/chunk-7wm5s02e.js +216 -0
  131. package/dist/chunk-83hfzbx3.js +10 -0
  132. package/dist/chunk-84k64e4a.js +1646 -0
  133. package/dist/chunk-87jfpcm7.js +438 -0
  134. package/dist/chunk-8btm871b.js +42 -0
  135. package/dist/chunk-8hbbzet5.js +34 -0
  136. package/dist/chunk-8hq5kk3y.js +44 -0
  137. package/dist/chunk-8j6vs75t.js +256 -0
  138. package/dist/chunk-8ngxagxq.js +18 -0
  139. package/dist/chunk-8nsem424.js +110 -0
  140. package/dist/chunk-8pf73pc8.js +169 -0
  141. package/dist/chunk-8tnsngw2.js +31 -0
  142. package/dist/chunk-8y12jxg8.js +10 -0
  143. package/dist/chunk-8ymf4e6z.js +48 -0
  144. package/dist/chunk-90wp6wez.js +10510 -0
  145. package/dist/chunk-95dt8mpg.js +603 -0
  146. package/dist/chunk-95rj8m4e.js +130 -0
  147. package/dist/chunk-9ebygqen.js +89 -0
  148. package/dist/chunk-9gbamk79.js +93 -0
  149. package/dist/chunk-9tkq3g56.js +642 -0
  150. package/dist/chunk-a05hje2h.js +105 -0
  151. package/dist/chunk-a2krhf3c.js +90 -0
  152. package/dist/chunk-a6q9rehn.js +182 -0
  153. package/dist/chunk-a78b3pvt.js +71 -0
  154. package/dist/chunk-a8ejc632.js +3094 -0
  155. package/dist/chunk-a9vdeb6y.js +258 -0
  156. package/dist/chunk-a9zh40sj.js +48 -0
  157. package/dist/chunk-ab59azrr.js +480 -0
  158. package/dist/chunk-accxhkm6.js +88 -0
  159. package/dist/chunk-adzd8pzb.js +1095 -0
  160. package/dist/chunk-ae76ded0.js +30 -0
  161. package/dist/chunk-aftppv3p.js +691 -0
  162. package/dist/chunk-agmw1vmf.js +725 -0
  163. package/dist/chunk-an5cb1vx.js +16 -0
  164. package/dist/chunk-b1s11z4y.js +63 -0
  165. package/dist/chunk-b2rkh01x.js +443 -0
  166. package/dist/chunk-b4w4argn.js +1551 -0
  167. package/dist/chunk-b4wg70y1.js +54 -0
  168. package/dist/chunk-b5b7h81y.js +7189 -0
  169. package/dist/chunk-b9k5cs09.js +50 -0
  170. package/dist/chunk-bapy5rc8.js +40 -0
  171. package/dist/chunk-bda3gxxz.js +246 -0
  172. package/dist/chunk-bhdt6k7w.js +15 -0
  173. package/dist/chunk-bm1qb16p.js +17 -0
  174. package/dist/chunk-bp0dnrwg.js +281 -0
  175. package/dist/chunk-bqfnp99q.js +477 -0
  176. package/dist/chunk-bs6keys0.js +158 -0
  177. package/dist/chunk-bsbmmfyt.js +17 -0
  178. package/dist/chunk-btkettbr.js +166 -0
  179. package/dist/chunk-bwgde7nf.js +37 -0
  180. package/dist/chunk-c1zc58pw.js +280 -0
  181. package/dist/chunk-c2g96ga2.js +184 -0
  182. package/dist/chunk-c3z7ptb2.js +21933 -0
  183. package/dist/chunk-c8vn3ynx.js +349 -0
  184. package/dist/chunk-cdm0k2n0.js +115 -0
  185. package/dist/chunk-cdz5yb0r.js +57 -0
  186. package/dist/chunk-cfv996bs.js +22 -0
  187. package/dist/chunk-cg788ab0.js +100 -0
  188. package/dist/chunk-cgfdkzhb.js +12 -0
  189. package/dist/chunk-cp76dsdp.js +386 -0
  190. package/dist/chunk-cr6t6rth.js +306 -0
  191. package/dist/chunk-cvp5vayb.js +31 -0
  192. package/dist/chunk-cwehsmj5.js +114 -0
  193. package/dist/chunk-cy2hswr1.js +15 -0
  194. package/dist/chunk-d2rzy2p0.js +42 -0
  195. package/dist/chunk-d3v2fbay.js +106 -0
  196. package/dist/chunk-dc4eha8a.js +243 -0
  197. package/dist/chunk-dcz167d6.js +73 -0
  198. package/dist/chunk-de55jjre.js +106 -0
  199. package/dist/chunk-dfx733j3.js +650 -0
  200. package/dist/chunk-dgqrcy74.js +48 -0
  201. package/dist/chunk-dj6dk19k.js +55 -0
  202. package/dist/chunk-dn2xcmc4.js +173 -0
  203. package/dist/chunk-dndehvfr.js +57 -0
  204. package/dist/chunk-dnh7jtpb.js +37 -0
  205. package/dist/chunk-dnwzz9f7.js +88 -0
  206. package/dist/chunk-dv1wfr85.js +6373 -0
  207. package/dist/chunk-dwq5rs3q.js +62 -0
  208. package/dist/chunk-dz8exe78.js +91 -0
  209. package/dist/chunk-e4rzw1sd.js +606 -0
  210. package/dist/chunk-e6rrwzv0.js +463 -0
  211. package/dist/chunk-e6t9kpzq.js +145 -0
  212. package/dist/chunk-e7c8ypwc.js +287 -0
  213. package/dist/chunk-e9nkfs4e.js +738 -0
  214. package/dist/chunk-eaf7c8ck.js +537 -0
  215. package/dist/chunk-ebyr6p77.js +115 -0
  216. package/dist/chunk-edfv7pme.js +104 -0
  217. package/dist/chunk-eh474zhj.js +59 -0
  218. package/dist/chunk-er8ckwzt.js +140 -0
  219. package/dist/chunk-ev5p07yh.js +144 -0
  220. package/dist/chunk-ewadzrm8.js +103 -0
  221. package/dist/chunk-f2mhrmww.js +62 -0
  222. package/dist/chunk-f2zhqnb6.js +69 -0
  223. package/dist/chunk-f5ma3nh5.js +3436 -0
  224. package/dist/chunk-f63q7vx7.js +756 -0
  225. package/dist/chunk-fbv4apne.js +51 -0
  226. package/dist/chunk-fcna95wg.js +113 -0
  227. package/dist/chunk-fdvcpaz3.js +163 -0
  228. package/dist/chunk-fgc0q2b2.js +3354 -0
  229. package/dist/chunk-fm2jvsk7.js +87 -0
  230. package/dist/chunk-ft7fs35e.js +282 -0
  231. package/dist/chunk-fyc5fepv.js +10 -0
  232. package/dist/chunk-g0j0t6qk.js +26 -0
  233. package/dist/chunk-g0nbec9m.js +32 -0
  234. package/dist/chunk-g1fdv1kb.js +86 -0
  235. package/dist/chunk-g338npwr.js +1061 -0
  236. package/dist/chunk-g3t0act8.js +8 -0
  237. package/dist/chunk-g6qddbvf.js +1391 -0
  238. package/dist/chunk-ga5faygf.js +61 -0
  239. package/dist/chunk-gac6nzhc.js +90 -0
  240. package/dist/chunk-gck2cswd.js +862 -0
  241. package/dist/chunk-gntr3b25.js +40683 -0
  242. package/dist/chunk-gq5bbtme.js +456 -0
  243. package/dist/chunk-gyj242zr.js +20 -0
  244. package/dist/chunk-h0qngp9w.js +157 -0
  245. package/dist/chunk-h1xnvnye.js +524 -0
  246. package/dist/chunk-h3mhfamg.js +60 -0
  247. package/dist/chunk-h6s1tx0e.js +250 -0
  248. package/dist/chunk-h7qb4hyj.js +70 -0
  249. package/dist/chunk-h8qd1gw2.js +106 -0
  250. package/dist/chunk-hakdhagh.js +16606 -0
  251. package/dist/chunk-hcdt34n4.js +143 -0
  252. package/dist/chunk-hh7cmy4k.js +20 -0
  253. package/dist/chunk-hk9xz7gk.js +118 -0
  254. package/dist/chunk-hqmz36b3.js +552 -0
  255. package/dist/chunk-hs8ph4p8.js +8 -0
  256. package/dist/chunk-hsq4vtjy.js +92 -0
  257. package/dist/chunk-hzhd0p1y.js +104 -0
  258. package/dist/chunk-hzhe8ygc.js +547 -0
  259. package/dist/chunk-j0tqbsh7.js +176 -0
  260. package/dist/chunk-j1s1jvad.js +346 -0
  261. package/dist/chunk-j2k4p94p.js +55 -0
  262. package/dist/chunk-j3a4p81y.js +184 -0
  263. package/dist/chunk-j595yd4h.js +439 -0
  264. package/dist/chunk-j64ga6ta.js +8035 -0
  265. package/dist/chunk-j7qwxra8.js +2335 -0
  266. package/dist/chunk-j98f65zv.js +789 -0
  267. package/dist/chunk-jd32zbps.js +15 -0
  268. package/dist/chunk-jdgeec04.js +4249 -0
  269. package/dist/chunk-jdt5s5k7.js +62 -0
  270. package/dist/chunk-jeaek018.js +97 -0
  271. package/dist/chunk-jkhvm8yk.js +104 -0
  272. package/dist/chunk-jmxaze30.js +780 -0
  273. package/dist/chunk-jne71s1f.js +104 -0
  274. package/dist/chunk-jnhkref0.js +30 -0
  275. package/dist/chunk-jpgr7zfs.js +95 -0
  276. package/dist/chunk-jqp0q5nk.js +339 -0
  277. package/dist/chunk-jtqgnyaq.js +1317 -0
  278. package/dist/chunk-jx817w05.js +11 -0
  279. package/dist/chunk-jynzr5w9.js +71 -0
  280. package/dist/chunk-jzmz18nn.js +65 -0
  281. package/dist/chunk-k0p9w03v.js +4957 -0
  282. package/dist/chunk-k1jnpyj9.js +155 -0
  283. package/dist/chunk-k445en8h.js +102 -0
  284. package/dist/chunk-k62k13ya.js +81 -0
  285. package/dist/chunk-kf8kjmfv.js +821 -0
  286. package/dist/chunk-kgn1nfg9.js +468 -0
  287. package/dist/chunk-khmz14d4.js +38 -0
  288. package/dist/chunk-kjhmt6ba.js +100 -0
  289. package/dist/chunk-kkrz2zw2.js +122 -0
  290. package/dist/chunk-kv1ryvtm.js +176 -0
  291. package/dist/chunk-kwekc97v.js +18 -0
  292. package/dist/chunk-kyvwf342.js +65 -0
  293. package/dist/chunk-m0g3xv72.js +266 -0
  294. package/dist/chunk-m26twd8m.js +277 -0
  295. package/dist/chunk-m4bc15mz.js +229 -0
  296. package/dist/chunk-m9t8j37k.js +253 -0
  297. package/dist/chunk-mb2gpwwf.js +432 -0
  298. package/dist/chunk-mezwt1bt.js +306 -0
  299. package/dist/chunk-mfm83xn5.js +84 -0
  300. package/dist/chunk-mn7870fh.js +4389 -0
  301. package/dist/chunk-mr9df5v8.js +722 -0
  302. package/dist/chunk-mt25echc.js +6157 -0
  303. package/dist/chunk-mwrr6zbb.js +55 -0
  304. package/dist/chunk-mywpbwad.js +198 -0
  305. package/dist/chunk-mzdtkccs.js +125 -0
  306. package/dist/chunk-mzn0z9d3.js +691 -0
  307. package/dist/chunk-n0qaeaa5.js +256 -0
  308. package/dist/chunk-n128bzxs.js +2739 -0
  309. package/dist/chunk-n1erf6kh.js +22820 -0
  310. package/dist/chunk-n4nbgkvd.js +520 -0
  311. package/dist/chunk-n5gkdn9v.js +120 -0
  312. package/dist/chunk-n7ttdtk0.js +641 -0
  313. package/dist/chunk-n8b1njwb.js +208 -0
  314. package/dist/chunk-nek12gtk.js +94 -0
  315. package/dist/chunk-nerv0jvx.js +74 -0
  316. package/dist/chunk-nka1g8f4.js +773 -0
  317. package/dist/chunk-nm2cncrq.js +336 -0
  318. package/dist/chunk-nq0fxyxh.js +752 -0
  319. package/dist/chunk-nrnkshv2.js +192 -0
  320. package/dist/chunk-nsqma629.js +128 -0
  321. package/dist/chunk-nt837qt9.js +21 -0
  322. package/dist/chunk-nttf3k0r.js +2643 -0
  323. package/dist/chunk-nx638j6h.js +268 -0
  324. package/dist/chunk-nx7s0zn5.js +375 -0
  325. package/dist/chunk-p0hff8zy.js +8871 -0
  326. package/dist/chunk-p2816w9z.js +1486 -0
  327. package/dist/chunk-p2d5nh3g.js +342 -0
  328. package/dist/chunk-p57bz7nv.js +55 -0
  329. package/dist/chunk-p5z8t6r3.js +130 -0
  330. package/dist/chunk-pd6653na.js +5394 -0
  331. package/dist/chunk-pjnzf3cg.js +61 -0
  332. package/dist/chunk-ps49ymvj.js +43 -0
  333. package/dist/chunk-pthzapbx.js +348 -0
  334. package/dist/chunk-pwwa7s62.js +11 -0
  335. package/dist/chunk-pyx135a5.js +20 -0
  336. package/dist/chunk-q132dkwr.js +195 -0
  337. package/dist/chunk-q16y18s1.js +120 -0
  338. package/dist/chunk-q25bjaev.js +15 -0
  339. package/dist/chunk-q3jxs36m.js +716 -0
  340. package/dist/chunk-q5by3da6.js +8 -0
  341. package/dist/chunk-q663msp4.js +908 -0
  342. package/dist/chunk-qezgfppb.js +4521 -0
  343. package/dist/chunk-qgjgqmy5.js +5796 -0
  344. package/dist/chunk-qj7h3xc3.js +40 -0
  345. package/dist/chunk-qjcxkbv6.js +644 -0
  346. package/dist/chunk-qnfx3qtx.js +617 -0
  347. package/dist/chunk-qnmyzsam.js +84 -0
  348. package/dist/chunk-qp2qdcda.js +100 -0
  349. package/dist/chunk-qvrq1sby.js +6107 -0
  350. package/dist/chunk-qz2x630m.js +49145 -0
  351. package/dist/chunk-qz3fe4fj.js +469 -0
  352. package/dist/chunk-r0af6bw0.js +173 -0
  353. package/dist/chunk-r1v8d6da.js +1299 -0
  354. package/dist/chunk-r6b58y3x.js +17 -0
  355. package/dist/chunk-r6e45bzh.js +118 -0
  356. package/dist/chunk-r843jezp.js +28 -0
  357. package/dist/chunk-rbgjkg3v.js +90 -0
  358. package/dist/chunk-rc5bbzx4.js +655 -0
  359. package/dist/chunk-rca5xtnd.js +267 -0
  360. package/dist/chunk-rfdbzyjh.js +1865 -0
  361. package/dist/chunk-rh7q28df.js +93 -0
  362. package/dist/chunk-rn0v1hk8.js +34 -0
  363. package/dist/chunk-rvxs7x7j.js +542 -0
  364. package/dist/chunk-rw6fwk2s.js +98 -0
  365. package/dist/chunk-rwagvxh5.js +1711 -0
  366. package/dist/chunk-s10vyjz4.js +224 -0
  367. package/dist/chunk-s274nv8k.js +8 -0
  368. package/dist/chunk-s3pzvdss.js +50 -0
  369. package/dist/chunk-s4w01jsb.js +969 -0
  370. package/dist/chunk-s56j2d6g.js +500 -0
  371. package/dist/chunk-sbs1r0h4.js +317 -0
  372. package/dist/chunk-sd36yzx8.js +954 -0
  373. package/dist/chunk-sd6env07.js +19 -0
  374. package/dist/chunk-sdj9b9wh.js +782 -0
  375. package/dist/chunk-sfht9xvd.js +24 -0
  376. package/dist/chunk-sk3gpkdt.js +89 -0
  377. package/dist/chunk-sp5cjcjh.js +526 -0
  378. package/dist/chunk-sq847dr5.js +1528 -0
  379. package/dist/chunk-sskngwam.js +89 -0
  380. package/dist/chunk-svar8pp2.js +276 -0
  381. package/dist/chunk-szj5wvdy.js +28 -0
  382. package/dist/chunk-t175chdd.js +714 -0
  383. package/dist/chunk-t4k75hqs.js +4987 -0
  384. package/dist/chunk-t7z7vg91.js +225 -0
  385. package/dist/chunk-tanfpxm1.js +419 -0
  386. package/dist/chunk-tf9h0cyj.js +3037 -0
  387. package/dist/chunk-tm1wwvm1.js +99 -0
  388. package/dist/chunk-trtgjd28.js +9300 -0
  389. package/dist/chunk-ts2p6bv1.js +224 -0
  390. package/dist/chunk-ttk5dzz8.js +25 -0
  391. package/dist/chunk-tvg352rv.js +391 -0
  392. package/dist/chunk-tww14j0s.js +86 -0
  393. package/dist/chunk-tz03j2da.js +66 -0
  394. package/dist/chunk-v1kzp02e.js +785 -0
  395. package/dist/chunk-v2sm9w6h.js +220 -0
  396. package/dist/chunk-v3gm2day.js +8 -0
  397. package/dist/chunk-v4qn3g0d.js +286 -0
  398. package/dist/chunk-v66tbnn6.js +476 -0
  399. package/dist/chunk-v78fj8by.js +145 -0
  400. package/dist/chunk-v9smspw2.js +4301 -0
  401. package/dist/chunk-v9ybze94.js +713 -0
  402. package/dist/chunk-vest0y6x.js +3830 -0
  403. package/dist/chunk-vf5sd1nq.js +12 -0
  404. package/dist/chunk-vht4mzgb.js +298 -0
  405. package/dist/chunk-vjwgf4qh.js +41 -0
  406. package/dist/chunk-vkrhafhf.js +248 -0
  407. package/dist/chunk-vn56q87z.js +2058 -0
  408. package/dist/chunk-vscz82fv.js +27 -0
  409. package/dist/chunk-vvn4gkak.js +642 -0
  410. package/dist/chunk-vxj5rbg5.js +84 -0
  411. package/dist/chunk-vyjeh50y.js +2149 -0
  412. package/dist/chunk-w44nvpvt.js +22 -0
  413. package/dist/chunk-waambva2.js +2430 -0
  414. package/dist/chunk-wbhsqc2a.js +275 -0
  415. package/dist/chunk-wbsnpxzh.js +471 -0
  416. package/dist/chunk-wfz0qffj.js +3939 -0
  417. package/dist/chunk-wpqbrv0f.js +83 -0
  418. package/dist/chunk-wzpdet3m.js +843 -0
  419. package/dist/chunk-x6tb96y2.js +264 -0
  420. package/dist/chunk-x8b7vft8.js +132 -0
  421. package/dist/chunk-x8eg216f.js +99 -0
  422. package/dist/chunk-xc9khn0r.js +490 -0
  423. package/dist/chunk-xch406a3.js +673 -0
  424. package/dist/chunk-xdw5dv00.js +8 -0
  425. package/dist/chunk-xe0bpcbr.js +3444 -0
  426. package/dist/chunk-xm3ed3zn.js +300 -0
  427. package/dist/chunk-xpm4ebhz.js +87 -0
  428. package/dist/chunk-xr6yfttj.js +43 -0
  429. package/dist/chunk-xsq9ae7x.js +90 -0
  430. package/dist/chunk-xszk7n10.js +14358 -0
  431. package/dist/chunk-xzmkekfb.js +259 -0
  432. package/dist/chunk-y1784krc.js +19 -0
  433. package/dist/chunk-y3py9g5d.js +213 -0
  434. package/dist/chunk-y9nnmev5.js +687 -0
  435. package/dist/chunk-ya6jq0hf.js +29 -0
  436. package/dist/chunk-ycc3xnx0.js +374 -0
  437. package/dist/chunk-yfa54ssn.js +87 -0
  438. package/dist/chunk-ymy4xrr8.js +101 -0
  439. package/dist/chunk-yqfz2k9z.js +48 -0
  440. package/dist/chunk-ywxd4qw4.js +22 -0
  441. package/dist/chunk-yxmz5k16.js +122 -0
  442. package/dist/chunk-yxvy4jt4.js +1014 -0
  443. package/dist/chunk-z2dp53wn.js +17 -0
  444. package/dist/chunk-z2xxx2sz.js +294 -0
  445. package/dist/chunk-z31an09g.js +67 -0
  446. package/dist/chunk-z95xqvr0.js +75 -0
  447. package/dist/chunk-zbmxxxz8.js +161 -0
  448. package/dist/chunk-zk2wsm7d.js +15 -0
  449. package/dist/chunk-zmg1pcp3.js +71 -0
  450. package/dist/chunk-znrwmznk.js +272 -0
  451. package/dist/chunk-zq9r43cb.js +26 -0
  452. package/dist/chunk-zsfxha74.js +17655 -0
  453. package/dist/chunk-ztpr96av.js +229 -0
  454. package/dist/chunk-zv7qrz04.js +58 -0
  455. package/dist/chunk-zxa7st21.js +32 -0
  456. package/dist/chunk-zxhezavg.js +216 -0
  457. package/dist/chunk-zz0qcq2n.js +434 -0
  458. package/dist/cli.js +194 -0
  459. package/package.json +164 -0
@@ -0,0 +1,2643 @@
1
+ // @bun
2
+ import {
3
+ getAutoModeDenials,
4
+ init_autoModeDenials
5
+ } from "./chunk-0paqc2yw.js";
6
+ import {
7
+ detectUnreachableRules,
8
+ init_shadowedRuleDetection
9
+ } from "./chunk-jpgr7zfs.js";
10
+ import {
11
+ SearchBox,
12
+ init_SearchBox,
13
+ init_useSearchInput,
14
+ useSearchInput
15
+ } from "./chunk-mb2gpwwf.js";
16
+ import {
17
+ Tab,
18
+ Tabs,
19
+ init_Tabs,
20
+ useTabHeaderFocus,
21
+ useTabsWidth
22
+ } from "./chunk-3z7ae04g.js";
23
+ import {
24
+ StatusIcon,
25
+ init_StatusIcon
26
+ } from "./chunk-mfm83xn5.js";
27
+ import {
28
+ AddWorkspaceDirectory,
29
+ init_AddWorkspaceDirectory
30
+ } from "./chunk-76t2h5v2.js";
31
+ import"./chunk-3envnthj.js";
32
+ import"./chunk-47gy6qkp.js";
33
+ import"./chunk-8pf73pc8.js";
34
+ import {
35
+ BashTool,
36
+ SandboxManager,
37
+ Select,
38
+ TextInput,
39
+ WebFetchTool,
40
+ applyPermissionUpdate,
41
+ createPermissionRetryMessage,
42
+ deletePermissionRule,
43
+ getAllowRules,
44
+ getAskRules,
45
+ getDenyRules,
46
+ init_AppState,
47
+ init_BashTool,
48
+ init_PermissionUpdate,
49
+ init_TextInput,
50
+ init_WebFetchTool,
51
+ init_messages1 as init_messages,
52
+ init_permissions,
53
+ init_sandbox_adapter,
54
+ init_select,
55
+ permissionRuleSourceDisplayString,
56
+ persistPermissionUpdate,
57
+ useAppState,
58
+ useSetAppState
59
+ } from "./chunk-2y54j9ew.js";
60
+ import"./chunk-1yzc16qa.js";
61
+ import"./chunk-s10vyjz4.js";
62
+ import"./chunk-1k4j1xcf.js";
63
+ import"./chunk-3c4qja3e.js";
64
+ import"./chunk-rc5bbzx4.js";
65
+ import {
66
+ Dialog,
67
+ init_Dialog
68
+ } from "./chunk-e6rrwzv0.js";
69
+ import"./chunk-2gzv8nrw.js";
70
+ import"./chunk-743znc5c.js";
71
+ import"./chunk-5p2ssw3d.js";
72
+ import"./chunk-cgfdkzhb.js";
73
+ import"./chunk-bhdt6k7w.js";
74
+ import"./chunk-6wkdqk81.js";
75
+ import"./chunk-5dbk24zg.js";
76
+ import"./chunk-bda3gxxz.js";
77
+ import"./chunk-zxhezavg.js";
78
+ import {
79
+ init_useExitOnCtrlCDWithKeybindings,
80
+ useExitOnCtrlCDWithKeybindings
81
+ } from "./chunk-x8eg216f.js";
82
+ import"./chunk-9gbamk79.js";
83
+ import"./chunk-t175chdd.js";
84
+ import"./chunk-7rjyn5d3.js";
85
+ import {
86
+ Pane,
87
+ init_Pane,
88
+ init_useKeybinding,
89
+ init_useTerminalSize,
90
+ useKeybinding,
91
+ useTerminalSize
92
+ } from "./chunk-6q2x8zeg.js";
93
+ import {
94
+ Newline,
95
+ ThemedBox_default,
96
+ ThemedText,
97
+ init_ink,
98
+ require_compiler_runtime,
99
+ useTerminalFocus,
100
+ use_input_default
101
+ } from "./chunk-0yb4dz9c.js";
102
+ import"./chunk-7m2nd8da.js";
103
+ import"./chunk-ps49ymvj.js";
104
+ import {
105
+ require_jsx_dev_runtime,
106
+ require_react
107
+ } from "./chunk-g338npwr.js";
108
+ import"./chunk-zk2wsm7d.js";
109
+ import"./chunk-eh474zhj.js";
110
+ import"./chunk-ga5faygf.js";
111
+ import"./chunk-e7c8ypwc.js";
112
+ import"./chunk-g6qddbvf.js";
113
+ import"./chunk-b1s11z4y.js";
114
+ import"./chunk-4jm600zv.js";
115
+ import"./chunk-yxmz5k16.js";
116
+ import"./chunk-v9smspw2.js";
117
+ import"./chunk-qz2x630m.js";
118
+ import {
119
+ SOURCES,
120
+ getRelativeSettingsFilePathForSource,
121
+ init_constants,
122
+ init_permissionRuleParser,
123
+ init_settings1 as init_settings,
124
+ init_source,
125
+ init_stringUtils,
126
+ permissionRuleValueFromString,
127
+ permissionRuleValueToString,
128
+ plural,
129
+ source_default
130
+ } from "./chunk-30chpfyc.js";
131
+ import"./chunk-84k64e4a.js";
132
+ import"./chunk-y3py9g5d.js";
133
+ import"./chunk-7pemewz2.js";
134
+ import"./chunk-s4w01jsb.js";
135
+ import"./chunk-c8vn3ynx.js";
136
+ import"./chunk-g0j0t6qk.js";
137
+ import"./chunk-6kpbgc5w.js";
138
+ import"./chunk-3c25bcsw.js";
139
+ import"./chunk-mzdtkccs.js";
140
+ import"./chunk-55wgxwa9.js";
141
+ import"./chunk-5k2gdxnr.js";
142
+ import"./chunk-2qhs9n36.js";
143
+ import"./chunk-f5ma3nh5.js";
144
+ import"./chunk-v1kzp02e.js";
145
+ import"./chunk-p2816w9z.js";
146
+ import"./chunk-0vkfrmqm.js";
147
+ import"./chunk-0xjaqda8.js";
148
+ import"./chunk-mr9df5v8.js";
149
+ import"./chunk-cdz5yb0r.js";
150
+ import"./chunk-f2mhrmww.js";
151
+ import"./chunk-10fdxge0.js";
152
+ import"./chunk-r1v8d6da.js";
153
+ import"./chunk-d3v2fbay.js";
154
+ import"./chunk-qnfx3qtx.js";
155
+ import"./chunk-f2zhqnb6.js";
156
+ import"./chunk-cvp5vayb.js";
157
+ import {
158
+ figures_default,
159
+ init_figures
160
+ } from "./chunk-b5b7h81y.js";
161
+ import"./chunk-nm2cncrq.js";
162
+ import"./chunk-8tnsngw2.js";
163
+ import"./chunk-0rkbrabt.js";
164
+ import"./chunk-7wm5s02e.js";
165
+ import {
166
+ init_slowOperations,
167
+ jsonStringify
168
+ } from "./chunk-rwagvxh5.js";
169
+ import"./chunk-fbv4apne.js";
170
+ import"./chunk-0fkqze0v.js";
171
+ import {
172
+ getOriginalCwd,
173
+ init_state
174
+ } from "./chunk-2zcaw1jd.js";
175
+ import"./chunk-hqmz36b3.js";
176
+ import"./chunk-4g3v8y12.js";
177
+ import"./chunk-7739pg2c.js";
178
+ import"./chunk-xszk7n10.js";
179
+ import"./chunk-sdj9b9wh.js";
180
+ import {
181
+ __esm,
182
+ __toESM
183
+ } from "./chunk-qp2qdcda.js";
184
+
185
+ // src/components/permissions/rules/PermissionRuleDescription.tsx
186
+ function PermissionRuleDescription(t0) {
187
+ const $ = import_compiler_runtime.c(9);
188
+ const {
189
+ ruleValue
190
+ } = t0;
191
+ switch (ruleValue.toolName) {
192
+ case BashTool.name: {
193
+ if (ruleValue.ruleContent) {
194
+ if (ruleValue.ruleContent.endsWith(":*")) {
195
+ let t1;
196
+ if ($[0] !== ruleValue.ruleContent) {
197
+ t1 = ruleValue.ruleContent.slice(0, -2);
198
+ $[0] = ruleValue.ruleContent;
199
+ $[1] = t1;
200
+ } else {
201
+ t1 = $[1];
202
+ }
203
+ let t2;
204
+ if ($[2] !== t1) {
205
+ t2 = /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
206
+ dimColor: true,
207
+ children: [
208
+ "Any Bash command starting with",
209
+ " ",
210
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
211
+ bold: true,
212
+ children: t1
213
+ }, undefined, false, undefined, this)
214
+ ]
215
+ }, undefined, true, undefined, this);
216
+ $[2] = t1;
217
+ $[3] = t2;
218
+ } else {
219
+ t2 = $[3];
220
+ }
221
+ return t2;
222
+ } else {
223
+ let t1;
224
+ if ($[4] !== ruleValue.ruleContent) {
225
+ t1 = /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
226
+ dimColor: true,
227
+ children: [
228
+ "The Bash command ",
229
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
230
+ bold: true,
231
+ children: ruleValue.ruleContent
232
+ }, undefined, false, undefined, this)
233
+ ]
234
+ }, undefined, true, undefined, this);
235
+ $[4] = ruleValue.ruleContent;
236
+ $[5] = t1;
237
+ } else {
238
+ t1 = $[5];
239
+ }
240
+ return t1;
241
+ }
242
+ } else {
243
+ let t1;
244
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
245
+ t1 = /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
246
+ dimColor: true,
247
+ children: "Any Bash command"
248
+ }, undefined, false, undefined, this);
249
+ $[6] = t1;
250
+ } else {
251
+ t1 = $[6];
252
+ }
253
+ return t1;
254
+ }
255
+ }
256
+ default: {
257
+ if (!ruleValue.ruleContent) {
258
+ let t1;
259
+ if ($[7] !== ruleValue.toolName) {
260
+ t1 = /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
261
+ dimColor: true,
262
+ children: [
263
+ "Any use of the ",
264
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
265
+ bold: true,
266
+ children: ruleValue.toolName
267
+ }, undefined, false, undefined, this),
268
+ " tool"
269
+ ]
270
+ }, undefined, true, undefined, this);
271
+ $[7] = ruleValue.toolName;
272
+ $[8] = t1;
273
+ } else {
274
+ t1 = $[8];
275
+ }
276
+ return t1;
277
+ } else {
278
+ return null;
279
+ }
280
+ }
281
+ }
282
+ }
283
+ var import_compiler_runtime, jsx_dev_runtime;
284
+ var init_PermissionRuleDescription = __esm(() => {
285
+ init_ink();
286
+ init_BashTool();
287
+ import_compiler_runtime = __toESM(require_compiler_runtime(), 1);
288
+ jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
289
+ });
290
+
291
+ // src/components/permissions/rules/AddPermissionRules.tsx
292
+ function optionForPermissionSaveDestination(saveDestination) {
293
+ switch (saveDestination) {
294
+ case "localSettings":
295
+ return {
296
+ label: "Project settings (local)",
297
+ description: `Saved in ${getRelativeSettingsFilePathForSource("localSettings")}`,
298
+ value: saveDestination
299
+ };
300
+ case "projectSettings":
301
+ return {
302
+ label: "Project settings",
303
+ description: `Checked in at ${getRelativeSettingsFilePathForSource("projectSettings")}`,
304
+ value: saveDestination
305
+ };
306
+ case "userSettings":
307
+ return {
308
+ label: "User settings",
309
+ description: `Saved in at ~/.claude/settings.json`,
310
+ value: saveDestination
311
+ };
312
+ }
313
+ }
314
+ function AddPermissionRules(t0) {
315
+ const $ = import_compiler_runtime2.c(26);
316
+ const {
317
+ onAddRules,
318
+ onCancel,
319
+ ruleValues,
320
+ ruleBehavior,
321
+ initialContext,
322
+ setToolPermissionContext
323
+ } = t0;
324
+ let t1;
325
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
326
+ t1 = SOURCES.map(optionForPermissionSaveDestination);
327
+ $[0] = t1;
328
+ } else {
329
+ t1 = $[0];
330
+ }
331
+ const allOptions = t1;
332
+ let t2;
333
+ if ($[1] !== initialContext || $[2] !== onAddRules || $[3] !== onCancel || $[4] !== ruleBehavior || $[5] !== ruleValues || $[6] !== setToolPermissionContext) {
334
+ t2 = (selectedValue) => {
335
+ if (selectedValue === "cancel") {
336
+ onCancel();
337
+ return;
338
+ } else {
339
+ if (SOURCES.includes(selectedValue)) {
340
+ const destination = selectedValue;
341
+ const updatedContext = applyPermissionUpdate(initialContext, {
342
+ type: "addRules",
343
+ rules: ruleValues,
344
+ behavior: ruleBehavior,
345
+ destination
346
+ });
347
+ persistPermissionUpdate({
348
+ type: "addRules",
349
+ rules: ruleValues,
350
+ behavior: ruleBehavior,
351
+ destination
352
+ });
353
+ setToolPermissionContext(updatedContext);
354
+ const rules = ruleValues.map((ruleValue) => ({
355
+ ruleValue,
356
+ ruleBehavior,
357
+ source: destination
358
+ }));
359
+ const sandboxAutoAllowEnabled = SandboxManager.isSandboxingEnabled() && SandboxManager.isAutoAllowBashIfSandboxedEnabled();
360
+ const allUnreachable = detectUnreachableRules(updatedContext, {
361
+ sandboxAutoAllowEnabled
362
+ });
363
+ const newUnreachable = allUnreachable.filter((u) => ruleValues.some((rv) => rv.toolName === u.rule.ruleValue.toolName && rv.ruleContent === u.rule.ruleValue.ruleContent));
364
+ onAddRules(rules, newUnreachable.length > 0 ? newUnreachable : undefined);
365
+ }
366
+ }
367
+ };
368
+ $[1] = initialContext;
369
+ $[2] = onAddRules;
370
+ $[3] = onCancel;
371
+ $[4] = ruleBehavior;
372
+ $[5] = ruleValues;
373
+ $[6] = setToolPermissionContext;
374
+ $[7] = t2;
375
+ } else {
376
+ t2 = $[7];
377
+ }
378
+ const onSelect = t2;
379
+ let t3;
380
+ if ($[8] !== ruleValues.length) {
381
+ t3 = plural(ruleValues.length, "rule");
382
+ $[8] = ruleValues.length;
383
+ $[9] = t3;
384
+ } else {
385
+ t3 = $[9];
386
+ }
387
+ const title = `Add ${ruleBehavior} permission ${t3}`;
388
+ let t4;
389
+ if ($[10] !== ruleValues) {
390
+ t4 = ruleValues.map(_temp);
391
+ $[10] = ruleValues;
392
+ $[11] = t4;
393
+ } else {
394
+ t4 = $[11];
395
+ }
396
+ let t5;
397
+ if ($[12] !== t4) {
398
+ t5 = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
399
+ flexDirection: "column",
400
+ paddingX: 2,
401
+ children: t4
402
+ }, undefined, false, undefined, this);
403
+ $[12] = t4;
404
+ $[13] = t5;
405
+ } else {
406
+ t5 = $[13];
407
+ }
408
+ const t6 = ruleValues.length === 1 ? "Where should this rule be saved?" : "Where should these rules be saved?";
409
+ let t7;
410
+ if ($[14] !== t6) {
411
+ t7 = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
412
+ children: t6
413
+ }, undefined, false, undefined, this);
414
+ $[14] = t6;
415
+ $[15] = t7;
416
+ } else {
417
+ t7 = $[15];
418
+ }
419
+ let t8;
420
+ if ($[16] !== onSelect) {
421
+ t8 = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Select, {
422
+ options: allOptions,
423
+ onChange: onSelect
424
+ }, undefined, false, undefined, this);
425
+ $[16] = onSelect;
426
+ $[17] = t8;
427
+ } else {
428
+ t8 = $[17];
429
+ }
430
+ let t9;
431
+ if ($[18] !== t7 || $[19] !== t8) {
432
+ t9 = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
433
+ flexDirection: "column",
434
+ marginY: 1,
435
+ children: [
436
+ t7,
437
+ t8
438
+ ]
439
+ }, undefined, true, undefined, this);
440
+ $[18] = t7;
441
+ $[19] = t8;
442
+ $[20] = t9;
443
+ } else {
444
+ t9 = $[20];
445
+ }
446
+ let t10;
447
+ if ($[21] !== onCancel || $[22] !== t5 || $[23] !== t9 || $[24] !== title) {
448
+ t10 = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Dialog, {
449
+ title,
450
+ onCancel,
451
+ color: "permission",
452
+ children: [
453
+ t5,
454
+ t9
455
+ ]
456
+ }, undefined, true, undefined, this);
457
+ $[21] = onCancel;
458
+ $[22] = t5;
459
+ $[23] = t9;
460
+ $[24] = title;
461
+ $[25] = t10;
462
+ } else {
463
+ t10 = $[25];
464
+ }
465
+ return t10;
466
+ }
467
+ function _temp(ruleValue_0) {
468
+ return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
469
+ flexDirection: "column",
470
+ children: [
471
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
472
+ bold: true,
473
+ children: permissionRuleValueToString(ruleValue_0)
474
+ }, undefined, false, undefined, this),
475
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(PermissionRuleDescription, {
476
+ ruleValue: ruleValue_0
477
+ }, undefined, false, undefined, this)
478
+ ]
479
+ }, permissionRuleValueToString(ruleValue_0), true, undefined, this);
480
+ }
481
+ var import_compiler_runtime2, jsx_dev_runtime2;
482
+ var init_AddPermissionRules = __esm(() => {
483
+ init_select();
484
+ init_ink();
485
+ init_PermissionUpdate();
486
+ init_permissionRuleParser();
487
+ init_shadowedRuleDetection();
488
+ init_sandbox_adapter();
489
+ init_constants();
490
+ init_settings();
491
+ init_stringUtils();
492
+ init_Dialog();
493
+ init_PermissionRuleDescription();
494
+ import_compiler_runtime2 = __toESM(require_compiler_runtime(), 1);
495
+ jsx_dev_runtime2 = __toESM(require_jsx_dev_runtime(), 1);
496
+ });
497
+
498
+ // src/components/permissions/rules/PermissionRuleInput.tsx
499
+ function PermissionRuleInput(t0) {
500
+ const $ = import_compiler_runtime3.c(24);
501
+ const {
502
+ onCancel,
503
+ onSubmit,
504
+ ruleBehavior
505
+ } = t0;
506
+ const [inputValue, setInputValue] = import_react.useState("");
507
+ const [cursorOffset, setCursorOffset] = import_react.useState(0);
508
+ const exitState = useExitOnCtrlCDWithKeybindings();
509
+ let t1;
510
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
511
+ t1 = {
512
+ context: "Settings"
513
+ };
514
+ $[0] = t1;
515
+ } else {
516
+ t1 = $[0];
517
+ }
518
+ useKeybinding("confirm:no", onCancel, t1);
519
+ const {
520
+ columns
521
+ } = useTerminalSize();
522
+ const textInputColumns = columns - 6;
523
+ let t2;
524
+ if ($[1] !== onSubmit || $[2] !== ruleBehavior) {
525
+ t2 = (value) => {
526
+ const trimmedValue = value.trim();
527
+ if (trimmedValue.length === 0) {
528
+ return;
529
+ }
530
+ const ruleValue = permissionRuleValueFromString(trimmedValue);
531
+ onSubmit(ruleValue, ruleBehavior);
532
+ };
533
+ $[1] = onSubmit;
534
+ $[2] = ruleBehavior;
535
+ $[3] = t2;
536
+ } else {
537
+ t2 = $[3];
538
+ }
539
+ const handleSubmit = t2;
540
+ let t3;
541
+ if ($[4] !== ruleBehavior) {
542
+ t3 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
543
+ bold: true,
544
+ color: "permission",
545
+ children: [
546
+ "Add ",
547
+ ruleBehavior,
548
+ " permission rule"
549
+ ]
550
+ }, undefined, true, undefined, this);
551
+ $[4] = ruleBehavior;
552
+ $[5] = t3;
553
+ } else {
554
+ t3 = $[5];
555
+ }
556
+ let t4;
557
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
558
+ t4 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Newline, {}, undefined, false, undefined, this);
559
+ $[6] = t4;
560
+ } else {
561
+ t4 = $[6];
562
+ }
563
+ let t5;
564
+ let t6;
565
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
566
+ t5 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
567
+ bold: true,
568
+ children: permissionRuleValueToString({
569
+ toolName: WebFetchTool.name
570
+ })
571
+ }, undefined, false, undefined, this);
572
+ t6 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
573
+ bold: false,
574
+ children: " or "
575
+ }, undefined, false, undefined, this);
576
+ $[7] = t5;
577
+ $[8] = t6;
578
+ } else {
579
+ t5 = $[7];
580
+ t6 = $[8];
581
+ }
582
+ let t7;
583
+ if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
584
+ t7 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
585
+ children: [
586
+ "Permission rules are a tool name, optionally followed by a specifier in parentheses.",
587
+ t4,
588
+ "e.g.,",
589
+ " ",
590
+ t5,
591
+ t6,
592
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
593
+ bold: true,
594
+ children: permissionRuleValueToString({
595
+ toolName: BashTool.name,
596
+ ruleContent: "ls:*"
597
+ })
598
+ }, undefined, false, undefined, this)
599
+ ]
600
+ }, undefined, true, undefined, this);
601
+ $[9] = t7;
602
+ } else {
603
+ t7 = $[9];
604
+ }
605
+ let t8;
606
+ if ($[10] !== cursorOffset || $[11] !== handleSubmit || $[12] !== inputValue || $[13] !== textInputColumns) {
607
+ t8 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
608
+ flexDirection: "column",
609
+ children: [
610
+ t7,
611
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
612
+ borderDimColor: true,
613
+ borderStyle: "round",
614
+ marginY: 1,
615
+ paddingLeft: 1,
616
+ children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(TextInput, {
617
+ showCursor: true,
618
+ value: inputValue,
619
+ onChange: setInputValue,
620
+ onSubmit: handleSubmit,
621
+ placeholder: `Enter permission rule${figures_default.ellipsis}`,
622
+ columns: textInputColumns,
623
+ cursorOffset,
624
+ onChangeCursorOffset: setCursorOffset
625
+ }, undefined, false, undefined, this)
626
+ }, undefined, false, undefined, this)
627
+ ]
628
+ }, undefined, true, undefined, this);
629
+ $[10] = cursorOffset;
630
+ $[11] = handleSubmit;
631
+ $[12] = inputValue;
632
+ $[13] = textInputColumns;
633
+ $[14] = t8;
634
+ } else {
635
+ t8 = $[14];
636
+ }
637
+ let t9;
638
+ if ($[15] !== t3 || $[16] !== t8) {
639
+ t9 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
640
+ flexDirection: "column",
641
+ gap: 1,
642
+ borderStyle: "round",
643
+ paddingLeft: 1,
644
+ paddingRight: 1,
645
+ borderColor: "permission",
646
+ children: [
647
+ t3,
648
+ t8
649
+ ]
650
+ }, undefined, true, undefined, this);
651
+ $[15] = t3;
652
+ $[16] = t8;
653
+ $[17] = t9;
654
+ } else {
655
+ t9 = $[17];
656
+ }
657
+ let t10;
658
+ if ($[18] !== exitState.keyName || $[19] !== exitState.pending) {
659
+ t10 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
660
+ marginLeft: 3,
661
+ children: exitState.pending ? /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
662
+ dimColor: true,
663
+ children: [
664
+ "Press ",
665
+ exitState.keyName,
666
+ " again to exit"
667
+ ]
668
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
669
+ dimColor: true,
670
+ children: "Enter to submit \xB7 Esc to cancel"
671
+ }, undefined, false, undefined, this)
672
+ }, undefined, false, undefined, this);
673
+ $[18] = exitState.keyName;
674
+ $[19] = exitState.pending;
675
+ $[20] = t10;
676
+ } else {
677
+ t10 = $[20];
678
+ }
679
+ let t11;
680
+ if ($[21] !== t10 || $[22] !== t9) {
681
+ t11 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(jsx_dev_runtime3.Fragment, {
682
+ children: [
683
+ t9,
684
+ t10
685
+ ]
686
+ }, undefined, true, undefined, this);
687
+ $[21] = t10;
688
+ $[22] = t9;
689
+ $[23] = t11;
690
+ } else {
691
+ t11 = $[23];
692
+ }
693
+ return t11;
694
+ }
695
+ var import_compiler_runtime3, import_react, jsx_dev_runtime3;
696
+ var init_PermissionRuleInput = __esm(() => {
697
+ init_figures();
698
+ init_TextInput();
699
+ init_useExitOnCtrlCDWithKeybindings();
700
+ init_useTerminalSize();
701
+ init_ink();
702
+ init_useKeybinding();
703
+ init_BashTool();
704
+ init_WebFetchTool();
705
+ init_permissionRuleParser();
706
+ import_compiler_runtime3 = __toESM(require_compiler_runtime(), 1);
707
+ import_react = __toESM(require_react(), 1);
708
+ jsx_dev_runtime3 = __toESM(require_jsx_dev_runtime(), 1);
709
+ });
710
+
711
+ // src/components/permissions/rules/RecentDenialsTab.tsx
712
+ function RecentDenialsTab(t0) {
713
+ const $ = import_compiler_runtime4.c(30);
714
+ const {
715
+ onHeaderFocusChange,
716
+ onStateChange
717
+ } = t0;
718
+ const {
719
+ headerFocused,
720
+ focusHeader
721
+ } = useTabHeaderFocus();
722
+ let t1;
723
+ let t2;
724
+ if ($[0] !== headerFocused || $[1] !== onHeaderFocusChange) {
725
+ t1 = () => {
726
+ onHeaderFocusChange?.(headerFocused);
727
+ };
728
+ t2 = [headerFocused, onHeaderFocusChange];
729
+ $[0] = headerFocused;
730
+ $[1] = onHeaderFocusChange;
731
+ $[2] = t1;
732
+ $[3] = t2;
733
+ } else {
734
+ t1 = $[2];
735
+ t2 = $[3];
736
+ }
737
+ import_react2.useEffect(t1, t2);
738
+ const [denials] = import_react2.useState(_temp4);
739
+ const [approved, setApproved] = import_react2.useState(_temp2);
740
+ const [retry, setRetry] = import_react2.useState(_temp3);
741
+ const [focusedIdx, setFocusedIdx] = import_react2.useState(0);
742
+ let t3;
743
+ let t4;
744
+ if ($[4] !== approved || $[5] !== denials || $[6] !== onStateChange || $[7] !== retry) {
745
+ t3 = () => {
746
+ onStateChange({
747
+ approved,
748
+ retry,
749
+ denials
750
+ });
751
+ };
752
+ t4 = [approved, retry, denials, onStateChange];
753
+ $[4] = approved;
754
+ $[5] = denials;
755
+ $[6] = onStateChange;
756
+ $[7] = retry;
757
+ $[8] = t3;
758
+ $[9] = t4;
759
+ } else {
760
+ t3 = $[8];
761
+ t4 = $[9];
762
+ }
763
+ import_react2.useEffect(t3, t4);
764
+ let t5;
765
+ if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
766
+ t5 = (value) => {
767
+ const idx = Number(value);
768
+ setApproved((prev) => {
769
+ const next = new Set(prev);
770
+ if (next.has(idx)) {
771
+ next.delete(idx);
772
+ } else {
773
+ next.add(idx);
774
+ }
775
+ return next;
776
+ });
777
+ };
778
+ $[10] = t5;
779
+ } else {
780
+ t5 = $[10];
781
+ }
782
+ const handleSelect = t5;
783
+ let t6;
784
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
785
+ t6 = (value_0) => {
786
+ setFocusedIdx(Number(value_0));
787
+ };
788
+ $[11] = t6;
789
+ } else {
790
+ t6 = $[11];
791
+ }
792
+ const handleFocus = t6;
793
+ let t7;
794
+ if ($[12] !== focusedIdx) {
795
+ t7 = (input, _key) => {
796
+ if (input === "r") {
797
+ setRetry((prev_0) => {
798
+ const next_0 = new Set(prev_0);
799
+ if (next_0.has(focusedIdx)) {
800
+ next_0.delete(focusedIdx);
801
+ } else {
802
+ next_0.add(focusedIdx);
803
+ }
804
+ return next_0;
805
+ });
806
+ setApproved((prev_1) => {
807
+ if (prev_1.has(focusedIdx)) {
808
+ return prev_1;
809
+ }
810
+ const next_1 = new Set(prev_1);
811
+ next_1.add(focusedIdx);
812
+ return next_1;
813
+ });
814
+ }
815
+ };
816
+ $[12] = focusedIdx;
817
+ $[13] = t7;
818
+ } else {
819
+ t7 = $[13];
820
+ }
821
+ const t8 = denials.length > 0;
822
+ let t9;
823
+ if ($[14] !== t8) {
824
+ t9 = {
825
+ isActive: t8
826
+ };
827
+ $[14] = t8;
828
+ $[15] = t9;
829
+ } else {
830
+ t9 = $[15];
831
+ }
832
+ use_input_default(t7, t9);
833
+ if (denials.length === 0) {
834
+ let t102;
835
+ if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
836
+ t102 = /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
837
+ dimColor: true,
838
+ children: "No recent denials. Commands denied by the auto mode classifier will appear here."
839
+ }, undefined, false, undefined, this);
840
+ $[16] = t102;
841
+ } else {
842
+ t102 = $[16];
843
+ }
844
+ return t102;
845
+ }
846
+ let t10;
847
+ if ($[17] !== approved || $[18] !== denials || $[19] !== retry) {
848
+ let t112;
849
+ if ($[21] !== approved || $[22] !== retry) {
850
+ t112 = (d, idx_0) => {
851
+ const isApproved = approved.has(idx_0);
852
+ const suffix = retry.has(idx_0) ? " (retry)" : "";
853
+ return {
854
+ label: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
855
+ children: [
856
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(StatusIcon, {
857
+ status: isApproved ? "success" : "error",
858
+ withSpace: true
859
+ }, undefined, false, undefined, this),
860
+ d.display,
861
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
862
+ dimColor: true,
863
+ children: suffix
864
+ }, undefined, false, undefined, this)
865
+ ]
866
+ }, undefined, true, undefined, this),
867
+ value: String(idx_0)
868
+ };
869
+ };
870
+ $[21] = approved;
871
+ $[22] = retry;
872
+ $[23] = t112;
873
+ } else {
874
+ t112 = $[23];
875
+ }
876
+ t10 = denials.map(t112);
877
+ $[17] = approved;
878
+ $[18] = denials;
879
+ $[19] = retry;
880
+ $[20] = t10;
881
+ } else {
882
+ t10 = $[20];
883
+ }
884
+ const options = t10;
885
+ let t11;
886
+ if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
887
+ t11 = /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
888
+ children: "Commands recently denied by the auto mode classifier."
889
+ }, undefined, false, undefined, this);
890
+ $[24] = t11;
891
+ } else {
892
+ t11 = $[24];
893
+ }
894
+ const t12 = Math.min(10, options.length);
895
+ let t13;
896
+ if ($[25] !== focusHeader || $[26] !== headerFocused || $[27] !== options || $[28] !== t12) {
897
+ t13 = /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
898
+ flexDirection: "column",
899
+ children: [
900
+ t11,
901
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
902
+ marginTop: 1,
903
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Select, {
904
+ options,
905
+ onChange: handleSelect,
906
+ onFocus: handleFocus,
907
+ visibleOptionCount: t12,
908
+ isDisabled: headerFocused,
909
+ onUpFromFirstItem: focusHeader
910
+ }, undefined, false, undefined, this)
911
+ }, undefined, false, undefined, this)
912
+ ]
913
+ }, undefined, true, undefined, this);
914
+ $[25] = focusHeader;
915
+ $[26] = headerFocused;
916
+ $[27] = options;
917
+ $[28] = t12;
918
+ $[29] = t13;
919
+ } else {
920
+ t13 = $[29];
921
+ }
922
+ return t13;
923
+ }
924
+ function _temp3() {
925
+ return new Set;
926
+ }
927
+ function _temp2() {
928
+ return new Set;
929
+ }
930
+ function _temp4() {
931
+ return getAutoModeDenials();
932
+ }
933
+ var import_compiler_runtime4, import_react2, jsx_dev_runtime4;
934
+ var init_RecentDenialsTab = __esm(() => {
935
+ init_ink();
936
+ init_autoModeDenials();
937
+ init_select();
938
+ init_StatusIcon();
939
+ init_Tabs();
940
+ import_compiler_runtime4 = __toESM(require_compiler_runtime(), 1);
941
+ import_react2 = __toESM(require_react(), 1);
942
+ jsx_dev_runtime4 = __toESM(require_jsx_dev_runtime(), 1);
943
+ });
944
+
945
+ // src/components/permissions/rules/RemoveWorkspaceDirectory.tsx
946
+ function RemoveWorkspaceDirectory(t0) {
947
+ const $ = import_compiler_runtime5.c(19);
948
+ const {
949
+ directoryPath,
950
+ onRemove,
951
+ onCancel,
952
+ permissionContext,
953
+ setPermissionContext
954
+ } = t0;
955
+ let t1;
956
+ if ($[0] !== directoryPath || $[1] !== onRemove || $[2] !== permissionContext || $[3] !== setPermissionContext) {
957
+ t1 = () => {
958
+ const updatedContext = applyPermissionUpdate(permissionContext, {
959
+ type: "removeDirectories",
960
+ directories: [directoryPath],
961
+ destination: "session"
962
+ });
963
+ setPermissionContext(updatedContext);
964
+ onRemove();
965
+ };
966
+ $[0] = directoryPath;
967
+ $[1] = onRemove;
968
+ $[2] = permissionContext;
969
+ $[3] = setPermissionContext;
970
+ $[4] = t1;
971
+ } else {
972
+ t1 = $[4];
973
+ }
974
+ const handleRemove = t1;
975
+ let t2;
976
+ if ($[5] !== handleRemove || $[6] !== onCancel) {
977
+ t2 = (value) => {
978
+ if (value === "yes") {
979
+ handleRemove();
980
+ } else {
981
+ onCancel();
982
+ }
983
+ };
984
+ $[5] = handleRemove;
985
+ $[6] = onCancel;
986
+ $[7] = t2;
987
+ } else {
988
+ t2 = $[7];
989
+ }
990
+ const handleSelect = t2;
991
+ let t3;
992
+ if ($[8] !== directoryPath) {
993
+ t3 = /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
994
+ marginX: 2,
995
+ flexDirection: "column",
996
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
997
+ bold: true,
998
+ children: directoryPath
999
+ }, undefined, false, undefined, this)
1000
+ }, undefined, false, undefined, this);
1001
+ $[8] = directoryPath;
1002
+ $[9] = t3;
1003
+ } else {
1004
+ t3 = $[9];
1005
+ }
1006
+ let t4;
1007
+ if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
1008
+ t4 = /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
1009
+ children: "Open CC will no longer have access to files in this directory."
1010
+ }, undefined, false, undefined, this);
1011
+ $[10] = t4;
1012
+ } else {
1013
+ t4 = $[10];
1014
+ }
1015
+ let t5;
1016
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
1017
+ t5 = [{
1018
+ label: "Yes",
1019
+ value: "yes"
1020
+ }, {
1021
+ label: "No",
1022
+ value: "no"
1023
+ }];
1024
+ $[11] = t5;
1025
+ } else {
1026
+ t5 = $[11];
1027
+ }
1028
+ let t6;
1029
+ if ($[12] !== handleSelect || $[13] !== onCancel) {
1030
+ t6 = /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Select, {
1031
+ onChange: handleSelect,
1032
+ onCancel,
1033
+ options: t5
1034
+ }, undefined, false, undefined, this);
1035
+ $[12] = handleSelect;
1036
+ $[13] = onCancel;
1037
+ $[14] = t6;
1038
+ } else {
1039
+ t6 = $[14];
1040
+ }
1041
+ let t7;
1042
+ if ($[15] !== onCancel || $[16] !== t3 || $[17] !== t6) {
1043
+ t7 = /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Dialog, {
1044
+ title: "Remove directory from workspace?",
1045
+ onCancel,
1046
+ color: "error",
1047
+ children: [
1048
+ t3,
1049
+ t4,
1050
+ t6
1051
+ ]
1052
+ }, undefined, true, undefined, this);
1053
+ $[15] = onCancel;
1054
+ $[16] = t3;
1055
+ $[17] = t6;
1056
+ $[18] = t7;
1057
+ } else {
1058
+ t7 = $[18];
1059
+ }
1060
+ return t7;
1061
+ }
1062
+ var import_compiler_runtime5, jsx_dev_runtime5;
1063
+ var init_RemoveWorkspaceDirectory = __esm(() => {
1064
+ init_select();
1065
+ init_ink();
1066
+ init_PermissionUpdate();
1067
+ init_Dialog();
1068
+ import_compiler_runtime5 = __toESM(require_compiler_runtime(), 1);
1069
+ jsx_dev_runtime5 = __toESM(require_jsx_dev_runtime(), 1);
1070
+ });
1071
+
1072
+ // src/components/permissions/rules/WorkspaceTab.tsx
1073
+ function WorkspaceTab(t0) {
1074
+ const $ = import_compiler_runtime6.c(23);
1075
+ const {
1076
+ onExit,
1077
+ toolPermissionContext,
1078
+ onRequestAddDirectory,
1079
+ onRequestRemoveDirectory,
1080
+ onHeaderFocusChange
1081
+ } = t0;
1082
+ const {
1083
+ headerFocused,
1084
+ focusHeader
1085
+ } = useTabHeaderFocus();
1086
+ let t1;
1087
+ let t2;
1088
+ if ($[0] !== headerFocused || $[1] !== onHeaderFocusChange) {
1089
+ t1 = () => {
1090
+ onHeaderFocusChange?.(headerFocused);
1091
+ };
1092
+ t2 = [headerFocused, onHeaderFocusChange];
1093
+ $[0] = headerFocused;
1094
+ $[1] = onHeaderFocusChange;
1095
+ $[2] = t1;
1096
+ $[3] = t2;
1097
+ } else {
1098
+ t1 = $[2];
1099
+ t2 = $[3];
1100
+ }
1101
+ import_react3.useEffect(t1, t2);
1102
+ let t3;
1103
+ if ($[4] !== toolPermissionContext.additionalWorkingDirectories) {
1104
+ t3 = Array.from(toolPermissionContext.additionalWorkingDirectories.keys()).map(_temp6);
1105
+ $[4] = toolPermissionContext.additionalWorkingDirectories;
1106
+ $[5] = t3;
1107
+ } else {
1108
+ t3 = $[5];
1109
+ }
1110
+ const additionalDirectories = t3;
1111
+ let t4;
1112
+ if ($[6] !== additionalDirectories || $[7] !== onRequestAddDirectory || $[8] !== onRequestRemoveDirectory) {
1113
+ t4 = (selectedValue) => {
1114
+ if (selectedValue === "add-directory") {
1115
+ onRequestAddDirectory();
1116
+ return;
1117
+ }
1118
+ const directory = additionalDirectories.find((d) => d.path === selectedValue);
1119
+ if (directory && directory.isDeletable) {
1120
+ onRequestRemoveDirectory(directory.path);
1121
+ }
1122
+ };
1123
+ $[6] = additionalDirectories;
1124
+ $[7] = onRequestAddDirectory;
1125
+ $[8] = onRequestRemoveDirectory;
1126
+ $[9] = t4;
1127
+ } else {
1128
+ t4 = $[9];
1129
+ }
1130
+ const handleDirectorySelect = t4;
1131
+ let t5;
1132
+ if ($[10] !== onExit) {
1133
+ t5 = () => onExit("Workspace dialog dismissed", {
1134
+ display: "system"
1135
+ });
1136
+ $[10] = onExit;
1137
+ $[11] = t5;
1138
+ } else {
1139
+ t5 = $[11];
1140
+ }
1141
+ const handleCancel = t5;
1142
+ let opts;
1143
+ if ($[12] !== additionalDirectories) {
1144
+ opts = additionalDirectories.map(_temp22);
1145
+ let t62;
1146
+ if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
1147
+ t62 = {
1148
+ label: `Add directory${figures_default.ellipsis}`,
1149
+ value: "add-directory"
1150
+ };
1151
+ $[14] = t62;
1152
+ } else {
1153
+ t62 = $[14];
1154
+ }
1155
+ opts.push(t62);
1156
+ $[12] = additionalDirectories;
1157
+ $[13] = opts;
1158
+ } else {
1159
+ opts = $[13];
1160
+ }
1161
+ const options = opts;
1162
+ let t6;
1163
+ if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
1164
+ t6 = /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
1165
+ flexDirection: "row",
1166
+ marginTop: 1,
1167
+ marginLeft: 2,
1168
+ gap: 1,
1169
+ children: [
1170
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
1171
+ children: `- ${getOriginalCwd()}`
1172
+ }, undefined, false, undefined, this),
1173
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
1174
+ dimColor: true,
1175
+ children: "(Original working directory)"
1176
+ }, undefined, false, undefined, this)
1177
+ ]
1178
+ }, undefined, true, undefined, this);
1179
+ $[15] = t6;
1180
+ } else {
1181
+ t6 = $[15];
1182
+ }
1183
+ const t7 = Math.min(10, options.length);
1184
+ let t8;
1185
+ if ($[16] !== focusHeader || $[17] !== handleCancel || $[18] !== handleDirectorySelect || $[19] !== headerFocused || $[20] !== options || $[21] !== t7) {
1186
+ t8 = /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
1187
+ flexDirection: "column",
1188
+ marginBottom: 1,
1189
+ children: [
1190
+ t6,
1191
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Select, {
1192
+ options,
1193
+ onChange: handleDirectorySelect,
1194
+ onCancel: handleCancel,
1195
+ visibleOptionCount: t7,
1196
+ onUpFromFirstItem: focusHeader,
1197
+ isDisabled: headerFocused
1198
+ }, undefined, false, undefined, this)
1199
+ ]
1200
+ }, undefined, true, undefined, this);
1201
+ $[16] = focusHeader;
1202
+ $[17] = handleCancel;
1203
+ $[18] = handleDirectorySelect;
1204
+ $[19] = headerFocused;
1205
+ $[20] = options;
1206
+ $[21] = t7;
1207
+ $[22] = t8;
1208
+ } else {
1209
+ t8 = $[22];
1210
+ }
1211
+ return t8;
1212
+ }
1213
+ function _temp22(dir) {
1214
+ return {
1215
+ label: dir.path,
1216
+ value: dir.path
1217
+ };
1218
+ }
1219
+ function _temp6(path) {
1220
+ return {
1221
+ path,
1222
+ isCurrent: false,
1223
+ isDeletable: true
1224
+ };
1225
+ }
1226
+ var import_compiler_runtime6, import_react3, jsx_dev_runtime6;
1227
+ var init_WorkspaceTab = __esm(() => {
1228
+ init_figures();
1229
+ init_state();
1230
+ init_select();
1231
+ init_ink();
1232
+ init_Tabs();
1233
+ import_compiler_runtime6 = __toESM(require_compiler_runtime(), 1);
1234
+ import_react3 = __toESM(require_react(), 1);
1235
+ jsx_dev_runtime6 = __toESM(require_jsx_dev_runtime(), 1);
1236
+ });
1237
+
1238
+ // src/components/permissions/rules/PermissionRuleList.tsx
1239
+ function RuleSourceText(t0) {
1240
+ const $ = import_compiler_runtime7.c(4);
1241
+ const {
1242
+ rule
1243
+ } = t0;
1244
+ let t1;
1245
+ if ($[0] !== rule.source) {
1246
+ t1 = permissionRuleSourceDisplayString(rule.source);
1247
+ $[0] = rule.source;
1248
+ $[1] = t1;
1249
+ } else {
1250
+ t1 = $[1];
1251
+ }
1252
+ const t2 = `From ${t1}`;
1253
+ let t3;
1254
+ if ($[2] !== t2) {
1255
+ t3 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1256
+ dimColor: true,
1257
+ children: t2
1258
+ }, undefined, false, undefined, this);
1259
+ $[2] = t2;
1260
+ $[3] = t3;
1261
+ } else {
1262
+ t3 = $[3];
1263
+ }
1264
+ return t3;
1265
+ }
1266
+ function getRuleBehaviorLabel(ruleBehavior) {
1267
+ switch (ruleBehavior) {
1268
+ case "allow":
1269
+ return "allowed";
1270
+ case "deny":
1271
+ return "denied";
1272
+ case "ask":
1273
+ return "ask";
1274
+ }
1275
+ }
1276
+ function RuleDetails(t0) {
1277
+ const $ = import_compiler_runtime7.c(42);
1278
+ const {
1279
+ rule,
1280
+ onDelete,
1281
+ onCancel
1282
+ } = t0;
1283
+ const exitState = useExitOnCtrlCDWithKeybindings();
1284
+ let t1;
1285
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
1286
+ t1 = {
1287
+ context: "Confirmation"
1288
+ };
1289
+ $[0] = t1;
1290
+ } else {
1291
+ t1 = $[0];
1292
+ }
1293
+ useKeybinding("confirm:no", onCancel, t1);
1294
+ let t2;
1295
+ if ($[1] !== rule.ruleValue) {
1296
+ t2 = permissionRuleValueToString(rule.ruleValue);
1297
+ $[1] = rule.ruleValue;
1298
+ $[2] = t2;
1299
+ } else {
1300
+ t2 = $[2];
1301
+ }
1302
+ let t3;
1303
+ if ($[3] !== t2) {
1304
+ t3 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1305
+ bold: true,
1306
+ children: t2
1307
+ }, undefined, false, undefined, this);
1308
+ $[3] = t2;
1309
+ $[4] = t3;
1310
+ } else {
1311
+ t3 = $[4];
1312
+ }
1313
+ let t4;
1314
+ if ($[5] !== rule.ruleValue) {
1315
+ t4 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(PermissionRuleDescription, {
1316
+ ruleValue: rule.ruleValue
1317
+ }, undefined, false, undefined, this);
1318
+ $[5] = rule.ruleValue;
1319
+ $[6] = t4;
1320
+ } else {
1321
+ t4 = $[6];
1322
+ }
1323
+ let t5;
1324
+ if ($[7] !== rule) {
1325
+ t5 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(RuleSourceText, {
1326
+ rule
1327
+ }, undefined, false, undefined, this);
1328
+ $[7] = rule;
1329
+ $[8] = t5;
1330
+ } else {
1331
+ t5 = $[8];
1332
+ }
1333
+ let t6;
1334
+ if ($[9] !== t3 || $[10] !== t4 || $[11] !== t5) {
1335
+ t6 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1336
+ flexDirection: "column",
1337
+ marginX: 2,
1338
+ children: [
1339
+ t3,
1340
+ t4,
1341
+ t5
1342
+ ]
1343
+ }, undefined, true, undefined, this);
1344
+ $[9] = t3;
1345
+ $[10] = t4;
1346
+ $[11] = t5;
1347
+ $[12] = t6;
1348
+ } else {
1349
+ t6 = $[12];
1350
+ }
1351
+ const ruleDescription = t6;
1352
+ let t7;
1353
+ if ($[13] !== exitState.keyName || $[14] !== exitState.pending) {
1354
+ t7 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1355
+ marginLeft: 3,
1356
+ children: exitState.pending ? /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1357
+ dimColor: true,
1358
+ children: [
1359
+ "Press ",
1360
+ exitState.keyName,
1361
+ " again to exit"
1362
+ ]
1363
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1364
+ dimColor: true,
1365
+ children: "Esc to cancel"
1366
+ }, undefined, false, undefined, this)
1367
+ }, undefined, false, undefined, this);
1368
+ $[13] = exitState.keyName;
1369
+ $[14] = exitState.pending;
1370
+ $[15] = t7;
1371
+ } else {
1372
+ t7 = $[15];
1373
+ }
1374
+ const footer = t7;
1375
+ if (rule.source === "policySettings") {
1376
+ let t82;
1377
+ if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
1378
+ t82 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1379
+ bold: true,
1380
+ color: "permission",
1381
+ children: "Rule details"
1382
+ }, undefined, false, undefined, this);
1383
+ $[16] = t82;
1384
+ } else {
1385
+ t82 = $[16];
1386
+ }
1387
+ let t92;
1388
+ if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
1389
+ t92 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1390
+ italic: true,
1391
+ children: [
1392
+ "This rule is configured by managed settings and cannot be modified.",
1393
+ `
1394
+ `,
1395
+ "Contact your system administrator for more information."
1396
+ ]
1397
+ }, undefined, true, undefined, this);
1398
+ $[17] = t92;
1399
+ } else {
1400
+ t92 = $[17];
1401
+ }
1402
+ let t102;
1403
+ if ($[18] !== ruleDescription) {
1404
+ t102 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1405
+ flexDirection: "column",
1406
+ gap: 1,
1407
+ borderStyle: "round",
1408
+ paddingLeft: 1,
1409
+ paddingRight: 1,
1410
+ borderColor: "permission",
1411
+ children: [
1412
+ t82,
1413
+ ruleDescription,
1414
+ t92
1415
+ ]
1416
+ }, undefined, true, undefined, this);
1417
+ $[18] = ruleDescription;
1418
+ $[19] = t102;
1419
+ } else {
1420
+ t102 = $[19];
1421
+ }
1422
+ let t112;
1423
+ if ($[20] !== footer || $[21] !== t102) {
1424
+ t112 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
1425
+ children: [
1426
+ t102,
1427
+ footer
1428
+ ]
1429
+ }, undefined, true, undefined, this);
1430
+ $[20] = footer;
1431
+ $[21] = t102;
1432
+ $[22] = t112;
1433
+ } else {
1434
+ t112 = $[22];
1435
+ }
1436
+ return t112;
1437
+ }
1438
+ let t8;
1439
+ if ($[23] !== rule.ruleBehavior) {
1440
+ t8 = getRuleBehaviorLabel(rule.ruleBehavior);
1441
+ $[23] = rule.ruleBehavior;
1442
+ $[24] = t8;
1443
+ } else {
1444
+ t8 = $[24];
1445
+ }
1446
+ let t9;
1447
+ if ($[25] !== t8) {
1448
+ t9 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1449
+ bold: true,
1450
+ color: "error",
1451
+ children: [
1452
+ "Delete ",
1453
+ t8,
1454
+ " tool?"
1455
+ ]
1456
+ }, undefined, true, undefined, this);
1457
+ $[25] = t8;
1458
+ $[26] = t9;
1459
+ } else {
1460
+ t9 = $[26];
1461
+ }
1462
+ let t10;
1463
+ if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
1464
+ t10 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1465
+ children: "Are you sure you want to delete this permission rule?"
1466
+ }, undefined, false, undefined, this);
1467
+ $[27] = t10;
1468
+ } else {
1469
+ t10 = $[27];
1470
+ }
1471
+ let t11;
1472
+ if ($[28] !== onCancel || $[29] !== onDelete) {
1473
+ t11 = (_) => _ === "yes" ? onDelete() : onCancel();
1474
+ $[28] = onCancel;
1475
+ $[29] = onDelete;
1476
+ $[30] = t11;
1477
+ } else {
1478
+ t11 = $[30];
1479
+ }
1480
+ let t12;
1481
+ if ($[31] === Symbol.for("react.memo_cache_sentinel")) {
1482
+ t12 = [{
1483
+ label: "Yes",
1484
+ value: "yes"
1485
+ }, {
1486
+ label: "No",
1487
+ value: "no"
1488
+ }];
1489
+ $[31] = t12;
1490
+ } else {
1491
+ t12 = $[31];
1492
+ }
1493
+ let t13;
1494
+ if ($[32] !== onCancel || $[33] !== t11) {
1495
+ t13 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Select, {
1496
+ onChange: t11,
1497
+ onCancel,
1498
+ options: t12
1499
+ }, undefined, false, undefined, this);
1500
+ $[32] = onCancel;
1501
+ $[33] = t11;
1502
+ $[34] = t13;
1503
+ } else {
1504
+ t13 = $[34];
1505
+ }
1506
+ let t14;
1507
+ if ($[35] !== ruleDescription || $[36] !== t13 || $[37] !== t9) {
1508
+ t14 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1509
+ flexDirection: "column",
1510
+ gap: 1,
1511
+ borderStyle: "round",
1512
+ paddingLeft: 1,
1513
+ paddingRight: 1,
1514
+ borderColor: "error",
1515
+ children: [
1516
+ t9,
1517
+ ruleDescription,
1518
+ t10,
1519
+ t13
1520
+ ]
1521
+ }, undefined, true, undefined, this);
1522
+ $[35] = ruleDescription;
1523
+ $[36] = t13;
1524
+ $[37] = t9;
1525
+ $[38] = t14;
1526
+ } else {
1527
+ t14 = $[38];
1528
+ }
1529
+ let t15;
1530
+ if ($[39] !== footer || $[40] !== t14) {
1531
+ t15 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
1532
+ children: [
1533
+ t14,
1534
+ footer
1535
+ ]
1536
+ }, undefined, true, undefined, this);
1537
+ $[39] = footer;
1538
+ $[40] = t14;
1539
+ $[41] = t15;
1540
+ } else {
1541
+ t15 = $[41];
1542
+ }
1543
+ return t15;
1544
+ }
1545
+ function RulesTabContent(props) {
1546
+ const $ = import_compiler_runtime7.c(26);
1547
+ const {
1548
+ options,
1549
+ searchQuery,
1550
+ isSearchMode,
1551
+ isFocused,
1552
+ onSelect,
1553
+ onCancel,
1554
+ lastFocusedRuleKey,
1555
+ cursorOffset,
1556
+ onHeaderFocusChange
1557
+ } = props;
1558
+ const tabWidth = useTabsWidth();
1559
+ const {
1560
+ headerFocused,
1561
+ focusHeader,
1562
+ blurHeader
1563
+ } = useTabHeaderFocus();
1564
+ let t0;
1565
+ let t1;
1566
+ if ($[0] !== blurHeader || $[1] !== headerFocused || $[2] !== isSearchMode) {
1567
+ t0 = () => {
1568
+ if (isSearchMode && headerFocused) {
1569
+ blurHeader();
1570
+ }
1571
+ };
1572
+ t1 = [isSearchMode, headerFocused, blurHeader];
1573
+ $[0] = blurHeader;
1574
+ $[1] = headerFocused;
1575
+ $[2] = isSearchMode;
1576
+ $[3] = t0;
1577
+ $[4] = t1;
1578
+ } else {
1579
+ t0 = $[3];
1580
+ t1 = $[4];
1581
+ }
1582
+ import_react4.useEffect(t0, t1);
1583
+ let t2;
1584
+ let t3;
1585
+ if ($[5] !== headerFocused || $[6] !== onHeaderFocusChange) {
1586
+ t2 = () => {
1587
+ onHeaderFocusChange?.(headerFocused);
1588
+ };
1589
+ t3 = [headerFocused, onHeaderFocusChange];
1590
+ $[5] = headerFocused;
1591
+ $[6] = onHeaderFocusChange;
1592
+ $[7] = t2;
1593
+ $[8] = t3;
1594
+ } else {
1595
+ t2 = $[7];
1596
+ t3 = $[8];
1597
+ }
1598
+ import_react4.useEffect(t2, t3);
1599
+ const t4 = isSearchMode && !headerFocused;
1600
+ let t5;
1601
+ if ($[9] !== cursorOffset || $[10] !== isFocused || $[11] !== searchQuery || $[12] !== t4 || $[13] !== tabWidth) {
1602
+ t5 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1603
+ marginBottom: 1,
1604
+ flexDirection: "column",
1605
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(SearchBox, {
1606
+ query: searchQuery,
1607
+ isFocused: t4,
1608
+ isTerminalFocused: isFocused,
1609
+ width: tabWidth,
1610
+ cursorOffset
1611
+ }, undefined, false, undefined, this)
1612
+ }, undefined, false, undefined, this);
1613
+ $[9] = cursorOffset;
1614
+ $[10] = isFocused;
1615
+ $[11] = searchQuery;
1616
+ $[12] = t4;
1617
+ $[13] = tabWidth;
1618
+ $[14] = t5;
1619
+ } else {
1620
+ t5 = $[14];
1621
+ }
1622
+ const t6 = Math.min(10, options.length);
1623
+ const t7 = isSearchMode || headerFocused;
1624
+ let t8;
1625
+ if ($[15] !== focusHeader || $[16] !== lastFocusedRuleKey || $[17] !== onCancel || $[18] !== onSelect || $[19] !== options || $[20] !== t6 || $[21] !== t7) {
1626
+ t8 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Select, {
1627
+ options,
1628
+ onChange: onSelect,
1629
+ onCancel,
1630
+ visibleOptionCount: t6,
1631
+ isDisabled: t7,
1632
+ defaultFocusValue: lastFocusedRuleKey,
1633
+ onUpFromFirstItem: focusHeader
1634
+ }, undefined, false, undefined, this);
1635
+ $[15] = focusHeader;
1636
+ $[16] = lastFocusedRuleKey;
1637
+ $[17] = onCancel;
1638
+ $[18] = onSelect;
1639
+ $[19] = options;
1640
+ $[20] = t6;
1641
+ $[21] = t7;
1642
+ $[22] = t8;
1643
+ } else {
1644
+ t8 = $[22];
1645
+ }
1646
+ let t9;
1647
+ if ($[23] !== t5 || $[24] !== t8) {
1648
+ t9 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1649
+ flexDirection: "column",
1650
+ children: [
1651
+ t5,
1652
+ t8
1653
+ ]
1654
+ }, undefined, true, undefined, this);
1655
+ $[23] = t5;
1656
+ $[24] = t8;
1657
+ $[25] = t9;
1658
+ } else {
1659
+ t9 = $[25];
1660
+ }
1661
+ return t9;
1662
+ }
1663
+ function PermissionRulesTab(t0) {
1664
+ const $ = import_compiler_runtime7.c(27);
1665
+ let T0;
1666
+ let T1;
1667
+ let handleToolSelect;
1668
+ let rulesProps;
1669
+ let t1;
1670
+ let t2;
1671
+ let t3;
1672
+ let t4;
1673
+ let tab;
1674
+ if ($[0] !== t0) {
1675
+ const {
1676
+ tab: t52,
1677
+ getRulesOptions,
1678
+ handleToolSelect: t62,
1679
+ ...t72
1680
+ } = t0;
1681
+ tab = t52;
1682
+ handleToolSelect = t62;
1683
+ rulesProps = t72;
1684
+ T1 = ThemedBox_default;
1685
+ t2 = "column";
1686
+ t3 = tab === "allow" ? 0 : undefined;
1687
+ let t8;
1688
+ if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
1689
+ t8 = {
1690
+ allow: "Open CC won't ask before using allowed tools.",
1691
+ ask: "Open CC will always ask for confirmation before using these tools.",
1692
+ deny: "Open CC will always reject requests to use denied tools."
1693
+ };
1694
+ $[10] = t8;
1695
+ } else {
1696
+ t8 = $[10];
1697
+ }
1698
+ const t9 = t8[tab];
1699
+ if ($[11] !== t9) {
1700
+ t4 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1701
+ children: t9
1702
+ }, undefined, false, undefined, this);
1703
+ $[11] = t9;
1704
+ $[12] = t4;
1705
+ } else {
1706
+ t4 = $[12];
1707
+ }
1708
+ T0 = RulesTabContent;
1709
+ t1 = getRulesOptions(tab, rulesProps.searchQuery);
1710
+ $[0] = t0;
1711
+ $[1] = T0;
1712
+ $[2] = T1;
1713
+ $[3] = handleToolSelect;
1714
+ $[4] = rulesProps;
1715
+ $[5] = t1;
1716
+ $[6] = t2;
1717
+ $[7] = t3;
1718
+ $[8] = t4;
1719
+ $[9] = tab;
1720
+ } else {
1721
+ T0 = $[1];
1722
+ T1 = $[2];
1723
+ handleToolSelect = $[3];
1724
+ rulesProps = $[4];
1725
+ t1 = $[5];
1726
+ t2 = $[6];
1727
+ t3 = $[7];
1728
+ t4 = $[8];
1729
+ tab = $[9];
1730
+ }
1731
+ let t5;
1732
+ if ($[13] !== handleToolSelect || $[14] !== tab) {
1733
+ t5 = (v) => handleToolSelect(v, tab);
1734
+ $[13] = handleToolSelect;
1735
+ $[14] = tab;
1736
+ $[15] = t5;
1737
+ } else {
1738
+ t5 = $[15];
1739
+ }
1740
+ let t6;
1741
+ if ($[16] !== T0 || $[17] !== rulesProps || $[18] !== t1.options || $[19] !== t5) {
1742
+ t6 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(T0, {
1743
+ options: t1.options,
1744
+ onSelect: t5,
1745
+ ...rulesProps
1746
+ }, undefined, false, undefined, this);
1747
+ $[16] = T0;
1748
+ $[17] = rulesProps;
1749
+ $[18] = t1.options;
1750
+ $[19] = t5;
1751
+ $[20] = t6;
1752
+ } else {
1753
+ t6 = $[20];
1754
+ }
1755
+ let t7;
1756
+ if ($[21] !== T1 || $[22] !== t2 || $[23] !== t3 || $[24] !== t4 || $[25] !== t6) {
1757
+ t7 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(T1, {
1758
+ flexDirection: t2,
1759
+ flexShrink: t3,
1760
+ children: [
1761
+ t4,
1762
+ t6
1763
+ ]
1764
+ }, undefined, true, undefined, this);
1765
+ $[21] = T1;
1766
+ $[22] = t2;
1767
+ $[23] = t3;
1768
+ $[24] = t4;
1769
+ $[25] = t6;
1770
+ $[26] = t7;
1771
+ } else {
1772
+ t7 = $[26];
1773
+ }
1774
+ return t7;
1775
+ }
1776
+ function PermissionRuleList(t0) {
1777
+ const $ = import_compiler_runtime7.c(113);
1778
+ const {
1779
+ onExit,
1780
+ initialTab,
1781
+ onRetryDenials
1782
+ } = t0;
1783
+ let t1;
1784
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
1785
+ t1 = getAutoModeDenials();
1786
+ $[0] = t1;
1787
+ } else {
1788
+ t1 = $[0];
1789
+ }
1790
+ const hasDenials = t1.length > 0;
1791
+ const defaultTab = initialTab ?? (hasDenials ? "recent" : "allow");
1792
+ let t2;
1793
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
1794
+ t2 = [];
1795
+ $[1] = t2;
1796
+ } else {
1797
+ t2 = $[1];
1798
+ }
1799
+ const [changes, setChanges] = import_react4.useState(t2);
1800
+ const toolPermissionContext = useAppState(_temp7);
1801
+ const setAppState = useSetAppState();
1802
+ const isTerminalFocused = useTerminalFocus();
1803
+ let t3;
1804
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
1805
+ t3 = {
1806
+ approved: new Set,
1807
+ retry: new Set,
1808
+ denials: []
1809
+ };
1810
+ $[2] = t3;
1811
+ } else {
1812
+ t3 = $[2];
1813
+ }
1814
+ const denialStateRef = import_react4.useRef(t3);
1815
+ let t4;
1816
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
1817
+ t4 = (s_0) => {
1818
+ denialStateRef.current = s_0;
1819
+ };
1820
+ $[3] = t4;
1821
+ } else {
1822
+ t4 = $[3];
1823
+ }
1824
+ const handleDenialStateChange = t4;
1825
+ const [selectedRule, setSelectedRule] = import_react4.useState();
1826
+ const [lastFocusedRuleKey, setLastFocusedRuleKey] = import_react4.useState();
1827
+ const [addingRuleToTab, setAddingRuleToTab] = import_react4.useState(null);
1828
+ const [validatedRule, setValidatedRule] = import_react4.useState(null);
1829
+ const [isAddingWorkspaceDirectory, setIsAddingWorkspaceDirectory] = import_react4.useState(false);
1830
+ const [removingDirectory, setRemovingDirectory] = import_react4.useState(null);
1831
+ const [isSearchMode, setIsSearchMode] = import_react4.useState(false);
1832
+ const [headerFocused, setHeaderFocused] = import_react4.useState(true);
1833
+ let t5;
1834
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
1835
+ t5 = (focused) => {
1836
+ setHeaderFocused(focused);
1837
+ };
1838
+ $[4] = t5;
1839
+ } else {
1840
+ t5 = $[4];
1841
+ }
1842
+ const handleHeaderFocusChange = t5;
1843
+ let map;
1844
+ if ($[5] !== toolPermissionContext) {
1845
+ map = new Map;
1846
+ getAllowRules(toolPermissionContext).forEach((rule) => {
1847
+ map.set(jsonStringify(rule), rule);
1848
+ });
1849
+ $[5] = toolPermissionContext;
1850
+ $[6] = map;
1851
+ } else {
1852
+ map = $[6];
1853
+ }
1854
+ const allowRulesByKey = map;
1855
+ let map_0;
1856
+ if ($[7] !== toolPermissionContext) {
1857
+ map_0 = new Map;
1858
+ getDenyRules(toolPermissionContext).forEach((rule_0) => {
1859
+ map_0.set(jsonStringify(rule_0), rule_0);
1860
+ });
1861
+ $[7] = toolPermissionContext;
1862
+ $[8] = map_0;
1863
+ } else {
1864
+ map_0 = $[8];
1865
+ }
1866
+ const denyRulesByKey = map_0;
1867
+ let map_1;
1868
+ if ($[9] !== toolPermissionContext) {
1869
+ map_1 = new Map;
1870
+ getAskRules(toolPermissionContext).forEach((rule_1) => {
1871
+ map_1.set(jsonStringify(rule_1), rule_1);
1872
+ });
1873
+ $[9] = toolPermissionContext;
1874
+ $[10] = map_1;
1875
+ } else {
1876
+ map_1 = $[10];
1877
+ }
1878
+ const askRulesByKey = map_1;
1879
+ let t6;
1880
+ if ($[11] !== allowRulesByKey || $[12] !== askRulesByKey || $[13] !== denyRulesByKey) {
1881
+ t6 = (tab, t72) => {
1882
+ const query = t72 === undefined ? "" : t72;
1883
+ const rulesByKey = (() => {
1884
+ switch (tab) {
1885
+ case "allow": {
1886
+ return allowRulesByKey;
1887
+ }
1888
+ case "deny": {
1889
+ return denyRulesByKey;
1890
+ }
1891
+ case "ask": {
1892
+ return askRulesByKey;
1893
+ }
1894
+ case "workspace":
1895
+ case "recent": {
1896
+ return new Map;
1897
+ }
1898
+ }
1899
+ })();
1900
+ const options = [];
1901
+ if (tab !== "workspace" && tab !== "recent" && !query) {
1902
+ options.push({
1903
+ label: `Add a new rule${figures_default.ellipsis}`,
1904
+ value: "add-new-rule"
1905
+ });
1906
+ }
1907
+ const sortedRuleKeys = Array.from(rulesByKey.keys()).sort((a, b) => {
1908
+ const ruleA = rulesByKey.get(a);
1909
+ const ruleB = rulesByKey.get(b);
1910
+ if (ruleA && ruleB) {
1911
+ const ruleAString = permissionRuleValueToString(ruleA.ruleValue).toLowerCase();
1912
+ const ruleBString = permissionRuleValueToString(ruleB.ruleValue).toLowerCase();
1913
+ return ruleAString.localeCompare(ruleBString);
1914
+ }
1915
+ return 0;
1916
+ });
1917
+ const lowerQuery = query.toLowerCase();
1918
+ for (const ruleKey of sortedRuleKeys) {
1919
+ const rule_2 = rulesByKey.get(ruleKey);
1920
+ if (rule_2) {
1921
+ const ruleString = permissionRuleValueToString(rule_2.ruleValue);
1922
+ if (query && !ruleString.toLowerCase().includes(lowerQuery)) {
1923
+ continue;
1924
+ }
1925
+ options.push({
1926
+ label: ruleString,
1927
+ value: ruleKey
1928
+ });
1929
+ }
1930
+ }
1931
+ return {
1932
+ options,
1933
+ rulesByKey
1934
+ };
1935
+ };
1936
+ $[11] = allowRulesByKey;
1937
+ $[12] = askRulesByKey;
1938
+ $[13] = denyRulesByKey;
1939
+ $[14] = t6;
1940
+ } else {
1941
+ t6 = $[14];
1942
+ }
1943
+ const getRulesOptions = t6;
1944
+ const exitState = useExitOnCtrlCDWithKeybindings();
1945
+ const isSearchModeActive = !selectedRule && !addingRuleToTab && !validatedRule && !isAddingWorkspaceDirectory && !removingDirectory;
1946
+ const t7 = isSearchModeActive && isSearchMode;
1947
+ let t8;
1948
+ if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
1949
+ t8 = () => {
1950
+ setIsSearchMode(false);
1951
+ };
1952
+ $[15] = t8;
1953
+ } else {
1954
+ t8 = $[15];
1955
+ }
1956
+ let t9;
1957
+ if ($[16] !== t7) {
1958
+ t9 = {
1959
+ isActive: t7,
1960
+ onExit: t8
1961
+ };
1962
+ $[16] = t7;
1963
+ $[17] = t9;
1964
+ } else {
1965
+ t9 = $[17];
1966
+ }
1967
+ const {
1968
+ query: searchQuery,
1969
+ setQuery: setSearchQuery,
1970
+ cursorOffset: searchCursorOffset
1971
+ } = useSearchInput(t9);
1972
+ let t10;
1973
+ if ($[18] !== isSearchMode || $[19] !== isSearchModeActive || $[20] !== setSearchQuery) {
1974
+ t10 = (e) => {
1975
+ if (!isSearchModeActive) {
1976
+ return;
1977
+ }
1978
+ if (isSearchMode) {
1979
+ return;
1980
+ }
1981
+ if (e.ctrl || e.meta) {
1982
+ return;
1983
+ }
1984
+ if (e.key === "/") {
1985
+ e.preventDefault();
1986
+ setIsSearchMode(true);
1987
+ setSearchQuery("");
1988
+ } else {
1989
+ if (e.key.length === 1 && e.key !== "j" && e.key !== "k" && e.key !== "m" && e.key !== "i" && e.key !== "r" && e.key !== " ") {
1990
+ e.preventDefault();
1991
+ setIsSearchMode(true);
1992
+ setSearchQuery(e.key);
1993
+ }
1994
+ }
1995
+ };
1996
+ $[18] = isSearchMode;
1997
+ $[19] = isSearchModeActive;
1998
+ $[20] = setSearchQuery;
1999
+ $[21] = t10;
2000
+ } else {
2001
+ t10 = $[21];
2002
+ }
2003
+ const handleKeyDown = t10;
2004
+ let t11;
2005
+ if ($[22] !== getRulesOptions) {
2006
+ t11 = (selectedValue, tab_0) => {
2007
+ const {
2008
+ rulesByKey: rulesByKey_0
2009
+ } = getRulesOptions(tab_0);
2010
+ if (selectedValue === "add-new-rule") {
2011
+ setAddingRuleToTab(tab_0);
2012
+ return;
2013
+ } else {
2014
+ setSelectedRule(rulesByKey_0.get(selectedValue));
2015
+ return;
2016
+ }
2017
+ };
2018
+ $[22] = getRulesOptions;
2019
+ $[23] = t11;
2020
+ } else {
2021
+ t11 = $[23];
2022
+ }
2023
+ const handleToolSelect = t11;
2024
+ let t12;
2025
+ if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
2026
+ t12 = () => {
2027
+ setAddingRuleToTab(null);
2028
+ };
2029
+ $[24] = t12;
2030
+ } else {
2031
+ t12 = $[24];
2032
+ }
2033
+ const handleRuleInputCancel = t12;
2034
+ let t13;
2035
+ if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
2036
+ t13 = (ruleValue, ruleBehavior) => {
2037
+ setValidatedRule({
2038
+ ruleValue,
2039
+ ruleBehavior
2040
+ });
2041
+ setAddingRuleToTab(null);
2042
+ };
2043
+ $[25] = t13;
2044
+ } else {
2045
+ t13 = $[25];
2046
+ }
2047
+ const handleRuleInputSubmit = t13;
2048
+ let t14;
2049
+ if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
2050
+ t14 = (rules, unreachable) => {
2051
+ setValidatedRule(null);
2052
+ for (const rule_3 of rules) {
2053
+ setChanges((prev) => [...prev, `Added ${rule_3.ruleBehavior} rule ${source_default.bold(permissionRuleValueToString(rule_3.ruleValue))}`]);
2054
+ }
2055
+ if (unreachable && unreachable.length > 0) {
2056
+ for (const u of unreachable) {
2057
+ const severity = u.shadowType === "deny" ? "blocked" : "shadowed";
2058
+ setChanges((prev_0) => [...prev_0, source_default.yellow(`${figures_default.warning} Warning: ${permissionRuleValueToString(u.rule.ruleValue)} is ${severity}`), source_default.dim(` ${u.reason}`), source_default.dim(` Fix: ${u.fix}`)]);
2059
+ }
2060
+ }
2061
+ };
2062
+ $[26] = t14;
2063
+ } else {
2064
+ t14 = $[26];
2065
+ }
2066
+ const handleAddRulesSuccess = t14;
2067
+ let t15;
2068
+ if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
2069
+ t15 = () => {
2070
+ setValidatedRule(null);
2071
+ };
2072
+ $[27] = t15;
2073
+ } else {
2074
+ t15 = $[27];
2075
+ }
2076
+ const handleAddRuleCancel = t15;
2077
+ let t16;
2078
+ if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
2079
+ t16 = () => setIsAddingWorkspaceDirectory(true);
2080
+ $[28] = t16;
2081
+ } else {
2082
+ t16 = $[28];
2083
+ }
2084
+ const handleRequestAddDirectory = t16;
2085
+ let t17;
2086
+ if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
2087
+ t17 = (path) => setRemovingDirectory(path);
2088
+ $[29] = t17;
2089
+ } else {
2090
+ t17 = $[29];
2091
+ }
2092
+ const handleRequestRemoveDirectory = t17;
2093
+ let t18;
2094
+ if ($[30] !== changes || $[31] !== onExit || $[32] !== onRetryDenials) {
2095
+ t18 = () => {
2096
+ const s_1 = denialStateRef.current;
2097
+ const denialsFor = (set) => Array.from(set).map((idx) => s_1.denials[idx]).filter(_temp23);
2098
+ const retryDenials = denialsFor(s_1.retry);
2099
+ if (retryDenials.length > 0) {
2100
+ const commands = retryDenials.map(_temp32);
2101
+ onRetryDenials?.(commands);
2102
+ onExit(undefined, {
2103
+ shouldQuery: true,
2104
+ metaMessages: [`Permission granted for: ${commands.join(", ")}. You may now retry ${commands.length === 1 ? "this command" : "these commands"} if you would like.`]
2105
+ });
2106
+ return;
2107
+ }
2108
+ const approvedDenials = denialsFor(s_1.approved);
2109
+ if (approvedDenials.length > 0 || changes.length > 0) {
2110
+ const approvedMsg = approvedDenials.length > 0 ? [`Approved ${approvedDenials.map(_temp42).join(", ")}`] : [];
2111
+ onExit([...approvedMsg, ...changes].join(`
2112
+ `));
2113
+ } else {
2114
+ onExit("Permissions dialog dismissed", {
2115
+ display: "system"
2116
+ });
2117
+ }
2118
+ };
2119
+ $[30] = changes;
2120
+ $[31] = onExit;
2121
+ $[32] = onRetryDenials;
2122
+ $[33] = t18;
2123
+ } else {
2124
+ t18 = $[33];
2125
+ }
2126
+ const handleRulesCancel = t18;
2127
+ const t19 = isSearchModeActive && !isSearchMode;
2128
+ let t20;
2129
+ if ($[34] !== t19) {
2130
+ t20 = {
2131
+ context: "Settings",
2132
+ isActive: t19
2133
+ };
2134
+ $[34] = t19;
2135
+ $[35] = t20;
2136
+ } else {
2137
+ t20 = $[35];
2138
+ }
2139
+ useKeybinding("confirm:no", handleRulesCancel, t20);
2140
+ let t21;
2141
+ if ($[36] !== getRulesOptions || $[37] !== selectedRule || $[38] !== setAppState || $[39] !== toolPermissionContext) {
2142
+ t21 = () => {
2143
+ if (!selectedRule) {
2144
+ return;
2145
+ }
2146
+ const {
2147
+ options: options_0
2148
+ } = getRulesOptions(selectedRule.ruleBehavior);
2149
+ const selectedKey = jsonStringify(selectedRule);
2150
+ const ruleKeys = options_0.filter(_temp5).map(_temp62);
2151
+ const currentIndex = ruleKeys.indexOf(selectedKey);
2152
+ let nextFocusKey;
2153
+ if (currentIndex !== -1) {
2154
+ if (currentIndex < ruleKeys.length - 1) {
2155
+ nextFocusKey = ruleKeys[currentIndex + 1];
2156
+ } else {
2157
+ if (currentIndex > 0) {
2158
+ nextFocusKey = ruleKeys[currentIndex - 1];
2159
+ }
2160
+ }
2161
+ }
2162
+ setLastFocusedRuleKey(nextFocusKey);
2163
+ deletePermissionRule({
2164
+ rule: selectedRule,
2165
+ initialContext: toolPermissionContext,
2166
+ setToolPermissionContext(toolPermissionContext_0) {
2167
+ setAppState((prev_1) => ({
2168
+ ...prev_1,
2169
+ toolPermissionContext: toolPermissionContext_0
2170
+ }));
2171
+ }
2172
+ });
2173
+ setChanges((prev_2) => [...prev_2, `Deleted ${selectedRule.ruleBehavior} rule ${source_default.bold(permissionRuleValueToString(selectedRule.ruleValue))}`]);
2174
+ setSelectedRule(undefined);
2175
+ };
2176
+ $[36] = getRulesOptions;
2177
+ $[37] = selectedRule;
2178
+ $[38] = setAppState;
2179
+ $[39] = toolPermissionContext;
2180
+ $[40] = t21;
2181
+ } else {
2182
+ t21 = $[40];
2183
+ }
2184
+ const handleDeleteRule = t21;
2185
+ if (selectedRule) {
2186
+ let t222;
2187
+ if ($[41] === Symbol.for("react.memo_cache_sentinel")) {
2188
+ t222 = () => setSelectedRule(undefined);
2189
+ $[41] = t222;
2190
+ } else {
2191
+ t222 = $[41];
2192
+ }
2193
+ let t232;
2194
+ if ($[42] !== handleDeleteRule || $[43] !== selectedRule) {
2195
+ t232 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(RuleDetails, {
2196
+ rule: selectedRule,
2197
+ onDelete: handleDeleteRule,
2198
+ onCancel: t222
2199
+ }, undefined, false, undefined, this);
2200
+ $[42] = handleDeleteRule;
2201
+ $[43] = selectedRule;
2202
+ $[44] = t232;
2203
+ } else {
2204
+ t232 = $[44];
2205
+ }
2206
+ return t232;
2207
+ }
2208
+ if (addingRuleToTab && addingRuleToTab !== "workspace" && addingRuleToTab !== "recent") {
2209
+ let t222;
2210
+ if ($[45] !== addingRuleToTab) {
2211
+ t222 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(PermissionRuleInput, {
2212
+ onCancel: handleRuleInputCancel,
2213
+ onSubmit: handleRuleInputSubmit,
2214
+ ruleBehavior: addingRuleToTab
2215
+ }, undefined, false, undefined, this);
2216
+ $[45] = addingRuleToTab;
2217
+ $[46] = t222;
2218
+ } else {
2219
+ t222 = $[46];
2220
+ }
2221
+ return t222;
2222
+ }
2223
+ if (validatedRule) {
2224
+ let t222;
2225
+ if ($[47] !== validatedRule.ruleValue) {
2226
+ t222 = [validatedRule.ruleValue];
2227
+ $[47] = validatedRule.ruleValue;
2228
+ $[48] = t222;
2229
+ } else {
2230
+ t222 = $[48];
2231
+ }
2232
+ let t232;
2233
+ if ($[49] !== setAppState) {
2234
+ t232 = (toolPermissionContext_1) => {
2235
+ setAppState((prev_3) => ({
2236
+ ...prev_3,
2237
+ toolPermissionContext: toolPermissionContext_1
2238
+ }));
2239
+ };
2240
+ $[49] = setAppState;
2241
+ $[50] = t232;
2242
+ } else {
2243
+ t232 = $[50];
2244
+ }
2245
+ let t242;
2246
+ if ($[51] !== t222 || $[52] !== t232 || $[53] !== toolPermissionContext || $[54] !== validatedRule.ruleBehavior) {
2247
+ t242 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(AddPermissionRules, {
2248
+ onAddRules: handleAddRulesSuccess,
2249
+ onCancel: handleAddRuleCancel,
2250
+ ruleValues: t222,
2251
+ ruleBehavior: validatedRule.ruleBehavior,
2252
+ initialContext: toolPermissionContext,
2253
+ setToolPermissionContext: t232
2254
+ }, undefined, false, undefined, this);
2255
+ $[51] = t222;
2256
+ $[52] = t232;
2257
+ $[53] = toolPermissionContext;
2258
+ $[54] = validatedRule.ruleBehavior;
2259
+ $[55] = t242;
2260
+ } else {
2261
+ t242 = $[55];
2262
+ }
2263
+ return t242;
2264
+ }
2265
+ if (isAddingWorkspaceDirectory) {
2266
+ let t222;
2267
+ if ($[56] !== setAppState || $[57] !== toolPermissionContext) {
2268
+ t222 = (path_0, remember) => {
2269
+ const destination = remember ? "localSettings" : "session";
2270
+ const permissionUpdate = {
2271
+ type: "addDirectories",
2272
+ directories: [path_0],
2273
+ destination
2274
+ };
2275
+ const updatedContext = applyPermissionUpdate(toolPermissionContext, permissionUpdate);
2276
+ setAppState((prev_4) => ({
2277
+ ...prev_4,
2278
+ toolPermissionContext: updatedContext
2279
+ }));
2280
+ if (remember) {
2281
+ persistPermissionUpdate(permissionUpdate);
2282
+ }
2283
+ setChanges((prev_5) => [...prev_5, `Added directory ${source_default.bold(path_0)} to workspace${remember ? " and saved to local settings" : " for this session"}`]);
2284
+ setIsAddingWorkspaceDirectory(false);
2285
+ };
2286
+ $[56] = setAppState;
2287
+ $[57] = toolPermissionContext;
2288
+ $[58] = t222;
2289
+ } else {
2290
+ t222 = $[58];
2291
+ }
2292
+ let t232;
2293
+ if ($[59] === Symbol.for("react.memo_cache_sentinel")) {
2294
+ t232 = () => setIsAddingWorkspaceDirectory(false);
2295
+ $[59] = t232;
2296
+ } else {
2297
+ t232 = $[59];
2298
+ }
2299
+ let t242;
2300
+ if ($[60] !== t222 || $[61] !== toolPermissionContext) {
2301
+ t242 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(AddWorkspaceDirectory, {
2302
+ onAddDirectory: t222,
2303
+ onCancel: t232,
2304
+ permissionContext: toolPermissionContext
2305
+ }, undefined, false, undefined, this);
2306
+ $[60] = t222;
2307
+ $[61] = toolPermissionContext;
2308
+ $[62] = t242;
2309
+ } else {
2310
+ t242 = $[62];
2311
+ }
2312
+ return t242;
2313
+ }
2314
+ if (removingDirectory) {
2315
+ let t222;
2316
+ if ($[63] !== removingDirectory) {
2317
+ t222 = () => {
2318
+ setChanges((prev_6) => [...prev_6, `Removed directory ${source_default.bold(removingDirectory)} from workspace`]);
2319
+ setRemovingDirectory(null);
2320
+ };
2321
+ $[63] = removingDirectory;
2322
+ $[64] = t222;
2323
+ } else {
2324
+ t222 = $[64];
2325
+ }
2326
+ let t232;
2327
+ if ($[65] === Symbol.for("react.memo_cache_sentinel")) {
2328
+ t232 = () => setRemovingDirectory(null);
2329
+ $[65] = t232;
2330
+ } else {
2331
+ t232 = $[65];
2332
+ }
2333
+ let t242;
2334
+ if ($[66] !== setAppState) {
2335
+ t242 = (toolPermissionContext_2) => {
2336
+ setAppState((prev_7) => ({
2337
+ ...prev_7,
2338
+ toolPermissionContext: toolPermissionContext_2
2339
+ }));
2340
+ };
2341
+ $[66] = setAppState;
2342
+ $[67] = t242;
2343
+ } else {
2344
+ t242 = $[67];
2345
+ }
2346
+ let t252;
2347
+ if ($[68] !== removingDirectory || $[69] !== t222 || $[70] !== t242 || $[71] !== toolPermissionContext) {
2348
+ t252 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(RemoveWorkspaceDirectory, {
2349
+ directoryPath: removingDirectory,
2350
+ onRemove: t222,
2351
+ onCancel: t232,
2352
+ permissionContext: toolPermissionContext,
2353
+ setPermissionContext: t242
2354
+ }, undefined, false, undefined, this);
2355
+ $[68] = removingDirectory;
2356
+ $[69] = t222;
2357
+ $[70] = t242;
2358
+ $[71] = toolPermissionContext;
2359
+ $[72] = t252;
2360
+ } else {
2361
+ t252 = $[72];
2362
+ }
2363
+ return t252;
2364
+ }
2365
+ let t22;
2366
+ if ($[73] !== getRulesOptions || $[74] !== handleRulesCancel || $[75] !== handleToolSelect || $[76] !== isSearchMode || $[77] !== isTerminalFocused || $[78] !== lastFocusedRuleKey || $[79] !== searchCursorOffset || $[80] !== searchQuery) {
2367
+ t22 = {
2368
+ searchQuery,
2369
+ isSearchMode,
2370
+ isFocused: isTerminalFocused,
2371
+ onCancel: handleRulesCancel,
2372
+ lastFocusedRuleKey,
2373
+ cursorOffset: searchCursorOffset,
2374
+ getRulesOptions,
2375
+ handleToolSelect,
2376
+ onHeaderFocusChange: handleHeaderFocusChange
2377
+ };
2378
+ $[73] = getRulesOptions;
2379
+ $[74] = handleRulesCancel;
2380
+ $[75] = handleToolSelect;
2381
+ $[76] = isSearchMode;
2382
+ $[77] = isTerminalFocused;
2383
+ $[78] = lastFocusedRuleKey;
2384
+ $[79] = searchCursorOffset;
2385
+ $[80] = searchQuery;
2386
+ $[81] = t22;
2387
+ } else {
2388
+ t22 = $[81];
2389
+ }
2390
+ const sharedRulesProps = t22;
2391
+ const isHidden = !!selectedRule || !!addingRuleToTab || !!validatedRule || isAddingWorkspaceDirectory || !!removingDirectory;
2392
+ const t23 = !isSearchMode;
2393
+ let t24;
2394
+ if ($[82] === Symbol.for("react.memo_cache_sentinel")) {
2395
+ t24 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Tab, {
2396
+ id: "recent",
2397
+ title: "Recently denied",
2398
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(RecentDenialsTab, {
2399
+ onHeaderFocusChange: handleHeaderFocusChange,
2400
+ onStateChange: handleDenialStateChange
2401
+ }, undefined, false, undefined, this)
2402
+ }, undefined, false, undefined, this);
2403
+ $[82] = t24;
2404
+ } else {
2405
+ t24 = $[82];
2406
+ }
2407
+ let t25;
2408
+ if ($[83] !== sharedRulesProps) {
2409
+ t25 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Tab, {
2410
+ id: "allow",
2411
+ title: "Allow",
2412
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(PermissionRulesTab, {
2413
+ tab: "allow",
2414
+ ...sharedRulesProps
2415
+ }, undefined, false, undefined, this)
2416
+ }, undefined, false, undefined, this);
2417
+ $[83] = sharedRulesProps;
2418
+ $[84] = t25;
2419
+ } else {
2420
+ t25 = $[84];
2421
+ }
2422
+ let t26;
2423
+ if ($[85] !== sharedRulesProps) {
2424
+ t26 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Tab, {
2425
+ id: "ask",
2426
+ title: "Ask",
2427
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(PermissionRulesTab, {
2428
+ tab: "ask",
2429
+ ...sharedRulesProps
2430
+ }, undefined, false, undefined, this)
2431
+ }, undefined, false, undefined, this);
2432
+ $[85] = sharedRulesProps;
2433
+ $[86] = t26;
2434
+ } else {
2435
+ t26 = $[86];
2436
+ }
2437
+ let t27;
2438
+ if ($[87] !== sharedRulesProps) {
2439
+ t27 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Tab, {
2440
+ id: "deny",
2441
+ title: "Deny",
2442
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(PermissionRulesTab, {
2443
+ tab: "deny",
2444
+ ...sharedRulesProps
2445
+ }, undefined, false, undefined, this)
2446
+ }, undefined, false, undefined, this);
2447
+ $[87] = sharedRulesProps;
2448
+ $[88] = t27;
2449
+ } else {
2450
+ t27 = $[88];
2451
+ }
2452
+ let t28;
2453
+ if ($[89] === Symbol.for("react.memo_cache_sentinel")) {
2454
+ t28 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
2455
+ children: "Open CC can read files in the workspace, and make edits when auto-accept edits is on."
2456
+ }, undefined, false, undefined, this);
2457
+ $[89] = t28;
2458
+ } else {
2459
+ t28 = $[89];
2460
+ }
2461
+ let t29;
2462
+ if ($[90] !== onExit || $[91] !== toolPermissionContext) {
2463
+ t29 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Tab, {
2464
+ id: "workspace",
2465
+ title: "Workspace",
2466
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
2467
+ flexDirection: "column",
2468
+ children: [
2469
+ t28,
2470
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(WorkspaceTab, {
2471
+ onExit,
2472
+ toolPermissionContext,
2473
+ onRequestAddDirectory: handleRequestAddDirectory,
2474
+ onRequestRemoveDirectory: handleRequestRemoveDirectory,
2475
+ onHeaderFocusChange: handleHeaderFocusChange
2476
+ }, undefined, false, undefined, this)
2477
+ ]
2478
+ }, undefined, true, undefined, this)
2479
+ }, undefined, false, undefined, this);
2480
+ $[90] = onExit;
2481
+ $[91] = toolPermissionContext;
2482
+ $[92] = t29;
2483
+ } else {
2484
+ t29 = $[92];
2485
+ }
2486
+ let t30;
2487
+ if ($[93] !== defaultTab || $[94] !== isHidden || $[95] !== t23 || $[96] !== t25 || $[97] !== t26 || $[98] !== t27 || $[99] !== t29) {
2488
+ t30 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Tabs, {
2489
+ title: "Permissions:",
2490
+ color: "permission",
2491
+ defaultTab,
2492
+ hidden: isHidden,
2493
+ initialHeaderFocused: !hasDenials,
2494
+ navFromContent: t23,
2495
+ children: [
2496
+ t24,
2497
+ t25,
2498
+ t26,
2499
+ t27,
2500
+ t29
2501
+ ]
2502
+ }, undefined, true, undefined, this);
2503
+ $[93] = defaultTab;
2504
+ $[94] = isHidden;
2505
+ $[95] = t23;
2506
+ $[96] = t25;
2507
+ $[97] = t26;
2508
+ $[98] = t27;
2509
+ $[99] = t29;
2510
+ $[100] = t30;
2511
+ } else {
2512
+ t30 = $[100];
2513
+ }
2514
+ let t31;
2515
+ if ($[101] !== defaultTab || $[102] !== exitState.keyName || $[103] !== exitState.pending || $[104] !== headerFocused || $[105] !== isSearchMode) {
2516
+ t31 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
2517
+ marginTop: 1,
2518
+ paddingLeft: 1,
2519
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
2520
+ dimColor: true,
2521
+ children: exitState.pending ? /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
2522
+ children: [
2523
+ "Press ",
2524
+ exitState.keyName,
2525
+ " again to exit"
2526
+ ]
2527
+ }, undefined, true, undefined, this) : headerFocused ? /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
2528
+ children: "\u2190/\u2192 tab switch \xB7 \u2193 return \xB7 Esc cancel"
2529
+ }, undefined, false, undefined, this) : isSearchMode ? /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
2530
+ children: "Type to filter \xB7 Enter/\u2193 select \xB7 \u2191 tabs \xB7 Esc clear"
2531
+ }, undefined, false, undefined, this) : hasDenials && defaultTab === "recent" ? /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
2532
+ children: "Enter approve \xB7 r retry \xB7 \u2191\u2193 navigate \xB7 \u2190/\u2192 switch \xB7 Esc cancel"
2533
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
2534
+ children: "\u2191\u2193 navigate \xB7 Enter select \xB7 Type to search \xB7 \u2190/\u2192 switch \xB7 Esc cancel"
2535
+ }, undefined, false, undefined, this)
2536
+ }, undefined, false, undefined, this)
2537
+ }, undefined, false, undefined, this);
2538
+ $[101] = defaultTab;
2539
+ $[102] = exitState.keyName;
2540
+ $[103] = exitState.pending;
2541
+ $[104] = headerFocused;
2542
+ $[105] = isSearchMode;
2543
+ $[106] = t31;
2544
+ } else {
2545
+ t31 = $[106];
2546
+ }
2547
+ let t32;
2548
+ if ($[107] !== t30 || $[108] !== t31) {
2549
+ t32 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Pane, {
2550
+ color: "permission",
2551
+ children: [
2552
+ t30,
2553
+ t31
2554
+ ]
2555
+ }, undefined, true, undefined, this);
2556
+ $[107] = t30;
2557
+ $[108] = t31;
2558
+ $[109] = t32;
2559
+ } else {
2560
+ t32 = $[109];
2561
+ }
2562
+ let t33;
2563
+ if ($[110] !== handleKeyDown || $[111] !== t32) {
2564
+ t33 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
2565
+ flexDirection: "column",
2566
+ onKeyDown: handleKeyDown,
2567
+ children: t32
2568
+ }, undefined, false, undefined, this);
2569
+ $[110] = handleKeyDown;
2570
+ $[111] = t32;
2571
+ $[112] = t33;
2572
+ } else {
2573
+ t33 = $[112];
2574
+ }
2575
+ return t33;
2576
+ }
2577
+ function _temp62(opt_0) {
2578
+ return opt_0.value;
2579
+ }
2580
+ function _temp5(opt) {
2581
+ return opt.value !== "add-new-rule";
2582
+ }
2583
+ function _temp42(d_1) {
2584
+ return source_default.bold(d_1.display);
2585
+ }
2586
+ function _temp32(d_0) {
2587
+ return d_0.display;
2588
+ }
2589
+ function _temp23(d) {
2590
+ return d !== undefined;
2591
+ }
2592
+ function _temp7(s) {
2593
+ return s.toolPermissionContext;
2594
+ }
2595
+ var import_compiler_runtime7, import_react4, jsx_dev_runtime7;
2596
+ var init_PermissionRuleList = __esm(() => {
2597
+ init_source();
2598
+ init_figures();
2599
+ init_AppState();
2600
+ init_PermissionUpdate();
2601
+ init_select();
2602
+ init_useExitOnCtrlCDWithKeybindings();
2603
+ init_useSearchInput();
2604
+ init_ink();
2605
+ init_useKeybinding();
2606
+ init_autoModeDenials();
2607
+ init_permissionRuleParser();
2608
+ init_permissions();
2609
+ init_slowOperations();
2610
+ init_Pane();
2611
+ init_Tabs();
2612
+ init_SearchBox();
2613
+ init_AddPermissionRules();
2614
+ init_AddWorkspaceDirectory();
2615
+ init_PermissionRuleDescription();
2616
+ init_PermissionRuleInput();
2617
+ init_RecentDenialsTab();
2618
+ init_RemoveWorkspaceDirectory();
2619
+ init_WorkspaceTab();
2620
+ import_compiler_runtime7 = __toESM(require_compiler_runtime(), 1);
2621
+ import_react4 = __toESM(require_react(), 1);
2622
+ jsx_dev_runtime7 = __toESM(require_jsx_dev_runtime(), 1);
2623
+ });
2624
+
2625
+ // src/commands/permissions/permissions.tsx
2626
+ var jsx_dev_runtime8, call = async (onDone, context) => {
2627
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(PermissionRuleList, {
2628
+ onExit: onDone,
2629
+ onRetryDenials: (commands) => {
2630
+ context.setMessages((prev) => [...prev, createPermissionRetryMessage(commands)]);
2631
+ }
2632
+ }, undefined, false, undefined, this);
2633
+ };
2634
+ var init_permissions2 = __esm(() => {
2635
+ init_PermissionRuleList();
2636
+ init_messages();
2637
+ jsx_dev_runtime8 = __toESM(require_jsx_dev_runtime(), 1);
2638
+ });
2639
+ init_permissions2();
2640
+
2641
+ export {
2642
+ call
2643
+ };