@maycombhq/atticus 2.0.0-beta.27.1 → 2.0.0-beta.28
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.
- package/dist/bin.js +3 -3
- package/dist/{chunk-N5DLB74D.js → chunk-22MCNFEB.js} +4 -4
- package/dist/{chunk-C5DY4R7R.js → chunk-25GG2NAU.js} +2 -2
- package/dist/{chunk-YAPVAYZN.js → chunk-2C3KACPH.js} +3 -3
- package/dist/{chunk-NNURP7VO.js → chunk-2D5YPHEF.js} +11 -11
- package/dist/{chunk-3CMGSQIA.js → chunk-2E3TK22H.js} +2 -2
- package/dist/{chunk-GZSOZYEP.js → chunk-2E725C6E.js} +2 -2
- package/dist/{chunk-AOQG37K4.js → chunk-2FJ2GBMY.js} +8 -2
- package/dist/{chunk-JF2HM2IF.js → chunk-2GP3OTVG.js} +3 -3
- package/dist/{chunk-QLT3WYTD.js → chunk-2Q5TFDLI.js} +3 -3
- package/dist/{chunk-JGR4X2UA.js → chunk-2YB35HY6.js} +19 -19
- package/dist/{chunk-7LOXUBRB.js → chunk-2Z2CIBGD.js} +11 -11
- package/dist/{chunk-ZNZYMUBK.js → chunk-32KKFIIP.js} +23 -23
- package/dist/{chunk-TPKDYSHO.js → chunk-3AZEQIXD.js} +9 -9
- package/dist/{chunk-MNOZDE6W.js → chunk-3BOKR3RU.js} +10 -10
- package/dist/chunk-3MKQXZWB.js +67 -0
- package/dist/{chunk-JRXFZB6J.js → chunk-3MXX45EF.js} +3 -3
- package/dist/{chunk-MA44TMTL.js → chunk-3STTGZFW.js} +1 -1
- package/dist/{chunk-P7H5WZH6.js → chunk-3URSPNDW.js} +6 -6
- package/dist/{chunk-6ESJWPR3.js → chunk-3YR2EYJP.js} +4 -4
- package/dist/{chunk-WNPGLGCJ.js → chunk-42CRNKOT.js} +1 -1
- package/dist/{chunk-2WPUSHB6.js → chunk-43DFUZ5J.js} +9 -9
- package/dist/{chunk-DDRTAEFZ.js → chunk-4BIG3Y3L.js} +7 -7
- package/dist/{chunk-PPKH6ULR.js → chunk-4EBXR37M.js} +1 -1
- package/dist/{chunk-SRIU7L4Z.js → chunk-4GR77BYQ.js} +11 -11
- package/dist/{chunk-66CMRGI2.js → chunk-4OITEXVX.js} +18 -18
- package/dist/{chunk-UGJSKAZ2.js → chunk-4PYY4TMT.js} +3 -3
- package/dist/{chunk-LH52QGNY.js → chunk-4QCR6HE3.js} +7 -7
- package/dist/{chunk-DNKYWTVZ.js → chunk-5DTLTADG.js} +14 -14
- package/dist/{chunk-INCFIDCB.js → chunk-5KRMFM3P.js} +1 -1
- package/dist/{chunk-O5BUMSB3.js → chunk-5PWXWUW3.js} +6 -6
- package/dist/{chunk-AQLDQK2M.js → chunk-5RCX7YFH.js} +3 -3
- package/dist/{chunk-7BOGXFZ3.js → chunk-5U4KA353.js} +7 -7
- package/dist/{chunk-MP7W6OKP.js → chunk-65VII57C.js} +12 -12
- package/dist/{chunk-EFDUC35B.js → chunk-665VDAU4.js} +2 -2
- package/dist/{chunk-3NGHSBVS.js → chunk-6D7HF6V4.js} +21 -21
- package/dist/{chunk-R7VX5BSP.js → chunk-6J4PQWNI.js} +12 -12
- package/dist/{chunk-MUXYUIBV.js → chunk-6LGI3LIF.js} +3 -3
- package/dist/{chunk-ZQZRNVNS.js → chunk-6LIHNYLJ.js} +20 -20
- package/dist/{chunk-UMIZYX3U.js → chunk-6RKZYQTL.js} +12 -12
- package/dist/chunk-6WIYOGDU.js +23 -0
- package/dist/{chunk-ZIAMPN7N.js → chunk-72FLXGSN.js} +3 -3
- package/dist/{chunk-USYDJY63.js → chunk-7CBLSYKC.js} +12 -12
- package/dist/{chunk-6DHGNY3O.js → chunk-7DMQXEKN.js} +12 -12
- package/dist/chunk-7GBVL7JC.js +51 -0
- package/dist/{chunk-FVT6LUOC.js → chunk-7IEQFI4L.js} +4 -4
- package/dist/{chunk-LAPVW2F6.js → chunk-7NU54VAT.js} +3 -3
- package/dist/{chunk-PVJZR4JB.js → chunk-7O22X554.js} +372 -37
- package/dist/{chunk-5CIW5RMP.js → chunk-7RBQP7PY.js} +3 -3
- package/dist/{chunk-VSED7FYC.js → chunk-7SJ7D6Q7.js} +4 -4
- package/dist/{chunk-XKWPEY4B.js → chunk-7SVS7PBB.js} +10 -10
- package/dist/{chunk-6MSACVCY.js → chunk-7T73PJED.js} +17 -17
- package/dist/{chunk-LCQIRCOT.js → chunk-A2PNCDY2.js} +5 -5
- package/dist/{chunk-ELZGWEK4.js → chunk-A5IJVTLL.js} +4 -4
- package/dist/{chunk-QXXEOH3A.js → chunk-ABY7IKHT.js} +3 -3
- package/dist/{chunk-MSNEGKI3.js → chunk-AGTB5CRY.js} +13 -11
- package/dist/{chunk-X5B7KYPD.js → chunk-AIM4ER32.js} +1 -1
- package/dist/{chunk-CLM5Z3R5.js → chunk-AKC5NKH6.js} +4 -4
- package/dist/{chunk-HNU4AQXB.js → chunk-AKMOH4JL.js} +17 -17
- package/dist/{chunk-OBQL7GX4.js → chunk-APVNK4WC.js} +23 -23
- package/dist/{chunk-5YX7MJWW.js → chunk-AQOFIHBO.js} +20 -20
- package/dist/{chunk-6OTGCKYH.js → chunk-AT7JJQGK.js} +6 -6
- package/dist/{chunk-2J2GMERV.js → chunk-ATMILKLM.js} +12 -12
- package/dist/{chunk-VVLWEM2Y.js → chunk-AWICXXAC.js} +4 -4
- package/dist/{chunk-QU3ENIJV.js → chunk-AY7Z2MFH.js} +22 -22
- package/dist/{chunk-PGAXZLNF.js → chunk-B23Z4Y25.js} +9 -9
- package/dist/{chunk-AHAEHBH5.js → chunk-B6N2QL5F.js} +7 -7
- package/dist/{chunk-YRHKEXTP.js → chunk-BCMXPM2J.js} +7 -7
- package/dist/{chunk-L4WFMAHI.js → chunk-BEDHU324.js} +11 -11
- package/dist/{chunk-QNXMVJMA.js → chunk-BJZ5BPJU.js} +4 -4
- package/dist/{chunk-FT55WYNB.js → chunk-BKHDWJYK.js} +18 -18
- package/dist/{chunk-3M3MDBOG.js → chunk-BPWOKVPJ.js} +1 -1
- package/dist/{chunk-3YL2GZZH.js → chunk-BULKZIYH.js} +20 -20
- package/dist/{chunk-4NPWOUI2.js → chunk-CBYJQD7C.js} +2 -2
- package/dist/{chunk-OUALZ5RA.js → chunk-CLH4QLIH.js} +1 -1
- package/dist/{chunk-W6OY2PMB.js → chunk-CP4KZA33.js} +6 -6
- package/dist/{chunk-V6BP4XHZ.js → chunk-CSP2VZQ2.js} +20 -20
- package/dist/{chunk-ORGB6645.js → chunk-CX7WKIUV.js} +12 -12
- package/dist/{chunk-4FLIW5PJ.js → chunk-CXGGT3LX.js} +1 -1
- package/dist/{chunk-Y6S7VCYN.js → chunk-CYPQ3PBB.js} +3 -3
- package/dist/{chunk-XZY4GTCX.js → chunk-D6GPG32H.js} +2 -2
- package/dist/{chunk-DTW37FJ6.js → chunk-D6WUJFQH.js} +12 -12
- package/dist/{chunk-UXETN43F.js → chunk-DEQGTRMM.js} +5 -5
- package/dist/{chunk-VWCNMDMZ.js → chunk-DJLVEPNP.js} +2 -2
- package/dist/{chunk-JD3QDLM2.js → chunk-DR2NZ2O6.js} +24 -24
- package/dist/{chunk-KOITA526.js → chunk-DSLVJKCF.js} +19 -19
- package/dist/{chunk-OOZKLLW7.js → chunk-DXSZXPFF.js} +23 -23
- package/dist/{chunk-GEHB2LMA.js → chunk-E2V7Z5PS.js} +26 -26
- package/dist/{chunk-YTPND655.js → chunk-E4AUZ5AC.js} +14 -14
- package/dist/{chunk-CPB4XMFI.js → chunk-E7O2WMDW.js} +5 -5
- package/dist/{chunk-DNDIT3LD.js → chunk-EC6YA766.js} +5 -5
- package/dist/{chunk-2AIOOA3U.js → chunk-EGHG6K65.js} +4 -4
- package/dist/{chunk-W5UMEIYG.js → chunk-ESOOGVOM.js} +17 -17
- package/dist/{chunk-ZT6GPGZ4.js → chunk-EVWTVCFN.js} +34 -34
- package/dist/{chunk-XRTECHVH.js → chunk-EXGL7CWI.js} +6 -6
- package/dist/{chunk-IPSZDVLI.js → chunk-FEJPEDDX.js} +4 -4
- package/dist/{chunk-BUBKKEUV.js → chunk-FHTOS6DU.js} +2 -2
- package/dist/{chunk-LP6BFBE5.js → chunk-FIYGZJF6.js} +4 -4
- package/dist/{chunk-NNRQZUVW.js → chunk-FJ6YX4K2.js} +22 -22
- package/dist/{chunk-I57IH5X6.js → chunk-FRSDREKQ.js} +1 -1
- package/dist/{chunk-LKLB5IJ7.js → chunk-FUKL7PUS.js} +4 -4
- package/dist/{chunk-U36V664P.js → chunk-G4USCLYQ.js} +87 -42
- package/dist/{chunk-5KR2DHDW.js → chunk-G5CXRFI5.js} +14 -14
- package/dist/{chunk-MBIJNU3D.js → chunk-G5ZQLW5K.js} +500 -369
- package/dist/{chunk-OILAH2C7.js → chunk-GAACSJWG.js} +17 -17
- package/dist/{chunk-44XGOSUU.js → chunk-GCT6HBIU.js} +4 -4
- package/dist/{chunk-CHS5BJ34.js → chunk-GGCRLU4L.js} +3 -3
- package/dist/{chunk-S6TLXRBR.js → chunk-GNY4LOHN.js} +3 -3
- package/dist/{chunk-VTQ55N4O.js → chunk-GOB2TYE5.js} +14 -14
- package/dist/{chunk-UDM7LXNJ.js → chunk-H4JC4U44.js} +3 -3
- package/dist/{chunk-I4P72R2F.js → chunk-H7BHL2KV.js} +21 -21
- package/dist/{chunk-J4L64TUA.js → chunk-HBBMRFSQ.js} +25 -25
- package/dist/{chunk-RDFRB26Z.js → chunk-HBRMXFMC.js} +3 -3
- package/dist/chunk-HBWRKIJI.js +68 -0
- package/dist/{chunk-OUGTAOGA.js → chunk-HE4O7PLD.js} +1 -1
- package/dist/{chunk-HOEZQRZU.js → chunk-HPKQIRQR.js} +5 -5
- package/dist/{chunk-XIIT4PVT.js → chunk-HQG5AGT2.js} +2 -2
- package/dist/{chunk-O6UC7ASJ.js → chunk-HWXEPWHW.js} +5 -5
- package/dist/{chunk-L3KSU4QU.js → chunk-HZ65CLTT.js} +8 -8
- package/dist/{chunk-FZ2K3IXP.js → chunk-HZPHNRHV.js} +23 -23
- package/dist/{chunk-SFCFL7Y5.js → chunk-I3ZJTM2T.js} +3 -1
- package/dist/{chunk-FADIWOA5.js → chunk-IEGOFWZC.js} +2 -2
- package/dist/{chunk-4BK5EJ2C.js → chunk-IQYR73ED.js} +6 -6
- package/dist/{chunk-DS2OZXBN.js → chunk-J3G3YZSE.js} +17 -17
- package/dist/{chunk-W4SWXJZQ.js → chunk-J5AJRTID.js} +14 -14
- package/dist/{chunk-QK3UFHFC.js → chunk-JCZSY5ZC.js} +1 -1
- package/dist/{chunk-2ANBMA74.js → chunk-JMU2NZ4W.js} +2 -2
- package/dist/{chunk-HDWVR5KD.js → chunk-JNAJH2KI.js} +1 -1
- package/dist/{chunk-DVQCYF3V.js → chunk-JQARUMXI.js} +2 -2
- package/dist/{chunk-Z245SJ64.js → chunk-JS2QR752.js} +20 -20
- package/dist/{chunk-D566V3T3.js → chunk-JTTTC5AI.js} +11 -11
- package/dist/{chunk-3PN7KJBA.js → chunk-JUY5VPJL.js} +19 -19
- package/dist/{chunk-JA7AUBHU.js → chunk-JZ5UJ5AM.js} +19 -19
- package/dist/{chunk-5GCCG3GJ.js → chunk-KIRQVVEQ.js} +2 -2
- package/dist/{chunk-SF3HXNXR.js → chunk-KLTHX4MU.js} +3 -3
- package/dist/{chunk-7GZ46N4V.js → chunk-KNHV3DEJ.js} +14 -14
- package/dist/{chunk-6GX3OFEZ.js → chunk-KOTDH7M2.js} +5 -5
- package/dist/{chunk-FBNJZ3VH.js → chunk-KS3XFDGF.js} +2 -2
- package/dist/{chunk-XRNMQZFC.js → chunk-L72673XW.js} +8 -8
- package/dist/{chunk-SKVLJL2E.js → chunk-LBLYKXFO.js} +23 -23
- package/dist/{chunk-LCWC6NDE.js → chunk-LD35W2PC.js} +3 -3
- package/dist/{chunk-TM2WY65Q.js → chunk-LD5YRRZW.js} +20 -20
- package/dist/{chunk-MA73J3E6.js → chunk-LDHTS4DI.js} +10 -10
- package/dist/{chunk-EHXEJFHD.js → chunk-LHSKJEIP.js} +2 -2
- package/dist/{chunk-SSYD4XIW.js → chunk-LQM2YZUX.js} +15 -15
- package/dist/{chunk-QPAANKUR.js → chunk-LSRKXZI4.js} +4 -4
- package/dist/{chunk-TRSNIJNM.js → chunk-LWCWGLLZ.js} +3 -3
- package/dist/{chunk-2FORECYK.js → chunk-LWUWPGQV.js} +6 -6
- package/dist/{chunk-VGXE7XFO.js → chunk-M4XMRGH3.js} +14 -14
- package/dist/{chunk-6VFR3DYS.js → chunk-M5RJE72K.js} +8 -8
- package/dist/{chunk-NK6JCNJX.js → chunk-M76MYSFZ.js} +16 -16
- package/dist/{chunk-6TXB2WR6.js → chunk-M7H7U62C.js} +4 -4
- package/dist/{chunk-BSGOUHL6.js → chunk-MBBWY2MA.js} +12 -12
- package/dist/{chunk-5YEUAZZE.js → chunk-MM2SZYPS.js} +4 -4
- package/dist/{chunk-3BQDBTQJ.js → chunk-MO6D2ZO6.js} +8 -8
- package/dist/{chunk-JOG5O2ZH.js → chunk-MUTSQOQ7.js} +11 -11
- package/dist/{chunk-GBJRFFDW.js → chunk-MVZYCDIX.js} +1 -1
- package/dist/{chunk-TMMGQBLO.js → chunk-MWEJAEX5.js} +15 -15
- package/dist/{chunk-3PBIZBWN.js → chunk-MZ2ITC2C.js} +1 -1
- package/dist/{chunk-HBHPOKL2.js → chunk-MZ7LTRE4.js} +4 -4
- package/dist/{chunk-AXJCABA5.js → chunk-N2IVTVXW.js} +5 -5
- package/dist/{chunk-YIGSUTW2.js → chunk-N5IGQQM4.js} +3 -3
- package/dist/{chunk-LTVOQJKT.js → chunk-NC6ET2OI.js} +3 -3
- package/dist/{chunk-S5O57P5P.js → chunk-NNRU2B3U.js} +13 -13
- package/dist/{chunk-NJ5IEZIG.js → chunk-NQFBTZWW.js} +7 -7
- package/dist/{chunk-TFN2N227.js → chunk-NT4SCIRT.js} +3 -3
- package/dist/{chunk-LQEMCF43.js → chunk-NTWOEULN.js} +12 -12
- package/dist/{chunk-NWAMUD7B.js → chunk-NWZPMZUR.js} +22 -22
- package/dist/{chunk-7HUCEHUK.js → chunk-O77FAGKZ.js} +12 -12
- package/dist/chunk-ODCC5CRP.js +62 -0
- package/dist/{chunk-YBAJ5SAR.js → chunk-OFHPXH3N.js} +4 -4
- package/dist/{chunk-OY2VC2IU.js → chunk-OHAMT5OA.js} +21 -21
- package/dist/{chunk-D3L5SO27.js → chunk-OJ7KHS4P.js} +2 -2
- package/dist/{chunk-I2NGDERG.js → chunk-OJE4JK45.js} +12 -12
- package/dist/{chunk-AZBP5DTU.js → chunk-OMGEHUXV.js} +9 -9
- package/dist/chunk-ON2W7SWK.js +60 -0
- package/dist/{chunk-VX5CORDG.js → chunk-OU35MAMV.js} +19 -19
- package/dist/{chunk-GF6GBHFN.js → chunk-OUVEXAM2.js} +7 -7
- package/dist/{chunk-G33UIUG3.js → chunk-OXDMFJHR.js} +2 -2
- package/dist/{chunk-W7NNZFIL.js → chunk-OZN3KT74.js} +15 -15
- package/dist/{chunk-RX2SMQV3.js → chunk-P37XFTBW.js} +14 -14
- package/dist/{chunk-JWIAVNEC.js → chunk-P6WPQQ5K.js} +15 -15
- package/dist/{chunk-KMBI6IQD.js → chunk-PEIGHDVC.js} +4 -4
- package/dist/{chunk-523NRKHF.js → chunk-PHXTGKLG.js} +2 -2
- package/dist/{chunk-Z5CIRZNO.js → chunk-PI5G43TD.js} +42 -42
- package/dist/{chunk-APYIIVBH.js → chunk-PKQJANRL.js} +31 -31
- package/dist/{chunk-Q7YDUGVZ.js → chunk-PL4EFATK.js} +1 -1
- package/dist/{chunk-CWKQRP6Y.js → chunk-PNU5SNYP.js} +23 -23
- package/dist/{chunk-QUFZDWPC.js → chunk-PTFOD2OZ.js} +4 -4
- package/dist/{chunk-R6KZWNZM.js → chunk-PUORKWTG.js} +27 -27
- package/dist/{chunk-UDM6HGF4.js → chunk-PXUNPXAB.js} +4 -4
- package/dist/{chunk-U4K34CXK.js → chunk-PZY4M3AZ.js} +16 -16
- package/dist/{chunk-5ZFLP2IK.js → chunk-Q2KK7SXF.js} +3 -3
- package/dist/{chunk-HUMM4S5I.js → chunk-QAKAUMAK.js} +3 -3
- package/dist/{chunk-WPZCSFND.js → chunk-QEODQXAV.js} +16 -16
- package/dist/{chunk-QQUAEM3U.js → chunk-QIUQHNEC.js} +22 -22
- package/dist/{chunk-TMETWJFO.js → chunk-QKDVSKSI.js} +7 -7
- package/dist/{chunk-PCIENCB7.js → chunk-QYK2G2YA.js} +12 -12
- package/dist/{chunk-6H62UHY5.js → chunk-QZIXAFV2.js} +109 -15
- package/dist/{chunk-QXSYFB5L.js → chunk-R3BSM6HV.js} +3 -3
- package/dist/{chunk-GZILYRGC.js → chunk-R5X4CNVG.js} +2 -2
- package/dist/{chunk-RZEYZOLW.js → chunk-RA5Y7WI7.js} +12 -12
- package/dist/{chunk-WTLFRINF.js → chunk-RGL7ZSJ7.js} +32 -32
- package/dist/{chunk-5PAIR73N.js → chunk-RIXLWV3X.js} +22 -22
- package/dist/{chunk-YHS7TSQS.js → chunk-RKDZ2LAO.js} +4 -4
- package/dist/{chunk-R7NPDUBL.js → chunk-RLGDSUJM.js} +12 -12
- package/dist/{chunk-RTHQIGGY.js → chunk-RUCNERM2.js} +23 -23
- package/dist/{chunk-RZYRUXSU.js → chunk-RV32IY7X.js} +1 -1
- package/dist/{chunk-BV7WB32T.js → chunk-RXCYV2QS.js} +22 -22
- package/dist/{chunk-HPCGQAYH.js → chunk-SFWTGHHU.js} +14 -14
- package/dist/{chunk-IDFUGYTS.js → chunk-SG4PMGZS.js} +12 -12
- package/dist/{chunk-AKZTCZ6F.js → chunk-SGFFO45X.js} +1 -1
- package/dist/{chunk-KZ5G3KEN.js → chunk-STJYW2X2.js} +3 -3
- package/dist/{chunk-YPXBGNUV.js → chunk-SU2JHMIS.js} +17 -17
- package/dist/{chunk-3PG6QOQF.js → chunk-T62FEOSG.js} +8 -8
- package/dist/{chunk-TQISA4VW.js → chunk-T7FFW2NN.js} +19 -19
- package/dist/{chunk-WJWSB65O.js → chunk-T7QW62TW.js} +204 -10
- package/dist/{chunk-WNRIL6JQ.js → chunk-TCHA7MWY.js} +12 -12
- package/dist/{chunk-IPMPLTEG.js → chunk-TCYVFE6T.js} +2 -2
- package/dist/{chunk-7SO6CGJH.js → chunk-TEESLG4C.js} +8 -8
- package/dist/{chunk-OY6H7JX6.js → chunk-TIQMGQPM.js} +3 -3
- package/dist/chunk-TQP6HR52.js +43 -0
- package/dist/{chunk-FYRBBFIF.js → chunk-TUYZSEKB.js} +4 -4
- package/dist/{chunk-4UVTNHA6.js → chunk-TYC6ILJ5.js} +1 -1
- package/dist/chunk-U25OIWWE.js +55 -0
- package/dist/{chunk-4HMOOBIR.js → chunk-U3SLTDOW.js} +10 -10
- package/dist/{chunk-ZW3OEHLT.js → chunk-UMP3TCNX.js} +25 -25
- package/dist/{chunk-OUDGBJC2.js → chunk-UZ45RC2L.js} +3 -3
- package/dist/{chunk-NWQ76YQ5.js → chunk-V44VIUP2.js} +16 -16
- package/dist/{chunk-SJ2Z3AWF.js → chunk-VEI22AS7.js} +2 -2
- package/dist/{chunk-M25UUEKC.js → chunk-VKBJ4JDV.js} +21 -21
- package/dist/{chunk-I5X4WU7U.js → chunk-VMNBSQIV.js} +2 -2
- package/dist/{chunk-TOSHT6NJ.js → chunk-VQKBO73Y.js} +6 -6
- package/dist/{chunk-DX7WEXYG.js → chunk-VQX2XXTI.js} +13 -13
- package/dist/{chunk-DGNTEKF6.js → chunk-VTE3MIWY.js} +119 -119
- package/dist/{chunk-YZUOOTC3.js → chunk-VX5WA6M2.js} +22 -22
- package/dist/{chunk-5A4FHGTI.js → chunk-W66GLVBI.js} +15 -15
- package/dist/{chunk-2MRYL45Z.js → chunk-W7U3NIUF.js} +102 -10
- package/dist/{chunk-CWJDZ5VP.js → chunk-WAEYJ6XE.js} +5 -5
- package/dist/{chunk-ELJ5Q4J2.js → chunk-WX2EYZTA.js} +2 -2
- package/dist/{chunk-FBG3QHOL.js → chunk-WZPPCEAK.js} +8 -8
- package/dist/{chunk-TUMHMISE.js → chunk-X3JAILX6.js} +18 -18
- package/dist/{chunk-V7DGFWDB.js → chunk-X4HPOZCJ.js} +22 -22
- package/dist/{chunk-J3ZUKQLV.js → chunk-XGOLAZSH.js} +4 -4
- package/dist/{chunk-3XNE6XXF.js → chunk-XLONNKSI.js} +4 -4
- package/dist/{chunk-ZOAX7W5S.js → chunk-XNZCTQ5C.js} +8 -8
- package/dist/{chunk-TLSL7OII.js → chunk-XPE3V7ZN.js} +7 -7
- package/dist/{chunk-B4WPO6FX.js → chunk-XSLFANKH.js} +12 -12
- package/dist/{chunk-LJEEVZIH.js → chunk-Y3AA4RZA.js} +12 -12
- package/dist/{chunk-SP5BWA5H.js → chunk-Y55ADAF3.js} +27 -27
- package/dist/chunk-YM2X57FO.js +157 -0
- package/dist/{chunk-GLNSLQSV.js → chunk-YRK6FTYB.js} +21 -21
- package/dist/{chunk-UEUPEUZX.js → chunk-YV75FKIY.js} +3 -3
- package/dist/{chunk-PT77IUYQ.js → chunk-Z56NN3AX.js} +19 -19
- package/dist/{chunk-EM6DKBTJ.js → chunk-ZBW2UO5M.js} +3 -3
- package/dist/{chunk-ZCARJ77R.js → chunk-ZGOQY4UB.js} +27 -27
- package/dist/{chunk-A3QZZEJA.js → chunk-ZHNZZ642.js} +63 -37
- package/dist/{chunk-NV5S63YK.js → chunk-ZLPTFC2O.js} +4 -4
- package/dist/{chunk-E7Q52EOO.js → chunk-ZLQQJBPF.js} +5 -5
- package/dist/{chunk-23OQZY5Z.js → chunk-ZUSKC4YT.js} +6 -6
- package/dist/{chunk-3TWERSTY.js → chunk-ZVCF5PBG.js} +11 -11
- package/dist/files.json +588 -580
- package/dist/fixtures/forge/slots/build.json +1 -1
- package/dist/packages/sdk/npm/index.js +144 -1
- package/dist/packages/ui/dist/assets/{elk-api-CPE6PVL8.js → elk-api-dCIOhvlC.js} +2 -2
- package/dist/packages/ui/dist/assets/index-B1Jr0xH8.js +63 -0
- package/dist/packages/ui/dist/assets/index-BqafgeqY.css +1 -0
- package/dist/packages/ui/dist/index.html +2 -2
- package/package.json +5 -5
- package/dist/chunk-CBFQO2F2.js +0 -62
- package/dist/chunk-EHT2KP5A.js +0 -43
- package/dist/chunk-FFIHRQ3O.js +0 -67
- package/dist/chunk-G4TFQ4EG.js +0 -60
- package/dist/chunk-MIKRDA2P.js +0 -68
- package/dist/chunk-RCPWEZD7.js +0 -47
- package/dist/chunk-WTGQJXRJ.js +0 -55
- package/dist/packages/ui/dist/assets/index-BYcVqj0l.js +0 -65
- package/dist/packages/ui/dist/assets/index-DF52Ejvz.css +0 -1
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),l=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ee(e,t){return D(e.type,t,e.props)}function te(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ne(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var O=/\/+/g;function re(e,t){return typeof e==`object`&&e&&e.key!=null?ne(``+e.key):t.toString(36)}function k(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function A(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,A(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+re(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(O,`$&/`)+`/`),A(o,r,i,``,function(e){return e})):o!=null&&(te(o)&&(o=ee(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(O,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+re(a,u),c+=A(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+re(a,u++),c+=A(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return A(k(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function ie(e,t,n){if(e==null)return e;var r=[],i=0;return A(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function j(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var ae=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function oe(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,ae)}catch(e){ae(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function se(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else oe(se.bind(null,e))}var ce={map:ie,forEach:function(e,t,n){ie(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ie(e,function(){t++}),t},toArray:function(e){return ie(e,function(e){return e})||[]},only:function(e){if(!te(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ce,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=se,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=te,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:j}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=oe,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.1`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,ee());else{var t=n(l);t!==null&&O(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&O(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?ee():S=!1}}}var ee;if(typeof y==`function`)ee=function(){y(D)};else if(typeof MessageChannel<`u`){var te=new MessageChannel,ne=te.port2;te.port1.onmessage=D,ee=function(){ne.postMessage(null)}}else ee=function(){_(D,0)};function O(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,O(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,ee()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=u(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=u(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.1`})),h=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}function m(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&m(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,ee=Symbol.for(`react.element`),te=Symbol.for(`react.transitional.element`),ne=Symbol.for(`react.portal`),O=Symbol.for(`react.fragment`),re=Symbol.for(`react.strict_mode`),k=Symbol.for(`react.profiler`),A=Symbol.for(`react.consumer`),ie=Symbol.for(`react.context`),j=Symbol.for(`react.forward_ref`),ae=Symbol.for(`react.suspense`),oe=Symbol.for(`react.suspense_list`),se=Symbol.for(`react.memo`),ce=Symbol.for(`react.lazy`),M=Symbol.for(`react.activity`),le=Symbol.for(`react.legacy_hidden`),ue=Symbol.for(`react.memo_cache_sentinel`),de=Symbol.for(`react.view_transition`),fe=Symbol.for(`react.recoverable`),pe=Symbol.iterator;function me(e){return typeof e!=`object`||!e?null:(e=pe&&e[pe]||e[`@@iterator`],typeof e==`function`?e:null)}var he=Symbol.for(`react.client.reference`);function ge(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===he?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case O:return`Fragment`;case k:return`Profiler`;case re:return`StrictMode`;case ae:return`Suspense`;case oe:return`SuspenseList`;case M:return`Activity`;case de:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case ne:return`Portal`;case ie:return e.displayName||`Context`;case A:return(e._context.displayName||`Context`)+`.Consumer`;case j:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case se:return t=e.displayName||null,t===null?ge(e.type)||`Memo`:t;case ce:t=e._payload,e=e._init;try{return ge(e(t))}catch{}}return null}var _e=Array.isArray,ve=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ye=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,be={pending:!1,data:null,method:null,action:null},xe=[],Se=-1;function Ce(e){return{current:e}}function we(e){0>Se||(e.current=xe[Se],xe[Se]=null,Se--)}function Te(e,t){Se++,xe[Se]=e.current,e.current=t}var Ee=Ce(null),De=Ce(null),Oe=Ce(null),ke=Ce(null);function Ae(e,t){switch(Te(Oe,t),Te(De,e),Te(Ee,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?bp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=bp(t),e=xp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}we(Ee),Te(Ee,e)}function je(){we(Ee),we(De),we(Oe)}function Me(e){var t=e.memoizedState;t!==null&&(_h._currentValue=t.memoizedState,Te(ke,e)),t=Ee.current;var n=xp(t,e.type);t!==n&&(Te(De,e),Te(Ee,n))}function Ne(e){De.current===e&&(we(Ee),we(De)),ke.current===e&&(we(ke),_h._currentValue=be)}var Pe,Fe;function Ie(e){if(Pe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Pe=t&&t[1]||``,Fe=-1<e.stack.indexOf(`
|
|
2
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
|
+
`+Pe+e+Fe}var Le=!1;function Re(e,t){if(!e||Le)return``;Le=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
4
|
+
`),l=s.split(`
|
|
5
|
+
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
6
|
+
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Le=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ie(n):``}function ze(e,t){switch(e.tag){case 26:case 27:case 5:return Ie(e.type);case 16:return Ie(`Lazy`);case 13:return e.child!==t&&t!==null?Ie(`Suspense Fallback`):Ie(`Suspense`);case 19:return Ie(`SuspenseList`);case 0:case 15:return Re(e.type,!1);case 11:return Re(e.type.render,!1);case 1:return Re(e.type,!0);case 31:return Ie(`Activity`);case 30:return Ie(`ViewTransition`);default:return``}}function Be(e){try{var t=``,n=null;do t+=ze(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
|
+
Error generating stack: `+e.message+`
|
|
8
|
+
`+e.stack}}var Ve=Object.prototype.hasOwnProperty,He=t.unstable_scheduleCallback,Ue=t.unstable_cancelCallback,We=t.unstable_shouldYield,Ge=t.unstable_requestPaint,Ke=t.unstable_now,qe=t.unstable_getCurrentPriorityLevel,Je=t.unstable_ImmediatePriority,Ye=t.unstable_UserBlockingPriority,N=t.unstable_NormalPriority,Xe=t.unstable_LowPriority,Ze=t.unstable_IdlePriority,Qe=t.log,$e=t.unstable_setDisableYieldValue,et=null,tt=null;function nt(e){if(typeof Qe==`function`&&$e(e),tt&&typeof tt.setStrictMode==`function`)try{tt.setStrictMode(et,e)}catch{}}var rt=Math.clz32?Math.clz32:ot,it=Math.log,at=Math.LN2;function ot(e){return e>>>=0,e===0?32:31-(it(e)/at|0)|0}var st=256,P=262144,ct=4194304;function lt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ut(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=lt(n))):i=lt(o):i=lt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=lt(n))):i=lt(o)):i=lt(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function dt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ft(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-rt(n),i=1<<r;t|=e[r],n&=~i}return t}function pt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function mt(){var e=ct;return ct<<=1,!(ct&62914560)&&(ct=4194304),e}function ht(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function gt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function _t(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-rt(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&vt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function vt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-rt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function yt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-rt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function bt(e,t){var n=t&-t;return n=n&42?1:xt(n),(n&(e.suspendedLanes|t))===0?n:0}function xt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function St(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Ct(){var e=ye.p;return e===0?(e=window.event,e===void 0?32:Nh(e.type)):e}function wt(e,t){var n=ye.p;try{return ye.p=e,t()}finally{ye.p=n}}var Tt=Math.random().toString(36).slice(2),Et=`__reactFiber$`+Tt,Dt=`__reactProps$`+Tt,Ot=`__reactContainer$`+Tt,kt=`__reactEvents$`+Tt,At=`__reactListeners$`+Tt,jt=`__reactHandles$`+Tt,F=`__reactResources$`+Tt,I=`__reactMarker$`+Tt,Mt=`__reactLoad$`+Tt;function Nt(e){delete e[Et],delete e[Dt],delete e[At],delete e[jt]}function Pt(e){var t;if(t=e[Et])return t;for(var n=e.parentNode;n;){if(t=n[Ot]||n[Et]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Sm(e);e!==null;){if(n=e[Et])return n;e=Sm(e)}return t}e=n,n=e.parentNode}return null}function Ft(e){if(e=e[Et]||e[Ot]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function It(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Lt(e){var t=e[F];return t||=e[F]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Rt(e){e[I]=!0}function zt(e){e[Mt]=void 0}var Bt=new Set,Vt={};function Ht(e,t){Ut(e,t),Ut(e+`Capture`,t)}function Ut(e,t){for(Vt[e]=t,e=0;e<t.length;e++)Bt.add(t[e])}var Wt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Gt={},Kt={};function qt(e){return Ve.call(Kt,e)?!0:Ve.call(Gt,e)?!1:Wt.test(e)?Kt[e]=!0:(Gt[e]=!0,!1)}var Jt=!1;function Yt(){var e=Jt;return Jt=!1,e}function Xt(e,t,n){if(qt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Zt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function Qt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function $t(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function en(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function tn(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function nn(e){if(!e._valueTracker){var t=en(e)?`checked`:`value`;e._valueTracker=tn(e,t,``+e[t])}}function rn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=en(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var an=/[\n"\\]/g;function on(e){return e.replace(an,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function sn(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+$t(t)):e.value!==``+$t(t)&&(e.value=``+$t(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):ln(e,$t(n)):o===`number`&&e.value==t?ln(e,$t(e.value)):ln(e,$t(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+$t(s):e.removeAttribute(`name`)}function cn(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){nn(e);return}n=n==null?``:``+$t(n),t=t==null?n:``+$t(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),nn(e)}function ln(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function un(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+$t(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function dn(e,t,n){t!=null&&(t=``+$t(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+$t(n)}function fn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(_e(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=$t(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),nn(e)}function pn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var mn=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function hn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||mn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function gn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,Jt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(hn(e,a,r),Jt=!0)}else for(var o in t)t.hasOwnProperty(o)&&hn(e,o,t[o])}function _n(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var vn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),yn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function bn(e){return yn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function xn(){}var Sn=null;function Cn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wn=null,Tn=null;function En(e){var t=Ft(e);if(t&&(e=t.stateNode)){var n=e[Dt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(sn(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+on(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[Dt]||null;if(!a)throw Error(i(90));sn(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&rn(r)}break a;case`textarea`:dn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&un(e,!!n.multiple,t,!1)}}}var Dn=!1;function On(e,t,n){if(Dn)return e(t,n);Dn=!0;try{return e(t)}finally{if(Dn=!1,(wn!==null||Tn!==null)&&(qd(),wn&&(t=wn,e=Tn,Tn=wn=null,En(t),e)))for(t=0;t<e.length;t++)En(e[t])}}function kn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Dt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var An=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,jn=!1;if(An)try{var Mn={};Object.defineProperty(Mn,"passive",{get:function(){jn=!0}}),window.addEventListener(`test`,Mn,Mn),window.removeEventListener(`test`,Mn,Mn)}catch{jn=!1}var Nn=null,Pn=null,Fn=null;function In(){if(Fn)return Fn;var e,t=Pn,n=t.length,r,i=`value`in Nn?Nn.value:Nn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Fn=i.slice(e,1<r?1-r:void 0)}function Ln(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Rn(){return!0}function zn(){return!1}function Bn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Rn:zn,this.isPropagationStopped=zn,this}return D(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Rn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Rn)},persist:function(){},isPersistent:Rn}),t}var Vn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hn=Bn(Vn),Un=D({},Vn,{view:0,detail:0}),Wn=Bn(Un),Gn,Kn,qn,Jn=D({},Un,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ar,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==qn&&(qn&&e.type===`mousemove`?(Gn=e.screenX-qn.screenX,Kn=e.screenY-qn.screenY):Kn=Gn=0,qn=e),Gn)},movementY:function(e){return`movementY`in e?e.movementY:Kn}}),Yn=Bn(Jn),Xn=Bn(D({},Jn,{dataTransfer:0})),Zn=Bn(D({},Un,{relatedTarget:0})),Qn=Bn(D({},Vn,{animationName:0,elapsedTime:0,pseudoElement:0})),$n=Bn(D({},Vn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),er=Bn(D({},Vn,{data:0})),tr={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},nr={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},rr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function ir(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=rr[e])?!!t[e]:!1}function ar(){return ir}var or=Bn(D({},Un,{key:function(e){if(e.key){var t=tr[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Ln(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?nr[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ar,charCode:function(e){return e.type===`keypress`?Ln(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Ln(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),sr=Bn(D({},Jn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),cr=Bn(D({},Vn,{submitter:0})),lr=Bn(D({},Un,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ar})),ur=Bn(D({},Vn,{propertyName:0,elapsedTime:0,pseudoElement:0})),dr=Bn(D({},Jn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),fr=Bn(D({},Vn,{newState:0,oldState:0,source:0})),pr=[9,13,27,32],mr=An&&`CompositionEvent`in window,hr=null;An&&`documentMode`in document&&(hr=document.documentMode);var gr=An&&`TextEvent`in window&&!hr,_r=An&&(!mr||hr&&8<hr&&11>=hr),vr=` `,yr=!1;function br(e,t){switch(e){case`keyup`:return pr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function xr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Sr=!1;function Cr(e,t){switch(e){case`compositionend`:return xr(t);case`keypress`:return t.which===32?(yr=!0,vr):null;case`textInput`:return e=t.data,e===vr&&yr?null:e;default:return null}}function wr(e,t){if(Sr)return e===`compositionend`||!mr&&br(e,t)?(e=In(),Fn=Pn=Nn=null,Sr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return _r&&t.locale!==`ko`?null:t.data;default:return null}}var Tr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Er(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Tr[e.type]:t===`textarea`}function Dr(e,t,n,r){wn?Tn?Tn.push(r):Tn=[r]:wn=r,t=rp(t,`onChange`),0<t.length&&(n=new Hn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Or=null,kr=null;function Ar(e){Yf(e,0)}function jr(e){if(rn(It(e)))return e}function Mr(e,t){if(e===`change`)return t}var Nr=!1;if(An){var Pr;if(An){var Fr=`oninput`in document;if(!Fr){var Ir=document.createElement(`div`);Ir.setAttribute(`oninput`,`return;`),Fr=typeof Ir.oninput==`function`}Pr=Fr}else Pr=!1;Nr=Pr&&(!document.documentMode||9<document.documentMode)}function Lr(){Or&&(Or.detachEvent(`onpropertychange`,Rr),kr=Or=null)}function Rr(e){if(e.propertyName===`value`&&jr(kr)){var t=[];Dr(t,kr,e,Cn(e)),On(Ar,t)}}function zr(e,t,n){e===`focusin`?(Lr(),Or=t,kr=n,Or.attachEvent(`onpropertychange`,Rr)):e===`focusout`&&Lr()}function Br(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return jr(kr)}function Vr(e,t){if(e===`click`)return jr(t)}function Hr(e,t){if(e===`input`||e===`change`)return jr(t)}function Ur(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Wr=typeof Object.is==`function`?Object.is:Ur;function Gr(e,t){if(Wr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Ve.call(t,i)||!Wr(e[i],t[i]))return!1}return!0}function Kr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function qr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Jr(e,t){var n=qr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=qr(n)}}function Yr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Yr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Xr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Kr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Kr(e.document)}return t}function Zr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Qr=An&&`documentMode`in document&&11>=document.documentMode,$r=null,ei=null,ti=null,ni=!1;function ri(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ni||$r==null||$r!==Kr(r)||(r=$r,`selectionStart`in r&&Zr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ti&&Gr(ti,r)||(ti=r,r=rp(ei,`onSelect`),0<r.length&&(t=new Hn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=$r)))}function ii(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ai={animationend:ii(`Animation`,`AnimationEnd`),animationiteration:ii(`Animation`,`AnimationIteration`),animationstart:ii(`Animation`,`AnimationStart`),transitionrun:ii(`Transition`,`TransitionRun`),transitionstart:ii(`Transition`,`TransitionStart`),transitioncancel:ii(`Transition`,`TransitionCancel`),transitionend:ii(`Transition`,`TransitionEnd`)},oi={},L={};An&&(L=document.createElement(`div`).style,`AnimationEvent`in window||(delete ai.animationend.animation,delete ai.animationiteration.animation,delete ai.animationstart.animation),`TransitionEvent`in window||delete ai.transitionend.transition);function si(e){if(oi[e])return oi[e];if(!ai[e])return e;var t=ai[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in L)return oi[e]=t[n];return e}var ci=si(`animationend`),li=si(`animationiteration`),ui=si(`animationstart`),di=si(`transitionrun`),fi=si(`transitionstart`),pi=si(`transitioncancel`),mi=si(`transitionend`),hi=new Map,gi=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);gi.push(`scrollEnd`);function _i(e,t){hi.set(e,t),Ht(t,[e])}var vi=0;function yi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Od.identifierPrefix;var n=vi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function bi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Id;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function xi(e,t){return e=bi(e),t=bi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var Si=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Ci=[],R=0,wi=0;function Ti(){for(var e=R,t=wi=R=0;t<e;){var n=Ci[t];Ci[t++]=null;var r=Ci[t];Ci[t++]=null;var i=Ci[t];Ci[t++]=null;var a=Ci[t];if(Ci[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ki(n,i,a)}}function Ei(e,t,n,r){Ci[R++]=e,Ci[R++]=t,Ci[R++]=n,Ci[R++]=r,wi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Di(e,t,n,r){return Ei(e,t,n,r),Ai(e)}function Oi(e,t){return Ei(e,null,null,t),Ai(e)}function ki(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-rt(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ai(e){if(50<Ld)throw Ld=0,Rd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ji={};function Mi(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ni(e,t,n,r){return new Mi(e,t,n,r)}function Pi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Fi(e,t){var n=e.alternate;return n===null?(n=Ni(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Ii(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Li(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Pi(r)&&(s=1);else if(typeof r==`string`)s=rh(e,n,Ee.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case M:return e=Ni(31,n,t,a),e.elementType=M,e.lanes=o,e;case O:return Ri(n.children,a,o,t);case re:s=8,a|=24;break;case k:return e=Ni(12,n,t,a|2),e.elementType=k,e.lanes=o,e;case ae:return e=Ni(13,n,t,a),e.elementType=ae,e.lanes=o,e;case oe:return e=Ni(19,n,t,a),e.elementType=oe,e.lanes=o,e;case le:case de:return e=a|32,e=Ni(30,n,t,e),e.elementType=de,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case ie:s=10;break a;case A:s=9;break a;case j:s=11;break a;case se:s=14;break a;case ce:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Ni(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Ri(e,t,n,r){return e=Ni(7,e,r,t),e.lanes=n,e}function zi(e,t,n){return e=Ni(6,e,null,t),e.lanes=n,e}function Bi(e){var t=Ni(18,null,null,0);return t.stateNode=e,t}function Vi(e,t,n){return t=Ni(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Hi=new WeakMap;function Ui(e,t){if(typeof e==`object`&&e){var n=Hi.get(e);return n===void 0?(t={value:e,source:t,stack:Be(t)},Hi.set(e,t),t):n}return{value:e,source:t,stack:Be(t)}}var Wi=[],Gi=0,Ki=null,qi=0,Ji=[],Yi=0,Xi=null,Zi=1,Qi=``;function $i(e,t){Wi[Gi++]=qi,Wi[Gi++]=Ki,Ki=e,qi=t}function ea(e,t,n){Ji[Yi++]=Zi,Ji[Yi++]=Qi,Ji[Yi++]=Xi,Xi=e;var r=Zi;e=Qi;var i=32-rt(r)-1;r&=~(1<<i),n+=1;var a=32-rt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Zi=1<<32-rt(t)+i|n<<i|r,Qi=a+e}else Zi=1<<a|n<<i|r,Qi=e}function ta(e){e.return!==null&&($i(e,1),ea(e,1,0))}function na(e){for(;e===Ki;)Ki=Wi[--Gi],Wi[Gi]=null,qi=Wi[--Gi],Wi[Gi]=null;for(;e===Xi;)Xi=Ji[--Yi],Ji[Yi]=null,Qi=Ji[--Yi],Ji[Yi]=null,Zi=Ji[--Yi],Ji[Yi]=null}function ra(e,t){Ji[Yi++]=Zi,Ji[Yi++]=Qi,Ji[Yi++]=Xi,Zi=t.id,Qi=t.overflow,Xi=e}var ia=null,aa=null,oa=!1,sa=null,ca=!1,la=Error(i(519));function ua(e){throw ga(Ui(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),la}function da(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Et]=e,t[Dt]=r,n){case`dialog`:Xf(`cancel`,t),Xf(`close`,t);break;case`iframe`:case`object`:case`embed`:Xf(`load`,t);break;case`video`:case`audio`:for(n=0;n<qf.length;n++)Xf(qf[n],t);break;case`source`:Xf(`error`,t);break;case`img`:case`image`:case`link`:Xf(`error`,t),Xf(`load`,t);break;case`details`:Xf(`toggle`,t);break;case`input`:Xf(`invalid`,t),cn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Xf(`invalid`,t);break;case`textarea`:Xf(`invalid`,t),fn(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||lp(t.textContent,n)?(r.popover!=null&&(Xf(`beforetoggle`,t),Xf(`toggle`,t)),r.onScroll!=null&&Xf(`scroll`,t),r.onScrollEnd!=null&&Xf(`scrollend`,t),r.onClick!=null&&(t.onclick=xn),t=!0):t=!1,t||ua(e,!0)}function fa(e){for(ia=e.return;ia;)switch(ia.tag){case 5:case 31:case 13:ca=!1;return;case 27:case 3:ca=!0;return;default:ia=ia.return}}function pa(e){if(e!==ia)return!1;if(!oa)return fa(e),oa=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Cp(e.type,e.memoizedProps)),n=!n),n&&aa&&ua(e),fa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));aa=xm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));aa=xm(e)}else t===27?(t=aa,Mp(e.type)?(e=bm,bm=null,aa=e):aa=t):aa=ia?ym(e.stateNode.nextSibling):null;return!0}function ma(){aa=ia=null,oa=!1}function ha(){var e=sa;return e!==null&&(bd===null?bd=e:bd.push.apply(bd,e),sa=null),e}function ga(e){sa===null?sa=[e]:sa.push(e)}var _a=Ce(null),va=null,ya=null;function ba(e,t,n){Te(_a,t._currentValue),t._currentValue=n}function xa(e){e._currentValue=_a.current,we(_a)}function Sa(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Ca(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Sa(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Sa(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),Sa(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function wa(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Wr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ke.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[_h]:e.push(_h))}a=a.return}return e!==null&&Ca(t,e,n,r),t.flags|=262144,e!==null}function Ta(e){for(e=e.firstContext;e!==null;){if(!Wr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ea(e){va=e,ya=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Da(e){return ka(va,e)}function Oa(e,t){return va===null&&Ea(e),ka(e,t)}function ka(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ya===null){if(e===null)throw Error(i(308));ya=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ya=ya.next=t;return n}var Aa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ja=t.unstable_scheduleCallback,Ma=t.unstable_NormalPriority,Na={$$typeof:ie,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Pa(){return{controller:new Aa,data:new Map,refCount:0}}function Fa(e){e.refCount--,e.refCount===0&&ja(Ma,function(){e.controller.abort()})}function Ia(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var La=null;function Ra(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var za=null,Ba=0,Va=0,Ha=null;function Ua(e,t){if(za===null){var n=za=[];Ba=0,Va=Hf(),Ha={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Ba++,t.then(Wa,Wa),t}function Wa(){if(--Ba===0&&(La=null,za!==null)){Ha!==null&&(Ha.status=`fulfilled`);var e=za;za=null,Va=0,Ha=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ga(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Ka=ve.S;ve.S=function(e,t){if(Cd=Ke(),typeof t==`object`&&t&&typeof t.then==`function`&&Ua(e,t),La!==null)for(var n=Of;n!==null;)Ia(n,La),n=n.next;if(n=e.types,n!==null){for(var r=Of;r!==null;)Ia(r,n),r=r.next;if(Va!==0){r=La,r===null&&(r=La=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ka!==null&&Ka(e,t)};var qa=Ce(null);function Ja(){var e=qa.current;return e===null?id.pooledCache:e}function Ya(e,t){t===null?Te(qa,qa.current):Te(qa,t.pool)}function Xa(){var e=Ja();return e===null?null:{parent:Na._currentValue,pool:e}}var Za=Error(i(460)),Qa=Error(i(474)),$a=Error(i(542)),eo={then:function(){}};function to(e){return e=e.status,e===`fulfilled`||e===`rejected`}function no(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(xn,xn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,oo(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(xn,xn);else{if(e=id,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,oo(e),e}throw io=t,Za}}function ro(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(io=e,Za):e}}var io=null;function ao(){if(io===null)throw Error(i(459));var e=io;return io=null,e}function oo(e){if(e===Za||e===$a)throw Error(i(483))}var so=null,co=0;function lo(e){var t=co;return co+=1,so===null&&(so=[]),no(so,e,t)}function uo(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function fo(e,t){throw t.$$typeof===ee?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function po(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Fi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=zi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===O?(e=d(e,t,n.props.children,r,n.key),uo(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===ce&&ro(i)===t.type)?(t=a(t,n.props),uo(t,n),t.return=e,t):(t=Li(n.type,n.key,n.props,null,e.mode,r),uo(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Vi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Ri(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=zi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case te:return n=Li(t.type,t.key,t.props,null,e.mode,n),uo(n,t),n.return=e,n;case ne:return t=Vi(t,e.mode,n),t.return=e,t;case ce:return t=ro(t),f(e,t,n)}if(_e(t)||me(t))return t=Ri(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,lo(t),n);if(t.$$typeof===ie)return f(e,Oa(e,t),n);fo(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case te:return n.key===i?l(e,t,n,r):null;case ne:return n.key===i?u(e,t,n,r):null;case ce:return n=ro(n),p(e,t,n,r)}if(_e(n)||me(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,lo(n),r);if(n.$$typeof===ie)return p(e,t,Oa(e,n),r);fo(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case te:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case ne:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case ce:return r=ro(r),m(e,t,n,r,i)}if(_e(r)||me(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,lo(r),i);if(r.$$typeof===ie)return m(e,t,n,Oa(t,r),i);fo(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),oa&&$i(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return oa&&$i(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),oa&&$i(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),oa&&$i(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return oa&&$i(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),oa&&$i(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===O&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case te:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===O){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),uo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ce&&ro(l)===r.type){n(e,r.sibling),c=a(r,o.props),uo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===O?(c=Ri(o.props.children,e.mode,c,o.key),uo(c,o),c.return=e,e=c):(c=Li(o.type,o.key,o.props,null,e.mode,c),uo(c,o),c.return=e,e=c)}return s(e);case ne:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Vi(o,e.mode,c),c.return=e,e=c}return s(e);case ce:return o=ro(o),_(e,r,o,c)}if(_e(o))return h(e,r,o,c);if(me(o)){if(l=me(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,lo(o),c);if(o.$$typeof===ie)return _(e,r,Oa(e,o),c);fo(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=zi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{co=0;var i=_(e,t,n,r);return so=null,i}catch(t){if(t===Za||t===$a)throw t;var a=Ni(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var mo=po(!0),ho=po(!1),go=!1;function _o(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function vo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function yo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function bo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,rd&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ai(e),ki(e,null,n),t}return Ei(e,r,t,n),Ai(e)}function xo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,yt(e,n)}}function So(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Co=!1;function wo(){if(Co){var e=Ha;if(e!==null)throw e}}function To(e,t,n,r){Co=!1;var i=e.updateQueue;go=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(od&f)===f:(r&f)===f){f!==0&&f===Va&&(Co=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:go=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),md|=o,e.lanes=o,e.memoizedState=d}}function Eo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Do(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Eo(n[e],t)}var Oo=Ce(null),ko=Ce(0);function Ao(e,t){e=fd,Te(ko,e),Te(Oo,t),fd=e|t.baseLanes}function jo(){Te(ko,fd),Te(Oo,Oo.current)}function Mo(){fd=ko.current,we(Oo),we(ko)}var No=Ce(null),Po=null;function Fo(e){var t=e.alternate;Te(Bo,Bo.current&1),Te(No,e),Po===null&&(t===null||Oo.current!==null||t.memoizedState!==null)&&(Po=e)}function Io(e){Te(Bo,Bo.current),Te(No,e),Po===null&&(Po=e)}function Lo(e){e.tag===22?(Te(Bo,Bo.current),Te(No,e),Po===null&&(Po=e)):Ro()}function Ro(){Te(Bo,Bo.current),Te(No,No.current)}function zo(e){we(No),Po===e&&(Po=null),we(Bo)}var Bo=Ce(0);function Vo(e,t){Te(No,No.current),Te(Bo,t)}function Ho(e){we(Bo),we(No),Po===e&&(Po=null)}function z(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||gm(n)||_m(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Uo=0,Wo=null,Go=null,Ko=null,qo=!1,Jo=!1,Yo=!1,Xo=0,Zo=0,Qo=null,$o=0;function es(){throw Error(i(321))}function ts(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Wr(e[n],t[n]))return!1;return!0}function ns(e,t,n,r,i,a){return Uo=a,Wo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ve.H=e===null||e.memoizedState===null?V:vc,Yo=!1,a=n(r,i),Yo=!1,Jo&&(a=is(t,n,r,i)),rs(e),a}function rs(e){ve.H=_c;var t=Go!==null&&Go.next!==null;if(Uo=0,Ko=Go=Wo=null,qo=!1,Zo=0,Qo=null,t)throw Error(i(300));e===null||Fc||(e=e.dependencies,e!==null&&Ta(e)&&(Fc=!0))}function is(e,t,n,r){Wo=e;var a=0;do{if(Jo&&(Qo=null),Zo=0,Jo=!1,25<=a)throw Error(i(301));if(a+=1,Ko=Go=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}ve.H=yc,o=t(n,r)}while(Jo);return o}function as(){var e=ve.H,t=e.useState()[0];return t=typeof t.then==`function`?fs(t):t,e=e.useState()[0],(Go===null?null:Go.memoizedState)!==e&&(Wo.flags|=1024),t}function os(){var e=Xo!==0;return Xo=0,e}function ss(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function cs(e){if(qo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}qo=!1}Uo=0,Ko=Go=Wo=null,Jo=!1,Zo=Xo=0,Qo=null}function ls(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ko===null?Wo.memoizedState=Ko=e:Ko=Ko.next=e,Ko}function us(){if(Go===null){var e=Wo.alternate;e=e===null?null:e.memoizedState}else e=Go.next;var t=Ko===null?Wo.memoizedState:Ko.next;if(t!==null)Ko=t,Go=e;else{if(e===null)throw Wo.alternate===null?Error(i(467)):Error(i(310));Go=e,e={memoizedState:Go.memoizedState,baseState:Go.baseState,baseQueue:Go.baseQueue,queue:Go.queue,next:null},Ko===null?Wo.memoizedState=Ko=e:Ko=Ko.next=e}return Ko}function ds(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function fs(e){var t=Zo;return Zo+=1,Qo===null&&(Qo=[]),e=no(Qo,e,t),t=Wo,(Ko===null?t.memoizedState:Ko.next)===null&&(t=t.alternate,ve.H=t===null||t.memoizedState===null?V:vc),e}function ps(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return fs(e);if(e.$$typeof===fe)return;if(e.$$typeof===ie)return Da(e)}throw Error(i(438,String(e)))}function ms(e){var t=null,n=Wo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Wo.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=ds(),Wo.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ue;return t.index++,n}function hs(e,t){return typeof t==`function`?t(e):t}function gs(e){return _s(us(),Go,e)}function _s(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Uo&f)===f:(od&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Va&&(d=!0);else if((Uo&p)===p){u=u.next,p===Va&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,Wo.lanes|=p,md|=p;f=u.action,Yo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,Wo.lanes|=f,md|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Wr(o,e.memoizedState)&&(Fc=!0,d&&(n=Ha,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function vs(e){var t=us(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Wr(o,t.memoizedState)||(Fc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ys(e,t,n){var r=Wo,a=us(),o=oa;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Wr((Go||a).memoizedState,n);if(s&&(a.memoizedState=n,Fc=!0),a=a.queue,Us(Ss.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Ko!==null&&!!(Ko.memoizedState.tag&1),Rs(e?9:8,{destroy:void 0},xs.bind(null,r,a,n,t),null),e){if(r.flags|=2048,id===null)throw Error(i(349));o||Uo&127||bs(r,t,n)}return n}function bs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Wo.updateQueue,t===null?(t=ds(),Wo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function xs(e,t,n,r){t.value=n,t.getSnapshot=r,Cs(t)&&ws(e)}function Ss(e,t,n){return n(function(){Cs(t)&&ws(e)})}function Cs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Wr(e,n)}catch{return!0}}function ws(e){var t=Oi(e,2);t!==null&&Hd(t,e,2)}function B(e){var t=ls();if(typeof e==`function`){var n=e;if(e=n(),Yo){nt(!0);try{n()}finally{nt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hs,lastRenderedState:e},t}function Ts(e,t,n,r){return e.baseState=n,_s(e,Go,typeof r==`function`?r:hs)}function Es(e,t,n,r,a){if(mc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};ve.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ds(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ds(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=ve.T,o={};o.types=a===null?null:a.types,ve.T=o;try{var s=n(i,r),c=ve.S;c!==null&&c(o,s),Os(e,t,s)}catch(n){As(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),ve.T=a}}else try{a=n(i,r),Os(e,t,a)}catch(n){As(e,t,n)}}function Os(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){ks(e,t,n)},function(n){return As(e,t,n)}):ks(e,t,n)}function ks(e,t,n){t.status=`fulfilled`,t.value=n,js(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ds(e,n)))}function As(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,js(t),t=t.next;while(t!==r)}e.action=null}function js(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ms(e,t){return t}function Ns(e,t){if(oa){var n=id.formState;if(n!==null){a:{var r=Wo;if(oa){if(aa){b:{for(var i=aa,a=ca;i.nodeType!==8;)if(!a||(i=ym(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){aa=ym(i.nextSibling),r=i.data===`F!`;break a}}ua(r)}r=!1}r&&(t=n[0])}}return n=ls(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ms,lastRenderedState:t},n.queue=r,n=dc.bind(null,Wo,r),r.dispatch=n,r=B(!1),a=pc.bind(null,Wo,!1,r.queue),r=ls(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Es.bind(null,Wo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ps(e){return Fs(us(),Go,e)}function Fs(e,t,n){if(t=_s(e,t,Ms)[0],e=gs(hs)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=fs(t)}catch(e){throw e===Za?$a:e}else r=t;t=us();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Wo.flags|=2048,Rs(9,{destroy:void 0},Is.bind(null,i,n),null)),[r,a,e]}function Is(e,t){e.action=t}function Ls(e){var t=us(),n=Go;if(n!==null)return Fs(t,n,e);us(),t=t.memoizedState,n=us();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Rs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Wo.updateQueue,t===null&&(t=ds(),Wo.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function zs(){return us().memoizedState}function Bs(e,t,n,r){var i=ls();Wo.flags|=e,i.memoizedState=Rs(1|t,{destroy:void 0},n,r===void 0?null:r)}function Vs(e,t,n,r){var i=us();r=r===void 0?null:r;var a=i.memoizedState.inst;Go!==null&&r!==null&&ts(r,Go.memoizedState.deps)?i.memoizedState=Rs(t,a,n,r):(Wo.flags|=e,i.memoizedState=Rs(1|t,a,n,r))}function Hs(e,t){Bs(8390656,8,e,t)}function Us(e,t){Vs(2048,8,e,t)}function Ws(e){Wo.flags|=4;var t=Wo.updateQueue;if(t===null)t=ds(),Wo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Gs(e){var t=us().memoizedState;return Ws({ref:t,nextImpl:e}),function(){if(rd&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Ks(e,t){return Vs(4,2,e,t)}function qs(e,t){return Vs(4,4,e,t)}function Js(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Ys(e,t,n){n=n==null?null:n.concat([e]),Vs(4,4,Js.bind(null,t,e),n)}function Xs(){}function Zs(e,t){var n=us();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&ts(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Qs(e,t){var n=us();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&ts(t,r[1]))return r[0];if(r=e(),Yo){nt(!0);try{e()}finally{nt(!1)}}return n.memoizedState=[r,t],r}function $s(e,t,n){return n===void 0||Uo&1073741824&&!(od&261930)?e.memoizedState=t:(e.memoizedState=n,e=Bd(),Wo.lanes|=e,md|=e,n)}function ec(e,t,n,r){return Wr(n,t)?n:Oo.current===null?!(Uo&106)||Uo&1073741824&&!(od&261930)?(Fc=!0,e.memoizedState=n):(e=Bd(),Wo.lanes|=e,md|=e,t):(e=$s(e,n,r),Wr(e,t)||(Fc=!0),e)}function tc(e,t,n,r,i){var a=ye.p;ye.p=a!==0&&8>a?a:8;var o=ve.T,s={};s.types=o===null?null:o.types,ve.T=s,pc(e,!1,t,n);try{var c=i(),l=ve.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?fc(e,t,Ga(c,r),zd(e)):fc(e,t,r,zd(e))}catch(n){fc(e,t,{then:function(){},status:`rejected`,reason:n},zd())}finally{ye.p=a,o!==null&&s.types!==null&&(o.types=s.types),ve.T=o}}function nc(){}function rc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=ic(e).queue;tc(e,a,t,be,n===null?nc:function(){return ac(e),n(r)})}function ic(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:be,baseState:be,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hs,lastRenderedState:be},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ac(e){var t=ic(e);t.next===null&&(t=e.alternate.memoizedState),fc(e,t.next.queue,{},zd())}function oc(){return Da(_h)}function sc(){return us().memoizedState}function cc(){return us().memoizedState}function lc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=zd();e=yo(n);var r=bo(t,e,n);r!==null&&(Hd(r,t,n),xo(r,t,n)),t={cache:Pa()},e.payload=t;return}t=t.return}}function uc(e,t,n){var r=zd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},mc(e)?hc(t,n):(n=Di(e,t,n,r),n!==null&&(Hd(n,e,r),gc(n,t,r)))}function dc(e,t,n){fc(e,t,n,zd())}function fc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(mc(e))hc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Wr(s,o))return Ei(e,t,i,0),id===null&&Ti(),!1}catch{}if(n=Di(e,t,i,r),n!==null)return Hd(n,e,r),gc(n,t,r),!0}return!1}function pc(e,t,n,r){if(r={lane:2,revertLane:Hf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},mc(e)){if(t)throw Error(i(479))}else t=Di(e,n,r,2),t!==null&&Hd(t,e,2)}function mc(e){var t=e.alternate;return e===Wo||t!==null&&t===Wo}function hc(e,t){Jo=qo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function gc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,yt(e,n)}}var _c={readContext:Da,use:ps,useCallback:es,useContext:es,useEffect:es,useImperativeHandle:es,useLayoutEffect:es,useInsertionEffect:es,useMemo:es,useReducer:es,useRef:es,useState:es,useDebugValue:es,useDeferredValue:es,useTransition:es,useSyncExternalStore:es,useId:es,useHostTransitionStatus:es,useFormState:es,useActionState:es,useOptimistic:es,useMemoCache:es,useCacheRefresh:es,useEffectEvent:es},V={readContext:Da,use:ps,useCallback:function(e,t){return ls().memoizedState=[e,t===void 0?null:t],e},useContext:Da,useEffect:Hs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Bs(4194308,4,Js.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Bs(4194308,4,e,t)},useInsertionEffect:function(e,t){Bs(4,2,e,t)},useMemo:function(e,t){var n=ls();t=t===void 0?null:t;var r=e();if(Yo){nt(!0);try{e()}finally{nt(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ls();if(n!==void 0){var i=n(t);if(Yo){nt(!0);try{n(t)}finally{nt(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=uc.bind(null,Wo,e),[r.memoizedState,e]},useRef:function(e){var t=ls();return e={current:e},t.memoizedState=e},useState:function(e){e=B(e);var t=e.queue,n=dc.bind(null,Wo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Xs,useDeferredValue:function(e,t){return $s(ls(),e,t)},useTransition:function(){var e=B(!1);return e=tc.bind(null,Wo,e.queue,!0,!1),ls().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Wo,a=ls();if(oa){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),id===null)throw Error(i(349));od&127||bs(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Hs(Ss.bind(null,r,o,e),[e]),r.flags|=2048,Rs(9,{destroy:void 0},xs.bind(null,r,o,n,t),null),n},useId:function(){var e=ls(),t=id.identifierPrefix;if(oa){var n=Qi,r=Zi;n=(r&~(1<<32-rt(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Xo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=$o++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:oc,useFormState:Ns,useActionState:Ns,useOptimistic:function(e){var t=ls();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=pc.bind(null,Wo,!0,n),n.dispatch=t,[e,t]},useMemoCache:ms,useCacheRefresh:function(){return ls().memoizedState=lc.bind(null,Wo)},useEffectEvent:function(e){var t=ls(),n={impl:e};return t.memoizedState=n,function(){if(rd&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},vc={readContext:Da,use:ps,useCallback:Zs,useContext:Da,useEffect:Us,useImperativeHandle:Ys,useInsertionEffect:Ks,useLayoutEffect:qs,useMemo:Qs,useReducer:gs,useRef:zs,useState:function(){return gs(hs)},useDebugValue:Xs,useDeferredValue:function(e,t){return ec(us(),Go.memoizedState,e,t)},useTransition:function(){var e=gs(hs)[0],t=us().memoizedState;return[typeof e==`boolean`?e:fs(e),t]},useSyncExternalStore:ys,useId:sc,useHostTransitionStatus:oc,useFormState:Ps,useActionState:Ps,useOptimistic:function(e,t){return Ts(us(),Go,e,t)},useMemoCache:ms,useCacheRefresh:cc,useEffectEvent:Gs},yc={readContext:Da,use:ps,useCallback:Zs,useContext:Da,useEffect:Us,useImperativeHandle:Ys,useInsertionEffect:Ks,useLayoutEffect:qs,useMemo:Qs,useReducer:vs,useRef:zs,useState:function(){return vs(hs)},useDebugValue:Xs,useDeferredValue:function(e,t){var n=us();return Go===null?$s(n,e,t):ec(n,Go.memoizedState,e,t)},useTransition:function(){var e=vs(hs)[0],t=us().memoizedState;return[typeof e==`boolean`?e:fs(e),t]},useSyncExternalStore:ys,useId:sc,useHostTransitionStatus:oc,useFormState:Ls,useActionState:Ls,useOptimistic:function(e,t){var n=us();return Go===null?(n.baseState=e,[e,n.queue.dispatch]):Ts(n,Go,e,t)},useMemoCache:ms,useCacheRefresh:cc,useEffectEvent:Gs};function bc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var xc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=zd(),i=yo(r);i.payload=t,n!=null&&(i.callback=n),t=bo(e,i,r),t!==null&&(Hd(t,e,r),xo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=zd(),i=yo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=bo(e,i,r),t!==null&&(Hd(t,e,r),xo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=zd(),r=yo(n);r.tag=2,t!=null&&(r.callback=t),t=bo(e,r,n),t!==null&&(Hd(t,e,n),xo(t,e,n))}};function Sc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Gr(n,r)||!Gr(i,a):!0}function Cc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&xc.enqueueReplaceState(t,t.state,null)}function wc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Tc(e){Si(e)}function Ec(e){console.error(e)}function Dc(e){Si(e)}function Oc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function kc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Ac(e,t,n){return n=yo(n),n.tag=3,n.payload={element:null},n.callback=function(){Oc(e,t)},n}function jc(e){return e=yo(e),e.tag=3,e}function Mc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){kc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){kc(t,n,r),typeof i!=`function`&&(Ed===null?Ed=new Set([this]):Ed.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Nc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&wa(t,n,a,!0),n=No.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Po===null?ef():n.alternate===null&&pd===0&&(pd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===eo?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Sf(e,r,a)),!1;case 22:return n.flags|=65536,r===eo?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Sf(e,r,a)),!1}throw Error(i(435,n.tag))}return Sf(e,r,a),ef(),!1}if(oa)return t=No.current,t===null?(r!==la&&(t=Error(i(423),{cause:r}),ga(Ui(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Ui(r,n),a=Ac(e.stateNode,r,a),So(e,a),pd!==4&&(pd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==la&&(e=Error(i(422),{cause:r}),ga(Ui(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Ui(o,n),yd===null?yd=[o]:yd.push(o),pd!==4&&(pd=2),t===null)return!0;r=Ui(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Ac(n.stateNode,r,e),So(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(Ed===null||!Ed.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=jc(a),Mc(a,e,n,r),So(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Pc=Error(i(461)),Fc=!1;function Ic(e,t,n,r){t.child=e===null?ho(t,null,n,r):mo(t,e.child,n,r)}function Lc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Ea(t),r=ns(e,t,n,o,a,i),s=os(),e!==null&&!Fc?(ss(e,t,i),dl(e,t,i)):(oa&&s&&ta(t),t.flags|=1,Ic(e,t,r,i),t.child)}function Rc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Pi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,zc(e,t,a,r,i)):(e=Li(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!fl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Gr:n,n(o,r)&&e.ref===t.ref)return dl(e,t,i)}return t.flags|=1,e=Fi(a,r),e.ref=t.ref,e.return=t,t.child=e}function zc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Gr(a,r)&&e.ref===t.ref){if(Fc=!1,t.pendingProps=r=a,fl(e,i))e.flags&131072&&(Fc=!0);else return t.lanes=e.lanes,dl(e,t,i)}}return qc(e,t,n,r,i)}function Bc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Hc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ya(t,a===null?null:a.cachePool),a===null?jo():Ao(t,a),Lo(t);else return r=t.lanes=536870912,Hc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ya(t,null),jo(),Ro()):(Ya(t,a.cachePool),Ao(t,a),Ro(),t.memoizedState=null);return Ic(e,t,i,n),t.child}function Vc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Hc(e,t,n,r,i){var a=Ja();return a=a===null?null:{parent:Na._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ya(t,null),jo(),Lo(t),e!==null&&wa(e,t,r,!0),t.childLanes=i,null}function Uc(e,t){return t=nl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Wc(e,t,n){return mo(t,e.child,null,n),e=Uc(t,t.pendingProps),e.flags|=2,zo(t),t.memoizedState=null,e}function Gc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(oa){if(r.mode===`hidden`)return e=Uc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Vc(null,e);if(Io(t),(e=aa)?(e=hm(e,ca),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Xi===null?null:{id:Zi,overflow:Qi},retryLane:536870912,hydrationErrors:null},n=Bi(e),n.return=t,t.child=n,ia=t,aa=null)):e=null,e===null)throw ua(t);return t.lanes=536870912,null}return Uc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Io(t),a){if(t.flags&256)t.flags&=-257,t=Wc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Fc||wa(e,t,n,!1),a=(n&e.childLanes)!==0,Fc||a){if(Oo.current===null){if(r=id,r!==null&&(s=bt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Oi(e,s),Hd(r,e,s),Pc;ef()}t=Wc(e,t,n)}else e=o.treeContext,aa=ym(s.nextSibling),ia=t,oa=!0,sa=null,ca=!1,e!==null&&ra(t,e),t=Uc(t,r),t.flags|=134221824;return t}return e=Fi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Kc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function qc(e,t,n,r,i){return Ea(t),n=ns(e,t,n,r,void 0,i),r=os(),e!==null&&!Fc?(ss(e,t,i),dl(e,t,i)):(oa&&r&&ta(t),t.flags|=1,Ic(e,t,n,i),t.child)}function Jc(e,t,n,r,i,a){return Ea(t),t.updateQueue=null,n=is(t,r,n,i),rs(e),r=os(),e!==null&&!Fc?(ss(e,t,a),dl(e,t,a)):(oa&&r&&ta(t),t.flags|=1,Ic(e,t,n,a),t.child)}function Yc(e,t,n,r,i){if(Ea(t),t.stateNode===null){var a=ji,o=n.contextType;typeof o==`object`&&o&&(a=Da(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=xc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},_o(t),o=n.contextType,a.context=typeof o==`object`&&o?Da(o):ji,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(bc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&xc.enqueueReplaceState(a,a.state,null),To(t,r,a,i),wo(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=wc(n,s);a.props=c;var l=a.context,u=n.contextType;o=ji,typeof u==`object`&&u&&(o=Da(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Cc(t,a,r,o),go=!1;var f=t.memoizedState;a.state=f,To(t,r,a,i),wo(),l=t.memoizedState,s||f!==l||go?(typeof d==`function`&&(bc(t,n,d,r),l=t.memoizedState),(c=go||Sc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,vo(e,t),o=t.memoizedProps,u=wc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ji,typeof l==`object`&&l&&(c=Da(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Cc(t,a,r,c),go=!1,f=t.memoizedState,a.state=f,To(t,r,a,i),wo();var p=t.memoizedState;o!==d||f!==p||go||e!==null&&e.dependencies!==null&&Ta(e.dependencies)?(typeof s==`function`&&(bc(t,n,s,r),p=t.memoizedState),(u=go||Sc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ta(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Kc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=mo(t,e.child,null,i),t.child=mo(t,null,n,i)):Ic(e,t,n,i),t.memoizedState=a.state,e=t.child):e=dl(e,t,i),e}function Xc(e,t,n,r){return ma(),t.flags|=256,Ic(e,t,n,r),t.child}var Zc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Qc(e){return{baseLanes:e,cachePool:Xa()}}function $c(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=_d),e}function el(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Bo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(oa){if(i?Fo(t):Ro(),(e=aa)?(e=hm(e,ca),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Xi===null?null:{id:Zi,overflow:Qi},retryLane:536870912,hydrationErrors:null},n=Bi(e),n.return=t,t.child=n,ia=t,aa=null)):e=null,e===null)throw ua(t);return t.lanes=_m(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Ro(),i=t.mode,a=nl({mode:`hidden`,children:a},i),r=Ri(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Qc(n),r.childLanes=$c(e,o,n),t.memoizedState=Zc,Vc(null,r)):(Fo(t),tl(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return il(e,t,a,o,r,c,s,n)}return i?(Ro(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Fi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ri(i,a,n,null),i.flags|=2):i=Fi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Vc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Qc(n):(a=i.cachePool,a===null?a=Xa():(s=Na._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=$c(e,o,n),t.memoizedState=Zc,Vc(e.child,r)):(Fo(t),n=e.child,e=n.sibling,n=Fi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function tl(e,t){return t=nl({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function nl(e,t){return e=Ni(22,e,null,t),e.lanes=0,e}function rl(e,t,n){return mo(t,e.child,null,n),e=tl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function il(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Fo(t),t.flags&=-257,rl(e,t,c)):t.memoizedState===null?(Ro(),o=a.fallback,s=t.mode,a=nl({mode:`visible`,children:a.children},s),o=Ri(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,mo(t,e.child,null,c),a=t.child,a.memoizedState=Qc(c),a.childLanes=$c(e,r,c),t.memoizedState=Zc,Vc(null,a)):(Ro(),t.child=e.child,t.flags|=128,null);if(Fo(t),_m(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,ga({value:a,source:null,stack:null})),rl(e,t,c)}if(Fc||wa(e,t,c,!1),r=(c&e.childLanes)!==0,Fc||r){if(Oo.current!==null)return rl(e,t,c);if(r=id,r!==null&&(a=bt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Oi(e,a),Hd(r,e,a),Pc;return gm(o)||ef(),rl(e,t,c)}return gm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,aa=ym(o.nextSibling),ia=t,oa=!0,sa=null,ca=!1,e!==null&&ra(t,e),t=tl(t,a.children),t.flags|=134221824,t)}function al(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Sa(e.return,t,n)}function ol(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&z(n)===null&&(t=e),e=e.sibling}return t}function sl(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function cl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function ll(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Bo.current;if(t.flags&128)return Vo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Vo(t,o),i===`backwards`&&e!==null?(cl(e),Ic(e,t,r,n),cl(e)):Ic(e,t,r,n),r=oa?qi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&al(e,n,t);else if(e.tag===19)al(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=ol(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,cl(t)),sl(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&z(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}sl(t,!0,n,null,a,r);break;case`together`:sl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=ol(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),sl(t,!1,i,n,a,r)}return t.child}function ul(e,t,n){var r=t.pendingProps;return ba(t,t.type,r.value),Ic(e,t,r.children,n),t.child}function dl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),md|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(wa(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Fi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Fi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function fl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Ta(e)))}function pl(e,t,n){switch(t.tag){case 3:Ae(t,t.stateNode.containerInfo),ba(t,Na,e.memoizedState.cache),ma();break;case 27:case 5:Me(t);break;case 4:Ae(t,t.stateNode.containerInfo);break;case 10:ba(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Io(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Fo(t),t.flags|=128,null;r=wa(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?el(e,t,n):(Fo(t),e=dl(e,t,n),e===null?null:e.sibling)}Fo(t);break;case 19:if(t.flags&128)return ll(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(wa(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return ll(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Vo(t,Bo.current),r)break;return null;case 22:return t.lanes=0,Bc(e,t,n,t.pendingProps);case 24:ba(t,Na,e.memoizedState.cache)}return dl(e,t,n)}function ml(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Fc=!0;else{if(!fl(e,n)&&!(t.flags&128))return Fc=!1,pl(e,t,n);Fc=!!(e.flags&131072)}}else Fc=!1,oa&&t.flags&1048576&&ea(t,qi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=ro(t.elementType),t.type=e,typeof e==`function`)Pi(e)?(r=wc(e,r),t.tag=1,t=Yc(null,t,e,r,n)):(t.tag=0,t=qc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===j){t.tag=11,t=Lc(null,t,e,r,n);break a}if(a===se){t.tag=14,t=Rc(null,t,e,r,n);break a}if(a===ie){t.tag=10,t.type=e,t=ul(null,t,n);break a}}throw t=ge(e)||e,Error(i(306,t,``))}}return t;case 0:return qc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=wc(r,t.pendingProps),Yc(e,t,r,a,n);case 3:a:{if(Ae(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,vo(e,t),To(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ba(t,Na,r),r!==o.cache&&Ca(t,[Na],n,!0),wo(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Xc(e,t,r,n);break a}if(r!==a){a=Ui(Error(i(424)),t),ga(a),t=Xc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(aa=ym(e.firstChild),ia=t,oa=!0,sa=null,ca=!0,n=ho(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ma(),r===a){t=dl(e,t,n);break a}Ic(e,t,r,n)}t=t.child}return t;case 26:return Kc(e,t),e===null?(n=Um(t.type,null,t.pendingProps,null))?t.memoizedState=n:oa||(t.stateNode=Sp(t.type,t.pendingProps,Oe.current,t)):t.memoizedState=Um(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Me(t),e===null&&oa&&(r=t.stateNode=Tm(t.type,t.pendingProps,Oe.current),ia=t,ca=!0,a=aa,Mp(t.type)?(bm=a,aa=ym(r.firstChild)):aa=a),Ic(e,t,t.pendingProps.children,n),Kc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&oa&&((a=r=aa)&&(r=pm(r,t.type,t.pendingProps,ca),r===null?a=!1:(t.stateNode=r,ia=t,aa=ym(r.firstChild),ca=!1,a=!0)),a||ua(t)),Me(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Cp(a,o)?r=null:s!==null&&Cp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=ns(e,t,as,null,null,n),_h._currentValue=a),Kc(e,t),Ic(e,t,r,n),t.child;case 6:return e===null&&oa&&((e=n=aa)&&(n=mm(n,t.pendingProps,ca),n===null?e=!1:(t.stateNode=n,ia=t,aa=null,e=!0)),e||ua(t)),null;case 13:return el(e,t,n);case 4:return Ae(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=mo(t,null,r,n):Ic(e,t,r,n),t.child;case 11:return Lc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Kc(e,t),Ic(e,t,r,n),t.child;case 8:return Ic(e,t,t.pendingProps.children,n),t.child;case 12:return Ic(e,t,t.pendingProps.children,n),t.child;case 10:return ul(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,Ea(t),a=Da(a),r=r(a),t.flags|=1,Ic(e,t,r,n),t.child;case 14:return Rc(e,t,t.type,t.pendingProps,n);case 15:return zc(e,t,t.type,t.pendingProps,n);case 19:return ll(e,t,n);case 31:return Gc(e,t,n);case 22:return Bc(e,t,n,t.pendingProps);case 24:return Ea(t),r=Da(Na),e===null?(a=Ja(),a===null&&(a=id,o=Pa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},_o(t),ba(t,Na,a)):((e.lanes&n)!==0&&(vo(e,t),To(t,null,null,n),wo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ba(t,Na,r),r!==a.cache&&Ca(t,[Na],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ba(t,Na,r))),Ic(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:oa&&ta(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Kc(e,t),Ic(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function hl(e){e.flags|=4}function gl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?ih(t,r):ih(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Zd())e.flags|=8192;else throw io=eo,Qa}}else e.flags&=-16777217}function _l(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!ah(t)){if(Zd())e.flags|=8192;else throw io=eo,Qa}}function vl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:mt(),e.lanes|=t,vd|=t)}function yl(e,t){if(!oa)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function bl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function xl(e,t,n){var r=t.pendingProps;switch(na(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bl(t),null;case 1:return bl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),xa(Na),je(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(pa(t)?hl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ha())),bl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(hl(t),o===null?(bl(t),gl(t,a,null,r,n)):(bl(t),_l(t,o))):o?o===e.memoizedState?(bl(t),t.flags&=-16777217):(hl(t),bl(t),_l(t,o)):(e=e.memoizedProps,e!==r&&hl(t),bl(t),gl(t,a,e,r,n)),null;case 27:if(Ne(t),n=Oe.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&hl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return bl(t),t.subtreeFlags&=-33554433,null}e=Ee.current,pa(t)?da(t,e):(e=Tm(a,r,n),t.stateNode=e,hl(t))}return bl(t),t.subtreeFlags&=-33554433,null;case 5:if(Ne(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&hl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return bl(t),t.subtreeFlags&=-33554433,null}if(o=Ee.current,pa(t))da(t,o);else{var s=yp(Oe.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[Et]=t,o[Dt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(fp(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&hl(t)}}return bl(t),t.subtreeFlags&=-33554433,gl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&hl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=Oe.current,pa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=ia,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[Et]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||lp(e.nodeValue,n)),e||ua(t,!0)}else e=yp(e).createTextNode(r),e[Et]=t,t.stateNode=e}return bl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=pa(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[Et]=t}else ma(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;bl(t),e=!1}else n=ha(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(zo(t),t):(zo(t),null);if(t.flags&128)throw Error(i(558))}return bl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=pa(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[Et]=t}else ma(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;bl(t),a=!1}else a=ha(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(zo(t),t):(zo(t),null)}return zo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),vl(t,t.updateQueue),bl(t),null);case 4:return je(),e===null&&$f(t.stateNode.containerInfo),t.flags|=67108864,bl(t),null;case 10:return xa(t.type),bl(t),null;case 19:if(Ho(t),r=t.memoizedState,r===null)return bl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)yl(r,!1);else{if(pd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=z(e),o!==null){for(t.flags|=128,yl(r,!1),e=o.updateQueue,t.updateQueue=e,vl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ii(n,e),n=n.sibling;return Vo(t,Bo.current&1|2),oa&&$i(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ke()>wd&&(t.flags|=128,a=!0,yl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=z(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,vl(t,e),yl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!oa)return bl(t),null}else 2*Ke()-r.renderingStartTime>wd&&n!==536870912&&(t.flags|=128,a=!0,yl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ke(),e.sibling=null,o=Bo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||oa?Vo(t,o):(n=o,Te(No,t),Te(Bo,n),Po===null&&(Po=t)),oa&&$i(t,r.treeForkCount),e}return bl(t),null;case 22:case 23:return zo(t),Mo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(bl(t),t.subtreeFlags&6&&(t.flags|=8192)):bl(t),n=t.updateQueue,n!==null&&vl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&we(qa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),xa(Na),bl(t),null;case 25:return null;case 30:return t.flags|=33554432,bl(t),null}throw Error(i(156,t.tag))}function Sl(e,t){switch(na(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xa(Na),je(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ne(t),null;case 31:if(t.memoizedState!==null){if(zo(t),t.alternate===null)throw Error(i(340));ma()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(zo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ma()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ho(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return je(),null;case 10:return xa(t.type),null;case 22:case 23:return zo(t),Mo(),e!==null&&we(qa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return xa(Na),null;case 25:return null;default:return null}}function Cl(e,t){switch(na(t),t.tag){case 3:xa(Na),je();break;case 26:case 27:case 5:Ne(t);break;case 4:je();break;case 31:t.memoizedState!==null&&zo(t);break;case 13:zo(t);break;case 19:Ho(t);break;case 10:xa(t.type);break;case 22:case 23:zo(t),Mo(),e!==null&&we(qa);break;case 24:xa(Na)}}function wl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){xf(t,t.return,e)}}function Tl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){xf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){xf(t,t.return,e)}}function El(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Do(t,n)}catch(t){xf(e,e.return,t)}}}function Dl(e,t,n){n.props=wc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){xf(e,t,n)}}function Ol(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=yi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Wp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Gp(e);m(e.child,!1,cm,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){xf(e,t,n)}}function kl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){xf(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){xf(e,t,n)}else n.current=null}}function Al(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)um(e.stateNode,t[n])}function jl(e){for(var t=e.return;t!==null&&(Pl(t)&&um(e.stateNode,t.stateNode),!Nl(t));)t=t.return}function Ml(e){for(var t=e.return;t!==null&&(Pl(t)&&dm(e.stateNode,t.stateNode),!Nl(t));)t=t.return}function Nl(e){return e.tag===5||e.tag===3||e.tag===27}function Pl(e){return e&&e.tag===7&&e.stateNode!==null}function Fl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){xf(e,e.return,t)}}function Il(e,t,n){try{var r=e.stateNode;mp(r,e.type,n,t),r[Dt]=t}catch(t){xf(e,e.return,t)}}function Ll(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Mp(e.type)||e.tag===4}function Rl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ll(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Mp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function zl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=xn)),Al(e,r),Jt=!0;else if(i!==4&&(i===27&&(Al(e,r),r=null,Mp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(zl(e,t,n,r),e=e.sibling;e!==null;)zl(e,t,n,r),e=e.sibling}function Bl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Al(e,r),Jt=!0;else if(i!==4&&(i===27&&(Al(e,r),r=null,Mp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Bl(e,t,n,r),e=e.sibling;e!==null;)Bl(e,t,n,r),e=e.sibling}function Vl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);fp(t,r,n),t[Et]=e,t[Dt]=n}catch(t){xf(e,e.return,t)}}var Hl=!1,Ul=null;function Wl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Hl=!0)}var Gl=null;function Kl(){var e=Gl;return Gl=null,e}var ql=0;function Jl(e,t,n,r,i){return ql=0,Yl(e.child,t,n,r,i)}function Yl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Rp(o);r.push(s),s.view&&(a=!0)}else a||Rp(o).view&&(a=!0);Hl=!0,Fp(o,ql===0?t:t+`_`+ql,n),ql++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Yl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Xl(e,t){for(;e!==null;)e.tag===5?Ip(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Xl(e.child,t)),e=e.sibling}function Zl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Zl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=xi(t.default,t.share),t!==`none`&&(Jl(e,n,t,null,!1)||Xl(e.child,!1))}e=e.sibling}}function Ql(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=yi(r,n),a=xi(r.default,n.paired?r.share:r.enter);a===`none`?Zl(e):Jl(e,i,a,null,!1)?(Zl(e),n.paired||t||Vd(e,r.onEnter)):Xl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ql(e,t),e=e.sibling;else Zl(e)}function $l(e){if(Ul!==null&&Ul.size!==0){var t=Ul;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=xi(n.default,n.share);if(a!==`none`&&(Jl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Vd(e,n.onShare)):Xl(e.child,!1)),t.delete(r),t.size===0)break}}}$l(e)}e=e.sibling}}}function eu(e){if(e.tag===30){var t=e.memoizedProps,n=yi(t,e.stateNode),r=Ul===null?void 0:Ul.get(n),i=xi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Jl(e,n,i,null,!1)?r===void 0?Vd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Ul.delete(n),Vd(e,t.onShare)):Xl(e.child,!1)),Ul!==null&&$l(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)eu(e),e=e.sibling;else Ul!==null&&$l(e)}function tu(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=yi(t,e.stateNode);t=xi(t.default,t.update),e.flags&=-5,t!==`none`&&Jl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&tu(e);e=e.sibling}}function nu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Xl(e.child,!1))}nu(e)}e=e.sibling}}function ru(e){if(e.tag===30)e.stateNode.paired=null,Xl(e.child,!1),nu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ru(e),e=e.sibling;else nu(e)}function iu(e){for(e=e.child;e!==null;)e.tag===30?Xl(e.child,!1):e.subtreeFlags&33554432&&iu(e),e=e.sibling}function au(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&ql<a.length){var l=a[ql],u=Rp(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Fp(c,ql===0?n:n+`_`+ql,i),s&&e.flags&4||(Gl===null&&(Gl=[]),Gl.push(c,ql===0?r:r+`_`+ql,t.memoizedProps)),ql++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:au(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function ou(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=yi(n,r),a=xi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(zp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;ql=0,i=au(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Vd(e,n.onUpdate))}else e.subtreeFlags&33554432&&ou(e,t);e=e.sibling}}var su=!1,cu=!1,lu=!1,uu=!1,du=typeof WeakSet==`function`?WeakSet:Set,fu=null,pu=!1,mu=!1,hu=!1,gu=!1;function _u(e,t,n){if(e=e.containerInfo,_p=Eh,e=Xr(e),Zr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(vp={focusedElem:e,selectionRange:r},Eh=!1,n=(n&335544064)===n,fu=t,t=n?9270:1024;fu!==null;){if(e=fu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&eu(r[a]);if(e.alternate===null&&e.flags&2)n&&Wl(e),vu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&eu(r),vu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Wl(e),vu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,fu=r):(n&&tu(e),vu(n))}}Ul=null}function vu(e){for(;fu!==null;){var t=fu,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=wc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){xf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)fm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:fm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=yi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=xi(a.default,a.update),a!==`none`&&Jl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,fu=r;break}fu=t.return}}function yu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:zu(e,n),r&4&&wl(5,n);break;case 1:if(zu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){xf(n,n.return,e)}else{var i=wc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){xf(n,n.return,e)}}}r&64&&El(n),r&512&&Ol(n,n.return);break;case 3:if(zu(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Do(e,t)}catch(e){xf(n,n.return,e)}}break;case 27:t===null&&r&4&&Vl(n);case 26:case 5:zu(e,n),t===null&&r&4&&Fl(n),r&512&&Ol(n,n.return);break;case 12:zu(e,n);break;case 31:zu(e,n),r&4&&Ou(e,n);break;case 13:zu(e,n),r&4&&ku(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Tf.bind(null,n),vm(e,n))));break;case 22:if(r=n.memoizedState!==null||su,!r){var a=t!==null&&t.memoizedState!==null||cu;t=su,i=cu,su=r,(cu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Vu(e,n,r)):zu(e,n),su=t,cu=i}break;case 30:zu(e,n),r&512&&Ol(n,n.return);break;case 7:r&512&&Ol(n,n.return);default:zu(e,n)}}function bu(e,t){for(e=e.child;e!==null;)xu(e,t),e=e.sibling}function xu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){xf(e,e.return,t)}Su(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Jt=!0}catch(t){xf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Pp(s,!0):Pp(e.stateNode,!1)}catch(t){xf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&bu(e,t);break;default:bu(e,t)}}function Su(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:xu(n,r);break a;case 22:n.memoizedState===null&&Su(n,r);break a;default:Su(n,r)}}e=e.sibling}}function Cu(e){var t=e.alternate;t!==null&&(e.alternate=null,Cu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Nt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var wu=null,Tu=!1;function Eu(e,t,n){for(n=n.child;n!==null;)Du(e,t,n),n=n.sibling}function Du(e,t,n){if(tt&&typeof tt.onCommitFiberUnmount==`function`)try{tt.onCommitFiberUnmount(et,n)}catch{}switch(n.tag){case 26:cu||kl(n,t),Eu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!cu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:cu||kl(n,t),Ml(n);var r=wu,i=Tu;Mp(n.type)&&(wu=n.stateNode,Tu=!1),Eu(e,t,n),Em(n.stateNode,n.type,n.memoizedProps),wu=r,Tu=i;break;case 5:cu||kl(n,t),Ml(n);case 6:if(n.tag===6&&Ml(n),r=wu,i=Tu,wu=null,Eu(e,t,n),wu=r,Tu=i,wu!==null){if(Tu)try{(wu.nodeType===9?wu.body:wu.nodeName===`HTML`?wu.ownerDocument.body:wu).removeChild(n.stateNode),Jt=!0}catch(e){xf(n,t,e)}else try{wu.removeChild(n.stateNode),Jt=!0}catch(e){xf(n,t,e)}}break;case 18:wu!==null&&(Tu?(e=wu,Np(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Qh(e)):Np(wu,n.stateNode));break;case 4:r=wu,i=Tu,wu=n.stateNode.containerInfo,Tu=!0,Eu(e,t,n),wu=r,Tu=i;break;case 0:case 11:case 14:case 15:Tl(2,n,t),cu||Tl(4,n,t),Eu(e,t,n);break;case 1:cu||(kl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Dl(n,t,r)),Eu(e,t,n);break;case 21:Eu(e,t,n);break;case 22:cu=(r=cu)||n.memoizedState!==null,Eu(e,t,n),cu=r;break;case 30:kl(n,t),Eu(e,t,n);break;case 7:cu||kl(n,t),Eu(e,t,n);break;default:Eu(e,t,n)}}function Ou(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Qh(e)}catch(e){xf(t,t.return,e)}}}function ku(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Qh(e)}catch(e){xf(t,t.return,e)}}function Au(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new du),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new du),t;default:throw Error(i(435,e.tag))}}function ju(e,t){var n=Au(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Ef.bind(null,e,t);t.then(r,r)}})}function Mu(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Mp(l.type)){wu=l.stateNode,Tu=!1;break a}break;case 5:wu=l.stateNode,Tu=!1;break a;case 3:case 4:wu=l.stateNode.containerInfo,Tu=!0;break a}l=l.return}if(wu===null)throw Error(i(160));Du(s,c,o),wu=null,Tu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Pu(t,e,n),t=t.sibling}var Nu=null;function Pu(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Mu(t,e,n),Fu(e),a&4&&(Tl(3,e,e.return),wl(3,e),Tl(5,e,e.return));break;case 1:Mu(t,e,n),Fu(e),a&512&&(cu||r===null||kl(r,r.return)),a&64&&su&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Nu,Mu(t,e,n),Fu(e),a&512&&(cu||r===null||kl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(su)e.stateNode=Sp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[I]||r[Et]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),fp(r,t,n),r[Et]=e,Rt(r),t=r;break a;case`link`:if(o=th(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),fp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=th(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),fp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[Et]=e,Rt(r),t=r}e.stateNode=t}}else su||nh(o,e.type,e.stateNode)}else e.stateNode=Xm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Il(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||cu||t.parentNode.removeChild(t)):a.count--,n===null?su||nh(o,e.type,e.stateNode):Xm(o,n,e.memoizedProps))}break;case 27:Mu(t,e,n),Fu(e),a&512&&(cu||r===null||kl(r,r.return)),r!==null&&a&4&&Il(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=lu,lu=!1,Mu(t,e,n),lu=o,Fu(e),a&512&&(cu||r===null||kl(r,r.return)),e.flags&32){t=e.stateNode;try{pn(t,``),Jt=!0}catch(t){xf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Il(e,t,r===null?t:r.memoizedProps)),a&1024&&(uu=!0);break;case 6:if(Mu(t,e,n),Fu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Jt=!0}catch(t){xf(e,e.return,t)}}break;case 3:if(Jt=!1,eh=null,o=Nu,Nu=Am(t.containerInfo),Mu(t,e,n),Nu=o,Fu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Qh(t.containerInfo)}catch(t){xf(e,e.return,t)}uu&&(uu=!1,Iu(e)),Jt=!1;break;case 4:a=lu,lu=su,r=Yt(),o=Nu,Nu=Am(e.stateNode.containerInfo),Mu(t,e,n),Fu(e),Nu=o,Jt&&mu&&(hu=!0),Jt=r,lu=a;break;case 12:Mu(t,e,n),Fu(e);break;case 31:Mu(t,e,n),Fu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ju(e,t)));break;case 13:Mu(t,e,n),Fu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(Sd=Ke()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ju(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=su,l=cu,u=lu;su=c||o,lu=u||o,cu=l||s,Mu(t,e,n),cu=l,lu=u,su=c,Fu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||su||cu||(t=s||cu,n=su,r=cu,su=o||su,cu=t,Bu(e,2),su=n,cu=r),!o&&lu||bu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,ju(e,n))));break;case 19:Mu(t,e,n),Fu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ju(e,t)));break;case 30:a&512&&(cu||r===null||kl(r,r.return)),a=Yt(),o=mu,s=(n&335544064)===n,c=e.memoizedProps,mu=s&&xi(c.default,c.update)!==`none`,Mu(t,e,n),Fu(e),s&&r!==null&&Jt&&(e.flags|=4),mu=o,Jt=a;break;case 21:break;case 7:a&512&&(cu||r===null||kl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Mu(t,e,n),Fu(e)}}function Fu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Ll(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Pl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Nl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Bl(e,Rl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(pn(l,``),n.flags&=-33),Bl(e,Rl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;zl(e,Rl(e),u,s);break;default:throw Error(i(161))}}catch(t){xf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Iu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Iu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Eh=!0,t.reset(),Eh=!1),e=e.sibling}}function Lu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Ru(t,e),t=t.sibling;else ou(t,!1)}function Ru(e,t){var n=e.alternate;if(n===null)Ql(e,!1);else switch(e.tag){case 3:if(gu=pu=!1,Kl(),Lu(t,e),!pu&&!hu){if(e=Gl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ip(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),gu=!0}Gl=null;break;case 5:Lu(t,e);break;case 4:r=pu,pu=!1,Lu(t,e),pu&&(hu=!0),pu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Lu(t,e):Ql(e,!1));break;case 30:r=pu,i=Kl(),pu=!1,Lu(t,e),pu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=yi(a,o),o=yi(n.memoizedProps,o);var s=xi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,ql=0,t=au(e,n,t,o,s,a,!0),ql!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Vd(e,e.memoizedProps.onUpdate),Gl=i):i!==null&&(i.push.apply(i,Gl),Gl=i),pu=e.flags&32?!0:r;break;default:Lu(t,e)}}function zu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)yu(e,t.alternate,t),t=t.sibling}function Bu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Tl(4,n,n.return),Bu(n,r);break;case 1:kl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Dl(n,n.return,i),Bu(n,r);break;case 27:r&2&&Em(n.stateNode,n.type,n.memoizedProps);case 5:kl(n,n.return),n.tag!==5&&n.tag!==27||Ml(n),Bu(n,r);break;case 6:Ml(n);break;case 26:kl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||cu||i.parentNode.removeChild(i),Bu(n,r);break;case 22:n.memoizedState===null&&Bu(n,r);break;case 30:kl(n,n.return),Bu(n,r);break;case 7:kl(n,n.return);default:Bu(n,r)}e=e.sibling}}function Vu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Vu(i,a,n),wl(4,a);break;case 1:if(Vu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){xf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)Eo(l[i],c)}catch(e){xf(r,r.return,e)}}s&&o&64&&El(a),Ol(a,a.return);break;case 27:n&2&&Vl(a);case 5:a.tag!==5&&a.tag!==27||jl(a),Vu(i,a,n),s&&r===null&&o&4&&Fl(a),Ol(a,a.return);break;case 6:jl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||su||nh(Am(c.ownerDocument),a.type,c),Vu(i,a,n),s&&r===null&&o&4&&Fl(a),Ol(a,a.return);break;case 12:Vu(i,a,n);break;case 31:Vu(i,a,n),s&&o&4&&Ou(i,a);break;case 13:Vu(i,a,n),s&&o&4&&ku(i,a);break;case 22:a.memoizedState===null&&Vu(i,a,n),Ol(a,a.return);break;case 30:Vu(i,a,n),Ol(a,a.return);break;case 7:Ol(a,a.return);default:Vu(i,a,n)}t=t.sibling}}function Hu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Fa(n))}function Uu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Fa(e))}function H(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Wu(e,t,n,r),t=t.sibling;else i&&iu(t)}function Wu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&ru(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:H(e,t,n,r),a&2048&&wl(9,t);break;case 1:H(e,t,n,r);break;case 3:H(e,t,n,r),i&&gu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Fa(a)));break;case 12:if(a&2048){H(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){xf(t,t.return,e)}}else H(e,t,n,r);break;case 31:H(e,t,n,r);break;case 13:H(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&ru(t),o._visibility&2?H(e,t,n,r):(o._visibility|=2,Gu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&ru(s),o._visibility&2?H(e,t,n,r):Ku(e,t)),a&2048&&Hu(s,t);break;case 24:H(e,t,n,r),a&2048&&Uu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Xl(a.child,!0),Xl(t.child,!0))),H(e,t,n,r);break;default:H(e,t,n,r)}}function Gu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Gu(a,o,s,c,i),wl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Gu(a,o,s,c,i)):u._visibility&2?Gu(a,o,s,c,i):Ku(a,o),i&&l&2048&&Hu(o.alternate,o);break;case 24:Gu(a,o,s,c,i),i&&l&2048&&Uu(o.alternate,o);break;default:Gu(a,o,s,c,i)}t=t.sibling}}function Ku(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Ku(n,r),i&2048&&Hu(r.alternate,r);break;case 24:Ku(n,r),i&2048&&Uu(r.alternate,r);break;default:Ku(n,r)}t=t.sibling}}var qu=8192;function Ju(e,t,n){if(e.subtreeFlags&qu)for(e=e.child;e!==null;)Yu(e,t,n),e=e.sibling}function Yu(e,t,n){switch(e.tag){case 26:Ju(e,t,n),e.flags&qu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&sh(n,e)):ch(n,Nu,e.memoizedState,e.memoizedProps));break;case 5:Ju(e,t,n),e.flags&qu&&(e=e.stateNode,(t&335544128)===t&&sh(n,e));break;case 3:case 4:var r=Nu;Nu=Am(e.stateNode.containerInfo),Ju(e,t,n),Nu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=qu,qu=16777216,Ju(e,t,n),qu=r):Ju(e,t,n));break;case 30:if((e.flags&qu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Ul===null&&(Ul=new Map),Ul.set(r,i)}Ju(e,t,n);break;default:Ju(e,t,n)}}function Xu(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Zu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];fu=r,ed(r,e)}Xu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Qu(e),e=e.sibling}function Qu(e){switch(e.tag){case 0:case 11:case 15:Zu(e),e.flags&2048&&Tl(9,e,e.return);break;case 3:Zu(e);break;case 12:Zu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,$u(e)):Zu(e);break;default:Zu(e)}}function $u(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];fu=r,ed(r,e)}Xu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Tl(8,t,t.return),$u(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,$u(t));break;default:$u(t)}e=e.sibling}}function ed(e,t){for(;fu!==null;){var n=fu;switch(n.tag){case 0:case 11:case 15:Tl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Fa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,fu=r;else a:for(n=e;fu!==null;){r=fu;var i=r.sibling,a=r.return;if(Cu(r),r===n){fu=null;break a}if(i!==null){i.return=a,fu=i;break a}fu=a}}}var td={getCacheForType:function(e){var t=Da(Na),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Da(Na).controller.signal}},nd=typeof WeakMap==`function`?WeakMap:Map,rd=0,id=null,ad=null,od=0,sd=0,cd=null,ld=!1,ud=!1,dd=!1,fd=0,pd=0,md=0,hd=0,gd=0,_d=0,vd=0,yd=null,bd=null,xd=!1,Sd=0,Cd=0,wd=1/0,Td=null,Ed=null,Dd=0,Od=null,kd=null,Ad=0,jd=0,Md=null,Nd=null,Pd=null,Fd=null,Id=null,Ld=0,Rd=null;function zd(){return rd&2&&od!==0?od&-od:ve.T===null?Ct():Hf()}function Bd(){if(_d===0){if(!(od&536870912)||oa){var e=P;P<<=1,!(P&3932160)&&(P=262144),_d=e}else _d=536870912}return e=No.current,e!==null&&(e.flags|=32),_d}function Vd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Wp(yi(e.memoizedProps,n))),Fd===null&&(Fd=[]),Fd.push(t.bind(null,r))}}function Hd(e,t,n){(e===id&&(sd===2||sd===9)||e.cancelPendingCommit!==null)&&(Yd(e,0),Kd(e,od,_d,!1)),gt(e,n),(!(rd&2)||e!==id)&&(e===id&&(!(rd&2)&&(hd|=n),pd===4&&Kd(e,od,_d,!1)),Pf(e))}function Ud(e,t,n){if(rd&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||dt(e,t),a=r?rf(e,t):tf(e,t,!0),o=r;do{if(a===0){ud&&!r&&Kd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Gd(n))a=tf(e,t,!1),o=!1;else{if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=yd;var l=c.current.memoizedState.isDehydrated;if(l&&(Yd(c,s).flags|=256),s=tf(c,s,!1),s!==2&&s!==6){if(dd&&!l){c.errorRecoveryDisabledLanes|=o,hd|=o,a=4;break a}o=bd,bd=a,o!==null&&(bd===null?bd=o:bd.push.apply(bd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Yd(e,0),Kd(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Kd(r,t,_d,!ld);break a;case 2:bd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=Sd+300-Ke(),10<a)){if(Kd(r,t,_d,!ld),ut(r,0,!0)!==0)break a;Ad=t,r.timeoutHandle=Ep(Wd.bind(null,r,n,bd,Td,xd,t,_d,hd,vd,ld,o,`Throttled`,-0,0),a);break a}Wd(r,n,bd,Td,xd,t,_d,hd,vd,ld,o,null,-0,0)}break}}while(1);Pf(e)}function Wd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:xn},Ul=null,Yu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=fh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?Sd-Ke():(a&4194048)===a?Cd-Ke():0,m=uh(d,m),m!==null)?(Ad=a,e.cancelPendingCommit=m(df.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Kd(e,a,o,!l)):df(e,t,a,n,r,i,o,s,c,l,u,d)}function Gd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Wr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Kd(e,t,n,r){t=ft(e,t),t&=~gd,t&=~hd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-rt(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&vt(e,n,t)}function qd(){return rd&6?!0:(Ff(0,!1),!1)}function Jd(){if(ad!==null){if(sd===0)var e=ad.return;else e=ad,ya=va=null,cs(e),so=null,co=0,e=ad;for(;e!==null;)Cl(e.alternate,e),e=e.return;ad=null}}function Yd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Dp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ad=0,Jd(),id=e,ad=n=Fi(e.current,null),od=t,sd=0,cd=null,ld=!1,ud=dt(e,t),dd=!1,vd=_d=gd=hd=md=pd=0,bd=yd=null,xd=!1,fd=ft(e,t),Ti(),n}function Xd(e,t){Wo=null,ve.H=_c,t===Za||t===$a?(t=ao(),sd=3):t===Qa?(t=ao(),sd=4):sd=t===Pc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,cd=t,ad===null&&(pd=1,Oc(e,Ui(t,e.current)))}function Zd(){var e=No.current;return e===null?!0:(od&4194048)===od?Po===null:(od&62914560)===od||od&536870912?e===Po:!1}function Qd(){var e=ve.H;return ve.H=_c,e===null?_c:e}function $d(){var e=ve.A;return ve.A=td,e}function ef(){pd=4,ld||(od&4194048)!==od&&No.current!==null||(ud=!0),!(md&134217727)&&!(hd&134217727)||id===null||Kd(id,od,_d,!1)}function tf(e,t,n){var r=rd;rd|=2;var i=Qd(),a=$d();(id!==e||od!==t)&&(Td=null,Yd(e,t)),t=!1;var o=pd;a:do try{if(sd!==0&&ad!==null){var s=ad,c=cd;switch(sd){case 8:Jd(),o=6;break a;case 3:case 2:case 9:case 6:No.current===null&&(t=!0);var l=sd;if(sd=0,cd=null,cf(e,s,c,l),n&&ud){o=0;break a}break;default:l=sd,sd=0,cd=null,cf(e,s,c,l)}}nf(),o=pd;break}catch(t){Xd(e,t)}while(1);return t&&e.shellSuspendCounter++,ya=va=null,rd=r,ve.H=i,ve.A=a,ad===null&&(id=null,od=0,Ti()),o}function nf(){for(;ad!==null;)of(ad)}function rf(e,t){var n=rd;rd|=2;var r=Qd(),a=$d();id!==e||od!==t?(Td=null,wd=Ke()+500,Yd(e,t)):ud=dt(e,t);a:do try{if(sd!==0&&ad!==null){t=ad;var o=cd;b:switch(sd){case 1:sd=0,cd=null,cf(e,t,o,1);break;case 2:case 9:if(to(o)){sd=0,cd=null,sf(t);break}t=function(){sd!==2&&sd!==9||id!==e||(sd=7),Pf(e)},o.then(t,t);break a;case 3:sd=7;break a;case 4:sd=5;break a;case 7:to(o)?(sd=0,cd=null,sf(t)):(sd=0,cd=null,cf(e,t,o,7));break;case 5:var s=null;switch(ad.tag){case 26:s=ad.memoizedState;case 5:case 27:var c=ad;if(s?ah(s):c.stateNode.complete){sd=0,cd=null;var l=c.sibling;if(l!==null)ad=l;else{var u=c.return;u===null?ad=null:(ad=u,lf(u))}break b}}sd=0,cd=null,cf(e,t,o,5);break;case 6:sd=0,cd=null,cf(e,t,o,6);break;case 8:Jd(),pd=6;break a;default:throw Error(i(462))}}af();break}catch(t){Xd(e,t)}while(1);return ya=va=null,ve.H=r,ve.A=a,rd=n,ad===null?(id=null,od=0,Ti(),pd):0}function af(){for(;ad!==null&&!We();)of(ad)}function of(e){var t=ml(e.alternate,e,fd);e.memoizedProps=e.pendingProps,t===null?lf(e):ad=t}function sf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Jc(n,t,t.pendingProps,t.type,void 0,od);break;case 11:t=Jc(n,t,t.pendingProps,t.type.render,t.ref,od);break;case 5:cs(t);var r=t;r===ia&&(oa?(fa(r),r.tag===5&&r.stateNode!=null&&(aa=r.stateNode)):(fa(r),oa=!0));default:Cl(n,t),t=ad=Ii(t,fd),t=ml(n,t,fd)}e.memoizedProps=e.pendingProps,t===null?lf(e):ad=t}function cf(e,t,n,r){ya=va=null,cs(t),so=null,co=0;var i=t.return;try{if(Nc(e,i,t,n,od)){pd=1,Oc(e,Ui(n,e.current)),ad=null;return}}catch(t){if(i!==null)throw ad=i,t;pd=1,Oc(e,Ui(n,e.current)),ad=null;return}t.flags&32768?(oa||r===1?e=!0:ud||od&536870912?e=!1:(ld=e=!0,(r===2||r===9||r===3||r===6)&&(r=No.current,r!==null&&r.tag===13&&(r.flags|=16384))),uf(t,e)):lf(t)}function lf(e){var t=e;do{if(t.flags&32768){uf(t,ld);return}e=t.return;var n=xl(t.alternate,t,fd);if(n!==null){ad=n;return}if(t=t.sibling,t!==null){ad=t;return}ad=t=e}while(t!==null);pd===0&&(pd=5)}function uf(e,t){do{var n=Sl(e.alternate,e);if(n!==null){n.flags&=32767,ad=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ad=e;return}ad=e=n}while(e!==null);pd=6,ad=null}function df(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do yf();while(Dd!==0);if(rd&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===id&&(ad=id=null,od=0),kd=t,Od=e,Ad=n,Md=a,Nd=r,ff(e,t,n,s,c,l,f)}}function ff(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(jd=s,s|=wi,_t(e,n,s,r,i,a),Fd=null,(n&335544064)===n?(Id=Ra(e),r=10262):(Id=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Df(N,function(){return U(),null})):(e.callbackNode=null,e.callbackPriority=0),Hl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=ve.T,ve.T=null,i=ye.p,ye.p=2,a=rd,rd|=4;try{_u(e,t,n)}finally{rd=a,ye.p=i,ve.T=r}}Dd=1,Hl?Pd=Hp(o,e.containerInfo,Id,hf,gf,mf,_f,U,pf,null,null):(hf(),gf(),_f())}function pf(e){if(Dd!==0){var t=Od.onRecoverableError;t(e,{componentStack:null})}}function mf(){Dd===3&&(Dd=0,Ru(kd,Od),Dd=4)}function hf(){if(Dd===1){Dd=0;var e=Od,t=kd,n=Ad,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=ve.T,ve.T=null;var i=ye.p;ye.p=2;var a=rd;rd|=4;try{mu=hu=!1,Pu(t,e,n),n=vp;var o=Xr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Yr(s.ownerDocument.documentElement,s)){if(c!==null&&Zr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Jr(s,h),v=Jr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}Eh=!!_p,vp=_p=null}finally{rd=a,ye.p=i,ve.T=r}}e.current=t,Dd=2}}function gf(){if(Dd===2){Dd=0;var e=Od,t=kd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=ve.T,ve.T=null;var r=ye.p;ye.p=2;var i=rd;rd|=4;try{yu(e,t.alternate,t)}finally{rd=i,ye.p=r,ve.T=n}}Dd=3}}function _f(){if(Dd===4||Dd===3){Dd=0;var e=Pd;Pd=null,Ge();var t=Od,n=kd,r=Ad,i=Nd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?Dd=5:(Dd=0,kd=Od=null,vf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Ed=null),St(r),n=n.stateNode,tt&&typeof tt.onCommitFiberRoot==`function`)try{tt.onCommitFiberRoot(et,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=ve.T,a=ye.p,ye.p=2,ve.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{ve.T=n,ye.p=a}}if(i=Fd,o=Id,Id=null,i!==null&&(Fd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Ad&3&&yf(),Pf(t),a=t.pendingLanes,r&261930&&a&42?t===Rd?Ld++:(Ld=0,Rd=t):(Ld=0,Rd=null),Ff(0,!1)}}function vf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Fa(t)))}function yf(){return Pd!==null&&(Pd.skipTransition(),Pd=null),hf(),gf(),_f(),U()}function U(){if(Dd!==5)return!1;var e=Od,t=jd;jd=0;var n=St(Ad),r=ve.T,a=ye.p;try{ye.p=32>n?32:n,ve.T=null,n=Md,Md=null;var o=Od,s=Ad;if(Dd=0,kd=Od=null,Ad=0,rd&6)throw Error(i(331));var c=rd;if(rd|=4,Qu(o.current),Wu(o,o.current,s,n),rd=c,Ff(0,!1),tt&&typeof tt.onPostCommitFiberRoot==`function`)try{tt.onPostCommitFiberRoot(et,o)}catch{}return!0}finally{ye.p=a,ve.T=r,vf(e,t)}}function bf(e,t,n){t=Ui(n,t),t=Ac(e.stateNode,t,2),e=bo(e,t,2),e!==null&&(gt(e,2),Pf(e))}function xf(e,t,n){if(e.tag===3)bf(e,e,n);else for(;t!==null;){if(t.tag===3){bf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Ed===null||!Ed.has(r))){e=Ui(n,e),n=jc(2),r=bo(t,n,2),r!==null&&(Mc(n,r,t,e),gt(r,2),Pf(r));break}}t=t.return}}function Sf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new nd;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(dd=!0,i.add(n),e=Cf.bind(null,e,t,n),t.then(e,e))}function Cf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,id===e&&(od&n)===n&&(pd===4||pd===3&&(od&62914560)===od&&300>Ke()-Sd?rd&2?gd|=n:Yd(e,0):gd|=n,vd===od&&(vd=0)),Pf(e)}function wf(e,t){t===0&&(t=mt()),e=Oi(e,t),e!==null&&(gt(e,t),Pf(e))}function Tf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),wf(e,n)}function Ef(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),wf(e,n)}function Df(e,t){return He(e,t)}var Of=null,kf=null,Af=!1,jf=!1,Mf=!1,Nf=0;function Pf(e){e!==kf&&e.next===null&&(kf===null?Of=kf=e:kf=kf.next=e),jf=!0,Af||(Af=!0,Vf())}function Ff(e,t){if(!Mf&&jf){Mf=!0;do for(var n=!1,r=Of;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-rt(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Bf(r,a))}else a=od,a=ut(r,r===id?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||dt(r,a)||(n=!0,Bf(r,a))}r=r.next}while(n);Mf=!1}}function If(){Lf()}function Lf(){jf=Af=!1;var e=0;Nf!==0&&Tp()&&(e=Nf);for(var t=Ke(),n=null,r=Of;r!==null;){var i=r.next,a=Rf(r,t);a===0?(r.next=null,n===null?Of=i:n.next=i,i===null&&(kf=n)):(n=r,(e!==0||a&3)&&(jf=!0)),r=i}Dd!==0&&Dd!==5||Ff(e,!1),Nf!==0&&(Nf=0)}function Rf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-rt(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=pt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=id,n=od,n=ut(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(sd===2||sd===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ue(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||dt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ue(r),St(n)){case 2:case 8:n=Ye;break;case 32:n=N;break;case 268435456:n=Ze;break;default:n=N}return r=zf.bind(null,e),n=He(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ue(r),e.callbackPriority=2,e.callbackNode=null,2}function zf(e,t){if(Dd!==0&&Dd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(yf()&&e.callbackNode!==n)return null;var r=od;return r=ut(e,e===id?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Ud(e,r,t),Rf(e,Ke()),e.callbackNode!=null&&e.callbackNode===n?zf.bind(null,e):null)}function Bf(e,t){if(yf())return null;Ud(e,t,!0)}function Vf(){Ap(function(){rd&6?He(Je,If):Lf()})}function Hf(){if(Nf===0){var e=Va;e===0&&(e=st,st<<=1,!(st&261888)&&(st=256)),Nf=e}return Nf}function Uf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:bn(e)}function Wf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Uf((i[Dt]||null).action),o=r.submitter;o&&(t=(t=o[Dt]||null)?Uf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Hn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Nf!==0){var e=new FormData(i,o);rc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),rc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Gf=0;Gf<gi.length;Gf++){var Kf=gi[Gf];_i(Kf.toLowerCase(),`on`+(Kf[0].toUpperCase()+Kf.slice(1)))}_i(ci,`onAnimationEnd`),_i(li,`onAnimationIteration`),_i(ui,`onAnimationStart`),_i(`dblclick`,`onDoubleClick`),_i(`focusin`,`onFocus`),_i(`focusout`,`onBlur`),_i(di,`onTransitionRun`),_i(fi,`onTransitionStart`),_i(pi,`onTransitionCancel`),_i(mi,`onTransitionEnd`),Ut(`onMouseEnter`,[`mouseout`,`mouseover`]),Ut(`onMouseLeave`,[`mouseout`,`mouseover`]),Ut(`onPointerEnter`,[`pointerout`,`pointerover`]),Ut(`onPointerLeave`,[`pointerout`,`pointerover`]),Ht(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ht(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ht(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ht(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ht(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ht(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var qf=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),Jf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(qf));function Yf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Si(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Si(e)}i.currentTarget=null,a=c}}}}function Xf(e,t){var n=t[kt];n===void 0&&(n=t[kt]=new Set);var r=e+`__bubble`;n.has(r)||(ep(t,e,2,!1),n.add(r))}function Zf(e,t,n){var r=0;t&&(r|=4),ep(n,e,r,t)}var Qf=`_reactListening`+Math.random().toString(36).slice(2);function $f(e){if(!e[Qf]){e[Qf]=!0,Bt.forEach(function(t){t!==`selectionchange`&&(Jf.has(t)||Zf(t,!1,e),Zf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Qf]||(t[Qf]=!0,Zf(`selectionchange`,!1,t))}}function ep(e,t,n,r){switch(Nh(t)){case 2:var i=Dh;break;case 8:i=Oh;break;default:i=kh}n=i.bind(null,t,n,e),i=void 0,!jn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function tp(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=Pt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}On(function(){var r=a,i=Cn(n),s=[];a:{var c=hi.get(e);if(c!==void 0){var l=Hn,u=e;switch(e){case`keypress`:if(Ln(n)===0)break a;case`keydown`:case`keyup`:l=or;break;case`focusin`:u=`focus`,l=Zn;break;case`focusout`:u=`blur`,l=Zn;break;case`beforeblur`:case`afterblur`:l=Zn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Yn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Xn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=lr;break;case ci:case li:case ui:l=Qn;break;case mi:l=ur;break;case`scroll`:case`scrollend`:l=Wn;break;case`wheel`:l=dr;break;case`copy`:case`cut`:case`paste`:l=$n;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=sr;break;case`submit`:l=cr;break;case`toggle`:case`beforetoggle`:l=fr}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=kn(m,p),g!=null&&d.push(np(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==Sn&&(u=n.relatedTarget||n.fromElement)&&(Pt(u)||u[Ot]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Pt(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Yn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=sr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:It(c),h=l==null?u:It(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Pt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?E(c,l,ip):null,c!==null&&ap(s,u,c,d,!1),l!==null&&f!==null&&ap(s,f,l,d,!0)))}a:{if(c=r?It(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Mr;else if(Er(c)){if(Nr)_=Hr;else{_=Br;var v=zr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&_n(r.elementType)&&(_=Mr):_=Vr;if(_&&=_(e,r)){Dr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?It(r):window,e){case`focusin`:(Er(v)||v.contentEditable===`true`)&&($r=v,ei=r,ti=null);break;case`focusout`:ti=ei=$r=null;break;case`mousedown`:ni=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ni=!1,ri(s,n,i);break;case`selectionchange`:if(Qr)break;case`keydown`:case`keyup`:ri(s,n,i)}var y;if(mr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else Sr?br(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(_r&&n.locale!==`ko`&&(Sr||b!==`onCompositionStart`?b===`onCompositionEnd`&&Sr&&(y=In()):(Nn=i,Pn=`value`in Nn?Nn.value:Nn.textContent,Sr=!0)),v=rp(r,b),0<v.length&&(b=new er(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=xr(n),y!==null&&(b.data=y)))),(y=gr?Cr(e,n):wr(e,n))&&(b=rp(r,`onBeforeInput`),0<b.length&&(v=new er(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Wf(s,e,r,n,i)}Yf(s,t)})}function np(e,t,n){return{instance:e,listener:t,currentTarget:n}}function rp(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=kn(e,n),i!=null&&r.unshift(np(e,i,a)),i=kn(e,t),i!=null&&r.push(np(e,i,a))),e.tag===3)return r;e=e.return}return[]}function ip(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ap(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=kn(n,a),l!=null&&o.unshift(np(n,l,c))):i||(l=kn(n,a),l!=null&&o.push(np(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var op=/\r\n?/g,sp=/\u0000|\uFFFD/g;function cp(e){return(typeof e==`string`?e:``+e).replace(op,`
|
|
9
|
+
`).replace(sp,``)}function lp(e,t){return t=cp(t),cp(e)===t}function up(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||pn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&pn(e,``+r);else return;break;case`className`:Zt(e,`class`,r);break;case`tabIndex`:Zt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Zt(e,n,r);break;case`style`:gn(e,r,o);return;case`data`:if(t!==`object`){Zt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=bn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&up(e,t,`name`,a.name,a,null),up(e,t,`formEncType`,a.formEncType,a,null),up(e,t,`formMethod`,a.formMethod,a,null),up(e,t,`formTarget`,a.formTarget,a,null)):(up(e,t,`encType`,a.encType,a,null),up(e,t,`method`,a.method,a,null),up(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=bn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=xn);return;case`onScroll`:r!=null&&Xf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Xf(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=bn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Xf(`beforetoggle`,e),Xf(`toggle`,e),Xt(e,`popover`,r);break;case`xlinkActuate`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Xt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=vn.get(n)||n,Xt(e,n,r);else return}Jt=!0}function dp(e,t,n,r,a,o){switch(n){case`style`:gn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)pn(e,r);else if(typeof r==`number`||typeof r==`bigint`)pn(e,``+r);else return;break;case`onScroll`:r!=null&&Xf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Xf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=xn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Vt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[Dt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}Jt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Xt(e,n,r)}return}Jt=!0}function fp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Xf(`error`,e),Xf(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:up(e,t,o,s,n,null)}}a&&up(e,t,`srcSet`,n.srcSet,n,null),r&&up(e,t,`src`,n.src,n,null);return;case`input`:Xf(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:up(e,t,r,d,n,null)}}cn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Xf(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:up(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&un(e,!!r,n,!0):un(e,!!r,t,!1);return;case`textarea`:for(s in Xf(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:up(e,t,s,c,n,null)}fn(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:up(e,t,l,r,n,null)}return;case`dialog`:Xf(`beforetoggle`,e),Xf(`toggle`,e),Xf(`cancel`,e),Xf(`close`,e);break;case`iframe`:case`object`:Xf(`load`,e);break;case`video`:case`audio`:for(r=0;r<qf.length;r++)Xf(qf[r],e);break;case`image`:Xf(`error`,e),Xf(`load`,e);break;case`details`:Xf(`toggle`,e);break;case`embed`:case`source`:case`link`:Xf(`error`,e),Xf(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:up(e,t,u,r,n,null)}return;default:if(_n(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&dp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&up(e,t,c,r,n,null))}var pp={};function mp(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||up(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(Jt=!0),o=m;break;case`name`:m!==f&&(Jt=!0),a=m;break;case`checked`:m!==f&&(Jt=!0),u=m;break;case`defaultChecked`:m!==f&&(Jt=!0),d=m;break;case`value`:m!==f&&(Jt=!0),s=m;break;case`defaultValue`:m!==f&&(Jt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&up(e,t,p,m,r,f)}}sn(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||up(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(Jt=!0),p=o;break;case`defaultValue`:o!==l&&(Jt=!0),c=o;break;case`multiple`:o!==l&&(Jt=!0),s=o;default:o!==l&&up(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?un(e,!!n,n?[]:``,!1):un(e,!!n,t,!0)):un(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:up(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(Jt=!0),p=a;break;case`defaultValue`:a!==o&&(Jt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&up(e,t,s,a,r,o)}dn(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:up(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(Jt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:up(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&up(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:up(e,t,u,p,r,m)}return;default:if(_n(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&dp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||dp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&up(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||up(e,t,f,p,r,m)}function hp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function gp(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&hp(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&hp(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var _p=null,vp=null;function yp(e){return e.nodeType===9?e:e.ownerDocument}function bp(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function xp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Sp(e,t,n,r){return n=yp(n).createElement(e),n[Et]=r,n[Dt]=t,fp(n,e,t),Rt(n),n}function Cp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var wp=null;function Tp(){var e=window.event;return e&&e.type===`popstate`?e!==wp&&(wp=e,!0):(wp=null,!1)}var Ep=typeof setTimeout==`function`?setTimeout:void 0,Dp=typeof clearTimeout==`function`?clearTimeout:void 0,Op=typeof Promise==`function`?Promise:void 0,kp=typeof requestAnimationFrame==`function`?requestAnimationFrame:Ep,Ap=typeof queueMicrotask==`function`?queueMicrotask:Op===void 0?Ep:function(e){return Op.resolve(null).then(e).catch(jp)};function jp(e){setTimeout(function(){throw e})}function Mp(e){return e===`head`}function Np(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Qh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Dm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Dm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[I]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Dm(e.ownerDocument.body)}n=i}while(n);Qh(t)}function Pp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Fp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ip(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Lp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Rp(e){return Lp(e.getBoundingClientRect(),getComputedStyle(e),e)}function zp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Lp(t,n,e)}function Bp(e){return e.documentElement.clientHeight}function Vp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Hp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Bp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=oh(f),u>lh){s.length=o;break}f=new Promise(Vp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Up(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Up.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Up.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Up.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Wp(e){return{name:e,group:new Up(`group`,e),imagePair:new Up(`image-pair`,e),old:new Up(`old`,e),new:new Up(`new`,e)}}function Gp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Gp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Xp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Jp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),m(this._fragmentFiber.child,!1,Kp,e,s,r)}this._eventListeners=a}};function Kp(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Gp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Xp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Jp(i.optionsOrUseCapture),m(this._fragmentFiber.child,!1,qp,e,n,i),r.splice(t,1),a!==null&&a()}};function qp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Jp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Yp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Xp(e,t,n,r){if(e.length===0)return-1;r=Yp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Yp(a.optionsOrUseCapture)===r)return i}return-1}Gp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Jp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Jp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Gp.prototype.focus=function(e){m(this._fragmentFiber.child,!0,Zp,e,void 0,void 0)};function Zp(e,t){return e.tag!==6&&(e=b(e),Cm(e,t))}Gp.prototype.focusLast=function(e){var t=[];m(this._fragmentFiber.child,!0,Qp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Zp(t[n],e);n--);};function Qp(e,t){return t.push(e),!1}Gp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=yp(e).activeElement,e!==null&&m(this._fragmentFiber.child,!1,$p,e,void 0,void 0))};function $p(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Gp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),m(this._fragmentFiber.child,!1,em,e,void 0,void 0)};function em(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}Gp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),m(this._fragmentFiber.child,!1,tm,e,void 0,void 0);for(var n=t=0;n<nm.length;n++){var r=nm[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):nm[t++]=r}nm.length=t}};function tm(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var nm=[],rm=!1;function im(e,t,n){nm.push({fragmentInstance:e,observer:t,instance:n}),rm||(rm=!0,wm(function(){rm=!1;var e=nm;nm=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Gp.prototype.getClientRects=function(){var e=[];return m(this._fragmentFiber.child,!1,am,e,void 0,void 0),e};function am(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Gp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Gp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];m(this._fragmentFiber.child,!1,Qp,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||om(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function om(e,t,n,r,i){var a=Pt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(m(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(m(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function sm(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Gp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];m(this._fragmentFiber.child,!1,Qp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),sm(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=b(a),sm(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function cm(e,t){return e=b(e),lm(e,t),!1}function lm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function um(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Jp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<nm.length;i++){var a=nm[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(nm[r++]=a)}nm.length=r,n.observe(e)}),lm(e,t))}function dm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Jp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?im(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function fm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:fm(n),Nt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function pm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[I])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=ym(e.nextSibling),e===null)break}return null}function mm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=ym(e.nextSibling),e===null))return null;return e}function hm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=ym(e.nextSibling),e===null))return null;return e}function gm(e){return e.data===`$?`||e.data===`$~`}function _m(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function vm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function ym(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var bm=null;function xm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return ym(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Sm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function Cm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function wm(e){kp(function(){kp(function(t){return e(t)})})}function Tm(e,t,n){switch(t=yp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Em(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&up(e,t,r,null,pp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===xn&&(e.onclick=null),Nt(e)}function Dm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Nt(e)}var Om=new Map,km=new Set;function Am(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var jm=ye.d;ye.d={f:Mm,r:Nm,D:Im,C:Lm,L:Rm,m:zm,X:Vm,S:Bm,M:Hm};function Mm(){var e=jm.f(),t=qd();return e||t}function Nm(e){var t=Ft(e);t!==null&&t.tag===5&&t.type===`form`?ac(t):jm.r(e)}var Pm=typeof document>`u`?null:document;function Fm(e,t,n){var r=Pm;if(r&&typeof t==`string`&&t){var i=on(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),km.has(i)||(km.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),fp(t,`link`,e),Rt(t),r.head.appendChild(t)))}}function Im(e){jm.D(e),Fm(`dns-prefetch`,e,null)}function Lm(e,t){jm.C(e,t),Fm(`preconnect`,e,t)}function Rm(e,t,n){jm.L(e,t,n);var r=Pm;if(r&&e&&t){var i=`link[rel="preload"][as="`+on(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+on(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+on(n.imageSizes)+`"]`)):i+=`[href="`+on(e)+`"]`;var a=i;switch(t){case`style`:a=Wm(e);break;case`script`:a=Jm(e)}if(!(Om.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Om.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Gm(a))||t===`script`&&r.querySelector(Ym(a))))){var o=r.createElement(`link`);fp(o,`link`,e),t===`style`&&(o[Mt]=!0,o.onload=o.onerror=function(){zt(o)}),Rt(o),r.head.appendChild(o)}}}function zm(e,t){jm.m(e,t);var n=Pm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+on(r)+`"][href="`+on(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Jm(e)}if(!Om.has(a)&&(e=D({rel:`modulepreload`,href:e},t),Om.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ym(a)))return}r=n.createElement(`link`),fp(r,`link`,e),Rt(r),n.head.appendChild(r)}}}function Bm(e,t,n){jm.S(e,t,n);var r=Pm;if(r&&e){var i=Lt(r).hoistableStyles,a=Wm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Gm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Om.get(a))&&Qm(e,n);var c=o=r.createElement(`link`);Rt(c),fp(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Zm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Vm(e,t){jm.X(e,t);var n=Pm;if(n&&e){var r=Lt(n).hoistableScripts,i=Jm(e),a=r.get(i);a||(a=n.querySelector(Ym(i)),a||(e=D({src:e,async:!0},t),(t=Om.get(i))&&$m(e,t),a=n.createElement(`script`),Rt(a),fp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Hm(e,t){jm.M(e,t);var n=Pm;if(n&&e){var r=Lt(n).hoistableScripts,i=Jm(e),a=r.get(i);a||(a=n.querySelector(Ym(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=Om.get(i))&&$m(e,t),a=n.createElement(`script`),Rt(a),fp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Um(e,t,n,r){var a=(a=Oe.current)?Am(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Wm(n.href),t=Lt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Wm(n.href);var o=Lt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Gm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Om.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Om.set(e,o)),qm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Jm(n),t=Lt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Wm(e){return`href="`+on(e)+`"`}function Gm(e){return`link[rel="stylesheet"][`+e+`]`}function Km(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function qm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Mt]){r.loading=1;return}}else t=e.createElement(`link`),t[Mt]=!0,t.onload=t.onerror=zt.bind(null,t),fp(t,`link`,n),Rt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Jm(e){return`[src="`+on(e)+`"]`}function Ym(e){return`script[async]`+e}function Xm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+on(n.href)+`"]`);if(r)return t.instance=r,Rt(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Rt(r),fp(r,`style`,a),Zm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Wm(n.href);var o=e.querySelector(Gm(a));if(o)return t.state.loading|=4,t.instance=o,Rt(o),o;r=Km(n),(a=Om.get(a))&&Qm(r,a),o=(e.ownerDocument||e).createElement(`link`),Rt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),fp(o,`link`,r),t.state.loading|=4,Zm(o,n.precedence,e),t.instance=o;case`script`:return o=Jm(n.src),(a=e.querySelector(Ym(o)))?(t.instance=a,Rt(a),a):(r=n,(a=Om.get(o))&&(r=D({},n),$m(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Rt(a),fp(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Zm(r,n.precedence,e));return t.instance}function Zm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Qm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function $m(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var eh=null;function th(e,t,n){if(eh===null){var r=new Map,i=eh=new Map;i.set(n,r)}else i=eh,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[I]||a[Et]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function nh(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function rh(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function ih(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function ah(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function oh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function sh(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=oh(t),e.suspenseyImages.push(t)),e=ph.bind(e),t.decode().then(e,e))}function ch(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Wm(r.href),a=t.querySelector(Gm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=fh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Rt(a);return}a=t.ownerDocument||t,r=Km(r),(i=Om.get(i))&&Qm(r,i),a=a.createElement(`link`),Rt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),fp(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=fh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var lh=0;function uh(e,t){return e.stylesheets&&e.count===0&&hh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&hh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&lh===0&&(lh=62500*gp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&hh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>lh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function dh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)hh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function fh(){this.count--,dh(this)}function ph(){this.imgCount--,dh(this)}var mh=null;function hh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,mh=new Map,t.forEach(gh,e),mh=null,fh.call(e))}function gh(e,t){if(!(t.state.loading&4)){var n=mh.get(e);if(n)var r=n.get(null);else{n=new Map,mh.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=fh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var _h={$$typeof:ie,Provider:null,Consumer:null,_currentValue:be,_currentValue2:be,_threadCount:0};function vh(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ht(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ht(0),this.hiddenUpdates=ht(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function yh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new vh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ni(3,null,null,t),e.current=a,a.stateNode=e,t=Pa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},_o(a),e}function bh(e){return e?(e=ji,e):ji}function xh(e,t,n,r,i,a){i=bh(i),r.context===null?r.context=i:r.pendingContext=i,r=yo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=bo(e,r,t),n!==null&&(Hd(n,e,t),xo(n,e,t))}function Sh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ch(e,t){Sh(e,t),(e=e.alternate)&&Sh(e,t)}function wh(e){if(e.tag===13||e.tag===31){var t=Oi(e,67108864);t!==null&&Hd(t,e,67108864),Ch(e,67108864)}}function Th(e){if(e.tag===13||e.tag===31){var t=zd();t=xt(t);var n=Oi(e,t);n!==null&&Hd(n,e,t),Ch(e,t)}}var Eh=!0;function Dh(e,t,n,r){var i=ve.T;ve.T=null;var a=ye.p;try{ye.p=2,kh(e,t,n,r)}finally{ye.p=a,ve.T=i}}function Oh(e,t,n,r){var i=ve.T;ve.T=null;var a=ye.p;try{ye.p=8,kh(e,t,n,r)}finally{ye.p=a,ve.T=i}}function kh(e,t,n,r){if(Eh){var i=Ah(r);if(i===null)tp(e,t,r,jh,n),Hh(e,r);else if(Wh(i,e,t,n,r))r.stopPropagation();else if(Hh(e,r),t&4&&-1<Vh.indexOf(e)){for(;i!==null;){var a=Ft(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=lt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-rt(o);s.entanglements[1]|=c,o&=~c}Pf(a),!(rd&6)&&(wd=Ke()+500,Ff(0,!1))}}break;case 31:case 13:s=Oi(a,2),s!==null&&Hd(s,a,2),qd(),Ch(a,2)}if(a=Ah(r),a===null&&tp(e,t,r,jh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else tp(e,t,r,null,n)}}function Ah(e){return e=Cn(e),Mh(e)}var jh=null;function Mh(e){if(jh=null,e=Pt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return jh=e,null}function Nh(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(qe()){case Je:return 2;case Ye:return 8;case N:case Xe:return 32;case Ze:return 268435456;default:return 32}default:return 32}}var Ph=!1,Fh=null,Ih=null,Lh=null,Rh=new Map,zh=new Map,Bh=[],Vh=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Hh(e,t){switch(e){case`focusin`:case`focusout`:Fh=null;break;case`dragenter`:case`dragleave`:Ih=null;break;case`mouseover`:case`mouseout`:Lh=null;break;case`pointerover`:case`pointerout`:Rh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:zh.delete(t.pointerId)}}function Uh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Ft(t),t!==null&&wh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Wh(e,t,n,r,i){switch(t){case`focusin`:return Fh=Uh(Fh,e,t,n,r,i),!0;case`dragenter`:return Ih=Uh(Ih,e,t,n,r,i),!0;case`mouseover`:return Lh=Uh(Lh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Rh.set(a,Uh(Rh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,zh.set(a,Uh(zh.get(a)||null,e,t,n,r,i)),!0}return!1}function Gh(e){var t=Pt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,wt(e.priority,function(){Th(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,wt(e.priority,function(){Th(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Kh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ah(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Sn=r,n.target.dispatchEvent(r),Sn=null}else return t=Ft(n),t!==null&&wh(t),e.blockedOn=n,!1;t.shift()}return!0}function qh(e,t,n){Kh(e)&&n.delete(t)}function Jh(){Ph=!1,Fh!==null&&Kh(Fh)&&(Fh=null),Ih!==null&&Kh(Ih)&&(Ih=null),Lh!==null&&Kh(Lh)&&(Lh=null),Rh.forEach(qh),zh.forEach(qh)}function Yh(e,n){e.blockedOn===n&&(e.blockedOn=null,Ph||(Ph=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Jh)))}var Xh=null;function Zh(e){Xh!==e&&(Xh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Xh===e&&(Xh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Mh(r||n)===null)continue;break}var a=Ft(n);a!==null&&(e.splice(t,3),t-=3,rc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Qh(e){function t(t){return Yh(t,e)}Fh!==null&&Yh(Fh,e),Ih!==null&&Yh(Ih,e),Lh!==null&&Yh(Lh,e),Rh.forEach(t),zh.forEach(t);for(var n=0;n<Bh.length;n++){var r=Bh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Bh.length&&(n=Bh[0],n.blockedOn===null);)Gh(n),n.blockedOn===null&&Bh.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[Dt]||null;if(typeof a==`function`)o||Zh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Dt]||null)s=o.formAction;else if(Mh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Zh(n)}}}function $h(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function eg(e){this._internalRoot=e}tg.prototype.render=eg.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;xh(n,zd(),e,t,null,null)},tg.prototype.unmount=eg.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;xh(e.current,2,null,e,null,null),qd(),t[Ot]=null}};function tg(e){this._internalRoot=e}tg.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ct();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Bh.length&&t!==0&&t<Bh[n].priority;n++);Bh.splice(n,0,e),n===0&&Gh(e)}};var ng=n.version;if(ng!==`19.3.1`)throw Error(i(527,ng,`19.3.1`));ye.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var rg={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:ve,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var ig=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ig.isDisabled&&ig.supportsFiber)try{et=ig.inject(rg),tt=ig}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Tc,s=Ec,c=Dc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=yh(e,1,!1,null,null,n,r,null,o,s,c,$h),e[Ot]=t.current,$f(e),new eg(t)}})),_=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=c(d(),1),y=_(),b=e=>e.length<2?e[0]??``:`${e.slice(0,-1).join(`, `)} and ${e.at(-1)}`,x=e=>`${Math.round(e*1e3)/10}%`,S=e=>e.n?x(e.k/e.n):`-`,C={entry:`a route`,call:`a call`,"topic-in":`a topic listened to`,"topic-out":`a topic published`,config:`a config key`},w={app:{dismiss:`Close`,loading:`Loading`,andMore:e=>`and ${e} more`,cantLoad:e=>`Couldn't load this: ${e}`,tryAgain:`Try again`,scrollTable:e=>`Table: ${e} (scrolls sideways)`,scrollCode:`Code block (scrolls sideways)`,changePicker:`Change`,noChanges:`No changes yet`,offline:`The Atticus server isn't answering. Check that atticus ui is still running in its terminal (start it again with atticus ui if it stopped), then press Try again or reload the page.`,serverAnswered:(e,t)=>t?`The server answered ${e}: ${t}`:`The server answered ${e}, with no reason given.`,notJson:e=>`The server answered with something that isn't Atticus's (status ${e}). Check that the address is the one atticus ui printed.`,offlinePanel:`The Atticus server the extension started isn't answering. Run Atticus: Open the app from the Command Palette to start it again, then press Try again.`,offlineShort:`the server isn't answering (the note above the page says how to fix it)`,notLoadedOffline:`Not loaded: the server isn't answering (the note above the page says how to fix it).`,restarted:`The Atticus app restarted, so this page's session ended. Reload the page to go on where you were.`,otherMetarepo:`The Atticus app at this address now shows another metarepo, so this page sent it nothing. Reload the page to see that one.`,notResentTitle:`Not sent`,notResent:`The Atticus app restarted while you did this, so it wasn't sent: nothing was changed. Do it again.`,reload:`Reload the page`,online:`The server is answering again.`,jobEnded:(e,t)=>t?`It ${e===`cancelled`?`was stopped`:`failed`}: ${t}`:e===`cancelled`?`It was stopped before it finished.`:`It failed; the Console has what it printed.`,working:`Working on it…`,ccReading:`Reading your metarepo…`,ccCantRead:`Couldn't read what needs attention: each panel below says why.`,notLoaded:`not loaded`,checking:`Checking…`,checkedAt:e=>`Checked again at ${e}.`,newTab:`(opens in a new tab)`,askEmpty:`Type a question first.`,tourEscape:`Esc closes the tour`,needId:`Type a record id first, for example ledger-db.account. The Knowledge explorer finds one.`,needFolder:`Type the folder for the sandbox first: a new, empty one.`,noExecutors:`No tool is set up on this machine yet, so there is nothing to check.`,forceSnow:`To replace it, tick “Replace a snow.md a person edited” and draft again.`,forceStories:e=>`Edit ${e}'s stories on Stories, or replace them with Draft the stories again.`,panelNoSave:(e,t)=>`The VS Code panel can't save files, so ${e} wasn't saved. Copy the text below into a file, or run ${t} in a terminal.`},artifactStatus:{written:`Written`,notWritten:`Not written yet`,needsWork:`Written, not passing yet`,ready:`Can be written now`,blocked:`Waits on an earlier stage`,notRequired:`Not needed`},theme:{label:`Theme`,hint:`System follows your computer's light or dark setting.`,choices:{system:`System`,light:`Light`,dark:`Dark`}},findings:{needsReason:`Not relevant and Waive need a reason: type it above first.`,cantWaive:`This rule can't be waived`},flows:{title:`Flows`,intro:`Each flow is what happens, step by step, when something starts it: who calls, what the code does, and the components, tables and topics it reaches. Every step cites the file and line it was read from.`,repo:`Repo`,filter:`Find a flow`,filterHint:`Name, id or what starts it`,listTitle:`Flows`,noSpecs:`No repo has a spec yet. Draft one with atticus spec draft <repo>, or /atticus-spec in Copilot Chat or Claude Code.`,noFlows:`This repo's spec has no flows yet.`,noFlowsSpec:e=>`Its spec step reads ${e} and writes its flows, one per trigger, each step cited. A change's diagram can take a step out of a flow only once the flow is here.`,noMatch:`No flow matches. Try part of its name or what starts it.`,pick:`Pick a flow from the list to see its steps.`,counts:(e,t)=>`${e} step${e===1?``:`s`}, ${t} confirmed`,unreadable:`These files don't read:`,file:`File`,copyFile:`Copy the file's path`,calledBy:`Called by`,notJoined:`The estate pass hasn't run, so calls to other repos aren't linked to their flows. Join them here.`,start:`Start`,goesTo:(e,t)=>`Goes to ${e} on ${t}.`,backTo:e=>`Goes back to ${e}.`,opens:(e,t)=>`Opens "${e}" in ${t}`,unjoined:e=>`Not linked to a flow: ${e}`,more:e=>`and ${e} more`,confirmed:{check:`Confirmed by the check`,ai:`Confirmed by the AI`,person:`Confirmed by a person`},notConfirmed:`Not confirmed yet`,errorsTitle:`When it goes wrong`,noErrors:`The spec names no error paths for this flow.`,diagram:e=>`The steps of ${e}`,lanes:{caller:`starts it`,gateway:`gateway`,self:`runs the flow`,component:`called`,store:`table`,topic:`topic`},kinds:{endpoint:`Endpoint`,action:`Action`,page:`Page`,listener:`Listener`,job:`Job`,entry:`Entry`,lookup:`Lookup`,read:`Read`,write:`Write`,"call-out":`Call`,publish:`Publish`,transform:`Transform`,validate:`Validate`,branch:`Branch`,log:`Log`,respond:`Respond`,loop:`Loop`,retry:`Retry`},openFlows:`Flows of this repo`,frame:(e,t,n)=>`${e===`retry`?`Retry`:`Loop`}: steps ${t} to ${n} again`,marks:{added:`Added`,changed:`Changed`,removed:`Removed`},was:e=>`Before: ${e}`,newLane:`new`,change:`Change`,pickRepo:`A repo's flows`,changeIntro:`The flows this change adds, changes or removes, each drawn beside today's: added steps say Added, changed ones say Changed with what they did before, removed ones say Removed and are struck through.`,noTargets:e=>`${e} has no target flows yet. The change's architecture stage writes them:`,targetsTitle:`Target flows`,targetCounts:(e,t,n)=>[e?`${e} added`:``,t?`${t} changed`:``,n?`${n} removed`:``].filter(Boolean).join(`, `)||`no step changes`,deltaKinds:{new:`New flow`,modify:`Changed flow`,remove:`Removed flow`},whyChange:`Why`,openTargets:`Its target flows`},questions:{proposal:{title:`Proposed by your assistant`,listed:`An answer is proposed`,notYet:e=>`${e} read the code and proposes this. It is not an answer until you accept it.`,option:(e,t)=>`Option ${e}: ${t}`,words:e=>`In words: ${e}`,cites:`The lines it rests on (each checked: the quoted words are on that line)`,accept:`Accept as my answer`,accepting:`Accepting…`,orAnswer:`Or answer it yourself below.`,askTitle:`Ask AI to propose answers`,askWhy:`Your assistant reads the code and config behind each open question and proposes an answer with the lines it rests on. Atticus checks every line it cites and shows each proposal on its question; nothing is answered until you accept it or answer otherwise.`,askWhyAuto:`Your assistant reads the code and config behind each open question and proposes an answer with the lines it rests on. Atticus checks every line it cites. Each proposal for an option question that meets the bar (the code's shapes rank that option first, or a person's rule says the same) is applied as the AI's answer, marked Detected by AI, never as yours: correct any that is wrong. The rest wait on their questions for you to accept or answer otherwise.`,askWhyPaused:e=>`AI deciding is paused (${e}), so each proposal waits on its question for you to accept or answer otherwise.`,askHandoff:`Hand it to my assistant`,askHandingOff:`Handing it off…`,askWaiting:e=>`Handed off as run ${e}. In a NEW Copilot Chat (agent mode) or Claude Code session at the metarepo, run the line below. When it has written its proposals, press Done: Atticus reads them in.`,askDone:`Done: read the proposals in`,askReading:`Reading the proposals in…`,askRead:`Read in.`,askTerminal:`Or in a terminal:`,askSlash:`In Copilot Chat or Claude Code, at the metarepo:`,askCommand:`Or in a terminal (where runtime.yaml allows copilot-acp, it runs in a new Copilot session):`,askCopy:`Copy`,command:e=>`atticus questions answer ${e} --accept-proposal`},title:`Questions`,intro:`When something isn't settled, Atticus asks here, and each question goes to the person whose role answers it. Your answer is saved with the question; then Apply uses it, and Propose for review sends it for review.`,changeIntro:e=>`The questions ${e}'s steps asked. Your answer is written to the question's file in questions/; then the step that asked it runs again and reads it.`,onlyChange:e=>`Only the questions ${e}'s steps asked.`,showAll:`Show every question`,filter:`Show`,filterOpen:`Open`,filterAll:`All`,listTitle:`Questions`,empty:`No question waits for an answer. When a step needs a person to settle something, it asks here.`,emptyAll:`No questions yet. When a step needs a person to settle something, it asks here.`,emptyChange:e=>`No question for ${e} waits for an answer.`,emptyChangeAll:e=>`No question for ${e} yet.`,unreadable:e=>`${e} isn't a valid question file.`,pickFromList:`Pick a question from the list to answer it.`,kind:`Kind`,kindSteps:e=>e===void 0?`From the steps`:`From the steps (${e})`,kindOwner:e=>e===void 0?`Owner questions`:`Owner questions (${e})`,ownerQuestions:{title:`Owner questions`,intro:`An owner question asks a system's owner for a fact the code can't give. Ask the owner, then record what they said here: it is written to catalog/curated/ownerquestion/<id>.yaml, which every scan keeps. The gap itself closes once the fact is in the catalog.`,empty:`No owner questions: the catalog has every fact its checks need.`,emptyCatalog:`The catalog is empty, so nothing is asked yet. Read the repos first (Set up), and the owner questions appear here.`,ask:(e,t,n)=>`For ${e} · about ${t} · by ${n}`,channels:{ado:`Azure DevOps`,teams:`Microsoft Teams`,email:`email`,Atticus:`Atticus`},sentTo:(e,t,n)=>`Sent to ${e} by ${t}${n?` on ${n}`:``}. Record their answer below when it comes.`,overdueTo:(e,t,n)=>`Sent to ${e} by ${t}${n?` on ${n}`:``}, and no answer yet: it is overdue.`,sent:`SENT`,asked:`ASKED`,askedStep:e=>`Asked: a step for ${e}. It waits for you to send it (Home › Manual steps); record their answer here when it comes.`,notSent:`NOT SENT YET`,notSentTo:(e,t)=>`Not sent to ${e} yet. Send it by ${t} below, or copy the question and ask them; then record their answer here.`,nobody:`Nobody owns it`,toRole:e=>`the ${e}`,teamWords:e=>`${e} team`,overdue:`OVERDUE`,routeTo:e=>`Nobody owns it: it goes to the ${e}.`,needs:e=>`Needs: ${e}`,fill:(e,t)=>`The fact itself goes in org-pack/${e}: ${t}.`,answered:`ANSWERED`,answeredWas:e=>`Recorded answer: ${e}`,answerLabel:`The owner's answer`,answerAgain:`Change the recorded answer`,save:`Record the answer`,saving:`Recording…`,saved:e=>`Recorded in ${e}. The gap closes once the fact is in the catalog. Propose it for review below.`,needAnswer:`Write what the owner said first.`,fromFinding:(e,t,n)=>`Asked from ${e}'s ${t} review (${n}): the hand-off waits for this answer.`,savedGap:e=>`Recorded the answer as yours. The gap is closed at the ${e} gate; the next draft reads the answer.`,command:e=>`atticus questions owner ${e} --text "…"`,copyCommand:`Copy the command`},askedBy:(e,t)=>`Asked by ${e} on ${t}`,askedWhen:{verify:(e,t)=>`Asked when Atticus checked ${e}'s map on ${t}`,read:(e,t)=>`Asked when Atticus read ${e} on ${t}`,stage:(e,t,n)=>`Asked at the ${e} stage of ${t} on ${n}`,step:(e,t)=>`Asked by Atticus's ${e} step on ${t}`},whenApplied:e=>`when the answers are next applied to ${e}'s map`,pickBelow:`pick this and the list of every repo, system and team opens below; it takes the one you name`,copyId:`Copy the id`,toAnswer:(e,t,n)=>`${e} question${e===1?``:`s`} to answer: ${t} from the steps, ${n} owner question${n===1?``:`s`}`,counts:{label:e=>e?`Questions from the steps in ${e}`:`Questions from the steps, in the estate`,caption:`From the steps`,open:`Open`,answered:`Answered`,retired:`Retired`,total:`All`,progress:e=>`${e}% settled`,repos:e=>`${e} repo${e===1?``:`s`}`},bulk:{pick:e=>`Pick ${e} to answer with others`,pickRepo:e=>`Pick every open question in ${e}`,title:e=>`Answer ${e} question${e===1?``:`s`} the same way`,more:e=>`and ${e} more`,how:`Answer with`,byTarget:`Where the calls go`,byWords:`Your own words`,targetLabel:`Repo, system or team`,hint:`Each picked question gets this answer for its own repo, as if answered one by one. A question it doesn't fit says why; the rest are still answered.`,needTarget:`Name the repo, system or team the calls go to.`,submit:e=>`Answer ${e}`,busy:`Answering…`,clear:`Clear the picks`,done:e=>`Answered ${e}.`,next:`atticus verify --all --write`},groupOf:(e,t)=>`${e}: ${t} question${t===1?``:`s`}`,evidence:`What it read`,notShown:`Not shown: the file isn't here, or the line is past its end.`,excerptOf:e=>`The code at ${e}`,options:`Your answer`,optionChanges:`It would change`,notApplied:`This answer isn't in the map yet. Apply puts it there:`,notProposed:`This answer is in the map, not proposed for review yet:`,ownWords:`In my own words`,ownWordsLabel:`Your answer, in your own words`,ownWordsJoin:`Name a repo, component or system Atticus knows. Words that name none are refused, never drawn as a box: for a new outside system, choose it from the list above; if these aren't real calls, choose Ignore.`,ignore:{label:`Ignore: not a real call (e.g. CI/CD, a test, a template)`,means:`These aren't real calls: a CI/CD job, a test or a template, not code that runs. The join leaves them, no box is drawn for them, and this isn't asked again.`,reason:`Why (optional)`,answered:(e,t,n)=>`Ignored by ${e} on ${t}: not a real call${n?` (${n})`:``}`},scope:`Who the answer is for`,scopeRepo:e=>`This repo only (${e})`,scopeChange:e=>`This change only (${e})`,scopeType:e=>`Every repo of type ${e}`,scopeTypeOther:`Every repo of a type`,typeLabel:`The repo type`,proposed:`proposed`,submit:`Save the answer`,saving:`Saving`,pickOne:`Pick one of the options, or answer in your own words.`,needWords:`Write your answer, or pick one of the options.`,needType:`Say which repo type the answer is for, or keep it to this repo.`,saved:e=>`Saved to ${e}.`,skillWritten:e=>`Also written under Answers in ${e}.`,skillMissing:e=>`${e} isn't there yet, so the answer is kept in the question file, with that path.`,next:`Apply it to the map, then propose it for review.`,nextStage:`Run the step it came from again, from here:`,orCommandLine:`Or in a terminal:`,copy:`Copy the command`,answered:(e,t)=>`Answered by ${e} on ${t}`,retired:`This question is retired; nothing reads its answer.`,change:`Change the answer`,whose:`Whose`,whoseAll:`Everyone's`,whoseMine:`My teams'`,owner:(e,t)=>`Owner: ${t?`${t} (${e})`:e}`,noOwner:e=>`No owner: ${e}`,forRole:e=>`For ${e}`,restsOn:e=>{let t=typeof e==`string`?[e]:e;return`Ask first: ${t.join(`, `)} ${t.length===1?`rests`:`rest`} on it`},joins:e=>`Its answer joins ${e} ${e===1?`call`:`calls`}`,mineTeams:e=>`Questions for your teams: ${e}.`,mineNone:e=>`${e} is on no team in org-pack/roles.yaml, so no question is yours here. Add yourself under a team's people there (schemaVersion 2), or show everyone's.`,emptyMine:`No questions are waiting for your teams.`,changeOwner:(e,t)=>`Owner: the people of ${e} (${(typeof t==`string`?[t]:t).join(`, `)})`,mineChanges:e=>`Questions of the changes that name ${e} under owners. ${e} is on no team in org-pack/roles.yaml.`,rule:{label:`Answer by rule (optional)`,hint:`A host pattern (*.payments.forge.internal) or a path prefix (/forge/limits/**): your answer then covers every call that matches, the calls found later too, in the repos the scope above allows.`,answered:e=>`By rule: every call matching ${e}`,offer:(e,t,n)=>`Answer once for all ${e}: ${n} is filled in, so this answer covers the ${t} calls of the ${e} open questions like this one, and the others retire on the next verify --write. Clear it to answer this one only.`,offerListed:(e,t)=>`One answer covers all ${e}: ${t}`},another:{label:`Which repo, system or team`,loading:`Loading the repos, systems and teams…`,failed:e=>`The list didn't load: ${e}`,empty:`The org pack lists no repos, systems or teams yet. Answer in your own words instead.`,choose:`Choose one`,repos:`Repos of the manifest`,systems:`Systems of the profile`,teams:`Teams in roles.yaml`,notRead:`not read yet`,noSystem:`no system yet`,newVendor:`An outside system (new): its name`,newVendorHint:`Leave the list on “Choose one” and type the system's name to add it to the profile: a short name (letters, digits, spaces and dashes, up to 40 characters), not a sentence. If these aren't real calls, choose Ignore instead.`,pickOne:`Choose a repo, system or team, or type a new outside system's name.`,addTeam:(e,t)=>`${e} has no system yet: add ${t} (another team's, owner ${e}) to the profile, as a file change for review in the pull request`,addVendor:e=>`Add ${e} to the profile as a vendor, as a file change for review in the pull request`,needAdd:`Tick the box to add the system to the profile, or choose one that is listed.`,added:(e,t)=>`Wrote the system ${e} into ${t}; review it in the same pull request.`},reopened:(e,t,n)=>`Asked again on ${n}: you answered ${t}, and ${e}`,fromProposal:(e,t)=>`It was ${e}'s proposal (${t}), confirmed by the person who answered. It cited:`,fromAiProposal:(e,t,n)=>`${e} proposed it (${t}) and Atticus applied it as the AI's from run ${n}, because it met the bar. No person has confirmed it. It cited:`,changeAiAnswer:`To change the AI's answer, Correct it above: your answer is recorded as yours, and Apply to similar spreads it to the questions like it.`},knowledge:{nav:{sources:`Knowledge sources`,documents:`Documents`,items:`Knowledge items`,search:`Search the wikis`,parties:`Teams, vendors and products`,orgpack:`Org pack from the wikis`},emptyGo:`Open Knowledge sources to add or sync a wiki`,documents:{title:`Documents`,intro:`Files dropped in the metarepo's inputs/ are general knowledge: decisions, runbooks, specs, request forms and slides. Sync reads them into a snapshot, and your assistant reads that into knowledge items, each quote checked against the file. A file for one change only goes in that change's Files attached instead.`,add:`Add files`,adding:`Adding…`,added:e=>`Added ${e} file${e===1?``:`s`} to inputs/inbox/. Commit them through a pull request.`,sync:`Sync inputs/`,syncing:`Syncing…`,syncedNow:`inputs/ is read into a new snapshot. Your assistant reads it into items next.`,listTitle:`Files in inputs/`,empty:`Nothing in inputs/ yet. Add files here, or run atticus intake add <files>.`,neverSynced:`Not synced yet: Sync reads what can be read into a snapshot.`,synced:(e,t,n)=>`Snapshot of ${e}: ${t} of ${n} file${n===1?``:`s`} read.`,kindLabel:`Kind`,anyKind:`Any kind`,systemLabel:`System`,anySystem:`Any system`,filtered:`documents`,kinds:{document:`Document`,spreadsheet:`Spreadsheet`,diagram:`Diagram`,image:`Picture`,openapi:`OpenAPI spec`,swagger:`Swagger spec`,asyncapi:`AsyncAPI spec`,protobuf:`Protobuf spec`,avro:`Avro schema`,payload:`Payload sample`,"ticket-export":`Ticket export`,unknown:`Unknown`},states:{read:`Read`,skipped:`Not read`,"not-synced":`Not synced yet`},inbox:`In the inbox`,systems:e=>`About ${e}`,noSystems:`Names no system`,age:e=>e===0?`changed today`:`changed ${e} day${e===1?``:`s`} ago`,items:(e,t)=>`${e} knowledge item${e===1?``:`s`}, ${t} verified`,verified:`verified`,why:e=>`Not read: ${e}.`,newer:e=>`A newer version is ${e}.`,duplicate:e=>`The same file as ${e}.`,readTitle:`Read them into knowledge items`,readWhy:`Your assistant reads the snapshot of inputs/ into patterns, standards, processes, requests, decisions and constraints. Atticus checks every quote against the file.`},kinds:{pattern:`Pattern`,standard:`Standard`,process:`Process`,request:`Request`,decision:`Decision`,constraint:`Constraint`,team:`Team`,vendor:`Vendor`,product:`Product`,project:`Project`},groups:[{title:`Requests and processes`,kinds:[`request`,`process`]},{title:`Standards and patterns`,kinds:[`standard`,`pattern`]},{title:`Decisions and constraints`,kinds:[`decision`,`constraint`]},{title:`Teams and vendors`,kinds:[`team`,`vendor`]},{title:`Products and projects`,kinds:[`product`,`project`]}],fields:{title:`Title`,name:`Name`,appliesWhen:`Applies when`,leadTime:`Lead time`,handledBy:`Handled by`,catalogueItem:`Catalogue item`,inputs:`It needs`,steps:`Steps`,notes:`Notes`,definition:`Definition`,rules:`Rules`,reason:`Reason`,owner:`Owner`,responsibilities:`Responsibilities`,owns:`Owns`,uses:`Uses`,contacts:`Contacts`,channel:`Channel`,aliases:`Also called`,description:`What it is`,ownedBy:`Owned by`,usedBy:`Used by`,vendor:`Vendor`,systems:`Systems`,urls:`Links`,decision:`Decision`,stance:`Stance`},review:{verified:(e,t)=>`✓ Verified by ${e} on ${t}`,corrected:(e,t)=>`✓ Corrected by ${e} on ${t}`,rejected:(e,t)=>`✗ Rejected by ${e} on ${t}`,stale:e=>`Check again: its page changed since ${e} reviewed it`,staleRejected:(e,t)=>`✗ Rejected by ${e} on ${t}, then its page changed: still left out until checked again`,staleCorrected:(e,t)=>`Check again: ${e} corrected ${t} before its page changed; the correction isn't used until checked again`,none:`Not yet verified: check it against its page`,because:`Why`,correctedFields:e=>`Corrected: ${e}`},ai:{intro:`This step needs a model. Run the command in a terminal at the metarepo:`,introOr:`Or run the command in a terminal at the metarepo:`,slash:`Or type this in Copilot Chat or Claude Code:`,copy:`Copy the command`,copySlash:`Copy the slash command`},sources:{intro:`The wikis and docs repos in org-pack/sources.yaml. Sync copies a source's pages to a dated snapshot; the knowledge scan then reads the snapshot with your assistant, and every quote is checked.`,listTitle:`Sources`,empty:`No wiki is in sources.yaml yet. Add one below.`,type:`Type`,location:`Where`,ref:`Branch or tag`,path:`Folder of its pages`,checkout:`Checkout`,owner:`Owner`,tags:`Tags`,noTags:`No tags: it is read for every kind`,authority:`Authority`,authorities:{standard:`Standard: the organisation's own rules`,platform:`Platform: a shared platform team's guidance`,framework:`Framework: a framework's own documentation`,team:`Team: a team's pages`,reference:`Reference: glossaries and notes`},noAuthority:`Not set: it ranks as a team's pages`,byPage:e=>`${e} page override${e===1?``:`s`} in sources.yaml`,scope:`Applies to`,everywhere:`Every task: no appliesTo in sources.yaml`,restricted:`Restricted pages`,readsRestricted:`Read: the metarepo's audience may read them`,skipsRestricted:`Skipped, path and reason only`,maxPages:e=>`A scan reads at most ${e} page${e===1?``:`s`} of it a run`,snapshot:`Newest snapshot`,noSnapshot:`Never synced`,snapshotLine:(e,t,n)=>`${e}: ${t} page${t===1?``:`s`}, ${n} day${n===1?``:`s`} old`,commit:e=>`at commit ${e.slice(0,7)}`,scanned:e=>`The knowledge scan read the snapshot of ${e}`,notScanned:`The knowledge scan hasn't read it yet`,stale:e=>`Sync it again: the snapshot is older than ${e} days`,unsynced:`Not synced yet: sync it so the knowledge scan can read it`,sync:e=>`Sync ${e}`,syncing:`Syncing`,synced:e=>`Synced ${e}.`,scanLabel:`Knowledge scan`,addTitle:`Add a source`,addIntro:`Atticus checks the wiki and writes its entry into org-pack/sources.yaml, keeping the file's comments. Commit the file through a pull request: merging it is the approval.`,addType:`Type of wiki`,addLocation:`Location: a URL, or a folder relative to the metarepo`,addId:`Id (optional; made from the location when empty)`,addPath:`Folder of its pages (git only)`,addRef:`Branch or tag (git only; default the repository's default branch)`,addSubmodule:`Keep it as a submodule of the metarepo (git only)`,addKinds:`Kinds of knowledge it holds, comma-separated`,addFrameworks:`Frameworks it is about, comma-separated`,addOwner:`Owner`,addSave:`Write it into sources.yaml (otherwise only show the entry)`,add:`Add the source`,adding:`Adding`,needLocation:`Say where the wiki is.`,gitOnly:`Branch, folder and submodule are for a git wiki.`,notSlug:e=>`${e} isn't a tag: use lowercase letters, digits and dashes.`,problems:`These files don't read:`},scan:{title:`What the last scan changed`,never:`No knowledge scan has run yet.`,at:e=>`Scanned on ${e}`,added:`New`,changed:`Changed`,removed:`Gone`,nothing:`The last scan changed no item.`,flags:(e,t,n)=>`${e} conflict${e===1?``:`s`} between pages, ${t} quarantined text${t===1?``:`s`}, ${n} item${n===1?``:`s`} that failed the checks`,checkAgain:`Reviews to check again`,noCheckAgain:`No review waits to be checked again.`,rescan:`Read every source again (only changed pages go to your assistant):`},items:{intro:`What the knowledge scan read from the wikis, as people reviewed it. A tick lasts until the page under it changes; a rejected item is left out of plans and answers, and still listed here with its reason.`,kind:`Kind`,allKinds:`All kinds`,empty:`There are no knowledge items yet. Sync a source on the Knowledge sources page, then read it with your assistant.`,noMatch:`No item matches.`,pick:`Pick an item to see it and review it.`,reviewStart:e=>e?`Review what no one has checked (${e})`:`Nothing waits for a review`,reviewStop:`Stop reviewing`,reviewKeys:e=>`Review mode, ${e} waiting: j or ↓ next, k or ↑ back, v verify and go on, c correct, r reject.`,missing:e=>`There is no knowledge item ${e}: a rescan may have removed it, or the link is wrong. Pick one from the list.`,count:e=>`${e} item${e===1?``:`s`}`,quote:`What the page says`,page:(e,t)=>`${e}${t?`, line ${t}`:``}`,links:`Links`,noLinks:`The page gives no link for it.`,conflict:`Another page disagrees with it: see the conflicts in knowledge/scan.yaml.`,verify:`Verify`,correct:`Correct`,reject:`Reject`,cancel:`Cancel`,save:`Save the correction`,saving:`Saving`,rejectWhy:`Why is it wrong? The next person reads it.`,rejectSave:`Reject it`,needWhy:`Say why it is wrong.`,noChange:`Change a field first, or cancel.`,verified:e=>`Verified ${e}. Commit knowledge/reviews/ through a pull request.`,corrected:e=>`Corrected ${e}. Everything that reads it uses the correction from now on.`,rejected:e=>`Rejected ${e}: plans and answers leave it out.`,correctIntro:`Only the fields a person may correct are here. What the page quoted can't be corrected: a quote is checked word for word.`,addValue:`Add one`,remove:`Remove`,linkLabel:`Label`,linkUrl:`Address (https://…)`,badUrl:e=>`${e} isn't an http(s) address.`,item:e=>`Item ${e}`,link:e=>`Link ${e}`,open:`Open the item`},search:{intro:`Look for a term or phrase across every wiki. The plain search runs here and shows the pages and sections that mention it. Your assistant then reads only those pages and proposes what they hold about it; every quote is checked.`,label:`A term or phrase`,placeholder:`e.g. new starter, Kafka topic, change freeze`,go:`Search`,needText:`Type a word or phrase to look for first.`,searching:`Searching the wikis again…`,noSnapshot:`No source has a snapshot yet: sync one on the Knowledge sources page first.`,none:e=>`No page of the wikis mentions "${e}". There is nothing to send to your assistant.`,found:(e,t)=>`${e} section${e===1?``:`s`} on ${t} page${t===1?``:`s`} mention it.`,next:`Have your assistant read those pages:`,savedTitle:`Saved searches`,noSaved:`No search has been saved yet. Each search your assistant runs is saved here.`,candidates:(e,t)=>`${e} found, ${t} kept`,fresh:`New`,known:e=>`Already known as ${e}`,kept:(e,t)=>`Kept as a ${e} by ${t}`,keepAs:`Keep as`,keep:`Keep`,keeping:`Keeping`,keepOf:e=>`Keep ${e}`,keptNote:(e,t)=>`Kept ${e} as a ${t}, verified by you. Commit knowledge/items/ and reviews/ through a pull request.`,pick:`Pick a saved search to see what it found.`},parties:{intro:`The teams, vendors, products and projects the wikis name: what each team owns and uses, who owns each product, and the other names people use for them.`,empty:`No team, vendor or product has been read from the wikis yet. The knowledge scan reads them.`,teams:`Teams`,vendors:`Vendors`,products:`Products and projects`,owns:`Owns`,uses:`Uses`,usedBy:`Used by`,ownedBy:`Owned by`,aliases:`Also called`,responsibilities:`Responsible for`,none:`None named`,review:`Review it on the Knowledge items page`},orgpack:{intro:`The products and vendors the wikis name, drafted as each platform profile's systems. Accept the ones you pick: Atticus writes them into profile.yaml, keeping its comments, and you commit it through a pull request.`,empty:`The org pack has no platform profile yet.`,noDraft:`No draft yet for this platform.`,draft:`Draft from the wikis`,drafting:`Drafting`,drafted:e=>`Drafted ${e} system${e===1?``:`s`}.`,nothing:`The profile already has every system the knowledge items name.`,add:`Add`,update:`Update`,gains:e=>`gains ${e}`,verified:e=>`✓ Verified by ${e}`,unverified:`Not yet verified: check it against its page`,accept:`Accept the picked systems`,accepting:`Accepting`,pickOne:`Pick at least one system.`,accepted:(e,t,n)=>`Added ${e} and updated ${t} in ${n}. Commit it through a pull request: merging it is the approval.`,pick:e=>`Accept ${e}`,at:e=>`Drafted on ${e}`,command:`Or in a terminal:`},needs:{title:`What this change needs`,intro:`What the organisation needs from this change, from the knowledge items: requests to raise, standards to follow, decisions to keep to, teams to involve. Atticus never raises one: you do, then mark it here.`,none:e=>`${e} has no needs list yet. Find what it needs early: a request's lead time runs from the day it is raised.`,empty:`Nothing in the knowledge items applies to this change.`,groups:[{title:`Requests and processes to raise`,kinds:[`request`,`process`]},{title:`Standards and patterns to follow`,kinds:[`standard`,`pattern`]},{title:`Decisions and constraints that apply`,kinds:[`decision`,`constraint`]},{title:`Teams, vendors and products to involve`,kinds:[`team`,`vendor`,`product`,`project`]}],for:e=>e===`change`?`the whole change`:e.replace(`:`,` `),leadTime:`Lead time`,handledBy:`Handled by`,catalogueItem:`Catalogue item`,inputs:`It needs`,steps:`How`,rules:`Rules`,links:`Links`,why:`Why`,when:e=>`Needed ${e.replace(`-`,` `)}`,from:e=>`From ${e}`,fromStories:`Suggested by the stories stage`,open:`Open`,done:(e,t)=>`Done by ${e}${t?`: ${t}`:``}`,notNeeded:(e,t)=>`Not needed (${e}): ${t}`,markDone:`Done`,markDoneOf:e=>`Done: ${e}`,markSkipOf:e=>`Not needed: ${e}`,reopenOf:e=>`Reopen: ${e}`,openAgain:`open again`,markSkip:`Not needed`,reopen:`Reopen`,doneNote:`Note (optional), e.g. the CTASK number`,skipNote:`Why it isn't needed (a reviewer reads it)`,save:`Save`,cancel:`Cancel`,needWhy:`Say why it isn't needed.`,marked:(e,t)=>`${e} is ${t}. Commit needs.yaml with the change.`,considered:`Considered and left out`,openCount:e=>`${e} open`}},nav:{main:`Main`,dashboard:`Overview`,onboarding:`Onboarding`,feature:`Feature design`,architecture:`Architecture`,stories:`Stories`,tasks:`Tasks`,knowledge:`Knowledge`,sections:{Home:`Home`,Map:`Map`,Change:`Change`,Questions:`Questions`,Knowledge:`Knowledge`,SetUp:`Set up`,Atticus:`Atticus`},groups:{Define:`Define`,Design:`Design`,Plan:`Plan`,Build:`Build`,Release:`Release`},tabs:e=>`${e} pages`,youAreHere:`You are here`,screens:{home:`Home`,canvas:`Estate canvas`,trust:`Trust`,explore:`Search the catalog`,map:`Ecosystem map`,impact:`Impact explorer`,features:`Features`,orgpack:`Org pack`,intake:`Intake`,scans:`Scans`,brief:`Brief`,ux:`Prototypes and UX`,archReview:`Architecture review`,diagrams:`Diagrams`,reconcile:`Reconcile`,contracts:`Contracts`,mappings:`API mappings`,breakdown:`Breakdown`,initiatives:`Initiatives`,changes:`All changes`,tasks:`Task board`,trace:`Test trace`,todo:`Manual steps`,release:`Release plan`,serviceDesk:`Service desk queue`,governance:`Governance`,evals:`AI quality`,learning:`Learning`,settings:`Settings`,ai:`AI`,repos:`Repos`,cockpit:`At a glance`,systems:`Systems`,outside:`Outside systems`,mismatches:`Mismatches`,runs:`Model runs`,history:`Prompt history`,words:`What the words mean`,changeDiagram:`Change diagram`,estimate:`Estimate`,conformance:`Code against design`,changeKnowledge:`Knowledge`,decisions:`Decided by AI`,crosscheck:`Readers found / facts say`,catalogBuilds:`Catalog builds`}},crossCheck:{title:`Readers found / facts say`,intro:`For each repo with verified facts, what the built-in readers found is compared with what the facts say. The facts are the map; the readers are a cross-check. Nothing here changes the catalog: check the cited line, then promote what the readers got right to your own fact, dismiss what they got wrong, or ask your assistant to read the repo again.`,openFromTrust:`Readers found / facts say`,openFromTrustOf:e=>`Readers found / facts say for ${e}`,pickerCounts:(e,t)=>`${e} found, ${t} disagree`,repoPicker:`Repo`,empty:`No repo has verified facts yet, so there is nothing to check the readers against. Read a repo with your assistant and Apply it on Map › Trust; then scan to compare.`,loadingRepo:`Loading the cross-check`,state:{compared:`Compared`,"no-facts":`No facts yet: its map comes from the built-in readers, so there is nothing to compare.`,"no-readers":`No readers slot yet: check this repo with the built-in readers (Set up › Scans) to compare.`,legacy:`Kept from before the upgrade, not yet read by the built-in readers: scan or verify this repo to replace it.`,unusable:`A slot doesn't read, so it isn't compared.`},commits:(e,t)=>`Readers read commit ${e}; the facts are of commit ${t}.`,behind:e=>`The base clone is at ${e} now: a slot behind it is shown as read at its own commit.`,counts:(e,t,n,r)=>`${e} found by the readers only · ${t} disagree · ${n} in the facts only · ${r} agree`,filterLabel:`Show`,filter:{"readers-only":e=>`Readers found (${e})`,disagree:e=>`Disagree (${e})`,"facts-only":e=>`Facts only (${e})`,dismissed:e=>`Dismissed (${e})`,all:e=>`All (${e})`},kindLabel:`Kind`,allKinds:`Every kind`,searchLabel:`Find`,searchHint:`A key, an id or a file`,shown:(e,t)=>`${e} of ${t} shown`,noneShown:`Nothing matches these filters.`,allAgree:`The readers and the facts agree on everything they both have.`,listLabel:e=>`Cross-check items of ${e}`,itemState:{"readers-only":`Readers found`,disagree:`Disagree`,"facts-only":`Facts only`},readersSay:`Readers`,factsSay:`Facts`,nothing:`nothing`,field:`Field`,fieldsCaption:e=>`What the readers and the facts say of ${e}`,factsOnlyNote:`For information: the built-in readers are known to miss things.`,dismissed:`Dismissed`,dismiss:`Dismiss`,dismissOf:e=>`Dismiss ${e}`,dismissHint:`Check the cited line first. A dismissal is kept in facts/<repo>.crosscheck.yaml at the readers' value, and the item is listed again if that value changes.`,undismiss:`List again`,undismissOf:e=>`List ${e} again`,working:`Writing…`,dismissedNote:e=>`Dismissed ${e}.`,undismissedNote:e=>`${e} is listed again.`,failed:e=>`Nothing written: ${e}`,proposeHint:`The dismissals file is yours to propose for review, like any edit.`,problems:`Files that couldn't be read`,promote:`Promote to assert…`,promoteOf:e=>`Promote ${e} to your own fact`,promoteLoading:`Reading the cited line…`,promoteCant:e=>`It can't be promoted: ${e}.`,promoteTitle:`Promote to your own fact`,promoteIntro:e=>`Check the cited line first. Atticus writes what the readers found as your own fact (by: person) with their citation, then verify checks it on its line in ${e}. Nothing reaches the catalog until you Apply it.`,promoteFact:(e,t)=>`Fact ${t}, of kind ${e}`,promoteCite:(e,t)=>`Cites ${e} at commit ${t}`,promoteValue:e=>`It claims ${e} is written on that line.`,promoteNoText:`The checkout isn't at the readers' commit here, so the line's text can't be shown: open it at that commit to check it.`,promoteInto:e=>`Added to ${e}, an edit to propose for review.`,promoteFromSnapshot:e=>`${e} isn't here: it is started from the facts verify last kept.`,promoteAlready:`It is promoted already: verify runs again on it.`,promoteConfirm:`Write it, then verify`,promotedNote:e=>`Promoted ${e}; verify checked it.`,promoteVerifyStopped:e=>`Your fact is written; verify stopped: ${e}`,promoteRefused:e=>`Nothing written: the promote refused: ${e}`,promoted:{written:`Your fact: not verified yet`,verified:`Your fact: verified on its line`,rejected:`Your fact: verify rejected it`},promotedVerifiedHint:e=>`Apply ${e} on Map › Trust (atticus verify ${e} --write) to put it in the catalog.`,promotedRejectedHint:`It is kept in the rejected file with why: check the line, or dismiss the item.`},catalogBuild:{title:`Catalog builds`,intro:`catalog/generated is built from each repo's source slot (its verified facts, else its built-in readers' last full read) and the curated decisions. Nothing is removed or overwritten without being shown first, and every build can be undone.`,openFromScans:`Catalog builds: confirm, undo, prune`,sourcesTitle:`Where each repo's records come from`,sourcesCaption:`Each repo's source in the build`,col:{repo:`Repo`,source:`Source`,commit:`Commit`,note:`Note`},source:{facts:`Verified facts`,readers:`Built-in readers`,legacy:`Kept from before the upgrade`,none:`No slot yet`},noSources:`The manifests list no repo yet.`,pendingTitle:`The next build`,upToDate:`catalog/generated is what the slots and inputs build. Nothing waits.`,wouldWrite:e=>`A build would write the slots' changes, removing ${e} ${e===1?`record`:`records`} (within the limits).`,wouldWriteNothing:`A build would write the slots' changes; nothing would be removed.`,build:`Build now`,building:`Building…`,refusedTitle:`The build waits for you: nothing has been written.`,reason:{"large-removals":e=>`It would remove ${e} ${e===1?`record`:`records`}, more than 10% of a repo's or 200 in one build.`,"hand-edits":e=>`${e} ${e===1?`file`:`files`} under catalog/generated ${e===1?`was`:`were`} changed by hand since the last build.`,"unexplained-removals":e=>`It would remove ${e} ${e===1?`record`:`records`} that no changed slot or input explains. That is a bug: nothing can confirm it. The list is its report.`,"not-upgraded":e=>`This catalog (${e} record files) was written before beta.27, or the last undo took back the upgrade: run atticus upgrade --yes (or Upgrade on Set up › Catalog builds) to build from slots again. The upgrade lists every file it writes first.`,empty:()=>`The build has no record from any repo's code, so the catalog is left as it was.`,"nothing-read":()=>`The scan read no repo in full, so it wrote nothing.`},inTerminal:`In a terminal`,reviewRemovals:e=>`Review the ${e} removals`,removalsTitle:e=>`Confirm ${e} ${e===1?`removal`:`removals`}`,removalsIntro:`These records are in the catalog now and the build would remove them. Each says what explains it. Nothing is removed until you confirm, and undo takes it back.`,removalsCaption:`The records the build would remove`,removalCol:{record:`Record`,repos:`Repos`,why:`Explained by`},noRepo:`no repo`,typeCount:e=>`Type ${e} to confirm exactly these`,countHint:`A confirmation names the count it was shown, so it never covers more.`,countWrong:e=>`Type ${e}, the number listed.`,editsChanged:`The hand edits aren't the ones listed here any more. Nothing was made curated: scan again to list them.`,confirmRemove:e=>`Remove ${e} ${e===1?`record`:`records`}`,cancel:`Cancel`,editsTitle:`Hand edits`,editsIntro:`These files were changed by hand since the last build. A build never overwrites them: make each a curated decision, which every later build keeps, or discard them (a copy is kept for undo).`,editsCaption:`Files changed by hand`,how:{changed:`changed`,added:`added`,deleted:`deleted`},curate:e=>`Make ${e===1?`it`:`these ${e}`} curated`,curating:`Making them curated…`,curateHint:`Writes a curated decision for each into catalog/curated/, to propose for review, then builds.`,discard:e=>`Discard ${e===1?`it`:`these ${e}`}…`,discardTitle:e=>`Discard ${e} hand ${e===1?`edit`:`edits`}`,discardIntro:`The build replaces these files with what the slots build. Their bytes are kept in the undo copy first.`,confirmDiscard:e=>`Discard ${e} ${e===1?`edit`:`edits`}`,upgradeTodo:`Review the upgrade below: it shows every file it writes before it writes one. In a terminal:`,upgradeElsewhere:`Upgrade from the app on`,upgradeOn:`Set up › Catalog builds`,lastTitle:`The last build here`,lastNone:`No build has run on this machine yet.`,lastIntro:`Every command that builds leaves its report here, in the app or a terminal: a scan, Apply (verify --write), a rename, a build.`,lastLine:(e,t)=>`${e}, ${t}`,outcome:{written:`Written`,unchanged:`Nothing to change`,refused:`Refused: nothing written`,stopped:`Stopped part way`},lastCounts:(e,t,n)=>`${e} added · ${t} changed · ${n} removed`,lastWouldCounts:(e,t,n)=>`It would have added ${e}, changed ${t} and removed ${n}.`,lastSlots:e=>`${e} slot ${e===1?`file`:`files`} written`,lastRemoved:e=>`The ${e} ${e===1?`record`:`records`} it removed, and why`,lastWouldRemove:e=>`The ${e} ${e===1?`record`:`records`} it would have removed, and why`,lastStopped:e=>`The write stopped part way (${e}). The undo copy holds what it replaced; the next build finishes it.`,lastRun:`To go on, in a terminal:`,lastUnread:`The repos it couldn't read in full:`,lastDiscarded:e=>`${e} hand ${e===1?`edit`:`edits`} discarded (their bytes are in the undo copy).`,lastAdded:e=>`The ${e} ${e===1?`record`:`records`} added`,lastChanged:e=>`The ${e} ${e===1?`record`:`records`} changed`,input:{answers:e=>`An answer changed (${e}): your own action`,pairings:e=>`A pairing changed (${e})`,"org-pack":e=>`The org pack changed (${e})`,curated:e=>`A curated decision changed (${e})`,traffic:e=>`The traffic evidence changed (${e})`,shared:e=>`A shared map changed (${e})`,inputs:e=>`inputs/ changed (${e})`,proposals:e=>`A proposal changed (${e})`,federated:e=>`A federated catalog changed (${e})`,other:e=>`An input changed (${e})`},upgradeTitle:`Upgrade to source slots`,upgradeIntro:`This catalog was written before beta.27. The upgrade adopts every record into source slots, so nothing is lost, and keeps a copy of the catalog as it is. It writes nothing until you confirm.`,upgradeRecords:(e,t)=>`${e} ${e===1?`record`:`records`} adopted into ${t} slot ${t===1?`file`:`files`}:`,upgradeSlotsCaption:`The slots the upgrade writes`,upgradeSlotCol:{path:`Slot`,repo:`Repo`,records:`Records`},upgradeJoins:`joined and evidence-less records`,upgradeCopy:(e,t)=>`The catalog as it is now, ${t} ${t===1?`file`:`files`}, is copied to ${e}, committed with the upgrade.`,upgradeFirstBuild:`The first build after it gives every record byte for byte as it is now.`,upgradeOthers:`Other upgrade steps wait first, and may change what this one writes. Run them here (as Home offers), then confirm this list.`,upgradeDiffers:e=>`Its first build would give ${e} record ${e===1?`file`:`files`} differently. The files as they are now stay in the copy; the upgrade writes nothing until you accept exactly ${e===1?`this change`:`these ${e}`}:`,upgradeChangesCaption:`The record files the first build changes`,upgradeHow:{added:`added`,changed:`changed`,removed:`removed`},upgradeChange:(e,t)=>`${e}: catalog/generated/${t}`,upgradeAccept:e=>`Accept the ${e} ${e===1?`change`:`changes`}…`,upgradeAcceptTitle:e=>`Accept ${e} ${e===1?`change`:`changes`} of the first build`,upgradeAcceptIntro:`The upgrade's first build gives these record files differently from catalog/generated now. Accepting them writes nothing yet: the files it writes are confirmed next, as atticus upgrade --yes --accept-changes does.`,confirmAccept:e=>`Accept ${e} ${e===1?`change`:`changes`}`,upgradeAccepted:e=>`${e} ${e===1?`change`:`changes`} accepted. Review the files it writes to upgrade.`,upgradeVerifiable:e=>`These repos' facts passed verify as they are; Apply each next to put its facts in: ${e}.`,upgradeReview:e=>`Review the ${e} files it writes…`,upgradeConfirmTitle:e=>`Upgrade: write ${e} ${e===1?`file`:`files`}`,upgradeConfirmIntro:`atticus upgrade --yes writes exactly these files, after an undo copy. catalog/generated is left as it is.`,upgradeConfirmIntroChanges:e=>`atticus upgrade --yes --accept-changes ${e} writes exactly these files, after an undo copy, then the first build's catalog with the ${e} ${e===1?`change`:`changes`} you accepted (undo takes it all back).`,upgradeFilesCaption:`Every file the upgrade writes`,upgradeWhat:{"readers-slot":`readers slot`,"legacy-joins":`legacy joins`,copy:`copy`,"build-manifest":`build manifest`},upgradeBytes:e=>`${e.toLocaleString(`en`)} bytes`,confirmUpgrade:e=>`Write ${e} ${e===1?`file`:`files`}`,upgradeNone:`Nothing to upgrade: catalog/sources is here already.`,undoTitle:`Undo`,undoIntro:`The last five builds on this machine keep an undo copy. Undo puts back catalog/generated, build.json and the slots as they were before a build, and can itself be undone. Git keeps everything older.`,undoNone:`Nothing to undo: no build has been written here yet.`,undoLatest:`1 is the latest build. Undoing an older one takes back every build after it too, newest first.`,undoCaption:`The undo copies, newest first`,undoCol:{n:`Build`,command:`Command`,at:`When`,files:`Files`,act:`Undo`},undoTo:`Undo…`,undoToOf:e=>e===1?`Undo the latest build`:`Undo the ${e} latest builds`,undoPlanTitle:e=>e===1?`Undo the latest build`:`Undo the ${e} latest builds`,undoPlanIntro:e=>`Takes back: ${e}.`,undoPlanCaption:`The files undo puts back`,undoRename:(e,t)=>`This undoes the rename's build, not the rename: the manifest still names ${t}. Rename back with atticus repo rename ${t} ${e} to read the old slot again.`,restore:`restore`,remove:`remove`,confirmUndo:e=>`Put back ${e} ${e===1?`file`:`files`}`,pruneTitle:`Prune`,pruneIntro:`Slot files no build reads: repos no longer in the manifests or archived, and the upgrade's copy of the catalog. They are kept until you remove them.`,pruneNone:`Nothing to prune: every slot file is one a build reads.`,pruneCaption:`The files prune would remove`,pruneReview:e=>`Remove these ${e} ${e===1?`file`:`files`}…`,pruneConfirmTitle:e=>`Remove ${e} ${e===1?`file`:`files`}`,pruneConfirmIntro:`Undo and git keep them.`,confirmPrune:e=>`Remove ${e} ${e===1?`file`:`files`}`,done:`Done. What it printed is in the Console.`,failed:e=>`It stopped: ${e}`,problems:`Problems the build reported`,orphaned:(e,t)=>`${e}: ${t===`archived`?`archived`:`no longer in the manifests`}; its slots are kept, not built from.`},scanSources:{title:`What the scan read`,caption:`Each repo's outcome of the scan`,col:{repo:`Repo`,outcome:`Readers slot`,source:`Catalog from`,note:`Why`},slot:{written:`Read in full`,unchanged:`Read in full, unchanged`,"kept-last-good":`Kept its last good read`,none:`No read yet`},at:e=>`at ${e}`,why:{"not-cloned":`it isn't cloned here`,unreadable:`its clone can't be read`,"not-asked":`left out of this scan`,"run-failed":`a reader run failed`,"plugin-refused":`a plugin that applies to it isn't used`,"readers-off":`the readers are switched off`,dirty:`its clone has changes not committed`,refused:`the scan wrote nothing`,"dry-run":`a dry run writes nothing`},factsStale:`its facts cite files changed since: read it again on Map › Trust`,refusedBuild:`The scan read these repos, and its build waits for you:`,confirmScan:e=>`Scan again, removing ${e} ${e===1?`record`:`records`}`,links:`Readers found / facts say, and the catalog's builds:`},trust:{contracts:(e,t,n)=>`Contracts: ${e} mismatch${e===1?``:`es`} and ${t} unconfirmed on ${n} link${n===1?``:`s`} with a payload on both sides.`,contractsOpen:`Open Mismatches`,intro:`How far to trust each repo's map. Your assistant reads a repo and writes facts, each citing a file and line; the verifier keeps the facts whose line says what they claim and rejects the rest. Here is what it kept and rejected, how much of the code the facts cover, whether they are of the commit the checkout is at, and whether the catalog is built from them or from the built-in readers.`,empty:`No repo is listed yet. Add your repos in Set up › Repos, then have your assistant read one with /atticus-map <repo>.`,reportIn:e=>`The verifier's reports are in ${e}/.`,summary:(e,t)=>`${e} of ${t} repos trusted`,filterLabel:`Filter the repos`,readAgain:{title:`Read it again`,why:e=>`Reads ${e} whole again with your assistant, every file, as when it was first read. The facts on file stay until the new read replaces them, and Apply checks them again.`},states:{"not-read":`Not read yet`,unverified:`Not verified`,rejected:`Facts rejected`,stale:`Facts of another commit`,unwritten:`Verified, not in the catalog`,"unknown-files":`Files not read yet`,trusted:`Trusted`},why:{notRead:`Your assistant hasn't read this repo yet, so any map of it comes from the built-in readers.`,unverified:`Its facts haven't been checked by the verifier yet.`,rejected:e=>`The verifier rejected ${e} fact${e===1?``:`s`}: the cited line doesn't say what the fact claims. Fix ${e===1?`it`:`them`} and verify again.`,stale:(e,t)=>`The facts are of commit ${e.slice(0,7)}, but the checkout is at ${t.slice(0,7)}. Read the repo again.`,unwritten:`Its facts are verified, but the catalog isn't built from them yet.`,unknownFiles:(e,t)=>`${e} source file${e===1?` has`:`s have`} no fact citing ${e===1?`it`:`them`} yet: read ${e===1?`it`:`them`}, or exclude generated code in org-pack/scan/${t}.yaml.`,trusted:`Every fact is verified at the checkout's commit, every source file is read, and the catalog is built from the facts.`},audit:`Sample audit`,auditNone:e=>`None yet: atticus verify audit ${e}`,auditTally:(e,t)=>t.precision===null?`${e}: no answers yet`:`${e}: ${Math.round(t.precision*100)}% right (${t.right} of ${t.right+t.wrong}; 95% between ${Math.round((t.low??0)*100)}% and ${Math.round((t.high??0)*100)}%)`,auditFacts:`facts`,auditLinks:`links`,auditSmall:`A small sample: read the range, not the number.`,sample:{open:`Answer a sample`,openOf:e=>`Answer a sample audit of ${e}`,intro:`A random sample of the repo's kept facts and the links the join makes from it, drawn as atticus verify audit draws it: the same seed draws the same sample on any machine. Read each item's lines and say whether it is right. Your answers go to the repo's audit file, a person's record you commit in a pull request; nothing is sent anywhere.`,seed:`Seed`,seedHint:e=>`Leave it empty for ${e}, the repo at its facts' commit.`,seedHintNone:`Leave it empty for the repo at its facts' commit.`,size:`How many facts and how many links`,draw:`Draw`,loading:`Drawing the sample…`,failed:e=>`Couldn't draw the sample: ${e}`,refused:{"no-facts":e=>`${e} has no facts to audit yet. Have your assistant read it (/atticus-map ${e}), then run atticus verify ${e}.`,"bad-facts":e=>`${e}'s facts file doesn't read as facts: run atticus verify ${e} first.`,unverified:(e,t)=>`${t} of ${e}'s facts aren't verified yet, and an audit samples kept facts only. Run atticus verify ${e} first.`,"bad-file":e=>`${e}'s audit file isn't one Atticus can read: atticus verify audit ${e} --report says why.`},empty:`Nothing to sample: the repo has no kept facts a reader wrote and no links.`,item:(e,t,n,r)=>`${e} of ${t}: ${n} ${r}`,fact:`fact`,link:e=>`link (${e})`,lines:`The lines it rests on`,noText:`(the line isn't in the checkout)`,choices:{right:`Right`,wrong:`Wrong`,unsure:`Unsure`},note:`Note (what is wrong with it)`,noteOptional:`Note (optional)`,onFile:(e,t)=>`On file: ${e}, by ${t}`,save:`Save the answers`,saving:`Writing the answers…`,nothingPicked:`Answer at least one item first.`,saved:(e,t,n)=>`Written to ${e}: ${t} answered, ${n} open. Propose it for review, or commit it yourself:`,copyCommit:`Copy the git command`,sameInTerminal:`The same draw in a terminal:`,copyCommand:`Copy the audit command`,wrongFact:`Correct this fact`,wrongFactOf:e=>`Correct the fact ${e}`,wrongLink:e=>`Open ${e} on the estate canvas, then the link's Why is this linked? › This link is wrong`,factGone:`This fact isn't in the repo's facts any more, so there is nothing to correct.`},builtOn:`Built on`,builtOnNone:`Not read yet`,builtOnOne:(e,t,n)=>`${e}${t?` ${t}`:``} (${n})`,builtOnModule:(e,t)=>`${e}, in ${t}`,builtOnGap:e=>`${e}: none of its patterns are in the facts`,terms:`Terms`,termsNone:`None in the facts`,termRole:{owner:`its own id`,consumer:`a consumer it lets in`,none:`names no system`,unknown:`open: nothing says what it means yet`},termOne:(e,t,n,r)=>`${e} ${t}: ${n} (${r})`,termNote:e=>typeof e==`number`||/^[0-9a-f]{8}$/.test(e)?`note ${e}`:`the note "${e}"`,builtOnIntro:`What each repo's build files declare it is built on, each read from the line that declares it. Where a repo declares a framework and its facts show none of that framework's patterns — a Spring Boot service with no route, a React app with no screen — the entry points were probably missed, and that is a question for a person rather than something to be decided here.`,kept:`Facts kept`,rejected:`Rejected`,redacted:e=>`${e} quote${e===1?``:`s`} redacted`,answerBoxes:{title:e=>e===1?`A box made from an answer's words`:`${e} boxes made from answers' words`,intro:`An answer to a question about where calls go was taken as a system's name, so the map drew a box with arrows to it. Say what it was: Ignore leaves its calls off the map; a rename points them at a real system. Both are written here first, then proposed for review.`,box:e=>`A box made from an answer's words: ${e}`,inProfile:e=>`A system in ${e}`,answeredIn:e=>`Named by ${e} answer${e===1?``:`s`}:`,ignore:`It was 'ignore this'`,ignoreOf:e=>`It was 'ignore this': ${e}`,rename:`Rename to a real system`,renameOf:e=>`Rename to a real system: ${e}`,nameLabel:`The repo or system it is, or a new outside system's name`,nameHint:`A repo or system Atticus knows, or a short name: letters, digits, spaces and dashes, up to 40 characters, not a sentence.`,needName:`Type the repo or system it is, or a new system's name.`,preview:`Preview the change`,previewing:`Working out the change…`,willIgnore:e=>`${e} answer${e===1?``:`s`} become${e===1?`s`:``} Ignore, and the box leaves the map after Apply:`,willRename:(e,t)=>`${e} answer${e===1?``:`s`} name${e===1?`s`:``} ${t} instead, after Apply:`,answerChange:(e,t,n)=>`${e}: “${t}” becomes “${n}”`,profileChange:e=>`The lines it changes in ${e}:`,confirmIgnore:`Yes, ignore it`,confirmRename:`Yes, rename it`,cancel:`Cancel`,writing:`Writing…`,written:e=>`Written here. Apply puts it on the map${e?` (${e})`:``}, then propose it for review:`},secrets:{title:e=>e===1?`A secret seems to sit in a config file`:`${e} secrets seem to sit in config files`,at:(e,t,n)=>`A secret sits in ${e}:${t} (${n})`,secretKey:`a key that looks like a secret`,fix:`Move it to where your secrets live (a vault, an environment variable, a Secret) and read it from there; then rotate it, as it has been in the repo. Atticus never copies its value into a map.`},coverage:`Coverage`,coverageOf:(e,t,n,r)=>`${Math.round(e*100)}%: ${t} file${t===1?``:`s`} read, ${n} not read, ${r} excluded`,noReport:`No verifier's report yet`,commit:`Commit`,sameCommit:e=>`${e.slice(0,7)}, the checkout's`,otherCommit:(e,t)=>`Facts ${e.slice(0,7)}, checkout ${t.slice(0,7)}`,noCheckout:e=>`Facts ${e.slice(0,7)}; no checkout to compare with`,noFactsCommit:`No facts yet`,catalogFrom:`Catalog from`,from:{facts:`Its facts`,readers:`The built-in readers`,both:`Its facts and the readers`,none:`Nothing yet`},records:(e,t)=>`${e} record${e===1?``:`s`} from facts, ${t} from readers`,unknownFiles:e=>`The ${e} file${e===1?``:`s`} no fact cites yet`,more:(e,t)=>`and ${e} more, listed in ${t}`,files:(e,t)=>`Files: ${e}, ${t}`,none:`None`,show:(e,t)=>`${e} ${t}: show them`,what:{kept:`facts kept`,redacted:`quotes redacted`,rejected:`lines rejected`,unknown:`files not read`,excluded:`files excluded`,asked:`questions open`,unverified:`facts not checked`},asked:`Questions open`,unverified:`Not checked yet`,keptFix:`Each is checked on its line. Open a citation to see the quote, and Correct this if the fact is wrong.`,redactedFix:`A secret value in the quote was replaced with <redacted> before the facts were kept. Nothing to do: the claim is still checked on its line.`,rejectedFix:e=>`The cited line doesn't say what the fact claims, or the line isn't a fact. Your assistant fixes each from ${e}, then the verifier checks them again:`,rejectedLine:(e,t)=>t?`${e}: ${t}`:e,rejectedNoLine:`No file or line: the line isn't a fact`,rejectedHolds:e=>`Nothing is written to the catalog while ${e===1?`a fact is`:`${e} facts are`} rejected: fix ${e===1?`it`:`them`} with your assistant, or drop ${e===1?`it`:`each`} below.`,dropFact:`Drop this fact`,dropFactLabel:e=>`Drop fact ${e}`,dropFactReason:e=>`Why is ${e} wrong?`,dropFactHelp:`Recorded as your correction (the fact is wrong) with your name, then Apply writes the rest of the repo's facts.`,dropFactNeedsReason:`Say why the fact is wrong first.`,dropFactAndApply:`Drop it and apply`,droppingFact:`Dropping it…`,dropFactCancel:`Keep it`,droppedFact:e=>`Dropped ${e} as wrong and applied the rest. Propose the correction for review from Home.`,unknownFix:e=>`No fact cites these yet. Have your assistant read them, or exclude generated code in org-pack/scan/${e}.yaml:`,excludedFix:e=>`Left out of the read by org-pack/scan/${e}.yaml. If one should be read, take its exclusion out of that file and read the repo again.`,askedFix:`Atticus asked because the code doesn't say. Answer each; the next verify reads the answer.`,answer:`Answer it`,unverifiedFix:`The verifier hasn't checked these on their lines yet:`,moreFacts:(e,t)=>`and ${e} more, in ${t}`,openCanvas:`Open the repo on the estate canvas`,canary:{title:`Canaries and the audit: how often a backed claim is wrong`,intro:`How often a claim graded as backed is wrong, measured two ways on your own code, with nobody labelling anything. The sample audit: a person answers a random sample of kept facts and links, which shows real lines read wrongly. A canary: Atticus copies a repo to a scratch folder outside the metarepo, plants a few made-up entries, calls, topics and config keys the repo can serve, and comments out a few real lines; your assistant reads the copy as it reads any repo, and a line taken out that the read still claims and the verifier keeps is a silent error. The two are of different things, so they are shown side by side, never added up.`,empty:`No canary has been scored yet. Run one on a few repos each release: plant it, open the run folder it names as your assistant's workspace, give it the prompt in a new chat, then score it. Nothing is written to the metarepo but its report.`,howTo:`In a terminal, in the metarepo:`,misread:e=>`Audit misread rate (real lines read wrongly, of the sample audit's answers; ${e} ${e===1?`repo`:`repos`})`,passed:e=>`Canary pass-through rate (lines taken out, still claimed and kept by the verifier, of those taken out; ${e} ${e===1?`repo`:`repos`})`,rate:e=>e.n?`${S(e)} (${e.k} of ${e.n})`:`not measured`,range:(e,t)=>e===null||t===null?``:`95% between ${x(e)} and ${x(t)}`,recall:e=>e.n?`Planted and found: ${S(e)}, ${e.k} of ${e.n}`:`Planted and found: no canary yet`,fabrication:(e,t,n)=>e.n?`Taken out but still claimed: ${S(e)}, ${e.k} of ${e.n}; the verifier caught ${t}${n?`, and ${n} named only elsewhere were counted in neither`:``}`:`Taken out but still claimed: no canary yet`,covers:e=>`The canaries cover ${e}.`,coversNone:`No canary yet: the pass-through rate covers no stack.`,small:`A small sample: read the range, not the number.`,caption:`The latest canary of each repo`,col:{repo:`Repo`,at:`Scored`,covers:`Covers`,planted:`Planted found`,removed:`Taken out, claimed`,passed:`Kept by the verifier`,report:`Report`},stack:(e,t)=>`${e} (${(Array.isArray(t)?t:[String(t)]).map(e=>C[e]??e).join(`, `)})`,skipped:e=>`${e} not planted (the repo can't serve them)`,of:(e,t)=>`${e} of ${t}`,passedWarn:`silent errors: claims kept by the verifier about lines that aren't there`,pending:e=>`${e}: planted, waiting for its read and its score`,scoreIt:e=>`atticus canary score ${e}`},fresh:{title:`Freshness`,intro:`Which repos' clones have moved past the commit their facts were read at, and what reading each again costs: the files changed that the facts cite, the facts to read again (the rest are carried as they are), and the command to run. Most stale first. Read from the facts and the clones with local git only; nothing is fetched or written. The same list in a terminal: atticus estate fresh.`,empty:`No repo is read yet, so none can be stale. atticus next says which to read first.`,allFresh:e=>`All ${e} repo${e===1?``:`s`} read ${e===1?`is`:`are`} fresh: the facts are of the commit the clone is at.`,summary:(e,t,n)=>`${e} of ${t} read moved on · ${n} fact${n===1?``:`s`} to read again`,caption:`Repos whose clone has moved past their facts' commit, most stale first`,col:{repo:`Repo`,state:`State`,facts:`Facts at`,clone:`Clone at`,cited:`Files cited that changed`,reread:`Facts to read again`,carried:`Carried`,run:`Run`},states:{stale:`Read again`,"unknown-commit":`Commit not in the clone`,moved:`Moved, nothing cited changed`,"no-checkout":`No clone`,fresh:`Fresh`,"not-read":`Not read yet`},more:e=>`+${e} more`,freshCount:e=>`${e} more repo${e===1?` is`:`s are`} fresh, and not listed here.`}},changeKnowledge:{title:`Knowledge that applies`,onFeature:`The pages attached to this change, ranked, with their source, the tasks that use them and the pages that disagree, are on the change's Knowledge page. Confirm or exclude them there.`,openPage:`Open the change's knowledge`,intro:`What the change's stages picked from the org's knowledge, with why: from the feature stage on, each picks the patterns, standards, decisions, processes and requests, and the wiki and document sections, that its own input leads to. Confirm what applies, and every later stage that takes its kind picks it; exclude what doesn't, and no later stage picks it again.`,none:`No knowledge is attached to this change yet. The feature stage is the first that picks pages from the org's wikis, documents and standards. Once the brief is written, run:`,featureCommand:e=>`atticus change feature ${e}`,working:`Writing knowledge.yaml…`,caption:`Knowledge that applies to this change`,item:`Item`,why:`Why`,stages:`Stages`,status:`Status`,actions:`Confirm or exclude`,statuses:{suggested:`Suggested`,confirmed:`Confirmed`,excluded:`Excluded`},confirm:`Confirm`,exclude:`Exclude`,confirmItem:e=>`Confirm ${e}`,excludeItem:e=>`Exclude ${e}`,kinds:{Pattern:`Pattern or standard`,Decision:`Decision`,ProcessDefinition:`Process or request`,Party:`Team or vendor`,Product:`Product`,GlossaryTerm:`Term`,SourceDocument:`Document`,WikiSection:`Wiki section`,DocumentSection:`Document section`},nearMisses:e=>`Nearly picked (${e}): left out for room`,nearMissStage:e=>`left out of ${e}`,set:(e,t,n)=>`${e} is ${t}, in ${n}. Commit it with the change's files:`,copyCommit:`Copy the git command`,noStages:`a person`,fromSource:(e,t)=>t?`from ${e} (${t})`:`from ${e}`,tasks:e=>{let t=typeof e==`string`?[e]:e;return`task${t.length===1?``:`s`} ${t.join(`, `)}`}},knowledgeConflicts:{title:`Pages that disagree`,intro:`Two pages say different things about the same item. A person decides which applies (or both, in different cases); nothing is picked for them. A signal may suggest a page (it replaces the other, its owner handles the item, its source is tagged for the kind, it is in the team's space, or it was edited last), but only suggests. When code verified in a repo holds one page's value, the code settles it: a document never overrides a fact verified from code.`,says:(e,t)=>`${e} says "${t}"`,open:e=>`Waiting for a person: question ${e} (atticus questions answer ${e} --option <n>, or on the Questions page).`,notAsked:`No one has been asked yet; a change that relies on it asks a person which applies.`,applies:(e,t)=>`${e} applies (${t}).`,both:(e,t)=>`Both apply, in different cases (${e}${t?`: "${t}"`:``}).`,byPerson:e=>`answered by ${e}`,byCode:(e,t,n,r)=>`settled by the code: ${e} ${t} has ${n}, verified at ${r}`,suggested:(e,t,n)=>`Suggested, not decided: ${e}, by ${t} (${n}).`},conformance:{title:`Code against design`,intro:`Does the code do what the design says? Each repo's branch is scanned at its commit and checked against the change's target flows: every call, table, column, migration and endpoint they add must be there, every call they remove gone, and nothing they don't name added. Every item cites its file and line. No AI; a person can dismiss a finding as not relevant.`,none:`No change yet. Start one from a brief, then run its architecture stage.`,noTargets:e=>`${e} has no target flows yet, so there is nothing to check the code against. Its architecture stage writes them:`,notChecked:e=>`${e}'s code hasn't been checked against its target flows yet. A task run checks it when its build passes, or run:`,repo:(e,t)=>`${e} at ${t}`,commits:(e,t)=>`Commit ${e.slice(0,12)}, compared with ${t.slice(0,12)}`,task:e=>`Only the steps task ${e} builds`,counts:e=>`${e.found} found, ${e.missing} missing, ${e.stillThere} still there, ${e.unexpected} not in the design`,allGood:`Everything its target flows add is there, and nothing they don't name.`,itemsCaption:e=>`What the check looked for in ${e}, and what it found`,status:{found:`Found`,missing:`Missing`,"still-there":`Still there`,unexpected:`Not in the design`},col:{status:`Result`,what:`What`,step:`Step`,task:`Task`,at:`Where`,finding:`Finding`},step:(e,t)=>t?`${e} item ${t}`:`${e} trigger`,noStep:`no target flow`,unchecked:`Not checked by a scan`,uncheckedIntro:`A scan can't show these steps, or the facts don't cover them at this commit, so the code couldn't confirm them; a person or a test checks them.`,gate:e=>e?`The findings are on the conform gate, round ${e}. Dismiss one as not relevant from the change's findings.`:`Nothing was written to the conform gate.`,problems:`What couldn't be read`,run:`Check the code again`,checking:`Checking the code…`,checked:`Checked. What it found is below.`,orTerminal:`Or in a terminal:`},changeImpact:{title:`What this change breaks`,intro:`From the change's target flows: each entry or table they break, who calls or uses it today, the fields that stop crossing and the gateway routes to update, each with the team that owns it. A link the map only guessed may break, and isn't counted as a break until someone confirms it.`,noTargets:e=>`${e} has no target flows yet, so there is nothing to weigh. Its architecture stage writes them:`,nothing:`Its target flows break nothing the map shows.`,counts:(e,t,n)=>`${e} caller${e===1?``:`s`} ${e===1?`breaks`:`break`}, ${t} may break (link guessed), ${n} gateway route${n===1?``:`s`} to update.`,owned:e=>`Owned by ${e}`,why:`Why it breaks`,gone:`Stops crossing`,required:`Callers must now send`,callersCaption:e=>`Who calls or uses ${e}, and whether it breaks`,col:{who:`Caller`,verdict:`Breaks?`,owner:`Owner`,where:`Where`},breaks:`Breaks`,mayBreak:e=>`May break (link guessed ${e})`,guessWords:{"joined-by-path":`by path`,"joined-by-label":`by a host's first label`,"joined-by-platform-setting":`by a platform-wide setting`,"joined-by-folder-name":`by a setting's folder name`,"joined-despite-conflict":`despite an open host conflict`,"joined-by-service-name":`by a Service's short name`},confirm:e=>`Not counted as a break: the critic's ${e} asks the caller's owner to confirm each guessed link.`,nobody:`The map shows nobody calling or using it.`,chain:`Up the chain: who calls the callers`,upstream:(e,t)=>`Up the chain, ${e} more ${e===1?`breaks`:`break`} and ${t} may break (resting on a guessed link).`,chainCaption:e=>`Who calls the callers of ${e}, hop by hop`,chainCol:{who:`Caller`,via:`Calls`,verdict:`Breaks?`,owner:`Owner`,where:`Where`},via:e=>`via ${[...e].join(`, `)}`,depth:e=>`${e} hops up`,restsOwn:e=>`May break (its link guessed ${e})`,restsOn:(e,t)=>`May break (rests on ${e}, guessed ${t})`,capped:e=>`The walk stops at ${e} hops up; more callers are above the last ones listed.`,routes:`Gateway routes to update`,route:(e,t)=>`${e}: ${[...t].join(`, `)} ${t.length===1?`calls`:`call`} through it`,teams:`Teams to involve`,noTeam:e=>`no team (${e})`,problems:`Notes`,command:e=>`atticus change impact ${e}`},estimate:{title:`Estimate`,intro:`How big the change is, counted from its target flows: each step it adds, changes or removes is a unit of work, classed by what it reaches. The days come from the org pack's ranges, summed; every unit and driver says where it comes from. No AI, and never a number nobody stands behind.`,none:`No change yet. Start one from a brief, then run its architecture stage.`,noTargets:e=>`${e} has no target flows yet, so there is nothing to size. Its architecture stage writes them:`,effort:`Effort`,effortRange:(e,t,n)=>`${e} to ${t} developer days (most likely ${n})`,noDays:e=>`${e} unit${e===1?``:`s`} of work, and no days:`,noTable:`the org pack has no estimates.yaml, so no unit has a range. Add one with the ranges your teams agree.`,noMatch:`no class in the org pack's estimates.yaml matches this work.`,from:(e,t)=>`from ${e} of ${t} units of work; the rest need a class and count for nothing yet`,calendar:`Calendar`,waiting:e=>`Waiting, from the release forecast: ${e} working days`,longer:e=>e===`work`?`The work takes longer than the waiting.`:`The waiting takes longer than the work.`,noWait:`No waiting worked out: the release forecast couldn't be read.`,calibration:`Calibration`,notCalibrated:(e,t)=>e?`Not calibrated yet: the ranges are ${e}'s, from ${t??`estimates.yaml`}. Once past changes record their effort, the ranges are checked against them.`:`Not calibrated yet, and no ranges to calibrate.`,drivers:`What drives it`,driversCaption:`What makes the change bigger or riskier, with where it comes from`,noDrivers:`Nothing makes it bigger or riskier than its units of work.`,widens:e=>`widens the upper end ${e}×`,work:`The work`,workCaption:e=>`Every unit of work in ${e}`,needsClass:`needs a class`,perRepo:`By repo`,col:{what:`What`,count:`How many`,effect:`Effect`,source:`From`,repo:`Repo`,flow:`Flow`,step:`Step`,cls:`Class`,days:`Days`,units:`Units`},days:e=>`${e.p20}–${e.p80} (${e.p50})`,problems:`What couldn't be read`},changeDiagram:{title:`Change diagram`,intro:`What the change touches, drawn from its target flows: each component, entry and table, marked + new, ◇ changed or ✕ retired; the rest is there for context. A part is new only when the target flow says so.`,pick:`Change`,none:`No change yet. Start one from a brief, then run its architecture stage.`,noTargets:e=>`${e} has no target flows yet, so there is nothing to draw. Its architecture stage writes them:`,legend:`Legend`,legendNew:`+ New`,legendModify:`◇ Changed`,legendRetire:`✕ Retired`,legendContext:`Unmarked: there for context`,parts:`Every part and its mark`,caption:e=>`The parts of ${e}'s picture`,lines:`Every line and its mark`,col:{part:`Part`,kind:`Kind`,in:`In`,mark:`Mark`,from:`From`,to:`To`,what:`What`},mark:{new:`New`,modify:`Changed`,retire:`Retired`,none:`Context`},from:(e,t)=>`Drawn from ${e} target flow${e===1?``:`s`} in ${t}.`,problems:`What couldn't be drawn`,mermaid:`The same picture as Mermaid`,mermaidHint:`Paste it into a pull request, a wiki or a chat that draws Mermaid.`,copyMermaid:`Copy the Mermaid`,flows:e=>`The target flows of ${e}, step by step`},sketch:{title:`Draw the change`,openFlows:`Find today's flows and their ids on Flows`,intro:`Say a stroke: a call one component makes to another, a topic it publishes, a table it reads or writes, or a step of today's flow taken out or sent elsewhere. Preview shows the lines it adds to the change's target flows; Draw writes them and the picture redraws with the stroke marked. A stroke is a plan for the pull request, never a fact.`,kind:`Stroke`,kinds:{call:`A call`,topic:`A topic`,table:`A table`,remove:`A step taken out`,retarget:`A step sent elsewhere`,retire:`A component retired`},retireComponent:`Component to retire`,from:`From component`,flow:`On flow`,flowOptional:`On flow (left out: its one flow)`,pickFlow:`Pick the flow…`,newFlow:`A new flow (the component has none fitting, or is new)`,newName:`What a person calls the new flow`,newId:`Its id (left out: made from the name)`,trigger:`What starts it`,triggers:{endpoint:`An endpoint is called`,action:`A user action`,page:`A page opens`,listener:`A message arrives`,job:`A job runs`},triggerWhat:`In words`,componentWord:`component`,flowWord:`flow`,newType:`What the new box is`,newTypeNone:`A type isn't said yet`,typeOption:(e,t)=>t?`${e} [${t}]`:e,typeMustNot:e=>`Must not: ${typeof e==`string`?e:e.join(` · `)}`,todayFlow:`Today's flow (its id)`,step:`Step number (1 is the first)`,toComponent:`To component`,toEntry:`Its API (METHOD /path, an Endpoint id, or a topic)`,toEntryExample:`POST /v1/screenings`,flowOption:(e,t)=>`${e} (${t})`,drawnBy:e=>`by ${e}`,toNew:`The API doesn't exist yet`,topic:`Topic or queue`,listener:`A component that listens (optional)`,listenerFlow:`On its flow (left out: its one flow)`,op:`Reads or writes`,ops:{read:`Reads`,write:`Writes`,lookup:`Looks up`},table:`Table (store.table)`,tableExample:`orders-db.screenings`,columns:`Columns, comma-separated (optional)`,tableNew:`The table doesn't exist yet`,what:`What the step does (optional)`,why:`Why`,missing:{from:`Say the component the stroke starts from (and, for a new flow, its name and what starts it).`,to:`Say the component it goes to and which API.`,topic:`Say the topic.`,table:`Say the table.`,step:`Say today's flow and the step number.`,why:`Say why.`,component:`Say the component to retire.`},preview:`Preview`,previewing:`Previewing…`,draw:`Draw it`,drawing:`Drawing…`,previewSays:`Draw it writes exactly these lines (the flow's target file, and design.md where Atticus wrote it):`,written:`Drawn. The picture shows it. Propose the drawing for review now, or let it ride the stage's hand-off.`,copy:`Copy`,drawnTitle:`Strokes drawn here`,drawnNone:`None yet.`,undo:`Undo`,undoing:`Undoing…`,fill:`Fill in the rest: the architecture stage keeps every drawn step and drafts the ones around them.`},runNext:{title:`Run next`,copy:`Copy the command`,copySlash:`Copy the slash command`,terminal:`In a terminal, at the metarepo:`,slash:`Or type this in Copilot Chat or Claude Code:`,slashIn:e=>`Or type this in Copilot Chat or Claude Code in ${e}:`,noSlash:`No slash command does this step yet. Run the command in a terminal.`,orTerminal:`Or in a terminal`,openTaskBoard:`Open the Task board`,taskOnBoard:`Run the task with AI on the Task board: Atticus prepares its prompt, checks the result and raises its PR on your click.`,writeBrief:`Write the brief on the Brief tab`,answerOnQuestions:`Answer them on Questions`,openPr:`Open the hand-off PR`,openRelease:`Open Release`,resolveFindings:`Resolve them on the change's page`,answerGap:`Answer it on the change's page`,answerGapSay:`A missing fact is settled on the change's page: Apply fix, ask its owner (Ask), or say it isn't relevant, with a reason.`,resolveFindingsSay:`Each blocking finding is resolved on the change's page: Apply fix, Not relevant or Waive, with a reason.`,openGlance:`Open At a glance`,mapQuestions:e=>`${e} map question${e===1?``:`s`} open.`,mapQuestionsLink:`Answer them on Questions`,whatNext:`Not sure what comes next? Type /atticus-next in Copilot Chat or Claude Code, or run atticus next.`,after:`After that`,install:`atticus assistant-files writes the slash commands into the metarepo, where Copilot Chat and Claude Code both read them:`,plugin:`For Claude Code, add the Atticus plugin: it carries the metarepo's slash commands, and says the next step when a session starts in a metarepo.`,commands:[{name:`/atticus-next`,args:`[--all]`,where:`metarepo`,what:`Says the next step to take, its command and why.`},{name:`/atticus-map`,args:`<repo>`,where:`metarepo`,what:`Reads a repo into facts, each citing its line; Atticus checks every one and the assistant loops until all pass.`},{name:`/atticus-probe`,args:``,where:`metarepo`,what:`Shows Atticus what the assistant can do here (open a file, write one, run a command) after atticus probe, so the first read of a repo is handed to it the way it can take it.`},{name:`/atticus-propose`,args:`[question id]`,where:`metarepo`,what:`Reads the code and config behind each open question and proposes an answer with the lines it rests on; Atticus checks every citation, and a person accepts it or answers otherwise.`},{name:`/atticus-survey`,args:`<repo>`,where:`metarepo`,what:`Drafts a repo's scan settings; Atticus checks them against the code.`},{name:`/atticus-verify`,args:`<repo>`,where:`metarepo`,what:`Compares a repo's code with its last scan; Atticus checks every item.`},{name:`/atticus-spec`,args:`<repo>`,where:`metarepo`,what:`Writes a repo's spec of flows and loops until the spec check passes.`},{name:`/atticus-answer`,args:`[question]`,where:`metarepo`,what:`Explains the open questions; the person chooses each answer.`},{name:`/atticus-knowledge`,args:`<source>`,where:`metarepo`,what:`Reads a knowledge source into items; Atticus checks every quote.`},{name:`/atticus-find`,args:`<term or phrase>`,where:`metarepo`,what:`Searches every wiki for it and proposes what the pages hold about it; Atticus checks every quote.`},{name:`/atticus-needs`,args:`<change>`,where:`metarepo`,what:`Says what a change needs from the organisation: requests to raise, standards to follow, teams to involve.`},{name:`/atticus-feature`,args:`<change>`,where:`metarepo`,what:`Places a change on the estate's flows and features, looping with the checks and critic.`},{name:`/atticus-architecture`,args:`<change>`,where:`metarepo`,what:`Writes a change's target flows from its feature, looping with the checks and critic.`},{name:`/atticus-stories`,args:`<change>`,where:`metarepo`,what:`Writes a change's stories and tasks from its approved design.`},{name:`/atticus-small`,args:`<change>`,where:`metarepo`,what:`Plans a small change in one step: its place on the flows, its target flows and its stories.`},{name:`/atticus-draft`,args:`<change>`,where:`metarepo`,what:`Drafts a change's proposal, spec and interfaces from its brief and the catalog.`},{name:`/atticus-attach`,args:`<change> <files…>`,where:`metarepo`,what:`Attaches a spec, screenshot, PDF or document to a change, for its steps to read and cite.`},{name:`/atticus-knowledge-ask`,args:`<question>`,where:`metarepo`,what:`Answers a question from the knowledge items only, citing each one.`},{name:`/atticus-ask`,args:`<question>`,where:`metarepo`,what:`Answers a question about the systems from the catalog.`},{name:`/atticus-impact`,args:`<record id>`,where:`metarepo`,what:`Lists what a change to one record reaches.`},{name:`/atticus-critic`,args:`<change>`,where:`metarepo`,what:`Reviews a change with the critic's AI lenses, one at a time; every finding is recorded.`},{name:`/atticus-plan`,args:`<change>`,where:`metarepo`,what:`The old name of /atticus-stories, kept for one version.`},{name:`/atticus-snow`,args:`<change>`,where:`metarepo`,what:`Drafts the service-desk requests a change needs.`},{name:`/atticus-release`,args:`<change>`,where:`metarepo`,what:`Checks whether a change is ready to release.`},{name:`/atticus-task`,args:`<change> <task>`,where:`metarepo`,what:`Starts a task with its context loaded: its story, criteria, today's code and the files to change. In a code repo, /atticus-task <task>.`}]},work:{loading:`Loading`,unreadable:`These files couldn't be read:`,estate:`What is read and trusted`,coverage:`Onboarded and read`,reposListed:`repos in the manifests`,reposCloned:`cloned`,reposScanned:`in the catalog`,records:`facts in the catalog`,openOnboarding:`Open Onboarding`,trustNone:`No repo is listed yet, so there is no map to trust.`,allTrusted:`Every repo's map is trusted: its facts are verified and of the commit checked out.`,notTrusted:`Not trusted yet`,openTrust:`Open Map › Trust`,addReposInApp:`Add repos on Set up › Repos`,inFlight:`Changes in flight`,noChanges:`No change is in flight. Start one with New change.`,stageCol:`Stage`,changeCol:`Change`,stateCol:`State`,commandCol:`Run`,slashTitle:`Slash commands in Copilot Chat and Claude Code`,slashIntro:`These slash commands are in Copilot Chat once atticus assistant-files has written them, and in Claude Code through the Atticus plugin. In each AI step your assistant does the model work and Atticus checks it.`,slashWhere:{metarepo:`the metarepo`,repo:`a code repo`},onbIntro:`Pick the repos, connect the knowledge sources, then run the steps in order. Each step is a command; this page shows which one is next.`,steps:`Steps, in order`,stepPick:`Pick the repos: edit the manifest. Each repo is one entry.`,stepPickNone:`There is no manifest yet. Propose one from a folder of clones or your Git host's organisation:`,stepAddOne:`Or add one repo at a time, saying what it is in your own words. That line goes into every reading prompt, the questions a join asks and these views:`,stepSync:`Clone the repos, or bring the clones up to date:`,stepRead:`Have your assistant read each repo and write its facts, each citing its line:`,stepWrite:`Check the facts against the code and put them in the catalog:`,stepAnswer:`Answer the questions the scan raised:`,stepAnswerLink:`Open the Questions page`,stepTrust:`See how far to trust each repo's map, and the files not read yet:`,done:`DONE`,todo:`TO DO`,repos:`Repos`,noRepos:`No repos in any manifest yet.`,repoCol:`Repo`,aboutCol:`What it is`,aboutDraft:`Unconfirmed draft`,aboutMissing:`Nothing says yet. Say what it is, in one line:`,typeCol:`Type in the manifest`,matchCol:`Matched repo type`,matchHint:`Run to see the match and its evidence:`,cloneCol:`Clone`,cloned:`CLONED`,notCloned:`NOT YET`,settingsCol:`Scan settings`,settingsMissing:`none yet`,lastScanCol:`In the catalog`,notScanned:`nothing yet`,recordCount:e=>`${e} fact${e===1?``:`s`}`,atCommit:e=>`at ${e.slice(0,7)}`,sources:`Knowledge sources`,sourcesMissing:e=>`${e} isn't there. Add a wiki on Set up › Org pack (Add a wiki), or with atticus sources add <type> <location>.`,sourcesNone:e=>`${e} lists no wikis or absorbed repos yet.`,sourcesFile:`File`,wikiCol:`Wiki`,kindCol:`Kind`,whereCol:`Location`,spacesCol:`Spaces`,ownerCol:`Owner`,absorbedTitle:`Absorbed repos`,syncSources:`Read the wikis:`,pickChange:`Change`,noChangeYet:`No change yet. Start one with New change; the command line is under Or in a terminal.`,noChangeTitle:`No change yet`,noChangeReads:`No change reads`,noChangeReadsBody:`No change reads: each one's change.yaml below doesn't. Fix it where it says, or start another with New change; the command line is under Or in a terminal.`,openBreakdown:`Open Breakdown`,openBreakdownWhy:`for how ready each story is and what no story covers yet.`,storiesIndex:`The stories`,storyFile:e=>`Story ${e}`,noStoryFiles:`No story is written yet: Prepare the stories stage above to write them.`,placementTitle:`Where the feature lands`,placementText:`feature.md, where the feature lands`,placementNotYet:`The feature stage hasn't placed this change yet. Its run writes feature.md here: the feature in a few sentences, the flows it touches and the gaps.`,placementNotDrawn:`feature.md isn't drawn yet. Save in Edit, or the stage's next run, draws it from feature.yaml.`,draftedByAiWhy:`The AI drafted it at the feature stage, and no person has edited it here since (The drafts below says which run). Read it before the hand-off; Edit changes feature.yaml, which the stage's next run reads.`,editedBy:e=>`Edited by ${e}`,editedByPerson:`Edited by a person`,editedByWhy:(e,t)=>`${e} saved feature.yaml${t?` on ${t}`:``}; feature.md is drawn from it.`,editedByHand:`feature.yaml was edited outside the app; feature.md is drawn from it.`,editPlacement:`Edit`,editPlacementLabel:`Edit feature.yaml, where the feature lands`,placementEditTitle:`Edit feature.yaml`,placementSourceHint:`feature.md is drawn from feature.yaml. Change the summary, the flows and the gaps here: Save checks it still reads as a placement and draws feature.md again, and the stage's next run reads your edit.`,placementSourceLabel:`feature.yaml text`,placementSave:`Save`,placementCancel:`Cancel`,placementClose:`Close`,placementSaved:`Saved feature.yaml and drew feature.md from it. Both ride the feature hand-off.`,openTaskBoard:`Run tasks with AI`,openTaskBoardWhy:`on the Task board: each task runs on its repo and ends as a pull request a person approves.`,noChangeCommand:`atticus change new "<title>" --type <type>`,noChangeLink:`All changes lists every change once you start one.`,pickAChangeTitle:`Pick a change`,pickAChange:`This tab is about one change. Pick it in All changes, and every tab of Change follows it.`,openAllChanges:`Open All changes`,stageIs:e=>`This change is at the ${e} stage.`,goStage:e=>`Open ${e}`,files:`The change's files`,noFiles:`No files for this change yet.`,fileCol:`File`,statusCol:`Status`,tasks:`Tasks`,noTasks:`No tasks yet. Write them with atticus plan stories <change>.`,taskCol:`Task`,repoTaskCol:`Repo`,runCol:`Run it`,taskDone:`DONE`,taskOpen:`OPEN`,openOnBoard:`Open on the Task board`,openOnBoardLabel:e=>`Open task ${e} on the Task board`,runOnBoard:`Run with AI there, or mark it done.`,fromTerminal:`From a terminal or your assistant`,taskInRepo:e=>`Prints the same context for any assistant, to read before coding in ${e}.`,stage:{feature:`feature`,architecture:`architecture`,stories:`stories`,tasks:`tasks`,release:`release`,done:`done`},why:{discover:`There are no repos to work on until a manifest lists them: add them on Set up › Repos.`,sync:e=>`${e} repo${e===1?` isn't`:`s aren't`} cloned yet.`,read:{"not-read":e=>`${e} isn't read yet: your assistant reads it and writes its facts, each citing its line, and atticus verify checks every one.`,unverified:e=>`${e}'s facts aren't verified yet: atticus verify checks each against the line it cites.`,rejected:e=>`Some of ${e}'s facts were rejected: your assistant fixes them from the rejected file, then verify runs again.`,stale:e=>`${e}'s facts are of another commit than its checkout: your assistant reads what changed again.`,unwritten:e=>`${e}'s facts are verified but not in the catalog yet: atticus verify --write puts them there.`},write:e=>`When the read is done, atticus verify ${e} --write checks the facts and puts them in the catalog.`,answer:e=>`${e} question${e===1?` is`:`s are`} waiting. Answer on the Questions page; it shows the command to rerun.`,answerUnknown:`The open questions couldn't be read just now, so this step isn't ticked yet. Open the Questions page to see them.`,onboarded:`Every repo is read and its facts verified. Map › Trust says how far to trust each repo's map; atticus next says what comes next.`,change:(e,t)=>`${e} is at the ${t} stage.`,newChange:`Everything is onboarded and no change is in flight. Start one.`,feature:`Your assistant places the change on the estate's flows and features; Atticus checks and criticises every draft until nothing blocks.`,architecture:`Your assistant writes the target flows; Atticus checks and criticises every draft until nothing blocks.`,stories:`Writes the stories, stories.md and tasks.md from the approved design.`,task:(e,t)=>`Task ${e} in ${t} is the next open one. /atticus-task gives your assistant its context: the story, the criteria, the step with today's code and the files to change.`,small:`A small change: your assistant places it, writes its target flows and words its stories in one step; Atticus runs every stage's checks and the critic at its gate.`,later:`The change is past this stage; its status says what it needs now.`,refresh:`The diagram is drawn from the catalog. When a repo's code has changed, your assistant reads it again and atticus verify --write puts its facts in the catalog.`,stageDone:(e,t)=>`The ${e} stage is done; the change now waits on its hand-off gate. ${t}`,stageBlocked:(e,t)=>`The ${e} stage is done, but the gate can't be raised yet: ${t}`,stageUnderWay:(e,t)=>t===`questions`?`The ${e} stage waits for answers to its questions; run it again once they are answered.`:t===`waiting`?`The ${e} stage is with your assistant: finish its hand-off, then run it again.`:t===`stopped`?`The ${e} stage stopped for a person to fix a file; run it again once it is fixed.`:`The ${e} stage is drafting; run it again to go on.`,critic:`Reviews the change's files against the checklists.`,handoff:`Opens the stage's hand-off PR; merging it approves the stage.`,questionsList:`Lists the open questions with their files.`},architectureIntro:`The diagram is drawn from the catalog. A change at the design stage shows its next step here.`},shell:{aiOff:`AI OFF`,textOnlyAi:`TEXT-ONLY AI`,aiIsOffIn:`AI is off in this organisation: no AI step runs; people write and the rule checks review.`,imageReadingIsOff:`Image reading is off: pictures go to a person in Intake.`,setYourGitUser:`SET YOUR GIT USER`,recordedAs:(e,t,n)=>`${e}${t} · recorded as ${n}`,askAtticus:`Ask Atticus`,askWhatBreaksIf:e=>`Ask: what breaks if ${e} changes?`,askNeutral:`Ask: who calls a component, or what breaks if a table changes?`,ask:`Ask`,help:`Help`,replayTheTour:`Replay the tour`,skipToContent:`Skip to content`},ide:{search:`Search the estate, ask, or run a command`,metarepo:e=>`${e} · metarepo`,sideShow:`Show the side panel`,sideHide:`Hide the side panel`,resize:`Resize the side panel`,tabs:`Open pages`,tabHint:`Delete closes this tab. Ctrl+Shift+Left or Right moves it.`,closeTab:e=>`Close ${e}`,moreTabs:e=>`${e} more`,moreTabsLabel:e=>`${e} more tab${e===1?``:`s`}`,tabTitle:(e,t)=>`${e} · ${t}`,openCount:e=>`${e} to answer`,more:`More pages`,settings:`Settings`,status:`Status`,repos:e=>`${e} repo${e===1?``:`s`}`,questions:e=>`${e} question${e===1?``:`s`} to answer`,running:e=>`${e} running`,step:(e,t)=>`${e}/${t}`,alsoRunning:e=>`+${e}`,api:e=>`local API ${e}`,version:e=>`v${e}`,who:(e,t)=>t?`${e} · ${t}`:e,tools:`Page tools`,panelCommands:{console:`Open the Console`,questions:`Show the open questions in the panel`,problems:`Show the problems`,runs:`Show the recent runs`,detail:`bottom panel`,also:{console:[`console`,`log`,`output`,`terminal`],questions:[`questions`,`panel`],problems:[`problems`,`failed`,`blocking`,`rejected`,`errors`],runs:[`runs`,`recent`,`history`,`jobs`]}},layout:{title:`Layout`,meta:`this browser`,legend:`How the app is laid out`,ide:`IDE (new)`,ideWhat:`An activity bar, a side panel, a tab per open page and a status bar.`,classic:`Classic`,classicWhat:`The menu on the left and one page at a time, as before beta.26.`,kept:`Kept in this browser. The classic layout stays available for this release.`,toClassic:`Switch to the classic layout`,toIde:`Switch to the IDE layout`,commandDetail:`layout, this browser`}},boundary:{appCouldntBeShown:`Atticus couldn't be shown`,somethingInTheApp:e=>`Something in the app failed: ${e}. Go to Home to carry on; if it happens again, reload.`,goHome:`Go to Home`,couldntBeShown:e=>`${e} couldn't be shown`,somethingOnThisScreen:e=>`Something on this screen failed: ${e}. The other screens still work; reload to try again.`},flowView:{andMore:(e,t)=>`${e} and ${t} more`,nodesInGroupsEdges:(e,t,n,r)=>`${e}: ${t} nodes in ${n} groups, ${r} edges.`,callsInsideIt:e=>`, ${e} calls inside it`,edgePointAtAnother:(e,t,n,r,i)=>`${e}: ${t} edge${n}${r}${i}. Point at another box, or click it again to clear.`,everythingHereIsOne:`Everything here is one system: open Container to see its components and how they connect.`,edgesPointAtA:e=>`${e} edges. Point at a box to light its edges; dashed lines are asynchronous.`},menu:{atticus:`ATTICUS`,askAtticus:`Ask Atticus`,morePages:`More pages`,keysMac:`Cmd+K`,keys:`Ctrl+K`,anyPage:e=>`${e}: any page`},palette:{kinds:{screen:`page`,change:`change`,record:`record`,ask:`ask`,command:`command`},askItem:e=>`Ask: ${e}`,askDetail:`answer from the catalog, with the query shown`,sync:{label:`Sync the repos`,detail:`Clone each repo's base clone, or bring it up to date; the Console shows it as it runs`,also:[`sync`,`clone the repos`,`update the repos`,`workspace sync`,`base clones`],started:`Syncing the repos: the Console shows each repo as it goes.`,failed:e=>`The sync didn't start: ${e}`},goToAScreen:`Go to a screen, change or record, or ask a question`,goToAScreen2:`Go to a screen, change or record… or ask a question`,nothingMatches:`Nothing matches.`,results:`Results`,toMoveEnterTo:`↑ ↓ to move · Enter to open · Esc to close`,goToAnything:`Go to anything`},tour:{tourOf:(e,t,n)=>`Tour · ${e} of ${t} · ${n}`,steps:{home:{title:`Your home`,body:`Home is one page. First what needs a person across every change (changes in each phase, blocking findings, open needs, questions and manual steps) and the step to run next; then what is read and trusted, and each change in flight with the stage it is at. Beside it: Map, Change, Questions, Knowledge and Set up. Everyone sees the same screens; Ctrl+K jumps anywhere.`},ask:{title:`Ask in plain words`,body:`Type a question such as “who calls <a component>?” or “what breaks if <a table> changes?” in the box at the top. Atticus answers from the catalog and always shows the query it ran.`},change:{title:`One change, a tab per stage`,body:`Change opens on All changes: pick one, and the tabs follow it. At a glance says where the change is and what blocks it; then a tab for each stage: feature, architecture, stories and tasks. Each shows that stage's files and the command to run next; Feature also lists the org knowledge that applies, to confirm or exclude. Watch a change you aren't on, and your digest says how it is doing.`},assistant:{title:`Run a step in your assistant`,body:`The AI steps run in your assistant, not here: type /atticus-next in Copilot Chat or Claude Code and it says what comes next and runs it when you ask. Its questions come back here to answer, and this page follows along.`},approve:{title:`Approving is the pull request`,body:`Each phase ends with a hand-off PR in the metarepo. Merging it approves the gate; your Git host's rules decide who may approve. Atticus records you by your Git user.`}},skipTheTour:`Skip the tour`,back:`Back`,next:`Next`,done:`Done`},glossary:{title:`What the words mean`,intro:`Atticus's own words, each in one plain sentence. atticus explain <word> says the same on the command line.`,link:`Words`,linkTitle:`What Atticus's words mean`,terms:[{term:`metarepo`,says:`The Git repo Atticus keeps for your estate: the catalog read from your repos' code, the changes in flight, the knowledge and the org pack. Its pull requests are how things get approved.`},{term:`org pack`,says:`Your organisation's settings for Atticus, in org-pack/: the repos and their types, the change types, the checklists and how AI runs here, changed through a pull request.`},{term:`catalog`,says:`What Atticus read from your code: systems, components, endpoints, tables, settings and how they connect, each citing the file and line it came from.`},{term:`estate`,says:`All your systems and the repos behind them, as the catalog describes them.`},{term:`flow`,says:`One path through your code from a trigger (an endpoint, a job, a message) to what it reads, writes and returns, step by step, read from the code.`},{term:`change`,says:`A piece of work from idea to release, kept in the metarepo with its brief, its design, its stories and its tasks.`},{term:`target flow`,says:`How a flow will run once a change is in: the steps it adds, changes or removes, with what each reads and writes.`},{term:`hand-off`,says:`The pull request in the metarepo that ends a phase of a change; merging it approves the phase's gate.`},{term:`gate`,says:`The point between two phases of a change where its findings are checked and a person approves, by merging the hand-off pull request.`},{term:`finding`,says:`Something the critic or a check raised about a change (blocking, a risk, a gap or an idea), citing where it is; a person decides what to do with it.`},{term:`critic`,says:`The AI reviewer that reads a change at a gate, one lens at a time, and raises findings.`},{term:`lens`,says:`One way the critic reads a change, such as security, data or architecture, each with its own rules.`},{term:`checking round`,says:`One more critic round after a gate's rounds are used, which reviews only what a person fixed.`},{term:`question`,says:`Something Atticus asked a person because the code doesn't say, with options and the lines it read; the answer is kept in the metarepo for the steps that read it.`},{term:`knowledge item`,says:`A fact read from a wiki or a document you added (a process, a standard, a decision, a team), quoted with its page, until a person verifies it.`},{term:`need`,says:`Something a change needs from the organisation, such as a firewall rule or an access request, with how to ask for it and who handles it.`},{term:`dialect`,says:`The rules that tell Atticus's scanner how to read one framework or language, your own house frameworks included.`},{term:`base clone`,says:`Atticus's own read-only copy of a repo, in the metarepo's workspace/, which the scans read; it never touches your working copy.`},{term:`slash command`,says:`A command you type in your assistant's chat, such as /atticus-next, that runs one Atticus step with the assistant's model.`},{term:`service desk`,says:`Your operations ticketing system, where a change's release and access requests are raised.`}]},filter:{label:`Filter`,placeholder:`Words to match, for example forge-ledger`,shown:(e,t)=>`${e} of ${t} shown`,words:e=>`“${e}”`,inRepo:e=>`in ${e}`,inChange:e=>`in ${e}`,among:e=>`among ${e}`,nothingMatches:e=>`Nothing matches ${e}.`,clear:`Clear the filter`,repo:`Repo`,allRepos:`All repos`},common:{nothingHereYet:`Nothing here yet.`,of:(e,t,n)=>`${e}: ${t} of ${n}`},across:{findings:`Findings`,tasks:`Tasks`,stories:`Stories`,tests:`Tests`,requests:`Requests`,releases:`Releases`,needs:`Needs`,change:`Change`,severity:`Severity`,finding:`Finding`,where:`Where`,state:`State`,task:`Task`,repo:`Repo`,what:`What`,done:`Done`,story:`Story`,title:`Title`,repos:`Repos`,written:`Written`,requirementsTested:`Requirements tested`,gaps:`Gaps`,firstGaps:`First gaps`,request:`Request`,for:`For`,missing:`Missing`,risk:`Risk`,next:`Next`,handOff:`Hand-off`,noFindingsOnAny:`No findings on any open change. Run the critic on a change to review it.`,noTasksYetTasks:`No tasks yet: tasks come with a change's plan.`,noStoriesYetWrite:`No stories yet: write them on a change's Breakdown.`,noOpenChangesTo:`No open changes to trace.`,noServiceRequestsDrafted:`No service requests drafted on any open change.`,noOpenChanges:`No open changes.`,notYet:`not yet`,noneOpen:`none open`,handOffManual:e=>`${e} · waits on a manual step`,acrossChanges:`Across changes`,ofAcrossOpenChange:(e,t,n,r)=>`${e} of ${t} across ${n} open change${r}`,acrossOpenChanges:e=>`${e} across open changes`,nothingMatches:e=>`Nothing matches “${e}”.`,acrossChanges2:e=>`${e} across changes`,needsIntro:`Every open need of every open change: the requests to raise, the standards to follow and the teams to involve. Done, Not needed and Reopen work as on a change's page.`,needsShowAll:`Show the needs done or not needed too`,needsCount:(e,t)=>`${e} open need${e===1?``:`s`} across ${t} open change${t===1?``:`s`}`,needsNone:`No open needs on any change.`,needsNoChanges:`No open changes.`,needsOf:e=>`Needs of ${e}`,needsNotYet:e=>`${e} change${e===1?` hasn't`:`s haven't`} been looked at for needs yet`,needsCantRead:(e,t)=>`Couldn't read the needs of ${e}: ${t}`},changeWork:{more:`More`,less:`Less`,moreAbout:e=>`More: ${e}`,lessAbout:e=>`Less: ${e}`,changeCount:e=>`${e} change${e===1?``:`s`}`,risk:e=>`${e.charAt(0).toUpperCase()}${e.slice(1)} risk`,lifecycle:{draft:`Draft`,define:`Define`,design:`Design`,plan:`Plan`,build:`Build`,qa:`QA`,"release-ready":`Release`,released:`Released`,"post-release-review":`Post-release review`,returned:`Returned`,archived:`Archived`},fromTerminalFor:e=>`From a terminal or your assistant, for task ${e}`,prShort:e=>e?`PR #${e}`:`PR`},changes:{qa:`QA`,define:`Define`,design:`Design`,plan:`Plan`,build:`Build`,release:`Release`,handOffPrOpened:`Hand-off raised. Reviewers approve its PR on the Git host (on a manual Git host, its step on Home says how to open it); merging it approves the gate.`,syncedWithTheGit:`Synced with the Git host.`,criticRoundStartedThe:`The review started: the rule checks ran. Any AI review that waits is in Model runs, where Done checks its answer.`,theRuleChecksRan:`The rule checks ran. AI is off here, so no AI review waits.`,checkedTheAnswer:`Checked the answer.`,readyToTryAgain:`Ready to try again.`,findAChange:`Find a change`,idTitleOrRepo:`Id, title or repo`,state:`State`,everyState:`Every state`,blocked:`Blocked`,blocked2:`BLOCKED`,noChangeMatches:`No change matches.`,changes:`Changes`,acrossAllChanges:`Across all changes`,noChangesYetStart:`No changes yet. Start one with New change.`,currentPhase:e=>`${e}: current phase`,done:`done`,toCome:`to come`,phases:`Phases`,text:e=>`${e} text`,save:`Save`,close:`Close`,cancel:`Cancel`,templateAsks:`What the template asks for`,recordedOn:(e,t)=>`Recorded on ${t}: ${e}.`,ifSomeoneSavedMeanwhile:`If someone saved meanwhile, Atticus refuses the save and asks you to reload.`,edit:e=>`Edit ${e}`,saved:e=>`Saved ${e}.`,recorded:e=>`Recorded: ${e}.`,changedMeanwhile:`Someone saved this file meanwhile, so yours wasn't written over theirs. Reload it (your text stays) and save again.`,reloadKeepMine:`Reload, keep my text`,taskHanded:e=>`Task ${e} handed to your assistant. Open the prompt, then mark it done.`,reason:`Reason`,reasonNeededToWaive:`Reason (needed to waive or dismiss)`,applyFix:`Apply fix`,owner:`owner`,ask:e=>`Ask ${e}`,notRelevant:`Not relevant`,waive:`Waive`,next:`Next`,risk:e=>`RISK ${e}`,handOff:(e,t,n)=>`${e} HAND-OFF · ${t}${n}`,handOffManual:e=>`${e} HAND-OFF · WAITS ON A MANUAL STEP`,whatBlocksTheHand:`What blocks the hand-off`,blockedBy:e=>`${e} thing${e===1?``:`s`} block${e===1?`s`:``} the hand-off; clear them first.`,heldFirst:`Raise hand-off waits until the next step above is done.`,seeGlance:`See the step on At a glance`,raiseHandOff:`Raise hand-off`,syncAndMergeWhen:`Sync and merge when approved`,runTheCriticYour:`Run the critic (your assistant)`,runTheRuleChecks:`Run the rule checks`,artifact:`Artifact`,status:`Status`,findings:`Findings`,actions:`Actions`,edit2:`Edit`,artifacts:`Artifacts`,checks:`checks`,noOpenFindingsOn:`No open findings on this change.`,openFindings:`Open findings`,done2:`DONE`,byHand:`BY HAND`,runWithAi:`Run with AI`,inputs:`Files attached`,promote:`Copy to general knowledge`,promoteFor:e=>`Copy ${e} to general knowledge`,promoted:e=>`${e} is copied to the metarepo's inputs/inbox/: general knowledge, read at the next sync. This change keeps its copy. Commit both through a pull request.`,attachLabel:`Attach a file`,attachHelp:`A spec, screenshot, PDF, email export or document. It is copied into the change's inputs/, and the change's steps read it as data, citing it by line or page.`,noInputs:`No file is attached yet.`,attached:e=>`Attached ${e}. The change's steps read it from now on.`,attachTooLarge:e=>`That file is ${e} MB; the app attaches files up to 15 MB. For a larger one, run atticus change attach in a terminal.`,inputFile:`File`,inputKind:`What it is`,inputWho:`Attached`,inputWhen:(e,t)=>`${e}, ${t.slice(0,10)}`,inputRead:(e,t)=>e===`text`?`Read, cited by ${t??`line`}`:`Not read: open it to see it`,inputOlder:e=>`Older version: ${e} replaces it`,inputHidden:`Hides instructions: kept out of every AI step until a person decides`,prototypes:`The prototype, compared`,noPrototypes:e=>`No prototype is attached. Compare one with the estate above, or run: atticus change attach ${e} --prototype <repo>`,prototypePick:`Prototype repo`,prototypeCompare:`Compare with the estate`,prototypeComparing:`Comparing…`,prototypeCompareHelp:`Reads the prototype's verified facts, compares each call with the estate, attaches the comparison to this change and adds what it touches. The same as atticus change attach --prototype.`,prototypeCompared:e=>`Compared ${e} and attached it.`,prototypeNoCandidates:`No repo in the manifests is typed prototype. Set one repo's type to prototype on Set up › Repos, read it, then compare it here.`,prototypeMarker:`Prototype`,prototypeUnconfirmed:`a draft nobody has confirmed`,prototypeNoAbout:`Nothing says what it is yet.`,prototypeCounts:e=>`${e.exists} exist, ${e.changes} change, ${e.new} new, ${e.vendor} only a vendor provides`,prototypeGroup:{exists:`Exists`,changes:`Changes`,new:`New`,vendor:`Only a vendor`},prototypeGroupHelp:{exists:`The estate serves it as the prototype needs.`,changes:`The estate serves the operation, but not as the prototype needs.`,new:`Nothing in the estate serves it.`,vendor:`Only a vendor provides it, so it needs a route through the external gateway.`},prototypeNoCalls:`None.`,prototypeGroupCount:(e,t)=>`${e} · ${t}`,prototypeLeg:{"ui-bff":`UI to BFF`,"bff-mock":`BFF to mock`},prototypeCites:(e,t)=>`Prototype: ${e} → ${t}`,prototypeEstate:(e,t)=>`Estate: ${e} ${t}`,prototypeVendor:(e,t)=>`Vendor: ${e} ${t}`,prototypeTeam:(e,t)=>`Another team: ${e} ${t}`,prototypeLeft:e=>`${e} call${e===1?``:`s`} reach${e===1?`es`:``} nothing in the prototype and ${e===1?`isn't`:`aren't`} compared.`,noTasksYetThey:`No tasks yet: they come with the plan.`,tasks:`Tasks`,markDone:`Mark done`,retry:`Retry`,cancelRun:`Cancel`,runCancelled:`Cancelled. The task can run again.`,noAiRunsYet:`No AI runs yet.`,taskRunLine:(e,t,n)=>`Task ${e}: ${(t===`pr-open`&&n===`merged`?`PR merged`:t===`pr-open`&&n===`closed`?`PR closed`:void 0)??{planned:`planned`,built:`built`,unverified:`drafted, not built (no build command)`,"pr-open":`PR open`,waiting:`waiting for your assistant`,"needs-person":`needs a person`,failed:`failed`}[t]??t}`,taskRunLog:e=>`Last build: ${e}`,aiRuns:`AI runs`,pickAChangeOn:`Pick a change on the left, or start one with New change.`,noChangeSelected:`No change selected`},commandCenter:{select:e=>`Select ${e}`,bulkTitle:`Act on the selected items`,selected:e=>`${e} selected`,bulkAction:`What to do`,bulkNeedDone:e=>`Mark ${e} need${e===1?``:`s`} done`,bulkNeedNot:e=>`Mark ${e} need${e===1?``:`s`} not needed`,bulkStepSkip:e=>`Skip ${e} manual step${e===1?``:`s`}`,bulkTicket:`The ticket or note, for all of them`,bulkWhy:`Why, for all of them`,bulkDo:e=>`Do it for ${e}`,bulkClear:`Clear the selection`,bulkDone:(e,t,n=[])=>t?`Done for ${e}; ${t} couldn't be changed${n.length?`: ${[...new Set(typeof n==`string`?[n]:n)].join(`; `)}`:`: open each to see why`}.`:`Done for ${e}.`,partlyLoaded:e=>`Part of this list didn't load, so it may be short: ${typeof e==`string`?e:e.join(`; `)}`,needsOfFailed:(e,t)=>`${e}'s needs (${t})`,needsFailed:e=>`the changes' needs (${e})`,stepsFailed:e=>`the steps to do (${e})`,questionsFailed:e=>`the open questions (${e})`,triageFailed:e=>`the triage (${e})`,howStepsRun:`How AI steps run:`,howStepsRunChange:`Change in Set up › AI`,howStepsRunCantRead:e=>`Atticus couldn't read how AI steps run here: ${e}`,define:`Define`,design:`Design`,plan:`Plan`,build:`Build`,release:`Release`,theCatalogIsAccepted:`The catalog is accepted as the baseline, with your name, in catalog/baseline.yaml. Propose it for review: merging the pull request makes it the baseline on main.`,baselineAccepted:`Baseline accepted`,done:` (done)`,toDo:` (to do)`,checking:` (checking)`,optional:` · optional`,acceptTheCatalogAs:`Accept the catalog as the baseline`,afterWalkingTheEcosystem:`After walking the ecosystem map with the architect. Every later scan, document and change is compared with it. It is a file in the metarepo, so it reaches main through a pull request.`,setUpAtticus:`Set up Atticus`,ownerLabel:`Who looks after the org pack`,ownerHint:`One handle, such as priya.nair or team-platform. Saved as owner in org-pack/pack.yaml: propose it for review; its owner approves changes to the org pack from then on.`,ownerSave:`Save the owner`,ownerSaving:`Saving…`,ownerBad:`One handle: letters, digits, dots and hyphens, no spaces.`,ownerSaved:e=>`${e} now looks after the org pack. Propose org-pack/pack.yaml for review to share it.`,ofDone:(e,t)=>`${e} of ${t} done`,showMyDigest:`Show my digest`,sendItToMe:`Send it to me`,sendItTo:e=>`Send it to ${e}`,sentTo:e=>`Sent to ${e}.`,thingsNeedAttention:e=>`${e} things need attention.`,nothingIsBlockedRight:`Nothing is blocked right now.`,nothingBlockedButWaiting:(e,t)=>`Nothing is blocked; ${e} thing${e===1?` waits`:`s wait`} for a person: ${t}.`,approvingIsThePull:`Approving is the pull request: each phase ends with a hand-off PR, and merging it approves the gate. Your Git host decides who may approve.`,currentPhase:e=>`${e}: current phase`,done2:`done`,toCome:`to come`,noChangeInFlight:`No change in flight. Start one with New change.`,loading:`Loading…`,couldntLoadWhatNeeds:e=>`Couldn't load what needs a person: ${e}`,nothingNeedsAPerson:`Nothing needs a person right now.`,needsAPerson:`Needs a person`,waitingOnYou:`Waiting on you`,waitQuestions:`Questions to answer`,waitNeeds:`Needs still open`,waitSteps:`Manual steps to do`,waitBlocking:`Blocking findings`,openNeeds:`Open needs`,byChangeIntro:`Grouped by change, changes with something blocking first; then what belongs to no change.`,noChangeGroup:`Not part of a change`,blocked:`BLOCKED`,groupCount:e=>`${e} waiting`,inState:e=>`in ${e}`,sectionNeeds:`Open needs`,sectionFindings:`Findings`,sectionSteps:`Manual steps`,sectionQuestions:e=>e?`Questions · ${e}`:`Questions`,sectionTriage:`To sort out`,sectionKnowledge:`Knowledge to verify`,knowledgeToVerify:e=>`${e} knowledge item${e===1?``:`s`} no one has verified yet`,knowledgeDetail:`Verify, correct or reject each against its page`,aPersonApprovesEvery:`A person approves every write · Atticus never touches live systems · every fact keeps its evidence`,home:{you:(e,t)=>t?`You are ${e} · ${t}`:`You are ${e}`,live:`Live from your metarepo`,inFlight:`Changes in flight`,inFlightNone:`None in flight`,inStage:(e,t)=>`${e} at ${t}`,corrections:`Corrections to apply`,toPropose:e=>e?`${e} file${e===1?``:`s`} to propose`:`Nothing to propose`,trusted:(e,t)=>`${e}/${t} trusted`,catalog:`Facts in the catalog`,catalogSub:(e,t)=>`${e} interface${e===1?``:`s`}${t?` · ${t}`:``}`,mapSub:`Open the map`,findingsSub:(e,t,n)=>`${e} from checks · ${t} from AI lenses${n?` · most: ${n}`:``}`,tileLoading:`Loading`,tileError:e=>`Couldn't load: ${e}`,next:`Next for you`,changes:`Your changes`,seeAllChanges:`See all changes`,changesMore:e=>`${e} more in flight`,gatesOf:e=>`Gate pipeline of ${e}`,glance:`At a glance`,waitOnYou:`Your needs and steps`,waitingKinds:{triage:e=>`${e} to sort out`,question:e=>`${e} question${e===1?``:`s`}`,need:e=>`${e} need${e===1?``:`s`}`,step:e=>`${e} manual step${e===1?``:`s`}`,finding:e=>`${e} finding${e===1?``:`s`}`,knowledge:e=>`${e} knowledge item${e===1?``:`s`} to check`},waitOnYouSub:(e,t)=>`${e} open need${e===1?``:`s`} · ${t} manual step${t===1?``:`s`}`,needsMore:e=>`${e} more group${e===1?``:`s`}`,needsMeta:e=>`${e} waiting`,questionsSub:(e,t)=>`${e} from steps · ${t} to owners`,seeAllQuestions:`See all questions`,wholeList:e=>`Show the whole list (${e})`,hideWholeList:`Hide the whole list`,wholeListTitle:`Everything that needs a person`,digest:`Digest`,inChange:e=>`in ${e}`,inChangeLead:`in `,assistant:`Use with your assistant`,problems:`Some files couldn't be read: see Map › Trust.`,more:e=>`+${e} more`,setupLine:(e,t)=>`Atticus isn't set up yet: ${e} of ${t} steps done.`,setupShow:`Show the steps`,count:(e,t)=>`${e} ${t}`,topKinds:e=>`Most in the catalog: ${e}`,byLens:e=>`Open findings by lens: ${e}`,seeFindings:`See the findings`,seeCatalog:`Explore the catalog`}},explore:{evidence:`Evidence`,noEvidenceRecordedTreat:`No evidence recorded: treat this fact as unconfirmed.`,whatBreaksIfThis:`What breaks if this changes`,isOwnedBy:` is owned by `,theCatalogDoesntKnow:`The catalog doesn't know who owns `,yet:` yet.`,queryRun:`Query run: `,editItBelowTo:` · edit it below to refine`,ask:e=>`Ask: ${e}`,search:`Search`,tryDailyLimitKind:`Try: daily limit · kind:interface via:gateway · "ledger-db"`,wordsMatchIdsAnd:`Words match ids and names; `,kind:`kind:`,system:`system:`,status:`status:`,narrowIt:` narrow it.`,searchTheCatalog:`Search the catalog`,searchForAService:`Search for a service, a table, a topic, a term or a feature.`,searchResults:`Search results`,nothingMatchesTryFewer:`Nothing matches. Try fewer words.`,results:`Results`,theCatalogIsEmpty:`The catalog is empty. Read a repo first: your assistant reads its code, and Atticus checks each fact against its line and draws the map.`,around:e=>`Around ${e}`,theWholeEstate:`The whole estate`},knowCommon:{table:`Table`},design:{interfaces:`Interfaces`,tables:`Tables`,result:`Result`,what:`What`,next:`Next`,diagramLabel:`Diagram label`,matched:`Matched`,how:`How`,similar:`Similar`,context:`Context`,data:`Data`,events:`Events`,container:`Container`,sequence:`Sequence`,item:`Item`,party:`Party`,due:`Due`,forecast2:`Forecast`,status:`Status`,commitment:`Commitment`,neededBy:`Needed by`,noInTheCatalog:e=>`No ${e} in the catalog.`,evidence:`Evidence`,noEvidenceTreatIt:`No evidence: treat it as unconfirmed.`,thePathOfTheCall:`The path of the call`,scopesIt:e=>`scopes ${e}`,noScopeDemanded:`no scope demanded`,theCallerMeets:e=>`the caller meets ${e}`,thenReaches:e=>`then reaches ${e}`,noRouteRecordedFor:`The catalog has no gateway route for this call: only that it goes through a gateway.`,consumersAndDependants:`Consumers and dependants`,seeImpact:`See impact`,nothingInTheCatalog:`Nothing in the catalog depends on it.`,record:`Record`,apis:`APIs`,interfacesAndEvents:`Interfaces and events`,dataStores:`Data stores`,dataStoresComeFrom:`Data stores come from DDL, migrations, ORM mappings and DBA exports, never live databases.`,contractsList:`Contracts list`,contracts:`Contracts`,chooseAnApiAn:`Choose an API, an interface or a table to see its evidence and who depends on it.`,pickAContract:`Pick a contract`,contractsByKind:`Contracts by kind`,contractMix:`Contract mix`,ofInterfacesVerifiedFrom:(e,t)=>`${e} of ${t} interfaces verified from code`,filterContracts:e=>`Find ${e} by id or name`,showingOf:(e,t)=>`Showing ${e} of ${t}`,showMore:`Show more`,aVendorSpecIs:`A vendor spec is a document until its caller is scanned; code wins when they differ.`,fieldMappings:`Field mappings`,verifiedFromCode:`Verified from code`,noDiagramsYetPut:`No diagrams yet. Put draw.io, Visio, Lucid CSV or Mermaid files under `,inputsDiagrams:`inputs/diagrams/`,orAddThemOn:` (or add them on `,intake:`Intake`,thenComeBack:`), then come back.`,reconcileADiagramAgainst:`Reconcile a diagram against the catalog`,edgesMatchCode:(e,t)=>`${e}/${t} edges match code`,toResolve:e=>`${e} TO RESOLVE`,inSync:`IN SYNC`,checkAgain:`Check again`,ofDrawnEdgesAgree:(e,t)=>`${e} of ${t} drawn edges agree with code`,drawnEdgesAgreeWith:`drawn edges agree with the code`,itemsToResolveBy:`Items to resolve by kind`,labelsMatchedToThe:(e,t)=>`${e}/${t} labels matched to the catalog`,noDiagramsCouldBe:`No diagrams could be read.`,diagrams:`Diagrams`,pickADiagram:`Pick a diagram.`,all:e=>`All ${e}`,filterItems:`Filter items`,everyDrawnEdgeAgrees:`Every drawn edge agrees with the code.`,itemsToResolve:`Items to resolve`,codeWinsOverA:`Code wins over a diagram: a conflict goes to `,triage:`triage`,untilAPersonDecides:` until a person decides.`,edgeByEdge:e=>`Edge by edge · ${e}`,edgeByEdge2:`Edge by edge`,ofEdgesAgreeWith:(e,t)=>`${e} of ${t} edges agree with code`,diagramLabels:`Diagram labels`,noMatch:`NO MATCH`,confirmANameWith:`Confirm a name with `,atticusAliasLabelId:`atticus alias "<label>" <id>`,itIsSavedTo:`; it is saved to the alias table.`,nameMatching:`Name matching`,view:`View`,system:`System`,drawnFromTheCatalog:`Drawn from the catalog; rebuilt whenever it changes. Edits happen in draw.io and come back through the metarepo.`,generatedViews:`Generated views`,noSystemToDraw:`This view is drawn around one system, and the catalog has none yet: read a repo first, then come back.`,systemsFailed:e=>`The systems couldn't be listed: ${e}`,nothingToDrawThe:e=>`Nothing to draw: the catalog has nothing for the ${e} view.`,theCatalogIsEmpty:`The catalog is empty. Read a repo first: your assistant reads its code, and Atticus checks each fact against its line and draws the map.`,view2:e=>`${e} view`,mermaidSource:`Mermaid source`,nothingToDrawFor:`Nothing to draw for this view yet.`,mermaid:`Mermaid`,copied:`Copied`,copy:`Copy`,diagramsUnder:`Diagrams under `,areComparedWithThe:` are compared with the catalog on `,reconcile:`Reconcile`,diagramsInTheMetarepo:`Diagrams in the metarepo`,writeTheDrawIo:`Write the draw.io shape library with `,atticusDiagramLibraryFile:`atticus diagram library <file>`,andLoadItIn:` and load it in draw.io, or in the draw.io integration for IntelliJ or VS Code: boxes keep their catalog ids.`,catalogShapeLibrary:`Catalog shape library`,nothingPlannedYet:`Nothing planned yet.`,today:e=>`today ${e}`,target:e=>`target ${e}`,timelineOfPlanItems:(e,t,n)=>`Timeline of ${e} plan items from ${t}; today ${n}`,changesParties:(e,t,n)=>`${e} · ${t} changes · ${n} parties`,noInitiativesYet:`No initiatives yet. Start one from a guided journey with New initiative.`,startOneFromA:`Or in a terminal: `,atticusInitiativeNewTitle:`atticus initiative new "<title>" --journey new-feature`,initiatives:`Initiatives`,newInitiative:`New initiative`,newInitiativeTitle:`New initiative`,initiativeTitleLabel:`Title`,initiativeTitleHint:`Northwind Pay v3 migration`,initiativeIdLabel:`Id (from the title)`,journeyLabel:`Guided journey`,journeys:{"new-feature":`New feature`,"new-integration":`New integration`,"vendor-api-change":`Vendor API change`,"design-change":`Design change`,migration:`Migration`,"retire-system":`Retire a system`},releaseLabel:`Target release (optional)`,epicLabel:`Work-tracker epic (optional)`,startInitiative:`Start the initiative`,startingInitiative:`Starting…`,startedInitiative:e=>`Started ${e}. Plan it next: name the system it is about.`,initiativeStates:{"not-planned":`Not planned yet`,"on-track":`On track`,"at-risk":`At risk`,slipped:`Slipped`,done:`Done`,open:`Open`},noPlanYet:`No plan yet: name the system it is about below and press Plan it.`,changesToStart:`Changes to start`,noChangesYet:`No changes yet: planning it writes the changes to start.`,notStartedYet:`not started yet`,cancel:`Cancel`,planTitle:`Plan its changes and commitments`,planSay:`Atticus works back from the release through the journey's steps, with each team's and vendor's lead times, and writes the changes to start and who owes what.`,targetLabel:`System it is about`,targetHint:`northwind-pay`,planReleaseLabel:`Target release`,systemsLabel:`Other systems it touches (optional, comma-separated)`,plan:`Plan it`,replan:`Plan it again`,planning:`Planning…`,planned:`Planned. The changes to start, the plan items and who owes what are on this page.`,setCommitment:e=>`Record where "${e}" stands`,commitmentStateLabel:`State`,commitmentStates:{open:`Open`,"at-risk":`At risk`,done:`Done`,slipped:`Slipped`},noteLabel:`Note (optional): what changed, who said so`,recordState:`Record it`,recording:`Recording…`,recorded:(e,t)=>`Recorded: ${e} is ${t}.`,lastNote:(e,t,n)=>`“${e}” (${t}, ${n.slice(0,10)})`,update:`Update`,orCommand:`Or: `,commitCommand:e=>`atticus initiative commit ${e} <open|at-risk|done|slipped>`,criticalPath:`Critical path`,planItems:`Plan items`,forecast:e=>` · forecast ${e}`,target2:(e,t)=>`Target ${e}${t}`,timeline:`Timeline`,noCommitmentsYet:`No commitments yet.`,commitments:`Commitments`,whoOwesWhat:`Who owes what`},know:{decided:e=>`Decided: ${e}.`,started:e=>`${e} started.`,verifiedFromCode:`verified from code`,fromDocumentsOnly:`from documents only`,coverageBySystemAnd2:`Coverage by system and area`,component:`Component`,record:`Record`,kind:`Kind`,why:`Why`,owner:`Owner`,confirmedByPeople:`Confirmed by people`,foundInCodeOnly:`Found in code only`,unknown2:`Unknown`,code:`Code`,pattern:`Pattern`,interaction:`Interaction`,route:`Route`,target:`Target`,term:`Term`,definition:`Definition`,file:`File`,readAs:`Read as`,about:`About`,facts:`Facts`,status:`Status`,sync:`Sync`,scan2:`Scan`,repo:`Repo`,platform:`Platform`,type:`Type`,baseClone:`Base clone`,guideTo:e=>`Guide to ${e}`,guide:e=>`Guide · ${e}`,generatedFromTheCatalog:`Generated from the catalog`,theCatalogIsEmpty:`The catalog is empty. Read a repo first: your assistant reads its code, and Atticus checks each fact against its line and draws the map.`,around:e=>`Around ${e}`,ecosystemMap:`Ecosystem map`,showAll:`Show all`,clickANodeTo:`Click a node to centre it`,gaps:e=>` · ${e} gaps`,verified:(e,t,n)=>`${e}/${t} verified${n}`,factsVerifiedFromCode:e=>`${e}: facts verified from code`,noSystemsYet:`No systems yet.`,systems:`Systems`,coverageBySystemAnd:`Coverage by system and area`,notExpected:`not expected`,notExpected2:(e,t)=>`${e} · ${t}: not expected`,whatTheCatalogKnows:`What the catalog knows`,factsByRepo:{intro:`No System record says more yet, so this is what each repo's verified facts say. Map › Trust says how far to trust them.`,caption:`Facts by repo`,repo:`Repo`,entries:`Entries`,tables:`Tables`,calls:`Calls`,flows:`Flows`,none:`No repo has facts yet: read one first, and its facts are counted here.`,cantRead:e=>`${e}'s facts couldn't be read.`},ask:e=>` · ask ${e}`,ownerUnknown:` · owner unknown`,questionsForOwners:`Questions for owners`,noOpenQuestionsEvery:`No open questions: every gap has an answer.`,recordId:`Record id`,aComponentInterfaceTable:`A component, interface, table, column or topic id, e.g. ledger-db.account`,showImpact:`Show impact`,incidentModeOn:`Incident mode on`,incidentMode:`Incident mode`,findAnIdIn:`Find an id in the Knowledge explorer`,whatBreaksIfThis:`What breaks if this changes`,noOwnerRecordedFor:e=>`No owner recorded for ${e}.`,fromTheLastScan:`From the catalog. Atticus never connects to live systems, consoles or monitoring.`,ownersToCall:`Owners to call`,noAlertsDashboardsOr:`No alerts, dashboards or runbooks in the catalog for what it reaches.`,whatWatchesIt:`What watches it`,noChangeTouchesWhat:`No change touches what it reaches.`,recentNearbyChanges:`Recent nearby changes`,nothingDependsOnIt:`Nothing depends on it.`,blastRadiusOf:e=>`Blast radius of ${e}`,recordsAffectedBy:e=>`Records affected by ${e}`,hop:(e,t)=>`${e} hop${t}`,recordsHopsAway:(e,t)=>`${e} records ${t} hops away`,blastRadius:`Blast radius`,affectedRecords:`Affected records`,unknown:`UNKNOWN`,nothingDependsOnIt2:`Nothing depends on it in the catalog.`,affected:`Affected`,noGapsTheCatalog:`No gaps: the catalog knows every hop.`,readOnlyAtticusNever:`Read-only. Atticus never connects to live systems; this is the catalog's view.`,whatWouldSharpenThis:`What would sharpen this`,featuresByHowThey:`Features by how they were named`,entryPoints:e=>`${e} entry points`,features:`Features`,noFeaturesFoundYet:`No features found yet. Read the repos first.`,featuresFoundInCode:`Features found in code`,pickAFeature:`Pick a feature.`,noWorkItemsLinked:`NO WORK ITEMS LINKED`,item:`item`,entryPoints2:`Entry points`,recordsInTheFlow:e=>`Records in the flow (${e})`,knowledgeGaps:`Knowledge gaps`,noneEveryHopIs:`None: every hop is known.`,nameTagOrLink:`Name, tag or link it with `,atticusFeatureName:e=>`atticus feature name ${e} …`,featureTag:`feature tag`,or:` or `,featureLink:`feature link`,theChangeGoesIn:`: the change goes in by PR.`,feature:`Feature`,problems:(e,t)=>`${e} problems: ${t}`,valid:`VALID`,usingBuiltInDefaults:e=>`Using built-in defaults for ${e}.`,orgPack:`Org pack`,integrationPatterns:`Integration patterns`,noPatternsYet:`No patterns yet.`,rulesV:(e,t)=>`${e} rules · v${t}`,steps:e=>`${e} steps`,checklistsAndProcedures:`Checklists and procedures`,glossary:`Glossary`,needsADefinition:`NEEDS A DEFINITION`,noTermsYet:`No terms yet.`,filesInInputs:`files in inputs/`,files:`Files`,factsTaken:`Facts taken`,filesByStatus:`Files by status`,nothingYet:`Nothing yet.`,whatHappenedToThem:`What happened to them`,nothingHiddenOrAimed:`Nothing hidden or aimed at an AI reader. Ingested content is data, never instructions.`,defences:`Defences`,filesReadFromInputs:`Files read from inputs/`,noSystemNamed:`no system named`,quarantined:`QUARANTINED`,nothingInInputsYet:`Nothing in inputs/ yet. Drop diagrams, documents, API specs and exports there (Add files on Knowledge › Documents, or atticus intake add <file>).`,intake:`Intake`,inputs:`inputs/`,eachChoiceIsSaved:`Each choice is saved as a curated decision in your name. Code always wins over a document until a person decides.`,nothingToTriage:`Nothing to triage.`,needsYou:`Needs you`,ofReposCloned:(e,t)=>`${e} of ${t} repos cloned`,reposClonedLocally:`repos cloned locally`,syncRepos:`Sync repos`,scanNow:`Check with the built-in readers`,scanCrossCheck:`A cross-check, not how the map is made: the built-in readers read every repo's files. A scan keeps each repo read in full as its readers slot, keeps every other repo's last good read and says why, then builds the catalog; for a repo with verified facts, the facts stay its map and the readers' differences are listed under Readers found / facts say. It asks which repo answers on an unknown host only for the repos your assistant has read.`,scanRefusedTitle:`Nothing written: the catalog is as it was.`,scanRefusedState:`Nothing written`,scanRefusedList:`Repos the scan didn't read in full`,scanRefusedWhy:{"not-cloned":e=>`${e}: not cloned here. Sync repos, then check again.`,unreadable:e=>`${e}: its clone can't be read. Sync repos to clone it again.`,"not-asked":e=>`${e}: left out of this scan, and a scan of some repos would replace the catalog with them alone.`},scanRefusedRun:(e,t)=>`${e}: ${t}, so its read is short of what that run reads.`,scanRefusedRunOne:(e,t)=>`the run of ${e} failed (${t})`,scanRefusedEmpty:e=>`The scan found no records in any repo's code, and the catalog has ${e}.`,scanRefusedTodo:`Sync repos, then check again, or put one repo's read in the catalog from its facts: atticus verify <repo> --write (Map › Trust). A failed reader run is in the Console.`,scanAskAll:`Also ask about the repos your assistant hasn't read`,scanAdded:(e,t,n,r)=>`The built-in readers added ${e} ${e===1?`record`:`records`}, changed ${t} and removed ${n}. ${r===1?`1 host question is`:`${r} host questions are`} open.`,readAgain:`Read again with your assistant`,readAgainWhere:`Your assistant reads each repo and cites its facts: on Map › Trust.`,jobProgress:`Job progress`,jobState:{queued:`Waiting to start`,running:`Running`,done:`Done`,failed:`It stopped with problems`,cancelled:`Cancelled: it stopped before writing anything more`},cancelJob:`Cancel`,cancelling:`Stopping…`,cancelJobHint:`Stops at the next repo; what was already written stays.`,jobProblems:`What went wrong`,scansReadFilesOnly:`Scans read files only: no network, no AI.`,scan:`Scan`,repos:`Repos`,cloned:`CLONED`,notYet:`NOT YET`,noReposInAny:`No repos in any manifest yet.`,noFactsYet:`No facts yet.`,catalog:`Catalog`},phase:{runPrepared:e=>`Run ${e} prepared: your assistant takes it from here.`,openTheRun:`Open the run: its prompt, Done and Cancel`,waitsForTasks:e=>`Waits for ${e}`,sameRepo:e=>`${e} (same repo)`,theRuleChecksRan:`The rule checks ran; any AI review is with your assistant. Each waits in Model runs, where Done checks its answer.`,theRuleChecksRan2:`The rule checks ran. AI is off here, so no AI review waits.`,handOffPrRaised:`Hand-off raised. A person approves and merges its PR on the Git host (on a manual Git host, its step on Home says how to open it).`,blockedBy:e=>`${e} thing${e===1?``:`s`} block${e===1?`s`:``} the hand-off; clear them first.`,syncedWithTheHand:`Synced with the hand-off PR.`,sourceField:`Source field`,targetField:`Target field`,rule:`Rule`,whenMissingOrInvalid:`When missing or invalid`,transform:`Transform`,record:`Record`,theStoryWritersPrompt:`The story writer's prompt is ready for your assistant.`,requirement:`Requirement`,story2:`Story`,test:`Test`,code:`Code`,gap:`Gap`,what:`What`,handOff:(e,t)=>` · hand-off ${e} ${t}`,approvalMerge:`Approval: merge `,pr:e=>`PR #${e}`,onTheGitHost:` on the Git host; that approves the gate.`,approvalRaiseTheHand:`Approval: raise the hand-off; merging its PR approves the gate.`,runTheCritic:`Run the critic`,runTheRuleChecks:`Run the rule checks`,raiseHandOff:`Raise hand-off`,syncAndMergeWhen:`Sync and merge when approved`,gate:`Gate`,notWrittenYetEdit:`Not written yet. Edit writes it, or your assistant drafts it with the change's other files:`,notWrittenYetFor:`Not written yet for this change. It is drafted when the change reaches this phase, or by its agent.`,noSuchArtifact:e=>`This change has no ${e}. Atticus 2 writes a change's brief, design, stories and tasks in its stages instead: see Feature design, Architecture and Stories.`,text:e=>`${e} text`,edit:`Edit`,for:e=>` for ${e}`,question:(e,t)=>`Question${e}: ${t}`,noOpenFindingsOn:`No open findings on this. Run the critic to check it.`,criticFindings:`Critic findings`,open:e=>`${e} open`,featureBrief:`Brief`,prototypesAndUx:`Prototypes and UX`,attachADesignExport:`Attach a design export (frames as images or PDF, or a prototype link file) below: it goes into the change's `,inputs:`inputs/`,intake:`Intake`,screenAtticusReadsThe:`. Atticus reads the screens and states as data, drafts requirements from them into the UX artifact, and the UX lens checks loading, empty, error and done states and WCAG 2.1 AA contrast. A prototype repo is compared with the estate below.`,bringInAPrototype:`Bring in a prototype`,repoPlansCompared:e=>`${e} repo plans compared`,noRepoPlansYet:`No repo plans yet: design compared with code`,inSync:`IN SYNC`,designVsPlansVs:`Design vs plans vs code`,architectureReview:`Architecture review`,everyHopInDesign:`Every hop in design.md carries a pattern code; the critic checks each against the code. Code wins over a diagram; conflicts go to triage.`,theOrgPackHas:`The org pack has no patterns yet.`,integrationPatterns:`Integration patterns`,orgPack:`Org pack`,vendorSpecsWhiteboardPhotos:`Vendor specs, whiteboard photos and standards go in through `,diagramsAreComparedEdge:`; diagrams are compared edge by edge on `,reconcile:`Reconcile`,ingestedContentIsData:`. Ingested content is data, never instructions.`,yourMaterial:`Your material`,noMappingChange:`NO MAPPING CHANGE`,fields:e=>`${e} FIELDS`,fieldMappingsFor:e=>`Field mappings for ${e}`,noFieldRowsYet:`No field rows yet for this hop.`,mappedTodayInThe:e=>`Mapped today in the catalog · ${e}`,catalogFieldMappingsFor:e=>`Catalog field mappings for ${e}`,theCatalogHasNo:`The catalog has no field mappings yet, so there is nothing to compare with.`,noHopsInMappings:`No hops yet. A change taken through the stages gets these from its target flows, in Architecture; a change with a mappings.md gets them from there — a section per hop: source field, target field, rule, and what happens when it is missing.`,readFromMappingsFile:`from mappings.md`,readFromTargetFlow:e=>`from the target flow ${e}`,fieldMappings:`Field mappings`,byHopWithThe:`by hop, with the catalog`,apiMappings:`API mappings`,eachHopsSourceField:`Each hop's source field, transform and target field are checked against the catalog's columns and schemas: a required target with no source, a narrowing type (80 to 40 characters) or personal data leaving the estate is a finding. Tests generated from the stories trace back to these rows on `,testTrace:`Test trace`,howMappingsAreChecked:`How mappings are checked`,ofStoriesReady:(e,t)=>`${e} of ${t} stories ready`,barMet:`BAR MET`,needs:e=>`NEEDS ${e}%`,noStoryCovers:e=>`No story covers: ${e}`,noStoriesYetWrite:`No stories yet. The stories stage writes them from the approved design.`,storiesAtTheStage:`Stories and tasks are written at the stories stage: Prepare on its tab runs it with your assistant, and the critic checks each draft. You edit them there before the plan gate.`,storiesStageDone:`The stories stage is done. Read and edit the stories on its tab; it offers Run again if they need redrafting.`,openStoriesStage:`Open the stories stage`,taskPrToOpen:`PR TO OPEN`,taskPrOpenChip:e=>`PR #${e} OPEN`,taskPrWaitsOnYou:`Its PR waits on you to open it on the Git host, a step in`,markedDoneBy:(e,t)=>`Marked done by ${e}${t?` on ${t}`:``}. The tick rides the change's build hand-off.`,markedNotDoneBy:(e,t)=>`Marked not done by ${e}${t?` on ${t}`:``}.`,noCodeYet:`NO CODE YET`,noCodeYetWhy:`No task has run yet, so there is no code to compare with the design and plans.`,storyBar:`Story bar`,theStoryWriterDrafts:`The story writer drafts stories, acceptance criteria and repo tasks from the approved design. You edit them before the plan gate.`,writeStoriesWithAi:`Write stories with AI`,storiesAndTasks:`Stories and tasks`,breakdown:`Breakdown`,done:(e,t)=>`${e}/${t} done`,ofTasksDone:(e,t,n)=>`${e}: ${t} of ${n} tasks done`,done2:`DONE`,runWithAi:`Run with AI`,byHand:`BY HAND`,story:e=>` · story ${e}`,noTasksYetThey:`No tasks yet: they come from tasks.md once the stories are written.`,handDownPreview:`Hand-down preview`,tasksByRepo:`Tasks by repo`,tasks:e=>`${e} tasks`,ofRunsFinished:(e,t)=>`${e} of ${t} runs finished`,everyWriteIsApproved:`Every write is approved by a person; AI never pushes to protected branches.`,noRunsYet:`No runs yet.`,aiTaskRuns:`AI task runs`,noTaskRunsYet:`No task has run with AI yet: Run with AI on a task starts one.`,taskState:{built:`DRAFTED`,unverified:`UNVERIFIED`,"pr-open":`PR RAISED`,waiting:`WITH YOUR ASSISTANT`,"needs-person":`NEEDS A PERSON`,failed:`STOPPED`,planned:`PLANNED`},taskBuilt:(e,t)=>`Drafted and built: committed on ${e} (${t.slice(0,7)}). Its PR is the next step.`,taskUnverified:(e,t,n)=>`Drafted and committed on ${t}, but ${e} has no build command, so nothing was built or tested. Atticus opens a task's PR only after a passing build: set ${e}'s build command on Set up › Repos, then Build and raise PR here; or push ${t} and open its PR into ${n} yourself.`,taskUnverifiedBuildable:(e,t)=>`Drafted and committed on ${t}, not built yet. ${e} has a build command now: Build and raise PR builds it and, on your yes, raises its PR. Run again drafts it afresh.`,taskNeedsPersonBuild:e=>`Once your fix is committed on ${e}, Build and raise PR builds it and raises its PR.`,handoffUnpushed:e=>`The hand-off's branch ${e} is here but wasn't pushed, so its PR has no files on the Git host yet.`,pushAgain:`Push again`,pushingAgain:`Pushing…`,pushAgainWhy:`Your click is your approval to push the branch (never forced).`,handoffPushed:e=>`Pushed ${e}.`,buildAndRaise:`Build and raise PR`,buildingTask:`Building…`,buildAndRaiseWhy:`Builds the task where it was drafted; your click is your approval to push its branch and open its PR once the build passes.`,taskBuiltAndRaised:e=>`Task ${e} is built and its PR is raised into the change branch. A person reviews and merges it on the Git host.`,taskBuiltOnly:e=>`Task ${e} is built. Its PR is the next step: Raise the task's PR.`,taskUnmerged:(e,t,n)=>`Its branch ${e} has ${t===1?`a commit`:`${t} commits`} not in ${n}, so its code isn't in the change yet: raise its PR and merge it. Build ready and the release wait for that.`,taskDecided:(e,t,n)=>`${e} let its work go on ${t}: "${n}"`,markDoneAnyway:`Mark done anyway`,markDoneReason:`Why isn't its work needed?`,markDoneReasonHelp:`Recorded with your name. Build ready and the release then go without this task's commits.`,markDoneNeedsReason:`Say why its work isn't needed first.`,taskWaiting:`Your assistant has it: Done on its run checks the work.`,taskPrOpen:`Its PR is open:`,taskPrStateChip:{merged:`PR MERGED`,closed:`PR CLOSED`},taskPrMerged:`Its PR is merged into the change branch. Mark the task done, or Run with AI again to start it over:`,tickTask:`Mark done`,untickTask:`Mark not done`,tickTaskLabel:e=>`Mark task ${e} done`,untickTaskLabel:e=>`Mark task ${e} not done`,tickedTask:e=>`Ticked task ${e} in tasks.md. The tick rides the change's build hand-off.`,untickedTask:e=>`Unticked task ${e} in tasks.md. That rides the change's build hand-off too.`,tickedByMerge:`Atticus ticked it in tasks.md when its PR merged on the Git host. The tick rides the change's build hand-off.`,taskPrClosed:`Its PR was closed without merging. Run with AI again to start the task over, or do it by hand:`,taskPrNumber:e=>`PR #${e}`,raiseTaskPr:`Raise the task's PR`,raisingTaskPr:`Raising the PR…`,raiseTaskPrWhy:`Your click is your approval to push the task's branch and open its PR.`,taskPrNotRaised:`Its PR wasn't raised. The build still passes: raise it again once this is fixed.`,taskPrRaised:e=>`Task ${e}'s PR is raised into the change branch. A person reviews and merges it on the Git host.`,taskPrManual:e=>`Task ${e}'s PR is a step for you now: open it on the Git host, then record its link.`,openItsRun:`Open its run`,runAgainWithAi:`Run with AI again`,manualPrWaits:`Opening this PR is a step waiting on you, in`,manualSteps:`Home › Manual steps`,handOffWaitsManual:e=>`The ${e} hand-off's PR isn't open yet: your Git host is manual, so opening it is a step waiting on you. Open it on the Git host as its step says and record its link there; once it is merged on the Git host, record that on its reviews step. Atticus syncs the change each time you mark one done, and merging approves the gate.`,handOffManual:e=>` · hand-off ${e} waits on a manual step`,taskBoard:`Task board`,tasksInCrossRepo:`Tasks in cross-repo order. The tech lead or architect runs the tasks: Run all ready tasks runs every task whose dependencies are done, and Run with AI runs one. Atticus hands the Spec Kit feature down to the repo, prepares the prompt for your assistant and reads the result back at the PR.`,everyRequirementShouldReach:`Every requirement should reach a story, a test, code and a release. Gaps are flagged before QA sign-off.`,requirementToCode:`Requirement to code`,noRequirement:`NO REQUIREMENT`,noStory:`NO STORY`,noTest:`NO TEST`,nothingToTraceYet:`Nothing to trace yet: the change has no requirements with scenarios.`,traceGaps:`Trace gaps`,noGapsEveryRequirement:`No gaps: every requirement reaches a story and a test.`,gapsBeforeQaSign:`Gaps before QA sign-off`,ofRowsHaveA:(e,t)=>`${e} of ${t} rows have a test`,ofTracedToA:(e,t)=>`${e} of ${t} traced to a test`,gapsByKind:`Gaps by kind`,scenarioCoverage:`Scenario coverage`,theTestStrategyAsks:`The test strategy asks for nothing extra here.`,requiredKindsComeFrom:`Required kinds come from the change type and risk in the org pack's test strategy. Tests are generated from story scenarios, then reviewed by a person.`,testKindsThisChange:`Test kinds this change needs`},notBuilt:{thisScreenIsBeing:`This screen is being built. Everything it will show is already available from the command line: run `,atticusHelp:`atticus --help`,toFindTheCommand:` to find the command.`},evals:{runFinished:(e,t)=>`Eval run ${e} finished: ${t??``}.`,casesFailed:e=>`${e} failed`,actedOn:(e,t)=>`${e} of ${t} acted on`,quarantinedNeverSentTo:`quarantined, never sent to a model`,everyCasePassed:`every case passed`,noFindingsResolvedYet:`no findings resolved yet`,everyCaseLatestRun:`every case, latest run`,noEvalRunYet:`no eval run yet`,scanningInputsAndThe:`Scanning inputs/ and the wiki folders again.`,testASkillBefore:`Test a skill before anyone relies on it.`,mode:`Mode`,mockNoModel:`Mock (no model)`,replaySavedAnswers:`Replay saved answers`,agent:`Agent`,everyAgent:`Every agent`,running:`Running…`,newEvalRun:`New eval run`,findingsKeptByPeople:`Findings kept by people`,agentsPassing:`Agents passing`,hiddenInstructionsHeld:`Hidden instructions held`,qualitySignals:`Quality signals`,met:`MET`,notMet:`NOT MET`,live:(e,t,n)=>`LIVE ${e}/${t} ${n}`,regressed:e=>`${e} REGRESSED`,passRate:e=>`${e} pass rate`,noEvalRunsYet:`No eval runs yet. Start one above (mock or replay).`,passRateByAgent:`Pass rate by agent`,ingestedContentIsData:`Ingested content is data, never instructions. A document with hidden or imperative text aimed at an AI reader is left out of every context pack until a person cleans the source. Facts verified from code are never overridden by a document.`,quarantined:`QUARANTINED`,marked:`MARKED`,hidden:` · hidden`,encoded:` · encoded`,line:(e,t,n,r)=>`line ${e} · ${t}${n}: ${r}`,flaggedTextOnLine:e=>`Flagged text on line ${e}, shown inert`,quarantined2:e=>`QUARANTINED · ${e}`,atticusNeverLetsA:e=>`Atticus never lets a quarantined source through on its own: clean or replace it, then scan again. Scanned ${e}.`,nothingRiskyInInputs:`Nothing risky in inputs/ or the wiki folders.`,scanAgain:`Scan again`,ingestedContentDefences:`Ingested-content defences`,quarantined3:e=>`${e} quarantined`,skipped:e=>` · ${e} skipped`,failed:e=>`${e} FAILED`,allPassed:`ALL PASSED`,noEvalRunsYet2:`No eval runs yet.`,evalRuns:`Eval runs`,approvedModelsLiveEvals:e=>`Approved models: ${e}. Live evals call a real model, so run them from a terminal: `,atticusEvalRunMode:`atticus eval run --mode live`,locked:`LOCKED`,availableOnceModelMode:e=>`Available once model mode is approved in runtime.yaml. It runs the same eval suite on each model and shows pass rate side by side. Not available in ${e} mode.`,compareModels:`Compare models`},governance:{allInTheExplorer:e=>`All ${e} in the explorer`,governance:`Governance`,theOrgPackConforms:`The org pack conforms.`,someRulesNeedA:`Some rules need a decision.`,fromTheFilesAnd:`From the files and the last scan`,ofConformanceChecksPass:(e,t)=>`${e} of ${t} conformance checks pass`,ofChecksPass:(e,t,n)=>`${e} of ${t} checks pass${n}.`,conformance:`Conformance`,orgPackChecks:`org pack checks`,constitutionRules:`Constitution rules`,locked:`LOCKED`,orgPackRules:`Org-pack rules`,teamRules:`Team rules`,activeWaivers:`Active waivers`,constitutionRulesCantBe:(e,t)=>`Constitution rules can't be waived or loosened. ${e} rules are in force; ${t} of them can be waived, each with a reason.`,refused:(e,t,n)=>`Refused ${e}${t}: ${n}`,rulesAndWaivers:`Rules and waivers`,rule:`Rule`,findings:`Findings`,dismissed:`Dismissed`,waived:`Waived`,overridden:`Overridden`,overridden2:e=>`${e} overridden`,acrossARuleDismissed:e=>`Across ${e}. A rule dismissed again and again is a candidate for a checklist change, reviewed in a PR.`,noCriticFindingsYet:`No critic findings yet, so nothing to measure.`,howOftenRulesAre:`How often rules are overridden`,by:(e,t)=>` · by ${e} ${t}`,reason:e=>`Reason: ${e}`,noActiveWaivers:`No active waivers.`,waivers:`Waivers`,sensitiveData:`Sensitive data`,columnsTaggedWithA:`Columns tagged with a data classification, and so where tagged fields live.`,noColumnsAreTagged:`No columns are tagged yet. Tag sensitive fields as curated decisions so their flows show here.`,authenticationGaps:`Authentication gaps`,callsWithNoOauth2:`Calls with no OAuth2, mTLS or API key declared in code or config.`,everyCallDeclaresHow:`Every call declares how it authenticates.`,timeoutsAndRetries:`Timeouts and retries`,timeoutAndRetrySettings:`Timeout and retry settings, to compare a caller's patience with what it calls.`,noTimeoutOrRetry:`No timeout or retry settings were found in code or config.`,retiring:`Retiring`,recordsPlannedForRetirement:`Records planned for retirement; check who still depends on them.`,nothingIsPlannedFor:`Nothing is planned for retirement.`,readOnlyBlastRadius:`Read-only blast radius from the catalog. Atticus never connects to live systems, consoles or monitoring. `,openTheImpactExplorer:`Open the impact explorer`,incidentMode:`Incident mode`},learning:{lessonWord:`lesson`,stepWord:`step`,newChip:`NEW`,doneChip:`DONE`,notYet:(e,t)=>`Not yet: ${e}\nHint: ${t}`,notYetNoHint:e=>`Not yet: ${e}`,passed:e=>`Passed: ${e}`,sandboxMade:e=>`Made a practice sandbox. Start the app there with: atticus ui --root ${e}`,inProgress:`IN PROGRESS`,everyone:`Everyone`,youHaveFinishedThis:`You have finished this lesson.`,stepOf:(e,t)=>`Step ${e} of ${t}`,tryInTheSandbox:`Try in the sandbox`,copy:e=>`Copy ${e}`,checkMyWork:`Check my work`,hideTheHint:`Hide the hint`,showAHint:`Show a hint`,hint:e=>`Hint: ${e}`,lessonsRunOnlyIn:`Lessons run only in a practice sandbox: a throwaway copy of the invented Forge estate. No network, no real systems, no real data. This metarepo isn't one, so lessons are read-only here.`,aNewEmptyFolder:`A new, empty folder for the sandbox`,homeYouAtticusSandbox:`a new empty folder, full path (or ~/atticus-sandbox)`,makeASandbox:`Make a sandbox`,learning:`Learning`,practiceSandboxOfflineForge:`PRACTICE SANDBOX · OFFLINE FORGE`,notASandbox:`NOT A SANDBOX`,lessonsBuiltOnThe:`Lessons built on the Forge estate, with a sandbox to practise in. Nothing here touches a real system.`,ofLessonsDone:(e,t)=>`${e} of ${t} lessons done`,ofDone:(e,t)=>`${e} of ${t} done.`,progress:`Progress`,lessonsDone:e=>`${e} lessons done`,noLessonsAreInstalled:`No lessons are installed.`,progressByKindOf:`Progress by kind of work`,lessonsDone2:`lessons done`,practiseInASandbox:`Practise in a sandbox`,exercise:e=>`Exercise · ${e}`,done:`done`,writtenFor:`Written for`,min:(e,t,n)=>`${e} · ${t} min · ${n}`,continue:`Continue`,done2:`Done`,start:`Start`,lessonsRunInA:`Lessons run in a practice sandbox`,noLessonsWrittenFor:`No lessons written for this kind of work.`,lessonsAndExercisesUse:`Lessons and exercises use only the invented Forge ecosystem. A check passes from what the sandbox's files say, never from a model.`,lessons:`Lessons`},release:{releasedChipWord:`RELEASED`,openFindingsChip:e=>`${e} OPEN`,clearChip:`CLEAR`,mergedChip:`MERGED`,laterChip:`LATER`,openChip:`OPEN`,blockersChip:e=>`${e} BLOCKERS`,notFiledChip:e=>`${e} NOT FILED`,filedChip:e=>`${e} FILED`,fileWord:`file`,bytes:e=>`${e} B`,atGoNoGo:`AT GO / NO-GO`,postReleaseReview:`POST-RELEASE REVIEW`,noneNeeded:`NONE NEEDED`,knowledgeGap:`a fact to ask for`,approvedNotMerged:`APPROVED, NOT MERGED`,notRaised:`NOT RAISED`,goNoGoPr2:`Go / no-go PR opened. Reviewers decide on the Git host; merging it is the go.`,goNoGoManual:`Go / no-go raised as a step for you: open its PR on the Git host from Home › Manual steps, then record its link. Merging it is the go.`,waitsOnYouChip:`WAITS ON YOU`,syncedWithTheGit:`Synced with the Git host.`,archivedItsReposWere:`Archived. Its repos were rescanned.`,changes:`Changes`,noChangesInFlight:`No changes in flight.`,next:`Next`,type:e=>`TYPE ${e}`,risk:e=>`RISK ${e}`,requests:`Requests`,snowMdListsNo:`snow.md lists no service-desk request.`,ofFiled:(e,t)=>`${e} of ${t} filed.`,findings:`Findings`,blocking:(e,t)=>`${e} blocking, ${t}.`,goNoGoPr:`Go / no-go PR`,approvedBy:e=>`; approved by ${e}`,mergingIsTheGo:(e,t)=>`Merging ${e} is the go${t}.`,goNoGoIs:`Go / no-go is the release hand-off PR: merging it is the go.`,archiveGate:`Archive gate`,opensOnceReleasedMerged:`Opens once released, its release PRs merged and built, and its repos read again at the merged commit.`,gatesToGoLive:`Gates to go-live`,aPersonApprovesEvery:`A person approves every gate by merging its hand-off PR; the Git host decides who may approve, and the person who raised a PR can't be its only approver.`,askForGoNo:`Ask for go / no-go`,theChangeReachesGo:`The change reaches go / no-go after QA`,syncAndMergeWhen:`Sync and merge when approved`,readsThePrMerges:`Reads the PR; merges it as you once it is approved and the Git host's checks pass`,archive:`Archive`,archivesTheChangeAnd:`Archives the change and rescans its repos`,raiseReleasePrs:`Raise the release PRs`,raisesReleasePrs:`Opens one PR per code repo from the change branch into its default branch, as you; a person merges each on the Git host`,releasePrsRaised:`Release PRs raised. A person merges each on the Git host; Sync records it.`,releasePrsNotYet:`The release PRs are raised once the build is done (in QA or at go / no-go).`,releasePrs:`Release PRs`,releasePrsIntro:`Each code repo's change branch, with the task PRs merged into it, goes into the repo's default branch by one PR. Atticus raises none while a task's branch has commits the change branch hasn't, and says which task. Go / no-go is decided over these; Atticus never pushes to the default branch, and a person merges each on the Git host.`,noCodeRepos:`This change has no code repos (repos.yaml), so there is no release PR.`,releasePrCol:{repo:`Repo`,branch:`From`,pr:`Release PR`,build:`Checks`},releasePrsCaption:`Each code repo's release PR and its checks`,notRaisedYet:`Not raised yet`,prState:(e,t)=>`#${e} ${t.toUpperCase()}`,prToOpen:`Waits on you to open it, a step in`,nothingStopsThisChange:`Nothing stops this change right now.`,whatStopsIt:`What stops it`,theChangeMayBe:`The change may be archived.`,alsoTouchesAgreeAn:e=>`Also touches ${e}. Agree an order before release.`,overlap:`OVERLAP`,noOtherOpenChange:`No other open change touches the same things.`,conflictsWithOtherChanges:`Conflicts with other changes`,forTheApprovalBoard:`For the approval board or an audit: one Markdown document generated from the change folder (summary, every file with its sha-256, critic rounds and waivers, approvals, trace, requests and steps, drift and AI runs), each item with its source.`,kb:e=>`${e} KB`,evidenceFiles:`Evidence files`,theChangeFolderIs:`The change folder is empty.`,evidencePack:`Evidence pack`,pickAChangeOn:`Pick a change on the left. Changes reach go / no-go after QA.`,noChangeSelected:`No change selected`},releaseViews:{migrationChip:`MIGRATION`,topicChip:`TOPIC`,codeChip:`CODE`,stepWord:`step`,sensitiveSuffix:`, sensitive`,interfaceWord:`interface`,valueWord:`value`,fileWord:`file`,filedAs:e=>`filed${e?` as ${e}`:``}`,waitFor:(e,t)=>`${e}${t?` for ${t}`:``}`,readyBy:(e,t)=>`, ready by ${e} (${t})`,missing:e=>`. Missing ${e}`,evidenceSaved:(e,t)=>`Saved ${e}: the summary, ${t} with their sha-256, rounds, waivers, approvals, trace, requests, drift and AI runs.`,gatewayRoute:`GATEWAY ROUTE`,rollout:`Rollout`,rollback2:`Rollback`,readiness:`Readiness`,verification:`Verification`,hypercare:`Hypercare`,onTrack:`ON TRACK`,atRisk:`AT RISK`,noTarget:`NO TARGET`,releasedChip:`RELEASED`,lateChip:`LATE`,waitingForAPerson:`waiting for a person to file it`,notFiled:`not filed`,workingDay:`working day`,noLeadTimeTo:`, no lead time to forecast`,business:`Business`,technical:`Technical`,recorded:`Recorded.`,workedOutFromInterfaces:`Worked out from interfaces.md, data.md, stories.md and the catalog: a route before its caller, a topic before its publisher, a migration before the code that reads it, a callee before its caller.`,n0BeforeAnything:`0 · Before anything`,from:e=>` · from ${e}`,waitsOn:e=>`Waits on ${e}`,rollback:`Rollback`,deployOrder:`Deploy order`,beforeStep:e=>`, before step ${e}`,notPlaced:`Not placed`,criticReleaseLensStill:`Critic, release lens: still open`,nothingToDeployYet:`Nothing to deploy yet: interfaces.md, data.md, tasks.md and stories.md name no repo.`,deploymentPlan:`Deployment plan`,computed:`computed`,noDate:`No date`,released:`Released.`,readyToReleaseBy:e=>`Ready to release by this day at the earliest (${e} from today).`,target:(e,t)=>`Target ${e} (${t}).`,noTargetDateThe:`No target date: the change isn't part of an initiative with one.`,whatSetsTheDay:`What sets the day`,waitOnAService:e=>`; ${e} wait on a service request`,tasksOfDone:(e,t,n)=>`Tasks: ${e} of ${t} done${n}.`,forecast:`Forecast`,fromDatesNoEstimates:`from dates, no estimates`,rolloutReadinessAndHypercare:`Rollout, readiness and hypercare`,fromDesignMd:`from design.md`,signsOff:`Signs off`,copyTheSecurityReview:`Copy the security review draft`,interfacesMdListsNo:`interfaces.md lists no new or changed interfaces.`,newOrChangedInterfaces:`New or changed interfaces and their auth`,operation:`Operation`,callerCallee:`Caller → callee`,auth:`Auth`,crosses:`Crosses`,saidNowhere:`said nowhere`,no:`no`,dataFieldsTouched:`Data fields touched`,dataMdAddsNo:`data.md adds no fields.`,looksLikePersonalData:` (judged personal data)`,dataCrossingABoundary:`Data crossing a boundary`,noNewOrChanged:`No new or changed call crosses a system boundary.`,mappingsMdDoesntSay:`mappings.md doesn't say which fields it sends.`,vendorsSecretsAndFindings:`Vendors, secrets and findings`,aNewVendor:`a new vendor`,alreadyCalled:e=>`already called (${e})`,noVendorSecretOr:`No vendor, secret or open security finding.`,gapsForTheReviewer:`Gaps for the reviewer`,securityReviewDraft:`Security review draft`,fromTheCatalogAnd:`from the catalog and the change`,audience:`Audience`,copyTheReleaseNotes:`Copy the release notes`,releaseNotes:`Release notes`,generatedNoAi:`from the change folder; what breaks callers is judged`,measuredByOn:(e,t,n,r)=>`${e}, measured by ${t} on ${n}${r}`,notMeasuredYet:`Not measured yet.`,measured:`MEASURED`,open:`OPEN`,recordedButBriefMd:e=>`${e}: recorded, but brief.md no longer has this measure.`,measure:`Measure`,chooseAMeasure:`Choose a measure`,whatYouMeasured:`What you measured`,howOptional:`How (optional)`,as:e=>` as ${e}`,record:e=>`Record${e}`,recordAnOutcome:`Record an outcome`,briefMdHasNo:`brief.md has no "Success measures" section, so there is nothing to measure after release.`,outcomes:`Outcomes`,theBriefsSuccessMeasures:`the brief's success measures`,exportEvidencePack:`Export evidence pack`,evidenceMd:e=>`evidence-${e}.md`,copyEvidenceMd:e=>`Copy evidence-${e}.md`},serviceDesk:{requestWord:`request`,exportWord:`export`,filedChip:`FILED`,ofChange:e=>`Requests of ${e} only.`,showAll:`Show every change's`,filters:{all:e=>`All ${e}`,"to-file":e=>`To file ${e}`,waiting:e=>`Waiting ${e}`,filed:e=>`Filed ${e}`},toFile2:`TO FILE`,waitingForYou:`WAITING FOR YOU`,drafted:`Drafted.`,filedAsAStep:`Filed as a step.`,toFile3:`To file`,waitingForYou2:`Waiting for you`,filed:`Filed`,pastRequest:`past request`,requestTemplate:`request template`,draftTheRequestsA:`Draft the requests a change needs`,replaceASnowMd:`Replace a snow.md a person edited`,draftFromTheOrg:`Draft from the org pack's templates`,noChangesToDraft:`No changes to draft requests for.`,template:e=>`TEMPLATE ${e}`,noTemplateMatches:`NO TEMPLATE MATCHES`,leadTimeDays:e=>`Lead time ${e} days. `,noneNamed:`none named`,approversValuesComeFrom:(e,t)=>`${e}Approvers: ${t}. Values come from snow.md; fill a missing one below, or edit the file.`,fields:`Fields`,copyAllFields:`Copy all fields`,required:` · required`,missingFillItIn:`Missing: fill it below`,empty:`Empty`,copy:e=>`Copy ${e}`,atticusNeverCallsThe:`Atticus never calls the desk from here. Filing makes a step in To-do with every field ready to copy; you submit it in the desk and record the number.`,fileSCompleteDrafts:e=>`File ${e}'s complete drafts as steps`,fillFirst:e=>`Fill ${e} first`,fillInSnowMd:e=>`Fill ${e} above before filing.`,fillTitle:`Fill the missing fields`,fillHelp:e=>`Written into ${e}, as you would edit it: only these values change; its comments and other lines stay. If the file changed since this page read it, nothing is written.`,fillField:e=>`${e} (required)`,fillSave:`Save to snow.md`,fillSaving:`Saving…`,fillDone:`Saved to snow.md.`,fillSomething:`Type a value for at least one field first.`,fillPropose:`snow.md changed in your copy of the metarepo. Propose it for review so the team sees the values; filing stays the File button's.`,filedAsStep:`Filed as step `,submitItInThe:`. Submit it in the desk, then `,recordTheRequestNumber:`record the request number in To-do`,filedAs:e=>`Filed as ${e}`,open:`open`,serviceDeskQueue:`Service desk queue`,toFile:e=>`${e} to file.`,nothingToFile:`Nothing to file.`,show:`Show`,draftsOnlyYouFile:`Drafts only: you file them. Next: the `,releasePlan:`release plan`,requests:`Requests`,noDraftsYet:`No drafts yet.`,queue:`Queue`,writesFromTheApp:`Writes from the app become steps you perform. Reads come from an export you load into inputs/.`,from:(e,t)=>`${e} from ${t}.`,noDeskExportLoaded:`No desk export loaded yet.`,inTheOrgPack:(e,t)=>`${e} ${t} in the org pack.`,serviceDeskAdapter:`Service desk adapter`,approveEachWrite:e=>`${e} · APPROVE EACH WRITE`,noneAllowedHere:`NONE ALLOWED HERE`,calledThroughTheCommon:`Called through the common step spec from `,toDo:`To-do`,noCredentialsPassTo:`. No credentials pass to the tool. `,executorsAllowList:`Executors allow-list`,localAutomationTool:`Local automation tool`,toFill:e=>` · ${e} to fill`,noneInThisView:`None in this view.`,noServiceDeskDrafts:`No service-desk drafts. Draft them for a change below.`,pickARequestOn:`Pick a request on the left.`,noRequestSelected:`No request selected`,draftRequests:`Draft requests`},systems:{title:`Systems`,pick:`Which system`,empty:`No system in the catalog yet: read the repos first.`,openPage:`Open its page`,inFlight:`Changes in flight in its repos`,noChanges:`No change in flight touches its repos.`,questions:`Open questions about it`,noQuestions:`No open question about it.`,outside:`The systems outside the estate: vendors and other teams`},mismatches:{title:`Mismatches`,intro:`The payload on both sides of every link compared: each REST call, each hop through a gateway, each topic's publisher and listeners, and each call to an outside system, from the fields your assistant read and the specs on file. A difference that a mapping nobody traced touches is unconfirmed, never a mismatch. Read from the facts and the specs; nothing is written.`,empty:`No link has a payload on both sides yet. Your assistant records what each call sends and each entry takes when it reads a repo (/atticus-map); atticus verify <repo> --write reads the repo's specs; atticus intake add takes a vendor's or another team's.`,noneShown:`None of this kind: pick another in the list.`,noneAtAll:`No difference on any link compared.`,counts:(e,t,n,r)=>`${e} mismatch${e===1?``:`es`}, ${t} unconfirmed; ${r} of ${n} link${n===1?``:`s`} had a payload on both sides.`,unlinked:e=>`${e} call${e===1?` joins`:`s join`} nothing yet, so ${e===1?`its`:`their`} payload isn't checked: answer their questions on the Questions page, or re-read the repo (atticus map --all --stale).`,filter:`Show`,filters:{all:`Everything`,mismatch:`Mismatches`,unconfirmed:`Unconfirmed`},link:(e,t,n,r)=>`${e} ${t} → ${n}${r?` via ${r}`:``}`,cols:{kind:`What`,says:`Says`,sender:`One side`,receiver:`The other`},kinds:{"field-missing":`Read, never sent`,"field-extra":`Sent, not taken`,"field-not-sent":`Required, not sent`,"field-required":`Required on one side only`,"field-type":`Types differ`,"field-number":`Field number reused`,"error-unlisted":`Error not listed`,"error-unanswered":`Error never answered`},status:{mismatch:`Mismatch`,unconfirmed:`Unconfirmed`},via:e=>`Through ${e}`,specs:e=>`Specs read: ${e}`,notes:`Left out`,command:`atticus join contracts`,commandLabel:`Copy the command that prints this list`},outside:{noSuchSystem:e=>`No outside system of the profile is ${e}: pick one above, or add it in Map › Canvas (Add to the picture).`,title:`Outside systems`,contracts:`The calls against this spec`,contractsIntro:`Each call to this system compared with the operation or message its newest spec publishes. Marked new: what this spec brings that the one it replaced didn't.`,noContracts:`No call to it differs from its spec, or none says what it sends.`,newWithSpec:`New with this spec`,intro:`The systems no repo of the estate belongs to: vendors, and other teams' systems. For each, who calls it, the operations its spec publishes, the calls that match nothing in that spec, and the questions open about it. Read from the facts, the catalog and the specs in inputs/; nothing is written.`,pick:`Which outside system`,empty:`No outside system yet: the profiles name none that the estate's repos don't belong to. Add a vendor or another team's system to a profile's systems in the org pack.`,boundary:{vendor:`A vendor`,internal:`Another team's system`,product:`A product no estate repo belongs to`},owner:e=>`Owner: ${e}`,aliases:e=>`Also called ${e}`,callers:`Who calls it`,noCallers:`No call in the estate's facts reaches it yet. A call reaches it when it names it, uses one of its hosts, or a person's answer says so.`,callerCols:{from:`From`,call:`Call`,line:`Line`,operation:`Operation`,seen:`Seen in`},through:(e,t)=>`through ${e} ${t}`,seen:{interface:`the catalog`,join:`the estate join`,spec:`its spec`,shared:`their shared map`},noOperation:`—`,reachesMany:e=>`${e} operations, through a wildcard route:`,configNotes:`Check its configuration`,operations:`Its operations`,specFrom:(e,t,n)=>`From ${e}${t?`, ${t}`:``}${n?` ${n}`:``}`,opCols:{op:`Operation`,line:`Spec line`,calls:`Calls`},unmatched:`Calls that match nothing in its spec`,noUnmatched:`Every call to it matches an operation its spec publishes.`,ambiguous:`Calls two or more operations answer`,ambiguousOf:e=>`Could be ${e}`,noSpec:`No spec of it is in inputs/ yet, so its operations aren't known. Add one:`,noSpecWhy:`Then intake links it to this system by name (atticus triage asks when it can't tell), and this page lists its operations and the calls that match none.`,questions:`Open questions about it`,noQuestions:`No open question about it.`,answer:`Answer it`,copy:e=>`Copy: ${e}`,notes:`What the estate's facts left out`,shared:`Their shared map`,sharedFrom:(e,t,n)=>`${e}'s Atticus map, their commit ${t.slice(0,7)}, imported ${n.slice(0,10)}. Their entries stay theirs: Atticus never verifies, corrects or reports on them; a wrong one is theirs to fix in their own map.`,sharedCols:{entry:`Their entry`,repo:`Their repo`,line:`Their line`,calls:`Calls`},sharedUnmatched:`Calls their map has no entry for`,noSharedUnmatched:`Every call to it is answered by an entry of their map.`,noShared:`If the team that owns it runs Atticus, bring in their map, read-only, so calls to it join their entries:`,sharedImport:e=>`atticus join shared import <their metarepo> --team <their team id> --system ${e} --name "<their team's name>"`},brokenChanges:{title:e=>e===1?`1 change doesn't read`:`${e} changes don't read`,fileLine:(e,t)=>`${e}, line ${t}`,fix:`Fix the file (a merge's conflict markers, a line cut short, a field that isn't valid) and the change comes back on every page.`,problems:`Changes that don't read`,problemMeta:(e,t)=>`${e}: ${t}`},cockpit:{title:`This change at a glance`,where:`Where it is`,state:(e,t)=>`In ${e}, ${t} risk.`,stages:{feature:`Placement`,architecture:`Target flows`,stories:`Stories`},stageScreen:{feature:`feature-design`,architecture:`architecture`,stories:`stories`},marks:{done:`done`,current:`in progress`,todo:`to come`,person:`written by a person`,skipped:`skipped`},stage:(e,t)=>`${e}: ${t}`,progress:(e,t,n)=>[`${e} draft${e===1?``:`s`}`,`${t} critic round${t===1?``:`s`}`,...n?[`${n} question${n===1?``:`s`} to answer`]:[]].join(`, `),next:`What's next`,copySlash:`Copy the slash command`,copyCommand:`Copy the command`,writeBrief:`Write the brief on the Brief tab`,openArchitecture:`Open the Architecture tab`,blocks:`What blocks it`,questions:e=>`${e} question${e===1?` waits`:`s wait`} for a person`,repos:`Repos and branches`,noRepos:`No repo has a branch for this change yet.`,openWorkspace:e=>`Make the change's branch in ${e===1?`its repo`:`its ${e} repos`}`,workspaceOpened:`The change's branches are made in your clones.`,noReposToOpen:`No repo is named for this change yet, so there is no branch to make. The architecture stage names the repos in its target flows:`,raiseHeld:e=>`${e} thing${e===1?``:`s`} block${e===1?`s`:``} the hand-off, so Raise hand-off waits:`,raiseChecking:`Checking what blocks the hand-off…`,branchOn:(e,t)=>`${e}, from ${t}`,pr:`the pull request`,taskDrafted:e=>`Task ${e} is drafted: its PR is the step now. Raise it here or on the Task board.`,taskUnverified:e=>`Task ${e} is drafted but not built: its PR is the step now, and it waits on a build command (set it on Set up › Repos) or on you.`,taskPrRaised:e=>`Task ${e}'s PR is raised; a person reviews and merges it.`,taskWaiting:e=>`Task ${e} is with your assistant: Done on its run checks it.`,thenTask:e=>`Meanwhile, task ${e} is the first one not run yet:`,noOtherTask:`Every other task has run or is done.`,openTaskBoard:`Open the Task board`,raiseHere:`Raise it here: your click is your approval to open the hand-off PR.`,watch:`Watch this change`,unwatch:`Stop watching`,watched:`You watch it: your digest says how it is doing.`,unwatched:`You no longer watch it.`,like:{title:`Earlier changes like this one`,intro:`Archived changes whose brief is nearest this one's. One you pick is attached to this change as an example its steps read, as data.`,byWords:e=>`By shared words, since ${e}.`,none:`No archived change is near this one yet.`,archived:e=>`archived ${e}`,use:`Use as an example`,used:`Attached to this change (Files attached): its steps read it as an example.`}},repos:{yourAssistant:`Your assistant`,title:`Repos and their branches`,intro:`The catalog is read from each repo's default branch: that is the baseline, the one the hand-off PRs build on. Other branches people work on can be scanned beside it and compared with it, never merged into it.`,empty:`No repo is listed yet. Add them above: paste their clone URLs, or discover a folder of clones.`,typeOwner:(e,t)=>`${e} · ${t}`,about:`What it is`,noAbout:`Nothing says yet`,aboutHint:`One line: what it is for, who uses it. It goes into every reading prompt, the questions a join asks and these views, so a repo whose id says nothing can still be read and placed. Up to 300 characters.`,aboutWhy:`A person's note, not read from the code: where the two disagree, the facts read from the code are what counts.`,aboutBy:e=>`said by ${e}`,aboutDraft:`Unconfirmed draft`,aboutDraftWhy:e=>`${e} drafted this from what it read. Until a person confirms it, it is marked unconfirmed everywhere it is used.`,aboutCites:`Read from`,editAbout:`Say what it is`,editAboutDraft:`Confirm, change or drop`,acceptAbout:`Confirm it`,rejectAbout:`Drop it`,editAboutFor:e=>`Say what it is: ${e}`,editAboutDraftFor:e=>`Confirm, change or drop what ${e} is`,acceptAboutFor:e=>`Confirm it: what ${e} is`,rejectAboutFor:e=>`Drop it: what ${e} is`,aboutSaved:`Saved to the manifest: commit it in a pull request. Every reading prompt, question and view now says what this repo is.`,aboutDropped:`Dropped from the manifest: commit it in a pull request. Nothing says what this repo is now.`,aboutTooLong:e=>`One line, up to ${e} characters.`,aboutEmpty:`Say what it is, in one line, before saving.`,url:`URL`,defaultBranch:`Default branch`,atCommit:e=>`read at ${e}`,remoteSays:e=>`The remote's default is ${e}`,branches:`Other branches`,noBranches:`None listed`,branchesHint:`One a line, for example develop or release/2026.11. Each can be scanned beside the baseline.`,scanned:(e,t,n)=>`${e} scanned on ${t}, at ${n}`,scan:e=>`Scan ${e}`,scanStarted:e=>`Scanning ${e} beside the baseline: follow it on Scans.`,compare:(e,t)=>`Compare ${e} with ${t}`,comparedNow:`Compared.`,compared:(e,t,n,r)=>`${e} against the baseline: ${t} added, ${n} removed, ${r} changed.`,edit:`Edit branches`,editFor:e=>`Edit branches of ${e}`,build:`Build command`,noBuild:`None: a task drafted here isn't built or tested, so Atticus doesn't raise its PR. Set one here.`,buildHint:`One line, run in the repo's folder, for example ./gradlew test or npm ci && npm test. A task's PR is raised only after it passes.`,setBuild:`Set the build command`,changeBuild:`Change the build command`,setBuildFor:e=>`Set the build command for ${e}`,changeBuildFor:e=>`Change the build command for ${e}`,buildOneLine:`One line: join the steps with &&.`,buildSaved:`Saved to the manifest: propose it for review. Run the repo's drafted tasks again to build and test them.`,buildCleared:`Cleared from the manifest: propose it for review. The repo's tasks aren't built or tested now.`,save:`Save to the manifest`,saved:`Saved to the manifest: commit it in a pull request. Run atticus workspace sync if the default branch changed.`},aiSettings:{changedOnDisk:`runtime.yaml changed on disk while this form was open (another window, or the command line). Your edits are kept here; Save writes them over what is there, or take the file's values.`,takeDisk:`Take the file's values`,title:`How AI runs here`,intro:`Choose whether AI runs, which assistants your people use, and whether Atticus may call a model itself. Saving writes the org pack's runtime.yaml.`,aiLabel:`AI here`,ai:{on:`On: every AI step may run`,"text-only":`Text only: no step is given a picture`,off:`Off: no AI step runs; people write what agents would draft`},assistantsLabel:`Assistants your people use`,assistantsHint:`Atticus writes the slash commands, instructions and skills for each one ticked.`,defaultAssistant:`Default assistant`,modesLabel:`How a step runs`,modes:{"hand-off":`Hand-off: the person's own assistant does the step`,model:`Model: Atticus calls the provider below`,"headless-claude-code":`Headless Claude Code: Claude Code runs the step on this machine`,"copilot-acp":`Copilot, unattended: Atticus drives your own Copilot seat through its Agent Client Protocol (ADR 0171)`},defaultMode:`Default`,providerLabel:`Model provider`,noProvider:`None: AI steps hand off to the person's assistant`,providerHint:`Used when a step runs in model mode. A key never goes here: name the environment variable that holds it in keyEnv. For a provider Atticus has no built-in for, add a plugin: atticus plugin add vertex, or your own in org-pack/plugins/model-providers/.`,pluginProvider:(e,t)=>t?`${e} (plugin)`:`${e} (plugin, not pinned yet: atticus plugin pin ${e})`,keySet:e=>`${e} is set on this machine.`,keyNotSet:e=>`${e} isn't set on this machine: set it to the key before testing.`,keyLabel:e=>`The key for ${e}`,setKey:`Set the key on this machine`,keyKept:e=>`Kept ${e} in this machine's credential store. It never goes in runtime.yaml.`,save:`Save`,saved:e=>`Saved ${e}. Propose it for review: the org pack is reviewed like code.`,saveNote:e=>`Saving writes ${e}; then propose it for review.`,test:`Test the provider`,budgetsLabel:`Models and budgets`,modelsLabel:`Models allowed`,modelsHint:`One model id a line. Model mode refuses any other; empty allows any.`,defaultTokensLabel:`Tokens for a step`,perAgentLabel:`Tokens for an agent`,perAgentHint:`One a line, for example architect: 300000. Others get the tokens for a step.`,badDefaultTokens:`The tokens for a step must be a whole number above 0, such as 200000.`,badBudgetLine:e=>`"${e}" doesn't read as an agent and its tokens: write it as architect: 300000.`,answered:(e,t)=>`${e} answered in ${t} ms.`,notAnswered:e=>`It didn't answer: ${e}`,decideLabel:`AI decides first`,decideHint:`Auto: after a Copilot session Atticus runs, or a hand-off to your assistant you mark done, Atticus applies each AI decision that passes the citation check and the bar, shown as Detected by AI and never as anyone's word; a person corrects what is wrong. Propose: the AI only proposes, and a person accepts each one. The safety rules are not affected.`,decideLinks:`Pairings of calls to APIs`,decideQuestions:`Answers to option questions`,decideMode:{propose:`Propose for a person`,auto:`Decide (auto)`},minPrecisionLabel:`Pause below this audited precision (%)`,minPrecisionHint:`When the sample audit puts the AI's decisions below it, deciding pauses back to propose and Home says why.`,badMinPrecision:`The precision is a whole number of percent from 0 to 100, such as 95.`},upgrade:{title:`Upgrade this metarepo`,intro:e=>`This metarepo waits on ${e} upgrade step${e===1?``:`s`} for this Atticus. Upgrading backs up every file it changes under .atticus/backups/, runs each step and stamps the metarepo; then propose the changes for review.`,newer:(e,t)=>`A newer Atticus (${e}) upgraded this metarepo; this is ${t}. Install ${e} or later before working in it.`,step:(e,t)=>`${e} (${t} file${t===1?``:`s`})`,run:`Run the upgrade`,running:`Upgrading…`,done:`Upgraded. Propose the changed files for review.`,doneStampOnly:`Upgraded. Only the stamp that records this Atticus changed (.atticus/metarepo.yaml): propose the stamp so everyone's Atticus sees this upgrade.`,failed:`The upgrade stopped.`,terminal:`Or in a terminal:`},settings:{connectedChip:`CONNECTED`,manualChip:`MANUAL`,mockChip:`MOCK`,onChip:`ON`,offChip:`OFF`,defaultOf:e=>`(default ${e})`,autonomyLine:(e,t,n)=>`${e} by default; at most ${t} build-fix rounds${n?`; capped: ${n}`:``}`,handOff:`Hand-off`,yourOwnAssistantCopilot:`Your own assistant (Copilot or Claude Code) does the work. Atticus builds the context pack, watches the branch, then checks the result.`,model:`Model`,directModelAccessThrough:`Direct model access through an approved gateway. Unlocks draft-and-PR runs and model comparisons.`,headlessClaudeCode:`Headless Claude Code`,claudeCodeRunsA:`Claude Code runs a task on its own in the change's worktree; a person still approves every write.`,workTracker:`Work tracker`,serviceDesk:`Service desk`,gitHost:`Git host`,wiki:`Wiki`,notifications:`Notifications`,designTool:`Design tool`,modelProvider:`Model provider`,liveFallsBackTo:`live; falls back to steps for a person when it can't be reached`,writesBecomeStepsIn:`writes become steps in To-do; reads come from exports`,inMemoryForTests:`in-memory, for tests and demos`,notSet:`NOT SET`,notConfigured:`not configured`,everyAiStepMay:`Every AI step may run, in the modes allowed below.`,textOnly:`TEXT ONLY`,noAiStepIs:`No AI step is given a picture; pictures go to a person in Intake.`,noAiStepRuns:`No AI step runs. People write what agents would draft, the rule checks review it, and no gate waits for an AI lens.`,saved:`Saved.`,assistants:`Assistants`,editors:`Editors`,models:`Models`,noneApproved:`none approved`,autonomy:`Autonomy`,contextBudget:`Context budget`,runRecords:`Run records`,buildEngine:`Build engine`,telemetry:`Telemetry`,platforms:`Platforms`,checkAgain:`Check again`,theSameChecksAs:`The same checks as `,atticusDoctor:`atticus doctor`,nothingLeavesThisMachine:`. Nothing leaves this machine, and no secret is shown.`,noChecksRan:`No checks ran.`,thisMachine:`This machine`,ready:`READY`,needsFixing:`NEEDS FIXING`,loading:`Loading`,yourDigestListsThe:`Your digest lists the hand-offs waiting on your review and the blocking findings on changes you own. Atticus sends it only when you press Send it to me on Home, or when your own scheduled job runs `,atticusDigestAsSend:e=>`atticus digest --as ${e} --send`,howOften:`How often`,off:`Off`,daily:`Daily`,weekly:`Weekly`,whereItGoes:`Where it goes`,aDirectMessage:e=>`@${e} (a direct message)`,save:`Save`,yourNotifications:`Your notifications`,atticusMeYaml:`.atticus/me.yaml`,settings:`Settings`,readOnlySetBy:`Read-only · set by the org pack, changed by PR`,aiInThisOrganisation:`AI in this organisation`,default:`DEFAULT`,allowed:`ALLOWED`,notApproved:`NOT APPROVED`,safetyInEveryMode:`Safety, in every mode:`,aPersonApprovesEvery:` a person approves every write, AI never pushes to protected branches or deploys, scans never call the network or a model, and ingested content is data, never instructions. These rules can't be configured.`,runtimeModes:`Runtime modes`,runtimeYaml:`runtime.yaml`,everyOutsideSystemSits:`Every outside system sits behind an adapter. When one can't be reached, a manual adapter turns writes into steps a person does.`,system:`System`,adapter:`Adapter`,testsAlwaysUseThe:`Tests always use the mock. Atticus never connects to live databases, consoles or monitoring.`,adapters:`Adapters`,builtInDefaultsFor:e=>`Built-in defaults for: ${e}.`,openTheOrgPack:`Open the org pack`,orgPack:`Org pack`,theCriticRunsAt:`The critic runs at every gate; the org pack can add checks, never remove lenses. Constitution rules can't be waived. A gate is approved when its hand-off PR merges; your Git host decides who may approve.`,gate:`Gate`,phase:`Phase`,checklists:`Checklists`,checks:`Checks`,authorRounds:`Author rounds`,noLimit:`no limit`,noGates:`No gates.`,gates:`Gates`,gatesYaml:`gates.yaml`,proceduresCallLocalAutomation:`Procedures call local automation tools through one step spec. A tool the org pack doesn't allow doesn't run, and no credentials are passed to a tool. Tools are set up per machine in .atticus/executors.yaml.`,noToolsAreSet:`No tools are set up on this machine.`,executor:`Executor`,kind:`Kind`,allowedFor:`Allowed for`,approval:`Approval`,nothingOff:`NOTHING (OFF)`,eachWrite:`each write`,procedureAllowsWhichIsnt:(e,t)=>`Procedure ${e} allows ${t}, which isn't set up here.`,checkTheyAnswer:`Check they answer`,addingAToolTo:`Adding a tool to the allow-list is an org-pack PR that its owners review.`,executorsAllowList:`Executors allow-list`,setUp:e=>`${e} set up`},runShared:{workTracker:`Work tracker`,serviceDesk:`Service desk`,gitHost:`Git host`,wiki:`Wiki`,notifications:`Notifications`,designTool:`Design tool`,copied:`Copied`,selectAndCopy:`Select and copy`,copy:`Copy`,notSet:`NOT SET`,manual:`MANUAL`,mock:`MOCK`,connected:e=>`CONNECTED · ${e}`},todo:{stepWord:`step`,requestWord:`request`,executorDid:e=>`${e} did the step.`,recordedStep:e=>`Recorded step ${e}.`,recordedAndSynced:(e,t)=>`Recorded step ${e}, and synced the change: ${t}`,skippedStep:e=>`Skipped step ${e}.`,noClipboard:`This browser won't copy from here; use Copy all fields.`,theseAreTheExact:`These are the exact inputs the tool gets. Approve them to run it.`,copiedTheFieldsAs:`Copied the fields as CSV, ready to import.`,allChanges:`All changes`,noChange2:`No change`,done2:`Done`,open2:`Open`,waitingOnOthers:`Waiting on others`,workItem:`work item`,choose:`Choose`,patDana:`pat, dana`,approvalRecordedBy:(e,t)=>`Approved by ${e}, as recorded by ${t}. A manual Git host's approvals are what a person records here.`,localTool:`LOCAL TOOL`,aToolOnThe:`A tool on the allow-list can do this step for you. You approve the exact inputs; it gets no credentials.`,tool:`Tool`,showTheInputs:`Show the inputs`,inputsTheToolGets:`Inputs the tool gets`,sha256:e=>`sha-256 ${e}…`,runWithIApprove:e=>`Run with ${e}, I approve these inputs`,manual:`MANUAL`,procedure:e=>`PROCEDURE ${e}`,whyThisIsManual:e=>`Why this is manual: ${e}. `,whereEveryValueComes:(e,t)=>`Where: ${e}. ${t}Every value comes from the change files. Nothing is sent until you do it.`,it:`it`,them:`them`,doFirstThisStep:(e,t)=>`Do ${e} first: this step depends on ${t}.`,fieldsToCopy:`Fields to copy`,copyAllFields:`Copy all fields`,copyAsCsv:`Copy as CSV`,empty:`Empty`,copy:e=>`Copy ${e}`,whenItsDoneRecord:`When it's done, record`,optional:` (optional)`,markDone:`Mark done`,reasonToSkip:`Reason to skip`,skipWithThisReason:`Skip with this reason`,done:`Done`,skipped:`Skipped`,byALocalTool:` (by a local tool)`,byOn:(e,t,n,r,i,a)=>`${e} by ${t} on ${n}${r}.${i}${a}`,toDoAndManual:`To-do and manual steps`,waitForAPerson:e=>`${e} wait for a person.`,nothingToDoEvery:`Nothing to do: every manual step is done.`,change:`Change`,stepsAPersonDoes:`Steps a person does in the work tracker, service desk or Git host when Atticus can't reach them.`,ofStepsDone:(e,t)=>`${e} of ${t} steps done`,steps:`Steps`,noManualStepsYet:`No manual steps yet.`,progress:`Progress`,open:e=>`${e} OPEN`,exportsInInputs:(e,t)=>`Exports in inputs/: ${e}, ${t}.`,noExportsInInputs:`No exports in inputs/ yet: drop a tracker or desk export there so Atticus can check results.`,whereStepsComeFrom:`Where steps come from`,allowListedToolsCan:`Allow-listed tools can do a step for you. A person approves each write and no credentials are passed. `,executorsAllowList:`Executors allow-list`,noToolsSetUp:`No tools set up on this machine (.atticus/executors.yaml).`,localAutomation:`Local automation`,noChange:`no change`,waits:`WAITS`,toDo:`TO DO`,openSteps:`Open steps`,noOpenSteps:`No open steps.`,pickAStepOn:`Pick a step on the left.`,step:`Step`,noStepSelected:`No step selected`,procedure2:`Procedure`,toolsAllowed:`Tools allowed`,writes:`Writes`,lastRun:`Last run`,noneOff:`none (off)`,notHere:` · not here`,setUpHere:`Set up here`,notSetUpOn:`Not set up on this machine`,neverRun:`never run`,theOrgPackHas:`The org pack has no procedures yet (process/procedures).`,eachRunShowsThe:`Each run shows the exact inputs first, waits for your approval, and logs what happened. Protected branches and deploys are never touched.`,proceduresALocalTool:`Procedures a local tool can run`,nothingDoneYet:`Nothing done yet.`,ownerNotKnown:`owner not known`,copyQuestionText:`Copy question text`,openChange:`Open change`,eachQuestionIsAsked:`Each question is asked once and the answer is reused at every gate. Where notifications are set up, Send to the owner posts it; otherwise copy the text, ask the owner, then record what they said on the Questions page.`,answerOnQuestions:`Record the answer`,noOwnerQuestionsWaiting:`No owner questions waiting.`,ownerQuestionsWaiting:`Owner questions waiting`},dashboardExtra:{of:(e,t,n)=>`${e} of ${t} ${n}`},graph:{map:`Map`},architecture:{readingEstate:`Reading the estate's catalog…`,layingOutBoxes:e=>`Laying out ${e} box${e===1?``:`es`}…`,joiningEstate:`Joining the estate to check each link's two sides… the marks of links whose sides disagree come next.`,contractsFailed:e=>`Couldn't check the links' contracts, so no link is marked: ${e}`},viewer:{toolbar:`Picture controls`,zoomIn:`Zoom in`,zoomOut:`Zoom out`,reset:`Actual size`,fit:`Fit to screen`,fitSelection:`Zoom to the picked box`,focus:`Focus on the picked box`,focusOff:`Show everything`,fullScreen:`Full screen`,leaveFullScreen:`Leave full screen`,zoomLevel:e=>`Zoom ${e}%`,search:`Find a box`,searchPlaceholder:`Find a repo, system or topic`,found:e=>`${e}: centred and picked.`,notFound:e=>`Nothing here is called ${e}.`,minimap:`Map of the whole picture`,keys:`Keys: + and − zoom, 0 fits, 1 is actual size, arrows pan, S zooms to the picked box, M focuses on it, F is full screen, / finds a box, Esc leaves full screen.`,region:e=>`${e}: picture`,fullScreenOn:`Full screen: Tab stays inside the picture. Press Esc to leave.`,focusOn:e=>`Focus on ${e} and what it links to; everything else is dimmed.`,details:`Details`,hideDetails:`Hide details`,showDetails:`Show details`,resizeDetails:`Width of the details: drag, or use the arrow keys`,widenDetails:`Wider details`,mapControls:`Map controls`,legend:`Legend`},topics:{owner:e=>`Owner: ${e}`,ownerOutside:e=>`Owner: ${e} (outside the estate)`,ownerUnknown:`Owner not known`,noListener:`No listener in the estate`,noPublisher:`No publisher in the estate`,noListenerFix:`Read the repo that listens on it, or, if a system outside the estate does, name that system so its listener is known.`,noPublisherFix:`Read the repo that publishes to it, or, if a system outside the estate does, name that system so its publisher is known.`,listens:`listens`,declared:`Declared in the profile`,declaredMark:`declared`,declaredGap:`Only the profile says so: no repo of the estate shows the other side`,declaredFix:`A person named it in the profile, so it rests on their word. If a repo of the estate serves the other side, read that repo: the code's link takes its place.`},me:{aiIsOffHere:`AI is off here, so write it yourself: the critic's rule checks still review it.`},flowsScreen:{thisFlow:`this flow`},flowsModel:{whoCallsThisEntry:`Who calls this entry point isn't known yet.`,callerNotKnown:`Caller not known`,calledByFlows:(e,t)=>t?`${e} and ${t} more`:e,start:`Start`},propose:{apply:e=>e?`Apply to ${e}'s map`:`Apply`,applying:`Applying…`,applied:e=>`Applied: ${e}'s facts are checked again and in the catalog.`,applyFailed:`Verify found problems; they are listed above.`,notStarted:e=>`It didn't start: ${e}`,propose:`Propose for review`,listed:`Here is what would be proposed.`,title:`Propose for review`,nothing:`Nothing has changed to propose.`,willCommit:(e,t)=>`These files go on branch ${e} as "${t}", and a pull request is opened. Untick any you don't want in it.`,status:{"??":`new`,M:`changed`,A:`added`,D:`removed`,R:`renamed`},yes:e=>`Push ${e} file${e===1?``:`s`} and open the PR`,proposing:`Proposing…`,proposed:`Proposed for review.`,cancel:`Not now`,appliedFlash:e=>`Applied the correction to ${e}'s map. It waits on Home to be proposed for review.`,applyWaits:e=>`Nothing applied to ${e}'s map yet: its build waits for you to confirm what it lists.`,confirmApply:e=>`Apply, removing ${e} ${e===1?`record`:`records`}`,editsChanged:`The hand edits aren't the ones listed here any more. Nothing was made curated: Apply again to list them.`,curatedApplyAgain:e=>`The hand edits are curated decisions now, which every later build keeps. Apply again to put ${e}'s facts in the map.`,toHome:`Propose it from Home`,applyFirst:`Apply the answers and corrections first, so the map in the pull request matches them:`,onMap:e=>`Your corrections aren't in the map yet: ${e}. Apply them to check each against the code and draw the map again.`,dismissErrors:`Dismiss these errors`,onMapApplied:`Applied. The map is drawn again; propose it for review from Home.`,pending:e=>`${e} changed file${e===1?``:`s`} ${e===1?`isn't`:`aren't`} proposed for review yet.`,inReview:e=>`already proposed (${e})`,bringIn:`Bring in what merged`,bringingIn:`Bringing it in…`,bringingInSay:`Fetching what merged from the remote, then catching your copy up.`,setUpstream:e=>`Set the upstream to ${e}`,setUpstreamWhy:`A setting of your copy only: nothing is sent. Then Bring in what merged again.`,bringInWhy:`When the PR has merged: your copy of the metarepo catches up, and your own edits stay.`,whoMerges:`A person reviews and merges it on the Git host; Atticus never merges. Your click is your approval to push the branch.`},appStep:{inTerminal:`In a terminal`,applyAll:`Apply to every repo's map`,applyingAll:`Applying…`,appliedAll:`Applied: every repo's facts are checked again and the map is drawn again.`,sync:`Sync the repos`,syncing:`Syncing…`,synced:`Synced the repos' clones.`,syncFirstSay:e=>`This machine has no clone of ${e} yet. Sync it, then try the step again.`,syncFirstDone:e=>`Synced ${e}: try the step again.`,sourcesSync:`Sync all wikis`,sourcesSyncing:`Syncing the wikis…`,sourcesSynced:`Synced every wiki into a dated snapshot.`,join:`Join the estate's flows`,joining:`Joining…`,joined:`Joined: each flow's calls to other repos now reach their flows.`,prune:`Clean up finished worktrees`,pruning:`Cleaning up…`,pruned:`Cleaned up. A worktree with uncommitted work is kept.`,pruneSay:`Removes the worktrees of changes whose pull requests merged or closed. A worktree with uncommitted work is kept, as the command line keeps it.`,taskContext:`Copy task context for my assistant`,taskContextWorking:`Making the context…`,taskContextCopied:`Copied. Paste it into your assistant in the task's repo.`,taskContextFailed:`The browser didn't allow copying. Select the context below and copy it yourself.`,taskContextSay:e=>`For your assistant in ${e}: the task, its stories, the design and the knowledge it needs.`,historyOn:`Turn recording on`,historyOff:`Turn recording off`,historyWorking:`Saving…`,historyNowOn:`Recording is on on this machine.`,historyNowOff:`Recording is off on this machine.`,readRepoFirst:`Read a repo first`,readRepoFirstSay:`Your assistant reads a repo's code and writes its facts; Atticus checks each against its line and draws the map.`,openTrust:`Read a repo on Map › Trust`,storiesAgain:`Draft the stories again`,openArchitecture:`Prepare it on Architecture`,findingAsk:`Ask its owner`,findingFill:`Fill it in`,openChangeFor:`Open it on the change's page`,proposeSay:`Then propose it for review: a person approves the pull request.`,openMap:`Open the map`,readOnMap:e=>`${e} is read and on the map.`,setupClones:`Sync the repos: it clones what's missing into the workspace.`,setupMachine:`Open Settings › This machine: each check says how to fix it, and Check again reads them again.`,openMachine:`Open Settings › This machine`,ownInstall:`Your install`,setupRead:`Read each repo with your assistant on Map › Trust; Done checks every fact against the line it cites and puts it on the map.`,setupBaseline:`Walk the ecosystem map with the architect, then accept it with Accept the catalog below and propose it for review.`},newChange:{start:`New change`,title:`New change`,titleLabel:`Title`,titleHint:`Raise the daily transfer limit`,idLabel:`Id (the folder and branch name)`,typeLabel:`Type`,noTypes:e=>`The change types didn't load: ${e}`,create:`Start the change`,starting:`Starting…`,cancel:`Cancel`,created:e=>`Started ${e}. Its brief is next.`},runs:{waitingSay:`This run waits for its answer. Paste the prompt into your assistant; when it has written the answer, Done checks it.`,done:`Done: check the answer`,failedSay:`The answer didn't pass its checks. Have your assistant fix what is listed, then Done checks it again:`,failedAgainSay:`Fix the answer, then press Done again.`,failedStill:`The answer still has the problems listed above.`,copyPrompt:`Copy the prompt`,nextPrompt:`Next: open the step's next prompt`,doneOk:`Checked the answer.`,cancel:`Cancel the run`,cancelled:`Cancelled. The step can run again.`,title:`Model runs`,intro:`What Atticus asked a model and what came back, for every AI step, newest first. A prompt and an answer are shown as text, as they were written.`,listTitle:`Runs`,caption:`Model runs, newest first`,cols:{step:`Step or change`,agent:`Agent`,model:`Model`,round:`Round`,state:`State`,answered:`Answered`,handedBack:`Handed back`,when:`When`},classes:{read:`Read`,draft:`Draft`,critic:`Critic`,knowledge:`Knowledge`,quick:`Quick`},modelCell:(e,t)=>`${t??`Not recorded`}${e?` · ${e}`:``}`,modelNotRecorded:`Not recorded`,yes:`Yes`,notYet:`Not yet`,problems:e=>e===0?`Nothing`:e===1?`1 problem`:`${e} problems`,states:{prepared:`Prepared`,waiting:`Waiting for its answer`,produced:`Answered, not checked yet`,validated:`Passed the checks`,failed:`Failed`,cancelled:`Cancelled`},empty:`No model runs yet. A run is listed here once an AI step starts: run one from its page, or with its command or slash command.`,emptyFor:e=>`No model runs for ${e} yet.`,onlyFor:e=>`Only the runs of ${e}.`,showAll:`Show every run`,pick:`Open a run from the list to read what it was asked and what it answered.`,back:`Back to every run`,toGlance:e=>`Go on with ${e} on At a glance`,toTaskBoard:e=>`Go on with task ${e} on the Task board`,toTaskBoardAny:`Go on with the tasks on the Task board`,toNextRun:`Open the run that waits next`,missing:e=>`There is no run ${e}. It may have been removed from .runs/.`,runTitle:(e,t)=>`${e}, round ${t}`,prompt:`Prompt`,answer:`Answer`,noAnswer:`No answer yet: the run is waiting for one.`,handedBack:`Handed back`,noneHandedBack:`Nothing was handed back: this is the step's first round.`,roundProblems:e=>`Round ${e}: the problems the checks found`,failedAnswer:e=>`The answer round ${e} gave`,noFailedAnswer:`The answer that failed them isn't in the prompt.`,tools:{title:`What the model looked up`,offered:(e,t)=>`Read-only tools offered: ${e||`none`}. The model called them ${t===1?`once`:`${t} times`}.`,stopped:e=>`A cap stopped the tool calls (${e}).`,call:(e,t,n,r)=>`Round ${e}: ${t}, ${n} tokens back${r?`, refused`:``}`,returned:e=>`What ${e} gave back`},retrieval:{title:`How the context was found`,expansion:(e,t)=>`The model read the input first${e?` (run ${e})`:``}${t?`, an answer kept from before`:``}.`,terms:e=>`Search terms: ${e||`none`}.`,name:(e,t,n,r)=>`${e}: ${t?`the index's ${t}`:n?`new in this change`:`nothing in the index`} ("${r}")`,dropped:(e,t)=>`Left out: ${e}, ${t}.`,rerank:(e,t,n)=>`The model ordered ${e} candidates. Kept, in its order: ${t||`none`}. Judged not needed: ${n||`none`}.`,rerankIgnored:e=>`The model's order of ${e} candidates named one it wasn't shown, so the engine's order stood.`,meaning:e=>`Meaning: ${e}.`},rounds:`Rounds of this step`,round:e=>`Round ${e}`,thisRound:`(this one)`,batch:{parts:`Lenses in this prompt`,partsSay:`One prompt asks these lenses together; Done checks each lens's section on its own. A lens still out can be fixed here and Done pressed again, or answered alone from its own run.`,lens:e=>`The ${e} lens`,askedIn:`Asked in`,askedInLink:`The prompt that asked the lenses together`},facts:{agent:`Agent`,runtime:`Runs with`,stepClass:`Kind of step`,model:`Model`,state:`State`,started:`Started`,finished:`Finished`,size:`Prompt size`,file:`Prompt file`},tokens:e=>`${e} tokens`,textBox:e=>`${e}, scrolls on its own`,forChange:e=>`Model runs for ${e}`,knowledge:`Model runs of the knowledge steps`,surveys:`Model runs of the surveys`,all:`Every model run`},history:{title:`Prompt history`,intro:`What people asked their assistant in this metarepo and what it answered, by session, newest first. It is kept on this machine only, in .atticus/history/, and never committed. Each prompt and response is shown as text, as it was written.`,what:`Recorded: prompts and replies in Claude Code with the Atticus plugin, and @atticus requests and replies in VS Code. Copilot's other chats can't be recorded: VS Code gives extensions no access to them, and Copilot in IntelliJ gives plugins no chat at all.`,recordingOn:`Recording is on on this machine. Turn it off here, for this machine only.`,offOrgPack:`Recording is off for everyone: the org pack's runtime.yaml says history: { record: false }. What was kept before is still here.`,offLocal:`Recording is off on this machine. Turn it back on here; what was kept before is still here.`,empty:`No prompts yet. With the Atticus plugin in Claude Code, or @atticus in VS Code, each prompt and reply in this metarepo is listed here.`,change:`Change`,everyChange:`Every change`,session:e=>`Session ${e}`,surfaces:{"claude-code":`Claude Code`,vscode:`VS Code, @atticus`,cli:`Command line`},onlySession:e=>`Only session ${e}.`,showAll:`Show every session`,prompt:`Prompt`,response:`Response`,noResponse:`No response yet.`,command:`Command`,about:`About`,box:(e,t)=>`${e} ${t}, scrolls on its own`,truncated:e=>`Cut at 64 KB: the text was ${e} bytes.`,masked:`Parts that looked like a secret were masked (***) before it was kept.`,newest:(e,t)=>`The newest ${e} of ${t} turns. atticus history --limit n lists more.`,turns:e=>e===1?`1 turn`:`${e} turns`},canvasAi:{mark:(e,t)=>e>=t?`◆ Detected by AI`:`◆ ${e} of ${t} calls detected by AI`,title:`Detected by AI`,hint:`Links the AI paired as itself, from a run Atticus started, that no person has confirmed. Drawn dotted, with ◆ and the words. Pick one to see its run and correct it.`,only:`Only links detected by AI`,listed:e=>`${e} link${e===1?``:`s`} on this picture detected by AI:`,pick:(e,t)=>`Show the link ${e} → ${t}`,none:`No link on this picture was detected by AI.`,noneOnly:`Only links detected by AI are shown, and this picture has none. Press the button again to show every link.`,legend:`How links are drawn`,legendCode:`Solid line: read from code`,legendPerson:`Dashed line: a person's word (declared or paired)`,legendAi:`Dotted line with ◆: detected by AI`,legendDependency:e=>`Dash-dot line, "depends on": a build dependency on a library of the estate's own, not a call (${e} on this picture)`,linkTitle:(e,t,n)=>`${e} → ${t} (${n})`,link:`Link`,close:`Close the link`,gone:`This link isn't on the picture any more: a correction or a new read moved it.`,corrected:`Correction saved as your word. The canvas was read again; the link moves once atticus verify --write has joined the caller's repo again.`},deleteLink:{open:`Delete this link`,openOf:(e,t)=>`Delete the link ${e} → ${t}`,confirm:(e,t,n)=>`Delete ${e} → ${t}, ${n} call${n===1?``:`s`}?`,intro:`Your decision is written to catalog/curated, for review in a pull request, and the catalog is built without the link. Bring it back any time from Deleted links, in the map's tools.`,yes:`Delete`,no:`Cancel`,reading:`Reading every call on this link…`,readFailed:e=>`Couldn't read every call on this link: ${e}`,partial:(e,t)=>`only ${t} of its ${e} calls could be read, and a link is deleted whole or not at all. Open the box it starts in and pick the arrow there.`,none:`it has no call to take away.`,mixed:`it merges something that isn't a call (a use of a table, a loose end), which Delete can't take away: delete it from the box it starts in, where its calls are drawn apart.`,also:e=>`This also takes away ${e}: they are the same calls.`,working:`Deleting the link and building the catalog…`,failed:e=>`The link wasn't deleted: ${e}`,done:(e,t)=>`Deleted ${e} → ${t}. Bring it back below, or from Deleted links in the map's tools.`,list:{title:`Deleted links`,loading:`Reading the deleted links…`,failed:e=>`The deleted links couldn't be read: ${e}`,none:`No link was deleted on the canvas.`,item:(e,t,n)=>`${e} → ${t}, ${n} call${n===1?``:`s`}`,by:(e,t)=>`${e}, ${t.slice(0,10)}`,back:`Bring back`,redirected:`redirected (its new link was added with it)`,gone:`no longer in the code read: Bring back draws nothing`,backOf:(e,t)=>`Bring back the link ${e} → ${t}`,backing:`Bringing it back and building the catalog…`,backDone:(e,t)=>`${e} → ${t} is back on the map.`,backFailed:e=>`The link wasn't brought back: ${e}`}},panelResults:{waitsRemovals:e=>`Saved. The catalog build waits for you to review ${e} removal${e===1?``:`s`} first.`,waitsBuild:`Saved. The catalog build waits for you on Catalog builds.`,reviewRemovals:e=>`Review the ${e} removal${e===1?``:`s`}`,reviewBuild:`Review the build`,printed:e=>`What it printed (${e} line${e===1?``:`s`})`},editMap:{toggle:`Edit the map`,toggleOf:e=>e?`Edit the map, ${e} change${e===1?``:`s`} not applied yet`:`Edit the map`,title:`Your changes to the map`,intro:`Pick an arrow to delete or redirect it, or add a link below. Nothing is saved until Apply my changes, which saves them all and builds the catalog once.`,empty:`No changes yet. Pick an arrow on the map to delete or redirect it, or add a link below.`,counts:(e,t,n)=>[e?`${e} deleted`:``,t?`${t} added`:``,n?`${n} redirected`:``].filter(Boolean).join(`, `),listLabel:`Changes not applied yet`,row:{delete:(e,t,n)=>`Delete ${e} → ${t} (${n} call${n===1?``:`s`})`,add:e=>`Add: ${e}`,redirect:(e,t,n)=>`Redirect ${e} → ${t} to: ${n}`,also:e=>`, and with it ${e}`},what:{call:(e,t)=>`${e} calls ${t}`,publishes:(e,t)=>`${e} publishes to ${t}`,listens:(e,t)=>`${e} listens on ${t}`,pair:(e,t,n)=>`${e} → ${t}, ${n} call${n===1?``:`s`} paired`,pairShort:e=>`${e} call${e===1?``:`s`} paired`},remove:`Remove`,removeOf:e=>`Remove from your changes: ${e}`,onCanvas:{delete:`to delete`,add:`to add`},stage:{delete:`Delete this link`,deleteOf:(e,t)=>`Add to your changes: delete ${e} → ${t}`,redirect:`Redirect this link…`,redirectOf:(e,t)=>`Redirect ${e} → ${t}`,staged:e=>`In your changes: ${e}`,reading:`Reading every call on this link…`,readFailed:e=>`Couldn't read every call on this link: ${e}`},add:{title:`Add a link`,redirectTitle:(e,t)=>`Redirect ${e} → ${t}`,redirectIntro:`The link is deleted and this one is added in its place, as one change. Say where it goes now.`,intro:`What Declare a link… writes: your word in the profile that has the system, with your name and the date, drawn dashed.`,from:`From`,fromNone:`No outside system is on the map to start a link from. Add one with Add to the picture first.`,kind:`What it does`,to:`Draw it to, until the map is built`,toNone:`Don't draw it yet`,stage:`Add to my changes`,cancel:`Cancel`,empty:`Say the topic or the route first.`,twice:`That link is in your changes already.`,pairIntro:`What Connect to… writes: your word that each call picked goes to that API, one line each in the repo's corrections, with your name and the date. The call's fact stays as read.`,toPick:`To (a repo or an outside system)`,toPickNone:`Pick the box first`,loading:`Reading the calls and APIs…`,failed:e=>`The calls and APIs couldn't be read: ${e}`,calls:e=>`${e}'s calls, each with the API it goes to`,callApi:e=>`The API ${e} goes to`,notPaired:`Not this call`,noCalls:e=>`${e} has no call left to pair with this box: every call of it joins something already. To move one, pick its arrow and use Redirect this link….`,noApis:e=>`${e} has no APIs on record yet, so there is nothing to pair with. Read it first (Map › Trust).`,pickOne:`Pick the API for at least one call.`,redirectCalls:e=>`${e}'s calls this arrow is, each with where it goes now`,lineless:e=>`This arrow cites no line of ${e}'s, so the call it is isn't known from the map. Pick ${e}'s call it is (the ones with its method and path are picked for you); the pairing cites that call's own line.`,linelessAmbiguous:e=>`This arrow cites no line of ${e}'s, and more than one of ${e}'s calls has its method and path, so none is picked for you: pick the call it is. The pairing cites that call's own line.`,drawsAnother:e=>`${e} already draw${e.includes(`,`)?``:`s`} another arrow: pairing it moves that arrow here too.`,redirectNoRepo:`This arrow doesn't start in a repo's box, so its calls can't be paired again here. Delete it, then add the link from a system's box.`},apply:`Apply my changes`,confirm:{title:e=>`Apply ${e} change${e===1?``:`s`}?`,intro:`Each is saved for review (a delete in catalog/curated, an add in the profile, with your name and the date), then the catalog is built once with all of them.`,yes:`Apply them`,back:`Go back`},working:`Saving your changes and building the catalog…`,failed:e=>`Your changes weren't applied: ${e}`,outcome:{saved:`saved`,failed:`not saved`,"taken-back":`taken back`,"not-tried":`not tried`},done:e=>`${e} change${e===1?``:`s`} applied and the catalog built. Propose them for review with the catalog's other changes.`,doneWaits:(e,t)=>`${e} change${e===1?``:`s`} applied and the catalog built. The new links are drawn once ${t} ${t.includes(`,`)?`are`:`is`} read from facts too (Map › Trust).`,problemsLine:e=>`${e} change${e===1?``:`s`} can't be made, so nothing was saved: each says why below.`,failedLine:`Your changes weren't applied and nothing was built: each says what happened below. The whole output is in the Console.`,reRead:`Re-read the repos these touch`,reReadWhy:e=>`Reads ${e} whole again with Copilot, as one run, so their facts agree with your changes.`,reReadNone:`None of these changes starts in a repo of the estate, so there is no repo to read again.`,reReadNoCopilot:e=>`Copilot can't run from the app here. Read ${e} again with your assistant (/atticus-map <repo>).`},canvasTools:{types:`Types`,typesHint:`The organisation's component types, as the boxes wear them. Click one to show only its components (the rest of your filter stays); again to show all.`,title:`Layers, filters and tools`,show:`Show the tools`,hide:`Hide the tools`,layers:`Layers`,layer:{verified:`Read and cited`,guessed:`Guesses and gaps`,declared:`Declared (a person's word)`,paired:`Paired by a person`,ai:`Detected by AI`,outside:`Outside systems`,topics:`Topics and queues`},mismatches:`Only links whose two sides disagree`,filter:`Filter`,filterHint:`team:<id> system:<id> type:<repo or component type> path:/accounts/** or words`,filtered:(e,t)=>`${e} of ${t} boxes shown`,overlay:`Colour boxes by`,questionsBadge:e=>e===1?`open question`:`open questions`,overlayLoading:`Getting the open questions…`,overlayFailed:e=>`Couldn't get the open questions: ${e}`,viewsLoading:`Getting the kept views…`,viewsFailed:e=>`Couldn't get the kept views: ${e}`,saving:`Keeping it…`,overlays:{none:`Nothing`,gaps:`Gaps`,questions:`Open questions`},radius:`Blast radius of the selected box`,radiusPick:`Select a box first.`,radiusDir:{up:`What calls it`,down:`What it calls`,both:`Both`},depth:e=>`Depth ${e}`,radiusOn:`Show it`,radiusOff:`Stop`,radiusCount:e=>`${e} boxes reached`,trace:`Trace from the selected box`,traceNone:`Nothing goes out from it in this view.`,hop:e=>`Hop ${e}`,inbox:`Open on this picture`,inboxNone:`Nothing open: no box or link here has a gap.`,compare:`Compare`,snapshot:`Keep a snapshot of the links now`,snapshotAt:e=>`Snapshot of ${e}`,compareOn:`Mark what changed since`,added:e=>`${e} links added (marked new)`,removed:e=>`${e} links gone:`,noSnapshot:`No snapshot yet: keep one, change something, then compare.`,views:`Saved views`,viewName:`Name (lower case, e.g. ledger-calls)`,save:`Keep this view`,replace:e=>`Replace ${e}`,saved:e=>`Kept in ${e}: commit it to share it.`,open:`Open`,noViews:`No view kept yet.`,export:`Export the picture`,exportEnd:{saved:`Saved.`,cancelled:`Not saved: the Save dialog was closed.`,failed:`Couldn't save the file here. Open the app in a browser to download it.`},exports:{mermaid:`Mermaid`,drawio:`draw.io`,svg:`SVG`,png:`PNG`,pdf:`Print or PDF`},openCode:`Open in your editor`,openingCode:`Finding the file…`,inVsCode:`VS Code`,inIntellij:`IntelliJ`,noCheckout:e=>e},declare:{open:`Declare a link…`,title:e=>`Declare a link of ${e} the code can't show`,intro:`Your word, written to the profile with your name and the date for review: drawn dashed, never passed off as read from code. A declared topic is drawn where a repo of the estate publishes or listens on it with nobody on the other side.`,kind:`What it does`,kinds:{publishes:`Publishes to a topic or queue`,listens:`Listens on a topic or queue`,call:`Calls a gateway route`},topic:`Topic or queue, as the code names it`,route:`Route, as METHOD /path (or the handler proxy/flow)`,preview:`Preview`,previewing:`Working out the change…`,confirm:`Write it`,writing:`Writing…`,written:`Written. Apply it to redraw the map, then propose it for review.`,empty:`Say the topic or the route first.`,close:`Close`,copy:`Copy the command`},corrections:{title:`Corrections and declarations`,show:`Show the corrections`,loading:`Reading the corrections…`,failed:e=>`The corrections couldn't be read: ${e}`,none:`No corrections or declarations on this box.`,by:(e,t)=>`${e}, ${t.slice(0,10)}`,kinds:{edit:`corrected`,wrong:`marked wrong`,link:`paired`,topic:`declared topic`,call:`declared call`,unlink:`said it reaches none of these`},undo:`Undo`,undoing:`Undoing…`,undone:`Undone. Apply it to redraw the map, then propose it for review.`},addBox:{open:`Add to the picture…`,title:`Add to the picture`,loading:`Reading the manifest and profiles…`,failed:e=>`What can be added couldn't be read: ${e}`,notRead:`Repos of the manifest not read yet: read one to draw it with its calls.`,readCommand:e=>`atticus map --all --repos ${e}`,allRead:`Every repo of the manifest is read.`,newSystem:`A new vendor or another team's system`,id:`Id (e.g. harbor-audit)`,name:`Name`,boundary:`It is`,boundaries:{vendor:`a vendor`,internal:`another team's system`},owner:`Owner (for another team's)`,noOwner:`None yet`,preview:`Preview`,confirm:`Add it`,writing:`Adding…`,previewing:`Working out the change…`,written:`Added to the profile. Apply it to redraw the map, then propose it for review.`,close:`Close`,copy:`Copy the command`},owner:{open:`Owner and system…`,title:e=>`Who owns ${e}, and its system`,intro:e=>`Written to ${e} after your yes, the file's comments kept; the map shows it once you apply it.`,loading:`Reading the manifest…`,failed:e=>`The owner couldn't be read: ${e}`,owner:`Owner (a team)`,system:`System`,noSystem:`None`,addTeam:`Add a team…`,teamId:`New team's id (e.g. team-loyalty)`,teamName:`New team's name`,teamNote:`The team is added to roles.yaml for review, with nobody on it yet.`,preview:`Preview`,previewing:`Working out the change…`,nothing:`That is what the manifest says already: nothing to change.`,diffOf:e=>`What changes in ${e}`,confirm:`Write it`,writing:`Writing…`,written:`Written. Apply it to redraw the map, then propose it for review.`,close:`Close`,copy:`Copy the command`},match:{intro:`Not enough from the paths? Copilot can read this repo's call sites (the constants and settings the paths are built from) and propose which API each call reaches, naming the lines. It writes nothing but its answer; every proposal you take is previewed and confirmed here like any pairing.`,start:`Match with Copilot`,again:`Match again`,running:`Matching…`,runningSay:(e,t)=>`Copilot is reading ${e}'s call sites against ${t}'s APIs. This takes a minute or two; the proposals appear here.`,readAnswer:`Read the answer`,readingAnswer:`Reading the answer in…`,handoff:e=>`The brief is written for your assistant (Copilot can't be started from here: runtime.yaml doesn't allow copilot-acp). In a new Copilot Chat (agent mode) or Claude Code session, say "read ${e} and do what it says", then Read the answer. Atticus checks it; where runtime.yaml's decide.links is auto, it applies each pairing that passes the citation check and the bar as the AI's (Detected by AI), and the rest wait here for you.`,answerAt:e=>`It writes its answer to ${e}.`,copy:`Copy`,done:(e,t,n)=>`Copilot proposes ${e} pairing${e===1?``:`s`}${t?`, says ${t} match${t===1?`es`:``} nothing here`:``}${n?`, and ${n} line${n===1?``:`s`} of its answer named a call or API that isn't one and ${n===1?`was`:`were`} left out`:``}. Nothing is written until you tick, preview and confirm.`,take:e=>`Tick the ${e} proposed`,taken:`Ticked above`,noneTitle:e=>`${e} said to match nothing here`,rejectedTitle:e=>`${e} left out`},connect:{open:`Connect to…`,title:e=>`Connect ${e} to another box`,ends:(e,t)=>`From ${e} to ${t}`,dropNeedsRepo:`A line connects a repo's calls to another box: start or end it on a repo, a component in one, or a system that holds one repo. A system with several repos: open it (double-click) and draw from the repo. Two outside systems can't be connected here: declare the link on the system's box instead.`,dropSameRepo:`Both ends are in the same repo, so there is nothing to connect: a repo's calls inside itself are read from its code.`,intro:`Pair this repo's calls that join nothing with the other box's APIs. Each pair you confirm is one line in this repo's corrections, your word: the call's fact stays as read.`,pickBox:`The other box`,pickBoxNone:`Pick a repo or a system`,loading:`Reading the calls and APIs…`,failed:e=>`The calls and APIs couldn't be read: ${e}`,leftWhy:{"no-host":`no host in its URL`,"unresolved-placeholder":`its URL has a setting not resolved`,"host-no-route":`its host serves no such route`,"label-no-route":`no repo of that name serves it`,"target-no-route":`its named target serves no such route`,"generic-path":`its path is too generic to match`,"answered-none":`answered as calling nothing here`,"topic-unheard":`no one listens on its topic`,"topic-unresolved":`its topic is a setting not resolved`,"type-not-joined":`calls of this kind aren't joined`},noCalls:e=>`${e} has no calls on record yet, so there is nothing to pair. Read its calls first:`,unverifiedCalls:e=>`${e}'s facts are read but not all verified, so the map leaves them out and there is nothing to pair yet. Verify them first:`,noApis:{"not-read":e=>`${e} has no APIs on record yet. Read it first:`,unverified:e=>`${e}'s facts are read but not all verified, so its APIs aren't on the map yet. Verify them first:`,"no-spec":e=>`${e} has no spec on file. Add its OpenAPI file:`},noLoose:`Every call of this repo joins something already: nothing loose to pair.`,calls:`Calls that join nothing`,caption:(e,t)=>`${e}'s loose calls, each with an API of ${t}`,col:{pick:`Pair`,call:`Call`,line:`Line`,status:`Now`,api:`API`},pickApi:`Pick an API`,likely:`Likely`,allApis:`All APIs`,findApi:`Find an API (type part of its path or name)`,tickConfident:e=>`Tick the ${e} confident`,tickSuggested:e=>`Tick all ${e} suggested`,untickAll:`Untick all`,tally:(e,t,n)=>`${e} confident, ${t} suggested, ${n} with no suggestion. A confident pair is the same path (or the same once a setting or a gateway's forwarding is read), well ahead of every other API.`,status:{asked:`asked`,missed:`no route`,left:`left`,outside:`outside`,unresolved:`not joined`,paired:`paired by a person`},why:{"same-path":`same path`,prefix:`same but for a prefix`,parameter:`same but for a parameter or setting`,"names-alike":`names alike`,setting:`the same path once its setting is filled in`,"operation-words":`the operation's name says the same`,"forwarded-path":`what the gateway's route forwards to`},suggested:e=>`Suggested: ${e}`,rule:e=>`All ${e} loose calls go there, and calls read later too: answer the open target question with /** (a rule)`,preview:`Preview`,previewing:`Working out what changes…`,confirm:(e,t)=>e===0&&t?`Answer for all its calls`:`${e===1?`Write the pair`:`Write ${e} pairs`}${t?` and answer for all`:``}`,writing:`Writing…`,written:(e,t)=>e===0?`No pair written.`:`${e===1?`One pair`:`${e} pairs`} written to ${t}.`,ruleWritten:e=>`The open target question ${e} is answered with /**.`,undo:`Undo`,undone:`Undone: the line is removed.`,undoneRuleStays:(e,t)=>`Undone: the pair lines are removed. The rule's answer is not undone: the target question ${e} still sends this repo's loose calls, and calls read later, to ${t} (/**). To take it back, answer ${e} again on the Questions page.`,nothingPicked:`Pick at least one pair, or the rule for all.`,pairedMark:`paired by a person`,makeRule:`Make this a rule for every repo of this type?`,makingRule:`Drafting the rule…`,ruleMade:e=>`Drafted in ${e}, for review: a reader is given it once a person sets it active.`,close:`Close`,copy:`Copy the command`},activity:{title:`Console`,open:`Open the Console`,close:`Close the Console`,list:`What ran`,empty:`Nothing has run yet on this metarepo.`,emptyHint:`Scans, syncs, Apply, AI steps, hand-offs and the commands you run in a terminal or an editor (atticus map, verify, scan, workspace sync…) show here while they run, with what they print.`,loading:`Reading what ran…`,failed:e=>`Couldn't read what ran: ${e}`,retry:`Try again`,runningCount:e=>e===1?`1 running`:`${e} running`,kinds:{scan:`Scan`,sync:`Sync`,reconcile:`Reconcile`,index:`Index`,intake:`Intake`,step:`AI step`,local:`Local step`,work:`Request`,copilot:`Copilot run`,command:`Command`,handoff:`Hand-off`},where:{app:`this app`,terminal:`a terminal`,vscode:`VS Code`,intellij:`IntelliJ`,copilot:`a Copilot session`,assistant:`your assistant`},states:{running:`running`,waiting:`waiting for your assistant`,done:`done`,failed:`failed`,cancelled:`cancelled`,ended:`ended without saying`},refused:`refused: nothing written`,appClosedState:`stopped when the app closed`,appClosed:`The app closed (or restarted) while this ran, so it stopped there. Its lines up to then are below; start it again from where you started it.`,stoppingState:`stopping…`,from:e=>`from ${e}`,at:e=>`at ${e}`,exitCode:e=>`exit code ${e}`,stop:`Stop`,stopping:`Stopping…`,stopFailed:e=>`Stop didn't go through: ${e}`,stopTerminal:`Stop it in its terminal (Ctrl+C).`,otherWindow:`Started in another Atticus window: stop it there.`,endedWithoutSaying:`Its process is gone and it never said how it ended: the terminal was closed, or it crashed. Its lines up to then are below.`,handoffWaits:`This waits for your assistant. The lines below say where the prompt is and how to finish it.`,linesLoading:`Reading its lines…`,linesFailed:`Couldn't read its lines. The Console tries again on its next look.`,noLines:`Nothing printed yet.`,follow:`Follow the end`,search:`Search the log`,copy:`Copy`,copied:`Copied`,copyFailed:`Couldn't copy here`,noMatch:e=>`No line has “${e}”.`,earlier:e=>`${e.toLocaleString()} earlier lines not shown.`,loadEarlier:`Show earlier lines`,dropped:e=>`${e.toLocaleString()} earlier ${e===1?`line was`:`lines were`} dropped before these: the log keeps only its last lines.`,newLines:(e,t)=>e===1?`1 new line in ${t}`:`${e} new lines in ${t}`,changed:(e,t)=>`${e}: ${t}`,strip:{label:`Running now`,running:e=>`Running: ${e}`,step:(e,t)=>`${e} of ${t}`,more:e=>e===1?`and 1 more`:`and ${e} more`,show:`Show in the Console`}},bottomPanel:{label:`Panel`,tabs:`Panel tabs`,tab:{console:`Console`,questions:`Questions`,problems:`Problems`,runs:`Runs`},count:e=>e===1?`1 item`:`${e.toLocaleString()} items`,countStepsOnly:e=>`${e===1?`1 question`:`${e.toLocaleString()} questions`} from the steps; the owner questions couldn't be read`,expand:`Show the panel`,collapse:`Hide the panel`,resize:`Resize the panel`,resizeHint:`Drag, or use the up and down arrow keys, to change the panel's height.`,running:(e,t)=>`${e} · ${t}`,started:e=>`Started: ${e}`,console:{noneSelected:`Pick a run in Runs to see its lines here.`},questions:{loading:`Reading the open questions…`,failed:e=>`Couldn't read the open questions: ${e}`,empty:`No question is open. Atticus asks here when it can't tell something from the code.`,intro:e=>e===1?`1 open question`:`${e.toLocaleString()} open questions`,openAll:`Open Questions`,answer:`Answer`,answerLabel:e=>`Answer: ${e}`,more:e=>`and ${e.toLocaleString()} more on the Questions page`,ownerRow:e=>e===1?`1 owner question`:`${e.toLocaleString()} owner questions`,ownerMeta:`asked of a system's owner`,ownerLabel:e=>`Answer the ${e===1?`owner question`:`${e.toLocaleString()} owner questions`}`},problems:{loading:`Reading what needs attention…`,findingsFailed:e=>`Couldn't read the open findings: ${e}`,trustFailed:e=>`Couldn't read the verifier's reports: ${e}`,empty:`Nothing needs attention: no run failed lately, no finding blocks a change and the verifier rejected no fact.`,failedRuns:`Failed runs`,blocking:`Blocking findings`,rejected:`Facts the verifier rejected`,copilotStopped:`Copilot stopped reading`,copilotStoppedMeta:e=>e===0?`two sessions added nothing`:e===1?`verify rejected 1 line`:`verify rejected ${e.toLocaleString()} lines`,failedRun:(e,t,n)=>`${e} · ${t} · ${n}`,rejectedFacts:(e,t)=>t===1?`${e}: 1 fact rejected`:`${e}: ${t.toLocaleString()} facts rejected`,fixThenVerify:e=>`Fix them, then run ${e}`,open:`Open`,openLabel:e=>`Open: ${e}`,openTrust:`Open Trust`,show:`Show in the Console`,showLabel:e=>`Show ${e} in the Console`},runs:{label:`Recent runs`,hint:`Pick a run to see its lines in the Console.`},retry:`Try again`},copilotRuns:{start:{stale:`Read the stale repos with Copilot`,gaps:`Fill the gaps with Copilot`,all:`Read the repos not read yet with Copilot`,repos:e=>`Read ${e} with Copilot`,again:e=>`Read ${e} again with Copilot`},hint:`Copilot reads unattended, one new session per part, and Atticus verifies each part. You see each step in the Console.`,confirm:{title:`Start a Copilot run?`,what:{stale:`Re-read every repo whose clone moved past its facts.`,gaps:`A second pass on the gaps of every read repo: calls with no target, entries no flow follows.`,all:`Read every repo of the manifest not read yet.`,repos:(e,t)=>`${t?`Read again, whole: `:`Read: `}${e}.`,staleRepos:e=>`Re-read those of ${e} whose clone moved past its facts.`,gapsRepos:e=>`A second pass on the gaps of ${e}.`},model:e=>e?`Model: ${e} (runtime.yaml's copilotAcp).`:`Model: Copilot's default.`,may:`Each session may only read the code, write facts and run atticus verify. It can't answer, accept, audit or mark anything done as you, and it never pushes, deploys or writes anywhere else.`,long:`A large repo takes several sessions. Stop at any time: the next run carries on from there.`,yes:`Start the run`,no:`Not now`,limit:{label:`Your model's limit, in tokens`,hint:`Atticus doesn't know it here: runtime.yaml names no limit and nothing was measured on this machine. Give the context window of the model Copilot uses (for example 128000), so each part fits it. It is kept on this machine for the next run.`,last:`Filled in with the limit given for the last run on this machine.`,probe:`Filled in with the limit measured on this machine.`,bad:`Give a whole number of tokens, 1,000 or more.`,known:(e,t)=>`Model limit: ${e.toLocaleString()} tokens (${t===`probe`?`as measured on this machine`:`runtime.yaml's maxInput`}).`},files:{stale:e=>`The assistant files Copilot reads are out of date (${e===1?`1 file`:`${e.toLocaleString()} files`}): the run writes them again from the org pack before the first session. Propose them for review with the facts.`,edited:(e,t)=>`Copilot's sessions would each stop at once: ${t===1?`${e} was edited by hand, and only a person replaces it`:`${t.toLocaleString()} assistant files were edited by hand (${e}), and only a person replaces them`}. Put back the generated text, then start the run.`,editedHow:`In a terminal: atticus assistant-files --force writes the generated text over the edits.`,shared:e=>`It adds Atticus's section to your ${e}, after your own lines, which it keeps as they are.`}},notAllowed:`Copilot can't be started from here`,starting:`Starting…`,failedToStart:e=>`The run didn't start: ${e}`,strip:{running:`Copilot is reading`,planning:`Planning the run…`,repo:(e,t,n)=>`Repo ${e} of ${t}: ${n}`,session:e=>`Session: ${e}`,totals:(e,t,n)=>`${e} facts kept, ${t} rejected${n?`, ${n.toLocaleString()} tokens`:``}`,done:`The Copilot run finished.`,stopped:`The Copilot run stopped. The next run carries on from there.`,failed:e=>`The Copilot run stopped: ${e}`,stop:`Stop`,stopping:`Stopping…`,stopFailed:e=>`Stop didn't go through: ${e}`,showConsole:`Show the Console`,dismiss:`Dismiss`,stoppedOn:e=>e===1?`The run stopped on 1 repo:`:`The run stopped on ${e.toLocaleString()} repos:`,stoppedRepo:(e,t,n)=>t&&n?`${e}, part ${t} of ${n}`:e,rejected:e=>e===1?`verify rejected 1 line:`:`verify rejected ${e.toLocaleString()} lines:`,noRejected:`Two Copilot sessions added nothing to it, and verify rejected nothing.`,moreRejected:e=>`and ${e.toLocaleString()} more on Map › Trust`},console:{title:`Console`,open:`Open the Console`,close:`Close the Console`,tabs:`Console tabs`,follow:`Follow the end`,search:`Search the log`,copy:`Copy`,copied:`Copied`,empty:`No Copilot run yet. Start one from Map › Trust: read the stale repos, fill the gaps, or read one repo.`,noLines:`Nothing printed yet.`,noMatch:e=>`No line has “${e}”.`,earlier:e=>`${e.toLocaleString()} earlier lines not shown.`,loadEarlier:`Show earlier lines`,notKept:e=>`${e.toLocaleString()} earlier lines are no longer kept (the app keeps a tab's last 5,000).`,runTab:`Run`,copyFailed:`Couldn't copy here`,states:{running:`running`,ended:`ended`,failed:`failed`}}},bridge:{noAnswer:`No answer from VS Code`,stepSilent:`No word from VS Code about this step for an hour: given up here. Its run, if any, is in Runs.`,noAnswerTo:(e,t)=>`No answer to ${e} in ${t} s. Close the Atticus panel and open it again.`},runStep:{handoffPrepare:`Prepare it for your assistant`,handoffRead:`Read with my assistant`,handoffReadHint:`Atticus writes the prompt for your assistant (Copilot, Claude Code) to read the repo's code into facts; Done checks each fact against its line and puts the kept ones on the map.`,handoffWorking:`Preparing…`,handoffHint:`Atticus writes the prompt; paste it into your assistant (Copilot, Claude Code), then Done checks the answer.`,handoffReady:`Prepared.`,handoffStill:`A run of this step still waits for its answer.`,handoffOpen:`Open the prompt and Done`,handoffOpenWaiting:`Open the run that waits`,withCopilot:`Run with Copilot`,withModel:e=>`Run with ${e}`,running:`Running…`,busy:`The step is running. The button comes back when it ends.`,hintCopilot:`Copilot runs it in VS Code, with your consent, and the checks read its answer.`,hintModel:e=>`The server runs it with ${e}, as runtime.yaml sets, and the checks read its answer.`,started:e=>`Started on the server with ${e}.`,progress:`Progress`,output:`What the step printed`,ends:{done:`Done: the step finished.`,handoff:`Handed off: the prompt waits for its answer.`,question:`It asked a question: answer it in Waiting on you, then run the step again.`,stopped:`It stopped: its checks found problems. Read the run to see them.`,failed:`It failed.`,cancelled:`Cancelled.`,"too-long":`It stopped: the prompt was too long for the model.`,"no-consent":`It didn't run: Copilot wasn't allowed to use the model.`,"no-model":`It didn't run: no Copilot model is available.`,"model-error":`It stopped: the model answered with an error.`,"too-many-rounds":`It stopped: the checks still found problems after the last round.`},refused:e=>`It didn't run: ${e}`,ended:e=>`It ended: ${e}.`,openRun:`Read the run in Model runs`,openRuns:`Open Model runs`,cancel:`Cancel`,cancelling:`Stopping…`,cancelHint:`Stops the model call; nothing from this run is kept.`,cantStart:e=>`Couldn't start it: ${e}`},nextStep:{releasePlan:`Release plan`},evidence:{cite:e=>`Where this was found: ${e}`,citeOf:(e,t)=>`Where this was found: ${t}, ${e}`,loading:`Reading the facts for this line…`,quote:`The line, as the reader quoted it`,noQuote:`No quote was kept for this line.`,facts:e=>`${e} fact${e===1?``:`s`} on this line`,by:{assistant:`read by the assistant`,reader:`read by a built-in reader`,person:`a person's fact`},verified:{line:`checked on its line by atticus verify`,sample:`checked by a sample session`,person:`confirmed by a person`,none:`not checked yet: run atticus verify`},gaps:{unverified:`No fact verified from code cites this`,question:`A question is open on this`,corrected:`A person corrected this; atticus verify applies it`},short:{unverified:`unproven`,question:`question open`,corrected:`corrected`},noFacts:e=>`${e} has no facts yet: what is drawn from it comes from the built-in readers, not from a read the verifier checked.`,openQuestion:`Answer it`,correct:`Correct this`,correctFact:e=>`Correct the fact ${e}`,close:`Close`,correctTitle:e=>`Correct ${e}`,correctIntro:`Say the fact is wrong, or put the claim right. Atticus writes your correction to the repo's corrections file; atticus verify applies it every time it runs, so the next read keeps it. A corrected claim is still checked on its line: the code must say it.`,wrong:`It is wrong`,edit:`Put the claim right`,reason:`Why (required to mark it wrong)`,reasonOptional:`Why (optional)`,line:`Line it is on`,save:`Save the correction`,saving:`Writing the correction…`,needReason:`Say why the fact is wrong first.`,nothingChanged:`Change a field or the line first.`,saved:e=>`Written to ${e}.`,correction:(e,t,n)=>e===`wrong`?`Marked wrong by ${t}`:e===`link`?`Paired with ${n??`another system`} by ${t}`:`Corrected by ${t}`,links:`Links`,noLinks:`No link starts or ends here in this view.`,linkOf:(e,t,n)=>`${e} ${n} ${t}`},correctionNext:{title:`What happens next`,onlyWrote:e=>`The app wrote only ${e}. Apply uses it; then Propose for review, here or later from Home (what you haven't proposed waits there). A person reviews the pull request.`,fileDiff:e=>`The change to ${e}, as written`,stepsTitle:`Or on the command line, in order`,step:{verify:`Apply it: verify checks the facts again and writes the catalog`,branch:`Make a branch for the change`,add:`Add the exact files the write changes`,commit:`Commit them`,push:`Push the branch`,pr:`Open a pull request`},prByHand:e=>`Open a pull request from ${e} on your Git host. Set adapters.gitHost in org-pack/runtime.yaml and Atticus gives its command here.`,copy:e=>`Copy: ${e}`,previewTitle:`What atticus verify --write will change`,previewIntro:`Worked out here by the same checks the command runs, without writing anything. It compares with the catalog on disk, so it also shows anything else waiting to be written.`,loading:`Working out what the write will change…`,failed:e=>`Couldn't work out what the write will change: ${e}`,unavailable:{"no-checkout":`There is no checkout of the repo here, so what the write changes can't be worked out. Clone it (atticus workspace sync); the commands still apply.`,"unreadable-facts":`The repo's facts file doesn't read as facts, so the write would change nothing yet. Have your assistant read the repo again.`},blocked:e=>`The write puts nothing in the catalog: ${e} fact${e===1?` is`:`s are`} rejected. Fix ${e===1?`it`:`them`} first (Map › Trust lists ${e===1?`it`:`them`}).`,headMoved:(e,t)=>`The checkout is at ${e.slice(0,7)}, past the facts' commit ${t.slice(0,7)}: verify reads the changed files' facts again, which this preview doesn't.`,facts:`Facts`,dropped:`Left out`,droppedWhy:{wrong:`marked wrong by a person`,rejected:`rejected by the verifier`},edited:`Edited`,field:(e,t,n)=>`${e}: ${t??`(none)`} → ${n??`(none)`}`,noFactChange:`No fact changes.`,kept:e=>`${e} fact${e===1?``:`s`} kept.`,links:`Links`,moved:(e,t,n)=>`${e}: moves from ${t} to ${n}`,added:e=>`${e}: added`,removed:e=>`${e}: removed`,changed:(e,t,n)=>`${e}: ${t} → ${n}`,unmade:e=>`${e}: this repo no longer makes it (the record stays, held by the other side, until that repo is written again)`,linkWhat:(e,t,n,r)=>`${e} → ${t} ${n?`${n} `:``}${r}`,noLinkChange:`No link changes.`,catalog:(e,t,n,r)=>`Catalog records: ${e} added, ${t} changed, ${n} removed, ${r} with only their evidence changed.`,stale:e=>`Corrections on file that meet no fact in this read (kept, applied when it is read again): ${e}.`},why:{contracts:`Contract`,contractsOf:(e,t)=>`${e} mismatch${e===1?``:`es`}${t?`, ${t} unconfirmed`:``} between what each side sends and takes`,contractsAll:`All mismatches`,open:`Why is this linked?`,openOf:e=>`Why is ${e} linked?`,intro:`Each call on this link, how Atticus joined it to what it calls, and the line it cites at each end. A verified call is read from code at both ends and named by someone; an inferred one is a guess.`,call:(e,t,n)=>`${e} → ${t}${n?`: ${n}`:``}`,count:e=>`${e} call${e===1?``:`s`}`,copyOf:e=>`Copy ${e}`,how:{person:`A person paired this call with this entry on the canvas (Connect to…): their word, written as a link in the caller's corrections, the call's own fact left as read.`,answer:`A person answered which repo or system it calls.`,named:`The call names the component it goes to.`,repo:`The call names the repo it goes to.`,host:`The call's host is one the manifest lists for that repo.`,"base-path":`The gateway forwards the call with no host (a proxy chained to another), and its whole path starts with this proxy's base path: this is the one route under it with its method and path.`,declared:`A person declared who calls this gateway route.`,topic:`It publishes a topic the other side listens to.`,path:`Nobody named where it goes: it is the only entry in the estate that serves its path, so this is a guess.`,label:`Its host names no repo; the host's first part happens to be a component's name, so this is a guess.`,"platform-setting":`Its host comes from a platform-wide setting nobody set for this service, so this is a guess.`,"folder-name":`Its host comes from a setting that is this service's only because its file sits in a folder named like it, so this is a guess.`,conflict:`Its host or base path is one a deploy file gives and the manifest disagrees with (an open conflict on Map › Trust), so this is a guess.`,"service-name":`Its host is a Kubernetes Service's short name, which reaches that Service only from its own namespace, and no deploy file says this service runs there, so this is a guess.`,shared:`It calls another team's system, and the map that team shares has the entry that answers it.`,ai:`The AI paired this call with the entry, as itself, from a run Atticus started. No person has confirmed it; correct it if it is wrong.`,coordinates:`Its build file declares a dependency on the coordinates the other repo's build publishes: a library of the estate's own, both lines checked. It is a build dependency, not a call.`,unknown:`The catalog doesn't say how this was joined: it was written before Atticus kept that, or by a built-in reader. Run atticus verify on the caller's repo with --write to record it.`},howGuessed:{"base-path":`Joined by the proxy's BasePath; the caller's host is unknown. Its whole path starts with this gateway proxy's base path, and this is the one route under it with its method and path, but nothing says the call goes to this gateway, so this is a guess.`},gateway:`It goes through a gateway on the way.`,declared:`Declared in the profile`,declaredTopic:`Declared in the profile: a person named this topic or queue as that system's, and no repo of the estate serves the other side. It rests on their word, not on code at both ends.`,declaredIn:`In the profile`,sharedMap:(e,t)=>`Joined to ${e}'s map${t?` (their commit ${t.slice(0,7)})`:``}.`,sharedTheirs:e=>`What answers it is ${e}'s, read from the map they share: Atticus never verifies or corrects it. If their entry is wrong, tell ${e}; correct this call only if it goes somewhere else.`,verified:`✓ Verified`,inferred:`△ Inferred`,caller:`The call`,callee:`What answers it`,hops:`Through the gateway`,other:`Lines cited`,noLine:`No line cited at this end.`,more:e=>`${e} more call${e===1?``:`s`} on this link. Open either end to see its calls one by one, or list the Interface records with atticus query "kind:interface".`,none:`This link isn't a call, so there is no join to explain: its lines are listed under it.`,also:e=>`Also: other calls merged into this link were joined by ${e}, not read from code at both ends; open either end to see them one by one.`,alsoHow:{person:`a person's pairing (their word)`,ai:`the AI's pairing (no person has confirmed it)`,path:`their path alone`,"base-path":`the proxy's BasePath, their host unknown`,label:`their host's first part`,"platform-setting":`a platform-wide setting`,"folder-name":`the folder a setting is in`,conflict:`a host the manifest disagrees with`,"service-name":`a Service's short name`},dependency:{edge:`depends on`,intro:`Each build dependency on this link: the component's build file declares the coordinates the library's build publishes. It isn't a call, so it is never counted with the calls; the library's own calls stay the library's.`,title:(e,t,n)=>`${e} depends on ${t}: ${n}`,ends:(e,t)=>`${e} depends on ${t}`,count:e=>`${e} build dependenc${e===1?`y`:`ies`}`,scope:e=>`(${e} scope)`,caller:`Declared in its build file`,callee:`Published by`,wrongOf:e=>`Say the dependency ${e} is wrong`,wrongTitle:e=>`What is wrong with ${e}?`,wrongIntro:`Say why it is no dependency on the estate's library (a test helper, a stale line, a fork). Atticus writes it to the depending repo's corrections file through the local API; atticus verify leaves the dependency out every time it runs, and the link goes. Nothing changes until you run the command below and the change is reviewed in a pull request.`,reason:`Why (required)`,needReason:`Say why the dependency is wrong first.`,pickFacts:e=>`The ${e} lines of its build that declare it (the link goes once each is wrong)`,needFact:`Choose at least one line that declares the dependency.`,moreLoading:`Reading every dependency on this arrow…`,moreFailed:e=>`Couldn't read every dependency on this arrow: ${e}`,noFact:e=>`No dependency fact of ${e} is on this line, so there is nothing to correct here. Read the repo again (/atticus-map ${e}) or correct the line's facts from its citation.`,loadingFacts:`Reading the depending repo's facts…`,factsFailed:e=>`Couldn't read the depending repo's facts: ${e}`,will:(e,t)=>`The dependency is left out: ${e} no longer depends on ${t} once atticus verify runs with --write, unless another line of its build declares it.`,savedAll:(e,t)=>`Written ${e} correction${e===1?``:`s`} to ${t}, in one go.`,alreadyAll:`Every one of these corrections is on file already, so nothing new was written.`,skippedAll:e=>`${e} ${e===1?`was`:`were`} on file already.`},wrong:`This link is wrong`,wrongOf:e=>`Say the call ${e} is wrong`,wrongTitle:e=>`What is wrong with ${e}?`,wrongIntro:`Your word outranks every join rule. Atticus writes it to the caller's repo's corrections file through the local API; atticus verify applies it every time it runs. Nothing changes until you run the command below and the change is reviewed in a pull request.`,pickCall:`The call on that line`,choice:{estate:`It calls another repo or component of the estate`,outside:`It calls an outside system (a vendor, a cloud service)`,"not-a-call":`It isn't a call`},target:`What it calls`,targetHint:`A repo or component id, as the manifest names it.`,outsideTarget:`The outside system`,outsideHint:`The system's name, e.g. Northwind Pay.`,reason:`Why (required when it isn't a call)`,reasonOptional:`Why (optional)`,save:`Write the correction`,saving:`Writing the correction…`,needTarget:`Say what it calls first.`,sameTarget:`The call names that already: pick another target.`,needReason:`Say why it isn't a call first.`,noCall:e=>`No call fact of ${e} is on this line, so there is nothing to correct here. Read the repo again (/atticus-map ${e}) or correct the line's facts from its citation.`,loadingFacts:`Reading the caller's facts…`,factsFailed:e=>`Couldn't read the caller's facts: ${e}`,will:{moves:(e,t,n)=>`This call leaves ${e} → ${t} and goes to ${n}: verify joins it to the entry of ${n} that serves it, or says none does.`,outside:(e,t,n)=>`This call leaves ${e} → ${t} and goes to ${n}, outside the estate: no repo is joined to it.`,unknown:e=>`Atticus doesn't know ${e} as a repo or component of the estate, so verify will take it as outside.`,dropped:(e,t)=>`The call is dropped from the catalog: ${e} → ${t} loses it, and goes if it was the link's only call.`},saved:e=>`Written to ${e}.`,arrow:{open:`All calls on this arrow are wrong…`,openOf:e=>`Say every call on ${e} is wrong`,title:e=>`What is wrong with the ${e} call${e===1?``:`s`} on this arrow?`,intro:`One answer for every call on the arrow: Atticus writes a correction for each to its caller's repo's corrections file, one write per repo. Your word outranks every join rule. Nothing changes until you apply them (Corrections to apply, at the top of the map) and the change is reviewed in a pull request.`,choice:{estate:`They all go to another box (a repo or component of the estate)`,outside:`They all go to an outside system`,"not-a-call":`None of these is a call`},target:`The box they all go to`,outsideTarget:`The outside system they all go to`,save:e=>`Correct all ${e} call${e===1?``:`s`}`,saving:`Writing the corrections…`,noCalls:`No call fact is cited on these calls' lines, so there is nothing to correct here. Read the callers' repos again, or correct each call from its citation.`,missing:e=>`${e} call${e===1?` has`:`s have`} no call fact on its line and ${e===1?`is`:`are`} left as ${e===1?`it is`:`they are`}.`,saved:(e,t)=>`Written ${e} correction${e===1?``:`s`} to ${t}.`,apply:`Next: Apply them from Corrections to apply, at the top of the map, then propose the change for review.`,loadingCalls:`Reading every call on this arrow…`,callsFailed:e=>`Couldn't read every call on this arrow: ${e}`,declared:e=>`${e} of these link${e===1?` is`:`s are`} a person's declaration, not a call in code, and ${e===1?`is`:`are`} left as ${e===1?`it is`:`they are`}: withdraw a declaration from This link is wrong under its call.`,pick:{legend:`Which of these calls are on this arrow?`,intro:`Atticus can't tell for sure which call on these lines makes this arrow: the line holds no call of its path, or more than one. Tick each call that belongs to this arrow; only the ticked ones are corrected.`,call:(e,t,n)=>`${e}${t?` to ${t}`:``}, ${n}`,need:`Tick at least one call to correct first.`},tooMany:(e,t)=>`This arrow has ${e} calls to correct, more than the ${t} one correction can take. Correct the calls of one box at a time, opening the arrow from a box inside it.`,routing:e=>`${e} of these link${e===1?` comes`:`s come`} from a gateway proxy's routing, with no line of a caller's to correct, and ${e===1?`is`:`are`} left as ${e===1?`it is`:`they are`}: answer where ${e===1?`it goes`:`they go`} or correct the proxy's forwarding from This link is wrong under ${e===1?`its call`:`each`}, which changes that route for every caller.`,uncited:e=>`${e} of these link${e===1?` cites`:`s cite`} no line of the caller's, so there is no call to correct, and ${e===1?`is`:`are`} left as ${e===1?`it is`:`they are`}: to take the arrow away, use Delete this link at the top of the link's panel.`,already:`Every one of these corrections is on file already, so nothing new was written. Apply them from Corrections to apply, at the top of the map.`,skipped:e=>`${e} ${e===1?`was`:`were`} on file already and ${e===1?`was`:`were`} left as ${e===1?`it was`:`they were`}.`},declaredLink:{profile:`the profile`,say:e=>`A person declared this link in ${e}: no call in code makes it, so there is no call to correct. Withdraw the declaration and the link goes at the next join.`,sayNoFile:`A person declared this link in the profile: no call in code makes it, so there is no call to correct. Withdraw the declaration and the link goes at the next join.`,byHand:e=>`It wasn't declared from the canvas, so there is no Undo for it here: remove it from ${e} and propose that for review.`},routingLink:`No line of a caller's cites this call: the link comes from a gateway proxy's routing, so there is no call here to correct. Where the proxy forwards it is set on the proxy, for every caller of the route, not this link alone: answer where it goes, or correct the proxy's forwarding at its line.`,uncitedLink:`No line of the caller's is cited for this call, so there is no call here to correct. To take the arrow away, use Delete this link at the top of the link's panel.`,routing:{all:e=>`${e===1?`The call on this arrow comes`:`All ${e} calls on this arrow come`} from a gateway proxy's routing: no line of a caller's cites ${e===1?`it`:`them`}, so there is no call here to correct. Where the proxy forwards ${e===1?`it`:`them`} is set on the proxy, for every caller of the route: answer where it goes, or correct the proxy's forwarding at its line.`,answer:`Answer where it goes`,answerFor:e=>`Answer where it goes: ${e}`,answerOf:(e,t)=>t?`Answer where it goes: ${t} (${e})`:`Answer where it goes: ${e}`,forwarding:`Correct the proxy's forwarding`,forwardingOf:(e,t)=>`Correct the proxy's forwarding: ${e} ${t}`,loading:`Reading the proxy's facts…`,failed:(e,t)=>`Couldn't read ${e}'s facts: ${t}`,none:`Atticus finds no forwarding call on the proxy's lines for this route, and so no open question about where it goes: there is nothing to open here. List the open questions, or read the proxy's repo again, in a terminal.`,terminal:`Or in a terminal`,copy:e=>`Copy the command: ${e}`},moved:`What moved when the estate was joined again`,movedTo:(e,t,n)=>`${e}: was ${t}, now ${n}`,movedOff:(e,t)=>`${e}: was ${t}, now on no link of the parts open here`,notYet:`No call has moved yet: run the verify command above. The picture reads the catalog again when it changes.`},stageReview:{title:`What the critic found`,intro:`The critic's findings on this stage's latest draft, each with what you can do about it: make the fix, say it isn't relevant, waive it where the rule allows, or ask its owner. Or leave a comment: the stage's next run gives it to your assistant as your answer, with the next draft.`,notRun:`This stage hasn't run for this change yet, so there is nothing to review. Run it first:`,noRound:e=>e?`The critic hasn't reviewed a draft at the ${e} gate yet. The stage runs it on each draft that passes its checks.`:`No gate in gates.yaml reviews this stage's phase, so the critic doesn't run here.`,clean:(e,t)=>`Nothing found at the ${e} gate, round ${t}.`,round:(e,t,n)=>`${n} finding${n===1?``:`s`} at the ${e} gate, round ${t}`,loopState:{drafting:`The stage is drafting.`,waiting:`The stage waits on your assistant's answer.`,questions:`The stage waits on the questions below.`,stopped:`The stage stopped: its assistant couldn't fix what was found.`,done:`The stage is done.`},severity:{blocking:`Blocking`,gap:`Knowledge gap`,risk:`Risk`,idea:`Idea`},state:{open:`Open`,applied:`Fixed`,dismissed:`Not relevant`,waived:`Waived`,asked:`Asked`},where:`Where`,why:`Why`,fix:`The fix`,options:`What you can do`,apply:`Make the fix`,applyFor:e=>`Make the fix for ${e}`,dismiss:`Not relevant`,dismissFor:e=>`Not relevant: ${e}`,waive:`Waive`,waiveFor:e=>`Waive ${e}`,ask:e=>`Ask ${e}`,askFor:(e,t)=>`Ask ${t} about ${e}`,cantWaive:`This rule can't be waived: fix it, or say it isn't relevant with why.`,reason:e=>`Why, for ${e} (needed for not relevant and waive)`,needReason:`Write why first: not relevant and waive need a reason.`,acted:e=>`Recorded: ${e}.`,actions:{apply:`the fix is made`,"not-relevant":`not relevant`,waive:`waived`,ask:`asked of its owner: send it to them from Questions › Owner questions`},resolved:(e,t)=>`${e} by ${t}`,proposed:(e,t)=>`Proposed by the assistant (${e}) as ${t===`fixed`?`fixed`:`not relevant`}, waiting on a person`,question:e=>`The question for ${e}`,comments:`Comments`,comment:e=>`Your comment on ${e}`,commentHint:`Say what the next draft should do about it. Your words go to the assistant as your answer.`,saveComment:`Save the comment`,savingComment:`Writing the comment…`,needComment:`Write the comment first.`,read:`read by a draft`,unread:`not read yet: run the stage`,commented:e=>`Written to ${e}. Commit them, then run the stage again: its next draft reads your comment.`,copyCommit:`Copy the git command`,questions:`The stage's questions`,noQuestions:`The stage has no question for a person.`,answered:e=>`Answered: ${e}`,answerIt:e=>`Answer: ${e}`,next:`Then run the stage again`,nextWhy:`It reads your answers, comments and choices, drafts again where they ask, and the critic checks the new draft.`,runAgain:`Run the stage again`,runAgainWhy:`The stage is done. Run it again only to redraft: it reads your answers and comments, and the critic checks the new draft.`,pickForArchitecture:`Pick a change to see what the critic found in its architecture.`},thread:{title:e=>({proposal:`The proposal, as one conversation`,feature:`The feature stage, as one conversation`,architecture:`The architecture stage, as one conversation`,stories:`The stories stage, as one conversation`,small:`The small change, as one conversation`})[e]??`The stage, as one conversation`,intro:`Everything about this stage in one place, in order: the prompt for your assistant, its answer and what the checks said, what the critic found, the questions, and what you told the assistant. Your assistant does the work in your editor; you paste the prompt, and the app picks the answer up as soon as the file is written.`,loading:`Reading the stage's thread…`,start:`Start the stage`,startNext:`Start the next round`,byPersonGoOn:`Go on from them on At a glance`,byPersonAgain:`Or have the stage write them instead (it replaces them):`,byPersonReplace:e=>`Draft the stories again, replacing ${b(e)}…`,byPersonConfirm:e=>`This replaces ${b(e)}, which a person wrote. A copy of ${e.length===1?`it`:`each`} is kept first in the change's stage/stories-by-person/ folder, and the stage says where. Draft the stories again?`,byPersonKeep:`Keep them`,starting:`Writing the prompt…`,prompt:`The prompt for your assistant`,criticPrompt:`The critic's prompt for your assistant`,copyPrompt:`Copy the prompt`,copyPromptFor:e=>`Copy the prompt of ${e}`,showPrompt:`Show the prompt`,pasteHint:`Paste it into your assistant (Copilot or Claude Code). It writes the answer file; the app checks it as soon as the file is complete.`,runState:{prepared:`Ready to paste`,waiting:`Waiting for the answer`,produced:`Being checked`,validated:`Answered`,failed:`Answered, with problems`,cancelled:`Not used: a newer prompt replaced it`},answer:`Your assistant's answer`,criticAnswer:`The critic's answer`,checked:{passed:`Passed the checks`,failed:`Didn't pass the checks`,checking:`Being checked`},checkedBy:{app:`The app checked it when the file arrived.`,person:`Checked when Done was pressed.`},problems:`What the checks found`,changed:`What the stage wrote`,finding:`The critic found`,where:e=>`At ${e}`,fix:`The fix`,reply:`Reply`,replyFor:e=>`Reply about ${e}`,makeFix:`Make the fix`,makeFixFor:e=>`Make the fix for ${e}`,fixToAssistant:e=>`Make the fix: ${e}`,fixSent:`Sent to the assistant: the next round makes the fix. Start the next round when you're ready.`,fixInEditor:e=>`The stage's assistant doesn't write ${e}, so the fix is yours: it opens here, at the line.`,fixSaved:`Saved. Recorded as fixed.`,askOwner:e=>`Ask ${e}`,askOwnerFor:(e,t)=>`Ask ${t} about ${e}`,asked:`Asked of its owner.`,notRelevant:`Not relevant, for this reason`,notRelevantNeeds:`Write why it isn't relevant in the box first.`,findingState:{open:`Open`,applied:`Fixed`,dismissed:`Not relevant`,waived:`Waived`,asked:`Asked`},question:`A question for a person`,answerHere:e=>`Answer: ${e}`,answered:e=>`Answered: ${e}`,you:e=>`${e} told the assistant`,aboutFinding:e=>`About ${e}`,read:`Read by a round`,unread:`The next round reads it`,correction:e=>`Correction of ${e}`,dropped:`1 question couldn't be kept: its line didn't match`,droppedCites:e=>`It cites ${e}.`,droppedNearest:e=>`Keep it anyway cites ${e}, the nearest line.`,droppedNone:`Keep it anyway cites the stage's file: no file it names is there.`,keep:`Keep it anyway`,keepFor:e=>`Keep it anyway: ${e}`,kept:`Kept: it is one of the stage's questions now.`,note:`Note`,replyLabel:`Tell the assistant…`,replyAbout:e=>`Tell the assistant about ${e}…`,replyHint:`Say what the next round should do. Your words go to the assistant with the next prompt, as your answer.`,send:`Send and start the next round`,sendOnly:`Send`,sending:`Sending…`,needText:`Write what to tell the assistant first.`,clearAbout:`Not about a finding`,sent:`Sent. The next round's prompt carries it.`,savedNotStarted:e=>`Your reply is saved, but the next round didn't start: ${e} Press Start the next round once that is fixed; there's no need to send the reply again.`,replyClosed:`Replies open once the stage has run.`,details:`Details`,detailAgent:(e,t)=>`Step ${e}, ${t}`,detailTokens:e=>`${e} tokens`,detailModel:e=>`Model ${e}`,detailAttempt:e=>`Round ${e}`,detailFiles:`Files`,adminView:`Every run, for an administrator: Set up › Model runs`,empty:`Nothing has happened at this stage yet.`,criticRan:e=>e?`The rule checks ran; ${e===1?`an AI lens waits`:`${e} AI lenses wait`} for your assistant in the stage's thread.`:`The rule checks ran.`},roles:{names:{product:`Product`,architecture:`Architecture`,analysis:`Analysis`,delivery:`Delivery`},who:{product:`the product owner`,architecture:`the architect`,analysis:`the business analyst`,delivery:`the tech lead`},filter:`Role`,allRoles:`All roles`,option:(e,t,n)=>`${e}${t===void 0?``:` (${t})`}${n?` · yours`:``}`,pickYours:`Your role`,pickYoursHint:`The change doesn't name you among its owners, so pick the role you play: Atticus remembers it on this machine. Or name the change's owners on its page.`,pickYoursHintSome:`For the changes that don't name you among their owners, pick the role you play: Atticus remembers it on this machine. Where a change names you, its owners decide.`,pickNone:`Pick a role`,homeTitle:`Your role's questions`,homeIntro:`Each role answers its own questions on a change: the product owner the brief's, the architect the feature stage's (placing it on the estate) and the design's, the business analyst the stories', the tech lead the tasks'.`,line:(e,t,n)=>n===0?`${e}: no open question for ${t}.`:`${e}: ${n} open ${n===1?`question`:`questions`} for ${t}.`,fromOwners:`From the change's owners`,fromPicker:`The role you picked`,open:`Answer them`,noChanges:`No change in flight asks a role anything yet.`,cantRead:e=>`The questions of ${e} couldn't be read.`},changeOwners:{title:`Owners by role`,intro:`Who answers each role's questions on this change. Saving writes change.yaml's owners; it rides the change's next hand-off.`,roles:{"product-owner":`Product owner`,architect:`Architect`,"business-analyst":`Business analyst`,"team-lead":`Tech lead`},placeholder:`Git handles, comma-separated`,save:`Save owners`,saving:`Saving…`,saved:`Saved the owners in change.yaml.`},runReady:{button:`Run all ready tasks`,buttonCount:e=>`Run all ready tasks (${e})`,running:`Running the ready tasks…`,reading:`Reading which tasks are ready…`,cantRead:e=>`Which tasks are ready couldn't be read: ${e}`,why:`The tech lead or architect runs the tasks: every task whose dependencies are done, in cross-repo order, one task run each, stopping on the first that needs a person. Your click approves the drafts; each PR is raised on its own Raise click, and nothing is merged.`,noneReady:`No task is ready to run: each waits for the tasks before it, its PR, the assistant or a person.`,progress:e=>`Running: ${e}`,ran:(e,t)=>`Task ${e}: ${t}`,refused:(e,t)=>`Task ${e} wasn't run: ${t}`,stopped:(e,t,n)=>`Stopped at task ${e}: ${t}.${n?` Not run yet: ${n}.`:``}`,allRan:e=>`Ran ${e} ${e===1?`task`:`tasks`}. A person reviews and merges each PR on the Git host.`,failed:`The ready tasks couldn't be run.`,waits:(e,t)=>`Task ${e} isn't ready: ${t}.`},stageDrafts:{title:`The drafts`,intro:`What the AI drafted for this stage. Read each one: if something is wrong, Correct it in your words. The stage's next run follows your correction, and with Apply to similar, makes the same fix everywhere it fits.`,none:`Nothing drafted for this page yet. Run the stage: its drafts show here, each marked as drafted by AI until you edit it.`,draftedByAi:`Drafted by AI`,draftedByAiRun:e=>`in run ${e}`,draftedByAiWhy:e=>`Drafted by AI at the ${e} stage; no person has edited it since. Read it before the hand-off.`,editedBy:(e,t)=>`Edited by ${e} on ${t}`,editedByPerson:`Edited by a person`,editedOutside:`Changed outside the app since the AI drafted it.`,openRun:e=>`Open run ${e}`,items:e=>`What you can correct in ${e}`,correct:`Correct`,correctFile:e=>`Correct ${e} as a whole`,correctItem:e=>`Correct ${e}`,formTitle:e=>`Your correction of ${e}`,textLabel:`What should it say or do instead?`,textHint:`Say it as you would to a colleague. Your words go to the stage's assistant as your instruction; a fact verified from the code still wins over them.`,similar:`Apply to similar`,similarHint:`The next run makes the same correction to every other step, story, section or task like this one.`,likeLabel:`Similar items name`,likeHint:`The component, entry, table or term they share. Leave it empty to let the run judge.`,save:`Save the correction`,saving:`Writing the correction…`,cancel:`Cancel`,needText:`Write the correction first.`,saved:e=>`Your correction of ${e} is saved. Run the stage again to apply it.`,waitingTitle:`Corrections waiting for the next run`,waitingNone:`No correction waits. Correct an item above, then run the stage again.`,runAgain:`Run the stage again to apply them`,runAgainWhy:`The stage's next run reads every correction as your instruction, drafts again from the current drafts, and the critic checks the new draft.`,doneTitle:`Corrections the stage has read`,state:{waiting:`Waiting for the next run`,read:`Read, but the item didn't change`,applied:`Applied`},scope:{one:`This item`,similar:`This item and similar ones`},likeOf:e=>`naming ${e}`,by:(e,t)=>`${e}, ${t}`,appliedIn:e=>`in run ${e}`,touched:e=>`Also changed ${e} similar item${e===1?``:`s`}:`,readNotApplied:`The draft had your correction but didn't change this item. Correct it again in other words, or edit the file.`,remove:`Take back`,removeFor:e=>`Take back your correction of ${e}`,removed:`Correction taken back.`,copyCommit:`Copy the git command`,ridesHandoff:e=>`It is kept in ${e}, which goes with the stage's hand-off: running the stage again and raising its hand-off carries it to the pull request.`,outsideHandoff:`Not raising this stage's hand-off? Propose the file for review:`,correctionsFile:`the change's stage/corrections.yaml`},decisions:{chip:`Detected by AI`,chipWhy:`Decided by AI as itself, through an Atticus run (a Copilot session Atticus started, or a hand-off to your assistant read back on Done). No person has confirmed it; correct it if it is wrong.`,chipShort:`By AI`,run:e=>`run ${e}`,openRun:e=>`Open run ${e}: what the AI was asked and what it answered`,title:`Decided by AI`,intro:`What the AI decided without a person: pairings of calls to APIs and answers to option questions. Each is the AI's, never yours. If one is wrong, Correct it: your answer is your word, and Apply to similar spreads it to everything like it. Every batch is one Undo away.`,loading:`Reading the AI's decisions…`,failed:e=>`The AI's decisions couldn't be read: ${e}`,problems:`Files that couldn't be read:`,counts:{label:e=>`How the ${e} were settled`,links:`links`,questions:`questions`,line:e=>e.retired===void 0?`${e.fromCode} from code · ${e.byPerson} by a person · ${e.byAi} by AI${e.open===void 0?``:` · ${e.open} open`}`:`${e.byPerson} by a person · ${e.byAi} by AI${e.open===void 0?``:` · ${e.open} open`} · ${e.retired} retired`,linksInMap:`links in the map as last applied`,lines:(e,t)=>`The corrections hold ${e} standing AI pairing${e===1?``:`s`} and ${t} of people's now; Apply brings the map up to them.`},mode:{auto:`decided by AI`,propose:`proposed for a person`},modeLine:(e,t)=>`Now: pairings are ${e}; option answers are ${t}.`,decideIn:{none:`runtime.yaml allows neither copilot-acp nor hand-off here, so no run decides anything: the AI only proposes.`,both:`The AI decides when a Copilot session Atticus runs ends, and when a hand-off to your assistant is marked done (Match with Copilot's Read the answer, Ask AI to propose's Done).`,handoff:`The AI decides when a hand-off to your assistant is marked done (Match with Copilot's Read the answer, Ask AI to propose's Done); copilot-acp isn't allowed here.`,acp:`The AI decides when a Copilot session Atticus runs ends; hand-off isn't allowed here.`},setUp:`Change it in Set up › AI`,kind:{link:`Pairing`,question:`Answer`},filterRepo:`Repo`,allRepos:`All repos`,filterKind:`Kind`,allKinds:`Pairings and answers`,kinds:{link:`Pairings`,question:`Answers`},itemsTitle:`What the AI decided`,itemsCaption:`Each decision the AI applied that still stands`,itemsEmpty:`The AI has decided nothing that still stands. When runtime.yaml's decide says auto, Match with Copilot and Ask AI to propose apply what passes the bar here.`,itemsFiltered:`Nothing the AI decided matches the filter.`,shown:(e,t)=>e===t?`${t} decision${t===1?``:`s`}`:`${e} of ${t} decisions`,decided:e=>`Decided: ${e}`,bar:{confident:`it met the confidence bar`,"agrees-with-shapes":`it agrees with what the code's shapes say`,"person-rule":`it agrees with a person's rule`},because:e=>`Applied because ${e}.`,restsOn:`Rests on`,question:`Question`,correct:`Correct`,correctOf:e=>`Correct: ${e}`,formTitle:e=>`Your correction of ${e}`,pickOption:`The right answer`,pickLink:`Where the call really goes`,linkApi:`This API`,noneOption:`None of these`,noneLink:`The call reaches none of these`,repoLabel:`Repo the API is in`,repoPick:`Pick the repo`,apiLabel:`API`,apiPick:`Pick the API`,apisLoading:`Reading that repo's APIs…`,apisFailed:e=>`That repo's APIs couldn't be read: ${e}. Type the API's id:`,apiIdLabel:`The API's id (its entry fact)`,similar:`Apply to similar`,similarHint:`Atticus derives a rule from your correction, shows it below before you save, and re-checks every AI decision and open item it covers in this repo.`,matchLabel:`The rule to spread (a path prefix, host or topic pattern)`,matchHint:`Atticus derived it; change it to spread wider or narrower.`,matchHintNone:`Atticus derives one when you preview; where it can't, give one here (a path prefix such as /forge/limits/**, a host pattern or a topic pattern).`,preview:`Preview`,previewing:`Working out what it changes…`,save:`Save my correction`,saving:`Writing your correction…`,cancel:`Cancel`,needPick:`Pick the right answer first.`,needApi:`Pick the API and say its repo, or pick None of these.`,previewFirst:`Preview first: you see the rule and what it spreads to before anything is saved.`,changedSince:`The correction changed since the preview. Preview it again.`,approval:`Saving is your approval: the correction is recorded as your word, and its rule as yours.`,previewTitle:`What saving does`,yourAnswer:e=>`Your answer: ${e}`,rule:(e,t,n)=>n?`The rule derived from it (${e}): ${t}`:`Your rule (${e}): ${t}`,noRule:e=>`No rule spreads: ${e}`,spreadNone:`No other item is like it: only this one changes.`,spreadTitle:e=>`${e} other item${e===1?``:`s`} the rule re-checks`,spreadCaption:`What the rule does to each item like it`,change:{applied:`Applied`,confirmed:`Confirmed`,replaced:`Replaced`,reverted:`Reverted to open`},changeWhy:{applied:`an open item your rule answers`,confirmed:`the AI had decided the same`,replaced:`the AI had decided otherwise; your rule decides`,reverted:`the AI had decided otherwise and your rule can't decide it, so it is open again`},col:{item:`Item`,change:`What happens`,was:`Was`,now:`Now`},spreadCounts:e=>`${e.applied} applied, ${e.confirmed} confirmed, ${e.replaced} replaced, ${e.reverted} reverted to open.`,nothing:`—`,saved:e=>`Saved as your word: ${e}.`,savedBatch:e=>`Written as batch ${e}, one Undo away on Map › Decided by AI.`,whatSpread:`What your correction spread to`,savedFlash:(e,t)=>`Your correction is saved as your word: ${e}. Similar items: ${t.applied} applied, ${t.confirmed} confirmed, ${t.replaced} replaced, ${t.reverted} reverted to open.`,verify:`Bring the map up to it:`,commit:`Commit it for review:`,next:`Then bring the map up to it, and propose it for review:`,terminal:`Or in a terminal`,copy:e=>`Copy: ${e}`,makeRuleOffer:(e,t)=>`This shape has been corrected ${e} times (${t}). Make it a reading rule, so the next read gets it right at the source.`,makeRule:`Make this a reading rule`,makingRule:`Drafting the reading rule…`,ruleMade:e=>`Drafted the reading rule in ${e}. Turn it on with:`,ruleCommand:`Draft it in a terminal:`,batchesTitle:`Batches`,batchesIntro:`Every batch the AI or a person's rule applied, newest first. Undo removes exactly its lines and answers, and puts back what it took away.`,batchesEmpty:`No batch yet: nothing has been applied by AI or by a correction's rule.`,batchesCaption:`Batches applied, newest first, each with Undo`,batchKind:{ai:`By AI`,rule:`By a person's rule`,correction:`A person's correction`},batchCol:{batch:`Batch`,by:`Who and when`,what:`What it did`,undo:`Undo`},batchBy:(e,t)=>`${e}, ${t}`,batchApplied:(e,t)=>`${e} applied${t?`, ${t} reverted to open`:``}`,batchFrom:(e,t)=>`From the correction of ${e}: ${t}`,batchRule:(e,t)=>`Rule (${e}): ${t}`,undone:(e,t)=>`Undone by ${e} on ${t}`,undo:`Undo`,undoOf:e=>`Undo batch ${e}`,confirmUndo:(e,t)=>`Undo batch ${e}? It removes the ${t} line${t===1?``:`s`} and answer${t===1?``:`s`} it applied and puts back what it took away. Anything changed since is left as it is now.`,confirmYes:`Yes, undo it`,confirmNo:`Keep it`,undoing:`Undoing…`,undoneResult:(e,t,n)=>`Batch ${e} undone: removed ${t}, put back ${n}.`,skipped:`Left as it is now, because it changed since the batch:`,undoFailed:e=>`The batch couldn't be undone: ${e}`,record:e=>`Record: ${e}`,pausedTitle:`AI deciding is paused`,pausedWhy:e=>`${e} Until the audit is back above the bar, the AI only proposes.`,pausedLink:`See the audit on Map › Trust`,trustTitle:`AI decisions`,trustTally:e=>e.precision===null?`AI decisions: no audited answers yet`:`AI decisions: ${Math.round(e.precision*100)}% right (${e.right} of ${e.right+e.wrong}; 95% between ${Math.round((e.low??0)*100)}% and ${Math.round((e.high??0)*100)}%)`,trustBar:e=>`The bar is ${Math.round(e*100)}%: below it, the AI stops deciding and only proposes.`,trustOpen:`Open Decided by AI`,trustAudit:`ai decisions`,impactByAi:e=>`${e} of the callers that break ${e===1?`is`:`are`} linked only by AI; confirm or correct ${e===1?`its link`:`their links`} on Decided by AI.`,impactCaller:`every link of this caller was decided by AI`,answeredByAi:e=>`Answered by AI on ${e}`,matchApplied:e=>`Atticus applied ${e} pairing${e===1?``:`s`} as the AI's (they met the bar):`,matchKept:e=>`${e} kept as proposals for you:`,matchPaused:e=>`Not applied: AI deciding is paused. ${e}`,matchUndo:`Undo or correct them on Decided by AI`,betweenTitle:e=>`Paired by AI between these boxes (${e})`,whyLinked:`The AI paired this call with this entry, from a run Atticus started. No person has confirmed it, so it is inferred until someone does.`},setup:{title:`Set up Atticus here`,intro:e=>`${e} isn't a metarepo yet. Create one here, or open the folder of one you have.`,loading:`Looking at this folder…`,createTitle:`Create the metarepo here`,createWhat:`Atticus writes the org pack, openspec/ and the catalog folders here, makes the folder a Git repository if it isn't one, and pushes nothing. Propose it for review once your repos are in.`,name:`Name`,nameHint:`A lowercase slug, such as forge-payments: the org pack's name.`,platform:`Platform`,platformHint:`What its repos make up, as a slug, such as forge.`,owner:`Owner (optional)`,ownerHint:`Who looks after the org pack, normally the platform lead. Left out, it is a question for later.`,metarepoId:`The metarepo on your Git host (optional)`,metarepoIdHint:`Its repo there, such as forge-payments-metarepo. Read from this folder's origin when it is a clone. Propose for review and hand-offs open their PRs on it.`,badSlug:`A lowercase slug: letters, digits and - only, such as forge-payments.`,create:`Create the metarepo`,creating:`Creating…`,created:`The metarepo is made. Next: add your repos.`,openTitle:`Open another folder`,path:`Folder`,pathHint:`Its full path on this machine, such as C:\\work\\forge-metarepo.`,open:`Open it`,opening:`Opening…`,openedAt:e=>`Opening it at ${e}…`,terminal:`Or in a terminal`,preview:`Preview the change`,previewing:`Looking…`,willChange:e=>`${e} will change:`,diffLabel:e=>`Lines that change in ${e}`,removed:`removed`,added:`added`,nothingChanges:`Nothing would change.`,write:`Write it`,writing:`Writing…`,cancel:`Cancel`,written:e=>`${e} is written.`,thenPropose:`Propose it for review: a person merges the PR on the Git host.`,confirmAddress:`This moves where the model's key goes: Write it is your confirmation (as Save is in the AI settings).`,reposTitle:`Add repos`,reposIntro:`Paste clone URLs, one a line (up to 500 at once), or discover a folder of clones on this machine. You see the list before anything is written; then the manifest is proposed for review.`,pasteMode:`Paste clone URLs`,folderMode:`Discover a folder of clones`,modeLabel:`How`,urls:`Clone URLs`,urlsHint:`As your Git host shows them, such as https://dev.azure.com/forgeorg/Forge%20Payments/_git/forge-ledger. Credentials and a browser link's ?path= are taken out.`,dir:`Folder of clones`,dirHint:`Its full path. Every repo in it is read from its files, as atticus repos discover does.`,read:`Read the list`,reading:`Reading…`,platformLabel:`Platform`,platformNone:`Choose one`,choosePlatform:e=>`The org pack has ${e} platforms, and a folder's repos are one platform's: choose which, then read the folder.`,toAdd:e=>`${e} repo${e===1?``:`s`} to add`,colAdd:`Add`,colId:`Id`,colUrl:`Clone URL`,colType:`Type`,colAbout:`What it is (optional)`,addFor:e=>`Add ${e}`,aboutFor:e=>`What ${e} is`,normalised:e=>`From: ${e}`,renamed:(e,t)=>`${e} is taken (${t}), so this one is the id shown.`,listed:(e,t)=>`${e} is listed already, as ${t}: left out.`,refused:(e,t)=>`${e}: ${t}.`,skipped:e=>`${e} folder${e===1?``:`s`} looked at aren't repos.`,nothingNew:`Nothing new to add: the manifest lists all of them already.`,noneTicked:`Tick at least one repo to add.`,detect:`Detect the type`,detecting:`Reading its files…`,detectFor:e=>`Detect the type of ${e}`,detected:e=>`Its files say ${e}.`,detectedTypes:(e,t)=>t?`The org pack's repo types: a ${e} match for ${t}.`:`The org pack's repo types: ${e}.`,noType:`Nothing in its files settles a type: set one here.`,type:`Type`,typeFor:e=>`Type of ${e}`,setType:`Set the type`,typeHint:`Type it prototype for a prototype repo: Change › Prototypes compares it with the estate.`,adaptersTitle:`Outside systems`,adaptersIntro:`Where Atticus opens PRs, files work items and requests, and sends notifications. Manual: Atticus writes each step for a person with every field ready to copy, and records the result (the way to go when your Git host, ADO or ServiceNow has no API access from here). Each change is written to runtime.yaml, then proposed for review.`,kinds:{gitHost:`Git host`,workTracker:`Work tracker`,serviceDesk:`Service desk`,notify:`Notifications`,wiki:`Wiki`,design:`Design tool`},types:{manual:`Manual: a step for a person`,github:`GitHub`,"azure-repos":`Azure DevOps (Azure Repos)`,gitlab:`GitLab`,bitbucket:`Bitbucket`,"azure-devops":`Azure DevOps Boards`,jira:`Jira`,servicenow:`ServiceNow`,"jira-service-management":`Jira Service Management`,teams:`Microsoft Teams`,slack:`Slack`,email:`Email`,confluence:`Confluence`,"ado-wiki":`Azure DevOps wiki`,sharepoint:`SharePoint`,figma:`Figma`,mock:`Mock (for tests)`},notSet:`Not set`,typeOf:e=>`${e}: how it is reached`,fields:{metarepo:`The metarepo's repo on the Git host`,protectedBranches:`Protected branches (one a line)`,defaultBranch:`Default branch, when a repo doesn't say`,project:`Project`,idPattern:`Work item id pattern`,numberPattern:`Request number pattern`,exportDir:`Exported to (a folder of this metarepo)`},fieldHints:{metarepo:`Its id there, such as forge-payments-metarepo (Azure Repos) or forge/forge-metarepo (GitHub). Propose for review and hand-offs open their PRs on it.`,protectedBranches:`AI never pushes to these; the default branch always is one. Such as main and release.`},more:`Other settings the adapter's plugin reads (name: value, one a line)`,moreHint:`Values read as YAML: true, 3 and [a, b] are a yes, a number and a list; quote one to keep it words ("3"). Never a token or key: Atticus refuses one.`,adapterChanged:e=>`runtime.yaml changed since you started editing ${e} (another window, the raw editor or the CLI). Writing this would be refused: start again from the file as it is now, or make your edit there.`,adapterReload:`Start again from the file`,badLine:e=>`"${e}" doesn't read as name: value.`,live:e=>`${e} is a live adapter: its plugin goes in the org pack. Until it can be reached, its steps fall back to manual ones.`,secretTitle:`Tokens and keys`,secretWhy:`A token never goes in runtime.yaml or through the app. Keep it in this machine's credential store from your terminal, under the name the adapter's plugin reads:`,secretCommand:`atticus secret set <NAME>`,takeOut:`Take it out`,kindFor:e=>`${e}'s settings`,editInApp:`Edit in app`,editFile:e=>`Edit ${e} in the app`,rawTitle:e=>`Edit ${e}`,rawHint:`The whole file. It is checked with its schema before it is written, and only onto the file as you opened it.`,rawUnchecked:`No schema checks this file; YAML still has to parse.`,rawNew:`This file isn't there yet: Write it creates it.`,rawText:e=>`The text of ${e}`,close:`Close`,noForm:`No form for this yet: edit the file in the app, then propose it.`,rawPickTitle:`Edit a file of the org pack`,rawPick:`File`,rawPickHint:`A path inside org-pack/, such as gates.yaml or patterns/S.GW.SOR.yaml.`,patternTitle:`Add an integration pattern`,code:`Code`,codeHint:`Such as S.GW.NWP: a capital letter, then parts after dots.`,patternName:`Name`,definition:`What it is`,interaction:`Interaction`,route:`Route`,targetType:`Target`,controls:`Controls (comma-separated)`,source:`Where it is written down`,sourceHint:`A wiki page or a file, such as inputs/wiki/integration-patterns.md.`,status:`Status`,wikiTitle:`Add a wiki`,wikiType:`Type`,location:`Where it is`,locationHint:`A folder of this metarepo, a Git repository's URL or a wiki's https:// address.`,wikiPath:`Pages folder (git only)`,wikiRef:`Branch or tag (git only)`,aiAdapters:`Outside systems are set on Set up › Settings, and here:`,settingsEdit:`Edit, then Propose: each change is a file you propose for review`,runtimeOnAi:`The modes, assistants, models and AI decides are edited on Set up › AI.`,openAi:`Open Set up › AI`,addReposLink:`Add repos in the app (Set up › Repos)`},roleWork:{asks:{business:`business`,design:`design`,delivery:`delivery`},asksChip:e=>`Asks about ${e}`,routeLabel:`Send it to`,routePick:`Pick who answers it`,route:`Send`,routing:`Sending…`,routed:e=>`Sent to ${e}: it is on their Questions and Home now.`,routedFrom:(e,t,n)=>`Moved from ${e} by ${t} on ${n}.`,noRole:`no role`,ownersTitle:`Who is on this change`,ownersIntro:`Who answers each role's questions and reviews its hand-off. Saved in the change's file, it goes with the change's next hand-off.`,nobody:`Nobody yet`,editOwners:`Change who is on it`,cancelOwners:`Cancel`,saveOwners:`Save who is on it`,suggestedTitle:`Suggested`,suggestedFromTeam:(e,t)=>`from ${e}, which owns ${t}`,suggestedDefault:`the organisation's usual person for this role`,accept:`Accept`,acceptFor:(e,t)=>`Accept ${e} as ${t}`,accepted:(e,t)=>`${e} is the ${t} on this change now.`,noSuggestion:`Nobody to suggest:`,waitsOn:(e,t)=>`Waits on: ${e} (${t})`,waitsOnReview:`to review and approve its hand-off`,waitsOnWork:`for this phase's work`,waitsOnNobody:e=>`Waits on the ${e}, but nobody is named for it yet. Name them under Who is on this change.`,roleNames:{"product-owner":`product owner`,architect:`architect`,"business-analyst":`business analyst`,"team-lead":`tech lead`},workItems:{title:`Work items in the tracker`,intro:`Each story and its tasks go into your work tracker (Azure DevOps or another) as work items. Atticus keeps the id each one gets, so a later update changes it instead of making a second one.`,none:`No work tracker is set up yet. Set one up on Set up › Adapters (manual works with no connection: each work item is a step for you).`,manual:`Your work tracker is manual here: each work item is a step on Home › Manual steps with every field to copy (title, description, acceptance criteria, parent). Create it in the tracker, then record the id it got on the step.`,live:`Atticus writes them to your work tracker on your click, and keeps each id.`,push:`Put them in the work tracker`,pushLive:`Put them in the work tracker (asks you to confirm)`,update:`Update them in the work tracker`,pushing:`Putting them in…`,story:e=>`Story: ${e}`,feature:e=>`Feature: ${e}`,task:e=>`Task: ${e}`,created:`in the tracker`,waiting:`step waiting on you`,toCreate:`not in the tracker yet`,changed:`changed since: update it`,gone:`no longer planned (left as it is)`,openStep:`Open the step`,empty:`The stories aren't written yet: they appear here once the stories stage has drafted them.`,cantRead:e=>`The work items couldn't be listed: ${e}`},shape:{title:`Shape the stories`,intro:`Rename, split, merge or add a story in your own words. The AI then puts each task under the story it belongs to when the stories are drafted again, and the check makes sure no story is left without a task and no task without a story.`,op:`What to do`,ops:{rename:`Rename a story`,split:`Split a story`,merge:`Merge stories`,add:`Add a story`},story:`Story`,stories:`Stories to merge (the first keeps its number)`,name:`Its name`,firstName:`The first part's name`,words:`What it is for (optional)`,part:`The other part's name`,partWords:`What the other part is for (optional)`,record:`Save`,recording:`Saving…`,recorded:`Saved. Draft the stories again on this tab and the AI maps the tasks to them; until then the stories are as they were.`,waiting:`waits for the next draft`,applied:`in the stories`,remove:`Take back`,removeFor:e=>`Take back: ${e}`,entry:{rename:(e,t)=>`Rename ${e} to "${t}"`,split:(e,t)=>`Split ${e} into ${t}`,merge:(e,t)=>`Merge ${e} into "${t}"`,add:(e,t)=>`Add ${e}: "${t}"`},uncovered:`Not covered yet`,allCovered:`Every story has a task, and every task a story.`,none:`Nothing shaped yet: the stories are one per flow the change changes.`,notDrafted:`The stories aren't drafted yet: shape them once the stories stage has drafted them.`,needStory:`Pick the story first.`,needTwo:`Pick two or more stories to merge.`,needPart:`Name the other part.`},lens:{true:`Is it true?`,complete:`Is it complete?`,safe:`Is it safe?`,ship:`Can it ship?`,business:`Business`,architecture:`Design`,story:`Stories`,ux:`Screens`,delivery:`Delivery`,"code-and-test":`Code and tests`,release:`Release`},passage:{open:`Read it here`,from:(e,t)=>`From ${e} (${t})`,quote:`The words it rests on`,details:`Details`,path:`Where the file is`,none:`Its page couldn't be read just now; it is listed by name only.`},ask:{knowledge:`From your organisation's knowledge`,knowledgeIntro:`What your wikis and documents say, found by the question's words. Each is quoted with where it is from; Atticus doesn't word an answer of its own here.`,items:`Knowledge items`,passages:`Pages`,none:`Nothing in your wikis or documents (inputs/) shares this question's words.`,askAi:`To have your assistant word an answer from these, citing them:`,catalogNone:`Nothing in the catalog answers it.`},send:{button:e=>`Send to ${e}`,sending:`Sending…`,sent:e=>`Sent to ${e}. Record their answer here when it comes.`,again:e=>`Send to ${e} again`,already:e=>`It was already sent to ${e} (its record in the metarepo says so), so it wasn't sent twice. Send it again only if they need it once more.`,beingSent:e=>`It is being sent to ${e} now, from another tab or window, so it wasn't sent twice.`,confirmAgain:(e,t)=>`It was sent${t?` on ${t}`:``}. Send it to ${e} again?`,yesAgain:`Yes, send it again`,cancel:`Cancel`,step:`Notifications are manual here: sending it is a step for you on Home › Manual steps.`,notSent:e=>`Not sent: ${e}`},brief:{title:`The brief`,intro:`What the change is for, in your words. Each box is one part of the brief; the hint under it says what goes there.`,edit:`Edit the brief`,draftKept:`Your unsaved draft, as you left it: Save the brief to keep it, or Cancel.`,save:`Save the brief`,saving:`Saving…`,saved:`Saved the brief.`,cancel:`Cancel`,details:`Details`,file:e=>`Saved as ${e}`,changed:`Someone changed the brief since you opened it: open it again to see their words.`,empty:`Not written yet.`,write:`Write the brief`},home:{yourChanges:`Your changes`,yourChangesIntro:e=>`The changes you are on as ${e}, and what waits on you.`,waitsOnYou:`waits on you`,waitsOnOther:e=>`waits on ${e}`,noneYours:`No change in flight names you yet.`,admin:`Setting up Atticus`,adminIntro:`Setting up, upgrading and the catalog's checks. The people who look after Atticus here deal with these.`,designWaits:e=>`${e} design finding${e===1?` waits`:`s wait`} for the architect; ${e===1?`it doesn't`:`they don't`} hold the brief.`}},explorer:{title:`Estate`,label:`Explorer`,filter:`Filter the explorer`,filterPlaceholder:`Filter`,sections:{changes:`Changes in flight`,systems:`Systems`,questions:`Questions`,pinned:`Pinned`},empty:{changes:`No changes in flight`,systems:`No systems read yet`,questions:`No open questions`,pinned:`Nothing pinned yet. Pin a page to keep it here.`},loading:e=>`Loading ${e.toLowerCase()}…`,couldntLoad:e=>`Couldn't load: ${e}`,retry:`Retry`,count:e=>`${e}`,repos:e=>`${e} repo${e===1?``:`s`}`,reposOnMap:(e,t)=>`${e} of ${t} repo${t===1?``:`s`} on the map`,notOnMap:`Not on the map`,notInManifest:`not in the manifest`,alsoOffManifest:(e,t)=>`${e}, ${t} more not in the manifest`,noRepo:`no repo`,components:e=>`${e} component${e===1?``:`s`}`,waitsOnYou:`waits on you`,spoken:(...e)=>e.join(`, `),items:e=>`${e} item${e===1?``:`s`}`,kinds:{lib:`lib`,gw:`gw`,outside:`outside`},kindWords:{lib:`library`,gw:`gateway`,outside:`outside the estate`},ownerQuestions:`Owner questions`,pin:`Pin`,pinHere:e=>`Pin this page: ${e}`,unpinHint:`Delete unpins it`,pageLabel:(...e)=>e.join(` › `),stages:{draft:`draft`,define:`define`,design:`design`,plan:`plan`,build:`build`,qa:`qa`,"release-ready":`release`,"post-release-review":`review`,returned:`returned`}}},T=/^#\/[a-z][a-z0-9-]*(\/[^?\s]*)?(\?[^\s]*)?$/,E=e=>typeof e==`object`&&!!e,D=6e4,ee=66e4,te=36e5,ne=6e5;function O(e,t,n=D,r=ee){let i=0,a=new Map,o=new Map,s=new Map,c=new Set,l=[];return t(e=>{if(E(e)){if(e.type===`api-reply`&&typeof e.id==`number`){let t=a.get(e.id);a.delete(e.id),t?.({status:Number(e.status),body:e.body})}else if(e.type===`save-reply`&&typeof e.id==`number`){let t=s.get(e.id);s.delete(e.id),t?.(e.state===`saved`||e.state===`cancelled`?e.state:`failed`)}else if(e.type===`run-progress`&&typeof e.id==`number`)typeof e.line==`string`&&o.get(e.id)?.onLine(e.line);else if(e.type===`run-end`&&typeof e.id==`number`){let t=o.get(e.id);o.delete(e.id),t?.done({state:typeof e.state==`string`?e.state:`failed`,lines:Array.isArray(e.lines)?e.lines.filter(e=>typeof e==`string`):[],...typeof e.runId==`string`?{runId:e.runId}:{}})}else if(e.type===`event`&&E(e.event)&&typeof e.event.type==`string`)for(let t of c)t(e.event);else if(e.type===`navigate`&&typeof e.hash==`string`&&T.test(e.hash))for(let t of l)t(e.hash)}}),{call(t,o){let s=++i,c=!o.method||o.method===`GET`?n:r;return new Promise(n=>{let r=setTimeout(()=>{a.delete(s)&&n({status:504,body:{type:`about:blank`,title:w.bridge.noAnswer,status:504,detail:w.bridge.noAnswerTo(t,Math.round(c/1e3))}})},c);a.set(s,e=>{clearTimeout(r),n(e)}),e({type:`api`,id:s,method:o.method,path:t,...o.body===void 0?{}:{body:o.body}})})},runStep(t,n){let r=++i;return new Promise(i=>{let a,s=()=>{clearTimeout(a),a=setTimeout(()=>{o.delete(r)&&i({state:`failed`,lines:[w.bridge.stepSilent]})},te)};s(),o.set(r,{onLine:e=>{s(),n(e)},done:e=>{clearTimeout(a),i(e)}}),e({type:`run-step`,id:r,args:t})})},saveFile(t,n,r){let a=++i;return new Promise(i=>{let o=setTimeout(()=>{s.delete(a)&&i(`failed`)},ne);s.set(a,e=>{clearTimeout(o),i(e)}),e({type:`save-file`,id:a,name:t,data:n,encoding:r})})},onEvent(e){return c.add(e),()=>c.delete(e)},onNavigate(e){l.push(e)}}}function re(e){return t=>{if(!(t.button!==0||t.ctrlKey||t.metaKey||t.shiftKey||t.altKey))for(let n of t.composedPath()){let t=n;if(t.tagName?.toLowerCase()!==`a`)continue;let r=t.getAttribute?.(`href`);r&&T.test(r)&&e(r);return}}}var k;function A(){if(k!==void 0)return k??void 0;let e=globalThis.acquireVsCodeApi;if(typeof e!=`function`||typeof window>`u`){k=null;return}let t=e();return k=O(e=>t.postMessage(e),e=>window.addEventListener(`message`,t=>e(t.data))),k.onNavigate(e=>{location.hash!==e&&(location.hash=e)}),window.addEventListener(`click`,re(e=>{location.hash!==e&&(location.hash=e)})),k}var ie=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),j=o(((e,t)=>{t.exports=ie()}))(),ae,oe=new Set;function se(e){ae=e;for(let e of oe)e()}function ce(){let[,e]=(0,v.useState)(0);if((0,v.useEffect)(()=>{let t=()=>e(e=>e+1);return oe.add(t),()=>{oe.delete(t)}},[]),!ae)return null;let t=ae;return(0,j.jsxs)(`div`,{role:`status`,className:`row`,style:{gap:8,alignItems:`center`,margin:`0 0 8px`},children:[(0,j.jsx)(`span`,{children:t.text}),t.href&&t.link&&(0,j.jsx)(`a`,{href:t.href,onClick:()=>se(void 0),children:t.link}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>se(void 0),children:w.app.dismiss})]})}var M=class extends Error{problem;constructor(e){super(e.detail??e.title),this.problem=e}},le;function ue(){return le?le.token:typeof document>`u`?``:document.querySelector(`meta[name="atticus-token"]`)?.content??``}var de=()=>le?.pageKey,fe=e=>e.replace(/</g,`<`).replace(/"/g,`"`).replace(/&/g,`&`);function pe(e){let t=t=>{let n=RegExp(`<meta name="${t}" content="([^"]*)"\\s*/?>`).exec(e);return(n?fe(n[1]):``)||void 0},n=t(`atticus-token`),r=t(`atticus-page-key`);return{...n?{token:n}:{},...n&&r?{pageKey:r}:{}}}var me=!1,he=()=>me,ge,_e=!1,ve=()=>_e,ye=`unknown`,be=e=>{let t=e&&typeof e==`object`?e:{},n=t.rootKey;if(typeof n==`string`&&n)return n;let r=t.root;return typeof r==`string`&&r?r:void 0},xe=new EventTarget;function Se(e){let t=t=>e(t.detail);return xe.addEventListener(`session`,t),()=>xe.removeEventListener(`session`,t)}var Ce=e=>{me=e===`stale`,xe.dispatchEvent(new CustomEvent(`session`,{detail:e}))},we;function Te(){return we??=(async()=>{let e=ue();try{let t=await fetch(`/`,{method:`GET`,cache:`no-store`,credentials:`same-origin`,headers:{Accept:`text/html`}});if(!t.ok)return!1;let n=pe(await t.text());return!n.token||n.token===e?!1:(ye=await Ee(n.token),ye===`other`?(_e=!0,Ce(`stale`),!1):(le={token:n.token,...n.pageKey?{pageKey:n.pageKey}:{}},De(`atticus-token`,n.token),n.pageKey&&De(`atticus-page-key`,n.pageKey),Ce(`renewed`),!0))}catch{return!1}})().finally(()=>{we=void 0}),we}async function Ee(e){if(ge===void 0)return`unknown`;try{let t=await fetch(`/api/health`,{method:`GET`,cache:`no-store`,headers:{"X-Atticus-Token":e}});if(!t.ok)return`unknown`;let n=be(Ie(await t.text(),t.status));return n===void 0?`unknown`:n===ge?`same`:`other`}catch{return`unknown`}}function De(e,t){if(typeof document>`u`)return;let n=document.querySelector(`meta[name="${e}"]`);n&&(n.content=t)}async function Oe(e,t=!1){return _e?!1:ue()!==e||await Te()?!t||ye===`same`||`not-sent`:(me||Ce(`stale`),!1)}var ke=(e,t)=>e===401&&!!t&&typeof t==`object`&&t.title===`Missing or wrong session token`;function Ae(e=!1){return{type:`about:blank`,title:`Server not answering`,status:0,detail:e?w.app.offlinePanel:w.app.offline}}var je=`atticus:server`,Me=!1;function Ne(e){e!==!Me&&(Me=!e,typeof dispatchEvent==`function`&&dispatchEvent(new CustomEvent(je,{detail:{up:e}})))}function Pe(e){let t=(0,v.useRef)(e);t.current=e,(0,v.useEffect)(()=>{if(typeof addEventListener!=`function`)return;let e=e=>{e.detail.up&&t.current()};return addEventListener(je,e),()=>removeEventListener(je,e)},[])}var Fe=e=>e===w.app.offline||e===w.app.offlinePanel;function Ie(e,t){if(e)try{return JSON.parse(e)}catch{throw new M({type:`about:blank`,title:`Not an Atticus answer`,status:t,detail:w.app.notJson(t)})}}function Le(e,t,n){let r=e&&typeof e==`object`?e:{},i=e=>typeof e==`string`&&e.trim()?e.trim():void 0;if(i(r.detail)||i(r.title))return{...r,type:i(r.type)??`about:blank`,status:t};let a=i(r.error)??i(r.message)??i(n)??``;return{type:`about:blank`,title:i(n)??`Request failed`,status:t,detail:w.app.serverAnswered(t,a)}}var Re=`The Atticus app isn't answering`,ze=`atticus:busy`,Be=0,Ve=()=>Be,He=e=>{Be=Math.max(0,Be+e),typeof window<`u`&&window.dispatchEvent(new CustomEvent(ze,{detail:Be}))},Ue=new EventTarget,We=`atticus:wrote`,Ge=e=>(Ue.addEventListener(We,e),()=>Ue.removeEventListener(We,e)),Ke=0,qe=()=>{Ke++};function Je(){let e=new Map,t=(t,n,r,i)=>{let a=new AbortController,o={ctl:a,waiters:0,sent:!1,dead:!1,seq:Ke};o.promise=(async()=>(i&&await i.catch(()=>void 0),o.sent=!0,o.seq=Ke,r(a.signal)))();let s=()=>{n.current===o?(n.current=n.next,n.next=void 0):n.next===o&&(n.next=void 0),!n.current&&!n.next&&e.get(t)===n&&e.delete(t)};return o.promise.then(s,s),o};return function(n,r,i,a={}){if(i?.aborted)return Promise.reject(new DOMException(`Aborted`,`AbortError`));let o=e.get(n);o||e.set(n,o={});let s=e=>e&&!e.dead?e:void 0;o.current?.dead&&(o.current=s(o.next),o.next=void 0),o.next?.dead&&(o.next=void 0);let c,l=o.current;c=l&&(!l.sent||!a.after&&l.seq===Ke)?l:l?s(o.next)??(o.next=t(n,o,r,l.promise)):o.current=t(n,o,r),c.waiters++;let u=c;return i?new Promise((e,t)=>{let n=!1,r=()=>{n||(n=!0,t(new DOMException(`Aborted`,`AbortError`)),--u.waiters===0&&(u.dead=!0,u.ctl.abort()))};i.addEventListener(`abort`,r,{once:!0}),u.promise.then(t=>{n||(n=!0,i.removeEventListener(`abort`,r),e(t))},e=>{n||(n=!0,i.removeEventListener(`abort`,r),t(e))})}):u.promise}}var Ye=Je();async function N(e,t={}){let n=!!t.method&&t.method!==`GET`;if(!n&&t.body===void 0){let n=Ye(e,t=>Qe(e,{signal:t,quiet:!0}),t.signal,t.after?{after:!0}:{});return t.quiet?n:(He(1),n.finally(()=>He(-1)))}qe();try{let r=await Qe(e,t);return qe(),n&&Ue.dispatchEvent(new Event(We)),r}catch(e){throw qe(),n&&Xe(e).length&&Ue.dispatchEvent(new Event(We)),e}}function Xe(e){let t=e instanceof M?e.problem.written:void 0;return Array.isArray(t)?t.filter(e=>!!e&&typeof e.repo==`string`&&typeof e.file==`string`):[]}async function Ze(e,t={},n=e=>new Promise(t=>setTimeout(t,e))){let r=await N(e,{method:`POST`,body:{...t,job:!0}}),i=r&&typeof r==`object`?r.jobId:void 0;if(typeof i!=`string`)return r;for(;;){let e=await N(`/api/jobs/${encodeURIComponent(i)}`,{quiet:!0});if(e.state!==`running`&&e.state!==`queued`){if(e.state===`done`&&e.result&&`answer`in e.result)return Ue.dispatchEvent(new Event(We)),e.result.answer;let t=e.result?.problem;if(t)throw new M(Le(t,typeof t.status==`number`?t.status:422,``));let n=(e.result?.lines?.length?e.result.lines:e.errors??[]).join(` `);throw new M({type:`about:blank`,title:w.app.jobEnded(e.state,``),status:500,detail:w.app.jobEnded(e.state,n)})}await n(700)}}async function Qe(e,t){if(t.quiet)return $e(e,t);He(1);try{return await $e(e,t)}finally{He(-1)}}async function $e(e,t,n=!1){let r=A();if(r){let n=await r.call(e,{method:t.method??`GET`,...t.body===void 0?{}:{body:t.body}});if(t.signal?.aborted)throw new DOMException(`Aborted`,`AbortError`);if(n.status===503&&n.body?.title===Re)throw Ne(!1),new M(Ae(!0));if(Ne(!0),n.status<200||n.status>=300)throw new M(Le(n.body,n.status,``));return n.body}let i,a,o=ue();try{i=await fetch(e,{method:t.method??`GET`,headers:{"X-Atticus-Token":o,...t.body===void 0?{}:{"Content-Type":`application/json`}},...t.body===void 0?{}:{body:JSON.stringify(t.body)},...t.signal?{signal:t.signal}:{}}),a=await i.text()}catch(e){throw t.signal?.aborted?e:(Ne(!1),new M(Ae()))}Ne(!0);let s=Ie(a,i.status);if(i.ok&&ge===void 0&&e===`/api/health`&&!_e&&(ge=be(s)),ke(i.status,s)&&!n&&!t.signal?.aborted){let n=await Oe(o,!!t.method&&t.method!==`GET`&&t.method!==`HEAD`);if(n===!0)return $e(e,t,!0);if(n===`not-sent`)throw new M({type:`about:blank`,title:w.app.notResentTitle,status:409,detail:w.app.notResent})}else i.ok&&me&&!_e&&ue()===o&&Ce(`renewed`);if(!i.ok)throw new M(Le(s,i.status,i.statusText));return s}var et=new Map,tt=new Map;function nt(e,t){let n=et.get(e);if(n){tt.set(e,t);for(let e of n)e(t)}}function rt(e){let[t,n]=(0,v.useState)(()=>tt.get(e));return(0,v.useEffect)(()=>{let t=e=>n(e),r=et.get(e)??new Set;return r.add(t),et.set(e,r),tt.has(e)&&n(tt.get(e)),()=>{r.delete(t)}},[e]),t}var it=nt,at=new Map;function ot(e){return at.set(e,(at.get(e)??0)+1),()=>{let t=(at.get(e)??1)-1;t>0?at.set(e,t):at.delete(e)}}var st=e=>(at.get(e)??0)>0;function P(e,t={}){let n=t.load,r=e===void 0?void 0:t.view??e,[i,a]=(0,v.useState)({s:{state:`loading`}}),o=(e,t)=>a({s:e,for:t}),[s,c]=(0,v.useState)(0),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(),p=(0,v.useCallback)(()=>c(e=>e+1),[]),m=(0,v.useRef)(!1);return(0,v.useEffect)(()=>e?ot(e):void 0,[e]),(0,v.useEffect)(()=>{if(!e)return;let t=new AbortController;return m.current&&u(!0),(n?n(e,t.signal):N(e,{signal:t.signal})).then(n=>{t.signal.aborted||(o({state:`ready`,data:n},r),nt(e,n))},e=>{t.signal.aborted||o({state:`error`,error:e instanceof Error?e.message:String(e),...e instanceof M&&e.problem.notYet?{notYet:!0}:{},...e instanceof M&&e.problem.status?{status:e.problem.status}:{}},r)}).finally(()=>{t.signal.aborted||(m.current=!0,u(!1),f(Date.now()))}),()=>t.abort()},[e,s,n]),{...i.for===r&&r!==void 0?i.s:{state:`loading`},reload:p,refreshing:l,...d===void 0?{}:{at:d}}}var ct=e=>e.type===`file.changed`||e.type===`run.changed`||e.type===`index.rebuilt`;function lt(...e){let t=(0,v.useRef)(e);t.current=e,ut(()=>{for(let e of t.current)e?.reload()})}function ut(e,t=250,n={}){let r=(0,v.useRef)(e);r.current=e;let i=(0,v.useRef)({events:[],first:0});(0,v.useEffect)(()=>()=>{clearTimeout(i.current.timer)},[]);let a=!!n.jobs;St(e=>{if(!ct(e)&&!(a&&e.type===`job.done`))return;let n=i.current,o=Date.now();n.events.length||(n.first=o),n.events.push(e),clearTimeout(n.timer),n.timer=setTimeout(()=>{let e=n.events;n.events=[],n.timer=void 0,e.length&&r.current(e)},o-n.first>2e3?0:t)})}var dt=e=>e.some(e=>{if(e.type===`index.rebuilt`)return!0;if(e.type!==`file.changed`)return!1;if(typeof e.catalog==`boolean`)return e.catalog;let t=typeof e.path==`string`?e.path.replace(/^\.\//,``):``;return!t||!t.includes(`/`)||/(^|\/)(catalog|org-pack)(\/|$)/.test(t)}),ft=(e,t)=>e.some(e=>{if(e.type!==`file.changed`)return!1;let n=typeof e.path==`string`?e.path.replace(/^\.\//,``):``;return!n||!n.includes(`/`)||t.test(n)});function pt(e,t,n={}){let r=n.wait??(e=>new Promise(t=>setTimeout(t,e))),i=!1;return{stop:()=>{i=!0},finished:(async()=>{for(;!i;){let a;try{a=await N(`/api/jobs/${encodeURIComponent(e)}`,{quiet:!0})}catch(e){i||n.onError?.(e);return}if(i||(t(a),a.state!==`running`&&a.state!==`queued`))return;await r(n.everyMs??1500)}})()}}function mt(e,t,n){let r=(0,v.useRef)({onJob:t,onError:n});r.current={onJob:t,onError:n},(0,v.useEffect)(()=>{if(!e)return;let t=pt(e,e=>r.current.onJob(e),{onError:e=>r.current.onError?.(e)});return()=>t.stop()},[e])}var ht=2e3,gt=1e4,_t={listeners:new Set,ws:void 0,wait:500,retry:void 0,linger:void 0};function vt(e){(ct(e)||e.type===`job.done`)&&qe()}function yt(){if(_t.ws||!_t.listeners.size)return;let e=new URL(`/api/events`,location.href);e.protocol=e.protocol===`https:`?`wss:`:`ws:`,e.searchParams.set(`token`,ue());let t=new WebSocket(e);_t.ws=t;let n=!1;t.onmessage=e=>{let t;try{t=JSON.parse(String(e.data))}catch{return}vt(t);for(let e of[..._t.listeners])try{e(t)}catch{}},t.onopen=()=>{n=!0,_t.wait=500},t.onclose=()=>{if(_t.ws!==t||(_t.ws=void 0,!_t.listeners.size))return;let e=_t.wait;_t.wait=Math.min(_t.wait*2,gt),_t.retry=setTimeout(()=>{_t.retry=void 0,n?yt():Te().finally(yt)},e)}}function bt(){clearTimeout(_t.retry),_t.retry=void 0;let e=_t.ws;_t.ws=void 0,_t.wait=500,e?.close()}function xt(e){return _t.listeners.add(e),clearTimeout(_t.linger),_t.linger=void 0,yt(),()=>{_t.listeners.delete(e)&&!_t.listeners.size&&(clearTimeout(_t.linger),_t.linger=setTimeout(()=>{_t.linger=void 0,_t.listeners.size||bt()},ht))}}function St(e){let t=(0,v.useRef)(e);t.current=e,(0,v.useEffect)(()=>{let e=A();return e?e.onEvent(e=>{vt(e),t.current(e)}):xt(e=>t.current(e))},[])}function Ct(){let[e,t]=(0,v.useState)(Ve());return(0,v.useEffect)(()=>{let e=e=>t(e.detail);return addEventListener(ze,e),()=>removeEventListener(ze,e)},[]),(0,j.jsx)(`div`,{className:`loading-bar${e>0?` on`:``}`,"aria-hidden":e===0,children:e>0&&(0,j.jsx)(`div`,{role:`progressbar`,"aria-label":w.app.loading,"aria-busy":`true`,className:`loading-bar-run`})})}function wt(){return(0,j.jsx)(`div`,{className:`loading-bar inline on`,"aria-hidden":`true`,children:(0,j.jsx)(`div`,{className:`loading-bar-run`})})}function Tt(){let e=0;return{start(){let t=++e;return()=>t===e},drop(){e++}}}var Et=w.common;function Dt(e){return t=>{t.key!==`Escape`||t.defaultPrevented||t.nativeEvent.isComposing||(t.preventDefault(),t.stopPropagation(),e())}}var Ot=new Set([`checkbox`,`radio`,`range`,`button`,`submit`,`reset`,`color`,`file`,`image`]);function kt(e){return e?e.isContentEditable||e.tagName===`TEXTAREA`?!0:e.tagName===`INPUT`&&!Ot.has(String(e.type??`text`).toLowerCase()):!1}function At(e){let t=(0,v.useId)();return(0,j.jsxs)(`figure`,{style:{margin:0},children:[(0,j.jsx)(`figcaption`,{id:t,className:`hud`,children:e.caption}),(0,j.jsx)(`pre`,{className:`mono`,tabIndex:0,role:`region`,"aria-labelledby":t,style:{whiteSpace:`pre-wrap`,overflowWrap:`anywhere`,margin:0,...e.fontSize?{fontSize:e.fontSize}:{}},children:(0,j.jsx)(`code`,{children:e.children})})]})}function jt(e,t=typeof document>`u`?void 0:document){if(!e||!t)return!1;let n=t.activeElement;return n&&n!==t.body?!1:(e.focus({preventScroll:!1}),!0)}function F(e){let t=e.labelledBy??(e.title?`p-${e.title.toLowerCase().replace(/[^a-z0-9]+/g,`-`)}`:void 0);return(0,j.jsxs)(`section`,{className:`panel ${e.kind??``}${e.className?` ${e.className}`:``}`,"aria-labelledby":e.title?t:void 0,style:{gridColumn:e.span,gridRow:e.rows},children:[e.title&&(0,j.jsxs)(`div`,{className:`row between`,style:{marginBottom:10},children:[(0,j.jsx)(`h2`,{id:t,className:`h`,children:e.title}),e.meta&&(0,j.jsx)(`span`,{className:`hud`,children:e.meta})]}),e.children]})}function I(e){return e.of.state===`loading`?(0,j.jsxs)(`div`,{className:`stack`,"aria-busy":`true`,"aria-live":`polite`,children:[(0,j.jsx)(wt,{}),(0,j.jsx)(`span`,{className:`sr`,children:w.app.loading}),(0,j.jsx)(`div`,{className:`skeleton`,style:{width:`80%`}}),(0,j.jsx)(`div`,{className:`skeleton`,style:{width:`60%`}}),(0,j.jsx)(`div`,{className:`skeleton`,style:{width:`70%`}})]}):e.of.state===`error`&&e.of.notYet?(0,j.jsx)(`div`,{className:`state`,children:e.of.error}):e.of.state===`error`?(0,j.jsx)(Mt,{error:e.of.error,retry:e.of.reload}):e.empty?.(e.of.data)?e.emptyContent===void 0?(0,j.jsx)(`div`,{className:`state`,children:e.emptyText??Et.nothingHereYet}):(0,j.jsx)(j.Fragment,{children:e.emptyContent}):(0,j.jsx)(j.Fragment,{children:e.children(e.of.data)})}function Mt({error:e,retry:t}){return Fe(e)?(0,j.jsx)(`div`,{className:`state muted`,children:w.app.notLoadedOffline}):(0,j.jsxs)(`div`,{className:`state error`,role:`alert`,children:[(0,j.jsx)(`p`,{style:{margin:0},children:w.app.cantLoad(Fe(e)?w.app.offlineShort:e)}),t&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,style:{marginTop:8},onClick:t,children:w.app.tryAgain})]})}function Nt({change:e}){return(0,j.jsx)(`a`,{className:`glance-link`,href:`#/cockpit?change=${encodeURIComponent(e)}`,children:w.changes.seeGlance})}function Pt({href:e,children:t}){return/^https?:\/\//i.test(e.trim())?(0,j.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer noopener`,children:[t,(0,j.jsxs)(`span`,{className:`sr`,children:[` `,w.app.newTab]})]}):(0,j.jsx)(`span`,{title:e,children:t})}function Ft(e){let[t,n]=(0,v.useState)(!1);return(0,j.jsxs)(`span`,{className:`row`,style:{gap:8,flexWrap:`wrap`},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:e.of.refreshing,onClick:()=>{n(!0),(e.run??e.of.reload)()},children:e.of.refreshing?w.app.checking:e.label}),(0,j.jsx)(`span`,{role:`status`,className:`muted`,style:{fontSize:12},children:t&&!e.of.refreshing&&e.of.at?w.app.checkedAt(new Date(e.of.at).toTimeString().slice(0,8)):``})]})}function It(e){let t=e.size??56,n=t/2-5,r=2*Math.PI*n,i=e.max>0?Math.min(e.value/e.max,1):0;return(0,j.jsxs)(`svg`,{role:`img`,"aria-label":e.label,width:t,height:t,viewBox:`0 0 ${t} ${t}`,children:[(0,j.jsx)(`circle`,{cx:t/2,cy:t/2,r:n,fill:`none`,stroke:`var(--track)`,strokeWidth:4}),(0,j.jsx)(`circle`,{cx:t/2,cy:t/2,r:n,fill:`none`,stroke:e.color??`var(--accent)`,strokeWidth:4,strokeLinecap:`round`,strokeDasharray:`${r*i} ${r}`,transform:`rotate(-90 ${t/2} ${t/2})`,style:{filter:`drop-shadow(0 0 var(--glow-size) ${e.color??`var(--accent)`})`}}),(0,j.jsx)(`text`,{x:t/2,y:t/2+5,textAnchor:`middle`,fill:`var(--text)`,fontFamily:`Rajdhani, sans-serif`,fontWeight:700,fontSize:t/4,children:e.text??`${e.value}/${e.max}`})]})}function Lt(e){let t=e.parts.reduce((e,t)=>e+t.value,0),n=2*Math.PI*26,r=0;return(0,j.jsxs)(`div`,{className:`row`,style:{gap:12},children:[(0,j.jsxs)(`svg`,{role:`img`,"aria-label":`${e.title}: ${e.parts.map(e=>`${e.label} ${e.value}`).join(`, `)}`,width:70,height:70,viewBox:`0 0 70 70`,children:[(0,j.jsx)(`circle`,{cx:35,cy:35,r:26,fill:`none`,stroke:`var(--track)`,strokeWidth:10}),e.parts.map(e=>{let i=t?e.value/t*n:0,a=(0,j.jsx)(`circle`,{cx:35,cy:35,r:26,fill:`none`,stroke:e.color,strokeWidth:10,strokeDasharray:`${i} ${n}`,strokeDashoffset:-r,transform:`rotate(-90 35 35)`},e.label);return r+=i,a})]}),(0,j.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0,display:`flex`,flexDirection:`column`,gap:5,fontSize:11.5},children:e.parts.map(e=>(0,j.jsxs)(`li`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`span`,{"aria-hidden":`true`,style:{width:8,height:8,borderRadius:2,background:e.color}}),e.label,` `,e.value]},e.label))})]})}function Rt(e){let t=e.max>0?Math.round(e.value/e.max*100):0;return(0,j.jsx)(`div`,{role:`img`,"aria-label":Et.of(e.label,e.value,e.max),className:`track`,children:(0,j.jsx)(`span`,{style:{width:`${t}%`,background:e.color,boxShadow:e.color?`0 0 10px ${e.color}`:void 0}})})}var zt=w.copilotRuns,Bt=(0,v.createContext)(void 0),Vt=()=>(0,v.useContext)(Bt),Ht=5e3,Ut=e=>e.lines.length>5e3?{...e,from:e.from+e.lines.length-Ht,lines:e.lines.slice(-5e3)}:e;function Wt(e,t,n,r,i){let a=e.tabs.map(e=>({...e})),o=a.find(e=>e.id===t);o||(o={id:t,title:n,state:`running`,from:r,lines:[]},a.push(o));let s=o.from+o.lines.length;if(r>s)return e;let c=i.slice(s-r);return c.length&&Object.assign(o,Ut({...o,lines:[...o.lines,...c]})),{...e,tabs:a}}function Gt(e,t){if(!t||!e||e.runId!==t.runId)return{run:t,gaps:[]};let n=[],r=t.tabs.map(t=>{let r=e.tabs.find(e=>e.id===t.id);if(!r)return t;let i=r.from+r.lines.length;if(t.from>i)return n.push({tab:t.id,from:i}),{...t,from:r.from,lines:r.lines};let a=t.lines.slice(i-t.from);return Ut({...t,from:r.from,lines:a.length?[...r.lines,...a]:r.lines})});return{run:{...e,...t,tabs:r},gaps:n}}function Kt(e,t,n,r){return{...e,tabs:e.tabs.map(e=>{if(e.id!==t)return e;let i=e.from+e.lines.length,a=n+r.length;if(n>i)return{...e,from:n,lines:r};if(a<e.from)return e;let o=n>e.from?e.lines.slice(0,n-e.from):[],s=i>a?e.lines.slice(a-e.from):[];return Ut({...e,from:Math.min(n,e.from),lines:[...o,...r,...s]})})}}function qt({children:e}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(),[s,c]=(0,v.useState)(),[l,u]=(0,v.useState)(),[d,f]=(0,v.useState)(),[p,m]=(0,v.useState)(),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)(!1),b=(0,v.useRef)(null);b.current=t;let[x,S]=(0,v.useState)(),C=t?.state===`running`?t.runId:void 0;(0,v.useEffect)(()=>{C&&S(C),ee(void 0)},[C]);let w=(0,v.useCallback)(async(e,t,r,i=!1)=>{try{let a=await N(`/api/copilot-runs/${encodeURIComponent(e)}/tabs/${encodeURIComponent(t)}?from=${r}`,{quiet:i});return n(n=>n&&n.runId===e?Kt(n,t,a.from,a.lines):n),a.from}catch{return}},[]),[T,E]=(0,v.useState)(new Set),[D,ee]=(0,v.useState)(),te=(0,v.useCallback)(async(e=!1)=>{try{let t=await N(`/api/copilot-runs/current`,{quiet:e}),{gaps:r}=Gt(b.current,t.run);if(n(e=>Gt(e,t.run).run),t.run)for(let e of r)w(t.run.runId,e.tab,e.from,!0);i(t.allowed),o(t.why),c(t.model),u(t.limit),f(t.assistantFiles)}catch{}},[w]);(0,v.useEffect)(()=>{te()},[te]);let ne=t?.state===`running`;(0,v.useEffect)(()=>{if(!ne){g(!1);return}let e=()=>void te(!0),t=setInterval(()=>void te(!0),A()?1e3:3e3);return()=>{clearInterval(t),e()}},[ne,te]),St(e=>{if(e.type===`copilot-run.state`){let t=e.run;n(e=>e&&e.runId===t.runId?{...e,...t}:{...t,tabs:[{id:`run`,title:zt.console.runTab,state:`running`,from:0,lines:[]}]})}else e.type===`copilot-run.lines`&&n(t=>t&&t.runId===e.runId?Wt(t,String(e.tab),String(e.title),Number(e.at),e.lines??[]):t)});let O=(0,v.useCallback)(async()=>{if(t){g(!0),ee(void 0);try{await N(`/api/copilot-runs/${encodeURIComponent(t.runId)}/stop`,{method:`POST`})}catch(e){g(!1),ee(zt.strip.stopFailed(e instanceof M?e.problem.detail??e.message:e.message))}te()}},[t,te]),re=(0,v.useMemo)(()=>({run:t,allowed:r,...a?{why:a}:{},...s?{model:s}:{},...l?{limit:l}:{},...d?{assistantFiles:d}:{},ask:e=>{m(e),te(!0)},stop:O,stopping:h,consoleOpen:_,setConsoleOpen:y,loadEarlier:e=>{if(!t)return;let n=t.tabs.find(t=>t.id===e)?.from??0;w(t.runId,e,0).then(r=>{r!==void 0&&r>=n&&E(n=>new Set(n).add(`${t.runId}:${e}`))})},notKept:T,...D?{stopError:D}:{},...x?{watched:x}:{}}),[t,r,a,s,l,d,te,O,h,_,w,x,T,D]);return(0,j.jsxs)(Bt.Provider,{value:re,children:[e,p&&(0,j.jsx)(Yt,{ask:p,...s?{model:s}:{},...l?{limit:l}:{},...d?{assistantFiles:d}:{},onClose:()=>m(void 0),onStarted:e=>{n(e),m(void 0),y(!0)}})]})}function Jt(e){let t=e.trim().replace(/[\s,_]/g,``);if(!/^\d+$/.test(t))return;let n=Number(t);return Number.isSafeInteger(n)&&n>=1e3&&n<=1e7?n:void 0}function Yt(e){let[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(),a=e.limit?.known===!1,[o,s]=(0,v.useState)(a&&e.limit?.tokens?String(e.limit.tokens):``),[c,l]=(0,v.useState)(!1),u=e.assistantFiles?.edited??[],d=e.assistantFiles?.stale??[],f=e.assistantFiles?.shared??[],p=u.length>0,m=(0,v.useRef)(null),h=(0,v.useRef)(null),g=(0,v.useRef)(null),_=(0,v.useRef)(null);(0,v.useEffect)(()=>{let e=document.activeElement;return(g.current??(p?h.current:m.current)??_.current)?.focus(),()=>{(e?.isConnected&&!e.disabled?e:document.getElementById(`run-console-toggle`))?.focus?.()}},[]);let y=(0,v.useRef)(a);(0,v.useEffect)(()=>{a&&!y.current&&(!o&&e.limit?.tokens&&s(String(e.limit.tokens)),g.current?.focus()),y.current=a},[a]),(0,v.useEffect)(()=>{if(!p)return;let e=document.activeElement;(!e||e===m.current||e===document.body)&&h.current?.focus()},[p]);let b=(e.ask.repos??[]).join(`, `),x=e.ask.kind===`repos`?zt.confirm.what.repos(b,!!e.ask.force):b&&e.ask.kind===`stale`?zt.confirm.what.staleRepos(b):b&&e.ask.kind===`gaps`?zt.confirm.what.gapsRepos(b):zt.confirm.what[e.ask.kind],S=async()=>{if(u.length)return;let t=a?Jt(o):void 0;if(a&&t===void 0){l(!0),g.current?.focus();return}l(!1),_.current?.focus(),n(!0),i(void 0);let r=t===void 0?e.ask:{...e.ask,maxTokens:t};try{let t=e.start?await e.start(r):await N(`/api/copilot-runs`,{method:`POST`,body:r});e.onStarted(t)}catch(e){i(e instanceof M?e.problem.detail??e.message:e instanceof Error?e.message:String(e)),n(!1)}};return(0,j.jsx)(`div`,{className:`run-dialog-back`,children:(0,j.jsxs)(`div`,{ref:_,id:`run-dialog`,tabIndex:-1,className:`run-dialog panel`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`run-dialog-title`,"aria-describedby":`run-dialog-what`,onKeyDown:n=>{if(n.key===`Escape`&&!t&&(n.preventDefault(),e.onClose()),n.key===`Tab`&&_.current){let e=[..._.current.querySelectorAll(`input:not([disabled]), button:not([disabled])`)];if(!e.length){n.preventDefault();return}let t=e[0],r=e[e.length-1];document.activeElement===_.current?(n.preventDefault(),(n.shiftKey?r:t).focus()):n.shiftKey&&document.activeElement===t?(n.preventDefault(),r.focus()):!n.shiftKey&&document.activeElement===r&&(n.preventDefault(),t.focus())}},children:[(0,j.jsx)(`h2`,{id:`run-dialog-title`,className:`h`,style:{marginTop:0,fontSize:16},children:zt.confirm.title}),(0,j.jsx)(`p`,{id:`run-dialog-what`,children:x}),(0,j.jsx)(`p`,{className:`work-say`,children:zt.confirm.model(e.model)}),e.limit?.known&&e.limit.tokens&&e.limit.from!==`last`&&(0,j.jsx)(`p`,{className:`work-say`,children:zt.confirm.limit.known(e.limit.tokens,e.limit.from??`runtime.yaml`)}),a&&(0,j.jsxs)(`div`,{className:`field`,children:[(0,j.jsx)(`label`,{htmlFor:`run-dialog-limit`,children:zt.confirm.limit.label}),(0,j.jsx)(`input`,{ref:g,id:`run-dialog-limit`,type:`text`,inputMode:`numeric`,autoComplete:`off`,value:o,disabled:t,"aria-invalid":c,"aria-describedby":`run-dialog-limit-hint${c?` run-dialog-limit-bad`:``}`,onChange:e=>{s(e.target.value),c&&l(!1)},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),S())}}),(0,j.jsxs)(`p`,{id:`run-dialog-limit-hint`,className:`work-say`,children:[zt.confirm.limit.hint,e.limit?.tokens&&e.limit.from===`last`?` ${zt.confirm.limit.last}`:``,e.limit?.tokens&&e.limit.from===`probe`?` ${zt.confirm.limit.probe}`:``]}),c&&(0,j.jsx)(`p`,{id:`run-dialog-limit-bad`,className:`state error`,role:`alert`,children:zt.confirm.limit.bad})]}),(0,j.jsx)(`p`,{className:`work-say`,children:zt.confirm.may}),(0,j.jsx)(`p`,{className:`work-say`,children:zt.confirm.long}),u.length>0?(0,j.jsxs)(`div`,{role:`alert`,className:`state error`,children:[(0,j.jsx)(`p`,{children:zt.confirm.files.edited(u.slice(0,3).join(`, `),u.length)}),(0,j.jsxs)(`details`,{children:[(0,j.jsx)(`summary`,{children:w.appStep.inTerminal}),(0,j.jsx)(`p`,{children:zt.confirm.files.editedHow})]})]}):d.length>0&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`work-say`,children:zt.confirm.files.stale(d.length)}),f.length>0&&(0,j.jsx)(`p`,{className:`work-say`,children:zt.confirm.files.shared(f.join(`, `))})]}),r&&(0,j.jsx)(`p`,{className:`state error`,role:`alert`,children:zt.failedToStart(r)}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,justifyContent:`flex-end`},children:[(0,j.jsx)(`button`,{ref:h,id:`run-dialog-no`,type:`button`,className:`btn`,onClick:e.onClose,disabled:t,children:zt.confirm.no}),(0,j.jsx)(`button`,{ref:m,id:`run-dialog-yes`,type:`button`,className:`btn primary`,onClick:()=>void S(),disabled:t||u.length>0,"aria-busy":t,children:t?zt.starting:zt.confirm.yes})]})]})})}function Xt(e){let t=Vt();if(!t?.allowed)return null;let n=t.run?.state===`running`;return(0,j.jsx)(`button`,{type:`button`,className:e.className??`btn`,onClick:()=>t.ask(e.ask),disabled:n,title:n?zt.strip.running:zt.hint,children:e.label})}var Zt=`atticus.copilotRun.dismissed`,Qt=()=>{try{return sessionStorage.getItem(Zt)??void 0}catch{return}};function $t(){let e=Vt(),[t,n]=(0,v.useState)(Qt),r=e=>{n(e);try{sessionStorage.setItem(Zt,e)}catch{}},i=e?.run;if(!e||!i||t===`${i.runId}:${i.state}`||i.state!==`running`&&e.watched!==i.runId)return null;let a=i.progress,o=i.totals,s=i.state===`running`,c=s?a.repo?zt.strip.repo(a.repoIndex,a.repos,a.repo):zt.strip.planning:i.state===`done`?zt.strip.done:i.state===`stopped`?zt.strip.stopped:zt.strip.failed(i.message??``);return(0,j.jsxs)(`section`,{className:`run-strip ${s?``:i.state===`failed`?`failed`:`ended`}`,"aria-label":zt.strip.running,children:[s&&(0,j.jsx)(`div`,{className:`run-strip-bar`,role:`progressbar`,"aria-label":zt.strip.running,"aria-valuemin":0,"aria-valuemax":Math.max(a.repos,1),"aria-valuenow":Math.max(a.repoIndex-1,0),"aria-valuetext":c,children:(0,j.jsx)(`span`,{style:{width:`${a.repos?Math.max(a.repoIndex-1,0)/a.repos*100:0}%`}})}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:10,flexWrap:`wrap`,alignItems:`center`},children:[(0,j.jsx)(`strong`,{role:`status`,children:c}),s&&a.session&&(0,j.jsx)(`span`,{className:`work-say`,children:zt.strip.session(a.session)}),(0,j.jsx)(`span`,{className:`work-say`,children:zt.strip.totals(o.kept,o.rejected,o.tokens)}),(0,j.jsx)(`span`,{style:{flex:1}}),!e.consoleOpen&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>e.setConsoleOpen(!0),children:zt.strip.showConsole}),s?(0,j.jsx)(`button`,{type:`button`,className:`btn danger`,onClick:()=>void e.stop(),disabled:e.stopping,children:e.stopping?zt.strip.stopping:zt.strip.stop}):(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>r(`${i.runId}:${i.state}`),children:zt.strip.dismiss})]}),s&&e.stopError&&(0,j.jsx)(`p`,{role:`alert`,className:`state error`,children:e.stopError}),(0,j.jsx)(en,{problems:i.problems??[]})]})}function en({problems:e}){return e.length?(0,j.jsxs)(`div`,{className:`run-strip-problems`,role:`status`,children:[(0,j.jsx)(`p`,{className:`work-say`,children:zt.strip.stoppedOn(e.length)}),(0,j.jsx)(`ul`,{children:e.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`strong`,{children:zt.strip.stoppedRepo(e.repo,e.part,e.total)}),` `,e.rejectedCount?zt.strip.rejected(e.rejectedCount):zt.strip.noRejected,e.rejected.length>0&&(0,j.jsxs)(`ul`,{children:[e.rejected.map((e,t)=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`code`,{children:e.code}),` `,e.message]},t)),e.rejectedCount>e.rejected.length&&(0,j.jsx)(`li`,{children:zt.strip.moreRejected(e.rejectedCount-e.rejected.length)})]})]},`${e.repo}:${e.part??0}`))})]}):null}function tn(e,t){let n=t.toLowerCase().split(/\s+/).filter(Boolean);return n.length?e.filter(e=>{let t=e.toLowerCase();return n.every(e=>t.includes(e))}):e}function nn(e,t){let n=t.scrollTop+t.clientHeight>=t.scrollHeight-4;return t.scrollTop<e-1&&!n}function rn(){let e=Vt(),[t,n]=(0,v.useState)(`run`),[r,i]=(0,v.useState)(!0),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(),l=(0,v.useRef)(void 0);(0,v.useEffect)(()=>()=>clearTimeout(l.current),[]);let u=e=>{c(e),clearTimeout(l.current),l.current=setTimeout(()=>c(void 0),2e3)},d=(0,v.useRef)(null),f=(0,v.useRef)(0),p=e?.run,m=p?.tabs??[],h=m.find(e=>e.id===t)??m[0],g=m.at(-1)?.id,_=p?.runId;(0,v.useEffect)(()=>{n(`run`),i(!0),o(``)},[_]),(0,v.useEffect)(()=>{r&&g&&n(g)},[g,r]);let y=(0,v.useMemo)(()=>h?tn(h.lines,a):[],[h,a]);return(0,v.useEffect)(()=>{r&&d.current&&(d.current.scrollTop=d.current.scrollHeight,f.current=d.current.scrollTop)},[y.length,r,t]),!e||!p?null:(0,j.jsxs)(`div`,{className:`run-console-copilot`,children:[(0,j.jsx)(`div`,{role:`tablist`,"aria-label":zt.console.tabs,className:`run-console-tabs`,onKeyDown:e=>{let t=m.findIndex(e=>e.id===h?.id),r=e.key===`ArrowRight`?m[(t+1)%m.length]:e.key===`ArrowLeft`?m[(t-1+m.length)%m.length]:e.key===`Home`?m[0]:e.key===`End`?m.at(-1):void 0;r&&(e.preventDefault(),i(!1),n(r.id),document.getElementById(`console-tab-${r.id}`)?.focus())},children:m.map(e=>(0,j.jsxs)(`button`,{id:`console-tab-${e.id}`,type:`button`,role:`tab`,"aria-selected":e.id===h?.id,"aria-controls":`run-console-log`,tabIndex:e.id===h?.id?0:-1,className:`run-console-tab ${e.state}`,onClick:()=>{i(e.id===g),n(e.id)},title:e.ended??zt.console.states[e.state],children:[e.title,e.id!==`run`&&(0,j.jsxs)(`span`,{className:`sr`,children:[` (`,zt.console.states[e.state],`)`]})]},e.id))}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,alignItems:`center`,margin:`6px 0`},children:[(0,j.jsxs)(`label`,{className:`row`,style:{gap:4},children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:r,onChange:e=>i(e.target.checked)}),zt.console.follow]}),(0,j.jsx)(`label`,{htmlFor:`run-console-search`,className:`sr`,children:zt.console.search}),(0,j.jsx)(`input`,{id:`run-console-search`,className:`field`,type:`search`,placeholder:zt.console.search,value:a,onChange:e=>o(e.target.value),style:{height:26,fontSize:12}}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>{if(!navigator.clipboard)return u(`failed`);navigator.clipboard.writeText(y.join(`
|
|
10
|
+
`)).then(()=>u(`yes`),()=>u(`failed`))},children:s===`yes`?zt.console.copied:s===`failed`?zt.console.copyFailed:zt.console.copy}),(0,j.jsx)(`span`,{role:`status`,className:`sr`,children:s===`yes`?zt.console.copied:s===`failed`?zt.console.copyFailed:``})]}),(0,j.jsxs)(`div`,{role:`tabpanel`,id:`run-console-log`,className:`run-console-panel`,"aria-labelledby":`console-tab-${h?.id??`run`}`,children:[h&&h.from>0&&(0,j.jsx)(`p`,{className:`work-say row`,style:{gap:8,alignItems:`center`},children:e.notKept?.has(`${p.runId}:${h.id}`)?zt.console.notKept(h.from):(0,j.jsxs)(j.Fragment,{children:[zt.console.earlier(h.from),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>e.loadEarlier(h.id),children:zt.console.loadEarlier})]})}),(0,j.jsx)(`pre`,{ref:d,className:`run-console-log`,role:`log`,"aria-live":`off`,tabIndex:0,onScroll:e=>{r&&nn(f.current,e.currentTarget)&&i(!1),f.current=e.currentTarget.scrollTop},children:y.length?y.join(`
|
|
11
|
+
`):a?zt.console.noMatch(a):zt.console.noLines})]})]})}var an=w.activity,on=(0,v.createContext)(void 0),sn=()=>(0,v.useContext)(on);function cn(e){return e.outcome===`refused`?an.refused:e.state===`ended`&&e.where===`app`?an.appClosedState:e.state===`running`&&e.stopping?an.stoppingState:an.states[e.state]??e.state}function ln(e){if(!(e.state!==`running`||e.stop)){if(e.kind===`command`)return an.stopTerminal;if(e.where===`app`&&e.kind!==`copilot`)return an.otherWindow}}var un=(e,t)=>e.stopping===t.id||t.state===`running`&&t.stopping===!0,dn=e=>e.title??an.kinds[e.kind]??e.kind;function fn(e,t){return[t,...e.filter(e=>e.id!==t.id)].sort((e,t)=>t.startedAt.localeCompare(e.startedAt)||t.id.localeCompare(e.id))}var pn=e=>e.lines.length>5e3?{...e,from:e.from+e.lines.length-Ht,lines:e.lines.slice(-Ht)}:e;function mn(e,t,n,r,i={}){if(!e||e.startedAt!==r)return pn({from:t,lines:n,startedAt:r});let a=e.from+e.lines.length;if(t>a)return i.gap?pn({from:t,lines:n,startedAt:r,dropped:t-a}):e;if(t<e.from){let r=n.slice(0,e.from-t),i=n.slice(e.from-t+e.lines.length);return pn({...e,from:t,lines:[...r,...e.lines,...i]})}let o=n.slice(a-t);return o.length?pn({...e,lines:[...e.lines,...o]}):e}var hn=e=>e.rev?`${e.startedAt}#${e.rev}`:e.startedAt;function gn(e,t){if(e)return e.startedAt===hn(t)||e.startedAt===t.startedAt||e.startedAt.startsWith(`${t.startedAt}#`)?e:void 0}function _n(e){return e.hidden?6e4:e.running||e.open?e.bridge?1500:3e3:e.bridge?5e3:15e3}function vn(){let[e,t]=(0,v.useState)(()=>yn());return(0,v.useEffect)(()=>{if(typeof document>`u`||typeof document.addEventListener!=`function`)return;let e=()=>t(yn());return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),e}var yn=()=>typeof document<`u`&&document.visibilityState===`hidden`;function bn(e){return{id:e.runId,kind:`copilot`,where:`app`,state:e.state===`running`?`running`:e.state===`stopped`?`cancelled`:e.state===`failed`?`failed`:`done`,startedAt:e.startedAt,...e.finishedAt?{finishedAt:e.finishedAt}:{},lines:0,from:0,copilotRunId:e.runId,jobId:e.jobId}}var xn=e=>e instanceof M?e.problem.detail??e.message:e instanceof Error?e.message:String(e);function Sn({children:e}){let t=Vt(),[n,r]=(0,v.useState)(`loading`),[i,a]=(0,v.useState)(),[o,s]=(0,v.useState)([]),[c,l]=(0,v.useState)({}),[u,d]=(0,v.useState)({}),[f,p]=(0,v.useState)(),m=(0,v.useRef)(!1),[h,g]=(0,v.useState)(!1),_=t?t.consoleOpen:h,y=t?t.setConsoleOpen:g,[b,x]=(0,v.useState)(),[S,C]=(0,v.useState)(),[w,T]=(0,v.useState)(``),E=(0,v.useRef)(0),[D,ee]=(0,v.useState)(0),te=t?.run,ne=(0,v.useMemo)(()=>{if(!te)return o;let e=o.find(e=>e.id===te.runId),t=bn(te);return fn(o,e?{...e,state:t.state}:t)},[o,te]),O=(0,v.useRef)(ne);O.current=ne;let re=(0,v.useRef)(c);re.current=c;let k=(0,v.useCallback)(async()=>{try{let e=await N(`/api/activity`,{quiet:!0});s(e.entries),r(`ready`),a(void 0)}catch(e){r(e=>e===`ready`?e:`error`),a(xn(e))}},[]);(0,v.useEffect)(()=>{k()},[k]);let ie=ne.some(e=>e.state===`running`),ae=vn();(0,v.useEffect)(()=>{let e=_n({running:ie,open:_,bridge:!!A(),hidden:ae}),t=setInterval(()=>void k(),e);return()=>clearInterval(t)},[ie,_,ae,k]);let oe=(0,v.useRef)(ae);(0,v.useEffect)(()=>{oe.current&&!ae&&k(),oe.current=ae},[ae,k]);let se=(0,v.useRef)(void 0),ce=(0,v.useCallback)(()=>{clearTimeout(se.current),se.current=setTimeout(()=>void k(),300)},[k]);(0,v.useEffect)(()=>()=>clearTimeout(se.current),[]);let M=(0,v.useCallback)((e,t=!1)=>{let n=Date.now();!t&&n-E.current<1e4||(E.current=n,T(e))},[]);St(e=>{if(e.type===`activity.changed`){let t=e.entry,n=O.current.find(e=>e.id===t.id);n&&n.state===`running`&&t.state!==`running`&&M(an.changed(dn(t),cn(t)),!0),s(e=>fn(e,t)),r(`ready`)}else if(e.type===`activity.lines`){let t=String(e.id),n=O.current.find(e=>e.id===t),r=e.lines??[];n&&re.current[t]&&(l(i=>({...i,[t]:mn(i[t],Number(e.at),r,hn(n))})),t===f&&_&&M(an.newLines(r.length,dn(n))))}else(e.type===`job.done`||e.type===`run.changed`||e.type===`job.progress`&&!O.current.some(t=>t.id===e.jobId))&&ce()}),(0,v.useEffect)(()=>{if(m.current&&f&&ne.some(e=>e.id===f))return;let e=ne.find(e=>e.state===`running`)??ne[0];e&&e.id!==f&&p(e.id)},[ne,f]);let le=te?.state===`running`?te.runId:void 0;(0,v.useEffect)(()=>{le&&(m.current=!1,p(le))},[le]);let ue=ne.find(e=>e.id===f),de=ue?.id,fe=ue?.kind,pe=ue?.lines??0,me=ue?hn(ue):void 0,he=de?c[de]:void 0,ge=he&&he.startedAt===me?he.from+he.lines.length:void 0;(0,v.useEffect)(()=>{if(!_||!de||!me||fe===`copilot`)return;let e=re.current[de],t=e&&e.startedAt===me?e:void 0,n=t?t.from+t.lines.length:void 0;if(t&&n!==void 0&&n>=pe)return;let r=!1;return t||d(e=>({...e,[de]:`loading`})),N(`/api/activity/${encodeURIComponent(de)}/lines${n===void 0?``:`?from=${n}`}`,{quiet:!0}).then(e=>{r||(l(t=>({...t,[de]:mn(t[de]?.startedAt===me?t[de]:void 0,e.from,e.lines,me,{gap:!0})})),d(e=>({...e,[de]:void 0})))},()=>{r||t||d(e=>({...e,[de]:`error`}))}),()=>{r=!0}},[_,de,fe,pe,me,ge]);let _e=(0,v.useCallback)(async e=>{if(e.stop){x(e.id),C(void 0);try{await N(e.stop,{method:`POST`})}catch(e){C(an.stopFailed(xn(e)))}x(void 0),k()}},[k]),ve=(0,v.useCallback)(e=>{let t=O.current.find(t=>t.id===e);t&&N(`/api/activity/${encodeURIComponent(e)}/lines?from=0`,{quiet:!0}).then(n=>l(r=>({...r,[e]:mn(r[e],n.from,n.lines,hn(t))})),()=>void 0)},[]),ye=(0,v.useMemo)(()=>({state:n,...i?{error:i}:{},entries:ne,lines:c,linesState:u,...f?{selected:f}:{},select:(e,t=!0)=>{m.current=t,p(e)},open:_,setOpen:y,show:e=>{m.current=!0,p(e),y(!0),ee(e=>e+1),ce()},stop:_e,...b?{stopping:b}:{},...S?{stopError:S}:{},reload:()=>{r(`loading`),k()},loadEarlier:ve,said:w,showAsks:D}),[n,i,ne,c,u,f,_,y,ce,_e,b,S,k,ve,w,D]);return(0,j.jsx)(on.Provider,{value:ye,children:e})}var Cn=e=>{let t=new Date(e);return Number.isNaN(t.getTime())?e:new Date().toDateString()===t.toDateString()?t.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}):t.toLocaleString([],{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})};function wn(){let e=sn(),t=Vt(),n=(e?.entries??[]).filter(e=>e.state===`running`&&e.kind!==`copilot`),r=n[0];return(0,j.jsxs)(j.Fragment,{children:[t&&(0,j.jsx)($t,{}),e&&r&&(0,j.jsxs)(`section`,{className:`run-strip activity-strip`,"aria-label":an.strip.label,children:[r.progress&&r.progress.total>0&&(0,j.jsx)(`div`,{className:`run-strip-bar`,role:`progressbar`,"aria-label":dn(r),"aria-valuemin":0,"aria-valuemax":r.progress.total,"aria-valuenow":r.progress.done,"aria-valuetext":r.progress.message,children:(0,j.jsx)(`span`,{style:{width:`${r.progress.done/r.progress.total*100}%`}})}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:10,flexWrap:`wrap`,alignItems:`center`},children:[(0,j.jsx)(`strong`,{children:an.strip.running(dn(r))}),(0,j.jsxs)(`span`,{className:`work-say`,children:[an.from(an.where[r.where]??r.where),r.progress?.message&&r.progress.message!==`Starting`?` · ${r.progress.message}`:``,r.progress&&r.progress.total>1?` · ${an.strip.step(r.progress.done,r.progress.total)}`:``]}),n.length>1&&(0,j.jsx)(`span`,{className:`work-say`,children:an.strip.more(n.length-1)}),(0,j.jsx)(`span`,{style:{flex:1}}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>e.show(r.id),children:an.strip.show}),r.stop?(0,j.jsx)(`button`,{type:`button`,className:`btn danger`,onClick:()=>void e.stop(r),disabled:un(e,r),children:un(e,r)?an.stopping:an.stop}):ln(r)?(0,j.jsx)(`span`,{className:`work-say`,children:ln(r)}):null]}),e.stopError&&(0,j.jsx)(`p`,{role:`alert`,className:`state error`,children:e.stopError})]})]})}function Tn(e){let[t,n]=(0,v.useState)(!0),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(),s=(0,v.useRef)(void 0);(0,v.useEffect)(()=>()=>clearTimeout(s.current),[]);let c=(0,v.useRef)(null),l=(0,v.useRef)(0),u=e.lines?.lines??[],d=(0,v.useMemo)(()=>tn(u,r),[u,r]);(0,v.useEffect)(()=>{t&&c.current&&(c.current.scrollTop=c.current.scrollHeight,l.current=c.current.scrollTop)},[d.length,t,e.entry.id]);let f=e=>{o(e),clearTimeout(s.current),s.current=setTimeout(()=>o(void 0),2e3)},p=a===`yes`?an.copied:a===`failed`?an.copyFailed:an.copy;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,alignItems:`center`,margin:`6px 0`},children:[(0,j.jsxs)(`label`,{className:`row`,style:{gap:4},children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:t,onChange:e=>n(e.target.checked)}),an.follow]}),(0,j.jsx)(`label`,{htmlFor:e.searchId??`activity-search`,className:`sr`,children:an.search}),(0,j.jsx)(`input`,{id:e.searchId??`activity-search`,className:`field`,type:`search`,placeholder:an.search,value:r,onChange:e=>i(e.target.value),style:{height:26,fontSize:12}}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>{if(!navigator.clipboard)return f(`failed`);navigator.clipboard.writeText(d.join(`
|
|
12
|
+
`)).then(()=>f(`yes`),()=>f(`failed`))},children:p}),(0,j.jsx)(`span`,{role:`status`,className:`sr`,children:a?p:``})]}),e.lines&&e.lines.from>0&&(0,j.jsxs)(`p`,{className:`work-say row`,style:{gap:8,alignItems:`center`},children:[an.earlier(e.lines.from),e.lines.from>e.entry.from&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:e.onEarlier,children:an.loadEarlier})]}),e.lines?.dropped?(0,j.jsx)(`p`,{className:`work-say`,children:an.dropped(e.lines.dropped)}):null,e.state===`error`&&!e.lines?(0,j.jsx)(`p`,{className:`state error`,role:`alert`,children:an.linesFailed}):(0,j.jsx)(`pre`,{ref:c,className:`run-console-log`,role:`log`,"aria-live":`off`,"aria-busy":e.state===`loading`,"aria-label":dn(e.entry),tabIndex:0,onScroll:e=>{t&&nn(l.current,e.currentTarget)&&n(!1),l.current=e.currentTarget.scrollTop},children:e.state===`loading`&&!e.lines?an.linesLoading:d.length?d.join(`
|
|
13
|
+
`):r?an.noMatch(r):an.noLines})]})}function En({e}){return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`span`,{className:`activity-kind`,children:an.kinds[e.kind]??e.kind}),(0,j.jsx)(`span`,{className:`activity-title`,children:dn(e)}),(0,j.jsxs)(`span`,{className:`activity-meta`,children:[(0,j.jsx)(`span`,{className:`activity-state ${e.outcome??e.state}`,children:cn(e)}),` · `,an.from(an.where[e.where]??e.where),` · `,an.at(Cn(e.startedAt))]})]})}function Dn({a:e}){return e.state===`loading`&&!e.entries.length?(0,j.jsx)(`p`,{className:`work-say`,role:`status`,children:an.loading}):e.state===`error`&&!e.entries.length?(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,alignItems:`center`},children:[(0,j.jsx)(`p`,{className:`state error`,role:`alert`,children:an.failed(e.error??``)}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:e.reload,children:an.retry})]}):e.entries.length?null:(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`p`,{children:an.empty}),(0,j.jsx)(`p`,{className:`work-say`,children:an.emptyHint})]})}function On(e){let{a:t,entry:n}=e,r=Vt(),i=gn(t.lines[n.id],n);return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,alignItems:`center`,flexWrap:`wrap`},children:[(0,j.jsx)(`strong`,{children:dn(n)}),(0,j.jsxs)(`span`,{className:`work-say`,children:[cn({...n,stopping:un(t,n)}),n.exitCode!==void 0&&n.state!==`done`?` (${an.exitCode(n.exitCode)})`:``,` · `,an.from(an.where[n.where]??n.where),` · `,an.at(Cn(n.startedAt))]}),(0,j.jsx)(`span`,{style:{flex:1}}),n.state===`running`&&n.stop&&n.kind!==`copilot`&&(0,j.jsx)(`button`,{type:`button`,className:`btn danger`,onClick:()=>void t.stop(n),disabled:un(t,n),children:un(t,n)?an.stopping:an.stop}),ln(n)&&(0,j.jsx)(`span`,{className:`work-say`,children:ln(n)})]}),n.state===`ended`&&(0,j.jsx)(`p`,{className:`work-say`,children:n.where===`app`?an.appClosed:an.endedWithoutSaying}),n.state===`waiting`&&(0,j.jsx)(`p`,{className:`work-say`,children:an.handoffWaits}),n.kind===`copilot`&&r?.run?.runId===n.id?(0,j.jsx)(rn,{}):(0,j.jsx)(Tn,{entry:n,...i?{lines:i}:{},...t.linesState[n.id]?{state:t.linesState[n.id]}:{},...e.searchId?{searchId:e.searchId}:{},onEarlier:()=>t.loadEarlier(n.id)},`${n.id}:${n.startedAt}`)]})}function kn(){let e=sn();if(!e)return null;let t=e.entries.filter(e=>e.state===`running`).length,n=e.entries.find(t=>t.id===e.selected)??e.entries[0];return(0,j.jsxs)(`section`,{className:`run-console ${e.open?`open`:``}`,"aria-label":an.title,children:[(0,j.jsxs)(`div`,{className:`run-console-head row`,style:{gap:8,alignItems:`center`},children:[(0,j.jsx)(`button`,{id:`run-console-toggle`,type:`button`,className:`btn`,"aria-expanded":e.open,"aria-controls":`run-console-body`,onClick:()=>e.setOpen(!e.open),children:e.open?an.close:an.open}),(0,j.jsx)(`strong`,{children:an.title}),t>0&&(0,j.jsx)(`span`,{className:`work-say`,children:an.runningCount(t)}),(0,j.jsx)(`span`,{className:`sr`,role:`status`,"aria-live":`polite`,children:e.said})]}),e.open&&(0,j.jsx)(`div`,{id:`run-console-body`,className:`run-console-body`,children:e.entries.length?(0,j.jsxs)(`div`,{className:`activity`,children:[(0,j.jsx)(`div`,{role:`tablist`,"aria-orientation":`vertical`,"aria-label":an.list,className:`activity-list`,onKeyDown:t=>{let r=e.entries,i=r.findIndex(e=>e.id===n?.id),a=t.key===`ArrowDown`?r[(i+1)%r.length]:t.key===`ArrowUp`?r[(i-1+r.length)%r.length]:t.key===`Home`?r[0]:t.key===`End`?r.at(-1):void 0;a&&(t.preventDefault(),e.select(a.id),document.getElementById(`activity-${a.id}`)?.focus())},children:e.entries.map(t=>(0,j.jsx)(`button`,{id:`activity-${t.id}`,type:`button`,role:`tab`,"aria-selected":t.id===n?.id,"aria-controls":`activity-panel`,tabIndex:t.id===n?.id?0:-1,className:`activity-item ${t.state}`,onClick:()=>e.select(t.id),children:(0,j.jsx)(En,{e:t})},t.id))}),(0,j.jsx)(`div`,{role:`tabpanel`,id:`activity-panel`,className:`activity-panel`,"aria-labelledby":n?`activity-${n.id}`:void 0,children:n&&(0,j.jsx)(On,{a:e,entry:n})})]}):(0,j.jsx)(Dn,{a:e})})]})}function An(e){let t=sn();return!t||!e.id?null:(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>t.show(e.id),children:an.strip.show})}var jn=w.knowCommon;function Mn(e,t,n=!1){let r=P(n?void 0:`/api/view/${e}${t?`/${encodeURIComponent(t)}`:``}`);return r.state===`ready`?{state:`ready`,data:r.data.data,reload:r.reload}:r}function Nn(e,t){let n=e.split(`?`)[1];return n?new URLSearchParams(n).get(t)??void 0:void 0}function Pn(e,t,n,r={}){let i=new URLSearchParams(location.hash.split(`?`)[1]??``);for(let e of r.drop??[])i.delete(e);i.set(t,n),location.hash=`#/${e}?${i.toString()}`}function Fn(e,t){let n=P(`/api/changes`),r=Nn(e,`change`)??(n.state===`ready`?n.data[0]?.id:void 0);return{id:r,picker:(0,j.jsxs)(`label`,{className:`row`,style:{gap:8},children:[(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:w.app.changePicker}),(0,j.jsxs)(`select`,{value:r??``,onChange:e=>Pn(t,`change`,e.target.value),disabled:n.state!==`ready`||n.data.length===0,style:{height:32,background:`var(--box)`,color:`var(--text)`,border:`1px solid var(--line-2)`,borderRadius:7,padding:`0 8px`,font:`inherit`},children:[n.state===`ready`&&n.data.length===0&&(0,j.jsx)(`option`,{value:``,children:w.app.noChanges}),n.state===`ready`&&n.data.map(e=>(0,j.jsxs)(`option`,{value:e.id,children:[e.id,` · `,e.state]},e.id))]})]}),none:n.state===`ready`&&n.data.length===0,list:n}}function In(e){return(0,j.jsx)(`div`,{className:`bento`,children:(0,j.jsx)(F,{title:e.title,span:`1 / -1`,children:e.list.state===`error`?(0,j.jsx)(Mt,{error:e.list.error,retry:e.list.reload}):(0,j.jsxs)(`div`,{"aria-busy":`true`,"aria-live":`polite`,children:[(0,j.jsx)(`span`,{className:`sr`,children:w.app.loading}),(0,j.jsx)(`div`,{className:`skeleton`})]})})})}function Ln(e){return e.split(/(`[^`]+`|\*\*[^*]+\*\*|_\([^)]*\)_)/).map((e,t)=>e.startsWith("`")&&e.endsWith("`")&&e.length>1?(0,j.jsx)(`code`,{className:`mono`,style:{fontSize:`0.92em`,color:`var(--accent)`},children:e.slice(1,-1)},t):e.startsWith(`_(`)&&e.endsWith(`)_`)?(0,j.jsx)(`span`,{className:`muted mono`,style:{fontSize:`0.85em`},children:e.slice(1,-1)},t):e.startsWith(`**`)&&e.endsWith(`**`)&&e.length>3?(0,j.jsx)(`strong`,{children:e.slice(2,-2)},t):e)}var Rn=e=>e.trim().replace(/^\|/,``).replace(/\|$/,``).split(`|`).map(e=>e.trim());function zn({text:e}){let t=[],n=[],r=[],i=[],a=()=>{if(i.length&&t.push((0,j.jsx)(`p`,{style:{margin:`4px 0 8px`,lineHeight:1.6,color:`var(--text-2)`},children:Ln(i.join(` `))},`p${t.length}`)),i=[],n.length&&t.push((0,j.jsx)(`ul`,{style:{margin:`4px 0 8px`,paddingLeft:20,lineHeight:1.6},children:n.map((e,t)=>(0,j.jsx)(`li`,{children:Ln(e)},t))},`l${t.length}`)),n=[],r.length){let[e,...n]=r,i=n.filter(e=>!/^\s*\|?\s*:?-{2,}/.test(e));t.push((0,j.jsx)(`div`,{style:{overflowX:`auto`,position:`relative`,margin:`6px 0 10px`},tabIndex:0,role:`region`,"aria-label":w.app.scrollTable(Rn(e).join(`, `)),children:(0,j.jsxs)(`table`,{style:{borderCollapse:`collapse`,width:`100%`,fontSize:12},children:[(0,j.jsx)(`thead`,{children:(0,j.jsx)(`tr`,{children:Rn(e).map((e,t)=>(0,j.jsx)(`th`,{className:`hud`,style:{textAlign:`left`,fontWeight:400,fontSize:10,padding:`4px 10px 6px 0`},children:e},t))})}),(0,j.jsx)(`tbody`,{children:i.map((e,t)=>(0,j.jsx)(`tr`,{style:{borderTop:`1px solid var(--rule)`,verticalAlign:`top`},children:Rn(e).map((e,t)=>(0,j.jsx)(`td`,{style:{padding:`6px 10px 6px 0`,color:`var(--text-2)`},children:Ln(e)},t))},t))})]})},`t${t.length}`))}r=[]},o=!1,s=[];for(let c of e.split(`
|
|
14
|
+
`)){let e=c.trimEnd();if(/^```/.test(e)){o?(t.push((0,j.jsx)(`pre`,{className:`mono`,tabIndex:0,role:`region`,"aria-label":w.app.scrollCode,style:{fontSize:11.5,background:`var(--box)`,border:`1px solid var(--line)`,borderRadius:8,padding:10,overflowX:`auto`},children:s.join(`
|
|
15
|
+
`)},`c${t.length}`)),s=[]):a(),o=!o;continue}if(o){s.push(c);continue}let l=/^(#{1,4})\s+(.*)$/.exec(e),u=/^\s*(?:[-*]|\d+\.)\s+(?:\[[ xX]\]\s+)?(.*)$/.exec(e);if(e.trimStart().startsWith(`|`)){if(n.length){let e=r;r=[],a(),r=e}r.push(e)}else if(r.length&&a(),l){a();let e=l[1].length;t.push((0,j.jsx)(`div`,{className:e<=2?`h`:`hud`,style:{margin:`12px 0 6px`,fontSize:e<=1?16:e===2?14:11},children:Ln(l[2])},t.length))}else u?(i.length&&a(),n.push(u[1])):!e.trim()||/^<!--/.test(e)?a():(n.length&&a(),i.push(e.trim()))}return a(),(0,j.jsx)(`div`,{children:t})}function Bn(e){return e instanceof M?e.problem.detail??e.problem.title:e instanceof Error?e.message:String(e)}function Vn(){let[e,t]=(0,v.useState)(!1),[n,r]=(0,v.useState)();return{busy:e,note:n,run:async(e,n)=>{t(!0),r({ok:!0,text:w.app.working,working:!0});try{let t=await e();r({ok:!0,text:typeof n==`function`?n(t):n})}catch(e){r({ok:!1,text:Bn(e)})}finally{t(!1)}}}}function Hn(){let[e,t]=(0,v.useState)();return{said:e,say:e=>t(t=>({text:e,n:(t?.n??0)+1}))}}function Un({said:e}){let t=(0,v.useRef)(null);return(0,v.useEffect)(()=>{e&&jt(t.current)},[e?.n]),(0,j.jsx)(`p`,{ref:t,tabIndex:-1,role:`status`,style:{margin:e?`0 0 8px`:0,fontSize:12.5,color:`var(--green)`},children:e?.text??``})}function Wn({note:e}){let t=(0,v.useRef)(null),n=e&&!e.working?e.text:void 0;return(0,v.useEffect)(()=>{n!==void 0&&jt(t.current)},[n]),e?(0,j.jsx)(`p`,{ref:t,tabIndex:-1,role:e.ok?`status`:`alert`,"aria-busy":e.working?!0:void 0,style:{margin:`8px 0 0`,whiteSpace:`pre-line`,color:e.working?`var(--text-2)`:e.ok?`var(--green)`:`var(--magenta-text)`,fontSize:12.5},children:e.text}):null}function Gn(e){return(0,j.jsx)(`div`,{style:{overflowX:`auto`,position:`relative`},tabIndex:0,role:`region`,"aria-label":e.caption??jn.table,children:(0,j.jsxs)(`table`,{style:{width:`100%`,borderCollapse:`collapse`,fontSize:12.5,minWidth:480},children:[e.caption&&(0,j.jsx)(`caption`,{className:`sr`,children:e.caption}),(0,j.jsx)(`thead`,{children:(0,j.jsx)(`tr`,{className:`hud`,style:{textAlign:`left`,fontSize:10},children:e.cols.map(e=>(0,j.jsx)(`th`,{scope:`col`,style:{padding:`4px 8px 6px 0`,fontWeight:400,width:e.width},children:e.label},e.label))})}),(0,j.jsx)(`tbody`,{children:e.rows.map(t=>(0,j.jsx)(`tr`,{style:{borderTop:`1px solid var(--rule)`,verticalAlign:`top`},children:e.cols.map(e=>(0,j.jsx)(`td`,{className:e.mono?`mono`:void 0,style:{padding:`7px 8px 7px 0`,wordBreak:`break-word`},children:e.cell(t)},e.label))},e.rowKey(t)))})]})})}var Kn=e=>Array.isArray(e)?e.join(`, `):e==null?``:String(e);function qn(){return de()||(typeof document>`u`?``:document.querySelector(`meta[name="atticus-page-key"]`)?.content??``)}async function Jn(e,t){let n=n=>N(`/api/confirmations`,{method:`POST`,body:{write:e,target:t,pageKey:n}}),r=qn(),i;try{i=await n(r)}catch(e){if(!(e instanceof M&&e.problem.status===403)||qn()===r)throw e;i=await n(qn())}return i?.confirmation?{confirmation:i.confirmation}:{}}function Yn(e){let t=e?.next;if(!t||t.step!==`sync`||!Array.isArray(t.repos))return;let n=t.repos.filter(e=>typeof e==`string`&&e!==``);return n.length?{step:`sync`,repos:n}:void 0}function Xn(e){if(e instanceof Zn)return e.next;if(e instanceof M)return Yn(e.problem)}var Zn=class extends Error{lines;next;code;result;constructor(e,t,n,r,i){super(e),this.lines=t,this.next=n,this.code=r,this.result=i}};async function Qn(e,t,n=e=>new Promise(t=>setTimeout(t,e)),r){let{jobId:i}=await N(e,{method:`POST`,body:t});for(r?.(i);;){let e=await N(`/api/jobs/${encodeURIComponent(i)}`,{quiet:!0});if(e.state!==`running`&&e.state!==`queued`){let t=e.result?.code??(e.state===`done`?0:1),n=e.state!==`done`||t!==0,r=e.result?.lines??[],i=e.errors??[],a=n?i.length?i:r:r.length?r:i;if(n)throw new Zn(a.join(` `)||e.state,a,Yn(e.result),e.result?.code,e.result);return{code:t,lines:a,...e.result?{result:e.result}:{}}}await n(700)}}var $n=w.appStep;function er({repos:e,onSynced:t}){let n=Vn(),[r,i]=(0,v.useState)(),[a,o]=(0,v.useState)(!1);return e.length?(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:a?$n.syncFirstDone(e.join(`, `)):$n.syncFirstSay(e.join(`, `))}),!a&&(0,j.jsxs)(`div`,{className:`row`,style:{gap:6,alignItems:`center`},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:n.busy,onClick:()=>void n.run(async()=>{await Qn(`/api/workspace/sync`,{repos:e},void 0,i),o(!0),t?.()},$n.synced),children:n.busy?$n.syncing:$n.sync}),n.busy&&(0,j.jsx)(An,{id:r})]}),(0,j.jsx)(Wn,{note:n.note})]}):null}var tr=w.runShared;function nr(e){return e instanceof M?e.problem.detail??e.problem.title:e instanceof Error?e.message:String(e)}function rr(e,t){return e.replace(/Re-run with --force to [^.]*\./,t)}var ir=e=>t=>{throw Error(rr(nr(t),e))};function ar(){let[e,t]=(0,v.useState)(!1),[n,r]=(0,v.useState)();return{busy:e,note:n,run:async(e,n)=>{t(!0),r({ok:!0,text:w.app.working,working:!0});try{let t=await e();r({ok:!0,text:typeof n==`string`?n:n(t)})}catch(e){r({ok:!1,text:nr(e)})}finally{t(!1)}},clear:()=>r(void 0)}}function or({note:e}){let t=(0,v.useRef)(null),n=e&&!e.working?e.text:void 0;return(0,v.useEffect)(()=>{n!==void 0&&jt(t.current)},[n]),e?(0,j.jsx)(`p`,{ref:t,tabIndex:-1,role:e.ok?`status`:`alert`,"aria-busy":e.working?!0:void 0,className:`run-note ${e.working?`working`:e.ok?`ok`:`bad`}`,children:e.text}):null}function sr({text:e,label:t}){let[n,r]=(0,v.useState)();return(0,j.jsx)(`button`,{type:`button`,className:`btn run-copy`,"aria-label":t,onClick:()=>{navigator.clipboard?navigator.clipboard.writeText(e).then(()=>r(`copied`),()=>r(`failed`)):r(`failed`),setTimeout(()=>r(void 0),2e3)},children:n===`copied`?tr.copied:n===`failed`?tr.selectAndCopy:tr.copy})}function cr({rows:e}){return(0,j.jsx)(`dl`,{className:`run-facts`,children:e.map(([e,t])=>(0,j.jsxs)(`div`,{style:{display:`contents`},children:[(0,j.jsx)(`dt`,{className:`hud`,children:e}),(0,j.jsx)(`dd`,{children:t})]},e))})}function lr(e){return(0,j.jsx)(`div`,{role:`group`,"aria-label":e.label,className:`row run-choice`,children:e.options.map(t=>(0,j.jsx)(`button`,{type:`button`,className:`btn ${e.value===t.value?`on`:``}`,"aria-pressed":e.value===t.value,onClick:()=>e.onChange(t.value),children:t.label},t.value))})}function ur({type:e}){return e?e===`manual`?(0,j.jsx)(`span`,{className:`chip warn`,children:tr.manual}):e===`mock`?(0,j.jsx)(`span`,{className:`chip dim`,children:tr.mock}):(0,j.jsx)(`span`,{className:`chip done`,children:tr.connected(e.toUpperCase())}):(0,j.jsx)(`span`,{className:`chip dim`,children:tr.notSet})}var dr={"work-tracker":tr.workTracker,"service-desk":tr.serviceDesk,"git-host":tr.gitHost,wiki:tr.wiki,notify:tr.notifications,design:tr.designTool},fr=e=>e?e.slice(0,10):``,pr=(e,t)=>`${e} ${t}${e===1?``:`s`}`,mr=w.upgrade,hr=`atticus upgrade`;function gr(e){let{view:t,run:n}=e;if(t.newer&&t.stamp)return(0,j.jsx)(`div`,{className:`state error`,role:`alert`,children:mr.newer(t.stamp,t.atticus)});if(!t.pending.length&&n.state!==`done`)return null;let r=n.state===`done`&&n.upgraded!==void 0&&!n.upgraded.length;return(0,j.jsxs)(`section`,{className:`state upgrade-panel`,"aria-labelledby":`home-upgrade`,style:{display:`grid`,gap:6,textAlign:`start`},children:[(0,j.jsx)(`h2`,{id:`home-upgrade`,className:`hud`,style:{margin:0,fontSize:11},children:mr.title}),n.state!==`done`&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{style:{margin:0},children:mr.intro(t.pending.length)}),(0,j.jsx)(`ul`,{style:{margin:0},children:t.pending.map(e=>(0,j.jsx)(`li`,{children:mr.step(e.summary,e.files.length)},e.id))}),(0,j.jsx)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`},children:(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:n.state===`running`,"aria-busy":n.state===`running`,onClick:e.onRun,children:n.state===`running`?mr.running:mr.run})}),(0,j.jsxs)(`details`,{children:[(0,j.jsx)(`summary`,{className:`hud`,children:mr.terminal}),(0,j.jsxs)(`div`,{className:`work-cmd`,children:[(0,j.jsx)(`code`,{className:`mono`,children:hr}),(0,j.jsx)(sr,{text:hr,label:w.decisions.copy(hr)})]})]})]}),(n.state===`done`||n.state===`failed`)&&(0,j.jsxs)(`div`,{role:n.state===`done`?`status`:`alert`,children:[(0,j.jsx)(`p`,{style:{margin:0},children:n.state===`failed`?mr.failed:r?mr.doneStampOnly:mr.done}),n.lines.length>0&&(0,j.jsx)(`pre`,{className:`mono`,style:{whiteSpace:`pre-wrap`,margin:0,fontSize:11.5},children:n.lines.join(`
|
|
16
|
+
`)})]}),n.state===`done`&&(0,j.jsx)(Yc,{scope:`upgrade`,onDone:Kc})]})}function _r({only:e,part:t}={}){let n=P(`/api/upgrade`);lt(n);let[r,i]=(0,v.useState)({state:`idle`});if(n.state!==`ready`)return null;let a=!!(n.data.newer&&n.data.stamp);return t===`newer`&&!a||t===`pending`&&a||e&&r.state===`idle`&&!n.data.pending.some(t=>t.id.startsWith(e))?null:(0,j.jsx)(gr,{view:n.data,run:r,onRun:()=>{i({state:`running`}),Qn(`/api/upgrade`,{}).then(e=>{let t=e.result?.upgraded;i({state:`done`,lines:e.lines,...Array.isArray(t)?{upgraded:t.filter(e=>typeof e==`string`)}:{}}),n.reload(),Kc()},e=>i({state:`failed`,lines:[e instanceof Error?e.message:String(e)]}))}})}var vr=w.newChange,yr=e=>e.toLowerCase().normalize(`NFKD`).replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,60).replace(/-+$/,``);function br(e){let[t,n]=(0,v.useState)(e.open??!1),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(),[s,c]=(0,v.useState)(``),l=P(t?`/api/change-types`:void 0),u=Vn(),d=(0,v.useId)();if(!t)return(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,onClick:()=>n(!0),children:vr.start});let f=a??yr(r),p=l.state===`ready`?l.data:[],m=s||p[0]?.id||``,h=r.trim()!==``&&f!==``&&m!==``,g=()=>void u.run(async()=>{await N(`/api/changes`,{method:`POST`,body:{id:f,title:r.trim(),type:m}}),e.onCreated?e.onCreated(f):window.location.hash=`#/changes/${f}`,n(!1),i(``),o(void 0)},vr.created(f));return(0,j.jsxs)(`form`,{className:`stack`,style:{gap:6},"aria-label":vr.title,onSubmit:e=>{e.preventDefault(),h&&!u.busy&&g()},children:[(0,j.jsx)(`label`,{htmlFor:`${d}-title`,className:`hud`,style:{fontSize:10},children:vr.titleLabel}),(0,j.jsx)(`input`,{id:`${d}-title`,className:`field`,value:r,placeholder:vr.titleHint,onChange:e=>i(e.target.value)}),(0,j.jsx)(`label`,{htmlFor:`${d}-id`,className:`hud`,style:{fontSize:10},children:vr.idLabel}),(0,j.jsx)(`input`,{id:`${d}-id`,className:`field mono`,value:f,onChange:e=>o(e.target.value)}),(0,j.jsx)(`label`,{htmlFor:`${d}-type`,className:`hud`,style:{fontSize:10},children:vr.typeLabel}),l.state===`error`?(0,j.jsx)(`p`,{role:`alert`,className:`state error`,children:vr.noTypes(l.error)}):(0,j.jsx)(`select`,{id:`${d}-type`,className:`field`,value:m,"aria-busy":l.state===`loading`||void 0,onChange:e=>c(e.target.value),children:p.map(e=>(0,j.jsx)(`option`,{value:e.id,children:e.name},e.id))}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:!h||u.busy,children:u.busy?vr.starting:vr.create}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>n(!1),children:vr.cancel})]}),(0,j.jsx)(Wn,{note:u.note})]})}var xr=w.runStep,Sr=new Set([`scan survey`,`scan verify`,`spec draft`,`knowledge scan`,`change feature`,`change architecture`,`change small`,`change draft`,`plan stories`,`change needs`,`knowledge find`,`knowledge ask`]);function Cr(e){let t=[],n=/"((?:[^"\\]|\\.)*)"|'([^']*)'|(\S+)/g,r;for(;r=n.exec(e);)if(r[1]!==void 0)t.push(r[1].replace(/\\(.)/g,`$1`));else if(r[2]!==void 0)t.push(r[2]);else if(/["']/.test(r[3]))return;else t.push(r[3]);return t}function wr(e){let t=Cr(e.trim());if(!t||t[0]!==`atticus`||t.length<3)return;let n=t.slice(1),r=n[0]===`critic`&&n[1]!==`stats`,i=n[0]===`map`&&n.length===2&&n[1]!==`render`;if((r||i||Sr.has(`${n[0]} ${n[1]}`))&&!Er(Or(n)).some(e=>e.startsWith(`-`)||/[<>]/.test(e)||e.trim()===``))return n}var Tr=new Set([`plan stories`]);function Er(e){if(!Tr.has(`${e[0]} ${e[1]}`))return e;let t=e.indexOf(`--force`);return t<0?e:[...e.slice(0,t),...e.slice(t+1)]}var Dr=new Set([`knowledge scan`,`knowledge find`]);function Or(e){if(!Dr.has(`${e[0]} ${e[1]}`))return e;let t=e.indexOf(`--source`),n=e[t+1];return t<0||!n||n.startsWith(`-`)?e:[...e.slice(0,t),...e.slice(t+2)]}function kr(e){return e.panel?{kind:`copilot`}:typeof e.serverModel==`string`&&e.serverModel?{kind:`model`,model:e.serverModel}:{kind:`copy`}}var Ar;function jr(e){let[t,n]=(0,v.useState)(void 0);return(0,v.useEffect)(()=>{if(!e)return;let t=!0;return Ar??=N(`/api/runs?limit=1`).then(e=>e.serverModel??null,()=>(Ar=void 0,null)),Ar.then(e=>{t&&n(e)}),()=>{t=!1}},[e]),t}var Mr=new Set([`done`,`failed`,`cancelled`]);async function Nr(e,t){let n=await t.call(`/api/runs`,{method:`POST`,body:{args:e}});t.onJob?.(n.jobId),t.onLine(xr.started(n.model));let r=``;for(;;){let e=await t.call(`/api/jobs/${encodeURIComponent(n.jobId)}`),i=e.progress?.message??``;if(i&&i!==r&&t.onLine(i),r=i,Mr.has(e.state)){let n=e.result??{},r=Array.isArray(n.lines)?n.lines.filter(e=>typeof e==`string`):e.errors,i=e.state===`done`?n.code===0||n.code===void 0?`done`:`stopped`:e.state,a=typeof n.runId==`string`?n.runId:await t.call(`/api/runs?limit=1`).then(t=>t.runs.find(t=>t.startedAt>=e.startedAt)?.runId).catch(()=>void 0),o=Yn(n);return{state:i,lines:r,...a?{runId:a}:{},...o?{next:o}:{},...typeof n.applied==`string`?{applied:n.applied}:{}}}await t.wait(700)}}var Pr=e=>(t,n)=>e(t,{...n,quiet:!n?.method||n.method===`GET`}),Fr=e=>e instanceof M?e.problem.detail??e.problem.title:e instanceof Error?e.message:String(e),Ir=new Set([`refused`,`not-started`]);function Lr(e){return Ir.has(e.state)?xr.refused(e.lines[0]??e.state):xr.ends[e.state]??xr.ended(e.state)}function Rr(e){let t=(0,v.useId)();if(e.choice.kind===`copy`)return null;let n=e.choice.kind===`copilot`?xr.withCopilot:xr.withModel(e.choice.model),r=e.choice.kind===`copilot`?xr.hintCopilot:xr.hintModel(e.choice.model),i=e.state.phase===`running`,a=e.state;return(0,j.jsxs)(`div`,{className:`runstep stack`,children:[(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`,alignItems:`center`},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:i,"aria-describedby":`${t}-why`,onClick:e.onRun,children:i?xr.running:n}),i&&e.onCancel&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:e.stopping,title:xr.cancelHint,onClick:e.onCancel,children:e.stopping?xr.cancelling:xr.cancel}),(0,j.jsx)(`span`,{id:`${t}-why`,className:`muted`,style:{fontSize:12},children:i?xr.busy:r})]}),(0,j.jsxs)(`div`,{"aria-live":`polite`,className:`runstep-live`,children:[a.lines.length>0&&(0,j.jsx)(`ul`,{className:`runstep-lines mono`,"aria-label":xr.progress,children:a.lines.map((e,t)=>(0,j.jsx)(`li`,{children:e},`${t}:${e}`))}),a.phase===`ended`&&(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`p`,{className:`runstep-end`,children:Lr(a.end)}),!Ir.has(a.end.state)&&a.end.lines.length>0&&(0,j.jsx)(`pre`,{className:`runstep-out`,tabIndex:0,role:`region`,"aria-label":xr.output,children:a.end.lines.join(`
|
|
17
|
+
`)}),!Ir.has(a.end.state)&&(0,j.jsx)(`a`,{href:a.end.runId?`#/runs?run=${encodeURIComponent(a.end.runId)}`:`#/runs`,children:a.end.runId?xr.openRun:xr.openRuns}),a.end.next&&(0,j.jsx)(er,{repos:a.end.next.repos})]})]}),a.phase===`error`&&(0,j.jsx)(`p`,{role:`alert`,className:`run-note bad`,children:xr.cantStart(a.error)})]})}function zr({command:e,args:t}){let n=t??(e?wr(e):void 0),r=A(),i=jr(!!n&&!r),[a,o]=(0,v.useState)({phase:`idle`,lines:[]}),[s,c]=(0,v.useState)(),[l,u]=(0,v.useState)(!1),d=(0,v.useRef)(!0);if((0,v.useEffect)(()=>(d.current=!0,()=>{d.current=!1}),[]),!n)return null;let f=kr({panel:!!r,serverModel:i}),p=e=>{d.current&&o(t=>({phase:`running`,lines:[...t.lines,e]}))},m=()=>{o({phase:`running`,lines:[]}),c(void 0),u(!1),(r?r.runStep(n,p):Nr(n,{call:Pr(N),wait:e=>new Promise(t=>setTimeout(t,e)),onLine:p,onJob:e=>{d.current&&c(e)}})).then(e=>{d.current&&o(t=>({phase:`ended`,lines:t.lines,end:e}))},e=>{d.current&&o(t=>({phase:`error`,lines:t.lines,error:Fr(e)}))})},h=s?()=>{u(!0),N(`/api/jobs/${encodeURIComponent(s)}/cancel`,{method:`POST`,body:{}}).catch(()=>void 0)}:void 0;if(f.kind===`copy`&&i===null)return(0,j.jsx)(Hr,{args:n});let g=Br(n,a.phase===`ended`?a.end.lines.join(`
|
|
18
|
+
`):a.phase===`error`?a.error:``);return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(Rr,{choice:f,state:a,onRun:m,...h?{onCancel:h}:{},stopping:l}),g&&(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:w.app.forceStories(n[2]??``)}),(0,j.jsx)(zr,{args:g})]})]})}function Br(e,t){if(!(e[0]!==`plan`||e[1]!==`stories`||e.includes(`--force`)))return/Re-run with --force\b/.test(t)?[...e,`--force`]:void 0}var Vr=(e,t)=>Br(e,t)?t.replace(/Re-run with --force to [^.]*\./,w.app.forceStories(e[2]??``)):t;function Hr({args:e}){let[t,n]=(0,v.useState)({s:`idle`}),r=(0,v.useId)();return t.s===`said`?(0,j.jsx)(`p`,{role:`status`,className:`work-say`,style:{margin:0},children:t.lines.join(` `)}):t.s===`ready`?(0,j.jsxs)(`p`,{role:`status`,className:`work-say`,style:{margin:0},children:[t.still?xr.handoffStill:xr.handoffReady,` `,(0,j.jsx)(`a`,{className:`btn primary`,href:`#/runs?run=${encodeURIComponent(t.runId)}`,children:xr.handoffOpen})]}):(0,j.jsxs)(`div`,{className:`runstep stack`,children:[(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`,alignItems:`center`},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:t.s===`working`,"aria-describedby":`${r}-why`,onClick:()=>{n({s:`working`}),N(`/api/runs/handoff`,{method:`POST`,body:{args:e}}).then(e=>n(e.runId?{s:`ready`,runId:e.runId,...e.stillWaiting?{still:!0}:{}}:{s:`said`,lines:e.lines})).catch(e=>{let t=Fr(e),r=/\b(run-[0-9a-z-]+)\b/.exec(t)?.[1],i=Xn(e);n({s:`error`,why:t,...r?{runId:r}:{},...i?{sync:i.repos}:{}})})},children:t.s===`working`?xr.handoffWorking:e[0]===`map`?xr.handoffRead:e.includes(`--force`)?w.appStep.storiesAgain:xr.handoffPrepare}),(0,j.jsx)(`span`,{id:`${r}-why`,className:`muted`,style:{fontSize:12},children:e[0]===`map`?xr.handoffReadHint:xr.handoffHint})]}),t.s===`error`&&(0,j.jsxs)(`p`,{role:`alert`,className:`run-note bad`,children:[xr.cantStart(Vr(e,t.why)),` `,t.runId&&(0,j.jsx)(`a`,{href:`#/runs?run=${encodeURIComponent(t.runId)}`,children:xr.handoffOpenWaiting})]}),t.s===`error`&&t.sync&&(0,j.jsx)(er,{repos:t.sync,onSynced:()=>n({s:`idle`})}),t.s===`error`&&Br(e,t.why)&&(0,j.jsx)(Hr,{args:Br(e,t.why)})]})}function Ur(e){return e.replace(/\s*\((?:atticus |\/atticus-)[^)]*\)/g,``).replace(/\s*\(not-relevant --reason, or waive\)/g,` (Not relevant, or Waive)`).replace(/: pass --repo, or set metarepo under/g,`: set metarepo under`).replace(/[ \t]+/g,` `).trim()}function Wr(e){return Ur(e).replace(/\s*\(ADRs? \d{4}[^)]*\)/g,``).replace(/[ \t]+([.;,:])/g,`$1`).replace(/[ \t]+/g,` `).trim()}function Gr(e,t,n){return n||(t?Wr(e):e)}var Kr=w.artifactStatus;function qr(e){return e.status===`done`?Kr.written:e.status===`not-required`?Kr.notRequired:e.written===!1?Kr.notWritten:e.written===!0?Kr.needsWork:e.status===`blocked`?Kr.blocked:Kr.ready}var Jr=w.me,Yr=(0,v.createContext)({saveNotify:async()=>void 0});function Xr({children:e}){let t=P(`/api/me`),[n,r]=(0,v.useState)(),i=n??(t.state===`ready`?t.data:void 0),a=async e=>{r(await N(`/api/me/notify`,{method:`PUT`,body:e}))};return(0,j.jsx)(Yr.Provider,{value:{...i?{me:i}:{},...t.state===`error`?{error:t.error}:{},reload:t.reload,saveNotify:a},children:e})}var Zr=()=>(0,v.useContext)(Yr),Qr=()=>Zr().me?.ai!==`off`,$r=Jr.aiIsOffHere,ei=e=>e.toLowerCase().split(/\s+/).filter(Boolean);function ti(e,t){let n=ei(t);if(!n.length)return!0;let r=e.filter(e=>!!e).map(e=>e.toLowerCase());return n.every(e=>r.some(t=>t.includes(e)))}var ni=w.filter;function ri(e){return[e.text?.trim()?ni.words(e.text.trim()):``,e.kind?ni.among(e.kind):``,e.repo?ni.inRepo(e.repo):``,e.change?ni.inChange(e.change):``].filter(Boolean).join(` `)}function ii(e){return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4,...e.grow?{flex:`1 1 200px`}:{}},children:[(0,j.jsx)(`label`,{htmlFor:e.id,className:`hud`,style:{fontSize:10},children:e.label??ni.label}),(0,j.jsx)(`input`,{id:e.id,className:`field`,value:e.value,placeholder:ni.placeholder,autoComplete:`off`,onChange:t=>e.onChange(t.target.value)})]})}function ai(e){return(0,j.jsx)(`p`,{className:`hud`,"aria-live":`polite`,style:{margin:0,fontSize:10,minHeight:`1em`},children:e.active?ni.shown(e.shown,e.total):``})}function oi(e){return(0,j.jsxs)(`div`,{className:`state stack`,style:{gap:8,alignItems:`flex-start`},children:[(0,j.jsx)(`span`,{children:ni.nothingMatches(e.what)}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>{e.onClear(),e.focus&&document.getElementById(e.focus)?.focus()},children:ni.clear})]})}var L=w.runs;function si(e){let t=e.label??(e.change?L.forChange(e.change):L.all);return(0,j.jsx)(`a`,{className:`runs-link`,href:ci({...e.change?{change:e.change}:{},...e.q?{q:e.q}:{}}),children:t})}function ci(e){let t=new URLSearchParams;e.change&&t.set(`change`,e.change),e.q&&t.set(`q`,e.q),e.run&&t.set(`run`,e.run);let n=t.toString();return`#/runs${n?`?${n}`:``}`}var li=e=>L.states[e]??e,ui=e=>e.replace(`T`,` `).slice(0,16),di=e=>e?L.classes[e]??e:void 0,fi=e=>L.modelCell(di(e.stepClass),e.model);function pi(e,t){return e.filter(e=>ti([e.change,e.agent,e.runId,e.state,li(e.state),e.runtime,e.model??``,di(e.stepClass)??``],t))}function mi(e){return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[e.change&&(0,j.jsxs)(`p`,{className:`work-say`,style:{margin:0},children:[L.onlyFor(e.change),` `,(0,j.jsx)(`a`,{href:`#/runs`,children:L.showAll})]}),(0,j.jsx)(I,{of:e.of,empty:e=>e.runs.length===0,emptyContent:(0,j.jsx)(`div`,{className:`state`,children:e.change?L.emptyFor(e.change):L.empty}),children:t=>{let n=pi(t.runs,e.text);return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`div`,{role:`search`,children:(0,j.jsx)(ii,{id:`runs-find`,value:e.text,onChange:t=>e.onText?.(t)})}),(0,j.jsx)(ai,{shown:n.length,total:t.runs.length,active:!!e.text.trim()}),n.length===0?(0,j.jsx)(oi,{what:ri({text:e.text}),onClear:()=>e.onClear?.(),focus:`runs-find`}):(0,j.jsx)(Gn,{caption:L.caption,rows:n,rowKey:e=>e.runId,cols:[{label:L.cols.step,cell:t=>(0,j.jsxs)(`a`,{href:ci({run:t.runId}),"aria-current":t.runId===e.current?`page`:void 0,children:[t.change,(0,j.jsx)(`span`,{className:`mono runs-id`,children:t.runId})]})},{label:L.cols.agent,cell:e=>e.agent,mono:!0},{label:L.cols.model,cell:e=>fi(e)},{label:L.cols.round,cell:e=>e.attempt},{label:L.cols.state,cell:e=>(0,j.jsx)(`span`,{className:`chip ${hi[e.state]??`dim`}`,children:li(e.state)})},{label:L.cols.answered,cell:e=>e.answered?L.yes:L.notYet},{label:L.cols.handedBack,cell:e=>L.problems(e.handedBack)},{label:L.cols.when,cell:e=>(0,j.jsx)(`time`,{dateTime:e.startedAt,children:ui(e.startedAt)}),mono:!0}]})]})}})]})}var hi={validated:`done`,produced:`warn`,waiting:`warn`,failed:`blocking`};function gi({text:e,label:t}){return(0,j.jsx)(`pre`,{className:`runs-text`,tabIndex:0,role:`region`,"aria-label":L.textBox(t),children:e})}function _i(e,t){let n=new Set(t.map(e=>e.trim())),r=e.split(`
|
|
19
|
+
`).map(e=>e.trim()).filter(e=>e&&!n.has(e));return r.length?r.join(`
|
|
20
|
+
`):L.failedStill}function vi(e){let t=Vn(),[n,r]=(0,v.useState)(),i=(n,i,a=!1)=>void t.run(()=>(a?Ze(n):N(n,{method:`POST`,body:{}})).catch(t=>{throw Error(e.failed?_i(Bn(t),e.failed):Bn(t))}).then(e=>{r({lines:e.lines??[],...e.next?{next:e.next}:{}}),e.applied?(se({text:w.appStep.readOnMap(e.applied),href:`#/canvas`,link:w.appStep.openMap}),Kc()):(e.next||e.lines?.length)&&se({text:(e.lines??[]).filter(e=>!/^\s*(Next: )?atticus |run atticus handoff done/.test(e)).slice(-3).join(` `),...e.next?{href:ci({run:e.next}),link:L.nextPrompt}:{}})}).finally(()=>e.reload?.()),i);return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,j.jsx)(`p`,{className:`work-say`,children:e.failed?L.failedAgainSay:L.waitingSay}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:6},children:[e.prompt&&(0,j.jsx)(sr,{text:e.prompt,label:L.copyPrompt}),(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:t.busy,onClick:()=>i(`/api/runs/${e.runId}/done`,L.doneOk,!0),children:L.done}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:t.busy,onClick:()=>i(`/api/runs/${e.runId}/cancel`,L.cancelled),children:L.cancel})]}),(0,j.jsx)(Wn,{note:t.note}),n&&(0,j.jsxs)(`div`,{role:`status`,className:`stack`,style:{gap:4},children:[n.lines.length>0&&(0,j.jsx)(`pre`,{className:`mono`,style:{whiteSpace:`pre-wrap`,margin:0,fontSize:11.5},children:n.lines.join(`
|
|
21
|
+
`)}),n.next&&(0,j.jsx)(`a`,{className:`btn primary`,href:ci({run:n.next}),children:L.nextPrompt})]})]})}function yi(e){return e.parts?.length?(0,j.jsxs)(`section`,{"aria-labelledby":`run-parts`,className:`stack`,style:{gap:4},children:[(0,j.jsx)(`h3`,{id:`run-parts`,className:`hud runs-h`,children:L.batch.parts}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:L.batch.partsSay}),(0,j.jsx)(`ul`,{style:{margin:0,paddingLeft:18},children:e.parts.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`a`,{href:ci({run:e.runId}),children:L.batch.lens(e.name)}),e.state&&(0,j.jsxs)(`span`,{className:`muted`,children:[` `,li(e.state)]})]},e.runId))})]}):null}function bi(e){return(0,j.jsx)(I,{of:e.of,children:t=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:14},children:[(0,j.jsx)(cr,{rows:[[L.facts.agent,(0,j.jsx)(`span`,{className:`mono`,children:t.run.agent})],[L.facts.runtime,t.run.runtime],...t.run.stepClass?[[L.facts.stepClass,di(t.run.stepClass)]]:[],[L.facts.model,t.run.model?(0,j.jsx)(`span`,{className:`mono`,children:t.run.model}):L.modelNotRecorded],[L.facts.state,li(t.run.state)],[L.facts.started,(0,j.jsx)(`time`,{dateTime:t.run.startedAt,children:ui(t.run.startedAt)})],...t.run.finishedAt?[[L.facts.finished,(0,j.jsx)(`time`,{dateTime:t.run.finishedAt,children:ui(t.run.finishedAt)})]]:[],...t.run.promptTokens===void 0?[]:[[L.facts.size,L.tokens(t.run.promptTokens)]],...t.run.promptPath?[[L.facts.file,(0,j.jsx)(`code`,{className:`mono`,children:t.run.promptPath})]]:[],...t.run.batch?[[L.batch.askedIn,(0,j.jsx)(`a`,{href:ci({run:t.run.batch}),children:L.batch.askedInLink})]]:[]]}),(0,j.jsx)(yi,{parts:t.run.parts}),t.run.state===`failed`&&(t.run.errors??[]).length>0&&(0,j.jsxs)(`div`,{role:`alert`,className:`stack`,style:{gap:4},children:[(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:L.failedSay}),(0,j.jsx)(`ul`,{style:{margin:0,paddingLeft:18},children:t.run.errors.map(e=>(0,j.jsx)(`li`,{children:e},e))})]}),(t.run.state===`waiting`||t.run.state===`prepared`||t.run.state===`failed`&&t.run.runtime===`hand-off`)&&(0,j.jsx)(vi,{runId:t.run.runId,reload:e.of.reload,prompt:t.prompt,failed:t.run.state===`failed`?t.run.errors??[]:void 0}),t.rounds.length>1&&(0,j.jsxs)(`nav`,{"aria-label":L.rounds,children:[(0,j.jsx)(`h3`,{className:`hud runs-h`,children:L.rounds}),(0,j.jsx)(`ol`,{className:`runs-rounds`,children:t.rounds.map((e,n)=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`a`,{href:ci({run:e.runId}),"aria-current":e.runId===t.run.runId?`page`:void 0,children:L.round(n+1)}),` `,(0,j.jsx)(`span`,{className:`muted`,children:li(e.state)}),e.runId===t.run.runId&&(0,j.jsxs)(`span`,{className:`muted`,children:[` `,L.thisRound]})]},e.runId))})]}),(0,j.jsxs)(`div`,{className:`runs-pair`,children:[(0,j.jsxs)(`section`,{"aria-labelledby":`run-prompt`,children:[(0,j.jsx)(`h3`,{id:`run-prompt`,className:`hud runs-h`,children:L.prompt}),(0,j.jsx)(gi,{text:t.prompt,label:L.prompt})]}),(0,j.jsxs)(`section`,{"aria-labelledby":`run-answer`,children:[(0,j.jsx)(`h3`,{id:`run-answer`,className:`hud runs-h`,children:L.answer}),t.answer===void 0?(0,j.jsx)(`div`,{className:`state`,children:L.noAnswer}):(0,j.jsx)(gi,{text:t.answer,label:L.answer})]})]}),t.tools&&(0,j.jsxs)(`section`,{"aria-labelledby":`run-tools`,children:[(0,j.jsx)(`h3`,{id:`run-tools`,className:`hud runs-h`,children:L.tools.title}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:L.tools.offered(t.tools.offered.join(`, `),t.tools.calls.length)}),t.tools.stopped&&(0,j.jsx)(`p`,{className:`muted`,role:`note`,children:L.tools.stopped(t.tools.stopped)}),t.tools.calls.map((e,t)=>(0,j.jsxs)(`section`,{"aria-labelledby":`run-tool-${t}`,children:[(0,j.jsx)(`h4`,{id:`run-tool-${t}`,className:`runs-h4`,children:L.tools.call(e.round,e.name,e.tokens,e.error===!0)}),(0,j.jsx)(`pre`,{className:`runs-line`,children:JSON.stringify(e.input)}),(0,j.jsx)(gi,{text:e.output,label:L.tools.returned(e.name)})]},`${t}:${e.name}`))]}),t.retrieval&&(t.retrieval.expansion||t.retrieval.rerank||t.retrieval.meaning)&&(0,j.jsxs)(`section`,{"aria-labelledby":`run-retrieval`,children:[(0,j.jsx)(`h3`,{id:`run-retrieval`,className:`hud runs-h`,children:L.retrieval.title}),t.retrieval.expansion&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`p`,{className:`muted`,style:{margin:0},children:[L.retrieval.expansion(t.retrieval.expansion.run,t.retrieval.expansion.cached),` `,L.retrieval.terms(t.retrieval.expansion.terms.join(`; `))]}),(0,j.jsxs)(`ul`,{children:[t.retrieval.expansion.names.map(e=>(0,j.jsx)(`li`,{children:L.retrieval.name(e.name,e.id,e.new===!0,e.quote)},`n:${e.name}`)),t.retrieval.expansion.dropped.map(e=>(0,j.jsx)(`li`,{children:L.retrieval.dropped(e.name,e.why)},`d:${e.name}`))]})]}),t.retrieval.rerank&&(0,j.jsx)(`p`,{className:`muted`,children:t.retrieval.rerank.used?L.retrieval.rerank(t.retrieval.rerank.shown,t.retrieval.rerank.order.join(`, `),t.retrieval.rerank.dropped.join(`, `)):L.retrieval.rerankIgnored(t.retrieval.rerank.shown)}),t.retrieval.meaning&&(0,j.jsx)(`p`,{className:`muted`,children:L.retrieval.meaning(t.retrieval.meaning)})]}),(0,j.jsxs)(`section`,{"aria-labelledby":`run-back`,children:[(0,j.jsx)(`h3`,{id:`run-back`,className:`hud runs-h`,children:L.handedBack}),t.handedBack.length===0?(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:L.noneHandedBack}):t.handedBack.map(e=>(0,j.jsxs)(`div`,{className:`runs-pair`,children:[(0,j.jsxs)(`section`,{"aria-labelledby":`run-back-${e.attempt}`,children:[(0,j.jsx)(`h4`,{id:`run-back-${e.attempt}`,className:`runs-h4`,children:L.roundProblems(e.attempt)}),(0,j.jsx)(`ul`,{className:`runs-problems`,children:e.problems.map((e,t)=>(0,j.jsx)(`li`,{children:(0,j.jsx)(`pre`,{className:`runs-line`,children:e})},`${t}:${e}`))})]}),(0,j.jsxs)(`section`,{"aria-labelledby":`run-failed-${e.attempt}`,children:[(0,j.jsx)(`h4`,{id:`run-failed-${e.attempt}`,className:`runs-h4`,children:L.failedAnswer(e.attempt)}),e.previousAnswer===void 0?(0,j.jsx)(`p`,{className:`muted`,children:L.noFailedAnswer}):(0,j.jsx)(gi,{text:e.previousAnswer,label:L.failedAnswer(e.attempt)})]})]},e.attempt))]})]})})}function xi(e){let t=e.rounds.findIndex(t=>t.runId===e.run.runId);return t>=0?t+1:e.run.attempt}function Si(e,t,n){let r=e=>e===`waiting`||e===`prepared`;if(r(e.run.state))return;let i=encodeURIComponent(e.run.change),a=e.run.taskRun?.task;if(n?.has(e.run.change)&&(a||e.run.agent===`task-runner`))return{href:`#/tasks?change=${i}`,label:a?L.toTaskBoard(a):L.toTaskBoardAny};let o=t?.find(t=>t.change===e.run.change&&t.runId!==e.run.runId&&r(t.state));if(o)return{href:ci({run:o.runId}),label:L.toNextRun};if(n?.has(e.run.change))return{href:`#/cockpit?change=${i}`,label:L.toGlance(e.run.change)}}function Ci({hash:e}){let t=Nn(e,`change`),n=Nn(e,`run`),[r,i]=(0,v.useState)(Nn(e,`q`)??``),a=Nn(e,`q`);(0,v.useEffect)(()=>i(a??``),[a]);let o=P(`/api/runs${t?`?change=${encodeURIComponent(t)}`:``}`),s=P(n?`/api/runs/${encodeURIComponent(n)}/transcript`:void 0);St(e=>{e.type===`file.changed`&&(o.reload(),n&&s.reload())});let c=P(n?`/api/changes`:void 0),l=s.state===`ready`&&s.data.run.runId===n?s:{state:`loading`},u=l.state===`ready`?Si(l.data,o.state===`ready`?o.data.runs:void 0,c.state===`ready`?new Set(c.data.map(e=>e.id)):void 0):void 0,d=(0,v.useRef)(null),f=(0,v.useRef)(null),p=l.state===`ready`?l.data.run.state:void 0,m=(0,v.useRef)({run:void 0,state:void 0});return(0,v.useEffect)(()=>{if(!p)return;let e=m.current;e.run===n&&e.state&&e.state!==p&&jt(d.current??f.current),m.current={run:n,state:p}},[p,n]),(0,j.jsxs)(`div`,{className:`bento`,children:[n&&(0,j.jsxs)(F,{title:l.state===`ready`?L.runTitle(l.data.run.change,xi(l.data)):L.title,span:`1 / -1`,labelledBy:`run-detail`,children:[(0,j.jsxs)(`p`,{className:`row`,style:{margin:`0 0 10px`,gap:12,flexWrap:`wrap`},children:[u&&(0,j.jsx)(`a`,{ref:d,className:`btn primary`,href:u.href,children:u.label}),(0,j.jsx)(`a`,{ref:f,href:ci(t?{change:t}:{}),children:L.back})]}),s.state===`error`?(0,j.jsx)(bi,{of:{...s,error:s.error||L.missing(n)}}):(0,j.jsx)(bi,{of:l})]}),(0,j.jsxs)(F,{title:n?L.listTitle:L.title,span:`1 / -1`,children:[(0,j.jsx)(`p`,{className:`work-say`,style:{marginTop:0},children:L.intro}),(0,j.jsx)(mi,{of:o,text:r,onText:i,onClear:()=>i(``),...t?{change:t}:{},...n?{current:n}:{}}),!n&&o.state===`ready`&&o.data.runs.length>0&&(0,j.jsx)(`p`,{className:`muted`,style:{margin:`8px 0 0`,fontSize:12},children:L.pick})]})]})}var R=w.decisions,wi=e=>e instanceof M?e.problem.detail??e.message:e instanceof Error?e.message:String(e),Ti=e=>typeof e==`object`&&!!e&&e.kind===`ai`,Ei=(0,v.createContext)(void 0);function Di({children:e}){let[t,n]=(0,v.useState)(),r=(0,v.useRef)(!1),i=(0,v.useRef)(!1),a=(0,v.useRef)(!1),o=(0,v.useCallback)(()=>{if(r.current=!0,i.current){a.current=!0;return}i.current=!0,n(e=>e?.state===`ready`?e:{state:`loading`});let e=()=>{i.current=!1,a.current&&(a.current=!1,o())};N(`/api/decisions`).then(t=>{n({state:`ready`,data:t}),e()},t=>{n({state:`error`,error:wi(t)}),e()})},[]);St(e=>{r.current&&e.type===`file.changed`&&o()});let s=(0,v.useMemo)(()=>({view:t,need:()=>{r.current||o()},reload:o}),[t,o]);return(0,j.jsx)(Ei.Provider,{value:s,children:e})}function Oi(){let e=(0,v.useContext)(Ei);return(0,v.useEffect)(()=>e?.need(),[e]),e}var ki=e=>e?[...e.links.items,...e.questions.items]:[];function Ai(e,t){return t?ki(e).find(e=>e.item===t):void 0}function ji(e,t,n){return e?.links.items.find(e=>e.repo===t&&e.call&&`${e.call.file}:${e.call.line}`===n)}var Mi=e=>e?.view?.state===`ready`?e.view.data:void 0;function Ni(e){return(0,j.jsxs)(`span`,{className:`row ai-mark`,style:{gap:6,flexWrap:`wrap`,display:`inline-flex`},children:[(0,j.jsxs)(`span`,{className:`chip ai`,children:[(0,j.jsx)(`span`,{"aria-hidden":`true`,children:`◆ `}),e.short?R.chipShort:R.chip]}),!e.short&&(0,j.jsx)(`span`,{className:`sr`,children:R.chipWhy}),e.run&&!e.inLink&&(0,j.jsx)(`a`,{href:ci({run:e.run}),"aria-label":R.openRun(e.run),className:`hud`,children:R.run(e.run)})]})}function Pi(e){return(0,j.jsxs)(`p`,{className:`work-say`,role:`group`,"aria-label":R.counts.label(e.what),style:{margin:0},children:[(0,j.jsxs)(`span`,{className:`hud`,children:[e.what,`: `]}),R.counts.line(e.counts)]})}function Fi(e){let t=Oi(),n=Ai(Mi(t),e.item),[r,i]=(0,v.useState)(),a=n??r;return!a&&!e.ai&&!e.run?null:(0,j.jsxs)(`span`,{className:`stack`,style:{gap:6,display:`inline-flex`},children:[(0,j.jsxs)(`span`,{className:`row`,style:{gap:6,flexWrap:`wrap`},children:[(0,j.jsx)(Ni,{run:a?.run??e.run,...e.inLink?{inLink:!0}:{}}),n&&!e.inLink&&!r&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,"aria-label":R.correctOf(n.what),onClick:()=>{i(n),e.onOpen?.(n)},children:R.correct})]}),r&&(0,j.jsx)(Ri,{d:r,onClose:()=>{i(void 0),e.onClose?.()},onDone:n=>{se({text:R.savedFlash(n.answer,n.counts),href:`#/decisions`,link:R.title}),t?.reload(),e.onDone?.(n)}})]})}function Ii(e,t,n){let r={similar:t.similar,...t.similar&&t.match?.trim()?{match:t.match.trim()}:{},...n?{preview:!0}:{}};return t.pick===`none`?{body:{item:e.item,none:!0,...r}}:e.kind===`question`?t.pick!==`option`||!t.option?{error:R.needPick}:{body:{item:e.item,option:t.option,...r}}:t.pick===`api`?!t.api.trim()||!t.repo.trim()?{error:R.needApi}:{body:{item:e.item,api:t.api.trim(),repo:t.repo.trim(),...r}}:{error:R.needPick}}var Li=(e,t)=>`/api/links/candidates?from=${encodeURIComponent(e)}&to=${encodeURIComponent(t)}`;function Ri(e){let{d:t}=e,n=(0,v.useId)(),r=(0,v.useRef)(null);(0,v.useEffect)(()=>{r.current?.focus()},[]);let[i,a]=(0,v.useState)({...t.kind===`link`?{pick:`api`}:{},repo:t.to?.repo??``,api:``,similar:!0}),o=e=>a(t=>({...t,...e})),[s,c]=(0,v.useState)(),[l,u]=(0,v.useState)(),[d,f]=(0,v.useState)(),[p,m]=(0,v.useState)(),h=(0,v.useRef)(null),g=P(e.apis||t.kind!==`link`||i.pick!==`api`||!i.repo.trim()?void 0:Li(t.repo,i.repo.trim())),_=e.apis??(i.pick===`api`&&i.repo.trim()?g:void 0),y=P(e.repos||t.kind!==`link`?void 0:`/api/repos`),b=e.repos??(t.kind===`link`?y:void 0),x=b?.state===`ready`?[...new Set([...b.data.map(e=>e.id),...i.repo?[i.repo]:[]])].sort((e,t)=>e.localeCompare(t)):void 0;(0,v.useEffect)(()=>{p&&h.current?.focus()},[p]);let S=e.post??(e=>N(`/api/decisions/correct`,{method:`POST`,body:e})),C=Ii(t,i,!1),w=`body`in C?JSON.stringify(C.body):``,T=!!d&&d.asked===w,E=async n=>{let r=Ii(t,i,n===`preview`);if(`error`in r){u(r.error);return}if(n===`save`&&!T){u(R.previewFirst);return}c(n),u(void 0);let a=w;try{let t=await S(r.body);n===`preview`?f({r:t,asked:a}):(m(t),e.onDone?.(t))}catch(e){u(wi(e))}finally{c(void 0)}},D=e=>{e.preventDefault(),E(`preview`)};if(p)return(0,j.jsxs)(`div`,{className:`stack`,role:`status`,tabIndex:-1,ref:h,style:{gap:6},children:[(0,j.jsx)(Bi,{r:p,saved:!0}),p.makeRule&&(0,j.jsx)(Wi,{m:p.makeRule}),(0,j.jsx)(`div`,{className:`row`,style:{gap:6},children:(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:e.onClose,children:R.cancel})})]});let ee=d?.r.rule;return(0,j.jsxs)(`form`,{className:`stack`,onSubmit:D,"aria-labelledby":`${n}-t`,style:{gap:8},children:[(0,j.jsx)(`h4`,{id:`${n}-t`,className:`h`,style:{fontSize:13,margin:0},tabIndex:-1,ref:r,children:R.formTitle(t.what)}),(0,j.jsxs)(`fieldset`,{className:`stack`,style:{gap:4,border:0,padding:0,margin:0},children:[(0,j.jsx)(`legend`,{className:`hud`,children:t.kind===`question`?R.pickOption:R.pickLink}),t.kind===`question`&&(t.question?.options??[]).map((e,t)=>(0,j.jsxs)(`label`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`input`,{type:`radio`,name:`${n}-pick`,value:String(t+1),checked:i.pick===`option`&&i.option===t+1,onChange:()=>o({pick:`option`,option:t+1})}),e]},e)),t.kind===`link`&&(0,j.jsxs)(`label`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`input`,{type:`radio`,name:`${n}-pick`,value:`api`,checked:i.pick===`api`,onChange:()=>o({pick:`api`})}),R.linkApi]}),t.kind===`link`&&i.pick===`api`&&(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4,paddingLeft:22},children:[(0,j.jsx)(`label`,{htmlFor:`${n}-repo`,className:`hud`,children:R.repoLabel}),x?(0,j.jsxs)(`select`,{id:`${n}-repo`,className:`field`,value:i.repo,onChange:e=>o({repo:e.target.value,api:``}),children:[(0,j.jsx)(`option`,{value:``,children:R.repoPick}),x.map(e=>(0,j.jsx)(`option`,{value:e,children:e},e))]}):(0,j.jsx)(`input`,{id:`${n}-repo`,className:`field`,value:i.repo,onChange:e=>o({repo:e.target.value,api:``})}),_?.state===`ready`?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`label`,{htmlFor:`${n}-api`,className:`hud`,children:R.apiLabel}),(0,j.jsxs)(`select`,{id:`${n}-api`,className:`field`,value:i.api,onChange:e=>o({api:e.target.value}),children:[(0,j.jsx)(`option`,{value:``,children:R.apiPick}),_.data.apis.map(e=>(0,j.jsx)(`option`,{value:e.id,children:`${e.method??``} ${e.path}`.trim()},e.id))]})]}):_?.state===`loading`?(0,j.jsx)(`p`,{className:`ev-say`,role:`status`,"aria-busy":`true`,children:R.apisLoading}):(0,j.jsxs)(j.Fragment,{children:[_?.state===`error`&&(0,j.jsx)(`p`,{className:`state error`,role:`alert`,children:R.apisFailed(_.error)}),(0,j.jsx)(`label`,{htmlFor:`${n}-api`,className:`hud`,children:R.apiIdLabel}),(0,j.jsx)(`input`,{id:`${n}-api`,className:`field mono`,value:i.api,onChange:e=>o({api:e.target.value})})]})]}),t.kind===`link`&&(0,j.jsxs)(`label`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`input`,{type:`radio`,name:`${n}-pick`,value:`none`,checked:i.pick===`none`,onChange:()=>o({pick:`none`})}),R.noneLink]})]}),(0,j.jsxs)(`label`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:i.similar,onChange:e=>o({similar:e.target.checked}),"aria-describedby":`${n}-sim`}),R.similar]}),(0,j.jsx)(`p`,{id:`${n}-sim`,className:`muted`,style:{margin:0,fontSize:12},children:R.similarHint}),i.similar&&(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`label`,{htmlFor:`${n}-match`,className:`hud`,children:R.matchLabel}),(0,j.jsx)(`input`,{id:`${n}-match`,className:`field mono`,value:i.match??ee?.match??``,onChange:e=>o({match:e.target.value}),"aria-describedby":`${n}-match-hint`}),(0,j.jsx)(`span`,{id:`${n}-match-hint`,className:`muted`,style:{fontSize:12},children:ee?R.matchHint:R.matchHintNone})]}),l&&(0,j.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:0},children:l}),d&&!T&&(0,j.jsx)(`p`,{role:`status`,className:`ev-say`,style:{margin:0},children:R.changedSince}),d&&T&&(0,j.jsxs)(`div`,{className:`stack`,role:`status`,style:{gap:6},children:[(0,j.jsx)(Bi,{r:d.r}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:R.approval})]}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`},children:[(0,j.jsx)(`button`,{type:`submit`,className:`btn`,disabled:!!s,"aria-busy":s===`preview`,children:s===`preview`?R.previewing:R.preview}),(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:!!s||!T,"aria-busy":s===`save`,onClick:()=>void E(`save`),children:s===`save`?R.saving:R.save}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:e.onClose,children:R.cancel})]})]})}function zi({text:e}){return(0,j.jsxs)(`div`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`code`,{className:`mono`,children:e}),(0,j.jsx)(sr,{text:e,label:R.copy(e)})]})}function Bi({r:e,saved:t}){return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,j.jsx)(`p`,{className:`hud`,style:{margin:0},children:t?R.whatSpread:R.previewTitle}),(0,j.jsx)(`p`,{style:{margin:0},children:t?R.saved(e.answer):R.yourAnswer(e.answer)}),t&&e.batch&&(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:R.savedBatch(e.batch)}),e.rule?(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:R.rule(e.rule.kind,e.rule.match,e.rule.derived)}):e.noRule&&(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:R.noRule(e.noRule)}),e.spread.length===0?(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:R.spreadNone}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`p`,{style:{margin:0},children:[R.spreadTitle(e.spread.length),` · `,R.spreadCounts(e.counts)]}),(0,j.jsxs)(`table`,{className:`run-table`,children:[(0,j.jsx)(`caption`,{className:`sr`,children:R.spreadCaption}),(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{scope:`col`,children:R.col.item}),(0,j.jsx)(`th`,{scope:`col`,children:R.col.change}),(0,j.jsx)(`th`,{scope:`col`,children:R.col.was}),(0,j.jsx)(`th`,{scope:`col`,children:R.col.now})]})}),(0,j.jsx)(`tbody`,{children:e.spread.map(e=>(0,j.jsxs)(`tr`,{children:[(0,j.jsxs)(`th`,{scope:`row`,style:{fontWeight:`normal`},children:[e.what,(0,j.jsx)(`div`,{className:`hud mono`,children:e.repo})]}),(0,j.jsxs)(`td`,{children:[(0,j.jsx)(`strong`,{children:R.change[e.change]??e.change}),(0,j.jsx)(`div`,{className:`muted`,children:R.changeWhy[e.change]??``})]}),(0,j.jsx)(`td`,{children:e.was??R.nothing}),(0,j.jsx)(`td`,{children:e.now??R.nothing})]},e.item))})]})]}),t&&(0,j.jsx)(Hi,{verify:e.verify,commit:e.commit,scope:e.item.startsWith(`link:`)?`corrections`:`answers`})]})}var Vi=e=>/^atticus verify (\S+)/.exec(e)?.[1];function Hi(e){let t=e.verify.map(Vi).filter(e=>!!e);return!t.length&&!e.commit?null:(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:R.next}),t.map((n,r)=>(0,j.jsx)(qc,{scope:e.scope,repo:n,...r<t.length-1?{noPropose:!0}:{}},n)),!t.length&&(0,j.jsx)(qc,{scope:e.scope}),(0,j.jsxs)(`details`,{children:[(0,j.jsx)(`summary`,{className:`hud`,children:R.terminal}),(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4,marginTop:4},children:[e.verify.length>0&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:R.verify}),e.verify.map(e=>(0,j.jsx)(zi,{text:e},e))]}),e.commit&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:R.commit}),(0,j.jsx)(zi,{text:e.commit})]})]})]})]})}function Ui(e){let{m:t,state:n}=e;return n.state===`made`?(0,j.jsxs)(`div`,{className:`stack`,role:`status`,style:{gap:4},children:[(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:R.ruleMade(n.made.file)}),(0,j.jsx)(zi,{text:n.made.activate})]}):(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:R.makeRuleOffer(t.corrections,t.shape)}),t.line?(0,j.jsx)(`div`,{className:`row`,style:{gap:6},children:(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:n.state===`making`,"aria-busy":n.state===`making`,onClick:e.onMake,children:n.state===`making`?R.makingRule:R.makeRule})}):t.command&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:R.ruleCommand}),(0,j.jsx)(zi,{text:t.command})]}),n.state===`error`&&(0,j.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:0},children:n.error})]})}function Wi(e){let[t,n]=(0,v.useState)({state:`idle`}),r=e.post??(e=>N(`/api/reading-rules/from-pairing`,{method:`POST`,body:e}));return(0,j.jsx)(Ui,{m:e.m,state:t,onMake:()=>{e.m.line&&(n({state:`making`}),r({repo:e.m.repo,line:e.m.line}).then(e=>n({state:`made`,made:e}),e=>n({state:`error`,error:wi(e)})))}})}function Gi({r:e,onDismiss:t}){let n=(0,v.useRef)(null);return(0,v.useEffect)(()=>{n.current?.focus()},[]),(0,j.jsxs)(`div`,{className:`stack`,role:`status`,tabIndex:-1,ref:n,style:{gap:4},children:[(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:R.undoneResult(e.batch,e.removed,e.restored)}),e.skipped.length>0&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:R.skipped}),(0,j.jsx)(`ul`,{style:{margin:0},children:e.skipped.map(e=>(0,j.jsx)(`li`,{children:e},e))})]}),(0,j.jsx)(Hi,{verify:e.verify,commit:e.commit,scope:e.files.some(e=>e.endsWith(`.corrections.jsonl`))?`corrections`:`answers`}),t&&(0,j.jsx)(`div`,{children:(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:t,children:w.app.dismiss})})]})}function Ki(e){let[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(),[s,c]=(0,v.useState)(),l=(0,v.useRef)(null);(0,v.useEffect)(()=>{t&&l.current?.focus()},[t]);let u=e.post??(e=>N(`/api/decisions/batches/${encodeURIComponent(e)}/undo`,{method:`POST`})),d=async()=>{i(!0),o(void 0);try{let t=await u(e.b.id);c(t),n(!1),e.onDone?.(t)}catch(e){o(R.undoFailed(wi(e)))}finally{i(!1)}};return s?(0,j.jsx)(Gi,{r:s}):(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[t?(0,j.jsxs)(`div`,{className:`stack`,role:`group`,"aria-label":R.undoOf(e.b.id),style:{gap:4},children:[(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:R.confirmUndo(e.b.id,e.b.applied)}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,ref:l,disabled:r,"aria-busy":r,onClick:()=>void d(),children:r?R.undoing:R.confirmYes}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:r,onClick:()=>n(!1),children:R.confirmNo})]})]}):(0,j.jsx)(`div`,{children:(0,j.jsx)(`button`,{type:`button`,className:`btn`,"aria-label":R.undoOf(e.b.id),onClick:()=>n(!0),children:R.undo})}),a&&(0,j.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:0},children:a})]})}function qi({decide:e}){return e.paused?(0,j.jsxs)(`div`,{className:`state`,role:`note`,"aria-label":R.pausedTitle,children:[(0,j.jsxs)(`p`,{style:{margin:0},children:[(0,j.jsx)(`span`,{"aria-hidden":`true`,children:`⏸ `}),(0,j.jsx)(`strong`,{children:R.pausedTitle})]}),(0,j.jsx)(`p`,{style:{margin:`4px 0 0`},children:R.pausedWhy(e.paused.why)}),(0,j.jsx)(`a`,{href:`#/trust`,children:R.pausedLink})]}):null}var Ji=w.knowledge,Yi=e=>Ji.kinds[e]??e,Xi=e=>Ji.fields[e]??e,Zi=e=>e.slice(0,10);function Qi(e){return e?e.state===`verified`?Ji.review.verified(e.by,Zi(e.at)):e.state===`corrected`?Ji.review.corrected(e.by,Zi(e.at)):e.state===`rejected`?Ji.review.rejected(e.by,Zi(e.at)):e.verdict===`rejected`?Ji.review.staleRejected(e.by,Zi(e.at)):e.verdict===`corrected`&&e.corrected?.length?Ji.review.staleCorrected(e.by,e.corrected.map(Xi).join(`, `)):Ji.review.stale(e.by):Ji.review.none}var $i={verified:`done`,corrected:`done`,rejected:`blocking`,stale:`warn`};function ea({review:e}){return(0,j.jsx)(`span`,{className:`chip ${e?e.verdict===`rejected`?$i.rejected:$i[e.state]:`dim`}`,children:Qi(e)})}function ta({command:e,slash:t,why:n,runs:r}){return(0,j.jsxs)(`div`,{className:`kn-ai`,children:[n&&(0,j.jsx)(`p`,{className:`work-why`,children:n}),(0,j.jsx)(zr,{command:e}),(0,j.jsx)(`p`,{className:`work-say`,children:wr(e)?Ji.ai.introOr:Ji.ai.intro}),(0,j.jsx)(sc,{text:e,label:Ji.ai.copy,noRun:!0}),t&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`work-say`,children:Ji.ai.slash}),(0,j.jsx)(sc,{text:t,label:Ji.ai.copySlash})]}),r&&(0,j.jsx)(`p`,{className:`work-say`,children:(0,j.jsx)(si,{...r})})]})}function na({text:e}){return(0,j.jsxs)(`div`,{className:`kn-empty`,children:[(0,j.jsx)(`div`,{className:`state`,children:e}),(0,j.jsx)(`p`,{style:{margin:0},children:(0,j.jsx)(`a`,{href:`#/wikis`,children:Ji.emptyGo})}),(0,j.jsx)(ta,{command:`atticus knowledge scan`,slash:`/atticus-knowledge`,runs:{q:`knowledge`,label:w.runs.knowledge}})]})}function ra({conflicts:e}){let t=w.knowledgeConflicts;if(!e.length)return null;let n=e=>`${e.source}/${e.page}`;return(0,j.jsx)(`ul`,{className:`stack`,style:{listStyle:`none`,padding:0,margin:0,gap:8},children:e.map(e=>{let r=e.decided,i=r?r.by===`person`?t.byPerson(r.who):t.byCode(r.kind,r.record,r.value,r.at):void 0,a=r?void 0:e.suggested;return(0,j.jsxs)(`li`,{role:`note`,children:[(0,j.jsxs)(`p`,{style:{margin:0},children:[(0,j.jsx)(`span`,{className:`mono`,children:e.about.join(`, `)}),e.summary?(0,j.jsxs)(`span`,{className:`muted`,children:[` · `,e.summary]}):null]}),(0,j.jsx)(`ul`,{style:{margin:`4px 0`,paddingLeft:18},children:e.pages.map(e=>(0,j.jsx)(`li`,{children:t.says(n(e),e.says)},n(e)))}),(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:i?e.applies.length>1?t.both(i,r?.by===`person`?r.words:void 0):t.applies(e.applies.map(n).join(`, `),i):e.question?.state===`open`?t.open(e.question.id):t.notAsked}),e.question&&(0,j.jsx)(Fi,{item:e.question.id}),a?(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:t.suggested(n(a),a.signal,a.detail)}):null]},e.key)})})}function ia({urls:e}){return e.length?(0,j.jsx)(`ul`,{style:{margin:`4px 0`,paddingLeft:18},children:e.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(Pt,{href:e.url,children:e.label??e.url}),e.label&&(0,j.jsx)(`span`,{className:`muted mono`,style:{fontSize:11,marginLeft:6},children:e.url})]},e.url))}):null}function aa(e){let t=e.quote;if(t)return Ji.items.page(`${t.source}/${t.page}${t.section?` (${t.section})`:``}`,t.line)}function oa(e){let t=e.indexOf(`#`);return t<0?e:`${e.slice(0,t)} (${e.slice(t+1)})`}var sa=e=>e.quote?.text,ca=e=>Array.isArray(e.urls)?e.urls:[];function la(e){return Array.isArray(e)?e.map(e=>typeof e==`object`&&e?e.label??e.url:String(e)).join(`, `):e==null?``:String(e)}function ua(e,t){let n=t.toLowerCase().split(/\s+/).filter(Boolean);if(!n.length)return!0;let r=e.record,i=[e.id,e.title,e.kind,la(r.handledBy),la(r.owner),la(r.ownedBy),la(r.aliases),la(r.appliesWhen),sa(r)??``].join(` `).toLowerCase();return n.every(e=>i.includes(e))}function da(e,t){return t.map(t=>({title:t.title,items:e.filter(e=>t.kinds.includes(e.kind))})).filter(e=>e.items.length>0)}function fa(e){let t={};for(let[n,r]of Object.entries(e.fields)){let i=e.record[n];t[n]=r===`text`?typeof i==`string`?i:``:r===`list`?Array.isArray(i)?i.map(String):[]:ca(e.record).map(e=>({url:e.url,...e.label?{label:e.label}:{}}))}return t}var pa=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function ma(e,t){let n=fa(e),r={};for(let[i,a]of Object.entries(e.fields)){let e=t[i]??n[i];if(a===`text`)e=e.trim();else if(a===`list`)e=e.map(e=>e.trim()).filter(Boolean);else{let t=[];for(let n of e){let e=n.url.trim(),r=n.label?.trim();if(e||r){if(!/^https?:\/\/\S+$/.test(e))return{error:Ji.items.badUrl(e||r||``)};t.push(r?{url:e,label:r}:{url:e})}}e=t}pa(e,n[i])||(r[i]=e)}return!Object.keys(r).length&&!e.review?.corrected?.length?{error:Ji.items.noChange}:{set:r}}function ha(e){let t=e.split(`,`).map(e=>e.trim()).filter(Boolean),n=t.find(e=>!/^[a-z0-9][a-z0-9._-]*$/.test(e));return n?{error:Ji.sources.notSlug(n)}:t}var ga=w.knowledge.needs,_a=w.knowledge.review;function va(e){let t=e.review;return t?.state===`verified`||t?.state===`corrected`?{text:_a.verified(t.by,t.at.slice(0,10)),ok:!0}:t?.state===`stale`&&t.verdict===`rejected`?{text:_a.staleRejected(t.by,t.at.slice(0,10)),ok:!1,rejected:!0}:t?.state===`stale`&&t.verdict===`corrected`&&t.corrected?.length?{text:_a.staleCorrected(t.by,t.corrected.join(`, `)),ok:!1}:t?.state===`stale`?{text:_a.stale(t.by),ok:!1}:t?.state===`rejected`?{text:_a.rejected(t.by,t.at.slice(0,10)),ok:!1,rejected:!0}:{text:_a.none,ok:!1}}function ya(e){return e===`open`?ga.openAgain:e===`not-needed`?ga.markSkip.toLowerCase():e}function ba(e,t,n){return e===`not-needed`&&!t.trim()?{error:ga.needWhy}:{body:{status:e,for:n,...e!==`open`&&t.trim()?{note:t.trim()}:{}}}}function xa({n:e}){let t=[];return e.leadTime&&t.push([ga.leadTime,e.leadTime]),e.handledBy&&t.push([ga.handledBy,e.handledBy]),e.catalogueItem&&t.push([ga.catalogueItem,e.catalogueItem]),e.inputs.length&&t.push([ga.inputs,e.inputs.join(`, `)]),t.length?(0,j.jsx)(`dl`,{className:`run-facts`,style:{margin:`4px 0`},children:t.map(([e,t])=>(0,j.jsxs)(`div`,{style:{display:`contents`},children:[(0,j.jsx)(`dt`,{children:e}),(0,j.jsx)(`dd`,{children:t})]},e))}):null}function Sa(e){let t=e.n,[n,r]=(0,v.useState)(),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(),c=va(t),l=`need-${e.scope?`${e.scope}-`:``}${t.item}-${t.for}`.replace(/[^a-z0-9-]/gi,`-`),u=(0,v.useRef)(null),d=(0,v.useRef)(null),f=(0,v.useRef)(null),p=(0,v.useRef)(null),m=(0,v.useRef)(!1),h=(0,v.useRef)(`title`);(0,v.useEffect)(()=>{n?d.current?.focus():m.current&&({title:u,done:f,"not-needed":p}[h.current].current??u.current)?.focus(),m.current=!!n},[n]);let g=()=>{h.current=n??`title`,s(void 0),r(void 0)},_=o=>{let c=ba(o,i,t.for);`error`in c?(s(c.error),d.current?.focus()):(s(void 0),h.current=`title`,r(void 0),a(``),n||u.current?.focus(),e.onMark?.(t,c.body))};return(0,j.jsxs)(`li`,{className:`list-row`,style:{display:`block`},children:[(0,j.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`,gap:6},children:[(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`a`,{ref:u,id:`${l}-t`,href:`#/knowledge?item=${encodeURIComponent(t.item)}`,style:t.status===`not-needed`?{textDecoration:`line-through`}:void 0,children:(0,j.jsx)(`strong`,{children:t.title})}),` `,(0,j.jsxs)(`span`,{className:`muted`,style:{fontSize:12},children:[`(`,ga.for(t.for),`) · `,Yi(t.kind)]})]}),(0,j.jsxs)(`span`,{className:`row`,style:{gap:6,flexWrap:`wrap`},children:[(0,j.jsx)(`span`,{className:`chip ${c.ok?`done`:c.rejected?`blocking`:`warn`}`,children:c.text}),(0,j.jsx)(`span`,{className:`chip ${t.status===`open`?`ai`:`dim`}`,children:t.status===`open`?ga.open:t.status===`done`?ga.done(t.by??``,t.note):ga.notNeeded(t.by??``,t.note??``)})]})]}),(0,j.jsx)(xa,{n:t}),(0,j.jsxs)(`p`,{style:{margin:`4px 0`},children:[(0,j.jsxs)(`span`,{className:`hud`,style:{fontSize:10},children:[ga.why,`:`]}),` `,t.why,t.because&&(0,j.jsxs)(j.Fragment,{children:[` `,(0,j.jsx)(`q`,{children:t.because.quote}),` `,(0,j.jsx)(`span`,{className:`muted mono`,style:{fontSize:11},children:`${t.because.file}${t.because.line?`:${t.because.line}`:``}`})]})]}),t.when&&(0,j.jsx)(`p`,{className:`muted`,style:{margin:`2px 0`,fontSize:12},children:ga.when(t.when)}),t.rules.length>0&&(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:ga.rules}),(0,j.jsx)(`ul`,{style:{margin:`2px 0`,paddingLeft:18},children:t.rules.map(e=>(0,j.jsx)(`li`,{children:e},e))})]}),t.steps.length>0&&(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:ga.steps}),(0,j.jsx)(`ol`,{style:{margin:`2px 0`,paddingLeft:20},children:t.steps.map((e,t)=>(0,j.jsx)(`li`,{children:e},t))})]}),t.urls.length>0&&(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:ga.links}),(0,j.jsx)(ia,{urls:t.urls})]}),(0,j.jsxs)(`p`,{className:`muted mono`,style:{margin:`2px 0`,fontSize:11},children:[t.from===`stories`?ga.fromStories:``,t.page?`${t.from===`stories`?` · `:``}${ga.from(oa(t.page))}`:``]}),e.onMark&&!n&&(0,j.jsx)(`div`,{className:`row`,style:{gap:8,marginTop:4},children:t.status===`open`?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:e.busy,ref:f,"aria-label":ga.markDoneOf(t.title),onClick:()=>r(`done`),children:ga.markDone}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:e.busy,ref:p,"aria-label":ga.markSkipOf(t.title),onClick:()=>r(`not-needed`),children:ga.markSkip})]}):(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:e.busy,"aria-label":ga.reopenOf(t.title),onClick:()=>_(`open`),children:ga.reopen})}),n&&(0,j.jsxs)(`form`,{className:`stack`,style:{gap:6,marginTop:6},onKeyDown:Dt(g),onSubmit:e=>{e.preventDefault(),_(n)},children:[(0,j.jsx)(`label`,{htmlFor:`${l}-note`,className:`hud`,style:{fontSize:10},children:n===`done`?ga.doneNote:ga.skipNote}),(0,j.jsx)(`input`,{ref:d,id:`${l}-note`,className:`field`,"aria-describedby":o?`${l}-err`:void 0,"aria-invalid":o?!0:void 0,value:i,onChange:e=>a(e.target.value)}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:8},children:[(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:e.busy,children:ga.save}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:g,children:ga.cancel})]}),o&&(0,j.jsx)(`p`,{id:`${l}-err`,role:`alert`,style:{margin:0,color:`var(--magenta-text)`,fontSize:12.5},children:o})]})]})}function Ca(e){return(0,j.jsx)(I,{of:e.of,children:t=>t.present?(0,j.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,j.jsxs)(`p`,{className:`hud`,style:{fontSize:10,margin:0},children:[t.file,` · `,ga.openCount(t.needs.filter(e=>e.status===`open`).length)]}),t.needs.length===0&&(0,j.jsx)(`div`,{className:`state`,children:ga.empty}),da(t.needs,ga.groups).map(t=>(0,j.jsxs)(`section`,{"aria-label":t.title,children:[(0,j.jsx)(`h3`,{className:`hud`,style:{fontSize:11,margin:`6px 0`},children:t.title}),(0,j.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0},children:t.items.map(t=>(0,j.jsx)(Sa,{n:t,onMark:e.onMark,busy:e.busy},`${t.item}|${t.for}`))})]},t.title)),t.considered.length>0&&(0,j.jsxs)(`details`,{children:[(0,j.jsx)(`summary`,{children:ga.considered}),(0,j.jsx)(`ul`,{style:{margin:`4px 0`,paddingLeft:18},children:t.considered.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`span`,{className:`mono`,children:e.item}),`: `,e.why]},e.item))})]})]}):(0,j.jsx)(ta,{command:t.command,slash:t.slash,why:ga.none(t.change),runs:{change:t.change}})})}function wa({change:e,span:t}){let n=P(`/api/changes/${encodeURIComponent(e)}/needs`),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)();return St(e=>{e.type===`file.changed`&&n.reload()}),(0,j.jsxs)(`section`,{className:`panel`,"aria-labelledby":`needs-${e}`,style:{gridColumn:t??`1 / -1`},children:[(0,j.jsx)(`h2`,{id:`needs-${e}`,className:`h`,style:{marginBottom:6},children:ga.title}),(0,j.jsxs)(`p`,{className:`work-say`,style:{marginTop:0},children:[ga.intro,` `,(0,j.jsx)(si,{change:e})]}),(0,j.jsx)(Ca,{of:n,onMark:(t,r)=>{i(!0),o({ok:!0,text:w.app.working,working:!0}),N(`/api/changes/${encodeURIComponent(e)}/needs/${encodeURIComponent(t.item)}`,{method:`POST`,body:r}).then(e=>o({ok:!0,text:ga.marked(e.need.title,ya(e.need.status))})).catch(e=>o({ok:!1,text:Bn(e)})).finally(()=>{i(!1),n.reload()})},busy:r}),(0,j.jsx)(Wn,{note:a})]})}var Ta=w.across,Ea=w.knowledge.needs,Da=e=>e.filter(e=>e.state!==`archived`),Oa=(e,t)=>`${e}|${t.item}|${t.for}`;function ka(e,t){let n=(e,n)=>ti([e.change,e.title,JSON.stringify(n)],t.text),r=[],i=0;for(let a of e){if(!a.needs?.present)continue;i+=a.needs.needs.filter(e=>e.status===`open`).length;let e=a.needs.needs.filter(e=>(t.all||e.status===`open`||t.kept?.has(Oa(a.change,e)))&&n(a,e));e.length&&r.push({change:a.change,title:a.title,needs:e})}return{groups:r,open:i,notYet:e.filter(e=>e.needs&&!e.needs.present).map(e=>({change:e.change,title:e.title,command:e.needs.command,slash:e.needs.slash})),errors:e.filter(e=>e.error!==void 0).map(e=>({change:e.change,title:e.title,error:e.error}))}}var Aa=e=>`needs-across-${e.replace(/[^a-z0-9-]/gi,`-`)}`;function ja(e){return(0,j.jsx)(I,{of:e.of,empty:e=>e.length===0,emptyText:Ta.needsNoChanges,children:t=>{let n=ka(t,e);return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:10},children:[(0,j.jsx)(`p`,{className:`muted`,"aria-live":`polite`,style:{margin:0,fontSize:12},children:Ta.needsCount(n.open,t.length)}),n.errors.map(e=>(0,j.jsx)(`p`,{role:`alert`,style:{margin:0,color:`var(--magenta-text)`,fontSize:12.5},children:Ta.needsCantRead(e.change,e.error)},e.change)),n.groups.length===0&&(e.text.trim()?(0,j.jsx)(oi,{what:ri({text:e.text}),onClear:()=>e.onClear?.(),focus:`across-filter`}):(0,j.jsx)(`div`,{className:`state`,children:Ta.needsNone})),n.groups.map(t=>(0,j.jsxs)(`section`,{"aria-labelledby":Aa(t.change),children:[(0,j.jsxs)(`h3`,{id:Aa(t.change),className:`h`,style:{fontSize:14,margin:`6px 0`},children:[(0,j.jsx)(`a`,{href:`#/changes/${encodeURIComponent(t.change)}`,children:t.title}),` `,(0,j.jsx)(`span`,{className:`muted mono`,style:{fontSize:11},children:t.change})]}),(0,j.jsx)(`p`,{className:`work-say`,style:{margin:`0 0 4px`},children:(0,j.jsx)(si,{change:t.change})}),da(t.needs,Ea.groups).map(n=>(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h4`,{className:`hud`,style:{fontSize:11,margin:`6px 0`},children:n.title}),(0,j.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0},children:n.items.map(n=>(0,j.jsx)(Sa,{n,scope:t.change,busy:e.busy,onMark:e.onMark?(n,r)=>e.onMark(t.change,n,r):void 0},Oa(t.change,n)))})]},n.title))]},t.change)),n.notYet.length>0&&(0,j.jsxs)(`details`,{children:[(0,j.jsx)(`summary`,{children:Ta.needsNotYet(n.notYet.length)}),(0,j.jsx)(`ul`,{style:{listStyle:`none`,margin:`6px 0 0`,padding:0},className:`stack`,children:n.notYet.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`a`,{href:`#/changes/${encodeURIComponent(e.change)}`,children:e.title}),(0,j.jsx)(ta,{command:e.command,slash:e.slash,why:Ea.none(e.change),runs:{change:e.change}})]},e.change))})]})]})}})}function Ma(e){let[t,n]=(0,v.useState)({state:`loading`}),[r,i]=(0,v.useState)(0),a=e.state===`error`?e.reload:void 0,o=(0,v.useCallback)(()=>{a?.(),i(e=>e+1)},[a]),s=e.state===`ready`?JSON.stringify(Da(e.data).map(e=>[e.id,e.title])):void 0,c=e.state===`error`?e.error:void 0,l=e.state===`error`&&e.notYet;return(0,v.useEffect)(()=>{if(c!==void 0){n({state:`error`,error:c,...l?{notYet:!0}:{}});return}if(s===void 0)return;let e=new AbortController,t=JSON.parse(s);return Promise.all(t.map(([t,n])=>N(`/api/changes/${encodeURIComponent(t)}/needs`,{signal:e.signal}).then(e=>({change:t,title:n,needs:e}),e=>({change:t,title:n,error:Bn(e)})))).then(t=>{e.signal.aborted||n({state:`ready`,data:t})}),()=>e.abort()},[s,c,l,r]),{...t,reload:o}}function Na({text:e,onClear:t}){let n=P(`/api/changes`),r=Ma(n),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(new Set),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)();return St(e=>{e.type===`file.changed`&&(n.reload(),r.reload())}),(0,j.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:Ta.needsIntro}),(0,j.jsxs)(`label`,{className:`row`,style:{gap:6,fontSize:12.5},children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:i,onChange:e=>a(e.target.checked)}),Ta.needsShowAll]}),(0,j.jsx)(Wn,{note:u}),(0,j.jsx)(ja,{of:r,all:i,text:e,kept:o,onMark:(e,t,n)=>{l(!0),s(n=>new Set([...n,Oa(e,t)])),d({ok:!0,text:w.app.working,working:!0}),N(`/api/changes/${encodeURIComponent(e)}/needs/${encodeURIComponent(t.item)}`,{method:`POST`,body:n}).then(e=>d({ok:!0,text:Ea.marked(e.need.title,ya(e.need.status))})).catch(e=>d({ok:!1,text:Bn(e)})).finally(()=>{l(!1),r.reload()})},busy:c,...t?{onClear:t}:{}})]})}var Pa=w.phase,Fa=`#/todo`,Ia=e=>!!e&&/^manual:\/\//i.test(e.trim()),La=new Set([`built`,`pr-open`,`waiting`]),Ra=e=>!!e&&e.startsWith(`The PR wasn't raised:`);function za(e){let t=e.taskRun?.state===`pr-open`?e.taskRun.pr?.state:void 0;return t===`merged`||t===`closed`?t:void 0}function Ba(e){return!e.done&&(!La.has(e.taskRun?.state??``)||!!za(e))}function Va(e,t){let n=new Set((t??[]).map(e=>e.run).filter(Boolean));return e.filter(e=>e.agent===`task-runner`||e.taskRun!==void 0||n.has(e.runId))}function Ha(e,t){let n=e?/^atticus task run (\S+) (\S+)$/.exec(e.trim()):null;if(!n||!t)return;let r=t.find(e=>e.id===n[2]);if(!r||Ba(r))return;let i=t.find(e=>e!==r&&Ba(e));return{change:n[1],task:r,...i?{then:i}:{}}}function Ua(){return(0,j.jsxs)(`span`,{children:[Pa.manualPrWaits,` `,(0,j.jsx)(`a`,{href:Fa,children:Pa.manualSteps}),`.`]})}function Wa({phase:e}){return(0,j.jsxs)(j.Fragment,{children:[Pa.handOffWaitsManual(e),` `,(0,j.jsx)(`a`,{href:Fa,children:Pa.manualSteps})]})}function Ga(e){let t=Vn();return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4,fontSize:12},children:[(0,j.jsx)(`span`,{role:`note`,children:Pa.handoffUnpushed(e.branch)}),(0,j.jsxs)(`span`,{className:`row`,style:{gap:6,flexWrap:`wrap`,alignItems:`center`},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:t.busy,onClick:()=>void t.run(async()=>N(`/api/changes/${encodeURIComponent(e.change)}/handoff/push`,{method:`POST`,body:await Jn(`handoff`,e.change)}).finally(()=>e.onDone?.()),t=>(t.notes??[]).join(` `)||Pa.handoffPushed(e.branch)),children:t.busy?Pa.pushingAgain:Pa.pushAgain}),(0,j.jsx)(`span`,{className:`muted`,children:Pa.pushAgainWhy})]}),(0,j.jsx)(Wn,{note:t.note})]})}function Ka({pr:e}){return Ia(e.url)?(0,j.jsx)(Ua,{}):(0,j.jsx)(Pt,{href:e.url,children:Pa.taskPrNumber(e.number)})}function qa(e){let t=Vn();return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsxs)(`div`,{className:`row`,style:{gap:6,flexWrap:`wrap`,alignItems:`center`},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:t.busy,onClick:()=>void t.run(async()=>N(`/api/changes/${encodeURIComponent(e.change)}/tasks/${encodeURIComponent(e.task)}/pr`,{method:`POST`,body:await Jn(`task-pr`,`${e.change}/${e.task}`)}).finally(()=>e.onDone?.()),t=>Ia(t.taskRun?.pr?.url)?Pa.taskPrManual(e.task):Pa.taskPrRaised(e.task)),children:t.busy?Pa.raisingTaskPr:Pa.raiseTaskPr}),(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:Pa.raiseTaskPrWhy})]}),(0,j.jsx)(Wn,{note:t.note})]})}function Ja(e){let t=Vn();return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsxs)(`div`,{className:`row`,style:{gap:6,flexWrap:`wrap`,alignItems:`center`},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:t.busy,onClick:()=>void t.run(async()=>N(`/api/changes/${encodeURIComponent(e.change)}/tasks/${encodeURIComponent(e.task)}/build`,{method:`POST`,body:{raise:!0,...await Jn(`task-pr`,`${e.change}/${e.task}`)}}).finally(()=>e.onDone?.()),t=>t.taskRun?.state===`pr-open`?Ia(t.taskRun.pr?.url)?Pa.taskPrManual(e.task):Pa.taskBuiltAndRaised(e.task):Pa.taskBuiltOnly(e.task)),children:t.busy?Pa.buildingTask:Pa.buildAndRaise}),(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:Pa.buildAndRaiseWhy})]}),(0,j.jsx)(Wn,{note:t.note})]})}function Ya(e){let t=Vn(),n=e.task,r=n.done,[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(!1),u=`task-${n.id.replace(/[^a-z0-9]/gi,`-`)}-reason`,d=r=>void t.run(()=>N(`/api/changes/${encodeURIComponent(e.change)}/tasks/${encodeURIComponent(n.id)}/done`,{method:`POST`,body:r}).then(e=>(a(!1),e)).catch(e=>{throw e instanceof M&&e.problem.status===409&&a(!0),e}).finally(()=>e.onDone?.()),e=>e.done?Pa.tickedTask(n.id):Pa.untickedTask(n.id)),f=n.taskRun?.marked,p=f&&f.done===r?f:void 0;return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4,fontSize:12},children:[p?(0,j.jsx)(`span`,{children:p.done?Pa.markedDoneBy(p.by,p.at.slice(0,10)):Pa.markedNotDoneBy(p.by,p.at.slice(0,10))}):r&&n.taskRun?.ticked&&(0,j.jsx)(`span`,{children:Pa.tickedByMerge}),n.decision&&(0,j.jsx)(`span`,{children:Pa.taskDecided(n.decision.by,n.decision.at.slice(0,10),n.decision.reason)}),!r&&n.unmerged&&(0,j.jsx)(`span`,{role:`note`,style:{color:`var(--magenta-text)`},children:Pa.taskUnmerged(n.unmerged.branch,n.unmerged.commits,`change/${e.change}`)}),(0,j.jsx)(`span`,{className:`row`,style:{gap:6,flexWrap:`wrap`,alignItems:`center`},children:(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:t.busy,"aria-label":r?Pa.untickTaskLabel(n.id):Pa.tickTaskLabel(n.id),onClick:()=>{!r&&n.unmerged?a(!0):d({done:!r})},children:r?Pa.untickTask:Pa.tickTask})}),i&&!r&&(0,j.jsxs)(`form`,{className:`stack`,style:{gap:4},onSubmit:e=>{e.preventDefault(),o.trim()?(l(!1),d({done:!0,reason:o.trim()})):l(!0)},children:[(0,j.jsx)(`label`,{htmlFor:u,children:Pa.markDoneReason}),(0,j.jsx)(`textarea`,{id:u,rows:2,value:o,"aria-describedby":`${u}-help`,"aria-invalid":c||void 0,onChange:e=>s(e.target.value)}),(0,j.jsx)(`span`,{id:`${u}-help`,className:`muted`,children:c?Pa.markDoneNeedsReason:Pa.markDoneReasonHelp}),(0,j.jsx)(`span`,{className:`row`,style:{gap:6},children:(0,j.jsx)(`button`,{type:`submit`,className:`btn`,disabled:t.busy,children:Pa.markDoneAnyway})})]}),(0,j.jsx)(Wn,{note:t.note})]})}function Xa(e){let t=e.task,n=t.taskRun;if(!n||t.done)return null;let r=n.notes.at(-1),i=n.state===`built`&&Ra(r),a=n.state===`needs-person`||n.state===`failed`,o=za(t),s=a||i,c=n.state===`pr-open`&&!o?n.pr:void 0,l=!!c&&Ia(c.url),u=(o&&Pa.taskPrStateChip[o])??(c?l?Pa.taskPrToOpen:Pa.taskPrOpenChip(c.number):void 0)??Pa.taskState[n.state]??n.state.toUpperCase();return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4,fontSize:12},children:[(0,j.jsxs)(`span`,{className:`row`,style:{gap:6,flexWrap:`wrap`,alignItems:`center`},children:[(0,j.jsx)(`span`,{className:`chip ${a?`blocking`:n.state===`waiting`||l?`ai`:n.state===`unverified`||o===`closed`?`warn`:`done`}`,children:u}),t.run&&(0,j.jsx)(`a`,{href:`#/runs?run=${encodeURIComponent(t.run)}`,children:Pa.openItsRun})]}),n.state===`built`&&n.commit&&(0,j.jsx)(`span`,{children:Pa.taskBuilt(n.branch,n.commit)}),i&&(0,j.jsx)(`span`,{children:Pa.taskPrNotRaised}),n.state===`built`&&n.commit&&(0,j.jsx)(qa,{change:e.change,task:t.id,onDone:e.onDone}),n.state===`unverified`&&(0,j.jsx)(`span`,{children:t.repoBuilds?Pa.taskUnverifiedBuildable(t.repo,n.branch):Pa.taskUnverified(t.repo,n.branch,`change/${e.change}`)}),n.state===`needs-person`&&t.repoBuilds&&n.commit&&(0,j.jsx)(`span`,{children:Pa.taskNeedsPersonBuild(n.branch)}),(n.state===`unverified`||n.state===`needs-person`&&!!n.commit)&&t.repoBuilds&&(0,j.jsx)(Ja,{change:e.change,task:t.id,onDone:e.onDone}),n.state===`pr-open`&&n.pr&&(l?(0,j.jsxs)(`span`,{children:[Pa.taskPrWaitsOnYou,` `,(0,j.jsx)(`a`,{href:`#/todo`,children:Pa.manualSteps}),`.`]}):(0,j.jsxs)(`span`,{children:[o===`merged`?Pa.taskPrMerged:o===`closed`?Pa.taskPrClosed:Pa.taskPrOpen,` `,(0,j.jsx)(Ka,{pr:n.pr})]})),n.state===`waiting`&&(0,j.jsx)(`span`,{children:Pa.taskWaiting}),s&&r&&(0,j.jsx)(`span`,{role:`alert`,style:{color:`var(--magenta-text)`},children:r})]})}var Za=w.across,Qa=[{id:`findings`,label:Za.findings},{id:`tasks`,label:Za.tasks},{id:`stories`,label:Za.stories},{id:`tests`,label:Za.tests},{id:`requests`,label:Za.requests},{id:`releases`,label:Za.releases},{id:`needs`,label:Za.needs}],$a=e=>e==null?``:String(e),eo=e=>(0,j.jsx)(`a`,{href:`#/changes/${e.change}`,className:`mono`,children:e.change}),to=(e,t=``)=>(0,j.jsx)(`span`,{className:`chip ${t}`,children:e.toUpperCase()});function no(e){return(0,j.jsxs)(j.Fragment,{children:[Gr($a(e.nextStep),e.stepFirst===!0,typeof e.nextStepApp==`string`?e.nextStepApp:void 0),e.stepFirst===!0&&(0,j.jsxs)(j.Fragment,{children:[` `,(0,j.jsx)(Nt,{change:e.change})]})]})}function ro(e){return e?e.state===`open`&&Ia(e.pr)?(0,j.jsx)(`a`,{href:Fa,children:Za.handOffManual(e.phase)}):(0,j.jsx)(Pt,{href:e.pr,children:`${e.phase} · ${e.state}`}):(0,j.jsx)(`span`,{className:`muted`,children:Za.noneOpen})}var io={findings:[{label:Za.change,cell:eo,width:`18%`},{label:Za.severity,cell:e=>to($a(e.severity),e.severity===`blocking`?`blocking`:``)},{label:Za.finding,cell:e=>$a(e.summary)},{label:Za.where,cell:e=>`${$a(e.gate)} · ${$a(e.artifact)}`,mono:!0},{label:Za.state,cell:e=>$a(e.state)}],tasks:[{label:Za.change,cell:eo,width:`18%`},{label:Za.task,cell:e=>$a(e.id),mono:!0},{label:Za.repo,cell:e=>$a(e.repo),mono:!0},{label:Za.what,cell:e=>$a(e.description)},{label:Za.done,cell:e=>e.done?to(`done`,`done`):to(`open`)}],stories:[{label:Za.change,cell:eo,width:`18%`},{label:Za.story,cell:e=>$a(e.id),mono:!0},{label:Za.title,cell:e=>$a(e.title)},{label:Za.repos,cell:e=>e.repos.join(`, `),mono:!0},{label:Za.written,cell:e=>e.written?`${$a(e.criteria)} criteria`:(0,j.jsx)(`span`,{className:`muted`,children:Za.notYet})}],tests:[{label:Za.change,cell:eo,width:`18%`},{label:Za.requirementsTested,cell:e=>`${$a(e.tested)} of ${$a(e.rows)}`},{label:Za.gaps,cell:e=>e.gaps?to(`${$a(e.gaps)} gaps`,`warn`):to(`none`,`done`)},{label:Za.firstGaps,cell:e=>e.topGaps.join(`; `)}],requests:[{label:Za.change,cell:eo,width:`18%`},{label:Za.request,cell:e=>$a(e.heading)},{label:Za.for,cell:e=>$a(e.record),mono:!0},{label:Za.state,cell:e=>to($a(e.state),e.state===`filed`?`done`:e.state===`to-file`?`warn`:``)},{label:Za.missing,cell:e=>e.missing.length?e.missing.join(`, `):`nothing`}],releases:[{label:Za.change,cell:eo,width:`18%`},{label:Za.state,cell:e=>to(e.changeState,e.atRelease?`done`:``)},{label:Za.risk,cell:e=>$a(e.risk)},{label:Za.next,cell:e=>no(e)},{label:Za.handOff,cell:e=>ro(e.handoff)}]},ao={findings:Za.noFindingsOnAny,tasks:Za.noTasksYetTasks,stories:Za.noStoriesYetWrite,tests:Za.noOpenChangesTo,requests:Za.noServiceRequestsDrafted,releases:Za.noOpenChanges};function oo(e,t){return e.filter(e=>ti([JSON.stringify(e)],t))}function so({view:e}){let t=P(e===`needs`?void 0:`/api/across?view=${e}`);lt(t);let[n,r]=(0,v.useState)(``),i=Qa.find(t=>t.id===e).label;return(0,j.jsxs)(F,{title:Za.acrossChanges2(i),span:`span 9`,rows:`span 3`,children:[(0,j.jsx)(`nav`,{"aria-label":Za.acrossChanges,className:`kn-tabs`,children:Qa.map(t=>(0,j.jsx)(`a`,{href:`#/changes?across=${t.id}`,"aria-current":t.id===e?`page`:void 0,className:`btn ${t.id===e?`on`:``}`,children:t.label},t.id))}),(0,j.jsx)(`div`,{className:`kn-tools`,children:(0,j.jsx)(ii,{id:`across-filter`,value:n,onChange:r})}),e===`needs`?(0,j.jsx)(Na,{text:n,onClear:()=>r(``)}):(0,j.jsx)(co,{data:t,view:e,text:n,label:i,onClear:()=>r(``)})]})}function co(e){let{data:t,view:n,text:r,label:i}=e;return(0,j.jsx)(j.Fragment,{children:(0,j.jsx)(I,{of:t,empty:e=>e.rows.length===0,emptyText:ao[n],children:t=>{let a=oo(t.rows,r);return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,j.jsx)(`p`,{className:`kn-count`,role:`status`,children:Za.ofAcrossOpenChange(a.length,t.rows.length,t.changes,t.changes===1?``:`s`)}),a.length?(0,j.jsx)(Gn,{rows:a,cols:io[n],rowKey:e=>`${e.change}|${$a(e.id??e.heading??``)}|${a.indexOf(e)}`,caption:Za.acrossOpenChanges(i)}):(0,j.jsx)(oi,{what:ri({text:r}),onClear:e.onClear,focus:`across-filter`})]})}})})}var lo=w.changes,uo=15;function fo(e){let t=``;for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return btoa(t)}function po({change:e}){let t=P(`/api/changes/${e}/inputs`),n=Vn(),r=Vn(),i=(0,v.useRef)(null),a=(0,v.useId)();return St(e=>{e.type===`file.changed`&&t.reload()}),(0,j.jsx)(F,{title:lo.inputs,span:`span 4`,meta:t.state===`ready`?t.data.files.length:void 0,children:(0,j.jsxs)(`div`,{className:`stack`,style:{gap:10},children:[(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`label`,{htmlFor:a,className:`hud`,children:lo.attachLabel}),(0,j.jsx)(`input`,{id:a,ref:i,type:`file`,disabled:n.busy,"aria-describedby":`${a}-help`,onChange:r=>{let a=r.target.files?.[0];a&&n.run(async()=>{if(a.size>uo*1024*1024)throw Error(lo.attachTooLarge(Math.ceil(a.size/1048576)));let n=fo(new Uint8Array(await a.arrayBuffer())),r=await N(`/api/changes/${e}/inputs`,{method:`POST`,body:{name:a.name,content:n}});return t.reload(),i.current&&(i.current.value=``),r},lo.attached(a.name))}}),(0,j.jsx)(`span`,{id:`${a}-help`,className:`muted`,style:{fontSize:12},children:lo.attachHelp}),(0,j.jsx)(Wn,{note:n.note}),(0,j.jsx)(Wn,{note:r.note})]}),(0,j.jsx)(I,{of:t,empty:e=>e.files.length===0,emptyText:lo.noInputs,children:t=>(0,j.jsxs)(`table`,{style:{width:`100%`,borderCollapse:`collapse`,fontSize:12.5},children:[(0,j.jsx)(`caption`,{className:`sr`,children:lo.inputs}),(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{className:`hud`,style:{textAlign:`left`,fontSize:10},children:[(0,j.jsx)(`th`,{style:{padding:`4px 0`,fontWeight:400},children:lo.inputFile}),(0,j.jsx)(`th`,{style:{fontWeight:400},children:lo.inputKind}),(0,j.jsx)(`th`,{style:{fontWeight:400},children:lo.inputWho})]})}),(0,j.jsx)(`tbody`,{children:t.files.map(t=>(0,j.jsxs)(`tr`,{style:{borderTop:`1px solid var(--rule)`},children:[(0,j.jsx)(`td`,{className:`mono`,style:{padding:`7px 0`,wordBreak:`break-all`},children:t.path}),(0,j.jsx)(`td`,{children:(0,j.jsxs)(`span`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`span`,{children:`${t.kind} · ${t.format}`}),(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:11.5},children:lo.inputRead(t.read,t.citeBy)}),t.supersededBy&&(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:11.5},children:lo.inputOlder(t.supersededBy)}),t.defences?.risk===`high`&&(0,j.jsx)(`span`,{className:`chip blocking`,children:lo.inputHidden})]})}),(0,j.jsx)(`td`,{children:(0,j.jsxs)(`span`,{className:`stack`,style:{gap:4,alignItems:`flex-start`},children:[(0,j.jsx)(`span`,{children:lo.inputWhen(t.addedBy,t.addedAt)}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:r.busy,"aria-label":lo.promoteFor(t.path),onClick:()=>void r.run(()=>N(`/api/changes/${e}/inputs/${encodeURIComponent(t.path.replace(/^inputs\//,``))}/promote`,{method:`POST`}),lo.promoted(t.path)),children:lo.promote})]})})]},t.path))})]})})]})})}var mo=w.changes,ho=[`exists`,`changes`,`new`,`vendor`];function go({c:e}){return(0,j.jsxs)(`li`,{className:`stack`,style:{gap:3,borderTop:`1px solid var(--rule)`,paddingTop:6},children:[(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`span`,{className:`chip`,children:mo.prototypeLeg[e.leg]}),` `,(0,j.jsx)(`span`,{className:`mono`,children:[e.method,e.path].filter(Boolean).join(` `)})]}),(0,j.jsx)(`span`,{children:e.sentence}),(0,j.jsx)(`span`,{className:`muted mono`,style:{fontSize:11.5,wordBreak:`break-all`},children:mo.prototypeCites(e.call.at,e.lands.at)}),e.estate&&(0,j.jsx)(`span`,{className:`muted mono`,style:{fontSize:11.5,wordBreak:`break-all`},children:mo.prototypeEstate(e.estate.entry.repo,e.estate.entry.at)}),e.vendor?.at&&(0,j.jsx)(`span`,{className:`muted mono`,style:{fontSize:11.5,wordBreak:`break-all`},children:e.vendor.boundary===`internal`?mo.prototypeTeam(e.vendor.name,e.vendor.at):mo.prototypeVendor(e.vendor.name,e.vendor.at)}),e.differences.length>0&&(0,j.jsx)(`ul`,{style:{margin:0,paddingLeft:18},children:e.differences.map((e,t)=>(0,j.jsx)(`li`,{children:e.message},t))})]})}function _o({p:e}){let t=`proto-${e.repo}`;return(0,j.jsxs)(`article`,{className:`stack`,style:{gap:8},"aria-labelledby":t,children:[(0,j.jsxs)(`h3`,{id:t,className:`h`,style:{fontSize:13},children:[(0,j.jsx)(`span`,{className:`chip`,children:mo.prototypeMarker}),` `,(0,j.jsx)(`span`,{className:`mono`,children:e.repo})]}),(0,j.jsx)(`span`,{className:`muted`,children:e.about?`${e.about.text}${e.about.trust===`suggested`?` (${mo.prototypeUnconfirmed})`:``}`:mo.prototypeNoAbout}),e.problem&&(0,j.jsx)(`div`,{className:`state`,role:`status`,children:e.problem}),e.comparison&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`span`,{className:`hud`,children:mo.prototypeCounts(e.comparison.counts)}),ho.map(t=>{let n=e.comparison.calls.filter(e=>e.group===t);return(0,j.jsxs)(`section`,{className:`stack`,style:{gap:4},"aria-label":mo.prototypeGroup[t],children:[(0,j.jsx)(`h4`,{className:`hud`,style:{margin:0},children:mo.prototypeGroupCount(mo.prototypeGroup[t],n.length)}),(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:11.5},children:mo.prototypeGroupHelp[t]}),n.length?(0,j.jsx)(`ul`,{className:`stack`,style:{gap:6,listStyle:`none`,margin:0,padding:0},children:n.map(e=>(0,j.jsx)(go,{c:e},e.id))}):(0,j.jsx)(`span`,{className:`muted`,children:mo.prototypeNoCalls})]},t)}),e.comparison.left.length>0&&(0,j.jsx)(`span`,{className:`muted`,children:mo.prototypeLeft(e.comparison.left.length)})]})]})}function vo(e){let[t,n]=(0,v.useState)(``),r=Vn(),i=(0,v.useId)();if(!e.candidates.length)return(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:mo.prototypeNoCandidates});let a=t&&e.candidates.includes(t)?t:e.candidates[0];return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`,alignItems:`flex-end`},children:[(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`label`,{htmlFor:`${i}-repo`,className:`hud`,children:mo.prototypePick}),(0,j.jsx)(`select`,{id:`${i}-repo`,className:`field`,value:a,disabled:r.busy,onChange:e=>n(e.target.value),children:e.candidates.map(e=>(0,j.jsx)(`option`,{value:e,children:e},e))})]}),(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:r.busy,"aria-describedby":`${i}-help`,onClick:()=>void r.run(async()=>{let t=await N(`/api/changes/${encodeURIComponent(e.change)}/prototypes`,{method:`POST`,body:{repo:a}});return e.onDone(),t},e=>e.lines.join(`
|
|
22
|
+
`)||mo.prototypeCompared(a)),children:r.busy?mo.prototypeComparing:mo.prototypeCompare})]}),(0,j.jsx)(`span`,{id:`${i}-help`,className:`muted`,style:{fontSize:12},children:mo.prototypeCompareHelp}),(0,j.jsx)(Wn,{note:r.note})]})}function yo({change:e}){let t=P(`/api/changes/${e}/prototypes`);return St(e=>{e.type===`file.changed`&&t.reload()}),(0,j.jsx)(F,{title:mo.prototypes,span:`span 4`,meta:t.state===`ready`?t.data.prototypes.length:void 0,children:(0,j.jsx)(I,{of:t,children:n=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:14},children:[(0,j.jsx)(vo,{change:e,candidates:n.candidates??[],onDone:t.reload}),n.prototypes.length===0?(0,j.jsx)(`div`,{className:`state`,children:mo.noPrototypes(e)}):n.prototypes.map(e=>(0,j.jsx)(_o,{p:e},e.repo))]})})})}var bo=e=>(e?.round?.lenses??[]).filter(e=>e.state===`waiting`&&!!e.runId).length,xo=w.changeWork;function So({children:e}){return(0,j.jsx)(`div`,{className:`cw`,children:e})}function Co(e){return(0,j.jsxs)(`header`,{className:`cw-head`,children:[(0,j.jsxs)(`div`,{className:`cw-head-name`,children:[(0,j.jsx)(`p`,{className:`cw-title`,children:e.title}),(e.sub||e.badges)&&(0,j.jsxs)(`div`,{className:`cw-head-sub`,children:[e.sub&&(0,j.jsx)(`span`,{className:`cw-sub`,children:e.sub}),e.badges]})]}),e.actions&&(0,j.jsx)(`div`,{className:`cw-head-actions`,children:e.actions})]})}var wo=w.changes,To=xo.lifecycle,Eo=new Set([`release-ready`,`post-release-review`,`returned`]);function Do({state:e,blocked:t}){let n=t?`blocking`:Eo.has(e)?`warn`:`dim`;return(0,j.jsx)(`span`,{className:`chip ${n} cw-badge`,children:t?wo.blocked:To[e]??e})}function Oo(e){let t=e.trim().split(/\s+/);return t.length>6?`${t.slice(0,6).join(` `)}…`:t.join(` `)}function ko({children:e,text:t,about:n}){let r=(0,v.useId)(),[i,a]=(0,v.useState)(!1),o=t.length>140,s=n??Oo(t);return(0,j.jsxs)(`div`,{className:`cw-explain${o&&!i?` cut`:``}`,children:[(0,j.jsx)(`p`,{id:`${r}-x`,className:`cw-explain-text`,children:e??t}),o&&(0,j.jsx)(`button`,{type:`button`,className:`cw-more`,"aria-expanded":i,"aria-controls":`${r}-x`,"aria-label":i?xo.lessAbout(s):xo.moreAbout(s),onClick:()=>a(!i),children:i?xo.less:xo.more})]})}var Ao=w.changeOwners,jo=w.roleWork,Mo=[`product-owner`,`architect`,`business-analyst`,`team-lead`];function No(e){return Object.fromEntries(Mo.map(t=>[t,(e?.[t]??[]).join(`, `)]))}function Po(e){return{owners:Object.fromEntries(Mo.map(t=>[t,[...new Set((e[t]??``).split(/[,\s]+/).map(e=>e.trim()).filter(Boolean))]]))}}function Fo(e,t){return{owners:{[t.role]:[...new Set([...e?.[t.role]??[],...t.people])]}}}function Io(e){return`team`in e.from?jo.suggestedFromTeam(e.from.name??e.from.team,e.from.repos.join(`, `)):jo.suggestedDefault}function Lo(e){let t=(0,v.useId)(),[n,r]=(0,v.useState)(e.startEditing===!0),[i,a]=(0,v.useState)(e.owners),o=JSON.stringify(e.owners??{});(0,v.useEffect)(()=>a(JSON.parse(o)),[o]);let[s,c]=(0,v.useState)(()=>No(e.owners)),l=Vn(),u=Vn(),d=P(`/api/changes/${encodeURIComponent(e.change)}/owners/suggested`),f=t=>{t.preventDefault(),l.run(()=>N(`/api/changes/${encodeURIComponent(e.change)}/owners`,{method:`PUT`,body:Po(s)}).then(()=>{r(!1),d.reload(),e.onSaved?.()}),Ao.saved)},p=d.state===`ready`?d.data.suggestions:[];return(0,j.jsxs)(`section`,{className:`stack`,style:{gap:6},"aria-labelledby":`${t}-h`,children:[(0,j.jsx)(`p`,{id:`${t}-h`,className:`hud`,style:{margin:0},children:jo.ownersTitle}),(0,j.jsx)(ko,{text:jo.ownersIntro}),!n&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`dl`,{className:`row`,style:{gap:16,flexWrap:`wrap`,margin:0},children:Mo.map(e=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:2,minWidth:140},children:[(0,j.jsx)(`dt`,{className:`hud`,style:{fontSize:10},children:Ao.roles[e]}),(0,j.jsx)(`dd`,{style:{margin:0,fontSize:13},children:(i?.[e]??[]).length?(i?.[e]??[]).join(`, `):jo.nobody})]},e))}),p.length>0&&(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`p`,{className:`hud`,style:{margin:0,fontSize:10},children:jo.suggestedTitle}),(0,j.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0},className:`stack`,children:p.map(t=>{let n=t.people.join(`, `),r=jo.roleNames[t.role]??t.role;return(0,j.jsxs)(`li`,{className:`row`,style:{gap:8,flexWrap:`wrap`},children:[(0,j.jsxs)(`span`,{style:{fontSize:13},children:[Ao.roles[t.role]??t.role,`: `,(0,j.jsx)(`strong`,{children:n}),` `,(0,j.jsxs)(`span`,{className:`muted`,children:[`(`,Io(t),`)`]})]}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:u.busy,"aria-label":jo.acceptFor(n,r),onClick:()=>void u.run(()=>{let n=Fo(i,t);return N(`/api/changes/${encodeURIComponent(e.change)}/owners`,{method:`PUT`,body:n}).then(t=>{a(t?.owners??{...i,...n.owners}),d.reload(),e.onSaved?.()})},jo.accepted(n,r)),children:jo.accept})]},`${t.role}|${n}`)})})]}),(0,j.jsx)(Wn,{note:u.note}),(0,j.jsx)(`div`,{className:`row`,style:{gap:6},children:(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>{c(No(i)),r(!0)},children:jo.editOwners})}),(0,j.jsx)(Wn,{note:l.note})]}),n&&(0,j.jsxs)(`form`,{className:`stack`,style:{gap:6},onSubmit:f,children:[(0,j.jsx)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`},children:Mo.map(e=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:2,minWidth:160},children:[(0,j.jsx)(`label`,{htmlFor:`${t}-${e}`,className:`hud`,style:{fontSize:10},children:Ao.roles[e]}),(0,j.jsx)(`input`,{id:`${t}-${e}`,className:`field`,value:s[e],placeholder:Ao.placeholder,onChange:t=>c(n=>({...n,[e]:t.target.value}))})]},e))}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`button`,{type:`submit`,className:`btn`,disabled:l.busy,children:l.busy?Ao.saving:jo.saveOwners}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>r(!1),children:jo.cancelOwners})]}),(0,j.jsx)(Wn,{note:l.note})]})]})}var Ro=w.brokenChanges,zo=`/api/change-problems`,Bo=e=>e.line?Ro.fileLine(e.file,e.line):e.file;function Vo({of:e}){let t=(0,v.useId)();return e.state!==`ready`||e.data.length===0?null:(0,j.jsxs)(`section`,{className:`cw-broken`,"aria-labelledby":t,children:[(0,j.jsx)(`h3`,{id:t,className:`hud`,children:Ro.title(e.data.length)}),(0,j.jsx)(`ul`,{className:`stack`,style:{gap:6,margin:0,paddingLeft:18},children:e.data.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`strong`,{children:e.id}),` `,(0,j.jsx)(`span`,{className:`muted`,children:Bo(e)}),(0,j.jsx)(`div`,{style:{overflowWrap:`anywhere`},children:e.message})]},e.id))}),(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:Ro.fix})]})}function Ho(){let e=P(zo);return lt(e),(0,j.jsx)(Vo,{of:e})}var z=w.changes,Uo=w.changeWork;function Wo(e,t,n){let r=t.toLowerCase().split(/\s+/).filter(Boolean);return e.filter(e=>{if(n===`blocked`&&!e.openFindings.blocking||n&&n!==`blocked`&&e.state!==n)return!1;let t=[e.id,e.title,e.type,...e.repos??[]].join(` `).toLowerCase();return r.every(e=>t.includes(e))})}var Go=[`define`,`design`,`plan`,`build`,`qa`,`release-ready`],Ko={define:z.define,design:z.design,plan:z.plan,build:z.build,qa:z.qa,"release-ready":z.release};function qo({list:e,current:t,across:n,onCreated:r}){let[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(``);return(0,j.jsxs)(F,{title:z.changes,className:`cw-list-panel`,meta:e.state===`ready`?Uo.changeCount(e.data.length):void 0,children:[(0,j.jsx)(br,{onCreated:e=>{r?.(),window.location.hash=`#/changes/${e}`}}),(0,j.jsx)(Ho,{}),(0,j.jsx)(I,{of:e,empty:e=>e.length===0,emptyText:z.noChangesYetStart,children:e=>{let r=[...new Set(e.map(e=>e.state))],c=Wo(e,i,o);return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:10,marginTop:8},children:[(0,j.jsxs)(`div`,{className:`cw-list-tools`,children:[(0,j.jsx)(`label`,{htmlFor:`change-filter`,className:`cw-label`,children:z.findAChange}),(0,j.jsx)(`input`,{id:`change-filter`,className:`field`,value:i,placeholder:z.idTitleOrRepo,onChange:e=>a(e.target.value)}),(0,j.jsx)(`label`,{htmlFor:`change-state`,className:`sr`,children:z.state}),(0,j.jsxs)(`select`,{id:`change-state`,className:`field`,value:o,onChange:e=>s(e.target.value),children:[(0,j.jsx)(`option`,{value:``,children:z.everyState}),(0,j.jsx)(`option`,{value:`blocked`,children:z.blocked}),r.map(e=>(0,j.jsx)(`option`,{value:e,children:Ko[e]??e},e))]})]}),(0,j.jsxs)(`nav`,{"aria-label":z.changes,className:`cw-list`,children:[c.map(e=>(0,j.jsxs)(`a`,{href:`#/changes/${e.id}`,"aria-current":!n&&e.id===t?`page`:void 0,className:`cw-row`,children:[(0,j.jsxs)(`span`,{className:`cw-row-main`,children:[(0,j.jsx)(`span`,{className:`cw-row-title`,children:e.title}),(0,j.jsx)(`span`,{className:`cw-row-sub`,children:e.id})]}),(0,j.jsx)(`span`,{className:`chip ${e.openFindings.blocking?`blocking`:`dim`}`,children:e.openFindings.blocking?z.blocked:Ko[e.state]??e.state})]},e.id)),c.length===0&&(0,j.jsx)(`p`,{className:`state`,children:z.noChangeMatches})]}),(0,j.jsxs)(`div`,{className:`cw-across`,children:[(0,j.jsx)(`span`,{className:`cw-label`,children:z.acrossAllChanges}),(0,j.jsx)(`div`,{className:`cw-across-links`,children:Qa.map(e=>(0,j.jsx)(`a`,{href:`#/changes?across=${e.id}`,"aria-current":n===e.id?`page`:void 0,className:`chip`,style:{textDecoration:`none`},children:e.label},e.id))})]})]})}})]})}function Jo({state:e}){let t=Go.indexOf(e);return(0,j.jsx)(`ol`,{className:`cw-gates`,"aria-label":z.phases,children:Go.map((e,n)=>(0,j.jsxs)(`li`,{className:`cw-gate${n<t?` done`:n===t?` now`:``}`,"aria-current":n===t?`step`:void 0,children:[(0,j.jsx)(`span`,{role:`img`,className:`cw-gate-dot`,"aria-label":n===t?z.currentPhase(Ko[e]??``):`${Ko[e]}: ${n<t?z.done:z.toCome}`,children:n<t?`✓`:n===t?n+1:``}),(0,j.jsx)(`span`,{className:`cw-gate-name`,"aria-hidden":`true`,children:Ko[e]})]},e))})}var Yo=(e,t,n)=>`/api/changes/${e}/artifacts/${t}${n?`?file=${encodeURIComponent(n)}`:``}`,Xo=/^(generated|drafted) by atticus\b/i;function Zo(e){let t=[];for(let n of e.matchAll(/<!--([\s\S]*?)-->/g)){let e=n[1].replace(/\s+/g,` `).trim();e&&!Xo.test(e)&&!t.includes(e)&&t.push(e)}return t}function Qo({change:e,artifact:t,file:n,onClose:r,onSaved:i,line:a}){let o=P(Yo(e,t,n)),s=`artifact-text${n?`-${n.replace(/[^a-z0-9]+/gi,`-`)}`:``}`,[c,l]=(0,v.useState)(),u=Vn(),d=(0,v.useRef)(null),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)(),g=o.state===`ready`;return(0,v.useEffect)(()=>{if(!g)return;let e=d.current;if(e?.focus(),e&&a&&a>0){let t=e.value.split(`
|
|
23
|
+
`),n=Math.min(a,t.length),r=t.slice(0,n-1).reduce((e,t)=>e+t.length+1,0);e.setSelectionRange(r,r+(t[n-1]?.length??0)),e.scrollTop=Math.max(0,(n-4)*20.8)}},[g,a]),(0,j.jsx)(F,{title:z.edit(n??t),span:`1 / -1`,meta:o.state===`ready`?o.data.path:void 0,children:(0,j.jsx)(I,{of:o,children:a=>{let g=m&&m.from===a.sha256?{...a,content:m.content,sha256:m.sha256}:a;return(0,j.jsxs)(`form`,{onSubmit:r=>{r.preventDefault(),p(!1),u.run(()=>N(Yo(e,t,n),{method:`PUT`,body:{content:c??g.content,baseSha256:g.sha256}}).then(e=>{h({from:a.sha256,content:e.content,sha256:e.sha256}),l(void 0),o.reload(),i?.()}).catch(e=>{throw e instanceof M&&e.problem.status===409&&p(!0),e}),z.saved(g.path))},onKeyDown:Dt(r),className:`stack`,children:[(0,j.jsx)(`label`,{htmlFor:s,className:`sr`,children:z.text(n??t)}),Zo(g.content).length>0&&(0,j.jsxs)(`div`,{id:`${s}-hints`,className:`work-why`,style:{margin:0},children:[(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:z.templateAsks}),(0,j.jsx)(`ul`,{style:{margin:`4px 0 0`,paddingLeft:18,lineHeight:1.6},children:Zo(g.content).map(e=>(0,j.jsx)(`li`,{children:e},e))})]}),(0,j.jsx)(`textarea`,{ref:d,id:s,"aria-describedby":Zo(g.content).length>0?`${s}-hints`:void 0,value:c??g.content,onChange:e=>l(e.target.value),rows:18,spellCheck:!0,style:{width:`100%`,background:`var(--box)`,color:`var(--text)`,border:`1px solid var(--line-2)`,borderRadius:8,padding:12,font:`13px/1.6 var(--mono)`}}),(0,j.jsxs)(`div`,{className:`row`,children:[(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:u.busy,children:z.save}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:r,children:c!==void 0&&c!==g.content?z.cancel:z.close}),(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:z.ifSomeoneSavedMeanwhile})]}),(0,j.jsx)(Wn,{note:u.note}),f&&(0,j.jsxs)(`p`,{role:`alert`,className:`state error`,children:[z.changedMeanwhile,` `,(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>{p(!1),o.reload()},children:z.reloadKeepMine})]})]})}})})}var $o=w.findings.needsReason,es=w.findings.cantWaive;function ts({change:e,f:t,done:n,say:r}){let[i,a]=(0,v.useState)(``),o=Vn(),s=a=>{let s=z.recordedOn(a.replace(/-/g,` `),t.id);return o.run(()=>N(`/api/findings/${e}/${t.id}/action`,{method:`POST`,body:{action:a,gate:t.gate,...i?{reason:i}:{}}}).then(()=>{r?.(s),n()}),s)};return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,j.jsx)(`label`,{className:`sr`,htmlFor:`reason-${t.id}`,children:z.reason}),(0,j.jsx)(`input`,{id:`reason-${t.id}`,value:i,onChange:e=>a(e.target.value),placeholder:z.reasonNeededToWaive,style:{height:30,background:`var(--box)`,color:`var(--text)`,border:`1px solid var(--line-2)`,borderRadius:6,padding:`0 8px`}}),(0,j.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,gap:6},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:o.busy,onClick:()=>void s(`apply`),children:z.applyFix}),t.question&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:o.busy,onClick:()=>void s(`ask`),children:z.ask(t.question.owner??z.owner)}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:o.busy||!i,title:i?void 0:$o,"aria-describedby":i?void 0:`why-${t.id}`,onClick:()=>void s(`not-relevant`),children:z.notRelevant}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:o.busy||!i||!t.waivable,title:t.waivable?i?void 0:$o:es,"aria-describedby":!t.waivable||!i?`why-${t.id}`:void 0,onClick:()=>void s(`waive`),children:z.waive})]}),(!i||!t.waivable)&&(0,j.jsx)(`p`,{id:`why-${t.id}`,className:`muted`,style:{margin:0,fontSize:11.5},children:[i?``:$o,t.waivable?``:`${es}.`].filter(Boolean).join(` `)}),(0,j.jsx)(Wn,{note:o.note})]})}function ns({handoff:e}){let t=e.phase.toUpperCase();if(e.pr&&Ia(e.pr))return(0,j.jsx)(`span`,{className:`chip`,children:z.handOffManual(t)});let n=e.pr?/(\d+)\/?(?:[?#].*)?$/.exec(e.pr)?.[1]:void 0;return(0,j.jsxs)(`span`,{className:`chip`,children:[z.handOff(t,e.state.toUpperCase(),``),e.pr&&(0,j.jsxs)(j.Fragment,{children:[` · `,(0,j.jsx)(Pt,{href:e.pr,children:Uo.prShort(n)})]})]})}function rs({id:e}){let t=Qr(),n=P(`/api/changes/${e}`),r=P(`/api/changes/${e}/status`),i=P(`/api/changes/${e}/tasks`),a=P(`/api/changes/${e}/runs`),o=P(`/api/findings?change=${e}&state=open`),[s,c]=(0,v.useState)(),l=(0,v.useRef)(new Map),u=()=>{let e=s;c(void 0),e&&l.current.get(e)?.focus()},d=Vn(),f=Vn(),p=Vn(),m=Hn(),h=(0,v.useId)(),g=()=>{n.reload(),r.reload(),o.reload(),a.reload(),i.reload()};return St(e=>{(e.type===`file.changed`||e.type===`run.changed`)&&g()}),(0,j.jsxs)(`div`,{className:`cw-detail`,children:[(0,j.jsx)(F,{title:n.state===`ready`?`${n.data.id} · ${n.data.title}`:e,kind:`hero`,className:`cw-summary-panel`,children:(0,j.jsx)(I,{of:n,children:i=>(0,j.jsxs)(`div`,{className:`cw-summary`,children:[(0,j.jsx)(Jo,{state:i.state}),(0,j.jsx)(I,{of:r,children:n=>(0,j.jsxs)(`div`,{className:`cw-next`,children:[(0,j.jsxs)(`p`,{className:`cw-next-line`,children:[(0,j.jsx)(`span`,{className:`cw-label`,children:z.next}),(0,j.jsxs)(`span`,{children:[n.handoff&&Ia(n.handoff.pr.url)?(0,j.jsx)(Wa,{phase:n.handoff.phase}):Gr(n.nextStep,n.stepFirst,n.nextStepApp),n.stepFirst&&(0,j.jsxs)(j.Fragment,{children:[` `,(0,j.jsx)(Nt,{change:e})]})]})]}),(0,j.jsxs)(`div`,{className:`cw-chips`,children:[(0,j.jsx)(`span`,{className:`chip ${n.risk.level===`high`?`blocking`:n.risk.level===`medium`?`warn`:``}`,children:z.risk(n.risk.level.toUpperCase())}),i.handoff&&(0,j.jsx)(ns,{handoff:i.handoff})]}),i.handoff?.unpushed&&i.handoff.branch&&(0,j.jsx)(Ga,{change:i.id,branch:i.handoff.branch,onDone:g}),n.blockers.length>0&&(0,j.jsx)(`ul`,{className:`cw-blockers`,"aria-label":z.whatBlocksTheHand,children:n.blockers.map(e=>(0,j.jsx)(`li`,{children:e.message},e.message))}),(n.blockers.length>0||n.stepFirst)&&(0,j.jsx)(`p`,{id:h,className:`cw-held`,children:n.blockers.length>0?z.blockedBy(n.blockers.length):z.heldFirst}),(0,j.jsxs)(`div`,{className:`cw-actions`,children:[(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:d.busy||n.blockers.length>0||!!n.stepFirst,"aria-describedby":n.blockers.length>0||n.stepFirst?h:void 0,onClick:()=>void d.run(async()=>N(`/api/changes/${e}/handoff`,{method:`POST`,body:await Jn(`handoff`,e)}).then(e=>(g(),e)),e=>[z.handOffPrOpened,...e.notes??[]].join(` `)),children:z.raiseHandOff}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:d.busy,onClick:()=>void d.run(async()=>N(`/api/changes/${e}/sync`,{method:`POST`,body:await Jn(`merge`,e)}).then(g),z.syncedWithTheGit),children:z.syncAndMergeWhen}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:f.busy,onClick:()=>void f.run(()=>N(`/api/changes/${e}/critic`,{method:`POST`,body:{}}).then(e=>(g(),e)),e=>t?w.thread.criticRan(bo(e)):z.theRuleChecksRan),children:t?z.runTheCriticYour:z.runTheRuleChecks})]}),(0,j.jsx)(Wn,{note:d.note}),(0,j.jsx)(Wn,{note:f.note}),(0,j.jsx)(Zc,{})]})}),(0,j.jsx)(Lo,{change:i.id,owners:i.owners,onSaved:n.reload})]})})}),s&&(0,j.jsx)(Qo,{change:e,artifact:s,onClose:u}),(0,j.jsxs)(`div`,{className:`cw-pairs`,children:[(0,j.jsxs)(F,{title:z.artifacts,children:[(0,j.jsx)(I,{of:n,empty:e=>e.artifacts.length===0,children:e=>(0,j.jsxs)(`table`,{className:`cw-table`,children:[(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{children:z.artifact}),(0,j.jsx)(`th`,{children:z.status}),(0,j.jsx)(`th`,{children:z.findings}),(0,j.jsx)(`th`,{children:(0,j.jsx)(`span`,{className:`sr`,children:z.actions})})]})}),(0,j.jsx)(`tbody`,{children:e.artifacts.map(e=>(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`td`,{className:`mono`,children:e.artifact}),(0,j.jsx)(`td`,{children:(0,j.jsx)(`span`,{className:`chip ${e.status===`done`?`done`:e.status===`blocked`?`dim`:`warn`}`,children:qr(e)})}),(0,j.jsx)(`td`,{children:e.openFindings||``}),(0,j.jsx)(`td`,{children:e.status!==`blocked`&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,ref:t=>{t?l.current.set(e.artifact,t):l.current.delete(e.artifact)},onClick:()=>c(e.artifact),"aria-label":z.edit(e.artifact),children:z.edit2})})]},e.artifact))})]})}),n.state===`ready`&&n.data.artifacts.some(e=>(e.artifact===`proposal`||e.artifact===`specs`)&&e.status!==`done`)&&(0,j.jsx)(zr,{command:`atticus change draft ${e}`})]}),(0,j.jsxs)(F,{title:z.openFindings,meta:o.state===`ready`?o.data.length:void 0,children:[(0,j.jsx)(Un,{said:m.said}),(0,j.jsx)(I,{of:o,empty:e=>e.length===0,emptyText:z.noOpenFindingsOn,children:t=>(0,j.jsx)(`div`,{className:`stack`,style:{gap:0},children:t.map(t=>(0,j.jsxs)(`article`,{className:`cw-finding`,children:[(0,j.jsxs)(`div`,{className:`cw-chips`,children:[(0,j.jsx)(`span`,{className:`chip ${t.severity===`blocking`?`blocking`:t.severity===`gap`?`warn`:`dim`}`,children:t.severity.toUpperCase()}),(0,j.jsxs)(`span`,{className:`cw-row-sub`,children:[t.gate,` · `,t.lens??z.checks,` · `,t.artifact]})]}),(0,j.jsx)(`div`,{className:`cw-finding-what`,children:t.question?.text??t.summary}),(0,j.jsx)(`div`,{className:`cw-finding-why`,children:t.why}),(0,j.jsx)(ts,{change:e,f:t,done:g,say:m.say})]},`${t.gate}/${t.id}`))})})]}),(0,j.jsxs)(F,{title:z.tasks,children:[(0,j.jsx)(I,{of:i,empty:e=>e.length===0,emptyText:z.noTasksYetThey,children:n=>n.map(n=>(0,j.jsxs)(`div`,{className:`list-row`,children:[(0,j.jsxs)(`span`,{className:`cw-row-main`,children:[(0,j.jsxs)(`span`,{style:{fontSize:12.5},children:[(0,j.jsx)(`span`,{className:`mono`,children:n.id}),` `,n.description]}),(0,j.jsxs)(`span`,{className:`cw-row-sub`,children:[n.repo,n.story?` · ${n.story}`:``]})]}),n.done?(0,j.jsx)(`span`,{className:`chip done`,children:z.done2}):t?(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:p.busy,onClick:()=>void p.run(()=>N(`/api/changes/${e}/runs`,{method:`POST`,body:{agent:`task-runner`,runtime:`hand-off`,task:n.id}}).then(g),z.taskHanded(n.id)),children:z.runWithAi}):(0,j.jsx)(`span`,{className:`chip dim`,title:$r,children:z.byHand})]},n.id))}),(0,j.jsx)(Wn,{note:p.note})]}),(0,j.jsx)(F,{title:z.aiRuns,children:(0,j.jsx)(I,{of:a,empty:e=>e.length===0,emptyText:z.noAiRunsYet,children:e=>e.slice().reverse().map(e=>(0,j.jsxs)(`div`,{className:`list-row`,style:{alignItems:`flex-start`},children:[(0,j.jsxs)(`span`,{className:`cw-row-main`,children:[(0,j.jsx)(`span`,{style:{fontSize:12.5},children:e.agent}),(0,j.jsxs)(`span`,{className:`cw-row-sub`,children:[e.runtime,` · `,e.promptPath??e.runId]}),e.errors.length>0&&(0,j.jsx)(`span`,{style:{color:`var(--magenta-text)`,fontSize:12},children:e.errors.join(`; `)}),e.taskRun&&(0,j.jsx)(as,{of:e.taskRun,pr:i.state===`ready`?i.data.find(t=>t.id===e.taskRun.task)?.taskRun?.pr?.state:void 0})]}),(0,j.jsxs)(`span`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`span`,{className:`chip ${e.state===`validated`?`done`:e.state===`failed`?`blocking`:`ai`}`,children:e.state.toUpperCase()}),(e.state===`waiting`||e.state===`prepared`)&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:p.busy,onClick:()=>void p.run(()=>Ze(`/api/runs/${e.runId}/done`).then(g),z.checkedTheAnswer),children:z.markDone}),(e.state===`waiting`||e.state===`prepared`)&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:p.busy,onClick:()=>void p.run(()=>N(`/api/runs/${e.runId}/cancel`,{method:`POST`,body:{}}).then(g),z.runCancelled),children:z.cancelRun}),e.state===`failed`&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:p.busy,onClick:()=>void p.run(()=>N(`/api/runs/${e.runId}/retry`,{method:`POST`,body:{}}).then(g),z.readyToTryAgain),children:z.retry})]})]},e.runId))})}),(0,j.jsx)(po,{change:e}),(0,j.jsx)(yo,{change:e})]}),(0,j.jsx)(wa,{change:e,span:`1 / -1`})]})}function is({hash:e}){let t=e.replace(/^#\/?changes\/?/,``).split(`?`)[0]||void 0,n=new URLSearchParams(e.split(`?`)[1]??``).get(`across`),r=Qa.find(e=>e.id===n)?.id,i=P(`/api/changes`),a=i.state===`ready`?i.data[0]?.id:void 0,o=t??a;return(0,j.jsxs)(`div`,{className:`cw-split`,children:[(0,j.jsx)(qo,{list:i,current:o,across:r,onCreated:i.reload}),r&&!t?(0,j.jsx)(so,{view:r},r):o?(0,j.jsx)(rs,{id:o},o):(0,j.jsx)(F,{title:z.noChangeSelected,children:(0,j.jsx)(`p`,{className:`state`,children:z.pickAChangeOn})})]})}function as({of:e,pr:t}){let n=e.state===`needs-person`||e.state===`failed`,r=e.notes.at(-1);return(0,j.jsxs)(`span`,{className:`stack`,style:{gap:2,fontSize:12},children:[(0,j.jsx)(`span`,{className:`chip ${n?`blocking`:e.state===`waiting`?`ai`:`done`}`,children:z.taskRunLine(e.task,e.state,t)}),r&&(0,j.jsx)(`span`,{role:n?`alert`:void 0,style:n?{color:`var(--magenta-text)`}:void 0,children:r}),e.log&&(0,j.jsx)(`code`,{className:`mono`,children:z.taskRunLog(e.log)})]})}var os=w.roleWork.brief,ss=/<!--([\s\S]*?)-->/g;function cs(e){let t=e.replace(/\r\n/g,`
|
|
24
|
+
`).split(/^## /m);return{head:t.shift()??``,sections:t.map(e=>{let t=e.indexOf(`
|
|
25
|
+
`),n=(t<0?e:e.slice(0,t)).trim(),r=t<0?``:e.slice(t+1);return{heading:n,hint:[...r.matchAll(ss)].map(e=>e[1].replace(/\s+/g,` `).trim()).filter(Boolean).join(` `),text:r.replace(ss,``).trim(),raw:r}})}}function ls(e,t){return(e.head+e.sections.map((e,n)=>{let r=t[n];if(r===void 0||r.trim()===e.text)return`## ${e.heading}\n${e.raw}`;let i=[e.hint?`<!-- ${e.hint} -->`:``,r.trim()].filter(Boolean).join(`
|
|
26
|
+
|
|
27
|
+
`);return`## ${e.heading}\n\n${i}\n\n`}).join(``)).replace(/\n{3,}$/,`
|
|
28
|
+
|
|
29
|
+
`)}var us=new Map;function ds({change:e,onSaved:t}){let n=(0,v.useId)(),r=P(Yo(e,`brief`)),i=us.get(e),[a,o]=(0,v.useState)(()=>!!i),[s,c]=(0,v.useState)(()=>i??{}),[l]=(0,v.useState)(()=>!!i),u=(0,v.useRef)({editing:a,texts:s});u.current={editing:a,texts:s},(0,v.useEffect)(()=>()=>{let{editing:t,texts:n}=u.current;t&&Object.keys(n).length?us.set(e,n):us.delete(e)},[e]);let[d,f]=(0,v.useState)(!1),p=Vn(),m=(0,v.useRef)(null);return(0,j.jsxs)(F,{title:os.title,meta:!a&&r.state===`ready`?(0,j.jsx)(`button`,{ref:m,type:`button`,className:`btn`,onClick:()=>o(!0),children:r.data.content.trim()?os.edit:os.write}):void 0,children:[(0,j.jsx)(I,{of:r,children:i=>{let u=cs(i.content);return a?(0,j.jsxs)(`form`,{className:`stack`,style:{gap:12},onSubmit:n=>{n.preventDefault(),f(!1),p.run(()=>N(Yo(e,`brief`),{method:`PUT`,body:{content:ls(u,s),baseSha256:i.sha256}}).then(()=>{us.delete(e),o(!1),c({}),r.reload(),t?.(),m.current?.focus()}).catch(e=>{throw e instanceof M&&e.problem.status===409&&f(!0),e}),os.saved)},children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:os.intro}),l&&Object.keys(s).length>0&&(0,j.jsx)(`p`,{role:`status`,className:`work-say`,style:{margin:0},children:os.draftKept}),u.sections.map((e,t)=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`label`,{htmlFor:`${n}-${t}`,className:`hud`,style:{fontSize:11},children:e.heading}),(0,j.jsx)(`textarea`,{id:`${n}-${t}`,className:`field`,rows:Math.max(3,Math.min(10,(s[t]??e.text).split(`
|
|
30
|
+
`).length+1)),value:s[t]??e.text,...e.hint?{"aria-describedby":`${n}-${t}-hint`}:{},onChange:e=>c(n=>({...n,[t]:e.target.value})),spellCheck:!0,style:{width:`100%`}}),e.hint&&(0,j.jsx)(`span`,{id:`${n}-${t}-hint`,className:`muted`,style:{fontSize:12},children:e.hint})]},e.heading)),d&&(0,j.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:0},children:os.changed}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:p.busy,children:p.busy?os.saving:os.save}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>{us.delete(e),o(!1),c({})},children:os.cancel})]})]}):(0,j.jsxs)(`div`,{className:`stack`,style:{gap:10},children:[u.sections.length===0&&(0,j.jsx)(`div`,{className:`state`,children:os.empty}),u.sections.map(e=>(0,j.jsxs)(`section`,{"aria-label":e.heading,className:`stack`,style:{gap:2},children:[(0,j.jsx)(`h3`,{className:`hud`,style:{margin:0,fontSize:11},children:e.heading}),e.text?(0,j.jsx)(zn,{text:e.text}):(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:e.hint||os.empty})]},e.heading)),(0,j.jsxs)(`details`,{children:[(0,j.jsx)(`summary`,{className:`muted`,style:{fontSize:12},children:os.details}),(0,j.jsx)(`p`,{className:`mono muted`,style:{margin:`4px 0 0`,fontSize:11},children:os.file(i.path)})]})]})}}),(0,j.jsx)(Wn,{note:p.note})]})}function fs(e,t,n=()=>0,r=ps){let i,a=i=>{for(let[e,t]of i)t.every(e=>e.signal?.aborted)&&i.delete(e);for(let a of ms([...i.keys()],t,n,r)){let t=a.flatMap(e=>i.get(e)??[]),n=new AbortController,r=t.map(e=>e.signal),o=()=>{};if(r.every(e=>e)){let e=()=>{r.every(e=>e.aborted)&&n.abort()};for(let t of r)t.addEventListener(`abort`,e,{once:!0});o=()=>{for(let t of r)t.removeEventListener(`abort`,e)}}e(a,n.signal).finally(o).then(e=>{for(let t of a){let n=e.get(t);for(let e of i.get(t)??[])n===void 0?e.reject(new M({type:`about:blank`,title:`Not answered`,status:500})):n instanceof M?e.reject(n):e.resolve(n)}},e=>{for(let n of t)n.reject(e)})}};return(e,t)=>new Promise((n,r)=>{if(t?.aborted){r(t.reason??new DOMException(`Aborted`,`AbortError`));return}if(!i){let e=new Map;i=e,setTimeout(()=>{i=void 0,a(e)},0)}let o=()=>r(t.reason??new DOMException(`Aborted`,`AbortError`));t?.addEventListener(`abort`,o,{once:!0});let s=()=>t?.removeEventListener(`abort`,o),c=i.get(e)??[];c.push({resolve:e=>{s(),n(e)},reject:e=>{s(),r(e)},...t?{signal:t}:{}}),i.set(e,c)})}var ps=8192;function ms(e,t,n,r){let i=[],a=[],o=0;for(let s of e){let e=n(s);a.length&&(a.length>=t||o+e>r)&&(i.push(a),a=[],o=0),a.push(s),o+=e}return a.length&&i.push(a),i}var hs=e=>t=>e.length+2+encodeURIComponent(t).length,gs=e=>new M({type:`about:blank`,title:e.title,status:e.status,...e.detail?{detail:e.detail}:{}}),_s=fs(async(e,t)=>{let n=await N(`/api/facts?${e.map(e=>`repo=${encodeURIComponent(e)}`).join(`&`)}`,t?{signal:t}:{}),r=new Map;for(let t of e){let e=n.facts?.[t],i=n.problems?.[t];e?r.set(t,e):i&&r.set(t,gs(i))}return r},100,hs(`repo`)),vs=new Map;function ys(e,t){let n=/^(\/api\/changes\/[^/?]+\/artifacts\/[^/?]+)\?file=([^&]+)$/.exec(e);if(!n)return N(e,t?{signal:t}:{});let r=n[1],i=vs.get(r);return i||(i=fs(async(e,t)=>{let n=e.map(e=>`file=${encodeURIComponent(e)}`).join(`&`),i=await N(`${r}/files?${n}`,t?{signal:t}:{}),a=new Map;for(let e of i.files??[]){let{file:t,...n}=e;a.set(t,n)}for(let[e,t]of Object.entries(i.problems??{}))a.set(e,gs(t));return a},200,hs(`file`)),vs.set(r,i)),i(decodeURIComponent(n[2]),t)}var bs=w.runReady,xs=w.phase.taskState;function Ss(e){let t=e.ran.map(e=>e.refused===void 0?bs.ran(e.task,xs[e.state??``]??e.state??``):bs.refused(e.task,e.refused));return t.push(e.stopped?bs.stopped(e.stopped.task,e.stopped.why,e.left.join(`, `)):bs.allRan(e.ran.length)),t.join(`
|
|
31
|
+
`)}function Cs(e){let t=e.ready?.ready.length??0;return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,j.jsx)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`,alignItems:`center`},children:(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:e.busy||t===0||!!e.loading||!!e.error,"aria-busy":e.busy,"aria-describedby":`run-ready-why`,onClick:e.onRun,children:e.busy?bs.running:t?bs.buttonCount(t):bs.button})}),e.error?(0,j.jsx)(`p`,{id:`run-ready-why`,role:`alert`,style:{margin:0,fontSize:12},children:bs.cantRead(e.error)}):(0,j.jsx)(`p`,{id:`run-ready-why`,className:`muted`,style:{margin:0,fontSize:12},children:e.loading?bs.reading:e.ready&&t===0?bs.noneReady:bs.why}),(0,j.jsx)(Wn,{note:e.note})]})}function ws({change:e}){let t=P(`/api/changes/${encodeURIComponent(e)}/tasks/ready`);lt(t);let n=Qr(),[r,i]=(0,v.useState)(),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(),l=async e=>{try{let n=await N(`/api/jobs/${e}`);if(n.state===`running`||n.state===`queued`)return;i(void 0),c(n.result?{ok:!n.result.stopped,text:Ss(n.result)}:{ok:!1,text:n.errors.join(`
|
|
32
|
+
`)||bs.failed}),t.reload()}catch(e){i(void 0),c({ok:!1,text:e instanceof M?e.problem.detail??e.problem.title:String(e)})}};if(St(e=>{r&&(e.type===`job.progress`&&e.jobId===r&&c({ok:!0,working:!0,text:bs.progress(String(e.message??``))}),e.type===`job.done`&&e.jobId===r&&l(r))}),mt(r,e=>{e.state===`running`||e.state===`queued`?e.progress.message&&c({ok:!0,working:!0,text:bs.progress(e.progress.message)}):l(e.id)}),!n)return null;let u=async()=>{if(!(a||r)){o(!0),c({ok:!0,working:!0,text:w.app.working});try{let n=await N(`/api/changes/${encodeURIComponent(e)}/tasks/run-ready`,{method:`POST`,body:{tasks:t.state===`ready`?t.data.ready:[]}});i(n.jobId),l(n.jobId)}catch(e){c({ok:!1,text:e instanceof M?e.problem.detail??e.problem.title:String(e)})}finally{o(!1)}}};return(0,j.jsx)(Cs,{ready:t.state===`ready`?t.data:void 0,busy:!!r||a,loading:t.state===`loading`,error:t.state===`error`?t.error:void 0,note:s,onRun:()=>void u()})}var B=w.phase,Ts={blocking:`blocking`,gap:`warn`,risk:`warn`,idea:`dim`};function Es(e){let t=P(`/api/changes/${e.id}`),n=P(`/api/changes/${e.id}/status`),r=Vn(),i=Qr();(0,v.useEffect)(()=>{e.refresh&&(t.reload(),n.reload())},[e.refresh]),St(e=>{e.type===`file.changed`&&(t.reload(),n.reload())});let a=()=>{t.reload(),n.reload(),e.reload()},o=(0,j.jsx)(F,{title:e.title,kind:`hero`,meta:e.picker,children:(0,j.jsx)(I,{of:t,children:e=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:14},children:[(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`span`,{style:{fontSize:18,fontWeight:600},children:e.title}),(0,j.jsxs)(`span`,{className:`hud`,style:{fontSize:10},children:[e.id,` · `,e.type,e.handoff?Ia(e.handoff.pr)?B.handOffManual(e.handoff.phase):B.handOff(e.handoff.phase,e.handoff.state):``]})]}),(0,j.jsx)(Jo,{state:e.state})]})})}),s=(0,j.jsx)(F,{title:B.gate,kind:`dark`,children:(0,j.jsx)(I,{of:n,children:t=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:10},children:[(0,j.jsxs)(`p`,{style:{margin:0,lineHeight:1.5},children:[t.handoff&&Ia(t.handoff.pr.url)?(0,j.jsx)(Wa,{phase:t.handoff.phase}):Gr(t.nextStep,t.stepFirst,t.nextStepApp),t.stepFirst&&(0,j.jsxs)(j.Fragment,{children:[` `,(0,j.jsx)(Nt,{change:e.id})]})]}),t.blockers.length>0&&(0,j.jsx)(`ul`,{style:{margin:0,paddingLeft:18,fontSize:12.5,color:`var(--magenta-text)`},children:t.blockers.map((e,t)=>(0,j.jsx)(`li`,{children:e.message},t))}),t.handoff&&Ia(t.handoff.pr.url)?null:t.handoff?(0,j.jsxs)(`span`,{className:`muted`,style:{fontSize:12},children:[B.approvalMerge,(0,j.jsx)(Pt,{href:t.handoff.pr.url,children:B.pr(t.handoff.pr.number)}),` `,B.onTheGitHost]}):(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:B.approvalRaiseTheHand}),(0,j.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,gap:6},children:[e.critic&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:r.busy,onClick:()=>void r.run(()=>N(`/api/changes/${e.id}/critic`,{method:`POST`,body:{}}).then(e=>(a(),e)),e=>i?w.thread.criticRan(bo(e)):B.theRuleChecksRan2),children:i?B.runTheCritic:B.runTheRuleChecks}),(0,j.jsx)(Ds,{change:e.id,blockers:t.blockers.length,...t.stepFirst?{first:Gr(t.nextStep,!0,t.nextStepApp)}:{},onDone:a,act:r}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:r.busy,onClick:()=>void r.run(async()=>N(`/api/changes/${e.id}/sync`,{method:`POST`,body:await Jn(`merge`,e.id)}).then(a),B.syncedWithTheHand),children:B.syncAndMergeWhen})]}),(0,j.jsx)(Wn,{note:r.note})]})})});return e.part===`hero`?o:s}function Ds(e){let t=Vn(),n=e.act??t,r=(0,v.useId)(),i=e.blockers>0||!!e.first,a=(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:n.busy||i||e.held===!0,title:i?e.blockers>0?B.blockedBy(e.blockers):e.first:void 0,"aria-describedby":i?r:void 0,onClick:()=>void n.run(async()=>N(`/api/changes/${encodeURIComponent(e.change)}/handoff`,{method:`POST`,body:await Jn(`handoff`,e.change)}).then(t=>(e.onDone?.(),t),e=>{throw Error(Ur(nr(e)),{cause:e})}),e=>[B.handOffPrRaised,...e.notes??[]].join(` `)),children:B.raiseHandOff}),o=i&&(0,j.jsx)(`span`,{id:r,className:`muted`,style:{fontSize:12},children:e.blockers>0?B.blockedBy(e.blockers):e.first});return e.act?(0,j.jsxs)(j.Fragment,{children:[a,o]}):(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`div`,{children:a}),o,(0,j.jsx)(Wn,{note:n.note})]})}function Os(e,t){return e===`error`?!0:e?e.artifacts.some(e=>e.artifact===t):void 0}function ks({change:e,artifact:t,listed:n,span:r,file:i,title:a,onSaved:o}){let s=P(n?Yo(e,t,i):void 0,i?{load:ys}:{}),[c,l]=(0,v.useState)(!1),u=(0,v.useRef)(null),d=(0,v.useRef)(!1);if((0,v.useEffect)(()=>{!c&&d.current&&u.current?.focus(),d.current=c},[c]),c)return(0,j.jsx)(Qo,{change:e,artifact:t,...i?{file:i}:{},...o?{onSaved:o}:{},onClose:()=>{l(!1),s.reload()}});let f=a??t[0].toUpperCase()+t.slice(1);if(n===!1)return(0,j.jsx)(F,{title:f,span:r,children:(0,j.jsx)(`div`,{className:`state`,children:B.noSuchArtifact(t)})});let p=s.state===`error`&&(s.status===404||s.status===void 0&&/not found|no such|isn't there/i.test(s.error));return(0,j.jsx)(F,{title:f,span:r,meta:p?void 0:(0,j.jsx)(`button`,{ref:u,type:`button`,className:`btn`,onClick:()=>l(!0),children:B.edit}),children:p?(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,j.jsx)(`div`,{className:`state`,children:B.notWrittenYetFor}),(t===`proposal`||t===`specs`)&&(0,j.jsx)(zr,{command:`atticus change draft ${e}`})]}):(0,j.jsx)(I,{of:s,children:n=>n.content===``?(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,j.jsx)(`div`,{className:`state`,children:B.notWrittenYetEdit}),(t===`proposal`||t===`specs`)&&(0,j.jsx)(zr,{command:`atticus change draft ${e}`})]}):(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,j.jsx)(`div`,{tabIndex:0,role:`region`,"aria-label":B.text(t),style:{maxHeight:520,overflowY:`auto`,paddingRight:6},children:(0,j.jsx)(zn,{text:n.content})}),(0,j.jsxs)(`details`,{children:[(0,j.jsx)(`summary`,{className:`muted`,style:{fontSize:11.5},children:w.roleWork.passage.details}),(0,j.jsx)(`span`,{className:`mono muted`,style:{fontSize:11},children:n.path})]})]})})})}function As(e){return w.roleWork.lens[e]??e.replace(/-/g,` `)}function js({change:e,artifacts:t,span:n,rows:r,tick:i=0}){let a=P(`/api/findings?change=${e}&state=open`),[o,s]=(0,v.useState)(),c=Hn();St(e=>{(e.type===`file.changed`||e.type===`run.changed`)&&a.reload()}),(0,v.useEffect)(()=>{i&&a.reload()},[i]);let l=a.state===`ready`?a.data.filter(e=>t.some(t=>e.artifact.startsWith(t))):[];return(0,j.jsxs)(F,{title:B.criticFindings,span:n,...r?{rows:r}:{},meta:a.state===`ready`?B.open(l.length):void 0,children:[(0,j.jsx)(Un,{said:c.said}),(0,j.jsx)(I,{of:a,empty:()=>l.length===0,emptyText:B.noOpenFindingsOn,children:()=>(0,j.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0},className:`stack`,children:l.map(t=>(0,j.jsxs)(`li`,{style:{borderBottom:`1px solid var(--rule)`,paddingBottom:8},children:[(0,j.jsxs)(`button`,{type:`button`,"aria-expanded":o===t.id,onClick:()=>s(o===t.id?void 0:t.id),style:{all:`unset`,cursor:`pointer`,display:`flex`,flexDirection:`column`,gap:4,width:`100%`},children:[(0,j.jsxs)(`span`,{className:`row`,style:{gap:6,flexWrap:`wrap`},children:[(0,j.jsx)(`span`,{className:`chip ${Ts[t.severity]??``}`,children:t.severity.toUpperCase()}),t.lens&&(0,j.jsx)(`span`,{className:`chip ai`,children:As(t.lens)})]}),(0,j.jsx)(`span`,{style:{fontSize:13},children:t.summary})]}),o===t.id&&(0,j.jsxs)(`div`,{className:`stack`,style:{gap:8,marginTop:8},children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:t.why}),(0,j.jsxs)(`details`,{children:[(0,j.jsx)(`summary`,{className:`muted`,style:{fontSize:11.5},children:w.roleWork.passage.details}),(0,j.jsx)(`span`,{className:`mono muted`,style:{fontSize:10.5},children:t.artifact})]}),t.question&&(0,j.jsx)(`p`,{style:{margin:0,fontSize:12.5},children:B.question(t.question.owner?B.for(t.question.owner):``,t.question.text)}),(0,j.jsx)(ts,{change:e,f:t,done:()=>a.reload(),say:c.say})]})]},t.id))})})]})}function Ms(){return(0,j.jsx)(`div`,{className:`bento`,children:(0,j.jsx)(gc,{})})}function Ns(e){let t=Fn(e.hash,e.screen),[n,r]=(0,v.useState)(0),[i,a]=(0,v.useState)(0),o=P(t.id?`/api/changes/${t.id}`:void 0),s=o.state===`ready`?o.data:o.state===`error`?`error`:void 0;if(t.none)return(0,j.jsx)(Ms,{});if(!t.id)return(0,j.jsx)(In,{list:t.list,title:e.title});let c={id:t.id,title:e.title,picker:t.picker,...e.critic?{critic:e.critic}:{},reload:()=>r(n+1),refresh:i};return(0,j.jsxs)(`div`,{className:`bento`,children:[(0,j.jsxs)(`div`,{className:`column`,style:{gridColumn:`span 8`},children:[(0,j.jsx)(Es,{part:`hero`,...c}),e.main?.(t.id),e.artifacts.map(e=>e===`brief`&&Os(s,e)!==!1?(0,j.jsx)(ds,{change:t.id,onSaved:()=>{a(e=>e+1),o.reload()}},e):(0,j.jsx)(ks,{change:t.id,artifact:e,listed:Os(s,e),onSaved:()=>{a(e=>e+1),o.reload()}},e))]}),(0,j.jsxs)(`div`,{className:`column`,style:{gridColumn:`span 4`},children:[(0,j.jsx)(Es,{part:`gate`,...c}),(0,j.jsx)(js,{change:t.id,artifacts:e.artifacts,tick:n}),e.extra?.(t.id)]})]},t.id)}function Ps({hash:e}){return(0,j.jsx)(Ns,{hash:e,screen:`brief`,title:B.featureBrief,artifacts:[`brief`,`proposal`],critic:`business-critic`})}function Fs({hash:e}){return(0,j.jsx)(Ns,{hash:e,screen:`ux`,title:B.prototypesAndUx,artifacts:[`ux`],critic:`ux-critic`,extra:e=>(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(F,{title:B.bringInAPrototype,span:`span 4`,children:(0,j.jsxs)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5,lineHeight:1.6},children:[B.attachADesignExport,(0,j.jsx)(`span`,{className:`mono`,children:B.inputs}),B.screenAtticusReadsThe]})}),(0,j.jsx)(po,{change:e}),(0,j.jsx)(yo,{change:e})]})})}function Is({open:e,codeYet:t}){return e.length===0&&!t?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`span`,{className:`chip dim`,style:{width:`fit-content`},children:B.noCodeYet}),(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:B.noCodeYetWhy})]}):e.length===0?(0,j.jsx)(`span`,{className:`chip done`,style:{width:`fit-content`},children:B.inSync}):(0,j.jsx)(`ul`,{style:{margin:0,paddingLeft:18,lineHeight:1.6,fontSize:12.5},children:e.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`span`,{className:`chip ${Ts[e.severity]??``}`,children:e.severity.toUpperCase()}),` `,e.summary]},e.id))})}function Ls({change:e}){let t=Mn(`drift`,e),n=P(`/api/changes/${encodeURIComponent(e)}/tasks`),r=n.state!==`ready`||n.data.some(e=>e.done||e.taskRun!==void 0);return(0,j.jsx)(F,{title:B.designVsPlansVs,span:`span 4`,children:(0,j.jsx)(I,{of:n.state===`loading`?{state:`loading`}:t,children:e=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:e.plans.length?B.repoPlansCompared(e.plans.length):B.noRepoPlansYet}),(0,j.jsx)(Is,{open:e.findings.filter(e=>e.state===`open`),codeYet:r})]})})})}function Rs({hash:e}){let t=P(`/api/orgpack`);return(0,j.jsx)(Ns,{hash:e,screen:`arch-review`,title:B.architectureReview,artifacts:[`design`,`interfaces`],critic:`architecture-critic`,extra:e=>(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(Ls,{change:e}),(0,j.jsx)(F,{title:B.integrationPatterns,span:`span 4`,meta:(0,j.jsx)(`a`,{href:`#/orgpack`,children:B.orgPack}),children:(0,j.jsx)(I,{of:t,empty:e=>!e.patterns?.length,emptyText:B.theOrgPackHas,children:e=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[e.patterns.map(e=>(0,j.jsxs)(`div`,{className:`list-row`,children:[(0,j.jsx)(`span`,{className:`chip`,children:e.code}),(0,j.jsx)(`span`,{style:{fontSize:12.5},children:e.name})]},e.code)),(0,j.jsx)(`p`,{className:`muted`,style:{margin:`6px 0 0`,fontSize:11.5},children:B.everyHopInDesign})]})})}),(0,j.jsx)(F,{title:B.yourMaterial,span:`span 4`,children:(0,j.jsxs)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5,lineHeight:1.6},children:[B.vendorSpecsWhiteboardPhotos,(0,j.jsx)(`a`,{href:`#/intake`,children:B.intake}),B.diagramsAreComparedEdge,(0,j.jsx)(`a`,{href:`#/reconcile`,children:B.reconcile}),B.ingestedContentIsData]})})]})})}function zs(e){if(!e)return;if(e===`mappings.md`)return B.readFromMappingsFile;let t=e.replace(/^target-flows\//,``).replace(/\.yaml$/,``);return B.readFromTargetFlow(t)}function Bs({change:e}){let t=P(`/api/changes/${encodeURIComponent(e)}/mappings`);return(0,j.jsx)(F,{title:B.fieldMappings,meta:B.byHopWithThe,children:(0,j.jsx)(I,{of:t,empty:e=>e.hops.length===0,emptyText:B.noHopsInMappings,children:e=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:14},children:[e.hops.map(e=>(0,j.jsxs)(`section`,{"aria-label":e.heading,className:`stack`,style:{gap:6},children:[(0,j.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`,gap:6},children:[(0,j.jsx)(`h3`,{className:`mono`,style:{margin:0,fontSize:13},children:e.heading}),e.noChange?(0,j.jsx)(`span`,{className:`chip`,children:B.noMappingChange}):(0,j.jsx)(`span`,{className:`chip`,children:B.fields(e.rows.length)})]}),zs(e.from)&&(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:zs(e.from)}),e.note&&(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:e.note}),e.rows.length>0&&(0,j.jsx)(Gn,{rows:e.rows,rowKey:e=>String(e.line),caption:B.fieldMappingsFor(e.heading),cols:[{label:B.sourceField,cell:e=>e.source,mono:!0},{label:B.targetField,cell:e=>e.target,mono:!0},{label:B.rule,cell:e=>e.rule},{label:B.whenMissingOrInvalid,cell:e=>e.whenMissing}]}),!e.noChange&&e.rows.length===0&&(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:B.noFieldRowsYet}),e.asIs.length>0&&(0,j.jsxs)(`details`,{children:[(0,j.jsx)(`summary`,{className:`hud`,style:{fontSize:10,cursor:`pointer`},children:B.mappedTodayInThe(e.asIs.length)}),(0,j.jsx)(Gn,{rows:e.asIs,rowKey:e=>e.id,caption:B.catalogFieldMappingsFor(e.heading),cols:[{label:B.sourceField,cell:e=>e.source,mono:!0},{label:B.targetField,cell:e=>e.target,mono:!0},{label:B.transform,cell:e=>e.transform??``},{label:B.record,cell:e=>e.id,mono:!0}]})]})]},`${e.from??``}#${e.line}`)),e.catalogMappings===0&&(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:B.theCatalogHasNo})]})})})}function Vs({hash:e}){return(0,j.jsx)(Ns,{hash:e,screen:`mappings`,title:B.apiMappings,artifacts:[`mappings`],critic:`architecture-critic`,main:e=>(0,j.jsx)(Bs,{change:e}),extra:()=>(0,j.jsx)(F,{title:B.howMappingsAreChecked,span:`span 4`,children:(0,j.jsxs)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5,lineHeight:1.6},children:[B.eachHopsSourceField,(0,j.jsx)(`a`,{href:`#/trace`,children:B.testTrace}),`.`]})})})}function Hs({change:e}){let t=Mn(`story-bar`,e);return(0,j.jsx)(F,{title:B.storyBar,span:`span 4`,kind:`dark`,children:(0,j.jsx)(I,{of:t,empty:e=>!e||e.stories.length===0,emptyText:B.noStoriesYetWrite,children:e=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:10},children:[(0,j.jsxs)(`div`,{className:`row`,children:[(0,j.jsx)(It,{value:e.ready.passed,max:Math.max(e.ready.total,1),size:64,label:B.ofStoriesReady(e.ready.passed,e.ready.total)}),(0,j.jsx)(`span`,{className:`chip ${e.met?`done`:`warn`}`,children:e.met?B.barMet:B.needs(Math.round(e.ready.min*100))})]}),e.stories.filter(e=>!e.ready).map(e=>(0,j.jsxs)(`div`,{style:{fontSize:12.5},children:[(0,j.jsx)(`span`,{className:`mono`,children:e.id}),`: `,e.problems.join(`; `)]},e.id)),e.gaps.filter(e=>!e.covered).map(e=>(0,j.jsx)(`div`,{style:{fontSize:12.5,color:`var(--amber-text)`},children:B.noStoryCovers(e.what)},e.id))]})})})}function Us({change:e}){let t=P(`/api/changes/${encodeURIComponent(e)}/stages/stories`),n=`#/stories?change=${encodeURIComponent(e)}`,r=t.state===`ready`&&t.data.loop.state===`done`;return(0,j.jsx)(F,{title:B.storiesAndTasks,span:`span 4`,children:(0,j.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:r?B.storiesStageDone:B.storiesAtTheStage}),(0,j.jsx)(`p`,{style:{margin:0},children:(0,j.jsx)(`a`,{className:r?void 0:`btn primary`,href:n,children:B.openStoriesStage})})]})})}function Ws({change:e,listed:t}){let n=Mn(`story-bar`,e,t===!1),r=w.work;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(ks,{change:e,artifact:`stories`,listed:t,span:`1 / -1`,title:r.storiesIndex}),t!==!1&&(0,j.jsx)(I,{of:n,empty:e=>!e||e.stories.length===0,emptyContent:(0,j.jsx)(`div`,{className:`state`,children:r.noStoryFiles}),children:n=>(0,j.jsx)(j.Fragment,{children:n.stories.map(n=>(0,j.jsx)(ks,{change:e,artifact:`stories`,listed:t,file:n.path,span:`1 / -1`,title:r.storyFile(n.id)},n.path))})})]})}function Gs({hash:e}){return(0,j.jsx)(Ns,{hash:e,screen:`breakdown`,title:B.breakdown,artifacts:[`stories`,`tasks`],critic:`story-critic`,extra:e=>(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(Hs,{change:e}),(0,j.jsx)(Us,{change:e}),(0,j.jsx)(Xs,{change:e,span:`span 4`,compact:!0})]})})}var Ks=e=>`task-row-${e.replace(/[^A-Za-z0-9_-]/g,`-`)}`;function qs(e){if(e.done||!e.waits?.tasks.length)return;let t=new Set(e.waits.sameRepo);return B.waitsForTasks(e.waits.tasks.map(e=>t.has(e)?B.sameRepo(e):e).join(`, `))}function Js(e,t){let n=new Map(t.map(e=>[e.id,JSON.stringify(e)])),r=new Set;for(let t of e)n.get(t.id)!==JSON.stringify(t)&&r.add(t.id);return r}function Ys(e,t){return Object.keys(e).some(e=>t.has(e))?Object.fromEntries(Object.entries(e).filter(([e])=>!t.has(e))):e}function Xs({change:e,span:t,compact:n,focus:r}){let i=P(`/api/changes/${e}/tasks`),a=Qr(),o=(0,v.useRef)(void 0);(0,v.useEffect)(()=>{if(!r||i.state!==`ready`||o.current===r)return;let e=document.getElementById(Ks(r));e&&(o.current=r,e.scrollIntoView({block:`center`}),e.focus({preventScroll:!0}))},[r,i.state]);let[s,c]=(0,v.useState)({}),[l,u]=(0,v.useState)({}),[d,f]=(0,v.useState)({});St(e=>{(e.type===`run.changed`||e.type===`file.changed`)&&i.reload()});let p=i.state===`ready`?i.data:void 0,m=(0,v.useRef)(void 0);(0,v.useEffect)(()=>{if(!p)return;let e=m.current;if(m.current=p,!e)return;let t=Js(e,p);t.size!==0&&(c(e=>Ys(e,t)),u(e=>Ys(e,t)))},[p]);let h=(e,t)=>c(n=>({...n,[e]:t})),g=async t=>{f(e=>({...e,[t.id]:!0})),h(t.id,w.app.working);try{let n=await N(`/api/changes/${e}/runs`,{method:`POST`,body:{agent:`task-runner`,task:t.id,runtime:`hand-off`}});h(t.id,B.runPrepared(n.runId)),u(e=>({...e,[t.id]:n.runId}))}catch(e){h(t.id,e instanceof M?e.problem.detail??e.problem.title:String(e))}finally{f(e=>({...e,[t.id]:!1}))}};return(0,j.jsx)(F,{title:n?B.handDownPreview:B.tasksByRepo,span:t,meta:i.state===`ready`?B.tasks(i.data.length):void 0,children:(0,j.jsx)(I,{of:i,empty:e=>e.length===0,emptyText:B.noTasksYetThey,children:t=>{let o=[...new Set(t.map(e=>e.repo))].sort();return(0,j.jsx)(`div`,{className:`stack`,style:{gap:12},children:o.map(o=>{let c=t.filter(e=>e.repo===o),u=c.filter(e=>e.done).length;return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,j.jsxs)(`div`,{className:`row between`,children:[(0,j.jsx)(`span`,{className:`mono`,style:{fontSize:12.5},children:o}),(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:B.done(u,c.length)})]}),(0,j.jsx)(Rt,{value:u,max:c.length,label:B.ofTasksDone(o,u,c.length)}),!n&&c.map(t=>(0,j.jsxs)(`div`,{id:Ks(t.id),tabIndex:t.id===r?-1:void 0,"aria-current":t.id===r?`true`:void 0,className:`stack`,style:{gap:4,padding:`6px 0 6px 10px`,borderLeft:`2px solid ${t.done?`var(--green)`:t.id===r?`var(--accent)`:`var(--line-2)`}`},children:[(0,j.jsxs)(`div`,{className:`row between`,style:{alignItems:`flex-start`},children:[(0,j.jsxs)(`span`,{style:{fontSize:13},children:[(0,j.jsx)(`span`,{className:`mono muted`,children:t.id}),` `,t.description]}),t.done?(0,j.jsx)(`span`,{className:`chip done`,children:B.done2}):Ba(t)?a?(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:d[t.id],onClick:()=>void g(t),children:t.taskRun?B.runAgainWithAi:B.runWithAi}):(0,j.jsx)(`span`,{className:`chip dim`,title:$r,children:B.byHand}):null]}),(0,j.jsxs)(`span`,{className:`mono muted`,style:{fontSize:10.5},children:[t.branch,t.story?B.story(t.story):``]}),!s[t.id]&&(0,j.jsx)(Xa,{change:e,task:t,onDone:i.reload}),qs(t)&&(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:qs(t)}),(0,j.jsx)(Ya,{change:e,task:t,onDone:i.reload}),s[t.id]&&(0,j.jsxs)(`span`,{role:`status`,style:{fontSize:12},children:[s[t.id],` `,l[t.id]&&(0,j.jsx)(`a`,{href:`#/runs?run=${encodeURIComponent(l[t.id])}`,children:B.openTheRun})]})]},t.id))]},o)})})}})})}function Zs({change:e}){let t=P(`/api/changes/${e}/runs`),n=P(`/api/changes/${encodeURIComponent(e)}/tasks`);St(e=>{(e.type===`run.changed`||e.type===`file.changed`)&&(t.reload(),n.reload())});let r=t.state===`ready`?Va(t.data,n.state===`ready`?n.data:void 0):[],i=r.filter(e=>e.state===`validated`).length;return(0,j.jsx)(F,{title:B.aiTaskRuns,span:`span 4`,kind:`dark`,children:(0,j.jsx)(I,{of:t,empty:()=>r.length===0,emptyText:B.noTaskRunsYet,children:()=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,j.jsxs)(`div`,{className:`row`,children:[(0,j.jsx)(It,{value:i,max:r.length,size:60,label:B.ofRunsFinished(i,r.length)}),(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:B.everyWriteIsApproved})]}),r.slice(-8).map(e=>(0,j.jsxs)(`div`,{className:`list-row`,children:[(0,j.jsxs)(`span`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`a`,{className:`mono`,style:{fontSize:11.5},href:`#/runs?run=${encodeURIComponent(e.runId)}`,children:e.runId}),(0,j.jsxs)(`span`,{className:`hud`,style:{fontSize:9.5},children:[e.agent,` · `,e.runtime]})]}),(0,j.jsx)(`span`,{className:`chip ${e.errors.length?`blocking`:e.state===`validated`?`done`:e.state===`failed`?`blocking`:``}`,children:e.state.toUpperCase()})]},e.runId))]})})})}function Qs({hash:e}){let t=Fn(e,`tasks`);return t.none?(0,j.jsx)(Ms,{}):t.id?(0,j.jsxs)(`div`,{className:`bento`,children:[(0,j.jsxs)(F,{title:B.taskBoard,span:`1 / -1`,meta:t.picker,children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:B.tasksInCrossRepo}),(0,j.jsx)(ws,{change:t.id})]}),(0,j.jsx)(Xs,{change:t.id,span:`span 8`,focus:Nn(e,`task`)}),(0,j.jsxs)(`div`,{className:`stack`,style:{gridColumn:`span 4`,gap:16},children:[(0,j.jsx)(Zs,{change:t.id}),(0,j.jsx)(Ls,{change:t.id})]})]},t.id):(0,j.jsx)(In,{list:t.list,title:B.taskBoard})}function $s({hash:e}){let t=Fn(e,`trace`),n=Mn(`trace`,t.id,!t.id),r=P(t.id?`/api/changes/${t.id}/status`:void 0);if(t.none)return(0,j.jsx)(Ms,{});if(!t.id)return(0,j.jsx)(In,{list:t.list,title:B.testTrace});let i=n.state===`ready`?n.data.rows.filter(e=>e.tests.length>0).length:0,a=n.state===`ready`?n.data.rows.length:0;return(0,j.jsxs)(`div`,{className:`bento`,children:[(0,j.jsxs)(`div`,{className:`column`,style:{gridColumn:`span 8`},children:[(0,j.jsxs)(F,{title:B.testTrace,kind:`hero`,meta:t.picker,children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:`0 0 12px`,fontSize:12.5},children:B.everyRequirementShouldReach}),(0,j.jsx)(I,{of:n,empty:e=>e.rows.length===0,emptyText:B.nothingToTraceYet,children:e=>(0,j.jsx)(Gn,{caption:B.requirementToCode,rows:e.rows,rowKey:e=>`${e.requirement?.key??``}/${e.story??``}/${e.criterion?.n??``}`,cols:[{label:B.requirement,cell:e=>e.requirement?(0,j.jsxs)(`span`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`span`,{children:e.requirement.requirement}),e.requirement.scenario&&(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:11.5},children:e.requirement.scenario})]}):(0,j.jsxs)(`span`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`span`,{className:`chip warn`,style:{width:`fit-content`},children:B.noRequirement}),e.criterion&&(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:11.5},children:e.criterion.text})]})},{label:B.story2,cell:e=>e.story??(0,j.jsx)(`span`,{className:`chip warn`,children:B.noStory}),mono:!0},{label:B.test,cell:e=>e.tests.length?e.tests.join(`, `):(0,j.jsx)(`span`,{className:`chip blocking`,children:B.noTest}),mono:!0},{label:B.code,cell:e=>e.code.slice(0,3).join(`, `),mono:!0}]})})]}),(0,j.jsx)(F,{title:B.gapsBeforeQaSign,meta:n.state===`ready`?n.data.gaps.length:void 0,children:(0,j.jsx)(I,{of:n,empty:e=>e.gaps.length===0,emptyText:B.noGapsEveryRequirement,children:e=>(0,j.jsx)(Gn,{caption:B.traceGaps,rows:e.gaps,rowKey:e=>`${e.kind}/${e.subject}`,cols:[{label:B.gap,cell:e=>(0,j.jsx)(`span`,{className:`chip warn`,children:e.kind}),width:`190px`},{label:B.what,cell:e=>e.summary}]})})})]}),(0,j.jsxs)(`div`,{className:`column`,style:{gridColumn:`span 4`},children:[(0,j.jsx)(F,{title:B.scenarioCoverage,kind:`dark`,children:(0,j.jsx)(I,{of:n,children:e=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:10},children:[(0,j.jsxs)(`div`,{className:`row`,children:[(0,j.jsx)(It,{value:i,max:Math.max(a,1),size:72,label:B.ofRowsHaveA(i,a),text:a?`${Math.round(i/a*100)}%`:`–`}),(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12.5},children:B.ofTracedToA(i,a)})]}),(0,j.jsx)(Lt,{title:B.gapsByKind,parts:[...new Set(e.gaps.map(e=>e.kind))].map((t,n)=>({label:t,value:e.gaps.filter(e=>e.kind===t).length,color:[`var(--amber)`,`var(--magenta)`,`var(--violet)`,`var(--accent)`][n%4]}))})]})})}),(0,j.jsxs)(F,{title:B.testKindsThisChange,children:[(0,j.jsx)(I,{of:r,empty:e=>!e.tests?.required?.length,emptyText:B.theTestStrategyAsks,children:e=>(0,j.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,gap:6},children:[e.tests.required.map(e=>(0,j.jsx)(`span`,{className:`chip`,children:String(e).toUpperCase()},String(e))),e.tests.note&&(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:e.tests.note})]})}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:`10px 0 0`,fontSize:11.5},children:B.requiredKindsComeFrom})]})]})]})}var ec=w.runNext,tc=w.cockpit,nc=(e,t)=>`#/${e}${t?`?change=${encodeURIComponent(t)}`:``}`;function rc({change:e}){let t=P(`/api/changes/${encodeURIComponent(e)}/status`);lt(t);let n=t.state===`ready`?t.data.blockers:[];return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[t.state===`loading`?(0,j.jsx)(`p`,{className:`muted`,role:`status`,style:{margin:0},children:tc.raiseChecking}):n.length>0?(0,j.jsxs)(`div`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:tc.raiseHeld(n.length)}),(0,j.jsx)(`ul`,{style:{margin:0,paddingLeft:18,fontSize:12.5},children:n.map((e,t)=>(0,j.jsx)(`li`,{children:e.message},`${t}:${e.message}`))})]}):(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:tc.raiseHere}),(0,j.jsx)(Ds,{change:e,blockers:n.length,held:t.state===`loading`,onDone:t.reload})]})}function ic(e){return e.kind===`handoff`||e.kind===`task`||e.kind===`release`||e.kind===`findings`||e.kind===`gap`?!!e.change:e.kind===`merge`?!!e.pr:!!e.kind||ul(e.command)!==void 0}function ac(e){let t=(e,t)=>(0,j.jsx)(`p`,{style:{margin:0},children:(0,j.jsx)(`a`,{className:`btn primary`,href:e,children:t})});switch(e.kind){case`new-change`:return(0,j.jsx)(br,{});case`handoff`:return e.change?(0,j.jsx)(rc,{change:e.change}):null;case`task`:return e.change?(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:ec.taskOnBoard}),t(nc(`tasks`,e.change),ec.openTaskBoard)]}):null;case`brief`:return t(nc(`brief`,e.change),ec.writeBrief);case`answer`:return t(nc(`questions`,e.change),ec.answerOnQuestions);case`release`:return e.change?t(`#/release/${encodeURIComponent(e.change)}`,ec.openRelease):null;case`findings`:return e.change?(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:ec.resolveFindingsSay}),t(`#/changes/${encodeURIComponent(e.change)}`,ec.resolveFindings)]}):null;case`gap`:return e.change?(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:ec.answerGapSay}),t(`#/changes/${encodeURIComponent(e.change)}`,ec.answerGap)]}):null;case`merge`:return e.pr?Ia(e.pr)?(0,j.jsx)(`p`,{style:{margin:0},children:(0,j.jsx)(Ua,{})}):(0,j.jsx)(`p`,{style:{margin:0},children:(0,j.jsx)(Pt,{href:e.pr,children:ec.openPr})}):null;default:return(0,j.jsx)(fl,{command:e.command})}}var oc=w.runNext;function sc({text:e,label:t,noRun:n,scope:r}){let i=(0,j.jsxs)(`div`,{className:`work-cmd`,children:[(0,j.jsx)(`code`,{className:`mono`,children:e}),(0,j.jsx)(sr,{text:e,label:`${t}: ${e}`})]}),a=n?void 0:ul(e);return a?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(dl,{step:a,...r?{scope:r}:{}}),(0,j.jsxs)(`details`,{className:`work-terminal`,children:[(0,j.jsx)(`summary`,{children:w.appStep.inTerminal}),i]})]}):i}function cc({command:e,slash:t}){return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(zr,{command:e}),t&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`work-say`,children:oc.slash}),(0,j.jsx)(sc,{text:t,label:oc.copySlash,noRun:!0})]}),(0,j.jsxs)(`details`,{className:`work-terminal`,children:[(0,j.jsx)(`summary`,{children:oc.orTerminal}),(0,j.jsx)(`p`,{className:`work-say`,children:oc.terminal}),(0,j.jsx)(sc,{text:e,label:oc.copy,noRun:!0})]})]})}function lc({slash:e}){return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`work-say`,children:e.where===w.work.slashWhere.metarepo?oc.slash:oc.slashIn(e.where)}),(0,j.jsx)(sc,{text:e.command,label:oc.copySlash})]})}function uc({step:e}){let t=ic(e),n=e.link&&(0,j.jsx)(`p`,{style:{margin:0},children:(0,j.jsx)(`a`,{className:t?void 0:`btn primary`,href:e.link.href,children:e.link.label})}),r=t||!!e.link;return(0,j.jsxs)(`section`,{className:`panel hero work-next`,"aria-labelledby":`run-next`,children:[(0,j.jsx)(`h2`,{id:`run-next`,className:`h`,children:oc.title}),(0,j.jsx)(`p`,{className:`work-why`,children:e.why}),e.aside&&(0,j.jsxs)(`p`,{className:`work-say`,children:[e.aside.text,` `,(0,j.jsx)(`a`,{href:e.aside.link.href,children:e.aside.link.label})]}),r?(0,j.jsxs)(j.Fragment,{children:[t&&(0,j.jsx)(ac,{...e}),n,e.slash&&(0,j.jsx)(lc,{slash:e.slash}),(0,j.jsxs)(`details`,{className:`work-terminal`,children:[(0,j.jsx)(`summary`,{children:oc.orTerminal}),(0,j.jsx)(`p`,{className:`work-say`,children:oc.terminal}),(0,j.jsx)(sc,{text:e.command,label:oc.copy,noRun:!0})]})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`work-say`,children:oc.terminal}),(0,j.jsx)(sc,{text:e.command,label:oc.copy}),e.slash?(0,j.jsx)(lc,{slash:e.slash}):(0,j.jsx)(`p`,{className:`work-say`,children:oc.noSlash})]}),(0,j.jsx)(`p`,{className:`work-say`,children:oc.whatNext}),e.after&&e.after.length>0&&(0,j.jsxs)(`details`,{className:`work-after`,children:[(0,j.jsx)(`summary`,{children:oc.after}),(0,j.jsx)(`ol`,{children:e.after.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`p`,{className:`work-say`,children:e.why}),(0,j.jsx)(sc,{text:e.command,label:oc.copy}),e.slash&&(0,j.jsx)(lc,{slash:e.slash})]},e.command))})]})]})}function dc({step:e}){let t=ic(e),n=t||!!e.link;return(0,j.jsxs)(`div`,{className:`hm-step`,children:[(0,j.jsx)(`p`,{className:`hm-step-why`,children:e.why}),e.aside&&(0,j.jsxs)(`p`,{className:`hm-step-aside`,children:[e.aside.text,` `,(0,j.jsx)(`a`,{href:e.aside.link.href,children:e.aside.link.label})]}),n?(0,j.jsxs)(`div`,{className:`hm-step-act`,children:[t&&(0,j.jsx)(ac,{...e}),e.link&&(0,j.jsx)(`a`,{className:t?`btn`:`btn primary`,href:e.link.href,children:e.link.label})]}):(0,j.jsx)(sc,{text:e.command,label:oc.copy}),(0,j.jsxs)(`details`,{className:`work-terminal`,children:[(0,j.jsx)(`summary`,{children:oc.orTerminal}),n&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`work-say`,children:oc.terminal}),(0,j.jsx)(sc,{text:e.command,label:oc.copy,noRun:!0})]}),e.slash?(0,j.jsx)(lc,{slash:e.slash}):!n&&(0,j.jsx)(`p`,{className:`work-say`,children:oc.noSlash}),(0,j.jsx)(`p`,{className:`work-say`,children:oc.whatNext}),e.after&&e.after.length>0&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`work-say`,children:oc.after}),(0,j.jsx)(`ol`,{children:e.after.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`p`,{className:`work-say`,children:e.why}),(0,j.jsx)(sc,{text:e.command,label:oc.copy}),e.slash&&(0,j.jsx)(lc,{slash:e.slash})]},e.command))})]})]})]})}function fc({of:e,step:t}){return(0,j.jsx)(I,{of:e,children:e=>(0,j.jsx)(uc,{step:t(e)})})}function pc({bare:e=!1}){let t=w.work,n=(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`work-why`,children:t.pickAChange}),(0,j.jsx)(`p`,{className:`work-say`,children:(0,j.jsx)(`a`,{href:`#/changes`,children:t.openAllChanges})})]});return e?(0,j.jsx)(`div`,{className:`state`,children:n}):(0,j.jsxs)(`section`,{className:`panel`,"aria-labelledby":`pick-a-change`,style:{gridColumn:`1 / -1`},children:[(0,j.jsx)(`h2`,{id:`pick-a-change`,className:`h`,children:t.pickAChangeTitle}),n]})}var mc=(e,t)=>t??(e>0?w.work.noChangeReads:w.work.noChangeTitle),hc=e=>e>0?w.work.noChangeReadsBody:w.work.noChangeYet;function gc({title:e}){let t=w.work,n=P(zo);lt(n);let r=(0,v.useId)();return(0,j.jsxs)(`section`,{className:`panel`,"aria-labelledby":r,style:{gridColumn:`1 / -1`},children:[(0,j.jsx)(`h2`,{id:r,className:`h`,children:mc(n.state===`ready`?n.data.length:0,e)}),(0,j.jsx)(`p`,{className:`work-why`,children:hc(n.state===`ready`?n.data.length:0)}),(0,j.jsx)(Vo,{of:n}),(0,j.jsx)(br,{}),(0,j.jsxs)(`details`,{className:`work-terminal`,children:[(0,j.jsx)(`summary`,{children:oc.orTerminal}),(0,j.jsx)(`p`,{className:`work-say`,children:oc.terminal}),(0,j.jsx)(sc,{text:t.noChangeCommand,label:oc.copy})]}),(0,j.jsx)(`p`,{className:`work-say`,children:(0,j.jsx)(`a`,{href:`#/changes`,children:t.noChangeLink})})]})}function _c({list:e}){return e.length===0?null:(0,j.jsxs)(`div`,{className:`state error`,role:`alert`,children:[w.work.unreadable,(0,j.jsx)(`ul`,{children:e.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`code`,{className:`mono`,children:e.file}),`: `,e.message]},`${e.file}:${e.message}`))})]})}var V=w.catalogBuild,vc=e=>e&&/^[0-9a-f]{8,}$/.test(e)?e.slice(0,7):e??``,yc=e=>e.replace(`T`,` `).replace(/\.\d+Z$|Z$/,` UTC`);function bc(e){return e instanceof Zn?e.lines.join(` `)||e.message:e instanceof M?e.problem.detail??e.message:e instanceof Error?e.message:String(e)}function xc(e){let[t,n]=(0,v.useState)(``),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(),s=(0,v.useRef)(null),c=(0,v.useRef)(null),l=(0,v.useRef)(null),u=(0,v.useRef)(null),d=(0,v.useId)(),f=(0,v.useId)(),p=(0,v.useId)();(0,v.useEffect)(()=>{if(typeof document>`u`)return;let e=document.activeElement;return s.current?.querySelector(`[data-first-focus]`)?.focus(),()=>{e?.isConnected&&e.focus()}},[]);let m=e.count===void 0||t.trim()===String(e.count),h=async()=>{if(!m)o(V.countWrong(e.count));else{i(!0),o(void 0);try{await e.onConfirm()}catch(e){o(V.failed(bc(e))),i(!1)}}};return(0,j.jsx)(`div`,{className:`run-dialog-back`,children:(0,j.jsxs)(`div`,{ref:s,className:`run-dialog panel cb-dialog cb`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":d,"aria-describedby":f,onKeyDown:t=>{if(t.key===`Escape`&&!r&&(t.preventDefault(),t.stopPropagation(),e.onClose()),t.key===`Tab`&&s.current){let e=[...s.current.querySelectorAll(`button:not([disabled]), input:not([disabled]), [tabindex='0']`)];if(!e.length)return;let n=e[0],r=e[e.length-1];t.shiftKey&&document.activeElement===n?(t.preventDefault(),r.focus()):!t.shiftKey&&document.activeElement===r&&(t.preventDefault(),n.focus())}},children:[(0,j.jsx)(`h2`,{id:d,className:`h`,style:{marginTop:0,fontSize:16},children:e.title}),(0,j.jsx)(`p`,{id:f,children:e.intro}),(0,j.jsx)(`div`,{tabIndex:0,className:`stack cb-dialog-list`,style:{gap:6},"aria-label":e.title,children:e.children}),e.count!==void 0&&(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4,marginTop:10},children:[(0,j.jsx)(`label`,{htmlFor:p,children:V.typeCount(e.count)}),(0,j.jsx)(`input`,{id:p,ref:c,"data-first-focus":!0,className:`field cb-count`,style:{width:`10em`,maxWidth:`100%`},inputMode:`numeric`,autoComplete:`off`,value:t,"aria-describedby":`${p}-hint`,onChange:e=>n(e.target.value),onKeyDown:e=>{e.key===`Enter`&&h()}}),(0,j.jsx)(`span`,{id:`${p}-hint`,className:`work-say`,children:V.countHint})]}),a&&(0,j.jsx)(`p`,{className:`state error`,role:`alert`,children:a}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,justifyContent:`flex-end`,marginTop:10},children:[(0,j.jsx)(`button`,{ref:u,...e.count===void 0?{"data-first-focus":!0}:{},type:`button`,className:`btn`,onClick:e.onClose,disabled:r,children:V.cancel}),(0,j.jsx)(`button`,{ref:l,type:`button`,className:`btn primary`,disabled:r||!m,"aria-busy":r,onClick:()=>void h(),children:r?e.working??V.building:e.confirm})]})]})})}function Sc(e){let t=e.inputs??[];return[...t.map(e=>(V.input[e.what]??V.input.other)(e.path)),...e.explainedBy.filter(e=>!t.length||!/^an input changed \(/.test(e))]}function Cc({text:e}){let t=e.split(/(?<=[./_-])/);return(0,j.jsx)(j.Fragment,{children:t.map((e,n)=>(0,j.jsxs)(`span`,{children:[e,n<t.length-1&&(0,j.jsx)(`wbr`,{})]},n))})}function wc({removals:e}){return(0,j.jsxs)(`table`,{className:`cb-table`,children:[(0,j.jsx)(`caption`,{className:`sr`,children:V.removalsCaption}),(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{scope:`col`,children:V.removalCol.record}),(0,j.jsx)(`th`,{scope:`col`,children:V.removalCol.repos}),(0,j.jsx)(`th`,{scope:`col`,children:V.removalCol.why})]})}),(0,j.jsx)(`tbody`,{children:e.map(e=>(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{scope:`row`,className:`mono cb-id`,style:{fontWeight:`normal`},children:(0,j.jsx)(Cc,{text:`${e.kind}/${e.id}`})}),(0,j.jsx)(`td`,{"data-label":V.removalCol.repos,children:e.repos.length?e.repos.join(`, `):V.noRepo}),(0,j.jsx)(`td`,{"data-label":V.removalCol.why,children:Sc(e).join(`; `)})]},e.path))})]})}async function Tc(e,t,n=V.editsChanged){let r=await N(`/api/build`),i=e=>(e?.edits??[]).map(e=>`${e.how} ${e.path}`).join(`
|
|
33
|
+
`);if(i(r.pending.refused)!==i(e))throw Error(n);await Qn(`/api/build/edits/curate`,{count:t,plan:r.pending.plan})}function Ec(e){let t=e.refused,[n,r]=(0,v.useState)(),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(),c=t.removals??[],l=t.edits??[],u=t.discardEdits??l.length,d=e=>e===`large-removals`||e===`unexplained-removals`?e===`large-removals`?t.allowRemovals??c.length:t.unexplained?.length??0:e===`hand-edits`||e===`not-upgraded`?u:0;return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:10},role:`group`,"aria-label":V.refusedTitle,children:[(0,j.jsx)(`p`,{className:`state`,role:`note`,style:{margin:0},children:(0,j.jsx)(`strong`,{children:V.refusedTitle})}),(0,j.jsx)(`ul`,{style:{margin:0,paddingLeft:18},children:t.reasons.map(e=>(0,j.jsx)(`li`,{children:V.reason[e]?.(d(e))??e},e))}),t.unexplained&&t.unexplained.length>0&&(0,j.jsx)(wc,{removals:t.unexplained}),t.reasons.includes(`large-removals`)&&(0,j.jsx)(`div`,{children:(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,onClick:()=>r(`removals`),children:V.reviewRemovals(t.allowRemovals??c.length)})}),t.reasons.includes(`hand-edits`)&&(0,j.jsxs)(`section`,{className:`stack`,style:{gap:6},"aria-labelledby":`cb-edits`,children:[(0,j.jsx)(`h3`,{id:`cb-edits`,className:`hud`,style:{margin:0},children:V.editsTitle}),(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:V.editsIntro}),(0,j.jsx)(`ul`,{className:`cb-list mono`,"aria-label":V.editsCaption,children:l.map(e=>(0,j.jsxs)(`li`,{children:[V.how[e.how]??e.how,`: `,e.path]},e.path))}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`},children:[e.onCurate&&(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:i,"aria-busy":i,"aria-describedby":`cb-curate-hint`,onClick:()=>{a(!0),s(void 0),e.onCurate(l.length).catch(e=>s(V.failed(bc(e)))).finally(()=>a(!1))},children:i?V.curating:V.curate(l.length)}),e.onDiscard&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>r(`discard`),children:V.discard(u)})]}),(0,j.jsx)(`p`,{id:`cb-curate-hint`,className:`work-say`,style:{margin:0},children:V.curateHint})]}),t.reasons.includes(`not-upgraded`)&&(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:e.upgradeHere?V.upgradeTodo:(0,j.jsxs)(j.Fragment,{children:[V.upgradeElsewhere,` `,(0,j.jsx)(`a`,{href:`#/catalog-builds`,children:V.upgradeOn})]})}),(0,j.jsx)(sc,{text:`atticus upgrade --yes`,label:w.runNext.copy,noRun:!0})]}),o&&(0,j.jsx)(`p`,{className:`state error`,role:`alert`,style:{margin:0},children:o}),(0,j.jsxs)(`details`,{className:`work-terminal`,children:[(0,j.jsx)(`summary`,{children:V.inTerminal}),(0,j.jsx)(sc,{text:t.command,label:w.runNext.copy,noRun:!0})]}),n===`removals`&&(0,j.jsx)(xc,{title:V.removalsTitle(t.allowRemovals??c.length),intro:V.removalsIntro,confirm:(e.confirmLabel??V.confirmRemove)(t.allowRemovals??c.length),count:t.allowRemovals??c.length,onConfirm:async()=>{await e.onAllowRemovals(t.allowRemovals??c.length),r(void 0)},onClose:()=>r(void 0),children:(0,j.jsx)(wc,{removals:c})}),n===`discard`&&e.onDiscard&&(0,j.jsx)(xc,{title:V.discardTitle(u),intro:V.discardIntro,confirm:V.confirmDiscard(u),count:u,onConfirm:async()=>{await e.onDiscard(u),r(void 0)},onClose:()=>r(void 0),children:(0,j.jsx)(`ul`,{className:`cb-list mono`,children:l.map(e=>(0,j.jsxs)(`li`,{children:[V.how[e.how]??e.how,`: `,e.path]},e.path))})})]})}function Dc(e){let[t,n]=(0,v.useState)(),[r,i]=(0,v.useState)();return(0,j.jsxs)(F,{title:V.undoTitle,span:`1 / -1`,children:[(0,j.jsxs)(`p`,{className:`work-why`,style:{marginTop:0},children:[V.undoIntro,` `,V.undoLatest]}),(0,j.jsx)(I,{of:e.of,empty:e=>e.copies.length===0,emptyText:V.undoNone,children:t=>(0,j.jsxs)(`table`,{className:`cb-table`,children:[(0,j.jsx)(`caption`,{className:`sr`,children:V.undoCaption}),(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{scope:`col`,style:{width:`4.5em`},children:V.undoCol.n}),(0,j.jsx)(`th`,{scope:`col`,children:V.undoCol.command}),(0,j.jsx)(`th`,{scope:`col`,children:V.undoCol.at}),(0,j.jsx)(`th`,{scope:`col`,style:{width:`4.5em`},children:V.undoCol.files}),(0,j.jsx)(`th`,{scope:`col`,children:V.undoCol.act})]})}),(0,j.jsx)(`tbody`,{children:t.copies.map(t=>(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{scope:`row`,children:t.n}),(0,j.jsx)(`td`,{"data-label":V.undoCol.command,className:`mono`,children:t.command}),(0,j.jsx)(`td`,{"data-label":V.undoCol.at,children:yc(t.at)}),(0,j.jsx)(`td`,{"data-label":V.undoCol.files,children:t.files}),(0,j.jsx)(`td`,{children:(0,j.jsx)(`button`,{type:`button`,className:`btn`,"aria-label":V.undoToOf(t.n),onClick:()=>{i(void 0),e.plan(t.n).then(e=>e.plan?n(e.plan):i(e.problem),e=>i(bc(e)))},children:V.undoTo})})]},t.n))})]})}),r&&(0,j.jsx)(`p`,{className:`state error`,role:`alert`,children:r}),t&&(0,j.jsx)(kc,{plan:t,onConfirm:async()=>{await e.onUndo(t.n,t.files.length,t.hash),n(void 0)},onClose:()=>n(void 0)})]})}function Oc(e){let t=[];for(let n of[...e].reverse()){let e=/^atticus repo rename (\S+) (\S+)(?: |$)/.exec(n);if(!e)continue;let r=e[1],i=e[2],a=t.find(e=>e.to===r);a?a.to=i:t.push({from:r,to:i})}return t.filter(e=>e.from!==e.to)}function kc(e){let t=Oc(e.plan.takesBack.map(e=>e.command));return(0,j.jsxs)(xc,{title:V.undoPlanTitle(e.plan.n),intro:V.undoPlanIntro(e.plan.takesBack.map(e=>`${e.n} (${e.command})`).join(`, `)),confirm:V.confirmUndo(e.plan.files.length),onConfirm:e.onConfirm,onClose:e.onClose,children:[t.map(e=>(0,j.jsx)(`p`,{className:`work-why`,role:`note`,children:V.undoRename(e.from,e.to)},`${e.from}>${e.to}`)),(0,j.jsx)(`ul`,{className:`cb-list mono`,"aria-label":V.undoPlanCaption,children:e.plan.files.map(e=>(0,j.jsxs)(`li`,{children:[e.to===`absent`?V.remove:V.restore,` `,e.path]},e.path))})]})}function Ac(e){let[t,n]=(0,v.useState)(!1);return(0,j.jsxs)(F,{title:V.pruneTitle,span:`1 / -1`,children:[(0,j.jsx)(`p`,{className:`work-why`,style:{marginTop:0},children:V.pruneIntro}),(0,j.jsx)(I,{of:e.of,empty:e=>e.files.length===0,emptyText:V.pruneNone,children:r=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,j.jsx)(`ul`,{className:`cb-list mono`,"aria-label":V.pruneCaption,children:r.files.map(e=>(0,j.jsxs)(`li`,{children:[e.path,` `,(0,j.jsxs)(`span`,{className:`work-say`,children:[`(`,e.why,`)`]})]},e.path))}),(0,j.jsx)(`div`,{children:(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>n(!0),children:V.pruneReview(r.files.length)})}),t&&(0,j.jsx)(xc,{title:V.pruneConfirmTitle(r.files.length),intro:V.pruneConfirmIntro,confirm:V.confirmPrune(r.files.length),onConfirm:async()=>{await e.onPrune(r.files.length,r.plan),n(!1)},onClose:()=>n(!1),children:(0,j.jsx)(`ul`,{className:`cb-list mono`,children:r.files.map(e=>(0,j.jsx)(`li`,{children:e.path},e.path))})})]})})]})}function jc({last:e}){let t=e.outcome===`refused`,n=e.refused,r=(e,t)=>(0,j.jsx)(`ul`,{className:`cb-list mono`,tabIndex:0,"aria-label":t,children:e.map(e=>(0,j.jsxs)(`li`,{children:[e.kind,`/`,e.id]},e.path))}),i=e=>n?e===`large-removals`?n.allowRemovals??0:e===`unexplained-removals`?n.unexplained?.length??0:n.discardEdits??n.edits?.length??0:0;return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,j.jsxs)(`p`,{style:{margin:0},children:[(0,j.jsx)(`span`,{className:`chip ${t||e.outcome===`stopped`?`warn`:e.outcome===`written`?`done`:`dim`}`,children:V.outcome[e.outcome]??e.outcome}),` `,(0,j.jsx)(`span`,{className:`mono`,children:V.lastLine(e.command,yc(e.at))})]}),(0,j.jsxs)(`p`,{className:`hud`,style:{margin:0},children:[t?V.lastWouldCounts(e.counts.added,e.counts.changed,e.counts.removed):V.lastCounts(e.counts.added,e.counts.changed,e.counts.removed),e.slots.length?` · ${V.lastSlots(e.slots.length)}`:``]}),e.stopped!==void 0&&(0,j.jsx)(`p`,{className:`state error`,role:`note`,style:{margin:0},children:V.lastStopped(e.stopped)}),n&&(0,j.jsx)(`ul`,{style:{margin:0,paddingLeft:18},"aria-label":V.refusedTitle,children:n.reasons.map(e=>(0,j.jsx)(`li`,{children:V.reason[e]?.(i(e))??e},e))}),n?.unread&&n.unread.length>0&&(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:V.lastUnread}),(0,j.jsx)(`ul`,{className:`cb-list`,children:n.unread.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`span`,{className:`mono`,children:e.repo}),`: `,e.why]},e.repo))})]}),n?.edits&&n.edits.length>0&&(0,j.jsx)(`ul`,{className:`cb-list mono`,"aria-label":V.editsCaption,children:n.edits.map(e=>(0,j.jsxs)(`li`,{children:[V.how[e.how]??e.how,`: `,e.path]},e.path))}),e.removed.length>0&&(0,j.jsxs)(`details`,{open:t,children:[(0,j.jsx)(`summary`,{children:t?V.lastWouldRemove(e.removed.length):V.lastRemoved(e.removed.length)}),(0,j.jsx)(wc,{removals:e.removed})]}),!t&&e.added.length>0&&(0,j.jsxs)(`details`,{children:[(0,j.jsx)(`summary`,{children:V.lastAdded(e.added.length)}),r(e.added,V.lastAdded(e.added.length))]}),!t&&e.changed.length>0&&(0,j.jsxs)(`details`,{children:[(0,j.jsx)(`summary`,{children:V.lastChanged(e.changed.length)}),r(e.changed,V.lastChanged(e.changed.length))]}),e.discarded&&e.discarded.length>0&&(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:V.lastDiscarded(e.discarded.length)}),e.run.length>0&&(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:V.lastRun}),e.run.map(e=>(0,j.jsx)(sc,{text:e,label:w.runNext.copy,noRun:!0},e))]})]})}function Mc(e){return(0,j.jsx)(`ul`,{className:`cb-list mono`,"aria-label":V.upgradeChangesCaption,children:e.changes.map(e=>(0,j.jsx)(`li`,{children:V.upgradeChange(V.upgradeHow[e.how]??e.how,e.path)},e.path))})}function Nc(e){let[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(e.accepted===void 0?void 0:{n:e.accepted}),s=e=>e.acceptChanges>0&&a?.n===e.acceptChanges&&(a.plan===void 0||a.plan===e.plan);return(0,j.jsxs)(F,{title:V.upgradeTitle,span:`1 / -1`,children:[(0,j.jsx)(`p`,{className:`work-why`,style:{marginTop:0},children:V.upgradeIntro}),(0,j.jsx)(I,{of:e.of,empty:e=>!e.pending,emptyText:V.upgradeNone,children:a=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,j.jsx)(`p`,{style:{margin:0},children:V.upgradeRecords(a.records,a.write.length)}),(0,j.jsxs)(`table`,{className:`cb-table`,children:[(0,j.jsx)(`caption`,{className:`sr`,children:V.upgradeSlotsCaption}),(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{scope:`col`,children:V.upgradeSlotCol.path}),(0,j.jsx)(`th`,{scope:`col`,children:V.upgradeSlotCol.repo}),(0,j.jsx)(`th`,{scope:`col`,style:{width:`6em`},children:V.upgradeSlotCol.records})]})}),(0,j.jsx)(`tbody`,{children:a.write.map(e=>(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{scope:`row`,className:`mono`,style:{fontWeight:`normal`},children:e.path}),(0,j.jsx)(`td`,{"data-label":V.upgradeSlotCol.repo,children:e.repo??V.upgradeJoins}),(0,j.jsx)(`td`,{"data-label":V.upgradeSlotCol.records,children:e.records})]},e.path))})]}),(0,j.jsx)(`p`,{style:{margin:0},children:V.upgradeCopy(a.copy.dir,a.copy.files)}),a.acceptChanges===0?(0,j.jsx)(`p`,{className:`state`,style:{margin:0},children:V.upgradeFirstBuild}):(0,j.jsxs)(`div`,{className:`state`,role:`note`,children:[(0,j.jsx)(`p`,{style:{margin:0},children:V.upgradeDiffers(a.acceptChanges)}),(0,j.jsx)(Mc,{changes:a.changes}),s(a)?(0,j.jsx)(`p`,{className:`work-say`,style:{margin:`6px 0 0`},children:V.upgradeAccepted(a.acceptChanges)}):a.others.length===0&&(0,j.jsx)(`div`,{style:{marginTop:6},children:(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,onClick:()=>i(!0),children:V.upgradeAccept(a.acceptChanges)})})]}),a.verifiable.length>0&&(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:V.upgradeVerifiable(a.verifiable.join(`, `))}),a.others.length>0&&(0,j.jsxs)(`div`,{className:`state`,role:`note`,children:[(0,j.jsx)(`p`,{style:{margin:0},children:V.upgradeOthers}),(0,j.jsx)(_r,{})]}),(a.applies||s(a))&&a.others.length===0&&(0,j.jsx)(`div`,{children:(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,onClick:()=>n(!0),children:V.upgradeReview(a.writes.length)})}),(0,j.jsxs)(`details`,{className:`work-terminal`,children:[(0,j.jsx)(`summary`,{children:V.inTerminal}),(0,j.jsx)(sc,{text:a.run,label:w.runNext.copy,noRun:!0})]}),r&&(0,j.jsx)(xc,{title:V.upgradeAcceptTitle(a.acceptChanges),intro:V.upgradeAcceptIntro,confirm:V.confirmAccept(a.acceptChanges),count:a.acceptChanges,onConfirm:async()=>{o({n:a.acceptChanges,plan:a.plan}),i(!1)},onClose:()=>i(!1),children:(0,j.jsx)(Mc,{changes:a.changes})}),t&&(0,j.jsx)(xc,{title:V.upgradeConfirmTitle(a.writes.length),intro:a.acceptChanges?V.upgradeConfirmIntroChanges(a.acceptChanges):V.upgradeConfirmIntro,confirm:V.confirmUpgrade(a.writes.length),count:a.writes.length,onConfirm:async()=>{await e.onUpgrade(a.writes.length,a.plan,a.acceptChanges?a.acceptChanges:void 0),n(!1)},onClose:()=>n(!1),children:(0,j.jsx)(`ul`,{className:`cb-list mono`,"aria-label":V.upgradeFilesCaption,children:a.writes.map(e=>(0,j.jsxs)(`li`,{children:[e.path,` `,(0,j.jsxs)(`span`,{className:`work-say`,children:[`(`,V.upgradeWhat[e.what]??e.what,`, `,V.upgradeBytes(e.bytes),`)`]})]},e.path))})})]})})]})}function Pc(e){let[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)();return(0,j.jsxs)(`div`,{className:`bento cb`,children:[(0,j.jsxs)(F,{title:V.title,span:`1 / -1`,children:[(0,j.jsx)(`p`,{className:`work-why`,style:{marginTop:0},children:V.intro}),(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:(0,j.jsx)(`a`,{href:`#/crosscheck`,children:w.crossCheck.title})}),(0,j.jsx)(`div`,{role:`status`,className:`stack`,style:{gap:4,marginTop:6},children:e.note&&(0,j.jsx)(`span`,{children:e.note})}),(0,j.jsx)(An,{id:e.job})]}),(0,j.jsx)(F,{title:V.pendingTitle,span:`1 / -1`,children:(0,j.jsx)(I,{of:e.build,children:a=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:10},children:[a.pending.refused?(0,j.jsx)(Ec,{refused:a.pending.refused,upgradeHere:!0,onAllowRemovals:t=>e.run(`/api/build`,{allowRemovals:t,plan:a.pending.plan}),onCurate:t=>e.run(`/api/build/edits/curate`,{count:t,plan:a.pending.plan}),onDiscard:t=>e.run(`/api/build`,{discardEdits:t,plan:a.pending.plan})}):a.pending.upToDate?(0,j.jsx)(`p`,{className:`state`,style:{margin:0},children:V.upToDate}):(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,j.jsx)(`p`,{style:{margin:0},children:a.pending.removals.length?V.wouldWrite(a.pending.removals.length):V.wouldWriteNothing}),a.pending.removals.length>0&&(0,j.jsx)(wc,{removals:a.pending.removals}),(0,j.jsx)(`div`,{children:(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:t,"aria-busy":t,onClick:()=>{n(!0),i(void 0),e.run(`/api/build`,{plan:a.pending.plan}).catch(e=>i(V.failed(bc(e)))).finally(()=>n(!1))},children:t?V.building:V.build})})]}),r&&(0,j.jsx)(`p`,{className:`state error`,role:`alert`,style:{margin:0},children:r}),a.orphaned.map(e=>(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:V.orphaned(e.repo,e.why)},e.repo)),a.problems.length>0&&(0,j.jsxs)(`div`,{className:`state error`,role:`note`,children:[(0,j.jsx)(`p`,{style:{margin:0},children:V.problems}),(0,j.jsx)(`ul`,{style:{margin:0},children:a.problems.map((e,t)=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`span`,{className:`mono`,children:e.file}),`: `,e.message]},`${t}:${e.file}`))})]})]})})}),(0,j.jsx)(F,{title:V.sourcesTitle,span:`1 / -1`,children:(0,j.jsx)(I,{of:e.build,empty:e=>e.sources.length===0,emptyText:V.noSources,children:e=>(0,j.jsxs)(`table`,{className:`cb-table`,children:[(0,j.jsx)(`caption`,{className:`sr`,children:V.sourcesCaption}),(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{scope:`col`,children:V.col.repo}),(0,j.jsx)(`th`,{scope:`col`,children:V.col.source}),(0,j.jsx)(`th`,{scope:`col`,children:V.col.commit}),(0,j.jsx)(`th`,{scope:`col`,children:V.col.note})]})}),(0,j.jsx)(`tbody`,{children:e.sources.map(e=>(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{scope:`row`,className:`mono`,style:{fontWeight:`normal`},children:e.repo}),(0,j.jsx)(`td`,{"data-label":V.col.source,children:(0,j.jsx)(`span`,{className:`chip ${e.source===`facts`?`done`:e.source===`none`?`dim`:`warn`}`,children:V.source[e.source]??e.source})}),(0,j.jsx)(`td`,{"data-label":V.col.commit,className:`mono`,children:vc(e.commit)}),(0,j.jsx)(`td`,{"data-label":V.col.note,children:e.source===`legacy`?w.crossCheck.state.legacy:e.problem??``})]},e.repo))})]})})}),e.upgrade&&(0,j.jsx)(Nc,{of:e.upgrade,onUpgrade:(t,n,r)=>e.run(`/api/build/upgrade`,{count:t,plan:n,...r?{acceptChanges:r}:{}})}),(0,j.jsxs)(F,{title:V.lastTitle,span:`1 / -1`,children:[(0,j.jsx)(`p`,{className:`work-why`,style:{marginTop:0},children:V.lastIntro}),(0,j.jsx)(I,{of:e.build,empty:e=>!e.last,emptyText:V.lastNone,children:e=>(0,j.jsx)(jc,{last:e.last})})]}),(0,j.jsx)(Dc,{of:e.undo,plan:e.plan,onUndo:(t,n,r)=>e.run(`/api/build/undo`,{n:t,files:n,plan:r})}),(0,j.jsx)(Ac,{of:e.prune,onPrune:(t,n)=>e.run(`/api/build/prune`,{count:t,plan:n})})]})}function Fc(){let e=P(`/api/build`),t=P(`/api/build/undo`),n=P(`/api/build/prune`),r=e.state===`ready`&&e.data.upgrade===!0,i=P(r?`/api/build/upgrade`:void 0);lt(e,t,n,i);let[a,o]=(0,v.useState)(),[s,c]=(0,v.useState)(),l=()=>{e.reload(),t.reload(),n.reload(),r&&i.reload()};return(0,j.jsx)(Pc,{build:e,upgrade:r?i:void 0,undo:t,prune:n,run:async(e,t)=>{c(void 0);try{await Qn(e,t,void 0,o),c(V.done)}finally{l()}},plan:e=>N(`/api/build/undo?n=${e}`),job:a,note:s})}var Ic=w.propose;function Lc(e){if(!(e instanceof Zn))return;let t=e.result?.refused;if(t&&Array.isArray(t.reasons))return t.reasons.some(e=>e===`large-removals`||e===`hand-edits`)?t:void 0}var Rc=(0,v.createContext)(!1),zc=()=>(0,v.useContext)(Rc);function Bc(e,t){let n=(0,j.jsx)(`pre`,{className:`mono`,style:{whiteSpace:`pre-wrap`,margin:0,fontSize:11.5},children:e.join(`
|
|
34
|
+
`)});return t?(0,j.jsxs)(`details`,{className:`work-terminal`,children:[(0,j.jsx)(`summary`,{children:w.panelResults.printed(e.length)}),n]}):n}var Vc=`#/catalog-builds`;function Hc({refused:e}){let t=w.panelResults,n=e.removals?.length??e.allowRemovals??0;return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,j.jsx)(`p`,{className:`ev-say`,role:`status`,style:{margin:0},children:n?t.waitsRemovals(n):t.waitsBuild}),(0,j.jsx)(`a`,{className:`btn primary`,href:Vc,children:n?t.reviewRemovals(n):t.reviewBuild})]})}var Uc=e=>e.plan?{plan:e.plan}:{},Wc=`atticus:work-changed`,Gc=new EventTarget,Kc=()=>void Gc.dispatchEvent(new Event(Wc));function qc(e){let t=Vn(),[n,r]=(0,v.useState)(),[i,a]=(0,v.useState)(),[o,s]=(0,v.useState)(),[c,l]=(0,v.useState)(),u=zc(),d=async t=>{a(void 0);try{let n=await Qn(`/api/facts/${encodeURIComponent(e.repo)}/apply`,t,void 0,s);l(void 0),r(n.lines),e.scope===`corrections`&&se({text:Ic.appliedFlash(e.repo),href:`#/home`,link:Ic.toHome})}catch(t){if(t instanceof M&&t.problem.status===409){let n=Ic.notStarted(t.problem.detail??t.problem.title);throw e.scope===`corrections`&&se({text:n.slice(0,400)}),Error(n,{cause:t})}let n=Lc(t);throw l(n),r([t.message]),a(Xn(t)),e.scope===`corrections`&&se({text:(n?Ic.applyWaits(e.repo):`${Ic.applyFailed} ${t.message}`).slice(0,400)}),Error(n?Ic.applyWaits(e.repo):Ic.applyFailed,{cause:t})}finally{Kc()}};return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[e.repo&&(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsxs)(`div`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:t.busy,onClick:()=>void t.run(()=>d({}),Ic.applied(e.repo)),children:t.busy?Ic.applying:Ic.apply(e.repo)}),(t.busy||u&&n)&&(0,j.jsx)(An,{id:o})]}),(0,j.jsx)(Wn,{note:t.note}),n&&n.length>0&&Bc(n,u),i&&(0,j.jsx)(er,{repos:i.repos}),c&&Jc({refused:c,onAllowRemovals:n=>t.run(()=>d({allowRemovals:n,...Uc(c)}),Ic.applied(e.repo)),onCurate:async t=>{await Tc(c,t,Ic.editsChanged),l(void 0),r([Ic.curatedApplyAgain(e.repo)]),Kc()},onDiscard:n=>t.run(()=>d({discardEdits:n,...Uc(c)}),Ic.applied(e.repo))})]}),!e.noPropose&&(0,j.jsx)(Yc,{scope:e.scope})]})}function Jc(e){return(0,j.jsx)(Ec,{refused:e.refused,confirmLabel:Ic.confirmApply,onAllowRemovals:e.onAllowRemovals,onCurate:e.onCurate,onDiscard:e.onDiscard})}function Yc({scope:e,onDone:t}){let[n,r]=(0,v.useState)(),[i,a]=(0,v.useState)(new Set),[o,s]=(0,v.useState)(),c=Vn(),l=Vn(),u=(0,v.useId)(),d=(0,v.useRef)(null);if((0,v.useEffect)(()=>{o&&jt(d.current)},[o]),o)return(0,j.jsx)(`div`,{className:`stack`,style:{gap:4},children:(0,j.jsx)(`div`,{ref:d,tabIndex:-1,role:`status`,className:`stack`,style:{gap:4},children:o.map(e=>(0,j.jsx)(`p`,{style:{margin:0},children:e},e))})});if(!n)return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:c.busy,onClick:()=>void c.run(async()=>{let t=await N(`/api/propose?scope=${e}`);a(new Set(t.files.filter(e=>e.proposed).map(e=>e.path))),r(t)},Ic.listed),children:Ic.propose}),(0,j.jsx)(Wn,{note:c.note})]});let f=n.files.filter(e=>!i.has(e.path));return(0,j.jsxs)(`section`,{className:`stack`,style:{gap:6},"aria-labelledby":`${u}-t`,children:[(0,j.jsx)(`h5`,{id:`${u}-t`,className:`hud`,children:Ic.title}),n.files.length===0?(0,j.jsx)(`p`,{className:`work-say`,children:Ic.nothing}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`work-say`,children:Ic.willCommit(n.branch,n.title)}),(0,j.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0},children:n.files.map(e=>(0,j.jsx)(`li`,{children:(0,j.jsxs)(`label`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:!i.has(e.path),onChange:t=>{let n=new Set(i);t.target.checked?n.delete(e.path):n.add(e.path),a(n)}}),(0,j.jsx)(`code`,{className:`mono`,children:e.path}),(0,j.jsx)(`span`,{className:`muted`,children:Ic.status[e.status]??e.status}),e.proposed&&(0,j.jsx)(`span`,{className:`muted`,children:Ic.inReview(e.proposed)})]})},e.path))}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:l.busy||f.length===0,onClick:()=>void l.run(async()=>{let r=await Qn(`/api/propose`,{scope:e,files:f.map(e=>e.path),branch:n.branch,...await Jn(`propose`,e)});s(r.lines),t?.()},Ic.proposed),children:l.busy?Ic.proposing:Ic.yes(f.length)}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>r(void 0),children:Ic.cancel})]}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:Ic.whoMerges})]}),(0,j.jsx)(Wn,{note:l.note})]})}var Xc=e=>e?/follows no remote branch, and (\S+) is there/.exec(e)?.[1]:void 0;function Zc(){let e=Vn(),t=Vn(),[n,r]=(0,v.useState)(),i=e.note&&!e.note.ok?Xc(e.note.text):void 0;return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsxs)(`div`,{className:`row`,style:{gap:6,alignItems:`center`},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:e.busy,onClick:()=>void e.run(()=>Qn(`/api/propose/bring-in`,{},void 0,r),e=>e.lines.join(` `)),children:e.busy?Ic.bringingIn:Ic.bringIn}),(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:Ic.bringInWhy})]}),e.busy&&(0,j.jsxs)(`span`,{role:`status`,className:`row`,style:{gap:6,alignItems:`center`,fontSize:12},children:[Ic.bringingInSay,` `,(0,j.jsx)(An,{id:n})]}),(0,j.jsx)(Wn,{note:e.note}),i&&(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsxs)(`span`,{className:`row`,style:{gap:6,alignItems:`center`},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:t.busy,onClick:()=>void t.run(()=>Qn(`/api/propose/upstream`,{upstream:i}),e=>e.lines.join(` `)),children:Ic.setUpstream(i)}),(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:Ic.setUpstreamWhy})]}),(0,j.jsx)(Wn,{note:t.note})]})]})}var Qc={running:!1};async function $c(e){e({running:!0,note:{ok:!0,text:w.app.working,working:!0}});try{return e({running:!1,lines:(await Qn(`/api/facts/apply-all`,{},void 0,t=>e(e=>({...e,jobId:t})))).lines,note:{ok:!0,text:w.appStep.appliedAll}}),!0}catch(t){let n=Xn(t);return e({running:!1,lines:[Bn(t)],...n?{next:n}:{},note:{ok:!1,text:Bn(t)}}),!1}finally{Kc()}}function el({noPropose:e,onDone:t,onFailed:n,run:r,onRun:i}){let[a,o]=(0,v.useState)(Qc),s=r??a,c=zc(),l=i??(()=>void $c(o).then(e=>{e?t?.():n?.()}));return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,j.jsxs)(`div`,{className:`row`,style:{gap:6,alignItems:`center`},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:s.running,onClick:l,children:s.running?w.appStep.applyingAll:w.appStep.applyAll}),(s.running||c&&s.lines)&&(0,j.jsx)(An,{id:s.jobId})]}),(0,j.jsx)(Wn,{note:s.note}),s.lines&&s.lines.length>0&&Bc(s.lines,c),s.next&&(0,j.jsx)(er,{repos:s.next.repos}),!e&&(0,j.jsx)(Yc,{scope:`work`})]})}var tl=e=>e.type===`file.changed`&&typeof e.path==`string`&&(/(?:^|[\\/])facts[\\/][^\\/]+\.(?:corrections\.jsonl|verify\.yaml)$/.test(e.path)||/(?:^|[\\/])questions[\\/]q-[^\\/]+\.yaml$/.test(e.path)),nl=2e3;function rl(){let e=P(`/api/propose?scope=work`),t=e.reload,n=(0,v.useRef)(0);(0,v.useEffect)(()=>{let e=()=>{n.current=Date.now(),t()};Gc.addEventListener(Wc,e);let r=Ge(e);return()=>{Gc.removeEventListener(Wc,e),r()}},[t]);let r=(0,v.useRef)(void 0);(0,v.useEffect)(()=>()=>clearTimeout(r.current),[]),ut(e=>{if(!e.some(tl))return;let i=n.current+nl-Date.now();if(i<=0)return t();r.current===void 0&&(r.current=setTimeout(()=>{r.current=void 0,t()},i))});let[i,a]=(0,v.useState)(Qc),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(0),u=(0,v.useRef)(null);(0,v.useEffect)(()=>{c&&(u.current?.isConnected?u.current.querySelector(`button`)??u.current:typeof document>`u`?null:document.getElementById(`main`))?.focus()},[c]);let d=e.state===`ready`?e.data.applyFirst??[]:[],f=!i.running&&i.note?.ok===!1;if(!d.length&&!o&&!i.running&&!f)return null;let p=d.length>1||i.running||f;return(0,j.jsxs)(`section`,{ref:u,tabIndex:-1,className:`panel stack box-bar`,style:{gap:6,gridColumn:`1 / -1`},"aria-label":w.appStep.applyAll,children:[d.length>0&&(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:Ic.onMap(d.join(`, `))}),p&&(0,j.jsx)(el,{noPropose:!0,run:i,onRun:()=>{s(!1),$c(a).then(e=>{e&&(a(Qc),s(!0))})}}),f&&(0,j.jsx)(`div`,{children:(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>{a(Qc),l(e=>e+1)},children:Ic.dismissErrors})}),!p&&d.length===1&&(0,j.jsx)(qc,{scope:`corrections`,repo:d[0],noPropose:!0}),o&&!d.length&&!f&&(0,j.jsxs)(`p`,{role:`status`,className:`work-say`,style:{margin:0},children:[Ic.onMapApplied,` `,(0,j.jsx)(`a`,{href:`#/home`,children:Ic.toHome})]})]})}function il(e){return e.applyFirst??[...new Set(e.files.map(e=>/(?:^|\/)facts\/([^/]+)\.corrections\.jsonl$/.exec(e.path)?.[1]).filter(e=>!!e))]}var al=e=>e.files.filter(e=>!e.proposed).length;function ol(e={}){let t=P(e.plan?void 0:`/api/propose?scope=work`),n=e.plan??t,r=n.reload;(0,v.useEffect)(()=>(Gc.addEventListener(Wc,r),()=>Gc.removeEventListener(Wc,r)),[r]);let[i,a]=(0,v.useState)(!1),o=n.state===`ready`?al(n.data):0;if(o===0&&!i)return null;let s=n.state!==`ready`||i?[]:il(n.data);return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[!i&&(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:Ic.pending(o)}),s.length>0&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:Ic.applyFirst}),s.length>1&&(0,j.jsx)(el,{noPropose:!0}),s.slice(0,e.max??s.length).map(e=>(0,j.jsx)(qc,{scope:`corrections`,repo:e,noPropose:!0},e)),e.max!==void 0&&s.length>e.max&&(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:(0,j.jsx)(`a`,{href:`#/canvas`,children:w.commandCenter.home.more(s.length-e.max)})})]}),(0,j.jsx)(Yc,{scope:`work`,onDone:()=>{a(!0),n.reload()}})]})}var sl=w.appStep;function cl(e){let t=e.trim().split(/\s+/);return t.some(e=>/["'<>…]/.test(e))?void 0:t}var ll=e=>!!e&&!e.startsWith(`-`);function ul(e){let t=wr(e);if(t)return{kind:`ai`,args:t};let n=cl(e);if(!n||n[0]!==`atticus`)return;let[,r,i,a,o,...s]=n,c=e=>n.length===e;if(r===`verify`&&ll(i)&&(c(3)||c(4)&&a===`--write`))return{kind:`apply`,repo:i};if(r===`verify`&&i===`--all`&&(c(3)||c(4)&&a===`--write`))return{kind:`apply-all`};if(r===`map`&&i===`--all`&&a===`--repos`&&ll(o)&&!o.includes(`,`)&&c(5))return{kind:`ai`,args:[`map`,o]};if(r===`workspace`&&i===`sync`&&(c(3)||c(4)&&ll(a)))return{kind:`call`,method:`POST`,path:`/api/workspace/sync`,body:a?{repos:[a]}:{},label:sl.sync,working:sl.syncing,done:sl.synced};if(r===`sources`&&i===`sync`&&c(3))return{kind:`call`,method:`POST`,path:`/api/knowledge/sources/sync`,label:sl.sourcesSync,working:sl.sourcesSyncing,done:sl.sourcesSynced};if(r===`estate`&&i===`join`&&c(3)||r===`join`&&c(2))return{kind:`call`,method:`POST`,path:`/api/estate/join`,label:sl.join,working:sl.joining,done:sl.joined,writes:!0};if(r===`workspace`&&i===`prune`&&(c(3)||c(4)&&ll(a)))return{kind:`call`,method:`POST`,path:`/api/workspace/prune`,body:a?{change:a}:{},label:sl.prune,working:sl.pruning,done:sl.pruned,say:sl.pruneSay};if(r===`task`&&i===`context`&&ll(a)&&ll(o)&&s.length===0)return{kind:`task-context`,change:a,task:o};if(r===`history`&&(i===`on`||i===`off`)&&c(3))return{kind:`call`,method:`PUT`,path:`/api/history/recording`,body:{on:i===`on`},label:i===`on`?sl.historyOn:sl.historyOff,working:sl.historyWorking,done:i===`on`?sl.historyNowOn:sl.historyNowOff}}function dl({step:e,scope:t=`work`}){switch(e.kind){case`ai`:return(0,j.jsx)(zr,{args:e.args});case`apply`:return(0,j.jsx)(qc,{scope:t,repo:e.repo});case`apply-all`:return(0,j.jsx)(el,{});case`task-context`:return(0,j.jsx)(ml,{change:e.change,task:e.task});case`call`:return(0,j.jsx)(pl,{step:e})}}function fl({command:e,scope:t}){let n=ul(e);return n?(0,j.jsx)(dl,{step:n,...t?{scope:t}:{}}):null}function pl({step:e}){let t=Vn(),[n,r]=(0,v.useState)(),[i,a]=(0,v.useState)(),o=zc();return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[e.say&&(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:e.say}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:t.busy,onClick:()=>void t.run(async()=>{try{if(e.method===`POST`){let t=await Qn(e.path,e.body??{},void 0,a);r(t.lines)}else await N(e.path,{method:e.method,body:e.body??{}})}catch(e){throw r(void 0),e}finally{e.writes&&Kc()}},e.done),children:t.busy?e.working:e.label}),o&&(0,j.jsx)(An,{id:i})]}),(0,j.jsx)(Wn,{note:t.note}),n&&n.length>0&&Bc(n,o)]})}function ml({change:e,task:t}){let n=Vn(),[r,i]=(0,v.useState)();return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,j.jsx)(`div`,{className:`row`,style:{gap:6},children:(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:n.busy,onClick:()=>void n.run(async()=>{let n=await N(`/api/changes/${encodeURIComponent(e)}/tasks/${encodeURIComponent(t)}/context`);return i(n.markdown),navigator.clipboard?navigator.clipboard.writeText(n.markdown).then(()=>!0,()=>!1):!1},e=>e?sl.taskContextCopied:sl.taskContextFailed),children:n.busy?sl.taskContextWorking:sl.taskContext})}),(0,j.jsx)(Wn,{note:n.note}),r!==void 0&&(0,j.jsxs)(`details`,{children:[(0,j.jsx)(`summary`,{children:sl.taskContext}),(0,j.jsx)(`pre`,{className:`mono`,tabIndex:0,role:`region`,"aria-label":sl.taskContext,style:{whiteSpace:`pre-wrap`,margin:0,fontSize:11.5,maxHeight:320,overflow:`auto`},children:r})]})]})}function hl({text:e}){return(0,j.jsxs)(`div`,{className:`state stack`,style:{gap:8},children:[(0,j.jsx)(`p`,{style:{margin:0},children:e}),(0,j.jsx)(`p`,{style:{margin:0},children:(0,j.jsx)(`a`,{className:`btn primary`,href:`#/trust`,children:sl.openTrust})})]})}function gl({repo:e,again:t,ask:n}){return Vt()?.allowed?(0,j.jsx)(Xt,{ask:n??{kind:`repos`,repos:[e],...t?{force:!0}:{}},label:t&&!n?w.copilotRuns.start.again(e):w.copilotRuns.start.repos(e)}):(0,j.jsx)(zr,{args:[`map`,e]})}function _l(e){let t=ul(e.verify),n=[e.verify,e.commit].filter(e=>!!e);return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,j.jsx)(`p`,{className:`ev-say`,role:`status`,children:e.said}),t&&(0,j.jsx)(dl,{step:t,scope:e.scope??`corrections`}),(0,j.jsxs)(`details`,{className:`work-terminal`,children:[(0,j.jsx)(`summary`,{children:sl.inTerminal}),n.map(e=>(0,j.jsxs)(`div`,{className:`work-cmd`,children:[(0,j.jsx)(`code`,{className:`mono`,style:{whiteSpace:`pre-wrap`},children:e}),(0,j.jsx)(sr,{text:e,label:`${sl.inTerminal}: ${e}`})]},e))]})]})}var vl=h(),yl=w.viewer,bl={min:280,step:40,wide:.6,keep:240},xl=`atticus.detailsWidth`;function Sl(e,t,n){let r=e=>Math.min(Math.max(e,bl.min),Math.max(n,bl.min));switch(t){case`ArrowLeft`:return r(e+bl.step);case`ArrowRight`:return r(e-bl.step);case`Home`:return r(bl.min);case`End`:return r(n);default:return}}function Cl(e,t,n){return Math.min(Math.max(e-t,bl.min),Math.max(n,bl.min))}function wl(e,t){return e!==void 0&&t>0&&e>=(t-bl.keep)*bl.wide-1}function Tl(e,t){let n=Math.max(bl.min,e-bl.keep);return Math.max(Math.round(n*bl.wide),t+bl.step,bl.min)}function El(e=globalThis.localStorage){try{let t=e?.getItem(xl);if(t==null||t===``)return;let n=Number(t);return Number.isFinite(n)&&n>=bl.min?n:void 0}catch{return}}function Dl(e){try{e===void 0?globalThis.localStorage?.removeItem(xl):globalThis.localStorage?.setItem(xl,String(Math.round(e)))}catch{}}var Ol={min:.1,max:3,step:1.25},kl=(e,t,n)=>Math.min(n,Math.max(t,e)),Al=e=>kl(e,Ol.min,Ol.max);function jl(e,t,n={}){let r=n.pad??24,i=Math.max(1,t.width-r*2),a=Math.max(1,t.height-r*2),o=kl(Math.min(i/Math.max(1,e.w),a/Math.max(1,e.h)),n.min??Ol.min,n.max??1);return{k:o,x:(t.width-e.w*o)/2-e.x*o,y:(t.height-e.h*o)/2-e.y*o}}function Ml(e,t,n){let r=n.pad??24,i=jl(e,t,{pad:r,min:n.min,...n.max===void 0?{}:{max:n.max}}),a=e.w*i.k>t.width-r*2,o=e.h*i.k>t.height-r*2;return{k:i.k,x:a?r-e.x*i.k:i.x,y:o?r-e.y*i.k:i.y}}function Nl(e,t,n){let r=Al(e.k*t),i=r/e.k;return{k:r,x:n.x-(n.x-e.x)*i,y:n.y-(n.y-e.y)*i}}function Pl(e,t,n,r=e.k){return{k:r,x:n.width/2-(t.x+t.w/2)*r,y:n.height/2-(t.y+t.h/2)*r}}var Fl=(e,t=0)=>Math.exp(-e*(t===1?33:t===2?400:1)/500);function Il(e){if(!(e.ctrlKey||e.metaKey||e.altKey))switch(e.key){case`+`:case`=`:return`zoom-in`;case`-`:case`_`:return`zoom-out`;case`0`:return`fit`;case`1`:return`reset`;case`s`:case`S`:return`fit-selection`;case`m`:case`M`:return`focus`;case`f`:case`F`:return`full-screen`;case`Escape`:return`leave`;case`/`:return`search`;case`ArrowLeft`:return`pan-left`;case`ArrowRight`:return`pan-right`;case`ArrowUp`:return`pan-up`;case`ArrowDown`:return`pan-down`;default:return}}function Ll(e,t){return t===`pan-left`?{...e,x:e.x+80}:t===`pan-right`?{...e,x:e.x-80}:t===`pan-up`?{...e,y:e.y+80}:t===`pan-down`?{...e,y:e.y-80}:e}function Rl(e,t,n=8){let r=t.trim().toLowerCase();if(!r)return[];let i=e=>{let t=e.label.toLowerCase();return t===r?0:t.startsWith(r)?1:t.includes(r)?2:e.id.toLowerCase().includes(r)?3:9};return e.map(e=>({n:e,s:i(e)})).filter(e=>e.s<9).sort((e,t)=>e.s-t.s||e.n.label.length-t.n.label.length||(e.n.id<t.n.id?-1:1)).slice(0,n).map(e=>e.n)}function zl(e,t){let n=new Set([t]);for(let r of e)r.from===t&&n.add(r.to),r.to===t&&n.add(r.from);return n}function Bl(e,t,n,r){if(!e.length)return r;let i=t===null?-1:e.indexOf(t);return n?i<=0?e[e.length-1]:void 0:i===-1||i===e.length-1?e[0]:void 0}function Vl(e){return e.key!==`Escape`||e.defaultPrevented?!1:!e.target?.closest?.(`[role="search"]`)}function Hl(e){e?.querySelector(`[data-viewer-action="full-screen"]`)?.focus()}var Ul=`a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`;function Wl(e=!1){let[t,n]=(0,v.useState)(e),r=(0,v.useCallback)(e=>n(t=>e===void 0?!t:e),[]);return(0,v.useEffect)(()=>{if(!t||typeof window>`u`)return;let e=e=>{let t=e.target;Vl({key:e.key,defaultPrevented:e.defaultPrevented,target:t})&&n(!1)};window.addEventListener(`keydown`,e);let r=document.body,i=r.style.overflow;return r.style.overflow=`hidden`,()=>{window.removeEventListener(`keydown`,e),r.style.overflow=i}},[t]),[t,r]}var Gl=8;function Kl(e,t,n=420,r=160){return Math.max(n,Math.floor(e-kl(t,0,r)-16-Gl))}var ql=(e,t)=>Math.max(160,e-Math.max(0,t-16));function Jl(e,t,n=420,r=160){return Kl(e.bottom-e.top,t-e.top,n,r)}function Yl(e){for(let t=e.parentElement;t&&t!==document.body;t=t.parentElement){let e=getComputedStyle(t).overflowY;if(e===`auto`||e===`scroll`)return t}}function Xl(e,t={}){let n=t.min??420,r=t.maxTop??160,[i,a]=(0,v.useState)(t.fixed??Math.max(n,560));return(0,v.useEffect)(()=>{if(t.fixed!==void 0||typeof window>`u`)return;let i=e.current?Yl(e.current):void 0,o=()=>{let t=e.current;if(!t)return;let o=i?.getBoundingClientRect(),s={top:Math.max(0,o?.top??0),bottom:Math.min(window.innerHeight,o?.bottom??window.innerHeight)};a(Jl(s,t.getBoundingClientRect().top,n,r))};o(),window.addEventListener(`resize`,o);let s=typeof ResizeObserver>`u`?void 0:new ResizeObserver(o);if(s)for(let t=e.current?.parentElement;t&&t!==i&&t!==document.body;)s.observe(t),t=t.parentElement;return s&&i&&s.observe(i),()=>{window.removeEventListener(`resize`,o),s?.disconnect()}},[e,n,r,t.fixed]),t.fixed??i}function Zl(e,t){let{height:n,ready:r,full:i,moved:a}=t,o=t.minZoom??.6;(0,v.useEffect)(()=>{if(!r||a.current||typeof requestAnimationFrame>`u`)return;let t=requestAnimationFrame(()=>void e.current?.fitView({padding:.08,minZoom:o}));return()=>cancelAnimationFrame(t)},[n,r,i,e,a,o])}var Ql=({d:e})=>(0,j.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 14 14`,"aria-hidden":`true`,focusable:`false`,children:(0,j.jsx)(`path`,{d:e,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`})}),$l={in:`M3 7 H11 M7 3 V11`,out:`M3 7 H11`,reset:`M2 4 V10 M5 4 V10 M9 4 H12 V10 H9 Z`,fit:`M2 5 V2 H5 M9 2 H12 V5 M12 9 V12 H9 M5 12 H2 V9`,sel:`M4 4 H10 V10 H4 Z M1 7 H3 M11 7 H13 M7 1 V3 M7 11 V13`,focus:`M7 4 A3 3 0 1 1 6.99 4 M1 7 H2.5 M11.5 7 H13`,full:`M2 5 V2 H5 M9 2 H12 V5 M12 9 V12 H9 M5 12 H2 V9 M5 5 L9 9 M9 5 L5 9`,leave:`M5 2 V5 H2 M9 2 V5 H12 M12 9 H9 V12 M2 9 H5 V12`,close:`M3.5 3.5 L10.5 10.5 M10.5 3.5 L3.5 10.5`};function eu(e){let t=(0,v.useId)(),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(``),o=t=>{let n=Rl(e.nodes,t,1)[0];n?(e.onFind(n.id),a(yl.found(n.label))):t.trim()&&a(yl.notFound(t.trim()))},s=(t,n,r,i={})=>(0,j.jsx)(`button`,{type:`button`,className:`btn viewer-btn ${i.on?`primary`:``}`,"aria-label":n,title:n,"data-viewer-action":t,disabled:i.off,...i.on===void 0?{}:{"aria-pressed":i.on},onClick:()=>e.onAction(t),children:(0,j.jsx)(Ql,{d:r})});return(0,j.jsxs)(`div`,{className:`viewer-bar`,role:`toolbar`,"aria-label":yl.toolbar,children:[(0,j.jsxs)(`div`,{className:`viewer-group`,children:[s(`zoom-out`,yl.zoomOut,$l.out),(0,j.jsx)(`span`,{className:`hud viewer-zoom`,"aria-live":`polite`,children:yl.zoomLevel(Math.round(e.zoom*100))}),s(`zoom-in`,yl.zoomIn,$l.in),s(`reset`,yl.reset,$l.reset),s(`fit`,yl.fit,$l.fit),s(`fit-selection`,yl.fitSelection,$l.sel,{off:!e.picked}),s(`focus`,e.focus?yl.focusOff:yl.focus,$l.focus,{on:e.focus,off:!e.picked&&!e.focus}),s(`full-screen`,e.full?yl.leaveFullScreen:yl.fullScreen,e.full?$l.leave:$l.full,{on:e.full})]}),(0,j.jsxs)(`form`,{className:`viewer-group viewer-find`,role:`search`,onSubmit:e=>{e.preventDefault(),o(n)},children:[(0,j.jsx)(`input`,{ref:e.searchRef,className:`field`,type:`search`,"aria-label":yl.search,placeholder:yl.searchPlaceholder,list:t,value:n,onChange:t=>{r(t.target.value),e.nodes.some(e=>e.label===t.target.value)&&o(t.target.value)},onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),e.preventDefault(),r(``))}}),(0,j.jsx)(`datalist`,{id:t,children:Rl(e.nodes,n,8).map(e=>(0,j.jsx)(`option`,{value:e.label,children:e.kind??``},e.id))}),(0,j.jsx)(`span`,{className:`sr`,"aria-live":`polite`,children:i})]})]})}function tu(e){let[t,n]=(0,v.useState)(()=>!(e.asideIdle&&nu())),r=(0,v.useId)(),i=(0,v.useRef)(null),a=(0,v.useRef)(null),[o,s]=(0,v.useState)(void 0);(0,v.useEffect)(()=>s(El()),[]);let[c,l]=(0,v.useState)(0),[u,d]=(0,v.useState)(bl.min),f=!!e.aside&&!!e.asideBeside;(0,v.useEffect)(()=>{let e=i.current,t=a.current;if(!f||!e||typeof ResizeObserver>`u`)return;let n=()=>{l(Math.round(e.getBoundingClientRect().width)),t&&!t.hidden&&d(Math.round(t.getBoundingClientRect().width))};n();let r=new ResizeObserver(n);return r.observe(e),t&&r.observe(t),()=>r.disconnect()},[f]);let p=Math.max(bl.min,c-bl.keep),m=Math.round(c>0?Math.min(o??u,p):o??u),h=e=>{s(e),Dl(e)},g=wl(o,c),_=e=>{let t=Sl(m,e.key,p);t===void 0?(e.key===`ArrowUp`||e.key===`ArrowDown`)&&e.stopPropagation():(e.preventDefault(),e.stopPropagation(),h(t))},y=e=>{let t=i.current;if(!t||e.button!==0)return;e.preventDefault();let n=e.currentTarget;n.setPointerCapture?.(e.pointerId);let r,a=e=>{let n=t.getBoundingClientRect();r=Cl(n.right,e.clientX,n.width-bl.keep),s(r)},o=()=>{r!==void 0&&Dl(r),n.removeEventListener(`pointermove`,a),n.removeEventListener(`pointerup`,o),n.removeEventListener(`pointercancel`,o)};n.addEventListener(`pointermove`,a),n.addEventListener(`pointerup`,o),n.addEventListener(`pointercancel`,o)},b=(0,v.useRef)(null),x=e.frameRef??b,S=(0,v.useRef)(null),[C,w]=(0,v.useState)(16);(0,v.useEffect)(()=>{let e=S.current;if(!e||typeof ResizeObserver>`u`)return;let t=()=>w(Math.ceil(e.getBoundingClientRect().height));t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let T=(0,v.useRef)(null),E=(0,v.useRef)(null),D=(0,v.useRef)(!1),ee=e=>{D.current=!0,n(e)};(0,v.useEffect)(()=>{D.current&&e.asideBeside&&(D.current=!1,(t?T:E).current?.focus())},[t,e.asideBeside]);let[te,ne]=(0,v.useState)(e.reveal),O=t;e.reveal!==te&&(ne(e.reveal),e.reveal&&!t&&(n(!0),O=!0));let re=e.toolbarIn&&!e.full?e.toolbarIn:void 0,k=(0,v.useRef)(e.full);return(0,v.useEffect)(()=>{if(k.current&&!e.full&&Hl(e.toolbarIn??x.current),k.current=e.full,!e.full||typeof document>`u`)return;let t=x.current;t&&!t.contains(document.activeElement)&&t.focus();let n=e=>{t&&!t.contains(e.target)&&t.focus()};return document.addEventListener(`focusin`,n),()=>document.removeEventListener(`focusin`,n)},[e.full,x]),(0,j.jsxs)(`div`,{ref:x,className:`viewer ${e.full?`viewer-full`:``} ${e.className??``}`,role:`region`,tabIndex:0,"aria-label":yl.region(e.title),onKeyDown:t=>{if(e.full&&t.key===`Tab`&&x.current){let e=x.current,n=Bl([...e.querySelectorAll(Ul)].filter(t=>t!==e&&!t.closest(`[hidden]`)&&t.getClientRects().length>0),document.activeElement,t.shiftKey,e);n&&(t.preventDefault(),n.focus());return}let n=t.target;if(n.tagName===`INPUT`||n.tagName===`TEXTAREA`||n.tagName===`SELECT`||n.isContentEditable||n.closest?.(`.viewer-aside, .viewer-own`))return;let r=Il(t);r&&(r.startsWith(`pan-`)&&n.closest?.(`.react-flow__node`)||(r!==`leave`||e.full)&&(t.preventDefault(),e.onKeyAction(r)))},...e.full?{"aria-modal":!0}:{},children:[re?(0,vl.createPortal)(e.toolbar,re):e.toolbar,e.full&&(0,j.jsx)(`p`,{className:`sr`,role:`status`,children:yl.fullScreenOn}),(0,j.jsxs)(`div`,{ref:i,className:`viewer-stage${e.aside&&e.asideBeside?` beside`:``}`,style:e.full?void 0:{height:ql(e.height,C)},children:[e.children,e.aside&&e.asideBeside&&(0,j.jsxs)(j.Fragment,{children:[!O&&(0,j.jsx)(`button`,{ref:E,type:`button`,className:`btn viewer-aside-toggle`,"aria-expanded":!1,"aria-controls":r,onClick:()=>ee(!0),children:yl.showDetails}),O&&(0,j.jsx)(`div`,{role:`separator`,tabIndex:0,className:`viewer-aside-resize`,"aria-orientation":`vertical`,"aria-controls":r,"aria-label":yl.resizeDetails,"aria-valuemin":bl.min,"aria-valuemax":p,"aria-valuenow":m,"aria-valuetext":`${m} px`,onKeyDown:_,onPointerDown:y,onDoubleClick:()=>h(void 0)}),(0,j.jsxs)(`aside`,{id:r,ref:a,className:`viewer-aside`,"aria-label":yl.details,hidden:!O,style:o===void 0?void 0:{"--aside-w":`${Math.round(o)}px`},children:[(0,j.jsxs)(`div`,{className:`viewer-aside-head`,children:[(0,j.jsx)(`button`,{type:`button`,className:`btn viewer-btn viewer-aside-widen`,"aria-pressed":g,onClick:()=>h(g?void 0:Tl(c,u)),children:yl.widenDetails}),(0,j.jsx)(`button`,{ref:T,type:`button`,className:`btn viewer-btn viewer-aside-close`,"aria-expanded":!0,"aria-controls":r,"aria-label":yl.hideDetails,title:yl.hideDetails,onClick:()=>ee(!1),children:(0,j.jsx)(Ql,{d:$l.close})})]}),e.aside]})]}),e.aside&&!e.asideBeside&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`button`,{type:`button`,className:`btn viewer-aside-toggle`,"aria-expanded":O,"aria-controls":r,onClick:()=>n(e=>!e),children:O?yl.hideDetails:yl.showDetails}),(0,j.jsx)(`aside`,{id:r,className:`viewer-aside`,"aria-label":yl.details,hidden:!O,children:e.aside})]})]}),(0,j.jsx)(`p`,{ref:S,className:`viewer-keys`,children:yl.keys})]})}var nu=()=>typeof window<`u`&&(typeof window.matchMedia==`function`?window.matchMedia(`(max-width: 1000px)`).matches:window.innerWidth<=1e3),ru=w.flowView;function iu(e,t=5){return e.length<=t?e.join(`, `):ru.andMore(e.slice(0,t).join(`, `),e.length-t)}function au(e){let t=[...new Set(e.filter(e=>!!e&&!!e.trim()))];return t.length?` (${iu(t)})`:``}var ou=(e,t=0)=>t?`${e} · ${t} inside`:e,su=6.6,cu=22,lu=10,uu=96,du=24,fu=10,pu=24,mu=16,hu=e=>Math.max(64,Math.ceil(e.length*su)+18),gu=e=>(Math.round(e*10)/10).toString();function _u(e){let t=new Map;for(let n of e.edges)n.from===n.to&&t.set(n.from,(t.get(n.from)??0)+1);let n=t=>{let n=e.nodes.find(e=>e.id===t);return n?.group?`group:${n.group}`:`node:${t}`},r=[...e.nodes.filter(e=>!e.group).map(e=>`node:${e.id}`),...e.groups.filter(t=>e.nodes.some(e=>e.group===t.id)).map(e=>`group:${e.id}`)].sort(),i=new Map(r.map(e=>[e,new Set]));for(let t of e.edges){let e=n(t.from),r=n(t.to);e!==r&&i.has(e)&&i.has(r)&&i.get(r).add(e)}let a=new Map;for(;a.size<r.length;){let e=r.filter(e=>!a.has(e)),t=e.filter(e=>[...i.get(e)].every(e=>a.has(e)));if(!t.length){let n=e=>[...i.get(e)].filter(e=>!a.has(e)).length;t=[e.reduce((e,t)=>n(t)<n(e)?t:e)]}for(let e of t)a.set(e,Math.max(0,...[...i.get(e)].filter(e=>a.has(e)).map(e=>a.get(e)+1)))}let o=new Map,s=new Map;for(let n of r){if(n.startsWith(`node:`)){let r=e.nodes.find(e=>`node:${e.id}`===n);s.set(n,{w:hu(ou(r.label,t.get(r.id))),h:cu});continue}let r=e.groups.find(e=>`group:${e.id}`===n),i=e.nodes.filter(e=>e.group===r.id),a=Math.ceil(i.length/mu),c=Math.ceil(i.length/a),l=Math.max(...i.map(e=>hu(e.label)));o.set(n,i.map((e,t)=>({id:e.id,col:Math.floor(t/c),row:t%c,w:l}))),s.set(n,{w:Math.max(hu(r.label)+12,a*l+(a-1)*lu+20),h:pu+c*cu+(c-1)*lu+fu})}let c=[...new Set(a.values())].sort((e,t)=>e-t),l=new Map,u=du,d=0,f=[];for(let e of c){let t=r.filter(t=>a.get(t)===e);for(let e=0;e<t.length;e+=mu){let n=t.slice(e,e+mu),r=Math.max(...n.map(e=>s.get(e).w)),i=n.reduce((e,t)=>e+s.get(t).h,0)+(n.length-1)*lu*2;f.push({units:n,x:u,h:i}),d=Math.max(d,i),u+=r+uu}}for(let e of f){let t=du+(d-e.h)/2;for(let n of e.units){let r=s.get(n);l.set(n,{x:e.x,y:t,w:r.w,h:r.h}),t+=r.h+20}}let p=new Map,m=new Map;for(let e of r){let t=l.get(e);if(e.startsWith(`node:`))p.set(e.slice(5),t);else{m.set(e.slice(6),t);for(let n of o.get(e))p.set(n.id,{x:t.x+fu+n.col*(n.w+lu),y:t.y+pu+n.row*32,w:n.w,h:cu})}}let h=e.edges.filter(e=>e.from!==e.to&&p.has(e.from)&&p.has(e.to)).map(e=>{let t=p.get(e.from),n=p.get(e.to),r=t.y+t.h/2,i=n.y+n.h/2,a;if(n.x>t.x+t.w){let e=t.x+t.w,o=(e+n.x)/2;a=`M${gu(e)} ${gu(r)} C${gu(o)} ${gu(r)} ${gu(o)} ${gu(i)} ${gu(n.x)} ${gu(i)}`}else{let e=Math.max(0,Math.min(t.x,n.x)-40);a=`M${gu(t.x)} ${gu(r)} C${gu(e)} ${gu(r)} ${gu(e)} ${gu(i)} ${gu(n.x)} ${gu(i)}`}return{id:e.id,from:e.from,to:e.to,label:e.label,async:e.async,d:a}}),g=[...p.values(),...m.values()];return{width:Math.max(320,...g.map(e=>e.x+e.w+du)),height:Math.max(160,...g.map(e=>e.y+e.h+du)),nodes:p,groups:m,edges:h,inside:t}}var vu=.6,yu=960;function bu({view:e,height:t,selected:n,highlight:r=[],onPick:i,initialFull:a,initialFocus:o}){let s=(0,v.useMemo)(()=>_u(e),[e]),[c,l]=(0,v.useState)(n),[u,d]=Wl(a),[f,p]=(0,v.useState)(!!o),m=(0,v.useRef)(null),h=(0,v.useRef)(null),g=(0,v.useRef)(null),_=Xl(m,{min:t??420}),[y,b]=(0,v.useState)({width:yu,height:_}),x={x:0,y:0,w:s.width,h:s.height},S=e=>jl(x,e,{min:vu}),[C,T]=(0,v.useState)(()=>S({width:yu,height:_})),E=(0,v.useRef)(!1);(0,v.useEffect)(()=>{let e=h.current;if(!e||typeof window>`u`)return;let t=()=>{let t=e.getBoundingClientRect();if(!t.width||!t.height)return;let n={width:t.width,height:t.height};b(n),E.current||(E.current=!0,T(jl({x:0,y:0,w:s.width,h:s.height},n,{min:vu})))};t();let n=typeof ResizeObserver>`u`?void 0:new ResizeObserver(t);return n?.observe(e),window.addEventListener(`resize`,t),()=>{n?.disconnect(),window.removeEventListener(`resize`,t)}},[s,u]),(0,v.useEffect)(()=>{E.current=!1},[s]),(0,v.useEffect)(()=>{let e=h.current;if(!e)return;let t=t=>{t.preventDefault();let n=e.getBoundingClientRect(),r={x:t.clientX-n.left,y:t.clientY-n.top};T(e=>Nl(e,Fl(t.deltaY,t.deltaMode),r))};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[]);let D=(0,v.useRef)(new Map),[ee,te]=(0,v.useState)(!1),ne=e=>{e.target.closest?.(`[data-node]`)||(D.current.set(e.pointerId,{x:e.clientX,y:e.clientY}),e.currentTarget.setPointerCapture?.(e.pointerId),te(!0))},O=e=>{let t=D.current,n=t.get(e.pointerId);if(n){if(t.size===2){let[r,i]=[...t.values()],a=r===n?i:r,o=Math.hypot(n.x-a.x,n.y-a.y),s=Math.hypot(e.clientX-a.x,e.clientY-a.y),c=e.currentTarget.getBoundingClientRect(),l={x:(e.clientX+a.x)/2-c.left,y:(e.clientY+a.y)/2-c.top};o>0&&T(e=>Nl(e,s/o,l))}else{let t=e.clientX-n.x,r=e.clientY-n.y;T(e=>({...e,x:e.x+t,y:e.y+r}))}t.set(e.pointerId,{x:e.clientX,y:e.clientY})}},re=e=>{D.current.delete(e.pointerId),D.current.size||te(!1)},k=new Set(r),A=e=>c!==void 0&&(e.from===c||e.to===c),ie=t=>e.nodes.find(e=>e.id===t)?.label??t,ae=c?s.edges.filter(A):[],oe=f&&c?zl(s.edges,c):void 0,se=(e,t=Math.max(C.k,1))=>T(Pl(C,e,y,Al(t))),ce=e=>{let t=s.nodes.get(e);return t?{x:t.x,y:t.y,w:t.w,h:t.h}:void 0},M=e=>{let t={x:y.width/2,y:y.height/2};switch(e){case`zoom-in`:return T(e=>Nl(e,Ol.step,t));case`zoom-out`:return T(e=>Nl(e,1/Ol.step,t));case`reset`:return T(e=>Nl(e,1/e.k,t));case`fit`:return T(S(y));case`fit-selection`:{let e=c?ce(c):void 0;e&&se(e,Math.max(C.k,1.2));return}case`focus`:return p(e=>!e);case`full-screen`:E.current=!1,d(),requestAnimationFrame(()=>m.current?.focus());return;case`leave`:return E.current=!1,d(!1);case`search`:return g.current?.focus();default:return T(t=>Ll(t,e))}},le=e=>{l(e),i?.(e);let t=ce(e);t&&se(t)},ue=e.nodes.length>12;return(0,j.jsxs)(`div`,{style:{display:`grid`,gap:8},children:[(0,j.jsx)(tu,{title:e.title,full:u,height:_,frameRef:m,onKeyAction:M,toolbar:(0,j.jsx)(eu,{zoom:C.k,full:u,focus:f,picked:!!c,nodes:e.nodes,onAction:M,onFind:le,searchRef:g}),children:(0,j.jsxs)(`div`,{ref:h,className:`flow-canvas ${ee?`panning`:``}`,onPointerDown:ne,onPointerMove:O,onPointerUp:re,onPointerCancel:re,children:[(0,j.jsxs)(`svg`,{role:`group`,"aria-label":ru.nodesInGroupsEdges(e.title,e.nodes.length,e.groups.length,e.edges.length),width:`100%`,height:`100%`,style:{display:`block`},children:[(0,j.jsx)(`defs`,{children:(0,j.jsx)(`marker`,{id:`flow-arrow`,viewBox:`0 0 8 8`,refX:`7`,refY:`4`,markerWidth:`7`,markerHeight:`7`,orient:`auto`,children:(0,j.jsx)(`path`,{d:`M0 0 L8 4 L0 8 z`,fill:`var(--accent)`})})}),(0,j.jsxs)(`g`,{transform:`translate(${gu(C.x)} ${gu(C.y)}) scale(${Math.round(C.k*1e3)/1e3})`,children:[e.groups.map(e=>{let t=s.groups.get(e.id);return t?(0,j.jsxs)(`g`,{children:[(0,j.jsx)(`rect`,{x:t.x,y:t.y,width:t.w,height:t.h,rx:8,fill:`var(--wash)`,stroke:`var(--accent)`,strokeOpacity:.35,strokeDasharray:e.kind===`datastore`?void 0:`3 4`}),(0,j.jsx)(`text`,{x:t.x+fu,y:t.y+16,fontFamily:`Rajdhani, sans-serif`,fontWeight:700,fontSize:12,letterSpacing:`0.08em`,fill:`var(--flow-label)`,children:e.label})]},`group-${e.id}`):null}),(0,j.jsx)(`g`,{fill:`none`,children:s.edges.map(e=>(0,j.jsx)(`path`,{d:e.d,stroke:A(e)?`var(--accent-soft)`:`var(--accent)`,strokeOpacity:c===void 0?.45:A(e)?1:oe?.06:.12,strokeWidth:(A(e)?1.6:1)/Math.max(.5,Math.min(1,C.k)),strokeDasharray:e.async?`5 4`:void 0,markerEnd:`url(#flow-arrow)`,children:(0,j.jsx)(`title`,{children:`${ie(e.from)} → ${ie(e.to)}${e.label?`: ${e.label}`:``}`})},e.id))}),e.nodes.map(e=>{let t=s.nodes.get(e.id);if(!t)return null;let n=c===e.id;return(0,j.jsxs)(`g`,{"data-node":e.id,tabIndex:0,role:`button`,"aria-label":`${e.label} (${e.kind})`,"aria-pressed":n,className:`flow-node`,opacity:oe&&!oe.has(e.id)?.2:1,style:{cursor:`pointer`},onMouseEnter:()=>l(e.id),onFocus:()=>l(e.id),onClick:()=>{l(n?void 0:e.id),i?.(e.id)},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),l(n?void 0:e.id),i?.(e.id))},children:[(0,j.jsx)(`rect`,{x:t.x,y:t.y,width:t.w,height:t.h,rx:e.kind===`table`?3:e.kind===`topic`?t.h/2:6,fill:n?`var(--picked-on)`:k.has(e.id)?`var(--picked-strong)`:`var(--box)`,stroke:n||k.has(e.id)?`var(--accent-soft)`:e.kind===`table`?`var(--flow-table)`:`var(--accent)`,strokeDasharray:e.kind===`topic`?`4 3`:void 0,strokeWidth:n?1.6:1}),(0,j.jsx)(`text`,{x:t.x+9,y:t.y+15,fontFamily:`JetBrains Mono, monospace`,fontSize:11,fill:n?`var(--text)`:`var(--accent-pale)`,children:ou(e.label,s.inside.get(e.id))})]},e.id)})]})]}),ue&&(0,j.jsx)(xu,{l:s,v:C,size:y,onCentre:e=>se(e,C.k)})]})}),(0,j.jsxs)(`p`,{className:`muted`,style:{fontSize:12,margin:0},"aria-live":`polite`,children:[c?ru.edgePointAtAnother(ie(c),ae.length,ae.length===1?``:`s`,au(ae.map(e=>e.label)),s.inside.get(c)?ru.callsInsideIt(s.inside.get(c)??0):``):e.type===`context`&&e.nodes.length===1?ru.everythingHereIsOne:ru.edgesPointAtA(s.edges.length),f&&c?` ${w.viewer.focusOn(ie(c))}`:``]})]})}function xu(e){let t=160/Math.max(1,e.l.width),n=Math.max(40,Math.round(e.l.height*t)),r={x:-e.v.x/e.v.k,y:-e.v.y/e.v.k,w:e.size.width/e.v.k,h:e.size.height/e.v.k};return(0,j.jsx)(`div`,{className:`flow-minimap`,"aria-hidden":`true`,"data-node":`minimap`,onPointerDown:n=>{let r=n.currentTarget.getBoundingClientRect(),i=(n.clientX-r.left)/t,a=(n.clientY-r.top)/t;e.onCentre({x:i,y:a,w:0,h:0})},children:(0,j.jsxs)(`svg`,{width:160,height:n,children:[[...e.l.nodes.values()].map((e,n)=>(0,j.jsx)(`rect`,{x:e.x*t,y:e.y*t,width:Math.max(1,e.w*t),height:Math.max(1,e.h*t),fill:`var(--minimap-node)`},n)),(0,j.jsx)(`rect`,{x:r.x*t,y:r.y*t,width:r.w*t,height:r.h*t,fill:`none`,stroke:`var(--accent)`,strokeWidth:1.5})]})})}var Su=w.graph,Cu=new Set([`event-bus`,`pubsub`,`mq`]),wu={System:`system`,Component:`component`,Table:`table`,Endpoint:`topic`};function Tu(e,t=Su.map){let n=new Set(e.nodes.map(e=>e.system).filter(e=>!!e)),r=e.nodes.filter(e=>e.kind===`System`&&n.has(e.id)).map(e=>({id:e.id,label:e.label||e.id,kind:`system`})),i=new Set(r.map(e=>e.id)),a=e.nodes.filter(e=>!i.has(e.id)).map(e=>({id:e.id,label:e.label||e.id,kind:wu[e.kind]??`box`,...e.system&&i.has(e.system)?{group:e.system}:{}})),o=new Map;for(let t of e.edges){if(i.has(t.from)||i.has(t.to))continue;let e=`${t.from}\u0000${t.to}\u0000${t.via}`,n=o.get(e);n?n.n++:o.set(e,{id:t.id,from:t.from,to:t.to,via:t.via,n:1})}return{type:`context`,title:t,groups:r,nodes:a,edges:[...o.values()].map(e=>({id:e.id,from:e.from,to:e.to,label:e.n>1?`${e.n} × ${e.via}`:e.via,async:Cu.has(e.via)}))}}function Eu({g:e,focus:t,highlight:n=[],onPick:r,height:i=430}){let a=(0,v.useMemo)(()=>Tu(e),[e]);return(0,j.jsx)(bu,{view:a,height:i,...t?{selected:t}:{},highlight:n,...r?{onPick:r}:{}},t??``)}var Du=w.setup;function Ou({edit:e}){return e.changes.length?(0,j.jsx)(`ul`,{"aria-label":Du.diffLabel(e.path),className:`mono`,style:{listStyle:`none`,margin:0,padding:8,fontSize:12,background:`var(--box)`,border:`1px solid var(--line-2)`,borderRadius:8,maxHeight:320,overflow:`auto`,whiteSpace:`pre-wrap`,wordBreak:`break-all`},children:e.changes.flatMap((e,t)=>[...e.was===void 0?[]:[(0,j.jsxs)(`li`,{style:{color:`var(--magenta-text)`},children:[(0,j.jsxs)(`span`,{className:`sr`,children:[Du.removed,`: `]}),`- ${e.was}`]},`${t}-was`)],...e.now===void 0?[]:[(0,j.jsxs)(`li`,{style:{color:`var(--green)`},children:[(0,j.jsxs)(`span`,{className:`sr`,children:[Du.added,`: `]}),`+ ${e.now}`]},`${t}-now`)]])}):(0,j.jsx)(`p`,{className:`work-say`,children:Du.nothingChanges})}function ku(e){let t=Vn(),n=Vn(),r=(0,v.useId)(),[i,a]=(0,v.useState)(),[o,s]=(0,v.useState)();return o?(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,j.jsx)(`p`,{role:`status`,className:`work-say`,style:{margin:0},children:`${Du.written(o.path)} ${o.note}`}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:Du.thenPropose}),(0,j.jsx)(Yc,{scope:`org-pack`})]}):i?(0,j.jsxs)(`section`,{className:`stack`,style:{gap:6},"aria-labelledby":`${r}-t`,children:[(0,j.jsx)(`h4`,{id:`${r}-t`,className:`hud`,style:{margin:0,fontSize:11},children:Du.willChange(i.path)}),(0,j.jsx)(Ou,{edit:i}),i.confirm&&(0,j.jsx)(`p`,{className:`state`,role:`note`,style:{margin:0},children:Du.confirmAddress}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:n.busy||!i.changes.length,onClick:()=>void n.run(async()=>{let t=await e.write(i.confirm);return s(t),e.onWritten?.(t),t},Du.written(i.path)),children:n.busy?Du.writing:Du.write}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>a(void 0),children:Du.cancel})]}),(0,j.jsx)(Wn,{note:n.note})]}):(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`div`,{className:`row`,style:{gap:6},children:(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:t.busy||e.disabled===!0,onClick:()=>void t.run(async()=>a(await e.preview()),``),children:t.busy?Du.previewing:e.label??Du.preview})}),t.note&&!t.note.ok&&(0,j.jsx)(Wn,{note:t.note})]})}var Au=w.setup;function ju({path:e,onClose:t}){let n=P(`/api/setup/file?path=${encodeURIComponent(e)}`),[r,i]=(0,v.useState)(),[a,o]=(0,v.useState)(0),s=`raw-${e.replace(/[^a-z0-9]+/gi,`-`)}`;return(0,j.jsxs)(`section`,{className:`stack`,style:{gap:6},"aria-labelledby":`${s}-t`,onKeyDown:Dt(t),children:[(0,j.jsx)(`h4`,{id:`${s}-t`,className:`hud`,style:{margin:0,fontSize:11},children:Au.rawTitle(n.state===`ready`?n.data.path:e)}),(0,j.jsx)(I,{of:n,children:e=>{let c=(t,n)=>async()=>N(`/api/setup/file`,{method:`PUT`,body:{path:e.rel,content:r??e.content,baseSha256:e.sha256,...t?{preview:!0}:{},...n?await Jn(n,`model`):{}}});return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,j.jsxs)(`p`,{className:`muted`,style:{margin:0,fontSize:12},id:`${s}-hint`,children:[e.checked?Au.rawHint:Au.rawUnchecked,` `,e.exists?``:Au.rawNew]}),(0,j.jsx)(`label`,{htmlFor:s,className:`sr`,children:Au.rawText(e.path)}),(0,j.jsx)(`textarea`,{id:s,className:`field mono`,rows:16,spellCheck:!1,"aria-describedby":`${s}-hint`,value:r??e.content,onChange:e=>{i(e.target.value),o(a+1)},style:{width:`100%`,font:`12.5px/1.6 var(--mono)`}}),(0,j.jsx)(ku,{disabled:r===void 0||r===e.content,preview:()=>c(!0)(),write:e=>c(!1,e)(),onWritten:()=>n.reload()},a),(0,j.jsx)(`div`,{className:`row`,children:(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:t,children:Au.close})})]})}})]})}function Mu({path:e,label:t}){let[n,r]=(0,v.useState)(!1);return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`,alignItems:`center`},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,"aria-expanded":n,"aria-label":Au.editFile(e),onClick:()=>r(!n),children:t??Au.editInApp}),(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:Au.noForm})]}),n&&(0,j.jsx)(ju,{path:e,onClose:()=>r(!1)})]})}function Nu(){let[e,t]=(0,v.useState)(``),[n,r]=(0,v.useState)();return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,j.jsxs)(`form`,{className:`row`,style:{gap:8,flexWrap:`wrap`,alignItems:`flex-end`},onSubmit:t=>{t.preventDefault(),e.trim()&&r(e.trim())},children:[(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4,flex:1,minWidth:220},children:[(0,j.jsx)(`label`,{htmlFor:`raw-pick`,children:Au.rawPick}),(0,j.jsx)(`input`,{id:`raw-pick`,className:`field mono`,value:e,"aria-describedby":`raw-pick-hint`,onChange:e=>t(e.target.value)})]}),(0,j.jsx)(`button`,{type:`submit`,className:`btn`,disabled:!e.trim(),children:Au.open})]}),(0,j.jsx)(`span`,{id:`raw-pick-hint`,className:`muted`,style:{fontSize:12},children:Au.rawPickHint}),n&&(0,j.jsx)(ju,{path:n,onClose:()=>r(void 0)},n)]})}var Pu=w.setup,Fu=[`sync`,`async`,`data-access`],Iu=[`gateway`,`direct`,`event-bus`,`pubsub`,`sftp`,`mq`,`jdbc`,`other`],Lu=[`product`,`internal`,`vendor`,`data-store`],Ru=[`to-review`,`confirmed`,`deprecated`],zu=[`markdown-folder`,`git`,`ado-wiki`,`confluence`,`sharepoint`,`confluence-export`,`sharepoint-export`];function Bu(e){let t=e.hint?`${e.id}-hint`:void 0;return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`label`,{htmlFor:e.id,children:e.label}),e.options?(0,j.jsx)(`select`,{id:e.id,className:`field`,value:e.value,"aria-describedby":t,onChange:t=>e.set(t.target.value),children:e.options.map(e=>(0,j.jsx)(`option`,{value:e,children:e},e))}):e.long?(0,j.jsx)(`textarea`,{id:e.id,className:`field`,rows:2,value:e.value,"aria-describedby":t,onChange:t=>e.set(t.target.value)}):(0,j.jsx)(`input`,{id:e.id,className:`field mono`,value:e.value,"aria-describedby":t,onChange:t=>e.set(t.target.value)}),e.hint&&(0,j.jsx)(`span`,{id:t,className:`muted`,style:{fontSize:12},children:e.hint})]})}function Vu(){let[e,t]=(0,v.useState)({code:``,name:``,definition:``,interaction:`sync`,route:`gateway`,targetType:`internal`,controls:``,source:``,status:`to-review`}),[n,r]=(0,v.useState)(0),i=i=>a=>{t({...e,[i]:a}),r(n+1)},a=t=>({...e,controls:e.controls.split(`,`).map(e=>e.trim()).filter(Boolean),...t?{preview:!0}:{}}),o=!!(e.code.trim()&&e.name.trim()&&e.definition.trim()&&e.source.trim());return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,j.jsx)(Bu,{id:`pattern-code`,label:Pu.code,hint:Pu.codeHint,value:e.code,set:i(`code`)}),(0,j.jsx)(Bu,{id:`pattern-name`,label:Pu.patternName,value:e.name,set:i(`name`)}),(0,j.jsx)(Bu,{id:`pattern-definition`,label:Pu.definition,value:e.definition,set:i(`definition`),long:!0}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`},children:[(0,j.jsx)(Bu,{id:`pattern-interaction`,label:Pu.interaction,value:e.interaction,set:i(`interaction`),options:Fu}),(0,j.jsx)(Bu,{id:`pattern-route`,label:Pu.route,value:e.route,set:i(`route`),options:Iu}),(0,j.jsx)(Bu,{id:`pattern-target`,label:Pu.targetType,value:e.targetType,set:i(`targetType`),options:Lu}),(0,j.jsx)(Bu,{id:`pattern-status`,label:Pu.status,value:e.status,set:i(`status`),options:Ru})]}),(0,j.jsx)(Bu,{id:`pattern-controls`,label:Pu.controls,value:e.controls,set:i(`controls`)}),(0,j.jsx)(Bu,{id:`pattern-source`,label:Pu.source,hint:Pu.sourceHint,value:e.source,set:i(`source`)}),(0,j.jsx)(ku,{disabled:!o,preview:()=>N(`/api/setup/patterns`,{method:`POST`,body:a(!0)}),write:()=>N(`/api/setup/patterns`,{method:`POST`,body:a(!1)})},n)]})}function Hu(){let[e,t]=(0,v.useState)({type:`markdown-folder`,location:``,path:``,ref:``}),[n,r]=(0,v.useState)(0),i=i=>a=>{t({...e,[i]:a}),r(n+1)},a=t=>({type:e.type,location:e.location.trim(),...e.type===`git`&&e.path.trim()?{path:e.path.trim()}:{},...e.type===`git`&&e.ref.trim()?{ref:e.ref.trim()}:{},...t?{preview:!0}:{}});return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,j.jsx)(Bu,{id:`wiki-type`,label:Pu.wikiType,value:e.type,set:i(`type`),options:zu}),(0,j.jsx)(Bu,{id:`wiki-location`,label:Pu.location,hint:Pu.locationHint,value:e.location,set:i(`location`)}),e.type===`git`&&(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`},children:[(0,j.jsx)(Bu,{id:`wiki-path`,label:Pu.wikiPath,value:e.path,set:i(`path`)}),(0,j.jsx)(Bu,{id:`wiki-ref`,label:Pu.wikiRef,value:e.ref,set:i(`ref`)})]}),(0,j.jsx)(ku,{disabled:!e.location.trim(),preview:()=>N(`/api/setup/sources`,{method:`POST`,body:a(!0)}),write:()=>N(`/api/setup/sources`,{method:`POST`,body:a(!1)})},n)]})}function Uu(){return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(F,{title:Pu.patternTitle,span:`span 6`,children:(0,j.jsx)(Vu,{})}),(0,j.jsx)(F,{title:Pu.wikiTitle,span:`span 6`,children:(0,j.jsx)(Hu,{})}),(0,j.jsx)(F,{title:Pu.rawPickTitle,span:`span 12`,children:(0,j.jsx)(Nu,{})})]})}var H=w.know,Wu={verified:{bg:`var(--cov-verified)`,label:H.verifiedFromCode},"document-only":{bg:`var(--cov-doc)`,label:H.fromDocumentsOnly},unknown:{bg:`var(--cov-unknown)`,label:`unknown`}};function Gu({system:e,link:t}){let n=P(`/api/guide/${encodeURIComponent(e)}`);return(0,j.jsx)(F,{title:H.guide(e),span:`1 / -1`,meta:t?(0,j.jsx)(`a`,{href:`#/systems?system=${encodeURIComponent(e)}`,children:w.systems.openPage}):H.generatedFromTheCatalog,children:(0,j.jsx)(I,{of:n,children:t=>(0,j.jsx)(`div`,{tabIndex:0,role:`region`,"aria-label":H.guideTo(e),style:{maxHeight:560,overflowY:`auto`,paddingRight:6},children:(0,j.jsx)(zn,{text:t.markdown})})})})}function Ku(e){let t=t=>e.facts.filter(e=>e.kind===t),n=new Set(t(`store`).map(e=>`${e.claim.store??``}.${e.claim.name??``}`));return{repo:e.repo,entries:t(`entry`).length,tables:n.size,calls:t(`call`).length,flows:t(`flow`).length}}function qu(e){let t=P(e?`/api/trust`:void 0),[n,r]=(0,v.useState)({state:`loading`}),i=t.state===`ready`?t.data.repos.filter(e=>e.facts.present).map(e=>e.repo).join(` `):void 0,a=t.state===`error`?t.error:void 0;return(0,v.useEffect)(()=>{if(a!==void 0)return r({state:`error`,error:a});if(i===void 0)return;let e=!0;return Promise.all(i.split(` `).filter(Boolean).map(e=>N(`/api/facts/${encodeURIComponent(e)}`))).then(t=>e&&r({state:`ready`,data:t.map(Ku)}),t=>e&&r({state:`error`,error:t instanceof Error?t.message:String(t)})),()=>{e=!1}},[i,a]),n}function Ju({of:e}){let t=H.factsByRepo;return(0,j.jsx)(I,{of:e,empty:e=>e.length===0,emptyContent:(0,j.jsx)(hl,{text:t.none}),children:e=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,j.jsxs)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:[t.intro,` `,(0,j.jsx)(`a`,{href:`#/trust`,children:w.work.openTrust})]}),(0,j.jsx)(Gn,{caption:t.caption,rows:e,rowKey:e=>e.repo,cols:[{label:t.repo,cell:e=>e.repo,mono:!0},{label:t.entries,cell:e=>e.entries},{label:t.tables,cell:e=>e.tables},{label:t.calls,cell:e=>e.calls},{label:t.flows,cell:e=>e.flows}]})]})})}function Yu(){let e=P(`/api/graph`),t=Mn(`coverage`),n=Mn(`questions`),r=P(`/api/catalog/kinds`),i=r.state===`ready`&&!r.data.some(e=>e.kind===`System`&&e.count>0),a=qu(i),[o,s]=(0,v.useState)();return(0,j.jsxs)(`div`,{className:`bento`,children:[(0,j.jsx)(F,{title:o?H.around(o):H.ecosystemMap,kind:`hero`,span:`1 / -1`,meta:o?(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>s(void 0),children:H.showAll}):H.clickANodeTo,children:(0,j.jsx)(I,{of:e,empty:e=>e.nodes.length===0,emptyContent:(0,j.jsx)(hl,{text:H.theCatalogIsEmpty}),children:e=>(0,j.jsx)(Eu,{g:e,...o?{focus:o}:{},onPick:s,height:520})})}),(0,j.jsx)(F,{title:H.systems,span:`span 4`,rows:`span 2`,children:(0,j.jsx)(I,{of:t,empty:e=>e.systems.length===0,emptyText:H.noSystemsYet,children:e=>(0,j.jsx)(`div`,{className:`stack`,children:e.systems.map(e=>{let t=e.verified+e.documentOnly+e.unknown;return(0,j.jsxs)(`button`,{type:`button`,onClick:()=>s(e.system),className:`stack`,style:{gap:4,background:`transparent`,border:0,color:`inherit`,textAlign:`left`,font:`inherit`,cursor:`pointer`,padding:`6px 0`,borderBottom:`1px solid var(--rule)`},children:[(0,j.jsxs)(`span`,{className:`row between`,children:[(0,j.jsx)(`span`,{className:`mono`,style:{fontSize:12.5},children:e.system}),(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:9.5},children:H.verified(e.verified,t,e.gaps?H.gaps(e.gaps):``)})]}),(0,j.jsx)(Rt,{value:e.verified,max:Math.max(t,1),label:H.factsVerifiedFromCode(e.system)})]},e.system)})})})}),o&&t.state===`ready`&&t.data.systems.some(e=>e.system===o)&&(0,j.jsx)(Gu,{system:o,link:!0}),(0,j.jsx)(F,{title:H.whatTheCatalogKnows,span:`span 8`,children:i?(0,j.jsx)(Ju,{of:a}):(0,j.jsx)(I,{of:t,empty:e=>e.systems.length===0,emptyText:H.noSystemsYet,children:e=>{let t=[...new Set(e.systems.flatMap(e=>e.areas.map(e=>e.area)))];return(0,j.jsxs)(`div`,{style:{overflowX:`auto`,position:`relative`},tabIndex:0,role:`region`,"aria-label":w.app.scrollTable(H.coverageBySystemAnd2),children:[(0,j.jsxs)(`table`,{style:{borderCollapse:`separate`,borderSpacing:4,width:`100%`,fontSize:11},children:[(0,j.jsx)(`caption`,{className:`sr`,children:H.coverageBySystemAnd}),(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{}),t.map(e=>(0,j.jsx)(`th`,{className:`hud`,style:{fontSize:9.5,fontWeight:400,textAlign:`center`},children:e},e))]})}),(0,j.jsx)(`tbody`,{children:e.systems.map(e=>(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{className:`mono`,style:{textAlign:`left`,fontWeight:400,paddingRight:8},children:e.system}),t.map(t=>{let n=e.areas.find(e=>e.area===t);if(!n)return(0,j.jsx)(`td`,{title:H.notExpected2(e.system,t),children:(0,j.jsx)(`span`,{className:`sr`,children:H.notExpected})},t);let r=Wu[n.state]??Wu.unknown;return(0,j.jsxs)(`td`,{title:`${e.system} · ${n.area}: ${r.label}${n.records.length?` (${n.records.length})`:``}`,style:{background:r.bg,height:26,borderRadius:4,textAlign:`center`,border:`1px solid var(--cov-line)`},children:[(0,j.jsx)(`span`,{className:`sr`,children:r.label}),n.records.length?(0,j.jsx)(`span`,{"aria-hidden":`true`,children:n.records.length}):null]},n.area)})]},e.system))})]}),(0,j.jsx)(`div`,{className:`row`,style:{gap:14,marginTop:8,flexWrap:`wrap`},children:Object.entries(Wu).map(([e,t])=>(0,j.jsxs)(`span`,{className:`row`,style:{gap:6,fontSize:11.5},children:[(0,j.jsx)(`span`,{"aria-hidden":`true`,style:{width:12,height:12,borderRadius:3,background:t.bg,display:`inline-block`}}),t.label]},e))})]})}})}),(0,j.jsx)(F,{title:H.questionsForOwners,span:`span 4`,meta:n.state===`ready`?n.data.questions.length:void 0,children:(0,j.jsx)(I,{of:n,empty:e=>e.questions.length===0,emptyText:H.noOpenQuestionsEvery,children:e=>(0,j.jsxs)(`ul`,{tabIndex:0,"aria-label":H.questionsForOwners,style:{listStyle:`none`,margin:0,padding:0,maxHeight:300,overflowY:`auto`},className:`stack`,children:[e.questions.slice(0,12).map(e=>(0,j.jsxs)(`li`,{className:`stack`,style:{gap:2,paddingBottom:6,borderBottom:`1px solid var(--rule)`},children:[(0,j.jsx)(`span`,{style:{fontSize:12.5},children:e.question}),(0,j.jsxs)(`span`,{className:`hud`,style:{fontSize:9.5},children:[e.system??``,e.owner?H.ask(e.owner):H.ownerUnknown]})]},e.id)),e.questions.length>12&&(0,j.jsx)(`li`,{className:`hud`,children:w.app.andMore(e.questions.length-12)})]})})})]})}function Xu(e){let t=new Map,n=new Map(e.affected.map(e=>[e.id,e.kind])),r=new Map;t.set(e.root,{id:e.root,kind:`Component`,label:e.root,status:`current`});for(let i of e.affected){t.set(i.id,{id:i.id,kind:i.kind,label:i.id,status:`current`});for(let e=1;e<i.path.length;e++){let a=i.path[e-1],o=i.path[e];t.has(a)||t.set(a,{id:a,kind:n.get(a)??H.component,label:a,status:`current`}),r.set(`${a}>${o}`,{id:`${a}>${o}`,from:a,to:o,via:``,confidence:`verified`,status:`current`})}}return{nodes:[...t.values()],edges:[...r.values()]}}function Zu({hash:e}){let t=Nn(e,`q`)??``,[n,r]=(0,v.useState)(t);(0,v.useEffect)(()=>r(t),[t]);let i=Nn(e,`incident`)===`1`,a=P(t?`/api/impact/${encodeURIComponent(t)}?depth=4`:void 0),o=P(t&&i?`/api/incident/${encodeURIComponent(t)}`:void 0),[s,c]=(0,v.useState)(!1),l=e=>{e.preventDefault(),n.trim()?(c(!1),location.hash=`#/impact?q=${encodeURIComponent(n.trim())}${i?`&incident=1`:``}`):c(!0)},u=new Map;if(a.state===`ready`)for(let e of a.data.affected)u.set(e.path.length-1,(u.get(e.path.length-1)??0)+1);let d=a.state===`ready`?Xu(a.data):void 0;return(0,j.jsxs)(`div`,{className:`bento`,children:[(0,j.jsxs)(F,{title:H.whatBreaksIfThis,span:`1 / -1`,children:[(0,j.jsxs)(`form`,{onSubmit:l,className:`row`,style:{flexWrap:`wrap`},children:[(0,j.jsx)(`label`,{htmlFor:`impact-id`,className:`sr`,children:H.recordId}),(0,j.jsx)(`input`,{id:`impact-id`,value:n,onChange:e=>{r(e.target.value),c(!1)},"aria-describedby":s?`impact-blank`:void 0,placeholder:H.aComponentInterfaceTable,style:{flex:`1 1 360px`,height:40,background:`var(--box)`,color:`var(--text)`,border:`1px solid var(--accent)`,borderRadius:10,padding:`0 12px`,font:`inherit`}}),(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,children:H.showImpact}),(0,j.jsx)(`button`,{type:`button`,className:`btn ${i?`danger`:``}`,"aria-pressed":i,onClick:()=>{n.trim()?location.hash=`#/impact?q=${encodeURIComponent(n.trim())}${i?``:`&incident=1`}`:c(!0)},children:i?H.incidentModeOn:H.incidentMode}),(0,j.jsx)(`a`,{href:`#/explore`,className:`muted`,style:{fontSize:12},children:H.findAnIdIn})]}),s&&(0,j.jsx)(`p`,{id:`impact-blank`,role:`alert`,className:`run-note bad`,children:w.app.needId})]}),t&&i&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(F,{title:H.ownersToCall,span:`span 4`,kind:`dark`,children:(0,j.jsx)(I,{of:o,children:e=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[e.call.map(e=>(0,j.jsxs)(`div`,{className:`list-row`,children:[(0,j.jsx)(`span`,{className:`chip blocking`,children:e.owner}),(0,j.jsx)(`span`,{className:`mono`,style:{fontSize:11.5},children:e.systems.join(`, `)})]},e.owner)),e.ownerUnknown.length>0&&(0,j.jsx)(`p`,{style:{margin:0,fontSize:12.5,color:`var(--amber-text)`},children:H.noOwnerRecordedFor(e.ownerUnknown.join(`, `))}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:11.5},children:H.fromTheLastScan})]})})}),(0,j.jsx)(F,{title:H.whatWatchesIt,span:`span 4`,children:(0,j.jsx)(I,{of:o,empty:e=>e.watch.length===0,emptyText:H.noAlertsDashboardsOr,children:e=>(0,j.jsx)(`ul`,{style:{margin:0,paddingLeft:18,fontSize:12.5,lineHeight:1.6},children:e.watch.map((e,t)=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`span`,{className:`chip dim`,children:e.kind}),` `,e.name,` `,(0,j.jsxs)(`span`,{className:`mono muted`,children:[`(`,e.component,`)`]})]},t))})})}),(0,j.jsx)(F,{title:H.recentNearbyChanges,span:`span 4`,children:(0,j.jsx)(I,{of:o,empty:e=>e.recentChanges.length===0,emptyText:H.noChangeTouchesWhat,children:e=>(0,j.jsx)(`div`,{className:`stack`,style:{gap:6},children:e.recentChanges.map(e=>(0,j.jsxs)(`a`,{href:`#/changes/${encodeURIComponent(e.id)}`,className:`list-row`,style:{textDecoration:`none`,color:`inherit`},children:[(0,j.jsxs)(`span`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`span`,{style:{fontSize:12.5},children:e.title}),(0,j.jsxs)(`span`,{className:`hud`,style:{fontSize:9.5},children:[e.id,` · `,e.updatedAt.slice(0,10),` · `,e.systems.join(`, `)]})]}),(0,j.jsx)(`span`,{className:`chip`,children:e.state.toUpperCase()})]},e.id))})})})]}),t?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(F,{title:H.blastRadiusOf(t),kind:`hero`,span:`1 / -1`,children:(0,j.jsx)(I,{of:a,empty:e=>e.affected.length===0,emptyText:H.nothingDependsOnIt,children:()=>(0,j.jsx)(Eu,{g:d,focus:t,height:380})})}),(0,j.jsx)(F,{title:H.blastRadius,span:`1 / -1`,kind:`dark`,children:(0,j.jsx)(I,{of:a,children:e=>(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsx)(`span`,{className:`big`,children:e.affected.length}),(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:H.recordsAffectedBy(e.root)}),[...u.entries()].sort((e,t)=>e[0]-t[0]).map(([e,t])=>(0,j.jsxs)(`div`,{className:`row`,style:{gap:8},children:[(0,j.jsx)(`span`,{className:`hud`,style:{width:56,fontSize:10},children:H.hop(e,e===1?``:`s`)}),(0,j.jsx)(`div`,{style:{flex:1},children:(0,j.jsx)(Rt,{value:t,max:Math.max(...u.values()),label:H.recordsHopsAway(t,e)})}),(0,j.jsx)(`span`,{className:`n`,children:t})]},e))]})})}),(0,j.jsx)(F,{title:H.affected,span:`span 8`,children:(0,j.jsx)(I,{of:a,empty:e=>e.affected.length===0,emptyText:H.nothingDependsOnIt2,children:e=>(0,j.jsx)(Gn,{caption:H.affectedRecords,rows:e.affected,rowKey:e=>`${e.kind}/${e.id}`,cols:[{label:H.record,cell:e=>e.byAi?(0,j.jsxs)(`span`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`span`,{children:e.id}),(0,j.jsx)(Ni,{run:e.run})]}):e.id,mono:!0},{label:H.kind,cell:e=>(0,j.jsx)(`span`,{className:`chip dim`,children:e.kind})},{label:H.why,cell:e=>e.reason},{label:H.owner,cell:e=>e.owner?(0,j.jsx)(`span`,{className:`chip dim`,style:{whiteSpace:`nowrap`},children:e.owner}):(0,j.jsx)(`span`,{className:`chip warn`,children:H.unknown})}]})})}),(0,j.jsxs)(F,{title:H.whatWouldSharpenThis,span:`span 4`,children:[(0,j.jsx)(I,{of:a,empty:e=>e.gaps.length===0,emptyText:H.noGapsTheCatalog,children:e=>(0,j.jsx)(`ul`,{style:{margin:0,paddingLeft:18,lineHeight:1.6},children:e.gaps.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`span`,{className:`mono`,children:e.record}),`: `,e.question]},`${e.record}/${e.field}`))})}),(0,j.jsx)(`p`,{className:`muted`,style:{fontSize:11.5,margin:`10px 0 0`},children:H.readOnlyAtticusNever})]})]}):null]})}function Qu({records:e}){let t=P(`/api/graph`),n=new Set(e.flatMap(e=>[e,e.split(`.`)[0]]));return(0,j.jsx)(I,{of:t,empty:e=>e.nodes.length===0,emptyText:``,children:e=>(0,j.jsx)(`div`,{style:{border:`1px solid var(--line)`,borderRadius:10,background:`var(--inset)`},children:(0,j.jsx)(Eu,{g:e,highlight:e.nodes.filter(e=>n.has(e.id)).map(e=>e.id),height:300})})})}function $u({hash:e}){let t=Mn(`features`),n=Nn(e,`id`)??(t.state===`ready`?t.data.features[0]?.id:void 0),r=Mn(`features`,n,!n);return(0,j.jsxs)(`div`,{className:`bento`,children:[(0,j.jsx)(F,{title:H.featuresFoundInCode,span:`span 4`,rows:`span 2`,meta:t.state===`ready`?t.data.features.length:void 0,children:(0,j.jsx)(I,{of:t,empty:e=>e.features.length===0,emptyText:H.noFeaturesFoundYet,children:e=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:10},children:[(0,j.jsx)(Lt,{title:H.featuresByHowThey,parts:[{label:H.confirmedByPeople,value:e.coverage.confirmed.length,color:`var(--green)`},{label:H.foundInCodeOnly,value:e.coverage.detectedOnly.length,color:`var(--accent)`},{label:H.unknown2,value:e.coverage.unknown.length,color:`var(--amber)`}]}),(0,j.jsx)(`nav`,{"aria-label":H.features,className:`stack`,style:{gap:2},children:e.features.map(e=>(0,j.jsxs)(`a`,{href:`#/features?id=${encodeURIComponent(e.id)}`,"aria-current":e.id===n?`page`:void 0,className:`list-row`,style:{textDecoration:`none`,padding:`7px 6px`,borderRadius:6,background:e.id===n?`var(--picked)`:void 0},children:[(0,j.jsxs)(`span`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`span`,{children:e.name??e.id}),(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:9.5},children:H.entryPoints(e.entryPoints.length)})]}),(0,j.jsx)(`span`,{className:`chip ${e.namedBy===`detected`?``:e.namedBy===`ai`?`ai`:`done`}`,children:e.namedBy.toUpperCase()})]},e.id))})]})})}),(0,j.jsx)(F,{title:r.state===`ready`?r.data.feature.name??r.data.feature.id:H.feature,span:`span 8`,rows:`span 2`,meta:r.state===`ready`?r.data.system:void 0,children:n?(0,j.jsx)(I,{of:r,children:e=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:14},children:[(0,j.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,gap:6},children:[(0,j.jsx)(`span`,{className:`chip`,children:e.feature.confidence.toUpperCase()}),e.feature.tags.map(e=>(0,j.jsx)(`span`,{className:`chip dim`,children:e},e)),e.feature.externalRefs.length===0?(0,j.jsx)(`span`,{className:`chip warn`,children:H.noWorkItemsLinked}):e.feature.externalRefs.map((e,t)=>(0,j.jsxs)(`span`,{className:`chip done`,children:[e.system??H.item,` `,e.id??``]},t))]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:`hud`,style:{fontSize:10,marginBottom:6},children:H.entryPoints2}),(0,j.jsx)(`ul`,{style:{margin:0,paddingLeft:18,lineHeight:1.7},className:`mono`,children:e.feature.entryPoints.map(e=>(0,j.jsx)(`li`,{children:e},e))})]}),(0,j.jsx)(Qu,{records:[...e.feature.records,...e.feature.entryPoints]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:`hud`,style:{fontSize:10,marginBottom:6},children:H.recordsInTheFlow(e.feature.records.length)}),(0,j.jsx)(`p`,{className:`mono`,style:{margin:0,fontSize:11.5,lineHeight:1.7,color:`var(--text-2)`},children:e.feature.records.join(` · `)})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:`hud`,style:{fontSize:10,marginBottom:6},children:H.knowledgeGaps}),e.looseEnds.length===0?(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:H.noneEveryHopIs}):(0,j.jsx)(`ul`,{style:{margin:0,paddingLeft:18,lineHeight:1.6},children:e.looseEnds.map((e,t)=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`span`,{className:`chip warn`,children:e.kind}),` `,e.text]},t))})]}),(0,j.jsxs)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:[H.nameTagOrLink,(0,j.jsx)(`span`,{className:`mono`,children:H.atticusFeatureName(e.feature.id)}),`,`,` `,(0,j.jsx)(`span`,{className:`mono`,children:H.featureTag}),` `,H.or,(0,j.jsx)(`span`,{className:`mono`,children:H.featureLink}),H.theChangeGoesIn]})]})}):(0,j.jsx)(`p`,{className:`muted`,children:H.pickAFeature})})]})}function ed(){let e=P(`/api/orgpack`),t=Mn(`glossary`);return(0,j.jsxs)(`div`,{className:`bento`,children:[(0,j.jsx)(F,{title:H.orgPack,span:`span 4`,kind:`dark`,children:(0,j.jsx)(I,{of:e,children:e=>(0,j.jsxs)(`div`,{className:`stack`,children:[Object.entries(e.counts).map(([e,t])=>(0,j.jsxs)(`div`,{className:`list-row`,children:[(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:e}),(0,j.jsx)(`span`,{className:`n`,style:{fontSize:16},children:t})]},e)),e.problems.length?(0,j.jsx)(`p`,{role:`alert`,style:{color:`var(--magenta-text)`,margin:0},children:H.problems(e.problems.length,e.problems.map(e=>`${e.file}: ${e.message}`).join(`; `))}):(0,j.jsx)(`span`,{className:`chip done`,style:{width:`fit-content`},children:H.valid}),e.defaulted.length>0&&(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:H.usingBuiltInDefaults(e.defaulted.join(`, `))})]})})}),(0,j.jsx)(F,{title:H.integrationPatterns,span:`span 8`,children:(0,j.jsx)(I,{of:e,empty:e=>!e.patterns?.length,emptyText:H.noPatternsYet,children:e=>(0,j.jsx)(Gn,{caption:H.integrationPatterns,rows:e.patterns??[],rowKey:e=>e.code,cols:[{label:H.code,cell:e=>(0,j.jsx)(`span`,{className:`chip`,children:e.code}),width:`130px`},{label:H.pattern,cell:e=>(0,j.jsx)(`span`,{title:e.definition,children:e.name})},{label:H.interaction,cell:e=>e.interaction},{label:H.route,cell:e=>e.route},{label:H.target,cell:e=>e.targetType}]})})}),(0,j.jsx)(F,{title:H.checklistsAndProcedures,span:`span 4`,children:(0,j.jsx)(I,{of:e,children:e=>(0,j.jsxs)(`div`,{className:`stack`,children:[(e.checklists??[]).map(e=>(0,j.jsxs)(`div`,{className:`list-row`,children:[(0,j.jsx)(`span`,{children:e.name}),(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:H.rulesV(e.rules,e.version)})]},e.name)),(e.procedures??[]).map(e=>(0,j.jsxs)(`div`,{className:`list-row`,children:[(0,j.jsx)(`span`,{children:e.title??e.id}),(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:H.steps(e.steps)})]},e.id))]})})}),(0,j.jsx)(F,{title:H.glossary,span:`span 8`,children:(0,j.jsx)(I,{of:t,empty:e=>e.terms.length===0,emptyText:H.noTermsYet,children:e=>(0,j.jsx)(Gn,{caption:H.glossary,rows:e.terms,rowKey:e=>e.id,cols:[{label:H.term,cell:e=>e.term,width:`180px`},{label:H.definition,cell:e=>e.definition??(0,j.jsx)(`span`,{className:`chip warn`,children:H.needsADefinition})}]})})}),(0,j.jsx)(Uu,{})]})}function td(e){let t=Vn();return e.options.length===0?null:(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`div`,{className:`row`,style:{flexWrap:`wrap`,gap:6},children:e.options.map((n,r)=>(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:t.busy,onClick:()=>void t.run(()=>N(`/api/triage/${encodeURIComponent(e.item)}/decide`,{method:`POST`,body:{option:r+1}}).then(()=>e.done(H.decided(n.label))),H.decided(n.label)),children:n.label},r))}),(0,j.jsx)(Wn,{note:t.note?.ok&&!t.note.working?void 0:t.note})]})}var nd={read:`var(--green)`,"needs-reading":`var(--accent)`,"no-reader":`var(--violet)`,unresolved:`var(--amber)`,duplicate:`var(--gone)`,superseded:`var(--gone)`,failed:`var(--magenta)`};function rd(){let e=Mn(`intake`),t=Mn(`triage`),[n,r]=(0,v.useState)(),i=e.state===`ready`?e.data.documents:[],a=[...new Set(i.map(e=>e.status))],o=i.reduce((e,t)=>e+t.records.length,0);return(0,j.jsxs)(`div`,{className:`bento`,children:[(0,j.jsx)(F,{title:H.files,span:`span 3`,kind:`dark`,children:(0,j.jsx)(I,{of:e,children:()=>(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsx)(`span`,{className:`big`,children:i.length}),(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:H.filesInInputs})]})})}),(0,j.jsx)(F,{title:H.factsTaken,span:`span 2`,kind:`dark`,children:(0,j.jsx)(I,{of:e,children:()=>(0,j.jsx)(`span`,{className:`big`,children:o})})}),(0,j.jsx)(F,{title:H.whatHappenedToThem,span:`span 3`,children:(0,j.jsx)(I,{of:e,empty:()=>i.length===0,emptyText:H.nothingYet,children:()=>(0,j.jsx)(Lt,{title:H.filesByStatus,parts:a.map(e=>({label:e,value:i.filter(t=>t.status===e).length,color:nd[e]??`var(--accent-pale)`}))})})}),(0,j.jsx)(F,{title:H.defences,span:`span 4`,children:(0,j.jsx)(I,{of:e,children:()=>{let e=i.filter(e=>e.defences&&e.defences.risk!==`cleared`);return e.length===0?(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:H.nothingHiddenOrAimed}):(0,j.jsx)(`ul`,{style:{margin:0,paddingLeft:18,fontSize:12.5},children:e.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`span`,{className:`mono`,children:e.path}),`: `,e.defences.reason]},e.path))})}})}),(0,j.jsx)(F,{title:H.intake,span:`span 8`,meta:H.inputs,children:(0,j.jsx)(I,{of:e,empty:e=>e.documents.length===0,emptyText:H.nothingInInputsYet,children:e=>(0,j.jsx)(Gn,{caption:H.filesReadFromInputs,rows:e.documents,rowKey:e=>e.path,cols:[{label:H.file,cell:e=>e.path,mono:!0},{label:H.readAs,cell:e=>e.classification},{label:H.about,cell:e=>Kn(e.systems)||(0,j.jsx)(`span`,{className:`muted`,children:H.noSystemNamed})},{label:H.facts,cell:e=>e.records.length},{label:H.status,cell:e=>e.defences?.risk===`high`?(0,j.jsx)(`span`,{className:`chip blocking`,title:e.defences.reason,children:H.quarantined}):(0,j.jsx)(`span`,{className:`chip ${e.status===`read`?`done`:e.status===`failed`||e.status===`unresolved`?`warn`:`dim`}`,children:e.status.toUpperCase()})}]})})}),(0,j.jsx)(F,{title:H.needsYou,span:`span 4`,meta:t.state===`ready`?t.data.items.length:void 0,children:(0,j.jsx)(I,{of:t,empty:e=>e.items.length===0,emptyText:H.nothingToTriage,children:e=>(0,j.jsxs)(`div`,{className:`stack`,children:[n&&(0,j.jsx)(Wn,{note:{ok:!0,text:n}}),e.items.map(e=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4,padding:`6px 0`,borderBottom:`1px solid var(--rule)`},children:[(0,j.jsxs)(`span`,{className:`row between`,style:{alignItems:`flex-start`},children:[(0,j.jsx)(`span`,{style:{fontSize:12.5},children:e.summary}),(0,j.jsx)(`span`,{className:`chip ${e.kind===`defences`?`blocking`:`warn`}`,children:e.kind.toUpperCase()})]}),(0,j.jsxs)(`span`,{className:`mono muted`,style:{fontSize:11},children:[e.id,` · `,e.source.path,e.source.line?`:${e.source.line}`:``]}),(0,j.jsx)(td,{item:e.id,options:e.options,done:e=>{r(e),t.reload()}})]},e.id)),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:H.eachChoiceIsSaved})]})})})]})}function id(e){let t=e?.state===`done`?e.result:void 0,n=e=>typeof t?.[e]==`number`?t[e]:void 0,r=n(`added`);if(r!==void 0)return H.scanAdded(r,n(`changed`)??0,n(`removed`)??0,n(`questions`)??0)}function ad(e){if(!e||e.state===`running`||e.state===`queued`)return;let t=e.result?.refused;if(!t||!Array.isArray(t.repos))return;let n=t.repos.map(e=>e.why===`run-failed`?H.scanRefusedRun(e.repo,(e.runs??[]).map(e=>H.scanRefusedRunOne(e.extractor,e.error)).join(`; `)):H.scanRefusedWhy[e.why]?.(e.repo)??`${e.repo}: ${e.message}`);return t.empty&&n.push(H.scanRefusedEmpty(t.empty.before)),{title:H.scanRefusedTitle,lines:n,todo:H.scanRefusedTodo}}function od(e,t){return e&&e.state!==`queued`&&e.state!==`running`&&t?.ok?void 0:t}function sd(e){if(!e||e.state===`running`||e.state===`queued`)return[];let t=e.result?.sources;return Array.isArray(t)?t:[]}function cd(e){if(!e||e.state===`running`||e.state===`queued`)return;let t=e.result?.refused;if(!t||!Array.isArray(t.reasons)||t.reasons.every(e=>e===`nothing-read`))return;let n=t.reasons.includes(`not-upgraded`)?`atticus upgrade --yes`:t.reasons.includes(`large-removals`)?`atticus scan --allow-removals ${t.allowRemovals??0}`:t.reasons.includes(`hand-edits`)?`atticus catalog edits --curate`:`atticus scan`;return{...t,command:t.command??n}}var ld=w.scanSources,ud=e=>e&&/^[0-9a-f]{8,}$/.test(e)?e.slice(0,7):e??``;function dd({sources:e}){return e.length?(0,j.jsxs)(`section`,{className:`stack cb`,style:{gap:6},"aria-labelledby":`scan-sources`,children:[(0,j.jsx)(`h3`,{id:`scan-sources`,className:`hud`,style:{margin:0},children:ld.title}),(0,j.jsxs)(`table`,{className:`cb-table`,children:[(0,j.jsx)(`caption`,{className:`sr`,children:ld.caption}),(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{scope:`col`,children:ld.col.repo}),(0,j.jsx)(`th`,{scope:`col`,children:ld.col.outcome}),(0,j.jsx)(`th`,{scope:`col`,children:ld.col.source}),(0,j.jsx)(`th`,{scope:`col`,children:ld.col.note})]})}),(0,j.jsx)(`tbody`,{children:e.map(e=>(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{scope:`row`,className:`mono`,style:{fontWeight:`normal`},children:e.repo}),(0,j.jsxs)(`td`,{"data-label":ld.col.outcome,children:[(0,j.jsx)(`span`,{className:`chip ${e.slot===`written`||e.slot===`unchanged`?`done`:e.slot===`none`?`dim`:`warn`}`,children:ld.slot[e.slot]??e.slot}),e.commit?` ${ld.at(ud(e.commit))}`:``]}),(0,j.jsxs)(`td`,{"data-label":ld.col.source,children:[w.catalogBuild.source[e.source]??e.source,e.sourceCommit?` ${ld.at(ud(e.sourceCommit))}`:``]}),(0,j.jsxs)(`td`,{"data-label":ld.col.note,children:[e.reason?ld.why[e.reason]??e.reason:``,e.detail?` (${e.detail})`:``,e.factsStale?`${e.reason?`; `:``}${ld.factsStale}`:``]})]},e.repo))})]})]}):null}function fd(e){let{allowRemovals:t,discardEdits:n,plan:r,...i}=e;return i}function pd(e,t,n){return{...fd(e),...n,...t.plan?{plan:t.plan}:{}}}function md(){let e=P(`/api/repos`),t=P(`/api/catalog/kinds`),[n,r]=(0,v.useState)(),i=Vn();St(i=>{n&&i.jobId===n.id&&(i.type===`job.progress`&&r({...n,progress:{done:Number(i.done),total:Number(i.total),message:String(i.message)}}),i.type===`job.done`&&(N(`/api/jobs/${n.id}`).then(r),e.reload(),t.reload()))}),mt(n&&(n.state===`running`||n.state===`queued`)?n.id:void 0,n=>{r(n),n.state!==`running`&&n.state!==`queued`&&(e.reload(),t.reload())});let[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(!1),l=(e,t,n={})=>i.run(async()=>{o(!1),e===`/api/scan`&&y(n);let t=await N(e,{method:`POST`,body:n});r(await N(`/api/jobs/${t.jobId}`))},H.started(t)),u=od(n,i.note),d=id(n),[f,p]=(0,v.useState)(),m=f===n?.id?void 0:cd(n),h=m?void 0:ad(n),g=sd(n),[_,y]=(0,v.useState)({}),b=e=>{o(!0),N(`/api/jobs/${e}/cancel`,{method:`POST`,body:{}}).catch(()=>void 0)},x=e.state===`ready`?e.data.filter(e=>e.baseClone.present).length:0,S=e.state===`ready`?e.data.length:0;return(0,j.jsxs)(`div`,{className:`bento`,children:[(0,j.jsx)(F,{title:H.scan,span:`span 4`,kind:`dark`,children:(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsxs)(`div`,{className:`row`,children:[(0,j.jsx)(It,{value:x,max:Math.max(S,1),size:64,label:H.ofReposCloned(x,S)}),(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12.5},children:H.reposClonedLocally})]}),(0,j.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:i.busy,onClick:()=>void l(`/api/workspace/sync`,H.sync),children:H.syncRepos}),(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:i.busy,"aria-describedby":`scan-cross-check`,onClick:()=>void l(`/api/scan`,H.scan2,s?{askAll:!0}:{}),children:H.scanNow})]}),(0,j.jsx)(`p`,{id:`scan-cross-check`,className:`muted`,style:{margin:0,fontSize:12},children:H.scanCrossCheck}),(0,j.jsxs)(`label`,{className:`row`,style:{gap:6,fontSize:12,alignItems:`center`},children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:s,onChange:e=>c(e.target.checked)}),H.scanAskAll]}),(0,j.jsxs)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:[H.readAgainWhere,` `,(0,j.jsx)(`a`,{href:`#/trust`,children:H.readAgain})]}),(0,j.jsxs)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:[ld.links,` `,(0,j.jsx)(`a`,{href:`#/crosscheck`,children:w.crossCheck.title}),` ·`,` `,(0,j.jsx)(`a`,{href:`#/catalog-builds`,children:w.catalogBuild.openFromScans})]}),n&&(0,j.jsxs)(`div`,{className:`stack`,role:`status`,"aria-live":`polite`,children:[(0,j.jsxs)(`span`,{className:`hud`,style:{fontSize:10},children:[h?H.scanRefusedState:H.jobState[n.state]??n.state,n.state===`running`?` · ${n.progress.message}`:``]}),(0,j.jsx)(Rt,{value:n.progress.done,max:Math.max(n.progress.total,1),label:H.jobProgress}),d&&(0,j.jsx)(`span`,{children:d}),(0,j.jsx)(dd,{sources:g}),m&&(0,j.jsx)(Ec,{refused:m,confirmLabel:ld.confirmScan,onAllowRemovals:e=>l(`/api/scan`,H.scan2,pd(_,m,{allowRemovals:e})).then(()=>void 0),onCurate:async e=>{await Tc(m,e),p(n.id)},onDiscard:e=>l(`/api/scan`,H.scan2,pd(_,m,{discardEdits:e})).then(()=>void 0)}),h&&(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`strong`,{children:h.title}),(0,j.jsx)(`ul`,{"aria-label":H.scanRefusedList,style:{margin:0,paddingLeft:18},children:h.lines.map(e=>(0,j.jsx)(`li`,{style:{overflowWrap:`anywhere`},children:e},e))}),(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:h.todo})]}),(0,j.jsx)(An,{id:n.id}),n.state===`running`&&(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,alignItems:`center`},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:a,"aria-describedby":`scan-cancel-hint`,onClick:()=>b(n.id),children:a?H.cancelling:H.cancelJob}),(0,j.jsx)(`span`,{id:`scan-cancel-hint`,className:`muted`,style:{fontSize:12},children:H.cancelJobHint})]}),n.errors.length>0&&!h&&(0,j.jsx)(`ul`,{"aria-label":H.jobProblems,style:{margin:0,paddingLeft:18,color:`var(--magenta-text)`},children:n.errors.map((e,t)=>(0,j.jsx)(`li`,{children:e},`${t}:${e}`))})]}),(0,j.jsx)(Wn,{note:u}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:11.5},children:H.scansReadFilesOnly}),(0,j.jsx)(sc,{text:`atticus workspace prune`,label:w.runNext.copy})]})}),(0,j.jsx)(F,{title:H.repos,span:`span 8`,children:(0,j.jsx)(I,{of:e,empty:e=>e.length===0,emptyText:H.noReposInAny,children:e=>(0,j.jsx)(Gn,{caption:H.repos,rows:e,rowKey:e=>e.id,cols:[{label:H.repo,cell:e=>e.id,mono:!0},{label:H.platform,cell:e=>e.platform},{label:H.type,cell:e=>e.type??``},{label:H.baseClone,cell:e=>(0,j.jsx)(`span`,{className:`chip ${e.baseClone.present?`done`:`dim`}`,children:e.baseClone.present?H.cloned:H.notYet})}]})})}),(0,j.jsx)(F,{title:H.catalog,span:`1 / -1`,children:(0,j.jsx)(I,{of:t,empty:e=>e.length===0,emptyText:H.noFactsYet,children:e=>(0,j.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fill, minmax(150px, 1fr))`,gap:10},children:e.map(e=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:9.5},children:e.kind}),(0,j.jsx)(`span`,{className:`n`,style:{fontSize:20},children:e.count})]},e.kind))})})})]})}var hd=w.systems;function gd(e,t){let n=new Set(e.repos??[]);return t.filter(e=>![`released`,`archived`].includes(e.state)).filter(e=>e.repos.some(e=>n.has(e))).sort((e,t)=>e.title.localeCompare(t.title))}var _d=e=>`#/systems?system=${encodeURIComponent(e)}`;function vd(e){return(0,j.jsx)(`nav`,{"aria-label":hd.pick,children:(0,j.jsx)(`ul`,{className:`row`,style:{gap:6,flexWrap:`wrap`,listStyle:`none`,padding:0,margin:0},children:e.systems.map(t=>(0,j.jsx)(`li`,{children:(0,j.jsx)(`a`,{className:`chip`,href:_d(t.id),"aria-current":t.id===e.current?`page`:void 0,children:t.name??t.id})},t.id))})})}function yd({hash:e}){let t=P(`/api/catalog/System?limit=500`),n=P(`/api/changes`),r=Mn(`questions`);lt(t,n,r);let i=Nn(e,`system`),a=t.state===`ready`?t.data.items:[],o=i??a[0]?.id,s=a.find(e=>e.id===o),c=r.state===`ready`?(r.data.questions??[]).filter(e=>e.system===o):[];return(0,j.jsxs)(`div`,{className:`bento`,children:[(0,j.jsxs)(F,{title:hd.title,span:`1 / -1`,children:[(0,j.jsx)(I,{of:t,empty:e=>e.items.length===0,emptyText:hd.empty,children:()=>(0,j.jsx)(vd,{systems:a,current:o})}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:`8px 0 0`},children:(0,j.jsx)(`a`,{href:`#/outside`,children:hd.outside})})]}),o&&(0,j.jsx)(Gu,{system:o}),s&&(0,j.jsx)(F,{title:hd.inFlight,span:`span 6`,children:n.state===`ready`?gd(s,n.data).length===0?(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:hd.noChanges}):(0,j.jsx)(`ul`,{style:{margin:0,paddingLeft:18},children:gd(s,n.data).map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`a`,{href:`#/cockpit?change=${encodeURIComponent(e.id)}`,children:e.title}),(0,j.jsx)(`span`,{className:`muted`,children:` · ${e.state}`})]},e.id))}):(0,j.jsx)(I,{of:n,children:()=>null})}),s&&(0,j.jsx)(F,{title:hd.questions,span:`span 6`,children:(0,j.jsx)(I,{of:r,empty:()=>c.length===0,emptyText:hd.noQuestions,children:()=>(0,j.jsx)(`ul`,{style:{margin:0,paddingLeft:18},children:c.map(e=>(0,j.jsx)(`li`,{children:e.question},e.id))})})})]})}var bd=w.correctionNext,xd=e=>bd.linkWhat(e.from,e.to,e.method,e.path);function Sd({text:e,label:t}){return(0,j.jsxs)(`div`,{className:`work-cmd`,children:[(0,j.jsx)(`code`,{className:`mono`,children:e}),(0,j.jsx)(sr,{text:e,label:bd.copy(`${t}: ${e}`)})]})}function Cd({v:e}){if(!e.preview)return(0,j.jsx)(`p`,{className:`ev-say`,children:bd.unavailable[e.unavailable??`no-checkout`]});let t=e.preview,n=t.links,r=n?[...n.moved.map(e=>bd.moved(xd({...e,to:e.was}),e.was,e.to)),...n.added.map(e=>bd.added(xd(e))),...n.removed.map(e=>bd.removed(xd(e))),...n.changed.map(e=>bd.changed(xd(e),e.was?.confidence??``,e.confidence)),...n.unmade.map(e=>bd.unmade(xd(e)))]:[],i=[...t.facts.dropped.map(e=>`${bd.dropped}: ${e.label} (${bd.droppedWhy[e.why]}${e.message?`: ${e.message}`:``})`),...t.facts.edited.map(e=>`${bd.edited}: ${e.label} (${e.fields.map(e=>bd.field(e.name,e.was,e.now)).join(`; `)})`)];return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[t.headMoved&&(0,j.jsx)(`p`,{className:`ev-say`,children:bd.headMoved(t.headMoved.head,t.headMoved.commit)}),t.blocked&&(0,j.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:0},children:bd.blocked(t.blocked.rejected)}),(0,j.jsx)(`h5`,{className:`hud`,children:bd.facts}),i.length?(0,j.jsx)(`ul`,{className:`ev-list`,children:i.map(e=>(0,j.jsx)(`li`,{children:e},e))}):(0,j.jsx)(`p`,{className:`ev-say`,children:bd.noFactChange}),(0,j.jsx)(`p`,{className:`ev-say`,children:bd.kept(t.facts.kept)}),n&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`h5`,{className:`hud`,children:bd.links}),r.length?(0,j.jsx)(`ul`,{className:`ev-list`,children:r.map(e=>(0,j.jsx)(`li`,{children:e},e))}):(0,j.jsx)(`p`,{className:`ev-say`,children:bd.noLinkChange})]}),t.catalog&&(0,j.jsx)(`p`,{className:`ev-say`,children:bd.catalog(t.catalog.added,t.catalog.changed,t.catalog.removed,t.catalog.evidenceOnly)}),t.staleCorrections.length>0&&(0,j.jsx)(`p`,{className:`ev-say`,children:bd.stale(t.staleCorrections.join(`, `))})]})}function wd(e){let t=(0,v.useId)(),n=e.preview.state===`ready`?e.preview.data:void 0;return(0,j.jsxs)(`section`,{className:`stack`,style:{gap:6},"aria-labelledby":`${t}-t`,children:[(0,j.jsx)(`h4`,{id:`${t}-t`,className:`h`,style:{fontSize:14},children:bd.title}),(0,j.jsx)(`p`,{className:`ev-say`,children:bd.onlyWrote(e.file)}),e.line&&(0,j.jsx)(At,{caption:bd.fileDiff(e.file),children:`+ ${e.line}`}),e.repo&&(0,j.jsx)(qc,{scope:`corrections`,repo:e.repo}),(0,j.jsx)(`h5`,{className:`hud`,children:bd.stepsTitle}),e.preview.state===`loading`&&(0,j.jsx)(`p`,{role:`status`,"aria-busy":`true`,className:`ev-say`,children:bd.loading}),e.preview.state===`error`&&(0,j.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:0},children:bd.failed(e.preview.error)}),n&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`ol`,{className:`stack`,style:{gap:4,paddingLeft:18,margin:0},children:n.steps.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`span`,{className:`ev-say`,children:bd.step[e.step]}),e.command?(0,j.jsx)(Sd,{text:e.command,label:bd.step[e.step]}):(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:bd.prByHand(n.branch)})]},e.step))}),(0,j.jsx)(`h5`,{className:`hud`,children:bd.previewTitle}),(0,j.jsx)(`p`,{className:`ev-say`,children:bd.previewIntro}),(0,j.jsx)(Cd,{v:n})]})]})}function Td(e){let t=P(`/api/facts/${encodeURIComponent(e.repo)}/preview?fact=${encodeURIComponent(e.result.correction.fact)}`);return(0,j.jsx)(wd,{file:e.result.file,line:e.result.line,preview:t,repo:e.repo})}var Ed=w.match,Dd=3e3,Od=e=>e instanceof M?e.problem.detail??e.message:e instanceof Error?e.message:String(e);function kd(e){let t=w.decisions,n=e.decided;return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[n.paused&&(0,j.jsx)(`p`,{className:`ev-say`,role:`status`,style:{margin:0},children:t.matchPaused(n.paused)}),n.applied.length>0&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:t.matchApplied(n.applied.length)}),(0,j.jsx)(`ul`,{className:`stack`,style:{gap:4,margin:0,paddingLeft:18},children:n.applied.map(n=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`code`,{className:`mono`,children:e.label(n.call)}),` →`,` `,(0,j.jsx)(`code`,{className:`mono`,children:e.apiLabel(n.api)}),` `,(0,j.jsx)(Ni,{}),(0,j.jsxs)(`span`,{className:`muted`,children:[` · `,t.because(t.bar[n.bar]??n.bar)]})]},n.call))}),(0,j.jsx)(`a`,{href:`#/decisions?repo=${encodeURIComponent(e.from)}`,children:t.matchUndo})]}),n.kept.length>0&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:t.matchKept(n.kept.length)}),(0,j.jsx)(`ul`,{className:`stack`,style:{gap:2,margin:0,paddingLeft:18},children:n.kept.map(t=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`code`,{className:`mono`,children:e.label(t.call)}),` →`,` `,(0,j.jsx)(`code`,{className:`mono`,children:e.apiLabel(t.api)}),t.why?(0,j.jsxs)(`span`,{className:`muted`,children:[` · `,t.why]}):null]},t.call))})]})]})}function Ad(e){let t=`from=${encodeURIComponent(e.from)}&${e.box.system?`system=${encodeURIComponent(e.box.system)}`:`to=${encodeURIComponent(e.box.repo??``)}`}`,n=e.io??{get:()=>N(`/api/links/match?${t}`,{quiet:!0}),post:()=>N(`/api/links/match`,{method:`POST`,body:{from:e.from,to:e.box}}),done:()=>N(`/api/links/match/done`,{method:`POST`,body:{from:e.from,to:e.box}})},[r,i]=(0,v.useState)(),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(),[l,u]=(0,v.useState)(!1),d=(0,v.useRef)(!0);(0,v.useEffect)(()=>(d.current=!0,()=>{d.current=!1}),[]);let f=(0,v.useRef)(0),p=(0,v.useRef)(n);p.current=n;let m=async()=>{let e=++f.current;try{let t=await p.current.get();return d.current&&e===f.current&&i(t),t}catch(t){d.current&&e===f.current&&c(Od(t));return}};(0,v.useEffect)(()=>{i(void 0),c(void 0),u(!1),m()},[e.from,e.box.repo,e.box.system]),(0,v.useEffect)(()=>{if(r?.state!==`running`)return;let e=setInterval(()=>void m(),Dd);return()=>clearInterval(e)},[r?.state]),St(e=>{e.type===`job.done`&&r?.jobId===e.jobId&&m()});let h=async()=>{o(!0),c(void 0),u(!1);try{let e=await p.current.post();f.current++,d.current&&i(e)}catch(e){d.current&&c(Od(e))}finally{d.current&&o(!1)}},g=async()=>{let e=p.current.done;if(!r?.run||!e)return void m();o(!0),c(void 0);try{let t=await e();f.current++,d.current&&i(t)}catch(e){d.current&&c(Od(e))}finally{d.current&&o(!1)}},_=t=>{let n=e.calls.find(e=>e.fact===t);return n?`${n.method??``} ${n.path}`.trim():t},y=t=>{let n=e.apis.find(e=>e.id===t);return n?`${n.method??``} ${n.path}`.trim():t},b=r?.state??`idle`,x=r?.proposals??[];return(0,j.jsxs)(`div`,{className:`stack match-panel`,style:{gap:6},children:[(0,j.jsx)(`p`,{className:`ev-say`,children:Ed.intro}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`,alignItems:`center`},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:a||b===`running`,"aria-busy":a||b===`running`,onClick:()=>void h(),children:b===`running`?Ed.running:b===`done`?Ed.again:Ed.start}),(b===`handoff`||b===`failed`||b===`done`&&!!r?.run)&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:a,"aria-busy":a,onClick:()=>void g(),children:a&&r?.run?Ed.readingAnswer:Ed.readAnswer})]}),b===`running`&&r?.jobId&&(0,j.jsx)(An,{id:r.jobId}),b===`running`&&(0,j.jsx)(`p`,{role:`status`,"aria-live":`polite`,className:`ev-say`,children:Ed.runningSay(e.from,e.toName)}),b===`handoff`&&r?.brief&&(0,j.jsxs)(`div`,{className:`stack`,role:`status`,style:{gap:4},children:[(0,j.jsx)(`p`,{className:`ev-say`,children:Ed.handoff(r.brief)}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`code`,{className:`mono`,children:r.brief}),(0,j.jsx)(sr,{text:r.brief,label:`${Ed.copy}: ${r.brief}`})]}),r.answer&&(0,j.jsx)(`p`,{className:`hud`,children:Ed.answerAt(r.answer)})]}),(s||b===`failed`&&r?.error)&&(0,j.jsx)(`p`,{role:`alert`,className:`state error`,children:s??r?.error}),b===`done`&&(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,j.jsx)(`p`,{className:`ev-say`,role:`status`,children:Ed.done(x.length,r?.none.length??0,r?.rejected.length??0)}),r?.decided&&(0,j.jsx)(kd,{decided:r.decided,label:_,apiLabel:y,from:e.from}),x.length>0&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`ul`,{className:`stack`,style:{gap:4,margin:0,paddingLeft:18},children:x.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`code`,{className:`mono`,children:_(e.call)}),` →`,` `,(0,j.jsx)(`code`,{className:`mono`,children:y(e.api)}),e.why?(0,j.jsxs)(`span`,{className:`muted`,children:[` · `,e.why]}):null,e.lines.length>0&&(0,j.jsx)(`div`,{className:`hud`,children:e.lines.join(`, `)})]},e.call))}),(0,j.jsx)(`div`,{className:`row`,style:{gap:8},children:(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:l,onClick:()=>{e.onTake(x),u(!0)},children:l?Ed.taken:Ed.take(x.length)})})]}),(r?.none.length??0)>0&&(0,j.jsxs)(`details`,{children:[(0,j.jsx)(`summary`,{className:`hud`,children:Ed.noneTitle(r.none.length)}),(0,j.jsx)(`ul`,{className:`stack`,style:{gap:2,margin:0,paddingLeft:18},children:r.none.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`code`,{className:`mono`,children:_(e.call)}),e.why?(0,j.jsxs)(`span`,{className:`muted`,children:[` · `,e.why]}):null]},e.call))})]}),(r?.rejected.length??0)>0&&(0,j.jsxs)(`details`,{children:[(0,j.jsx)(`summary`,{className:`hud`,children:Ed.rejectedTitle(r.rejected.length)}),(0,j.jsx)(`ul`,{className:`stack`,style:{gap:2,margin:0,paddingLeft:18},children:r.rejected.map((e,t)=>(0,j.jsx)(`li`,{className:`muted`,children:e},t))})]})]})]})}function jd(e,t){return e?.scrollIntoView?.({block:`nearest`}),e?.focus({preventScroll:!0}),()=>{t&&t.isConnected!==!1&&t.focus({preventScroll:!0})}}function Md(){let e=(0,v.useRef)(null);return(0,v.useEffect)(()=>{let t=typeof document>`u`?null:document.activeElement,n=t&&typeof t.focus==`function`&&t!==document.body?t:null;return jd(e.current,n)},[]),e}var Nd=w.connect,Pd=e=>e.repo?`repo:${e.repo}`:`system:${e.system}`,Fd=(e,t)=>`/api/links/candidates?from=${encodeURIComponent(e)}&${t.repo?`to=${encodeURIComponent(t.repo)}`:`system=${encodeURIComponent(t.system)}`}`,Id=e=>e instanceof M?e.problem.detail??e.message:e instanceof Error?e.message:String(e);function Ld(e,t){return[...t].filter(t=>e[t]).sort().map(t=>({call:t,api:e[t]}))}function Rd(e){let t={},n=new Set;for(let r of e.calls)r.status!==`paired`&&r.suggestion&&(t[r.fact]=r.suggestion.api,r.confident&&n.add(r.fact));return{picked:t,ticked:n}}function zd(e,t){return!t||e.some(e=>Pd(e.box)===Pd(t.box))?[...e]:[...e,t].sort((e,t)=>e.label<t.label?-1:1)}function Bd(e){let t=(0,v.useId)(),[n,r]=(0,v.useState)(e.initial?Pd(e.initial.box):``),i=zd(e.boxes,e.initial),a=i.find(e=>Pd(e.box)===n)?.box,o=P(a?Fd(e.from,a):void 0),s=Md(),c=i.find(e=>Pd(e.box)===n)?.label;return(0,j.jsxs)(`section`,{className:`stack connect-panel`,"aria-labelledby":`${t}-t`,children:[(0,j.jsxs)(`div`,{className:`box-pop-head`,children:[(0,j.jsx)(`h4`,{id:`${t}-t`,ref:s,tabIndex:-1,className:`h box-pop-title`,children:Nd.title(e.from)}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:e.onClose,children:Nd.close})]}),(0,j.jsxs)(`p`,{className:`box-ends`,children:[(0,j.jsx)(`span`,{className:`sr`,children:Nd.ends(e.from,c??Nd.pickBoxNone)}),(0,j.jsx)(`span`,{"aria-hidden":`true`,className:`chip mono`,children:e.from}),(0,j.jsx)(`span`,{"aria-hidden":`true`,children:`→`}),(0,j.jsx)(`span`,{"aria-hidden":`true`,className:`chip mono ${c?``:`dim`}`,children:c??Nd.pickBoxNone})]}),(0,j.jsx)(`p`,{className:`ev-say`,children:Nd.intro}),(0,j.jsx)(`label`,{htmlFor:`${t}-to`,className:`hud`,children:Nd.pickBox}),(0,j.jsxs)(`select`,{id:`${t}-to`,className:`field`,value:n,onChange:e=>r(e.target.value),children:[(0,j.jsx)(`option`,{value:``,children:Nd.pickBoxNone}),i.map(e=>(0,j.jsx)(`option`,{value:Pd(e.box),children:e.label},Pd(e.box)))]}),a&&(0,j.jsx)(Vd,{from:e.from,box:a}),a&&(0,j.jsx)(Ud,{from:e.from,box:a,cands:o},n)]})}function Vd(e){let t=(Mi(Oi())?.links.items??[]).filter(t=>t.repo===e.from&&!!e.box.repo&&t.to?.repo===e.box.repo);return t.length?(0,j.jsxs)(`details`,{className:`stack`,children:[(0,j.jsx)(`summary`,{className:`hud`,children:w.decisions.betweenTitle(t.length)}),(0,j.jsx)(`ul`,{className:`stack`,style:{gap:8,margin:0,paddingLeft:18},children:t.map(e=>(0,j.jsxs)(`li`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`span`,{children:e.what}),(0,j.jsx)(Fi,{item:e.item,run:e.run})]},e.item))})]}):null}function Hd(e){return e.rule?Nd.undoneRuleStays(e.rule.question,e.rule.target):Nd.undone}function Ud(e){let t=e.cands.state===`ready`?e.cands.data:void 0,[n,r]=(0,v.useState)({}),[i,a]=(0,v.useState)(new Set),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(),[u,d]=(0,v.useState)(),[f,p]=(0,v.useState)(),[m,h]=(0,v.useState)(),[g,_]=(0,v.useState)();(0,v.useEffect)(()=>{if(!t)return;let e=Rd(t);r(e.picked),a(e.ticked)},[t]);let y=(0,v.useMemo)(()=>t?.calls.filter(e=>e.status!==`paired`)??[],[t]),[b,x]=(0,v.useState)(``),S=(0,v.useId)(),C=(0,v.useMemo)(()=>({confident:y.filter(e=>e.confident).length,suggested:y.filter(e=>e.suggestion).length,none:y.filter(e=>!e.suggestion).length}),[y]),w=e=>a(e===`none`?new Set:new Set(y.filter(t=>t.suggestion&&(e===`suggested`||t.confident)).map(e=>e.fact))),T=Ld(n,i),E=e.post??(e=>N(`/api/links/connect`,{method:`POST`,body:e})),D=JSON.stringify({pairs:T,rule:!!o}),[ee,te]=(0,v.useState)(),[ne,O]=(0,v.useState)(!1),re=async t=>{if(!T.length&&!o){d(Nd.nothingPicked);return}l(t),d(void 0);let n=D;try{let r=await E({from:e.from,to:e.box,pairs:T,...o?{rule:!0}:{},...t===`preview`?{preview:!0}:{}});t===`preview`?(p(r),te(n)):(h(r),_(void 0),p(void 0),e.cands.reload?.())}catch(e){d(Id(e))}finally{l(void 0)}},k=async()=>{if(!m||ne)return;O(!0),d(void 0);let t=m.lines;try{for(let n of m.lines)await N(`/api/facts/${encodeURIComponent(e.from)}/corrections/undo`,{method:`POST`,body:{line:n}}),t=t.filter(e=>e!==n);_(m),h(void 0),e.cands.reload?.()}catch(e){h({...m,lines:t}),d(Id(e))}finally{O(!1)}};if(e.cands.state===`loading`)return(0,j.jsx)(`p`,{role:`status`,"aria-busy":`true`,className:`ev-say`,children:Nd.loading});if(e.cands.state===`error`)return(0,j.jsx)(`p`,{role:`alert`,className:`state error`,children:Nd.failed(e.cands.error)});let A=e.cands.data;return(0,j.jsxs)(`div`,{className:`stack`,children:[A.noCalls&&(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsx)(`p`,{className:`ev-say`,children:A.noCalls.why===`unverified`?Nd.unverifiedCalls(A.from):Nd.noCalls(A.from)}),(0,j.jsx)(Gd,{text:A.noCalls.command})]}),A.noApis&&(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsx)(`p`,{className:`ev-say`,children:Nd.noApis[A.noApis.why](A.toName)}),(0,j.jsx)(Gd,{text:A.noApis.command})]}),!A.noCalls&&!y.length&&(0,j.jsx)(`p`,{className:`ev-say`,children:Nd.noLoose}),y.length>0&&A.apis.length>0&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`ev-say`,children:Nd.tally(C.confident,C.suggested,C.none)}),(0,j.jsxs)(`div`,{className:`box-btns`,children:[C.confident>0&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>w(`confident`),children:Nd.tickConfident(C.confident)}),C.suggested>0&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>w(`suggested`),children:Nd.tickSuggested(C.suggested)}),i.size>0&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>w(`none`),children:Nd.untickAll}),A.apis.length>20&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`label`,{htmlFor:`connect-find`,className:`sr`,children:Nd.findApi}),(0,j.jsx)(`input`,{id:`connect-find`,className:`field`,type:`search`,placeholder:Nd.findApi,value:b,onChange:e=>x(e.target.value),style:{flex:`1 1 100%`,minWidth:0}})]})]})]}),y.length>0&&A.apis.length>0&&(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,j.jsx)(`p`,{id:`${S}-c`,className:`hud box-sub`,children:Nd.caption(A.from,A.toName)}),(0,j.jsx)(`ul`,{className:`box-calls`,"aria-labelledby":`${S}-c`,children:y.map(e=>{let t=`${e.method??``} ${e.path}`.trim();return(0,j.jsxs)(`li`,{className:`box-call`,children:[(0,j.jsxs)(`label`,{className:`box-call-head`,title:`${t}\n${e.at}`,children:[(0,j.jsx)(`input`,{type:`checkbox`,"aria-label":`${Nd.col.pick}: ${t}`,checked:i.has(e.fact),onChange:t=>a(n=>{let r=new Set(n);return t.target.checked?r.add(e.fact):r.delete(e.fact),r})}),(0,j.jsxs)(`span`,{className:`box-call-what`,children:[(0,j.jsxs)(`span`,{className:`box-path`,children:[e.method&&(0,j.jsx)(`span`,{className:`box-method`,children:e.method}),(0,j.jsx)(`code`,{className:`mono`,children:e.path})]}),(0,j.jsx)(`span`,{className:`box-at mono`,children:e.at})]}),(0,j.jsxs)(`span`,{className:`chip dim box-now`,children:[(0,j.jsxs)(`span`,{className:`sr`,children:[Nd.col.status,`: `]}),Nd.status[e.status]]})]}),e.why&&(0,j.jsx)(`span`,{className:`box-why`,children:Nd.leftWhy[e.why]??e.why}),(0,j.jsxs)(`select`,{className:`field`,"aria-label":`${Nd.col.api}: ${t}`,value:n[e.fact]??``,onChange:t=>{let n=t.target.value;r(t=>({...t,[e.fact]:n})),n&&a(t=>new Set(t).add(e.fact))},children:[(0,j.jsx)(`option`,{value:``,children:Nd.pickApi}),e.suggestions?.length?(0,j.jsx)(`optgroup`,{label:Nd.likely,children:e.suggestions.map(e=>{let t=A.apis.find(t=>t.id===e.api);return t?(0,j.jsxs)(`option`,{value:t.id,children:[`${t.method??``} ${t.path}`.trim(),` · `,Nd.why[e.why]??e.why]},t.id):null})}):null,(0,j.jsx)(`optgroup`,{label:Nd.allApis,children:A.apis.filter(t=>{let r=b.trim().toLowerCase();if(!r)return!0;let i=`${t.method??``} ${t.path} ${t.words??``}`.toLowerCase();return r.split(/\s+/).every(e=>i.includes(e))||t.id===n[e.fact]}).map(e=>(0,j.jsx)(`option`,{value:e.id,children:`${e.method??``} ${e.path}`.trim()},e.id))})]}),e.suggestion&&n[e.fact]===e.suggestion.api&&(0,j.jsx)(`span`,{className:`box-why`,children:Nd.suggested(Nd.why[e.suggestion.why])})]},e.fact)})})]}),y.length>0&&A.apis.length>0&&(0,j.jsx)(Ad,{from:e.from,box:e.box,toName:A.toName,calls:y,apis:A.apis,...e.match?{io:e.match}:{},onTake:e=>{r(t=>({...t,...Object.fromEntries(e.map(e=>[e.call,e.api]))})),a(t=>new Set([...t,...e.map(e=>e.call)])),p(void 0)}}),A.rule&&(0,j.jsxs)(`label`,{className:`box-check`,children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:o,onChange:e=>s(e.target.checked)}),Nd.rule(A.rule.calls)]}),u&&(0,j.jsx)(`p`,{role:`alert`,className:`state error`,children:u}),(y.length>0||A.rule)&&(0,j.jsxs)(`div`,{className:`box-foot`,children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>void re(`preview`),disabled:!!c,"aria-busy":c===`preview`,children:c===`preview`?Nd.previewing:Nd.preview}),(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,onClick:()=>void re(`write`),disabled:!!c||!f||ee!==D,"aria-busy":c===`write`,children:c===`write`?Nd.writing:Nd.confirm(T.length,o)})]}),f&&ee===D&&(0,j.jsx)(wd,{file:f.file,line:f.lines.join(`
|
|
35
|
+
+ `),preview:f.preview?{state:`ready`,data:f.preview}:{state:`loading`}}),m&&(0,j.jsxs)(`div`,{className:`stack`,children:[m.rule&&(0,j.jsx)(`p`,{className:`ev-say`,children:Nd.ruleWritten(m.rule.question)}),(0,j.jsx)(_l,{said:Nd.written(m.lines.length,m.file),verify:m.verify,commit:m.commit}),m.lines.length>0&&(0,j.jsxs)(`div`,{className:`box-btns`,children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>void k(),disabled:ne,"aria-busy":ne,children:Nd.undo}),(0,j.jsx)(Wd,{repo:e.from,line:m.lines[0]})]})]}),g&&(0,j.jsx)(`p`,{role:`status`,className:`ev-say`,children:Hd(g)})]})}function Wd({repo:e,line:t}){let[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(),[o,s]=(0,v.useState)();return i?(0,j.jsxs)(`div`,{className:`stack`,role:`status`,children:[(0,j.jsx)(`p`,{className:`ev-say`,children:Nd.ruleMade(i.file)}),(0,j.jsx)(Gd,{text:i.activate})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:n,"aria-busy":n,onClick:()=>{r(!0),s(void 0),N(`/api/reading-rules/from-pairing`,{method:`POST`,body:{repo:e,line:t}}).then(a,e=>s(Id(e))).finally(()=>r(!1))},children:n?Nd.makingRule:Nd.makeRule}),o&&(0,j.jsx)(`p`,{role:`alert`,className:`state error`,children:o})]})}function Gd({text:e}){return ul(e)?(0,j.jsx)(sc,{text:e,label:Nd.copy,scope:`corrections`}):(0,j.jsxs)(`div`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`code`,{className:`mono`,children:e}),(0,j.jsx)(sr,{text:e,label:`${Nd.copy}: ${e}`})]})}var Kd=w.owner,qd=`\0add`,Jd=e=>e instanceof M?e.problem.detail??e.message:e instanceof Error?e.message:String(e);function Yd(e){let t=P(`/api/repos/${encodeURIComponent(e.repo)}/owner`);return(0,j.jsx)(Xd,{repo:e.repo,view:t,onClose:e.onClose})}function Xd(e){let t=(0,v.useId)(),n=e.view.state===`ready`?e.view.data:void 0,[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)(),[p,m]=(0,v.useState)(),[h,g]=(0,v.useState)(),[_,y]=(0,v.useState)();(0,v.useEffect)(()=>{n&&(i(n.owner),o(n.system??``))},[n]);let b=e.put??(t=>N(`/api/repos/${encodeURIComponent(e.repo)}/owner`,{method:`PUT`,body:t})),x=()=>{if(!n)return;let e={};return r===qd?s.trim()&&l.trim()&&(e.addTeam={id:s.trim(),name:l.trim()}):r&&r!==n.owner&&(e.owner=r),a&&a!==(n.system??``)&&(e.system=a),e.owner||e.system||e.addTeam?e:void 0},S=JSON.stringify(x()??null),[C,w]=(0,v.useState)(),[T,E]=(0,v.useState)(),D=p===Kd.nothing&&T!==S?void 0:p,ee=async t=>{let n=x();if(!n)m(Kd.nothing),E(S),g(void 0);else{f(t),m(void 0);try{let r=await b({...n,...t===`preview`?{preview:!0}:{}});t===`preview`?(g(r),w(JSON.stringify(n))):(y(r),g(void 0),e.view.reload?.())}catch(e){m(Jd(e))}finally{f(void 0)}}},te=Md();return(0,j.jsxs)(`section`,{className:`stack connect-panel`,"aria-labelledby":`${t}-t`,children:[(0,j.jsxs)(`div`,{className:`box-pop-head`,children:[(0,j.jsx)(`h4`,{id:`${t}-t`,ref:te,tabIndex:-1,className:`h box-pop-title`,children:Kd.title(e.repo)}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:e.onClose,children:Kd.close})]}),e.view.state===`loading`&&(0,j.jsx)(`p`,{role:`status`,"aria-busy":`true`,className:`ev-say`,children:Kd.loading}),e.view.state===`error`&&(0,j.jsx)(`p`,{role:`alert`,className:`state error`,children:Kd.failed(e.view.error)}),n&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`ev-say`,children:Kd.intro(n.file)}),(0,j.jsx)(`label`,{htmlFor:`${t}-o`,className:`hud`,children:Kd.owner}),(0,j.jsxs)(`select`,{id:`${t}-o`,className:`field`,value:r,onChange:e=>{i(e.target.value),g(void 0)},children:[!n.teams.some(e=>e.id===n.owner)&&(0,j.jsx)(`option`,{value:n.owner,children:n.owner}),n.teams.map(e=>(0,j.jsx)(`option`,{value:e.id,children:e.name===e.id?e.id:`${e.name} (${e.id})`},e.id)),(0,j.jsx)(`option`,{value:qd,children:Kd.addTeam})]}),r===qd&&(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsx)(`label`,{htmlFor:`${t}-ti`,className:`hud`,children:Kd.teamId}),(0,j.jsx)(`input`,{id:`${t}-ti`,className:`field`,value:s,onChange:e=>c(e.target.value)}),(0,j.jsx)(`label`,{htmlFor:`${t}-tn`,className:`hud`,children:Kd.teamName}),(0,j.jsx)(`input`,{id:`${t}-tn`,className:`field`,value:l,onChange:e=>u(e.target.value)}),(0,j.jsx)(`p`,{className:`ev-say`,children:Kd.teamNote})]}),(0,j.jsx)(`label`,{htmlFor:`${t}-s`,className:`hud`,children:Kd.system}),(0,j.jsxs)(`select`,{id:`${t}-s`,className:`field`,value:a,onChange:e=>{o(e.target.value),g(void 0)},children:[!n.system&&(0,j.jsx)(`option`,{value:``,children:Kd.noSystem}),n.system&&!n.systems.some(e=>e.id===n.system)&&(0,j.jsx)(`option`,{value:n.system,children:n.system}),n.systems.map(e=>(0,j.jsx)(`option`,{value:e.id,children:e.name===e.id?e.id:`${e.name} (${e.id})`},e.id))]}),D&&(0,j.jsx)(`p`,{role:`alert`,className:`state error`,children:D}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:8},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:!!d,"aria-busy":d===`preview`,onClick:()=>void ee(`preview`),children:d===`preview`?Kd.previewing:Kd.preview}),(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:!!d||!h||C!==S,"aria-busy":d===`write`,onClick:()=>void ee(`write`),children:d===`write`?Kd.writing:Kd.confirm})]}),h&&C===S&&(0,j.jsx)(Zd,{r:h}),_&&(0,j.jsx)(_l,{said:Kd.written,verify:_.verify,commit:_.commit})]})]})}function Zd({r:e}){return(0,j.jsx)(`div`,{className:`stack`,children:e.files.map(e=>(0,j.jsx)(At,{caption:Kd.diffOf(e.file),children:e.changes.flatMap(e=>[...e.was===void 0?[]:[`- ${e.was}`],...e.now===void 0?[]:[`+ ${e.now}`]]).join(`
|
|
36
|
+
`)},e.file))})}var Qd=w.declare,$d=w.corrections,ef=w.addBox,tf=e=>e instanceof M?e.problem.detail??e.message:e instanceof Error?e.message:String(e);function nf({r:e,label:t}){return(0,j.jsx)(_l,{said:t,verify:e.verify,commit:e.commit})}function rf(e,t,n){let r=n.trim();if(r)return t===`call`?{kind:`call`,system:e,route:r}:{kind:`topic`,system:e,topic:r,side:t}}function af(e){let t=(0,v.useId)(),[n,r]=(0,v.useState)(`publishes`),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(),[c,l]=(0,v.useState)(),[u,d]=(0,v.useState)(),[f,p]=(0,v.useState)(),m=e.post??(e=>N(`/api/declared-links`,{method:`POST`,body:e})),h=JSON.stringify(rf(e.system,n,i)??null),[g,_]=(0,v.useState)(),y=async t=>{let r=rf(e.system,n,i);if(!r)l(Qd.empty);else{s(t),l(void 0);try{let e=await m({...r,...t===`preview`?{preview:!0}:{}});t===`preview`?(d(e),_(JSON.stringify(r))):(p(e),d(void 0))}catch(e){l(tf(e))}finally{s(void 0)}}},b=Md();return(0,j.jsxs)(`section`,{className:`stack connect-panel`,"aria-labelledby":`${t}-t`,children:[(0,j.jsxs)(`div`,{className:`box-pop-head`,children:[(0,j.jsx)(`h4`,{id:`${t}-t`,ref:b,tabIndex:-1,className:`h box-pop-title`,children:Qd.title(e.label)}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:e.onClose,children:Qd.close})]}),(0,j.jsx)(`p`,{className:`ev-say`,children:Qd.intro}),(0,j.jsxs)(`fieldset`,{className:`stack`,style:{border:0,padding:0,margin:0},children:[(0,j.jsx)(`legend`,{className:`hud`,children:Qd.kind}),[`publishes`,`listens`,`call`].map(e=>(0,j.jsxs)(`label`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`input`,{type:`radio`,name:`${t}-k`,checked:n===e,onChange:()=>{r(e),d(void 0)}}),Qd.kinds[e]]},e))]}),(0,j.jsx)(`label`,{htmlFor:`${t}-v`,className:`hud`,children:n===`call`?Qd.route:Qd.topic}),(0,j.jsx)(`input`,{id:`${t}-v`,className:`field`,value:i,onChange:e=>{a(e.target.value),d(void 0)}}),c&&(0,j.jsx)(`p`,{role:`alert`,className:`state error`,children:c}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:8},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:!!o,"aria-busy":o===`preview`,onClick:()=>void y(`preview`),children:o===`preview`?Qd.previewing:Qd.preview}),(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:!!o||!u||g!==h,onClick:()=>void y(`write`),children:o===`write`?Qd.writing:Qd.confirm})]}),u&&g===h&&(0,j.jsx)(Zd,{r:u}),f&&(0,j.jsx)(nf,{r:f,label:Qd.written})]})}function of(e){let[t,n]=(0,v.useState)(!1),r=e.box.repo?`/api/boxes/corrections?repo=${encodeURIComponent(e.box.repo)}`:`/api/boxes/corrections?system=${encodeURIComponent(e.box.system)}`,i=P(t?r:void 0);return(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsx)(`h4`,{className:`hud`,children:$d.title}),t?(0,j.jsx)(sf,{of:i}):(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>n(!0),children:$d.show})]})}function sf(e){let[t,n]=(0,v.useState)(),[r,i]=(0,v.useState)(),[a,o]=(0,v.useState)(),s=e.undo??(e=>`line`in e?N(`/api/facts/${encodeURIComponent(e.repo)}/corrections/undo`,{method:`POST`,body:{line:e.line}}):N(`/api/declared-links/undo`,{method:`POST`,body:e}));if(e.of.state===`loading`)return(0,j.jsx)(`p`,{role:`status`,"aria-busy":`true`,className:`ev-say`,children:$d.loading});if(e.of.state===`error`)return(0,j.jsx)(`p`,{role:`alert`,className:`state error`,children:$d.failed(e.of.error)});let c=e.of.data.items;return(0,j.jsxs)(`div`,{className:`stack`,children:[!c.length&&(0,j.jsx)(`p`,{className:`ev-say`,children:$d.none}),c.length>0&&(0,j.jsx)(`ul`,{className:`stack`,style:{paddingLeft:18,margin:0},children:c.map((r,a)=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`span`,{className:`chip dim`,children:$d.kinds[r.kind]}),` `,r.says,r.ai&&(0,j.jsxs)(j.Fragment,{children:[` `,(0,j.jsx)(Ni,{run:r.ai.run})]}),r.by&&(0,j.jsxs)(`span`,{className:`hud`,children:[` · `,$d.by(r.by,r.at??``)]}),` `,(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:t!==void 0,"aria-busy":t===a,onClick:()=>{n(a),i(void 0),s(r.undo).then(t=>{o({verify:t.verify,commit:t.commit}),e.of.reload?.()}).catch(e=>i(tf(e))).finally(()=>n(void 0))},children:t===a?$d.undoing:$d.undo})]},`${r.file}:${a}`))}),r&&(0,j.jsx)(`p`,{role:`alert`,className:`state error`,children:r}),a&&(0,j.jsx)(_l,{said:$d.undone,verify:a.verify,commit:a.commit})]})}function cf(e){let t=P(`/api/boxes/addable`);return(0,j.jsx)(lf,{of:t,onClose:e.onClose})}function lf(e){let t=(0,v.useId)(),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(`vendor`),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(),[f,p]=(0,v.useState)(),[m,h]=(0,v.useState)(),[g,_]=(0,v.useState)(),y=e.post??(e=>N(`/api/boxes`,{method:`POST`,body:e})),b={id:n.trim(),name:i.trim(),boundary:o,...c&&o===`internal`?{owner:c}:{}},x=JSON.stringify(b),[S,C]=(0,v.useState)(),T=async e=>{d(e),p(void 0);try{let t=await y({...b,...e===`preview`?{preview:!0}:{}});e===`preview`?(h(t),C(JSON.stringify(b))):(_(t),h(void 0))}catch(e){p(tf(e))}finally{d(void 0)}},E=Md();return(0,j.jsxs)(`section`,{className:`stack connect-panel`,"aria-labelledby":`${t}-t`,children:[(0,j.jsxs)(`div`,{className:`box-pop-head`,children:[(0,j.jsx)(`h4`,{id:`${t}-t`,ref:E,tabIndex:-1,className:`h box-pop-title`,children:ef.title}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:e.onClose,children:ef.close})]}),e.of.state===`loading`&&(0,j.jsx)(`p`,{role:`status`,"aria-busy":`true`,className:`ev-say`,children:ef.loading}),e.of.state===`error`&&(0,j.jsx)(`p`,{role:`alert`,className:`state error`,children:ef.failed(e.of.error)}),e.of.state===`ready`&&(0,j.jsxs)(j.Fragment,{children:[(()=>{let t=e.of.data.repos.filter(e=>!e.read);return t.length?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`ev-say`,children:ef.notRead}),(0,j.jsx)(`ul`,{className:`stack`,style:{paddingLeft:18,margin:0},children:t.map(e=>(0,j.jsxs)(`li`,{className:`row`,style:{gap:6,flexWrap:`wrap`},children:[(0,j.jsx)(`span`,{className:`mono`,children:e.name}),(0,j.jsx)(gl,{repo:e.id}),(0,j.jsxs)(`details`,{className:`work-terminal`,children:[(0,j.jsx)(`summary`,{children:w.appStep.inTerminal}),(0,j.jsx)(`code`,{className:`mono`,children:ef.readCommand(e.id)})]})]},e.id))})]}):(0,j.jsx)(`p`,{className:`ev-say`,children:ef.allRead})})(),(0,j.jsx)(`h5`,{className:`hud`,children:ef.newSystem}),(0,j.jsx)(`label`,{htmlFor:`${t}-id`,className:`hud`,children:ef.id}),(0,j.jsx)(`input`,{id:`${t}-id`,className:`field`,value:n,onChange:e=>r(e.target.value)}),(0,j.jsx)(`label`,{htmlFor:`${t}-n`,className:`hud`,children:ef.name}),(0,j.jsx)(`input`,{id:`${t}-n`,className:`field`,value:i,onChange:e=>a(e.target.value)}),(0,j.jsx)(`label`,{htmlFor:`${t}-b`,className:`hud`,children:ef.boundary}),(0,j.jsx)(`select`,{id:`${t}-b`,className:`field`,value:o,onChange:e=>s(e.target.value),children:[`vendor`,`internal`].map(e=>(0,j.jsx)(`option`,{value:e,children:ef.boundaries[e]},e))}),o===`internal`&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`label`,{htmlFor:`${t}-o`,className:`hud`,children:ef.owner}),(0,j.jsxs)(`select`,{id:`${t}-o`,className:`field`,value:c,onChange:e=>l(e.target.value),children:[(0,j.jsx)(`option`,{value:``,children:ef.noOwner}),e.of.data.teams.map(e=>(0,j.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),f&&(0,j.jsx)(`p`,{role:`alert`,className:`state error`,children:f}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:8},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:!!u||!n.trim()||!i.trim(),"aria-busy":u===`preview`,onClick:()=>void T(`preview`),children:u===`preview`?ef.previewing:ef.preview}),(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:!!u||!m||S!==x,onClick:()=>void T(`write`),children:u===`write`?ef.writing:ef.confirm})]}),m&&S===x&&(0,j.jsx)(Zd,{r:m}),g&&(0,j.jsx)(nf,{r:g,label:ef.written})]})]})}function uf(e){let t=/^(.+):(\d+)$/.exec(e.trim());return t?{file:t[1],line:Number(t[2])}:void 0}function df(e,t,n){let r=[];for(let i of e.facts){i.cite.file===t&&i.cite.line===n&&r.push({fact:i,spot:i.cite});for(let e of i.steps??[])e.file===t&&e.line===n&&r.push({fact:i,spot:e,step:e.what})}return r}var ff=(e,t,n)=>e.questions.filter(e=>e.evidence.includes(`${t}:${n}`)),pf=e=>!!e.correction&&(e.correction.action===`wrong`||e.by!==`person`);function mf(e,t){if(!e||!t.length)return[];let n=t.flatMap(t=>df(e,t.file,t.line)),r=[];return n.some(e=>e.fact.verified!==`none`)||r.push(`unverified`),t.some(t=>ff(e,t.file,t.line).length)&&r.push(`question`),n.some(e=>pf(e.fact))&&r.push(`corrected`),r}function hf(e,t,n={}){let r=new Map;for(let t of e){if(!t.repo)continue;let e=t.at?uf(t.at):t.path&&t.line?{file:t.path,line:t.line}:void 0;e&&r.set(t.repo,[...r.get(t.repo)??[],e])}if(!r.size)return n.bare&&e.length===0?[`unverified`]:[];let i=new Set,a=0,o=0;for(let[e,n]of r){let r=t(e);if(!r)continue;a++;let s=mf(r,n);s.includes(`unverified`)&&o++;for(let e of s)e!==`unverified`&&i.add(e)}return a>0&&o===a&&i.add(`unverified`),[...i].sort()}var gf=e=>[...new Set(e.map(e=>e.repo).filter(e=>!!e))];function _f(e,t){let n=(e,t)=>`${e??``}|${t}`,r=new Set(e.caller.map(e=>n(e.repo,e.at))),i=new Set(e.callee.map(e=>n(e.repo,e.at))),a=e=>!!e.system&&!!e.entry&&e.entry.repo===e.call.repo&&e.entry.fact===e.call.fact&&i.has(n(e.entry.repo,e.entry.at));return t.filter(t=>(t.interfaces??(t.interface?[t.interface]:[])).includes(e.interface)||!t.interface&&(r.has(n(t.call.repo,t.call.at))||a(t)))}function vf(e,t){let n=e.flatMap(e=>_f(e,t));return[...n.some(e=>e.status===`mismatch`)?[`contract-mismatch`]:[],...n.some(e=>e.status===`unconfirmed`)?[`contract-unconfirmed`]:[]]}var yf=`#/mismatches`,U={title:`Architecture`,lens:`Lens`,lenses:{architecture:`Architecture`,repo:`Repo`,data:`Data`,integration:`Integration`,infrastructure:`Infrastructure`},breadcrumbs:`Where you are`,canvas:`Picture`,canvasLabel:`The picture of this part of the estate`,canvasHelp:`Drag a box to move it; its links follow. Double-click a box to open it here. Scroll or use the buttons to zoom. The outline below has the same boxes for keyboards.`,layingOut:`Laying out the picture`,layingOutBoxes:w.architecture.layingOutBoxes,readingEstate:w.architecture.readingEstate,joiningEstate:w.architecture.joiningEstate,contractsFailed:w.architecture.contractsFailed,layoutFailed:e=>`Couldn't lay out the picture: ${e}`,minimap:`Map of the whole picture`,keep:`Keep this arrangement`,keeping:`Keeping`,kept:e=>`Kept in ${e}. The view opens like this next time.`,keepFailed:e=>`Couldn't keep the arrangement: ${e}`,keptNothing:`Drag a box first: only boxes you moved are kept.`,tidy:`Tidy up`,reset:`Reset`,resetDone:`Arrangement dropped. Every box is placed by the layout again.`,resetAsk:`Drop the kept arrangement for everyone who opens this picture?`,resetYes:`Yes, drop it`,resetNo:`Keep it`,moved:e=>`${e} box${e===1?``:`es`} placed by you`,openHere:`Open here`,closeHere:`Close here`,gapsOn:e=>`${e} thing${e===1?``:`s`} missing`,sharedGaps:e=>`Every part here is missing the same thing: ${e}.`,insideGaps:e=>`every part inside is missing: ${e}`,insideLinks:e=>`${e} link${e===1?``:`s`} inside`,edgeCount:(e,t)=>`${e} × ${t}`,outside:(e,t)=>`${e} of ${t} box${t===1?``:`es`} ${e===1?`is`:`are`} outside the view`,fitAll:`Fit to see all`,legible:{nodes:e=>`This picture has ${e} boxes, more than about 60 can be read at once.`,crossings:`Too many links cross in this picture to follow them.`,api:`This view is clearer another way.`,focus:`Open one in focus to see who reads and writes it.`,collapse:`Close the parts opened here to see the whole again.`,group:`Open one part at a time instead.`},collapseAll:`Close the parts opened here`,openPart:e=>`Open ${e}`,outline:`Outline`,outlineHelp:`Tab moves through the boxes. Enter opens one. Escape closes it. Arrow keys move up and down.`,inspector:`Details`,pick:`Pick a box to see its details.`,open:`Open`,close:`Close`,focus:`Show in focus`,focusOff:`Back to the whole view`,focusHint:`Tables are clearer one at a time. Open one in focus to see who reads and writes it.`,groupHint:`This view has more boxes than can be read at once. Open a part of it instead.`,empty:`Nothing to show here in this lens.`,emptyEstate:`The catalog is empty. Read a repo first: your assistant reads its code, and Atticus checks each fact against its line and draws the map.`,properties:`Properties`,kind:`Kind`,stateLabel:`State`,loading:`Loading`,loadFailed:e=>`Couldn't load this: ${e}`,stepFailed:e=>`That couldn't be opened: ${e}. The picture is as it was.`,dismiss:`Dismiss`,evidence:`Where it was found`,noEvidence:`No file cited.`,gaps:`What is missing`,gapsBadge:e=>e===1?`thing missing`:`things missing`,kindWord:{repo:`repo`,system:`system`,component:`component`},noGaps:`Nothing missing.`,next:`Next step`,copy:`Copy`,copied:`Copied`,state:{current:`Current`,new:`New`,changed:`Changed`,retired:`Retired`},gap:{"contract-mismatch":`The two sides' payloads don't match`,"contract-unconfirmed":`The payloads may not match: a mapping isn't traced`,inferred:`Seen at one end only`,"no-repo":`No repo known`,"no-system":`No system known`,"no-component":`No component known`,"no-owner":`No owner known`,"no-store":`No store known`,"no-endpoint":`Endpoint not found`,"not-in-catalog":`Not in the catalog`,conflicts:`Sources disagree`,"joined-by-path":`Joined by its path: nobody named where it goes`,"joined-by-label":`Joined by its host's first part: a guess`,"joined-by-platform-setting":`Joined by a platform-wide setting: a guess`,"joined-by-folder-name":`Joined by the folder its host's setting is in: a guess`,"joined-despite-conflict":`Joined by a host the manifest disagrees with: a guess`,"joined-by-service-name":`Joined by a Service's short name from another namespace: a guess`,"joined-by-path-overlap":`Joined under a base path nothing names: a guess`,unverified:`No fact verified from code`,question:`A question is open on it`,corrected:`A correction waits for atticus verify`,"not-in-shared-map":`Their shared map has no entry for it`,"no-listener":w.topics.noListener,"no-publisher":w.topics.noPublisher,"declared-topic":w.topics.declaredGap},gapFix:{inferred:`Only one side's code shows it. Read the other side's repo, or open Why is this linked? on its links.`,"no-repo":`Add the repo that builds it to the manifest, then read it.`,"no-system":`Say which system it is part of in the manifest.`,"no-component":`Read the repo so its components are known.`,"no-owner":`Name the owner in the manifest.`,"no-store":`Read the repo that owns the store.`,"no-endpoint":`Read the callee's repo so its entry is known.`,"not-in-catalog":`Read the repo that has it.`,conflicts:`Open the record and settle which source is right.`,"joined-by-path":`Open Why is this linked?, and say where it goes if the guess is wrong.`,"joined-by-label":`Open Why is this linked?, and say where it goes if the guess is wrong.`,"joined-by-platform-setting":`Open Why is this linked?, and say where it goes if the guess is wrong; or set the variable for this service.`,"joined-by-folder-name":`Open Why is this linked?, and say where it goes if the guess is wrong; or name the service in the setting's target.`,"joined-despite-conflict":`Settle the host conflict on Map › Trust (list the host in the manifest, or correct the deploy file).`,"joined-by-service-name":`Open Why is this linked?, and say where it goes if the guess is wrong; or have the caller's own Service read so its namespace is known, or call the Service by its full .svc.cluster.local name.`,"joined-by-path-overlap":`Set the service's basePath in repos.manifest.yaml (the path its routes sit under), or have its context path setting read; or say where it goes if the guess is wrong.`,unverified:`Read the repo and verify it; Map › Trust lists what isn't checked yet.`,question:`Answer the open question on Questions; Map › Trust lists the repo's questions.`,corrected:`Run atticus verify on the repo with --write to apply the correction.`,"not-in-shared-map":`Ask the team that owns the system (their map is theirs to change), refresh it with atticus join shared refresh, or correct the call if it goes elsewhere.`,"no-listener":w.topics.noListenerFix,"no-publisher":w.topics.noPublisherFix,"declared-topic":w.topics.declaredFix},repoCounts:`See what each count holds on Map › Trust`,edges:(e,t)=>`${e} link${e===1?``:`s`}${t?`, ${t} implied link${t===1?``:`s`} hidden`:``}`,outsideMark:`outside`,children:e=>`${e} inside`},bf=e=>e.length>1?e[0].gaps.filter(t=>e.every(e=>e.gaps.includes(t))):[];function xf(e,t,n){let r=e.get(t)?.node;if(!r)return[];let i=[],a=(t,r,o)=>{let s=n.has(t.id)&&e.has(t.id),c=s?e.get(t.id).children:[],l=bf(c);i.push({node:t,depth:r,expanded:s,gaps:t.gaps.filter(e=>!o.includes(e)),inside:l});for(let e of c)a(e,r+1,l)};return a(r,0,[]),i}function Sf(e,t,n){let r=e.findIndex(e=>e.node.id===t);if(r<0)return;let i=e[r];switch(n){case`ArrowDown`:return{focus:e[Math.min(e.length-1,r+1)].node.id};case`ArrowUp`:return{focus:e[Math.max(0,r-1)].node.id};case`Home`:return{focus:e[0].node.id};case`End`:return{focus:e[e.length-1].node.id};case`Enter`:case`ArrowRight`:return i.node.childCount>0?{open:t}:{select:t};case`Escape`:case`ArrowLeft`:return i.expanded?{close:t}:i.node.parent&&e.some(e=>e.node.id===i.node.parent)?{focus:i.node.parent}:void 0;default:return}}var Cf=e=>e===`depends-on`?w.why.dependency.edge:e;function wf(e){return e.ai?`ai`:e.declared||e.paired?`person`:`code`}function Tf(e){let t={fromCode:0,byPerson:0,byAi:0};for(let n of e){let e=wf(n);e===`ai`?t.byAi++:e===`person`?t.byPerson++:t.fromCode++}return t}function Ef(e){let t=(e.joins??[]).filter(e=>e.how===`ai`||e.caller.some(e=>e.source===`ai`)),n=t.find(e=>e.run)?.run;return{n:t.length,...n?{run:n}:{}}}var Df=(e,t={})=>({id:e.id,label:e.label,kind:e.kind,gaps:e.gaps,childCount:e.childCount,outside:!1,group:!1,inside:0,...e.kind===`topic`&&typeof e.properties.owner==`string`?{owner:e.properties.owner,...e.properties.ownerOutside===!0?{ownerOutside:!0}:{}}:{},...e.kind===`topic`&&e.properties.declared===!0?{declared:!0}:{},...e.kind===`component`&&typeof e.properties.type==`string`&&e.properties.type?{typeId:e.properties.type}:{},...t}),Of=new Set([`component`,`endpoint`,`topic`,`client`,`store`,`table`,`deployment`]);function kf(e,t){let n=(e,t)=>t.some(t=>!e.gaps.includes(t))?{...e,gaps:[...e.gaps,...t.filter(t=>!e.gaps.includes(t))]}:e,r=e=>n(e,hf(e.evidence,t,{bare:!!e.record&&Of.has(e.kind)})),i=new Map;for(let[a,o]of e)i.set(a,{...o,node:r(o.node),children:o.children.map(r),outside:o.outside.map(r),edges:o.edges.map(e=>n(e,hf(e.evidence,t)))});return i}function Af(e,t){if(!t.length)return e;let n=new Map;for(let[r,i]of e)n.set(r,{...i,edges:i.edges.map(e=>{let n=vf(e.joins??[],t).filter(t=>!e.gaps.includes(t));return n.length?{...e,gaps:[...e.gaps,...n]}:e})});return n}function jf(e){let t=new Set;for(let n of e.values())for(let e of[n.node,...n.children,...n.outside,...n.edges])for(let n of e.evidence)n.repo&&t.add(n.repo);return[...t].sort()}var Mf=(e,t)=>e>1?U.edgeCount(e,t):t;function Nf(e,t,n,r){let i=new Map,a=new Map;if(r){for(let e of[r.node,...r.neighbours])i.set(e.id,Df(e));for(let e of r.edges)a.set(e.id,e)}else{let r=e.get(t);if(!r)return{boxes:[],links:[]};let o=(t,r)=>{for(let e of t.edges)a.set(e.id,e);for(let a of t.children){if(i.has(a.id))continue;let t=n.has(a.id)?e.get(a.id):void 0;i.set(a.id,Df(a,{group:!!t,...r?{parent:r}:{}})),t&&o(t,a.id)}};o(r);for(let e of r.outside)i.has(e.id)||i.set(e.id,Df(e,{outside:!0}))}let o=(e,t)=>{for(let n=i.get(e)?.parent;n;n=i.get(n)?.parent)if(n===t)return!0;return!1},s=[...a.values()].filter(e=>i.has(e.from)&&i.has(e.to)),c=e=>s.some(t=>t!==e&&t.type===e.type&&(i.get(e.to).group&&t.from===e.from&&o(t.to,e.to)||i.get(e.from).group&&t.to===e.to&&o(t.from,e.from))),l=[];for(let e of s){if(e.from===e.to){i.get(e.from).inside+=e.count;continue}if(c(e))continue;let t=e.type===`subscribes`&&i.get(e.to).kind===`topic`,n=e.gaps.includes(`declared-topic`)||!!e.joins?.length&&e.joins.every(e=>e.how===`declared`),r=!!e.joins?.length&&e.joins.every(e=>e.how===`person`),a=Ef(e),o=e.type===`depends-on`,s=Mf(e.count,t?w.topics.listens:Cf(e.type)),u=a.n?`${s} · ${w.canvasAi.mark(a.n,e.joins.length)}`:s;l.push({id:e.id,from:t?e.to:e.from,to:t?e.from:e.to,type:e.type,count:e.count,label:n?`${u} · ${w.topics.declaredMark}`:r?`${u} · ${w.connect.pairedMark}`:u,async:e.sync===`async`||e.type===`publishes`||e.type===`subscribes`,gaps:e.gaps,...n?{declared:!0}:{},...r?{paired:!0}:{},...a.n?{ai:a.n}:{},...a.run?{run:a.run}:{},...o?{dependency:!0}:{}})}let u=[...i.values()].filter(e=>!e.outside),d=u.length>1?u[0].gaps.filter(e=>u.every(t=>t.gaps.includes(e))):[];if(d.length)for(let e of u)i.set(e.id,{...e,gaps:e.gaps.filter(e=>!d.includes(e))});return{boxes:[...i.values()],links:l,shared:d}}function Pf(e){return e===`architecture`||e===`infrastructure`?`DOWN`:`RIGHT`}function Ff(e){return{width:Math.min(280,Math.max(150,Math.ceil(e.label.length*7.5)+56)),height:e.kind===`topic`?82:64}}function If(e,t,n,r){let i=e.includes(`nodes`)?`nodes`:e.includes(`crossings`)?`crossings`:void 0;if(!i&&!t)return;let a=i??`api`;if(t?.mode===`focus`&&t.id)return{mode:`focus`,id:t.id,why:a};if(n.size)return{mode:`collapse`,why:a};let o=[...r].filter(e=>e.childCount>0).sort((e,t)=>t.childCount-e.childCount||(e.id<t.id?-1:1))[0];return o?{mode:`group`,id:o.id,why:a}:{mode:`group`,why:a}}function Lf(e,t,n=`node`){return[e,...n===`focus`?[`focus`]:[],t.replace(/:/g,`-`)].join(`.`)}function Rf(e){let t=e.path.map(e=>e.id),n=e.node.childCount>0||t.length===0?[...t,e.node.id]:t;return{current:n[n.length-1],expanded:n,selected:e.node.id}}var zf=w.deleteLink,Bf=zf.list;function Vf(e){return e instanceof Zn?e.lines.join(` `)||e.message:e instanceof M?e.problem.detail??e.message:e instanceof Error?e.message:String(e)}function Hf(e){let t=(0,v.useId)(),n=e.now,r=n.state!==`idle`&&n.state!==`done`,i=`interfaces`in n&&n.interfaces?n.interfaces.length:e.count;return(0,j.jsxs)(`div`,{className:`li-delete`,children:[(0,j.jsx)(`button`,{type:`button`,className:`btn li-delete-open`,"aria-label":zf.openOf(e.from,e.to),"aria-expanded":r,"aria-controls":`${t}-c`,ref:e.opener,disabled:n.state===`working`||n.state===`reading`,onClick:e.onOpen,children:zf.open}),r&&(0,j.jsxs)(`div`,{id:`${t}-c`,className:`li-delete-confirm stack`,role:`group`,"aria-labelledby":`${t}-q`,children:[n.state===`reading`?(0,j.jsx)(`p`,{className:`ev-say`,role:`status`,"aria-busy":`true`,style:{margin:0},children:zf.reading}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{id:`${t}-q`,className:`li-delete-ask`,style:{margin:0},children:zf.confirm(e.from,e.to,i)}),e.also&&e.also.length>0&&(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:zf.also(e.also.join(`, `))}),(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:zf.intro})]}),n.state===`working`&&(0,j.jsx)(`p`,{className:`ev-say`,role:`status`,"aria-busy":`true`,style:{margin:0},children:zf.working}),n.state===`error`&&(0,j.jsx)(`p`,{className:`state error`,role:`alert`,style:{margin:0},children:n.interfaces?zf.failed(n.text):zf.readFailed(n.text)}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`},children:[(n.state===`confirm`||n.state===`working`||n.state===`error`&&n.interfaces)&&(0,j.jsx)(`button`,{type:`button`,className:`btn danger`,ref:e.yes,disabled:n.state===`working`,"aria-busy":n.state===`working`,onClick:e.onConfirm,children:zf.yes}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:n.state===`working`,onClick:e.onCancel,children:zf.no}),(0,j.jsx)(An,{id:e.job})]})]})]})}var Uf=/^if-[0-9a-f]{16}$/;function Wf(e){let t=e.joins??[];return e.type!==`depends-on`&&t.length>0&&t.every(e=>Uf.test(e.interface))}async function Gf(e,t,n=e=>N(e)){return[...new Set((await Kf(e,t,n)).map(e=>e.interface))]}async function Kf(e,t,n=e=>N(e)){let r=e.joins??[],i=r;if(e.count>r.length){if(!t)throw Error(zf.partial(e.count,r.length));if(i=(await n(t)).joins,i.length<e.count)throw Error(zf.partial(e.count,i.length))}if(!i.length)throw Error(zf.none);if(!i.every(e=>Uf.test(e.interface)))throw Error(zf.mixed);return i}function qf(e){let[t,n]=(0,v.useState)({state:`idle`}),[r,i]=(0,v.useState)(),a=(0,v.useRef)(null),o=(0,v.useRef)(null),s=(e.link.joins??[]).map(e=>e.interface);(0,v.useEffect)(()=>{t.state===`confirm`&&o.current?.focus()},[t.state]);let c=async()=>{e.link.count>s.length&&e.callsPath&&n({state:`reading`});try{n({state:`confirm`,interfaces:await Gf(e.link,e.callsPath)})}catch(e){n({state:`error`,text:Vf(e)})}},l=async()=>{if(!(`interfaces`in t)||!t.interfaces)return;let r=t.interfaces;n({state:`working`,interfaces:r});try{await Qn(`/api/links/delete`,{interfaces:r,from:e.from,to:e.to},void 0,i),n({state:`done`}),e.onDeleted({from:e.from,to:e.to,interfaces:r})}catch(e){n({state:`error`,text:Vf(e),interfaces:r})}};return(0,j.jsx)(Hf,{from:e.from,to:e.to,count:e.link.count,now:t,job:r,also:`interfaces`in t&&t.interfaces?e.alsoOf?.(t.interfaces):void 0,opener:a,yes:o,onOpen:()=>void c(),onConfirm:()=>void l(),onCancel:()=>{n({state:`idle`}),a.current?.focus()}})}function Jf(e){let t=(0,v.useId)(),n=e.back.state===`done`?(0,j.jsx)(`p`,{role:`status`,className:`ev-say`,style:{margin:0},children:Bf.backDone(e.back.from,e.back.to)}):e.back.state===`error`?(0,j.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:0},children:Bf.backFailed(e.back.text)}):e.back.state===`working`?(0,j.jsx)(`p`,{role:`status`,"aria-busy":`true`,className:`ev-say`,style:{margin:0},children:Bf.backing}):null,r;if(e.of.state===`loading`)r=(0,j.jsx)(`p`,{role:`status`,"aria-busy":`true`,className:`ev-say`,style:{margin:0},children:Bf.loading});else if(e.of.state===`error`)r=(0,j.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:0},children:Bf.failed(e.of.error)});else{let t=e.of.data.links.filter(t=>!e.only||t.decisions.some(t=>e.only.has(t.target)));r=t.length?(0,j.jsx)(`ul`,{className:`stack`,style:{paddingLeft:18,margin:0},children:t.map((t,n)=>(0,j.jsxs)(`li`,{children:[Bf.item(t.from,t.to,t.calls||t.decisions.length),t.redirect&&(0,j.jsxs)(`span`,{className:`hud`,children:[` · `,Bf.redirected]}),t.gone&&(0,j.jsxs)(`span`,{className:`hud`,children:[` · `,Bf.gone]}),t.by&&(0,j.jsxs)(`span`,{className:`hud`,children:[` · `,Bf.by(t.by,t.at)]}),` `,(0,j.jsx)(`button`,{type:`button`,className:`btn`,"aria-label":Bf.backOf(t.from,t.to),disabled:e.back.state===`working`,"aria-busy":e.back.state===`working`&&e.back.at===n,onClick:()=>e.onBack(t,n),children:e.back.state===`working`&&e.back.at===n?Bf.backing:Bf.back})]},t.decisions[0]?.id??n))}):e.back.state===`done`?null:(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:Bf.none})}return(0,j.jsxs)(`section`,{className:`stack`,"aria-labelledby":`${t}-h`,style:{gap:6},children:[(0,j.jsx)(`h4`,{id:`${t}-h`,className:`hud`,style:{margin:0},children:Bf.title}),r,n,(0,j.jsx)(An,{id:e.job})]})}function Yf(e){let t=P(`/api/links/deleted`),[n,r]=(0,v.useState)({state:`idle`}),[i,a]=(0,v.useState)();return(0,j.jsx)(Jf,{of:t,only:e.only,back:n,job:i,onBack:(n,i)=>{r({state:`working`,at:i}),Qn(`/api/links/deleted/undo`,{decisions:n.decisions.map(e=>e.id)},void 0,a).then(()=>{r({state:`done`,from:n.from,to:n.to}),e.onBack?.()}).catch(e=>r({state:`error`,text:Vf(e)})).finally(()=>t.reload())}})}var Xf=[`verified`,`guessed`,`declared`,`paired`,`ai`,`outside`,`topics`],Zf={verified:!0,guessed:!0,declared:!0,paired:!0,ai:!0,outside:!0,topics:!0},Qf=[`verified`,`guessed`,`declared`,`paired`,`ai`];function $f(e){return e.declared?`declared`:e.paired?`paired`:e.ai?`ai`:e.gaps.some(e=>!e.startsWith(`contract-`))?`guessed`:`verified`}var ep=e=>e.ai&&Qf.every(t=>t===`ai`||!e[t]);function tp(e){let t=!ep(e),n={...e};for(let e of Qf)n[e]=!t||e===`ai`;return n}function np(e,t,n={}){let r=e.boxes.filter(e=>(t.outside||!e.outside||e.group)&&(t.topics||e.kind!==`topic`)),i=new Set(r.map(e=>e.id)),a=e.links.filter(e=>i.has(e.from)&&i.has(e.to)&&t[$f(e)]&&(!n.mismatches||n.mismatches.has(e.id)));return{...e,boxes:r,links:a}}function rp(e){return e.trim().split(/\s+/).filter(Boolean).map(e=>{let t=/^(team|system|type|path):(.+)$/i.exec(e);return t?{key:t[1].toLowerCase(),value:t[2].toLowerCase()}:{value:e.toLowerCase()}})}function ip(e,t,n){let r=e=>{let n=t?.[e];return(Array.isArray(n)?n.join(` `):n===void 0?``:String(n)).toLowerCase()};return n.every(n=>{switch(n.key){case`team`:return r(`owner`).includes(n.value)||r(`team`).includes(n.value);case`system`:return r(`system`).includes(n.value)||e.kind===`system`&&e.label.toLowerCase().includes(n.value);case`type`:return r(`type`).includes(n.value);case`path`:{let r=n.value.replace(/\/\*\*$/,``).replace(/\*+$/,``);return Object.values(t??{}).some(e=>(Array.isArray(e)?e:[String(e)]).some(e=>e.toLowerCase().startsWith(r)))||e.label.toLowerCase().startsWith(r)}default:return e.label.toLowerCase().includes(n.value)||e.kind.toLowerCase()===n.value||Object.values(t??{}).some(e=>String(e).toLowerCase().includes(n.value))}})}function ap(e,t,n){let r=rp(t);if(!r.length)return e;let i=new Set(e.boxes.filter(e=>!e.group&&ip(e,n(e.id),r)).map(e=>e.id)),a=new Set(i);for(let t of e.links)i.has(t.from)&&a.add(t.to),i.has(t.to)&&a.add(t.from);for(let t of e.boxes)t.parent&&a.has(t.id)&&a.add(t.parent);return{...e,boxes:e.boxes.filter(e=>a.has(e.id)),links:e.links.filter(e=>a.has(e.from)&&a.has(e.to))}}function op(e,t,n,r){let i=new Map([[t,0]]),a=[t];for(let t=1;t<=n&&a.length;t++){let n=[];for(let o of a)for(let a of e){let e=(r!==`up`&&a.from===o?a.to:void 0)??(r!==`down`&&a.to===o?a.from:void 0);e&&!i.has(e)&&(i.set(e,t),n.push(e))}a=n}return i}function sp(e,t,n=8){let r=[],i=new Set([t]),a=[t];for(let t=1;t<=n&&a.length;t++){let n=[];for(let o of a)for(let a of e.filter(e=>e.from===o).sort((e,t)=>e.to<t.to?-1:1))r.push({depth:t,link:a}),i.has(a.to)||(i.add(a.to),n.push(a.to));a=n}return r}function cp(e){let t=new Map(e.boxes.map(e=>[e.id,e.label]));return[...e.boxes.filter(e=>e.gaps.length).map(e=>({id:e.id,what:`box`,label:e.label,gaps:e.gaps})),...e.links.filter(e=>e.gaps.length).map(e=>({id:e.from,what:`link`,label:`${t.get(e.from)??e.from} → ${t.get(e.to)??e.to}`,gaps:e.gaps}))].sort((e,t)=>t.gaps.length-e.gaps.length||(e.label<t.label?-1:1))}var lp=(e,t)=>({at:t,links:e.links.map(e=>({id:e.id,from:e.from,to:e.to,label:e.label}))});function up(e,t){let n=new Set(e.links.map(e=>e.id)),r=new Set(t.links.map(e=>e.id));return{added:t.links.filter(e=>!n.has(e.id)),removed:e.links.filter(e=>!r.has(e.id))}}var dp=e=>`n_${e.replace(/[^A-Za-z0-9_]/g,`_`)}`,fp=e=>e.replace(/"/g,`#quot;`),pp=e=>e.declared||e.paired?`word`:e.ai?`ai`:e.dependency?`dep`:void 0;function mp(e,t=`LR`){let n=[`flowchart ${t}`];for(let t of e.boxes.filter(e=>!e.group))n.push(` ${dp(t.id)}["${fp(`${t.label}`)}"]`);for(let t of e.links){let e=pp(t)?`-.->`:`-->`;n.push(` ${dp(t.from)} ${e}|"${fp(t.label)}"| ${dp(t.to)}`)}return n.join(`
|
|
37
|
+
`)+`
|
|
38
|
+
`}var hp=e=>e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`),gp={word:`dashed=1;`,ai:`dashed=1;dashPattern=1 4;`,dep:`dashed=1;dashPattern=8 3 2 3;`,none:``},_p={word:` stroke-dasharray="6 4"`,ai:` stroke-dasharray="1 4" stroke-linecap="round"`,dep:` stroke-dasharray="8 3 2 3"`,none:``};function vp(e,t){let n=[`<mxCell id="0"/>`,`<mxCell id="1" parent="0"/>`];for(let r of e.boxes.filter(e=>!e.group)){let e=t(r.id)??{x:0,y:0,width:160,height:60};n.push(`<mxCell id="${hp(dp(r.id))}" value="${hp(r.label)}" style="rounded=1;whiteSpace=wrap;${r.outside?`dashed=1;`:``}" vertex="1" parent="1"><mxGeometry x="${Math.round(e.x)}" y="${Math.round(e.y)}" width="${Math.round(e.width)}" height="${Math.round(e.height)}" as="geometry"/></mxCell>`)}return e.links.forEach((e,t)=>n.push(`<mxCell id="e${t}" value="${hp(e.label)}" style="endArrow=block;${gp[pp(e)??`none`]}" edge="1" parent="1" source="${hp(dp(e.from))}" target="${hp(dp(e.to))}"><mxGeometry relative="1" as="geometry"/></mxCell>`)),`<mxfile host="atticus"><diagram name="Atticus"><mxGraphModel><root>${n.join(``)}</root></mxGraphModel></diagram></mxfile>\n`}function yp(e,t){let n=e.boxes.filter(e=>!e.group).map(e=>({b:e,p:t(e.id)})).filter(e=>!!e.p),r=new Map(n.map(e=>[e.b.id,e.p])),i=Math.min(0,...n.map(e=>e.p.x))-20,a=Math.min(0,...n.map(e=>e.p.y))-20,o=Math.max(100,...n.map(e=>e.p.x+e.p.width))+20,s=Math.max(100,...n.map(e=>e.p.y+e.p.height))+20,c=[];for(let t of e.links){let e=r.get(t.from),n=r.get(t.to);if(!e||!n)continue;let[i,a,o,s]=[e.x+e.width/2,e.y+e.height/2,n.x+n.width/2,n.y+n.height/2];c.push(`<line x1="${i}" y1="${a}" x2="${o}" y2="${s}" stroke="dimgray" stroke-width="1.5" marker-end="url(#arrow)"${_p[pp(t)??`none`]}/>`,`<text x="${(i+o)/2}" y="${(a+s)/2-4}" font-size="11" text-anchor="middle" fill="darkslategray">${hp(t.label)}</text>`)}for(let{b:e,p:t}of n)c.push(`<rect x="${t.x}" y="${t.y}" width="${t.width}" height="${t.height}" rx="6" fill="white" stroke="darkslategray"${e.outside?` stroke-dasharray="4 3"`:``}/>`,`<text x="${t.x+t.width/2}" y="${t.y+t.height/2+4}" font-size="12" text-anchor="middle" fill="black">${hp(e.label)}</text>`);return[`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${i} ${a} ${o-i} ${s-a}" width="${o-i}" height="${s-a}" font-family="sans-serif">`,`<defs><marker id="arrow" viewBox="0 0 10 10" refX="10" refY="5" markerWidth="8" markerHeight="8" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 z" fill="dimgray"/></marker></defs>`,`<rect x="${i}" y="${a}" width="${o-i}" height="${s-a}" fill="white"/>`,...c,`</svg>`,``].join(`
|
|
39
|
+
`)}var bp=w.canvasTools;async function xp(e,t,n){let r=A();if(r)return r.saveFile(e,t,`utf8`);let i=URL.createObjectURL(new Blob([t],{type:n})),a=document.createElement(`a`);a.href=i,a.download=e,a.click(),setTimeout(()=>URL.revokeObjectURL(i),1e3)}function Sp(e,t){return new Promise(n=>{let r=new Image;r.onerror=()=>n(`failed`),r.onload=()=>{let t=document.createElement(`canvas`);t.width=r.width*2,t.height=r.height*2;let i=t.getContext(`2d`);i?.scale(2,2),i?.drawImage(r,0,0);let a=A();if(a){let r=t.toDataURL(`image/png`).split(`,`)[1]??``;if(!r)return n(`failed`);a.saveFile(e,r,`base64`).then(n)}else t.toBlob(t=>{if(!t)return n(`failed`);let r=URL.createObjectURL(t),i=document.createElement(`a`);i.href=r,i.download=e,i.click(),setTimeout(()=>URL.revokeObjectURL(r),1e3),n(void 0)})},r.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`})}function Cp(e,t){let n=window.open(``,`_blank`);if(!n)return`failed`;n.document.title=t,n.document.body.innerHTML=e,n.focus(),n.print()}function wp(e){let t=(0,v.useId)(),[n,r]=(0,v.useState)(!1),i=e.drawer?e.drawer.open:n,[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(),[l,u]=(0,v.useState)(),d=async e=>{let t=await e;u(t?bp.exportEnd[t]:void 0)},[f,p]=(0,v.useState)(),m=P(i?`/api/graph/views`:void 0),h=e.state,g=t=>e.onChange({...h,...t}),_=e.selected?sp(e.graph.links,e.selected):[],y=cp(e.graph),[b,x]=(0,v.useState)(!1),S=async()=>{if(!b){x(!0),p(void 0);try{let t=await N(`/api/graph/views/${encodeURIComponent(a)}${m.state===`ready`&&m.data.views.some(e=>e.name===a)?`?replace=1`:``}`,{method:`PUT`,body:{lens:e.lens,node:e.node,filter:h.filter,layers:h.layers,overlay:h.overlay,mismatches:h.mismatches}});c(`diagrams/views/${t.name}.yaml`),m.reload()}catch(e){p(e instanceof M?e.problem.detail??e.message:String(e)),e instanceof M&&e.problem.status===409&&m.reload()}finally{x(!1)}}},C=e.drawer;return C&&!i?null:(0,j.jsxs)(`section`,{...C?{id:C.bodyId}:{},className:C?`canvas-tools arch-tools-drawer`:`canvas-tools`,"aria-labelledby":`${t}-t`,...C?{onKeyDown:e=>{e.key!==`Escape`||kt(e.target)||(e.preventDefault(),C.onClose())}}:{},children:[C?(0,j.jsxs)(`div`,{className:`row arch-tools-head`,children:[(0,j.jsx)(`h3`,{id:`${t}-t`,className:`hud`,style:{margin:0},children:bp.title}),(0,j.jsx)(`span`,{className:`work-say`,children:bp.filtered(e.graph.boxes.length,e.allBoxes)}),(0,j.jsx)(`button`,{type:`button`,className:`btn viewer-btn arch-tools-close`,"aria-label":bp.hide,title:bp.hide,onClick:C.onClose,children:(0,j.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 14 14`,"aria-hidden":`true`,focusable:`false`,children:(0,j.jsx)(`path`,{d:`M3.5 3.5 L10.5 10.5 M10.5 3.5 L3.5 10.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`})})})]}):(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,alignItems:`center`},children:[(0,j.jsx)(`h3`,{id:`${t}-t`,className:`hud`,style:{margin:0},children:bp.title}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,"aria-expanded":i,"aria-controls":`${t}-body`,onClick:()=>r(e=>!e),children:i?bp.hide:bp.show}),(0,j.jsx)(`span`,{className:`work-say`,children:bp.filtered(e.graph.boxes.length,e.allBoxes)})]}),i&&(0,j.jsxs)(`div`,{id:`${t}-body`,className:`canvas-tools-body`,children:[(0,j.jsxs)(`fieldset`,{children:[(0,j.jsx)(`legend`,{className:`hud`,children:bp.layers}),Xf.map(e=>(0,j.jsxs)(`label`,{className:`row`,style:{gap:4},children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:h.layers[e],onChange:t=>g({layers:{...h.layers,[e]:t.target.checked}})}),bp.layer[e]]},e)),(0,j.jsxs)(`label`,{className:`row`,style:{gap:4},children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:h.mismatches,onChange:e=>g({mismatches:e.target.checked})}),bp.mismatches]})]}),(0,j.jsx)(Dp,{graph:e.graph,layers:h.layers,onLayers:e=>g({layers:e}),onPick:t=>e.onPickLink?.(t),labelOf:e.labelOf}),(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsx)(`label`,{htmlFor:`${t}-f`,className:`hud`,children:bp.filter}),(0,j.jsx)(`input`,{id:`${t}-f`,className:`field`,type:`search`,value:h.filter,placeholder:bp.filterHint,"aria-describedby":`${t}-fh`,onChange:e=>g({filter:e.target.value})}),(0,j.jsx)(`span`,{id:`${t}-fh`,className:`hud`,children:bp.filterHint}),(0,j.jsx)(`label`,{htmlFor:`${t}-o`,className:`hud`,children:bp.overlay}),(0,j.jsx)(`select`,{id:`${t}-o`,className:`field`,value:h.overlay,onChange:e=>g({overlay:e.target.value}),children:[`none`,`gaps`,`questions`].map(e=>(0,j.jsx)(`option`,{value:e,children:bp.overlays[e]},e))})]}),e.overlayNote&&(0,j.jsx)(`p`,{role:`status`,className:`work-say`,children:e.overlayNote}),(0,j.jsxs)(`fieldset`,{children:[(0,j.jsx)(`legend`,{className:`hud`,children:bp.radius}),e.selected?(0,j.jsxs)(j.Fragment,{children:[[`up`,`down`,`both`].map(e=>(0,j.jsxs)(`label`,{className:`row`,style:{gap:4},children:[(0,j.jsx)(`input`,{type:`radio`,name:`${t}-dir`,checked:(h.radius?.dir??`both`)===e,onChange:()=>g({radius:{dir:e,depth:h.radius?.depth??2}})}),bp.radiusDir[e]]},e)),(0,j.jsxs)(`label`,{className:`row`,style:{gap:6},children:[bp.depth(h.radius?.depth??2),(0,j.jsx)(`input`,{type:`range`,min:1,max:5,value:h.radius?.depth??2,onChange:e=>g({radius:{dir:h.radius?.dir??`both`,depth:Number(e.target.value)}})})]}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>g(h.radius?{radius:void 0}:{radius:{dir:`both`,depth:2}}),children:h.radius?bp.radiusOff:bp.radiusOn})]}):(0,j.jsx)(`p`,{className:`work-say`,children:bp.radiusPick})]}),(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsx)(`h4`,{className:`hud`,children:bp.trace}),e.selected?_.length?(0,j.jsx)(`ol`,{className:`stack`,style:{paddingLeft:18,margin:0},children:_.map((t,n)=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`span`,{className:`hud`,children:bp.hop(t.depth)}),` `,(0,j.jsxs)(`button`,{type:`button`,className:`link`,onClick:()=>e.onSelect(t.link.to),children:[e.labelOf(t.link.from),` → `,e.labelOf(t.link.to)]}),` `,(0,j.jsx)(`span`,{className:`work-say`,children:t.link.label})]},`${t.link.id}-${n}`))}):(0,j.jsx)(`p`,{className:`work-say`,children:bp.traceNone}):(0,j.jsx)(`p`,{className:`work-say`,children:bp.radiusPick})]}),(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsx)(`h4`,{className:`hud`,children:bp.inbox}),y.length?(0,j.jsxs)(`ul`,{className:`stack`,style:{paddingLeft:18,margin:0},children:[y.slice(0,50).map((t,n)=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`button`,{type:`button`,className:`link`,onClick:()=>e.onSelect(t.id),children:t.label}),` `,(0,j.jsx)(`span`,{className:`work-say`,children:t.gaps.map(e=>U.gap[e]??e).join(`, `)})]},`${t.what}-${t.id}-${n}`)),y.length>50&&(0,j.jsx)(`li`,{className:`work-say`,children:w.app.andMore(y.length-50)})]}):(0,j.jsx)(`p`,{className:`work-say`,children:bp.inboxNone})]}),(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsx)(`h4`,{className:`hud`,children:bp.compare}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:e.onSnapshot,children:bp.snapshot}),e.snapshot?(0,j.jsxs)(`label`,{className:`row`,style:{gap:4},children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:!!h.compareWith,onChange:t=>g(t.target.checked?{compareWith:e.snapshot}:{compareWith:void 0})}),bp.compareOn,` `,bp.snapshotAt(e.snapshot.at)]}):(0,j.jsx)(`span`,{className:`work-say`,children:bp.noSnapshot})]}),h.compareWith&&e.compared&&(0,j.jsxs)(`div`,{role:`status`,children:[(0,j.jsx)(`p`,{className:`work-say`,children:bp.added(e.compared.added)}),e.compared.removed.length>0&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`work-say`,children:bp.removed(e.compared.removed.length)}),(0,j.jsx)(`ul`,{style:{paddingLeft:18,margin:0},children:e.compared.removed.map(t=>(0,j.jsxs)(`li`,{children:[e.labelOf(t.from),` → `,e.labelOf(t.to),` (`,t.label,`)`]},t.id))})]})]})]}),e.types&&Object.keys(e.types).length>0&&(0,j.jsx)(Op,{types:e.types,graph:e.graph,filter:e.state.filter,onFilter:t=>e.onChange({...e.state,filter:t})}),(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsx)(`h4`,{className:`hud`,children:bp.views}),m.state===`ready`&&m.data.views.length?(0,j.jsx)(`ul`,{style:{paddingLeft:18,margin:0},children:m.data.views.map(t=>(0,j.jsxs)(`li`,{children:[(0,j.jsxs)(`button`,{type:`button`,className:`link`,onClick:()=>{e.onChange({...h,filter:t.filter,layers:{...h.layers,...t.layers},overlay:t.overlay,mismatches:t.mismatches}),(t.lens!==e.lens||t.node!==e.node)&&e.onOpenView?.(t.lens,t.node)},children:[bp.open,` `,t.name]}),t.filter&&(0,j.jsxs)(`span`,{className:`work-say`,children:[` · `,t.filter]})]},t.name))}):m.state===`ready`?(0,j.jsx)(`p`,{className:`work-say`,children:bp.noViews}):m.state===`error`?(0,j.jsx)(`p`,{role:`alert`,className:`state error`,children:bp.viewsFailed(m.error)}):m.state===`loading`&&(0,j.jsx)(`p`,{role:`status`,"aria-busy":`true`,className:`work-say`,children:bp.viewsLoading}),(0,j.jsx)(`label`,{htmlFor:`${t}-n`,className:`hud`,children:bp.viewName}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`input`,{id:`${t}-n`,className:`field`,value:a,onChange:e=>{o(e.target.value),c(void 0)}}),(0,j.jsxs)(`button`,{type:`button`,className:`btn`,disabled:b||!/^[a-z0-9][a-z0-9-]{0,62}$/.test(a),"aria-busy":b,onClick:()=>void S(),children:[b&&bp.saving,b?null:m.state===`ready`&&m.data.views.some(e=>e.name===a)?bp.replace(a):bp.save]})]}),s&&(0,j.jsx)(`p`,{role:`status`,className:`work-say`,children:bp.saved(s)}),f&&(0,j.jsx)(`p`,{role:`alert`,className:`state error`,children:f})]}),(0,j.jsx)(Yf,{...e.onLinkBack?{onBack:e.onLinkBack}:{}}),(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsx)(`h4`,{className:`hud`,children:bp.export}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:6,flexWrap:`wrap`},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>void d(xp(`${e.name}.mmd`,mp(e.graph),`text/plain`)),children:bp.exports.mermaid}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>void d(xp(`${e.name}.drawio`,vp(e.graph,e.placed),`application/xml`)),children:bp.exports.drawio}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>void d(xp(`${e.name}.svg`,yp(e.graph,e.placed),`image/svg+xml`)),children:bp.exports.svg}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>void d(Sp(`${e.name}.png`,yp(e.graph,e.placed))),children:bp.exports.png}),!A()&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>void d(Promise.resolve(Cp(yp(e.graph,e.placed),e.name))),children:bp.exports.pdf})]}),l&&(0,j.jsx)(`p`,{role:`status`,className:`work-say`,children:l})]})]})]})}function Tp({by:e}){return(0,j.jsxs)(`svg`,{width:`28`,height:`10`,viewBox:`0 0 28 10`,"aria-hidden":`true`,focusable:`false`,children:[(0,j.jsx)(`line`,{x1:`1`,y1:`5`,x2:e===`ai`?19:27,y2:`5`,stroke:`currentColor`,strokeWidth:`2`,...e===`person`?{strokeDasharray:`6 4`}:{},...e===`ai`?{strokeDasharray:`1 4`,strokeLinecap:`round`}:{}}),e===`ai`&&(0,j.jsx)(`path`,{d:`M24 1 L28 5 L24 9 L20 5 Z`,fill:`currentColor`})]})}function Ep({links:e}){if(!e.length)return null;let t=w.canvasAi,n=e.filter(e=>e.dependency).length,r=e.filter(e=>!e.dependency);return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:2,margin:`4px 0`},children:[r.length>0&&(0,j.jsx)(Pi,{counts:Tf(r),what:w.decisions.counts.links}),(0,j.jsxs)(`ul`,{className:`row link-legend`,"aria-label":t.legend,style:{gap:12,flexWrap:`wrap`,listStyle:`none`,margin:0,padding:0},children:[[[`code`,t.legendCode],[`person`,t.legendPerson],[`ai`,t.legendAi]].map(([e,t])=>(0,j.jsxs)(`li`,{className:`row work-say${e===`ai`?` ai-sample`:``}`,style:{gap:4},children:[(0,j.jsx)(Tp,{by:e}),t]},e)),n>0&&(0,j.jsxs)(`li`,{className:`row work-say`,style:{gap:4},children:[(0,j.jsx)(`svg`,{width:`28`,height:`10`,viewBox:`0 0 28 10`,"aria-hidden":`true`,focusable:`false`,children:(0,j.jsx)(`line`,{x1:`1`,y1:`5`,x2:`27`,y2:`5`,stroke:`currentColor`,strokeWidth:`2`,strokeDasharray:`8 3 2 3`})}),t.legendDependency(n)]})]})]})}function Dp(e){let t=w.canvasAi,n=(0,v.useId)(),r=ep(e.layers),i=e.graph.links.filter(e=>e.ai);return(0,j.jsxs)(`section`,{className:`stack`,"aria-labelledby":`${n}-ai`,style:{gap:4},children:[(0,j.jsxs)(`h4`,{id:`${n}-ai`,className:`hud`,style:{margin:0},children:[(0,j.jsx)(`span`,{"aria-hidden":`true`,children:`◆ `}),t.title]}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:t.hint}),(0,j.jsxs)(`p`,{className:`row work-say ai-sample`,style:{gap:4,margin:0},children:[(0,j.jsx)(Tp,{by:`ai`}),t.legendAi]}),(0,j.jsx)(`div`,{children:(0,j.jsx)(`button`,{type:`button`,className:`btn${r?` primary`:``}`,"aria-pressed":r,onClick:()=>e.onLayers(tp(e.layers)),children:t.only})}),i.length?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:t.listed(i.length)}),(0,j.jsx)(`ul`,{className:`stack`,style:{paddingLeft:18,margin:0,gap:2},children:i.map(n=>(0,j.jsxs)(`li`,{children:[(0,j.jsxs)(`button`,{type:`button`,className:`link`,"aria-label":t.pick(e.labelOf(n.from),e.labelOf(n.to)),onClick:()=>e.onPick(n.id),children:[e.labelOf(n.from),` → `,e.labelOf(n.to)]}),` `,(0,j.jsx)(`span`,{className:`work-say`,children:n.label})]},n.id))})]}):(0,j.jsx)(`p`,{className:`work-say`,role:`status`,style:{margin:0},children:r?t.noneOnly:t.none})]})}function Op(e){let t=Object.entries(e.types).filter(([t])=>e.graph.boxes.some(e=>e.typeId===t));return t.length?(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsx)(`h4`,{className:`hud`,children:bp.types}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:bp.typesHint}),(0,j.jsx)(`ul`,{className:`type-legend`,style:{paddingLeft:0,margin:0,listStyle:`none`},children:t.map(([t,n])=>{let r=e.filter.trim().split(/\s+/).filter(Boolean),i=r.includes(`type:${t}`),a=i?r.filter(e=>e!==`type:${t}`):[...r.filter(e=>!e.startsWith(`type:`)),`type:${t}`];return(0,j.jsx)(`li`,{className:`row`,style:{gap:6,alignItems:`center`},children:(0,j.jsxs)(`button`,{type:`button`,className:`link${i?` on`:``}`,"aria-pressed":i,title:n.description,onClick:()=>e.onFilter(a.join(` `)),children:[(0,j.jsx)(`span`,{className:`hud arch-type`,style:n.colour?{borderLeft:`3px solid ${n.colour}`,paddingLeft:4}:void 0,children:n.badge??t}),` `,n.name]})},t)})})]}):null}var kp=w.viewer,Ap=w.canvasTools,jp={add:`M2 2 H12 V12 H2 Z M7 4.5 V9.5 M4.5 7 H9.5`,tools:`M2 4 H12 M2 10 H12 M5 2.5 V5.5 M9 8.5 V11.5`,keep:`M5 1.5 H9 L8.5 5.5 L10.5 7.5 H3.5 L5.5 5.5 Z M7 7.5 V12.5`,tidy:`M2 2 H6 V6 H2 Z M8 2 H12 V6 H8 Z M2 8 H6 V12 H2 Z M8 8 H12 V12 H8 Z`,reset:`M3.2 5 A4.2 4.2 0 1 1 3 8.5 M3 2 V5 H6`,legend:`M2 3.5 H3.5 M6 3.5 H12 M2 7 H3.5 M6 7 H12 M2 10.5 H3.5 M6 10.5 H12`,edit:`M2.5 11.5 L3 9 L9.5 2.5 L11.5 4.5 L5 11 Z M8 4 L10 6`};function Mp({d:e}){return(0,j.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 14 14`,"aria-hidden":`true`,focusable:`false`,children:(0,j.jsx)(`path`,{d:jp[e],fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Np(e){return(0,j.jsx)(`button`,{type:`button`,className:`btn viewer-btn${e.primary?` primary`:``}`,"aria-label":e.label,title:e.label,disabled:e.disabled,...e.busy?{"aria-busy":!0}:{},onClick:e.onClick,children:(0,j.jsx)(Mp,{d:e.icon})})}function Pp(e){let t=e.tools;return(0,j.jsxs)(`div`,{className:`arch-bar`,role:`group`,"aria-label":kp.mapControls,children:[(0,j.jsx)(`div`,{role:`tablist`,"aria-label":U.lens,className:`arch-seg`,children:e.lenses.map(t=>(0,j.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":t.id===e.lens,className:`arch-seg-btn${t.id===e.lens?` on`:``}`,onClick:()=>e.onLens(t.id),children:t.label},t.id))}),e.crumbs,(0,j.jsxs)(`div`,{className:`arch-bar-tools`,children:[(0,j.jsx)(Np,{label:w.addBox.open,icon:`add`,onClick:e.onAdd}),e.edit,(0,j.jsx)(`button`,{ref:t.buttonRef,type:`button`,className:`btn viewer-btn arch-tools-toggle${t.open?` primary`:``}`,"aria-expanded":t.open,...t.open?{"aria-controls":t.bodyId}:{},"aria-label":t.open?Ap.hide:Ap.show,title:t.open?Ap.hide:Ap.show,"data-controls":t.bodyId,onClick:t.onToggle,children:(0,j.jsx)(Mp,{d:`tools`})}),t.shown<t.all&&(0,j.jsx)(`span`,{className:`hud arch-bar-count`,children:Ap.filtered(t.shown,t.all)}),e.arrangement]}),e.status&&(0,j.jsx)(`div`,{className:`arch-bar-status`,children:e.status}),(0,j.jsx)(`div`,{className:`arch-bar-view`,ref:e.viewSlot})]})}var Fp=`atticus.map.legend`;function Ip(){try{return typeof localStorage>`u`?void 0:localStorage}catch{return}}function Lp(e=Ip()){try{return e?.getItem(Fp)===`open`}catch{return!1}}function Rp(e,t=Ip()){try{t?.setItem(Fp,e?`open`:`closed`)}catch{}}function zp(e){let t=(0,v.useId)(),[n,r]=(0,v.useState)(()=>e.initialOpen??Lp());return(0,j.jsxs)(`div`,{className:`arch-legend viewer-own`,children:[(0,j.jsxs)(`button`,{type:`button`,className:`btn arch-legend-btn`,"aria-expanded":n,...n?{"aria-controls":`${t}-legend`}:{},"data-controls":`${t}-legend`,onClick:()=>{r(!n),Rp(!n)},children:[(0,j.jsx)(Mp,{d:`legend`}),kp.legend]}),n&&(0,j.jsxs)(`div`,{id:`${t}-legend`,className:`arch-legend-body`,children:[(0,j.jsx)(`p`,{className:`hud`,children:e.meta}),(0,j.jsx)(Ep,{links:e.links})]})]})}function Bp({repo:e,at:t}){let[n,r]=(0,v.useState)(),[i,a]=(0,v.useState)(),[o,s]=(0,v.useState)(!1);return n?.missing?(0,j.jsxs)(`span`,{className:`hud`,children:[` · `,n.missing]}):n?(0,j.jsxs)(`span`,{className:`row`,style:{gap:6,display:`inline-flex`},children:[n.vscode&&(0,j.jsx)(`a`,{className:`hud`,href:n.vscode,children:w.canvasTools.inVsCode}),n.idea&&(0,j.jsx)(`a`,{className:`hud`,href:n.idea,children:w.canvasTools.inIntellij})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`button`,{type:`button`,className:`link hud`,disabled:o,"aria-busy":o,onClick:()=>{s(!0),a(void 0),N(`/api/code-link?repo=${encodeURIComponent(e)}&at=${encodeURIComponent(t)}`).then(r,e=>a(e instanceof Error?e.message:String(e))).finally(()=>s(!1))},children:o?w.canvasTools.openingCode:w.canvasTools.openCode}),i&&(0,j.jsxs)(`span`,{className:`hud`,children:[` · `,i]})]})}function Vp(e){if(typeof e==`string`||typeof e==`number`)return``+e;let t=``;if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Vp(e[n]))!==``&&(t+=(t&&` `)+r);else for(let n in e)e[n]&&(t+=(t&&` `)+n);return t}var Hp={value:()=>{}};function Up(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new Wp(n)}function Wp(e){this._=e}function Gp(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}Wp.prototype=Up.prototype={constructor:Wp,on:function(e,t){var n=this._,r=Gp(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=Kp(n[i],e.name)))return i}else{if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=qp(n[i],e.name,t);else if(t==null)for(i in n)n[i]=qp(n[i],e.name,null);return this}},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Wp(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function Kp(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function qp(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Hp,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Jp={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function Yp(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),Jp.hasOwnProperty(t)?{space:Jp[t],local:e}:e}function Xp(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function Zp(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Qp(e){var t=Yp(e);return(t.local?Zp:Xp)(t)}function $p(){}function em(e){return e==null?$p:function(){return this.querySelector(e)}}function tm(e){typeof e!=`function`&&(e=em(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new Uh(r,this._parents)}function nm(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function rm(){return[]}function im(e){return e==null?rm:function(){return this.querySelectorAll(e)}}function am(e){return function(){return nm(e.apply(this,arguments))}}function om(e){e=typeof e==`function`?am(e):im(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new Uh(r,i)}function sm(e){return function(){return this.matches(e)}}function cm(e){return function(t){return t.matches(e)}}var lm=Array.prototype.find;function um(e){return function(){return lm.call(this.children,e)}}function dm(){return this.firstElementChild}function fm(e){return this.select(e==null?dm:um(typeof e==`function`?e:cm(e)))}var pm=Array.prototype.filter;function mm(){return Array.from(this.children)}function hm(e){return function(){return pm.call(this.children,e)}}function gm(e){return this.selectAll(e==null?mm:hm(typeof e==`function`?e:cm(e)))}function _m(e){typeof e!=`function`&&(e=sm(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Uh(r,this._parents)}function vm(e){return Array(e.length)}function ym(){return new Uh(this._enter||this._groups.map(vm),this._parents)}function bm(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}bm.prototype={constructor:bm,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function xm(e){return function(){return e}}function Sm(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new bm(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function Cm(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new bm(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function wm(e){return e.__data__}function Tm(e,t){if(!arguments.length)return Array.from(this,wm);var n=t?Cm:Sm,r=this._parents,i=this._groups;typeof e!=`function`&&(e=xm(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=Em(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new Uh(o,r),o._enter=s,o._exit=c,o}function Em(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Dm(){return new Uh(this._exit||this._groups.map(vm),this._parents)}function Om(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function km(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new Uh(s,this._parents)}function Am(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function jm(e){e||=Mm;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new Uh(i,this._parents).order()}function Mm(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Nm(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Pm(){return Array.from(this)}function Fm(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function Im(){let e=0;for(let t of this)++e;return e}function Lm(){return!this.node()}function Rm(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function zm(e){return function(){this.removeAttribute(e)}}function Bm(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Vm(e,t){return function(){this.setAttribute(e,t)}}function Hm(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Um(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Wm(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Gm(e,t){var n=Yp(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Bm:zm:typeof t==`function`?n.local?Wm:Um:n.local?Hm:Vm)(n,t))}function Km(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function qm(e){return function(){this.style.removeProperty(e)}}function Jm(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Ym(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Xm(e,t,n){return arguments.length>1?this.each((t==null?qm:typeof t==`function`?Ym:Jm)(e,t,n??``)):Zm(this.node(),e)}function Zm(e,t){return e.style.getPropertyValue(t)||Km(e).getComputedStyle(e,null).getPropertyValue(t)}function Qm(e){return function(){delete this[e]}}function $m(e,t){return function(){this[e]=t}}function eh(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function th(e,t){return arguments.length>1?this.each((t==null?Qm:typeof t==`function`?eh:$m)(e,t)):this.node()[e]}function nh(e){return e.trim().split(/^|\s+/)}function rh(e){return e.classList||new ih(e)}function ih(e){this._node=e,this._names=nh(e.getAttribute(`class`)||``)}ih.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function ah(e,t){for(var n=rh(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function oh(e,t){for(var n=rh(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function sh(e){return function(){ah(this,e)}}function ch(e){return function(){oh(this,e)}}function lh(e,t){return function(){(t.apply(this,arguments)?ah:oh)(this,e)}}function uh(e,t){var n=nh(e+``);if(arguments.length<2){for(var r=rh(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?lh:t?sh:ch)(n,t))}function dh(){this.textContent=``}function fh(e){return function(){this.textContent=e}}function ph(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function mh(e){return arguments.length?this.each(e==null?dh:(typeof e==`function`?ph:fh)(e)):this.node().textContent}function hh(){this.innerHTML=``}function gh(e){return function(){this.innerHTML=e}}function _h(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function vh(e){return arguments.length?this.each(e==null?hh:(typeof e==`function`?_h:gh)(e)):this.node().innerHTML}function yh(){this.nextSibling&&this.parentNode.appendChild(this)}function bh(){return this.each(yh)}function xh(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Sh(){return this.each(xh)}function Ch(e){var t=typeof e==`function`?e:Qp(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function wh(){return null}function Th(e,t){var n=typeof e==`function`?e:Qp(e),r=t==null?wh:typeof t==`function`?t:em(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Eh(){var e=this.parentNode;e&&e.removeChild(this)}function Dh(){return this.each(Eh)}function Oh(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function kh(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ah(e){return this.select(e?kh:Oh)}function jh(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function Mh(e){return function(t){e.call(this,t,this.__data__)}}function Nh(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function Ph(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function Fh(e,t,n){return function(){var r=this.__on,i,a=Mh(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function Ih(e,t,n){var r=Nh(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}}else{for(s=t?Fh:Ph,i=0;i<a;++i)this.each(s(r[i],t,n));return this}}function Lh(e,t,n){var r=Km(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Rh(e,t){return function(){return Lh(this,e,t)}}function zh(e,t){return function(){return Lh(this,e,t.apply(this,arguments))}}function Bh(e,t){return this.each((typeof t==`function`?zh:Rh)(e,t))}function*Vh(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var Hh=[null];function Uh(e,t){this._groups=e,this._parents=t}function Wh(){return new Uh([[document.documentElement]],Hh)}function Gh(){return this}Uh.prototype=Wh.prototype={constructor:Uh,select:tm,selectAll:om,selectChild:fm,selectChildren:gm,filter:_m,data:Tm,enter:ym,exit:Dm,join:Om,merge:km,selection:Gh,order:Am,sort:jm,call:Nm,nodes:Pm,node:Fm,size:Im,empty:Lm,each:Rm,attr:Gm,style:Xm,property:th,classed:uh,text:mh,html:vh,raise:bh,lower:Sh,append:Ch,insert:Th,remove:Dh,clone:Ah,datum:jh,on:Ih,dispatch:Bh,[Symbol.iterator]:Vh};function Kh(e){return typeof e==`string`?new Uh([[document.querySelector(e)]],[document.documentElement]):new Uh([[e]],Hh)}function qh(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Jh(e,t){if(e=qh(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var Yh={passive:!1},Xh={capture:!0,passive:!1};function Zh(e){e.stopImmediatePropagation()}function Qh(e){e.preventDefault(),e.stopImmediatePropagation()}function $h(e){var t=e.document.documentElement,n=Kh(e).on(`dragstart.drag`,Qh,Xh);`onselectstart`in t?n.on(`selectstart.drag`,Qh,Xh):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function eg(e,t){var n=e.document.documentElement,r=Kh(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,Qh,Xh),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var tg=e=>()=>e;function ng(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}ng.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function rg(e){return!e.ctrlKey&&!e.button}function ig(){return this.parentNode}function ag(e,t){return t??{x:e.x,y:e.y}}function og(){return navigator.maxTouchPoints||`ontouchstart`in this}function sg(){var e=rg,t=ig,n=ag,r=og,i={},a=Up(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,Yh).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!u&&e.call(this,n,r)){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(Kh(n.view).on(`mousemove.drag`,m,Xh).on(`mouseup.drag`,h,Xh),$h(n.view),Zh(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(Qh(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){Kh(e.view).on(`mousemove.drag mouseup.drag`,null),eg(e.view,l),Qh(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r))for(var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s=0,c;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(Zh(n),c(`start`,n,i[s]))}function _(e){for(var t=e.changedTouches,n=t.length,r=0,a;r<n;++r)(a=i[t[r].identifier])&&(Qh(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(Zh(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=Jh(l||r,t),p,m,h;if((h=n.call(e,new ng(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=Jh(l||a,t),_=o}u.call(r,e,new ng(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:tg(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:tg(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:tg(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:tg(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function cg(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function lg(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ug(){}var dg=.7,fg=1/dg,pg=`\\s*([+-]?\\d+)\\s*`,mg=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,hg=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,gg=/^#([0-9a-f]{3,8})$/,_g=RegExp(`^rgb\\(${pg},${pg},${pg}\\)$`),vg=RegExp(`^rgb\\(${hg},${hg},${hg}\\)$`),yg=RegExp(`^rgba\\(${pg},${pg},${pg},${mg}\\)$`),bg=RegExp(`^rgba\\(${hg},${hg},${hg},${mg}\\)$`),xg=RegExp(`^hsl\\(${mg},${hg},${hg}\\)$`),Sg=RegExp(`^hsla\\(${mg},${hg},${hg},${mg}\\)$`),Cg={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};cg(ug,Og,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:wg,formatHex:wg,formatHex8:Tg,formatHsl:Eg,formatRgb:Dg,toString:Dg});function wg(){return this.rgb().formatHex()}function Tg(){return this.rgb().formatHex8()}function Eg(){return Vg(this).formatHsl()}function Dg(){return this.rgb().formatRgb()}function Og(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=gg.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?kg(t):n===3?new Ng(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ag(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ag(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=_g.exec(e))?new Ng(t[1],t[2],t[3],1):(t=vg.exec(e))?new Ng(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=yg.exec(e))?Ag(t[1],t[2],t[3],t[4]):(t=bg.exec(e))?Ag(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=xg.exec(e))?Bg(t[1],t[2]/100,t[3]/100,1):(t=Sg.exec(e))?Bg(t[1],t[2]/100,t[3]/100,t[4]):Cg.hasOwnProperty(e)?kg(Cg[e]):e===`transparent`?new Ng(NaN,NaN,NaN,0):null}function kg(e){return new Ng(e>>16&255,e>>8&255,e&255,1)}function Ag(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ng(e,t,n,r)}function jg(e){return e instanceof ug||(e=Og(e)),e?(e=e.rgb(),new Ng(e.r,e.g,e.b,e.opacity)):new Ng}function Mg(e,t,n,r){return arguments.length===1?jg(e):new Ng(e,t,n,r??1)}function Ng(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}cg(Ng,Mg,lg(ug,{brighter(e){return e=e==null?fg:fg**+e,new Ng(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?dg:dg**+e,new Ng(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ng(Rg(this.r),Rg(this.g),Rg(this.b),Lg(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Pg,formatHex:Pg,formatHex8:Fg,formatRgb:Ig,toString:Ig}));function Pg(){return`#${zg(this.r)}${zg(this.g)}${zg(this.b)}`}function Fg(){return`#${zg(this.r)}${zg(this.g)}${zg(this.b)}${zg((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ig(){let e=Lg(this.opacity);return`${e===1?`rgb(`:`rgba(`}${Rg(this.r)}, ${Rg(this.g)}, ${Rg(this.b)}${e===1?`)`:`, ${e})`}`}function Lg(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Rg(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function zg(e){return e=Rg(e),(e<16?`0`:``)+e.toString(16)}function Bg(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ug(e,t,n,r)}function Vg(e){if(e instanceof Ug)return new Ug(e.h,e.s,e.l,e.opacity);if(e instanceof ug||(e=Og(e)),!e)return new Ug;if(e instanceof Ug)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new Ug(o,s,c,e.opacity)}function Hg(e,t,n,r){return arguments.length===1?Vg(e):new Ug(e,t,n,r??1)}function Ug(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}cg(Ug,Hg,lg(ug,{brighter(e){return e=e==null?fg:fg**+e,new Ug(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?dg:dg**+e,new Ug(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Ng(Kg(e>=240?e-240:e+120,i,r),Kg(e,i,r),Kg(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ug(Wg(this.h),Gg(this.s),Gg(this.l),Lg(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=Lg(this.opacity);return`${e===1?`hsl(`:`hsla(`}${Wg(this.h)}, ${Gg(this.s)*100}%, ${Gg(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function Wg(e){return e=(e||0)%360,e<0?e+360:e}function Gg(e){return Math.max(0,Math.min(1,e||0))}function Kg(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var qg=e=>()=>e;function Jg(e,t){return function(n){return e+n*t}}function Yg(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Xg(e){return(e=+e)==1?Zg:function(t,n){return n-t?Yg(t,n,e):qg(isNaN(t)?n:t)}}function Zg(e,t){var n=t-e;return n?Jg(e,n):qg(isNaN(e)?t:e)}var Qg=(function e(t){var n=Xg(t);function r(e,t){var r=n((e=Mg(e)).r,(t=Mg(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=Zg(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function $g(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var e_=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,t_=new RegExp(e_.source,`g`);function n_(e){return function(){return e}}function r_(e){return function(t){return e(t)+``}}function i_(e,t){var n=e_.lastIndex=t_.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=e_.exec(e))&&(i=t_.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:$g(r,i)})),n=t_.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?r_(c[0].x):n_(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}var a_=180/Math.PI,o_={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function s_(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*a_,skewX:Math.atan(c)*a_,scaleX:o,scaleY:s}}var c_;function l_(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?o_:s_(t.a,t.b,t.c,t.d,t.e,t.f)}function u_(e){return e==null||(c_||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),c_.setAttribute(`transform`,e),!(e=c_.transform.baseVal.consolidate()))?o_:(e=e.matrix,s_(e.a,e.b,e.c,e.d,e.e,e.f))}function d_(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:$g(e,i)},{i:c-2,x:$g(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:$g(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:$g(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:$g(e,n)},{i:s-2,x:$g(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var f_=d_(l_,`px, `,`px)`,`deg)`),p_=d_(u_,`, `,`)`,`)`),m_=1e-12;function h_(e){return((e=Math.exp(e))+1/e)/2}function g_(e){return((e=Math.exp(e))-1/e)/2}function __(e){return((e=Math.exp(2*e))-1)/(e+1)}var v_=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<m_)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=h_(y),c=s/(n*g)*(i*__(t*r+y)-g_(y));return[a+c*d,o+c*f,s*i/h_(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4),y_=0,b_=0,x_=0,S_=1e3,C_,w_,T_=0,E_=0,D_=0,O_=typeof performance==`object`&&performance.now?performance:Date,k_=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function A_(){return E_||=(k_(j_),O_.now()+D_)}function j_(){E_=0}function M_(){this._call=this._time=this._next=null}M_.prototype=N_.prototype={constructor:M_,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?A_():+n)+(t==null?0:+t),!this._next&&w_!==this&&(w_?w_._next=this:C_=this,w_=this),this._call=e,this._time=n,R_()},stop:function(){this._call&&(this._call=null,this._time=1/0,R_())}};function N_(e,t,n){var r=new M_;return r.restart(e,t,n),r}function P_(){A_(),++y_;for(var e=C_,t;e;)(t=E_-e._time)>=0&&e._call.call(void 0,t),e=e._next;--y_}function F_(){E_=(T_=O_.now())+D_,y_=b_=0;try{P_()}finally{y_=0,L_(),E_=0}}function I_(){var e=O_.now(),t=e-T_;t>S_&&(D_-=t,T_=e)}function L_(){for(var e,t=C_,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:C_=n);w_=e,R_(r)}function R_(e){y_||(b_&&=clearTimeout(b_),e-E_>24?(e<1/0&&(b_=setTimeout(F_,e-O_.now()-D_)),x_&&=clearInterval(x_)):(x_||=(T_=O_.now(),setInterval(I_,S_)),y_=1,k_(F_)))}function z_(e,t,n){var r=new M_;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var B_=Up(`start`,`end`,`cancel`,`interrupt`),V_=[];function H_(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;K_(e,n,{name:t,index:r,group:i,on:B_,tween:V_,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function U_(e,t){var n=G_(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function W_(e,t){var n=G_(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function G_(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function K_(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=N_(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return z_(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(z_(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function q_(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n)(r=n[o]).name===t?(i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]):a=!1;a&&delete e.__transition}}function J_(e){return this.each(function(){q_(this,e)})}function Y_(e,t){var n,r;return function(){var i=W_(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function X_(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=W_(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function Z_(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=G_(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?Y_:X_)(n,e,t))}function Q_(e,t,n){var r=e._id;return e.each(function(){var e=W_(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return G_(e,r).value[t]}}function $_(e,t){var n;return(typeof t==`number`?$g:t instanceof Og?Qg:(n=Og(t))?(t=n,Qg):i_)(e,t)}function ev(e){return function(){this.removeAttribute(e)}}function tv(e){return function(){this.removeAttributeNS(e.space,e.local)}}function nv(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function rv(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function iv(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function av(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function ov(e,t){var n=Yp(e),r=n===`transform`?p_:$_;return this.attrTween(e,typeof t==`function`?(n.local?av:iv)(n,r,Q_(this,`attr.`+e,t)):t==null?(n.local?tv:ev)(n):(n.local?rv:nv)(n,r,t))}function sv(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function cv(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function lv(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&cv(e,i)),n}return i._value=t,i}function uv(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&sv(e,i)),n}return i._value=t,i}function dv(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=Yp(e);return this.tween(n,(r.local?lv:uv)(r,t))}function fv(e,t){return function(){U_(this,e).delay=+t.apply(this,arguments)}}function pv(e,t){return t=+t,function(){U_(this,e).delay=t}}function mv(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?fv:pv)(t,e)):G_(this.node(),t).delay}function hv(e,t){return function(){W_(this,e).duration=+t.apply(this,arguments)}}function gv(e,t){return t=+t,function(){W_(this,e).duration=t}}function _v(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?hv:gv)(t,e)):G_(this.node(),t).duration}function vv(e,t){if(typeof t!=`function`)throw Error();return function(){W_(this,e).ease=t}}function yv(e){var t=this._id;return arguments.length?this.each(vv(t,e)):G_(this.node(),t).ease}function bv(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();W_(this,e).ease=n}}function xv(e){if(typeof e!=`function`)throw Error();return this.each(bv(this._id,e))}function Sv(e){typeof e!=`function`&&(e=sm(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Zv(r,this._parents,this._name,this._id)}function Cv(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new Zv(o,this._parents,this._name,this._id)}function wv(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function Tv(e,t,n){var r,i,a=wv(t)?U_:W_;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function Ev(e,t){var n=this._id;return arguments.length<2?G_(this.node(),n).on.on(e):this.each(Tv(n,e,t))}function Dv(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Ov(){return this.on(`end.remove`,Dv(this._id))}function kv(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=em(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,H_(l[f],t,n,f,l,G_(u,n)));return new Zv(a,this._parents,t,n)}function Av(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=im(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=G_(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&H_(p,t,n,h,f,m);a.push(f),o.push(u)}return new Zv(a,o,t,n)}var jv=Wh.prototype.constructor;function Mv(){return new jv(this._groups,this._parents)}function Nv(e,t){var n,r,i;return function(){var a=Zm(this,e),o=(this.style.removeProperty(e),Zm(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function Pv(e){return function(){this.style.removeProperty(e)}}function Fv(e,t,n){var r,i=n+``,a;return function(){var o=Zm(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function Iv(e,t,n){var r,i,a;return function(){var o=Zm(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),Zm(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function Lv(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=W_(this,e),l=c.on,u=c.value[a]==null?s||=Pv(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function Rv(e,t,n){var r=(e+=``)==`transform`?f_:$_;return t==null?this.styleTween(e,Nv(e,r)).on(`end.style.`+e,Pv(e)):typeof t==`function`?this.styleTween(e,Iv(e,r,Q_(this,`style.`+e,t))).each(Lv(this._id,e)):this.styleTween(e,Fv(e,r,t),n).on(`end.style.`+e,null)}function zv(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Bv(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&zv(e,a,n)),r}return a._value=t,a}function Vv(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,Bv(e,t,n??``))}function Hv(e){return function(){this.textContent=e}}function Uv(e){return function(){var t=e(this);this.textContent=t??``}}function Wv(e){return this.tween(`text`,typeof e==`function`?Uv(Q_(this,`text`,e)):Hv(e==null?``:e+``))}function Gv(e){return function(t){this.textContent=e.call(this,t)}}function Kv(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Gv(r)),t}return r._value=e,r}function qv(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,Kv(e))}function Jv(){for(var e=this._name,t=this._id,n=Qv(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=G_(c,t);H_(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Zv(r,this._parents,e,n)}function Yv(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=W_(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var Xv=0;function Zv(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Qv(){return++Xv}var $v=Wh.prototype;Zv.prototype={constructor:Zv,select:kv,selectAll:Av,selectChild:$v.selectChild,selectChildren:$v.selectChildren,filter:Sv,merge:Cv,selection:Mv,transition:Jv,call:$v.call,nodes:$v.nodes,node:$v.node,size:$v.size,empty:$v.empty,each:$v.each,on:Ev,attr:ov,attrTween:dv,style:Rv,styleTween:Vv,text:Wv,textTween:qv,remove:Ov,tween:Z_,delay:mv,duration:_v,ease:yv,easeVarying:xv,end:Yv,[Symbol.iterator]:$v[Symbol.iterator]};function ey(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var ty={time:null,delay:0,duration:250,ease:ey};function ny(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function ry(e){var t,n;e instanceof Zv?(t=e._id,e=e._name):(t=Qv(),(n=ty).time=A_(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&H_(c,e,t,l,o,n||ny(c,t));return new Zv(r,this._parents,e,t)}Wh.prototype.interrupt=J_,Wh.prototype.transition=ry;var iy=e=>()=>e;function ay(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function oy(e,t,n){this.k=e,this.x=t,this.y=n}oy.prototype={constructor:oy,scale:function(e){return e===1?this:new oy(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new oy(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var sy=new oy(1,0,0);cy.prototype=oy.prototype;function cy(e){for(;!e.__zoom;)if(!(e=e.parentNode))return sy;return e.__zoom}function ly(e){e.stopImmediatePropagation()}function uy(e){e.preventDefault(),e.stopImmediatePropagation()}function dy(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function fy(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute(`viewBox`)?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function py(){return this.__zoom||sy}function my(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function hy(){return navigator.maxTouchPoints||`ontouchstart`in this}function gy(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function _y(){var e=dy,t=fy,n=gy,r=my,i=hy,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=v_,l=Up(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,py).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,ee).on(`touchend.zoom touchcancel.zoom`,te).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,py),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(sy.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new oy(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new oy(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new oy(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=Kh(this.that).datum();l.call(e,this.that,new ay(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=Jh(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],q_(this),s.start();uy(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=Kh(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=Jh(t,i),l=t.clientX,u=t.clientY;$h(t.view),ly(t),a.mouse=[c,this.__zoom.invert(c)],q_(this),a.start();function d(e){if(uy(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=Jh(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),eg(e.view,a.moved),uy(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=Jh(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);uy(r),s>0?Kh(this).transition().duration(s).call(x,d,c,r):Kh(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(ly(t),s=0;s<i;++s)c=r[s],l=Jh(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),q_(this),a.start())}}function ee(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(uy(e),s=0;s<a;++s)c=i[s],l=Jh(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function te(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(ly(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=Jh(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=Kh(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:iy(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:iy(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:iy(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:iy([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var vy={error001:()=>`[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001`,error002:()=>`It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.`,error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>`The React Flow parent container needs a width and a height to render the graph.`,error005:()=>`Only child nodes can use a parent extent.`,error006:()=>`Can't create edge. An edge needs a source and a target.`,error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e===`source`?n:r}", edge id: ${t}.`,error010:()=>`Handle: No node id found. Make sure to only use a Handle inside a custom Node.`,error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e=`react`)=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`},yy=[[-1/0,-1/0],[1/0,1/0]],by=[`Enter`,` `,`Escape`],xy;(function(e){e.Strict=`strict`,e.Loose=`loose`})(xy||={});var Sy;(function(e){e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`})(Sy||={});var Cy;(function(e){e.Partial=`partial`,e.Full=`full`})(Cy||={});var wy={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null},Ty;(function(e){e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`})(Ty||={});var Ey;(function(e){e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`})(Ey||={});var Dy;(function(e){e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`})(Dy||={});var Oy={[Dy.Left]:Dy.Right,[Dy.Right]:Dy.Left,[Dy.Top]:Dy.Bottom,[Dy.Bottom]:Dy.Top};function ky(e){return e===null?null:e?`valid`:`invalid`}var Ay=e=>`id`in e&&`source`in e&&`target`in e,jy=e=>`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),My=e=>`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),Ny=(e,t=[0,0])=>{let{width:n,height:r}=lb(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},Py=(e,t={nodeOrigin:[0,0],nodeLookup:void 0})=>e.length===0?{x:0,y:0,width:0,height:0}:Yy(e.reduce((e,n)=>{let r=typeof n==`string`,i=!t.nodeLookup&&!r?n:void 0;return t.nodeLookup&&(i=r?t.nodeLookup.get(n):My(n)?n:t.nodeLookup.get(n.id)),qy(e,i?Zy(i,t.nodeOrigin):{x:0,y:0,x2:0,y2:0})},{x:1/0,y:1/0,x2:-1/0,y2:-1/0})),Fy=(e,t={})=>{if(e.size===0)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(e=>{if(t.filter===void 0||t.filter(e)){let t=Zy(e);n=qy(n,t)}}),Yy(n)},Iy=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{let s={...ib(t,[n,r,i]),width:t.width/i,height:t.height/i},c=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(o&&!n||r)continue;let i=e.width??t.width??t.initialWidth??null,l=e.height??t.height??t.initialHeight??null,u=$y(s,Xy(t)),d=(i??0)*(l??0),f=a&&u>0;(!t.internals.handleBounds||f||u>=d||t.dragging)&&c.push(t)}return c},Ly=(e,t)=>{let n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))};function Ry(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{e.measured.width&&e.measured.height&&(t?.includeHiddenNodes||!e.hidden)&&(!r||r.has(e.id))&&n.set(e.id,e)}),n}async function zy({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return Promise.resolve(!1);let s=ob(Fy(e),t,n,o?.minZoom??i,o?.maxZoom??a,o?.padding??.1);return await r.setViewport(s,{duration:o?.duration}),Promise.resolve(!0)}function By({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){let o=n.get(e),s=o.parentId?n.get(o.parentId):void 0,{x:c,y:l}=s?s.internals.positionAbsolute:{x:0,y:0},u=o.origin??r,d=i;if(o.extent===`parent`&&!o.expandParent){if(!s)a?.(`005`,vy.error005());else{let e=s.measured.width,t=s.measured.height;e&&t&&(d=[[c,l],[c+e,l+t]])}}else s&&cb(o.extent)&&(d=[[o.extent[0][0]+c,o.extent[0][1]+l],[o.extent[1][0]+c,o.extent[1][1]+l]]);let f=cb(d)?Uy(t,d,o.measured):t;return{position:{x:f.x-c+o.measured.width*u[0],y:f.y-l+o.measured.height*u[1]},positionAbsolute:f}}async function Vy({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let a=new Set(e.map(e=>e.id)),o=[];for(let e of n){if(e.deletable===!1)continue;let t=a.has(e.id),n=!t&&e.parentId&&o.find(t=>t.id===e.parentId);(t||n)&&o.push(e)}let s=new Set(t.map(e=>e.id)),c=r.filter(e=>e.deletable!==!1),l=Ly(o,c);for(let e of c)s.has(e.id)&&!l.find(t=>t.id===e.id)&&l.push(e);if(!i)return{edges:l,nodes:o};let u=await i({nodes:o,edges:l});return typeof u==`boolean`?u?{edges:l,nodes:o}:{edges:[],nodes:[]}:u}var Hy=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Uy=(e={x:0,y:0},t,n)=>({x:Hy(e.x,t[0][0],t[1][0]-(n?.width??0)),y:Hy(e.y,t[0][1],t[1][1]-(n?.height??0))});function Wy(e,t,n){let{width:r,height:i}=lb(n),{x:a,y:o}=n.internals.positionAbsolute;return Uy(e,[[a,o],[a+r,o+i]],t)}var Gy=(e,t,n)=>e<t?Hy(Math.abs(e-t),1,t)/t:e>n?-Hy(Math.abs(e-n),1,t)/t:0,Ky=(e,t,n=15,r=40)=>[Gy(e.x,r,t.width-r)*n,Gy(e.y,r,t.height-r)*n],qy=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Jy=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Yy=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Xy=(e,t=[0,0])=>{let{x:n,y:r}=My(e)?e.internals.positionAbsolute:Ny(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Zy=(e,t=[0,0])=>{let{x:n,y:r}=My(e)?e.internals.positionAbsolute:Ny(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},Qy=(e,t)=>Yy(qy(Jy(e),Jy(t))),$y=(e,t)=>{let n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},eb=e=>tb(e.width)&&tb(e.height)&&tb(e.x)&&tb(e.y),tb=e=>!isNaN(e)&&isFinite(e),nb=(e,t)=>{},rb=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),ib=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?rb(s,o):s},ab=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r}),ob=(e,t,n,r,i,a)=>{let o=t/(e.width*(1+a)),s=n/(e.height*(1+a)),c=Hy(Math.min(o,s),r,i),l=e.x+e.width/2,u=e.y+e.height/2;return{x:t/2-l*c,y:n/2-u*c,zoom:c}},sb=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function cb(e){return e!==void 0&&e!==`parent`}function lb(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function ub(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function db(e,t={width:0,height:0},n,r,i){let a={...e},o=r.get(n);if(o){let e=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*e[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*e[1]}return a}function fb(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=vb(e),s=ib({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?rb(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var pb=e=>({width:e.offsetWidth,height:e.offsetHeight}),mb=e=>e.getRootNode?.()||window?.document,hb=[`INPUT`,`SELECT`,`TEXTAREA`];function gb(e){let t=e.composedPath?.()?.[0]||e.target;return hb.includes(t?.nodeName)||t?.hasAttribute?.(`contenteditable`)||!!t?.closest(`.nokey`)}var _b=e=>`clientX`in e,vb=(e,t)=>{let n=_b(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},yb=(e,t,n,r,i)=>{let a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...pb(t)}})};function bb({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:s}){let c=e*.125+i*.375+o*.375+n*.125,l=t*.125+a*.375+s*.375+r*.125;return[c,l,Math.abs(c-e),Math.abs(l-t)]}function xb(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Sb({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case Dy.Left:return[t-xb(t-r,a),n];case Dy.Right:return[t+xb(r-t,a),n];case Dy.Top:return[t,n-xb(n-i,a)];case Dy.Bottom:return[t,n+xb(i-n,a)]}}function Cb({sourceX:e,sourceY:t,sourcePosition:n=Dy.Bottom,targetX:r,targetY:i,targetPosition:a=Dy.Top,curvature:o=.25}){let[s,c]=Sb({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=Sb({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=bb({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${c} ${l},${u} ${r},${i}`,d,f,p,m]}function wb({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2;return[a,r<t?r+o:r-o,i,o]}function Tb({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1}){if(!i)return r;let a=n||t.selected||e.selected,o=Math.max(e.internals.z||0,t.internals.z||0,1e3);return r+(a?o:0)}function Eb({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=qy(Zy(e),Zy(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),$y({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},Yy(a))>0}var Db=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,Ob=(e,t)=>t.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),kb=(e,t)=>{if(!e.source||!e.target)return vy.error006(),t;let n;return n=Ay(e)?{...e}:{...e,id:Db(e)},Ob(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function Ab({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=wb({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var jb={[Dy.Left]:{x:-1,y:0},[Dy.Right]:{x:1,y:0},[Dy.Top]:{x:0,y:-1},[Dy.Bottom]:{x:0,y:1}},Mb=({source:e,sourcePosition:t=Dy.Bottom,target:n})=>t===Dy.Left||t===Dy.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Nb=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2);function Pb({source:e,sourcePosition:t=Dy.Bottom,target:n,targetPosition:r=Dy.Top,center:i,offset:a}){let o=jb[t],s=jb[r],c={x:e.x+o.x*a,y:e.y+o.y*a},l={x:n.x+s.x*a,y:n.y+s.y*a},u=Mb({source:c,sourcePosition:t,target:l}),d=u.x===0?`y`:`x`,f=u[d],p=[],m,h,g={x:0,y:0},_={x:0,y:0},[v,y,b,x]=wb({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(o[d]*s[d]===-1){m=i.x??v,h=i.y??y;let e=[{x:m,y:c.y},{x:m,y:l.y}],t=[{x:c.x,y:h},{x:l.x,y:h}];p=o[d]===f?d===`x`?e:t:d===`x`?t:e}else{let i=[{x:c.x,y:l.y}],u=[{x:l.x,y:c.y}];if(p=d===`x`?o.x===f?u:i:o.y===f?i:u,t===r){let t=Math.abs(e[d]-n[d]);if(t<=a){let r=Math.min(a-1,a-t);o[d]===f?g[d]=(c[d]>e[d]?-1:1)*r:_[d]=(l[d]>n[d]?-1:1)*r}}if(t!==r){let e=d===`x`?`y`:`x`,t=o[d]===s[e],n=c[e]>l[e],r=c[e]<l[e];(o[d]===1&&(!t&&n||t&&r)||o[d]!==1&&(!t&&r||t&&n))&&(p=d===`x`?i:u)}let v={x:c.x+g.x,y:c.y+g.y},y={x:l.x+_.x,y:l.y+_.y};Math.max(Math.abs(v.x-p[0].x),Math.abs(y.x-p[0].x))>=Math.max(Math.abs(v.y-p[0].y),Math.abs(y.y-p[0].y))?(m=(v.x+y.x)/2,h=p[0].y):(m=p[0].x,h=(v.y+y.y)/2)}return[[e,{x:c.x+g.x,y:c.y+g.y},...p,{x:l.x+_.x,y:l.y+_.y},n],m,h,b,x]}function Fb(e,t,n,r){let i=Math.min(Nb(e,t)/2,Nb(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${a+i*t},${o}Q ${a},${o} ${a},${o+i*r}`}let s=e.x<n.x?1:-1;return`L ${a},${o+i*(e.y<n.y?-1:1)}Q ${a},${o} ${a+i*s},${o}`}function Ib({sourceX:e,sourceY:t,sourcePosition:n=Dy.Bottom,targetX:r,targetY:i,targetPosition:a=Dy.Top,borderRadius:o=5,centerX:s,centerY:c,offset:l=20}){let[u,d,f,p,m]=Pb({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:s,y:c},offset:l});return[u.reduce((e,t,n)=>{let r=``;return r=n>0&&n<u.length-1?Fb(u[n-1],t,u[n+1],o):`${n===0?`M`:`L`}${t.x} ${t.y}`,e+=r,e},``),d,f,p,m]}function Lb(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Rb(e){let{sourceNode:t,targetNode:n}=e;if(!Lb(t)||!Lb(n))return null;let r=t.internals.handleBounds||zb(t.handles),i=n.internals.handleBounds||zb(n.handles),a=Vb(r?.source??[],e.sourceHandle),o=Vb(e.connectionMode===xy.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!o)return e.onError?.(`008`,vy.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||Dy.Bottom,c=o?.position||Dy.Top,l=Bb(t,a,s),u=Bb(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function zb(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,r.type===`source`?t.push(r):r.type===`target`&&n.push(r);return{source:t,target:n}}function Bb(e,t,n=Dy.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,a=(t?.y??0)+e.internals.positionAbsolute.y,{width:o,height:s}=t??lb(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case Dy.Top:return{x:i+o/2,y:a};case Dy.Right:return{x:i+o,y:a+s/2};case Dy.Bottom:return{x:i+o/2,y:a+s};case Dy.Left:return{x:i,y:a+s/2}}}function Vb(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function Hb(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function Ub(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let a=new Set;return e.reduce((e,o)=>([o.markerStart||r,o.markerEnd||i].forEach(r=>{if(r&&typeof r==`object`){let i=Hb(r,t);a.has(i)||(e.push({id:i,color:r.color||n,...r}),a.add(i))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}var Wb={nodeOrigin:[0,0],nodeExtent:yy,elevateNodesOnSelect:!0,defaults:{}},Gb={...Wb,checkEquality:!0};function Kb(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function qb(e,t,n){let r=Kb(Wb,n);for(let n of e.values())if(n.parentId)Xb(n,e,t,r);else{let e=Uy(Ny(n,r.nodeOrigin),cb(n.extent)?n.extent:r.nodeExtent,lb(n));n.internals.positionAbsolute=e}}function Jb(e,t,n,r){let i=Kb(Gb,r),a=new Map(t),o=i?.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(let s of e){let e=a.get(s.id);if(i.checkEquality&&s===e?.internals.userNode)t.set(s.id,e);else{let n=Uy(Ny(s,i.nodeOrigin),cb(s.extent)?s.extent:i.nodeExtent,lb(s));e={...i.defaults,...s,measured:{width:s.measured?.width,height:s.measured?.height},internals:{positionAbsolute:n,handleBounds:s.measured?e?.internals.handleBounds:void 0,z:Zb(s,o),userNode:s}},t.set(s.id,e)}s.parentId&&Xb(e,t,n,r)}}function Yb(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Xb(e,t,n,r){let{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:o}=Kb(Wb,r),s=e.parentId,c=t.get(s);if(!c){console.warn(`Parent node ${s} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Yb(e,n);let{x:l,y:u,z:d}=Qb(e,c,a,o,i?1e3:0),{positionAbsolute:f}=e.internals,p=l!==f.x||u!==f.y;(p||d!==e.internals.z)&&(e.internals={...e.internals,positionAbsolute:p?{x:l,y:u}:f,z:d})}function Zb(e,t){return(tb(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function Qb(e,t,n,r,i){let{x:a,y:o}=t.internals.positionAbsolute,s=lb(e),c=Ny(e,n),l=cb(e.extent)?Uy(c,e.extent,s):c,u=Uy({x:a+l.x,y:o+l.y},r,s);e.extent===`parent`&&(u=Wy(u,s,t));let d=Zb(e,i),f=t.internals.z??0;return{x:u.x,y:u.y,z:f>d?f:d}}function $b(e,t,n,r=[0,0]){let i=[],a=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=Qy(a.get(n.parentId)?.expandedRect??Xy(e),n.rect);a.set(n.parentId,{expandedRect:r,parent:e})}return a.size>0&&a.forEach(({expandedRect:t,parent:a},o)=>{let s=a.internals.positionAbsolute,c=lb(a),l=a.origin??r,u=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,d=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,f=Math.max(c.width,Math.round(t.width)),p=Math.max(c.height,Math.round(t.height)),m=(f-c.width)*l[0],h=(p-c.height)*l[1];(u>0||d>0||m||h)&&(i.push({id:o,type:`position`,position:{x:a.position.x-u+m,y:a.position.y-d+h}}),n.get(o)?.forEach(t=>{e.some(e=>e.id===t.id)||i.push({id:t.id,type:`position`,position:{x:t.position.x+u,y:t.position.y+d}})})),(c.width<t.width||c.height<t.height||u||d)&&i.push({id:o,type:`dimensions`,setAttributes:!0,dimensions:{width:f+(u?l[0]*u-m:0),height:p+(d?l[1]*d-h:0)}})}),i}function ex(e,t,n,r,i,a){let o=r?.querySelector(`.xyflow__viewport`),s=!1;if(!o)return{changes:[],updatedInternals:s};let c=[],l=window.getComputedStyle(o),{m22:u}=new window.DOMMatrixReadOnly(l.transform),d=[];for(let r of e.values()){let e=t.get(r.id);if(e){if(e.hidden)e.internals={...e.internals,handleBounds:void 0},s=!0;else{let o=pb(r.nodeElement),l=e.measured.width!==o.width||e.measured.height!==o.height;if(o.width&&o.height&&(l||!e.internals.handleBounds||r.force)){let f=r.nodeElement.getBoundingClientRect(),p=cb(e.extent)?e.extent:a,{positionAbsolute:m}=e.internals;e.parentId&&e.extent===`parent`?m=Wy(m,o,t.get(e.parentId)):p&&(m=Uy(m,p,o)),e.measured=o,e.internals={...e.internals,positionAbsolute:m,handleBounds:{source:yb(`source`,r.nodeElement,f,u,e.id),target:yb(`target`,r.nodeElement,f,u,e.id)}},e.parentId&&Xb(e,t,n,{nodeOrigin:i}),s=!0,l&&(c.push({id:e.id,type:`dimensions`,dimensions:o}),e.expandParent&&e.parentId&&d.push({id:e.id,parentId:e.parentId,rect:Xy(e,i)}))}}}}if(d.length>0){let e=$b(d,t,n,i);c.push(...e)}return{changes:c,updatedInternals:s}}async function tx({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);let o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r),s=!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2]);return Promise.resolve(s)}function nx(e,t,n){e.clear(),t.clear();for(let r of n){let{source:n,target:i,sourceHandle:a=null,targetHandle:o=null}=r,s=`${n}-source-${a}`,c=`${i}-target-${o}`,l=e.get(s)||new Map,u=e.get(c)||new Map,d={edgeId:r.id,source:n,target:i,sourceHandle:a,targetHandle:o};t.set(r.id,r),e.set(s,l.set(`${i}-${o}`,d)),e.set(c,u.set(`${n}-${a}`,d))}}function rx(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:rx(n,t):!1}function ix(e,t,n){let r=e;do{if(r?.matches(t))return!0;if(r===n)return!1;r=r.parentElement}while(r);return!1}function ax(e,t,n,r){let i=new Map;for(let[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!rx(o,e))&&(o.draggable||t&&o.draggable===void 0)){let t=e.get(a);t&&i.set(a,{id:a,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return i}function ox({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[e,a]of t){let t=n.get(e)?.internals.userNode;t&&i.push({...t,position:a.position,dragging:r})}if(!e)return[i[0],i];let a=n.get(e)?.internals.userNode;return[a?{...a,position:t.get(e)?.position||a.position,dragging:r}:i[0],i]}function sx({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,s=new Map,c=!1,l={x:0,y:0},u=null,d=!1,f=null,p=!1;function m({noDragClassName:m,handleSelector:h,domNode:g,isSelectable:_,nodeId:v,nodeClickDistance:y=0}){f=Kh(g);function b({x:e,y:n},i){let{nodeLookup:o,nodeExtent:c,snapGrid:l,snapToGrid:u,nodeOrigin:d,onNodeDrag:f,onSelectionDrag:p,onError:m,updateNodePositions:h}=t();a={x:e,y:n};let g=!1,_={x:0,y:0,x2:0,y2:0};s.size>1&&c&&(_=Jy(Fy(s)));for(let[t,r]of s){if(!o.has(t))continue;let i={x:e-r.distance.x,y:n-r.distance.y};u&&(i=rb(i,l));let a=[[c[0][0],c[0][1]],[c[1][0],c[1][1]]];if(s.size>1&&c&&!r.extent){let{positionAbsolute:e}=r.internals,t=e.x-_.x+c[0][0],n=e.x+r.measured.width-_.x2+c[1][0],i=e.y-_.y+c[0][1],o=e.y+r.measured.height-_.y2+c[1][1];a=[[t,i],[n,o]]}let{position:f,positionAbsolute:p}=By({nodeId:t,nextPosition:i,nodeLookup:o,nodeExtent:a,nodeOrigin:d,onError:m});g=g||r.position.x!==f.x||r.position.y!==f.y,r.position=f,r.internals.positionAbsolute=p}if(g&&(h(s,!0),i&&(r||f||!v&&p))){let[e,t]=ox({nodeId:v,dragItems:s,nodeLookup:o});r?.(i,s,e,t),f?.(i,e,t),v||p?.(i,t)}}async function x(){if(!u)return;let{transform:e,panBy:n,autoPanSpeed:r}=t(),[i,s]=Ky(l,u,r);(i!==0||s!==0)&&(a.x=(a.x??0)-i/e[2],a.y=(a.y??0)-s/e[2],await n({x:i,y:s})&&b(a,null)),o=requestAnimationFrame(x)}function S(r){let{nodeLookup:i,multiSelectionActive:o,nodesDraggable:c,transform:l,snapGrid:f,snapToGrid:p,selectNodesOnDrag:m,onNodeDragStart:h,onSelectionDragStart:g,unselectNodesAndEdges:y}=t();d=!0,(!m||!_)&&!o&&v&&(i.get(v)?.selected||y()),_&&m&&v&&e?.(v);let b=fb(r.sourceEvent,{transform:l,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=b,s=ax(i,c,b,v),s.size>0&&(n||h||!v&&g)){let[e,t]=ox({nodeId:v,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),v||g?.(r.sourceEvent,t)}}let C=sg().clickDistance(y).on(`start`,e=>{let{domNode:n,nodeDragThreshold:r,transform:i,snapGrid:o,snapToGrid:s}=t();u=n?.getBoundingClientRect()||null,p=!1,r===0&&S(e),a=fb(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:u}),l=vb(e.sourceEvent,u)}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:f,nodeLookup:m}=t(),h=fb(e.sourceEvent,{transform:r,snapGrid:i,snapToGrid:o,containerBounds:u});if((e.sourceEvent.type===`touchmove`&&e.sourceEvent.touches.length>1||v&&!m.has(v))&&(p=!0),!p){if(!c&&n&&d&&(c=!0,x()),!d){let t=h.xSnapped-(a.x??0),n=h.ySnapped-(a.y??0);Math.sqrt(t*t+n*n)>f&&S(e)}(a.x!==h.xSnapped||a.y!==h.ySnapped)&&s&&d&&(l=vb(e.sourceEvent,u),b(h,e.sourceEvent))}}).on(`end`,e=>{if(d&&!p&&(c=!1,d=!1,cancelAnimationFrame(o),s.size>0)){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:a,onSelectionDragStop:o}=t();if(r(s,!1),i||a||!v&&o){let[t,r]=ox({nodeId:v,dragItems:s,nodeLookup:n,dragging:!1});i?.(e.sourceEvent,s,t,r),a?.(e.sourceEvent,t,r),v||o?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!m||!ix(t,`.${m}`,g))&&(!h||ix(t,h,g))});f.call(C)}function h(){f?.on(`.drag`,null)}return{update:m,destroy:h}}function cx(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())$y(i,Xy(e))>0&&r.push(e);return r}var lx=250;function ux(e,t,n,r){let i=[],a=1/0,o=cx(e,n,t+lx);for(let n of o){let o=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=Bb(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function dx(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===`strict`?o.internals.handleBounds?.[t]:[...o.internals.handleBounds?.source??[],...o.internals.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...Bb(o,c,c.position,!0)}:c}function fx(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function px(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var mx=()=>!0;function hx(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:s,nodeLookup:c,lib:l,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:m,onConnect:h,onConnectEnd:g,isValidConnection:_=mx,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S}){let C=mb(e.target),w=0,T,{x:E,y:D}=vb(e),ee=C?.elementFromPoint(E,D),te=fx(a,ee),ne=s?.getBoundingClientRect();if(!ne||!te)return;let O=dx(i,te,r,c,t);if(!O)return;let re=vb(e,ne),k=!1,A=null,ie=!1,j=null;function ae(){if(!u||!ne)return;let[e,t]=Ky(re,ne,S);f({x:e,y:t}),w=requestAnimationFrame(ae)}let oe={...O,nodeId:i,type:te,position:O.position},se=c.get(i),ce={inProgress:!0,isValid:null,from:Bb(se,oe,Dy.Left,!0),fromHandle:oe,fromPosition:oe.position,fromNode:se,to:re,toHandle:null,toPosition:Oy[oe.position],toNode:null};y(ce);let M=ce;m?.(e,{nodeId:i,handleId:r,handleType:te});function le(e){if(!x()||!oe){ue(e);return}let a=b();re=vb(e,ne),T=ux(ib(re,a,!1,[1,1]),n,c,oe),k||=(ae(),!0);let s=gx(e,{handle:T,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?`target`:`source`,isValidConnection:_,doc:C,lib:l,flowId:d,nodeLookup:c});j=s.handleDomNode,A=s.connection,ie=px(!!T,s.isValid);let u={...M,isValid:ie,to:T&&ie?ab({x:T.x,y:T.y},a):re,toHandle:s.toHandle,toPosition:ie&&s.toHandle?s.toHandle.position:Oy[oe.position],toNode:s.toHandle?c.get(s.toHandle.nodeId):null};ie&&T&&M.toHandle&&u.toHandle&&M.toHandle.type===u.toHandle.type&&M.toHandle.nodeId===u.toHandle.nodeId&&M.toHandle.id===u.toHandle.id&&M.to.x===u.to.x&&M.to.y===u.to.y||(y(u),M=u)}function ue(e){(T||j)&&A&&ie&&h?.(A);let{inProgress:t,...n}=M,r={...n,toPosition:M.toHandle?M.toPosition:null};g?.(e,r),a&&v?.(e,r),p(),cancelAnimationFrame(w),k=!1,ie=!1,A=null,j=null,C.removeEventListener(`mousemove`,le),C.removeEventListener(`mouseup`,ue),C.removeEventListener(`touchmove`,le),C.removeEventListener(`touchend`,ue)}C.addEventListener(`mousemove`,le),C.addEventListener(`mouseup`,ue),C.addEventListener(`touchmove`,le),C.addEventListener(`touchend`,ue)}function gx(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=mx,nodeLookup:u}){let d=a===`target`,f=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=vb(e),h=o.elementFromPoint(p,m),g=h?.classList.contains(`${s}-flow__handle`)?h:f,_={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){let e=fx(void 0,g),t=g.getAttribute(`data-nodeid`),a=g.getAttribute(`data-handleid`),o=g.classList.contains(`connectable`),s=g.classList.contains(`connectableend`);if(!t||!e)return _;let c={source:d?t:r,sourceHandle:d?a:i,target:d?r:t,targetHandle:d?i:a};_.connection=c,_.isValid=o&&s&&(n===xy.Strict?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=dx(t,e,a,u,n,!1)}return _}var _x={onPointerDown:hx,isValid:gx};function vx({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=Kh(e);function a({translateExtent:e,width:a,height:o,zoomStep:s=10,pannable:c=!0,zoomable:l=!0,inversePan:u=!1}){let d=e=>{let r=n();if(e.sourceEvent.type!==`wheel`||!t)return;let i=-e.sourceEvent.deltaY*(e.sourceEvent.deltaMode===1?.05:e.sourceEvent.deltaMode?1:.002)*s,a=r[2]*2**i;t.scaleTo(a)},f=[0,0],p=_y().on(`start`,e=>{(e.sourceEvent.type===`mousedown`||e.sourceEvent.type===`touchstart`)&&(f=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on(`zoom`,c?i=>{let s=n();if(i.sourceEvent.type!==`mousemove`&&i.sourceEvent.type!==`touchmove`||!t)return;let c=[i.sourceEvent.clientX??i.sourceEvent.touches[0].clientX,i.sourceEvent.clientY??i.sourceEvent.touches[0].clientY],l=[c[0]-f[0],c[1]-f[1]];f=c;let d=r()*Math.max(s[2],Math.log(s[2]))*(u?-1:1),p={x:s[0]-l[0]*d,y:s[1]-l[1]*d},m=[[0,0],[a,o]];t.setViewportConstrained({x:p.x,y:p.y,zoom:s[2]},m,e)}:null).on(`zoom.wheel`,l?d:null);i.call(p,{})}function o(){i.on(`zoom`,null)}return{update:a,destroy:o,pointer:Jh}}var yx=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,bx=e=>({x:e.x,y:e.y,zoom:e.k}),xx=({x:e,y:t,zoom:n})=>sy.translate(e,t).scale(n),Sx=(e,t)=>e.target.closest(`.${t}`),Cx=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),wx=(e,t=0,n=()=>{})=>{let r=typeof t==`number`&&t>0;return r||n(),r?e.transition().duration(t).on(`end`,n):e},Tx=e=>{let t=e.ctrlKey&&sb()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Ex({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(Sx(u,t))return!1;u.preventDefault(),u.stopImmediatePropagation();let d=n.property(`__zoom`).k||1;if(u.ctrlKey&&o){let e=Jh(u),t=d*2**Tx(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===Sy.Vertical?0:u.deltaX*f,m=i===Sy.Horizontal?0:u.deltaY*f;!sb()&&u.shiftKey&&i!==Sy.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=bx(n.property(`__zoom`));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,s?.(u,h)),e.isPanScrolling&&(c?.(u,h),e.panScrollTimeout=setTimeout(()=>{l?.(u,h),e.isPanScrolling=!1},150))}}function Dx({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){if(!t&&r.type===`wheel`&&!r.ctrlKey||Sx(r,e))return null;r.preventDefault(),n.call(this,r,i)}}function Ox({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=bx(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type===`mousedown`&&t(!0),n&&n?.(r.sourceEvent,i)}}function kx({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&Cx(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,bx(a.transform))}}function Ax({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(!o.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&Cx(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i&&yx(e.prevViewport,o.transform))){let t=bx(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function jx({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:a,userSelectionActive:o,noWheelClassName:s,noPanClassName:c,lib:l}){return u=>{let d=e||t,f=n&&u.ctrlKey;if(u.button===1&&u.type===`mousedown`&&(Sx(u,`${l}-flow__node`)||Sx(u,`${l}-flow__edge`)))return!0;if(!r&&!d&&!i&&!a&&!n||o||Sx(u,s)&&u.type===`wheel`||Sx(u,c)&&(u.type!==`wheel`||i&&u.type===`wheel`&&!e)||!n&&u.ctrlKey&&u.type===`wheel`)return!1;if(!n&&u.type===`touchstart`&&u.touches?.length>1)return u.preventDefault(),!1;if(!d&&!i&&!f&&u.type===`wheel`||!r&&(u.type===`mousedown`||u.type===`touchstart`)||Array.isArray(r)&&!r.includes(u.button)&&u.type===`mousedown`)return!1;let p=Array.isArray(r)&&r.includes(u.button)||!u.button||u.button<=1;return(!u.ctrlKey||u.type===`wheel`)&&p}}function Mx({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:r,translateExtent:i,viewport:a,onPanZoom:o,onPanZoomStart:s,onPanZoomEnd:c,onDraggingChange:l}){let u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=_y().clickDistance(!tb(r)||r<0?0:r).scaleExtent([t,n]).translateExtent(i),p=Kh(e).call(f);y({x:a.x,y:a.y,zoom:Hy(a.zoom,t,n)},[[0,0],[d.width,d.height]],i);let m=p.on(`wheel.zoom`),h=p.on(`dblclick.zoom`);f.wheelDelta(Tx);function g(e,t){return p?new Promise(n=>{f?.transform(wx(p,t?.duration,()=>n(!0)),e)}):Promise.resolve(!1)}function _({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:i,panOnDrag:a,panOnScrollMode:d,panOnScrollSpeed:g,preventScrolling:_,zoomOnPinch:y,zoomOnScroll:b,zoomOnDoubleClick:x,zoomActivationKeyPressed:S,lib:C,onTransformChange:w}){r&&!u.isZoomingOrPanning&&v();let T=i&&!S&&!r?Ex({zoomPanValues:u,noWheelClassName:e,d3Selection:p,d3Zoom:f,panOnScrollMode:d,panOnScrollSpeed:g,zoomOnPinch:y,onPanZoomStart:s,onPanZoom:o,onPanZoomEnd:c}):Dx({noWheelClassName:e,preventScrolling:_,d3ZoomHandler:m});if(p.on(`wheel.zoom`,T,{passive:!1}),!r){let e=Ox({zoomPanValues:u,onDraggingChange:l,onPanZoomStart:s});f.on(`start`,e);let t=kx({zoomPanValues:u,panOnDrag:a,onPaneContextMenu:!!n,onPanZoom:o,onTransformChange:w});f.on(`zoom`,t);let r=Ax({zoomPanValues:u,panOnDrag:a,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:c,onDraggingChange:l});f.on(`end`,r)}let E=jx({zoomActivationKeyPressed:S,panOnDrag:a,zoomOnScroll:b,panOnScroll:i,zoomOnDoubleClick:x,zoomOnPinch:y,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:C});f.filter(E),x?p.on(`dblclick.zoom`,h):p.on(`dblclick.zoom`,null)}function v(){f.on(`zoom`,null)}async function y(e,t,n){let r=xx(e),i=f?.constrain()(r,t,n);return i&&await g(i),new Promise(e=>e(i))}async function b(e,t){let n=xx(e);return await g(n,t),new Promise(e=>e(n))}function x(e){if(p){let t=xx(e),n=p.property(`__zoom`);(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&f?.transform(p,t,null,{sync:!0})}}function S(){let e=p?cy(p.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}}function C(e,t){return p?new Promise(n=>{f?.scaleTo(wx(p,t?.duration,()=>n(!0)),e)}):Promise.resolve(!1)}function w(e,t){return p?new Promise(n=>{f?.scaleBy(wx(p,t?.duration,()=>n(!0)),e)}):Promise.resolve(!1)}function T(e){f?.scaleExtent(e)}function E(e){f?.translateExtent(e)}function D(e){let t=!tb(e)||e<0?0:e;f?.clickDistance(t)}return{update:_,destroy:v,setViewport:b,setViewportConstrained:y,getViewport:S,scaleTo:C,scaleBy:w,setScaleExtent:T,setTranslateExtent:E,syncViewport:x,setClickDistance:D}}var Nx;(function(e){e.Line=`line`,e.Handle=`handle`})(Nx||={});function Px({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){let o=e-t,s=n-r,c=[o>0?1:o<0?-1:0,s>0?1:s<0?-1:0];return o&&i&&(c[0]*=-1),s&&a&&(c[1]*=-1),c}function Fx(e){return{isHorizontal:e.includes(`right`)||e.includes(`left`),isVertical:e.includes(`bottom`)||e.includes(`top`),affectsX:e.includes(`left`),affectsY:e.includes(`top`)}}function Ix(e,t){return Math.max(0,t-e)}function Lx(e,t){return Math.max(0,e-t)}function Rx(e,t,n){return Math.max(0,t-e,e-n)}function zx(e,t){return e?!t:t}function Bx(e,t,n,r,i,a,o,s){let{affectsX:c,affectsY:l}=t,{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:p,ySnapped:m}=n,{minWidth:h,maxWidth:g,minHeight:_,maxHeight:v}=r,{x:y,y:b,width:x,height:S,aspectRatio:C}=e,w=Math.floor(u?p-e.pointerX:0),T=Math.floor(d?m-e.pointerY:0),E=x+(c?-w:w),D=S+(l?-T:T),ee=-a[0]*x,te=-a[1]*S,ne=Rx(E,h,g),O=Rx(D,_,v);if(o){let e=0,t=0;c&&w<0?e=Ix(y+w+ee,o[0][0]):!c&&w>0&&(e=Lx(y+E+ee,o[1][0])),l&&T<0?t=Ix(b+T+te,o[0][1]):!l&&T>0&&(t=Lx(b+D+te,o[1][1])),ne=Math.max(ne,e),O=Math.max(O,t)}if(s){let e=0,t=0;c&&w>0?e=Lx(y+w,s[0][0]):!c&&w<0&&(e=Ix(y+E,s[1][0])),l&&T>0?t=Lx(b+T,s[0][1]):!l&&T<0&&(t=Ix(b+D,s[1][1])),ne=Math.max(ne,e),O=Math.max(O,t)}if(i){if(u){let e=Rx(E/C,_,v)*C;if(ne=Math.max(ne,e),o){let e=0;e=!c&&!l||c&&!l&&f?Lx(b+te+E/C,o[1][1])*C:Ix(b+te+(c?w:-w)/C,o[0][1])*C,ne=Math.max(ne,e)}if(s){let e=0;e=!c&&!l||c&&!l&&f?Ix(b+E/C,s[1][1])*C:Lx(b+(c?w:-w)/C,s[0][1])*C,ne=Math.max(ne,e)}}if(d){let e=Rx(D*C,h,g)/C;if(O=Math.max(O,e),o){let e=0;e=!c&&!l||l&&!c&&f?Lx(y+D*C+ee,o[1][0])/C:Ix(y+(l?T:-T)*C+ee,o[0][0])/C,O=Math.max(O,e)}if(s){let e=0;e=!c&&!l||l&&!c&&f?Ix(y+D*C,s[1][0])/C:Lx(y+(l?T:-T)*C,s[0][0])/C,O=Math.max(O,e)}}}T+=T<0?O:-O,w+=w<0?ne:-ne,i&&(f?E>D*C?T=(zx(c,l)?-w:w)/C:w=(zx(c,l)?-T:T)*C:u?(T=w/C,l=c):(w=T*C,c=l));let re=c?y+w:y,k=l?b+T:b;return{width:x+(c?-w:w),height:S+(l?-T:T),x:a[0]*w*(c?-1:1)+re,y:a[1]*T*(l?-1:1)+k}}var Vx={width:0,height:0,x:0,y:0},Hx={...Vx,pointerX:0,pointerY:0,aspectRatio:1};function Ux(e){return[[0,0],[e.measured.width,e.measured.height]]}function Wx(e,t,n){let r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,s=n[0]*a,c=n[1]*o;return[[r-s,i-c],[r+a-s,i+o-c]]}function Gx({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let a=Kh(e);function o({controlPosition:e,boundaries:o,keepAspectRatio:s,onResizeStart:c,onResize:l,onResizeEnd:u,shouldResize:d}){let f={...Vx},p={...Hx},m=Fx(e),h,g=null,_=[],v,y,b,x=sg().on(`start`,e=>{let{nodeLookup:r,transform:i,snapGrid:a,snapToGrid:o,nodeOrigin:s,paneDomNode:l}=n();if(h=r.get(t),!h)return;g=l?.getBoundingClientRect()??null;let{xSnapped:u,ySnapped:d}=fb(e.sourceEvent,{transform:i,snapGrid:a,snapToGrid:o,containerBounds:g});f={width:h.measured.width??0,height:h.measured.height??0,x:h.position.x??0,y:h.position.y??0},p={...f,pointerX:u,pointerY:d,aspectRatio:f.width/f.height},v=void 0,h.parentId&&(h.extent===`parent`||h.expandParent)&&(v=r.get(h.parentId),y=v&&h.extent===`parent`?Ux(v):void 0),_=[],b=void 0;for(let[e,n]of r)if(n.parentId===t&&(_.push({id:e,position:{...n.position},extent:n.extent}),n.extent===`parent`||n.expandParent)){let e=Wx(n,h,n.origin??s);b=b?[[Math.min(e[0][0],b[0][0]),Math.min(e[0][1],b[0][1])],[Math.max(e[1][0],b[1][0]),Math.max(e[1][1],b[1][1])]]:e}c?.(e,{...f})}).on(`drag`,e=>{let{transform:t,snapGrid:i,snapToGrid:a,nodeOrigin:c}=n(),u=fb(e.sourceEvent,{transform:t,snapGrid:i,snapToGrid:a,containerBounds:g}),x=[];if(!h)return;let{x:S,y:C,width:w,height:T}=f,E={},D=h.origin??c,{width:ee,height:te,x:ne,y:O}=Bx(p,m,u,o,s,D,y,b),re=ee!==w,k=te!==T,A=ne!==S&&re,ie=O!==C&&k;if(!A&&!ie&&!re&&!k)return;if((A||ie||D[0]===1||D[1]===1)&&(E.x=A?ne:f.x,E.y=ie?O:f.y,f.x=E.x,f.y=E.y,_.length>0)){let e=ne-S,t=O-C;for(let n of _)n.position={x:n.position.x-e+D[0]*(ee-w),y:n.position.y-t+D[1]*(te-T)},x.push(n)}if((re||k)&&(E.width=re?ee:f.width,E.height=k?te:f.height,f.width=E.width,f.height=E.height),v&&h.expandParent){let e=D[0]*(E.width??0);E.x&&E.x<e&&(f.x=e,p.x-=E.x-e);let t=D[1]*(E.height??0);E.y&&E.y<t&&(f.y=t,p.y-=E.y-t)}let j=Px({width:f.width,prevWidth:w,height:f.height,prevHeight:T,affectsX:m.affectsX,affectsY:m.affectsY}),ae={...f,direction:j};d?.(e,ae)!==!1&&(l?.(e,ae),r(E,x))}).on(`end`,e=>{u?.(e,{...f}),i?.()});a.call(x)}function s(){a.on(`.drag`,null)}return{update:o,destroy:s}}var Kx=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),qx=o(((e,t)=>{t.exports=Kx()})),Jx=o((e=>{var t=d(),n=qx();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),Yx=c(o(((e,t)=>{t.exports=Jx()}))(),1),Xx=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{n.clear()}},o=t=e(r,i,a);return a},Zx=e=>e?Xx(e):Xx,{useDebugValue:Qx}=v.default,{useSyncExternalStoreWithSelector:$x}=Yx.default,eS=e=>e;function tS(e,t=eS,n){let r=$x(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Qx(r),r}var nS=(e,t)=>{let n=Zx(e),r=(e,r=t)=>tS(n,e,r);return Object.assign(r,n),r},rS=(e,t)=>e?nS(e,t):nS;function iS(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var aS=(0,v.createContext)(null),oS=aS.Provider,sS=vy.error001();function cS(e,t){let n=(0,v.useContext)(aS);if(n===null)throw Error(sS);return tS(n,e,t)}function lS(){let e=(0,v.useContext)(aS);if(e===null)throw Error(sS);return(0,v.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var uS={display:`none`},dS={position:`absolute`,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0px, 0px, 0px, 0px)`,clipPath:`inset(100%)`},fS=`react-flow__node-desc`,pS=`react-flow__edge-desc`,mS=`react-flow__aria-live`,hS=e=>e.ariaLiveMessage;function gS({rfId:e}){let t=cS(hS);return(0,j.jsx)(`div`,{id:`${mS}-${e}`,"aria-live":`assertive`,"aria-atomic":`true`,style:dS,children:t})}function _S({rfId:e,disableKeyboardA11y:t}){return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{id:`${fS}-${e}`,style:uS,children:[`Press enter or space to select a node.`,!t&&`You can then use the arrow keys to move the node around.`,` Press delete to remove it and escape to cancel.`,` `]}),(0,j.jsx)(`div`,{id:`${pS}-${e}`,style:uS,children:`Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.`}),!t&&(0,j.jsx)(gS,{rfId:e})]})}var vS=e=>e.userSelectionActive?`none`:`all`,yS=(0,v.forwardRef)(({position:e=`top-left`,children:t,className:n,style:r,...i},a)=>{let o=cS(vS),s=`${e}`.split(`-`);return(0,j.jsx)(`div`,{className:Vp([`react-flow__panel`,n,...s]),style:{...r,pointerEvents:o},ref:a,...i,children:t})});function bS({proOptions:e,position:t=`bottom-right`}){return e?.hideAttribution?null:(0,j.jsx)(yS,{position:t,className:`react-flow__attribution`,"data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev`,children:(0,j.jsx)(`a`,{href:`https://reactflow.dev`,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`React Flow attribution`,children:`React Flow`})})}var xS=e=>{let t=[],n=[];for(let[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(let[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},SS=e=>e.id;function CS(e,t){return iS(e.selectedNodes.map(SS),t.selectedNodes.map(SS))&&iS(e.selectedEdges.map(SS),t.selectedEdges.map(SS))}function wS({onSelectionChange:e}){let t=lS(),{selectedNodes:n,selectedEdges:r}=cS(xS,CS);return(0,v.useEffect)(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(e=>e(i))},[n,r,e]),null}var TS=e=>!!e.onSelectionChangeHandlers;function ES({onSelectionChange:e}){let t=cS(TS);return e||t?(0,j.jsx)(wS,{onSelectionChange:e}):null}var DS=[0,0],OS={x:0,y:0,zoom:1},kS=[...`nodes.edges.defaultNodes.defaultEdges.onConnect.onConnectStart.onConnectEnd.onClickConnectStart.onClickConnectEnd.nodesDraggable.nodesConnectable.nodesFocusable.edgesFocusable.edgesReconnectable.elevateNodesOnSelect.elevateEdgesOnSelect.minZoom.maxZoom.nodeExtent.onNodesChange.onEdgesChange.elementsSelectable.connectionMode.snapGrid.snapToGrid.translateExtent.connectOnClick.defaultEdgeOptions.fitView.fitViewOptions.onNodesDelete.onEdgesDelete.onDelete.onNodeDrag.onNodeDragStart.onNodeDragStop.onSelectionDrag.onSelectionDragStart.onSelectionDragStop.onMoveStart.onMove.onMoveEnd.noPanClassName.nodeOrigin.autoPanOnConnect.autoPanOnNodeDrag.onError.connectionRadius.isValidConnection.selectNodesOnDrag.nodeDragThreshold.onBeforeDelete.debug.autoPanSpeed.paneClickDistance`.split(`.`),`rfId`],AS=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setPaneClickDistance:e.setPaneClickDistance}),jS={translateExtent:yy,nodeOrigin:DS,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:`nopan`,rfId:`1`,paneClickDistance:0};function MS(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:s,setDefaultNodesAndEdges:c,setPaneClickDistance:l}=cS(AS,iS),u=lS();(0,v.useEffect)(()=>(c(e.defaultNodes,e.defaultEdges),()=>{d.current=jS,s()}),[]);let d=(0,v.useRef)(jS);return(0,v.useEffect)(()=>{for(let s of kS){let c=e[s];c!==d.current[s]&&e[s]!==void 0&&(s===`nodes`?t(c):s===`edges`?n(c):s===`minZoom`?r(c):s===`maxZoom`?i(c):s===`translateExtent`?a(c):s===`nodeExtent`?o(c):s===`paneClickDistance`?l(c):s===`fitView`?u.setState({fitViewOnInit:c}):s===`fitViewOptions`?u.setState({fitViewOnInitOptions:c}):u.setState({[s]:c}))}d.current=e},kS.map(t=>e[t])),null}function NS(){return typeof window>`u`||!window.matchMedia?null:window.matchMedia(`(prefers-color-scheme: dark)`)}function PS(e){let[t,n]=(0,v.useState)(e===`system`?null:e);return(0,v.useEffect)(()=>{if(e!==`system`){n(e);return}let t=NS(),r=()=>n(t?.matches?`dark`:`light`);return r(),t?.addEventListener(`change`,r),()=>{t?.removeEventListener(`change`,r)}},[e]),t===null?NS()?.matches?`dark`:`light`:t}var FS=typeof document<`u`?document:null;function IS(e=null,t={target:FS,actInsideInputWithModifier:!0}){let[n,r]=(0,v.useState)(!1),i=(0,v.useRef)(!1),a=(0,v.useRef)(new Set([])),[o,s]=(0,v.useMemo)(()=>{if(e!==null){let t=(Array.isArray(e)?e:[e]).filter(e=>typeof e==`string`).map(e=>e.replace(`+`,`
|
|
40
|
+
`).replace(`
|
|
41
|
+
|
|
42
|
+
`,`
|
|
43
|
+
+`).split(`
|
|
44
|
+
`));return[t,t.reduce((e,t)=>e.concat(...t),[])]}return[[],[]]},[e]);return(0,v.useEffect)(()=>{let n=t?.target||FS;if(e!==null){let e=e=>{if(i.current=e.ctrlKey||e.metaKey||e.shiftKey,(!i.current||i.current&&!t.actInsideInputWithModifier)&&gb(e))return!1;let n=RS(e.code,s);a.current.add(e[n]),LS(o,a.current,!1)&&(e.preventDefault(),r(!0))},c=e=>{if((!i.current||i.current&&!t.actInsideInputWithModifier)&&gb(e))return!1;let n=RS(e.code,s);LS(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(e[n]),e.key===`Meta`&&a.current.clear(),i.current=!1},l=()=>{a.current.clear(),r(!1)};return n?.addEventListener(`keydown`,e),n?.addEventListener(`keyup`,c),window.addEventListener(`blur`,l),window.addEventListener(`contextmenu`,l),()=>{n?.removeEventListener(`keydown`,e),n?.removeEventListener(`keyup`,c),window.removeEventListener(`blur`,l),window.removeEventListener(`contextmenu`,l)}}},[e,r]),n}function LS(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function RS(e,t){return t.includes(e)?`code`:`key`}var zS=()=>{let e=lS();return(0,v.useMemo)(()=>({zoomIn:t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomOut:t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{let{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{let{transform:[r,i,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??a},{duration:n?.duration}),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{let[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},fitView:t=>{let{nodeLookup:n,minZoom:r,maxZoom:i,panZoom:a,domNode:o}=e.getState();if(!a||!o)return Promise.resolve(!1);let s=Ry(n,t),{width:c,height:l}=pb(o);return zy({nodes:s,width:c,height:l,minZoom:r,maxZoom:i,panZoom:a},t)},setCenter:async(t,n,r)=>{let{width:i,height:a,maxZoom:o,panZoom:s}=e.getState(),c=r?.zoom===void 0?o:r.zoom,l=i/2-t*c,u=a/2-n*c;return s?(await s.setViewport({x:l,y:u,zoom:c},{duration:r?.duration}),Promise.resolve(!0)):Promise.resolve(!1)},fitBounds:async(t,n)=>{let{width:r,height:i,minZoom:a,maxZoom:o,panZoom:s}=e.getState(),c=ob(t,r,i,a,o,n?.padding??.1);return s?(await s.setViewport(c,{duration:n?.duration}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={snapToGrid:!0})=>{let{transform:r,snapGrid:i,domNode:a}=e.getState();if(!a)return t;let{x:o,y:s}=a.getBoundingClientRect();return ib({x:t.x-o,y:t.y-s},r,n.snapToGrid,i)},flowToScreenPosition:t=>{let{transform:n,domNode:r}=e.getState();if(!r)return t;let{x:i,y:a}=r.getBoundingClientRect(),o=ab(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function BS(e,t){let n=[],r=new Map,i=[];for(let t of e)if(t.type===`add`){i.push(t);continue}else if(t.type===`remove`||t.type===`replace`)r.set(t.id,[t]);else{let e=r.get(t.id);e?e.push(t):r.set(t.id,[t])}for(let e of t){let t=r.get(e.id);if(!t){n.push(e);continue}if(t[0].type===`remove`)continue;if(t[0].type===`replace`){n.push({...t[0].item});continue}let i={...e};for(let e of t)VS(e,i);n.push(i)}return i.length&&i.forEach(e=>{e.index===void 0?n.push({...e.item}):n.splice(e.index,0,{...e.item})}),n}function VS(e,t){switch(e.type){case`select`:t.selected=e.selected;break;case`position`:e.position!==void 0&&(t.position=e.position),e.dragging!==void 0&&(t.dragging=e.dragging);break;case`dimensions`:e.dimensions!==void 0&&(t.measured??={},t.measured.width=e.dimensions.width,t.measured.height=e.dimensions.height,e.setAttributes&&(t.width=e.dimensions.width,t.height=e.dimensions.height)),typeof e.resizing==`boolean`&&(t.resizing=e.resizing)}}function HS(e,t){return BS(e,t)}function US(e,t){return BS(e,t)}function WS(e,t){return{id:e,type:`select`,selected:t}}function GS(e,t=new Set,n=!1){let r=[];for(let[i,a]of e){let e=t.has(i);(a.selected!==void 0||e)&&a.selected!==e&&(n&&(a.selected=e),r.push(WS(a.id,e)))}return r}function KS({items:e=[],lookup:t}){let n=[],r=new Map(e.map(e=>[e.id,e]));for(let[r,i]of e.entries()){let e=t.get(i.id),a=e?.internals?.userNode??e;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:`replace`}),a===void 0&&n.push({item:i,type:`add`,index:r})}for(let[e]of t)r.get(e)===void 0&&n.push({id:e,type:`remove`});return n}function qS(e){return{id:e.id,type:`remove`}}var JS=e=>jy(e),YS=e=>Ay(e);function XS(e){return(0,v.forwardRef)(e)}var ZS=typeof window<`u`?v.useLayoutEffect:v.useEffect;function QS(e){let[t,n]=(0,v.useState)(BigInt(0)),[r]=(0,v.useState)(()=>$S(()=>n(e=>e+BigInt(1))));return ZS(()=>{let t=r.get();t.length&&(e(t),r.reset())},[t]),r}function $S(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}var eC=(0,v.createContext)(null);function tC({children:e}){let t=lS(),n=QS((0,v.useCallback)(e=>{let{nodes:n=[],setNodes:r,hasDefaultNodes:i,onNodesChange:a,nodeLookup:o}=t.getState(),s=n;for(let t of e)s=typeof t==`function`?t(s):t;i?r(s):a&&a(KS({items:s,lookup:o}))},[])),r=QS((0,v.useCallback)(e=>{let{edges:n=[],setEdges:r,hasDefaultEdges:i,onEdgesChange:a,edgeLookup:o}=t.getState(),s=n;for(let t of e)s=typeof t==`function`?t(s):t;i?r(s):a&&a(KS({items:s,lookup:o}))},[])),i=(0,v.useMemo)(()=>({nodeQueue:n,edgeQueue:r}),[]);return(0,j.jsx)(eC.Provider,{value:i,children:e})}function nC(){let e=(0,v.useContext)(eC);if(!e)throw Error(`useBatchContext must be used within a BatchProvider`);return e}var rC=e=>!!e.panZoom;function iC(){let e=zS(),t=lS(),n=nC(),r=cS(rC),i=(0,v.useMemo)(()=>{let e=e=>t.getState().nodeLookup.get(e),r=e=>{n.nodeQueue.push(e)},i=e=>{n.edgeQueue.push(e)},a=e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState(),i=JS(e)?e:n.get(e.id),a=i.parentId?db(i.position,i.measured,i.parentId,n,r):i.position;return Xy({...i,position:a,width:i.measured?.width??i.width,height:i.measured?.height??i.height})},o=(e,t,n={replace:!1})=>{r(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&JS(e)?e:{...r,...e}}return r}))},s=(e,t,n={replace:!1})=>{i(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&YS(e)?e:{...r,...e}}return r}))};return{getNodes:()=>t.getState().nodes.map(e=>({...e})),getNode:t=>e(t)?.internals.userNode,getInternalNode:e,getEdges:()=>{let{edges:e=[]}=t.getState();return e.map(e=>({...e}))},getEdge:e=>t.getState().edgeLookup.get(e),setNodes:r,setEdges:i,addNodes:e=>{let t=Array.isArray(e)?e:[e];n.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{let t=Array.isArray(e)?e:[e];n.edgeQueue.push(e=>[...e,...t])},toObject:()=>{let{nodes:e=[],edges:n=[],transform:r}=t.getState(),[i,a,o]=r;return{nodes:e.map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:i,y:a,zoom:o}}},deleteElements:async({nodes:e=[],edges:n=[]})=>{let{nodes:r,edges:i,onNodesDelete:a,onEdgesDelete:o,triggerNodeChanges:s,triggerEdgeChanges:c,onDelete:l,onBeforeDelete:u}=t.getState(),{nodes:d,edges:f}=await Vy({nodesToRemove:e,edgesToRemove:n,nodes:r,edges:i,onBeforeDelete:u}),p=f.length>0,m=d.length>0;if(p){let e=f.map(qS);o?.(f),c(e)}if(m){let e=d.map(qS);a?.(d),s(e)}return(m||p)&&l?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,r)=>{let i=eb(e),o=i?e:a(e),s=r!==void 0;return o?(r||t.getState().nodes).filter(r=>{let a=t.getState().nodeLookup.get(r.id);if(a&&!i&&(r.id===e.id||!a.internals.positionAbsolute))return!1;let c=$y(Xy(s?r:a),o);return n&&c>0||c>=o.width*o.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{let r=eb(e)?e:a(e);if(!r)return!1;let i=$y(r,t);return n&&i>0||i>=r.width*r.height},updateNode:o,updateNodeData:(e,t,n={replace:!1})=>{o(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},updateEdge:s,updateEdgeData:(e,t,n={replace:!1})=>{s(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},getNodesBounds:e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState();return Py(e,{nodeLookup:n,nodeOrigin:r})},getHandleConnections:({type:e,id:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}-${e}-${n??null}`)?.values()??[])}},[]);return(0,v.useMemo)(()=>({...i,...e,viewportInitialized:r}),[r])}var aC=e=>e.selected,oC={actInsideInputWithModifier:!1},sC=typeof window<`u`?window:void 0;function cC({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=lS(),{deleteElements:r}=iC(),i=IS(e,oC),a=IS(t,{target:sC});(0,v.useEffect)(()=>{if(i){let{edges:e,nodes:t}=n.getState();r({nodes:t.filter(aC),edges:e.filter(aC)}),n.setState({nodesSelectionActive:!1})}},[i]),(0,v.useEffect)(()=>{n.setState({multiSelectionActive:a})},[a])}function lC(e){let t=lS();(0,v.useEffect)(()=>{let n=()=>{if(!e.current)return!1;let n=pb(e.current);(n.height===0||n.width===0)&&t.getState().onError?.(`004`,vy.error004()),t.setState({width:n.width||500,height:n.height||500})};if(e.current){n(),window.addEventListener(`resize`,n);let t=new ResizeObserver(()=>n());return t.observe(e.current),()=>{window.removeEventListener(`resize`,n),t&&e.current&&t.unobserve(e.current)}}},[])}var uC={position:`absolute`,width:`100%`,height:`100%`,top:0,left:0},dC=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function fC({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:a=Sy.Free,zoomOnDoubleClick:o=!0,panOnDrag:s=!0,defaultViewport:c,translateExtent:l,minZoom:u,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:p=!0,children:m,noWheelClassName:h,noPanClassName:g,onViewportChange:_,isControlledViewport:y,paneClickDistance:b}){let x=lS(),S=(0,v.useRef)(null),{userSelectionActive:C,lib:w}=cS(dC,iS),T=IS(f),E=(0,v.useRef)();lC(S);let D=(0,v.useCallback)(e=>{_?.({x:e[0],y:e[1],zoom:e[2]}),y||x.setState({transform:e})},[_,y]);return(0,v.useEffect)(()=>{if(S.current){E.current=Mx({domNode:S.current,minZoom:u,maxZoom:d,translateExtent:l,viewport:c,paneClickDistance:b,onDraggingChange:e=>x.setState({paneDragging:e}),onPanZoomStart:(e,t)=>{let{onViewportChangeStart:n,onMoveStart:r}=x.getState();r?.(e,t),n?.(t)},onPanZoom:(e,t)=>{let{onViewportChange:n,onMove:r}=x.getState();r?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{let{onViewportChangeEnd:n,onMoveEnd:r}=x.getState();r?.(e,t),n?.(t)}});let{x:e,y:t,zoom:n}=E.current.getViewport();return x.setState({panZoom:E.current,transform:[e,t,n],domNode:S.current.closest(`.react-flow`)}),()=>{E.current?.destroy()}}},[]),(0,v.useEffect)(()=>{E.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:a,zoomOnDoubleClick:o,panOnDrag:s,zoomActivationKeyPressed:T,preventScrolling:p,noPanClassName:g,userSelectionActive:C,noWheelClassName:h,lib:w,onTransformChange:D})},[e,t,n,r,i,a,o,s,T,p,g,C,h,w,D]),(0,j.jsx)(`div`,{className:`react-flow__renderer`,ref:S,style:uC,children:m})}var pC=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function mC(){let{userSelectionActive:e,userSelectionRect:t}=cS(pC,iS);return e&&t?(0,j.jsx)(`div`,{className:`react-flow__selection react-flow__container`,style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}var hC=(e,t)=>n=>{n.target===t.current&&e?.(n)},gC=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging});function _C({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Cy.Full,panOnDrag:r,selectionOnDrag:i,onSelectionStart:a,onSelectionEnd:o,onPaneClick:s,onPaneContextMenu:c,onPaneScroll:l,onPaneMouseEnter:u,onPaneMouseMove:d,onPaneMouseLeave:f,children:p}){let m=(0,v.useRef)(null),h=lS(),g=(0,v.useRef)(0),_=(0,v.useRef)(0),y=(0,v.useRef)(),b=(0,v.useRef)(new Map),{userSelectionActive:x,elementsSelectable:S,dragging:C}=cS(gC,iS),w=S&&(e||x),T=(0,v.useRef)(!1),E=(0,v.useRef)(!1),D=()=>{h.setState({userSelectionActive:!1,userSelectionRect:null}),g.current=0,_.current=0},ee=e=>{T.current?T.current=!1:(s?.(e),h.getState().resetSelectedElements(),h.setState({nodesSelectionActive:!1}))},te=e=>{Array.isArray(r)&&r?.includes(2)?e.preventDefault():c?.(e)},ne=l?e=>l(e):void 0,O=t=>{let{resetSelectedElements:n,domNode:r,edgeLookup:i}=h.getState();if(y.current=r?.getBoundingClientRect(),!S||!e||t.button!==0||t.target!==m.current||!y.current)return;t.target?.setPointerCapture?.(t.pointerId),E.current=!0,T.current=!1,b.current=new Map;for(let[e,t]of i)b.current.set(t.source,b.current.get(t.source)?.add(e)||new Set([e])),b.current.set(t.target,b.current.get(t.target)?.add(e)||new Set([e]));let{x:o,y:s}=vb(t.nativeEvent,y.current);n(),h.setState({userSelectionRect:{width:0,height:0,startX:o,startY:s,x:o,y:s}}),a?.(t)},re=e=>{let{userSelectionRect:t,edgeLookup:r,transform:i,nodeLookup:a,triggerNodeChanges:o,triggerEdgeChanges:s}=h.getState();if(!y.current||!t)return;T.current=!0;let{x:c,y:l}=vb(e.nativeEvent,y.current),{startX:u,startY:d}=t,f={startX:u,startY:d,x:c<u?c:u,y:l<d?l:d,width:Math.abs(c-u),height:Math.abs(l-d)},p=Iy(a,f,i,n===Cy.Partial,!0),m=new Set,v=new Set;for(let e of p){v.add(e.id);let t=b.current.get(e.id);if(t)for(let e of t)m.add(e)}g.current!==v.size&&(g.current=v.size,o(GS(a,v,!0))),_.current!==m.size&&(_.current=m.size,s(GS(r,m))),h.setState({userSelectionRect:f,userSelectionActive:!0,nodesSelectionActive:!1})},k=e=>{if(e.button!==0||!E.current)return;e.target?.releasePointerCapture?.(e.pointerId);let{userSelectionRect:n}=h.getState();!x&&n&&e.target===m.current&&ee?.(e),g.current>0&&h.setState({nodesSelectionActive:!0}),D(),o?.(e),(t||i)&&(T.current=!1),E.current=!1},A=r===!0||Array.isArray(r)&&r.includes(0);return(0,j.jsxs)(`div`,{className:Vp([`react-flow__pane`,{draggable:A,dragging:C,selection:e}]),onClick:w?void 0:hC(ee,m),onContextMenu:hC(te,m),onWheel:hC(ne,m),onPointerEnter:w?void 0:u,onPointerDown:w?O:d,onPointerMove:w?re:d,onPointerUp:w?k:void 0,onPointerLeave:f,ref:m,style:uC,children:[p,(0,j.jsx)(mC,{})]})}function vC({id:e,store:t,unselect:n=!1,nodeRef:r}){let{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:s,onError:c}=t.getState(),l=s.get(e);l?(t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&o)&&(a({nodes:[l],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):i([e])):c?.(`012`,vy.error012(e))}function yC({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){let s=lS(),[c,l]=(0,v.useState)(!1),u=(0,v.useRef)();return(0,v.useEffect)(()=>{u.current=sx({getStoreItems:()=>s.getState(),onNodeMouseDown:t=>{vC({id:t,store:s,nodeRef:e})},onDragStart:()=>{l(!0)},onDragStop:()=>{l(!1)}})},[]),(0,v.useEffect)(()=>{if(t)u.current?.destroy();else if(e.current)return u.current?.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o}),()=>{u.current?.destroy()}},[n,r,t,a,e,i]),c}var bC=e=>t=>t.selected&&(t.draggable||e&&t.draggable===void 0);function xC(){let e=lS();return(0,v.useCallback)(t=>{let{nodeExtent:n,snapToGrid:r,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:s,nodeLookup:c,nodeOrigin:l}=e.getState(),u=new Map,d=bC(a),f=r?i[0]:5,p=r?i[1]:5,m=t.direction.x*f*t.factor,h=t.direction.y*p*t.factor;for(let[,e]of c){if(!d(e))continue;let t={x:e.internals.positionAbsolute.x+m,y:e.internals.positionAbsolute.y+h};r&&(t=rb(t,i));let{position:a,positionAbsolute:s}=By({nodeId:e.id,nextPosition:t,nodeLookup:c,nodeExtent:n,nodeOrigin:l,onError:o});e.position=a,e.internals.positionAbsolute=s,u.set(e.id,e)}s(u)},[])}var SC=(0,v.createContext)(null),CC=SC.Provider;SC.Consumer;var wC=()=>(0,v.useContext)(SC),TC=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),EC=(e,t,n)=>r=>{let{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:s,toHandle:c,isValid:l}=o,u=c?.nodeId===e&&c?.id===t&&c?.type===n;return{connectingFrom:s?.nodeId===e&&s?.id===t&&s?.type===n,connectingTo:u,clickConnecting:i?.nodeId===e&&i?.id===t&&i?.type===n,isPossibleEndHandle:a===xy.Strict?s?.type!==n:e!==s?.nodeId||t!==s?.id,connectionInProcess:!!s,valid:u&&l}};function DC({type:e=`source`,position:t=Dy.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:o,onConnect:s,children:c,className:l,onMouseDown:u,onTouchStart:d,...f},p){let m=o||null,h=e===`target`,g=lS(),_=wC(),{connectOnClick:v,noPanClassName:y,rfId:b}=cS(TC,iS),{connectingFrom:x,connectingTo:S,clickConnecting:C,isPossibleEndHandle:w,connectionInProcess:T,valid:E}=cS(EC(_,m,e),iS);_||g.getState().onError?.(`010`,vy.error010());let D=e=>{let{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=g.getState(),i={...t,...e};if(r){let{edges:e,setEdges:t}=g.getState();t(kb(i,e))}n?.(i),s?.(i)},ee=e=>{if(!_)return;let t=_b(e.nativeEvent);if(i&&(t&&e.button===0||!t)){let t=g.getState();_x.onPointerDown(e.nativeEvent,{autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:h,handleId:m,nodeId:_,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:t.onConnectEnd,updateConnection:t.updateConnection,onConnect:D,isValidConnection:n||t.isValidConnection,getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed})}t?u?.(e):d?.(e)};return(0,j.jsx)(`div`,{"data-handleid":m,"data-nodeid":_,"data-handlepos":t,"data-id":`${b}-${_}-${m}-${e}`,className:Vp([`react-flow__handle`,`react-flow__handle-${t}`,`nodrag`,y,l,{source:!h,target:h,connectable:r,connectablestart:i,connectableend:a,clickconnecting:C,connectingfrom:x,connectingto:S,valid:E,connectionindicator:r&&(!T||w)&&(T?a:i)}]),onMouseDown:ee,onTouchStart:ee,onClick:v?t=>{let{onClickConnectStart:r,onClickConnectEnd:a,connectionClickStartHandle:o,connectionMode:s,isValidConnection:c,lib:l,rfId:u,nodeLookup:d,connection:f}=g.getState();if(!_||!o&&!i)return;if(!o){r?.(t.nativeEvent,{nodeId:_,handleId:m,handleType:e}),g.setState({connectionClickStartHandle:{nodeId:_,type:e,id:m}});return}let p=mb(t.target),h=n||c,{connection:v,isValid:y}=_x.isValid(t.nativeEvent,{handle:{nodeId:_,id:m,type:e},connectionMode:s,fromNodeId:o.nodeId,fromHandleId:o.id||null,fromType:o.type,isValidConnection:h,flowId:u,doc:p,lib:l,nodeLookup:d});y&&v&&D(v);let b=structuredClone(f);delete b.inProgress,b.toPosition=b.toHandle?b.toHandle.position:null,a?.(t,b),g.setState({connectionClickStartHandle:null})}:void 0,ref:p,...f,children:c})}var OC=(0,v.memo)(XS(DC));function kC({data:e,isConnectable:t,sourcePosition:n=Dy.Bottom}){return(0,j.jsxs)(j.Fragment,{children:[e?.label,(0,j.jsx)(OC,{type:`source`,position:n,isConnectable:t})]})}function AC({data:e,isConnectable:t,targetPosition:n=Dy.Top,sourcePosition:r=Dy.Bottom}){return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(OC,{type:`target`,position:n,isConnectable:t}),e?.label,(0,j.jsx)(OC,{type:`source`,position:r,isConnectable:t})]})}function jC(){return null}function MC({data:e,isConnectable:t,targetPosition:n=Dy.Top}){return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(OC,{type:`target`,position:n,isConnectable:t}),e?.label]})}var NC={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},PC={input:kC,default:AC,output:MC,group:jC};function FC(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}var IC=e=>{let{width:t,height:n,x:r,y:i}=Fy(e.nodeLookup,{filter:e=>!!e.selected});return{width:tb(t)?t:null,height:tb(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function LC({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=lS(),{width:i,height:a,transformString:o,userSelectionActive:s}=cS(IC,iS),c=xC(),l=(0,v.useRef)(null);if((0,v.useEffect)(()=>{n||l.current?.focus({preventScroll:!0})},[n]),yC({nodeRef:l}),s||!i||!a)return null;let u=e?t=>{e(t,r.getState().nodes.filter(e=>e.selected))}:void 0;return(0,j.jsx)(`div`,{className:Vp([`react-flow__nodesselection`,`react-flow__container`,t]),style:{transform:o},children:(0,j.jsx)(`div`,{ref:l,className:`react-flow__nodesselection-rect`,onContextMenu:u,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(NC,e.key)&&(e.preventDefault(),c({direction:NC[e.key],factor:e.shiftKey?4:1}))},style:{width:i,height:a}})})}var RC=typeof window<`u`?window:void 0,zC=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function BC({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:s,deleteKeyCode:c,selectionKeyCode:l,selectionOnDrag:u,selectionMode:d,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:h,zoomActivationKeyCode:g,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:b,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:w,defaultViewport:T,translateExtent:E,minZoom:D,maxZoom:ee,preventScrolling:te,onSelectionContextMenu:ne,noWheelClassName:O,noPanClassName:re,disableKeyboardA11y:k,onViewportChange:A,isControlledViewport:ie}){let{nodesSelectionActive:ae,userSelectionActive:oe}=cS(zC),se=IS(l,{target:RC}),ce=IS(h,{target:RC}),M=ce||w,le=ce||b,ue=u&&M!==!0,de=se||oe||ue;return cC({deleteKeyCode:c,multiSelectionKeyCode:m}),(0,j.jsx)(fC,{onPaneContextMenu:a,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:le,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:!se&&M,defaultViewport:T,translateExtent:E,minZoom:D,maxZoom:ee,zoomActivationKeyCode:g,preventScrolling:te,noWheelClassName:O,noPanClassName:re,onViewportChange:A,isControlledViewport:ie,paneClickDistance:s,children:(0,j.jsxs)(_C,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:M,isSelecting:!!de,selectionMode:d,selectionKeyPressed:se,selectionOnDrag:ue,children:[e,ae&&(0,j.jsx)(LC,{onSelectionContextMenu:ne,noPanClassName:re,disableKeyboardA11y:k})]})})}BC.displayName=`FlowRenderer`;var VC=(0,v.memo)(BC),HC=e=>t=>e?Iy(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(e=>e.id):Array.from(t.nodeLookup.keys());function UC(e){return cS((0,v.useCallback)(HC(e),[e]),iS)}var WC=e=>e.updateNodeInternals;function GC(){let e=cS(WC),[t]=(0,v.useState)(()=>typeof ResizeObserver>`u`?null:new ResizeObserver(t=>{let n=new Map;t.forEach(e=>{let t=e.target.getAttribute(`data-id`);n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return(0,v.useEffect)(()=>()=>{t?.disconnect()},[t]),t}function KC({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let i=lS(),a=(0,v.useRef)(null),o=(0,v.useRef)(null),s=(0,v.useRef)(e.sourcePosition),c=(0,v.useRef)(e.targetPosition),l=(0,v.useRef)(t),u=n&&!!e.internals.handleBounds;return(0,v.useEffect)(()=>{a.current&&!e.hidden&&(!u||o.current!==a.current)&&(o.current&&r?.unobserve(o.current),r?.observe(a.current),o.current=a.current)},[u,e.hidden]),(0,v.useEffect)(()=>()=>{o.current&&=(r?.unobserve(o.current),null)},[]),(0,v.useEffect)(()=>{if(a.current){let n=l.current!==t,r=s.current!==e.sourcePosition,o=c.current!==e.targetPosition;(n||r||o)&&(l.current=t,s.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function qC({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:s,elementsSelectable:c,nodesConnectable:l,nodesFocusable:u,resizeObserver:d,noDragClassName:f,noPanClassName:p,disableKeyboardA11y:m,rfId:h,nodeTypes:g,nodeExtent:_,nodeClickDistance:v,onError:y}){let{node:b,internals:x,isParent:S}=cS(t=>{let n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},iS),C=b.type||`default`,w=g?.[C]||PC[C];w===void 0&&(y?.(`003`,vy.error003(C)),C=`default`,w=PC.default);let T=!!(b.draggable||s&&b.draggable===void 0),E=!!(b.selectable||c&&b.selectable===void 0),D=!!(b.connectable||l&&b.connectable===void 0),ee=!!(b.focusable||u&&b.focusable===void 0),te=lS(),ne=ub(b),O=KC({node:b,nodeType:C,hasDimensions:ne,resizeObserver:d}),re=yC({nodeRef:O,disabled:b.hidden||!T,noDragClassName:f,handleSelector:b.dragHandle,nodeId:e,isSelectable:E,nodeClickDistance:v}),k=xC();if(b.hidden)return null;let A=lb(b),ie=FC(b),ae=E||T||t||n||r||i,oe=n?e=>n(e,{...x.userNode}):void 0,se=r?e=>r(e,{...x.userNode}):void 0,ce=i?e=>i(e,{...x.userNode}):void 0,M=a?e=>a(e,{...x.userNode}):void 0,le=o?e=>o(e,{...x.userNode}):void 0,ue=n=>{let{selectNodesOnDrag:r,nodeDragThreshold:i}=te.getState();E&&(!r||!T||i>0)&&vC({id:e,store:te,nodeRef:O}),t&&t(n,{...x.userNode})},de=t=>{if(!(gb(t.nativeEvent)||m)){if(by.includes(t.key)&&E){let n=t.key===`Escape`;vC({id:e,store:te,unselect:n,nodeRef:O})}else T&&b.selected&&Object.prototype.hasOwnProperty.call(NC,t.key)&&(t.preventDefault(),te.setState({ariaLiveMessage:`Moved selected node ${t.key.replace(`Arrow`,``).toLowerCase()}. New position, x: ${~~x.positionAbsolute.x}, y: ${~~x.positionAbsolute.y}`}),k({direction:NC[t.key],factor:t.shiftKey?4:1}))}};return(0,j.jsx)(`div`,{className:Vp([`react-flow__node`,`react-flow__node-${C}`,{[p]:T},b.className,{selected:b.selected,selectable:E,parent:S,draggable:T,dragging:re}]),ref:O,style:{zIndex:x.z,transform:`translate(${x.positionAbsolute.x}px,${x.positionAbsolute.y}px)`,pointerEvents:ae?`all`:`none`,visibility:ne?`visible`:`hidden`,...b.style,...ie},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:oe,onMouseMove:se,onMouseLeave:ce,onContextMenu:M,onClick:ue,onDoubleClick:le,onKeyDown:ee?de:void 0,tabIndex:ee?0:void 0,role:ee?`button`:void 0,"aria-describedby":m?void 0:`${fS}-${h}`,"aria-label":b.ariaLabel,children:(0,j.jsx)(CC,{value:e,children:(0,j.jsx)(w,{id:e,data:b.data,type:C,positionAbsoluteX:x.positionAbsolute.x,positionAbsoluteY:x.positionAbsolute.y,selected:b.selected,selectable:E,draggable:T,deletable:b.deletable??!0,isConnectable:D,sourcePosition:b.sourcePosition,targetPosition:b.targetPosition,dragging:re,dragHandle:b.dragHandle,zIndex:x.z,parentId:b.parentId,...A})})})}var JC=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function YC(e){let{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:a}=cS(JC,iS),o=UC(e.onlyRenderVisibleElements),s=GC();return(0,j.jsx)(`div`,{className:`react-flow__nodes`,style:uC,children:o.map(o=>(0,j.jsx)(qC,{id:o,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:s,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:a},o))})}YC.displayName=`NodeRenderer`;var XC=(0,v.memo)(YC);function ZC(e){return cS((0,v.useCallback)(t=>{if(!e)return t.edges.map(e=>e.id);let n=[];if(t.width&&t.height)for(let e of t.edges){let r=t.nodeLookup.get(e.source),i=t.nodeLookup.get(e.target);r&&i&&Eb({sourceNode:r,targetNode:i,width:t.width,height:t.height,transform:t.transform})&&n.push(e.id)}return n},[e]),iS)}var QC=({color:e=`none`,strokeWidth:t=1})=>(0,j.jsx)(`polyline`,{style:{stroke:e,strokeWidth:t},strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`,points:`-5,-4 0,0 -5,4`}),$C=({color:e=`none`,strokeWidth:t=1})=>(0,j.jsx)(`polyline`,{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:`round`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4 -5,-4`}),ew={[Ey.Arrow]:QC,[Ey.ArrowClosed]:$C};function tw(e){let t=lS();return(0,v.useMemo)(()=>Object.prototype.hasOwnProperty.call(ew,e)?ew[e]:(t.getState().onError?.(`009`,vy.error009(e)),null),[e])}var nw=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:a=`strokeWidth`,strokeWidth:o,orient:s=`auto-start-reverse`})=>{let c=tw(t);return c?(0,j.jsx)(`marker`,{className:`react-flow__arrowhead`,id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:`-10 -10 20 20`,markerUnits:a,orient:s,refX:`0`,refY:`0`,children:(0,j.jsx)(c,{color:n,strokeWidth:o})}):null},rw=({defaultColor:e,rfId:t})=>{let n=cS(e=>e.edges),r=cS(e=>e.defaultEdgeOptions),i=(0,v.useMemo)(()=>Ub(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return i.length?(0,j.jsx)(`svg`,{className:`react-flow__marker`,children:(0,j.jsx)(`defs`,{children:i.map(e=>(0,j.jsx)(nw,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};rw.displayName=`MarkerDefinitions`;var iw=(0,v.memo)(rw);function aw({x:e,y:t,label:n,labelStyle:r={},labelShowBg:i=!0,labelBgStyle:a={},labelBgPadding:o=[2,4],labelBgBorderRadius:s=2,children:c,className:l,...u}){let[d,f]=(0,v.useState)({x:1,y:0,width:0,height:0}),p=Vp([`react-flow__edge-textwrapper`,l]),m=(0,v.useRef)(null);return(0,v.useEffect)(()=>{if(m.current){let e=m.current.getBBox();f({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n===void 0||!n?null:(0,j.jsxs)(`g`,{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?`visible`:`hidden`,...u,children:[i&&(0,j.jsx)(`rect`,{width:d.width+2*o[0],x:-o[0],y:-o[1],height:d.height+2*o[1],className:`react-flow__edge-textbg`,style:a,rx:s,ry:s}),(0,j.jsx)(`text`,{className:`react-flow__edge-text`,y:d.height/2,dy:`0.3em`,ref:m,style:r,children:n}),c]})}aw.displayName=`EdgeText`;var ow=(0,v.memo)(aw);function sw({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c,interactionWidth:l=20,...u}){return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`path`,{...u,d:e,fill:`none`,className:Vp([`react-flow__edge-path`,u.className])}),l&&(0,j.jsx)(`path`,{d:e,fill:`none`,strokeOpacity:0,strokeWidth:l,className:`react-flow__edge-interaction`}),r&&tb(t)&&tb(n)?(0,j.jsx)(ow,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c}):null]})}function cw({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===Dy.Left||e===Dy.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function lw({sourceX:e,sourceY:t,sourcePosition:n=Dy.Bottom,targetX:r,targetY:i,targetPosition:a=Dy.Top}){let[o,s]=cw({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,l]=cw({pos:a,x1:r,y1:i,x2:e,y2:t}),[u,d,f,p]=bb({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:s,targetControlX:c,targetControlY:l});return[`M${e},${t} C${o},${s} ${c},${l} ${r},${i}`,u,d,f,p]}function uw(e){return(0,v.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=Dy.Bottom,targetPosition:s=Dy.Top,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})=>{let[v,y,b]=lw({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s}),x=e.isInternal?void 0:t;return(0,j.jsx)(sw,{id:x,path:v,labelX:y,labelY:b,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})})}var dw=uw({isInternal:!1}),fw=uw({isInternal:!0});dw.displayName=`SimpleBezierEdge`,fw.displayName=`SimpleBezierEdgeInternal`;function pw(e){return(0,v.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,sourcePosition:p=Dy.Bottom,targetPosition:m=Dy.Top,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=Ib({sourceX:n,sourceY:r,sourcePosition:p,targetX:i,targetY:a,targetPosition:m,borderRadius:_?.borderRadius,offset:_?.offset}),S=e.isInternal?void 0:t;return(0,j.jsx)(sw,{id:S,path:y,labelX:b,labelY:x,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:g,interactionWidth:v})})}var mw=pw({isInternal:!1}),hw=pw({isInternal:!0});mw.displayName=`SmoothStepEdge`,hw.displayName=`SmoothStepEdgeInternal`;function gw(e){return(0,v.memo)(({id:t,...n})=>{let r=e.isInternal?void 0:t;return(0,j.jsx)(mw,{...n,id:r,pathOptions:(0,v.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}var _w=gw({isInternal:!1}),vw=gw({isInternal:!0});_w.displayName=`StepEdge`,vw.displayName=`StepEdgeInternal`;function yw(e){return(0,v.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})=>{let[g,_,v]=Ab({sourceX:n,sourceY:r,targetX:i,targetY:a}),y=e.isInternal?void 0:t;return(0,j.jsx)(sw,{id:y,path:g,labelX:_,labelY:v,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})})}var bw=yw({isInternal:!1}),xw=yw({isInternal:!0});bw.displayName=`StraightEdge`,xw.displayName=`StraightEdgeInternal`;function Sw(e){return(0,v.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=Dy.Bottom,targetPosition:s=Dy.Top,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=Cb({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s,curvature:_?.curvature}),S=e.isInternal?void 0:t;return(0,j.jsx)(sw,{id:S,path:y,labelX:b,labelY:x,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:v})})}var Cw=Sw({isInternal:!1}),ww=Sw({isInternal:!0});Cw.displayName=`BezierEdge`,ww.displayName=`BezierEdgeInternal`;var Tw={default:ww,straight:xw,step:vw,smoothstep:hw,simplebezier:fw},Ew={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Dw=(e,t,n)=>n===Dy.Left?e-t:n===Dy.Right?e+t:e,Ow=(e,t,n)=>n===Dy.Top?e-t:n===Dy.Bottom?e+t:e,kw=`react-flow__edgeupdater`;function Aw({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:s}){return(0,j.jsx)(`circle`,{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:Vp([kw,`${kw}-${s}`]),cx:Dw(t,r,e),cy:Ow(n,r,e),r,stroke:`transparent`,fill:`transparent`})}function jw({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:c,onReconnect:l,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:p}){let m=lS(),h=(e,t)=>{if(e.button!==0)return;let{autoPanOnConnect:r,domNode:i,isValidConnection:a,connectionMode:o,connectionRadius:s,lib:c,onConnectStart:p,onConnectEnd:h,cancelConnection:g,nodeLookup:_,rfId:v,panBy:y,updateConnection:b}=m.getState(),x=t.type===`target`;f(!0),u?.(e,n,t.type),_x.onPointerDown(e.nativeEvent,{autoPanOnConnect:r,connectionMode:o,connectionRadius:s,domNode:i,handleId:t.id,nodeId:t.nodeId,nodeLookup:_,isTarget:x,edgeUpdaterType:t.type,lib:c,flowId:v,cancelConnection:g,panBy:y,isValidConnection:a,onConnect:e=>l?.(n,e),onConnectStart:p,onConnectEnd:h,onReconnectEnd:(e,r)=>{f(!1),d?.(e,n,t.type,r)},updateConnection:b,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle})},g=e=>h(e,{nodeId:n.target,id:n.targetHandle??null,type:`target`}),_=e=>h(e,{nodeId:n.source,id:n.sourceHandle??null,type:`source`}),v=()=>p(!0),y=()=>p(!1);return(0,j.jsxs)(j.Fragment,{children:[(e===!0||e===`source`)&&(0,j.jsx)(Aw,{position:s,centerX:r,centerY:i,radius:t,onMouseDown:g,onMouseEnter:v,onMouseOut:y,type:`source`}),(e===!0||e===`target`)&&(0,j.jsx)(Aw,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:_,onMouseEnter:v,onMouseOut:y,type:`target`})]})}function Mw({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,rfId:m,edgeTypes:h,noPanClassName:g,onError:_,disableKeyboardA11y:y}){let b=cS(t=>t.edgeLookup.get(e)),x=cS(e=>e.defaultEdgeOptions);b=x?{...x,...b}:b;let S=b.type||`default`,C=h?.[S]||Tw[S];C===void 0&&(_?.(`011`,vy.error011(S)),S=`default`,C=Tw.default);let w=!!(b.focusable||t&&b.focusable===void 0),T=d!==void 0&&(b.reconnectable||n&&b.reconnectable===void 0),E=!!(b.selectable||r&&b.selectable===void 0),D=(0,v.useRef)(null),[ee,te]=(0,v.useState)(!1),[ne,O]=(0,v.useState)(!1),re=lS(),{zIndex:k,sourceX:A,sourceY:ie,targetX:ae,targetY:oe,sourcePosition:se,targetPosition:ce}=cS((0,v.useCallback)(t=>{let n=t.nodeLookup.get(b.source),r=t.nodeLookup.get(b.target);if(!n||!r)return{zIndex:b.zIndex,...Ew};let i=Rb({id:e,sourceNode:n,targetNode:r,sourceHandle:b.sourceHandle||null,targetHandle:b.targetHandle||null,connectionMode:t.connectionMode,onError:_});return{zIndex:Tb({selected:b.selected,zIndex:b.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect}),...i||Ew}},[b.source,b.target,b.sourceHandle,b.targetHandle,b.selected,b.zIndex]),iS),M=(0,v.useMemo)(()=>b.markerStart?`url('#${Hb(b.markerStart,m)}')`:void 0,[b.markerStart,m]),le=(0,v.useMemo)(()=>b.markerEnd?`url('#${Hb(b.markerEnd,m)}')`:void 0,[b.markerEnd,m]);if(b.hidden||A===null||ie===null||ae===null||oe===null)return null;let ue=t=>{let{addSelectedEdges:n,unselectNodesAndEdges:r,multiSelectionActive:a}=re.getState();E&&(re.setState({nodesSelectionActive:!1}),b.selected&&a?(r({nodes:[],edges:[b]}),D.current?.blur()):n([e])),i&&i(t,b)},de=a?e=>{a(e,{...b})}:void 0,fe=o?e=>{o(e,{...b})}:void 0,pe=s?e=>{s(e,{...b})}:void 0,me=c?e=>{c(e,{...b})}:void 0,he=l?e=>{l(e,{...b})}:void 0;return(0,j.jsx)(`svg`,{style:{zIndex:k},children:(0,j.jsxs)(`g`,{className:Vp([`react-flow__edge`,`react-flow__edge-${S}`,b.className,g,{selected:b.selected,animated:b.animated,inactive:!E&&!i,updating:ee,selectable:E}]),onClick:ue,onDoubleClick:de,onContextMenu:fe,onMouseEnter:pe,onMouseMove:me,onMouseLeave:he,onKeyDown:w?t=>{if(!y&&by.includes(t.key)&&E){let{unselectNodesAndEdges:n,addSelectedEdges:r}=re.getState();t.key===`Escape`?(D.current?.blur(),n({edges:[b]})):r([e])}}:void 0,tabIndex:w?0:void 0,role:w?`button`:`img`,"data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":b.ariaLabel===null?void 0:b.ariaLabel||`Edge from ${b.source} to ${b.target}`,"aria-describedby":w?`${pS}-${m}`:void 0,ref:D,children:[!ne&&(0,j.jsx)(C,{id:e,source:b.source,target:b.target,type:b.type,selected:b.selected,animated:b.animated,selectable:E,deletable:b.deletable??!0,label:b.label,labelStyle:b.labelStyle,labelShowBg:b.labelShowBg,labelBgStyle:b.labelBgStyle,labelBgPadding:b.labelBgPadding,labelBgBorderRadius:b.labelBgBorderRadius,sourceX:A,sourceY:ie,targetX:ae,targetY:oe,sourcePosition:se,targetPosition:ce,data:b.data,style:b.style,sourceHandleId:b.sourceHandle,targetHandleId:b.targetHandle,markerStart:M,markerEnd:le,pathOptions:`pathOptions`in b?b.pathOptions:void 0,interactionWidth:b.interactionWidth}),T&&(0,j.jsx)(jw,{edge:b,isReconnectable:T,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,sourceX:A,sourceY:ie,targetX:ae,targetY:oe,sourcePosition:se,targetPosition:ce,setUpdateHover:te,setReconnecting:O})]})})}var Nw=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Pw({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:s,onEdgeMouseMove:c,onEdgeMouseLeave:l,onEdgeClick:u,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:h}){let{edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,onError:y}=cS(Nw,iS),b=ZC(t);return(0,j.jsxs)(`div`,{className:`react-flow__edges`,children:[(0,j.jsx)(iw,{defaultColor:e,rfId:n}),b.map(e=>(0,j.jsx)(Mw,{id:e,edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,onClick:u,reconnectRadius:d,onDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:h},e))]})}Pw.displayName=`EdgeRenderer`;var Fw=(0,v.memo)(Pw),Iw=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Lw({children:e}){let t=cS(Iw);return(0,j.jsx)(`div`,{className:`react-flow__viewport xyflow__viewport react-flow__container`,style:{transform:t},children:e})}function Rw(e){let t=iC(),n=(0,v.useRef)(!1);(0,v.useEffect)(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}var zw=e=>e.panZoom?.syncViewport;function Bw(e){let t=cS(zw),n=lS();return(0,v.useEffect)(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Vw(e){return e.connection.inProgress?{...e.connection,to:ib(e.connection.to,e.transform)}:{...e.connection}}function Hw(e){return e?t=>e(Vw(t)):Vw}function Uw(e){return cS(Hw(e),iS)}var Ww=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Gw({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:i,width:a,height:o,isValid:s,inProgress:c}=cS(Ww,iS);return a&&i&&c?(0,j.jsx)(`svg`,{style:e,width:a,height:o,className:`react-flow__connectionline react-flow__container`,children:(0,j.jsx)(`g`,{className:Vp([`react-flow__connection`,ky(s)]),children:(0,j.jsx)(Kw,{style:t,type:n,CustomComponent:r,isValid:s})})}):null}var Kw=({style:e,type:t=Ty.Bezier,CustomComponent:n,isValid:r})=>{let{inProgress:i,from:a,fromNode:o,fromHandle:s,fromPosition:c,to:l,toNode:u,toHandle:d,toPosition:f}=Uw();if(!i)return;if(n)return(0,j.jsx)(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:s,fromX:a.x,fromY:a.y,toX:l.x,toY:l.y,fromPosition:c,toPosition:f,connectionStatus:ky(r),toNode:u,toHandle:d});let p=``,m={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:l.x,targetY:l.y,targetPosition:f};switch(t){case Ty.Bezier:[p]=Cb(m);break;case Ty.SimpleBezier:[p]=lw(m);break;case Ty.Step:[p]=Ib({...m,borderRadius:0});break;case Ty.SmoothStep:[p]=Ib(m);break;default:[p]=Ab(m)}return(0,j.jsx)(`path`,{d:p,fill:`none`,className:`react-flow__connection-path`,style:e})};Kw.displayName=`ConnectionLine`;var qw={};function Jw(e=qw){(0,v.useRef)(e),lS(),(0,v.useEffect)(()=>{},[e])}function Yw(){lS(),(0,v.useRef)(!1),(0,v.useEffect)(()=>{},[])}function Xw({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:h,connectionLineComponent:g,connectionLineContainerStyle:_,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,deleteKeyCode:w,onlyRenderVisibleElements:T,elementsSelectable:E,defaultViewport:D,translateExtent:ee,minZoom:te,maxZoom:ne,preventScrolling:O,defaultMarkerColor:re,zoomOnScroll:k,zoomOnPinch:A,panOnScroll:ie,panOnScrollSpeed:ae,panOnScrollMode:oe,zoomOnDoubleClick:se,panOnDrag:ce,onPaneClick:M,onPaneMouseEnter:le,onPaneMouseMove:ue,onPaneMouseLeave:de,onPaneScroll:fe,onPaneContextMenu:pe,paneClickDistance:me,nodeClickDistance:he,onEdgeContextMenu:ge,onEdgeMouseEnter:_e,onEdgeMouseMove:ve,onEdgeMouseLeave:ye,reconnectRadius:be,onReconnect:xe,onReconnectStart:Se,onReconnectEnd:Ce,noDragClassName:we,noWheelClassName:Te,noPanClassName:Ee,disableKeyboardA11y:De,nodeExtent:Oe,rfId:ke,viewport:Ae,onViewportChange:je}){return Jw(e),Jw(t),Yw(),Rw(n),Bw(Ae),(0,j.jsx)(VC,{onPaneClick:M,onPaneMouseEnter:le,onPaneMouseMove:ue,onPaneMouseLeave:de,onPaneContextMenu:pe,onPaneScroll:fe,paneClickDistance:me,deleteKeyCode:w,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,elementsSelectable:E,zoomOnScroll:k,zoomOnPinch:A,zoomOnDoubleClick:se,panOnScroll:ie,panOnScrollSpeed:ae,panOnScrollMode:oe,panOnDrag:ce,defaultViewport:D,translateExtent:ee,minZoom:te,maxZoom:ne,onSelectionContextMenu:d,preventScrolling:O,noDragClassName:we,noWheelClassName:Te,noPanClassName:Ee,disableKeyboardA11y:De,onViewportChange:je,isControlledViewport:!!Ae,children:(0,j.jsxs)(Lw,{children:[(0,j.jsx)(Fw,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:xe,onReconnectStart:Se,onReconnectEnd:Ce,onlyRenderVisibleElements:T,onEdgeContextMenu:ge,onEdgeMouseEnter:_e,onEdgeMouseMove:ve,onEdgeMouseLeave:ye,reconnectRadius:be,defaultMarkerColor:re,noPanClassName:Ee,disableKeyboardA11y:De,rfId:ke}),(0,j.jsx)(Gw,{style:h,type:m,component:g,containerStyle:_}),(0,j.jsx)(`div`,{className:`react-flow__edgelabel-renderer`}),(0,j.jsx)(XC,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,nodeClickDistance:he,onlyRenderVisibleElements:T,noPanClassName:Ee,noDragClassName:we,disableKeyboardA11y:De,nodeExtent:Oe,rfId:ke}),(0,j.jsx)(`div`,{className:`react-flow__viewport-portal`})]})})}Xw.displayName=`GraphView`;var Zw=(0,v.memo)(Xw),Qw=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,nodeOrigin:s,nodeExtent:c}={})=>{let l=new Map,u=new Map,d=new Map,f=new Map,p=r??t??[],m=n??e??[],h=s??[0,0],g=c??yy;nx(d,f,p),Jb(m,l,u,{nodeOrigin:h,nodeExtent:g,elevateNodesOnSelect:!1});let _=[0,0,1];if(o&&i&&a){let{x:e,y:t,zoom:n}=ob(Fy(l,{filter:e=>!(!e.width&&!e.initialWidth||!e.height&&!e.initialHeight)}),i,a,.5,2,.1);_=[e,t,n]}return{rfId:`1`,width:0,height:0,transform:_,nodes:m,nodeLookup:l,parentLookup:u,edges:p,edgeLookup:f,connectionLookup:d,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:.5,maxZoom:2,translateExtent:yy,nodeExtent:g,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:xy.Strict,domNode:null,paneDragging:!1,noPanClassName:`nopan`,nodeOrigin:h,nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,fitViewOnInit:!1,fitViewDone:!1,fitViewOnInitOptions:void 0,selectNodesOnDrag:!0,multiSelectionActive:!1,connection:{...wy},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:``,autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:nb,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:`react`,debug:!1}},$w=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,nodeOrigin:s,nodeExtent:c})=>rS((l,u)=>({...Qw({nodes:e,edges:t,width:i,height:a,fitView:o,nodeOrigin:s,nodeExtent:c,defaultNodes:n,defaultEdges:r}),setNodes:e=>{let{nodeLookup:t,parentLookup:n,nodeOrigin:r,elevateNodesOnSelect:i}=u();Jb(e,t,n,{nodeOrigin:r,nodeExtent:c,elevateNodesOnSelect:i,checkEquality:!0}),l({nodes:e})},setEdges:e=>{let{connectionLookup:t,edgeLookup:n}=u();nx(t,n,e),l({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){let{setNodes:t}=u();t(e),l({hasDefaultNodes:!0})}if(t){let{setEdges:e}=u();e(t),l({hasDefaultEdges:!0})}},updateNodeInternals:(e,t={triggerFitView:!0})=>{let{triggerNodeChanges:n,nodeLookup:r,parentLookup:i,fitViewOnInit:a,fitViewDone:o,fitViewOnInitOptions:s,domNode:c,nodeOrigin:d,nodeExtent:f,debug:p,fitViewSync:m}=u(),{changes:h,updatedInternals:g}=ex(e,r,i,c,d,f);if(g){if(qb(r,i,{nodeOrigin:d,nodeExtent:f}),t.triggerFitView){let e=o;!o&&a&&(e=m({...s,nodes:s?.nodes})),l({fitViewDone:e})}else l({});h?.length>0&&(p&&console.log(`React Flow: trigger node changes`,h),n?.(h))}},updateNodePositions:(e,t=!1)=>{let n=[],r=[];for(let[i,a]of e){let e=!!(a?.expandParent&&a?.parentId&&a?.position),o={id:i,type:`position`,position:e?{x:Math.max(0,a.position.x),y:Math.max(0,a.position.y)}:a.position,dragging:t};e&&n.push({id:i,parentId:a.parentId,rect:{...a.internals.positionAbsolute,width:a.measured.width,height:a.measured.height}}),r.push(o)}if(n.length>0){let{nodeLookup:e,parentLookup:t,nodeOrigin:i}=u(),a=$b(n,e,t,i);r.push(...a)}u().triggerNodeChanges(r)},triggerNodeChanges:e=>{let{onNodesChange:t,setNodes:n,nodes:r,hasDefaultNodes:i,debug:a}=u();e?.length&&(i&&n(HS(e,r)),a&&console.log(`React Flow: trigger node changes`,e),t?.(e))},triggerEdgeChanges:e=>{let{onEdgesChange:t,setEdges:n,edges:r,hasDefaultEdges:i,debug:a}=u();e?.length&&(i&&n(US(e,r)),a&&console.log(`React Flow: trigger edge changes`,e),t?.(e))},addSelectedNodes:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=u();t?i(e.map(e=>WS(e,!0))):(i(GS(r,new Set([...e]),!0)),a(GS(n)))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=u();t?a(e.map(e=>WS(e,!0))):(a(GS(n,new Set([...e]))),i(GS(r,new Set,!0)))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{let{edges:n,nodes:r,nodeLookup:i,triggerNodeChanges:a,triggerEdgeChanges:o}=u(),s=e||r,c=t||n,l=s.map(e=>{let t=i.get(e.id);return t&&(t.selected=!1),WS(e.id,!1)}),d=c.map(e=>WS(e.id,!1));a(l),o(d)},setMinZoom:e=>{let{panZoom:t,maxZoom:n}=u();t?.setScaleExtent([e,n]),l({minZoom:e})},setMaxZoom:e=>{let{panZoom:t,minZoom:n}=u();t?.setScaleExtent([n,e]),l({maxZoom:e})},setTranslateExtent:e=>{u().panZoom?.setTranslateExtent(e),l({translateExtent:e})},setPaneClickDistance:e=>{u().panZoom?.setClickDistance(e)},resetSelectedElements:()=>{let{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:r}=u(),i=t.reduce((e,t)=>t.selected?[...e,WS(t.id,!1)]:e,[]),a=e.reduce((e,t)=>t.selected?[...e,WS(t.id,!1)]:e,[]);n(i),r(a)},setNodeExtent:e=>{let{nodes:t,nodeLookup:n,parentLookup:r,nodeOrigin:i,elevateNodesOnSelect:a,nodeExtent:o}=u();(e[0][0]!==o[0][0]||e[0][1]!==o[0][1]||e[1][0]!==o[1][0]||e[1][1]!==o[1][1])&&(Jb(t,n,r,{nodeOrigin:i,nodeExtent:e,elevateNodesOnSelect:a,checkEquality:!1}),l({nodeExtent:e}))},panBy:e=>{let{transform:t,width:n,height:r,panZoom:i,translateExtent:a}=u();return tx({delta:e,panZoom:i,transform:t,translateExtent:a,width:n,height:r})},fitView:e=>{let{panZoom:t,width:n,height:r,minZoom:i,maxZoom:a,nodeLookup:o}=u();return t?zy({nodes:Ry(o,e),width:n,height:r,panZoom:t,minZoom:i,maxZoom:a},e):Promise.resolve(!1)},fitViewSync:e=>{let{panZoom:t,width:n,height:r,minZoom:i,maxZoom:a,nodeLookup:o}=u();if(!t)return!1;let s=Ry(o,e);return zy({nodes:s,width:n,height:r,panZoom:t,minZoom:i,maxZoom:a},e),s.size>0},cancelConnection:()=>{l({connection:{...wy}})},updateConnection:e=>{l({connection:e})},reset:()=>l({...Qw()})}),Object.is);function eT({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,fitView:o,nodeOrigin:s,nodeExtent:c,children:l}){let[u]=(0,v.useState)(()=>$w({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,nodeOrigin:s,nodeExtent:c}));return(0,j.jsx)(oS,{value:u,children:(0,j.jsx)(tC,{children:l})})}function tT({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:o,fitView:s,nodeOrigin:c,nodeExtent:l}){return(0,v.useContext)(aS)?(0,j.jsx)(j.Fragment,{children:e}):(0,j.jsx)(eT,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:s,nodeOrigin:c,nodeExtent:l,children:e})}var nT={width:`100%`,height:`100%`,overflow:`hidden`,position:`relative`,zIndex:0};function rT({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:s,onEdgeClick:c,onInit:l,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:x,onNodeDoubleClick:S,onNodeDragStart:C,onNodeDrag:w,onNodeDragStop:T,onNodesDelete:E,onEdgesDelete:D,onDelete:ee,onSelectionChange:te,onSelectionDragStart:ne,onSelectionDrag:O,onSelectionDragStop:re,onSelectionContextMenu:k,onSelectionStart:A,onSelectionEnd:ie,onBeforeDelete:ae,connectionMode:oe,connectionLineType:se=Ty.Bezier,connectionLineStyle:ce,connectionLineComponent:M,connectionLineContainerStyle:le,deleteKeyCode:ue=`Backspace`,selectionKeyCode:de=`Shift`,selectionOnDrag:fe=!1,selectionMode:pe=Cy.Full,panActivationKeyCode:me=`Space`,multiSelectionKeyCode:he=sb()?`Meta`:`Control`,zoomActivationKeyCode:ge=sb()?`Meta`:`Control`,snapToGrid:_e,snapGrid:ve,onlyRenderVisibleElements:ye=!1,selectNodesOnDrag:be,nodesDraggable:xe,nodesConnectable:Se,nodesFocusable:Ce,nodeOrigin:we=DS,edgesFocusable:Te,edgesReconnectable:Ee,elementsSelectable:De=!0,defaultViewport:Oe=OS,minZoom:ke=.5,maxZoom:Ae=2,translateExtent:je=yy,preventScrolling:Me=!0,nodeExtent:Ne,defaultMarkerColor:Pe=`#b1b1b7`,zoomOnScroll:Fe=!0,zoomOnPinch:Ie=!0,panOnScroll:Le=!1,panOnScrollSpeed:Re=.5,panOnScrollMode:ze=Sy.Free,zoomOnDoubleClick:Be=!0,panOnDrag:Ve=!0,onPaneClick:He,onPaneMouseEnter:Ue,onPaneMouseMove:We,onPaneMouseLeave:Ge,onPaneScroll:Ke,onPaneContextMenu:qe,paneClickDistance:Je=0,nodeClickDistance:Ye=0,children:N,onReconnect:Xe,onReconnectStart:Ze,onReconnectEnd:Qe,onEdgeContextMenu:$e,onEdgeDoubleClick:et,onEdgeMouseEnter:tt,onEdgeMouseMove:nt,onEdgeMouseLeave:rt,reconnectRadius:it=10,onNodesChange:at,onEdgesChange:ot,noDragClassName:st=`nodrag`,noWheelClassName:P=`nowheel`,noPanClassName:ct=`nopan`,fitView:lt,fitViewOptions:ut,connectOnClick:dt,attributionPosition:ft,proOptions:pt,defaultEdgeOptions:mt,elevateNodesOnSelect:ht,elevateEdgesOnSelect:gt,disableKeyboardA11y:_t=!1,autoPanOnConnect:vt,autoPanOnNodeDrag:yt,autoPanSpeed:bt,connectionRadius:xt,isValidConnection:St,onError:Ct,style:wt,id:Tt,nodeDragThreshold:Et,viewport:Dt,onViewportChange:Ot,width:kt,height:At,colorMode:jt=`light`,debug:F,...I},Mt){let Nt=Tt||`1`,Pt=PS(jt);return(0,j.jsx)(`div`,{"data-testid":`rf__wrapper`,...I,style:{...wt,...nT},ref:Mt,className:Vp([`react-flow`,i,Pt]),id:Tt,children:(0,j.jsxs)(tT,{nodes:e,edges:t,width:kt,height:At,fitView:lt,nodeOrigin:we,nodeExtent:Ne,children:[(0,j.jsx)(Zw,{onInit:l,onNodeClick:s,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:x,onNodeDoubleClick:S,nodeTypes:a,edgeTypes:o,connectionLineType:se,connectionLineStyle:ce,connectionLineComponent:M,connectionLineContainerStyle:le,selectionKeyCode:de,selectionOnDrag:fe,selectionMode:pe,deleteKeyCode:ue,multiSelectionKeyCode:he,panActivationKeyCode:me,zoomActivationKeyCode:ge,onlyRenderVisibleElements:ye,defaultViewport:Oe,translateExtent:je,minZoom:ke,maxZoom:Ae,preventScrolling:Me,zoomOnScroll:Fe,zoomOnPinch:Ie,zoomOnDoubleClick:Be,panOnScroll:Le,panOnScrollSpeed:Re,panOnScrollMode:ze,panOnDrag:Ve,onPaneClick:He,onPaneMouseEnter:Ue,onPaneMouseMove:We,onPaneMouseLeave:Ge,onPaneScroll:Ke,onPaneContextMenu:qe,paneClickDistance:Je,nodeClickDistance:Ye,onSelectionContextMenu:k,onSelectionStart:A,onSelectionEnd:ie,onReconnect:Xe,onReconnectStart:Ze,onReconnectEnd:Qe,onEdgeContextMenu:$e,onEdgeDoubleClick:et,onEdgeMouseEnter:tt,onEdgeMouseMove:nt,onEdgeMouseLeave:rt,reconnectRadius:it,defaultMarkerColor:Pe,noDragClassName:st,noWheelClassName:P,noPanClassName:ct,rfId:Nt,disableKeyboardA11y:_t,nodeExtent:Ne,viewport:Dt,onViewportChange:Ot}),(0,j.jsx)(MS,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,nodesDraggable:xe,nodesConnectable:Se,nodesFocusable:Ce,edgesFocusable:Te,edgesReconnectable:Ee,elementsSelectable:De,elevateNodesOnSelect:ht,elevateEdgesOnSelect:gt,minZoom:ke,maxZoom:Ae,nodeExtent:Ne,onNodesChange:at,onEdgesChange:ot,snapToGrid:_e,snapGrid:ve,connectionMode:oe,translateExtent:je,connectOnClick:dt,defaultEdgeOptions:mt,fitView:lt,fitViewOptions:ut,onNodesDelete:E,onEdgesDelete:D,onDelete:ee,onNodeDragStart:C,onNodeDrag:w,onNodeDragStop:T,onSelectionDrag:O,onSelectionDragStart:ne,onSelectionDragStop:re,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:ct,nodeOrigin:we,rfId:Nt,autoPanOnConnect:vt,autoPanOnNodeDrag:yt,autoPanSpeed:bt,onError:Ct,connectionRadius:xt,isValidConnection:St,selectNodesOnDrag:be,nodeDragThreshold:Et,onBeforeDelete:ae,paneClickDistance:Je,debug:F}),(0,j.jsx)(ES,{onSelectionChange:te}),N,(0,j.jsx)(bS,{proOptions:pt,position:ft}),(0,j.jsx)(_S,{rfId:Nt,disableKeyboardA11y:_t})]})})}var iT=XS(rT),aT=e=>e.domNode?.querySelector(`.react-flow__edgelabel-renderer`);function oT({children:e}){let t=cS(aT);return t?(0,vl.createPortal)(e,t):null}function sT(e){return cS((0,v.useCallback)(t=>t.nodeLookup.get(e),[e]),iS)}function cT({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,j.jsx)(`path`,{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Vp([`react-flow__background-pattern`,n,r])})}function lT({radius:e,className:t}){return(0,j.jsx)(`circle`,{cx:e,cy:e,r:e,className:Vp([`react-flow__background-pattern`,`dots`,t])})}var uT;(function(e){e.Lines=`lines`,e.Dots=`dots`,e.Cross=`cross`})(uT||={});var dT={[uT.Dots]:1,[uT.Lines]:1,[uT.Cross]:6},fT=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function pT({id:e,variant:t=uT.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:s,style:c,className:l,patternClassName:u}){let d=(0,v.useRef)(null),{transform:f,patternId:p}=cS(fT,iS),m=r||dT[t],h=t===uT.Dots,g=t===uT.Cross,_=Array.isArray(n)?n:[n,n],y=[_[0]*f[2]||1,_[1]*f[2]||1],b=m*f[2],x=Array.isArray(a)?a:[a,a],S=g?[b,b]:y,C=[x[0]*f[2]||1+S[0]/2,x[1]*f[2]||1+S[1]/2],w=`${p}${e||``}`;return(0,j.jsxs)(`svg`,{className:Vp([`react-flow__background`,l]),style:{...c,...uC,"--xy-background-color-props":s,"--xy-background-pattern-color-props":o},ref:d,"data-testid":`rf__background`,children:[(0,j.jsx)(`pattern`,{id:w,x:f[0]%y[0],y:f[1]%y[1],width:y[0],height:y[1],patternUnits:`userSpaceOnUse`,patternTransform:`translate(-${C[0]},-${C[1]})`,children:h?(0,j.jsx)(lT,{radius:b/2,className:u}):(0,j.jsx)(cT,{dimensions:S,lineWidth:i,variant:t,className:u})}),(0,j.jsx)(`rect`,{x:`0`,y:`0`,width:`100%`,height:`100%`,fill:`url(#${w})`})]})}pT.displayName=`Background`;var mT=(0,v.memo)(pT);function hT(){return(0,j.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,children:(0,j.jsx)(`path`,{d:`M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z`})})}function gT(){return(0,j.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 5`,children:(0,j.jsx)(`path`,{d:`M0 0h32v4.2H0z`})})}function _T(){return(0,j.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 30`,children:(0,j.jsx)(`path`,{d:`M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z`})})}function vT(){return(0,j.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,j.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z`})})}function yT(){return(0,j.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,j.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z`})})}function bT({children:e,className:t,...n}){return(0,j.jsx)(`button`,{type:`button`,className:Vp([`react-flow__controls-button`,t]),...n,children:e})}var xT=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function ST({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:o,onFitView:s,onInteractiveChange:c,className:l,children:u,position:d=`bottom-left`,orientation:f=`vertical`,"aria-label":p=`React Flow controls`}){let m=lS(),{isInteractive:h,minZoomReached:g,maxZoomReached:_}=cS(xT,iS),{zoomIn:v,zoomOut:y,fitView:b}=iC();return(0,j.jsxs)(yS,{className:Vp([`react-flow__controls`,f===`horizontal`?`horizontal`:`vertical`,l]),position:d,style:e,"data-testid":`rf__controls`,"aria-label":p,children:[t&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(bT,{onClick:()=>{v(),a?.()},className:`react-flow__controls-zoomin`,title:`zoom in`,"aria-label":`zoom in`,disabled:_,children:(0,j.jsx)(hT,{})}),(0,j.jsx)(bT,{onClick:()=>{y(),o?.()},className:`react-flow__controls-zoomout`,title:`zoom out`,"aria-label":`zoom out`,disabled:g,children:(0,j.jsx)(gT,{})})]}),n&&(0,j.jsx)(bT,{className:`react-flow__controls-fitview`,onClick:()=>{b(i),s?.()},title:`fit view`,"aria-label":`fit view`,children:(0,j.jsx)(_T,{})}),r&&(0,j.jsx)(bT,{className:`react-flow__controls-interactive`,onClick:()=>{m.setState({nodesDraggable:!h,nodesConnectable:!h,elementsSelectable:!h}),c?.(!h)},title:`toggle interactivity`,"aria-label":`toggle interactivity`,children:h?(0,j.jsx)(yT,{}):(0,j.jsx)(vT,{})}),u]})}ST.displayName=`Controls`,(0,v.memo)(ST);function CT({id:e,x:t,y:n,width:r,height:i,style:a,color:o,strokeColor:s,strokeWidth:c,className:l,borderRadius:u,shapeRendering:d,selected:f,onClick:p}){let{background:m,backgroundColor:h}=a||{},g=o||m||h;return(0,j.jsx)(`rect`,{className:Vp([`react-flow__minimap-node`,{selected:f},l]),x:t,y:n,rx:u,ry:u,width:r,height:i,style:{fill:g,stroke:s,strokeWidth:c},shapeRendering:d,onClick:p?t=>p(t,e):void 0})}var wT=(0,v.memo)(CT),TT=e=>e.nodes.map(e=>e.id),ET=e=>e instanceof Function?e:()=>e;function DT({nodeStrokeColor:e,nodeColor:t,nodeClassName:n=``,nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=wT,onClick:o}){let s=cS(TT,iS),c=ET(t),l=ET(e),u=ET(n),d=typeof window>`u`||window.chrome?`crispEdges`:`geometricPrecision`;return(0,j.jsx)(j.Fragment,{children:s.map(e=>(0,j.jsx)(kT,{id:e,nodeColorFunc:c,nodeStrokeColorFunc:l,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:d},e))})}function OT({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:s,onClick:c}){let{node:l,x:u,y:d,width:f,height:p}=cS(t=>{let n=t.nodeLookup.get(e),{x:r,y:i}=n.internals.positionAbsolute,{width:a,height:o}=lb(n);return{node:n,x:r,y:i,width:a,height:o}},iS);return!l||l.hidden||!ub(l)?null:(0,j.jsx)(s,{x:u,y:d,width:f,height:p,style:l.style,selected:!!l.selected,className:r(l),color:t(l),borderRadius:i,strokeColor:n(l),strokeWidth:a,shapeRendering:o,onClick:c,id:l.id})}var kT=(0,v.memo)(OT),AT=(0,v.memo)(DT),jT=200,MT=150,NT=e=>{let t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?Qy(Fy(e.nodeLookup),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}},PT=`react-flow__minimap-desc`;function FT({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i=``,nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:s,bgColor:c,maskColor:l,maskStrokeColor:u,maskStrokeWidth:d,position:f=`bottom-right`,onClick:p,onNodeClick:m,pannable:h=!1,zoomable:g=!1,ariaLabel:_=`React Flow mini map`,inversePan:y,zoomStep:b=10,offsetScale:x=5}){let S=lS(),C=(0,v.useRef)(null),{boundingRect:w,viewBB:T,rfId:E,panZoom:D,translateExtent:ee,flowWidth:te,flowHeight:ne}=cS(NT,iS),O=e?.width??jT,re=e?.height??MT,k=w.width/O,A=w.height/re,ie=Math.max(k,A),ae=ie*O,oe=ie*re,se=x*ie,ce=w.x-(ae-w.width)/2-se,M=w.y-(oe-w.height)/2-se,le=ae+se*2,ue=oe+se*2,de=`${PT}-${E}`,fe=(0,v.useRef)(0),pe=(0,v.useRef)();fe.current=ie,(0,v.useEffect)(()=>{if(C.current&&D)return pe.current=vx({domNode:C.current,panZoom:D,getTransform:()=>S.getState().transform,getViewScale:()=>fe.current}),()=>{pe.current?.destroy()}},[D]),(0,v.useEffect)(()=>{pe.current?.update({translateExtent:ee,width:te,height:ne,inversePan:y,pannable:h,zoomStep:b,zoomable:g})},[h,g,y,b,ee,te,ne]);let me=p?e=>{let[t,n]=pe.current?.pointer(e)||[0,0];p(e,{x:t,y:n})}:void 0,he=m?(0,v.useCallback)((e,t)=>{m(e,S.getState().nodeLookup.get(t))},[]):void 0;return(0,j.jsx)(yS,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof c==`string`?c:void 0,"--xy-minimap-mask-background-color-props":typeof l==`string`?l:void 0,"--xy-minimap-mask-stroke-color-props":typeof u==`string`?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof d==`number`?d*ie:void 0,"--xy-minimap-node-background-color-props":typeof r==`string`?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n==`string`?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o==`string`?o:void 0},className:Vp([`react-flow__minimap`,t]),"data-testid":`rf__minimap`,children:(0,j.jsxs)(`svg`,{width:O,height:re,viewBox:`${ce} ${M} ${le} ${ue}`,className:`react-flow__minimap-svg`,role:`img`,"aria-labelledby":de,ref:C,onClick:me,children:[_&&(0,j.jsx)(`title`,{id:de,children:_}),(0,j.jsx)(AT,{onClick:he,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:s}),(0,j.jsx)(`path`,{className:`react-flow__minimap-mask`,d:`M${ce-se},${M-se}h${le+se*2}v${ue+se*2}h${-le-se*2}z
|
|
45
|
+
M${T.x},${T.y}h${T.width}v${T.height}h${-T.width}z`,fillRule:`evenodd`,pointerEvents:`none`})]})})}FT.displayName=`MiniMap`;var IT=(0,v.memo)(FT);function LT({nodeId:e,position:t,variant:n=Nx.Handle,className:r,style:i={},children:a,color:o,minWidth:s=10,minHeight:c=10,maxWidth:l=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,shouldResize:f,onResizeStart:p,onResize:m,onResizeEnd:h}){let g=wC(),_=typeof e==`string`?e:g,y=lS(),b=(0,v.useRef)(null),x=n===Nx.Line?`right`:`bottom-right`,S=t??x,C=(0,v.useRef)(null);(0,v.useEffect)(()=>{if(b.current&&_)return C.current||=Gx({domNode:b.current,nodeId:_,getStoreItems:()=>{let{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,domNode:a}=y.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,paneDomNode:a}},onChange:(e,t)=>{let{triggerNodeChanges:n,nodeLookup:r,parentLookup:i,nodeOrigin:a}=y.getState(),o=[],s={x:e.x,y:e.y},c=r.get(_);if(c&&c.expandParent&&c.parentId){let t=c.origin??a,n=e.width??c.measured.width,l=e.height??c.measured.height,u=$b([{id:c.id,parentId:c.parentId,rect:{width:n,height:l,...db({x:e.x??c.position.x,y:e.y??c.position.y},{width:n,height:l},c.parentId,r,t)}}],r,i,a);o.push(...u),s.x=e.x?Math.max(t[0]*n,e.x):void 0,s.y=e.y?Math.max(t[1]*l,e.y):void 0}if(s.x!==void 0&&s.y!==void 0){let e={id:_,type:`position`,position:{...s}};o.push(e)}if(e.width!==void 0&&e.height!==void 0){let t={id:_,type:`dimensions`,resizing:!0,setAttributes:!0,dimensions:{width:e.width,height:e.height}};o.push(t)}for(let e of t){let t={...e,type:`position`};o.push(t)}n(o)},onEnd:()=>{let e={id:_,type:`dimensions`,resizing:!1};y.getState().triggerNodeChanges([e])}}),C.current.update({controlPosition:S,boundaries:{minWidth:s,minHeight:c,maxWidth:l,maxHeight:u},keepAspectRatio:d,onResizeStart:p,onResize:m,onResizeEnd:h,shouldResize:f}),()=>{C.current?.destroy()}},[S,s,c,l,u,d,p,m,h,f]);let w=S.split(`-`),T=n===Nx.Line?`borderColor`:`backgroundColor`,E=o?{...i,[T]:o}:i;return(0,j.jsx)(`div`,{className:Vp([`react-flow__resize-control`,`nodrag`,...w,n,r]),ref:b,style:E,children:a})}(0,v.memo)(LT);var RT={crossingsPerEdge:.5,overlaps:0,detailedNodes:60,overviewLeaves:300,layoutMs500:1500},zT={width:1600,height:900},BT=(e,t,n)=>(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),VT=(e,t)=>Math.abs(e.x-t.x)<1e-9&&Math.abs(e.y-t.y)<1e-9;function HT(e,t,n,r){if(VT(e,n)||VT(e,r)||VT(t,n)||VT(t,r))return!1;let i=BT(n,r,e),a=BT(n,r,t),o=BT(e,t,n),s=BT(e,t,r);return(i>0&&a<0||i<0&&a>0)&&(o>0&&s<0||o<0&&s>0)}function UT(e){let t=e.edges.map(e=>{let t=[];for(let n=1;n<e.points.length;n++)t.push([e.points[n-1],e.points[n]]);return t}),n=0;for(let e=0;e<t.length;e++)for(let r=e+1;r<t.length;r++)for(let[i,a]of t[e])for(let[e,o]of t[r])HT(i,a,e,o)&&n++;let r=new Map(e.nodes.map(e=>[e.id,e.parent])),i=(e,t)=>{for(let n=r.get(t);n;n=r.get(n))if(n===e)return!0;return!1},a=0;for(let t=0;t<e.nodes.length;t++)for(let n=t+1;n<e.nodes.length;n++){let r=e.nodes[t],o=e.nodes[n];if(i(r.id,o.id)||i(o.id,r.id))continue;let s=Math.min(r.x+r.width,o.x+o.width)-Math.max(r.x,o.x),c=Math.min(r.y+r.height,o.y+o.height)-Math.max(r.y,o.y);s>0&&c>0&&a++}let o=new Set(e.nodes.map(e=>e.parent).filter(Boolean)),s=t.reduce((e,t)=>e+t.reduce((e,[t,n])=>e+Math.hypot(n.x-t.x,n.y-t.y),0),0),c=[...e.nodes.flatMap(e=>[e.x,e.x+e.width]),...e.edges.flatMap(e=>e.points.map(e=>e.x))],l=[...e.nodes.flatMap(e=>[e.y,e.y+e.height]),...e.edges.flatMap(e=>e.points.map(e=>e.y))],u=c.length?Math.max(...c)-Math.min(...c):0,d=l.length?Math.max(...l)-Math.min(...l):0;return{nodes:e.nodes.length,leaves:e.nodes.filter(e=>!o.has(e.id)).length,edges:e.edges.length,crossings:n,crossingsPerEdge:e.edges.length?n/e.edges.length:0,overlaps:a,averageEdgeLength:e.edges.length?s/e.edges.length:0,width:u,height:d,screens:u*d/(zT.width*zT.height)}}function WT(e,t=`detailed`){let n=[];return e.crossingsPerEdge>RT.crossingsPerEdge&&n.push(`crossings`),e.overlaps>RT.overlaps&&n.push(`overlaps`),t===`detailed`&&e.nodes>RT.detailedNodes&&n.push(`nodes`),t===`overview`&&e.leaves>RT.overviewLeaves&&n.push(`leaves`),n}function GT(e,t,n=16){let r={},i=[],a=new Map(e.map(e=>[e.id,e.parent])),o=(e,t)=>{for(let n=a.get(t);n;n=a.get(n))if(n===e)return!0;for(let n=a.get(e);n;n=a.get(n))if(n===t)return!0;return!1};for(let n of e){let e=t[n.id];e&&(r[n.id]={x:e.x,y:e.y},i.push({...n,x:e.x,y:e.y}))}let s=e=>i.find(t=>!o(t.id,e.id)&&Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x)>0&&Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y)>0);for(let a of e){if(t[a.id])continue;let e={...a};for(let t=0,r=s(e);r&&t<1e3;t++,r=s(e))e.y=r.y+r.height+n;r[a.id]={x:e.x,y:e.y},i.push(e)}return r}var KT=`__root__`,qT=16,JT=36;function YT(e){return{"elk.algorithm":`layered`,"elk.direction":e,"elk.edgeRouting":`ORTHOGONAL`,"elk.hierarchyHandling":`INCLUDE_CHILDREN`,"elk.spacing.nodeNode":`32`,"elk.layered.spacing.nodeNodeBetweenLayers":`64`,"elk.spacing.edgeLabel":`4`,"elk.edgeLabels.placement":`CENTER`,"elk.layered.considerModelOrder.strategy":`NODES_AND_EDGES`}}function XT(e){let t=new Map;for(let n of e.groups)t.set(n.id,n.parent);for(let n of e.nodes)t.set(n.id,n.parent);let n=new Set(e.groups.map(e=>e.id)),r=new Map;for(let e of t.keys()){let i=[],a=new Set([e]);for(let r=t.get(e);r&&n.has(r)&&!a.has(r);r=t.get(r))i.push(r),a.add(r);r.set(e,i)}return r}function ZT(e,t,n){let r=e.get(t)??[],i=new Set(e.get(n)??[]);return r.find(e=>i.has(e))??`__root__`}var QT=e=>[...e].sort((e,t)=>e.id<t.id?-1:+(e.id>t.id));function $T(e,t){let n=XT(e),r=new Map;r.set(KT,{id:KT,layoutOptions:YT(t),children:[],edges:[]});for(let t of QT(e.groups))r.set(t.id,{id:t.id,layoutOptions:{"elk.padding":`[top=${t.header??JT},left=${qT},bottom=${qT},right=${qT}]`},children:[],edges:[]});for(let t of QT(e.nodes))r.has(t.id)||r.set(t.id,{id:t.id,width:t.width,height:t.height});let i=e=>n.get(e)?.[0]??`__root__`;for(let t of QT(e.groups))r.get(i(t.id)).children.push(r.get(t.id));for(let t of QT(e.nodes)){let n=r.get(t.id);e.groups.some(e=>e.id===t.id)||r.get(i(t.id)).children.push(n)}let a=[];for(let t of QT(e.edges)){if(t.from===t.to||!n.has(t.from)||!n.has(t.to)){a.push(t.id);continue}let e={id:t.id,sources:[t.from],targets:[t.to]};t.label&&(e.labels=[{text:t.id,width:t.label.width,height:t.label.height}]),r.get(ZT(n,t.from,t.to)).edges.push(e)}return{graph:r.get(KT),dropped:a}}function eE(e,t,n=[]){let r=new Set(t.groups.map(e=>e.id)),i={},a={},o=(e,t,n)=>{for(let a of e.children??[]){let e={id:a.id,x:a.x??0,y:a.y??0,width:a.width??0,height:a.height??0,group:r.has(a.id)};n&&(e.parent=n),i[a.id]=e,o(a,{x:t.x+e.x,y:t.y+e.y},a.id)}for(let n of e.edges??[]){let e=n.sections?.[0];if(!e)continue;let r=e=>({x:e.x+t.x,y:e.y+t.y}),i={id:n.id,from:n.sources[0],to:n.targets[0],points:[e.startPoint,...e.bendPoints??[],e.endPoint].map(r)},o=n.labels?.[0];o&&o.x!==void 0&&o.y!==void 0&&(i.label=r({x:o.x,y:o.y})),a[n.id]=i}};return o(e,{x:0,y:0}),{boxes:i,routes:a,dropped:n}}function tE(e,t){let n=0,r=0,i=new Set;for(let a=e[t];a&&!i.has(a.id);a=a.parent?e[a.parent]:void 0)i.add(a.id),n+=a.x,r+=a.y;return{x:n,y:r}}var nE=16;function rE(e,t){if(!Object.keys(t).filter(t=>e.boxes[t]).length)return e;let n=new Map(Object.keys(e.boxes).map(t=>[t,tE(e.boxes,t)])),r={};for(let[t,n]of Object.entries(e.boxes))r[t]={...n};let i=e=>e?1+i(r[e]?.parent):0,a=[...Object.values(r).filter(e=>e.group).map(e=>e.id).sort((e,t)=>i(t)-i(e)||(e<t?-1:1)),void 0];for(let e of a){let n=Object.values(r).filter(t=>t.parent===e).sort((e,t)=>e.id<t.id?-1:1),i={};for(let e of n)t[e.id]&&(i[e.id]=t[e.id]);let a=GT(n.map(e=>({id:e.id,x:e.x,y:e.y,width:e.width,height:e.height})),i);for(let e of n)Object.assign(r[e.id],a[e.id]);if(e&&n.length){let t=r[e];t.width=Math.max(t.width,...n.map(e=>r[e.id].x+e.width+nE)),t.height=Math.max(t.height,...n.map(e=>r[e.id].y+e.height+nE))}}let o=new Set(Object.keys(r).filter(t=>{let i=n.get(t),a=tE(r,t),o=e.boxes[t],s=r[t];return[i.x-a.x,i.y-a.y,o.width-s.width,o.height-s.height].some(e=>Math.abs(e)>.5)})),s={};for(let[t,n]of Object.entries(e.routes))!o.has(n.from)&&!o.has(n.to)&&(s[t]=n);return{boxes:r,routes:s,dropped:e.dropped}}async function iE(e,t=location.href,n=e=>fetch(e).then(e=>e.text()),r=e=>URL.createObjectURL(new Blob([e],{type:`text/javascript`}))){let i=new URL(e,t),a=new URL(t);return i.origin!==`null`&&i.origin===a.origin?i.href:r(await n(i.href))}var aE=`modulepreload`,oE=function(e,t){return new URL(e,t).href},sE={},cE=function(e){return e.pathname.endsWith(`.css`)},lE=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},uE=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=oE(t,n);let r=s(t),i=cE(r);return lE(sE,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:aE,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};function dE(e){return{name:`elk`,async layout(t,n){let{graph:r,dropped:i}=$T(t,n);return eE(await e.layout(r),t,i)}}}var fE;function pE(){return fE??=Promise.all([uE(()=>import(`./elk-api-dCIOhvlC.js`).then(e=>c(e.default,1)),[],import.meta.url),uE(()=>import(`./elk-worker.min-DdYmS5kP.js`),[],import.meta.url)]).then(async([e,t])=>dE(new e.default({workerUrl:await iE(t.default)}))),fE}function mE(e,t){let n=t=>{let n=tE(e.boxes,t),r=e.boxes[t];return{x:n.x+r.width/2,y:n.y+r.height/2}};return{nodes:Object.values(e.boxes).map(t=>({id:t.id,...tE(e.boxes,t.id),width:t.width,height:t.height,...t.parent?{parent:t.parent}:{}})),edges:t.filter(t=>e.boxes[t.from]&&e.boxes[t.to]&&t.from!==t.to).map(t=>({id:t.id,points:e.routes[t.id]?.points??[n(t.from),n(t.to)]}))}}async function hE(e,t,n,r,i){let a=rE(await(i??await pE()).layout({nodes:e,edges:t,groups:n},r.direction),r.pinned??{}),o=UT(mE(a,t));return{...a,score:o,over:WT(o,`detailed`)}}var gE=w.topics;function _E({n:e}){return(0,j.jsxs)(`span`,{className:`arch-gap`,children:[(0,j.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,"aria-hidden":`true`,focusable:`false`,children:[(0,j.jsx)(`path`,{d:`M6 1 L11 11 H1 Z`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,j.jsx)(`path`,{d:`M6 5 V7.5 M6 9 V9.5`,stroke:`currentColor`,strokeWidth:`1.5`})]}),U.gapsOn(e)]})}function vE({data:e}){let{box:t,dir:n}=e,r=t.typeId?e.types?.[t.typeId]?.shape:void 0,i=[`arch-box`,r?`shape-${r}`:``,t.group?`group`:``,t.outside?`outside`:``,t.kind===`topic`?`topic`:``,t.gaps.length?`gappy`:``,e.selected?`picked`:``,t.mark?`m-${t.mark}`:``,t.badge?`heat-${Math.min(3,t.badge.n===0?0:t.badge.n<3?1:t.badge.n<10?2:3)}`:``].join(` `);return(0,j.jsxs)(`div`,{className:i,title:t.gaps.map(e=>U.gap[e]??e).join(`, `)||void 0,children:[(0,j.jsx)(OC,{type:`target`,position:n===`RIGHT`?Dy.Left:Dy.Top}),(0,j.jsxs)(`div`,{className:`arch-box-head`,children:[t.typeId&&e.types?.[t.typeId]?(0,j.jsx)(`span`,{className:`hud arch-type`,title:`${e.types[t.typeId].name}: ${e.types[t.typeId].description}`,"aria-label":`${e.types[t.typeId].name} (${t.kind})`,style:e.types[t.typeId].colour?{borderLeft:`3px solid ${e.types[t.typeId].colour}`,paddingLeft:4}:void 0,children:e.types[t.typeId].badge??t.typeId}):(0,j.jsx)(`span`,{className:`hud`,children:t.kind}),t.childCount>0&&!t.group&&(0,j.jsx)(`span`,{className:`hud`,children:U.children(t.childCount)})]}),(0,j.jsxs)(`div`,{className:`arch-box-label`,children:[t.label,t.outside&&` (${U.outsideMark})`]}),t.kind===`topic`&&(0,j.jsxs)(`div`,{className:`hud arch-box-owner`,children:[xE(t),t.declared&&` · ${gE.declared}`]}),t.badge&&(0,j.jsx)(`div`,{className:`arch-box-badge`,children:(0,j.jsx)(`span`,{className:`chip`,children:`${t.badge.n} ${t.badge.what}`})}),(t.gaps.length>0||t.inside>0)&&(0,j.jsxs)(`div`,{className:`arch-box-foot`,children:[t.gaps.length>0&&(0,j.jsx)(_E,{n:t.gaps.length}),t.inside>0&&(0,j.jsx)(`span`,{className:`hud`,children:U.insideLinks(t.inside)})]}),(0,j.jsx)(OC,{type:`source`,position:n===`RIGHT`?Dy.Right:Dy.Bottom})]})}function yE(e,t=(e,t)=>document.elementsFromPoint(e,t)){let n=`changedTouches`in e?e.changedTouches[0]:void 0,r=n?n.clientX:`clientX`in e?e.clientX:void 0,i=n?n.clientY:`clientY`in e?e.clientY:void 0;if(r!==void 0&&i!==void 0)for(let e of t(r,i)){let t=e.closest?.(`.react-flow__node`);if(t)return t.getAttribute(`data-id`)??void 0;if(!e.closest?.(`.react-flow`)||e.closest(`.react-flow__panel`))return}}function bE(e,t,n=yE){if(t.isValid||!t.fromNode)return;let r=n(e);if(r&&r!==t.fromNode.id)return t.fromHandle?.type===`target`?[r,t.fromNode.id]:[t.fromNode.id,r]}var xE=e=>e.owner?e.ownerOutside?gE.ownerOutside(e.owner):gE.owner(e.owner):gE.ownerUnknown,SE=(e,t)=>!!e&&!!t&&Math.abs(e.x-t.x)<.5&&Math.abs(e.y-t.y)<.5;function CE(e){let t=e.map((e,t)=>`${t?`L`:`M`}${e.x},${e.y}`).join(` `),n=Math.max(1,Math.floor(e.length/2)),r=e[n-1],i=e[n];return[t,(r.x+i.x)/2,(r.y+i.y)/2]}var wE=e=>({width:Math.ceil((e.label.length+(e.gaps.length?2:0))*6.6)+16,height:20}),TE=4,EE=[.5,.35,.65,.2,.8,.1,.9],DE=(e,t)=>({x:e.x-t.width/2,y:e.y-t.height/2,width:t.width,height:t.height});function OE(e,t,n,r=[]){let i=Math.max(0,Math.floor(e.length/2)-1),a=(t,n)=>{let r=e[t],i=e[t+1]??r;return{x:r.x+(i.x-r.x)*n,y:r.y+(i.y-r.y)*n}},o=(e,n)=>!n.some(n=>e.x-t.width/2<n.x+n.width+TE&&e.x+t.width/2>n.x-TE&&e.y-t.height/2<n.y+n.height+TE&&e.y+t.height/2>n.y-TE),s=[...Array(Math.max(1,e.length-1)).keys()].sort((e,t)=>Math.abs(e-i)-Math.abs(t-i)||e-t),c,l=0;for(let e of s)for(let t of EE){if(l++>=40)return c??a(i,.5);let s=a(e,t);if(o(s,n)){if(o(s,r))return s;c??=s}}return c??a(i,.5)}function kE(e,t){let n=new Map,r=[];for(let i of e){if(!i.points||i.points.length<2)continue;let e=OE(i.points,i.size,t,r);n.set(i.id,e),r.push(DE(e,i.size))}return n}function AE(e){let t=sT(e.source),n=sT(e.target),r=e.data,i=r.points&&SE(t?.internals.positionAbsolute,r.ends?.from)&&SE(n?.internals.positionAbsolute,r.ends?.to),[a,o,s]=i?CE(r.points):Ib({sourceX:e.sourceX,sourceY:e.sourceY,targetX:e.targetX,targetY:e.targetY,sourcePosition:e.sourcePosition,targetPosition:e.targetPosition}),c=i&&r.labelAt?r.labelAt.x:o,l=i&&r.labelAt?r.labelAt.y:s,u=r.link.declared||r.link.paired,d=!u&&!!r.link.ai,f=!!r.link.dependency,p=r.link.staged?`staged-${r.link.staged}`:``,m=`arch-link ${r.link.async?`async`:``} ${r.link.gaps.length?`gappy`:``} ${r.link.mark?`m-${r.link.mark}`:``} ${u?`word`:``} ${d?`ai`:``} ${f?`dep`:``} ${r.picked?`picked`:``} ${p}`;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(sw,{id:e.id,path:a,className:m,...e.markerEnd?{markerEnd:e.markerEnd}:{}}),(0,j.jsx)(oT,{children:(0,j.jsxs)(`div`,{className:`arch-link-label nodrag nopan ${r.link.gaps.length?`gappy`:``} ${r.link.mark?`m-${r.link.mark}`:``} ${d?`ai`:``} ${f?`dep`:``} ${r.picked?`picked`:``} ${p}`,style:{transform:`translate(-50%, -50%) translate(${c}px, ${l}px)`},children:[r.link.gaps.length>0&&(0,j.jsx)(`span`,{"aria-hidden":`true`,children:`⚠ `}),r.link.label,r.link.staged&&(0,j.jsxs)(`span`,{children:[` · `,w.editMap.onCanvas[r.link.staged]]}),r.link.gaps.length>0&&(0,j.jsxs)(`span`,{className:`sr`,children:[` (`,U.gapsOn(r.link.gaps.length),`)`]})]})})]})}var jE={box:vE},ME=.9,NE={link:AE},PE=.08,FE=e=>Math.round(Math.min(e.width,e.height)*(1-1/1.08)/2);function IE(e,t,n){let r=FE(t),i=Ml(e,t,{min:ME,max:1,pad:r}),a=(n??[]).filter(e=>!e.group).reduce((e,t)=>!e||t.y<e.y||t.y===e.y&&t.x<e.x?t:e,void 0);if(!a)return i;let o=e.w*i.k>t.width-r*2,s=e.h*i.k>t.height-r*2,c=(t.width-a.width*i.k)/2-a.x*i.k,l=r-e.x*i.k,u=t.width-r-(e.x+e.w)*i.k;return{k:i.k,x:o?Math.min(l,Math.max(u,c)):i.x,y:s?r-a.y*i.k:i.y}}function LE(e,t){return Ml(e,t,{min:Ol.min,max:1,pad:FE(t)})}function RE(e){let t=new Map(e.map(e=>[e.id,e])),n=(e,r=0)=>{let i=t.get(e);if(!i)return{x:0,y:0};let a=i.parentId&&r<32?n(i.parentId,r+1):{x:0,y:0};return{x:a.x+i.position.x,y:a.y+i.position.y}};return e.map(e=>({...n(e.id),width:e.width??0,height:e.height??0,group:!!e.data.box.group}))}function zE(e){if(!e.length)return;let t=Math.min(...e.map(e=>e.x)),n=Math.min(...e.map(e=>e.y));return{x:t,y:n,w:Math.max(...e.map(e=>e.x+e.width))-t,h:Math.max(...e.map(e=>e.y+e.height))-n}}function BE(e,t,n){let r=-t.x/t.k,i=-t.y/t.k,a=r+n.width/t.k,o=i+n.height/t.k;return e.filter(e=>!e.group&&(e.x+e.width<=r||e.x>=a||e.y+e.height<=i||e.y>=o)).length}function VE(e){return{nodes:e.boxes.map(e=>({id:e.id,...Ff(e),...e.parent?{parent:e.parent}:{}})),groups:e.boxes.filter(e=>e.group).map(e=>({id:e.id,...e.parent?{parent:e.parent}:{}})),edges:e.links.map(e=>({id:e.id,from:e.from,to:e.to,label:wE(e)}))}}function HE(e,t,n,r,i){let a=e=>{let n=e?t.boxes[e]:void 0;return n?1+a(n.parent):0},o=e.boxes.filter(e=>t.boxes[e.id]).map(e=>{let a=t.boxes[e.id];return{id:e.id,type:`box`,position:{x:a.x,y:a.y},data:{box:e,dir:n,selected:e.id===r,...i?{types:i}:{}},width:a.width,height:a.height,ariaLabel:`${e.kind} ${e.label}${e.kind===`topic`?`, ${xE(e)}`:``}${e.declared?`, ${gE.declared}`:``}${e.gaps.length?`, ${e.gaps.map(e=>U.gap[e]??e).join(`, `)}`:``}`,...e.parent?{parentId:e.parent,expandParent:!0}:{},...e.group?{zIndex:-1}:{}}}).sort((e,t)=>a(e.id)-a(t.id)),s=Object.values(t.boxes).filter(e=>!e.group).map(e=>({...tE(t.boxes,e.id),width:e.width,height:e.height})),c=e.links.filter(e=>t.boxes[e.from]&&t.boxes[e.to]&&e.from!==e.to),l=kE(c.map(e=>({id:e.id,...t.routes[e.id]?{points:t.routes[e.id].points}:{},size:wE(e)})),s);return{nodes:o,edges:c.map(e=>{let n=t.routes[e.id],r={link:e};if(n){r.points=n.points;let i=l.get(e.id);i&&(r.labelAt=i),r.ends={from:tE(t.boxes,e.from),to:tE(t.boxes,e.to)}}return{id:e.id,source:e.from,target:e.to,type:`link`,data:r,markerEnd:{type:Ey.ArrowClosed,width:16,height:16},ariaLabel:`${e.from} ${e.label} ${e.to}`}})}}function UE(e){let[t,n]=(0,v.useState)(e.initial?{state:`ready`}:{state:`running`}),[r]=(0,v.useState)(()=>e.initial?HE(e.graph,e.initial,e.direction,e.selected,e.types):void 0),[i,a]=(0,v.useState)(r?.nodes??[]),[o,s]=(0,v.useState)(r?.edges??[]),c=(0,v.useRef)(void 0),l=(0,v.useRef)(e.pinned);l.current=e.pinned;let u=(0,v.useRef)(e);u.current=e;let d=(0,v.useRef)(null),f=(0,v.useRef)(null),[p,m]=Wl(e.initialFull),[h,g]=(0,v.useState)(!!e.initialFocus),[_,y]=(0,v.useState)(1),b=Xl(d,e.height===void 0?{maxTop:400,min:320}:{fixed:e.height}),x=(0,v.useRef)(!1),S=(0,v.useRef)(null),C=(0,v.useRef)(i);C.current=i;let[T,E]=(0,v.useState)(0),D=e=>{let t=S.current,n=e??c.current?.getViewport();if(!t||!n||!t.clientWidth||!t.clientHeight)return;let r=BE(RE(C.current),{x:n.x,y:n.y,k:n.zoom},{width:t.clientWidth,height:t.clientHeight});E(e=>e===r?e:r)},[ee,te]=(0,v.useState)(0);(0,v.useEffect)(()=>{let e=setTimeout(()=>te(T),700);return()=>clearTimeout(e)},[T]);let ne=(e,t=!1)=>{let n=c.current,r=S.current,i=RE(C.current),a=zE(i);if(!n||!r||!a||!r.clientWidth||!r.clientHeight){n?.fitView({padding:PE,minZoom:t?Ol.min:ME,maxZoom:1,...e?{duration:e}:{}});return}let o={width:r.clientWidth,height:r.clientHeight},s=t?LE(a,o):IE(a,o,i);n.setViewport({x:s.x,y:s.y,zoom:s.k},e?{duration:e}:void 0),D({x:s.x,y:s.y,zoom:s.k})},O=(0,v.useRef)(ne);O.current=ne;let re=(0,v.useRef)(!1),k=(0,v.useRef)(!1);(0,v.useEffect)(()=>typeof window>`u`?void 0:WE(window,k),[]);let A=e=>{let t=c.current,n=t?.getInternalNode(e);if(!t||!n||re.current)return;let{x:r,y:i}=n.internals.positionAbsolute;x.current=!0,t.setCenter(r+(n.measured.width??0)/2,i+(n.measured.height??0)/2,{zoom:t.getZoom(),duration:200})};Zl((0,v.useRef)({fitView:()=>O.current()}),{height:b,ready:t.state===`ready`&&i.length>0,full:p,moved:x,minZoom:ME});let ie=`${(0,v.useMemo)(()=>JSON.stringify([e.direction,e.graph.boxes.map(e=>[e.id,e.parent??``,e.group]),e.graph.links.map(e=>[e.id,e.label])]),[e.graph,e.direction])}#${e.tidy}`,ae=(0,v.useRef)(e.initial?ie:``);(0,v.useEffect)(()=>{if(ae.current===ie)return;ae.current=ie;let e=!0,{graph:t,direction:r,engine:i}=u.current,o=VE(t);return n(e=>e.state===`ready`?e:{state:`running`}),hE(o.nodes,o.edges,o.groups,{direction:r,pinned:l.current},i).then(i=>{if(!e)return;let o=HE(t,i,r,u.current.selected,u.current.types);a(o.nodes),s(o.edges),n({state:`ready`}),u.current.onLaid(i),x.current=!1,requestAnimationFrame(()=>O.current(200))},t=>e&&n({state:`failed`,error:t instanceof Error?t.message:String(t)})),()=>{e=!1}},[ie]),(0,v.useEffect)(()=>{let t=new Map(e.graph.boxes.map(e=>[e.id,e]));a(n=>n.map(n=>{let r=t.get(n.id)??n.data.box,i=n.id===e.selected;return r===n.data.box&&i===n.data.selected&&e.types===n.data.types?n:{...n,data:{...n.data,box:r,selected:i,...e.types?{types:e.types}:{}}}}));let n=new Map(e.graph.links.map(e=>[e.id,e]));s(t=>t.map(t=>{let r=n.get(t.id)??t.data.link,i=t.id===e.selectedLink;return r===t.data.link&&i===!!t.data.picked?t:{...t,data:{...t.data,link:r,picked:i}}}))},[e.graph,e.selected,e.types,e.selectedLink]);let oe=(0,v.useCallback)(e=>a(t=>HS(e,t)),[]),se=(0,v.useMemo)(()=>e.lit??(h&&e.selected?zl(e.graph.links,e.selected):void 0),[e.lit,h,e.selected,e.graph.links]),ce=(0,v.useMemo)(()=>se?i.map(e=>qE(e,se)):i,[i,se]),M=(0,v.useMemo)(()=>e.lit?o.map(t=>e.lit.has(t.source)&&e.lit.has(t.target)?t:{...t,style:{...t.style,opacity:.15}}):se&&e.selected?o.map(t=>JE(t,e.selected)):o,[o,se,e.lit,e.selected]),le=t=>{let n=c.current,r={duration:200};switch(t===`fit`?x.current=!1:[`focus`,`full-screen`,`leave`,`search`].includes(t)||(x.current=!0),t){case`zoom-in`:n?.zoomIn(r);return;case`zoom-out`:n?.zoomOut(r);return;case`reset`:n?.zoomTo(1,r);return;case`fit`:ne(r.duration,!0);return;case`fit-selection`:e.selected&&n?.fitView({nodes:[{id:e.selected}],maxZoom:1.2,...r});return;case`focus`:g(e=>!e);return;case`full-screen`:m(),requestAnimationFrame(()=>d.current?.focus());return;case`leave`:m(!1);return;case`search`:f.current?.focus();return;default:{let e=n?.getViewport();if(!e)return;let r=Ll({x:e.x,y:e.y,k:e.zoom},t);n?.setViewport({x:r.x,y:r.y,zoom:e.zoom},{duration:120})}}},ue=t=>{x.current=!0,e.onSelect(t),requestAnimationFrame(()=>void c.current?.fitView({nodes:[{id:t}],maxZoom:1,duration:250}))};return t.state===`failed`?(0,j.jsx)(`div`,{className:`state error`,role:`alert`,children:U.layoutFailed(t.error)}):(0,j.jsx)(tu,{title:U.canvasLabel,full:p,height:b,frameRef:d,onKeyAction:le,...e.aside?{aside:e.aside}:{},...e.asideBeside?{asideBeside:!0}:{},...e.reveal?{reveal:e.reveal}:{},...e.asideIdle?{asideIdle:!0}:{},...e.toolbarIn?{toolbarIn:e.toolbarIn}:{},toolbar:(0,j.jsx)(eu,{zoom:_,full:p,focus:h,picked:!!e.selected,nodes:e.graph.boxes,onAction:le,onFind:ue,searchRef:f}),children:(0,j.jsxs)(`div`,{ref:S,className:`arch-canvas ${_<.5?`far`:``} ${se?`focusing`:``}`,style:{height:`100%`,...YE(_)},"aria-busy":t.state===`running`,onPointerDownCapture:()=>{k.current=!0},onFocusCapture:e=>{let t=S.current;if(!t)return;let n=e.target;KE(n,t,A,{keyboard:!k.current&&!re.current&&GE(n)}),requestAnimationFrame(()=>KE(n,t,()=>void 0))},children:[t.state===`running`&&!i.length?(0,j.jsxs)(`div`,{className:`stack`,"aria-live":`polite`,children:[(0,j.jsx)(`p`,{className:`hud`,children:U.layingOutBoxes(e.graph.boxes.length)}),(0,j.jsx)(`div`,{className:`skeleton`,style:{width:`70%`}}),(0,j.jsx)(`div`,{className:`skeleton`,style:{width:`50%`}})]}):(0,j.jsxs)(iT,{nodes:ce,edges:M,nodeTypes:jE,edgeTypes:NE,onNodesChange:oe,onInit:e=>{c.current=e,y(e.getZoom())},onMove:(e,t)=>{y(t.zoom),D(t)},onMoveStart:e=>{e&&(x.current=!0)},onNodeClick:(t,n)=>e.onSelect(n.id),...e.onSelectLink?{onEdgeClick:(t,n)=>e.onSelectLink(n.id)}:{},onSelectionChange:({nodes:t})=>{t.length===1&&t[0].id!==e.selected&&e.onSelect(t[0].id)},onNodeDoubleClick:(t,n)=>{n.data.box.childCount>0&&e.onToggle(n.id)},onNodeDragStart:()=>{re.current=!0},onNodeDragStop:(t,n,r)=>{re.current=!1;for(let t of r.length?r:[n])e.onMoved(t.id,t.position)},nodesConnectable:!!e.onConnect,onConnect:t=>{t.source&&t.target&&t.source!==t.target&&e.onConnect?.(t.source,t.target)},...e.onConnect?{onConnectEnd:(t,n)=>{let r=bE(t,n);r&&e.onConnect(r[0],r[1])}}:{},edgesFocusable:!1,zoomOnDoubleClick:!1,zoomOnPinch:!0,zoomOnScroll:!0,panOnDrag:!0,minZoom:Ol.min,maxZoom:Ol.max,fitView:!0,fitViewOptions:{padding:PE,minZoom:ME,maxZoom:1},colorMode:`dark`,"aria-label":U.canvasLabel,children:[(0,j.jsx)(mT,{gap:24}),i.length>12&&(0,j.jsx)(IT,{pannable:!0,zoomable:!0,ariaLabel:w.viewer.minimap})]}),T>0&&i.length>0&&t.state===`ready`&&(0,j.jsxs)(`div`,{className:`arch-outside viewer-own`,children:[(0,j.jsx)(`span`,{children:U.outside(T,RE(i).filter(e=>!e.group).length)}),` `,(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>le(`fit`),children:U.fitAll})]}),(0,j.jsx)(`span`,{className:`sr`,role:`status`,children:ee>0&&i.length>0&&t.state===`ready`?U.outside(ee,RE(i).filter(e=>!e.group).length):``}),e.overlay]})})}function WE(e,t){let n=()=>{t.current=!1},r=[`pointerup`,`pointercancel`,`keydown`],i={capture:!0};for(let t of r)e.addEventListener(t,n,i);return()=>{for(let t of r)e.removeEventListener(t,n,i)}}function GE(e){try{return typeof e.matches==`function`&&e.matches(`:focus-visible`)}catch{return!1}}function KE(e,t,n,r={}){let i=e.closest(`.react-flow__node`);if(!i||!t.contains(i))return!1;for(let e=i.parentElement;e&&e!==t;e=e.parentElement)e.scrollTop&&(e.scrollTop=0),e.scrollLeft&&(e.scrollLeft=0);if(!r.keyboard)return!1;let a=i.getBoundingClientRect(),o=t.getBoundingClientRect(),s=a.left>=o.left&&a.right<=o.right&&a.top>=o.top&&a.bottom<=o.bottom,c=i.getAttribute(`data-id`);return s||!c?!1:(n(c),!0)}function qE(e,t){let n=t.has(e.id)||e.data.box.group;return n===(e.className!==`dim`)?e:{...e,className:n?``:`dim`}}function JE(e,t){return e.source===t||e.target===t?e:{...e,className:`dim`}}var YE=e=>({"--label-scale":String(Math.round(Math.min(1.8,Math.max(1,.7/e))*100)/100)}),XE=w.evidence,ZE=(0,v.createContext)(void 0),QE=()=>(0,v.useContext)(ZE),$E=Symbol(`all repos`);function eD(e){let t=e.replace(/\\/g,`/`).replace(/^\.\//,``).replace(/\/$/,``);if(/(^|\/)facts$/.test(t))return $E;let n=/(?:^|\/)facts\/([^/]+?)(?:\.(?:corrections|rejected|reviewed|questions))?\.jsonl$/.exec(t);return n?n[1]:/(^|\/)facts\//.test(t)?$E:void 0}function tD({children:e}){let[t,n]=(0,v.useState)(new Map),r=(0,v.useRef)(new Set),i=(0,v.useCallback)(e=>{r.current.add(e),n(t=>t.get(e)?.state===`ready`?t:new Map(t).set(e,{state:`loading`})),_s(e).then(t=>n(n=>new Map(n).set(e,{state:`ready`,data:t})),t=>n(n=>new Map(n).set(e,{state:`error`,error:nr(t)})))},[]);St(e=>{if(e.type!==`file.changed`||typeof e.path!=`string`)return;let t=eD(e.path);if(t!==void 0)for(let e of r.current)(t===$E||e===t)&&i(e)});let a=(0,v.useMemo)(()=>({of:e=>t.get(e),need:e=>{r.current.has(e)||i(e)},reload:i}),[t,i]);return(0,j.jsx)(ZE.Provider,{value:a,children:e})}var nD={unverified:`△`,question:`?`,corrected:`✎`};function rD({gaps:e,short:t=!1}){return e.length?(0,j.jsx)(`span`,{className:`ev-gaps`,children:e.map(e=>(0,j.jsxs)(`span`,{className:`ev-gap ev-${e}`,children:[(0,j.jsx)(`span`,{"aria-hidden":`true`,children:nD[e]}),` `,t?XE.short[e]:XE.gaps[e]]},e))}):null}function iD({hit:e}){let t=e.fact;return(0,j.jsxs)(`span`,{className:`ev-fact`,children:[(0,j.jsx)(`code`,{className:`mono`,children:e.step??t.label}),` `,(0,j.jsxs)(`span`,{className:`muted`,children:[XE.by[t.by]??t.by,` · `,XE.verified[t.verified]??t.verified]}),t.correction&&(0,j.jsxs)(`span`,{className:`ev-corr`,children:[` `,`·`,` `,XE.correction(t.correction.action,t.correction.by,t.correction.link?.system??t.correction.link?.repo)]})]})}function aD(e){let t=uf(e.at),n=e.of?.state===`ready`?e.of.data:void 0,r=n&&t?df(n,t.file,t.line):[],i=r.find(e=>e.spot.quote)?.spot.quote;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`span`,{className:`ev-place mono`,children:[e.repo?`${e.repo} · `:``,e.at]}),e.of?.state===`loading`&&(0,j.jsx)(`span`,{className:`ev-say`,children:XE.loading}),n&&!n.present&&e.repo&&(0,j.jsx)(`span`,{className:`ev-say`,children:XE.noFacts(e.repo)}),n&&n.present&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`span`,{className:`ev-say`,children:XE.quote}),i?(0,j.jsx)(`code`,{className:`ev-quote mono`,children:i}):(0,j.jsx)(`span`,{className:`ev-say`,children:XE.noQuote}),r.map(e=>(0,j.jsx)(iD,{hit:e},`${e.fact.id}:${e.step??``}`))]}),n&&t&&(0,j.jsx)(rD,{gaps:mf(n,[t])})]})}function oD({repo:e,at:t}){let n=QE();(0,v.useEffect)(()=>{e&&n?.need(e)},[e,n]);let r=e?n?.of(e):void 0,[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(!1),c=(0,v.useId)(),l=(0,v.useRef)(null),u=uf(t),d=r?.state===`ready`?r.data:void 0,f=d&&u?mf(d,[u]):[],p=t.split(`/`).pop();return(0,j.jsxs)(`span`,{className:`ev-wrap${i?` open`:``}${o?` quiet`:``}`,onKeyDown:e=>{e.key===`Escape`&&!i&&s(!0)},onMouseLeave:()=>s(!1),onBlur:()=>s(!1),children:[(0,j.jsxs)(`button`,{ref:l,type:`button`,className:`ev-cite${f.length?` gappy`:``}`,"aria-describedby":c,"aria-expanded":i,"aria-label":e?XE.citeOf(t,e):XE.cite(t),onClick:()=>a(e=>!e),children:[(0,j.jsx)(`code`,{className:`mono`,children:p}),f.length>0&&(0,j.jsx)(rD,{gaps:f,short:!0})]}),(0,j.jsx)(`span`,{role:`tooltip`,id:c,className:`ev-tip`,children:(0,j.jsx)(aD,{repo:e,at:t,of:r})}),i&&(0,j.jsx)(sD,{repo:e,at:t,of:r,onClose:()=>{a(!1),l.current?.focus()}})]})}function sD(e){let t=uf(e.at),n=e.of?.state===`ready`?e.of.data:void 0,r=n&&t?df(n,t.file,t.line):[],i=n&&t?ff(n,t.file,t.line):[],[a,o]=(0,v.useState)(),s=[...new Map(r.map(e=>[e.fact.id,e.fact])).values()];return(0,j.jsxs)(`div`,{className:`ev-details`,role:`group`,"aria-label":XE.cite(e.at),onKeyDown:Dt(e.onClose),children:[(0,j.jsx)(aD,{repo:e.repo,at:e.at,of:e.of}),i.length>0&&(0,j.jsx)(`ul`,{className:`ev-list`,children:i.map(e=>(0,j.jsxs)(`li`,{children:[e.question,` `,(0,j.jsx)(`a`,{href:`#/questions/${e.id}`,children:XE.openQuestion})]},e.id))}),e.repo&&s.length>0&&(0,j.jsx)(`ul`,{className:`ev-list`,children:s.map(t=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,"aria-label":XE.correctFact(t.label),"aria-expanded":a===t.id,onClick:()=>o(a===t.id?void 0:t.id),children:XE.correct}),` `,(0,j.jsx)(`code`,{className:`mono`,children:t.label}),a===t.id&&(0,j.jsx)(uD,{repo:e.repo,fact:t,onClose:()=>o(void 0)})]},t.id))}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:e.onClose,children:XE.close})]})}function cD(e,t){let n=t.reason.trim();if(t.action===`wrong`)return n?{body:{fact:e.id,action:`wrong`,reason:n}}:{error:XE.needReason};let r=Object.fromEntries(Object.entries(t.set).filter(([t,n])=>(e.claim[t]??``)!==n.trim())),i=Number(t.line),a=Number.isInteger(i)&&i>0&&i!==e.cite.line;return!Object.keys(r).length&&!a?{error:XE.nothingChanged}:{body:{fact:e.id,action:`edit`,...Object.keys(r).length?{set:r}:{},...a?{line:i}:{},...n?{reason:n}:{}}}}function lD(e){let t=(0,v.useId)(),[n,r]=(0,v.useState)({action:`wrong`,reason:``,set:{...e.fact.claim},line:String(e.fact.cite.line)}),[i,a]=(0,v.useState)(),o=e.saving??{state:`idle`},s=o.state===`working`;return(0,j.jsxs)(`form`,{className:`ev-correct stack`,onSubmit:t=>{t.preventDefault();let r=cD(e.fact,n);if(`error`in r)return a(r.error);a(void 0),e.onSave?.(r.body)},onKeyDown:Dt(e.onClose),"aria-labelledby":`${t}-t`,children:[(0,j.jsx)(`h3`,{id:`${t}-t`,className:`h`,style:{fontSize:14},children:XE.correctTitle(e.fact.label)}),(0,j.jsx)(`p`,{className:`ev-say`,children:XE.correctIntro}),(0,j.jsxs)(`fieldset`,{className:`ev-choice`,children:[(0,j.jsx)(`legend`,{className:`sr`,children:XE.correctTitle(e.fact.label)}),[`wrong`,`edit`].map(e=>(0,j.jsxs)(`label`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`input`,{type:`radio`,name:`${t}-action`,value:e,checked:n.action===e,onChange:()=>r({...n,action:e})}),e===`wrong`?XE.wrong:XE.edit]},e))]}),n.action===`edit`&&(0,j.jsxs)(`div`,{className:`ev-fields`,children:[Object.keys(e.fact.claim).map(e=>(0,j.jsxs)(`label`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`span`,{className:`hud`,children:e}),(0,j.jsx)(`input`,{value:n.set[e]??``,onChange:t=>r({...n,set:{...n.set,[e]:t.target.value}})})]},e)),(0,j.jsxs)(`label`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`span`,{className:`hud`,children:XE.line}),(0,j.jsx)(`input`,{type:`number`,min:1,value:n.line,onChange:e=>r({...n,line:e.target.value})})]})]}),(0,j.jsxs)(`label`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`span`,{className:`hud`,children:n.action===`wrong`?XE.reason:XE.reasonOptional}),(0,j.jsx)(`textarea`,{rows:2,value:n.reason,onChange:e=>r({...n,reason:e.target.value})})]}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:s,children:s?XE.saving:XE.save}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:e.onClose,children:XE.close})]}),i&&(0,j.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:0},children:i}),o.state===`working`&&(0,j.jsx)(`p`,{role:`status`,"aria-busy":`true`,className:`ev-say`,children:XE.saving}),o.state===`error`&&(0,j.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:0},children:o.text}),o.state===`done`&&(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`p`,{role:`status`,className:`ev-say`,children:XE.saved(o.result.file)}),(0,j.jsx)(Td,{repo:e.repo,result:o.result})]})]})}function uD(e){let t=QE(),[n,r]=(0,v.useState)({state:`idle`});return(0,j.jsx)(lD,{repo:e.repo,fact:e.fact,saving:n,onSave:n=>{r({state:`working`}),N(`/api/facts/${encodeURIComponent(e.repo)}/corrections`,{method:`POST`,body:n}).then(n=>{r({state:`done`,result:n}),t?.reload(e.repo)},e=>r({state:`error`,text:nr(e)}))},onClose:e.onClose})}function dD(e){let t=e.trim();if(t===``)return``;let n=fD(t).split(/[?#]/,1)[0]??``;return n.startsWith(`/`)||n.includes(`/`)?`/`+n.split(`/`).filter(e=>e.length>0).map(e=>/^(\{[^}]*\}|:[^/]+|<[^>]+>|\$\{[^}]*\})$/.test(e)?`{}`:e).join(`/`):n}function fD(e){let t=``,n=0;for(;n<e.length;){let r=e[n];if(r!==`{`){t+=r,n++;continue}let i=0,a=n;for(;a<e.length;a++)if(e[a]===`{`)i++;else if(e[a]===`}`&&--i===0)break;if(a>=e.length){t+=e.slice(n);break}let o=e.slice(n+1,a);t+=`{`+(/^[^:?=]*/.exec(o)?.[0]??``)+`}`,n=a+1}return t}var pD=5e3,mD=e=>gD(e)[0];function hD(e,t){let n=mD(e),r=n?uf(n.at):void 0;if(!t||!r)return[];let i=new Map;for(let e of df(t,r.file,r.line))e.fact.kind===`call`&&!e.step&&i.set(e.fact.id,e.fact);return[...i.values()]}function gD(e){let t=new Set,n=[],r=[...e.caller.filter(e=>e.source===`code`),...e.caller.filter(e=>e.source!==`code`)];for(let e of r){if(!e.repo||!uf(e.at))continue;let r=`${e.repo}\u0000${e.at}`;t.has(r)||(t.add(r),n.push({repo:e.repo,at:e.at}))}return n}function _D(e,t){let n=uf(e.at);if(!t||!n)return[];let r=new Map;for(let e of df(t,n.file,n.line))e.fact.kind===`call`&&!e.step&&r.set(e.fact.id,e.fact);return[...r.values()]}var vD=e=>`${e.repo}\u0000${e.fact.id}`;function yD(e,t){if(e.claim.path===void 0)return!1;let n=dD(e.claim.path);if(n===t)return!0;if(t===``||t===`/`)return!1;let r=t.startsWith(`/`)?t:`/${t}`;return n.length>r.length&&n.endsWith(r)}function bD(e,t){if(e.how===`declared`)return{kind:`declared`};let n=gD(e);if(!n.length)return SD(e)?{kind:`routing`}:{kind:`uncited`};let r=e=>(e??``).toUpperCase(),i=e.path?dD(e.path):void 0,a=[],o=[],s=new Set;for(let c of n){let n=_D(c,t(c.repo)),l=n.filter(t=>!e.method||!t.claim.method||r(t.claim.method)===r(e.method)),u=l.length?l:n,d=i?u.filter(e=>yD(e,i)):u,f=d.length===1;for(let e of f?d:u){let t={repo:c.repo,at:c.at,fact:e};s.has(vD(t))||(s.add(vD(t)),f?a.push(t):o.push({...t,ofPath:d.includes(e)}))}}return!a.length&&!o.length?{kind:`none`}:{kind:`calls`,calls:a,ask:o}}function xD(e){let t=new Set,n=[];for(let r of e.hops){if(r.source!==`gateway`||!r.repo||!uf(r.at))continue;let e=`${r.repo}\u0000${r.at}`;t.has(e)||(t.add(e),n.push({repo:r.repo,at:r.at}))}return n}var SD=e=>e.how!==`declared`&&!e.dependency&&e.gateway&&xD(e).length>0&&gD(e).length===0,CD=e=>e.how!==`declared`&&!e.dependency&&gD(e).length===0&&!SD(e),wD=e=>[...new Set(e.filter(SD).flatMap(e=>xD(e).map(e=>e.repo)))];function TD(e,t){let n,r=!1,i=[],a=new Set;for(let o of xD(e)){o.repo!==n&&(n=o.repo,r=!1,i=[],a.clear());let e=t(o.repo),s=uf(o.at);if(!e){r=!0;continue}let c=df(e,s.file,s.line).filter(e=>!e.step);for(let e of c)e.fact.kind===`entry`&&a.add(e.fact.id);let l=[...new Map(c.filter(e=>e.fact.kind===`call`).map(e=>[e.fact.id,e.fact])).values()];if(!l.length)continue;let u=l.filter(e=>e.claim.from!==void 0&&a.has(e.claim.from));i.push({repo:o.repo,at:`${s.file}:${s.line}`,calls:u.length?u:l})}return r?[]:i}function ED(e){let t=/\bunder (\/[^\s?]*)/.exec(e)?.[1]?.replace(/\/?\*\*$/,``),n=/\b(?:forwards to|on|naming|through) ([^\s?]+)\??\s*$/.exec(e)?.[1];return{...t===void 0?{}:{under:t},...n?{host:n}:{}}}var DD=e=>dD(e).split(`/`).filter(Boolean);function OD(e,t){let n=DD(t),r=DD(e);if(!n.length)return!0;for(let e=0;e+n.length<=r.length;e++)if(n.every((t,n)=>r[e+n]===t))return!0;return!1}function kD(e,t,n){if(t.length<2)return t;let r=n.flatMap(e=>e.claim.path?[e.claim.path]:[]),i=n.flatMap(e=>[e.claim.base,e.claim.host,e.claim.to].filter(e=>!!e)),a=e=>t.filter(t=>{let n=ED(t.question);if(n.under===void 0)return!1;let r=n.under;return e.some(e=>OD(e,r))?!n.host||!i.length||i.includes(n.host):!1}),o=e.path?a([e.path]):[];return o.length?o:a(r)}function AD(e,t){let n=new Map,r=new Map;for(let i of e.filter(SD)){let e=TD(i,t);for(let a of e){r.set(`${a.repo}\u0000${a.at}`,{repo:a.repo,at:a.at});let e=(t(a.repo)?.questions??[]).filter(e=>e.evidence.includes(a.at));for(let t of kD(i,e,a.calls))n.has(t.id)||n.set(t.id,{id:t.id,question:t.question,repo:a.repo})}}let i=[...n.values()];if(i.length<2)return{questions:i,forwarding:[...r.values()]};let a=new Map(i.map(e=>[e.id,ED(e.question)])),o=e=>{let t=a.get(e.id).under;return t===void 0?void 0:`${t}/**`},s=e=>a.get(e.id).host,c=(e,t)=>t(e)!==void 0&&i.filter(n=>t(n)===t(e)).length===1;return{questions:i.map(e=>({...e,what:c(e,o)?o(e):c(e,s)?s(e):e.question})),forwarding:[...r.values()]}}var jD=e=>[...new Set(e.flatMap(e=>e.how===`declared`?[]:gD(e).map(e=>e.repo)))];function MD(e,t){let n=new Map,r=new Map,i=[],a=[],o=[],s=[];for(let c of e){let e=bD(c,t);if(e.kind===`declared`)a.push(c.interface);else if(e.kind===`routing`)o.push(c.interface);else if(e.kind===`uncited`)s.push(c.interface);else if(e.kind===`none`)i.push(c.interface);else{for(let t of e.calls)n.has(vD(t))||n.set(vD(t),t);for(let t of e.ask){let e=r.get(vD(t));r.set(vD(t),e?{...e,ofPath:e.ofPath||t.ofPath}:t)}}}for(let e of n.keys())r.delete(e);return{calls:[...n.values()],ask:[...r.values()],missing:i,declared:a,routing:o,uncited:s}}var ND=(e,t)=>e.filter(e=>t?t.has(vD(e)):e.ofPath);function PD(e,t,n,r){let i=n.reason.trim();if(n.kind===`not-a-call`&&!i)return{error:`needReason`};let a=n.kind===`not-a-call`?``:n.target.trim();if(n.kind!==`not-a-call`&&!a)return{error:`needTarget`};let{calls:o,ask:s,missing:c,declared:l,routing:u}=MD(e,t),d=[],f=new Set,p=0;for(let e of[...o,...ND(s,r)])n.kind!==`not-a-call`&&(e.fact.claim.to??``).trim()===a?p++:(f.add(`${e.repo}:${e.at}`),d.push(n.kind===`not-a-call`?{repo:e.repo,fact:e.fact.id,action:`wrong`}:{repo:e.repo,fact:e.fact.id,action:`edit`,set:{to:a}}));return d.length?d.length>5e3?{error:`tooMany`}:{body:{items:d,...i?{reason:i}:{}},lines:[...f],missing:c,declared:l,routing:u}:{error:p?`sameTarget`:s.length?`needPick`:`noCalls`}}function FD(e,t){let n=t.reason.trim();if(t.kind===`not-a-call`)return n?{body:{fact:e.id,action:`wrong`,reason:n}}:{error:`needReason`};let r=t.target.trim();return r?(e.claim.to??``).trim()===r?{error:`sameTarget`}:{body:{fact:e.id,action:`edit`,set:{to:r},...n?{reason:n}:{}}}:{error:`needTarget`}}function ID(e,t){let n=mD(e),r=n?uf(n.at):void 0;if(!t||!r||!e.dependency)return[];let i=new Map;for(let e of df(t,r.file,r.line))e.fact.kind===`dependency`&&!e.step&&i.set(e.fact.id,e.fact);return[...i.values()]}function LD(e,t){let n=e.dependency?.facts;return n?.length?n.map(e=>{let n=t&&t.repo===e.repo?t.facts.find(t=>t.id===e.fact):void 0;return{repo:e.repo,id:e.fact,at:e.at,...n?{fact:n}:{},...e.group&&e.name?{coordinates:`${e.group}:${e.name}`}:{}}}):ID(e,t).map(e=>({repo:t.repo,id:e.id,at:`${e.cite.file}:${e.cite.line}`,fact:e}))}function RD(e,t){if(!e.length)return{error:`needFact`};let n=t.trim();return n?{bodies:e.map(e=>({fact:e.id,action:`wrong`,reason:n}))}:{error:`needReason`}}function zD(e,t){let n=RD(e,t);return`error`in n?n:{body:{items:e.map(e=>({repo:e.repo,fact:e.id,action:`wrong`})),reason:t.trim()}}}var BD=e=>e.dependency?[...new Set([`${e.dependency.group}:${e.dependency.name}`,...(e.dependency.facts??[]).flatMap(e=>e.group&&e.name?[`${e.group}:${e.name}`]:[])])].join(`, `):[e.method,e.path].filter(Boolean).join(` `);function VD(e,t=[]){let n=new Set(t);for(let t of e.values())for(let e of[t.node,...t.children,...t.outside])(e.kind===`repo`||e.kind===`component`)&&n.add(e.id.slice(e.id.indexOf(`:`)+1));return[...n].sort()}function HD(e,t,n){if(t.kind===`not-a-call`)return{kind:`dropped`,from:e.from,was:e.to};let r=t.target.trim();return t.kind===`estate`&&n.includes(r)?{kind:`moves`,from:e.from,was:e.to,to:r}:{kind:`outside`,from:e.from,was:e.to,to:r,unknown:t.kind===`estate`}}function UD(e){let t=new Map;for(let n of e.values())for(let e of n.edges)for(let n of e.joins??[])for(let e of gD(n))t.set(`${e.repo}:${e.at}`,{link:`${n.from} → ${n.to}`,what:BD(n)});return t}function WD(e,t,n){let r=UD(e),i=UD(t),a=[];for(let e of n){let t=r.get(e),n=i.get(e);t&&t.link!==n?.link&&a.push({call:e,what:t.what,was:t.link,...n?{now:n.link}:{}})}return a}var W=w.why;function GD({title:e,list:t}){return(0,j.jsxs)(`div`,{className:`li-lines-group`,children:[(0,j.jsx)(`dt`,{className:`hud`,children:e}),(0,j.jsx)(`dd`,{children:(0,j.jsx)(`ul`,{className:`li-cites`,children:t.map(e=>(0,j.jsxs)(`li`,{children:[e.repo&&(0,j.jsxs)(`span`,{className:`mono li-repo`,children:[e.repo,`: `]}),(0,j.jsx)(`code`,{className:`mono li-at`,children:e.at})]},`${e.repo??``}:${e.at}`))})})]})}function KD({title:e,list:t}){return(0,j.jsxs)(`div`,{className:`li-lines-group`,children:[(0,j.jsx)(`dt`,{className:`hud`,children:e}),(0,j.jsx)(`dd`,{children:t.length?(0,j.jsx)(`ul`,{className:`li-cites`,children:t.map(e=>(0,j.jsxs)(`li`,{children:[e.repo&&(0,j.jsxs)(`span`,{className:`mono li-repo`,children:[e.repo,`: `]}),(0,j.jsx)(oD,{repo:e.repo,at:e.at})]},`${e.repo??``}:${e.at}`))}):(0,j.jsx)(`span`,{className:`ev-say`,children:W.noLine})})]})}function qD(e){let t=[e.method,e.what].filter(Boolean).join(` `);return(0,j.jsxs)(`header`,{className:`li-call-head`,children:[(0,j.jsxs)(`p`,{className:`li-what`,children:[t&&e.method&&(0,j.jsx)(`span`,{className:`li-method mono`,children:e.method}),(0,j.jsx)(`code`,{className:`mono li-path`,title:t||e.ends,children:t?e.what:e.ends})]}),(0,j.jsxs)(`div`,{className:`li-call-sub`,children:[(0,j.jsxs)(`p`,{className:`li-ends mono`,children:[t&&e.ends,e.extra]}),(0,j.jsxs)(`span`,{className:`li-call-tools`,children:[e.chip,t&&(0,j.jsx)(sr,{text:t,label:W.copyOf(t)})]})]})]})}function JD({also:e}){if(!e?.length)return null;let t=e.map(e=>W.alsoHow[e]??e).join(`, `);return(0,j.jsx)(`p`,{className:`ev-say li-also`,children:W.also(t)})}function YD(e){let t=e.dependency;if(t?.scope)return(t.facts??[]).every(e=>e.scope===t.scope)?t.scope:void 0}function XD({join:e,children:t}){let n=W.dependency,r=BD(e),i=n.title(e.from,e.to,r),a=YD(e);return(0,j.jsxs)(`article`,{className:`li-call`,"aria-label":i,children:[(0,j.jsx)(qD,{what:r,ends:n.ends(e.from,e.to),...a?{extra:(0,j.jsxs)(`span`,{className:`li-scope`,children:[` `,n.scope(a)]})}:{},chip:(0,j.jsx)(`span`,{className:`chip ${e.verified?`done`:`warn`}`,children:e.verified?W.verified:W.inferred})}),(0,j.jsx)(`div`,{className:`li-how`,children:(0,j.jsx)(`p`,{className:`ev-say`,children:W.how.coordinates})}),(0,j.jsxs)(`dl`,{className:`li-lines`,children:[(0,j.jsx)(KD,{title:n.caller,list:e.caller}),(0,j.jsx)(KD,{title:n.callee,list:e.callee})]}),t&&(0,j.jsx)(`div`,{className:`li-call-foot`,children:t})]})}function ZD({join:e,topic:t,children:n,onCorrected:r}){let i=[e.method,e.path].filter(Boolean).join(` `),a=!!t&&e.how===`declared`&&!e.gateway,o=a?e.other.filter(e=>e.source===`manual`):[],s=a?e.other.filter(e=>e.source!==`manual`):e.other,c=e.caller.find(e=>e.source===`ai`)??(e.how===`ai`?mD(e)??{at:``}:void 0),l=Oi(),u=c?ji(Mi(l),c.repo,c.at):void 0;return e.dependency?(0,j.jsx)(XD,{join:e,children:n}):(0,j.jsxs)(`article`,{className:`li-call`,"aria-label":W.call(e.from,e.to,i),children:[(0,j.jsx)(qD,{method:e.method,what:e.path??``,ends:W.call(e.from,e.to,``),chip:a?(0,j.jsx)(`span`,{className:`chip`,children:W.declared}):(0,j.jsx)(`span`,{className:`chip ${e.verified?`done`:`warn`}`,children:e.verified?W.verified:W.inferred})}),(0,j.jsxs)(`div`,{className:`li-how`,children:[(0,j.jsxs)(`p`,{className:`ev-say`,children:[a?W.declaredTopic:c?w.decisions.whyLinked:(e.verified?void 0:W.howGuessed[e.how])??W.how[e.how]??W.how.unknown,e.gateway&&` ${W.gateway}`,e.shared&&` ${W.sharedMap(e.shared.team,e.shared.commit)}`]}),e.verified&&(0,j.jsx)(JD,{also:e.also}),c&&(0,j.jsx)(Fi,{item:u?.item,ai:!0,...e.run?{run:e.run}:{},...r?{onDone:r}:{}}),e.shared&&(0,j.jsx)(`p`,{className:`ev-say`,children:W.sharedTheirs(e.shared.team)})]}),(0,j.jsxs)(`dl`,{className:`li-lines`,children:[(0,j.jsx)(KD,{title:W.caller,list:e.caller}),e.hops.length>0&&(0,j.jsx)(KD,{title:W.hops,list:e.hops}),e.shared&&e.callee.length?(0,j.jsx)(GD,{title:W.callee,list:e.callee}):(0,j.jsx)(KD,{title:W.callee,list:e.callee}),s.length>0&&(0,j.jsx)(KD,{title:W.other,list:s}),o.length>0&&(0,j.jsx)(GD,{title:W.declaredIn,list:o})]}),n&&(0,j.jsx)(`div`,{className:`li-call-foot`,children:n})]})}function QD({list:e}){if(!e.length)return null;let t=e.filter(e=>e.status===`mismatch`).length;return(0,j.jsxs)(`section`,{className:`li-contracts`,"aria-label":W.contracts,children:[(0,j.jsxs)(`p`,{className:`ev-say`,children:[(0,j.jsxs)(`span`,{className:`chip warn`,children:[(0,j.jsx)(`span`,{"aria-hidden":`true`,children:`⚠ `}),W.contracts]}),` `,W.contractsOf(t,e.length-t)]}),(0,j.jsx)(`ul`,{className:`ev-list`,children:e.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`span`,{className:`chip ${e.status===`mismatch`?`warn`:``}`,children:w.mismatches.status[e.status]}),` `,e.message]},e.id))}),(0,j.jsx)(`a`,{href:yf,children:W.contractsAll})]})}function $D(e){let t=e.link.joins??[];if(!t.length)return(0,j.jsx)(`p`,{className:`ev-say`,children:W.none});let n=e.above?.(e.link);return(0,j.jsxs)(`div`,{className:`li-body`,children:[(0,j.jsx)(`p`,{className:`ev-say li-intro`,children:e.link.type===`depends-on`?W.dependency.intro:W.intro}),n&&(0,j.jsx)(`div`,{className:`li-arrow-actions`,children:n}),(0,j.jsx)(`ul`,{className:`li-calls`,children:t.map(t=>(0,j.jsx)(`li`,{children:(0,j.jsxs)(ZD,{join:t,topic:e.link.type===`publishes`||e.link.type===`subscribes`,...e.onCorrected?{onCorrected:e.onCorrected}:{},children:[e.contracts&&(0,j.jsx)(QD,{list:_f(t,e.contracts)}),e.under?.(t)]})},t.interface))}),e.link.count>t.length&&(0,j.jsx)(`p`,{className:`ev-say li-more`,children:W.more(e.link.count-t.length)})]})}function eO(e){let t=w.canvasAi,n=w.decisions,r=(0,v.useId)(),i=(0,v.useRef)(null),a=Oi(),o=e.link?.id;(0,v.useEffect)(()=>{e.autoFocus&&i.current?.focus()},[o,e.autoFocus]);let s=e.link?Ef(e.link):{n:0},c=a?.view;return(0,j.jsxs)(`section`,{className:`link-inspector li`,"aria-labelledby":`${r}-h`,children:[(0,j.jsxs)(`header`,{className:`li-head`,children:[(0,j.jsxs)(`div`,{className:`li-head-name`,children:[(0,j.jsx)(`h3`,{id:`${r}-h`,className:`h li-title`,tabIndex:-1,ref:i,children:e.link?t.linkTitle(e.labelOf(e.link.from),e.labelOf(e.link.to),Cf(e.link.type)):t.link}),e.link&&(0,j.jsx)(`p`,{className:`li-meta mono`,children:e.link.type===`depends-on`?W.dependency.count(e.link.count):W.count(e.link.count)})]}),e.link&&Wf(e.link)&&e.deleteLink?.(e.link),(0,j.jsx)(`button`,{type:`button`,className:`btn li-close`,onClick:e.onClose,children:t.close})]}),e.link?(0,j.jsxs)(j.Fragment,{children:[s.n>0&&(0,j.jsxs)(j.Fragment,{children:[c?.state===`loading`&&(0,j.jsx)(`p`,{className:`ev-say`,role:`status`,"aria-busy":`true`,style:{margin:0},children:n.loading}),c?.state===`error`&&(0,j.jsx)(`p`,{className:`state error`,role:`alert`,style:{margin:0},children:n.failed(c.error)})]}),(0,j.jsx)($D,{link:e.link,...e.under?{under:e.under}:{},...e.above?{above:e.above}:{},...e.contracts?{contracts:e.contracts}:{},...e.onCorrected?{onCorrected:e.onCorrected}:{}})]}):e.gone??(0,j.jsx)(`p`,{className:`state`,role:`status`,children:t.gone})]})}function tO(e,t){if(e.open&&!t.open)return`opener`;if(t.open&&t.done&&!e.done)return`result`}function nO(e,t,n){let r=(0,v.useRef)(e);(0,v.useEffect)(()=>{let i=tO(r.current,e);r.current=e,i===`opener`?jt(t.current):i===`result`&&jt(n?.current)},[e.open,e.done])}async function rO(e,t,n){try{return{state:`done-all`,result:await e(`/api/links/corrections`,{method:`POST`,body:t}),will:n}}catch(e){return{state:`error`,text:nr(e)}}}var iO=[`estate`,`outside`,`not-a-call`];function aO(e){return e.kind===`moves`?[W.will.moves(e.from,e.was,e.to)]:e.kind===`dropped`?[W.will.dropped(e.from,e.was)]:[...e.unknown?[W.will.unknown(e.to)]:[],W.will.outside(e.from,e.was,e.to)]}function oO(e){let t=(0,v.useId)(),n=mD(e.join),r=hD(e.join,e.facts?.state===`ready`?e.facts.data:void 0),[i,a]=(0,v.useState)(),[o,s]=(0,v.useState)(`estate`),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(),m=e.saving??{state:`idle`},h=[e.join.method,e.join.path].filter(Boolean).join(` `),g=W.call(e.join.from,e.join.to,h),_=r.find(e=>e.id===i)??r[0];if(!n)return(0,j.jsx)(`p`,{className:`ev-say`,children:W.noLine});if(!e.facts||e.facts.state===`loading`)return(0,j.jsx)(`p`,{role:`status`,"aria-busy":`true`,className:`ev-say`,children:W.loadingFacts});if(e.facts.state===`error`)return(0,j.jsx)(`p`,{role:`alert`,className:`state error`,children:W.factsFailed(e.facts.error)});if(!_)return(0,j.jsx)(`p`,{className:`ev-say`,children:W.noCall(n.repo)});let y=()=>o===`not-a-call`?{kind:o,reason:u}:{kind:o,target:c,reason:u};return(0,j.jsxs)(`form`,{className:`ev-correct stack li-form`,onSubmit:t=>{t.preventDefault();let r=FD(_,y());if(`error`in r)return p(W[r.error]);p(void 0),e.onSave?.(n.repo,r.body,HD(e.join,y(),e.known))},onKeyDown:Dt(e.onClose),"aria-labelledby":`${t}-t`,children:[(0,j.jsx)(`h4`,{id:`${t}-t`,className:`li-form-title`,children:W.wrongTitle(g)}),(0,j.jsx)(`p`,{className:`ev-say`,children:W.wrongIntro}),r.length>1&&(0,j.jsxs)(`fieldset`,{className:`ev-choice`,children:[(0,j.jsx)(`legend`,{className:`hud`,children:W.pickCall}),r.map(e=>(0,j.jsxs)(`label`,{className:`li-choice`,children:[(0,j.jsx)(`input`,{type:`radio`,name:`${t}-call`,value:e.id,checked:_.id===e.id,onChange:()=>a(e.id)}),(0,j.jsx)(`code`,{className:`mono`,children:e.label})]},e.id))]}),(0,j.jsxs)(`fieldset`,{className:`ev-choice`,children:[(0,j.jsx)(`legend`,{className:`sr`,children:W.wrongTitle(g)}),iO.map(e=>(0,j.jsxs)(`label`,{className:`li-choice`,children:[(0,j.jsx)(`input`,{type:`radio`,name:`${t}-choice`,value:e,checked:o===e,onChange:()=>s(e)}),W.choice[e]]},e))]}),o!==`not-a-call`&&(0,j.jsxs)(`label`,{className:`li-field`,children:[(0,j.jsx)(`span`,{className:`hud`,children:o===`estate`?W.target:W.outsideTarget}),(0,j.jsx)(`input`,{value:c,list:o===`estate`?`${t}-known`:void 0,"aria-describedby":`${t}-hint`,onChange:e=>l(e.target.value)}),(0,j.jsx)(`span`,{id:`${t}-hint`,className:`ev-say`,children:o===`estate`?W.targetHint:W.outsideHint}),o===`estate`&&(0,j.jsx)(`datalist`,{id:`${t}-known`,children:e.known.map(e=>(0,j.jsx)(`option`,{value:e},e))})]}),(0,j.jsxs)(`label`,{className:`li-field`,children:[(0,j.jsx)(`span`,{className:`hud`,children:o===`not-a-call`?W.reason:W.reasonOptional}),(0,j.jsx)(`textarea`,{rows:2,value:u,onChange:e=>d(e.target.value)})]}),(0,j.jsxs)(`div`,{className:`li-form-actions`,children:[(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:m.state===`working`,children:m.state===`working`?W.saving:W.save}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:e.onClose,children:w.evidence.close})]}),f&&(0,j.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:0},children:f}),m.state===`working`&&(0,j.jsx)(`p`,{role:`status`,"aria-busy":`true`,className:`ev-say`,children:W.saving}),m.state===`error`&&(0,j.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:0},children:m.text}),m.state===`done`&&(0,j.jsxs)(`div`,{role:`status`,className:`li-result`,children:[aO(m.will).map(e=>(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:e},e)),(0,j.jsx)(`p`,{className:`ev-say`,children:W.saved(m.result.file)}),(0,j.jsx)(Td,{repo:n.repo,result:m.result})]})]})}function sO(e){let t=W.dependency,n=(0,v.useId)(),r=mD(e.join),i=LD(e.join,e.facts?.state===`ready`?e.facts.data:void 0),[a,o]=(0,v.useState)(()=>new Set),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(),d=e.saving??{state:`idle`},f=t.title(e.join.from,e.join.to,BD(e.join));if(!r)return(0,j.jsx)(`p`,{className:`ev-say`,children:W.noLine});if(!e.facts||e.facts.state===`loading`)return(0,j.jsx)(`p`,{role:`status`,"aria-busy":`true`,className:`ev-say`,children:t.loadingFacts});if(e.facts.state===`error`)return(0,j.jsx)(`p`,{role:`alert`,className:`state error`,children:t.factsFailed(e.facts.error)});if(!i.length)return(0,j.jsx)(`p`,{className:`ev-say`,children:t.noFact(r.repo)});let p=i[0].repo,m=i.filter(e=>!a.has(e.id)),h=e=>e.fact?.label??e.id,g=n=>{n.preventDefault();let r=RD(m,s);if(`error`in r)return u(r.error===`needFact`?t.needFact:t.needReason);u(void 0);let i={kind:`dropped`,from:e.join.from,was:e.join.to};if(m.length===1&&m[0].repo===p)return e.onSave?.(p,r.bodies[0],i);let a=zD(m,s);`body`in a&&e.onSaveAll?.(a.body,i)},_=d.state===`done-all`?d.result.files:[];return(0,j.jsxs)(`form`,{className:`ev-correct stack li-form`,onSubmit:g,onKeyDown:Dt(e.onClose),"aria-labelledby":`${n}-t`,children:[(0,j.jsx)(`h4`,{id:`${n}-t`,className:`li-form-title`,children:t.wrongTitle(f)}),(0,j.jsx)(`p`,{className:`ev-say`,children:t.wrongIntro}),i.length===1?(0,j.jsxs)(`p`,{className:`ev-say`,style:{margin:0},children:[(0,j.jsx)(`code`,{className:`mono`,children:h(i[0])}),` `,i[0].coordinates&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`code`,{className:`mono`,children:i[0].coordinates}),` `]}),(0,j.jsx)(`span`,{className:`li-at`,children:i[0].at})]}):(0,j.jsxs)(`fieldset`,{className:`ev-choice`,children:[(0,j.jsx)(`legend`,{className:`hud`,children:t.pickFacts(i.length)}),i.map(e=>(0,j.jsxs)(`label`,{className:`li-choice`,children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:!a.has(e.id),onChange:t=>{let n=t.target.checked;o(t=>{let r=new Set(t);return n?r.delete(e.id):r.add(e.id),r})}}),(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`code`,{className:`mono`,children:h(e)}),` `,e.coordinates&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`code`,{className:`mono`,children:e.coordinates}),` `]}),(0,j.jsx)(`span`,{className:`li-at`,children:e.at})]})]},`${e.repo}:${e.id}`))]}),(0,j.jsxs)(`label`,{className:`li-field`,children:[(0,j.jsx)(`span`,{className:`hud`,children:t.reason}),(0,j.jsx)(`textarea`,{rows:2,value:s,onChange:e=>c(e.target.value)})]}),(0,j.jsxs)(`div`,{className:`li-form-actions`,children:[(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:d.state===`working`,children:d.state===`working`?W.saving:W.save}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:e.onClose,children:w.evidence.close})]}),l&&(0,j.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:0},children:l}),d.state===`working`&&(0,j.jsx)(`p`,{role:`status`,"aria-busy":`true`,className:`ev-say`,children:W.saving}),d.state===`error`&&(0,j.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:0},children:d.text}),d.state===`done`&&(0,j.jsxs)(`div`,{role:`status`,className:`li-result`,children:[(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:t.will(e.join.from,e.join.to)}),(0,j.jsx)(`p`,{className:`ev-say`,children:W.saved(d.result.file)}),(0,j.jsx)(Td,{repo:p,result:d.result})]}),d.state===`done-all`&&(0,j.jsxs)(`div`,{role:`status`,className:`li-result`,children:[(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:t.will(e.join.from,e.join.to)}),(0,j.jsxs)(`p`,{className:`ev-say`,children:[_.length?t.savedAll(_.reduce((e,t)=>e+t.lines.length,0),_.map(e=>e.file).join(`, `)):t.alreadyAll,_.length&&d.result.skipped?.length?` ${t.skippedAll(d.result.skipped.length)}`:``]}),_.flatMap(e=>e.corrections[0]?[{f:e,first:e.corrections[0]}]:[]).map(({f:e,first:t})=>(0,j.jsx)(Td,{repo:e.repo,result:{correction:t,file:e.file,commit:d.result.commit,verify:`atticus verify ${e.repo}`,line:e.lines.join(`
|
|
46
|
+
`)}},e.repo))]})]})}function cO(e){let t=W.declaredLink,n=e.join.other.find(e=>e.source===`manual`)?.at,r=e.of.state===`ready`?{state:`ready`,data:{items:uO(e.join,e.of.data.items)},...e.of.reload?{reload:e.of.reload}:{}}:e.of;return(0,j.jsxs)(`div`,{className:`ev-correct stack li-form`,children:[(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:n?t.say(n):t.sayNoFile}),r.state===`ready`&&!r.data.items.length?(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:t.byHand(n??t.profile)}):(0,j.jsx)(sf,{of:r,...e.undo?{undo:e.undo}:{}})]})}function lO(e){return e.gateway?[e.from]:[...new Set([e.to,e.from])]}function uO(e,t){let n=(e,t)=>!!e&&!!t&&e.toLowerCase()===t.toLowerCase(),r=t.filter(e=>`kind`in e.undo);if(!e.gateway)return r.filter(t=>t.undo.kind===`topic`&&n(t.undo.value,e.path));let i=r.filter(e=>e.undo.kind===`call`),a=[e.method,e.path].filter(Boolean).join(` `),o=i.filter(t=>n(t.undo.value,a)||n(t.undo.value,e.path));return o.length?o:i}function dO(e){return e.find(e=>e.state===`error`)||(e.some(e=>e.state===`loading`)?{state:`loading`}:{state:`ready`,data:{items:e.flatMap(e=>e.state===`ready`?e.data.items:[])}})}var fO=e=>e?`/api/boxes/corrections?system=${encodeURIComponent(e)}`:void 0;function pO(e){let[t,n]=lO(e.join),r=P(fO(t)),i=P(fO(n)),a=dO(n?[r,i]:[r]),o=()=>{r.reload(),n&&i.reload()};return(0,j.jsx)(cO,{join:e.join,of:{...a,reload:o}})}function mO({text:e}){return(0,j.jsxs)(`div`,{className:`work-cmd`,children:[(0,j.jsx)(`code`,{className:`mono`,children:e}),(0,j.jsx)(sr,{text:e,label:W.routing.copy(e)})]})}function hO({commands:e,open:t}){return(0,j.jsxs)(`details`,{className:`work-terminal li-terminal`,open:t,children:[(0,j.jsx)(`summary`,{children:W.routing.terminal}),e.map(e=>(0,j.jsx)(mO,{text:e},e))]})}var gO=e=>[`atticus questions`,...e.map(e=>`atticus verify ${e} --write`)];function _O(e){return(0,j.jsx)(`div`,{className:`li-route-left stack`,children:(0,j.jsx)(`p`,{className:`ev-say li-note`,style:{margin:0},children:e.say})})}function vO(e){let t=W.routing,n=QE(),[r,i]=(0,v.useState)(e.openAt),a=(0,v.useRef)(new Map),o=wD(e.joins),s=o.join(`\0`);(0,v.useEffect)(()=>{for(let e of s.split(`\0`))e&&n?.need(e)},[s,n]);let c=o.map(t=>({repo:t,s:e.of(t)})),l=c.flatMap(({repo:e,s:t})=>t?.state===`error`?[{repo:e,s:t}]:[]),u=c.some(({s:e})=>e?.state===`loading`),{questions:d,forwarding:f}=AD(e.joins,t=>{let n=e.of(t);return n?.state===`ready`?n.data:void 0}),p=d.length+f.length>0;if(!p&&u&&!l.length)return(0,j.jsx)(`p`,{role:`status`,"aria-busy":`true`,className:`ev-say`,children:t.loading});let m=e=>`${e.repo}\u0000${e.at}`,h=f.find(e=>m(e)===r||e.at===r),g=f.length>1;return(0,j.jsxs)(`div`,{className:`li-route stack`,children:[l.map(({repo:e,s:n})=>(0,j.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:0},children:t.failed(e,n.error)},e)),p&&(0,j.jsxs)(`div`,{className:`li-route-actions`,children:[d.map(e=>(0,j.jsx)(`a`,{className:`btn primary`,href:`#/questions/${e.id}`,"aria-label":e.what&&e.what!==e.question?t.answerOf(e.question,e.what):t.answerOf(e.question),children:e.what?t.answerFor(e.what):t.answer},e.id)),f.map(e=>(0,j.jsx)(`button`,{ref:t=>{a.current.set(m(e),t)},type:`button`,className:`btn`,"aria-expanded":!!h&&m(h)===m(e),...g?{}:{"aria-label":t.forwardingOf(e.repo,e.at)},onClick:()=>i(t=>t===m(e)||t===e.at?void 0:m(e)),children:g?t.forwardingOf(e.repo,e.at):t.forwarding},m(e)))]}),u&&(0,j.jsx)(`p`,{role:`status`,"aria-busy":`true`,className:`ev-say`,style:{margin:0},children:t.loading}),!p&&!u&&!l.length&&(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:t.none}),(l.length>0||!p&&!u)&&(0,j.jsx)(hO,{commands:gO(o),open:!0}),h&&(0,j.jsx)(sD,{repo:h.repo,at:h.at,of:e.of(h.repo),onClose:()=>{i(void 0),a.current.get(m(h))?.focus()}})]})}function yO(e){let t=QE(),n=e.join.how===`declared`,r=n?void 0:mD(e.join),i=r?.repo,a=SD(e.join);(0,v.useEffect)(()=>{i&&t?.need(i)},[i,t]);let[o,s]=(0,v.useState)(!!e.startOpen),[c,l]=(0,v.useState)({state:`idle`}),u=(0,v.useRef)(null);nO({open:o,done:c.state===`done`},u);let d=BD(e.join),f=!!e.join.dependency,p=(n,i)=>{r&&(l({state:`working`}),rO(N,n,i).then(n=>{if(l(n),n.state===`done-all`){for(let e of n.result.files)t?.reload(e.repo);e.onSaved?.(`${r.repo}:${r.at}`)}}))},m=(n,i,a)=>{r&&(l({state:`working`}),N(`/api/facts/${encodeURIComponent(n)}/corrections`,{method:`POST`,body:i}).then(i=>{l({state:`done`,result:i,will:a}),t?.reload(n),e.onSaved?.(`${r.repo}:${r.at}`)},e=>l({state:`error`,text:nr(e)})))};return(0,j.jsxs)(`div`,{className:`li-fix`,children:[(0,j.jsx)(`button`,{ref:u,type:`button`,className:`btn li-fix-open`,"aria-expanded":o,"aria-label":f?W.dependency.wrongOf(W.dependency.title(e.join.from,e.join.to,d)):W.wrongOf(W.call(e.join.from,e.join.to,d)),onClick:()=>s(e=>!e),children:W.wrong}),o&&(n?(0,j.jsx)(pO,{join:e.join}):f?(0,j.jsx)(sO,{join:e.join,facts:r?t?.of(r.repo):void 0,saving:c,onSave:m,onSaveAll:p,onClose:()=>s(!1)}):!r&&a?(0,j.jsxs)(`div`,{className:`li-route-left stack`,children:[(0,j.jsx)(`p`,{className:`ev-say li-note`,children:W.routingLink}),(0,j.jsx)(vO,{joins:[e.join],of:e=>t?t.of(e)??{state:`loading`}:void 0})]}):r?(0,j.jsx)(oO,{join:e.join,facts:t?.of(r.repo),known:e.known,saving:c,onSave:m,onClose:()=>s(!1)}):(0,j.jsx)(_O,{say:W.uncitedLink}))]})}function bO(e){let t=(0,v.useId)(),n=W.arrow,r=e.link.joins??[],i=e.joins??(r.length<e.link.count?void 0:r),a=e.labelOf??(e=>e),[o,s]=(0,v.useState)(!!e.startOpen),[c,l]=(0,v.useState)(`estate`),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(),[g,_]=(0,v.useState)(),y=e.saving??{state:`idle`},b=jD(i??[]),x=!i||b.some(t=>!e.viewOf(t)),S=()=>c===`not-a-call`?{kind:c,reason:f}:{kind:c,target:u,reason:f},C=x||!i?void 0:MD(i,e.viewOf),T=new Set(ND(C?.ask??[],g).map(vD)),E=e=>{let t=new Set(T);t.delete(e)||t.add(e),_(t),t.size>0&&m===n.pick.need&&h(void 0)},D=x||!i?void 0:PD(i,e.viewOf,S(),T),ee=(C?.calls.length??0)+T.size,te=D&&`body`in D?D.body.items.length:ee,ne=!!C&&C.calls.length+C.ask.length===0,O=e.proxyOf??(t=>{let n=e.viewOf(t);return n?{state:`ready`,data:n}:void 0}),re=(i??[]).filter(SD),k=(i??[]).filter(CD),A=C&&(0,j.jsxs)(`div`,{className:`li-route-left stack`,children:[C.routing.length>0&&(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:C.routing.length===i?.length?W.routing.all(C.routing.length):n.routing(C.routing.length)}),C.declared.length>0&&(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:n.declared(C.declared.length)}),C.missing.length>0&&(0,j.jsxs)(`p`,{className:`ev-say`,style:{margin:0},children:[n.missing(C.missing.length),` `,n.noCalls]}),k.length>0&&(0,j.jsx)(_O,{say:n.uncited(k.length)}),re.length>0&&(0,j.jsx)(vO,{joins:re,of:O})]}),ie=t=>{if(t.preventDefault(),!i||y.state===`done`||y.state===`working`)return;let r=PD(i,e.viewOf,S(),T);if(`error`in r)return h(r.error===`noCalls`?n.noCalls:r.error===`needPick`?n.pick.need:r.error===`tooMany`?n.tooMany(ee,pD):W[r.error]);h(void 0),e.onSave?.(r.body,r.lines)},ae=W.call(a(e.link.from),a(e.link.to),``),oe=y.state===`done`?y.result.files:[],se=y.state===`done`?(y.result.skipped??[]).length:0,ce=(0,v.useRef)(null),M=(0,v.useRef)(null);return nO({open:o,done:y.state===`done`},ce,M),r.length>=e.link.count&&r.length>0&&r.every(e=>e.how===`declared`||SD(e)||CD(e))&&A?(0,j.jsx)(`div`,{className:`li-fix li-arrow`,children:A}):(0,j.jsxs)(`div`,{className:`li-fix li-arrow`,children:[(0,j.jsx)(`div`,{children:(0,j.jsx)(`button`,{ref:ce,type:`button`,className:`btn li-fix-open`,"aria-expanded":o,"aria-label":n.openOf(ae),onClick:()=>{o||(e.onOpen?.(),_(void 0)),s(e=>!e)},children:n.open})}),o&&(e.callsFailed?(0,j.jsx)(`p`,{role:`alert`,className:`state error`,children:n.callsFailed(e.callsFailed)}):e.failed?(0,j.jsx)(`p`,{role:`alert`,className:`state error`,children:W.factsFailed(e.failed)}):x?(0,j.jsx)(`p`,{role:`status`,"aria-busy":`true`,className:`ev-say`,children:i?W.loadingFacts:n.loadingCalls}):ne?A:(0,j.jsxs)(`form`,{className:`ev-correct stack li-form`,onSubmit:ie,onKeyDown:Dt(()=>s(!1)),"aria-labelledby":`${t}-t`,children:[(0,j.jsx)(`h4`,{id:`${t}-t`,className:`li-form-title`,children:n.title(te||(C?.ask.length??0))}),(0,j.jsx)(`p`,{className:`ev-say`,children:n.intro}),(0,j.jsxs)(`fieldset`,{className:`ev-choice`,children:[(0,j.jsx)(`legend`,{className:`sr`,children:n.title(te||(C?.ask.length??0))}),iO.map(e=>(0,j.jsxs)(`label`,{className:`li-choice`,children:[(0,j.jsx)(`input`,{type:`radio`,name:`${t}-choice`,value:e,checked:c===e,onChange:()=>l(e)}),n.choice[e]]},e))]}),c!==`not-a-call`&&(0,j.jsxs)(`label`,{className:`li-field`,children:[(0,j.jsx)(`span`,{className:`hud`,children:c===`estate`?n.target:n.outsideTarget}),(0,j.jsx)(`input`,{value:u,list:c===`estate`?`${t}-known`:void 0,"aria-describedby":`${t}-hint`,onChange:e=>d(e.target.value)}),(0,j.jsx)(`span`,{id:`${t}-hint`,className:`ev-say`,children:c===`estate`?W.targetHint:W.outsideHint}),c===`estate`&&(0,j.jsx)(`datalist`,{id:`${t}-known`,children:e.known.map(e=>(0,j.jsx)(`option`,{value:e},e))})]}),(0,j.jsxs)(`label`,{className:`li-field`,children:[(0,j.jsx)(`span`,{className:`hud`,children:c===`not-a-call`?W.reason:W.reasonOptional}),(0,j.jsx)(`textarea`,{rows:2,value:f,onChange:e=>p(e.target.value)})]}),C&&C.ask.length>0&&(0,j.jsxs)(`fieldset`,{className:`ev-choice`,"aria-describedby":`${t}-pick`,children:[(0,j.jsx)(`legend`,{className:`hud`,children:n.pick.legend}),(0,j.jsx)(`p`,{id:`${t}-pick`,className:`ev-say`,style:{margin:0},children:n.pick.intro}),C.ask.map(e=>{let r=vD(e),i=[e.fact.claim.method,e.fact.claim.path].filter(Boolean).join(` `);return(0,j.jsxs)(`label`,{className:`li-choice`,children:[(0,j.jsx)(`input`,{type:`checkbox`,name:`${t}-pick`,checked:T.has(r),onChange:()=>E(r)}),(0,j.jsx)(`code`,{className:`mono`,children:n.pick.call(i,e.fact.claim.host??e.fact.claim.to,e.at)})]},r)})]}),C&&C.missing.length>0&&(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:n.missing(C.missing.length)}),C&&C.declared.length>0&&(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:n.declared(C.declared.length)}),C&&C.routing.length>0&&(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:n.routing(C.routing.length)}),C&&C.uncited.length>0&&(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:n.uncited(C.uncited.length)}),(0,j.jsxs)(`div`,{className:`li-form-actions`,children:[y.state!==`done`&&te>0&&(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:y.state===`working`,children:y.state===`working`?n.saving:n.save(te)}),y.state!==`done`&&te===0&&m!==n.pick.need&&(0,j.jsx)(`span`,{className:`ev-say`,children:n.pick.need}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>s(!1),children:w.evidence.close})]}),m&&(0,j.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:0},children:m}),y.state===`working`&&(0,j.jsx)(`p`,{role:`status`,"aria-busy":`true`,className:`ev-say`,children:n.saving}),y.state===`error`&&(0,j.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:0},children:y.text}),y.state===`done`&&(0,j.jsxs)(`div`,{role:`status`,className:`li-result`,tabIndex:-1,ref:M,children:[oe.length?(0,j.jsxs)(`p`,{className:`ev-say`,style:{margin:0},children:[n.saved(oe.reduce((e,t)=>e+t.lines.length,0),oe.map(e=>e.file).join(`, `)),se?` ${n.skipped(se)}`:``]}):(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:n.already}),oe.length>0&&(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:n.apply})]})]}))]})}function xO(e){let t=QE(),n=e.link.joins??[],r=n.length<e.link.count,[i,a]=(0,v.useState)(!1),o=P(r&&i&&e.callsPath?e.callsPath:void 0),s=!r||!e.callsPath?n:o.state===`ready`?o.data.joins:void 0,c=jD(s??[]).join(`\0`);(0,v.useEffect)(()=>{for(let e of c.split(`\0`))e&&t?.need(e)},[c,t]);let[l,u]=(0,v.useState)({state:`idle`});if(!n.length)return null;let d=e=>{let n=t?.of(e);return n?.state===`ready`?n.data:void 0},f=c.split(`\0`).map(e=>e?t?.of(e):void 0).find(e=>e?.state===`error`)?.error,p=(n,r)=>{u({state:`working`}),N(`/api/links/corrections`,{method:`POST`,body:n}).then(n=>{u({state:`done`,result:n});for(let e of n.files)t?.reload(e.repo);e.onSaved?.(r)},e=>{for(let n of Xe(e))t?.reload(n.repo);u({state:`error`,text:nr(e)})})};return(0,j.jsx)(bO,{link:e.link,...s?{joins:s}:{},...r&&e.callsPath&&o.state===`error`?{callsFailed:o.error}:{},...e.labelOf?{labelOf:e.labelOf}:{},viewOf:d,proxyOf:e=>t?t.of(e)??{state:`loading`}:void 0,known:e.known,saving:l,onSave:p,onOpen:()=>{a(!0),u({state:`idle`})},...f?{failed:f}:{}})}function SO({moved:e}){return(0,j.jsxs)(`div`,{role:`status`,className:`li-result`,children:[(0,j.jsx)(`h3`,{className:`li-form-title`,children:W.moved}),e.length?(0,j.jsx)(`ul`,{className:`ev-list`,children:e.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`code`,{className:`mono`,children:e.call}),` `,e.now?W.movedTo(e.what,e.was,e.now):W.movedOff(e.what,e.was)]},e.call))}):(0,j.jsx)(`p`,{className:`ev-say`,children:W.notYet})]})}var CO=w.editMap,wO=e=>e.by===`declare`?[`declare\u0000${e.add.system}\u0000${e.add.kind}\u0000${e.add.kind===`call`?e.add.route.trim():`${e.add.side}:${e.add.topic.trim()}`}`]:e.pair.pairs.map(t=>`pair\u0000${e.pair.from}\u0000${t.call}`);function TO(e){return e.kind===`delete`||e.kind===`redirect`?`link:${e.delete.link}`:`add:${wO(e.link).join(`|`)}`}function EO(e){if(e.by===`pair`)return CO.what.pair(e.from,e.to,e.pair.pairs.length);let t=e.add;return t.kind===`call`?CO.what.call(t.system,t.route.trim()):t.side===`publishes`?CO.what.publishes(t.system,t.topic.trim()):CO.what.listens(t.system,t.topic.trim())}function DO(e){let t=e.kind!==`add`&&e.delete.also?.length?CO.row.also(e.delete.also.join(`, `)):``;return e.kind===`delete`?CO.row.delete(e.delete.from,e.delete.to,e.delete.interfaces.length)+t:e.kind===`add`?CO.row.add(EO(e.link)):CO.row.redirect(e.delete.from,e.delete.to,EO(e.link))+t}function OO(e,t){let n=TO(t),r={...t,key:n},i=e.findIndex(e=>e.key===n),a=new Set(r.kind===`delete`?[]:wO(r.link));if(r.kind===`add`&&e.some(e=>e.kind===`redirect`&&wO(e.link).some(e=>a.has(e))))return[...e];let o=e.filter((e,t)=>t!==i&&!(e.kind===`add`&&wO(e.link).some(e=>a.has(e))));if(i<0)return[...o,r];let s=[...o];return s.splice(Math.min(i,s.length),0,r),s}var kO=(e,t)=>e.filter(e=>e.key!==t),AO=(e,t)=>e.filter(e=>!t.has(e.key));function jO(e){return{deleted:e.filter(e=>e.kind===`delete`).length,added:e.filter(e=>e.kind===`add`).length,redirected:e.filter(e=>e.kind===`redirect`).length}}function MO(e){let t=jO(e);return CO.counts(t.deleted,t.added,t.redirected)}var NO=(e,t)=>e.find(e=>e.kind!==`add`&&e.delete.link===t);function PO(e){let t=e=>({interfaces:[...e.interfaces],from:e.from,to:e.to});return{edits:e.map(e=>{if(e.kind===`delete`)return{kind:`delete`,delete:t(e.delete)};let n=e.link.by===`pair`?{pair:e.link.pair}:{add:e.link.add};return e.kind===`add`?{kind:`add`,...n}:{kind:`redirect`,delete:t(e.delete),...n}})}}var FO=`staged:`;function IO(e,t){if(!t.length)return e;let n=new Set(t.flatMap(e=>e.kind===`add`?[]:[e.delete.link])),r=new Set(e.boxes.map(e=>e.id)),i=e.links.map(e=>n.has(e.id)?{...e,staged:`delete`}:e);for(let e of t){if(e.kind===`delete`)continue;let t=e.fromBox,n=e.toBox;t&&n&&t!==n&&r.has(t)&&r.has(n)&&i.push({id:`${FO}${e.key}`,from:t,to:n,type:`calls`,count:1,label:e.link.by===`pair`?CO.what.pairShort(e.link.pair.pairs.length):e.link.add.kind===`call`?e.link.add.route.trim():e.link.add.topic.trim(),async:e.link.by===`declare`&&e.link.add.kind===`topic`,gaps:[],declared:!0,staged:`add`})}return{...e,links:i}}var LO=w.editMap,RO=w.declare;function zO(e){return(0,j.jsxs)(`button`,{type:`button`,className:`btn viewer-btn arch-edit-toggle${e.on?` primary`:``}`,"aria-pressed":e.on,"aria-label":LO.toggleOf(e.count),title:LO.toggleOf(e.count),onClick:e.onToggle,children:[(0,j.jsx)(Mp,{d:`edit`}),e.count>0&&(0,j.jsx)(`span`,{className:`chip arch-edit-count`,"aria-hidden":`true`,children:e.count})]})}function BO(e){let t=e.now.state===`reading`;return(0,j.jsxs)(`div`,{className:`li-delete`,children:[e.staged?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`ev-say li-delete-ask`,role:`status`,style:{margin:0},children:LO.stage.staged(DO(e.staged))}),(0,j.jsx)(`button`,{type:`button`,className:`btn li-delete-open`,"aria-label":LO.removeOf(DO(e.staged)),onClick:e.onUnstage,children:LO.remove})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`button`,{type:`button`,className:`btn li-delete-open`,"aria-label":LO.stage.deleteOf(e.from,e.to),disabled:t,onClick:e.onDelete,children:LO.stage.delete}),(0,j.jsx)(`button`,{type:`button`,className:`btn li-delete-open`,"aria-label":LO.stage.redirectOf(e.from,e.to),disabled:t,onClick:e.onRedirect,children:LO.stage.redirect})]}),t&&(0,j.jsx)(`p`,{className:`ev-say li-delete-confirm`,role:`status`,"aria-busy":`true`,children:LO.stage.reading}),e.now.state===`error`&&(0,j.jsx)(`p`,{className:`state error li-delete-confirm`,role:`alert`,children:LO.stage.readFailed(e.now.text)})]})}function VO(e){let[t,n]=(0,v.useState)({state:`idle`}),r=async t=>{e.link.count>(e.link.joins?.length??0)&&e.callsPath&&n({state:`reading`});try{let r=await Kf(e.link,e.callsPath),i=[...new Set(r.map(e=>e.interface))];n({state:`idle`});let a=HO({...e.link,joins:[...r]},e.from,e.to,i,e.fromRepo),o=e.alsoOf?.(i)??[];t(o.length?{...a,also:o}:a)}catch(e){n({state:`error`,text:Vf(e)})}};return(0,j.jsx)(BO,{from:e.from,to:e.to,staged:e.staged,now:t,onDelete:()=>void r(t=>e.onStage({kind:`delete`,delete:t})),onRedirect:()=>void r(e.onRedirect),onUnstage:()=>e.staged&&e.onUnstage(e.staged.key)})}function HO(e,t,n,r,i){let a=e.joins??[],o=[...new Set(a.flatMap(e=>e.caller.filter(e=>!i||!e.repo||e.repo===i).map(e=>e.at)))];return{link:e.id,fromBox:e.from,toBox:e.to,from:t,to:n,interfaces:r,...i?{fromRepo:i}:{},callerLines:o,shapes:a.map(e=>({...e.method?{method:e.method}:{},...e.path?{path:e.path}:{}}))}}function UO(e,t,n){let r=n.trim();if(e&&r)return t===`call`?{kind:`call`,system:e,route:r}:{kind:`topic`,system:e,topic:r,side:t}}var WO=e=>(e??``).replace(/\{[^}]*\}/g,`{}`).replace(/\/+$/,``);function GO(e){return e.calls.filter(e=>e.status!==`paired`).map(e=>({call:e.fact,label:`${e.method?`${e.method} `:``}${e.path}`,at:e.at,api:e.confident&&e.suggestion?e.suggestion.api:``}))}function KO(e,t,n){let r=!t.callerLines?.length,i=new Set(t.callerLines??[]),a=e.facts.filter(e=>e.kind===`call`),o=(e,t)=>`${(e??``).toUpperCase()} ${WO(t)}`,s=new Map;for(let e of a){let t=o(e.claim.method,e.claim.path);s.set(t,[...s.get(t)??[],e.id])}let c=[...new Set((t.shapes??[]).map(e=>o(e.method,e.path)))],l=new Set(c.flatMap(e=>s.get(e)?.length===1?s.get(e):[])),u=r&&c.some(e=>(s.get(e)?.length??0)>1),d=a.map(e=>{let t=`${e.cite.file}:${e.cite.line}`,a=(e.claim.method??``).toUpperCase(),o=r?l.has(e.id):i.has(t),s=n.filter(t=>(t.method??``).toUpperCase()===a&&WO(t.path)===WO(e.claim.path)),c=o?n.length===1?n[0].id:s.length===1?s[0].id:``:``;return{call:e.id,label:e.label,at:t,api:c,picked:o}});return d.sort((e,t)=>Number(t.picked)-Number(e.picked)),{rows:d.map(({picked:e,...t})=>t),lineless:r,ambiguous:u}}function qO(e,t,n){let r=new Set(n?.callerLines??[]);return e.filter(e=>e.api&&!t.has(e.call)&&!r.has(e.at))}function JO(e,t,n){let r=n.filter(e=>e.api).map(e=>({call:e.call,api:e.api}));return r.length?{from:e,to:{...t},pairs:r}:void 0}function YO(e){let t=(0,v.useId)();return(0,j.jsxs)(`fieldset`,{className:`stack edit-map-pairs`,style:{border:0,padding:0,margin:0},children:[(0,j.jsx)(`legend`,{className:`hud`,children:e.caption}),e.rows.map((n,r)=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:2},children:[(0,j.jsxs)(`label`,{htmlFor:`${t}-${r}`,className:`edit-map-call`,children:[(0,j.jsx)(`span`,{className:`mono`,children:n.label}),` `,(0,j.jsx)(`span`,{className:`hud`,children:n.at})]}),(0,j.jsxs)(`select`,{id:`${t}-${r}`,className:`field`,"aria-label":LO.add.callApi(n.label),value:n.api,onChange:t=>e.onPick(n.call,t.target.value),children:[(0,j.jsx)(`option`,{value:``,children:LO.add.notPaired}),e.apis.map(e=>(0,j.jsx)(`option`,{value:e.id,children:`${e.method?`${e.method} `:``}${e.path}`},e.id))]})]},n.call))]})}var XO=(e,t)=>`/api/links/candidates?from=${encodeURIComponent(e)}&${t.repo?`to=${encodeURIComponent(t.repo)}`:`system=${encodeURIComponent(t.system)}`}`;function ZO(e){let t=e.to.link,n=P(XO(e.from,t)),r=P(e.redirect?`/api/facts/${encodeURIComponent(e.from)}`:void 0),i=n.state===`ready`&&(!e.redirect||r.state===`ready`),a=i?e.redirect&&r.state===`ready`&&n.state===`ready`?KO(r.data,e.redirect,n.data.apis):n.state===`ready`?{rows:GO(n.data),lineless:!1}:void 0:void 0,o=i?`${e.from}>${e.to.box}`:``,s=(0,v.useRef)(e.onPairs);s.current=e.onPairs,(0,v.useEffect)(()=>{a&&n.state===`ready`&&s.current(a.rows,n.data.apis.length)},[o]);let c=e.redirect?r.state:`ready`;return n.state===`loading`||c===`loading`?(0,j.jsx)(`p`,{className:`ev-say`,role:`status`,"aria-busy":`true`,style:{margin:0},children:LO.add.loading}):n.state===`error`||c===`error`?(0,j.jsx)(`p`,{className:`state error`,role:`alert`,style:{margin:0},children:LO.add.failed(n.state===`error`?n.error:r.state===`error`?r.error:``)}):!a||n.state!==`ready`?null:n.data.apis.length?e.rows.length?(0,j.jsxs)(j.Fragment,{children:[a.lineless&&(0,j.jsx)(`p`,{className:`ev-say`,role:`note`,style:{margin:0},children:`ambiguous`in a&&a.ambiguous?LO.add.linelessAmbiguous(e.fromLabel):LO.add.lineless(e.fromLabel)}),(()=>{let t=new Set(n.data.calls.filter(e=>e.status!==`paired`).map(e=>e.fact)),r=qO(e.rows,t,e.redirect);return r.length?(0,j.jsx)(`p`,{className:`ev-say`,role:`note`,style:{margin:0},children:LO.add.drawsAnother(r.map(e=>e.label).join(`, `))}):null})(),(0,j.jsx)(YO,{caption:e.redirect?LO.add.redirectCalls(e.fromLabel):LO.add.calls(e.fromLabel),rows:e.rows,apis:n.data.apis,onPick:(t,r)=>e.onPairs(e.rows.map(e=>e.call===t?{...e,api:r}:e),n.data.apis.length)})]}):(0,j.jsx)(`p`,{className:`ev-say`,role:`status`,style:{margin:0},children:LO.add.noCalls(e.fromLabel)}):(0,j.jsx)(`p`,{className:`ev-say`,role:`status`,style:{margin:0},children:LO.add.noApis(n.data.toName)})}function QO(e){let t=(0,v.useId)(),n=e.redirect?e.systems.filter(t=>e.redirect.fromRepo?t.repo===e.redirect.fromRepo:t.box===e.redirect.fromBox):e.systems,r=n.find(t=>t.box===e.redirect?.fromBox)??n[0],[i,a]=(0,v.useState)(r?.box??``),[o,s]=(0,v.useState)(`call`),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(e.redirect&&!e.redirect.fromRepo?e.redirect.toBox:``),[f,p]=(0,v.useState)([]),[m,h]=(0,v.useState)(),g=(0,v.useRef)(null);(0,v.useEffect)(()=>{e.redirect&&g.current?.focus()},[e.redirect?.link]);let _=n.find(e=>e.box===i),y=e.targets.find(e=>e.box===u),b=!!_?.repo,x=()=>{if(!_)return h(LO.add.empty);let t;if(_.repo){if(!y?.link)return h(LO.add.toPickNone);let e=JO(_.repo,y.link,f);if(!e)return h(LO.add.pickOne);t={by:`pair`,pair:e,from:_.label,to:y.label}}else{let e=UO(_.system,o,c);if(!e)return h(LO.add.empty);t={by:`declare`,add:e}}let n={fromBox:_.box,...u?{toBox:u}:{}},r=e.redirect?{kind:`redirect`,delete:e.redirect,link:t,...n}:{kind:`add`,link:t,...n},i=new Set(wO(t));if(e.staged.some(e=>e.kind!==`delete`&&e.key!==TO(r)&&wO(e.link).some(e=>i.has(e))))return h(LO.add.twice);h(void 0),l(``),e.onStage(r)},S=e.targets.filter(e=>e.box!==i&&(!b||e.link&&e.link.repo!==_?.repo));return(0,j.jsxs)(`section`,{className:`stack edit-map-add`,"aria-labelledby":`${t}-t`,children:[(0,j.jsx)(`h4`,{id:`${t}-t`,ref:g,tabIndex:-1,className:`hud`,style:{margin:0},children:e.redirect?LO.add.redirectTitle(e.redirect.from,e.redirect.to):LO.add.title}),(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:e.redirect?LO.add.redirectIntro:b?LO.add.pairIntro:LO.add.intro}),n.length?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`label`,{htmlFor:`${t}-f`,className:`hud`,children:LO.add.from}),(0,j.jsx)(`select`,{id:`${t}-f`,className:`field`,value:i,onChange:e=>{a(e.target.value),p([])},children:n.map(e=>(0,j.jsx)(`option`,{value:e.box,children:e.label},e.box))}),b?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`label`,{htmlFor:`${t}-to`,className:`hud`,children:LO.add.toPick}),(0,j.jsxs)(`select`,{id:`${t}-to`,className:`field`,value:u,onChange:e=>{d(e.target.value),p([])},children:[(0,j.jsx)(`option`,{value:``,children:LO.add.toPickNone}),S.map(e=>(0,j.jsx)(`option`,{value:e.box,children:e.label},e.box))]}),y?.link&&_?.repo&&(0,j.jsx)(ZO,{from:_.repo,fromLabel:_.label,to:y,redirect:e.redirect,rows:f,onPairs:e=>p(e)},`${_.repo}>${y.box}`)]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`fieldset`,{className:`stack`,style:{border:0,padding:0,margin:0},children:[(0,j.jsx)(`legend`,{className:`hud`,children:LO.add.kind}),[`call`,`publishes`,`listens`].map(e=>(0,j.jsxs)(`label`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`input`,{type:`radio`,name:`${t}-k`,checked:o===e,onChange:()=>s(e)}),RO.kinds[e]]},e))]}),(0,j.jsx)(`label`,{htmlFor:`${t}-v`,className:`hud`,children:o===`call`?RO.route:RO.topic}),(0,j.jsx)(`input`,{id:`${t}-v`,className:`field`,value:c,...m?{"aria-invalid":!0,"aria-describedby":`${t}-e`}:{},onChange:e=>l(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),x())}}),(0,j.jsx)(`label`,{htmlFor:`${t}-to`,className:`hud`,children:LO.add.to}),(0,j.jsxs)(`select`,{id:`${t}-to`,className:`field`,value:u,onChange:e=>d(e.target.value),children:[(0,j.jsx)(`option`,{value:``,children:LO.add.toNone}),S.map(e=>(0,j.jsx)(`option`,{value:e.box,children:e.label},e.box))]})]}),m&&(0,j.jsx)(`p`,{id:`${t}-e`,role:`alert`,className:`state error`,style:{margin:0},children:m}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,onClick:x,children:LO.add.stage}),e.onCancel&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:e.onCancel,children:LO.add.cancel})]})]}):(0,j.jsx)(`p`,{className:`ev-say`,role:`status`,style:{margin:0},children:e.redirect?LO.add.redirectNoRepo:LO.add.fromNone})]})}async function $O(e,t=Qn,n){try{let r=await t(`/api/map/edits`,PO(e),void 0,n),i=r.result?.callers??[],a=r.result?.waitsOn??[];return{state:`done`,n:e.length,callers:[...i],waitsOn:[...a]}}catch(t){if(t instanceof M&&t.problem.problems?.length)return{state:`problems`,problems:t.problem.problems.map(e=>({edit:e.edit,message:e.message}))};let n=t instanceof Zn?t.result:void 0,r=n?.edits??[];if(r.length&&r.every(e=>e.state===`saved`)&&n?.built===!1){let t=n.refused;return{state:`saved`,n:e.length,...t?{refused:t}:{}}}return{state:`failed`,text:Vf(t),...r.length?{outcomes:r.map(e=>({edit:e.edit,state:LO.outcome[e.state]??e.state,...e.message?{message:e.message}:{}}))}:{}}}}var ek=e=>({kind:`repos`,repos:[...e],force:!0});function tk(e){let t=Vt(),n=[e.waitsOn.length?LO.doneWaits(e.n,e.waitsOn.join(`, `)):LO.done(e.n),e.callers.length?t?.allowed?LO.reReadWhy(e.callers.join(`, `)):LO.reReadNoCopilot(e.callers.join(`, `)):LO.reReadNone].join(` `);return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,j.jsx)(`p`,{className:`ev-say`,role:`status`,style:{margin:0},children:n}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`},children:[e.callers.length>0&&(0,j.jsx)(Xt,{ask:ek(e.callers),label:LO.reRead,className:`btn primary`}),(0,j.jsx)(An,{id:e.job})]})]})}function nk(e){let t=(0,v.useId)(),n=e.apply,r=(0,v.useRef)(null),i=(0,v.useRef)(null),a=(0,v.useRef)(null),o=(0,v.useRef)(n.state);(0,v.useEffect)(()=>{let e=o.current;o.current=n.state,n.state===`confirm`?r.current?.focus():e===`confirm`&&n.state===`idle`?i.current?.focus():(e===`confirm`||e===`working`)&&a.current?.focus()},[n.state]);let s=e.staged.length,c=n.state===`working`,l=new Map;if(n.state===`problems`)for(let e of n.problems)l.set(e.edit,e.message);if(n.state===`failed`)for(let e of n.outcomes??[])l.set(e.edit,e.message?`${e.state}, ${e.message}`:e.state);return(0,j.jsxs)(`section`,{className:`stack edit-map`,"aria-labelledby":`${t}-t`,children:[(0,j.jsx)(`h3`,{id:`${t}-t`,ref:a,tabIndex:-1,className:`h`,style:{margin:0},children:LO.title}),n.state===`done`?(0,j.jsx)(tk,{n:n.n,callers:n.callers,waitsOn:n.waitsOn,job:e.job}):n.state===`saved`&&!s?(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[n.refused?(0,j.jsx)(Hc,{refused:n.refused}):(0,j.jsx)(`p`,{className:`ev-say`,role:`status`,style:{margin:0},children:w.panelResults.waitsBuild}),(0,j.jsx)(An,{id:e.job})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:LO.intro}),s?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`hud`,"aria-live":`polite`,style:{margin:0},children:MO(e.staged)}),(0,j.jsx)(`ul`,{className:`stack edit-map-list`,"aria-label":LO.listLabel,children:e.staged.map((t,r)=>(0,j.jsxs)(`li`,{className:`stack edit-map-row k-${t.kind}`,children:[(0,j.jsxs)(`div`,{className:`row edit-map-line`,children:[(0,j.jsx)(`span`,{className:`edit-map-what`,children:DO(t)}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,"aria-label":LO.removeOf(DO(t)),disabled:c||n.state===`confirm`,onClick:()=>e.onRemove(t.key),children:LO.remove})]}),l.has(r)&&(0,j.jsx)(`span`,{className:`edit-map-why state error`,children:l.get(r)})]},t.key))})]}):(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:LO.empty}),n.state===`confirm`?(0,j.jsxs)(`div`,{className:`stack edit-map-confirm`,role:`group`,"aria-labelledby":`${t}-q`,style:{gap:6},children:[(0,j.jsx)(`p`,{id:`${t}-q`,className:`li-delete-ask`,style:{margin:0},children:LO.confirm.title(s)}),(0,j.jsx)(`ol`,{className:`stack`,style:{margin:0,paddingLeft:18},children:e.staged.map(e=>(0,j.jsx)(`li`,{children:DO(e)},e.key))}),(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:LO.confirm.intro}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,ref:r,onClick:e.onConfirm,children:LO.confirm.yes}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:e.onBack,children:LO.confirm.back})]})]}):(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,ref:i,disabled:!s||c,"aria-busy":c,onClick:e.onApply,children:LO.apply}),(0,j.jsx)(An,{id:e.job})]}),c&&(0,j.jsx)(`p`,{className:`ev-say`,role:`status`,"aria-busy":`true`,style:{margin:0},children:LO.working}),n.state===`saved`&&(n.refused?(0,j.jsx)(Hc,{refused:n.refused}):(0,j.jsx)(`p`,{className:`ev-say`,role:`status`,style:{margin:0},children:w.panelResults.waitsBuild})),n.state===`problems`&&(0,j.jsx)(`p`,{className:`state error`,role:`alert`,style:{margin:0},children:LO.problemsLine(n.problems.length)}),n.state===`failed`&&(0,j.jsx)(`p`,{className:`state error`,role:`alert`,style:{margin:0},children:n.outcomes?LO.failedLine:LO.failed(n.text)}),!c&&n.state!==`confirm`&&e.add]})]})}function rk(e){let[t,n]=(0,v.useState)({state:`idle`}),[r,i]=(0,v.useState)(),a=e.staged.length;return(0,v.useEffect)(()=>{a>0&&n(e=>e.state===`done`||e.state===`saved`?{state:`idle`}:e)},[a]),(0,j.jsx)(nk,{staged:e.staged,apply:t,job:r,...e.add?{add:e.add}:{},onRemove:r=>{e.onRemove(r),t.state!==`working`&&n({state:`idle`})},onApply:()=>n({state:`confirm`}),onBack:()=>n({state:`idle`}),onConfirm:()=>{n({state:`working`});let t=new Set(e.staged.map(e=>e.key));$O(e.staged,Qn,i).then(r=>{n(r),(r.state===`done`||r.state===`saved`)&&e.onApplied(t)})}})}function ik(e){let t=w.why.dependency;if(e.every.state===`loading`)return(0,j.jsx)(`p`,{role:`status`,"aria-busy":`true`,className:`ev-say`,children:t.moreLoading});if(e.every.state===`error`)return(0,j.jsx)(`p`,{role:`alert`,className:`state error`,children:t.moreFailed(e.every.error)});let n=new Set((e.link.joins??[]).map(e=>e.interface)),r=e.every.data.joins.filter(e=>!n.has(e.interface));return r.length?(0,j.jsx)(`div`,{className:`stack`,style:{gap:8},children:r.map(t=>(0,j.jsx)(ZD,{join:t,children:e.under?.(t)},t.interface))}):null}function ak(e){let t=P(e.path);return(0,j.jsx)(ik,{link:e.link,every:t,...e.under?{under:e.under}:{}})}var ok=[`architecture`,`repo`,`data`,`integration`,`infrastructure`],sk=(e,t)=>`/api/graph/node/${encodeURIComponent(e)}?lens=${t}`;function ck(e){return(0,j.jsx)(tD,{children:(0,j.jsx)(pk,{...e})})}var lk=[],uk=e=>e.ready&&e.drawn?`/api/contracts`:void 0;function dk(e){return[e.adding?`add`:``,e.editing?`edit`:``,e.pickedBox?`box:${e.pickedBox}`:``,e.connecting?.from??``,e.declaring?.system??``,e.owning??``,e.pickedLink?.id??``].filter(Boolean).join(`|`)}var fk=class extends Error{};function pk({hash:e,screen:t=`architecture`}){let n=Nn(e,`lens`),r=ok.includes(n??``)?n:`architecture`,i=Nn(e,`node`),[a,o]=(0,v.useState)(new Map),s=QE(),c=jf(a).join(` `);(0,v.useEffect)(()=>{for(let e of c.split(` `).filter(Boolean))s?.need(e)},[c,s]);let[l,u]=(0,v.useState)({state:`loading`}),[d,f]=(0,v.useState)(),[p,m]=(0,v.useState)(),h=e=>{let t=e instanceof Error?e.message:String(e);u(e=>e.state===`ready`?e:{state:`error`,error:t}),f(t)},[g,_]=(0,v.useState)(!1);(0,v.useEffect)(()=>{l.state===`ready`&&p&&_(!0)},[l.state,p]);let y=P(uk({ready:l.state===`ready`,drawn:g})),b=y.state===`ready`?y.data.findings:lk,x=(0,v.useMemo)(()=>Af(kf(a,e=>{let t=s?.of(e);return t?.state===`ready`?t.data:void 0}),b),[a,s,b]),[S,C]=(0,v.useState)(`estate`),[T,E]=(0,v.useState)(new Set([`estate`])),[D,ee]=(0,v.useState)(),[te,ne]=(0,v.useState)(),O=e=>{ee(e),ne(e)},[re,k]=(0,v.useState)(),[A,ie]=(0,v.useState)(),[ae,oe]=(0,v.useState)(),[ce,le]=(0,v.useState)(!1),[ue,de]=(0,v.useState)(),[fe,pe]=(0,v.useState)(new Set),[me,he]=(0,v.useState)({state:`loading`,key:``}),[ge,_e]=(0,v.useState)(0),[ve,ye]=(0,v.useState)({state:`idle`}),be=(0,v.useRef)(new Map),xe=(0,v.useRef)(0),[Se,Ce]=(0,v.useState)(),[we,Te]=(0,v.useState)(),[Ee,De]=(0,v.useState)(),[Oe,ke]=(0,v.useState)(!1),[Ae,je]=(0,v.useState)(!1),[Me,Ne]=(0,v.useState)([]),[Pe,Fe]=(0,v.useState)(),Ie=(0,v.useRef)(Tt()).current,Le=()=>{Ie.drop(),de(void 0)},Re=(0,v.useCallback)(async(e,t)=>{let n=xe.current,i=await N(sk(e,r));if(n!==xe.current)throw new fk;return o(n=>new Map(t??n).set(e,i)),i},[r]);(0,v.useEffect)(()=>{let e=!0;return xe.current++,$e(void 0),Ze(e=>e.compareWith?{...e,compareWith:void 0}:e),u({state:`loading`}),f(void 0),C(`estate`),E(new Set([`estate`])),ee(void 0),ne(void 0),Te(void 0),ke(!1),de(void 0),pe(new Set),Re(`estate`,new Map).then(async()=>{let t=i&&i!==`estate`?await Re(i).catch(()=>void 0):void 0;if(t&&e){let e=Rf(t);await Promise.all(e.expanded.filter(e=>e!==`estate`&&e!==t.node.id).map(e=>Re(e).catch(()=>void 0))),E(new Set(e.expanded)),C(e.current),ee(e.selected)}e&&u({state:`ready`})},t=>e&&u({state:`error`,error:t instanceof Error?t.message:String(t),...t instanceof M&&t.problem.notYet?{notYet:!0}:{}})),()=>{e=!1}},[Re,i]);let ze=()=>{for(let e of x.keys())Re(e).catch(()=>void 0)};St(e=>{e.type===`file.changed`&&typeof e.path==`string`&&e.path.startsWith(`catalog`)&&ze()});let Be=e=>{if(ue){if(ue.node.id===e)return ue.node;let t=ue.neighbours.find(t=>t.id===e);if(t)return t}for(let t of x.values()){if(t.node.id===e)return t.node;let n=t.children.find(t=>t.id===e)??t.outside.find(t=>t.id===e);if(n)return n}},Ve=async e=>{let t=xe.current;try{let n=await Re(e),r=Rf(n);if(await Promise.all(r.expanded.filter(e=>e!==`estate`&&e!==n.node.id).map(e=>Re(e).catch(()=>void 0))),xe.current!==t)return;E(new Set(r.expanded)),C(r.current),ee(r.selected),Le(),pe(new Set)}catch(e){if(e instanceof fk||xe.current!==t||e instanceof M&&e.problem.status===404)return;u({state:`error`,error:e instanceof Error?e.message:String(e)})}},He=async e=>{let t=Be(e);if(!t||t.childCount===0)ee(e),f(void 0);else try{x.has(e)||await Re(e),E(t=>new Set(t).add(e)),C(e),ee(e),f(void 0),Le(),pe(new Set)}catch(e){if(e instanceof fk)return;h(e)}},Ue=e=>{E(t=>{let n=new Set(t);return n.delete(e),n});let t=Be(e)?.parent;S===e&&t?(C(t),pe(new Set)):Ge(e),Le()},We=async e=>{if(fe.has(e))return Ge(e);try{x.has(e)||await Re(e),pe(t=>new Set(t).add(e)),E(t=>new Set(t).add(e)),ee(e),f(void 0)}catch(e){if(e instanceof fk)return;h(e)}},Ge=e=>pe(t=>{let n=new Set(t),r=t=>{for(let n=Be(t)?.parent;n;n=Be(n)?.parent)if(n===e)return!0;return!1};for(let i of t)(i===e||r(i))&&n.delete(i);return n}),Ke=async e=>{let t=xe.current,n=Ie.start(),i=()=>n()&&xe.current===t;try{let t=await N(`/api/graph/focus/${encodeURIComponent(e)}?lens=${r}`);if(!i())return;de(t),ee(e),f(void 0)}catch(e){if(!i())return;h(e)}},qe=(0,v.useMemo)(()=>xf(x,`estate`,T),[x,T]),Je=x.get(S),Ye=(0,v.useMemo)(()=>Nf(x,S,fe,ue),[x,S,fe,ue]),[Xe,Ze]=(0,v.useState)({layers:Zf,mismatches:!1,filter:``,overlay:`none`}),[Qe,$e]=(0,v.useState)(),et=(0,v.useId)(),[tt,nt]=(0,v.useState)(!1),rt=(0,v.useRef)(null),[it,at]=(0,v.useState)(null),ot=P(`/api/component-types`),st=(0,v.useMemo)(()=>ot.state===`ready`?Object.fromEntries(ot.data.types.map(e=>[e.id,{name:e.name,description:e.description,...e.draws?.badge?{badge:e.draws.badge}:{},...e.draws?.colour?{colour:e.draws.colour}:{},...e.draws?.shape?{shape:e.draws.shape}:{}}])):void 0,[ot]),ct=P(Xe.overlay===`questions`?`/api/questions?state=open`:void 0),lt=(0,v.useCallback)(e=>Be(e)?.properties,[x,ue]),ut=(0,v.useMemo)(()=>{let e=ap(np(Ye,Xe.layers,{...Xe.mismatches?{mismatches:new Set(Ye.links.filter(e=>e.gaps.some(e=>e===`contract-mismatch`)).map(e=>e.id))}:{}}),Xe.filter,lt);if(Xe.compareWith){let t=up(Xe.compareWith,Ye),n=new Set(t.added.map(e=>e.id));e={...e,links:e.links.map(e=>n.has(e.id)?{...e,mark:`new`}:e)}}if(Xe.overlay!==`none`){let t=ct.state===`ready`?ct.data.counts?.byRepo??{}:{};e={...e,boxes:e.boxes.map(e=>e.group?e:Xe.overlay===`gaps`?e.gaps.length?{...e,badge:{n:e.gaps.length,what:U.gapsBadge(e.gaps.length)}}:e:e.kind===`repo`&&ct.state===`ready`&&t[e.label]?.open?{...e,badge:{n:t[e.label].open,what:w.canvasTools.questionsBadge(t[e.label].open)}}:e)}}return Me.length&&(e=IO(e,Me)),e},[Ye,Xe,lt,ct,Me]),dt=(0,v.useMemo)(()=>Xe.radius&&D?new Set(op(ut.links,D,Xe.radius.depth,Xe.radius.dir).keys()):void 0,[Xe.radius,D,ut.links]),ft=ue?ue.node.id:S,pt=`${ft}|${ue?`f`:`n`}`,mt=(0,v.useRef)(pt);(0,v.useEffect)(()=>{mt.current!==pt&&(mt.current=pt,$e(void 0),Ze(e=>e.compareWith?{...e,compareWith:void 0}:e))},[pt]);let ht=Lf(r,ft,ue?`focus`:`node`);(0,v.useEffect)(()=>{let e=!0;return he({state:`loading`,key:ht}),ye({state:`idle`}),m(void 0),N(`/api/graph/layout/${encodeURIComponent(ht)}`).then(t=>e&&he({state:`ready`,key:ht,pinned:t.positions,moved:0}),t=>e&&he({state:`error`,key:ht,error:t instanceof Error?t.message:String(t)})),()=>{e=!1}},[ht]);let gt=async(e,t)=>{ye({state:`saving`});try{let n=await N(`/api/graph/layout/${encodeURIComponent(ht)}`,{method:`PUT`,body:{lens:r,node:ft,positions:e}});return he({state:`ready`,key:ht,pinned:n.positions,moved:0}),ye({state:`done`,text:t||U.kept(n.path)}),!0}catch(e){return ye({state:`error`,text:U.keepFailed(e instanceof Error?e.message:String(e))}),!1}},_t=me.state===`ready`?me.pinned:{},vt=!ue&&Je?If(p?.over??[],Je.suggest,fe,Je.children):void 0,yt=(e,t)=>{let n=Sf(qe,e,t.key);n&&(t.preventDefault(),`focus`in n?be.current.get(n.focus)?.focus():`open`in n?He(n.open):`close`in n?Ue(n.close):O(n.select))},bt=D?Be(D):void 0,xt=we?[...ue?.edges??[],...[...x.values()].flatMap(e=>e.edges)].find(e=>e.id===we.id):void 0,Ct=bk(x),{fromChoices:wt,toChoices:Et}=yk(x),Dt=(e,t)=>{let n=new Set(e),r=new Map;for(let e of[...ue?.edges??[],...[...x.values()].flatMap(e=>e.edges)])e.id!==t&&(e.joins??[]).some(e=>n.has(e.interface))&&r.set(e.id,`${Be(e.from)?.label??e.from} → ${Be(e.to)?.label??e.to}`);return[...r.values()]},Ot=VD(a),kt=Se?WD(Se.before,a,Se.calls):[],At=e=>(0,j.jsx)(yO,{join:e,known:Ot,onSaved:e=>Ce(t=>({calls:[...new Set([...t?.calls??[],e])],before:t?.before??a}))}),jt=e=>{let t=encodeURIComponent(e.id);if(ue?.edges.some(t=>t.id===e.id))return`/api/graph/edge-calls?focus=${encodeURIComponent(ue.node.id)}&lens=${r}&edge=${t}`;for(let n of x.values())if(n.edges.some(t=>t.id===e.id))return`/api/graph/edge-calls?node=${encodeURIComponent(n.node.id)}&lens=${r}&edge=${t}`},I=e=>e.type===`depends-on`?e.count>(e.joins?.length??0)&&jt(e)?(0,j.jsx)(ak,{link:e,path:jt(e),under:At}):null:(0,j.jsx)(xO,{link:e,known:Ot,labelOf:e=>Be(e)?.label??e,...jt(e)?{callsPath:jt(e)}:{},onSaved:e=>Ce(t=>({calls:[...new Set([...t?.calls??[],...e])],before:t?.before??a}))}),Mt=Je?[...Je.path,Je.node]:[],Nt=l.state===`ready`&&!!Je&&ut.boxes.length>0&&me.state===`ready`&&me.key===ht,Pt=dk({adding:ce,connecting:re,declaring:ae,owning:A,pickedLink:we,pickedBox:te,editing:Ae});return(0,j.jsxs)(`div`,{className:`bento`,children:[(0,j.jsx)(rl,{}),(0,j.jsxs)(`section`,{className:`panel arch-work`,"aria-labelledby":`${et}-h`,style:{gridColumn:`1 / -1`},children:[(0,j.jsx)(`h2`,{id:`${et}-h`,className:`sr`,children:U.title}),(0,j.jsx)(Pp,{lenses:ok.map(e=>({id:e,label:U.lenses[e]})),lens:r,onLens:e=>Pn(t,`lens`,e,{drop:[`node`]}),crumbs:(0,j.jsx)(`nav`,{"aria-label":U.breadcrumbs,className:`arch-crumbs`,children:(0,j.jsx)(`ol`,{children:Mt.map((e,t)=>(0,j.jsxs)(`li`,{children:[t>0&&(0,j.jsx)(`span`,{"aria-hidden":`true`,children:`/`}),t===Mt.length-1&&!ue?(0,j.jsx)(`span`,{className:`chip`,"aria-current":`location`,children:e.label}):(0,j.jsx)(`button`,{type:`button`,className:`btn`,"aria-current":t===Mt.length-1?`location`:void 0,onClick:()=>{e.id!==S&&pe(new Set),C(e.id),Le()},children:e.label})]},e.id))})}),onAdd:()=>le(!0),edit:(0,j.jsx)(zO,{on:Ae,count:Me.length,onToggle:()=>{je(e=>!e),Fe(void 0)}}),tools:{open:tt,bodyId:`${et}-tools`,onToggle:()=>nt(e=>!e),shown:ut.boxes.length,all:Ye.boxes.length,buttonRef:rt},...l.state===`ready`&&Je?{arrangement:(0,j.jsx)(Sk,{ready:me.state===`ready`,saving:ve.state===`saving`,moved:me.state===`ready`?me.moved:0,...ue?{onFocusOff:()=>Le()}:{},onKeep:()=>{Object.keys(_t).length?gt(_t,``):ye({state:`error`,text:U.keptNothing})},onTidy:()=>_e(e=>e+1),onReset:()=>void gt({},U.resetDone).then(e=>e&&_e(e=>e+1))})}:{},status:(0,j.jsxs)(j.Fragment,{children:[g&&y.state===`loading`&&(0,j.jsx)(`span`,{className:`hud`,role:`status`,"aria-live":`polite`,children:U.joiningEstate}),y.state===`error`&&(0,j.jsx)(`span`,{className:`hud`,role:`status`,children:U.contractsFailed(y.error)}),ve.state===`done`&&(0,j.jsx)(`span`,{className:`hud`,role:`status`,children:ve.text})]}),viewSlot:at}),l.state===`loading`&&(0,j.jsxs)(`div`,{className:`stack`,"aria-busy":`true`,"aria-live":`polite`,children:[(0,j.jsx)(`p`,{className:`hud`,children:U.readingEstate}),(0,j.jsx)(`div`,{className:`skeleton`,style:{width:`80%`}}),(0,j.jsx)(`div`,{className:`skeleton`,style:{width:`60%`}})]}),l.state===`error`&&(l.notYet?(0,j.jsx)(hl,{text:U.emptyEstate}):(0,j.jsx)(`div`,{className:`state error`,role:`alert`,children:U.loadFailed(l.error)})),l.state===`ready`&&d&&(0,j.jsxs)(`div`,{className:`state error`,role:`alert`,style:{marginBottom:8},children:[U.stepFailed(d),` `,(0,j.jsx)(`button`,{type:`button`,className:`link`,onClick:()=>f(void 0),children:U.dismiss})]}),ve.state===`error`&&(0,j.jsx)(`p`,{className:`state error`,role:`alert`,children:ve.text}),l.state===`ready`&&Je&&(0,j.jsxs)(j.Fragment,{children:[vt&&(0,j.jsxs)(`div`,{className:`state arch-notice`,role:`status`,children:[(0,j.jsxs)(`p`,{children:[vt.why===`nodes`?U.legible.nodes(p?.score.nodes??0):U.legible[vt.why],` `,U.legible[vt.mode]]}),vt.mode===`focus`&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>void Ke(vt.id),children:U.focus}),vt.mode===`collapse`&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>pe(new Set),children:U.collapseAll}),vt.mode===`group`&&vt.id&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>void He(vt.id),children:U.openPart(Be(vt.id)?.label??vt.id)})]}),ut.shared&&ut.shared.length>0&&(0,j.jsxs)(`p`,{className:`arch-shared`,children:[(0,j.jsx)(`span`,{"aria-hidden":`true`,children:`⚠ `}),U.sharedGaps(ut.shared.map(e=>U.gap[e]??e).join(`; `))]}),ep(Xe.layers)&&!ut.links.length&&ut.boxes.length>0&&(0,j.jsx)(`p`,{className:`state`,role:`status`,children:w.canvasAi.noneOnly}),(0,j.jsx)(`p`,{className:`sr`,role:`status`,"aria-live":`polite`,children:Oe?w.canvasAi.corrected:``}),(0,j.jsxs)(`div`,{className:`arch-stage-wrap${Nt?``:` flat`}`,children:[(0,j.jsx)(wp,{drawer:{open:tt,bodyId:`${et}-tools`,onClose:()=>{nt(!1),rt.current?.focus()}},graph:ut,...st?{types:st}:{},allBoxes:Ye.boxes.length,state:Xe,onChange:Ze,...D?{selected:D}:{},onSelect:O,onPickLink:e=>{Te({id:e,keyboard:!0}),ke(!1)},labelOf:e=>Be(e)?.label??e,placed:e=>p?.boxes[e],lens:r,node:ft,...Xe.overlay===`questions`&&ct.state!==`ready`?{overlayNote:ct.state===`error`?w.canvasTools.overlayFailed(ct.error):w.canvasTools.overlayLoading}:{},onOpenView:(e,n)=>{if(e!==r){let r=new URLSearchParams(window.location.hash.split(`?`)[1]??``);r.set(`lens`,e),r.set(`node`,n),window.location.hash=`#/${t}?${r.toString()}`}else Ve(n)},...Xe.compareWith?(()=>{let e=up(Xe.compareWith,Ye);return{compared:{added:e.added.length,removed:e.removed}}})():{},...Qe?{snapshot:Qe}:{},onLinkBack:ze,onSnapshot:()=>{let e=lp(Ye,new Date().toLocaleTimeString());$e(e),Ze(t=>t.compareWith?{...t,compareWith:e}:t)},name:ht}),ut.boxes.length?me.state===`error`?(0,j.jsx)(`div`,{className:`state error`,role:`alert`,children:U.loadFailed(me.error)}):me.state===`loading`||me.key!==ht?(0,j.jsxs)(`div`,{className:`stack`,"aria-busy":`true`,"aria-live":`polite`,children:[(0,j.jsx)(`p`,{className:`hud`,children:U.layingOutBoxes(ut.boxes.length)}),(0,j.jsx)(`div`,{className:`skeleton`,style:{width:`70%`}})]}):(0,j.jsx)(UE,{graph:ut,...st?{types:st}:{},direction:Pf(r),pinned:_t,tidy:ge,...D?{selected:D}:{},onSelect:O,onToggle:e=>void We(e),onMoved:(e,t)=>he(n=>n.state===`ready`?{...n,pinned:{...n.pinned,[e]:{x:t.x,y:t.y}},moved:n.moved+ +!n.pinned[e]}:n),onLaid:m,...dt?{lit:dt}:{},onSelectLink:e=>{e.startsWith(`staged:`)||(Te({id:e,keyboard:!1}),ke(!1))},...we?{selectedLink:we.id}:{},onConnect:(e,t)=>{let n=_k(Be(e),Be(t));if(`say`in n)return se({text:n.say});k(n)},aside:(0,j.jsx)(Rc.Provider,{value:!0,children:(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsx)(`h2`,{className:`h`,children:U.inspector}),Ae&&(0,j.jsx)(rk,{staged:Me,onRemove:e=>Ne(t=>kO(t,e)),onApplied:e=>{Ne(t=>AO(t,e)),Fe(void 0),ze()},add:(0,j.jsx)(QO,{systems:wt,targets:Et,staged:Me,...Pe?{redirect:Pe,onCancel:()=>Fe(void 0)}:{},onStage:e=>{Ne(t=>OO(t,e)),Fe(void 0)}},Pe?.link??`add`)}),we&&(0,j.jsx)(eO,{link:xt,labelOf:e=>Be(e)?.label??e,under:At,above:I,contracts:b,autoFocus:we.keyboard,deleteLink:e=>Ae?(0,j.jsx)(VO,{link:e,fromRepo:vk(Be(e.from))?.repo,from:Be(e.from)?.label??e.from,to:Be(e.to)?.label??e.to,...jt(e)?{callsPath:jt(e)}:{},staged:NO(Me,e.id),onStage:e=>Ne(t=>OO(t,e)),onRedirect:Fe,onUnstage:e=>Ne(t=>kO(t,e)),alsoOf:t=>Dt(t,e.id)}):(0,j.jsx)(qf,{link:e,alsoOf:t=>Dt(t,e.id),from:Be(e.from)?.label??e.from,to:Be(e.to)?.label??e.to,...jt(e)?{callsPath:jt(e)}:{},onDeleted:t=>{De({link:e.id,from:t.from,to:t.to,interfaces:new Set(t.interfaces)}),ze()}}),...Ee?.link===we.id?{gone:(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsx)(`p`,{className:`state`,role:`status`,children:w.deleteLink.done(Ee.from,Ee.to)}),(0,j.jsx)(Yf,{only:Ee.interfaces,onBack:ze})]})}:{},onClose:()=>Te(void 0),onCorrected:()=>{ze(),ke(!0)}},we.id),bt?(0,j.jsx)(xk,{node:bt,isCurrent:bt.id===S,onOpen:He,onFocus:Ke,lens:r,links:(ue?.edges??Je.edges).filter(e=>e.from===bt.id||e.to===bt.id),labelOf:e=>Be(e)?.label??e,under:At,above:I,contracts:b,...vk(bt)?.repo?{onConnect:()=>k({from:vk(bt).repo}),onOwner:()=>ie(vk(bt).repo)}:vk(bt)?.system?{onDeclare:()=>oe({system:vk(bt).system,label:bt.label})}:{},...!ue&&ut.boxes.some(e=>e.id===bt.id)?{here:{open:fe.has(bt.id),toggle:()=>void We(bt.id)}}:{}}):(0,j.jsx)(`p`,{children:U.pick}),re&&(0,j.jsx)(Bd,{from:re.from,boxes:Ct.filter(e=>e.box.repo!==re.from),...re.initial?{initial:re.initial}:{},onClose:()=>k(void 0)},`${re.from}:${re.initial?.box.repo??re.initial?.box.system??``}`),ae&&(0,j.jsx)(af,{system:ae.system,label:ae.label,onClose:()=>oe(void 0)},ae.system),ce&&(0,j.jsx)(cf,{onClose:()=>le(!1)}),A&&(0,j.jsx)(Yd,{repo:A,onClose:()=>ie(void 0)},A),Se&&(0,j.jsx)(SO,{moved:kt})]})}),asideBeside:!0,reveal:Pt,asideIdle:!Pt&&!D,toolbarIn:it,overlay:(0,j.jsx)(zp,{meta:U.edges(ut.links.length,ue?0:Je.hiddenEdges),links:ut.links})},ht):(0,j.jsx)(`div`,{className:`state`,children:U.empty})]}),(0,j.jsx)(`p`,{className:`hud`,style:{marginTop:8},children:U.canvasHelp})]})]}),l.state===`ready`&&Je&&(0,j.jsx)(j.Fragment,{children:(0,j.jsxs)(F,{title:U.outline,span:`1 / -1`,children:[(0,j.jsx)(`p`,{className:`hud`,id:`outline-help`,children:U.outlineHelp}),(0,j.jsx)(`ul`,{role:`tree`,"aria-describedby":`outline-help`,style:{listStyle:`none`,padding:0},children:qe.map(e=>(0,j.jsx)(`li`,{role:`treeitem`,"aria-level":e.depth+1,"aria-expanded":e.node.childCount>0?e.expanded:void 0,"aria-selected":e.node.id===D,style:{paddingLeft:e.depth*18},children:(0,j.jsxs)(`button`,{type:`button`,className:`btn ${e.node.id===S?`primary`:``}`,ref:t=>{t?be.current.set(e.node.id,t):be.current.delete(e.node.id)},onKeyDown:t=>yt(e.node.id,t),onClick:()=>O(e.node.id),onDoubleClick:()=>void(e.expanded?Ue(e.node.id):He(e.node.id)),children:[(0,j.jsx)(`span`,{className:`hud`,children:e.node.kind}),` `,e.node.label,e.node.childCount>0&&` · ${U.children(e.node.childCount)}`,e.gaps.length>0&&` · ${U.gaps}: ${e.gaps.map(e=>U.gap[e]??e).join(`, `)}`,e.inside.length>0&&` · ${U.insideGaps(e.inside.map(e=>U.gap[e]??e).join(`, `))}`]})},e.node.id))})]})})]})}var mk=e=>{let t=e.properties.repos,n=e.properties.boundary;return n===`outside`||n===`vendor`||!(Array.isArray(t)&&t.length>0)&&n!==`product`};function hk(e){let t=vk(e);if(!t?.system||!e||mk(e))return t;let n=e.properties.repos;return Array.isArray(n)&&n.length===1?{repo:String(n[0])}:void 0}var gk=(e,t)=>t.repo&&e.kind!==`repo`?{label:`${U.kindWord.repo}: ${t.repo}`,box:t}:{label:`${U.kindWord[e.kind]??e.kind}: ${e.label}`,box:t};function _k(e,t){let n=hk(e),r=hk(t),i=t;return n?.system&&r?.repo&&([n,r]=[r,n],i=e),!n?.repo||!r||!i?{say:w.connect.dropNeedsRepo}:r.repo===n.repo?{say:w.connect.dropSameRepo}:{from:n.repo,initial:gk(i,r)}}function vk(e){if(e){if(e.kind===`repo`)return{repo:e.label};if(e.kind===`component`&&typeof e.properties.repo==`string`)return{repo:e.properties.repo};if(e.kind===`system`&&e.id.startsWith(`system:`))return{system:e.id.slice(7)}}}function yk(e){let t=new Map,n=new Map;for(let r of e.values())for(let e of[r.node,...r.children,...r.outside]){if(e.kind!==`repo`&&e.kind!==`system`&&e.kind!==`component`)continue;let r=`${U.kindWord[e.kind]??e.kind}: ${e.label}`,i=hk(e);n.set(e.id,{box:e.id,label:r,...i?{link:i}:{}});let a=vk(e);e.kind===`system`&&a?.system?t.set(e.id,{box:e.id,system:a.system,label:r}):a?.repo&&t.set(e.id,{box:e.id,repo:a.repo,label:r})}let r=e=>[...e.values()].sort((e,t)=>e.label<t.label?-1:+(e.label>t.label));return{fromChoices:r(t),toChoices:r(n)}}function bk(e){let t=new Map;for(let n of e.values())for(let e of[n.node,...n.children,...n.outside]){if(e.kind!==`repo`&&e.kind!==`system`)continue;let n=hk(e);if(!n)continue;let r=n.repo?`r:${n.repo}`:`s:${n.system}`;(!t.has(r)||e.kind===`repo`)&&t.set(r,gk(e,n))}return[...t.values()].sort((e,t)=>e.label<t.label?-1:1)}function xk({node:e,isCurrent:t,lens:n,onOpen:r,onFocus:i,here:a,links:o=[],labelOf:s=e=>e,under:c,above:l,contracts:u,onConnect:d,onOwner:f,onDeclare:p}){let m=vk(e),h=Object.entries(e.properties).filter(([t,n])=>t!==`name`||n!==e.label).map(([e,t])=>[e,Array.isArray(t)?t.join(`, `):String(t)]),g=[e.childCount>0&&!t&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>r(e.id),children:U.open},`open`),e.childCount>0&&a&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:a.toggle,children:a.open?U.closeHere:U.openHere},`here`),e.kind!==`estate`&&(n===`data`||e.kind===`table`)&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>i(e.id),children:U.focus},`focus`),d&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:d,children:w.connect.open},`connect`),f&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:f,children:w.owner.open},`owner`),p&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:p,children:w.declare.open},`declare`)].filter(Boolean),_=[e.kind===`repo`&&(0,j.jsx)(`a`,{className:`btn`,href:`#/flows?repo=${encodeURIComponent(e.label)}`,children:w.flows.openFlows},`flows`),e.kind===`repo`&&(0,j.jsx)(`a`,{className:`btn`,href:`#/trust`,children:U.repoCounts},`trust`),e.kind===`system`&&e.id.startsWith(`system:`)&&e.record&&(0,j.jsx)(`a`,{className:`btn`,href:_d(e.id.slice(7)),children:w.systems.openPage},`page`)].filter(Boolean);return(0,j.jsxs)(`div`,{className:`stack box-panel`,children:[(0,j.jsxs)(`header`,{className:`box-head`,children:[(0,j.jsx)(`h3`,{className:`h box-name`,children:e.label}),(0,j.jsxs)(`p`,{className:`box-tags`,children:[(0,j.jsxs)(`span`,{className:`chip`,children:[(0,j.jsxs)(`span`,{className:`sr`,children:[U.kind,`: `]}),U.kindWord[e.kind]??e.kind]}),(0,j.jsxs)(`span`,{className:`chip ${e.state===`current`?`dim`:`warn`}`,children:[(0,j.jsxs)(`span`,{className:`sr`,children:[U.stateLabel,`: `]}),U.state[e.state]]}),e.gaps.length>0&&(0,j.jsx)(`span`,{className:`chip warn`,children:`${e.gaps.length} ${U.gapsBadge(e.gaps.length)}`})]}),h.length>0&&(0,j.jsx)(cr,{rows:h})]}),(g.length>0||_.length>0)&&(0,j.jsxs)(`div`,{className:`box-actions`,children:[g.length>0&&(0,j.jsx)(`div`,{className:`box-btns`,children:g}),_.length>0&&(0,j.jsx)(`div`,{className:`box-btns box-go`,children:_})]}),(0,j.jsxs)(`section`,{className:`box-sec`,"aria-label":U.gaps,children:[(0,j.jsx)(`h4`,{className:`hud`,children:U.gaps}),e.gaps.length?(0,j.jsx)(`ul`,{className:`box-list`,children:e.gaps.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsxs)(`span`,{className:`box-gap`,children:[(0,j.jsx)(`span`,{"aria-hidden":`true`,children:`⚠ `}),U.gap[e]??e]}),U.gapFix[e]&&(0,j.jsx)(`span`,{className:`box-why`,children:U.gapFix[e]})]},e))}):(0,j.jsx)(`p`,{className:`box-none`,children:U.noGaps})]}),m&&(0,j.jsx)(`section`,{className:`box-sec`,children:(0,j.jsx)(of,{box:m},e.id)}),(0,j.jsxs)(`section`,{className:`box-sec`,"aria-label":U.evidence,children:[(0,j.jsx)(`h4`,{className:`hud`,children:U.evidence}),e.evidence.length?(0,j.jsx)(`ul`,{className:`box-list`,children:e.evidence.map(e=>(0,j.jsxs)(`li`,{className:`box-cite`,children:[e.repo&&(0,j.jsx)(`span`,{className:`mono box-repo`,children:e.repo}),(0,j.jsx)(oD,{repo:e.repo,at:e.at}),e.repo&&(0,j.jsx)(Bp,{repo:e.repo,at:e.at})]},`${e.repo??``}:${e.at}`))}):(0,j.jsx)(`p`,{className:`box-none`,children:U.noEvidence})]}),(0,j.jsxs)(`section`,{className:`box-sec`,"aria-label":w.evidence.links,children:[(0,j.jsxs)(`h4`,{className:`hud`,children:[w.evidence.links,o.length>0&&(0,j.jsxs)(`span`,{className:`box-count`,children:[` · `,o.length]})]}),o.length?(0,j.jsx)(`ul`,{className:`box-list box-links`,children:o.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`span`,{className:`box-link-say`,children:w.evidence.linkOf(s(e.from),s(e.to),Cf(e.type))}),e.gaps.length>0&&(0,j.jsxs)(`span`,{className:`box-gap`,children:[(0,j.jsx)(`span`,{"aria-hidden":`true`,children:`⚠ `}),`${U.gaps}: ${e.gaps.map(e=>U.gap[e]??e).join(`, `)}`]}),e.joins?.length?(0,j.jsxs)(`details`,{children:[(0,j.jsx)(`summary`,{children:w.why.openOf(w.evidence.linkOf(s(e.from),s(e.to),Cf(e.type)))}),(0,j.jsx)($D,{link:e,...c?{under:c}:{},...l?{above:l}:{},...u?{contracts:u}:{}})]}):e.evidence.length>0&&(0,j.jsx)(`ul`,{className:`box-list`,children:e.evidence.map(e=>(0,j.jsxs)(`li`,{className:`box-cite`,children:[e.repo&&(0,j.jsx)(`span`,{className:`mono box-repo`,children:e.repo}),(0,j.jsx)(oD,{repo:e.repo,at:e.at})]},`${e.repo??``}:${e.at}`))})]},e.id))}):(0,j.jsx)(`p`,{className:`box-none`,children:w.evidence.noLinks})]}),e.next&&(0,j.jsxs)(`section`,{className:`box-sec`,"aria-label":U.next,children:[(0,j.jsx)(`h4`,{className:`hud`,children:U.next}),(0,j.jsx)(`p`,{className:`box-why`,children:e.next.why}),(0,j.jsxs)(`div`,{className:`box-cmd`,children:[(0,j.jsx)(`code`,{className:`mono`,children:e.next.command}),(0,j.jsx)(sr,{text:e.next.command,label:`${U.copy}: ${e.next.command}`})]}),(0,j.jsx)(zr,{command:e.next.command})]})]})}function Sk(e){let[t,n]=(0,v.useState)(!1);return(0,j.jsxs)(`div`,{className:`arch-arrange`,children:[e.onFocusOff&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:e.onFocusOff,children:U.focusOff}),(0,j.jsx)(Np,{label:e.saving?U.keeping:U.keep,icon:`keep`,primary:e.moved>0,busy:e.saving,disabled:!e.ready||e.saving,onClick:e.onKeep}),(0,j.jsx)(Np,{label:U.tidy,icon:`tidy`,disabled:!e.ready,onClick:e.onTidy}),t?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`span`,{className:`hud`,role:`status`,children:U.resetAsk}),(0,j.jsx)(`button`,{type:`button`,className:`btn danger`,disabled:!e.ready||e.saving,onClick:()=>{n(!1),e.onReset()},children:U.resetYes}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>n(!1),children:U.resetNo})]}):(0,j.jsx)(Np,{label:U.reset,icon:`reset`,disabled:!e.ready||e.saving,onClick:()=>n(!0)}),e.moved>0&&(0,j.jsx)(`span`,{className:`hud`,children:U.moved(e.moved)})]})}var Ck=w.trust.sample;function wk({text:e,label:t}){return(0,j.jsxs)(`div`,{className:`work-cmd`,children:[(0,j.jsx)(`code`,{className:`mono`,children:e}),(0,j.jsx)(sr,{text:e,label:`${t}: ${e}`})]})}function Tk({repo:e,item:t}){let n=QE(),[r,i]=(0,v.useState)(!1);if((0,v.useEffect)(()=>{t.kind===`fact`&&n?.need(e)},[n,e,t.kind]),t.kind===`link`)return(0,j.jsx)(`a`,{href:`#/canvas?lens=repo&node=${encodeURIComponent(`repo:${e}`)}`,children:Ck.wrongLink(e)});let a=n?.of(e),o=a?.state===`ready`?a.data.facts.find(e=>e.id===t.fact):void 0;return a?.state===`ready`&&!o?(0,j.jsx)(`p`,{className:`work-say`,children:Ck.factGone}):(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,"aria-expanded":r,"aria-label":Ck.wrongFactOf(t.claim),disabled:!o,onClick:()=>i(e=>!e),children:Ck.wrongFact}),r&&o&&(0,j.jsx)(uD,{repo:e,fact:o,onClose:()=>i(!1)})]})}function Ek(e){let t=(0,v.useId)();if(e.sample.state===`loading`)return(0,j.jsx)(`p`,{role:`status`,"aria-busy":`true`,className:`work-say`,children:Ck.loading});if(e.sample.state===`error`)return(0,j.jsx)(`p`,{role:`alert`,className:`state error`,children:Ck.failed(e.sample.error)});let n=e.sample.data;if(n.refused)return(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`p`,{className:`work-say`,children:Ck.refused[n.refused](e.repo,n.unverified??0)}),(0,j.jsx)(wk,{text:n.command,label:Ck.copyCommand})]});if(!n.items.length)return(0,j.jsx)(`p`,{className:`work-say`,children:Ck.empty});let r=t=>e.picks[t.id]??{note:t.note??``},i=()=>{let t=n.items.flatMap(t=>{let n=e.picks[t.id],r=n&&(n.answer??t.answer);return r?[{id:t.id,answer:r,...n.note.trim()?{note:n.note.trim()}:{}}]:[]});e.onSave(t)},a=e.saving;return(0,j.jsxs)(`section`,{className:`stack`,style:{gap:8},"aria-labelledby":`${t}-t`,children:[(0,j.jsx)(`h4`,{id:`${t}-t`,className:`h`,style:{fontSize:14},children:Ck.openOf(e.repo)}),(0,j.jsx)(`ol`,{className:`stack`,style:{gap:8,paddingLeft:18,margin:0},children:n.items.map((i,a)=>{let o=r(i),s=o.answer??i.answer,c=`${t}-${a}`,l=i.kind===`fact`?Ck.fact:Ck.link(i.of);return(0,j.jsx)(`li`,{children:(0,j.jsxs)(`fieldset`,{className:`ev-choice`,children:[(0,j.jsx)(`legend`,{children:Ck.item(a+1,n.items.length,l,i.claim)}),(0,j.jsx)(`p`,{className:`hud`,style:{margin:0},children:Ck.lines}),(0,j.jsx)(`ul`,{className:`ev-list`,children:i.lines.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`code`,{className:`mono`,children:e.cite}),` `,e.text?(0,j.jsx)(`code`,{className:`mono`,children:e.text}):Ck.noText]},e.cite))}),i.answer&&i.by&&(0,j.jsx)(`p`,{className:`work-say`,children:Ck.onFile(Ck.choices[i.answer],i.by)}),(0,j.jsx)(`div`,{className:`row`,style:{gap:12,flexWrap:`wrap`},children:[`right`,`wrong`,`unsure`].map(t=>(0,j.jsxs)(`label`,{className:`row`,style:{gap:4},children:[(0,j.jsx)(`input`,{type:`radio`,name:c,value:t,checked:s===t,onChange:()=>e.onPick(i.id,{...o,answer:t})}),Ck.choices[t]]},t))}),(0,j.jsxs)(`label`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`span`,{className:`hud`,children:s===`wrong`?Ck.note:Ck.noteOptional}),(0,j.jsx)(`textarea`,{rows:1,value:o.note,onChange:t=>e.onPick(i.id,{...o,note:t.target.value})})]}),s===`wrong`&&(0,j.jsx)(Tk,{repo:e.repo,item:i})]})},i.id)})}),(0,j.jsx)(`div`,{className:`row`,style:{gap:6},children:(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:a.state===`working`,onClick:i,children:a.state===`working`?Ck.saving:Ck.save})}),e.problem&&(0,j.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:0},children:e.problem}),a.state===`working`&&(0,j.jsx)(`p`,{role:`status`,"aria-busy":`true`,className:`work-say`,children:Ck.saving}),a.state===`error`&&(0,j.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:0},children:a.text}),a.state===`done`&&(0,j.jsxs)(`div`,{role:`status`,children:[(0,j.jsx)(`p`,{className:`work-say`,children:Ck.saved(a.result.file,a.result.answered,a.result.open)}),(0,j.jsx)(Yc,{scope:`audit`}),(0,j.jsx)(wk,{text:a.result.commit,label:Ck.copyCommit})]}),(0,j.jsx)(`p`,{className:`work-say`,children:Ck.sameInTerminal}),(0,j.jsx)(wk,{text:n.command,label:Ck.copyCommand})]})}function Dk({repo:e}){let t=(0,v.useId)(),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(`10`),[o,s]=(0,v.useState)({seed:``,size:`10`}),c=new URLSearchParams({...o.seed.trim()?{seed:o.seed.trim()}:{},...o.size?{size:o.size}:{}}).toString(),l=P(`/api/facts/${encodeURIComponent(e)}/audit?${c}`),[u,d]=(0,v.useState)({}),[f,p]=(0,v.useState)({state:`idle`}),[m,h]=(0,v.useState)(),g=l.state===`ready`?l.data:void 0;return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,j.jsx)(`p`,{className:`work-say`,children:Ck.intro}),(0,j.jsxs)(`form`,{className:`row`,style:{gap:8,flexWrap:`wrap`,alignItems:`flex-end`},onSubmit:e=>{e.preventDefault(),d({}),p({state:`idle`}),s({seed:n,size:i})},children:[(0,j.jsxs)(`label`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`span`,{className:`hud`,children:Ck.seed}),(0,j.jsx)(`input`,{value:n,"aria-describedby":`${t}-seed`,onChange:e=>r(e.target.value)}),(0,j.jsx)(`span`,{id:`${t}-seed`,className:`work-say`,children:g?.defaultSeed?Ck.seedHint(g.defaultSeed):Ck.seedHintNone})]}),(0,j.jsxs)(`label`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`span`,{className:`hud`,children:Ck.size}),(0,j.jsx)(`input`,{type:`number`,min:1,max:100,value:i,onChange:e=>a(e.target.value)})]}),(0,j.jsx)(`button`,{type:`submit`,className:`btn`,children:Ck.draw})]}),(0,j.jsx)(Ek,{repo:e,sample:l,picks:u,onPick:(e,t)=>d(n=>({...n,[e]:t})),saving:f,onSave:t=>{if(g){if(!t.length)return h(Ck.nothingPicked);h(void 0),p({state:`working`}),N(`/api/facts/${encodeURIComponent(e)}/audit`,{method:`POST`,body:{seed:g.seed,size:g.size,answers:t}}).then(e=>{p({state:`done`,result:e}),d({}),l.reload()},e=>p({state:`error`,text:nr(e)}))}},problem:m})]})}var Ok=w.trust.answerBoxes;function kk({r:e,rename:t}){return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:t?Ok.willRename(e.answers.length,t):Ok.willIgnore(e.answers.length)}),e.answers.length>0&&(0,j.jsx)(`ul`,{style:{margin:0},children:e.answers.map(e=>(0,j.jsx)(`li`,{className:`mono`,style:{fontSize:12},children:Ok.answerChange(e.id,e.was,e.now)},e.id))}),e.profile&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:Ok.profileChange(e.profile.path)}),(0,j.jsx)(Ou,{edit:{path:e.profile.path,changes:e.profile.changes,written:!1,note:``}})]})]})}function Ak({box:e}){let t=(0,v.useId)(),n=Vn(),r=Vn(),[i,a]=(0,v.useState)(),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(),u=c&&c.mode===i?c.r:void 0,d=(0,v.useRef)(0),[f,p]=(0,v.useState)(),m=`/api/trust/answer-boxes/${i??`ignore`}`,h=t=>({id:e.id,...i===`rename`?{name:o.trim()}:{},...t?{preview:!0}:u?.stamp?{stamp:u.stamp}:{}}),g=e=>{d.current++,a(e),l(void 0)},_=(e,t)=>{let r=d.current;return n.run(async()=>{let n=await N(`/api/trust/answer-boxes/${e}`,{method:`POST`,body:t});d.current===r&&l({mode:e,r:n})},``)},y=()=>i?_(i,h(!0)):void 0,b=`${t}-h`;return(0,j.jsxs)(`section`,{"aria-labelledby":b,className:`panel qs-card qs-box`,children:[(0,j.jsx)(`h4`,{id:b,className:`qs-q`,children:Ok.box(e.name)}),e.profile&&(0,j.jsx)(`p`,{className:`qs-card-line`,children:Ok.inProfile(e.profile)}),e.questions.length>0&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`qs-card-line`,children:Ok.answeredIn(e.questions.length)}),(0,j.jsx)(`ul`,{className:`qs-box-qs`,children:e.questions.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`a`,{href:`#/questions/${e.id}`,children:e.question}),` `,(0,j.jsxs)(`span`,{className:`qs-cmd mono`,children:[e.repo,` · `,e.id]})]},e.id))})]}),f?(0,j.jsxs)(`div`,{className:`qs-done`,children:[(0,j.jsx)(`p`,{role:`status`,className:`work-say`,style:{margin:0},children:Ok.written(f.repos.join(`, `))}),(0,j.jsx)(qc,{scope:`answers`,repo:f.repos.length===1?f.repos[0]:void 0})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`qs-group-btns`,children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,"aria-pressed":i===`ignore`,"aria-label":Ok.ignoreOf(e.name),onClick:()=>{g(`ignore`),_(`ignore`,{id:e.id,preview:!0})},children:Ok.ignore}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,"aria-pressed":i===`rename`,"aria-label":Ok.renameOf(e.name),onClick:()=>g(`rename`),children:Ok.rename})]}),i===`rename`&&!u&&(0,j.jsxs)(`div`,{className:`qs-field`,children:[(0,j.jsx)(`label`,{htmlFor:`${t}-name`,className:`qs-field-label`,children:Ok.nameLabel}),(0,j.jsx)(`input`,{id:`${t}-name`,className:`field`,maxLength:200,value:o,"aria-describedby":`${t}-name-d`,onChange:e=>s(e.target.value)}),(0,j.jsx)(`span`,{id:`${t}-name-d`,className:`qs-hint`,children:Ok.nameHint}),(0,j.jsx)(`div`,{className:`qs-group-btns`,children:(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:n.busy||!o.trim(),onClick:()=>void y(),children:n.busy?Ok.previewing:Ok.preview})})]}),n.busy&&i===`ignore`&&!u&&(0,j.jsx)(`p`,{role:`status`,"aria-busy":`true`,className:`muted`,style:{margin:0},children:Ok.previewing}),n.note&&!n.note.ok&&(0,j.jsx)(Wn,{note:n.note}),u&&i&&(0,j.jsxs)(`div`,{className:`qs-answered`,children:[(0,j.jsx)(kk,{r:u,...i===`rename`?{rename:o.trim()}:{}}),(0,j.jsxs)(`div`,{className:`qs-group-btns`,children:[(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:r.busy,onClick:()=>void r.run(async()=>{p(await N(m,{method:`POST`,body:h(!1)}))},``),children:r.busy?Ok.writing:i===`rename`?Ok.confirmRename:Ok.confirmIgnore}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:r.busy,onClick:()=>{d.current++,a(void 0),l(void 0)},children:Ok.cancel})]}),r.note&&!r.note.ok&&(0,j.jsx)(Wn,{note:r.note})]})]})]})}function jk({boxes:e}){return e?.length?(0,j.jsxs)(`div`,{className:`qs-boxes`,role:`group`,"aria-label":Ok.title(e.length),children:[(0,j.jsxs)(`p`,{className:`work-say`,style:{margin:0},children:[(0,j.jsx)(`span`,{"aria-hidden":`true`,children:`⚠ `}),Ok.title(e.length)]}),(0,j.jsx)(`p`,{className:`work-why`,style:{margin:0},children:Ok.intro}),e.map(e=>(0,j.jsx)(Ak,{box:e},e.id))]}):null}var Mk=w.trust;function Nk(e){let t=Vn(),[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(!1),c=(0,v.useId)();return n?(0,j.jsxs)(`form`,{className:`stack`,style:{gap:4,marginTop:4},onSubmit:n=>{n.preventDefault(),i.trim()?(s(!1),t.run(async()=>(await N(`/api/facts/${encodeURIComponent(e.repo)}/corrections`,{method:`POST`,body:{fact:e.fact,action:`wrong`,reason:i.trim()}}),Qn(`/api/facts/${encodeURIComponent(e.repo)}/apply`,{}).finally(()=>e.onDone?.())),()=>Mk.droppedFact(e.fact))):s(!0)},children:[(0,j.jsx)(`label`,{htmlFor:c,children:Mk.dropFactReason(e.fact)}),(0,j.jsx)(`input`,{id:c,type:`text`,value:i,"aria-describedby":`${c}-help`,"aria-invalid":o||void 0,onChange:e=>a(e.target.value)}),(0,j.jsx)(`span`,{id:`${c}-help`,className:`muted`,style:{fontSize:12},children:o?Mk.dropFactNeedsReason:Mk.dropFactHelp}),(0,j.jsxs)(`span`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:t.busy,children:t.busy?Mk.droppingFact:Mk.dropFactAndApply}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:t.busy,onClick:()=>r(!1),children:Mk.dropFactCancel})]}),(0,j.jsx)(Wn,{note:t.note})]}):(0,j.jsx)(`button`,{type:`button`,className:`btn`,"aria-label":Mk.dropFactLabel(e.fact),onClick:()=>r(!0),children:Mk.dropFact})}var G=w.trust,Pk=w.runNext;function Fk({repo:e}){let[t,n]=(0,v.useState)(!1);return(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,"aria-expanded":t,"aria-label":G.sample.openOf(e),onClick:()=>n(e=>!e),children:G.sample.open}),t&&(0,j.jsx)(Dk,{repo:e})]})}function Ik(e){let t=e.verify.report;switch(e.state){case`not-read`:return G.why.notRead;case`unverified`:return G.why.unverified;case`rejected`:return G.why.rejected(t?.rejected??0);case`stale`:return G.why.stale(t?.commit??e.facts.commit??``,e.checkout.commit??``);case`unwritten`:return G.why.unwritten;case`unknown-files`:return G.why.unknownFiles(t?.coverage.unknown??0,e.repo);default:return G.why.trusted}}function Lk(e){let t=e.verify.report?.commit??e.facts.commit;return t?e.checkout.commit?e.sameCommit?G.sameCommit(t):G.otherCommit(t,e.checkout.commit):G.noCheckout(t):G.noFactsCommit}var Rk=e=>e===`trusted`?`done`:e===`rejected`||e===`stale`?`blocking`:`warn`;function zk(e){let[t,n]=(0,v.useState)(!1);return e.n===0?(0,j.jsx)(j.Fragment,{children:G.none}):(0,j.jsxs)(`details`,{className:`trust-list`,onToggle:e=>n(e.currentTarget.open),children:[(0,j.jsx)(`summary`,{children:G.show(e.n,e.what)}),e.children(t)]})}var Bk=(e,t)=>e?t?`${e}:${t}`:e:void 0,Vk=50;function Hk(e){return(0,j.jsx)(I,{of:e.of,empty:t=>!(e.only?t.facts.filter(e.only):t.facts).length,emptyText:G.none,children:t=>{let n=e.only?t.facts.filter(e.only):t.facts;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`ul`,{className:`mono trust-items`,children:n.slice(0,Vk).map(t=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(oD,{repo:e.repo,at:`${t.cite.file}:${t.cite.line}`}),` `,t.label]},t.id))}),n.length>Vk&&(0,j.jsx)(`p`,{className:`work-say`,children:G.moreFacts(n.length-Vk,t.file)})]})}})}function Uk(e){let t=P(`/api/facts/${encodeURIComponent(e.repo)}`);return(0,j.jsx)(Hk,{repo:e.repo,of:t,...e.only?{only:e.only}:{}})}var Wk=e=>!!e.cite.quote?.includes(`<redacted>`);function Gk({r:e}){let t=e.verify.report,n=`trust-${e.repo}`,r=e.lists,i=e.verify.path.replace(/\.verify\.yaml$/,`.rejected.jsonl`);return(0,j.jsxs)(`article`,{className:`list-row`,style:{display:`block`},"aria-labelledby":n,children:[(0,j.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`,gap:8},children:[(0,j.jsx)(`h3`,{id:n,className:`h`,style:{fontSize:14,margin:0},children:e.repo}),(0,j.jsx)(`span`,{className:`chip ${Rk(e.state)}`,children:G.states[e.state]})]}),(0,j.jsx)(`p`,{className:`work-why`,style:{margin:`6px 0`},children:Ik(e)}),t?.secrets?.length?(0,j.jsxs)(`div`,{role:`alert`,className:`stack`,style:{gap:4,margin:`6px 0`},children:[(0,j.jsx)(`p`,{style:{margin:0},children:(0,j.jsxs)(`span`,{className:`chip warn`,children:[(0,j.jsx)(`span`,{"aria-hidden":`true`,children:`⚠ `}),G.secrets.title(t.secrets.length)]})}),(0,j.jsx)(`ul`,{className:`ev-list`,style:{margin:`4px 0`},children:t.secrets.map(e=>(0,j.jsx)(`li`,{children:(0,j.jsx)(`code`,{className:`mono`,children:G.secrets.at(e.file,e.line,e.key||G.secrets.secretKey)})},`${e.file}:${e.line}`))}),(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:G.secrets.fix})]}):null,(0,j.jsxs)(`dl`,{className:`run-facts`,style:{margin:`8px 0`},children:[(0,j.jsx)(`dt`,{children:G.kept}),(0,j.jsxs)(`dd`,{children:[t?t.accepted:G.noReport,t&&t.redacted>0?` (${G.redacted(t.redacted)})`:``,t&&e.facts.present&&(0,j.jsx)(zk,{n:t.accepted,what:G.what.kept,children:t=>(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`work-say`,children:G.keptFix}),t&&(0,j.jsx)(Uk,{repo:e.repo})]})}),t&&t.redacted>0&&e.facts.present&&(0,j.jsx)(zk,{n:t.redacted,what:G.what.redacted,children:t=>(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`work-say`,children:G.redactedFix}),t&&(0,j.jsx)(Uk,{repo:e.repo,only:Wk})]})})]}),(0,j.jsx)(`dt`,{children:G.rejected}),(0,j.jsxs)(`dd`,{children:[t?t.rejected:G.noReport,r&&r.rejected.length>0&&(0,j.jsx)(zk,{n:r.rejected.length,what:G.what.rejected,children:()=>(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`ul`,{className:`trust-items`,children:r.rejected.map((t,n)=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`code`,{className:`mono`,children:Bk(t.file,t.line)??G.rejectedNoLine}),t.fact&&(0,j.jsxs)(`span`,{className:`mono`,children:[` `,t.fact]}),` · `,G.rejectedLine(t.code,t.message),t.fact&&(0,j.jsx)(Nk,{repo:e.repo,fact:t.fact})]},`${t.fact??t.code}-${n}`))}),(0,j.jsx)(`p`,{className:`work-say`,children:G.rejectedFix(i)}),(0,j.jsx)(gl,{repo:e.repo,again:!0}),(0,j.jsx)(sc,{text:`/atticus-map ${e.repo}`,label:Pk.copySlash}),(0,j.jsx)(sc,{text:`atticus verify ${e.repo}`,label:Pk.copy})]})})]}),(0,j.jsx)(`dt`,{children:G.coverage}),(0,j.jsxs)(`dd`,{children:[t?G.coverageOf(t.coverage.ratio,t.coverage.read,t.coverage.unknown,t.coverage.excluded):G.noReport,t&&t.coverage.unknown>0&&(0,j.jsx)(zk,{n:t.coverage.unknown,what:G.what.unknown,children:()=>(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`ul`,{className:`mono trust-items`,children:t.unknownFiles.map(e=>(0,j.jsx)(`li`,{children:e},e))}),t.coverage.unknown>t.unknownFiles.length&&(0,j.jsx)(`p`,{className:`work-say`,children:G.more(t.coverage.unknown-t.unknownFiles.length,e.verify.path)}),(0,j.jsx)(`p`,{className:`work-say`,children:G.unknownFix(e.repo)}),(0,j.jsx)(gl,{repo:e.repo,again:!0}),(0,j.jsx)(sc,{text:`/atticus-map ${e.repo}`,label:Pk.copySlash})]})}),t&&t.coverage.excluded>0&&(0,j.jsx)(zk,{n:t.coverage.excluded,what:G.what.excluded,children:()=>(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`ul`,{className:`mono trust-items`,children:(r?.excluded??[]).map(e=>(0,j.jsx)(`li`,{children:e},e))}),t.coverage.excluded>(r?.excluded.length??0)&&(0,j.jsx)(`p`,{className:`work-say`,children:G.more(t.coverage.excluded-(r?.excluded.length??0),e.verify.path)}),(0,j.jsx)(`p`,{className:`work-say`,children:G.excludedFix(e.repo)})]})})]}),r&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`dt`,{children:G.asked}),(0,j.jsx)(`dd`,{children:(0,j.jsx)(zk,{n:r.asked.length,what:G.what.asked,children:()=>(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`work-say`,children:G.askedFix}),(0,j.jsx)(`ul`,{className:`trust-items`,children:r.asked.map(e=>(0,j.jsxs)(`li`,{children:[e.question,` `,e.lines.map(e=>(0,j.jsxs)(`code`,{className:`mono`,children:[e,` `]},e)),(0,j.jsx)(`a`,{href:`#/questions/${e.id}`,children:G.answer})]},e.id))})]})})})]}),e.facts.unverified>0&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`dt`,{children:G.unverified}),(0,j.jsxs)(`dd`,{children:[e.facts.unverified,(0,j.jsx)(zk,{n:e.facts.unverified,what:G.what.unverified,children:()=>(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`work-say`,children:G.unverifiedFix}),(0,j.jsx)(`ul`,{className:`mono trust-items`,children:(r?.unverified??[]).map(e=>(0,j.jsxs)(`li`,{children:[e.file,`:`,e.line,` `,e.fact]},e.fact))}),e.facts.unverified>(r?.unverified.length??0)&&(0,j.jsx)(`p`,{className:`work-say`,children:G.more(e.facts.unverified-(r?.unverified.length??0),e.facts.path)}),(0,j.jsx)(sc,{text:`atticus verify ${e.repo}`,label:Pk.copy})]})})]})]}),(0,j.jsx)(`dt`,{children:G.audit}),(0,j.jsxs)(`dd`,{children:[e.audit?(0,j.jsxs)(j.Fragment,{children:[G.auditTally(G.auditFacts,e.audit.facts),` ·`,` `,G.auditTally(G.auditLinks,e.audit.links),e.audit.ai&&(0,j.jsxs)(j.Fragment,{children:[` · `,w.decisions.trustTally(e.audit.ai)]}),e.audit.facts.right+e.audit.facts.wrong+e.audit.links.right+e.audit.links.wrong<30&&(0,j.jsxs)(`span`,{className:`work-say`,children:[` `,G.auditSmall]})]}):(0,j.jsx)(`span`,{className:`mono`,children:G.auditNone(e.repo)}),e.facts.present&&(0,j.jsx)(Fk,{repo:e.repo})]}),(0,j.jsx)(`dt`,{children:G.builtOn}),(0,j.jsx)(`dd`,{children:e.frameworks?.length?e.frameworks.map(e=>e.component?G.builtOnModule(G.builtOnOne(e.name,e.version,e.cite),e.component):G.builtOnOne(e.name,e.version,e.cite)).join(`, `):G.builtOnNone}),(0,j.jsx)(`dt`,{children:G.terms}),(0,j.jsx)(`dd`,{children:e.terms?.length?(0,j.jsx)(`ul`,{className:`mono trust-items`,"aria-label":`${G.terms}: ${e.repo}`,children:e.terms.map(e=>(0,j.jsxs)(`li`,{children:[G.termOne(e.term,e.value,G.termRole[e.role]??e.role,e.cite),e.note===void 0?``:`; ${G.termNote(e.note)}`]},`${e.cite}-${e.term}-${e.value}`))}):G.termsNone}),(0,j.jsx)(`dt`,{children:G.commit}),(0,j.jsx)(`dd`,{className:`mono`,children:Lk(e)}),(0,j.jsx)(`dt`,{children:G.catalogFrom}),(0,j.jsxs)(`dd`,{children:[G.from[e.catalog.from],` · `,G.records(e.catalog.fromFacts,e.catalog.fromReaders),t&&t.rejected>0&&(0,j.jsxs)(j.Fragment,{children:[` · `,G.rejectedHolds(t.rejected)]}),e.catalog.fromFacts+e.catalog.fromReaders>0&&(0,j.jsxs)(j.Fragment,{children:[` · `,(0,j.jsx)(`a`,{href:`#/canvas?lens=repo&node=${encodeURIComponent(`repo:${e.repo}`)}`,children:G.openCanvas})]})]})]}),(e.frameworks??[]).filter(e=>e.gap).map(e=>(0,j.jsxs)(`p`,{className:`work-say`,children:[(0,j.jsx)(`strong`,{children:G.builtOnGap(e.name)}),` `,e.gap]},`gap-${e.name}-${e.cite}`)),e.next&&(0,j.jsxs)(`div`,{style:{marginTop:8},children:[ul(e.next.command)&&(0,j.jsx)(sc,{text:e.next.command,label:Pk.copy}),e.next.slash&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`work-say`,children:Pk.slash}),(0,j.jsx)(sc,{text:e.next.slash,label:Pk.copySlash})]}),!ul(e.next.command)&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`work-say`,children:Pk.terminal}),(0,j.jsx)(sc,{text:e.next.command,label:Pk.copy})]})]}),e.state!==`not-read`&&(0,j.jsxs)(`section`,{className:`stack`,style:{gap:4,marginTop:8},"aria-labelledby":`${n}-again`,children:[(0,j.jsx)(`h4`,{id:`${n}-again`,className:`h`,style:{fontSize:13,margin:0},children:G.readAgain.title}),(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:G.readAgain.why(e.repo)}),(0,j.jsx)(gl,{repo:e.repo,again:!0})]}),(0,j.jsx)(`p`,{className:`work-say mono`,style:{margin:`6px 0 0`},children:G.files(e.facts.path,e.verify.path)}),e.state!==`not-read`&&(0,j.jsx)(`p`,{className:`work-say`,style:{margin:`6px 0 0`},children:(0,j.jsx)(`a`,{href:`#/crosscheck?repo=${encodeURIComponent(e.repo)}`,children:w.crossCheck.openFromTrustOf(e.repo)})})]})}var Kk=G.fresh,qk=e=>e.slice(0,7);function Jk({of:e}){let t=e.state===`ready`?e.data.repos.filter(e=>e.state!==`not-read`):[],n=t.filter(e=>e.state!==`fresh`);return(0,j.jsxs)(F,{title:Kk.title,span:`1 / -1`,meta:t.length?Kk.summary(n.length,t.length,n.reduce((e,t)=>e+t.reread,0)):void 0,children:[(0,j.jsx)(`p`,{className:`work-why`,style:{marginTop:0},children:Kk.intro}),(0,j.jsx)(I,{of:e,empty:e=>!e.repos.some(e=>e.state!==`not-read`)&&!e.problems.length,emptyText:Kk.empty,children:e=>(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(_c,{list:e.problems}),n.length===0?(0,j.jsx)(`p`,{className:`work-say`,children:Kk.allFresh(t.length)}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`row`,style:{gap:8},children:(0,j.jsx)(Xt,{ask:{kind:`stale`},label:w.copilotRuns.start.stale})}),(0,j.jsxs)(`table`,{className:`run-table`,children:[(0,j.jsx)(`caption`,{className:`sr`,children:Kk.caption}),(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{scope:`col`,children:Kk.col.repo}),(0,j.jsx)(`th`,{scope:`col`,children:Kk.col.state}),(0,j.jsx)(`th`,{scope:`col`,children:Kk.col.facts}),(0,j.jsx)(`th`,{scope:`col`,children:Kk.col.clone}),(0,j.jsx)(`th`,{scope:`col`,children:Kk.col.cited}),(0,j.jsx)(`th`,{scope:`col`,children:Kk.col.reread}),(0,j.jsx)(`th`,{scope:`col`,children:Kk.col.carried}),(0,j.jsx)(`th`,{scope:`col`,children:Kk.col.run})]})}),(0,j.jsx)(`tbody`,{children:n.map(e=>(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{scope:`row`,className:`mono`,children:e.repo}),(0,j.jsx)(`td`,{children:(0,j.jsx)(`span`,{className:`chip ${e.state===`moved`?`warn`:`blocking`}`,children:Kk.states[e.state]})}),(0,j.jsxs)(`td`,{className:`mono`,children:[e.factsCommits[0]?qk(e.factsCommits[0]):``,e.factsCommits.length>1?` ${Kk.more(e.factsCommits.length-1)}`:``]}),(0,j.jsx)(`td`,{className:`mono`,children:e.head?qk(e.head):``}),(0,j.jsx)(`td`,{children:e.citedChanged}),(0,j.jsx)(`td`,{children:e.reread}),(0,j.jsx)(`td`,{children:e.carried}),(0,j.jsxs)(`td`,{children:[(0,j.jsx)(gl,{repo:e.repo,again:!0,ask:{kind:`stale`,repos:[e.repo]}}),e.slash&&(0,j.jsx)(sc,{text:e.slash,label:Pk.copySlash}),e.command&&(0,j.jsxs)(`details`,{className:`work-terminal`,children:[(0,j.jsx)(`summary`,{children:w.appStep.inTerminal}),(0,j.jsx)(sc,{text:e.command,label:Pk.copy,noRun:!0})]})]})]},e.repo))})]}),t.length>n.length&&(0,j.jsx)(`p`,{className:`work-say`,children:Kk.freshCount(t.length-n.length)})]})]})})]})}var Yk=G.canary;function Xk({name:e,r:t}){return(0,j.jsxs)(`li`,{children:[(0,j.jsxs)(`strong`,{children:[e,`:`]}),` `,Yk.rate(t),` `,(0,j.jsx)(`span`,{className:`work-say`,children:Yk.range(t.low,t.high)})]})}function Zk({of:e}){let t=e=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:Yk.howTo}),(0,j.jsx)(sc,{text:e.commands.plant,label:Pk.copy,noRun:!0}),(0,j.jsx)(sc,{text:e.commands.score,label:Pk.copy,noRun:!0}),(0,j.jsx)(sc,{text:e.commands.report,label:Pk.copy,noRun:!0})]});return(0,j.jsxs)(F,{title:Yk.title,span:`1 / -1`,children:[(0,j.jsx)(`p`,{className:`work-why`,style:{marginTop:0},children:Yk.intro}),(0,j.jsx)(I,{of:e,empty:e=>!e.latest.length&&!e.pending.length&&!e.rates.misread.n&&!e.problems.length,emptyContent:e.state===`ready`?(0,j.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:Yk.empty}),t(e.data)]}):void 0,children:e=>{let n=e.rates;return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,j.jsx)(_c,{list:e.problems}),(0,j.jsxs)(`ul`,{className:`trust-items`,style:{margin:0},children:[(0,j.jsx)(Xk,{name:Yk.misread(n.repos.audited),r:n.misread}),(0,j.jsx)(Xk,{name:Yk.passed(n.repos.canaries),r:n.passed})]}),(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:n.covers.length?Yk.covers(n.covers.map(e=>Yk.stack(e.stack,e.what)).join(`; `)):Yk.coversNone}),n.repos.canaries>0&&(0,j.jsxs)(`ul`,{className:`trust-items`,style:{margin:0},children:[(0,j.jsx)(`li`,{children:Yk.recall(n.recall)}),(0,j.jsx)(`li`,{children:Yk.fabrication(n.fabrication,n.caught,n.elsewhere)})]}),(n.misread.n>0&&n.misread.n<30||n.passed.n>0&&n.passed.n<30)&&(0,j.jsx)(`p`,{className:`work-say`,children:Yk.small}),e.latest.length>0&&(0,j.jsxs)(`table`,{className:`run-table`,children:[(0,j.jsx)(`caption`,{className:`sr`,children:Yk.caption}),(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{scope:`col`,children:Yk.col.repo}),(0,j.jsx)(`th`,{scope:`col`,children:Yk.col.at}),(0,j.jsx)(`th`,{scope:`col`,children:Yk.col.covers}),(0,j.jsx)(`th`,{scope:`col`,children:Yk.col.planted}),(0,j.jsx)(`th`,{scope:`col`,children:Yk.col.removed}),(0,j.jsx)(`th`,{scope:`col`,children:Yk.col.passed}),(0,j.jsx)(`th`,{scope:`col`,children:Yk.col.report})]})}),(0,j.jsx)(`tbody`,{children:e.latest.map(e=>(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{scope:`row`,className:`mono`,children:e.repo}),(0,j.jsx)(`td`,{children:e.at.slice(0,10)}),(0,j.jsxs)(`td`,{children:[e.covers.map(e=>Yk.stack(e.stack,e.what)).join(`; `),e.skipped.length>0&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`br`,{}),(0,j.jsx)(`span`,{className:`work-say`,children:Yk.skipped(e.skipped.length)})]})]}),(0,j.jsx)(`td`,{children:Yk.of(e.recall.k,e.recall.n)}),(0,j.jsx)(`td`,{children:Yk.of(e.fabrication.k,e.fabrication.n)}),(0,j.jsxs)(`td`,{children:[e.passed.k>0&&(0,j.jsxs)(`span`,{role:`img`,"aria-label":Yk.passedWarn,title:Yk.passedWarn,children:[`⚠`,` `]}),Yk.of(e.passed.k,e.passed.n)]}),(0,j.jsx)(`td`,{className:`mono`,children:e.path})]},e.repo))})]}),e.pending.map(e=>(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:Yk.pending(e.repo)}),(0,j.jsx)(sc,{text:Yk.scoreIt(e.repo),label:Pk.copy,noRun:!0})]},e.repo)),(0,j.jsxs)(`details`,{className:`work-terminal`,children:[(0,j.jsx)(`summary`,{children:Yk.howTo}),t(e)]})]})}})]})}function Qk({of:e}){let t=w.decisions;return(0,j.jsx)(F,{title:t.trustTitle,span:`1 / -1`,children:(0,j.jsx)(I,{of:e,children:e=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,j.jsx)(`p`,{style:{margin:0},children:t.trustTally(e.decide.precision)}),(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:t.trustBar(e.decide.configured.minPrecision)}),(0,j.jsx)(qi,{decide:e.decide}),(0,j.jsx)(`a`,{href:`#/decisions`,children:t.trustOpen})]})})})}var $k=(e,t)=>ti([e.repo],t);function eA(e){let t=e.repos.filter(t=>$k(t,e.filter)),n=!!e.filter.trim();return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:12},children:[e.repos.length>0&&(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(ii,{id:`trust-filter`,label:G.filterLabel,value:e.filter,onChange:e.onFilter}),(0,j.jsx)(ai,{shown:t.length,total:e.repos.length,active:n})]}),n&&!t.length?(0,j.jsx)(oi,{what:ri({text:e.filter}),onClear:()=>e.onFilter(``),focus:`trust-filter`}):t.map(e=>(0,j.jsx)(Gk,{r:e},e.repo))]})}function tA({of:e,fresh:t,decide:n,canary:r,filter:i=``}){let[a,o]=(0,v.useState)(i);return(0,j.jsxs)(`div`,{className:`bento`,children:[t&&(0,j.jsx)(Jk,{of:t}),n&&(0,j.jsx)(Qk,{of:n}),r&&(0,j.jsx)(Zk,{of:r}),(0,j.jsxs)(F,{title:w.nav.screens.trust,span:`1 / -1`,meta:e.state===`ready`&&e.data.repos.length?G.summary(e.data.repos.filter(e=>e.state===`trusted`).length,e.data.repos.length):void 0,children:[(0,j.jsx)(`p`,{className:`work-why`,style:{marginTop:0},children:G.intro}),(0,j.jsxs)(`p`,{className:`row`,style:{gap:8,flexWrap:`wrap`},children:[(0,j.jsx)(Xt,{ask:{kind:`all`},label:w.copilotRuns.start.all}),(0,j.jsx)(Xt,{ask:{kind:`gaps`},label:w.copilotRuns.start.gaps})]}),(0,j.jsx)(I,{of:e,empty:e=>e.repos.length===0&&!e.problems.length&&!e.answerBoxes?.length,emptyText:G.empty,children:e=>(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(_c,{list:e.problems}),(0,j.jsx)(`p`,{className:`work-say`,children:G.reportIn(e.factsDir)}),(0,j.jsx)(`p`,{className:`work-say`,children:(0,j.jsx)(`a`,{href:`#/crosscheck`,children:w.crossCheck.openFromTrust})}),e.contracts&&(0,j.jsxs)(`p`,{className:`work-say`,children:[e.contracts.mismatches>0&&(0,j.jsx)(`span`,{"aria-hidden":`true`,children:`⚠ `}),G.contracts(e.contracts.mismatches,e.contracts.unconfirmed,e.contracts.compared),` `,(0,j.jsx)(`a`,{href:`#/mismatches`,children:G.contractsOpen})]}),(0,j.jsx)(jk,{boxes:e.answerBoxes}),(0,j.jsx)(eA,{repos:e.repos,filter:a,onFilter:o})]})})]})]})}function nA(){let e=P(`/api/trust`);lt(e);let t=P(`/api/trust/fresh`);lt(t);let n=Oi(),r=P(`/api/trust/canaries`);return lt(r),(0,j.jsx)(tD,{children:(0,j.jsx)(tA,{of:e,fresh:t,canary:r,decide:{...n?.view??{state:`loading`},...n?{reload:n.reload}:{}}})})}var rA=w.outside,iA=e=>`#/outside?system=${encodeURIComponent(e)}`;function aA(e){return(0,j.jsx)(`nav`,{"aria-label":rA.pick,children:(0,j.jsx)(`ul`,{className:`row`,style:{gap:6,flexWrap:`wrap`,listStyle:`none`,padding:0,margin:0},children:e.systems.map(t=>(0,j.jsx)(`li`,{children:(0,j.jsx)(`a`,{className:`chip`,href:iA(t.id),"aria-current":t.id===e.current?`page`:void 0,children:t.name})},t.id))})})}var oA=e=>[e.method,e.path].filter(Boolean).join(` `)||(e.fact??``);function sA({text:e}){return(0,j.jsxs)(`div`,{className:`work-cmd`,children:[(0,j.jsx)(`code`,{className:`mono`,children:e}),(0,j.jsx)(sr,{text:e,label:rA.copy(e)})]})}function cA({calls:e,extra:t}){return(0,j.jsx)(`ul`,{className:`ev-list`,style:{margin:0},children:e.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`code`,{className:`mono`,children:oA(e)}),` · `,e.repo,` `,(0,j.jsx)(`code`,{className:`mono`,children:e.at}),` · `,t(e)]},`${e.repo}|${e.at}`))})}function lA({system:e}){let t=`outside-${e.id}`;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(F,{title:e.name,span:`1 / -1`,labelledBy:`${t}-name`,children:(0,j.jsxs)(`p`,{className:`work-say`,style:{margin:0},children:[rA.boundary[e.boundary]??e.boundary,e.owner?` · ${rA.owner(e.owner)}`:``,e.aliases.length?` · ${rA.aliases(e.aliases.join(`, `))}`:``]})}),e.notes&&e.notes.length>0&&(0,j.jsx)(F,{title:rA.configNotes,span:`1 / -1`,labelledBy:`${t}-notes`,children:(0,j.jsx)(`ul`,{className:`ev-list`,style:{margin:0},children:e.notes.map(e=>(0,j.jsx)(`li`,{children:e},e))})}),(0,j.jsx)(F,{title:rA.callers,span:`1 / -1`,labelledBy:`${t}-callers`,children:e.callers.length?(0,j.jsxs)(`table`,{className:`run-table`,children:[(0,j.jsx)(`caption`,{className:`sr`,children:rA.callers}),(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{scope:`col`,children:rA.callerCols.from}),(0,j.jsx)(`th`,{scope:`col`,children:rA.callerCols.call}),(0,j.jsx)(`th`,{scope:`col`,children:rA.callerCols.line}),(0,j.jsx)(`th`,{scope:`col`,children:rA.callerCols.operation}),(0,j.jsx)(`th`,{scope:`col`,children:rA.callerCols.seen})]})}),(0,j.jsx)(`tbody`,{children:e.callers.map(e=>(0,j.jsxs)(`tr`,{children:[(0,j.jsxs)(`td`,{children:[e.repo,e.component&&e.component!==e.repo?` (${e.component})`:``]}),(0,j.jsxs)(`td`,{children:[(0,j.jsx)(`code`,{className:`mono`,children:oA(e)}),e.through&&(0,j.jsxs)(`span`,{className:`work-say`,children:[` `,rA.through(e.through.repo,e.through.at)]})]}),(0,j.jsx)(`td`,{children:(0,j.jsx)(`code`,{className:`mono`,children:e.at})}),(0,j.jsx)(`td`,{children:e.operations&&e.operations.length>1?(0,j.jsxs)(j.Fragment,{children:[rA.reachesMany(e.operations.length),` `,e.operations.map((e,t)=>(0,j.jsxs)(`span`,{children:[t?`, `:``,(0,j.jsx)(`code`,{className:`mono`,children:e})]},e))]}):e.operation?(0,j.jsx)(`code`,{className:`mono`,children:e.operation}):rA.noOperation}),(0,j.jsx)(`td`,{children:e.seen.map(e=>rA.seen[e]??e).join(`, `)})]},`${e.repo}|${e.at}`))})]}):(0,j.jsx)(`p`,{className:`work-say`,children:rA.noCallers})}),(0,j.jsx)(F,{title:rA.operations,span:`span 6`,labelledBy:`${t}-ops`,children:e.spec?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`work-say`,children:rA.specFrom(e.spec.path,e.spec.title,e.spec.version)}),(0,j.jsxs)(`table`,{className:`run-table`,children:[(0,j.jsx)(`caption`,{className:`sr`,children:rA.operations}),(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{scope:`col`,children:rA.opCols.op}),(0,j.jsx)(`th`,{scope:`col`,children:rA.opCols.line}),(0,j.jsx)(`th`,{scope:`col`,children:rA.opCols.calls})]})}),(0,j.jsx)(`tbody`,{children:e.spec.operations.map(e=>(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`td`,{children:(0,j.jsx)(`code`,{className:`mono`,children:`${e.method} ${e.path}`})}),(0,j.jsx)(`td`,{children:(0,j.jsx)(`code`,{className:`mono`,children:e.cite})}),(0,j.jsx)(`td`,{children:e.calls})]},e.id))})]})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`work-say`,children:rA.noSpec}),(e.addSpec??[]).map(e=>(0,j.jsx)(sA,{text:e},e)),(0,j.jsx)(`p`,{className:`work-say`,children:rA.noSpecWhy})]})}),(0,j.jsxs)(F,{title:rA.unmatched,span:`span 6`,labelledBy:`${t}-unmatched`,children:[e.unmatched.length?(0,j.jsx)(cA,{calls:e.unmatched,extra:e=>e.message}):(0,j.jsx)(`p`,{className:`work-say`,children:e.spec?rA.noUnmatched:rA.noSpec}),e.ambiguous.length>0&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`h3`,{className:`hud`,children:rA.ambiguous}),(0,j.jsx)(cA,{calls:e.ambiguous,extra:e=>rA.ambiguousOf(e.candidates.join(`, `))})]})]}),(e.shared||e.boundary===`internal`)&&(0,j.jsx)(F,{title:rA.shared,span:`1 / -1`,labelledBy:`${t}-shared`,children:e.shared?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`work-say`,children:rA.sharedFrom(e.shared.name,e.shared.commit,e.shared.importedAt)}),(0,j.jsxs)(`table`,{className:`run-table`,children:[(0,j.jsx)(`caption`,{className:`sr`,children:rA.shared}),(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{scope:`col`,children:rA.sharedCols.entry}),(0,j.jsx)(`th`,{scope:`col`,children:rA.sharedCols.repo}),(0,j.jsx)(`th`,{scope:`col`,children:rA.sharedCols.line}),(0,j.jsx)(`th`,{scope:`col`,children:rA.sharedCols.calls})]})}),(0,j.jsx)(`tbody`,{children:e.shared.entries.map(e=>(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`td`,{children:(0,j.jsx)(`code`,{className:`mono`,children:[e.method,e.path].filter(Boolean).join(` `)})}),(0,j.jsxs)(`td`,{children:[e.repo,e.component===e.repo?``:` (${e.component})`]}),(0,j.jsx)(`td`,{children:(0,j.jsx)(`code`,{className:`mono`,children:e.at})}),(0,j.jsx)(`td`,{children:e.calls})]},`${e.repo}|${e.fact}`))})]}),(0,j.jsx)(`h3`,{className:`hud`,children:rA.sharedUnmatched}),e.shared.unmatched.length?(0,j.jsx)(cA,{calls:e.shared.unmatched,extra:e=>e.message}):(0,j.jsx)(`p`,{className:`work-say`,children:rA.noSharedUnmatched})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`work-say`,children:rA.noShared}),(0,j.jsx)(sA,{text:rA.sharedImport(e.id)})]})}),(e.spec||e.contracts)&&(0,j.jsxs)(F,{title:rA.contracts,span:`1 / -1`,labelledBy:`${t}-contracts`,children:[(0,j.jsx)(`p`,{className:`work-say`,children:rA.contractsIntro}),e.contracts?.findings.length?(0,j.jsx)(`ul`,{className:`ev-list`,style:{margin:0},children:e.contracts.findings.map(t=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`span`,{className:`chip ${t.status===`mismatch`?`warn`:``}`,children:w.mismatches.status[t.status]}),` `,e.contracts?.new?.includes(t.id)&&(0,j.jsx)(`span`,{className:`chip warn`,children:rA.newWithSpec}),` `,t.message]},t.id))}):(0,j.jsx)(`p`,{className:`work-say`,children:rA.noContracts})]}),(0,j.jsx)(F,{title:rA.questions,span:`1 / -1`,labelledBy:`${t}-questions`,children:e.questions.length?(0,j.jsx)(`ul`,{className:`ev-list`,style:{margin:0},children:e.questions.map(e=>(0,j.jsxs)(`li`,{children:[e.question,` `,(0,j.jsxs)(`span`,{className:`muted`,children:[`(`,e.repo,`)`]}),` `,(0,j.jsx)(`a`,{href:`#/questions/${e.id}`,children:rA.answer})]},e.id))}):(0,j.jsx)(`p`,{className:`work-say`,children:rA.noQuestions})})]})}function uA({hash:e}){let t=P(`/api/outside`);lt(t);let n=Nn(e,`system`),r=t.state===`ready`?t.data.systems:[],i=n??r[0]?.id,a=r.find(e=>e.id===i);return(0,j.jsxs)(`div`,{className:`bento`,children:[(0,j.jsxs)(F,{title:rA.title,span:`1 / -1`,children:[(0,j.jsx)(`p`,{className:`work-say`,children:rA.intro}),(0,j.jsx)(I,{of:t,empty:e=>e.systems.length===0,emptyText:rA.empty,children:e=>(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(aA,{systems:e.systems,current:i}),n&&!a&&(0,j.jsx)(`p`,{role:`alert`,className:`state error`,children:rA.noSuchSystem(n)}),e.notes.length>0&&(0,j.jsxs)(`details`,{children:[(0,j.jsx)(`summary`,{children:rA.notes}),(0,j.jsx)(`ul`,{className:`ev-list`,children:e.notes.map(e=>(0,j.jsx)(`li`,{children:e},e))})]})]})})]}),a&&(0,j.jsx)(lA,{system:a})]})}var dA=w.mismatches,fA=[`all`,`mismatch`,`unconfirmed`],pA=e=>[e.what,e.value?`: ${e.value}`:``,e.at?` (${e.at})`:``].join(``);function mA({link:e,list:t}){let n=(0,v.useId)(),r=[e.method,e.path].filter(Boolean).join(` `),i=e.entry?.repo??e.system??``,a=dA.link(e.call.repo,r,i,e.through.join(`, `));return(0,j.jsxs)(`section`,{className:`stack`,style:{gap:4},"aria-labelledby":n,children:[(0,j.jsx)(`h3`,{className:`hud`,id:n,style:{margin:0},children:(0,j.jsx)(`code`,{className:`mono`,children:a})}),e.specs.length>0&&(0,j.jsx)(`p`,{className:`work-say`,children:dA.specs(e.specs.join(`, `))}),(0,j.jsxs)(`table`,{className:`run-table`,children:[(0,j.jsx)(`caption`,{className:`sr`,children:a}),(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{scope:`col`,children:dA.cols.kind}),(0,j.jsx)(`th`,{scope:`col`,children:dA.cols.says}),(0,j.jsx)(`th`,{scope:`col`,children:dA.cols.sender}),(0,j.jsx)(`th`,{scope:`col`,children:dA.cols.receiver})]})}),(0,j.jsx)(`tbody`,{children:t.map(e=>(0,j.jsxs)(`tr`,{children:[(0,j.jsxs)(`td`,{children:[(0,j.jsxs)(`span`,{className:`chip ${e.status===`mismatch`?`warn`:``}`,children:[e.status===`mismatch`&&(0,j.jsx)(`span`,{"aria-hidden":`true`,children:`⚠ `}),dA.status[e.status]]}),` `,dA.kinds[e.kind]??e.kind]}),(0,j.jsxs)(`td`,{children:[e.message,e.via?.length?(0,j.jsx)(`div`,{className:`work-say`,children:dA.via(e.via.join(`, `))}):null]}),(0,j.jsx)(`td`,{children:(0,j.jsx)(`code`,{className:`mono`,children:pA(e.sender)})}),(0,j.jsx)(`td`,{children:(0,j.jsx)(`code`,{className:`mono`,children:pA(e.receiver)})})]},e.id))})]})]})}function hA({view:e}){let[t,n]=(0,v.useState)(`all`),r=(0,v.useId)(),i=e.findings.filter(e=>t===`all`||e.status===t),a=e.links.map(e=>({l:e,list:i.filter(t=>t.id.startsWith(`${e.key}#`))})).filter(e=>e.list.length),o=e.counts;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`work-say`,children:dA.counts(o.mismatches,o.unconfirmed,o.links,o.compared)}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:6,alignItems:`center`},children:[(0,j.jsx)(`label`,{htmlFor:r,children:dA.filter}),(0,j.jsx)(`select`,{id:r,value:t,onChange:e=>n(e.target.value),children:fA.map(e=>(0,j.jsx)(`option`,{value:e,children:dA.filters[e]},e))}),(0,j.jsx)(`code`,{className:`mono`,children:dA.command}),(0,j.jsx)(sr,{text:dA.command,label:dA.commandLabel})]}),(0,j.jsxs)(`div`,{className:`stack`,style:{gap:12},children:[a.map(({l:e,list:t})=>(0,j.jsx)(mA,{link:e,list:t},e.key)),a.length===0&&(0,j.jsx)(`p`,{className:`state empty`,children:t===`all`?dA.noneAtAll:dA.noneShown})]}),e.notes.length>0&&(0,j.jsxs)(`details`,{children:[(0,j.jsx)(`summary`,{children:dA.notes}),(0,j.jsx)(`ul`,{className:`ev-list`,children:e.notes.map(e=>(0,j.jsx)(`li`,{children:e},e))})]})]})}function gA(){let e=P(`/api/contracts`);return lt(e),(0,j.jsx)(`div`,{className:`bento`,children:(0,j.jsxs)(F,{title:dA.title,span:`1 / -1`,children:[(0,j.jsx)(`p`,{className:`work-say`,children:dA.intro}),e.state===`ready`&&!!e.data.counts.unlinked&&(0,j.jsx)(`p`,{className:`state`,style:{margin:`0 0 8px`},children:dA.unlinked(e.data.counts.unlinked)}),(0,j.jsx)(I,{of:e,empty:e=>e.counts.compared===0,emptyText:dA.empty,children:e=>(0,j.jsx)(hA,{view:e})})]})})}var _A=w.decisions,vA=e=>e.slice(0,10);function yA(e){let t=e.now.links===`auto`||e.now.questions===`auto`,n=e.decideIn;if(!t||!n)return;let r=n.includes(`copilot-acp`),i=n.includes(`hand-off`);return r&&i?_A.decideIn.both:i?_A.decideIn.handoff:r?_A.decideIn.acp:_A.decideIn.none}var bA=e=>e.kind===`ai`?_A.batchKind.ai:e.correction?.rule?_A.batchKind.rule:_A.batchKind.correction;function xA(e,t){return e.filter(e=>(!t.repo||e.repo===t.repo)&&(!t.kind||e.kind===t.kind))}function SA(e){let{d:t}=e;return(0,j.jsxs)(`li`,{className:`stack`,style:{gap:4},children:[(0,j.jsxs)(`p`,{style:{margin:0},children:[(0,j.jsx)(`span`,{className:`hud`,children:_A.kind[t.kind]??t.kind}),` `,(0,j.jsx)(`span`,{children:t.what})]}),(0,j.jsxs)(`p`,{className:`ev-say`,style:{margin:0},children:[_A.decided(t.kind===`link`&&t.to?`${t.to.repo} ${`${t.to.method??``} ${t.to.path}`.trim()}`:t.decided),t.bar&&` ${_A.because(_A.bar[t.bar]??t.bar)}`]}),t.cites.length>0&&(0,j.jsxs)(`p`,{className:`hud`,style:{margin:0},children:[_A.restsOn,`: `,(0,j.jsx)(`span`,{className:`mono`,children:t.cites.join(`, `)})]}),(0,j.jsx)(Fi,{item:t.item,run:t.run,onOpen:e.onOpen,onClose:e.onClose})]})}function CA(e){let[t,n]=(0,v.useState)({}),r=e=>n(t=>({...t,[e.item]:e})),i=e=>n(t=>{let{[e]:n,...r}=t;return r}),[a,o]=(0,v.useState)({}),s=(t,n)=>{o(e=>({...e,[t]:n})),e.of.reload?.()},c=e=>o(t=>{let{[e]:n,...r}=t;return r});return(0,j.jsx)(`div`,{className:`bento`,children:(0,j.jsxs)(F,{title:_A.title,span:`1 / -1`,children:[(0,j.jsx)(`p`,{className:`work-why`,style:{marginTop:0},children:_A.intro}),(0,j.jsx)(I,{of:e.of,children:n=>{let o=[...n.links.items,...n.questions.items],l=[...o,...Object.values(t).filter(e=>!o.some(t=>t.item===e.item))],u=[...new Set([...l.map(e=>e.repo),...e.repo?[e.repo]:[]])].filter(Boolean).sort((e,t)=>e.localeCompare(t)),d=xA(l,e);return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:12},children:[(0,j.jsx)(qi,{decide:n.decide}),(0,j.jsxs)(`p`,{className:`ev-say`,style:{margin:0},children:[_A.modeLine(_A.mode[n.decide.now.links]??n.decide.now.links,_A.mode[n.decide.now.questions]??n.decide.now.questions),` `,yA(n.decide),` `,(0,j.jsx)(`a`,{href:`#/ai`,children:_A.setUp})]}),(0,j.jsx)(Pi,{counts:n.links.counts,what:_A.counts.linksInMap}),n.links.lines&&(n.links.lines.byAi!==n.links.counts.byAi||n.links.lines.byPerson>n.links.counts.byPerson)&&(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:_A.counts.lines(n.links.lines.byAi,n.links.lines.byPerson)}),(0,j.jsx)(Pi,{counts:n.questions.counts,what:_A.counts.questions}),n.problems.length>0&&(0,j.jsxs)(`div`,{className:`state error`,role:`alert`,children:[(0,j.jsx)(`p`,{style:{margin:0},children:_A.problems}),(0,j.jsx)(`ul`,{style:{margin:0},children:n.problems.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`span`,{className:`mono`,children:e.file}),`: `,e.message]},e.file))})]}),(0,j.jsxs)(`section`,{className:`stack`,"aria-labelledby":`decisions-items`,style:{gap:8},children:[(0,j.jsx)(`h3`,{id:`decisions-items`,className:`hud`,style:{margin:0},children:_A.itemsTitle}),l.length===0?(0,j.jsx)(`div`,{className:`state`,children:_A.itemsEmpty}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`,alignItems:`flex-end`},children:[(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`label`,{htmlFor:`decisions-repo`,className:`hud`,style:{fontSize:10},children:_A.filterRepo}),(0,j.jsxs)(`select`,{id:`decisions-repo`,className:`field`,value:e.repo,onChange:t=>e.onRepo(t.target.value),children:[(0,j.jsx)(`option`,{value:``,children:_A.allRepos}),u.map(e=>(0,j.jsx)(`option`,{value:e,children:e},e))]})]}),(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`label`,{htmlFor:`decisions-kind`,className:`hud`,style:{fontSize:10},children:_A.filterKind}),(0,j.jsxs)(`select`,{id:`decisions-kind`,className:`field`,value:e.kind,onChange:t=>e.onKind(t.target.value),children:[(0,j.jsx)(`option`,{value:``,children:_A.allKinds}),(0,j.jsx)(`option`,{value:`link`,children:_A.kinds.link}),(0,j.jsx)(`option`,{value:`question`,children:_A.kinds.question})]})]}),(0,j.jsx)(`p`,{role:`status`,className:`hud`,style:{margin:0},children:_A.shown(d.length,l.length)})]}),d.length===0?(0,j.jsx)(`div`,{className:`state`,children:_A.itemsFiltered}):(0,j.jsx)(`ul`,{className:`stack`,"aria-label":_A.itemsCaption,style:{gap:12,listStyle:`none`,padding:0,margin:0},children:d.map(e=>(0,j.jsx)(SA,{d:e,onOpen:r,onClose:()=>i(e.item)},e.item))})]})]}),(0,j.jsxs)(`section`,{className:`stack`,"aria-labelledby":`decisions-batches`,style:{gap:8},children:[(0,j.jsx)(`h3`,{id:`decisions-batches`,className:`hud`,style:{margin:0},children:_A.batchesTitle}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:_A.batchesIntro}),n.batches.length===0?(0,j.jsx)(`div`,{className:`state`,children:_A.batchesEmpty}):(0,j.jsxs)(`table`,{className:`run-table`,children:[(0,j.jsx)(`caption`,{className:`sr`,children:_A.batchesCaption}),(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{scope:`col`,children:_A.batchCol.batch}),(0,j.jsx)(`th`,{scope:`col`,children:_A.batchCol.by}),(0,j.jsx)(`th`,{scope:`col`,children:_A.batchCol.what}),(0,j.jsx)(`th`,{scope:`col`,children:_A.batchCol.undo})]})}),(0,j.jsx)(`tbody`,{children:n.batches.map(e=>(0,j.jsxs)(`tr`,{children:[(0,j.jsxs)(`th`,{scope:`row`,style:{fontWeight:`normal`},children:[(0,j.jsx)(`code`,{className:`mono`,children:e.id}),(0,j.jsx)(`div`,{children:e.kind===`ai`?(0,j.jsx)(Ni,{run:e.run,short:!0}):(0,j.jsx)(`span`,{className:`chip done`,children:bA(e)})})]}),(0,j.jsx)(`td`,{children:_A.batchBy(e.by,vA(e.at))}),(0,j.jsxs)(`td`,{children:[_A.batchApplied(e.applied,e.reverted),e.correction&&(0,j.jsxs)(`div`,{className:`muted`,children:[_A.batchFrom(e.correction.item,e.correction.answer),e.correction.rule&&(0,j.jsx)(`div`,{className:`mono`,children:_A.batchRule(e.correction.rule.kind,e.correction.rule.match)})]}),(0,j.jsx)(`div`,{className:`hud`,children:_A.record(e.file)})]}),(0,j.jsxs)(`td`,{children:[a[e.id]&&(0,j.jsx)(Gi,{r:a[e.id],onDismiss:()=>c(e.id)}),e.undone?(0,j.jsx)(`span`,{className:`chip dim`,children:_A.undone(e.undone.by,vA(e.undone.at))}):!a[e.id]&&(0,j.jsx)(Ki,{b:e,onDone:t=>s(e.id,t)})]})]},e.id))})]})]})]})}})]})})}function wA({hash:e}){let t=Oi(),[n,r]=(0,v.useState)(()=>Nn(e,`repo`)??``),[i,a]=(0,v.useState)(()=>Nn(e,`kind`)??``);(0,v.useEffect)(()=>{r(Nn(e,`repo`)??``),a(Nn(e,`kind`)??``)},[e]);let o={...t?.view??{state:`loading`},...t?{reload:t.reload}:{}};return(0,j.jsx)(CA,{of:o,repo:n,kind:i,onRepo:e=>{r(e),Pn(`decisions`,`repo`,e)},onKind:e=>{a(e),Pn(`decisions`,`kind`,e)}})}var TA=3,EA=w.crossCheck,DA=[`readers-only`,`disagree`,`facts-only`,`dismissed`,`all`],OA=e=>e&&/^[0-9a-f]{8,}$/.test(e)?e.slice(0,7):e??``;function kA(e){return e==null?EA.nothing:typeof e==`string`?e:typeof e==`object`&&!Array.isArray(e)?Object.entries(e).map(([e,t])=>`${e}: ${typeof t==`string`?t:JSON.stringify(t)}`).join(` · `):JSON.stringify(e)}function AA(e,t){let n=t.find.trim().toLowerCase();return e.filter(e=>(t.show===`dismissed`?!e.dismissed:t.show!==`all`&&(e.dismissed||e.state!==t.show))||t.kind&&e.kind!==t.kind?!1:!n||[e.key,e.readers?.id,e.facts?.id,...(e.readers?.cites??[]).map(e=>e.file),...(e.facts?.cites??[]).map(e=>e.file)].join(` `).toLowerCase().includes(n))}function jA(e){return{"readers-only":e.filter(e=>e.state===`readers-only`&&!e.dismissed).length,disagree:e.filter(e=>e.state===`disagree`&&!e.dismissed).length,"facts-only":e.filter(e=>e.state===`facts-only`).length,dismissed:e.filter(e=>e.dismissed).length,all:e.length}}function MA(e){let t=jA(e);return t[`readers-only`]?`readers-only`:t.disagree?`disagree`:`all`}function NA({cites:e,commit:t}){return e.length?(0,j.jsx)(`ul`,{className:`xc-cites mono`,children:e.map(e=>(0,j.jsxs)(`li`,{children:[e.file,e.line?`:${e.line}`:``,e.commit&&e.commit!==t?` @ ${OA(e.commit)}`:``]},`${e.file}:${e.line??``}`))}):null}function PA({plan:e}){let t=e.cite;return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,j.jsx)(`p`,{style:{margin:0},children:EA.promoteFact(e.factKind??``,e.fact??``)}),(0,j.jsx)(`p`,{className:`mono`,style:{margin:0},children:EA.promoteCite(`${t.file}:${t.line}`,OA(t.commit))}),t.text===void 0?(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:EA.promoteNoText}):(0,j.jsx)(`pre`,{className:`xc-line mono`,children:t.text}),(0,j.jsx)(`p`,{style:{margin:0},children:EA.promoteValue(t.value)}),(0,j.jsxs)(`p`,{className:`work-say`,style:{margin:0},children:[e.already?EA.promoteAlready:EA.promoteInto(e.factsFile),e.fromSnapshot?` ${EA.promoteFromSnapshot(e.factsFile)}`:``]})]})}function FA({repo:e,p:t}){return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`span`,{style:{alignSelf:`flex-start`},className:`chip ${t.state===`verified`?`done`:t.state===`rejected`?`blocking`:`warn`}`,children:EA.promoted[t.state]??t.state}),(0,j.jsxs)(`span`,{className:`work-say mono`,children:[t.fact,` · `,t.file,`:`,t.line]}),t.state===`verified`&&(0,j.jsx)(`span`,{className:`work-say`,children:EA.promotedVerifiedHint(e)}),t.state===`rejected`&&(0,j.jsxs)(`span`,{className:`work-say`,children:[t.message?`${t.message} `:``,EA.promotedRejectedHint]})]})}function IA(e){let[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)();if(e.item.state===`facts-only`)return(0,j.jsx)(`p`,{className:`work-say xc-note`,children:EA.factsOnlyNote});let l=!!e.item.dismissed,u=!!e.steps&&e.item.state===`readers-only`&&!e.item.dismissed&&(!e.item.promoted||e.item.promoted.state===`rejected`),d=()=>{o(!0),i(void 0),e.steps.preview(e.repo,e.item.key).then(e=>e.can?c(e):i(EA.promoteCant(e.why??``)),e=>i(EA.failed(bc(e)))).finally(()=>o(!1))},f=async()=>{n(!0),i(void 0);try{await e.run(e.repo,e.item.key,l,l?void 0:e.item.readersSha256),e.onDone(l?EA.undismissedNote(e.item.key):EA.dismissedNote(e.item.key))}catch(e){i(EA.failed(e instanceof Zn?e.lines.join(` `)||e.message:e instanceof Error?e.message:String(e)))}finally{n(!1)}};return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsxs)(`div`,{className:`row`,style:{gap:6,flexWrap:`wrap`},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:t,"aria-busy":t,"aria-label":l?EA.undismissOf(e.item.key):EA.dismissOf(e.item.key),onClick:()=>void f(),children:t?EA.working:l?EA.undismiss:EA.dismiss}),u&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:a||t,"aria-busy":a,"aria-label":EA.promoteOf(e.item.key),onClick:d,children:a?EA.promoteLoading:EA.promote})]}),r&&(0,j.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:0},children:r}),s&&(0,j.jsx)(xc,{title:EA.promoteTitle,intro:EA.promoteIntro(e.repo),confirm:EA.promoteConfirm,working:EA.working,onConfirm:async()=>{try{await e.steps.promote(e.repo,e.item.key,s.sha256),c(void 0),e.onDone(EA.promotedNote(e.item.key))}catch(t){if(!(t instanceof Zn))throw t;if(c(void 0),t.code===TA){i(EA.promoteRefused(t.lines.at(-1)??t.message));return}i(EA.promoteVerifyStopped(t.lines.at(-1)??t.message)),e.onDone(EA.promotedNote(e.item.key))}},onClose:()=>c(void 0),children:(0,j.jsx)(PA,{plan:s})})]})}function LA(e){let{item:t}=e;return(0,j.jsxs)(`li`,{className:`xc-item xc-${t.state}`,children:[(0,j.jsxs)(`div`,{className:`xc-head`,children:[(0,j.jsx)(`span`,{className:`chip ${t.state===`facts-only`?`dim`:t.state===`disagree`?`blocking`:`warn`}`,children:EA.itemState[t.state]??t.state}),(0,j.jsx)(`span`,{className:`hud`,children:t.kind}),t.dismissed&&(0,j.jsx)(`span`,{className:`chip dim`,children:EA.dismissed})]}),(0,j.jsx)(`p`,{className:`xc-key mono`,children:t.key.slice(t.kind.length+1)}),t.state===`disagree`?(0,j.jsxs)(`table`,{className:`xc-fields`,children:[(0,j.jsx)(`caption`,{className:`sr`,children:EA.fieldsCaption(t.key)}),(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{scope:`col`,children:EA.field}),(0,j.jsx)(`th`,{scope:`col`,children:EA.readersSay}),(0,j.jsx)(`th`,{scope:`col`,children:EA.factsSay})]})}),(0,j.jsx)(`tbody`,{children:(t.fields??[]).map(e=>(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{scope:`row`,className:`mono`,children:e.field}),(0,j.jsx)(`td`,{className:`mono`,children:kA(e.readers)}),(0,j.jsx)(`td`,{className:`mono`,children:kA(e.facts)})]},e.field))})]}):(0,j.jsx)(`p`,{className:`xc-value mono`,children:kA((t.readers??t.facts)?.value)}),(0,j.jsxs)(`div`,{className:`xc-sides`,children:[t.readers&&(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`span`,{className:`hud`,children:EA.readersSay}),(0,j.jsx)(NA,{cites:t.readers.cites,...e.repo.readersCommit?{commit:e.repo.readersCommit}:{}})]}),t.facts&&(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`span`,{className:`hud`,children:EA.factsSay}),(0,j.jsx)(NA,{cites:t.facts.cites,...e.repo.factsCommit?{commit:e.repo.factsCommit}:{}})]})]}),t.promoted&&(0,j.jsx)(FA,{repo:e.repo.repo,p:t.promoted}),(0,j.jsx)(IA,{repo:e.repo.repo,item:t,run:e.run,steps:e.steps,onDone:e.onDone})]})}function RA(e){let[t,n]=(0,v.useState)(``),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)();return(0,j.jsx)(I,{of:e.of,children:s=>{if(s.state!==`compared`)return(0,j.jsxs)(`div`,{className:`state`,role:`note`,children:[(0,j.jsx)(`p`,{style:{margin:0},children:EA.state[s.state]}),s.problem&&(0,j.jsx)(`p`,{className:`work-say mono`,style:{margin:`4px 0 0`},children:s.problem}),(s.readersCommit||s.factsCommit)&&(0,j.jsx)(`p`,{className:`work-say`,style:{margin:`4px 0 0`},children:EA.commits(OA(s.readersCommit)||`–`,OA(s.factsCommit)||`–`)})]});let c=jA(s.items),l=e.show??MA(s.items),u=[...new Set(s.items.map(e=>e.kind))].sort((e,t)=>e.localeCompare(t)),d=AA(s.items,{show:l,kind:t,find:r}),f=s.head&&s.readersCommit&&!s.head.startsWith(s.readersCommit)&&!s.readersCommit.startsWith(s.head);return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:10},children:[(0,j.jsxs)(`p`,{className:`work-say`,style:{margin:0},children:[EA.commits(OA(s.readersCommit),OA(s.factsCommit)),f&&` ${EA.behind(OA(s.head))}`]}),(0,j.jsx)(`p`,{className:`hud`,style:{margin:0},children:EA.counts(s.counts.readersOnly,s.counts.disagree,s.counts.factsOnly,s.counts.agree)}),s.items.length===0?(0,j.jsx)(`div`,{className:`state`,children:EA.allAgree}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`xc-filters`,children:[(0,j.jsxs)(`fieldset`,{className:`xc-show`,children:[(0,j.jsx)(`legend`,{className:`hud`,children:EA.filterLabel}),DA.map(t=>(0,j.jsxs)(`label`,{className:`xc-seg${t===l?` on`:``}`,children:[(0,j.jsx)(`input`,{type:`radio`,name:`xc-show-${s.repo}`,value:t,checked:t===l,onChange:()=>e.onShow(t)}),EA.filter[t](c[t])]},t))]}),(0,j.jsxs)(`div`,{className:`xc-narrow`,children:[(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`label`,{htmlFor:`xc-kind`,className:`hud`,children:EA.kindLabel}),(0,j.jsxs)(`select`,{id:`xc-kind`,className:`field`,value:t,onChange:e=>n(e.target.value),children:[(0,j.jsx)(`option`,{value:``,children:EA.allKinds}),u.map(e=>(0,j.jsx)(`option`,{value:e,children:e},e))]})]}),(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`label`,{htmlFor:`xc-find`,className:`hud`,children:EA.searchLabel}),(0,j.jsx)(`input`,{id:`xc-find`,type:`search`,className:`field`,placeholder:EA.searchHint,value:r,onChange:e=>i(e.target.value)})]})]})]}),(0,j.jsxs)(`p`,{role:`status`,className:`hud`,style:{margin:0},children:[EA.shown(d.length,s.items.length),a?` · ${a}`:``]}),d.length===0?(0,j.jsx)(`div`,{className:`state`,children:EA.noneShown}):(0,j.jsx)(`ul`,{className:`xc-list`,"aria-label":EA.listLabel(s.repo),children:d.map(t=>(0,j.jsx)(LA,{repo:s,item:t,run:e.run,steps:e.steps,onDone:t=>{o(t),e.of.reload?.(),e.onChanged?.()}},`${t.state}|${t.key}`))}),(0,j.jsxs)(`p`,{className:`work-say`,style:{margin:0},children:[EA.dismissHint,` `,EA.proposeHint,` `,(0,j.jsx)(`span`,{className:`mono`,children:s.dismissals})]})]})]})}})}function zA(e){return[...e.repos.filter(e=>e.state===`compared`),...e.repos.filter(e=>e.state!==`compared`)]}function BA(e){return(0,j.jsx)(`div`,{className:`bento xc`,children:(0,j.jsxs)(F,{title:EA.title,span:`1 / -1`,children:[(0,j.jsx)(`p`,{className:`work-why`,style:{marginTop:0},children:EA.intro}),(0,j.jsx)(I,{of:e.list,empty:e=>!e.repos.some(e=>e.state!==`no-facts`)&&!e.problems.length,emptyText:EA.empty,children:t=>{let n=zA(t),r=e.repo??n[0]?.repo??``;return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:12},children:[t.problems.length>0&&(0,j.jsxs)(`div`,{className:`state error`,role:`alert`,children:[(0,j.jsx)(`p`,{style:{margin:0},children:EA.problems}),(0,j.jsx)(`ul`,{style:{margin:0},children:t.problems.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`span`,{className:`mono`,children:e.file}),`: `,e.message]},e.file))})]}),(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4,maxWidth:360},children:[(0,j.jsx)(`label`,{htmlFor:`xc-repo`,className:`hud`,children:EA.repoPicker}),(0,j.jsx)(`select`,{id:`xc-repo`,className:`field`,value:r,onChange:t=>e.onRepo(t.target.value),children:n.map(e=>(0,j.jsx)(`option`,{value:e.repo,children:e.state===`compared`?`${e.repo} · ${EA.pickerCounts(e.counts.readersOnly,e.counts.disagree)}`:`${e.repo} · ${EA.state[e.state]?.split(`:`)[0]??e.state}`},e.repo))})]}),(0,j.jsx)(An,{id:e.job}),e.one&&(0,j.jsx)(RA,{of:e.one,show:e.show,onShow:e.onShow,run:e.run,steps:e.steps,onChanged:e.list.reload})]})}})]})})}function VA({hash:e}){let t=P(`/api/crosscheck`),[n,r]=(0,v.useState)(()=>Nn(e,`repo`)),[i,a]=(0,v.useState)(()=>{let t=Nn(e,`show`);return t&&DA.includes(t)?t:void 0}),[o,s]=(0,v.useState)();(0,v.useEffect)(()=>{r(Nn(e,`repo`));let t=Nn(e,`show`);a(t&&DA.includes(t)?t:void 0)},[e]);let c=(0,v.useMemo)(()=>t.state===`ready`?zA(t.data)[0]?.repo:void 0,[t]),l=n??c,u=P(l?`/api/crosscheck/${encodeURIComponent(l)}`:void 0);return lt(t,u),(0,j.jsx)(BA,{list:t,repo:l,onRepo:e=>{r(e),a(void 0),Pn(`crosscheck`,`repo`,e,{drop:[`show`]})},one:l?u:void 0,show:i,onShow:e=>{a(e),Pn(`crosscheck`,`show`,e)},run:(e,t,n,r)=>Qn(`/api/crosscheck/${encodeURIComponent(e)}/dismiss`,n?{key:t,undo:!0}:{key:t,...r?{sha256:r}:{}},void 0,s),steps:{preview:(e,t)=>N(`/api/crosscheck/${encodeURIComponent(e)}/promote?key=${encodeURIComponent(t)}`),promote:(e,t,n)=>Qn(`/api/crosscheck/${encodeURIComponent(e)}/promote`,{key:t,sha256:n},void 0,s)},job:o})}var HA=w.roleWork.home,UA=w.roleWork;function WA(e){return e.length>0&&e.every(e=>e===`product`||e===`analysis`)}var GA=(e,t)=>!!e&&!!t&&e.people.some(e=>e.toLowerCase()===t.replace(/^@/,``).toLowerCase());function KA(e){let t=e.waitsOn,n=GA(t,e.me),r=t?UA.roleNames[t.role]??t.role:void 0,i=t&&!n?t.people.length?HA.waitsOnOther(`${t.people.map(e=>`@${e}`).join(`, `)} (${r})`):UA.waitsOnNobody(r??t.role):void 0;return(0,j.jsxs)(`li`,{children:[(0,j.jsxs)(`span`,{className:`hm-row-main`,children:[(0,j.jsx)(`a`,{className:`hm-row-title`,href:`#/changes/${encodeURIComponent(e.c.id)}`,children:e.c.title}),(0,j.jsxs)(`span`,{className:`hm-row-sub`,children:[e.c.id,i?` · ${i}`:``]})]}),(0,j.jsxs)(`span`,{className:`hm-row-end`,children:[e.c.blocked&&(0,j.jsx)(`span`,{className:`chip blocking`,children:w.commandCenter.blocked}),n&&(0,j.jsx)(`span`,{className:`chip warn`,children:HA.waitsOnYou}),(0,j.jsx)(`span`,{className:`chip dim`,children:e.stage})]})]})}function qA(e){let t=P(`/api/changes/${encodeURIComponent(e.c.id)}/cockpit`);return lt(t),(0,j.jsx)(KA,{...e,waitsOn:t.state===`ready`?t.data.waitsOn:void 0})}function JA(e){return e.fold?(0,j.jsxs)(`details`,{className:`panel`,children:[(0,j.jsx)(`summary`,{className:`hud`,children:HA.admin}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:`6px 0`,fontSize:12.5},children:HA.adminIntro}),(0,j.jsx)(`div`,{className:`stack`,style:{gap:12},children:e.children})]}):(0,j.jsx)(j.Fragment,{children:e.children})}var YA={define:`brief`,design:`arch-review`,plan:`breakdown`,build:`tasks`,qa:`trace`,"release-ready":`release`,"post-release-review":`release`,returned:`brief`},XA=[[`brief`,`brief`],[`proposal`,`brief`],[`ux`,`ux`],[`design`,`arch-review`],[`interfaces`,`arch-review`],[`data`,`arch-review`],[`mappings`,`mappings`],[`stories`,`breakdown`],[`specs`,`breakdown`],[`tasks`,`breakdown`],[`snow`,`breakdown`],[`tests`,`trace`],[`security`,`release`]],ZA=(e,t)=>`#/${e}${t?`?change=${encodeURIComponent(t)}`:``}`;function QA(e,t){return!e||!t?!0:t===`draft`||t===`define`||t===`returned`?e===`business`:t!==`design`||e!==`delivery`}function $A(e){if(!e.length)return;let t=new Set;for(let n of e)(n===`product`||n===`analysis`)&&t.add(`business`),n===`architecture`&&[`business`,`design`].forEach(e=>t.add(e)),n===`delivery`&&[`business`,`design`,`delivery`].forEach(e=>t.add(e));return[...t]}function ej(e){let t=[];for(let n of e.changes){let e=YA[n.state];e&&t.push({kind:`phase`,title:`${n.title} is in ${n.state}`,detail:`${n.id} · ${n.type}`,href:ZA(e,n.id),id:n.id,change:n.id,...n.updatedAt?{since:n.updatedAt}:{}})}let n=new Map(e.changes.map(e=>[e.id,e.state]));for(let r of e.findings)r.state===`open`&&(r.severity===`blocking`||r.severity===`gap`)&&(!e.levels||!r.asks||e.levels.includes(r.asks))&&t.push({kind:`finding`,title:r.summary,detail:`${r.severity} · ${r.artifact}${r.change?` · ${r.change}`:``}`,href:ZA(XA.find(([e])=>r.artifact.startsWith(e))?.[1]??`changes`,r.change),id:r.id,...r.change?{change:r.change}:{},...r.severity===`blocking`&&QA(r.asks,r.change?n.get(r.change):void 0)?{blocking:!0}:{}});for(let n of e.needs??[])n.status===`open`&&t.push({kind:`need`,title:n.title,detail:[n.kind,n.handledBy,n.leadTime,n.change].filter(Boolean).join(` · `),href:`#/changes?across=needs`,id:n.item,change:n.change});for(let n of e.triage)t.push({kind:`triage`,title:n.summary,detail:n.kind,href:`#/intake`,id:n.id});for(let n of e.questions)t.push({kind:`question`,title:n.question,detail:`${n.system??``}${n.owner?` · ask ${n.owner}`:``}`,href:`#/questions?kind=owner`,id:n.id,...n.system?{repo:n.system}:{}});for(let n of e.questionFiles??[])t.push({kind:`question`,title:n.question,detail:`${n.repo} · ${n.id}`,href:`#/questions/${encodeURIComponent(n.id)}`,id:n.id,repo:n.repo});for(let n of e.steps)t.push({kind:`step`,title:n.title,detail:`${n.system}${n.change?` · ${n.change}`:``}`,href:`#/todo`,id:n.id,...n.change?{change:n.change}:{}});return e.knowledgeToVerify&&t.push({kind:`knowledge`,title:w.commandCenter.knowledgeToVerify(e.knowledgeToVerify),detail:w.commandCenter.knowledgeDetail,href:`#/knowledge`}),t}var tj=[`need`,`finding`,`step`],nj=[`question`,`need`,`finding`,`step`,`triage`,`knowledge`];function rj(e,t,n){let r=e.filter(e=>e.kind!==`phase`),i=new Map(t.map((e,t)=>[e.id,{...e,n:t}])),a=r.filter(e=>ti([e.title,e.id,e.change,e.change&&i.get(e.change)?.title,e.repo],n)),o=(e,t)=>t.flatMap(t=>{let n=e.filter(e=>e.kind===t);return n.length?t===`finding`?[{kind:t,items:[...n.filter(e=>e.blocking),...n.filter(e=>!e.blocking)]}]:t===`question`?[...new Set(n.map(e=>e.repo??``))].sort((e,t)=>e?t?e.localeCompare(t):-1:1).map(e=>({kind:t,...e?{repo:e}:{},items:n.filter(t=>(t.repo??``)===e)})):[{kind:t,items:n}]:[]}),s=[...new Set(a.map(e=>e.change).filter(e=>!!e))],c=e=>i.get(e.change??``)?.n??2**53-1,l=s.map(e=>{let t=a.filter(t=>t.change===e),n=i.get(e);return{change:e,title:n?.title??e,...n?.state?{state:n.state}:{},blocking:t.filter(e=>e.blocking).length,count:t.length,sections:o(t,tj)}}).sort((e,t)=>Number(t.blocking>0)-Number(e.blocking>0)||c(e)-c(t)),u=a.filter(e=>!e.change);return u.length&&l.push({title:w.commandCenter.noChangeGroup,blocking:0,count:u.length,sections:o(u,nj)}),{groups:l,shown:a.length,total:r.length}}var ij=w.questions.ownerQuestions;function aj(e){let t=new URLSearchParams(e.split(`?`)[1]??``).get(`kind`);return t===`owner`||t===`steps`?t:void 0}function oj(e,t,n){return e||(t===0&&(n??0)>0?`owner`:`steps`)}function sj(e,t){return e===void 0||t===void 0?{n:void 0,href:`#/questions`}:{n:e+t,href:e===0&&t>0?`#/questions?kind=owner`:`#/questions`}}function cj(e){return(0,j.jsx)(I,{of:e.of,empty:e=>e.empty||e.questions.length===0,emptyContent:e.of.state===`ready`?(0,j.jsx)(`div`,{className:`state`,children:e.of.data.empty?ij.emptyCatalog:ij.empty}):void 0,children:t=>(0,j.jsx)(`ul`,{className:`qs-owner-list`,children:t.questions.map(t=>(0,j.jsx)(`li`,{children:(0,j.jsx)(fj,{q:t,onAnswered:()=>e.onAnswered?.()})},t.id))})})}function lj({id:e,owner:t,again:n=!1,sentOn:r,onSent:i,onAlready:a}){let o=w.roleWork.send,[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(),[d,f]=(0,v.useState)(!1),[p,m]=(0,v.useState)(!1),h=n||d,g=async n=>{c(!0),u(void 0);try{let r=await Jn(`owner-ask`,e).catch(()=>({})),a=await N(`/api/owner-questions/${encodeURIComponent(e)}/send`,{method:`POST`,body:{...r,...n?{again:!0}:{}}});(a.state===`sent`||a.state===`step`)&&i?.(new Date().toISOString(),a.state),u(a.state===`sent`?{ok:!0,text:o.sent(t)}:a.state===`step`?{ok:!0,text:a.why??o.step}:{ok:!1,text:o.notSent(a.why??``)})}catch(e){if(e instanceof M&&e.problem.status===409){let n=e.problem.code===`being-sent`;n||f(!0),u({ok:!1,text:n?o.beingSent(t):o.already(t)}),a?.()}else u({ok:!1,text:nr(e)})}finally{c(!1)}};return(0,j.jsxs)(`div`,{className:`qs-group-btns`,children:[(0,j.jsx)(`button`,{type:`button`,className:h?`btn`:`btn primary`,disabled:s||p,onClick:()=>h?m(!0):void g(!1),children:s?o.sending:h?o.again(t):o.button(t)}),p&&(0,j.jsxs)(`span`,{role:`group`,"aria-label":o.again(t),className:`qs-group-btns`,children:[(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12.5},children:o.confirmAgain(t,r)}),(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,onClick:()=>{m(!1),g(!0)},children:o.yesAgain}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>m(!1),children:o.cancel})]}),l&&(0,j.jsx)(`span`,{role:l.ok?`status`:`alert`,className:l.ok?`muted`:`state error`,style:{fontSize:12.5},children:l.text})]})}function uj(e){if(!e)return;let t=new Date(e);if(Number.isNaN(t.getTime()))return;let n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}`}function dj(e,t){if(t)return t;if(e===`unassigned`)return ij.nobody;let n=/^team-([a-z0-9-]+)$/.exec(e)?.[1];if(!n)return e;let r=n.split(`-`).join(` `);return ij.teamWords(r[0].toUpperCase()+r.slice(1))}function fj(e){let t=e.q,n=dj(t.owner,t.ownerName),r=t.owner===`unassigned`&&t.routeTo?ij.toRole(t.routeTo):n,i=ij.channels[t.channel]??t.channel,[a,o]=(0,v.useState)(),s=a??t.sentAt,[c,l]=(0,v.useState)(!1),u=(c||!!t.asked)&&!s,d=(0,v.useId)(),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)(),[y,b]=(0,v.useState)(),x=y?.question??t,S=async n=>{if(n.preventDefault(),!f.trim())_({ok:!1,text:ij.needAnswer});else{h(!0),_(void 0);try{let n=await N(`/api/owner-questions/${encodeURIComponent(t.id)}/answer`,{method:`POST`,body:{answer:f.trim()}});b(n),p(``),_({ok:!0,text:t.finding?ij.savedGap(t.finding.gate):ij.saved(n.file)}),e.onAnswered()}catch(e){_({ok:!1,text:nr(e)})}finally{h(!1)}}};return(0,j.jsxs)(`article`,{className:`panel qs-card`,"aria-labelledby":`${d}-q`,children:[(0,j.jsxs)(`div`,{className:`qs-card-head`,children:[(0,j.jsx)(`h3`,{id:`${d}-q`,className:`qs-q`,children:t.question}),(0,j.jsx)(`span`,{className:`chip ${x.state===`answered`?`done`:x.state===`overdue`?`blocking`:s||u?`warn`:``}`,children:x.state===`answered`?ij.answered:x.state===`overdue`?ij.overdue:s?ij.sent:u?ij.asked:ij.notSent})]}),(0,j.jsx)(`p`,{className:`qs-meta`,children:(0,j.jsxs)(`span`,{children:[ij.ask(n,t.system,i),` · `,(0,j.jsx)(`code`,{className:`mono`,children:t.id})]})}),x.state!==`answered`&&(0,j.jsx)(`span`,{className:`qs-card-line`,children:x.state===`overdue`?ij.overdueTo(r,i,uj(s)):s?ij.sentTo(r,i,uj(s)):u?ij.askedStep(r):ij.notSentTo(r,i)}),t.routeTo&&(0,j.jsx)(`span`,{className:`qs-card-line`,children:ij.routeTo(t.routeTo)}),t.finding&&(0,j.jsx)(`span`,{className:`qs-card-line`,children:ij.fromFinding(t.finding.change,t.finding.gate,t.finding.id)}),(0,j.jsx)(`span`,{className:`qs-card-line`,children:ij.needs(t.neededFact)}),t.fill?.map(e=>(0,j.jsx)(`span`,{className:`qs-card-line`,children:ij.fill(e.file,e.field)},`${e.file}|${e.field}`)),x.answer&&(0,j.jsx)(`p`,{className:`qs-answered`,style:{margin:0},children:ij.answeredWas(x.answer)}),x.state!==`answered`&&(0,j.jsx)(lj,{id:t.id,owner:r,again:!!s||x.state===`overdue`,...uj(s)?{sentOn:uj(s)}:{},onSent:(e,t)=>t===`sent`?o(e):l(!0),onAlready:e.onAnswered}),(0,j.jsxs)(`form`,{className:`qs-form`,onSubmit:e=>void S(e),children:[(0,j.jsx)(`label`,{htmlFor:`${d}-a`,className:`qs-field-label`,children:x.answer?ij.answerAgain:ij.answerLabel}),(0,j.jsx)(`textarea`,{id:`${d}-a`,className:`field`,rows:2,value:f,onChange:e=>p(e.target.value)}),(0,j.jsxs)(`div`,{className:`qs-actions`,children:[(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:m,children:m?ij.saving:ij.save}),(0,j.jsx)(`code`,{className:`mono qs-cmd`,children:ij.command(t.id)}),(0,j.jsx)(sr,{text:ij.command(t.id),label:ij.copyCommand})]})]}),g&&(0,j.jsx)(`p`,{role:g.ok?`status`:`alert`,style:{margin:0,fontSize:12.5},children:g.text}),y&&!t.finding&&(0,j.jsx)(Yc,{scope:`owner-answers`})]})}var pj=`/api/questions?state=open`,mj=`/api/owner-questions`,hj=e=>ft(e,/(^|\/)questions(\/|$)/),gj=e=>dt(e);function _j(e){if(e){if(typeof e.counts?.open==`number`)return e.counts.open;if(Array.isArray(e.questions))return e.questions.filter(e=>e.state===void 0||e.state===`open`).length}}function vj(e){return typeof e?.open==`number`?e.open:void 0}function yj(e,t){if(e!==void 0&&t!==void 0)return{total:e+t,steps:e,owner:t}}function bj(e,t){return yj(_j(e),vj(t))}var xj=w.roles,Sj=[`product`,`architecture`,`analysis`,`delivery`],Cj=e=>typeof e==`string`&&Sj.includes(e),wj=`atticus.viewerRole`;function Tj(){try{return globalThis.localStorage}catch{return}}function Ej(e=Tj()){try{let t=e?.getItem(wj);return Cj(t)?t:void 0}catch{return}}function Dj(e,t=Tj()){try{t?.setItem(wj,e??``)}catch{}}function Oj(e){let t=e.split(`?`)[1],n=t?new URLSearchParams(t):void 0,r=n?.get(`change`)??void 0,i=n?.get(`role`);return{...r&&/^[a-z0-9][a-z0-9._-]*$/.test(r)?{change:r}:{},...Cj(i)?{role:i}:{}}}function kj(e,t){return{...e.change?{change:e.change}:{},...t?{role:t}:{}}}function Aj(e,t){let n=[...t.change?[`change=${encodeURIComponent(t.change)}`]:[],...t.role?[`role=${encodeURIComponent(t.role)}`]:[]];return n.length?`${e}${e.includes(`?`)?`&`:`?`}${n.join(`&`)}`:e}var jj=(e,t)=>`#/questions?change=${encodeURIComponent(e)}&role=${t}`;function Mj(e,t){let n=(e??[]).filter(Cj);return n.length?{roles:n,from:`owners`}:t?{roles:[t],from:`picker`}:{roles:[],from:`none`}}function Nj(e){let t=e.filter(e=>e!==void 0);return t.length===e.length&&e.length>0&&t.every(Boolean)?{show:!1,hint:`some-named`}:{show:!0,hint:t.some(Boolean)?`some-named`:`none-named`}}function Pj(e){return(0,j.jsxs)(`div`,{className:`qs-field`,children:[(0,j.jsx)(`label`,{htmlFor:`questions-role`,className:`qs-field-label`,children:xj.filter}),(0,j.jsxs)(`select`,{id:`questions-role`,className:`field`,value:e.value??``,onChange:t=>e.onChange(Cj(t.target.value)?t.target.value:void 0),children:[(0,j.jsx)(`option`,{value:``,children:xj.allRoles}),Sj.map(t=>(0,j.jsx)(`option`,{value:t,children:xj.option(xj.names[t]??t,e.byRole?.[t]?.open,!!e.yours?.includes(t))},t))]})]})}function Fj(e){return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`label`,{htmlFor:`viewer-role`,className:`hud`,style:{fontSize:10},children:xj.pickYours}),(0,j.jsxs)(`select`,{id:`viewer-role`,className:`field`,"aria-describedby":`viewer-role-hint`,value:e.value??``,onChange:t=>e.onChange(Cj(t.target.value)?t.target.value:void 0),children:[(0,j.jsx)(`option`,{value:``,children:xj.pickNone}),Sj.map(e=>(0,j.jsx)(`option`,{value:e,children:xj.names[e]},e))]}),(0,j.jsx)(`span`,{id:`viewer-role-hint`,className:`muted`,style:{fontSize:11.5},children:e.hint===`some-named`?xj.pickYoursHintSome:xj.pickYoursHint})]})}function Ij(e){return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:2},children:[e.roles.map(t=>{let n=e.byRole?.[t]?.open??0;return(0,j.jsxs)(`span`,{style:{fontSize:13},children:[xj.line(e.change,xj.who[t]??t,n),` `,n>0&&(0,j.jsx)(`a`,{href:jj(e.change,t),children:xj.open})]},t)}),(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:9.5},children:e.from===`owners`?xj.fromOwners:xj.fromPicker})]})}function Lj(e){let t=P(`/api/questions?state=open&change=${encodeURIComponent(e.change)}`);lt(t);let n=t.state===`ready`?(t.data.yourRoles??[]).some(Cj):void 0,{onNamed:r,onRoles:i,change:a}=e;(0,v.useEffect)(()=>{n!==void 0&&r?.(a,n)},[n,a,r]);let o=t.state===`ready`?Mj(t.data.yourRoles,e.picked).roles.join(`,`):void 0;(0,v.useEffect)(()=>{o!==void 0&&i?.(a,o?o.split(`,`):[])},[o,a,i]);let s=t.state===`ready`?Mj(t.data.yourRoles,e.picked).roles.filter(e=>(t.data.counts?.byRole?.[e]?.open??0)>0):[],c=(t.state===`ready`?Mj(t.data.yourRoles,e.picked).from:`none`)===`none`?0:s.length,{onOpen:l}=e;if((0,v.useEffect)(()=>{t.state===`ready`&&l?.(a,c)},[t.state,c,a,l]),t.state===`loading`)return null;if(t.state===`error`)return e.compact?(0,j.jsx)(`li`,{children:(0,j.jsx)(`span`,{className:`hm-quiet-line`,children:xj.cantRead(e.change)})}):(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:xj.cantRead(e.change)});let u=Mj(t.data.yourRoles,e.picked);if(u.from===`none`)return null;if(e.compact){let n=s.slice(0,e.limit??s.length);return n.length?(0,j.jsx)(j.Fragment,{children:n.map(n=>(0,j.jsxs)(`li`,{children:[(0,j.jsxs)(`span`,{className:`hm-row-main`,children:[(0,j.jsx)(`span`,{className:`hm-row-title`,children:xj.line(e.change,xj.who[n]??n,t.data.counts?.byRole?.[n]?.open??0)}),(0,j.jsx)(`span`,{className:`hm-row-sub`,children:u.from===`owners`?xj.fromOwners:xj.fromPicker})]}),(0,j.jsx)(`span`,{className:`hm-row-end`,children:(0,j.jsx)(`a`,{className:`btn`,href:jj(e.change,n),children:xj.open})})]},n))}):null}return(0,j.jsx)(Ij,{change:e.change,roles:u.roles,from:u.from,byRole:t.data.counts?.byRole})}var Rj=new Set([`released`,`archived`]),zj=5;function Bj(e){let[t,n]=(0,v.useState)(()=>Ej()),[r,i]=(0,v.useState)({}),[a]=(0,v.useState)(()=>(e,t)=>i(n=>n[e]===t?n:{...n,[e]:t})),[o,s]=(0,v.useState)({}),[c]=(0,v.useState)(()=>(e,t)=>s(n=>n[e]===t?n:{...n,[e]:t})),[l,u]=(0,v.useState)({}),[d]=(0,v.useState)(()=>(e,t)=>u(n=>n[e]?.join(`,`)===t.join(`,`)?n:{...n,[e]:t})),{onRoles:f}=e,p=e.changes.filter(e=>!Rj.has(e.state)),m={};for(let e of p){let n=e.yourRoles?Mj(e.yourRoles,t).roles:l[e.id];n&&(m[e.id]=n)}let h=JSON.stringify(Object.entries(m));(0,v.useEffect)(()=>{f?.(Object.fromEntries(JSON.parse(h)))},[h,f]);let g=p.slice(0,zj);if(!g.length)return null;let _=Nj(g.map(e=>e.yourRoles?e.yourRoles.some(Cj):o[e.id])),y=_.show&&(0,j.jsx)(Fj,{value:t,hint:_.hint,onChange:e=>{n(e),Dj(e)}});if(e.compact){let n=e.max??1/0,i=g.map(e=>{let t=Math.max(0,n);return n-=r[e.id]??0,t}),o=g.reduce((e,t)=>e+(r[t.id]??0),0),s=e.max===void 0?0:o-e.max;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`ul`,{className:`hm-list`,"aria-label":xj.homeTitle,children:g.map((n,r)=>(0,j.jsx)(Lj,{change:n.id,picked:t,onNamed:c,onRoles:d,onOpen:a,compact:!0,...e.max===void 0?{}:{limit:i[r]}},n.id))}),s>0&&(0,j.jsx)(`p`,{className:`hm-quiet-line`,children:(0,j.jsx)(`a`,{href:`#/questions`,children:w.commandCenter.home.more(s)})}),y]})}return(0,j.jsxs)(`section`,{className:`panel stack`,"aria-labelledby":`your-role-questions`,style:{gap:8},children:[(0,j.jsx)(`p`,{id:`your-role-questions`,className:`hud`,style:{margin:0},children:xj.homeTitle}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:xj.homeIntro}),g.map(e=>(0,j.jsx)(Lj,{change:e.id,picked:t,onNamed:c,onRoles:d},e.id)),y]})}var Vj=w.roleWork;function Hj(e){return e?Vj.asksChip(Vj.asks[e]??e):void 0}function Uj(e){let t=(0,v.useId)(),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(),c=Sj.filter(t=>t!==e.role);return(0,j.jsxs)(`form`,{className:`qs-route`,onSubmit:async t=>{if(t.preventDefault(),n){a(!0),s(void 0);try{await N(`/api/questions/${e.id}/route`,{method:`POST`,body:{role:n}}),s({ok:!0,text:Vj.routed(w.roles.who[n]??n)}),r(``),e.onRouted?.()}catch(e){s({ok:!1,text:nr(e)})}finally{a(!1)}}},children:[Hj(e.asks)&&(0,j.jsx)(`span`,{className:`chip`,children:Hj(e.asks)}),e.routed&&(0,j.jsx)(`span`,{className:`qs-hint`,children:Vj.routedFrom(e.routed.from?w.roles.who[e.routed.from]??e.routed.from:Vj.noRole,e.routed.by,e.routed.at.slice(0,10))}),(0,j.jsxs)(`div`,{className:`qs-field`,children:[(0,j.jsx)(`label`,{htmlFor:`${t}-to`,className:`qs-field-label`,children:Vj.routeLabel}),(0,j.jsxs)(`select`,{id:`${t}-to`,className:`field`,value:n,onChange:e=>r(e.target.value||``),children:[(0,j.jsx)(`option`,{value:``,children:Vj.routePick}),c.map(e=>(0,j.jsx)(`option`,{value:e,children:w.roles.who[e]??e},e))]})]}),(0,j.jsx)(`button`,{type:`submit`,className:`btn`,disabled:i||!n,children:i?Vj.routing:Vj.route}),o&&(0,j.jsx)(`p`,{role:o.ok?`status`:`alert`,className:`qs-route-note ${o.ok?`muted`:`state error`}`,style:{margin:0},children:o.text})]})}var Wj=new Map,Gj=Je(),Kj=new Map,qj=1500;function Jj(e,t,n={}){return Gj(e,t=>N(e,{signal:t,...n.after?{after:!0}:{}}).then(t=>(Wj.set(e,t),it(e,t),t)),t,n)}var Yj=5e3;function Xj(e,t=300,n=Yj){let r=!1,i,a=()=>{r||(r=!0,l(),e())},o=e=>{clearTimeout(i),i=e===0?setTimeout(a,t):void 0},s=e=>o(Number(e.detail)||0),c=setTimeout(a,n),l=()=>{clearTimeout(i),clearTimeout(c),typeof removeEventListener==`function`&&removeEventListener(ze,s)};return typeof addEventListener==`function`&&addEventListener(ze,s),o(Ve()),()=>{r=!0,l()}}function Zj(e,t,n,r={}){let i=r.counted??!0;(0,v.useEffect)(()=>t&&i?ot(e):void 0,[e,t,i]);let[a,o]=(0,v.useState)(()=>Wj.has(e)?{state:`ready`,data:Wj.get(e)}:{state:`idle`}),[s,c]=(0,v.useState)(0),l=(0,v.useRef)(n);l.current=n;let u=(0,v.useRef)(!1),d=(0,v.useCallback)(()=>{u.current&&c(e=>e+1)},[]);return(0,v.useEffect)(()=>{if(!t)return;let n=s===0&&Wj.has(e);n&&(u.current=!0,o({state:`ready`,data:Wj.get(e)}));let r=!0,i=new AbortController;o(e=>e.state===`ready`?e:{state:`loading`});let a=()=>{u.current=!0,Jj(e,i.signal).then(e=>{r&&o({state:`ready`,data:e})},e=>{r&&!n&&o({state:`error`,error:e instanceof Error?e.message:String(e),...e instanceof M&&e.problem.notYet?{notYet:!0}:{}})})},c=s===0&&l.current?Xj(a):(a(),()=>void 0);return()=>{r=!1,c(),i.abort()}},[e,t,s]),{...a,reload:d}}function Qj(e,t=!0,n=()=>!0){let r=rt(e),[i,a]=(0,v.useState)(0),o=Zj(e,t&&(r===void 0||i>0),!0,{counted:!1}),s=o.reload,c=(0,v.useRef)(void 0);(0,v.useEffect)(()=>()=>clearTimeout(c.current),[]);let l=()=>{c.current=void 0;let t=(Kj.get(e)??0)-Date.now();t>0?c.current=setTimeout(l,t):(a(e=>e+1),s())};return ut(r=>{t&&!st(e)&&n(r)&&(c.current||l())}),r??(o.state===`ready`?o.data:void 0)}function $j(e){let t=()=>Kj.set(e,Math.max(Kj.get(e)??0,Date.now()+qj));return t(),Jj(e,void 0,{after:!0}).then(t,()=>void 0).then(()=>void 0)}var eM=[`system`,`light`,`dark`],tM=`atticus.theme`;function nM(){try{return globalThis.localStorage}catch{return}}function rM(e=nM()){try{let t=e?.getItem(tM);return eM.includes(t)?t:`system`}catch{return`system`}}function iM(e,t=nM()){try{t?.setItem(tM,e)}catch{}}function aM(e,t){return e===`system`?t?`light`:`dark`:e}function oM(e=document){let t=e.body?.classList;return!!t&&[`vscode-light`,`vscode-dark`,`vscode-high-contrast`].some(e=>t.contains(e))}function sM(e,t,n=document){if(oM(n))return;let r=aM(e,t);n.documentElement.dataset.theme=r,n.documentElement.style.colorScheme=r}var cM=`(prefers-color-scheme: light)`,lM=()=>!!globalThis.matchMedia?.(cM).matches;function uM(){sM(rM(),lM())}function dM(){let[e,t]=(0,v.useState)(()=>rM());return(0,v.useEffect)(()=>{if(sM(e,lM()),e!==`system`)return;let t=globalThis.matchMedia?.(cM);if(!t)return;let n=()=>sM(`system`,t.matches);return t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)},[e]),[e,e=>{iM(e),t(e)}]}var K=w.questions;function fM(e){if(e)return K.forRole(w.roles.who[e]??e)}function pM(e){return e?[...e.restsOn.length?[K.restsOn(e.restsOn)]:[],`team`in e.owner?K.owner(e.owner.team,e.owner.name):`change`in e.owner?K.changeOwner(e.owner.change,e.owner.people):K.noOwner(e.owner.none),...e.joins?[K.joins(e.joins)]:[],...e.proposal?[K.proposal.listed]:[],...e.rule?[K.rule.offerListed(e.rule.ids.length,e.rule.match)]:[]]:[]}function mM(e){let t=K.proposal,{question:n,proposal:r}=e,i=`proposal-${n.id}`;return(0,j.jsxs)(`section`,{"aria-labelledby":i,className:`qs-section qs-proposal`,children:[(0,j.jsx)(`h3`,{id:i,className:`qs-label`,children:t.title}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:t.notYet(r.by)}),(0,j.jsx)(`p`,{style:{margin:0},children:(0,j.jsx)(`strong`,{children:r.answer.option===void 0?t.words(r.answer.text??``):t.option(r.answer.option,n.options[r.answer.option-1]?.label??``)})}),(0,j.jsx)(`p`,{style:{margin:0},children:r.why}),(0,j.jsx)(`h4`,{className:`qs-label`,children:t.cites}),(0,j.jsx)(`ul`,{className:`qs-cites`,children:r.cites.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsxs)(`span`,{className:`mono`,children:[e.repo??n.repo,` `,e.file,`:`,e.line]}),` `,(0,j.jsx)(`q`,{children:e.quote})]},`${e.repo??n.repo}:${e.file}:${e.line}`))}),(0,j.jsxs)(`div`,{className:`qs-group-btns`,children:[(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:e.busy,onClick:e.onAccept,children:e.busy?t.accepting:t.accept}),(0,j.jsx)(`code`,{className:`mono qs-cmd`,children:t.command(n.id)}),(0,j.jsx)(sr,{text:t.command(n.id),label:K.copy})]}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:t.orAnswer})]})}function hM(e){let t=P(`/api/questions/${e.id}/targets`);return(0,j.jsx)(gM,{...e,of:t})}function gM(e){let t=K.another,n=e.of,r=`q-${e.id}-target`;if(n.state===`loading`)return(0,j.jsx)(`p`,{role:`status`,"aria-busy":`true`,className:`muted`,style:{margin:0},children:t.loading});if(n.state===`error`)return(0,j.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:0},children:t.failed(n.error)});let i=n.data.picks;if(!i.length)return(0,j.jsx)(`p`,{className:`state`,style:{margin:0},children:t.empty});let a=i.find(t=>t.id===e.form.target),o=!a&&e.form.target?e.form.target:``,s=(t,n)=>e.set({target:t?t.id:n??``,addSystem:void 0,needsSystem:t?t.adds?`internal`:void 0:n?.trim()?`vendor`:void 0}),c=(e,n)=>{let r=i.filter(t=>t.kind===e);return r.length?(0,j.jsx)(`optgroup`,{label:n,children:r.map(n=>(0,j.jsxs)(`option`,{value:n.id,children:[n.name,e===`repo`&&!n.read?` (${t.notRead})`:``,e===`system`&&n.boundary?` (${n.boundary})`:``,e===`team`&&n.adds?` (${t.noSystem})`:``]},n.id))}):null};return(0,j.jsxs)(`div`,{className:`qs-sub`,children:[(0,j.jsx)(`label`,{htmlFor:`${r}-pick`,className:`qs-label`,children:t.label}),(0,j.jsxs)(`select`,{id:`${r}-pick`,className:`field`,value:a?.id??``,onChange:e=>s(i.find(t=>t.id===e.target.value)),children:[(0,j.jsx)(`option`,{value:``,children:t.choose}),c(`repo`,t.repos),c(`system`,t.systems),c(`team`,t.teams)]}),(0,j.jsx)(`label`,{htmlFor:`${r}-new`,className:`qs-label`,children:t.newVendor}),(0,j.jsx)(`input`,{id:`${r}-new`,className:`field`,value:o,"aria-describedby":`${r}-new-d`,onChange:e=>s(void 0,e.target.value)}),(0,j.jsx)(`span`,{id:`${r}-new-d`,className:`qs-hint`,children:t.newVendorHint}),e.form.needsSystem&&(0,j.jsxs)(`div`,{className:`qs-check`,children:[(0,j.jsx)(`input`,{type:`checkbox`,id:`${r}-add`,checked:!!e.form.addSystem,onChange:t=>e.set({addSystem:t.target.checked?e.form.needsSystem:void 0})}),(0,j.jsx)(`label`,{htmlFor:`${r}-add`,children:a?.adds?t.addTeam(a.id,a.adds.name):t.addVendor(e.form.target??``)})]})]})}var _M=/^q-[0-9a-f]{12}$/;function vM({e}){return(0,j.jsxs)(`figure`,{className:`qs-excerpt`,children:[(0,j.jsxs)(`figcaption`,{children:[(0,j.jsx)(`code`,{className:`mono`,children:e.ref}),!e.found&&(0,j.jsx)(`span`,{className:`muted`,children:K.notShown})]}),e.found&&(0,j.jsx)(`pre`,{className:`mono qs-code`,tabIndex:0,role:`region`,"aria-label":K.excerptOf(e.ref),children:e.lines.map((t,n)=>{let r=e.start+n,i=r===e.line;return(0,j.jsxs)(`span`,{className:`qs-line`,"aria-current":i?`true`:void 0,children:[(0,j.jsx)(`span`,{className:`muted qs-ln`,children:`${String(r).padStart(4)} `}),(0,j.jsx)(`span`,{className:`qs-lc`,children:i?(0,j.jsx)(`mark`,{children:t}):t})]},r)})})]})}function yM({id:e,refs:t}){let n=P(`/api/questions/${e}/evidence`);return n.state===`ready`?(0,j.jsx)(`div`,{className:`qs-excerpts`,children:n.data.excerpts.map(e=>(0,j.jsx)(vM,{e},e.ref))}):(0,j.jsx)(`ul`,{className:`qs-refs`,children:t.map(e=>(0,j.jsx)(`li`,{children:(0,j.jsx)(`code`,{className:`mono`,children:e})},e))})}function bM(e){let t=e.replace(/^#\/?/,``).split(/[?]/)[0].split(`/`)[1]??``,n;try{n=decodeURIComponent(t)}catch{return}return _M.test(n)?n:void 0}var xM={"facts-targets":`Another repo…`,"facts-topics":`A topic owned by another team or vendor`},SM=new Set([`scan-hosts`,`facts-targets`,`facts-topics`,`estate-targets`]),CM=K.ignore.label;function wM(e){let t=e.answer;if(!t)return;if(t.option!==void 0)return e.options[t.option-1]?.label===CM?{}:void 0;let n=t.text?.trim()??``;if(!/^ignore:/i.test(n))return;let r=n===CM?``:n.slice(7).trim();return r?{reason:r}:{}}var TM=new Set([`facts-targets`,`scan-hosts`]);function EM(e){if(e.pick===void 0)return{error:K.pickOne};let t=e.match?.trim()?{match:e.match.trim()}:{};if(e.pick===`ignore`){let n=e.reason?.trim()?{reason:e.reason.trim()}:{};return e.scope===`repo-type`?e.repoType.trim()?{body:{ignore:!0,...n,scope:`repo-type`,repoType:e.repoType.trim(),...t}}:{error:K.needType}:{body:{ignore:!0,...n,scope:`repo`,...t}}}if(e.another){if(!e.target?.trim())return{error:K.another.pickOne};if(e.needsSystem&&!e.addSystem)return{error:K.another.needAdd}}let n=e.another?{target:e.target.trim(),...e.addSystem?{addSystem:e.addSystem}:{}}:e.pick===`words`?e.text.trim()?{text:e.text.trim()}:void 0:{option:e.pick};if(!n)return{error:K.needWords};let r=e.match?.trim()?{match:e.match.trim()}:{};return e.scope===`repo-type`?e.repoType.trim()?{body:{...n,scope:`repo-type`,repoType:e.repoType.trim(),...r}}:{error:K.needType}:{body:{...n,scope:`repo`,...r}}}var DM=e=>e.slice(0,10),OM=e=>/[.!?]$/.test(e.trim())?e.trim():`${e.trim()}.`,kM=e=>[...new Set(e.map(e=>e.repo))].sort((e,t)=>e.localeCompare(t)),AM=(e,t)=>e.filter(e=>(!t.repo||e.repo===t.repo)&&ti([e.question,e.id,e.repo],t.text)),jM=`questions-filter`;function MM(e){let t=new Map;for(let n of kM(e))t.set(n,[]);for(let n of e)t.get(n.repo).push(n);return[...t]}var NM=e=>e===`/api/questions?state=open`||e===`/api/questions`;function PM(e,t){let n=[...e===`open`?[`state=open`]:[],...t===`mine`?[`mine=true`]:[]];return`/api/questions${n.length?`?${n.join(`&`)}`:``}`}function FM(e){let t=e.text??``,n=t=>!!e.onSelect&&t.state===`open`,r=e.repo??``;return(0,j.jsx)(I,{of:e.of,empty:e=>e.questions.length===0&&e.problems.length===0&&!e.me,emptyText:e.change?e.all?K.emptyChangeAll(e.change):K.emptyChange(e.change):e.mine?K.emptyMine:e.all?K.emptyAll:K.empty,children:i=>{let a=AM(i.questions,{text:t,repo:r}),o=!!t.trim()||!!r;return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[i.me&&(0,j.jsx)(`p`,{className:`qs-note`,children:i.me.teams.length?K.mineTeams(i.me.teams.map(e=>e.name??e.id).join(`, `)):i.questions.length?K.mineChanges(i.me.handle):K.mineNone(i.me.handle)}),i.me&&i.me.teams.length>0&&i.questions.length===0&&(0,j.jsx)(`div`,{className:`state`,children:K.emptyMine}),i.problems.map(e=>(0,j.jsxs)(`p`,{className:`state error`,role:`alert`,style:{margin:0},children:[K.unreadable(e.file),` `,e.message]},e.file)),(0,j.jsx)(ai,{shown:a.length,total:i.questions.length,active:o}),o&&a.length===0&&i.questions.length>0&&(0,j.jsx)(oi,{what:ri({text:t,repo:r}),onClear:()=>e.onClear?.(),focus:jM}),a.length>0&&MM(a).map(([t,a])=>(0,j.jsxs)(`section`,{className:`q-group`,"aria-label":K.groupOf(t,a.length),children:[(!r||e.onSelect)&&(0,j.jsxs)(`h3`,{className:`q-group-head`,children:[e.onSelect&&a.some(n)?(0,j.jsxs)(`label`,{className:`q-pick`,children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:a.filter(n).every(t=>e.selected?.has(t.id)),onChange:t=>e.onSelect(a.filter(n).map(e=>e.id),t.target.checked),"aria-label":K.bulk.pickRepo(t)}),(0,j.jsx)(`span`,{children:t})]}):(0,j.jsx)(`span`,{children:t}),(0,j.jsx)(`span`,{className:`q-count`,children:a.length})]}),(0,j.jsx)(`ul`,{className:`q-list`,children:a.map(t=>(0,j.jsxs)(`li`,{className:`q-row`,children:[n(t)?(0,j.jsx)(`input`,{type:`checkbox`,className:`q-check`,checked:!!e.selected?.has(t.id),onChange:n=>e.onSelect([t.id],n.target.checked),"aria-label":K.bulk.pick(t.id)}):e.onSelect&&(0,j.jsx)(`span`,{className:`q-check-gap`,"aria-hidden":`true`}),(0,j.jsxs)(`a`,{href:Aj(`#/questions/${t.id}`,{...e.change?{change:e.change}:{},...e.role?{role:e.role}:{}}),"aria-current":t.id===e.current?`true`:void 0,className:`q-item`,title:t.question,children:[(0,j.jsx)(`span`,{className:`q-title`,children:t.question}),(0,j.jsxs)(`span`,{className:`q-meta`,children:[(0,j.jsx)(`span`,{className:`chip${t.state===`open`?` warn`:t.state===`answered`?` done`:``}`,children:t.state}),(0,j.jsx)(`span`,{className:`mono`,children:t.id}),fM(i.about?.[t.id]?.role??t.role)&&(0,j.jsx)(`span`,{className:`chip`,children:fM(i.about?.[t.id]?.role??t.role)}),t.answer&&Ti(t.answer.by)&&(0,j.jsx)(Ni,{inLink:!0})]}),pM(i.about?.[t.id]).map(e=>(0,j.jsx)(`span`,{className:`q-about`,children:e},e))]})]},t.id))})]},t))]})}})}var IM=e=>/^atticus verify ([a-z0-9][a-z0-9._-]*) --write$/.exec(e.trim())?.[1],LM=e=>IM(e)??/^atticus map ([a-z0-9][a-z0-9._-]*)$/.exec(e.trim())?.[1];function RM(e,t){let n=e.command.trim(),r=/^atticus verify ([a-z0-9][a-z0-9._-]*)/.exec(n)?.[1];if(r)return K.askedWhen.verify(r,t);let i=/^atticus change ([a-z-]+) ([a-z0-9][a-z0-9._-]*)/.exec(n);if(i)return K.askedWhen.stage(i[1],i[2],t);let a=n.split(/\s+/).filter(e=>!e.startsWith(`-`));return/^atticus (scan|map|onboard)\b/.test(n)&&a.length>2?K.askedWhen.read(a.at(-1),t):K.askedWhen.step(e.step,t)}function zM(e){return e.replace(/when the facts are next written \(atticus verify ([a-z0-9][a-z0-9._-]*) --write\)/g,(e,t)=>K.whenApplied(t)).replace(/atticus questions answer <id> --target <[^>]*> lists them and takes the one you name \(the app's Questions page lists them too\)/g,K.pickBelow).replace(/\s*\((?:atticus [^)]*|\/atticus-[^)]*)\)/g,``)}function BM({repo:e,file:t}){let n=P(`/api/propose?scope=work`);return n.state===`ready`?n.data.applyFirst?.includes(e)?(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:K.notApplied}),(0,j.jsx)(qc,{scope:`answers`,repo:e})]}):t&&n.data.files?.some(e=>e.path===t&&!e.proposed)?(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:K.notProposed}),(0,j.jsx)(qc,{scope:`answers`})]}):null:null}var VM=e=>e?.focus(),HM=e=>{let t=(e.askedBy?.command??``).trim().split(/\s+/);return/^atticus (change|plan) /.test(e.askedBy?.command??``)&&t.includes(e.repo)};function UM(e,t){let n=(e??``).trim().split(/\s+/);return n[0]!==`atticus`||n[1]!==`change`&&n[1]!==`plan`&&n[1]!==`critic`?!1:t===void 0?n.length>2:n.slice(2).includes(t)}var WM=(e,t)=>UM(e.askedBy?.command,t)||UM(e.rerun,t),GM=e=>!UM(e.askedBy?.command)&&!UM(e.rerun);function KM({result:e}){return(0,j.jsxs)(`div`,{role:`status`,ref:VM,tabIndex:-1,className:`qs-done`,children:[(0,j.jsx)(`p`,{style:{margin:0},children:K.saved(`questions/${e.question.id}.yaml`)}),e.system?.added&&(0,j.jsx)(`p`,{style:{margin:0},children:K.another.added(e.system.id,e.system.profile)}),e.skill&&(0,j.jsx)(`p`,{style:{margin:0},children:e.skill.written?K.skillWritten(e.skill.path):K.skillMissing(e.skill.path)}),LM(e.rerun)||!wr(e.rerun)?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{style:{margin:0},children:K.next}),(0,j.jsx)(qc,{scope:`answers`,repo:LM(e.rerun)})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{style:{margin:0},children:K.nextStage}),(0,j.jsx)(zr,{command:e.rerun})]}),(0,j.jsxs)(`details`,{className:`work-terminal`,children:[(0,j.jsx)(`summary`,{children:K.orCommandLine}),(0,j.jsxs)(`div`,{className:`work-cmd`,children:[(0,j.jsx)(`code`,{className:`mono`,children:e.rerun}),(0,j.jsx)(sr,{text:e.rerun,label:K.copy})]})]})]})}function qM(e){let t=e.question,n=fM(e.role??t.role),r=t.state===`open`?e.rule:void 0,i=wM(t),a=SM.has(t.askedBy.step),[o,s]=(0,v.useState)({pick:i?`ignore`:t.answer?.option??(t.answer?.text?`words`:void 0),text:i?``:t.answer?.text??``,...i?.reason?{reason:i.reason}:{},scope:t.answer?.scope.level??t.scope.level,repoType:t.scope.level===`repo-type`?t.scope.id:``,match:t.answer?.match??r?.match??``}),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(),[f,p]=(0,v.useState)(),[m,h]=(0,v.useState)(!1),g=e=>s(t=>({...t,...e})),_=async n=>{n.preventDefault();let r=EM(o);if(`error`in r)d(r.error);else{l(!0),d(void 0);try{let n=await N(`/api/questions/${t.id}/answer`,{method:`POST`,body:r.body});p(n),e.onAnswered(n)}catch(e){d(nr(e))}finally{l(!1)}}},y=async()=>{l(!0),d(void 0);try{let n=await N(`/api/questions/${t.id}/answer`,{method:`POST`,body:{acceptProposal:!0,scope:o.scope,...o.scope===`repo-type`&&o.repoType.trim()?{repoType:o.repoType.trim()}:{},...o.match?.trim()?{match:o.match.trim()}:{}}});p(n),e.onAnswered(n)}catch(e){d(nr(e))}finally{l(!1)}},b=`q-${t.id}`,x=!!t.answer&&!f,S=(0,j.jsxs)(`form`,{className:`qs-form`,onSubmit:e=>void _(e),noValidate:!0,children:[(0,j.jsxs)(`fieldset`,{className:`qs-section`,children:[(0,j.jsx)(`legend`,{children:t.answer&&!x?K.change:K.options}),(0,j.jsxs)(`div`,{className:`qs-opts`,children:[t.options.map((e,n)=>{let r=`${b}-o${n+1}`;if(a&&e.label===CM)return null;let i=xM[t.askedBy.step]===e.label;return(0,j.jsxs)(v.Fragment,{children:[(0,j.jsxs)(`div`,{className:`qs-opt`,children:[(0,j.jsx)(`input`,{type:`radio`,id:r,name:`${b}-pick`,checked:o.pick===n+1,onChange:()=>g({pick:n+1,another:i}),"aria-describedby":`${r}-d`}),(0,j.jsxs)(`label`,{htmlFor:r,children:[(0,j.jsxs)(`span`,{className:`qs-opt-label`,children:[(0,j.jsxs)(`span`,{className:`qs-opt-num`,children:[n+1,`.`]}),` `,e.label]}),(0,j.jsxs)(`span`,{id:`${r}-d`,className:`qs-opt-d`,children:[OM(e.means),` `,K.optionChanges,`: `,OM(zM(e.changes))]})]})]}),i&&o.another&&(0,j.jsx)(hM,{id:t.id,form:o,set:g})]},r)}),a&&(0,j.jsxs)(`div`,{className:`qs-opt`,children:[(0,j.jsx)(`input`,{type:`radio`,id:`${b}-ignore`,name:`${b}-pick`,checked:o.pick===`ignore`,onChange:()=>g({pick:`ignore`,another:!1}),"aria-describedby":`${b}-ignore-d`}),(0,j.jsxs)(`label`,{htmlFor:`${b}-ignore`,children:[(0,j.jsx)(`span`,{className:`qs-opt-label`,children:CM}),(0,j.jsx)(`span`,{id:`${b}-ignore-d`,className:`qs-opt-d`,children:K.ignore.means})]})]}),o.pick===`ignore`&&(0,j.jsxs)(`div`,{className:`qs-sub`,children:[(0,j.jsx)(`label`,{htmlFor:`${b}-reason`,className:`qs-label`,children:K.ignore.reason}),(0,j.jsx)(`input`,{id:`${b}-reason`,className:`field`,maxLength:300,value:o.reason??``,onChange:e=>g({reason:e.target.value})})]}),(0,j.jsxs)(`div`,{className:`qs-opt`,children:[(0,j.jsx)(`input`,{type:`radio`,id:`${b}-words`,name:`${b}-pick`,checked:o.pick===`words`,onChange:()=>g({pick:`words`,another:!1})}),(0,j.jsx)(`label`,{htmlFor:`${b}-words`,children:(0,j.jsx)(`span`,{className:`qs-opt-label`,children:K.ownWords})})]}),o.pick===`words`&&(0,j.jsxs)(`div`,{className:`qs-sub`,children:[(0,j.jsx)(`label`,{htmlFor:`${b}-text`,className:`qs-label`,children:K.ownWordsLabel}),(0,j.jsx)(`textarea`,{id:`${b}-text`,className:`field`,rows:3,value:o.text,...a?{"aria-describedby":`${b}-text-d`}:{},onChange:e=>g({text:e.target.value})}),a&&(0,j.jsx)(`span`,{id:`${b}-text-d`,className:`qs-hint`,children:K.ownWordsJoin})]})]})]}),(0,j.jsxs)(`fieldset`,{className:`qs-section`,children:[(0,j.jsx)(`legend`,{children:K.scope}),(0,j.jsxs)(`div`,{className:`qs-scope`,children:[(0,j.jsxs)(`div`,{className:`qs-radio`,children:[(0,j.jsx)(`input`,{type:`radio`,id:`${b}-repo`,name:`${b}-scope`,checked:o.scope===`repo`,onChange:()=>g({scope:`repo`})}),(0,j.jsxs)(`label`,{htmlFor:`${b}-repo`,children:[HM(t)?K.scopeChange(t.repo):K.scopeRepo(t.repo),t.scope.level===`repo`?` (${K.proposed})`:``]})]}),(0,j.jsxs)(`div`,{className:`qs-radio`,children:[(0,j.jsx)(`input`,{type:`radio`,id:`${b}-type`,name:`${b}-scope`,checked:o.scope===`repo-type`,onChange:()=>g({scope:`repo-type`})}),(0,j.jsx)(`label`,{htmlFor:`${b}-type`,children:t.scope.level===`repo-type`?`${K.scopeType(t.scope.id)} (${K.proposed})`:K.scopeTypeOther})]})]}),o.scope===`repo-type`&&t.scope.level!==`repo-type`&&(0,j.jsxs)(`div`,{className:`qs-field`,children:[(0,j.jsx)(`label`,{htmlFor:`${b}-type-id`,className:`qs-field-label`,children:K.typeLabel}),(0,j.jsx)(`input`,{id:`${b}-type-id`,className:`field`,value:o.repoType,onChange:e=>g({repoType:e.target.value})})]})]}),TM.has(t.askedBy.step)&&(0,j.jsxs)(`div`,{className:`qs-field`,children:[(0,j.jsx)(`label`,{htmlFor:`${b}-match`,className:`qs-field-label`,children:K.rule.label}),(0,j.jsx)(`input`,{id:`${b}-match`,className:`field mono`,value:o.match??``,"aria-describedby":`${b}-match-d`,onChange:e=>g({match:e.target.value})}),(0,j.jsxs)(`span`,{id:`${b}-match-d`,className:`qs-hint`,children:[r?`${K.rule.offer(r.ids.length,r.calls,r.match)} `:``,K.rule.hint]})]}),(0,j.jsxs)(`div`,{className:`qs-actions`,children:[u&&(0,j.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:0},children:u}),(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:c,children:c?K.saving:K.submit})]})]});return(0,j.jsxs)(`div`,{className:`qs-detail`,children:[(0,j.jsx)(`h2`,{className:`qs-q`,children:t.question}),(0,j.jsxs)(`p`,{className:`qs-meta`,children:[(0,j.jsxs)(`span`,{children:[RM(t.askedBy,DM(t.askedBy.at)),` · `,t.repo,` · `,n?`${n} · `:``,(0,j.jsx)(`code`,{className:`mono`,children:t.id})]}),(0,j.jsx)(sr,{text:t.id,label:K.copyId})]}),t.state!==`retired`&&(0,j.jsx)(Uj,{id:t.id,role:e.role??t.role,asks:e.asks??t.asks,routed:t.routed,...e.onRouted?{onRouted:e.onRouted}:{}}),(0,j.jsxs)(`section`,{className:`qs-section`,"aria-labelledby":`${b}-read`,children:[(0,j.jsx)(`h3`,{id:`${b}-read`,className:`qs-label`,children:K.evidence}),(0,j.jsx)(yM,{id:t.id,refs:t.evidence})]}),t.answer&&(0,j.jsxs)(`div`,{className:`qs-answered`,children:[(0,j.jsxs)(`p`,{style:{margin:0},children:[i&&!Ti(t.answer.by)?K.ignore.answered(t.answer.by,DM(t.answer.at),i.reason):(0,j.jsxs)(j.Fragment,{children:[Ti(t.answer.by)?w.decisions.answeredByAi(DM(t.answer.at)):K.answered(t.answer.by,DM(t.answer.at)),`: `,t.answer.text??t.options[(t.answer.option??1)-1]?.label]}),t.answer.match?` · ${K.rule.answered(t.answer.match)}`:``]}),(Ti(t.answer.by)||m)&&(0,j.jsx)(Fi,{item:t.id,run:Ti(t.answer.by)?t.answer.by.run:void 0,ai:!0,onOpen:()=>h(!0),onClose:()=>h(!1)}),t.answer.proposal&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:Ti(t.answer.by)?K.fromAiProposal(t.answer.proposal.by,DM(t.answer.proposal.at),t.answer.by.run):K.fromProposal(t.answer.proposal.by,DM(t.answer.proposal.at))}),(0,j.jsx)(`ul`,{className:`qs-cites`,children:t.answer.proposal.cites.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsxs)(`span`,{className:`mono`,children:[e.repo??t.repo,` `,e.file,`:`,e.line]}),` `,(0,j.jsx)(`q`,{children:e.quote})]},`${e.repo??t.repo}:${e.file}:${e.line}`))})]})]}),t.state===`answered`&&!f&&LM(t.rerun)&&(0,j.jsx)(BM,{repo:LM(t.rerun),file:`questions/${t.id}.yaml`}),t.reopened&&(0,j.jsx)(`p`,{className:`state`,style:{margin:0},children:K.reopened(t.reopened.why,t.reopened.answer.text??t.options[(t.reopened.answer.option??1)-1]?.label??``,DM(t.reopened.at))}),t.state===`open`&&e.proposal&&!f&&(0,j.jsx)(mM,{question:t,proposal:e.proposal,busy:c,onAccept:()=>void y()}),t.state===`retired`?(0,j.jsx)(`p`,{className:`state`,children:K.retired}):t.answer&&Ti(t.answer.by)&&!f?(0,j.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:K.changeAiAnswer}):x?(0,j.jsxs)(`details`,{className:`qs-change`,children:[(0,j.jsx)(`summary`,{children:K.change}),S]}):S,f&&(0,j.jsx)(KM,{result:f})]})}function JM(e,t=typeof matchMedia==`function`&&matchMedia(`(max-width: 1000px)`).matches){if(!e)return;if(e.focus({preventScroll:!0}),t){e.scrollIntoView?.({block:`start`});return}let n=e.closest?.(`.qs-pane`);n&&(n.scrollTop=0)}function YM({id:e,onAnswered:t,proposal:n,rule:r,role:i,asks:a}){let o=P(`/api/questions/${e}`);lt(o);let s=(0,v.useRef)(null);return(0,v.useEffect)(()=>{o.state===`ready`&&JM(s.current)},[o.state,e]),(0,j.jsx)(`div`,{ref:s,tabIndex:-1,className:`qs-focus`,children:(0,j.jsx)(I,{of:o,children:e=>(0,j.jsx)(qM,{question:e,onAnswered:t,...n?{proposal:n}:{},...r?{rule:r}:{},...i?{role:i}:{},...a?{asks:a}:{},onRouted:()=>{o.reload(),t()}},e.id)})})}function XM(e){let t=e.value.trim();return t?{body:e.how===`target`?{target:t,scope:`repo`}:{text:t,scope:`repo`}}:{error:e.how===`target`?K.bulk.needTarget:K.needWords}}function ZM({r:e,onDismiss:t}){let n=(0,v.useRef)(null);return(0,v.useEffect)(()=>{n.current?.focus()},[e]),(0,j.jsxs)(`div`,{role:`status`,className:`qs-done`,tabIndex:-1,ref:n,style:{marginBottom:10},children:[(0,j.jsx)(`p`,{className:`state`,style:{margin:0},children:K.bulk.done(e.ok.length)}),e.failed.map(e=>(0,j.jsxs)(`p`,{className:`state error`,style:{margin:0},children:[e.id,`: `,e.why]},e.id)),e.ok.length>0&&(0,j.jsx)(`code`,{className:`mono`,children:K.bulk.next}),(0,j.jsx)(`div`,{className:`qs-group-btns`,children:(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:t,children:w.app.dismiss})})]})}function QM(e){let t=e.questions.every(e=>e.askedBy.step===`facts-targets`),[n,r]=(0,v.useState)(t?`target`:`words`),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(),u=P(`/api/questions/${e.ids[0]}/targets`),d=async t=>{t.preventDefault();let r=XM({how:n,value:i});if(`error`in r){l(r.error);return}s(!0),l(void 0);let a=[],o=[];for(let t of e.ids)try{await N(`/api/questions/${t}/answer`,{method:`POST`,body:r.body}),a.push(t)}catch(e){o.push({id:t,why:nr(e)})}s(!1),e.onDone({ok:a,failed:o})};return(0,j.jsxs)(`form`,{className:`qs-detail`,onSubmit:e=>void d(e),noValidate:!0,children:[(0,j.jsx)(`h2`,{className:`qs-q`,children:K.bulk.title(e.ids.length)}),(0,j.jsxs)(`ul`,{className:`q-bulk-list`,children:[e.questions.slice(0,8).map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`span`,{className:`mono`,children:e.id}),` `,e.question]},e.id)),e.questions.length>8&&(0,j.jsx)(`li`,{className:`muted`,children:K.bulk.more(e.questions.length-8)})]}),t&&(0,j.jsx)(lr,{label:K.bulk.how,value:n,options:[{value:`target`,label:K.bulk.byTarget},{value:`words`,label:K.bulk.byWords}],onChange:r}),(0,j.jsxs)(`div`,{className:`qs-field`,children:[(0,j.jsx)(`label`,{htmlFor:`bulk-value`,className:`qs-field-label`,children:n===`target`?K.bulk.targetLabel:K.ownWords}),(0,j.jsx)(`input`,{id:`bulk-value`,className:`field`,list:n===`target`?`bulk-picks`:void 0,value:i,onChange:e=>a(e.target.value),"aria-describedby":`bulk-hint`}),n===`target`&&u.state===`ready`&&(0,j.jsx)(`datalist`,{id:`bulk-picks`,children:u.data.picks.map(e=>(0,j.jsxs)(`option`,{value:e.id,children:[e.name,` (`,e.kind,`)`]},`${e.kind}:${e.id}`))}),(0,j.jsx)(`span`,{id:`bulk-hint`,className:`qs-hint`,children:K.bulk.hint})]}),(0,j.jsxs)(`div`,{className:`qs-actions`,children:[c&&(0,j.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:0},children:c}),(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:o,children:o?K.bulk.busy:K.bulk.submit(e.ids.length)}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:e.onClear,disabled:o,children:K.bulk.clear})]})]})}function $M(e,t=``){let n=t?e.filter(e=>e.repo===t):e,r=e=>n.filter(t=>t.state===e).length;return{open:r(`open`),answered:r(`answered`),retired:r(`retired`),total:n.length,repos:kM(n).length}}function eN(e,t=``){if(!e.counts)return $M(e.questions,t);let n=e.counts.byRepo??{};if(t)return{...n[t]??{open:0,answered:0,retired:0,total:0},repos:1};let{byRepo:r,...i}=e.counts;return{...i,repos:Object.keys(n).length}}function tN(e){let t=K.proposal;if(e.open===0&&!e.note)return null;let n=e.handoff?.line??`/atticus-propose`,r=`atticus questions propose`,i=e.decide,a=i?.paused?t.askWhyPaused(i.paused.why):i?.now.questions===`auto`&&i.decideIn?.includes(`hand-off`)!==!1?t.askWhyAuto:t.askWhy,o=e.handoff?.state===`waiting`&&e.handoff.run?e.handoff:void 0;return(0,j.jsxs)(`section`,{"aria-labelledby":`ask-ai-propose`,className:`qs-ai`,children:[(0,j.jsx)(`h2`,{id:`ask-ai-propose`,className:`qs-label`,children:t.askTitle}),(0,j.jsx)(`p`,{className:`qs-ai-why`,children:a}),o?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`work-say`,role:`status`,style:{margin:0},children:t.askWaiting(o.run)}),(0,j.jsxs)(`div`,{className:`work-cmd`,children:[(0,j.jsx)(`code`,{className:`mono`,children:n}),(0,j.jsx)(sr,{text:n,label:`${t.askCopy}: ${n}`})]}),e.onDone&&(0,j.jsx)(`div`,{className:`qs-group-btns`,children:(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:!!e.busy,"aria-busy":e.busy===`done`,onClick:e.onDone,children:e.busy===`done`?t.askReading:t.askDone})}),o.done&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:t.askTerminal}),(0,j.jsxs)(`div`,{className:`work-cmd`,children:[(0,j.jsx)(`code`,{className:`mono`,children:o.done}),(0,j.jsx)(sr,{text:o.done,label:`${t.askCopy}: ${o.done}`})]})]})]}):(0,j.jsxs)(j.Fragment,{children:[e.onHandoff&&e.open>0&&(0,j.jsx)(`div`,{className:`qs-group-btns`,children:(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:!!e.busy,"aria-busy":e.busy===`handoff`,onClick:e.onHandoff,children:e.busy===`handoff`?t.askHandingOff:t.askHandoff})}),(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:t.askSlash}),(0,j.jsxs)(`div`,{className:`work-cmd`,children:[(0,j.jsx)(`code`,{className:`mono`,children:n}),(0,j.jsx)(sr,{text:n,label:`${t.askCopy}: ${n}`})]}),(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:t.askCommand}),(0,j.jsxs)(`div`,{className:`work-cmd`,children:[(0,j.jsx)(`code`,{className:`mono`,children:r}),(0,j.jsx)(sr,{text:r,label:`${t.askCopy}: ${r}`})]})]}),e.note&&(0,j.jsxs)(`div`,{role:e.note.ok?`status`:`alert`,className:e.note.ok?`ev-say`:`state error`,children:[e.note.ok&&(0,j.jsx)(`p`,{style:{margin:0},children:t.askRead}),(0,j.jsx)(`pre`,{className:`mono`,style:{whiteSpace:`pre-wrap`,margin:0,fontSize:11.5},children:e.note.lines.join(`
|
|
47
|
+
`)})]})]})}var nN=e=>{let t=e.problem;return t?.lines?.length?t.lines:t?.detail?[t.detail]:[e instanceof Error?e.message:String(e)]};function rN({open:e}){let t=Oi(),n=Mi(t),r=P(e>0?`/api/propose-answers`:void 0),[i,a]=(0,v.useState)(),[o,s]=(0,v.useState)(),c=r.state===`ready`?r.data:void 0;return(0,j.jsx)(tN,{open:e,decide:n?.decide,handoff:c,busy:i,note:o,onHandoff:()=>{a(`handoff`),s(void 0),N(`/api/propose-answers`,{method:`POST`}).then(()=>r.reload(),e=>s({ok:!1,lines:nN(e)})).finally(()=>a(void 0))},onDone:()=>{let e=c?.run;e&&(a(`done`),s(void 0),Ze(`/api/runs/${encodeURIComponent(e)}/done`).then(e=>{s({ok:!0,lines:e.lines??[]}),r.reload(),t?.reload()},e=>s({ok:!1,lines:nN(e)})).finally(()=>a(void 0)))}})}function iN(){let e=Mi(Oi());return e?(0,j.jsx)(Pi,{counts:e.questions.counts,what:w.decisions.counts.questions}):null}function aN({of:e}){return e?(0,j.jsx)(`p`,{className:`qs-to-answer`,children:K.toAnswer(e.total,e.steps,e.owner)}):null}function oN(e){let t=e.counts,n=t.total?Math.round((t.answered+t.retired)/t.total*100):0,r=(t,n,r,i)=>i?(0,j.jsxs)(`button`,{type:`button`,className:`q-stat ${r}`,"aria-pressed":e.filter===i,onClick:()=>e.onFilter(i),children:[(0,j.jsx)(`span`,{className:`q-stat-n`,children:n}),(0,j.jsx)(`span`,{className:`q-stat-label`,children:t})]}):(0,j.jsxs)(`div`,{className:`q-stat q-stat-count ${r}`,children:[(0,j.jsx)(`span`,{className:`q-stat-n`,children:n}),(0,j.jsx)(`span`,{className:`q-stat-label`,children:t})]});return(0,j.jsxs)(`div`,{className:`q-stats`,role:`group`,"aria-label":K.counts.label(e.repo),children:[(0,j.jsx)(`span`,{className:`q-stats-caption hud`,"aria-hidden":`true`,children:K.counts.caption}),r(K.counts.open,t.open,`warn`,`open`),r(K.counts.answered,t.answered,`done`),r(K.counts.retired,t.retired,``),r(K.counts.total,t.total,``,`all`),(0,j.jsxs)(`div`,{className:`q-progress`,"aria-label":K.counts.progress(n),children:[(0,j.jsx)(`div`,{className:`q-progress-bar`,children:(0,j.jsx)(`span`,{style:{width:`${n}%`}})}),(0,j.jsxs)(`span`,{className:`muted`,children:[K.counts.progress(n),e.repo?``:` · ${K.counts.repos(t.repos)}`]})]})]})}var sN=e=>Nn(e,`change`)||void 0;function cN(e,t){if(!t||e.state!==`ready`)return e;let{counts:n,...r}=e.data;return{...e,data:{...r,questions:e.data.questions.filter(e=>WM(e,t))}}}function lN({change:e}){return e?(0,j.jsxs)(`p`,{className:`qs-intro`,children:[K.changeIntro(e),` `,K.onlyChange(e),` `,(0,j.jsx)(`a`,{href:`#/questions`,children:K.showAll})]}):(0,j.jsx)(`p`,{className:`qs-intro`,children:K.intro})}function uN({children:e}){let t=(0,v.useRef)(null),n=Xl(t,{min:240});return(0,j.jsx)(`div`,{ref:t,className:`qs-split`,style:{"--qs-pane-h":`${n}px`},children:e})}function dN({hash:e}){let[t,n]=(0,v.useState)(`open`),[r,i]=(0,v.useState)(`all`),[a,o]=(0,v.useState)(()=>Oj(e)),s=JSON.stringify(Oj(e));(0,v.useEffect)(()=>o(JSON.parse(s)),[s]);let c=Aj(PM(t,r),a),l=P(c),u=P(`/api/owner-questions`);lt(l,u);let d=sN(e),f=a.change?l:cN(l,d),[p,m]=(0,v.useState)(aj(e));(0,v.useEffect)(()=>m(aj(e)),[e]);let h=oj(p,f.state===`ready`?eN(f.data).open:void 0,u.state===`ready`?u.data.open:void 0),g=NM(c),_=!g&&!(typeof document<`u`&&oM(document)),y=Qj(pj,_,hj),b=bj(g?l.state===`ready`?l.data:void 0:y,u.state===`ready`?u.data:void 0),x=()=>{f.reload(),_&&$j(pj)},S=bM(e),[C,T]=(0,v.useState)(``),[E,D]=(0,v.useState)(``),[ee,te]=(0,v.useState)(new Set),[ne,O]=(0,v.useState)(),re=(e,t)=>te(n=>{let r=new Set(n);for(let n of e)t?r.add(n):r.delete(n);return r}),k=f.state===`ready`?f.data.questions.filter(e=>ee.has(e.id)):[],A=[...new Set([...f.state===`ready`?kM(f.data.questions):[],...E?[E]:[]])].sort((e,t)=>e.localeCompare(t));return(0,j.jsxs)(`div`,{className:`qs`,children:[(0,j.jsxs)(`div`,{className:`qs-head`,children:[(0,j.jsx)(`p`,{className:`qs-title`,children:K.title}),(0,j.jsx)(lr,{label:K.kind,value:h,options:[{value:`steps`,label:K.kindSteps(f.state===`ready`?eN(f.data).open:void 0)},{value:`owner`,label:K.kindOwner(u.state===`ready`?u.data.open:void 0)}],onChange:m})]}),(0,j.jsx)(aN,{of:b}),h===`owner`?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`qs-intro`,children:K.ownerQuestions.intro}),(0,j.jsx)(`section`,{className:`qs-counts`,"aria-label":K.ownerQuestions.title,children:(0,j.jsx)(cj,{of:u,onAnswered:u.reload})})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`qs-tools`,children:[(0,j.jsx)(ii,{id:jM,value:C,onChange:T}),!d&&(0,j.jsxs)(`div`,{className:`qs-field`,children:[(0,j.jsx)(`label`,{htmlFor:`questions-repo`,className:`qs-field-label`,children:w.filter.repo}),(0,j.jsxs)(`select`,{id:`questions-repo`,className:`field`,value:E,onChange:e=>D(e.target.value),children:[(0,j.jsx)(`option`,{value:``,children:w.filter.allRepos}),A.map(e=>(0,j.jsx)(`option`,{value:e,children:e},e))]})]}),(0,j.jsx)(Pj,{value:a.role,onChange:e=>o(t=>kj(t,e)),byRole:f.state===`ready`?f.data.counts?.byRole:void 0,yours:f.state===`ready`?f.data.yourRoles:void 0}),(0,j.jsx)(lr,{label:K.whose,value:r,options:[{value:`all`,label:K.whoseAll},{value:`mine`,label:K.whoseMine}],onChange:i}),(0,j.jsx)(lr,{label:K.filter,value:t,options:[{value:`open`,label:K.filterOpen},{value:`all`,label:K.filterAll}],onChange:n})]}),(0,j.jsx)(lN,{change:d}),f.state===`ready`&&(0,j.jsxs)(`div`,{className:`qs-summary`,children:[(0,j.jsxs)(`div`,{className:`qs-counts`,children:[(0,j.jsx)(oN,{counts:eN(f.data,E),...E?{repo:E}:{},filter:t,onFilter:n}),(0,j.jsx)(iN,{})]}),(0,j.jsx)(rN,{open:eN(f.data).open})]}),(0,j.jsxs)(uN,{children:[(0,j.jsxs)(`section`,{className:`panel qs-pane`,"aria-labelledby":`p-questions`,children:[(0,j.jsx)(`div`,{className:`row between`,children:(0,j.jsx)(`h2`,{id:`p-questions`,className:`h`,children:K.listTitle})}),(0,j.jsx)(FM,{of:f,current:S,all:t===`all`,mine:r===`mine`,text:C,repo:E,onClear:()=>{T(``),D(``)},selected:ee,onSelect:re,change:d,role:a.role})]}),(0,j.jsxs)(`section`,{className:`panel qs-pane`,children:[ne&&(0,j.jsx)(ZM,{r:ne,onDismiss:()=>O(void 0)}),k.length>0?(0,j.jsx)(QM,{ids:k.map(e=>e.id),questions:k,onDone:e=>{O(e),re(e.ok,!1),x()},onClear:()=>te(new Set)},k.map(e=>e.id).join(`,`)):S?(0,j.jsx)(YM,{id:S,onAnswered:x,...f.state===`ready`&&f.data.about?.[S]?.proposal?{proposal:f.data.about[S].proposal}:{},...f.state===`ready`&&f.data.about?.[S]?.rule?{rule:f.data.about[S].rule}:{},...f.state===`ready`&&f.data.about?.[S]?.role?{role:f.data.about[S].role}:{},...f.state===`ready`&&f.data.about?.[S]?.asks?{asks:f.data.about[S].asks}:{}}):(0,j.jsx)(`div`,{className:`state`,children:K.pickFromList})]})]})]})]})}var fN=w.nextStep,pN=w.work,mN=w.runNext;function hN(e){switch(e){case`new-change`:case`brief`:case`answer`:case`merge`:case`release`:case`task`:case`findings`:return e;case`handoff`:case`small-handoff`:return`handoff`;case`tasks`:return`task`;case`release-prs`:case`release-prs-merge`:return`release`;default:return}}function gN(e){switch(e){case`draft`:case`define`:case`returned`:return`feature`;case`design`:return`architecture`;case`plan`:return`stories`;case`build`:case`qa`:return`tasks`;case`released`:case`archived`:return`done`;default:return`release`}}var _N={feature:{id:`feature-design`,label:w.nav.feature},architecture:{id:`architecture`,label:w.nav.architecture},stories:{id:`stories`,label:w.nav.stories},tasks:{id:`task-list`,label:w.nav.tasks},release:{id:`release`,label:fN.releasePlan},done:void 0},vN=e=>gN(e.state)!==`done`,yN=(e,t)=>`#/${e}${t?`?change=${encodeURIComponent(t)}`:``}`,bN=e=>({command:e,where:pN.slashWhere.metarepo}),xN=e=>({command:`atticus critic ${e}`,why:pN.why.critic,slash:bN(`/atticus-critic ${e}`)}),SN=e=>({command:`atticus change handoff ${e} --approve`,why:pN.why.handoff,kind:`handoff`,change:e});function CN(e,t){return{command:`atticus task run ${e} ${t.id}`,why:pN.why.task(t.id,t.repo),slash:bN(`/atticus-task ${e} ${t.id}`),kind:`task`,change:e,after:[{command:`atticus task context ${e} ${t.id}`,why:pN.taskInRepo(t.repo)}]}}function wN(e,t){let n=gN(e.state);return e.fastPath&&(n===`feature`||n===`architecture`||n===`stories`)?{command:`atticus change small ${e.id}`,why:pN.why.small,slash:bN(`/atticus-small ${e.id}`),after:[SN(e.id)]}:TN(n,e,t)}function TN(e,t,n){switch(e){case`feature`:return{command:`atticus change feature ${t.id}`,why:pN.why.feature,slash:bN(`/atticus-feature ${t.id}`),after:[SN(t.id)]};case`architecture`:return{command:`atticus change architecture ${t.id}`,why:pN.why.architecture,slash:bN(`/atticus-architecture ${t.id}`),after:[SN(t.id)]};case`stories`:return{command:`atticus plan stories ${t.id}`,why:pN.why.stories,slash:bN(`/atticus-stories ${t.id}`),after:[xN(t.id),SN(t.id)]};case`tasks`:{let e=n?.find(e=>!e.done);return e?CN(t.id,e):{command:`atticus change status ${t.id}`,why:pN.why.later}}default:return{command:`atticus change status ${t.id}`,why:pN.why.later,...e===`release`?{slash:bN(`/atticus-release ${t.id}`)}:{}}}}var EN=new Set([`drafting`,`waiting`,`questions`,`stopped`]);function DN(e,t,n){let r=n.reasons.filter(e=>e.code!==`no-handoff`&&e.code!==`pr-not-merged`&&e.code!==`changes-requested`),i={command:`atticus change status ${t.id}`},a=r[0],o=a?.code===`stage-not-done`?/^The (\w+) stage hasn't run yet: run (atticus [^\n]+?)\.?$/.exec(a.message):null,s=o?_N[o[1]]:void 0;if(o&&s)return{command:o[2],why:pN.why.stageBlocked(e,`The ${o[1]} stage hasn't run yet.`),link:{href:yN(s.id,t.id),label:pN.goStage(s.label)}};if(a)return{...i,why:pN.why.stageBlocked(e,a.message),...a.code===`open-gap`?{kind:`gap`,change:t.id}:a.code===`blocking-finding`?{kind:`findings`,change:t.id}:{}};let c=pN.why.stageDone(e,n.nextStep);return n.next?.step===`merge`?{command:n.next.command,why:c,kind:`merge`,change:t.id,...n.next.pr?{pr:n.next.pr}:{}}:n.reasons.some(e=>e.code===`pr-not-merged`)?{command:`atticus change sync ${t.id}`,why:c}:n.reasons.some(e=>e.code===`no-handoff`||e.code===`changes-requested`)?{...SN(t.id),why:c}:{...i,why:c}}function ON(e,t,n,r){let i=r?.stages.find(t=>t.stage===e);if(r&&i&&!t.fastPath&&gN(t.state)!==`done`){if(i.state===`done`)return DN(e,t,r);if(EN.has(i.state))return{...TN(e,t,n),why:pN.why.stageUnderWay(e,i.state)}}let a=gN(t.state);if(a===e){let e=wN(t,n);return r?.next&&r.id===t.id&&r.next.command!==e.command?FN(t,r.next):e}let o=e=>e===`feature`||e===`architecture`||e===`stories`;if(t.fastPath&&o(a)&&o(e))return wN(t,n);let s=r?.stages.find(e=>e.stage===a);if(e===`tasks`&&r?.id===t.id&&s?.state===`done`&&!t.fastPath)return DN(a,t,r);let c=_N[a];return{command:`atticus change status ${t.id}`,why:pN.stageIs(pN.stage[a]),...c?{link:{href:yN(c.id,t.id),label:pN.goStage(c.label)}}:{}}}function kN(e,t){return t===void 0?void 0:e.find(e=>e.id===t)}function AN(e){let t=e.repos;return{listed:t.length,cloned:t.filter(e=>e.cloned).length,settings:t.filter(e=>e.scanSettings.present).length,scanned:t.filter(e=>e.lastScan!==null).length,records:e.catalog.records}}var jN=new Set([`not-read`,`unverified`,`rejected`,`stale`,`unwritten`]);function MN(e){return{command:`atticus map ${e}`,why:pN.why.read[`not-read`](e),slash:bN(`/atticus-map ${e}`),after:[{command:`atticus verify ${e} --write`,why:pN.why.write(e)}]}}function NN(e,t,n){let r=e.repos;if(r.length===0)return{command:`atticus repos discover <folder>`,why:pN.why.discover,link:{href:`#/repos`,label:pN.addReposInApp}};let i=r.filter(e=>!e.cloned);if(i.length)return{command:`atticus workspace sync`,why:pN.why.sync(i.length)};let a={href:`#/trust`,label:pN.openTrust};if(n){let e=new Set(r.map(e=>e.id)),t=n.repos.find(t=>e.has(t.repo)&&jN.has(t.state)&&t.next);if(t?.next)return{command:t.next.command,why:pN.why.read[t.state](t.repo),...t.next.slash?{slash:bN(t.next.slash)}:{},link:a}}else{let e=r.find(e=>e.lastScan===null);if(e)return{...MN(e.id),link:a}}return t===void 0||t>0?{command:`atticus questions list --state open`,why:t===void 0?pN.why.answerUnknown:pN.why.answer(t),slash:bN(`/atticus-answer`),link:{href:`#/questions`,label:pN.stepAnswerLink}}:{command:`atticus next`,why:pN.why.onboarded,link:a,done:!0}}function PN(e,t,n){return NN(e,t,n).done===!0}function FN(e,t){let n=t.step===`finding`?/\bask$/.test(t.command.trim())?`gap`:`findings`:hN(t.step);return{command:t.command,why:Ur(t.why),...t.slash?{slash:bN(t.slash)}:{},...n?{kind:n}:{},change:e.id,...t.pr?{pr:t.pr}:{}}}function IN(e,t){return PN(e,0,t)}function LN(e,t,n,r,i){if(!IN(e,r)){let n=NN(e,t,r);return n.link?n:{...n,link:{href:`#/onboarding`,label:pN.openOnboarding}}}let a=t?{aside:{text:mN.mapQuestions(t),link:{href:`#/questions`,label:mN.mapQuestionsLink}}}:{},o=n.find(vN);if(!o)return{command:`atticus change new "<title>" --type <type>`,why:pN.why.newChange,kind:`new-change`,...a};let s=gN(o.state),c=_N[s],l=c?{link:{href:yN(c.id,o.id),label:pN.goStage(c.label)}}:{};return i?.id===o.id&&i.next?{...FN(o,i.next),...l,...a}:{...wN(o),why:pN.why.change(o.id,pN.stage[s]),...l,...a}}function RN(e,t){if(t)return ON(`architecture`,t.change,void 0,t.cockpit);let n=e.find(e=>gN(e.state)===`architecture`);return n?wN(n):{command:`atticus map <repo>`,why:pN.why.refresh,slash:bN(`/atticus-map <repo>`),after:[{command:`atticus verify <repo> --write`,why:pN.why.write(`<repo>`)}]}}var zN=w.dashboardExtra,BN=w.work,VN=w.runNext;function HN({v:e}){let t=AN(e),n=Math.max(t.listed,1),r=[[t.cloned,BN.reposCloned],[t.scanned,BN.reposScanned]];return(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsx)(_c,{list:e.problems}),(0,j.jsxs)(`p`,{style:{margin:0},children:[(0,j.jsx)(`span`,{className:`n`,style:{fontSize:22},children:t.listed}),` `,BN.reposListed,` ·`,` `,(0,j.jsx)(`span`,{className:`n`,style:{fontSize:22},children:t.records}),` `,BN.records]}),(0,j.jsx)(`div`,{className:`row`,style:{gap:18,flexWrap:`wrap`},children:r.map(([e,r])=>(0,j.jsxs)(`div`,{className:`stack`,style:{alignItems:`center`,gap:4},children:[(0,j.jsx)(It,{value:e,max:n,label:zN.of(e,t.listed,r),text:`${e}/${t.listed}`}),(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:11.5},children:r})]},r))}),(0,j.jsx)(`a`,{href:`#/onboarding`,children:BN.openOnboarding})]})}function UN({changes:e}){let t=e.filter(vN);return t.length===0?(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,j.jsx)(`div`,{className:`state`,children:BN.noChanges}),(0,j.jsx)(br,{})]}):(0,j.jsx)(Gn,{caption:BN.inFlight,rows:t,rowKey:e=>e.id,cols:[{label:BN.changeCol,cell:e=>(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`code`,{className:`mono`,children:e.id}),(0,j.jsx)(`br`,{}),(0,j.jsx)(`span`,{className:`muted`,children:e.title})]})},{label:BN.stateCol,cell:e=>e.openFindings?.blocking?(0,j.jsxs)(j.Fragment,{children:[e.state,` `,(0,j.jsx)(`span`,{className:`chip blocking`,children:w.commandCenter.blocked})]}):e.state},{label:BN.stageCol,cell:e=>{let t=gN(e.state),n=_N[t];return n?(0,j.jsx)(`a`,{href:`#/${n.id}?change=${encodeURIComponent(e.id)}`,children:n.label}):BN.stage[t]}},{label:BN.commandCol,cell:e=>(0,j.jsx)(WN,{c:e})}]})}function WN({c:e}){let t=wN(e),n={...t,change:t.change??e.id,...gN(e.state)===`release`&&!t.kind?{kind:`release`}:{}};return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[ic(n)?(0,j.jsx)(ac,{...n}):(0,j.jsx)(`p`,{style:{margin:0},children:(0,j.jsx)(`a`,{href:`#/cockpit?change=${encodeURIComponent(e.id)}`,children:VN.openGlance})}),(0,j.jsxs)(`details`,{className:`work-terminal`,children:[(0,j.jsx)(`summary`,{children:VN.orTerminal}),(0,j.jsx)(sc,{text:n.command,label:VN.copy,noRun:!0})]})]})}function GN(){return(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:BN.slashIntro}),(0,j.jsx)(`ul`,{style:{margin:0,paddingLeft:18,lineHeight:1.7},children:VN.commands.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsxs)(`code`,{className:`mono`,children:[e.name,` `,e.args]}),` `,e.what,` `,(0,j.jsxs)(`span`,{className:`muted`,children:[`(`,BN.slashWhere[e.where],`)`]})]},e.name))}),(0,j.jsx)(`p`,{className:`work-say`,children:VN.install}),(0,j.jsx)(sc,{text:`atticus assistant-files`,label:VN.copy}),(0,j.jsx)(`p`,{className:`work-say`,children:VN.plugin}),(0,j.jsx)(sc,{text:`/plugin marketplace add maycombhq/atticus`,label:VN.copy}),(0,j.jsx)(sc,{text:`/plugin install atticus@maycombhq`,label:VN.copy})]})}function KN(e,t,n){for(let r of[e,t,n])if(r.state===`error`)return r;return e.state!==`ready`||t.state!==`ready`||n.state!==`ready`?{state:`loading`}:{state:`ready`,data:{onboarding:e.data,changes:t.data,questions:n.data}}}function qN(e){let t=e.trust?.state===`ready`?e.trust.data:void 0,n=KN(e.onboarding,e.changes,e.questions),r=n.state===`ready`&&IN(n.data.onboarding,t)?n.data.changes.find(vN)?.id:void 0,i=P(r?`/api/changes/${encodeURIComponent(r)}/cockpit`:void 0);lt(i);let a=r&&i.state===`loading`?{state:`loading`}:n;return(0,j.jsx)(I,{of:a,children:e=>(0,j.jsx)(dc,{step:LN(e.onboarding,e.questions.questions.filter(GM).length,e.changes,t,i.state===`ready`?i.data:void 0)})})}function JN({v:e}){let t=w.trust,n=e.repos.filter(e=>e.state!==`trusted`);return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,j.jsx)(_c,{list:e.problems}),(0,j.jsx)(`p`,{style:{margin:0},children:t.summary(e.repos.length-n.length,e.repos.length)}),n.length===0?(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:BN.allTrusted}):(0,j.jsx)(`ul`,{"aria-label":BN.notTrusted,style:{margin:0,paddingLeft:18,lineHeight:1.7},children:n.slice(0,5).map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`span`,{className:`mono`,children:e.repo}),` `,(0,j.jsx)(`span`,{className:`chip ${Rk(e.state)}`,children:t.states[e.state]})]},e.repo))}),(0,j.jsx)(`a`,{href:`#/trust`,children:BN.openTrust})]})}function YN(e){let t=e.withInFlight??!0;return(0,j.jsxs)(`div`,{className:`bento`,children:[(0,j.jsx)(F,{title:BN.estate,span:t?`span 5`:`1 / -1`,children:(0,j.jsxs)(`div`,{className:`stack`,style:{gap:14},children:[(0,j.jsx)(I,{of:e.onboarding,children:e=>(0,j.jsx)(HN,{v:e})}),(0,j.jsx)(I,{of:e.trust,empty:e=>e.repos.length===0&&e.problems.length===0,emptyText:BN.trustNone,children:e=>(0,j.jsx)(JN,{v:e})})]})}),t&&(0,j.jsx)(F,{title:BN.inFlight,span:`span 7`,meta:e.changes.state===`ready`?String(e.changes.data.filter(vN).length):void 0,children:(0,j.jsx)(I,{of:e.changes,children:e=>(0,j.jsx)(UN,{changes:e})})})]})}var XN=w.commandCenter.home,ZN=(e,t)=>e?t===`blocks`?`bad`:`warn`:`quiet`,QN=e=>!e||Fe(e)?w.app.offlineShort:e;function $N({t:e}){let t=e.state===`ready`&&e.value!==void 0,n=e.state===`error`?XN.tileError(QN(e.error)):e.state===`loading`?void 0:e.sub,r=`hm-tile-${e.id}-sub`,i=e.state===`error`?`error`:e.state===`loading`?`quiet`:e.tone??`plain`;return(0,j.jsxs)(`li`,{className:`hm-tile ${i}`,children:[(0,j.jsxs)(`a`,{className:`hm-tile-link`,href:e.href,"aria-busy":e.state===`loading`||void 0,...n?{"aria-describedby":r}:{},children:[(0,j.jsx)(`span`,{className:`hm-tile-label`,children:e.label}),` `,(0,j.jsx)(`span`,{className:`hm-tile-n`,children:t?typeof e.value==`number`?e.value.toLocaleString():e.value:e.state===`loading`?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`span`,{className:`skeleton`,"aria-hidden":`true`}),(0,j.jsx)(`span`,{className:`sr`,children:XN.tileLoading})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`span`,{"aria-hidden":`true`,children:`–`}),(0,j.jsx)(`span`,{className:`sr`,children:w.app.notLoaded})]})})]}),n&&(0,j.jsx)(`span`,{id:r,className:`hm-tile-sub`,children:n})]})}function eP(e){let{id:t,title:n,tiles:r}=e;return(0,j.jsxs)(`section`,{className:`hm-group`,"aria-labelledby":t,children:[(0,j.jsx)(`h2`,{id:t,className:e.quiet?`sr`:`hm-label`,children:n}),(0,j.jsx)(`ul`,{className:`hm-tiles`,children:r.map(e=>(0,j.jsx)($N,{t:e},e.id))})]})}var tP=w.commandCenter,nP=tP.home,rP=w.work;function iP(e){return(0,j.jsxs)(`section`,{...e.sectionId?{id:e.sectionId}:{},className:`panel hm-panel${e.className?` ${e.className}`:``}`,"aria-labelledby":e.id,children:[(0,j.jsxs)(`div`,{className:`hm-panel-head`,children:[(0,j.jsx)(`h2`,{id:e.id,className:`hm-label`,...e.headRef?{ref:e.headRef,tabIndex:-1}:{},children:e.title}),e.meta!==void 0&&e.meta!==null&&(0,j.jsx)(`span`,{className:`hm-meta`,children:e.meta})]}),e.children]})}var aP=e=>!e||Fe(e)?w.app.offlineShort:e;function oP(e){let t=e.items[0]?.href;switch(e.kind){case`question`:return t?.startsWith(`#/questions?kind=owner`)?t:`#/questions`;case`need`:return`#/changes?across=needs`;case`step`:return`#/todo`;case`triage`:return`#/intake`;case`knowledge`:return`#/knowledge`;default:return t??`#/changes?across=findings`}}var sP={need:()=>tP.sectionNeeds,finding:()=>tP.sectionFindings,step:()=>tP.sectionSteps,question:e=>tP.sectionQuestions(e.repo),triage:()=>tP.sectionTriage,knowledge:()=>tP.sectionKnowledge};function cP(e,t){let n=rj(e,t,``),r=n.groups.flatMap(e=>e.sections.map(t=>({key:`${e.change??``}|${t.kind}|${t.repo??``}`,kind:t.kind,title:sP[t.kind](t),...e.change?{change:e.title,changeId:e.change}:{},count:t.items.length,blocking:t.items.some(e=>e.blocking),href:oP(t)})));return r.sort((e,t)=>Number(t.blocking)-Number(e.blocking)||t.count-e.count),{rows:r,total:n.total}}function lP(e){if(e.state===`loading`)return(0,j.jsxs)(`div`,{className:`stack`,"aria-busy":`true`,style:{gap:6},children:[(0,j.jsx)(`span`,{className:`sr`,children:w.app.loading}),(0,j.jsx)(`div`,{className:`skeleton`,style:{width:`85%`}}),(0,j.jsx)(`div`,{className:`skeleton`,style:{width:`70%`}}),(0,j.jsx)(`div`,{className:`skeleton`,style:{width:`60%`}})]});if(e.state===`error`)return(0,j.jsx)(`div`,{className:`state error`,role:`alert`,children:tP.couldntLoadWhatNeeds(aP(e.error))});let{rows:t}=cP(e.items,e.changes),n=e.partial?.length?(0,j.jsx)(`div`,{className:`state error`,role:`alert`,children:tP.partlyLoaded(e.partial)}):null;if(t.length===0)return(0,j.jsxs)(j.Fragment,{children:[n,(0,j.jsx)(`p`,{className:`hm-quiet-line`,children:tP.nothingNeedsAPerson})]});let r=t.length-5;return(0,j.jsxs)(j.Fragment,{children:[n,(0,j.jsx)(`ul`,{className:`hm-list`,children:t.slice(0,5).map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsxs)(`span`,{className:`hm-row-main`,children:[(0,j.jsx)(`a`,{className:`hm-row-title`,href:e.href,children:e.title}),(0,j.jsx)(`span`,{className:`hm-row-sub`,children:e.change&&e.changeId?(0,j.jsxs)(j.Fragment,{children:[nP.inChangeLead,(0,j.jsx)(`a`,{href:`#/changes/${encodeURIComponent(e.changeId)}`,children:e.change})]}):e.change?nP.inChange(e.change):tP.noChangeGroup})]}),(0,j.jsxs)(`span`,{className:`hm-row-end`,children:[e.blocking&&(0,j.jsx)(`span`,{className:`chip blocking`,children:tP.blocked}),(0,j.jsx)(`span`,{className:`chip ${e.blocking?`blocking`:`dim`}`,children:tP.groupCount(e.count)})]})]},e.key))}),r>0&&(0,j.jsx)(`p`,{className:`hm-quiet-line`,children:nP.needsMore(r)})]})}function uP(e){let t=e.yours?e.inFlight.filter(t=>e.yours.includes(t.id)):e.inFlight,n=t[0]??e.inFlight[0],r=t=>{let n={c:{...t,blocked:!!t.openFindings?.blocking},stage:pP(t.state),me:e.me};return e.yours?(0,j.jsx)(qA,{...n},t.id):(0,j.jsx)(KA,{...n},t.id)},i=e.inFlight.length-Math.min(t.length,4),a=(n?t.filter(e=>e.id!==n.id):t).slice(0,4-(n&&t.includes(n)?1:0)),o=(0,j.jsxs)(`div`,{className:`hm-foot`,children:[(0,j.jsx)(`a`,{href:`#/changes`,children:nP.seeAllChanges}),i>0&&(0,j.jsx)(`span`,{className:`hm-meta`,children:nP.changesMore(i)}),(0,j.jsx)(`a`,{href:`#/canvas`,children:nP.mapSub})]});return(0,j.jsx)(I,{of:e.changes,children:()=>e.inFlight.length===0?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`hm-empty`,children:[(0,j.jsx)(`p`,{className:`hm-quiet-line`,children:rP.noChanges}),(0,j.jsx)(br,{})]}),o]}):(0,j.jsxs)(j.Fragment,{children:[n&&(0,j.jsxs)(`div`,{className:`hm-focus`,children:[(0,j.jsx)(`ul`,{className:`hm-list`,children:r(n)}),(0,j.jsx)(hP,{state:n.state,label:nP.gatesOf(n.title)})]}),t.length===0?(0,j.jsx)(`p`,{className:`hm-quiet-line`,children:w.roleWork.home.noneYours}):a.length>0&&(0,j.jsx)(`ul`,{className:`hm-list`,children:a.map(r)}),o]})})}var dP=[`define`,`design`,`plan`,`build`,`qa`,`release-ready`],fP={define:tP.define,design:tP.design,plan:tP.plan,build:tP.build,qa:`QA`,"release-ready":tP.release};function pP(e){return fP[e===`draft`||e===`returned`?`define`:e===`release`?`release-ready`:e]??(e===`released`||e===`archived`?rP.stage.done:e)}var mP=[...dP,`released`];function hP({state:e,label:t}){let n=dP.indexOf(e);return(0,j.jsx)(`ol`,{className:`hm-gates`,...t?{"aria-label":t}:{},children:dP.map((e,t)=>(0,j.jsxs)(`li`,{className:`hm-gate ${t<n?`done`:t===n?`now`:`todo`}`,"aria-current":t===n?`step`:void 0,children:[(0,j.jsx)(`span`,{className:`hm-gate-dot`,"aria-hidden":`true`,children:t<n?`✓`:t===n?t+1:``}),(0,j.jsxs)(`span`,{className:`hm-gate-name`,children:[fP[e],(0,j.jsxs)(`span`,{className:`sr`,children:[` `,`(`,t===n?tP.currentPhase(fP[e]??``):t<n?tP.done2:tP.toCome,`)`]})]})]},e))})}function gP(){let e=Mi(Oi());return e?(0,j.jsx)(qi,{decide:e.decide}):null}var _P=w.commandCenter,vP=_P.home,yP=new Set([`define`,`design`,`plan`,`build`,`qa`,`release-ready`,`returned`,`post-release-review`]),bP=e=>!e||Fe(e)?w.app.offlineShort:e;function xP({onDone:e}){let t=P(`/api/doctor`).state!==`loading`;return(0,v.useEffect)(()=>{t&&e()},[t,e]),null}function SP({runs:e,failed:t,why:n}){return t?(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:_P.howStepsRunCantRead(bP(n))}):e?(0,j.jsxs)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:[_P.howStepsRun,` `,(0,j.jsx)(`strong`,{children:e}),` · `,(0,j.jsx)(`a`,{href:`#/ai`,children:_P.howStepsRunChange})]}):null}function CP(){let e=P(`/api/settings/ai`);return St(t=>{t.type===`file.changed`&&e.reload()}),(0,j.jsx)(SP,{...e.state===`ready`&&e.data.runs?{runs:e.data.runs}:{},failed:e.state===`error`,...e.state===`error`?{why:e.error}:{}})}var wP=/^[A-Za-z0-9][A-Za-z0-9._@-]*$/;function TP({onSaved:e}){let[t,n]=(0,v.useState)(``),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(),s=t.trim(),c=s!==``&&!wP.test(s);return(0,j.jsxs)(`form`,{className:`stack`,style:{gap:4,marginTop:4},onSubmit:t=>{t.preventDefault(),s&&!c&&(i(!0),N(`/api/orgpack/owner`,{method:`PUT`,body:{owner:s,was:``}}).then(()=>{o({ok:!0,text:_P.ownerSaved(s)}),e?.()}).catch(e=>o({ok:!1,text:e instanceof M?e.problem.detail??e.problem.title:String(e)})).finally(()=>i(!1)))},children:[(0,j.jsxs)(`label`,{className:`stack`,htmlFor:`org-pack-owner`,style:{gap:2},children:[(0,j.jsx)(`span`,{style:{fontSize:12.5},children:_P.ownerLabel}),(0,j.jsx)(`span`,{className:`muted`,id:`org-pack-owner-hint`,style:{fontSize:12},children:_P.ownerHint})]}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`},children:[(0,j.jsx)(`input`,{id:`org-pack-owner`,className:`field mono`,value:t,autoComplete:`off`,"aria-describedby":`org-pack-owner-hint`,"aria-invalid":c||void 0,onChange:e=>n(e.target.value)}),(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:r||!s||c,children:r?_P.ownerSaving:_P.ownerSave})]}),c&&(0,j.jsx)(`p`,{role:`alert`,style:{margin:0,fontSize:12},children:_P.ownerBad}),a&&(0,j.jsx)(`p`,{role:a.ok?`status`:`alert`,style:{margin:0,fontSize:12.5},children:a.text})]})}var EP={clones:w.appStep.setupClones,scan:w.appStep.setupRead,baseline:w.appStep.setupBaseline,machine:w.appStep.setupMachine},DP=e=>e.checking?e.fix:EP[e.id]??e.fix,OP=e=>e.id===`machine`&&!e.done&&!e.checking;function kP(){return(0,j.jsx)(`span`,{children:(0,j.jsx)(`a`,{className:`btn`,href:`#/settings`,children:w.appStep.openMachine})})}function AP(e={}){let t=P(e.setup?void 0:`/api/setup`),n=e.setup??t;ut(()=>n.reload(),250,{jobs:!0});let r=n.state===`ready`&&!n.data.baselined?n.data.steps.find(OP):void 0;return(0,j.jsxs)(j.Fragment,{children:[r&&(0,j.jsxs)(`section`,{className:`state error stack`,role:`alert`,"aria-label":w.appStep.ownInstall,style:{gap:6},children:[(0,j.jsxs)(`span`,{style:{fontSize:13},children:[r.label,(0,j.jsxs)(`span`,{className:`muted`,style:{fontSize:12},children:[` `,`· `,r.detail]})]}),(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:DP(r)}),(0,j.jsx)(kP,{})]}),(0,j.jsx)(_r,{part:`newer`})]})}function jP(e={}){let t=P(e.setup?void 0:`/api/setup`),n=e.setup??t;ut(()=>n.reload(),250,{jobs:!0});let[r,i]=(0,v.useState)(),[a,o]=(0,v.useState)(!1);if(a)return(0,j.jsx)(`div`,{className:`bento`,children:(0,j.jsxs)(F,{title:_P.baselineAccepted,kind:`hero`,span:`1 / -1`,children:[(0,j.jsx)(`p`,{role:`status`,style:{margin:`0 0 8px`,fontSize:12.5},children:_P.theCatalogIsAccepted}),(0,j.jsx)(Yc,{scope:`baseline`})]})});if(n.state!==`ready`||n.data.baselined)return null;let s=n.data,c=s.steps.filter(e=>e.done).length,l=s.steps.find(e=>e.id===`scan`)?.done,u=async()=>{try{await N(`/api/baseline`,{method:`POST`,body:{}}),o(!0),n.reload(),Kc()}catch(e){i({ok:!1,text:e instanceof M?e.problem.detail??e.problem.title:String(e)})}};return(0,j.jsx)(`div`,{className:`bento`,children:(0,j.jsxs)(F,{title:_P.setUpAtticus,kind:`hero`,span:`1 / -1`,meta:_P.ofDone(c,s.steps.length),children:[(0,j.jsx)(`ol`,{style:{listStyle:`none`,margin:0,padding:0},className:`stack`,children:s.steps.map(e=>(0,j.jsxs)(`li`,{className:`row`,style:{alignItems:`flex-start`,gap:10},children:[(0,j.jsx)(`span`,{"aria-hidden":`true`,className:`chip ${e.done?`done`:e.optional||e.checking?`dim`:`warn`}`,style:{minWidth:24,textAlign:`center`},children:e.done?`✓`:e.checking?`…`:`·`}),(0,j.jsxs)(`span`,{className:`stack`,style:{gap:2},"aria-busy":e.checking||void 0,children:[(0,j.jsxs)(`span`,{style:{fontSize:13},children:[e.label,(0,j.jsx)(`span`,{className:`sr`,children:e.done?_P.done:e.checking?_P.checking:_P.toDo}),(0,j.jsxs)(`span`,{className:`muted`,style:{fontSize:12},children:[` `,`· `,e.detail,e.optional?_P.optional:``]})]}),!e.done&&e.fix&&(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:DP(e)}),OP(e)&&(0,j.jsx)(kP,{}),!e.done&&e.id===`clones`&&(0,j.jsx)(sc,{text:`atticus workspace sync`,label:w.runNext.copy}),!e.done&&e.id===`scan`&&(0,j.jsx)(`span`,{children:(0,j.jsx)(`a`,{className:`btn primary`,href:`#/trust`,children:w.appStep.openTrust})}),!e.done&&e.id===`org-pack-owner`&&(0,j.jsx)(TP,{onSaved:()=>n.reload()})]})]},e.id))}),s.steps.some(e=>e.checking)&&(0,j.jsx)(xP,{onDone:n.reload}),l&&(0,j.jsxs)(`div`,{className:`row`,style:{marginTop:12,gap:10,flexWrap:`wrap`},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,onClick:()=>void u(),children:_P.acceptTheCatalogAs}),(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:_P.afterWalkingTheEcosystem})]}),r&&(0,j.jsx)(`p`,{role:r.ok?`status`:`alert`,style:{margin:`8px 0 0`,fontSize:12.5},children:r.text})]})})}function MP(e){if(e.setup.state!==`ready`||e.setup.data.baselined)return null;let t=e.setup.data;return(0,j.jsxs)(`p`,{className:`hm-quiet-line hm-setup-line`,children:[vP.setupLine(t.steps.filter(e=>e.done).length,t.steps.length),` `,(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:e.onShow,children:vP.setupShow})]})}function NP(e){e&&(e.open=!0,e.querySelector(`summary`)?.focus())}function PP(e,t,n=[]){if(e===`error`)return{text:w.app.ccCantRead,bad:!1};if(e===`loading`)return{text:w.app.ccReading,bad:!1};if(t>0)return{text:_P.thingsNeedAttention(t),bad:!0};let r=n.filter(e=>e.kind!==`phase`);return r.length?{text:_P.nothingBlockedButWaiting(r.length,FP(r)),bad:!1}:{text:_P.nothingIsBlockedRight,bad:!1}}function FP(e){let t=new Map;for(let n of e)t.set(n.kind,(t.get(n.kind)??0)+1);return[...t.entries()].sort((e,t)=>t[1]-e[1]).map(([e,t])=>vP.waitingKinds[e]?.(t)??`${t} ${e}`).join(`, `)}function IP(e,t=3){return[...e].filter(([,e])=>e>0).sort((e,t)=>t[1]-e[1]).slice(0,t).map(([e,t])=>vP.count(t,e)).join(` · `)}function LP({to:e}){let[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(),[a,o]=(0,v.useState)(),s=async t=>{n(!0),o(void 0);try{let n=t?await Jn(`digest-send`,e??`me`):{};i(await N(`/api/me/digest`,{method:`POST`,body:{send:t,...n}}))}catch(e){o(e instanceof M?e.problem.detail??e.problem.title:String(e))}finally{n(!1)}};return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6,marginTop:10},children:[(0,j.jsxs)(`div`,{className:`row`,style:{gap:6,flexWrap:`wrap`},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:t,onClick:()=>void s(!1),children:_P.showMyDigest}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:t,onClick:()=>void s(!0),children:e?_P.sendItTo(e):_P.sendItToMe})]}),a&&(0,j.jsx)(`p`,{role:`alert`,style:{margin:0,color:`var(--magenta-text)`,fontSize:12.5},children:a}),r&&(0,j.jsxs)(`div`,{role:`status`,className:`stack`,style:{gap:2,fontSize:12.5},children:[(0,j.jsx)(`strong`,{children:r.title}),r.lines.map((e,t)=>(0,j.jsx)(`span`,{className:`clamp2`,children:e},t)),r.sent&&(0,j.jsx)(`span`,{style:{color:`var(--green)`},children:_P.sentTo(r.sent.channel)}),r.notSent&&(0,j.jsx)(`span`,{className:`muted`,children:r.notSent})]})]})}function RP(e,t){let n=bj(e,t),r=sj(n?.steps,n?.owner);return{questions:r.n,questionsOf:n,questionsHref:r.href}}function zP(e){let t=e=>e?.state===`error`?{state:`error`,error:e.error}:{state:e?.state??`ready`},n=e.needs!==void 0&&e.steps!==void 0?e.needs+e.steps:void 0,r=e.status?.needs,i=e.status?.steps;return{wait:{id:`wait`,label:vP.waitOnYou,href:e.needs?`#/changes?across=needs`:`#/todo`,value:n,...t(r?.state===`error`?r:i?.state===`error`?i:r??i),...n===void 0?{}:{sub:vP.waitOnYouSub(e.needs,e.steps)},tone:ZN(n,`waits`)},questions:{id:`questions`,label:_P.waitQuestions,href:e.questionsHref??`#/questions`,value:e.questions,...t(e.status?.questions),...e.questionsOf?{sub:vP.questionsSub(e.questionsOf.steps,e.questionsOf.owner)}:{},tone:ZN(e.questions,`waits`)},blocking:{id:`blocking`,label:_P.waitBlocking,href:`#/changes?across=findings`,value:e.blocking,...t(e.status?.blocking),tone:ZN(e.blocking,`blocks`),...e.blockingSub?{sub:e.blockingSub}:{}}}}var BP={need:()=>_P.sectionNeeds,finding:()=>_P.sectionFindings,step:()=>_P.sectionSteps,question:e=>_P.sectionQuestions(e.repo),triage:()=>_P.sectionTriage,knowledge:()=>_P.sectionKnowledge},VP=e=>`waiting-${(e??`no-change`).replace(/[^a-z0-9-]/gi,`-`)}`,HP=`waiting-filter`,UP=e=>e.kind===`need`&&!!e.change&&!!e.id||e.kind===`step`&&!!e.id,WP=e=>`${e.kind}|${e.change??``}|${e.id??``}`;function GP(e,t,n){let r=n.trim();return r?e.flatMap(e=>t===`step-skip`&&e.kind===`step`&&e.id?[{path:`/api/todo/${encodeURIComponent(e.id)}/done`,body:{skip:!0,note:r,...e.change?{change:e.change}:{}}}]:t!==`step-skip`&&e.kind===`need`&&e.change&&e.id?[{path:`/api/changes/${encodeURIComponent(e.change)}/needs/${encodeURIComponent(e.id)}`,body:{status:t===`need-done`?`done`:`not-needed`,note:r}}]:[]):[]}function KP({x:e,selected:t,onSelect:n}){return(0,j.jsxs)(`li`,{className:`row`,style:{gap:6,alignItems:`flex-start`},children:[n&&UP(e)&&(0,j.jsx)(`input`,{type:`checkbox`,"aria-label":_P.select(e.title),checked:!!t,onChange:e=>n(e.target.checked),style:{marginTop:10}}),(0,j.jsxs)(`a`,{href:e.href,className:`list-row`,style:{alignItems:`flex-start`,textDecoration:`none`,color:`inherit`},children:[(0,j.jsxs)(`span`,{style:{minWidth:0},children:[(0,j.jsx)(`span`,{className:`clamp2`,style:{fontSize:12.5},children:e.title}),(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:9.5},children:e.detail})]}),(0,j.jsx)(`span`,{className:`chip ${e.blocking?`blocking`:e.kind===`finding`?`warn`:``}`,children:e.kind.toUpperCase()})]})]})}function qP(e){let t=e.selected.filter(e=>e.kind===`need`).length,n=e.selected.filter(e=>e.kind===`step`).length,[r,i]=(0,v.useState)(t?`need-done`:`step-skip`);(0,v.useEffect)(()=>{(t||n)&&(!t&&r.startsWith(`need-`)?i(`step-skip`):!n&&r.startsWith(`step-`)&&i(`need-done`))},[t,n,r]);let[a,o]=(0,v.useState)(``),s=GP(e.selected,r,a||`-`).length;return(0,j.jsxs)(`form`,{className:`row`,style:{gap:8,flexWrap:`wrap`,alignItems:`flex-end`},"aria-label":_P.bulkTitle,onSubmit:t=>{t.preventDefault(),a.trim()&&e.onDo(r,a)},children:[(0,j.jsx)(`span`,{children:_P.selected(e.selected.length)}),(0,j.jsxs)(`label`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`span`,{className:`hud`,children:_P.bulkAction}),(0,j.jsxs)(`select`,{id:`bulk-action`,className:`field`,value:r,onChange:e=>i(e.target.value),children:[t>0&&(0,j.jsx)(`option`,{value:`need-done`,children:_P.bulkNeedDone(t)}),t>0&&(0,j.jsx)(`option`,{value:`need-not-needed`,children:_P.bulkNeedNot(t)}),n>0&&(0,j.jsx)(`option`,{value:`step-skip`,children:_P.bulkStepSkip(n)})]})]}),(0,j.jsxs)(`label`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`span`,{className:`hud`,children:r===`need-done`?_P.bulkTicket:_P.bulkWhy}),(0,j.jsx)(`input`,{id:`bulk-note`,className:`field`,value:a,onChange:e=>o(e.target.value),required:!0})]}),(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:e.busy||!a.trim(),children:_P.bulkDo(s)}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:e.onClear,children:_P.bulkClear})]})}function JP(e){let[t,n]=(0,v.useState)(new Set),[r,i]=(0,v.useState)(!1),a=e.partial?.length?(0,j.jsx)(`div`,{className:`state error`,role:`alert`,style:{marginBottom:6},children:_P.partlyLoaded(e.partial)}):null;if(e.state===`loading`)return(0,j.jsx)(`div`,{className:`state`,role:`status`,children:_P.loading});if(e.state===`error`)return(0,j.jsx)(`div`,{className:`state`,role:`alert`,children:_P.couldntLoadWhatNeeds(bP(e.error))});let o=rj(e.items,e.changes,e.text);return o.total===0?(0,j.jsxs)(j.Fragment,{children:[a,(0,j.jsx)(`div`,{className:`state`,children:_P.nothingNeedsAPerson})]}):(0,j.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[a,(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:_P.byChangeIntro}),(0,j.jsx)(ii,{id:HP,value:e.text,onChange:e.onText}),e.onBulk&&e.items.some(e=>t.has(WP(e)))&&(0,j.jsx)(qP,{selected:e.items.filter(e=>t.has(WP(e))),busy:r,onClear:()=>n(new Set),onDo:(r,a)=>{i(!0),e.onBulk(e.items.filter(e=>t.has(WP(e))),r,a).finally(()=>{i(!1),n(new Set)})}}),(0,j.jsx)(ai,{shown:o.shown,total:o.total,active:!!e.text.trim()}),o.groups.length===0&&(0,j.jsx)(oi,{what:ri({text:e.text}),onClear:()=>e.onText(``),focus:HP}),o.groups.map(r=>(0,j.jsxs)(`section`,{"aria-labelledby":VP(r.change),children:[(0,j.jsxs)(`h3`,{id:VP(r.change),className:`h row`,style:{fontSize:14,margin:`6px 0`,gap:6,flexWrap:`wrap`},children:[r.change?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`a`,{href:`#/changes/${encodeURIComponent(r.change)}`,children:r.title}),(0,j.jsx)(`span`,{className:`muted mono`,style:{fontSize:11},children:r.change})]}):(0,j.jsx)(`span`,{children:r.title}),(0,j.jsx)(`span`,{className:`chip`,children:_P.groupCount(r.count)}),r.blocking>0&&(0,j.jsx)(`span`,{className:`chip blocking`,children:_P.blocked}),r.state&&(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:_P.inState(r.state)})]}),r.sections.map(r=>(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h4`,{className:`hud`,style:{fontSize:11,margin:`6px 0`},children:BP[r.kind](r)}),(0,j.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0},children:r.items.map((r,i)=>(0,j.jsx)(KP,{x:r,selected:t.has(WP(r)),...e.onBulk?{onSelect:e=>n(t=>{let n=new Set(t);return e?n.add(WP(r)):n.delete(WP(r)),n})}:{}},`${r.id??``}|${i}`))})]},`${r.kind}|${r.repo??``}`))]},r.change??``))]})}function YP(){let e=P(`/api/changes`),t=P(`/api/findings?state=open`),n=P(`/api/catalog/kinds`),r=P(`/api/owner-questions`),i=P(`/api/view/triage`),a=P(`/api/todo`),o=P(`/api/questions?state=open`),s=P(`/api/onboarding`),c=P(`/api/trust`),l=P(`/api/knowledge/items`),u=P(`/api/setup`),d=P(`/api/propose?scope=work`),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(!1),g=(0,v.useRef)(!1),_=(0,v.useRef)(null),[y,b]=(0,v.useState)(!1);!y&&u.state===`ready`&&!u.data.baselined&&b(!0);let[x,S]=(0,v.useState)(),{me:C}=Zr(),[T,E]=(0,v.useState)({}),D=[...new Set(Object.values(T).flat())],ee=$A(D),te=WA(D),ne=Ma(e),O=ne.state===`ready`?ne.data.flatMap(e=>(e.needs?.needs??[]).map(t=>({...t,change:e.change}))):[],re=ej({needs:O,changes:e.state===`ready`?e.data:[],findings:t.state===`ready`?t.data:[],...ee?{levels:ee}:{},questions:r.state===`ready`?r.data.questions.filter(e=>e.state!==`answered`):[],triage:i.state===`ready`?i.data.data?.items??[]:[],steps:a.state===`ready`?a.data.steps:[],questionFiles:o.state===`ready`?o.data.questions:[],...l.state===`ready`?{knowledgeToVerify:l.data.items.filter(e=>!e.review||e.review.state===`stale`).length}:{}});ut(i=>{let u=i.some(e=>e.type===`file.changed`||e.type===`job.done`);dt(i)&&n.reload(),(u||i.some(e=>e.type===`index.rebuilt`))&&(e.reload(),t.reload()),u&&(s.reload(),c.reload(),ne.reload(),a.reload(),r.reload(),o.reload(),l.reload()),!u&&i.some(e=>e.type===`run.changed`)&&t.reload()},250,{jobs:!0});let k=e.state===`ready`?e.data.filter(e=>yP.has(e.state)):[],A=t.state===`ready`?t.data:[],ie=new Map((e.state===`ready`?e.data:[]).map(e=>[e.id,e.state])),ae=A.filter(e=>!ee||!e.asks||ee.includes(e.asks)).filter(e=>e.severity===`blocking`&&QA(e.asks,ie.get(e.change))),oe=A.filter(e=>ee&&e.asks&&!ee.includes(e.asks)).length,se=RP(o.state===`ready`?o.data:void 0,r.state===`ready`?r.data:void 0),ce=n.state===`ready`?n.data.reduce((e,t)=>e+t.count,0):0,M=e=>n.state===`ready`?n.data.find(t=>t.kind===e)?.count??0:0,le=new Map;for(let e of A)le.set(e.lens??`checks`,(le.get(e.lens??`checks`)??0)+1);let ue=[...le.entries()].sort((e,t)=>t[1]-e[1])[0]?.[0],de=A.filter(e=>e.layer===`ai`).length,fe=D.map(e=>w.roles.who[e]??e).join(`, `),pe=re.filter(e=>e.kind!==`phase`).length,me=e.state===`loading`||t.state===`loading`?`loading`:e.state===`error`||t.state===`error`?`error`:`ready`,he=e.state===`error`?e.error:t.state===`error`?t.error:``,ge=[...ne.state===`ready`?ne.data.filter(e=>e.error).map(e=>_P.needsOfFailed(e.change,e.error)):ne.state===`error`?[_P.needsFailed(ne.error)]:[],...a.state===`error`?[_P.stepsFailed(a.error)]:[],...r.state===`error`?[_P.questionsFailed(r.error)]:[],...i.state===`error`?[_P.triageFailed(i.error)]:[]],_e=(s.state===`ready`?s.data.problems.length:0)+(c.state===`ready`?c.data.problems.length:0),ve=PP(me,ae.length,re),ye=zP({...se,needs:ne.state===`ready`?O.filter(e=>e.status===`open`).length:void 0,steps:a.state===`ready`?a.data.steps.length:void 0,blocking:t.state===`ready`?ae.length:void 0,status:{questions:XP(o,r),needs:XP(ne),steps:XP(a),blocking:XP(t)},blockingSub:A.length?vP.findingsSub(A.length-de,de,ue):void 0});return(0,j.jsxs)(`div`,{className:`hm`,children:[(0,j.jsxs)(`header`,{className:`hm-head`,children:[(0,j.jsx)(`p`,{className:`hm-status${ve.bad?` bad`:``}`,children:ve.text}),(0,j.jsxs)(`p`,{className:`hm-who`,children:[vP.live,C?` · ${vP.you(C.user,fe||void 0)}`:``]})]}),te?(0,j.jsx)(AP,{setup:u}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(MP,{setup:u,onShow:()=>NP(_.current)}),(0,j.jsx)(_r,{})]}),(0,j.jsx)(gP,{}),_e>0&&(0,j.jsxs)(`p`,{className:`state error`,role:`alert`,style:{margin:0,textAlign:`left`},children:[vP.problems,` `,(0,j.jsx)(`a`,{href:`#/trust`,children:w.work.openTrust})]}),(0,j.jsx)(eP,{id:`hm-glance`,title:vP.glance,quiet:!0,tiles:[ye.wait,ye.questions,{id:`in-flight`,label:vP.inFlight,href:`#/changes`,...ZP(e),value:k.length,sub:k.length?QP(k):vP.inFlightNone,tone:k.length?`plain`:`quiet`},$P(d),ye.blocking,{id:`catalog`,label:vP.catalog,href:`#/trust`,...ZP(n),value:ce,sub:vP.catalogSub(M(`Interface`),c.state===`ready`&&c.data.repos.length?vP.trusted(c.data.repos.filter(e=>e.state===`trusted`).length,c.data.repos.length):void 0),tone:ce?`plain`:`quiet`}]}),(0,j.jsxs)(`div`,{className:`hm-grid`,children:[(0,j.jsx)(`div`,{className:`hm-col`,children:(0,j.jsxs)(iP,{id:`hm-next`,title:vP.next,children:[(0,j.jsx)(qN,{onboarding:s,changes:e,questions:o,trust:c}),(0,j.jsxs)(`div`,{className:`hm-rest`,children:[(0,j.jsx)(ol,{plan:d,max:5}),e.state===`ready`&&(0,j.jsx)(Bj,{compact:!0,max:5,changes:e.data,onRoles:E}),(0,j.jsx)(Zc,{}),!te&&(0,j.jsx)(CP,{})]})]})}),(0,j.jsx)(`div`,{className:`hm-col`,children:(0,j.jsxs)(iP,{id:`hm-needs`,title:_P.needsAPerson,meta:pe?vP.needsMeta(pe):void 0,children:[oe>0&&ee&&!ee.includes(`design`)&&(0,j.jsx)(`p`,{className:`hm-quiet-line`,children:w.roleWork.home.designWaits(oe)}),(0,j.jsx)(lP,{items:re,changes:e.state===`ready`?e.data:[],state:me,error:he,partial:ge}),(0,j.jsxs)(`div`,{className:`hm-foot`,children:[(0,j.jsx)(`a`,{href:se.questionsHref,children:vP.seeAllQuestions}),me===`ready`&&pe>0&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,"aria-expanded":m,...m?{"aria-controls":`hm-whole`}:{},onClick:()=>{g.current=!m,h(e=>!e)},children:m?vP.hideWholeList:vP.wholeList(pe)}),C&&(0,j.jsxs)(`details`,{className:`hm-menu`,children:[(0,j.jsx)(`summary`,{children:vP.digest}),(0,j.jsx)(LP,{...C.notify?.to?{to:C.notify.to}:{}})]})]}),x&&(0,j.jsx)(`p`,{role:`status`,className:`hm-quiet-line`,children:x})]})}),(0,j.jsx)(`div`,{className:`hm-col`,children:(0,j.jsx)(iP,{id:`hm-changes`,title:D.length?vP.changes:vP.inFlight,meta:fe||void 0,children:(0,j.jsx)(uP,{changes:e,inFlight:k,yours:D.length?Object.entries(T).filter(([,e])=>e.length).map(([e])=>e):void 0,me:C?.user})})})]}),m&&(0,j.jsx)(iP,{sectionId:`hm-whole`,id:`hm-whole-t`,title:vP.wholeListTitle,headRef:e=>{e&&g.current&&(g.current=!1,e.focus())},children:(0,j.jsx)(JP,{onBulk:async(e,t,n)=>{let r=[],i=GP(e,t,n);for(let e of i)await N(e.path,{method:`POST`,body:e.body}).catch(e=>{r.push(e instanceof Error?e.message:String(e))});S(_P.bulkDone(i.length-r.length,r.length,r)),ne.reload(),a.reload()},items:re,changes:e.state===`ready`?e.data:[],text:f,onText:p,partial:ge,...he?{error:he}:{},state:me})}),(0,j.jsxs)(`div`,{className:`hm-folds`,children:[(0,j.jsxs)(`div`,{className:`hm-fold-row`,children:[te&&(0,j.jsxs)(JA,{fold:!0,children:[(0,j.jsx)(CP,{}),(0,j.jsx)(jP,{setup:u}),(0,j.jsx)(_r,{part:`pending`})]}),!te&&y&&(0,j.jsxs)(`details`,{className:`hm-fold`,ref:_,children:[(0,j.jsx)(`summary`,{children:_P.setUpAtticus}),(0,j.jsx)(jP,{setup:u})]}),(0,j.jsxs)(`details`,{className:`hm-fold`,children:[(0,j.jsx)(`summary`,{children:w.work.estate}),(0,j.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[n.state===`ready`&&n.data.length>0&&(0,j.jsxs)(`p`,{className:`hm-quiet-line`,children:[vP.topKinds(IP(n.data.map(e=>[e.kind,e.count]))),` `,(0,j.jsx)(`a`,{href:`#/explore`,children:vP.seeCatalog})]}),A.length>0&&(0,j.jsxs)(`p`,{className:`hm-quiet-line`,children:[vP.byLens(IP(le)),` `,(0,j.jsx)(`a`,{href:`#/changes?across=findings`,children:vP.seeFindings})]}),(0,j.jsx)(YN,{onboarding:s,trust:c,changes:e,withInFlight:!1})]})]}),(0,j.jsxs)(`details`,{className:`hm-fold`,children:[(0,j.jsx)(`summary`,{children:vP.assistant}),(0,j.jsx)(GN,{})]})]}),(0,j.jsxs)(`p`,{className:`hm-note`,children:[_P.approvingIsThePull,` `,_P.aPersonApprovesEvery]})]})]})}function XP(...e){let t=e.find(e=>e.state===`error`);return t?.state===`error`?{state:`error`,error:t.error}:e.some(e=>e.state===`loading`)?{state:`loading`}:void 0}function ZP(e){return e.state===`error`?{state:`error`,error:e.error}:{state:e.state}}function QP(e){let t=new Map;for(let n of e)t.set(pP(n.state),(t.get(pP(n.state))??0)+1);let n=[...new Set(mP.map(e=>pP(e)))];return[...n.filter(e=>t.has(e)),...[...t.keys()].filter(e=>!n.includes(e))].map(e=>vP.inStage(t.get(e),e)).join(` · `)}function $P(e){let t=e.state===`ready`?il(e.data).length:0,n=e.state===`ready`?al(e.data):0;return{id:`corrections`,label:vP.corrections,href:`#/canvas`,...ZP(e),value:t,sub:vP.toPropose(n),tone:t?`warn`:`quiet`}}var eF=w.roleWork.ask;function tF({k:e}){let t=e.items.length===0&&e.passages.length===0;return(0,j.jsxs)(`section`,{"aria-labelledby":`ask-knowledge`,className:`kn-answer`,children:[(0,j.jsx)(`h3`,{id:`ask-knowledge`,className:`kn-label`,children:eF.knowledge}),t?(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:eF.none}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:eF.knowledgeIntro}),e.items.length>0&&(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`h4`,{className:`kn-label`,children:eF.items}),(0,j.jsx)(`ul`,{style:{margin:0,paddingLeft:18},children:e.items.map(e=>(0,j.jsxs)(`li`,{style:{marginBottom:6},children:[(0,j.jsx)(`a`,{href:`#/knowledge?item=${encodeURIComponent(e.id)}`,children:e.title}),e.quote&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`blockquote`,{className:`kn-quote`,children:e.quote.text}),(0,j.jsx)(`span`,{className:`kn-from`,children:w.roleWork.passage.from(e.quote.section??e.quote.page,e.quote.source)})]})]},e.id))})]}),e.passages.length>0&&(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`h4`,{className:`kn-label`,children:eF.passages}),(0,j.jsx)(`ul`,{style:{margin:0,paddingLeft:18},children:e.passages.map(e=>(0,j.jsxs)(`li`,{style:{marginBottom:8},children:[(0,j.jsx)(`strong`,{children:e.heading.split(` › `).at(-1)||e.page}),` `,(0,j.jsx)(`span`,{className:`kn-from`,children:w.roleWork.passage.from(e.page,e.source)}),(0,j.jsx)(`p`,{className:`kn-passage`,children:e.text}),(0,j.jsxs)(`details`,{children:[(0,j.jsx)(`summary`,{className:`muted`,style:{fontSize:11.5},children:w.roleWork.passage.details}),(0,j.jsxs)(`code`,{className:`mono muted`,children:[e.path,`:`,e.line]})]})]},`${e.path}:${e.line}`))})]}),(0,j.jsxs)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:[eF.askAi,` `,(0,j.jsx)(`code`,{className:`mono`,children:e.command}),` `,(0,j.jsx)(sr,{text:e.command,label:e.command})]})]})]})}var nF=w.explore,rF=[`name`,`description`,`system`,`owner`,`ownerComponent`,`from`,`to`,`via`,`method`,`normalizedPath`,`type`,`runtime`,`table`,`dataType`];function iF(e){return e==null?``:typeof e==`string`||typeof e==`number`||typeof e==`boolean`?String(e):Array.isArray(e)?e.map(iF).join(`, `):JSON.stringify(e)}function aF(e,t){let n=e.split(`?`)[1];return n?new URLSearchParams(n).get(t)??``:``}var oF=e=>aF(e,`q`);function sF({row:e}){let t=P(`/api/catalog/${e.kind}/${encodeURIComponent(e.id)}`);return(0,j.jsx)(F,{title:e.id,meta:e.kind,span:`span 4`,rows:`span 2`,children:(0,j.jsx)(I,{of:t,children:e=>{let t=Object.keys(e).filter(e=>![`kind`,`id`,`evidence`,`schemaVersion`,`flags`].includes(e)),n=[...rF.filter(e=>t.includes(e)),...t.filter(e=>!rF.includes(e))];return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:12},children:[(0,j.jsx)(`dl`,{style:{margin:0,display:`grid`,gridTemplateColumns:`120px 1fr`,gap:`6px 10px`,fontSize:12.5},children:n.map(t=>(0,j.jsxs)(`div`,{style:{display:`contents`},children:[(0,j.jsx)(`dt`,{className:`hud`,style:{fontSize:10},children:t}),(0,j.jsx)(`dd`,{className:/^(from|to|system|owner|ownerComponent|table)$/.test(t)?`mono`:``,style:{margin:0,wordBreak:`break-word`},children:iF(e[t])})]},t))}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:`hud`,style:{fontSize:10,marginBottom:6},children:nF.evidence}),(e.evidence??[]).length===0?(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:nF.noEvidenceRecordedTreat}):(0,j.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0,display:`flex`,flexDirection:`column`,gap:6},children:(e.evidence??[]).map((e,t)=>(0,j.jsxs)(`li`,{style:{fontSize:12.5},children:[(0,j.jsx)(`span`,{className:`chip ${e.source===`code`||e.source===`config`?``:e.source===`document`||e.source===`diagram`?`warn`:`ai`}`,children:e.source.toUpperCase()}),` `,(0,j.jsxs)(`span`,{className:`mono`,children:[e.repo?`${e.repo} · `:``,e.path??``,e.line?`:${e.line}`:``]})]},t))})]}),(0,j.jsx)(`a`,{href:`#/impact?q=${encodeURIComponent(e.id)}`,className:`btn`,style:{display:`inline-flex`,alignItems:`center`,textDecoration:`none`,width:`fit-content`},children:nF.whatBreaksIfThis})]})}})})}function cF({hash:e}){let t=oF(e),n=aF(e,`ask`),r=P(n?`/api/ask?q=${encodeURIComponent(n)}`:void 0),[i,a]=(0,v.useState)(t),[o,s]=(0,v.useState)(t);(0,v.useEffect)(()=>{a(t),s(t)},[t]),(0,v.useEffect)(()=>{r.state===`ready`&&(r.data.action===`impact`&&r.data.id?location.hash=`#/impact?q=${encodeURIComponent(r.data.id)}`:(a(r.data.query),s(r.data.query)))},[r.state,r.state===`ready`?r.data:void 0]);let[c,l]=(0,v.useState)(),u=P(o?`/api/search?q=${encodeURIComponent(o)}&limit=60`:void 0),d=c&&(c.kind===`Component`||c.kind===`System`)?c.id:c?.system,f=P(d?`/api/graph?focus=${encodeURIComponent(d)}&depth=2`:`/api/graph`);return lt(u,f),(0,j.jsxs)(`div`,{className:`bento`,children:[n&&(0,j.jsx)(F,{title:nF.ask(n),kind:`hero`,span:`1 / -1`,children:(0,j.jsx)(I,{of:r,children:e=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,j.jsx)(`p`,{style:{margin:0},children:e.explanation}),e.action===`owner`&&(0,j.jsx)(`p`,{style:{margin:0,fontSize:18},children:e.owner?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`span`,{className:`mono`,children:e.id}),` `,nF.isOwnedBy,(0,j.jsx)(`span`,{className:`chip done`,children:e.owner})]}):(0,j.jsxs)(j.Fragment,{children:[nF.theCatalogDoesntKnow,(0,j.jsx)(`span`,{className:`mono`,children:e.id}),` `,nF.yet]})}),(0,j.jsxs)(`span`,{className:`hud`,style:{fontSize:10},children:[nF.queryRun,(0,j.jsx)(`span`,{className:`mono`,style:{color:`var(--accent)`},children:e.query}),nF.editItBelowTo]}),e.error&&(0,j.jsx)(`span`,{role:`alert`,style:{color:`var(--magenta-text)`},children:e.error}),e.knowledge&&(0,j.jsx)(tF,{k:e.knowledge})]})})}),(0,j.jsx)(F,{title:nF.searchTheCatalog,span:`1 / -1`,children:(0,j.jsxs)(`form`,{role:`search`,onSubmit:e=>{e.preventDefault(),l(void 0),s(i.trim()),location.hash=`#/explore?q=${encodeURIComponent(i.trim())}`},className:`row`,style:{flexWrap:`wrap`},children:[(0,j.jsx)(`label`,{htmlFor:`kq`,className:`sr`,children:nF.search}),(0,j.jsx)(`input`,{id:`kq`,value:i,onChange:e=>a(e.target.value),placeholder:nF.tryDailyLimitKind,style:{flex:`1 1 360px`,height:40,background:`var(--box)`,color:`var(--text)`,border:`1px solid var(--accent)`,borderRadius:10,padding:`0 12px`,font:`inherit`}}),(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,children:nF.search}),(0,j.jsxs)(`span`,{className:`muted`,style:{fontSize:12},children:[nF.wordsMatchIdsAnd,(0,j.jsx)(`span`,{className:`mono`,children:nF.kind}),`, `,(0,j.jsx)(`span`,{className:`mono`,children:nF.system}),`,`,` `,(0,j.jsx)(`span`,{className:`mono`,children:nF.status}),` `,nF.narrowIt]})]})}),(0,j.jsx)(F,{title:nF.results,span:`span 3`,rows:`span 2`,meta:u.state===`ready`?u.data.total:void 0,children:o?(0,j.jsx)(I,{of:u,empty:e=>e.rows.length===0,emptyText:nF.nothingMatchesTryFewer,children:e=>(0,j.jsxs)(`ul`,{style:{listStyle:`none`,margin:0,padding:0},"aria-label":nF.searchResults,children:[e.rows.map(e=>(0,j.jsx)(`li`,{children:(0,j.jsxs)(`button`,{type:`button`,onClick:()=>l(e),"aria-pressed":c?.id===e.id&&c?.kind===e.kind,className:`list-row`,style:{width:`100%`,background:c?.id===e.id?`var(--picked)`:`transparent`,border:0,color:`inherit`,font:`inherit`,textAlign:`left`,cursor:`pointer`,padding:`7px 6px`,borderRadius:6},children:[(0,j.jsxs)(`span`,{className:`stack`,style:{gap:2,minWidth:0},children:[(0,j.jsx)(`span`,{className:`mono`,style:{fontSize:12,wordBreak:`break-all`},children:e.id}),e.name&&e.name!==e.id&&(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:11.5},children:e.name})]}),(0,j.jsx)(`span`,{className:`chip dim`,children:e.kind})]})},`${e.kind}/${e.id}`)),e.total>e.rows.length&&(0,j.jsx)(`li`,{className:`muted`,style:{fontSize:11.5,padding:`4px 6px`},children:w.app.andMore(e.total-e.rows.length)})]})}):(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:nF.searchForAService})}),(0,j.jsx)(F,{title:d?nF.around(d):nF.theWholeEstate,kind:`hero`,span:`1 / -1`,children:(0,j.jsx)(I,{of:f,empty:e=>e.nodes.length===0,emptyContent:(0,j.jsx)(hl,{text:nF.theCatalogIsEmpty}),children:e=>(0,j.jsx)(Eu,{g:e,...d?{focus:d}:{},highlight:u.state===`ready`?u.data.rows.map(e=>e.id):[]})})}),c&&(0,j.jsx)(sF,{row:c},`${c.kind}/${c.id}`)]})}var lF=w.flowsModel,uF={action:`A person`,page:`A person`,job:`A schedule`,listener:`A message`},dF=6,fF=e=>e.length>dF?`${e.slice(0,dF).join(`, `)} and ${e.length-dF} more`:e.join(`, `),pF=e=>e?.path?`${e.path}${e.line===void 0?``:`:${e.line}`}`:void 0,mF=new Set([`loop`,`retry`]);function hF(e){let t=e.data??{},n=[];for(let e of[`sends`,`returns`,`reads`,`checks`])t[e]?.length&&n.push(`${e}: ${fF(t[e])}`);return(t.from?.length||t.to?.length)&&n.push(`maps: ${fF(t.from??[])} → ${fF(t.to??[])}`),e.store?.columns.length&&n.push(`columns: ${fF(e.store.columns)}`),e.repeats&&n.push(`repeats steps ${e.repeats.from} to ${e.repeats.to}`),n}function gF(e){let t=e.trigger,n=[],r=[{id:`caller`,label:t.caller?.who??uF[t.kind]??(n.push(lF.whoCallsThisEntry),lF.callerNotKnown),kind:`caller`}],i=t.caller?.via&&t.caller.via!==`direct`?t.caller.via:void 0;i&&r.push({id:`gateway`,label:i,kind:`gateway`}),r.push({id:`self`,label:e.component,kind:`self`});let a=(e,t,n,i)=>{let a=r.find(t=>t.id===e);return a?i&&(a.isNew=!0):r.push({id:e,label:t,kind:n,...i?{isNew:!0}:{}}),e},o=[{n:0,shown:lF.start,kind:t.kind,what:t.what,from:`caller`,to:`self`,...i?{label:`via ${i}`}:{},back:!1,fields:[],...pF(t.evidence[0])?{cite:pF(t.evidence[0])}:{},more:Math.max(0,t.evidence.length-1),frames:[]}];e.steps.forEach((t,r)=>{let i=r+1,s=`self`,c,l=!1;if(t.kind===`call-out`&&t.to)s=a(`component:${t.to.component}`,t.to.component,`component`,t.to.new),c=t.to.entry;else if(t.kind===`publish`){let e=t.to?.entry??t.refs?.[0]??`a topic`;s=a(`topic:${e}`,e,`topic`,t.to?.new)}else t.store&&[`read`,`write`,`lookup`].includes(t.kind)?s=a(`store:${t.store.table}`,t.store.table,`store`,t.store.new):t.kind===`respond`&&(s=`caller`,l=!0);let u=e.target?t.target:i,d=e.target?void 0:e.calls.find(e=>e.step===i),f=e.target?void 0:e.unmatched.find(e=>e.step===i);mF.has(t.kind)&&!t.repeats&&t.mark!==`removed`&&n.push(`Step ${u??i} is a ${t.kind} that doesn't say which steps it repeats yet.`),o.push({n:i,shown:u===void 0?t.today===void 0?``:`was ${t.today}`:String(u),kind:t.kind,what:t.what,from:`self`,to:s,...c?{label:c}:{},back:l,fields:hF(t),...pF(t.evidence[0])?{cite:pF(t.evidence[0])}:{},more:Math.max(0,t.evidence.length-1),...t.confirmedBy?{confirmedBy:t.confirmedBy}:{},...d?{opens:{repo:d.repo,flow:d.flow,...d.name?{name:d.name}:{}}}:{},...f?{unjoined:f.message}:{},frames:[],...t.mark&&t.mark!==`same`?{mark:t.mark}:{},...t.was&&t.was.what!==t.what?{was:t.was.what}:{},...t.why?{why:t.why}:{}})});let s=t=>e.target?o.find(n=>n.n>0&&e.steps[n.n-1].target===t)?.n:t,c=[];e.steps.forEach((t,n)=>{if(!mF.has(t.kind)||!t.repeats||t.mark===`removed`)return;let r=s(t.repeats.from),i=s(t.repeats.to);if(r===void 0||i===void 0||r>i||i>e.steps.length)return;let a=n+1;c.push({kind:t.kind,step:a,from:Math.min(r,a),to:Math.max(i,a),depth:0,repeats:t.repeats})}),c.sort((e,t)=>e.from-t.from||t.to-e.to),c.forEach((e,t)=>{e.depth=c.slice(0,t).filter(t=>t.from<=e.from&&t.to>=e.to).length});for(let e of c)for(let t=e.from;t<=e.to;t++)o[t].frames.push({depth:e.depth,kind:e.kind,first:t===e.from,last:t===e.to,repeats:e.repeats});for(let e of o)e.frames.sort((e,t)=>e.depth-t.depth);return{lanes:r,rows:o,frames:c,errors:e.errors.map(e=>({when:e.when,then:e.then,...pF(e.evidence[0])?{cite:pF(e.evidence[0])}:{}})),gaps:n}}function _F(e){let t=e.calledBy[0],n=e.flow.trigger.caller??(t?{who:lF.calledByFlows(t.name??t.flow,e.calledBy.length-1)}:void 0);return gF({component:e.flow.component,trigger:{...e.flow.trigger,caller:n},steps:e.flow.steps,errors:e.flow.errors,calls:e.calls,unmatched:e.unmatched,target:!1})}function vF(e){return gF({component:e.component,trigger:{...e.trigger,evidence:e.triggerEvidence},steps:e.steps,errors:[],calls:[],unmatched:[],target:!0})}var yF=w.flowsScreen,bF=w.flows,xF=(e,t)=>`#/flows?repo=${encodeURIComponent(e)}${t?`&flow=${encodeURIComponent(t)}`:``}`,SF=(e,t)=>`#/flows?change=${encodeURIComponent(e)}${t?`&flow=${encodeURIComponent(t)}`:``}`,CF=e=>bF.kinds[e]??e;function wF({at:e,repo:t}){return(0,j.jsx)(oD,{repo:t,at:e})}function TF({by:e}){return e?(0,j.jsxs)(`span`,{className:`seq-ok`,children:[(0,j.jsx)(`span`,{"aria-hidden":`true`,children:`✓ `}),bF.confirmed[e]??e]}):(0,j.jsxs)(`span`,{className:`seq-unsure`,children:[(0,j.jsx)(`span`,{"aria-hidden":`true`,children:`○ `}),bF.notConfirmed]})}function EF({r:e,lanes:t,now:n,repo:r}){let i=(0,v.useRef)(null);(0,v.useEffect)(()=>{n&&i.current?.scrollIntoView({block:`center`,behavior:`smooth`})},[n]);let a=e=>t.findIndex(t=>t.id===e)+1,o=a(e.from),s=a(e.to),c=e.n===0?o:a(`self`),l=Math.min(o,s),u=Math.max(o,s),d=u-l+1,f=t[s-1];return(0,j.jsxs)(`li`,{ref:i,className:`seq-row${n?` seq-now`:``}`,...n?{"aria-current":`step`}:{},children:[e.frames.map(e=>(0,j.jsx)(`span`,{className:`seq-frame ${e.kind}${e.first?` first`:``}${e.last?` last`:``}`,style:{"--depth":e.depth},"aria-hidden":`true`,children:e.first&&(0,j.jsx)(`span`,{className:`seq-frame-label`,children:bF.frame(e.kind,e.repeats.from,e.repeats.to)})},e.depth)),t.map((e,t)=>(0,j.jsx)(`span`,{className:`seq-life`,style:{gridColumn:t+1},"aria-hidden":`true`},e.id)),o!==s&&(0,j.jsx)(`span`,{className:`seq-arrow ${s>o?`right`:`left`}${e.back?` back`:``}`,style:{gridColumn:`${l} / ${u+1}`,"--span":d},"aria-hidden":`true`,children:e.label&&(0,j.jsx)(`em`,{children:e.label})}),(0,j.jsxs)(`div`,{className:`seq-box k-${e.kind}${e.mark?` m-${e.mark}`:``}`,style:{gridColumn:c},children:[(0,j.jsxs)(`div`,{className:`seq-top`,children:[(0,j.jsx)(`span`,{className:`seq-n`,children:e.shown}),(0,j.jsx)(`span`,{className:`seq-kind`,children:CF(e.kind)}),e.mark&&(0,j.jsx)(`span`,{className:`seq-mark m-${e.mark}`,children:bF.marks[e.mark]})]}),(0,j.jsx)(`p`,{className:`seq-what`,children:e.what}),e.was&&(0,j.jsx)(`p`,{className:`seq-was`,children:bF.was(e.was)}),e.why&&(0,j.jsx)(`p`,{className:`seq-why`,children:e.why}),o!==s&&(0,j.jsx)(`p`,{className:`sr`,children:e.back?bF.backTo(f.label):bF.goesTo(e.label??f.label,f.label)}),e.fields.length>0&&(0,j.jsx)(`ul`,{className:`seq-fields`,children:e.fields.map(e=>(0,j.jsx)(`li`,{children:e},e))}),e.cite&&(0,j.jsxs)(`p`,{className:`seq-cite`,children:[(0,j.jsx)(wF,{at:e.cite,repo:r}),e.more>0&&(0,j.jsxs)(`span`,{children:[` `,bF.more(e.more)]})]}),e.n>0&&e.mark!==`added`&&(0,j.jsx)(TF,{by:e.confirmedBy}),e.opens&&(0,j.jsx)(`a`,{className:`seq-opens`,href:xF(e.opens.repo,e.opens.flow),children:bF.opens(e.opens.name??e.opens.flow,e.opens.repo)}),e.unjoined&&(0,j.jsx)(`p`,{className:`seq-unjoined`,children:bF.unjoined(e.unjoined)})]})]})}function DF({seq:e,name:t,current:n,hideErrors:r,repo:i}){let a=e.frames.reduce((e,t)=>Math.max(e,t.depth+1),0),o={"--lanes":e.lanes.length,"--frames":a},[s,c]=Wl();return(0,j.jsxs)(`div`,{className:`seq-wrap ${s?`viewer-full`:``}`,onKeyDown:e=>{if((e.key===`f`||e.key===`F`)&&!e.ctrlKey&&!e.metaKey&&!e.altKey){if(e.target.tagName===`INPUT`)return;e.preventDefault(),c()}},...s?{role:`dialog`,"aria-modal":!0,"aria-label":bF.diagram(t??yF.thisFlow)}:{},children:[(0,j.jsxs)(`div`,{className:`seq-bar`,children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,"aria-pressed":s,onClick:()=>c(),children:s?w.viewer.leaveFullScreen:w.viewer.fullScreen}),s&&(0,j.jsx)(`span`,{className:`hud`,role:`status`,children:w.viewer.fullScreenOn})]}),(0,j.jsxs)(`div`,{className:`seq`,style:o,tabIndex:0,role:`region`,"aria-label":bF.diagram(t??yF.thisFlow),children:[(0,j.jsx)(`div`,{className:`seq-row seq-head`,"aria-hidden":`true`,children:e.lanes.map((e,t)=>(0,j.jsxs)(`div`,{className:`seq-lane ${e.kind}${e.isNew?` new`:``}`,style:{gridColumn:t+1},children:[(0,j.jsx)(`strong`,{children:e.label}),(0,j.jsxs)(`small`,{children:[bF.lanes[e.kind],e.isNew?` · ${bF.newLane}`:``]})]},e.id))}),(0,j.jsx)(`ol`,{className:`seq-steps`,"aria-label":bF.diagram(t??yF.thisFlow),children:e.rows.map(t=>(0,j.jsx)(EF,{r:t,lanes:e.lanes,now:t.n===n,repo:i},t.n))})]}),!r&&(0,j.jsx)(`h3`,{className:`h seq-h`,children:bF.errorsTitle}),r?null:e.errors.length?(0,j.jsx)(`ul`,{className:`seq-errors`,children:e.errors.map((e,t)=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`span`,{children:e.when}),` `,(0,j.jsx)(`span`,{"aria-hidden":`true`,children:`→`}),` `,(0,j.jsx)(`strong`,{children:e.then}),e.cite&&(0,j.jsx)(wF,{at:e.cite,repo:i})]},t))}):(0,j.jsx)(`p`,{className:`muted`,children:bF.noErrors})]})}var OF=(e,t)=>{let n=t.trim().toLowerCase();return!n||[e.name,e.id,e.trigger.what].some(e=>e.toLowerCase().includes(n))};function kF(e){let t=e.spec.flows.filter(t=>OF(t,e.filter));return(0,j.jsxs)(`div`,{className:`stack`,children:[e.spec.flows.length===0?(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,j.jsx)(`div`,{className:`state`,children:bF.noFlows}),(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:bF.noFlowsSpec(e.spec.repo)}),(0,j.jsx)(sc,{text:`atticus spec draft ${e.spec.repo}`,label:w.runNext.copy})]}):t.length===0?(0,j.jsx)(`div`,{className:`state`,children:bF.noMatch}):(0,j.jsx)(`ul`,{className:`flow-list`,children:t.map(t=>(0,j.jsx)(`li`,{children:(0,j.jsxs)(`a`,{href:xF(e.spec.repo,t.id),"aria-current":t.id===e.current?`true`:void 0,children:[(0,j.jsx)(`span`,{className:`flow-name`,children:t.name}),(0,j.jsxs)(`span`,{className:`flow-trigger`,children:[(0,j.jsx)(`span`,{className:`seq-kind`,children:CF(t.trigger.kind)}),` `,t.trigger.what]}),(0,j.jsx)(`span`,{className:`flow-counts`,children:bF.counts(t.steps,t.confirmed)})]})},t.id))}),e.spec.problems.length>0&&(0,j.jsxs)(`div`,{className:`state error`,children:[bF.unreadable,(0,j.jsx)(`ul`,{children:e.spec.problems.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`code`,{children:e.file}),`: `,e.message]},e.file))})]})]})}function AF({repo:e,flow:t,step:n}){let r=P(`/api/specs/${encodeURIComponent(e)}/flows/${encodeURIComponent(t)}`);return St(e=>{e.type===`file.changed`&&typeof e.path==`string`&&e.path.includes(`specs`)&&r.reload()}),(0,j.jsx)(I,{of:r,children:t=>{let r=_F(t);return(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsx)(`h2`,{className:`h`,children:t.flow.name}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`},children:[(0,j.jsx)(`span`,{className:`hud`,children:bF.file}),(0,j.jsx)(`code`,{children:t.file}),(0,j.jsx)(sr,{text:t.file,label:bF.copyFile})]}),t.calledBy.length>0&&(0,j.jsxs)(`p`,{children:[bF.calledBy,`:`,` `,t.calledBy.map((e,t)=>(0,j.jsxs)(`span`,{children:[t>0&&`, `,(0,j.jsx)(`a`,{href:xF(e.repo,e.flow),children:e.name??e.flow}),` (`,e.repo,`)`]},`${e.flow}.${e.step}`))]}),!t.joined&&(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`p`,{className:`muted`,children:bF.notJoined}),(0,j.jsx)(sc,{text:`atticus estate join`,label:w.runNext.copy})]}),r.gaps.map(e=>(0,j.jsx)(`p`,{className:`seq-unjoined`,children:e},e)),(0,j.jsx)(DF,{seq:r,name:t.flow.name,repo:e,...n===void 0?{}:{current:n}})]})}})}function jF(e){let{repo:t,flow:n}=e,r=P(`/api/specs/${encodeURIComponent(t)}`),[i,a]=(0,v.useState)(e.q??``);return(0,j.jsxs)(`div`,{className:`flows-grid`,children:[(0,j.jsxs)(F,{title:bF.listTitle,children:[(0,j.jsxs)(`label`,{className:`stack`,style:{gap:4,marginBottom:10},children:[(0,j.jsx)(`span`,{className:`hud`,children:bF.filter}),(0,j.jsx)(`input`,{id:`flow-filter`,className:`field`,type:`search`,placeholder:bF.filterHint,value:i,onChange:e=>a(e.target.value)})]}),(0,j.jsx)(I,{of:r,children:e=>(0,j.jsx)(kF,{spec:e,filter:i,current:n})})]}),(0,j.jsx)(F,{children:n?(0,j.jsx)(AF,{repo:t,flow:n,...e.step===void 0?{}:{step:e.step}}):(0,j.jsx)(`div`,{className:`state`,children:bF.pick})})]})}function MF(e){return(0,j.jsxs)(`div`,{className:`stack`,children:[e.list.flows.length===0?(0,j.jsxs)(`div`,{className:`state`,children:[(0,j.jsx)(`p`,{style:{margin:`0 0 8px`},children:bF.noTargets(e.list.change)}),(0,j.jsx)(cc,{command:`atticus change architecture ${e.list.change}`,slash:`/atticus-architecture ${e.list.change}`})]}):(0,j.jsx)(`ul`,{className:`flow-list`,children:e.list.flows.map(t=>(0,j.jsx)(`li`,{children:(0,j.jsxs)(`a`,{href:SF(e.list.change,t.flow),"aria-current":t.flow===e.current?`true`:void 0,children:[(0,j.jsx)(`span`,{className:`flow-name`,children:t.name}),(0,j.jsxs)(`span`,{className:`flow-trigger`,children:[(0,j.jsx)(`span`,{className:`seq-kind d-${t.change}`,children:bF.deltaKinds[t.change]}),` `,t.repo]}),(0,j.jsx)(`span`,{className:`flow-counts`,children:bF.targetCounts(t.added,t.changed,t.removed)})]})},t.flow))}),e.list.problems.length>0&&(0,j.jsxs)(`div`,{className:`state error`,children:[bF.unreadable,(0,j.jsx)(`ul`,{children:e.list.problems.map(e=>(0,j.jsx)(`li`,{children:(0,j.jsx)(`code`,{children:e})},e))})]})]})}function NF({change:e,flow:t}){let n=P(`/api/changes/${encodeURIComponent(e)}/target-flows/${encodeURIComponent(t)}`);return St(e=>{e.type===`file.changed`&&typeof e.path==`string`&&e.path.includes(`changes`)&&n.reload()}),(0,j.jsx)(I,{of:n,children:e=>{let t=vF(e);return(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsx)(`h2`,{className:`h`,children:e.name}),(0,j.jsxs)(`p`,{children:[(0,j.jsx)(`span`,{className:`seq-kind d-${e.delta}`,children:bF.deltaKinds[e.delta]}),` `,bF.targetCounts(e.counts.added,e.counts.changed,e.counts.removed),`.`,` `,e.delta!==`new`&&(0,j.jsx)(`a`,{href:xF(e.repo,e.flow),children:e.flow})]}),(0,j.jsxs)(`p`,{children:[(0,j.jsx)(`span`,{className:`hud`,children:bF.whyChange}),` `,e.why]}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`},children:[(0,j.jsx)(`span`,{className:`hud`,children:bF.file}),(0,j.jsx)(`code`,{children:e.file}),(0,j.jsx)(sr,{text:e.file,label:bF.copyFile})]}),[...e.problems,...t.gaps].map(e=>(0,j.jsx)(`p`,{className:`seq-unjoined`,children:e},e)),(0,j.jsx)(DF,{seq:t,name:e.name,repo:e.repo,hideErrors:!0})]})}})}function PF({change:e,flow:t}){let n=P(`/api/changes/${encodeURIComponent(e)}/target-flows`);return(0,j.jsxs)(`div`,{className:`flows-grid`,children:[(0,j.jsxs)(F,{title:bF.targetsTitle,children:[(0,j.jsx)(`p`,{className:`muted`,style:{marginTop:0},children:bF.changeIntro}),(0,j.jsx)(I,{of:n,children:e=>(0,j.jsx)(MF,{list:e,current:t})})]}),(0,j.jsx)(F,{children:t?(0,j.jsx)(NF,{change:e,flow:t}):(0,j.jsx)(`div`,{className:`state`,children:bF.pick})})]})}function FF(e){return e.list.state!==`ready`||e.list.data.length===0?null:(0,j.jsxs)(`label`,{className:`row`,style:{gap:8},children:[(0,j.jsx)(`span`,{className:`hud`,children:bF.change}),(0,j.jsxs)(`select`,{id:`flow-change`,className:`run-select`,value:e.change??``,onChange:e=>location.hash=e.target.value?SF(e.target.value):`#/flows`,children:[(0,j.jsx)(`option`,{value:``,children:bF.pickRepo}),e.list.data.map(e=>(0,j.jsx)(`option`,{value:e.id,children:e.title},e.id))]})]})}function IF({hash:e}){let t=P(`/api/specs`),n=P(`/api/changes`),r=Nn(e,`change`),i=Nn(e,`repo`),a=Nn(e,`flow`),o=Nn(e,`q`),s=Number(Nn(e,`step`)),c=Number.isInteger(s)&&s>=0?s:void 0;return(0,j.jsx)(tD,{children:(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsxs)(F,{title:bF.title,children:[(0,j.jsx)(`p`,{className:`muted`,style:{marginTop:0},children:bF.intro}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:16,flexWrap:`wrap`},children:[(0,j.jsx)(FF,{list:n,...r?{change:r}:{}}),!r&&(0,j.jsx)(I,{of:t,empty:e=>e.repos.length===0,emptyText:bF.noSpecs,children:e=>{let t=i??e.repos[0].repo;return(0,j.jsxs)(`label`,{className:`row`,style:{gap:8},children:[(0,j.jsx)(`span`,{className:`hud`,children:bF.repo}),(0,j.jsx)(`select`,{id:`flow-repo`,className:`run-select`,value:t,onChange:e=>location.hash=xF(e.target.value),children:e.repos.map(e=>(0,j.jsxs)(`option`,{value:e.repo,children:[e.repo,` (`,e.flows,`)`]},e.repo))})]})}})]})]}),r&&(0,j.jsx)(PF,{change:r,flow:a},r),!r&&t.state===`ready`&&t.data.repos.length>0&&(0,j.jsx)(jF,{repo:i??t.data.repos[0].repo,flow:a,q:o,step:c},`${i}?${o}`)]})})}var LF=w.design,RF=Object.keys(LF.journeys),zF=Object.keys(LF.commitmentStates),BF=e=>e?.focus();function VF(e){let[t,n]=(0,v.useState)(e.open??!1),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(),[s,c]=(0,v.useState)(RF[0]),[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)(``),[p,m]=(0,v.useState)(!1),h=Vn(),g=(0,v.useId)();if(!t)return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,j.jsx)(`div`,{children:(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,onClick:()=>{n(!0),m(!1)},children:LF.newInitiative})}),p&&(0,j.jsxs)(`div`,{ref:BF,tabIndex:-1,className:`stack`,style:{gap:8},children:[(0,j.jsx)(Wn,{note:h.note}),(0,j.jsx)(Yc,{scope:`initiatives`})]})]});let _=a??yr(r),y=r.trim()!==``&&_!==``,b=()=>void h.run(async()=>{let t=await N(`/api/initiatives`,{method:`POST`,body:{title:r.trim(),id:_,journey:s,...l?{release:l}:{},...d.trim()?{epic:d.trim()}:{}}});return m(!0),n(!1),i(``),o(void 0),u(``),f(``),e.onCreated?.(t.initiative),t.initiative},LF.startedInitiative);return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,j.jsxs)(`form`,{className:`stack`,style:{gap:6},"aria-label":LF.newInitiativeTitle,onSubmit:e=>{e.preventDefault(),y&&!h.busy&&b()},children:[(0,j.jsx)(`label`,{htmlFor:`${g}-title`,className:`hud`,style:{fontSize:10},children:LF.initiativeTitleLabel}),(0,j.jsx)(`input`,{id:`${g}-title`,className:`field`,value:r,placeholder:LF.initiativeTitleHint,onChange:e=>{i(e.target.value),m(!1)}}),(0,j.jsx)(`label`,{htmlFor:`${g}-id`,className:`hud`,style:{fontSize:10},children:LF.initiativeIdLabel}),(0,j.jsx)(`input`,{id:`${g}-id`,className:`field mono`,value:_,onChange:e=>o(e.target.value)}),(0,j.jsx)(`label`,{htmlFor:`${g}-journey`,className:`hud`,style:{fontSize:10},children:LF.journeyLabel}),(0,j.jsx)(`select`,{id:`${g}-journey`,className:`field`,value:s,onChange:e=>c(e.target.value),children:RF.map(e=>(0,j.jsx)(`option`,{value:e,children:LF.journeys[e]},e))}),(0,j.jsx)(`label`,{htmlFor:`${g}-release`,className:`hud`,style:{fontSize:10},children:LF.releaseLabel}),(0,j.jsx)(`input`,{id:`${g}-release`,type:`date`,className:`field mono`,value:l,onChange:e=>u(e.target.value)}),(0,j.jsx)(`label`,{htmlFor:`${g}-epic`,className:`hud`,style:{fontSize:10},children:LF.epicLabel}),(0,j.jsx)(`input`,{id:`${g}-epic`,className:`field mono`,value:d,onChange:e=>f(e.target.value)}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:!y||h.busy,children:h.busy?LF.startingInitiative:LF.startInitiative}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>n(!1),children:LF.cancel})]}),(0,j.jsx)(Wn,{note:h.note})]}),p&&(0,j.jsx)(Yc,{scope:`initiatives`})]})}function HF(e){let[t,n]=(0,v.useState)(``),[r,i]=(0,v.useState)(e.release??``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(!1),l=Vn(),u=(0,v.useId)(),d=a.split(`,`).map(e=>e.trim()).filter(Boolean),f=t.trim()!==``||e.planned===!0,p=()=>void l.run(async()=>{await N(`/api/initiatives/${encodeURIComponent(e.initiative)}/plan`,{method:`POST`,body:{...t.trim()?{target:t.trim()}:{},...r&&r!==e.release?{release:r}:{},...d.length?{systems:d}:{}}}),c(!0),e.onSaved?.()},LF.planned);return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,j.jsxs)(`form`,{className:`stack`,style:{gap:6},"aria-label":LF.planTitle,onSubmit:e=>{e.preventDefault(),f&&!l.busy&&p()},children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:LF.planSay}),(0,j.jsx)(`label`,{htmlFor:`${u}-target`,className:`hud`,style:{fontSize:10},children:LF.targetLabel}),(0,j.jsx)(`input`,{id:`${u}-target`,className:`field mono`,value:t,placeholder:LF.targetHint,onChange:e=>n(e.target.value)}),(0,j.jsx)(`label`,{htmlFor:`${u}-release`,className:`hud`,style:{fontSize:10},children:LF.planReleaseLabel}),(0,j.jsx)(`input`,{id:`${u}-release`,type:`date`,className:`field mono`,value:r,onChange:e=>i(e.target.value)}),(0,j.jsx)(`label`,{htmlFor:`${u}-systems`,className:`hud`,style:{fontSize:10},children:LF.systemsLabel}),(0,j.jsx)(`input`,{id:`${u}-systems`,className:`field mono`,value:a,onChange:e=>o(e.target.value)}),(0,j.jsx)(`div`,{className:`row`,style:{gap:6},children:(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:!f||l.busy,children:l.busy?LF.planning:e.planned?LF.replan:LF.plan})}),(0,j.jsx)(Wn,{note:l.note})]}),s&&(0,j.jsx)(Yc,{scope:`initiatives`})]})}function UF(e){let[t,n]=(0,v.useState)(e.commitment.recorded??zF[0]),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(!1),s=Vn(),c=(0,v.useId)(),l=e.commitment.id,u=()=>void s.run(async()=>{await N(`/api/commitments/${encodeURIComponent(l)}/status`,{method:`POST`,body:{status:t,...r.trim()?{note:r.trim()}:{}}}),o(!0),i(``),e.onSaved?.()},LF.recorded(l,LF.commitmentStates[t]??t));return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,j.jsxs)(`form`,{className:`stack`,style:{gap:6},"aria-label":LF.setCommitment(e.commitment.what),onSubmit:e=>{e.preventDefault(),s.busy||u()},children:[(0,j.jsx)(`label`,{htmlFor:`${c}-state`,className:`hud`,style:{fontSize:10},children:LF.commitmentStateLabel}),(0,j.jsx)(`select`,{id:`${c}-state`,className:`field`,value:t,onChange:e=>n(e.target.value),children:zF.map(e=>(0,j.jsx)(`option`,{value:e,children:LF.commitmentStates[e]},e))}),(0,j.jsx)(`label`,{htmlFor:`${c}-note`,className:`hud`,style:{fontSize:10},children:LF.noteLabel}),(0,j.jsx)(`textarea`,{id:`${c}-note`,className:`field`,rows:2,value:r,onChange:e=>i(e.target.value)}),(0,j.jsx)(`div`,{className:`row`,style:{gap:6},children:(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:s.busy,children:s.busy?LF.recording:LF.recordState})}),(0,j.jsx)(Wn,{note:s.note}),(0,j.jsxs)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:[LF.orCommand,(0,j.jsx)(`span`,{className:`mono`,children:LF.commitCommand(l)})]})]}),a&&(0,j.jsx)(Yc,{scope:`initiatives`})]})}var q=w.design,WF=e=>Array.isArray(e.flags)&&e.flags.includes(`joined-by-ai`)||(e.evidence??[]).some(e=>e.source===`ai`);function GF(){let e=Mi(Oi());return e?(0,j.jsx)(Pi,{counts:e.links.counts,what:w.decisions.counts.links}):null}var KF=e=>e.kind===`Endpoint`?`${String(e.method??``)} ${String(e.normalizedPath??e.path??e.id)}`.trim():e.kind===`Interface`?`${String(e.from??`?`)} → ${String(e.to??`?`)}${e.via?` · ${String(e.via)}`:``}`:e.name??e.id;function qF({kind:e,title:t,pick:n,picked:r}){let[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(),c=`/api/catalog/${e}?limit=200${i.trim()?`&q=${encodeURIComponent(i.trim())}`:``}`,l=P(c),u=o?.for===c?o:void 0,d=u?u.next:l.state===`ready`?l.data.next:void 0,f=async()=>{if(!d)return;let e=await N(`${c}&cursor=${encodeURIComponent(d)}`);s({items:[...u?.items??[],...e.items],next:e.next,for:c})},p=`contracts-${e}-q`;return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsxs)(`div`,{className:`row between`,children:[(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:t}),(0,j.jsx)(`span`,{className:`n`,style:{fontSize:14},children:l.state===`ready`?l.data.total:``})]}),(0,j.jsx)(`label`,{className:`sr`,htmlFor:p,children:q.filterContracts(t.toLowerCase())}),(0,j.jsx)(`input`,{id:p,className:`field`,type:`search`,placeholder:q.filterContracts(t.toLowerCase()),value:i,onChange:e=>a(e.target.value)}),(0,j.jsx)(I,{of:l,empty:e=>e.items.length===0,emptyText:q.noInTheCatalog(t.toLowerCase()),children:e=>(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0},children:[...e.items,...u?.items??[]].map(e=>(0,j.jsx)(`li`,{children:(0,j.jsxs)(`button`,{type:`button`,"aria-pressed":r===e.id,onClick:()=>n(e),className:`list-row`,style:{width:`100%`,background:r===e.id?`var(--picked)`:`transparent`,border:0,color:`inherit`,font:`inherit`,textAlign:`left`,cursor:`pointer`,padding:`6px`,borderRadius:6},children:[(0,j.jsx)(`span`,{className:`mono`,style:{fontSize:11.5,wordBreak:`break-all`},children:KF(e)}),(0,j.jsx)(`span`,{className:`chip ${e.confidence===`verified`?`done`:`warn`}`,children:(e.confidence??`unknown`).toUpperCase()}),WF(e)&&(0,j.jsx)(Ni,{inLink:!0})]})},e.id))}),e.total>e.items.length+(u?.items.length??0)&&(0,j.jsxs)(`div`,{className:`row`,style:{gap:8},children:[(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:q.showingOf(e.items.length+(u?.items.length??0),e.total)}),d&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>void f(),children:q.showMore})]})]})})]})}function JF({evidence:e}){let t=QE(),n=gf(e).join(` `);return(0,v.useEffect)(()=>{for(let e of n.split(` `).filter(Boolean))t?.need(e)},[n,t]),(0,j.jsx)(rD,{gaps:hf(e,e=>{let n=t?.of(e);return n?.state===`ready`?n.data:void 0},{bare:!0})})}function YF({r:e}){let t=P(`/api/catalog/GatewayRoute?limit=500`),n=e=>`${e.repo??``}|${e.path??``}:${e.line??``}`,r=(e.evidence??[]).filter(e=>e.side===`gateway`&&e.path).map(n),i=e=>r.length?e.flatMap(e=>{let t=(e.evidence??[])[0],i=t?.path?r.indexOf(n(t)):-1;return i<0?[]:[{x:e,n:i}]}).sort((e,t)=>e.n-t.n||(e.x.id<t.x.id?-1:1)).map(e=>e.x):[];return(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:`hud`,style:{fontSize:10,marginBottom:6},children:q.thePathOfTheCall}),(0,j.jsx)(I,{of:t,empty:e=>i(e.items).length===0,emptyText:q.noRouteRecordedFor,children:t=>(0,j.jsxs)(`ol`,{className:`stack`,style:{gap:4,margin:0,paddingLeft:18,fontSize:12.5},children:[i(t.items).map((t,n)=>{let r=t.scopes??[],i=t.policies??[];return(0,j.jsxs)(`li`,{children:[(0,j.jsxs)(`span`,{className:`mono`,children:[String(t.proxy??t.id),` `,String(t.basepath??``)]}),` `,(0,j.jsx)(`span`,{className:`chip ${r.length?`done`:`blocking`}`,children:r.length?q.scopesIt(r.join(`, `)):q.noScopeDemanded}),` `,(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:9.5},children:n===0&&e.auth?q.theCallerMeets(String(e.auth)):i.join(`, `)||q.thenReaches(String(t.target??``))})]},t.id)}),(0,j.jsx)(`li`,{children:(0,j.jsxs)(`span`,{className:`mono`,children:[String(e.to??``),` `,String(e.method??``),` `,String(e.normalizedPath??``)]})})]})})]})}function XF({r:e}){let t=P(`/api/catalog/${e.kind}/${encodeURIComponent(e.id)}`),n=Oi(),r=P(`/api/impact/${encodeURIComponent(e.id)}?depth=2`);return(0,j.jsx)(F,{title:KF(e),span:`span 5`,rows:`span 2`,meta:e.kind,children:(0,j.jsx)(I,{of:t,children:t=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:12},children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:`hud`,style:{fontSize:10,marginBottom:6},children:q.evidence}),(0,j.jsx)(JF,{evidence:t.evidence??[]}),(t.evidence??[]).length===0?(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:q.noEvidenceTreatIt}):(t.evidence??[]).map((e,t)=>(0,j.jsxs)(`div`,{style:{fontSize:12.5,marginBottom:4},children:[e.source===`ai`?(0,j.jsx)(Fi,{run:e.run,ai:!0,...e.repo&&e.path&&e.line?{item:ji(Mi(n),e.repo,`${e.path}:${e.line}`)?.item}:{}}):(0,j.jsx)(`span`,{className:`chip ${e.source===`code`?``:`warn`}`,children:e.source.toUpperCase()}),` `,e.path&&e.line?(0,j.jsxs)(j.Fragment,{children:[e.repo&&(0,j.jsxs)(`span`,{className:`mono`,children:[e.repo,` · `]}),(0,j.jsx)(oD,{repo:e.repo,at:`${e.path}:${e.line}`})]}):(0,j.jsxs)(`span`,{className:`mono`,children:[e.repo?`${e.repo} · `:``,e.path??``]})]},t))]}),t.kind===`Interface`&&t.via===`gateway`?(0,j.jsx)(YF,{r:t}):null,(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:`hud`,style:{fontSize:10,marginBottom:6},children:q.consumersAndDependants}),(0,j.jsx)(I,{of:r,empty:e=>e.affected.length===0,emptyText:q.nothingInTheCatalog,children:t=>(0,j.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,gap:6},children:[t.affected.filter(e=>e.kind===`Component`).map(e=>(0,j.jsx)(`span`,{className:`chip dim`,children:e.id},e.id)),(0,j.jsx)(`a`,{href:`#/impact?q=${encodeURIComponent(e.id)}`,children:q.seeImpact})]})})]}),(0,j.jsxs)(`details`,{children:[(0,j.jsx)(`summary`,{className:`hud`,style:{fontSize:10,cursor:`pointer`},children:q.record}),(0,j.jsx)(`pre`,{className:`mono`,style:{fontSize:11,whiteSpace:`pre-wrap`,color:`var(--text-2)`},children:JSON.stringify(Object.fromEntries(Object.entries(t).filter(([e])=>e!==`evidence`)),null,2)})]})]})})})}function ZF(){let e=P(`/api/catalog/kinds`),t=P(`/api/catalog/Interface?limit=1`),n=P(`/api/catalog/Interface?limit=1&confidence=verified`),[r,i]=(0,v.useState)(),a=P(`/api/catalog/Endpoint?limit=1`),o=r??(a.state===`ready`?a.data.items[0]:void 0),s=t=>e.state===`ready`?e.data.find(e=>e.kind===t)?.count??0:0,c=n.state===`ready`?n.data.total:0,l=t.state===`ready`?t.data.total:0;return(0,j.jsx)(tD,{children:(0,j.jsxs)(`div`,{className:`bento`,children:[(0,j.jsx)(F,{title:q.contracts,span:`span 4`,rows:`span 2`,children:(0,j.jsxs)(`div`,{className:`stack`,tabIndex:0,role:`region`,"aria-label":q.contractsList,style:{gap:14,maxHeight:640,overflowY:`auto`},children:[(0,j.jsx)(qF,{kind:`Endpoint`,title:q.apis,pick:i,...o?{picked:o.id}:{}}),(0,j.jsx)(qF,{kind:`Interface`,title:q.interfacesAndEvents,pick:i,...o?{picked:o.id}:{}}),(0,j.jsx)(qF,{kind:`Table`,title:q.dataStores,pick:i,...o?{picked:o.id}:{}}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:11.5},children:q.dataStoresComeFrom})]})}),o?(0,j.jsx)(XF,{r:o},`${o.kind}/${o.id}`):(0,j.jsx)(F,{title:q.pickAContract,span:`span 5`,rows:`span 2`,children:(0,j.jsx)(`div`,{className:`state`,children:q.chooseAnApiAn})}),(0,j.jsx)(F,{title:q.contractMix,span:`span 3`,kind:`dark`,children:(0,j.jsx)(I,{of:e,children:()=>(0,j.jsx)(Lt,{title:q.contractsByKind,parts:[{label:`APIs`,value:s(`Endpoint`),color:`var(--accent)`},{label:q.interfaces,value:s(`Interface`),color:`var(--violet)`},{label:q.tables,value:s(`Table`),color:`var(--amber)`}]})})}),(0,j.jsx)(F,{title:q.verifiedFromCode,span:`span 3`,children:(0,j.jsx)(I,{of:t,children:()=>(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsx)(It,{value:c,max:Math.max(l,1),size:64,label:q.ofInterfacesVerifiedFrom(c,l)}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:11.5},children:q.aVendorSpecIs}),(0,j.jsx)(GF,{}),(0,j.jsx)(`a`,{href:`#/mappings`,children:q.fieldMappings})]})})})]})})}var QF=/^inputs\/diagrams\/.+\.(drawio|drawio\.xml|vsdx|mmd|mermaid|csv)$/i;function $F(e){return e===`error`?!0:e?e.documents.some(e=>QF.test(e.path)):void 0}function eI(){let e=P(`/api/knowledge/documents`),t=$F(e.state===`ready`?e.data:e.state===`error`?`error`:void 0);return{r:P(t?`/api/view/reconcile`:void 0),none:t===!1}}var tI=e=>/No diagrams to reconcile/.test(e);function nI({hash:e}){let{r:t,none:n}=eI(),r=Nn(e,`file`),[i,a]=(0,v.useState)(`all`);if(St(e=>{e.type===`job.done`&&t.reload()}),n||t.state===`error`&&tI(t.error))return(0,j.jsx)(`div`,{className:`bento`,children:(0,j.jsx)(F,{title:q.reconcileADiagramAgainst,span:`1 / -1`,children:(0,j.jsxs)(`div`,{className:`state`,children:[q.noDiagramsYetPut,(0,j.jsx)(`span`,{className:`mono`,children:q.inputsDiagrams}),` `,q.orAddThemOn,(0,j.jsx)(`a`,{href:`#/intake`,children:q.intake}),q.thenComeBack]})})});let o=t.state===`ready`?t.data.data.diagrams:[],s=o.find(e=>e.file===r)??o[0],c=s?[...new Set(s.items.map(e=>e.type))]:[],l=s?s.items.filter(e=>i===`all`||e.type===i):[];return(0,j.jsxs)(`div`,{className:`bento`,children:[(0,j.jsx)(F,{title:q.diagrams,span:`span 4`,children:(0,j.jsx)(I,{of:t,empty:()=>o.length===0,emptyText:q.noDiagramsCouldBe,children:()=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[o.map(e=>(0,j.jsxs)(`a`,{href:`#/reconcile?file=${encodeURIComponent(e.file)}`,"aria-current":e===s?`page`:void 0,className:`list-row`,style:{textDecoration:`none`,padding:6,borderRadius:6,background:e===s?`var(--picked)`:void 0},children:[(0,j.jsxs)(`span`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`span`,{className:`mono`,style:{fontSize:11.5},children:e.file.replace(/^inputs\/diagrams\//,``)}),(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:9.5},children:q.edgesMatchCode(e.matches.length,e.edges)})]}),(0,j.jsx)(`span`,{className:`chip ${e.items.length?`warn`:`done`}`,children:e.items.length?q.toResolve(e.items.length):q.inSync})]},e.file)),(0,j.jsx)(Ft,{of:t,label:q.checkAgain}),s&&(0,j.jsxs)(`div`,{className:`stack`,style:{gap:12,marginTop:10},children:[(0,j.jsxs)(`div`,{className:`row`,children:[(0,j.jsx)(It,{value:s.matches.length,max:Math.max(s.edges,1),size:72,label:q.ofDrawnEdgesAgree(s.matches.length,s.edges)}),(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12.5},children:q.drawnEdgesAgreeWith})]}),(0,j.jsx)(Lt,{title:q.itemsToResolveBy,parts:c.map((e,t)=>({label:e,value:s.items.filter(t=>t.type===e).length,color:[`var(--magenta)`,`var(--amber)`,`var(--accent)`,`var(--violet)`,`var(--green)`,`var(--accent-pale)`][t%6]}))}),s.names.length>0&&(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:q.labelsMatchedToThe(s.names.filter(e=>e.id).length,s.names.length)})]})]})})}),(0,j.jsx)(F,{title:s?q.edgeByEdge(s.file.split(`/`).pop()??``):q.edgeByEdge2,span:`span 8`,meta:s?(0,j.jsx)(Rt,{value:s.matches.length,max:Math.max(s.edges,1),label:q.ofEdgesAgreeWith(s.matches.length,s.edges)}):void 0,children:s?(0,j.jsxs)(`div`,{className:`stack`,style:{gap:10},children:[(0,j.jsx)(`div`,{className:`row`,role:`group`,"aria-label":q.filterItems,style:{flexWrap:`wrap`,gap:6},children:[`all`,...c].map(e=>(0,j.jsx)(`button`,{type:`button`,className:`btn ${i===e?`primary`:``}`,"aria-pressed":i===e,onClick:()=>a(e),children:e===`all`?q.all(s.items.length):`${e} ${s.items.filter(t=>t.type===e).length}`},e))}),l.length===0?(0,j.jsx)(`div`,{className:`state`,children:q.everyDrawnEdgeAgrees}):(0,j.jsx)(Gn,{caption:q.itemsToResolve,rows:l,rowKey:e=>e.id,cols:[{label:q.result,cell:e=>(0,j.jsx)(`span`,{className:`chip ${/mismatch|conflict|unknown/.test(e.type)?`blocking`:`warn`}`,children:e.type}),width:`150px`},{label:q.what,cell:e=>e.summary},{label:q.next,cell:e=>e.suggestion?.text??``}]}),(0,j.jsxs)(`p`,{className:`muted`,style:{margin:0,fontSize:11.5},children:[q.codeWinsOverA,(0,j.jsx)(`a`,{href:`#/intake`,children:q.triage}),` `,q.untilAPersonDecides]})]}):(0,j.jsx)(`div`,{className:`state`,children:q.pickADiagram})}),s&&s.names.some(e=>!e.id||e.how!==`exact`)&&(0,j.jsxs)(F,{title:q.nameMatching,span:`1 / -1`,children:[(0,j.jsx)(Gn,{caption:q.diagramLabels,rows:s.names.filter(e=>!e.id||e.how!==`exact`),rowKey:e=>e.name,cols:[{label:q.diagramLabel,cell:e=>e.name},{label:q.matched,cell:e=>e.id?(0,j.jsx)(`span`,{className:`mono`,children:e.id}):(0,j.jsx)(`span`,{className:`chip warn`,children:q.noMatch})},{label:q.how,cell:e=>e.how??``},{label:q.similar,cell:e=>e.similar.slice(0,3).join(`, `),mono:!0}]}),(0,j.jsxs)(`p`,{className:`muted`,style:{margin:`8px 0 0`,fontSize:12},children:[q.confirmANameWith,(0,j.jsx)(`span`,{className:`mono`,children:q.atticusAliasLabelId}),q.itIsSavedTo]})]})]})}var rI=[{id:`context`,label:q.context,focus:!1},{id:`data`,label:q.data,focus:!1},{id:`event`,label:q.events,focus:!1},{id:`container`,label:q.container,focus:!0},{id:`sequence`,label:q.sequence,focus:!0}];function iI({hash:e}){let t=Nn(e,`view`)??`context`,n=rI.find(e=>e.id===t)??rI[0],r=Mn(`coverage`),i=r.state===`ready`?r.data.systems.map(e=>e.system):[],[a,o]=(0,v.useState)(),s=a??i[0],c=P(n.focus&&!s?void 0:`/api/diagram/${n.id}${n.focus&&s?`?focus=${encodeURIComponent(s)}`:``}`),l=n.id!==`sequence`,u=P(!l||n.focus&&!s?void 0:`/api/diagram/${n.id}/graph${n.focus&&s?`?focus=${encodeURIComponent(s)}`:``}`),d=P(l?void 0:s?`/api/graph?focus=${encodeURIComponent(s)}&depth=1`:`/api/graph`),[f,p]=(0,v.useState)(!1);(0,v.useEffect)(()=>p(!1),[n.id,s]);let m=n.focus&&!s&&r.state!==`loading`;return(0,j.jsxs)(`div`,{className:`bento`,children:[(0,j.jsx)(F,{title:q.generatedViews,span:`1 / -1`,children:(0,j.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,gap:6},children:[(0,j.jsx)(`div`,{role:`tablist`,"aria-label":q.view,className:`row`,style:{gap:6},children:rI.map(e=>(0,j.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":e.id===n.id,className:`btn ${e.id===n.id?`primary`:``}`,onClick:()=>Pn(`diagrams`,`view`,e.id),children:e.label},e.id))}),n.focus&&(0,j.jsxs)(`label`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:q.system}),(0,j.jsx)(`select`,{value:s??``,onChange:e=>o(e.target.value),style:{height:32,background:`var(--box)`,color:`var(--text)`,border:`1px solid var(--line-2)`,borderRadius:7,padding:`0 8px`,font:`inherit`},children:i.map(e=>(0,j.jsx)(`option`,{children:e},e))})]}),(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:q.drawnFromTheCatalog})]})}),(0,j.jsx)(F,{title:q.view2(n.label),kind:`hero`,span:`1 / -1`,children:m?r.state===`error`?(0,j.jsx)(`p`,{role:`alert`,className:`state error`,children:q.systemsFailed(r.error)}):(0,j.jsx)(hl,{text:q.noSystemToDraw}):l?(0,j.jsx)(I,{of:u,empty:e=>e.view.nodes.length===0,emptyText:q.nothingToDrawThe(n.label.toLowerCase()),children:e=>(0,j.jsx)(bu,{view:e.view,height:460})}):(0,j.jsx)(I,{of:d,empty:e=>e.nodes.length===0,emptyContent:(0,j.jsx)(hl,{text:q.theCatalogIsEmpty}),children:e=>(0,j.jsx)(Eu,{g:e,...n.focus&&s?{focus:s}:{},height:460})})}),(0,j.jsx)(F,{title:q.mermaid,span:`1 / -1`,meta:c.state===`ready`?(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>{navigator.clipboard?.writeText(c.data.text).then(()=>p(!0))},children:f?q.copied:q.copy}):void 0,children:m?(0,j.jsx)(hl,{text:q.noSystemToDraw}):(0,j.jsx)(I,{of:c,empty:e=>!e.text.trim(),emptyText:q.nothingToDrawFor,children:e=>(0,j.jsx)(`pre`,{className:`mono`,tabIndex:0,"aria-label":q.mermaidSource,style:{margin:0,fontSize:11.5,lineHeight:1.55,whiteSpace:`pre-wrap`,maxHeight:460,overflowY:`auto`,color:`var(--text-2)`},children:e.text})})}),(0,j.jsx)(F,{title:q.diagramsInTheMetarepo,span:`span 7`,children:(0,j.jsxs)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:[q.diagramsUnder,(0,j.jsx)(`span`,{className:`mono`,children:q.inputsDiagrams}),` `,q.areComparedWithThe,(0,j.jsx)(`a`,{href:`#/reconcile`,children:q.reconcile}),`.`]})}),(0,j.jsx)(F,{title:q.catalogShapeLibrary,span:`span 5`,children:(0,j.jsxs)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:[q.writeTheDrawIo,(0,j.jsx)(`span`,{className:`mono`,children:q.atticusDiagramLibraryFile}),` `,q.andLoadItIn]})})]})}var aI={done:`var(--green)`,open:`var(--accent)`,"at-risk":`var(--amber)`,slipped:`var(--magenta)`};function oI({s:e}){let t=e=>Date.parse(`${e}T00:00:00Z`)/864e5,n=e.items;if(n.length===0)return(0,j.jsx)(`div`,{className:`state`,children:q.nothingPlannedYet});let r=Math.min(t(e.today),...n.map(e=>t(e.start))),i=Math.max(...n.map(e=>Math.max(t(e.due),t(e.projectedFinish))),r+1),a=e=>230+(t(e)-r)/(i-r)*520,o=n.length*26+30;return(0,j.jsxs)(`svg`,{role:`img`,"aria-label":q.timelineOfPlanItems(n.length,n[0].start,e.today),viewBox:`0 0 760 ${o}`,style:{width:`100%`,display:`block`},children:[n.map((e,t)=>{let n=10+t*26,r=aI[e.status]??`var(--accent)`;return(0,j.jsxs)(`g`,{children:[(0,j.jsx)(`text`,{x:0,y:n+13,fill:e.critical?`var(--text)`:`var(--muted-2)`,fontSize:11,fontFamily:`IBM Plex Sans, sans-serif`,children:e.what.length>34?`${e.what.slice(0,33)}…`:e.what}),(0,j.jsx)(`rect`,{x:a(e.start),y:n+3,width:Math.max(a(e.projectedFinish)-a(e.start),3),height:12,rx:3,fill:r,opacity:.75,style:{filter:`drop-shadow(0 0 var(--glow-size) ${r})`}}),(0,j.jsx)(`line`,{x1:a(e.due),x2:a(e.due),y1:n,y2:n+18,stroke:`var(--text)`,strokeWidth:1.5})]},e.key)}),(0,j.jsx)(`line`,{x1:a(e.today),x2:a(e.today),y1:0,y2:o-16,stroke:`var(--magenta)`,strokeDasharray:`3 3`}),(0,j.jsx)(`text`,{x:a(e.today)+4,y:o-4,fill:`var(--magenta-text)`,fontSize:10,fontFamily:`JetBrains Mono, monospace`,children:q.today(e.today)}),e.targetRelease&&(0,j.jsx)(`text`,{x:750,y:o-4,textAnchor:`end`,fill:`var(--muted-2)`,fontSize:10,fontFamily:`JetBrains Mono, monospace`,children:q.target(e.targetRelease)})]})}var sI={"on-track":`done`,done:`done`,"at-risk":`warn`,slipped:`blocking`,open:`dim`,"not-planned":`dim`};function cI(e){return q.initiativeStates[e]??e.replace(/-/g,` `)}function lI({changes:e}){return e.length===0?(0,j.jsx)(`div`,{className:`state`,children:q.noChangesYet}):(0,j.jsx)(`ul`,{className:`stack`,style:{gap:4,margin:0,paddingLeft:18},children:e.map(e=>(0,j.jsxs)(`li`,{children:[e.state?(0,j.jsx)(`a`,{href:`#/changes/${encodeURIComponent(e.id)}`,className:`mono`,children:e.id}):(0,j.jsx)(`span`,{className:`mono`,children:e.id}),` `,(0,j.jsxs)(`span`,{className:`muted`,children:[`· `,e.state??q.notStartedYet]})]},e.id))})}function uI(e){return e.status===`not-planned`?[q.noPlanYet,...e.notes.filter(e=>!/has no plan yet/.test(e))]:e.notes}function dI({hash:e}){let t=P(`/api/initiatives`),n=Nn(e,`id`),[r,i]=(0,v.useState)(),a=t.state===`ready`?t.data.find(e=>e.initiative===n)??t.data[0]:void 0,o=()=>t.reload(),s=a?.commitments.find(e=>e.id===r);return(0,j.jsxs)(`div`,{className:`bento`,children:[(0,j.jsxs)(F,{title:q.initiatives,span:`span 4`,children:[(0,j.jsx)(I,{of:t,empty:e=>e.length===0,emptyText:q.noInitiativesYet,children:e=>(0,j.jsx)(`div`,{className:`stack`,style:{gap:6},children:e.map(e=>(0,j.jsxs)(`a`,{href:`#/initiatives?id=${encodeURIComponent(e.initiative)}`,"aria-current":e===a?`page`:void 0,className:`stack`,style:{gap:4,textDecoration:`none`,color:`inherit`,padding:8,borderRadius:8,border:`1px solid var(--line)`,background:e===a?`var(--picked-faint)`:void 0},children:[(0,j.jsxs)(`span`,{className:`row between`,children:[(0,j.jsx)(`span`,{style:{fontWeight:600},children:e.title}),(0,j.jsx)(`span`,{className:`chip ${sI[e.status]??``}`,children:cI(e.status)})]}),(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:9.5},children:q.changesParties(e.journey,e.changes.length,new Set(e.commitments.map(e=>e.party)).size)})]},e.initiative))})}),(0,j.jsx)(`div`,{style:{marginTop:10},children:(0,j.jsx)(VF,{onCreated:e=>{Pn(`initiatives`,`id`,e),o()}})}),(0,j.jsxs)(`p`,{className:`muted`,style:{margin:`10px 0 0`,fontSize:12},children:[q.startOneFromA,(0,j.jsx)(`span`,{className:`mono`,children:q.atticusInitiativeNewTitle})]})]}),a?(0,j.jsxs)(`div`,{className:`column`,style:{gridColumn:`span 8`},children:[(0,j.jsx)(F,{title:a.title,kind:`hero`,span:`span 8`,meta:a.targetRelease?q.target2(a.targetRelease,a.projectedRelease?q.forecast(a.projectedRelease):``):void 0,children:(0,j.jsxs)(`div`,{className:`stack`,style:{gap:10},children:[a.criticalPath.length>0&&(0,j.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,gap:6},children:[(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:q.criticalPath}),a.criticalPath.map((e,t)=>(0,j.jsxs)(`span`,{className:`row`,style:{gap:6},children:[t>0&&(0,j.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,j.jsx)(`span`,{className:`chip`,children:e})]},e))]}),(0,j.jsx)(Gn,{caption:q.planItems,rows:a.items,rowKey:e=>e.key,cols:[{label:q.item,cell:e=>(0,j.jsx)(`span`,{className:e.critical?``:`muted`,children:e.what})},{label:q.party,cell:e=>e.party??``},{label:q.due,cell:e=>e.due,mono:!0},{label:q.forecast2,cell:e=>e.projectedFinish,mono:!0},{label:q.status,cell:e=>(0,j.jsx)(`span`,{className:`chip ${sI[e.status]??``}`,title:e.why,children:cI(e.status)})}]})]})}),(0,j.jsx)(F,{title:q.changesToStart,span:`span 8`,children:(0,j.jsx)(lI,{changes:a.changes})}),(0,j.jsx)(F,{title:q.timeline,span:`span 8`,kind:`dark`,children:(0,j.jsx)(oI,{s:a})}),(0,j.jsx)(F,{title:q.planTitle,span:`span 8`,children:(0,j.jsx)(HF,{initiative:a.initiative,planned:a.status!==`not-planned`,release:a.targetRelease,onSaved:o},a.initiative)}),(0,j.jsxs)(F,{title:q.whoOwesWhat,span:`span 8`,children:[a.commitments.length===0?(0,j.jsx)(`div`,{className:`state`,children:q.noCommitmentsYet}):(0,j.jsx)(Gn,{caption:q.commitments,rows:a.commitments,rowKey:e=>e.id,cols:[{label:q.party,cell:e=>e.party},{label:q.commitment,cell:e=>e.what},{label:q.neededBy,cell:e=>e.neededBy,mono:!0},{label:q.status,cell:e=>(0,j.jsxs)(`span`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`span`,{className:`chip ${sI[e.status]??``}`,title:e.why,children:cI(e.status)}),e.note&&(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:11.5},children:q.lastNote(e.note.note,e.note.by,e.note.at)})]})},{label:q.update,cell:e=>(0,j.jsx)(`button`,{type:`button`,className:`btn`,"aria-pressed":r===e.id,"aria-label":q.setCommitment(e.what),onClick:()=>i(r===e.id?void 0:e.id),children:q.update})}]}),s&&(0,j.jsx)(`div`,{style:{marginTop:10},children:(0,j.jsx)(UF,{commitment:s,onSaved:o},s.id)}),uI(a).map((e,t)=>(0,j.jsx)(`p`,{className:`muted`,style:{margin:`8px 0 0`,fontSize:12},children:e},t))]})]}):null]})}var fI={map:()=>(0,j.jsx)(Yu,{}),systems:yd,impact:Zu,features:$u,orgpack:()=>(0,j.jsx)(ed,{}),intake:()=>(0,j.jsx)(rd,{}),scans:()=>(0,j.jsx)(md,{}),brief:Ps,ux:Fs,"arch-review":Rs,diagrams:iI,reconcile:nI,contracts:()=>(0,j.jsx)(ZF,{}),mappings:Vs,breakdown:Gs,initiatives:dI,tasks:Qs,trace:$s},pI=w.knowledge.documents,mI=864e5;function hI(e,t){if(!e)return;let n=Math.floor((t-Date.parse(e))/mI);return Number.isFinite(n)?pI.age(Math.max(0,n)):void 0}function gI(e,t){let n=t.text.trim().toLowerCase();return e.filter(e=>(!t.kind||e.kind===t.kind)&&(!t.system||e.systems.includes(t.system))&&(!n||e.path.toLowerCase().includes(n)||(e.title??``).toLowerCase().includes(n)))}function _I({d:e,now:t}){let n=hI(e.modifiedAt,t),r=e.items.filter(e=>e.verified).length;return(0,j.jsxs)(`article`,{className:`list-row`,style:{display:`block`},"aria-label":e.path,children:[(0,j.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`,gap:8},children:[(0,j.jsx)(`span`,{className:`mono`,style:{wordBreak:`break-all`},children:e.path}),(0,j.jsxs)(`span`,{className:`row`,style:{gap:6,flexWrap:`wrap`},children:[(0,j.jsx)(`span`,{className:`chip`,children:pI.kinds[e.kind]??e.kind}),(0,j.jsx)(`span`,{className:`chip ${e.state===`read`?``:`warn`}`,children:pI.states[e.state]}),e.inbox&&(0,j.jsx)(`span`,{className:`chip`,children:pI.inbox})]})]}),e.title&&e.title!==e.path&&(0,j.jsx)(`p`,{style:{margin:`4px 0 0`},children:e.title}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:`4px 0 0`,fontSize:12.5},children:[e.systems.length?pI.systems(e.systems.join(`, `)):pI.noSystems,n,e.items.length?pI.items(e.items.length,r):void 0].filter(Boolean).join(` · `)}),e.reason&&(0,j.jsx)(`p`,{className:`muted`,style:{margin:`4px 0 0`,fontSize:12.5},children:pI.why(e.reason)}),e.supersededBy&&!e.reason&&(0,j.jsx)(`p`,{className:`muted`,style:{margin:`4px 0 0`,fontSize:12.5},children:pI.newer(e.supersededBy)}),e.duplicateOf&&!e.reason&&(0,j.jsx)(`p`,{className:`muted`,style:{margin:`4px 0 0`,fontSize:12.5},children:pI.duplicate(e.duplicateOf)}),e.items.length>0&&(0,j.jsx)(`ul`,{style:{margin:`6px 0 0`,paddingLeft:18},children:e.items.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`a`,{href:`#/knowledge?item=${encodeURIComponent(e.id)}`,children:e.title}),e.verified?` (${pI.verified})`:``]},e.id))})]})}function vI(e){let[t,n]=(0,v.useState)(``),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),s=e.now??Date.now(),c=e.data.documents,l=[...new Set(c.map(e=>e.kind))].sort(),u=[...new Set(c.flatMap(e=>e.systems))].sort(),d=gI(c,{kind:t,system:r,text:a}),f=!!(t||r||a.trim()),p=c.filter(e=>e.state===`read`).length;return(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:e.data.snapshot?pI.synced(e.data.snapshot.date,p,c.length):pI.neverSynced}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`,alignItems:`flex-end`},children:[(0,j.jsx)(ii,{id:`documents-filter`,value:a,onChange:o,grow:!0}),(0,j.jsxs)(`label`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`span`,{className:`hud`,children:pI.kindLabel}),(0,j.jsxs)(`select`,{id:`documents-kind`,className:`field`,value:t,onChange:e=>n(e.target.value),children:[(0,j.jsx)(`option`,{value:``,children:pI.anyKind}),l.map(e=>(0,j.jsx)(`option`,{value:e,children:pI.kinds[e]??e},e))]})]}),(0,j.jsxs)(`label`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`span`,{className:`hud`,children:pI.systemLabel}),(0,j.jsxs)(`select`,{id:`documents-system`,className:`field`,value:r,onChange:e=>i(e.target.value),children:[(0,j.jsx)(`option`,{value:``,children:pI.anySystem}),u.map(e=>(0,j.jsx)(`option`,{value:e,children:e},e))]})]})]}),(0,j.jsx)(ai,{shown:d.length,total:c.length,active:f}),d.length===0?(0,j.jsx)(oi,{what:pI.filtered,onClear:()=>{n(``),i(``),o(``)},focus:`documents-filter`}):(0,j.jsx)(`div`,{className:`stack`,style:{gap:6},children:d.map(e=>(0,j.jsx)(_I,{d:e,now:s},e.path))})]})}var yI=e=>{let t=``,n=new Uint8Array(e);for(let e=0;e<n.length;e+=32768)t+=String.fromCharCode(...n.subarray(e,e+32768));return btoa(t)};function bI(){let e=P(`/api/knowledge/documents`);lt(e);let t=Vn(),n=Vn();return(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsxs)(F,{title:pI.title,children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:`0 0 8px`,maxWidth:`70ch`},children:pI.intro}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:n.busy,onClick:()=>document.getElementById(`documents-add`)?.click(),children:n.busy?pI.adding:pI.add}),(0,j.jsx)(`input`,{id:`documents-add`,type:`file`,multiple:!0,className:`sr`,"aria-label":pI.add,tabIndex:-1,disabled:n.busy,onChange:t=>{let r=[...t.target.files??[]];t.target.value=``,r.length&&n.run(async()=>{for(let e of r)await N(`/api/knowledge/documents`,{method:`POST`,body:{name:e.name,content:yI(await e.arrayBuffer())}});e.reload()},pI.added(r.length))}}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:t.busy,onClick:()=>void t.run(async()=>{await N(`/api/knowledge/sources/inputs/sync`,{method:`POST`}),e.reload()},pI.syncedNow),children:t.busy?pI.syncing:pI.sync})]}),(0,j.jsx)(Wn,{note:n.note}),(0,j.jsx)(Wn,{note:t.note})]}),(0,j.jsx)(F,{title:pI.listTitle,children:(0,j.jsx)(I,{of:e,empty:e=>e.documents.length===0,emptyText:pI.empty,children:e=>(0,j.jsx)(vI,{data:e})})}),(0,j.jsx)(F,{title:pI.readTitle,children:(0,j.jsx)(ta,{command:`atticus knowledge scan --source inputs`,slash:`/atticus-knowledge inputs`,why:pI.readWhy})})]})}var xI=w.knowledge,SI=xI.items;function CI(e,t){if(!t)return{};let n=e.find(e=>e.id===t);return n?{item:n}:{missing:t}}function wI(){let e=(0,v.useRef)(null);return(0,v.useEffect)(()=>{e.current?.querySelector(`input, textarea, select`)?.focus()},[]),e}var TI=[`decision`,`stance`];function EI(e){let t=e.screen??`knowledge`;return(0,j.jsx)(I,{of:e.of,empty:e=>e.items.length===0,emptyContent:(0,j.jsx)(na,{text:SI.empty}),children:n=>{let r=n.items.filter(t=>(!e.kind||t.kind===e.kind)&&ua(t,e.text)),i=da(r,xI.groups);return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(_c,{list:n.problems}),(0,j.jsx)(`p`,{className:`hud`,style:{fontSize:10,margin:`0 0 6px`},"aria-live":`polite`,children:SI.count(r.length)}),i.length===0&&(e.onClear?(0,j.jsx)(oi,{what:ri({text:e.text,...e.kind?{kind:Yi(e.kind)}:{}}),onClear:e.onClear,focus:`item-find`}):(0,j.jsx)(`div`,{className:`state`,children:SI.noMatch})),i.map(n=>(0,j.jsxs)(`section`,{"aria-label":n.title,style:{marginBottom:10},children:[(0,j.jsx)(`h3`,{className:`hud`,style:{fontSize:11,margin:`6px 0`},children:`${n.title} (${n.items.length})`}),(0,j.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0},children:n.items.map(n=>(0,j.jsxs)(`li`,{className:`list-row`,style:{alignItems:`flex-start`},children:[(0,j.jsxs)(`span`,{className:`stack`,style:{gap:2,minWidth:0},children:[(0,j.jsx)(`a`,{href:`#/${t}?item=${encodeURIComponent(n.id)}`,"aria-current":n.id===e.current?`true`:void 0,children:n.title}),(0,j.jsxs)(`span`,{className:`muted mono`,style:{fontSize:11},children:[Yi(n.kind),` · `,n.id]})]}),(0,j.jsx)(ea,{review:n.review})]},n.id))})]},n.title))]})}})}function DI(e){return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`label`,{htmlFor:e.id,className:`hud`,style:{fontSize:10},children:e.label}),(0,j.jsx)(`input`,{id:e.id,className:`field`,value:e.value,onChange:t=>e.onChange(t.target.value)})]})}function OI(e){return(0,j.jsxs)(`fieldset`,{className:`stack`,style:{gap:4,border:0,padding:0,margin:0},children:[(0,j.jsx)(`legend`,{className:`hud`,style:{fontSize:10},children:e.label}),e.value.map((t,n)=>(0,j.jsxs)(`div`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`input`,{className:`field`,"aria-label":`${e.label}: ${SI.item(n+1)}`,value:t,onChange:t=>e.onChange(e.value.map((e,r)=>r===n?t.target.value:e))}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,"aria-label":`${SI.remove} ${e.label}: ${SI.item(n+1)}`,onClick:()=>e.onChange(e.value.filter((e,t)=>t!==n)),children:SI.remove})]},n)),(0,j.jsx)(`div`,{children:(0,j.jsx)(`button`,{type:`button`,className:`btn`,"aria-label":`${SI.addValue}: ${e.label}`,onClick:()=>e.onChange([...e.value,``]),children:SI.addValue})})]})}function kI(e){let t=(t,n)=>e.onChange(e.value.map((e,r)=>r===t?{...e,...n}:e));return(0,j.jsxs)(`fieldset`,{className:`stack`,style:{gap:4,border:0,padding:0,margin:0},children:[(0,j.jsx)(`legend`,{className:`hud`,style:{fontSize:10},children:e.label}),e.value.map((n,r)=>(0,j.jsxs)(`div`,{className:`row`,style:{gap:6,flexWrap:`wrap`},children:[(0,j.jsx)(`input`,{className:`field`,style:{flex:`1 1 120px`},"aria-label":`${SI.link(r+1)}: ${SI.linkLabel}`,placeholder:SI.linkLabel,value:n.label??``,onChange:e=>t(r,{label:e.target.value})}),(0,j.jsx)(`input`,{className:`field`,style:{flex:`2 1 220px`},"aria-label":`${SI.link(r+1)}: ${SI.linkUrl}`,placeholder:SI.linkUrl,value:n.url,onChange:e=>t(r,{url:e.target.value})}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,"aria-label":`${SI.remove} ${SI.link(r+1)}`,onClick:()=>e.onChange(e.value.filter((e,t)=>t!==r)),children:SI.remove})]},r)),(0,j.jsx)(`div`,{children:(0,j.jsx)(`button`,{type:`button`,className:`btn`,"aria-label":`${SI.addValue}: ${e.label}`,onClick:()=>e.onChange([...e.value,{url:``,label:``}]),children:SI.addValue})})]})}function AI(e){let[t,n]=(0,v.useState)(()=>fa(e.item)),[r,i]=(0,v.useState)(),a=(e,t)=>n(n=>({...n,[e]:t})),o=n=>{n.preventDefault();let r=ma(e.item,t);`error`in r?i(r.error):(i(void 0),e.onSave(r.set))},s=`fix-${e.item.id}`,c=wI();return(0,j.jsxs)(`form`,{ref:c,onSubmit:o,onKeyDown:Dt(e.onCancel),className:`stack`,style:{gap:10},"aria-label":SI.correct,children:[(0,j.jsx)(`p`,{className:`work-say`,children:SI.correctIntro}),Object.entries(e.item.fields).map(([e,n])=>n===`text`?(0,j.jsx)(DI,{id:`${s}-${e}`,label:Xi(e),value:t[e],onChange:t=>a(e,t)},e):n===`list`?(0,j.jsx)(OI,{id:`${s}-${e}`,label:Xi(e),value:t[e],onChange:t=>a(e,t)},e):(0,j.jsx)(kI,{id:`${s}-${e}`,label:Xi(e),value:t[e],onChange:t=>a(e,t)},e)),(0,j.jsxs)(`div`,{className:`row`,style:{gap:8},children:[(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:e.busy,children:e.busy?SI.saving:SI.save}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:e.onCancel,children:SI.cancel})]}),r&&(0,j.jsx)(`p`,{role:`alert`,style:{margin:0,color:`var(--magenta-text)`,fontSize:12.5},children:r})]})}function jI(e){let[t,n]=(0,v.useState)(``),[r,i]=(0,v.useState)(),a=wI();return(0,j.jsxs)(`form`,{ref:a,className:`stack`,style:{gap:8},"aria-label":SI.reject,onKeyDown:Dt(e.onCancel),onSubmit:n=>{n.preventDefault(),t.trim()?e.onSave(t.trim()):(i(SI.needWhy),document.getElementById(`reject-why`)?.focus())},children:[(0,j.jsx)(`label`,{htmlFor:`reject-why`,className:`hud`,style:{fontSize:10},children:SI.rejectWhy}),(0,j.jsx)(`textarea`,{id:`reject-why`,className:`field`,"aria-describedby":r?`reject-why-err`:void 0,"aria-invalid":r?!0:void 0,rows:3,value:t,onChange:e=>n(e.target.value)}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:8},children:[(0,j.jsx)(`button`,{type:`submit`,className:`btn danger`,disabled:e.busy,children:e.busy?SI.saving:SI.rejectSave}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:e.onCancel,children:SI.cancel})]}),r&&(0,j.jsx)(`p`,{id:`reject-why-err`,role:`alert`,style:{margin:0,color:`var(--magenta-text)`,fontSize:12.5},children:r})]})}function MI(e){let t=e.item,n=t.record,r=[...Object.keys(t.fields).filter(e=>e!==`urls`),...TI].filter(e=>la(n[e])!==``),i=sa(n),a=aa(n),o=(t,n)=>e.onReview?.(t,n),s=(0,v.useRef)(null),c=(0,v.useRef)(null),l=(0,v.useRef)(null),u=(0,v.useRef)(void 0);return(0,v.useEffect)(()=>{if(e.mode||e.busy||!u.current)return;let t={verify:s,correct:c,reject:l}[u.current];u.current=void 0,t.current?.focus()},[e.mode,e.busy]),(0,j.jsxs)(`article`,{className:`stack`,style:{gap:10},"aria-labelledby":`item-${t.id}`,children:[(0,j.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`,gap:8},children:[(0,j.jsx)(`h3`,{id:`item-${t.id}`,className:`n`,style:{fontSize:18,margin:0},children:t.title}),(0,j.jsx)(ea,{review:t.review})]}),(0,j.jsxs)(`p`,{className:`muted mono`,style:{margin:0,fontSize:11.5},children:[Yi(t.kind),` · `,t.id]}),t.review?.note&&(0,j.jsxs)(`p`,{style:{margin:0},children:[(0,j.jsxs)(`span`,{className:`hud`,style:{fontSize:10},children:[xI.review.because,`:`]}),` `,t.review.note]}),t.review?.corrected?.length?(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:xI.review.correctedFields(t.review.corrected.map(Xi).join(`, `))}):null,t.conflict&&!t.conflicts?.length&&(0,j.jsx)(`p`,{role:`note`,className:`chip warn`,style:{margin:0},children:SI.conflict}),t.conflicts?.length?(0,j.jsxs)(`section`,{"aria-label":w.knowledgeConflicts.title,children:[(0,j.jsx)(`p`,{role:`note`,className:`chip warn`,style:{margin:`0 0 6px`},children:w.knowledgeConflicts.title}),(0,j.jsx)(ra,{conflicts:t.conflicts})]}):null,(0,j.jsx)(`dl`,{className:`run-facts`,style:{margin:0},children:r.map(e=>(0,j.jsxs)(`div`,{style:{display:`contents`},children:[(0,j.jsx)(`dt`,{children:Xi(e)}),(0,j.jsx)(`dd`,{children:Array.isArray(n[e])&&t.fields[e]===`list`?(0,j.jsx)(`ul`,{style:{margin:0,paddingLeft:18},children:n[e].map((e,t)=>(0,j.jsx)(`li`,{children:String(e)},t))}):la(n[e])})]},e))}),i&&(0,j.jsxs)(`figure`,{style:{margin:0},children:[(0,j.jsx)(`figcaption`,{className:`hud`,style:{fontSize:10},children:SI.quote}),(0,j.jsx)(`blockquote`,{style:{margin:`4px 0`,paddingLeft:10,borderLeft:`2px solid var(--line-2)`},children:i}),a&&(0,j.jsx)(`p`,{className:`muted mono`,style:{margin:0,fontSize:11.5},children:a})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:SI.links}),ca(n).length?(0,j.jsx)(ia,{urls:ca(n)}):(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:SI.noLinks})]}),e.onReview&&!e.mode&&(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,ref:s,disabled:e.busy,onClick:()=>{u.current=`verify`,o({verdict:`verified`},SI.verified(t.id))},children:SI.verify}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,ref:c,disabled:e.busy||Object.keys(t.fields).length===0,onClick:()=>{u.current=`correct`,e.onMode?.(`correct`)},children:SI.correct}),(0,j.jsx)(`button`,{type:`button`,className:`btn danger`,ref:l,disabled:e.busy,onClick:()=>{u.current=`reject`,e.onMode?.(`reject`)},children:SI.reject})]}),e.mode===`correct`&&(0,j.jsx)(AI,{item:t,busy:e.busy,onCancel:()=>e.onMode?.(void 0),onSave:e=>o({verdict:`corrected`,set:e},SI.corrected(t.id))}),e.mode===`reject`&&(0,j.jsx)(jI,{busy:e.busy,onCancel:()=>e.onMode?.(void 0),onSave:e=>o({verdict:`rejected`,note:e},SI.rejected(t.id))}),(0,j.jsx)(`span`,{className:`sr`,"aria-live":`polite`,children:Qi(t.review)})]})}function NI(e){return(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`,marginBottom:10},role:`search`,children:[(0,j.jsx)(ii,{id:`item-find`,value:e.text,onChange:e.onText,grow:!0}),(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`label`,{htmlFor:`item-kind`,className:`hud`,style:{fontSize:10},children:SI.kind}),(0,j.jsxs)(`select`,{id:`item-kind`,className:`field`,value:e.kind,onChange:t=>e.onKind(t.target.value),children:[(0,j.jsx)(`option`,{value:``,children:SI.allKinds}),Object.keys(xI.kinds).map(e=>(0,j.jsx)(`option`,{value:e,children:Yi(e)},e))]})]})]})}function PI(e){return e.filter(e=>!e.review||e.review.state===`stale`)}function FI(e,t,n){if(!e.length)return;let r=e.findIndex(e=>e.id===t);return r<0?e[0].id:e[Math.min(e.length-1,Math.max(0,r+n))].id}function II(e){return{j:`next`,ArrowDown:`next`,k:`prev`,ArrowUp:`prev`,v:`verify`,c:`correct`,r:`reject`}[e]}var LI=e=>`#/knowledge?item=${encodeURIComponent(e)}`;function RI({hash:e}){let t=P(`/api/knowledge/items`),n=Nn(e,`item`),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(Nn(e,`kind`)??``),s=Nn(e,`kind`)??``;(0,v.useEffect)(()=>o(s),[s]);let[c,l]=(0,v.useState)(),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(),[m,h]=(0,v.useState)(!1);(0,v.useEffect)(()=>p(void 0),[n]),St(e=>{e.type===`file.changed`&&t.reload()});let{item:g,missing:_}=t.state===`ready`?CI(t.data.items,n):{},y=t.state===`ready`?PI(t.data.items):[],b=e=>{e&&(window.location.hash=LI(e))},x=(e,n)=>{if(!g)return;let r=m?FI(y,g.id,1):void 0;d(!0),p({ok:!0,text:w.app.working,working:!0}),N(`/api/knowledge/items/${encodeURIComponent(g.id)}/review`,{method:`POST`,body:e}).then(()=>{p({ok:!0,text:n}),l(void 0),t.reload(),r&&r!==g.id&&b(r)}).catch(e=>p({ok:!1,text:Bn(e)})).finally(()=>d(!1))};return(0,j.jsxs)(`div`,{className:`bento`,children:[(0,j.jsxs)(F,{title:xI.nav.items,span:`span 5`,children:[(0,j.jsxs)(`p`,{className:`work-say`,style:{marginTop:0},children:[SI.intro,` `,(0,j.jsx)(si,{q:`knowledge`,label:w.runs.knowledge})]}),(0,j.jsx)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`,marginBottom:8},children:(0,j.jsx)(`button`,{type:`button`,className:`btn`,"aria-pressed":m,disabled:!m&&y.length===0,onClick:()=>{let e=!m;h(e),e&&!y.some(e=>e.id===n)&&b(FI(y,n,1))},children:m?SI.reviewStop:SI.reviewStart(y.length)})}),(0,j.jsx)(NI,{text:r,kind:a,onText:i,onKind:o}),(0,j.jsx)(EI,{of:t,text:r,kind:a,current:n,onClear:()=>{i(``),o(``)}})]}),(0,j.jsx)(F,{title:g?.title??SI.open,span:`span 7`,labelledBy:`item-detail`,children:g?(0,j.jsxs)(`div`,{tabIndex:m?0:void 0,role:m?`group`:void 0,"aria-label":m?SI.reviewStop:void 0,"aria-keyshortcuts":m?`j k v c r`:void 0,onKeyDown:e=>{if(!m||c||u)return;let t=e.target;if(/^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName))return;let n=II(e.key);n&&(e.preventDefault(),n===`next`||n===`prev`?b(FI(y,g.id,n===`next`?1:-1)):n===`verify`?x({verdict:`verified`},SI.verified(g.id)):l({id:g.id,mode:n}))},children:[m&&(0,j.jsx)(`p`,{className:`muted`,style:{margin:`0 0 8px`,fontSize:12.5},children:SI.reviewKeys(y.length)}),(0,j.jsx)(MI,{item:g,onReview:x,busy:u,mode:c?.id===g.id?c.mode:void 0,onMode:e=>l(e?{id:g.id,mode:e}:void 0)},g.id),(0,j.jsx)(Wn,{note:f})]}):(0,j.jsx)(`div`,{className:`state`,children:_?SI.missing(_):SI.pick})})]})}var zI=w.knowledge.orgpack,BI=e=>e.filter(e=>e.verified).map(e=>e.from);function VI(e){if(e.action===`add`)return`${e.system.boundary}${e.system.owner?`, ${e.system.owner}`:``}${e.system.aliases.length?`, ${e.system.aliases.join(`, `)}`:``}`;let t=[e.adds?.aliases?.length?e.adds.aliases.join(`, `):``,e.adds?.owner?e.adds.owner:``].filter(Boolean).join(`; `);return zI.gains(t)}function HI(e){let t=e.d,[n,r]=(0,v.useState)(()=>BI(t.proposals)),[i,a]=(0,v.useState)(),o=(e,t)=>r(n=>t?[...new Set([...n,e])]:n.filter(t=>t!==e));return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:e.busy,onClick:()=>e.onDraft?.(t.platform),children:e.busy?zI.drafting:zI.draft}),t.at&&(0,j.jsx)(`span`,{className:`hud`,children:zI.at(t.at.slice(0,10))})]}),(0,j.jsx)(`p`,{className:`work-say`,children:zI.command}),(0,j.jsx)(sc,{text:t.command,label:w.knowledge.ai.copy}),t.present?t.proposals.length===0?(0,j.jsx)(`div`,{className:`state`,children:zI.nothing}):(0,j.jsxs)(`form`,{onSubmit:r=>{r.preventDefault(),n.length?(a(void 0),e.onAccept?.(t.platform,n)):a(zI.pickOne)},children:[(0,j.jsxs)(`fieldset`,{style:{border:0,padding:0,margin:0},children:[(0,j.jsx)(`legend`,{className:`sr`,children:t.platform}),(0,j.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0},children:t.proposals.map(e=>(0,j.jsxs)(`li`,{className:`list-row`,style:{alignItems:`flex-start`},children:[(0,j.jsxs)(`label`,{className:`row`,style:{gap:8,alignItems:`flex-start`},children:[(0,j.jsx)(`input`,{type:`checkbox`,"aria-label":zI.pick(e.system.name),checked:n.includes(e.from),onChange:t=>o(e.from,t.target.checked)}),(0,j.jsxs)(`span`,{className:`stack`,style:{gap:2},children:[(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`span`,{className:`chip dim`,children:e.action===`add`?zI.add:zI.update}),` `,(0,j.jsx)(`strong`,{children:e.system.name}),` `,(0,j.jsx)(`span`,{className:`muted mono`,style:{fontSize:11},children:e.system.id})]}),(0,j.jsx)(`span`,{style:{fontSize:12},children:VI(e)}),e.quote&&(0,j.jsxs)(`span`,{className:`muted`,style:{fontSize:12},children:[`"`,e.quote,`" (`,e.page?`${oa(e.page)}, `:``,(0,j.jsx)(`a`,{href:`#/knowledge?item=${encodeURIComponent(e.from)}`,children:e.from}),`)`]}),e.notes.map(e=>(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:e},e))]})]}),(0,j.jsx)(`span`,{className:`chip ${e.verified?`done`:`warn`}`,children:e.verified?zI.verified(e.verifiedBy??``):zI.unverified})]},e.from))})]}),(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:e.busy,style:{marginTop:8},children:e.busy?zI.accepting:zI.accept}),i&&(0,j.jsx)(`p`,{role:`alert`,style:{margin:`6px 0 0`,color:`var(--magenta-text)`,fontSize:12.5},children:i})]}):(0,j.jsx)(`div`,{className:`state`,children:zI.noDraft})]})}function UI(e){return(0,j.jsx)(I,{of:e.of,empty:e=>e.platforms.length===0,emptyText:zI.empty,children:t=>(0,j.jsx)(`div`,{className:`bento`,children:t.platforms.map(t=>(0,j.jsx)(F,{title:t.platform,span:`1 / -1`,children:(0,j.jsx)(HI,{d:t,onDraft:e.onDraft,onAccept:e.onAccept,busy:e.busy},`${t.platform}:${t.at??``}:${t.proposals.length}`)},t.platform))})})}function WI(){let e=P(`/api/orgpack/draft`),[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(),a=(0,v.useRef)(null);St(t=>{t.type===`file.changed`&&e.reload()});let o=t=>{n(!0),i({ok:!0,text:w.app.working,working:!0}),t().then(e=>i({ok:!0,text:e})).catch(e=>i({ok:!1,text:Bn(e)})).finally(()=>{n(!1),e.reload(),a.current?.focus()})};return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`work-say`,style:{marginTop:0},children:zI.intro}),(0,j.jsx)(`div`,{ref:a,tabIndex:-1,children:(0,j.jsx)(Wn,{note:r})}),(0,j.jsx)(UI,{of:e,busy:t,onDraft:e=>o(async()=>{let t=(await N(`/api/orgpack/draft`,{method:`POST`,body:{platform:e}})).platforms.find(t=>t.platform===e)?.proposals.length??0;return t?zI.drafted(t):zI.nothing}),onAccept:(e,t)=>o(async()=>{let n=await N(`/api/orgpack/draft/${encodeURIComponent(e)}/accept`,{method:`POST`,body:{only:t}});return zI.accepted(n.added.length,n.updated.length,n.file)})})]})}var GI=w.knowledge,KI=GI.parties,qI=e=>Array.isArray(e)?e.map(String):[],JI=e=>typeof e==`string`&&e?e:void 0,YI=e=>e.trim().toLowerCase(),XI=e=>new Set([e.id,e.title,...qI(e.record.aliases)].map(YI));function ZI(e){let t=e.filter(e=>e.kind===`product`||e.kind===`project`),n=e=>{let n=XI(e),r=e=>!!JI(e)&&n.has(YI(JI(e))),i=(e,t)=>{let n=new Set(e.map(YI));return[...e,...t.filter(e=>!n.has(YI(e))&&n.add(YI(e)))]},a=e.record,o=e.kind===`team`||e.kind===`vendor`;return{item:e,aliases:qI(a.aliases),responsibilities:qI(a.responsibilities),owns:o?i(qI(a.owns),t.filter(t=>r(t.record.ownedBy)||e.kind===`vendor`&&r(t.record.vendor)).map(e=>e.title)):[],uses:o?i(qI(a.uses),t.filter(e=>qI(e.record.usedBy).some(e=>r(e))).map(e=>e.title)):[],...JI(a.ownedBy)?{ownedBy:JI(a.ownedBy)}:{},usedBy:qI(a.usedBy),...JI(a.vendor)?{vendor:JI(a.vendor)}:{}}},r=t=>e.filter(e=>t.includes(e.kind)).map(n).sort((e,t)=>e.item.title.localeCompare(t.item.title));return{teams:r([`team`]),vendors:r([`vendor`]),products:r([`product`,`project`])}}function QI({label:e,names:t}){return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`dt`,{children:e}),(0,j.jsx)(`dd`,{children:t.length?t.join(`, `):(0,j.jsx)(`span`,{className:`muted`,children:KI.none})})]})}function $I({v:e}){let t=e.item,n=t.kind===`product`||t.kind===`project`;return(0,j.jsxs)(`li`,{className:`list-row`,style:{display:`block`},children:[(0,j.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`,gap:6},children:[(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`a`,{href:`#/knowledge?item=${encodeURIComponent(t.id)}`,title:KI.review,children:(0,j.jsx)(`strong`,{children:t.title})}),` `,(0,j.jsxs)(`span`,{className:`muted mono`,style:{fontSize:11},children:[Yi(t.kind),` · `,t.id]})]}),(0,j.jsx)(ea,{review:t.review})]}),(0,j.jsxs)(`dl`,{className:`run-facts`,style:{margin:`6px 0 0`},children:[e.aliases.length>0&&(0,j.jsx)(QI,{label:KI.aliases,names:e.aliases}),e.responsibilities.length>0&&(0,j.jsx)(QI,{label:KI.responsibilities,names:e.responsibilities}),n?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(QI,{label:KI.ownedBy,names:e.ownedBy?[e.ownedBy]:[]}),(0,j.jsx)(QI,{label:KI.usedBy,names:e.usedBy}),e.vendor&&(0,j.jsx)(QI,{label:GI.fields.vendor,names:[e.vendor]})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(QI,{label:KI.owns,names:e.owns}),(0,j.jsx)(QI,{label:KI.uses,names:e.uses})]})]}),(0,j.jsx)(ia,{urls:ca(t.record)})]})}function eL({title:e,list:t}){return(0,j.jsx)(F,{title:`${e} (${t.length})`,span:`span 4`,children:t.length===0?(0,j.jsx)(`div`,{className:`state`,children:KI.none}):(0,j.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0},children:t.map(e=>(0,j.jsx)($I,{v:e},e.item.id))})})}function tL({of:e}){return(0,j.jsx)(I,{of:e,empty:e=>!e.items.some(e=>[`team`,`vendor`,`product`,`project`].includes(e.kind)),emptyContent:(0,j.jsx)(F,{title:GI.nav.parties,children:(0,j.jsx)(na,{text:KI.empty})}),children:e=>{let t=ZI(e.items.filter(e=>e.review?.state!==`rejected`));return(0,j.jsxs)(`div`,{className:`bento`,children:[(0,j.jsx)(eL,{title:KI.teams,list:t.teams}),(0,j.jsx)(eL,{title:KI.vendors,list:t.vendors}),(0,j.jsx)(eL,{title:KI.products,list:t.products})]})}})}function nL(){let e=P(`/api/knowledge/items`);return St(t=>{t.type===`file.changed`&&e.reload()}),(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`work-say`,style:{marginTop:0},children:KI.intro}),(0,j.jsx)(tL,{of:e})]})}var rL=w.knowledge,iL=rL.search,aL=(e,t)=>{let n=new URLSearchParams;e&&n.set(`q`,e),t&&n.set(`find`,t);let r=n.toString();return`#/wiki-search${r?`?${r}`:``}`};function oL({of:e}){return(0,j.jsx)(I,{of:e,children:e=>e.sources===0?(0,j.jsx)(`div`,{className:`state`,children:iL.noSnapshot}):e.matches.length===0?(0,j.jsx)(`div`,{className:`state`,children:iL.none(e.phrase)}):(0,j.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,j.jsx)(`p`,{style:{margin:0},"aria-live":`polite`,children:iL.found(e.matches.length,e.pages.length)}),e.pages.map(t=>(0,j.jsxs)(`section`,{"aria-label":t,children:[(0,j.jsx)(`h3`,{className:`mono`,style:{fontSize:12.5,margin:`4px 0`},children:t}),(0,j.jsx)(`ul`,{style:{margin:0,paddingLeft:18},children:e.matches.filter(e=>`${e.source}/${e.page}`===t).map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:`${e.section||t} · ${e.line}`}),(0,j.jsx)(`div`,{style:{color:`var(--text-2)`},children:e.excerpt})]},`${e.section}:${e.line}`))})]},t)),(0,j.jsx)(ta,{command:e.command,slash:e.slash,why:iL.next,runs:{q:`knowledge`,label:w.runs.knowledge}})]})})}function sL(e){return(0,j.jsx)(I,{of:e.of,empty:e=>e.finds.length===0,emptyText:iL.noSaved,children:t=>(0,j.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0},children:t.finds.map(t=>(0,j.jsxs)(`li`,{className:`list-row`,children:[(0,j.jsx)(`a`,{href:aL(e.q??``,t.slug),"aria-current":t.slug===e.current?`true`:void 0,children:t.phrase}),(0,j.jsxs)(`span`,{className:`hud`,style:{fontSize:10},children:[iL.candidates(t.candidates.length,t.candidates.filter(e=>e.kept).length),` ·`,` `,t.at.slice(0,10)]})]},t.slug))})})}function cL(e){let t=e.c,[n,r]=(0,v.useState)(t.kind),i=(0,v.useRef)(null),a=(0,v.useRef)(!!t.kept);(0,v.useEffect)(()=>{t.kept&&!a.current&&i.current?.focus(),a.current=!!t.kept},[t.kept]);let o=aa(t.record),s=sa(t.record);return(0,j.jsxs)(`li`,{ref:i,tabIndex:-1,className:`list-row`,style:{display:`block`},children:[(0,j.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`,gap:6},children:[(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`strong`,{children:t.title}),` `,(0,j.jsxs)(`span`,{className:`muted mono`,style:{fontSize:11},children:[Yi(t.kind),` · `,t.id]})]}),(0,j.jsx)(`span`,{className:`chip ${t.kept?`done`:t.known?`dim`:`ai`}`,children:t.kept?iL.kept(Yi(t.kept.as),t.kept.by):t.known?iL.known(t.known):iL.fresh})]}),s&&(0,j.jsx)(`blockquote`,{style:{margin:`4px 0`,paddingLeft:10,borderLeft:`2px solid var(--line-2)`},children:s}),o&&(0,j.jsx)(`p`,{className:`muted mono`,style:{margin:0,fontSize:11},children:o}),(0,j.jsx)(ia,{urls:ca(t.record)}),!t.known&&!t.kept&&e.onKeep&&(0,j.jsxs)(`form`,{className:`row`,style:{gap:8,marginTop:6},onSubmit:r=>{r.preventDefault(),e.onKeep?.(t.id,n)},children:[(0,j.jsx)(`label`,{htmlFor:`keep-${t.id}`,className:`hud`,style:{fontSize:10},children:iL.keepAs}),(0,j.jsx)(`select`,{id:`keep-${t.id}`,className:`field`,value:n,onChange:e=>r(e.target.value),children:t.keepAs.map(e=>(0,j.jsx)(`option`,{value:e,children:Yi(e)},e))}),(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:e.busy,"aria-label":iL.keepOf(t.title),children:e.keeping===t.id?iL.keeping:iL.keep})]})]})}function lL(e){return(0,j.jsx)(I,{of:e.of,children:t=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,j.jsxs)(`p`,{className:`muted mono`,style:{margin:0,fontSize:11.5},children:[t.file,` · `,t.at.slice(0,10)]}),(0,j.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0},children:t.candidates.map(t=>(0,j.jsx)(cL,{c:t,onKeep:e.onKeep,busy:e.busy,keeping:e.keeping},t.id))})]})})}function uL({hash:e}){let t=Nn(e,`q`)??``,n=Nn(e,`find`),[r,i]=(0,v.useState)(t);(0,v.useEffect)(()=>i(t),[t]);let a=P(t?`/api/knowledge/search?q=${encodeURIComponent(t)}`:void 0),o=P(`/api/knowledge/finds`),s=P(n?`/api/knowledge/finds/${encodeURIComponent(n)}`:void 0),[c,l]=(0,v.useState)(),u=c!==void 0,[d,f]=(0,v.useState)();(0,v.useEffect)(()=>f(void 0),[n]),St(e=>{e.type===`file.changed`&&(o.reload(),s.reload())});let[p,m]=(0,v.useState)(!1);return(0,j.jsxs)(`div`,{className:`bento`,children:[(0,j.jsxs)(F,{title:rL.nav.search,span:`span 7`,children:[(0,j.jsx)(`p`,{className:`work-say`,style:{marginTop:0},children:iL.intro}),(0,j.jsxs)(`form`,{role:`search`,className:`row`,style:{gap:8,marginBottom:12},onSubmit:e=>{if(e.preventDefault(),!r.trim()){m(!0);return}m(!1);let t=aL(r.trim(),n);location.hash===t?a.reload():location.hash=t},children:[(0,j.jsx)(`label`,{htmlFor:`wiki-q`,className:`sr`,children:iL.label}),(0,j.jsx)(`input`,{id:`wiki-q`,className:`field`,style:{flex:1},value:r,placeholder:iL.placeholder,"aria-describedby":p?`wiki-q-blank`:void 0,onChange:e=>{i(e.target.value),m(!1)}}),(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,children:iL.go})]}),p&&(0,j.jsx)(`p`,{id:`wiki-q-blank`,role:`alert`,className:`run-note bad`,style:{marginTop:-4},children:iL.needText}),(0,j.jsx)(`p`,{role:`status`,className:`muted`,style:{margin:`0 0 6px`,fontSize:12},children:a.refreshing?iL.searching:``}),t&&(0,j.jsx)(oL,{of:a})]}),(0,j.jsxs)(`div`,{className:`column`,style:{gridColumn:`span 5`},children:[(0,j.jsx)(F,{title:iL.savedTitle,children:(0,j.jsx)(sL,{of:o,current:n,q:t})}),n&&(0,j.jsxs)(F,{title:s.state===`ready`?s.data.phrase:n,labelledBy:`find-detail`,children:[(0,j.jsx)(lL,{of:s,onKeep:(e,t)=>{n&&(l(e),f({ok:!0,text:w.app.working,working:!0}),N(`/api/knowledge/finds/${encodeURIComponent(n)}/keep`,{method:`POST`,body:{item:e,as:t}}).then(()=>{f({ok:!0,text:iL.keptNote(e,Yi(t))}),s.reload(),o.reload()}).catch(e=>f({ok:!1,text:Bn(e)})).finally(()=>l(void 0)))},busy:u,keeping:c}),(0,j.jsx)(Wn,{note:d})]})]})]})}var dL=w.knowledge.sources,fL=w.knowledge.scan;function pL(e){let t=e.s;return(0,j.jsxs)(`article`,{className:`list-row`,style:{display:`block`},"aria-labelledby":`src-${t.id}`,children:[(0,j.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`,gap:8},children:[(0,j.jsx)(`h3`,{id:`src-${t.id}`,className:`h`,style:{fontSize:14,margin:0},children:t.id}),(0,j.jsxs)(`span`,{className:`row`,style:{gap:6},children:[t.stale&&(0,j.jsx)(`span`,{className:`chip warn`,children:t.snapshot?dL.stale(e.staleDays):dL.unsynced}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:e.busy,onClick:()=>e.onSync(t.id),children:e.busy?dL.syncing:dL.sync(t.id)})]})]}),(0,j.jsxs)(`dl`,{className:`run-facts`,style:{margin:`8px 0`},children:[(0,j.jsx)(`dt`,{children:dL.type}),(0,j.jsx)(`dd`,{children:t.type}),(0,j.jsx)(`dt`,{children:dL.location}),(0,j.jsx)(`dd`,{className:`mono`,style:{wordBreak:`break-all`},children:t.location}),t.ref&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`dt`,{children:dL.ref}),(0,j.jsx)(`dd`,{className:`mono`,children:t.ref})]}),t.path&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`dt`,{children:dL.path}),(0,j.jsx)(`dd`,{className:`mono`,children:t.path})]}),t.checkout&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`dt`,{children:dL.checkout}),(0,j.jsx)(`dd`,{children:t.checkout})]}),(0,j.jsx)(`dt`,{children:dL.owner}),(0,j.jsx)(`dd`,{children:t.owner??`—`}),(0,j.jsx)(`dt`,{children:dL.tags}),(0,j.jsx)(`dd`,{children:t.tags.kinds.length+t.tags.frameworks.length?[...t.tags.kinds,...t.tags.frameworks].join(`, `):dL.noTags}),(0,j.jsx)(`dt`,{children:dL.authority}),(0,j.jsxs)(`dd`,{children:[t.authority?dL.authorities[t.authority]??t.authority:dL.noAuthority,t.byPage?`; ${dL.byPage(t.byPage)}`:``]}),(0,j.jsx)(`dt`,{children:dL.scope}),(0,j.jsx)(`dd`,{children:t.scope??dL.everywhere}),(0,j.jsx)(`dt`,{children:dL.restricted}),(0,j.jsxs)(`dd`,{children:[t.readRestricted?dL.readsRestricted:dL.skipsRestricted,t.maxPages?`; ${dL.maxPages(t.maxPages)}`:``]}),(0,j.jsx)(`dt`,{children:dL.snapshot}),(0,j.jsx)(`dd`,{children:t.snapshot?`${dL.snapshotLine(t.snapshot.date,t.snapshot.pages,t.snapshot.ageDays)}${t.snapshot.commit?`, ${dL.commit(t.snapshot.commit)}`:``}`:dL.noSnapshot}),(0,j.jsx)(`dt`,{children:dL.scanLabel}),(0,j.jsx)(`dd`,{children:t.scanned?dL.scanned(t.scanned.date):dL.notScanned})]}),(0,j.jsx)(ta,{command:t.commands.scan,slash:t.commands.slash,runs:{q:`knowledge`,label:w.runs.knowledge}})]})}function mL(e){return(0,j.jsx)(I,{of:e.of,children:t=>(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(_c,{list:t.problems}),t.sources.length===0?(0,j.jsx)(`div`,{className:`state`,children:dL.empty}):t.sources.map(n=>(0,j.jsx)(pL,{s:n,staleDays:t.staleDays,onSync:e.onSync,busy:e.syncing===n.id},n.id))]})})}var hL={type:`git`,location:``,id:``,path:``,ref:``,submodule:!1,kinds:``,frameworks:``,owner:``,save:!0};function gL(e){if(!e.location.trim())return{error:dL.needLocation};let t=e.type===`git`;if(!t&&(e.path.trim()||e.ref.trim()||e.submodule))return{error:dL.gitOnly};let n=ha(e.kinds);if(!Array.isArray(n))return n;let r=ha(e.frameworks);return Array.isArray(r)?{body:{type:e.type,location:e.location.trim(),...e.id.trim()?{id:e.id.trim()}:{},...t&&e.path.trim()?{path:e.path.trim()}:{},...t&&e.ref.trim()?{ref:e.ref.trim()}:{},...t&&e.submodule?{submodule:!0}:{},...n.length?{kinds:n}:{},...r.length?{frameworks:r}:{},...e.owner.trim()?{owner:e.owner.trim()}:{},save:e.save}}:r}function _L(e){return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`label`,{htmlFor:e.id,className:`hud`,style:{fontSize:10},children:e.label}),(0,j.jsx)(`input`,{id:e.id,className:`field`,value:e.value,disabled:e.disabled,list:e.list,onChange:t=>e.onChange(t.target.value)})]})}function vL(e){let[t,n]=(0,v.useState)(e.initial??hL),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(),s=e=>n(t=>({...t,...e})),c=t.type===`git`;return(0,j.jsxs)(`form`,{onSubmit:r=>{r.preventDefault();let a=gL(t);`error`in a?o({ok:!1,text:a.error}):(i(!0),o(void 0),N(`/api/knowledge/sources`,{method:`POST`,body:a.body}).then(r=>{o({ok:!0,text:r.lines.join(`
|
|
48
|
+
`)}),t.save&&(n(hL),e.onAdded?.())}).catch(e=>o({ok:!1,text:Bn(e)})).finally(()=>i(!1)))},className:`stack`,style:{gap:10},"aria-labelledby":`add-source`,children:[(0,j.jsx)(`p`,{className:`work-say`,children:dL.addIntro}),(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`label`,{htmlFor:`src-type`,className:`hud`,style:{fontSize:10},children:dL.addType}),(0,j.jsx)(`select`,{id:`src-type`,className:`field`,value:t.type,onChange:e=>s({type:e.target.value}),children:e.types.map(e=>(0,j.jsx)(`option`,{value:e,children:e},e))})]}),(0,j.jsx)(_L,{id:`src-location`,label:dL.addLocation,value:t.location,onChange:e=>s({location:e})}),(0,j.jsx)(_L,{id:`src-id`,label:dL.addId,value:t.id,onChange:e=>s({id:e})}),(0,j.jsx)(_L,{id:`src-path`,label:dL.addPath,value:t.path,disabled:!c,onChange:e=>s({path:e})}),(0,j.jsx)(_L,{id:`src-ref`,label:dL.addRef,value:t.ref,disabled:!c,onChange:e=>s({ref:e})}),(0,j.jsxs)(`label`,{className:`row`,style:{gap:8},children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:t.submodule,disabled:!c,onChange:e=>s({submodule:e.target.checked})}),dL.addSubmodule]}),(0,j.jsx)(_L,{id:`src-kinds`,label:dL.addKinds,value:t.kinds,list:`src-kind-list`,onChange:e=>s({kinds:e})}),(0,j.jsx)(`datalist`,{id:`src-kind-list`,children:e.kinds.map(e=>(0,j.jsx)(`option`,{value:e},e))}),(0,j.jsx)(_L,{id:`src-frameworks`,label:dL.addFrameworks,value:t.frameworks,onChange:e=>s({frameworks:e})}),(0,j.jsx)(_L,{id:`src-owner`,label:dL.addOwner,value:t.owner,onChange:e=>s({owner:e})}),(0,j.jsxs)(`label`,{className:`row`,style:{gap:8},children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:t.save,onChange:e=>s({save:e.target.checked})}),dL.addSave]}),(0,j.jsx)(`div`,{children:(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:r,children:r?dL.adding:dL.add})}),(0,j.jsx)(Wn,{note:a})]})}function yL({label:e,ids:t}){return t.length?(0,j.jsxs)(`div`,{style:{margin:`6px 0`},children:[(0,j.jsxs)(`span`,{className:`hud`,style:{fontSize:10},children:[e,` (`,t.length,`)`]}),(0,j.jsx)(`ul`,{style:{margin:`2px 0`,paddingLeft:18},children:t.map(e=>(0,j.jsx)(`li`,{children:(0,j.jsx)(`a`,{href:`#/knowledge?item=${encodeURIComponent(e)}`,className:`mono`,children:e})},e))})]}):null}function bL({of:e}){return(0,j.jsx)(I,{of:e,children:e=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[e.scannedAt?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{style:{margin:0},children:fL.at(e.scannedAt.slice(0,10))}),e.changes&&e.changes.added.length+e.changes.changed.length+e.changes.removed.length?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(yL,{label:fL.added,ids:e.changes.added}),(0,j.jsx)(yL,{label:fL.changed,ids:e.changes.changed}),(0,j.jsx)(yL,{label:fL.removed,ids:e.changes.removed})]}):(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:fL.nothing}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:fL.flags(e.conflicts,e.injections,e.failed)})]}):(0,j.jsx)(`div`,{className:`state`,children:fL.never}),(0,j.jsx)(`h3`,{className:`hud`,style:{fontSize:11,margin:`6px 0 0`},children:fL.checkAgain}),e.checkAgain.length===0?(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:fL.noCheckAgain}):(0,j.jsx)(`ul`,{style:{margin:0,paddingLeft:18},children:e.checkAgain.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`a`,{href:`#/knowledge?item=${encodeURIComponent(e.id)}`,children:e.title}),` `,(0,j.jsxs)(`span`,{className:`muted mono`,style:{fontSize:11},children:[e.id,` · `,e.by]})]},e.id))}),(0,j.jsx)(ta,{command:e.command,slash:e.slash,why:fL.rescan,runs:{q:`knowledge`,label:w.runs.knowledge}})]})})}function xL(){let e=P(`/api/knowledge/sources`),t=P(`/api/knowledge/scan`),[n,r]=(0,v.useState)(),i=Vn();return St(n=>{n.type===`file.changed`&&(e.reload(),t.reload())}),(0,j.jsxs)(`div`,{className:`bento`,children:[(0,j.jsxs)(F,{title:dL.listTitle,span:`span 7`,children:[(0,j.jsx)(`p`,{className:`work-say`,style:{marginTop:0},children:dL.intro}),(0,j.jsx)(Wn,{note:i.note}),(0,j.jsx)(mL,{of:e,onSync:t=>{r(t),i.run(()=>N(`/api/knowledge/sources/${encodeURIComponent(t)}/sync`,{method:`POST`,body:{}}).then(e.reload),dL.synced(t)).finally(()=>r(void 0))},syncing:n})]}),(0,j.jsxs)(`div`,{className:`column`,style:{gridColumn:`span 5`},children:[(0,j.jsx)(F,{title:fL.title,children:(0,j.jsx)(bL,{of:t})}),(0,j.jsx)(F,{title:dL.addTitle,labelledBy:`add-source`,children:(0,j.jsx)(I,{of:e,children:t=>(0,j.jsx)(vL,{types:t.types,kinds:t.kindSuggestions,onAdded:e.reload})})})]})]})}var SL={wikis:()=>(0,j.jsx)(xL,{}),documents:()=>(0,j.jsx)(bI,{}),knowledge:RI,"wiki-search":uL,parties:()=>(0,j.jsx)(nL,{}),"orgpack-draft":()=>(0,j.jsx)(WI,{})},CL=w.evals,wL=e=>`${Math.round(e*100)}%`;function TL({label:e,value:t,sub:n}){return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:e}),(0,j.jsx)(`span`,{className:`n`,style:{fontSize:28,color:`var(--accent)`},children:t}),(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:11.5},children:n})]})}function EL(){let e=P(`/api/evals`),t=P(`/api/evals/defences`),[n,r]=(0,v.useState)(`mock`),[i,a]=(0,v.useState)(``),o=ar(),s=ar();St(t=>{t.type===`file.changed`&&e.reload()});let c=e.state===`ready`?e.data.quality?.agents??[]:[],l=t.state===`ready`?t.data.files.filter(e=>e.risk===`high`):[],u=t.state===`ready`?t.data.files.filter(e=>e.risk===`medium`):[];return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`},children:[(0,j.jsx)(`p`,{className:`n`,style:{margin:0,fontSize:24},children:CL.testASkillBefore}),(0,j.jsxs)(`form`,{className:`row`,style:{flexWrap:`wrap`,alignItems:`flex-end`},onSubmit:t=>{t.preventDefault(),o.run(()=>N(`/api/evals/run`,{method:`POST`,body:{mode:n,...i?{agents:[i]}:{}}}).then(t=>(e.reload(),t)),e=>{let t=e.report,n=t.results?.filter(e=>!e.pass).length??0;return CL.runFinished(t.runId,n?CL.casesFailed(pr(n,`case`)):CL.everyCasePassed)})},children:[(0,j.jsxs)(`label`,{className:`run-label`,htmlFor:`eval-mode`,children:[CL.mode,(0,j.jsxs)(`select`,{id:`eval-mode`,className:`run-select`,value:n,onChange:e=>r(e.target.value),children:[(0,j.jsx)(`option`,{value:`mock`,children:CL.mockNoModel}),(0,j.jsx)(`option`,{value:`replay`,children:CL.replaySavedAnswers})]})]}),(0,j.jsxs)(`label`,{className:`run-label`,htmlFor:`eval-agent`,children:[CL.agent,(0,j.jsxs)(`select`,{id:`eval-agent`,className:`run-select`,value:i,onChange:e=>a(e.target.value),children:[(0,j.jsx)(`option`,{value:``,children:CL.everyAgent}),c.map(e=>(0,j.jsx)(`option`,{children:e.agent},e.agent))]})]}),(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:o.busy,children:o.busy?CL.running:CL.newEvalRun})]})]}),(0,j.jsx)(or,{note:o.note}),(0,j.jsxs)(`div`,{className:`bento`,children:[(0,j.jsx)(F,{title:CL.qualitySignals,span:`span 5`,children:(0,j.jsx)(I,{of:e,children:e=>{let n=e.findings.applied+e.findings.dismissed+e.findings.waived,r=c.filter(e=>e.passRate===1).length;return(0,j.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`,alignItems:`flex-start`},children:[(0,j.jsx)(TL,{label:CL.findingsKeptByPeople,value:n?wL(e.findings.applied/n):`–`,sub:n?CL.actedOn(e.findings.applied,n):CL.noFindingsResolvedYet}),(0,j.jsx)(TL,{label:CL.agentsPassing,value:c.length?`${r}/${c.length}`:`–`,sub:c.length?CL.everyCaseLatestRun:CL.noEvalRunYet}),(0,j.jsx)(TL,{label:CL.hiddenInstructionsHeld,value:t.state===`ready`?String(l.length+t.data.items.length):`–`,sub:CL.quarantinedNeverSentTo})]})}})}),(0,j.jsx)(F,{title:CL.passRateByAgent,span:`span 7`,children:(0,j.jsx)(I,{of:e,empty:()=>c.length===0,emptyText:CL.noEvalRunsYet,children:()=>(0,j.jsx)(`div`,{className:`stack`,style:{gap:8},children:c.map(e=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsxs)(`div`,{className:`row between`,children:[(0,j.jsx)(`span`,{className:`mono`,style:{fontSize:12},children:e.agent}),(0,j.jsxs)(`span`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`span`,{className:`chip dim`,children:e.mode.toUpperCase()}),e.liveBar&&(0,j.jsx)(`span`,{className:`chip ${e.liveBar.pass?`done`:`blocking`}`,children:CL.live(e.liveBar.min,e.liveBar.runs,e.liveBar.pass?CL.met:CL.notMet)}),e.regressed.length>0&&(0,j.jsx)(`span`,{className:`chip blocking`,title:e.regressed.join(`, `),children:CL.regressed(e.regressed.length)}),(0,j.jsx)(`span`,{style:{fontSize:12},children:wL(e.passRate)})]})]}),(0,j.jsx)(Rt,{value:Math.round(e.passRate*100),max:100,color:e.passRate<1?`var(--amber)`:void 0,label:CL.passRate(e.agent)})]},e.agent))})})}),(0,j.jsxs)(F,{title:CL.ingestedContentDefences,meta:t.state===`ready`?CL.quarantined3(l.length+t.data.items.length):void 0,span:`span 7`,rows:`span 2`,children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:`0 0 8px`,fontSize:12.5},children:CL.ingestedContentIsData}),(0,j.jsx)(I,{of:t,empty:e=>e.files.length===0&&e.items.length===0,emptyText:CL.nothingRiskyInInputs,children:e=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:12},children:[[...l,...u].map(e=>(0,j.jsxs)(`article`,{className:`stack`,style:{gap:4,borderTop:`1px solid var(--rule)`,paddingTop:8},children:[(0,j.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`},children:[(0,j.jsx)(`span`,{className:`mono`,style:{fontSize:12},children:e.path}),(0,j.jsx)(`span`,{className:`chip ${e.risk===`high`?`blocking`:`warn`}`,children:e.risk===`high`?CL.quarantined:CL.marked})]}),(0,j.jsxs)(`span`,{className:`muted`,style:{fontSize:12},children:[e.reason,`. `,e.action,`.`]}),e.signals.slice(0,2).map(e=>(0,j.jsx)(`code`,{className:`run-inert`,"aria-label":CL.flaggedTextOnLine(e.line),children:CL.line(e.line,e.rule,e.hidden?CL.hidden:e.encoded?CL.encoded:``,e.excerpt)},`${e.line}${e.rule}`))]},e.path)),e.items.map(e=>(0,j.jsxs)(`article`,{className:`stack`,style:{gap:4,borderTop:`1px solid var(--rule)`,paddingTop:8},children:[(0,j.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`},children:[(0,j.jsx)(`span`,{style:{fontSize:12.5},children:e.origin}),(0,j.jsx)(`span`,{className:`chip blocking`,children:CL.quarantined2(e.change)})]}),(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:e.summary}),(0,j.jsx)(`span`,{style:{fontSize:12},children:e.fix})]},`${e.change}${e.file}${e.source}`)),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:CL.atticusNeverLetsA(pr(e.scanned,`file`))})]})}),(0,j.jsx)(`div`,{className:`row`,style:{marginTop:8},children:(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:s.busy,onClick:()=>void s.run(async()=>{t.reload()},CL.scanningInputsAndThe),children:CL.scanAgain})}),(0,j.jsx)(or,{note:s.note})]}),(0,j.jsx)(F,{title:CL.evalRuns,span:`span 5`,children:(0,j.jsx)(I,{of:e,empty:e=>e.runs.length===0,emptyText:CL.noEvalRunsYet2,children:e=>(0,j.jsxs)(j.Fragment,{children:[e.runs.length>8&&(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:w.app.andMore(e.runs.length-8)}),e.runs.slice().reverse().slice(0,8).map(e=>(0,j.jsxs)(`div`,{className:`list-row`,children:[(0,j.jsxs)(`span`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`span`,{className:`mono`,style:{fontSize:11.5},children:e.runId}),(0,j.jsxs)(`span`,{className:`hud`,style:{fontSize:9.5},children:[fr(e.startedAt),` · `,pr(e.agents.length,`agent`),e.skipped?CL.skipped(e.skipped):``]})]}),(0,j.jsx)(`span`,{className:`chip ${e.failed?`blocking`:`done`}`,children:e.failed?CL.failed(e.failed):CL.allPassed})]},e.runId))]})})}),(0,j.jsx)(F,{title:CL.compareModels,span:`span 5`,children:(0,j.jsx)(I,{of:e,children:e=>e.modes.allowed.includes(`model`)&&e.models.length>1?(0,j.jsxs)(`p`,{style:{margin:0,fontSize:12.5},children:[CL.approvedModelsLiveEvals(e.models.join(`, `)),(0,j.jsx)(`code`,{className:`mono`,children:CL.atticusEvalRunMode}),`.`]}):(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsx)(`span`,{className:`chip dim`,style:{alignSelf:`flex-start`},children:CL.locked}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:CL.availableOnceModelMode(e.modes.default)})]})})})]})]})}var DL=w.governance;function OL(e){let t=P(e.go?`/api/search?q=${encodeURIComponent(e.query)}&limit=8`:void 0),{onDone:n}=e;return(0,v.useEffect)(()=>{t.state!==`loading`&&n()},[t.state,n]),(0,j.jsxs)(F,{title:e.title,span:e.span,meta:t.state===`ready`&&t.data.total?t.data.total:void 0,children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:`0 0 6px`,fontSize:12},children:e.why}),(0,j.jsx)(I,{of:t,empty:e=>e.total===0,emptyText:e.emptyText,children:t=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:0},children:[t.rows.map(t=>(0,j.jsxs)(`div`,{className:`list-row`,children:[(0,j.jsx)(`a`,{href:`#/explore?q=${encodeURIComponent(t.id)}`,style:{fontSize:12.5},children:t.name||t.id}),(0,j.jsx)(`span`,{className:`chip ${e.warn?`warn`:`dim`}`,children:t.system??t.kind})]},t.id)),t.total>t.rows.length&&(0,j.jsx)(`a`,{href:`#/explore?q=${encodeURIComponent(e.query)}`,style:{fontSize:12,marginTop:6},children:DL.allInTheExplorer(t.total)})]})})]})}function kL(){let e=P(`/api/governance`),[t,n]=(0,v.useState)(0),[r]=(0,v.useState)(()=>[0,1,2,3].map(e=>()=>n(t=>Math.max(t,e+1))));return St(t=>{(t.type===`file.changed`||t.type===`index.rebuilt`)&&e.reload()}),(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`},children:[(0,j.jsx)(`p`,{className:`n`,style:{margin:0,fontSize:24},children:e.state===`ready`?e.data.conformance.passed?DL.theOrgPackConforms:DL.someRulesNeedA:DL.governance}),(0,j.jsx)(`span`,{className:`hud`,children:DL.fromTheFilesAnd})]}),(0,j.jsxs)(`div`,{className:`bento`,children:[(0,j.jsx)(F,{title:DL.conformance,meta:DL.orgPackChecks,span:`span 6`,children:(0,j.jsx)(I,{of:e,children:e=>{let{pass:t,fail:n,warn:r}=e.conformance.summary,i=t+n,a=i?Math.round(t/i*100):0,o=e.conformance.results.filter(e=>e.status!==`pass`);return(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsxs)(`div`,{className:`row`,children:[(0,j.jsx)(It,{value:t,max:i,size:72,text:`${a}%`,color:n?`var(--amber)`:`var(--green)`,label:DL.ofConformanceChecksPass(t,i)}),(0,j.jsx)(`span`,{style:{fontSize:12.5},children:DL.ofChecksPass(t,i,r?`, ${pr(r,`warning`)}`:``)})]}),o.length>0&&(0,j.jsx)(`ul`,{className:`run-steps`,style:{fontSize:12},children:o.slice(0,6).map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`span`,{className:`chip ${e.status===`fail`?`blocking`:`warn`}`,children:e.status.toUpperCase()}),` `,e.file?`${e.file}: `:``,e.message]},`${e.check}${e.file??``}${e.message}`))})]})}})}),(0,j.jsx)(F,{title:DL.rulesAndWaivers,span:`span 6`,children:(0,j.jsx)(I,{of:e,children:e=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:0},children:[(0,j.jsxs)(`div`,{className:`list-row`,children:[(0,j.jsx)(`span`,{children:DL.constitutionRules}),(0,j.jsxs)(`span`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`span`,{className:`n`,style:{fontSize:18},children:e.rules.constitution}),(0,j.jsx)(`span`,{className:`chip dim`,children:DL.locked})]})]}),(0,j.jsxs)(`div`,{className:`list-row`,children:[(0,j.jsx)(`span`,{children:DL.orgPackRules}),(0,j.jsx)(`span`,{className:`n`,style:{fontSize:18},children:e.rules.org})]}),(0,j.jsxs)(`div`,{className:`list-row`,children:[(0,j.jsx)(`span`,{children:DL.teamRules}),(0,j.jsx)(`span`,{className:`n`,style:{fontSize:18},children:e.rules.team})]}),(0,j.jsxs)(`div`,{className:`list-row`,children:[(0,j.jsx)(`span`,{children:DL.activeWaivers}),(0,j.jsx)(`span`,{className:`n`,style:{fontSize:18,color:e.waivers.length?`var(--amber)`:void 0},children:e.waivers.length})]}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:`8px 0 0`,fontSize:12},children:DL.constitutionRulesCantBe(e.rules.inForce,e.rules.waivable)}),e.rules.refused.map(e=>(0,j.jsx)(`p`,{className:`run-note bad`,children:DL.refused(e.file,e.rule?` (${e.rule})`:``,e.reason)},`${e.file}${e.rule??``}`))]})})}),(0,j.jsx)(F,{title:DL.howOftenRulesAre,span:`span 7`,children:(0,j.jsx)(I,{of:e,empty:e=>e.overrides.rules.length===0,emptyText:DL.noCriticFindingsYet,children:e=>(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsxs)(`table`,{className:`run-table`,children:[(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{children:DL.rule}),(0,j.jsx)(`th`,{children:DL.findings}),(0,j.jsx)(`th`,{children:DL.dismissed}),(0,j.jsx)(`th`,{children:DL.waived}),(0,j.jsx)(`th`,{children:DL.overridden})]})}),(0,j.jsx)(`tbody`,{children:e.overrides.rules.slice(0,12).map(e=>(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`td`,{className:`mono`,style:{fontSize:11.5},children:e.rule}),(0,j.jsx)(`td`,{children:e.total}),(0,j.jsx)(`td`,{children:e.dismissed}),(0,j.jsx)(`td`,{children:e.waived}),(0,j.jsxs)(`td`,{style:{minWidth:110},children:[(0,j.jsxs)(`span`,{style:{fontSize:11.5},children:[Math.round(e.overrideRate*100),`%`]}),(0,j.jsx)(Rt,{value:Math.round(e.overrideRate*100),max:100,color:e.overrideRate>=.5?`var(--amber)`:void 0,label:DL.overridden2(e.rule)})]})]},e.rule))})]}),e.overrides.rules.length>12&&(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:w.app.andMore(e.overrides.rules.length-12)}),e.overrides.suggestions.map(e=>(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:e.message},e.rule)),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:DL.acrossARuleDismissed(pr(e.overrides.changes,`change`))})]})})}),(0,j.jsx)(F,{title:DL.waivers,span:`span 5`,children:(0,j.jsx)(I,{of:e,empty:e=>e.waivers.length===0,emptyText:DL.noActiveWaivers,children:e=>e.waivers.map(e=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:2,padding:`6px 0`,borderBottom:`1px solid var(--rule)`},children:[(0,j.jsx)(`span`,{style:{fontSize:12.5},children:e.summary}),(0,j.jsxs)(`span`,{className:`hud`,style:{fontSize:9.5},children:[e.rule,` · `,e.change,` · `,e.gate,e.by?DL.by(e.by,fr(e.at)):``]}),e.reason&&(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:DL.reason(e.reason)})]},`${e.change}${e.gate}${e.rule}`))})}),(0,j.jsx)(OL,{go:t>=0,onDone:r[0],title:DL.sensitiveData,why:DL.columnsTaggedWithA,query:`kind:column has:classification`,emptyText:DL.noColumnsAreTagged,span:`span 6`}),(0,j.jsx)(OL,{go:t>=1,onDone:r[1],title:DL.authenticationGaps,why:DL.callsWithNoOauth2,query:`kind:interface missing:auth`,emptyText:DL.everyCallDeclaresHow,span:`span 6`,warn:!0}),(0,j.jsx)(OL,{go:t>=2,onDone:r[2],title:DL.timeoutsAndRetries,why:DL.timeoutAndRetrySettings,query:`kind:setting settingKind:timeout,retry`,emptyText:DL.noTimeoutOrRetry,span:`span 6`}),(0,j.jsx)(OL,{go:t>=3,onDone:r[3],title:DL.retiring,why:DL.recordsPlannedForRetirement,query:`status:planned-retire`,emptyText:DL.nothingIsPlannedFor,span:`span 6`}),(0,j.jsx)(F,{title:DL.incidentMode,span:`span 12`,children:(0,j.jsxs)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:[DL.readOnlyBlastRadius,(0,j.jsx)(`a`,{href:`#/impact`,children:DL.openTheImpactExplorer})]})})]})]})}var AL=w.learning,jL={"not-started":{label:AL.newChip,cls:`dim`},"in-progress":{label:AL.inProgress,cls:`warn`},done:{label:AL.doneChip,cls:`done`}};function ML({cur:e,reload:t}){let[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(!1),o=ar(),s=e.step;return s?(0,j.jsxs)(`form`,{className:`stack`,style:{gap:12},onSubmit:e=>{e.preventDefault(),o.run(()=>N(`/api/learning/check`,{method:`POST`,body:n?{answer:n}:{}}).then(e=>{if(e.pass&&(r(``),a(!1),t()),!e.pass)throw Error(e.hint?AL.notYet(e.message,e.hint):AL.notYetNoHint(e.message));return e}),e=>AL.passed(e.message))},children:[(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:AL.stepOf(s.n,e.steps)}),(0,j.jsx)(`p`,{className:`n`,style:{margin:0,fontSize:18},children:s.title}),(0,j.jsx)(`p`,{className:`run-text`,children:s.body}),s.commands.length>0&&(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:AL.tryInTheSandbox}),s.commands.map(e=>(0,j.jsxs)(`div`,{className:`row between run-field`,style:{gridTemplateColumns:`1fr auto`},children:[(0,j.jsx)(`code`,{className:`value`,children:e}),(0,j.jsx)(sr,{text:e,label:AL.copy(e)})]},e))]}),s.question&&(0,j.jsxs)(`label`,{className:`run-label`,htmlFor:`learn-answer`,children:[s.question,(0,j.jsx)(`input`,{id:`learn-answer`,className:`run-input`,value:n,onChange:e=>r(e.target.value)})]}),(0,j.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`},children:[(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:o.busy,children:AL.checkMyWork}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,"aria-expanded":i,onClick:()=>a(e=>!e),children:i?AL.hideTheHint:AL.showAHint})]}),i&&(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:AL.hint(s.hint)}),(0,j.jsx)(or,{note:o.note})]}):(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsx)(`p`,{className:`run-note ok`,children:AL.youHaveFinishedThis}),(0,j.jsx)(`p`,{className:`run-text`,children:e.outro})]})}function NL(){let[e,t]=(0,v.useState)(``),[n,r]=(0,v.useState)(!1),i=ar();return(0,j.jsxs)(`form`,{className:`stack`,onSubmit:t=>{t.preventDefault(),e.trim()?(r(!1),i.run(()=>N(`/api/learning/sandbox`,{method:`POST`,body:{dir:e}}),e=>AL.sandboxMade(e.root))):r(!0)},children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:AL.lessonsRunOnlyIn}),(0,j.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,alignItems:`flex-end`},children:[(0,j.jsxs)(`label`,{className:`run-label`,htmlFor:`sandbox-dir`,style:{flex:`1 1 260px`},children:[AL.aNewEmptyFolder,(0,j.jsx)(`input`,{id:`sandbox-dir`,className:`run-input`,value:e,onChange:e=>{t(e.target.value),r(!1)},"aria-describedby":n?`sandbox-dir-blank`:void 0,placeholder:AL.homeYouAtticusSandbox})]}),(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:i.busy,children:AL.makeASandbox})]}),n&&(0,j.jsx)(`p`,{id:`sandbox-dir-blank`,role:`alert`,className:`run-note bad`,children:w.app.needFolder}),(0,j.jsx)(or,{note:i.note})]})}function PL(){let e=P(`/api/learning`);lt(e);let[t,n]=(0,v.useState)(`all`),r=ar(),i=e.state===`ready`?e.data.roles:[],a=e.state===`ready`?e.data.lessons.filter(e=>t===`all`||e.role===t):[],o=e.state===`ready`?{done:e.data.lessons.filter(e=>e.state===`done`).length,all:e.data.lessons.length}:{done:0,all:0};return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`},children:[(0,j.jsx)(`p`,{className:`n`,style:{margin:0,fontSize:24},children:AL.learning}),e.state===`ready`&&(0,j.jsx)(`span`,{className:`chip ${e.data.sandbox?`done`:`dim`}`,children:e.data.sandbox?AL.practiceSandboxOfflineForge:AL.notASandbox})]}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:AL.lessonsBuiltOnThe}),(0,j.jsxs)(`div`,{className:`bento`,children:[(0,j.jsx)(F,{title:AL.progress,span:`span 4`,children:(0,j.jsx)(I,{of:e,children:()=>(0,j.jsxs)(`div`,{className:`row`,style:{alignItems:`flex-start`},children:[(0,j.jsx)(It,{value:o.done,max:o.all,size:72,text:o.all?`${Math.round(o.done/o.all*100)}%`:`0%`,label:AL.ofLessonsDone(o.done,o.all)}),(0,j.jsx)(`span`,{style:{fontSize:12.5},children:AL.ofDone(o.done,pr(o.all,AL.lessonWord))})]})})}),(0,j.jsx)(F,{title:AL.progressByKindOf,meta:AL.lessonsDone2,span:`span 8`,children:(0,j.jsx)(I,{of:e,empty:()=>i.length===0,emptyText:AL.noLessonsAreInstalled,children:()=>(0,j.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(180px, 1fr))`,gap:`8px 16px`},children:i.map(e=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsxs)(`div`,{className:`row between`,children:[(0,j.jsx)(`span`,{style:{fontSize:12.5},children:e.role}),(0,j.jsxs)(`span`,{className:`hud`,style:{fontSize:10},children:[e.done,`/`,e.lessons]})]}),(0,j.jsx)(Rt,{value:e.done,max:e.lessons,label:AL.lessonsDone(e.role)})]},e.role))})})}),e.state===`ready`&&!e.data.sandbox&&(0,j.jsx)(F,{title:AL.practiseInASandbox,span:`span 12`,children:(0,j.jsx)(NL,{})}),e.state===`ready`&&e.data.current&&(0,j.jsx)(F,{title:AL.exercise(e.data.current.title),meta:e.data.current.completed?AL.done:void 0,span:`span 12`,kind:`hero`,children:(0,j.jsx)(ML,{cur:e.data.current,reload:()=>e.reload()},e.data.current.lesson)}),(0,j.jsxs)(F,{title:AL.lessons,span:`span 12`,children:[(0,j.jsx)(`div`,{style:{marginBottom:10},children:(0,j.jsx)(lr,{label:AL.writtenFor,value:t,onChange:n,options:[{value:`all`,label:AL.everyone},...i.map(e=>({value:e.role,label:e.role}))]})}),(0,j.jsx)(I,{of:e,empty:()=>a.length===0,emptyText:AL.noLessonsWrittenFor,children:t=>(0,j.jsx)(`div`,{className:`stack`,style:{gap:0},children:a.map(n=>(0,j.jsxs)(`article`,{className:`list-row`,style:{alignItems:`flex-start`},children:[(0,j.jsxs)(`span`,{className:`stack`,style:{gap:3,minWidth:0},children:[(0,j.jsxs)(`span`,{className:`row`,style:{gap:6,flexWrap:`wrap`},children:[(0,j.jsx)(`span`,{style:{fontSize:13.5},children:n.title}),(0,j.jsxs)(`span`,{className:`chip ${jL[n.state].cls}`,children:[jL[n.state].label,n.state===`in-progress`?` · ${n.done}/${n.steps}`:``]})]}),(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12.5},children:n.summary}),(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:9.5},children:AL.min(n.role,n.minutes,pr(n.steps,AL.stepWord))})]}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:!t.sandbox||r.busy||n.state===`done`,title:t.sandbox?void 0:AL.lessonsRunInA,"aria-label":`${n.state===`in-progress`?AL.continue:AL.start} ${n.title}`,onClick:()=>void r.run(()=>N(`/api/learning/start`,{method:`POST`,body:{lesson:n.id}}).then(t=>(e.reload(),t)),e=>[`Started ${n.title}.`,...e.setup].join(` `)),children:n.state===`in-progress`?AL.continue:n.state===`done`?AL.done2:AL.start})]},n.id))})}),(0,j.jsx)(or,{note:r.note}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:`8px 0 0`,fontSize:12},children:AL.lessonsAndExercisesUse})]})]})]})}var FL=[`Home`,`Map`,`Change`,`Questions`,`Knowledge`,`SetUp`],IL=[...FL,`Atticus`],LL=[`Define`,`Design`,`Plan`,`Build`,`Release`],RL=w.nav,zL=w.nav.screens,BL=w.knowledge.nav,VL=[{id:`home`,label:zL.home,section:`Home`,also:[w.commandCenter.waitingOnYou,RL.dashboard]},{id:`words`,label:zL.words,section:`Home`,aside:!0},{id:`initiatives`,label:zL.initiatives,section:`Home`,full:!0},{id:`todo`,label:zL.todo,section:`Home`},{id:`canvas`,label:zL.canvas,section:`Map`},{id:`flows`,label:w.flows.title,section:`Map`},{id:`contracts`,label:zL.contracts,section:`Map`},{id:`impact`,label:zL.impact,section:`Map`},{id:`trust`,label:zL.trust,section:`Map`},{id:`decisions`,label:zL.decisions,section:`Map`,also:[w.decisions.chip,w.decisions.batchesTitle]},{id:`explore`,label:zL.explore,section:`Map`,aside:!0},{id:`systems`,label:zL.systems,section:`Map`,aside:!0},{id:`outside`,label:zL.outside,section:`Map`,aside:!0},{id:`mismatches`,label:zL.mismatches,section:`Map`,aside:!0},{id:`crosscheck`,label:zL.crosscheck,section:`Map`,aside:!0},{id:`map`,label:zL.map,section:`Map`,full:!0},{id:`features`,label:zL.features,section:`Map`,full:!0},{id:`mappings`,label:zL.mappings,section:`Map`,full:!0},{id:`diagrams`,label:zL.diagrams,section:`Map`,full:!0},{id:`reconcile`,label:zL.reconcile,section:`Map`,full:!0},{id:`changes`,label:zL.changes,section:`Change`},{id:`cockpit`,label:zL.cockpit,section:`Change`,group:`Define`},{id:`brief`,label:zL.brief,section:`Change`,group:`Define`},{id:`ux`,label:zL.ux,section:`Change`,group:`Define`,full:!0},{id:`feature-design`,label:RL.feature,section:`Change`,group:`Define`},{id:`change-knowledge`,label:zL.changeKnowledge,section:`Change`,group:`Define`,also:[w.changeKnowledge.title]},{id:`architecture`,label:RL.architecture,section:`Change`,group:`Design`},{id:`arch-review`,label:zL.archReview,section:`Change`,group:`Design`,full:!0},{id:`change-diagram`,label:zL.changeDiagram,section:`Change`,group:`Design`,aside:!0},{id:`stories`,label:RL.stories,section:`Change`,group:`Plan`},{id:`breakdown`,label:zL.breakdown,section:`Change`,group:`Plan`,full:!0},{id:`estimate`,label:zL.estimate,section:`Change`,group:`Plan`,full:!0},{id:`task-list`,label:RL.tasks,section:`Change`,group:`Build`},{id:`tasks`,label:zL.tasks,section:`Change`,group:`Build`,full:!0},{id:`conformance`,label:zL.conformance,section:`Change`,group:`Build`,full:!0},{id:`trace`,label:zL.trace,section:`Change`,group:`Build`,full:!0},{id:`release`,label:zL.release,section:`Change`,group:`Release`},{id:`service-desk`,label:zL.serviceDesk,section:`Change`,group:`Release`,full:!0},{id:`questions`,label:w.questions.title,section:`Questions`},{id:`knowledge`,label:BL.items,section:`Knowledge`},{id:`wikis`,label:BL.sources,section:`Knowledge`},{id:`documents`,label:BL.documents,section:`Knowledge`},{id:`wiki-search`,label:BL.search,section:`Knowledge`},{id:`parties`,label:BL.parties,section:`Knowledge`,full:!0},{id:`orgpack-draft`,label:BL.orgpack,section:`Knowledge`,full:!0},{id:`repos`,label:zL.repos,section:`SetUp`},{id:`ai`,label:zL.ai,section:`SetUp`},{id:`runs`,label:zL.runs,section:`SetUp`},{id:`orgpack`,label:zL.orgpack,section:`SetUp`},{id:`governance`,label:zL.governance,section:`SetUp`,full:!0},{id:`onboarding`,label:RL.onboarding,section:`SetUp`,aside:!0},{id:`scans`,label:zL.scans,section:`SetUp`},{id:`catalog-builds`,label:zL.catalogBuilds,section:`SetUp`,aside:!0},{id:`intake`,label:zL.intake,section:`SetUp`,full:!0},{id:`settings`,label:zL.settings,section:`SetUp`,full:!0},{id:`history`,label:zL.history,section:`SetUp`},{id:`evals`,label:zL.evals,section:`Atticus`,full:!0},{id:`learning`,label:zL.learning,section:`Atticus`,full:!0}],HL=e=>RL.sections[e],UL=e=>RL.groups[e],WL=(e,t=!1)=>VL.filter(n=>n.section===e&&!n.under&&(t||!n.full&&!n.aside)),GL=(e,t=!1)=>WL(e,t)[0];function KL(){return IL.flatMap(e=>{let t=VL.filter(t=>t.section===e&&t.full);if(!t.length)return[];if(e!==`Change`)return[{section:e,pages:t}];let n=LL.map(e=>({phase:e,pages:t.filter(t=>t.group===e)})).filter(e=>e.pages.length);return[{section:e,pages:n.flatMap(e=>e.pages),phases:n}]})}var qL={dashboard:`home`};function JL(e){let t=e.replace(/^#\/?/,``).split(/[/?]/)[0]||`home`,n=qL[t]??t;return VL.find(e=>e.id===n)??VL[0]}function YL(e){let t=e.replace(/^#\/?/,``),n=/^changes\/([^/?]+)/.exec(t);if(n)try{return decodeURIComponent(n[1])}catch{return n[1]}let r=t.split(`?`)[1];return r?new URLSearchParams(r).get(`change`)??void 0:void 0}function XL(e,t){return e.section!==`Change`||!t?`#/${e.id}`:e.id===`changes`?`#/changes/${encodeURIComponent(t)}`:`#/${e.id}?change=${encodeURIComponent(t)}`}var J=w.releaseViews,ZL={migration:J.migrationChip,topic:J.topicChip,"gateway-route":J.gatewayRoute,code:J.codeChip},QL={rollout:J.rollout,rollback:J.rollback2,readiness:J.readiness,verification:J.verification,hypercare:J.hypercare},$L={released:{label:J.releasedChip,chip:`done`},"on-track":{label:J.onTrack,chip:`done`},"at-risk":{label:J.atRisk,chip:`warn`},late:{label:J.lateChip,chip:`blocking`},"no-target":{label:J.noTarget,chip:`dim`}};function eR(e,t){return(0,v.useEffect)(()=>{t&&e.reload()},[t]),e}function tR(e){let t=e.state===`filed`?J.filedAs(e.number):e.state===`waiting`?J.waitingForAPerson:J.notFiled;return`${J.waitFor(e.requestType,e.record)}: ${t}${e.readyBy?J.readyBy(e.readyBy,pr(e.waitDays??0,J.workingDay)):J.noLeadTimeTo}${e.missing.length?J.missing(e.missing.join(`, `)):``}.`}function nR({rollback:e,label:t=J.rollback}){return(0,j.jsxs)(`span`,{style:{fontSize:11.5},children:[(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:9.5,marginRight:6},children:t}),` `,e.text?(0,j.jsxs)(j.Fragment,{children:[e.text,` `,(0,j.jsx)(`span`,{className:`hud cite`,style:{fontSize:9.5},children:e.source})]}):(0,j.jsx)(`span`,{style:{color:`var(--magenta-text)`},children:e.gap})]})}function rR({id:e,tick:t}){let n=eR(P(`/api/release/${e}/plan`),t);return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(F,{title:J.deploymentPlan,meta:n.state===`ready`?pr(n.data.steps.length,J.stepWord):J.computed,span:`span 5`,children:(0,j.jsx)(I,{of:n,empty:e=>e.steps.length===0,emptyText:J.nothingToDeployYet,children:e=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:10},children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:J.workedOutFromInterfaces}),e.before.length>0&&(0,j.jsx)(`div`,{className:`list-row`,style:{alignItems:`flex-start`},children:(0,j.jsxs)(`span`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`span`,{style:{fontSize:12.5},children:J.n0BeforeAnything}),e.before.map(e=>(0,j.jsxs)(`span`,{className:`muted`,style:{fontSize:12},children:[tR(e),` `,(0,j.jsx)(`span`,{className:`hud cite`,children:e.source})]},e.heading))]})}),(0,j.jsx)(`ol`,{"aria-label":J.deployOrder,className:`stack`,style:{listStyle:`none`,margin:0,padding:0,gap:0},children:e.steps.map(e=>(0,j.jsxs)(`li`,{className:`list-row`,style:{alignItems:`flex-start`,padding:`8px 0`},children:[(0,j.jsxs)(`span`,{className:`stack`,style:{gap:3,minWidth:0},children:[(0,j.jsxs)(`span`,{style:{fontSize:12.5},children:[e.n,` · `,(0,j.jsx)(`span`,{className:`mono`,children:e.repo}),e.waitDays>0&&(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:11.5},children:J.from(e.earliest)})]}),e.what.map(e=>(0,j.jsx)(`span`,{style:{fontSize:12},children:e},e)),e.why.map(e=>(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:11.5},children:e},e)),e.waitsOn.map(e=>(0,j.jsx)(`span`,{style:{fontSize:11.5,color:`var(--amber)`},children:J.waitsOn(tR(e))},e.heading)),(0,j.jsx)(nR,{rollback:e.rollback})]}),(0,j.jsx)(`span`,{className:`chip ${e.kind===`code`?`dim`:`warn`}`,children:ZL[e.kind]})]},e.n))}),e.external.map(e=>(0,j.jsxs)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:[e.what,e.beforeStep?J.beforeStep(e.beforeStep):``,`.`]},e.what)),e.unplaced.length>0&&(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:J.notPlaced}),(0,j.jsx)(`ul`,{className:`run-steps`,children:e.unplaced.map(e=>(0,j.jsx)(`li`,{children:e.why},e.id))})]}),e.findings.length>0&&(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:J.criticReleaseLensStill}),(0,j.jsx)(`ul`,{className:`run-steps`,children:e.findings.map(e=>(0,j.jsxs)(`li`,{children:[e.summary,` `,(0,j.jsx)(`span`,{className:`hud cite`,children:e.path})]},e.id))})]})]})})}),(0,j.jsx)(F,{title:J.forecast,meta:J.fromDatesNoEstimates,span:`span 4`,children:(0,j.jsx)(I,{of:n,children:e=>{let t=e.forecast,n=$L[t.status]??$L[`no-target`];return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:10},children:[(0,j.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,gap:8,alignItems:`baseline`},children:[(0,j.jsx)(`span`,{style:{fontSize:20},className:`mono`,children:t.ready??J.noDate}),(0,j.jsx)(`span`,{className:`chip ${n.chip}`,children:n.label})]}),(0,j.jsxs)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:[t.status===`released`?J.released:J.readyToReleaseBy(pr(t.waitDays,J.workingDay)),` `,t.target?J.target(t.target.date,t.target.source):J.noTargetDateThe]}),t.drivers.length>0&&(0,j.jsx)(`ul`,{className:`run-steps`,"aria-label":J.whatSetsTheDay,children:t.drivers.map(e=>(0,j.jsxs)(`li`,{children:[e.until,`: `,e.what,` `,(0,j.jsx)(`span`,{className:`hud cite`,style:{fontSize:9.5},children:e.source})]},e.what))}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:J.tasksOfDone(t.tasks.done,t.tasks.total,t.tasks.waitingOnRequests.length?J.waitOnAService(t.tasks.waitingOnRequests.join(`, `)):``)}),t.notes.map(e=>(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:11.5},children:e},e))]})}})}),(0,j.jsx)(F,{title:J.rolloutReadinessAndHypercare,meta:J.fromDesignMd,span:`1 / -1`,children:(0,j.jsx)(I,{of:n,children:e=>(0,j.jsx)(`dl`,{className:`run-facts`,children:e.sections.map(e=>(0,j.jsxs)(`div`,{style:{display:`contents`},children:[(0,j.jsx)(`dt`,{className:`hud`,children:QL[e.name]??e.name}),(0,j.jsx)(`dd`,{children:e.text?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`span`,{className:`run-text`,children:e.text}),` `,(0,j.jsx)(`span`,{className:`hud cite`,style:{fontSize:9.5},children:e.source})]}):(0,j.jsx)(`span`,{style:{color:`var(--amber)`},children:e.gap})})]},e.name))})})})]})}function iR({id:e,tick:t}){let n=eR(P(`/api/release/${e}/security`),t);return(0,j.jsx)(F,{title:J.securityReviewDraft,meta:J.fromTheCatalogAnd,span:`span 12`,children:(0,j.jsx)(I,{of:n,children:e=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:12},children:[(0,j.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`,gap:8},children:[(0,j.jsxs)(`p`,{style:{margin:0,fontSize:12.5},children:[(0,j.jsx)(`span`,{className:`hud`,style:{marginRight:8},children:J.signsOff}),e.signOff.how]}),(0,j.jsx)(sr,{text:e.markdown,label:J.copyTheSecurityReview})]}),e.interfaces.length===0?(0,j.jsx)(`p`,{className:`state`,children:J.interfacesMdListsNo}):(0,j.jsxs)(`table`,{className:`run-table`,children:[(0,j.jsx)(`caption`,{className:`sr`,children:J.newOrChangedInterfaces}),(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{scope:`col`,children:J.operation}),(0,j.jsx)(`th`,{scope:`col`,children:J.callerCallee}),(0,j.jsx)(`th`,{scope:`col`,children:J.auth}),(0,j.jsx)(`th`,{scope:`col`,children:J.crosses})]})}),(0,j.jsx)(`tbody`,{children:e.interfaces.map(e=>(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`td`,{className:`mono`,children:e.operation}),(0,j.jsxs)(`td`,{children:[e.caller,` → `,e.callee,` (`,e.change,`)`]}),(0,j.jsxs)(`td`,{children:[(0,j.jsx)(`span`,{className:`chip ${e.auth===`not stated`?`blocking`:`done`}`,children:e.auth.toUpperCase()}),` `,(0,j.jsx)(`span`,{className:`hud cite`,style:{fontSize:9.5},children:e.authSource??J.saidNowhere})]}),(0,j.jsx)(`td`,{children:e.crosses??J.no})]},`${e.operation}|${e.caller}`))})]}),(0,j.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,gap:16,alignItems:`flex-start`},children:[(0,j.jsxs)(`div`,{className:`stack`,style:{flex:`1 1 260px`,gap:4},children:[(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:J.dataFieldsTouched}),e.fields.length===0?(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:J.dataMdAddsNo}):(0,j.jsx)(`ul`,{className:`run-steps`,children:e.fields.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`span`,{className:`mono`,children:e.field}),`: `,e.classification,e.personalLooking?J.looksLikePersonalData:``]},e.field))})]}),(0,j.jsxs)(`div`,{className:`stack`,style:{flex:`1 1 260px`,gap:4},children:[(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:J.dataCrossingABoundary}),e.crossings.length===0?(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:J.noNewOrChanged}):(0,j.jsx)(`ul`,{className:`run-steps`,children:e.crossings.map(e=>(0,j.jsxs)(`li`,{children:[e.operation,`: `,e.from,` → `,e.to,` (`,e.toBoundary,`).`,` `,e.fields.length?e.fields.map(e=>`${e.field} (${e.classification}${e.sensitive===`yes`?J.sensitiveSuffix:``})`).join(`; `):e.note??J.mappingsMdDoesntSay]},e.operation))})]}),(0,j.jsxs)(`div`,{className:`stack`,style:{flex:`1 1 260px`,gap:4},children:[(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:J.vendorsSecretsAndFindings}),(0,j.jsxs)(`ul`,{className:`run-steps`,children:[e.vendors.map(e=>(0,j.jsxs)(`li`,{children:[e.name,`:`,` `,e.isNew?J.aNewVendor:J.alreadyCalled(pr(e.existing,J.interfaceWord)),`; `,e.operations.join(`, `)]},e.name)),e.secrets.map(e=>(0,j.jsxs)(`li`,{children:[e.what,` `,(0,j.jsx)(`span`,{className:`hud cite`,style:{fontSize:9.5},children:e.source})]},`${e.what}|${e.source}`)),e.findings.map(e=>(0,j.jsxs)(`li`,{children:[e.severity,`: `,e.summary]},e.id)),e.vendors.length+e.secrets.length+e.findings.length===0&&(0,j.jsx)(`li`,{children:J.noVendorSecretOr})]})]})]}),e.gaps.length>0&&(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:J.gapsForTheReviewer}),(0,j.jsx)(`ul`,{className:`run-steps`,children:e.gaps.map(e=>(0,j.jsx)(`li`,{children:e},e))})]})]})})})}function aR({id:e,tick:t}){let[n,r]=(0,v.useState)(`business`),i=eR(P(`/api/release/${e}/notes?audience=${n}`),t);return(0,j.jsx)(F,{title:J.releaseNotes,meta:J.generatedNoAi,span:`span 6`,children:(0,j.jsxs)(`div`,{className:`stack`,style:{gap:10},children:[(0,j.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`,gap:8},children:[(0,j.jsx)(lr,{label:J.audience,value:n,options:[{value:`business`,label:J.business},{value:`technical`,label:J.technical}],onChange:r}),i.state===`ready`&&(0,j.jsx)(sr,{text:i.data.markdown,label:J.copyTheReleaseNotes})]}),(0,j.jsx)(I,{of:i,children:e=>(0,j.jsx)(`pre`,{className:`run-text`,tabIndex:0,"aria-label":J.releaseNotes,style:{maxHeight:320,overflow:`auto`,fontFamily:`var(--mono)`,fontSize:12},children:e.markdown})})]})})}function oR({id:e,tick:t}){let n=eR(P(`/api/outcomes?change=${e}`),t),r=P(`/api/health`),i=ar(),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)(!1),p=t=>{t.preventDefault(),i.run(()=>N(`/api/release/${e}/outcomes`,{method:`POST`,body:{measure:a,value:s,...l.trim()?{note:l}:{}}}).then(()=>{c(``),u(``),f(!0),n.reload()}),J.recorded)};return(0,j.jsx)(F,{title:J.outcomes,meta:J.theBriefsSuccessMeasures,span:`span 6`,children:(0,j.jsx)(I,{of:n,empty:e=>e.measures.length===0,emptyText:J.briefMdHasNo,children:t=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:10},children:[(0,j.jsx)(`ul`,{className:`stack`,style:{listStyle:`none`,margin:0,padding:0,gap:0},children:t.measures.map(e=>(0,j.jsxs)(`li`,{className:`list-row`,style:{alignItems:`flex-start`},children:[(0,j.jsxs)(`span`,{className:`stack`,style:{gap:2},children:[(0,j.jsxs)(`span`,{style:{fontSize:12.5},children:[e.n,` · `,e.measure]}),(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:e.latest?J.measuredByOn(e.latest.value,e.latest.by,fr(e.latest.at),e.values.length>1?` (${pr(e.values.length,J.valueWord)})`:``):J.notMeasuredYet})]}),(0,j.jsx)(`span`,{className:`chip ${e.latest?`done`:`dim`}`,children:e.latest?J.measured:J.open})]},e.id))}),t.orphans.map(e=>(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:J.recordedButBriefMd(e.measure)},e.id)),t.canRecord?(0,j.jsxs)(`form`,{onSubmit:p,className:`stack`,"aria-label":J.recordAnOutcome,children:[(0,j.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,alignItems:`flex-end`},children:[(0,j.jsxs)(`label`,{className:`run-label`,htmlFor:`om-${e}`,style:{flex:`1 1 200px`},children:[J.measure,(0,j.jsxs)(`select`,{id:`om-${e}`,className:`run-select`,value:a,required:!0,onChange:e=>o(e.target.value),children:[(0,j.jsx)(`option`,{value:``,children:J.chooseAMeasure}),t.measures.map(e=>(0,j.jsxs)(`option`,{value:e.id,children:[e.n,` · `,e.measure]},e.id))]})]}),(0,j.jsxs)(`label`,{className:`run-label`,htmlFor:`ov-${e}`,style:{flex:`1 1 160px`},children:[J.whatYouMeasured,(0,j.jsx)(`input`,{id:`ov-${e}`,className:`run-input`,value:s,required:!0,onChange:e=>c(e.target.value)})]})]}),(0,j.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,alignItems:`flex-end`},children:[(0,j.jsxs)(`label`,{className:`run-label`,htmlFor:`on-${e}`,style:{flex:`1 1 240px`},children:[J.howOptional,(0,j.jsx)(`input`,{id:`on-${e}`,className:`run-input`,value:l,onChange:e=>u(e.target.value)})]}),(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:i.busy||!a||!s.trim(),children:J.record(r.state===`ready`?J.as(r.data.user):``)})]}),(0,j.jsx)(or,{note:i.note}),d&&(0,j.jsx)(Yc,{scope:`outcomes`})]}):(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:t.why})]})})})}function sR(e,t){let n=URL.createObjectURL(new Blob([t],{type:`text/markdown;charset=utf-8`})),r=document.createElement(`a`);r.href=n,r.download=e,document.body.appendChild(r),r.click(),r.remove(),setTimeout(()=>URL.revokeObjectURL(n),1e3)}function cR(e,t,n){let r=`evidence-${e}.md`;return n?{saved:!1,text:w.app.panelNoSave(r,`atticus release evidence ${e} --out <folder>`)}:{saved:!0,text:J.evidenceSaved(r,pr(t.files.length,J.fileWord))}}function lR({id:e}){let t=ar(),[n,r]=(0,v.useState)();return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`div`,{className:`row`,style:{flexWrap:`wrap`},children:(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:t.busy,onClick:()=>void t.run(()=>N(`/api/release/${e}/evidence`).then(t=>{let n=!!A();return n?r(t.markdown):sR(`evidence-${e}.md`,t.markdown),cR(e,t,n)}),e=>e.text),children:J.exportEvidencePack})}),(0,j.jsx)(or,{note:t.note}),n!==void 0&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`label`,{htmlFor:`evidence-${e}`,className:`sr`,children:J.evidenceMd(e)}),(0,j.jsx)(`textarea`,{id:`evidence-${e}`,className:`run-textarea`,readOnly:!0,rows:10,value:n}),(0,j.jsx)(`div`,{children:(0,j.jsx)(sr,{text:n,label:J.copyEvidenceMd(e)})})]})]})}var Y=w.release;function uR({pr:e}){return e.url&&Ia(e.url)?(0,j.jsxs)(`span`,{children:[Y.prToOpen,` `,(0,j.jsx)(`a`,{href:Fa,children:w.phase.manualSteps})]}):e.url&&/^https?:/.test(e.url)?(0,j.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,children:Y.prState(e.number,e.state)}):(0,j.jsx)(j.Fragment,{children:Y.prState(e.number,e.state)})}var dR=[`qa`,`release-ready`,`released`,`post-release-review`],fR=new Set([`open`,`draft`,`merged`]),pR={"release-ready":Y.atGoNoGo,released:Y.releasedChipWord,"post-release-review":Y.postReleaseReview};function mR({list:e,current:t}){return(0,j.jsx)(F,{title:Y.changes,span:`span 3`,rows:`span 3`,children:(0,j.jsx)(I,{of:e,empty:e=>e.length===0,emptyText:Y.noChangesInFlight,children:e=>(0,j.jsx)(`nav`,{"aria-label":Y.changes,className:`cw-list`,children:e.map(e=>(0,j.jsxs)(`a`,{href:`#/release/${e.id}`,"aria-current":e.id===t?`page`:void 0,className:`cw-row`,children:[(0,j.jsxs)(`span`,{className:`cw-row-main`,children:[(0,j.jsx)(`span`,{className:`cw-row-title`,children:e.title}),(0,j.jsx)(`span`,{className:`cw-row-sub`,children:e.id})]}),(0,j.jsx)(`span`,{className:`chip ${e.atRelease?`warn`:`dim`}`,children:pR[e.state]??e.state.toUpperCase()})]},e.id))})})})}function hR(e){return(0,j.jsxs)(`li`,{"aria-label":`${e.label}: ${e.value}`,children:[(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:e.label}),(0,j.jsx)(`span`,{className:`chip ${e.ok?`done`:e.warn?`warn`:`blocking`}`,style:{alignSelf:`flex-start`},children:e.value}),(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:11.5},children:e.detail})]})}function gR(e){let t=e.handoff,n=t?.approvals.map(e=>e.by)??[];return t&&t.state===`open`&&Ia(t.pr)?{value:Y.waitsOnYouChip,ok:!1,warn:!0,detail:(0,j.jsx)(Wa,{phase:`release`})}:{value:t?t.state===`merged`?Y.mergedChip:n.length?Y.approvedNotMerged:t.state.toUpperCase():e.change.state===`release-ready`?Y.notRaised:Y.laterChip,ok:t?.state===`merged`,warn:!t,detail:t?Y.mergingIsTheGo(t.pr,n.length?Y.approvedBy(n.join(`, `)):``):Y.goNoGoIs}}function _R({id:e}){let t=P(`/api/release/${e}`),n=ar(),[r,i]=(0,v.useState)(0);St(e=>{e.type===`file.changed`&&(t.reload(),i(e=>e+1))});let a=(e,r,i)=>void n.run(()=>N(e,{method:`POST`,body:r}).then(()=>t.reload()),i),o=(r,i,a)=>void n.run(async()=>N(r,{method:`POST`,body:await Jn(i,e)}).then(()=>t.reload()),a);return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(F,{title:t.state===`ready`?`${t.data.change.id} · ${t.data.change.title}`:e,span:`span 9`,kind:`hero`,children:(0,j.jsx)(I,{of:t,children:r=>{let i=r.openFindings.blocking+r.openFindings.gap;return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:12},children:[(0,j.jsxs)(`p`,{style:{margin:0,fontSize:14},children:[(0,j.jsx)(`span`,{className:`hud`,style:{marginRight:8},children:Y.next}),Gr(r.status.nextStep,r.status.stepFirst,r.status.nextStepApp),r.status.stepFirst&&(0,j.jsxs)(j.Fragment,{children:[` `,(0,j.jsx)(Nt,{change:r.change.id})]})]}),(0,j.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,gap:6},children:[(0,j.jsx)(`span`,{className:`chip dim`,children:Y.type(r.change.type.toUpperCase())}),(0,j.jsx)(`span`,{className:`chip ${r.status.risk.level===`high`?`blocking`:r.status.risk.level===`medium`?`warn`:``}`,children:Y.risk(r.status.risk.level.toUpperCase())}),(0,j.jsx)(`span`,{className:`chip`,children:(pR[r.change.state]??r.change.state).toUpperCase()})]}),(0,j.jsxs)(`ul`,{className:`run-gates`,"aria-label":Y.gatesToGoLive,children:[(0,j.jsx)(hR,{label:Y.requests,value:r.requests.total===0?Y.noneNeeded:r.requests.toFile?Y.notFiledChip(r.requests.toFile):Y.filedChip(r.requests.filed),ok:r.requests.toFile===0,detail:r.requests.total===0?Y.snowMdListsNo:Y.ofFiled(r.requests.filed,r.requests.total)}),(0,j.jsx)(hR,{label:Y.findings,value:i?Y.openFindingsChip(i):Y.clearChip,ok:i===0,detail:Y.blocking(r.openFindings.blocking,pr(r.openFindings.gap,Y.knowledgeGap))}),(0,j.jsx)(hR,{label:Y.goNoGoPr,...gR(r)}),(0,j.jsx)(hR,{label:Y.archiveGate,value:r.archive.pass?Y.openChip:Y.blockersChip(r.archive.blockers.length),ok:r.archive.pass,warn:!r.archive.pass&&r.change.state!==`released`,detail:Y.opensOnceReleasedMerged})]}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:Y.aPersonApprovesEvery}),(0,j.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:n.busy||!dR.includes(r.change.state)||!r.repos.some(e=>!e.pr||!fR.has(e.pr.state)),title:dR.includes(r.change.state)?Y.raisesReleasePrs:Y.releasePrsNotYet,onClick:()=>o(`/api/changes/${e}/release-prs`,`release-prs`,Y.releasePrsRaised),children:Y.raiseReleasePrs}),(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:n.busy||r.change.state!==`release-ready`||!!r.handoff&&r.handoff.state===`open`,title:r.change.state===`release-ready`?void 0:Y.theChangeReachesGo,onClick:()=>void n.run(async()=>N(`/api/changes/${e}/handoff`,{method:`POST`,body:await Jn(`handoff`,e)}).then(e=>(t.reload(),e)),e=>Ia(e.handoff?.pr)?Y.goNoGoManual:Y.goNoGoPr2),children:Y.askForGoNo}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:n.busy||!r.handoff&&!r.repos.some(e=>e.pr),title:Y.readsThePrMerges,onClick:()=>o(`/api/changes/${e}/sync`,`merge`,Y.syncedWithTheGit),children:Y.syncAndMergeWhen}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:n.busy||![`released`,`post-release-review`].includes(r.change.state),title:Y.archivesTheChangeAnd,onClick:()=>a(`/api/release/${e}/archive`,{},Y.archivedItsReposWere),children:Y.archive})]}),(0,j.jsx)(or,{note:n.note})]})}})}),(0,j.jsx)(F,{title:Y.releasePrs,span:`span 9`,children:(0,j.jsx)(I,{of:t,empty:e=>e.repos.length===0,emptyText:Y.noCodeRepos,children:e=>(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:Y.releasePrsIntro}),(0,j.jsxs)(`table`,{className:`run-table`,children:[(0,j.jsx)(`caption`,{className:`sr`,children:Y.releasePrsCaption}),(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{scope:`col`,children:Y.releasePrCol.repo}),(0,j.jsx)(`th`,{scope:`col`,children:Y.releasePrCol.branch}),(0,j.jsx)(`th`,{scope:`col`,children:Y.releasePrCol.pr}),(0,j.jsx)(`th`,{scope:`col`,children:Y.releasePrCol.build})]})}),(0,j.jsx)(`tbody`,{children:e.repos.map(e=>(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`td`,{className:`mono`,children:e.id}),(0,j.jsx)(`td`,{className:`mono`,children:e.branch}),(0,j.jsx)(`td`,{children:e.pr?(0,j.jsx)(uR,{pr:e.pr}):(0,j.jsx)(`span`,{className:`muted`,children:Y.notRaisedYet})}),(0,j.jsx)(`td`,{children:e.build.status})]},e.id))})]})]})})}),(0,j.jsx)(rR,{id:e,tick:r}),(0,j.jsx)(F,{title:Y.whatStopsIt,span:`span 6`,children:(0,j.jsx)(I,{of:t,empty:e=>e.status.blockers.length+e.status.reasons.length===0,emptyText:Y.nothingStopsThisChange,children:e=>(0,j.jsx)(`ul`,{className:`run-steps`,children:[...e.status.blockers,...e.status.reasons].filter((e,t,n)=>n.findIndex(t=>t.message===e.message)===t).map(e=>(0,j.jsx)(`li`,{children:e.message},e.message))})})}),(0,j.jsx)(F,{title:Y.archiveGate,span:`span 6`,children:(0,j.jsx)(I,{of:t,children:e=>e.archive.pass?(0,j.jsx)(`p`,{className:`run-note ok`,children:Y.theChangeMayBe}):(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsx)(`ul`,{className:`run-steps`,children:e.archive.blockers.map(e=>(0,j.jsx)(`li`,{children:e.message},e.message))}),e.archive.notes.map(e=>(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:e},e))]})})}),(0,j.jsx)(F,{title:Y.conflictsWithOtherChanges,span:`span 6`,children:(0,j.jsx)(I,{of:t,empty:e=>e.conflicts.length===0,emptyText:Y.noOtherOpenChange,children:e=>e.conflicts.map(e=>(0,j.jsxs)(`div`,{className:`list-row`,style:{alignItems:`flex-start`},children:[(0,j.jsxs)(`span`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`a`,{href:`#/release/${e.with}`,className:`mono`,children:e.with}),(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:Y.alsoTouchesAgreeAn(Object.entries(e.overlap).filter(([,e])=>e.length).map(([e,t])=>`${e} ${t.join(`, `)}`).join(`; `))})]}),(0,j.jsx)(`span`,{className:`chip warn`,children:Y.overlap})]},e.with))})}),(0,j.jsx)(F,{title:Y.evidencePack,meta:t.state===`ready`?pr(t.data.evidence.length,Y.fileWord):void 0,span:`span 6`,children:(0,j.jsx)(I,{of:t,empty:e=>e.evidence.length===0,emptyText:Y.theChangeFolderIs,children:t=>(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:Y.forTheApprovalBoard}),(0,j.jsx)(lR,{id:e}),(0,j.jsx)(`ul`,{tabIndex:0,"aria-label":Y.evidenceFiles,style:{listStyle:`none`,margin:0,padding:0,maxHeight:220,overflow:`auto`},children:t.evidence.map(e=>(0,j.jsxs)(`li`,{className:`list-row`,style:{padding:`4px 0`},children:[(0,j.jsx)(`span`,{className:`mono`,style:{fontSize:11.5},children:e.path}),(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:9.5},children:e.bytes<1024?Y.bytes(e.bytes):Y.kb(Math.round(e.bytes/1024))})]},e.path))})]})})}),(0,j.jsx)(iR,{id:e,tick:r}),(0,j.jsx)(aR,{id:e,tick:r}),(0,j.jsx)(oR,{id:e,tick:r})]})}function vR({hash:e}){let t=e.replace(/^#\/?release\/?/,``).split(`?`)[0]||YL(e)||void 0,n=P(`/api/release`),r=t??(n.state===`ready`?n.data[0]?.id:void 0);return(0,j.jsxs)(`div`,{className:`bento`,children:[(0,j.jsx)(mR,{list:n,current:r}),r?(0,j.jsx)(_R,{id:r},r):(0,j.jsx)(F,{title:Y.noChangeSelected,span:`span 9`,children:(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:Y.pickAChangeOn})})]})}var yR=w.setup;function bR(e){return e.filter(e=>e.add&&e.id.trim()).map(e=>({id:e.id.trim(),url:e.url,type:e.type,...e.defaultBranch?{defaultBranch:e.defaultBranch}:{},...e.about.trim()?{description:e.about.trim()}:{}}))}function xR({plan:e,rows:t,setRows:n}){let r=(e,r)=>n(t.map((t,n)=>n===e?{...t,...r}:t));return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[t.length===0?(0,j.jsx)(`p`,{className:`state`,children:yR.nothingNew}):(0,j.jsxs)(`table`,{className:`run-table`,children:[(0,j.jsx)(`caption`,{className:`hud`,style:{textAlign:`left`},children:yR.toAdd(t.filter(e=>e.add).length)}),(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{scope:`col`,children:yR.colAdd}),(0,j.jsx)(`th`,{scope:`col`,children:yR.colId}),(0,j.jsx)(`th`,{scope:`col`,children:yR.colUrl}),(0,j.jsx)(`th`,{scope:`col`,children:yR.colType}),(0,j.jsx)(`th`,{scope:`col`,children:yR.colAbout})]})}),(0,j.jsx)(`tbody`,{children:t.map((e,t)=>(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`td`,{children:(0,j.jsx)(`input`,{type:`checkbox`,checked:e.add,"aria-label":yR.addFor(e.id),onChange:e=>r(t,{add:e.target.checked})})}),(0,j.jsxs)(`td`,{children:[(0,j.jsx)(`input`,{className:`field mono`,value:e.id,"aria-label":`${yR.colId}: ${e.url}`,onChange:e=>r(t,{id:e.target.value}),style:{minWidth:140}}),e.renamed&&(0,j.jsx)(`div`,{className:`muted`,style:{fontSize:11.5},children:yR.renamed(e.renamed.from,e.renamed.why)})]}),(0,j.jsxs)(`td`,{className:`mono`,style:{wordBreak:`break-all`,fontSize:12},children:[e.url,e.given&&(0,j.jsx)(`div`,{className:`muted`,style:{fontSize:11.5},children:yR.normalised(e.given)})]}),(0,j.jsx)(`td`,{className:`mono`,children:e.type}),(0,j.jsx)(`td`,{children:(0,j.jsx)(`input`,{className:`field`,value:e.about,maxLength:300,"aria-label":yR.aboutFor(e.id),onChange:e=>r(t,{about:e.target.value})})})]},e.url))})]}),e.listed.map(e=>(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:yR.listed(e.url,e.id)},e.url)),e.refused.map(e=>(0,j.jsx)(`p`,{className:`run-note bad`,children:yR.refused(e.given,e.why)},e.given)),e.skipped.length>0&&(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:yR.skipped(e.skipped.length)})]})}function SR({onAdded:e}){let[t,n]=(0,v.useState)(`paste`),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(),[l,u]=(0,v.useState)([]),[d,f]=(0,v.useState)(),[p,m]=(0,v.useState)([]),[h,g]=(0,v.useState)(0),_=Vn(),y=t===`paste`?r.trim():a.trim(),b=bR(l),x=e=>({repos:b,...d?{platform:d}:{},...e?{preview:!0}:{}});return(0,j.jsx)(F,{title:yR.reposTitle,children:(0,j.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,maxWidth:`70ch`},children:yR.reposIntro}),(0,j.jsxs)(`fieldset`,{className:`row`,style:{gap:12,border:0,padding:0,margin:0},children:[(0,j.jsx)(`legend`,{className:`sr`,children:yR.modeLabel}),[`paste`,`folder`].map(e=>(0,j.jsxs)(`label`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`input`,{type:`radio`,name:`add-repos-mode`,checked:t===e,onChange:()=>n(e)}),e===`paste`?yR.pasteMode:yR.folderMode]},e))]}),(0,j.jsxs)(`form`,{className:`stack`,style:{gap:6},onSubmit:e=>{e.preventDefault(),y&&_.run(async()=>{let e=await N(`/api/setup/repos/plan`,{method:`POST`,body:t===`paste`?{urls:r}:{dir:a.trim(),...d?{platform:d}:{}}});return c(e),m(e.platforms),f(e.platform??d??(t===`paste`?e.platforms[0]:void 0)),u(e.repos.map(e=>({...e,add:!0,about:``}))),g(h+1),e},e=>t===`folder`&&!e.platform&&e.platforms.length>1?yR.choosePlatform(e.platforms.length):yR.toAdd(e.repos.length))},children:[t===`paste`?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`label`,{htmlFor:`add-repos-urls`,children:yR.urls}),(0,j.jsx)(`textarea`,{id:`add-repos-urls`,className:`field mono`,rows:6,value:r,"aria-describedby":`add-repos-urls-hint`,onChange:e=>i(e.target.value)}),(0,j.jsx)(`span`,{id:`add-repos-urls-hint`,className:`muted`,style:{fontSize:12},children:yR.urlsHint})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`label`,{htmlFor:`add-repos-dir`,children:yR.dir}),(0,j.jsx)(`input`,{id:`add-repos-dir`,className:`field mono`,value:a,"aria-describedby":`add-repos-dir-hint`,onChange:e=>o(e.target.value)}),(0,j.jsx)(`span`,{id:`add-repos-dir-hint`,className:`muted`,style:{fontSize:12},children:yR.dirHint})]}),p.length>1&&(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`label`,{htmlFor:`add-repos-platform`,children:yR.platformLabel}),(0,j.jsxs)(`select`,{id:`add-repos-platform`,className:`field`,value:d??``,"aria-describedby":t===`folder`&&!d?`add-repos-platform-hint`:void 0,onChange:e=>f(e.target.value||void 0),children:[(0,j.jsx)(`option`,{value:``,children:yR.platformNone}),p.map(e=>(0,j.jsx)(`option`,{value:e,children:e},e))]}),t===`folder`&&!d&&(0,j.jsx)(`span`,{id:`add-repos-platform-hint`,className:`state`,children:yR.choosePlatform(p.length)})]}),(0,j.jsx)(`div`,{className:`row`,children:(0,j.jsx)(`button`,{type:`submit`,className:`btn`,disabled:_.busy||!y,children:_.busy?yR.reading:yR.read})}),(0,j.jsx)(Wn,{note:_.note})]}),s&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(xR,{plan:s,rows:l,setRows:u}),l.length>0&&(0,j.jsx)(ku,{disabled:b.length===0,preview:()=>N(`/api/setup/repos`,{method:`POST`,body:x(!0)}),write:()=>N(`/api/setup/repos`,{method:`POST`,body:x(!1)}),onWritten:()=>e?.()},h),l.length>0&&b.length===0&&(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:yR.noneTicked})]})]})})}var CR=w.setup;function wR({repo:e,type:t,onChanged:n}){let r=Vn(),[i,a]=(0,v.useState)(),[o,s]=(0,v.useState)(t),[c,l]=(0,v.useState)(0),[u,d]=(0,v.useState)(!1),f=`repo-${e}-type`,p=t=>N(`/api/repos/${encodeURIComponent(e)}/type`,{method:`PUT`,body:{type:o.trim(),...t?{preview:!0}:{}}});return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6,margin:`8px 0`},children:[(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`,alignItems:`flex-end`},children:[(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`label`,{htmlFor:f,className:`muted`,style:{fontSize:12},children:CR.type}),(0,j.jsx)(`input`,{id:f,className:`field mono`,value:o,"aria-describedby":`${f}-hint`,onChange:e=>{s(e.target.value),d(!1),l(c+1)}})]}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:r.busy,"aria-label":CR.detectFor(e),onClick:()=>void r.run(async()=>{let t=await N(`/api/repos/${encodeURIComponent(e)}/type/detect`,{method:`POST`});return a(t),t.type&&(s(t.type),l(c+1)),t},e=>e.from===`repo-types`?CR.detectedTypes(e.verdict,e.type):e.type?CR.detected(e.type):CR.noType),children:r.busy?CR.detecting:CR.detect})]}),(0,j.jsx)(`span`,{id:`${f}-hint`,className:`muted`,style:{fontSize:12},children:CR.typeHint}),(0,j.jsx)(Wn,{note:r.note}),i?.signals&&i.signals.length>0&&(0,j.jsx)(`p`,{className:`muted mono`,style:{margin:0,fontSize:12},children:i.signals.join(`, `)}),(o.trim()&&o.trim()!==t||u)&&(0,j.jsx)(ku,{label:CR.setType,preview:()=>p(!0),write:()=>p(!1),onWritten:()=>{d(!0),n?.()}},c)]})}var TR=w.repos;function ER(e){return[...new Set(e.split(/[\n,]/).map(e=>e.trim()).filter(Boolean))]}function DR({c:e}){return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},"aria-live":`polite`,children:[(0,j.jsx)(`p`,{style:{margin:0},children:TR.compared(e.branch,e.added.length,e.removed.length,e.changed.length)}),e.added.length+e.removed.length+e.changed.length>0&&(0,j.jsxs)(`ul`,{className:`mono`,style:{margin:0,paddingLeft:18,fontSize:12},children:[e.added.map(e=>(0,j.jsxs)(`li`,{children:[`+ `,e]},`+${e}`)),e.removed.map(e=>(0,j.jsxs)(`li`,{children:[`- `,e]},`-${e}`)),e.changed.map(e=>(0,j.jsxs)(`li`,{children:[`~ `,e.record,` (`,e.fields.join(`, `),`)`]},`~${e.record}`))]})]})}function OR({r:e,onChanged:t}){let n=e.description,r=n?.trust===`suggested`,[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(n?.text??``),[c,l]=(0,v.useState)(n?.text??``),u=Vn(),d=(r,i)=>u.run(async()=>{let i=await N(`/api/repos/${e.id}/description`,{method:`PUT`,body:{...r,was:r.text===void 0?n?.text??``:c}});return a(!1),t?.(),i},i),f=o.trim().length>300,p=!o.trim();return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4,margin:`8px 0`},children:[(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`,alignItems:`baseline`},children:[(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:TR.about}),r&&(0,j.jsx)(`span`,{className:`chip warn`,title:TR.aboutDraftWhy(n.by??TR.yourAssistant),children:TR.aboutDraft})]}),(0,j.jsxs)(`p`,{style:{margin:0,maxWidth:`70ch`},children:[n?n.text:(0,j.jsx)(`span`,{className:`muted`,children:TR.noAbout}),n?.by&&!r&&(0,j.jsx)(`span`,{className:`muted`,children:` · ${TR.aboutBy(n.by)}`})]}),n&&(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12,maxWidth:`70ch`},children:r?TR.aboutDraftWhy(n.by??TR.yourAssistant):TR.aboutWhy}),r&&!!n?.cites?.length&&(0,j.jsx)(`p`,{className:`muted mono`,style:{margin:0,fontSize:12},children:`${TR.aboutCites}: ${n.cites.map(e=>`${e.file}:${e.line}`).join(`, `)}`}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:6,flexWrap:`wrap`},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,"aria-expanded":i,"aria-controls":`repo-${e.id}-about-form`,"aria-label":n?TR.editAboutDraftFor(e.id):TR.editAboutFor(e.id),onClick:()=>{i||(s(n?.text??``),l(n?.text??``)),a(!i)},children:n?TR.editAboutDraft:TR.editAbout}),r&&(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:u.busy,"aria-label":TR.acceptAboutFor(e.id),onClick:()=>void d({accept:!0},TR.aboutSaved),children:TR.acceptAbout}),n&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:u.busy,"aria-label":TR.rejectAboutFor(e.id),onClick:()=>void d({reject:!0},TR.aboutDropped),children:TR.rejectAbout})]}),i&&(0,j.jsxs)(`form`,{id:`repo-${e.id}-about-form`,className:`stack`,style:{gap:4},onSubmit:e=>{e.preventDefault(),!(p||f)&&d({text:o.trim()},TR.aboutSaved)},children:[(0,j.jsxs)(`label`,{className:`stack`,htmlFor:`repo-${e.id}-about`,children:[(0,j.jsx)(`span`,{children:TR.about}),(0,j.jsx)(`span`,{className:`muted`,id:`repo-${e.id}-about-hint`,children:TR.aboutHint})]}),(0,j.jsx)(`textarea`,{id:`repo-${e.id}-about`,className:`field`,rows:2,maxLength:300,value:o,"aria-describedby":`repo-${e.id}-about-hint`,"aria-invalid":f||void 0,onChange:e=>s(e.target.value)}),f&&(0,j.jsx)(`p`,{role:`alert`,style:{margin:0},children:TR.aboutTooLong(300)}),(0,j.jsx)(`div`,{className:`row`,style:{gap:8},children:(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:u.busy||p||f,children:TR.save})}),p&&(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:TR.aboutEmpty})]}),(0,j.jsx)(Wn,{note:u.note})]})}function kR({r:e,onChanged:t}){let[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(e.build??``),[o,s]=(0,v.useState)(e.build??``),c=Vn(),l=/[\r\n]/.test(i.trim()),u=i.trim().length>500,d=`repo-${e.id}-build`;return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4,margin:`8px 0`},children:[(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:TR.build}),(0,j.jsx)(`p`,{style:{margin:0,maxWidth:`70ch`},children:e.build?(0,j.jsx)(`code`,{className:`mono`,children:e.build}):(0,j.jsx)(`span`,{className:`muted`,children:TR.noBuild})}),(0,j.jsx)(`div`,{className:`row`,style:{gap:6,flexWrap:`wrap`},children:(0,j.jsx)(`button`,{type:`button`,className:`btn`,"aria-expanded":n,"aria-controls":`${d}-form`,"aria-label":e.build?TR.changeBuildFor(e.id):TR.setBuildFor(e.id),onClick:()=>{n||(a(e.build??``),s(e.build??``)),r(!n)},children:e.build?TR.changeBuild:TR.setBuild})}),n&&(0,j.jsxs)(`form`,{id:`${d}-form`,className:`stack`,style:{gap:4},onSubmit:n=>{if(n.preventDefault(),l||u)return;let a=i.trim();c.run(async()=>{let n=await N(`/api/repos/${e.id}/build`,{method:`PUT`,body:{build:a,was:o}});return s(a),r(!1),t?.(),n},a?TR.buildSaved:TR.buildCleared)},children:[(0,j.jsxs)(`label`,{className:`stack`,htmlFor:d,children:[(0,j.jsx)(`span`,{children:TR.build}),(0,j.jsx)(`span`,{className:`muted`,id:`${d}-hint`,children:TR.buildHint})]}),(0,j.jsx)(`input`,{id:d,className:`field mono`,value:i,maxLength:500,"aria-describedby":`${d}-hint`,"aria-invalid":l||u||void 0,onChange:e=>a(e.target.value)}),l&&(0,j.jsx)(`p`,{role:`alert`,style:{margin:0},children:TR.buildOneLine}),(0,j.jsx)(`div`,{className:`row`,style:{gap:8},children:(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:c.busy||l||u,children:TR.save})})]}),(0,j.jsx)(Wn,{note:c.note})]})}function AR({r:e,onChanged:t}){let[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(e.defaultBranch),[o,s]=(0,v.useState)(e.branches.join(`
|
|
49
|
+
`)),[c,l]=(0,v.useState)({defaultBranch:e.defaultBranch,branches:e.branches}),[u,d]=(0,v.useState)(),f=Vn(),p=sn(),m=Vn(),h=e.remoteDefault&&e.remoteDefault!==e.defaultBranch;return(0,j.jsxs)(`article`,{className:`list-row`,style:{display:`block`},"aria-labelledby":`repo-${e.id}`,children:[(0,j.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`,gap:8},children:[(0,j.jsx)(`h3`,{id:`repo-${e.id}`,className:`h`,style:{fontSize:14,margin:0},children:e.id}),(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:TR.typeOwner(e.type,e.owner)})]}),(0,j.jsx)(OR,{r:e,onChanged:t}),(0,j.jsx)(wR,{repo:e.id,type:e.type,...t?{onChanged:t}:{}}),(0,j.jsxs)(`dl`,{className:`run-facts`,style:{margin:`8px 0`},children:[(0,j.jsx)(`dt`,{children:TR.url}),(0,j.jsx)(`dd`,{className:`mono`,style:{wordBreak:`break-all`},children:e.url}),(0,j.jsx)(`dt`,{children:TR.defaultBranch}),(0,j.jsxs)(`dd`,{children:[(0,j.jsx)(`span`,{className:`mono`,children:e.defaultBranch}),e.commit&&(0,j.jsx)(`span`,{className:`muted`,children:` · ${TR.atCommit(e.commit.slice(0,7))}`}),h&&(0,j.jsx)(`span`,{className:`chip warn`,style:{marginLeft:6},children:TR.remoteSays(e.remoteDefault)})]}),(0,j.jsx)(`dt`,{children:TR.branches}),(0,j.jsx)(`dd`,{children:e.branches.length?e.branches.join(`, `):TR.noBranches})]}),(0,j.jsx)(kR,{r:e,onChanged:t}),e.scans.length>0&&(0,j.jsx)(`ul`,{style:{margin:`0 0 8px`,paddingLeft:18,fontSize:12.5},children:e.scans.map(e=>(0,j.jsx)(`li`,{children:TR.scanned(e.branch,e.scannedAt.slice(0,10),e.commit.slice(0,7))},e.branch))}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:6,flexWrap:`wrap`},children:[e.branches.map(t=>(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:f.busy,onClick:()=>void f.run(async()=>{let n=await N(`/api/scan`,{method:`POST`,body:{repos:[e.id],ref:t}});n?.jobId&&p?.show(n.jobId)},TR.scanStarted(t)),children:TR.scan(t)},`scan-${t}`)),e.scans.map(t=>(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:f.busy,onClick:()=>void f.run(async()=>{d(await N(`/api/repos/compare?branch=${encodeURIComponent(t.branch)}`))},TR.comparedNow),children:TR.compare(t.branch,e.defaultBranch)},`cmp-${t.branch}`)),(0,j.jsx)(`button`,{type:`button`,className:`btn`,"aria-expanded":n,"aria-label":TR.editFor(e.id),onClick:()=>{n||(a(e.defaultBranch),s(e.branches.join(`
|
|
50
|
+
`)),l({defaultBranch:e.defaultBranch,branches:e.branches})),r(!n)},children:TR.edit})]}),(0,j.jsx)(Wn,{note:f.note}),u&&(0,j.jsx)(DR,{c:u}),n&&(0,j.jsxs)(`form`,{className:`stack`,style:{marginTop:8},onSubmit:n=>{n.preventDefault(),m.run(async()=>{let n=await N(`/api/repos/${e.id}/branches`,{method:`PUT`,body:{defaultBranch:i,branches:ER(o),was:c}});return l({defaultBranch:i.trim()||c.defaultBranch,branches:ER(o)}),t?.(),n},TR.saved)},children:[(0,j.jsxs)(`label`,{className:`row`,style:{gap:8},children:[(0,j.jsx)(`span`,{style:{minWidth:140},children:TR.defaultBranch}),(0,j.jsx)(`input`,{id:`repo-${e.id}-default`,className:`field mono`,value:i,onChange:e=>a(e.target.value)})]}),(0,j.jsxs)(`label`,{className:`stack`,htmlFor:`repo-${e.id}-branches`,children:[(0,j.jsx)(`span`,{children:TR.branches}),(0,j.jsx)(`span`,{className:`muted`,children:TR.branchesHint})]}),(0,j.jsx)(`textarea`,{id:`repo-${e.id}-branches`,className:`field mono`,rows:3,value:o,onChange:e=>s(e.target.value)}),(0,j.jsx)(`div`,{className:`row`,style:{gap:8},children:(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:m.busy,children:TR.save})}),(0,j.jsx)(Wn,{note:m.note})]})]})}function jR(){let e=P(`/api/repos/branches`);return lt(e),(0,j.jsxs)(`div`,{className:`stack`,style:{gap:12},children:[(0,j.jsx)(SR,{onAdded:e.reload}),(0,j.jsxs)(F,{title:TR.title,children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:`0 0 8px`,maxWidth:`70ch`},children:TR.intro}),(0,j.jsx)(I,{of:e,empty:e=>e.repos.length===0,emptyText:TR.empty,children:t=>(0,j.jsx)(`div`,{className:`stack`,style:{gap:8},children:t.repos.map(t=>(0,j.jsx)(AR,{r:t,onChanged:e.reload},t.id))})})]})]})}var X=w.serviceDesk,MR={"to-file":{label:X.toFile2,cls:`warn`},waiting:{label:X.waitingForYou,cls:`ai`},filed:{label:X.filedChip,cls:`done`}},NR=e=>`${e.change}|${e.heading}`;function PR({done:e}){let t=P(`/api/changes`),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(!1),o=ar();return(0,j.jsx)(I,{of:t,empty:e=>e.length===0,emptyText:X.noChangesToDraft,children:t=>(0,j.jsxs)(`form`,{className:`stack`,onSubmit:r=>{r.preventDefault();let a=n||t[0].id;o.run(()=>N(`/api/service-desk/${a}/draft`,{method:`POST`,body:i?{force:!0}:{}}).then(t=>(e(),t)).catch(ir(w.app.forceSnow)),e=>e.lines.join(`
|
|
51
|
+
`)||X.drafted)},children:[(0,j.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,alignItems:`flex-end`},children:[(0,j.jsxs)(`label`,{className:`run-label`,htmlFor:`draft-change`,children:[X.draftTheRequestsA,(0,j.jsx)(`select`,{id:`draft-change`,className:`run-select`,value:n||t[0].id,onChange:e=>r(e.target.value),children:t.map(e=>(0,j.jsxs)(`option`,{value:e.id,children:[e.id,` (`,e.state,`)`]},e.id))})]}),(0,j.jsxs)(`label`,{className:`row`,style:{gap:6,fontSize:12.5},htmlFor:`draft-force`,children:[(0,j.jsx)(`input`,{id:`draft-force`,type:`checkbox`,checked:i,onChange:e=>a(e.target.checked)}),X.replaceASnowMd]}),(0,j.jsx)(`button`,{type:`submit`,className:`btn`,disabled:o.busy,children:X.draftFromTheOrg})]}),(0,j.jsx)(or,{note:o.note})]})})}function FR({r:e,done:t}){let[n,r]=(0,v.useState)({}),[i,a]=(0,v.useState)(!1),o=ar(),s=(0,v.useId)();if(!e.missing.length&&!i)return null;let c=Object.fromEntries(e.missing.flatMap(e=>n[e]?.trim()?[[e,n[e].trim()]]:[]));return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[e.missing.length>0&&(0,j.jsxs)(`form`,{className:`stack`,style:{gap:8},"aria-labelledby":`${s}-title`,onSubmit:n=>{n.preventDefault(),!Object.keys(c).length||!e.sha256?o.run(()=>Promise.reject(Error(X.fillSomething)),``):o.run(async()=>{let n=await N(`/api/service-desk/${encodeURIComponent(e.change)}/fields`,{method:`PUT`,body:{heading:e.heading,baseSha256:e.sha256,values:c}});return a(!0),r({}),t(),n},e=>e.lines.join(`
|
|
52
|
+
`)||X.fillDone)},children:[(0,j.jsx)(`span`,{id:`${s}-title`,className:`hud`,style:{fontSize:10},children:X.fillTitle}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:X.fillHelp(e.file??`snow.md`)}),e.missing.map((e,t)=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`label`,{htmlFor:`${s}-f${t}`,className:`hud`,style:{fontSize:10},children:X.fillField(e)}),(0,j.jsx)(`input`,{id:`${s}-f${t}`,className:`field`,required:!0,"aria-required":`true`,disabled:o.busy,value:n[e]??``,onChange:t=>{let n=t.target.value;r(t=>({...t,[e]:n}))}})]},e)),(0,j.jsx)(`div`,{className:`row`,children:(0,j.jsx)(`button`,{type:`submit`,className:`btn`,disabled:o.busy,children:o.busy?X.fillSaving:X.fillSave})})]}),(0,j.jsx)(or,{note:o.note}),i&&(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:X.fillPropose}),(0,j.jsx)(Yc,{scope:`service-desk`})]})]})}function IR({r:e,done:t}){let n=ar(),r=e.fields.map(e=>`${e.name}: ${e.value}`).join(`
|
|
53
|
+
`);return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:12},children:[(0,j.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,gap:6},children:[(0,j.jsx)(`span`,{className:`chip ${MR[e.state].cls}`,children:MR[e.state].label}),(0,j.jsx)(`a`,{className:`chip`,href:`#/changes/${e.change}`,children:e.change}),e.template?(0,j.jsx)(`span`,{className:`chip dim`,children:X.template(e.template)}):(0,j.jsx)(`span`,{className:`chip blocking`,children:X.noTemplateMatches})]}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:X.approversValuesComeFrom(e.leadTimeDays===void 0?``:X.leadTimeDays(e.leadTimeDays),e.approvers.join(`, `)||X.noneNamed)}),(0,j.jsxs)(`div`,{children:[(0,j.jsxs)(`div`,{className:`row between`,style:{marginBottom:4},children:[(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:X.fields}),(0,j.jsx)(sr,{text:r,label:X.copyAllFields})]}),e.fields.map(e=>(0,j.jsxs)(`div`,{className:`run-field`,children:[(0,j.jsxs)(`span`,{className:`hud`,style:{fontSize:10},children:[e.name,e.required?X.required:``]}),(0,j.jsx)(`span`,{className:`value ${e.value?``:`empty`}`,children:e.value||(e.required?X.missingFillItIn:X.empty)}),e.value?(0,j.jsx)(sr,{text:e.value,label:X.copy(e.name)}):(0,j.jsx)(`span`,{})]},e.name))]}),e.state===`to-file`&&(0,j.jsx)(FR,{r:e,done:t}),e.state===`to-file`&&(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:X.atticusNeverCallsThe}),(0,j.jsx)(`div`,{className:`row`,children:(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:n.busy||e.missing.length>0,title:e.missing.length?X.fillFirst(e.missing.join(`, `)):void 0,onClick:()=>void n.run(()=>N(`/api/service-desk/${e.change}/submit`,{method:`POST`,body:{}}).then(e=>(t(),e)),e=>e.lines.join(`
|
|
54
|
+
`)||X.filedAsAStep),children:X.fileSCompleteDrafts(e.change)})}),e.missing.length>0&&(0,j.jsx)(`p`,{className:`run-note bad`,children:X.fillInSnowMd(e.missing.join(`, `))})]}),e.state===`waiting`&&(0,j.jsxs)(`p`,{style:{margin:0,fontSize:12.5},children:[X.filedAsStep,(0,j.jsx)(`span`,{className:`mono`,children:e.step}),X.submitItInThe,(0,j.jsx)(`a`,{href:`#/todo`,children:X.recordTheRequestNumber}),`.`]}),e.state===`filed`&&(0,j.jsxs)(`p`,{className:`run-note ok`,children:[X.filedAs(e.number??``),e.url?(0,j.jsxs)(j.Fragment,{children:[` `,`(`,(0,j.jsx)(Pt,{href:e.url,children:X.open}),`)`]}):null,`.`]}),(0,j.jsx)(or,{note:n.note})]})}function LR({hash:e=``}){let t=P(`/api/service-desk`),[n,r]=(0,v.useState)(`all`),i=YL(e),[a,o]=(0,v.useState)();St(e=>{e.type===`file.changed`&&t.reload()});let s=(t.state===`ready`?t.data.requests:[]).filter(e=>!i||e.change===i),c=s.filter(e=>n===`all`||e.state===n),l=c.find(e=>NR(e)===a)??c[0],u=e=>s.filter(t=>t.state===e).length;return(0,j.jsxs)(j.Fragment,{children:[i&&(0,j.jsxs)(`p`,{className:`ev-say`,style:{margin:0},children:[X.ofChange(i),` `,(0,j.jsx)(`a`,{href:`#/service-desk`,children:X.showAll})]}),(0,j.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`},children:[(0,j.jsx)(`p`,{className:`n`,style:{margin:0,fontSize:24},children:t.state===`ready`?u(`to-file`)?X.toFile(pr(u(`to-file`),X.requestWord)):X.nothingToFile:X.serviceDeskQueue}),(0,j.jsx)(lr,{label:X.show,value:n,onChange:r,options:[{value:`all`,label:X.filters.all(s.length)},{value:`to-file`,label:X.filters[`to-file`](u(`to-file`))},{value:`waiting`,label:X.filters.waiting(u(`waiting`))},{value:`filed`,label:X.filters.filed(u(`filed`))}]})]}),(0,j.jsxs)(`p`,{className:`muted`,style:{margin:0},children:[X.draftsOnlyYouFile,(0,j.jsx)(`a`,{href:`#/release`,children:X.releasePlan}),`.`]}),(0,j.jsxs)(`div`,{className:`bento`,children:[(0,j.jsx)(F,{title:X.queue,span:`span 4`,children:(0,j.jsx)(I,{of:t,empty:()=>s.length===0,emptyText:X.noDraftsYet,children:()=>(0,j.jsx)(Lt,{title:X.requests,parts:[{label:X.toFile3,value:u(`to-file`),color:`var(--amber)`},{label:X.waitingForYou2,value:u(`waiting`),color:`var(--violet)`},{label:X.filed,value:u(`filed`),color:`var(--green)`}]})})}),(0,j.jsx)(F,{title:X.serviceDeskAdapter,span:`span 4`,children:(0,j.jsx)(I,{of:t,children:e=>(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsx)(`div`,{className:`row`,children:(0,j.jsx)(ur,{type:e.adapter.configured})}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:X.writesFromTheApp}),(0,j.jsx)(`p`,{style:{margin:0,fontSize:12.5},children:X.inTheOrgPack(e.exports.files.length?X.from(pr(e.exports.requests,X.pastRequest),pr(e.exports.files.length,X.exportWord)):X.noDeskExportLoaded,pr(e.templates.length,X.requestTemplate))})]})})}),(0,j.jsx)(F,{title:X.localAutomationTool,span:`span 4`,children:(0,j.jsx)(I,{of:t,children:e=>(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsx)(`div`,{className:`row`,style:{flexWrap:`wrap`,gap:6},children:e.executors.length?e.executors.map(e=>(0,j.jsx)(`span`,{className:`chip ai`,children:X.approveEachWrite(e)},e)):(0,j.jsx)(`span`,{className:`chip dim`,children:X.noneAllowedHere})}),(0,j.jsxs)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:[X.calledThroughTheCommon,(0,j.jsx)(`a`,{href:`#/todo`,children:X.toDo}),X.noCredentialsPassTo,(0,j.jsx)(`a`,{href:`#/settings`,children:X.executorsAllowList})]})]})})}),(0,j.jsx)(F,{title:X.requests,meta:c.length,span:`span 4`,rows:`span 2`,children:(0,j.jsx)(I,{of:t,empty:()=>c.length===0,emptyText:s.length?X.noneInThisView:X.noServiceDeskDrafts,children:()=>(0,j.jsx)(`nav`,{"aria-label":X.requests,className:`stack`,style:{gap:2},children:Object.entries(c.reduce((e,t)=>((e[t.requestType]??=[]).push(t),e),{})).map(([e,t])=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10,marginTop:6},children:e}),t.map(e=>(0,j.jsxs)(`button`,{type:`button`,className:`run-pick`,"aria-current":l&&NR(l)===NR(e)?`true`:void 0,onClick:()=>o(NR(e)),children:[(0,j.jsxs)(`span`,{className:`stack`,style:{gap:2,minWidth:0},children:[(0,j.jsx)(`span`,{style:{fontSize:12.5},children:e.record||e.heading}),(0,j.jsxs)(`span`,{className:`hud`,style:{fontSize:9.5},children:[e.change,e.missing.length?X.toFill(e.missing.length):``]})]}),(0,j.jsx)(`span`,{className:`chip ${MR[e.state].cls}`,children:MR[e.state].label})]},NR(e)))]},e))})})}),(0,j.jsx)(F,{title:l?l.heading:X.noRequestSelected,span:`span 8`,kind:`hero`,children:(0,j.jsx)(I,{of:t,empty:()=>!l,emptyText:X.pickARequestOn,children:()=>(0,j.jsx)(IR,{r:l,done:()=>t.reload()},NR(l))})}),(0,j.jsx)(F,{title:X.draftRequests,span:`span 8`,children:(0,j.jsx)(PR,{done:()=>t.reload()})})]})]})}var RR=w.setup;function zR(e){if(/^(true|True|TRUE)$/.test(e))return!0;if(/^(false|False|FALSE)$/.test(e))return!1;if(/^[-+]?(\d[\d_]*)(\.\d+)?([eE][-+]?\d+)?$/.test(e)&&Number.isFinite(Number(e)))return Number(e);if(/^"(?:[^"\\]|\\.)*"$/.test(e))try{return JSON.parse(e)}catch{return e}return/^'(?:[^']|'')*'$/.test(e)?e.slice(1,-1).replace(/''/g,`'`):e}function BR(e){if(!/^\[.*\]$/.test(e))return;let t=e.slice(1,-1).trim();if(!t)return[];let n=[],r=``,i;for(let e=0;e<t.length;e++){let a=t[e];i?(r+=a,a===`\\`&&i===`"`?r+=t[++e]??``:a===i&&(i=void 0)):a===`"`||a===`'`?(i=a,r+=a):a===`,`?(n.push(r.trim()),r=``):r+=a}if(!i)return n.push(r.trim()),n.some(e=>!e||/^[[{]/.test(e))?void 0:n}function VR(e){let t=e.trim(),n=BR(t);return n?n.map(e=>String(zR(e))):zR(t)}function HR(e){let t=e=>typeof e!=`string`||VR(e)===e&&!/^\s|\s$|[#,[\]{}"']|: /.test(e)?String(e):JSON.stringify(e);return Array.isArray(e)?`[${e.map(t).join(`, `)}]`:t(e)}function UR(e){let t={},n=[];for(let r of e.split(/\r?\n/)){let e=r.trim();if(!e)continue;let i=/^([A-Za-z_][\w.-]*)\s*:\s*(.+)$/.exec(e);i?t[i[1]]=VR(i[2].trim()):n.push(e)}return{settings:t,bad:n}}var WR=e=>Array.isArray(e)?e.join(`
|
|
55
|
+
`):e===void 0?``:String(e);function GR(e,t,n,r,i={}){if(!t)return null;let a={...UR(r).settings};for(let t of e.fields){let e=n[t.name]??``,r=e.trim();if(!r)continue;let o=i[t.name];o!==void 0&&e===WR(o)?a[t.name]=o:a[t.name]=t.list?r.split(/[\r\n,]+/).map(e=>e.trim()).filter(Boolean):r}return{type:t,settings:a}}function KR(e){let t=e.current,n=new Set(e.fields.map(e=>e.name));return{type:t?.type??``,fields:Object.fromEntries(e.fields.map(e=>[e.name,WR(t?.settings[e.name])])),more:Object.entries(t?.settings??{}).filter(([e])=>!n.has(e)).map(([e,t])=>`${e}: ${HR(t)}`).join(`
|
|
56
|
+
`)}}var qR=(e,t,n)=>{let r=GR(e,t.type,t.fields,t.more,n);return JSON.stringify(r&&{type:r.type,settings:Object.fromEntries(Object.entries(r.settings).sort())})};function JR({kind:e,sha256:t,onWritten:n}){let r=e.current,i=KR(e),[a,o]=(0,v.useState)(i),[s,c]=(0,v.useState)({sha256:t,texts:i,was:r?.settings??{}}),[l,u]=(0,v.useState)(0),d=()=>{o(i),c({sha256:t,texts:i,was:r?.settings??{}})};s.sha256!==t&&(qR(e,a,s.was)===qR(e,s.texts,s.was)||qR(e,a,s.was)===qR(e,i,r?.settings??{}))&&d();let f=s.sha256!==t,{type:p,fields:m,more:h}=a,g=RR.kinds[e.kind]??e.kind,_=`adapter-${e.kind}`,y=r&&!e.types.includes(r.type)?[...e.types,r.type]:e.types,b=UR(h).bad,x=()=>u(l+1),S=e=>o({...a,type:e}),C=e=>o({...a,fields:e}),w=e=>o({...a,more:e}),T=t=>N(`/api/setup/adapters/${e.kind}`,{method:`PUT`,body:{value:GR(e,p,m,h,s.was),baseSha256:s.sha256,...t?{preview:!0}:{}}});return(0,j.jsxs)(`details`,{open:e.kind===`gitHost`,className:`list-row`,style:{display:`block`},children:[(0,j.jsxs)(`summary`,{children:[(0,j.jsx)(`span`,{style:{fontSize:13},children:g}),` `,(0,j.jsx)(`span`,{className:`chip dim`,children:r?RR.types[r.type]??r.type:RR.notSet})]}),(0,j.jsxs)(`fieldset`,{className:`stack`,style:{gap:6,border:0,padding:`8px 0 0`,margin:0},children:[(0,j.jsx)(`legend`,{className:`sr`,children:RR.kindFor(g)}),(0,j.jsx)(`label`,{htmlFor:`${_}-type`,children:RR.typeOf(g)}),(0,j.jsxs)(`select`,{id:`${_}-type`,className:`field`,value:p,onChange:e=>{S(e.target.value),x()},children:[(0,j.jsx)(`option`,{value:``,children:RR.notSet}),y.map(e=>(0,j.jsx)(`option`,{value:e,children:RR.types[e]??e},e))]}),p&&p!==`manual`&&p!==`mock`&&(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:RR.live(RR.types[p]??p)}),p&&e.fields.map(e=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`label`,{htmlFor:`${_}-${e.name}`,children:RR.fields[e.name]??e.name}),e.list?(0,j.jsx)(`textarea`,{id:`${_}-${e.name}`,className:`field mono`,rows:2,value:m[e.name]??``,"aria-describedby":RR.fieldHints[e.name]?`${_}-${e.name}-hint`:void 0,onChange:t=>{C({...m,[e.name]:t.target.value}),x()}}):(0,j.jsx)(`input`,{id:`${_}-${e.name}`,className:`field mono`,value:m[e.name]??``,"aria-describedby":RR.fieldHints[e.name]?`${_}-${e.name}-hint`:void 0,onChange:t=>{C({...m,[e.name]:t.target.value}),x()}}),RR.fieldHints[e.name]&&(0,j.jsx)(`span`,{id:`${_}-${e.name}-hint`,className:`muted`,style:{fontSize:12},children:RR.fieldHints[e.name]})]},e.name)),p&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`label`,{htmlFor:`${_}-more`,children:RR.more}),(0,j.jsx)(`textarea`,{id:`${_}-more`,className:`field mono`,rows:2,value:h,"aria-describedby":`${_}-more-hint`,onChange:e=>{w(e.target.value),x()}}),(0,j.jsx)(`span`,{id:`${_}-more-hint`,className:`muted`,style:{fontSize:12},children:b.length?b.map(RR.badLine).join(` `):RR.moreHint})]}),f&&(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`p`,{className:`run-note bad`,role:`status`,style:{margin:0},children:RR.adapterChanged(g)}),(0,j.jsx)(`div`,{className:`row`,children:(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>{d(),x()},children:RR.adapterReload})})]}),(0,j.jsx)(ku,{disabled:b.length>0||!p&&!r,label:!p&&r?RR.takeOut:void 0,preview:()=>T(!0),write:()=>T(!1),onWritten:n},l)]})]})}function YR({span:e}){let t=P(`/api/setup/adapters`);return lt(t),(0,j.jsx)(F,{title:RR.adaptersTitle,meta:t.state===`ready`?t.data.path:void 0,span:e??`span 12`,children:(0,j.jsx)(I,{of:t,children:e=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,maxWidth:`75ch`,fontSize:12.5},children:RR.adaptersIntro}),e.problems.map(e=>(0,j.jsx)(`p`,{className:`run-note bad`,children:e},e)),e.kinds.map(t=>(0,j.jsx)(JR,{kind:t,sha256:e.sha256,onWritten:()=>void 0},t.kind)),(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`h4`,{className:`hud`,style:{margin:0,fontSize:11},children:RR.secretTitle}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5,maxWidth:`75ch`},children:RR.secretWhy}),(0,j.jsxs)(`div`,{className:`work-cmd`,children:[(0,j.jsx)(`code`,{className:`mono`,children:RR.secretCommand}),(0,j.jsx)(sr,{text:RR.secretCommand,label:w.decisions.copy(RR.secretCommand)})]})]})]})})})}var XR=w.aiSettings;function ZR(e){let t=e.minPrecision.trim(),n=/^\d{1,3}$/.test(t)?Number(t):NaN;return!Number.isInteger(n)||n<0||n>100?{error:XR.badMinPrecision}:{links:e.links,questions:e.questions,minPrecision:n/100}}var QR=e=>e.split(/\r?\n/).map(e=>e.trim()).filter(Boolean);function $R(e){let t=/^\d+$/.test(e.defaultTokens.trim())?Number(e.defaultTokens.trim()):NaN;if(!Number.isSafeInteger(t)||t<=0)return{error:XR.badDefaultTokens};let n={};for(let t of QR(e.perAgent)){let e=/^([a-z0-9][a-z0-9-]*)\s*:\s*(\d+)$/.exec(t);if(!e||Number(e[2])<=0)return{error:XR.badBudgetLine(t)};n[e[1]]=Number(e[2])}return{models:{allowed:QR(e.models),recommended:e.recommended},budgets:{defaultTokens:t,perAgent:n}}}var ez=[`hand-off`,`model`,`headless-claude-code`,`copilot-acp`],tz=[`on`,`text-only`,`off`];function nz(e,t){let n=e.limits?$R(e.limits):void 0;if(n&&`error`in n)throw Error(n.error);let r=e.decide?ZR(e.decide):void 0;if(r&&`error`in r)throw Error(r.error);let i=!r||t?.decide!==void 0&&t.decide.links===r.links&&t.decide.questions===r.questions&&Math.abs(t.decide.minPrecision-r.minPrecision)<1e-9;return{...n??{},...i?{}:{decide:r},ai:e.ai,modes:e.modes,assistants:e.assistants,model:e.provider?{type:e.provider,settings:Object.fromEntries(Object.entries(e.settings).filter(([,e])=>e.trim()!==``))}:null}}var rz=e=>({ai:e.ai,modes:e.modes,assistants:{allowed:e.assistants.filter(e=>e.allowed).map(e=>e.id),default:e.assistants.find(e=>e.default)?.id??e.assistants[0]?.id??`copilot`},provider:e.model?.type??``,settings:Object.fromEntries(Object.entries(e.model?.settings??{}).map(([e,t])=>[e,String(t)])),...e.decide?{decide:{links:e.decide.links,questions:e.decide.questions,minPrecision:String(Math.round(e.decide.minPrecision*100))}}:{},limits:{models:e.models.allowed.join(`
|
|
57
|
+
`),recommended:e.models.recommended,defaultTokens:String(e.budgets.defaultTokens),perAgent:Object.entries(e.budgets.perAgent).map(([e,t])=>`${e}: ${t}`).join(`
|
|
58
|
+
`)}}),iz=(e,t,n)=>n?[...new Set([...e,t])]:e.filter(e=>e!==t);function az(e){let[t,n]=(0,v.useState)(()=>rz(e.data)),r=JSON.stringify(rz(e.data)),[i,a]=(0,v.useState)(r),o=(0,v.useRef)(void 0),s=JSON.stringify(t)!==i;(0,v.useEffect)(()=>{let c=o.current;o.current=void 0,r!==i&&(!s||c!==void 0&&c===JSON.stringify(t))&&(n(rz(e.data)),a(r))},[r]);let c=r!==i&&s,l=()=>{n(rz(e.data)),a(r)},u=ar(),d=ar(),f=ar(),[p,m]=(0,v.useState)(``),h=e.data.providers.find(e=>e.type===t.provider)?.settings??[],g=t.settings.keyEnv?.trim(),_=e.data.model?.type;return(0,j.jsxs)(`form`,{className:`stack`,onSubmit:n=>{n.preventDefault();let r=JSON.stringify(t);u.run(async()=>{let n=nz(t,e.data),i=n.model?await Jn(`ai-model`,`model`):{};await N(`/api/settings/ai`,{method:`PUT`,body:{...n,...i}}),o.current=r,e.onSaved?.()},XR.saved(e.data.path))},children:[(0,j.jsx)(`h2`,{className:`h`,children:XR.title}),c&&(0,j.jsxs)(`p`,{role:`alert`,className:`state error`,children:[XR.changedOnDisk,` `,(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:l,children:XR.takeDisk})]}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,maxWidth:`70ch`},children:XR.intro}),(0,j.jsxs)(`fieldset`,{className:`stack`,children:[(0,j.jsx)(`legend`,{className:`hud`,children:XR.aiLabel}),tz.map(e=>(0,j.jsxs)(`label`,{className:`row`,style:{gap:8},children:[(0,j.jsx)(`input`,{type:`radio`,id:`ai-on-${e}`,name:`ai`,checked:t.ai===e,onChange:()=>n({...t,ai:e})}),XR.ai[e]]},e))]}),(0,j.jsxs)(`fieldset`,{className:`stack`,children:[(0,j.jsx)(`legend`,{className:`hud`,children:XR.assistantsLabel}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:XR.assistantsHint}),e.data.assistants.map(e=>(0,j.jsxs)(`label`,{className:`row`,style:{gap:8},children:[(0,j.jsx)(`input`,{type:`checkbox`,id:`ai-assistant-${e.id}`,checked:t.assistants.allowed.includes(e.id),onChange:r=>n({...t,assistants:{...t.assistants,allowed:iz(t.assistants.allowed,e.id,r.target.checked)}})}),e.name]},e.id)),(0,j.jsxs)(`label`,{className:`row`,style:{gap:8},children:[XR.defaultAssistant,(0,j.jsx)(`select`,{id:`ai-default-assistant`,className:`field`,value:t.assistants.default,onChange:e=>n({...t,assistants:{...t.assistants,default:e.target.value}}),children:e.data.assistants.filter(e=>t.assistants.allowed.includes(e.id)).map(e=>(0,j.jsx)(`option`,{value:e.id,children:e.name},e.id))})]})]}),(0,j.jsxs)(`fieldset`,{className:`stack`,children:[(0,j.jsx)(`legend`,{className:`hud`,children:XR.modesLabel}),ez.map(e=>(0,j.jsxs)(`label`,{className:`row`,style:{gap:8},children:[(0,j.jsx)(`input`,{type:`checkbox`,id:`ai-mode-${e}`,checked:t.modes.allowed.includes(e),onChange:r=>n({...t,modes:{...t.modes,allowed:iz(t.modes.allowed,e,r.target.checked)}})}),XR.modes[e]]},e)),(0,j.jsxs)(`label`,{className:`row`,style:{gap:8},children:[XR.defaultMode,(0,j.jsx)(`select`,{id:`ai-default-mode`,className:`field`,value:t.modes.default,onChange:e=>n({...t,modes:{...t.modes,default:e.target.value}}),children:t.modes.allowed.map(e=>(0,j.jsx)(`option`,{value:e,children:XR.modes[e]},e))})]})]}),(0,j.jsxs)(`fieldset`,{className:`stack`,children:[(0,j.jsx)(`legend`,{className:`hud`,children:XR.providerLabel}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:XR.providerHint}),(0,j.jsxs)(`select`,{id:`ai-provider`,className:`field`,"aria-label":XR.providerLabel,value:t.provider,onChange:e=>n({...t,provider:e.target.value}),children:[(0,j.jsx)(`option`,{value:``,children:XR.noProvider}),e.data.providers.map(e=>(0,j.jsx)(`option`,{value:e.type,children:e.plugin?XR.pluginProvider(e.type,!!e.pinned):e.type},e.type))]}),h.map(e=>(0,j.jsxs)(`label`,{className:`row`,style:{gap:8},children:[(0,j.jsx)(`span`,{className:`mono`,style:{minWidth:140},children:e}),(0,j.jsx)(`input`,{id:`ai-setting-${e}`,className:`field`,value:t.settings[e]??``,onChange:r=>n({...t,settings:{...t.settings,[e]:r.target.value}})})]},e)),g&&_===t.provider&&(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},role:`note`,children:e.data.keySet?XR.keySet(g):XR.keyNotSet(g)}),g&&(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`},children:[(0,j.jsx)(`label`,{htmlFor:`ai-key`,className:`mono`,children:XR.keyLabel(g)}),(0,j.jsx)(`input`,{id:`ai-key`,type:`password`,className:`field`,autoComplete:`off`,value:p,onChange:e=>m(e.target.value)}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:f.busy||!p.trim(),onClick:()=>void f.run(async()=>{await N(`/api/settings/ai/key`,{method:`POST`,body:{name:g,value:p}}),m(``),e.onSaved?.()},XR.keyKept(g)),children:XR.setKey})]}),(0,j.jsx)(or,{note:f.note})]}),t.decide&&(0,j.jsxs)(`fieldset`,{className:`stack`,"aria-describedby":`ai-decide-hint`,children:[(0,j.jsx)(`legend`,{className:`hud`,children:XR.decideLabel}),(0,j.jsx)(`p`,{id:`ai-decide-hint`,className:`muted`,style:{margin:0,maxWidth:`70ch`},children:XR.decideHint}),[`links`,`questions`].map(e=>(0,j.jsxs)(`label`,{className:`row`,style:{gap:8},children:[(0,j.jsx)(`span`,{style:{minWidth:220},children:e===`links`?XR.decideLinks:XR.decideQuestions}),(0,j.jsx)(`select`,{id:`ai-decide-${e}`,className:`field`,value:t.decide[e],onChange:r=>n({...t,decide:{...t.decide,[e]:r.target.value}}),children:[`propose`,`auto`].map(e=>(0,j.jsx)(`option`,{value:e,children:XR.decideMode[e]},e))})]},e)),(0,j.jsxs)(`label`,{className:`row`,style:{gap:8},htmlFor:`ai-decide-precision`,children:[(0,j.jsx)(`span`,{style:{minWidth:220},children:XR.minPrecisionLabel}),(0,j.jsx)(`input`,{id:`ai-decide-precision`,className:`field mono`,inputMode:`numeric`,"aria-describedby":`ai-decide-precision-hint`,value:t.decide.minPrecision,onChange:e=>n({...t,decide:{...t.decide,minPrecision:e.target.value}})})]}),(0,j.jsx)(`span`,{id:`ai-decide-precision-hint`,className:`muted`,style:{fontSize:12},children:XR.minPrecisionHint})]}),t.limits&&(0,j.jsxs)(`fieldset`,{className:`stack`,children:[(0,j.jsx)(`legend`,{className:`hud`,children:XR.budgetsLabel}),(0,j.jsxs)(`label`,{className:`stack`,htmlFor:`ai-models`,children:[(0,j.jsx)(`span`,{children:XR.modelsLabel}),(0,j.jsx)(`span`,{className:`muted`,children:XR.modelsHint})]}),(0,j.jsx)(`textarea`,{id:`ai-models`,className:`field mono`,rows:3,value:t.limits.models,onChange:e=>n({...t,limits:{...t.limits,models:e.target.value}})}),(0,j.jsxs)(`label`,{className:`row`,style:{gap:8},children:[(0,j.jsx)(`span`,{style:{minWidth:140},children:XR.defaultTokensLabel}),(0,j.jsx)(`input`,{id:`ai-default-tokens`,className:`field mono`,inputMode:`numeric`,value:t.limits.defaultTokens,onChange:e=>n({...t,limits:{...t.limits,defaultTokens:e.target.value}})})]}),(0,j.jsxs)(`label`,{className:`stack`,htmlFor:`ai-per-agent`,children:[(0,j.jsx)(`span`,{children:XR.perAgentLabel}),(0,j.jsx)(`span`,{className:`muted`,children:XR.perAgentHint})]}),(0,j.jsx)(`textarea`,{id:`ai-per-agent`,className:`field mono`,rows:3,value:t.limits.perAgent,onChange:e=>n({...t,limits:{...t.limits,perAgent:e.target.value}})})]}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:10,flexWrap:`wrap`},children:[(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:u.busy,children:XR.save}),_&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:d.busy,onClick:()=>void d.run(async()=>N(`/api/settings/ai/test`,{method:`POST`,body:await Jn(`ai-test`,`model`)}).then(e=>{if(!e.ok)throw Error(XR.notAnswered(e.error??``));return e}),e=>{let t=e;return XR.answered(t.model??_,t.ms??0)}),children:XR.test}),(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:XR.saveNote(e.data.path)})]}),(0,j.jsx)(or,{note:u.note}),u.note?.ok&&!u.note.working&&(0,j.jsx)(Yc,{scope:`org-pack`}),(0,j.jsx)(or,{note:d.note})]})}function oz(){let e=P(`/api/settings/ai`);return lt(e),(0,j.jsxs)(`div`,{className:`bento`,children:[(0,j.jsx)(`div`,{style:{gridColumn:`1 / -1`},children:(0,j.jsx)(_r,{only:`runtime-`})}),(0,j.jsx)(`section`,{className:`panel`,style:{gridColumn:`1 / -1`},"aria-label":XR.title,children:(0,j.jsx)(I,{of:e,children:t=>(0,j.jsx)(az,{data:t,onSaved:e.reload})})}),(0,j.jsx)(YR,{span:`1 / -1`})]})}var sz=[`ide`,`classic`],cz=`atticus.layout`,lz=`atticus.shell.side`,uz=`atticus.shell.bottom`,dz=`atticus:layout`;function fz(){try{return globalThis.localStorage}catch{return}}function pz(e,t){try{return t?.getItem(e)??void 0}catch{return}}function mz(e,t,n){try{n?.setItem(e,t)}catch{}}function hz(e=fz()){return pz(`atticus.layout`,e)===`classic`?`classic`:`ide`}function gz(e,t=fz()){mz(cz,e,t);try{globalThis.dispatchEvent?.(new CustomEvent(dz,{detail:e}))}catch{}}function _z(){let[e,t]=(0,v.useState)(()=>hz());return(0,v.useEffect)(()=>{let e=e=>t(e.detail);return addEventListener(dz,e),()=>removeEventListener(dz,e)},[]),[e,gz]}function vz(e){let t=e.activeElement;t&&t!==e.body&&t.isConnected!==!1||(e.querySelector(`input[name="layout"]:checked`)??e.getElementById(`main`))?.focus()}var yz=e=>Math.round(Math.min(480,Math.max(180,Number.isFinite(e)?e:260)));function bz(e=fz()){let t=pz(lz,e);try{let e=t?JSON.parse(t):{};return{width:yz(typeof e.width==`number`?e.width:260),hidden:e.hidden===!0}}catch{return{width:260,hidden:!1}}}function xz(e,t=fz()){mz(lz,JSON.stringify({width:yz(e.width),hidden:e.hidden}),t)}function Sz(e=fz()){let t=pz(uz,e);return t===`open`||t!==`closed`&&void 0}function Cz(e,t=fz()){mz(uz,e?`open`:`closed`,t)}var wz=w.ide.layout,Tz={ide:{name:wz.ide,what:wz.ideWhat},classic:{name:wz.classic,what:wz.classicWhat}};function Ez(){let[e,t]=_z();return(0,j.jsx)(F,{title:wz.title,meta:wz.meta,span:`span 12`,children:(0,j.jsxs)(`fieldset`,{className:`stack`,style:{gap:8,border:0,margin:0,padding:0},children:[(0,j.jsx)(`legend`,{className:`sr`,children:wz.legend}),sz.map(n=>(0,j.jsxs)(`label`,{className:`row`,style:{gap:8,alignItems:`flex-start`},children:[(0,j.jsx)(`input`,{type:`radio`,name:`layout`,value:n,checked:e===n,onChange:()=>t(n)}),(0,j.jsxs)(`span`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`span`,{style:{fontSize:13},children:Tz[n].name}),(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:Tz[n].what})]})]},n)),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:wz.kept})]})})}var Z=w.settings,Dz=[{id:`hand-off`,name:Z.handOff,what:Z.yourOwnAssistantCopilot},{id:`model`,name:Z.model,what:Z.directModelAccessThrough},{id:`headless-claude-code`,name:Z.headlessClaudeCode,what:Z.claudeCodeRunsA}],Oz={workTracker:Z.workTracker,serviceDesk:Z.serviceDesk,gitHost:Z.gitHost,wiki:Z.wiki,notify:Z.notifications,design:Z.designTool,model:Z.modelProvider},kz={live:{cls:`done`,label:Z.connectedChip,what:Z.liveFallsBackTo},manual:{cls:`warn`,label:Z.manualChip,what:Z.writesBecomeStepsIn},mock:{cls:`dim`,label:Z.mockChip,what:Z.inMemoryForTests},"not-set":{cls:`dim`,label:Z.notSet,what:Z.notConfigured}},Az={on:{label:Z.onChip,what:Z.everyAiStepMay},"text-only":{label:Z.textOnly,what:Z.noAiStepIs},off:{label:Z.offChip,what:Z.noAiStepRuns}};function jz(){let[e,t]=(0,v.useState)(0),n=P(`/api/doctor${e?`?fresh=1&n=${e}`:``}`,{view:`/api/doctor`}),r={ok:`done`,warn:`warn`,fail:`blocking`};return(0,j.jsx)(F,{title:Z.thisMachine,meta:n.state===`ready`?n.data.ok?Z.ready:Z.needsFixing:void 0,span:`span 12`,children:(0,j.jsx)(I,{of:n,empty:e=>e.checks.length===0,emptyText:Z.noChecksRan,children:i=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[i.checks.map(e=>(0,j.jsxs)(`div`,{className:`row between`,style:{alignItems:`flex-start`,gap:10},children:[(0,j.jsxs)(`span`,{className:`stack`,style:{gap:2,minWidth:0},children:[(0,j.jsxs)(`span`,{style:{fontSize:12.5},children:[e.label,` `,(0,j.jsxs)(`span`,{className:`muted`,children:[`· `,e.detail]})]}),e.status!==`ok`&&e.fix&&(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:e.fix})]}),(0,j.jsx)(`span`,{className:`chip ${r[e.status]}`,children:e.status.toUpperCase()})]},e.id)),(0,j.jsxs)(`div`,{className:`row`,style:{gap:8},children:[(0,j.jsx)(Ft,{of:n,label:Z.checkAgain,run:()=>t(e+1)}),(0,j.jsxs)(`span`,{className:`muted`,style:{fontSize:12},children:[Z.theSameChecksAs,(0,j.jsx)(`code`,{className:`mono`,children:Z.atticusDoctor}),Z.nothingLeavesThisMachine]})]})]})})})}function Mz(){let{me:e,saveNotify:t,error:n,reload:r}=Zr(),[i,a]=(0,v.useState)(),[o,s]=(0,v.useState)(),c=ar(),l=i??e?.notify?.digest??`off`,u=o??e?.notify?.channel??``;return(0,j.jsx)(F,{title:Z.yourNotifications,meta:Z.atticusMeYaml,span:`span 12`,children:!e&&n?(0,j.jsx)(Mt,{error:n,retry:r}):e?(0,j.jsxs)(`form`,{className:`stack`,style:{gap:8},onSubmit:e=>{e.preventDefault(),c.run(()=>t({digest:l,...u.trim()?{channel:u.trim()}:{}}),Z.saved)},children:[(0,j.jsxs)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5,lineHeight:1.55},children:[Z.yourDigestListsThe,(0,j.jsx)(`code`,{className:`mono`,style:{whiteSpace:`nowrap`},children:Z.atticusDigestAsSend(e.user)}),`.`]}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`,alignItems:`flex-end`},children:[(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`label`,{htmlFor:`notify-digest`,className:`hud`,style:{fontSize:10},children:Z.howOften}),(0,j.jsxs)(`select`,{id:`notify-digest`,className:`field`,value:l,onChange:e=>a(e.target.value),children:[(0,j.jsx)(`option`,{value:`off`,children:Z.off}),(0,j.jsx)(`option`,{value:`daily`,children:Z.daily}),(0,j.jsx)(`option`,{value:`weekly`,children:Z.weekly})]})]}),(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4,flex:1,minWidth:180},children:[(0,j.jsx)(`label`,{htmlFor:`notify-channel`,className:`hud`,style:{fontSize:10},children:Z.whereItGoes}),(0,j.jsx)(`input`,{id:`notify-channel`,className:`field`,value:u,placeholder:Z.aDirectMessage(e.user),onChange:e=>s(e.target.value)})]}),(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:c.busy,children:Z.save})]}),(0,j.jsx)(or,{note:c.note})]}):(0,j.jsxs)(`div`,{className:`stack`,"aria-busy":`true`,children:[(0,j.jsx)(`span`,{className:`sr`,children:Z.loading}),(0,j.jsx)(`div`,{className:`skeleton`,style:{width:`70%`}})]})})}function Nz(){let e=P(`/api/settings`);lt(e);let t=Zr().me?.ai??`on`,n=ar();return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`},children:[(0,j.jsx)(`p`,{className:`n`,style:{margin:0,fontSize:24},children:Z.settings}),(0,j.jsx)(`span`,{className:`hud`,children:w.setup.settingsEdit})]}),(0,j.jsxs)(`div`,{className:`bento`,children:[(0,j.jsx)(Ez,{}),(0,j.jsx)(F,{title:Z.runtimeModes,meta:Z.runtimeYaml,span:`span 7`,children:(0,j.jsx)(I,{of:e,children:e=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:10},children:[(0,j.jsxs)(`div`,{className:`list-row`,style:{alignItems:`flex-start`},children:[(0,j.jsxs)(`span`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`span`,{style:{fontSize:13},children:Z.aiInThisOrganisation}),(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:Az[t].what})]}),(0,j.jsx)(`span`,{className:`chip ${t===`on`?`done`:`warn`}`,children:Az[t].label})]}),Dz.map(t=>{let n=e.runtime.modes.allowed.includes(t.id),r=e.runtime.modes.default===t.id;return(0,j.jsxs)(`div`,{className:`list-row`,style:{alignItems:`flex-start`},children:[(0,j.jsxs)(`span`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`span`,{style:{fontSize:13},children:t.name}),(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:t.what})]}),(0,j.jsx)(`span`,{className:`chip ${r?``:n?`done`:`dim`}`,children:r?Z.default:n?Z.allowed:Z.notApproved})]},t.id)}),(0,j.jsxs)(`div`,{className:`run-safety`,role:`note`,children:[(0,j.jsx)(`strong`,{style:{color:`var(--green)`},children:Z.safetyInEveryMode}),` `,Z.aPersonApprovesEvery]}),(0,j.jsx)(cr,{rows:[[Z.assistants,`${e.runtime.assistants.allowed.join(`, `)} ${Z.defaultOf(e.runtime.assistants.default)}`],[Z.editors,e.runtime.editors.join(`, `)],[Z.models,e.runtime.models.allowed.join(`, `)||Z.noneApproved],[Z.autonomy,Z.autonomyLine(e.runtime.autonomy.default,e.runtime.autonomy.maxFixRounds,Object.keys(e.runtime.autonomy.capPerRepo).length?Object.entries(e.runtime.autonomy.capPerRepo).map(([e,t])=>`${e} ${t}`).join(`, `):void 0)],[Z.contextBudget,`${e.runtime.budgets.defaultTokens.toLocaleString()} tokens per pack`],[Z.runRecords,`kept ${e.runtime.retention.runsDays} days in .runs/ (git-ignored)`],[Z.buildEngine,e.runtime.buildEngine.default],[Z.telemetry,e.runtime.telemetry.enabled?`on`:`off`]]}),(0,j.jsxs)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:[w.setup.runtimeOnAi,` `,(0,j.jsx)(`a`,{href:`#/ai`,children:w.setup.openAi})]}),(0,j.jsx)(Mu,{path:`runtime.yaml`})]})})}),(0,j.jsx)(F,{title:Z.adapters,span:`span 5`,children:(0,j.jsx)(I,{of:e,children:e=>(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:Z.everyOutsideSystemSits}),(0,j.jsxs)(`table`,{className:`run-table`,children:[(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{children:Z.system}),(0,j.jsx)(`th`,{children:Z.adapter})]})}),(0,j.jsx)(`tbody`,{children:e.adapters.map(e=>(0,j.jsxs)(`tr`,{children:[(0,j.jsxs)(`td`,{children:[Oz[e.kind]??e.kind,(0,j.jsx)(`div`,{className:`muted`,style:{fontSize:11.5},children:kz[e.mode].what})]}),(0,j.jsx)(`td`,{children:(0,j.jsxs)(`span`,{className:`chip ${kz[e.mode].cls}`,children:[kz[e.mode].label,e.mode===`live`?` · ${e.type}`:``]})})]},e.kind))})]}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:Z.testsAlwaysUseThe})]})})}),(0,j.jsx)(YR,{}),(0,j.jsx)(Pz,{s:e,check:n}),(0,j.jsx)(F,{title:Z.orgPack,span:`span 5`,children:(0,j.jsx)(I,{of:e,children:e=>(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsx)(cr,{rows:[[Z.platforms,e.orgPack.platforms.join(`, `)||`none`],...Object.entries(e.orgPack.counts).map(([e,t])=>[e.replace(/([A-Z])/g,` $1`).toLowerCase(),String(t)])]}),e.orgPack.defaulted.length>0&&(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:Z.builtInDefaultsFor(e.orgPack.defaulted.join(`, `))}),e.orgPack.problems.map(e=>(0,j.jsxs)(`p`,{className:`run-note bad`,children:[e.file,e.path?` ${e.path}`:``,`: `,e.message]},`${e.file}${e.path}${e.message}`)),(0,j.jsx)(`a`,{href:`#/orgpack`,style:{fontSize:12.5},children:Z.openTheOrgPack})]})})}),(0,j.jsx)(jz,{}),(0,j.jsx)(Mz,{}),(0,j.jsx)(F,{title:Z.gates,meta:Z.gatesYaml,span:`span 12`,children:(0,j.jsx)(I,{of:e,empty:e=>e.gates.length===0,emptyText:Z.noGates,children:e=>(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:Z.theCriticRunsAt}),(0,j.jsx)(Mu,{path:`gates.yaml`}),(0,j.jsxs)(`table`,{className:`run-table`,children:[(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{children:Z.gate}),(0,j.jsx)(`th`,{children:Z.phase}),(0,j.jsx)(`th`,{children:Z.checklists}),(0,j.jsx)(`th`,{children:Z.checks}),(0,j.jsx)(`th`,{children:Z.authorRounds})]})}),(0,j.jsx)(`tbody`,{children:e.gates.map(e=>(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`td`,{className:`mono`,children:e.id}),(0,j.jsx)(`td`,{children:e.phase}),(0,j.jsx)(`td`,{children:e.checklists.join(`, `)||`-`}),(0,j.jsx)(`td`,{children:e.checks.join(`, `)||`-`}),(0,j.jsx)(`td`,{children:e.maxAuthorRounds??Z.noLimit})]},e.id))})]})]})})})]})]})}function Pz({s:e,check:t}){return(0,j.jsx)(F,{title:Z.executorsAllowList,meta:e.state===`ready`?Z.setUp(e.data.executors.configured.length):void 0,span:`span 7`,children:(0,j.jsx)(I,{of:e,children:e=>(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:Z.proceduresCallLocalAutomation}),e.executors.configured.length===0?(0,j.jsx)(`p`,{className:`state`,children:Z.noToolsAreSet}):(0,j.jsxs)(`table`,{className:`run-table`,children:[(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{children:Z.executor}),(0,j.jsx)(`th`,{children:Z.kind}),(0,j.jsx)(`th`,{children:Z.allowedFor}),(0,j.jsx)(`th`,{children:Z.approval})]})}),(0,j.jsx)(`tbody`,{children:e.executors.configured.map(e=>(0,j.jsxs)(`tr`,{children:[(0,j.jsxs)(`td`,{children:[(0,j.jsx)(`span`,{className:`mono`,children:e.name}),(0,j.jsx)(`div`,{className:`muted`,style:{fontSize:11},children:e.where})]}),(0,j.jsx)(`td`,{children:e.transport}),(0,j.jsx)(`td`,{children:e.allowedFor.length?e.allowedFor.join(`, `):(0,j.jsx)(`span`,{className:`chip dim`,children:Z.nothingOff})}),(0,j.jsx)(`td`,{children:Z.eachWrite})]},e.name))})]}),e.executors.missing.map(e=>(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:Z.procedureAllowsWhichIsnt(e.procedure,e.executor)},`${e.procedure}${e.executor}`)),e.executors.problems.map(e=>(0,j.jsx)(`p`,{className:`run-note bad`,children:e},e)),(0,j.jsxs)(`div`,{className:`row`,children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:t.busy||e.executors.configured.length===0,"aria-describedby":e.executors.configured.length===0?`no-executors`:void 0,onClick:()=>void t.run(()=>N(`/api/settings/executors/check`),e=>{let t=e;return[...t.executors.map(e=>`${e.name}: ${e.reachable?`answers${e.version?` (${e.version})`:``}`:`doesn't answer${e.problem?` (${e.problem})`:``}`}`),...t.problems].join(`
|
|
59
|
+
`)}),children:Z.checkTheyAnswer}),e.executors.configured.length===0&&(0,j.jsx)(`span`,{id:`no-executors`,className:`muted`,style:{fontSize:12},children:w.app.noExecutors})]}),(0,j.jsx)(or,{note:t.note}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:Z.addingAToolTo})]})})})}var Q=w.todo;function Fz(e){let t={id:e.id,value:e.value,required:e.f.required,className:`run-input`};if(e.f.format===`choice`||e.f.format===`yes-no`){let n=e.f.format===`yes-no`?[`yes`,`no`]:e.f.choices??[];return(0,j.jsxs)(`select`,{...t,className:`run-select`,onChange:t=>e.onChange(t.target.value),children:[(0,j.jsx)(`option`,{value:``,children:Q.choose}),n.map(e=>(0,j.jsx)(`option`,{children:e},e))]})}let n=e.f.format===`url`?`url`:e.f.format===`date`?`date`:e.f.format===`number`||e.f.format===`integer`?`number`:`text`;return(0,j.jsx)(`input`,{...t,type:n,placeholder:e.f.help??(e.f.format===`handles`?Q.patDana:``),onChange:t=>e.onChange(t.target.value)})}function Iz({step:e,done:t}){let[n,r]=(0,v.useState)(e.executors[0]??``),[i,a]=(0,v.useState)(),o=ar();return e.executors.length===0?null:(0,j.jsxs)(`div`,{className:`stack`,style:{borderTop:`1px solid var(--rule)`,paddingTop:10},children:[(0,j.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`},children:[(0,j.jsx)(`span`,{className:`chip ai`,children:Q.localTool}),(0,j.jsx)(`span`,{style:{fontSize:12.5,color:`var(--text-2)`},children:Q.aToolOnThe})]}),(0,j.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`},children:[(0,j.jsxs)(`label`,{className:`run-label`,htmlFor:`exec-${e.id}`,children:[Q.tool,(0,j.jsx)(`select`,{id:`exec-${e.id}`,className:`run-select`,value:n,onChange:e=>{r(e.target.value),a(void 0)},children:e.executors.map(e=>(0,j.jsx)(`option`,{children:e},e))})]}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,style:{alignSelf:`flex-end`},disabled:o.busy,onClick:()=>void o.run(()=>N(`/api/todo/${e.id}/run?with=${encodeURIComponent(n)}${e.change?`&change=${encodeURIComponent(e.change)}`:``}`).then(a),Q.theseAreTheExact),children:Q.showTheInputs})]}),i&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`pre`,{className:`run-inert`,"aria-label":Q.inputsTheToolGets,style:{borderStyle:`solid`},children:JSON.stringify(i.inputs,null,2)}),(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:Q.sha256(i.inputsSha256.slice(0,16))}),(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:o.busy,onClick:()=>void o.run(async()=>N(`/api/todo/${e.id}/run`,{method:`POST`,body:{with:n,inputsSha256:i.inputsSha256,...e.change?{change:e.change}:{},...await Jn(`step-run`,e.id)}}).then(e=>(t(),e)),e=>e.lines.join(`
|
|
60
|
+
`)||Q.executorDid(n)),children:Q.runWithIApprove(n)})]}),(0,j.jsx)(or,{note:o.note})]})}function Lz({step:e,done:t}){let[n,r]=(0,v.useState)({}),[i,a]=(0,v.useState)(``),o=ar(),s=ar(),c=e.fields.map(e=>`${e.name}: ${e.value}`).join(`
|
|
61
|
+
`);return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:12},children:[(0,j.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,gap:6},children:[(0,j.jsx)(`span`,{className:`chip`,children:(dr[e.system]??e.system).toUpperCase()}),(0,j.jsx)(`span`,{className:`chip warn`,children:Q.manual}),e.procedure&&(0,j.jsx)(`span`,{className:`chip dim`,children:Q.procedure(e.procedure)}),e.change&&(0,j.jsx)(`a`,{className:`chip`,href:`#/changes/${e.change}`,children:e.change})]}),(0,j.jsx)(`p`,{style:{margin:0,fontSize:15},children:e.title}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:Q.whereEveryValueComes(e.where,e.reason?Q.whyThisIsManual(e.reason):``)}),e.waitsFor.length>0&&(0,j.jsx)(`p`,{className:`run-note bad`,role:`note`,children:Q.doFirstThisStep(e.waitsFor.join(`, `),e.waitsFor.length===1?Q.it:Q.them)}),e.instructions.length>0&&(0,j.jsx)(`ol`,{className:`run-steps`,children:e.instructions.map(e=>(0,j.jsx)(`li`,{children:e},e))}),e.fields.length>0&&(0,j.jsxs)(`div`,{children:[(0,j.jsxs)(`div`,{className:`row between`,style:{marginBottom:4},children:[(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:Q.fieldsToCopy}),(0,j.jsxs)(`span`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(sr,{text:c,label:Q.copyAllFields}),(0,j.jsx)(`button`,{type:`button`,className:`btn run-copy`,disabled:o.busy,onClick:()=>void o.run(()=>N(`/api/todo/${e.id}/export?format=csv${e.change?`&change=${encodeURIComponent(e.change)}`:``}`).then(e=>{if(!navigator.clipboard)throw Error(Q.noClipboard);return navigator.clipboard.writeText(e.text)}),Q.copiedTheFieldsAs),children:Q.copyAsCsv})]})]}),e.fields.map(e=>(0,j.jsxs)(`div`,{className:`run-field`,children:[(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:e.name}),(0,j.jsx)(`span`,{className:`value ${e.value?``:`empty`}`,children:e.value||Q.empty}),e.value?(0,j.jsx)(sr,{text:e.value,label:Q.copy(e.name)}):(0,j.jsx)(`span`,{})]},e.name)),(0,j.jsx)(or,{note:o.note})]}),e.state===`open`?(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsxs)(`form`,{onSubmit:r=>{r.preventDefault();let i=Object.fromEntries(Object.entries(n).filter(([,e])=>e.trim()));s.run(()=>N(`/api/todo/${e.id}/done`,{method:`POST`,body:{values:i,...e.change?{change:e.change}:{}}}).then(e=>(t(),e)),t=>t.synced?.length?Q.recordedAndSynced(e.id,t.synced.join(` `)):Q.recordedStep(e.id))},className:`stack`,children:[(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:Q.whenItsDoneRecord}),(0,j.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,alignItems:`flex-end`},children:[e.result.map(t=>(0,j.jsxs)(`label`,{className:`run-label`,htmlFor:`r-${e.id}-${t.name}`,children:[t.label,t.required?``:Q.optional,(0,j.jsx)(Fz,{f:t,id:`r-${e.id}-${t.name}`,value:n[t.name]??``,onChange:e=>r(n=>({...n,[t.name]:e}))})]},t.name)),(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:s.busy,children:Q.markDone})]})]}),(0,j.jsxs)(`form`,{className:`row`,style:{flexWrap:`wrap`,alignItems:`flex-end`},onSubmit:n=>{n.preventDefault(),i.trim()&&!s.busy&&s.run(()=>N(`/api/todo/${e.id}/done`,{method:`POST`,body:{skip:!0,note:i,...e.change?{change:e.change}:{}}}).then(t),Q.skippedStep(e.id))},children:[(0,j.jsxs)(`label`,{className:`run-label`,htmlFor:`skip-${e.id}`,style:{flex:`1 1 240px`},children:[Q.reasonToSkip,(0,j.jsx)(`input`,{id:`skip-${e.id}`,className:`run-input`,value:i,onChange:e=>a(e.target.value)})]}),(0,j.jsx)(`button`,{type:`submit`,className:`btn`,disabled:s.busy||!i.trim(),children:Q.skipWithThisReason})]}),(0,j.jsx)(Iz,{step:e,done:t})]}):(0,j.jsx)(`p`,{className:`run-note ok`,children:Q.byOn(e.state===`done`?Q.done:Q.skipped,e.recorded?.by??``,fr(e.recorded?.at),e.recorded?.via===`executor`?Q.byALocalTool:``,e.recorded?.note?` ${e.recorded.note}`:``,Object.entries(e.recorded?.values??{}).map(([e,t])=>` ${e}: ${String(t)}.`).join(``))}),e.state===`done`&&Rz(e)&&(0,j.jsx)(`p`,{className:`run-note`,role:`note`,children:Q.approvalRecordedBy(Rz(e),e.recorded?.by??``)}),(0,j.jsx)(or,{note:s.note})]})}function Rz(e){if(e.action!==`report-pull-request`)return;let t=e.recorded?.values.approvers,n=Array.isArray(t)?t.map(String):typeof t==`string`&&t?[t]:[];return n.length?n.join(`, `):void 0}var zz=(e,t)=>ti([e.title,e.id,e.change,e.system],t),Bz=`todo-filter`;function Vz({hash:e=``}){let t=P(`/api/todo?all=1`),n=P(`/api/findings`),[r,i]=(0,v.useState)(),[a,o]=(0,v.useState)(YL(e)??`all`),s=YL(e);(0,v.useEffect)(()=>{s&&o(s)},[s]);let[c,l]=(0,v.useState)(``);St(e=>{e.type===`file.changed`&&(t.reload(),n.reload())});let u=t.state===`ready`?t.data.steps.filter(e=>a===`all`||(e.change??`none`)===a):[],d=u.filter(e=>e.state===`open`),f=u.filter(e=>e.state!==`open`),p=d.filter(e=>e.waitsFor.length>0),m=!!c.trim(),h=d.filter(e=>zz(e,c)),g=f.filter(e=>zz(e,c)),_=ri({text:c,...a===`all`?{}:{change:a===`none`?Q.noChange2:a}}),y=t.state===`ready`?[...new Set(t.data.steps.map(e=>e.change??`none`))]:[],b=e=>`${e.change??``}/${e.id}`,x=u.find(e=>b(e)===r)??d[0],S=n.state===`ready`?n.data.filter(e=>e.question&&(e.state===`open`||e.state===`asked`)):[];return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`},children:[(0,j.jsx)(`p`,{className:`n`,style:{margin:0,fontSize:24},children:t.state===`ready`?d.length?Q.waitForAPerson(pr(d.length,Q.stepWord)):Q.nothingToDoEvery:Q.toDoAndManual}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`,alignItems:`flex-end`},children:[(0,j.jsxs)(`div`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(ii,{id:Bz,value:c,onChange:l}),(0,j.jsx)(ai,{shown:h.length+g.length,total:u.length,active:m})]}),(y.length>1||a!==`all`)&&(0,j.jsx)(lr,{label:Q.change,value:a,onChange:o,options:[{value:`all`,label:Q.allChanges},...[...new Set([...y,...a===`all`?[]:[a]])].map(e=>({value:e,label:e===`none`?Q.noChange2:e}))]})]})]}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:Q.stepsAPersonDoes}),(0,j.jsxs)(`div`,{className:`bento`,children:[(0,j.jsx)(F,{title:Q.progress,span:`span 3`,children:(0,j.jsx)(I,{of:t,empty:()=>u.length===0,emptyText:Q.noManualStepsYet,children:()=>(0,j.jsxs)(`div`,{className:`stack`,style:{alignItems:`flex-start`},children:[(0,j.jsx)(It,{value:f.length,max:u.length,size:72,label:Q.ofStepsDone(f.length,u.length)}),(0,j.jsx)(Lt,{title:Q.steps,parts:[{label:Q.done2,value:f.length,color:`var(--green)`},{label:Q.open2,value:d.length-p.length,color:`var(--accent)`},{label:Q.waitingOnOthers,value:p.length,color:`var(--amber)`}]})]})})}),(0,j.jsx)(F,{title:Q.whereStepsComeFrom,span:`span 4`,children:(0,j.jsx)(I,{of:t,children:e=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:2},children:[e.sources.filter(e=>e.configured||e.open).map(e=>(0,j.jsxs)(`div`,{className:`list-row`,children:[(0,j.jsx)(`span`,{children:dr[e.system]??e.system}),(0,j.jsxs)(`span`,{className:`row`,style:{gap:6},children:[e.open>0&&(0,j.jsx)(`span`,{className:`chip warn`,children:Q.open(e.open)}),(0,j.jsx)(ur,{type:e.configured})]})]},e.system)),(0,j.jsx)(`p`,{className:`muted`,style:{margin:`8px 0 0`,fontSize:12},children:e.exports.files.length?Q.exportsInInputs(pr(e.exports.workItems,Q.workItem),pr(e.exports.requests,Q.requestWord)):Q.noExportsInInputs})]})})}),(0,j.jsx)(F,{title:Q.localAutomation,span:`span 5`,children:(0,j.jsx)(I,{of:t,children:e=>(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsxs)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:[Q.allowListedToolsCan,(0,j.jsx)(`a`,{href:`#/settings`,children:Q.executorsAllowList})]}),(0,j.jsx)(`div`,{className:`row`,style:{flexWrap:`wrap`,gap:6},children:e.executors.configured.length?e.executors.configured.map(e=>(0,j.jsx)(`span`,{className:`chip ai`,children:e},e)):(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12.5},children:Q.noToolsSetUp})}),e.executors.problems.map(e=>(0,j.jsx)(`p`,{className:`run-note bad`,children:e},e))]})})}),(0,j.jsx)(F,{title:Q.openSteps,meta:m?`${h.length}/${d.length}`:d.length,span:`span 4`,rows:`span 2`,children:(0,j.jsx)(I,{of:t,empty:()=>d.length===0,emptyText:Q.noOpenSteps,children:()=>h.length===0?(0,j.jsx)(oi,{what:_,onClear:()=>l(``),focus:Bz}):(0,j.jsx)(`nav`,{"aria-label":Q.openSteps,className:`stack`,style:{gap:2},children:Object.entries(h.reduce((e,t)=>((e[t.system]??=[]).push(t),e),{})).map(([e,t])=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10,marginTop:6},children:dr[e]??e}),t.map(e=>(0,j.jsxs)(`button`,{type:`button`,className:`run-pick`,"aria-current":x&&b(e)===b(x)?`true`:void 0,onClick:()=>i(b(e)),children:[(0,j.jsxs)(`span`,{className:`stack`,style:{gap:2,minWidth:0},children:[(0,j.jsx)(`span`,{style:{fontSize:12.5},children:e.title}),(0,j.jsxs)(`span`,{className:`hud`,style:{fontSize:9.5},children:[e.change??Q.noChange,` · `,e.id]})]}),(0,j.jsx)(`span`,{className:`chip ${e.waitsFor.length?`warn`:``}`,children:e.waitsFor.length?Q.waits:Q.toDo})]},`${e.change}/${e.id}`))]},e))})})}),(0,j.jsx)(F,{title:x?Q.step:Q.noStepSelected,span:`span 8`,rows:`span 2`,kind:`hero`,children:(0,j.jsx)(I,{of:t,empty:()=>!x,emptyText:Q.pickAStepOn,children:()=>(0,j.jsx)(Lz,{step:x,done:()=>{i(b(x)),t.reload()}},`${x.change}/${x.id}`)})}),(0,j.jsxs)(F,{title:Q.proceduresALocalTool,span:`span 7`,children:[(0,j.jsx)(I,{of:t,empty:e=>e.procedures.length===0,emptyText:Q.theOrgPackHas,children:e=>(0,j.jsxs)(`table`,{className:`run-table`,children:[(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{children:Q.procedure2}),(0,j.jsx)(`th`,{children:Q.toolsAllowed}),(0,j.jsx)(`th`,{children:Q.writes}),(0,j.jsx)(`th`,{children:Q.lastRun})]})}),(0,j.jsx)(`tbody`,{children:e.procedures.map(e=>(0,j.jsxs)(`tr`,{children:[(0,j.jsxs)(`td`,{children:[e.name,(0,j.jsxs)(`div`,{className:`hud`,style:{fontSize:9.5},children:[e.id,` · `,e.status]})]}),(0,j.jsx)(`td`,{children:e.allowed.length===0?(0,j.jsx)(`span`,{className:`muted`,children:Q.noneOff}):e.allowed.map(t=>(0,j.jsxs)(`span`,{className:`chip ${e.configured.includes(t)?`ai`:`dim`}`,title:e.configured.includes(t)?Q.setUpHere:Q.notSetUpOn,style:{marginRight:4},children:[t,e.configured.includes(t)?``:Q.notHere]},t))}),(0,j.jsx)(`td`,{children:e.writes}),(0,j.jsx)(`td`,{children:e.lastRun?`${fr(e.lastRun.at)} · ${e.lastRun.status} · ${e.lastRun.executor}`:Q.neverRun})]},e.id))})]})}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:`8px 0 0`,fontSize:12},children:Q.eachRunShowsThe})]}),(0,j.jsx)(F,{title:Q.done,meta:m?`${g.length}/${f.length}`:f.length,span:`span 5`,children:(0,j.jsx)(I,{of:t,empty:()=>f.length===0,emptyText:Q.nothingDoneYet,children:()=>g.length===0?(0,j.jsx)(`div`,{className:`state`,children:w.filter.nothingMatches(_)}):g.map(e=>(0,j.jsxs)(`button`,{type:`button`,className:`run-pick`,"aria-current":x&&b(e)===b(x)?`true`:void 0,onClick:()=>i(b(e)),children:[(0,j.jsx)(`span`,{style:{fontSize:12.5},children:e.title}),(0,j.jsx)(`span`,{className:`chip ${e.state===`done`?`done`:`dim`}`,children:e.state.toUpperCase()})]},`${e.change}/${e.id}`))})}),(0,j.jsx)(F,{title:Q.ownerQuestionsWaiting,meta:S.length||void 0,span:`span 12`,children:(0,j.jsx)(I,{of:n,empty:()=>S.length===0,emptyText:Q.noOwnerQuestionsWaiting,children:()=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:0},children:[S.map(e=>(0,j.jsxs)(`div`,{className:`list-row`,children:[(0,j.jsxs)(`span`,{className:`stack`,style:{gap:2,minWidth:0},children:[(0,j.jsx)(`span`,{style:{fontSize:12.5},children:e.question.text}),(0,j.jsxs)(`span`,{className:`hud`,style:{fontSize:9.5},children:[e.question.owner??Q.ownerNotKnown,` · `,e.change,` · `,e.gate]})]}),(0,j.jsxs)(`span`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`span`,{className:`chip ${e.state===`asked`?`ai`:`warn`}`,children:e.state.toUpperCase()}),(0,j.jsx)(sr,{text:e.question.text,label:Q.copyQuestionText}),(0,j.jsx)(`a`,{className:`btn`,href:`#/questions?kind=owner`,style:{display:`inline-flex`,alignItems:`center`,textDecoration:`none`},children:Q.answerOnQuestions}),(0,j.jsx)(`a`,{className:`btn`,href:`#/changes/${e.change}`,style:{display:`inline-flex`,alignItems:`center`,textDecoration:`none`},children:Q.openChange})]})]},`${e.change}/${e.gate}/${e.id}`)),(0,j.jsx)(`p`,{className:`muted`,style:{margin:`8px 0 0`,fontSize:12},children:Q.eachQuestionIsAsked})]})})})]})]})}var Hz={todo:Vz,release:vR,"service-desk":LR,governance:kL,evals:EL,learning:PL,settings:Nz,ai:oz,repos:jR},Uz=w.history,Wz=e=>e.replace(`T`,` `).slice(0,16),Gz=(e,t)=>`hs-${e}-${t}`.replace(/[^A-Za-z0-9_-]/g,`-`);function Kz(e){let t=new URLSearchParams;e.change&&t.set(`change`,e.change),e.session&&t.set(`session`,e.session),e.q&&t.set(`q`,e.q);let n=t.toString();return`#/history${n?`?${n}`:``}`}function qz(e,t){return e.filter(e=>(!t.change||e.change===t.change)&&(!t.session||e.session===t.session)&&ti([e.prompt?.text,e.response?.text,e.prompt?.command,e.change,e.session,Uz.surfaces[e.surface]],t.text))}function Jz(e){let t=new Map;for(let n of e){let e=`${n.surface}\u0000${n.session}`,r=t.get(e)??{session:n.session,surface:n.surface,turns:[]};r.turns.push(n),t.set(e,r)}return[...t.values()]}function Yz(e){return[...new Set(e.flatMap(e=>e.change?[e.change]:[]))].sort()}function Xz({r:e,what:t}){return(0,j.jsxs)(`div`,{className:`history-said`,children:[(0,j.jsxs)(`h4`,{className:`runs-h4`,children:[t,` `,(0,j.jsx)(`time`,{dateTime:e.at,children:Wz(e.at)})]}),e.truncated&&(0,j.jsx)(`p`,{className:`history-note`,children:Uz.truncated(e.size)}),e.masked&&(0,j.jsx)(`p`,{className:`history-note`,children:Uz.masked}),(0,j.jsx)(`pre`,{className:`runs-text`,tabIndex:0,role:`region`,"aria-label":Uz.box(t,e.id),children:e.text})]})}function Zz({t:e}){let t=e.prompt?.command??e.response?.command;return(0,j.jsxs)(`li`,{className:`history-turn`,children:[(e.change||t)&&(0,j.jsxs)(`p`,{className:`history-tags`,children:[e.change&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`span`,{className:`hud`,children:Uz.about}),` `,(0,j.jsx)(`a`,{href:Kz({change:e.change}),children:e.change})]}),t&&(0,j.jsxs)(j.Fragment,{children:[` `,(0,j.jsx)(`span`,{className:`hud`,children:Uz.command}),` `,(0,j.jsx)(`code`,{className:`mono`,children:t})]})]}),(0,j.jsxs)(`div`,{className:`runs-pair`,children:[e.prompt?(0,j.jsx)(Xz,{r:e.prompt,what:Uz.prompt}):(0,j.jsx)(`div`,{}),e.response?(0,j.jsx)(Xz,{r:e.response,what:Uz.response}):(0,j.jsxs)(`div`,{className:`history-said`,children:[(0,j.jsx)(`h4`,{className:`runs-h4`,children:Uz.response}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:Uz.noResponse})]})]})]})}function Qz({r:e}){let t=e.on?`atticus history off`:e.offBy===`org-pack`?void 0:`atticus history on`;return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:e.on?Uz.recordingOn:e.offBy===`org-pack`?Uz.offOrgPack:Uz.offLocal}),t&&(0,j.jsx)(sc,{text:t,label:w.runNext.copy})]})}function $z(e){return(0,j.jsx)(I,{of:e.of,empty:e=>e.total===0,emptyContent:e.of.state===`ready`?(0,j.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,j.jsx)(Qz,{r:e.of.data.recording}),(0,j.jsx)(`div`,{className:`state`,children:Uz.empty}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:Uz.what})]}):null,children:t=>{let n=qz(t.turns,{text:e.text,...e.change?{change:e.change}:{},...e.session?{session:e.session}:{}}),r=!!e.text.trim()||!!e.change||!!e.session;return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:10},children:[(0,j.jsx)(Qz,{r:t.recording}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:Uz.what}),e.session&&(0,j.jsxs)(`p`,{className:`work-say`,style:{margin:0},children:[Uz.onlySession(e.session),` `,(0,j.jsx)(`a`,{href:Kz(e.change?{change:e.change}:{}),children:Uz.showAll})]}),(0,j.jsxs)(`div`,{className:`row history-filters`,role:`search`,children:[(0,j.jsx)(ii,{id:`history-find`,value:e.text,onChange:t=>e.onText?.(t),grow:!0}),(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`label`,{htmlFor:`history-change`,className:`hud`,style:{fontSize:10},children:Uz.change}),(0,j.jsxs)(`select`,{id:`history-change`,className:`field`,value:e.change??``,onChange:t=>e.onChange?.(t.target.value),children:[(0,j.jsx)(`option`,{value:``,children:Uz.everyChange}),Yz(t.turns).map(e=>(0,j.jsx)(`option`,{value:e,children:e},e))]})]})]}),(0,j.jsx)(ai,{shown:n.length,total:t.turns.length,active:r}),n.length===0?(0,j.jsx)(oi,{what:ri({text:e.text,...e.change?{change:e.change}:{}}),onClear:()=>{e.onText?.(``),e.onChange?.(``)},focus:`history-find`}):Jz(n).map(e=>(0,j.jsxs)(`section`,{className:`history-session`,"aria-labelledby":Gz(e.surface,e.session),children:[(0,j.jsxs)(`h3`,{id:Gz(e.surface,e.session),className:`history-h`,children:[(0,j.jsx)(`a`,{href:Kz({session:e.session}),children:Uz.session(e.session)}),` `,(0,j.jsxs)(`span`,{className:`muted`,children:[Uz.surfaces[e.surface]??e.surface,`, `,Uz.turns(e.turns.length)]})]}),(0,j.jsx)(`ol`,{className:`history-turns`,children:e.turns.map(e=>(0,j.jsx)(Zz,{t:e},e.prompt?.id??e.response?.id))})]},`${e.surface}:${e.session}`)),t.total>t.turns.length&&(0,j.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:Uz.newest(t.turns.length,t.total)})]})}})}function eB({hash:e}){let t=Nn(e,`change`),n=Nn(e,`session`),r=Nn(e,`q`),[i,a]=(0,v.useState)(r??``);(0,v.useEffect)(()=>a(r??``),[r]);let o=P(`/api/history?limit=1000`);return St(e=>{e.type===`file.changed`&&o.reload()}),(0,j.jsx)(`div`,{className:`bento`,children:(0,j.jsxs)(F,{title:Uz.title,span:`1 / -1`,children:[(0,j.jsx)(`p`,{className:`work-say`,style:{marginTop:0},children:Uz.intro}),(0,j.jsx)($z,{of:o,text:i,onText:a,...t?{change:t}:{},...n?{session:n}:{},onChange:e=>{location.hash=Kz({...e?{change:e}:{},...n?{session:n}:{}})}})]})})}var tB=w.glossary;function nB(){return(0,j.jsxs)(F,{title:tB.title,children:[(0,j.jsx)(`p`,{className:`muted`,children:tB.intro}),(0,j.jsx)(`dl`,{className:`words`,children:tB.terms.map(e=>(0,j.jsxs)(`div`,{id:`word-${e.term.replace(/ /g,`-`)}`,children:[(0,j.jsx)(`dt`,{children:(0,j.jsx)(`strong`,{children:e.term})}),(0,j.jsx)(`dd`,{style:{margin:`2px 0 10px`},children:e.says})]},e.term))})]})}var rB=w.sketch,iB=[`call`,`topic`,`table`,`remove`,`retarget`,`retire`],aB={kind:`call`,component:``,flow:``,newFlow:!1,newId:``,newName:``,triggerKind:`endpoint`,triggerWhat:``,newType:``,toComponent:``,toEntry:``,toNew:!1,what:``,topic:``,listener:``,listenerFlow:``,op:`write`,table:``,columns:``,tableNew:!1,step:``,why:``},oB=e=>e.trim(),sB=e=>oB(e).toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,60);function cB(e,t=[]){let n=(n,r,i)=>{if(!oB(n))return;let a={component:oB(n)};if(i){if(!oB(e.newName)||!oB(e.triggerWhat))return;let r=t.find(t=>t.id===oB(e.newType));a.newFlow={id:oB(e.newId)||`${oB(n)}.${sB(e.newName)}`,name:oB(e.newName),trigger:{kind:e.triggerKind,what:oB(e.triggerWhat)},...r?{runsOn:{type:r.id,...r.runsOn?.platform?{platform:r.runsOn.platform}:{},...r.runsOn?.cloud?{cloud:r.runsOn.cloud}:{},...r.runsOn?.framework?{framework:r.runsOn.framework}:{}}}:{}}}else oB(r)&&(a.flow=oB(r));return a},r=oB(e.what)?{what:oB(e.what)}:{};switch(e.kind){case`call`:{let t=n(e.component,e.flow,e.newFlow);return t?!oB(e.toComponent)||!oB(e.toEntry)?{missing:rB.missing.to}:{stroke:{kind:`call`,from:t,to:{component:oB(e.toComponent),entry:oB(e.toEntry),new:e.toNew},...r}}:{missing:rB.missing.from}}case`topic`:{let t=n(e.component,e.flow,e.newFlow);if(!t)return{missing:rB.missing.from};if(!oB(e.topic))return{missing:rB.missing.topic};let i=oB(e.listener)?n(e.listener,e.listenerFlow,!1):void 0;return{stroke:{kind:`topic`,from:t,topic:oB(e.topic),...i?{listener:i}:{},...r}}}case`table`:{let t=n(e.component,e.flow,e.newFlow);return t?oB(e.table)?{stroke:{kind:`table`,from:t,op:e.op,table:oB(e.table),columns:e.columns.split(`,`).map(oB).filter(Boolean),new:e.tableNew,...r}}:{missing:rB.missing.table}:{missing:rB.missing.from}}case`retire`:return oB(e.component)?oB(e.why)?{stroke:{kind:`retire`,component:oB(e.component),why:oB(e.why)}}:{missing:rB.missing.why}:{missing:rB.missing.component};case`remove`:case`retarget`:{let t=Number(e.step);return!oB(e.flow)||!Number.isInteger(t)||t<1?{missing:rB.missing.step}:oB(e.why)?e.kind===`remove`?{stroke:{kind:`remove`,flow:oB(e.flow),step:t,why:oB(e.why)}}:!oB(e.toComponent)||!oB(e.toEntry)?{missing:rB.missing.to}:{stroke:{kind:`retarget`,flow:oB(e.flow),step:t,to:{component:oB(e.toComponent),entry:oB(e.toEntry),new:e.toNew},why:oB(e.why)}}:{missing:rB.missing.why}}}}var lB=e=>e instanceof M?e.problem.detail??e.message:e instanceof Error?e.message:String(e),uB=[];function dB({change:e,map:t}){let n=P(`/api/changes/${encodeURIComponent(e)}/sketch`),r=P(`/api/component-types`);return lt(n),n.state===`ready`?(0,j.jsxs)(j.Fragment,{children:[r.state===`error`&&(0,j.jsx)(Mt,{error:r.error,retry:r.reload}),(0,j.jsx)(mB,{change:e,map:t,drawn:n.data.drawn,commit:n.data.commit,fingerprint:n.data.fingerprint,types:r.state===`ready`?r.data.types:uB,post:t=>N(`/api/changes/${encodeURIComponent(e)}/sketch`,{method:`POST`,body:t}),onWritten:()=>n.reload()})]}):(0,j.jsx)(I,{of:n,children:()=>null})}var fB=/^([\s\S]*?):\s*(atticus spec draft \S+)$/;function pB({problem:e}){let t=fB.exec(e),n=/^No flow of today's map is /.test(e);return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,j.jsx)(`p`,{role:`alert`,className:`state error`,children:t?`${t[1]}:`:e}),t&&(0,j.jsx)(sc,{text:t[2],label:w.runNext.copy}),n&&(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:(0,j.jsx)(`a`,{href:`#/flows`,children:rB.openFlows})})]})}function mB(e){let t=(0,v.useId)(),[n,r]=(0,v.useState)(aB),[i,a]=(0,v.useState)(),[o,s]=(0,v.useState)(),[c,l]=(0,v.useState)(),[u,d]=(0,v.useState)(),[f,p]=(0,v.useState)(),[m,h]=(0,v.useState)(),[g,_]=(0,v.useState)(),[y,b]=(0,v.useState)(!1);(0,v.useEffect)(()=>_(void 0),[e.drawn,e.fingerprint]);let x=g?.drawn??e.drawn,S=g?.commit??e.commit,C=g?.fingerprint??e.fingerprint,T=cB(n,e.types??[]),E=`stroke`in T?JSON.stringify(T.stroke):void 0,D=(e,t)=>{r(n=>({...n,[e]:t})),l(void 0),h(void 0),s(void 0),(e===`component`||e===`kind`)&&p(void 0)},ee=async t=>{if(!(`stroke`in T))s(T.missing);else{a(t),s(void 0);try{let i=await e.post({stroke:T.stroke,...t===`preview`?{preview:!0}:c?.fingerprint?{expect:c.fingerprint}:{}});i.problem?(l(void 0),d(void 0),h(i.problem),i.pick&&p({component:oB(n.component),flows:i.pick.flows})):t===`preview`?(l(i),d(JSON.stringify(T.stroke))):(_(i),b(!0),l(void 0),r(e=>({...e,toComponent:``,toEntry:``,toNew:!1,tableNew:!1,table:``,columns:``,what:``,step:``,why:``})),e.onWritten?.(i))}catch(e){s(lB(e)),l(void 0)}finally{a(void 0)}}},te=async t=>{let n=`${t.flow}#${t.index}`;a(n),s(void 0);try{let n=await e.post({stroke:{kind:`undo`,flow:t.flow,index:t.index},...C?{expect:C}:{}});n.problem?s(n.problem):(_(n),b(!0),l(void 0),e.onWritten?.(n))}catch(e){s(lB(e))}finally{a(void 0)}},ne=[...new Set([...e.map?.nodes.filter(e=>e.kind===`component`).map(e=>e.id)??[]])].sort(),O=f&&f.component===oB(n.component)?f.flows:[],re=n.kind!==`remove`&&n.kind!==`retarget`&&n.kind!==`retire`,k=(e,t,r={})=>(0,j.jsxs)(`label`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`span`,{className:`hud`,children:t}),(0,j.jsx)(`input`,{className:`field`,value:String(n[e]),onChange:t=>D(e,t.target.value),...r})]}),A=(e,t)=>(0,j.jsxs)(`label`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:n[e],onChange:t=>D(e,t.target.checked)}),t]});return(0,j.jsxs)(`section`,{className:`stack sketch-panel`,"aria-labelledby":`${t}-t`,children:[(0,j.jsx)(`h3`,{id:`${t}-t`,className:`hud`,children:rB.title}),(0,j.jsx)(`p`,{className:`ev-say`,children:rB.intro}),(0,j.jsx)(`datalist`,{id:`${t}-c`,children:ne.map(e=>(0,j.jsx)(`option`,{value:e},e))}),(0,j.jsxs)(`fieldset`,{className:`row`,style:{border:0,padding:0,margin:0,flexWrap:`wrap`,gap:10},children:[(0,j.jsx)(`legend`,{className:`hud`,children:rB.kind}),iB.map(e=>(0,j.jsxs)(`label`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`input`,{type:`radio`,name:`${t}-k`,checked:n.kind===e,onChange:()=>D(`kind`,e)}),rB.kinds[e]]},e))]}),re?(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[k(`component`,rB.from,{list:`${t}-c`}),!n.newFlow&&(O.length?(0,j.jsxs)(`label`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`span`,{className:`hud`,children:rB.flow}),(0,j.jsxs)(`select`,{className:`field`,value:n.flow,onChange:e=>D(`flow`,e.target.value),children:[(0,j.jsx)(`option`,{value:``,children:rB.pickFlow}),O.map(e=>(0,j.jsx)(`option`,{value:e.id,children:rB.flowOption(e.name,e.id)},e.id))]})]}):k(`flow`,rB.flowOptional)),A(`newFlow`,rB.newFlow),n.newFlow&&(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6,paddingLeft:12},children:[k(`newName`,rB.newName),k(`newId`,rB.newId,{placeholder:`${oB(n.component)||rB.componentWord}.${sB(n.newName)||rB.flowWord}`}),(0,j.jsxs)(`label`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`span`,{className:`hud`,children:rB.trigger}),(0,j.jsx)(`select`,{className:`field`,value:n.triggerKind,onChange:e=>D(`triggerKind`,e.target.value),children:[`endpoint`,`action`,`page`,`listener`,`job`].map(e=>(0,j.jsx)(`option`,{value:e,children:rB.triggers[e]},e))})]}),k(`triggerWhat`,rB.triggerWhat),(e.types?.length??0)>0&&(0,j.jsxs)(`label`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`span`,{className:`hud`,children:rB.newType}),(0,j.jsxs)(`select`,{className:`field`,value:n.newType,onChange:e=>D(`newType`,e.target.value),children:[(0,j.jsx)(`option`,{value:``,children:rB.newTypeNone}),e.types.map(e=>(0,j.jsx)(`option`,{value:e.id,title:e.description,children:rB.typeOption(e.name,e.draws?.badge)},e.id))]}),n.newType&&e.types.find(e=>e.id===n.newType)?.mustNot.length?(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:rB.typeMustNot(e.types.find(e=>e.id===n.newType).mustNot)}):null]})]})]}):n.kind===`retire`?(0,j.jsx)(`div`,{className:`stack`,style:{gap:6},children:k(`component`,rB.retireComponent,{list:`${t}-c`})}):(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[k(`flow`,rB.todayFlow),k(`step`,rB.step,{inputMode:`numeric`})]}),(n.kind===`call`||n.kind===`retarget`)&&(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[k(`toComponent`,rB.toComponent,{list:`${t}-c`}),k(`toEntry`,rB.toEntry,{placeholder:rB.toEntryExample}),A(`toNew`,rB.toNew)]}),n.kind===`topic`&&(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[k(`topic`,rB.topic),k(`listener`,rB.listener,{list:`${t}-c`}),oB(n.listener)&&k(`listenerFlow`,rB.listenerFlow)]}),n.kind===`table`&&(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,j.jsxs)(`label`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`span`,{className:`hud`,children:rB.op}),(0,j.jsx)(`select`,{className:`field`,value:n.op,onChange:e=>D(`op`,e.target.value),children:[`read`,`write`,`lookup`].map(e=>(0,j.jsx)(`option`,{value:e,children:rB.ops[e]},e))})]}),k(`table`,rB.table,{placeholder:rB.tableExample}),k(`columns`,rB.columns),A(`tableNew`,rB.tableNew)]}),re?k(`what`,rB.what):k(`why`,rB.why),o&&(0,j.jsx)(`p`,{role:`alert`,className:`state error`,children:o}),m&&pB({problem:m}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:8},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:!!i,"aria-busy":i===`preview`,onClick:()=>void ee(`preview`),children:i===`preview`?rB.previewing:rB.preview}),(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:!!i||!c||!E||u!==E,"aria-busy":i===`write`,onClick:()=>void ee(`write`),children:i===`write`?rB.drawing:rB.draw})]}),c&&u===E&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`ev-say`,children:rB.previewSays}),(0,j.jsx)(Zd,{r:{files:c.files}})]}),y&&(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsx)(`p`,{className:`ev-say`,role:`status`,children:rB.written}),(0,j.jsx)(Yc,{scope:`work`}),S&&(0,j.jsxs)(`details`,{className:`work-terminal`,children:[(0,j.jsx)(`summary`,{children:w.appStep.inTerminal}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`code`,{className:`mono`,style:{whiteSpace:`pre-wrap`},children:S}),(0,j.jsx)(sr,{text:S,label:`${rB.copy}: ${S}`})]})]})]}),(0,j.jsx)(`h4`,{className:`hud`,children:rB.drawnTitle}),x.length===0?(0,j.jsx)(`p`,{className:`muted`,children:rB.drawnNone}):(0,j.jsx)(`ul`,{className:`stack sketch-drawn`,style:{gap:4,listStyle:`none`,padding:0},children:x.map(e=>{let t=`${e.flow}#${e.index}`;return(0,j.jsxs)(`li`,{className:`row between`,style:{gap:8},children:[(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`code`,{className:`mono`,children:e.flow}),` · `,e.what,e.by?(0,j.jsxs)(`span`,{className:`muted`,children:[` · `,rB.drawnBy(e.by)]}):null]}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:i!==void 0,"aria-busy":i===t,onClick:()=>void te(e),children:i===t?rB.undoing:rB.undo})]},t)})}),(0,j.jsx)(`p`,{className:`ev-say`,children:rB.fill}),(0,j.jsx)(sc,{text:`atticus change architecture ${e.change}`,label:w.runNext.copy})]})}var hB=w.roleWork.shape,gB=w.roleWork.workItems;function _B(e){return(e?.items??[]).filter(e=>e.type===`story`).map(e=>({id:e.key.replace(/^story:/,``),title:e.title}))}function vB(e){return e.op===`rename`?hB.entry.rename(e.story??``,e.name):e.op===`merge`?hB.entry.merge((e.stories??[]).join(`, `),e.name):e.op===`split`?hB.entry.split(e.story??``,[`"${e.name}"`,...(e.parts??[]).map(e=>`${e.id} "${e.name}"`)].join(`, `)):hB.entry.add(e.added??``,e.name)}function yB(e){if(!e.name.trim())return{error:hB.name};if((e.op===`rename`||e.op===`split`)&&!e.story)return{error:hB.needStory};if(e.op===`merge`&&e.stories.length<2)return{error:hB.needTwo};if(e.op===`split`&&!e.part.trim())return{error:hB.needPart};let t=e.words.trim()?{words:e.words.trim()}:{};return e.op===`rename`?{body:{op:`rename`,story:e.story,name:e.name.trim()}}:e.op===`merge`?{body:{op:`merge`,stories:e.stories,name:e.name.trim()}}:e.op===`add`?{body:{op:`add`,name:e.name.trim(),...t}}:{body:{op:`split`,story:e.story,name:e.name.trim(),...t,parts:[{name:e.part.trim(),...e.partWords.trim()?{words:e.partWords.trim()}:{}}]}}}function bB({change:e}){let t=(0,v.useId)(),n=P(`/api/changes/${encodeURIComponent(e)}/stories/shape`),r=P(`/api/changes/${encodeURIComponent(e)}/work-items`);lt(n),lt(r);let[i,a]=(0,v.useState)({op:`rename`,story:``,stories:[],name:``,words:``,part:``,partWords:``}),[o,s]=(0,v.useState)(),c=Vn(),l=Vn(),u=_B(r.state===`ready`?r.data:void 0),d=e=>a(t=>({...t,...e})),f=t=>{t.preventDefault();let r=yB(i);`error`in r?s(r.error):(s(void 0),c.run(()=>N(`/api/changes/${encodeURIComponent(e)}/stories/shape`,{method:`POST`,body:r.body}).then(()=>{d({name:``,words:``,part:``,partWords:``,stories:[]}),n.reload()}),hB.recorded))},p=e=>`${e.id} · ${e.title}`;return(0,j.jsxs)(F,{title:hB.title,span:`1 / -1`,children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:`0 0 8px`,fontSize:12.5},children:hB.intro}),(0,j.jsx)(I,{of:n,children:r=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:10},children:[r.entries.length===0?(0,j.jsx)(`div`,{className:`state`,children:hB.none}):(0,j.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0},className:`stack`,children:r.entries.map(t=>(0,j.jsxs)(`li`,{className:`row`,style:{gap:8,flexWrap:`wrap`},children:[(0,j.jsx)(`span`,{style:{fontSize:13},children:vB(t)}),(0,j.jsx)(`span`,{className:`chip ${t.state===`applied`?`done`:`warn`}`,children:t.state===`applied`?hB.applied:hB.waiting}),t.state===`waiting`&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:l.busy,"aria-label":hB.removeFor(vB(t)),onClick:()=>void l.run(()=>N(`/api/changes/${encodeURIComponent(e)}/stories/shape/${t.id}/remove`,{method:`POST`}).then(()=>n.reload()),hB.remove),children:hB.remove})]},t.id))}),(0,j.jsx)(Wn,{note:l.note}),r.entries.length>0&&(0,j.jsxs)(`section`,{"aria-labelledby":`${t}-cover`,className:`stack`,style:{gap:4},children:[(0,j.jsx)(`h3`,{id:`${t}-cover`,className:`hud`,style:{margin:0,fontSize:10},children:hB.uncovered}),r.uncovered.length?(0,j.jsx)(`ul`,{style:{margin:0,paddingLeft:18,fontSize:12.5},children:r.uncovered.map(e=>(0,j.jsx)(`li`,{children:e},e))}):(0,j.jsx)(`span`,{className:`chip done`,style:{width:`fit-content`},children:hB.allCovered})]})]})}),u.length===0?(0,j.jsx)(`p`,{className:`muted`,style:{margin:`8px 0 0`,fontSize:12.5},children:hB.notDrafted}):(0,j.jsxs)(`form`,{className:`stack`,style:{gap:6,marginTop:10},onSubmit:f,children:[(0,j.jsxs)(`fieldset`,{className:`stack`,style:{gap:6,border:0,padding:0,margin:0},children:[(0,j.jsx)(`legend`,{className:`hud`,style:{fontSize:10},children:hB.op}),(0,j.jsx)(`div`,{className:`row`,style:{gap:12,flexWrap:`wrap`},children:[`rename`,`split`,`merge`,`add`].map(e=>(0,j.jsxs)(`label`,{className:`row`,style:{gap:4},children:[(0,j.jsx)(`input`,{type:`radio`,name:`${t}-op`,checked:i.op===e,onChange:()=>d({op:e})}),hB.ops[e]]},e))})]}),(i.op===`rename`||i.op===`split`)&&(0,j.jsxs)(`div`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`label`,{htmlFor:`${t}-story`,className:`hud`,style:{fontSize:10},children:hB.story}),(0,j.jsxs)(`select`,{id:`${t}-story`,className:`field`,value:i.story,onChange:e=>d({story:e.target.value}),children:[(0,j.jsx)(`option`,{value:``,children:hB.needStory}),u.map(e=>(0,j.jsx)(`option`,{value:e.id,children:p(e)},e.id))]})]}),i.op===`merge`&&(0,j.jsxs)(`fieldset`,{className:`stack`,style:{gap:2,border:0,padding:0,margin:0},children:[(0,j.jsx)(`legend`,{className:`hud`,style:{fontSize:10},children:hB.stories}),u.map(e=>(0,j.jsxs)(`label`,{className:`row`,style:{gap:4},children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:i.stories.includes(e.id),onChange:t=>d({stories:t.target.checked?[...i.stories,e.id]:i.stories.filter(t=>t!==e.id)})}),p(e)]},e.id))]}),(0,j.jsxs)(`div`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`label`,{htmlFor:`${t}-name`,className:`hud`,style:{fontSize:10},children:i.op===`split`?hB.firstName:hB.name}),(0,j.jsx)(`input`,{id:`${t}-name`,className:`field`,value:i.name,onChange:e=>d({name:e.target.value})})]}),(i.op===`add`||i.op===`split`)&&(0,j.jsxs)(`div`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`label`,{htmlFor:`${t}-words`,className:`hud`,style:{fontSize:10},children:hB.words}),(0,j.jsx)(`textarea`,{id:`${t}-words`,className:`field`,rows:2,value:i.words,onChange:e=>d({words:e.target.value})})]}),i.op===`split`&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`label`,{htmlFor:`${t}-part`,className:`hud`,style:{fontSize:10},children:hB.part}),(0,j.jsx)(`input`,{id:`${t}-part`,className:`field`,value:i.part,onChange:e=>d({part:e.target.value})})]}),(0,j.jsxs)(`div`,{className:`stack`,style:{gap:2},children:[(0,j.jsx)(`label`,{htmlFor:`${t}-part-words`,className:`hud`,style:{fontSize:10},children:hB.partWords}),(0,j.jsx)(`textarea`,{id:`${t}-part-words`,className:`field`,rows:2,value:i.partWords,onChange:e=>d({partWords:e.target.value})})]})]}),o&&(0,j.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:0},children:o}),(0,j.jsx)(`div`,{className:`row`,children:(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:c.busy,children:c.busy?hB.recording:hB.record})}),(0,j.jsx)(Wn,{note:c.note})]})]})}function xB(e){return e.action===`create`?gB.toCreate:e.action===`update`?gB.changed:e.action===`orphaned`?gB.gone:e.id?.startsWith(`manual:`)?gB.waiting:`${gB.created}: ${e.id}`}function SB({change:e}){let t=P(`/api/changes/${encodeURIComponent(e)}/work-items`);lt(t);let n=Vn();return(0,j.jsxs)(F,{title:gB.title,span:`1 / -1`,children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:`0 0 8px`,fontSize:12.5},children:gB.intro}),(0,j.jsx)(I,{of:t,empty:e=>e.items.filter(e=>e.type===`story`).length===0,emptyText:gB.empty,children:r=>{let i=r.items.filter(e=>e.action===`create`||e.action===`update`);return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,j.jsx)(`p`,{className:`work-why`,style:{margin:0},children:r.tracker===`none`?gB.none:r.tracker===`manual`?gB.manual:gB.live}),(0,j.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0},className:`stack`,children:r.items.map(t=>(0,j.jsxs)(`li`,{className:`row`,style:{gap:8,flexWrap:`wrap`,paddingLeft:t.type===`task`?18:0},children:[(0,j.jsx)(`span`,{style:{fontSize:13},children:t.type===`story`?gB.story(t.title):t.type===`task`?gB.task(t.title):gB.feature(t.title)}),(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:xB(t)}),t.step&&t.action===`unchanged`&&(0,j.jsx)(`a`,{href:`#/todo?change=${encodeURIComponent(e)}`,children:gB.openStep})]},t.key))}),r.tracker!==`none`&&i.length>0&&(0,j.jsx)(`div`,{className:`row`,children:(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:n.busy,onClick:()=>void n.run(async()=>{let n=r.tracker===`live`?await Jn(`work-items`,e):{},i=await Ze(`/api/changes/${encodeURIComponent(e)}/work-items`,n);return t.reload(),i},e=>e.lines.join(` `)),children:n.busy?gB.pushing:i.some(e=>e.action===`update`)?gB.update:r.tracker===`live`?gB.pushLive:gB.push})}),(0,j.jsx)(Wn,{note:n.note})]})}})]})}var $=w.thread,CB=class extends Error{reason;constructor(e){super($.savedNotStarted(e)),this.reason=e}};async function wB(e,t){if(await e.post(),!t)return e.reload();try{await e.start()}catch(t){throw e.reload(),new CB(Bn(t))}}function TB(e){return e instanceof CB?{clear:!0,text:e.message}:{clear:!1,text:Bn(e)}}var EB=e=>e.split(`/`).slice(-2).join(`/`);function DB({it:e}){let t=e.state===`prepared`||e.state===`waiting`;return(0,j.jsxs)(`article`,{className:`thread-item`,"aria-label":e.who===`critic`?$.criticPrompt:$.prompt,children:[(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`},children:[(0,j.jsx)(`span`,{className:`hud`,children:e.who===`critic`?$.criticPrompt:$.prompt}),(0,j.jsx)(`span`,{className:`chip ${t?`warn`:e.state===`failed`?`blocking`:`dim`}`,children:$.runState[e.state]??e.state}),e.state!==`cancelled`&&(0,j.jsx)(sr,{text:e.prompt,label:$.copyPromptFor(e.runId)})]}),t&&(0,j.jsx)(`p`,{className:`work-say`,children:$.pasteHint}),(0,j.jsxs)(`details`,{children:[(0,j.jsx)(`summary`,{children:$.showPrompt}),(0,j.jsx)(`pre`,{className:`thread-prompt`,children:e.prompt})]}),(0,j.jsxs)(`details`,{children:[(0,j.jsx)(`summary`,{children:$.details}),(0,j.jsxs)(`ul`,{className:`stage-comments`,children:[(0,j.jsx)(`li`,{children:$.detailAgent(e.details.agent,e.details.runtime)}),(0,j.jsx)(`li`,{children:$.detailAttempt(e.details.attempt)}),e.details.promptTokens!==void 0&&(0,j.jsx)(`li`,{children:$.detailTokens(e.details.promptTokens)}),e.details.model&&(0,j.jsx)(`li`,{children:$.detailModel(e.details.model)}),(0,j.jsx)(`li`,{children:(0,j.jsx)(`code`,{className:`mono`,children:e.details.promptPath})}),e.details.output&&(0,j.jsx)(`li`,{children:(0,j.jsx)(`code`,{className:`mono`,children:e.details.output})}),(0,j.jsx)(`li`,{children:(0,j.jsx)(`a`,{href:`#/runs?run=${encodeURIComponent(e.runId)}`,children:$.adminView})})]})]})]})}function OB({it:e}){return(0,j.jsxs)(`article`,{className:`thread-item`,"aria-label":e.who===`critic`?$.criticAnswer:$.answer,children:[(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`},children:[(0,j.jsx)(`span`,{className:`hud`,children:e.who===`critic`?$.criticAnswer:$.answer}),(0,j.jsx)(`span`,{className:`chip ${e.checked===`passed`?`done`:e.checked===`failed`?`blocking`:`warn`}`,children:$.checked[e.checked]})]}),e.by&&(0,j.jsx)(`p`,{className:`work-say`,children:$.checkedBy[e.by]}),e.summary.length>0&&(0,j.jsx)(`ul`,{className:`stage-comments`,children:e.summary.map(e=>(0,j.jsx)(`li`,{children:e},e))}),e.problems.length>0&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`span`,{className:`hud`,children:$.problems}),(0,j.jsx)(`ul`,{className:`stage-comments`,children:e.problems.map(e=>(0,j.jsx)(`li`,{children:e},e))})]})]})}function kB(e){let t=e.it.view.finding,n=e.it.view.options,[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(),s=t.state===`open`,c=`${t.artifact}${t.locator.line?`:${t.locator.line}`:``}`,l=(t,n)=>{if(t===`not-relevant`&&!n?.trim())return o({ok:!1,text:$.notRelevantNeeds});o(void 0),e.onAct?.(e.it,t,n)?.then(()=>o({ok:!0,text:t===`ask`?$.asked:w.stageReview.acted(w.stageReview.actions[t]??t)}),e=>o({ok:!1,text:Bn(e)}))};return(0,j.jsxs)(`article`,{className:`thread-item stage-finding`,"aria-label":`${$.finding}: ${t.id}`,children:[(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`},children:[(0,j.jsx)(`span`,{className:`hud`,children:$.finding}),(0,j.jsx)(`span`,{className:`chip ${t.severity===`blocking`?`blocking`:t.severity===`gap`?`warn`:`dim`}`,children:w.stageReview.severity[t.severity]??t.severity}),(0,j.jsx)(`span`,{className:`chip ${s?``:`done`}`,children:$.findingState[t.state]??t.state}),(0,j.jsx)(`code`,{className:`mono muted`,children:t.id})]}),(0,j.jsx)(`p`,{style:{margin:`6px 0`},children:t.summary}),(0,j.jsxs)(`p`,{className:`work-say`,style:{margin:0},children:[$.where(c),` · `,$.fix,`: `,n.fix]}),t.resolution&&(0,j.jsxs)(`p`,{className:`work-say`,children:[w.stageReview.resolved($.findingState[t.state]??t.state,t.resolution.by),t.resolution.reason?`: ${t.resolution.reason}`:``]}),s&&(0,j.jsxs)(`div`,{className:`row`,style:{gap:6,flexWrap:`wrap`,marginTop:6},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,"aria-label":$.replyFor(t.id),onClick:()=>e.onReplyTo(e.it),children:$.reply}),n.apply&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,"aria-label":$.makeFixFor(t.id),onClick:()=>e.it.assistantWrites||!e.it.edit?e.onFixToAssistant(e.it):i(!0),children:$.makeFix}),n.ask&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,"aria-label":$.askOwnerFor(t.id,n.ask.owner),onClick:()=>l(`ask`),children:$.askOwner(n.ask.owner)}),n.dismiss&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>l(`not-relevant`,e.reason),children:$.notRelevant})]}),r&&e.it.edit&&(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6,marginTop:8},children:[(0,j.jsx)(`p`,{className:`work-say`,children:$.fixInEditor(t.artifact)}),(0,j.jsx)(Qo,{change:e.change,artifact:e.it.edit.artifact,...e.it.edit.file?{file:e.it.edit.file}:{},...e.it.edit.line?{line:e.it.edit.line}:{},onClose:()=>i(!1),onSaved:()=>{i(!1),l(`apply`)}})]}),a&&(0,j.jsx)(`p`,{role:a.ok?`status`:`alert`,className:a.ok?`work-say`:`state error`,children:a.text})]})}function AB({it:e,onAnswered:t}){let n=e.question;return(0,j.jsxs)(`article`,{className:`thread-item`,"aria-label":$.question,children:[(0,j.jsx)(`span`,{className:`hud`,children:$.question}),n.state===`open`?(0,j.jsxs)(`details`,{open:!0,children:[(0,j.jsx)(`summary`,{children:$.answerHere(n.question)}),(0,j.jsx)(qM,{question:n,onAnswered:t})]}):(0,j.jsxs)(`p`,{style:{margin:`6px 0 0`},children:[n.question,` `,(0,j.jsx)(`span`,{className:`muted`,children:$.answered(n.answer?.text??n.options[(n.answer?.option??1)-1]?.label??``)})]})]})}function jB({it:e,onKeep:t}){let[n,r]=(0,v.useState)(),[i,a]=(0,v.useState)(!1);return(0,j.jsxs)(`article`,{className:`thread-item`,"aria-label":$.dropped,children:[(0,j.jsx)(`span`,{className:`hud`,children:$.dropped}),(0,j.jsx)(`p`,{style:{margin:`6px 0`},children:e.question}),(0,j.jsxs)(`p`,{className:`work-say`,style:{margin:0},children:[$.droppedCites(e.evidence.join(`, `)),` `,e.nearest?$.droppedNearest(e.nearest):$.droppedNone]}),(0,j.jsx)(`div`,{style:{marginTop:6},children:(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:i,"aria-label":$.keepFor(e.question),onClick:()=>{a(!0),(t?.(e.key)??Promise.resolve()).then(()=>r({ok:!0,text:$.kept}),e=>{a(!1),r({ok:!1,text:Bn(e)})})},children:$.keep})}),n&&(0,j.jsx)(`p`,{role:n.ok?`status`:`alert`,className:n.ok?`work-say`:`state error`,children:n.text})]})}function MB(e){let t=e.it;switch(t.kind){case`prompt`:return(0,j.jsx)(DB,{it:t});case`answer`:return(0,j.jsx)(OB,{it:t});case`changed`:return(0,j.jsxs)(`article`,{className:`thread-item`,"aria-label":$.changed,children:[(0,j.jsx)(`span`,{className:`hud`,children:$.changed}),(0,j.jsx)(`ul`,{className:`stage-comments`,children:t.files.map(e=>(0,j.jsx)(`li`,{children:EB(e)},e))})]});case`finding`:return(0,j.jsx)(kB,{it:t,change:e.change,onReplyTo:e.onReplyTo,onFixToAssistant:e.onFixToAssistant,reason:e.reason,...e.handlers.onAct?{onAct:e.handlers.onAct}:{}});case`question`:return(0,j.jsx)(AB,{it:t,onAnswered:()=>e.handlers.onAnswered?.()});case`reply`:return(0,j.jsxs)(`article`,{className:`thread-item thread-reply`,"aria-label":$.you(t.by),children:[(0,j.jsxs)(`span`,{className:`hud`,children:[$.you(t.by),t.about?` · ${$.aboutFinding(t.about)}`:``]}),(0,j.jsx)(`p`,{style:{margin:`6px 0 0`},children:t.text}),(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:t.read?$.read:$.unread})]});case`correction`:return(0,j.jsxs)(`article`,{className:`thread-item thread-reply`,"aria-label":$.correction(t.label),children:[(0,j.jsx)(`span`,{className:`hud`,children:$.correction(t.label)}),(0,j.jsx)(`p`,{style:{margin:`6px 0 0`},children:t.text}),(0,j.jsxs)(`span`,{className:`muted`,style:{fontSize:12},children:[t.by,` · `,t.state]})]});case`dropped`:return(0,j.jsx)(jB,{it:t,...e.handlers.onKeep?{onKeep:e.handlers.onKeep}:{}});case`note`:return(0,j.jsx)(`p`,{role:`note`,className:`work-say thread-item`,children:t.text})}}function NB(e){let t=(0,v.useId)(),[n,r]=(0,v.useState)(),[i,a]=(0,v.useState)(!1),o=(0,v.useRef)(null);if((0,v.useEffect)(()=>{n&&jt(o.current)},[n]),!e.v.reply.open)return(0,j.jsx)(`p`,{className:`work-say`,children:e.v.reply.why??$.replyClosed});let s=t=>n=>{if(n?.preventDefault(),!e.text.trim())return r({ok:!1,text:$.needText});a(!0),r(void 0),(e.handlers.onReply?.(e.text.trim(),e.about,t)??Promise.resolve()).then(()=>{a(!1),e.setText(``),e.onClearAbout(),r({ok:!0,text:$.sent})},t=>{a(!1);let n=TB(t);n.clear&&(e.setText(``),e.onClearAbout()),r({ok:!1,text:n.text})})},c=!!e.v.waiting;return(0,j.jsxs)(`form`,{className:`stack thread-reply-box`,style:{gap:4},onSubmit:s(!c),children:[(0,j.jsx)(`label`,{htmlFor:`${t}-r`,className:`hud`,children:e.about?$.replyAbout(e.about.view.finding.id):$.replyLabel}),(0,j.jsx)(`textarea`,{id:`${t}-r`,ref:e.box,className:`field`,rows:3,value:e.text,"aria-describedby":`${t}-h`,onChange:t=>e.setText(t.target.value)}),(0,j.jsx)(`p`,{id:`${t}-h`,className:`work-say`,style:{margin:0},children:$.replyHint}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:6,flexWrap:`wrap`},children:[(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:i,children:i?$.sending:c?$.sendOnly:$.send}),!c&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:i,onClick:()=>s(!1)(),children:$.sendOnly}),e.about&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:e.onClearAbout,children:$.clearAbout})]}),n&&(0,j.jsx)(`p`,{ref:o,tabIndex:-1,role:n.ok?`status`:`alert`,className:n.ok?`work-say`:`state error`,children:n.text})]})}function PB(e){let[t,n]=(0,v.useState)(e.asking===!0),r=(0,v.useRef)(null),i=(0,v.useRef)(null),a=(0,v.useRef)(t),o=(0,v.useId)();return(0,v.useEffect)(()=>{t?r.current?.focus():a.current&&i.current?.focus(),a.current=t},[t]),t?(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},role:`group`,"aria-labelledby":o,children:[(0,j.jsx)(`p`,{id:o,ref:r,tabIndex:-1,style:{margin:0},children:$.byPersonConfirm(e.files)}),(0,j.jsx)(Hr,{args:e.args}),(0,j.jsx)(`div`,{children:(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>n(!1),children:$.byPersonKeep})})]}):(0,j.jsx)(`div`,{children:(0,j.jsx)(`button`,{ref:i,type:`button`,className:`btn`,onClick:()=>n(!0),children:$.byPersonReplace(e.files)})})}function FB(e){let[t,n]=(0,v.useState)(),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)({busy:!1}),s=(0,v.useRef)(null),c=e=>{n(e),s.current?.focus()},l=e;return(0,j.jsxs)(F,{title:$.title(e.stage),span:`1 / -1`,className:`cw-thread`,children:[(0,j.jsx)(ko,{text:$.intro}),(0,j.jsx)(I,{of:e.of,children:u=>{let d=e=>{n(e),i($.fixToAssistant(e.view.options.fix)),s.current?.focus()};return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:10},children:[(0,j.jsx)(`p`,{role:`status`,"aria-live":`polite`,className:`thread-headline`,style:{margin:0},children:u.headline}),u.byPerson&&u.byPerson.length>0&&(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,j.jsx)(`p`,{style:{margin:0},children:(0,j.jsx)(`a`,{href:`#/cockpit?change=${encodeURIComponent(u.change)}`,children:$.byPersonGoOn})}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:$.byPersonAgain}),(0,j.jsx)(PB,{files:u.byPerson,args:[...u.step,`--force`]})]}),!u.waiting&&u.state!==`done`&&(0,j.jsxs)(`div`,{className:`cw-thread-start`,children:[(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:a.busy,onClick:()=>{o({busy:!0}),(e.onStart?.()??Promise.resolve()).then(()=>o({busy:!1}),e=>o({busy:!1,error:Bn(e)}))},children:a.busy?$.starting:u.state===`not-started`?$.start:$.startNext}),a.error&&(0,j.jsx)(`p`,{role:`alert`,className:`state error`,children:a.error})]}),u.items.length===0?u.state===`done`?null:(0,j.jsx)(`div`,{className:`state`,children:$.empty}):(0,j.jsx)(`ol`,{className:`thread`,"aria-label":$.title(e.stage),children:u.items.map((e,n)=>(0,j.jsx)(`li`,{children:(0,j.jsx)(MB,{it:e,change:u.change,handlers:l,onReplyTo:c,onFixToAssistant:d,reason:t&&e.kind===`finding`&&t.view.finding.id===e.view.finding.id?r:``})},`${e.kind}-${n}-${e.at}`))}),(0,j.jsx)(NB,{v:u,about:t,onClearAbout:()=>n(void 0),text:r,setText:i,handlers:l,box:s}),u.problems.length>0&&(0,j.jsx)(_c,{list:u.problems})]})}})]})}function IB({change:e,stage:t}){let n=`/api/changes/${encodeURIComponent(e)}/stages/${t}/thread`,r=P(n);St(e=>{(e.type===`file.changed`||e.type===`run.changed`)&&r.reload()});let i=async()=>{let e=r.state===`ready`?r.data:void 0;e&&(await N(`/api/runs/handoff`,{method:`POST`,body:{args:e.step}}),r.reload())};return(0,j.jsx)(FB,{of:r,stage:t,onStart:i,onReply:(e,t,a)=>wB({post:()=>N(n,{method:`POST`,body:t?{kind:`finding`,finding:t.view.finding.id,gate:t.view.finding.gate,text:e}:{kind:`reply`,text:e}}),start:i,reload:()=>r.reload()},a),onAct:async(t,n,i)=>{let a=t.view.finding;await N(`/api/findings/${encodeURIComponent(e)}/${encodeURIComponent(a.id)}/action`,{method:`POST`,body:{action:n,gate:a.gate,...i?{reason:i}:{},...n===`ask`&&t.view.options.ask?{askedOf:t.view.options.ask.owner}:{}}}),r.reload()},onKeep:async e=>{await N(n,{method:`POST`,body:{kind:`keep`,key:e}}),r.reload()},onAnswered:()=>r.reload()})}var LB=w.work,RB=e=>e?e.slice(0,10):``;function zB({d:e}){return e.by===`ai`?(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:LB.draftedByAiWhy}):(0,j.jsxs)(`p`,{className:`work-say`,style:{margin:0},children:[(0,j.jsx)(`span`,{className:`chip done`,children:e.who?LB.editedBy(e.who):LB.editedByPerson}),` `,e.who?LB.editedByWhy(e.who,RB(e.at)):LB.editedByHand]})}function BB(e){let t=e.of.state===`ready`&&e.of.data.present;return(0,j.jsx)(F,{title:LB.placementTitle,span:`1 / -1`,meta:t&&e.onEdit?(0,j.jsx)(`button`,{ref:e.editRef,type:`button`,className:`btn`,"aria-label":LB.editPlacementLabel,onClick:e.onEdit,children:LB.editPlacement}):void 0,children:(0,j.jsx)(I,{of:e.of,empty:e=>!e.present,emptyContent:(0,j.jsx)(`div`,{className:`state`,children:LB.placementNotYet}),children:e=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[e.drafted&&(0,j.jsx)(zB,{d:e.drafted}),(0,j.jsx)(`span`,{className:`mono muted`,style:{fontSize:11},children:e.file}),e.content.trim()===``?(0,j.jsx)(`div`,{className:`state`,children:LB.placementNotDrawn}):(0,j.jsx)(`div`,{tabIndex:0,role:`region`,"aria-label":LB.placementText,style:{maxHeight:520,overflowY:`auto`,paddingRight:6},children:(0,j.jsx)(zn,{text:e.content})})]})})})}function VB(e){let[t,n]=(0,v.useState)(),[r,i]=(0,v.useState)(e.d.sha256),a=Vn(),o=(0,v.useRef)(null),s=`placement-${e.change}`;(0,v.useEffect)(()=>{o.current?.focus()},[]);let c=t!==void 0&&t!==e.d.sourceContent,l=()=>e.onClose(!1);return(0,j.jsx)(F,{title:LB.placementEditTitle,span:`1 / -1`,meta:e.d.source,children:(0,j.jsxs)(`form`,{className:`stack`,onKeyDown:Dt(l),onSubmit:o=>{o.preventDefault(),a.run(async()=>{let a=await N(`/api/changes/${encodeURIComponent(e.change)}/placement`,{method:`PUT`,body:{content:t??e.d.sourceContent,baseSha256:r}});return i(a.sha256),n(void 0),e.onClose(!0),a},LB.placementSaved)},children:[(0,j.jsx)(`label`,{htmlFor:s,className:`sr`,children:LB.placementSourceLabel}),(0,j.jsx)(`p`,{id:`${s}-hint`,className:`work-why`,style:{margin:0},children:LB.placementSourceHint}),(0,j.jsx)(`textarea`,{ref:o,id:s,value:t??e.d.sourceContent,"aria-describedby":`${s}-hint`,onChange:e=>n(e.target.value),rows:18,spellCheck:!0,style:{width:`100%`,background:`var(--box)`,color:`var(--text)`,border:`1px solid var(--line-2)`,borderRadius:8,padding:12,font:`13px/1.6 var(--mono)`}}),(0,j.jsxs)(`div`,{className:`row`,children:[(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:a.busy,children:LB.placementSave}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:l,children:c?LB.placementCancel:LB.placementClose})]}),(0,j.jsx)(Wn,{note:a.note})]})})}function HB({change:e}){let t=P(`/api/changes/${encodeURIComponent(e)}/placement`);lt(t);let[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(!1),o=(0,v.useRef)(null),s=(0,v.useRef)(!1);return(0,v.useEffect)(()=>{!n&&s.current&&o.current?.focus(),s.current=n},[n]),n&&t.state===`ready`?(0,j.jsx)(VB,{change:e,d:t.data,onClose:e=>{a(e),r(!1),t.reload()}}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(BB,{of:t,editRef:o,onEdit:()=>{a(!1),r(!0)}}),i&&(0,j.jsx)(`p`,{role:`status`,className:`work-say`,style:{gridColumn:`1 / -1`,margin:0},children:LB.placementSaved})]})}var UB=w.stageDrafts,WB=e=>e?e.slice(0,10):``,GB=e=>`${e.file}#${e.item??``}`;function KB({d:e}){return e.by===`ai`?(0,j.jsxs)(`span`,{className:`row`,style:{gap:6,flexWrap:`wrap`},children:[(0,j.jsx)(`span`,{className:`chip ai`,children:UB.draftedByAi}),e.run&&(0,j.jsx)(`a`,{href:ci({run:e.run}),"aria-label":UB.openRun(e.run),children:UB.draftedByAiRun(e.run)}),(0,j.jsx)(`span`,{className:`sr`,children:UB.draftedByAiWhy(e.stage??``)})]}):(0,j.jsxs)(`span`,{className:`row`,style:{gap:6,flexWrap:`wrap`},children:[(0,j.jsx)(`span`,{className:`chip done`,children:e.who?UB.editedBy(e.who,WB(e.at)):UB.editedByPerson}),!e.who&&(0,j.jsx)(`span`,{className:`muted`,children:UB.editedOutside})]})}function qB(e){let t=(0,v.useId)(),n=(0,v.useRef)(null),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(!0),[s,c]=(0,v.useState)(e.target.like??``),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)();return(0,v.useEffect)(()=>{n.current?.focus()},[]),(0,j.jsxs)(`form`,{className:`stack stage-correct`,"aria-labelledby":`${t}-h`,onSubmit:t=>{t.preventDefault(),r.trim()?(f(void 0),u(!0),e.onSave({file:e.target.file,...e.target.item?{item:e.target.item}:{},text:r.trim(),similar:a,...a&&s.trim()?{like:s.trim()}:{}}).then(t=>e.onClose(t)).catch(e=>{f(Bn(e)),u(!1)})):(f(UB.needText),n.current?.focus())},onKeyDown:Dt(()=>e.onClose()),style:{gap:6,margin:`6px 0 10px`},children:[(0,j.jsx)(`p`,{id:`${t}-h`,className:`work-say`,style:{margin:0,fontWeight:600},children:UB.formTitle(e.target.label)}),(0,j.jsx)(`label`,{htmlFor:`${t}-text`,children:UB.textLabel}),(0,j.jsx)(`p`,{id:`${t}-hint`,className:`work-why`,style:{margin:0},children:UB.textHint}),(0,j.jsx)(`textarea`,{ref:n,id:`${t}-text`,value:r,rows:3,"aria-describedby":`${t}-hint${d?` ${t}-problem`:``}`,"aria-invalid":d?!0:void 0,onChange:e=>i(e.target.value),style:{width:`100%`,background:`var(--box)`,color:`var(--text)`,border:`1px solid var(--line-2)`,borderRadius:8,padding:8}}),(0,j.jsxs)(`label`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:a,"aria-describedby":`${t}-similar`,onChange:e=>o(e.target.checked)}),UB.similar]}),(0,j.jsx)(`p`,{id:`${t}-similar`,className:`work-why`,style:{margin:0},children:UB.similarHint}),a&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`label`,{htmlFor:`${t}-like`,children:UB.likeLabel}),(0,j.jsx)(`input`,{id:`${t}-like`,value:s,"aria-describedby":`${t}-like-hint`,onChange:e=>c(e.target.value),className:`run-select`}),(0,j.jsx)(`p`,{id:`${t}-like-hint`,className:`work-why`,style:{margin:0},children:UB.likeHint})]}),d&&(0,j.jsx)(`p`,{id:`${t}-problem`,role:`alert`,className:`state error`,style:{margin:0},children:d}),l&&(0,j.jsx)(`p`,{role:`status`,"aria-busy":`true`,className:`work-say`,style:{margin:0},children:UB.saving}),(0,j.jsxs)(`div`,{className:`row`,children:[(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:l,children:UB.save}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>e.onClose(),children:UB.cancel})]})]})}function JB(e){let t=e.c;return(0,j.jsxs)(`li`,{children:[(0,j.jsxs)(`div`,{className:`row`,style:{gap:6,flexWrap:`wrap`},children:[(0,j.jsx)(`span`,{className:`chip ${t.state===`applied`?`done`:t.state===`read`?`warn`:``}`,children:UB.state[t.state]??t.state}),(0,j.jsx)(`code`,{className:`mono`,children:t.file}),t.item&&(0,j.jsx)(`span`,{children:t.label}),(0,j.jsxs)(`span`,{className:`muted`,children:[UB.scope[t.scope]??t.scope,t.like?`, ${UB.likeOf(t.like)}`:``]})]}),(0,j.jsxs)(`p`,{className:`work-say`,style:{margin:`4px 0`},children:[`“`,t.text,`” `,(0,j.jsxs)(`span`,{className:`muted`,children:[`(`,UB.by(t.by,WB(t.at)),`)`]}),t.run&&t.state!==`waiting`&&(0,j.jsxs)(j.Fragment,{children:[` `,(0,j.jsx)(`a`,{href:ci({run:t.run}),"aria-label":UB.openRun(t.run),children:UB.appliedIn(t.run)})]})]}),t.state===`read`&&(0,j.jsx)(`p`,{className:`work-why`,style:{margin:`0 0 4px`},children:UB.readNotApplied}),t.touched&&t.touched.length>0&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`work-why`,style:{margin:0},children:UB.touched(t.touched.length)}),(0,j.jsx)(`ul`,{className:`stage-comments`,children:t.touched.map(e=>(0,j.jsx)(`li`,{children:(0,j.jsx)(`code`,{className:`mono`,children:e})},e))})]}),t.state===`waiting`&&e.onRemove&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:e.busy,"aria-label":UB.removeFor(t.label),onClick:()=>e.onRemove?.(t),children:UB.remove})]})}function YB(e){let t=e.f,n={file:t.file,label:t.file},r=t=>!!e.open&&GB(e.open)===GB(t);return(0,j.jsxs)(`li`,{className:`stage-draft`,children:[(0,j.jsxs)(`div`,{className:`row between`,style:{gap:8,flexWrap:`wrap`},children:[(0,j.jsx)(`code`,{className:`mono`,children:t.path}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`},children:[t.drafted&&(0,j.jsx)(KB,{d:t.drafted}),e.correctable&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,"aria-label":UB.correctFile(t.file),"aria-expanded":r(n),onClick:t=>e.onOpen(n,t.currentTarget),children:UB.correct})]})]}),r(n)&&e.form(n),t.items.length>0&&e.correctable&&(0,j.jsxs)(`details`,{children:[(0,j.jsx)(`summary`,{children:UB.items(t.file)}),(0,j.jsx)(`ul`,{className:`stage-comments`,children:t.items.map(n=>{let i={file:t.file,item:n.id,label:n.label,...n.like?.[0]?{like:n.like[0]}:{}};return(0,j.jsxs)(`li`,{children:[(0,j.jsxs)(`div`,{className:`row between`,style:{gap:8},children:[(0,j.jsx)(`span`,{children:n.label}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,"aria-label":UB.correctItem(n.label),"aria-expanded":r(i),onClick:t=>e.onOpen(i,t.currentTarget),children:UB.correct})]}),r(i)&&e.form(i)]},n.id)})})]})]})}function XB(e){return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:e.text}),e.commit&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`work-why`,style:{margin:`4px 0`},children:UB.ridesHandoff(e.files?.join(`, `)||UB.correctionsFile)}),(0,j.jsx)(`p`,{className:`work-why`,style:{margin:`4px 0`},children:UB.outsideHandoff}),(0,j.jsx)(Yc,{scope:`work`}),(0,j.jsxs)(`details`,{className:`work-terminal`,children:[(0,j.jsx)(`summary`,{children:w.runNext.orTerminal}),(0,j.jsx)(sc,{text:e.commit,label:UB.copyCommit,noRun:!0})]})]})]})}function ZB(e){let[t,n]=(0,v.useState)(),[r,i]=(0,v.useState)(),[a,o]=(0,v.useState)(!1),s=(0,v.useRef)(null),c=(0,v.useRef)(null);(0,v.useEffect)(()=>{r&&jt(c.current)},[r]);let l=e=>{let t=s.current;n(void 0),e?i(t=>({text:UB.saved(e.correction.label),files:e.files,commit:e.commit,n:(t?.n??0)+1})):setTimeout(()=>t?.focus(),0)},u=t=>{e.onRemove&&(o(!0),e.onRemove(t).then(()=>i(e=>({text:UB.removed,n:(e?.n??0)+1}))).catch(e=>i(t=>({text:Bn(e),n:(t?.n??0)+1}))).finally(()=>o(!1)))};return(0,j.jsxs)(F,{title:UB.title,span:`1 / -1`,children:[(0,j.jsx)(ko,{text:UB.intro}),(0,j.jsx)(I,{of:e.of,empty:e=>e.files.length===0&&e.corrections.length===0,emptyContent:(0,j.jsx)(`div`,{className:`state`,children:UB.none}),children:i=>{let o=i.corrections.filter(e=>e.state===`waiting`),d=i.corrections.filter(e=>e.state!==`waiting`);return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:10},children:[i.problems.map(e=>(0,j.jsxs)(`p`,{role:`alert`,className:`state error`,style:{margin:0},children:[(0,j.jsx)(`code`,{className:`mono`,children:e.file}),`: `,e.message]},e.file)),(0,j.jsx)(`ul`,{className:`stage-drafts`,"aria-label":UB.title,children:i.files.map(r=>(0,j.jsx)(YB,{f:r,open:t,correctable:!!e.onCorrect,onOpen:(e,t)=>{s.current=t,n(e)},form:t=>(0,j.jsx)(qB,{target:t,onSave:e.onCorrect,onClose:l})},r.file))}),(0,j.jsx)(`div`,{ref:c,tabIndex:-1,role:`status`,children:r&&(0,j.jsx)(XB,{text:r.text,...r.files?{files:r.files}:{},...r.commit?{commit:r.commit}:{}})}),(0,j.jsxs)(`section`,{"aria-label":UB.waitingTitle,children:[(0,j.jsx)(`h3`,{className:`h`,style:{fontSize:14,margin:`4px 0`},children:UB.waitingTitle}),o.length===0?(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:UB.waitingNone}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`ul`,{className:`stage-comments`,children:o.map(t=>(0,j.jsx)(JB,{c:t,busy:a,...e.onRemove?{onRemove:u}:{}},t.id))}),(0,j.jsx)(`p`,{className:`work-say`,style:{margin:`8px 0 0`,fontWeight:600},children:UB.runAgain}),(0,j.jsx)(`p`,{className:`work-why`,style:{margin:`0 0 6px`},children:UB.runAgainWhy}),(0,j.jsx)(cc,{command:i.next.command,slash:i.next.slash})]})]}),d.length>0&&(0,j.jsxs)(`section`,{"aria-label":UB.doneTitle,children:[(0,j.jsx)(`h3`,{className:`h`,style:{fontSize:14,margin:`4px 0`},children:UB.doneTitle}),(0,j.jsx)(`ul`,{className:`stage-comments`,children:d.map(e=>(0,j.jsx)(JB,{c:e},e.id))})]})]})}})]})}function QB({change:e,page:t}){let n=encodeURIComponent(e),r=P(`/api/changes/${n}/drafts/${t}`);return lt(r),(0,j.jsx)(ZB,{of:r,onCorrect:async e=>{let t=await N(`/api/changes/${n}/corrections`,{method:`POST`,body:e});return r.reload(),t},onRemove:async e=>{await N(`/api/changes/${n}/corrections/${encodeURIComponent(e.id)}/remove`,{method:`POST`}),r.reload()}})}var $B=w.changeImpact,eV=e=>`none`in e?$B.noTeam(e.none):e.name?`${e.team} (${e.name})`:e.team;function tV({i:e}){return e.flows?(0,j.jsxs)(j.Fragment,{children:[e.items.length===0?(0,j.jsx)(`p`,{children:$B.nothing}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`est-big`,children:$B.counts(e.breaks,e.mayBreak,e.routes)}),(e.byAi??0)>0&&(0,j.jsx)(`p`,{children:(0,j.jsx)(`a`,{href:`#/decisions?kind=link`,children:w.decisions.impactByAi(e.byAi)})}),e.upstream&&(e.upstream.breaks>0||e.upstream.mayBreak>0)&&(0,j.jsx)(`p`,{children:$B.upstream(e.upstream.breaks,e.upstream.mayBreak)}),e.items.map((t,n)=>{let r=`impact-${n}`;return(0,j.jsxs)(`section`,{"aria-labelledby":r,className:`est-band`,children:[(0,j.jsxs)(`h3`,{id:r,className:`hud`,children:[(0,j.jsx)(`span`,{className:`mono`,children:t.name}),` `,(0,j.jsxs)(`span`,{className:`muted`,children:[`(`,t.flow,`)`]})]}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:`0 0 6px`},children:$B.owned(eV(t.owner))}),(0,j.jsxs)(`p`,{children:[(0,j.jsxs)(`strong`,{children:[$B.why,`:`]}),` `,t.why.join(`; `)]}),t.fields.gone.length>0&&(0,j.jsxs)(`p`,{children:[(0,j.jsxs)(`strong`,{children:[$B.gone,`:`]}),` `,(0,j.jsx)(`span`,{className:`mono`,children:t.fields.gone.join(`, `)})]}),t.fields.required.length>0&&(0,j.jsxs)(`p`,{children:[(0,j.jsxs)(`strong`,{children:[$B.required,`:`]}),` `,(0,j.jsx)(`span`,{className:`mono`,children:t.fields.required.join(`, `)})]}),t.callers.length===0?(0,j.jsx)(`p`,{children:$B.nobody}):(0,j.jsxs)(`table`,{className:`run-table`,children:[(0,j.jsx)(`caption`,{className:`sr`,children:$B.callersCaption(t.name)}),(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{scope:`col`,children:$B.col.who}),(0,j.jsx)(`th`,{scope:`col`,children:$B.col.verdict}),(0,j.jsx)(`th`,{scope:`col`,children:$B.col.owner}),(0,j.jsx)(`th`,{scope:`col`,children:$B.col.where})]})}),(0,j.jsx)(`tbody`,{children:t.callers.map(e=>(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`td`,{className:`mono`,children:e.component}),(0,j.jsxs)(`td`,{children:[e.verdict===`breaks`?(0,j.jsx)(`strong`,{children:$B.breaks}):$B.mayBreak($B.guessWords[e.guessed??``]??``),e.decidedByAi&&(0,j.jsxs)(`div`,{children:[(0,j.jsx)(Ni,{}),(0,j.jsxs)(`span`,{className:`sr`,children:[` `,w.decisions.impactCaller]})]})]}),(0,j.jsx)(`td`,{children:eV(e.owner)}),(0,j.jsx)(`td`,{className:`mono`,children:[...e.at,...e.flows,...e.routes].join(`, `)})]},e.component))})]}),(t.chain??[]).length>0&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`h4`,{className:`hud`,children:$B.chain}),(0,j.jsxs)(`table`,{className:`run-table`,children:[(0,j.jsx)(`caption`,{className:`sr`,children:$B.chainCaption(t.name)}),(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{scope:`col`,children:$B.chainCol.who}),(0,j.jsx)(`th`,{scope:`col`,children:$B.chainCol.via}),(0,j.jsx)(`th`,{scope:`col`,children:$B.chainCol.verdict}),(0,j.jsx)(`th`,{scope:`col`,children:$B.chainCol.owner}),(0,j.jsx)(`th`,{scope:`col`,children:$B.chainCol.where})]})}),(0,j.jsx)(`tbody`,{children:(t.chain??[]).map(e=>{let t=$B.guessWords[e.guessed??``]??``;return(0,j.jsxs)(`tr`,{children:[(0,j.jsxs)(`td`,{className:`mono`,style:{paddingLeft:`${(e.depth-1)*14}px`},children:[e.component,` `,(0,j.jsxs)(`span`,{className:`sr`,children:[`(`,$B.depth(e.depth),`)`]})]}),(0,j.jsxs)(`td`,{children:[(0,j.jsx)(`span`,{className:`mono`,children:$B.via(e.via)}),e.entries.length>0&&(0,j.jsxs)(`span`,{className:`muted mono`,children:[` (`,e.entries.join(`, `),`)`]})]}),(0,j.jsx)(`td`,{children:e.verdict===`breaks`?(0,j.jsx)(`strong`,{children:$B.breaks}):e.restsOn?$B.restsOn(e.restsOn,t):$B.restsOwn(t)}),(0,j.jsx)(`td`,{children:eV(e.owner)}),(0,j.jsx)(`td`,{className:`mono`,children:[...e.at,...e.flows,...e.routes].join(`, `)})]},e.component)})})]})]}),t.capped&&(0,j.jsx)(`p`,{className:`muted`,children:$B.capped(Math.max(...(t.chain??[]).map(e=>e.depth)))}),[...t.callers,...t.chain??[]].some(e=>e.verdict===`may-break`)&&(0,j.jsx)(`p`,{role:`note`,className:`muted`,children:$B.confirm(e.rule)}),t.routes.length>0&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`h4`,{className:`hud`,children:$B.routes}),(0,j.jsx)(`ul`,{children:t.routes.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`span`,{className:`mono`,children:$B.route(e.id,e.callers)}),` `,(0,j.jsxs)(`span`,{className:`muted`,children:[`(`,[e.proxy,e.basepath,e.repo].filter(Boolean).join(`, `),`)`,` `,$B.owned(eV(e.owner))]})]},e.id))})]})]},`${t.flow}.${t.id??n}`)}),(0,j.jsx)(`h3`,{className:`hud`,children:$B.teams}),(0,j.jsx)(`ul`,{children:e.owners.map(e=>(0,j.jsxs)(`li`,{children:[eV(e.owner),`: `,(0,j.jsx)(`span`,{className:`mono`,children:e.repos.join(`, `)})]},`${eV(e.owner)}.${e.repos.join(`,`)}`))})]}),e.problems.length>0&&(0,j.jsxs)(`div`,{role:`note`,className:`cd-problems`,children:[(0,j.jsx)(`h3`,{className:`hud`,children:$B.problems}),(0,j.jsx)(`ul`,{children:e.problems.map(e=>(0,j.jsx)(`li`,{children:e},e))})]}),(0,j.jsx)(sc,{text:$B.command(e.change),label:w.runNext.copy})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{children:$B.noTargets(e.change)}),(0,j.jsx)(cc,{command:`atticus change architecture ${e.change}`,slash:`/atticus-architecture ${e.change}`})]})}function nV({change:e}){let t=P(`/api/changes/${encodeURIComponent(e)}/impact`);return St(e=>{e.type===`file.changed`&&t.reload()}),(0,j.jsxs)(F,{title:$B.title,children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:`0 0 12px`,fontSize:12.5,lineHeight:1.55},children:$B.intro}),(0,j.jsx)(I,{of:t,children:e=>(0,j.jsx)(tV,{i:e})})]})}var rV=w.work,iV=w.runNext,aV={feature:[`brief`,`proposal`,`specs`,`interfaces`,`ux`],stories:[`stories`,`tasks`,`snow`],tasks:[`tasks`]};function oV(e){let t=`pick-${e.screen}`;return(0,j.jsxs)(`div`,{className:`cw-picker`,children:[(0,j.jsx)(`label`,{htmlFor:t,children:rV.pickChange}),(0,j.jsx)(`select`,{id:t,className:`run-select`,value:e.current??``,onChange:t=>Pn(e.screen,`change`,t.target.value),children:e.list.map(e=>(0,j.jsxs)(`option`,{value:e.id,children:[e.id,` · `,e.state]},e.id))})]})}function sV(e){if(!e?.present)return[];let t=e.content.trim()!==``;return[{artifact:`feature.md`,path:e.file,status:t?`done`:`ready`,written:t,openFindings:0},{artifact:`feature.yaml`,path:e.source,status:`done`,written:!0,openFindings:0}]}function cV({detail:e,stage:t,extra:n=[]}){let r=aV[t],i=[...e.artifacts.filter(e=>r.includes(e.artifact)),...n];return i.length===0?(0,j.jsx)(`div`,{className:`state`,children:rV.noFiles}):(0,j.jsx)(Gn,{caption:rV.files,rows:i,rowKey:e=>e.artifact,cols:[{label:rV.fileCol,cell:e=>e.path,mono:!0},{label:rV.statusCol,cell:e=>(0,j.jsx)(`span`,{className:`chip ${e.status===`done`?`done`:e.status===`ready`?`warn`:`dim`}`,children:qr(e)})}]})}function lV({change:e,tasks:t}){return t.length===0?(0,j.jsx)(`div`,{className:`state`,children:rV.noTasks.replace(`<change>`,e)}):(0,j.jsx)(Gn,{caption:rV.tasks,rows:t,rowKey:e=>`${e.repo}:${e.id}`,cols:[{label:rV.taskCol,cell:e=>(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`code`,{className:`mono`,children:e.id}),` `,e.description]})},{label:rV.repoTaskCol,cell:e=>e.repo,mono:!0},{label:rV.statusCol,cell:e=>(0,j.jsx)(`span`,{className:`chip ${e.done?`done`:`dim`}`,children:e.done?rV.taskDone:rV.taskOpen})},{label:rV.runCol,cell:t=>{let n=CN(e,t);return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`a`,{href:`#/tasks?change=${encodeURIComponent(e)}&task=${encodeURIComponent(t.id)}`,"aria-label":rV.openOnBoardLabel(t.id),children:rV.openOnBoard}),(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:rV.runOnBoard}),(0,j.jsxs)(`details`,{className:`work-terminal`,children:[(0,j.jsx)(`summary`,{"aria-label":w.changeWork.fromTerminalFor(t.id),children:rV.fromTerminal}),(0,j.jsx)(sc,{text:n.command,label:iV.copy}),(0,j.jsx)(sc,{text:n.slash.command,label:iV.copySlash})]})]})}}]})}function uV(e){let t=sV(e.placement?.state===`ready`?e.placement.data:void 0),n=_N[e.stage].id,r=e.cockpit?.state===`ready`?e.cockpit.data:void 0;return(0,j.jsx)(I,{of:e.list,empty:e=>e.length===0,emptyContent:(0,j.jsx)(gc,{}),children:i=>{let a=kN(i,e.wanted);if(!a)return(0,j.jsx)(pc,{});let o=e.tasks?.state===`ready`?e.tasks.data:void 0;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(Co,{title:a.title,sub:a.id,badges:(0,j.jsx)(Do,{state:a.state,blocked:!!a.openFindings?.blocking}),actions:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(si,{change:a.id}),e.stage===`tasks`&&(0,j.jsx)(`a`,{href:`#/conformance?change=${encodeURIComponent(a.id)}`,children:w.conformance.title}),(0,j.jsx)(oV,{list:i,current:a.id,screen:n})]})}),(e.stage===`stories`||e.stage===`tasks`)&&(0,j.jsxs)(`p`,{className:`cw-lead`,children:[(0,j.jsx)(`a`,{className:e.stage===`tasks`?`btn primary`:void 0,href:`#/${e.stage===`stories`?`breakdown`:`tasks`}?change=${encodeURIComponent(a.id)}`,children:e.stage===`stories`?rV.openBreakdown:rV.openTaskBoard}),` `,e.stage===`stories`?rV.openBreakdownWhy:rV.openTaskBoardWhy]}),e.stage===`tasks`&&e.tasks?.state===`loading`?(0,j.jsx)(I,{of:e.tasks,children:()=>null}):e.cockpit?.state===`loading`?(0,j.jsx)(I,{of:e.cockpit,children:()=>null}):(0,j.jsx)(uc,{step:ON(e.stage,a,o,r)}),(0,j.jsxs)(`div`,{className:`cw-cols`,children:[(0,j.jsxs)(`div`,{className:`cw-col`,children:[e.stage===`feature`&&(0,j.jsx)(HB,{change:a.id}),e.stage===`tasks`&&(0,j.jsx)(F,{title:rV.tasks,children:e.tasks?(0,j.jsx)(I,{of:e.tasks,children:e=>(0,j.jsx)(lV,{change:a.id,tasks:e})}):(0,j.jsx)(`div`,{className:`state`,children:rV.noTasks.replace(`<change>`,a.id)})}),e.stage!==`tasks`&&(0,j.jsx)(IB,{change:a.id,stage:e.stage===`feature`?`feature`:`stories`}),(0,j.jsx)(QB,{change:a.id,page:e.stage}),e.stage===`stories`&&(0,j.jsx)(Ws,{change:a.id,listed:e.detail?.state===`ready`?e.detail.data.artifacts.some(e=>e.artifact===`stories`):e.detail?.state===`error`||void 0}),e.stage===`stories`&&(0,j.jsx)(bB,{change:a.id}),(0,j.jsx)(wa,{change:a.id})]}),(0,j.jsxs)(`div`,{className:`cw-col`,children:[(0,j.jsx)(F,{title:rV.files,children:e.detail?(0,j.jsx)(I,{of:e.detail,children:n=>(0,j.jsx)(cV,{detail:n,stage:e.stage,extra:t})}):(0,j.jsx)(`div`,{className:`state`,children:rV.noFiles})}),e.stage===`stories`&&(0,j.jsx)(SB,{change:a.id}),e.stage===`feature`&&(0,j.jsx)(po,{change:a.id}),e.stage===`feature`&&(0,j.jsxs)(F,{title:w.changeKnowledge.title,children:[(0,j.jsx)(ko,{text:w.changeKnowledge.onFeature,about:w.changeKnowledge.title}),(0,j.jsx)(`p`,{className:`work-say`,style:{margin:0},children:(0,j.jsx)(`a`,{href:`#/change-knowledge?change=${encodeURIComponent(a.id)}`,children:w.changeKnowledge.openPage})})]})]})]})]})}})}function dV(e,t){let n=P(`/api/changes`),r=Nn(e,`change`),i=n.state===`ready`?kN(n.data,r):void 0,a=P(i?`/api/changes/${i.id}`:void 0),o=P(i&&t===`tasks`?`/api/changes/${i.id}/tasks`:void 0),s=P(i&&t!==`tasks`?`/api/changes/${i.id}/cockpit`:void 0),c=P(i&&t===`feature`?`/api/changes/${encodeURIComponent(i.id)}/placement`:void 0);return St(e=>{e.type===`file.changed`&&(n.reload(),a.reload(),o.reload(),s.reload(),c.reload())}),(0,j.jsx)(uV,{stage:t,list:n,wanted:r,detail:i?a:void 0,tasks:i&&t===`tasks`?o:void 0,cockpit:i&&t!==`tasks`?s:void 0,placement:i&&t===`feature`?c:void 0})}function fV({hash:e}){return dV(e,`feature`)}function pV({hash:e}){return dV(e,`stories`)}function mV({hash:e}){return dV(e,`tasks`)}function hV({list:e,wanted:t,cockpit:n}){return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(ko,{text:rV.architectureIntro}),(0,j.jsx)(I,{of:e,children:e=>{let r=kN(e,t);return r&&n?.state===`loading`?(0,j.jsx)(I,{of:n,children:()=>null}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(uc,{step:RN(e,r?{change:r,...n?.state===`ready`?{cockpit:n.data}:{}}:void 0)}),(0,j.jsx)(`p`,{className:`work-say`,style:{margin:`0 0 8px`},children:(0,j.jsx)(si,{...e.find(e=>gN(e.state)===`architecture`)?{change:e.find(e=>gN(e.state)===`architecture`).id}:{}})}),e.length>0&&(0,j.jsx)(`ul`,{className:`cw-stages cw-links`,children:e.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsxs)(`a`,{href:`#/flows?change=${encodeURIComponent(e.id)}`,children:[w.flows.openTargets,`: `,e.title]}),(0,j.jsxs)(`a`,{href:`#/change-diagram?change=${encodeURIComponent(e.id)}`,children:[w.changeDiagram.title,`: `,e.title]}),(0,j.jsxs)(`a`,{href:`#/estimate?change=${encodeURIComponent(e.id)}`,children:[w.estimate.title,`: `,e.title]})]},e.id))})]})}})]})}function gV({list:e,wanted:t}){if(e.state!==`ready`||e.data.length===0)return null;let n=kN(e.data,t);return(0,j.jsx)(`div`,{className:`bento`,style:{marginBottom:12},children:n?(0,j.jsx)(IB,{change:n.id,stage:`architecture`}):(0,j.jsxs)(F,{title:w.stageReview.title,span:`1 / -1`,children:[(0,j.jsx)(`p`,{className:`work-say`,style:{marginTop:0},children:w.stageReview.pickForArchitecture}),(0,j.jsx)(`ul`,{className:`stage-comments`,children:e.data.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`a`,{href:`#/architecture?change=${encodeURIComponent(e.id)}`,children:e.title}),` `,(0,j.jsx)(`span`,{className:`muted`,children:e.id})]},e.id))})]})})}function _V({hash:e}){let t=P(`/api/changes`),n=Nn(e,`change`),r=t.state===`ready`?kN(t.data,n):void 0,i=P(r?`/api/changes/${r.id}/cockpit`:void 0);return St(e=>{e.type===`file.changed`&&(t.reload(),i.reload())}),(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(So,{children:[(0,j.jsx)(hV,{list:t,wanted:n,...r?{cockpit:i}:{}}),r&&(0,j.jsxs)(`div`,{className:`bento`,children:[(0,j.jsx)(nV,{change:r.id}),(0,j.jsx)(QB,{change:r.id,page:`architecture`})]}),(0,j.jsx)(gV,{list:t,wanted:Nn(e,`change`)})]}),(0,j.jsx)(ck,{hash:e})]})}var vV=w.changeDiagram;function yV(e){let t=new Set(e.nodes.map(e=>e.group).filter(Boolean));return{boxes:[...e.groups.filter(e=>t.has(e.id)).map(e=>({id:e.id,label:e.label,kind:e.kind,gaps:[],childCount:0,outside:!1,group:!0,inside:0})),...e.nodes.map(e=>({id:e.id,label:e.label,kind:e.kind,gaps:[],childCount:0,outside:!1,group:!1,inside:0,...e.group?{parent:e.group}:{},...e.legend?{mark:e.legend}:{}}))],links:e.edges.map(e=>({id:e.id,from:e.from,to:e.to,type:`change`,count:1,label:e.label,async:e.async,gaps:[],...e.legend?{mark:e.legend}:{}}))}}var bV=e=>vV.mark[e??`none`]??vV.mark.none;function xV(){return(0,j.jsxs)(`ul`,{className:`cd-legend`,"aria-label":vV.legend,children:[(0,j.jsx)(`li`,{className:`cd-key m-new`,children:vV.legendNew}),(0,j.jsx)(`li`,{className:`cd-key m-modify`,children:vV.legendModify}),(0,j.jsx)(`li`,{className:`cd-key m-retire`,children:vV.legendRetire}),(0,j.jsx)(`li`,{className:`cd-key`,children:vV.legendContext})]})}function SV({map:e,sketch:t}){let n=(0,v.useMemo)(()=>yV(e),[e]),r=new Map(e.groups.map(e=>[e.id,e.label])),i=new Map(e.nodes.map(e=>[e.id,e.label])),a=t?(0,j.jsx)(dB,{change:e.change,map:e},`sketch`):null;return e.flows?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{children:[(0,j.jsxs)(`p`,{className:`muted`,style:{margin:`0 0 8px`},children:[vV.from(e.flows,e.source),` `,(0,j.jsx)(`a`,{href:SF(e.change),children:vV.flows(e.change)})]}),(0,j.jsx)(xV,{}),(0,j.jsx)(`div`,{className:`cd-canvas`,children:(0,j.jsx)(UE,{graph:n,direction:`RIGHT`,pinned:{},tidy:0,onSelect:()=>void 0,onToggle:()=>void 0,onMoved:()=>void 0,onLaid:()=>void 0})}),e.problems.length>0&&(0,j.jsxs)(`div`,{role:`note`,className:`cd-problems`,children:[(0,j.jsx)(`h3`,{className:`hud`,children:vV.problems}),(0,j.jsx)(`ul`,{children:e.problems.map(e=>(0,j.jsx)(`li`,{children:e},e))})]}),(0,j.jsx)(`h3`,{className:`hud`,children:vV.parts}),(0,j.jsxs)(`table`,{className:`run-table`,children:[(0,j.jsx)(`caption`,{className:`sr`,children:vV.caption(e.change)}),(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{scope:`col`,children:vV.col.part}),(0,j.jsx)(`th`,{scope:`col`,children:vV.col.kind}),(0,j.jsx)(`th`,{scope:`col`,children:vV.col.in}),(0,j.jsx)(`th`,{scope:`col`,children:vV.col.mark})]})}),(0,j.jsx)(`tbody`,{children:e.nodes.map(e=>(0,j.jsxs)(`tr`,{className:e.legend?`m-${e.legend}`:``,children:[(0,j.jsx)(`td`,{className:`mono`,children:e.id}),(0,j.jsx)(`td`,{children:e.kind}),(0,j.jsx)(`td`,{children:e.group?r.get(e.group)??e.group:``}),(0,j.jsx)(`td`,{children:bV(e.legend)})]},e.id))})]}),(0,j.jsx)(`h3`,{className:`hud`,children:vV.lines}),(0,j.jsxs)(`table`,{className:`run-table`,children:[(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{scope:`col`,children:vV.col.from}),(0,j.jsx)(`th`,{scope:`col`,children:vV.col.what}),(0,j.jsx)(`th`,{scope:`col`,children:vV.col.to}),(0,j.jsx)(`th`,{scope:`col`,children:vV.col.mark})]})}),(0,j.jsx)(`tbody`,{children:e.edges.map(e=>(0,j.jsxs)(`tr`,{className:e.legend?`m-${e.legend}`:``,children:[(0,j.jsx)(`td`,{className:`mono`,children:i.get(e.from)??e.from}),(0,j.jsx)(`td`,{className:`mono`,children:e.label}),(0,j.jsx)(`td`,{className:`mono`,children:i.get(e.to)??e.to}),(0,j.jsx)(`td`,{children:bV(e.legend)})]},e.id))})]}),(0,j.jsx)(`h3`,{className:`hud`,children:vV.mermaid}),(0,j.jsx)(`p`,{className:`muted`,children:vV.mermaidHint}),(0,j.jsxs)(`div`,{className:`cd-mermaid`,children:[(0,j.jsx)(`pre`,{tabIndex:0,"aria-label":vV.mermaid,children:e.mermaid}),(0,j.jsx)(sr,{text:e.mermaid,label:vV.copyMermaid})]})]},`body`),a]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`p`,{children:vV.noTargets(e.change)}),(0,j.jsx)(sc,{text:`atticus change architecture ${e.change}`,label:w.runNext.copy})]},`body`),a]})}function CV({hash:e}){let t=P(`/api/changes`),n=Nn(e,`change`)??(t.state===`ready`?t.data[0]?.id:void 0)??void 0,r=P(n?`/api/changes/${encodeURIComponent(n)}/map`:void 0);return St(e=>{ct(e)&&r.reload()}),(0,j.jsxs)(F,{title:vV.title,children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:`0 0 12px`,fontSize:12.5,lineHeight:1.55},children:vV.intro}),(0,j.jsx)(I,{of:t,empty:e=>e.length===0,emptyText:vV.none,children:e=>(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(oV,{list:e,current:n,screen:`change-diagram`}),n&&(0,j.jsx)(I,{of:r,children:e=>(0,j.jsx)(SV,{map:e,sketch:!0})})]})})]})}var wV=w.conformance,TV=e=>`${e.repo?`${e.repo}:`:``}${e.path}${e.line?`:${e.line}`:``}`;function EV({r:e}){let t=e.counts.missing+e.counts.stillThere+e.counts.unexpected>0,n=`conf-${e.repo}`;return(0,j.jsxs)(`section`,{"aria-labelledby":n,className:`est-band`,children:[(0,j.jsx)(`h3`,{id:n,className:`hud`,children:wV.repo(e.repo,e.ref)}),(0,j.jsxs)(`p`,{className:`muted`,style:{margin:`0 0 4px`},children:[wV.commits(e.commit,e.base),e.task?`. ${wV.task(e.task)}`:``]}),(0,j.jsx)(`p`,{className:`est-big`,children:t?wV.counts(e.counts):wV.allGood}),(0,j.jsxs)(`table`,{className:`run-table`,children:[(0,j.jsx)(`caption`,{className:`sr`,children:wV.itemsCaption(e.repo)}),(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{scope:`col`,children:wV.col.status}),(0,j.jsx)(`th`,{scope:`col`,children:wV.col.what}),(0,j.jsx)(`th`,{scope:`col`,children:wV.col.step}),(0,j.jsx)(`th`,{scope:`col`,children:wV.col.task}),(0,j.jsx)(`th`,{scope:`col`,children:wV.col.at}),(0,j.jsx)(`th`,{scope:`col`,children:wV.col.finding})]})}),(0,j.jsx)(`tbody`,{children:e.items.map((e,t)=>(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`td`,{children:e.status===`found`?wV.status[e.status]:(0,j.jsx)(`strong`,{children:wV.status[e.status]})}),(0,j.jsx)(`td`,{children:e.what}),(0,j.jsx)(`td`,{className:`mono`,children:e.flow?wV.step(e.flow,e.item):wV.noStep}),(0,j.jsx)(`td`,{className:`mono`,children:e.task??``}),(0,j.jsx)(`td`,{className:`mono`,children:e.at.map(TV).join(`, `)}),(0,j.jsx)(`td`,{className:`mono`,children:e.finding?`${e.finding.id} (${e.finding.state})`:``})]},`${e.status}.${e.check}.${e.flow??``}.${e.item??``}.${e.record??``}.${t}`))})]}),e.unchecked.length>0&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`h4`,{className:`hud`,children:wV.unchecked}),(0,j.jsx)(`p`,{className:`muted`,children:wV.uncheckedIntro}),(0,j.jsx)(`ul`,{children:e.unchecked.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`span`,{className:`mono`,children:wV.step(e.flow,e.item)}),` (`,e.kind,`): `,e.why]},`${e.flow}.${e.item??`trigger`}`))})]}),e.problems.length>0&&(0,j.jsxs)(`div`,{role:`note`,className:`cd-problems`,children:[(0,j.jsx)(`h4`,{className:`hud`,children:wV.problems}),(0,j.jsx)(`ul`,{children:e.problems.map(e=>(0,j.jsx)(`li`,{children:e},e))})]})]})}function DV({change:e}){let t=Vn();return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4,margin:`8px 0 4px`},children:[(0,j.jsx)(`div`,{className:`row`,style:{gap:6},children:(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:t.busy,onClick:()=>void t.run(()=>Qn(`/api/changes/${encodeURIComponent(e)}/conformance`,{}),wV.checked),children:t.busy?wV.checking:wV.run})}),(0,j.jsx)(Wn,{note:t.note}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:`4px 0 0`},children:wV.orTerminal}),(0,j.jsx)(sc,{text:`atticus change conform ${e}`,label:w.runNext.copy})]})}function OV({c:e}){return e.flows?e.results.length?(0,j.jsxs)(j.Fragment,{children:[e.results.map(e=>(0,j.jsx)(EV,{r:e},e.repo)),(0,j.jsx)(`p`,{children:wV.gate(e.round)}),(0,j.jsx)(DV,{change:e.change}),e.problems.length>0&&(0,j.jsxs)(`div`,{role:`note`,className:`cd-problems`,children:[(0,j.jsx)(`h3`,{className:`hud`,children:wV.problems}),(0,j.jsx)(`ul`,{children:e.problems.map(e=>(0,j.jsx)(`li`,{children:e},e))})]})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{children:wV.notChecked(e.change)}),(0,j.jsx)(DV,{change:e.change})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{children:wV.noTargets(e.change)}),(0,j.jsx)(sc,{text:`atticus change architecture ${e.change}`,label:w.runNext.copy})]})}function kV({hash:e}){let t=P(`/api/changes`),n=Nn(e,`change`)??(t.state===`ready`?t.data[0]?.id:void 0),r=P(n?`/api/changes/${encodeURIComponent(n)}/conformance`:void 0);return St(e=>{ct(e)&&r.reload()}),(0,j.jsxs)(F,{title:wV.title,children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:`0 0 12px`,fontSize:12.5,lineHeight:1.55},children:wV.intro}),(0,j.jsx)(I,{of:t,empty:e=>e.length===0,emptyText:wV.none,children:e=>(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(oV,{list:e,current:n,screen:`conformance`}),n&&(0,j.jsx)(I,{of:r,children:e=>(0,j.jsx)(OV,{c:e})})]})})]})}var AV=w.cockpit,jV=(e,t)=>{let n=JL(e);return n?XL(n,t):`#/${e}`};function MV(e){return e.state===`done`?`done`:e.state===`person`?`person`:e.state===`skipped`?`skipped`:e.state===`not-started`?`todo`:`current`}var NV=e=>/^atticus change handoff \S+/.test(e.trim());function PV({change:e,next:t}){if(t.step===`brief`)return(0,j.jsx)(`p`,{style:{margin:0},children:(0,j.jsx)(`a`,{href:`#/brief?change=${encodeURIComponent(e)}`,children:AV.writeBrief})});let n={kind:NV(t.command)?`handoff`:t.step===`finding`?/\bask$/.test(t.command.trim())?`gap`:`findings`:hN(t.step),command:t.command,change:e,pr:t.pr},r=ic(n);return(0,j.jsxs)(j.Fragment,{children:[r&&(0,j.jsx)(ac,{...n}),t.slash&&(0,j.jsx)(sc,{text:t.slash,label:AV.copySlash}),r?(0,j.jsxs)(`details`,{className:`work-terminal`,children:[(0,j.jsx)(`summary`,{children:w.runNext.orTerminal}),(0,j.jsx)(sc,{text:t.command,label:AV.copyCommand,noRun:!0})]}):(0,j.jsx)(sc,{text:t.command,label:AV.copyCommand})]})}function FV({d:e,onDone:t}){let n=e.task.taskRun.state;return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:n===`built`?AV.taskDrafted(e.task.id):n===`unverified`?AV.taskUnverified(e.task.id):n===`pr-open`?AV.taskPrRaised(e.task.id):AV.taskWaiting(e.task.id)}),(0,j.jsx)(Xa,{change:e.change,task:e.task,...t?{onDone:t}:{}}),e.then?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:AV.thenTask(e.then.id)}),(0,j.jsx)(sc,{text:`/atticus-task ${e.change} ${e.then.id}`,label:AV.copySlash}),(0,j.jsx)(sc,{text:`atticus task run ${e.change} ${e.then.id}`,label:AV.copyCommand})]}):(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:AV.noOtherTask}),(0,j.jsx)(`p`,{style:{margin:0},children:(0,j.jsx)(`a`,{href:jV(`tasks`,e.change),children:AV.openTaskBoard})})]})}function IV({w:e}){let t=w.roleWork,n=t.roleNames[e.role]??e.role;return(0,j.jsxs)(`p`,{style:{margin:0},className:`row`,"aria-live":`polite`,children:[(0,j.jsx)(`strong`,{children:e.people.length?t.waitsOn(e.people.map(e=>`@${e}`).join(`, `),n):t.waitsOnNobody(n)}),e.people.length>0&&(0,j.jsx)(`span`,{className:`muted`,style:{marginLeft:6},children:e.because===`handoff`?t.waitsOnReview:t.waitsOnWork})]})}function LV(e){let t=e.c,n=Ha(t.next?.command,e.tasks);return(0,j.jsxs)(`div`,{className:`cw-cols`,children:[(0,j.jsxs)(`div`,{className:`cw-col`,children:[(0,j.jsxs)(`section`,{"aria-labelledby":`cockpit-next`,className:`cw-card cw-step`,children:[(0,j.jsx)(`h3`,{id:`cockpit-next`,className:`hud`,children:AV.next}),(0,j.jsx)(`p`,{className:`cw-step-what`,children:t.nextStep}),n?(0,j.jsx)(FV,{d:n,onDone:e.onTasks}):t.next&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:Ur(t.next.why)}),(0,j.jsx)(PV,{change:t.id,next:t.next})]})]}),t.reasons.length>0&&(0,j.jsxs)(`section`,{"aria-labelledby":`cockpit-blocks`,className:`cw-card`,children:[(0,j.jsx)(`h3`,{id:`cockpit-blocks`,className:`hud`,children:AV.blocks}),(0,j.jsx)(`ul`,{className:`cw-plain`,children:t.reasons.map(e=>(0,j.jsx)(`li`,{children:e.message},`${e.code}-${e.message}`))})]})]}),(0,j.jsxs)(`div`,{className:`cw-col`,children:[(0,j.jsxs)(`section`,{"aria-labelledby":`cockpit-where`,className:`cw-card`,children:[(0,j.jsx)(`h3`,{id:`cockpit-where`,className:`hud`,children:AV.where}),(0,j.jsx)(`p`,{style:{margin:0},children:AV.state(t.state,t.risk.level)}),t.waitsOn&&(0,j.jsx)(IV,{w:t.waitsOn}),t.work&&(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:t.work}),(0,j.jsx)(`ol`,{className:`cw-stages`,children:t.stages.map(e=>{let n=MV(e);return(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`a`,{className:`chip ${n===`done`||n===`person`?`done`:n===`current`?`warn`:`dim`}`,href:jV(AV.stageScreen[e.stage],t.id),"aria-current":n===`current`?`step`:void 0,children:AV.stage(AV.stages[e.stage],AV.marks[n])}),(e.drafts>0||e.openQuestions>0)&&` `,(e.drafts>0||e.openQuestions>0)&&(0,j.jsx)(`span`,{className:`cw-row-sub`,children:AV.progress(e.drafts,e.rounds,e.openQuestions)})]},e.stage)})}),t.openQuestions>0&&(0,j.jsx)(`p`,{style:{margin:0,fontSize:12.5},children:(0,j.jsx)(`a`,{href:jV(`questions`,t.id),children:AV.questions(t.openQuestions)})})]}),(0,j.jsxs)(`section`,{"aria-labelledby":`cockpit-repos`,className:`cw-card`,children:[(0,j.jsx)(`h3`,{id:`cockpit-repos`,className:`hud`,children:AV.repos}),t.repos.length===0?(0,j.jsx)(RV,{change:t.id}):(0,j.jsx)(`ul`,{className:`cw-plain`,children:t.repos.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`span`,{className:`mono`,children:e.id}),`: `,AV.branchOn(e.branch,e.base),e.pr&&!Ia(e.pr)&&(0,j.jsxs)(j.Fragment,{children:[` · `,(0,j.jsx)(Pt,{href:e.pr,children:AV.pr})]})]},e.id))}),t.repos.some(e=>e.pr&&Ia(e.pr))&&(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:(0,j.jsx)(Ua,{})})]})]})]})}function RV({change:e,onDone:t}){let n=P(`/api/changes/${encodeURIComponent(e)}`),r=Vn(),i=n.state===`ready`?n.data.repos:[],a=`atticus workspace open ${e} --repos ${i.length?i.join(`,`):`<repo>,<repo>`}`;return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:0},children:AV.noRepos}),(0,j.jsx)(I,{of:n,children:()=>i.length>0?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{style:{margin:0},children:(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:r.busy,onClick:()=>void r.run(()=>N(`/api/changes/${encodeURIComponent(e)}/workspace`,{method:`POST`,body:{repos:i}}).then(e=>(t?.(),e)),AV.workspaceOpened),children:AV.openWorkspace(i.length)})}),(0,j.jsx)(Wn,{note:r.note}),(0,j.jsxs)(`details`,{className:`work-terminal`,children:[(0,j.jsx)(`summary`,{children:w.runNext.orTerminal}),(0,j.jsx)(sc,{text:a,label:AV.copyCommand,noRun:!0})]})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`p`,{className:`muted`,style:{margin:0},children:[AV.noReposToOpen,` `,(0,j.jsx)(`a`,{href:`#/architecture?change=${encodeURIComponent(e)}`,children:AV.openArchitecture})]}),(0,j.jsxs)(`details`,{className:`work-terminal`,children:[(0,j.jsx)(`summary`,{children:w.runNext.orTerminal}),(0,j.jsx)(sc,{text:a,label:AV.copyCommand,noRun:!0})]})]})})]})}function zV(e){let t=AV.like;return(0,j.jsxs)(`section`,{"aria-label":t.title,className:`cw-card`,children:[(0,j.jsx)(`h3`,{className:`hud`,children:t.title}),(0,j.jsx)(ko,{text:t.intro,about:t.title}),e.r.how===`words`&&e.r.note&&e.r.changes.length>0&&(0,j.jsx)(`p`,{className:`muted`,children:t.byWords(e.r.note)}),e.r.changes.length===0?(0,j.jsx)(`p`,{className:`muted`,children:t.none}):(0,j.jsx)(`ul`,{className:`plain`,children:e.r.changes.map(n=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`strong`,{children:n.title}),n.archived&&(0,j.jsxs)(`span`,{className:`muted`,children:[` · `,t.archived(n.archived)]}),n.summary&&(0,j.jsx)(`p`,{className:`cw-past-summary`,children:n.summary}),e.onUse&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:e.busy,onClick:()=>e.onUse?.(n.id),children:t.use})]},n.id))})]})}function BV({change:e}){let t=P(`/api/past-changes?change=${encodeURIComponent(e)}`),n=Vn();return(0,j.jsx)(I,{of:t,children:t=>(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(zV,{r:t,busy:n.busy,onUse:t=>void n.run(()=>N(`/api/changes/${encodeURIComponent(e)}/like`,{method:`POST`,body:{like:t}}),AV.like.used)}),(0,j.jsx)(Wn,{note:n.note})]})})}function VV(e){let t=Vn();return(0,j.jsxs)(`span`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,"aria-pressed":e.watching,disabled:t.busy,onClick:()=>void t.run(async()=>{await N(`/api/me/watch`,{method:`PUT`,body:{change:e.change,watch:!e.watching}}),e.onChanged?.()},e.watching?AV.unwatched:AV.watched),children:e.watching?AV.unwatch:AV.watch}),(0,j.jsx)(Wn,{note:t.note})]})}function HV(e){let t=e.c.state===`ready`?e.c.data.next?.command:void 0,n=P(e.current&&t?.startsWith(`atticus task run `)?`/api/changes/${encodeURIComponent(e.current)}/tasks`:void 0);if(lt(n),!e.current||!e.list.some(t=>t.id===e.current))return(0,j.jsx)(pc,{bare:!0});let r=e.list.find(t=>t.id===e.current);return(0,j.jsxs)(`div`,{className:`cw-glance`,children:[(0,j.jsx)(Co,{title:r.title,sub:r.id,badges:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(Do,{state:r.state,blocked:!!r.openFindings?.blocking}),e.c.state===`ready`&&(0,j.jsx)(`span`,{className:`chip ${e.c.data.risk.level===`high`?`blocking`:e.c.data.risk.level===`medium`?`warn`:`dim`}`,children:w.changeWork.risk(e.c.data.risk.level)})]}),actions:(0,j.jsx)(oV,{list:e.list,current:e.current,screen:`cockpit`})}),(0,j.jsx)(I,{of:e.c,children:e=>(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(LV,{c:e,tasks:n.state===`ready`?n.data:void 0,onTasks:n.reload}),e.next?.command?.startsWith(`atticus change small `)?(0,j.jsx)(IB,{change:e.id,stage:`small`}):(0,j.jsx)(IB,{change:e.id,stage:`proposal`})]})}),(0,j.jsx)(BV,{change:e.current})]})}function UV({hash:e}){let t=P(`/api/changes`),n=Nn(e,`change`),r=P(n?`/api/changes/${encodeURIComponent(n)}/cockpit`:void 0),i=P(`/api/me`);return lt(r),(0,j.jsx)(F,{title:AV.title,className:`cw-frame`,meta:n&&i.state===`ready`?(0,j.jsx)(VV,{change:n,watching:(i.data.watching??[]).includes(n),onChanged:i.reload}):void 0,children:(0,j.jsx)(I,{of:t,empty:e=>e.length===0,emptyContent:(0,j.jsx)(gc,{}),children:e=>(0,j.jsx)(HV,{list:e,current:n,c:r})})})}var WV=w.estimate;function GV({e}){if(!e.units.length)return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{children:WV.noTargets(e.change)}),(0,j.jsx)(sc,{text:`atticus change architecture ${e.change}`,label:w.runNext.copy})]});let t=e.units.length-e.needsClass;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`section`,{"aria-labelledby":`est-effort`,className:`est-band`,children:[(0,j.jsx)(`h3`,{id:`est-effort`,className:`hud`,children:WV.effort}),e.effort?(0,j.jsxs)(`p`,{className:`est-big`,children:[WV.effortRange(e.effort.p20,e.effort.p80,e.effort.p50),` `,(0,j.jsx)(`span`,{className:`muted`,children:WV.from(t,e.units.length)})]}):(0,j.jsxs)(`p`,{className:`est-big`,children:[WV.noDays(e.units.length),` `,e.table?WV.noMatch:WV.noTable]})]}),(0,j.jsxs)(`section`,{"aria-labelledby":`est-calendar`,className:`est-band`,children:[(0,j.jsx)(`h3`,{id:`est-calendar`,className:`hud`,children:WV.calendar}),(0,j.jsxs)(`p`,{children:[e.calendar.waitDays===void 0?WV.noWait:WV.waiting(e.calendar.waitDays),e.calendar.longer&&(0,j.jsxs)(j.Fragment,{children:[` `,WV.longer(e.calendar.longer)]})]})]}),(0,j.jsxs)(`section`,{"aria-labelledby":`est-calibration`,className:`est-band`,children:[(0,j.jsx)(`h3`,{id:`est-calibration`,className:`hud`,children:WV.calibration}),(0,j.jsx)(`p`,{children:WV.notCalibrated(e.calibration.source,e.table)})]}),(0,j.jsx)(`h3`,{className:`hud`,children:WV.drivers}),e.drivers.length?(0,j.jsxs)(`table`,{className:`run-table`,children:[(0,j.jsx)(`caption`,{className:`sr`,children:WV.driversCaption}),(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{scope:`col`,children:WV.col.what}),(0,j.jsx)(`th`,{scope:`col`,children:WV.col.count}),(0,j.jsx)(`th`,{scope:`col`,children:WV.col.effect}),(0,j.jsx)(`th`,{scope:`col`,children:WV.col.source})]})}),(0,j.jsx)(`tbody`,{children:e.drivers.map(e=>(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`td`,{children:e.what}),(0,j.jsx)(`td`,{children:e.count}),(0,j.jsx)(`td`,{children:e.widens?WV.widens(e.widens):``}),(0,j.jsx)(`td`,{className:`mono`,children:e.source??``})]},e.id))})]}):(0,j.jsx)(`p`,{children:WV.noDrivers}),e.perRepo.length>1&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`h3`,{className:`hud`,children:WV.perRepo}),(0,j.jsxs)(`table`,{className:`run-table`,children:[(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{scope:`col`,children:WV.col.repo}),(0,j.jsx)(`th`,{scope:`col`,children:WV.col.units}),(0,j.jsx)(`th`,{scope:`col`,children:WV.col.days})]})}),(0,j.jsx)(`tbody`,{children:e.perRepo.map(e=>(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`td`,{className:`mono`,children:e.repo}),(0,j.jsx)(`td`,{children:e.units}),(0,j.jsx)(`td`,{children:e.effort?WV.days(e.effort):WV.needsClass})]},e.repo))})]})]}),(0,j.jsx)(`h3`,{className:`hud`,children:WV.work}),(0,j.jsxs)(`table`,{className:`run-table`,children:[(0,j.jsx)(`caption`,{className:`sr`,children:WV.workCaption(e.change)}),(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{scope:`col`,children:WV.col.repo}),(0,j.jsx)(`th`,{scope:`col`,children:WV.col.flow}),(0,j.jsx)(`th`,{scope:`col`,children:WV.col.step}),(0,j.jsx)(`th`,{scope:`col`,children:WV.col.what}),(0,j.jsx)(`th`,{scope:`col`,children:WV.col.cls}),(0,j.jsx)(`th`,{scope:`col`,children:WV.col.days})]})}),(0,j.jsx)(`tbody`,{children:e.units.map((e,t)=>(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`td`,{className:`mono`,children:e.repo}),(0,j.jsx)(`td`,{className:`mono`,children:e.flow}),(0,j.jsx)(`td`,{children:e.step??``}),(0,j.jsx)(`td`,{children:e.what}),(0,j.jsx)(`td`,{className:`mono`,children:e.class}),(0,j.jsx)(`td`,{children:e.days?WV.days(e.days):(0,j.jsx)(`strong`,{children:WV.needsClass})})]},`${e.flow}.${e.step??`flow`}.${t}`))})]}),e.problems.length>0&&(0,j.jsxs)(`div`,{role:`note`,className:`cd-problems`,children:[(0,j.jsx)(`h3`,{className:`hud`,children:WV.problems}),(0,j.jsx)(`ul`,{children:e.problems.map(e=>(0,j.jsx)(`li`,{children:e},e))})]})]})}function KV({hash:e}){let t=P(`/api/changes`),n=Nn(e,`change`)??(t.state===`ready`?t.data[0]?.id:void 0),r=P(n?`/api/changes/${encodeURIComponent(n)}/estimate`:void 0);return St(e=>{ct(e)&&r.reload()}),(0,j.jsxs)(F,{title:WV.title,children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:`0 0 12px`,fontSize:12.5,lineHeight:1.55},children:WV.intro}),(0,j.jsx)(I,{of:t,empty:e=>e.length===0,emptyText:WV.none,children:e=>(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(oV,{list:e,current:n,screen:`estimate`}),n&&(0,j.jsx)(I,{of:r,children:e=>(0,j.jsx)(GV,{e})})]})})]})}var qV=w.changeKnowledge,JV=w.runNext,YV=e=>e.title??ZV(e.passage)??e.id,XV=e=>qV.kinds[e]??e;function ZV(e){if(e)return e.heading.split(` › `).at(-1)?.trim()||e.page.split(`/`).at(-1)?.replace(/\.(md|markdown)$/i,``).replace(/[-_]+/g,` `)}function QV({item:e}){let t=w.roleWork.passage,n=e.title??ZV(e.passage)??e.id;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`span`,{children:n}),` `,(0,j.jsx)(`span`,{className:`muted`,children:XV(e.kind)}),e.source&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`br`,{}),(0,j.jsx)(`span`,{className:`muted`,children:qV.fromSource(e.source,e.authority)})]}),e.passage?(0,j.jsxs)(`details`,{children:[(0,j.jsx)(`summary`,{children:t.open}),(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4,marginTop:4},children:[(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:t.from(e.passage.heading||e.passage.page,e.passage.source)}),e.passage.quote?(0,j.jsxs)(`blockquote`,{style:{margin:0,paddingLeft:10,borderLeft:`2px solid var(--line-2)`},children:[(0,j.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:t.quote}),(0,j.jsx)(`p`,{style:{margin:`2px 0 0`,whiteSpace:`pre-wrap`},children:e.passage.quote})]}):(0,j.jsx)(`p`,{style:{margin:0,whiteSpace:`pre-wrap`,fontSize:12.5},children:e.passage.text})]})]}):null,(0,j.jsxs)(`details`,{children:[(0,j.jsx)(`summary`,{className:`muted`,style:{fontSize:11.5},children:t.details}),(0,j.jsx)(`code`,{className:`mono muted`,children:e.id}),e.passage&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`br`,{}),(0,j.jsxs)(`code`,{className:`mono muted`,children:[e.passage.path,`:`,e.passage.line]})]})]})]})}function $V(e){return(0,j.jsxs)(`span`,{className:`row`,style:{gap:6,flexWrap:`wrap`},children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:e.busy||e.item.status===`confirmed`,"aria-label":qV.confirmItem(YV(e.item)),onClick:()=>e.onSet(e.item.id,`confirmed`),children:qV.confirm}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:e.busy||e.item.status===`excluded`,"aria-label":qV.excludeItem(YV(e.item)),onClick:()=>e.onSet(e.item.id,`excluded`),children:qV.exclude})]})}function eH({w:e,named:t}){return e.state===`idle`?null:e.state===`working`?(0,j.jsx)(`p`,{role:`status`,"aria-busy":`true`,className:`work-say`,children:qV.working}):e.state===`error`?(0,j.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:`8px 0 0`},children:e.text}):(0,j.jsxs)(`div`,{role:`status`,style:{marginTop:8},children:[(0,j.jsx)(`p`,{className:`work-say`,children:qV.set(t(e.id),qV.statuses[e.status].toLowerCase(),e.result.file)}),(0,j.jsx)(Yc,{scope:`work`}),(0,j.jsxs)(`details`,{className:`work-terminal`,children:[(0,j.jsx)(`summary`,{children:w.appStep.inTerminal}),(0,j.jsx)(sc,{text:e.result.commit,label:qV.copyCommit,noRun:!0})]})]})}function tH(e){let t=e.written??{state:`idle`},n=t=>{let n=e.of.state===`ready`?e.of.data:void 0,r=[...n?.items??[],...n?.nearMisses??[]].find(e=>e.id===t);return r?YV(r):t},r=t.state===`working`,i=e.onSet??(()=>void 0);return(0,j.jsxs)(F,{title:qV.title,span:`1 / -1`,children:[(0,j.jsx)(`p`,{className:`work-why`,style:{marginTop:0},children:qV.intro}),(0,j.jsx)(I,{of:e.of,empty:e=>!e.present,emptyContent:(0,j.jsxs)(`div`,{className:`state`,children:[(0,j.jsx)(`p`,{style:{margin:`0 0 8px`},children:qV.none}),(0,j.jsx)(`p`,{className:`work-say`,children:JV.terminal}),(0,j.jsx)(sc,{text:qV.featureCommand(e.change),label:JV.copy})]}),children:e=>(0,j.jsxs)(j.Fragment,{children:[e.items.length>0?(0,j.jsx)(Gn,{caption:qV.caption,rows:e.items,rowKey:e=>e.id,cols:[{label:qV.item,cell:e=>(0,j.jsx)(QV,{item:e})},{label:qV.why,cell:e=>[e.reason,e.stages.join(`, `)||(e.tasks?.length?``:qV.noStages),e.tasks?.length?qV.tasks(e.tasks):``].filter(Boolean).join(` · `)},{label:qV.status,cell:e=>(0,j.jsx)(`span`,{className:`chip ${e.status===`confirmed`?`done`:e.status===`excluded`?`dim`:`warn`}`,children:qV.statuses[e.status]})},{label:qV.actions,cell:e=>(0,j.jsx)($V,{item:e,busy:r,onSet:i})}]}):(0,j.jsx)(`div`,{className:`state`,children:qV.none}),e.nearMisses.length>0&&(0,j.jsxs)(`details`,{style:{marginTop:8},children:[(0,j.jsx)(`summary`,{children:qV.nearMisses(e.nearMisses.length)}),(0,j.jsx)(`ul`,{className:`stack`,style:{listStyle:`none`,padding:0,margin:`8px 0 0`},children:e.nearMisses.map(e=>(0,j.jsxs)(`li`,{className:`row between`,style:{gap:8,flexWrap:`wrap`},children:[(0,j.jsxs)(`span`,{children:[(0,j.jsx)(QV,{item:e}),` `,(0,j.jsxs)(`span`,{className:`muted`,children:[`· `,qV.nearMissStage(e.stage)]})]}),(0,j.jsx)($V,{item:e,busy:r,onSet:i})]},e.id))})]}),e.conflicts?.length?(0,j.jsxs)(`section`,{"aria-label":w.knowledgeConflicts.title,style:{marginTop:12},children:[(0,j.jsx)(`h3`,{style:{margin:`0 0 4px`},children:w.knowledgeConflicts.title}),(0,j.jsx)(`p`,{className:`work-why`,style:{marginTop:0},children:w.knowledgeConflicts.intro}),(0,j.jsx)(ra,{conflicts:e.conflicts})]}):null,(0,j.jsx)(eH,{w:t,named:n})]})})]})}function nH({change:e}){let t=`/api/changes/${encodeURIComponent(e)}/knowledge`,n=P(t);lt(n);let[r,i]=(0,v.useState)({state:`idle`});return(0,j.jsx)(tH,{change:e,of:n,written:r,onSet:(e,r)=>{i({state:`working`}),N(`${t}/${encodeURIComponent(e)}`,{method:`POST`,body:{status:r}}).then(t=>{i({state:`done`,id:e,status:r,result:t}),n.reload()}).catch(e=>i({state:`error`,text:Bn(e)}))}})}function rH(e){return(0,j.jsx)(I,{of:e.list,empty:e=>e.length===0,emptyContent:(0,j.jsx)(gc,{}),children:t=>{let n=kN(t,e.wanted);return n?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`,marginBottom:12},children:[(0,j.jsx)(`p`,{style:{margin:0},children:(0,j.jsx)(`span`,{className:`n`,style:{fontSize:20},children:n.title})}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:12,flexWrap:`wrap`},children:[(0,j.jsx)(si,{change:n.id}),(0,j.jsx)(oV,{list:t,current:n.id,screen:`change-knowledge`})]})]}),(0,j.jsx)(`div`,{className:`bento`,children:e.panel(n.id)})]}):(0,j.jsx)(pc,{})}})}function iH({hash:e}){let t=P(`/api/changes`);return St(e=>{e.type===`file.changed`&&t.reload()}),(0,j.jsx)(rH,{list:t,wanted:Nn(e,`change`),panel:e=>(0,j.jsx)(nH,{change:e})})}var aH=w.work;function oH({done:e}){return(0,j.jsx)(`span`,{className:`chip ${e?`done`:`dim`}`,children:e?aH.done:aH.todo})}function sH({v:e,openQuestions:t}){let n=AN(e),r=e.repos[0]?.id??`<repo>`,i=e.repos.find(e=>e.lastScan===null)?.id??r,a=n.listed>0&&n.scanned===n.listed;return(0,j.jsxs)(`ol`,{className:`work-steps`,children:[(0,j.jsxs)(`li`,{children:[(0,j.jsxs)(`p`,{children:[(0,j.jsx)(oH,{done:n.listed>0}),` `,e.manifests.length?aH.stepPick:aH.stepPickNone]}),e.manifests.map(e=>(0,j.jsx)(`p`,{children:(0,j.jsx)(`code`,{className:`mono`,children:e.path})},e.path)),(0,j.jsx)(`p`,{children:(0,j.jsx)(`a`,{href:`#/repos`,children:w.setup.addReposLink})}),(0,j.jsx)(sc,{text:`atticus repos discover <folder>`,label:w.runNext.copy}),(0,j.jsx)(`p`,{className:`work-say`,children:aH.stepAddOne}),(0,j.jsx)(sc,{text:`atticus repo add <url> --description "what it is"`,label:w.runNext.copy})]}),(0,j.jsxs)(`li`,{children:[(0,j.jsxs)(`p`,{children:[(0,j.jsx)(oH,{done:n.listed>0&&n.cloned===n.listed}),` `,aH.stepSync]}),(0,j.jsx)(sc,{text:`atticus workspace sync`,label:w.runNext.copy})]}),(0,j.jsxs)(`li`,{children:[(0,j.jsxs)(`p`,{children:[(0,j.jsx)(oH,{done:a}),` `,aH.stepRead]}),(0,j.jsx)(sc,{text:`atticus map ${i}`,label:w.runNext.copy}),(0,j.jsx)(`p`,{className:`work-say`,children:w.runNext.slash}),(0,j.jsx)(sc,{text:`/atticus-map ${i}`,label:w.runNext.copySlash})]}),(0,j.jsxs)(`li`,{children:[(0,j.jsxs)(`p`,{children:[(0,j.jsx)(oH,{done:a}),` `,aH.stepWrite]}),(0,j.jsx)(sc,{text:`atticus verify ${i} --write`,label:w.runNext.copy})]}),(0,j.jsx)(`li`,{children:(0,j.jsxs)(`p`,{children:[(0,j.jsx)(oH,{done:a&&t===0}),` `,aH.stepAnswer,` `,(0,j.jsx)(`a`,{href:`#/questions`,children:aH.stepAnswerLink})]})}),(0,j.jsx)(`li`,{children:(0,j.jsxs)(`p`,{children:[aH.stepTrust,` `,(0,j.jsx)(`a`,{href:`#/trust`,children:aH.openTrust})]})})]})}function cH({v:e}){return e.repos.length===0?(0,j.jsx)(`div`,{className:`state`,children:aH.noRepos}):(0,j.jsx)(Gn,{caption:aH.repos,rows:e.repos,rowKey:e=>e.id,cols:[{label:aH.repoCol,cell:e=>e.id,mono:!0},{label:aH.aboutCol,cell:e=>e.description?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`span`,{children:e.description.text}),e.description.trust===`suggested`&&(0,j.jsx)(`span`,{className:`chip warn`,style:{marginLeft:6},children:aH.aboutDraft})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:11.5},children:aH.aboutMissing}),(0,j.jsx)(sc,{text:`atticus repo describe ${e.id}`,label:w.runNext.copy})]})},{label:aH.typeCol,cell:e=>e.type,mono:!0},{label:aH.matchCol,cell:e=>(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:11.5},children:aH.matchHint}),(0,j.jsx)(sc,{text:`atticus repo-type detect ${e.id}`,label:w.runNext.copy})]})},{label:aH.cloneCol,cell:e=>(0,j.jsx)(`span`,{className:`chip ${e.cloned?`done`:`dim`}`,children:e.cloned?aH.cloned:aH.notCloned})},{label:aH.settingsCol,cell:e=>e.scanSettings.present?(0,j.jsx)(`code`,{className:`mono`,children:e.scanSettings.path}):(0,j.jsx)(`span`,{className:`muted`,children:aH.settingsMissing})},{label:aH.lastScanCol,cell:e=>e.lastScan?(0,j.jsxs)(`span`,{children:[aH.recordCount(e.lastScan.records),e.lastScan.commit?` ${aH.atCommit(e.lastScan.commit)}`:``,(0,j.jsx)(`br`,{}),(0,j.jsx)(`span`,{className:`muted`,style:{fontSize:11.5},children:Object.entries(e.lastScan.kinds).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).map(([e,t])=>`${e} ${t}`).join(`, `)})]}):(0,j.jsx)(`span`,{className:`muted`,children:aH.notScanned})}]})}function lH({v:e}){let t=e.sources;return t.present?(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsxs)(`p`,{style:{margin:0},children:[aH.sourcesFile,`: `,(0,j.jsx)(`code`,{className:`mono`,children:t.path})]}),t.wikis.length===0&&t.absorbed.length===0&&(0,j.jsx)(`div`,{className:`state`,children:aH.sourcesNone(t.path)}),t.wikis.length>0&&(0,j.jsx)(Gn,{caption:aH.sources,rows:t.wikis,rowKey:e=>e.id,cols:[{label:aH.wikiCol,cell:e=>e.id,mono:!0},{label:aH.kindCol,cell:e=>e.type},{label:aH.whereCol,cell:e=>e.location,mono:!0},{label:aH.spacesCol,cell:e=>e.spaces.join(`, `)},{label:aH.ownerCol,cell:e=>e.owner??``}]}),t.absorbed.length>0&&(0,j.jsx)(Gn,{caption:aH.absorbedTitle,rows:t.absorbed,rowKey:e=>e.id,cols:[{label:aH.absorbedTitle,cell:e=>e.id,mono:!0},{label:aH.kindCol,cell:e=>`${e.format} · ${e.mode}`},{label:aH.whereCol,cell:e=>e.url,mono:!0}]}),t.wikis.length>0&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`work-say`,children:aH.syncSources}),(0,j.jsx)(sc,{text:`atticus sources sync`,label:w.runNext.copy})]})]}):(0,j.jsx)(`div`,{className:`state`,children:aH.sourcesMissing(t.path)})}function uH({of:e,questions:t,trust:n}){let r=t.state===`ready`?t.data.questions.length:void 0;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`muted`,style:{margin:`0 0 12px`,fontSize:12.5,lineHeight:1.55},children:aH.onbIntro}),(0,j.jsx)(fc,{of:e,step:e=>NN(e,r,n?.state===`ready`?n.data:void 0)}),(0,j.jsxs)(`div`,{className:`bento`,children:[(0,j.jsx)(F,{title:aH.steps,span:`span 5`,children:(0,j.jsx)(I,{of:e,children:e=>(0,j.jsx)(sH,{v:e,openQuestions:r})})}),(0,j.jsx)(F,{title:aH.sources,span:`span 7`,children:(0,j.jsx)(I,{of:e,children:e=>(0,j.jsx)(lH,{v:e})})}),(0,j.jsx)(F,{title:aH.repos,span:`1 / -1`,children:(0,j.jsx)(I,{of:e,children:e=>(0,j.jsxs)(`div`,{className:`stack`,children:[(0,j.jsx)(_c,{list:e.problems}),(0,j.jsx)(cH,{v:e})]})})})]})]})}function dH(){let e=P(`/api/onboarding`),t=P(`/api/questions?state=open`),n=P(`/api/trust`);return St(r=>{r.type===`file.changed`&&(e.reload(),t.reload(),n.reload())}),(0,j.jsx)(uH,{of:e,questions:t,trust:n})}var fH={knowledge:`kn`,wikis:`kn`,documents:`kn`,"wiki-search":`kn`,parties:`kn`,"orgpack-draft":`kn`,explore:`kn`,map:`kn`,systems:`kn`,impact:`kn`,features:`kn`,diagrams:`kn`,reconcile:`kn`,contracts:`kn`,initiatives:`kn`,settings:`st`,repos:`st`,ai:`st`,orgpack:`st`,scans:`st`,"catalog-builds":`st`,intake:`st`};function pH(e,t){let n=({hash:n})=>(0,j.jsx)(`div`,{className:e,children:(0,j.jsx)(t,{hash:n})});return n.displayName=e+`(`+(t.displayName??t.name??`Screen`)+`)`,n}var mH={onboarding:()=>(0,j.jsx)(dH,{}),"feature-design":fV,"change-knowledge":iH,architecture:_V,stories:pV,"task-list":mV,canvas:({hash:e})=>(0,j.jsx)(ck,{hash:e,screen:`canvas`}),trust:()=>(0,j.jsx)(nA,{}),outside:uA,mismatches:gA,decisions:wA,crosscheck:VA,"catalog-builds":()=>(0,j.jsx)(Fc,{}),home:()=>(0,j.jsx)(YP,{}),changes:is,explore:cF,flows:IF,questions:dN,...fI,...SL,...Hz,runs:Ci,history:eB,"change-diagram":CV,estimate:KV,cockpit:UV,conformance:kV,words:nB},hH=new Set([...VL.filter(e=>e.section===`Change`&&e.id!==`architecture`&&e.id!==`change-diagram`).map(e=>e.id),`runs`,`history`,`flows`]),gH=Object.fromEntries(Object.entries(mH).map(([e,t])=>{let n=fH[e];if(n)return[e,pH(n,t)];if(!hH.has(e))return[e,t];let r=e=>(0,j.jsx)(So,{children:(0,j.jsx)(t,{...e})});return r.displayName=`ChangeWork(${e})`,[e,r]})),_H=w.notBuilt;function vH({screen:e}){return(0,j.jsx)(F,{title:e.label,children:(0,j.jsxs)(`p`,{style:{margin:0,color:`var(--text-2)`,lineHeight:1.6},children:[_H.thisScreenIsBeing,(0,j.jsx)(`code`,{className:`mono`,children:_H.atticusHelp}),` `,_H.toFindTheCommand]})})}var yH=w.setup,bH=/^[a-z0-9][a-z0-9-]*$/;function xH(e){let[t,n]=(0,v.useState)(e.view.suggested.name),[r,i]=(0,v.useState)(e.view.suggested.platform),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(e.view.metarepoId??``),l=Vn(),u=!bH.test(t)||!bH.test(r),d=`atticus init . --platform ${r||`<platform>`}${a.trim()?` --owner ${a.trim()}`:``}`;return(0,j.jsxs)(`form`,{className:`stack`,style:{gap:10},"aria-describedby":`create-what`,onSubmit:n=>{n.preventDefault(),!u&&l.run(async()=>{let n=await N(`/api/setup/metarepo`,{method:`POST`,body:{name:t,platform:r,...a.trim()?{owner:a.trim()}:{},...s.trim()?{metarepo:s.trim()}:{}}});return e.onCreated(),n},yH.created)},children:[(0,j.jsx)(`p`,{id:`create-what`,className:`muted`,style:{margin:0,maxWidth:`70ch`},children:yH.createWhat}),[[`setup-name`,yH.name,yH.nameHint,t,n,!0],[`setup-platform`,yH.platform,yH.platformHint,r,i,!0],[`setup-owner`,yH.owner,yH.ownerHint,a,o,!1],[`setup-metarepo`,yH.metarepoId,yH.metarepoIdHint,s,c,!1]].map(([e,t,n,r,i,a])=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4,maxWidth:520},children:[(0,j.jsx)(`label`,{htmlFor:e,children:t}),(0,j.jsx)(`input`,{id:e,className:`field mono`,value:r,required:a,"aria-invalid":a&&!bH.test(r)?!0:void 0,"aria-describedby":`${e}-hint`,onChange:e=>i(e.target.value)}),(0,j.jsx)(`span`,{id:`${e}-hint`,className:`muted`,style:{fontSize:12},children:a&&r&&!bH.test(r)?yH.badSlug:n})]},e)),(0,j.jsx)(`div`,{className:`row`,style:{gap:8},children:(0,j.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:l.busy||u,children:l.busy?yH.creating:yH.create})}),(0,j.jsx)(Wn,{note:l.note}),(0,j.jsxs)(`details`,{children:[(0,j.jsx)(`summary`,{className:`hud`,children:yH.terminal}),(0,j.jsxs)(`div`,{className:`work-cmd`,children:[(0,j.jsx)(`code`,{className:`mono`,children:d}),(0,j.jsx)(sr,{text:d,label:w.decisions.copy(d)})]})]})]})}function SH(){let[e,t]=(0,v.useState)(``),n=Vn();return(0,j.jsxs)(`form`,{className:`stack`,style:{gap:8},onSubmit:t=>{t.preventDefault(),e.trim()&&n.run(async()=>{let t=await N(`/api/setup/open`,{method:`POST`,body:{path:e.trim()}});return location.assign(t.url),t},e=>yH.openedAt(e.url))},children:[(0,j.jsxs)(`div`,{className:`stack`,style:{gap:4,maxWidth:520},children:[(0,j.jsx)(`label`,{htmlFor:`setup-open-path`,children:yH.path}),(0,j.jsx)(`input`,{id:`setup-open-path`,className:`field mono`,value:e,"aria-describedby":`setup-open-hint`,onChange:e=>t(e.target.value)}),(0,j.jsx)(`span`,{id:`setup-open-hint`,className:`muted`,style:{fontSize:12},children:yH.pathHint})]}),(0,j.jsx)(`div`,{className:`row`,children:(0,j.jsx)(`button`,{type:`submit`,className:`btn`,disabled:n.busy||!e.trim(),children:n.busy?yH.opening:yH.open})}),(0,j.jsx)(Wn,{note:n.note})]})}function CH({onCreated:e}){let t=P(`/api/setup/metarepo`);return(0,j.jsxs)(`div`,{className:`stack`,style:{gap:12},children:[(0,j.jsx)(`h2`,{className:`n`,style:{margin:0,fontSize:24},children:yH.title}),(0,j.jsxs)(`div`,{className:`bento`,children:[(0,j.jsx)(F,{title:yH.createTitle,span:`span 7`,children:(0,j.jsx)(I,{of:t,children:t=>(0,j.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,j.jsx)(`p`,{style:{margin:0},children:yH.intro(t.root)}),(0,j.jsx)(xH,{view:t,onCreated:e})]})})}),(0,j.jsx)(F,{title:yH.openTitle,span:`span 5`,children:(0,j.jsx)(SH,{})})]})]})}var wH=w.boundary,TH=class extends v.Component{state={};static getDerivedStateFromError(e){return{error:e instanceof Error?e.message:String(e)}}render(){return this.state.error?(0,j.jsx)(`div`,{className:`bento`,children:(0,j.jsxs)(`section`,{className:`panel`,style:{gridColumn:`1 / -1`},role:`alert`,children:[(0,j.jsx)(`h2`,{className:`h`,children:wH.couldntBeShown(this.props.name)}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:`8px 0 0`},children:wH.somethingOnThisScreen(this.state.error)})]})}):this.props.children}},EH=class extends v.Component{state={};static getDerivedStateFromError(e){return{error:e instanceof Error?e.message:String(e)}}render(){return this.state.error?(0,j.jsx)(`main`,{className:`bento`,style:{padding:24},children:(0,j.jsxs)(`section`,{className:`panel`,style:{gridColumn:`1 / -1`},role:`alert`,children:[(0,j.jsx)(`h2`,{className:`h`,children:wH.appCouldntBeShown}),(0,j.jsx)(`p`,{className:`muted`,style:{margin:`8px 0 0`},children:wH.somethingInTheApp(this.state.error)}),(0,j.jsx)(`p`,{style:{margin:`12px 0 0`},children:(0,j.jsx)(`a`,{href:`#/home`,className:`btn`,onClick:()=>{location.hash=`#/home`,this.setState({error:void 0})},children:wH.goHome})})]})}):this.props.children}},DH=w.shell;function OH(){let{me:e}=Zr();return!e||e.ai===`on`?null:(0,j.jsx)(`span`,{className:`chip warn`,title:e.ai===`off`?DH.aiIsOffIn:DH.imageReadingIsOff,children:e.ai===`off`?DH.aiOff:DH.textOnlyAi})}function kH({health:e,version:t=!0}){let{me:n}=Zr(),r=n?.name?`${n.name} (${e.user})`:e.user;return(0,j.jsxs)(j.Fragment,{children:[n?.warning&&(0,j.jsx)(`span`,{className:`chip warn`,title:n.warning,role:`note`,"aria-label":n.warning,children:DH.setYourGitUser}),(0,j.jsxs)(`span`,{className:`chip dim`,title:DH.recordedAs(e.root,n?.email?` · ${n.email}`:``,e.user),children:[r,t?` · v${e.version}`:``]})]})}function AH(){let[e,t]=dM();return(0,j.jsxs)(`span`,{className:`row`,style:{gap:6},children:[(0,j.jsx)(`label`,{htmlFor:`theme`,className:`hud`,style:{fontSize:9.5},children:w.theme.label}),(0,j.jsx)(`select`,{id:`theme`,className:`field`,style:{height:28,fontSize:12},title:w.theme.hint,value:e,onChange:e=>t(e.target.value),children:eM.map(e=>(0,j.jsx)(`option`,{value:e,children:w.theme.choices[e]},e))})]})}function jH(e,t){let n=e?.rows[0]?.id??t?.rows[0]?.id;return n?DH.askWhatBreaksIf(n):DH.askNeutral}function MH(){let e=P(`/api/search?q=kind:table&limit=1`),t=P(e.state===`error`||e.state===`ready`&&!e.data.rows.length?`/api/search?q=kind:endpoint&limit=1`:void 0);return jH(e.state===`ready`?e.data:void 0,t.state===`ready`?t.data:void 0)}var NH=w.palette,PH=`atticus:open-palette`,FH=e=>`${e.kind}/${e.label}/${e.detail}/${e.href}`,IH=e=>e.replace(/["]/g,` `).split(/\s+/).map(e=>e.replace(/^-+/,``).replace(/:/g,` `).trim()).filter(Boolean).join(` `);function LH(e,t){let n=e.trim().toLowerCase(),r=4;for(let e of t){let t=e.toLowerCase();if(!n||!t.includes(n))continue;let i=t===n?0:t.startsWith(n)?1:RegExp(`[\\s.\\-_/·:]${RH(n)}`).test(t)?2:3;r=Math.min(r,i)}return r}var RH=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function zH(e){let t=e.label.split(` · `);return[e.label,...t,...e.also??[],...e.kind===`change`?[e.detail.split(` · `)[0]]:[]]}function BH(e,t,n,r=[]){let i=e.trim().toLowerCase(),a=e=>!i||e.toLowerCase().includes(i),o=[...i?r.filter(e=>a(e.label)||(e.also??[]).some(a)).map(e=>({kind:`command`,label:e.label,detail:e.detail,href:``,run:e.run,also:e.also??[]})):[],...VL.filter(e=>a(e.label)||a(e.id)||(e.also??[]).some(a)).map(e=>({kind:`screen`,label:e.label,detail:e.group?`${HL(e.section)} · ${UL(e.group)}`:HL(e.section),href:`#/${e.id}`,also:[e.id,...e.also??[]]})),...t.filter(e=>a(e.id)||a(e.title)).map(e=>({kind:`change`,label:e.title,detail:`${e.id} · ${e.state}`,href:`#/changes/${encodeURIComponent(e.id)}`})),...n.map(e=>({kind:`record`,label:e.name&&e.name!==e.id?`${e.id} · ${e.name}`:e.id,detail:e.kind,href:e.kind===`Capability`?`#/features?id=${encodeURIComponent(e.id)}`:`#/explore?q=${encodeURIComponent(e.id)}`}))];if(i){let e={command:0,screen:1,change:2,record:3,ask:4},t=o.map((e,t)=>({item:e,at:t,score:LH(i,zH(e))}));t.sort((t,n)=>t.score-n.score||e[t.item.kind]-e[n.item.kind]||t.at-n.at),o.splice(0,o.length,...t.map(e=>e.item))}return i&&o.push({kind:`ask`,label:NH.askItem(e.trim()),detail:NH.askDetail,href:`#/explore?ask=${encodeURIComponent(e.trim())}`}),o.slice(0,14)}function VH({commands:e=[],placeholder:t}={}){let[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(0),[c,l]=(0,v.useState)([]),[u,d]=(0,v.useState)([]),f=(0,v.useRef)(null),p=(0,v.useRef)(null);(0,v.useEffect)(()=>{let e=e=>{(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),p.current=document.activeElement,r(e=>!e))},t=()=>{p.current=document.activeElement,r(!0)};return addEventListener(`keydown`,e),addEventListener(PH,t),()=>{removeEventListener(`keydown`,e),removeEventListener(PH,t)}},[]),(0,v.useEffect)(()=>{n&&(a(``),s(0),f.current?.focus(),N(`/api/changes`).then(l).catch(()=>l([])))},[n]),(0,v.useEffect)(()=>{let e=i.trim();if(!n||e.length<2){d([]);return}let t=!0,r=setTimeout(()=>{N(`/api/search?q=${encodeURIComponent(IH(e))}&limit=20`).then(e=>t&&d(e.rows)).catch(()=>t&&d([]))},150);return()=>{t=!1,clearTimeout(r)}},[i,n]);let m=(0,v.useMemo)(()=>BH(i,c,u,e),[i,c,u,e]),h=()=>{r(!1),p.current?.focus?.()},g=e=>{e&&(e.run?(h(),e.run()):(location.hash=e.href,h()))};return n?(0,j.jsx)(`div`,{className:`palette-backdrop`,onClick:h,children:(0,j.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":NH.goToAnything,className:`palette panel`,onClick:e=>e.stopPropagation(),onKeyDown:e=>{e.key===`Escape`?(e.preventDefault(),h()):e.key===`Tab`?(e.preventDefault(),f.current?.focus()):e.key===`ArrowDown`?(e.preventDefault(),s(e=>Math.max(0,Math.min(e+1,m.length-1)))):e.key===`ArrowUp`?(e.preventDefault(),s(e=>Math.max(e-1,0))):e.key===`Enter`&&(e.preventDefault(),g(m[o]))},children:[(0,j.jsx)(`label`,{htmlFor:`palette-input`,className:`sr`,children:NH.goToAScreen}),(0,j.jsx)(`input`,{id:`palette-input`,ref:f,value:i,onChange:e=>{a(e.target.value),s(0)},placeholder:t??NH.goToAScreen2,role:`combobox`,"aria-expanded":`true`,"aria-controls":`palette-list`,"aria-activedescendant":m[o]?`palette-${o}`:void 0,autoComplete:`off`}),(0,j.jsxs)(`ul`,{id:`palette-list`,role:`listbox`,"aria-label":NH.results,children:[m.map((e,t)=>(0,j.jsxs)(`li`,{id:`palette-${t}`,role:`option`,"aria-selected":t===o,onMouseEnter:()=>s(t),onClick:()=>g(e),children:[(0,j.jsx)(`span`,{children:e.label}),(0,j.jsxs)(`span`,{className:`hud`,style:{fontSize:9.5},children:[NH.kinds[e.kind],` · `,e.detail]})]},FH(e))),m.length===0&&(0,j.jsx)(`li`,{className:`muted`,children:NH.nothingMatches})]}),(0,j.jsx)(`div`,{className:`hud`,style:{fontSize:9.5,marginTop:8},children:NH.toMoveEnterTo})]})}):null}var HH=w.tour,UH=e=>[`.nav`,`.sh-activity`,`.sh-side`].map(t=>`${t} a[href="#/${e}"]`).join(`, `),WH=[{...HH.steps.home,target:UH(`home`)},{...HH.steps.ask,target:`.ask-form, .sh-search`},{...HH.steps.change,target:UH(`changes`)},{...HH.steps.assistant},{...HH.steps.approve,target:UH(`changes`)}],GH=`atticus.tour.done`,KH=e=>`${GH}:${e}`,qH=()=>{try{return localStorage}catch{return}};function JH(e,t=qH()){try{return t?.getItem(KH(e))===`1`}catch{return!1}}function YH(e,t=qH()){try{t?.setItem(KH(e),`1`)}catch{}}var XH=()=>dispatchEvent(new Event(`atticus:tour`));function ZH({metarepo:e}){let[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(0),a=e??``,o=()=>YH(a);(0,v.useEffect)(()=>{e!==void 0&&!JH(e??``)&&window.self===window.top&&(i(0),n(!0))},[e]),(0,v.useEffect)(()=>{if(!t)return;let e=()=>{YH(a),n(!1)};return addEventListener(`hashchange`,e),()=>removeEventListener(`hashchange`,e)},[t,a]),(0,v.useEffect)(()=>{let e=()=>{i(0),n(!0)};return addEventListener(`atticus:tour`,e),()=>removeEventListener(`atticus:tour`,e)},[]);let s=WH[r];(0,v.useEffect)(()=>{if(!t||!s?.target)return;let e=document.querySelector(s.target);return e?.classList.add(`tour-target`),()=>e?.classList.remove(`tour-target`)},[t,s]),(0,v.useEffect)(()=>{if(!t)return;let e=e=>{e.key===`Escape`&&(o(),n(!1))};return addEventListener(`keydown`,e),()=>removeEventListener(`keydown`,e)},[t]);let c=(0,v.useRef)(null);(0,v.useEffect)(()=>{if(!t)return;let e=document.activeElement;return()=>e?.focus?.()},[t]),(0,v.useEffect)(()=>{t&&c.current?.querySelector(`.btn.primary`)?.focus()},[t,r]);let l=e=>{if(e.key!==`Tab`)return;let t=[...c.current?.querySelectorAll(`button`)??[]];if(!t.length)return;let n=t.indexOf(document.activeElement);t[e.shiftKey?n<=0?t.length-1:n-1:n===t.length-1?0:n+1].focus(),e.preventDefault()};if(!t||!s)return null;let u=()=>{o(),n(!1)};return(0,j.jsxs)(`div`,{ref:c,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`tour-title`,className:`tour panel hero`,onKeyDown:l,children:[(0,j.jsx)(`div`,{className:`hud`,style:{fontSize:10},children:HH.tourOf(r+1,WH.length,w.app.tourEscape)}),(0,j.jsx)(`h2`,{id:`tour-title`,className:`h`,style:{margin:`6px 0`},children:s.title}),(0,j.jsx)(`p`,{style:{margin:`0 0 12px`,lineHeight:1.55,fontSize:13},children:s.body}),(0,j.jsxs)(`div`,{className:`row between`,children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:u,children:HH.skipTheTour}),(0,j.jsxs)(`div`,{className:`row`,style:{gap:6},children:[r>0&&(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>i(r-1),children:HH.back}),r<WH.length-1?(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,onClick:()=>i(r+1),children:HH.next}):(0,j.jsx)(`button`,{type:`button`,className:`btn primary`,onClick:u,children:HH.done})]})]})]})}var QH=w.menu;function $H({size:e=26}){return(0,j.jsxs)(`svg`,{"aria-hidden":`true`,width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,stroke:`var(--accent)`,strokeLinecap:`round`,style:{filter:`drop-shadow(0 0 var(--glow-size) var(--accent))`},children:[(0,j.jsxs)(`g`,{strokeWidth:`1.25`,children:[(0,j.jsx)(`circle`,{cx:`6.5`,cy:`12.4`,r:`4.5`}),(0,j.jsx)(`circle`,{cx:`17.5`,cy:`12.4`,r:`4.5`}),(0,j.jsx)(`path`,{d:`M11 11.4 H13`})]}),(0,j.jsx)(`path`,{strokeWidth:`1.05`,d:`M3.7 11.3 Q3.9 10.0 5.2 9.6 M20.3 11.3 Q20.1 10.0 18.8 9.6`})]})}var eU=`atticus.menu.more`;function tU(){try{return globalThis.localStorage}catch{return}}function nU(e=tU()){try{let t=e?.getItem(eU);return t===`open`||t!==`closed`&&void 0}catch{return}}function rU(e,t=tU()){try{t?.setItem(eU,e?`open`:`closed`)}catch{}}function iU(e){return/Mac|iPhone|iPad|iPod/.test(e??``)?QH.keysMac:QH.keys}function aU(){try{let e=globalThis.navigator;return e?.userAgentData?.platform||e?.platform}catch{return}}var oU=()=>KL().reduce((e,t)=>e+t.pages.length,0);function sU(e){let t=e.under??e.id;return KL().some(e=>e.pages.some(e=>e.id===t))}function cU({current:e,hash:t,id:n=`more-pages`,hidden:r=!1,className:i=`more-pages`}){let a=KL(),o=e.under??e.id,s=YL(t),c=e=>(0,j.jsx)(`a`,{href:XL(e,s),"aria-current":e.id===o?`page`:void 0,children:e.label},e.id);return(0,j.jsx)(`div`,{id:n,className:i,hidden:r,children:a.map(e=>(0,j.jsxs)(`div`,{role:`group`,"aria-label":HL(e.section),children:[(0,j.jsx)(`span`,{className:`more-group`,"aria-hidden":`true`,children:HL(e.section)}),e.phases?e.phases.map(e=>(0,j.jsxs)(`div`,{role:`group`,"aria-label":UL(e.phase),children:[(0,j.jsx)(`span`,{className:`more-phase`,"aria-hidden":`true`,children:UL(e.phase)}),e.pages.map(c)]},e.phase)):e.pages.map(c)]},e.section))})}function lU({current:e,hash:t,full:n}){let[r,i]=(0,v.useState)(()=>nU()),a=(0,v.useRef)(null),o=oU(),s=r??(n||sU(e)),c=e=>{i(e),rU(e)};return(0,j.jsxs)(`div`,{className:`more`,onKeyDown:e=>{e.key===`Escape`&&s&&(e.stopPropagation(),c(!1),a.current?.focus())},children:[(0,j.jsxs)(`button`,{ref:a,type:`button`,className:`more-toggle`,"aria-expanded":s,"aria-controls":`more-pages`,onClick:()=>c(!s),children:[(0,j.jsx)(`span`,{"aria-hidden":`true`,className:`more-caret`,children:`▸`}),(0,j.jsx)(`span`,{children:QH.morePages}),(0,j.jsx)(`span`,{className:`more-count`,children:o})]}),(0,j.jsx)(cU,{current:e,hash:t,hidden:!s})]})}function uU({current:e,hash:t=``,full:n=!1}){return(0,j.jsxs)(`nav`,{"aria-label":w.nav.main,className:`nav`,children:[(0,j.jsxs)(`div`,{className:`brand`,children:[(0,j.jsx)($H,{}),QH.atticus]}),(0,j.jsx)(`div`,{role:`group`,"aria-label":w.nav.main,children:FL.map(t=>{let n=GL(t);return(0,j.jsx)(`a`,{href:`#/${n.id}`,"aria-current":e.section===t?`page`:void 0,children:HL(t)},t)})}),(0,j.jsxs)(`a`,{className:`ask`,href:`#/explore`,children:[(0,j.jsx)(`span`,{"aria-hidden":`true`,style:{width:8,height:8,borderRadius:`50%`,background:`var(--accent)`,boxShadow:`0 0 8px var(--accent)`}}),QH.askAtticus]}),(0,j.jsx)(lU,{current:e,hash:t,full:n}),(0,j.jsx)(`button`,{type:`button`,className:`menu-hint hud`,onClick:()=>dispatchEvent(new Event(PH)),children:QH.anyPage(iU(aU()))})]})}var dU=w.nav;function fU({current:e,hash:t,full:n=!1}){let r=WL(e.section,n),i=HL(e.section),a=e.section===`Change`?YL(t):void 0;if(r.length<2&&(r[0]?.id===e.id||!r.length))return null;let o=e.under??e.id,s=e=>(0,j.jsx)(`a`,{href:XL(e,a),"aria-current":e.id===o?`page`:void 0,children:e.label},e.id),c=n&&e.section===`Change`,l=c?r.filter(e=>!e.group):r;return(0,j.jsxs)(`div`,{className:`section-tabs`,children:[(0,j.jsxs)(`nav`,{"aria-label":dU.youAreHere,className:`crumbs hud`,children:[(0,j.jsx)(`span`,{children:i}),a&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`span`,{"aria-hidden":`true`,children:` › `}),(0,j.jsx)(`span`,{children:a})]}),(0,j.jsx)(`span`,{"aria-hidden":`true`,children:` › `}),(0,j.jsx)(`span`,{"aria-current":`location`,children:e.label})]}),r.length>1&&(0,j.jsxs)(`nav`,{"aria-label":dU.tabs(i),className:`tabs`,children:[l.map(s),c&&LL.map(e=>{let t=r.filter(t=>t.group===e);return t.length?(0,j.jsxs)(`span`,{role:`group`,"aria-label":UL(e),className:`tab-group`,children:[(0,j.jsx)(`span`,{className:`tab-group-name`,"aria-hidden":`true`,children:UL(e)}),t.map(s)]},e):null})]})]})}var pU=`atticus.panel.host`,mU=[`intellij`];function hU(){try{return globalThis.sessionStorage}catch{return}}var gU=e=>typeof e==`string`&&mU.includes(e),_U=new WeakMap,vU={};function yU(e,t=hU()){let n;try{n=new URLSearchParams(e??``).get(`host`)}catch{n=null}if(gU(n)){_U.set(t??vU,n);try{t?.setItem(pU,n)}catch{}return n}try{let e=t?.getItem(pU);if(gU(e))return e}catch{}return _U.get(t??vU)}function bU(){return A()||typeof document<`u`&&document.body&&oM()?!0:!!yU(globalThis.location?.search)}var xU=w.bottomPanel,SU=w.activity,CU=[`console`,`questions`,`problems`,`runs`],wU=`atticus:panel`;function TU(e){try{globalThis.dispatchEvent?.(new CustomEvent(wU,{detail:e}))}catch{}}var EU=`atticus.panel.height`;function DU(e){return Math.max(120,Math.round((typeof e==`number`&&e>0?e:900)-180))}function OU(e,t){let n=e?.parentElement;if(!n||!(n.clientHeight>0))return t;let r=0;for(let t of Array.from(n.children))t!==e&&t.id!==`main`&&(r+=t.offsetHeight||0);return n.clientHeight-r}var kU=(e,t)=>Math.round(Math.min(Math.max(e,120),Math.max(120,t)));function AU(){try{return globalThis.localStorage}catch{return}}function jU(e=AU()){try{let t=Number(e?.getItem(EU));return Number.isFinite(t)&&t>0?t:void 0}catch{return}}function MU(e,t=AU()){try{t?.setItem(EU,String(Math.round(e)))}catch{}}function NU(e,t,n){let r=e===`ArrowUp`?t+16:e===`ArrowDown`?t-16:e===`PageUp`?t+80:e===`PageDown`?t-80:e===`Home`?120:e===`End`?n:void 0;return r===void 0?void 0:kU(r,n)}function PU(e,t,n){if(e===`ArrowRight`)return(t+1)%n;if(e===`ArrowLeft`)return(t-1+n)%n;if(e===`Home`)return 0;if(e===`End`)return n-1}var FU=`/api/questions?state=open`,IU=mj;function LU(e,t){let n=e.state===`ready`?e.data:void 0;return t.state===`error`?_j(n):bj(n,t.state===`ready`?t.data:void 0)?.total}var RU=(e,t)=>t.state===`error`&&e.state===`ready`,zU=`/api/findings?state=open`,BU=`/api/trust`;function VU(e){let t=e.entries.filter(e=>e.state===`failed`),n=e.findings?ej({changes:[],findings:[...e.findings],questions:[],triage:[],steps:[]}).filter(e=>e.kind===`finding`&&e.blocking):[],r=(e.trust?.repos??[]).filter(e=>e.state===`rejected`).map(e=>({repo:e.repo,count:e.verify.report?.rejected??e.lists?.rejected.length??0,...e.next?{command:e.next.command}:{}})),i=(e.copilot?.problems??[]).map(t=>({runId:e.copilot.runId,repo:t.repo,title:w.copilotRuns.strip.stoppedRepo(t.repo,t.part,t.total),rejectedCount:t.rejectedCount}));return{failed:t,blocking:n,rejected:r,broken:[...e.broken??[]],stopped:i}}var HU=e=>e.failed.length+e.blocking.length+e.rejected.length+e.broken.length+e.stopped.length,UU=e=>{try{globalThis.document?.getElementById(e)?.focus()}catch{}},WU=e=>e.state===`error`?e.error:``;function GU(e){let t=xU.questions;if(e.of.state===`loading`)return(0,j.jsx)(`p`,{className:`work-say`,role:`status`,children:t.loading});if(e.of.state===`error`)return(0,j.jsxs)(`div`,{className:`bp-error`,children:[(0,j.jsx)(`p`,{className:`state error`,role:`alert`,children:t.failed(e.of.error)}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:e.onRetry,children:xU.retry})]});let n=e.of.data.questions.filter(e=>!e.state||e.state===`open`),r=e.owner??0;if(!n.length&&!r)return(0,j.jsx)(`p`,{className:`bp-empty`,children:t.empty});let i=n.slice(0,100);return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`bp-list-head`,children:[(0,j.jsx)(`span`,{children:e.owner===void 0?t.intro(n.length):w.questions.toAnswer(n.length+r,n.length,r)}),(0,j.jsx)(`a`,{href:`#/questions`,children:t.openAll})]}),(0,j.jsxs)(`ul`,{className:`bp-list`,children:[r>0&&(0,j.jsxs)(`li`,{className:`bp-row`,children:[(0,j.jsxs)(`span`,{className:`bp-row-main`,children:[(0,j.jsx)(`span`,{className:`bp-row-title`,children:t.ownerRow(r)}),(0,j.jsx)(`span`,{className:`bp-row-meta`,children:t.ownerMeta})]}),(0,j.jsx)(`a`,{className:`btn bp-row-act`,href:`#/questions?kind=owner`,"aria-label":t.ownerLabel(r),children:t.answer})]}),i.map(e=>(0,j.jsxs)(`li`,{className:`bp-row`,children:[(0,j.jsxs)(`span`,{className:`bp-row-main`,children:[(0,j.jsx)(`span`,{className:`bp-row-title`,title:e.question,children:e.question}),(0,j.jsx)(`span`,{className:`bp-row-meta`,children:e.repo})]}),(0,j.jsx)(`a`,{className:`btn bp-row-act`,href:`#/questions/${encodeURIComponent(e.id)}`,"aria-label":t.answerLabel(e.question),children:t.answer})]},e.id))]}),n.length>i.length&&(0,j.jsx)(`p`,{className:`work-say`,children:(0,j.jsx)(`a`,{href:`#/questions`,children:t.more(n.length-i.length)})})]})}function KU(e){let t=xU.problems,{failed:n,blocking:r,rejected:i,broken:a,stopped:o}=e.problems,s=e.findings.state===`loading`||e.trust.state===`loading`,c=[...e.findings.state===`error`?[t.findingsFailed(WU(e.findings))]:[],...e.trust.state===`error`?[t.trustFailed(WU(e.trust))]:[]],l=HU(e.problems)>0;return(0,j.jsxs)(j.Fragment,{children:[s&&(0,j.jsx)(`p`,{className:`work-say`,role:`status`,children:t.loading}),c.length>0&&(0,j.jsxs)(`div`,{className:`bp-error`,children:[c.map(e=>(0,j.jsx)(`p`,{className:`state error`,role:`alert`,children:e},e)),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:e.onRetry,children:xU.retry})]}),!s&&!c.length&&!l&&(0,j.jsx)(`p`,{className:`bp-empty`,children:t.empty}),a.length>0&&(0,j.jsxs)(`section`,{className:`bp-group`,"aria-labelledby":`bp-problems-broken`,children:[(0,j.jsx)(`h3`,{id:`bp-problems-broken`,className:`bp-group-head`,children:w.brokenChanges.problems}),(0,j.jsx)(`ul`,{className:`bp-list`,children:a.map(e=>(0,j.jsxs)(`li`,{className:`bp-row bad`,children:[(0,j.jsxs)(`span`,{className:`bp-row-main`,children:[(0,j.jsx)(`span`,{className:`bp-row-title`,children:e.id}),(0,j.jsx)(`span`,{className:`bp-row-meta`,title:e.message,children:w.brokenChanges.problemMeta(Bo(e),e.message)})]}),(0,j.jsx)(`a`,{className:`btn bp-row-act`,href:`#/changes`,"aria-label":t.openLabel(e.id),children:t.open})]},e.id))})]}),n.length>0&&(0,j.jsxs)(`section`,{className:`bp-group`,"aria-labelledby":`bp-problems-failed`,children:[(0,j.jsx)(`h3`,{id:`bp-problems-failed`,className:`bp-group-head`,children:t.failedRuns}),(0,j.jsx)(`ul`,{className:`bp-list`,children:n.map(n=>(0,j.jsxs)(`li`,{className:`bp-row bad`,children:[(0,j.jsxs)(`span`,{className:`bp-row-main`,children:[(0,j.jsx)(`span`,{className:`bp-row-title`,children:dn(n)}),(0,j.jsx)(`span`,{className:`bp-row-meta`,children:t.failedRun(`${SU.states[n.state]??n.state}${n.exitCode===void 0?``:` (${SU.exitCode(n.exitCode)})`}`,SU.from(SU.where[n.where]??n.where),SU.at(Cn(n.startedAt)))})]}),(0,j.jsx)(`button`,{type:`button`,className:`btn bp-row-act`,"aria-label":t.showLabel(dn(n)),onClick:()=>e.onShow(n.id),children:t.show})]},n.id))})]}),o.length>0&&(0,j.jsxs)(`section`,{className:`bp-group`,"aria-labelledby":`bp-problems-copilot`,children:[(0,j.jsx)(`h3`,{id:`bp-problems-copilot`,className:`bp-group-head`,children:t.copilotStopped}),(0,j.jsx)(`ul`,{className:`bp-list`,children:o.map(n=>(0,j.jsxs)(`li`,{className:`bp-row bad`,children:[(0,j.jsxs)(`span`,{className:`bp-row-main`,children:[(0,j.jsx)(`span`,{className:`bp-row-title`,children:n.title}),(0,j.jsx)(`span`,{className:`bp-row-meta`,children:t.copilotStoppedMeta(n.rejectedCount)})]}),(0,j.jsx)(`button`,{type:`button`,className:`btn bp-row-act`,"aria-label":t.showLabel(n.title),onClick:()=>e.onShow(n.runId),children:t.show})]},`${n.runId}:${n.title}`))})]}),r.length>0&&(0,j.jsxs)(`section`,{className:`bp-group`,"aria-labelledby":`bp-problems-blocking`,children:[(0,j.jsx)(`h3`,{id:`bp-problems-blocking`,className:`bp-group-head`,children:t.blocking}),(0,j.jsx)(`ul`,{className:`bp-list`,children:r.map(e=>(0,j.jsxs)(`li`,{className:`bp-row bad`,children:[(0,j.jsxs)(`span`,{className:`bp-row-main`,children:[(0,j.jsx)(`span`,{className:`bp-row-title`,title:e.title,children:e.title}),(0,j.jsx)(`span`,{className:`bp-row-meta`,children:e.detail})]}),(0,j.jsx)(`a`,{className:`btn bp-row-act`,href:e.href,"aria-label":t.openLabel(e.title),children:t.open})]},e.id??e.title))})]}),i.length>0&&(0,j.jsxs)(`section`,{className:`bp-group`,"aria-labelledby":`bp-problems-rejected`,children:[(0,j.jsx)(`h3`,{id:`bp-problems-rejected`,className:`bp-group-head`,children:t.rejected}),(0,j.jsx)(`ul`,{className:`bp-list`,children:i.map(e=>(0,j.jsxs)(`li`,{className:`bp-row warn`,children:[(0,j.jsxs)(`span`,{className:`bp-row-main`,children:[(0,j.jsx)(`span`,{className:`bp-row-title`,children:t.rejectedFacts(e.repo,e.count)}),e.command&&(0,j.jsx)(`span`,{className:`bp-row-meta`,children:t.fixThenVerify(e.command)})]}),(0,j.jsx)(`a`,{className:`btn bp-row-act`,href:`#/trust`,children:t.openTrust})]},e.repo))})]})]})}function qU(e){if(!e.a.entries.length)return(0,j.jsx)(Dn,{a:e.a});let t=e.a.entries,n=(e,n)=>{let r=e.key===`ArrowDown`?(n+1)%t.length:e.key===`ArrowUp`?(n-1+t.length)%t.length:e.key===`Home`?0:e.key===`End`?t.length-1:void 0;r!==void 0&&(e.preventDefault(),UU(`bp-run-${t[r].id}`))};return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{id:`bp-runs-hint`,className:`work-say bp-hint`,children:xU.runs.hint}),(0,j.jsx)(`ul`,{className:`bp-runs`,"aria-label":xU.runs.label,"aria-describedby":`bp-runs-hint`,children:t.map((t,r)=>(0,j.jsx)(`li`,{children:(0,j.jsx)(`button`,{id:`bp-run-${t.id}`,type:`button`,className:`activity-item bp-run ${t.state}`,"aria-current":t.id===e.shown?`true`:void 0,onClick:()=>e.onPick(t.id),onKeyDown:e=>n(e,r),children:(0,j.jsx)(En,{e:t})})},t.id))})]})}function JU(e){let t=e.a;if(!t)return(0,j.jsx)(`p`,{className:`bp-empty`,children:SU.empty});if(!t.entries.length)return(0,j.jsx)(Dn,{a:t});let n=t.entries.find(e=>e.id===t.selected)??t.entries[0];return n?(0,j.jsxs)(j.Fragment,{children:[t.stopError&&(0,j.jsx)(`p`,{role:`alert`,className:`state error`,children:t.stopError}),(0,j.jsx)(On,{a:t,entry:n,searchId:`bp-search`})]}):(0,j.jsx)(`p`,{className:`bp-empty`,children:xU.console.noneSelected})}function YU(e){let t=e.find(e=>e.state===`running`);if(!t)return;let n=t.progress&&t.progress.total>1?` · ${SU.strip.step(t.progress.done,t.progress.total)}`:``;return`${xU.running(dn(t),SU.from(SU.where[t.where]??t.where))}${n}`}function XU(e){let{open:t,onToggle:n}=e,r=sn(),i=Vt(),[a,o]=(0,v.useState)(`console`),[s,c]=(0,v.useState)({}),[l,u]=(0,v.useState)(()=>jU()??240),d=(0,v.useRef)(null),[f,p]=(0,v.useState)(()=>globalThis.innerHeight);(0,v.useEffect)(()=>{let e=()=>p(OU(d.current,globalThis.innerHeight));if(e(),typeof addEventListener!=`function`)return;addEventListener(`resize`,e);let t=d.current?.parentElement,n=t&&typeof ResizeObserver==`function`?new ResizeObserver(e):void 0;return t&&n?.observe(t),()=>{removeEventListener(`resize`,e),n?.disconnect()}},[t]);let m=DU(f),h=kU(l,m),[g,_]=(0,v.useState)(!1),y=(0,v.useRef)(void 0),b=(0,v.useRef)(h);b.current=h;let[x,S]=(0,v.useState)(``),C=e=>!!s[e]||t&&a===e;(0,v.useEffect)(()=>{t&&!s[a]&&c(e=>({...e,[a]:!0}))},[t,a,s]);let w=P(C(`questions`)?FU:void 0),T=P(C(`questions`)?IU:void 0),E=P(C(`problems`)?zU:void 0),D=P(C(`problems`)?BU:void 0),ee=P(C(`problems`)?zo:void 0);lt(w,T,E,D,ee);let te=r?.open,ne=(0,v.useRef)(void 0);(0,v.useEffect)(()=>{r&&(ne.current===t?r.open!==t&&(r.open&&o(`console`),n()):(ne.current=t,r.open!==t&&r.setOpen(t)))},[t,te]);let O=r?.showAsks??0,re=(0,v.useRef)(O);(0,v.useEffect)(()=>{O!==re.current&&(re.current=O,o(`console`))},[O]);let k=(0,v.useRef)(void 0),A=r?.entries,ie=r?.state;(0,v.useEffect)(()=>{if(!A||ie!==`ready`)return;if(!k.current){k.current=new Set(A.map(e=>e.id));return}let e=A.filter(e=>!k.current.has(e.id));for(let t of e)k.current.add(t.id);let t=e.find(e=>e.state===`running`);t&&S(xU.started(dn(t)))},[A,ie]);let ae=r?.said;(0,v.useEffect)(()=>{ae&&S(ae)},[ae]);let oe=e=>{o(e),t||n()},se=(0,v.useRef)(oe);se.current=oe,(0,v.useEffect)(()=>{if(typeof addEventListener!=`function`)return;let e=e=>{let t=e.detail;CU.includes(t)&&(se.current(t),requestAnimationFrame(()=>UU(`bp-tab-${t}`)))};return addEventListener(wU,e),()=>removeEventListener(wU,e)},[]);let ce=e=>{let t=PU(e.key,CU.indexOf(a),CU.length);if(t===void 0)return;e.preventDefault();let n=CU[t];oe(n),UU(`bp-tab-${n}`)},M=e=>{let t=NU(e.key,h,m);t!==void 0&&(e.preventDefault(),u(t),MU(t))},le=e=>{if(e.button===0){e.preventDefault();try{e.currentTarget?.setPointerCapture?.(e.pointerId)}catch{}y.current={y:e.clientY,h},_(!0)}},ue=e=>{let t=y.current;t&&u(kU(t.h+t.y-e.clientY,m))},de=(e,t=!1)=>{let n=y.current;if(!n)return;y.current=void 0,_(!1);let r=t?b.current:kU(n.h+n.y-e.clientY,m);u(r),MU(r)},fe=r?(r.entries.find(e=>e.id===r.selected)??r.entries[0])?.id:void 0,pe=e=>{r?.select(e),o(`console`),UU(`bp-tab-console`)},me=e=>{r&&r.show(e),o(`console`),UU(`bp-tab-console`)},he=VU({entries:r?.entries??[],...i?.run?{copilot:i.run}:{},...E.state===`ready`?{findings:E.data}:{},...D.state===`ready`?{trust:D.data}:{},...ee.state===`ready`?{broken:ee.data}:{}}),ge=LU(w,T),_e=RU(w,T),ve={...ge===void 0?{}:{questions:ge},...E.state===`ready`&&D.state===`ready`?{problems:HU(he)}:{}},ye=YU(r?.entries??[]);return(0,j.jsxs)(`section`,{ref:d,className:`bp${t?` open`:``}${g?` dragging`:``}`,"aria-label":xU.label,style:t?{height:h}:void 0,children:[t&&(0,j.jsx)(`div`,{className:`bp-resize`,role:`separator`,"aria-orientation":`horizontal`,"aria-label":xU.resize,"aria-description":xU.resizeHint,"aria-controls":`bp-body`,"aria-valuemin":120,"aria-valuemax":m,"aria-valuenow":h,tabIndex:0,onKeyDown:M,onPointerDown:le,onPointerMove:ue,onPointerUp:e=>de(e),onPointerCancel:e=>de(e,!0)}),(0,j.jsxs)(`div`,{className:`bp-head`,children:[(0,j.jsx)(`div`,{role:`tablist`,"aria-label":xU.tabs,className:`bp-tabs`,onKeyDown:ce,children:CU.map(e=>(0,j.jsxs)(`button`,{id:`bp-tab-${e}`,type:`button`,role:`tab`,className:`bp-tab`,"aria-selected":e===a,"aria-controls":`bp-panel-${e}`,tabIndex:e===a?0:-1,onClick:()=>oe(e),children:[(0,j.jsx)(`span`,{children:xU.tab[e]}),ve[e]!==void 0&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`span`,{className:`bp-count`,"aria-hidden":`true`,...e===`questions`&&_e?{title:xU.countStepsOnly(ve[e])}:{},children:ve[e].toLocaleString()}),(0,j.jsx)(`span`,{className:`sr`,children:e===`questions`&&_e?xU.countStepsOnly(ve[e]):xU.count(ve[e])})]})]},e))}),(0,j.jsx)(`span`,{className:`bp-summary`,title:ye,children:ye}),(0,j.jsx)(`span`,{className:`sr`,role:`status`,"aria-live":`polite`,children:x}),(0,j.jsx)(`button`,{type:`button`,className:`bp-toggle`,"aria-expanded":t,"aria-controls":`bp-body`,"aria-label":t?xU.collapse:xU.expand,title:t?xU.collapse:xU.expand,onClick:n,children:(0,j.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`14`,height:`14`,"aria-hidden":`true`,focusable:`false`,children:(0,j.jsx)(`path`,{d:t?`M4 6l4 4 4-4`:`M4 10l4-4 4 4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`})})})]}),(0,j.jsx)(`div`,{id:`bp-body`,className:`bp-body`,hidden:!t,children:CU.map(e=>(0,j.jsxs)(`div`,{id:`bp-panel-${e}`,role:`tabpanel`,"aria-labelledby":`bp-tab-${e}`,className:`bp-panel bp-panel-${e}`,hidden:e!==a,tabIndex:e===`console`?-1:0,children:[t&&e===a&&e===`console`&&(0,j.jsx)(JU,{a:r}),t&&e===a&&e===`questions`&&(0,j.jsx)(GU,{of:w,...T.state===`ready`&&typeof T.data.open==`number`?{owner:T.data.open}:{},onRetry:w.reload}),t&&e===a&&e===`problems`&&(0,j.jsx)(KU,{problems:he,findings:E,trust:D,onShow:me,onRetry:()=>{E.state===`error`&&E.reload(),D.state===`error`&&D.reload()}}),t&&e===a&&e===`runs`&&(r?(0,j.jsx)(qU,{a:r,...fe?{shown:fe}:{},onPick:pe}):(0,j.jsx)(`p`,{className:`bp-empty`,children:SU.empty}))]},e))})]})}function ZU({children:e,size:t=20}){return(0,j.jsx)(`svg`,{"aria-hidden":`true`,focusable:`false`,width:t,height:t,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,children:e})}var QU={Home:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`rect`,{x:`3`,y:`3`,width:`7`,height:`7`,rx:`1`}),(0,j.jsx)(`rect`,{x:`14`,y:`3`,width:`7`,height:`7`,rx:`1`}),(0,j.jsx)(`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`}),(0,j.jsx)(`rect`,{x:`14`,y:`14`,width:`7`,height:`7`,rx:`1`})]}),Map:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`circle`,{cx:`5`,cy:`6`,r:`2.5`}),(0,j.jsx)(`circle`,{cx:`19`,cy:`6`,r:`2.5`}),(0,j.jsx)(`circle`,{cx:`12`,cy:`18`,r:`2.5`}),(0,j.jsx)(`path`,{d:`M7.2 7.3l3.6 8.4M16.8 7.3l-3.6 8.4M7.5 6h9`})]}),Change:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`circle`,{cx:`6`,cy:`5`,r:`2.5`}),(0,j.jsx)(`circle`,{cx:`6`,cy:`19`,r:`2.5`}),(0,j.jsx)(`circle`,{cx:`18`,cy:`8`,r:`2.5`}),(0,j.jsx)(`path`,{d:`M6 7.5v9M18 10.5c0 4-6 3-11 6.5`})]}),Questions:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,j.jsx)(`path`,{d:`M9.5 9.5a2.5 2.5 0 1 1 3.5 2.3c-.7.3-1 .9-1 1.7M12 17h.01`})]}),Knowledge:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`path`,{d:`M4 5a2 2 0 0 1 2-2h13v16H6a2 2 0 0 0-2 2V5z`}),(0,j.jsx)(`path`,{d:`M4 19a2 2 0 0 1 2-2h13`})]}),SetUp:(0,j.jsx)(`path`,{d:`M14.7 6.3a4 4 0 0 0-5.4 5.4L3 18v3h3l6.3-6.3a4 4 0 0 0 5.4-5.4l-2.6 2.6-2.4-.6-.6-2.4z`}),Atticus:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`circle`,{cx:`7`,cy:`12`,r:`4`}),(0,j.jsx)(`circle`,{cx:`17`,cy:`12`,r:`4`})]})},$U=({section:e})=>(0,j.jsx)(ZU,{children:QU[e]}),eW=()=>(0,j.jsxs)(ZU,{children:[(0,j.jsx)(`circle`,{cx:`5`,cy:`12`,r:`1.3`}),(0,j.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1.3`}),(0,j.jsx)(`circle`,{cx:`19`,cy:`12`,r:`1.3`})]}),tW=()=>(0,j.jsxs)(ZU,{children:[(0,j.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,j.jsx)(`path`,{d:`M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z`})]}),nW=({size:e=14})=>(0,j.jsxs)(ZU,{size:e,children:[(0,j.jsx)(`circle`,{cx:`11`,cy:`11`,r:`7`}),(0,j.jsx)(`path`,{d:`M20 20l-3.5-3.5`})]}),rW=()=>(0,j.jsxs)(ZU,{size:16,children:[(0,j.jsx)(`rect`,{x:`3`,y:`4`,width:`18`,height:`16`,rx:`2`}),(0,j.jsx)(`path`,{d:`M9 4v16`})]}),iW=({filled:e=!1})=>(0,j.jsx)(`svg`,{"aria-hidden":`true`,focusable:`false`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:e?`currentColor`:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,j.jsx)(`path`,{d:`M9 3h6l-1 6 4 4H6l4-4-1-6zM12 13v8`})}),aW=({text:e})=>(0,j.jsx)(`span`,{className:`sh-tip`,"aria-hidden":`true`,"data-tip":e}),oW=w.ide;function sW(e){return e.id===`settings`?`settings`:e.section}function cW({current:e,hash:t,className:n=`sh-act`}){let[r,i]=(0,v.useState)(!1),a=(0,v.useRef)(null),o=(0,v.useRef)(null),s=oU();return(0,v.useEffect)(()=>i(!1),[t]),(0,v.useEffect)(()=>{if(!r)return;let e=e=>{let t=e.target;t&&!o.current?.contains(t)&&!a.current?.contains(t)&&i(!1)};return addEventListener(`pointerdown`,e),()=>removeEventListener(`pointerdown`,e)},[r]),(0,j.jsxs)(`div`,{className:`sh-more`,onKeyDown:e=>{e.key===`Escape`&&r&&(e.stopPropagation(),i(!1),a.current?.focus())},children:[(0,j.jsxs)(`button`,{ref:a,type:`button`,className:n,"aria-expanded":r,"aria-controls":`more-pages`,onClick:()=>i(!r),children:[(0,j.jsx)(aW,{text:oW.more}),(0,j.jsx)(eW,{}),(0,j.jsxs)(`span`,{className:`sr`,children:[oW.more,` `,s]})]}),(0,j.jsx)(`div`,{ref:o,className:`sh-flyout`,hidden:!r,children:(0,j.jsx)(cU,{current:e,hash:t,className:`sh-flyout-pages more-pages`})})]})}function lW({current:e,hash:t,badges:n={}}){let r=sW(e);return(0,j.jsxs)(`nav`,{"aria-label":w.nav.main,className:`sh-activity`,children:[(0,j.jsxs)(`div`,{role:`group`,"aria-label":w.nav.main,className:`sh-activity-group`,children:[FL.map(e=>{let t=HL(e),i=e===`Questions`?n.questions:void 0;return(0,j.jsxs)(`a`,{className:`sh-act`,href:`#/${GL(e).id}`,"aria-current":r===e?`page`:void 0,children:[(0,j.jsx)(aW,{text:t}),(0,j.jsx)($U,{section:e}),(0,j.jsxs)(`span`,{className:`sr`,children:[t,i?`, ${oW.openCount(i)}`:``]}),!!i&&(0,j.jsx)(`span`,{className:`sh-badge`,"aria-hidden":`true`,"data-n":i>99?`99+`:String(i)})]},e)}),(0,j.jsx)(cW,{current:e,hash:t})]}),(0,j.jsx)(`span`,{className:`sh-grow`,"aria-hidden":`true`}),(0,j.jsxs)(`a`,{className:`sh-act`,href:`#/settings`,"aria-current":r===`settings`?`page`:void 0,children:[(0,j.jsx)(aW,{text:oW.settings}),(0,j.jsx)(tW,{}),(0,j.jsx)(`span`,{className:`sr`,children:oW.settings})]})]})}var uW=/«[^»]*»|:r[0-9a-z]*:|_r_[0-9a-z]+_/g,dW=/«[^»]*»|:r[0-9a-z]*:|_r_[0-9a-z]+_/;function fW(e){let t=new Map;return e.map(e=>{let n=e.getAttribute(`aria-controls`)??e.getAttribute(`data-controls`);if(!n)return;let r=n.replace(uW,`~`),i=t.get(r)??0;return t.set(r,i+1),`${r}#${i}`})}function pW(e){let t=fW(e);return e.map((e,n)=>e.getAttribute(`aria-expanded`)===`true`?t[n]:void 0).filter(e=>!!e)}function mW(e,t){let n=new Set(e),r=fW(t);return t.forEach((e,t)=>{let i=r[t];i&&n.has(i)&&(e.getAttribute(`aria-expanded`)===`false`&&e.click(),n.delete(i))}),n}var hW=e=>[...e.querySelectorAll(`button[aria-expanded][aria-controls], button[aria-expanded][data-controls]`)],gW=new Set([``,`text`,`search`,`email`,`url`,`number`,`tel`]);function _W(e){let t=e.tagName.toLowerCase();return t===`textarea`||t===`select`||t===`input`&&gW.has((e.type??``).toLowerCase())}function vW(e,t){if(e.id&&dW.test(e.id)){let n=e=>(e.id??``).replace(uW,`~`),r=n(e);return`#${r}#${t.filter(e=>e.id&&n(e)===r).indexOf(e)}`}if(e.id)return`#${e.id}`;if(e.name)return`@${e.name}`;let n=e.tagName.toLowerCase();return`${n}:${t.filter(e=>e.tagName.toLowerCase()===n&&!e.id&&!e.name).indexOf(e)}`}function yW(e,t,n,r=[]){let i={};for(let n of e){if(!_W(n))continue;let r=vW(n,e);t.has(r)&&(i[r]=n.value)}if(!(!Object.keys(i).length&&n<1&&!r.length))return{fields:i,scroll:n,...r.length?{open:[...r]}:{}}}var bW=e=>new Set(Object.keys(e.fields));function xW(e,t,n,r=new Set(Object.keys(e.fields))){let i=new Set(r);for(let r of t){if(!_W(r))continue;let a=vW(r,t);if(!i.has(a))continue;let o=e.fields[a];r.value!==o&&n(r,o),i.delete(a)}return i}function SW(e,t){let n=e,r=Object.getPrototypeOf(n),i=Object.getOwnPropertyDescriptor(r,`value`)?.set;i?i.call(n,t):n.value=t,n.dispatchEvent(new Event(`input`,{bubbles:!0})),n.dispatchEvent(new Event(`change`,{bubbles:!0}))}var CW=e=>[...e.querySelectorAll(`input, textarea, select`)];function wW(e,t,n,r=8e3){let i=new Set(Object.keys(n.fields)),a=new Set(n.open??[]),o=n.scroll<1,s=()=>{a.size&&(a=mW(a,hW(e))),i.size&&(i=xW(n,CW(e),SW,i)),!o&&t.scrollHeight-t.clientHeight>=n.scroll-1&&(t.scrollTop=n.scroll,o=!0),!i.size&&!a.size&&o&&d()},c=new MutationObserver(s),l=setTimeout(()=>d(),r),u=e=>e.isTrusted&&d();function d(){c.disconnect(),clearTimeout(l),e.removeEventListener(`input`,u,!0)}return c.observe(e,{childList:!0,subtree:!0}),e.addEventListener(`input`,u,!0),s(),d}var TW=e=>e.slice(0,e.lastIndexOf(`|`)),EW=class{kept=new Map;closing;leave(e,t){let n=this.closing!==void 0&&TW(e)===this.closing;this.closing=void 0,t&&!n?this.kept.set(e,t):this.kept.delete(e)}take(e){let t=this.kept.get(e);return this.kept.delete(e),t}close(e,t){for(let t of[...this.kept.keys()])TW(t)===e&&this.kept.delete(t);this.closing=t?e:void 0}shown(){this.closing=void 0}},DW=`/api/trust`,OW=e=>dt(e)||ft(e,/(^|\/)facts\//);function kW(e){if(e&&Array.isArray(e.repos))return e.repos.map((e,t)=>e&&typeof e==`object`&&typeof e.repo==`string`?e.repo:`#${t+1}`)}var AW=e=>kW(e)?.length;function jW(e){return e.filter(e=>e.kind===`repo`).map(e=>e.id.replace(/^repo:/,``))}function MW(e,t){let n=kW(e);if(!n||!t)return;let r=new Set(n),i=new Set(jW(t.children)),a=(e,t)=>e.localeCompare(t),o=[...r].filter(e=>!i.has(e)).sort(a),s=[...i].filter(e=>!r.has(e)).sort(a),c=[...r].filter(e=>i.has(e)).length;return{repos:r.size,onMap:c,notOnMap:o,offManifest:s}}var NW=w.explorer,PW=[`changes`,`systems`,`questions`,`pinned`],FW=new Set([`define`,`design`,`plan`,`build`,`qa`,`release-ready`,`returned`,`post-release-review`]);function IW(e,t){return t?.length?({draft:[`product`],define:[`product`],returned:[`product`],design:[`architecture`],plan:[`analysis`,`delivery`],build:[`delivery`],qa:[`delivery`],"release-ready":[`delivery`]}[e]??[]).some(e=>t.includes(e)):!1}var LW=e=>`#/changes/${encodeURIComponent(e)}`,RW=e=>`#/canvas?node=${encodeURIComponent(e)}`;function zW(e){return e.filter(e=>FW.has(e.state)).map(e=>({id:`changes/${e.id}`,label:e.id,hash:LW(e.id),...e.title&&e.title!==e.id?{title:e.title}:{},detail:NW.stages[e.state]??e.state,...IW(e.state,e.yourRoles)?{waits:!0}:{}}))}var BW=e=>e.properties.boundary===`outside`||e.properties.boundary===`vendor`,VW=(e,t)=>e.label.localeCompare(t.label);function HW(e,t=[],n=[]){let r=new Set(n.map(e=>`repo:${e}`)),i=e.children,a=e=>i.filter(t=>t.parent===e),o=e=>{if(e.kind===`system`)return BW(e)?`outside`:void 0;let t=e.kind===`component`?[e.properties.type]:a(e.id).filter(e=>e.kind===`component`).map(e=>e.properties.type);if(t.includes(`gateway`))return`gw`;if(t.length&&t.every(e=>e===`library`))return`lib`},s=e=>{let t=o(e),n=e.kind===`repo`?a(e.id).filter(e=>e.kind===`component`).length:0,i=e.kind===`repo`&&r.has(e.id);return{id:`systems/${e.id}`,label:e.label,hash:RW(e.id),...t?{kind:t}:{},...n?{count:n,countOf:`components`}:{},...i?{detail:NW.notInManifest,offManifest:!0}:{}}},c=e=>a(e).filter(e=>e.kind===`repo`||e.kind===`component`).map(s).sort(VW),l=i.filter(e=>e.kind===`system`&&(e.parent??`estate`)===`estate`).map(e=>{let t=c(e.id),n=o(e),i=a(e.id).filter(e=>e.kind===`repo`&&!r.has(e.id)).length,s=BW(e);return{id:`systems/${e.id}`,label:e.label,hash:RW(e.id),...n?{kind:n}:{},...i?{count:i,countOf:`repos`}:{},...!i&&!s?{detail:NW.noRepo}:{},...t.length?{children:t}:{},outside:s}}).sort((e,t)=>Number(e.outside)-Number(t.outside)||VW(e,t)).map(({outside:e,...t})=>t),u=t.length?[{id:`systems/not-on-map`,label:NW.notOnMap,hash:`#/trust`,count:t.length,countOf:`repos`,children:[...t].sort((e,t)=>e.localeCompare(t)).map(e=>({id:`systems/manifest:${e}`,label:e,hash:`#/trust`}))}]:[];return[...l,...c(`estate`),...u]}function UW(e,t){let n=new Map;for(let t of e.questions)n.set(t.repo,(n.get(t.repo)??0)+1);return[...[...n.entries()].sort(([e,t],[n,r])=>r-t||e.localeCompare(n)).map(([e,t])=>({id:`questions/repo:${e}`,label:e,hash:`#/questions`,count:t})),...t&&t.open>0?[{id:`questions/owner`,label:NW.ownerQuestions,hash:`#/questions?kind=owner`,count:t.open}]:[]]}function WW(e,t){let n=JL(e),r=HL(n.section),i=YL(e),a=new URLSearchParams(e.split(`?`)[1]??``).get(`node`)??void 0,o=i??(a?t?.(a)??a.replace(/^[a-z-]+:/,``):void 0),s=[r,...(n.id===`changes`&&i?[]:[n.label]).filter(e=>e!==r),...o?[o]:[]];return NW.pageLabel(...s)}function GW(e,t){return e.map(e=>({id:`pinned/${e}`,label:WW(e,t),hash:e,pin:e}))}var KW=e=>t=>e?.children.find(e=>e.id===t)?.label;function qW(e,t){let n=new Set;if(!t.trim())return{items:[...e],open:n};let r=e=>e.flatMap(e=>{if(ti([e.label,e.title,e.detail,e.kind],t))return[e];let i=r(e.children??[]);return i.length?(n.add(e.id),[{...e,children:i}]):[]});return{items:r(e),open:n}}function JW(e,t,n){let r=[],i=(e,t,a)=>e.forEach((o,s)=>{r.push({item:o,level:t,...a?{parent:a}:{},setSize:e.length,posInSet:s+1}),o.children?.length&&n.has(o.id)&&i(o.children,t+1,o.id)});return i(t,1),r}function YW(e,t,n,r){if(!e.length)return;let i=Math.max(0,e.findIndex(e=>e.item.id===t)),a=e[i],o=a.item.id,s=!!a.item.children?.length;switch(n){case`ArrowDown`:return{focus:e[Math.min(e.length-1,i+1)].item.id};case`ArrowUp`:return{focus:e[Math.max(0,i-1)].item.id};case`Home`:return{focus:e[0].item.id};case`End`:return{focus:e[e.length-1].item.id};case`ArrowRight`:return s?r.has(o)?{focus:e[i+1].item.id}:{expand:o}:void 0;case`ArrowLeft`:return s&&r.has(o)?{collapse:o}:a.parent?{focus:a.parent}:void 0;case`Enter`:return{open:a.item.hash};case`Delete`:return a.item.pin?{unpin:a.item.pin}:void 0}if(n.length===1&&/\S/.test(n)){let t=n.toLowerCase(),r=[...e.slice(i+1),...e.slice(0,i+1)].find(e=>e.item.label.toLowerCase().startsWith(t));return r?{focus:r.item.id}:void 0}}var XW=`ex-pin-here`;function ZW(e,t){let n=e.findIndex(e=>e.item.pin===t),r=n<0?void 0:e[n+1]??e[n-1];return r?QW(r.item.id):XW}var QW=e=>`ex-i-${e.replace(/[^A-Za-z0-9-]/g,e=>`_${e.charCodeAt(0).toString(36)}_`)}`,$W=`atticus.explorer.pinned`,eG=`atticus:pins`,tG=50;function nG(){try{return globalThis.localStorage}catch{return}}var rG=e=>typeof e==`string`&&/^#\/[A-Za-z0-9-]/.test(e)&&e.length<400,iG=e=>/^#?\/?$/.test(e)?`#/home`:e;function aG(e=nG()){let t;try{t=JSON.parse(e?.getItem(`atticus.explorer.pinned`)??`[]`)}catch{return[]}return Array.isArray(t)?[...new Set(t.filter(rG))].slice(0,tG):[]}var oG=new WeakMap,sG={},cG=new WeakSet;function lG(e,t){oG.set(t??sG,e);try{t?.setItem($W,JSON.stringify(e)),t&&cG.delete(t)}catch{t&&cG.add(t)}typeof dispatchEvent==`function`&&dispatchEvent(new CustomEvent(eG))}function uG(e,t=nG()){let n=iG(e),r=dG(t),i=r.includes(n)?r.filter(e=>e!==n):[...r,n].slice(-50);return lG(i,t),i}function dG(e){let t=!!e&&!cG.has(e);try{e?.getItem($W)}catch{t=!1}return t&&e?aG(e):oG.get(e??sG)??[]}function fG(){let[e,t]=(0,v.useState)(()=>dG(nG()));return(0,v.useEffect)(()=>{let e=()=>t(dG(nG()));return addEventListener(eG,e),addEventListener(`storage`,e),()=>{removeEventListener(eG,e),removeEventListener(`storage`,e)}},[]),e}var pG=w.explorer,mG=`/api/graph/node/estate?lens=architecture&depth=3`,hG=`/api/changes`,gG=pj,_G=mj,vG=`atticus.explorer.sections`,yG={changes:!0,systems:!0,questions:!0,pinned:!0};function bG(){try{let e=JSON.parse(globalThis.localStorage?.getItem(`atticus.explorer.sections`)??`{}`);if(!e||typeof e!=`object`)return yG;let t=e;return Object.fromEntries(PW.map(e=>[e,typeof t[e]!=`boolean`||t[e]]))}catch{return yG}}function xG(e){try{globalThis.localStorage?.setItem(vG,JSON.stringify(e))}catch{}}var SG=(e,t)=>iG(e.hash)===iG(t);function CG({open:e}){return(0,j.jsx)(`svg`,{className:e?`ex-chev open`:`ex-chev`,"aria-hidden":`true`,width:`12`,height:`12`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,j.jsx)(`path`,{d:`M6 4l4 4-4 4`})})}function wG(e){return pG.spoken(e.label,...e.title?[e.title]:[],...e.detail?[e.detail]:[],...e.kind?[pG.kindWords[e.kind]]:[],...e.count===void 0?[]:[e.countOf===`repos`?pG.repos(e.count):e.countOf===`components`?pG.components(e.count):pG.items(e.count)],...e.waits?[pG.waitsOnYou]:[])}function TG(e){let{item:t}=e.row,n=(t.children??[]).length>0,r=n&&e.expanded.has(t.id),i=SG(t,e.current);return(0,j.jsxs)(`li`,{id:QW(t.id),role:`treeitem`,"aria-level":e.row.level,"aria-setsize":e.row.setSize,"aria-posinset":e.row.posInSet,"aria-expanded":n?r:void 0,"aria-label":wG(t),"aria-current":i?`page`:void 0,...t.pin?{"aria-keyshortcuts":`Delete`,"aria-description":pG.unpinHint}:{},tabIndex:e.tabStop===t.id?0:-1,"data-id":t.id,className:`ex-item`,children:[(0,j.jsxs)(`div`,{className:i?`ex-row here`:`ex-row`,style:{paddingLeft:8+(e.level-1)*14},title:t.title?pG.spoken(t.label,t.title):t.label,"data-row":t.id,onClick:()=>e.onOpen(t.hash),children:[n?(0,j.jsx)(`span`,{className:`ex-twisty`,"aria-hidden":`true`,"data-twisty":t.id,onClick:n=>{n.stopPropagation(),e.onToggleItem(t.id)},children:(0,j.jsx)(CG,{open:r})}):(0,j.jsx)(`span`,{className:`ex-twisty`,"aria-hidden":`true`}),(0,j.jsx)(`span`,{className:`ex-label`,children:t.label}),t.kind&&(0,j.jsx)(`span`,{className:`ex-kind`,"aria-hidden":`true`,children:pG.kinds[t.kind]}),t.waits&&(0,j.jsx)(`span`,{className:`ex-waits`,"aria-hidden":`true`,children:pG.waitsOnYou}),t.detail&&(0,j.jsx)(`span`,{className:t.waits?`ex-detail waits`:`ex-detail`,"aria-hidden":`true`,children:t.detail}),t.count!==void 0&&(0,j.jsx)(`span`,{className:`ex-count`,"aria-hidden":`true`,children:pG.count(t.count)})]}),r&&(0,j.jsx)(`ul`,{role:`group`,className:`ex-group`,children:e.rows.filter(e=>e.parent===t.id).map(t=>(0,j.jsx)(TG,{...e,row:t,level:e.level+1},t.item.id))})]})}function EG(e){let{s:t}=e;if(t.state===`loading`)return(0,j.jsxs)(`div`,{className:`ex-skel`,role:`status`,"aria-busy":`true`,children:[(0,j.jsx)(`span`,{className:`sr`,children:pG.loading(e.title)}),(0,j.jsx)(`span`,{className:`skeleton`,style:{width:`72%`}}),(0,j.jsx)(`span`,{className:`skeleton`,style:{width:`54%`}}),(0,j.jsx)(`span`,{className:`skeleton`,style:{width:`64%`}})]});if(t.state===`error`&&(!t.error||Fe(t.error)))return(0,j.jsx)(`p`,{className:`ex-state`,children:w.app.notLoadedOffline});if(t.state===`error`)return(0,j.jsxs)(`div`,{className:`ex-state error`,role:`alert`,children:[(0,j.jsx)(`span`,{children:pG.couldntLoad(t.error??``)}),(0,j.jsx)(`button`,{type:`button`,className:`btn ex-retry`,"data-retry":t.id,onClick:()=>e.onRetry(t.id),children:pG.retry})]});if(!t.items.length)return(0,j.jsx)(`p`,{className:`ex-state`,children:e.filter.trim()?w.filter.nothingMatches(w.filter.words(e.filter.trim())):pG.empty[t.id]});let n=JW(t.id,t.items,e.expanded),r=e.focus[t.id],i=n.some(e=>e.item.id===r)?r:n[0]?.item.id;return(0,j.jsx)(`ul`,{role:`tree`,"aria-labelledby":`ex-head-${t.id}`,className:`ex-tree`,onKeyDown:n=>e.onTreeKey(t.id,n),onFocus:n=>{let r=n.target.dataset?.id;r&&e.onTreeFocus(t.id,r)},children:n.filter(e=>e.level===1).map(t=>(0,j.jsx)(TG,{row:t,rows:n,tabStop:i,expanded:e.expanded,current:e.current,level:1,onOpen:e.onOpen,onToggleItem:e.onToggleItem},t.item.id))})}function DG(e){let t=WW(iG(e.current));return(0,j.jsxs)(`div`,{className:`ex`,children:[(0,j.jsx)(`p`,{className:`ex-title`,"aria-hidden":`true`,children:pG.title}),(0,j.jsx)(`div`,{className:`ex-filter`,children:(0,j.jsx)(`input`,{type:`search`,className:`field`,"aria-label":pG.filter,placeholder:pG.filterPlaceholder,autoComplete:`off`,value:e.filter,onChange:t=>e.onFilter(t.target.value)})}),(0,j.jsx)(`div`,{className:`ex-scroll`,children:e.sections.map(n=>{let r=pG.sections[n.id];return(0,j.jsxs)(`section`,{className:`ex-section`,"aria-labelledby":`ex-head-${n.id}`,children:[(0,j.jsxs)(`div`,{className:`ex-headrow`,children:[(0,j.jsx)(`h2`,{className:`ex-head`,children:(0,j.jsxs)(`button`,{type:`button`,className:`ex-head-btn`,"aria-expanded":n.open,"aria-controls":`ex-body-${n.id}`,onClick:()=>e.onToggleSection(n.id),children:[(0,j.jsx)(CG,{open:n.open}),(0,j.jsx)(`span`,{id:`ex-head-${n.id}`,className:`ex-head-name`,children:r}),n.count&&(0,j.jsx)(`span`,{className:`ex-head-count`,children:n.count})]})}),n.id===`pinned`&&(0,j.jsx)(`button`,{id:`ex-pin-here`,type:`button`,className:`ex-pin`,"aria-pressed":e.pinnedHere,"aria-label":pG.pinHere(t),title:pG.pinHere(t),onClick:e.onPinHere,children:pG.pin})]}),(0,j.jsx)(`div`,{id:`ex-body-${n.id}`,className:`ex-body`,hidden:!n.open,children:n.open&&(0,j.jsx)(EG,{...e,s:n,title:r})})]},n.id)})})]})}var OG=e=>e!==void 0&&Array.isArray(e.repos)&&e.repos.length===0;function kG(e,t=!1){return e.state===`ready`?{state:`ready`}:e.state===`error`?e.notYet&&t?{state:`ready`}:{state:`error`,error:e.error}:{state:`loading`}}function AG(e){if(!e)return;let t=e.onMap===e.repos?pG.repos(e.repos):pG.reposOnMap(e.onMap,e.repos),n=e.offManifest?.length??0;return n?pG.alsoOffManifest(t,n):t}function jG(e){let{current:t,onOpen:n}=e,[r,i]=(0,v.useState)(bG),[a,o]=(0,v.useState)(new Set),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(new Set),[d,f]=(0,v.useState)({}),p=(0,v.useRef)(void 0),m=s.trim().length>0,h=e=>r[e]||m,g=e=>!a.has(e)&&!m,_=Zj(hG,h(`changes`),g(`changes`)),y=Qj(DW,h(`systems`),OW),b=OG(y),x=Zj(mG,h(`systems`)&&!b,g(`systems`)),S=Zj(gG,h(`questions`),g(`questions`)),C=Zj(_G,h(`questions`),g(`questions`)),w=MW(y,x.state===`ready`?x.data:void 0),T=fG();Pe(()=>{for(let e of[_,x,S,C])e.state===`error`&&e.reload()}),ut(e=>{let t=e.some(e=>e.type===`file.changed`);dt(e)&&x.reload(),(t||e.some(e=>e.type===`index.rebuilt`))&&_.reload(),t&&(S.reload(),C.reload())});let E=(0,v.useMemo)(()=>({changes:_.state===`ready`?zW(_.data):[],systems:x.state===`ready`?HW(x.data,w?.notOnMap??[],w?.offManifest??[]):[],questions:S.state===`ready`?UW(S.data,C.state===`ready`?C.data:void 0):[],pinned:GW(T,KW(x.state===`ready`?x.data:void 0))}),[_,x,S,C,T,y]),D=(0,v.useMemo)(()=>{let e={},t=new Set;for(let n of PW){let r=qW(E[n],s);e[n]=r.items,r.open.forEach(e=>t.add(e))}return{items:e,open:new Set([...l,...t])}},[E,s,l]),ee={changes:kG(_),systems:b?{state:`ready`}:kG(x,!0),questions:S.state===`ready`&&(C.state===`idle`||C.state===`loading`)?{state:`loading`}:kG(S),pinned:{state:`ready`}},te={changes:_.state===`ready`?pG.count(E.changes.length):void 0,systems:AG(w),questions:(()=>{let e=bj(S.state===`ready`?S.data:void 0,C.state===`ready`?C.data:void 0);return e?pG.count(e.total):void 0})(),pinned:void 0},ne=PW.map(e=>({id:e,open:r[e]||m,...ee[e],items:D.items[e],...te[e]?{count:te[e]}:{}}));(0,v.useEffect)(()=>{let e=p.current;e&&(p.current=void 0,document.getElementById(e)?.focus())},[d,D,T]);let O=e=>u(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return(0,j.jsx)(DG,{current:t,filter:s,sections:ne,expanded:D.open,focus:d,pinnedHere:T.includes(iG(t)),onFilter:c,onToggleSection:e=>{let t={...r,[e]:!r[e]};i(t),xG(t),o(t=>new Set([...t,e]))},onToggleItem:O,onOpen:n,onRetry:e=>{e===`changes`&&_.reload(),e===`systems`&&x.reload(),e===`questions`&&(S.reload(),C.reload())},onPinHere:()=>uG(t),onTreeFocus:(e,t)=>f(n=>n[e]===t?n:{...n,[e]:t}),onTreeKey:(e,t)=>{if(t.altKey||t.ctrlKey||t.metaKey)return;let r=JW(e,D.items[e],D.open),i=YW(r,d[e],t.key,D.open);if(i){if(t.preventDefault(),`focus`in i)p.current=QW(i.focus),f(t=>({...t,[e]:i.focus}));else if(`expand`in i||`collapse`in i)O(`expand`in i?i.expand:i.collapse);else if(`open`in i)n(i.open);else{let t=r.findIndex(e=>e.item.pin===i.unpin),n=r[t+1]??r[t-1];p.current=ZW(r,i.unpin),uG(i.unpin),n&&f(t=>({...t,[e]:n.item.id}))}}}})}var MG=w.ide,NG=e=>e.replace(/[\\/]+$/,``).split(/[\\/]/).pop()||e;function PG(e,t){return{root:e.root,version:e.version,...e.apiVersion?{apiVersion:e.apiVersion}:{},user:t?.user??e.user}}function FG({facts:e,onShowRunning:t}){let n=e.running;return(0,j.jsxs)(`footer`,{className:`sh-status`,"aria-label":MG.status,children:[e.root&&(0,j.jsx)(`span`,{className:`sh-status-item sh-mono`,title:e.root,children:NG(e.root)}),e.repos!==void 0&&(0,j.jsx)(`a`,{className:`sh-status-item`,href:`#/trust`,children:MG.repos(e.repos)}),e.questions!==void 0&&(0,j.jsx)(`a`,{className:`sh-status-item`,href:`#/questions`,children:MG.questions(e.questions)}),n&&(0,j.jsxs)(`button`,{type:`button`,className:`sh-status-item`,onClick:()=>t?.(n.id),children:[(0,j.jsx)(`span`,{className:`sh-spin`,"aria-hidden":`true`}),MG.running(n.title),n.total?` ${MG.step(n.done??0,n.total)}`:``,n.more>0?` ${MG.alsoRunning(n.more)}`:``]}),(0,j.jsx)(`span`,{className:`sh-grow`,"aria-hidden":`true`}),e.apiVersion&&(0,j.jsx)(`span`,{className:`sh-status-item sh-low`,children:MG.api(e.apiVersion)}),e.user&&(0,j.jsx)(`span`,{className:`sh-status-item`,children:MG.who(e.user,e.role)}),e.version&&(0,j.jsx)(`span`,{className:`sh-status-item sh-mono sh-low`,children:MG.version(e.version)})]})}var IG=`home`,LG=`#/home`,RG=`atticus.shell.tabs`,zG=/^#\/[a-z][a-z0-9-]*(\/[^?\s]*)?(\?[^\s]*)?$/;function BG(e){let t=JL(e),n=t.section===`Change`?YL(e):void 0;return n?`change:${n}`:t.id}function VG(e){let t=JL(e.hash).label;if(!e.key.startsWith(`change:`))return{label:t,title:t};let n=e.key.slice(7);return{label:n,title:w.ide.tabTitle(n,t)}}var HG=(e=0)=>({key:IG,hash:LG,used:e}),UG=()=>({tabs:[HG()],active:IG}),WG=e=>e.tabs.reduce((e,t)=>Math.max(e,t.used),0);function GG(e){let t=e.tabs;for(;t.length>12;){let n=t.filter(t=>t.key!==`home`&&t.key!==e.active).sort((e,t)=>e.used-t.used)[0];if(!n)break;t=t.filter(e=>e!==n)}return t===e.tabs?e:{...e,tabs:t}}function KG(e,t){let n=BG(t),r=n===`home`||!zG.test(t)?LG:t,i=e.tabs.find(e=>e.key===n);if(i&&i.hash===r&&e.active===n)return e;let a={key:n,hash:r,used:WG(e)+1};return GG({tabs:i?e.tabs.map(e=>e.key===n?a:e):[...e.tabs,a],active:n})}function qG(e,t){let n=e.tabs.findIndex(e=>e.key===t);if(t===`home`||n<0)return{state:e};let r=e.tabs.filter(e=>e.key!==t);if(e.active!==t)return{state:{...e,tabs:r}};let i=r[n]??r[n-1]??HG();return{state:{tabs:r,active:i.key},go:i.hash}}function JG(e,t,n){let r=e.tabs.findIndex(e=>e.key===t),i=r+n;if(t===`home`||r<0||i<1||i>=e.tabs.length)return e;let a=[...e.tabs];return[a[r],a[i]]=[a[i],a[r]],{...e,tabs:a}}function YG(){try{return globalThis.localStorage}catch{return}}function XG(e=YG()){let t;try{let n=e?.getItem(RG);if(!n)return;t=JSON.parse(n)}catch{return}let n=t;if(!n||!Array.isArray(n.tabs))return;let r=[HG()],i=0;for(let e of n.tabs){let t=typeof e?.hash==`string`?e.hash:``;if(!zG.test(t))continue;let n=BG(t);n===`home`||r.some(e=>e.key===n)||r.push({key:n,hash:t,used:++i})}let a=typeof n.active==`string`?n.active:IG,o=r.some(e=>e.key===a)?a:IG;return GG({tabs:r.map(e=>e.key===o?{...e,used:i+1}:e),active:o})}function ZG(e,t=YG()){try{t?.setItem(RG,JSON.stringify({active:e.active,tabs:e.tabs.map(e=>({key:e.key,hash:e.hash}))}))}catch{}}function QG(e,t){let n=e??UG();return!t||t===`#`||t===`#/`?n:KG(n,t)}var $G=e=>e.tabs.find(t=>t.key===e.active)?.hash??`#/home`;function eK(e,t=YG()){if(e&&e!==`#`&&e!==`#/`)return e;let n=$G(XG(t)??UG());return n===`#/home`?e:n}var tK=w.ide,nK=`sh-panel`,rK=e=>`sh-tab-${e.replace(/[^A-Za-z0-9-]/g,e=>`_${e.charCodeAt(0).toString(36)}_`)}`;function iK(e){requestAnimationFrame(()=>{let t=document.activeElement;t&&t!==document.body&&t.isConnected!==!1||((e?document.getElementById(rK(e)):null)??document.getElementById(`main`))?.focus()})}function aK(e){try{(globalThis.document?.getElementById(rK(e)))?.scrollIntoView?.({inline:`nearest`,block:`nearest`})}catch{}}function oK(e,t,n=0){let r=t.scroll+n,i=t.scroll+t.width,a=[],o=[];for(let n of e){if(n.key===`home`){t.width<n.width-1&&a.push(n.key);continue}let e=n.left+n.width;e<=r+1||n.left>=i-1?a.push(n.key):(n.left<r-1||e>i+1)&&o.push(n.key)}return{hidden:a,cut:o}}function sK(e,t,n){if(n){if(e===`Escape`)return`close`;if(e===`Tab`)return`leave`;if(e===`Home`)return 0;if(e===`End`)return n-1;if(e===`ArrowDown`)return(t+1)%n;if(e===`ArrowUp`)return(t-1+n)%n}}function cK(e){let[t,n]=(0,v.useState)(!1),r=(0,v.useRef)(null),i=(0,v.useRef)(null),a=(0,v.useRef)(null);(0,v.useEffect)(()=>{t&&i.current?.querySelector(`button`)?.focus()},[t]),(0,v.useEffect)(()=>{if(!t)return;let e=e=>{a.current?.contains(e.target)||n(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[t]);let o=e.state.tabs.filter(t=>e.keys.includes(t.key));if(!o.length)return null;let s=(e=!0)=>{n(!1),e&&r.current?.focus()};return(0,j.jsxs)(`div`,{className:`sh-more`,ref:a,children:[(0,j.jsx)(`button`,{ref:r,type:`button`,className:`sh-more-btn`,"aria-haspopup":`menu`,"aria-expanded":t,"aria-label":tK.moreTabsLabel(o.length),onClick:()=>n(e=>!e),children:tK.moreTabs(o.length)}),t&&(0,j.jsx)(`ul`,{ref:i,role:`menu`,className:`sh-more-menu`,"aria-label":tK.moreTabsLabel(o.length),onKeyDown:e=>{let t=[...i.current?.querySelectorAll(`button`)??[]],n=t.indexOf(document.activeElement),r=sK(e.key,n,t.length);if(r!==void 0){if(r===`leave`)return s(!1);e.preventDefault(),r===`close`?s():t[r]?.focus()}},children:o.map(t=>{let{label:r,title:i}=VG(t);return(0,j.jsx)(`li`,{role:`none`,children:(0,j.jsx)(`button`,{type:`button`,role:`menuitem`,title:i,onClick:()=>{n(!1),e.onShow(t.key),requestAnimationFrame(()=>document.getElementById(rK(t.key))?.focus())},children:r})},t.key)})})]})}function lK({state:e,onShow:t,onClose:n,onMove:r,side:i,tools:a}){let o=(0,v.useRef)(null);(0,v.useEffect)(()=>aK(e.active),[e.active]);let[s,c]=(0,v.useState)({hidden:[],cut:[]}),l=e.tabs.map(e=>e.key).join(`
|
|
62
|
+
`);(0,v.useEffect)(()=>{let t=o.current;if(!t||typeof ResizeObserver>`u`)return;let n=()=>{let n=[...t.querySelectorAll(`[role=tab]`)].map((n,r)=>({key:e.tabs[r]?.key??``,left:n.offsetLeft-t.offsetLeft,width:n.offsetWidth})),r=n.find(e=>e.key===IG),i=oK(n,{scroll:t.scrollLeft,width:t.clientWidth},r?.width??0);c(e=>e.hidden.join()===i.hidden.join()&&e.cut.join()===i.cut.join()?e:i),[...i.hidden,...i.cut].includes(e.active)&&aK(e.active)};n();let r=new ResizeObserver(n);return r.observe(t),t.addEventListener(`scroll`,n,{passive:!0}),()=>{r.disconnect(),t.removeEventListener(`scroll`,n)}},[l,e.active]);let u=t=>{if(t!==e.active)return e.active;let n=e.tabs.findIndex(e=>e.key===t);return(e.tabs[n+1]??e.tabs[n-1])?.key},d=e=>{let t=u(e);n(e),iK(t)},f=e=>{e&&document.getElementById(rK(e))?.focus()},p=(t,i)=>{let a=e.tabs,o=a[i].key;if(t.ctrlKey&&t.shiftKey&&(t.key===`ArrowLeft`||t.key===`ArrowRight`)){t.preventDefault(),r(o,t.key===`ArrowLeft`?-1:1),requestAnimationFrame(()=>f(o));return}let s=t.key===`ArrowRight`?a[(i+1)%a.length]:t.key===`ArrowLeft`?a[(i-1+a.length)%a.length]:t.key===`Home`?a[0]:t.key===`End`?a.at(-1):void 0;if(s)t.preventDefault(),f(s.key);else if(t.key===`Delete`&&o!==`home`){t.preventDefault();let e=a[i+1]??a[i-1];n(o),requestAnimationFrame(()=>f(e?.key))}};return(0,j.jsxs)(`div`,{className:`sh-tabbar`,children:[i&&(0,j.jsxs)(`button`,{type:`button`,className:`sh-tool`,"aria-expanded":i.open,"aria-controls":`sh-side`,"aria-label":i.open?tK.sideHide:tK.sideShow,onClick:i.onToggle,children:[(0,j.jsx)(aW,{text:i.open?tK.sideHide:tK.sideShow}),(0,j.jsx)(rW,{})]}),(0,j.jsx)(`div`,{ref:o,role:`tablist`,"aria-label":tK.tabs,className:`sh-tabs`,children:e.tabs.map((n,r)=>{let{label:i,title:a}=VG(n),o=n.key===e.active,c=n.key!==IG;return(0,j.jsxs)(`button`,{id:rK(n.key),type:`button`,role:`tab`,className:`sh-tab${n.key===`home`?` sh-tab-home`:``}${s.cut.includes(n.key)?` sh-tab-cut`:``}`,"aria-selected":o,"aria-controls":o?nK:void 0,"aria-describedby":c?`sh-tab-hint`:void 0,"aria-keyshortcuts":c?`Delete`:void 0,tabIndex:o?0:-1,title:a,onClick:()=>t(n.key),onAuxClick:e=>{e.button===1&&c&&(e.preventDefault(),d(n.key))},onKeyDown:e=>p(e,r),children:[(0,j.jsx)(`span`,{className:`sh-tab-label`,children:i}),c&&(0,j.jsx)(`span`,{className:`sh-tab-x`,"aria-hidden":`true`,title:tK.closeTab(i),onClick:e=>{e.stopPropagation(),d(n.key)},children:`×`})]},n.key)})}),(0,j.jsx)(cK,{keys:[...s.hidden,...s.cut],state:e,onShow:t}),(0,j.jsx)(`span`,{id:`sh-tab-hint`,className:`sr`,children:tK.tabHint}),a&&(0,j.jsx)(`div`,{className:`sh-tabtools`,role:`group`,"aria-label":tK.tools,children:a})]})}var uK=w.ide,dK=()=>{dispatchEvent(new Event(PH))};function fK({root:e,right:t}){let n=iU(aU());return(0,j.jsxs)(`header`,{className:`sh-title`,children:[(0,j.jsxs)(`div`,{className:`sh-brand`,children:[(0,j.jsx)($H,{size:20}),(0,j.jsx)(`span`,{className:`sh-brand-name`,children:w.menu.atticus})]}),e&&(0,j.jsx)(`span`,{className:`sh-metarepo sh-mono`,title:e,children:uK.metarepo(NG(e))}),(0,j.jsx)(`div`,{className:`sh-search-wrap`,children:(0,j.jsxs)(`button`,{type:`button`,className:`sh-search`,"aria-keyshortcuts":n===w.menu.keysMac?`Meta+K`:`Control+K`,onClick:dK,children:[(0,j.jsx)(nW,{}),(0,j.jsx)(`span`,{className:`sh-search-text`,children:uK.search}),(0,j.jsx)(`kbd`,{"aria-hidden":`true`,children:n})]})}),(0,j.jsx)(`div`,{className:`sh-title-right`,children:t})]})}var pK=w.ide,mK=!1,hK=()=>{let e=mK;return mK=!1,e};function gK(e){location.hash!==e&&(mK=!0,location.hash=e)}function _K(e){let t=()=>typeof matchMedia==`function`?matchMedia(e):void 0,[n,r]=(0,v.useState)(()=>!!t()?.matches);return(0,v.useEffect)(()=>{let e=t();if(!e)return;let n=()=>r(e.matches);return n(),e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[e]),n}function vK(e){let[t,n]=(0,v.useState)(()=>QG(XG(),e));return(0,v.useEffect)(()=>n(t=>KG(t,e)),[e]),(0,v.useEffect)(()=>ZG(t),[t]),[t,n]}var yK=e=>`${BG(e)}|${JL(e).id}`;function bK(e,t,n){let r=(0,v.useRef)(new EW),i=(0,v.useRef)(new Set),a=(0,v.useRef)(yK(e));return(0,v.useEffect)(()=>{let e=t.current;if(!e)return;let n=t=>{let n=t.target;t.isTrusted&&n&&_W(n)&&i.current.add(vW(n,CW(e)))};return e.addEventListener(`input`,n,!0),e.addEventListener(`change`,n,!0),()=>{e.removeEventListener(`input`,n,!0),e.removeEventListener(`change`,n,!0)}},[t]),(0,v.useEffect)(()=>{let e=()=>{if(yK(location.hash)===a.current||!t.current)return;let e=yW(CW(t.current),i.current,n.current?.scrollTop??0,pW(hW(t.current)));r.current.leave(a.current,e),i.current=new Set};return addEventListener(`hashchange`,e),()=>removeEventListener(`hashchange`,e)},[t,n]),(0,v.useEffect)(()=>{let o=yK(e);if(o===a.current)return;a.current=o,r.current.shown();let s=r.current.take(o);if(!s||!t.current||!n.current)n.current&&(n.current.scrollTop=0);else return i.current=bW(s),wW(t.current,n.current,s)},[e,t,n]),(e,t)=>r.current.close(e,t)}function xK(e){return e.key!==`Escape`||e.defaultPrevented?!1:!e.target?.closest?.(`[role=dialog], [role=alertdialog]`)}function SK({hash:e,label:t}){let n=fG().includes(iG(e)),r=w.explorer.pinHere(t);return(0,j.jsxs)(`button`,{type:`button`,className:`sh-tool`,"aria-pressed":n,"aria-label":r,onClick:()=>uG(e),children:[(0,j.jsx)(aW,{text:r}),(0,j.jsx)(iW,{filled:n})]})}function CK(e){return TK(Qj(pj,e,hj),Qj(mj,e,gj),Qj(wK,e,OW))}var wK=DW;function TK(e,t,n){let r=bj(e,t),i=AW(n);return{...r?{questions:r.total}:{},...i===void 0?{}:{repos:i}}}function EK(e){let[t,n]=(0,v.useState)(()=>bz()),[r,i]=(0,v.useState)(!1),a=e=>{n(e),xz(e)};(0,v.useEffect)(()=>{e||i(!1)},[e]);let o=e?r:!t.hidden;return{width:t.width,open:o,overlay:e&&r,toggle:()=>e?i(!r):a({...t,hidden:!t.hidden}),close:()=>i(!1),resize:e=>a({...t,width:yz(e)}),setWidth:e=>n({...t,width:yz(e)})}}function DK({width:e,onResize:t,onLive:n}){return(0,j.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":pK.resize,"aria-controls":`sh-side`,"aria-valuemin":180,"aria-valuemax":480,"aria-valuenow":e,tabIndex:0,className:`sh-resizer`,onKeyDown:n=>{let r=n.key===`ArrowLeft`?-16:n.key===`ArrowRight`?16:void 0;r===void 0?(n.key===`Home`||n.key===`End`)&&(n.preventDefault(),t(n.key===`Home`?180:480)):(n.preventDefault(),t(e+r))},onPointerDown:r=>{if(r.button!==0)return;r.preventDefault();let i=r.clientX,a=e,o=r.currentTarget;try{o.setPointerCapture(r.pointerId)}catch{}let s=a,c=!1,l=e=>{s=yz(a+e.clientX-i),n(s)},u=()=>{c||(c=!0,o.removeEventListener(`pointermove`,l),o.removeEventListener(`pointerup`,u),o.removeEventListener(`pointercancel`,u),o.removeEventListener(`lostpointercapture`,u),t(s))};o.addEventListener(`pointermove`,l),o.addEventListener(`pointerup`,u),o.addEventListener(`pointercancel`,u),o.addEventListener(`lostpointercapture`,u)}})}function OK({hash:e,current:t,health:n,embedded:r,heading:i,top:a,children:o}){let[s,c]=vK(e),l=EK(_K(`(max-width: 999px)`)),[u,d]=(0,v.useState)(()=>Sz()??!1),f=(0,v.useRef)(null),p=(0,v.useRef)(null),m=(0,v.useRef)(null),h=bK(e,f,p),g=CK(!r),_=sn(),{me:y}=Zr(),b=(_?.entries??[]).filter(e=>e.state===`running`),x=b[0],S=Ej(),C={...n?PG(n,y??void 0):{},...S?{role:w.roles.names[S]??S}:{},...g,...x?{running:{id:x.id,title:dn(x),...x.progress&&x.progress.total>1?{done:x.progress.done,total:x.progress.total}:{},more:b.length-1}}:{}},T=s.active,E=(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:XH,title:w.shell.replayTheTour,children:w.shell.help}),D=(0,j.jsx)(`a`,{className:`btn`,href:`#/words`,title:w.glossary.linkTitle,children:w.glossary.link}),ee=(e=`button`)=>{l.close(),e===`page`?document.getElementById(`main`)?.focus({preventScroll:!0}):m.current?.querySelector(`[aria-controls='sh-side']`)?.focus()},te=l.overlay;return(0,v.useEffect)(()=>{if(!te)return;document.getElementById(`sh-side`)?.querySelector(`a[href], button, input, [tabindex='0']`)?.focus();let e=e=>{xK(e)&&!document.querySelector(`[role=dialog]`)&&(e.preventDefault(),ee())},t=()=>{document.getElementById(`sh-side`)?.contains(document.activeElement)?ee(`page`):l.close()};return addEventListener(`keydown`,e),addEventListener(`hashchange`,t),()=>{removeEventListener(`keydown`,e),removeEventListener(`hashchange`,t)}},[te]),(0,j.jsxs)(`div`,{className:`sh${r?` sh-embedded`:``}${l.open?` sh-side-open`:``}${l.overlay?` sh-overlay`:``}`,style:{"--sh-side":`${l.width}px`},children:[!r&&(0,j.jsx)(fK,{...n?{root:n.root}:{},right:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(OH,{}),(0,j.jsx)(AH,{}),E,D,n&&(0,j.jsx)(kH,{health:n,version:!1})]})}),(0,j.jsxs)(`div`,{className:`sh-body`,children:[!r&&(0,j.jsx)(lW,{current:t,hash:e,badges:g}),(0,j.jsx)(`aside`,{id:`sh-side`,className:`sh-side`,"aria-label":w.explorer.label,hidden:!l.open,children:l.open&&(0,j.jsx)(jG,{current:e,onOpen:e=>{let t=l.overlay;location.hash!==e&&(location.hash=e),t&&ee(`page`)}})}),l.open&&!l.overlay&&(0,j.jsx)(DK,{width:l.width,onResize:l.resize,onLive:l.setWidth}),l.overlay&&(0,j.jsx)(`div`,{className:`sh-scrim`,"aria-hidden":`true`,onClick:()=>ee()}),(0,j.jsxs)(`div`,{className:`sh-column`,children:[(0,j.jsx)(`div`,{ref:m,children:(0,j.jsx)(lK,{state:s,onShow:e=>{let t=s.tabs.find(t=>t.key===e);t&&gK(t.hash)},onClose:e=>{h(e,e===s.active);let t=qG(s,e);c(t.state),t.go&&gK(t.go)},onMove:(e,t)=>c(JG(s,e,t)),side:{open:l.open,onToggle:l.toggle},tools:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(SK,{hash:e,label:t.label}),r&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`button`,{type:`button`,className:`sh-tool`,"aria-label":pK.search,onClick:dK,children:[(0,j.jsx)(aW,{text:pK.search}),(0,j.jsx)(nW,{size:16})]}),(0,j.jsx)(cW,{current:t,hash:e,className:`sh-tool`}),(0,j.jsx)(OH,{}),E,D,n&&(0,j.jsx)(kH,{health:n,version:!1})]})]})})}),(0,j.jsx)(`main`,{id:`main`,ref:p,className:`sh-main`,tabIndex:-1,children:(0,j.jsxs)(`div`,{ref:f,id:nK,role:`tabpanel`,"aria-labelledby":rK(T),className:`sh-page`,children:[(0,j.jsx)(`h1`,{className:`sr`,children:i}),a,o]})}),(0,j.jsx)(XU,{open:u,onToggle:()=>{d(!u),Cz(!u)}})]})]}),!r&&(0,j.jsx)(FG,{facts:C,onShowRunning:e=>_?.show(e)})]})}var kK=w.shell;function AK(e){let[t,n]=(0,v.useState)(()=>{let t=location.hash,n=e?eK(t):t;return n!==t&&history.replaceState(history.state,``,n),n});return(0,v.useEffect)(()=>{let e=()=>n(location.hash);return addEventListener(`hashchange`,e),()=>removeEventListener(`hashchange`,e)},[]),t}function jK({health:e}){let t=MH(),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(!1);return(0,j.jsxs)(`header`,{className:`topbar`,children:[(0,j.jsxs)(`form`,{role:`search`,className:`ask-form`,onSubmit:e=>{e.preventDefault(),n.trim()?location.hash=`#/explore?ask=${encodeURIComponent(n.trim())}`:(a(!0),document.getElementById(`ask`)?.focus())},children:[(0,j.jsx)(`label`,{htmlFor:`ask`,className:`sr`,children:kK.askAtticus}),(0,j.jsx)(`input`,{id:`ask`,value:n,onChange:e=>{r(e.target.value),a(!1)},"aria-describedby":i?`ask-blank`:void 0,placeholder:t}),(0,j.jsx)(`button`,{type:`submit`,className:`btn`,"aria-label":kK.ask,children:kK.ask}),(0,j.jsx)(`span`,{id:`ask-blank`,role:`status`,className:i?`chip warn`:`sr`,children:i?w.app.askEmpty:``})]}),(0,j.jsx)(OH,{}),!A()&&!oM()&&(0,j.jsx)(AH,{}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:XH,title:kK.replayTheTour,children:kK.help}),(0,j.jsx)(`a`,{className:`btn`,href:`#/words`,title:w.glossary.linkTitle,children:w.glossary.link}),e&&(0,j.jsx)(kH,{health:e})]})}function MK(){let[e,t]=(0,v.useState)({down:!1,epoch:0});return(0,v.useEffect)(()=>{let e=e=>{let n=e.detail.up;t(e=>n?{down:!1,epoch:e.epoch+1}:{...e,down:!0})};return addEventListener(je,e),()=>removeEventListener(je,e)},[]),e}function NK(){let[e,t]=(0,v.useState)(he);return(0,v.useEffect)(()=>Se(e=>t(e===`stale`)),[]),e}function PK({down:e,stale:t,inPanel:n,moved:r=!1}){return e?(0,j.jsx)(FK,{inPanel:n}):t?(0,j.jsxs)(`div`,{className:`state error`,role:`alert`,style:{marginBottom:12},children:[(0,j.jsx)(`p`,{style:{margin:0},children:r?w.app.otherMetarepo:w.app.restarted}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,style:{marginTop:8},onClick:()=>location.reload(),children:w.app.reload})]}):null}function FK({inPanel:e}){let[t,n]=(0,v.useState)(!1);return(0,j.jsxs)(`div`,{className:`state error`,role:`alert`,style:{marginBottom:12},children:[(0,j.jsx)(`p`,{style:{margin:0},children:e?w.app.offlinePanel:w.app.offline}),(0,j.jsx)(`button`,{type:`button`,className:`btn`,style:{marginTop:8},disabled:t,onClick:()=>{n(!0),N(`/api/health`).catch(()=>void 0).finally(()=>n(!1))},children:t?w.app.checking:w.app.tryAgain})]})}function IK({current:e,hash:t,epoch:n,tab:r=``}){let i=gH[e.id];return i?(0,j.jsx)(TH,{name:e.label,children:(0,j.jsx)(i,{hash:t})},`${r}:${e.id}:${n}`):(0,j.jsx)(vH,{screen:e})}function LK(e){return e.state===`ready`?e.data.root:void 0}function RK(e){let t=w.palette.sync;return{label:t.label,detail:t.detail,also:t.also,run:()=>{N(`/api/workspace/sync`,{method:`POST`,body:{}}).then(()=>{se({text:t.started}),e===`ide`&&TU(`console`)},e=>se({text:t.failed(e instanceof Error?e.message:String(e))}))}}}function zK(e,t,n){return[...BK(e,t),...e===`ide`?VK():[],...n?[RK(e)]:[]]}function BK(e,t){let n=w.ide.layout;return e===`ide`?[{label:n.toClassic,detail:n.commandDetail,run:()=>t(`classic`),also:[n.title]}]:[{label:n.toIde,detail:n.commandDetail,run:()=>t(`ide`),also:[n.title]}]}function VK(){let e=w.ide.panelCommands;return[`console`,`questions`,`problems`,`runs`].map(t=>({label:e[t],detail:e.detail,run:()=>TU(t),also:e.also[t]}))}function HK({commands:e}){let t=MH();return(0,j.jsx)(VH,{commands:e,placeholder:t})}function UK(){let[e,t]=_z(),n=AK(e===`ide`),r=JL(n),i=P(`/api/health`),a=i.state===`ready`&&i.data.full===!0,o=MK(),s=NK(),c=(0,j.jsx)(PK,{down:o.down,stale:s,moved:s&&ve(),inPanel:!!A()}),l=i.state===`ready`&&i.data.metarepo===!1,u=i.state===`ready`&&i.data.metarepo!==!1,d=(0,v.useMemo)(()=>zK(e,t,u),[e,t,u]),f=i.reload;(0,v.useEffect)(()=>{o.epoch&&f()},[o.epoch,f]),(0,v.useEffect)(()=>{document.title=`${r.label} · Atticus`},[r]);let p=(0,v.useRef)(void 0);(0,v.useEffect)(()=>{let e=hK();p.current!==void 0&&p.current!==r.id&&!e&&document.getElementById(`main`)?.focus({preventScroll:!0}),p.current=r.id},[r.id,n]);let m=(0,v.useRef)(e);(0,v.useEffect)(()=>{m.current!==e&&(m.current=e,vz(document))},[e]);let h=!l&&(0,j.jsx)(ZH,{metarepo:LK(i)}),g=(0,j.jsx)(`a`,{className:`skip`,href:`#main`,onClick:e=>{e.preventDefault(),document.getElementById(`main`)?.focus()},children:kK.skipToContent}),_=l?(0,j.jsx)(CH,{onCreated:()=>{location.hash=`#/home`,f()}}):(0,j.jsx)(IK,{current:r,hash:n,epoch:o.epoch,...e===`ide`?{tab:BG(n)}:{}});return(0,j.jsx)(Xr,{children:(0,j.jsx)(qt,{children:(0,j.jsx)(Sn,{children:(0,j.jsx)(Di,{children:e===`classic`?(0,j.jsxs)(`div`,{className:`shell`,children:[(0,j.jsx)(Ct,{}),g,(0,j.jsx)(uU,{current:r,hash:n,full:a}),(0,j.jsx)(VH,{commands:d}),h,(0,j.jsxs)(`main`,{id:`main`,className:`main`,tabIndex:-1,children:[c,(0,j.jsx)(ce,{}),(0,j.jsx)(jK,{health:i.state===`ready`?i.data:void 0}),(0,j.jsx)(wn,{}),(0,j.jsx)(`h1`,{className:`sr`,children:l?w.setup.title:r.label}),!l&&(0,j.jsx)(fU,{current:r,hash:n,full:a}),_]}),(0,j.jsx)(kn,{})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(Ct,{}),g,(0,j.jsx)(HK,{commands:d}),h,(0,j.jsx)(OK,{hash:n,current:r,...i.state===`ready`?{health:i.data}:{},embedded:bU(),heading:l?w.setup.title:r.label,top:(0,j.jsxs)(j.Fragment,{children:[c,(0,j.jsx)(ce,{}),(0,j.jsx)(wn,{}),!l&&(0,j.jsx)(fU,{current:r,hash:n,full:a})]}),children:_})]})})})})})}A()||uM(),(0,y.createRoot)(document.getElementById(`root`)).render((0,j.jsx)(v.StrictMode,{children:(0,j.jsx)(EH,{children:(0,j.jsx)(UK,{})})}));export{l as n,o as t};
|
|
63
|
+
//# sourceMappingURL=index-B1Jr0xH8.js.map
|