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
@@ -1,2 +1,2 @@
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 _t,b as sr,c as cr,d as dr,e as lr,f as Wt,g as ur,h as Dt}from"./chunk.VXPEXUQF.js";import{a as lo}from"./chunk.PZ3KM3TY.js";import{a as fr,b as pr,c as qt,d as mr,e as zt,f as yr,g as gr,h as wr,i as Gt,j as vr,k as br,l as Sr,m as Ar,n as Pr,o as Rr,p as Er,q as kr,r as Tr,s as xr,t as Fr,u as Ye}from"./chunk.NSAGOOJW.js";import{b as hr}from"./chunk.CA2SYEYE.js";import{c as jt}from"./chunk.6ZFYFT5A.js";import{a as Ft}from"./chunk.Q5WEOX3Q.js";import{b as Ot,i as Bn}from"./chunk.SAWASNDO.js";import{k as ct}from"./chunk.TLPCYKLW.js";import{C as It,F as rr,K as or,O as ar,P as ir,k as Qn,n as Zn,o as Xn,p as $t,q as er,s as tr,w as nr}from"./chunk.NLZHNPDU.js";import{c as co}from"./chunk.QNC2OKLF.js";import{Ba as Dn,Ca as jn,Da as qn,Ea as zn,Fa as Gn,G as Nn,Ha as Un,Ia as Kn,Ka as Jn,La as Vt,Oa as Yn,Ra as ut,W as Vn,a as Mn,aa as $n,b as dt,c as lt,j as Hn,ja as In,ka as _n,m as Nt,ma as Wn}from"./chunk.FWXW4T4I.js";import{a as Me}from"./chunk.SDO3U72B.js";import{Ae as Ln,Be as Ht,Ed as En,Fb as Sn,Fd as kn,Nd as Tn,Ob as An,Pd as xn,Qb as Pn,Qd as Fn,Sd as st,mb as qe,oe as Te,pe as On,qe as Cn,ve as Lt,we as Bt,xb as it,xc as Ct,xe as Mt,yc as Rn}from"./chunk.DHPXRDT5.js";import"./chunk.FQLNBIQ5.js";import{b as je}from"./chunk.AJZBJBMO.js";async function ft(t,r={}){let o=t.compiled===void 0||!fo(t.compiled,t.document)?void 0:Bn(t.compiled,r);if(o?.ok)return o;let{compileDocumentWithoutCheck:i}=await uo();return i(t.document,r)}var Or,uo=()=>Or??=(__graviewPreload(import.meta.url,["./chunk.MATUPDZ3.js","./chunk.SAWASNDO.js","./chunk.DKUEZPGR.js","./chunk.I7KN732Z.js","./chunk.TLPCYKLW.js","./chunk.DHPXRDT5.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.MHHNO3O2.js")).catch(t=>{throw Or=void 0,t});function fo(t,r){let o=typeof t=="object"&&t!==null?t.document:void 0,i=r;if(typeof i=="string")try{i=JSON.parse(i)}catch{return!1}return o!==void 0&&Ft(Ot(o).document)===Ft(Ot(i).document)}var d=je(Nn(),1);var mt=je(Nn(),1),Ut="data-graview-drawn",po=200,Cr=50,mo=1e4,pt=()=>typeof performance<"u"?performance.now():Date.now();function ho(t){let r=[...t.querySelectorAll("img")];for(let o of t.querySelectorAll("[data-worker-view]"))o.shadowRoot&&r.push(...o.shadowRoot.querySelectorAll("img"));return r}function yo(t,r){if(t.ownerDocument.fonts?.status==="loading"||Dn()>0||Gn(r)>0||t.querySelector('[aria-busy="true"]')||ho(t).some(i=>!i.complete&&i.loading!=="lazy"))return!1;for(let i of t.querySelectorAll("[data-worker-view-place]"))if(!i.querySelector("[data-worker-view][data-worker-view-drawn], [data-worker-view][data-worker-view-failed]"))return!1;return!0}function Lr(t){let r=t.querySelector("[data-embed-content]"),o=[...t.querySelectorAll("[data-worker-view]")].map(i=>`${i.offsetWidth}x${i.offsetHeight}`);return`${t.scrollWidth}x${t.scrollHeight}|${r?`${r.scrollWidth}x${r.scrollHeight}`:""}|${o.join(",")}`}function go(t,r,o,i){t.removeAttribute(Ut);let l=t.ownerDocument.defaultView;if(!l)return()=>{};let p=pt(),c=p,b=Lr(t),h=!1,k,O=typeof MutationObserver>"u"?void 0:new MutationObserver(x=>{x.some(C=>!(C.target===t&&C.attributeName===Ut))&&(c=pt())});O?.observe(t,{childList:!0,subtree:!0,characterData:!0,attributes:!0});let I=()=>{h=!0,O?.disconnect(),k!==void 0&&clearTimeout(k)},S=x=>{let C=!1,re=()=>{C||(C=!0,x())};typeof l.requestAnimationFrame=="function"&&l.requestAnimationFrame(()=>setTimeout(re,0)),setTimeout(re,100)},T=()=>{if(h)return;let x=Lr(t);x!==b&&(b=x,c=pt());let C=pt();if(yo(t,i)&&C-c>=po||C-p>=mo){S(()=>{h||(I(),t.setAttribute(Ut,r),Kn(),o())});return}k=setTimeout(T,Cr)};return k=setTimeout(T,Cr),I}function Br(t,r,o,i,l){Un();let p=(0,mt.useRef)({place:o,onDrawn:i});p.current={place:o,onDrawn:i},(0,mt.useLayoutEffect)(()=>{l&&zn(l);let c=k=>go(k,p.current.place.path,()=>p.current.onDrawn?.(p.current.place),l);if(t.current)return c(t.current);let b,h=!1;return queueMicrotask(()=>{!h&&t.current&&(b=c(t.current))}),()=>{h=!0,b?.()}},[r,t,l])}var Nr=je(lo(),1);var F=je(co(),1);var w=je(Vn(),1);function ht(t,r={}){let o=Vt(t);return{Face:o.part((l,p)=>(0,d.createElement)(l,p),r),fetch:()=>o.load().then(()=>{}),here:()=>o.current!==void 0||o.failed}}var Yt=t=>Promise.all([t,ar()]).then(([r])=>r),Vr=Me(()=>(__graviewPreload(import.meta.url,["./chunk.JQEXH23N.js","./chunk.4RPKCW4J.js","./chunk.4R7H3GIL.js","./chunk.AUNQNTKY.js","./chunk.PJL3I2IW.js","./chunk.YJ4PFOPC.js","./chunk.LKM2R5UF.js","./chunk.HJCQ6I3S.js","./chunk.EL7XXGQY.js","./chunk.CDSHUWSK.js","./chunk.6XBQDXT6.js","./chunk.JN3WZGJY.js","./chunk.CYEPHT7V.js","./chunk.U5P23GO7.js","./chunk.JHAMSDAI.js","./chunk.B5EFNTDA.js","./chunk.47VEV4BX.js","./chunk.FE3SINPK.js","./chunk.MUWI54IP.js","./chunk.3D37E2G5.js","./chunk.WFJCC6G3.js","./chunk.BIDL7GQD.js","./chunk.IO5VFTXC.js","./chunk.7L3I776Z.js","./chunk.CLIC2QBA.js","./chunk.NSAGOOJW.js","./chunk.CA2SYEYE.js","./chunk.Q5WEOX3Q.js","./chunk.MATUPDZ3.js","./chunk.SAWASNDO.js","./chunk.HCX6KPRF.js","./chunk.DKUEZPGR.js","./chunk.EP7YT7LT.js","./chunk.I7KN732Z.js","./chunk.TLPCYKLW.js","./chunk.MIE4TJRW.js","./chunk.SCVKHGO3.js","./chunk.RD2FSSLV.js","./chunk.AZRICZKT.js","./chunk.MH3AQO2R.js","./chunk.J2N7EKMX.js","./chunk.P26ATAAI.js","./chunk.FIY4RUK5.js","./chunk.IY3DV52G.js","./chunk.NLZHNPDU.js","./chunk.QNC2OKLF.js","./chunk.FWXW4T4I.js","./chunk.SDO3U72B.js","./chunk.DHPXRDT5.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.6BNSDPZE.js"))),wo=Me(()=>(__graviewPreload(import.meta.url,["./chunk.HGH27XZG.js","./chunk.NRECR3NQ.js","./chunk.T2BZBR7S.js","./chunk.HMJXB6KC.js","./chunk.Q355UPFG.js","./chunk.JQEXH23N.js","./chunk.O7NYSO6F.js","./chunk.I7OFRF6N.js","./chunk.4RPKCW4J.js","./chunk.IRNEWNUB.js","./chunk.AUNQNTKY.js","./chunk.KLEKC4ZX.js","./chunk.PJL3I2IW.js","./chunk.LMZ2WMGH.js","./chunk.OD5QZHRC.js","./chunk.YJ4PFOPC.js","./chunk.LKM2R5UF.js","./chunk.MB7LKKUD.js","./chunk.26RYER7Y.js","./chunk.CYEPHT7V.js","./chunk.5MOXQUZH.js","./chunk.MKN7ADJB.js","./chunk.I4H2GS4O.js","./chunk.FE3SINPK.js","./chunk.MUWI54IP.js","./chunk.3D37E2G5.js","./chunk.IO5VFTXC.js","./chunk.BJUUSIQY.js","./chunk.7L3I776Z.js","./chunk.CLIC2QBA.js","./chunk.XOZU4OFA.js","./chunk.WV6SP6IJ.js","./chunk.WVUJXDXZ.js","./chunk.B422DSYN.js","./chunk.ZE5RSKXF.js","./chunk.DKUEZPGR.js","./chunk.EP7YT7LT.js","./chunk.I7KN732Z.js","./chunk.TLPCYKLW.js","./chunk.MIE4TJRW.js","./chunk.SCVKHGO3.js","./chunk.RD2FSSLV.js","./chunk.AZRICZKT.js","./chunk.MH3AQO2R.js","./chunk.J2N7EKMX.js","./chunk.P26ATAAI.js","./chunk.FIY4RUK5.js","./chunk.IY3DV52G.js","./chunk.NLZHNPDU.js","./chunk.QNC2OKLF.js","./chunk.FWXW4T4I.js","./chunk.SDO3U72B.js","./chunk.DHPXRDT5.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.KVQYOFDV.js"))),vo=Me(()=>(__graviewPreload(import.meta.url,["./chunk.HGH27XZG.js","./chunk.NRECR3NQ.js","./chunk.T2BZBR7S.js","./chunk.HMJXB6KC.js","./chunk.Q355UPFG.js","./chunk.JQEXH23N.js","./chunk.O7NYSO6F.js","./chunk.I7OFRF6N.js","./chunk.4RPKCW4J.js","./chunk.IRNEWNUB.js","./chunk.AUNQNTKY.js","./chunk.KLEKC4ZX.js","./chunk.PJL3I2IW.js","./chunk.LMZ2WMGH.js","./chunk.OD5QZHRC.js","./chunk.YJ4PFOPC.js","./chunk.LKM2R5UF.js","./chunk.MB7LKKUD.js","./chunk.26RYER7Y.js","./chunk.CYEPHT7V.js","./chunk.5MOXQUZH.js","./chunk.MKN7ADJB.js","./chunk.I4H2GS4O.js","./chunk.FE3SINPK.js","./chunk.MUWI54IP.js","./chunk.3D37E2G5.js","./chunk.IO5VFTXC.js","./chunk.BJUUSIQY.js","./chunk.7L3I776Z.js","./chunk.CLIC2QBA.js","./chunk.XOZU4OFA.js","./chunk.WV6SP6IJ.js","./chunk.WVUJXDXZ.js","./chunk.B422DSYN.js","./chunk.ZE5RSKXF.js","./chunk.DKUEZPGR.js","./chunk.EP7YT7LT.js","./chunk.I7KN732Z.js","./chunk.TLPCYKLW.js","./chunk.MIE4TJRW.js","./chunk.SCVKHGO3.js","./chunk.RD2FSSLV.js","./chunk.AZRICZKT.js","./chunk.MH3AQO2R.js","./chunk.J2N7EKMX.js","./chunk.P26ATAAI.js","./chunk.FIY4RUK5.js","./chunk.IY3DV52G.js","./chunk.NLZHNPDU.js","./chunk.QNC2OKLF.js","./chunk.FWXW4T4I.js","./chunk.SDO3U72B.js","./chunk.DHPXRDT5.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.5TWRTGP6.js"))),$r=ht(()=>Yt(Vr().then(t=>t.SceneFace)),{what:"This view"}),Ir=ht(()=>Vr().then(t=>t.SceneKeeping),{quiet:!0}),_r=ht(()=>Yt(wo().then(t=>t.PagesContent)),{what:"This page"}),Wr=ht(()=>Yt(vo().then(t=>t.PictureFace)),{what:"This picture"}),bo=$r.Face,So=Ir.Face,Ao=_r.Face,Po=Wr.Face;jt(Me(()=>(__graviewPreload(import.meta.url,["./chunk.KHKCTVHD.js","./chunk.CEQQIW7Z.js","./chunk.TQRC5VAM.js","./chunk.O7NYSO6F.js","./chunk.32SHA3EY.js","./chunk.GG47EIKO.js","./chunk.NYLKG25K.js","./chunk.CLZYNFFH.js","./chunk.WQ7K5O2I.js","./chunk.ZT3ZG52B.js","./chunk.QDVGHI7R.js","./chunk.ROYCJXPE.js","./chunk.M5FP4Y4Q.js","./chunk.RSMCTI2N.js","./chunk.WFJCC6G3.js","./chunk.IO5VFTXC.js","./chunk.HCX6KPRF.js","./chunk.J2N7EKMX.js","./chunk.DHPXRDT5.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.J7O23NKZ.js"))));function He(...t){let r=t.length>0?t:["scene","pages","picture"],o=new Set(r.flatMap(Dr));return Promise.all([...[...o].map(i=>i.fetch()),tr()]).then(()=>{},()=>{})}var Dr=t=>t==="pages"?[_r]:t==="picture"?[Wr]:[$r,Ir],jr=t=>Dr(t).every(r=>r.here()),Ro=150,Kt=0;function Mr(t,r){if(jr(t))return r();let o=++Kt,i=()=>{o===Kt&&(Kt+=1,r())};He(t).then(i),setTimeout(i,Ro)}var Eo=768;function ko(t,r){let o=r!==null&&r>=Eo;(0,d.useEffect)(()=>{if(!o||t==="picture")return;let i=t==="pages"?"scene":"pages";if(jr(i))return;let l=globalThis,p=()=>void He(i),c=()=>{},b=Jn(()=>{if(l.requestIdleCallback&&l.cancelIdleCallback){let h=l.requestIdleCallback(p,{timeout:4e3});c=()=>l.cancelIdleCallback?.(h)}else{let h=setTimeout(p,1500);c=()=>clearTimeout(h)}});return()=>(b(),c())},[t,o])}function To({asked:t,shown:r,onDrawn:o}){return(0,d.useLayoutEffect)(()=>o(t,r),[t,r,o]),null}function xo({auto:t,scene:r}){return(0,w.jsx)("div",{"data-embed-content":"","aria-busy":"true",style:{flex:t?r?`0 0 ${Gt}px`:"0 0 auto":"1 1 auto",minHeight:0,background:"var(--graview-ground)"}})}var Fo=Vt(Me(()=>(__graviewPreload(import.meta.url,["./chunk.AJZBJBMO.js"]),import("./chunk.5JNXQHN4.js")))).part((t,r)=>(0,w.jsx)(t.StudioPlace,{...r}),{quiet:!0});function qr(t,r,o,i,l){return Wt(t,lr(r?lt(r):l??Mn,i),o)}function Qt(t){return t&&lt(t).overview?"graview":"scene"}function Hr(t,r){if(r.homeView?.()===void 0)return!1;let o=t.pages?.first?.trim();return o===void 0||o===""||o==="/"||o.toLowerCase()==="home"}function zr(t){let[,r]=(0,d.useState)(!1),o=(0,d.useCallback)(()=>r(!0),[]),i=(0,d.useRef)(!1);return t.at&&!yt?(0,w.jsx)(qt,{onReady:o,fetch:Zt}):!i.current&&pr(t.draftView)?(0,w.jsx)(qt,{onReady:o,fetch:fr}):(i.current=!0,(0,w.jsx)(Oo,{...t}))}function Oo(t){let{app:r,stop:o,bar:i=!0,standing:l="Everything is in order",principal:p,heading:c=2}=t,{rootRef:b,scope:h,css:k,scheme:O,store:I,presence:S,brand:T,auto:x,height:C}=vr(t),re=mr(t.draftView),E=gr(t,ir,re.over),[de]=(0,d.useState)(qn),u=t.basePath===void 0?{}:{basePath:t.basePath},[V]=(0,d.useState)($t),$=t.notices??V,z=g=>Lt(g,u),ae={...t.routing?{routing:t.routing}:{},...u},[ie]=(0,d.useState)(()=>{let g=t.at?.face;if(g)return g;let Z=o===void 0&&Hr(r,E)?"pages":Qt(o),J=_t({...ae,face:Z});return t.face===void 0&&t.onOpening?.(J),J}),[ve,H]=(0,d.useState)(()=>t.face!==void 0&&t.face!=="pages"&&!t.at&&o===void 0&&sr(ae)&&Hr(r,E)),be=(0,d.useRef)(t.onFace);be.current=t.onFace,(0,d.useLayoutEffect)(()=>{ve&&(be.current?.("pages"),H(!1))},[ve]);let P=ve?"pages":t.face??ie,R=r.schema.kinds,N=t.routing==="address",Se=(0,d.useMemo)(()=>t.at?yt.settleAt(t,I.seenBy(p??{kind:"human"}),E.places()):void 0,[]),L=(0,d.useMemo)(()=>_n(E,r.schema),[E,r.schema]),pe=(0,d.useMemo)(()=>{let g=Se?.stop??(N?cr(t.basePath):void 0)??o;return P==="scene"&&g===void 0&&L===void 0&&(t.path===void 0||Jt(t.path))?Dt(void 0):qr(P,g,R,E.places(),L)},[]),[_]=(0,d.useState)(P);(0,d.useEffect)(()=>{_!=="pages"&&In(E)},[_,E]);let B=(0,d.useRef)(void 0),j=g=>g===void 0||Jt(g)?"/":g;B.current??={path:j(Se?.path??(N?P==="pages"?(Bt(window.location.pathname,t.basePath)??"/")+window.location.search:"/":t.path)),asked:t.path},t.path!==B.current.asked&&(B.current={path:j(t.path),asked:t.path});let X=(0,d.useRef)(t.onNavigate);X.current=t.onNavigate;let Fe=(0,d.useCallback)((g,Z)=>{B.current.path=g,X.current?.(g,Z)},[]),{at:me,setAt:D,steering:G,steer:oe}=Tr(B.current.path),M=(0,d.useContext)(Gr);M&&(M.pages=()=>B.current.path);let[Ne]=(0,d.useState)(()=>({})),Y=M??Ne,se=(0,d.useMemo)(()=>Zn($),[$]),q=(0,d.useRef)(void 0),Ae=(0,d.useCallback)(g=>void(B.current.path=g),[]),U=Qn(b),[Oe,Pe]=(0,d.useState)(!1),Ve=t.pagesBelow!==void 0&&U!==null&&U<t.pagesBelow&&(P==="scene"||P==="graview")&&!Oe,v=Ve?"pages":P,he=(0,d.useRef)(!1);he.current=Oe&&t.pagesBelow!==void 0&&U!==null&&U<t.pagesBelow&&(P==="scene"||P==="graview"),M&&(M.shown=v);let Ce=(0,d.useRef)(P==="graview"?"graview":"scene");(v==="scene"||v==="graview")&&(Ce.current=v),(0,d.useState)(()=>{if(!N||typeof window>"u"||v==="pages"||v==="picture")return;let{pathname:g,search:Z,hash:J}=window.location;Bt(g,t.basePath)==="/"&&window.history.replaceState(window.history.state,"",`${z(Te)}${Z}${J}`)}),wr(b,v,t.onIntrinsicHeight),ko(v,U);let ee=xr(t.onError,v),Le=Fr(t.onReady,v),Re=(0,d.useRef)(t.onFaceDrawn);Re.current=t.onFaceDrawn;let Ze=(0,d.useCallback)((g,Z)=>{Le(Z),Re.current?.(g)},[Le]),[$e,St]=(0,d.useState)(null),Xe=E.places(),Ie=(0,d.useRef)({shown:v,onFace:t.onFace});Ie.current={shown:v,onFace:t.onFace};let W=(0,d.useCallback)((g,Z,J)=>{if(N){q.current?.(g,Z,J);return}Ie.current.onFace?.(g),X.current?.(g==="pages"?Z??B.current.path:Te,"push")},[N]),[ye,K]=(0,d.useState)(void 0);(0,d.useEffect)(()=>{v==="pages"&&K(void 0)},[v]);let _e=(0,d.useRef)(o);(0,d.useEffect)(()=>{_e.current!==o&&(_e.current=o,K(void 0))},[o]);let Ee=(0,d.useCallback)(g=>{if(Ie.current.shown==="pages"){if(Pe(!0),K(g),P==="scene"||P==="graview"){Mr(P,()=>{N?window.history.pushState(null,"",`${z(Te)}${g??""}`):X.current?.(Te,"push")});return}Mr(Ce.current,()=>W(Ce.current,void 0,g))}},[N,P,t.basePath,W]),Be=(0,d.useCallback)(g=>{if(Ie.current.shown==="pages"){G.go.current||(B.current.path=g),oe(g);return}if(B.current.path=g,D(g),he.current){Pe(!1),N?window.history.pushState(null,"",z(g)):X.current?.(g,"push");return}W("pages",g)},[G,oe,D,W,N,t.basePath]),Ke=E.arrangement?.(),le=v==="pages",ke=t.hrefOf,We=ke??(N?z:void 0),Q=(0,d.useMemo)(()=>({open:Be,...ke?{href:ke}:N?{href:g=>Lt(g,t.basePath===void 0?{}:{basePath:t.basePath})}:{}}),[Be,N,t.basePath,ke]);return(0,w.jsxs)("section",{ref:b,className:h,"aria-label":t.label??r.name,"data-graview-embed":v,"data-graview-scheme":O,...Ve?{"data-graview-embed-narrow":""}:{},style:{position:"relative",isolation:"isolate",height:C,minHeight:x?0:320,display:"flex",flexDirection:"column",overflow:"hidden",borderRadius:"var(--graview-radius, 12px)"},children:[(0,w.jsx)("style",{children:k}),(0,w.jsxs)(Yn.Provider,{value:ee,children:[(0,w.jsx)(br,{rootRef:b,board:$,onReport:t.onReport,where:()=>v==="pages"?Sr(me):v==="picture"?{place:"picture"}:Xn(Y.view?.focusId)}),(0,w.jsx)(yr,{rootRef:b,firstLook:t.firstLook,app:rr(T??{name:r.name},r.schema)}),(0,w.jsx)(Ye,{module:"@graview/react",report:ee,content:!0,children:(0,w.jsx)(jn.Provider,{value:de,children:(0,w.jsx)($n,{store:I,views:E,initialView:pe,scheme:O,...Ar(t,S,T),...t.onSeat?{onSeat:t.onSeat}:{},children:(0,w.jsxs)(er.Provider,{value:se,children:[(0,w.jsx)(Mo,{face:v,stop:ye??o,kinds:R,places:Xe,opens:L}),(0,w.jsx)(Co,{into:Y}),(0,w.jsx)(Lo,{rootRef:b,face:P,shown:v,path:me,stop:o,draft:re.n,onDrawn:t.onDrawn,parts:de}),N?(0,w.jsx)(dr,{pagesWere:Se?.path,basePath:t.basePath,shown:v,onFace:t.onFace,toggle:q,kinds:R,places:Xe,opens:L,landed:Ae}):null,i&&v!=="picture"?(0,w.jsx)(Ye,{module:"@graview/embed",report:ee,children:(0,w.jsx)(Pr,{name:T?.name??r.name,heading:c,named:zt(i).name!==!1,faces:zt(i).faces===!1?void 0:{scene:{label:On(Ke),current:!le,go:()=>Ee(),reach:()=>void He(Ce.current)},pages:{label:Cn(Ke),current:le,go:()=>Be(B.current.path),reach:()=>void He("pages")}},at:le?me:null,without:t.pages?.without(),home:{...We?.("/")!==void 0?{href:We("/")}:{},go:()=>Be("/"),current:le&&me.split("?")[0]==="/"},reach:{...We?{href:We}:{},go:g=>Be(g.path)},standing:l,hostActions:t.hostActions,barActions:t.barActions,appMenu:t.appMenu,schemeChoice:t.schemeChoice,share:t.share,status:t.status,keeping:le?void 0:(0,w.jsx)(Ho,{app:r,studio:t.studio,report:ee}),onFind:St})}):null,(0,w.jsx)(nr.Provider,{value:$e,children:(0,w.jsx)(Ye,{module:v==="pages"||v==="picture"?"@graview/pages":"@graview/react",report:ee,content:!0,children:(0,w.jsxs)(d.Suspense,{fallback:(0,w.jsx)(xo,{auto:x,scene:v!=="pages"&&v!=="picture"}),children:[v==="picture"?(0,w.jsx)(Po,{scope:h,store:I,views:E,as:(o?lt(o).within?.view:void 0)??""}):v==="pages"?(0,w.jsx)(Ao,{store:I,views:E,presence:S,auto:x,brand:T,steering:G,overview:Ee,scope:h,titleLevel:kr(c),quickAsk:It(t.quickAsk),props:{...t,onNavigate:Fe,...N?{}:{path:B.current.path}}}):(0,w.jsx)(Wn.Provider,{value:Q,children:(0,w.jsx)(bo,{address:N,auto:x,scheme:O,scope:h,quickAsk:It(t.quickAsk)})}),(0,w.jsx)(To,{asked:P,shown:v,onDrawn:Ze})]})},v)})]})})})})]})]})}var Jt=t=>t.split(/[?#]/)[0]===Te,Gr=(0,d.createContext)(null);function Co({into:t}){return t.view=ut().view,null}function Lo({rootRef:t,face:r,shown:o,path:i,stop:l,draft:p,onDrawn:c,parts:b}){let{view:h}=ut(),k=o==="scene"||o==="graview",O=dt(h),{pan:I,...S}=h,T=h.pan?dt(S):O,x={face:r,path:k?Te:o==="picture"?l??"#":i,stop:O};return Br(t,`${o} ${k?T:x.path} ${p}`,x,c,b),null}var yt,Bo=Me(()=>(__graviewPreload(import.meta.url,["./chunk.VXPEXUQF.js","./chunk.NLZHNPDU.js","./chunk.QNC2OKLF.js","./chunk.FWXW4T4I.js","./chunk.SDO3U72B.js","./chunk.DHPXRDT5.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.POKGLN4T.js"))),Zt=()=>Bo().then(t=>void(yt=t),()=>new Promise(t=>{let r=()=>{window.removeEventListener("online",r),clearTimeout(o),t()},o=setTimeout(r,1e4);window.addEventListener("online",r)}).then(Zt));function Mo({face:t,stop:r,kinds:o,places:i,opens:l}){let{view:p,go:c}=ut(),b=(0,d.useRef)({face:t,stop:r});return(0,d.useLayoutEffect)(()=>{let h=b.current.stop!==r,k=b.current.face!==t,O=b.current.face==="pages";if(b.current={face:t,stop:r},!h&&!k||t==="pages"||t==="picture")return;let I=(h||O)&&r!==void 0?qr(t,r,o,i):O&&ur(p)?Wt(t,Dt(l),o):t==="graview"?Nt(p,!0):p.overview?Hn(Nt(p,!1),or(p,o)):p;c(I)},[t,r,o,p,c,l]),null}function Ho({app:t,studio:r,report:o}){return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(d.Suspense,{fallback:null,children:(0,w.jsx)(So,{})}),r!==!1?(0,w.jsx)(Ye,{module:"@graview/studio",report:o,children:(0,w.jsx)(No,{app:t,studio:r})}):null]})}function No({app:t,studio:r}){let o={app:t,within:"box",...r?{onApply:r.onApply}:{},...r?.landmark?{landmark:r.landmark}:{},...r?.offered!==void 0?{offered:r.offered}:{}},i=r?.place;return i?(0,w.jsx)(i,{...o}):(0,w.jsx)(d.Suspense,{fallback:null,children:(0,w.jsx)(Fo,{...o})})}function Vo({path:t,stop:r,...o},i){return{...o,app:i.app,at:i.at,remote:i.remote,...i.remote.presence?{presence:i.remote.presence}:{}}}function Xt(t,r){let o=r.store??r.remote?.store??hr(r.app,r.seed),i=r.notices??$t(),l=null,p={},c=0,b=r.label,h=r.app,k=Promise.resolve(),O=r.at?.face??r.face,I=O===void 0?void 0:_t({...r,face:O}),S=I??Qt(r.stop),T=null,x=[],C=u=>{if(T=u,u!==S)return;let V=x;x=[];for(let $ of V)$()};function re(){let[u,V]=(0,d.useState)(I),[$,z]=(0,d.useState)(r.stop),[ae,ie]=(0,d.useState)(r.path),[ve,H]=(0,d.useState)(r.scheme??"auto"),[be,P]=(0,d.useState)(r.principal),[R,N]=(0,d.useState)(r.seats),[Se,L]=(0,d.useState)(r.quickAsk),[pe,_]=(0,d.useState)(r.people),[B,j]=(0,d.useState)(r.hostContext),[X,Fe]=(0,d.useState)(r.brand),[me,D]=(0,d.useState)(r.whileAway),[G,oe]=(0,d.useState)(r.label),[M,Ne]=(0,d.useState)(r.hostActions),[Y,se]=(0,d.useState)(r.barActions),[q,Ae]=(0,d.useState)(()=>Rr(r)),[U,Oe]=(0,d.useState)(void 0),[Pe,Ve]=(0,d.useState)(r.draftView);return l={app:v=>{Oe(v),ie(void 0),z(void 0)},face:V,stop:z,path:ie,scheme:H,seat:P,seats:N,quickAsk:L,people:_,hostContext:j,brand:Fe,whileAway:D,label:oe,hostActions:Ne,barActions:se,hostBar:v=>Ae(he=>({...he,...v})),draft:Ve},(0,w.jsx)(Gr.Provider,{value:p,children:(0,w.jsx)(zr,{...U?Vo(r,U):r,store:o,notices:i,...u!==void 0?{face:u}:{},onOpening:v=>{S=v},...$!==void 0?{stop:$}:{},...ae!==void 0?{path:ae}:{},...be?{principal:be}:{},...R?{seats:R}:{},...Se!==void 0?{quickAsk:Se}:{},...pe?{people:pe}:{},...B?{hostContext:B}:{},...X?{brand:X}:{},whileAway:me,label:G,hostActions:M,barActions:Y,...Er(q),draftView:Pe,scheme:ve,onFace:v=>{S=v,V(v)},onSeat:P,onFaceDrawn:C},U?.n??0)})}let E=()=>{let u=p.view?.focusId,V=u?o.graph.getNode(u)?.kind:void 0,$=(p.shown??S)==="scene"||(p.shown??S)==="graview";return{face:S,path:$?Te:p.pages?.()??r.path??"/",stop:p.view?dt(p.view):r.stop??"#",...V?{kind:V}:{}}},de=(0,Nr.createRoot)(t);return(0,F.flushSync)(()=>de.render((0,w.jsx)(re,{}))),{get store(){return o},where:E,setApp:(u,V,$)=>{let z="graph"in V?{store:V}:V,ae=()=>{let ie=E();o=z.store,b=$?.label??(b===h.name?u.name:b),h=u,(0,F.flushSync)(()=>{l?.label(b),l?.app({app:u,remote:z,at:ie,n:++c})})};yt?ae():k=k.then(Zt).then(ae)},setFace:u=>{S=u,(0,F.flushSync)(()=>l?.face(u))},setStop:u=>(0,F.flushSync)(()=>l?.stop(u)),setPath:u=>(0,F.flushSync)(()=>{if(Jt(u)){(S==="pages"||S==="picture")&&(S="scene",l?.face("scene"));return}l?.path(u),S!=="pages"&&(S="pages",l?.face("pages"))}),setScheme:u=>(0,F.flushSync)(()=>l?.scheme(u)),setSeat:u=>(0,F.flushSync)(()=>l?.seat(u)),setSeats:u=>(0,F.flushSync)(()=>l?.seats(u)),setQuickAsk:u=>(0,F.flushSync)(()=>l?.quickAsk(u)),setPeople:u=>(0,F.flushSync)(()=>l?.people(u)),setHostContext:u=>(0,F.flushSync)(()=>l?.hostContext(u)),setBrand:u=>(0,F.flushSync)(()=>l?.brand(u)),setWhileAway:u=>(0,F.flushSync)(()=>l?.whileAway(u)),setDraftView:u=>(0,F.flushSync)(()=>l?.draft(u)),setLabel:u=>{b=u,(0,F.flushSync)(()=>l?.label(u))},setHostActions:u=>(0,F.flushSync)(()=>l?.hostActions(u)),setBarActions:u=>(0,F.flushSync)(()=>l?.barActions(u)),setAppMenu:u=>(0,F.flushSync)(()=>l?.hostBar({appMenu:u})),setShare:u=>(0,F.flushSync)(()=>l?.hostBar({share:u})),setStatus:u=>(0,F.flushSync)(()=>l?.hostBar({status:u})),setSchemeChoice:u=>(0,F.flushSync)(()=>l?.hostBar({schemeChoice:u})),setNotifications:u=>(0,F.flushSync)(()=>l?.hostBar({notifications:u})),drawn:()=>k.then(()=>T===S?void 0:new Promise(u=>x.push(u))),notify:u=>{let V;return(0,F.flushSync)(()=>{V=i.notify(u)}),V},unmount:()=>de.unmount()}}var gt=t=>`s${(t+1).toString(36)}`;var we={seat:"x-graview-seat",roles:"x-graview-roles",kind:"x-graview-kind",name:"x-graview-name",for:"x-graview-for",forRoles:"x-graview-for-roles",forName:"x-graview-for-name",via:"x-graview-via"},ze={header:"x-graview-key",param:"graview_key",cookie:"graview_key"};function wt(t,r={}){try{let o=new URL(t),i=o.searchParams.get(ze.param);if(i)return o.searchParams.delete(ze.param),{url:o.origin+o.pathname.replace(/\/$/,"")+o.search,key:i,headers:{[ze.header]:i,...r}}}catch{}return{url:t.replace(/\/$/,""),headers:r}}var Ur="/graview/friction";var Kr="/graview/live",en="graview.ship",tn=`${en}.${it}`;var Ge=class extends Error{constructor(r){super(r),this.name="Superseded"}},xe=t=>t?.lineage?{lineage:t.lineage}:{},$o=(t,r)=>`${t.calls.map(o=>o.name.replace(/-/g," ")).join(", ")} (${r instanceof Error?r.message.split(`
2
- `)[0]??"":String(r)})`;function Io(t){if(!t)return[];try{let r=t.storage.getItem(t.key);if(r===null)return[];t.storage.removeItem(t.key);let o=JSON.parse(r);return Array.isArray(o)?o.filter(i=>!!i&&Array.isArray(i.calls)):[]}catch{return[]}}var Ue=class extends Error{constructor(o){super(o.sentence);this.refusal=o;this.name="RemoteRefusedError"}},_o={401:"forbidden",403:"forbidden",404:"missing",413:"limit"},fe=class extends Error{constructor(o,i){super(o);this.conflicts=i;this.name="StaleWrite"}},Qe=class extends Error{constructor(r){super(r),this.name="Unreached"}},Wo=new Set([502,503,504]);async function Do(t){try{return(await t.clone().json()).reason==="unavailable"}catch{return!1}}function jo(){let t=Math.random().toString(36).slice(2,8),r=0;return()=>`local-${t}-${++r}`}var qo=1,zo=()=>({refusals:new Set,conflicts:new Set,statuses:new Set,helds:new Set,builds:new Set,who:new Set,declarations:new Set,tally:{reconnects:0,rebases:0,conflicts:0,resyncs:0}});async function vt(t){return(await Jr(t,Io(t.carry),"This app was updated while your changes were on the way.",zo())).remote}async function Jr(t,r,o,i){let{key:l,...p}=wt(t.url,t.headers),c={...t,...p},b=c.fetch??fetch,h={"content-type":"application/json",...c.headers??{}},k={...bt(c.principal),[we.via]:c.via??"web"};Object.assign(h,k);let O=c.live===!0,I=c.presenceEveryMs,S=c.visible??Ko,T="connecting",x=i.statuses,C=i.tally,re=[],E,de=[],u=()=>T==="online"&&E!==void 0?"held":T,V=()=>{let e=u();if(i.told!==e){i.told=e;for(let n of[...x])n(e)}},$=e=>{if(!(e===T||ce)&&(T==="offline"&&e==="online"&&C.reconnects++,T=e,V(),e==="online"))for(let n of re.splice(0))n.again()},z=e=>{if(ce)return;let n=typeof e=="string"&&e.length>0?e:void 0,s=n!==E;if(E=n,ae(),!!s&&(V(),n===void 0)){for(let a of de.splice(0))a();te&&clearTimeout(te),sn()}},ae=()=>{if(i.toldHeld!==E){i.toldHeld=E;for(let e of[...i.helds])e(E??null)}},ie=async(e,n)=>{let s;try{s=await b(e,n)}catch(a){throw Q()||$("offline"),new Qe(a instanceof Error?a.message:String(a))}if(s.status===503&&await Do(s))return $("online"),s;if(Wo.has(s.status))throw Q()||$("offline"),new Qe(`The server is away (${s.status})`);return $("online"),s},ve=async(e=!1)=>{let n=`${c.url}/graview/state?opFormat=${qe.op}`,s=e?await b(n,{headers:h}):await ie(n,{headers:h});if(!s.ok)throw new Error((await s.json().catch(()=>({}))).error??`The server refused (${s.status})`);return await s.json()},H=c.state??await ve(!0);O||(T="online"),E=typeof H.held=="string"&&H.held.length>0?H.held:void 0,ae();let be=H.enabledModules??c.enabledModules,P=c.localApp?c.localApp(c.app):c.app,R=new Fn({schema:P.schema,mutations:P.mutations??[],invariants:P.invariants??[],...P.policy?{policy:P.policy}:{},...P.publishing?{publishing:P.publishing}:{},...P.tidying?{tidying:P.tidying}:{},...P.modules?{modules:P.modules}:{},...be?{enabledModules:be}:{},...P.intelligence?{intelligence:P.intelligence}:{},...P.brand?.timeZone?{timeZone:P.brand.timeZone}:{},snapshot:H.snapshot,log:H.log,...H.horizon!==void 0?{horizon:H.horizon}:{},ids:jo(),...c.storeOptions??{}});Pn.served.add(R);let N=c.friction!==!1&&c.principal?.kind!=="visitor";N&&En(R,e=>{N&&b(`${c.url}${Ur}`,{method:"POST",headers:h,body:JSON.stringify({event:e})}).then(n=>void(N=n.status!==404&&n.status!==410),()=>{})});let Se=Tn(R),L=H.log.at(-1)?.seq??(H.horizon??0)-1,pe=Ct.of(H.log,{horizon:H.horizon??0}),_=null,B,j=new Map,X=i.who,Fe=!1,me=e=>{if(ce)return;Fe=!0;let n=Ln(new Map,e,Date.now(),Mt,_?.participant);B!==void 0&&n.delete(B);let s=n.size!==j.size;if(!s)for(let[a,f]of n)Ht(f,j.get(a))||(s=!0);if(j=n,!!s)for(let a of[...X])a([...j.values()])},D=[],G=new Set,oe=e=>{let n=D.indexOf(e);n>=0&&D.splice(n,1)},M=new Map,Ne=(e,n)=>{let s=M.get(e);s&&(M.delete(e),s.resolve({ops:n.filter(a=>a.batch===e),batch:e}))},Y,se=[],q=(e,n=[])=>{if(e.length===0&&n.length===0)return[];if(Y)return se.push({ops:e,drop:n}),[];let s=Math.min(...e.filter(m=>m.seq>L).map(m=>m.seq));if(Number.isFinite(s)&&s>L+1)return se.push({ops:e,drop:n}),Ae(),[];let a=D.filter(m=>e.some(ne=>ne.batch===m)),f=[...new Set([...n,...a])].filter(m=>G.has(m)),y,A=D.filter(m=>!a.includes(m));try{y=R.rebase({confirmed:e,pending:A,drop:f}).confirmed}catch(m){if(!(m instanceof xn))throw m;return se.push({ops:e,drop:n}),Ae(),[]}for(let m of a)oe(m);e.some(m=>m.seq>L)&&A.some(m=>!f.includes(m))&&C.rebases++,e.length>0&&(L=Math.max(L,...e.map(m=>m.seq)),pe.note(e));for(let m of f)G.delete(m);for(let m of a)Ne(m,e);return y},Ae=()=>{Y||(Y=Re(ve().then(e=>{if(U(e)){se=[];return}let n=new Set(e.log.map(f=>f.batch)),s=D.filter(f=>n.has(f));for(let f of s)oe(f);let a=R.adopt({snapshot:e.snapshot,log:e.log,...e.horizon!==void 0?{horizon:e.horizon}:{},pending:[...D],drop:[...G].filter(f=>!D.includes(f))});G.clear();for(let f of a.pending)G.add(f.batch);L=e.log.at(-1)?.seq??(e.horizon??0)-1,pe=Ct.of(e.log,{horizon:e.horizon??0}),C.resyncs++;for(let f of s)Ne(f,e.log)}).then(()=>{Y=void 0;let e=se;se=[];for(let{ops:n,drop:s}of e)q(n,s)},()=>{Y=void 0,se=[]})))},U=e=>(typeof e.build=="string"&&dn(e.build),typeof e.version=="number"&&z(e.held),typeof e.version!="number"||e.version===H.version?!1:(Rt(e.version),!0)),Oe=async e=>{let s=await(await ie(`${c.url}/graview/since?seq=${gt(e)}&opFormat=${qe.op}`,{headers:h})).json();return U(s)?[]:s.reset===!0?(Ae(),[]):s.ops??[]},Pe=async()=>{let e=await Ve();return Y&&await Y,e},Ve=async()=>{if(_&&!Q()&&S()){let n=await(await ie(`${c.url}/graview/here?opFormat=${qe.op}`,{method:"POST",headers:h,body:JSON.stringify({presence:_,seq:gt(L)})})).json();return U(n)?[]:(typeof n.participant=="string"&&(B=n.participant),me(n.who??[]),q(n.ops??[]))}return q(await Oe(L))},v=new Map,he=new Map,Ce=new Set,ee=new Map,Le=new Set,Re=e=>(Le.add(e),e.finally(()=>Le.delete(e)).catch(()=>{}),e),Ze=Promise.resolve(),$e=0,St=(e,n)=>{let s=Ze.then(()=>Ie(e,n));return Ze=s.catch(()=>{}),s},Xe=()=>new Promise((e,n)=>re.push({again:e,give:n})),Ie=async(e,n)=>{let s,a;for(;;){try{s=await ie(`${c.url}/graview/ops`,{method:"POST",headers:h,body:JSON.stringify({...e,opFormat:qe.op})})}catch(m){if(!(m instanceof Qe)||K)throw m;if(await Xe(),Q())return et(e,n);continue}if(a=await s.json().catch(()=>({})),s.status===503&&a.reason==="unavailable"&&typeof a.held=="string"&&!K){if(typeof a.version=="number"?U(a):(z(a.held),!1))break;if(E!==void 0&&(xt>0||O)){if(await new Promise(m=>de.push(m)),K)throw new Ge("The client closed.");if(Q())return et(e,n);continue}}let A;if(s.status===503&&a.reason==="unavailable"&&!K)A=nn(c.backoff,$e++);else{if($e=0,s.status!==429||K)break;A=Go(s.headers.get("retry-after"),a.retryAfter)}if(await new Promise(m=>setTimeout(m,A)),Q())return et(e,n)}if(ce||U(a))throw new Ge("The app was changed.");if(!s.ok){let A=a.error??`The server refused (${s.status})`;throw a.conflict?new fe(A,a.conflicts??[]):new Ue({reason:a.reason??_o[s.status]??"invalid",sentence:A,...a.wouldNeed?.length?{wouldNeed:a.wouldNeed}:{}})}let f=a.ops??[],y=f[0]?.seq;return y!==void 0&&y>L+1&&(f=await Oe(L)),n!==void 0&&(a.batch&&v.set(n,a.batch),oe(n)),q(f,n!==void 0?[n]:[]),{ops:a.ops??[],...a.batch?{batch:a.batch}:{}}},W,ye=!1,K=!1,_e=0,Ee,Be=0,Ke=0,le=null,ke=()=>{},We=new Promise(e=>{ke=e}),Q=()=>O&&ye&&W?.readyState===qo,g=e=>{if(!Q())return!1;try{return W.send(JSON.stringify(e)),!0}catch{return!1}},Z=(e=!1)=>{!_||!Q()||!S()||!e&&le&&Ht(_,le)&&(I===void 0||Date.now()-Ke<I)||g({t:"here",presence:_})&&(le=_,Ke=Date.now())},J=new Set,te,sn=()=>{if(te=void 0,E!==void 0)return;let e=[...M.entries()].filter(([n])=>J.has(n));J.clear();for(let[,n]of e)g(n.message)},cn=(e,n)=>{M.has(e)&&(J.add(e),te&&clearTimeout(te),te=setTimeout(sn,Math.max(0,n)))},Zr=e=>{M.has(e)&&J.add(e)},et=(e,n)=>new Promise((s,a)=>{let f=n??`send-${++Be}`,y=e.undo?{t:"undo",cid:f,batches:e.undo,...e.intent?{intent:e.intent}:{},...e.batch?{batch:e.batch}:{},...e.via?{via:e.via}:{},...xe(e)}:{t:"call",cid:f,calls:e.calls??[],...e.intent?{intent:e.intent}:{},...e.batch?{batch:e.batch}:{},...e.base?.length?{base:e.base}:{},...e.via?{via:e.via}:{},...xe(e)};if(M.set(f,{message:y,...n!==void 0?{mine:n}:{},resolve:s,reject:a}),J.size>0||E!==void 0){J.add(f);return}g(y)}),tt=(e,n)=>Q()?et(e,n):St(e,n),Xr=e=>{switch(e.t){case"welcome":{if(dn(e.build),typeof e.version=="number"&&e.version!==H.version){Rt(e.version);return}if(ye=!0,_e=0,typeof e.participant=="string"&&(B=e.participant),z(e.held),e.state?Ae():q(e.ops??[]),J.clear(),te&&clearTimeout(te),te=void 0,E!==void 0)for(let n of M.keys())J.add(n);else for(let n of M.values())g(n.message);Z(!0),$("online"),ke();return}case"ops":q(e.ops??[]);return;case"ack":{let n=M.get(e.cid);if(!n){q(e.ops??[]);return}M.delete(e.cid),$e=0,n.mine!==void 0&&(v.set(n.mine,e.batch),oe(n.mine)),q(e.ops??[],n.mine!==void 0?[n.mine]:[]),n.resolve({ops:e.ops??[],batch:e.batch});return}case"refused":case"conflict":{let n=M.get(e.cid);if(!n)return;if(e.t==="refused"&&e.reason==="unavailable"){E!==void 0?Zr(e.cid):cn(e.cid,nn(c.backoff,$e++));return}M.delete(e.cid),n.reject(e.t==="conflict"?new fe(e.sentence,e.conflicts??[]):new Ue({reason:e.reason??"invalid",sentence:e.sentence,...e.wouldNeed?.length?{wouldNeed:[...e.wouldNeed]}:{}}));return}case"busy":typeof e.cid=="string"&&cn(e.cid,typeof e.retryAfter=="number"?e.retryAfter:1e3);return;case"presence":me(e.who??[]);return;case"held":z(e.sentence);return;case"declaration":typeof e.version=="number"&&e.version!==H.version&&Rt(e.version);return;case"reload":pn(typeof e.reason=="string"?e.reason:"This app was updated.");return;case"error":if(e.reopen===!0&&W){let n=W;hn(n);try{n.close(1e3,"Opening again.")}catch{}}return;default:return}},ce=!1,At=i.declarations,Pt=i.builds,dn=e=>{if(!(ce||i.otherBuild!==void 0||!c.build||typeof e!="string"||e.length===0||e===c.build)){i.otherBuild=e;for(let n of[...Pt])n(e)}},ln=()=>{let e=[],n=0;for(let s of D){let a=ee.get(s);a?e.push({calls:a.calls,...a.intent?{intent:a.intent}:{},...a.via?{via:a.via}:{},...xe(a),batch:s}):n++}return{carried:e,undos:n}},un=(e,n)=>`${n} while ${e===1?"an undo of yours was":"undos of yours were"} on the way; ${e===1?"it was":"they were"} not made.`,fn=e=>{ce=!0,_=null;let n=new Ge(e);for(let a of M.values())a.reject(n);M.clear(),ot&&clearInterval(ot),K=!0,Ee&&clearTimeout(Ee),te&&clearTimeout(te),ge&&clearTimeout(ge);for(let a of re.splice(0))a.give(n);for(let a of de.splice(0))a();let s=W;W=void 0,ye=!1;try{s?.close(1e3,e)}catch{}ke()};async function Rt(e){if(ce)return;if(!c.resolveApp){pn(`This app was changed on its server (version ${e}); reload the page to carry on.`);return}let{carried:n,undos:s}=ln(),a=c.resolveApp,f=_;fn("The app was changed.");try{let y=await a(e),{state:A,...m}=c,ne=await Jr({...m,app:y},n,"The app was changed while your changes were on the way.",i);f&&ne.remote.presence.here(f);for(let at of[...At])at(ne.remote,e);let ue=[...s>0?[nt(un(s,"The app was changed"))]:[],...ne.unheard()];for(let at of ue)for(let so of De)so(at.sentence,at)}catch(y){let A=`The app was changed, but the new version could not be opened: ${y instanceof Error?y.message:String(y)}`;for(let m of De)m(A,nt(A))}}function pn(e){if(ce)return;let{carried:n,undos:s}=ln();fn(e);let a=!1;if(c.carry&&n.length>0)try{c.carry.storage.setItem(c.carry.key,JSON.stringify(n)),a=!0}catch{}let f=[];!a&&n.length>0&&f.push(`${e} ${n.length===1?"A change of yours was":`${n.length} changes of yours were`} not sent; make ${n.length===1?"it":"them"} again after the page reloads.`),s>0&&f.push(un(s,"This app was updated"));for(let y of f)for(let A of De)A(y,nt(y));(c.reloadPage??Uo)()}let mn=()=>{if(K||!O)return;let e=`${c.url.replace(/^http/,"ws").replace(/\/$/,"")}${Kr}`,{"content-type":n,...s}=h,a;try{a=c.socket?c.socket(e,s,[tn]):io(e,s)}catch{return yn()}W=a,ye=!1,a.onopen=()=>{W===a&&a.send(JSON.stringify({t:"hello",seq:gt(L),protocol:it,wire:en,opFormat:qe.op,...c.build?{build:c.build.slice(0,64)}:{},...c.hostProtocol!==void 0?{hostProtocol:c.hostProtocol}:{}}))},a.onmessage=f=>{if(W!==a)return;let y;try{y=JSON.parse(String(f.data))}catch{return}Xr(y)},a.onclose=()=>hn(a),a.onerror=()=>{}},ge,eo=()=>{Fe=!1,ge&&clearTimeout(ge),ge=setTimeout(()=>{if(ge=void 0,Fe||K)return;let e=new Map([...j].filter(([,n])=>n.held!=="socket"));if(e.size!==j.size){j=e;for(let n of X)n([...j.values()])}},Mt),ge.unref?.()};function hn(e){if(W!==e)return;let n=ye;W=void 0,ye=!1,le=null,n&&($("offline"),eo()),yn()}let yn=()=>{if(K)return;let e=nn(c.backoff,_e);_e++,Ee=setTimeout(mn,e)},gn=R.applyAll.bind(R),to=R.undo.bind(R),no=R.previewAll.bind(R);R.previewAll=(e,n)=>no(e,{...c.principal?{author:c.principal}:{},...n});let De=i.refusals,Je=[],nt=e=>({reason:"invalid",sentence:e}),rt=i.conflicts,Et=!1,wn,kt=async(e,n)=>{if(n instanceof Ge||ce)return;let s=n instanceof Ue?n.refusal:An(n),a=s.sentence,f=n instanceof fe?wn?.yoursOf(R,ee.get(e)?.calls??[]):void 0;oe(e);try{q([],[e])}catch{}let y=ee.get(e);ee.delete(e);let A=y?.calls[0];if(A&&!(n instanceof fe)){let m=R.allMutations().find(ue=>ue.name===A.name)?.subject?.arg,ne=m&&R.graph.getNode(A.args[m])?.kind;kn(R,{type:"refused",act:A.name,code:s.reason,...ne?{kind:ne}:{}},c.principal)}if(n instanceof fe&&C.conflicts++,n instanceof fe&&!Q()&&await Pe().catch(()=>[]),n instanceof fe&&Y&&await Y,n instanceof fe&&rt.size>0){let m=!1,ne={sentence:a,conflicts:f?n.conflicts.map(ue=>ue.node===f.node&&ue.field===f.field?{...ue,yours:f.yours}:ue):n.conflicts,keepTheirs(){m=!0},useMine(){if(!(m||!y)){m=!0,Et=!0;try{R.applyAll(f?[f.over(L)]:y.calls,{...y.intent?{intent:y.intent}:{},...y.via?{via:y.via}:{},...xe(y)})}finally{Et=!1}}}};for(let ue of rt)ue(ne);return}for(let m of De)m(a,s)},ro=(e,n)=>e.flatMap(s=>s.mutation?.name===Sn?[]:s.primitives.flatMap(a=>a.op==="splice-text"&&!n.has(a.id)&&!n.has(`${a.id}\0${a.field}`)?[{node:a.id,field:a.field,rev:L}]:[]));R.applyAll=(e,n)=>{let s=Rn(R.log.all().filter(A=>G.has(A.batch))),a=gn(e,{...c.principal?{author:c.principal}:{},...n}),f=e.map((A,m)=>{let ne=a.minted?.[m];return ne===void 0||A.args?.id!==void 0?A:{...A,mintedHint:ne}});D.push(a.batch),G.add(a.batch),ee.set(a.batch,{calls:f,...n?.intent?{intent:n.intent}:{},...n?.via?{via:n.via}:{},...xe(n)});let y=Et?[]:[...pe.baseFor(a.ops,s,(A,m)=>R.collaborative(A,m)),...ro(a.ops,s)];return he.set(a.batch,Re(tt({calls:f,...n?.intent?{intent:n.intent}:{},batch:a.batch,...y.length>0?{base:y}:{},...n?.via?{via:n.via}:{},...xe(n)},a.batch).catch(A=>kt(a.batch,A)))),a},R.apply=(e,n)=>R.applyAll([e],n),R.undo=(e,n)=>{let s=typeof e=="string"?[e]:e,a=to(s.map(y=>v.get(y)??y),{...c.principal?{author:c.principal}:{},...n});D.push(a.batch),G.add(a.batch);let f=Promise.allSettled(s.map(y=>he.get(y)));return he.set(a.batch,Re(f.then(()=>{let y=s.filter(A=>!Ce.has(A));if(y.length===0){oe(a.batch),ee.delete(a.batch),q([],[a.batch]);return}return tt({undo:y.map(A=>v.get(A)??A),...n?.intent?{intent:n.intent}:{},batch:a.batch,...n?.via?{via:n.via}:{},...xe(n)},a.batch)}).catch(y=>kt(a.batch,y)))),a};let oo=async(e,n={})=>{Tt++;try{return(await Re(tt({calls:e,...n}))).ops}finally{Tt--}},Tt=0,vn={here(e){_=e,Z()},onWho(e){return X.add(e),j.size>0&&e([...j.values()]),()=>{X.delete(e)}},leave(){if(!_)return;let e=JSON.stringify({participant:B??_.participant});if(_=null,g({t:"bye"}))return;let n=globalThis.navigator?.sendBeacon;n?n.call(globalThis.navigator,`${c.url}/graview/leave${l!==void 0?`?${ze.param}=${encodeURIComponent(l)}`:""}`,e):b(`${c.url}/graview/leave`,{method:"POST",headers:h,body:e}).catch(()=>{})}},xt=c.pollMs??800,ot=xt>0&&typeof setInterval=="function"?setInterval(()=>{Q()||Pe().catch(()=>{})},xt):null;if(O){mn();let e;await Promise.race([We,new Promise(n=>e=setTimeout(n,c.openTimeoutMs??3e3))]),clearTimeout(e)}if(r.length>0&&!ce){let e=[],n=new Set(R.log.all().map(s=>s.batch));for(let s of r)if(!(s.batch!==void 0&&n.has(s.batch)))try{R.applyAll(s.calls,{...s.intent?{intent:s.intent}:{},...s.batch?{batch:s.batch}:{},...s.via?{via:s.via}:{},...xe(s)})}catch(a){e.push($o(s,a))}e.length>0&&Je.push(nt(`${o} ${e.length===1?"One no longer fits and was not made":`${e.length} no longer fit and were not made`}: ${e.join("; ")}.`))}let bn=new Map,ao=()=>({store:R,author:c.principal,appliedAll:gn,pending:D,provisional:G,asked:ee,answers:he,letGo:Ce,sent:(e,n)=>Re(tt({calls:n,batch:e},e).catch(s=>kt(e,s))),settle:oe,land:q,seen:()=>L,gone:()=>K||ce});return{remote:{store:R,typing(e,n){let s=`${e}\0${n}`,a=bn.get(s);return a||(a=(__graviewPreload(import.meta.url,["./chunk.ZQYHNFRZ.js","./chunk.DHPXRDT5.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.EK3JXEZL.js")).then(f=>(wn=f,f.typingOf(e,n,f.wireOf(ao())))),bn.set(s,a)),a},version:H.version,migrated:H.migrated??[],send:oo,pull:Pe,onRefusal(e){De.add(e);let n=Je;Je=[];for(let s of n)e(s.sentence,s);return()=>De.delete(e)},onDeclaration(e){return At.add(e),()=>At.delete(e)},onBuild(e){return Pt.add(e),i.otherBuild!==void 0&&e(i.otherBuild),()=>Pt.delete(e)},onConflict(e){return rt.add(e),()=>rt.delete(e)},revision:(e,n)=>pe.of(e,n),seq:()=>L,participant:()=>B,transport:()=>Q()?"socket":"poll",status:u,onStatus(e){return x.add(e),()=>x.delete(e)},held:()=>E,onHeld(e){return i.helds.add(e),E!==void 0&&e(E),()=>i.helds.delete(e)},counters:()=>({...C}),who:()=>[...j.values()],pending:()=>D.length+Tt,async settled(){for(;Le.size>0;)await Promise.allSettled([...Le])},presence:vn,close(){ot&&clearInterval(ot),Se(),vn.leave(),K=!0,Ee&&clearTimeout(Ee),te&&clearTimeout(te),ge&&clearTimeout(ge);for(let n of re.splice(0))n.give(new Error("The client closed before the server could be reached."));for(let n of de.splice(0))n();let e=W;W=void 0,ye=!1;try{e?.close(1e3,"Closed.")}catch{}}},unheard(){let e=Je;return Je=[],e}};function io(e,n){let s=globalThis.WebSocket;if(!s)throw new Error("This runtime has no WebSocket; the client polls instead.");let a=typeof globalThis.document<"u",f=c.subprotocol?[tn]:[];if(!a)try{return new s(e,{headers:n,...f.length>0?{protocols:f}:{}})}catch{}let y=new URL(e);for(let[A,m]of Object.entries(k))y.searchParams.set(A,m);return l!==void 0&&y.searchParams.set(ze.param,l),f.length>0?new s(y.toString(),f):new s(y.toString())}}function Go(t,r,o=Date.now()){let i,l=t?.trim();if(l)if(/^\d+(\.\d+)?$/.test(l))i=Number(l)*1e3;else{let b=Date.parse(l);Number.isFinite(b)&&(i=Math.max(0,b-o))}let p=typeof r=="number"&&Number.isFinite(r)&&r>=0?r:void 0,c=p!==void 0&&p<50&&i!==void 0&&Math.abs(p*1e3-i)<1e3;return p!==void 0&&!c?p:i??1e3}function Uo(){globalThis.location?.reload?.()}function Ko(){return globalThis.document?.visibilityState!=="hidden"}function nn(t,r){if(typeof t=="function")return Math.max(0,t(r));let{min:o=250,max:i=1e4,factor:l=2}=t??{};return Math.min(i,o*l**r)*(.75+Math.random()*.5)}function bt(t){let r={};if(!t)return r;t.id&&(r[we.seat]=t.id),t.roles?.length&&(r[we.roles]=t.roles.join(",")),t.kind!=="human"&&(r[we.kind]=t.kind),t.name&&(r[we.name]=encodeURIComponent(t.name));let o=t.onBehalfOf;return o?.id&&(r[we.for]=o.id),o?.roles?.length&&(r[we.forRoles]=o.roles.join(",")),o?.name&&(r[we.forName]=encodeURIComponent(o.name)),r}var Yr="/graview/views";function rn(t){let r=t.fetch??fetch,o=wt(t.url,t.headers),i=o.url,l={"content-type":"application/json",...t.principal?bt(t.principal):{},...o.headers},p=t.state?{hidden:t.state.hidden??[],removed:t.state.removed??[],may:t.state.may??st.may}:st,c=new Set,b=S=>{if(JSON.stringify(S)!==JSON.stringify(p)){p=S;for(let T of c)T()}},h=async(S,T)=>{let x=await r(`${i}${t.path??Yr}`,{method:S,headers:l,...T!==void 0?{body:JSON.stringify(T)}:{}}),C=await x.json();if(!x.ok)throw new Error(C.error??`The store answered ${x.status}.`);b({hidden:C.hidden??[],removed:C.removed??[],may:C.may??st.may})},k=()=>h("GET"),O=t.state?Promise.resolve():k().catch(()=>{}),I=t.pollMs?setInterval(()=>void k().catch(()=>{}),t.pollMs):void 0;return{ready:O,refresh:k,close:()=>clearInterval(I),current:()=>p,onChange(S){return c.add(S),()=>void c.delete(S)},hide:S=>h("POST",{hide:S}),show:S=>h("POST",{show:S}),remove:(S,T)=>h("POST",{remove:S,...T?{about:T}:{}}),async restore(S){let T=p.removed.find(x=>x.name===S)?.lens;await h("POST",{restore:S}),T&&await t.onDeclaration?.()},async lens(S){await h("POST",{lens:S}),await t.onDeclaration?.()}}}var an=document.getElementById("graview-app"),on=/^\/forms\/([^/]+)\/?$/.exec(location.pathname),Qr=on?(__graviewPreload(import.meta.url,["./chunk.NRECR3NQ.js","./chunk.3D37E2G5.js","./chunk.XOZU4OFA.js","./chunk.WV6SP6IJ.js","./chunk.PZ3KM3TY.js","./chunk.CA2SYEYE.js","./chunk.MH3AQO2R.js","./chunk.J2N7EKMX.js","./chunk.P26ATAAI.js","./chunk.FIY4RUK5.js","./chunk.IY3DV52G.js","./chunk.QNC2OKLF.js","./chunk.FWXW4T4I.js","./chunk.SDO3U72B.js","./chunk.DHPXRDT5.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.KEGL6NBD.js")):He("pages");try{on?await Jo(decodeURIComponent(on[1])):await Yo()}catch(t){let r=document.createElement("pre");r.setAttribute("role","alert"),r.style.cssText="margin:2rem;font:14px/1.5 ui-monospace,monospace;white-space:pre-wrap",r.textContent=t instanceof Error?t.message:String(t),an.replaceChildren(r),window.__graviewFailed=r.textContent}async function Jo(t){let r=await fetch(`/graview/document?form=${encodeURIComponent(t)}`),o=await r.json();if(!r.ok)throw new Error(o.error??`The preview server did not hand over the form (${r.status}).`);let i=await ft(o);if(!i.ok)throw new Error(ct(i.findings));let l=i.app,p=o.principal,c=await vt({app:l,url:location.origin,principal:p,...o.state?{state:o.state,openTimeoutMs:0}:{openTimeoutMs:3e3}});document.title=l.forms?.[t]?.title??l.name;let{mount:b}=await Qr;window.__graview=b(an,{app:l,form:t,principal:p,remote:c,height:"100dvh",onSubmitted:()=>window.__graviewSubmitted=!0}),window.__graviewReady=!0}async function Yo(){let t=await fetch("/graview/document");if(!t.ok)throw new Error(`The preview server did not hand over the document (${t.status}).`);let r=await t.json(),i=await(async h=>{if(typeof h.module=="string")return(await import(h.module)).app;let k=await ft(h);if(!k.ok)throw new Error(ct(k.findings));return k.app})(r);if(!i||typeof i!="object"||!("schema"in i))throw new Error("The app module the preview server handed does not export an app.");let l=r.principal,p=await vt({app:i,url:location.origin,principal:l,live:!0,subprotocol:!0,pollMs:1200,...r.state?{state:r.state,openTimeoutMs:0}:{openTimeoutMs:3e3}});document.title=i.name;let c,b=rn({url:location.origin,principal:l,...r.views?{state:r.views}:{},onDeclaration:async()=>{let h=await(await fetch("/graview/document")).json();if(typeof h.module=="string")return;let k=await ft(h);k.ok&&c?.setApp(k.app,p)}});await Promise.all([Qr,b.ready]),c=Xt(an,{app:i,remote:p,principal:l,studio:!1,face:"pages",routing:"address",bar:!0,height:"100dvh",label:i.name,heading:1,keptViews:b,...r.draftView?{draftView:r.draftView}:{}}),window.__graview=c,c.drawn().then(()=>{window.__graviewReady=!0})}
1
+ var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as Wt,b as cr,c as lr,d as ur,e as fr,f as Dt,g as pr,h as jt}from"./chunk.G5AF5IXL.js";import{a as fo}from"./chunk.5WCSQFS5.js";import{a as mr,b as hr,c as Kt,d as yr,e as zt,f as wr,g as vr,h as br,i as Gt,j as Sr,k as Pr,l as Ar,m as Rr,n as kr,o as Er,p as Tr,q as xr,r as Fr,s as Or,t as Cr,u as Ye}from"./chunk.TBEKEHFS.js";import{b as gr}from"./chunk.LHCGC3K6.js";import{c as qt}from"./chunk.L3MLGFIS.js";import{a as Ot}from"./chunk.Q5WEOX3Q.js";import{b as Ct,i as Hn}from"./chunk.OYMN3IFX.js";import{n as ct}from"./chunk.N3MXLORL.js";import{D as _t,G as ar,L as ir,P as sr,Q as dr,k as Xn,n as er,o as tr,p as It,q as nr,s as rr,w as or}from"./chunk.RJ7VSWTA.js";import{c as uo}from"./chunk.P43LPXXJ.js";import{Ea as qn,Fa as Kn,G as $n,Ga as zn,Ha as Gn,Ia as Un,Ka as Jn,La as Yn,Na as Qn,Oa as $t,Ra as Zn,Ua as ft,Y as In,a as Nn,b as lt,c as ut,ca as _n,j as Vn,la as Wn,m as Vt,ma as Dn,oa as jn}from"./chunk.JCKIJSW7.js";import{a as Ne}from"./chunk.SDO3U72B.js";import{Be as Bt,Ce as Mt,De as Ht,Ge as Mn,Hc as Lt,He as Nt,Ib as st,Ic as En,Jb as An,Kd as Tn,Ld as xn,Td as Fn,Vd as On,Wd as Cn,Yb as Rn,Yd as dt,_b as kn,ue as Fe,ve as Ln,we as Bn,xb as Ke,zb as Pn}from"./chunk.6L6RUOSF.js";import"./chunk.FQLNBIQ5.js";import{b as qe}from"./chunk.AJZBJBMO.js";async function pt(t,r={}){let o=t.compiled===void 0||!mo(t.compiled,t.document)?void 0:Hn(t.compiled,r);if(o?.ok)return o;let{compileDocumentWithoutCheck:s}=await po();return s(t.document,r)}var Lr,po=()=>Lr??=(__graviewPreload(import.meta.url,["./chunk.4O64QV2Y.js","./chunk.OYMN3IFX.js","./chunk.FOHZPYUV.js","./chunk.W6L2VAJG.js","./chunk.N3MXLORL.js","./chunk.6L6RUOSF.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.JREA2XDG.js")).catch(t=>{throw Lr=void 0,t});function mo(t,r){let o=typeof t=="object"&&t!==null?t.document:void 0,s=r;if(typeof s=="string")try{s=JSON.parse(s)}catch{return!1}return o!==void 0&&Ot(Ct(o).document)===Ot(Ct(s).document)}var c=qe($n(),1);var ht=qe($n(),1),Ut="data-graview-drawn",ho=200,Br=50,yo=1e4,mt=()=>typeof performance<"u"?performance.now():Date.now();function go(t){let r=[...t.querySelectorAll("img")];for(let o of t.querySelectorAll("[data-worker-view]"))o.shadowRoot&&r.push(...o.shadowRoot.querySelectorAll("img"));return r}function wo(t,r){if(t.ownerDocument.fonts?.status==="loading"||qn()>0||Un(r)>0||t.querySelector('[aria-busy="true"]')||go(t).some(s=>!s.complete&&s.loading!=="lazy"))return!1;for(let s of t.querySelectorAll("[data-worker-view-place]"))if(!s.querySelector("[data-worker-view][data-worker-view-drawn], [data-worker-view][data-worker-view-failed]"))return!1;return!0}function Mr(t){let r=t.querySelector("[data-embed-content]"),o=[...t.querySelectorAll("[data-worker-view]")].map(s=>`${s.offsetWidth}x${s.offsetHeight}`);return`${t.scrollWidth}x${t.scrollHeight}|${r?`${r.scrollWidth}x${r.scrollHeight}`:""}|${o.join(",")}`}function vo(t,r,o,s){t.removeAttribute(Ut);let l=t.ownerDocument.defaultView;if(!l)return()=>{};let m=mt(),d=m,w=Mr(t),h=!1,E,L=typeof MutationObserver>"u"?void 0:new MutationObserver(x=>{x.some(B=>!(B.target===t&&B.attributeName===Ut))&&(d=mt())});L?.observe(t,{childList:!0,subtree:!0,characterData:!0,attributes:!0});let _=()=>{h=!0,L?.disconnect(),E!==void 0&&clearTimeout(E)},v=x=>{let B=!1,te=()=>{B||(B=!0,x())};typeof l.requestAnimationFrame=="function"&&l.requestAnimationFrame(()=>setTimeout(te,0)),setTimeout(te,100)},T=()=>{if(h)return;let x=Mr(t);x!==w&&(w=x,d=mt());let B=mt();if(wo(t,s)&&B-d>=ho||B-m>=yo){v(()=>{h||(_(),t.setAttribute(Ut,r),Yn(),o())});return}E=setTimeout(T,Br)};return E=setTimeout(T,Br),_}function Hr(t,r,o,s,l){Jn();let m=(0,ht.useRef)({place:o,onDrawn:s});m.current={place:o,onDrawn:s},(0,ht.useLayoutEffect)(()=>{l&&Gn(l);let d=E=>vo(E,m.current.place.path,()=>m.current.onDrawn?.(m.current.place),l);if(t.current)return d(t.current);let w,h=!1;return queueMicrotask(()=>{!h&&t.current&&(w=d(t.current))}),()=>{h=!0,w?.()}},[r,t,l])}var $r=qe(fo(),1);var C=qe(uo(),1);var g=qe(In(),1);function yt(t,r={}){let o=$t(t);return{Face:o.part((l,m)=>(0,c.createElement)(l,m),r),fetch:()=>o.load().then(()=>{}),here:()=>o.current!==void 0||o.failed}}var Qt=t=>Promise.all([t,sr()]).then(([r])=>r),Ir=Ne(()=>(__graviewPreload(import.meta.url,["./chunk.4HU2ILFY.js","./chunk.EPSYX2SF.js","./chunk.JLNTE5CH.js","./chunk.T6UJEXFL.js","./chunk.4QMAYVPU.js","./chunk.ZONRIOIA.js","./chunk.NXHEOHRR.js","./chunk.HJCQ6I3S.js","./chunk.DJGZOPAS.js","./chunk.GFOZVQBQ.js","./chunk.3RRK6UTN.js","./chunk.MWWNKM3I.js","./chunk.6A3KTD66.js","./chunk.U5P23GO7.js","./chunk.RO3D2RNP.js","./chunk.MEAUTBVM.js","./chunk.OKHXXIMN.js","./chunk.NH3VXTGX.js","./chunk.6IMRCKB4.js","./chunk.GFBE4VNT.js","./chunk.RDUGUC7R.js","./chunk.OPMGQS5J.js","./chunk.PQTXM4VY.js","./chunk.BIDL7GQD.js","./chunk.7KX36ENH.js","./chunk.QDDDKEBH.js","./chunk.QKRQPUCE.js","./chunk.TBEKEHFS.js","./chunk.LHCGC3K6.js","./chunk.Q5WEOX3Q.js","./chunk.4O64QV2Y.js","./chunk.OYMN3IFX.js","./chunk.UQZ2P6KD.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.4YZ2A6SJ.js"))),bo=Ne(()=>(__graviewPreload(import.meta.url,["./chunk.6BBUTKFC.js","./chunk.Z22C2JJ4.js","./chunk.MKJV3BM5.js","./chunk.CEOQY5KS.js","./chunk.Q355UPFG.js","./chunk.4HU2ILFY.js","./chunk.WGH2P2YL.js","./chunk.EHLV3LND.js","./chunk.EPSYX2SF.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.MB7LKKUD.js","./chunk.QJJWAYHB.js","./chunk.6A3KTD66.js","./chunk.MQNW3O67.js","./chunk.67S2UWBT.js","./chunk.7PWLRRUS.js","./chunk.OKHXXIMN.js","./chunk.NH3VXTGX.js","./chunk.6IMRCKB4.js","./chunk.7KX36ENH.js","./chunk.BJUUSIQY.js","./chunk.QDDDKEBH.js","./chunk.QKRQPUCE.js","./chunk.XOZU4OFA.js","./chunk.KBJ3UUER.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.EUXAIG73.js"))),So=Ne(()=>(__graviewPreload(import.meta.url,["./chunk.6BBUTKFC.js","./chunk.Z22C2JJ4.js","./chunk.MKJV3BM5.js","./chunk.CEOQY5KS.js","./chunk.Q355UPFG.js","./chunk.4HU2ILFY.js","./chunk.WGH2P2YL.js","./chunk.EHLV3LND.js","./chunk.EPSYX2SF.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.MB7LKKUD.js","./chunk.QJJWAYHB.js","./chunk.6A3KTD66.js","./chunk.MQNW3O67.js","./chunk.67S2UWBT.js","./chunk.7PWLRRUS.js","./chunk.OKHXXIMN.js","./chunk.NH3VXTGX.js","./chunk.6IMRCKB4.js","./chunk.7KX36ENH.js","./chunk.BJUUSIQY.js","./chunk.QDDDKEBH.js","./chunk.QKRQPUCE.js","./chunk.XOZU4OFA.js","./chunk.KBJ3UUER.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.TUBY6SV3.js"))),_r=yt(()=>Qt(Ir().then(t=>t.SceneFace)),{what:"This view"}),Wr=yt(()=>Ir().then(t=>t.SceneKeeping),{quiet:!0}),Dr=yt(()=>Qt(bo().then(t=>t.PagesContent)),{what:"This page"}),jr=yt(()=>Qt(So().then(t=>t.PictureFace)),{what:"This picture"}),Po=_r.Face,Ao=Wr.Face,Ro=Dr.Face,ko=jr.Face;qt(Ne(()=>(__graviewPreload(import.meta.url,["./chunk.Q6GEPVQ7.js","./chunk.CEQQIW7Z.js","./chunk.Z2BCOZDZ.js","./chunk.WGH2P2YL.js","./chunk.GOVRX2YX.js","./chunk.TRP66PHK.js","./chunk.PGT4ZQDG.js","./chunk.UZKBFI52.js","./chunk.MFMC35ET.js","./chunk.GKYJQE5A.js","./chunk.EZQK23AB.js","./chunk.QDVGHI7R.js","./chunk.M5FP4Y4Q.js","./chunk.RSMCTI2N.js","./chunk.PQTXM4VY.js","./chunk.7KX36ENH.js","./chunk.UQZ2P6KD.js","./chunk.MT252WP4.js","./chunk.6L6RUOSF.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.KZUHXOZU.js"))));function Ve(...t){let r=t.length>0?t:["scene","pages","picture"],o=new Set(r.flatMap(qr));return Promise.all([...[...o].map(s=>s.fetch()),rr()]).then(()=>{},()=>{})}var qr=t=>t==="pages"?[Dr]:t==="picture"?[jr]:[_r,Wr],Kr=t=>qr(t).every(r=>r.here()),Eo=150,Jt=0;function Nr(t,r){if(Kr(t))return r();let o=++Jt,s=()=>{o===Jt&&(Jt+=1,r())};Ve(t).then(s),setTimeout(s,Eo)}var To=768;function xo(t,r){let o=r!==null&&r>=To;(0,c.useEffect)(()=>{if(!o||t==="picture")return;let s=t==="pages"?"scene":"pages";if(Kr(s))return;let l=globalThis,m=()=>void Ve(s),d=()=>{},w=Qn(()=>{if(l.requestIdleCallback&&l.cancelIdleCallback){let h=l.requestIdleCallback(m,{timeout:4e3});d=()=>l.cancelIdleCallback?.(h)}else{let h=setTimeout(m,1500);d=()=>clearTimeout(h)}});return()=>(w(),d())},[t,o])}function Fo({asked:t,shown:r,onDrawn:o}){return(0,c.useLayoutEffect)(()=>o(t,r),[t,r,o]),null}function Oo({auto:t,scene:r}){return(0,g.jsx)("div",{"data-embed-content":"","aria-busy":"true",style:{flex:t?r?`0 0 ${Gt}px`:"0 0 auto":"1 1 auto",minHeight:0,background:"var(--graview-ground)"}})}var Co=$t(Ne(()=>(__graviewPreload(import.meta.url,["./chunk.AJZBJBMO.js"]),import("./chunk.5JNXQHN4.js")))).part((t,r)=>(0,g.jsx)(t.StudioPlace,{...r}),{quiet:!0});function zr(t,r,o,s,l){return Dt(t,fr(r?ut(r):l??Nn,s),o)}function Zt(t){return t&&ut(t).overview?"graview":"scene"}function Vr(t,r){if(r.homeView?.()===void 0)return!1;let o=t.pages?.first?.trim();return o===void 0||o===""||o==="/"||o.toLowerCase()==="home"}function Gr(t){let[,r]=(0,c.useState)(!1),o=(0,c.useCallback)(()=>r(!0),[]),s=(0,c.useRef)(!1);return t.at&&!gt?(0,g.jsx)(Kt,{onReady:o,fetch:Xt}):!s.current&&hr(t.draftView)?(0,g.jsx)(Kt,{onReady:o,fetch:mr}):(s.current=!0,(0,g.jsx)(Lo,{...t}))}function Lo(t){let{app:r,stop:o,bar:s=!0,standing:l="Everything is in order",principal:m,heading:d=2}=t,{rootRef:w,scope:h,css:E,scheme:L,store:_,presence:v,brand:T,auto:x,height:B}=Sr(t),te=yr(t.draftView),k=vr(t,dr,te.over),[le]=(0,c.useState)(zn),u=t.basePath===void 0?{}:{basePath:t.basePath},[$]=(0,c.useState)(It),I=t.notices??$,z=p=>Bt(p,u),oe={...t.routing?{routing:t.routing}:{},...u},[ae]=(0,c.useState)(()=>{let p=t.at?.face;if(p)return p;let j=o===void 0&&Vr(r,k)?"pages":Zt(o),ve=Wt({...oe,face:j});return t.face===void 0&&t.onOpening?.(ve),ve}),[Se,O]=(0,c.useState)(()=>t.face!==void 0&&t.face!=="pages"&&!t.at&&o===void 0&&cr(oe)&&Vr(r,k)),Pe=(0,c.useRef)(t.onFace);Pe.current=t.onFace,(0,c.useLayoutEffect)(()=>{Se&&(Pe.current?.("pages"),O(!1))},[Se]);let R=Se?"pages":t.face??ae,b=r.schema.kinds,V=t.routing==="address",Ae=(0,c.useMemo)(()=>t.at?gt.settleAt(t,_.seenBy(m??{kind:"human"}),k.places()):void 0,[]),M=(0,c.useMemo)(()=>Dn(k,r.schema),[k,r.schema]),me=(0,c.useMemo)(()=>{let p=Ae?.stop??(V?lr(t.basePath):void 0)??o;return R==="scene"&&p===void 0&&M===void 0&&(t.path===void 0||Yt(t.path))?jt(void 0):zr(R,p,b,k.places(),M)},[]),[W]=(0,c.useState)(R);(0,c.useEffect)(()=>{W!=="pages"&&Wn(k)},[W,k]);let H=(0,c.useRef)(void 0),q=p=>p===void 0||Yt(p)?"/":p;H.current??={path:q(Ae?.path??(V?R==="pages"?(Mt(window.location.pathname,t.basePath)??"/")+window.location.search:"/":t.path)),asked:t.path},t.path!==H.current.asked&&(H.current={path:q(t.path),asked:t.path});let Z=(0,c.useRef)(t.onNavigate);Z.current=t.onNavigate;let Ce=(0,c.useCallback)((p,j)=>{H.current.path=p,Z.current?.(p,j)},[]),{at:he,setAt:D,steering:G,steer:ne}=Fr(H.current.path),N=(0,c.useContext)(Ur);N&&(N.pages=()=>H.current.path);let[$e]=(0,c.useState)(()=>({})),Y=N??$e,ie=(0,c.useMemo)(()=>er(I),[I]),K=(0,c.useRef)(void 0),Le=(0,c.useCallback)(p=>void(H.current.path=p),[]),U=Xn(w),[ue,Be]=(0,c.useState)(!1),Re=t.pagesBelow!==void 0&&U!==null&&U<t.pagesBelow&&(R==="scene"||R==="graview")&&!ue,S=Re?"pages":R,ye=(0,c.useRef)(!1);ye.current=ue&&t.pagesBelow!==void 0&&U!==null&&U<t.pagesBelow&&(R==="scene"||R==="graview"),N&&(N.shown=S);let ge=(0,c.useRef)(R==="graview"?"graview":"scene");(S==="scene"||S==="graview")&&(ge.current=S),(0,c.useState)(()=>{if(!V||typeof window>"u"||S==="pages"||S==="picture")return;let{pathname:p,search:j,hash:ve}=window.location;Mt(p,t.basePath)==="/"&&window.history.replaceState(window.history.state,"",`${z(Fe)}${j}${ve}`)}),br(w,S,t.onIntrinsicHeight),xo(S,U);let ke=Or(t.onError,S),fe=Cr(t.onReady,S),Me=(0,c.useRef)(t.onFaceDrawn);Me.current=t.onFaceDrawn;let He=(0,c.useCallback)((p,j)=>{fe(j),Me.current?.(p)},[fe]),[Ze,Ie]=(0,c.useState)(null),Xe=k.places(),_e=(0,c.useRef)({shown:S,onFace:t.onFace});_e.current={shown:S,onFace:t.onFace};let We=(0,c.useCallback)((p,j,ve)=>{if(V){K.current?.(p,j,ve);return}_e.current.onFace?.(p),Z.current?.(p==="pages"?j??H.current.path:Fe,"push")},[V]),[J,se]=(0,c.useState)(void 0);(0,c.useEffect)(()=>{S==="pages"&&se(void 0)},[S]);let Q=(0,c.useRef)(o);(0,c.useEffect)(()=>{Q.current!==o&&(Q.current=o,se(void 0))},[o]);let De=(0,c.useCallback)(p=>{if(_e.current.shown==="pages"){if(Be(!0),se(p),R==="scene"||R==="graview"){Nr(R,()=>{V?window.history.pushState(null,"",`${z(Fe)}${p??""}`):Z.current?.(Fe,"push")});return}Nr(ge.current,()=>We(ge.current,void 0,p))}},[V,R,t.basePath,We]),de=(0,c.useCallback)(p=>{if(_e.current.shown==="pages"){G.go.current||(H.current.path=p),ne(p);return}if(H.current.path=p,D(p),ye.current){Be(!1),V?window.history.pushState(null,"",z(p)):Z.current?.(p,"push");return}We("pages",p)},[G,ne,D,We,V,t.basePath]),et=k.arrangement?.(),Ee=S==="pages",we=t.hrefOf,Te=we??(V?z:void 0),Pt=(0,c.useMemo)(()=>({open:de,...we?{href:we}:V?{href:p=>Bt(p,t.basePath===void 0?{}:{basePath:t.basePath})}:{}}),[de,V,t.basePath,we]);return(0,g.jsxs)("section",{ref:w,className:h,"aria-label":t.label??r.name,"data-graview-embed":S,"data-graview-scheme":L,...Re?{"data-graview-embed-narrow":""}:{},style:{position:"relative",isolation:"isolate",height:B,minHeight:x?0:320,display:"flex",flexDirection:"column",overflow:"hidden",borderRadius:"var(--graview-radius, 12px)"},children:[(0,g.jsx)("style",{children:E}),(0,g.jsxs)(Zn.Provider,{value:ke,children:[(0,g.jsx)(Pr,{rootRef:w,board:I,onReport:t.onReport,where:()=>S==="pages"?Ar(he):S==="picture"?{place:"picture"}:tr(Y.view?.focusId)}),(0,g.jsx)(wr,{rootRef:w,firstLook:t.firstLook,app:ar(T??{name:r.name},r.schema)}),(0,g.jsx)(Ye,{module:"@graview/react",report:ke,content:!0,children:(0,g.jsx)(Kn.Provider,{value:le,children:(0,g.jsx)(_n,{store:_,views:k,initialView:me,scheme:L,...Rr(t,v,T),...t.onSeat?{onSeat:t.onSeat}:{},children:(0,g.jsxs)(nr.Provider,{value:ie,children:[(0,g.jsx)(No,{face:S,stop:J??o,kinds:b,places:Xe,opens:M}),(0,g.jsx)(Bo,{into:Y}),(0,g.jsx)(Mo,{rootRef:w,face:R,shown:S,path:he,stop:o,draft:te.n,onDrawn:t.onDrawn,parts:le}),V?(0,g.jsx)(ur,{pagesWere:Ae?.path,basePath:t.basePath,shown:S,onFace:t.onFace,toggle:K,kinds:b,places:Xe,opens:M,landed:Le}):null,s&&S!=="picture"?(0,g.jsx)(Ye,{module:"@graview/embed",report:ke,children:(0,g.jsx)(kr,{name:T?.name??r.name,heading:d,named:zt(s).name!==!1,faces:zt(s).faces===!1?void 0:{scene:{label:Ln(et),current:!Ee,go:()=>De(),reach:()=>void Ve(ge.current)},pages:{label:Bn(et),current:Ee,go:()=>de(H.current.path),reach:()=>void Ve("pages")}},at:Ee?he:null,without:t.pages?.without(),home:{...Te?.("/")!==void 0?{href:Te("/")}:{},go:()=>de("/"),current:Ee&&he.split("?")[0]==="/"},reach:{...Te?{href:Te}:{},go:p=>de(p.path)},standing:l,hostActions:t.hostActions,barActions:t.barActions,appMenu:t.appMenu,schemeChoice:t.schemeChoice,share:t.share,status:t.status,keeping:Ee?void 0:(0,g.jsx)(Vo,{app:r,studio:t.studio,report:ke}),onFind:Ie})}):null,(0,g.jsx)(or.Provider,{value:Ze,children:(0,g.jsx)(Ye,{module:S==="pages"||S==="picture"?"@graview/pages":"@graview/react",report:ke,content:!0,children:(0,g.jsxs)(c.Suspense,{fallback:(0,g.jsx)(Oo,{auto:x,scene:S!=="pages"&&S!=="picture"}),children:[S==="picture"?(0,g.jsx)(ko,{scope:h,store:_,views:k,as:(o?ut(o).within?.view:void 0)??""}):S==="pages"?(0,g.jsx)(Ro,{store:_,views:k,presence:v,auto:x,brand:T,steering:G,overview:De,scope:h,titleLevel:xr(d),quickAsk:_t(t.quickAsk),props:{...t,onNavigate:Ce,...V?{}:{path:H.current.path}}}):(0,g.jsx)(jn.Provider,{value:Pt,children:(0,g.jsx)(Po,{address:V,auto:x,scheme:L,scope:h,quickAsk:_t(t.quickAsk)})}),(0,g.jsx)(Fo,{asked:R,shown:S,onDrawn:He})]})},S)})]})})})})]})]})}var Yt=t=>t.split(/[?#]/)[0]===Fe,Ur=(0,c.createContext)(null);function Bo({into:t}){return t.view=ft().view,null}function Mo({rootRef:t,face:r,shown:o,path:s,stop:l,draft:m,onDrawn:d,parts:w}){let{view:h}=ft(),E=o==="scene"||o==="graview",L=lt(h),{pan:_,...v}=h,T=h.pan?lt(v):L,x={face:r,path:E?Fe:o==="picture"?l??"#":s,stop:L};return Hr(t,`${o} ${E?T:x.path} ${m}`,x,d,w),null}var gt,Ho=Ne(()=>(__graviewPreload(import.meta.url,["./chunk.G5AF5IXL.js","./chunk.RJ7VSWTA.js","./chunk.P43LPXXJ.js","./chunk.JCKIJSW7.js","./chunk.SDO3U72B.js","./chunk.6L6RUOSF.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.W3TJF4EH.js"))),Xt=()=>Ho().then(t=>void(gt=t),()=>new Promise(t=>{let r=()=>{window.removeEventListener("online",r),clearTimeout(o),t()},o=setTimeout(r,1e4);window.addEventListener("online",r)}).then(Xt));function No({face:t,stop:r,kinds:o,places:s,opens:l}){let{view:m,go:d}=ft(),w=(0,c.useRef)({face:t,stop:r});return(0,c.useLayoutEffect)(()=>{let h=w.current.stop!==r,E=w.current.face!==t,L=w.current.face==="pages";if(w.current={face:t,stop:r},!h&&!E||t==="pages"||t==="picture")return;let _=(h||L)&&r!==void 0?zr(t,r,o,s):L&&pr(m)?Dt(t,jt(l),o):t==="graview"?Vt(m,!0):m.overview?Vn(Vt(m,!1),ir(m,o)):m;d(_)},[t,r,o,m,d,l]),null}function Vo({app:t,studio:r,report:o}){return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(c.Suspense,{fallback:null,children:(0,g.jsx)(Ao,{})}),r!==!1?(0,g.jsx)(Ye,{module:"@graview/studio",report:o,children:(0,g.jsx)($o,{app:t,studio:r})}):null]})}function $o({app:t,studio:r}){let o={app:t,within:"box",...r?{onApply:r.onApply}:{},...r?.landmark?{landmark:r.landmark}:{},...r?.offered!==void 0?{offered:r.offered}:{}},s=r?.place;return s?(0,g.jsx)(s,{...o}):(0,g.jsx)(c.Suspense,{fallback:null,children:(0,g.jsx)(Co,{...o})})}function Io({path:t,stop:r,...o},s){return{...o,app:s.app,at:s.at,remote:s.remote,...s.remote.presence?{presence:s.remote.presence}:{}}}function en(t,r){let o=r.store??r.remote?.store??gr(r.app,r.seed),s=r.notices??It(),l=null,m={},d=0,w=r.label,h=r.app,E=Promise.resolve(),L=r.at?.face??r.face,_=L===void 0?void 0:Wt({...r,face:L}),v=_??Zt(r.stop),T=null,x=[],B=u=>{if(T=u,u!==v)return;let $=x;x=[];for(let I of $)I()};function te(){let[u,$]=(0,c.useState)(_),[I,z]=(0,c.useState)(r.stop),[oe,ae]=(0,c.useState)(r.path),[Se,O]=(0,c.useState)(r.scheme??"auto"),[Pe,R]=(0,c.useState)(r.principal),[b,V]=(0,c.useState)(r.seats),[Ae,M]=(0,c.useState)(r.quickAsk),[me,W]=(0,c.useState)(r.people),[H,q]=(0,c.useState)(r.hostContext),[Z,Ce]=(0,c.useState)(r.brand),[he,D]=(0,c.useState)(r.whileAway),[G,ne]=(0,c.useState)(r.label),[N,$e]=(0,c.useState)(r.hostActions),[Y,ie]=(0,c.useState)(r.barActions),[K,Le]=(0,c.useState)(()=>Er(r)),[U,ue]=(0,c.useState)(void 0),[Be,Re]=(0,c.useState)(r.draftView);return l={app:S=>{ue(S),ae(void 0),z(void 0)},face:$,stop:z,path:ae,scheme:O,seat:R,seats:V,quickAsk:M,people:W,hostContext:q,brand:Ce,whileAway:D,label:ne,hostActions:$e,barActions:ie,hostBar:S=>Le(ye=>({...ye,...S})),draft:Re},(0,g.jsx)(Ur.Provider,{value:m,children:(0,g.jsx)(Gr,{...U?Io(r,U):r,store:o,notices:s,...u!==void 0?{face:u}:{},onOpening:S=>{v=S},...I!==void 0?{stop:I}:{},...oe!==void 0?{path:oe}:{},...Pe?{principal:Pe}:{},...b?{seats:b}:{},...Ae!==void 0?{quickAsk:Ae}:{},...me?{people:me}:{},...H?{hostContext:H}:{},...Z?{brand:Z}:{},whileAway:he,label:G,hostActions:N,barActions:Y,...Tr(K),draftView:Be,scheme:Se,onFace:S=>{v=S,$(S)},onSeat:R,onFaceDrawn:B},U?.n??0)})}let k=()=>{let u=m.view?.focusId,$=u?o.graph.getNode(u)?.kind:void 0,I=(m.shown??v)==="scene"||(m.shown??v)==="graview";return{face:v,path:I?Fe:m.pages?.()??r.path??"/",stop:m.view?lt(m.view):r.stop??"#",...$?{kind:$}:{}}},le=(0,$r.createRoot)(t);return(0,C.flushSync)(()=>le.render((0,g.jsx)(te,{}))),{get store(){return o},where:k,setApp:(u,$,I)=>{let z="graph"in $?{store:$}:$,oe=()=>{let ae=k();o=z.store,w=I?.label??(w===h.name?u.name:w),h=u,(0,C.flushSync)(()=>{l?.label(w),l?.app({app:u,remote:z,at:ae,n:++d})})};gt?oe():E=E.then(Xt).then(oe)},setFace:u=>{v=u,(0,C.flushSync)(()=>l?.face(u))},setStop:u=>(0,C.flushSync)(()=>l?.stop(u)),setPath:u=>(0,C.flushSync)(()=>{if(Yt(u)){(v==="pages"||v==="picture")&&(v="scene",l?.face("scene"));return}l?.path(u),v!=="pages"&&(v="pages",l?.face("pages"))}),setScheme:u=>(0,C.flushSync)(()=>l?.scheme(u)),setSeat:u=>(0,C.flushSync)(()=>l?.seat(u)),setSeats:u=>(0,C.flushSync)(()=>l?.seats(u)),setQuickAsk:u=>(0,C.flushSync)(()=>l?.quickAsk(u)),setPeople:u=>(0,C.flushSync)(()=>l?.people(u)),setHostContext:u=>(0,C.flushSync)(()=>l?.hostContext(u)),setBrand:u=>(0,C.flushSync)(()=>l?.brand(u)),setWhileAway:u=>(0,C.flushSync)(()=>l?.whileAway(u)),setDraftView:u=>(0,C.flushSync)(()=>l?.draft(u)),setLabel:u=>{w=u,(0,C.flushSync)(()=>l?.label(u))},setHostActions:u=>(0,C.flushSync)(()=>l?.hostActions(u)),setBarActions:u=>(0,C.flushSync)(()=>l?.barActions(u)),setAppMenu:u=>(0,C.flushSync)(()=>l?.hostBar({appMenu:u})),setShare:u=>(0,C.flushSync)(()=>l?.hostBar({share:u})),setStatus:u=>(0,C.flushSync)(()=>l?.hostBar({status:u})),setSchemeChoice:u=>(0,C.flushSync)(()=>l?.hostBar({schemeChoice:u})),setNotifications:u=>(0,C.flushSync)(()=>l?.hostBar({notifications:u})),drawn:()=>E.then(()=>T===v?void 0:new Promise(u=>x.push(u))),notify:u=>{let $;return(0,C.flushSync)(()=>{$=s.notify(u)}),$},unmount:()=>le.unmount()}}var wt=t=>`s${(t+1).toString(36)}`;var ee={seat:"x-graview-seat",roles:"x-graview-roles",kind:"x-graview-kind",name:"x-graview-name",for:"x-graview-for",forRoles:"x-graview-for-roles",forName:"x-graview-for-name",profile:"x-graview-profile",profileName:"x-graview-profile-name",forProfile:"x-graview-for-profile",forProfileName:"x-graview-for-profile-name",via:"x-graview-via"},ze={header:"x-graview-key",param:"graview_key",cookie:"graview_key"};function vt(t,r={}){try{let o=new URL(t),s=o.searchParams.get(ze.param);if(s)return o.searchParams.delete(ze.param),{url:o.origin+o.pathname.replace(/\/$/,"")+o.search,key:s,headers:{[ze.header]:s,...r}}}catch{}return{url:t.replace(/\/$/,""),headers:r}}var Jr="/graview/friction";var Yr="/graview/live",tn="graview.ship",nn=`${tn}.${st}`;var Ge=class extends Error{constructor(r){super(r),this.name="Superseded"}},Oe=t=>t?.lineage?{lineage:t.lineage}:{},_o=(t,r)=>`${t.calls.map(o=>o.name.replace(/-/g," ")).join(", ")} (${r instanceof Error?r.message.split(`
2
+ `)[0]??"":String(r)})`;function Wo(t){if(!t)return[];try{let r=t.storage.getItem(t.key);if(r===null)return[];t.storage.removeItem(t.key);let o=JSON.parse(r);return Array.isArray(o)?o.filter(s=>!!s&&Array.isArray(s.calls)):[]}catch{return[]}}var Ue=class extends Error{constructor(o){super(o.sentence);this.refusal=o;this.name="RemoteRefusedError"}},Do={401:"forbidden",403:"forbidden",404:"missing",413:"limit"},pe=class extends Error{constructor(o,s){super(o);this.conflicts=s;this.name="StaleWrite"}},Qe=class extends Error{constructor(r){super(r),this.name="Unreached"}},jo=new Set([502,503,504]);async function qo(t){try{return(await t.clone().json()).reason==="unavailable"}catch{return!1}}function Ko(){let t=Math.random().toString(36).slice(2,8),r=0;return()=>`local-${t}-${++r}`}var zo=1,Go=()=>({refusals:new Set,conflicts:new Set,statuses:new Set,helds:new Set,builds:new Set,who:new Set,declarations:new Set,tally:{reconnects:0,rebases:0,conflicts:0,resyncs:0}});async function bt(t){return(await Qr(t,Wo(t.carry),"This app was updated while your changes were on the way.",Go())).remote}async function Qr(t,r,o,s){let{key:l,...m}=vt(t.url,t.headers),d={...t,...m},w=d.fetch??fetch,h={"content-type":"application/json",...d.headers??{}},E={...St(d.principal),[ee.via]:d.via??"web"};Object.assign(h,E);let L=d.live===!0,_=d.presenceEveryMs,v=d.visible??Yo,T="connecting",x=s.statuses,B=s.tally,te=[],k,le=[],u=()=>T==="online"&&k!==void 0?"held":T,$=()=>{let e=u();if(s.told!==e){s.told=e;for(let n of[...x])n(e)}},I=e=>{if(!(e===T||ce)&&(T==="offline"&&e==="online"&&B.reconnects++,T=e,$(),e==="online"))for(let n of te.splice(0))n.again()},z=e=>{if(ce)return;let n=typeof e=="string"&&e.length>0?e:void 0,i=n!==k;if(k=n,oe(),!!i&&($(),n===void 0)){for(let a of le.splice(0))a();X&&clearTimeout(X),dn()}},oe=()=>{if(s.toldHeld!==k){s.toldHeld=k;for(let e of[...s.helds])e(k??null)}},ae=async(e,n)=>{let i;try{i=await w(e,n)}catch(a){throw p()||I("offline"),new Qe(a instanceof Error?a.message:String(a))}if(i.status===503&&await qo(i))return I("online"),i;if(jo.has(i.status))throw p()||I("offline"),new Qe(`The server is away (${i.status})`);return I("online"),i},Se=async(e=!1)=>{let n=`${d.url}/graview/state?opFormat=${Ke.op}`,i=e?await w(n,{headers:h}):await ae(n,{headers:h});if(!i.ok)throw new Error((await i.json().catch(()=>({}))).error??`The server refused (${i.status})`);return await i.json()},O=d.state??await Se(!0);L||(T="online"),k=typeof O.held=="string"&&O.held.length>0?O.held:void 0,oe();let Pe=O.enabledModules??d.enabledModules,R=d.localApp?d.localApp(d.app):d.app,b=new Cn({schema:R.schema,mutations:R.mutations??[],invariants:R.invariants??[],...R.policy?{policy:R.policy}:{},...R.publishing?{publishing:R.publishing}:{},...R.tidying?{tidying:R.tidying}:{},...R.modules?{modules:R.modules}:{},...Pe?{enabledModules:Pe}:{},...R.intelligence?{intelligence:R.intelligence}:{},...R.brand?.timeZone?{timeZone:R.brand.timeZone}:{},snapshot:O.snapshot,log:O.log,...O.horizon!==void 0?{horizon:O.horizon}:{},ids:Ko(),...d.storeOptions??{}});kn.served.add(b);let V=d.friction!==!1&&d.principal?.kind!=="visitor";V&&Tn(b,e=>{V&&w(`${d.url}${Jr}`,{method:"POST",headers:h,body:JSON.stringify({event:e})}).then(n=>void(V=n.status!==404&&n.status!==410),()=>{})});let Ae=Fn(b),M=O.log.at(-1)?.seq??(O.horizon??0)-1,me=Lt.of(O.log,{horizon:O.horizon??0}),W=null,H,q=new Map,Z=s.who,Ce=!1,he=e=>{if(ce)return;Ce=!0;let n=Mn(new Map,e,Date.now(),Ht,W?.participant);H!==void 0&&n.delete(H);let i=n.size!==q.size;if(!i)for(let[a,f]of n)Nt(f,q.get(a))||(i=!0);if(q=n,!!i)for(let a of[...Z])a([...q.values()])},D=[],G=new Set,ne=e=>{let n=D.indexOf(e);n>=0&&D.splice(n,1)},N=new Map,$e=(e,n)=>{let i=N.get(e);i&&(N.delete(e),i.resolve({ops:n.filter(a=>a.batch===e),batch:e}))},Y,ie=[],K=(e,n=[])=>{if(e.length===0&&n.length===0)return[];if(Y)return ie.push({ops:e,drop:n}),[];let i=Math.min(...e.filter(P=>P.seq>M).map(P=>P.seq));if(Number.isFinite(i)&&i>M+1)return ie.push({ops:e,drop:n}),U(),[];let a=D.filter(P=>e.some(re=>re.batch===P)),f=[...new Set([...n,...a])].filter(P=>G.has(P)),y,A=D.filter(P=>!a.includes(P));try{y=b.rebase({confirmed:e,pending:A,drop:f}).confirmed}catch(P){if(!(P instanceof On))throw P;return ie.push({ops:e,drop:n}),U(),[]}for(let P of a)ne(P);e.some(P=>P.seq>M)&&A.some(P=>!f.includes(P))&&B.rebases++,e.length>0&&(M=Math.max(M,...e.map(P=>P.seq)),me.note(e));for(let P of f)G.delete(P);for(let P of a)$e(P,e);return e.some(P=>P.lineage?.liftedStop===!0||P.undoes!==void 0&&(b.log.get(P.undoes)?.lineage?.stopsKind===!0||b.log.get(P.undoes)===void 0&&(b.stopsServed?.stops.length??0)>0))&&U(),y},Le=e=>{let n=e.stops??[],i=e.stoppedKinds??[];n.length===0&&i.length===0&&!b.stopsServed||(b.stopsServed=n.length>0||i.length>0?{stops:n,kinds:i}:void 0,b.notify(Pn,[]))};(O.stops||O.stoppedKinds)&&(b.stopsServed={stops:O.stops??[],kinds:O.stoppedKinds??[]});let U=()=>{Y||(Y=He(Se().then(e=>{if(ue(e)){ie=[];return}Le(e);let n=new Set(e.log.map(f=>f.batch)),i=D.filter(f=>n.has(f));for(let f of i)ne(f);let a=b.adopt({snapshot:e.snapshot,log:e.log,...e.horizon!==void 0?{horizon:e.horizon}:{},pending:[...D],drop:[...G].filter(f=>!D.includes(f))});G.clear();for(let f of a.pending)G.add(f.batch);M=e.log.at(-1)?.seq??(e.horizon??0)-1,me=Lt.of(e.log,{horizon:e.horizon??0}),B.resyncs++;for(let f of i)$e(f,e.log)}).then(()=>{Y=void 0;let e=ie;ie=[];for(let{ops:n,drop:i}of e)K(n,i)},()=>{Y=void 0,ie=[]})))},ue=e=>(typeof e.build=="string"&&ln(e.build),typeof e.version=="number"&&z(e.held),typeof e.version!="number"||e.version===O.version?!1:(kt(e.version),!0)),Be=async e=>{let i=await(await ae(`${d.url}/graview/since?seq=${wt(e)}&opFormat=${Ke.op}`,{headers:h})).json();return ue(i)?[]:((i.ops?.length??0)>0&&Le(i),i.reset===!0?(U(),[]):i.ops??[])},Re=async()=>{let e=await S();return Y&&await Y,e},S=async()=>{if(W&&!p()&&v()){let n=await(await ae(`${d.url}/graview/here?opFormat=${Ke.op}`,{method:"POST",headers:h,body:JSON.stringify({presence:W,seq:wt(M)})})).json();return ue(n)?[]:(typeof n.participant=="string"&&(H=n.participant),he(n.who??[]),K(n.ops??[]))}return K(await Be(M))},ye=new Map,ge=new Map,ke=new Set,fe=new Map,Me=new Set,He=e=>(Me.add(e),e.finally(()=>Me.delete(e)).catch(()=>{}),e),Ze=Promise.resolve(),Ie=0,Xe=(e,n)=>{let i=Ze.then(()=>We(e,n));return Ze=i.catch(()=>{}),i},_e=()=>new Promise((e,n)=>te.push({again:e,give:n})),We=async(e,n)=>{let i,a;for(;;){try{i=await ae(`${d.url}/graview/ops`,{method:"POST",headers:h,body:JSON.stringify({...e,opFormat:Ke.op})})}catch(F){if(!(F instanceof Qe)||Q)throw F;if(await _e(),p())return tt(e,n);continue}if(a=await i.json().catch(()=>({})),i.status===503&&a.reason==="unavailable"&&typeof a.held=="string"&&!Q){if(typeof a.version=="number"?ue(a):(z(a.held),!1))break;if(k!==void 0&&(Ft>0||L)){if(await new Promise(F=>le.push(F)),Q)throw new Ge("The client closed.");if(p())return tt(e,n);continue}}let A;if(i.status===503&&a.reason==="unavailable"&&!Q)A=rn(d.backoff,Ie++);else{if(Ie=0,i.status!==429||Q)break;A=Uo(i.headers.get("retry-after"),a.retryAfter)}if(await new Promise(F=>setTimeout(F,A)),p())return tt(e,n)}if(ce||ue(a))throw new Ge("The app was changed.");if(!i.ok){let A=a.error??`The server refused (${i.status})`;throw a.conflict?new pe(A,a.conflicts??[]):new Ue({reason:a.reason??Do[i.status]??"invalid",sentence:A,...a.wouldNeed?.length?{wouldNeed:a.wouldNeed}:{}})}let f=a.ops??[],y=f[0]?.seq;return y!==void 0&&y>M+1&&(f=await Be(M)),n!==void 0&&(a.batch&&ye.set(n,a.batch),ne(n)),K(f,n!==void 0?[n]:[]),{ops:a.ops??[],...a.batch?{batch:a.batch}:{}}},J,se=!1,Q=!1,De=0,de,et=0,Ee=0,we=null,Te=()=>{},Pt=new Promise(e=>{Te=e}),p=()=>L&&se&&J?.readyState===zo,j=e=>{if(!p())return!1;try{return J.send(JSON.stringify(e)),!0}catch{return!1}},ve=(e=!1)=>{!W||!p()||!v()||!e&&we&&Nt(W,we)&&(_===void 0||Date.now()-Ee<_)||j({t:"here",presence:W})&&(we=W,Ee=Date.now())},xe=new Set,X,dn=()=>{if(X=void 0,k!==void 0)return;let e=[...N.entries()].filter(([n])=>xe.has(n));xe.clear();for(let[,n]of e)j(n.message)},cn=(e,n)=>{N.has(e)&&(xe.add(e),X&&clearTimeout(X),X=setTimeout(dn,Math.max(0,n)))},eo=e=>{N.has(e)&&xe.add(e)},tt=(e,n)=>new Promise((i,a)=>{let f=n??`send-${++et}`,y=e.undo?{t:"undo",cid:f,batches:e.undo,...e.intent?{intent:e.intent}:{},...e.batch?{batch:e.batch}:{},...e.via?{via:e.via}:{},...Oe(e)}:{t:"call",cid:f,calls:e.calls??[],...e.intent?{intent:e.intent}:{},...e.batch?{batch:e.batch}:{},...e.base?.length?{base:e.base}:{},...e.via?{via:e.via}:{},...Oe(e)};if(N.set(f,{message:y,...n!==void 0?{mine:n}:{},resolve:i,reject:a}),xe.size>0||k!==void 0){xe.add(f);return}j(y)}),nt=(e,n)=>p()?tt(e,n):Xe(e,n),to=e=>{switch(e.t){case"welcome":{if(Le(e),ln(e.build),typeof e.version=="number"&&e.version!==O.version){kt(e.version);return}if(se=!0,De=0,typeof e.participant=="string"&&(H=e.participant),z(e.held),e.state?U():K(e.ops??[]),xe.clear(),X&&clearTimeout(X),X=void 0,k!==void 0)for(let n of N.keys())xe.add(n);else for(let n of N.values())j(n.message);ve(!0),I("online"),Te();return}case"ops":K(e.ops??[]);return;case"ack":{let n=N.get(e.cid);if(!n){K(e.ops??[]);return}N.delete(e.cid),Ie=0,n.mine!==void 0&&(ye.set(n.mine,e.batch),ne(n.mine)),K(e.ops??[],n.mine!==void 0?[n.mine]:[]),n.resolve({ops:e.ops??[],batch:e.batch});return}case"refused":case"conflict":{let n=N.get(e.cid);if(!n)return;if(e.t==="refused"&&e.reason==="unavailable"){k!==void 0?eo(e.cid):cn(e.cid,rn(d.backoff,Ie++));return}N.delete(e.cid),n.reject(e.t==="conflict"?new pe(e.sentence,e.conflicts??[]):new Ue({reason:e.reason??"invalid",sentence:e.sentence,...e.wouldNeed?.length?{wouldNeed:[...e.wouldNeed]}:{}}));return}case"busy":typeof e.cid=="string"&&cn(e.cid,typeof e.retryAfter=="number"?e.retryAfter:1e3);return;case"presence":he(e.who??[]);return;case"held":z(e.sentence);return;case"declaration":typeof e.version=="number"&&e.version!==O.version&&kt(e.version);return;case"reload":mn(typeof e.reason=="string"?e.reason:"This app was updated.");return;case"error":if(e.reopen===!0&&J){let n=J;yn(n);try{n.close(1e3,"Opening again.")}catch{}}return;default:return}},ce=!1,At=s.declarations,Rt=s.builds,ln=e=>{if(!(ce||s.otherBuild!==void 0||!d.build||typeof e!="string"||e.length===0||e===d.build)){s.otherBuild=e;for(let n of[...Rt])n(e)}},un=()=>{let e=[],n=0;for(let i of D){let a=fe.get(i);a?e.push({calls:a.calls,...a.intent?{intent:a.intent}:{},...a.via?{via:a.via}:{},...Oe(a),batch:i}):n++}return{carried:e,undos:n}},fn=(e,n)=>`${n} while ${e===1?"an undo of yours was":"undos of yours were"} on the way; ${e===1?"it was":"they were"} not made.`,pn=e=>{ce=!0,W=null;let n=new Ge(e);for(let a of N.values())a.reject(n);N.clear(),at&&clearInterval(at),Q=!0,de&&clearTimeout(de),X&&clearTimeout(X),be&&clearTimeout(be);for(let a of te.splice(0))a.give(n);for(let a of le.splice(0))a();let i=J;J=void 0,se=!1;try{i?.close(1e3,e)}catch{}Te()};async function kt(e){if(ce)return;if(!d.resolveApp){mn(`This app was changed on its server (version ${e}); reload the page to carry on.`);return}let{carried:n,undos:i}=un(),a=d.resolveApp,f=W;pn("The app was changed.");try{let y=await a(e),{state:A,...F}=d,P=await Qr({...F,app:y},n,"The app was changed while your changes were on the way.",s);f&&P.remote.presence.here(f);for(let it of[...At])it(P.remote,e);let re=[...i>0?[rt(fn(i,"The app was changed"))]:[],...P.unheard()];for(let it of re)for(let lo of je)lo(it.sentence,it)}catch(y){let A=`The app was changed, but the new version could not be opened: ${y instanceof Error?y.message:String(y)}`;for(let F of je)F(A,rt(A))}}function mn(e){if(ce)return;let{carried:n,undos:i}=un();pn(e);let a=!1;if(d.carry&&n.length>0)try{d.carry.storage.setItem(d.carry.key,JSON.stringify(n)),a=!0}catch{}let f=[];!a&&n.length>0&&f.push(`${e} ${n.length===1?"A change of yours was":`${n.length} changes of yours were`} not sent; make ${n.length===1?"it":"them"} again after the page reloads.`),i>0&&f.push(fn(i,"This app was updated"));for(let y of f)for(let A of je)A(y,rt(y));(d.reloadPage??Jo)()}let hn=()=>{if(Q||!L)return;let e=`${d.url.replace(/^http/,"ws").replace(/\/$/,"")}${Yr}`,{"content-type":n,...i}=h,a;try{a=d.socket?d.socket(e,i,[nn]):co(e,i)}catch{return gn()}J=a,se=!1,a.onopen=()=>{J===a&&a.send(JSON.stringify({t:"hello",seq:wt(M),protocol:st,wire:tn,opFormat:Ke.op,...d.build?{build:d.build.slice(0,64)}:{},...d.hostProtocol!==void 0?{hostProtocol:d.hostProtocol}:{}}))},a.onmessage=f=>{if(J!==a)return;let y;try{y=JSON.parse(String(f.data))}catch{return}to(y)},a.onclose=()=>yn(a),a.onerror=()=>{}},be,no=()=>{Ce=!1,be&&clearTimeout(be),be=setTimeout(()=>{if(be=void 0,Ce||Q)return;let e=new Map([...q].filter(([,n])=>n.held!=="socket"));if(e.size!==q.size){q=e;for(let n of Z)n([...q.values()])}},Ht),be.unref?.()};function yn(e){if(J!==e)return;let n=se;J=void 0,se=!1,we=null,n&&(I("offline"),no()),gn()}let gn=()=>{if(Q)return;let e=rn(d.backoff,De);De++,de=setTimeout(hn,e)},wn=b.applyAll.bind(b),ro=b.undo.bind(b),oo=b.previewAll.bind(b);b.previewAll=(e,n)=>oo(e,{...d.principal?{author:d.principal}:{},...n});let je=s.refusals,Je=[],rt=e=>({reason:"invalid",sentence:e}),ot=s.conflicts,Et=!1,vn,Tt=async(e,n)=>{if(n instanceof Ge||ce)return;let i=n instanceof Ue?n.refusal:Rn(n),a=i.sentence,f=n instanceof pe?vn?.yoursOf(b,fe.get(e)?.calls??[]):void 0;ne(e);try{K([],[e])}catch{}let y=fe.get(e);fe.delete(e);let A=y?.calls[0];if(A&&!(n instanceof pe)){let F=b.allMutations().find(re=>re.name===A.name)?.subject?.arg,P=F&&b.graph.getNode(A.args[F])?.kind;xn(b,{type:"refused",act:A.name,code:i.reason,...P?{kind:P}:{}},d.principal)}if(n instanceof pe&&B.conflicts++,n instanceof pe&&!p()&&await Re().catch(()=>[]),n instanceof pe&&Y&&await Y,n instanceof pe&&ot.size>0){let F=!1,P={sentence:a,conflicts:f?n.conflicts.map(re=>re.node===f.node&&re.field===f.field?{...re,yours:f.yours}:re):n.conflicts,keepTheirs(){F=!0},useMine(){if(!(F||!y)){F=!0,Et=!0;try{b.applyAll(f?[f.over(M)]:y.calls,{...y.intent?{intent:y.intent}:{},...y.via?{via:y.via}:{},...Oe(y)})}finally{Et=!1}}}};for(let re of ot)re(P);return}for(let F of je)F(a,i)},ao=(e,n)=>e.flatMap(i=>i.mutation?.name===An?[]:i.primitives.flatMap(a=>a.op==="splice-text"&&!n.has(a.id)&&!n.has(`${a.id}\0${a.field}`)?[{node:a.id,field:a.field,rev:M}]:[]));b.applyAll=(e,n)=>{let i=En(b.log.all().filter(A=>G.has(A.batch))),a=wn(e,{...d.principal?{author:d.principal}:{},...n}),f=e.map((A,F)=>{let P=a.minted?.[F];return P===void 0||A.args?.id!==void 0?A:{...A,mintedHint:P}});D.push(a.batch),G.add(a.batch),fe.set(a.batch,{calls:f,...n?.intent?{intent:n.intent}:{},...n?.via?{via:n.via}:{},...Oe(n)});let y=Et?[]:[...me.baseFor(a.ops,i,(A,F)=>b.collaborative(A,F)),...ao(a.ops,i)];return ge.set(a.batch,He(nt({calls:f,...n?.intent?{intent:n.intent}:{},batch:a.batch,...y.length>0?{base:y}:{},...n?.via?{via:n.via}:{},...Oe(n)},a.batch).catch(A=>Tt(a.batch,A)))),a},b.apply=(e,n)=>b.applyAll([e],n),b.undo=(e,n)=>{let i=typeof e=="string"?[e]:e,a=ro(i.map(y=>ye.get(y)??y),{...d.principal?{author:d.principal}:{},...n});D.push(a.batch),G.add(a.batch);let f=Promise.allSettled(i.map(y=>ge.get(y)));return ge.set(a.batch,He(f.then(()=>{let y=i.filter(A=>!ke.has(A));if(y.length===0){ne(a.batch),fe.delete(a.batch),K([],[a.batch]);return}return nt({undo:y.map(A=>ye.get(A)??A),...n?.intent?{intent:n.intent}:{},batch:a.batch,...n?.via?{via:n.via}:{},...Oe(n)},a.batch)}).catch(y=>Tt(a.batch,y)))),a};let io=async(e,n={})=>{xt++;try{return(await He(nt({calls:e,...n}))).ops}finally{xt--}},xt=0,bn={here(e){W=e,ve()},onWho(e){return Z.add(e),q.size>0&&e([...q.values()]),()=>{Z.delete(e)}},leave(){if(!W)return;let e=JSON.stringify({participant:H??W.participant});if(W=null,j({t:"bye"}))return;let n=globalThis.navigator?.sendBeacon;n?n.call(globalThis.navigator,`${d.url}/graview/leave${l!==void 0?`?${ze.param}=${encodeURIComponent(l)}`:""}`,e):w(`${d.url}/graview/leave`,{method:"POST",headers:h,body:e}).catch(()=>{})}},Ft=d.pollMs??800,at=Ft>0&&typeof setInterval=="function"?setInterval(()=>{p()||Re().catch(()=>{})},Ft):null;if(L){hn();let e;await Promise.race([Pt,new Promise(n=>e=setTimeout(n,d.openTimeoutMs??3e3))]),clearTimeout(e)}if(r.length>0&&!ce){let e=[],n=new Set(b.log.all().map(i=>i.batch));for(let i of r)if(!(i.batch!==void 0&&n.has(i.batch)))try{b.applyAll(i.calls,{...i.intent?{intent:i.intent}:{},...i.batch?{batch:i.batch}:{},...i.via?{via:i.via}:{},...Oe(i)})}catch(a){e.push(_o(i,a))}e.length>0&&Je.push(rt(`${o} ${e.length===1?"One no longer fits and was not made":`${e.length} no longer fit and were not made`}: ${e.join("; ")}.`))}let Sn=new Map,so=()=>({store:b,author:d.principal,appliedAll:wn,pending:D,provisional:G,asked:fe,answers:ge,letGo:ke,sent:(e,n)=>He(nt({calls:n,batch:e},e).catch(i=>Tt(e,i))),settle:ne,land:K,seen:()=>M,gone:()=>Q||ce});return{remote:{store:b,typing(e,n){let i=`${e}\0${n}`,a=Sn.get(i);return a||(a=(__graviewPreload(import.meta.url,["./chunk.OPMGQS5J.js","./chunk.6L6RUOSF.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.RHIP2UYE.js")).then(f=>(vn=f,f.typingOf(e,n,f.wireOf(so())))),Sn.set(i,a)),a},version:O.version,migrated:O.migrated??[],send:io,pull:Re,onRefusal(e){je.add(e);let n=Je;Je=[];for(let i of n)e(i.sentence,i);return()=>je.delete(e)},onDeclaration(e){return At.add(e),()=>At.delete(e)},onBuild(e){return Rt.add(e),s.otherBuild!==void 0&&e(s.otherBuild),()=>Rt.delete(e)},onConflict(e){return ot.add(e),()=>ot.delete(e)},revision:(e,n)=>me.of(e,n),seq:()=>M,participant:()=>H,transport:()=>p()?"socket":"poll",status:u,onStatus(e){return x.add(e),()=>x.delete(e)},held:()=>k,onHeld(e){return s.helds.add(e),k!==void 0&&e(k),()=>s.helds.delete(e)},counters:()=>({...B}),who:()=>[...q.values()],pending:()=>D.length+xt,async settled(){for(;Me.size>0;)await Promise.allSettled([...Me])},presence:bn,close(){at&&clearInterval(at),Ae(),bn.leave(),Q=!0,de&&clearTimeout(de),X&&clearTimeout(X),be&&clearTimeout(be);for(let n of te.splice(0))n.give(new Error("The client closed before the server could be reached."));for(let n of le.splice(0))n();let e=J;J=void 0,se=!1;try{e?.close(1e3,"Closed.")}catch{}}},unheard(){let e=Je;return Je=[],e}};function co(e,n){let i=globalThis.WebSocket;if(!i)throw new Error("This runtime has no WebSocket; the client polls instead.");let a=typeof globalThis.document<"u",f=d.subprotocol?[nn]:[];if(!a)try{return new i(e,{headers:n,...f.length>0?{protocols:f}:{}})}catch{}let y=new URL(e);for(let[A,F]of Object.entries(E))y.searchParams.set(A,F);return l!==void 0&&y.searchParams.set(ze.param,l),f.length>0?new i(y.toString(),f):new i(y.toString())}}function Uo(t,r,o=Date.now()){let s,l=t?.trim();if(l)if(/^\d+(\.\d+)?$/.test(l))s=Number(l)*1e3;else{let w=Date.parse(l);Number.isFinite(w)&&(s=Math.max(0,w-o))}let m=typeof r=="number"&&Number.isFinite(r)&&r>=0?r:void 0,d=m!==void 0&&m<50&&s!==void 0&&Math.abs(m*1e3-s)<1e3;return m!==void 0&&!d?m:s??1e3}function Jo(){globalThis.location?.reload?.()}function Yo(){return globalThis.document?.visibilityState!=="hidden"}function rn(t,r){if(typeof t=="function")return Math.max(0,t(r));let{min:o=250,max:s=1e4,factor:l=2}=t??{};return Math.min(s,o*l**r)*(.75+Math.random()*.5)}function St(t){let r={};if(!t)return r;t.id&&(r[ee.seat]=t.id),t.roles?.length&&(r[ee.roles]=t.roles.join(",")),t.kind!=="human"&&(r[ee.kind]=t.kind),t.name&&(r[ee.name]=encodeURIComponent(t.name)),t.profile&&(r[ee.profile]=t.profile.id,r[ee.profileName]=encodeURIComponent(t.profile.name));let o=t.onBehalfOf;return o?.profile&&(r[ee.forProfile]=o.profile.id,r[ee.forProfileName]=encodeURIComponent(o.profile.name)),o?.id&&(r[ee.for]=o.id),o?.roles?.length&&(r[ee.forRoles]=o.roles.join(",")),o?.name&&(r[ee.forName]=encodeURIComponent(o.name)),r}var Zr="/graview/views";function on(t){let r=t.fetch??fetch,o=vt(t.url,t.headers),s=o.url,l={"content-type":"application/json",...t.principal?St(t.principal):{},...o.headers},m=t.state?{hidden:t.state.hidden??[],removed:t.state.removed??[],may:t.state.may??dt.may}:dt,d=new Set,w=v=>{if(JSON.stringify(v)!==JSON.stringify(m)){m=v;for(let T of d)T()}},h=async(v,T)=>{let x=await r(`${s}${t.path??Zr}`,{method:v,headers:l,...T!==void 0?{body:JSON.stringify(T)}:{}}),B=await x.json();if(!x.ok)throw new Error(B.error??`The store answered ${x.status}.`);w({hidden:B.hidden??[],removed:B.removed??[],may:B.may??dt.may})},E=()=>h("GET"),L=t.state?Promise.resolve():E().catch(()=>{}),_=t.pollMs?setInterval(()=>void E().catch(()=>{}),t.pollMs):void 0;return{ready:L,refresh:E,close:()=>clearInterval(_),current:()=>m,onChange(v){return d.add(v),()=>void d.delete(v)},hide:v=>h("POST",{hide:v}),show:v=>h("POST",{show:v}),remove:(v,T)=>h("POST",{remove:v,...T?{about:T}:{}}),async restore(v){let T=m.removed.find(x=>x.name===v)?.lens;await h("POST",{restore:v}),T&&await t.onDeclaration?.()},async lens(v){await h("POST",{lens:v}),await t.onDeclaration?.()}}}var sn=document.getElementById("graview-app"),an=/^\/forms\/([^/]+)\/?$/.exec(location.pathname),Xr=an?(__graviewPreload(import.meta.url,["./chunk.Z22C2JJ4.js","./chunk.6IMRCKB4.js","./chunk.XOZU4OFA.js","./chunk.KBJ3UUER.js","./chunk.5WCSQFS5.js","./chunk.LHCGC3K6.js","./chunk.6TBQV3NO.js","./chunk.MT252WP4.js","./chunk.VVIQSFM4.js","./chunk.TQ3MNB6K.js","./chunk.VGYG2IBZ.js","./chunk.P43LPXXJ.js","./chunk.JCKIJSW7.js","./chunk.SDO3U72B.js","./chunk.6L6RUOSF.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.L6P55HFW.js")):Ve("pages");try{an?await Qo(decodeURIComponent(an[1])):await Zo()}catch(t){let r=document.createElement("pre");r.setAttribute("role","alert"),r.style.cssText="margin:2rem;font:14px/1.5 ui-monospace,monospace;white-space:pre-wrap",r.textContent=t instanceof Error?t.message:String(t),sn.replaceChildren(r),window.__graviewFailed=r.textContent}async function Qo(t){let r=await fetch(`/graview/document?form=${encodeURIComponent(t)}`),o=await r.json();if(!r.ok)throw new Error(o.error??`The preview server did not hand over the form (${r.status}).`);let s=await pt(o);if(!s.ok)throw new Error(ct(s.findings));let l=s.app,m=o.principal,d=await bt({app:l,url:location.origin,principal:m,...o.state?{state:o.state,openTimeoutMs:0}:{openTimeoutMs:3e3}});document.title=l.forms?.[t]?.title??l.name;let{mount:w}=await Xr;window.__graview=w(sn,{app:l,form:t,principal:m,remote:d,height:"100dvh",onSubmitted:()=>window.__graviewSubmitted=!0}),window.__graviewReady=!0}async function Zo(){let t=await fetch("/graview/document");if(!t.ok)throw new Error(`The preview server did not hand over the document (${t.status}).`);let r=await t.json(),s=await(async h=>{if(typeof h.module=="string")return(await import(h.module)).app;let E=await pt(h);if(!E.ok)throw new Error(ct(E.findings));return E.app})(r);if(!s||typeof s!="object"||!("schema"in s))throw new Error("The app module the preview server handed does not export an app.");let l=r.principal,m=await bt({app:s,url:location.origin,principal:l,live:!0,subprotocol:!0,pollMs:1200,...r.state?{state:r.state,openTimeoutMs:0}:{openTimeoutMs:3e3}});document.title=s.name;let d,w=on({url:location.origin,principal:l,...r.views?{state:r.views}:{},onDeclaration:async()=>{let h=await(await fetch("/graview/document")).json();if(typeof h.module=="string")return;let E=await pt(h);E.ok&&d?.setApp(E.app,m)}});await Promise.all([Xr,w.ready]),d=en(sn,{app:s,remote:m,principal:l,studio:!1,face:"pages",routing:"address",bar:!0,height:"100dvh",label:s.name,heading:1,keptViews:w,...r.draftView?{draftView:r.draftView}:{}}),window.__graview=d,d.drawn().then(()=>{window.__graviewReady=!0})}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graview",
3
- "version": "0.1.69",
3
+ "version": "0.1.71",
4
4
  "type": "module",
5
5
  "description": "The Graview command line: start a product, check its declaration, write its agent docs, serve its store, preview a document with no product and photograph its places, say whether a product is on one release, host it for an agent over MCP, apply an act to it, sync its seed, install the authoring skills. The tool; @graview/* is the framework.",
6
6
  "keywords": [
@@ -29,14 +29,14 @@
29
29
  }
30
30
  },
31
31
  "dependencies": {
32
- "@graview/guest": "0.1.69",
33
- "@graview/skills": "0.1.69",
34
- "@graview/tools": "0.1.69",
35
- "@graview/core": "0.1.69",
36
- "@graview/ship": "0.1.69"
32
+ "@graview/core": "0.1.71",
33
+ "@graview/guest": "0.1.71",
34
+ "@graview/ship": "0.1.71",
35
+ "@graview/skills": "0.1.71",
36
+ "@graview/tools": "0.1.71"
37
37
  },
38
38
  "engines": {
39
- "node": ">=22"
39
+ "node": ">=22.22.0"
40
40
  },
41
41
  "files": [
42
42
  "dist",
@@ -1 +0,0 @@
1
- import{a,b,c,d,e,f,g,h,i,j,k}from"./chunk.CCCONK73.js";import"./chunk.IO5VFTXC.js";import"./chunk.WV6SP6IJ.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.P26ATAAI.js";import"./chunk.FIY4RUK5.js";import"./chunk.IY3DV52G.js";import"./chunk.DHPXRDT5.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{g as columnActs,d as columnChoices,c as columnMoves,b as columnOf,e as columnReach,f as columnSteps,j as describePlace,k as placeText,h as resolveFor,i as shadowedPageSlots,a as statusColumns};
@@ -1 +0,0 @@
1
- import{a as _,b as C,c as D,d as I,e as j,f as P,g as x,i as N}from"./chunk.GG47EIKO.js";var Y=0,Z=1,K=2,q=3,F=1,Q=2,U=3,ee=1,ne=3,te=8,H="~",v=o=>typeof o=="object"&&o!==null&&!Array.isArray(o),$=new Set(["input","select","textarea","option"]),re=new Set(["value","checked","selected"]),z=["aria-label","aria-labelledby","title"],se=o=>z.some(d=>(o.getAttribute(d)??"").trim()!=="");function de(o,d){let c=o.ownerDocument??o,h=d.maxNodes??5e3,p=[],g=new Map,T=new WeakMap,E={dom:o,name:"div",namespace:"html",children:[],id:H};g.set(H,E);let k=0,S=!1,b=new WeakMap,w=new Map,A=new Map,l=e=>{p.push(e),p.length>200&&p.shift(),d.onRefused?.(e)},y=()=>({dom:c.createComment(""),children:[],refused:!0}),X=(e,i)=>{if(e.namespace==="html"&&e.name&&$.has(e.name))return e.dom;if(i?.namespace==="html"&&i.name==="textarea")return i.dom},R=(e,i)=>{let s=e.dom,r=b.get(s)??s.getAttribute("role");if(r===null||!r.split(/\s+/).some(t=>_.includes(t.toLowerCase())))return void b.delete(s);if(se(s)){b.delete(s),s.getAttribute("role")!==r&&s.setAttribute("role",r);return}b.set(s,r),s.removeAttribute("role"),i&&l({reason:"value",element:e.name,name:"role"})},J=()=>{if(A.size===0)return;let e=new Set,i=s=>{for(let r of s.children){if(r.refused||r.text)continue;let t=r.dom.getAttribute("id");t&&e.add(t),i(r)}};i(E);for(let[s,r]of A){if(s.id===void 0||g.get(s.id)!==s){A.delete(s);continue}let t=s.dom;for(let[n,u]of r){let a=u.value.split(/\s+/).filter(m=>m!==""),f=a.filter(m=>!e.has(m));if(a.length>0&&f.length===0){if(u.drawn)continue;u.drawn=!0,t.setAttribute(n,u.value),R(s,!1)}else u.drawn&&(u.drawn=!1,t.removeAttribute(n),l({reason:"reference",element:s.name,name:n,ids:f.length>0?f:a}),R(s,!0))}}},L=(e,i,s,r=!0)=>{let t=e.dom;if(s!=null&&typeof s!="string")return l({reason:"value",element:e.name,name:i});let n=N(e.namespace,e.name,i,s??null,d);if("refused"in n){let m=N(e.namespace,e.name,i,null,d);return"refused"in m||t.removeAttribute(m.name),!("refused"in m)&&m.name==="role"&&b.delete(t),l(n.refused)}for(let m of n.dropped??[])l(m);let u=e.namespace==="html"&&re.has(n.name)&&$.has(e.name),a=t,f=u?n.name==="value"?a.value:n.name==="checked"?a.checked:a.selected:void 0;if(n.name==="role"&&b.delete(t),C.includes(n.name)){let m=A.get(e)??new Map;n.value===null?m.delete(n.name):m.set(n.name,{value:n.value,drawn:!0}),m.size>0?A.set(e,m):A.delete(e)}n.value===null?t.removeAttribute(n.name):t.setAttribute(n.name,n.value),r&&(n.name==="role"||z.includes(n.name))&&R(e,n.name==="role"),d.onAttribute?.(t,n.name),u&&(n.name==="value"&&"value"in a?(a.value=n.value??"",f!==a.value&&d.onFieldSet?.(t)):n.name==="checked"&&"checked"in a?(a.checked=n.value!==null,f!==a.checked&&d.onFieldSet?.(t)):n.name==="selected"&&"selected"in a&&(a.selected=n.value!==null,f!==a.selected&&d.onFieldSet?.(t.parentElement?.closest("select")??t)))},O=e=>{if(!e.refused){k-=1,e.id!==void 0&&g.delete(e.id);for(let i of e.children)O(i)}},M=(e,i)=>{if(!v(e)||typeof e.id!="string"||g.has(e.id))return l({reason:"record"}),y();if(k>=h)return l({reason:"budget"}),S||(S=!0,d.onOverBudget?.()),y();let s=e.id;if(e.type===te)return y();if(e.type===ne){if(x(i.namespace,i.name))return l({reason:"child",element:i.name}),y();let a=c.createTextNode(String(e.data??"").slice(0,D)),f={dom:a,children:[],text:!0,id:s,parent:i};return g.set(s,f),T.set(a,s),k+=1,f}if(e.type!==ee)return l({reason:"record"}),y();let r=String(e.element);if(x(i.namespace,i.name))return l({reason:"child",element:r}),y();let t=P(r,i.namespace);if("refused"in t)return l(t.refused),y();let n=c.createElementNS(t.namespace==="svg"?j:I,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:s,parent:i};if(g.set(s,u),T.set(n,s),k+=1,v(e.attributes)){for(let[a,f]of Object.entries(e.attributes))L(u,a,f,!1);R(u,!0)}if(d.decorate?.(n,t.name,t.namespace),v(e.properties))for(let a of Object.keys(e.properties))l({reason:"attribute",element:t.name,name:a});if(v(e.eventListeners))for(let a of Object.keys(e.eventListeners))e.eventListeners[a]!=null&&l({reason:"attribute",element:t.name,name:`on${a}`});if(Array.isArray(e.children))for(let a of e.children){let f=M(a,u);u.children.push(f),n.appendChild(f.dom)}return u},V=e=>{if(!Array.isArray(e))return l({reason:"record"});let[i,s]=e,r=typeof s=="string"?g.get(s):void 0;if(!r)return l({reason:"record"});switch(i){case Y:{if(r.text)return l({reason:"record"});let t=Number(e[3]),n=Number.isInteger(t)&&t>=0&&t<=r.children.length?t:r.children.length,u=e[2],a=v(u)&&typeof u.id=="string"?w.get(u.id):void 0,f;a&&a.parent?.namespace===r.namespace&&!x(r.namespace,r.name)?(w.delete(u.id),a.parent=r,f=a):f=M(u,r),r.dom.insertBefore(f.dom,r.children[n]?.dom??null),r.children.splice(n,0,f),r.namespace==="html"&&r.name==="textarea"&&d.onFieldSet?.(r.dom);return}case Z:{let t=Number(e[2]),n=r.children[t];if(!n)return l({reason:"record"});r.children.splice(t,1),n.dom.parentNode?.removeChild(n.dom),n.id!==void 0&&!n.refused?w.set(n.id,n):O(n);return}case K:{if(!r.text)return l({reason:"record"});r.dom.data=String(e[2]??"").slice(0,D);let t=X(r,r.parent);t&&d.onFieldSet?.(t);return}case q:{if(r===E||r.text)return l({reason:"record"});let t=String(e[2]),n=e[4]??F;return n===Q?L(r,t,e[3]):l(n===F||n===U?{reason:"attribute",element:r.name,name:n===U?`on${t}`:t}:{reason:"record"})}default:return l({reason:"record"})}};return{apply(e,i){if(!Array.isArray(e))return l({reason:"record"}),!0;try{for(let s=0;s<e.length;s+=1){if(i&&s%32===0&&i())return!1;V(e[s])}return!0}finally{for(let s of w.values())O(s);w.clear(),J()}},get refused(){return p},get size(){return k},idOf:e=>T.get(e),elementOf(e){let i=g.get(e);return i&&!i.text&&i!==E?i.dom:void 0},dispose(){for(let e of E.children)O(e);for(E.children.length=0;o.firstChild;)o.removeChild(o.firstChild)}}}var oe=o=>typeof o=="string"&&/^#[A-Za-z_][A-Za-z0-9_.:-]{0,199}$/.test(o),B=["https:","mailto:","tel:"];function G(o){if(!(typeof o!="string"||o.length>2e3||/[\s<>"]/.test(o.trim())||o.trim()!==o))try{let d=new URL(o);return!B.includes(d.protocol)||d.protocol==="https:"&&(d.hostname===""||d.username!==""||d.password!=="")?void 0:d.href}catch{return}}function ce(o){let d=new Set,c=h=>{if(typeof h!="string"||!/^(https|mailto|tel):/i.test(h))return;let p=G(h);p&&d.add(p)};for(let h of[...o?.node?[o.node]:[],...o?.nodes??[]])for(let[p,g]of Object.entries(h))p==="id"||p==="kind"||(Array.isArray(g)?g.forEach(c):c(g));return d}function W(o){return(o??[]).flatMap(d=>{try{let c=new URL(d);return c.protocol==="https:"&&c.hostname!==""&&c.username===""&&c.password===""?[c.origin]:[]}catch{return[]}})}function ue(o,d){if(oe(o))return o;let c=G(o);if(c&&(d.handed.has(c)||c.startsWith("https:")&&W(d.origins).includes(new URL(c).origin)))return c}function fe(o,d){let c=o.length>120?`${o.slice(0,119)}\u2026`:o,h="";try{h=new URL(o).protocol}catch{h=""}if(!B.includes(h))return`The link "${c}" was not drawn: a view links only to an https:, mailto: or tel: address.`;let p=W(d);return`The link "${c}" 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${p.length>0?`, or an https: address on ${p.join(", ")}`:""}; a record or a place of this app is <a data-record> or <a data-place>.`}export{de as a,ce as b,ue as c,fe as d};
@@ -1 +0,0 @@
1
- var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{G as k,La as o,W as n}from"./chunk.FWXW4T4I.js";import{a as t}from"./chunk.SDO3U72B.js";import{b as p}from"./chunk.AJZBJBMO.js";var f=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.WVUJXDXZ.js","./chunk.B422DSYN.js","./chunk.ZE5RSKXF.js","./chunk.DKUEZPGR.js","./chunk.EP7YT7LT.js","./chunk.I7KN732Z.js","./chunk.TLPCYKLW.js","./chunk.MIE4TJRW.js","./chunk.SCVKHGO3.js","./chunk.RD2FSSLV.js","./chunk.AZRICZKT.js","./chunk.MH3AQO2R.js","./chunk.J2N7EKMX.js","./chunk.P26ATAAI.js","./chunk.FIY4RUK5.js","./chunk.IY3DV52G.js","./chunk.NLZHNPDU.js","./chunk.QNC2OKLF.js","./chunk.FWXW4T4I.js","./chunk.SDO3U72B.js","./chunk.DHPXRDT5.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.QRNKGPAD.js")))),y=f.part((e,r)=>e.drawFiles(r),{quiet:!0});var d=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.MIE4TJRW.js","./chunk.SCVKHGO3.js","./chunk.RD2FSSLV.js","./chunk.AZRICZKT.js","./chunk.MH3AQO2R.js","./chunk.J2N7EKMX.js","./chunk.P26ATAAI.js","./chunk.FIY4RUK5.js","./chunk.IY3DV52G.js","./chunk.NLZHNPDU.js","./chunk.QNC2OKLF.js","./chunk.FWXW4T4I.js","./chunk.SDO3U72B.js","./chunk.DHPXRDT5.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.D5JZQZ74.js")))),I=d.part((e,r)=>e.drawLinkedRecord(r),{quiet:!0}),w=d.part((e,r)=>e.drawLinkedPicker(r),{what:"Picking a linked record"});var s=p(n(),1),m=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.MIE4TJRW.js","./chunk.SCVKHGO3.js","./chunk.RD2FSSLV.js","./chunk.AZRICZKT.js","./chunk.MH3AQO2R.js","./chunk.J2N7EKMX.js","./chunk.P26ATAAI.js","./chunk.FIY4RUK5.js","./chunk.IY3DV52G.js","./chunk.NLZHNPDU.js","./chunk.QNC2OKLF.js","./chunk.FWXW4T4I.js","./chunk.SDO3U72B.js","./chunk.DHPXRDT5.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.QK7EUIPL.js")))),g=m.part((e,r)=>(0,s.jsx)(e.RepeatPicker,{...r}),{quiet:!0}),E=m.part((e,r)=>(0,s.jsx)(e.RepeatEditor,{...r}),{quiet:!0});var a=p(k(),1),i=p(n(),1),c=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.MH3AQO2R.js","./chunk.J2N7EKMX.js","./chunk.P26ATAAI.js","./chunk.FIY4RUK5.js","./chunk.IY3DV52G.js","./chunk.NLZHNPDU.js","./chunk.QNC2OKLF.js","./chunk.FWXW4T4I.js","./chunk.SDO3U72B.js","./chunk.DHPXRDT5.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.TAJBXG5U.js")))),l=c.part((e,r)=>(0,i.jsx)(e.WhenInput,{...r}),{quiet:!0});function M(e){return(0,i.jsx)(a.Suspense,{fallback:(0,i.jsx)("span",{"data-graview-when-arriving":"",style:{display:"inline-block",minHeight:24}}),children:(0,i.jsx)(l,{...e})})}var N=()=>c.load().then(()=>{},()=>{});export{y as a,I as b,w as c,g as d,E as e,M as f,N as g};
@@ -1 +0,0 @@
1
- import"./chunk.WVUJXDXZ.js";import{k as m,m as i}from"./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.FIY4RUK5.js";import"./chunk.IY3DV52G.js";import"./chunk.DHPXRDT5.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";function a(t){let r=new Map;return(s,o)=>{let e=o.kind,n=r.get(e);return n===void 0&&r.set(e,n=i(t,e).length),n===0?{}:m(t,s,o).values}}export{a as computedOn};
@@ -1 +0,0 @@
1
- import{G as A,Ua as H,W as F,Wa as M}from"./chunk.FWXW4T4I.js";import"./chunk.SDO3U72B.js";import"./chunk.DHPXRDT5.js";import"./chunk.FQLNBIQ5.js";import{b as x}from"./chunk.AJZBJBMO.js";var t=x(A(),1),f=x(F(),1),q={faces:'[data-testid="app-menu-open"][data-scene]',problems:'[data-testid="standing"], [data-testid="standing-link"]',activity:'[data-testid="inbox-button"]',ask:'[data-testid="app-find"], [data-testid="app-find-open"]',find:'[data-testid="app-find"], [data-testid="app-find-open"]',profile:'[data-testid="profile-button"]',home:'[data-testid="app-home"]'};function D(e){if(!e.isConnected||e.closest("[hidden], [inert], [aria-hidden='true']"))return!1;if(typeof e.checkVisibility!="function")return!0;if(!e.checkVisibility({visibilityProperty:!0}))return!1;let a=e.getBoundingClientRect();return a.width>1&&a.height>1}function E(e,a){if(!e||a==="ask"&&!e.querySelector("[data-graview-quick-ask]"))return null;for(let c of e.querySelectorAll(q[a]))if(D(c))return c;return null}function W(e){let a=(u,h,d)=>e.querySelector(u)?.getAttribute(h)?.trim()||d,c=a('[data-testid="app-menu-open"]',"data-scene","Scene"),n=a('[data-testid="app-menu-open"]',"data-pages","Pages");return[{anchor:"faces",title:`${c} or ${n}`,words:`One app, two ways to see it, in the app menu: ${c} draws every record as one picture, ${n} as lists and pages to read and change.`},{anchor:"problems",title:"Whether all is in order",words:"The dot is green while every rule holds. When one is broken it counts what is wrong, and pressing it shows each one and where."},{anchor:"activity",title:"Inbox",words:"What waits for you, what has happened here and who did it \u2014 each change with its way back \u2014 and what you asked."},{anchor:"ask",title:"Tell Graview",words:"Press \u2318K (Ctrl+K) to tell Graview what to do about what you have selected, or right-click it and type. The answer stands beside it, and a change it proposes waits for you to accept it."}]}var R=300,O=1200,$=15e3;function _({root:e,steps:a,onEnd:c}){let[n,u]=(0,t.useState)(null),h=(0,t.useRef)(null),d=(0,t.useRef)(!1),p=(0,t.useRef)(c);p.current=c,(0,t.useEffect)(()=>{let r=Date.now(),o=Date.now(),s=null,i,k=new MutationObserver(()=>o=Date.now());k.observe(document.body,{childList:!0,subtree:!0});let v=()=>{let L=e(),S=Date.now();if(L?.querySelector('[data-testid="app-bar"]')){if(s??=S,S-o>=R||S-s>=O){let T=[...W(L),...a].filter(C=>E(L,C.anchor)!==null);if(T.length===0){d.current=!0,p.current(null);return}h.current=document.activeElement,u({list:T,at:0});return}}else if(S-r>=$){d.current=!0,p.current(null);return}i=setTimeout(v,100)};return i=setTimeout(v,100),()=>{clearTimeout(i),k.disconnect()}},[]);let y=(0,t.useCallback)(()=>{let r=h.current;(r instanceof HTMLElement&&r!==document.body&&r.isConnected?r:e()?.querySelector('[data-testid="app-home"]'))?.focus({preventScroll:!0})},[e]),m=(0,t.useCallback)((r,o)=>{if(d.current)return;d.current=!0;let s=document.querySelector("[data-testid='first-look']"),i=document.activeElement,k=i===null||i===document.body||s!==null&&s.contains(i);u(null),p.current(r),!(!o&&!k)&&(y(),requestAnimationFrame(()=>{let v=document.activeElement;(v===null||v===document.body)&&y()}))},[y]),w=(0,t.useCallback)((r,o)=>{let s=e();for(let i=o;i<r.length;i++)if(E(s,r[i].anchor))return i;return-1},[e]),b=(0,t.useCallback)(()=>{if(!n)return;let r=w(n.list,n.at+1);r<0?m("finished",!0):u({list:n.list,at:r})},[n,w,m]);if((0,t.useEffect)(()=>{if(!n)return;let r=e();if(!r)return;let o=0,s=()=>{cancelAnimationFrame(o),o=requestAnimationFrame(()=>{E(e(),n.list[n.at].anchor)||b()})},i=new MutationObserver(s);return i.observe(r,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["hidden","class"]}),()=>{cancelAnimationFrame(o),i.disconnect()}},[n,e,b]),!n)return null;let g=n.list[n.at],l=w(n.list,n.at+1)<0;return(0,f.jsx)(N,{root:e,step:g,position:n.at+1,total:n.list.length,last:l,onNext:b,onEnd:m},n.at)}var I={...H,width:"min(320px, calc(100vw - 24px))",maxHeight:"min(70vh, 420px)",overflow:"auto",padding:"12px 14px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",color:"var(--graview-ink)",fontFamily:"var(--graview-font-body, system-ui)",fontSize:"0.875rem",lineHeight:1.45,overflowWrap:"anywhere"},P={minHeight:32,padding:"0 12px",borderRadius:8,font:"inherit",fontWeight:600,cursor:"pointer"};function N({root:e,step:a,position:c,total:n,last:u,onNext:h,onEnd:d}){let p=(0,t.useRef)(null),y=(0,t.useRef)(null),m=(0,t.useId)().replace(/:/g,""),w=(0,t.useMemo)(()=>({get current(){return E(e(),a.anchor)}}),[e,a.anchor]),[b]=(0,t.useState)(()=>{let l=w.current?.getBoundingClientRect(),r=typeof document>"u"?0:document.documentElement.clientWidth||innerWidth;return l&&l.left+l.width/2<r/2?"start":"end"});M(p,!0,w,{align:b}),(0,t.useLayoutEffect)(()=>{y.current?.focus({preventScroll:!0})},[]);let g=(0,t.useRef)(d);return g.current=d,(0,t.useEffect)(()=>{let l=o=>{o.target instanceof Node&&p.current?.contains(o.target)||g.current("dismissed",!1)},r=o=>{if(o.key!=="Escape"||o.defaultPrevented)return;let s=o.target;s instanceof Node&&p.current?.contains(s)||s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement||[...document.querySelectorAll("[data-graview-overlay]:not([hidden])")].some(i=>i!==p.current)||g.current("dismissed",!0)};return document.addEventListener("pointerdown",l,!0),document.addEventListener("keydown",r),()=>{document.removeEventListener("pointerdown",l,!0),document.removeEventListener("keydown",r)}},[]),(0,f.jsxs)("div",{ref:p,popover:"manual",role:"dialog","aria-modal":"false","aria-labelledby":`${m}-title`,"aria-describedby":`${m}-words`,tabIndex:-1,"data-testid":"first-look","data-first-look-anchor":a.anchor,"data-graview-overlay":"",onKeyDown:l=>{l.key==="Escape"&&(l.preventDefault(),l.stopPropagation(),d("dismissed",!0))},style:I,children:[(0,f.jsxs)("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--graview-ink-muted)"},"data-testid":"first-look-count",children:[c," of ",n]}),(0,f.jsx)("p",{id:`${m}-title`,style:{margin:"2px 0 4px",fontWeight:600,fontSize:"0.9375rem"},"data-testid":"first-look-title",children:a.title}),(0,f.jsx)("p",{id:`${m}-words`,style:{margin:0},"data-testid":"first-look-words",children:a.words}),(0,f.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-end",gap:8,marginTop:12},children:[u?null:(0,f.jsx)("button",{type:"button","data-testid":"first-look-skip",onClick:()=>d("dismissed",!0),style:{...P,fontWeight:500,border:"1px solid transparent",background:"none",color:"var(--graview-ink-muted)"},children:"Skip"}),(0,f.jsx)("button",{ref:y,type:"button","data-testid":u?"first-look-done":"first-look-next",onClick:()=>u?d("finished",!0):h(),style:{...P,border:"1px solid var(--graview-accent)",background:"var(--graview-accent)",color:"var(--graview-accent-ink)"},children:u?"Done":"Next"})]})]})}export{_ as FirstLookHints,E as firstLookAnchor};
@@ -1 +0,0 @@
1
- import{b as X}from"./chunk.I4H2GS4O.js";import"./chunk.NLZHNPDU.js";import"./chunk.QNC2OKLF.js";import{G as ce,W as Y,ea as N,ha as _}from"./chunk.FWXW4T4I.js";import"./chunk.SDO3U72B.js";import{Fb as R,ye as U}from"./chunk.DHPXRDT5.js";import"./chunk.FQLNBIQ5.js";import{b as O}from"./chunk.AJZBJBMO.js";var u=O(ce(),1);function M(e,t,s=!1){if(e<t.at||e===t.at&&s)return e;let i=t.at+t.removed.length;return e>=i?e+t.inserted.length-t.removed.length:s?t.at:t.at+t.inserted.length}var G=e=>e>=55296&&e<=56319,V=e=>e>=56320&&e<=57343;function q(e,t,s){let i=Math.min(e.length,t.length),n=0,l=Math.max(0,Math.min(i,t.length-s));for(;n<l&&e.charCodeAt(e.length-1-n)===t.charCodeAt(t.length-1-n);)n++;let r=0;for(;r<i-n&&e.charCodeAt(r)===t.charCodeAt(r);)r++;return r>0&&G(e.charCodeAt(r-1))&&r--,n>0&&V(e.charCodeAt(e.length-n))&&n--,{at:r,removed:e.slice(r,e.length-n),inserted:t.slice(r,t.length-n)}}function B(e,t){let s=Math.min(e.length,t.length),i=0;for(;i<s&&e.charCodeAt(i)===t.charCodeAt(i);)i++;i>0&&G(e.charCodeAt(i-1))&&i--;let n=0;for(;n<s-i&&e.charCodeAt(e.length-1-n)===t.charCodeAt(t.length-1-n);)n++;return n>0&&V(e.charCodeAt(e.length-n))&&n--,{at:i,removed:e.slice(i,e.length-n),inserted:t.slice(i,t.length-n)}}function Z(e,t){let s=c=>c.at+c.removed.length;if(s(e)<t.at)return e;if(e.at>s(t))return{...e,at:e.at+t.inserted.length-t.removed.length};let i=Math.min(e.at,t.at),n=s(e)-s(t),l=e.removed.slice(0,t.at-i)+t.inserted+(n>0?e.removed.slice(e.removed.length-n):""),r=t.at<=e.at?t.inserted+e.inserted:e.inserted+t.inserted,d=B(l,r);return{...d,at:i+d.at}}function I(e,t){let s=M(e.start,t,!0),i=e.end===e.start?s:M(e.end,t);return{start:s,end:Math.max(s,i)}}function le(e,t){let{kind:s,id:i,session:n}=e.author,l=`${s}:${i??""}:`;return t.startsWith(l)&&(!n||t.slice(l.length)===n)}function J(e,t,s,i){let n=e.anchor,l=e.head;for(let d of s)if(!(d.seq<e.rev||le(d,t)))for(let c of d.primitives)c.op!=="splice-text"||c.id!==e.node||c.field!==e.field||(n=M(n,c),l=M(l,c));let r=d=>Math.max(0,Math.min(i,d));return{start:r(n),end:r(l)}}var W=(e,t,s)=>e.ops.length>0&&e.ops.every(i=>{let n=i.mutation?.args;return i.mutation?.name===R&&n?.node===t&&n.field===s}),de=(e,t,s,i)=>t.ops.length>0&&t.ops.every(n=>n.undoes!==void 0)&&e.batches().some(n=>t.ops.some(l=>l.undoes===n.id||l.undoes===n.ops[0]?.id)&&W(n,s,i)),Q=(e,t)=>e.author.kind==="human"&&(t?.id===void 0||e.author.id===void 0||e.author.id===t.id);function j(e,t,s,i){let n=e.batches();for(let l=n.length-1;l>=0;l--){let r=n[l];if(!(!Q(r,t)||r.undone||!W(r,s,i))&&e.canUndo(r.id).ok)return r.id}}function ee(e,t,s,i){let n=e.batches();for(let l=n.length-1;l>=0;l--){let r=n[l];if(Q(r,t)){if(W(r,s,i))return;if(de(e,r,s,i))return r.undone?void 0:r.id}}}var p=O(Y(),1);function ue(e){let{store:t}=N(),{live:s,nodeId:i,field:n}=e,[l,r]=(0,u.useState)(null);return(0,u.useEffect)(()=>{let d=!0;return s.typing(i,n).then(c=>d&&r(c)),()=>{d=!1}},[i,n]),l&&!t.collaborative(i,n)?(0,p.jsx)(p.Fragment,{children:e.writtenWhole}):(0,p.jsx)(pe,{...e,typing:l})}function pe({nodeId:e,field:t,label:s,markdown:i,live:n,onDone:l,typing:r}){let{store:d,principal:c}=N(),m=_(e),f=ne(m?.[t]),[T,ie]=(0,u.useState)(!1),v=(0,u.useRef)(null),D=(0,u.useRef)(f),E=(0,u.useRef)(!1),H=(0,u.useRef)(n);H.current=n;let K=()=>ne(d.graph.getNode(e)?.[t]),b=!r||d.permits({name:R,args:{node:e,field:t,at:0,remove:0,insert:""}},c).ok;(0,u.useEffect)(()=>v.current?.focus(),[T,r]);let C=(0,u.useRef)(void 0),k=()=>{C.current===void 0&&(C.current=setTimeout(()=>{C.current=void 0;let o=v.current;if(!o||o.ownerDocument.activeElement!==o)return;let a=o.selectionDirection==="backward";H.current.sayCaret({node:e,field:t,anchor:a?o.selectionEnd:o.selectionStart,head:a?o.selectionStart:o.selectionEnd,rev:d.log.length})},ge))};(0,u.useEffect)(()=>()=>{clearTimeout(C.current),H.current.sayCaret(null)},[]);let F=o=>{let a=v.current;if(a){if(a.value!==o){let h=I({start:a.selectionStart,end:a.selectionEnd},B(a.value,o)),g=a.selectionDirection??"none";a.value=o,a.setSelectionRange(h.start,h.end,g)}D.current=o}},$=()=>{let o=v.current;if(!o||!r||!b||E.current)return;let a=D.current,h=K(),g=q(a,o.value,o.selectionEnd);if(g.removed===""&&g.inserted==="")return F(h);let y=a===h?g:Z(g,B(a,h));try{r.splice(y.at,y.removed.length,y.inserted)}catch{}let w=K();if(o.value!==w){o.value=w;let S=Math.min(w.length,y.at+y.inserted.length);o.setSelectionRange(S,S)}D.current=w,k()};(0,u.useLayoutEffect)(()=>{E.current||F(f)},[f]);let ae=async o=>{if(!r)return;r.flush();for(let h=0;r.waiting()>0&&h<100;h++)await new Promise(g=>setTimeout(g,30));let a=o?ee(d,c,e,t):j(d,c,e,t);if(a)try{o?d.redo(a,{author:c}):d.undo(a,{author:c})}catch{}},x=o=>{r?.flush(),n.sayCaret(null),l(o)},A=(0,u.useRef)(void 0);(0,u.useEffect)(()=>()=>A.current?.(),[]);let se=o=>{A.current?.();let a=o.ownerDocument,h=v.current?.closest("[data-graview-live]"),g=P=>{let L=P.target;if(L instanceof Node&&h?.contains(L))return S();L instanceof Element&&L.closest(te)||(S(),x(!0))},y=()=>{let P=a.activeElement;P!==null&&P!==a.body||o.isConnected&&fe(o)||(S(),v.current?.focus({preventScroll:!0}))},w=new MutationObserver(y);w.observe(a.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["open","hidden"]}),a.addEventListener("focusin",g),a.addEventListener("toggle",y,!0);let S=()=>{A.current=void 0,w.disconnect(),a.removeEventListener("focusin",g),a.removeEventListener("toggle",y,!0)};A.current=S},z=[...n.who.values()].filter(o=>o.caret?.node===e&&o.caret.field===t);return(0,p.jsxs)("div",{style:{display:"grid",gap:8,minWidth:0},"data-graview-live":t,children:[T?(0,p.jsx)("div",{"data-graview-preview":t,"aria-label":`${s}, as it will read`,role:"region",style:ye,children:(0,p.jsx)(X,{text:f,markdown:!0})}):(0,p.jsxs)("div",{style:{position:"relative",minWidth:0},children:[(0,p.jsx)("textarea",{ref:v,"aria-label":s,"data-graview-field":t,defaultValue:f,readOnly:!r||!b,rows:3,onInput:$,onCompositionStart:()=>{E.current=!0},onCompositionEnd:()=>{E.current=!1,$()},onSelect:k,onFocus:k,onPointerDown:()=>r?.flush(),onKeyDown:o=>{let a=o.key;a==="Escape"?(o.preventDefault(),x(!1)):(o.metaKey||o.ctrlKey)&&!o.altKey&&a.toLowerCase()==="z"?(o.preventDefault(),ae(o.shiftKey)):(o.metaKey||o.ctrlKey)&&a==="Enter"?(o.preventDefault(),x(!1)):(a==="Enter"||me.has(a))&&r?.flush()},onKeyUp:k,onBlur:o=>{r?.flush(),n.sayCaret(null);let a=o.relatedTarget;if(a instanceof Node&&o.currentTarget.closest("[data-graview-live]")?.contains(a))return;let h=a instanceof Element?a.closest(te):null;if(h)return se(h);x(!0)},style:ve}),z.length>0?(0,p.jsx)(he,{text:f,others:z,area:v,log:d.log.all()}):null]}),(0,p.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:8},children:[(0,p.jsx)("button",{type:"button",onClick:()=>x(!1),style:re,children:"Done"}),i?(0,p.jsx)("button",{type:"button","aria-pressed":T,onClick:()=>ie(!T),style:re,children:T?"Write":"Preview"}):null,(0,p.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},...b?{}:{"data-graview-readonly":""},children:b?"Saved as you type \xB7 Ctrl or \u2318 Z takes back your typing":`Read only: the ${s.toLowerCase()} can't be changed here now`})]})]})}function he({text:e,others:t,area:s,log:i}){let n=(0,u.useRef)(null);(0,u.useLayoutEffect)(()=>{let c=s.current,m=n.current;if(!c||!m)return;let f=()=>{m.scrollTop=c.scrollTop};return f(),c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)});let l=t.map(c=>({one:c,at:J(c.caret,c.participant,i,e.length).end})).sort((c,m)=>c.at-m.at),r=[],d=0;for(let{one:c,at:m}of l){r.push(e.slice(d,m)),d=m;let f=U(c)||"Somebody";r.push((0,p.jsx)("span",{"data-graview-caret":c.participant,title:`${f} is typing here`,style:{borderLeft:`2px solid hsl(${Math.round(c.hue)} 55% 52%)`,marginLeft:-1,marginRight:-1,pointerEvents:"auto"}},c.participant))}return r.push(`${e.slice(d)}\u200B`),(0,p.jsx)("div",{ref:n,"aria-hidden":"true",style:we,children:r})}var te='[data-graview-overlay], dialog, [role="dialog"], [role="alertdialog"], [popover]',fe=e=>{if(e.hasAttribute("hidden")||e instanceof HTMLDialogElement&&!e.open)return!1;if(e.hasAttribute("popover"))try{return e.matches(":popover-open")}catch{}return!0},ge=120,ne=e=>typeof e=="string"?e:"",me=new Set(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"]),ye={minHeight:"7.5em",padding:"8px 10px",border:"1px dashed var(--graview-edge-bright)",borderRadius:6,lineHeight:1.6,minWidth:0},re={font:"inherit",fontSize:"0.8125rem",minHeight:28,padding:"2px 12px"},oe={font:"inherit",lineHeight:1.5,width:"100%",boxSizing:"border-box",minHeight:"7.5em",padding:"8px 10px",borderRadius:6},ve={...oe,resize:"vertical",fieldSizing:"content",color:"var(--graview-ink)",background:"var(--graview-panel, transparent)",border:"1px solid var(--graview-edge-bright)"},we={...oe,position:"absolute",inset:0,height:"100%",border:"1px solid transparent",color:"transparent",whiteSpace:"pre-wrap",overflowWrap:"break-word",overflow:"hidden",pointerEvents:"none"};export{ue as default};
@@ -1 +0,0 @@
1
- import{d as b,e as c,f as d,g as e,h as f,i as g,j as h}from"./chunk.AG7WJYM5.js";import"./chunk.KHKCTVHD.js";import{s as a}from"./chunk.DO3FQM6R.js";import"./chunk.NYLKG25K.js";import"./chunk.TBY5IR7C.js";import"./chunk.VR553M6J.js";import"./chunk.DU76ASS4.js";import"./chunk.BJUUSIQY.js";import"./chunk.UPOYRCKI.js";import"./chunk.XOZU4OFA.js";import"./chunk.WV6SP6IJ.js";import"./chunk.ZE5RSKXF.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"./chunk.FWXW4T4I.js";import"./chunk.SDO3U72B.js";import"./chunk.DHPXRDT5.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{g as Highlighter,h as LOOK,f as SectionCard,b as SectionDrawn,a as SectionOutline,e as drawingFindings,c as placeBeside,d as readPart};
@@ -1 +0,0 @@
1
- import{a as n}from"./chunk.HGH27XZG.js";import"./chunk.NRECR3NQ.js";import"./chunk.T2BZBR7S.js";import"./chunk.HMJXB6KC.js";import"./chunk.Q355UPFG.js";import{o as s}from"./chunk.JQEXH23N.js";import"./chunk.O7NYSO6F.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"./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.IO5VFTXC.js";import"./chunk.BJUUSIQY.js";import"./chunk.7L3I776Z.js";import"./chunk.CLIC2QBA.js";import"./chunk.XOZU4OFA.js";import"./chunk.WV6SP6IJ.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 y,W as i}from"./chunk.FWXW4T4I.js";import"./chunk.SDO3U72B.js";import"./chunk.DHPXRDT5.js";import"./chunk.FQLNBIQ5.js";import{b as r}from"./chunk.AJZBJBMO.js";var c=r(y(),1),e=r(i(),1);function v({store:d,views:t,as:a,scope:o}){let l=(0,c.useMemo)(()=>s({scope:`.${o}`}),[o]);return(0,e.jsxs)("div",{"data-testid":"embed-picture","data-embed-content":"",tabIndex:0,"aria-label":t.places().find(m=>m.as===a)?.title??"The picture",style:{flex:"1 1 auto",minHeight:0,display:"grid",gridTemplateRows:"minmax(0, 1fr)",overflow:"auto",background:"var(--graview-ground)",color:"var(--graview-ink)",fontFamily:"var(--graview-font-body, system-ui)"},children:[(0,e.jsx)("style",{children:l}),(0,e.jsx)(n,{store:d,views:t,as:a})]})}export{v as PictureFace};
@@ -1 +0,0 @@
1
- import{k as a,l as o}from"./chunk.IRNEWNUB.js";import"./chunk.AUNQNTKY.js";import"./chunk.KLEKC4ZX.js";import"./chunk.PJL3I2IW.js";import"./chunk.OD5QZHRC.js";import"./chunk.YJ4PFOPC.js";import"./chunk.LKM2R5UF.js";import"./chunk.5MOXQUZH.js";import"./chunk.MKN7ADJB.js";import"./chunk.I4H2GS4O.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{ya as n}from"./chunk.FWXW4T4I.js";import"./chunk.SDO3U72B.js";import"./chunk.DHPXRDT5.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var w=new WeakMap;function p(e,i){let t=w.get(e);t||w.set(e,t=new Map);let r=t.get(i);return r||t.set(i,r=a(o(e,n(e)),e,i)),r}export{p as frameworkViews};
@@ -1,17 +0,0 @@
1
- var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as G,b as J}from"./chunk.ZU3RPI34.js";import"./chunk.CCCONK73.js";import{a as S,b as W}from"./chunk.MB7LKKUD.js";import{a as K}from"./chunk.47VEV4BX.js";import"./chunk.FE3SINPK.js";import"./chunk.3D37E2G5.js";import"./chunk.IO5VFTXC.js";import"./chunk.7L3I776Z.js";import"./chunk.CLIC2QBA.js";import"./chunk.WV6SP6IJ.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.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{D as H,E as V,G as ee,La as _,Va as x,W as D,fa as F}from"./chunk.FWXW4T4I.js";import{a as j}from"./chunk.SDO3U72B.js";import{na as q,td as B}from"./chunk.DHPXRDT5.js";import"./chunk.FQLNBIQ5.js";import{b}from"./chunk.AJZBJBMO.js";var t=b(ee(),1);var a=b(D(),1);function ae(n){let r=[];return n.applied.length>0&&n.intent&&r.push(`${n.intent}.`),n.unchanged.length>0&&r.push(`${n.unchanged.length} already so.`),n.allOrNothing&&r.push("None of it was kept."),r.join(" ")}var re=_(j(()=>(__graviewPreload(import.meta.url,["./chunk.3VNOTHA5.js","./chunk.VR553M6J.js","./chunk.DU76ASS4.js","./chunk.BJUUSIQY.js","./chunk.7L3I776Z.js","./chunk.GTF6EMVE.js","./chunk.CLIC2QBA.js","./chunk.UPOYRCKI.js","./chunk.XOZU4OFA.js","./chunk.WV6SP6IJ.js","./chunk.ZE5RSKXF.js","./chunk.MH3AQO2R.js","./chunk.J2N7EKMX.js","./chunk.P26ATAAI.js","./chunk.FIY4RUK5.js","./chunk.IY3DV52G.js","./chunk.NLZHNPDU.js","./chunk.QNC2OKLF.js","./chunk.FWXW4T4I.js","./chunk.SDO3U72B.js","./chunk.DHPXRDT5.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.VBBH5R5T.js")))),te=re.part((n,r)=>(0,a.jsx)(n.SeveralAi,{...r}),{quiet:!0});function ne(n){let r=F()?.ai;return!H(r)||!V(r)?null:(0,a.jsx)(t.Suspense,{fallback:null,children:(0,a.jsx)(te,{...n})})}function ge({store:n,chosen:r,principal:d,context:v,via:k,anchor:A,of:g,onChooseAll:E,onClear:m,onActed:Q}){let[U,X]=(0,t.useState)(0);(0,t.useEffect)(()=>n.subscribe(()=>X(e=>e+1)),[n]);let f=r.join(`
2
- `),{acts:c,withheld:N}=(0,t.useMemo)(()=>G(n,r,{...d?{principal:d}:{},...v?{context:v}:{}}),[n,f,d,v,U]),[O,p]=(0,t.useState)(!1),[l,u]=(0,t.useState)(null),[s,P]=(0,t.useState)(null),h=(0,t.useRef)(null),L=(0,t.useId)(),w=(0,t.useMemo)(()=>[...new Set(r.map(e=>n.graph.getNode(e)?.kind))],[n,f]),Y=w.length===1&&w[0]?`${q(n.schema,w[0],r.length)} chosen`:`${r.length} chosen`,M=typeof matchMedia=="function"&&matchMedia("(pointer: coarse), (max-width: 599px)").matches?2:3,C=c.filter(e=>!e.more),Z=C.slice(0,M),R=[...C.slice(M),...c.filter(e=>e.more)];(0,t.useEffect)(()=>{u(null),p(!1)},[f]),(0,t.useLayoutEffect)(()=>{let e=h.current;if(!e)return;if(typeof e.showPopover=="function"&&!x(e))try{e.showPopover()}catch{}let i=()=>{W(e,A?.()??null),dispatchEvent(new Event(S))};i(),addEventListener("resize",i),addEventListener("scroll",i,!0);let o=typeof ResizeObserver=="function"?new ResizeObserver(i):null;return o?.observe(e),()=>{if(o?.disconnect(),removeEventListener("resize",i),removeEventListener("scroll",i,!0),e.isConnected&&x(e))try{e.hidePopover()}catch{}dispatchEvent(new Event(S))}},[A]);let y=(0,t.useRef)({asking:l,onClear:m});y.current={asking:l,onClear:m},(0,t.useEffect)(()=>{let e=i=>{if(i.key!=="Escape"||i.defaultPrevented)return;let o=document.activeElement;if(!(!(h.current?.contains(o)??!1)&&(o instanceof HTMLTextAreaElement||o instanceof HTMLInputElement&&o.type!=="checkbox"||o instanceof HTMLSelectElement))){if(i.preventDefault(),i.stopPropagation(),y.current.asking){u(null);return}y.current.onClear()}};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[]);let T=(e,i={})=>{let o=J(n,{mutation:e.mutation,subject:e.subject,args:{...e.args,...i},label:e.label},r,{...d?{author:d}:{},...k?{via:k}:{},...v?{context:v}:{}});u(null),p(!1),P(o.refused.length>0||o.applied.length===0?o:null),Q(o.refused.map(I=>I.id))},$=e=>{P(null),p(!1),e.open.length>0?u(e):T(e)},z=e=>(0,a.jsxs)("button",{type:"button",className:"graview-several-act","data-testid":"several-act","data-act":e.id,"data-mutation":e.mutation,...e.destructive?{"data-tone":"warn"}:{},"aria-pressed":l?.id===e.id?!0:void 0,onClick:()=>$(e),children:[e.label,e.open.length>0?"\u2026":""]},e.id);return(0,a.jsxs)("div",{ref:h,popover:"manual",role:"region","aria-label":"The chosen records",className:"graview-several-bar","data-testid":"several-bar","data-graview-foot":"","data-graview-overlay":"","data-graview-popover":"","data-graview-offstage":"",style:ie,children:[(0,a.jsx)("style",{children:oe}),(0,a.jsxs)("div",{className:"graview-several-line",children:[(0,a.jsx)("span",{role:"status","aria-live":"polite",className:"graview-several-count","data-testid":"several-count",children:Y}),(0,a.jsxs)("div",{role:"group","aria-label":`What to do with the ${r.length} chosen`,className:"graview-several-acts",children:[Z.map(z),R.length>0?(0,a.jsx)("button",{type:"button",className:"graview-several-act","data-testid":"several-more","aria-expanded":O,"aria-controls":L,onClick:()=>p(e=>!e),children:"More"}):null,E&&g!==void 0&&g>r.length?(0,a.jsxs)("button",{type:"button",className:"graview-several-quiet","data-testid":"several-all",onClick:E,children:["Choose all ",g]}):null,(0,a.jsx)("button",{type:"button",className:"graview-several-quiet","data-testid":"several-clear","aria-keyshortcuts":"Escape",title:"Put the choice down \u2014 Escape",onClick:m,children:"Clear"})]})]}),c.length>0&&r.length>1?(0,a.jsx)(ne,{chosen:r,acts:c,onAct:$}):null,O?(0,a.jsx)("div",{id:L,role:"group","aria-label":"More",className:"graview-several-acts","data-testid":"several-more-acts",children:R.map(z)}):null,c.length===0?(0,a.jsx)("p",{className:"graview-several-said","data-testid":"several-none",children:N.length>0?`Nothing here can be done to all of them by you: ${N[0].message}`:"Nothing can be done to all of these at once."}):null,l?(0,a.jsx)("div",{className:"graview-several-ask",role:"group","aria-label":`${l.label}, for all ${r.length}`,"data-testid":"several-ask",children:(0,a.jsx)(K,{store:n,affordance:l.affordance,onApply:e=>T(l,e),onCancel:()=>u(null)})}):null,s?(0,a.jsxs)("div",{role:"alert",className:"graview-several-said","data-testid":"several-outcome",children:[ae(s),s.refused.length>0?(0,a.jsxs)(a.Fragment,{children:[" ",s.refused.length===1?"One was not changed, and is still chosen:":`${s.refused.length} were not changed, and are still chosen:`,(0,a.jsx)("ul",{"data-testid":"several-refused",children:s.refused.map(e=>(0,a.jsxs)("li",{"data-record":e.id,children:["\u201C",e.label,"\u201D \u2014 ",e.message]},e.id))})]}):null]}):null]})}var ie={position:"fixed",inset:"auto",margin:0,zIndex:B("toast"),boxSizing:"border-box",width:"max-content",height:"auto",bottom:"calc(16px + env(safe-area-inset-bottom, 0px))",left:16,overflow:"visible"},oe=`
3
- .graview-several-bar{display:grid;gap:8px;padding:8px 10px;border:1px solid var(--graview-edge);border-radius:var(--graview-radius,12px);background:var(--graview-float);color:var(--graview-ink);box-shadow:var(--graview-lift-high);font-size:.875rem;line-height:1.4;max-height:70vh;overflow:auto}
4
- .graview-several-line{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;min-width:0}
5
- .graview-several-count{font-weight:600;white-space:nowrap}
6
- .graview-several-acts{display:flex;flex-wrap:wrap;align-items:center;gap:6px;min-width:0}
7
- .graview-several-act,.graview-several-quiet{min-height:32px;padding:0 12px;border-radius:8px;font:inherit;cursor:pointer;box-shadow:none}
8
- .graview-several-act{border:1px solid var(--graview-edge);background:transparent;color:var(--graview-ink);font-weight:600}
9
- .graview-several-act:hover,.graview-several-act[aria-pressed=true],.graview-several-act[aria-expanded=true]{background:color-mix(in srgb,var(--graview-accent) 14%,transparent)}
10
- .graview-several-act[data-tone=warn]{color:var(--graview-warn)}
11
- .graview-several-quiet{border:0;background:none;color:var(--graview-ink-muted);text-decoration:underline;text-underline-offset:2px}
12
- .graview-several-bar :focus-visible{outline:2px solid var(--graview-accent);outline-offset:2px}
13
- .graview-several-said{margin:0;max-width:52ch;overflow-wrap:anywhere}
14
- .graview-several-said ul{margin:4px 0 0;padding-left:18px}
15
- .graview-several-ask{padding:8px 4px 2px;border-top:1px solid var(--graview-edge)}
16
- @media (pointer: coarse){.graview-several-act,.graview-several-quiet{min-height:44px}}
17
- `;export{ge as SeveralBar};
@@ -1,3 +0,0 @@
1
- var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as j,e as B}from"./chunk.JN3WZGJY.js";import{t as I}from"./chunk.NLZHNPDU.js";import{G as J,La as M,Ua as R,W as b,Ya as $,ea as A,ga as H}from"./chunk.FWXW4T4I.js";import{a as L}from"./chunk.SDO3U72B.js";import{b as c}from"./chunk.AJZBJBMO.js";var t=c(J(),1);var S=c(b(),1),E=M(L(()=>(__graviewPreload(import.meta.url,["./chunk.25VJPUDH.js","./chunk.JHAMSDAI.js","./chunk.B5EFNTDA.js","./chunk.47VEV4BX.js","./chunk.FE3SINPK.js","./chunk.MUWI54IP.js","./chunk.3D37E2G5.js","./chunk.MH3AQO2R.js","./chunk.J2N7EKMX.js","./chunk.P26ATAAI.js","./chunk.FIY4RUK5.js","./chunk.IY3DV52G.js","./chunk.NLZHNPDU.js","./chunk.QNC2OKLF.js","./chunk.FWXW4T4I.js","./chunk.SDO3U72B.js","./chunk.DHPXRDT5.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.BSQI3KM2.js")))),W=E.part((a,n)=>(0,S.jsx)(a.SuggestedCount,{...n}),{quiet:!0}),ro=E.part((a,n)=>(0,S.jsx)(a.SuggestedList,{...n}),{quiet:!0,as:"div"});var o=c(b(),1),K=I.part((a,n)=>(0,o.jsx)(a.InboxPane,{...n}),{what:"The inbox"}),Q=[],U=[],oo=a=>a>99?"99+":String(a);function to(a,n){let d=[a>0?`${a} waiting for you`:"",n>0?`${n===1?"1 change":`${n} changes`}`:""].filter(Boolean);return d.length>0?`Inbox \u2014 ${d.join(", ")}`:"Inbox"}function po({calls:a=Q,seat:n,remembers:d=!1}){let{store:C,principal:f,whileAway:V,notifications:m=U,onNotificationsSeen:y,ai:Y}=A(),_=H(),r=B({calls:a,seat:n,remembers:d}),N=j(),q=Y.off!==!0,p=(0,t.useMemo)(()=>f.id===void 0?[]:N.filter(e=>e.by.id===f.id||e.by.onBehalfOf?.id===f.id),[N,f.id]),F=(0,t.useMemo)(()=>C.log.all().some(e=>e.suggests!==void 0&&!e.withheld),[C,_]),h=(V?.tidied??0)>0,v=F||h,[G,z]=(0,t.useState)(0),g=m.filter(e=>!e.read),u=G+g.length,x=u+r.recent,i=$("inbox"),s=i.open,[l,P]=(0,t.useState)("activity"),w=(0,t.useRef)(!1);if(s&&!w.current){w.current=!0;let e=u>0||h?"for-you":r.has?"activity":p.length>0?"asks":"for-you";e!==l&&P(e)}s||(w.current=!1);let T=(0,t.useRef)("");(0,t.useEffect)(()=>{if(!s||l!=="for-you"||g.length===0||!y)return;let e=g.map(Z=>Z.id);T.current!==e.join(`
2
- `)&&(T.current=e.join(`
3
- `),y(e))},[s,l,g,y]);let D=(0,t.useCallback)(()=>i.setOpen(!1),[i]),X=(0,t.useCallback)(e=>z(e),[]);if(!(r.has||v||m.length>0||p.length>0))return null;let k=to(u,r.recent),O=()=>I.prefetch();return(0,o.jsxs)("div",{className:"graview-bar-inbox",style:{position:"relative"},children:[v?(0,o.jsx)(t.Suspense,{fallback:null,children:(0,o.jsx)(W,{onCount:X})}):null,(0,o.jsxs)("button",{type:"button",className:"graview-bar-tool","data-testid":"inbox-button","data-count":x,...i.trigger,onClick:i.toggle,onPointerEnter:O,onFocus:O,"aria-label":r.running?`${k} \u2014 an agent is working`:k,title:r.running?"Inbox \u2014 an agent is working":k,...r.running?{"data-running":""}:{},children:[(0,o.jsx)(eo,{}),x>0?(0,o.jsx)("span",{className:"graview-bar-badge","data-testid":"inbox-count","aria-hidden":"true",children:oo(x)}):r.running?(0,o.jsx)("span",{className:"graview-bar-badge","data-dot":"","aria-hidden":"true"}):null]}),(!s||l!=="activity")&&n!==void 0?(0,o.jsx)("div",{hidden:!0,"data-testid":"agent-seat-seated",children:n}):null,s?(0,o.jsx)("section",{...i.pane,"aria-label":"Inbox","data-testid":"inbox","data-graview-offstage":"","data-tab":l,tabIndex:-1,style:{...R,width:"min(360px, calc(100vw - 16px))",maxHeight:"min(70vh, 520px)",overflowX:"hidden",overflowY:"auto",display:"flex",flexDirection:"column",padding:0,borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",outline:"none"},children:(0,o.jsx)(t.Suspense,{fallback:null,children:(0,o.jsx)(K,{tab:l,choose:P,asksOn:q,counts:{"for-you":u,activity:r.recent,asks:p.length},notifications:m,asks:p,tray:v,waits:u>0||h,activityHas:r.has,calls:a,remembers:d,close:D,...n!==void 0?{seat:n}:{}})})}):null]})}function eo(){return(0,o.jsxs)("svg",{width:16,height:16,viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",style:{flex:"0 0 auto"},children:[(0,o.jsx)("path",{d:"M4 11.25 V7.25 a4 4 0 0 1 8 0 V11.25 L13.25 12.5 H2.75 Z",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"}),(0,o.jsx)("path",{d:"M6.5 14 h3",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})}export{ro as a,po as b};
@@ -1 +0,0 @@
1
- import{b as cn,c as un}from"./chunk.CLIC2QBA.js";import{j as x}from"./chunk.P26ATAAI.js";import{b as Z}from"./chunk.FIY4RUK5.js";import{Bc as Q,Hd as dn,Lc as U,ec as on,fc as E,ga as H,gb as V,la as T,ma as K,na as en,nc as rn,oa as tn,oc as an,sa as sn,ta as J,ua as G}from"./chunk.DHPXRDT5.js";function fn(){return{name:"insight",derive({store:n,nodes:d,kindSelection:t}){let f=[],v=l=>T(n.schema.tryDefinition(l.kind),l);for(let l of d){if([...n.schema.edgeKinds].reduce((c,w)=>c+n.graph.out(l.id,w).length+n.graph.in(l.id,w).length,0)===0){f.push({id:`insight:island:${l.id}`,text:`${v(l)} is connected to nothing yet`,nodeIds:[l.id]});continue}for(let c of n.schema.edgeKinds){let w=n.graph.in(l.id,c).length;if(w<3)continue;let s=[...n.graph.allEdges()].filter(a=>a.kind===c),e=s.length;e>=4&&w/e>.6&&f.push({id:`insight:load:${l.id}:${c}`,text:`${v(l)} ${vn(n,s,c,w)}`,nodeIds:[l.id]})}}for(let l of t){if(n.graph.nodesOfKind(l).length>0)continue;let A=n.schema.definitions.filter(c=>c.kind!==l).filter(c=>Object.values(c.edges).some(w=>w.to!=="*"&&w.to.includes(l))).map(c=>c.plural??`${c.kind}s`);A.length>0&&f.push({id:`insight:gap:${l}`,text:`Nothing here yet, though ${A.join(" and ")} expect to connect to these`,nodeIds:[]})}return{observations:f}}}}function vn(n,d,t,f){let v=new Set(d.map(s=>n.graph.getNode(s.from)?.kind).filter(s=>s!==void 0)),l=v.size===1?[...v][0]:void 0,A=d.length,c=Z(n.schema,l??[...v][0]??"",t,"in"),w=s=>l?en(n.schema,l,s):String(s);return f===A?`${c}: all ${w(f)}`:`${c}: ${f} of the ${w(A)}`}function ln(n){let d=new Map;if(n.length===0)return d;let t=n.slice(-512),f=new Set;for(let l of t)l.undoes&&f.add(l.undoes);let v=n[n.length-1].seq;for(let l of t){if(!l.mutation||f.has(l.id))continue;let A=Math.pow(.5,(v-l.seq)/64);d.set(l.mutation.name,(d.get(l.mutation.name)??0)+A)}return d}function hn(n){return 8*(n/(n+1))}var bn=100;function gn(){return{name:"invariant",derive({store:n,selection:d,nodes:t,violations:f}){let v=s=>T(n.schema.tryDefinition(s.kind),s),l=new Set(d),A=f.filter(s=>s.nodeIds.some(e=>l.has(e))||s.subjectId!==void 0&&l.has(s.subjectId)),c=[],w=[];A.forEach((s,e)=>{w.push({id:`violation:${s.invariant}:${e}`,text:s.message,nodeIds:s.nodeIds}),s.repairs.forEach((a,h)=>{c.push({id:`invariant:${s.invariant}:${e}:${h}`,label:a.label,provider:"invariant",mutation:a.mutation,args:a.args??{},open:(a.missing??[]).map(m=>{let r=n.allMutations().find(g=>g.name===a.mutation);if(!r)return{name:m};let o=E(r.input).find(g=>g.name===m),k=o?o.kinds.includes("*")?n.graph.allNodes().map(g=>g.id):o.kinds.flatMap(g=>n.graph.nodesOfKind(g).map($=>$.id)):void 0;return{name:m,shape:x(r.input,m),...o?{kinds:o.kinds}:{},...k?{candidates:k}:{}}}),score:bn-h-(a.missing?.length??0),why:s.message,nodeIds:s.nodeIds,...s.subjectId===void 0?{}:{subjectId:s.subjectId}})})});for(let s of t){let e=n.allInvariants().filter(a=>{if(a.scope==="graph")return!1;let h=a.scope;return h.kind!==s.kind?!1:h.match?h.match(s):!0});e.length!==0&&(A.some(a=>a.subjectId===s.id||a.nodeIds.includes(s.id))||w.push({id:`holds:${s.id}`,text:`${v(s)} holds \u2014 nothing currently breaks ${e.length===1?"it":`any of its ${e.length} rules`}`,nodeIds:[s.id]}))}return{affordances:c,observations:w}}}}var X=40;function pn(){return{name:"schema",derive({store:n,selection:d,nodes:t,kindSelection:f,edgeSelection:v,principal:l}){let A=(e,a)=>l!==void 0&&!n.permits({name:e,args:a},l).ok,c=[];if(t.length===0&&v.length>0){for(let e of v){let a=n.graph.getNode(e.from),h=n.graph.getNode(e.to);if(!a||!h)continue;let m=un(n,e);m?.provisional&&c.push({id:`schema:edge:${Q}:${e.kind}:${e.from}:${e.to}`,label:"Keep this link",provider:"schema",mutation:Q,args:{kind:e.kind,from:e.from,to:e.to},open:[],score:64,why:cn(m),nodeIds:[e.from,e.to]});for(let r of n.allMutations()){let o=(r.connects??[]).includes(e.kind),k=(r.severs??[]).includes(e.kind);if(!o&&!k||r.derived?.relation!==void 0&&r.derived.kind!==a.kind)continue;let g={},$=[],j=E(r.input);for(let p of j){let S=p.kinds.includes("*")||p.kinds.includes(a.kind),P=p.kinds.includes("*")||p.kinds.includes(h.kind),y=S&&!j.some(I=>I!==p&&(I.kinds.includes(a.kind)||I.kinds.includes("*")));S&&!P?g[p.name]=e.from:P&&!S?g[p.name]=e.to:S&&P&&y?g[p.name]=e.from:$.push({name:p.name,kinds:p.kinds,candidates:[e.from,e.to],shape:x(r.input,p.name)})}for(let p of q(r.input,""))p in g||$.some(S=>S.name===p)||$.push({name:p,shape:x(r.input,p)});$.every(p=>p.optional===!0?!0:p.kinds!==void 0?(p.candidates?.length??0)>0:(p.candidates?.length??0)>0||p.shape!==void 0&&p.shape.type!=="unknown")&&(o&&!k&&$.length===0||c.push({id:`schema:edge:${r.name}:${e.kind}:${e.from}:${e.to}`,label:K(r),provider:"schema",mutation:r.name,args:g,open:$,...r.destructive?{destructive:!0}:{},score:(k?62:58)-$.length,why:`this line is "${Z(n.schema,n.graph.getNode(e.from)?.kind??"",e.kind,"out")}"`,nodeIds:[e.from,e.to]}))}}return{affordances:c}}if(t.length===0&&f.length>0){let e=new Set(f),a=[];for(let h of n.allMutations()){if(!(h.creates??[]).some(o=>e.has(o)))continue;let m=[];for(let o of E(h.input)){let k=o.kinds.includes("*")?n.graph.allNodes().map(g=>g.id):o.kinds.flatMap(g=>n.graph.nodesOfKind(g).map($=>$.id));m.push({name:o.name,kinds:o.kinds,candidates:k,shape:x(h.input,o.name),...o.optional?{optional:!0}:{}})}for(let o of q(h.input,""))m.some(k=>k.name===o)||m.push({name:o,shape:x(h.input,o)});if(!m.every(o=>o.optional===!0?!0:o.kinds!==void 0?(o.candidates?.length??0)>0:(o.candidates?.length??0)>0||o.shape!==void 0&&o.shape.type!=="unknown")&&!A(h.name,{})){let o=m.filter(k=>k.optional!==!0&&k.kinds!==void 0&&!k.kinds.includes("*")&&(k.candidates?.length??0)===0);if(o.length>0){let k=[...new Set(o.flatMap(g=>g.kinds??[]))].map(g=>J(G(n.schema.tryDefinition(g),g)));a.push({id:`schema:waits:${h.name}`,text:`"${h.title??h.name}" cannot begin until there is ${k.length===1?k[0]:`${k.slice(0,-1).join(", ")} and ${k[k.length-1]}`}.`,nodeIds:[]})}continue}c.push({id:`schema:add:${h.name}`,label:K(h),provider:"schema",mutation:h.name,args:{},open:m,score:X-m.length,why:`this makes ${(h.creates??[]).filter(o=>e.has(o)).map(o=>J(G(n.schema.tryDefinition(o),o))).join(", ")}`,nodeIds:[]})}return{affordances:c,observations:a}}if(t.length===0)return{};let w=new Set(t.map(e=>e.kind)),s=(e,a,h)=>{let m=[];for(let r of n.graph.allEdges()){if(!a.includes(r.kind))continue;let o=r.from===e?r.to:r.to===e?r.from:null;if(!o)continue;let k=n.graph.getNode(o);k&&(!h.includes("*")&&!h.includes(k.kind)||m.includes(o)||m.push(o))}return m};for(let e of n.allMutations()){let a=e.subject;if(!a||!(a.kinds==="*"?!0:[...w].every(u=>a.kinds.includes(u))))continue;let m=e.derived?.act;if((m==="archive"||m==="merge")&&t.some(u=>V(u))||m==="unarchive"&&!t.some(u=>V(u))||m==="leave-alone"&&t.every(u=>U(n,u.id))||m==="allow-tidying"&&!t.some(u=>U(n,u.id)))continue;let r=t.length===1?t[0].id:null,o=e.severs??[],k=e.connects??[];if(r&&o.length>0&&k.length===0&&s(r,o,["*"]).length===0)continue;let g=[];for(let u of E(e.input)){if(u.name===a.arg)continue;let p=u.kinds.includes("*")?n.graph.allNodes().map(S=>S.id):u.kinds.flatMap(S=>n.graph.nodesOfKind(S).map(P=>P.id));if(r&&k.length>0){let S=new Set(s(r,k,u.kinds));p=p.filter(P=>!S.has(P))}else r&&o.length>0&&(p=s(r,o,u.kinds));g.push({name:u.name,kinds:u.kinds,candidates:p.filter(S=>!d.includes(S)),shape:x(e.input,u.name),...u.optional?{optional:!0}:{}})}for(let u of q(e.input,a.arg))g.some(p=>p.name===u)||g.push({name:u,shape:x(e.input,u)});if(g.length===0&&r){let u=Sn(e.input,a.arg);if(u.length>0&&!wn(n,e.name,{[a.arg]:r}))for(let p of u){let S=E(e.input).find(P=>P.name===p);g.push({name:p,optional:!0,...S?{kinds:S.kinds}:{},shape:x(e.input,p)})}}if(!g.every(u=>u.optional===!0?!0:u.kinds!==void 0?(u.candidates?.length??0)>0:(u.candidates?.length??0)>0||u.shape!==void 0&&u.shape.type!=="unknown")&&!A(e.name,r?{[a.arg]:r}:{}))continue;let j=t.map(u=>({[a.arg]:u.id}));g.length===0&&!j.some(u=>n.wouldChange({name:e.name,args:u}))||c.push({id:`schema:${e.name}`,label:t.length>1?`${K(e)} (${t.length})`:K(e),provider:"schema",mutation:e.name,args:j[0]??{},open:g,...e.destructive?{destructive:!0}:{},...e.derived?.act==="archive"||e.derived?.act==="merge"||e.derived?.act==="leave-alone"||e.derived?.act==="allow-tidying"?{setsAside:!0}:{},...o.length>0||k.length>0?{ties:!0}:{},...t.length>1?{batch:j}:{},score:X-g.length,why:t.length>1?`all ${t.length} selected nodes are ${[...w].map(u=>tn(n.schema,u).toLowerCase()).join(" or ")}`:`this is ${J(G(n.schema.tryDefinition(t[0].kind),t[0].kind))}`,nodeIds:t.map(u=>u.id)})}if(t.length===1){let e=t[0];for(let a of n.allMutations()){let h=a.subject,m=a.severs??[],r=a.connects??[];if(!h||m.length===0&&r.length===0)continue;let o=h.kinds==="*"?"*":h.kinds;if(o==="*"||o.includes(e.kind))continue;let k=E(a.input),g=k.find(y=>y.name!==h.arg&&(y.kinds.includes("*")||y.kinds.includes(e.kind)));if(!g)continue;let $=o,j=$.includes("*")?n.graph.allNodes().map(y=>y.id):$.flatMap(y=>n.graph.nodesOfKind(y).map(I=>I.id)),u=new Set(s(e.id,r.length>0?r:m,$)),p=r.length>0?j.filter(y=>!u.has(y)):j.filter(y=>u.has(y));if(p.length===0)continue;let S=[{name:h.arg,kinds:$,candidates:p,shape:x(a.input,h.arg)}];for(let y of k){if(y.name===g.name||y.name===h.arg)continue;let I=y.kinds.includes("*")?n.graph.allNodes().map(L=>L.id):y.kinds.flatMap(L=>n.graph.nodesOfKind(L).map(O=>O.id));S.push({name:y.name,kinds:y.kinds,candidates:I,shape:x(a.input,y.name),...y.optional?{optional:!0}:{}})}for(let y of q(a.input,g.name))y===h.arg||S.some(I=>I.name===y)||S.push({name:y,shape:x(a.input,y)});S.every(y=>y.optional===!0?!0:y.kinds!==void 0?(y.candidates?.length??0)>0:(y.candidates?.length??0)>0||y.shape!==void 0&&y.shape.type!=="unknown")&&c.push({id:`schema:tie:${a.name}:${e.id}`,label:a.fromTheOtherEnd??K(a),provider:"schema",mutation:a.name,args:{[g.name]:e.id},open:S,ties:!0,...a.destructive?{destructive:!0}:{},score:X-S.length+2,why:`${m.length>0?"this one is on":"this one could join"} ${S[0].candidates.length===1?"it":"one of these"}`,nodeIds:[e.id]})}}return{affordances:c}}}}function Sn(n,d){let t=n.shape;return t?Object.entries(t).filter(([f,v])=>f!==d&&v.safeParse(void 0).success).map(([f])=>f):[]}function wn(n,d,t){try{return n.preview({name:d,args:t}),!0}catch{return!1}}function q(n,d){let t=n.shape;return t?Object.entries(t).filter(([f,v])=>f!==d&&!v.safeParse(void 0).success).map(([f])=>f):[]}var An=70,$n=80,On=new Set(["id","kind"]);function mn(){return{name:"structure",derive({store:n,nodes:d}){let t=c=>T(n.schema.tryDefinition(c.kind),c);if(d.length<2)return{};let f=[],v=[],l=d.map(c=>c.id);for(let c of n.schema.edgeKinds){let w=In(d.map(e=>new Set([...n.graph.out(e.id,c).map(a=>a.id),...n.graph.in(e.id,c).map(a=>a.id)])));for(let e of w){let a=n.graph.getNode(e);a&&f.push({id:`shared:${c}:${e}`,text:`all ${d.length} share "${t(a)}" (${H(c).toLowerCase()})`,nodeIds:[...l,e]})}let s=new Map;for(let e of d)for(let a of[...n.graph.out(e.id,c),...n.graph.in(e.id,c)])s.set(a.id,(s.get(a.id)??0)+1);for(let[e,a]of s){if(a!==d.length-1||d.length<3||l.includes(e))continue;let h=n.graph.getNode(e);if(!h)continue;let m=d.find(r=>![...n.graph.out(r.id,c),...n.graph.in(r.id,c)].some(o=>o.id===e));if(m&&(f.push({id:`near-shared:${c}:${e}`,text:`all but "${t(m)}" share "${t(h)}" (${H(c).toLowerCase()})`,nodeIds:[...l,e]}),!(!n.schema.edgeAllowed(c,m.kind,h.kind)&&!n.schema.edgeAllowed(c,h.kind,m.kind))))for(let r of n.allMutations()){let o=r.subject;if(!o||o.kinds!=="*"&&!o.kinds.includes(m.kind)||(r.connects!==void 0||r.severs!==void 0)&&!(r.connects??[]).includes(c))continue;let g=Pn(r.input,h.kind);g&&v.push({id:`structure:join:${r.name}:${m.id}:${e}`,label:`${K(r)}: bring "${t(m)}" in line with the others`,provider:"structure",mutation:r.name,args:{[o.arg]:m.id,[g]:e},open:[],score:An,why:`every other selected node is connected to "${t(h)}"`,nodeIds:[m.id,e]})}}}let A=new Map;for(let c of d)A.set(c.kind,[...A.get(c.kind)??[],c]);for(let[c,w]of A){if(w.length<2)continue;let s=w,e=w.map(r=>r.id),a=A.size>1?`${c}:`:"",h=new Set;for(let r of s)for(let o of Object.keys(r))On.has(o)||h.add(o);let m=r=>n.schema.definitions.find(o=>o.kind===r);for(let r of[...h].sort()){let o=m(s[0].kind),k=sn(o,r),g=o?.display?.format?.[r],$=O=>{if(!g)return O;try{return String(g(JSON.parse(O)))}catch{return O}},j=s.map(O=>O[r]),u=new Map;if(j.forEach((O,R)=>{let D=JSON.stringify(O??null),M=u.get(D);M?M.push(s[R]):u.set(D,[s[R]])}),u.size===1){let O=[...u.keys()][0];if(O==="null")continue;f.push({id:`agree:${a}${r}`,text:`all ${s.length} share the ${k} ${$(O)}`,nodeIds:e});continue}if(s.length<3||u.size!==2)continue;let p=[...u.entries()].sort((O,R)=>R[1].length-O[1].length),[S,P]=p[0],[,y]=p[1];if(y.length!==1||S==="null")continue;let I=y[0],L=JSON.parse(S);f.push({id:`odd-one-out:${a}${r}`,text:`${P.length} share the ${k} ${$(S)}; "${t(I)}" does not`,nodeIds:e});for(let O of n.allMutations()){let R=O.subject;if(!R||R.kinds!=="*"&&!R.kinds.includes(I.kind))continue;let D=kn(O.input);if(!D||!(r in D))continue;let M={[R.arg]:I.id,[r]:L},C=!0;for(let[W,z]of Object.entries(D)){if(W in M||z.safeParse(void 0).success)continue;let B=I[W];if(B===void 0){C=!1;break}M[W]=B}!C||!O.input.safeParse(M).success||v.push({id:`structure:align:${O.name}:${r}:${I.id}`,label:`Align the ${k} of "${t(I)}" with the other ${P.length}`,provider:"structure",mutation:O.name,args:M,open:[],score:$n,why:`${P.length} of ${s.length} share the ${k} ${$(S)}`,nodeIds:e})}}}return{affordances:v,observations:f}}}}function In(n){if(n.length===0)return[];let[d,...t]=n;return[...d].filter(f=>t.every(v=>v.has(f))).sort()}function kn(n){return n.shape??null}function Pn(n,d){let t=kn(n);if(!t)return null;for(let[f]of Object.entries(t)){let v=on(t[f]);if(v&&(v.includes("*")||v.includes(d)))return f}return null}function jn(){return[gn(),mn(),pn(),fn()]}function Xn(n,d,t={}){let f=yn(),v=t.providers??jn(),l=d.map(i=>n.graph.getNode(i)).filter(i=>i!==void 0),A={store:n,selection:d,nodes:l,kindSelection:t.kindSelection??[],edgeSelection:t.edgeSelection??[],violations:n.violations(t.context),context:t.context??{},principal:t.principal??{kind:"human"}},c=[],w=[];for(let i of v){let b=i.derive(A);c.push(...b.affordances??[]),w.push(...b.observations??[])}let s=new Map(n.allMutations().map(i=>[i.name,i]));c.forEach((i,b)=>{let N=i.open.length>1?s.get(i.mutation):void 0;N&&(c[b]={...i,open:an(i.open,rn(n.schema,N))})});let e=new Set(n.allMutations().filter(i=>i.pinned).map(i=>i.name)),a=new Set(t.pins?.pinned??[]),h=new Set(t.pins?.unpinned??[]),m=i=>a.has(i.mutation)?"user":e.has(i.mutation)&&!h.has(i.mutation)?"declared":void 0,r=i=>{let b=m(i);return b?{...i,pinned:b}:i},o=new Map;for(let[i,b]of ln(n.log.all()))o.set(i,hn(b));let k=i=>i.pinned==="user"?0:i.pinned==="declared"?1:2,g=i=>i.score+(o.get(i.mutation)??0),$=new Map(n.allMutations().map(i=>[i.name,i])),j=new Map,u=i=>{let b=$.get(i.mutation);if(!b)return[];let N=j.get(i.mutation);N||(N=E(b.input).map(F=>F.name),j.set(i.mutation,N));let _=[];for(let F of i.batch??[i.args])for(let Y of N){let nn=F[Y]??i.args[Y];typeof nn=="string"&&_.push(nn)}return _},p=t.focus,S=4,P=i=>i.open.length>0?1:0,y=i=>{if(p===void 0)return S;let b=u(i);return b.length>0?b.includes(p)?I(i,0):S:i.nodeIds.includes(p)||i.subjectId===p?I(i,1):S},I=(i,b)=>i.provider==="invariant"?b:2+P(i),L=i=>i.setsAside?1:0,O=Nn(c).map(r),R=new Map(O.map((i,b)=>[i,b])),D=O.sort((i,b)=>{let N=Number(i.destructive??!1)-Number(b.destructive??!1);if(N!==0)return N;let _=L(i)-L(b);if(_!==0)return _;let F=y(i)-y(b);return F!==0?F:y(i)<2?R.get(i)-R.get(b):+(b.provider==="invariant")-+(i.provider==="invariant")||k(i)-k(b)||g(b)-g(i)||i.id.localeCompare(b.id)}),M=t.principal??{kind:"human"},C=[],W=[];for(let i of D){let b=n.permits({name:i.mutation,args:{...i.args,...i.batch?.[0]??{}}},M);if(b.ok)C.push(i);else{let N=Rn(n,i,M);if(N==="done")continue;N?C.push(N):W.push({...i,refusal:b.refusal})}}let z=C.map((i,b)=>({...i,rank:b})),B=W.map((i,b)=>({...i,rank:C.length+b}));return{affordances:t.limit===void 0?z:z.slice(0,t.limit),withheld:B,observations:xn(w),ms:yn()-f}}function Nn(n){let d=new Map;for(let t of n){let f=[t.mutation,JSON.stringify(t.args),JSON.stringify(t.batch??null)].join("|"),v=d.get(f);(!v||t.score>v.score)&&d.set(f,t)}return[...d.values()]}function xn(n){let d=new Map;for(let t of n)d.set(t.text,t);return[...d.values()]}function yn(){return typeof performance<"u"?performance.now():Date.now()}function Yn(n,d,t={},f={}){let v=(d.batch??[d.args]).map(A=>({name:d.mutation,args:{...d.args,...A,...t}})),l=n.allMutations().find(A=>A.name===d.mutation);return n.applyAll(v,{...l?.describe?{}:{intent:d.label},...f.author?{author:f.author}:{}})}function ne(n,d,t={},f={}){try{return n.preview({name:d.mutation,args:{...d.args,...t}})}catch(v){throw f.pressed&&dn(v,f.pressed.author?.id),v}}function Rn(n,d,t){let f=n.allMutations().find(s=>s.name===d.mutation)?.subject,v=f!==void 0&&d.args[f.arg]===void 0,l=v?d.open.find(s=>s.name===f.arg):d.open.find(s=>s.name!==f?.arg&&s.candidates);if(!l?.candidates)return;let A=s=>n.permits({name:d.mutation,args:{...d.args,...d.batch?.[0]??{},[l.name]:s}},t).ok,c=l.candidates.filter(A),w=t.id===void 0?void 0:n.graph.getNode(t.id);if(c.length===0){let s=v?f.kinds:"*";return w!==void 0&&(s==="*"||s.includes(w.kind))&&A(w.id)?"done":void 0}return c.length===1&&c[0]===t.id?{...d,args:{...d.args,[l.name]:t.id},open:d.open.filter(s=>s!==l)}:{...d,open:d.open.map(s=>s===l?{...s,candidates:c}:s)}}export{Xn as a,Yn as b,ne as c};
@@ -1 +0,0 @@
1
- import{b as n}from"./chunk.C6CT6F4C.js";import{c as a}from"./chunk.JN3WZGJY.js";import"./chunk.CYEPHT7V.js";import"./chunk.U5P23GO7.js";import"./chunk.JHAMSDAI.js";import"./chunk.B5EFNTDA.js";import"./chunk.47VEV4BX.js";import"./chunk.FE3SINPK.js";import"./chunk.MUWI54IP.js";import"./chunk.3D37E2G5.js";import"./chunk.GTF6EMVE.js";import"./chunk.CLIC2QBA.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{W as i}from"./chunk.FWXW4T4I.js";import"./chunk.SDO3U72B.js";import"./chunk.DHPXRDT5.js";import"./chunk.FQLNBIQ5.js";import{b as o}from"./chunk.AJZBJBMO.js";var e=o(i(),1);function m({entries:d,style:l,headingStyle:p,className:r}){return(0,e.jsxs)("section",{...r?{className:r}:{},"data-testid":"record-ai","aria-label":"What AI did here",style:{display:"grid",gap:10,...l},children:[(0,e.jsx)("h2",{style:p??{margin:0,fontSize:"1rem"},children:"What AI did here"}),(0,e.jsx)("ol",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:8,fontSize:"0.875rem"},children:d.slice(0,8).map(t=>(0,e.jsx)(n,{entry:t,undo:s=>(0,e.jsx)(a,{batch:s})},t.id))})]})}export{m as RecordInteractions};