graview 0.1.69 → 0.1.71

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 (247) hide show
  1. package/dist/preview/chunk.23DATB5Y.js +1 -0
  2. package/dist/preview/chunk.2INDKSJI.js +1 -0
  3. package/dist/preview/chunk.3CLTABGP.js +1 -0
  4. package/dist/preview/chunk.3RRK6UTN.js +8 -0
  5. package/dist/preview/chunk.45HUV56Z.js +1 -0
  6. package/dist/preview/chunk.4HU2ILFY.js +1 -0
  7. package/dist/preview/{chunk.3VNOTHA5.js → chunk.4LWWXIM4.js} +1 -1
  8. package/dist/preview/chunk.4O64QV2Y.js +1 -0
  9. package/dist/preview/{chunk.PJL3I2IW.js → chunk.4QMAYVPU.js} +1 -1
  10. package/dist/preview/chunk.4UDST6IF.js +1 -0
  11. package/dist/preview/{chunk.6BNSDPZE.js → chunk.4YZ2A6SJ.js} +3 -3
  12. package/dist/preview/{chunk.523EFGHU.js → chunk.4ZEHLUXV.js} +1 -1
  13. package/dist/preview/{chunk.F4CDJBDS.js → chunk.5EQRIZ6I.js} +1 -1
  14. package/dist/preview/chunk.5OS4SYHE.js +1 -0
  15. package/dist/preview/{chunk.BO32A3W5.js → chunk.5PQV7GFE.js} +1 -1
  16. package/dist/preview/{chunk.PZ3KM3TY.js → chunk.5WCSQFS5.js} +1 -1
  17. package/dist/preview/{chunk.HU3KEWFO.js → chunk.64K5ELSQ.js} +1 -1
  18. package/dist/preview/{chunk.MKN7ADJB.js → chunk.67S2UWBT.js} +1 -1
  19. package/dist/preview/chunk.6A3KTD66.js +1 -0
  20. package/dist/preview/chunk.6BBUTKFC.js +23 -0
  21. package/dist/preview/chunk.6IMRCKB4.js +1 -0
  22. package/dist/preview/chunk.6L6RUOSF.js +5 -0
  23. package/dist/preview/{chunk.MH3AQO2R.js → chunk.6TBQV3NO.js} +1 -1
  24. package/dist/preview/chunk.6ZRVVRDQ.js +1 -0
  25. package/dist/preview/{chunk.YZKHTBTC.js → chunk.7FI75ZVE.js} +1 -1
  26. package/dist/preview/{chunk.IO5VFTXC.js → chunk.7KX36ENH.js} +1 -1
  27. package/dist/preview/chunk.7LPHWJB4.js +3 -0
  28. package/dist/preview/chunk.7MDGPTYF.js +1 -0
  29. package/dist/preview/{chunk.I4H2GS4O.js → chunk.7PWLRRUS.js} +2 -2
  30. package/dist/preview/{chunk.7T2P42VW.js → chunk.7TACFS7Q.js} +1 -1
  31. package/dist/preview/{chunk.KLEKC4ZX.js → chunk.7THS3DLZ.js} +1 -1
  32. package/dist/preview/{chunk.CSVDBDRZ.js → chunk.7XGU6KVF.js} +2 -2
  33. package/dist/preview/chunk.7ZLCA3WK.js +1 -0
  34. package/dist/preview/{chunk.RRCPEHM4.js → chunk.AIFT2HNP.js} +1 -1
  35. package/dist/preview/{chunk.LMZ2WMGH.js → chunk.ARGEGV5T.js} +1 -1
  36. package/dist/preview/{chunk.4FJ4OPSJ.js → chunk.BSWR5SGX.js} +1 -1
  37. package/dist/preview/{chunk.RNAL35ID.js → chunk.BWMPC7LK.js} +1 -1
  38. package/dist/preview/{chunk.KW7PHJYX.js → chunk.CEJIH3CN.js} +1 -1
  39. package/dist/preview/chunk.CEOQY5KS.js +5 -0
  40. package/dist/preview/{chunk.G43YUGNW.js → chunk.CGRX6SDE.js} +1 -1
  41. package/dist/preview/chunk.CPK6CYKN.js +111 -0
  42. package/dist/preview/{chunk.AZRICZKT.js → chunk.CVN2XFMF.js} +1 -1
  43. package/dist/preview/chunk.D4F6QX5L.js +1 -0
  44. package/dist/preview/{chunk.JPAE6K4E.js → chunk.D6ODKMOV.js} +1 -1
  45. package/dist/preview/{chunk.CCCONK73.js → chunk.DDSAFU3B.js} +1 -1
  46. package/dist/preview/{chunk.AHYMIVBX.js → chunk.DG3YNOH3.js} +1 -1
  47. package/dist/preview/chunk.DGYWNM5U.js +1 -0
  48. package/dist/preview/{chunk.ML5EHDZG.js → chunk.DHO3QZYK.js} +1 -1
  49. package/dist/preview/{chunk.EL7XXGQY.js → chunk.DJGZOPAS.js} +1 -1
  50. package/dist/preview/chunk.DOJCYXIJ.js +1 -0
  51. package/dist/preview/{chunk.CKSRW3LA.js → chunk.DX7RGK5G.js} +1 -1
  52. package/dist/preview/{chunk.QK7EUIPL.js → chunk.EA2KYBBR.js} +1 -1
  53. package/dist/preview/chunk.EEGVI266.js +1 -0
  54. package/dist/preview/{chunk.I7OFRF6N.js → chunk.EHLV3LND.js} +2 -2
  55. package/dist/preview/{chunk.QEBD7SC4.js → chunk.EJC7ACZT.js} +4 -2
  56. package/dist/preview/{chunk.QRNKGPAD.js → chunk.EJIQDMLU.js} +1 -1
  57. package/dist/preview/chunk.EOSN5DWW.js +1 -0
  58. package/dist/preview/{chunk.4RPKCW4J.js → chunk.EPSYX2SF.js} +1 -1
  59. package/dist/preview/chunk.EUXAIG73.js +1 -0
  60. package/dist/preview/chunk.EZQK23AB.js +1 -0
  61. package/dist/preview/{chunk.KKFKSJUN.js → chunk.F5O3HR7X.js} +1 -1
  62. package/dist/preview/chunk.F6MY6WJ4.js +1 -0
  63. package/dist/preview/{chunk.GTF6EMVE.js → chunk.F7KVEWFH.js} +1 -1
  64. package/dist/preview/{chunk.EEUCRZA3.js → chunk.FIUPDGUZ.js} +1 -1
  65. package/dist/preview/chunk.FNSVGSZI.js +1 -0
  66. package/dist/preview/chunk.FOHZPYUV.js +1 -0
  67. package/dist/preview/chunk.FW6M6GIU.js +32 -0
  68. package/dist/preview/{chunk.VXPEXUQF.js → chunk.G5AF5IXL.js} +1 -1
  69. package/dist/preview/chunk.G767NLBH.js +1 -0
  70. package/dist/preview/chunk.GFBE4VNT.js +1 -0
  71. package/dist/preview/{chunk.CDSHUWSK.js → chunk.GFOZVQBQ.js} +1 -1
  72. package/dist/preview/chunk.GKYJQE5A.js +1 -0
  73. package/dist/preview/chunk.GOVRX2YX.js +4 -0
  74. package/dist/preview/{chunk.T3PELB6I.js → chunk.H33XWGAY.js} +1 -1
  75. package/dist/preview/{chunk.2AL26ZPJ.js → chunk.H4BPTMED.js} +1 -1
  76. package/dist/preview/chunk.HLKDYI6J.js +1 -0
  77. package/dist/preview/{chunk.VEQIH7HR.js → chunk.HPFEYMGP.js} +1 -1
  78. package/dist/preview/chunk.HT35PAHI.js +21 -0
  79. package/dist/preview/{chunk.VR553M6J.js → chunk.HXRHEPPJ.js} +1 -1
  80. package/dist/preview/chunk.IPKODEOZ.js +1 -0
  81. package/dist/preview/{chunk.EP7YT7LT.js → chunk.IXYG65TM.js} +1 -1
  82. package/dist/preview/chunk.IZDB777E.js +1 -0
  83. package/dist/preview/{chunk.VBBH5R5T.js → chunk.JAPTTM6Y.js} +1 -1
  84. package/dist/preview/chunk.JCKIJSW7.js +25 -0
  85. package/dist/preview/{chunk.4R7H3GIL.js → chunk.JLNTE5CH.js} +2 -2
  86. package/dist/preview/chunk.JNK5WBSU.js +1 -0
  87. package/dist/preview/chunk.JREA2XDG.js +1 -0
  88. package/dist/preview/{chunk.WV6SP6IJ.js → chunk.KBJ3UUER.js} +1 -1
  89. package/dist/preview/{chunk.VBHV4TLG.js → chunk.KHRS2SKB.js} +1 -1
  90. package/dist/preview/{chunk.ISZFRLNJ.js → chunk.KJPLX72N.js} +1 -1
  91. package/dist/preview/chunk.KZUHXOZU.js +21 -0
  92. package/dist/preview/{chunk.6ZFYFT5A.js → chunk.L3MLGFIS.js} +1 -1
  93. package/dist/preview/{chunk.KEGL6NBD.js → chunk.L6P55HFW.js} +1 -1
  94. package/dist/preview/{chunk.N7A3T5QU.js → chunk.LDWWUKKX.js} +1 -1
  95. package/dist/preview/{chunk.CA2SYEYE.js → chunk.LHCGC3K6.js} +1 -1
  96. package/dist/preview/{chunk.BQORHDAH.js → chunk.LNKY6MT4.js} +1 -1
  97. package/dist/preview/chunk.LQ5J6YQW.js +1 -0
  98. package/dist/preview/{chunk.47VEV4BX.js → chunk.MEAUTBVM.js} +1 -1
  99. package/dist/preview/chunk.MEBKTW7H.js +17 -0
  100. package/dist/preview/{chunk.WQ7K5O2I.js → chunk.MFMC35ET.js} +1 -1
  101. package/dist/preview/chunk.MJ4T6YXI.js +1 -0
  102. package/dist/preview/chunk.MKJV3BM5.js +240 -0
  103. package/dist/preview/chunk.ML4X7VVK.js +1 -0
  104. package/dist/preview/chunk.MM7MLBGB.js +1 -0
  105. package/dist/preview/{chunk.5MOXQUZH.js → chunk.MQNW3O67.js} +1 -1
  106. package/dist/preview/{chunk.J2N7EKMX.js → chunk.MT252WP4.js} +1 -1
  107. package/dist/preview/chunk.MWWNKM3I.js +1 -0
  108. package/dist/preview/chunk.N3MXLORL.js +3 -0
  109. package/dist/preview/chunk.NH3VXTGX.js +1 -0
  110. package/dist/preview/{chunk.B422DSYN.js → chunk.NI4OPHTL.js} +1 -1
  111. package/dist/preview/chunk.NNGG7RCO.js +1 -0
  112. package/dist/preview/{chunk.LKM2R5UF.js → chunk.NXHEOHRR.js} +1 -1
  113. package/dist/preview/{chunk.TQQDUJLX.js → chunk.O5RPSUXV.js} +1 -1
  114. package/dist/preview/{chunk.FE3SINPK.js → chunk.OKHXXIMN.js} +1 -1
  115. package/dist/preview/chunk.ONAH6MC4.js +1 -0
  116. package/dist/preview/chunk.OOQG2AEF.js +1 -0
  117. package/dist/preview/{chunk.ZQYHNFRZ.js → chunk.OPMGQS5J.js} +1 -1
  118. package/dist/preview/{chunk.UHJSZ2XZ.js → chunk.OUF2QFZL.js} +1 -1
  119. package/dist/preview/{chunk.CUEIGKFG.js → chunk.OVSKPBPS.js} +1 -1
  120. package/dist/preview/chunk.OYMN3IFX.js +1 -0
  121. package/dist/preview/{chunk.QNC2OKLF.js → chunk.P43LPXXJ.js} +1 -1
  122. package/dist/preview/chunk.PGT4ZQDG.js +4 -0
  123. package/dist/preview/{chunk.WFJCC6G3.js → chunk.PQTXM4VY.js} +1 -1
  124. package/dist/preview/{chunk.KHKCTVHD.js → chunk.Q6GEPVQ7.js} +1 -1
  125. package/dist/preview/chunk.QDDDKEBH.js +1 -0
  126. package/dist/preview/{chunk.26RYER7Y.js → chunk.QJJWAYHB.js} +1 -1
  127. package/dist/preview/chunk.QK4QZVQG.js +1 -0
  128. package/dist/preview/{chunk.CLIC2QBA.js → chunk.QKRQPUCE.js} +1 -1
  129. package/dist/preview/{chunk.DU76ASS4.js → chunk.QNWGDG2Z.js} +2 -2
  130. package/dist/preview/{chunk.447RWLS7.js → chunk.QVBP4UZG.js} +2 -2
  131. package/dist/preview/chunk.RDUGUC7R.js +1 -0
  132. package/dist/preview/{chunk.EK3JXEZL.js → chunk.RHIP2UYE.js} +1 -1
  133. package/dist/preview/chunk.RJ7VSWTA.js +87 -0
  134. package/dist/preview/{chunk.JHAMSDAI.js → chunk.RO3D2RNP.js} +1 -1
  135. package/dist/preview/{chunk.C6CT6F4C.js → chunk.S2BMI23H.js} +1 -1
  136. package/dist/preview/{chunk.ZRBGYXAO.js → chunk.SGYZM6ZU.js} +1 -1
  137. package/dist/preview/{chunk.UPOYRCKI.js → chunk.SPJ34VHA.js} +1 -1
  138. package/dist/preview/{chunk.UAEOCWSG.js → chunk.T6KOL7TW.js} +1 -1
  139. package/dist/preview/{chunk.AUNQNTKY.js → chunk.T6UJEXFL.js} +3 -2
  140. package/dist/preview/chunk.TBEKEHFS.js +1 -0
  141. package/dist/preview/chunk.TO3ZKCA2.js +1 -0
  142. package/dist/preview/{chunk.FIY4RUK5.js → chunk.TQ3MNB6K.js} +1 -1
  143. package/dist/preview/{chunk.GG47EIKO.js → chunk.TRP66PHK.js} +1 -1
  144. package/dist/preview/{chunk.LGNGFG5V.js → chunk.TSZ2S3VG.js} +1 -1
  145. package/dist/preview/chunk.TTM5GQ2U.js +1 -0
  146. package/dist/preview/chunk.TUBY6SV3.js +1 -0
  147. package/dist/preview/{chunk.ZE5RSKXF.js → chunk.U5KJQFAP.js} +1 -1
  148. package/dist/preview/chunk.U6V4KZF5.js +1 -0
  149. package/dist/preview/chunk.UJ7RTNT4.js +1 -0
  150. package/dist/preview/{chunk.HCX6KPRF.js → chunk.UQZ2P6KD.js} +1 -1
  151. package/dist/preview/{chunk.CLZYNFFH.js → chunk.UZKBFI52.js} +1 -1
  152. package/dist/preview/{chunk.66TRDXYR.js → chunk.V5JB5UJS.js} +2 -2
  153. package/dist/preview/{chunk.3TKIZGC7.js → chunk.VDFQFLTU.js} +1 -1
  154. package/dist/preview/{chunk.IY3DV52G.js → chunk.VGYG2IBZ.js} +1 -1
  155. package/dist/preview/chunk.VICBF3MQ.js +2 -0
  156. package/dist/preview/{chunk.EQZPEOIW.js → chunk.VL3YDD7D.js} +1 -1
  157. package/dist/preview/{chunk.IYHY4VEC.js → chunk.VPFUOTY7.js} +1 -1
  158. package/dist/preview/chunk.VUDNQOOX.js +1 -0
  159. package/dist/preview/{chunk.P26ATAAI.js → chunk.VVIQSFM4.js} +1 -1
  160. package/dist/preview/{chunk.DO3FQM6R.js → chunk.W332P5T3.js} +6 -6
  161. package/dist/preview/{chunk.POKGLN4T.js → chunk.W3TJF4EH.js} +1 -1
  162. package/dist/preview/{chunk.D5JZQZ74.js → chunk.W5O5F4FT.js} +1 -1
  163. package/dist/preview/chunk.W6L2VAJG.js +2 -0
  164. package/dist/preview/{chunk.O7NYSO6F.js → chunk.WGH2P2YL.js} +1 -1
  165. package/dist/preview/{chunk.OD5QZHRC.js → chunk.WS5ORRGS.js} +1 -1
  166. package/dist/preview/{chunk.VQDL4EEP.js → chunk.WU6D3SPL.js} +1 -1
  167. package/dist/preview/{chunk.MV27WMNW.js → chunk.X2UYEA7H.js} +1 -1
  168. package/dist/preview/chunk.X45EITTK.js +18 -0
  169. package/dist/preview/{chunk.TAJBXG5U.js → chunk.X7U3JMBR.js} +1 -1
  170. package/dist/preview/chunk.XSM4OTF4.js +1 -0
  171. package/dist/preview/{chunk.DRAPVGQZ.js → chunk.XTHSPLZZ.js} +1 -1
  172. package/dist/preview/{chunk.VQOYFBEV.js → chunk.Y5WQD6KV.js} +1 -1
  173. package/dist/preview/chunk.YXVUJ3NB.js +1 -0
  174. package/dist/preview/{chunk.NRECR3NQ.js → chunk.Z22C2JJ4.js} +1 -1
  175. package/dist/preview/{chunk.TQRC5VAM.js → chunk.Z2BCOZDZ.js} +1 -1
  176. package/dist/preview/{chunk.S2NQRD6W.js → chunk.Z3TK2LJM.js} +1 -1
  177. package/dist/preview/chunk.ZGLOXN7O.js +1 -0
  178. package/dist/preview/{chunk.R7POSVUK.js → chunk.ZLQIGZXO.js} +2 -2
  179. package/dist/preview/{chunk.YJ4PFOPC.js → chunk.ZONRIOIA.js} +1 -1
  180. package/dist/preview/{chunk.QVCKTDG3.js → chunk.ZY3NAJDM.js} +1 -1
  181. package/dist/preview/index.html +55 -55
  182. package/dist/preview/page.js +2 -2
  183. package/package.json +7 -7
  184. package/dist/preview/chunk.2WFOKJB4.js +0 -1
  185. package/dist/preview/chunk.32SHA3EY.js +0 -1
  186. package/dist/preview/chunk.3D37E2G5.js +0 -1
  187. package/dist/preview/chunk.3PT3BU6K.js +0 -1
  188. package/dist/preview/chunk.3XTIYX6M.js +0 -1
  189. package/dist/preview/chunk.4O7WYLCK.js +0 -1
  190. package/dist/preview/chunk.5DU6FA5R.js +0 -1
  191. package/dist/preview/chunk.5TWRTGP6.js +0 -1
  192. package/dist/preview/chunk.6BR2SUAE.js +0 -1
  193. package/dist/preview/chunk.6TDVNWFU.js +0 -17
  194. package/dist/preview/chunk.6XBQDXT6.js +0 -3
  195. package/dist/preview/chunk.7L3I776Z.js +0 -1
  196. package/dist/preview/chunk.7OLKVOS6.js +0 -1
  197. package/dist/preview/chunk.AG7WJYM5.js +0 -3
  198. package/dist/preview/chunk.AMAOZVEO.js +0 -1
  199. package/dist/preview/chunk.AMV2ILR6.js +0 -1
  200. package/dist/preview/chunk.B5EFNTDA.js +0 -1
  201. package/dist/preview/chunk.BBLIT7S7.js +0 -1
  202. package/dist/preview/chunk.BSQI3KM2.js +0 -1
  203. package/dist/preview/chunk.CYEPHT7V.js +0 -1
  204. package/dist/preview/chunk.D3SWJ7OS.js +0 -1
  205. package/dist/preview/chunk.DHPXRDT5.js +0 -5
  206. package/dist/preview/chunk.DKUEZPGR.js +0 -1
  207. package/dist/preview/chunk.FWXW4T4I.js +0 -25
  208. package/dist/preview/chunk.GF5CZPZ7.js +0 -1
  209. package/dist/preview/chunk.GPBHUIZQ.js +0 -2
  210. package/dist/preview/chunk.GVFGS2HY.js +0 -1
  211. package/dist/preview/chunk.HGH27XZG.js +0 -23
  212. package/dist/preview/chunk.HMJXB6KC.js +0 -5
  213. package/dist/preview/chunk.HTEQCRVP.js +0 -1
  214. package/dist/preview/chunk.I7KN732Z.js +0 -2
  215. package/dist/preview/chunk.IAVIYJTL.js +0 -1
  216. package/dist/preview/chunk.IPKESOIU.js +0 -21
  217. package/dist/preview/chunk.IRNEWNUB.js +0 -1
  218. package/dist/preview/chunk.J7O23NKZ.js +0 -22
  219. package/dist/preview/chunk.JDUA5PH2.js +0 -1
  220. package/dist/preview/chunk.JN3WZGJY.js +0 -1
  221. package/dist/preview/chunk.JQEXH23N.js +0 -1
  222. package/dist/preview/chunk.KVQYOFDV.js +0 -1
  223. package/dist/preview/chunk.LAVLPYSC.js +0 -1
  224. package/dist/preview/chunk.MATUPDZ3.js +0 -1
  225. package/dist/preview/chunk.MD3N26BC.js +0 -23
  226. package/dist/preview/chunk.MHHNO3O2.js +0 -1
  227. package/dist/preview/chunk.MUWI54IP.js +0 -1
  228. package/dist/preview/chunk.NLZHNPDU.js +0 -93
  229. package/dist/preview/chunk.NSAGOOJW.js +0 -1
  230. package/dist/preview/chunk.NYLKG25K.js +0 -4
  231. package/dist/preview/chunk.OWO3OV62.js +0 -1
  232. package/dist/preview/chunk.ROYCJXPE.js +0 -1
  233. package/dist/preview/chunk.RZ73YG5K.js +0 -1
  234. package/dist/preview/chunk.SAWASNDO.js +0 -1
  235. package/dist/preview/chunk.SCVKHGO3.js +0 -1
  236. package/dist/preview/chunk.SM37MNS2.js +0 -1
  237. package/dist/preview/chunk.T2BZBR7S.js +0 -50
  238. package/dist/preview/chunk.TLPCYKLW.js +0 -3
  239. package/dist/preview/chunk.U563J5IM.js +0 -1
  240. package/dist/preview/chunk.U6QXLNHF.js +0 -15
  241. package/dist/preview/chunk.VBYJBW32.js +0 -1
  242. package/dist/preview/chunk.VHLL6VC6.js +0 -1
  243. package/dist/preview/chunk.W3WXI5B3.js +0 -1
  244. package/dist/preview/chunk.W43XWQRC.js +0 -1
  245. package/dist/preview/chunk.WJHLE73Y.js +0 -111
  246. package/dist/preview/chunk.ZT3ZG52B.js +0 -1
  247. package/dist/preview/chunk.ZU3RPI34.js +0 -1
