graview 0.1.70 → 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 (216) 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.4O3STSC4.js → chunk.3RRK6UTN.js} +1 -1
  5. package/dist/preview/chunk.45HUV56Z.js +1 -0
  6. package/dist/preview/chunk.4HU2ILFY.js +1 -0
  7. package/dist/preview/{chunk.M7DJJRFH.js → chunk.4LWWXIM4.js} +1 -1
  8. package/dist/preview/chunk.4O64QV2Y.js +1 -0
  9. package/dist/preview/{chunk.KP7HUXH5.js → chunk.4QMAYVPU.js} +1 -1
  10. package/dist/preview/chunk.4UDST6IF.js +1 -0
  11. package/dist/preview/{chunk.7TZXDPPO.js → chunk.4YZ2A6SJ.js} +3 -3
  12. package/dist/preview/{chunk.PAIBRJVZ.js → chunk.4ZEHLUXV.js} +1 -1
  13. package/dist/preview/{chunk.I7CSRZC2.js → chunk.5EQRIZ6I.js} +1 -1
  14. package/dist/preview/chunk.5OS4SYHE.js +1 -0
  15. package/dist/preview/{chunk.ZIGW5VOT.js → chunk.5PQV7GFE.js} +1 -1
  16. package/dist/preview/{chunk.SSHEFQ4R.js → chunk.5WCSQFS5.js} +1 -1
  17. package/dist/preview/{chunk.RJ7UV3XI.js → chunk.64K5ELSQ.js} +1 -1
  18. package/dist/preview/{chunk.2T24FYAO.js → chunk.67S2UWBT.js} +1 -1
  19. package/dist/preview/{chunk.FXCKKVT5.js → chunk.6A3KTD66.js} +1 -1
  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.ZGJUCVT5.js → chunk.6TBQV3NO.js} +1 -1
  24. package/dist/preview/chunk.6ZRVVRDQ.js +1 -0
  25. package/dist/preview/{chunk.4VTUC5TF.js → chunk.7FI75ZVE.js} +1 -1
  26. package/dist/preview/{chunk.NKUNCQB3.js → chunk.7KX36ENH.js} +1 -1
  27. package/dist/preview/{chunk.JPJHM62B.js → chunk.7LPHWJB4.js} +1 -1
  28. package/dist/preview/chunk.7MDGPTYF.js +1 -0
  29. package/dist/preview/{chunk.JEQ6CA5M.js → chunk.7PWLRRUS.js} +2 -2
  30. package/dist/preview/{chunk.YBQUP3KE.js → chunk.7TACFS7Q.js} +1 -1
  31. package/dist/preview/{chunk.DIVANC3G.js → chunk.7THS3DLZ.js} +1 -1
  32. package/dist/preview/{chunk.5W7EGQCQ.js → chunk.7XGU6KVF.js} +2 -2
  33. package/dist/preview/chunk.7ZLCA3WK.js +1 -0
  34. package/dist/preview/{chunk.4BSEYZMS.js → chunk.ARGEGV5T.js} +1 -1
  35. package/dist/preview/{chunk.3KF5RYPW.js → chunk.BSWR5SGX.js} +1 -1
  36. package/dist/preview/{chunk.BBMX3IIO.js → chunk.BWMPC7LK.js} +1 -1
  37. package/dist/preview/{chunk.55C7WO4X.js → chunk.CEJIH3CN.js} +1 -1
  38. package/dist/preview/{chunk.F5756PXX.js → chunk.CEOQY5KS.js} +2 -2
  39. package/dist/preview/{chunk.NZFO6BM3.js → chunk.CGRX6SDE.js} +1 -1
  40. package/dist/preview/{chunk.C67TMA4U.js → chunk.CPK6CYKN.js} +1 -1
  41. package/dist/preview/{chunk.T552MHMU.js → chunk.CVN2XFMF.js} +1 -1
  42. package/dist/preview/{chunk.MGG5DH2S.js → chunk.D4F6QX5L.js} +1 -1
  43. package/dist/preview/{chunk.M3HLZX6Q.js → chunk.D6ODKMOV.js} +1 -1
  44. package/dist/preview/{chunk.RECTEAG4.js → chunk.DDSAFU3B.js} +1 -1
  45. package/dist/preview/{chunk.UJF6YTEO.js → chunk.DG3YNOH3.js} +1 -1
  46. package/dist/preview/chunk.DGYWNM5U.js +1 -0
  47. package/dist/preview/{chunk.NBB5ALVJ.js → chunk.DHO3QZYK.js} +1 -1
  48. package/dist/preview/{chunk.4QBW46XV.js → chunk.DJGZOPAS.js} +1 -1
  49. package/dist/preview/{chunk.2MWEYNVH.js → chunk.DX7RGK5G.js} +1 -1
  50. package/dist/preview/{chunk.CZI6J5CE.js → chunk.EA2KYBBR.js} +1 -1
  51. package/dist/preview/{chunk.DWMFLLJO.js → chunk.EEGVI266.js} +1 -1
  52. package/dist/preview/{chunk.BQWMHHAZ.js → chunk.EHLV3LND.js} +2 -2
  53. package/dist/preview/{chunk.3MPLUSVY.js → chunk.EJC7ACZT.js} +1 -1
  54. package/dist/preview/{chunk.6NYSB6OZ.js → chunk.EJIQDMLU.js} +1 -1
  55. package/dist/preview/{chunk.QQUZ5RTQ.js → chunk.EOSN5DWW.js} +1 -1
  56. package/dist/preview/{chunk.2QALBEWP.js → chunk.EPSYX2SF.js} +1 -1
  57. package/dist/preview/chunk.EUXAIG73.js +1 -0
  58. package/dist/preview/{chunk.S4QSZRKH.js → chunk.EZQK23AB.js} +1 -1
  59. package/dist/preview/{chunk.ZTHZHBVN.js → chunk.F5O3HR7X.js} +1 -1
  60. package/dist/preview/chunk.F6MY6WJ4.js +1 -0
  61. package/dist/preview/{chunk.UVMHC6VM.js → chunk.F7KVEWFH.js} +1 -1
  62. package/dist/preview/{chunk.FJXKQZZS.js → chunk.FIUPDGUZ.js} +1 -1
  63. package/dist/preview/chunk.FNSVGSZI.js +1 -0
  64. package/dist/preview/chunk.FOHZPYUV.js +1 -0
  65. package/dist/preview/chunk.FW6M6GIU.js +32 -0
  66. package/dist/preview/{chunk.IJVR7ZL7.js → chunk.G5AF5IXL.js} +1 -1
  67. package/dist/preview/{chunk.SCN6IYDG.js → chunk.G767NLBH.js} +1 -1
  68. package/dist/preview/{chunk.X7HMTN3Z.js → chunk.GFBE4VNT.js} +1 -1
  69. package/dist/preview/{chunk.U5Q7EVZQ.js → chunk.GFOZVQBQ.js} +1 -1
  70. package/dist/preview/{chunk.KJAOJTZZ.js → chunk.GKYJQE5A.js} +1 -1
  71. package/dist/preview/{chunk.YCMMATFK.js → chunk.GOVRX2YX.js} +1 -1
  72. package/dist/preview/{chunk.U3CV227I.js → chunk.H33XWGAY.js} +1 -1
  73. package/dist/preview/{chunk.DGDOZHYK.js → chunk.H4BPTMED.js} +1 -1
  74. package/dist/preview/chunk.HLKDYI6J.js +1 -0
  75. package/dist/preview/{chunk.C4LC2UEU.js → chunk.HPFEYMGP.js} +1 -1
  76. package/dist/preview/{chunk.CLJKQLK2.js → chunk.HT35PAHI.js} +2 -2
  77. package/dist/preview/{chunk.6VG2LCES.js → chunk.HXRHEPPJ.js} +1 -1
  78. package/dist/preview/{chunk.LZNHTROY.js → chunk.IXYG65TM.js} +1 -1
  79. package/dist/preview/chunk.IZDB777E.js +1 -0
  80. package/dist/preview/{chunk.ZQSV5XVB.js → chunk.JAPTTM6Y.js} +1 -1
  81. package/dist/preview/{chunk.CUA7F3YJ.js → chunk.JCKIJSW7.js} +1 -1
  82. package/dist/preview/{chunk.WAIIXXVI.js → chunk.JLNTE5CH.js} +2 -2
  83. package/dist/preview/{chunk.5FQHZVE3.js → chunk.JNK5WBSU.js} +1 -1
  84. package/dist/preview/chunk.JREA2XDG.js +1 -0
  85. package/dist/preview/{chunk.CHG522KL.js → chunk.KBJ3UUER.js} +1 -1
  86. package/dist/preview/{chunk.VBHV4TLG.js → chunk.KHRS2SKB.js} +1 -1
  87. package/dist/preview/{chunk.CZUUFO6A.js → chunk.KJPLX72N.js} +1 -1
  88. package/dist/preview/{chunk.7LAXSQQY.js → chunk.KZUHXOZU.js} +2 -2
  89. package/dist/preview/{chunk.R65YX332.js → chunk.L3MLGFIS.js} +1 -1
  90. package/dist/preview/{chunk.RXUL6P7Y.js → chunk.L6P55HFW.js} +1 -1
  91. package/dist/preview/{chunk.J4NY2K2A.js → chunk.LDWWUKKX.js} +1 -1
  92. package/dist/preview/{chunk.RIP2SAQ5.js → chunk.LHCGC3K6.js} +1 -1
  93. package/dist/preview/{chunk.IQCMV5WD.js → chunk.LNKY6MT4.js} +1 -1
  94. package/dist/preview/chunk.LQ5J6YQW.js +1 -0
  95. package/dist/preview/{chunk.O2XPLDMM.js → chunk.MEAUTBVM.js} +1 -1
  96. package/dist/preview/chunk.MEBKTW7H.js +17 -0
  97. package/dist/preview/{chunk.K6EKSURO.js → chunk.MFMC35ET.js} +1 -1
  98. package/dist/preview/chunk.MJ4T6YXI.js +1 -0
  99. package/dist/preview/{chunk.SWY6DIE4.js → chunk.MKJV3BM5.js} +3 -3
  100. package/dist/preview/chunk.ML4X7VVK.js +1 -0
  101. package/dist/preview/{chunk.ZOSTOVXR.js → chunk.MM7MLBGB.js} +1 -1
  102. package/dist/preview/{chunk.NCBUECIW.js → chunk.MQNW3O67.js} +1 -1
  103. package/dist/preview/{chunk.CVVNHQPO.js → chunk.MT252WP4.js} +1 -1
  104. package/dist/preview/{chunk.VKQONZKR.js → chunk.MWWNKM3I.js} +1 -1
  105. package/dist/preview/chunk.N3MXLORL.js +3 -0
  106. package/dist/preview/{chunk.SUYYDJGZ.js → chunk.NH3VXTGX.js} +1 -1
  107. package/dist/preview/{chunk.IRPMGHZN.js → chunk.NI4OPHTL.js} +1 -1
  108. package/dist/preview/chunk.NNGG7RCO.js +1 -0
  109. package/dist/preview/{chunk.MZSWWMX6.js → chunk.NXHEOHRR.js} +1 -1
  110. package/dist/preview/{chunk.A5ENJJZN.js → chunk.O5RPSUXV.js} +1 -1
  111. package/dist/preview/{chunk.CM7EDQ4E.js → chunk.OKHXXIMN.js} +1 -1
  112. package/dist/preview/chunk.OOQG2AEF.js +1 -0
  113. package/dist/preview/{chunk.MYR36HW4.js → chunk.OPMGQS5J.js} +1 -1
  114. package/dist/preview/{chunk.TUVPQLFL.js → chunk.OUF2QFZL.js} +1 -1
  115. package/dist/preview/{chunk.6QMRDSTD.js → chunk.OVSKPBPS.js} +1 -1
  116. package/dist/preview/chunk.OYMN3IFX.js +1 -0
  117. package/dist/preview/{chunk.3HFBHLXC.js → chunk.P43LPXXJ.js} +1 -1
  118. package/dist/preview/{chunk.FSZQTX3K.js → chunk.PGT4ZQDG.js} +4 -4
  119. package/dist/preview/{chunk.5IM2X3VT.js → chunk.PQTXM4VY.js} +1 -1
  120. package/dist/preview/{chunk.U2DZE7A5.js → chunk.Q6GEPVQ7.js} +1 -1
  121. package/dist/preview/{chunk.HMV4ILAC.js → chunk.QDDDKEBH.js} +1 -1
  122. package/dist/preview/{chunk.6KYTCEIH.js → chunk.QJJWAYHB.js} +1 -1
  123. package/dist/preview/{chunk.QAERSZVB.js → chunk.QK4QZVQG.js} +1 -1
  124. package/dist/preview/{chunk.XAN7QXMQ.js → chunk.QKRQPUCE.js} +1 -1
  125. package/dist/preview/{chunk.I3ADXJQW.js → chunk.QNWGDG2Z.js} +1 -1
  126. package/dist/preview/{chunk.NZ5TJKPT.js → chunk.QVBP4UZG.js} +2 -2
  127. package/dist/preview/{chunk.YTRUZ56A.js → chunk.RDUGUC7R.js} +1 -1
  128. package/dist/preview/{chunk.TVNY7F64.js → chunk.RHIP2UYE.js} +1 -1
  129. package/dist/preview/{chunk.PYGNO2AV.js → chunk.RJ7VSWTA.js} +3 -3
  130. package/dist/preview/{chunk.LEZGBHPZ.js → chunk.RO3D2RNP.js} +1 -1
  131. package/dist/preview/{chunk.KOVTQCHX.js → chunk.S2BMI23H.js} +1 -1
  132. package/dist/preview/{chunk.XJ4JYROM.js → chunk.SPJ34VHA.js} +1 -1
  133. package/dist/preview/{chunk.LZ3HO3HM.js → chunk.T6KOL7TW.js} +1 -1
  134. package/dist/preview/{chunk.BJ3G7J2Z.js → chunk.T6UJEXFL.js} +3 -2
  135. package/dist/preview/{chunk.T4QRIJE4.js → chunk.TBEKEHFS.js} +1 -1
  136. package/dist/preview/chunk.TO3ZKCA2.js +1 -0
  137. package/dist/preview/{chunk.QILGAV7H.js → chunk.TQ3MNB6K.js} +1 -1
  138. package/dist/preview/{chunk.F5XWYO5W.js → chunk.TRP66PHK.js} +1 -1
  139. package/dist/preview/{chunk.QODVFVWE.js → chunk.TSZ2S3VG.js} +1 -1
  140. package/dist/preview/{chunk.DWPM7AWA.js → chunk.TTM5GQ2U.js} +1 -1
  141. package/dist/preview/chunk.TUBY6SV3.js +1 -0
  142. package/dist/preview/{chunk.7QWGIGHM.js → chunk.U5KJQFAP.js} +1 -1
  143. package/dist/preview/chunk.U6V4KZF5.js +1 -0
  144. package/dist/preview/chunk.UJ7RTNT4.js +1 -0
  145. package/dist/preview/{chunk.MR776WQ2.js → chunk.UQZ2P6KD.js} +1 -1
  146. package/dist/preview/{chunk.OXXZGPJZ.js → chunk.UZKBFI52.js} +1 -1
  147. package/dist/preview/{chunk.HIJ72QX6.js → chunk.V5JB5UJS.js} +1 -1
  148. package/dist/preview/{chunk.3I2SGKKF.js → chunk.VDFQFLTU.js} +1 -1
  149. package/dist/preview/{chunk.I6HIVTXU.js → chunk.VGYG2IBZ.js} +1 -1
  150. package/dist/preview/chunk.VICBF3MQ.js +2 -0
  151. package/dist/preview/{chunk.TD2V74XU.js → chunk.VL3YDD7D.js} +1 -1
  152. package/dist/preview/{chunk.A7JORJJL.js → chunk.VPFUOTY7.js} +1 -1
  153. package/dist/preview/{chunk.UWEFODVV.js → chunk.VUDNQOOX.js} +1 -1
  154. package/dist/preview/{chunk.YIDNZTON.js → chunk.VVIQSFM4.js} +1 -1
  155. package/dist/preview/{chunk.J65CZJIC.js → chunk.W332P5T3.js} +1 -1
  156. package/dist/preview/{chunk.S6IKR6RD.js → chunk.W3TJF4EH.js} +1 -1
  157. package/dist/preview/{chunk.7FTATAH2.js → chunk.W5O5F4FT.js} +1 -1
  158. package/dist/preview/chunk.W6L2VAJG.js +2 -0
  159. package/dist/preview/{chunk.QG3LV4RH.js → chunk.WGH2P2YL.js} +1 -1
  160. package/dist/preview/{chunk.KV3N6VRG.js → chunk.WS5ORRGS.js} +1 -1
  161. package/dist/preview/{chunk.7HNMG6LG.js → chunk.WU6D3SPL.js} +1 -1
  162. package/dist/preview/{chunk.MSWOETXN.js → chunk.X2UYEA7H.js} +1 -1
  163. package/dist/preview/{chunk.FBDCHJS2.js → chunk.X45EITTK.js} +1 -1
  164. package/dist/preview/{chunk.JIEBGUCA.js → chunk.X7U3JMBR.js} +1 -1
  165. package/dist/preview/chunk.XSM4OTF4.js +1 -0
  166. package/dist/preview/{chunk.5A5DI36V.js → chunk.XTHSPLZZ.js} +1 -1
  167. package/dist/preview/{chunk.TS5APXWC.js → chunk.Y5WQD6KV.js} +1 -1
  168. package/dist/preview/{chunk.3QPMFUMV.js → chunk.YXVUJ3NB.js} +1 -1
  169. package/dist/preview/{chunk.F5STM4DX.js → chunk.Z22C2JJ4.js} +1 -1
  170. package/dist/preview/{chunk.BBLA4PSP.js → chunk.Z2BCOZDZ.js} +1 -1
  171. package/dist/preview/{chunk.BZXJKWNI.js → chunk.Z3TK2LJM.js} +1 -1
  172. package/dist/preview/chunk.ZGLOXN7O.js +1 -0
  173. package/dist/preview/{chunk.UJM5EZDM.js → chunk.ZLQIGZXO.js} +1 -1
  174. package/dist/preview/{chunk.FUTSLXWN.js → chunk.ZONRIOIA.js} +1 -1
  175. package/dist/preview/{chunk.NTAC5NNE.js → chunk.ZY3NAJDM.js} +1 -1
  176. package/dist/preview/index.html +55 -55
  177. package/dist/preview/page.js +2 -2
  178. package/package.json +6 -6
  179. package/dist/preview/chunk.2QOB62XU.js +0 -1
  180. package/dist/preview/chunk.36FKQJFM.js +0 -2
  181. package/dist/preview/chunk.3A3DCALP.js +0 -1
  182. package/dist/preview/chunk.3GPYKWAD.js +0 -1
  183. package/dist/preview/chunk.3ZP6IDUC.js +0 -1
  184. package/dist/preview/chunk.53HW224Y.js +0 -1
  185. package/dist/preview/chunk.AW74DZ5V.js +0 -17
  186. package/dist/preview/chunk.CCCSZRKU.js +0 -1
  187. package/dist/preview/chunk.DBSSCJQM.js +0 -1
  188. package/dist/preview/chunk.DW6KXAUM.js +0 -1
  189. package/dist/preview/chunk.HHQUCFN4.js +0 -1
  190. package/dist/preview/chunk.HPWMCS3H.js +0 -23
  191. package/dist/preview/chunk.HRLCDBMO.js +0 -1
  192. package/dist/preview/chunk.I7ODVOO5.js +0 -1
  193. package/dist/preview/chunk.IANOWT3Z.js +0 -1
  194. package/dist/preview/chunk.IFPJPJ4M.js +0 -1
  195. package/dist/preview/chunk.IUVRJDL3.js +0 -5
  196. package/dist/preview/chunk.J4CSY2D5.js +0 -2
  197. package/dist/preview/chunk.JJIKTTXB.js +0 -1
  198. package/dist/preview/chunk.KDOJC4FX.js +0 -1
  199. package/dist/preview/chunk.KLZPUTMU.js +0 -1
  200. package/dist/preview/chunk.LQ2PDW2M.js +0 -32
  201. package/dist/preview/chunk.MNWP3TPN.js +0 -1
  202. package/dist/preview/chunk.NILR2BWR.js +0 -1
  203. package/dist/preview/chunk.NNYKLENL.js +0 -1
  204. package/dist/preview/chunk.PZHCWMKT.js +0 -1
  205. package/dist/preview/chunk.QVID5WHS.js +0 -1
  206. package/dist/preview/chunk.RHV73CBA.js +0 -3
  207. package/dist/preview/chunk.RP6C2IUM.js +0 -1
  208. package/dist/preview/chunk.RPHZY7N4.js +0 -1
  209. package/dist/preview/chunk.UYBSVE2W.js +0 -1
  210. package/dist/preview/chunk.WMZ2BINI.js +0 -1
  211. package/dist/preview/chunk.X2RHBTJI.js +0 -1
  212. package/dist/preview/chunk.X3FPVFFB.js +0 -1
  213. package/dist/preview/chunk.X4PFLIXB.js +0 -1
  214. package/dist/preview/chunk.YR7DKU5T.js +0 -1
  215. package/dist/preview/chunk.ZBK3FCVE.js +0 -1
  216. package/dist/preview/chunk.ZH5L746C.js +0 -1
