graview 0.1.60 → 0.1.62

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. package/dist/index.d.ts.map +1 -1
  2. package/dist/index.js +5 -1
  3. package/dist/index.js.map +1 -1
  4. package/dist/preview/{chunk.QDSEVPF3.js → chunk.22BZU7ME.js} +1 -1
  5. package/dist/preview/chunk.2AT3GRXM.js +1 -0
  6. package/dist/preview/chunk.2B6P4GPS.js +1 -0
  7. package/dist/preview/chunk.2GEJNG2U.js +1 -0
  8. package/dist/preview/{chunk.7N32AVIJ.js → chunk.2N4Z5K5S.js} +1 -1
  9. package/dist/preview/{chunk.NHUQ2N6J.js → chunk.3FON2Y72.js} +1 -1
  10. package/dist/preview/chunk.3L37FY3G.js +4 -0
  11. package/dist/preview/{chunk.ZYM2SSGW.js → chunk.4HEFUOLV.js} +1 -1
  12. package/dist/preview/chunk.4HRYB7HF.js +1 -0
  13. package/dist/preview/{chunk.YZ7FUKAL.js → chunk.4TX6VCBT.js} +1 -1
  14. package/dist/preview/{chunk.IGJZ4UH3.js → chunk.5HGD6OWL.js} +2 -2
  15. package/dist/preview/{chunk.2USDHXB4.js → chunk.5J3O2FVG.js} +1 -1
  16. package/dist/preview/{chunk.H45Q3O4F.js → chunk.5MZYCELA.js} +1 -1
  17. package/dist/preview/{chunk.SRVQJZRT.js → chunk.5ODHHH35.js} +1 -1
  18. package/dist/preview/{chunk.HDUO2USQ.js → chunk.5STU3KYG.js} +1 -1
  19. package/dist/preview/{chunk.TFWIG6LL.js → chunk.5YAOKOGV.js} +1 -1
  20. package/dist/preview/{chunk.BQIHNT7C.js → chunk.66P5IDTH.js} +1 -1
  21. package/dist/preview/{chunk.M4UD4ARP.js → chunk.6AKW7TXM.js} +1 -1
  22. package/dist/preview/{chunk.URWAFZHF.js → chunk.6JO5HQDR.js} +1 -1
  23. package/dist/preview/{chunk.HUJ6YTWE.js → chunk.75GVFX7L.js} +1 -1
  24. package/dist/preview/{chunk.A3ZXDG6V.js → chunk.7KVUUEZA.js} +1 -1
  25. package/dist/preview/{chunk.FFTYMBBT.js → chunk.7M4HNKDR.js} +1 -1
  26. package/dist/preview/chunk.7OBIBPYH.js +1 -0
  27. package/dist/preview/chunk.7V56P2A7.js +1 -0
  28. package/dist/preview/chunk.7XLS6XTY.js +1 -0
  29. package/dist/preview/chunk.7YOAW7ED.js +1 -0
  30. package/dist/preview/{chunk.FBJARKDT.js → chunk.A3OL2BI2.js} +1 -1
  31. package/dist/preview/{chunk.NGTRL5U4.js → chunk.A3ZC2JBO.js} +1 -1
  32. package/dist/preview/{chunk.A5PDXNY6.js → chunk.ACTXR2MI.js} +1 -1
  33. package/dist/preview/chunk.AFNSAQEQ.js +1 -0
  34. package/dist/preview/chunk.AI34V6WV.js +74 -0
  35. package/dist/preview/{chunk.3XGA65Y3.js → chunk.AJSUHPBE.js} +1 -1
  36. package/dist/preview/chunk.AQRB7LDA.js +1 -0
  37. package/dist/preview/{chunk.GNBIVVL3.js → chunk.B23WZQXQ.js} +1 -1
  38. package/dist/preview/chunk.BIDL7GQD.js +0 -0
  39. package/dist/preview/chunk.BLUKSGI4.js +1 -0
  40. package/dist/preview/chunk.BZMQDEIY.js +1 -0
  41. package/dist/preview/chunk.CAKFNKN5.js +1 -0
  42. package/dist/preview/chunk.CGALLZ54.js +1 -0
  43. package/dist/preview/{chunk.LSY256J4.js → chunk.CHHYIMB7.js} +1 -1
  44. package/dist/preview/chunk.CXDGE5ZS.js +1 -0
  45. package/dist/preview/{chunk.CC5BJH5A.js → chunk.CY3ELWCM.js} +1 -1
  46. package/dist/preview/chunk.DC35FJAB.js +1 -0
  47. package/dist/preview/{chunk.AVBTPSQF.js → chunk.DD2NKFDX.js} +1 -1
  48. package/dist/preview/{chunk.6HF6POIX.js → chunk.DDO3GLEJ.js} +1 -1
  49. package/dist/preview/{chunk.TLJOZSDD.js → chunk.DDUCIUVW.js} +1 -1
  50. package/dist/preview/chunk.DEAP3H2L.js +1 -0
  51. package/dist/preview/chunk.DHJ3FQTR.js +1 -0
  52. package/dist/preview/{chunk.P6RORYOT.js → chunk.DNVWSWL2.js} +1 -1
  53. package/dist/preview/chunk.DPEIT3TW.js +1 -0
  54. package/dist/preview/chunk.DVSTLVIH.js +15 -0
  55. package/dist/preview/chunk.DZZL5IDD.js +5 -0
  56. package/dist/preview/{chunk.IGVASEZU.js → chunk.ELOFPE25.js} +1 -1
  57. package/dist/preview/{chunk.MVWC3VR3.js → chunk.ELTV44HU.js} +2 -2
  58. package/dist/preview/chunk.EVBCEEQ4.js +1 -0
  59. package/dist/preview/{chunk.TKVLNBRD.js → chunk.F7YXLYLX.js} +1 -1
  60. package/dist/preview/{chunk.DCHQHKSA.js → chunk.FULEUL34.js} +1 -1
  61. package/dist/preview/{chunk.VNDKKTED.js → chunk.G4ULQK64.js} +14 -14
  62. package/dist/preview/{chunk.Y7G3OGDE.js → chunk.GX4G4BX3.js} +1 -1
  63. package/dist/preview/chunk.H24OC6OE.js +1 -0
  64. package/dist/preview/chunk.H5S7OL2U.js +1 -0
  65. package/dist/preview/chunk.H73ZPYUX.js +1 -0
  66. package/dist/preview/{chunk.GTKJJYQH.js → chunk.H7N7WN4U.js} +1 -1
  67. package/dist/preview/chunk.HANJZ6FA.js +1 -0
  68. package/dist/preview/chunk.HIMQ65QT.js +1 -0
  69. package/dist/preview/chunk.I77ZGIFE.js +1 -0
  70. package/dist/preview/{chunk.MJVYWLQQ.js → chunk.ILIIBSGA.js} +1 -1
  71. package/dist/preview/chunk.IQ3PRWGO.js +104 -0
  72. package/dist/preview/{chunk.NC7FXY2H.js → chunk.IQMD7DG3.js} +1 -1
  73. package/dist/preview/chunk.IQPILSV3.js +18 -0
  74. package/dist/preview/chunk.IYBEXENQ.js +1 -0
  75. package/dist/preview/{chunk.ULL6ZIJJ.js → chunk.J7Q2WAF4.js} +1 -1
  76. package/dist/preview/{chunk.TLWT67ON.js → chunk.JT3MFPRD.js} +1 -1
  77. package/dist/preview/chunk.JYFZCJ4N.js +2 -0
  78. package/dist/preview/chunk.K2HDEL7I.js +1 -0
  79. package/dist/preview/chunk.KDXU5DT3.js +1 -0
  80. package/dist/preview/chunk.KL7E4YHJ.js +1 -0
  81. package/dist/preview/{chunk.FRYBMS3W.js → chunk.KMV6PJFL.js} +1 -1
  82. package/dist/preview/{chunk.RXYNW5QB.js → chunk.L3WTKQQL.js} +1 -1
  83. package/dist/preview/chunk.LAYQ5PFS.js +1 -0
  84. package/dist/preview/{chunk.KBVTLNS5.js → chunk.LGRLVJGS.js} +3 -3
  85. package/dist/preview/chunk.LTZUF5VG.js +1 -0
  86. package/dist/preview/{chunk.OLFJH4RK.js → chunk.M4AYA2PL.js} +1 -1
  87. package/dist/preview/chunk.M7RESZB6.js +25 -0
  88. package/dist/preview/{chunk.WXUFATY5.js → chunk.MAKODQO3.js} +1 -1
  89. package/dist/preview/{chunk.F6V7RWDK.js → chunk.MDEX6ZVE.js} +1 -1
  90. package/dist/preview/chunk.MGALQLRW.js +1 -0
  91. package/dist/preview/{chunk.7OPM55I2.js → chunk.MYNMBOLD.js} +1 -1
  92. package/dist/preview/chunk.N6EJXXQK.js +2 -0
  93. package/dist/preview/chunk.NAD7ZXYP.js +1 -0
  94. package/dist/preview/chunk.NHTGAP3G.js +3 -0
  95. package/dist/preview/{chunk.5IEFTFKQ.js → chunk.NJSK3UO2.js} +1 -1
  96. package/dist/preview/{chunk.VFOON3Z3.js → chunk.NOGGSLVG.js} +1 -1
  97. package/dist/preview/chunk.NUWDMH47.js +1 -0
  98. package/dist/preview/chunk.NUYA4BWI.js +1 -0
  99. package/dist/preview/{chunk.VUBNBTJP.js → chunk.O2BHPYA4.js} +2 -2
  100. package/dist/preview/chunk.O75HWF3F.js +1 -0
  101. package/dist/preview/chunk.OFWNMTGB.js +21 -0
  102. package/dist/preview/chunk.OKZT2QBM.js +2 -0
  103. package/dist/preview/{chunk.EL5ICOOM.js → chunk.OUDATENL.js} +1 -1
  104. package/dist/preview/chunk.OUPURRDE.js +1 -0
  105. package/dist/preview/{chunk.Y5C4RXG7.js → chunk.OWOOKLIU.js} +2 -1
  106. package/dist/preview/{chunk.PI44XMY2.js → chunk.OWT3VVOT.js} +1 -1
  107. package/dist/preview/{chunk.VDMDPZ6U.js → chunk.PCDUV3WP.js} +1 -1
  108. package/dist/preview/chunk.PD2DECOP.js +1 -0
  109. package/dist/preview/{chunk.ZXOT3IXJ.js → chunk.PKWQKFPE.js} +1 -1
  110. package/dist/preview/{chunk.ENL2JJ47.js → chunk.PLTH2LW5.js} +1 -1
  111. package/dist/preview/{chunk.ZP5RT2EK.js → chunk.PZQNR4KZ.js} +1 -1
  112. package/dist/preview/chunk.Q5WEOX3Q.js +1 -0
  113. package/dist/preview/chunk.QDWSU47A.js +1 -0
  114. package/dist/preview/{chunk.VADQ7ZGA.js → chunk.QGU5QTR6.js} +1 -1
  115. package/dist/preview/chunk.QHY5NVYH.js +1 -0
  116. package/dist/preview/{chunk.6ZQAR5ZA.js → chunk.QIPASE42.js} +1 -1
  117. package/dist/preview/{chunk.7MHCGVGM.js → chunk.RD2X25XB.js} +1 -1
  118. package/dist/preview/chunk.RMR24LFJ.js +4 -0
  119. package/dist/preview/chunk.ROZTJ6IY.js +6 -0
  120. package/dist/preview/{chunk.RQOX5YDW.js → chunk.RPDH32XV.js} +1 -1
  121. package/dist/preview/chunk.RRKI24WY.js +1 -0
  122. package/dist/preview/{chunk.HDP3PS7N.js → chunk.RYRQ66JN.js} +1 -1
  123. package/dist/preview/chunk.SEHRPTNA.js +7 -0
  124. package/dist/preview/chunk.SGCW2XRC.js +1 -0
  125. package/dist/preview/{chunk.JPONLMU7.js → chunk.SS7234R6.js} +1 -1
  126. package/dist/preview/{chunk.BXDM3UMN.js → chunk.SVPKUWZU.js} +1 -1
  127. package/dist/preview/{chunk.LQVAABPS.js → chunk.SWMDFXUX.js} +1 -1
  128. package/dist/preview/{chunk.6WHAWOO7.js → chunk.T3UQ7ZQK.js} +1 -1
  129. package/dist/preview/chunk.T6PU3NKP.js +1 -0
  130. package/dist/preview/{chunk.6C2MHWSX.js → chunk.T6WHGKWR.js} +1 -1
  131. package/dist/preview/{chunk.QBLKTFF4.js → chunk.THVC2BEC.js} +1 -1
  132. package/dist/preview/{chunk.KDRLUBVF.js → chunk.TIALD6SC.js} +1 -1
  133. package/dist/preview/{chunk.Z2ERZ4S6.js → chunk.TM4EPUNO.js} +1 -1
  134. package/dist/preview/chunk.U5P23GO7.js +1 -0
  135. package/dist/preview/chunk.U6ZRJKVM.js +1 -0
  136. package/dist/preview/chunk.UFDJXQQQ.js +32 -0
  137. package/dist/preview/{chunk.IOK4GVJC.js → chunk.UKQUUPKE.js} +1 -1
  138. package/dist/preview/{chunk.TAT2IQUR.js → chunk.UQQKDBIH.js} +1 -1
  139. package/dist/preview/{chunk.QHDCTAD7.js → chunk.UVA7AALY.js} +1 -1
  140. package/dist/preview/chunk.UXMPFPFH.js +20 -0
  141. package/dist/preview/chunk.VACKSKGJ.js +1 -0
  142. package/dist/preview/{chunk.3UOKUF5Z.js → chunk.VC3V7HLL.js} +1 -1
  143. package/dist/preview/chunk.VIH5AX7S.js +5 -0
  144. package/dist/preview/{chunk.4LR64TPU.js → chunk.VJBBVLGZ.js} +1 -1
  145. package/dist/preview/chunk.VN23AGIY.js +1 -0
  146. package/dist/preview/{chunk.VZJWJ5XM.js → chunk.W4BKYSZX.js} +1 -1
  147. package/dist/preview/{chunk.CQT3W2SF.js → chunk.WEOVK2T4.js} +1 -1
  148. package/dist/preview/chunk.WKI5INH7.js +1 -0
  149. package/dist/preview/chunk.WPXPVD33.js +88 -0
  150. package/dist/preview/chunk.X6KYRBL6.js +1 -0
  151. package/dist/preview/chunk.Y2YYH3JN.js +1 -0
  152. package/dist/preview/chunk.Y4FZKUOK.js +1 -0
  153. package/dist/preview/chunk.Y4S7CDRB.js +1 -0
  154. package/dist/preview/{chunk.YFSBVZTG.js → chunk.YP2QSPXU.js} +1 -1
  155. package/dist/preview/{chunk.VWJGQDCE.js → chunk.Z2TDZSMN.js} +1 -1
  156. package/dist/preview/chunk.ZN3PUM2I.js +1 -0
  157. package/dist/preview/index.html +53 -51
  158. package/dist/preview/page.js +2 -2
  159. package/dist/preview/splash.js +57 -0
  160. package/package.json +6 -6
  161. package/dist/preview/chunk.2K4TT2BV.js +0 -1
  162. package/dist/preview/chunk.37TVS7CA.js +0 -1
  163. package/dist/preview/chunk.3IZ3ABII.js +0 -1
  164. package/dist/preview/chunk.3MOJF7BA.js +0 -1
  165. package/dist/preview/chunk.3V4WP7RY.js +0 -18
  166. package/dist/preview/chunk.3ZT5WQYL.js +0 -1
  167. package/dist/preview/chunk.4MP72LPR.js +0 -25
  168. package/dist/preview/chunk.4TCKEG6I.js +0 -1
  169. package/dist/preview/chunk.5DD62IOW.js +0 -21
  170. package/dist/preview/chunk.5YOLUDVO.js +0 -1
  171. package/dist/preview/chunk.644FUGSX.js +0 -1
  172. package/dist/preview/chunk.67U6M7OV.js +0 -1
  173. package/dist/preview/chunk.7TFLRR7D.js +0 -1
  174. package/dist/preview/chunk.7VKSXGTX.js +0 -1
  175. package/dist/preview/chunk.BF6S5UE4.js +0 -1
  176. package/dist/preview/chunk.BLPYNNR4.js +0 -1
  177. package/dist/preview/chunk.BRT27WON.js +0 -1
  178. package/dist/preview/chunk.BYKD5RLA.js +0 -1
  179. package/dist/preview/chunk.C7OLSEWK.js +0 -1
  180. package/dist/preview/chunk.CFKZXLXS.js +0 -1
  181. package/dist/preview/chunk.CMN6BBAD.js +0 -1
  182. package/dist/preview/chunk.D7YSL3NK.js +0 -2
  183. package/dist/preview/chunk.EQXB7LKI.js +0 -1
  184. package/dist/preview/chunk.ERFT54HT.js +0 -1
  185. package/dist/preview/chunk.FLUK3UXF.js +0 -1
  186. package/dist/preview/chunk.G3R4BTI7.js +0 -1
  187. package/dist/preview/chunk.G4YJPKRG.js +0 -5
  188. package/dist/preview/chunk.GLWSVSQL.js +0 -1
  189. package/dist/preview/chunk.I4XQBQRC.js +0 -1
  190. package/dist/preview/chunk.IBOKXVWN.js +0 -1
  191. package/dist/preview/chunk.IHBUBZQT.js +0 -2
  192. package/dist/preview/chunk.JEYQBH33.js +0 -32
  193. package/dist/preview/chunk.JJGCTGWA.js +0 -1
  194. package/dist/preview/chunk.KGW75Z5L.js +0 -3
  195. package/dist/preview/chunk.KI37ZEV3.js +0 -1
  196. package/dist/preview/chunk.KNYLY7MH.js +0 -1
  197. package/dist/preview/chunk.L6AWE76F.js +0 -1
  198. package/dist/preview/chunk.LGEA5257.js +0 -6
  199. package/dist/preview/chunk.LLYRFVIN.js +0 -104
  200. package/dist/preview/chunk.LZIBQ3VX.js +0 -1
  201. package/dist/preview/chunk.MDJWK5W2.js +0 -1
  202. package/dist/preview/chunk.MSWWWLEA.js +0 -1
  203. package/dist/preview/chunk.PFSYXD6Q.js +0 -1
  204. package/dist/preview/chunk.PHC2MI4C.js +0 -1
  205. package/dist/preview/chunk.PHJ6WPWH.js +0 -1
  206. package/dist/preview/chunk.PNW5K7BW.js +0 -1
  207. package/dist/preview/chunk.PXQVXBNG.js +0 -1
  208. package/dist/preview/chunk.QFUMFQJU.js +0 -1
  209. package/dist/preview/chunk.QI4SLPQ4.js +0 -4
  210. package/dist/preview/chunk.QUJS63OJ.js +0 -13
  211. package/dist/preview/chunk.SB2PZKN5.js +0 -88
  212. package/dist/preview/chunk.T7LQD67N.js +0 -20
  213. package/dist/preview/chunk.TY4GQJKC.js +0 -1
  214. package/dist/preview/chunk.UDCDK7XJ.js +0 -4
  215. package/dist/preview/chunk.UITT6JWW.js +0 -2
  216. package/dist/preview/chunk.UJTE7UAP.js +0 -1
  217. package/dist/preview/chunk.UQWTZJBV.js +0 -1
  218. package/dist/preview/chunk.VMV464JK.js +0 -1
  219. package/dist/preview/chunk.VSCIXAHN.js +0 -5
  220. package/dist/preview/chunk.W3W54DSX.js +0 -1
  221. package/dist/preview/chunk.WC3DENU4.js +0 -67
  222. package/dist/preview/chunk.WQ6RCEUQ.js +0 -1
  223. package/dist/preview/chunk.X6A4VSSD.js +0 -1
  224. package/dist/preview/chunk.XGASJAV2.js +0 -7
  225. package/dist/preview/chunk.XR6YR6RV.js +0 -1
  226. package/dist/preview/chunk.XZPKBHJT.js +0 -1
  227. package/dist/preview/chunk.YEBGI6ED.js +0 -1
  228. package/dist/preview/chunk.YH63KQ2G.js +0 -1