@@ -0,0 +1 @@
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{d as be,f as ke}from"./chunk.7THS3DLZ.js";import{e as wt}from"./chunk.4QMAYVPU.js";import{a as yt,b as vt}from"./chunk.WS5ORRGS.js";import{h as ft}from"./chunk.ZONRIOIA.js";import{a as ie,b as it}from"./chunk.MQNW3O67.js";import{a as bt,d as kt,f as xt}from"./chunk.67S2UWBT.js";import{a as Ce,b as St}from"./chunk.7PWLRRUS.js";import{b as we,c as J,d as Y,e as st,f as lt}from"./chunk.NH3VXTGX.js";import{a as Se,b as ht}from"./chunk.6IMRCKB4.js";import{d as dt,e as re,f as j,g as ct,h as ye,i as gt,l as ut,n as oe}from"./chunk.NI4OPHTL.js";import{j as pt,p as ve}from"./chunk.3CLTABGP.js";import{c as mt}from"./chunk.CVN2XFMF.js";import{c as ot,d as Pe}from"./chunk.VVIQSFM4.js";import{b as rt}from"./chunk.TQ3MNB6K.js";import{$ as et,Ba as he,G as U,Oa as fe,Qa as at,Sa as Ne,Ta as X,Ua as Re,Y as W,fa as tt,ga as V,ia as pe,j as Ue,l as Xe,m as Je,r as ae,ra as nt,sa as _,ta as me,v as Ye,y as Ze,z as Qe}from"./chunk.JCKIJSW7.js";import{a as ue}from"./chunk.SDO3U72B.js";import{Gb as je,Xc as ne,Z as ee,ha as te,ma as A,ud as qe,va as H}from"./chunk.6L6RUOSF.js";import{b as M}from"./chunk.AJZBJBMO.js";var f=M(U(),1);var Nt=M(U(),1);function Rt(e){(0,Nt.useLayoutEffect)(()=>{let n=e.current,t=n?.parentElement;if(!n||!t)return;let a=n.style.bottom,o=()=>{let l=t.querySelector(jt);if(!l){n.style.bottom=a;return}let u=t.getBoundingClientRect(),m=l.getBoundingClientRect(),g=u.height>0?t.offsetHeight/u.height:1;n.style.bottom=`${Math.max(0,Math.round((u.bottom-m.top)*g))}px`};if(o(),typeof ResizeObserver>"u")return;let s=new ResizeObserver(o);return s.observe(t),()=>s.disconnect()},[e])}var jt=".graview-spec-listing";var Ae=M(U(),1);var P=M(U(),1);var Pt=M(U(),1);var B=M(W(),1);function Ct({id:e,max:n=8,empty:t,hide:a}){let{store:o}=V();pe();let s=Ut(o,e,X()),[l,u]=(0,Pt.useState)(()=>new Set),m=a?s.flatMap(g=>{let w=g.ids.filter(r=>!a.has(r));return w.length>0?[{...g,ids:w}]:[]}):s;return m.length===0?t&&s.length===0?(0,B.jsx)("p",{style:{margin:0,fontSize:"0.875rem",color:"var(--graview-ink-faint)"},children:t}):null:(0,B.jsx)("div",{"data-graview-primitive":"connections",style:{display:"flex",flexDirection:"column",gap:12},children:m.map(g=>{let w=l.has(g.key),r=g.ids.length>n,c=w?g.ids:g.ids.slice(0,n),y=g.ids.length-Math.min(n,g.ids.length),S=`graview-more-${e}-${g.key}`.replace(/[^A-Za-z0-9_-]/g,"-");return(0,B.jsxs)("section",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,B.jsx)("h2",{...g.said?{"aria-label":g.said}:{},style:{margin:0,fontSize:"0.75rem",fontWeight:600,letterSpacing:"0.09em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:g.label}),(0,B.jsxs)("div",{id:S,style:{display:"flex",flexWrap:"wrap",gap:6},children:[c.map(h=>{let b=o.graph.getNode(h);return b?(0,B.jsx)(Y,{pickId:h,hue:ne(b.kind),title:`Go to the ${H(o.schema.tryDefinition(b.kind),b.kind)}`,label:A(o.schema.tryDefinition(b.kind),b)},h):null}),r?(0,B.jsx)("button",{type:"button","data-graview-more":g.key,"aria-expanded":w,"aria-controls":S,...w?{}:{"aria-label":`${y} more: ${g.said??g.label}`},onClick:h=>{h.stopPropagation(),u(b=>{let k=new Set(b);return k.has(g.key)?k.delete(g.key):k.add(g.key),k})},style:qt,children:w?"Show fewer":`+${y} more`}):null]})]},g.key)})})}var qt={display:"inline-flex",alignItems:"center",alignSelf:"flex-start",minHeight:24,boxSizing:"border-box",padding:"3px 9px",borderRadius:6,border:"1px solid var(--graview-edge)",background:"var(--graview-panel-muted)",color:"var(--graview-accent)",font:"inherit",fontSize:"0.8125rem",lineHeight:1.5,whiteSpace:"nowrap",cursor:"pointer"};function Ut(e,n,t=[]){let a=e.graph.getNode(n);if(!a)return[];let o=new Map,s=[];for(let l of t)if(l.subjectId===n)for(let u of l.nodeIds)u!==n&&!s.includes(u)&&e.graph.has(u)&&s.push(u);s.length>0&&o.set("judges",{key:"judges",label:"what it finds wrong",ids:s});for(let l of e.graph.allEdges()){let u=l.from===n?l.to:l.to===n?l.from:null;if(u===null||u===n)continue;let m=e.graph.getNode(u);if(!m)continue;let g=l.from===n?"out":"in",w=g==="out"?a.kind:m.kind,r=Xt(e.schema,w,l.kind,g),c=`${l.kind}:${g}:${r.label}`,y=o.get(c)??{key:c,...r,ids:[]};y.ids.includes(u)||y.ids.push(u),o.set(c,y)}for(let l of o.values())l.ids.sort();return[...o.values()].sort((l,u)=>l.key<u.key?-1:l.key>u.key?1:0)}function Xt(e,n,t,a){let o=rt(e,n,t,a),s=te(t).toLowerCase();return o.trim().toLowerCase()!==s?{label:o}:a==="out"?{label:`\u2192 ${s}`,said:s}:{label:`\u2190 ${s}`,said:`${s}, pointing here`}}var $t=M(U(),1),se=(0,$t.createContext)(null);var d=M(W(),1),Jt=fe(ue(()=>(__graviewPreload(import.meta.url,["./chunk.ARGEGV5T.js","./chunk.WS5ORRGS.js","./chunk.ZONRIOIA.js","./chunk.NXHEOHRR.js","./chunk.6TBQV3NO.js","./chunk.MT252WP4.js","./chunk.VVIQSFM4.js","./chunk.TQ3MNB6K.js","./chunk.VGYG2IBZ.js","./chunk.RJ7VSWTA.js","./chunk.P43LPXXJ.js","./chunk.JCKIJSW7.js","./chunk.SDO3U72B.js","./chunk.6L6RUOSF.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.TO3ZKCA2.js")))).part((e,n)=>(0,d.jsx)(e.ArrangeBar,{...n}),{what:"Arranging this list"}),Yt=fe(ue(()=>(__graviewPreload(import.meta.url,["./chunk.D4F6QX5L.js","./chunk.MM7MLBGB.js","./chunk.V5JB5UJS.js","./chunk.EHLV3LND.js","./chunk.EPSYX2SF.js","./chunk.JLNTE5CH.js","./chunk.DDSAFU3B.js","./chunk.EOSN5DWW.js","./chunk.T6UJEXFL.js","./chunk.7THS3DLZ.js","./chunk.4QMAYVPU.js","./chunk.ARGEGV5T.js","./chunk.WS5ORRGS.js","./chunk.ZONRIOIA.js","./chunk.NXHEOHRR.js","./chunk.HJCQ6I3S.js","./chunk.DJGZOPAS.js","./chunk.GFOZVQBQ.js","./chunk.MQNW3O67.js","./chunk.67S2UWBT.js","./chunk.7PWLRRUS.js","./chunk.MEAUTBVM.js","./chunk.OKHXXIMN.js","./chunk.NH3VXTGX.js","./chunk.6IMRCKB4.js","./chunk.64K5ELSQ.js","./chunk.G4JJXA63.js","./chunk.TBY5IR7C.js","./chunk.PQTXM4VY.js","./chunk.BIDL7GQD.js","./chunk.7KX36ENH.js","./chunk.QDDDKEBH.js","./chunk.QKRQPUCE.js","./chunk.SPJ34VHA.js","./chunk.XOZU4OFA.js","./chunk.KBJ3UUER.js","./chunk.Q5WEOX3Q.js","./chunk.4O64QV2Y.js","./chunk.OYMN3IFX.js","./chunk.UQZ2P6KD.js","./chunk.WVUJXDXZ.js","./chunk.NI4OPHTL.js","./chunk.U5KJQFAP.js","./chunk.FOHZPYUV.js","./chunk.IXYG65TM.js","./chunk.W6L2VAJG.js","./chunk.N3MXLORL.js","./chunk.MIE4TJRW.js","./chunk.3CLTABGP.js","./chunk.RD2FSSLV.js","./chunk.CVN2XFMF.js","./chunk.6TBQV3NO.js","./chunk.MT252WP4.js","./chunk.VVIQSFM4.js","./chunk.TQ3MNB6K.js","./chunk.VGYG2IBZ.js","./chunk.RJ7VSWTA.js","./chunk.P43LPXXJ.js","./chunk.JCKIJSW7.js","./chunk.SDO3U72B.js","./chunk.6L6RUOSF.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.CPK6CYKN.js")))).part((e,n)=>(0,d.jsx)(e.KindStop,{...n}),{what:"This list"});function $e(e){let{brand:n}=V();return ne(e,n?.accents)}function Zt(e,n){if(!n.endsWith("\u2026")&&!n.endsWith("..."))return;let t=n.replace(/[…]|\.\.\.$/g,"").trim();if(!(t.length<12)){for(let a of Object.values(e))if(typeof a=="string"&&a.length>t.length&&a.startsWith(t))return a}}function Qt(e,n){let a=Math.max(0,...e.slice(0,n*2).map(s=>s.length))*7.5+28<=212/2?2:1,o=n*a;return{columns:a,shown:Math.min(e.length,o)}}var en=8,At=500,tn=12;function Lt(e){return{x:e.clientX,y:e.clientY,pointerType:e.pointerType??""}}function nn(e,n,t){let a=performance.now()+At,o=["pointerdown","pointerup","mousedown","mouseup","dblclick"],s=r=>{if(performance.now()>a||!(r instanceof MouseEvent))return!1;let c=Lt(r);return n.pointerType&&c.pointerType&&n.pointerType!==c.pointerType?!1:Math.hypot(c.x-n.x,c.y-n.y)<=tn},l=r=>{if(!s(r))return g();r.stopPropagation()},u=r=>{if(!s(r))return g();r.stopPropagation(),r.preventDefault(),e.removeEventListener("click",u,!0),setTimeout(g,50),t()},m=!1,g=()=>{if(!m){m=!0,clearTimeout(w),e.removeEventListener("click",u,!0);for(let r of o)e.removeEventListener(r,l,!0)}};for(let r of o)e.addEventListener(r,l,!0);e.addEventListener("click",u,!0);let w=setTimeout(g,At)}function an({View:e,members:n,mode:t,flagged:a}){let{isSelected:o}=Ne(),s=n.slice(0,en);return(0,d.jsxs)("div",{"data-graview-rows":"",style:{display:"grid",gap:4,minWidth:0},children:[s.map(l=>(0,d.jsx)("div",{"data-graview-pick":l.id,style:{minWidth:0,cursor:"pointer"},children:(0,d.jsx)(e,{node:l,cardinality:"one",fidelity:"glyph",mode:t,selected:o(l.id),...a?.includes(l.id)?{flagged:[l.id]}:{}})},l.id)),n.length>s.length?(0,d.jsx)(Y,{label:`+${n.length-s.length} more`}):null]})}var rn=11/15,on=fe(ue(()=>(__graviewPreload(import.meta.url,["./chunk.6TBQV3NO.js","./chunk.MT252WP4.js","./chunk.VVIQSFM4.js","./chunk.TQ3MNB6K.js","./chunk.VGYG2IBZ.js","./chunk.RJ7VSWTA.js","./chunk.P43LPXXJ.js","./chunk.JCKIJSW7.js","./chunk.SDO3U72B.js","./chunk.6L6RUOSF.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.Y5WQD6KV.js")))).part((e,n)=>(0,d.jsx)(e.StatesBar,{...n}),{quiet:!0});function sn({text:e,accent:n}){let t=(0,P.useRef)(null),a=(0,P.useRef)(null),[o,s]=(0,P.useState)(1),[l,u]=(0,P.useState)(!1),m=o<1?`${o}em`:void 0;return(0,P.useLayoutEffect)(()=>{let g=t.current,w=a.current;if(!g||!w)return;let r=()=>{let y=g.clientWidth,S=w.offsetWidth;if(y<=0||S<=0)return;let h=parseFloat(getComputedStyle(w).fontSize)/parseFloat(getComputedStyle(g).fontSize)||1,b=S/h,k=Math.max(rn,Math.min(1,Math.floor(y/b*100)/100));s(N=>Math.abs(N-k)<.01?N:k),u(b*k>y+.5)};if(r(),typeof ResizeObserver>"u")return;let c=new ResizeObserver(r);return c.observe(g),()=>c.disconnect()},[e]),(0,d.jsx)("span",{ref:t,"data-graview-district-name":"",...o<1?{"data-graview-fitted":""}:{},...l?{title:e}:{},style:{display:"block",minWidth:0,fontSize:"0.9375rem",lineHeight:1.25,letterSpacing:"0.05em",textTransform:"uppercase",color:n?"var(--graview-accent)":"var(--graview-ink-muted)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:(0,d.jsx)("span",{ref:a,style:{fontSize:m},children:e})})}function Vt(e,n){return!!e?.display?.page?.groups?.length||Pe(n,e).some(t=>t.long)}function Mt(e,n=he(e)){for(let t of e.kinds){let a=e.tryDefinition(t),o=a?.plural??`${String(t)}s`,s=r=>{let c=r.node,y=X(),S=(0,P.useContext)(se);if(!c)return null;let h=S?.nodeId===c.id?S:null,b=A(a,c),k=r.mode==="fullscreen"?Zt(c,b)??b:b,N=je(y,[c.id]);return(0,d.jsxs)(J,{title:(0,d.jsx)(xt,{nodeId:c.id,children:h?.title??k}),...h?{}:{subtitle:a?.describe?ot(a,c):a?.description??String(t)},selected:r.selected,...r.flagged?.includes(c.id)?{tone:"warning"}:{},fit:!0,children:[h?(0,d.jsx)(se.Provider,{value:null,children:h.body}):null,(0,d.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:"22px 34px",alignItems:"flex-start"},children:[(0,d.jsx)("div",{style:{flex:Vt(a,c)?"1 1 100%":"1 1 0",minWidth:"min(200px, 100%)"},children:(0,d.jsx)(kt,{id:c.id,shown:[k,b,a?.description,h?.title],...h?{hide:[...h.fields]}:{}})}),(0,d.jsx)("div",{style:{flex:Vt(a,c)?"1 1 100%":"1.4 1 0",minWidth:"min(220px, 100%)"},children:(0,d.jsx)(Ct,{id:c.id,empty:`Nothing is connected to this ${H(a,String(t))} yet.`,...h?{hide:h.records}:{}})})]}),N.length>0?(0,d.jsx)("p",{"data-graview-broken":"",style:{margin:"14px 0 0",paddingTop:12,borderTop:"1px solid var(--graview-edge)",fontSize:"0.875rem",color:"var(--graview-warn)"},children:N.map(v=>v.message).join(" \xB7 ")}):null]})},l=r=>{let c=r.node;if(!c)return null;let{store:y}=V(),S=a?.computed?ut(y.schema,y.graph,c):c,h=Pe(S,a,{limit:3,said:[A(a,c)],glance:!0}),b=$e(t),k=h.filter(x=>!x.long&&!x.markdown),N=h.find(x=>x.long||x.markdown),v=dt(c,a);return(0,d.jsxs)(J,{title:A(a,c),selected:r.selected,tone:r.flagged?.includes(c.id)?"warning":"muted",fit:!0,children:[v?(0,d.jsx)(Se,{as:"thumb",file:v,size:64,style:{marginBottom:6}}):null,(0,d.jsx)(st,{items:k.map(x=>({id:x.key,label:x.alone,hue:b})),max:3}),N?(0,d.jsx)("p",{"data-graview-excerpt":N.key,title:N.value,style:{margin:k.length>0?"6px 0 0":0,fontSize:"0.8125rem",lineHeight:1.35,color:"var(--graview-ink-muted)",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:N.value}):null]})},u=r=>{let c=r.node,y=$e(t),S=ve().marks.flag;if(!c)return null;let h=r.flagged?.includes(c.id)??!1;return(0,d.jsx)(Y,{label:h?`${A(a,c)} ${S}`:A(a,c),hue:y,selected:r.selected,title:h?`${te(H(a,String(t)))} \u2014 implicated in a problem`:te(H(a,String(t)))})},m=r=>r.fidelity==="full"?(0,d.jsx)(P.Suspense,{fallback:(0,d.jsx)(g,{...r}),children:(0,d.jsx)(Yt,{kind:String(t),members:r.nodes??[],...r.flagged?{flagged:r.flagged}:{},...r.label?{label:r.label}:{},...r.retired?{retired:r.retired}:{}})}):(0,d.jsx)(g,{...r}),g=r=>{let{brand:c,store:y,views:S}=V(),{view:h,go:b}=Re(),k=r.nodes??[],N=S.lookup(String(t),{cardinality:"one",fidelity:"glyph"}),v=N!==void 0&&!me(N)?N:void 0,x=yt(h),C=ft(k,x,{schema:e,graph:y.graph,flagged:new Set(r.flagged??[])}),E=R=>({id:R.id,label:A(e.tryDefinition(R.kind),R),hue:ne(R.kind,c?.accents)}),I=r.fidelity==="full"&&k.length>1?(0,d.jsx)(P.Suspense,{fallback:null,children:(0,d.jsx)(Jt,{schema:e,graph:y.graph,kind:String(t),arrangement:x,onChange:R=>b(vt(h,R)),kept:{shown:C.nodes.length,of:k.length},style:{marginBottom:8}})}):null,le=R=>R.some($=>r.flagged?.includes($.id)),de=X(),Z=ve().marks.flag,z=(R,$,ce)=>v?(0,d.jsx)(J,{title:R,meta:(0,d.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[(0,d.jsx)(ke,{kind:String(t),plural:o,problems:be(de,$),flag:Z}),(0,d.jsx)("span",{title:`${ee($.length)} ${$.length===1?H(a,String(t)):o.toLowerCase()}`,children:ee($.length)})]}),tone:le($)?"warning":"muted",children:(0,d.jsx)(an,{View:v,members:$,mode:r.mode,...r.flagged?{flagged:r.flagged}:{}})},ce):(0,d.jsx)(lt,{label:R,count:$.length,flagged:le($),items:$.map(E),problems:(0,d.jsx)(ke,{kind:String(t),plural:o,problems:be(de,$),flag:Z})},ce);return C.grouped?(0,d.jsxs)("div",{style:{display:"grid",gap:8},"data-graview-grouped":x.group?.by,children:[I,C.groups.map(R=>z(`${r.label??o} \xB7 ${R.label}`,R.nodes,R.key||"-"))]}):(0,d.jsxs)("div",{style:{display:"grid",gap:4},children:[I,z(r.label??o,C.nodes)]})},w=r=>{let c=r.nodes??[],y=Qt(c.map(p=>A(a,p)),r.openedRows??pt(c.length)),S=$e(t),{brand:h}=V(),b=it(String(t),e,h),k=ve().marks.flag,{selection:N,set:v,clear:x}=Ne(),{toggle:C,view:E,go:I}=Re(),{views:le,hiddenKinds:de}=V(),Z=(0,P.useContext)(nt),z=E.overview&&!de.has(String(t))?le.places().filter(p=>p.kind===String(t)):[],R=r.focused?E.within?.view??z[0]?.as:void 0,$=c.filter(p=>r.flagged?.includes(p.id)).length,ce=$>0,zt=X(),Ft=be(zt,c),F=(E.overview??!1)&&r.nestedUnder===void 0,G=r.focused||r.raised,Ie=r.rank==="secondary"&&!G,L=r.nestedUnder!==void 0,ze=new Set(N),K=Z?N.length===1&&N[0]===ae(String(t)):r.opened??!1,Kt=mt(),O=G||F?0:c.filter(p=>Kt.includes(p.id)&&!ze.has(p.id)).length,xe=O>0&&!ce,ge=tt(),q=ge&&!L?ge.byKind[String(t)]??0:0,Fe=(0,P.useRef)(null),Ke=(0,P.useRef)(null);(0,P.useLayoutEffect)(()=>{let p=Ke.current,T=Fe.current;if(!p||!T||!F)return;let D=()=>T.style.setProperty("--graview-plate-h",`${p.offsetHeight}px`);if(D(),typeof ResizeObserver>"u")return;let Q=new ResizeObserver(D);return Q.observe(p,{box:"border-box"}),()=>Q.disconnect()},[F]);let _t=L?8:Math.min(46,10+Math.round(Math.sqrt(c.length)*8)),_e=L?(0,d.jsx)("span",{style:{fontSize:"0.75rem",lineHeight:1.25,letterSpacing:"0.05em",textTransform:"uppercase",color:G?"var(--graview-accent)":"var(--graview-ink-muted)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r.label??o}):(0,d.jsx)(sn,{text:r.label??o,accent:!!G});return(0,d.jsxs)("div",{ref:Fe,className:"graview-kind-card","data-graview-rank":r.rank,"data-graview-landmark":b||void 0,"data-graview-nested":L||void 0,"data-graview-tied":O||void 0,"data-graview-hits":ge&&!L?q:void 0,"data-graview-emphasis":ge&&!L?q>0?"lit":"dimmed":void 0,...a?.description||L?{title:L?[r.label??o,a?.description].filter(Boolean).join(" \u2014 "):a.description}:{},style:{position:"relative",height:"100%","--graview-hue":Math.round(S)},children:[b?(0,d.jsx)("span",{className:"graview-kind-block graview-kind-landmark","data-graview-opened":r.opened||void 0,"aria-hidden":"true",style:{"--graview-rise":_t},children:(0,d.jsx)(ie,{kind:String(t),schema:e,...h?{brand:h}:{},size:96})}):null,(0,d.jsxs)("div",{ref:Ke,className:"graview-kind-face","data-graview-opened":r.opened||void 0,"data-graview-nameplate":F?r.nameplate??"full":void 0,style:{display:"flex",flexDirection:"column",gap:L?1:3,padding:L?"5px 7px":"7px 10px",borderRadius:"var(--graview-radius-sm, 9px)",justifyContent:"center",position:"relative",height:"100%",overflow:"hidden",boxSizing:"border-box",border:G?"1px solid var(--graview-accent)":O>0?"1px solid var(--graview-accent-dim)":`1px solid hsl(${Math.round(S)} 55% var(--graview-tint-lightness) / 0.34)`,backgroundColor:"var(--graview-panel)",backgroundImage:`linear-gradient(hsl(${Math.round(S)} 55% var(--graview-tint-lightness) / calc(var(--graview-tint-alpha) * ${G?1.1:Ie?.28:.5})), hsl(${Math.round(S)} 55% var(--graview-tint-lightness) / calc(var(--graview-tint-alpha) * ${G?1.1:Ie?.28:.5})))`,boxShadow:G?"0 0 0 1px var(--graview-accent-dim)":void 0},children:[!L&&!F&&c.length>0?(0,d.jsx)("div",{"data-graview-tally":c.length,"data-graview-broken":$||void 0,"aria-hidden":"true",style:{position:"absolute",left:0,right:0,top:0,display:"flex",height:3,background:`hsl(${Math.round(S)} 55% var(--graview-tint-lightness) / 0.4)`},children:$>0?(0,d.jsx)("span",{style:{width:`${Math.max(6,Math.round($/c.length*100))}%`,background:"var(--graview-warn)"}}):null}):null,b?(0,d.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:L?4:6},children:[(0,d.jsx)(ie,{kind:String(t),schema:e,...h?{brand:h}:{},size:L?14:18}),_e]}):_e,(0,d.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:5,fontSize:"0.875rem"},children:[(0,d.jsx)("span",{title:c.length>0?`${ee(c.length)} ${c.length===1?H(a,String(t)):o.toLowerCase()}`:void 0,style:{fontVariantNumeric:"tabular-nums",color:xe?"var(--graview-accent)":"var(--graview-ink-faint)"},children:c.length===0?"none yet":xe?O===c.length?`${O} tied`:`${O} of ${c.length} tied`:ee(c.length)}),(0,d.jsx)(ke,{kind:String(t),plural:o,problems:Ft,flag:k,listed:K}),(r.retired??0)>0?(0,d.jsxs)("button",{type:"button",className:"graview-kind-past","data-graview-retired":r.retired,title:`${r.retired} retired ${o.toLowerCase()} \u2014 press to widen the view to the past`,onClick:p=>{p.stopPropagation(),I(wt(E,!0))},onDoubleClick:p=>p.stopPropagation(),onPointerDown:p=>p.stopPropagation(),children:["+",r.retired," past"]}):null,q>0?(0,d.jsxs)("button",{type:"button",className:"graview-kind-hits","data-testid":`hits-${String(t)}`,title:`${q} ${q===1?"match":"matches"} for \u201C${E.q??""}\u201D \u2014 press to go in, narrowed`,onClick:p=>{p.stopPropagation(),I(Ze(E,ae(String(t)),{ownPicture:!0,...E.q?{carry:E.q}:{}}))},onDoubleClick:p=>p.stopPropagation(),onPointerDown:p=>p.stopPropagation(),children:[q," match"]}):null,O>0&&!xe?(0,d.jsxs)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-accent)"},children:[O," tied"]}):null,r.hasOwnView&&!F?(0,d.jsx)("span",{title:`${o} has a view of its own`,"aria-label":"has its own view",style:{fontSize:"0.6875rem",color:"var(--graview-accent)"},children:"\u25C6"}):null,!L&&c.length>0&&!r.focused?(0,d.jsxs)("button",{type:"button",className:"graview-kind-open","data-testid":`open-${String(t)}`,"aria-expanded":K,"aria-label":K?`Close up the ${o}`:`See the ${o} in here`,title:K?"Close it up":`See the ${o} in here`,onClick:p=>{p.stopPropagation(),Z?K?x():v([ae(String(t))]):C(ae(String(t)))},onDoubleClick:p=>p.stopPropagation(),onPointerDown:p=>p.stopPropagation(),children:[(0,d.jsx)("span",{className:"graview-kind-open-word",children:K?"close":"open"})," ",(0,d.jsx)("span",{"aria-hidden":"true",children:K?"\u25B4":"\u25BE"})]}):null]}),F&&r.states?(0,d.jsx)(P.Suspense,{fallback:null,children:(0,d.jsx)(on,{states:r.states,definition:a})}):null,r.opened?(0,d.jsxs)("div",{className:"graview-kind-members","data-graview-buildings":r.plot?.side??1,style:{display:"grid",gridTemplateColumns:`repeat(${y.columns}, minmax(0, 1fr))`,gap:3},children:[c.slice(0,y.shown).map(p=>{let T=r.flagged?.includes(p.id)??!1,D=A(a,p);return(0,d.jsx)(Y,{pickId:p.id,label:T?`${D} ${k}`:D,title:T?`${D} \u2014 implicated in a problem`:void 0,hue:S,selected:ze.has(p.id)},p.id)}),c.length>y.shown?(0,d.jsxs)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",padding:"2px 4px",gridColumn:"1 / -1"},children:["+",c.length-y.shown," more \u2014 double-click to go in"]}):null]}):null]}),!L&&z.length>0?(0,d.jsx)("div",{className:"graview-drive-in","data-testid":`drive-in-${String(t)}`,"data-graview-showing":R,onPointerDown:p=>p.stopPropagation(),onDoubleClick:p=>p.stopPropagation(),children:(0,d.jsx)("div",{className:"graview-drive-in-marquee",role:"group","aria-label":`${o}: pictures`,"data-graview-thumbs":z.length===1?"one":"two",children:z.map(p=>{let T=R===p.as;return(0,d.jsxs)("div",{className:"graview-drive-in-thumb","data-graview-pressed":T||void 0,children:[(0,d.jsx)("span",{className:"graview-drive-in-thumb-title","aria-hidden":"true",children:p.title}),(0,d.jsx)("button",{type:"button",className:"graview-drive-in-thumb-press","data-testid":`showing-${p.as}`,"aria-label":`${o}: ${p.title}`,"aria-pressed":T,title:T?`${p.title} is showing \u2014 press again to open it`:`Show ${p.title} on the billboard \u2014 double-click to open it`,onClick:D=>{D.stopPropagation();let Q=()=>I(Qe(E,String(t),p.as));if(D.detail>=2||T&&r.focused){Q();return}I(Xe(Ue(Je(E,!0),Ye(String(t))),"view",p.as)),D.detail===1&&nn(D.currentTarget.ownerDocument,Lt(D.nativeEvent),Q)}})]},p.as)})})}):null]})};m.generic=!0,w.generic=!0,n.register(t,{cardinality:"one",fidelity:"full"},_(s)).register(t,{cardinality:"one",fidelity:"summary"},_(l)).register(t,{cardinality:"one",fidelity:"glyph"},_(u)).register(t,{cardinality:"many",fidelity:"full"},_(m)).register(t,{cardinality:"many",fidelity:"summary"},_(m)).register(t,{cardinality:"many",fidelity:"glyph"},_(w))}return n}var Le=M(W(),1),Et=new WeakMap;function ln(e){let n=Et.get(e);return n||Et.set(e,n=Mt(e,he(e))),n}var Ve=at;function Dt(){return(0,Ae.useContext)(Ve)}function Yn({children:e}){return(0,Le.jsx)(Ve.Provider,{value:!0,children:e})}function Tt(e){let n=(0,Ae.useContext)(Ve),{store:t}=V();if(n)return null;let a=e.kind??e.node?.kind??e.nodes?.[0]?.kind;if(!a)return null;let o=ln(t.schema).lookup(a,{cardinality:e.cardinality,fidelity:e.fidelity});return o?(0,Le.jsx)(o,{...e}):null}var i=M(W(),1);function Me(e,n){return e===void 0?{}:e===0?{"data-graview-lines":"all",style:{WebkitLineClamp:"none",lineClamp:"none",maxHeight:"none",overflow:"visible"}}:{"data-graview-lines":String(e),style:{...n?{display:"-webkit-box",WebkitBoxOrient:"vertical"}:{},WebkitLineClamp:e,lineClamp:e,overflow:"hidden",maxHeight:`${e*1.45}em`}}}var dn=90,Gt=(0,f.createContext)(null),Ee=(e,n)=>e.trim().toLowerCase().replace(/[_-]+/g," ")===n.trim().toLowerCase().replace(/[_-]+/g," "),cn=(0,f.createContext)(null),Oe=(0,f.createContext)(null);function Bt({block:e}){let n=(0,f.useContext)(Oe),t=n?.slots?.[e.key],a=(0,i.jsx)(gn,{block:e});return t?(0,i.jsx)(f.Suspense,{fallback:a,children:(0,i.jsx)(t,{block:e,node:n.node,drawn:a})}):a}function gn({block:e}){let n=(0,f.useContext)(Gt),t=(0,f.useContext)(pn),a=(0,f.useContext)(Be),o=(0,f.useContext)(we);if(n&&e.t==="badge"&&n.values.some(s=>Ee(s,e.text))||n&&e.t==="field"&&n.field!==void 0&&e.field===n.field||e.t==="badge"&&/^0(?:\s+\p{L}+)?$/u.test(e.text.trim()))return null;switch(e.t){case"title":return(0,i.jsx)("strong",{className:"graview-spec-title",...o!==null&&Ee(o,e.text)?{"aria-hidden":!0}:{},children:e.text});case"text":return e.markdown||Ce(e.text)?(0,i.jsx)("div",{className:"graview-spec-text",...e.tone?{"data-graview-tone":e.tone}:{},...Me(e.lines,!0),children:(0,i.jsx)(St,{text:e.text,markdown:e.markdown})}):e.runs?(0,i.jsx)("p",{className:"graview-spec-text graview-spec-meta",...e.tone?{"data-graview-tone":e.tone}:{},...Me(e.lines,!1),children:e.runs.map((s,l)=>(0,i.jsxs)(f.Fragment,{children:[l>0?" ":null,s.field!==void 0?(0,i.jsx)("span",{className:"graview-spec-chip","data-graview-field":s.field,children:s.text}):(0,i.jsx)("span",{className:"graview-spec-meta-words",children:l>0&&e.runs[l-1].field===void 0?`\xB7 ${s.text}`:s.text})]},l))}):(0,i.jsx)("p",{className:"graview-spec-text",...e.tone?{"data-graview-tone":e.tone}:{},...Me(e.lines,!0),children:e.text});case"badge":return(0,i.jsx)("span",{className:"graview-spec-badge","data-graview-tone":e.tone,children:e.text});case"field":return(0,i.jsxs)("span",{className:"graview-spec-field","data-graview-field":e.field,children:[(0,i.jsx)("span",{className:"graview-spec-label",children:e.label}),(0,i.jsx)("span",{className:"graview-spec-value",...Ce(e.text)?{style:{whiteSpace:"pre-line"}}:{},children:e.linked?(0,i.jsx)(ht,{relation:e.linked.relation,refs:e.linked.refs,as:"chip"}):e.app?(0,i.jsx)(bt,{address:e.app}):e.href?(0,i.jsx)("a",{className:"graview-spec-link",href:e.href,...e.href.startsWith("tel:")?{}:{rel:"noopener noreferrer",target:"_blank"},children:e.text}):e.text})]});case"image":return(0,i.jsx)(Se,{as:"block",field:e.field,files:e.files,label:e.label,view:e.as});case"progress":return e.value===void 0||e.max===void 0?(0,i.jsxs)("span",{className:"graview-spec-progress",children:[(0,i.jsx)("span",{className:"graview-spec-label",children:e.label}),(0,i.jsx)("span",{className:"graview-spec-value",children:e.text})]}):(0,i.jsxs)("span",{className:"graview-spec-progress",children:[(0,i.jsx)("span",{className:"graview-spec-label",children:e.label}),(0,i.jsx)("span",{className:"graview-spec-track",role:"progressbar","aria-label":e.label,"aria-valuemin":0,"aria-valuemax":e.max,"aria-valuenow":Math.max(0,Math.min(e.value,e.max)),"aria-valuetext":e.text,children:(0,i.jsx)("span",{className:"graview-spec-fill",style:{width:`${Math.round(Math.max(0,Math.min(e.value,e.max))/e.max*100)}%`}})}),(0,i.jsx)("span",{className:"graview-spec-value",children:e.text})]});case"group":return(0,i.jsx)("span",{className:"graview-spec-group","data-direction":e.direction,children:(0,i.jsx)(De,{blocks:e.blocks})});case"when":return e.shown?(0,i.jsx)(De,{blocks:e.blocks}):null;case"divider":return(0,i.jsx)("hr",{className:"graview-spec-divider"});case"figure":return(0,i.jsx)(un,{});case"headline":{let s=`h${Math.min(6,e.level+t)}`,l=(0,i.jsx)(s,{className:"graview-spec-headline","data-level":e.level,"data-long":e.text.length>dn?"":void 0,children:e.text});return a!==null&&e.level===1?(0,i.jsxs)(i.Fragment,{children:[l,a]}):l}case"number":return(0,i.jsxs)("span",{className:"graview-spec-number",...e.emphasis?{"data-emphasis":e.emphasis}:{},children:[(0,i.jsx)("span",{className:"graview-spec-number-value",children:e.text}),e.label?(0,i.jsx)("span",{className:"graview-spec-label",children:e.label}):null]});case"list":return(0,i.jsx)(wn,{list:e})}}function un(){let e=(0,f.useContext)(Oe)?.figure;return e?(0,i.jsx)("span",{className:"graview-spec-figure","aria-hidden":"true",children:e()}):null}function De({blocks:e}){let n=[];for(let t=0;t<e.length;t++){let a=t;for(;e[a]?.t==="badge"&&e[a+1]?.t==="badge";)a++;if(a===t){n.push((0,i.jsx)(Bt,{block:e[t]},t));continue}n.push((0,i.jsx)("span",{className:"graview-spec-badges",children:e.slice(t,a+1).map((o,s)=>(0,i.jsx)(Bt,{block:o},s))},t)),t=a}return n}function He({blocks:e,ctx:n,view:t}){let a=(0,f.useContext)(cn)?.[t];return(0,i.jsx)(Oe.Provider,{value:{figure:n.figure,slots:a,node:n.node},children:(0,i.jsx)(De,{blocks:e})})}function Ot({blocks:e,ctx:n,view:t}){return(0,i.jsx)(He,{blocks:j(e,n),ctx:n,view:t})}var Te=3,Ht=(0,f.createContext)(0),Wt=(0,f.createContext)(null),pn=(0,f.createContext)(0),Be=(0,f.createContext)(null),mn=(0,f.createContext)(null),It=(0,f.createContext)(null);function hn(){let{brand:e}=V();return qe(e?.kit).marks.flag}function fn({node:e,as:n,depth:t,said:a=null}){let{store:o,views:s}=V(),l=A(o.schema.tryDefinition(e.kind),e),u=s.lookup(e.kind,{cardinality:"one",fidelity:n==="card"?"summary":"glyph"}),m=(0,f.useContext)(It)?.has(e.id)===!0,g=hn(),w=m?{"data-graview-flagged":"",title:`${l} \u2014 implicated in a problem`}:{};return n==="row"&&t<=Te&&(!u||me(u))?(0,i.jsxs)("li",{className:"graview-spec-item","data-graview-listed":e.id,"data-as":n,...w,children:[(0,i.jsx)(Ge,{node:e,label:l}),(0,i.jsx)("div",{className:"graview-spec graview-spec-row","data-graview-spec":"row","data-graview-kind":e.kind,"aria-hidden":"true",children:(0,i.jsx)("strong",{className:"graview-spec-title",children:m?`${l} ${g}`:l})})]}):(0,i.jsxs)("li",{className:"graview-spec-item","data-graview-listed":e.id,"data-as":n,...w,children:[(0,i.jsx)(Ge,{node:e,label:l}),t<=Te&&u?(0,i.jsx)(et,{mode:"scene",children:(0,i.jsx)(Ht.Provider,{value:t,children:(0,i.jsx)(Gt.Provider,{value:a,children:(0,i.jsx)(we.Provider,{value:l,children:(0,i.jsx)(u,{node:e,cardinality:"one",fidelity:n==="card"?"summary":"glyph",mode:"scene",selected:!1,...m?{flagged:[e.id]}:{}})})})})}):(0,i.jsx)("span",{className:"graview-spec-item-name","aria-hidden":"true",children:m?`${l} ${g}`:l})]})}function Ge({node:e,label:n,describedBy:t}){let a=(0,f.useContext)(Wt),o=(0,f.useRef)(null);return Rt(o),a?(0,i.jsx)("a",{ref:o,className:"graview-spec-item-link",href:a.href(e),"aria-label":n,...t?{"aria-describedby":t}:{},onClick:s=>{s.metaKey||s.ctrlKey||s.shiftKey||s.button!==0||(s.preventDefault(),s.stopPropagation(),a.go(e))}}):(0,i.jsx)("button",{ref:o,type:"button",className:"graview-spec-item-link","data-graview-pick":e.id,"aria-label":n,...t?{"aria-describedby":t}:{}})}function wn({list:e}){let n=(0,f.useContext)(Ht)+1,{store:t}=V(),a=(0,f.useContext)(Wt),[o,s]=(0,f.useState)(e.members.length);if(e.failed)return(0,i.jsx)("p",{className:"graview-spec-text",children:"\u2014"});if(e.members.length===0)return e.empty?(0,i.jsx)("p",{className:"graview-spec-text graview-spec-empty",children:e.empty}):null;let l=(v,x=null)=>n>Te?(0,i.jsx)("ul",{className:"graview-spec-list","data-as":"names",children:v.map(C=>(0,i.jsxs)("li",{className:"graview-spec-item","data-graview-listed":C.id,"data-as":"name",children:[(0,i.jsx)(Ge,{node:C,label:A(t.schema.tryDefinition(C.kind),C)}),(0,i.jsx)("span",{className:"graview-spec-item-name","aria-hidden":"true",children:A(t.schema.tryDefinition(C.kind),C)})]},C.id))}):(0,i.jsx)("ul",{className:"graview-spec-list","data-as":e.as,children:v.map(C=>(0,i.jsx)(fn,{node:C,as:e.as,depth:n,said:x},C.id))}),u=e.rest??[],m=Math.min(o,e.members.length+u.length),g=m>e.members.length?[...e.members,...u].slice(0,m):e.members,w=e.members.length+u.length-m,r=Math.max(1,e.members.length),c=w>0?(0,i.jsx)("p",{className:"graview-spec-text graview-spec-more",children:(0,i.jsx)("button",{type:"button",className:"graview-spec-show-more","data-graview-show-more":w,onClick:()=>s(m+r),children:`Show ${Math.min(r,w)} more`})}):null,y=e.total??e.members.length+e.more,S=e.more-u.length,h=c??(a?.more&&y>g.length?a.more({members:g,total:y}):S>0?(0,i.jsx)("p",{className:"graview-spec-text graview-spec-more",children:`and ${S} more`}):null);if(!e.groups)return(0,i.jsxs)("div",{className:"graview-spec-listing",children:[l(g),h]});let b=`h${e.headingLevel}`,k=m,N=m>e.members.length&&e.everyGroup?e.everyGroup.flatMap(v=>{if(k<=0)return[];let x=v.members.slice(0,k);return k-=x.length,[{...v,members:x}]}):e.groups;return(0,i.jsxs)("div",{className:"graview-spec-listing",children:[N.map(v=>(0,i.jsxs)("section",{className:"graview-spec-list-group","data-graview-group":v.value??"",children:[v.heading?(0,i.jsxs)(b,{className:"graview-spec-list-heading",children:[v.heading," ",(0,i.jsx)("span",{className:"graview-spec-list-count",children:(e.everyGroup?.find(x=>x.value===v.value)??v).members.length})]}):null,l(v.members,v.value!==null?{values:[v.value,...v.heading?[v.heading]:[]]}:null)]},v.value??"")),h]})}function pa({blocks:e,heading:n=2,firstHeading:t,slot:a,view:o=a,flagged:s}){let{store:l,brand:u}=V();pe();let m=(0,f.useMemo)(()=>s&&s.length>0?new Set(s):null,[s]),g=oe(l,null,null,{heading:n,firstHeading:t,money:u}),w=(0,f.useContext)(Be),c=(0,f.useContext)(mn)?.lede===!0&&a==="place"&&e[0]?.t==="headline"?e.slice(1):e,y=c.some(S=>S.t==="headline");return(0,i.jsxs)("div",{className:`graview-spec graview-spec-${a}`,"data-graview-spec":a,children:[w!==null&&!y?w:null,(0,i.jsx)(Be.Provider,{value:y?w:null,children:(0,i.jsx)(It.Provider,{value:m,children:(0,i.jsx)(Ot,{blocks:c,ctx:g,view:o})})})]})}function We(e,n="card"){let{store:t,brand:a}=V(),o=t.schema;return{...oe(t,null,e,{slot:n,money:a}),figure:()=>(0,i.jsx)(ie,{kind:e.kind,schema:o,...a?{brand:a}:{},size:22})}}function yn({blocks:e,node:n,selected:t,flagged:a}){let o=We(n),[s,...l]=e,u=s?.t==="title";return(0,i.jsx)(J,{...u?{title:j([s],o)[0].text}:{},selected:t,tone:a?"warning":"muted",fit:!0,children:(0,i.jsx)("div",{className:"graview-spec graview-spec-card","data-graview-spec":"card","data-graview-kind":n.kind,children:(0,i.jsx)(Ot,{blocks:u?l:e,ctx:o,view:`${n.kind}.card`})})})}function vn({blocks:e,props:n}){let t=n.node,a=We(t,"page"),o=Dt(),s=j(e,a),l=ye(e,s),u=l.title!==void 0&&(!o||l.title===A(a.schema?.tryDefinition(t.kind),t)),m=(0,i.jsx)("div",{className:"graview-spec graview-spec-page","data-graview-spec":"page","data-graview-kind":t.kind,...o?{}:{"data-graview-heads-record":""},children:(0,i.jsx)(He,{blocks:u?s.slice(1):s,ctx:a,view:`${t.kind}.page`})});return o?m:(0,i.jsx)(se.Provider,{value:{nodeId:t.id,...l.title!==void 0?{title:l.title}:{},body:m,fields:l.fields,records:l.records},children:(0,i.jsx)(Tt,{...n})})}function ma(e,n,t){return typeof e=="function"?e.says?.(n,t):void 0}function Sn({blocks:e,node:n,selected:t}){let{store:a}=V(),o=A(a.schema.tryDefinition(n.kind),n),s=We(n,"row"),l=j(e,s),u=(0,f.useContext)(we);return(0,i.jsx)("div",{title:o,style:{minWidth:0,maxWidth:"100%"},children:(0,i.jsxs)("div",{className:"graview-spec graview-spec-row","data-graview-spec":"row","data-graview-kind":n.kind,...e.some(gt)?{"data-graview-tall":""}:{},...t?{"data-selected":""}:{},children:[ct(l,o)?null:(0,i.jsx)("strong",{className:"graview-spec-title","data-graview-row-name":"",...u!==null&&Ee(u,o)?{"aria-hidden":!0}:{},children:o}),(0,i.jsx)(He,{blocks:l,ctx:s,view:`${n.kind}.row`})]})})}function ha(e,n,t){if(!t)return e;let a=new Set(n.kinds);for(let[o,s]of Object.entries(t)){if(!a.has(o)||!s)continue;let l=o;if(s.card){let u=re(s.card),m=g=>g.node?(0,i.jsx)(yn,{blocks:u,node:g.node,selected:g.selected,flagged:g.flagged?.includes(g.node.id)??!1}):null;e.register(l,{cardinality:"one",fidelity:"summary"},m)}if(s.row){let u=re(s.row),m=g=>g.node?(0,i.jsx)(Sn,{blocks:u,node:g.node,selected:g.selected}):null;m.says=(g,w)=>ye(u,j(u,oe({graph:w,schema:n},null,g,{slot:"row"}))),e.register(l,{cardinality:"one",fidelity:"glyph"},m)}if(s.page){let u=re(s.page),m=g=>g.node?(0,i.jsx)(vn,{blocks:u,props:g}):null;m.says=(g,w)=>ye(u,j(u,oe({graph:w,schema:n},null,g))),e.register(l,{cardinality:"one",fidelity:"full"},m)}}return e}export{Rt as a,Yn as b,Gt as c,Wt as d,pn as e,Be as f,mn as g,Ge as h,pa as i,ma as j,ha as k,Mt as l};
@@ -1 +1 @@
1
- import{t as a}from"./chunk.SCVKHGO3.js";import{G as f,W as s,ea as l}from"./chunk.FWXW4T4I.js";import{b as i}from"./chunk.AJZBJBMO.js";var d=i(f(),1),p=i(s(),1),c=new Set;function B(e){return c.add(e),()=>void c.delete(e)}function S(){let{store:e,principal:o}=l();return(0,d.useMemo)(()=>n=>{let t=n.on===void 0?void 0:e.graph.getNode(n.on);if(!t)return null;let u=[...c].filter(r=>r.store===e&&r.kind===t.kind);return(n.element?u.find(r=>r.root()?.contains(n.element)??!1):u[0])?.section(t.id,o)??null},[e,o])}function v({children:e}){let o=S(),n=(0,d.useMemo)(()=>[o],[o]);return(0,p.jsx)(a,{sections:n,children:e})}export{B as a,S as b,v as c};
1
+ import{t as a}from"./chunk.3CLTABGP.js";import{G as f,Y as s,ga as l}from"./chunk.JCKIJSW7.js";import{b as i}from"./chunk.AJZBJBMO.js";var d=i(f(),1),p=i(s(),1),c=new Set;function B(e){return c.add(e),()=>void c.delete(e)}function S(){let{store:e,principal:o}=l();return(0,d.useMemo)(()=>n=>{let t=n.on===void 0?void 0:e.graph.getNode(n.on);if(!t)return null;let u=[...c].filter(r=>r.store===e&&r.kind===t.kind);return(n.element?u.find(r=>r.root()?.contains(n.element)??!1):u[0])?.section(t.id,o)??null},[e,o])}function v({children:e}){let o=S(),n=(0,d.useMemo)(()=>[o],[o]);return(0,p.jsx)(a,{sections:n,children:e})}export{B as a,S as b,v as c};
@@ -0,0 +1 @@
1
+ import{b as f}from"./chunk.6BBUTKFC.js";import"./chunk.Z22C2JJ4.js";import"./chunk.MKJV3BM5.js";import"./chunk.CEOQY5KS.js";import"./chunk.Q355UPFG.js";import{p as g}from"./chunk.4HU2ILFY.js";import"./chunk.WGH2P2YL.js";import"./chunk.EHLV3LND.js";import"./chunk.EPSYX2SF.js";import"./chunk.EOSN5DWW.js";import"./chunk.T6UJEXFL.js";import"./chunk.7THS3DLZ.js";import"./chunk.4QMAYVPU.js";import"./chunk.ARGEGV5T.js";import"./chunk.WS5ORRGS.js";import"./chunk.ZONRIOIA.js";import"./chunk.NXHEOHRR.js";import"./chunk.MB7LKKUD.js";import"./chunk.QJJWAYHB.js";import"./chunk.6A3KTD66.js";import"./chunk.MQNW3O67.js";import"./chunk.67S2UWBT.js";import"./chunk.7PWLRRUS.js";import"./chunk.OKHXXIMN.js";import"./chunk.NH3VXTGX.js";import"./chunk.6IMRCKB4.js";import"./chunk.7KX36ENH.js";import"./chunk.BJUUSIQY.js";import"./chunk.QDDDKEBH.js";import"./chunk.QKRQPUCE.js";import"./chunk.XOZU4OFA.js";import"./chunk.KBJ3UUER.js";import"./chunk.WVUJXDXZ.js";import"./chunk.NI4OPHTL.js";import"./chunk.U5KJQFAP.js";import"./chunk.FOHZPYUV.js";import"./chunk.IXYG65TM.js";import"./chunk.W6L2VAJG.js";import"./chunk.N3MXLORL.js";import"./chunk.MIE4TJRW.js";import"./chunk.3CLTABGP.js";import"./chunk.RD2FSSLV.js";import"./chunk.CVN2XFMF.js";import"./chunk.6TBQV3NO.js";import"./chunk.MT252WP4.js";import"./chunk.VVIQSFM4.js";import"./chunk.TQ3MNB6K.js";import"./chunk.VGYG2IBZ.js";import"./chunk.RJ7VSWTA.js";import"./chunk.P43LPXXJ.js";import{G as b,Y as h}from"./chunk.JCKIJSW7.js";import"./chunk.SDO3U72B.js";import{Ae as n}from"./chunk.6L6RUOSF.js";import"./chunk.FQLNBIQ5.js";import{b as t}from"./chunk.AJZBJBMO.js";var m=t(b(),1),a=t(h(),1);function P({store:c,auto:y,brand:i,views:u,presence:s,steering:r,overview:o,scope:d,titleLevel:w=2,quickAsk:l,props:e}){let v=(0,m.useMemo)(()=>g({scope:`.${d}`}),[d]);return(0,a.jsxs)("div",{"data-embed-content":"",style:y?{flex:"0 0 auto",background:"var(--graview-ground)"}:{flex:"1 1 auto",minHeight:0,overflow:"auto",background:"var(--graview-ground)"},children:[(0,a.jsx)("style",{children:v}),(0,a.jsx)("div",{"data-embed-measure":"",style:{display:"flow-root"},children:(0,a.jsx)(f,{context:{store:c,embedded:!0,...e.bar!==!1?{barAbove:!0}:{},...o?{overview:o}:{},titleLevel:w,views:u,settings:e.app.settings??[],app:e.app,...s?{presence:s}:{},...i?{brand:i}:{},...e.locale?{locale:e.locale}:{},...e.timeZone?{timeZone:e.timeZone}:{},...e.principal?{principal:e.principal}:{},...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{},...e.subscriptions?{subscriptions:e.subscriptions}:{},dismissals:e.dismissals,whileAway:e.whileAway,...e.signIn?{signIn:e.signIn}:{},...l!==void 0?{quickAsk:l}:{}},...e.pages?{registry:e.pages}:{},...r?{steering:r}:{},...e.routing==="address"?n(e.basePath)===""?{}:{basename:n(e.basePath)}:{initialPath:e.path??"/"},...e.path!==void 0?{path:e.path}:{},...e.hrefOf?{hrefOf:e.hrefOf}:e.routing==="address"?{}:{hrefOf:!1},...e.onNavigate?{onNavigate:e.onNavigate}:{}})})]})}export{P as PagesContent};
@@ -0,0 +1 @@
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{L as j,P as $,S as H,Wb as L,Zb as N,td as E}from"./chunk.6L6RUOSF.js";var W=()=>(__graviewPreload(import.meta.url,["./chunk.Z2BCOZDZ.js","./chunk.WGH2P2YL.js","./chunk.M5FP4Y4Q.js","./chunk.7KX36ENH.js","./chunk.6L6RUOSF.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.KJPLX72N.js"));function D(n,u,d){let i=new Map;for(let y of d?.kinds??[])for(let a of n.nodesOfKind(y))u.has(a.id)||i.set(a.id,a);let s=new Set([...u,...i.keys()]),h=new Set(d?.edges??[]),k=new Set;if(h.size>0&&u.size>0){for(let y of u)for(let a of n.outEdges(y))h.has(a.kind)&&i.has(a.to)&&k.add(a.to);for(let y of i.keys())n.outEdges(y).some(a=>h.has(a.kind)&&u.has(a.to))&&k.add(y)}let R=new Map([...[...i].filter(([y])=>k.has(y)),...[...i].filter(([y])=>!k.has(y))]),p=[];if(h.size>0)for(let y of s)for(let a of n.outEdges(y))h.has(a.kind)&&s.has(a.to)&&p.push({kind:a.kind,from:a.from,to:a.to});return{nodes:[...R.values()],edges:p}}function O(n,u,d){let i=[];return()=>{let s=d();for(;i.length>0&&i[0]<=s-u;)i.shift();return i.length>=n?!1:(i.push(s),!0)}}function I(n={},u=Date.now){return{act:O(n.acts??30,n.actWindowMs??6e4,u),message:O(n.messages??120,n.messageWindowMs??1e3,u)}}var G=n=>typeof n=="object"&&n!==null&&!Array.isArray(n);function J(n,u){let d=u.flatMap(s=>G(s)&&typeof s.kind=="string"?[s.kind]:[]),i=E(n,d);return Object.keys(i).length>0?{choices:i}:{}}function _(n,u){let d=structuredClone(u),i=n.schema.tryDefinition(d.kind),s=d.label;return{...d,label:i?.label?i.label(d):typeof s=="string"&&s.length>0?s:d.id}}function Q(n){let u=n.limiter??I(n.limits,n.now),d=n.limits?.maxHeight??4e3,i=`view:${n.view}`,s={applied:0,refused:0,dropped:0},h=()=>n.store.seenBy(n.principal),k=e=>_(n.store,e),R=()=>{if(n.props)return n.props();let e=h(),c=e.graph,r=n.input?.()??{},l=r.node?c.getNode(r.node.id):void 0,t=r.nodes?.flatMap(o=>{let m=c.getNode(o.id);return m?[m]:[]}),g=new Set([...l?[l.id]:[],...(t??[]).map(o=>o.id)]),f=[];for(let o of g)for(let m of c.outEdges(o))g.has(m.to)&&f.push({kind:m.kind,from:m.from,to:m.to});let b=D(c,g,n.reads),A=new Set(f.map(o=>`${o.kind} ${o.from} ${o.to}`));for(let o of b.edges)A.has(`${o.kind} ${o.from} ${o.to}`)||f.push(o);let w=b.nodes.length>0?[...t??[],...b.nodes]:t,S=o=>o?.filter(m=>c.has(m)),F=e.permittedMutations(n.principal).map(o=>({name:o.name,title:o.title??o.name,...o.description!==void 0?{description:o.description}:{},...o.subject?{subject:{kinds:o.subject.kinds,arg:o.subject.arg}}:{}}));return{view:n.view,...l?{node:k(l)}:{},...w?{nodes:w.map(k)}:{},edges:f,...r.label!==void 0?{label:r.label}:{},...r.fidelity!==void 0?{fidelity:r.fidelity}:{},...r.cardinality!==void 0?{cardinality:r.cardinality}:{},...r.mode!==void 0?{mode:r.mode}:{},...r.selected!==void 0?{selected:r.selected}:{},...r.implicated?{implicated:S(r.implicated)}:{},...r.flagged?{flagged:S(r.flagged)}:{},acts:F,...n.theme?{theme:n.theme()}:{},locale:$(),timeZone:H(),today:n.store.today()??j(),...J(n.store.schema,[...l?[l]:[],...w??[]]),...n.placesShown?{places:n.placesShown().map(({as:o,title:m,kind:K})=>({as:o,title:m,kind:K}))}:{}}},p=!1,y=0,a=new Set,M=()=>{if(p)return;y+=1,a.add(y),a.size>100&&a.delete(a.values().next().value);let e=R();n.send({type:"props",props:n.hand?n.hand(e):e,push:y})},x=!1,T=n.store.subscribe(()=>{x||(x=!0,queueMicrotask(()=>{x=!1,M()}))}),v=(e,c)=>(s.refused+=1,{ok:!1,reason:e,message:c}),z=(e,c,r)=>P([{name:e,args:c}],r),P=(e,c,r)=>{if(!u.act())return v("rate-limited","Too many acts asked for at once; this one was not applied.");let l=[];for(let{name:t,args:g}of e){if(c){let f=c(t,g);if(!f.ok)return v(f.reason,f.message);t=f.name,g=f.args}if(!n.store.allMutations().some(f=>f.name===t))return v("unknown-act","There is no act by that name here.");l.push({name:t,args:g})}try{let t=n.store.applyAll(l,{author:n.principal,via:i,...r?{intent:r}:{}});return s.applied+=1,{ok:!0,intent:t.intent}}catch(t){return t instanceof L?v("refused",t.refusal.message):t instanceof N?v("failed",Z(t)):v("failed","The act could not be applied.")}},C=(e,c,r)=>{let l=Array.isArray(r);if(typeof c!="string"||(l?r.length===0||r.length>100||!r.every(G):!G(r)))return s.refused+=1,n.send({type:"answer",id:e,ok:!1,reason:"malformed",message:"An act is asked for by name, with its arguments as an object, or a list of 1 to 100 of them for several as one change."});let t=P((l?r:[r]).map(g=>({name:c,args:g})),n.judgeAct);n.send(t.ok?{type:"answer",id:e,ok:!0,intent:t.intent}:{type:"answer",id:e,ok:!1,reason:t.reason,message:t.message})};return{receive(e){if(p)return;if(!(G(e)&&e.nonce===n.nonce&&e.type==="pushed"&&typeof e.push=="number"&&a.delete(e.push))&&!u.message()){s.dropped+=1,n.onFlood?.();return}if(!G(e)||e.nonce!==n.nonce){s.dropped+=1;return}if(e.type==="act"&&(typeof e.id=="string"||typeof e.id=="number"))return C(e.id,e.name,e.args);if(e.type==="navigate"&&n.onArrive&&(typeof e.place=="string"||typeof e.to=="string")){let r={...e.where!==void 0?{where:e.where}:{},...e.section!==void 0?{section:e.section}:{}},l=typeof e.place=="string"?{place:e.place,...r}:{record:e.to,...r},t=n.onArrive;W().then(({judgeDestination:g,listsOf:f,placeVocabulary:b})=>{if(p)return;let A=new Set([...n.store.kindsKeptFrom(n.principal),...n.store.modules.disabledKinds]),w=g(l,{sees:S=>h().graph.has(S),places:b(n.store.schema,n.placesShown?.()??[],{kept:A}),lists:f(n.store.schema,A),schema:n.store.schema});w.ok?t(w.arrival):(s.dropped+=1,n.onLost?.(w.says))});return}if(e.type==="navigate"&&typeof e.place=="string"){n.places?.().includes(e.place)?n.onNavigatePlace?.(e.place):s.dropped+=1;return}if(e.type==="navigate"&&typeof e.to=="string"){h().graph.has(e.to)?n.onNavigate?.(e.to):s.dropped+=1;return}if(e.type==="mine"&&(typeof e.id=="string"||typeof e.id=="number")&&n.mine){let r=e.id,l=t=>{p||n.send({type:"mine-answer",id:r,...t})};e.op==="set"?n.mine.set(e.key,e.value).then(l):typeof e.key=="string"?n.mine.get(e.key).then(l):l({ok:!0,value:null});return}if(e.type==="render"&&Array.isArray(e.records)&&n.onRender){n.onRender(e.records);return}if(e.type==="style"&&Array.isArray(e.sheets)&&e.sheets.every(r=>typeof r=="string")&&n.onStyle){n.onStyle(e.sheets);return}if(e.type==="hears"&&Array.isArray(e.events)&&n.onHears){n.onHears(e.events.filter(r=>typeof r=="string").slice(0,20));return}if(e.type==="clicks"&&Array.isArray(e.selectors)){let r=l=>(Array.isArray(l)?l:[]).filter(t=>typeof t=="string"&&t.length<=500).slice(0,200);n.onClicks?.(r(e.selectors),r(e.acted));return}if(e.type==="gestures"&&Array.isArray(e.bound)&&n.onGestures){n.onGestures(e.bound.slice(0,32));return}if(e.type==="pushed"&&typeof e.push=="number"&&typeof e.ms=="number"&&n.onPushed){n.onPushed(e.push,e.ms);return}if(e.type==="size"&&typeof e.height=="number"&&Number.isFinite(e.height)){n.onSize?.(Math.max(0,Math.min(d,Math.round(e.height))));return}s.dropped+=1},push:M,pressed(e){return p?{ok:!1,reason:"refused",message:"The view has gone."}:e.ok?z(e.name,e.args):(s.refused+=1,e)},change(e,c){return p?{ok:!1,reason:"refused",message:"The view has gone."}:P(e,void 0,c)},get stats(){return s},dispose(){p=!0,T()}}}var V=n=>({number:"a number",string:"text",boolean:"yes or no",date:"a date",array:"a list",object:"a set of values"})[n.toLowerCase()]??`a ${n}`;function Z(n){return`Not applied: ${q(n)}.`}function q(n){return n.issues.slice(0,4).map(d=>{let i=d.path.map(String).join("."),s=/expected (\w+)/i.exec(d.message)?.[1];return i?s&&/^invalid (input|type)/i.test(d.message)?`\u201C${i}\u201D expects ${V(s)}`:`\u201C${i}\u201D: ${d.message.charAt(0).toLowerCase()}${d.message.slice(1)}`:d.message}).join("; ")||"its arguments did not fit"}export{D as a,I as b,J as c,_ as d,Q as e,Z as f,q as g};
@@ -1,3 +1,3 @@
1
- import{b as te}from"./chunk.EL7XXGQY.js";import"./chunk.MH3AQO2R.js";import"./chunk.J2N7EKMX.js";import"./chunk.P26ATAAI.js";import{b as ne}from"./chunk.FIY4RUK5.js";import"./chunk.IY3DV52G.js";import{G as ge,W as ee}from"./chunk.FWXW4T4I.js";import"./chunk.SDO3U72B.js";import{la as X,na as Z,rd as q}from"./chunk.DHPXRDT5.js";import"./chunk.FQLNBIQ5.js";import{b as T}from"./chunk.AJZBJBMO.js";var M=T(ge(),1);var ye=6;function re($,S,m,x,E){let t=new Set($),o=new Map;for(let i of S)for(let[h,l,b]of[[i.from,i.to,"out"],[i.to,i.from,"in"]]){if(!t.has(h)||t.has(l))continue;let f=m(l);if(f===void 0)continue;let p=`${h}|${i.kind}|${b}|${f}`,v=o.get(p);v?v.others.includes(l)||v.others.push(l):o.set(p,{self:h,edge:i.kind,direction:b,kind:f,others:[l]})}let d=[];for(let i of o.values()){let h=m(i.self)??"",l=ne(E,i.direction==="out"?h:i.kind,i.edge,i.direction);if(i.others.length>ye){d.push({...i,others:i.others,lands:"district",words:l});continue}let b=[],f=[];for(let p of i.others)(x(p)?b:f).push(p);for(let p of b)d.push({...i,others:[p],lands:"record",words:l});f.length>0&&d.push({...i,others:f,lands:"district",words:l})}return d}function ie($,S=[]){let m=[...S],x=new Map,E=t=>m.some(o=>t.x<o.x+o.width&&o.x<t.x+t.width&&t.y<o.y+o.height&&o.y<t.y+t.height);for(let t of[...$].sort((o,d)=>o.y-d.y||o.x-d.x)){let o={x:t.x-t.width/2,y:t.y-t.height,width:t.width,height:t.height};for(let d=0;d<12&&E(o);d++)o.y+=t.height+2;m.push(o),x.set(t.key,{x:o.x,y:o.y})}return x}var s=T(ee(),1),he=4;function xe({frame:$,width:S,height:m,stageRef:x,tick:E,store:t,graphVersion:o,selection:d,view:i,rulers:{visibleRect:h,clipQuadratic:l,unsureOf:b,unsureDash:f,unsureOpacity:p}}){let v=n=>t.graph.getNode(n)?.kind,C=te(d,i,v),R=C.lens===null&&C.records.length<=he?C.records:[],oe=R.join(`
1
+ import{b as te}from"./chunk.DJGZOPAS.js";import"./chunk.6TBQV3NO.js";import"./chunk.MT252WP4.js";import"./chunk.VVIQSFM4.js";import{b as ne}from"./chunk.TQ3MNB6K.js";import"./chunk.VGYG2IBZ.js";import{G as ge,Y as ee}from"./chunk.JCKIJSW7.js";import"./chunk.SDO3U72B.js";import{ma as X,oa as Z,xd as q}from"./chunk.6L6RUOSF.js";import"./chunk.FQLNBIQ5.js";import{b as T}from"./chunk.AJZBJBMO.js";var M=T(ge(),1);var ye=6;function re($,S,m,x,E){let t=new Set($),o=new Map;for(let i of S)for(let[h,l,b]of[[i.from,i.to,"out"],[i.to,i.from,"in"]]){if(!t.has(h)||t.has(l))continue;let f=m(l);if(f===void 0)continue;let p=`${h}|${i.kind}|${b}|${f}`,v=o.get(p);v?v.others.includes(l)||v.others.push(l):o.set(p,{self:h,edge:i.kind,direction:b,kind:f,others:[l]})}let d=[];for(let i of o.values()){let h=m(i.self)??"",l=ne(E,i.direction==="out"?h:i.kind,i.edge,i.direction);if(i.others.length>ye){d.push({...i,others:i.others,lands:"district",words:l});continue}let b=[],f=[];for(let p of i.others)(x(p)?b:f).push(p);for(let p of b)d.push({...i,others:[p],lands:"record",words:l});f.length>0&&d.push({...i,others:f,lands:"district",words:l})}return d}function ie($,S=[]){let m=[...S],x=new Map,E=t=>m.some(o=>t.x<o.x+o.width&&o.x<t.x+t.width&&t.y<o.y+o.height&&o.y<t.y+t.height);for(let t of[...$].sort((o,d)=>o.y-d.y||o.x-d.x)){let o={x:t.x-t.width/2,y:t.y-t.height,width:t.width,height:t.height};for(let d=0;d<12&&E(o);d++)o.y+=t.height+2;m.push(o),x.set(t.key,{x:o.x,y:o.y})}return x}var s=T(ee(),1),he=4;function xe({frame:$,width:S,height:m,stageRef:x,tick:E,store:t,graphVersion:o,selection:d,view:i,rulers:{visibleRect:h,clipQuadratic:l,unsureOf:b,unsureDash:f,unsureOpacity:p}}){let v=n=>t.graph.getNode(n)?.kind,C=te(d,i,v),R=C.lens===null&&C.records.length<=he?C.records:[],oe=R.join(`
2
2
  `),[y,K]=(0,M.useState)(null);(0,M.useLayoutEffect)(()=>{let n=x.current;if(!i.overview||R.length===0||!n||typeof document>"u"||$.t<1){K(null);return}let w=n.getBoundingClientRect(),B=e=>({x:e.left-w.left,y:e.top-w.top,width:e.width,height:e.height}),D=new Map,se=R.map(e=>`[data-graview-view="${CSS.escape(e)}"]`).join(","),k=null,H=()=>{if(k)return k;k={drawn:new Map,buildings:new Map};for(let e of n.querySelectorAll("[data-graview-pick], [data-graview-view], [data-graview-building]")){let r=e.getAttribute("data-graview-pick"),a=e.getAttribute("data-graview-view");for(let c of r!==null&&r===a?[r]:[r,a]){if(c===null)continue;let u=k.drawn.get(c);u?u.push(e):k.drawn.set(c,[e])}let L=e.getAttribute("data-graview-building");L!==null&&!k.buildings.has(L)&&k.buildings.set(L,e)}return k},P=e=>{if(D.has(e))return D.get(e);let r=null;for(let a of H().drawn.get(e)??[])if(!a.closest("[data-graview-offstage], [data-graview-screen]")&&!(!R.includes(e)&&a.closest(se))&&(r=h(a,n),r))break;if(!r){let a=H().buildings.get(e);a&&(r=B(a.getBoundingClientRect()))}return D.set(e,r),r},W=e=>{let r=n.querySelector(`[data-graview-plot="kind:${CSS.escape(e)}"] .graview-plot-tile`);return r?B(r.getBoundingClientRect()):null},de=re(R,t.graph.allEdges(),v,e=>P(e)!==null,t.schema),z=[];for(let e of n.querySelectorAll('[data-graview-view^="kind:"] .graview-kind-face')){let r=h(e,n);r&&z.push(r)}let Q=e=>({x:e.x+e.width/2,y:e.y+e.height/2}),O=[],V=new Set(R),I=new Set;for(let e of de){let r=v(e.self),a=P(e.self)??(r?W(r):null),L=e.lands==="record"?P(e.others[0]):W(e.kind);if(!a||!L)continue;for(let g of e.others)V.add(g);I.add(e.kind),r&&I.add(r);let c=Q(a),u=Q(L),A=Math.hypot(u.x-c.x,u.y-c.y);if(A<6)continue;let G=Math.min(40,A*.12)*(O.length%2===0?1:-1),le={x:(c.x+u.x)/2-(u.y-c.y)/A*G,y:(c.y+u.y)/2+(u.x-c.x)/A*G},J=l({p0:c,c:le,p1:u},z);if(J.length===0)continue;let ce=J.map(g=>`M ${g.p0.x.toFixed(1)} ${g.p0.y.toFixed(1)} Q ${g.c.x.toFixed(1)} ${g.c.y.toFixed(1)} ${g.p1.x.toFixed(1)} ${g.p1.y.toFixed(1)}`).join(" "),ue=g=>{let j=t.graph.getNode(g);return j?X(t.schema.tryDefinition(j.kind),j):g},U=e.lands==="record"?`${e.words}: ${ue(e.others[0])}`:`${e.words}: ${Z(t.schema,e.kind,e.others.length)}`,F=e.others[0],_=e.lands==="record"?b?.(e.edge,e.direction==="out"?e.self:F,e.direction==="out"?F:e.self):void 0;O.push({key:`${e.self}|${e.edge}|${e.direction}|${e.lands}|${F}`,link:e,d:ce,end:u,said:_!==void 0?`${U} \xB7 unsure`:U,..._!==void 0?{unsure:_}:{}})}let Y=[];for(let e of n.querySelectorAll(".graview-kind-face[data-graview-nameplate]")){let r=h(e,n);r&&Y.push(r)}let ae=ie(O.map(e=>({key:e.key,x:e.end.x,y:e.end.y-6,width:Math.min(260,14+e.said.length*6.6),height:20})),Y);K({lines:O,labels:ae,reached:[...V],districts:[...I]})},[oe,i.overview,$,o,E,S,m,x,t]);let N=(0,M.useMemo)(()=>{if(!y)return"";let n=y.reached.map(B=>`[data-graview-building="${CSS.escape(B)}"]`).join(","),w=y.districts.map(B=>`[data-graview-plot="kind:${CSS.escape(B)}"]`).join(",");return[".graview-ground[data-graview-altitude] .graview-building { opacity: 0.22; }",n?`.graview-ground[data-graview-altitude] .graview-building:is(${n}) { opacity: 1; }`:"",w?`.graview-ground[data-graview-altitude] .graview-plot:not(:is(${w})) .graview-plot-tile { opacity: 0.4; }`:""].join(`
3
3
  `)},[y]);return!y||y.lines.length===0?N?(0,s.jsx)("style",{children:N}):null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{children:N}),(0,s.jsx)("svg",{className:"graview-record-links","data-graview-world":"","data-graview-record-links":y.lines.length,"aria-hidden":"true",width:S,height:m,style:{position:"absolute",left:0,top:0,pointerEvents:"none",zIndex:q.lines},children:y.lines.map(n=>(0,s.jsxs)("g",{className:"graview-record-link","data-graview-link":n.link.edge,"data-graview-lands":n.link.lands,"data-graview-direction":n.link.direction,"data-graview-provisional":n.unsure!==void 0||void 0,children:[(0,s.jsx)("path",{className:"graview-record-link-line",d:n.d,...n.unsure!==void 0?{strokeDasharray:f,strokeOpacity:p}:{}}),n.link.lands==="record"?(0,s.jsx)("circle",{className:"graview-record-link-end",cx:n.end.x,cy:n.end.y,r:3}):null]},n.key))}),(0,s.jsx)("div",{"aria-hidden":"true","data-graview-world":"",style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:q.tieLabels},children:y.lines.map(n=>{let w=y.labels.get(n.key);return w?(0,s.jsx)("span",{className:"graview-record-link-said","data-graview-link-said":n.link.edge,"data-graview-lands":n.link.lands,...n.unsure!==void 0?{title:n.unsure}:{},style:{position:"absolute",left:w.x,top:w.y,...n.unsure!==void 0?{pointerEvents:"auto"}:{}},children:n.said},n.key):null})})]})}export{xe as RecordLinks};
@@ -0,0 +1 @@
1
+ import{a as b,b as c,c as d,d as e,e as f,f as g}from"./chunk.VDFQFLTU.js";import{a}from"./chunk.TBY5IR7C.js";import"./chunk.BIDL7GQD.js";import"./chunk.Q5WEOX3Q.js";import"./chunk.4O64QV2Y.js";import"./chunk.OYMN3IFX.js";import"./chunk.FOHZPYUV.js";import"./chunk.IXYG65TM.js";import"./chunk.W6L2VAJG.js";import"./chunk.N3MXLORL.js";import"./chunk.6L6RUOSF.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{b as PROPOSE_CHANGE,c as documentOfApp,a as mayChangeDeclaration,g as proposeReshape,e as readReshape,f as reshapeCard,d as reshapeQuestions};
@@ -1 +1 @@
1
- import{G as g,S as y,ea as m,oa as d}from"./chunk.FWXW4T4I.js";import{b as S}from"./chunk.AJZBJBMO.js";var v=S(g(),1);function k(){let{store:w,principal:a,ai:n,aiDesk:r,seatTalk:i,views:p,app:t,brand:l,view:A,selection:s}=m(),e=y(w,a),c=d(),o=A.within?.view;return(0,v.useMemo)(()=>({store:e,principal:a,ai:n,desk:r,seatTalk:i,goTo:c,places:[...p.places()],app:t??{name:l?.name??"app",schema:e.schema,...e.policy?{policy:e.policy}:{}},...o?{place:o}:{},selection:s}),[e,a,n,r,i,c,p,t,l,o,s])}export{k as a};
1
+ import{G as g,U as y,ga as m,qa as d}from"./chunk.JCKIJSW7.js";import{b as S}from"./chunk.AJZBJBMO.js";var v=S(g(),1);function k(){let{store:w,principal:a,ai:n,aiDesk:r,seatTalk:i,views:p,app:t,brand:l,view:A,selection:s}=m(),e=y(w,a),c=d(),o=A.within?.view;return(0,v.useMemo)(()=>({store:e,principal:a,ai:n,desk:r,seatTalk:i,goTo:c,places:[...p.places()],app:t??{name:l?.name??"app",schema:e.schema,...e.policy?{policy:e.policy}:{}},...o?{place:o}:{},selection:s}),[e,a,n,r,i,c,p,t,l,o,s])}export{k as a};
@@ -1,4 +1,4 @@
1
- import{i as z,j as D,k as H}from"./chunk.HMJXB6KC.js";import{a as P,b as A,c as p,d as W}from"./chunk.Q355UPFG.js";import"./chunk.JQEXH23N.js";import"./chunk.I7OFRF6N.js";import"./chunk.4RPKCW4J.js";import"./chunk.IRNEWNUB.js";import"./chunk.AUNQNTKY.js";import"./chunk.KLEKC4ZX.js";import"./chunk.PJL3I2IW.js";import"./chunk.LMZ2WMGH.js";import"./chunk.OD5QZHRC.js";import"./chunk.YJ4PFOPC.js";import"./chunk.LKM2R5UF.js";import{a as C,b as O}from"./chunk.MB7LKKUD.js";import"./chunk.26RYER7Y.js";import"./chunk.CYEPHT7V.js";import"./chunk.5MOXQUZH.js";import"./chunk.MKN7ADJB.js";import"./chunk.I4H2GS4O.js";import"./chunk.FE3SINPK.js";import"./chunk.MUWI54IP.js";import"./chunk.3D37E2G5.js";import"./chunk.WVUJXDXZ.js";import"./chunk.B422DSYN.js";import"./chunk.ZE5RSKXF.js";import"./chunk.DKUEZPGR.js";import"./chunk.EP7YT7LT.js";import"./chunk.I7KN732Z.js";import"./chunk.TLPCYKLW.js";import"./chunk.MIE4TJRW.js";import"./chunk.SCVKHGO3.js";import"./chunk.RD2FSSLV.js";import"./chunk.AZRICZKT.js";import"./chunk.MH3AQO2R.js";import"./chunk.J2N7EKMX.js";import"./chunk.P26ATAAI.js";import"./chunk.FIY4RUK5.js";import"./chunk.IY3DV52G.js";import"./chunk.NLZHNPDU.js";import"./chunk.QNC2OKLF.js";import{G as B,Va as k,W as L}from"./chunk.FWXW4T4I.js";import"./chunk.SDO3U72B.js";import{td as R}from"./chunk.DHPXRDT5.js";import"./chunk.FQLNBIQ5.js";import{b as E}from"./chunk.AJZBJBMO.js";var r=E(B(),1);var s=E(L(),1);function M(c){let e=document.activeElement;if(e!==null&&e!==document.body&&e!==document.documentElement&&e.isConnected)return;let n=c??document,o=n.querySelector("main")??n.querySelector("[data-graview-page]")??null,t=n.querySelector("[data-graview-page-title]")??o?.querySelector("h1, h2")??o;t instanceof HTMLElement&&(t.hasAttribute("tabindex")||t.setAttribute("tabindex","-1"),t.focus({preventScroll:!0}))}var I=1500;function N(c,e,n){let{store:o,principal:t}=c,l=z(o),g=(0,r.useMemo)(()=>P(o,t),[o,t,l]),w=(0,r.useRef)(n),[b,d]=(0,r.useState)(),[y,u]=(0,r.useState)("");(0,r.useEffect)(()=>{let a=A(o,t,w.current);w.current=o.batches().length,a&&(d({batch:a.batch,at:e,when:Date.now()}),u(""))},[o,t,l]),(0,r.useEffect)(()=>{d(a=>!a||a.at===e?a:Date.now()-a.when<I?{...a,at:e}:void 0)},[e]);let[x,i]=(0,r.useState)(null),v=(0,r.useCallback)(()=>{d(void 0),i(null)},[]),f=(0,r.useCallback)(()=>{i(null);try{let a=W(o,t);a&&u(`Took back \u201C${a.intent}\u201D`)}catch(a){i(a instanceof Error?a.message:String(a))}},[o,t]),S=g&&b?.batch===g.batch&&b.at===e?g:void 0;return{change:g,offered:S,close:v,takeBack:f,refused:x,said:y}}function ee({context:c,docked:e,at:n,since:o,compact:t=!1,className:l,size:g}){let{change:w,offered:b,close:d,takeBack:y,refused:u,said:x}=N(c,n,o),i=e?b:w,v=(0,r.useRef)(null),f=e&&(i!==void 0||u!==null);j(v,f),(0,r.useEffect)(()=>{if(!f)return;let m,h=()=>m=setTimeout(()=>v.current?.matches(":hover, :focus-within")?h():d(),1e4);return h(),()=>clearTimeout(m)},[f,i?.batch,u,d]);let S=x||(e&&i?p(i):""),a=e?{position:"fixed",inset:"auto",margin:0,padding:0,border:"none",background:"none",overflow:"visible",zIndex:R("toast"),width:"max-content",height:"auto",bottom:"calc(16px + env(safe-area-inset-bottom, 0px))",left:16,justifyItems:"start",color:"var(--graview-ink)",...f?{}:{display:"none"}}:{},T=i?(0,s.jsxs)("button",{type:"button","data-testid":"page-undo",title:`${p(i)} \u2014 \u2318Z or Ctrl+Z`,"aria-keyshortcuts":"Meta+Z Control+Z",onClick:m=>{let h=m.currentTarget.closest("[data-graview-face]");y(),requestAnimationFrame(()=>M(h))},...e?{style:U}:{className:H("graview-undo",l),...D(g),...t?{"data-compact":"","aria-label":p(i)}:{}},children:[(0,s.jsx)("span",{"aria-hidden":"true",children:"\u21B6"}),e?(0,s.jsx)("span",{style:K,children:p(i)}):(0,s.jsx)("span",{className:"graview-undo-words",children:t?"Undo":p(i)})]}):null;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{role:"status","aria-live":"polite",style:V,children:S}),(0,s.jsxs)("div",{ref:v,...e?{popover:"manual","data-graview-foot":"","data-graview-offstage":""}:{},"data-testid":e?"face-undo-dock":"page-undo-place",...e?{style:{...F,...a}}:{className:"graview-undo-place"},children:[e?null:(0,s.jsx)("style",{children:q}),e&&i?(0,s.jsxs)("div",{"data-testid":"page-undo-notice",style:Z,children:[T,(0,s.jsx)("button",{type:"button","data-testid":"page-undo-dismiss","aria-label":`Dismiss: ${p(i)}`,title:"Dismiss",onClick:m=>{let h=m.currentTarget.closest("[data-graview-face]");d(),requestAnimationFrame(()=>M(h))},style:$,children:"\xD7"})]}):T,u?(0,s.jsx)("span",{"data-testid":"page-undo-refused",role:"alert",className:"graview-undo-refused",...e?{style:{fontSize:"0.8125rem",lineHeight:1.4,color:"var(--graview-warn)",borderRadius:6,background:"var(--graview-float)",padding:"4px 8px"}}:{},children:u}):null]})]})}function j(c,e){(0,r.useLayoutEffect)(()=>{let n=c.current;if(!n||!e)return;if(typeof n.showPopover=="function"&&!k(n))try{n.showPopover()}catch{}let o=()=>n.parentElement?.closest("[data-embed-content]")??null,t=()=>{O(n,o()),dispatchEvent(new Event(C))};t(),addEventListener("resize",t),addEventListener("scroll",t,!0);let l=typeof ResizeObserver=="function"?new ResizeObserver(t):null;return l?.observe(n),()=>{if(l?.disconnect(),removeEventListener("resize",t),removeEventListener("scroll",t,!0),n.isConnected&&k(n))try{n.hidePopover()}catch{}dispatchEvent(new Event(C))}},[c,e])}var q=`:where(.graview-undo-place){display:grid;justify-items:end;gap:4px;max-width:100%;min-width:0}
1
+ import{i as z,j as D,k as H}from"./chunk.CEOQY5KS.js";import{a as P,b as A,c as p,d as W}from"./chunk.Q355UPFG.js";import"./chunk.4HU2ILFY.js";import"./chunk.EHLV3LND.js";import"./chunk.EPSYX2SF.js";import"./chunk.EOSN5DWW.js";import"./chunk.T6UJEXFL.js";import"./chunk.7THS3DLZ.js";import"./chunk.4QMAYVPU.js";import"./chunk.ARGEGV5T.js";import"./chunk.WS5ORRGS.js";import"./chunk.ZONRIOIA.js";import"./chunk.NXHEOHRR.js";import{a as C,b as O}from"./chunk.MB7LKKUD.js";import"./chunk.QJJWAYHB.js";import"./chunk.6A3KTD66.js";import"./chunk.MQNW3O67.js";import"./chunk.67S2UWBT.js";import"./chunk.7PWLRRUS.js";import"./chunk.OKHXXIMN.js";import"./chunk.NH3VXTGX.js";import"./chunk.6IMRCKB4.js";import"./chunk.WVUJXDXZ.js";import"./chunk.NI4OPHTL.js";import"./chunk.U5KJQFAP.js";import"./chunk.FOHZPYUV.js";import"./chunk.IXYG65TM.js";import"./chunk.W6L2VAJG.js";import"./chunk.N3MXLORL.js";import"./chunk.MIE4TJRW.js";import"./chunk.3CLTABGP.js";import"./chunk.RD2FSSLV.js";import"./chunk.CVN2XFMF.js";import"./chunk.6TBQV3NO.js";import"./chunk.MT252WP4.js";import"./chunk.VVIQSFM4.js";import"./chunk.TQ3MNB6K.js";import"./chunk.VGYG2IBZ.js";import"./chunk.RJ7VSWTA.js";import"./chunk.P43LPXXJ.js";import{G as B,Y as L,Ya as k}from"./chunk.JCKIJSW7.js";import"./chunk.SDO3U72B.js";import{zd as R}from"./chunk.6L6RUOSF.js";import"./chunk.FQLNBIQ5.js";import{b as E}from"./chunk.AJZBJBMO.js";var r=E(B(),1);var s=E(L(),1);function M(c){let e=document.activeElement;if(e!==null&&e!==document.body&&e!==document.documentElement&&e.isConnected)return;let n=c??document,o=n.querySelector("main")??n.querySelector("[data-graview-page]")??null,t=n.querySelector("[data-graview-page-title]")??o?.querySelector("h1, h2")??o;t instanceof HTMLElement&&(t.hasAttribute("tabindex")||t.setAttribute("tabindex","-1"),t.focus({preventScroll:!0}))}var I=1500;function N(c,e,n){let{store:o,principal:t}=c,l=z(o),g=(0,r.useMemo)(()=>P(o,t),[o,t,l]),w=(0,r.useRef)(n),[b,d]=(0,r.useState)(),[y,u]=(0,r.useState)("");(0,r.useEffect)(()=>{let a=A(o,t,w.current);w.current=o.batches().length,a&&(d({batch:a.batch,at:e,when:Date.now()}),u(""))},[o,t,l]),(0,r.useEffect)(()=>{d(a=>!a||a.at===e?a:Date.now()-a.when<I?{...a,at:e}:void 0)},[e]);let[x,i]=(0,r.useState)(null),v=(0,r.useCallback)(()=>{d(void 0),i(null)},[]),f=(0,r.useCallback)(()=>{i(null);try{let a=W(o,t);a&&u(`Took back \u201C${a.intent}\u201D`)}catch(a){i(a instanceof Error?a.message:String(a))}},[o,t]),S=g&&b?.batch===g.batch&&b.at===e?g:void 0;return{change:g,offered:S,close:v,takeBack:f,refused:x,said:y}}function ee({context:c,docked:e,at:n,since:o,compact:t=!1,className:l,size:g}){let{change:w,offered:b,close:d,takeBack:y,refused:u,said:x}=N(c,n,o),i=e?b:w,v=(0,r.useRef)(null),f=e&&(i!==void 0||u!==null);j(v,f),(0,r.useEffect)(()=>{if(!f)return;let m,h=()=>m=setTimeout(()=>v.current?.matches(":hover, :focus-within")?h():d(),1e4);return h(),()=>clearTimeout(m)},[f,i?.batch,u,d]);let S=x||(e&&i?p(i):""),a=e?{position:"fixed",inset:"auto",margin:0,padding:0,border:"none",background:"none",overflow:"visible",zIndex:R("toast"),width:"max-content",height:"auto",bottom:"calc(16px + env(safe-area-inset-bottom, 0px))",left:16,justifyItems:"start",color:"var(--graview-ink)",...f?{}:{display:"none"}}:{},T=i?(0,s.jsxs)("button",{type:"button","data-testid":"page-undo",title:`${p(i)} \u2014 \u2318Z or Ctrl+Z`,"aria-keyshortcuts":"Meta+Z Control+Z",onClick:m=>{let h=m.currentTarget.closest("[data-graview-face]");y(),requestAnimationFrame(()=>M(h))},...e?{style:U}:{className:H("graview-undo",l),...D(g),...t?{"data-compact":"","aria-label":p(i)}:{}},children:[(0,s.jsx)("span",{"aria-hidden":"true",children:"\u21B6"}),e?(0,s.jsx)("span",{style:K,children:p(i)}):(0,s.jsx)("span",{className:"graview-undo-words",children:t?"Undo":p(i)})]}):null;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{role:"status","aria-live":"polite",style:V,children:S}),(0,s.jsxs)("div",{ref:v,...e?{popover:"manual","data-graview-foot":"","data-graview-offstage":""}:{},"data-testid":e?"face-undo-dock":"page-undo-place",...e?{style:{...F,...a}}:{className:"graview-undo-place"},children:[e?null:(0,s.jsx)("style",{children:q}),e&&i?(0,s.jsxs)("div",{"data-testid":"page-undo-notice",style:Z,children:[T,(0,s.jsx)("button",{type:"button","data-testid":"page-undo-dismiss","aria-label":`Dismiss: ${p(i)}`,title:"Dismiss",onClick:m=>{let h=m.currentTarget.closest("[data-graview-face]");d(),requestAnimationFrame(()=>M(h))},style:$,children:"\xD7"})]}):T,u?(0,s.jsx)("span",{"data-testid":"page-undo-refused",role:"alert",className:"graview-undo-refused",...e?{style:{fontSize:"0.8125rem",lineHeight:1.4,color:"var(--graview-warn)",borderRadius:6,background:"var(--graview-float)",padding:"4px 8px"}}:{},children:u}):null]})]})}function j(c,e){(0,r.useLayoutEffect)(()=>{let n=c.current;if(!n||!e)return;if(typeof n.showPopover=="function"&&!k(n))try{n.showPopover()}catch{}let o=()=>n.parentElement?.closest("[data-embed-content]")??null,t=()=>{O(n,o()),dispatchEvent(new Event(C))};t(),addEventListener("resize",t),addEventListener("scroll",t,!0);let l=typeof ResizeObserver=="function"?new ResizeObserver(t):null;return l?.observe(n),()=>{if(l?.disconnect(),removeEventListener("resize",t),removeEventListener("scroll",t,!0),n.isConnected&&k(n))try{n.hidePopover()}catch{}dispatchEvent(new Event(C))}},[c,e])}var q=`:where(.graview-undo-place){display:grid;justify-items:end;gap:4px;max-width:100%;min-width:0}
2
2
  :where(.graview-undo){box-sizing:border-box;display:inline-flex;align-items:center;gap:6px;min-height:var(--graview-control-height,36px);max-width:min(100%,var(--graview-undo-widest,18rem));min-width:0;padding:0 14px;border-radius:999px;border:1px solid var(--graview-edge);background:var(--graview-float);color:var(--graview-ink);font:inherit;font-size:.875rem;cursor:pointer}
3
3
  :where(.graview-undo[data-size=sm]){--graview-control-height:30px}
4
4
  :where(.graview-undo[data-compact]){padding:0 10px}
@@ -0,0 +1 @@
1
+ import{a as ge,b as U}from"./chunk.SGYZM6ZU.js";import{a as ke}from"./chunk.CEQQIW7Z.js";import{a as pe,e as ye}from"./chunk.MFMC35ET.js";import{b as ie,c as se,d as le,e as de,f as ce,g as ue,h as me,i as fe,j as we}from"./chunk.GKYJQE5A.js";import"./chunk.EZQK23AB.js";import"./chunk.QDVGHI7R.js";import{a as Q,b as X,d as Y}from"./chunk.L3MLGFIS.js";import"./chunk.MIE4TJRW.js";import{w as D}from"./chunk.3CLTABGP.js";import"./chunk.RD2FSSLV.js";import"./chunk.CVN2XFMF.js";import"./chunk.6TBQV3NO.js";import"./chunk.MT252WP4.js";import"./chunk.VVIQSFM4.js";import"./chunk.TQ3MNB6K.js";import"./chunk.VGYG2IBZ.js";import{G as ae,N as O,P as E,Qa as J,R as L,T as K,Y as $,ha as A,na as _,qa as P,ta as S,ua as q,wa as F,za as z}from"./chunk.JCKIJSW7.js";import"./chunk.SDO3U72B.js";import"./chunk.6L6RUOSF.js";import"./chunk.FQLNBIQ5.js";import{b as C}from"./chunk.AJZBJBMO.js";var i=C(ae(),1);var a=C($(),1);function he(e,t){let n=e?.logo;if(!t||!n)return e;let s=o=>o.startsWith("/graview/assets/")?t(o):o;return{...e,logo:typeof n=="string"?s(n):{...n,light:s(n.light),...n.dark?{dark:s(n.dark)}:{}}}}var Ve=e=>({...e.node?{node:{id:e.node.id}}:{},...e.nodes?{nodes:e.nodes.map(t=>({id:t.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 ne(e){let t=K(),n=t?.past?.seq,s=t?.host?.viewAt,o=(0,i.useMemo)(()=>n===void 0||!s||e.draft||e.keepsNothing?void 0:s(e.manifest.name,n),[s,n,e]);return(0,i.useMemo)(()=>o===null?null:o===void 0?e:{...e,worker:o},[o,e])}var T=new WeakMap,H=new Set,We=e=>(H.add(e),()=>void H.delete(e));function ve(e,t){t===void 0?T.delete(e):T.set(e,t);for(let n of[...H])n()}function re({definition:e,store:t,principal:n,input:s,goTo:o,places:l,arrangement:d,scheme:c,brand:f,onFailure:m,drawsItsOwn:w,tick:p}){let y=(0,i.useSyncExternalStore)(We,()=>T.get(e),()=>{}),r=(0,i.useMemo)(()=>y===void 0?e:{...e,worker:{source:y}},[e,y]),V=(0,i.useRef)(null),k=(0,i.useRef)(null),v=O(),b=E(),I=L(),R=(0,i.useContext)(_),x=(0,i.useMemo)(()=>he(f,b),[f,b]),u=(0,i.useRef)({input:s,goTo:o,places:l,arrangement:d,onFailure:m,brand:x,hostFiles:v,hostAssets:b,viewerState:I,told:R});u.current={input:s,goTo:o,places:l,arrangement:d,onFailure:m,brand:x,hostFiles:v,hostAssets:b,viewerState:I,told:R},(0,i.useEffect)(()=>{let W=V.current;if(!W)return;let j=r.file??(u.current.hostFiles?.src?g=>u.current.hostFiles?.src?.(g)??g:void 0);typeof r.worker=="function"&&U(r.worker).catch(()=>{});let B=g=>({manifest:r.manifest,worker:g,store:t,principal:n,input:()=>u.current.input?.()??{},goTo:()=>u.current.goTo,places:()=>u.current.places?.()??[],arrangement:()=>u.current.arrangement?.(),brand:()=>u.current.brand,onFailure:(h,oe)=>u.current.onFailure(h,oe),...w?{fallback:!1}:{},...r.limits?{limits:r.limits}:{},...r.author?{author:r.author}:{},...r.onProblem?{onProblem:r.onProblem}:{},...r.asset?{asset:r.asset}:u.current.hostAssets?{asset:h=>u.current.hostAssets?.(h)??h}:{},...j?{file:j}:{},...r.images?{images:r.images}:{},...r.fonts?{fonts:r.fonts}:{},...r.links?{links:r.links}:{},files:()=>u.current.hostFiles,...r.draft||r.keepsNothing?{draft:!0}:{viewerState:()=>u.current.viewerState},onContentHeight:h=>u.current.told?.(h)}),te=X(Q,g=>{k.current=g.mountWorkerView(W,B(r.worker)),D(W,g.viewPlaceHandle({element:W,definition:r,mounted:()=>k.current,optionsFor:B,draw:h=>ve(e,h),mount:g.mountWorkerView,pressing:Y}))});return()=>{te(),D(W,null),k.current?.dispose(),k.current=null}},[r,t,n]),(0,i.useEffect)(()=>k.current?.update(),[c,x,p]);let N=(0,a.jsx)("div",{ref:V,"data-worker-view-place":r.manifest.name,style:{minWidth:0}});if(!r.draft)return N;let M=r.manifest.title??r.manifest.name;return(0,a.jsxs)("div",{role:"group","aria-label":`Draft: ${M}`,"data-graview-draft-view":r.manifest.name,style:{display:"grid",gap:8,alignContent:"start",minWidth:0},children:[(0,a.jsxs)("p",{"data-testid":"draft-view-line",style:be,children:[(0,a.jsxs)("span",{children:["Draft \u2014 ",(0,a.jsx)("span",{style:{color:"var(--graview-ink)",fontWeight:600},children:M})]}),(0,a.jsx)("span",{"aria-hidden":"true",children:"\xB7"}),(0,a.jsx)("span",{children:"Not kept"})]}),N]})}var be={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 Z({view:e,props:t,fellBack:n}){return(0,a.jsx)("div",{"data-worker-view-fallback":"",...n?{"data-worker-view-fell-back":n.name,"data-worker-view-failed":n.reason}:{},style:{display:"contents"},children:(0,a.jsx)(e,{...t})})}var ee=(0,a.jsx)("div",{"data-worker-view-fallback":"",style:{display:"contents"}});function Se({name:e,reason:t,children:n}){return(0,a.jsx)("div",{"data-worker-view-fell-back":e,"data-worker-view-failed":t,style:{display:"contents"},children:n})}function G(e,t={}){let n=t.fallback,s=e.manifest.replaces==="page";function o(l){let d=A(),c=P(),f=(0,i.useContext)(J),[m,w]=(0,i.useState)(null),p=(0,i.useRef)(l);p.current=l;let y=ne(e);if(!d)return null;if(y===null)return n&&!(f&&S(n)&&!s)?(0,a.jsx)(Z,{view:n,props:l}):ee;if(m&&n)return f&&S(n)&&!s?ee:(0,a.jsx)(Z,{view:n,props:l,fellBack:{name:e.manifest.name,reason:m}});let r=t.beside&&!(f&&S(t.beside))?t.beside:void 0,V=(0,a.jsx)(re,{definition:y,store:d.store,principal:d.principal,input:()=>Ve(p.current),goTo:c,places:()=>d.views.places(),arrangement:()=>d.views.arrangement?.(),scheme:d.scheme,brand:d.brand,tick:l,drawsItsOwn:n!==void 0,onFailure:(k,v)=>{w(k),e.onFailure?.(k,v)}});return r?(0,a.jsxs)("div",{"data-worker-view-beside":e.manifest.name,style:{display:"grid",gap:12,minWidth:0},children:[V,e.manifest.bleed==="full"?(0,a.jsx)("div",{"data-worker-view-beside-under":"",style:{minWidth:0},children:(0,a.jsx)(r,{...l})}):(0,a.jsx)(r,{...l})]}):V}return o.displayName=`WorkerView(${e.manifest.name})`,o}function xe(e,t){let{manifest:n}=t;if(n.attach==="home"){if(!e.home)throw new Error(`The worker view "${n.name}" is the home's body: draw it with workerHome, on the home.`);let m=e.homes?.(),w=t.draft?void 0:m?m.filter(y=>y.name===void 0).at(-1)?.view:e.homeView?.(),p=G(t,w?{fallback:w}:{});return e.home(n.bleed===!0||n.bleed==="full"?F(p,n.bleed):p,t.draft?void 0:{name:n.name}),e}let s={cardinality:n.cardinality,fidelity:"full"},o=e.lookup(n.attach,s)??e.resolve(n.attach,s)?.view,l=n.cardinality==="one",d=t.draft===!0,c=G(t,{...o&&!d?{fallback:o}:{},...l&&n.replaces!=="page"&&o?{beside:o}:{}});n.replaces==="page"&&q(c);let f=o?.says;return l&&n.replaces!=="page"&&typeof f=="function"&&(c.says=f),(n.bleed===!0||n.bleed==="full")&&F(c,n.bleed),c.flows=n.flows!==!1,n.heading==="own"&&(c.ownHeading=!0),z(c,n.scene?.maxHeight!==void 0?{maxHeight:n.scene.maxHeight}:{}),e.register(n.attach,s,c,n.title?{title:n.title,...d?{}:{name:n.name},lens:"view",...n.reads?.kinds?.length?{reads:n.reads.kinds}:{}}:d?void 0:{name:n.name}),e}function Ce(e,t={}){let n=t.fallback;function s({context:o}){let l=A(),d=P(),[c,f]=(0,i.useState)(null),m=ne(e);return c&&n?(0,a.jsx)(Se,{name:e.manifest.name,reason:c,children:(0,a.jsx)(n,{context:o})}):m===null&&n?(0,a.jsx)(n,{context:o}):m===null?null:(0,a.jsx)(re,{definition:m,store:o.store,principal:o.principal??l?.principal??{kind:"human"},goTo:d,...l?{places:()=>l.views.places(),arrangement:()=>l.views.arrangement?.(),scheme:l.scheme,brand:l.brand}:{},drawsItsOwn:n!==void 0,onFailure:(w,p)=>{f(w),e.onFailure?.(w,p)}})}return s.displayName=`WorkerHome(${e.manifest.name})`,s}export{se as checkManifest,ke as checkViewSource,ue as edgesReadWithoutTheirKinds,me as edgesReadWithoutTheirKindsSaid,ye as judgeCodeAct,ie as manifestActs,ce as ownKindRelations,fe as readsComputed,xe as registerWorkerView,pe as sightIsTotal,le as unreadEdges,de as unreadEdgesSentence,ge as viewScript,Ce as workerHome,G as workerView,we as workerViewProps};
@@ -0,0 +1 @@
1
+ import{a as E,b,c as w,d as V,e as _}from"./chunk.W6L2VAJG.js";import{a as R,k as d,l as S}from"./chunk.N3MXLORL.js";import{Ra as $,Sa as F}from"./chunk.6L6RUOSF.js";var O=["card","row","page"],A=["good","warn","bad","neutral","accent"],H=["money","percent","date","time","datetime","relative","count"],T=4,I=40,L=120,B=["number","money","percent"],M=["large"],X=["card","row"],N=1e3,ye=100;function Z(e){let n=/^\s*(out|in)\(\s*['"]([A-Za-z][A-Za-z0-9_-]*)['"]\s*\)\s*$/.exec(e);return n?{edge:n[2],way:n[1]}:/^[A-Za-z][A-Za-z0-9_-]*$/.test(e)?{edge:e}:void 0}var v={title:[],headline:[],list:["sort","limit","group","empty","as"],text:["tone","lines"],badge:["tone"],field:["as","currency","label"],image:["as","label"],progress:["label"],group:["direction"],when:["show"],divider:[],figure:["as","currency","label","emphasis"]},Y=Object.keys(v),G=`{"title": "{name}"}, {"headline": "{count(all('offer'))} offers"}, {"figure": expr, "as"?: "number"|"money"|"percent", "currency"?, "label"?, "emphasis"?: "large"}, {"list": expr, "sort"?, "limit"?, "group"?, "empty"?, "as"?: "card"|"row"}, {"text": "\u2026", "tone"?, "lines"?: 0-12}, {"badge": "{status}", "tone"?}, {"field": "quote", "as"?, "currency"?, "label"?}, {"image": "photos", "as"?: "thumb"|"gallery"}, {"progress": {"value": expr, "max": expr}, "label"?}, {"group": [blocks], "direction"?: "row"|"column"}, {"when": expr, "show": [blocks]}, {"divider": true}, {"figure": true}`,q=e=>/^(image|video|file)$/.test(e?.of??e?.type??"");function he(e){return Object.fromEntries(Object.entries(e.views??{}).filter(([,n])=>!Array.isArray(n)))}function me(e){let n=e.views?.home;return Array.isArray(n)?n:void 0}var J={field:()=>!1,relation:()=>!1,figure:!1},W=e=>e.kind??"the home",m=(e,n)=>e!==void 0&&Object.hasOwn(e,n),g=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function D(e,n,t){let s=E(e);for(let a of s.unknownFunctions)t.findings.push(d("unknown-function",n,`"${a}" is not a function the rule language knows`,"see docs/declaration-document.md#expression-language"));for(let a of s.names){if(t.kind===null){t.findings.push(d("view-name",n,`"${a}" names nothing here: these blocks are about no one record`,"reach records with all('<kind>'), like count(all('offer')) or first(all('party') where role == 'client').name"));continue}a==="id"||t.spec.field(a)||t.spec.relation(a)||t.findings.push(d("view-name",n,`${t.kind} has no field or relation called "${a}"`))}for(let a of s.edges)t.edges.has(a)||t.findings.push(d("view-edge",n,`"${a}" is not a relation any kind declares`));for(let a of s.sweeps)t.kinds.has(a)||t.findings.push(d("view-kind",n,`"${a}" is not a kind this document declares`))}function k(e,n,t){if(typeof e!="string"||e.length===0||e.length>2e3){t.findings.push(d("view-expression",n,`an expression is a line of the rule language, like "status == 'booked'"`));return}try{D(w(e),n,t)}catch(s){if(!(s instanceof b))throw s;t.findings.push(d("expression",n,`${s.sentence} (at character ${s.at+1})`))}}function j(e,n,t,s,a=!1){let l=s==="text";if(typeof e!="string"||e.length===0||e.length>300){t.findings.push(d("view-template",n,'a template is words with {field} in braces, like "{name}" or "{quote|money}", at most 300 characters'));return}let r;try{r=_(e)}catch(i){if(i instanceof V||i instanceof b){t.findings.push(d("template",n,i.sentence));return}throw i}for(let i of r)if(i.expr){if(D(i.expr,n,t),l&&!a&&!i.format&&i.expr.t==="ident"&&(t.slot==="card"||t.slot==="row")&&t.spec.prose?.(i.expr.name)){let o=i.expr.name;t.findings.push(S("view-whole-text",n,`${t.kind} ${t.slot} shows ${o} whole; it will be clamped. Use {${o}|excerpt} or move it to the page.`,`write {${o}|excerpt}, or {${o}|excerpt: 80} for fewer characters`))}if(s==="headline"&&!i.format&&i.expr.t==="ident"&&t.spec.prose?.(i.expr.name)){let o=i.expr.name;t.findings.push(S("view-headline-long",n,`${W(t)}${t.slot?` ${t.slot}`:""} heads it with ${o}, a long text, drawn at a headline's size; a headline is a few words.`,`say it in a text block, {"text": "{${o}}"}, or head it with {${o}|excerpt: 60}`))}}}var K=12;function Q(e,n,t){typeof e=="number"&&Number.isInteger(e)&&e>=0&&e<=K||t.findings.push(d("view-lines",n,`lines is ${JSON.stringify(e)}, and a text block's lines is a whole number from 1 to ${K}, or 0 to show it whole`,'{"text": "{awards}", "lines": 6}, or "lines": 0 for no cut at all'))}function ee(e,n,t){if(typeof e=="string"){A.includes(e)||t.findings.push(d("view-tone",n,`"${e}" is not a tone`,`use one of ${A.join(", ")}, or {"expr": "if(status == 'booked', 'good', 'neutral')"}`));return}if(g(e)&&Object.keys(e).length===1&&"expr"in e){k(e.expr,`${n}.expr`,t);return}t.findings.push(d("view-tone",n,'a tone is a word or {"expr": \u2026}',`one of ${A.join(", ")}`))}function x(e,n,t,s){if(!Array.isArray(e)){s.findings.push(d("view-shape",n,"a view is a list of blocks"));return}if(t>T){s.findings.push(d("view-depth",n,`blocks nest at most ${T} deep`,"flatten a group or a condition"));return}e.forEach((a,l)=>ne(a,`${n}.${l}`,t,s))}function ne(e,n,t,s){if(t===1&&s.count++,s.all++,!g(e)){s.findings.push(d("view-block",n,"a block is an object naming what it shows",`one of ${G}`));return}let a=Object.keys(e),l=a.filter(o=>Y.includes(o)&&!(o==="group"&&a.includes("list")));if(l.length===0){s.findings.push(d("view-block",n,`${a.length>0?a.map(o=>`"${o}"`).join(", "):"an empty object"} is not a block Graview knows`,`one of ${G}`));return}if(l.length>1){s.findings.push(d("view-block",n,`a block is one thing, and this says ${l.map(o=>`"${o}"`).join(" and ")}`,"split it into two blocks"));return}let r=l[0];for(let o of a)o!==r&&o!="key"&&!v[r].includes(o)&&s.findings.push(d("unknown-key",`${n}.${o}`,`"${o}" is not part of a ${r} block`,v[r].length>0?`a ${r} block may also say ${v[r].map(f=>`"${f}"`).join(", ")}`:`a ${r} block says nothing else`));let i=e[r];switch(r){case"title":case"headline":case"text":case"badge":j(i,`${n}.${r}`,s,r==="text"||r==="headline"?r:void 0,r==="text"&&"lines"in e),"tone"in e&&ee(e.tone,`${n}.tone`,s),r==="text"&&"lines"in e&&Q(e.lines,`${n}.lines`,s);return;case"image":case"field":{let o=r==="image";if(typeof i!="string"||!(o?s.spec.files?.(i):s.spec.field(i))){let u=typeof i=="string"&&s.spec.relation(i);s.findings.push(d(`view-${r}`,`${n}.${r}`,`${s.kind} has no ${o?"image, video or file ":""}field ${typeof i=="string"?`"${i}"`:"by that name"}`,u?`"${i}" is a relation; show it with {"text": "{${i}.name}"}`:void 0))}let f=o?["thumb","gallery"]:H;"as"in e&&!f.includes(e.as)&&s.findings.push(d("view-format",`${n}.as`,`"${String(e.as)}" is not a way to show ${o?"pictures":"a field"}`,`use one of ${f.join(", ")}`)),o||P(e,n,s,"field"),"label"in e&&se(e.label,`${n}.label`,s);return}case"progress":{!g(i)||Object.keys(i).some(o=>o!=="value"&&o!=="max")||!("value"in i)||!("max"in i)?s.findings.push(d("view-progress",`${n}.progress`,'progress is {"value": expression, "max": expression}')):(k(i.value,`${n}.progress.value`,s),k(i.max,`${n}.progress.max`,s)),"label"in e&&j(e.label,`${n}.label`,s);return}case"group":"direction"in e&&e.direction!=="row"&&e.direction!=="column"&&s.findings.push(d("view-direction",`${n}.direction`,`a group runs "row" or "column", not "${String(e.direction)}"`)),x(i,`${n}.group`,t+1,s);return;case"when":k(i,`${n}.when`,s),"show"in e?x(e.show,`${n}.show`,t+1,s):s.findings.push(d("view-when",n,'a condition says what it shows: {"when": expr, "show": [blocks]}'));return;case"figure":if(typeof i=="string")return ie(e,n,s);for(let o of["as","currency","label","emphasis"])o in e&&s.findings.push(d("unknown-key",`${n}.${o}`,`"${o}" belongs to a figure that works a number out; {"figure": true} is the kind's picture`,`write {"figure": "count(all('offer'))", "as": "number"}`));i!==!0?s.findings.push(d("view-block",`${n}.figure`,`a figure is a number worked out, {"figure": "sum(all('offer'), net)", "as": "money"}, or the kind's picture, {"figure": true}`)):s.spec.figure||s.findings.push(d("view-figure",`${n}.figure`,`${W(s)} has no figure to show`,s.kind===null?`work a number out: {"figure": "count(all('offer'))"}`:'give the kind a "figure", or leave this block out'));return;case"list":return oe(e,n,s);case"divider":i!==!0&&s.findings.push(d("view-block",`${n}.${r}`,`write {"${r}": true}`));return}}function ie(e,n,t){k(e.figure,`${n}.figure`,t),"as"in e&&!B.includes(e.as)&&t.findings.push(d("view-format",`${n}.as`,`"${String(e.as)}" is not a way to say a figure`,`use one of ${B.join(", ")}`)),P(e,n,t,"figure"),"label"in e&&j(e.label,`${n}.label`,t),"emphasis"in e&&!M.includes(e.emphasis)&&t.findings.push(d("view-emphasis",`${n}.emphasis`,`"${String(e.emphasis)}" is not how loudly a figure is said`,`use ${M.map(s=>`"${s}"`).join(", ")}, or leave it out for the figure's own size`))}function P(e,n,t,s){"currency"in e&&(typeof e.currency!="string"||!/^[A-Z]{3}$/.test(e.currency)?t.findings.push(d("view-currency",`${n}.currency`,'a currency is its three-letter code, like "USD" or "EUR"')):e.as!=="money"&&t.findings.push(d("view-currency",`${n}.currency`,`a currency belongs on a ${s} shown as money`,'add "as": "money"')))}function te(e,n){let t=[...n.kinds],s=(l,r)=>{let i=new Set;for(let o of l){let f=n.vocabulary.namesOf(o)?.targets?.(r);if(f==="*")return t;for(let u of f??[])i.add(u)}return i.size>0?[...i]:void 0},a=l=>{switch(l.t){case"ident":return l.name===R?n.kind!==null?[n.kind]:void 0:n.kind!==null&&n.spec.relation(l.name)?s([n.kind],l.name):void 0;case"member":{let r=a(l.object);return r?s(r,l.name):void 0}case"where":return a(l.set);case"call":{let r=l.args[0],i=r?.t==="lit"&&typeof r.value=="string"?r.value:void 0;if(l.fn==="all")return i!==void 0&&n.kinds.has(i)?[i]:void 0;let o=l.args.length===2&&l.args[1]?.t==="lit"&&typeof l.args[1].value=="string"?l.args[1].value:void 0;if(l.fn==="out"&&o!==void 0){let f=a(r);return f?s(f,o):void 0}if(l.fn==="out")return i!==void 0&&n.kind!==null?s([n.kind],i):void 0;if(l.fn==="in"){let f=o??i,u=o!==void 0?a(r):n.kind!==null?[n.kind]:void 0,c=f!==void 0?n.vocabulary.sources(f).filter(p=>{let y=n.vocabulary.namesOf(p)?.targets?.(f);return!u||y==="*"||u.some(h=>y?.includes(h))}):[];return c.length>0?c:void 0}if((l.fn==="sort"||l.fn==="first")&&r)return a(r);if(l.fn==="either"){let f=l.args.map(a);return f.every(u=>u!==void 0)?[...new Set(f.flatMap(u=>u??[]))]:void 0}return}default:return}};return a(e)}function z(e,n,t,s){let a;try{a=w(e)}catch(r){if(!(r instanceof b))throw r;s.findings.push(d("expression",n,`${r.sentence} (at character ${r.at+1})`));return}let l=E(a);for(let r of l.unknownFunctions)s.findings.push(d("unknown-function",n,`"${r}" is not a function the rule language knows`,"see docs/declaration-document.md#expression-language"));for(let r of l.edges)s.edges.has(r)||s.findings.push(d("view-edge",n,`"${r}" is not a relation any kind declares`));if(t)for(let r of l.names)r==="id"||t.some(i=>s.vocabulary.namesOf(i)?.field(r)||s.vocabulary.namesOf(i)?.relation(r))||s.findings.push(d("view-name",n,`${t.join(" and ")} ${t.length===1?"has":"have"} no field or relation called "${r}"`))}function oe(e,n,t){let s=e.list;k(s,`${n}.list`,t);let a;if(typeof s=="string")try{a=te(w(s),t)}catch{a=void 0}let l=i=>{if(!a)return[...t.kinds].map(f=>t.vocabulary.namesOf(f)?.choices?.(i)).find(f=>f!==void 0);let o=a.map(f=>t.vocabulary.namesOf(f)?.choices?.(i));return o.every(f=>f!==void 0)?[...new Set(o.flatMap(f=>f??[]))]:void 0},r=a?a.join(" and "):"any kind";if("sort"in e){let i=e.sort;if(typeof i=="string")z(i,`${n}.sort`,a,t);else if(g(i)&&typeof i.by=="string"&&Object.keys(i).every(o=>o==="by"||o==="direction")){let o=i.direction;o!==void 0&&o!=="asc"&&o!=="desc"&&o!=="choices"?t.findings.push(d("list-sort",`${n}.sort.direction`,`a list is sorted "asc", "desc" or "choices", not "${String(o)}"`,'"choices" puts a choice field in the order its choices are declared')):o==="choices"?l(i.by)===void 0&&t.findings.push(d("list-sort",`${n}.sort.by`,`"${i.by}" is not a choice field of ${r}, so it has no declared order`,'sort by a choice field, or say "asc" or "desc"')):z(i.by,`${n}.sort.by`,a,t)}else t.findings.push(d("list-sort",`${n}.sort`,'a sort is a key, like "net", or {"by": key, "direction": "asc" | "desc" | "choices"}'))}if("limit"in e){let i=e.limit;(typeof i!="number"||!Number.isInteger(i)||i<1||i>N)&&t.findings.push(d("list-limit",`${n}.limit`,`a limit is a whole number from 1 to ${N}`))}if("group"in e){let i=e.group,o=typeof i=="string"?i:g(i)&&typeof i.by=="string"?i.by:void 0;if(!(typeof i=="string"||g(i)&&Object.keys(i).every(u=>u==="by"||u==="headings"))||o===void 0)t.findings.push(d("list-group",`${n}.group`,'a group is a choice field, like "type", or {"by": "type", "headings": {"pain": "What hurts"}} \u2014 or a relation, like "inGenre", a heading per linked record'));else{let u=l(o),c=u===void 0?Z(o):void 0,p=c!==void 0&&(c.way!==void 0?t.edges.has(c.edge):a?a.every(y=>t.vocabulary.namesOf(y)?.relation(c.edge)):t.edges.has(c.edge));if(u===void 0&&!p&&t.findings.push(d("list-group",`${n}.group`,`"${o}" is not a choice field or a relation of ${r}, so it has nothing to group by`,'group by a field whose type is enum, or by a relation of the kind listed, like "inGenre"')),g(i)&&"headings"in i){let y=i.headings;if(!g(y)||Object.values(y).some(h=>typeof h!="string"||h.length===0||h.length>80))t.findings.push(d("list-group",`${n}.group.headings`,'headings are words per choice, like {"pain": "What hurts"}, at most 80 characters each'));else if(u)for(let h of Object.keys(y))u.includes(h)||t.findings.push(d("list-group",`${n}.group.headings.${h}`,`"${h}" is not one of ${o}'s choices`,`use ${u.join(", ")}`))}}}"empty"in e&&(typeof e.empty!="string"||e.empty.length===0||e.empty.length>200)&&t.findings.push(d("list-empty",`${n}.empty`,"what an empty list says is a sentence, at most 200 characters")),"as"in e&&!X.includes(e.as)&&t.findings.push(d("list-as",`${n}.as`,`a list draws each record as its "card" or its "row", not "${String(e.as)}"`))}function se(e,n,t){(typeof e!="string"||e.length===0||e.length>60)&&t.findings.push(d("view-label",n,"a label is a few words, at most 60 characters"))}function U(e,n,t,s,a,l,r){let i={kind:null,spec:J,kinds:s,edges:a,vocabulary:t,findings:l,count:0,all:0};Array.isArray(e)&&e.length===0&&l.push(d("view-shape",n,`${r} has no blocks`,'give it one: {"headline": "\u2026"}')),x(e,n,1,i),C(i,n,r,"show less")}function C(e,n,t,s){e.count>I?e.findings.push(d("view-size",n,`${t} has ${e.count} blocks at its top; a view has at most ${I} there, a group or a condition counting as one`,`${s}, or gather some into a group`)):e.all>L&&e.findings.push(d("view-size",n,`${t} has ${e.all} blocks counting the ones inside its groups and conditions; a view has at most ${L} in all`,s))}function re(e,n,t,s,a){Array.isArray(e)&&e.forEach((l,r)=>{if(!g(l)||l.name!=="blocks"||!g(l.options)||!("blocks"in l.options))return;let i=[];U(l.options.blocks,`lenses.${r}.options.blocks`,n,t,s,i,`the lens "${String(l.title??r)}"`);for(let o of i)a.push({...o,severity:"warning"})})}function ae(e,n,t,s,a,l,r){let i=[];if(e===void 0)return i;if(!g(e))return i.push(d("view-shape",n,'views are an object of kinds, each with a "card", a "row" or a "page"')),i;for(let[o,f]of Object.entries(e)){if(o==="home"&&Array.isArray(f)){U(f,`${n}.home`,r,s,a,i,"the home");continue}let u=t(o);if(!u){i.push(d("view-kind",`${n}.${o}`,`"${o}" is not a kind this ${l} declares`));continue}if(!g(f)){i.push(d("view-shape",`${n}.${o}`,`a kind's views are {"card": [blocks], "row": [blocks], "page": [blocks]}`));continue}for(let c of Object.keys(f))O.includes(c)||i.push(d("view-slot",`${n}.${o}.${c}`,`"${c}" is not a place a view is drawn`,`use ${O.map(p=>`"${p}"`).join(", ")}`));for(let c of O){let p=f[c];if(p===void 0)continue;let y={kind:o,spec:u,kinds:s,edges:a,vocabulary:r,findings:i,count:0,all:0,slot:c};x(p,`${n}.${o}.${c}`,1,y),C(y,`${n}.${o}.${c}`,`this ${c}`,"show less, or move detail to the page")}}return i}function pe(e){let n=new Set(Object.keys(e.kinds)),t=new Set(Object.values(e.kinds).flatMap(r=>Object.keys($(r.edges)))),s=r=>{let i=m(e.kinds,r)?e.kinds[r]:void 0;return i?{field:o=>m(i.fields,o)||m(i.computed,o)||F(i.edges).has(o),relation:o=>m($(i.edges),o),figure:i.figure!==void 0,files:o=>m(i.fields,o)&&q(i.fields[o]),choices:o=>m(i.fields,o)&&i.fields[o].type==="enum"?i.fields[o].options:void 0,targets:o=>m($(i.edges),o)?i.edges[o].to:void 0,prose:o=>m(i.fields,o)&&i.fields[o].type==="text"}:void 0},a={namesOf:s,sources:r=>Object.keys(e.kinds).filter(i=>m(e.kinds[i].edges,r))},l=ae(e.views,"views",s,n,t,"document",a);return re(e.lenses,a,n,t,l),l}export{A as a,H as b,B as c,M as d,N as e,ye as f,Z as g,he as h,me as i,pe as j};
@@ -0,0 +1,32 @@
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 ue,b as ge,c as Le}from"./chunk.3RRK6UTN.js";import{b as me,c as ye,d as he}from"./chunk.MWWNKM3I.js";import{a as le,c as G,d as de,e as pe}from"./chunk.QJJWAYHB.js";import"./chunk.6A3KTD66.js";import{a as se}from"./chunk.5OS4SYHE.js";import"./chunk.MQNW3O67.js";import"./chunk.U5P23GO7.js";import"./chunk.RO3D2RNP.js";import"./chunk.MEAUTBVM.js";import"./chunk.OKHXXIMN.js";import"./chunk.NH3VXTGX.js";import"./chunk.6IMRCKB4.js";import"./chunk.GFBE4VNT.js";import"./chunk.RDUGUC7R.js";import"./chunk.OPMGQS5J.js";import"./chunk.QKRQPUCE.js";import"./chunk.MIE4TJRW.js";import"./chunk.3CLTABGP.js";import"./chunk.RD2FSSLV.js";import"./chunk.CVN2XFMF.js";import"./chunk.6TBQV3NO.js";import"./chunk.MT252WP4.js";import{l as ce}from"./chunk.VVIQSFM4.js";import"./chunk.TQ3MNB6K.js";import"./chunk.VGYG2IBZ.js";import{h as ie,m as V}from"./chunk.RJ7VSWTA.js";import"./chunk.P43LPXXJ.js";import{$a as oe,F as te,G as D,Oa as _,Sa as re,Xa as ae,Y as N,Z as ne,c as Q,ga as C,x as ee}from"./chunk.JCKIJSW7.js";import{a as B}from"./chunk.SDO3U72B.js";import{Tb as Z,cd as J,eb as Y,ha as q,ma as K,pb as X,qa as U}from"./chunk.6L6RUOSF.js";import"./chunk.FQLNBIQ5.js";import{b as M}from"./chunk.AJZBJBMO.js";var Ae=M(D(),1);function T(e){return{minHeight:24,padding:"3px 10px",borderRadius:6,fontSize:"0.875rem",borderWidth:1,borderStyle:"solid",borderColor:e?"transparent":"var(--graview-edge)",color:e?"var(--graview-ink)":"var(--graview-ink-muted)",fontWeight:e?600:400,background:e?"color-mix(in srgb, var(--graview-accent) 16%, transparent)":"transparent"}}var I=M(N(),1);function fe(){let{seats:e,principal:t,takeSeat:a}=C();return e.length<2?null:(0,I.jsxs)("div",{role:"group","aria-label":"Seat","data-testid":"seats",style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:6,rowGap:4},children:[(0,I.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:"As"}),e.map(n=>{let l=Te(t,n.principal);return(0,I.jsx)("button",{type:"button","aria-pressed":l,"data-testid":`seat-${n.principal.id??n.label}`,title:`Sit down as ${n.label}: the acts, the kinds and the pages narrow to what this seat may do`,onClick:()=>a(n.principal),style:{...T(l),whiteSpace:"nowrap"},children:n.label},n.principal.id??n.label)})]})}function Te(e,t){return e.kind===t.kind&&e.id===t.id}var H=M(D(),1),w=M(N(),1),Ie=`
2
+ .graview-here{display:flex;flex:none}
3
+ .graview-here>button{display:inline-flex;align-items:center;gap:4px;height:30px;margin:0;padding:0 4px;border:1px solid transparent;border-radius:8px;background:none;box-shadow:none;font:inherit;font-size:.75rem;color:var(--graview-ink-muted);cursor:pointer}
4
+ .graview-here-mark{display:inline-flex;align-items:center;justify-content:center;flex:none;box-sizing:border-box;width:24px;height:24px;border-radius:50%;border:1.5px solid hsl(var(--graview-hue) 50% 48%);background:var(--graview-panel-muted);color:var(--graview-ink);font-size:.75rem;font-weight:600;box-shadow:0 0 0 2px var(--graview-bar)}
5
+ .graview-here-mark+.graview-here-mark{margin-left:-10px}
6
+ .graview-here-mark[data-agent]{border-radius:5px}
7
+ .graview-here-mark[data-counted]{--graview-hue:0;border-color:var(--graview-edge)}
8
+ .graview-here small{display:block;font-size:.75rem;color:var(--graview-ink-muted)}
9
+ .graview-bar[data-finding] .graview-here{display:none}`,Re={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)"};function $e(e,t){let a=t.id===void 0?null:`${t.kind}:${t.id}`,n=new Map;for(let l of e.values()){let o=l.participant.slice(0,l.participant.lastIndexOf(":"));if(o===a)continue;let i=o.endsWith(":")?l.participant:o,d=n.get(i);(!d||d.at<l.at)&&n.set(i,l)}return[...n.values()]}var be=e=>e.name&&e.onBehalfOfName?`${e.name}, for ${e.onBehalfOfName}`:e.name??"",ve=e=>e===1?"1 viewer":`${e} viewers`;function He(e){let t=e.map(be).filter(Boolean),a=t.length<e.length?[...t,ve(e.length-t.length)]:t,n=a.pop();return`${a.length>0?`${a.join(", ")} and ${n}`:n} ${e.length===1?"is":"are"} here`}function ze(e,t){let{store:a,hidden:n,pictures:l}=t,o=Q(e),i=a.kindsKeptFrom(t.principal),d=y=>!n.has(y)&&!i.has(y)&&!a.modules.disabledKinds.has(y),m=l.find(y=>y.as===o.within?.view&&d(y.kind));if(m)return m.title;if(!o.focusId)return o.overview?"everything":null;let c=ee(o.focusId);if(c.length>0)return c.every(d)?c.map(y=>U(a.schema,y)).join(" and "):null;let v=a.graph.getNode(o.focusId);return v&&d(v.kind)?K(a.schema.tryDefinition(v.kind),v):null}function We(e,t){let a=d=>d.id!==void 0&&(d.id===t.principal.id||d.onBehalfOf?.id===t.principal.id),n=e.filter(d=>!Z(d)&&Y(d.author)!=="system"&&!a(d.author)),l=n[0];if(!l)return null;let o=X(l.author,{graph:t.store.graph,schema:t.store.schema,...t.seats?{seats:t.seats}:{},...t.people?{people:t.people}:{}}),i=[...new Set(n.map(d=>d.intent))].join("; ");return`${o}: ${i}`}function Oe(e,t,a){let n=We(e,t);n&&(a(""),setTimeout(()=>a(n),50))}function Be({scene:e,compact:t}){let{who:a,principal:n,store:l,views:o,hiddenKinds:i,follow:d}=C(),m=oe("here"),c=$e(a,n),v=c.length===0?"":He(c),[y,f]=(0,H.useState)("");if((0,H.useEffect)(()=>f(v),[v]),c.length===0)return null;let x=c.filter(k=>k.name),b=x.slice(0,t?2:3),u=c.length-b.length,S=c.length-x.length,g=o.places();return(0,w.jsxs)("div",{className:"graview-here","data-testid":"here",children:[(0,w.jsx)("style",{children:Ie}),(0,w.jsx)("span",{role:"status","aria-live":"polite",style:Re,children:y}),(0,w.jsxs)("button",{type:"button","data-testid":"here-open",...m.trigger,onClick:m.toggle,"aria-label":`${v} \u2014 who and where`,title:v,children:[b.length>0?(0,w.jsx)("span",{style:{display:"flex"},children:b.map(k=>(0,w.jsx)($,{one:k},k.participant))}):(0,w.jsx)($,{count:u}),b.length>0&&u>0?(0,w.jsxs)("span",{"aria-hidden":"true",children:["+",u]}):null]}),(0,w.jsxs)("ul",{...m.pane,"aria-label":"Who is here","data-testid":"here-list",hidden:!m.open,className:"graview-bar-list",style:ae,children:[x.map(k=>{let A=ze(k.stop,{store:l,principal:n,hidden:i,pictures:g}),h=be(k);return(0,w.jsx)("li",{children:(0,w.jsxs)(e?"button":"span",{className:"graview-bar-item","data-testid":"here-one",...e?{type:"button",title:`Go where ${h} is`,onClick:()=>{m.setOpen(!1),d(k.participant)}}:{style:{cursor:"default"}},children:[(0,w.jsx)($,{one:k}),(0,w.jsxs)("span",{children:[h,A?(0,w.jsxs)("small",{children:["On ",A]}):null]})]})},k.participant)}),S>0?(0,w.jsx)("li",{children:(0,w.jsxs)("span",{className:"graview-bar-item","data-testid":"here-viewers",style:{cursor:"default"},children:[(0,w.jsx)($,{count:S}),(0,w.jsxs)("span",{children:[ve(S),(0,w.jsx)("small",{children:"Not signed in"})]})]})}):null]})]})}function $({one:e,count:t}){return(0,w.jsx)("span",{className:"graview-here-mark","aria-hidden":"true",...e?{style:{"--graview-hue":Math.round(e.hue)}}:{"data-counted":""},...e?.kind==="agent"?{"data-agent":""}:{},children:e?(e.name??"").trim().charAt(0).toUpperCase():t})}var P=M(D(),1);function we(e){let t=e.line?` \u2014 ${e.line.text}`:"";return t&&e.message.endsWith(t)?e.message.slice(0,-t.length):e.message}var r=M(N(),1),De=[{tab:"for-you",label:"For you"},{tab:"activity",label:"Activity"},{tab:"asks",label:"Your asks"}],_e=`
10
+ .graview-inbox-tabs{display:flex;gap:4px;padding:6px 8px 0;border-bottom:1px solid var(--graview-edge);position:sticky;top:0;background:var(--graview-float)}
11
+ .graview-inbox-tabs button{display:inline-flex;align-items:center;gap:6px;min-height:34px;margin:0 0 -1px;padding:0 8px;border:0;border-bottom:2px solid transparent;border-radius:0;background:none;box-shadow:none;font:inherit;font-size:.8125rem;font-weight:500;white-space:nowrap;color:var(--graview-ink-muted);cursor:pointer}
12
+ .graview-inbox-tabs button[aria-selected=true]{color:var(--graview-ink);font-weight:600;border-bottom-color:var(--graview-accent)}
13
+ .graview-inbox-tab-count{font-size:.6875rem;font-weight:600;font-variant-numeric:tabular-nums;color:var(--graview-ink-faint)}
14
+ .graview-inbox-row{display:grid;gap:2px;width:100%;box-sizing:border-box;padding:7px 8px;border:0;border-radius:7px;background:none;box-shadow:none;font:inherit;font-size:.8125rem;line-height:1.4;text-align:left;text-decoration:none;color:var(--graview-ink)}
15
+ :is(a,button).graview-inbox-row{cursor:pointer}
16
+ :is(a,button).graview-inbox-row:hover{background:color-mix(in srgb,var(--graview-ink) 7%,transparent)}
17
+ .graview-inbox-part{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;min-width:0}
18
+ .graview-inbox-part+.graview-inbox-part{margin-top:10px}
19
+ .graview-inbox-part>h3{margin:0;font-size:.75rem;font-weight:600;color:var(--graview-ink-muted)}
20
+ .graview-inbox-problem{display:grid;grid-template-columns:minmax(0,1fr);gap:4px;font-size:.8125rem;line-height:1.45;overflow-wrap:anywhere}
21
+ .graview-inbox-problem-words{all:unset;box-sizing:border-box;min-height:24px;cursor:pointer;color:var(--graview-ink);overflow-wrap:anywhere}
22
+ .graview-inbox-problem-words:hover{text-decoration:underline;text-underline-offset:2px}
23
+ .graview-inbox-problem-words:focus-visible{outline:2px solid var(--graview-accent);outline-offset:2px;border-radius:4px}
24
+ .graview-inbox-fixes{display:flex;flex-wrap:wrap;gap:4px}
25
+ .graview-inbox-fixes button{min-height:24px;padding:1px 10px;font-size:.75rem}
26
+ .graview-inbox-unread{flex:none;width:7px;height:7px;border-radius:50%;background:var(--graview-accent);transform:translateY(-1px)}`,Ve=e=>e>99?"99+":String(e);function Ge({tab:e,choose:t,asksOn:a,counts:n,notifications:l,rules:o,asks:i,tray:d,waiting:m,activityHas:c,calls:v,seat:y,remembers:f,close:x}){let b=(0,P.useRef)(null),u=(0,P.useId)(),S=De.filter(h=>h.tab!=="asks"||a),g=h=>requestAnimationFrame(()=>b.current?.querySelector(`[data-inbox-tab="${h}"]`)?.focus());(0,P.useEffect)(()=>{let h=b.current?.parentElement;h&&document.activeElement===h&&b.current?.querySelector('[aria-selected="true"]')?.focus()},[]);let k=h=>{let E=S.findIndex(Ee=>Ee.tab===e),L=h.key==="ArrowRight"?E+1:h.key==="ArrowLeft"?E-1:h.key==="Home"?0:h.key==="End"?S.length-1:null;if(L===null)return;h.preventDefault();let j=S[(L+S.length)%S.length].tab;t(j),g(j)},A=()=>{t("activity"),g("activity")};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("style",{children:_e}),(0,r.jsx)("h2",{style:{...V,margin:0},children:"Inbox"}),(0,r.jsx)("div",{ref:b,role:"tablist","aria-label":"Inbox",className:"graview-inbox-tabs",onKeyDown:k,children:S.map(h=>{let E=h.tab===e,L=n[h.tab];return(0,r.jsxs)("button",{type:"button",role:"tab",id:`${u}-${h.tab}`,"data-testid":`inbox-tab-${h.tab}`,"data-inbox-tab":h.tab,"aria-selected":E,"aria-controls":`${u}-${h.tab}-panel`,tabIndex:E?0:-1,onClick:()=>t(h.tab),children:[h.label,L>0?(0,r.jsx)("span",{className:"graview-inbox-tab-count",children:Ve(L)}):null]},h.tab)})}),(0,r.jsx)("div",{role:"tabpanel",id:`${u}-${e}-panel`,"aria-labelledby":`${u}-${e}`,"data-testid":`inbox-panel-${e}`,style:{display:"flex",flexDirection:"column",gap:9,padding:12,minWidth:0},children:e==="for-you"?(0,r.jsx)(Fe,{notifications:l,rules:o,tray:d,waiting:m,close:x,done:A}):e==="activity"?(0,r.jsxs)("div",{"data-testid":"activity","aria-label":"Activity",style:{display:"flex",flexDirection:"column",gap:9,minWidth:0},children:[(0,r.jsx)(he,{calls:v,remembers:f,close:x,headed:!1,...y!==void 0?{seat:y}:{}}),c?null:(0,r.jsx)(Pe,{children:"Nothing has happened here yet."})]}):(0,r.jsx)(je,{asks:i})})]})}function Fe({notifications:e,rules:t,tray:a,waiting:n,close:l,done:o}){let i=e.filter(c=>c.needs),d=e.filter(c=>!c.needs),m=n===0&&t.yours.length===0&&i.length===0;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("section",{className:"graview-inbox-part","data-testid":"inbox-needs-you","aria-labelledby":"graview-inbox-needs-you",children:[(0,r.jsx)("h3",{id:"graview-inbox-needs-you",children:"Needs you"}),a?(0,r.jsx)(P.Suspense,{fallback:null,children:(0,r.jsx)(ue,{close:l,done:o})}):null,t.yours.length>0?(0,r.jsx)(xe,{violations:t.yours,close:l}):null,(0,r.jsx)(Me,{notifications:i,close:l,label:"From the host, needing you"}),m?(0,r.jsx)("p",{"data-testid":"inbox-needs-you-empty",style:ke,children:"Nothing needs you right now."}):null]}),(0,r.jsxs)("section",{className:"graview-inbox-part","data-testid":"inbox-updates","aria-labelledby":"graview-inbox-updates",children:[(0,r.jsx)("h3",{id:"graview-inbox-updates",children:"Updates"}),(0,r.jsx)(Me,{notifications:d,close:l,label:"From the host"}),t.others.length>0?(0,r.jsx)(xe,{violations:t.others,close:l,told:!0}):null,a?(0,r.jsx)(P.Suspense,{fallback:null,children:(0,r.jsx)(ge,{alone:d.length===0&&t.others.length===0,close:l,done:o})}):null,d.length===0&&t.others.length===0&&!a?(0,r.jsx)("p",{"data-testid":"inbox-updates-empty",style:ke,children:"No updates."}):null]})]})}function xe({violations:e,close:t,told:a=!1}){let{store:n,principal:l,setMenuAt:o}=C(),{set:i}=re(),[d,m]=(0,P.useState)(null),c=f=>{try{return n.permits({name:f.mutation,args:f.args??{}},l).ok}catch{return!1}},v=(f,x)=>{let b=x.closest('[data-testid="inbox"]').getBoundingClientRect();i(f.nodeIds),t(),o({x:b.left,y:b.top,on:f.subjectId})},y=(f,x,b)=>{if(m(null),x.missing!==void 0&&x.missing.length>0)return v(f,b);try{n.apply({name:x.mutation,args:x.args??{}},{author:l}),requestAnimationFrame(()=>{let u=document.querySelector('[data-testid="inbox"]');(u?.querySelector('[data-testid="inbox-problem-fix"]')??u?.querySelector('[aria-selected="true"]'))?.focus()})}catch(u){m(ce(n.schema,n.allMutations(),u))}};return(0,r.jsxs)("ol",{"data-testid":"problems","aria-label":"Rules broken",style:{margin:0,padding:0,listStyle:"none",display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:10,minWidth:0},children:[e.map((f,x)=>{let b=a?[]:f.repairs.filter(c).slice(0,3);return(0,r.jsxs)("li",{className:"graview-inbox-problem","data-testid":"inbox-problem",children:[(0,r.jsx)("button",{type:"button",className:"graview-inbox-problem-words","data-testid":"inbox-problem-words",onClick:u=>v(f,u.currentTarget),children:we(f)}),b.length>0?(0,r.jsx)("span",{className:"graview-inbox-fixes",children:b.map(u=>(0,r.jsx)("button",{type:"button","data-testid":"inbox-problem-fix",onClick:S=>y(f,u,S.currentTarget),children:u.label},u.label))}):null]},`${f.invariant}:${x}`)}),d?(0,r.jsx)("li",{"data-testid":"inbox-problem-refused",role:"alert",style:{fontSize:"0.75rem",color:"var(--graview-warn)",overflowWrap:"anywhere"},children:d}):null]})}var ke={margin:0,fontSize:"0.8125rem",color:"var(--graview-ink-muted)"};function Pe({children:e}){return(0,r.jsx)("p",{"data-testid":"inbox-empty",style:{margin:0,fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:e})}function Se(e){if(!e)return"";let t=new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function Me({notifications:e,close:t,label:a}){return e.length===0?null:(0,r.jsx)("ol",{"data-testid":"inbox-notifications","aria-label":a,style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:2,minWidth:0},children:e.map(n=>{let l=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("span",{style:{display:"flex",alignItems:"baseline",gap:6,minWidth:0},children:[n.read?null:(0,r.jsx)("span",{className:"graview-inbox-unread","aria-hidden":"true"}),(0,r.jsx)("span",{style:{fontWeight:n.read?400:600,overflowWrap:"anywhere"},children:n.title}),n.read?null:(0,r.jsx)("span",{style:V,children:", unread"})]}),n.body?(0,r.jsx)("span",{style:{color:"var(--graview-ink-muted)",overflowWrap:"anywhere"},children:n.body}):null,Se(n.at)?(0,r.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:Se(n.at)}):null]}),o=n.href!==void 0?"a":n.onSelect?"button":"div";return(0,r.jsx)("li",{children:(0,r.jsx)(o,{className:"graview-inbox-row","data-testid":"inbox-notification",...n.read?{}:{"data-unread":""},...n.href!==void 0?{href:n.href,...n.target?{target:n.target,rel:"noopener"}:{}}:n.onSelect?{type:"button"}:{},...n.href!==void 0||n.onSelect?{onClick:()=>{n.onSelect?.(),t()}}:{},children:l})},n.id)})})}function je({asks:e}){return e.length===0?(0,r.jsx)(Pe,{children:"What you ask the app is kept here, with what came of it."}):(0,r.jsx)("ol",{"data-testid":"inbox-asks",style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6,fontSize:"0.8125rem",minWidth:0},children:e.slice(0,20).map(t=>(0,r.jsx)(P.Suspense,{fallback:null,children:(0,r.jsx)(me,{entry:t,undo:a=>(0,r.jsx)(ye,{batch:a})})},t.id))})}var p=M(N(),1),qe=`
27
+ .graview-app-menu{width:min(280px,calc(100vw - 24px))}
28
+ .graview-app-menu-group{display:grid;margin:0;padding:0 0 4px;list-style:none}
29
+ .graview-app-menu-group+.graview-app-menu-group{padding-top:4px;border-top:1px solid var(--graview-edge)}
30
+ .graview-app-menu-choice{display:flex;gap:2px;margin:4px 8px 6px;padding:2px;border:1px solid var(--graview-edge);border-radius:8px}
31
+ .graview-app-menu-choice button{flex:1 1 0;min-height:28px;margin:0;padding:0 8px;border:0;border-radius:6px;background:none;box-shadow:none;font:inherit;font-size:.8125rem;color:var(--graview-ink-muted);cursor:pointer}
32
+ .graview-app-menu-choice button[aria-pressed=true]{background:color-mix(in srgb,var(--graview-accent) 16%,transparent);color:var(--graview-ink);font-weight:600}`,Ke={system:"System",light:"Light",dark:"Dark"};function Ue({faces:e,rows:t,scheme:a,close:n}){let l=a?.offers??["system","light","dark"];return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("style",{children:qe}),e?(0,p.jsx)("div",{role:"group","aria-label":`${e.scene.label} or ${e.pages.label}`,"data-testid":"app-faces",className:"graview-app-menu-group",children:["scene","pages"].map(o=>{let i=e[o];return(0,p.jsxs)("button",{type:"button",className:"graview-bar-item","data-testid":`app-face-${o}`,"aria-pressed":i.current,...i.reach&&!i.current?{onPointerEnter:i.reach,onPointerDown:i.reach,onFocus:i.reach}:{},onClick:()=>{n(),i.current||i.go()},children:[(0,p.jsx)("span",{className:"graview-bar-mark",children:o==="scene"?(0,p.jsx)(Ze,{}):(0,p.jsx)(Je,{})}),(0,p.jsx)("span",{style:{flex:"1 1 auto"},children:i.label}),i.current?(0,p.jsx)("span",{className:"graview-bar-mark","aria-hidden":"true",children:(0,p.jsx)(Qe,{})}):null]},o)})}):null,t.length>0?(0,p.jsx)("ul",{"aria-label":"From the host","data-testid":"app-menu-rows",className:"graview-app-menu-group",children:t.map(o=>(0,p.jsx)("li",{children:(0,p.jsx)(Ye,{row:o,close:n})},o.label))}):null,a?(0,p.jsxs)("div",{role:"group","aria-labelledby":"graview-app-menu-scheme","data-testid":"app-menu-scheme",className:"graview-app-menu-group",children:[(0,p.jsx)("p",{id:"graview-app-menu-scheme",children:"Appearance"}),(0,p.jsx)("div",{className:"graview-app-menu-choice",children:l.map(o=>(0,p.jsx)("button",{type:"button","data-testid":`app-menu-scheme-${o}`,"aria-pressed":a.value===o,onClick:()=>a.onChoose(o),children:Ke[o]},o))})]}):null]})}function Ye({row:e,close:t}){let a=e.href!==void 0?"a":"button";return(0,p.jsxs)(a,{className:"graview-bar-item","data-testid":"app-menu-row",...e.href!==void 0?{href:e.href,...e.target?{target:e.target,rel:"noopener"}:{}}:{type:"button"},onClick:n=>{t(),e.onSelect?.()},children:[(0,p.jsx)("span",{className:"graview-bar-mark",children:e.icon?(0,p.jsx)(Xe,{icon:e.icon}):null}),(0,p.jsx)("span",{children:e.label})]})}function Xe({icon:e}){let t=ie(J(e)?e:void 0);return t?(0,p.jsx)("span",{className:"graview-bar-host-mark","aria-hidden":"true",dangerouslySetInnerHTML:t}):(0,p.jsx)("span",{className:"graview-bar-host-mark","aria-hidden":"true",children:e})}function F({children:e}){return(0,p.jsx)("svg",{width:14,height:14,viewBox:"0 0 14 14","aria-hidden":"true",focusable:"false",style:{flex:"0 0 auto"},children:e})}function Ze(){return(0,p.jsxs)(F,{children:[(0,p.jsx)("path",{d:"M7 1.5 L12.5 4.5 L7 7.5 L1.5 4.5 Z",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"}),(0,p.jsx)("path",{d:"M1.5 7.5 L7 10.5 L12.5 7.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round",strokeLinecap:"round"})]})}function Je(){return(0,p.jsxs)(F,{children:[(0,p.jsx)("rect",{x:"2.25",y:"1.75",width:"9.5",height:"10.5",rx:"1.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3"}),(0,p.jsx)("path",{d:"M4.5 5 H9.5 M4.5 7.25 H9.5 M4.5 9.5 H7.5",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function Qe(){return(0,p.jsx)(F,{children:(0,p.jsx)("path",{d:"M3 7.25 L5.75 10 L11 4.25",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function et(e){let t=/^(?:place|scene):([^:]+):(.+)$/.exec(e.key);return t?{place:t[2],about:[`aggregate:${t[1]}`],title:e.label}:{about:e.group==="lists"&&e.kind?[`aggregate:${e.kind}`]:[],title:e.label}}function z(e,t,a,n,l,o){let i=et(t),d=e.getBoundingClientRect(),m={...i,face:a?"scene":"pages",x:Math.round(l??d.left+Math.min(16,d.width/2)),y:Math.round(o??Math.min(d.bottom,d.top+36)),returnTo:e},c=a?null:e.closest("[data-graview-embed], [data-graview-shell]")?.querySelector("[data-graview-face='pages']")??document.querySelector("[data-graview-face='pages']");c?c.dispatchEvent(new CustomEvent(ne,{detail:m})):n(m)}var W={on:null,at:0},Ne=500,tt=10;function nt(e,t,a,n,l,o,i){let d=t.getAttribute("data-testid")??"",m=d==="app-places-open"?n:d.slice(10),c=a.find(u=>u.key===m);if(!c)return;if(e.type==="keydown")return W={on:t,at:Date.now()},z(t,c,l,o);let{clientX:v,clientY:y}=e;if(e.type==="contextmenu")return W.on===t&&Date.now()-W.at<700?void 0:v===0&&y===0?z(t,c,l,o):z(t,c,l,o,v,y);let f=Date.now()-Math.max(0,performance.now()-e.timeStamp),x=!1,b=u=>{Math.hypot(u.clientX-v,u.clientY-y)>tt&&(x=!0)};document.addEventListener("pointermove",b),setTimeout(()=>{document.removeEventListener("pointermove",b),!(x||i.at!==0&&i.at-f<Ne)&&(W={on:t,at:Date.now()},t.addEventListener("click",u=>{u.preventDefault(),u.stopPropagation()},{capture:!0,once:!0}),z(t,c,l,o,v,y))},Math.max(0,Ne-(Date.now()-f)))}var s=M(N(),1),$t=_(B(()=>(__graviewPreload(import.meta.url,["./chunk.RJ7VSWTA.js","./chunk.P43LPXXJ.js","./chunk.JCKIJSW7.js","./chunk.SDO3U72B.js","./chunk.6L6RUOSF.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.CGRX6SDE.js")))).part((e,t)=>(0,s.jsx)(e.TidyGroups,{...t}),{quiet:!0}),rt=_(B(()=>(__graviewPreload(import.meta.url,["./chunk.JCKIJSW7.js","./chunk.SDO3U72B.js","./chunk.6L6RUOSF.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.BWMPC7LK.js")))).part((e,t)=>(0,s.jsx)(e.HoverChipsSwitch,{...t}),{quiet:!0});function Ht({violations:e,pick:t}){let{store:a,brand:n,setMenuAt:l}=C(),o=le(a,e);return(0,s.jsx)(s.Fragment,{children:o.map((i,d)=>{let m=pe(i),c=i.repairs.length>0?`${i.repairs.length} ${i.repairs.length===1?"way":"ways"} to fix`:"";return(0,s.jsx)("li",{style:{borderTop:d===0?"none":"1px solid var(--graview-edge)"},children:(0,s.jsxs)("button",{type:"button",onClick:v=>{let y=v.currentTarget.closest("ol").getBoundingClientRect();t(i),l({x:y.left,y:y.top,on:i.subjectId})},...G(i)!==void 0?{title:G(i)}:{},style:{width:"100%",textAlign:"left",fontSize:"0.8125rem",lineHeight:1.4,padding:"7px 8px",border:"1px solid transparent",background:"none",boxShadow:"none",borderRadius:7},children:[i.line?(0,s.jsx)(de,{line:i.line,schema:a.schema,...n?{brand:n}:{},stacked:!0,style:{display:"block",color:"var(--graview-ink)"}}):(0,s.jsx)("span",{style:{display:"block",color:"var(--graview-ink)"},children:i.message}),m||c?(0,s.jsx)("span",{style:{color:"var(--graview-ink-faint)",fontSize:"0.75rem"},children:[m,c].filter(Boolean).join(" \xB7 ")}):null]})},`${i.invariant}:${d}`)})})}function zt({name:e,me:t,profileHref:a,hostActions:n,close:l,part:o,signature:i=!1}){let{principal:d,seats:m,settings:c,settingValues:v,chooseSetting:y,sharing:f,ai:x,signIn:b}=C(),u=d.roles??[],S={setOpen:g=>l()};return(0,s.jsx)(s.Fragment,{children:o==="top"?(0,s.jsxs)(s.Fragment,{children:[b?(0,s.jsxs)("div",{style:{display:"grid",gap:6},children:[(0,s.jsx)("strong",{"data-testid":"profile-signed-out",style:{fontSize:"1rem",fontWeight:550},children:"Not signed in"}),(0,s.jsx)("button",{type:"button","data-testid":"profile-sign-in",onClick:()=>{S.setOpen(!1),b.run()},style:se,children:b.label}),f?(0,s.jsx)("span",{"data-testid":"profile-seen-as",style:{fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:"Others here see you as a visitor"}):null]}):(0,s.jsxs)("div",{style:{display:"grid",gap:3},children:[(0,s.jsx)("span",{style:O,children:"Signed in as"}),(0,s.jsx)("strong",{style:{fontSize:"1rem",fontWeight:550},children:e}),(0,s.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:u.length>0?u.map(g=>q(g)).join(", "):t===void 0?"This app has no sign-in; everything here is yours.":"No role in particular"}),t!==void 0&&a!==void 0?(0,s.jsx)("a",{href:a(t.id),"data-testid":"profile-record",style:{display:"inline-flex",alignItems:"center",minHeight:24,justifySelf:"start",fontSize:"0.875rem",color:"var(--graview-accent)"},children:"Your record \u2197"}):null,f?(0,s.jsxs)("span",{"data-testid":"profile-seen-as",style:{fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:["Seen by others as ",f.name]}):null]}),n.length>0?(0,s.jsx)("ul",{role:"list","aria-label":"From the host","data-testid":"host-actions",style:{...R,margin:0,paddingLeft:0,listStyle:"none",display:"grid",gap:2},children:n.map(g=>(0,s.jsx)("li",{children:g.href!==void 0?(0,s.jsx)("a",{href:g.href,"data-testid":"host-action",className:"graview-host-action",...g.target?{target:g.target,rel:"noopener"}:{},onClick:()=>{g.onSelect?.(),S.setOpen(!1)},style:Ce,children:g.label}):(0,s.jsx)("button",{type:"button","data-testid":"host-action",className:"graview-host-action",onClick:()=>{S.setOpen(!1),g.onSelect?.()},style:{...Ce,width:"100%",textAlign:"left",border:"none",background:"none",boxShadow:"none",font:"inherit",cursor:"pointer"},children:g.label})},g.label))}):null]}):(0,s.jsxs)(s.Fragment,{children:[m.length>1?(0,s.jsxs)("div",{style:{display:"grid",gap:6,...R},children:[(0,s.jsx)("span",{style:O,children:"Sit as somebody else"}),(0,s.jsx)(fe,{})]}):null,c.length>0?(0,s.jsx)("div",{style:{display:"grid",gap:10,...R},children:c.map(g=>(0,s.jsxs)("fieldset",{"data-testid":`setting-${g.name}`,style:{border:0,margin:0,padding:0,display:"grid",gap:5},children:[(0,s.jsx)("legend",{style:{...O,padding:0},children:g.title}),g.description?(0,s.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:g.description}):null,(0,s.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:g.options.map(k=>{let A=(v[g.name]??g.initial)===k.value;return(0,s.jsx)("button",{type:"button","aria-pressed":A,"data-testid":`setting-${g.name}-${k.value}`,onClick:()=>y(g.name,k.value),style:T(A),children:k.label},k.value)})})]},g.name))}):null,te(x)?(0,s.jsx)(Ae.Suspense,{fallback:null,children:(0,s.jsx)(rt,{legend:O,style:R,choice:T})}):null,i?(0,s.jsxs)("p",{"data-testid":"graview-signature",style:{...R,margin:0,display:"flex",alignItems:"center",gap:6,fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:["Built with",(0,s.jsxs)("a",{href:"https://graview.dev",target:"_blank",rel:"noopener",style:{display:"inline-flex",alignItems:"center",gap:4,minHeight:24,color:"var(--graview-ink-muted)",fontWeight:600,textDecoration:"none"},children:[(0,s.jsx)("span",{"data-testid":"graview-mark",style:{display:"inline-flex",lineHeight:0},dangerouslySetInnerHTML:{__html:at}}),"Graview"]})]}):null]})})}var at='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="14" height="14" aria-hidden="true" focusable="false"><g fill="none" stroke="currentColor" stroke-width="2.4" stroke-linejoin="round"><path d="M13 11 L3 8 L14 3 H29 L21 9"/><path d="M10 18 L3 23 L16.5 28 L29 21 L22 19"/><path d="M16.5 18.5 V23.5" stroke-linecap="round"/></g><circle cx="16.5" cy="13.5" r="2" fill="var(--graview-mark-point, currentColor)"/></svg>',Ce={display:"flex",alignItems:"center",minHeight:28,padding:"2px 8px",borderRadius:7,fontSize:"0.875rem",color:"var(--graview-ink)",textDecoration:"none"},O={fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},R={paddingTop:10,borderTop:"1px solid var(--graview-edge)"};export{Ue as AppMenuPane,Be as Here,Le as Inbox,Ge as InboxPane,Ht as ProblemRows,zt as ProfilePane,$t as TidyFoot,nt as placeGesture,Oe as sayTheirChange};
@@ -1 +1 @@
1
- import{K as $}from"./chunk.NLZHNPDU.js";import{G as L,Ra as U,a as I,b as R,c as E,d as f,e as k,j as W,m as F,v as j}from"./chunk.FWXW4T4I.js";import{oe as s,ve as b,we as r}from"./chunk.DHPXRDT5.js";import{b as H}from"./chunk.AJZBJBMO.js";var u=H(L(),1),_=e=>typeof e=="object"&&e!==null&&"idx"in e;function S(e){let n=r(window.location.pathname,e);return n===null?null:n!==s&&n!=="/"?"pages":n===s||window.location.href.includes("#")?f(window.location.hash).overview?"graview":"scene":_(window.history.state)?"pages":null}function K(e){let n=e.face??(e.stop&&E(e.stop).overview?"graview":"scene");return e.routing!=="address"||typeof window>"u"?n:S(e.basePath)??n}function Q(e){return e.routing!=="address"||typeof window>"u"?!1:r(window.location.pathname,e.basePath)==="/"&&S(e.basePath)===null}function X(e){if(typeof window>"u")return;let n=r(window.location.pathname,e);return n===s||n==="/"&&window.location.href.includes("#")?R(f(window.location.hash)):void 0}function Z({basePath:e,pagesWere:n,shown:t,onFace:i,toggle:l,kinds:N,places:w,opens:B,landed:V}){let{view:O,go:p}=U(),g=(0,u.useRef)({shown:t,view:O,onFace:i,landed:V});g.current={shown:t,view:O,onFace:i,landed:V};let m=(0,u.useRef)(n??"/"),P=()=>{m.current=`${r(window.location.pathname,e)??"/"}${window.location.search}`};return l.current=(o,c,a)=>{let{shown:d,view:h,onFace:A}=g.current;if(o==="pages"&&d!=="pages")window.history.pushState(null,"",b(c??m.current,{basePath:e}));else if(o!=="pages"&&d==="pages"){P();let y=a===void 0?h:M(E(a),w),v=q(y)?z(B):y,T=v!==y&&v.overview?"graview":o,x=Y(T,v,N);p(x),window.history.pushState(null,"",`${b(s,{basePath:e})}${k(x)}`),A?.(T);return}A?.(o)},(0,u.useEffect)(()=>{let o=()=>{if(r(window.location.pathname,e)===null)return;let c=S(e)??"pages",{shown:a,onFace:d,landed:h}=g.current;if(c==="pages"){P(),h?.(m.current),a!=="pages"&&d?.("pages");return}a==="pages"&&(p(M(f(window.location.hash),w)),d?.(c))};return window.addEventListener("popstate",o),()=>window.removeEventListener("popstate",o)},[e,p,w]),null}function M(e,n){let t=e.within?.view,i=t!==void 0&&!e.focusId?n.find(l=>l.as===t):void 0;return i?{...e,focusId:j(i.kind)}:e}function Y(e,n,t){return e==="graview"?F(n,!0):n.overview?W(F(n,!1),$(n,t)):n}function q(e){return e.focusId===null&&e.overview!==!0}function z(e){return e??{...I,overview:!0}}export{K as a,Q as b,X as c,Z as d,M as e,Y as f,q as g,z as h};
1
+ import{L as $}from"./chunk.RJ7VSWTA.js";import{G as L,Ua as U,a as I,b as R,c as E,d as f,e as k,j as W,m as F,v as j}from"./chunk.JCKIJSW7.js";import{Be as b,Ce as r,ue as s}from"./chunk.6L6RUOSF.js";import{b as H}from"./chunk.AJZBJBMO.js";var u=H(L(),1),_=e=>typeof e=="object"&&e!==null&&"idx"in e;function S(e){let n=r(window.location.pathname,e);return n===null?null:n!==s&&n!=="/"?"pages":n===s||window.location.href.includes("#")?f(window.location.hash).overview?"graview":"scene":_(window.history.state)?"pages":null}function K(e){let n=e.face??(e.stop&&E(e.stop).overview?"graview":"scene");return e.routing!=="address"||typeof window>"u"?n:S(e.basePath)??n}function Q(e){return e.routing!=="address"||typeof window>"u"?!1:r(window.location.pathname,e.basePath)==="/"&&S(e.basePath)===null}function X(e){if(typeof window>"u")return;let n=r(window.location.pathname,e);return n===s||n==="/"&&window.location.href.includes("#")?R(f(window.location.hash)):void 0}function Z({basePath:e,pagesWere:n,shown:t,onFace:i,toggle:l,kinds:N,places:w,opens:B,landed:V}){let{view:O,go:p}=U(),g=(0,u.useRef)({shown:t,view:O,onFace:i,landed:V});g.current={shown:t,view:O,onFace:i,landed:V};let m=(0,u.useRef)(n??"/"),P=()=>{m.current=`${r(window.location.pathname,e)??"/"}${window.location.search}`};return l.current=(o,c,a)=>{let{shown:d,view:h,onFace:A}=g.current;if(o==="pages"&&d!=="pages")window.history.pushState(null,"",b(c??m.current,{basePath:e}));else if(o!=="pages"&&d==="pages"){P();let y=a===void 0?h:M(E(a),w),v=q(y)?z(B):y,T=v!==y&&v.overview?"graview":o,x=Y(T,v,N);p(x),window.history.pushState(null,"",`${b(s,{basePath:e})}${k(x)}`),A?.(T);return}A?.(o)},(0,u.useEffect)(()=>{let o=()=>{if(r(window.location.pathname,e)===null)return;let c=S(e)??"pages",{shown:a,onFace:d,landed:h}=g.current;if(c==="pages"){P(),h?.(m.current),a!=="pages"&&d?.("pages");return}a==="pages"&&(p(M(f(window.location.hash),w)),d?.(c))};return window.addEventListener("popstate",o),()=>window.removeEventListener("popstate",o)},[e,p,w]),null}function M(e,n){let t=e.within?.view,i=t!==void 0&&!e.focusId?n.find(l=>l.as===t):void 0;return i?{...e,focusId:j(i.kind)}:e}function Y(e,n,t){return e==="graview"?F(n,!0):n.overview?W(F(n,!1),$(n,t)):n}function q(e){return e.focusId===null&&e.overview!==!0}function z(e){return e??{...I,overview:!0}}export{K as a,Q as b,X as c,Z as d,M as e,Y as f,q as g,z as h};
@@ -0,0 +1 @@
1
+ import{Ab as k,Ed as _,Gc as I,Jc as ue,Kc as le,Mb as de,Mc as ge,Nb as P,Nc as pe,Ob as D,Oc as V,Pc as L,Qc as U,Qd as O,Rb as h,Ub as ce,fb as N,ga as ee,gb as ie,ha as F,lb as se,mb as oe,nb as re,ob as ae,pa as ne,ta as te,tc as K,zb as T}from"./chunk.6L6RUOSF.js";import{j as m}from"./chunk.FQLNBIQ5.js";var ye=e=>N(e).id??e.session;function z(e,i={}){let o=I(e),n=new Map,t=i.advisory===!0;for(let s of e){if(s.vote===void 0||s.withheld||o.has(s.id)||s.vote.advisory===!0!==t)continue;let a=t?s.vote.voter:ye(s.author);if(a===void 0)continue;let d=n.get(s.vote.suggestion);d||n.set(s.vote.suggestion,d=new Map),s.vote.vote===null?d.delete(a):d.set(a,s.vote.vote)}return n}function fe(e){let i=0,o=0;for(let n of e?.values()??[])n==="for"?i++:o++;return{for:i,against:o}}function $e(e,i,o){let n=V(i)?L(i):void 0,t=i&&(n===void 0?ye(i):void 0),s=n!==void 0?o?.get(n):t!==void 0?e?.get(t):void 0,a=fe(o);return{...fe(e),...s!==void 0?{mine:s}:{},...a.for+a.against>0?{advisory:a}:{}}}var q=(e,i)=>e.expiresAt!==void 0&&Date.parse(e.expiresAt)<=Date.parse(i),Ce=(e,i,o)=>(e??[]).some(n=>n.suggestion===i&&(n.until===void 0||Date.parse(n.until)>Date.parse(o)));function me(e,i=()=>!0,o={}){let n=I(e),t=Ne(e),s=o.now??new Date().toISOString(),a,d;return e.filter(c=>c.suggests&&!c.withheld&&!n.has(c.id)&&t.get(c.id)!=="all"&&!q(c,s)&&!Ce(o.dismissed,c.id,s)).flatMap(({id:c,batch:r,suggests:u,suggestsSaid:g,intent:l,batchIntent:w,author:S,lineage:f,at:y,expiresAt:je})=>{let Z=t.get(c),C=Ee(u,g,l).filter(v=>!Z?.has(v.at));if(C.length===0)return[];let Q=C.map(v=>v.call),X=new Set;return JSON.stringify(Q.map(v=>v.args),(v,E)=>(typeof E=="string"&&i(E)&&X.add(E),E)),[{id:c,batch:r,calls:Q,intent:Z?C.map(v=>v.intent).join("; "):l,...w!==void 0?{headline:w}:{},items:C,author:S,...f?{lineage:f}:{},at:y,expiresAt:je,about:[...X],tally:$e((a??=z(e)).get(c),o.voter,(d??=z(e,{advisory:!0})).get(c))}]})}function Ee(e,i,o){let n=i&&i.length===e.length?i:void 0;return e.map((t,s)=>({at:s,call:t,intent:n?.[s]??(e.length===1?o:t.name)}))}function Ne(e){let i=new Map;for(let n of e){let t=n.lineage?.suggestion;if(t===void 0)continue;let s=n.lineage.items,a=i.get(t);if(a!=="all")if(s===void 0)i.set(t,"all");else{let d=a??new Set;for(let c of s)d.add(c);i.set(t,d)}}let o=new Map(e.filter(n=>n.suggests&&i.has(n.id)).map(n=>[n.id,n.suggests.length]));for(let[n,t]of i)t!=="all"&&o.has(n)&&t.size>=o.get(n)&&i.set(n,"all");return i}var B=e=>JSON.stringify(e,(i,o)=>o&&typeof o=="object"&&!Array.isArray(o)?Object.fromEntries(Object.entries(o).sort()):o);var Te=/^(archive|unarchive|remove|leave-alone|allow-tidying)$/;function Ve(e,i){let o=O(e.name),n=i?.act(e.name),t=e.args??{},s=n?n.derived:K(o),{id:a}=t;if(s&&typeof a=="string"){if(Te.test(s.act))return[s.act,a];if(s.act==="merge")return["merge",...[a,t.into].sort()];if(s.relation)return[s.act,s.relation,a,t.to]}let d=n?.subject?.arg??"id",[c,r]=Object.keys(t).filter(u=>u!==d);return n?.connects?.length===1&&c&&!r&&i.has(t[d])&&i.has(t[c])?["connect",n.connects[0],t[d],t[c]]:[o,n?.creates?.length&&typeof a=="string"&&!i.has(a)?{...t,id:0}:t]}var x=(e,i)=>`\u2248${B(e.map(o=>Ve(o,i)))}`;function A(e,i){let o=i?.act(e.name),n=o?.derived?.relation??(o?.connects?.length===1?o.connects[0]:void 0);if(n!==void 0)return`${R}${B([o?.derived?.act??"connect",n])}`;let t=O(e.name),s=o?.derived??K(t),a=o?.subject?.arg??"id",d=s?.act==="edit"?Object.keys(e.args??{}).filter(c=>c!==a).sort():void 0;return`${R}${B(d?[t,d]:[t])}`}var R="\u2200",he=e=>`\u2248${B([["connect",e.kind,e.from,e.to]])}`;function Se(e,i,o,n){let t=j(e,o,n);return[i,...i.map(s=>[s])].map(s=>t.get(x(s,o))).find(Boolean)}function W(e,i){return e.lineage?.liftedStop===!0&&e.undoes!==void 0&&e.mutation===null&&e.primitives.length===0&&!i(e.undoes)}function ve(e,i,o,n){if(i.length===0)return;let t=j(e,o,n),s=i.map(a=>t.get(A(a,o)));return s.every(Boolean)?s[0]:void 0}function j(e,i,o){let n=I(e),t=new Map(e.map(r=>[r.id,r])),s=new Map,a=new Set(e.map(r=>r.id)),d=new Set(e.filter(r=>W(r,u=>a.has(u))&&!n.has(r.id)).map(r=>r.undoes));for(let[r,u]of Object.entries(o??{}))!n.has(u.id)&&!d.has(u.id)&&s.set(r,u);let c=new Map;for(let r of e)r.lineage?.suggestion!==void 0&&r.lineage.items&&c.set(r.lineage.suggestion,[...c.get(r.lineage.suggestion)??[],...r.lineage.items]);for(let r of e){let u=!n.has(r.id)&&!r.withheld,g=r.author.kind==="human",l=r.undoes!==void 0&&u?t.get(r.undoes):void 0;if(l?.suggests&&l.author.kind===r.author.kind&&l.author.id===r.author.id)continue;let w=l?.mutation&&l.undoes===void 0&&(l.lineage||r.undoneLineage||g),S=l?.suggests?l.suggests.filter((f,y)=>!c.get(l.id)?.includes(y)):w?[l.mutation]:[];if(S.length>0)for(let f of[S,...S.map(y=>[y])])s.set(x(f,i),r);if(l?.suggests&&u&&D(r,l))for(let f of S)s.set(A(f,i),r);if(!(!u||!g||r.undoes!==void 0))for(let f of r.primitives)f.op==="remove-edge"?s.set(he(f.edge),r):f.op==="add-edge"&&s.delete(he(f.edge))}return s}function Ae(e,i=[],o){let n=new Map(i.map(s=>[s.id,s])),t=s=>{let a=s.stop;if(a)return a;let d=s;if(d.batch===void 0||s.undoes===void 0||!D(d,n.get(s.undoes)))return;let c=new Map((n.get(s.undoes)?.suggests??[]).map(r=>[A(r,o),r]));return{batch:d.batch,words:d.batchIntent??d.intent??"",calls:[...c.values()]}};return Object.fromEntries([...e].map(([s,a])=>{let d=t(a);return[s,{id:a.id,at:a.at,author:a.author,...a.undoes!==void 0&&{undoes:a.undoes},...d&&{stop:d}}]}))}h.declined=Se;h.kept=(e,i,o)=>Ae(j(e,i,o),e,i);h.stopped=ve;h.liftTold=(e,i)=>{let o=i,n=o.timeline?.log;if(!n?.get||!W(e,s=>n.get(s)!==void 0))return!1;if(o.actor!==void 0&&N(e.author).id===o.actor)return!0;let t=Object.values(n.horizonEpoch?.()?.declines??{}).find(s=>s.id===e.undoes)?.stop;return t!==void 0&&!H(t.calls,o)};function H(e,i){return e.some(o=>{let n=o.args??{};if(ce(n,i.sees))return!0;let t=n.id,s=typeof t=="string"?i.kindOf(t):void 0,a=s&&i.kept?.({id:t,kind:s});return a?Object.keys(n).some(d=>d!=="id"&&a(d)):!1})}h.lift=(e,i,o,n)=>{let t=e,s=Pe(t,i);return s&&ze(t,s,o,n)};h.liftRefusal=(e,i,o)=>{let n=e,t=Pe(n,i);if(!t)return;let s=Me(n,t,o);return s?{refusal:s}:{}};h.undoRefusal=(e,i,o)=>{let n=e;for(let t of i){if(W(t,r=>n.log.get(r)!==void 0))return{mutation:"undo",wouldNeed:[],message:`"${t.intent}" cannot be taken back: it may be suggested again now, and can be stopped again then.`};let s=t,a=!1;for(let r=t;r!==void 0;r=r.undoes===void 0?void 0:n.log.get(r.undoes))s=r,a||=D(r,r.undoes===void 0?void 0:n.log.get(r.undoes));if(!a)continue;let d=s.suggests??Object.values(n.log.horizonEpoch()?.declines??{}).find(r=>r.id===t.id||r.id===s.id)?.stop?.calls,c=d?xe(n,d,o):o.kind==="system"?void 0:{mutation:"undo",wouldNeed:[],message:"Only somebody who may make these changes can let them be suggested again."};if(c)return c}};var be=new WeakMap;function J(e,i,o){let n=be.get(e);return n?.length!==e.log.length&&be.set(e,n={length:e.log.length,held:new Map}),n.held.has(i)||n.held.set(i,o()),n.held.get(i)}var ke=e=>JSON.stringify([e.kind,e.id,e.roles,e.onBehalfOf?.id,e.onBehalfOf?.roles,e.shared,ie(e)?.id]),we="\0no-such-record",Le=new Set(["remove","archive","unarchive","merge"]);function _e(e,i,o,n){let t=p(e),s=t.mutations.get(i.name);return s?.subject?se(t.policy,n,i.name,o,t.viaOf(s,i,n),we,{},()=>[we],s.derived?()=>{}:void 0,s.derived!==void 0&&Le.has(s.derived.act)).ok:!0}function Oe(e,i,o){let n=p(e),t=n.actMeanings(),s=ke(o);return i.every(a=>e.permits(a,o).ok?J(e,`decides|${s}|${A(a,t)}`,()=>{let d=n.mutations.get(a.name)??n.mutations.get(O(a.name)),c=d?.subject;if(!c)return!0;let r=c.kinds==="*"?[void 0]:[c.kinds].flat();return r.every(g=>_e(e,a,g,o))?d.writesLinked!==void 0||_(e,o).hides?.()!==!1?r.every(g=>(g===void 0?[]:e.graph.nodesOfKind(g,{archived:"all"})).every(l=>e.permits({...a,args:{...a.args,[c.arg]:l.id}},o).ok)):!0:!1}):!1)}function xe(e,i,o){if(!Oe(e,i,o))return{mutation:"undo",wouldNeed:[],message:"Only somebody who may make these changes can let them be suggested again."}}function Me(e,i,o){let n=_(e,o);return n.hides?.()!==!1&&H(i.stop.calls,n)?{mutation:"undo",wouldNeed:[],message:"Only somebody who may make these changes can let them be suggested again."}:xe(e,i.stop.calls,o)}function Pe(e,i){if(i.length!==1)return;let o=e.stopsServed?.stops.find(s=>s.batch===i[0]);if(o&&!e.log.all().some(s=>s.batch===o.batch))return{id:`served:${o.batch}`,at:"",author:{kind:"system"},stop:{batch:o.batch,words:o.words,calls:[]}};let n=e.log.horizonEpoch()?.declines;if(!n)return;let t=new Set(e.log.all().flatMap(s=>s.undoes!==void 0?[s.undoes]:[]));return Object.values(n).find(s=>s.stop?.batch===i[0]&&!t.has(s.id)&&e.log.get(s.id)===void 0)}function ze(e,i,o,n){let t=p(e),s=Me(e,i,n);s&&t.refuse(s,n.id,!0);let a=e.violations(),d={id:t.nextId(),seq:e.log.length,batch:o.batch??t.mintBatch("undo"),author:n,intent:`Undo: ${i.stop.words}`,...b("batchIntent",o.intent),mutation:null,primitives:[],reads:[],writes:[],at:t.now(),undoes:i.id,...b("via",o.via),lineage:{basis:"A person let this kind of thing be suggested again",liftedStop:!0}};return e.log.append(d),e.stopsServed&&(e.stopsServed={...e.stopsServed,stops:e.stopsServed.stops.filter(c=>c.batch!==i.stop.batch)}),e.notify(T,[d]),{batch:d.batch,ops:[d],diff:T,primitives:[],reads:[],writes:[],intent:d.intent,...t.moved(a,a),violationsAfter:a}}h.stopRefusal=(e,i,o)=>{let n=e;if(i.length===0||i.some(t=>!t.suggests))return"Only a suggestion can be answered with not suggesting that kind of thing.";for(let t of i){let s=Re(n,t.suggests,t.author,t.lineage,o);if(s)return s}};var p=e=>e,b=(e,i)=>i===void 0?{}:{[e]:i};function wn(e,i,o){let n=m(e)?.store??e,t=p(n),s=le(o.lineage);if(s===void 0)throw new k("A suggestion says what it is based on: { basis, confidence? }");let a=o.author??t.by;if(o.expiresAt!==void 0&&Number.isNaN(Date.parse(o.expiresAt)))throw new k(`A suggestion expires at a time: "${o.expiresAt}" is not one (an ISO time, like 2026-10-23T06:00:00Z).`);let d=t.actMeanings(),c=x(i,d),r=$(n).find(y=>x(y.calls,d)===c);if(r)return n.log.get(r.id);t.refuseDeclined(i,a),P(a)&&t.refuseStopped(i,a,!0);let u=t.rehearsal();u.suggesting=!0;let g=u.applying(i,{author:a,lineage:s,...b("via",o.via)});if(g.ops.length===0)return;let l=[...new Set(g.ops.flatMap(y=>y.described??[]))],w=g.ops.filter(y=>y.mutation!==null&&y.author===a),S=i.length>1&&w.length===i.length?w.map(y=>y.intent):void 0,f={id:t.nextId(),seq:n.log.length,batch:t.mintBatch("batch"),author:a,intent:g.ops.map(y=>y.intent).join("; "),...b("batchIntent",o.intent),mutation:null,primitives:[],reads:[],writes:[],...l.length>0?{described:l}:{},at:t.now(),...b("via",o.via),lineage:s,suggests:i,...b("suggestsSaid",S),...b("expiresAt",o.expiresAt)};return n.log.append(f),n.notify(T,[f]),f}function $(e,i,o={}){let n=m(e),t=n?.store??e,s=i??n?.principal,a=(s!==void 0?t.seenBy(s):t).log.all(),d=me(a,u=>t.graph.has(u),{now:p(t).now(),dismissed:o.dismissed,voter:s}),c=new Set(Ke(t).keys());for(let u of t.stopsServed?.kinds??[])c.add(u);for(let u of De(t))for(let g of u.kinds)c.add(g);if(c.size===0)return d;let r=p(t).actMeanings();return d.filter(u=>!P(u.author)||G(u)||!u.calls.every(g=>c.has(A(g,r))))}function De(e){let i=e.stopsServed?.stops??[];if(i.length===0)return i;let o=e.log.undoneIds();return i.filter(n=>!e.log.all().some(t=>t.batch===n.batch&&o.has(t.id)))}function Ke(e){let i=e.log.all(),o=e.log.horizonEpoch()?.declines;return!i.some(n=>n.lineage?.stopsKind===!0)&&!Object.keys(o??{}).some(n=>n.startsWith(R))?new Map:new Map([...j(i,p(e).actMeanings(),o)].filter(([n])=>n.startsWith(R)))}function kn(e,i){let o=m(e),n=o?.store??e,t=i??o?.principal,s=t!==void 0?n.seenBy(t):n,a=new Map(s.log.all().map(c=>[c.id,c])),d=new Map;for(let c of Ke(n).values()){let{stop:r}=c;if(r){(t===void 0||!H(r.calls,_(n,t)))&&d.set(r.batch,{batch:r.batch,words:r.words});continue}let u=a.get(c.id);u?.batch!==void 0&&!u.withheld&&d.set(u.batch,{batch:u.batch,words:u.batchIntent??u.intent})}for(let c of De(n))d.set(c.batch,{batch:c.batch,words:c.words});return[...d.values()]}function Y(e,i,o){let n=m(e),t=n?.store??e,s=o??n?.principal??p(t).by;return i.calls.every(a=>t.permits(a,s).ok)}function Ie(e,i,o,n={}){let t=m(e)?.store??e,s=n.author??p(t).by;M(t,i,s);let a=t.applyAll([{name:pe,args:{suggestion:i,vote:o}}],{...n,author:s});return o===null?a:{...a,voted:o}}function M(e,i,o){let n=$(e,o).find(s=>s.id===i),t=n?void 0:e.log.get(i);if(t?.suggests&&q(t,p(e).now()))throw new k(`That suggestion expired on ${t.expiresAt.slice(0,10)}.`);if(!n)throw new k("That suggestion is no longer waiting: it was accepted or declined, or it is not one you can see.");return n}function On(e,i,o={}){let n=m(e)?.store??e,{items:t,...s}=o,a=s.author??p(n).by,d=M(n,i,a),c=t===void 0?d.items:d.items.filter(l=>t.includes(l.at));if(t!==void 0&&(t.length===0||c.length!==new Set(t).size))throw new k("Name the changes to accept by their place among those still waiting in the suggestion.");let r={...d,calls:c.map(l=>l.call)};if(!Y(n,r,a))return Ie(n,i,"for",{...s,author:a});let u=n.log.get(i)?.suggests?.length??c.length,g=c.length<u?{items:c.map(l=>l.at)}:{};return n.applyAll(r.calls,{...s,author:a,lineage:{...d.lineage,suggestion:i,...g}})}function xn(e,i,o={}){let n=m(e)?.store??e,t=o.author??p(n).by,s=M(n,i,t);if(!Y(n,s,t))return Ie(n,i,"against",{...o,author:t});let a=G(s)&&o.intent===void 0?{intent:`Declined ${Ue(Fe(s))} proposal: ${s.intent}`}:{};return n.undo(s.batch,{...o,...a,author:t})}function Be(e,i,o){let n=o.act(i.name),t=n?.derived?.relation??(n?.connects?.length===1?n.connects[0]:void 0);if(t!==void 0)return`\u201C${ee(F(t))}\u201D links`;let s=K(O(n?.name??i.name)),a=s&&e.schema.tryDefinition(s.kind);if(s&&a){let d=ne(e.schema,s.kind).toLowerCase();if(s.act==="edit"){let r=Object.keys(i.args??{}).filter(u=>u!=="id").map(u=>te(a,u));return`changes to the ${r.length>0?r.join(" and "):"details"} of ${d}`}let c={archive:`setting ${d} aside`,unarchive:`bringing ${d} back`,remove:`removing ${d}`,merge:`merging ${d}`};if(c[s.act])return c[s.act]}return`\u201C${n?.title??F(O(i.name))}\u201D`}function We(e,i){let o=m(e)?.store??e,n=p(o).actMeanings();return[...new Set(i.calls.map(t=>Be(o,t,n)))].join(", ")}function Re(e,i,o,n,t){if(n?.proposedBy!==void 0)return"A person proposed this: decline it, and they may propose again.";if(!P(o))return"Only what the app's own actor suggests can be stopped this way: decline this one.";let s=p(e).actMeanings(),a=[...new Set(i.map(c=>A(c,s)))].sort();if(J(e,`stops|${ke(t)}|${a.join("|")}`,()=>{let c=new Set(a),r=J(e,"waiting",()=>$(e)).filter(u=>P(u.author)&&!G(u)&&u.calls.some(g=>c.has(A(g,s))));return!(Oe(e,i,t)&&r.every(u=>Y(e,u,t)))}))return"Only somebody who may decide every suggestion of this kind can say not to suggest it."}function Mn(e,i,o){let n=m(e)?.store??e;return Re(n,i.calls,i.author,i.lineage,o??p(n).by)===void 0}function Pn(e,i,o={}){let n=m(e)?.store??e,t=o.author??p(n).by,s=M(n,i,t),a=o.intent??`Stopped suggesting ${We(n,s)}`;return n.undo(s.batch,{...o,author:t,intent:a,lineage:{basis:"A person said not to suggest this kind of thing",stopsKind:!0}})}function Dn(e,i,o={}){let n=m(e)?.store??e,t=o.author??p(n).by,s=M(n,i,t);if(s.author.kind!==t.kind||s.author.id!==t.id)throw new k("Only who made a suggestion withdraws it: a person declines it (declineSuggestion).");return n.undo(s.batch,{...o,author:t})}var Ge={kind:"system",id:"tidying",name:"Graview, tidying",automated:!0};U.op=(e,i,o,n,t,s)=>{let a=e,{suggestion:d,vote:c}=o.args,r=M(a,d,t),u=V(t)?L(t):void 0,g=c==="for"?`For: ${r.intent}`:c==="against"?`Against: ${r.intent}`:`Withdraws a vote on: ${r.intent}`;return{id:i.id,seq:a.log.length,batch:n,author:t,intent:g,mutation:o,primitives:[],reads:[],writes:[],...r.about.length>0?{described:r.about}:{},at:i.at,...s.via!==void 0?{via:s.via}:{},vote:{suggestion:d,vote:c,...u!==void 0?{advisory:!0,voter:u}:{}}}};U.accepting=(e,i)=>{let o=e,n=o.tidying?.autoAcceptAt;if(n===void 0||i.vote?.vote!=="for")return;let t=i.vote.suggestion,s=$(o).find(r=>r.id===t);if(!s)return;let d=[...z(o.log.all()).get(t)??[]].filter(([,r])=>r==="for").map(([r])=>r);if(d.length<n)return;let c=de(s.author)?s.author:Ge;return{calls:s.calls,author:c,lineage:{...s.lineage,suggestion:t,voters:d.slice(0,ue)}}};var G=e=>e.lineage?.proposedBy!==void 0,Fe=e=>e.author.name??e.author.id??"Somebody",Ue=e=>/s$/i.test(e)?`${e}'`:`${e}'s`;function Kn(e,i,o,n){let t=m(e)?.store??e,s=p(t).actMeanings(),a=x(o,s),d=$(t,i).find(r=>G(r)&&x(r.calls,s)===a);if(d)return t.log.get(d.id);let c={calls:o.map(({name:r,args:u})=>({name:r,args:u})),...b("intent",n)};return t.applyAll([{name:ge,args:c}],{author:i}).ops.find(r=>r.suggests!==void 0)}function In(e,i,o){if(!e||!e.grants.some(t=>t.propose!==void 0))return[];let n=new Set(oe(e,i,o));return o.filter(t=>!n.has(t)&&re(t).some(s=>ae(e,i,t.name,s)))}export{wn as a,$ as b,kn as c,Y as d,Ie as e,On as f,xn as g,We as h,Mn as i,Pn as j,Dn as k,G as l,Kn as m,In as n};
@@ -0,0 +1 @@
1
+ import{a as f,b as m,c as g,d as c}from"./chunk.OPMGQS5J.js";import{eb as y,gb as p,pb as u}from"./chunk.6L6RUOSF.js";function b(n,r){let t=y(n);return t==="agent"?"agent":t!=="human"&&t!=="visitor"?"app":n.onBehalfOf!==void 0||r?.id!==void 0&&p(n)?.id!==p(r)?.id?"person":n.id===void 0||r?.id===void 0||n.id===r.id?"you":"person"}var S=n=>n.ops.filter(r=>r.withheld!==!0);function $(n,r={}){let t=[];for(let e of n.batches()){let a=e.ops[0],s=e.ops.at(-1),i=S(e).length===0,o=i?void 0:m(e.ops),d=t.at(-1);if(o&&d?.typed&&d.author&&f(d.author,e.author)&&d.typed.node===o.node&&d.typed.field===o.field){let h=g(d.typed,o);t[t.length-1]={...d,seq:s.seq+1,at:s.at,batch:e.id,batches:[...d.batches??[],e.id],typed:h,said:c(h,n.schema,n.graph,!1)};continue}t.push({seq:s.seq+1,from:a.seq,at:s.at,batch:e.id,maker:i?"person":b(e.author,r.me),author:i?void 0:e.author,said:o?c(o,n.schema,n.graph,!1):e.intent,declaration:!1,withheld:i,...o?{batches:[e.id],typed:o}:{}})}let l=[...n.log.epochs().filter(e=>e.change!==void 0).map(e=>({seq:e.seq,sentence:e.change,...e.at?{at:e.at}:{}})),...r.declarations??[]];for(let e of l){if(e.seq<n.log.horizon||e.seq>n.log.length)continue;let a=t.findIndex(s=>s.seq===e.seq);if(a>=0&&!t[a].withheld){t[a]={...t[a],declaration:!0,said:e.sentence};continue}t.push({seq:e.seq,from:e.seq,at:e.at,batch:void 0,maker:e.author?b(e.author,r.me):"app",author:e.author,said:e.sentence,declaration:!0,withheld:!1})}return t.sort((e,a)=>e.seq-a.seq||+(e.batch!==void 0)-+(a.batch!==void 0))}function j(n,r){let t=n.log.all(),l=new Map(t.map(e=>[e.id,e.seq]));return n.batches().filter(e=>!e.undone&&e.ops[0].seq>=r).filter(e=>!e.ops.every(a=>a.sentOut!==void 0)).filter(e=>!e.ops.every(a=>a.undoes!==void 0&&(l.get(a.undoes)??-1)>=r)).map(e=>e.id)}function v(n,r){return n.withheld?"Someone":n.maker==="you"?"you":n.author?u(n.author,r):"the app"}export{b as a,$ as b,j as c,v as d};
@@ -1 +1 @@
1
- import{C as O}from"./chunk.DHPXRDT5.js";var k=3,A=k+1,P=A+1,z=(o,r)=>o<r?-1:o>r?1:0;function L(o){return(o??0)>4?k:2}function N(o,r,a){let n=[];for(let d of Object.values(o.tryDefinition(r)?.edges??{}))if(d.to!=="*")for(let i of d.to)i!==r&&a.includes(i)&&!n.includes(i)&&n.push(i);return n}function W(o,r={}){let a=[...o.kinds],n=[...(r.order??[]).filter(e=>a.includes(e)),...a.filter(e=>!(r.order??[]).includes(e)).sort(z)].filter((e,t,s)=>s.indexOf(e)===t),d=e=>n.indexOf(e),i=new Map,g=[],h=(e,t,s)=>{i.set(e,{col:t,row:s,side:L(r.counts?.[e])}),g.push({col:t,row:s})};for(let e of n){let t=o.tryDefinition(e)?.plot??r.plots?.[e];t&&h(e,t.col,t.row)}let l=new Map(n.map(e=>[e,N(o,e,a)])),b=new Set(n.filter(e=>l.get(e).length>0||n.some(t=>l.get(t).includes(e)))),v=new Map,C=new Set,D=e=>{let t=v.get(e);if(t!==void 0)return t;if(C.has(e))return-1;C.add(e);let s=0;for(let c of l.get(e))s=Math.max(s,D(c)+1);return C.delete(e),v.set(e,s),s};for(let e of n)b.has(e)&&D(e);let f=[];for(let e of n)b.has(e)&&(f[v.get(e)]??=[]).push(e);let I=new Map,T=Math.max(1,Math.ceil(Math.sqrt(f.length))),H=Math.max(1,...f.map(e=>e?.length??0)),w=Math.max(P,Math.round(r.pitch??P)),R=(e,t)=>r.upright?{col:e%T*w,row:(Math.floor(e/T)*(H+1)+t)*w}:{col:t*w,row:e===0?0:-e*w},$=e=>!g.some(t=>V(t,e)),S=(e,t,s)=>{let c=s;for(;!$(R(t,c))&&c<s+64;)c++;return i.has(e)||h(e,R(t,c).col,R(t,c).row),c},x=0;f.forEach((e=[],t)=>{let s=u=>{let m=l.get(u).map(p=>I.get(p)).filter(p=>p!==void 0);return m.length>0?m.reduce((p,q)=>p+q,0)/m.length:1/0},c=[...e].sort((u,m)=>s(u)-s(m)||d(u)-d(m)),y=0;for(let u of c)i.has(u)||(y=S(u,t,y),I.set(u,y),x=Math.max(x,y+1),y++)});let j=n.filter(e=>!b.has(e)&&!i.has(e)),M=Math.max(r.upright?x:f.length,Math.ceil(Math.sqrt(j.length*2)),1),E=b.size>0?1:0;return j.forEach((e,t)=>{r.upright?S(e,f.length+E+Math.floor(t/M),t%M):S(e,t%M,x+E+Math.floor(t/M))}),i}function V(o,r){return Math.abs(o.col-r.col)<A&&Math.abs(o.row-r.row)<A}function X(o,r,a,n=.5){return{x:(o-r)*a/2,y:(o+r)*a*n/2}}var G=1,B=/^(done|completed?|closed|finished|shipped|sent|won|lost|passed|declined|dropped|answered|resolved|fixed|archived|cancell?ed|retired|released|published|delivered|paid|merged|rejected|written[-_ ]?up|out)$/i,F=/^(doing|in[-_ ]?progress|active|building|started|working|in[-_ ]?review|review(ing)?|fixing|ongoing|underway|testing|drafting|writing|running)$/i;function _(o,r,a){let n=O(o.tryDefinition(r)?.fields.shape?.[a]);for(;n&&n.innerType!==void 0&&n.type!=="enum";)n=O(n.innerType);if(n?.type!=="enum")return;let d=(n.entries?Object.values(n.entries):n.values??[]).filter(i=>typeof i=="string");return d.length>0?d:void 0}function J(o,r){let a=o.tryDefinition(r);if(!a)return;let n=a.lifecycle,d=Object.keys(a.fields.shape??{}),i=[n?.field,...d.filter(l=>/^(status|stage|state|phase)$/i.test(l))].find(l=>l!==void 0&&_(o,r,l)!==void 0);if(!i)return;let g=_(o,r,i),h=n?.field===i&&Array.isArray(n.retired)?n.retired:[];return{field:i,values:g,tiers:g.map(l=>h.includes(l)||B.test(l)?"done":F.test(l)?"active":"waiting")}}export{P as a,W as b,X as c,G as d,J as e};
1
+ import{C as O}from"./chunk.6L6RUOSF.js";var k=3,A=k+1,P=A+1,z=(o,r)=>o<r?-1:o>r?1:0;function L(o){return(o??0)>4?k:2}function N(o,r,a){let n=[];for(let d of Object.values(o.tryDefinition(r)?.edges??{}))if(d.to!=="*")for(let i of d.to)i!==r&&a.includes(i)&&!n.includes(i)&&n.push(i);return n}function W(o,r={}){let a=[...o.kinds],n=[...(r.order??[]).filter(e=>a.includes(e)),...a.filter(e=>!(r.order??[]).includes(e)).sort(z)].filter((e,t,s)=>s.indexOf(e)===t),d=e=>n.indexOf(e),i=new Map,g=[],h=(e,t,s)=>{i.set(e,{col:t,row:s,side:L(r.counts?.[e])}),g.push({col:t,row:s})};for(let e of n){let t=o.tryDefinition(e)?.plot??r.plots?.[e];t&&h(e,t.col,t.row)}let l=new Map(n.map(e=>[e,N(o,e,a)])),b=new Set(n.filter(e=>l.get(e).length>0||n.some(t=>l.get(t).includes(e)))),v=new Map,C=new Set,D=e=>{let t=v.get(e);if(t!==void 0)return t;if(C.has(e))return-1;C.add(e);let s=0;for(let c of l.get(e))s=Math.max(s,D(c)+1);return C.delete(e),v.set(e,s),s};for(let e of n)b.has(e)&&D(e);let f=[];for(let e of n)b.has(e)&&(f[v.get(e)]??=[]).push(e);let I=new Map,T=Math.max(1,Math.ceil(Math.sqrt(f.length))),H=Math.max(1,...f.map(e=>e?.length??0)),w=Math.max(P,Math.round(r.pitch??P)),R=(e,t)=>r.upright?{col:e%T*w,row:(Math.floor(e/T)*(H+1)+t)*w}:{col:t*w,row:e===0?0:-e*w},$=e=>!g.some(t=>V(t,e)),S=(e,t,s)=>{let c=s;for(;!$(R(t,c))&&c<s+64;)c++;return i.has(e)||h(e,R(t,c).col,R(t,c).row),c},x=0;f.forEach((e=[],t)=>{let s=u=>{let m=l.get(u).map(p=>I.get(p)).filter(p=>p!==void 0);return m.length>0?m.reduce((p,q)=>p+q,0)/m.length:1/0},c=[...e].sort((u,m)=>s(u)-s(m)||d(u)-d(m)),y=0;for(let u of c)i.has(u)||(y=S(u,t,y),I.set(u,y),x=Math.max(x,y+1),y++)});let j=n.filter(e=>!b.has(e)&&!i.has(e)),M=Math.max(r.upright?x:f.length,Math.ceil(Math.sqrt(j.length*2)),1),E=b.size>0?1:0;return j.forEach((e,t)=>{r.upright?S(e,f.length+E+Math.floor(t/M),t%M):S(e,t%M,x+E+Math.floor(t/M))}),i}function V(o,r){return Math.abs(o.col-r.col)<A&&Math.abs(o.row-r.row)<A}function X(o,r,a,n=.5){return{x:(o-r)*a/2,y:(o+r)*a*n/2}}var G=1,B=/^(done|completed?|closed|finished|shipped|sent|won|lost|passed|declined|dropped|answered|resolved|fixed|archived|cancell?ed|retired|released|published|delivered|paid|merged|rejected|written[-_ ]?up|out)$/i,F=/^(doing|in[-_ ]?progress|active|building|started|working|in[-_ ]?review|review(ing)?|fixing|ongoing|underway|testing|drafting|writing|running)$/i;function _(o,r,a){let n=O(o.tryDefinition(r)?.fields.shape?.[a]);for(;n&&n.innerType!==void 0&&n.type!=="enum";)n=O(n.innerType);if(n?.type!=="enum")return;let d=(n.entries?Object.values(n.entries):n.values??[]).filter(i=>typeof i=="string");return d.length>0?d:void 0}function J(o,r){let a=o.tryDefinition(r);if(!a)return;let n=a.lifecycle,d=Object.keys(a.fields.shape??{}),i=[n?.field,...d.filter(l=>/^(status|stage|state|phase)$/i.test(l))].find(l=>l!==void 0&&_(o,r,l)!==void 0);if(!i)return;let g=_(o,r,i),h=n?.field===i&&Array.isArray(n.retired)?n.retired:[];return{field:i,values:g,tiers:g.map(l=>h.includes(l)||B.test(l)?"done":F.test(l)?"active":"waiting")}}export{P as a,W as b,X as c,G as d,J as e};
@@ -0,0 +1 @@
1
+ import{a as K,c as R,d as k}from"./chunk.EZQK23AB.js";import{a as I}from"./chunk.QDVGHI7R.js";import{L as M,P as j,S as V,gb as O,hb as W,jb as G}from"./chunk.6L6RUOSF.js";function E(e,t,n){let s=e.schema.tryDefinition(t)?.fields?.shape?.[n];return s===void 0?void 0:I(s)}function Z(e,t){if(e===void 0)return[];if(!Array.isArray(e))return[`The view's accepts is a list of { "kind": <a kind>, "field": <its image, video or file field> }.`];let n=[],i=new Set(t.schema.kinds);for(let s of e){let{kind:r,field:o}=s??{};typeof r!="string"||typeof o!="string"?n.push(`Each of the view's accepts is { "kind": <a kind>, "field": <its image, video or file field> }.`):i.has(r)?E(t,r,o)?t.allMutations().some(d=>(d.creates??[]).includes(r)&&Object.hasOwn(d.input?.shape??{},o))||n.push(`No act of this app makes a "${r}" with its "${o}", so a file dropped could become nothing.`):n.push(`The view accepts files into ${r}'s "${o}", which holds no picture, video or file.`):n.push(`The view accepts files for "${r}", which is no kind of this app.`)}return n}function _(e,t,n){if(e===void 0||e===!0)return[];let i=`The view's pictures is true; the kinds whose pictures it draws, ["circuit"]; or { "width": <the widest it draws a picture, in pixels> } with the fields it draws them from, by kind, { "circuit": "photo" }.`;if(typeof e!="object"||e===null)return[i];let s=new Set([...n.attach==="home"?[]:[n.attach],...n.reads?.kinds??[]]),r=new Set(t.schema.kinds),o=[],d=c=>{if(!r.has(c))return void o.push(`The view's pictures chooses "${c}", which is no kind of this app.`);s.has(c)||o.push(`The view's pictures chooses "${c}", whose records it is not handed: add "${c}" to its reads.kinds.`)};if(Array.isArray(e)){if(e.length===0||!e.every(c=>typeof c=="string"))return[i];for(let c of e)d(c);return o}for(let[c,l]of Object.entries(e)){if(c==="width"&&typeof l!="string"&&!Array.isArray(l)){Number.isInteger(l)&&l>=16&&l<=4096||o.push("The view's pictures width is a whole number of pixels from 16 to 4096.");continue}let y=typeof l=="string"?[l]:Array.isArray(l)&&l.length>0&&l.every(u=>typeof u=="string")?l:void 0;if(!y){o.push(`The view's pictures says "${c}": beside "width", it names a kind and the field it draws pictures from, "circuit": "photo", or its fields, "circuit": ["photo", "map"].`);continue}let f=o.length;if(d(c),!(o.length>f))for(let u of y){let g=E(t,c,u);g?g.as==="video"&&o.push(`The view's pictures chooses ${c}'s "${u}", which holds videos: the host plays a video where the view places it, and hands no picture of it.`):o.push(`The view's pictures chooses ${c}'s "${u}", which holds no picture.`)}}return o}function B(e){if(e===void 0)return[];if(typeof e!="object"||e===null||Array.isArray(e))return[`The view's scene is { "maxHeight": <the tallest its preview on the Scene is drawn, in pixels> }.`];let{maxHeight:t,...n}=e,i=[];return Object.keys(n).length>0&&i.push(`The view's scene says ${Object.keys(n).map(s=>`"${s}"`).join(", ")}: only "maxHeight" is read.`),t!==void 0&&!(Number.isInteger(t)&&t>=80&&t<=4e3)&&i.push("The view's scene maxHeight is a whole number of pixels from 80 to 4000."),i}function N(e){return(e.acts??[]).map(t=>typeof t=="string"?{act:t}:t)}function ee(e,t){let n=[],i=new Set(t.schema.kinds),s=new Set(t.schema.edgeKinds),r=new Set(t.allMutations().map(d=>d.name));(typeof e.name!="string"||!/^[a-z0-9][a-z0-9-]{0,62}$/.test(e.name))&&n.push(`The view's name "${String(e.name)}" is not lower-case letters, digits and hyphens.`),e.title!==void 0&&(typeof e.title!="string"||e.title.trim()===""||e.title.length>80)&&n.push("The view's title is empty or longer than 80 characters."),e.attach!=="home"&&!i.has(e.attach)&&n.push(`The view attaches to "${e.attach}", which is no kind of this app.`),e.cardinality!=="one"&&e.cardinality!=="many"&&n.push(`The view's cardinality is "${String(e.cardinality)}", not one or many.`),e.attach==="home"&&e.cardinality!=="many"&&n.push("A view of the home draws many records: its cardinality is many."),e.replaces!==void 0&&e.replaces!=="page"?n.push(`The view's replaces is "${String(e.replaces)}": the one thing a view replaces is "page", or leave it out to draw the view above the record's own fields.`):e.replaces==="page"&&e.attach==="home"&&n.push(`The home's view is the home already: replaces "page" is for a view of a kind, of one record (its page) or of many (its list).`),e.gestures!==void 0&&typeof e.gestures!="boolean"&&n.push(`The view's gestures is "${String(e.gestures)}": it is true, or left out.`),e.bleed!==void 0&&typeof e.bleed!="boolean"&&e.bleed!=="full"&&n.push(`The view's bleed is "${String(e.bleed)}": it is true, "full", or left out.`),e.heading!==void 0&&(e.heading!=="own"||e.attach==="home"||(e.cardinality==="many"?e.title===void 0:e.replaces!=="page"))&&n.push(`The view's heading is "${String(e.heading)}": it is "own" on a view that is a place (a title, cardinality many) or on a view of one record that replaces its page (replaces "page"), or left out.`),e.flows!==void 0&&typeof e.flows!="boolean"?n.push(`The view's flows is "${String(e.flows)}": it is false for a view that keeps its place's frame, or left out.`):e.flows===!1&&(e.attach==="home"||e.cardinality!=="many"||e.title===void 0)&&n.push("Only a view that is a place keeps a frame: flows false needs a title and cardinality many on a kind."),n.push(...B(e.scene)),e.scene!==void 0&&(e.attach==="home"||e.cardinality!=="many")&&n.push("Only a view of a kind's members is drawn on the Scene as a card: scene needs cardinality many on a kind."),n.push(..._(e.pictures,t,e)),n.push(...Z(e.accepts,t));for(let d of e.reads?.kinds??[])i.has(d)||n.push(`The view reads "${d}", which is no kind of this app.`);for(let d of e.reads?.edges??[])s.has(d)||n.push(`The view reads the edge "${d}", which no kind of this app declares.`);let o=new Set;for(let d of N(e)){r.has(d.act)||n.push(`The view asks for the act "${d.act}", which this app does not declare.`);let c=d.as??d.act;o.has(c)&&n.push(`Two of the view's acts are called "${c}".`),o.add(c)}return n}function q(e,t,n){let i=[...new Set([...t.attach==="home"?[]:[t.attach],...t.reads?.kinds??[]])];if(i.length<2)return[];let s=new Set(t.reads?.edges??[]),r=o=>new RegExp(`(["'\`])${o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\1`).test(n);return e.schema.edgeKinds.filter(o=>{let d=e.schema.edge(o);return!s.has(o)&&d!==void 0&&d.from.some(c=>i.includes(c))&&(d.to==="*"||d.to.some(c=>i.includes(c)))&&r(o)})}function ne(e,t,n){let i=q(e,t,n);if(i.length===0)return;let s=(r,o)=>r.length<2?r[0]??"":`${r.slice(0,-1).join(", ")} ${o} ${r[r.length-1]}`;return`"${t.name}" names ${s(i,"and")} but does not read ${i.length>1?"them":"it"}, so the view is handed no such links: add ${s(i.map(r=>`"${r}"`),"and")} to its manifest's reads.edges.`}function J(e,t){let n=t.attach;return n==="home"||t.cardinality!=="one"||(t.reads?.kinds??[]).includes(n)?[]:(t.reads?.edges??[]).filter(i=>{let s=e.schema.edge(i);return s!==void 0&&s.from.includes(n)&&s.to!=="*"&&s.to.includes(n)})}function L(e,t){let n=new Set([...t.attach==="home"?[]:[t.attach],...t.reads?.kinds??[]]),i=[];for(let s of t.reads?.edges??[]){let r=e.schema.edge(s);if(!r)continue;let o=r.from.some(l=>n.has(l))?[]:r.from,d=r.to==="*"||r.to.some(l=>n.has(l))?[]:r.to,c=[...new Set([...o,...d])];c.length>0?i.push({edge:s,kinds:c}):r.to==="*"&&t.attach!=="home"&&t.cardinality==="one"&&(t.reads?.kinds??[]).length===0&&i.push({edge:s,kinds:[]})}return i}function te(e,t){return L(e,t).map(({edge:n,kinds:i})=>{let s=e.schema.edge(n),r=`${s.from.join(" or ")} to ${s.to==="*"?"any kind":s.to.join(" or ")}`;return i.length===0?`"${t.name}" reads the relation "${n}", from ${r}, and is handed no other kind, so no link of it reaches the view: name the kinds it links to in its manifest's reads.kinds.`:`"${t.name}" reads the relation "${n}", from ${r}, and is handed no ${i.join(" or ")}, so no link of it reaches the view: add ${i.map(o=>`"${o}"`).join(" or ")} to its manifest's reads.kinds.`})}function ie(e,t){return[...t.attach==="home"?[]:[t.attach],...t.reads?.kinds??[]].some(i=>Object.keys(e.schema.tryDefinition(i)?.computed??{}).length>0)}function se(e,t,n){let{manifest:i}=n,s=n.input??{},o=e.seenBy(t).graph,d=i.attach==="home"?void 0:i.attach,c=d&&i.cardinality==="one"&&s.node?o.getNode(s.node.id):void 0,l=c&&c.kind===d?[c]:[],y=d&&i.cardinality==="many"?s.nodes?s.nodes.flatMap(a=>{let h=o.getNode(a.id);return h&&h.kind===d?[h]:[]}):o.nodesOfKind(d):[],f=l[0],u=f?J(e,i).flatMap(a=>[...o.outEdges(f.id,a).map(h=>h.to),...o.inEdges(f.id,a).map(h=>h.from)].flatMap(h=>{let p=h===f.id?void 0:o.getNode(h);return p&&p.kind===d?[p]:[]})):[],g=new Set([...l,...y,...u].map(a=>a.id)),v=K(o,g,{kinds:(i.reads?.kinds??[]).filter(a=>a!==d||i.cardinality==="one"),edges:i.reads?.edges??[]}),w=new Map;for(let a of[...y,...u,...v.nodes])l.some(h=>h.id===a.id)||w.set(a.id,a);let F=new Set([...l.map(a=>a.id),...w.keys()]),H=[...v.edges],C=new Set(N(i).map(a=>a.act)),D=e.permittedMutations(t).filter(a=>C.has(a.name)).map(a=>({name:a.name,title:a.title??a.name,...a.description!==void 0?{description:a.description}:{},...a.subject?{subject:{kinds:a.subject.kinds,arg:a.subject.arg}}:{}})),$=a=>a?.filter(h=>F.has(h)),x=n.computed,A=a=>x?{...k(e,a),...x(o,a)}:k(e,a),T=O(t),S=W(t),b=!G(t)&&S!==void 0?o.getNode(S):void 0,m=b&&e.schema.tryDefinition(b.kind)?.people?b:void 0,P=T?{...e.schema.definitions.some(a=>a.people)?{id:S}:{},name:T.name}:m?{id:m.id,name:k(e,m).label??m.id}:void 0;return{view:i.name,...l[0]?{node:A(l[0])}:{},nodes:[...w.values()].map(A),edges:H,...i.title!==void 0?{label:i.title}:s.label!==void 0?{label:s.label}:{},cardinality:i.cardinality,...s.fidelity!==void 0?{fidelity:s.fidelity}:{},...s.mode!==void 0?{mode:s.mode}:{},...s.selected!==void 0?{selected:s.selected}:{},...s.implicated?{implicated:$(s.implicated)}:{},...s.flagged?{flagged:$(s.flagged)}:{},acts:D,...P?{me:P}:{},...n.theme?{theme:n.theme}:{},locale:j(),timeZone:V(),today:e.today()??M(),...R(e.schema,[...l,...w.values()]),...n.places?{places:n.places.filter((a,h,p)=>p.findIndex(z=>z.as===a.as)===h).map(({as:a,title:h,kind:p})=>({as:a,title:h,kind:p}))}:{}}}export{E as a,N as b,ee as c,q as d,ne as e,J as f,L as g,te as h,ie as i,se as j};
@@ -0,0 +1,4 @@
1
+ import{a as _,b as I,c as T,d as j,e as P,f as F,g as S,j as D}from"./chunk.TRP66PHK.js";import{a as M}from"./chunk.PGT4ZQDG.js";var q=0,Q=1,ee=2,ne=3,U=1,te=2,$=3,re=1,se=3,ie=8,z="~",R=s=>typeof s=="object"&&s!==null&&!Array.isArray(s),H=new Set(["input","select","textarea","option"]),oe=new Set(["value","checked","selected"]),W=["aria-label","aria-labelledby","title"],ae=s=>W.some(r=>(s.getAttribute(r)??"").trim()!=="");function ge(s,r){let l=s.ownerDocument??s,h=r.maxNodes??5e3,f=[],p=new Map,E=new WeakMap,b={dom:s,name:"div",namespace:"html",children:[],id:z};p.set(z,b);let v=0,L=!1,k=new WeakMap,A=new Map,w=new Map,c=e=>{f.push(e),f.length>200&&f.shift(),r.onRefused?.(e)},y=()=>({dom:l.createComment(""),children:[],refused:!0}),Y=(e,a)=>{if(e.namespace==="html"&&e.name&&H.has(e.name))return e.dom;if(a?.namespace==="html"&&a.name==="textarea")return a.dom},O=(e,a)=>{let o=e.dom,i=k.get(o)??o.getAttribute("role");if(i===null||!i.split(/\s+/).some(t=>_.includes(t.toLowerCase())))return void k.delete(o);if(ae(o)){k.delete(o),o.getAttribute("role")!==i&&o.setAttribute("role",i);return}k.set(o,i),o.removeAttribute("role"),a&&c({reason:"value",element:e.name,name:"role"})},Z=()=>{if(w.size===0)return;let e=new Set,a=o=>{for(let i of o.children){if(i.refused||i.text)continue;let t=i.dom.getAttribute("id");t&&e.add(t),a(i)}};a(b);for(let[o,i]of w){if(o.id===void 0||p.get(o.id)!==o){w.delete(o);continue}let t=o.dom;for(let[n,u]of i){let d=u.value.split(/\s+/).filter(g=>g!==""),m=d.filter(g=>!e.has(g));if(d.length>0&&m.length===0){if(u.drawn)continue;u.drawn=!0,t.setAttribute(n,u.value),O(o,!1)}else u.drawn&&(u.drawn=!1,t.removeAttribute(n),c({reason:"reference",element:o.name,name:n,ids:m.length>0?m:d}),O(o,!0))}}},N=(e,a,o,i=!0)=>{let t=e.dom;if(o!=null&&typeof o!="string")return c({reason:"value",element:e.name,name:a});let n=D(e.namespace,e.name,a,o??null,r);if("refused"in n){let g=D(e.namespace,e.name,a,null,r);return"refused"in g||t.removeAttribute(g.name),!("refused"in g)&&g.name==="role"&&k.delete(t),c(n.refused)}for(let g of n.dropped??[])c(g);let u=e.namespace==="html"&&oe.has(n.name)&&H.has(e.name),d=t,m=u?n.name==="value"?d.value:n.name==="checked"?d.checked:d.selected:void 0;if(n.name==="role"&&k.delete(t),I.includes(n.name)){let g=w.get(e)??new Map;n.value===null?g.delete(n.name):g.set(n.name,{value:n.value,drawn:!0}),g.size>0?w.set(e,g):w.delete(e)}n.value===null?t.removeAttribute(n.name):t.setAttribute(n.name,n.value),i&&(n.name==="role"||W.includes(n.name))&&O(e,n.name==="role"),r.onAttribute?.(t,n.name),u&&(n.name==="value"&&"value"in d?(d.value=n.value??"",m!==d.value&&r.onFieldSet?.(t)):n.name==="checked"&&"checked"in d?(d.checked=n.value!==null,m!==d.checked&&r.onFieldSet?.(t)):n.name==="selected"&&"selected"in d&&(d.selected=n.value!==null,m!==d.selected&&r.onFieldSet?.(t.parentElement?.closest("select")??t)))},x=e=>{if(!e.refused){v-=1,e.id!==void 0&&p.delete(e.id);for(let a of e.children)x(a)}},C=(e,a)=>{if(!R(e)||typeof e.id!="string"||p.has(e.id))return c({reason:"record"}),y();if(v>=h)return c({reason:"budget"}),L||(L=!0,r.onOverBudget?.()),y();let o=e.id;if(e.type===ie)return y();if(e.type===se){if(S(a.namespace,a.name))return c({reason:"child",element:a.name}),y();let d=l.createTextNode(String(e.data??"").slice(0,T)),m={dom:d,children:[],text:!0,id:o,parent:a};return p.set(o,m),E.set(d,o),v+=1,m}if(e.type!==re)return c({reason:"record"}),y();let i=String(e.element);if(S(a.namespace,a.name))return c({reason:"child",element:i}),y();let t=F(i,a.namespace);if("refused"in t)return c(t.refused),y();let n=l.createElementNS(t.namespace==="svg"?P:j,t.name);t.as&&n.setAttribute("data-graview-as",t.as),t.namespace==="html"&&t.name==="img"&&n.setAttribute("referrerpolicy","no-referrer"),t.namespace==="html"&&t.name==="a"&&(n.setAttribute("target","_blank"),n.setAttribute("rel","noopener noreferrer"),n.setAttribute("referrerpolicy","no-referrer"));let u={dom:n,name:t.name,namespace:t.namespace,children:[],id:o,parent:a};if(p.set(o,u),E.set(n,o),v+=1,R(e.attributes)){for(let[d,m]of Object.entries(e.attributes))N(u,d,m,!1);O(u,!0)}if(r.decorate?.(n,t.name,t.namespace),R(e.properties))for(let d of Object.keys(e.properties))c({reason:"attribute",element:t.name,name:d});if(R(e.eventListeners))for(let d of Object.keys(e.eventListeners))e.eventListeners[d]!=null&&c({reason:"attribute",element:t.name,name:`on${d}`});if(Array.isArray(e.children))for(let d of e.children){let m=C(d,u);u.children.push(m),n.appendChild(m.dom)}return u},K=e=>{if(!Array.isArray(e))return c({reason:"record"});let[a,o]=e,i=typeof o=="string"?p.get(o):void 0;if(!i)return c({reason:"record"});switch(a){case q:{if(i.text)return c({reason:"record"});let t=Number(e[3]),n=Number.isInteger(t)&&t>=0&&t<=i.children.length?t:i.children.length,u=e[2],d=R(u)&&typeof u.id=="string"?A.get(u.id):void 0,m;d&&d.parent?.namespace===i.namespace&&!S(i.namespace,i.name)?(A.delete(u.id),d.parent=i,m=d):m=C(u,i),i.dom.insertBefore(m.dom,i.children[n]?.dom??null),i.children.splice(n,0,m),i.namespace==="html"&&i.name==="textarea"&&r.onFieldSet?.(i.dom);return}case Q:{let t=Number(e[2]),n=i.children[t];if(!n)return c({reason:"record"});i.children.splice(t,1),n.dom.parentNode?.removeChild(n.dom),n.id!==void 0&&!n.refused?A.set(n.id,n):x(n);return}case ee:{if(!i.text)return c({reason:"record"});i.dom.data=String(e[2]??"").slice(0,T);let t=Y(i,i.parent);t&&r.onFieldSet?.(t);return}case ne:{if(i===b||i.text)return c({reason:"record"});let t=String(e[2]),n=e[4]??U;return n===te?N(i,t,e[3]):c(n===U||n===$?{reason:"attribute",element:i.name,name:n===$?`on${t}`:t}:{reason:"record"})}default:return c({reason:"record"})}};return{apply(e,a){if(!Array.isArray(e))return c({reason:"record"}),!0;try{for(let o=0;o<e.length;o+=1){if(a&&o%32===0&&a())return!1;K(e[o])}return!0}finally{for(let o of A.values())x(o);A.clear(),Z()}},get refused(){return f},get size(){return v},idOf:e=>E.get(e),elementOf(e){let a=p.get(e);return a&&!a.text&&a!==b?a.dom:void 0},dispose(){for(let e of b.children)x(e);for(b.children.length=0;s.firstChild;)s.removeChild(s.firstChild)}}}var de="@layer graview-motion, graview-region, graview-view, graview-theme;",le=new Set(["media","supports","container","keyframes","-webkit-keyframes"]),ce=new Set(["src","image-set","-webkit-image-set"]),ue={"}":"{",")":"(","]":"["};function G(s){let r=[],l=M(s);for(let[h,f]of l.entries())switch(f.type){case"bad-string":case"bad-url":case"url":case"CDO":case"CDC":return!1;case"delim":if(f.value==="\\")return!1;break;case"at-keyword":if(!le.has(f.value.toLowerCase()))return!1;break;case";":if(r.length===0)return!1;break;case"function":{let p=f.value.toLowerCase();if(ce.has(p))return!1;if(p==="url"){let E=l[h+1];if(E?.type!=="string"||!E.value.startsWith("#"))return!1}r.push("(");break}case"{":case"(":case"[":r.push(f.type);break;case"}":case")":case"]":if(r.pop()!==ue[f.type])return!1;break;default:}return r.length===0}function B(s,r){return r.trim()===""||!G(r)?"":`@layer ${s} {
2
+ ${r}
3
+ }`}function Ee(s,r){return s.trim()===""?G(r)?r:"":[de,B("graview-theme",s),B("graview-view",r)].filter(l=>l!=="").join(`
4
+ `)}var fe=s=>typeof s=="string"&&/^#[A-Za-z_][A-Za-z0-9_.:-]{0,199}$/.test(s),V=["https:","mailto:","tel:"];function X(s){if(!(typeof s!="string"||s.length>2e3||/[\s<>"]/.test(s.trim())||s.trim()!==s))try{let r=new URL(s);return!V.includes(r.protocol)||r.protocol==="https:"&&(r.hostname===""||r.username!==""||r.password!=="")?void 0:r.href}catch{return}}function ke(s){let r=new Set,l=h=>{if(typeof h!="string"||!/^(https|mailto|tel):/i.test(h))return;let f=X(h);f&&r.add(f)};for(let h of[...s?.node?[s.node]:[],...s?.nodes??[]])for(let[f,p]of Object.entries(h))f==="id"||f==="kind"||(Array.isArray(p)?p.forEach(l):l(p));return r}function J(s){return(s??[]).flatMap(r=>{try{let l=new URL(r);return l.protocol==="https:"&&l.hostname!==""&&l.username===""&&l.password===""?[l.origin]:[]}catch{return[]}})}function we(s,r){if(fe(s))return s;let l=X(s);if(l&&(r.handed.has(l)||l.startsWith("https:")&&J(r.origins).includes(new URL(l).origin)))return l}function ve(s,r){let l=s.length>120?`${s.slice(0,119)}\u2026`:s,h="";try{h=new URL(s).protocol}catch{h=""}if(!V.includes(h))return`The link "${l}" was not drawn: a view links only to an https:, mailto: or tel: address.`;let f=J(r);return`The link "${l}" was not drawn: it is no address this view was handed. A view links out only to an address a record it was shown holds (a url field), as the record holds it${f.length>0?`, or an https: address on ${f.join(", ")}`:""}; a record or a place of this app is <a data-record> or <a data-place>.`}export{ge as a,de as b,B as c,Ee as d,ke as e,we as f,ve as g};