@@ -1 +0,0 @@
1
- import{a as fe,b as Ne,d as Ze,e as He,f as he,g as F,h as ke,j as We}from"./chunk.DW6KXAUM.js";import{h as Je,i as Xe,j as Qe}from"./chunk.HRLCDBMO.js";import{a as ae,b as ce,c as J,d as Ye,e as ee,g as se,h as en}from"./chunk.36FKQJFM.js";import{c as Be,h as k,i as Ue,j as ze,t as ye}from"./chunk.RHV73CBA.js";import{A as re,Ja as Ie,Qa as Ke,Ra as Q,Rd as qe,Sa as me,Sd as Ve,b as Z,c as U,e as ue,f as Me,g as P,h as v,k as L,l as X,m as I,n as _e,o as H,p as N,r as w,s as oe,sc as Pe,t as R,tc as ge,u as j,uc as Le,v as G,vc as Ge,w as T,wc as Ce,x as n,y as M,z as Y}from"./chunk.IUVRJDL3.js";var be=e=>Object.entries(e).map(([s,i])=>[s,Object.keys(Q(i?.edges))]),we=(e,s)=>Le(e,be(s));function nn(e){return[...Object.keys(e.acts??{}),...Object.keys(e.kinds).flatMap(s=>Pe(s)),...Ge(be(e.kinds))]}var B=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function tn(e){if(!B(e)||!B(e.kinds))return e;let s;try{let f=Object.fromEntries(Object.entries(e.kinds).map(([g,l])=>[g,B(l)&&B(l.edges)?{edges:l.edges}:{}]));s=nn({acts:B(e.acts)?e.acts:{},kinds:f})}catch{return e}let i=new Set(s),t=!1,o=f=>{if(typeof f!="string"||i.has(f))return f;let g=qe(f,s);return g===void 0?f:(t=!0,g)},a=B(e.policy)&&Array.isArray(e.policy.grants)?{...e.policy,grants:e.policy.grants.map(f=>B(f)&&Array.isArray(f.mutations)?{...f,mutations:f.mutations.map(o)}:f)}:void 0,u=B(e.rules)?Object.fromEntries(Object.entries(e.rules).map(([f,g])=>[f,B(g)&&Array.isArray(g.repairs)?{...g,repairs:g.repairs.map(l=>B(l)?{...l,act:o(l.act)}:l)}:g])):void 0;return t?{...e,...a?{policy:a}:{},...u?{rules:u}:{}}:e}function $e(e,s){let i=Ve(e,nn(s));return i&&i!==e?`did you mean "${i}"?`:void 0}var Oe="graview-document",je=1,xe=256*1024,ne=64*1024,vn=["plain","editorial","shader","ascii"];var Se=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,ve=/^[a-z][A-Za-z0-9]*$/,On=/^[a-z0-9\u00df-\u00ff'-]+( [a-z0-9\u00df-\u00ff'-]+){0,2}$/,on=12,sn=60,jn=new Set(["id","kind"]),xn=/^(?:[a-z][a-z0-9]*(?:-[a-z0-9]+)*|[a-z][A-Za-z0-9]*)$/,An=["string","text","number","integer","boolean","date","datetime","enum","list","url","email","image","video","file","app-link","phone","place","duration"];function En(){let e=h=>h in Object.prototype,s=Y(h=>!e(h),"every object already has this name \u2014 choose another"),i=(h,D)=>[...h===void 0?[]:[Me(h)],...D===void 0?[]:[ue(D)]],t=(h,D)=>v().check(...i(h,D)),o=(h,D,te)=>N(h).check(...i(D,te)),a=h=>v().check(P(Se,`${h} names are kebab-case, lower-case words joined by hyphens like "tool-note" (field and relation names are camelCase, like "supersededBy")`)),u=v().check(P(xn,'relation names are one camelCase word, like "supersededBy" (kind names are kebab-case, like "tool-note")'),s),f=v().check(P(ve,'field names are one word or camelCase, like "dueDate", so rules say them bare (kind names are kebab-case, like "tool-note")'),Y(h=>!jn.has(h),'a field cannot be called "id" or "kind" \u2014 the framework keeps those; try "type" or "category"'),s),g=t(1,500),l=v().check(ue(40),P(On,'an alias is up to three lower-case words, like "supplier"')),r=t(1,2e3),p=t(1,300),y=w({type:G(An),required:n(I()),description:n(g),label:n(t(1,60)),aliases:n(o(l,1,on)),options:n(o(t(1,80),1,100)),multiple:n(I()),optionLabels:n(j(t(1,80),t(1,80))),of:n(G(["string","number","date","image","video","file"])),default:n(H()),unit:n(t(void 0,12)),format:n(G(["money","percent","duration","markdown"])),places:n(T(0)),min:n(L()),max:n(L()),step:n(L()),renamedFrom:n(v().check(P(ve))),repeats:n(I()),collaborative:n(I())}).check(re((h,D)=>{h.type==="enum"&&!h.options&&D.addIssue({code:"custom",message:'an enum field lists its "options"',path:["options"]}),h.type!=="enum"&&h.options&&D.addIssue({code:"custom",message:'"options" belongs only on an enum field',path:["options"]}),h.type!=="enum"&&h.multiple!==void 0&&D.addIssue({code:"custom",message:'"multiple" belongs only on an enum field: a choice that takes several of its options',path:["multiple"]});for(let te of Object.keys(h.optionLabels??{}))h.options?.includes(te)||D.addIssue({code:"custom",message:`"${te}" is labeled, and is none of the field's options`,path:["optionLabels",te]});h.type!=="list"&&h.of&&D.addIssue({code:"custom",message:'"of" belongs only on a list field',path:["of"]}),h.places!==void 0&&!(h.format==="money"||!h.format&&/^[A-Z]{3}$/.test(h.unit??""))&&D.addIssue({code:"custom",message:'"places" belongs only on money: a number field with "format": "money"',path:["places"]}),h.repeats&&h.type!=="date"&&h.type!=="datetime"&&D.addIssue({code:"custom",message:'"repeats" belongs only on a date or datetime field',path:["repeats"]})})),m=v().check(P(new RegExp(`${Se.source}|${Ie.source}`),'a relation goes to a kind of this document, like "house", or of another app, like "@nick/house/house"')),d=w({to:R([o(m,1),T("*")]),cardinality:n(G(["one","many"])),description:n(g),inverse:n(t(1,80)),appendOnly:n(I()),renamedFrom:n(v()),tidying:n(T("never"))}),c=R([r,w({expr:r,label:n(t(1,60)),description:n(g),format:n(G(["money","percent","duration"])),unit:n(t(1,12)),places:n(T(0)),hidden:n(I())})]),S=R([v(),L(),I(),_e(),N(H()),w({expr:r})]),b=w({noun:n(t(1,40)),plural:n(t(1,40)),aliases:n(o(l,1,on)),description:n(g),fields:j(f,y).check(Y(h=>Object.keys(h).length>0,"a kind has at least one field")),label:n(p),describe:n(p),lifecycle:n(w({field:f,retired:o(R([v(),L(),I()]),1)})),figure:n(t(void 0,2e4)),glance:n(o(f,1,20)),page:n(w({fields:n(o(f,1,40)),groups:n(o(w({title:t(1,60),fields:o(f,1,40)}),1,12))})),edges:n(j(u,d)),computed:n(j(v(),c).check(Y(h=>Object.keys(h).length<=sn,`a kind works out at most ${sn} computed fields`))),fieldRoles:n(j(v(),v())),renamedFrom:n(v().check(P(Se))),people:n(I()),archives:n(T(!1)),tidying:n(G(["never","no-links"])),derives:n(w({from:a("kind"),via:u,set:j(f,S)}))}),O=v().check(P(/^\$[A-Za-z][A-Za-z0-9]*$/,'a reference is "$" and a name, like "$subject" or "$new"')),x=R([w({create:a("kind"),as:n(v().check(P(ve))),set:n(j(f,S))}),w({set:j(f,S),target:n(O)}),w({connect:u,from:O,to:O}),w({sever:u,from:O,to:O}),w({remove:O})]),A=w({title:n(t(1,80)),description:n(g),fromTheOtherEnd:n(t(1,80)),on:n(R([a("kind"),o(a("kind"),1)])),creates:n(a("kind")),sets:n(j(f,S)),writes:n(o(f,1)),connects:n(u),severs:n(u),setsOther:n(j(f,S)),setsLinked:n(j(u,j(f,S))),replaces:n(R([T(!0),o(u,1,10)])),removes:n(T(!0)),args:n(j(f,y)),effects:n(o(x,1,20)),allowedWhen:n(r),refusal:n(p),destructive:n(I())}),$=w({act:a("act"),label:n(t(1,80)),args:n(j(v(),S))}),C=w({every:a("kind"),through:u,via:n(u)}),q=w({title:n(t(1,120)),description:n(g),over:R([T("graph"),a("kind")]),when:n(r),require:n(r),covers:n(C),says:n(p),repairs:n(o($,void 0,10))}).check(re((h,D)=>{!h.require&&!h.covers&&D.addIssue({code:"custom",message:'a rule says what must hold in "require", or what each record must be linked to in "covers"',path:["require"]}),h.require&&h.covers&&D.addIssue({code:"custom",message:'a rule is judged by "require" or by "covers", not both',path:["covers"]}),h.covers&&h.over==="graph"&&D.addIssue({code:"custom",message:'a coverage rule is over a kind, whose records it follows through their links; name the kind in "over"',path:["over"]})})),z=w({roles:R([o(a("role"),1),T("*")]),mutations:R([o(a("act")),T("*")]),kinds:n(R([N(a("kind")),T("*")])),describe:n(g),self:n(I()),ownEnd:n(I()),propose:n(R([o(a("act"),1),T("*")]))}).check(re((h,D)=>{Array.isArray(h.mutations)&&h.mutations.length===0&&h.propose===void 0&&D.addIssue({code:"custom",message:'a grant names at least one act in "mutations", or the acts it lets these roles propose in "propose"',path:["mutations"]})})),E=n(o(f,1)),_=w({roles:R([o(a("role"),1),T("*")]),kinds:o(a("kind"),1),own:n(I()),via:n(u),fields:E,hide:E}),ie=w({grants:N(z),sees:n(N(_))}),W=w({accent:n(v().check(P(/^#[0-9a-fA-F]{6}$/,'an accent is a color like "#c2577a"'))),ground:n(R([v().check(P(/^#[0-9a-fA-F]{6}$/,'a ground is a color like "#eef3f8"')),w({light:n(v().check(P(/^#[0-9a-fA-F]{6}$/,'a ground is a color like "#eef3f8"'))),dark:n(v().check(P(/^#[0-9a-fA-F]{6}$/,'a ground is a color like "#101826"')))})])),name:n(t(1,60)),currency:n(v().check(P(/^[A-Z]{3}$/,'a currency is its three-letter code, like "USD" or "EUR"'))),locale:n(t(2,35)),timeZone:n(t(1,64)),logo:n(R([t(1,ne),w({src:t(1,ne),alt:n(t(1,120))}),w({light:t(1,ne),dark:n(t(1,ne)),alt:n(t(1,120)),darkFallback:n(T("invert"))})])),favicon:n(R([t(1,ne),w({emoji:v()})])),typography:n(w({display:n(t(1,200)),body:n(t(1,200)),mono:n(t(1,200))})),shape:n(w({radius:n(L().check(U(0),Z(32))),density:n(L().check(U(.75),Z(1.5)))})),accents:n(j(v(),L().check(U(0),Z(360)))),scheme:n(G(["light","dark","auto"])),subtitle:n(T(!1)),splash:n(w({style:G(vn),image:n(t(1,ne)),title:n(t(1,80)),kicker:n(t(1,80)),shader:n(t(1,40)),scheme:n(G(["light","dark","device"]))})),views:n(w({css:n(t(1)),motion:n(G(["none","fade"])),fonts:n(N(w({family:t(1),src:t(1),weight:n(R([L(),v()])),style:n(G(["normal","italic"]))})))}))}),V=j(v(),H()),Fe=R([t(1,120),w({by:t(1,120),direction:n(G(["asc","desc"]))})]),De=L().check(X(),U(1),Z(9999)),hn=oe({create:n(I()),options:n(oe({sort:n(Fe),columnSort:n(Fe),search:n(o(t(1,120),void 0,40)),filters:n(o(t(1,120),void 0,40)),horizon:n(R([L().check(X(),U(1),Z(200)),oe({years:L().check(X(),U(1),Z(200)),title:t(1,80),from:n(De),to:n(De)})]))}))}),kn=w({card:n(N(H())),row:n(N(H())),page:n(N(H()))}),bn=()=>{let h=n(G(["asc","desc"]));return R([t(1,120),w({by:t(1,120),direction:h,then:n(R([t(1,120),w({by:t(1,120),direction:h})]))})])},wn=()=>R([t(1,120),w({by:t(1,120),order:n(o(t(1,80),void 0,40)),closed:n(o(t(1,80),void 0,40))})]),Te=oe({order:n(N(v())),hide:n(N(v())),first:n(v()),primary:n(o(t(1,80),void 0,40)),scene:n(t(1,40)),pages:n(t(1,40)),lists:n(j(v(),w({filters:n(o(t(1,120),void 0,40)),sort:n(bn()),group:n(wn()),export:n(I()),opens:n(t(1,80))})))}),$n=w({act:a("act"),title:n(t(1,80)),intro:n(g),fields:n(o(f,1,40)),say:n(g),submit:n(t(1,80)),role:n(a("role"))}),Sn=w({$schema:n(v()),format:T(Oe),formatVersion:T(je),name:t(1,80),description:n(g),version:n(L().check(X(),U(1))),kinds:j(a("kind"),b).check(Y(h=>Object.keys(h).length>0,"a document declares at least one kind"),Y(h=>Object.keys(h).length<=40,"a document declares at most 40 kinds")),computed:n(j(v(),c)),acts:n(j(a("act"),A)),rules:n(j(a("rule"),q)),roles:n(N(a("role"))),policy:n(ie),modules:n(V),lenses:n(N(hn)),pages:n(Te),views:n(j(v(),R([kn,N(H())]))),brand:n(W),settings:n(N(V)),migrations:n(N(V)),connections:n(j(a("connection"),V)),purpose:n(V),workflows:n(j(a("workflow"),V)),forms:n(j(a("form"),$n)),publishing:n(w({mode:G(["live","on-publish"]),working:o(a("role"),void 0,40),publishers:n(o(a("role"),1,40))})),tidying:n(w({autoAcceptAt:n(L().check(X(),U(1),Z(1e4)))}))});return{FieldSpec:y,EdgeSpec:d,ComputedSpec:c,KindSpec:b,ValueSpec:S,EffectSpec:x,ActSpec:A,RepairSpec:$,CoverSpec:C,RuleSpec:q,GrantSpec:z,SightSpec:_,PolicySpec:ie,BrandSpec:W,PagesSpec:Te,DocumentSpec:Sn}}var Rn,K=()=>Rn??=En(),Xn=M(()=>K().FieldSpec),Qn=M(()=>K().EdgeSpec),et=M(()=>K().ComputedSpec),nt=M(()=>K().KindSpec),tt=M(()=>K().ValueSpec),ot=M(()=>K().EffectSpec),st=M(()=>K().ActSpec),it=M(()=>K().RepairSpec),rt=M(()=>K().CoverSpec),at=M(()=>K().RuleSpec),ct=M(()=>K().GrantSpec),lt=M(()=>K().SightSpec),dt=M(()=>K().PolicySpec),pt=M(()=>K().BrandSpec),ft=M(()=>K().PagesSpec),rn=M(()=>K().DocumentSpec);var Fn={};function an(e,s=Fn,i=je){let{document:t,respelled:o}=Ne(e),a=o.length>0?{respelled:o}:{};if(!t||typeof t!="object"||Array.isArray(t))return{document:t};let u=t;if(u.format!==Oe||typeof u.formatVersion!="number"||u.formatVersion>=i)return{document:t,...a};let f=u.formatVersion,g=structuredClone(u);for(let l=f;l<i;l++){let r=s[l];if(!r)throw new Error(`there is no upgrade from format ${l} to ${l+1}`);g={...r(g),formatVersion:l+1}}return{document:g,from:f,...a}}function Ae(e,s,i){let t=Object.keys(e).filter(f=>e[f].edges?.[s]!==void 0);if(t.length===0)return;let o=t.map(f=>e[f].edges[s].to),a=o.some(f=>f==="*")?"*":[...new Set(o.flatMap(f=>f))];if(i.length===0||i.some(f=>t.includes(f)))return{reversed:!1,kinds:a};let u=t.filter(f=>{let g=e[f].edges[s].to;return g==="*"||i.every(l=>g.includes(l))});return u.length>0?{reversed:!0,kinds:u}:{reversed:!1,kinds:a}}var dn=(e,s)=>{let i=e?.fields[s];return i!==void 0&&(i.type==="duration"||(i.type==="number"||i.type==="integer")&&i.format==="duration")};function cn(e,s,i,t){if(t==="out"){let o=e[s]?.edges?.[i]?.to;return o===void 0?[]:o==="*"?Object.keys(e):o}return Object.entries(e).filter(([,o])=>{let a=o.edges?.[i]?.to;return a!==void 0&&(a==="*"||a.includes(s))}).map(([o])=>o)}function Ee(e,s,i){if(i.t==="ident")return e[s]?.edges?.[i.name]?cn(e,s,i.name,"out"):void 0;if(i.t==="where")return Ee(e,s,i.set);if(i.t==="call"&&(i.fn==="out"||i.fn==="in")&&i.args[0]?.t==="lit"&&typeof i.args[0].value=="string")return cn(e,s,i.args[0].value,i.fn)}var ln=(e,s,i)=>{let t=s.filter(o=>e[o]?.fields[i]!==void 0);return t.length>0&&t.every(o=>dn(e[o],i))};function pn(e,s,i){let t=e.kinds,o=t[s],a=new Map(i),u=new Map,f=(l,r)=>{if(r>8)return!1;switch(l.t){case"ident":return dn(o,l.name)||g(l.name,r+1);case"member":{let p=Ee(t,s,l.object);return p!==void 0&&ln(t,p,l.name)}case"call":{if(l.fn!=="sum"&&l.fn!=="min"&&l.fn!=="max")return!1;let[p,y]=l.args,m=p&&Ee(t,s,p);return m!==void 0&&y?.t==="ident"&&ln(t,m,y.name)}case"binary":return(l.op==="+"||l.op==="-")&&f(l.left,r)&&f(l.right,r);case"unary":return l.op==="-"&&f(l.operand,r);default:return!1}},g=(l,r)=>{if(o?.computed?.[l]===void 0)return!1;if(u.has(l))return u.get(l);u.set(l,!1);let p=a.get(l),y=p!==void 0&&f(p,r);return u.set(l,y),y};return i.map(([l])=>l).filter(l=>g(l,0))}var Dn="several choices";var Tn={title:["string","text"],rich_text:["string","text"],number:["number","integer"],select:["enum","string"],status:["enum","string"],multi_select:["list",Dn],date:["date","datetime"],checkbox:["boolean"],url:["url","string"],email:["email","string"],phone_number:["phone","string"],people:["string","text","list"]};var fn=new Set(Object.values(Tn).flat());function un(e,s){let i=new Map;if(!e||typeof e!="object")return new Map;let t=Object.values(e).flatMap(o=>o&&typeof o=="object"&&o.system==="notion"&&Array.isArray(o.sources)?o.sources.filter(a=>a&&typeof a=="object").map(a=>({system:"notion",kind:a.kind,properties:a.properties})):[o]);for(let o of t){if(!o||typeof o!="object"||typeof o.kind!="string")continue;let a=s[o.kind]?.fields;if(!a)continue;let u=[];o.system==="google-calendar"&&o.fields&&typeof o.fields=="object"?u=Object.values(o.fields).filter(g=>typeof g=="string"):o.system==="notion"&&(u=o.properties&&typeof o.properties=="object"?Object.keys(o.properties):Object.keys(a).filter(g=>fn.has(a[g].type)));let f=i.get(o.kind)??new Set;for(let g of u)Object.hasOwn(a,g)&&f.add(g);i.set(o.kind,f)}return new Map([...i].filter(([,o])=>o.size>0).map(([o,a])=>[o,Object.keys(s[o].fields).filter(u=>a.has(u))]))}function mn(e,s,i=`kinds.${e}.page`){let t=s.page;if(!t)return[];let o=[],a=[...Object.keys(s.fields),...Object.keys(s.computed??{})],u=new Set,f=(l,r)=>{a.includes(l)?u.has(l)&&o.push(k("page-field-twice",r,`"${l}" is on ${e}'s page twice; name each field once`)):o.push(k("page-field",r,`${e}'s page is to show "${l}", and ${e} has no field or computed field called that`,`use one of: ${a.join(", ")}`)),u.add(l)};(t.fields??[]).forEach((l,r)=>f(l,`${i}.fields.${r}`));let g=new Set;return(t.groups??[]).forEach((l,r)=>{let p=l.title.trim().toLowerCase();g.has(p)&&o.push(k("page-group-twice",`${i}.groups.${r}.title`,`${e}'s page has two groups called "${l.title}"; give each its own title`)),g.add(p),l.fields.forEach((y,m)=>f(y,`${i}.groups.${r}.fields.${m}`))}),o}function gn(e,s=[]){return Ce({declared:Object.keys(e.fields),paged:[...e.page?.fields??[],...(e.page?.groups??[]).flatMap(i=>i.fields)],must:i=>!!e.fields[i].required&&e.fields[i].default===void 0,naming:s})}var Nn=new Set(["subject","now","today","me"]);function Mn(e){if((typeof e=="string"?e:JSON.stringify(e??null)).length>xe)return{findings:[k("too-large","",`a document may be at most ${xe/1024} KB`)]};if(typeof e=="string")try{e=JSON.parse(e)}catch(t){return{findings:[k("not-json","",`this is not JSON: ${t.message}`)]}}try{e=an(e).document}catch(t){return{findings:[k("format","formatVersion",t.message)]}}e=tn(e);let s=rn.safeParse(e);if(!s.success)return{findings:s.error.issues.map(t=>{let o=t.path.map(String).join(".");if(t.code==="unrecognized_keys")return k("unknown-key",o,`${t.keys.map(a=>`"${a}"`).join(", ")} ${t.keys.length===1?"is":"are"} not part of a Graview document here`,"check the spelling against docs/declaration-document.md");if(t.code==="invalid_union"&&/\.effects\.\d+$/.test(o))return k("effect-shape",o,"this effect is not one Graview knows",'an effect is one of {"create": kind, "as"?: name, "set"?: {field: value}}, {"set": {field: value, \u2026}, "target"?: "$ref"}, {"connect"|"sever": relation, "from": "$ref", "to": "$ref"}, {"remove": "$ref"}');if(t.code==="invalid_key"){let a=t.issues?.[0]?.message;return k("shape",o,`the name "${String(t.path.at(-1))}" is not allowed here${a?`: ${a}`:""}`)}return k("shape",o,t.message)})};let i=s.data;return{document:i,findings:_n(i)}}var pe=e=>[e??[]].flat();function zn(e){let s=new Map;for(let[i,t]of Object.entries(e.kinds))for(let[o,a]of Object.entries(Q(t.edges))){let u=s.get(o);s.set(o,{name:o,from:[...u?.from??[],i],to:a.to==="*"||u?.to==="*"?"*":[...new Set([...u?.to??[],...a.to])],cardinality:a.cardinality??"many"})}return s}function Ht(e){let s=new Map;for(let[t,o]of Object.entries(e.kinds)){let a=se(o),u=me(o.edges);s.set(t,{fields:new Set([...Object.keys(o.fields),...u.keys()]),edges:new Map(Object.entries(Q(o.edges)).map(([f,g])=>[f,g.cardinality??"many"])),...a?{computed:a}:{},...u.size>0?{linked:u}:{}})}let i=se(e);return i&&s.set(Be,{computed:i}),s}function yn(e,s){let i=[],t=pe(e.on),o=(a,u)=>{let f=Ae(s.kinds,a,t)?.reversed===!0,[g,l]=f?["$to","$subject"]:["$subject","$to"];return u==="connect"?{connect:a,from:g,to:l}:{sever:a,from:g,to:l}};if(e.creates){let a=s.kinds[e.creates],u={};for(let f of Object.keys(a?.fields??{}))u[f]=`$${f}`;for(let f of e.effects??[])"set"in f&&!("create"in f)&&F(f.target)==="new"&&Object.assign(u,f.set);i.push({create:e.creates,as:"new",set:u})}if(e.sets&&i.push({set:e.sets}),e.writes&&!(e.creates&&e.on===void 0)&&i.push({set:Object.fromEntries(e.writes.map(a=>[a,`$${a}`]))}),e.connects&&(e.replaces&&i.push({replace:e.replaces===!0?[e.connects]:[...e.replaces],keep:e.connects}),i.push(o(e.connects,"connect"))),e.severs&&i.push(o(e.severs,"sever")),e.setsOther&&(e.connects||e.severs)&&i.push({set:e.setsOther,target:"$to"}),e.setsLinked&&t.length>0)for(let[a,u]of Object.entries(e.setsLinked))i.push({set:u,through:a});return e.removes&&i.push({remove:"$subject"}),e.effects&&i.push(...e.effects.filter(a=>!(e.creates&&"set"in a&&!("create"in a)&&F(a.target)==="new"))),i}function le(e,s,i){try{let t=J(e),o=ae(t);for(let a of o.unknownFunctions)i.push(k("unknown-function",s,`"${a}" is not a function the rule language knows`,"see the rule language in the graview-invariant skill"));return t}catch(t){if(t instanceof ce){i.push(k("expression",s,t.sentence+` (at character ${t.at+1})`));return}throw t}}function Re(e,s,i){try{return ee(e)}catch(t){if(t instanceof Ye||t instanceof ce){i.push(k("template",s,(t instanceof ce,t.sentence)));return}throw t}}function _n(e){let s=[],i=new Set(Object.keys(e.kinds)),t=zn(e),o=e.acts??{},a=new Set(e.roles??[]),u=(l,r)=>me(e.kinds[l]?.edges).has(r),f=l=>Object.keys(e.kinds).some(r=>u(r,l));for(let[l,r]of Object.entries(e.kinds)){let p=`kinds.${l}`;for(let[m,d]of Object.entries(r.edges??{})){if(!Ke(d)&&d.to!=="*")for(let c of d.to)i.has(c)||s.push(k("edge-target",`${p}.edges.${m}.to`,`"${c}" is not a kind this document declares`));r.fields[m]&&s.push(k("edge-field-clash",`${p}.edges.${m}`,`"${m}" is both a field and a relation of ${l}`,"rename one of them"))}r.lifecycle&&!r.fields[r.lifecycle.field]&&s.push(k("lifecycle-field",`${p}.lifecycle.field`,`${l} has no field "${r.lifecycle.field}"`));let y=m=>r.computed!==void 0&&Object.hasOwn(r.computed,m);for(let m of r.glance??[])!r.fields[m]&&!y(m)&&s.push(k("glance-field",`${p}.glance`,`a glance at ${l} is to say "${m}", and ${l} has no field or computed field called that`,`use one of: ${[...Object.keys(r.fields),...Object.keys(r.computed??{})].join(", ")}`));s.push(...mn(l,r));for(let m of["label","describe"]){let d=r[m];if(!d)continue;let c=Re(d,`${p}.${m}`,s);for(let S of c??[])if(S.expr){for(let b of ae(S.expr).names)if(!r.fields[b]){if(y(b)){en(r,b)||s.push(k("template-field",`${p}.${m}`,`${l}'s ${b} is worked out from beyond the record, and a ${m} is said with no graph to read`,`show it in a view instead, or name a computed field worked out from ${l}'s own fields`));continue}s.push(k("template-field",`${p}.${m}`,`${l} has no field "${b}" for its ${m} to show`,m==="label"?"a label can only show the record's own fields and what they work out":void 0))}}}for(let[m,d]of Object.entries(r.derives?.set??{}))fe(d)&&"expr"in d&&le(String(d.expr),`${p}.derives.set.${m}`,s);for(let[m,d]of Object.entries(r.fields)){if(d.default!==void 0&&d.type==="enum"){let b=(d.multiple?Array.isArray(d.default)?d.default:[d.default]:[d.default]).find(O=>!d.options?.includes(String(O)));(b!==void 0||!d.multiple&&Array.isArray(d.default))&&s.push(k("default-option",`${p}.fields.${m}.default`,`"${String(b??d.default)}" is not one of ${m}'s options`))}let c=`${m}Repeat`;d.repeats&&(r.fields[c]||r.edges?.[c]||r.computed?.[c])&&s.push(k("repeat-clash",`${p}.fields.${m}.repeats`,`${l} already has "${c}", where how ${m} repeats is kept`))}}for(let[l,r]of Object.entries(o)){let p=`acts.${l}`;for(let c of pe(r.on))i.has(c)||s.push(k("act-kind",`${p}.on`,`"${c}" is not a kind this document declares`));let y=pe(r.on),m=yn(r,e);if(r.creates&&r.on===void 0&&r.writes&&i.has(r.creates)){for(let c of r.writes)if(!e.kinds[r.creates].fields[c])if(e.kinds[r.creates].computed?.[c]!==void 0)s.push(k("computed-written",`${p}.writes`,`${r.creates}'s ${c} is worked out, not written: no act can set it`,"write the stored fields it is worked out from"));else{if(u(r.creates,c))continue;s.push(k("act-field",`${p}.writes`,`${r.creates} has no field "${c}"`))}}m.length===0&&s.push(k("act-empty",p,`"${l}" does nothing`,"give it effects or a shorthand such as sets or creates"));let d=new Map;m.forEach((c,S)=>{let b=m.length-(r.effects?.length??0),O=r.effects&&S>=b?`${p}.effects.${S-b}`:p;if("create"in c){if(!i.has(c.create))s.push(k("act-kind",`${O}.create`,`"${c.create}" is not a kind this document declares`));else for(let $ of Object.keys(c.set??{}))e.kinds[c.create].fields[$]||(e.kinds[c.create].computed?.[$]!==void 0?s.push(k("computed-written",`${O}.set.${$}`,`${c.create}'s ${$} is worked out, not written: no act can set it`,"set the stored fields it is worked out from")):s.push(k("act-field",`${O}.set.${$}`,`${c.create} has no field "${$}"`)));c.as&&d.set(c.as,c.create)}else if("connect"in c||"sever"in c){let $="connect"in c?c.connect:c.sever;!t.has($)&&!f($)&&s.push(k("act-edge",`${O}.${"connect"in c?"connect":"sever"}`,`"${$}" is not a relation any kind declares`)),F(c.from)==="subject"&&y.length===0&&s.push(k("act-subject",`${p}.on`,`"${l}" acts on "$subject" but does not say which kinds it is "on"`))}else if(!("through"in c))if("set"in c){let $=F(c.target??"$subject"),C=$==="subject"?y:d.has($??"")?[d.get($)]:[];$==="subject"&&y.length===0&&s.push(k("act-subject",`${p}.on`,`"${l}" changes "$subject" but does not say which kinds it is "on"`));for(let q of Object.keys(c.set))for(let z of C)if(!(!i.has(z)||e.kinds[z].fields[q]))if(e.kinds[z].computed?.[q]!==void 0)s.push(k("computed-written",`${O}.set.${q}`,`${z}'s ${q} is worked out, not written: no act can set it`,"set the stored fields it is worked out from"));else{if(u(z,q))continue;s.push(k("act-field",`${O}.set.${q}`,`${z} has no field "${q}"`))}}else"remove"in c&&F(c.remove)==="subject"&&y.length===0&&s.push(k("act-subject",`${p}.on`,`"${l}" removes "$subject" but does not say which kinds it is "on"`));let x="set"in c&&c.set?Object.values(c.set):[],A="through"in c?`${p}.setsLinked.${c.through}`:`${O}.set`;x.forEach($=>{$&&typeof $=="object"&&!Array.isArray($)&&"expr"in $&&le($.expr,A,s)})}),r.allowedWhen&&le(r.allowedWhen,`${p}.allowedWhen`,s),r.refusal&&Re(r.refusal,`${p}.refusal`,s)}for(let[l,r]of Object.entries(e.rules??{})){let p=`rules.${l}`;r.over!=="graph"&&!i.has(r.over)&&s.push(k("rule-kind",`${p}.over`,`"${r.over}" is not a kind this document declares`));let y=r.over==="graph"?void 0:e.kinds[r.over];if(r.covers&&y){let m=ye(r.over,r.covers,d=>t.get(d),d=>i.has(d));if("problem"in m){let{key:d,message:c,fix:S}=m.problem;d==="every"?s.push(k("rule-kind",`${p}.covers.every`,c,S)):s.push(k("rule-covers-relation",`${p}.covers.${d}`,c,S))}}for(let m of["when","require"]){let d=r[m];if(!d)continue;let c=le(d,`${p}.${m}`,s);if(!c)continue;let S=ae(c);for(let b of S.names)if(r.over==="graph")s.push(k("rule-name",`${p}.${m}`,`"${b}" means nothing in a rule over the whole graph`,`name a kind in "over", or use all('kind')`));else if(y&&!y.fields[b]&&!y.edges?.[b]&&y.computed?.[b]===void 0){let O=Object.keys(y.edges??{}).find(x=>x.includes("-")&&x.split("-").includes(b));s.push(k("rule-name",`${p}.${m}`,`${r.over} has no field or relation called "${b}"`,O?`"${O}" reads as a subtraction in a rule; rename the relation to one camelCase word, like "${O.replace(/-([a-z0-9])/g,(x,A)=>A.toUpperCase())}"`:void 0))}for(let b of S.edges)!t.has(b)&&!f(b)&&s.push(k("rule-edge",`${p}.${m}`,`"${b}" is not a relation any kind declares`));for(let b of S.sweeps)i.has(b)?r.over!=="graph"&&s.push(Ue("rule-cost",`${p}.${m}`,`this rule looks at every ${b} for every ${r.over}, which grows slowly as the app grows`,"walk a relation with out()/in() instead of all() where you can")):s.push(k("rule-kind",`${p}.${m}`,`"${b}" is not a kind this document declares`))}r.says&&Re(r.says,`${p}.says`,s),(r.repairs??[]).forEach((m,d)=>{!o[m.act]&&!ge(m.act)&&!we(m.act,e.kinds)&&s.push(k("repair-act",`${p}.repairs.${d}.act`,`"${m.act}" is not an act this document declares`,$e(m.act,e)))})}let g=e.policy;return g&&(g.grants.forEach((l,r)=>{if(l.roles!=="*"&&a.size>0)for(let p of l.roles)a.has(p)||s.push(k("grant-role",`policy.grants.${r}.roles`,`"${p}" is not one of the document's roles`));for(let p of["mutations","propose"]){let y=l[p];if(y!==void 0&&y!=="*")for(let m of y)!o[m]&&!ge(m)&&!we(m,e.kinds)&&s.push(k("grant-act",`policy.grants.${r}.${p}`,`"${m}" is not an act this document declares`,$e(m,e)))}}),(g.sees??[]).forEach((l,r)=>{for(let p of l.kinds)i.has(p)||s.push(k("sight-kind",`policy.sees.${r}.kinds`,`"${p}" is not a kind this document declares`));if(l.roles!=="*"&&a.size>0)for(let p of l.roles)a.has(p)||s.push(k("sight-role",`policy.sees.${r}.roles`,`"${p}" is not one of the document's roles`))})),s.push(...Qe(e)),s}function In(e){return e.label?[...e.label.matchAll(/\{\s*([A-Za-z_][A-Za-z0-9_]*)/g)].map(s=>s[1]):[ke(e)??[]].flat()}function Kn(e,s,i,t){let o=new Map,a=pe(e.on),u=new Map,f=new Map;(a.length>0||s.some(d=>"remove"in d&&F(d.remove)==="subject"||"from"in d&&(F(d.from)==="subject"||F(d.to)==="subject")||"set"in d&&!("create"in d)&&!("through"in d)&&F(d.target??"$subject")==="subject"||"through"in d))&&o.set(he,{ref:a.length>0?a:"*",required:!0});let l=e.args??{},r=e.writes?.length===1,p=(d,c)=>c&&d.type===c.type&&d.min===void 0&&d.max===void 0&&d.step===void 0?{...d,...c.min===void 0?{}:{min:c.min},...c.max===void 0?{}:{max:c.max},...c.step===void 0?{}:{step:c.step}}:d,y=(d,c)=>c&&d.type===c.type&&d.format===void 0&&d.unit===void 0?{...p(d,c),...c.format?{format:c.format}:{},...c.unit?{unit:c.unit}:{}}:p(d,c),m=(d,c,S)=>{if(d===he||Nn.has(d)||u.has(d)||o.has(d))return;let b=l[d]?y(l[d],S):void 0;o.set(d,b?{field:b,optional:!b.required,required:!!b.required}:c())};for(let d of s)if("create"in d){let c=i.kinds[d.create],S=c?gn(c,In(c)):[],b=O=>S.includes(O)?S.indexOf(O):S.length;for(let[O,x]of Object.entries(d.set??{}).sort(([A],[$])=>b(A)-b($))){let A=F(x),$=c?.fields[O];if(A&&$){let C=!!$.required&&$.default===void 0;m(A,()=>({field:$,optional:!C,required:C}),$)}}d.as&&u.set(d.as,d.create)}else if("connect"in d||"sever"in d){let c="connect"in d?d.connect:d.sever,S=t.get(c),b=F(d.from)==="subject"&&a.length>0?a.map(x=>Q(i.kinds[x]?.edges)[c]?.to):[],O=b.length>0&&b.every(Boolean)?b.includes("*")?"*":[...new Set(b.flat())]:void 0;for(let[x,A]of[["from",d.from],["to",d.to]]){let $=F(A);if(!$)continue;let C=x==="to"?O??S?.to??"*":S?.from??"*";C!=="*"&&!f.has($)&&f.set($,C),m($,()=>({ref:C,required:!0}))}}else if("through"in d){let c=Ae(i.kinds,d.through,a),S=c&&c.kinds!=="*"?c.kinds[0]:void 0;for(let[b,O]of Object.entries(d.set)){let x=F(O);if(!x||x==="to")continue;let A=S?i.kinds[S]?.fields[b]:void 0;m(x,()=>A?{field:A,optional:!0,required:!1}:{any:!0,required:!1},A)}}else if("set"in d){let c=F(d.target??"$subject"),S=c==="subject"?a[0]:u.get(c??"")??f.get(c??"")?.[0];c&&c!=="subject"&&!u.has(c)&&m(c,()=>({ref:"*",required:!0}));for(let[b,O]of Object.entries(d.set)){let x=F(O);if(!x)continue;let A=S?i.kinds[S]?.fields[b]:void 0;m(x,()=>A?{field:A,optional:!r,required:r}:{any:!0,required:!1},A)}}else if("remove"in d){let c=F(d.remove);c&&m(c,()=>({ref:"*",required:!0}))}for(let[d,c]of Object.entries(l))o.has(d)||o.set(d,{field:c,optional:!c.required,required:!!c.required});return o}function Wt(e,s={}){let i=Mn(e);if(!i.document||ze(i.findings))return{ok:!1,findings:i.findings};let t=i.document,o=[...i.findings];s.previous&&o.push(...Gn(t,s.previous));let a=Ln(t,o);return ze(a.findings)?{ok:!1,findings:a.findings}:We(a,s)}function de(e,s,i){return e.map(t=>{if(t.format||t.expr?.t!=="ident")return t;let o=t.expr.name,a=i?.[o],u=s?.[o]??(typeof a=="object"?a:void 0),f=u?.format;return f==="money"||f==="percent"?{...t,format:f,...f==="money"&&u?.places===0?{formatArgs:["0"]}:{}}:t})}function Pn(e,s,i){let t=i.kinds[e]?.edges?.[s.via]!==void 0?"to":"from",o=i.kinds[s.from],a=[],u={};for(let[f,g]of Object.entries(s.set))if(fe(g)&&"expr"in g){let l=J(g.expr);a.push([f,{expr:l}]),l.t==="ident"&&o?.fields[l.name]&&(u[f]=l.name)}else a.push([f,{value:typeof g=="string"&&g.startsWith("$$")?g.slice(1):g}]);return{from:s.from,via:s.via,sourceEnd:t,set:a,back:u}}function Ln(e,s){let i=zn(e),t={},o=un(e.connections,e.kinds);for(let[r,p]of Object.entries(e.kinds)){let y=ke(p),m=p.label??(y?`{${y}}`:void 0),d=se(p),c=d?pn(e,r,[...d]):[];t[r]={...m?{label:de(ee(m),p.fields,p.computed)}:{},...p.describe?{describe:de(ee(p.describe),p.fields,p.computed)}:{},...d?{computed:[...d]}:{},...c.length>0?{durations:c}:{},...o.has(r)?{keptInStep:o.get(r)}:{},...p.derives?{derives:Pn(r,p.derives,e)}:{}}}let a={};for(let[r,p]of Object.entries(e.acts??{})){let y=yn(p,e),m=Kn(p,y,e,i),d=p.destructive??y.some(z=>"remove"in z||"sever"in z||"replace"in z),c=[...new Set(y.flatMap(z=>"create"in z?[z.create]:[]))],S=[...new Set(y.flatMap(z=>"connect"in z?[z.connect]:[]))],b=[...new Set(y.flatMap(z=>"sever"in z?[z.sever]:"replace"in z?z.replace:[]))],O=[...new Set(y.flatMap(z=>"set"in z&&!("create"in z)&&!("through"in z)&&F(z.target??"$subject")==="subject"?Object.keys(z.set):[]))],x=new Map;for(let z of y){if(!("connect"in z)&&!("sever"in z))continue;let E=i.get("connect"in z?z.connect:z.sever);for(let[_,ie]of[["from",z.from],["to",z.to]]){let W=F(ie),V=_==="to"?E?.to:E?.from;W&&W!=="subject"&&V&&V!=="*"&&x.set(W,[...new Set([...x.get(W)??[],...V])])}}let A={};for(let z of y){if(!("set"in z)||"create"in z||"through"in z)continue;let E=F(z.target??"$subject");for(let _ of E&&E!=="subject"&&x.get(E)||[])A[_]=[...new Set([...A[_]??[],...Object.keys(z.set)])]}let $={};for(let z of y)if(!(!("set"in z)||"create"in z||"through"in z||F(z.target??"$subject")!=="subject"))for(let[E,_]of Object.entries(z.set??{}))typeof _=="string"&&F(_)===void 0||typeof _=="number"||typeof _=="boolean"?$[E]=typeof _=="string"&&_.startsWith("$$")?_.slice(1):_:delete $[E];let C=c.length===0&&y.every(z=>!("set"in z)||!z.set||Object.values(z.set).every(E=>!(E&&typeof E=="object"&&!Array.isArray(E)&&"expr"in E))),q=new Map;for(let z of y)if(!(!("set"in z)||!z.set))for(let E of Object.values(z.set))E&&typeof E=="object"&&!Array.isArray(E)&&"expr"in E&&q.set(E.expr,J(E.expr));a[r]={title:p.title??r.replace(/-/g," "),effects:y,args:[...m],...p.allowedWhen?{guard:J(p.allowedWhen)}:{},...p.refusal?{refusal:de(ee(p.refusal),e.kinds[[p.on??[]].flat()[0]??""]?.fields)}:{},exprs:[...q],destructive:d,idempotent:C,creates:c,connects:S,severs:b,writes:O,writesOther:A,sets:$}}let u={};for(let[r,p]of Object.entries(e.rules??{})){let y=p.covers&&p.over!=="graph"?ye(p.over,p.covers,m=>i.get(m),m=>m in e.kinds):void 0;u[r]={title:p.title??r.replace(/-/g," "),...p.require?{require:J(p.require)}:{},...y&&"plan"in y?{covers:y.plan}:{},...p.when?{when:J(p.when)}:{},...p.says?{says:de(ee(p.says),e.kinds[p.over]?.fields)}:{}}}let f=Ze(e,s),g=Je(e),l=Xe(e);return{format:He,document:e,findings:s,kinds:t,...e.computed?{facts:[...se(e)??[]]}:{},edges:[...i].map(([r,{from:p,to:y,cardinality:m}])=>[r,{from:p,to:y,cardinality:m}]),acts:a,rules:u,brand:f,...Object.keys(g).length>0?{viewSpecs:g}:{},...l?{home:l}:{}}}function Yt(e,s,i){let t=/^defineNode\("([^"]+)"\)/.exec(s)?.[1],o=t?i.kinds[t]:void 0;if(!t||!o)return e;let a=Object.keys(o.fields).filter(u=>u!=="label").slice(0,3);return{...e,path:`kinds.${t}.glance`,fix:`Say which: "glance": [${a.map(u=>`"${u}"`).join(", ")}] on kinds.${t} \u2014 the facts a person compares one by, at a glance.`}}function Gn(e,s){let i=[],t=new Set(Object.values(s.kinds).flatMap(o=>Object.keys(o.edges??{})));for(let[o,a]of Object.entries(e.kinds)){let u=a.renamedFrom;u&&!s.kinds[u]&&i.push(k("renamed-from-nothing",`kinds.${o}.renamedFrom`,`${o} says it was ${u}, and the previous version has no kind called ${u}`,"name the kind it was, or drop renamedFrom"));let f=s.kinds[u??o];for(let[g,l]of Object.entries(a.fields)){let r=l.renamedFrom;r&&!f?.fields[r]&&i.push(k("renamed-from-nothing",`kinds.${o}.fields.${g}.renamedFrom`,`${g} says it was ${r}, and the previous ${u??o} has no field called ${r}`,"name the field it was, or drop renamedFrom"))}for(let[g,l]of Object.entries(a.edges??{})){let r=l.renamedFrom;r&&!t.has(r)&&i.push(k("renamed-from-nothing",`kinds.${o}.edges.${g}.renamedFrom`,`${g} says it was ${r}, and the previous version has no relation called ${r}`,"name the relation it was, or drop renamedFrom"))}}return i}export{Mn as a,Ht as b,yn as c,Wt as d,Yt as e};
@@ -1 +0,0 @@
1
- import{a,b}from"./chunk.53HW224Y.js";import"./chunk.RECTEAG4.js";import"./chunk.NKUNCQB3.js";import"./chunk.HMV4ILAC.js";import"./chunk.XAN7QXMQ.js";import"./chunk.CHG522KL.js";import"./chunk.IRPMGHZN.js";import"./chunk.7QWGIGHM.js";import"./chunk.HRLCDBMO.js";import"./chunk.LZNHTROY.js";import"./chunk.36FKQJFM.js";import"./chunk.RHV73CBA.js";import"./chunk.ZGJUCVT5.js";import"./chunk.CVVNHQPO.js";import"./chunk.YIDNZTON.js";import"./chunk.QILGAV7H.js";import"./chunk.I6HIVTXU.js";import"./chunk.IUVRJDL3.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{b as actOnSeveral,a as actsForSeveral};