@@ -1,18 +0,0 @@
1
- var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as Le}from"./chunk.LLYRFVIN.js";import{A as an,B as Te,C as vo,D as at,E as ye,F as Qn,G as Ve,H as ze,I as ko,J as Zn,K as Ee,L as xo,M as Po,N as H,O as wt,P as Rt,Q as Ao,R as Lt,S as rn,T as Co,U as ie,V as Je,W as se,X as Xn,a as j,b as xe,c as X,d as nn,e as zn,f as Jn,g as yt,h as ne,i as be,j as le,k as C,l as de,m as _,n as We,o as ve,p as ht,q as fe,r as ge,s as wo,t as Pt,u as So,v as At,w as Ct,x as z,y as Ge,z as bo}from"./chunk.YFSBVZTG.js";import{b as _n,c as yo,d as ho,e as qe,f as Yn,h as ae}from"./chunk.G4YJPKRG.js";import{a as io,c as so,f as lo,g as co,i as po,j as uo}from"./chunk.3UOKUF5Z.js";import{a as go,d as mo,e as fo}from"./chunk.Q355UPFG.js";import{a as en,b as tn}from"./chunk.PXQVXBNG.js";import{a as Yr,b as Qr,c as Zr,d as Un}from"./chunk.MVWC3VR3.js";import{b as Jr}from"./chunk.CC5BJH5A.js";import{a as Xr,b as eo,d as Zt,e as to,f as no,g as ao,j as Xt}from"./chunk.CFKZXLXS.js";import{m as zr}from"./chunk.LQVAABPS.js";import{a as $r,b as Hr,c as Fr,e as jr,f as jn,h as Jt}from"./chunk.3MOJF7BA.js";import{d as Ir,e as Dr,f as Wr,g as Gr,o as _t,p as qr,r as Vr,t as zt}from"./chunk.LZIBQ3VX.js";import{a as qt,b as cr,c as pr,d as Vt,e as ur}from"./chunk.YZ7FUKAL.js";import{b as wr,c as Er,e as Mr,f as Kn}from"./chunk.KDRLUBVF.js";import{a as Bn,b as Tr}from"./chunk.BQIHNT7C.js";import{a as Yt,b as Qt,c as Ur,e as _r}from"./chunk.BYKD5RLA.js";import{a as ft,b as Rr,e as Lr}from"./chunk.2K4TT2BV.js";import{a as Nr}from"./chunk.BJUUSIQY.js";import{a as qn}from"./chunk.ZP5RT2EK.js";import{a as Gn,b as yr,c as hr}from"./chunk.VZJWJ5XM.js";import{a as Or}from"./chunk.GLWSVSQL.js";import{c as br,d as vr,e as kr,f as xr,j as Pr,l as nt,n as Ar}from"./chunk.7VKSXGTX.js";import{a as Sr}from"./chunk.TY4GQJKC.js";import{b as za,c as Ja}from"./chunk.PI44XMY2.js";import{a as In,d as Dn,f as _a}from"./chunk.KGW75Z5L.js";import{r as xt,s as Cr}from"./chunk.IOK4GVJC.js";import{b as gr,c as mr,d as jt,e as fr,l as Ut}from"./chunk.UITT6JWW.js";import{H as ro,K as oo,c as lr,d as dr,r as Br,s as Kr,z as Vn}from"./chunk.WC3DENU4.js";import{c as Ci}from"./chunk.VNDKKTED.js";import{Ba as Kt,G as ke,L as Za,N as Xa,Qa as sr,R as er,T as V,U as Wn,Y as tr,Z as nr,ba as ar,ca as ce,fa as rr,ga as or,ia as ir,ma as gt,oa as mt,qa as Ke,r as Qa,v as De}from"./chunk.4MP72LPR.js";import{a as Ya}from"./chunk.SDO3U72B.js";import{$c as Ka,Aa as $a,Ad as Hn,Gd as Gt,Hd as Va,Jd as Bt,L as Ta,Sd as Fn,Tc as $n,Td as ja,Uc as Ba,W as kt,Yd as Ua,ab as Ha,cb as Fa,da as Xe,fa as et,ga as oe,ia as ut,ja as Ea,ka as _e,ma as Ma,md as qa,na as Na,oa as tt,ob as On,pb as Ia,qc as Da,xc as Wa,za as Oa,zb as Wt,zc as Ga}from"./chunk.VSCIXAHN.js";import{b as O}from"./chunk.AJZBJBMO.js";function on(e,t,n={}){let a=e.graph.getNode(t);if(!a)return;let r=e.schema.tryDefinition(a.kind),o=l=>oe(e.schema.tryDefinition(l.kind),l),i=new Map;for(let l of e.graph.allEdges()){let s=l.from===t?"out":l.to===t?"in":null;if(!s)continue;let c=s==="out"?l.to:l.from,u=e.graph.getNode(c);if(!u)continue;let p=(s==="out"?r:e.schema.tryDefinition(u.kind))?.edges?.[l.kind],S=s==="in"?p?.inverse??p?.description:p?.description,R=`${l.kind}|${s}|${S??""}`;(i.get(R)??(()=>{let k={edgeKind:l.kind,direction:s,...S?{description:S}:{},targets:[]};return i.set(R,k),k})()).targets.push({id:u.id,kind:u.kind,label:o(u)})}return{id:t,kind:a.kind,label:o(a),fields:jt(nt(e.schema,e.graph,a),r),violations:On(e.violations(n.context),[t]),actions:qn(e,[t],{focus:t,...n.principal?{principal:n.principal}:{},...n.context?{context:n.context}:{}}),links:[...i.values()].map(l=>{let s=gr(l.targets.flatMap(c=>{let u=e.graph.getNode(c.id);return u?[u]:[]}),c=>e.schema.tryDefinition(c));return{...l,targets:[...l.targets].map(c=>s.has(c.id)?{...c,apart:s.get(c.id)}:c).sort((c,u)=>c.label.localeCompare(u.label))}})}}function rt(e,t,n={}){return{kind:t,members:e.graph.nodesOfKind(t),actions:qn(e,[],{kindSelection:[t],...n.principal?{principal:n.principal}:{},...n.context?{context:n.context}:{}})}}function Ro(e,t){let n=(o,i)=>`${o}|${JSON.stringify(i)}`,a=new Map;for(let o of[...e.affordances,...e.withheld]){if(o.provider!=="invariant")continue;let i=n(o.mutation,o.args);a.has(i)||a.set(i,o.rank??Number.MAX_SAFE_INTEGER)}let r=Number.MAX_SAFE_INTEGER;return[...t].map((o,i)=>({repair:o,declared:i})).sort((o,i)=>(a.get(n(o.repair.mutation,o.repair.args??{}))??r)-(a.get(n(i.repair.mutation,i.repair.args??{}))??r)||o.declared-i.declared).map(o=>o.repair)}function ot(e){let t=e.schema.kinds.map(r=>({kind:r,plural:_e(e.schema,r),count:e.graph.nodesOfKind(r).length})),n=new Map;for(let r of e.graph.allEdges()){let o=e.graph.getNode(r.from),i=e.graph.getNode(r.to);if(!o||!i)continue;let l=`${r.kind}|${o.kind}|${i.kind}`;n.set(l,(n.get(l)??0)+1)}let a=[];for(let{kind:r}of t){let o=e.schema.tryDefinition(r)?.edges??{};for(let[i,l]of Object.entries(o)){let s=l.to==="*"||l.to===void 0?(()=>{let c=[...n.keys()].filter(u=>u.startsWith(`${i}|${r}|`)).map(u=>u.split("|")[2]);return c.length>0?c:["*"]})():l.to;for(let c of s)a.push({edgeKind:i,from:r,to:c,...l.description?{description:l.description}:{},...l.inverse?{inverse:l.inverse}:{},count:n.get(`${i}|${r}|${c}`)??0})}}return{kinds:t,relations:a}}var je=O(ke(),1);var Tt=O(ke(),1);var Me=O(V(),1),Li={problems:"Problems",search:"Search",map:"Connections",places:"Pictures","~draft":"A view drawn"},Ti=e=>{try{return decodeURIComponent(e)}catch{return e}};function Ei(e,t,n={}){let{store:a}=e,r=a.schema,o=(n.base??"").replace(/\/$/,""),[i="/",l=""]=t.split("#")[0].split("?"),s=(M,D,x)=>({label:M,href:`${o}${D}`,path:D,...x?{current:x}:{}}),c=M=>{let D=n.registry?.sectionOf(M);return D?[D.path===void 0?{label:D.label}:s(D.label,D.path)]:[]},u=M=>n.registry?.sectionOf(M)?.label,P=M=>{let D=u(M);return D===void 0?{}:{section:D}},[p,S,...R]=i.split("/").filter(Boolean).map(Ti);if(p===void 0)return{as:"home",label:"Home",trail:[s("Home","/",!0)]};if(p==="places"&&S!==void 0&&R.length===0){let M=new URLSearchParams(l).get("of"),D=new Set(Ge(a,e.principal)),x=e.views?.places()??[],B=x.find(U=>D.has(U.kind)&&U.as===S&&(!M||j(r,U.kind)===M));if(B){let U=nn(B.as,Gt(B,x)?j(r,B.kind):void 0);return{as:"place",kind:B.kind,label:B.title,...P(B.kind),trail:[...c(B.kind),s(B.title,U,!0)]}}}let m=R.length===0?xe(r,p):void 0;if(m!==void 0){let M=s(_e(r,m),`/${j(r,m)}`);if(S===void 0)return{as:"list",kind:m,label:M.label,...P(m),trail:[...c(m),{...M,current:!0}]};let D=a.graph.getNode(S),x=D&&D.kind===m?oe(r.tryDefinition(m),D):"Nothing lives here";return{as:"record",kind:m,id:S,label:x,...P(m),trail:[...c(m),M,s(x,X(r,m,S),!0)]}}let k=Li[p]??Mi((R.at(-1)??S??p).replace(/[-_]+/g," "));return{as:"page",label:k,trail:[s(k,i,!0)]}}var Mi=e=>e.charAt(0).toUpperCase()+e.slice(1),ea=(0,Tt.createContext)(null);function Ni(e){let t=ye(),n=at("/");return ae(e.context.store),Ei(e.context,`${t.pathname}${t.search}`,{registry:e.registry,base:n})}var Oi={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0},Lo={display:"flex",alignItems:"center",gap:6,minWidth:0},To={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,lineHeight:"24px"};function it({context:e,style:t}){let n=(0,Tt.useContext)(ea),a=(0,Tt.useContext)(Rt);return Lt(a??Hi,"trail")||n?.registry?.without().has("trail")?null:(0,Me.jsx)($i,{root:n??{context:e,registry:void 0},context:e,...t?{style:t}:{}})}function $i({root:e,context:t,style:n}){let a=Ni(e);return a.trail.length<2?null:(0,Me.jsx)(Fi,{here:a,mark:a.as==="record"?{kind:a.kind,context:t}:void 0,...n?{style:n}:{},"data-testid":"page-trail"})}var Hi={count:()=>0,place:()=>()=>{},subscribe:()=>()=>{}};function Fi({here:e,mark:t,style:n,...a}){let r=e.as==="record"?e.trail.length-2:-1;return(0,Me.jsx)("nav",{"aria-label":"You are here","data-graview-trail":"",style:{minWidth:0,...n},...a,children:(0,Me.jsx)("ol",{style:{...be,listStyle:"none",padding:0,display:"flex",alignItems:"center",gap:6,minWidth:0,overflow:"hidden"},children:e.trail.map((o,i)=>(0,Me.jsxs)("li",{style:o.current?Oi:{...Lo,flexShrink:i===e.trail.length-2?0:1,maxWidth:"100%"},...o.current?{"aria-current":"page"}:{},children:[i>0&&!o.current?(0,Me.jsx)("span",{"aria-hidden":"true",children:"\u203A"}):null,o.current?o.label:o.path!==void 0?(0,Me.jsxs)(H,{to:o.path,style:{...ve,...Lo},...i===r?{"data-testid":"trail-list"}:{},children:[i===r&&t?(0,Me.jsx)(ge,{kind:t.kind,brand:t.context.brand,schema:t.context.store.schema,size:8}):null,(0,Me.jsx)("span",{style:To,children:o.label})]}):(0,Me.jsx)("span",{style:To,children:o.label})]},`${i}:${o.label}`))})})}var L=O(V(),1);function Fe(e){let t=e.views;if(!t)return[];let n=new Set(Ge(e.store,e.principal));return t.places().filter(a=>n.has(a.kind))}function Et(e,t){if(!t.over)return[t.kind];let n=new Set(Ge(e.store,e.principal));return t.over.filter(a=>a===t.kind||n.has(a))}var st=e=>`place:${e.kind}:${e.as}`;function he(e,t){return nn(t.as,Gt(t,e.views?.places()??[])?j(e.store.schema,t.kind):void 0)}function St(e,t){let n=e.schema.tryDefinition(t);return e.graph.nodesOfKind(t).filter(a=>et(n,a))}function ta(e,t,n){let a=(o,i)=>ut(e.schema,i,o),r=(typeof t=="string"?[t]:t).map(o=>a(St(e,o).length,o)).join(" and ");return n?`${r} across ${a(St(e,n).length,n)}`:r}function na({context:e,place:t,chosen:n,filter:a}){let{store:r,views:o,invariantContext:i}=e,s=o?.resolve(t.kind,{cardinality:"many",fidelity:"full"},t.as)?.view,c=[...new Set(r.violations(i).flatMap(p=>p.nodeIds))],u=Et(e,t).flatMap(p=>St(r,p));if(!s)return null;let P=Ii(r,u,a,c);return(0,L.jsx)(xt,{kind:t.kind,view:t.title,children:(0,L.jsx)(Je,{when:Ke(s),children:(0,L.jsx)(s,{nodes:P,label:t.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1,...n&&n.length>0?{implicated:n}:{},...c.length>0?{flagged:c}:{}})})})}function Ii(e,t,n,a){let r=n?Bt({filter:n}).filter??[]:[];return r.length===0?t:Jt(t,{filter:r},{schema:e.schema,graph:e.graph,flagged:new Set(a)}).nodes}function Di({store:e,views:t,as:n,invariantContext:a}){ae(e);let r={store:e,views:t,...a?{invariantContext:a}:{}},o=t.places().find(i=>i.as===n);return o?(0,L.jsx)(na,{context:r,place:o}):null}function Wi({context:e,kind:t}){let{store:n,views:a,invariantContext:r}=e,o=St(n,t),i=n.schema.tryDefinition(t),l=z(n,t),c=a?.resolve(t,{cardinality:"many",fidelity:"full"})?.view,u=[...new Set(n.violations(r).flatMap(R=>R.nodeIds))];if(c&&!gt(c))return(0,L.jsx)(xt,{kind:t,children:(0,L.jsx)(c,{nodes:o,label:l,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1,...u.length>0?{flagged:u}:{}})});let P=a?.resolve(t,{cardinality:"one",fidelity:"summary"})?.view,p=8,S=o.slice(0,p);return(0,L.jsxs)("div",{"data-testid":"kind-sheet",style:P?{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gridAutoRows:"max-content",alignContent:"center",gap:12,padding:24}:{display:"flex",flexWrap:"wrap",alignContent:"center",justifyContent:"center",gap:10,padding:24},children:[S.map(R=>P?(0,L.jsx)(P,{node:R,fidelity:"summary",cardinality:"one",mode:"fullscreen",selected:!1,...u.includes(R.id)?{flagged:[R.id]}:{}},R.id):(0,L.jsx)("span",{style:{padding:"8px 14px",borderRadius:8,border:"1px solid var(--graview-edge-bright)",background:"var(--graview-ground)",color:"var(--graview-ink)"},children:oe(i,R)},R.id)),o.length>p?(0,L.jsxs)("span",{style:{...C,alignSelf:"center",padding:"0 6px"},children:["+",o.length-p," more ",l.toLowerCase()]}):null]})}function sn(e){let{store:t}=e,n=bo(e),a=Fe(e),r=e.views?.arrangement?.()?.order??[],o=s=>{let c=s.name===void 0?-1:r.indexOf(`view:${s.name}`);return c>=0?c-r.length:n.indexOf(s.kind)},i=Hn([...a].sort((s,c)=>o(s)-o(c))).filter(s=>!s.hidden),l=new Set(i.flatMap(s=>s.over??[s.kind]));return[...i.map(s=>({key:st(s),kind:s.kind,title:Va(s,a,t.schema),to:he(e,s),place:s})),...an(e).filter(s=>!l.has(s)).map(s=>({key:`kind:${s}`,kind:s,title:z(t,s),to:`/${j(t.schema,s)}`}))]}function No(e){let t=new Set(sn(e).flatMap(n=>n.place?Et(e,n.place):[n.kind]));return new Set([...t].flatMap(n=>St(e.store,n).map(a=>a.id)))}var Eo=.72,Gi=540,Mo=16/10;function Bi(e){let t=(0,je.useRef)(null),[n,a]=(0,je.useState)(e);return(0,je.useLayoutEffect)(()=>{let r=t.current;if(!r||typeof ResizeObserver>"u")return;let o=()=>{let l=r.getBoundingClientRect().width;l>0&&a(s=>Math.abs(s-l)<.5?s:l)};o();let i=new ResizeObserver(o);return i.observe(r),()=>i.disconnect()},[]),{ref:t,width:n}}function Ki(e){for(let t=e.parentElement;t;t=t.parentElement)if(/(auto|scroll)/.test(getComputedStyle(t).overflowY))return t;return null}function qi(e){let[t,n]=(0,je.useState)(()=>typeof IntersectionObserver>"u");return(0,je.useLayoutEffect)(()=>{let a=e.current;if(t||!a)return;let r=new IntersectionObserver(o=>{o.some(i=>i.isIntersecting)&&(r.disconnect(),n(!0))},{root:Ki(a),rootMargin:"50% 0px"});return r.observe(a),()=>r.disconnect()},[t,e]),t}function aa({context:e,entry:t,small:n=!1}){let{store:a,brand:r,principal:o}=e,{ref:i,width:l}=Bi(Gi),s=qi(i),c=l/Eo,u=St(a,t.kind),P=a.schema.tryDefinition(t.kind),p=u.length===0?rt(a,t.kind,{...o?{principal:o}:{},...e.invariantContext?{context:e.invariantContext}:{}}).actions.affordances[0]:void 0,S=t.place!==void 0;return(0,L.jsxs)(H,{to:t.to,"data-testid":S?"place-card":"kind-card",className:"graview-gallery-card",style:{...ve,display:"grid",gap:10,alignContent:"start",minWidth:0},children:[(0,L.jsxs)("span",{ref:i,"data-testid":S?"place-picture":"kind-picture","aria-hidden":"true",inert:!0,style:{display:"block",position:"relative",width:"100%",aspectRatio:`${Mo}`,overflow:"hidden",borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",pointerEvents:"none"},children:[(0,L.jsx)("span",{style:{position:"absolute",left:0,top:0,width:c,height:c/Mo,display:"grid",gridTemplateRows:"minmax(0, 1fr)",transform:`scale(${Eo})`,transformOrigin:"0 0"},children:s?(0,L.jsx)(Zt.Provider,{value:null,children:t.place?(0,L.jsx)(na,{context:e,place:t.place}):(0,L.jsx)(Wi,{context:e,kind:t.kind})}):null}),u.length===0?(0,L.jsx)("span",{"data-testid":"picture-empty",style:{position:"absolute",inset:0,display:"grid",placeContent:"center",justifyItems:"center",gap:2,padding:20,textAlign:"center"},children:(0,L.jsxs)("span",{style:{display:"grid",gap:2,padding:"10px 16px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-ground)",color:"var(--graview-ink)"},children:[(0,L.jsxs)("span",{style:{fontFamily:Jn,fontWeight:"var(--graview-weight-display)"},children:["No ",z(a,t.kind).toLowerCase()," yet"]}),p?(0,L.jsxs)("span",{style:C,children:["Begin with \u201C",p.label,"\u201D"]}):null]})}):null]}),(0,L.jsxs)("span",{style:{display:"grid",gap:2,minWidth:0},children:[(0,L.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0},children:[S?null:(0,L.jsx)(ge,{kind:t.kind,brand:r,schema:a.schema,size:8}),(0,L.jsx)("span",{style:{fontFamily:Jn,fontSize:n?"var(--graview-text-body)":"var(--graview-text-heading)",fontWeight:"var(--graview-weight-display)",lineHeight:1.3,overflowWrap:"anywhere",textWrap:"balance"},children:t.title})]}),(0,L.jsxs)("span",{style:C,children:[t.place?ta(a,Et(e,t.place),t.place.across):ta(a,t.kind),!S&&P?.description?` \xB7 ${P.description}`:null]})]})]})}var Oo={display:"grid",gap:"32px 28px",gridTemplateColumns:"repeat(auto-fill, minmax(min(420px, 100%), 1fr))"},Vi={display:"grid",gap:"20px 16px",gridTemplateColumns:"repeat(auto-fill, minmax(clamp(140px, 22%, 260px), 1fr))"},ji=`
2
- .graview-gallery-card > span:first-child { transition: border-color 160ms ease, box-shadow 160ms ease; }
3
- .graview-gallery-card:hover > span:first-child,
4
- .graview-gallery-card:focus-visible > span:first-child { border-color: var(--graview-edge-bright); box-shadow: 0 1px 0 var(--graview-edge), 0 10px 30px -18px var(--graview-ink); }
5
- `;function ln({context:e,small:t=!1}){ae(e.store);let n=sn(e);return n.length===0?null:(0,L.jsxs)("section",{style:t?Vi:Oo,"data-testid":"gallery",...t?{"data-small":""}:{},children:[(0,L.jsx)("style",{children:ji}),n.map(a=>(0,L.jsx)(aa,{context:e,entry:a,small:t},a.key))]})}function ra({context:e}){let{store:t}=e;ae(t);let n=Hn(Fe(e)).filter(r=>!r.hidden),a=sn(e);return(0,L.jsxs)(ie,{context:e,style:yt,children:[(0,L.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,L.jsx)("p",{style:be,children:n.length===0?"None of its own yet":`${n.length} ${n.length===1?"picture":"pictures"}`}),(0,L.jsx)(se,{context:e,children:"Pictures"}),(0,L.jsx)("p",{style:le,children:n.length===0?"Nothing here has a picture of its own yet, so each kind is drawn as the scene draws it. Title a group view and it appears here by name.":"The ways this installation looks at what it holds \u2014 each one the same picture the scene shows, here as a page."})]}),a.length>0?(0,L.jsx)("div",{style:Oo,"data-testid":"places",children:a.map(r=>(0,L.jsx)(aa,{context:e,entry:r},r.key))}):null]})}var Ui={lede:!0},_i={lede:!1},zi={...le,textWrap:"pretty"};function Ji(e,t){if(t===void 0)return;let[n]=xr(kr([t]),Ar(e.store,null,null,e.brand?{money:e.brand}:{}));return n?.t==="headline"&&!n.problem&&n.text.trim()!==""?n.text:void 0}function oa({context:e}){let{store:t,principal:n}=e;ae(t);let a=ze(),r=Ve(),[o]=wt(),i=decodeURIComponent(a.as??""),[l,s]=(0,je.useState)(null),c=o.get("of"),u=o.get("filter"),p=Fe(e).find(g=>g.as===i&&(!c||j(t.schema,g.kind)===c));if(!p)return(0,L.jsxs)(ie,{context:e,children:[(0,L.jsx)(se,{context:e,children:"No picture is called that."}),(0,L.jsx)("p",{style:le,children:(0,L.jsx)(H,{to:"/places",style:We,children:(0,L.jsx)(qe,{children:"The pictures there are"})})})]});let S=z(t,p.kind),R=e.views?.resolve(p.kind,{cardinality:"many",fidelity:"full"},p.as)?.view,m=R?.flows===!0,k=R?.ownHeading===!0,M=R?.creates!==!1,D=Ji(e,R?.lede),x=mt(R)&&e.views?.lookup(p.kind,{cardinality:"many",fidelity:"full"})===R,B=rt(t,p.kind,{...n?{principal:n}:{},...e.invariantContext?{context:e.invariantContext}:{}}),U=M?B.actions.affordances.map(g=>({affordance:g,mutation:t.allMutations().find(F=>F.name===g.mutation)})).filter(g=>g.mutation!==void 0):[];return(0,L.jsxs)(ie,{context:e,style:{...yt,gap:"var(--graview-space-6, 32px)"},children:[(0,L.jsxs)("header",{style:{display:"grid",gap:"var(--graview-space-2, 8px)"},children:[(0,L.jsx)(it,{context:e}),(0,L.jsx)(se,{context:e,unseen:k,children:p.title}),k?null:(0,L.jsx)("p",{style:zi,"data-testid":"place-lede",...D!==void 0?{"data-graview-lede":"headline"}:{},children:D??`${ta(t,Et(e,p),p.across)}.`}),u&&!m?(0,L.jsxs)("p",{style:{...C,margin:0},"data-testid":"place-narrowed",children:[`Only those where ${u.split(",").map(g=>g.replace(":"," is ")).join(" and ")}. `,(0,L.jsx)(H,{to:`?${(()=>{let g=new URLSearchParams(o);return g.delete("filter"),g.toString()})()}`,style:{..._,...C},children:"Show all"})]}):null,(0,L.jsx)("p",{style:{...C,margin:0,display:"flex",flexWrap:"wrap",gap:"4px 16px"},children:Et(e,p).filter(g=>!(x&&g===p.kind)).map((g,F)=>(0,L.jsx)(H,{to:`/${j(t.schema,g)}`,style:{...We,...C},...F===0?{"data-testid":"place-as-list"}:{},children:(0,L.jsxs)(qe,{children:["All ",(g===p.kind?S:z(t,g)).toLowerCase()," as a list"]})},g))})]}),(0,L.jsx)("div",{"data-testid":"place-lens","data-flows":m?"":void 0,...m?{}:{role:"group","aria-label":p.title,tabIndex:0},style:m?{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",maxWidth:"100%"}:{height:"min(72vh, 760px)",display:"grid",gridTemplateRows:"minmax(0, 1fr)",overflow:"auto",maxWidth:"100%",borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)"},onClick:g=>{let F=g.target?.closest("[data-graview-pick]"),Y=F?.getAttribute("data-graview-pick"),Q=F?.getAttribute("data-graview-joins");if(Q)try{let Ce=JSON.parse(Q);if(Array.isArray(Ce)&&Ce.every(Se=>typeof Se=="string")){g.preventDefault(),s({at:st(p),ids:Ce});return}}catch{}if(!Y)return;let Oe=t.graph.getNode(Y);Oe&&(g.preventDefault(),r(X(t.schema,Oe.kind,Y)))},children:(0,L.jsx)(ao.Provider,{value:D!==void 0?Ui:_i,children:(0,L.jsx)(na,{context:e,place:p,filter:u,...l?.at===st(p)?{chosen:l.ids}:{}})})}),U.length>0?(0,L.jsx)("div",{style:{maxWidth:760,display:"grid",gap:40},"data-testid":"place-creators",children:U.map(({affordance:g,mutation:F})=>(0,L.jsxs)("section",{style:{...de,display:"grid",gap:14},children:[(0,L.jsx)("h2",{style:ne,children:F.title??F.name}),F.description?(0,L.jsx)("p",{style:{...C,margin:0,maxWidth:"58ch"},children:F.description}):null,(0,L.jsx)(Le,{store:t,mutation:F,prefilled:g.args,open:g.open,label:g.label,...n?{principal:n}:{}})]},g.id))}):null]})}function Yi(e,t=document){let n=en(e);if(!n)return null;let a=[t,...[...t.querySelectorAll("[data-worker-view]")].flatMap(r=>r.shadowRoot?[r.shadowRoot]:[])];for(let r of a)for(let o of r.querySelectorAll("[id], [data-section]")){let i=o.getAttribute("data-section")??o.id;if(i===e||en(i)===n)return o}for(let r of a)for(let o of r.querySelectorAll("h1, h2, h3, h4, h5, h6, [role=heading]"))if(en(o.textContent??"")===n)return o;return null}function $o(e,t={}){if(typeof document>"u"||typeof requestAnimationFrame>"u")return()=>{};let n=t.frames??120,a=0,r=()=>{let o=Yi(e,t.root??document);if(o){o.hasAttribute("tabindex")||o.setAttribute("tabindex","-1"),o.scrollIntoView?.({block:"start"}),o.focus({preventScroll:!0});return}n-=1,n>0&&(a=requestAnimationFrame(r))};return a=requestAnimationFrame(()=>{a=requestAnimationFrame(r)}),()=>cancelAnimationFrame(a)}var q=O(ke(),1);var dn=O(ke(),1);var lt=O(V(),1);function Ho({context:e}){return ce()?(0,lt.jsxs)(lt.Fragment,{children:[(0,lt.jsx)(Qi,{context:e}),(0,lt.jsx)(so,{face:"pages",on:e.quickAsk??!0})]}):null}function Qi({context:e}){let{store:t}=e,n=ce(),{pathname:a}=ye(),r=(0,dn.useRef)(n?.setSelection);return r.current=n?.setSelection,(0,dn.useEffect)(()=>{let o=r.current;if(!o)return;let[,i,l]=a.split("/"),s=(()=>{if(i==="places"){let u=e.views?.places().find(P=>P.as===decodeURIComponent(l??""));return u?[De(u.kind)]:[]}let c=i?xe(t.schema,i):void 0;return c&&l?[decodeURIComponent(l)]:c?[Qa(c)]:[]})();o(c=>c.length===s.length&&c.every((u,P)=>u===s[P])?c:s)},[a]),null}var Pe=O(ke(),1);var Io=O(Ci(),1);var me=O(V(),1);var Zi=Kt(Ya(()=>(__graviewPreload(import.meta.url,["./chunk.G4YJPKRG.js","./chunk.3UOKUF5Z.js","./chunk.Q355UPFG.js","./chunk.MVWC3VR3.js","./chunk.CC5BJH5A.js","./chunk.CFKZXLXS.js","./chunk.Y5C4RXG7.js","./chunk.7MHCGVGM.js","./chunk.FRYBMS3W.js","./chunk.LQVAABPS.js","./chunk.NGTRL5U4.js","./chunk.3MOJF7BA.js","./chunk.LZIBQ3VX.js","./chunk.YZ7FUKAL.js","./chunk.KDRLUBVF.js","./chunk.BQIHNT7C.js","./chunk.TAT2IQUR.js","./chunk.3XGA65Y3.js","./chunk.BYKD5RLA.js","./chunk.2K4TT2BV.js","./chunk.VUBNBTJP.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.7VKSXGTX.js","./chunk.TY4GQJKC.js","./chunk.6ZQAR5ZA.js","./chunk.W3W54DSX.js","./chunk.PI44XMY2.js","./chunk.KGW75Z5L.js","./chunk.GZHZLJBF.js","./chunk.IOK4GVJC.js","./chunk.OJGHDWI6.js","./chunk.TLJOZSDD.js","./chunk.MSWWWLEA.js","./chunk.UITT6JWW.js","./chunk.A5PDXNY6.js","./chunk.WC3DENU4.js","./chunk.VNDKKTED.js","./chunk.4MP72LPR.js","./chunk.SDO3U72B.js","./chunk.VSCIXAHN.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.H45Q3O4F.js")).then(e=>({default:e.TakeBack}))));function Xi({context:e,docked:t,at:n,...a}){let{store:r}=e,o=ae(r),[i]=(0,Pe.useState)(()=>r.batches().length),l=(0,Pe.useRef)(!1);return l.current||=o>0||!t&&i>0,l.current?(0,me.jsx)(Pe.Suspense,{fallback:null,children:(0,me.jsx)(Zi,{context:e,docked:t,at:n,since:i,...a})}):null}function es(e,t,n){let{store:a,principal:r,embedded:o}=e;(0,Pe.useEffect)(()=>{if(!n)return;let i=l=>{if(!fo(l))return;let s=l.target,c=s instanceof Node&&t.current?.contains(s),u=s===document.body||s===document.documentElement||s===document;if(!(!c&&!(u&&!o))&&go(a,r)){l.preventDefault();try{mo(a,r)}catch{}}};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[a,r,o,t,n])}function Do({context:e,registry:t,root:n,children:a}){let r=(0,Pe.useMemo)(Ao,[]),o=t?.without()??new Set;return es(e,n,!o.has("undo")),(0,me.jsxs)(Rt.Provider,{value:r,children:[(0,me.jsx)(ts,{context:e,placed:r,without:o}),a]})}function ts({context:e,placed:t,without:n}){let[a,r]=(0,Pe.useState)(!1);(0,Pe.useLayoutEffect)(()=>r(!0),[]);let o=Lt(t,"find"),i=Lt(t,"undo"),l=ye(),s=Kr();if(!a)return null;let c=l.pathname.split("/").filter(Boolean),P=(c.length===1?xe(e.store.schema,c[0]):void 0)!==void 0;return(0,me.jsxs)(me.Fragment,{children:[!o&&!n.has("find")&&s?(0,Io.createPortal)((0,me.jsx)(Fo,{context:e,narrowsLists:P}),s.slot):null,!o&&!n.has("find")&&!s?(0,me.jsx)("div",{"data-testid":"face-find-bar",style:{display:"flex",alignItems:"center",padding:"8px 16px",borderBottom:"1px solid var(--graview-edge)",background:"var(--graview-bar)",minWidth:0},children:(0,me.jsx)(Fo,{context:e,narrowsLists:P})}):null,!i&&!n.has("undo")?(0,me.jsx)(Xi,{context:e,docked:!0,at:l.pathname+l.search}):null,s?.own&&!n.has("undo")?(0,me.jsx)(vo,{context:e,own:s.own}):null]})}function Fo({context:e,narrowsLists:t}){return(0,me.jsx)(Rt.Provider,{value:null,children:(0,me.jsx)(Xn,{context:e,narrowsLists:t})})}var re=O(ke(),1);var Ae=O(V(),1),ns=500,as=10;function cn(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName==="TEXTAREA"||e.tagName==="SELECT"?!0:e.tagName==="INPUT"&&!["button","submit","reset","checkbox","radio","image","file","color","range"].includes(e.type):!1}function rs(e){let t=typeof getSelection=="function"?getSelection():null;return t!==null&&!t.isCollapsed&&t.containsNode(e,!0)}function Wo(e){let t=e.closest('a[href], button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"])');if(t)return t;let n=document.activeElement;return n instanceof HTMLElement&&n!==document.body?n:null}function Go({context:e,root:t,children:n}){return ce()===null?(0,Ae.jsx)(Ae.Fragment,{children:n}):(0,Ae.jsx)(os,{context:e,root:t,children:n})}function os({context:e,root:t,children:n}){let{setMenuAt:a}=ar(),{store:r}=e,o=r.schema,i=Ve(),{pathname:l,search:s}=ye(),c=at("/").replace(/\/$/,""),u=(0,re.useCallback)((b,w)=>e.views?.places().find(T=>T.as===b&&(w===null||T.kind===w)),[e.views]),P=(0,re.useCallback)((b,w)=>{let[T="",$,ee]=b.split("/").filter(Boolean).map(f=>{try{return decodeURIComponent(f)}catch{return f}});if(ee!==void 0)return null;if(T==="places"&&$!==void 0){let f=u($,new URLSearchParams(w).get("of"));return f?{face:"pages",place:f.as,about:[De(f.kind)],title:f.title}:null}let te=xe(o,T);return te?$===void 0?{face:"pages",about:[De(te)],title:_e(o,te)}:r.graph.getNode($)?{face:"pages",on:$,about:[$]}:null:null},[o,r,u]),p=(0,re.useCallback)(b=>{let w=b.href;try{let T=new URL(w,location.href);if(T.origin===location.origin&&(c===""||T.pathname===c||T.pathname.startsWith(`${c}/`))){let $=P(T.pathname.slice(c.length),T.search);if($)return{...$,href:w}}}catch{}return{face:"pages",about:[],href:w}},[c,P]),S=(0,re.useCallback)(()=>P(l,s)??{face:"pages",about:[]},[P,l,s]),R=(0,re.useCallback)(b=>{let w=S(),T=b.closest("[data-graview-field]")?.getAttribute("data-graview-field");if(T&&w.on!==void 0&&b.closest("[data-graview-pick], a[href]")===null)return{...w,field:T};let $=b.closest("[data-graview-act]")?.getAttribute("data-graview-act");if($)return{...w,act:$};let ee=b.closest("a[href]"),te=b.closest("[data-graview-listed]"),f=[b.closest("[data-graview-pick]")?.getAttribute("data-graview-pick"),te&&(!ee||te.contains(ee)&&ee.classList.contains("graview-spec-item-link"))?te.getAttribute("data-graview-listed"):null].map(Z=>Z?r.graph.getNode(Z):void 0).find(Boolean);if(f)return{face:"pages",on:f.id,about:[f.id],href:`${c}${X(o,f.kind,f.id)}`};if(ee)return p(ee);let E=b.closest("[data-graview-record]")?.getAttribute("data-graview-record");return E&&r.graph.getNode(E)?{face:"pages",on:E,about:[E]}:w},[S,p,r,o,c]),m=(0,re.useCallback)(b=>{let w=t.current;if(w===null||!w.contains(b)||cn(b)||b.closest("[data-graview-popover]"))return null;let T=R(b);return{face:"pages",on:T.on,about:T.about??[],field:T.field,place:T.place,href:T.href,act:T.act,element:Wo(b)}},[R,t]),k=(0,re.useCallback)((b,w,T)=>{let $=R(b);a({...$,x:Math.round(w),y:Math.round(T),returnTo:Wo(b)})},[R,a]),M=(0,re.useCallback)(b=>{let w=b.getBoundingClientRect();k(b,w.left+Math.min(16,w.width/2),Math.min(w.bottom,w.top+36))},[k]),D=(0,re.useRef)(0),x=(0,re.useRef)(null),B=(0,re.useRef)(!1),U=()=>{x.current&&clearTimeout(x.current.timer),x.current=null};(0,re.useEffect)(()=>U,[]),(0,re.useEffect)(()=>{let b=w=>{if(w.defaultPrevented||!(w.key==="ContextMenu"||w.key==="F10"&&w.shiftKey))return;let T=t.current,$=w.target instanceof Element?w.target:null,ee=$===null||$===document.body||$===document.documentElement,te=T!==null&&$!==null&&T.contains($);if(!te&&!(ee&&document.querySelector("[data-graview-face='pages']")===T)||cn($)||$?.closest("[data-graview-popover]"))return;w.preventDefault(),D.current=Date.now();let f=te&&$ instanceof HTMLElement?$:T?.querySelector("[data-graview-page-title], main h1, main")??null;f&&M(f)};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[t,M]),(0,re.useEffect)(()=>{let b=t.current;if(!b)return;let w=T=>{let $=T.detail;$&&a({...$,face:"pages"})};return b.addEventListener(Wn,w),()=>b.removeEventListener(Wn,w)},[t,a]);let g=(0,re.useMemo)(()=>b=>{if(b.face!=="pages")return null;let w=[],T=b.on===void 0?void 0:r.graph.getNode(b.on),$=b.place===void 0?void 0:e.views?.places().find(pe=>pe.as===b.place),ee=T?void 0:b.about.length===1&&b.about[0].startsWith("aggregate:")&&!$?is(b.about[0]):void 0,te=T?X(o,T.kind,T.id):$?he(e,$):ee?`/${j(o,ee)}`:void 0,f=te!==void 0&&l===te.split("?")[0];te!==void 0&&!f&&w.push({id:"open",label:"Open",run:()=>i(te)});let E=te!==void 0?`${c}${te}`:b.href;E!==void 0&&w.push({id:"open-in-a-new-tab",label:"Open in a new tab",run:()=>void window.open(E,"_blank","noopener")});let Z=T?`#focus=${encodeURIComponent(T.id)}`:$?`#focus=${encodeURIComponent(De($.kind))}&view=${encodeURIComponent($.as)}`:ee?`#focus=${encodeURIComponent(De(ee))}`:void 0;if(Z!==void 0&&(e.overview||!e.embedded)){let pe=e.overview;w.push({id:"in-the-scene",label:"Show in the scene",run:()=>pe?pe(Z):location.assign(`${e.sceneHref??"/"}${Z}`)})}return T===void 0&&b.href===void 0&&w.push({id:"find",label:"Find\u2026",run:()=>{let pe=t.current?.querySelector('[data-testid="nav-find"]')??document.querySelector('[data-testid="nav-find"]');pe&&pe.offsetParent!==null?pe.focus():i("/search")}}),w.length>0?{id:"pages",items:w}:null},[r,o,e,l,c,i,t]),F=(0,re.useMemo)(()=>b=>{if(b.face!=="pages"||b.field===void 0||b.on===void 0)return null;let w=r.graph.getNode(b.on),T=b.element?.closest("[data-graview-field]")??t.current?.querySelector(`[data-graview-field="${CSS.escape(b.field)}"]`);return!w||!(T instanceof HTMLElement)||!T.hasAttribute("data-graview-editable")?null:{id:"field",at:"start",items:[{id:"change-field",label:`Change \u201C${Ma(o.tryDefinition(w.kind),b.field)}\u201D`,run:()=>T.click()}]}},[r,o,t]),Y=co(),Q=Er(),Oe=Jr(),Ce=(0,re.useCallback)((b,w)=>{l===he(e,b).split("?")[0]&&i(w?he(e,w):"/")},[l,e,i]),Se=uo(Ce),Re=(0,re.useMemo)(()=>[F,Oe,g,...Se?[Se]:[],...Q?[Q]:[],...Y?[Y]:[]],[F,Oe,g,Se,Q,Y]);return(0,Ae.jsxs)(Cr,{sections:Re,children:[(0,Ae.jsx)("div",{"data-graview-menu-ground":"",style:{display:"contents"},onContextMenu:b=>{let w=b.target;b.shiftKey||cn(w)||rs(w)||(b.preventDefault(),!w.closest("[data-graview-popover]")&&(Date.now()-D.current<700||(b.clientX===0&&b.clientY===0&&w instanceof HTMLElement?M(w):k(w,b.clientX,b.clientY))))},onPointerDown:b=>{if(B.current=!1,b.pointerType==="mouse"||!b.isPrimary)return;let w=b.target;if(cn(w)||w.closest("[data-graview-choose], [data-graview-popover]"))return;U();let{clientX:T,clientY:$}=b;x.current={x:T,y:$,timer:setTimeout(()=>{x.current=null,B.current=!0,D.current=Date.now(),k(w,T,$)},ns)}},onPointerMove:b=>{let w=x.current;w&&Math.hypot(b.clientX-w.x,b.clientY-w.y)>as&&U()},onPointerUp:U,onPointerCancel:U,onClickCapture:b=>{B.current&&(B.current=!1,b.preventDefault(),b.stopPropagation())},children:n}),(0,Ae.jsx)(ss,{openAt:M,readyAt:m}),(0,Ae.jsx)(po,{placement:"page"}),(0,Ae.jsx)(Mr,{})]})}function is(e){let t=e.slice(10).split("+");return t.length===1&&t[0]?t[0]:void 0}function ss({openAt:e,readyAt:t}){return(0,Ae.jsx)("span",{"data-graview-menu-home":"",tabIndex:-1,onFocus:n=>{if(n.target!==n.currentTarget)return;let a=n.currentTarget.closest("[data-graview-face]"),r=a?.querySelector("[data-graview-page-title]")??a?.querySelector("main h1, main")??null;r&&(r.hasAttribute("tabindex")||r.setAttribute("tabindex","-1"),r.focus({preventScroll:!0}))},style:{position:"absolute",width:0,height:0,overflow:"hidden"},children:(0,Ae.jsx)(io,{placement:"menu",openActs:e,aimAt:t})})}var K=O(V(),1);function Bo(e,t){return t==="*"?{label:"anything",path:null}:{label:z(e,t),path:`/${j(e.schema,t)}`}}function ls({context:e,relation:t}){let{store:n}=e,a=Bo(n,t.from),r=Bo(n,t.to),o=i=>i.path?(0,K.jsx)(H,{to:i.path,style:{...ve,fontWeight:550},children:i.label}):(0,K.jsx)("span",{children:i.label});return(0,K.jsxs)("li",{"data-testid":"relation","data-relation":t.edgeKind,style:{display:"grid",gridTemplateColumns:"30px minmax(0, 1fr) auto",gap:12,alignItems:"baseline"},children:[(0,K.jsx)(lo,{edgeKind:t.edgeKind,...e.brand?.kit?{kit:e.brand.kit}:{}}),(0,K.jsxs)("span",{style:{display:"grid",gap:1},children:[(0,K.jsxs)("span",{children:[o(a)," ",(0,K.jsxs)("span",{style:C,"data-graview-speaks-ids":"",children:[Xe(t.edgeKind)," \u2192"]})," ",o(r)]}),t.description||t.inverse?(0,K.jsxs)("span",{style:C,children:[t.description?Te(t.description):null,t.description&&t.inverse?" \xB7 ":null,t.inverse?`from the other end, ${t.inverse}`:null]}):null]}),r.path?(0,K.jsx)(H,{to:`${r.path}?with=${encodeURIComponent(t.edgeKind)}`,style:{..._,...C,fontVariantNumeric:"tabular-nums",display:"inline-block",minWidth:24,minHeight:24,textAlign:"center"},title:`The ${r.label.toLowerCase()} that have this`,children:t.count}):(0,K.jsx)("span",{style:{...C,fontVariantNumeric:"tabular-nums"},children:t.count})]})}function Ko({context:e,heading:t=!0}){let{store:n}=e,a=new Set(Ge(n,e.principal)),r=ot(n).relations.filter(o=>a.has(o.from)&&(o.to==="*"||a.has(o.to)));return r.length===0?null:(0,K.jsxs)("section",{style:{...de,display:"grid",gap:12},"data-testid":"kind-map",children:[t?(0,K.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[(0,K.jsx)("h2",{style:ne,children:(0,K.jsx)(H,{to:"/map",style:ve,children:"Connections"})}),(0,K.jsx)("span",{style:C,children:r.length===1?"1 relation":`${r.length} relations`})]}):null,(0,K.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:r.map(o=>(0,K.jsx)(ls,{context:e,relation:o},`${o.edgeKind}|${o.from}|${o.to}`))})]})}function ia({context:e}){let{store:t}=e;ae(t);let n=new Set(Ge(t,e.principal)),a=ot(t),r=a.relations.filter(o=>n.has(o.from));return(0,K.jsxs)(ie,{context:e,children:[(0,K.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,K.jsx)("p",{style:be,children:r.length===0?"No relations":`${r.length} ${r.length===1?"relation":"relations"}`}),(0,K.jsx)(se,{context:e,children:"Connections"}),(0,K.jsx)("p",{style:le,children:r.length===0?"Nothing here is declared to relate to anything else yet.":"The kinds this installation holds, and the relations declared between them \u2014 each in the declaration's own words, with how many of it there are."})]}),(0,K.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"6px 18px"},"data-testid":"map-kinds",children:a.kinds.filter(o=>n.has(o.kind)).map(o=>(0,K.jsxs)("li",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[(0,K.jsx)(ge,{kind:o.kind,brand:e.brand,schema:t.schema,size:7}),(0,K.jsx)(H,{to:`/${j(t.schema,o.kind)}`,style:_,children:o.plural}),(0,K.jsx)("span",{style:C,children:o.count})]},o.kind))}),(0,K.jsx)(Ko,{context:e,heading:!1})]})}function qo({context:e}){let n=[...ce()?.robots.values()??[]].filter(r=>r.mode==="asking"&&r.say);if(n.length===0)return null;let{store:a}=e;return(0,K.jsxs)("section",{style:{...de,display:"grid",gap:10},"data-testid":"seat-questions",children:[(0,K.jsx)("h2",{style:ne,children:n.length===1?"The seat asked something":`The seat asked ${n.length} things`}),(0,K.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:8},children:n.map(r=>{let o=r.at?a.graph.getNode(r.at):void 0;return(0,K.jsxs)("li",{style:{display:"grid",gap:2},children:[(0,K.jsx)("span",{children:r.say}),o?(0,K.jsxs)(H,{to:X(a.schema,o.kind,o.id),style:{..._,...C},children:[oe(a.schema.tryDefinition(o.kind),o)," \u2192"]}):null]},r.participant)})})]})}function jo(e){let t=new Set(e.schema.kinds);return(Array.isArray(e.purpose?.jobs)?e.purpose.jobs:[]).flatMap(a=>{if(typeof a!="object"||a===null||typeof a.name!="string"||typeof a.ask!="string"||!t.has(a.kind))return[];let r=$n(a.sort);return[{name:a.name,ask:a.ask,kind:a.kind,plural:Ea(e.schema,a.kind),...a.where!==void 0?{where:a.where}:{},...r?{sort:r}:{},...a.act!==void 0?{act:a.act}:{},...a.roles&&a.roles.length>0?{roles:[...a.roles]}:{}}]})}function Uo(e,t){return e.filter(n=>Nr(n,t.roles))}var pn=new Map;function Vo(e){if(!pn.has(e))try{pn.set(e,Ja(e))}catch(t){if(!(t instanceof za))throw t;pn.set(e,null)}return pn.get(e)}var ds=e=>e instanceof In?e.nodes.length>0:Array.isArray(e)?e.length>0:!!e,cs=(e,t)=>t instanceof In?t.nodes.length:t!==null&&typeof t=="object"&&!Array.isArray(t)?oe(e.tryDefinition(t.kind),t):t;function _o(e,t,n){let a=e;if(a.kindsKeptFrom(n).has(t.kind)||!a.schema.tryDefinition(t.kind))return{count:0,ids:[]};let r=a.seenBy(n),o=r.graph,i=r.schema,l=Pr(i),s=r.today?.(),c=(k,M)=>_a(k,{graph:o,subject:M,kinds:l,...s?{today:s}:{}}),u=t.where===void 0?void 0:Vo(t.where);if(u===null)return{count:0,ids:[]};let P=o.nodesOfKind(t.kind).filter(k=>{if(!u)return!0;try{return ds(c(u,k))}catch(M){if(!(M instanceof Dn))throw M;return!1}}),p=$n(t.sort),S=p&&p.by!=="label"?Vo(p.by):void 0,m=(p?Ba(P,p,k=>{if(p.by==="label")return oe(i.tryDefinition(k.kind),k);if(S)try{return cs(i,c(S,k))}catch(M){if(!(M instanceof Dn))throw M;return}}):P).map(k=>k.id);return{count:m.length,ids:m}}var un=O(ke(),1);var J=O(V(),1),ps=5,us=3,Jo={kind:"human"};function Yo(e){if(!e.app)return[];let t=e.principal??Jo;return Uo(jo(e.app),t).map(n=>({job:n,..._o(e.store,n,t)}))}function Qo({context:e,answered:t}){let n=t.filter(i=>i.count>0),a=t.filter(i=>i.count===0),[r,...o]=n;return(0,J.jsxs)("div",{style:{display:"grid",gap:40,maxWidth:"46rem",outline:"none"},"data-testid":"jobs",tabIndex:-1,children:[(0,J.jsx)("style",{children:ht}),r?(0,J.jsx)(zo,{context:e,answered:r,leads:!0}):null,o.map(i=>(0,J.jsx)(zo,{context:e,answered:i},i.job.name)),a.length>0?(0,J.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},"data-testid":"jobs-quiet",children:a.map(({job:i})=>(0,J.jsxs)("li",{"data-testid":"job-quiet","data-job":i.name,style:{overflowWrap:"anywhere"},children:[i.ask," ",(0,J.jsxs)("span",{style:C,children:["No ",z(e.store,i.kind).toLowerCase()," right now."]})]},i.name))}):null]})}function zo({context:e,answered:t,leads:n=!1}){let{store:a}=e,{job:r,count:o,ids:i}=t,l=i.slice(0,n?ps:us),s=z(a,r.kind),c=n?(0,J.jsx)(se,{context:e,"data-testid":"job-ask",children:r.ask}):(0,J.jsx)("h2",{style:ne,"data-testid":"job-ask",children:r.ask});return(0,J.jsxs)("section",{className:"graview-list",style:{display:"grid",gap:n?12:8,minWidth:0},"data-testid":"job","data-job":r.name,...n?{"data-leads":""}:{},children:[(0,J.jsxs)("header",{style:{display:"grid",gap:4},children:[c,(0,J.jsx)("p",{style:{...n?le:C,margin:0},"data-testid":"job-count",children:ut(a.schema,r.kind,o)})]}),(0,J.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",borderBottom:"1px solid var(--graview-edge)"},"data-testid":"job-rows",children:l.map(u=>(0,J.jsx)(gs,{context:e,job:r,id:u},u))}),(0,J.jsxs)("p",{style:{...C,margin:0,display:"flex",flexWrap:"wrap",gap:"0 12px",alignItems:"baseline"},children:[o>l.length?(0,J.jsxs)("span",{"data-testid":"job-more",children:[o-l.length," more"]}):null,(0,J.jsx)(H,{to:`/${j(a.schema,r.kind)}`,style:We,"data-testid":"job-all",children:(0,J.jsxs)(qe,{children:["All ",s.toLowerCase()]})})]})]})}function gs({context:e,job:t,id:n}){let{store:a,principal:r,invariantContext:o}=e,[i,l]=(0,un.useState)(!1),s=(0,un.useRef)(null),c=a.seenBy(r??Jo).graph.getNode(n);if(!c)return null;let u=a.schema.tryDefinition(c.kind),P=oe(u,c),p=At(c,u,P),S=t.act?on(a,n,{...r?{principal:r}:{},...o?{context:o}:{}})?.actions.affordances.find(k=>k.mutation===t.act&&k.provider!=="invariant"):void 0,R=S?a.allMutations().find(k=>k.name===S.mutation):void 0,m=`job-${t.name}-${n}`;return(0,J.jsxs)("li",{ref:s,"data-testid":"job-row","data-graview-record":n,style:{position:"relative",display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",alignItems:"center",gap:"8px 12px",minHeight:"2.75rem",padding:"8px 0",borderTop:"1px solid var(--graview-edge)"},children:[(0,J.jsxs)("span",{style:{display:"grid",gap:2,minWidth:0},children:[(0,J.jsx)(H,{to:X(a.schema,c.kind,n),className:"graview-row-title",...P.length>60?{title:P}:{},children:P}),p.length>0?(0,J.jsx)("span",{className:"graview-row-glance",children:(0,J.jsx)(Ct,{runs:p})}):null]}),S&&R?(0,J.jsx)("button",{type:"button","data-testid":"job-act","data-graview-act":S.mutation,"aria-expanded":i,"aria-controls":m,"aria-label":`${S.label}: ${P}`,onClick:()=>l(!i),style:{...fe,position:"relative",...i?{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"}:{}},children:S.label}):null,i&&S&&R?(0,J.jsx)("div",{id:m,style:{gridColumn:"1 / -1",position:"relative",display:"grid",gap:10,padding:"4px 0 8px"},children:(0,J.jsx)(Le,{store:a,mutation:R,prefilled:S.args,open:S.open,label:S.label,autoFocus:!0,onDone:()=>{let k=s.current?.closest('[data-testid="jobs"]');l(!1),requestAnimationFrame(()=>{((s.current?.isConnected?s.current.querySelector('[data-testid="job-act"]'):null)??k?.querySelector('[data-testid="job-act"]')??k)?.focus()})},...r?{principal:r}:{}})}):null]})}var I=O(V(),1);function ms({violations:e}){let t=e.some(n=>n.status==="could-not-judge"||n.status==="over-budget");return(0,I.jsxs)(H,{to:"/problems","data-testid":"problems-here","data-graview-problems-tone":t?"error":"rule",style:{..._,color:t?"var(--graview-warn)":"var(--graview-ink-muted)"},children:[e.length===1?"A rule is broken":"Rules are broken"," \u2014 see what, and what would fix it"]})}function sa({context:e}){let{principal:t}=e,{store:n,brand:a,invariantContext:r}=e;ae(n);let o=n.violations(r),i=[...n.log.all()].slice(-5).reverse(),s=an(e).map(g=>({kind:g,members:n.graph.nodesOfKind(g).filter(F=>et(n.schema.tryDefinition(g),F))})),c=s.filter(g=>g.members.length>0),u=s.map(g=>({entry:g,creator:n.allMutations().find(F=>(F.creates??[]).includes(g.kind)&&n.permits({name:F.name,args:{}},e.principal).ok)})).find(g=>g.creator!==void 0),P=c.length===0?"Nothing here yet.":`${c.map(g=>ut(n.schema,g.kind,g.members.length)).join(", ").replace(/, ([^,]*)$/," and $1")}.`,p=e.views?.homeView?.(),S=n.schema.kinds.some(g=>n.graph.nodesOfKind(g).length>0);if(p&&S){let g=[...new Set(o.flatMap(Q=>Q.nodeIds))],F=a?.subtitle&&a.subtitleDrawn!==!1?(0,I.jsx)("p",{style:{...C,margin:0},"data-testid":"app-subtitle",children:a.subtitle}):null,Y=p[Symbol.for("graview.home-blocks")]===!0;return(0,I.jsx)(ie,{context:e,style:yt,bleedTop:Ke(p),children:(0,I.jsxs)("div",{style:{display:"grid",gap:12},"data-testid":"home-view",children:[Y?null:F,(0,I.jsx)(no.Provider,{value:Y?F:null,children:(0,I.jsx)(Je,{when:Ke(p),children:(0,I.jsx)(p,{cardinality:"many",fidelity:"full",mode:"fullscreen",selected:!1,...g.length>0?{flagged:g}:{}})})})]})})}let R=new Set(Ge(n,e.principal)),m=ot(n).relations.filter(g=>R.has(g.from)&&(g.to==="*"||R.has(g.to))),k=Yo(e),M=k.some(g=>g.count>0),D=new Set([...No(e),...k.flatMap(g=>g.ids)]),x=o.filter(g=>g.nodeIds.some(F=>D.has(F))),U=c.length===0&&u!==void 0||x.length>0||o.length===0&&!M;return(0,I.jsxs)(ie,{context:e,style:yt,children:[(0,I.jsxs)("header",{style:{display:"grid",gap:12},children:[a?.subtitle&&a.subtitleDrawn!==!1?(0,I.jsx)("p",{style:{...C,margin:0},"data-testid":"app-subtitle",children:a.subtitle}):null,M?null:(0,I.jsx)(se,{context:e,"data-testid":"standing",children:P}),U?(0,I.jsxs)("p",{style:{...le,display:"grid",gap:4},"data-testid":"standing-card",children:[c.length===0&&u?(0,I.jsxs)("span",{children:["Begin with \u201C",u.creator?.title??u.creator?.name,"\u201D, under"," ",(0,I.jsx)(H,{to:`/${j(n.schema,u.entry.kind)}`,style:_,children:z(n,u.entry.kind)}),"."]}):null,o.length===0?(0,I.jsx)("span",{children:"All rules hold."}):x.length>0?(0,I.jsx)(ms,{violations:x}):null]}):null]}),k.length>0?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Qo,{context:e,answered:k}),(0,I.jsxs)("section",{style:{display:"grid",gap:20},"data-testid":"after-the-jobs",children:[M?(0,I.jsxs)("p",{style:{...C,margin:0},"data-testid":"standing",children:[P,o.length===0?" All rules hold.":""]}):null,(0,I.jsx)(ln,{context:e,small:!0})]})]}):(0,I.jsx)(ln,{context:e}),(0,I.jsxs)("section",{style:{...de,display:"grid",gap:14},"data-testid":"kinds",children:[(0,I.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[(0,I.jsx)("h2",{style:ne,children:"What is here"}),m.length>0?(0,I.jsx)(H,{to:"/map",style:{...We,...C,marginLeft:"auto"},"data-testid":"map-link",children:(0,I.jsxs)(qe,{children:["Connections \xB7 ",m.length===1?"1 relation":`${m.length} relations`]})}):null]}),(0,I.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"8px 10px"},children:s.map(({kind:g,members:F})=>(0,I.jsx)("li",{style:{maxWidth:"100%"},children:(0,I.jsxs)(H,{to:`/${j(n.schema,g)}`,style:{...ve,flexWrap:"wrap",gap:8,padding:"6px 14px 6px 10px",borderRadius:8,border:"1px solid var(--graview-edge-bright)",background:"var(--graview-panel)"},children:[(0,I.jsx)(ge,{kind:g,brand:a,schema:n.schema,size:7}),(0,I.jsx)("span",{style:{fontWeight:550,overflowWrap:"anywhere"},children:z(n,g)}),(0,I.jsx)("span",{style:{...C,fontVariantNumeric:"tabular-nums"},children:F.length===0?"none yet":kt(F.length)})]})},g))})]}),i.length>0?(0,I.jsxs)("section",{style:{...de,display:"grid",gap:10},children:[(0,I.jsx)("h2",{style:ne,children:"Recently"}),(0,I.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:i.map(g=>(0,I.jsxs)("li",{style:C,children:[(0,I.jsx)("span",{style:{color:"var(--graview-ink)"},children:g.intent})," \u2014 ",Pt(g,t,{graph:n.graph,schema:n.schema,...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{}})]},g.id))})]}):null]})}var Zo=O(ke(),1);function Xo(e,t){(0,Zo.useEffect)(()=>{let n=globalThis[Symbol.for("graview.shown-lists")]??=new Map;return n.set(e,()=>t),()=>void n.delete(e)})}var la=e=>(__graviewPreload(import.meta.url,["./chunk.AJZBJBMO.js"]),import("./chunk.6YGRRXJB.js")).then(t=>t.saveShownList(e.read()));function ei(e,t,n){let a={off:e,about:t,read:n,menu:(r,o,i)=>[...e?[]:[{id:"export-csv",label:"Export CSV",run:()=>void la(a)}],...r&&o?[{id:e?"export-on":"export-off",label:e?"Turn on export":"Turn off export",run:()=>void (__graviewPreload(import.meta.url,["./chunk.AJZBJBMO.js"]),import("./chunk.6YGRRXJB.js")).then(l=>l.switchExport(a,o,e,i))}]:[]]};return a}function da(e){let{schema:t,graph:n,kind:a,nodes:r,arrangement:o,offers:i,declaredGroup:l}=e,s=t.tryDefinition(a),c=_t(o.query??""),u=[...o.filter??[],...c.conditions],P=u.some(g=>g.key==="is"&&(g.value==="past"||g.value==="any"))||Ir(s,u),p=P||!s?.lifecycle?o:{...o,filter:[...o.filter??[],{key:"is",value:"current"}]},S=new Map,R=Jt(r,p,{schema:t,graph:n,...e.flagged?{flagged:e.flagged}:{},...e.today!==void 0?{today:e.today}:{},read:(g,F)=>{let Y=S.get(g.id);return Y||S.set(g.id,Y=nt(t,n,g)),Y[F]}}),m=R.grouped&&!!o.group?.by,k=l&&o.group?.by===l.by&&!o.group.bucket?i.groups.find(g=>g.key===l.by):void 0,M=l&&k&&(k.type==="choice"||k.type==="boolean")?Fr(R.groups,l,{type:k.type,...k.options?{options:k.options}:{}}):R.groups.map(g=>({...g,closed:!1})),D=!!o.query||(o.filter??[]).some(g=>g.key===l?.by),x=g=>k?.type==="boolean"?g==="1"?"true":"false":g,B=e.opened??new Set,U=M.map(g=>{let F=x(g.key);return{...g,value:F,shut:g.closed&&!D&&!B.has(F)}});return{arrangement:p,showingPast:P,arranged:R,grouped:m,groups:U,nodes:m?U.flatMap(g=>g.shut?[]:g.nodes):R.nodes}}var Ne=O(ke(),1);var dt=O(V(),1);function gn({context:e,withheld:t,style:n,testId:a}){let r=ce(),o=Ga(t,e.signIn??r?.signIn);return o?(0,dt.jsx)("p",{style:{...n,margin:0},children:(0,dt.jsx)("button",{type:"button","data-testid":"sign-in",onClick:()=>o.run(),style:fe,children:o.label})}):t.length===0?null:(0,dt.jsx)("ul",{style:{...n,margin:0,padding:0,listStyle:"none",display:"grid",gap:4},...a?{"data-testid":a}:{},children:t.map(i=>(0,dt.jsxs)("li",{style:C,children:[(0,dt.jsx)("s",{children:i.label})," \u2014 ",i.refusal.message]},i.id))})}var ti=O(ke(),1);var N=O(V(),1);function ca({context:e}){let{store:t,brand:n,principal:a,invariantContext:r}=e;ae(t);let[o]=wt(),i=o.get("q")??"",l=typeof r?.today=="string"?r.today:void 0,s=Vr(t,i,{...a?{principal:a}:{},places:Fe(e),flagged:new Set(t.violations(r).flatMap(m=>m.nodeIds)),...l?{today:l}:{},limit:200}),c=s.hits.filter(m=>m.about==="node"),u=s.hits.filter(m=>m.about==="kind"||m.about==="place"||m.about==="rule"),P=[...new Set(c.map(m=>m.kind))],p=i.trim(),S=p.length>=2&&s.hits.length===0,R=s.searched.kinds.length===1?s.searched.kinds[0]:void 0;return(0,ti.useEffect)(()=>{if(!S)return;let m=setTimeout(()=>qa(t,{type:"search-miss",words:p,...R?{kind:R}:{}},a),fs);return()=>clearTimeout(m)},[t,p,S,R,a]),(0,N.jsxs)(ie,{context:e,children:[(0,N.jsx)("style",{children:ht}),(0,N.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,N.jsx)("p",{style:be,children:"Search"}),(0,N.jsx)(se,{context:e,"data-testid":"search-heading",children:p.length===0?"Find anything by its name":s.hits.length===0?(0,N.jsxs)(N.Fragment,{children:["Nothing here is called \u201C",p,"\u201D."]}):(0,N.jsxs)(N.Fragment,{children:[ys(t,s.byKind)," for \u201C",p,"\u201D"]})}),p.length>0?(0,N.jsxs)("p",{style:{...C,margin:0},"data-testid":"search-searched",children:[zt(t.schema,s.searched),s.conditions.filter(m=>m.key!=="is"&&m.admittedBy.length<s.searched.kinds.length).map(m=>(0,N.jsxs)("span",{children:[" ",m.key,":",m.value," narrows"," ",m.admittedBy.length===0?"nothing here":m.admittedBy.map(k=>z(t,k).toLowerCase()).join(" and "),"."]},`${m.key}:${m.value}`))]}):(0,N.jsxs)("p",{style:le,children:["Type in the box above. Words find the start of words in names and in what each record says;"," ",(0,N.jsx)("code",{children:"done:false"})," and the like narrow as a list does, and ",(0,N.jsx)("code",{children:"is:any"})," includes what is past."]})]}),u.length>0?(0,N.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},"data-testid":"search-named",children:u.map(m=>(0,N.jsx)("li",{"data-testid":"search-hit","data-about":m.about,children:m.about==="kind"?(0,N.jsxs)(H,{to:`/${j(t.schema,m.kind)}`,style:_,children:[m.label,m.count>0?(0,N.jsxs)("span",{style:C,children:[" \xB7 ",m.count," match"]}):null]}):m.about==="place"?(0,N.jsxs)(H,{to:he(e,m),style:_,children:["Go to ",m.title]}):m.about==="rule"?(0,N.jsxs)(H,{to:"/problems",style:_,children:["The rule \u201C",m.label,"\u201D"]}):null},`${m.about}:${m.about==="rule"?m.name:m.about==="place"?m.as:m.kind}`))}):null,P.map(m=>(0,N.jsxs)("section",{className:"graview-list",style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",minWidth:0},"data-testid":"search-group","data-kind":m,children:[(0,N.jsxs)("h2",{className:"graview-group-head",style:{alignItems:"center"},children:[(0,N.jsx)(ge,{kind:m,brand:n,schema:t.schema,size:8}),(0,N.jsx)(H,{to:`/${j(t.schema,m)}?${new URLSearchParams({q:p}).toString()}`,style:_,"data-testid":"search-kind-link",children:z(t,m)}),(0,N.jsx)("span",{children:s.byKind[m]})]}),(0,N.jsx)("ul",{className:"graview-rows",children:c.filter(k=>k.kind===m).map(k=>(0,N.jsxs)("li",{"data-testid":"search-hit","data-about":"node",className:"graview-row",children:[(0,N.jsxs)(H,{to:X(t.schema,m,k.id),className:"graview-row-title",...k.label.length>60?{title:k.label}:{},children:[k.flagged?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("span",{role:"img","aria-label":"Breaks a rule:",style:{color:"var(--graview-warn)"},children:"\u26A0"})," "]}):null,k.label]}),k.apart||!k.current?(0,N.jsx)("span",{className:"graview-row-glance",children:[k.apart,k.current?"":"past"].filter(Boolean).join(" \xB7 ")}):null,(0,N.jsx)(mn,{why:k.why})]},k.id))})]},m)),p.length>0?(0,N.jsx)(hs,{asked:p}):null,p.length>0&&s.hits.length===0?(0,N.jsx)(ai,{store:t,kinds:s.searched.kinds,words:s.words,...a?{principal:a}:{},...r?{invariantContext:r}:{}}):null]})}var fs=1500;function mn({why:e}){return e.strength==="near"?(0,N.jsxs)("span",{style:C,"data-testid":"search-why","data-near":"",children:["Near \u201C",e.asked,"\u201D",e.field==="label"?"":` \u2014 ${e.reading}: ${e.fragment}`]}):e.field==="label"?null:(0,N.jsxs)("span",{style:C,"data-testid":"search-why",children:[e.reading,": ",e.fragment]})}function ys(e,t){let n=Object.entries(t).map(([a,r])=>`${r} ${r===1?tt(e.schema.tryDefinition(a),a):z(e,a).toLowerCase()}`);return n.length===0?"Found":n.length===1?Te(n[0]):Te(`${n.slice(0,-1).join(", ")} and ${n[n.length-1]}`)}function ni(e,t,n={}){let a=[];for(let r of t){let o=rt(e,r,{...n.principal?{principal:n.principal}:{},...n.invariantContext?{context:n.invariantContext}:{}});for(let i of fn(e,r,o.actions.affordances))a.some(l=>l.mutation.name===i.mutation.name)||a.push(i)}return a}function fn(e,t,n){let a=e.schema.tryDefinition(t)?.fieldRoles?.label,r=[];for(let o of n){let i=e.allMutations().find(c=>c.name===o.mutation);if(!i||!i.creates?.includes(t)||r.some(c=>c.mutation.name===i.name))continue;let l=Or(i.input).map(c=>c.name),s=l.includes("label")?"label":a&&l.includes(a)?a:void 0;!s||o.args[s]!==void 0||r.push({kind:t,affordance:o,mutation:i,arg:s})}return r}function ai({store:e,kinds:t,words:n,principal:a,invariantContext:r}){let o=ni(e,t,{...a?{principal:a}:{},...r?{invariantContext:r}:{}});return o.length===0||n.trim().length===0?null:(0,N.jsx)("div",{style:{display:"grid",gap:24},"data-testid":"search-to-create",children:o.map(({kind:i,affordance:l,mutation:s,arg:c})=>(0,N.jsxs)("section",{style:{...de,display:"grid",gap:14},children:[(0,N.jsxs)("h2",{style:ne,children:[Te(Na(tt(e.schema.tryDefinition(i),i)))," called \u201C",n,"\u201D"]}),(0,N.jsx)(Le,{store:e,mutation:s,prefilled:l.args,open:l.open,initial:{[c]:n},...a?{principal:a}:{}})]},`${l.id}|${n}`))})}function hs({asked:e}){let t=ce();return t?(0,N.jsx)(ws,{asked:e,desk:t.aiDesk}):null}function ws({asked:e,desk:t}){return dr(t)?(0,N.jsx)("p",{style:{margin:0},children:(0,N.jsxs)("button",{type:"button","data-testid":"search-ask",onClick:a=>lr(t,{pointed:{about:[]},asked:e,returnTo:a.currentTarget}),style:{..._,font:"inherit",padding:0,border:0,background:"transparent",cursor:"pointer",textAlign:"start"},children:["Ask: \u2018",e,"\u2019"]})}):null}var y=O(V(),1),oi=8,ii=40;function Ss(e,t){let n=t?.fields?.shape??{},a=Object.keys(n).find(r=>$a(n[r])&&Oa(e[r]));return a===void 0?void 0:e[a]}function pa({context:e}){let t=ze(),n=xe(e.store.schema,t.slug??"");if(!n)return(0,y.jsx)(ie,{context:e,children:(0,y.jsx)(se,{context:e,children:"No such kind of thing here."})});let a=e.views?.lookup(n,{cardinality:"many",fidelity:"full"});return a!==void 0&&mt(a)?(0,y.jsx)(bs,{context:e,kind:n,view:a}):(0,y.jsx)(si,{context:e,kind:n})}function bs({context:e,kind:t,view:n}){let{store:a,invariantContext:r}=e;ae(a);let o=a.schema.tryDefinition(t),i=z(a,t),l=a.graph.nodesOfKind(t).filter(c=>et(o,c)),s=[...new Set(a.violations(r).flatMap(c=>c.nodeIds))];return(0,y.jsxs)(ie,{context:e,children:[(0,y.jsxs)("header",{style:{display:"grid",gap:4},children:[(0,y.jsx)(it,{context:e}),(0,y.jsx)(se,{context:e,children:i})]}),(0,y.jsx)("section",{"data-testid":"list-view",style:{display:"grid",minWidth:0},children:(0,y.jsx)(xt,{kind:t,view:i,children:(0,y.jsx)(Je,{when:Ke(n),children:(0,y.jsx)(n,{nodes:l,label:i,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1,...s.length>0?{flagged:s}:{}})})})})]})}function si({context:e,kind:t,opening:n,row:a,layout:r="list",description:o,bare:i}){let{store:l,brand:s,invariantContext:c}=e;ae(l);let[u,P]=wt(),p=`list-${(0,Ne.useId)().replace(/:/g,"")}`,S=l.schema.tryDefinition(t),R=Fa(u.get("archived")),m=l.graph.nodesOfKind(t,{archived:R}),k=ot(l).relations.filter(d=>d.from===t||d.to===t),M=new Set(l.violations(c).flatMap(d=>d.nodeIds)),D=Gr(l.schema,Wr(l.schema,Dr(l.schema,t))),x=k.map(d=>d.edgeKind),B=Cs(u,D,x),U=["sort","filter","group","q","by","with","past","archived",...x].some(d=>u.has(d)),g=m.length>=ii,F=S?.fieldRoles?.when,Y=e.views?.arrangement?.()?.lists?.[t],Q=Hr(Y),Oe=$r(Y?.group),Ce=As(g,F),Se=n??(Q?{...Ce,...Q}:Ce),Re=U?B.arrangement:jn(Se,D).arrangement,b=Q?.sort,w=Re.sort&&b?.then&&Re.sort.by===b.by&&Re.sort.direction===b.direction?{...Re,sort:b}:Re,T=_t(w.query??""),$=new Set((u.get("open")??"").split(",").filter(Boolean)),ee=da({schema:l.schema,graph:l.graph,kind:t,nodes:m,arrangement:w,offers:D,declaredGroup:Oe,flagged:M,...typeof c?.today=="string"?{today:c.today}:{},opened:$}),{showingPast:te,arranged:f}=ee,E=ee.groups,Z=ce(),pe=ei(Y?.export===!1,{kind:t},()=>({title:z(l,t),schema:l.schema,graph:l.graph,kind:t,groups:ee.groups,grouped:ee.grouped,onExport:e.onExport??Z?.onExport,words:{labelOf:oe,readableFields:jt,withComputed:nt}}));Xo(`list:${t}`,pe);let mi=d=>d.shut,fi=d=>{let h=new URLSearchParams(u),W=new Set($);W.has(d)?W.delete(d):W.add(d),W.size>0?h.set("open",[...W].join(",")):h.delete("open"),P(h,{replace:!0})},$e=f.nodes,Qe=S?.lifecycle&&!te?m.filter(d=>et(S,d)):m,fa=m.length-Qe.length,ya=w.group?.by??null,yi=d=>{let h=new URLSearchParams(u);for(let ue of["sort","filter","group","q","by","with","past","archived",...k.map(It=>It.edgeKind)])h.delete(ue);let W=jr(d);for(let ue of["sort","filter","group","q","archived"])W[ue]&&h.set(ue,W[ue]);![...h.keys()].some(ue=>["sort","filter","group","q"].includes(ue))&&(n||Q||g||F)&&h.set("sort",""),P(h)},{principal:ct}=e,Sn=rt(l,t,{...ct?{principal:ct}:{},...e.invariantContext?{context:e.invariantContext}:{}}),Be=Sn.actions.affordances.map(d=>({affordance:d,mutation:l.allMutations().find(h=>h.name===d.mutation)})).filter(d=>d.mutation!==void 0),hi=Sn.actions.withheld,bn=()=>new Set($e.length===0?Be.map(({mutation:d})=>d.name):[]),[vn,ha]=(0,Ne.useState)(()=>({kind:t,open:bn()}));vn.kind!==t&&ha({kind:t,open:bn()});let wa=d=>(vn.kind===t?vn.open:bn()).has(d),Sa=(d,h)=>ha(W=>{let ue=new Set(W.open);return h?ue.add(d):ue.delete(d),{kind:W.kind,open:ue}}),ba=`begin-${(0,Ne.useId)().replace(/:/g,"")}`,va=T.words&&$e.length===0?Object.fromEntries(fn(l,t,Sn.actions.affordances).map(d=>[d.mutation.name,d.arg])):{},Ze=z(l,t),Nt=e.views?.lookup(t,{cardinality:"one",fidelity:"glyph"}),kn=Nt!==void 0&&!gt(Nt)?Nt:void 0,xn=(w.group?.bucket??"day")==="day"?w.group?.by:void 0,Pn=(w.filter??[]).map(d=>d.key),wi=Pn.filter(d=>Pn.indexOf(d)===Pn.lastIndexOf(d)&&/choice|boolean/.test(D.filters.find(h=>h.key===d)?.type??"")),An=d=>{let h={...S?.computed?nt(l.schema,l.graph,d):d};xn&&!String(h[xn]).includes("T")&&delete h[xn];for(let W of wi)delete h[W];return h},ka=d=>Sr(S?.fields?.shape?.[d])?.type==="enum",Ot=d=>{let h=oe(S,d);if(a)return(0,y.jsxs)("li",{"data-testid":"record-row","data-graview-record":d.id,style:{minWidth:0},...Mn(d.id),children:[En(d,h),a(d,{label:h,href:X(l.schema,t,d.id),flagged:M.has(d.id),glance:So(An(d),S,h)})]},d.id);if(kn){let Nn=Xt(Nt,d,l.graph),Pi=Object.fromEntries(Object.entries(An(d)).filter(([Ai])=>!Nn?.fields.has(Ai))),La=Nn?At(Pi,S,Nn.title??h,ka):[];return(0,y.jsxs)("li",{"data-testid":"record-row","data-graview-record":d.id,style:{position:"relative",display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:16,rowGap:2,paddingBlock:10,borderTop:"1px solid var(--graview-edge)"},...Mn(d.id),children:[En(d,h),(0,y.jsx)("div",{style:{flex:"1 1 14rem",minWidth:0},children:(0,y.jsx)(kn,{node:d,cardinality:"one",fidelity:"glyph",mode:"fullscreen",selected:!1,...M.has(d.id)?{flagged:[d.id]}:{}})}),La.length>0?(0,y.jsx)("span",{style:{...C,flex:"0 1 auto",minWidth:0,overflowWrap:"anywhere"},"data-testid":"record-glance",children:(0,y.jsx)(Ct,{runs:La})}):null,(0,y.jsx)(Ts,{to:X(l.schema,t,d.id),label:M.has(d.id)?`${h} \u2014 implicated in a problem`:h})]},d.id)}let W=At(An(d),S,h,ka),ue=W.length>0,It=T.words?qr(S,d,T.words):void 0,Ca=g?void 0:vr(d,S),Dt=Ss(d,S),Ra=(0,y.jsxs)(H,{to:X(l.schema,t,d.id),className:"graview-row-title",...h.length>60?{title:h}:{},children:[M.has(d.id)?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("span",{role:"img","aria-label":"Breaks a rule:",style:{color:"var(--graview-warn)"},children:"\u26A0"})," "]}):null,h]});return(0,y.jsxs)("li",{className:"graview-row","data-graview-record":d.id,...Mn(d.id),children:[En(d,h),Ca?(0,y.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,minWidth:0},children:[(0,y.jsx)(ft,{as:"thumb",file:Ca}),Ra]}):Ra,ue||Dt?(0,y.jsxs)("span",{className:"graview-row-glance",children:[(0,y.jsx)(Ct,{runs:W}),ue&&Dt?" \xB7 ":null,Dt?(0,y.jsx)(Yt,{address:Dt}):null]}):null,It?(0,y.jsx)(mn,{why:It}):null]},d.id)},Cn=Fe(e).filter(d=>d.kind===t&&!d.hidden),xa=Y?.filters,Si=(w.filter??[]).some(d=>d.key!=="is"||d.value!=="any"),bi=!!(w.sort||w.group||w.query||Si),vi=Qe.length>=oi||U&&bi,Ie=w.sort?D.sorts.find(d=>d.key===w.sort.by):void 0,Rn=Ie?.type==="date"||Ie!==void 0&&Ie.key===F,Pa=g&&!f.grouped&&Ie&&(Ie.about==="label"||Ie.type==="text"||Rn)?d=>{let h=Ie.about==="label"?oe(S,d):d[Ie.key];if(typeof h!="string"||h.length===0)return Rn?"No date":"#";if(Rn)return h.slice(0,4);let W=h.trim().charAt(0).toLocaleUpperCase();return/\p{L}/u.test(W)?W:"#"}:void 0,$t=Pa?$e.reduce((d,h)=>{let W=Pa(h);return d.at(-1)?.key===W?d.at(-1).nodes.push(h):d.push({key:W,nodes:[h]}),d},[]):void 0,Aa=ee.nodes,Ln=(0,Ne.useMemo)(()=>Aa.map(d=>d.id),[Aa.map(d=>d.id).join(`
6
- `)]),He=Yr(Ln),Tn=(0,Ne.useId)(),bt=(ct?l.permittedMutations(ct):l.permittedMutations()).some(d=>{let h=d.subject?.kinds;return h!==void 0&&(h==="*"||h.includes(t))}),En=(d,h)=>bt?(0,y.jsx)("span",{className:"graview-choose-at",children:(0,y.jsx)("input",{...He.boxProps(d.id,h),onPointerEnter:Un,onFocus:Un})}):null,Mn=d=>bt?{"data-graview-choose":d}:{},ki=(0,Ne.useCallback)(d=>{He.choose(d),requestAnimationFrame(()=>{let h=He.list.current;((d[0]===void 0?null:h?.querySelector(`[data-graview-choose-box="${CSS.escape(d[0])}"]`))??h)?.focus({preventScroll:!0})})},[He]),pt=r==="grid"?{margin:0,padding:0,listStyle:"none",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 15rem), 1fr))",alignItems:"start",gap:12}:a||kn?{margin:0,padding:0,listStyle:"none",display:"grid",gap:a&&r==="list"?6:0}:void 0,Ht=pt?void 0:"graview-rows",vt=d=>`list-at-${d.replace(/[^\p{L}\p{N}]/gu,"_")}`,Ft=k.map(d=>{let h=d.from===t?d.to:d.from,W=d.from===t?d.description:d.inverse??d.description;return{relation:d,far:h,words:W}}),xi=new Set(Ft.map(d=>(d.words??"").toLowerCase()).filter((d,h,W)=>d&&W.indexOf(d)!==h));return(0,y.jsxs)(i?Ps:ie,{context:e,children:[(0,y.jsxs)("div",{style:{display:"grid",gap:12},children:[(0,y.jsxs)("header",{style:{display:"grid",gap:4},children:[i?null:(0,y.jsx)(it,{context:e}),(0,y.jsxs)("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",columnGap:10,rowGap:4,minWidth:0},children:[(0,y.jsx)(ge,{kind:t,brand:s,schema:l.schema,size:8}),(0,y.jsx)(se,{context:e,children:Ze}),Be.length>0?(0,y.jsx)("span",{style:{marginLeft:"auto",display:"flex",flexWrap:"wrap",columnGap:14,rowGap:8},"data-testid":"beginnings-open",children:Be.map(({affordance:d,mutation:h})=>(0,y.jsx)(Rs,{name:h.name,title:h.title??h.name,panel:`${ba}-${h.name}`,open:wa(h.name),onOpen:W=>Sa(h.name,W)},d.id))}):null,!pe.off&&Qe.length>0?(0,y.jsxs)("button",{type:"button","data-testid":"list-export","aria-label":"Export CSV",title:"Export CSV",onClick:()=>void la(pe),style:{...ve,minHeight:28,margin:"-4px 0",...Be.length>0?{}:{marginLeft:"auto"},padding:"0 2px",border:0,background:"none",font:"inherit",color:"var(--graview-ink-muted)",cursor:"pointer"},children:[(0,y.jsx)("span",{"aria-hidden":"true",style:{marginRight:4},children:"\u2193"}),"CSV"]}):null]}),$e.length>0?(0,y.jsx)(yo,{place:"here",to:[{label:`Skip to the ${$e.length===1?tt(S,t):`${$e.length} ${Ze.toLowerCase()}`}`,testid:"records",go:()=>{let d=document.querySelector(`[data-graview-skip-target="${CSS.escape(Tn)}"]`);_n(d?.querySelector('[data-graview-choose-box][tabindex="0"]')??d)}},...Qe.length>0?[{label:"Skip to arranging them",testid:"arranging",go:()=>{let d=document.querySelector(`[data-graview-skip-target="${CSS.escape(Tn)}"]`)?.parentElement?.querySelector('[role="group"][aria-label="Arrange"]');_n(d?.querySelector('button[data-testid$="-add"], button[data-testid$="-all"]')??d)}}]:[]]}):null,o??S?.description?(0,y.jsx)("p",{style:le,children:o??S?.description}):null,Ft.length>0||Cn.length>0?(0,y.jsxs)("p",{style:{...C,margin:0,display:"flex",flexWrap:"wrap",columnGap:18,rowGap:2},"data-testid":"kind-related",children:[Ft.length>0?(0,y.jsxs)("span",{"data-testid":"kind-relations",children:["Related:"," ",Ft.map(({relation:d,far:h,words:W},ue)=>(0,y.jsxs)("span",{"data-relation":d.edgeKind,children:[ue>0?(0,y.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,h==="*"?Te(W??Xe(d.edgeKind)):(0,y.jsx)(H,{to:`/${j(l.schema,h)}`,style:_,title:z(l,h),children:W&&xi.has(W.toLowerCase())?`${Te(W)}: ${z(l,h).toLowerCase()}`:Te(W??z(l,h))})]},`${d.edgeKind}|${d.from}|${d.to}`))]}):null,Cn.length>0?(0,y.jsxs)("span",{"data-testid":"kind-pictures",children:["Also as:"," ",Cn.map((d,h)=>(0,y.jsxs)("span",{children:[h>0?(0,y.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,(0,y.jsx)(H,{to:he(e,d),style:_,children:d.title})]},st(d)))]}):null]}):null]}),Be.length>0?(0,y.jsx)("div",{style:{display:"contents"},"data-testid":"beginnings",children:Be.map(({affordance:d,mutation:h})=>{let W=!!(va[h.name]&&$e.length===0);return(0,y.jsx)(Ls,{name:h.name,id:`${ba}-${h.name}`,description:h.description,open:wa(h.name),onClose:()=>Sa(h.name,!1),children:(0,y.jsx)(Le,{store:l,mutation:h,prefilled:d.args,open:d.open,...W?{initial:{[va[h.name]]:T.words}}:{},...e.principal?{principal:e.principal}:{}},W?`${h.name}|${T.words}`:h.name)},d.id)})}):null,B.dropped.length>0?(0,y.jsxs)("p",{style:{...C,margin:0},"data-testid":"list-dropped",children:["This link asked for ",B.dropped.join(", "),", which ",Ze.toLowerCase()," cannot be arranged by; the rest is shown."]}):null,Qe.length>0?(0,y.jsx)(zr,{schema:l.schema,graph:l.graph,kind:t,arrangement:w,onChange:yi,kept:{shown:$e.length,of:Qe.length},noun:{one:tt(S,t),many:Ze.toLowerCase()},...vi?{}:{allow:!1},...xa?{filters:xa}:{},offers:D,chips:{nodes:Qe,flagged:M,...typeof c?.today=="string"?{today:c.today}:{}},query:e.framed===!0&&e.barAbove!==!0}):null,(0,y.jsx)("style",{children:ht}),bt?(0,y.jsx)("style",{children:Qr+xs}):null,(0,y.jsx)("div",{className:"graview-list","data-graview-skip-target":Tn,...bt?{...He.listProps,ref:He.list,tabIndex:-1,"data-graview-choosable":"","aria-label":He.chosen.length>0?`${Ze}, ${He.chosen.length} chosen`:Ze,role:"group"}:{},children:$e.length===0&&T.words?(0,y.jsxs)("p",{style:le,"data-testid":"none-yet",children:["Nothing here is called \u201C",T.words,"\u201D."," ",(0,y.jsx)("span",{style:C,"data-testid":"list-searched",children:zt(l.schema,{kinds:[t],past:te})})," ",(0,y.jsx)(H,{to:"?",style:_,children:"Show every one"})]}):$e.length===0?(0,y.jsxs)("p",{style:le,"data-testid":"none-yet",children:[w.filter?.length||w.query?"None of them.":"None yet",!w.filter?.length&&!w.query&&Be.length>0?` \u2014 the first one starts above, with \u201C${Be[0]?.mutation.title??Be[0]?.mutation.name}\u201D.`:!w.filter?.length&&!w.query?".":"",w.filter?.length||w.query?(0,y.jsxs)(y.Fragment,{children:[" ",(0,y.jsx)(H,{to:"?",style:_,children:"Show every one"})]}):null]}):f.grouped&&ya?(0,y.jsx)("div",{style:{display:"grid",gap:"1rem"},"data-testid":"records","data-grouped":ya,children:E.map(d=>{if(!d.closed)return(0,y.jsxs)("section",{style:{display:"grid",gap:0},"data-testid":"list-group",children:[(0,y.jsxs)("h2",{className:"graview-group-head",children:[d.label," ",(0,y.jsx)("span",{children:d.nodes.length})]}),(0,y.jsx)("ul",{style:pt,className:Ht,"data-graview-rows":"",children:d.nodes.map(Ot)})]},d.key||"-");let h=mi(d),W=`${p}-${vt(d.key||"none")}`;return(0,y.jsxs)("section",{style:{display:"grid",gap:0},"data-testid":"list-group","data-closed":h?"shut":"open",children:[(0,y.jsx)("h2",{className:"graview-group-head",children:(0,y.jsxs)("button",{type:"button",className:"graview-group-toggle","aria-expanded":!h,"aria-controls":W,"data-testid":"list-group-toggle",onClick:()=>fi(d.value),children:[(0,y.jsx)("span",{"aria-hidden":"true",children:h?"\u25B8":"\u25BE"}),d.label," ",(0,y.jsxs)("span",{children:["\xB7 ",d.nodes.length]}),(0,y.jsxs)("span",{style:vs,children:[" ",d.nodes.length===1?tt(S,t):Ze.toLowerCase()]})]})}),(0,y.jsx)("ul",{id:W,style:h?{...pt,display:"none"}:pt,className:Ht,"data-graview-rows":"",hidden:h,children:h?null:d.nodes.map(Ot)})]},d.key||"-")})}):$t&&$t.length>1?(0,y.jsxs)("div",{style:{display:"grid",gap:14},"data-testid":"records","data-sectioned":Ie?.type==="date"?"year":"letter",children:[(0,y.jsx)("nav",{"aria-label":"Jump to","data-testid":"list-index",style:{...C,display:"flex",flexWrap:"wrap",gap:Ie?.type==="date"?"0 10px":"0 4px",lineHeight:1.3},children:$t.map(d=>(0,y.jsx)("a",{href:`#${vt(d.key)}`,onClick:h=>{h.preventDefault(),document.getElementById(vt(d.key))?.scrollIntoView({block:"start"})},style:{...ve,minWidth:24,justifyContent:"center"},children:d.key},d.key))}),$t.map(d=>(0,y.jsxs)("section",{"data-testid":"list-section","aria-labelledby":vt(d.key),style:{display:"grid",gap:0},children:[(0,y.jsx)("h2",{id:vt(d.key),className:"graview-group-head",children:d.key}),(0,y.jsx)("ul",{style:pt,className:Ht,"data-graview-rows":"",children:d.nodes.map(Ot)})]},d.key))]}):(0,y.jsx)("ul",{style:pt,className:Ht,"data-testid":"records","data-graview-rows":"",children:$e.map(Ot)})}),bt?(0,y.jsx)(Zr,{store:l,chosen:He.chosen,...ct?{principal:ct}:{},...c?{context:c}:{},anchor:ks,of:Ln.length,onChooseAll:()=>He.choose(Ln),onClear:He.clear,onActed:ki}):null,fa>0?(0,y.jsxs)(H,{to:ri(u,"filter","is:any"),style:{..._,...C,justifySelf:"start"},"data-testid":"past-link",children:["+",fa," past"]}):null,R===!1&&l.graph.count(t,{archived:!0})>0?(0,y.jsxs)(H,{to:ri(u,"archived","true"),style:{..._,...C,justifySelf:"start"},"data-testid":"archived-link",children:["+",l.graph.count(t,{archived:!0})," archived"]}):null]}),(0,y.jsx)(gn,{context:e,withheld:hi,style:de,testId:"withheld"})]})}var vs={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},ks=()=>document.querySelector("[data-graview-choosable]")?.closest("[data-embed-content]")??null,xs=`
7
- .graview-list[data-graview-choosable]{outline:none}
8
- .graview-list [data-graview-choose]{position:relative;padding-left:34px}
9
- .graview-choose-at{position:absolute;left:2px;top:0;bottom:0;z-index:${Ka.raised};display:flex;align-items:center}
10
- @media (min-width: 900px) and (pointer: fine){
11
- .graview-list [data-graview-choose]{padding-left:0}
12
- .graview-choose-at{left:-34px}
13
- }
14
- @media (pointer: coarse){
15
- .graview-list:not([data-graview-choosing]) [data-graview-choose]{padding-left:0}
16
- .graview-list:not([data-graview-choosing]) .graview-choose-at{display:none}
17
- }
18
- `;function Ps({children:e}){return(0,y.jsx)("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:40,minWidth:0},children:e})}var As=(e,t)=>t?{sort:{by:t,direction:"desc"}}:e?{sort:{by:"label",direction:"asc"}}:{};function Cs(e,t,n){let a=Bt({...e.get("sort")?{sort:e.get("sort")}:{},...e.get("filter")?{filter:e.get("filter")}:{},...e.get("group")?{group:e.get("group")}:{},...e.get("q")?{q:e.get("q")}:{},...e.get("archived")?{archived:e.get("archived")}:{}}),r=[...a.filter??[]],o=e.get("by"),i=a.group??(o?{by:o}:void 0);for(let s of n){let c=e.get(s);c&&r.push({key:s,value:c})}let l=e.get("with");return l&&r.push({key:l,value:"*"}),e.get("past")==="1"&&!r.some(s=>s.key==="is")&&r.push({key:"is",value:"any"}),jn({...a.sort?{sort:a.sort}:{},...a.query?{query:a.query}:{},...r.length>0?{filter:r}:{},...i?{group:i}:{},...a.archived!==void 0?{archived:a.archived}:{}},t)}function ri(e,t,n){let a=new URLSearchParams(e);return a.set(t,n),a.delete("past"),`?${a.toString()}`}function Rs({name:e,title:t,panel:n,open:a,onOpen:r}){return(0,y.jsxs)("button",{type:"button","data-testid":`act-open-${e}`,"data-graview-act":e,"aria-expanded":a,"aria-controls":n,onClick:()=>{r(!a),a||requestAnimationFrame(()=>document.getElementById(n)?.querySelector("input, select, textarea, button")?.focus())},style:{...ve,minHeight:28,margin:"-4px 0",padding:"0 2px",border:0,background:"none",font:"inherit",fontWeight:600,color:"var(--graview-ink)",cursor:"pointer"},children:[(0,y.jsx)("span",{"aria-hidden":"true",style:{marginRight:6},children:a?"\u2212":"+"}),t]})}function Ls({name:e,id:t,description:n,open:a,onClose:r,children:o}){return(0,y.jsxs)("div",{"data-testid":`act-${e}`,id:t,hidden:!a,onKeyDown:i=>{i.key==="Escape"&&(i.preventDefault(),r(),document.querySelector(`[aria-controls="${t}"]`)?.focus())},style:a?{display:"grid",gap:12,padding:"4px 0 12px"}:void 0,children:[n?(0,y.jsx)("p",{style:{...C,margin:0,maxWidth:"58ch"},children:n}):null,o]})}function Ts({to:e,label:t}){let n=(0,Ne.useRef)(null);return Xr(n),(0,y.jsx)(H,{ref:n,to:e,"aria-label":t,style:{position:"absolute",inset:0,borderRadius:6}})}var Ue=O(ke(),1);var Mt=O(ke(),1);var G=O(V(),1);function ua({context:e}){let{store:t,brand:n,invariantContext:a,principal:r}=e;ae(t);let o=t.violations(a),i=t.allInvariants(),l=qt(t,o),s=cr(t.schema,i);return(0,G.jsxs)(ie,{context:e,children:[(0,G.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,G.jsx)(se,{context:e,children:o.length===0?"All rules hold":"What is broken"}),(0,G.jsx)("p",{style:le,"data-testid":"problems-count",children:o.length===0?"Every declared rule is satisfied by what is here.":Ia(o)})]}),(0,G.jsx)(qo,{context:e}),l.map((c,u)=>{let P=c.nodeIds[0],p=P?t.graph.getNode(P):void 0;return(0,G.jsxs)("section",{style:{display:"grid",gap:10,padding:"16px 18px",borderLeft:"3px solid var(--graview-warn)",background:"var(--graview-panel-warning)",borderRadius:"0 var(--graview-radius, 12px) var(--graview-radius, 12px) 0"},children:[c.line?null:(0,G.jsx)(yn,{violation:c,schema:t.schema,...n?{brand:n}:{}}),p?(0,G.jsxs)("p",{style:{margin:0,display:"inline-flex",alignItems:"center",gap:8},children:[(0,G.jsx)(ge,{kind:p.kind,brand:n,schema:t.schema,size:7}),(0,G.jsx)(H,{to:X(t.schema,p.kind,p.id),style:_,children:oe(t.schema.tryDefinition(p.kind),p)})]}):null,c.line?(0,G.jsx)(yn,{violation:c,schema:t.schema,...n?{brand:n}:{}}):null,(0,G.jsx)(hn,{store:t,repairs:c.repairs,...r?{principal:r}:{}})]},u)}),i.length>0?(0,G.jsxs)("section",{style:{...de,display:"grid",gap:12},"data-testid":"rules",children:[(0,G.jsx)("h2",{style:ne,children:"The rules"}),(0,G.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:i.map(c=>{let u=o.filter(S=>S.invariant===c.name).length,P=s.get(c.name),p=c.label??c.name;return(0,G.jsxs)("li",{"data-graview-rule":c.name,style:{display:"grid",gap:2},children:[(0,G.jsxs)("span",{style:{display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:12,rowGap:2},children:[P?(0,G.jsx)(Vt,{line:P,schema:t.schema,...n?{brand:n}:{},style:{flex:"1 1 18rem"}}):(0,G.jsx)("span",{style:{flex:"1 1 18rem",fontWeight:550},children:p}),(0,G.jsx)("span",{style:{...C,color:u>0?"var(--graview-warn)":"var(--graview-ink-faint)"},children:u===0?"holds":`broken in ${u} ${u===1?"place":"places"}`})]}),P&&p.trim().length>0?(0,G.jsx)("span",{style:C,children:p}):null]},c.name)})})]}):null]})}function yn({violation:e,schema:t,brand:n}){if(!e.line)return(0,G.jsx)("p",{style:{margin:0,color:"var(--graview-warn)",fontWeight:550},children:e.message});let a=ur(e),r=pr(e);return r?(0,G.jsxs)("div",{style:{display:"grid",gap:4},"data-testid":"problem-line",children:[(0,G.jsx)("p",{style:{margin:0,color:"var(--graview-warn)",fontWeight:550},"data-testid":"problem-says",children:r}),a?(0,G.jsx)("span",{style:C,children:a}):null,(0,G.jsxs)("details",{"data-testid":"problem-judged",style:C,children:[(0,G.jsx)("summary",{style:{cursor:"pointer",width:"fit-content",minHeight:24},children:"How it is judged"}),(0,G.jsx)(Vt,{line:e.line,schema:t,...n?{brand:n}:{},lead:"none"})]})]}):(0,G.jsxs)("div",{style:{display:"grid",gap:2},"data-testid":"problem-line",children:[(0,G.jsx)(Vt,{line:e.line,schema:t,...n?{brand:n}:{},lead:"none",style:{color:"var(--graview-warn)"}}),a?(0,G.jsx)("span",{style:C,children:a}):null]})}function hn({store:e,repairs:t,principal:n}){let[a,r]=(0,Mt.useState)(null),[o,i]=(0,Mt.useState)(null),l=(0,Mt.useRef)([]);if(t.length===0)return null;let s=a===null?null:t[a],c=s&&(s.missing??[]).length>0?e.allMutations().find(u=>u.name===s.mutation):void 0;return(0,G.jsxs)("div",{style:{display:"grid",gap:10},"data-testid":"repairs",children:[(0,G.jsx)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:t.map((u,P)=>{let p=(u.missing??[]).length>0,S=e.permits({name:u.mutation,args:{...u.args}},n);return S.ok?(0,G.jsx)("button",{ref:R=>{l.current[P]=R},type:"button","data-graview-repair":u.mutation,"data-graview-asks":p||void 0,"aria-expanded":p?a===P:void 0,onClick:()=>{if(i(null),p){r(a===P?null:P);return}r(null);try{e.apply({name:u.mutation,args:{...u.args}},n?{author:n}:{})}catch(R){i(Ut(e.schema,e.allMutations(),R))}},style:fe,children:p?`${u.label} \u2026`:u.label},P):(0,G.jsxs)("p",{"data-testid":"withheld","data-withheld":S.refusal.wouldNeed.join(",")||"nobody",style:{...C,margin:0},children:[(0,G.jsx)("s",{children:u.label})," \u2014 ",S.refusal.message]},P)})}),c&&s?(0,G.jsx)(Le,{store:e,mutation:c,prefilled:{...s.args},only:s.missing??[],label:s.label,autoFocus:!0,onDone:()=>{let u=a;r(null),requestAnimationFrame(()=>{let P=u===null?null:l.current[u];if(P?.isConnected){P.focus();return}let p=document.querySelector("[data-graview-page-title]")??document.querySelector("main h1, main h2");p&&(p.hasAttribute("tabindex")||(p.tabIndex=-1),p.focus())})},...n?{principal:n}:{}}):null,s&&!c&&(s.missing??[]).length>0?(0,G.jsxs)("p",{"data-testid":"refused",role:"alert",style:{margin:0,color:"var(--graview-warn)",fontSize:zn},children:["\u201C",s.label,"\u201D names ",s.mutation,", which this app does not declare."]}):null,o?(0,G.jsx)("p",{"data-testid":"refused",role:"alert",style:{margin:0,color:"var(--graview-warn)",fontSize:zn},children:o}):null]})}var ga=O(ke(),1);var Ye=O(V(),1);function li({store:e,link:t,principal:n}){let[a,r]=(0,ga.useState)(!1),[o,i]=(0,ga.useState)(null),l=yr(t);return(0,Ye.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[(0,Ye.jsx)("button",{type:"button","data-graview-provisional":"",title:l,"aria-label":`Unsure link: ${l}`,"aria-expanded":a,onClick:()=>r(!a),style:{border:"1px dashed var(--graview-ink-muted)",borderRadius:999,background:"transparent",color:"var(--graview-ink-muted)",font:"inherit",fontSize:"0.75rem",lineHeight:1,padding:"2px 6px",cursor:"pointer"},children:"unsure"}),a?(0,Ye.jsxs)("span",{style:{...C,display:"inline-flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,Ye.jsx)("span",{children:l}),(0,Ye.jsx)("button",{type:"button",style:{...fe,padding:"4px 10px"},onClick:()=>{try{e.apply({name:Da,args:{kind:t.edge.kind,from:t.edge.from,to:t.edge.to}},n?{author:n}:{}),r(!1)}catch(s){i(Ut(e.schema,e.allMutations(),s))}},children:"Keep this link"}),o?(0,Ye.jsx)("span",{role:"alert",children:o}):null]}):null]})}var we=O(V(),1);function di({nodeId:e,node:t,field:n,inPlace:a,labelStyle:r=be}){return n.files?(0,we.jsx)(ft,{as:"field",read:!a,nodeId:e,field:n.key,label:n.label,files:n.files,labelStyle:r,style:{gap:4}}):n.long?(0,we.jsx)(_r,{nodeId:e,field:n.key,label:n.label,value:n.value,markdown:n.markdown,style:{gridColumn:"1 / -1",gap:4},labelStyle:r,valueStyle:{lineHeight:1.6}}):(0,we.jsxs)("div",{style:{display:"grid",gap:2,minWidth:0,alignContent:"start"},children:[(0,we.jsx)("dt",{style:r,children:n.label}),(0,we.jsx)("dd",{style:{margin:0,overflowWrap:"anywhere",minWidth:0},children:n.linked?(0,we.jsx)(Rr,{relation:n.linked.relation,refs:n.linked.refs,...a?{nodeId:e,field:n.key}:{}}):n.app?(0,we.jsx)(Yt,{address:n.app,as:"record",...a?{nodeId:e,field:n.key}:{}}):n.href?(0,we.jsx)(Ur,{href:n.href,field:n.key,value:n.value,stored:n.stored,...a?{nodeId:e}:{}}):a?(0,we.jsxs)(we.Fragment,{children:[(0,we.jsx)(Qt,{nodeId:e,field:n.key,value:n.value,stored:n.stored}),n.repeats?(0,we.jsx)(Lr,{nodeId:e,field:n.key,start:t?.[n.key],value:t?.[`${n.key}Repeat`],label:`${n.label} repeats`}):null]}):n.value})]})}var v=O(V(),1),Es=[];function ma({context:e}){let{store:t,brand:n,principal:a,invariantContext:r}=e;ae(t);let o=ce()!==null,i=ze(),l=decodeURIComponent(i.id??""),s=on(t,l,{...a?{principal:a}:{},...r?{context:r}:{}}),c=qt(t,s?.violations??Es),[u,P]=(0,Ue.useState)(null),[p,S]=(0,Ue.useState)(!1),[R,m]=(0,Ue.useState)(null),k=(0,Ue.useRef)(null),M=(0,Ue.useRef)(null),D=Tr({flow:"both",letters:!0}),x=f=>{(k.current?.parentElement?.querySelector(`[data-affordance="${f.replace(/["\\]/g,"\\$&")}"]`)??k.current)?.focus()};if(!s)return(0,v.jsx)(ie,{context:e,children:(0,v.jsx)(se,{context:e,children:"Nothing lives at this address."})});let B=t.graph.getNode(l),U=t.schema.tryDefinition(s.kind),g=U?.describe&&B?mr(U,B):null,F=[...t.log.all()].filter(f=>!Wt(f)&&(f.writes.includes(l)||f.reads.includes(l))).slice(-8).reverse(),Y=t.log.all().find(f=>!Wt(f)&&f.undoes===void 0&&f.primitives.some(E=>E.op==="add-node"&&E.node.id===l)),Q=s.actions.affordances.filter(f=>f.provider!=="invariant"),Oe=Q.filter(f=>f.destructive||f.setsAside),Ce=p||Oe.length<2?Q:Q.filter(f=>!Oe.includes(f)),Se=e.views?.lookup(s.kind,{cardinality:"one",fidelity:"full"}),Re=Se!==void 0&&!gt(Se)?Se:void 0,b=Re&&B?Xt(Se,B,t.graph):void 0,w=b?s.fields.filter(f=>!b.fields.has(f.key)):s.fields,T=b?s.links.flatMap(f=>{let E=f.targets.filter(Z=>!b.records.has(Z.id));return E.length>0?[{...f,targets:E}]:[]}):s.links,$=Re!==void 0&&mt(Se),ee=o&&br(U).length>0,te=Fe(e).filter(f=>!f.hidden&&(f.kind===s.kind||f.across===s.kind));return(0,v.jsxs)(ie,{context:e,children:[(0,v.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,v.jsx)(it,{context:e}),(0,v.jsx)(se,{context:e,children:o&&B?.label===s.label?(0,v.jsx)(Qt,{nodeId:l,field:"label",value:s.label,said:s.label}):s.label}),g&&g!==s.label?(0,v.jsx)("p",{style:le,children:g}):null,Y?.lineage?(0,v.jsxs)("p",{style:{...C,margin:0},"data-testid":"record-lineage",children:["Made by ",Pt(Y,a,{graph:t.graph,schema:t.schema,...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{}}),", ",Gn(Y.lineage)]}):null,(0,v.jsx)(Yn,{context:e,stop:`#focus=${encodeURIComponent(l)}`,style:{...We,...C},"data-testid":"spatial-link"}),o&&B?(0,v.jsx)(Kn,{choices:[{on:"changed",record:l},{on:"act",record:l},{on:"reaches",kind:s.kind,condition:"",record:l}],label:"Notify me when this changes",testId:"record-notify",style:{...fe,...C,justifySelf:"start"}}):null,te.length>0?(0,v.jsx)(Ms,{context:e,places:te}):null]}),B&&Ha(B)?(0,v.jsx)($s,{context:e,id:l,kind:s.kind}):null,B&&Wa(t,l)?(0,v.jsx)(Os,{context:e,id:l,kind:s.kind}):null,Re&&B?(0,v.jsx)("section",{"data-testid":"record-view",style:{display:"grid",minWidth:0},children:(0,v.jsx)(eo,{children:(0,v.jsx)(Je,{when:Ke(Se),children:(0,v.jsx)(Re,{node:B,cardinality:"one",fidelity:"full",mode:"fullscreen",selected:!1,...s.violations.length>0?{flagged:[l]}:{}})})})}):null,s.violations.length>0?(0,v.jsx)("section",{"data-testid":"record-violations",style:{display:"grid",gap:12,padding:"16px 18px",borderLeft:"3px solid var(--graview-warn)",background:"var(--graview-panel-warning)",borderRadius:"0 var(--graview-radius, 12px) var(--graview-radius, 12px) 0"},children:c.map((f,E)=>(0,v.jsxs)("div",{style:{display:"grid",gap:8},children:[(0,v.jsx)(yn,{violation:f,schema:t.schema,...n?{brand:n}:{}}),(0,v.jsx)(hn,{store:t,repairs:Ro(s.actions,f.repairs),...a?{principal:a}:{}})]},E))}):null,!$&&(w.length>0||ee)?(0,v.jsxs)("section",{style:{...de,display:"grid",gap:14},"data-testid":"record-fields",children:[(0,v.jsx)("h2",{style:ne,children:"The facts"}),fr(U,w).map((f,E)=>{let Z=(0,v.jsx)("dl",{style:{margin:0,display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gap:"14px 24px"},children:f.fields.map(pe=>(0,v.jsx)(di,{nodeId:l,node:B,field:pe,inPlace:o},pe.key))});return f.title?(0,v.jsxs)("section",{style:{display:"grid",gap:10,minWidth:0},children:[(0,v.jsx)("h3",{"data-graview-field-group":f.title,style:{...ne,fontSize:"inherit"},children:f.title}),Z]},E):(0,v.jsx)("div",{children:Z},E)}),ee?(0,v.jsx)(ft,{as:"unfilled",nodeId:l,skip:[...b?.fields??[]],labelStyle:be,style:{gap:4}}):null]}):null,($?[]:T).map(f=>(0,v.jsxs)("section",{style:{...de,display:"grid",gap:10},children:[(0,v.jsx)("p",{style:be,children:wo(t,f)}),f.description?(0,v.jsx)("h2",{style:ne,children:Te(f.description)}):(0,v.jsxs)("h2",{style:ne,"aria-label":Xe(f.edgeKind),children:[f.direction==="in"?"\u2190 ":"\u2192 ",Xe(f.edgeKind)]}),(0,v.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"6px 18px"},children:f.targets.map(E=>{let Z=hr(t,f.direction==="in"?{kind:f.edgeKind,from:E.id,to:l}:{kind:f.edgeKind,from:l,to:E.id});return(0,v.jsxs)("li",{style:{display:"inline-flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,v.jsx)(ge,{kind:E.kind,brand:n,schema:t.schema,size:7}),(0,v.jsxs)(H,{to:X(t.schema,E.kind,E.id),style:_,children:[E.label,E.apart?(0,v.jsxs)("span",{style:C,children:[" \xB7 ",E.apart]}):null]}),Z?.provisional?(0,v.jsx)(li,{store:t,link:Z,...a?{principal:a}:{}}):null]},E.id)})}),(f.direction==="out"&&t.schema.edge(f.edgeKind)?.cardinality==="one"?[]:[...new Set(f.targets.map(E=>E.kind))]).map(E=>(0,v.jsx)(H,{to:`/${j(t.schema,E)}?${encodeURIComponent(f.edgeKind)}=${encodeURIComponent(l)}`,style:{...We,...C},"data-testid":"related-all",children:(0,v.jsxs)(qe,{children:["Sort and filter ",f.description??`these ${z(t,E).toLowerCase()}`,f.targets.some(Z=>Z.kind!==E)?` (${z(t,E).toLowerCase()})`:""]})},E))]},`${f.edgeKind}|${f.direction}|${f.description??""}`)),!$&&(Q.length>0||s.actions.withheld.length>0)?(0,v.jsxs)("section",{style:{...de,display:"grid",gap:14},"data-testid":"record-actions",children:[(0,v.jsx)("h2",{style:ne,ref:k,tabIndex:-1,children:"What can be done"}),(0,v.jsxs)("div",{role:"toolbar","aria-label":"What can be done",...D,style:{display:"flex",flexWrap:"wrap",gap:8},children:[Ce.map(f=>{let E=u===f.id;return(0,v.jsx)("button",{type:"button","data-affordance":f.id,"data-rank":f.rank,"data-graview-act":f.mutation,[Bn]:"",autoFocus:p&&f===Oe[0],"aria-expanded":E,onClick:()=>P(E?null:f.id),style:{...fe,...E?{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"}:{}},children:f.label},f.id)}),Ce.length<Q.length?(0,v.jsxs)("button",{type:"button","aria-expanded":!1,onClick:()=>S(!0),style:{...fe,...C},"data-testid":"record-actions-more",[Bn]:"",children:["Show ",Q.length-Ce.length," more"]}):null]}),Q.map(f=>{if(u!==f.id)return null;let E=t.allMutations().find(Z=>Z.name===f.mutation);return E?(0,v.jsxs)("div",{ref:M,onKeyDown:Z=>{if(Z.key!=="Escape"||Z.defaultPrevented)return;Z.preventDefault(),P(null);let pe=f.id;requestAnimationFrame(()=>x(pe))},style:{display:"grid",gap:10,padding:18,border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,v.jsx)("h3",{style:ne,children:f.label}),E.description?(0,v.jsx)("p",{style:{...C,margin:0},children:E.description}):null,(0,v.jsx)(Le,{store:t,mutation:E,prefilled:f.args,open:f.open,label:f.label,autoFocus:!0,onDone:()=>{P(null),m(f.mutation);let Z=f.id;requestAnimationFrame(()=>x(Z))},...a?{principal:a}:{}})]},f.id):null}),o&&R!==null&&u===null?(0,v.jsx)(Kn,{choices:[{on:"act",act:R,record:l},{on:"act",act:R}],label:"Notify me when someone else does this",testId:"notify-after-act",style:{...fe,...C,justifySelf:"start"}}):null,(0,v.jsx)(gn,{context:e,withheld:s.actions.withheld})]}):null,o?(0,v.jsx)(ho,{id:l,style:de,headingStyle:ne}):null,F.length>0?(0,v.jsxs)("section",{style:{...de,display:"grid",gap:10},"data-testid":"record-history",children:[(0,v.jsx)("h2",{style:ne,children:"What has happened"}),(0,v.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:F.map(f=>(0,v.jsxs)("li",{style:C,children:[(0,v.jsx)("span",{style:{color:"var(--graview-ink)"},children:f.intent}),f.lineage?(0,v.jsxs)("span",{"data-graview-lineage":"",children:[" \xB7 ",Gn(f.lineage)]}):null," \u2014 ",Pt(f,a,{graph:t.graph,schema:t.schema,...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{}})]},f.id))})]}):null]})}function Ms({context:e,places:t}){let[n,a]=(0,Ue.useState)(!1),r=(0,Ue.useRef)(null),o=n||t.length<=wn+1?0:t.length-wn;return(0,v.jsxs)("p",{ref:r,style:{...C,margin:0},"data-testid":"seen-in",...n?{"data-open":""}:{},children:["Seen in:"," ",t.map((i,l)=>(0,v.jsxs)("span",{...o>0&&l>=wn?{"data-graview-later":""}:{},children:[l>0?(0,v.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,(0,v.jsx)(H,{to:he(e,i),style:_,children:i.title})]},st(i))),o>0?(0,v.jsxs)(v.Fragment,{children:[" ",(0,v.jsxs)("button",{type:"button","data-graview-seen-more":"","aria-expanded":"false",style:{..._,...C,font:"inherit",background:"none",border:0,padding:0,cursor:"pointer"},onClick:()=>{a(!0),requestAnimationFrame(()=>r.current?.querySelectorAll("a")[wn]?.focus())},children:[o," more"]}),(0,v.jsx)("style",{children:Ns})]}):null]})}var wn=3,Ns="[data-graview-seen-more]{display:none!important}@media (max-width:680px){[data-graview-seen-more]{display:inline!important}[data-testid=seen-in] [data-graview-later]{display:none}}";function Os({context:e,id:t,kind:n}){let{store:a,principal:r}=e,o={name:`allow-tidying-${n}`,args:{id:t}},i=a.allMutations().some(l=>l.name===o.name)&&a.permits(o,r).ok;return(0,v.jsxs)("section",{"data-testid":"record-left-alone",style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:12,padding:"12px 16px",border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,v.jsxs)("p",{style:{margin:0,flex:"1 1 16rem"},children:[(0,v.jsx)("strong",{children:"Left alone."})," Nothing automated changes it; tidying passes it by."]}),i?(0,v.jsx)("button",{type:"button",style:fe,"data-testid":"allow-tidying",onClick:()=>a.apply(o,r?{author:r}:{}),children:"Allow tidying again"}):null]})}function $s({context:e,id:t,kind:n}){let{store:a,principal:r}=e,o={name:`unarchive-${n}`,args:{id:t}},i=a.allMutations().some(c=>c.name===o.name)&&a.permits(o,r).ok,l=[...a.log.all()].reverse().find(c=>!Wt(c)&&c.mergedInto!==void 0&&c.writes.includes(t)),s=l?.mergedInto!==void 0?a.graph.getNode(l.mergedInto):void 0;return(0,v.jsxs)("section",{"data-testid":"record-archived",style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:12,padding:"12px 16px",border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,v.jsxs)("p",{style:{margin:0,flex:"1 1 16rem"},children:[(0,v.jsx)("strong",{children:"Archived."})," Kept with its ties and history, and out of lists, counts and rules.",s?(0,v.jsxs)(v.Fragment,{children:[" ","Merged into ",(0,v.jsx)(H,{to:X(a.schema,s.kind,s.id),style:_,children:oe(a.schema.tryDefinition(s.kind),s)}),"."]}):null]}),i?(0,v.jsx)("button",{type:"button",style:fe,"data-testid":"bring-it-back",onClick:()=>a.apply(o,r?{author:r}:{}),children:"Bring it back"}):null]})}var A=O(V(),1),Hs=Kt(()=>(__graviewPreload(import.meta.url,["./chunk.YFSBVZTG.js","./chunk.G4YJPKRG.js","./chunk.3UOKUF5Z.js","./chunk.Q355UPFG.js","./chunk.MVWC3VR3.js","./chunk.CC5BJH5A.js","./chunk.CFKZXLXS.js","./chunk.Y5C4RXG7.js","./chunk.7MHCGVGM.js","./chunk.FRYBMS3W.js","./chunk.LQVAABPS.js","./chunk.NGTRL5U4.js","./chunk.3MOJF7BA.js","./chunk.LZIBQ3VX.js","./chunk.YZ7FUKAL.js","./chunk.KDRLUBVF.js","./chunk.BQIHNT7C.js","./chunk.TAT2IQUR.js","./chunk.3XGA65Y3.js","./chunk.BYKD5RLA.js","./chunk.2K4TT2BV.js","./chunk.VUBNBTJP.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.7VKSXGTX.js","./chunk.TY4GQJKC.js","./chunk.6ZQAR5ZA.js","./chunk.W3W54DSX.js","./chunk.PI44XMY2.js","./chunk.KGW75Z5L.js","./chunk.GZHZLJBF.js","./chunk.IOK4GVJC.js","./chunk.OJGHDWI6.js","./chunk.TLJOZSDD.js","./chunk.MSWWWLEA.js","./chunk.UITT6JWW.js","./chunk.A5PDXNY6.js","./chunk.WC3DENU4.js","./chunk.VNDKKTED.js","./chunk.4MP72LPR.js","./chunk.SDO3U72B.js","./chunk.VSCIXAHN.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.FLUK3UXF.js")).then(e=>({default:e.DraftPage}))),Fs={kind:"human"};function Is({list:e,store:t}){let n=new Set(e.members.map(i=>i.kind)),a=e.total-e.members.length,r=n.size===1?[...n][0]:void 0;if(!r)return(0,A.jsx)("p",{className:"graview-spec-text graview-spec-more",children:`and ${a} more`});let o=_e(t.schema,r).toLowerCase();return(0,A.jsx)("p",{className:"graview-spec-text graview-spec-more",children:(0,A.jsx)(H,{to:`/${j(t.schema,r)}`,className:"graview-spec-link graview-spec-see-all","data-testid":"see-all",children:e.total===t.graph.nodesOfKind(r).length?`See all ${kt(e.total)} ${o}`:`${kt(a)} more \xB7 all ${o}`})})}function Ds({context:e,children:t}){let n=Ve(),a=e.store.schema,r=at("/").replace(/\/$/,""),o=(0,q.useMemo)(()=>({href:i=>`${r}${X(a,i.kind,i.id)}`,go:i=>n(X(a,i.kind,i.id)),more:i=>(0,A.jsx)(Is,{list:i,store:e.store})}),[r,a,n,e.store]);return(0,A.jsx)(Zt.Provider,{value:o,children:(0,A.jsx)(to.Provider,{value:(e.titleLevel??(e.framed&&!e.barAbove?1:2))-1,children:t})})}var pi=(0,q.createContext)(void 0);function Ws({steering:e}){let t=ye(),n=Ve(),a=`${t.pathname}${t.search}`;return(0,q.useLayoutEffect)(()=>e.at(a),[a,e]),(0,q.useLayoutEffect)(()=>{let r=i=>{i!==a&&n(i)};e.go.current=r;let o=e.pending?.current;return o!==void 0&&(e.pending.current=void 0,r(o)),()=>{e.go.current===r&&(e.go.current=void 0)}},[a,n,e]),null}function Gs({context:e,to:t}){let{pathname:n}=ye(),a=ce(),r=(t??a)?.sayWhere,o=Bs(e,n);return(0,q.useEffect)(()=>(r?.(o),()=>r?.(null)),[r,o]),null}function Bs(e,t){let[n="",a,r]=t.split("/").filter(Boolean).map(i=>{try{return decodeURIComponent(i)}catch{return i}});if(r!==void 0)return"#";if(n==="places"&&a!==void 0){if(a===Fn)return"#overview=1";let i=e.views?.places().find(l=>l.as===a);return i?`#focus=${encodeURIComponent(De(i.kind))}&view=${encodeURIComponent(i.as)}`:"#"}let o=xe(e.store.schema,n);return o?`#focus=${encodeURIComponent(a??De(o))}`:"#"}function Ks({onNavigate:e,path:t}){let n=ye(),a=Qn(),r=Ve(),o=n.hash&&!n.hash.includes("=")?n.hash:"",i=`${n.pathname}${n.search}${o}`,l=(0,q.useRef)(e);l.current=e;let s=(0,q.useRef)(null);(0,q.useEffect)(()=>{let u=s.current;s.current=i,u!==null&&(i===u&&a!=="PUSH"||l.current?.(i,a==="POP"?"pop":a==="REPLACE"?"replace":"push"))},[n.key]);let c=(0,q.useRef)(t);return(0,q.useEffect)(()=>{t===void 0||t===c.current||(c.current=t,t!==i&&r(t))},[t]),null}function ci({context:e,registry:t,page:n}){let a=ze(),r=xe(e.store.schema,a.slug??""),o=n==="list"?pa:ma,l=(r?t?.lookup(r,n):void 0)??o;return(0,A.jsx)(l,{context:e})}function qs({context:e,registry:t,children:n}){let a=(0,q.useRef)(null);return sr(a),(0,A.jsx)("div",{ref:a,"data-graview-face":"pages",style:{display:"contents"},children:(0,A.jsx)(Do,{context:e,registry:t,root:a,children:(0,A.jsx)(Go,{context:e,root:a,children:n})})})}function Vs(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName==="TEXTAREA"||e.tagName==="SELECT"?!0:e.tagName==="INPUT"&&!["button","submit","reset","checkbox","radio","image","file","color","range"].includes(e.type):!1}function js(){let{pathname:e}=ye(),t=Qn(),n=(0,q.useRef)(null);(0,q.useLayoutEffect)(()=>{if(t!=="POP"){for(let o=n.current?.parentElement;o;o=o.parentElement){let{overflowY:i}=getComputedStyle(o);if((i==="auto"||i==="scroll")&&o.scrollHeight>o.clientHeight){o.scrollTop=0;return}}window.scrollTo(0,0)}},[e]);let a=(0,q.useRef)(e),r=(0,q.useRef)(!1);return(0,q.useEffect)(()=>{if(!r.current&&e===a.current)return;r.current=!0;let o=document.activeElement;if(Vs(o))return;let i=n.current?.closest("main")??document.querySelector("main"),s=n.current?.closest("[data-graview-face]")?.querySelector("[data-graview-page-title]")??i?.querySelector("h1, h2")??null??i??null;s&&(s.hasAttribute("tabindex")||s.setAttribute("tabindex","-1"),s.focus({preventScroll:!0}))},[e]),(0,A.jsx)("span",{ref:n,hidden:!0,"data-graview-scroll-reset":""})}function ui({context:e,children:t}){let n=Ve(),a=at("/").replace(/\/$/,""),r=(0,q.useContext)(pi),o=(0,q.useMemo)(()=>{let i=(s,c)=>{if("record"in s){let u=e.store.graph.getNode(s.record);return u?tn(X(e.store.schema,u.kind,s.record),{section:c?.section}):void 0}if("place"in s){let u=e.views?.places().find(P=>P.as===s.place);return u?tn(he(e,u),c):void 0}return e.store.schema.tryDefinition(s.list)?tn(`/${j(e.store.schema,s.list)}`,c):void 0},l=s=>{s!==void 0&&n(s)};return{record:(s,c)=>l(i({record:s},c)),place:(s,c)=>l(i({place:s},c)),list:(s,c)=>l(i({list:s},c)),draft:()=>n("/~draft"),href:(s,c)=>{let u=r===!1?void 0:i(s,c);if(u!==void 0)return r?r(u):`${a}${u}`}}},[e,n,a,r]);return(0,A.jsx)(ir.Provider,{value:o,children:t})}function Us(){let{pathname:e,search:t,hash:n}=ye();return(0,q.useEffect)(()=>{let a=decodeURIComponent(n.replace(/^#/,""));if(!(!a||a.includes("=")))return $o(a)},[e,t,n]),null}function _s({context:e,Home:t}){let n=ye(),a=e.views,r=n.key==="default"&&!(a&&rr(a));(0,q.useEffect)(()=>{a&&or(a)},[a]);let o=r?Ua(e.views?.arrangement?.()?.first,e.store.schema,e.views?.places()??[]):void 0,i=o?.to==="place"?he(e,o.place):o?.to==="kind"?`/${j(e.store.schema,o.kind)}`:void 0;return i?(0,A.jsx)(Zn,{to:i,replace:!0}):(0,A.jsx)(t,{context:e})}function gi({context:e,registry:t}){let n=t?.lookupSurface("shell"),a=n!==void 0,r=a&&(t?.without().has("bar")??!1),o=a&&!r&&!e.embedded?{...e,barAbove:!0}:e,i=m=>n===void 0?(0,A.jsx)(rn,{context:e,children:m}):r?(0,A.jsx)(n,{context:e,children:m}):(0,A.jsx)(rn,{context:e,children:(0,A.jsx)(n,{context:o,children:m})}),l=t?.lookupSurface("home")??sa,s=t?.lookupSurface("problems")??ua,c=a?{...o,framed:!0}:e,[u,P]=(0,q.useState)(null),p=(0,q.useMemo)(()=>({context:c,registry:t}),[c,t]),S=(0,q.useMemo)(()=>({onFind:P,find:!(t?.without().has("find")??!1),places:!(t?.without().has("places")??!1)}),[t]),R=(0,A.jsx)(ea.Provider,{value:p,children:(0,A.jsx)(ui,{context:e,children:(0,A.jsx)(qs,{context:e,registry:t,children:i((0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(wr,{face:"pages"}),(0,A.jsxs)(Ds,{context:c,children:[(0,A.jsx)(js,{}),(0,A.jsx)(Us,{}),(0,A.jsxs)(xo,{children:[(t?.routes()??[]).map(({path:m,component:k})=>(0,A.jsx)(Ee,{path:m,element:(0,A.jsx)(k,{context:c})},m)),(0,A.jsx)(Ee,{path:"/",element:(0,A.jsx)(_s,{context:c,Home:l})}),(0,A.jsx)(Ee,{path:"/problems",element:(0,A.jsx)(s,{context:c})}),(0,A.jsx)(Ee,{path:"/~draft",element:(0,A.jsx)(q.Suspense,{fallback:null,children:(0,A.jsx)(Hs,{context:c})})}),(0,A.jsx)(Ee,{path:"/search",element:(0,A.jsx)(ca,{context:c})}),(0,A.jsx)(Ee,{path:"/map",element:(0,A.jsx)(ia,{context:c})}),(0,A.jsx)(Ee,{path:"/places",element:(0,A.jsx)(ra,{context:c})}),Fe(c).some(m=>m.as===Fn)?null:(0,A.jsx)(Ee,{path:ja,element:(0,A.jsx)(Zn,{to:"/",replace:!0})}),(0,A.jsx)(Ee,{path:"/places/:as",element:(0,A.jsx)(oa,{context:c})}),(0,A.jsx)(Ee,{path:"/:slug",element:(0,A.jsx)(ci,{context:c,registry:t,page:"list"})}),(0,A.jsx)(Ee,{path:"/:slug/:id",element:(0,A.jsx)(ci,{context:c,registry:t,page:"record"})})]})]})]}))})})});return e.embedded||!a||r?R:(0,A.jsx)(Co.Provider,{value:S,children:(0,A.jsx)(Br.Provider,{value:u,children:R})})}var zs=()=>typeof document>"u"?null:document.body;function Js({context:e,registry:t,basename:n,initialPath:a,onNavigate:r,path:o,steering:i,firstLook:l,hrefOf:s,typing:c}){let[u,P]=(0,q.useState)(void 0),p=u!==void 0&&u.from===e.principal?{...e,principal:u.seat}:e;(0,q.useState)(()=>p.views?ro(p.views,p.store.schema,Vn(p.brand,p.store.schema)):void 0);let S=ce(),R=c??p.typing;Ta({reader:p.locale??S?.locale,app:p.brand?.locale??p.app?.brand?.locale,readerTimeZone:p.timeZone??S?.timeZone,appTimeZone:p.brand?.timeZone??p.app?.brand?.timeZone});let m=p.principal??Fs,k=er(p.store,m,p.history),D=(k.past&&k.live===p.store?k.past.store:p.store).seenBy(m),x=D===p.store?p:{...p,store:D};tr(p.store,p.principal);let B=(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Ks,{onNavigate:r,path:o}),i?(0,A.jsx)(Ws,{steering:i}):null,x.presence||S?(0,A.jsx)(Gs,{context:x,to:S}):null,(0,A.jsx)(gi,{context:x,...t?{registry:t}:{}}),l?(0,A.jsx)(oo,{firstLook:l,root:zs,app:Vn(p.brand,p.store.schema)}):null]}),U=x.views?(0,A.jsxs)(nr,{store:x.store,views:x.views,...x.principal?{principal:x.principal}:{},...x.brand?{brand:x.brand}:{},...x.locale?{locale:x.locale}:{},...x.timeZone?{timeZone:x.timeZone}:{},...x.settings?{settings:x.settings}:{},...x.presence&&!S?{presence:x.presence}:{},...R?{typing:R}:{},...x.people?{people:x.people}:{},...x.seats?{seats:x.seats}:{},onSeat:Q=>S?S.takeSeat(Q):P({from:e.principal,seat:Q}),...x.onKeepLens?{onKeepLens:x.onKeepLens}:{},...x.onExport?{onExport:x.onExport}:{},...x.ai?{ai:x.ai}:{},...x.subscriptions?{subscriptions:x.subscriptions}:{},dismissals:x.dismissals,whileAway:x.whileAway,...x.signIn?{signIn:x.signIn}:{},resolveApp:x.resolveApp??S?.resolveApp,linkedRecords:x.linkedRecords??S?.linkedRecords,...x.app?{app:x.app}:{},...x.menuSections?{menuSections:x.menuSections}:{},children:[B,(0,A.jsx)(ui,{context:x,children:(0,A.jsx)(Ho,{context:x})})]}):B,g=(0,A.jsx)(Xa.Provider,{value:k,children:U}),F=x.files?(0,A.jsx)(Za.Provider,{value:x.files,children:g}):g,Y=s===void 0?F:(0,A.jsx)(pi.Provider,{value:s,children:F});if(a!==void 0){let Q=n===void 0?a:`${n.replace(/\/$/,"")}${a}`;return(0,A.jsx)(ko,{initialEntries:[Q],...n===void 0?{}:{basename:n},children:Y})}return(0,A.jsx)(Po,{...n===void 0?{}:{basename:n},children:Y})}export{Di as a,Js as b};
@@ -1 +0,0 @@
1
- import{b as mt}from"./chunk.VFOON3Z3.js";import{a as pt}from"./chunk.W3W54DSX.js";import{f as dt}from"./chunk.PI44XMY2.js";import{a as F,f as q}from"./chunk.KGW75Z5L.js";import{F as Q,I as X,K as k,Q as G,T as tt,Tb as ft,V as nt,W as et,ba as rt,da as M,ga as _,ja as ot,kb as lt,ma as at,nb as ut,oa as st,sd as ct}from"./chunk.VSCIXAHN.js";import{e as it}from"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";function J(t){let e=[],n=!0;for(let r of t){if(r.text.length===0)continue;let s=r.as==="close"||r.text===","||r.text===":"||r.text.startsWith("'")||n;e.push({part:r,space:!s}),n=r.as==="open"}return e}function D(t,e){return J(t).map(({part:n,space:r})=>`${r?" ":""}${e?n.said??n.text:n.text}`).join("")}function Et(t){return D(t,!1)}function Pt(t){return D(t,!0)}function yt(t,e=!1){let n=e?t.said:t.text;return t.record!==void 0?`${t.record} \u2014 ${n}`:n}function z(t){let e=u=>J(u).map(({part:o,space:a})=>({...o,space:a})),n=e(t.parts),r=t.when&&t.when.length>0?e(t.when):void 0,s=u=>`${D(n,u)}${r?`, when ${D(r,u)}`:""}`;return{...t,parts:n,...r?{when:r}:{},text:s(!1),said:s(!0)}}function Lt(t,e=!1){return t.line?yt(t.line,e):t.message}var gt=60,O=t=>({text:t,as:"name"}),c=(t,e)=>e===void 0?{text:t,as:"word"}:{text:t,as:"word",said:e},L=(t,e)=>e===void 0||e===t?{text:t,as:"value"}:{text:t,as:"value",said:e},R=(t,e)=>({text:t,as:"op",said:e}),v={text:"(",as:"open"},w={text:")",as:"close"},N={text:"\u2014",as:"value",said:"empty"},V={">=":["\u2265","at least"],"<=":["\u2264","at most"],"<":["<","less than"],">":[">","more than"],"==":["=","is"],"!=":["\u2260","is not"]},B={">=":"<","<=":">","<":">=",">":"<=","==":"!=","!=":"=="},At={"+":["+","plus"],"-":["\u2212","minus"],"*":["\xD7","times"],"/":["\xF7","divided by"],"%":["mod","modulo"]},xt=t=>t.t==="binary"&&t.op in V;function I(t){return rt(t)}function bt(t){let{schema:e}=t,n=l=>l===null?void 0:e.tryDefinition(l),r=(l,m)=>{let g=n(l)?.edges;return g&&Object.hasOwn(g,m)?g[m]:void 0},s=(l,m)=>{let g=r(l,m)?.to;return Array.isArray(g)&&g.length===1?g[0]:null},u=(l,m)=>{let g=(e.edge(m)?.from??[]).filter(W=>{let K=r(W,m)?.to;return l===null||K==="*"||Array.isArray(K)&&K.includes(l)});return g.length===1?g[0]:null},o=(l,m)=>r(l,m)?M(m).toLowerCase():I(at(n(l),m)),a=l=>I(ot(e,l)),d=l=>I(dt(e).get(l)?.label??M(l)),b=l=>I(st(n(l),l)),i=(l,m)=>{let g=l===null?void 0:t.formatOf?.(l,m);if(g?.format)return g;let W=t.said?.get(m);return W?{...g,format:W}:g},p=l=>_(e.tryDefinition(l.kind),l),h=t.money?.locale,y=(l,m)=>{if(l==null)return N;if(l instanceof F){if(l.nodes.length===0)return N;let A=l.nodes.slice(0,3).map(p),Y=l.nodes.length-A.length;return L(Y>0?`${A.join(", ")} and ${Y} more`:A.length>1?`${A.slice(0,-1).join(", ")} and ${A[A.length-1]}`:A[0])}if(Array.isArray(l))return L(`{${l.map(A=>y(A,m).text).join(", ")}}`,l.map(A=>y(A,m).text).join(" or "));if(typeof l=="object")return L(p(l));if(typeof l=="boolean")return L(l?"yes":"no");let g=m?.format??(m?i(m.kind,m.key):void 0);if(typeof l=="number")return L(g&&g.format!=="date"?ft(l,{...t.money,...g}):et(l,h));if(Q.test(l)||g?.format==="date")return L(G(nt(l,t.money?.timeZone)??l.slice(0,10),h));if(X.test(l))return L(tt(l,h,t.money?.timeZone));let W=m&&m.kind!==null?n(m.kind)?.display?.format?.[m.key]:void 0;if(W)return L(W(l));let K=l.length>gt?`${l.slice(0,gt-1).trimEnd()}\u2026`:l;return L(/^[a-z][a-z0-9]*([-_][a-z0-9]+)*$/.test(K)?K.replace(/[-_]+/g," "):K)};return{definition:n,relation:r,farOf:s,nearOf:u,fieldName:o,plural:a,noun:b,factName:d,formatOf:i,valueWords:y,locale:h}}function P(t,e,n){if(t.t==="ident")return{kind:e,key:t.name};if(t.t==="member")return{kind:E(t.object,e,n),key:t.name};if(t.t==="call"&&(t.fn==="sum"||t.fn==="min"||t.fn==="max")&&t.args.length===2){let r=E(t.args[0],e,n),s=t.args[1];if(s.t==="ident")return{kind:r,key:s.name};if(s.t==="lit"&&typeof s.value=="string")return{kind:r,key:s.value}}if(t.t==="binary"&&(t.op==="+"||t.op==="-"))return P(t.left,e,n)??P(t.right,e,n);if(t.t==="call"&&t.fn==="if"&&t.args.length===3)return P(t.args[1],e,n)??P(t.args[2],e,n)}function E(t,e,n){switch(t.t){case"ident":return n.relation(e,t.name)?n.farOf(e,t.name):null;case"member":return n.farOf(E(t.object,e,n),t.name);case"where":return E(t.set,e,n);case"binary":return t.op==="|"||t.op==="&"||t.op==="-"?E(t.left,e,n):null;case"call":{let r=s=>{let u=t.args[s];return u?.t==="lit"&&typeof u.value=="string"?u.value:void 0};return t.fn==="all"?r(0)??null:t.fn==="out"?t.args.length===2?n.farOf(E(t.args[0],e,n),r(1)??""):n.farOf(e,r(0)??""):t.fn==="in"?t.args.length===2?n.nearOf(E(t.args[0],e,n),r(1)??""):n.nearOf(e,r(0)??""):(t.fn==="first"||t.fn==="sort")&&t.args[0]?E(t.args[0],e,n):null}default:return null}}function j(t){return t.t==="binary"?t.op==="||"?H(t)?4:1:t.op==="&&"?2:t.op in V||t.op==="in"?4:t.op==="+"||t.op==="-"?5:t.op==="*"||t.op==="/"||t.op==="%"?6:4.5:t.t==="unary"&&t.op==="!"?3:t.t==="where"?3.5:9}var $=t=>t.t==="lit",x=(t,e)=>t.t==="call"&&t.fn===e;function C(t,e){return t.t==="binary"&&t.op===e?[...C(t.left,e),...C(t.right,e)]:[t]}function H(t){if(t.t!=="binary"||t.op!=="||")return;let e=[];e.push(...C(t,"||"));let n,r=[];for(let s of e){if(s.t!=="binary"||s.op!=="=="||!$(s.right)||typeof s.right.value!="string"||n&&JSON.stringify(ht(n))!==JSON.stringify(ht(s.left)))return;n=s.left,r.push(s.right)}return n?{subject:n,values:r}:void 0}var ht=t=>JSON.parse(JSON.stringify(t,(e,n)=>e==="at"?void 0:n));function f(t,e,n,r){let s=(u,o,a=e)=>j(u)<o?[v,...f(u,a,n),w]:f(u,a,n);switch(t.t){case"lit":return[n.valueWords(t.value,r)];case"list":return[n.valueWords(t.items.map(u=>u.t==="lit"?u.value:null),r)];case"ident":return[O(n.fieldName(e,t.name))];case"member":{let u=x(t.object,"first")&&t.object.args[0]&&x(t.object.args[0],"all"),o=E(t.object,e,n);if(u&&o)return e!==null&&n.fieldName(e,t.name)===n.fieldName(o,t.name)&&n.definition(e)?.fields?.shape&&Object.prototype.hasOwnProperty.call(n.definition(e).fields.shape,t.name)?[O(`${n.noun(o)}'s ${n.fieldName(o,t.name)}`)]:[O(n.fieldName(o,t.name))];let a=f(t.object,e,n),d=a[a.length-1];return a.length===1&&d?.as==="name"?[O(`${d.text}'s ${n.fieldName(o,t.name)}`)]:[...a,c("'s"),O(n.fieldName(o,t.name))]}case"unary":return t.op==="-"?[R("\u2212","minus"),...s(t.operand,7)]:T(t.operand,e,n);case"where":{let u=E(t.set,e,n),o=f(t.filter,u,n),a=o.every(d=>d.as==="name"||d.as==="word"&&d.text==="not");return[...s(t.set,4),...a?[]:[c("with")],...j(t.filter)<=2?[v,...o,w]:o]}case"binary":return Rt(t,e,n);case"call":return jt(t,e,n)}}function T(t,e,n){return xt(t)?Rt({...t,op:B[t.op]},e,n):x(t,"present")||x(t,"exists")?[...f(t.args[0],e,n),R("=","is"),N]:t.t==="ident"?[c("not"),O(n.fieldName(e,t.name))]:[c("not"),v,...f(t,e,n),w]}function Rt(t,e,n){let r=(o,a)=>j(o)<a?[v,...f(o,e,n),w]:f(o,e,n);if(t.op==="&&"||t.op==="||"){let o=H(t);if(o){let d=P(o.subject,e,n);return[...f(o.subject,e,n),R("\u2208","is one of"),n.valueWords(o.values.map(b=>b.value),d)]}let a=t.op==="&&"?2:1;return[...r(t.left,a),c(t.op==="&&"?"and":"or"),...r(t.right,a+.5)]}if(t.op in V){if($(t.right)&&typeof t.right.value=="boolean"&&(t.op==="=="||t.op==="!="))return t.op==="=="===t.right.value?f(t.left,e,n):T(t.left,e,n);let[o,a]=V[t.op],d=P(t.left,e,n),b=P(t.right,e,n);return[...S(t.left,e,n,b),R(o,a),...S(t.right,e,n,d)]}if(t.op==="in")return[...r(t.left,5),R("\u2208","is one of"),...S(t.right,e,n,P(t.left,e,n))];let s=At[t.op];if(s){let o=j(t);return[...r(t.left,o),R(s[0],s[1]),...r(t.right,o+.5)]}let u={"|":"or","&":"and also","-":"except"};return[...r(t.left,5),c(u[t.op]??t.op),...r(t.right,5)]}function S(t,e,n,r){return t.t==="lit"||t.t==="list"?f(t,e,n,r):j(t)<5?[v,...f(t,e,n),w]:f(t,e,n)}function jt(t,e,n){let r=o=>t.args[o],s=o=>{let a=t.args[o];return a?.t==="lit"&&typeof a.value=="string"?a.value:void 0},u=o=>{let a=r(o);return j(a)<9&&a.t!=="where"?[v,...f(a,e,n),w]:f(a,e,n)};switch(t.fn){case"out":{let o=s(t.args.length-1)??"",a=O(M(o).toLowerCase());return t.args.length===2?[a,c("of"),...u(0)]:[a]}case"in":{let o=s(t.args.length-1)??"",a=t.args.length===2?n.nearOf(E(r(0),e,n),o):n.nearOf(e,o),d=O(a?n.plural(a):M(o).toLowerCase());return t.args.length===2?[d,c("of"),...u(0)]:[d]}case"all":{let o=s(0),a=t.args[1]?.t==="lit"?t.args[1].value:void 0,d=a===!0?[c("archived")]:a==="all"?[c("archived or not")]:[];return a===!0?[...d,O(o?n.plural(o):"everything")]:[O(o?n.plural(o):"everything"),...d]}case"fact":{let o=s(0);return[O(o?n.factName(o):"fact")]}case"count":return[c("number of"),...u(0)];case"exists":return[...u(0),R("\u2260","is not"),N];case"present":return[...f(r(0),e,n),R("\u2260","is not"),N];case"some":case"every":{let o=E(r(0),e,n),a=r(1);return[...t.fn==="some"?[c("some")]:[],...u(0),c(t.fn==="some"?"with":"all with"),...j(a)<=2?[v,...f(a,o,n),w]:f(a,o,n)]}case"sum":case"min":case"max":{let o=E(r(0),e,n),a=r(1),d=a.t==="lit"&&typeof a.value=="string"?[O(n.fieldName(o,a.value))]:j(a)<9?[v,...f(a,o,n),w]:f(a,o,n);return[c(t.fn==="sum"?"total":t.fn==="min"?"least":"most"),...d,c("of"),...u(0)]}case"first":{let o=r(0);if(x(o,"all")){let a=o.args[0]?.value;if(typeof a=="string")return[O(`the ${n.noun(a)}`)]}return[c("first of"),...u(0)]}case"sort":return[...u(0),c("by"),...f(r(1),E(r(0),e,n),n)];case"len":return[c("length of"),...f(r(0),e,n)];case"lower":return f(r(0),e,n);case"round":return[...f(r(0),e,n),c(t.args.length===2&&$(r(1))?`rounded to ${String(r(1).value)} places`:"rounded")];case"contains":case"startsWith":return[...f(r(0),e,n),c(t.fn==="contains"?"contains":"starts with"),...S(r(1),e,n,P(r(0),e,n))];case"today":return[L("today")];case"now":return[L("now")];case"date":return $(r(0))&&typeof r(0).value=="string"?[L(G(String(r(0).value),n.locale))]:f(r(0),e,n);case"days":case"hours":{let o=t.fn,[a,d]=[r(0),r(1)];return x(d,"today")||x(d,"now")?[c(`${o} since`),...f(a,e,n)]:x(a,"today")||x(a,"now")?[c(`${o} until`),...f(d,e,n)]:[c(`${o} from`),...f(a,e,n),c("to"),...f(d,e,n)]}case"if":return[v,...f(r(1),e,n),c("if"),...f(r(0),e,n),c(","),c("else"),...f(r(2),e,n),w];case"either":return t.args.flatMap((o,a)=>a===0?f(o,e,n):[c(","),c("else"),...f(o,e,n)]);default:return[c(t.fn),v,...t.args.flatMap((o,a)=>a===0?f(o,e,n):[c(","),...f(o,e,n)]),w]}}function U(t,e){let n=bt(e),r=t.over==="graph"?null:t.over;return z({...r===null?{}:{kind:r},parts:f(t.require,r,n),...t.when?{when:f(t.when,r,n)}:{}})}function Z(t,e,n){let r=bt(e),s=t.over==="graph"?null:t.over,u=n.subject,o=i=>{try{return q(i,{...n,budget:2e3})}catch{return}},a=(i,p)=>{let h=S(i,s,r,p);if(i.t==="lit"||i.t==="list"||x(i,"today")||x(i,"now")||x(i,"date"))return h;let y=o(i);if(y===void 0)return h;let l=P(i,s,r),m=r.valueWords(y,l?{...l,format:r.formatOf(l.kind,l.key)??(p?r.formatOf(p.kind,p.key):void 0)}:p);return y instanceof F?[...h,c(":"),m]:[...h,m]},d=i=>{if(i.t==="binary"&&i.op==="&&"){let p=[];p.push(...C(i,"&&"));let h=p.filter(y=>o(y)!==!0);return(h.length>0?h:p).flatMap((y,l)=>[...l>0?[c("and")]:[],...j(y)<=2?[v,...d(y),w]:d(y)])}if(i.t==="binary"&&i.op==="||"){let p=H(i);if(p){let y=P(p.subject,s,r);return[...a(p.subject),R("\u2209","is not one of"),r.valueWords(p.values.map(l=>l.value),y)]}let h=[];return h.push(...C(i,"||")),h.flatMap((y,l)=>[...l>0?[c("and")]:[],...j(y)<=2?[v,...d(y),w]:d(y)])}if(i.t==="binary"&&i.op in V){if($(i.right)&&typeof i.right.value=="boolean"&&(i.op==="=="||i.op==="!="))return i.op==="=="===i.right.value?T(i.left,s,r):f(i.left,s,r);let p=B[i.op],[h,y]=V[p],l=P(i.left,s,r),m=P(i.right,s,r);if($(i.right)&&i.right.value===null)return[...p==="=="?S(i.left,s,r,m):a(i.left,m),R(h,y),N];let g=p==="=="&&($(i.right)||$(i.left));return[...g?S(i.left,s,r,m):a(i.left,m),R(h,y),...g?S(i.right,s,r,l):a(i.right,l)]}if(i.t==="binary"&&i.op==="in")return[...a(i.left),R("\u2209","is not one of"),...S(i.right,s,r,P(i.left,s,r))];if(i.t==="unary"&&i.op==="!"){let p=i.operand;return xt(p)?d({...p,op:B[p.op]}):x(p,"present")||x(p,"exists")?[...a(p.args[0]),R("\u2260","is not"),N]:p.t==="ident"?f(p,s,r):[c("not"),v,...T(p,s,r),w]}if(x(i,"present")||x(i,"exists"))return[...f(i.args[0],s,r),R("=","is"),N];if(x(i,"some"))return[...f(i,s,r).slice(1),R("=","is"),N];if(x(i,"every")&&i.args.length===2){let p=o(i.args[0]);if(p instanceof F){let h=p.nodes.filter(y=>{try{return q(i.args[1],{...n,subject:y,budget:2e3})!==!0}catch{return!0}});return[...f(i,s,r),c(","),c("not"),r.valueWords(new F(h))]}}return i.t==="ident"?[c("not"),O(r.fieldName(s,i.name))]:[c("not"),v,...f(i,s,r),w]},b;try{b=d(t.require)}catch{b=[c("not"),v,...f(t.require,s,r),w]}return z({...s===null?{}:{kind:s},parts:b,...u?{record:_(e.schema.tryDefinition(u.kind),u)}:{}})}function vt(t){let e=new Map;for(let n of t??[])n.expr?.t==="ident"&&n.format&&(n.format==="money"||n.format==="percent"||n.format==="date")&&e.set(n.expr.name,n.format);return e}function St(t){return(e,n)=>{let r=t[e]?.fields?.[n],s=r?.format??(r?.type==="date"?"date":void 0);return s||r?.unit?{...s?{format:s}:{},...r?.unit?{unit:r.unit}:{}}:void 0}}function Ot(t,e){return{schema:e,said:vt(t.says),...t.declared?{formatOf:St(t.declared)}:{},...t.money?{money:t.money}:{}}}function Qt(t,e){return t.shape?U(t.shape,Ot(t.shape,e)):void 0}var wt=new WeakMap;function Nt(t,e){let n=new Map(t.allInvariants().map(r=>[r.name,r]));return e.map(r=>{let s=Kt(r),u=n.get(s.invariant)?.shape;if(!u||s.status&&s.status!=="violated")return s;let o=s.subjectId?t.graph.getNode(s.subjectId):void 0;if(u.over!=="graph"&&!o)return s;let a=u.kinds;a||(a=wt.get(t.schema),a||wt.set(t.schema,a=pt(t.schema)));try{let d=t.today?.()??u.today?.()??k(),b=Z(u,Ot(u,t.schema),{graph:t.graph,subject:o??null,kinds:a,today:d});return{...s,line:b,...u.says?{}:{message:`${s.message} \u2014 ${b.text}`}}}catch{return s}})}function Wt(){ut((t,e,n,r)=>Nt({graph:t,schema:t.schema,allInvariants:()=>e,today:()=>r},n)),mt($t)}function $t(t,e,n,r){let s=e.graph,u=lt.from(t.schema,s.snapshot(),{validate:!1});for(let b of n?[...r].reverse().map(it):r)try{u.applyPrimitives([b],{restoring:!0})}catch{}let o=b=>t.violations(void 0,b),a=o(n?u:s),d=o(n?s:u);return{...ct(t.allInvariants(),a,d),violationsAfter:d}}function Kt(t){if(!t.line)return t;let{line:e,...n}=t,r=` \u2014 ${e.text}`;return n.message.endsWith(r)?{...n,message:n.message.slice(0,-r.length)}:n}Wt();export{Z as brokenLineOf,Wt as judgeWithLines,$t as judgedForASeat,Lt as problemWords,Qt as ruleLine,U as ruleLineOf,yt as ruleLineWords,J as ruleSpacing,Pt as ruleSpoken,Et as ruleText,Kt as unlined,Nt as withLines};
@@ -1,25 +0,0 @@
1
- var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as Ye}from"./chunk.SDO3U72B.js";import{Ac as eo,Ia as Xn,Id as ao,L as Zn,Ma as kt,Oa as Jn,Yd as so,_a as Qn,ad as to,ae as lo,ce as Ue,de as Rt,hd as no,jd as oo,pd as ro,sd as io}from"./chunk.VSCIXAHN.js";import{a as $e,b as H}from"./chunk.AJZBJBMO.js";var To=$e(w=>{"use strict";var _t=Symbol.for("react.transitional.element"),ti=Symbol.for("react.portal"),ni=Symbol.for("react.fragment"),oi=Symbol.for("react.strict_mode"),ri=Symbol.for("react.profiler"),ii=Symbol.for("react.consumer"),ai=Symbol.for("react.context"),si=Symbol.for("react.forward_ref"),li=Symbol.for("react.suspense"),di=Symbol.for("react.memo"),xo=Symbol.for("react.lazy"),ui=Symbol.for("react.activity"),So=Symbol.iterator;function ci(e){return e===null||typeof e!="object"?null:(e=So&&e[So]||e["@@iterator"],typeof e=="function"?e:null)}var Eo={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Po=Object.assign,Ao={};function he(e,t,n){this.props=e,this.context=t,this.refs=Ao,this.updater=n||Eo}he.prototype.isReactComponent={};he.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")};he.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function ko(){}ko.prototype=he.prototype;function Ht(e,t,n){this.props=e,this.context=t,this.refs=Ao,this.updater=n||Eo}var Dt=Ht.prototype=new ko;Dt.constructor=Ht;Po(Dt,he.prototype);Dt.isPureReactComponent=!0;var wo=Array.isArray;function Lt(){}var C={H:null,A:null,T:null,S:null},Ro=Object.prototype.hasOwnProperty;function Nt(e,t,n){var o=n.ref;return{$$typeof:_t,type:e,key:t,ref:o!==void 0?o:null,props:n}}function fi(e,t){return Nt(e.type,t,e.props)}function jt(e){return typeof e=="object"&&e!==null&&e.$$typeof===_t}function pi(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var vo=/\/+/g;function It(e,t){return typeof e=="object"&&e!==null&&e.key!=null?pi(""+e.key):t.toString(36)}function yi(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(Lt,Lt):(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 ge(e,t,n,o,r){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(i){case"bigint":case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case _t:case ti:a=!0;break;case xo:return a=e._init,ge(a(e._payload),t,n,o,r)}}if(a)return r=r(e),a=o===""?"."+It(e,0):o,wo(r)?(n="",a!=null&&(n=a.replace(vo,"$&/")+"/"),ge(r,t,n,"",function(u){return u})):r!=null&&(jt(r)&&(r=fi(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(vo,"$&/")+"/")+a)),t.push(r)),1;a=0;var s=o===""?".":o+":";if(wo(e))for(var l=0;l<e.length;l++)o=e[l],i=s+It(o,l),a+=ge(o,t,n,i,r);else if(l=ci(e),typeof l=="function")for(e=l.call(e),l=0;!(o=e.next()).done;)o=o.value,i=s+It(o,l++),a+=ge(o,t,n,i,r);else if(i==="object"){if(typeof e.then=="function")return ge(yi(e),t,n,o,r);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return a}function ot(e,t,n){if(e==null)return e;var o=[],r=0;return ge(e,o,"","",function(i){return t.call(n,i,r++)}),o}function mi(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var bo=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!==null&&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)},gi={map:ot,forEach:function(e,t,n){ot(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ot(e,function(){t++}),t},toArray:function(e){return ot(e,function(t){return t})||[]},only:function(e){if(!jt(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};w.Activity=ui;w.Children=gi;w.Component=he;w.Fragment=ni;w.Profiler=ri;w.PureComponent=Ht;w.StrictMode=oi;w.Suspense=li;w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=C;w.__COMPILER_RUNTIME={__proto__:null,c:function(e){return C.H.useMemoCache(e)}};w.cache=function(e){return function(){return e.apply(null,arguments)}};w.cacheSignal=function(){return null};w.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var o=Po({},e.props),r=e.key;if(t!=null)for(i in t.key!==void 0&&(r=""+t.key),t)!Ro.call(t,i)||i==="key"||i==="__self"||i==="__source"||i==="ref"&&t.ref===void 0||(o[i]=t[i]);var i=arguments.length-2;if(i===1)o.children=n;else if(1<i){for(var a=Array(i),s=0;s<i;s++)a[s]=arguments[s+2];o.children=a}return Nt(e.type,r,o)};w.createContext=function(e){return e={$$typeof:ai,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:ii,_context:e},e};w.createElement=function(e,t,n){var o,r={},i=null;if(t!=null)for(o in t.key!==void 0&&(i=""+t.key),t)Ro.call(t,o)&&o!=="key"&&o!=="__self"&&o!=="__source"&&(r[o]=t[o]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var s=Array(a),l=0;l<a;l++)s[l]=arguments[l+2];r.children=s}if(e&&e.defaultProps)for(o in a=e.defaultProps,a)r[o]===void 0&&(r[o]=a[o]);return Nt(e,i,r)};w.createRef=function(){return{current:null}};w.forwardRef=function(e){return{$$typeof:si,render:e}};w.isValidElement=jt;w.lazy=function(e){return{$$typeof:xo,_payload:{_status:-1,_result:e},_init:mi}};w.memo=function(e,t){return{$$typeof:di,type:e,compare:t===void 0?null:t}};w.startTransition=function(e){var t=C.T,n={};C.T=n;try{var o=e(),r=C.S;r!==null&&r(n,o),typeof o=="object"&&o!==null&&typeof o.then=="function"&&o.then(Lt,bo)}catch(i){bo(i)}finally{t!==null&&n.types!==null&&(t.types=n.types),C.T=t}};w.unstable_useCacheRefresh=function(){return C.H.useCacheRefresh()};w.use=function(e){return C.H.use(e)};w.useActionState=function(e,t,n){return C.H.useActionState(e,t,n)};w.useCallback=function(e,t){return C.H.useCallback(e,t)};w.useContext=function(e){return C.H.useContext(e)};w.useDebugValue=function(){};w.useDeferredValue=function(e,t){return C.H.useDeferredValue(e,t)};w.useEffect=function(e,t){return C.H.useEffect(e,t)};w.useEffectEvent=function(e){return C.H.useEffectEvent(e)};w.useId=function(){return C.H.useId()};w.useImperativeHandle=function(e,t,n){return C.H.useImperativeHandle(e,t,n)};w.useInsertionEffect=function(e,t){return C.H.useInsertionEffect(e,t)};w.useLayoutEffect=function(e,t){return C.H.useLayoutEffect(e,t)};w.useMemo=function(e,t){return C.H.useMemo(e,t)};w.useOptimistic=function(e,t){return C.H.useOptimistic(e,t)};w.useReducer=function(e,t,n){return C.H.useReducer(e,t,n)};w.useRef=function(e){return C.H.useRef(e)};w.useState=function(e){return C.H.useState(e)};w.useSyncExternalStore=function(e,t,n){return C.H.useSyncExternalStore(e,t,n)};w.useTransition=function(){return C.H.useTransition()};w.version="19.2.8"});var W=$e((es,Mo)=>{"use strict";Mo.exports=To()});var Wo=$e(at=>{"use strict";var ki=Symbol.for("react.transitional.element"),Ri=Symbol.for("react.fragment");function jo(e,t,n){var o=null;if(n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),"key"in t){n={};for(var r in t)r!=="key"&&(n[r]=t[r])}else n=t;return t=n.ref,{$$typeof:ki,type:e,key:o,ref:t!==void 0?t:null,props:n}}at.Fragment=Ri;at.jsx=jo;at.jsxs=jo});var De=$e((us,Go)=>{"use strict";Go.exports=Wo()});var pe={focusId:null,relation:null,expanded:[],pins:{}},Ze=e=>{let t=Number(e);return Number.isFinite(t)?t:null};function Q(e){let t=new URLSearchParams;e.focusId&&t.set("focus",e.focusId),e.relation&&t.set("relation",e.relation),e.overview&&t.set("overview","1"),e.zoom&&t.set("zoom","1"),e.past&&t.set("past","1"),e.shown&&e.shown.length>0&&t.set("show",[...e.shown].sort().join(",")),e.selection!==void 0&&e.selection.length>0&&t.set("sel",[...e.selection].sort().join(",")),e.expanded.length>0&&t.set("expand",[...e.expanded].sort().join(","));for(let o of Object.keys(e.pins).sort()){let r=e.pins[o];t.set(`pin.${o}`,`${Xe(r.x)},${Xe(r.y)}`)}e.pan&&(e.pan.x!==0||e.pan.y!==0)&&t.set("pan",`${Xe(e.pan.x)},${Xe(e.pan.y)}`);for(let o of Object.keys(e.within??{}).sort()){let r=e.within[o];r.length>0&&t.set(`in.${o}`,r)}e.q&&e.q.trim().length>0&&t.set("q",e.q);let n=t.toString();return n?`#${n}`:"#"}function Yr(e){return e&&e.startsWith("agg:")?`aggregate:${e.slice(4)}`:e}function Je(e){let t=e.includes("#")?e.slice(e.indexOf("#")+1):e,n=new URLSearchParams(t),o=Object.create(null);for(let[m,y]of n){if(!m.startsWith("pin."))continue;let[g,b]=y.split(","),k=g===void 0?null:Ze(g),p=b===void 0?null:Ze(b);k===null||p===null||(o[m.slice(4)]={x:k,y:p})}let r=Object.create(null);for(let[m,y]of n)!m.startsWith("in.")||y.length===0||(r[m.slice(3)]=y);let i=n.get("view");i&&i.length>0&&r.view===void 0&&(r.view=i);let a=n.get("pan")?.split(",")??[],s=a[0]===void 0?null:Ze(a[0]),l=a[1]===void 0?null:Ze(a[1]),u=(n.get("sel")??"").split(",").filter(m=>m.length>0).sort(),c=n.get("overview")==="1";return{...u.length>0?{selection:u}:{},...c?{overview:!0}:{},...n.get("zoom")==="1"?{zoom:!0}:{},...n.get("past")==="1"?{past:!0}:{},...n.get("show")?{shown:[...new Set(n.get("show").split(",").filter(Boolean))].sort()}:{},...s!==null&&l!==null?{pan:{x:s,y:l}}:{},...Object.keys(r).length>0?{within:r}:{},...n.get("q")?.trim()?{q:n.get("q")}:{},focusId:Yr(n.get("focus")),relation:n.get("relation"),expanded:(n.get("expand")??"").split(",").filter(m=>m.length>0&&(c||!m.startsWith("kind:"))).sort(),pins:o}}function Da(e){let t=Je(e);return Q(t)==="#"?{...t,overview:!0}:t}function Na(e){let t=Q(e);return t==="#overview=1"?"":t}function Xe(e){return Math.round(e*100)/100}function co(e,t){return Q(e)===Q(t)}var uo="edge:";function fo(e){if(!e.startsWith(uo))return null;let t=e.slice(uo.length).split(":");if(t.length!==3)return null;let[n,o,r]=t;if(!n||!o||!r)return null;try{return{kind:decodeURIComponent(n),from:decodeURIComponent(o),to:decodeURIComponent(r)}}catch{return null}}function Tt(e){let{pan:t,...n}=e;return{...n,pins:{}}}function z(e,t){if(t===e.focusId)return{...e,focusId:t};let n=Tt(e);return{...n.within?.q!==void 0?le(n,"q",null):n,focusId:t}}function po(e,t){return{...e,relation:t}}function le(e,t,n){let o={...e.within??{}};if(n===null?delete o[t]:o[t]=n,Object.keys(o).length===0){let{within:r,...i}=e;return i}return{...e,within:o}}function ye(e,t){if(t!==e.overview&&(e=Tt(e)),!t){let n=e.expanded.filter(o=>!o.startsWith("kind:"));return{...e,overview:!1,expanded:n}}return{...e,overview:t}}function Qe(e,t){if(t.length===0){let{selection:n,...o}=e;return o}return{...e,selection:[...t]}}function _e(e,t){if(t!==(e.zoom===!0)&&(e=Tt(e)),!t){let{zoom:n,...o}=e;return o}return{...e,zoom:!0}}function et(e,t){let n=new Set(e.expanded);return n.has(t)?n.delete(t):n.add(t),{...e,expanded:[...n].sort()}}var nt="aggregate:",tt="kind:";function Mt(e){return`${tt}${e}`}function me(e){return e.startsWith(tt)?e.slice(tt.length):null}var Ga="kinds:beyond";function Zr(e){let t=me(e);return t?[t]:de(e)}function ee(...e){return`${nt}${[...e].sort().join("+")}`}function yo(e){return e.startsWith(nt)}function de(e){return!yo(e)||e.includes("|")?[]:e.slice(nt.length).split("+").filter(Boolean)}function mo(e,t,n={}){let o=me(t);if(o!==null&&e.overview&&n.ownPicture!==!0)return et(e,t);let r=o!==null?ee(o):t;if(e.zoom&&e.focusId===r&&!(o!==null&&n.carry))return _e(e,!1);if(o!==null&&n.carry){let i=ye({...z(e,r),relation:null},!1);return le(_e(i,!0),"q",n.carry)}return _e({...z(e,r),relation:null},!0)}function Xr(e,t,n){return le(ye(z(e,ee(t)),!1),"view",n)}function Fa(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var go="aggregate:";function Ot(e){return e.startsWith(go)&&e.includes("|")}var Ct=e=>e?.off===!0,Jr=e=>e!==void 0&&!Ct(e)&&(e.fast!==void 0||e.thinking!==void 0||e.answer!==void 0||e.decide!==void 0||e.complete!==void 0||e.turn!==void 0),ho=e=>e!==void 0&&!Ct(e)&&(e.fast!==void 0||e.decide!==void 0),Qr=e=>e?.suggestOnOpen!==!1&&ho(e),ei=e=>e?.hoverChips===!0&&ho(e);var Vt={};var Oo=H(W(),1),hi={turns:[],outcomes:new Map,busy:!1,pending:null,draft:null,draftNote:null},Co=e=>`graview:seat:${e}`;function Si(e){if(!e)return{};try{let t=sessionStorage.getItem(e);if(!t)return{};let n=JSON.parse(t);return{...Array.isArray(n.turns)?{turns:n.turns}:{},...Array.isArray(n.outcomes)?{outcomes:new Map(n.outcomes)}:{},...n.draft?.drawn?{draft:n.draft}:{}}}catch{return{}}}function wi(e,t){if(e)try{sessionStorage.setItem(e,JSON.stringify({turns:t.turns.slice(-40),outcomes:[...t.outcomes],draft:t.draft}))}catch{}}function Wt(e){let t=e===null?null:Co(e),n={...hi,...Si(t)},o=new Set,r=(i,a=!0)=>{n=i,a&&wi(t,n);for(let s of[...o])s()};return{get:()=>n,subscribe(i){return o.add(i),()=>void o.delete(i)},setTurns:i=>r({...n,turns:i(n.turns)}),settle:(i,a)=>r({...n,outcomes:new Map(n.outcomes).set(i,a)}),setBusy:i=>r({...n,busy:i},!1),ask:i=>r({...n,pending:i.trim()||null}),takePending(){let i=n.pending;return i!==null&&r({...n,pending:null},!1),i},setDraft:(i,a=null)=>r({...n,draft:i,draftNote:a})}}function vi(e){return(0,Oo.useSyncExternalStore)(e.subscribe,e.get,e.get)}var Io=H(W(),1),bi={entries:[],ghost:null,loaded:!1};function Vo(e,t){let n=new Map(e.map(o=>[o.id,o]));for(let o of t)n.set(o.id,{...n.get(o.id),...o});return[...n.values()].sort((o,r)=>o.at<r.at?1:o.at>r.at?-1:0)}function Gt(e){let t=bi,n=new Set,o=r=>{t=r;for(let i of[...n])i()};return{get:()=>t,subscribe:r=>(n.add(r),()=>n.delete(r)),record:r=>{o({...t,entries:Vo(t.entries,[r])}),Promise.resolve(e()?.keep?.(r)).catch(i=>{console.warn("The host did not keep an AI interaction:",i)})},setGhost:r=>o({...t,ghost:r}),load:()=>{if(t.loaded)return;o({...t,loaded:!0});let r=e()?.load;r&&Promise.resolve(r()).then(i=>o({...t,entries:Vo(t.entries,i)})).catch(i=>{console.warn("The host's AI interactions could not be read:",i)})}}}function xi(e){return(0,Io.useSyncExternalStore)(e.subscribe,e.get,e.get)}function Lo(e){return e?.closest?.("[data-graview-pick]")?.getAttribute("data-graview-pick")??null}var rt=H(W(),1),it=(0,rt.createContext)(void 0),Ei=()=>(0,rt.useContext)(it);var P=H(W(),1),He=(0,P.createContext)(null);function Ho(){return(0,P.useContext)(He)}function Pi(e,t){let n=Ho(),o=(0,P.useMemo)(()=>n?n.live.seenBy(t):e,[n,e,t]),r=(0,P.useRef)(0),i=(0,P.useCallback)(a=>o.subscribe(()=>{r.current+=1,a()}),[o]);return(0,P.useSyncExternalStore)(i,()=>r.current,()=>0),o}var Do=Ye(()=>(__graviewPreload(import.meta.url,["./chunk.YFVJUHAK.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.FC6AF6CC.js")));function Ft(e){let[,t]=(0,P.useReducer)(o=>o+1,0),n=e.publishing?.mode==="on-publish"&&!no();return(0,P.useEffect)(()=>{n&&Do().then(t,()=>{})},[n]),!n}var _o,Ai=400;function Kt(e,t,n){let o=(0,P.useContext)(He),r=o!==null&&o.owns(e,t),[i,a]=(0,P.useState)(null),[s,l]=(0,P.useState)(_o);(0,P.useEffect)(()=>{if(s||r||i===null)return;let E=!0;return Do().then(I=>{_o=I,E&&l(I)},()=>{}),()=>{E=!1}},[s,r,i]);let[u,c]=(0,P.useState)(0),[m,y]=(0,P.useMemo)(()=>r||i===null||!s?[]:[i>=e.log.length?void 0:s.askArchived(e,i,n)??s.askDeclaration(n,i),s.keptOf(e,n)],[r,e,i,n,s,u]),g=m&&"waiting"in m?m.waiting:void 0,b=m&&"seq"in m?m:null,[k,p]=(0,P.useState)(void 0);(0,P.useEffect)(()=>{if(!g)return;let E=!0,I=setTimeout(()=>E&&p(g),Ai);return g.then(()=>E&&c(_=>_+1)),()=>{E=!1,clearTimeout(I)}},[g]);let S=g!==void 0&&k!==g||b!==null,v=(0,P.useMemo)(()=>{if(r||i===null||i>=e.log.length||!s||S)return null;try{let E=s.pastAt(e,i,n);return{seq:i,at:E.past?.at,store:E}}catch{return null}},[r,e,i,n,s,S,u]),A=(0,P.useRef)(null),x=S?A.current:v;(0,P.useEffect)(()=>{A.current=x},[x]);let F=(0,P.useCallback)(E=>a(E===null?null:E>=e.log.length?Number.POSITIVE_INFINITY:E),[e]),D=(0,P.useCallback)((E,I)=>[e,x?.store].some(_=>_!==void 0&&(_===E||_.seenBy(I)===E)),[e,x]),N=i!==null,V=(0,P.useMemo)(()=>({past:x,open:N,show:F,live:e,host:n,owns:D,archive:b,kept:y}),[x,N,F,e,n,D,b,y]);return r?o:V}var No=H(W(),1),Bt=(0,No.createContext)(null);var Fo=e=>`graview:setting:${e}`;function Ko(){return localStorage}function Bo(e,t){try{let n=(t??Ko()).getItem(Fo(e.name));if(n!==null&&e.options.some(o=>o.value===n))return n}catch{}return e.initial}function qo(e,t,n){try{(n??Ko()).setItem(Fo(e.name),t)}catch{}}function zo(e,t){if(typeof document>"u")return;let n=document.documentElement;if(e.honored==="root-font-size"){n.style.fontSize=t===e.initial?"":t;return}let o=`graview${e.name.replace(/-([a-z0-9])/g,(r,i)=>i.toUpperCase()).replace(/^[a-z]/,r=>r.toUpperCase())}`;t===e.initial?delete n.dataset[o]:n.dataset[o]=t}var L=H(W(),1);function qt(e){return Ue(e)}var Ti=12,Mi=4;function Oi(e,t,n){let o=qt(t);return e.get(o)??{participant:o,who:t.id??t.kind,at:null,mode:"docked",since:n,trail:[]}}var st=(e,t)=>t===null||e[e.length-1]===t?e:[...e,t].slice(-Ti);function $o(e,t){let n=e.filter(r=>r.length>0);if(n.length===0)return null;if(n.length<=Mi)return n[0];let o=new Set(n.map(r=>t(r)).filter(r=>r!==void 0));return o.size===1?Mt([...o][0]):n[0]}function zt(e,t,n){let o=new Map(e);if(t.type==="rest"){for(let[a,s]of e)s.mode!=="asking"&&s.mode!=="docked"&&t.at-s.since>=t.holdMs&&o.set(a,{...s,mode:"docked",at:null,trail:[],say:void 0,confidence:void 0});return o}if(t.author.kind!=="agent")return o;let r=Oi(e,t.author,t.at),i=a=>o.set(r.participant,{...r,...a,since:t.at});switch(t.type){case"read":{let a=$o(t.ids,n);return i({at:a,mode:"reading",trail:st(r.trail,a)}),o}case"about-to-write":case"write":{let a=$o(t.ids,n);return i({at:a,mode:"writing",trail:st(r.trail,a),say:void 0,confidence:void 0}),o}case"refused":return i({at:t.where,mode:"refused",say:t.say,confidence:void 0,trail:st(r.trail,t.where)}),o;case"asking":return i({at:t.where??r.at,mode:"asking",say:t.say,...t.confidence!==void 0?{confidence:t.confidence}:{confidence:void 0},trail:st(r.trail,t.where)}),o;case"said":return i({say:t.say,...t.confidence!==void 0?{confidence:t.confidence}:{confidence:void 0},...t.caption?{caption:t.caption}:{}}),o;case"over":return i({over:t.over}),o;case"home":return i({at:null,mode:"docked",trail:[],say:void 0,confidence:void 0,over:null}),o;default:return o}}var Uo="graview:session";function Yo(e){let t=()=>typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID().slice(0,8):Math.random().toString(36).slice(2,10);try{let n=e??sessionStorage,o=n.getItem(Uo);if(o)return o;let r=t();return n.setItem(Uo,r),r}catch{return t()}}var $t={name:"share-where",title:"Where you are",description:"Whether the others here see which stop you are on.",honored:"root-attribute",options:[{value:"shared",label:"Shown"},{value:"private",label:"Hidden"}],initial:"shared"},Ut={name:"share-over",title:"What you point at",description:"Whether the others see the thing under your pointer, outlined in your color.",honored:"root-attribute",options:[{value:"private",label:"Kept to yourself"},{value:"shared",label:"Outlined for others"}],initial:"private"},Zo=[$t,Ut],Ci=800;function Xo(e){let{channel:t,store:n,view:o,principal:r,session:i,robots:a,seatWho:s,settingValues:l,setView:u,ttlMs:c=lo,people:m,seats:y}=e,[g,b]=(0,L.useState)(()=>new Map),[k,p]=(0,L.useState)(null),[S,v]=(0,L.useState)(null),[A,x]=(0,L.useState)(null),F=typeof r.id=="string"&&r.id.length>0,D=F&&(l[$t.name]??$t.initial)==="shared",N=D&&(l[Ut.name]??Ut.initial)==="shared",V=qt({kind:r.kind,...r.id?{id:r.id}:{},session:i}),E=F?Qn(r,{graph:n.graph,schema:n.schema,...y?{seats:y}:{},...m?{people:m}:{}}):"",I=s?a.get(`agent:${s}:${i}`):void 0,_=(0,L.useMemo)(()=>!t||!D?null:{participant:V,kind:r.kind,name:E,...r.onBehalfOf?.id?{onBehalfOf:r.onBehalfOf.id,...r.onBehalfOf.name?{onBehalfOfName:r.onBehalfOf.name}:{}}:{},hue:eo(r.id??"nobody"),stop:A??Q(o),...N?{over:k}:{},...I?{robot:{at:I.at,mode:I.mode}}:{},at:new Date().toISOString()},[t,D,N,V,E,r.id,r.kind,r.onBehalfOf?.id,r.onBehalfOf?.name,o,A,k,I?.at,I?.mode]),We=(0,L.useRef)(null),Pe=R=>R&&t?.here({...R,caret:We.current??void 0,at:new Date().toISOString()}),Ae=(0,L.useCallback)(R=>{We.current=R,Pe(_)},[t,_]);(0,L.useEffect)(()=>{if(!_)return;Pe(_);let R=setInterval(()=>Pe(_),Ci);return()=>clearInterval(R)},[t,_]),(0,L.useEffect)(()=>t?t.onWho(B=>b(Rt(new Map,B,Date.now(),c))):void 0,[t,c]);let ke=g.size>0;(0,L.useEffect)(()=>{if(!ke)return;let R=setInterval(()=>{b(B=>{let X=Rt(B,[],Date.now(),c);return X.size===B.size?B:X})},Math.max(250,Math.min(1e3,c/4)));return()=>clearInterval(R)},[ke,c]),(0,L.useEffect)(()=>{if(!t||typeof window>"u")return;let R=()=>t.leave();return window.addEventListener("pagehide",R),()=>window.removeEventListener("pagehide",R)},[t]),(0,L.useEffect)(()=>{if(!N||typeof document>"u")return;let R=null,B=X=>{let ie=Lo(X.target);ie!==R&&(R=ie,p(ie))};return document.addEventListener("pointermove",B,{passive:!0}),()=>document.removeEventListener("pointermove",B)},[N]);let ue=(0,L.useRef)(null),K=S?g.get(S)??null:null,oe=(0,L.useCallback)(R=>{ue.current=null,v(R)},[]);(0,L.useEffect)(()=>{if(S){if(!K){v(null);return}K.stop!==ue.current?.stop&&(ue.current={stop:K.stop,at:Date.now()},u(Je(K.stop)))}},[S,K,u]),(0,L.useEffect)(()=>{let R=ue.current;!S||R===null||Date.now()-R.at<400||co(o,Je(R.stop))||v(null)},[o,S]),(0,L.useEffect)(()=>{if(!S||typeof document>"u")return;let R=B=>{B.key==="Escape"&&v(null)};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[S]);let Re=_!==null,re=(0,L.useMemo)(()=>Re?{participant:V,name:E}:null,[Re,V,E]);return(0,L.useMemo)(()=>({who:g,sharing:re,following:K,follow:oe,sayWhere:x,sayCaret:Ae}),[g,re,K,oe,Ae])}var U=H(W(),1);function Jo(e){return Ue(e.author)}function Vi(e,t){return e.length>1?"co-edited":t==="rule"?"rule":t==="agent"?"autonomous":"directed"}function Qo(e,t,n,o,r){let i=new Map;for(let[l,u]of e)o-u.at<r&&i.set(l,u);let a=new Set(n.flatMap(l=>l.nodeIds)),s=(l,u,c)=>{let m=i.get(l),y=m?.participants.includes(Jo(u))?m.participants:[...m?.participants??[],Jo(u)];i.set(l,{at:o,manner:Vi(y,u.author.kind),intent:u.intent,wrote:(m?.wrote??!1)||(c.wrote??!1),read:(m?.read??!1)||(c.read??!1),broke:(m?.broke??!1)||a.has(l),participants:y})};for(let l of t){for(let u of l.writes)s(u,l,{wrote:!0});for(let u of l.reads)l.writes.includes(u)||s(u,l,{read:!0})}for(let l of n)for(let u of l.nodeIds){let c=i.get(u);i.set(u,{at:o,manner:c?.manner??"rule",intent:c?.intent??l.message,wrote:c?.wrote??!1,read:c?.read??!1,broke:!0,participants:c?.participants??["rule::"]})}return i}var Ii=2600;function er(e,t=Ii){let[n,o]=(0,U.useState)(()=>new Map),r=(0,U.useRef)(n);r.current=n;let i=(0,U.useRef)(null),a=(0,U.useCallback)(l=>{r.current=l,o(l),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{r.current=new Map,o(new Map)},t)},[t]);(0,U.useEffect)(()=>{let l=e.violations(),u=e.subscribe((c,m)=>{let y=e.violations(),g=io(e.allInvariants(),l,y).introduces;l=y,a(Qo(r.current,m,g.map(b=>({nodeIds:b.nodeIds,message:b.message})),Date.now(),t))});return()=>{u(),i.current&&clearTimeout(i.current)}},[e,t,a]);let s=(0,U.useCallback)(l=>{l.reads.length!==0&&a(Qo(r.current,[Li(l)],[],Date.now(),t))},[t,a]);return{activity:n,noteAttention:s}}function Li(e){return{id:`attention:${e.intent}`,seq:-1,batch:"attention",author:e.author,intent:e.intent,mutation:null,primitives:[],reads:e.reads,writes:[],at:new Date().toISOString()}}var d=H(W(),1);function tr(){let e=null,t=new Set,n=new Set,o=r=>{for(let i of n)i(r)};return{subscribe(r){return t.add(r),t.size===1&&o(!0),()=>{t.delete(r),t.size===0&&(e=null,o(!1))}},snapshot:()=>e,set(r){if(!(e===r||e&&r&&e.x===r.x&&e.y===r.y)){e=r;for(let i of t)i()}},get listeners(){return t.size},onActive(r){return n.add(r),()=>void n.delete(r)}}}var lt=H(W(),1),_i=e=>e.definitions.some(t=>Xn(t).size>0);function nr(e,t,n){let[o,r]=(0,lt.useState)(void 0),i=(n.roles??[]).join("\0"),a=n.onBehalfOf?JSON.stringify(n.onBehalfOf):"";return(0,lt.useEffect)(()=>{if(!t||!_i(e.schema)){r(void 0);return}let s=!0,l=!1,u=e.graph,c=()=>{l||(l=!0,queueMicrotask(()=>{l=!1,s&&e.reread()}))},m=Jn(t,{kind:n.kind,...n.id===void 0?{}:{id:n.id},...n.roles?{roles:n.roles}:{},...n.onBehalfOf?{onBehalfOf:n.onBehalfOf}:{}},c);return kt(u,m.read),r(m),e.reread(),()=>{s=!1,kt(u,void 0)}},[e,t,n.kind,n.id,i,a]),o}function or(){let e=!1,t=new Set;return{moving:()=>e,set(n){if(n!==e){e=n;for(let o of t)o()}},subscribe(n){return t.add(n),()=>t.delete(n)}}}var te=H(De(),1),Hi="graview:place-menu",Ne=(0,d.createContext)(null),sr=(0,d.createContext)("scene");function Di({mode:e,children:t}){return(0,te.jsx)(sr.Provider,{value:e,children:t})}function Ni(){return(0,d.useContext)(sr)}var lr={kind:"human"},ji=[],Wi=[],Gi=[],Yt=[];function dr(e,t){let n=(0,d.useId)();(0,d.useEffect)(()=>{if(!globalThis.__graviewWatch)return;let o=t??lr,r=()=>ro(e,o,n);r();let i,a=e.subscribe(()=>{clearTimeout(i),i=setTimeout(r,250)});return()=>{clearTimeout(i),a(),globalThis.__graviewWatch?.unseen?.({words:[],from:n,gone:!0})}},[e,t,n])}var Fi=()=>{try{return typeof location<"u"&&new URLSearchParams(location.search).get("as")==="published"?"published":void 0}catch{return}},Ki={off:!0};function Bi({store:e,views:t,initialView:n,scheme:o="dark",initialSelection:r,principal:i,as:a,seats:s=ji,onSeat:l,people:u=Wi,memory:c,presenceTtlMs:m,app:y,settings:g=y?.settings??Gi,presence:b,typing:k,brand:p,locale:S,timeZone:v,onKeepLens:A,providers:x,ai:F,files:D,resolveApp:N,history:V,linkedRecords:E,menuSections:I,keptViews:_,onExport:We,subscriptions:Pe,dismissals:Ae,whileAway:ke,signIn:ue,view:K,onViewChange:oe,children:Re}){let re=(0,d.useContext)(Ne),R=I??re?.menuSections,B=ue??re?.signIn,X=_??re?.keptViews,ie=We??re?.onExport,[_r,Hr]=(0,d.useState)(null),ce=_r??i??s[0]?.principal??lr,Ge=Kt(e,ce,V),pn=Ge.past&&Ge.live===e?Ge.past.store:e,wt=a??Fi(),vt=!Ft(e),j=(0,d.useMemo)(()=>vt?e:pn.seenBy(ce,wt?{as:wt}:void 0),[vt,e,pn,ce,wt]);dr(e,ce);let[ae]=(0,d.useState)(()=>Yo(c)),[yn,Dr]=(0,d.useState)(!1),mn=(0,d.useCallback)(()=>Dr(!0),[]),se=(0,d.useMemo)(()=>b?[...g,...Zo]:g,[g,b]),[bt]=(0,d.useState)(()=>n??Qt(t,e.schema)),[Nr,gn]=(0,d.useState)(()=>Qe(bt??pe,r??bt?.selection??[])),Te=(0,d.useRef)(bt??pe).current,[hn,jr]=(0,d.useState)(null),[Sn,Wr]=(0,d.useState)(null),Z=(0,d.useContext)(Ne),[wn]=(0,d.useState)(()=>Z?.seatTalk??Wt(p?.name??e.schema.kinds.join(","))),xt=F??Z?.ai??Vt,Fe=(0,d.useMemo)(()=>xt.off?Ki:xt,[xt]),vn=(0,d.useRef)(Fe.interactions);vn.current=Fe.interactions;let[bn]=(0,d.useState)(()=>Z?.aiDesk??Gt(()=>vn.current)),[Gr]=(0,d.useState)(()=>Z?.subscriptions??oo()),xn=Pe??Z?.subscriptions??Gr,Et=A??Z?.onKeepLens,Ke=y??Z?.app,Be=S??Z?.locale,Fr=p?.locale??Ke?.brand?.locale,qe=v??Z?.timeZone;Zn({reader:Be,app:Fr,readerTimeZone:qe,appTimeZone:p?.timeZone??Ke?.brand?.timeZone});let En=(0,d.useRef)(null),Pn=(0,d.useCallback)(f=>{En.current=f},[]),An=(0,d.useCallback)(f=>En.current?.whereIs(f)??null,[]),[kn]=(0,d.useState)(()=>tr()),[Rn]=(0,d.useState)(()=>or()),[Pt,Kr]=(0,d.useState)(null),[Me,Tn]=(0,d.useState)(()=>new Map),Oe=(0,d.useRef)(Me);Oe.current=Me;let Ce=(0,d.useRef)(null),At=(0,d.useCallback)(f=>j.graph.getNode(f)?.kind,[j]),J=(0,d.useCallback)(f=>{let h=zt(Oe.current,f,At);Oe.current=h,Tn(h),Ce.current&&clearTimeout(Ce.current),[...h.values()].some(O=>O.mode!=="docked"&&O.mode!=="asking")&&(Ce.current=setTimeout(()=>{let O=zt(Oe.current,{type:"rest",at:Date.now(),holdMs:Jt},At);Oe.current=O,Tn(O)},Jt+20))},[At]),Mn=(0,d.useCallback)(f=>J({...f,at:f.at??Date.now()}),[J]),On=(0,d.useCallback)(f=>{Kr(f),f&&J({type:"home",author:{kind:"agent",id:f,session:ae},at:Date.now()})},[J,ae]);(0,d.useEffect)(()=>j.subscribe((f,h)=>{for(let T of h)T.author.kind==="agent"&&J({type:"write",author:T.author,ids:T.writes,at:Date.now()})}),[j,J]),(0,d.useEffect)(()=>()=>{Ce.current&&clearTimeout(Ce.current)},[]);let $=(0,d.useMemo)(()=>({...ce,session:ae}),[ce,ae]),Cn=nr(j,E,$),Vn=(0,d.useCallback)(f=>{Hr(f),l?.(f)},[l]),[Ve,Br]=(0,d.useState)(()=>Object.fromEntries(se.map(f=>[f.name,Bo(f,c)])));(0,d.useEffect)(()=>{for(let f of se)zo(f,Ve[f.name]??f.initial)},[se,Ve]);let In=(0,d.useCallback)((f,h)=>{let T=se.find(O=>O.name===f);!T||!T.options.some(O=>O.value===h)||(qo(T,h,c),Br(O=>({...O,[f]:h})))},[se,c]),[Ln,qr]=(0,d.useState)(null),{activity:_n,noteAttention:Hn}=er(j),Dn=(0,d.useCallback)(f=>{Hn(f),J({type:"read",author:f.author,ids:f.reads,at:Date.now()})},[Hn,J]),fe=(0,d.useCallback)(f=>{if(me(f)!==null||de(f).length>0||Ot(f))return!0;let h=fo(f);return h?j.graph.allEdges().some(T=>T.kind===h.kind&&T.from===h.from&&T.to===h.to):j.graph.getNode(f)!==void 0},[j]),Nn=(0,d.useCallback)(f=>{let h=f.selection??Yt,T=h.filter(fe),O=T.length===h.length?f:Qe(f,T);return O.focusId!==null&&!fe(O.focusId)&&(O=z(O,null)),O},[fe]),Ie=(0,d.useCallback)(f=>{let h=Nn(f),T=ar(j,$,h.shown);if(h.focusId!==null&&T.size>0){let O=de(h.focusId),Yn=j.graph.getNode(h.focusId);(O.length>0?O.every(Ur=>T.has(Ur)):Yn?T.has(Yn.kind):!1)&&(h={...h,focusId:null})}if(!h.overview&&h.focusId===null){let O=Te.focusId!==null&&!fe(Te.focusId)?Qt(t,e.schema)??{...pe,overview:!0}:Te;O.focusId!==null&&fe(O.focusId)?h={...h,focusId:O.focusId}:O.overview===!0&&(h={...h,overview:!0})}return h},[Nn,fe,j,Te,$,t,e.schema]),q=Ie(K??Nr),jn=(0,d.useMemo)(()=>ar(j,$,q.shown),[j,$,q.shown]),Wn=(0,d.useMemo)(()=>[...j.modules.administered.entries()].map(([f,h])=>{let T=j.mayAdminister(f,$);return{name:f,...h.description?{description:h.description}:{},kinds:h.kinds??[],canShow:T,shown:T&&(q.shown??[]).includes(f)}}),[j,$,q.shown]),Le=(0,d.useCallback)(f=>{let h=T=>Ie(typeof f=="function"?f(T):f);if(K!==void 0){oe?.(h(K));return}oe&&oe(h(q)),gn(T=>h(T))},[q,oe,K,Ie]);(0,d.useEffect)(()=>{K===void 0&&gn(f=>{let h=Ie(f);return h===f?f:h})},[q,K,Ie]);let Gn=q.selection??Yt,Fn=(0,d.useCallback)(f=>{Le(h=>Qe(h,typeof f=="function"?f(h.selection??Yt):f))},[Le]),{who:ze,following:Kn,follow:Bn,sayWhere:zr,sayCaret:qn,sharing:zn}=Xo({channel:b,store:j,view:q,principal:$,session:ae,robots:Me,seatWho:Pt,settingValues:Ve,setView:Le,seats:s,people:u,...m!==void 0?{ttlMs:m}:{}}),$r=(0,d.useMemo)(()=>({store:j,scheme:o,views:t,view:q,setView:Le,homeView:Te,selection:Gn,setSelection:Fn,menuAt:hn,setMenuAt:jr,whereIs:An,pointer:kn,motion:Rn,registerScene:Pn,robots:Me,noteSeat:Mn,seatWho:Pt,registerSeatWho:On,actsDoor:Sn,registerActsDoor:Wr,seatTalk:wn,aiDesk:bn,...c?{memory:c}:{},who:ze,following:Kn,follow:Bn,sayWhere:zr,sharing:zn,session:ae,ai:Fe,resolveApp:N,linkedRecords:E,menuSections:R,...X?{keptViews:X}:{},...ie?{onExport:ie}:{},subscriptions:xn,dismissals:Ae,whileAway:ke,signIn:B,linkedReads:Cn,movedByHand:yn,noteMoved:mn,emphasis:Ln,setEmphasis:qr,activity:_n,noteAttention:Dn,principal:$,seats:s,people:u,takeSeat:Vn,settings:se,settingValues:Ve,chooseSetting:In,hiddenKinds:jn,administered:Wn,...x?{providers:x}:{},...p?{brand:p}:{},...Et?{onKeepLens:Et}:{},app:Ke,...Be?{locale:Be}:{},...qe?{timeZone:qe}:{}}),[j,o,t,q,Le,Gn,Fn,hn,An,kn,Rn,Pn,Me,Mn,Pt,On,Sn,wn,bn,c,ze,Kn,Bn,zn,ae,Fe,N,E,R,X,ie,xn,Ae,ke,B,Cn,yn,mn,Ln,_n,Dn,$,s,u,Vn,se,Ve,In,jn,Wn,x,p,Et,Ke,Be,qe]),$n=(0,d.useMemo)(()=>k?{typing:k,sayCaret:qn,who:ze}:null,[k,qn,ze]),Un=D?(0,te.jsx)(it.Provider,{value:D,children:Re}):Re;return(0,te.jsx)(Ne.Provider,{value:$r,children:(0,te.jsx)(He.Provider,{value:Ge,children:(0,te.jsx)(Yi,{children:vt?null:$n?(0,te.jsx)(Bt.Provider,{value:$n,children:Un}):Un})})})}var ur=(0,d.createContext)(null),Zt,Xt=new Set,qi=e=>(Xt.add(e),()=>void Xt.delete(e)),rr=()=>Zt;function zi(e){if(!Zt){Zt=e;for(let t of[...Xt])t()}}var $i=300;function Ui(e){let t=0;return async(n,o)=>{let r=++t;return await new Promise(i=>setTimeout(i,$i)),r===t?e(n,o):[]}}function Yi({children:e}){let{store:t,view:n,views:o,principal:r,hiddenKinds:i,selection:a,ai:s}=ne(),l=dt(),u=n.q,c=n.focusId,m=!!(u&&u.trim().length>0),y=(0,d.useSyncExternalStore)(qi,rr,rr),g=(0,d.useMemo)(()=>m&&y?{flagged:new Set(t.violations().flatMap(A=>A.nodeIds)),touched:y.touchWeights(t.log.all())}:null,[t,l,m,y]),b=c?t.graph.getNode(c)?.kind??me(c)??(de(c).length===1?de(c)[0]:void 0):void 0,k=(0,d.useMemo)(()=>s.near&&Ui(s.near),[s.near]),p=(0,d.useMemo)(()=>!u||!g||!y?null:y.search(t,u,{...b?{inKind:b}:{},principal:r,places:o.places(),kinds:t.schema.kinds.filter(A=>!i.has(A)),from:[...a,...c&&t.graph.has(c)?[c]:[]],flagged:g.flagged,touched:g.touched,limit:200,rank:k}),[t,u,r,o,i,a,c,b,g,k]),[S,v]=(0,d.useState)();return(0,d.useEffect)(()=>void p?.later?.then(A=>v([p,A])),[p]),(0,te.jsx)(ur.Provider,{value:S?.[0]===p?S[1]:p,children:e})}var ir=new WeakMap;function Gs(e){let t=ir.get(e);return t||ir.set(e,t=new Set(e.matched)),t}function Zi(){return(0,d.useContext)(ur)}function ne(){let e=(0,d.useContext)(Ne);if(!e)throw new Error("useGraview must be used inside a <GraviewProvider>.");return e}function en(){return(0,d.useContext)(Ne)??null}function dt(){let{store:e}=ne(),t=(0,d.useRef)(null),n=(0,d.useRef)(null),o=(0,d.useCallback)(()=>(n.current!==e&&(n.current=e,t.current=null),t.current??=e.graph.allNodes(),t.current),[e]),r=(0,d.useCallback)(i=>e.subscribe(()=>{t.current=null,i()}),[e]);return(0,d.useSyncExternalStore)(r,o,o)}function Xi(e){let{store:t}=ne(),n=(0,d.useCallback)(r=>t.subscribe(r),[t]),o=(0,d.useCallback)(()=>e===null?void 0:t.graph.getNode(e),[t,e]);return(0,d.useSyncExternalStore)(n,o,o)}function ar(e,t,n){let o=new Set(e.modules.disabledKinds);for(let r of e.kindsKeptFrom(t))o.add(r);for(let[r,i]of e.modules.administered)if(!(e.mayAdminister(r,t)&&(n??[]).includes(r)))for(let a of i.kinds??[])o.add(a);return o}var Jt=2600;var cr=new WeakSet,Ji=e=>cr.has(e),Qi=e=>void cr.add(e);function Qt(e,t){let n=so(e.arrangement?.()?.first,t,e.places());if(!(!n||n.to==="home"))return n.to==="place"?{...pe,focusId:ee(n.place.kind),within:{view:n.place.as}}:{...pe,focusId:ee(n.kind)}}var fr=H(W(),1),ea=(0,fr.createContext)(!1);var ut=Symbol.for("graview.default-view");function pr(e){return Object.defineProperty(e,ut,{value:!0,enumerable:!1}),e}function yr(e){return typeof e=="function"&&e[ut]===!0}var ct=Symbol.for("graview.replaces-page");function mr(e){return Object.defineProperty(e,ct,{value:!0,enumerable:!1}),e}function gr(e){return typeof e=="function"&&e[ct]===!0}var ft=Symbol.for("graview.bleeds");function hr(e){return Object.defineProperty(e,ft,{value:!0,enumerable:!1}),e}function Sr(e){return typeof e=="function"&&e[ft]===!0}var pt=Symbol.for("graview.previews");function wr(e,t={}){return Object.defineProperty(e,pt,{value:t,enumerable:!1}),e}function vr(e){return typeof e=="function"?e[pt]:void 0}function ta(e){return ao(e)}function na(e,t){if(t===e)return e;for(let r of t.registrations())e.register(r.kind,r,r.view,r);let n=t.arrangement?.();n&&e.arrange?.(n);let o=t.homes?.()??[];if(o.length>0)for(let r of o)e.home?.(r.view,r.name!==void 0?{name:r.name}:void 0);else{let r=t.homeView?.();r&&e.home?.(r)}return e}var M=H(W(),1),Y=H(De(),1),tn=new Set,yt=0;function nn(e){return()=>{yt+=1;let t=e();return t.then(()=>void(yt-=1),()=>void(yt-=1)),t}}var oa=()=>yt,gt=(0,M.createContext)(null);function ra(){return{waiting:new Map,at:0}}function ia(e){for(let[t,n]of e.waiting)n<e.at&&e.waiting.delete(t);e.at+=1}var aa=e=>e?.waiting.size??0;function Er(e,t){e?.waiting.set(t,e.at)}function Pr(e){let t=(0,M.useContext)(gt);(0,M.useLayoutEffect)(()=>{t?.waiting.delete(e)},[t,e])}function sa(e){let t={},n=!1,o=new Set,r=(0,M.lazy)(nn(()=>e().then(a=>{n=!0;let s=a.default;function l(u){return Pr(t),(0,M.createElement)(s,u)}return{default:l}},a=>{for(let s of o)s.waiting.delete(t);throw a})));function i(a){let s=(0,M.useContext)(gt);return!n&&s&&(o.add(s),Er(s,t)),(0,M.createElement)(r,a)}return i}var Ar=!1,kr=!1,mt=new Set;function la(){Ar=!0}function da(){kr=!0;for(let e of[...mt])e();mt.clear()}var Rr=()=>kr||!Ar;function ua(e){return Rr()?(e(),()=>{}):(mt.add(e),()=>void mt.delete(e))}var br=!1;function on(){for(let e of[...tn])e()}function ca(){br||typeof window>"u"||(br=!0,window.addEventListener("online",on))}function rn(e){let t,n=!1,o=!1,r,i=0,a=new Set,s=()=>{i+=1;for(let y of[...a])y()},l=y=>(a.add(y),()=>void a.delete(y)),u=()=>i,c=()=>void m().catch(()=>{});function m(){if(n)return Promise.resolve(t);if(r)return r;let y=e().then(g=>(t=g,n=!0,o=!1,r=void 0,tn.delete(c),s(),g),g=>{throw r=void 0,o=!0,tn.add(c),ca(),s(),g});return y.catch(()=>{}),r=y,y}return{load:m,prefetch:c,get current(){return t},get failed(){return o},part(y,g={}){let b=g.what??"This part",k={};function p(A){(0,M.useSyncExternalStore)(l,u,u),Pr(k);let x=(0,M.useRef)(null),F=(0,M.useRef)(null),D=(0,M.useRef)(!1);return(0,M.useEffect)(()=>{o&&r===void 0&&c()},[]),n&&typeof document<"u"&&x.current!==null&&document.activeElement===x.current&&(D.current=!0),(0,M.useLayoutEffect)(()=>{if(!(!n||!D.current)){D.current=!1;for(let N=F.current?.nextElementSibling??null;N!==null;N=N.nextElementSibling){let V=N.matches(xr)?N:N.querySelector(xr);if(V instanceof HTMLElement){V.focus();return}}}}),n?(0,Y.jsxs)(Y.Fragment,{children:[D.current?(0,Y.jsx)("span",{ref:F,hidden:!0}):null,y(t,A)]}):g.quiet?null:(0,Y.jsx)(fa,{what:b,button:x,...g.as?{as:g.as}:{}})}let S=(0,M.lazy)(nn(()=>m().then(()=>({default:p}),()=>({default:p}))));function v(A){let x=(0,M.useContext)(gt),[F]=(0,M.useState)(()=>n||o);return!n&&!o&&Er(x,k),(0,M.createElement)(F?p:S,A)}return v}}}var xr="button,a[href],input,select,textarea,[tabindex]:not([tabindex='-1'])";function fa({what:e,button:t,as:n="p"}){let r=typeof navigator<"u"&&navigator.onLine===!1?`${e} will load when you're back online.`:`${e} didn't load.`;return(0,Y.jsxs)(n,{"data-testid":"lazy-part-missing",style:{margin:0,fontSize:"0.875rem",color:"var(--graview-ink-muted)"},children:[(0,Y.jsx)("span",{role:"status",children:r})," ",(0,Y.jsx)("button",{ref:t,type:"button","data-testid":"lazy-part-retry",onClick:on,style:{font:"inherit",fontWeight:600,color:"var(--graview-ink)",background:"none",border:"1px solid var(--graview-edge)",borderRadius:6,padding:"2px 10px"},children:"Try again"})]})}var we=H(W(),1);function pa(){let{selection:e,setSelection:t}=ne();return(0,we.useMemo)(()=>({selection:e,set:n=>t(n),clear:()=>t([]),toggle:n=>t(o=>o.includes(n)?o.filter(r=>r!==n):[...o,n]),isSelected:n=>e.includes(n)}),[e,t])}function ya(){let{store:e}=ne(),t=dt();return(0,we.useMemo)(()=>ma(e),[e,t])}var Tr=new WeakMap;function ma(e){let t=Tr.get(e);if(!t){let n={violations:null};e.subscribe(()=>{n.violations=null}),Tr.set(e,n),t=n}return t.violations??=e.violations(),t.violations}function ga(){let{view:e,setView:t}=ne();return(0,we.useMemo)(()=>({view:e,url:Q(e),focus:n=>t(o=>z(o,n)),show:n=>t(o=>po(o,n)),toggle:n=>t(o=>et(o,n)),go:n=>t(n)}),[e,t])}var Se={at:0,depth:0,listeners:new Set,tell(){for(let e of this.listeners)e()}};typeof window<"u"&&window.addEventListener("popstate",e=>{let t=e.state;Se.at=typeof t?.graview=="number"?t.graview:0,Se.at>Se.depth&&(Se.depth=Se.at),Se.tell()});var G=H(W(),1),sn={profile:{trigger:"profile-button",pane:"profile",opens:"press",focus:"into",drawn:["shell","embed"]},problems:{trigger:"standing",pane:"problems",opens:"press",focus:"into",drawn:["shell","embed"]},places:{trigger:"app-places-open",pane:"app-places",opens:"press",focus:"into",drawn:["embed"]},here:{trigger:"here-open",pane:"here-list",opens:"press",focus:"into",drawn:["shell","embed","pages"]},suggested:{trigger:"suggested-button",pane:"suggested",opens:"press",focus:"into",drawn:["shell","embed","pages"]},activity:{trigger:"activity-button",pane:"activity",opens:"press",focus:"into",drawn:["shell","embed","pages"]},find:{trigger:"find-box",pane:"find-strip",opens:"typing",focus:"stays",drawn:["shell"]},districts:{trigger:"beyond-more",pane:"beyond-list",opens:"press",focus:"into",drawn:["shell","embed"]},acts:{trigger:null,pane:"context-menu",opens:"context-menu",focus:"into",drawn:["shell","embed","pages"]},arrange:{trigger:"arrange-add",pane:"arrange-list",opens:"press",focus:"into",drawn:["pages"]},"studio-ask":{trigger:"studio-agent",pane:"studio-agent-panel",opens:"press",focus:"into",drawn:["studio"]}},ha={position:"fixed",inset:"auto",margin:0,zIndex:to("popover"),boxSizing:"border-box"},ht=6,ve=8,Sa=e=>typeof e.showPopover=="function";function St(e){try{return e.matches(":popover-open")}catch{return!1}}function wa(e){if(typeof e=="function"){let o=e();return o?{left:o.x,right:o.x,top:o.y,bottom:o.y}:null}let t=e.current;if(!t||!t.isConnected)return null;let n=t.getBoundingClientRect();return{left:n.left,right:n.right,top:n.top,bottom:n.bottom}}function ln(e,t,n={}){let o=wa(t);if(!o)return;let r={width:document.documentElement.clientWidth||innerWidth,height:innerHeight},i=e.dataset.graviewDesignedHeight??=e.style.maxHeight;e.style.maxHeight=i;let a=e.getBoundingClientRect(),s=r.height-o.bottom-ht-ve,l=o.top-ht-ve,u=a.height<=s||s>=l,c=Math.max(96,Math.floor(u?s:l)),m=Math.min(a.height,c);a.height>c&&(e.style.maxHeight=i?`min(${i}, ${c}px)`:`${c}px`);let y=a.width,g=n.align==="start"?o.left:o.right-y,b=typeof t=="function"?null:t.current?.closest("[data-graview-embed]")?.getBoundingClientRect();b&&y<=b.right-b.left&&(g<b.left?g=o.left+y<=b.right?o.left:b.left:g+y>b.right&&(g=o.right-y>=b.left?o.right-y:b.right-y));let k=y>=r.width-2*ve?Math.max(0,(r.width-y)/2):Math.max(ve,Math.min(g,r.width-ve-y)),p=u?o.bottom+ht:Math.max(ve,o.top-ht-m);e.style.left=`${Math.round(k)}px`,e.style.top=`${Math.round(p)}px`}function Mr(e,t,n,o={}){let r=o.align??"end";(0,G.useLayoutEffect)(()=>{let i=e.current;if(!t||!i)return;if(Sa(i)&&!St(i))try{i.showPopover(),ba()}catch{}let a=0,s=u=>{u?.target instanceof Node&&i.contains(u.target)||(cancelAnimationFrame(a),a=requestAnimationFrame(()=>ln(i,n,{align:r})))};ln(i,n,{align:r}),addEventListener("resize",s),addEventListener("scroll",s,!0);let l=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>s());return l?.observe(i),()=>{if(cancelAnimationFrame(a),removeEventListener("resize",s),removeEventListener("scroll",s,!0),l?.disconnect(),i.isConnected&&St(i))try{i.hidePopover()}catch{}}},[t,e,r])}var dn=new Set;function va(e){return dn.add(e),()=>dn.delete(e)}function ba(){for(let e of dn)if(!(!e.isConnected||!St(e)))try{e.hidePopover(),e.showPopover()}catch{}}var be=null,xa='button:not([disabled]), [href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])';function Ea(e){for(let t of e.querySelectorAll(xa))if(t.closest("[hidden]")===null&&getComputedStyle(t).visibility!=="hidden")return t;return e}var an=()=>{let e=document.activeElement;return e===null||e===document.body};function Pa(e,t={}){let{at:n,returnTo:o,onOpenChange:r}=t,i=t.popover!==!1,[a,s]=(0,G.useState)(!1),l=t.open??a,u=(0,G.useRef)(null),c=(0,G.useRef)(null),m=(0,G.useCallback)(v=>{u.current=v},[]),y=(0,G.useCallback)(v=>{c.current=v},[]),g=`graview-popover-${(0,G.useId)().replace(/:/g,"")}`,b=(0,G.useRef)({onOpenChange:r,returnTo:o,controlled:t.open!==void 0});b.current={onOpenChange:r,returnTo:o,controlled:t.open!==void 0};let k=(0,G.useCallback)(v=>{b.current.controlled||s(v),b.current.onOpenChange?.(v)},[]),p=(0,G.useCallback)(()=>{(document.querySelector(`[aria-controls="${g}"]`)??u.current??b.current.returnTo?.()??null)?.focus({preventScroll:!0})},[g]),S=(0,G.useCallback)(v=>{let A=c.current,x=typeof document>"u"?null:document.activeElement,F=x===null||x===document.body||A!==null&&A.contains(x);k(!1),!(!v||!F)&&(p(),requestAnimationFrame(()=>{an()&&p()}))},[k,p]);return Mr(c,i&&l,n??u,t.align?{align:t.align}:{}),(0,G.useEffect)(()=>{if(!i||!l)return;let v={name:e,close:()=>S(!1)};if(be&&be.close!==v.close&&be.close(),be=v,sn[e].focus==="into"){let V=c.current;V&&!V.contains(document.activeElement)&&Ea(V).focus({preventScroll:!0})}let A=V=>{V.key==="Escape"&&S(!0)},x=V=>{let E=V.target;if(!(E instanceof Node))return;let I=c.current;if(I?.contains(E)||u.current?.contains(E))return;let _=E instanceof Element?E.closest('[role="dialog"], [role="alertdialog"]'):null;_&&!(I&&_.contains(I))||(S(!1),sn[e].focus==="into"&&requestAnimationFrame(()=>{(an()||I!==null&&I.contains(document.activeElement))&&p()}))},F=null,D=null,N=V=>{let E=V.target;if(!(E instanceof Element))return;let I=c.current,_=E.closest('[role="dialog"], [role="alertdialog"]');!_||I&&(I.contains(_)||_.contains(I))||(F=_,S(!1))};return document.addEventListener("keydown",A),document.addEventListener("pointerdown",x,!0),document.addEventListener("focusin",N),()=>{document.removeEventListener("keydown",A),document.removeEventListener("pointerdown",x,!0),document.removeEventListener("focusin",N);let V=F;V&&typeof MutationObserver<"u"&&(D?.disconnect(),D=new MutationObserver(()=>{V.isConnected||(D?.disconnect(),requestAnimationFrame(()=>{(an()||document.activeElement.closest("[hidden]")!==null)&&p()}))}),D.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>D?.disconnect(),10*6e4)),be?.close===v.close&&(be=null)}},[i,l,e,S,p]),{open:l,setOpen:v=>v?k(!0):S(!0),toggle:()=>l?S(!0):k(!0),trigger:{ref:m,"aria-expanded":l,"aria-controls":g,"data-graview-popover-trigger":e},pane:{ref:y,id:g,popover:"manual",tabIndex:-1,"data-graview-popover":e,"data-graview-overlay":""}}}var xe=H(W(),1);var Or=(0,xe.createContext)(null);function Aa(){let e=(0,xe.useContext)(Or),t=en(),n=(o,r,i)=>t?.setView(a=>le(le(ye(z(a,ee(o)),!1),"view",r),"filter",i?.filter??null));return(0,xe.useMemo)(()=>e??{record:o=>{t&&(t.setView(r=>z(ye(r,!1),o)),t.setSelection([o]))},place:(o,r)=>{let i=t?.views.places().find(a=>a.as===o);i&&n(i.kind,i.as,r)},list:(o,r)=>n(o,null,r)},[e,t])}var Ee=H(W(),1);var ka=rn(Ye(()=>(__graviewPreload(import.meta.url,["./chunk.4MP72LPR.js","./chunk.SDO3U72B.js","./chunk.VSCIXAHN.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.TLWT67ON.js"))));function Ra(e,t,n){let o,r=!1,i=()=>{let{hidden:s,removed:l}=t.current();o||r||s.length+l.length===0||(o=()=>{},ka.load().then(u=>{r||(o=u.watchTidied(e,t,n))},String))};i();let a=t.onChange?.(i);return()=>{r=!0,a?.(),o?.()}}function Ta(e,t){let[n,o]=(0,Ee.useState)();return(0,Ee.useEffect)(()=>t?Ra(e,t,r=>o([e,r])):void 0,[e,t]),n?.[0]===e?n[1]:e}var Cr=H(W(),1),Ma=(0,Cr.createContext)(!1);var un=H(W(),1),Oa=(0,un.createContext)(null),Ca=(0,un.createContext)(null);var Vr=H(W(),1),Va=(0,Vr.createContext)(null);var Ir=H(W(),1),cn='button:not([disabled]), a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])',fn=e=>e instanceof HTMLElement&&(e.matches(cn)||e.hasAttribute("tabindex")),je=e=>typeof e.checkVisibility=="function"?e.checkVisibility():e.getClientRects().length>0;function Ia(e,t){let n=l=>l.replace(/["\\]/g,"\\$&"),o=t.getAttribute("data-testid"),r=t.getAttribute("data-graview-pick"),i=t.getAttribute("aria-label"),a=o?`[data-testid="${n(o)}"]`:r?`[data-graview-pick="${n(r)}"]`:i?`${t.tagName.toLowerCase()}[aria-label="${n(i)}"]`:null;if(!a)return null;let s=e.querySelector(a);return s&&fn(s)&&je(s)?s:null}var La=e=>e.isConnected&&fn(e)&&!e.matches(":disabled")&&e instanceof HTMLElement&&je(e);function Lr(e,t){let n=t?Ia(e,t):null;if(n)return n;let o=e.querySelector("[data-graview-view][tabindex]");if(o&&je(o))return o;for(let r of e.querySelectorAll(cn))if(je(r))return r;return fn(e)&&je(e)?e:null}function _a(e){(0,Ir.useEffect)(()=>{let t=e.current;if(!t||typeof MutationObserver>"u")return;let n=[],o=p=>{let S=p.target;if(S instanceof Element){n=[];for(let v=S;v&&v!==t.parentElement;v=v.parentElement)n.push(v)}},r=!1,i=!1,a=t.ownerDocument,s=()=>!i&&a.defaultView!==null,l=(p,S)=>void setTimeout(()=>s()&&S(),p),u=p=>void requestAnimationFrame(()=>s()&&p()),c=p=>{if(r=!1,i)return;let S=a.activeElement;if(!(!(S===null||S===a.body||S===a.documentElement)||n.length===0)){if(La(n[0])){p&&n[0]instanceof HTMLElement&&n[0].focus({preventScroll:!0});return}for(let A of n.slice(1)){if(!A.isConnected)continue;let x=Lr(A,n[0]);if(x){x.focus({preventScroll:!0}),n=[];return}}}},m=(p,S=Date.now()+2500)=>{l(100,()=>{c(p);let v=a.activeElement;(v===null||v===a.body||v===a.documentElement)&&n.length>0&&Date.now()<S&&m(p,S)})},y=()=>{r||n.length===0||(r=!0,l(60,()=>u(()=>{c(!1),m(!1)})))},g=p=>{if(!(p instanceof KeyboardEvent&&!["Enter"," ","Escape"].includes(p.key))){if(!(p instanceof KeyboardEvent)){let S=p.target instanceof Element?p.target.closest(cn):null,v=a.activeElement,A=v===null||v===a.body||v===a.documentElement;if(S&&A&&t.contains(S)){n=[];for(let x=S;x&&x!==t.parentElement;x=x.parentElement)n.push(x);l(150,()=>u(()=>{c(!1),m(!1)}));return}}!(p instanceof KeyboardEvent)&&!(p.target instanceof Node&&n[0]?.contains(p.target))||l(150,()=>u(()=>{c(!0),m(!0)}))}},b=new MutationObserver(()=>{n.length>0&&!n[0].isConnected&&y()}),k=p=>{p.relatedTarget===null&&y()};return t.addEventListener("focusin",o),t.addEventListener("focusout",k),t.addEventListener("click",g),t.addEventListener("keydown",g),b.observe(t,{childList:!0,subtree:!0}),()=>{i=!0,t.removeEventListener("focusin",o),t.removeEventListener("focusout",k),t.removeEventListener("click",g),t.removeEventListener("keydown",g),b.disconnect()}},[e])}export{pe as a,Q as b,Je as c,Da as d,Na as e,co as f,uo as g,fo as h,Tt as i,z as j,po as k,le as l,ye as m,Qe as n,_e as o,et as p,nt as q,Mt as r,me as s,Ga as t,Zr as u,ee as v,yo as w,de as x,mo as y,Xr as z,Fa as A,go as B,Ot as C,Jr as D,Qr as E,ei as F,W as G,Wt as H,vi as I,xi as J,Lo as K,it as L,Ei as M,He as N,Ho as O,Pi as P,Ft as Q,Kt as R,Bt as S,De as T,Hi as U,Ne as V,Di as W,Ni as X,dr as Y,Bi as Z,zi as _,Gs as $,Zi as aa,ne as ba,en as ca,dt as da,Xi as ea,Ji as fa,Qi as ga,Qt as ha,Or as ia,Aa as ja,ea as ka,pr as la,yr as ma,mr as na,gr as oa,hr as pa,Sr as qa,wr as ra,vr as sa,ta,na as ua,nn as va,oa as wa,gt as xa,ra as ya,ia as za,aa as Aa,sa as Ba,la as Ca,da as Da,Rr as Ea,ua as Fa,rn as Ga,Ta as Ha,Ma as Ia,Oa as Ja,Ca as Ka,Va as La,pa as Ma,ya as Na,ga as Oa,Se as Pa,_a as Qa,ha as Ra,St as Sa,Mr as Ta,va as Ua,Pa as Va};
2
- /*! Bundled license information:
3
-
4
- react/cjs/react.production.js:
5
- (**
6
- * @license React
7
- * react.production.js
8
- *
9
- * Copyright (c) Meta Platforms, Inc. and affiliates.
10
- *
11
- * This source code is licensed under the MIT license found in the
12
- * LICENSE file in the root directory of this source tree.
13
- *)
14
-
15
- react/cjs/react-jsx-runtime.production.js:
16
- (**
17
- * @license React
18
- * react-jsx-runtime.production.js
19
- *
20
- * Copyright (c) Meta Platforms, Inc. and affiliates.
21
- *
22
- * This source code is licensed under the MIT license found in the
23
- * LICENSE file in the root directory of this source tree.
24
- *)
25
- */
@@ -1 +0,0 @@
1
- import{a as ee,b as re,c as R}from"./chunk.5IEFTFKQ.js";import{a as O,b as B}from"./chunk.BRT27WON.js";import{a as Y,e as Z}from"./chunk.DCHQHKSA.js";import{e as z,f as J,g as _,h as Q,i as U,j as X}from"./chunk.RXYNW5QB.js";import"./chunk.PFSYXD6Q.js";import{G as q,Ia as j,Ja as M,M as H,O as T,T as G,ca as b,ja as x,ma as V,na as D,pa as C,ra as I}from"./chunk.4MP72LPR.js";import"./chunk.SDO3U72B.js";import"./chunk.VSCIXAHN.js";import"./chunk.FQLNBIQ5.js";import{b as v}from"./chunk.AJZBJBMO.js";var i=v(q(),1);var o=v(G(),1),ne=e=>({...e.node?{node:{id:e.node.id}}:{},...e.nodes?{nodes:e.nodes.map(n=>({id:n.id}))}:{},...e.label!==void 0?{label:e.label}:{},fidelity:e.fidelity,cardinality:e.cardinality,mode:e.mode,selected:e.selected,...e.implicated?{implicated:e.implicated}:{},...e.flagged?{flagged:e.flagged}:{}});function E(e){let n=T(),r=n?.past?.seq,s=n?.host?.viewAt,t=(0,i.useMemo)(()=>r===void 0||!s||e.draft?void 0:s(e.manifest.name,r),[s,r,e]);return(0,i.useMemo)(()=>t===null?null:t===void 0?e:{...e,worker:t},[t,e])}function N({definition:e,store:n,principal:r,input:s,goTo:t,places:a,scheme:d,brand:l,onFailure:m,drawsItsOwn:u,tick:p}){let w=(0,i.useRef)(null),f=(0,i.useRef)(null),y=H(),k=(0,i.useContext)(M),c=(0,i.useRef)({input:s,goTo:t,places:a,onFailure:m,brand:l,hostFiles:y,told:k});c.current={input:s,goTo:t,places:a,onFailure:m,brand:l,hostFiles:y,told:k},(0,i.useEffect)(()=>{let P=w.current;if(!P)return;let A=e.file??(c.current.hostFiles?.src?g=>c.current.hostFiles?.src?.(g)??g:void 0);typeof e.worker=="function"&&R(e.worker).catch(()=>{});let $=B(O,({mountWorkerView:g})=>{f.current=g(P,{manifest:e.manifest,worker:e.worker,store:n,principal:r,input:()=>c.current.input?.()??{},goTo:()=>c.current.goTo,places:()=>c.current.places?.()??[],brand:()=>c.current.brand,onFailure:(W,K)=>c.current.onFailure(W,K),...u?{fallback:!1}:{},...e.limits?{limits:e.limits}:{},...e.author?{author:e.author}:{},...e.onProblem?{onProblem:e.onProblem}:{},...e.asset?{asset:e.asset}:{},...A?{file:A}:{},...e.images?{images:e.images}:{},...e.links?{links:e.links}:{},files:()=>c.current.hostFiles,onContentHeight:W=>c.current.told?.(W)})});return()=>{$(),f.current?.dispose(),f.current=null}},[e,n,r]),(0,i.useEffect)(()=>f.current?.update(),[d,l,p]);let h=(0,o.jsx)("div",{ref:w,"data-worker-view-place":e.manifest.name,style:{minWidth:0}});if(!e.draft)return h;let F=e.manifest.title??e.manifest.name;return(0,o.jsxs)("div",{role:"group","aria-label":`Draft: ${F}`,"data-graview-draft-view":e.manifest.name,style:{display:"grid",gap:8,alignContent:"start",minWidth:0},children:[(0,o.jsxs)("p",{"data-testid":"draft-view-line",style:te,children:[(0,o.jsxs)("span",{children:["Draft \u2014 ",(0,o.jsx)("span",{style:{color:"var(--graview-ink)",fontWeight:600},children:F})]}),(0,o.jsx)("span",{"aria-hidden":"true",children:"\xB7"}),(0,o.jsx)("span",{children:"Not kept"})]}),h]})}var te={margin:0,display:"flex",flexWrap:"wrap",alignItems:"baseline",gap:"4px 8px",fontSize:"0.875rem",color:"var(--graview-ink-muted)",borderBottom:"1px solid var(--graview-edge)",paddingBottom:8};function L({view:e,props:n,fellBack:r}){return(0,o.jsx)("div",{"data-worker-view-fallback":"",...r?{"data-worker-view-fell-back":r.name,"data-worker-view-failed":r.reason}:{},style:{display:"contents"},children:(0,o.jsx)(e,{...n})})}function oe({name:e,reason:n,children:r}){return(0,o.jsx)("div",{"data-worker-view-fell-back":e,"data-worker-view-failed":n,style:{display:"contents"},children:r})}function S(e,n={}){let r=n.fallback,s=e.manifest.replaces==="page";function t(a){let d=b(),l=x(),m=(0,i.useContext)(j),[u,p]=(0,i.useState)(null),w=(0,i.useRef)(a);w.current=a;let f=E(e);if(!d)return null;if(f===null)return r&&!(m&&V(r)&&!s)?(0,o.jsx)(L,{view:r,props:a}):null;if(u&&r)return m&&V(r)&&!s?null:(0,o.jsx)(L,{view:r,props:a,fellBack:{name:e.manifest.name,reason:u}});let y=n.beside&&!(m&&V(n.beside))?n.beside:void 0,k=(0,o.jsx)(N,{definition:f,store:d.store,principal:d.principal,input:()=>ne(w.current),goTo:l,places:()=>d.views.places(),scheme:d.scheme,brand:d.brand,tick:a,drawsItsOwn:r!==void 0,onFailure:(c,h)=>{p(c),e.onFailure?.(c,h)}});return y?(0,o.jsxs)("div",{"data-worker-view-beside":e.manifest.name,style:{display:"grid",gap:12,minWidth:0},children:[k,(0,o.jsx)(y,{...a})]}):k}return t.displayName=`WorkerView(${e.manifest.name})`,t}function ae(e,n){let{manifest:r}=n;if(r.attach==="home"){if(!e.home)throw new Error(`The worker view "${r.name}" is the home's body: draw it with workerHome, on the home.`);let u=e.homes?.(),p=n.draft?void 0:u?u.filter(f=>f.name===void 0).at(-1)?.view:e.homeView?.(),w=S(n,p?{fallback:p}:{});return e.home(r.bleed===!0?C(w):w,n.draft?void 0:{name:r.name}),e}let s={cardinality:r.cardinality,fidelity:"full"},t=e.lookup(r.attach,s)??e.resolve(r.attach,s)?.view,a=r.cardinality==="one",d=n.draft===!0,l=S(n,{...t&&!d?{fallback:t}:{},...a&&r.replaces!=="page"&&t?{beside:t}:{}});r.replaces==="page"&&D(l);let m=t?.says;return a&&r.replaces!=="page"&&typeof m=="function"&&(l.says=m),r.bleed===!0&&C(l),l.flows=r.flows!==!1,r.heading==="own"&&(l.ownHeading=!0),I(l,r.scene?.maxHeight!==void 0?{maxHeight:r.scene.maxHeight}:{}),e.register(r.attach,s,l,r.title?{title:r.title,...d?{}:{name:r.name},lens:"view",...r.reads?.kinds?.length?{reads:r.reads.kinds}:{}}:d?void 0:{name:r.name}),e}function ie(e,n={}){let r=n.fallback;function s({context:t}){let a=b(),d=x(),[l,m]=(0,i.useState)(null),u=E(e);return l&&r?(0,o.jsx)(oe,{name:e.manifest.name,reason:l,children:(0,o.jsx)(r,{context:t})}):u===null&&r?(0,o.jsx)(r,{context:t}):u===null?null:(0,o.jsx)(N,{definition:u,store:t.store,principal:t.principal??a?.principal??{kind:"human"},goTo:d,...a?{places:()=>a.views.places(),scheme:a.scheme,brand:a.brand}:{},drawsItsOwn:r!==void 0,onFailure:(p,w)=>{m(p),e.onFailure?.(p,w)}})}return s.displayName=`WorkerHome(${e.manifest.name})`,s}export{J as checkManifest,ee as checkViewSource,Z as judgeCodeAct,z as manifestActs,U as readsComputed,ae as registerWorkerView,Y as sightIsTotal,_ as unreadEdges,Q as unreadEdgesSentence,re as viewScript,ie as workerHome,S as workerView,X as workerViewProps};