graview 0.1.44 → 0.1.45

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 (178) hide show
  1. package/dist/preview/{chunk.2O2THM2R.js → chunk.2EFH63WS.js} +1 -1
  2. package/dist/preview/{chunk.RVQYXPCM.js → chunk.2JJYGYT2.js} +1 -1
  3. package/dist/preview/chunk.2LKMNEWZ.js +1 -0
  4. package/dist/preview/{chunk.P5K7EYDK.js → chunk.2YABX3SC.js} +1 -1
  5. package/dist/preview/{chunk.5WEEZ7WD.js → chunk.3HSPWSAI.js} +1 -1
  6. package/dist/preview/chunk.3NMINX5Z.js +1 -0
  7. package/dist/preview/{chunk.ZN77U6SU.js → chunk.4HYJHGI4.js} +1 -1
  8. package/dist/preview/{chunk.BA4KQR5H.js → chunk.4KNEBLB7.js} +1 -1
  9. package/dist/preview/{chunk.UXLJZIYX.js → chunk.4RJZVTW7.js} +1 -1
  10. package/dist/preview/{chunk.GAN77YDU.js → chunk.4XOWRYRU.js} +1 -1
  11. package/dist/preview/{chunk.F4DWRBO7.js → chunk.55D33E5A.js} +1 -1
  12. package/dist/preview/{chunk.YTXEPWVW.js → chunk.5B2LH2SR.js} +1 -1
  13. package/dist/preview/chunk.5EDA3JHU.js +1 -0
  14. package/dist/preview/{chunk.V4DR25S4.js → chunk.5O5IJVLN.js} +1 -1
  15. package/dist/preview/chunk.5R2R364Q.js +1 -0
  16. package/dist/preview/{chunk.ALFW4ZJQ.js → chunk.63JLXGYX.js} +1 -1
  17. package/dist/preview/{chunk.7PUFYK3B.js → chunk.64WM4IBI.js} +1 -1
  18. package/dist/preview/chunk.66JF3UMG.js +1 -0
  19. package/dist/preview/{chunk.FNXW46U4.js → chunk.6BJBPDF3.js} +72 -72
  20. package/dist/preview/{chunk.YTZDCIX2.js → chunk.6KWFTSK4.js} +1 -1
  21. package/dist/preview/{chunk.ATKKTPJS.js → chunk.6MADC6DM.js} +1 -1
  22. package/dist/preview/{chunk.N5ULWKR4.js → chunk.6RY6OSE6.js} +1 -1
  23. package/dist/preview/{chunk.HP72LB3B.js → chunk.6SJA4FSW.js} +1 -1
  24. package/dist/preview/chunk.6SWW6KEV.js +1 -0
  25. package/dist/preview/chunk.6UIW664O.js +6 -0
  26. package/dist/preview/chunk.6USUVORO.js +1 -0
  27. package/dist/preview/{chunk.O4VSQ2ER.js → chunk.6X3G3PWL.js} +1 -1
  28. package/dist/preview/chunk.7KVWV577.js +1 -0
  29. package/dist/preview/{chunk.FVHECT47.js → chunk.7ZRFXI73.js} +1 -1
  30. package/dist/preview/{chunk.AW2T3KFV.js → chunk.AS4CQBOQ.js} +1 -1
  31. package/dist/preview/{chunk.OAWAUB4P.js → chunk.B6KT6BTG.js} +4 -4
  32. package/dist/preview/{chunk.7B5BZZBG.js → chunk.BGYY55VO.js} +1 -1
  33. package/dist/preview/{chunk.B7FZLIAO.js → chunk.BNPQUI3F.js} +1 -1
  34. package/dist/preview/chunk.BRDAO2OF.js +4 -0
  35. package/dist/preview/{chunk.EW364363.js → chunk.BS2SJC2P.js} +2 -2
  36. package/dist/preview/{chunk.HKD5SR45.js → chunk.C2UFMFJ3.js} +2 -2
  37. package/dist/preview/{chunk.RNUGQRJI.js → chunk.CBUSFM3E.js} +1 -1
  38. package/dist/preview/chunk.CSDERNQV.js +1 -0
  39. package/dist/preview/{chunk.JGYGSNQY.js → chunk.DLFWBG33.js} +1 -1
  40. package/dist/preview/{chunk.LKF4BBCW.js → chunk.DQHPEKWK.js} +1 -1
  41. package/dist/preview/{chunk.7AEE3VHC.js → chunk.DQOCBKC3.js} +1 -1
  42. package/dist/preview/{chunk.KERLVJ6I.js → chunk.DX357TZ3.js} +1 -1
  43. package/dist/preview/{chunk.3M4VCAA3.js → chunk.E37V2EJM.js} +1 -1
  44. package/dist/preview/{chunk.DLVNW4HU.js → chunk.E4G6DXSB.js} +1 -1
  45. package/dist/preview/chunk.EAUVEVVO.js +1 -0
  46. package/dist/preview/chunk.EVW5YY3W.js +1 -0
  47. package/dist/preview/chunk.F6HMZL65.js +1 -0
  48. package/dist/preview/{chunk.EJAWDI2V.js → chunk.FCAYURB4.js} +1 -1
  49. package/dist/preview/{chunk.FIJNKSMQ.js → chunk.FF6DBQMB.js} +1 -1
  50. package/dist/preview/chunk.FHZBXMXR.js +33 -0
  51. package/dist/preview/{chunk.D2RK2KJD.js → chunk.FOFLD64U.js} +1 -1
  52. package/dist/preview/{chunk.YERDP6YF.js → chunk.FPASZ4RD.js} +1 -1
  53. package/dist/preview/{chunk.WPLKHIO5.js → chunk.FTM64IDI.js} +1 -1
  54. package/dist/preview/chunk.GEPNIMXW.js +1 -0
  55. package/dist/preview/{chunk.EYEIDL3T.js → chunk.GER2XRD4.js} +1 -1
  56. package/dist/preview/chunk.GFLAGZSB.js +1 -0
  57. package/dist/preview/{chunk.IQWKEGWG.js → chunk.GIYFEGAP.js} +1 -1
  58. package/dist/preview/chunk.GVY5UQTJ.js +1 -0
  59. package/dist/preview/{chunk.4EPT2CQG.js → chunk.H7KCWCB4.js} +1 -1
  60. package/dist/preview/{chunk.MZOIPCDA.js → chunk.HDRD33II.js} +1 -1
  61. package/dist/preview/{chunk.5JPELFMA.js → chunk.HGTPTRMM.js} +1 -1
  62. package/dist/preview/chunk.HWCHFQ7O.js +6 -0
  63. package/dist/preview/{chunk.LUPBT6YM.js → chunk.HZGVEHEN.js} +1 -1
  64. package/dist/preview/{chunk.VAUG5TGZ.js → chunk.ICCIZDTQ.js} +1 -1
  65. package/dist/preview/{chunk.REEDZSCG.js → chunk.ICGNIK3Z.js} +2 -2
  66. package/dist/preview/chunk.II7VTGNC.js +1 -0
  67. package/dist/preview/{chunk.27ZVVPRZ.js → chunk.IKX4VDTW.js} +1 -1
  68. package/dist/preview/chunk.IW7YFPGG.js +1 -0
  69. package/dist/preview/chunk.J7G3AATY.js +14 -0
  70. package/dist/preview/{chunk.IBWPRK2R.js → chunk.JBW3DI7E.js} +1 -1
  71. package/dist/preview/{chunk.QJJKITXF.js → chunk.JDMXZFSG.js} +1 -1
  72. package/dist/preview/{chunk.RYNCEZ6Q.js → chunk.JHIUG25Q.js} +1 -1
  73. package/dist/preview/{chunk.UZSZPMRC.js → chunk.JLEC3USG.js} +1 -1
  74. package/dist/preview/{chunk.XPIDPZKS.js → chunk.JLYNMAME.js} +1 -1
  75. package/dist/preview/{chunk.6BIRNR5P.js → chunk.JR7RDOEP.js} +1 -1
  76. package/dist/preview/{chunk.LULTKYE3.js → chunk.JSSFA3FC.js} +1 -1
  77. package/dist/preview/chunk.K46YRA65.js +1 -0
  78. package/dist/preview/chunk.K6KMLD2B.js +21 -0
  79. package/dist/preview/{chunk.2CPC3HQI.js → chunk.KBHU54NM.js} +1 -1
  80. package/dist/preview/{chunk.NBOZPPSM.js → chunk.KRGM25HF.js} +1 -1
  81. package/dist/preview/chunk.KUUDW7VR.js +1 -0
  82. package/dist/preview/{chunk.UG23RICT.js → chunk.KWQ7QOHD.js} +1 -1
  83. package/dist/preview/chunk.L24FCXZ7.js +1 -0
  84. package/dist/preview/{chunk.H4GHKBMH.js → chunk.L2PI7V4R.js} +1 -1
  85. package/dist/preview/{chunk.LKXYZK5H.js → chunk.L3FOLN3K.js} +1 -1
  86. package/dist/preview/{chunk.REOYQTFP.js → chunk.L3FQZCWI.js} +1 -1
  87. package/dist/preview/{chunk.ZP6PS5Z4.js → chunk.LEO2KWLZ.js} +1 -1
  88. package/dist/preview/{chunk.TTSNHX3F.js → chunk.LNG3CQNI.js} +1 -1
  89. package/dist/preview/{chunk.NPS2WN7T.js → chunk.LSLLKICK.js} +1 -1
  90. package/dist/preview/{chunk.FNF6XQI5.js → chunk.M5GJHVWZ.js} +1 -1
  91. package/dist/preview/{chunk.JQ7WY2VZ.js → chunk.MGWMGLWE.js} +1 -1
  92. package/dist/preview/{chunk.6NFR2LYQ.js → chunk.NIVTK2W5.js} +1 -1
  93. package/dist/preview/chunk.NMIXBH37.js +1 -0
  94. package/dist/preview/{chunk.KSXB4LDF.js → chunk.OF34OZ4V.js} +1 -1
  95. package/dist/preview/chunk.OMZ3LDDN.js +1 -0
  96. package/dist/preview/{chunk.ESU2DD3J.js → chunk.OYHQSXNC.js} +1 -1
  97. package/dist/preview/{chunk.IIB22IIP.js → chunk.PKUDIWIF.js} +1 -1
  98. package/dist/preview/{chunk.FUYMLDNJ.js → chunk.PRD3UNJX.js} +1 -1
  99. package/dist/preview/{chunk.TDCO7LEA.js → chunk.Q7RQC3F7.js} +1 -1
  100. package/dist/preview/{chunk.ZKBSEUK4.js → chunk.QGVLJTZS.js} +1 -1
  101. package/dist/preview/chunk.QPCSS322.js +1 -0
  102. package/dist/preview/{chunk.QNJYXB3U.js → chunk.R2AG4NHQ.js} +1 -1
  103. package/dist/preview/{chunk.IN4PKQO5.js → chunk.RNEJYIQ7.js} +1 -1
  104. package/dist/preview/chunk.RPX35VYU.js +1 -0
  105. package/dist/preview/{chunk.JLOSQ5UY.js → chunk.RYRTKIKB.js} +2 -2
  106. package/dist/preview/chunk.S5MQVPLF.js +1 -0
  107. package/dist/preview/{chunk.MFLJIFZD.js → chunk.S6WHA4CW.js} +1 -1
  108. package/dist/preview/{chunk.3L7OEBJH.js → chunk.SDU76JU6.js} +1 -1
  109. package/dist/preview/{chunk.RDGFZPKN.js → chunk.SGKPGVBB.js} +1 -1
  110. package/dist/preview/chunk.SZ34UAQ3.js +2 -0
  111. package/dist/preview/chunk.T7XH7FVJ.js +1 -0
  112. package/dist/preview/{chunk.3IUJ4GW7.js → chunk.TBQOSI4J.js} +1 -1
  113. package/dist/preview/{chunk.Y2MIG2C2.js → chunk.TBSNNOQU.js} +1 -1
  114. package/dist/preview/{chunk.FBIK4LTM.js → chunk.TOXWNEOQ.js} +2 -2
  115. package/dist/preview/{chunk.PL2P2OON.js → chunk.UHX4WTM7.js} +1 -1
  116. package/dist/preview/chunk.UJKT2G6M.js +5 -0
  117. package/dist/preview/{chunk.OGF6UORU.js → chunk.UKAPFIPJ.js} +1 -1
  118. package/dist/preview/{chunk.YGX2AE36.js → chunk.UM7GWXEW.js} +1 -1
  119. package/dist/preview/{chunk.64QDUERE.js → chunk.UNCS63AM.js} +1 -1
  120. package/dist/preview/{chunk.CDFVEL2Y.js → chunk.URXSZQSF.js} +1 -1
  121. package/dist/preview/{chunk.P546VMA5.js → chunk.UY7IOVR6.js} +1 -1
  122. package/dist/preview/{chunk.U3CV5CCL.js → chunk.V5FIZIX2.js} +1 -1
  123. package/dist/preview/{chunk.DAZEFSWI.js → chunk.VC3BX2ZF.js} +1 -1
  124. package/dist/preview/{chunk.4WCQWILK.js → chunk.VSAPJAT3.js} +1 -1
  125. package/dist/preview/{chunk.MWUP5X47.js → chunk.VW2VCPJX.js} +1 -1
  126. package/dist/preview/chunk.W2RCWPLK.js +1 -0
  127. package/dist/preview/{chunk.DGXWL4GC.js → chunk.W44VRHKS.js} +2 -2
  128. package/dist/preview/{chunk.3TBH2FMZ.js → chunk.WAB7UDHU.js} +1 -1
  129. package/dist/preview/{chunk.OK4FSBHI.js → chunk.WBHM5I3I.js} +1 -1
  130. package/dist/preview/chunk.WM2LWHTJ.js +1 -0
  131. package/dist/preview/{chunk.56DR42FA.js → chunk.WPOTEXJZ.js} +1 -1
  132. package/dist/preview/{chunk.T6S3CEW7.js → chunk.WSTBCWW7.js} +2 -2
  133. package/dist/preview/{chunk.TJO5Y2OJ.js → chunk.XMCFZD3A.js} +1 -1
  134. package/dist/preview/chunk.XWAMQPUM.js +25 -0
  135. package/dist/preview/{chunk.IQ3LUSD6.js → chunk.XXEYRHRG.js} +1 -1
  136. package/dist/preview/{chunk.7UV7ODXU.js → chunk.Y5ARSVH4.js} +1 -1
  137. package/dist/preview/{chunk.B2CIQ66N.js → chunk.Z6TMIAAB.js} +1 -1
  138. package/dist/preview/chunk.ZBR2QY67.js +104 -0
  139. package/dist/preview/chunk.ZEAH57AZ.js +1 -0
  140. package/dist/preview/{chunk.JEMQ66FT.js → chunk.ZJ2VS4M4.js} +1 -1
  141. package/dist/preview/chunk.ZTIF23VF.js +1 -0
  142. package/dist/preview/index.html +49 -45
  143. package/dist/preview/page.js +2 -34
  144. package/package.json +6 -6
  145. package/dist/preview/chunk.2EXY4AHX.js +0 -117
  146. package/dist/preview/chunk.3JATXDSP.js +0 -1
  147. package/dist/preview/chunk.3OKJ4GOA.js +0 -1
  148. package/dist/preview/chunk.3PNDXNX6.js +0 -1
  149. package/dist/preview/chunk.4B4DKCS4.js +0 -1
  150. package/dist/preview/chunk.4JWT6LIS.js +0 -25
  151. package/dist/preview/chunk.6VIZGLDK.js +0 -1
  152. package/dist/preview/chunk.7HL7CFXJ.js +0 -1
  153. package/dist/preview/chunk.7JVBVB4A.js +0 -1
  154. package/dist/preview/chunk.CSQNDAEK.js +0 -1
  155. package/dist/preview/chunk.EJOTTZWZ.js +0 -1
  156. package/dist/preview/chunk.EZRGGPAN.js +0 -1
  157. package/dist/preview/chunk.GAFYE37S.js +0 -3
  158. package/dist/preview/chunk.GBCWI2LF.js +0 -2
  159. package/dist/preview/chunk.HB34VQKQ.js +0 -1
  160. package/dist/preview/chunk.HKA27VJO.js +0 -1
  161. package/dist/preview/chunk.IPHWGBZE.js +0 -6
  162. package/dist/preview/chunk.JUT2VCFW.js +0 -1
  163. package/dist/preview/chunk.L6FWIQXS.js +0 -1
  164. package/dist/preview/chunk.LYSHLKAX.js +0 -1
  165. package/dist/preview/chunk.LYUPJ4VV.js +0 -1
  166. package/dist/preview/chunk.MOF2D6DV.js +0 -1
  167. package/dist/preview/chunk.NTFCZYOR.js +0 -1
  168. package/dist/preview/chunk.OG6GNGTX.js +0 -21
  169. package/dist/preview/chunk.PSTE3LZL.js +0 -5
  170. package/dist/preview/chunk.PX6VAZFJ.js +0 -1
  171. package/dist/preview/chunk.RLMW7DU6.js +0 -1
  172. package/dist/preview/chunk.URCC626R.js +0 -1
  173. package/dist/preview/chunk.WE5SA6TP.js +0 -1
  174. package/dist/preview/chunk.WNYPP52L.js +0 -1
  175. package/dist/preview/chunk.YE4GZVOX.js +0 -1
  176. package/dist/preview/chunk.YWVOACSX.js +0 -5
  177. package/dist/preview/chunk.YYPK7IDM.js +0 -1
  178. package/dist/preview/chunk.ZZ5F5I3O.js +0 -1
@@ -1 +0,0 @@
1
- import{h as n}from"./chunk.LUPBT6YM.js";import"./chunk.IBWPRK2R.js";import"./chunk.RNUGQRJI.js";import"./chunk.6NFR2LYQ.js";import"./chunk.U3CV5CCL.js";import"./chunk.LKF4BBCW.js";import"./chunk.NPS2WN7T.js";import"./chunk.JUT2VCFW.js";import"./chunk.HKD5SR45.js";import"./chunk.7UV7ODXU.js";import"./chunk.IIB22IIP.js";import"./chunk.MWUP5X47.js";import"./chunk.WVUJXDXZ.js";import{e as p}from"./chunk.ESU2DD3J.js";import"./chunk.PL2P2OON.js";import"./chunk.27ZVVPRZ.js";import"./chunk.IN4PKQO5.js";import"./chunk.3IUJ4GW7.js";import"./chunk.UG23RICT.js";import"./chunk.GZHZLJBF.js";import"./chunk.ATKKTPJS.js";import"./chunk.OJGHDWI6.js";import"./chunk.UZSZPMRC.js";import"./chunk.MZOIPCDA.js";import"./chunk.KERLVJ6I.js";import"./chunk.4EPT2CQG.js";import"./chunk.FNXW46U4.js";import{R as m}from"./chunk.4JWT6LIS.js";import"./chunk.SDO3U72B.js";import"./chunk.AW2T3KFV.js";import"./chunk.2AZTW66C.js";import{b as t}from"./chunk.AJZBJBMO.js";var i=t(m(),1),a=new WeakMap;function s(o){let e=a.get(o);if(!e){let r=p(o);e=c=>c.mode==="fullscreen"?(0,i.jsx)(n,{blocks:r,slot:"home",heading:2,firstHeading:1}):(0,i.jsx)(n,{blocks:r,slot:"home",heading:3,firstHeading:2}),a.set(o,e)}return e}export{s as homeView};
@@ -1 +0,0 @@
1
- import{a as we,b as De,c as Ke,d as le,e as A,f as Me,h as Te}from"./chunk.JQ7WY2VZ.js";import{h as Ge,i as Ce,j as Ne}from"./chunk.27ZVVPRZ.js";import{a as oe,b as se,c as H,d as Pe,e as Y,g as ee,h as _e}from"./chunk.3IUJ4GW7.js";import{c as Ae,h as z,i as Fe,j as de}from"./chunk.UG23RICT.js";import{A as ve,Ga as Ee,Ha as Q,Ia as ae,Lb as ce,Mb as Re,b as L,c as q,e as Se,f as je,g as _,h as S,k as G,l as J,m as C,n as Oe,o as B,p as D,r as $,s as X,t as E,u as R,v as V,w as T,x as e,y as K,z as U,za as xe}from"./chunk.AW2T3KFV.js";var on=n=>Object.entries(n).map(([s,r])=>[s,Object.keys(Q(r?.edges))]),pe=(n,s)=>Re(n,on(s));var me="graview-document",ge=1,ze=256*1024,ne=64*1024,fe=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,ue=/^[a-z][A-Za-z0-9]*$/,sn=new Set(["id","kind"]),rn=/^(?:[a-z][a-z0-9]*(?:-[a-z0-9]+)*|[a-z][A-Za-z0-9]*)$/,an=["string","text","number","integer","boolean","date","datetime","enum","list","url","email","image","video","file","app-link","phone","place","duration"];function cn(){let n=k=>k in Object.prototype,s=U(k=>!n(k),"every object already has this name \u2014 choose another"),r=(k,N)=>[...k===void 0?[]:[je(k)],...N===void 0?[]:[Se(N)]],t=(k,N)=>S().check(...r(k,N)),a=(k,N,tn)=>D(k).check(...r(N,tn)),l=k=>S().check(_(fe,`${k} names are kebab-case, lower-case words joined by hyphens like "tool-note" (field and relation names are camelCase, like "supersededBy")`)),u=S().check(_(rn,'relation names are one camelCase word, like "supersededBy" (kind names are kebab-case, like "tool-note")'),s),m=S().check(_(ue,'field names are one word or camelCase, like "dueDate", so rules say them bare (kind names are kebab-case, like "tool-note")'),U(k=>!sn.has(k),'a field cannot be called "id" or "kind" \u2014 the framework keeps those; try "type" or "category"'),s),h=t(1,500),i=t(1,2e3),o=t(1,300),p=$({type:V(an),required:e(C()),description:e(h),label:e(t(1,60)),options:e(a(t(1,80),1,100)),of:e(V(["string","number","date","image","video","file"])),default:e(B()),unit:e(t(void 0,12)),format:e(V(["money","percent","duration","markdown"])),min:e(G()),max:e(G()),step:e(G()),renamedFrom:e(S().check(_(ue))),repeats:e(C())}).check(ve((k,N)=>{k.type==="enum"&&!k.options&&N.addIssue({code:"custom",message:'an enum field lists its "options"',path:["options"]}),k.type!=="enum"&&k.options&&N.addIssue({code:"custom",message:'"options" belongs only on an enum field',path:["options"]}),k.type!=="list"&&k.of&&N.addIssue({code:"custom",message:'"of" belongs only on a list field',path:["of"]}),k.repeats&&k.type!=="date"&&k.type!=="datetime"&&N.addIssue({code:"custom",message:'"repeats" belongs only on a date or datetime field',path:["repeats"]})})),w=S().check(_(new RegExp(`${fe.source}|${xe.source}`),'a relation goes to a kind of this document, like "house", or of another app, like "@nick/house/house"')),f=$({to:E([a(w,1),T("*")]),cardinality:e(V(["one","many"])),description:e(h),inverse:e(t(1,80)),appendOnly:e(C()),renamedFrom:e(S()),tidying:e(T("never"))}),d=E([i,$({expr:i,label:e(t(1,60)),description:e(h)})]),c=$({noun:e(t(1,40)),plural:e(t(1,40)),description:e(h),fields:R(m,p).check(U(k=>Object.keys(k).length>0,"a kind has at least one field")),label:e(o),describe:e(o),lifecycle:e($({field:m,retired:a(E([S(),G(),C()]),1)})),figure:e(t(void 0,2e4)),glance:e(a(m,1,20)),page:e($({fields:e(a(m,1,40)),groups:e(a($({title:t(1,60),fields:a(m,1,40)}),1,12))})),edges:e(R(u,f)),computed:e(R(S(),d).check(U(k=>Object.keys(k).length<=20,"a kind works out at most 20 computed fields"))),fieldRoles:e(R(S(),S())),renamedFrom:e(S().check(_(fe))),people:e(C()),archives:e(T(!1)),tidying:e(V(["never","no-links"]))}),O=E([S(),G(),C(),Oe(),D(B()),$({expr:i})]),y=S().check(_(/^\$[A-Za-z][A-Za-z0-9]*$/,'a reference is "$" and a name, like "$subject" or "$new"')),j=E([$({create:l("kind"),as:e(S().check(_(ue))),set:e(R(m,O))}),$({set:R(m,O),target:e(y)}),$({connect:u,from:y,to:y}),$({sever:u,from:y,to:y}),$({remove:y})]),v=$({title:e(t(1,80)),description:e(h),fromTheOtherEnd:e(t(1,80)),on:e(E([l("kind"),a(l("kind"),1)])),creates:e(l("kind")),sets:e(R(m,O)),writes:e(a(m,1)),connects:e(u),severs:e(u),setsOther:e(R(m,O)),replaces:e(E([T(!0),a(u,1,10)])),removes:e(T(!0)),args:e(R(m,p)),effects:e(a(j,1,20)),allowedWhen:e(i),refusal:e(o),destructive:e(C())}),b=$({act:l("act"),label:e(t(1,80)),args:e(R(S(),O))}),W=$({title:e(t(1,120)),description:e(h),over:E([T("graph"),l("kind")]),when:e(i),require:i,says:e(o),repairs:e(a(b,void 0,10))}),P=$({roles:E([a(l("role"),1),T("*")]),mutations:E([a(l("act"),1),T("*")]),kinds:e(E([D(l("kind")),T("*")])),describe:e(h),self:e(C()),ownEnd:e(C())}),g=e(a(l("field"),1)),x=$({roles:E([a(l("role"),1),T("*")]),kinds:a(l("kind"),1),own:e(C()),via:e(u),fields:g,hide:g}),F=$({grants:D(P),sees:e(D(x))}),te=$({accent:e(S().check(_(/^#[0-9a-fA-F]{6}$/,'an accent is a color like "#c2577a"'))),name:e(t(1,60)),currency:e(S().check(_(/^[A-Z]{3}$/,'a currency is its three-letter code, like "USD" or "EUR"'))),locale:e(t(2,35)),timeZone:e(t(1,64)),logo:e(E([t(1,ne),$({src:t(1,ne),alt:e(t(1,120))}),$({light:t(1,ne),dark:e(t(1,ne)),alt:e(t(1,120)),darkFallback:e(T("invert"))})])),favicon:e(E([t(1,ne),$({emoji:S()})])),typography:e($({display:e(t(1,200)),body:e(t(1,200)),mono:e(t(1,200))})),shape:e($({radius:e(G().check(q(0),L(32))),density:e(G().check(q(.75),L(1.5)))})),accents:e(R(S(),G().check(q(0),L(360)))),scheme:e(V(["light","dark","auto"]))}),I=R(S(),B()),Z=E([t(1,120),$({by:t(1,120),direction:e(V(["asc","desc"]))})]),ke=G().check(J(),q(1),L(9999)),Je=X({create:e(C()),options:e(X({sort:e(Z),columnSort:e(Z),search:e(a(t(1,120),void 0,40)),filters:e(a(t(1,120),void 0,40)),horizon:e(E([G().check(J(),q(1),L(200)),X({years:G().check(J(),q(1),L(200)),title:t(1,80),from:e(ke),to:e(ke)})]))}))}),Xe=$({card:e(D(B())),row:e(D(B())),page:e(D(B()))}),Qe=()=>{let k=e(V(["asc","desc"]));return E([t(1,120),$({by:t(1,120),direction:k,then:e(E([t(1,120),$({by:t(1,120),direction:k})]))})])},en=()=>E([t(1,120),$({by:t(1,120),order:e(a(t(1,80),void 0,40)),closed:e(a(t(1,80),void 0,40))})]),$e=X({order:e(D(S())),hide:e(D(S())),first:e(S()),primary:e(a(t(1,80),void 0,40)),scene:e(t(1,40)),pages:e(t(1,40)),lists:e(R(S(),$({filters:e(a(t(1,120),void 0,40)),sort:e(Qe()),group:e(en())})))}),nn=$({$schema:e(S()),format:T(me),formatVersion:T(ge),name:t(1,80),description:e(h),version:e(G().check(J(),q(1))),kinds:R(l("kind"),c).check(U(k=>Object.keys(k).length>0,"a document declares at least one kind"),U(k=>Object.keys(k).length<=40,"a document declares at most 40 kinds")),computed:e(R(S(),d)),acts:e(R(l("act"),v)),rules:e(R(l("rule"),W)),roles:e(D(l("role"))),policy:e(F),modules:e(I),lenses:e(D(Je)),pages:e($e),views:e(R(S(),E([Xe,D(B())]))),brand:e(te),settings:e(D(I)),migrations:e(D(I)),connections:e(R(l("connection"),I))});return{FieldSpec:p,EdgeSpec:f,ComputedSpec:d,KindSpec:c,ValueSpec:O,EffectSpec:j,ActSpec:v,RepairSpec:b,RuleSpec:W,GrantSpec:P,SightSpec:x,PolicySpec:F,BrandSpec:te,PagesSpec:$e,DocumentSpec:nn}}var dn,M=()=>dn??=cn(),Sn=K(()=>M().FieldSpec),jn=K(()=>M().EdgeSpec),On=K(()=>M().ComputedSpec),vn=K(()=>M().KindSpec),xn=K(()=>M().ValueSpec),En=K(()=>M().EffectSpec),Rn=K(()=>M().ActSpec),An=K(()=>M().RepairSpec),Fn=K(()=>M().RuleSpec),Dn=K(()=>M().GrantSpec),Kn=K(()=>M().SightSpec),Mn=K(()=>M().PolicySpec),Tn=K(()=>M().BrandSpec),Pn=K(()=>M().PagesSpec),Ie=K(()=>M().DocumentSpec);var ln={};function Ve(n,s=ln,r=ge){let{document:t,respelled:a}=we(n),l=a.length>0?{respelled:a}:{};if(!t||typeof t!="object"||Array.isArray(t))return{document:t};let u=t;if(u.format!==me||typeof u.formatVersion!="number"||u.formatVersion>=r)return{document:t,...l};let m=u.formatVersion,h=structuredClone(u);for(let i=m;i<r;i++){let o=s[i];if(!o)throw new Error(`there is no upgrade from format ${i} to ${i+1}`);h={...o(h),formatVersion:i+1}}return{document:h,from:m,...l}}function qe(n,s,r){let t=Object.keys(n).filter(m=>n[m].edges?.[s]!==void 0);if(t.length===0)return;let a=t.map(m=>n[m].edges[s].to),l=a.some(m=>m==="*")?"*":[...new Set(a.flatMap(m=>m))];if(r.length===0||r.some(m=>t.includes(m)))return{reversed:!1,kinds:l};let u=t.filter(m=>{let h=n[m].edges[s].to;return h==="*"||r.every(i=>h.includes(i))});return u.length>0?{reversed:!0,kinds:u}:{reversed:!1,kinds:l}}var Ue=(n,s)=>{let r=n?.fields[s];return r!==void 0&&(r.type==="duration"||(r.type==="number"||r.type==="integer")&&r.format==="duration")};function Be(n,s,r,t){if(t==="out"){let a=n[s]?.edges?.[r]?.to;return a===void 0?[]:a==="*"?Object.keys(n):a}return Object.entries(n).filter(([,a])=>{let l=a.edges?.[r]?.to;return l!==void 0&&(l==="*"||l.includes(s))}).map(([a])=>a)}function ye(n,s,r){if(r.t==="ident")return n[s]?.edges?.[r.name]?Be(n,s,r.name,"out"):void 0;if(r.t==="where")return ye(n,s,r.set);if(r.t==="call"&&(r.fn==="out"||r.fn==="in")&&r.args[0]?.t==="lit"&&typeof r.args[0].value=="string")return Be(n,s,r.args[0].value,r.fn)}var Le=(n,s,r)=>{let t=s.filter(a=>n[a]?.fields[r]!==void 0);return t.length>0&&t.every(a=>Ue(n[a],r))};function We(n,s,r){let t=n.kinds,a=t[s],l=new Map(r),u=new Map,m=(i,o)=>{if(o>8)return!1;switch(i.t){case"ident":return Ue(a,i.name)||h(i.name,o+1);case"member":{let p=ye(t,s,i.object);return p!==void 0&&Le(t,p,i.name)}case"call":{if(i.fn!=="sum"&&i.fn!=="min"&&i.fn!=="max")return!1;let[p,w]=i.args,f=p&&ye(t,s,p);return f!==void 0&&w?.t==="ident"&&Le(t,f,w.name)}case"binary":return(i.op==="+"||i.op==="-")&&m(i.left,o)&&m(i.right,o);case"unary":return i.op==="-"&&m(i.operand,o);default:return!1}},h=(i,o)=>{if(a?.computed?.[i]===void 0)return!1;if(u.has(i))return u.get(i);u.set(i,!1);let p=l.get(i),w=p!==void 0&&m(p,o);return u.set(i,w),w};return r.map(([i])=>i).filter(i=>h(i,0))}function Ze(n,s,r=`kinds.${n}.page`){let t=s.page;if(!t)return[];let a=[],l=[...Object.keys(s.fields),...Object.keys(s.computed??{})],u=new Set,m=(i,o)=>{l.includes(i)?u.has(i)&&a.push(z("page-field-twice",o,`"${i}" is on ${n}'s page twice; name each field once`)):a.push(z("page-field",o,`${n}'s page is to show "${i}", and ${n} has no field or computed field called that`,`use one of: ${l.join(", ")}`)),u.add(i)};(t.fields??[]).forEach((i,o)=>m(i,`${r}.fields.${o}`));let h=new Set;return(t.groups??[]).forEach((i,o)=>{let p=i.title.trim().toLowerCase();h.has(p)&&a.push(z("page-group-twice",`${r}.groups.${o}.title`,`${n}'s page has two groups called "${i.title}"; give each its own title`)),h.add(p),i.fields.forEach((w,f)=>m(w,`${r}.groups.${o}.fields.${f}`))}),a}var pn=new Set(["subject","now","today","me"]);function fn(n){if((typeof n=="string"?n:JSON.stringify(n??null)).length>ze)return{findings:[z("too-large","",`a document may be at most ${ze/1024} KB`)]};if(typeof n=="string")try{n=JSON.parse(n)}catch(t){return{findings:[z("not-json","",`this is not JSON: ${t.message}`)]}}try{n=Ve(n).document}catch(t){return{findings:[z("format","formatVersion",t.message)]}}let s=Ie.safeParse(n);if(!s.success)return{findings:s.error.issues.map(t=>{let a=t.path.map(String).join(".");if(t.code==="unrecognized_keys")return z("unknown-key",a,`${t.keys.map(l=>`"${l}"`).join(", ")} ${t.keys.length===1?"is":"are"} not part of a Graview document here`,"check the spelling against docs/declaration-document.md");if(t.code==="invalid_union"&&/\.effects\.\d+$/.test(a))return z("effect-shape",a,"this effect is not one Graview knows",'an effect is one of {"create": kind, "as"?: name, "set"?: {field: value}}, {"set": {field: value, \u2026}, "target"?: "$ref"}, {"connect"|"sever": relation, "from": "$ref", "to": "$ref"}, {"remove": "$ref"}');if(t.code==="invalid_key"){let l=t.issues?.[0]?.message;return z("shape",a,`the name "${String(t.path.at(-1))}" is not allowed here${l?`: ${l}`:""}`)}return z("shape",a,t.message)})};let r=s.data;return{document:r,findings:un(r)}}var re=n=>[n??[]].flat();function He(n){let s=new Map;for(let[r,t]of Object.entries(n.kinds))for(let[a,l]of Object.entries(Q(t.edges))){let u=s.get(a);s.set(a,{name:a,from:[...u?.from??[],r],to:l.to==="*"||u?.to==="*"?"*":[...new Set([...u?.to??[],...l.to])],cardinality:l.cardinality??"many"})}return s}function lt(n){let s=new Map;for(let[t,a]of Object.entries(n.kinds)){let l=ee(a),u=ae(a.edges);s.set(t,{fields:new Set([...Object.keys(a.fields),...u.keys()]),edges:new Map(Object.entries(Q(a.edges)).map(([m,h])=>[m,h.cardinality??"many"])),...l?{computed:l}:{},...u.size>0?{linked:u}:{}})}let r=ee(n);return r&&s.set(Ae,{computed:r}),s}function Ye(n,s){let r=[],t=re(n.on),a=(l,u)=>{let m=qe(s.kinds,l,t)?.reversed===!0,[h,i]=m?["$to","$subject"]:["$subject","$to"];return u==="connect"?{connect:l,from:h,to:i}:{sever:l,from:h,to:i}};if(n.creates){let l=s.kinds[n.creates],u={};for(let m of Object.keys(l?.fields??{}))u[m]=`$${m}`;for(let m of n.effects??[])"set"in m&&!("create"in m)&&A(m.target)==="new"&&Object.assign(u,m.set);r.push({create:n.creates,as:"new",set:u})}return n.sets&&r.push({set:n.sets}),n.writes&&!(n.creates&&n.on===void 0)&&r.push({set:Object.fromEntries(n.writes.map(l=>[l,`$${l}`]))}),n.connects&&(n.replaces&&r.push({replace:n.replaces===!0?[n.connects]:[...n.replaces],keep:n.connects}),r.push(a(n.connects,"connect"))),n.severs&&r.push(a(n.severs,"sever")),n.setsOther&&(n.connects||n.severs)&&r.push({set:n.setsOther,target:"$to"}),n.removes&&r.push({remove:"$subject"}),n.effects&&r.push(...n.effects.filter(l=>!(n.creates&&"set"in l&&!("create"in l)&&A(l.target)==="new"))),r}function he(n,s,r){try{let t=H(n),a=oe(t);for(let l of a.unknownFunctions)r.push(z("unknown-function",s,`"${l}" is not a function the rule language knows`,"see docs/declaration-document.md#expression-language"));return t}catch(t){if(t instanceof se){r.push(z("expression",s,t.sentence+` (at character ${t.at+1})`));return}throw t}}function be(n,s,r){try{return Y(n)}catch(t){if(t instanceof Pe||t instanceof se){r.push(z("template",s,(t instanceof se,t.sentence)));return}throw t}}function un(n){let s=[],r=new Set(Object.keys(n.kinds)),t=He(n),a=n.acts??{},l=new Set(n.roles??[]),u=(i,o)=>ae(n.kinds[i]?.edges).has(o),m=i=>Object.keys(n.kinds).some(o=>u(o,i));for(let[i,o]of Object.entries(n.kinds)){let p=`kinds.${i}`;for(let[f,d]of Object.entries(o.edges??{})){if(!Ee(d)&&d.to!=="*")for(let c of d.to)r.has(c)||s.push(z("edge-target",`${p}.edges.${f}.to`,`"${c}" is not a kind this document declares`));o.fields[f]&&s.push(z("edge-field-clash",`${p}.edges.${f}`,`"${f}" is both a field and a relation of ${i}`,"rename one of them"))}o.lifecycle&&!o.fields[o.lifecycle.field]&&s.push(z("lifecycle-field",`${p}.lifecycle.field`,`${i} has no field "${o.lifecycle.field}"`));let w=f=>o.computed!==void 0&&Object.hasOwn(o.computed,f);for(let f of o.glance??[])!o.fields[f]&&!w(f)&&s.push(z("glance-field",`${p}.glance`,`a glance at ${i} is to say "${f}", and ${i} has no field or computed field called that`,`use one of: ${[...Object.keys(o.fields),...Object.keys(o.computed??{})].join(", ")}`));s.push(...Ze(i,o));for(let f of["label","describe"]){let d=o[f];if(!d)continue;let c=be(d,`${p}.${f}`,s);for(let O of c??[])if(O.expr){for(let y of oe(O.expr).names)if(!o.fields[y]){if(w(y)){_e(o,y)||s.push(z("template-field",`${p}.${f}`,`${i}'s ${y} is worked out from beyond the record, and a ${f} is said with no graph to read`,`show it in a view instead, or name a computed field worked out from ${i}'s own fields`));continue}s.push(z("template-field",`${p}.${f}`,`${i} has no field "${y}" for its ${f} to show`,f==="label"?"a label can only show the record's own fields and what they work out":void 0))}}}for(let[f,d]of Object.entries(o.fields)){d.default!==void 0&&d.type==="enum"&&!d.options?.includes(String(d.default))&&s.push(z("default-option",`${p}.fields.${f}.default`,`"${String(d.default)}" is not one of ${f}'s options`));let c=`${f}Repeat`;d.repeats&&(o.fields[c]||o.edges?.[c]||o.computed?.[c])&&s.push(z("repeat-clash",`${p}.fields.${f}.repeats`,`${i} already has "${c}", where how ${f} repeats is kept`))}}for(let[i,o]of Object.entries(a)){let p=`acts.${i}`;for(let c of re(o.on))r.has(c)||s.push(z("act-kind",`${p}.on`,`"${c}" is not a kind this document declares`));let w=re(o.on),f=Ye(o,n);if(o.creates&&o.on===void 0&&o.writes&&r.has(o.creates)){for(let c of o.writes)if(!n.kinds[o.creates].fields[c])if(n.kinds[o.creates].computed?.[c]!==void 0)s.push(z("computed-written",`${p}.writes`,`${o.creates}'s ${c} is worked out, not written: no act can set it`,"write the stored fields it is worked out from"));else{if(u(o.creates,c))continue;s.push(z("act-field",`${p}.writes`,`${o.creates} has no field "${c}"`))}}f.length===0&&s.push(z("act-empty",p,`"${i}" does nothing`,"give it effects or a shorthand such as sets or creates"));let d=new Map;f.forEach((c,O)=>{let y=f.length-(o.effects?.length??0),j=o.effects&&O>=y?`${p}.effects.${O-y}`:p;if("create"in c){if(!r.has(c.create))s.push(z("act-kind",`${j}.create`,`"${c.create}" is not a kind this document declares`));else for(let b of Object.keys(c.set??{}))n.kinds[c.create].fields[b]||(n.kinds[c.create].computed?.[b]!==void 0?s.push(z("computed-written",`${j}.set.${b}`,`${c.create}'s ${b} is worked out, not written: no act can set it`,"set the stored fields it is worked out from")):s.push(z("act-field",`${j}.set.${b}`,`${c.create} has no field "${b}"`)));c.as&&d.set(c.as,c.create)}else if("connect"in c||"sever"in c){let b="connect"in c?c.connect:c.sever;!t.has(b)&&!m(b)&&s.push(z("act-edge",`${j}.${"connect"in c?"connect":"sever"}`,`"${b}" is not a relation any kind declares`)),A(c.from)==="subject"&&w.length===0&&s.push(z("act-subject",`${p}.on`,`"${i}" acts on "$subject" but does not say which kinds it is "on"`))}else if("set"in c){let b=A(c.target??"$subject"),W=b==="subject"?w:d.has(b??"")?[d.get(b)]:[];b==="subject"&&w.length===0&&s.push(z("act-subject",`${p}.on`,`"${i}" changes "$subject" but does not say which kinds it is "on"`));for(let P of Object.keys(c.set))for(let g of W)if(!(!r.has(g)||n.kinds[g].fields[P]))if(n.kinds[g].computed?.[P]!==void 0)s.push(z("computed-written",`${j}.set.${P}`,`${g}'s ${P} is worked out, not written: no act can set it`,"set the stored fields it is worked out from"));else{if(u(g,P))continue;s.push(z("act-field",`${j}.set.${P}`,`${g} has no field "${P}"`))}}else"remove"in c&&A(c.remove)==="subject"&&w.length===0&&s.push(z("act-subject",`${p}.on`,`"${i}" removes "$subject" but does not say which kinds it is "on"`));("set"in c&&c.set?Object.values(c.set):[]).forEach(b=>{b&&typeof b=="object"&&!Array.isArray(b)&&"expr"in b&&he(b.expr,`${j}.set`,s)})}),o.allowedWhen&&he(o.allowedWhen,`${p}.allowedWhen`,s),o.refusal&&be(o.refusal,`${p}.refusal`,s)}for(let[i,o]of Object.entries(n.rules??{})){let p=`rules.${i}`;o.over!=="graph"&&!r.has(o.over)&&s.push(z("rule-kind",`${p}.over`,`"${o.over}" is not a kind this document declares`));let w=o.over==="graph"?void 0:n.kinds[o.over];for(let f of["when","require"]){let d=o[f];if(!d)continue;let c=he(d,`${p}.${f}`,s);if(!c)continue;let O=oe(c);for(let y of O.names)if(o.over==="graph")s.push(z("rule-name",`${p}.${f}`,`"${y}" means nothing in a rule over the whole graph`,`name a kind in "over", or use all('kind')`));else if(w&&!w.fields[y]&&!w.edges?.[y]&&w.computed?.[y]===void 0){let j=Object.keys(w.edges??{}).find(v=>v.includes("-")&&v.split("-").includes(y));s.push(z("rule-name",`${p}.${f}`,`${o.over} has no field or relation called "${y}"`,j?`"${j}" reads as a subtraction in a rule; rename the relation to one camelCase word, like "${j.replace(/-([a-z0-9])/g,(v,b)=>b.toUpperCase())}"`:void 0))}for(let y of O.edges)!t.has(y)&&!m(y)&&s.push(z("rule-edge",`${p}.${f}`,`"${y}" is not a relation any kind declares`));for(let y of O.sweeps)r.has(y)?o.over!=="graph"&&s.push(Fe("rule-cost",`${p}.${f}`,`this rule looks at every ${y} for every ${o.over}, which grows slowly as the app grows`,"walk a relation with out()/in() instead of all() where you can")):s.push(z("rule-kind",`${p}.${f}`,`"${y}" is not a kind this document declares`))}o.says&&be(o.says,`${p}.says`,s),(o.repairs??[]).forEach((f,d)=>{!a[f.act]&&!ce(f.act)&&!pe(f.act,n.kinds)&&s.push(z("repair-act",`${p}.repairs.${d}.act`,`"${f.act}" is not an act this document declares`))})}let h=n.policy;return h&&(h.grants.forEach((i,o)=>{if(i.roles!=="*"&&l.size>0)for(let p of i.roles)l.has(p)||s.push(z("grant-role",`policy.grants.${o}.roles`,`"${p}" is not one of the document's roles`));if(i.mutations!=="*")for(let p of i.mutations)!a[p]&&!ce(p)&&!pe(p,n.kinds)&&s.push(z("grant-act",`policy.grants.${o}.mutations`,`"${p}" is not an act this document declares`))}),(h.sees??[]).forEach((i,o)=>{for(let p of i.kinds)r.has(p)||s.push(z("sight-kind",`policy.sees.${o}.kinds`,`"${p}" is not a kind this document declares`));if(i.roles!=="*"&&l.size>0)for(let p of i.roles)l.has(p)||s.push(z("sight-role",`policy.sees.${o}.roles`,`"${p}" is not one of the document's roles`))})),s.push(...Ne(n)),s}function mn(n,s,r,t){let a=new Map,l=re(n.on),u=new Map,m=new Map;(l.length>0||s.some(d=>"remove"in d&&A(d.remove)==="subject"||"from"in d&&(A(d.from)==="subject"||A(d.to)==="subject")||"set"in d&&!("create"in d)&&A(d.target??"$subject")==="subject"))&&a.set(le,{ref:l.length>0?l:"*",required:!0});let i=n.args??{},o=n.writes?.length===1,p=(d,c)=>c&&d.type===c.type&&d.min===void 0&&d.max===void 0&&d.step===void 0?{...d,...c.min===void 0?{}:{min:c.min},...c.max===void 0?{}:{max:c.max},...c.step===void 0?{}:{step:c.step}}:d,w=(d,c)=>c&&d.type===c.type&&d.format===void 0&&d.unit===void 0?{...p(d,c),...c.format?{format:c.format}:{},...c.unit?{unit:c.unit}:{}}:p(d,c),f=(d,c,O)=>{if(d===le||pn.has(d)||u.has(d)||a.has(d))return;let y=i[d]?w(i[d],O):void 0;a.set(d,y?{field:y,optional:!y.required,required:!!y.required}:c())};for(let d of s)if("create"in d){let c=r.kinds[d.create];for(let[O,y]of Object.entries(d.set??{})){let j=A(y),v=c?.fields[O];if(j&&v){let b=!!v.required&&v.default===void 0;f(j,()=>({field:v,optional:!b,required:b}),v)}}d.as&&u.set(d.as,d.create)}else if("connect"in d||"sever"in d){let c=t.get("connect"in d?d.connect:d.sever);for(let[O,y]of[["from",d.from],["to",d.to]]){let j=A(y);if(!j)continue;let v=O==="to"?c?.to??"*":c?.from??"*";v!=="*"&&!m.has(j)&&m.set(j,v),f(j,()=>({ref:v,required:!0}))}}else if("set"in d){let c=A(d.target??"$subject"),O=c==="subject"?l[0]:u.get(c??"")??m.get(c??"")?.[0];c&&c!=="subject"&&!u.has(c)&&f(c,()=>({ref:"*",required:!0}));for(let[y,j]of Object.entries(d.set)){let v=A(j);if(!v)continue;let b=O?r.kinds[O]?.fields[y]:void 0;f(v,()=>b?{field:b,optional:!o,required:o}:{any:!0,required:!1},b)}}else if("remove"in d){let c=A(d.remove);c&&f(c,()=>({ref:"*",required:!0}))}for(let[d,c]of Object.entries(i))a.has(d)||a.set(d,{field:c,optional:!c.required,required:!!c.required});return a}function pt(n,s={}){let r=fn(n);if(!r.document||de(r.findings))return{ok:!1,findings:r.findings};let t=r.document,a=[...r.findings];s.previous&&a.push(...zn(t,s.previous));let l=gn(t,a);return de(l.findings)?{ok:!1,findings:l.findings}:Te(l,s)}function ie(n,s){return n.map(r=>{let t=!r.format&&r.expr?.t==="ident"?s?.[r.expr.name]?.format:void 0;return t==="money"||t==="percent"?{...r,format:t}:r})}function gn(n,s){let r=He(n),t={};for(let[i,o]of Object.entries(n.kinds)){let p=Me(o),w=o.label??(p?`{${p}}`:void 0),f=ee(o),d=f?We(n,i,[...f]):[];t[i]={...w?{label:ie(Y(w),o.fields)}:{},...o.describe?{describe:ie(Y(o.describe),o.fields)}:{},...f?{computed:[...f]}:{},...d.length>0?{durations:d}:{}}}let a={};for(let[i,o]of Object.entries(n.acts??{})){let p=Ye(o,n),w=mn(o,p,n,r),f=o.destructive??p.some(g=>"remove"in g||"sever"in g||"replace"in g),d=[...new Set(p.flatMap(g=>"create"in g?[g.create]:[]))],c=[...new Set(p.flatMap(g=>"connect"in g?[g.connect]:[]))],O=[...new Set(p.flatMap(g=>"sever"in g?[g.sever]:"replace"in g?g.replace:[]))],y=[...new Set(p.flatMap(g=>"set"in g&&!("create"in g)&&A(g.target??"$subject")==="subject"?Object.keys(g.set):[]))],j=new Map;for(let g of p){if(!("connect"in g)&&!("sever"in g))continue;let x=r.get("connect"in g?g.connect:g.sever);for(let[F,te]of[["from",g.from],["to",g.to]]){let I=A(te),Z=F==="to"?x?.to:x?.from;I&&I!=="subject"&&Z&&Z!=="*"&&j.set(I,[...new Set([...j.get(I)??[],...Z])])}}let v={};for(let g of p){if(!("set"in g)||"create"in g)continue;let x=A(g.target??"$subject");for(let F of x&&x!=="subject"&&j.get(x)||[])v[F]=[...new Set([...v[F]??[],...Object.keys(g.set)])]}let b={};for(let g of p)if(!(!("set"in g)||"create"in g||A(g.target??"$subject")!=="subject"))for(let[x,F]of Object.entries(g.set??{}))typeof F=="string"&&A(F)===void 0||typeof F=="number"||typeof F=="boolean"?b[x]=typeof F=="string"&&F.startsWith("$$")?F.slice(1):F:delete b[x];let W=d.length===0&&p.every(g=>!("set"in g)||!g.set||Object.values(g.set).every(x=>!(x&&typeof x=="object"&&!Array.isArray(x)&&"expr"in x))),P=new Map;for(let g of p)if(!(!("set"in g)||!g.set))for(let x of Object.values(g.set))x&&typeof x=="object"&&!Array.isArray(x)&&"expr"in x&&P.set(x.expr,H(x.expr));a[i]={title:o.title??i.replace(/-/g," "),effects:p,args:[...w],...o.allowedWhen?{guard:H(o.allowedWhen)}:{},...o.refusal?{refusal:ie(Y(o.refusal),n.kinds[[o.on??[]].flat()[0]??""]?.fields)}:{},exprs:[...P],destructive:f,idempotent:W,creates:d,connects:c,severs:O,writes:y,writesOther:v,sets:b}}let l={};for(let[i,o]of Object.entries(n.rules??{}))l[i]={title:o.title??i.replace(/-/g," "),require:H(o.require),...o.when?{when:H(o.when)}:{},...o.says?{says:ie(Y(o.says),n.kinds[o.over]?.fields)}:{}};let u=De(n,s),m=Ge(n),h=Ce(n);return{format:Ke,document:n,findings:s,kinds:t,...n.computed?{facts:[...ee(n)??[]]}:{},edges:[...r].map(([i,{from:o,to:p,cardinality:w}])=>[i,{from:o,to:p,cardinality:w}]),acts:a,rules:l,brand:u,...Object.keys(m).length>0?{viewSpecs:m}:{},...h?{home:h}:{}}}function ft(n,s,r){let t=/^defineNode\("([^"]+)"\)/.exec(s)?.[1],a=t?r.kinds[t]:void 0;if(!t||!a)return n;let l=Object.keys(a.fields).filter(u=>u!=="label").slice(0,3);return{...n,path:`kinds.${t}.glance`,fix:`Say which: "glance": [${l.map(u=>`"${u}"`).join(", ")}] on kinds.${t} \u2014 the facts a person compares one by, at a glance.`}}function zn(n,s){let r=[],t=new Set(Object.values(s.kinds).flatMap(a=>Object.keys(a.edges??{})));for(let[a,l]of Object.entries(n.kinds)){let u=l.renamedFrom;u&&!s.kinds[u]&&r.push(z("renamed-from-nothing",`kinds.${a}.renamedFrom`,`${a} says it was ${u}, and the previous version has no kind called ${u}`,"name the kind it was, or drop renamedFrom"));let m=s.kinds[u??a];for(let[h,i]of Object.entries(l.fields)){let o=i.renamedFrom;o&&!m?.fields[o]&&r.push(z("renamed-from-nothing",`kinds.${a}.fields.${h}.renamedFrom`,`${h} says it was ${o}, and the previous ${u??a} has no field called ${o}`,"name the field it was, or drop renamedFrom"))}for(let[h,i]of Object.entries(l.edges??{})){let o=i.renamedFrom;o&&!t.has(o)&&r.push(z("renamed-from-nothing",`kinds.${a}.edges.${h}.renamedFrom`,`${h} says it was ${o}, and the previous version has no relation called ${o}`,"name the relation it was, or drop renamedFrom"))}}return r}export{fn as a,lt as b,Ye as c,pt as d,ft as e};
@@ -1,25 +0,0 @@
1
- var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as Ke}from"./chunk.SDO3U72B.js";import{$b as Dn,Fa as _n,Hc as jn,J as Cn,Ja as mt,Kc as Gn,La as Ln,Nc as Wn,Wa as Hn,ad as Fn,qd as Kn,vd as Fe,wc as Nn,wd as gt}from"./chunk.AW2T3KFV.js";import{a as We,b as _}from"./chunk.AJZBJBMO.js";var lo=We(w=>{"use strict";var At=Symbol.for("react.transitional.element"),Tr=Symbol.for("react.portal"),Mr=Symbol.for("react.fragment"),Or=Symbol.for("react.strict_mode"),Vr=Symbol.for("react.profiler"),Ir=Symbol.for("react.consumer"),Cr=Symbol.for("react.context"),_r=Symbol.for("react.forward_ref"),Lr=Symbol.for("react.suspense"),Hr=Symbol.for("react.memo"),no=Symbol.for("react.lazy"),Dr=Symbol.for("react.activity"),Jn=Symbol.iterator;function Nr(e){return e===null||typeof e!="object"?null:(e=Jn&&e[Jn]||e["@@iterator"],typeof e=="function"?e:null)}var oo={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ro=Object.assign,io={};function ge(e,t,n){this.props=e,this.context=t,this.refs=io,this.updater=n||oo}ge.prototype.isReactComponent={};ge.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ge.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function ao(){}ao.prototype=ge.prototype;function kt(e,t,n){this.props=e,this.context=t,this.refs=io,this.updater=n||oo}var Pt=kt.prototype=new ao;Pt.constructor=kt;ro(Pt,ge.prototype);Pt.isPureReactComponent=!0;var Qn=Array.isArray;function Et(){}var M={H:null,A:null,T:null,S:null},so=Object.prototype.hasOwnProperty;function Rt(e,t,n){var o=n.ref;return{$$typeof:At,type:e,key:t,ref:o!==void 0?o:null,props:n}}function jr(e,t){return Rt(e.type,t,e.props)}function Tt(e){return typeof e=="object"&&e!==null&&e.$$typeof===At}function Gr(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var eo=/\/+/g;function xt(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Gr(""+e.key):t.toString(36)}function Wr(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(Et,Et):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function me(e,t,n,o,r){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(i){case"bigint":case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case At:case Tr:a=!0;break;case no:return a=e._init,me(a(e._payload),t,n,o,r)}}if(a)return r=r(e),a=o===""?"."+xt(e,0):o,Qn(r)?(n="",a!=null&&(n=a.replace(eo,"$&/")+"/"),me(r,t,n,"",function(u){return u})):r!=null&&(Tt(r)&&(r=jr(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(eo,"$&/")+"/")+a)),t.push(r)),1;a=0;var d=o===""?".":o+":";if(Qn(e))for(var s=0;s<e.length;s++)o=e[s],i=d+xt(o,s),a+=me(o,t,n,i,r);else if(s=Nr(e),typeof s=="function")for(e=s.call(e),s=0;!(o=e.next()).done;)o=o.value,i=d+xt(o,s++),a+=me(o,t,n,i,r);else if(i==="object"){if(typeof e.then=="function")return me(Wr(e),t,n,o,r);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return a}function Xe(e,t,n){if(e==null)return e;var o=[],r=0;return me(e,o,"","",function(i){return t.call(n,i,r++)}),o}function Fr(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var to=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Kr={map:Xe,forEach:function(e,t,n){Xe(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Xe(e,function(){t++}),t},toArray:function(e){return Xe(e,function(t){return t})||[]},only:function(e){if(!Tt(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};w.Activity=Dr;w.Children=Kr;w.Component=ge;w.Fragment=Mr;w.Profiler=Vr;w.PureComponent=kt;w.StrictMode=Or;w.Suspense=Lr;w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M;w.__COMPILER_RUNTIME={__proto__:null,c:function(e){return M.H.useMemoCache(e)}};w.cache=function(e){return function(){return e.apply(null,arguments)}};w.cacheSignal=function(){return null};w.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var o=ro({},e.props),r=e.key;if(t!=null)for(i in t.key!==void 0&&(r=""+t.key),t)!so.call(t,i)||i==="key"||i==="__self"||i==="__source"||i==="ref"&&t.ref===void 0||(o[i]=t[i]);var i=arguments.length-2;if(i===1)o.children=n;else if(1<i){for(var a=Array(i),d=0;d<i;d++)a[d]=arguments[d+2];o.children=a}return Rt(e.type,r,o)};w.createContext=function(e){return e={$$typeof:Cr,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:Ir,_context:e},e};w.createElement=function(e,t,n){var o,r={},i=null;if(t!=null)for(o in t.key!==void 0&&(i=""+t.key),t)so.call(t,o)&&o!=="key"&&o!=="__self"&&o!=="__source"&&(r[o]=t[o]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var d=Array(a),s=0;s<a;s++)d[s]=arguments[s+2];r.children=d}if(e&&e.defaultProps)for(o in a=e.defaultProps,a)r[o]===void 0&&(r[o]=a[o]);return Rt(e,i,r)};w.createRef=function(){return{current:null}};w.forwardRef=function(e){return{$$typeof:_r,render:e}};w.isValidElement=Tt;w.lazy=function(e){return{$$typeof:no,_payload:{_status:-1,_result:e},_init:Fr}};w.memo=function(e,t){return{$$typeof:Hr,type:e,compare:t===void 0?null:t}};w.startTransition=function(e){var t=M.T,n={};M.T=n;try{var o=e(),r=M.S;r!==null&&r(n,o),typeof o=="object"&&o!==null&&typeof o.then=="function"&&o.then(Et,to)}catch(i){to(i)}finally{t!==null&&n.types!==null&&(t.types=n.types),M.T=t}};w.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()};w.use=function(e){return M.H.use(e)};w.useActionState=function(e,t,n){return M.H.useActionState(e,t,n)};w.useCallback=function(e,t){return M.H.useCallback(e,t)};w.useContext=function(e){return M.H.useContext(e)};w.useDebugValue=function(){};w.useDeferredValue=function(e,t){return M.H.useDeferredValue(e,t)};w.useEffect=function(e,t){return M.H.useEffect(e,t)};w.useEffectEvent=function(e){return M.H.useEffectEvent(e)};w.useId=function(){return M.H.useId()};w.useImperativeHandle=function(e,t,n){return M.H.useImperativeHandle(e,t,n)};w.useInsertionEffect=function(e,t){return M.H.useInsertionEffect(e,t)};w.useLayoutEffect=function(e,t){return M.H.useLayoutEffect(e,t)};w.useMemo=function(e,t){return M.H.useMemo(e,t)};w.useOptimistic=function(e,t){return M.H.useOptimistic(e,t)};w.useReducer=function(e,t,n){return M.H.useReducer(e,t,n)};w.useRef=function(e){return M.H.useRef(e)};w.useState=function(e){return M.H.useState(e)};w.useSyncExternalStore=function(e,t,n){return M.H.useSyncExternalStore(e,t,n)};w.useTransition=function(){return M.H.useTransition()};w.version="19.2.8"});var N=We((xa,uo)=>{"use strict";uo.exports=lo()});var wo=We(et=>{"use strict";var ei=Symbol.for("react.transitional.element"),ti=Symbol.for("react.fragment");function So(e,t,n){var o=null;if(n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),"key"in t){n={};for(var r in t)r!=="key"&&(n[r]=t[r])}else n=t;return t=n.ref,{$$typeof:ei,type:e,key:o,ref:t!==void 0?t:null,props:n}}et.Fragment=ti;et.jsx=So;et.jsxs=So});var Ce=We((Oa,vo)=>{"use strict";vo.exports=wo()});var fe={focusId:null,relation:null,expanded:[],pins:{}},qe=e=>{let t=Number(e);return Number.isFinite(t)?t:null};function te(e){let t=new URLSearchParams;e.focusId&&t.set("focus",e.focusId),e.relation&&t.set("relation",e.relation),e.overview&&t.set("overview","1"),e.zoom&&t.set("zoom","1"),e.past&&t.set("past","1"),e.shown&&e.shown.length>0&&t.set("show",[...e.shown].sort().join(",")),e.selection!==void 0&&e.selection.length>0&&t.set("sel",[...e.selection].sort().join(",")),e.expanded.length>0&&t.set("expand",[...e.expanded].sort().join(","));for(let o of Object.keys(e.pins).sort()){let r=e.pins[o];t.set(`pin.${o}`,`${Be(r.x)},${Be(r.y)}`)}e.pan&&(e.pan.x!==0||e.pan.y!==0)&&t.set("pan",`${Be(e.pan.x)},${Be(e.pan.y)}`);for(let o of Object.keys(e.within??{}).sort()){let r=e.within[o];r.length>0&&t.set(`in.${o}`,r)}e.q&&e.q.trim().length>0&&t.set("q",e.q);let n=t.toString();return n?`#${n}`:"#"}function xr(e){return e&&e.startsWith("agg:")?`aggregate:${e.slice(4)}`:e}function $e(e){let t=e.includes("#")?e.slice(e.indexOf("#")+1):e,n=new URLSearchParams(t),o=Object.create(null);for(let[m,p]of n){if(!m.startsWith("pin."))continue;let[g,v]=p.split(","),k=g===void 0?null:qe(g),y=v===void 0?null:qe(v);k===null||y===null||(o[m.slice(4)]={x:k,y})}let r=Object.create(null);for(let[m,p]of n)!m.startsWith("in.")||p.length===0||(r[m.slice(3)]=p);let i=n.get("view");i&&i.length>0&&r.view===void 0&&(r.view=i);let a=n.get("pan")?.split(",")??[],d=a[0]===void 0?null:qe(a[0]),s=a[1]===void 0?null:qe(a[1]),u=(n.get("sel")??"").split(",").filter(m=>m.length>0).sort(),f=n.get("overview")==="1";return{...u.length>0?{selection:u}:{},...f?{overview:!0}:{},...n.get("zoom")==="1"?{zoom:!0}:{},...n.get("past")==="1"?{past:!0}:{},...n.get("show")?{shown:[...new Set(n.get("show").split(",").filter(Boolean))].sort()}:{},...d!==null&&s!==null?{pan:{x:d,y:s}}:{},...Object.keys(r).length>0?{within:r}:{},...n.get("q")?.trim()?{q:n.get("q")}:{},focusId:xr(n.get("focus")),relation:n.get("relation"),expanded:(n.get("expand")??"").split(",").filter(m=>m.length>0&&(f||!m.startsWith("kind:"))).sort(),pins:o}}function ia(e){let t=$e(e);return te(t)==="#"?{...t,overview:!0}:t}function aa(e){let t=te(e);return t==="#overview=1"?"":t}function Be(e){return Math.round(e*100)/100}function Bn(e,t){return te(e)===te(t)}var qn="edge:";function $n(e){if(!e.startsWith(qn))return null;let t=e.slice(qn.length).split(":");if(t.length!==3)return null;let[n,o,r]=t;if(!n||!o||!r)return null;try{return{kind:decodeURIComponent(n),from:decodeURIComponent(o),to:decodeURIComponent(r)}}catch{return null}}function ht(e){let{pan:t,...n}=e;return{...n,pins:{}}}function B(e,t){if(t===e.focusId)return{...e,focusId:t};let n=ht(e);return{...n.within?.q!==void 0?ae(n,"q",null):n,focusId:t}}function zn(e,t){return{...e,relation:t}}function ae(e,t,n){let o={...e.within??{}};if(n===null?delete o[t]:o[t]=n,Object.keys(o).length===0){let{within:r,...i}=e;return i}return{...e,within:o}}function pe(e,t){if(t!==e.overview&&(e=ht(e)),!t){let n=e.expanded.filter(o=>!o.startsWith("kind:"));return{...e,overview:!1,expanded:n}}return{...e,overview:t}}function ze(e,t){if(t.length===0){let{selection:n,...o}=e;return o}return{...e,selection:[...t]}}function Ve(e,t){if(t!==(e.zoom===!0)&&(e=ht(e)),!t){let{zoom:n,...o}=e;return o}return{...e,zoom:!0}}function Ue(e,t){let n=new Set(e.expanded);return n.has(t)?n.delete(t):n.add(t),{...e,expanded:[...n].sort()}}var Ze="aggregate:",Ye="kind:";function St(e){return`${Ye}${e}`}function ye(e){return e.startsWith(Ye)?e.slice(Ye.length):null}var da="kinds:beyond";function Er(e){let t=ye(e);return t?[t]:se(e)}function ne(...e){return`${Ze}${[...e].sort().join("+")}`}function Un(e){return e.startsWith(Ze)}function se(e){return!Un(e)||e.includes("|")?[]:e.slice(Ze.length).split("+").filter(Boolean)}function Yn(e,t,n={}){let o=ye(t);if(o!==null&&e.overview&&n.ownPicture!==!0)return Ue(e,t);let r=o!==null?ne(o):t;if(e.zoom&&e.focusId===r&&!(o!==null&&n.carry))return Ve(e,!1);if(o!==null&&n.carry){let i=pe({...B(e,r),relation:null},!1);return ae(Ve(i,!0),"q",n.carry)}return Ve({...B(e,r),relation:null},!0)}function Ar(e,t,n){return ae(pe(B(e,ne(t)),!1),"view",n)}function ua(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Zn="aggregate:";function wt(e){return e.startsWith(Zn)&&e.includes("|")}var vt=e=>e?.off===!0,kr=e=>e!==void 0&&!vt(e)&&(e.fast!==void 0||e.thinking!==void 0||e.answer!==void 0||e.decide!==void 0||e.complete!==void 0||e.turn!==void 0),Xn=e=>e!==void 0&&!vt(e)&&(e.fast!==void 0||e.decide!==void 0),Pr=e=>e?.suggestOnOpen!==!1&&Xn(e),Rr=e=>e?.hoverChips===!0&&Xn(e);var bt={};var co=_(N(),1),qr={turns:[],outcomes:new Map,busy:!1,pending:null,draft:null,draftNote:null},fo=e=>`graview:seat:${e}`;function Br(e){if(!e)return{};try{let t=sessionStorage.getItem(e);if(!t)return{};let n=JSON.parse(t);return{...Array.isArray(n.turns)?{turns:n.turns}:{},...Array.isArray(n.outcomes)?{outcomes:new Map(n.outcomes)}:{},...n.draft?.drawn?{draft:n.draft}:{}}}catch{return{}}}function $r(e,t){if(e)try{sessionStorage.setItem(e,JSON.stringify({turns:t.turns.slice(-40),outcomes:[...t.outcomes],draft:t.draft}))}catch{}}function Mt(e){let t=e===null?null:fo(e),n={...qr,...Br(t)},o=new Set,r=(i,a=!0)=>{n=i,a&&$r(t,n);for(let d of[...o])d()};return{get:()=>n,subscribe(i){return o.add(i),()=>void o.delete(i)},setTurns:i=>r({...n,turns:i(n.turns)}),settle:(i,a)=>r({...n,outcomes:new Map(n.outcomes).set(i,a)}),setBusy:i=>r({...n,busy:i},!1),ask:i=>r({...n,pending:i.trim()||null}),takePending(){let i=n.pending;return i!==null&&r({...n,pending:null},!1),i},setDraft:(i,a=null)=>r({...n,draft:i,draftNote:a})}}function zr(e){return(0,co.useSyncExternalStore)(e.subscribe,e.get,e.get)}var yo=_(N(),1),Ur={entries:[],ghost:null,loaded:!1};function po(e,t){let n=new Map(e.map(o=>[o.id,o]));for(let o of t)n.set(o.id,{...n.get(o.id),...o});return[...n.values()].sort((o,r)=>o.at<r.at?1:o.at>r.at?-1:0)}function Ot(e){let t=Ur,n=new Set,o=r=>{t=r;for(let i of[...n])i()};return{get:()=>t,subscribe:r=>(n.add(r),()=>n.delete(r)),record:r=>{o({...t,entries:po(t.entries,[r])}),Promise.resolve(e()?.keep?.(r)).catch(i=>{console.warn("The host did not keep an AI interaction:",i)})},setGhost:r=>o({...t,ghost:r}),load:()=>{if(t.loaded)return;o({...t,loaded:!0});let r=e()?.load;r&&Promise.resolve(r()).then(i=>o({...t,entries:po(t.entries,i)})).catch(i=>{console.warn("The host's AI interactions could not be read:",i)})}}}function Yr(e){return(0,yo.useSyncExternalStore)(e.subscribe,e.get,e.get)}function mo(e){return e?.closest?.("[data-graview-pick]")?.getAttribute("data-graview-pick")??null}var Je=_(N(),1),Qe=(0,Je.createContext)(void 0),Zr=()=>(0,Je.useContext)(Qe);var A=_(N(),1),Ie=(0,A.createContext)(null);function ho(){return(0,A.useContext)(Ie)}function Xr(e,t){let n=ho(),o=(0,A.useMemo)(()=>n?n.live.seenBy(t):e,[n,e,t]),r=(0,A.useRef)(0),i=(0,A.useCallback)(a=>o.subscribe(()=>{r.current+=1,a()}),[o]);return(0,A.useSyncExternalStore)(i,()=>r.current,()=>0),o}var Jr=Ke(()=>(__graviewPreload(import.meta.url,["./chunk.TI4OSTQV.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.E2AJ7U5Z.js"))),go,Qr=400;function Vt(e,t,n){let o=(0,A.useContext)(Ie),r=o!==null&&o.owns(e,t),[i,a]=(0,A.useState)(null),[d,s]=(0,A.useState)(go);(0,A.useEffect)(()=>{if(d||r||i===null)return;let x=!0;return Jr().then(V=>{go=V,x&&s(V)},()=>{}),()=>{x=!1}},[d,r,i]);let[u,f]=(0,A.useState)(0),m=(0,A.useMemo)(()=>r||i===null||i>=e.log.length||!d?void 0:d.askArchived(e,i,n)??d.askDeclaration(n,i),[r,e,i,n,d,u]),p=m&&"waiting"in m?m.waiting:void 0,g=m&&"seq"in m?m:null,[v,k]=(0,A.useState)(void 0);(0,A.useEffect)(()=>{if(!p)return;let x=!0,V=setTimeout(()=>x&&k(p),Qr);return p.then(()=>x&&f(O=>O+1)),()=>{x=!1,clearTimeout(V)}},[p]);let y=p!==void 0&&v!==p||g!==null,b=(0,A.useMemo)(()=>{if(r||i===null||i>=e.log.length||!d||y)return null;try{let x=d.pastAt(e,i,n);return{seq:i,at:x.past?.at,store:x}}catch{return null}},[r,e,i,n,d,y,u]),h=(0,A.useRef)(null),E=y?h.current:b;(0,A.useEffect)(()=>{h.current=E},[E]);let P=(0,A.useCallback)(x=>a(x===null?null:x>=e.log.length?Number.POSITIVE_INFINITY:x),[e]),D=(0,A.useCallback)((x,V)=>[e,E?.store].some(O=>O!==void 0&&(O===x||O.seenBy(V)===x)),[e,E]),C=i!==null,G=(0,A.useMemo)(()=>({past:E,open:C,show:P,live:e,host:n,owns:D,archive:g}),[E,C,P,e,n,D,g]);return r?o:G}var bo=e=>`graview:setting:${e}`;function xo(){return localStorage}function Eo(e,t){try{let n=(t??xo()).getItem(bo(e.name));if(n!==null&&e.options.some(o=>o.value===n))return n}catch{}return e.initial}function Ao(e,t,n){try{(n??xo()).setItem(bo(e.name),t)}catch{}}function ko(e,t){if(typeof document>"u")return;let n=document.documentElement;if(e.honored==="root-font-size"){n.style.fontSize=t===e.initial?"":t;return}let o=`graview${e.name.replace(/-([a-z0-9])/g,(r,i)=>i.toUpperCase()).replace(/^[a-z]/,r=>r.toUpperCase())}`;t===e.initial?delete n.dataset[o]:n.dataset[o]=t}var L=_(N(),1);function It(e){return Fe(e)}var ni=12,oi=4;function ri(e,t,n){let o=It(t);return e.get(o)??{participant:o,who:t.id??t.kind,at:null,mode:"docked",since:n,trail:[]}}var tt=(e,t)=>t===null||e[e.length-1]===t?e:[...e,t].slice(-ni);function Po(e,t){let n=e.filter(r=>r.length>0);if(n.length===0)return null;if(n.length<=oi)return n[0];let o=new Set(n.map(r=>t(r)).filter(r=>r!==void 0));return o.size===1?St([...o][0]):n[0]}function Ct(e,t,n){let o=new Map(e);if(t.type==="rest"){for(let[a,d]of e)d.mode!=="asking"&&d.mode!=="docked"&&t.at-d.since>=t.holdMs&&o.set(a,{...d,mode:"docked",at:null,trail:[],say:void 0,confidence:void 0});return o}if(t.author.kind!=="agent")return o;let r=ri(e,t.author,t.at),i=a=>o.set(r.participant,{...r,...a,since:t.at});switch(t.type){case"read":{let a=Po(t.ids,n);return i({at:a,mode:"reading",trail:tt(r.trail,a)}),o}case"about-to-write":case"write":{let a=Po(t.ids,n);return i({at:a,mode:"writing",trail:tt(r.trail,a),say:void 0,confidence:void 0}),o}case"refused":return i({at:t.where,mode:"refused",say:t.say,confidence:void 0,trail:tt(r.trail,t.where)}),o;case"asking":return i({at:t.where??r.at,mode:"asking",say:t.say,...t.confidence!==void 0?{confidence:t.confidence}:{confidence:void 0},trail:tt(r.trail,t.where)}),o;case"said":return i({say:t.say,...t.confidence!==void 0?{confidence:t.confidence}:{confidence:void 0},...t.caption?{caption:t.caption}:{}}),o;case"over":return i({over:t.over}),o;case"home":return i({at:null,mode:"docked",trail:[],say:void 0,confidence:void 0,over:null}),o;default:return o}}var Ro="graview:session";function To(e){let t=()=>typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID().slice(0,8):Math.random().toString(36).slice(2,10);try{let n=e??sessionStorage,o=n.getItem(Ro);if(o)return o;let r=t();return n.setItem(Ro,r),r}catch{return t()}}var _t={name:"share-where",title:"Where you are",description:"Whether the others here see which stop you are on.",honored:"root-attribute",options:[{value:"shared",label:"Shown"},{value:"private",label:"Hidden"}],initial:"shared"},Lt={name:"share-over",title:"What you point at",description:"Whether the others see the thing under your pointer, outlined in your color.",honored:"root-attribute",options:[{value:"private",label:"Kept to yourself"},{value:"shared",label:"Outlined for others"}],initial:"private"},Mo=[_t,Lt],ai=800;function Oo(e){let{channel:t,store:n,view:o,principal:r,session:i,robots:a,seatWho:d,settingValues:s,setView:u,ttlMs:f=1e4,people:m,seats:p}=e,[g,v]=(0,L.useState)(()=>new Map),[k,y]=(0,L.useState)(null),[b,h]=(0,L.useState)(null),[E,P]=(0,L.useState)(null),D=typeof r.id=="string"&&r.id.length>0,C=D&&(s[_t.name]??_t.initial)==="shared",G=C&&(s[Lt.name]??Lt.initial)==="shared",x=It({kind:r.kind,...r.id?{id:r.id}:{},session:i}),V=D?Hn(r,{graph:n.graph,schema:n.schema,...p?{seats:p}:{},...m?{people:m}:{}}):"",O=d?a.get(`agent:${d}:${i}`):void 0,W=(0,L.useMemo)(()=>!t||!C?null:{participant:x,kind:r.kind,name:V,...r.onBehalfOf?.id?{onBehalfOf:r.onBehalfOf.id,...r.onBehalfOf.name?{onBehalfOfName:r.onBehalfOf.name}:{}}:{},hue:Dn(r.id??"nobody"),stop:E??te(o),...G?{over:k}:{},...O?{robot:{at:O.at,mode:O.mode}}:{},at:new Date().toISOString()},[t,C,G,x,V,r.id,r.kind,r.onBehalfOf?.id,r.onBehalfOf?.name,o,E,k,O?.at,O?.mode]);(0,L.useEffect)(()=>{if(!t||!W)return;t.here(W);let I=setInterval(()=>t.here({...W,at:new Date().toISOString()}),ai);return()=>clearInterval(I)},[t,W]),(0,L.useEffect)(()=>t?t.onWho(K=>v(gt(new Map,K,Date.now(),f))):void 0,[t,f]);let Z=g.size>0;(0,L.useEffect)(()=>{if(!Z)return;let I=setInterval(()=>{v(K=>{let Q=gt(K,[],Date.now(),f);return Q.size===K.size?K:Q})},Math.max(250,Math.min(1e3,f/4)));return()=>clearInterval(I)},[Z,f]),(0,L.useEffect)(()=>{if(!t||typeof window>"u")return;let I=()=>t.leave();return window.addEventListener("pagehide",I),()=>window.removeEventListener("pagehide",I)},[t]),(0,L.useEffect)(()=>{if(!G||typeof document>"u")return;let I=null,K=Q=>{let Ee=mo(Q.target);Ee!==I&&(I=Ee,y(Ee))};return document.addEventListener("pointermove",K,{passive:!0}),()=>document.removeEventListener("pointermove",K)},[G]);let X=(0,L.useRef)(null),$=b?g.get(b)??null:null,de=(0,L.useCallback)(I=>{X.current=null,h(I)},[]);return(0,L.useEffect)(()=>{if(b){if(!$){h(null);return}$.stop!==X.current?.stop&&(X.current={stop:$.stop,at:Date.now()},u($e($.stop)))}},[b,$,u]),(0,L.useEffect)(()=>{let I=X.current;!b||I===null||Date.now()-I.at<400||Bn(o,$e(I.stop))||h(null)},[o,b]),(0,L.useEffect)(()=>{if(!b||typeof document>"u")return;let I=K=>{K.key==="Escape"&&h(null)};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[b]),(0,L.useMemo)(()=>({who:g,sharing:W?{participant:x,name:V}:null,following:$,follow:de,sayWhere:P}),[g,W,x,V,$,de])}var U=_(N(),1);function Vo(e){return Fe(e.author)}function si(e,t){return e.length>1?"co-edited":t==="rule"?"rule":t==="agent"?"autonomous":"directed"}function Io(e,t,n,o,r){let i=new Map;for(let[s,u]of e)o-u.at<r&&i.set(s,u);let a=new Set(n.flatMap(s=>s.nodeIds)),d=(s,u,f)=>{let m=i.get(s),p=m?.participants.includes(Vo(u))?m.participants:[...m?.participants??[],Vo(u)];i.set(s,{at:o,manner:si(p,u.author.kind),intent:u.intent,wrote:(m?.wrote??!1)||(f.wrote??!1),read:(m?.read??!1)||(f.read??!1),broke:(m?.broke??!1)||a.has(s),participants:p})};for(let s of t){for(let u of s.writes)d(u,s,{wrote:!0});for(let u of s.reads)s.writes.includes(u)||d(u,s,{read:!0})}for(let s of n)for(let u of s.nodeIds){let f=i.get(u);i.set(u,{at:o,manner:f?.manner??"rule",intent:f?.intent??s.message,wrote:f?.wrote??!1,read:f?.read??!1,broke:!0,participants:f?.participants??["rule::"]})}return i}var li=2600;function Co(e,t=li){let[n,o]=(0,U.useState)(()=>new Map),r=(0,U.useRef)(n);r.current=n;let i=(0,U.useRef)(null),a=(0,U.useCallback)(s=>{r.current=s,o(s),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{r.current=new Map,o(new Map)},t)},[t]);(0,U.useEffect)(()=>{let s=e.violations(),u=e.subscribe((f,m)=>{let p=e.violations(),g=Wn(e.allInvariants(),s,p).introduces;s=p,a(Io(r.current,m,g.map(v=>({nodeIds:v.nodeIds,message:v.message})),Date.now(),t))});return()=>{u(),i.current&&clearTimeout(i.current)}},[e,t,a]);let d=(0,U.useCallback)(s=>{s.reads.length!==0&&a(Io(r.current,[di(s)],[],Date.now(),t))},[t,a]);return{activity:n,noteAttention:d}}function di(e){return{id:`attention:${e.intent}`,seq:-1,batch:"attention",author:e.author,intent:e.intent,mutation:null,primitives:[],reads:e.reads,writes:[],at:new Date().toISOString()}}var l=_(N(),1);function _o(){let e=null,t=new Set,n=new Set,o=r=>{for(let i of n)i(r)};return{subscribe(r){return t.add(r),t.size===1&&o(!0),()=>{t.delete(r),t.size===0&&(e=null,o(!1))}},snapshot:()=>e,set(r){if(!(e===r||e&&r&&e.x===r.x&&e.y===r.y)){e=r;for(let i of t)i()}},get listeners(){return t.size},onActive(r){return n.add(r),()=>void n.delete(r)}}}var nt=_(N(),1),ui=e=>e.definitions.some(t=>_n(t).size>0);function Lo(e,t,n){let[o,r]=(0,nt.useState)(void 0),i=(n.roles??[]).join("\0");return(0,nt.useEffect)(()=>{if(!t||!ui(e.schema)){r(void 0);return}let a=!0,d=!1,s=e.graph,u=()=>{d||(d=!0,queueMicrotask(()=>{d=!1,a&&e.reread()}))},f=Ln(t,{kind:n.kind,...n.id===void 0?{}:{id:n.id},...n.roles?{roles:n.roles}:{}},u);return mt(s,f.read),r(f),e.reread(),()=>{a=!1,mt(s,void 0)}},[e,t,n.kind,n.id,i]),o}function Ho(){let e=!1,t=new Set;return{moving:()=>e,set(n){if(n!==e){e=n;for(let o of t)o()}},subscribe(n){return t.add(n),()=>t.delete(n)}}}var le=_(Ce(),1),ci="graview:place-menu",_e=(0,l.createContext)(null),Go=(0,l.createContext)("scene");function fi({mode:e,children:t}){return(0,le.jsx)(Go.Provider,{value:e,children:t})}function pi(){return(0,l.useContext)(Go)}var Wo={kind:"human"},yi=[],mi=[],gi=[],Ht=[];function Fo(e,t){let n=(0,l.useId)();(0,l.useEffect)(()=>{if(!globalThis.__graviewWatch)return;let o=t??Wo,r=()=>Gn(e,o,n);r();let i,a=e.subscribe(()=>{clearTimeout(i),i=setTimeout(r,250)});return()=>{clearTimeout(i),a(),globalThis.__graviewWatch?.unseen?.({words:[],from:n,gone:!0})}},[e,t,n])}var hi={off:!0};function Si({store:e,views:t,initialView:n,scheme:o="dark",initialSelection:r,principal:i,seats:a=yi,onSeat:d,people:s=mi,memory:u,presenceTtlMs:f,app:m,settings:p=m?.settings??gi,presence:g,brand:v,locale:k,timeZone:y,onKeepLens:b,providers:h,ai:E,files:P,resolveApp:D,history:C,linkedRecords:G,menuSections:x,keptViews:V,subscriptions:O,signIn:W,view:Z,onViewChange:X,children:$}){let de=(0,l.useContext)(_e),I=x??de?.menuSections,K=W??de?.signIn,Q=V??de?.keptViews,[Ee,dr]=(0,l.useState)(null),ue=Ee??i??a[0]?.principal??Wo,He=Vt(e,ue,C),Xt=He.past&&He.live===e?He.past.store:e,H=(0,l.useMemo)(()=>Xt.seenBy(ue),[Xt,ue]);Fo(e,ue);let[re]=(0,l.useState)(()=>To(u)),[Jt,ur]=(0,l.useState)(!1),Qt=(0,l.useCallback)(()=>ur(!0),[]),ie=(0,l.useMemo)(()=>g?[...p,...Mo]:p,[p,g]),[ut]=(0,l.useState)(()=>n??Gt(t,e.schema)),[cr,en]=(0,l.useState)(()=>ze(ut??fe,r??ut?.selection??[])),Ae=(0,l.useRef)(ut??fe).current,[tn,fr]=(0,l.useState)(null),[nn,pr]=(0,l.useState)(null),J=(0,l.useContext)(_e),[on]=(0,l.useState)(()=>J?.seatTalk??Mt(v?.name??e.schema.kinds.join(","))),ct=E??J?.ai??bt,De=(0,l.useMemo)(()=>ct.off?hi:ct,[ct]),rn=(0,l.useRef)(De.interactions);rn.current=De.interactions;let[an]=(0,l.useState)(()=>J?.aiDesk??Ot(()=>rn.current)),[yr]=(0,l.useState)(()=>J?.subscriptions??jn()),sn=O??J?.subscriptions??yr,ft=b??J?.onKeepLens,Ne=m??J?.app,je=k??J?.locale,mr=v?.locale??Ne?.brand?.locale,Ge=y??J?.timeZone;Cn({reader:je,app:mr,readerTimeZone:Ge,appTimeZone:v?.timeZone??Ne?.brand?.timeZone});let ln=(0,l.useRef)(null),dn=(0,l.useCallback)(c=>{ln.current=c},[]),un=(0,l.useCallback)(c=>ln.current?.whereIs(c)??null,[]),[cn]=(0,l.useState)(()=>_o()),[fn]=(0,l.useState)(()=>Ho()),[pt,gr]=(0,l.useState)(null),[ke,pn]=(0,l.useState)(()=>new Map),Pe=(0,l.useRef)(ke);Pe.current=ke;let Re=(0,l.useRef)(null),yt=(0,l.useCallback)(c=>H.graph.getNode(c)?.kind,[H]),ee=(0,l.useCallback)(c=>{let S=Ct(Pe.current,c,yt);Pe.current=S,pn(S),Re.current&&clearTimeout(Re.current),[...S.values()].some(T=>T.mode!=="docked"&&T.mode!=="asking")&&(Re.current=setTimeout(()=>{let T=Ct(Pe.current,{type:"rest",at:Date.now(),holdMs:jt},yt);Pe.current=T,pn(T)},jt+20))},[yt]),yn=(0,l.useCallback)(c=>ee({...c,at:c.at??Date.now()}),[ee]),mn=(0,l.useCallback)(c=>{gr(c),c&&ee({type:"home",author:{kind:"agent",id:c,session:re},at:Date.now()})},[ee,re]);(0,l.useEffect)(()=>H.subscribe((c,S)=>{for(let R of S)R.author.kind==="agent"&&ee({type:"write",author:R.author,ids:R.writes,at:Date.now()})}),[H,ee]),(0,l.useEffect)(()=>()=>{Re.current&&clearTimeout(Re.current)},[]);let z=(0,l.useMemo)(()=>({...ue,session:re}),[ue,re]),gn=Lo(H,G,z),hn=(0,l.useCallback)(c=>{dr(c),d?.(c)},[d]),[Te,hr]=(0,l.useState)(()=>Object.fromEntries(ie.map(c=>[c.name,Eo(c,u)])));(0,l.useEffect)(()=>{for(let c of ie)ko(c,Te[c.name]??c.initial)},[ie,Te]);let Sn=(0,l.useCallback)((c,S)=>{let R=ie.find(T=>T.name===c);!R||!R.options.some(T=>T.value===S)||(Ao(R,S,u),hr(T=>({...T,[c]:S})))},[ie,u]),[wn,Sr]=(0,l.useState)(null),{activity:vn,noteAttention:bn}=Co(H),xn=(0,l.useCallback)(c=>{bn(c),ee({type:"read",author:c.author,ids:c.reads,at:Date.now()})},[bn,ee]),ce=(0,l.useCallback)(c=>{if(ye(c)!==null||se(c).length>0||wt(c))return!0;let S=$n(c);return S?H.graph.allEdges().some(R=>R.kind===S.kind&&R.from===S.from&&R.to===S.to):H.graph.getNode(c)!==void 0},[H]),En=(0,l.useCallback)(c=>{let S=c.selection??Ht,R=S.filter(ce),T=R.length===S.length?c:ze(c,R);return T.focusId!==null&&!ce(T.focusId)&&(T=B(T,null)),T},[ce]),Me=(0,l.useCallback)(c=>{let S=En(c),R=jo(H,z,S.shown);if(S.focusId!==null&&R.size>0){let T=se(S.focusId),In=H.graph.getNode(S.focusId);(T.length>0?T.every(br=>R.has(br)):In?R.has(In.kind):!1)&&(S={...S,focusId:null})}if(!S.overview&&S.focusId===null){let T=Ae.focusId!==null&&!ce(Ae.focusId)?Gt(t,e.schema)??{...fe,overview:!0}:Ae;T.focusId!==null&&ce(T.focusId)?S={...S,focusId:T.focusId}:T.overview===!0&&(S={...S,overview:!0})}return S},[En,ce,H,Ae,z,t,e.schema]),q=Me(Z??cr),An=(0,l.useMemo)(()=>jo(H,z,q.shown),[H,z,q.shown]),kn=(0,l.useMemo)(()=>[...H.modules.administered.entries()].map(([c,S])=>{let R=H.mayAdminister(c,z);return{name:c,...S.description?{description:S.description}:{},kinds:S.kinds??[],canShow:R,shown:R&&(q.shown??[]).includes(c)}}),[H,z,q.shown]),Oe=(0,l.useCallback)(c=>{let S=R=>Me(typeof c=="function"?c(R):c);if(Z!==void 0){X?.(S(Z));return}X&&X(S(q)),en(R=>S(R))},[q,X,Z,Me]);(0,l.useEffect)(()=>{Z===void 0&&en(c=>{let S=Me(c);return S===c?c:S})},[q,Z,Me]);let Pn=q.selection??Ht,Rn=(0,l.useCallback)(c=>{Oe(S=>ze(S,typeof c=="function"?c(S.selection??Ht):c))},[Oe]),{who:Tn,following:Mn,follow:On,sayWhere:wr,sharing:Vn}=Oo({channel:g,store:H,view:q,principal:z,session:re,robots:ke,seatWho:pt,settingValues:Te,setView:Oe,seats:a,people:s,...f!==void 0?{ttlMs:f}:{}}),vr=(0,l.useMemo)(()=>({store:H,scheme:o,views:t,view:q,setView:Oe,homeView:Ae,selection:Pn,setSelection:Rn,menuAt:tn,setMenuAt:fr,whereIs:un,pointer:cn,motion:fn,registerScene:dn,robots:ke,noteSeat:yn,seatWho:pt,registerSeatWho:mn,actsDoor:nn,registerActsDoor:pr,seatTalk:on,aiDesk:an,...u?{memory:u}:{},who:Tn,following:Mn,follow:On,sayWhere:wr,sharing:Vn,session:re,ai:De,resolveApp:D,linkedRecords:G,menuSections:I,...Q?{keptViews:Q}:{},subscriptions:sn,signIn:K,linkedReads:gn,movedByHand:Jt,noteMoved:Qt,emphasis:wn,setEmphasis:Sr,activity:vn,noteAttention:xn,principal:z,seats:a,people:s,takeSeat:hn,settings:ie,settingValues:Te,chooseSetting:Sn,hiddenKinds:An,administered:kn,...h?{providers:h}:{},...v?{brand:v}:{},...ft?{onKeepLens:ft}:{},app:Ne,...je?{locale:je}:{},...Ge?{timeZone:Ge}:{}}),[H,o,t,q,Oe,Pn,Rn,tn,un,cn,fn,dn,ke,yn,pt,mn,nn,on,an,u,Tn,Mn,On,Vn,re,De,D,G,I,Q,sn,K,gn,Jt,Qt,wn,vn,xn,z,a,s,hn,ie,Te,Sn,An,kn,h,v,ft,Ne,je,Ge]);return(0,le.jsx)(_e.Provider,{value:vr,children:(0,le.jsx)(Ie.Provider,{value:He,children:(0,le.jsx)(Ei,{children:P?(0,le.jsx)(Qe.Provider,{value:P,children:$}):$})})})}var Ko=(0,l.createContext)(null),Dt,Nt=new Set,wi=e=>(Nt.add(e),()=>void Nt.delete(e)),Do=()=>Dt;function vi(e){if(!Dt){Dt=e;for(let t of[...Nt])t()}}var bi=300;function xi(e){let t=0;return async(n,o)=>{let r=++t;return await new Promise(i=>setTimeout(i,bi)),r===t?e(n,o):[]}}function Ei({children:e}){let{store:t,view:n,views:o,principal:r,hiddenKinds:i,selection:a,ai:d}=oe(),s=ot(),u=n.q,f=n.focusId,m=!!(u&&u.trim().length>0),p=(0,l.useSyncExternalStore)(wi,Do,Do),g=(0,l.useMemo)(()=>m&&p?{flagged:new Set(t.violations().flatMap(E=>E.nodeIds)),touched:p.touchWeights(t.log.all())}:null,[t,s,m,p]),v=f?t.graph.getNode(f)?.kind??ye(f)??(se(f).length===1?se(f)[0]:void 0):void 0,k=(0,l.useMemo)(()=>d.near&&xi(d.near),[d.near]),y=(0,l.useMemo)(()=>!u||!g||!p?null:p.search(t,u,{...v?{inKind:v}:{},principal:r,places:o.places(),kinds:t.schema.kinds.filter(E=>!i.has(E)),from:[...a,...f&&t.graph.has(f)?[f]:[]],flagged:g.flagged,touched:g.touched,limit:200,rank:k}),[t,u,r,o,i,a,f,v,g,k]),[b,h]=(0,l.useState)();return(0,l.useEffect)(()=>void y?.later?.then(E=>h([y,E])),[y]),(0,le.jsx)(Ko.Provider,{value:b?.[0]===y?b[1]:y,children:e})}var No=new WeakMap;function as(e){let t=No.get(e);return t||No.set(e,t=new Set(e.matched)),t}function Ai(){return(0,l.useContext)(Ko)}function oe(){let e=(0,l.useContext)(_e);if(!e)throw new Error("useGraview must be used inside a <GraviewProvider>.");return e}function Wt(){return(0,l.useContext)(_e)??null}function ot(){let{store:e}=oe(),t=(0,l.useRef)(null),n=(0,l.useRef)(null),o=(0,l.useCallback)(()=>(n.current!==e&&(n.current=e,t.current=null),t.current??=e.graph.allNodes(),t.current),[e]),r=(0,l.useCallback)(i=>e.subscribe(()=>{t.current=null,i()}),[e]);return(0,l.useSyncExternalStore)(r,o,o)}function ki(e){let{store:t}=oe(),n=(0,l.useCallback)(r=>t.subscribe(r),[t]),o=(0,l.useCallback)(()=>e===null?void 0:t.graph.getNode(e),[t,e]);return(0,l.useSyncExternalStore)(n,o,o)}function jo(e,t,n){let o=new Set(e.modules.disabledKinds);for(let r of e.kindsKeptFrom(t))o.add(r);for(let[r,i]of e.modules.administered)if(!(e.mayAdminister(r,t)&&(n??[]).includes(r)))for(let a of i.kinds??[])o.add(a);return o}var jt=2600;var qo=new WeakSet,Pi=e=>qo.has(e),Ri=e=>void qo.add(e);function Gt(e,t){let n=Kn(e.arrangement?.()?.first,t,e.places());if(!(!n||n.to==="home"))return n.to==="place"?{...fe,focusId:ne(n.place.kind),within:{view:n.place.as}}:{...fe,focusId:ne(n.kind)}}var Bo=_(N(),1),Ti=(0,Bo.createContext)(!1);var rt=Symbol.for("graview.default-view");function $o(e){return Object.defineProperty(e,rt,{value:!0,enumerable:!1}),e}function zo(e){return typeof e=="function"&&e[rt]===!0}var it=Symbol.for("graview.replaces-page");function Uo(e){return Object.defineProperty(e,it,{value:!0,enumerable:!1}),e}function Yo(e){return typeof e=="function"&&e[it]===!0}function Mi(e){return Fn(e)}function Oi(e,t){if(t===e)return e;for(let r of t.registrations())e.register(r.kind,r,r.view,r);let n=t.arrangement?.();n&&e.arrange?.(n);let o=t.homeView?.();return o&&e.home?.(o),e}var F=_(N(),1),Y=_(Ce(),1),Ft=new Set,at=0;function Jo(e){return()=>{at+=1;let t=e();return t.then(()=>void(at-=1),()=>void(at-=1)),t}}var Vi=()=>at,Qo=!1,er=!1,st=new Set;function Ii(){Qo=!0}function Ci(){er=!0;for(let e of[...st])e();st.clear()}var tr=()=>er||!Qo;function _i(e){return tr()?(e(),()=>{}):(st.add(e),()=>void st.delete(e))}var Zo=!1;function Kt(){for(let e of[...Ft])e()}function Li(){Zo||typeof window>"u"||(Zo=!0,window.addEventListener("online",Kt))}function qt(e){let t,n=!1,o=!1,r,i=0,a=new Set,d=()=>{i+=1;for(let p of[...a])p()},s=p=>(a.add(p),()=>void a.delete(p)),u=()=>i,f=()=>void m().catch(()=>{});function m(){if(n)return Promise.resolve(t);if(r)return r;let p=e().then(g=>(t=g,n=!0,o=!1,r=void 0,Ft.delete(f),d(),g),g=>{throw r=void 0,o=!0,Ft.add(f),Li(),d(),g});return p.catch(()=>{}),r=p,p}return{load:m,prefetch:f,get current(){return t},get failed(){return o},part(p,g={}){let v=g.what??"This part";function k(h){(0,F.useSyncExternalStore)(s,u,u);let E=(0,F.useRef)(null),P=(0,F.useRef)(null),D=(0,F.useRef)(!1);return(0,F.useEffect)(()=>{o&&r===void 0&&f()},[]),n&&typeof document<"u"&&E.current!==null&&document.activeElement===E.current&&(D.current=!0),(0,F.useLayoutEffect)(()=>{if(!(!n||!D.current)){D.current=!1;for(let C=P.current?.nextElementSibling??null;C!==null;C=C.nextElementSibling){let G=C.matches(Xo)?C:C.querySelector(Xo);if(G instanceof HTMLElement){G.focus();return}}}}),n?(0,Y.jsxs)(Y.Fragment,{children:[D.current?(0,Y.jsx)("span",{ref:P,hidden:!0}):null,p(t,h)]}):g.quiet?null:(0,Y.jsx)(Hi,{what:v,button:E,...g.as?{as:g.as}:{}})}let y=(0,F.lazy)(Jo(()=>m().then(()=>({default:k}),()=>({default:k}))));function b(h){let[E]=(0,F.useState)(()=>n||o);return(0,F.createElement)(E?k:y,h)}return b}}}var Xo="button,a[href],input,select,textarea,[tabindex]:not([tabindex='-1'])";function Hi({what:e,button:t,as:n="p"}){let r=typeof navigator<"u"&&navigator.onLine===!1?`${e} will load when you're back online.`:`${e} didn't load.`;return(0,Y.jsxs)(n,{"data-testid":"lazy-part-missing",style:{margin:0,fontSize:"0.875rem",color:"var(--graview-ink-muted)"},children:[(0,Y.jsx)("span",{role:"status",children:r})," ",(0,Y.jsx)("button",{ref:t,type:"button","data-testid":"lazy-part-retry",onClick:Kt,style:{font:"inherit",fontWeight:600,color:"var(--graview-ink)",background:"none",border:"1px solid var(--graview-edge)",borderRadius:6,padding:"2px 10px"},children:"Try again"})]})}var Se=_(N(),1);function Di(){let{selection:e,setSelection:t}=oe();return(0,Se.useMemo)(()=>({selection:e,set:n=>t(n),clear:()=>t([]),toggle:n=>t(o=>o.includes(n)?o.filter(r=>r!==n):[...o,n]),isSelected:n=>e.includes(n)}),[e,t])}function Ni(){let{store:e}=oe(),t=ot();return(0,Se.useMemo)(()=>ji(e),[e,t])}var nr=new WeakMap;function ji(e){let t=nr.get(e);if(!t){let n={violations:null};e.subscribe(()=>{n.violations=null}),nr.set(e,n),t=n}return t.violations??=e.violations(),t.violations}function Gi(){let{view:e,setView:t}=oe();return(0,Se.useMemo)(()=>({view:e,url:te(e),focus:n=>t(o=>B(o,n)),show:n=>t(o=>zn(o,n)),toggle:n=>t(o=>Ue(o,n)),go:n=>t(n)}),[e,t])}var he={at:0,depth:0,listeners:new Set,tell(){for(let e of this.listeners)e()}};typeof window<"u"&&window.addEventListener("popstate",e=>{let t=e.state;he.at=typeof t?.graview=="number"?t.graview:0,he.at>he.depth&&(he.depth=he.at),he.tell()});var j=_(N(),1),$t={profile:{trigger:"profile-button",pane:"profile",opens:"press",focus:"into",drawn:["shell","embed"]},problems:{trigger:"standing",pane:"problems",opens:"press",focus:"into",drawn:["shell","embed"]},places:{trigger:"app-places-open",pane:"app-places",opens:"press",focus:"into",drawn:["embed"]},here:{trigger:"here-open",pane:"here-list",opens:"press",focus:"into",drawn:["shell","embed","pages"]},suggested:{trigger:"suggested-button",pane:"suggested",opens:"press",focus:"into",drawn:["shell","embed","pages"]},activity:{trigger:"activity-button",pane:"activity",opens:"press",focus:"into",drawn:["shell","embed","pages"]},find:{trigger:"find-box",pane:"find-strip",opens:"typing",focus:"stays",drawn:["shell"]},districts:{trigger:"beyond-more",pane:"beyond-list",opens:"press",focus:"into",drawn:["shell","embed"]},acts:{trigger:null,pane:"context-menu",opens:"context-menu",focus:"into",drawn:["shell","embed","pages"]},arrange:{trigger:"arrange-add",pane:"arrange-list",opens:"press",focus:"into",drawn:["pages"]},"studio-ask":{trigger:"studio-agent",pane:"studio-agent-panel",opens:"press",focus:"into",drawn:["studio"]}},Wi={position:"fixed",inset:"auto",margin:0,zIndex:Nn("popover"),boxSizing:"border-box"},lt=6,we=8,Fi=e=>typeof e.showPopover=="function";function dt(e){try{return e.matches(":popover-open")}catch{return!1}}function Ki(e){if(typeof e=="function"){let o=e();return o?{left:o.x,right:o.x,top:o.y,bottom:o.y}:null}let t=e.current;if(!t||!t.isConnected)return null;let n=t.getBoundingClientRect();return{left:n.left,right:n.right,top:n.top,bottom:n.bottom}}function zt(e,t,n={}){let o=Ki(t);if(!o)return;let r={width:document.documentElement.clientWidth||innerWidth,height:innerHeight},i=e.dataset.graviewDesignedHeight??=e.style.maxHeight;e.style.maxHeight=i;let a=e.getBoundingClientRect(),d=r.height-o.bottom-lt-we,s=o.top-lt-we,u=a.height<=d||d>=s,f=Math.max(96,Math.floor(u?d:s)),m=Math.min(a.height,f);a.height>f&&(e.style.maxHeight=i?`min(${i}, ${f}px)`:`${f}px`);let p=a.width,g=n.align==="start"?o.left:o.right-p,v=typeof t=="function"?null:t.current?.closest("[data-graview-embed]")?.getBoundingClientRect();v&&p<=v.right-v.left&&(g<v.left?g=o.left+p<=v.right?o.left:v.left:g+p>v.right&&(g=o.right-p>=v.left?o.right-p:v.right-p));let k=p>=r.width-2*we?Math.max(0,(r.width-p)/2):Math.max(we,Math.min(g,r.width-we-p)),y=u?o.bottom+lt:Math.max(we,o.top-lt-m);e.style.left=`${Math.round(k)}px`,e.style.top=`${Math.round(y)}px`}function or(e,t,n,o={}){let r=o.align??"end";(0,j.useLayoutEffect)(()=>{let i=e.current;if(!t||!i)return;if(Fi(i)&&!dt(i))try{i.showPopover(),Bi()}catch{}let a=0,d=u=>{u?.target instanceof Node&&i.contains(u.target)||(cancelAnimationFrame(a),a=requestAnimationFrame(()=>zt(i,n,{align:r})))};zt(i,n,{align:r}),addEventListener("resize",d),addEventListener("scroll",d,!0);let s=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>d());return s?.observe(i),()=>{if(cancelAnimationFrame(a),removeEventListener("resize",d),removeEventListener("scroll",d,!0),s?.disconnect(),i.isConnected&&dt(i))try{i.hidePopover()}catch{}}},[t,e,r])}var Ut=new Set;function qi(e){return Ut.add(e),()=>Ut.delete(e)}function Bi(){for(let e of Ut)if(!(!e.isConnected||!dt(e)))try{e.hidePopover(),e.showPopover()}catch{}}var ve=null,$i='button:not([disabled]), [href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])';function zi(e){for(let t of e.querySelectorAll($i))if(t.closest("[hidden]")===null&&getComputedStyle(t).visibility!=="hidden")return t;return e}var Bt=()=>{let e=document.activeElement;return e===null||e===document.body};function Ui(e,t={}){let{at:n,returnTo:o,onOpenChange:r}=t,i=t.popover!==!1,[a,d]=(0,j.useState)(!1),s=t.open??a,u=(0,j.useRef)(null),f=(0,j.useRef)(null),m=(0,j.useCallback)(h=>{u.current=h},[]),p=(0,j.useCallback)(h=>{f.current=h},[]),g=`graview-popover-${(0,j.useId)().replace(/:/g,"")}`,v=(0,j.useRef)({onOpenChange:r,returnTo:o,controlled:t.open!==void 0});v.current={onOpenChange:r,returnTo:o,controlled:t.open!==void 0};let k=(0,j.useCallback)(h=>{v.current.controlled||d(h),v.current.onOpenChange?.(h)},[]),y=(0,j.useCallback)(()=>{(document.querySelector(`[aria-controls="${g}"]`)??u.current??v.current.returnTo?.()??null)?.focus({preventScroll:!0})},[g]),b=(0,j.useCallback)(h=>{let E=f.current,P=typeof document>"u"?null:document.activeElement,D=P===null||P===document.body||E!==null&&E.contains(P);k(!1),!(!h||!D)&&(y(),requestAnimationFrame(()=>{Bt()&&y()}))},[k,y]);return or(f,i&&s,n??u,t.align?{align:t.align}:{}),(0,j.useEffect)(()=>{if(!i||!s)return;let h={name:e,close:()=>b(!1)};if(ve&&ve.close!==h.close&&ve.close(),ve=h,$t[e].focus==="into"){let x=f.current;x&&!x.contains(document.activeElement)&&zi(x).focus({preventScroll:!0})}let E=x=>{x.key==="Escape"&&b(!0)},P=x=>{let V=x.target;if(!(V instanceof Node))return;let O=f.current;if(O?.contains(V)||u.current?.contains(V))return;let W=V instanceof Element?V.closest('[role="dialog"], [role="alertdialog"]'):null;W&&!(O&&W.contains(O))||(b(!1),$t[e].focus==="into"&&requestAnimationFrame(()=>{(Bt()||O!==null&&O.contains(document.activeElement))&&y()}))},D=null,C=null,G=x=>{let V=x.target;if(!(V instanceof Element))return;let O=f.current,W=V.closest('[role="dialog"], [role="alertdialog"]');!W||O&&(O.contains(W)||W.contains(O))||(D=W,b(!1))};return document.addEventListener("keydown",E),document.addEventListener("pointerdown",P,!0),document.addEventListener("focusin",G),()=>{document.removeEventListener("keydown",E),document.removeEventListener("pointerdown",P,!0),document.removeEventListener("focusin",G);let x=D;x&&typeof MutationObserver<"u"&&(C?.disconnect(),C=new MutationObserver(()=>{x.isConnected||(C?.disconnect(),requestAnimationFrame(()=>{(Bt()||document.activeElement.closest("[hidden]")!==null)&&y()}))}),C.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>C?.disconnect(),10*6e4)),ve?.close===h.close&&(ve=null)}},[i,s,e,b,y]),{open:s,setOpen:h=>h?k(!0):b(!0),toggle:()=>s?b(!0):k(!0),trigger:{ref:m,"aria-expanded":s,"aria-controls":g,"data-graview-popover-trigger":e},pane:{ref:p,id:g,popover:"manual",tabIndex:-1,"data-graview-popover":e,"data-graview-overlay":""}}}var be=_(N(),1);var rr=(0,be.createContext)(null);function Yi(){let e=(0,be.useContext)(rr),t=Wt(),n=(o,r,i)=>t?.setView(a=>ae(ae(pe(B(a,ne(o)),!1),"view",r),"filter",i?.filter??null));return(0,be.useMemo)(()=>e??{record:o=>{t&&(t.setView(r=>B(pe(r,!1),o)),t.setSelection([o]))},place:(o,r)=>{let i=t?.views.places().find(a=>a.as===o);i&&n(i.kind,i.as,r)},list:(o,r)=>n(o,null,r)},[e,t])}var xe=_(N(),1);var Zi=qt(Ke(()=>(__graviewPreload(import.meta.url,["./chunk.4JWT6LIS.js","./chunk.SDO3U72B.js","./chunk.AW2T3KFV.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.ZN77U6SU.js"))));function Xi(e,t,n){let o,r=!1,i=()=>{let{hidden:d,removed:s}=t.current();o||r||d.length+s.length===0||(o=()=>{},Zi.load().then(u=>{r||(o=u.watchTidied(e,t,n))},String))};i();let a=t.onChange?.(i);return()=>{r=!0,a?.(),o?.()}}function Ji(e,t){let[n,o]=(0,xe.useState)();return(0,xe.useEffect)(()=>t?Xi(e,t,r=>o([e,r])):void 0,[e,t]),n?.[0]===e?n[1]:e}var ir=_(N(),1),Qi=(0,ir.createContext)(!1);var ar=_(N(),1),ea=(0,ar.createContext)(null);var sr=_(N(),1),Yt='button:not([disabled]), a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])',Zt=e=>e instanceof HTMLElement&&(e.matches(Yt)||e.hasAttribute("tabindex")),Le=e=>typeof e.checkVisibility=="function"?e.checkVisibility():e.getClientRects().length>0;function ta(e,t){let n=s=>s.replace(/["\\]/g,"\\$&"),o=t.getAttribute("data-testid"),r=t.getAttribute("data-graview-pick"),i=t.getAttribute("aria-label"),a=o?`[data-testid="${n(o)}"]`:r?`[data-graview-pick="${n(r)}"]`:i?`${t.tagName.toLowerCase()}[aria-label="${n(i)}"]`:null;if(!a)return null;let d=e.querySelector(a);return d&&Zt(d)&&Le(d)?d:null}var na=e=>e.isConnected&&Zt(e)&&!e.matches(":disabled")&&e instanceof HTMLElement&&Le(e);function lr(e,t){let n=t?ta(e,t):null;if(n)return n;let o=e.querySelector("[data-graview-view][tabindex]");if(o&&Le(o))return o;for(let r of e.querySelectorAll(Yt))if(Le(r))return r;return Zt(e)&&Le(e)?e:null}function oa(e){(0,sr.useEffect)(()=>{let t=e.current;if(!t||typeof MutationObserver>"u")return;let n=[],o=y=>{let b=y.target;if(b instanceof Element){n=[];for(let h=b;h&&h!==t.parentElement;h=h.parentElement)n.push(h)}},r=!1,i=!1,a=t.ownerDocument,d=()=>!i&&a.defaultView!==null,s=(y,b)=>void setTimeout(()=>d()&&b(),y),u=y=>void requestAnimationFrame(()=>d()&&y()),f=y=>{if(r=!1,i)return;let b=a.activeElement;if(!(!(b===null||b===a.body||b===a.documentElement)||n.length===0)){if(na(n[0])){y&&n[0]instanceof HTMLElement&&n[0].focus({preventScroll:!0});return}for(let E of n.slice(1)){if(!E.isConnected)continue;let P=lr(E,n[0]);if(P){P.focus({preventScroll:!0}),n=[];return}}}},m=(y,b=Date.now()+2500)=>{s(100,()=>{f(y);let h=a.activeElement;(h===null||h===a.body||h===a.documentElement)&&n.length>0&&Date.now()<b&&m(y,b)})},p=()=>{r||n.length===0||(r=!0,s(60,()=>u(()=>{f(!1),m(!1)})))},g=y=>{if(!(y instanceof KeyboardEvent&&!["Enter"," ","Escape"].includes(y.key))){if(!(y instanceof KeyboardEvent)){let b=y.target instanceof Element?y.target.closest(Yt):null,h=a.activeElement,E=h===null||h===a.body||h===a.documentElement;if(b&&E&&t.contains(b)){n=[];for(let P=b;P&&P!==t.parentElement;P=P.parentElement)n.push(P);s(150,()=>u(()=>{f(!1),m(!1)}));return}}!(y instanceof KeyboardEvent)&&!(y.target instanceof Node&&n[0]?.contains(y.target))||s(150,()=>u(()=>{f(!0),m(!0)}))}},v=new MutationObserver(()=>{n.length>0&&!n[0].isConnected&&p()}),k=y=>{y.relatedTarget===null&&p()};return t.addEventListener("focusin",o),t.addEventListener("focusout",k),t.addEventListener("click",g),t.addEventListener("keydown",g),v.observe(t,{childList:!0,subtree:!0}),()=>{i=!0,t.removeEventListener("focusin",o),t.removeEventListener("focusout",k),t.removeEventListener("click",g),t.removeEventListener("keydown",g),v.disconnect()}},[e])}export{fe as a,te as b,$e as c,ia as d,aa as e,Bn as f,qn as g,$n as h,ht as i,B as j,zn as k,ae as l,pe as m,ze as n,Ve as o,Ue as p,Ze as q,St as r,ye as s,da as t,Er as u,ne as v,Un as w,se as x,Yn as y,Ar as z,ua as A,Zn as B,wt as C,kr as D,Pr as E,Rr as F,N as G,Mt as H,zr as I,Yr as J,mo as K,Qe as L,Zr as M,Ie as N,ho as O,Xr as P,Vt as Q,Ce as R,ci as S,fi as T,pi as U,Fo as V,Si as W,vi as X,as as Y,Ai as Z,oe as _,Wt as $,ot as aa,ki as ba,Pi as ca,Ri as da,Gt as ea,rr as fa,Yi as ga,Ti as ha,$o as ia,zo as ja,Uo as ka,Yo as la,Mi as ma,Oi as na,Jo as oa,Vi as pa,Ii as qa,Ci as ra,tr as sa,_i as ta,qt as ua,Ji as va,Qi as wa,ea as xa,Di as ya,Ni as za,Gi as Aa,he as Ba,oa as Ca,Wi as Da,dt as Ea,or as Fa,qi as Ga,Ui as Ha};
2
- /*! Bundled license information:
3
-
4
- react/cjs/react.production.js:
5
- (**
6
- * @license React
7
- * react.production.js
8
- *
9
- * Copyright (c) Meta Platforms, Inc. and affiliates.
10
- *
11
- * This source code is licensed under the MIT license found in the
12
- * LICENSE file in the root directory of this source tree.
13
- *)
14
-
15
- react/cjs/react-jsx-runtime.production.js:
16
- (**
17
- * @license React
18
- * react-jsx-runtime.production.js
19
- *
20
- * Copyright (c) Meta Platforms, Inc. and affiliates.
21
- *
22
- * This source code is licensed under the MIT license found in the
23
- * LICENSE file in the root directory of this source tree.
24
- *)
25
- */
@@ -1 +0,0 @@
1
- import{b as a,c as b,d as c,e as d,f as e,g as f,h as g}from"./chunk.RLMW7DU6.js";import"./chunk.PXQVXBNG.js";import"./chunk.AW2T3KFV.js";import"./chunk.2AZTW66C.js";import"./chunk.AJZBJBMO.js";export{g as createLinks,f as judgeDestination,e as listsOf,c as nowhere,a as placesSaid,b as quoted,d as whereOfWords};
@@ -1 +0,0 @@
1
- import{a,b,c,d,e,f,g,h,i,j}from"./chunk.GBCWI2LF.js";import"./chunk.DAZEFSWI.js";import"./chunk.ESU2DD3J.js";import"./chunk.PL2P2OON.js";import"./chunk.27ZVVPRZ.js";import"./chunk.IN4PKQO5.js";import"./chunk.3IUJ4GW7.js";import"./chunk.UG23RICT.js";import"./chunk.KERLVJ6I.js";import"./chunk.4EPT2CQG.js";import"./chunk.AW2T3KFV.js";import"./chunk.2AZTW66C.js";import"./chunk.AJZBJBMO.js";export{g as columnActs,d as columnChoices,c as columnMoves,b as columnOf,e as columnReach,f as columnSteps,i as describePlace,j as placeText,h as resolveFor,a as statusColumns};
@@ -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{a as t}from"./chunk.SDO3U72B.js";var d=t(()=>(__graviewPreload(import.meta.url,["./chunk.RYNCEZ6Q.js","./chunk.IQ3LUSD6.js","./chunk.GAFYE37S.js","./chunk.F4DWRBO7.js","./chunk.RVQYXPCM.js","./chunk.EJOTTZWZ.js","./chunk.BBLIT7S7.js","./chunk.RLMW7DU6.js","./chunk.PXQVXBNG.js","./chunk.SDO3U72B.js","./chunk.AW2T3KFV.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.OG6GNGTX.js")));function v(i,r){let e=!1,n=()=>{window.removeEventListener("online",n),e||o()},o=()=>void i().then(m=>{e||r(m)},()=>{e||window.addEventListener("online",n)});return o(),()=>{e=!0,window.removeEventListener("online",n)}}export{d as a,v as b};
@@ -1 +0,0 @@
1
- import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}from"./chunk.UXLJZIYX.js";import"./chunk.G4JJXA63.js";import"./chunk.OK4FSBHI.js";import"./chunk.DAZEFSWI.js";import"./chunk.3TBH2FMZ.js";import"./chunk.WE5SA6TP.js";import"./chunk.Q5WEOX3Q.js";import"./chunk.4B4DKCS4.js";import"./chunk.JQ7WY2VZ.js";import"./chunk.TDCO7LEA.js";import"./chunk.WVUJXDXZ.js";import"./chunk.ESU2DD3J.js";import"./chunk.PL2P2OON.js";import"./chunk.27ZVVPRZ.js";import"./chunk.IN4PKQO5.js";import"./chunk.3IUJ4GW7.js";import"./chunk.UG23RICT.js";import"./chunk.MZOIPCDA.js";import"./chunk.KERLVJ6I.js";import"./chunk.4EPT2CQG.js";import"./chunk.AW2T3KFV.js";import"./chunk.2AZTW66C.js";import"./chunk.AJZBJBMO.js";export{i as draftAnswer,h as draftFromLens,b as draftSight,l as draftView,a as isDraftFailure,c as judgeLens,d as lensEditOf,f as lensFromSpec,j as recipeDraft,g as recipeOfLens,m as refineDraft,o as runDraftTool,e as takeBackEditOf,k as templateDraft,n as withReaderLenses};
@@ -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{L as M,N as H,tb as N}from"./chunk.AW2T3KFV.js";var z=()=>(__graviewPreload(import.meta.url,["./chunk.RLMW7DU6.js","./chunk.PXQVXBNG.js","./chunk.AW2T3KFV.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.6VIZGLDK.js"));function F(n,l,y){let d=new Map;for(let u of y?.kinds??[])for(let a of n.nodesOfKind(u))l.has(a.id)||d.set(a.id,a);let o=new Set([...l,...d.keys()]),p=new Set(y?.edges??[]),k=new Set;if(p.size>0&&l.size>0){for(let u of l)for(let a of n.outEdges(u))p.has(a.kind)&&d.has(a.to)&&k.add(a.to);for(let u of d.keys())n.outEdges(u).some(a=>p.has(a.kind)&&l.has(a.to))&&k.add(u)}let b=new Map([...[...d].filter(([u])=>k.has(u)),...[...d].filter(([u])=>!k.has(u))]),h=[];if(p.size>0)for(let u of o)for(let a of n.outEdges(u))p.has(a.kind)&&o.has(a.to)&&h.push({kind:a.kind,from:a.from,to:a.to});return{nodes:[...b.values()],edges:h}}function L(n,l,y){let d=[];return()=>{let o=y();for(;d.length>0&&d[0]<=o-l;)d.shift();return d.length>=n?!1:(d.push(o),!0)}}function D(n={},l=Date.now){return{act:L(n.acts??30,n.actWindowMs??6e4,l),message:L(n.messages??120,n.messageWindowMs??1e3,l)}}var A=n=>typeof n=="object"&&n!==null&&!Array.isArray(n);function K(n,l){let y=structuredClone(l),d=n.schema.tryDefinition(y.kind),o=y.label;return{...y,label:d?.label?d.label(y):typeof o=="string"&&o.length>0?o:y.id}}function J(n){let l=n.limiter??D(n.limits,n.now),y=n.limits?.maxHeight??4e3,d=`view:${n.view}`,o={applied:0,refused:0,dropped:0},p=()=>n.store.seenBy(n.principal),k=e=>K(n.store,e),b=()=>{if(n.props)return n.props();let e=p(),t=e.graph,r=n.input?.()??{},f=r.node?t.getNode(r.node.id):void 0,i=r.nodes?.flatMap(s=>{let m=t.getNode(s.id);return m?[m]:[]}),g=new Set([...f?[f.id]:[],...(i??[]).map(s=>s.id)]),c=[];for(let s of g)for(let m of t.outEdges(s))g.has(m.to)&&c.push({kind:m.kind,from:m.from,to:m.to});let w=F(t,g,n.reads),S=new Set(c.map(s=>`${s.kind} ${s.from} ${s.to}`));for(let s of w.edges)S.has(`${s.kind} ${s.from} ${s.to}`)||c.push(s);let P=w.nodes.length>0?[...i??[],...w.nodes]:i,x=s=>s?.filter(m=>t.has(m)),T=e.permittedMutations(n.principal).map(s=>({name:s.name,title:s.title??s.name,...s.description!==void 0?{description:s.description}:{},...s.subject?{subject:{kinds:s.subject.kinds,arg:s.subject.arg}}:{}}));return{view:n.view,...f?{node:k(f)}:{},...P?{nodes:P.map(k)}:{},edges:c,...r.label!==void 0?{label:r.label}:{},...r.fidelity!==void 0?{fidelity:r.fidelity}:{},...r.cardinality!==void 0?{cardinality:r.cardinality}:{},...r.mode!==void 0?{mode:r.mode}:{},...r.selected!==void 0?{selected:r.selected}:{},...r.implicated?{implicated:x(r.implicated)}:{},...r.flagged?{flagged:x(r.flagged)}:{},acts:T,...n.theme?{theme:n.theme()}:{},locale:M(),timeZone:H(),...n.placesShown?{places:n.placesShown().map(({as:s,title:m,kind:$})=>({as:s,title:m,kind:$}))}:{}}},h=!1,u=0,a=()=>{if(h)return;u+=1;let e=b();n.send({type:"props",props:n.hand?n.hand(e):e,push:u})},v=!1,E=n.store.subscribe(()=>{v||(v=!0,queueMicrotask(()=>{v=!1,a()}))}),G=(e,t)=>(o.refused+=1,{ok:!1,reason:e,message:t}),j=(e,t,r)=>R([{name:e,args:t}],r),R=(e,t,r)=>{if(!l.act())return G("rate-limited","Too many acts asked for at once; this one was not applied.");let f=[];for(let{name:i,args:g}of e){if(t){let c=t(i,g);if(!c.ok)return G(c.reason,c.message);i=c.name,g=c.args}if(!n.store.allMutations().some(c=>c.name===i))return G("unknown-act","There is no act by that name here.");f.push({name:i,args:g})}try{let i=n.store.applyAll(f,{author:n.principal,via:d,...r?{intent:r}:{}});return o.applied+=1,{ok:!0,intent:i.intent}}catch(i){return i instanceof N?G("refused",i.refusal.message):G("failed","The act could not be applied.")}},O=(e,t,r)=>{let f=Array.isArray(r);if(typeof t!="string"||(f?r.length===0||r.length>100||!r.every(A):!A(r)))return o.refused+=1,n.send({type:"answer",id:e,ok:!1,reason:"malformed",message:"An act is asked for by name, with its arguments as an object, or a list of 1 to 100 of them for several as one change."});let i=R((f?r:[r]).map(g=>({name:t,args:g})),n.judgeAct);n.send(i.ok?{type:"answer",id:e,ok:!0,intent:i.intent}:{type:"answer",id:e,ok:!1,reason:i.reason,message:i.message})};return{receive(e){if(!h){if(!l.message()){o.dropped+=1,n.onFlood?.();return}if(!A(e)||e.nonce!==n.nonce){o.dropped+=1;return}if(e.type==="act"&&(typeof e.id=="string"||typeof e.id=="number"))return O(e.id,e.name,e.args);if(e.type==="navigate"&&n.onArrive&&(typeof e.place=="string"||typeof e.to=="string")){let t={...e.where!==void 0?{where:e.where}:{},...e.section!==void 0?{section:e.section}:{}},r=typeof e.place=="string"?{place:e.place,...t}:{record:e.to,...t},f=n.onArrive;z().then(({judgeDestination:i,listsOf:g})=>{if(h)return;let c=new Set([...n.store.kindsKeptFrom(n.principal),...n.store.modules.disabledKinds]),w=i(r,{sees:S=>p().graph.has(S),places:n.placesShown?.()??[],lists:g(n.store.schema,c),schema:n.store.schema});w.ok?f(w.arrival):(o.dropped+=1,n.onLost?.(w.says))});return}if(e.type==="navigate"&&typeof e.place=="string"){n.places?.().includes(e.place)?n.onNavigatePlace?.(e.place):o.dropped+=1;return}if(e.type==="navigate"&&typeof e.to=="string"){p().graph.has(e.to)?n.onNavigate?.(e.to):o.dropped+=1;return}if(e.type==="render"&&Array.isArray(e.records)&&n.onRender){n.onRender(e.records);return}if(e.type==="style"&&typeof e.css=="string"&&n.onStyle){n.onStyle(e.css);return}if(e.type==="hears"&&Array.isArray(e.events)&&n.onHears){n.onHears(e.events.filter(t=>typeof t=="string").slice(0,20));return}if(e.type==="gestures"&&Array.isArray(e.bound)&&n.onGestures){n.onGestures(e.bound.slice(0,32));return}if(e.type==="pushed"&&typeof e.push=="number"&&typeof e.ms=="number"&&n.onPushed){n.onPushed(e.push,e.ms);return}if(e.type==="size"&&typeof e.height=="number"&&Number.isFinite(e.height)){n.onSize?.(Math.max(0,Math.min(y,Math.round(e.height))));return}o.dropped+=1}},push:a,pressed(e){return h?{ok:!1,reason:"refused",message:"The view has gone."}:e.ok?j(e.name,e.args):(o.refused+=1,e)},change(e,t){return h?{ok:!1,reason:"refused",message:"The view has gone."}:R(e,void 0,t)},get stats(){return o},dispose(){h=!0,E()}}}export{F as a,D as b,K as c,J as d};
@@ -1 +0,0 @@
1
- import{a}from"./chunk.P546VMA5.js";import"./chunk.P5K7EYDK.js";import"./chunk.7PUFYK3B.js";import"./chunk.QJJKITXF.js";import"./chunk.7AEE3VHC.js";import"./chunk.LKF4BBCW.js";import"./chunk.JUT2VCFW.js";import"./chunk.UT6642FC.js";import{b as n}from"./chunk.IQWKEGWG.js";import"./chunk.QNJYXB3U.js";import"./chunk.TI4OSTQV.js";import"./chunk.GZHZLJBF.js";import"./chunk.ATKKTPJS.js";import"./chunk.OJGHDWI6.js";import"./chunk.UZSZPMRC.js";import"./chunk.MZOIPCDA.js";import"./chunk.KERLVJ6I.js";import"./chunk.4EPT2CQG.js";import"./chunk.FNXW46U4.js";import{R as i}from"./chunk.4JWT6LIS.js";import"./chunk.SDO3U72B.js";import"./chunk.AW2T3KFV.js";import"./chunk.2AZTW66C.js";import{b as o}from"./chunk.AJZBJBMO.js";var e=o(i(),1);function g({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{g as RecordInteractions};
@@ -1,3 +0,0 @@
1
- var l={},O={empty:!0},Se={id:"text",class:"text",title:"text",lang:"text",dir:{oneOf:["ltr","rtl","auto"]},hidden:"text",tabindex:{oneOf:["-1","0"]},role:"text",style:"style",translate:{oneOf:["yes","no"]},spellcheck:{oneOf:["true","false"]},draggable:{oneOf:["true","false"]},inert:"boolean"},A={div:l,section:l,article:l,aside:l,header:l,footer:l,nav:l,hgroup:l,search:l,address:l,figure:l,figcaption:l,blockquote:l,p:l,pre:l,hr:O,br:O,wbr:O,h1:l,h2:l,h3:l,h4:l,h5:l,h6:l,span:l,strong:l,em:l,b:l,i:l,u:l,s:l,small:l,mark:l,abbr:l,cite:l,q:l,code:l,kbd:l,samp:l,var:l,sub:l,sup:l,dfn:l,bdi:l,bdo:l,ruby:l,rt:l,rp:l,time:{attributes:{datetime:"text"}},data:{attributes:{value:"text"}},del:{attributes:{datetime:"text"}},ins:{attributes:{datetime:"text"}},a:l,ul:l,menu:l,dl:l,dt:l,dd:l,ol:{attributes:{start:"number",reversed:"boolean",type:{oneOf:["1","a","A","i","I"]}}},li:{attributes:{value:"number"}},table:l,caption:l,thead:l,tbody:l,tfoot:l,tr:l,colgroup:{attributes:{span:"number"}},col:{attributes:{span:"number"},empty:!0},th:{attributes:{colspan:"number",rowspan:"number",headers:"text",scope:{oneOf:["row","col","rowgroup","colgroup"]},abbr:"text"}},td:{attributes:{colspan:"number",rowspan:"number",headers:"text"}},details:{attributes:{open:"boolean",name:"text"}},summary:l,button:{attributes:{type:{oneOf:["button"]},disabled:"boolean",name:"text",value:"text"}},input:{empty:!0,attributes:{type:{oneOf:["text","search","number","range","checkbox","radio","date","time","datetime-local","month","week","color","email","tel","url"]},name:"text",value:"text",placeholder:"text",min:"text",max:"text",step:"text",checked:"boolean",disabled:"boolean",readonly:"boolean",required:"boolean",maxlength:"number",minlength:"number",size:"number",pattern:"text",multiple:"boolean",inputmode:"text",enterkeyhint:"text"}},select:{attributes:{name:"text",disabled:"boolean",multiple:"boolean",required:"boolean",size:"number"}},option:{attributes:{value:"text",selected:"boolean",disabled:"boolean",label:"text"}},optgroup:{attributes:{label:"text",disabled:"boolean"}},textarea:{attributes:{name:"text",placeholder:"text",rows:"number",cols:"number",disabled:"boolean",readonly:"boolean",required:"boolean",maxlength:"number",minlength:"number",wrap:{oneOf:["soft","hard","off"]}}},label:{attributes:{for:"text"}},fieldset:{attributes:{disabled:"boolean",name:"text"}},legend:l,output:l,meter:{attributes:{value:"number",min:"number",max:"number",low:"number",high:"number",optimum:"number"}},progress:{attributes:{value:"number",max:"number"}},img:{empty:!0,attributes:{src:"image",alt:"text",width:"number",height:"number",decoding:{oneOf:["async","sync","auto"]}}},"graview-video":O},Ee=["fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-dasharray","stroke-dashoffset","stroke-opacity","stroke-miterlimit","opacity","color","display","visibility","transform-origin","clip-path","clip-rule","marker-start","marker-mid","marker-end","font-family","font-size","font-weight","font-style","text-anchor","dominant-baseline","alignment-baseline","letter-spacing","text-decoration","paint-order","vector-effect","shape-rendering","pointer-events","stop-color","stop-opacity","overflow","mask"],Oe={id:"text",class:"text",style:"style",lang:"text",role:"text",tabindex:{oneOf:["-1","0"]},transform:"geometry",...Object.fromEntries(Ee.map(e=>[e,"css"]))},w={x:"geometry",y:"geometry",width:"geometry",height:"geometry"},R={viewBox:"geometry",preserveAspectRatio:"geometry"},X={gradientUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},gradientTransform:"geometry",spreadMethod:{oneOf:["pad","reflect","repeat"]},href:"fragment"},_={svg:{attributes:{...w,...R}},g:l,defs:l,symbol:{attributes:{...w,...R,refX:"geometry",refY:"geometry"}},use:{attributes:{...w,href:"fragment"}},title:l,desc:l,path:{attributes:{d:"geometry",pathLength:"number"}},rect:{attributes:{...w,rx:"geometry",ry:"geometry",pathLength:"number"}},circle:{attributes:{cx:"geometry",cy:"geometry",r:"geometry",pathLength:"number"}},ellipse:{attributes:{cx:"geometry",cy:"geometry",rx:"geometry",ry:"geometry",pathLength:"number"}},line:{attributes:{x1:"geometry",y1:"geometry",x2:"geometry",y2:"geometry",pathLength:"number"}},polyline:{attributes:{points:"geometry",pathLength:"number"}},polygon:{attributes:{points:"geometry",pathLength:"number"}},text:{attributes:{x:"geometry",y:"geometry",dx:"geometry",dy:"geometry",rotate:"geometry",textLength:"geometry",lengthAdjust:{oneOf:["spacing","spacingAndGlyphs"]}}},tspan:{attributes:{x:"geometry",y:"geometry",dx:"geometry",dy:"geometry",rotate:"geometry",textLength:"geometry"}},textPath:{attributes:{href:"fragment",startOffset:"geometry",method:{oneOf:["align","stretch"]},spacing:{oneOf:["auto","exact"]},side:{oneOf:["left","right"]}}},linearGradient:{attributes:{x1:"geometry",y1:"geometry",x2:"geometry",y2:"geometry",...X}},radialGradient:{attributes:{cx:"geometry",cy:"geometry",r:"geometry",fx:"geometry",fy:"geometry",fr:"geometry",...X}},stop:{attributes:{offset:"geometry"}},clipPath:{attributes:{clipPathUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]}}},mask:{attributes:{...w,maskUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},maskContentUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]}}},pattern:{attributes:{...w,...R,patternUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},patternContentUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},patternTransform:"geometry",href:"fragment"}},marker:{attributes:{...R,markerWidth:"geometry",markerHeight:"geometry",refX:"geometry",refY:"geometry",orient:"geometry",markerUnits:{oneOf:["strokeWidth","userSpaceOnUse"]}}}};var q=["alert","alertdialog","dialog","banner","main","navigation","contentinfo","complementary","search","form","region","application","status","log","marquee","timer"],v={nav:"div",header:"div",footer:"div",aside:"div",search:"div",output:"span"},Y={section:["aria-label","aria-labelledby","title"]};function Re(e){return/^aria-[a-z]+$/.test(e)}function Ae(e){return/^data-[a-z0-9][a-z0-9_.-]*$/.test(e)}var K=["all","display","position","top","right","bottom","left","inset","inset-block","inset-inline","inset-block-start","inset-block-end","inset-inline-start","inset-inline-end","width","height","min-width","min-height","max-width","max-height","inline-size","block-size","min-inline-size","min-block-size","max-inline-size","max-block-size","margin","margin-top","margin-right","margin-bottom","margin-left","margin-block","margin-inline","margin-block-start","margin-block-end","margin-inline-start","margin-inline-end","padding","padding-top","padding-right","padding-bottom","padding-left","padding-block","padding-inline","padding-block-start","padding-block-end","padding-inline-start","padding-inline-end","box-sizing","overflow","overflow-x","overflow-y","overflow-wrap","float","clear","z-index","aspect-ratio","object-fit","object-position","vertical-align","isolation","contain","container","container-type","container-name","content-visibility","flex","flex-direction","flex-wrap","flex-flow","flex-grow","flex-shrink","flex-basis","order","grid","grid-template","grid-template-columns","grid-template-rows","grid-template-areas","grid-auto-columns","grid-auto-rows","grid-auto-flow","grid-area","grid-column","grid-row","grid-column-start","grid-column-end","grid-row-start","grid-row-end","gap","row-gap","column-gap","align-items","align-content","align-self","justify-items","justify-content","justify-self","place-items","place-content","place-self","columns","column-count","column-width","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-fill","color","background","background-color","background-image","background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode","border","border-top","border-right","border-bottom","border-left","border-block","border-inline","border-block-start","border-block-end","border-inline-start","border-inline-end","border-width","border-style","border-color","border-top-width","border-right-width","border-bottom-width","border-left-width","border-top-style","border-right-style","border-bottom-style","border-left-style","border-top-color","border-right-color","border-bottom-color","border-left-color","border-radius","border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius","border-start-start-radius","border-start-end-radius","border-end-start-radius","border-end-end-radius","border-collapse","border-spacing","outline","outline-width","outline-style","outline-color","outline-offset","box-shadow","opacity","visibility","mix-blend-mode","filter","backdrop-filter","clip-path","accent-color","caret-color","color-scheme","appearance","-webkit-appearance","font","font-family","font-size","font-weight","font-style","font-stretch","font-variant","font-variant-numeric","font-variant-caps","font-variant-ligatures","font-feature-settings","font-variation-settings","font-kerning","font-optical-sizing","font-size-adjust","font-synthesis","line-height","letter-spacing","word-spacing","text-align","text-align-last","text-indent","text-transform","text-decoration","text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","text-underline-position","text-shadow","text-overflow","text-wrap","text-wrap-mode","text-wrap-style","white-space","white-space-collapse","word-break","line-break","hyphens","tab-size","direction","unicode-bidi","writing-mode","text-orientation","text-rendering","-webkit-font-smoothing","-webkit-line-clamp","-webkit-box-orient","line-clamp","-webkit-text-fill-color","-webkit-background-clip","list-style","list-style-type","list-style-position","content","quotes","counter-reset","counter-increment","counter-set","table-layout","caption-side","empty-cells","transform","transform-origin","transform-box","transform-style","translate","rotate","scale","perspective","perspective-origin","backface-visibility","transition","transition-property","transition-duration","transition-timing-function","transition-delay","transition-behavior","animation","animation-name","animation-duration","animation-timing-function","animation-delay","animation-iteration-count","animation-direction","animation-fill-mode","animation-play-state","animation-composition","will-change","cursor","pointer-events","user-select","-webkit-user-select","touch-action","resize","scroll-behavior","overscroll-behavior","overscroll-behavior-x","overscroll-behavior-y","scroll-snap-type","scroll-snap-align","scroll-snap-stop","scroll-margin","scroll-padding","scrollbar-width","scrollbar-color","scrollbar-gutter","fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-dasharray","stroke-dashoffset","stroke-opacity","stroke-miterlimit","stop-color","stop-opacity","clip-rule","marker","marker-start","marker-mid","marker-end","paint-order","vector-effect","shape-rendering","text-anchor","dominant-baseline","alignment-baseline","r","cx","cy","rx","ry","x","y","d","mask"],Z=["var","env","calc","min","max","clamp","round","mod","rem","abs","sign","sin","cos","tan","asin","acos","atan","atan2","pow","sqrt","hypot","log","exp","rgb","rgba","hsl","hsla","hwb","lab","lch","oklab","oklch","color","color-mix","light-dark","linear-gradient","radial-gradient","conic-gradient","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","translate","translatex","translatey","translatez","translate3d","rotate","rotatex","rotatey","rotatez","rotate3d","scale","scalex","scaley","scalez","scale3d","skew","skewx","skewy","matrix","matrix3d","perspective","cubic-bezier","steps","linear","repeat","minmax","fit-content","blur","brightness","contrast","drop-shadow","grayscale","hue-rotate","invert","saturate","sepia","opacity","circle","ellipse","inset","polygon","path","xywh","rect","counter","counters"],J=["fill","stroke","clip-path","mask","marker","marker-start","marker-mid","marker-end"],Q=["media","supports","container","keyframes"],ee={position:["static","relative","absolute","sticky"],all:[],appearance:["auto","none","menulist-button","textfield"],"-webkit-appearance":["auto","none","menulist-button","textfield"]},te=["host","host-context","slotted","part","backdrop","picker","view-transition","view-transition-group","view-transition-image-pair","view-transition-old","view-transition-new"],j=64e3,M=4e3,ne=1e5,S=512e3,Ke=1e4,Ze="http://www.w3.org/1999/xhtml",Je="http://www.w3.org/2000/svg",_e=new Map(Object.keys(_).map(e=>[e.toLowerCase(),e]));function re(e){return _e.get(e.toLowerCase())}function oe(e,r,n){let t=n.toLowerCase(),i=e==="html"?[A[r]?.attributes,Se]:[_[r]?.attributes,Oe],o=e==="svg"&&t==="xlink:href"?"href":t;for(let a of i)if(a){for(let[u,c]of Object.entries(a))if(u.toLowerCase()===o)return{name:u,kind:c}}if(Re(t)||Ae(t))return{name:t,kind:"text"}}var f=e=>e>=48&&e<=57,ie=e=>f(e)||e>=65&&e<=70||e>=97&&e<=102,B=e=>e>=65&&e<=90||e>=97&&e<=122,F=e=>e>=128,T=e=>B(e)||F(e)||e===95,ae=e=>T(e)||f(e)||e===45,se=e=>e===10,h=e=>e===10||e===9||e===32,Te=e=>e>=0&&e<=8||e===11||e>=14&&e<=31||e===127,y=-1;function Pe(e){let r=[];for(let n=0;n<e.length;n+=1){let t=e.codePointAt(n);t>65535&&(n+=1),t===13?(e.charCodeAt(n+1)===10&&(n+=1),t=10):t===12?t=10:(t===0||t>=55296&&t<=57343)&&(t=65533),r.push(t)}return r}function $e(e){let r=Pe(e),n=0,t=(s=0)=>n+s<r.length?r[n+s]:y,i=[],o=(s,d)=>s===92&&d!==10&&d!==y,a=(s,d,m)=>s===45?T(d)||d===45||o(d,m):T(s)?!0:o(s,d),u=(s,d,m)=>s===43||s===45?f(d)||d===46&&f(m):f(s===46?d:s),c=()=>{let s=t();if(n+=1,s===y)return 65533;if(ie(s)){let d=String.fromCodePoint(s);for(;d.length<6&&ie(t());)d+=String.fromCodePoint(t()),n+=1;h(t())&&(n+=1);let m=parseInt(d,16);return m===0||m>=55296&&m<=57343||m>1114111?65533:m}return s},p=()=>{let s="";for(;;){let d=t();if(ae(d))s+=String.fromCodePoint(d),n+=1;else if(o(d,t(1)))n+=1,s+=String.fromCodePoint(c());else return s}},g=()=>{let s="";for((t()===43||t()===45)&&(s+=String.fromCodePoint(r[n++]));f(t());)s+=String.fromCodePoint(r[n++]);if(t()===46&&f(t(1)))for(s+=String.fromCodePoint(r[n++],r[n++]);f(t());)s+=String.fromCodePoint(r[n++]);if((t()===69||t()===101)&&(f(t(1))||(t(1)===43||t(1)===45)&&f(t(2))))for(s+=String.fromCodePoint(r[n++]),f(t())||(s+=String.fromCodePoint(r[n++]));f(t());)s+=String.fromCodePoint(r[n++]);return s},E=()=>{let s=g();return a(t(),t(1),t(2))?{type:"dimension",repr:s,unit:p()}:t()===37?(n+=1,{type:"percentage",repr:s}):{type:"number",repr:s}},b=()=>{for(;;){let s=t();if(n+=1,s===41||s===y)return;o(s,t())&&c()}},Ce=()=>{let s="";for(;h(t());)n+=1;for(;;){let d=t();if(n+=1,d===41)return{type:"url",value:s};if(d===y)return{type:"url",value:s};if(h(d)){for(;h(t());)n+=1;return t()===41||t()===y?(t()===41&&(n+=1),{type:"url",value:s}):(b(),{type:"bad-url"})}if(d===34||d===39||d===40||Te(d))return b(),{type:"bad-url"};if(d===92){if(o(d,t()))s+=String.fromCodePoint(c());else return b(),{type:"bad-url"};continue}s+=String.fromCodePoint(d)}},z=()=>{let s=p();if(s.toLowerCase()==="url"&&t()===40){for(n+=1;h(t())&&h(t(1));)n+=1;let d=h(t())?t(1):t();return d===34||d===39?{type:"function",value:s}:Ce()}return t()===40?(n+=1,{type:"function",value:s}):{type:"ident",value:s}},ve=s=>{let d="";for(;;){let m=t();if(n+=1,m===s||m===y)return{type:"string",value:d};if(se(m))return n-=1,{type:"bad-string"};if(m===92){if(t()===y)continue;if(se(t())){n+=1;continue}d+=String.fromCodePoint(c());continue}d+=String.fromCodePoint(m)}};for(;;){for(;t()===47&&t(1)===42;){for(n+=2;t()!==y&&!(t()===42&&t(1)===47);)n+=1;t()!==y&&(n+=2)}let s=t();if(s===y)return i;if(h(s)){for(;h(t());)n+=1;i.push({type:"whitespace"});continue}switch(n+=1,s){case 34:case 39:i.push(ve(s));continue;case 35:if(ae(t())||o(t(),t(1))){let d=a(t(),t(1),t(2));i.push({type:"hash",value:p(),id:d})}else i.push({type:"delim",value:"#"});continue;case 40:i.push({type:"("});continue;case 41:i.push({type:")"});continue;case 43:case 46:u(s,t(),t(1))?(n-=1,i.push(E())):i.push({type:"delim",value:String.fromCodePoint(s)});continue;case 44:i.push({type:","});continue;case 45:u(s,t(),t(1))?(n-=1,i.push(E())):t()===45&&t(1)===62?(n+=2,i.push({type:"CDC"})):a(s,t(),t(1))?(n-=1,i.push(z())):i.push({type:"delim",value:"-"});continue;case 58:i.push({type:":"});continue;case 59:i.push({type:";"});continue;case 60:t()===33&&t(1)===45&&t(2)===45?(n+=3,i.push({type:"CDO"})):i.push({type:"delim",value:"<"});continue;case 64:a(t(),t(1),t(2))?i.push({type:"at-keyword",value:p()}):i.push({type:"delim",value:"@"});continue;case 91:i.push({type:"["});continue;case 92:o(s,t())?(n-=1,i.push(z())):i.push({type:"delim",value:"\\"});continue;case 93:i.push({type:"]"});continue;case 123:i.push({type:"{"});continue;case 125:i.push({type:"}"});continue;default:f(s)?(n-=1,i.push(E())):T(s)?(n-=1,i.push(z())):i.push({type:"delim",value:String.fromCodePoint(s)})}}}var pe={"{":"}","[":"]","(":")"},fe=32,D=class{constructor(r){this.tokens=r}i=0;peek(){return this.tokens[this.i]}next(){return this.tokens[this.i++]}};function me(e,r){let n=e.next();return n.type==="{"||n.type==="["||n.type==="("?{type:"block",open:n.type,value:le(e,pe[n.type],r+1)}:n.type==="function"?{type:"func",name:n.value,value:le(e,")",r+1)}:n}function le(e,r,n){let t=[];for(;;){let i=e.peek();if(!i)return t;if(i.type===r)return e.next(),t;if(n>fe){e.next(),t.push({type:"bad-string"});continue}t.push(me(e,n))}}function k(e,r){let n=[],t=0;for(;t<e.length;){let i=e[t];if(i.type==="whitespace"||r&&(i.type==="CDO"||i.type==="CDC")){t+=1;continue}if(i.type==="at-keyword"){let u=[];t+=1;let c;for(;t<e.length;){let p=e[t];if(t+=1,p.type===";")break;if(p.type==="block"&&p.open==="{"){c=p.value;break}u.push(p)}n.push({type:"at-rule",name:i.value,prelude:u,...c?{block:c}:{}});continue}let o=[],a;for(;t<e.length;){let u=e[t];if(t+=1,u.type==="block"&&u.open==="{"){a=u.value;break}o.push(u)}a&&n.push({type:"qualified",prelude:o,block:a})}return n}function H(e){let r=[],n=0;for(;n<e.length;){let t=e[n];if(t.type==="whitespace"||t.type===";"){n+=1;continue}if(t.type==="at-keyword"){let o=(()=>{for(let a=n+1;a<e.length;a+=1){let u=e[a];if(u.type===";"||u.type==="block"&&u.open==="{")return a+1}return e.length})();r.push(...k(e.slice(n,o),!1)),n=o;continue}if(t.type==="ident"){let o=n+1;for(;e[o]?.type==="whitespace";)o+=1;if(e[o]?.type===":"){let a=o+1;for(;a<e.length&&e[a].type!==";";)a+=1;let u=ge(t.value,e.slice(o+1,a));if(u.value.some(c=>c.type==="block"&&c.open==="{")){let c=e.findIndex((p,g)=>g>n&&p.type==="block"&&p.open==="{");r.push(...k(e.slice(n,c+1),!1)),n=c+1;continue}r.push(u),n=a+1;continue}}let i=n;for(;i<e.length&&!(e[i].type==="block"&&e[i].open==="{")&&e[i].type!==";";)i+=1;i<e.length&&e[i].type==="block"&&r.push(...k(e.slice(n,i+1),!1)),n=i+1}return r}function ge(e,r){let n=[...r];for(;n[0]?.type==="whitespace";)n.shift();for(;n.at(-1)?.type==="whitespace";)n.pop();let t=!1,o=n.length-1;if(n[o]?.type==="ident"&&n[o].value.toLowerCase()==="important"){for(o-=1;n[o]?.type==="whitespace";)o-=1;let a=n[o];if(a?.type==="delim"&&a.value==="!")for(t=!0,n.length=o;n.at(-1)?.type==="whitespace";)n.pop()}return{type:"declaration",name:e,value:n,important:t}}function W(e){let r=new D($e(e)),n=[];for(;r.peek();)n.push(me(r,0));return n}function P(e){let r="",n=[...e].map(t=>t.codePointAt(0));return n.forEach((t,i)=>{t===0?r+="\uFFFD":t>=1&&t<=31||t===127||i===0&&f(t)||i===1&&f(t)&&n[0]===45?r+=`\\${t.toString(16)} `:i===0&&t===45&&n.length===1?r+="\\-":F(t)||t===45||t===95||f(t)||B(t)?r+=String.fromCodePoint(t):r+=`\\${String.fromCodePoint(t)}`}),r}function $(e){let r="";for(let n of e){let t=n.codePointAt(0);F(t)||t===45||t===95||f(t)||B(t)?r+=n:t>=1&&t<=31||t===127?r+=`\\${t.toString(16)} `:r+=`\\${n}`}return r}function U(e){let r='"';for(let n of e){let t=n.codePointAt(0);t===0?r+="\uFFFD":t>=1&&t<=31||t===127||t===60||t===62?r+=`\\${t.toString(16)} `:t===34||t===92?r+=`\\${n}`:r+=n}return`${r}"`}function Ne(e){let r=$(e);return/^[eE]([0-9]|[+-][0-9])/.test(e)?`\\${e.codePointAt(0).toString(16)} ${$(e.slice(1))}`:r}var ue=e=>{switch(e.type){case"ident":case"url":case"bad-url":case"number":case"percentage":case"dimension":case"CDC":case"hash":case"at-keyword":return e.type;case"func":case"function":return"function";case"block":return e.open==="("?"(":"other";case"(":return"(";case"delim":return`delim${e.value}`;default:return"other"}};function Le(e,r){let n=["ident","function","url","bad-url","delim-","number","percentage","dimension","CDC"];return e==="ident"?[...n,"("].includes(r):e==="at-keyword"||e==="hash"||e==="dimension"||e==="delim#"||e==="delim-"?n.includes(r):e==="number"?["ident","function","url","bad-url","number","percentage","dimension","delim%"].includes(r):e==="delim@"?["ident","function","url","bad-url","delim-","CDC"].includes(r):e==="delim."||e==="delim+"?["number","percentage","dimension"].includes(r):e==="delim/"?r==="delim*":!1}function ze(e){switch(e.type){case"whitespace":return" ";case"ident":return P(e.value);case"at-keyword":return`@${P(e.value)}`;case"hash":return`#${$(e.value)}`;case"string":return U(e.value);case"url":return`url(${U(e.value)})`;case"delim":return e.value==="\\"?`\\
2
- `:e.value;case"CDO":return"<!--";case"CDC":return"-->";case"number":return e.repr;case"percentage":return`${e.repr}%`;case"dimension":return`${e.repr}${Ne(e.unit)}`;case"func":return`${P(e.name)}(${C(e.value)})`;case"block":return`${e.open}${C(e.value)}${pe[e.open]}`;case":":case";":case",":case"[":case"]":case"(":case")":case"{":case"}":return e.type;default:return""}}function C(e){let r="",n;for(let t of e)t.type==="whitespace"&&n?.type==="whitespace"||(n&&Le(ue(n),ue(t))&&(r+="/**/"),r+=ze(t),n=t);return r}var je=new Set(K),ye=new Set(Z),de=new Set(J),Me=new Set(Q),Ve=new Set(te),ce=/^#[A-Za-z_][A-Za-z0-9_.:-]*$/,x=e=>e.replace(/[A-Z]/g,r=>r.toLowerCase()),De=e=>x(e);function I(e,r,n){let t=[];for(let i of r){if(i.type==="bad-url"||i.type==="bad-string"){n({reason:"unreadable",...e?{name:e}:{}});return}if(i.type==="url"){if(e&&de.has(e)&&ce.test(i.value)){t.push({type:"func",name:"url",value:[{type:"string",value:i.value}]});continue}n({reason:"url",...e?{name:e}:{}});return}if(i.type==="func"){let o=x(i.name);if(o==="url"||o==="src"){let u=i.value.filter(p=>p.type!=="whitespace"),c=u[0];if(o==="url"&&u.length===1&&c?.type==="string"&&e&&de.has(e)&&ce.test(c.value)){t.push({type:"func",name:"url",value:[{type:"string",value:c.value}]});continue}n({reason:"url",...e?{name:e}:{}});return}if(!ye.has(o)){n({reason:"function",name:o});return}let a=I(e,i.value,n);if(!a)return;o==="var"?t.push({type:"whitespace"},{type:"func",name:o,value:a},{type:"whitespace"}):t.push({type:"func",name:o,value:a});continue}if(i.type==="block"){if(i.open==="{"||i.open==="("&&t.at(-1)?.type==="ident"){n({reason:"unreadable",...e?{name:e}:{}});return}let o=I(e,i.value,n);if(!o)return;t.push({type:"block",open:i.open,value:o});continue}if(i.type==="at-keyword"||i.type==="CDO"||i.type==="CDC"||i.type==="{"||i.type==="}"||i.type===";"||i.type==="delim"&&i.value==="\\"){n({reason:"unreadable",...e?{name:e}:{}});return}t.push(i)}return t}function L(e,r){let n=e.name.startsWith("--"),t=n?e.name:De(e.name);if(!n&&!je.has(t)){r({reason:"property",name:t});return}let i=ee[t];if(i){let u=e.value.filter(g=>g.type!=="whitespace"),c=u[0],p=u.length===1&&c?.type==="ident"?x(c.value):void 0;if(!p||![...i,"inherit","initial","unset","revert"].includes(p)){r({reason:"value",name:t});return}return`${t}: ${p}${e.important?" !important":""}`}let o=I(n?void 0:t,e.value,r);if(!o)return;let a=C(o).trim();return`${n?`--${$(e.name.slice(2))}`:t}: ${a}${e.important?" !important":""}`}function be(e,r){let n=t=>{for(let i=0;i<t.length;i+=1){let o=t[i];if(i>0&&t[i-1].type===":"&&(o.type==="ident"||o.type==="func")){let u=x(o.type==="ident"?o.value:o.name);if(Ve.has(u)||u.startsWith("-webkit-")||u.startsWith("-moz-"))return r({reason:"selector",name:u}),!1}if(o.type==="url"||o.type==="bad-url"||o.type==="bad-string"||o.type==="at-keyword"||o.type==="CDO"||o.type==="CDC"||o.type==="block"&&o.open==="{")return r({reason:"unreadable",name:"selector"}),!1;if(o.type==="func"&&!n(o.value)||o.type==="block"&&!n(o.value))return!1}return!0};return n(e)}function V(e,r,n){let t=[];for(let i of H(e))if(i.type==="declaration"){let o=L(i,r);o&&t.push(`${o};`)}else{let o=N(i,r,n+1,"style");o&&t.push(o)}return t.join(" ")}function Ue(e,r,n){let t=i=>i.every(o=>{if(o.type==="url"||o.type==="bad-url"||o.type==="bad-string"||o.type==="block"&&o.open==="{")return n({reason:o.type==="url"?"url":"unreadable",name:`@${r}`}),!1;if(o.type==="func"){let a=x(o.name);return r==="supports"&&a==="selector"?be(o.value,n):ye.has(a)?t(o.value):(n({reason:"function",name:a}),!1)}if(o.type==="block"){if(r==="supports"){let a=H(o.value);if(a.length===1&&a[0].type==="declaration")return L(a[0],n)!==void 0}return t(o.value)}return!0});return t(e)?C(e).trim():void 0}function G(e){return e.map((r,n)=>{let t=e[n-1],i=t?.type===":"||t?.type==="delim"&&(t.value==="."||t.value==="|");return r.type==="ident"&&!i&&Object.prototype.hasOwnProperty.call(v,x(r.value))?{type:"block",open:"[",value:[{type:"ident",value:"data-graview-as"},{type:"delim",value:"="},{type:"string",value:x(r.value)}]}:r.type==="func"?{type:"func",name:r.name,value:G(r.value)}:r.type==="block"&&r.open==="("?{type:"block",open:"(",value:G(r.value)}:r})}function N(e,r,n,t){if(n>fe){r({reason:"unreadable",name:"nesting"});return}if(e.type==="qualified"){if(t==="keyframes"){if(!e.prelude.every(g=>g.type==="whitespace"||g.type===","||g.type==="percentage"||g.type==="ident"&&["from","to"].includes(x(g.value)))){r({reason:"unreadable",name:"keyframe"});return}return`${C(e.prelude).trim()} { ${V(e.block,r,n)} }`}if(!be(e.prelude,r))return;let c=C(G(e.prelude)).trim();if(c===""){r({reason:"unreadable",name:"selector"});return}return`${c} { ${V(e.block,r,n)} }`}let i=x(e.name),o=i==="-webkit-keyframes"?"keyframes":i;if(!Me.has(o)||t==="keyframes"){r({reason:"at-rule",name:`@${i}`});return}if(!e.block){r({reason:"unreadable",name:`@${i}`});return}if(o==="keyframes"){if(t!=="sheet"){r({reason:"at-rule",name:"@keyframes"});return}let c=e.prelude.filter(b=>b.type!=="whitespace"),p=c[0];if(c.length!==1||!p||p.type!=="ident"&&p.type!=="string"){r({reason:"unreadable",name:"@keyframes"});return}let g=k(e.block,!1).map(b=>N(b,r,n+1,"keyframes")).filter(b=>b!==void 0);return`@keyframes ${p.type==="ident"?P(p.value):U(p.value)} { ${g.join(" ")} }`}let a=Ue(e.prelude,o,r);if(a===void 0)return;let u=t==="style"?V(e.block,r,n):k(e.block,!1).map(c=>N(c,r,n+1,"sheet")).filter(c=>c!==void 0).join(" ");return`@${o} ${a} { ${u} }`}function tt(e,r=j){let n=[];if(e.length>r)return{css:"",refused:[{reason:"size"}]};let t=o=>void n.push(o);return{css:k(W(e),!0).map(o=>N(o,t,0,"sheet")).filter(o=>o!==void 0).join(`
3
- `),refused:n}}function he(e,r=j){let n=[];if(e.length>r)return{css:"",refused:[{reason:"size"}]};let t=o=>void n.push(o),i=[];for(let o of H(W(e))){if(o.type!=="declaration"){t({reason:"unreadable",name:"a rule in a style attribute"});continue}let a=L(o,t);a&&i.push(a)}return{css:i.join("; "),refused:n}}function xe(e,r){let n,t=L(ge(e,W(r)),i=>n??=i);return t===void 0||n?{refused:n??{reason:"unreadable",name:e}}:{value:t.slice(t.indexOf(":")+1).trim()}}function it(e,r){if(r==="svg"){let t=re(e);return t?{namespace:"svg",name:t}:{refused:{reason:"element",element:e}}}let n=e.toLowerCase();return n==="svg"?{namespace:"svg",name:"svg"}:Object.prototype.hasOwnProperty.call(A,n)?Object.prototype.hasOwnProperty.call(v,n)?{namespace:"html",name:v[n],as:n}:{namespace:"html",name:n}:{refused:{reason:"element",element:e}}}function at(e,r){return(e==="html"?A[r]:_[r])?.empty===!0}var Ie=/^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/,Ge=/^[0-9A-Za-z\s.,+\-%()]*$/,Be=/^#[A-Za-z_][A-Za-z0-9_.:-]*$/,Fe=/^data:image\/(png|gif|jpeg|webp|avif|bmp|svg\+xml)(;[A-Za-z0-9=._+-]+)*,/i,He=/^\/graview\/assets\/[0-9a-f]{64}\.(png|gif|jpe?g|webp|avif|svg|ico)$/,we=/\/graview\/assets\/[0-9a-f]{64}\.(png|gif|jpe?g|webp|avif|svg|ico)$/,We=/^\/(?!\/)(?!(?:.*\/)?\.\.?(?:\/|$))(?!.*%(?:2e|2f|5c))[^\\\s?#"'<>]*$/i;function Xe(e,r){if(He.test(e))return e;let n=e;if(/^https?:\/\//i.test(e))try{let t=new URL(e);if(r==="null"||t.origin!==r||t.username!==""||t.password!==""||t.search!==""||t.hash!=="")return;n=e.slice(t.origin.length)}catch{return}if(We.test(n))return we.exec(n)?.[0]}function st(e,r={},n){let t=e.length>120?`${e.slice(0,119)}\u2026`:e,i=ke(r.origins),o=we.exec(e.split(/[?#]/)[0])?.[0],a=n!==void 0&&n>S?` It is a data: image of ${n.toLocaleString("en-US")} characters, more than the ${S.toLocaleString("en-US")} a view's own data: image may be. A picture on a record is drawn at any size by the src the host hands the view (pictures in its manifest), used as it was handed.`:o?r.assets?` It is the app's own image only by its path, or under the app's base on this page's origin: write it as its path, ${o}.`:" This host has not said where the app's own images live (asset, on the view's definition), so a view here cannot draw one by its path.":/^https:\/\//i.test(e)?i.length>0?` Its origin is not one the host lists for images (${i.join(", ")}).`:" The host lists no origin a view's images may come from (images.origins, on the view's definition).":"",u=["a data: image",...r.assets?["the app's own image by the path add_image answered (/graview/assets/<sha256>.<ext>)"]:[],"a picture on a record (pictures in its manifest)",...i.length>0?[`an https: image from ${i.join(", ")}`]:[]];return`The image "${t}" was not drawn.${a} A view here shows ${u.slice(0,-1).join(", ")} or ${u[u.length-1]}.`}function ke(e){return(e??[]).flatMap(r=>{try{let n=new URL(r);return n.protocol==="https:"&&n.hostname!==""&&n.username===""&&n.password===""?[n.origin]:[]}catch{return[]}})}function qe(e,r){if(!(!r||r.length===0||!/^https:\/\//i.test(e)))try{let n=new URL(e);return n.protocol!=="https:"||n.username!==""||n.password!==""?void 0:ke(r).includes(n.origin)?n.href:void 0}catch{return}}function lt(e,r,n,t,i){let o=oe(e,r,n);if(!o)return{refused:{reason:"attribute",element:r,name:n}};if(e==="html"&&Y[r]?.includes(o.name))return{refused:{reason:"attribute",element:r,name:n}};if(t===null)return{name:o.name,value:null};let a=Ye(o.name,o.kind,t,i);return"refused"in a?{refused:{...a.refused,element:r,...o.kind==="image"&&a.refused.reason==="url"?{address:t.slice(0,200),...t.length>S?{length:t.length}:{}}:{}}}:o.name==="role"&&a.value.split(/\s+/).some(u=>q.includes(u.toLowerCase()))?{refused:{reason:"value",element:r,name:n}}:o.name==="aria-live"&&!["polite","off"].includes(a.value.toLowerCase())?{refused:{reason:"value",element:r,name:n}}:{name:o.name,value:a.value,...a.dropped?{dropped:a.dropped.map(u=>({reason:u.reason==="url"?"url":"css",element:r,name:o.name,css:u}))}:{}}}function Ye(e,r,n,t){let i=(o,a)=>({refused:{reason:o,name:e,...a?{css:a}:{}}});if(r==="geometry")return n.length>ne||!Ge.test(n)||/url/i.test(n)?i("value"):{value:n};if(r==="image"){let o=t.picture?.(n);if(o!==void 0)return{value:o};if(n.length>S)return i("url");if(Fe.test(n))return{value:n};if(n.startsWith(`blob:${t.origin}/`)&&/^blob:[^\s"'<>]+$/.test(n))return{value:n};let a=t.asset?Xe(n,t.origin):void 0;if(a!==void 0){let c=t.asset(a);if(c)return{value:c}}let u=qe(n,t.imageOrigins);return u?{value:u}:i("url")}if(n.length>M)return i("value");if(typeof r=="object"){let o=r.oneOf.find(a=>a.toLowerCase()===n.toLowerCase());return o===void 0?i("value"):{value:o}}switch(r){case"text":return{value:n};case"number":return Ie.test(n.trim())&&Number.isFinite(Number(n))?{value:n.trim()}:i("value");case"boolean":return{value:""};case"fragment":return Be.test(n)?{value:n}:i("url");case"style":{let o=he(n,M);return o.refused.length>0&&o.css===""?i(o.refused[0].reason==="url"?"url":"css",o.refused[0]):{value:o.css,...o.refused.length>0?{dropped:o.refused}:{}}}case"css":{let o=xe(e,n);return"refused"in o?i(o.refused.reason==="url"?"url":"css",o.refused):{value:o.value}}}}export{Ke as a,Ze as b,Je as c,tt as d,it as e,at as f,st as g,lt as h};
@@ -1,2 +0,0 @@
1
- import{a as Se}from"./chunk.DAZEFSWI.js";import{e as ke,f as $e,i as ve,j as J,k as xe}from"./chunk.ESU2DD3J.js";import{f as he}from"./chunk.3IUJ4GW7.js";import{d as V,e as we}from"./chunk.KERLVJ6I.js";import{b as ye,e as be}from"./chunk.4EPT2CQG.js";import{Ab as ie,C as X,I as ne,Ic as me,Nb as q,Ob as ae,Yc as pe,ba as E,ca as K,ea as oe,fa as Y,ga as re,gc as le,gd as fe,ic as ce,ja as _,kc as de,la as se,od as ge,pc as L,qc as ue}from"./chunk.AW2T3KFV.js";function Be(n,r,t){let i=n.tryDefinition(r)?.fields.shape,e=X(i?.[t]),l=!1,a=!1;for(;e&&(e.type==="optional"||e.type==="default"||e.type==="nullable"||e.type==="prefault");)(e.type==="optional"||e.type==="nullable")&&(l=!0),(e.type==="default"||e.type==="prefault")&&(a=!0),e=X(e.innerType);if(e?.type!=="enum")return;let h=(e.entries?Object.values(e.entries):e.values??[]).filter(m=>typeof m=="string");return h.length>0?{values:h,empty:l&&!a}:void 0}function H(n,r,t){let i=Be(n,r,t);if(!i)return[];let e=n.tryDefinition(r),l=i.values.map(a=>({value:a,label:ye(e,t,a)}));return i.empty&&l.push({value:null,label:`No ${_(e,t).toLowerCase()}`}),l}function z(n,r,t){let i=n[r];return typeof i=="string"&&t.some(e=>e.value===i)?i:null}function Q(n,r,t,i,e=H(n.schema,t.kind,i)){return De(n,r,t,i,e).flatMap(l=>l.move?[l.move]:[])}function De(n,r,t,i,e=H(n.schema,t.kind,i)){let l=Ce(n.schema,n.allMutations(),t.kind,i,e),a=z(t,i,e),h=se(n.schema.tryDefinition(t.kind),t.kind),m=[];for(let{value:x,label:P,by:O,acts:B}of l){if(x===a)continue;let C,G,F;for(let s of B){let p=O==="step"?{[s.subject.arg]:t.id}:{[s.subject.arg]:t.id,[i]:x},w={name:s.name,args:p};if(!s.input.safeParse(p).success){F??=`${s.title??s.name} asks for more than the ${h} itself.`;continue}let k=n.permits(w,r);if(!k.ok){G??=k.refusal?.message??`You may not ${s.title??s.name}.`;continue}try{ie(n.graph,s,p)}catch(c){G??=c instanceof Error?c.message:String(c);continue}C={to:x,call:w,title:s.title??s.name};break}m.push(C?{to:x,label:P,move:C}:{to:x,label:P,why:G??F??`Nothing in this app moves a ${h} to ${P}.`})}return m}function Ce(n,r,t,i,e=H(n,t,i)){let l=Re(n,r,t,i),a=Ae(n,r,t,i);return e.flatMap(h=>{if(h.value===null)return[];let m=l.filter(x=>x.sets?.[i]===h.value);return[{value:h.value,label:h.label,by:m.length>0?"step":a.length>0?"value":"none",acts:m.length>0?m:a}]})}function Re(n,r,t,i){return r.filter(e=>e.subject!==void 0&&e.derived===void 0&&typeof e.sets?.[i]=="string"&&q(n,e).includes(t))}function Ae(n,r,t,i){let e=n.tryDefinition(t);return e?r.filter(l=>{if(!l.subject||!q(n,l).includes(t)||!ae(l,e).includes(i))return!1;let a=l.input.shape;return a!==void 0&&i in a}).sort((l,a)=>+(l.derived!==void 0)-+(a.derived!==void 0)):[]}var ee=(n,r)=>r&&n[r]!==void 0?String(n[r]):"";function Ie(n,r,t){let i=s=>n.tryDefinition(s)?r.nodesOfKind(s).filter(p=>E(n.tryDefinition(s),p)):[],e=i(t.rows),l=i(t.columns),a=new Set(e.map(s=>s.id)),h=new Set(l.map(s=>s.id)),m=r.allEdges(),x=[],P=t.link;if(typeof P=="string"){let s=c=>n.tryDefinition(c)?.edges?.[P]?.to,p=(s(t.columns)??[]).some(c=>c===t.rows||c==="*"),w=(s(t.rows)??[]).some(c=>c===t.columns||c==="*"),k=p||!w;for(let c of m){if(c.kind!==P)continue;let A=k?c.to:c.from,o=k?c.from:c.to;a.has(A)&&h.has(o)&&x.push({rowId:A,columnId:o,via:[]})}}else{let s=new Map(P.path.map(w=>[w,new Map]));for(let w of m){let k=s.get(w.kind);if(!k)continue;let c=k.get(w.from);c?c.push(w.to):k.set(w.from,[w.to]);let A=k.get(w.to);A?A.push(w.from):k.set(w.to,[w.from])}let p=new Set;for(let w of l){let k=[{id:w.id,via:[]}];for(let c of P.path){let A=[],o=new Set;for(let $ of k)for(let R of s.get(c).get($.id)??[])o.has(`${$.id}|${R}`)||(o.add(`${$.id}|${R}`),A.push({id:R,via:[...$.via,$.id]}));k=A}for(let c of k){let A=`${c.id}|${w.id}`;!a.has(c.id)||p.has(A)||(p.add(A),x.push({rowId:c.id,columnId:w.id,via:c.via.slice(1)}))}}}let O=t.groupOrder??[],B=s=>O.indexOf(s)===-1?O.length:O.indexOf(s),C=(s,p)=>p==="label"?K(n.tryDefinition(s.kind),s):s[p],G=L(e,t.sort,C).map(s=>{let p=s;return{node:s,label:K(n.tryDefinition(s.kind),s),group:ee(p,t.rowGroup),ref:ee(p,t.rowRef)}}).sort((s,p)=>B(s.group)-B(p.group)||(t.sort!==void 0?0:s.ref<p.ref?-1:s.ref>p.ref?1:0)),F=L(l,t.columnSort,C).map(s=>({node:s,label:K(n.tryDefinition(s.kind),s),group:ee(s,t.columnGroup)})).sort((s,p)=>s.group<p.group?-1:s.group>p.group?1:t.columnSort!==void 0?0:s.node.id<p.node.id?-1:s.node.id>p.node.id?1:0);return{rows:G,columns:F,cells:x}}function Pe(n,r,t){let{rows:i,columns:e,cells:l}=Ie(n,r,t),a=(o,$)=>Y(n,o,$),h=o=>Y(n,o,1).replace(/^1 /,""),m=o=>({id:o.id,kind:o.kind,title:K(n.tryDefinition(o.kind),o),parts:[]}),x=o=>{let $=r.getNode(o);if(!$)return null;let R=n.tryDefinition($.kind),j=K(R,$),T=V($,R,{limit:3,said:[j],glance:!0}).map(N=>N.alone.startsWith(N.label)?`${N.label.toLowerCase()}${N.alone.slice(N.label.length)}`:N.alone);return[j,...T].join(", ")},P=typeof t.link=="string"?[]:t.link.path.slice(0,-1).flatMap((o,$,R)=>{let j=me(n,t.columns,R.slice(0,$+1));return j.ok?[...j.reached]:[]}),O=ue(n,t,{rows:i.length,columns:e.length,cells:l.length});if(O)return[{t:"text",text:`${a(t.rows,i.length)} against ${a(t.columns,e.length)}.`},{t:"text",text:O}];let B=[{t:"text",text:`${a(t.rows,i.length)} against ${a(t.columns,e.length)}${P.length>0?`, through ${[...new Set(P)].map(o=>a(o,2).replace(/^2 /,"")).join(" and ")}`:""}${e.length>0?`: ${e.map(o=>o.label).join(", ")}`:""}.`}],C=new Map(e.map(o=>[o.node.id,o.label])),G=new Map(e.map((o,$)=>[o.node.id,$])),F=new Map,s=new Map;for(let o of l){let $=F.get(o.rowId);$?$.push(o):F.set(o.rowId,[o]);let R=s.get(o.columnId);R?R.add(o.rowId):s.set(o.columnId,new Set([o.rowId]))}for(let o of i){let R=[...F.get(o.node.id)??[]].sort((j,T)=>G.get(j.columnId)-G.get(T.columnId)).map(j=>{let T=j.via.map(x).filter(N=>N!==null);return`${C.get(j.columnId)}${T.length>0?` (${T.join("; ")})`:""}`});B.push({t:"field",label:o.label,text:R.length>0?R.join(", "):"none"})}B.push({t:"list",as:"name",columns:1,groups:e.map(o=>{let $=s.get(o.node.id)??new Set,R=i.filter(j=>$.has(j.node.id)).map(j=>m(j.node));return{heading:`${o.label} (${R.length})`,items:R}})});let p=new Set(l.map(o=>o.rowId)),w=new Set(l.map(o=>o.columnId)),k=i.filter(o=>!p.has(o.node.id)),c=e.filter(o=>!w.has(o.node.id)),A=t.rows===t.columns;return k.length>0&&B.push({t:"text",text:`${A?`${k.length} with none across`:`${a(t.rows,k.length)} with no ${h(t.columns)}`}: ${k.map(o=>o.label).join(", ")}.`}),c.length>0&&B.push({t:"text",text:`${A?`${c.length} with none down`:`${a(t.columns,c.length)} on no ${h(t.rows)}`}: ${c.map(o=>o.label).join(", ")}.`}),B}function te(n,r,t,i={}){let{app:e,blocks:l=t?e?.viewSpecs?.[t.kind]?.[i.slot??"page"]:e?.home}=i;if(!l?.length)return[];let a=i.firstHeading??(t||i.blocks?void 0:1),h=xe(n,r,t,{...i,money:i.money??e?.brand,firstHeading:a});return t&&!h.node?[]:$e(typeof l[0]?.t=="string"?l:ke(l),h)}var Ge=240,je=10,Fe=1160,Ne=40,Ke=640,Te=3,We=n=>Math.max(1,Math.floor((Math.min(n,Fe)-Ne+je)/(Ge+je)));function Ee(n,r,t,i){let{app:e}=i,l=i.width??1440,a=i.today??n.today()??ne(e.brand?.timeZone),h=n.seenBy(r),m=h.schema,x=h.graph,P=Se(e),O=typeof t=="string"?t.trim():t.slug,B=typeof t=="string"?P.find(d=>d.slug===O||d.title===O||d.address===O):P.find(d=>d.slug===t.slug&&d.kind===t.kind)??t,C=!B&&typeof t=="string"?x.getNode(O):void 0;if(!B&&!C)return{ok:!1,error:`"${O}" is not a place this app has, nor a record this seat can see.`,places:P.map(d=>d.slug)};let G=[],F=e.viewSpecs??{},s=We(l),p=(d,y)=>te(h,null,d,{app:e,today:a,...y}),w=(d,y,v)=>{let g=m.tryDefinition(d.kind),S=K(g,d);if(y==="name")return{id:d.id,kind:d.kind,title:S,parts:[]};if(F[d.kind]?.[y]){let M=p(d,{slot:y}),[I,...f]=M,D=I?.t==="title";return{id:d.id,kind:d.kind,title:D?I.text:S,parts:k(D?f:M,v,`views.${d.kind}.${y}`,` (${d.id})`,D?1:0)}}if(y==="row")return{id:d.id,kind:d.kind,title:S,parts:[]};let u=g?.computed?J(m,x,d):d,W=V(u,g,{limit:3,said:[S],glance:!0,locale:e.brand?.locale,timeZone:e.brand?.timeZone});return{id:d.id,kind:d.kind,title:S,parts:W.map(M=>({t:"text",text:M.alone}))}};function k(d,y,v,g="",S=0){let b=[];return d.forEach((u,W)=>{let M=`${v}.${W+S}`;switch("problem"in u&&u.problem&&G.push({at:`${M}${g}`,says:u.problem}),u.t){case"title":b.push({t:"heading",level:3,text:u.text});return;case"text":b.push({t:"text",text:u.markdown?be(u.text):u.text,...u.tone?{tone:u.tone}:{}});return;case"badge":b.push({t:"badge",text:u.text});return;case"field":case"image":b.push({t:"field",label:u.label,text:u.text});return;case"progress":b.push({t:"progress",label:u.label,text:u.text});return;case"group":b.push(...k(u.blocks,y,`${M}.group`,g));return;case"when":b.push(...k(u.blocks,y,`${M}.show`,g));return;case"divider":case"figure":return;case"headline":b.push({t:"heading",level:u.level,text:u.text});return;case"number":b.push({t:"figure",text:u.text,...u.label?{label:u.label}:{}});return;case"list":{if(u.failed){b.push({t:"text",text:"\u2014"});return}if(u.members.length===0){u.empty&&b.push({t:"list",as:u.as,columns:1,groups:[],empty:u.empty});return}let I=y+1,f=I>Te?"name":u.as,D=(u.groups??[{value:null,members:u.members}]).map(U=>({..."heading"in U&&U.heading?{heading:U.heading}:{},items:U.members.map(Oe=>w(Oe,f,I))}));b.push({t:"list",as:f,columns:f==="card"?s:1,groups:D,...u.more>0?{more:u.more}:{}});return}}}),b}let c=[],A,o,$;if(C){o="record";let d=m.tryDefinition(C.kind),y=K(d,C);$={slug:C.id,title:y,kind:C.kind,address:pe(m,C.kind,C.id)},F[C.kind]?.page&&c.push(...k(p(C,{slot:"page"}),1,`views.${C.kind}.page`));let g=d?.computed?J(m,x,C):C;for(let S of we(d,V(g,d,{said:[y],locale:e.brand?.locale,timeZone:e.brand?.timeZone}))){S.title&&c.push({t:"heading",level:2,text:S.title});for(let b of S.fields)c.push({t:"field",label:b.label,text:b.value,...b.long?{long:!0}:{},...b.markdown?{markdown:!0}:{}})}}else{let d=B;$={slug:d.slug,title:d.title,kind:d.kind,address:d.address};let y=d.lens?fe(e).drawn.find(v=>v.as===d.slug&&(d.kind===null||v.kinds.includes(d.kind))):void 0;if(d.kind===null){let v=e.brand,g=v?.name??e.name,S=de(v)?.light,b=S&&ce(S)?S:void 0;if(A={name:g,...v?.subtitle?{subtitle:v.subtitle}:{},...b?{logo:{alt:v?.logoAlt??g,...le(b)?{drawn:"inline SVG"}:{drawn:"image",src:b}}}:{}},e.home)o="blocks",c=k(p(null,{}),0,"views.home");else{o="derived";let u=n.kindsKeptFrom(r),W=new Set([...e.pages?.hide??[],...u,...n.modules.disabledKinds]),M=ge(m.kinds,e.pages?.order).filter(I=>!W.has(I));c.push({t:"heading",level:1,text:e.name??"Home"});for(let I of M){let f=x.nodesOfKind(I).filter(D=>E(m.tryDefinition(I),D)).length;f>0&&c.push({t:"text",text:`${f} ${Z(m,I,f)}`})}}}else if(y?.lens==="blocks")o="lens:blocks",c=k(p(null,{blocks:y.options.blocks??[]}),0,`lenses.${y.index}.options.blocks`);else if(y?.lens==="columns"){o="lens:columns";let v=y.options.bindings??{};for(let g of Object.keys(v)){let S=v[g]?.column;if(!S)continue;let b=H(m,g,S),u=L(x.nodesOfKind(g).filter(f=>E(m.tryDefinition(g),f)),y.options.sort,(f,D)=>D==="label"?K(m.tryDefinition(f.kind),f):f[D]);Object.keys(v).length>1&&c.push({t:"heading",level:2,text:Z(m,g,2).replace(/^./,f=>f.toUpperCase())}),c.push({t:"text",text:`${u.length} ${Z(m,g,u.length)} in columns by ${_(m.tryDefinition(g),S).toLowerCase()}.`});let W=b.map(f=>({column:f,items:u.filter(D=>z(D,S,b)===f.value).map(D=>w(D,"card",1))})).filter(({column:f,items:D})=>f.value!==null||D.length>0).map(({column:f,items:D})=>({heading:`${f.label} (${D.length})`,items:D}));c.push({t:"list",as:"card",columns:1,groups:W});let M=new Map;for(let f of u)for(let D of Q(n,r,f,S,b))M.set(D.to,(M.get(D.to)??new Set).add(`"${D.title}"`));let I=b.filter(f=>f.value!==null&&M.has(f.value)).map(f=>`to ${f.label} by ${[...M.get(f.value)].join(" or ")}`);c.push({t:"text",text:I.length>0?`Moves: ${I.join("; ")}.`:"Moves: none for this seat."})}}else if(y?.lens==="coverage")o="lens:coverage",c=Pe(m,x,y.options);else if(y){o=`lens:${y.lens}`;let v=y.kinds.flatMap(g=>x.nodesOfKind(g).filter(S=>E(m.tryDefinition(g),S)));c.push({t:"text",text:`A ${y.lens} of ${v.length} ${y.kinds.map(g=>Z(m,g,v.length)).join(" and ")}.`}),c.push({t:"list",as:"name",columns:1,groups:[{items:v.map(g=>w(g,"name",1))}]})}else{o="derived";let v=x.nodesOfKind(d.kind).filter(g=>E(m.tryDefinition(d.kind),g));c.push({t:"heading",level:1,text:d.title}),v.length===0?c.push({t:"list",as:"row",columns:1,groups:[],empty:`No ${Z(m,d.kind,0)} yet.`}):c.push({t:"list",as:"row",columns:1,groups:[{items:v.map(g=>w(g,"row",1))}]})}}let R=r.kind==="system"?"the system":(r.roles??[]).length>0?(r.roles??[]).join(", "):r.kind,j=l<Ke?"phone":"wide",T=$.kind===null?He(m,x):[],N={...A?{masthead:A}:{},...T.length>0?{facts:T}:{},place:$,seat:R,width:l,variant:j,drawnBy:o,parts:c,problems:G};return{ok:!0,description:{...N,text:Me(N)}}}function He(n,r){let t=ve(n,r,null),i=e=>Array.isArray(e)?e.map(i).join(", "):e===null?"nothing":typeof e=="boolean"?e?"yes":"no":typeof e=="object"?e.label:String(e);return[...he(n)].map(([e,l])=>{let a=l.label??oe(e);return Object.hasOwn(t.values,e)?{name:e,label:a,value:i(t.values[e])}:{name:e,label:a,refused:t.refused[e]??"it could not be worked out"}})}function Z(n,r,t){let i=n.tryDefinition(r);if(t===1)return i?.noun??r;let e=re(n,r);return e.charAt(0).toLowerCase()+e.slice(1)}function Me(n){let r=[`${n.place.title} (${n.place.address}) \u2014 as ${n.seat}, ${n.width} wide (${n.variant}).`],t=n.masthead;t&&r.push(`Masthead: ${t.logo?`the logo ("${t.logo.alt}", ${t.logo.drawn==="image"?t.logo.src:"inline SVG"}), `:""}${t.name}${t.subtitle?` \u2014 ${t.subtitle}`:""}`);let i=(e,l)=>{for(let a of e)switch(a.t){case"heading":r.push(`${l}${"#".repeat(a.level)} ${a.text}`);break;case"text":r.push(`${l}${a.text}`);break;case"badge":r.push(`${l}[${a.text}]`);break;case"field":case"progress":r.push(`${l}${a.label}: ${a.text}`);break;case"figure":r.push(`${l}${a.text}${a.label?` \u2014 ${a.label}`:""}`);break;case"list":if(a.groups.length===0){a.empty&&r.push(`${l}(${a.empty})`);break}for(let h of a.groups){h.heading&&r.push(`${l}${h.heading}:`);for(let m of h.items)r.push(`${l}${h.heading?" ":""}- ${m.title}`),i(m.parts,`${l}${h.heading?" ":" "}`)}a.as==="card"&&a.columns>1&&r.push(`${l}(cards, ${a.columns} across)`),a.more&&r.push(`${l}and ${a.more} more`);break}};if(i(n.parts,""),n.facts){r.push("Facts of the whole graph (what fact('<name>') reads):");for(let e of n.facts)r.push(`- ${e.label} (${e.name}): ${e.value??`not worked out \u2014 ${e.refused}`}`)}if(n.problems.length>0){r.push("Problems:");for(let e of n.problems)r.push(`- ${e.at}: ${e.says}`)}return r.join(`
2
- `)}export{H as a,z as b,Q as c,De as d,Ce as e,Re as f,Ae as g,te as h,Ee as i,Me as j};
@@ -1 +0,0 @@
1
- import{a as v,b as m,c as h}from"./chunk.MB7LKKUD.js";import"./chunk.FNXW46U4.js";import{Ea as p,G as N,Ga as b,R as u}from"./chunk.4JWT6LIS.js";import"./chunk.SDO3U72B.js";import{wc as f}from"./chunk.AW2T3KFV.js";import"./chunk.2AZTW66C.js";import{b as c}from"./chunk.AJZBJBMO.js";var l=c(N(),1);var o=c(u(),1);function z({notices:r,anchor:n,board:a}){return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(w,{notices:r.filter(i=>i.kind==="banner"),at:"top",anchor:n,board:a}),(0,o.jsx)(w,{notices:r.filter(i=>i.kind==="toast"),at:"foot",anchor:n,board:a})]})}var y={info:"var(--graview-accent)",good:"var(--graview-good)",warn:"var(--graview-warn)",bad:"var(--graview-bad)"};function w({notices:r,at:n,anchor:a,board:i}){let s=(0,l.useRef)(null),t=r.length>0;return(0,l.useLayoutEffect)(()=>{let e=s.current;if(!t||!e)return;if(typeof e.showPopover=="function"&&!p(e))try{e.showPopover()}catch{}let d=()=>(n==="top"?h:m)(e,a());d(),n==="foot"&&i.hold?.(()=>e.matches(":hover, :focus-within"));let S=b(e);addEventListener("resize",d),addEventListener("scroll",d,!0),n==="foot"&&addEventListener(v,d);let g=typeof ResizeObserver=="function"?new ResizeObserver(d):null;return g?.observe(e),()=>{if(S(),g?.disconnect(),removeEventListener("resize",d),removeEventListener("scroll",d,!0),removeEventListener(v,d),e.isConnected&&p(e))try{e.hidePopover()}catch{}}},[t,n,a,i]),t?(0,o.jsx)("div",{ref:s,popover:"manual",role:"region","aria-label":n==="top"?"Notices":"Messages","data-testid":n==="top"?"notices-banners":"notices-toasts","data-graview-offstage":"",style:{position:"fixed",inset:"auto",margin:0,padding:0,border:"none",background:"none",overflow:"visible",zIndex:f("toast"),width:"max-content",height:"auto",maxWidth:"min(560px, calc(100vw - 32px))",display:"grid",gap:8,color:"var(--graview-ink)"},children:r.map(e=>(0,o.jsx)(T,{notice:e,board:i},e.id))}):null}function T({notice:r,board:n}){let a=r.tone??"info",i=[...r.action?[r.action]:[],...r.actions??[]],s=()=>n.dismiss(r.id);return(0,o.jsxs)("div",{"data-testid":"notice","data-kind":r.kind,"data-tone":a,style:{boxSizing:"border-box",display:"flex",flexWrap:"wrap",alignItems:"center",gap:"8px 12px",padding:r.kind==="banner"?"8px 10px 8px 14px":"10px 12px 10px 14px",borderRadius:"var(--graview-radius, 12px)",borderTop:"1px solid var(--graview-edge)",borderRight:"1px solid var(--graview-edge)",borderBottom:"1px solid var(--graview-edge)",borderLeft:`3px solid ${y[a]}`,background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",fontSize:"0.875rem",lineHeight:1.45},children:[(0,o.jsx)("span",{"aria-hidden":"true",style:{width:7,height:7,borderRadius:999,flex:"0 0 auto",background:y[a]}}),(0,o.jsx)("span",{style:{flex:"1 1 16rem",minWidth:0},children:r.sentence}),i.length>0?(0,o.jsx)("span",{style:{display:"flex",flexWrap:"wrap",gap:6},children:i.map((t,e)=>t.href!==void 0?(0,o.jsx)("a",{href:t.href,...t.target?{target:t.target,rel:"noopener"}:{},"data-testid":"notice-action",onClick:()=>{t.onSelect?.(),s()},style:{...x,...e===0?k:{}},children:t.label},t.label):(0,o.jsx)("button",{type:"button","data-testid":"notice-action",onClick:()=>{s(),t.onSelect?.()},style:{...x,...e===0?k:{}},children:t.label},t.label))}):null,(0,o.jsx)("button",{type:"button","data-testid":"notice-dismiss","aria-label":`Dismiss: ${r.sentence}`,title:"Dismiss",onClick:s,style:E,children:"\xD7"})]})}var x={display:"inline-flex",alignItems:"center",minHeight:28,padding:"2px 12px",borderRadius:9,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)",font:"inherit",fontWeight:500,textDecoration:"none",cursor:"pointer"},k={background:"var(--graview-accent)",borderColor:"var(--graview-accent)",color:"var(--graview-accent-ink)"},E={minWidth:28,minHeight:28,padding:0,border:"none",background:"none",boxShadow:"none",color:"var(--graview-ink-muted)",fontSize:"1rem",cursor:"pointer"};export{z as NoticeStacks};
@@ -1 +0,0 @@
1
- import{a as n}from"./chunk.2EXY4AHX.js";import"./chunk.OAWAUB4P.js";import"./chunk.PSTE3LZL.js";import"./chunk.UGFDSE37.js";import{l as s}from"./chunk.JGYGSNQY.js";import"./chunk.JLOSQ5UY.js";import"./chunk.FNF6XQI5.js";import"./chunk.LUPBT6YM.js";import"./chunk.IBWPRK2R.js";import"./chunk.RNUGQRJI.js";import"./chunk.6NFR2LYQ.js";import"./chunk.PXQVXBNG.js";import"./chunk.YERDP6YF.js";import"./chunk.P5K7EYDK.js";import"./chunk.7AEE3VHC.js";import"./chunk.U3CV5CCL.js";import"./chunk.LKF4BBCW.js";import"./chunk.NPS2WN7T.js";import"./chunk.JUT2VCFW.js";import"./chunk.HKD5SR45.js";import"./chunk.JEMQ66FT.js";import"./chunk.7UV7ODXU.js";import"./chunk.IIB22IIP.js";import"./chunk.MWUP5X47.js";import"./chunk.OGF6UORU.js";import"./chunk.UT6642FC.js";import"./chunk.WE5SA6TP.js";import"./chunk.MB7LKKUD.js";import"./chunk.WVUJXDXZ.js";import"./chunk.ESU2DD3J.js";import"./chunk.PL2P2OON.js";import"./chunk.27ZVVPRZ.js";import"./chunk.IN4PKQO5.js";import"./chunk.3IUJ4GW7.js";import"./chunk.UG23RICT.js";import"./chunk.GZHZLJBF.js";import"./chunk.ATKKTPJS.js";import"./chunk.OJGHDWI6.js";import"./chunk.UZSZPMRC.js";import"./chunk.MZOIPCDA.js";import"./chunk.KERLVJ6I.js";import"./chunk.4EPT2CQG.js";import"./chunk.FNXW46U4.js";import{G as y,R as i}from"./chunk.4JWT6LIS.js";import"./chunk.SDO3U72B.js";import"./chunk.AW2T3KFV.js";import"./chunk.2AZTW66C.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,6 +0,0 @@
1
- import{g as z,h as D,i as H}from"./chunk.PSTE3LZL.js";import{a as P,b as A,c as p,d as W}from"./chunk.UGFDSE37.js";import"./chunk.JGYGSNQY.js";import"./chunk.JLOSQ5UY.js";import"./chunk.FNF6XQI5.js";import"./chunk.LUPBT6YM.js";import"./chunk.IBWPRK2R.js";import"./chunk.RNUGQRJI.js";import"./chunk.6NFR2LYQ.js";import"./chunk.YERDP6YF.js";import"./chunk.P5K7EYDK.js";import"./chunk.7AEE3VHC.js";import"./chunk.U3CV5CCL.js";import"./chunk.LKF4BBCW.js";import"./chunk.NPS2WN7T.js";import"./chunk.JUT2VCFW.js";import"./chunk.HKD5SR45.js";import"./chunk.JEMQ66FT.js";import"./chunk.7UV7ODXU.js";import"./chunk.IIB22IIP.js";import"./chunk.MWUP5X47.js";import{a as C,b as O}from"./chunk.MB7LKKUD.js";import"./chunk.WVUJXDXZ.js";import"./chunk.ESU2DD3J.js";import"./chunk.PL2P2OON.js";import"./chunk.27ZVVPRZ.js";import"./chunk.IN4PKQO5.js";import"./chunk.3IUJ4GW7.js";import"./chunk.UG23RICT.js";import"./chunk.GZHZLJBF.js";import"./chunk.ATKKTPJS.js";import"./chunk.OJGHDWI6.js";import"./chunk.UZSZPMRC.js";import"./chunk.MZOIPCDA.js";import"./chunk.KERLVJ6I.js";import"./chunk.4EPT2CQG.js";import"./chunk.FNXW46U4.js";import{Ea as k,G as B,R as L}from"./chunk.4JWT6LIS.js";import"./chunk.SDO3U72B.js";import{wc as R}from"./chunk.AW2T3KFV.js";import"./chunk.2AZTW66C.js";import{b as E}from"./chunk.AJZBJBMO.js";var r=E(B(),1);var s=E(L(),1);function M(c){let e=document.activeElement;if(e!==null&&e!==document.body&&e!==document.documentElement&&e.isConnected)return;let n=c??document,o=n.querySelector("main")??n.querySelector("[data-graview-page]")??null,t=n.querySelector("[data-graview-page-title]")??o?.querySelector("h1, h2")??o;t instanceof HTMLElement&&(t.hasAttribute("tabindex")||t.setAttribute("tabindex","-1"),t.focus({preventScroll:!0}))}var I=1500;function N(c,e,n){let{store:o,principal:t}=c,l=z(o),g=(0,r.useMemo)(()=>P(o,t),[o,t,l]),w=(0,r.useRef)(n),[b,d]=(0,r.useState)(),[y,u]=(0,r.useState)("");(0,r.useEffect)(()=>{let a=A(o,t,w.current);w.current=o.batches().length,a&&(d({batch:a.batch,at:e,when:Date.now()}),u(""))},[o,t,l]),(0,r.useEffect)(()=>{d(a=>!a||a.at===e?a:Date.now()-a.when<I?{...a,at:e}:void 0)},[e]);let[x,i]=(0,r.useState)(null),v=(0,r.useCallback)(()=>{d(void 0),i(null)},[]),f=(0,r.useCallback)(()=>{i(null);try{let a=W(o,t);a&&u(`Took back \u201C${a.intent}\u201D`)}catch(a){i(a instanceof Error?a.message:String(a))}},[o,t]),S=g&&b?.batch===g.batch&&b.at===e?g:void 0;return{change:g,offered:S,close:v,takeBack:f,refused:x,said:y}}function ee({context:c,docked:e,at:n,since:o,compact:t=!1,className:l,size:g}){let{change:w,offered:b,close:d,takeBack:y,refused:u,said:x}=N(c,n,o),i=e?b:w,v=(0,r.useRef)(null),f=e&&(i!==void 0||u!==null);j(v,f),(0,r.useEffect)(()=>{if(!f)return;let m,h=()=>m=setTimeout(()=>v.current?.matches(":hover, :focus-within")?h():d(),1e4);return h(),()=>clearTimeout(m)},[f,i?.batch,u,d]);let S=x||(e&&i?p(i):""),a=e?{position:"fixed",inset:"auto",margin:0,padding:0,border:"none",background:"none",overflow:"visible",zIndex:R("toast"),width:"max-content",height:"auto",bottom:"calc(16px + env(safe-area-inset-bottom, 0px))",left:16,justifyItems:"start",color:"var(--graview-ink)",...f?{}:{display:"none"}}:{},T=i?(0,s.jsxs)("button",{type:"button","data-testid":"page-undo",title:`${p(i)} \u2014 \u2318Z or Ctrl+Z`,"aria-keyshortcuts":"Meta+Z Control+Z",onClick:m=>{let h=m.currentTarget.closest("[data-graview-face]");y(),requestAnimationFrame(()=>M(h))},...e?{style:U}:{className:H("graview-undo",l),...D(g),...t?{"data-compact":"","aria-label":p(i)}:{}},children:[(0,s.jsx)("span",{"aria-hidden":"true",children:"\u21B6"}),e?(0,s.jsx)("span",{style:K,children:p(i)}):(0,s.jsx)("span",{className:"graview-undo-words",children:t?"Undo":p(i)})]}):null;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{role:"status","aria-live":"polite",style:V,children:S}),(0,s.jsxs)("div",{ref:v,...e?{popover:"manual","data-graview-foot":"","data-graview-offstage":""}:{},"data-testid":e?"face-undo-dock":"page-undo-place",...e?{style:{...F,...a}}:{className:"graview-undo-place"},children:[e?null:(0,s.jsx)("style",{children:q}),e&&i?(0,s.jsxs)("div",{"data-testid":"page-undo-notice",style:Z,children:[T,(0,s.jsx)("button",{type:"button","data-testid":"page-undo-dismiss","aria-label":`Dismiss: ${p(i)}`,title:"Dismiss",onClick:m=>{let h=m.currentTarget.closest("[data-graview-face]");d(),requestAnimationFrame(()=>M(h))},style:$,children:"\xD7"})]}):T,u?(0,s.jsx)("span",{"data-testid":"page-undo-refused",role:"alert",className:"graview-undo-refused",...e?{style:{fontSize:"0.8125rem",lineHeight:1.4,color:"var(--graview-warn)",borderRadius:6,background:"var(--graview-float)",padding:"4px 8px"}}:{},children:u}):null]})]})}function j(c,e){(0,r.useLayoutEffect)(()=>{let n=c.current;if(!n||!e)return;if(typeof n.showPopover=="function"&&!k(n))try{n.showPopover()}catch{}let o=()=>n.parentElement?.closest("[data-embed-content]")??null,t=()=>{O(n,o()),dispatchEvent(new Event(C))};t(),addEventListener("resize",t),addEventListener("scroll",t,!0);let l=typeof ResizeObserver=="function"?new ResizeObserver(t):null;return l?.observe(n),()=>{if(l?.disconnect(),removeEventListener("resize",t),removeEventListener("scroll",t,!0),n.isConnected&&k(n))try{n.hidePopover()}catch{}dispatchEvent(new Event(C))}},[c,e])}var q=`:where(.graview-undo-place){display:grid;justify-items:end;gap:4px;max-width:100%;min-width:0}
2
- :where(.graview-undo){box-sizing:border-box;display:inline-flex;align-items:center;gap:6px;min-height:var(--graview-control-height,36px);max-width:min(100%,var(--graview-undo-widest,18rem));min-width:0;padding:0 14px;border-radius:999px;border:1px solid var(--graview-edge);background:var(--graview-float);color:var(--graview-ink);font:inherit;font-size:.875rem;cursor:pointer}
3
- :where(.graview-undo[data-size=sm]){--graview-control-height:30px}
4
- :where(.graview-undo[data-compact]){padding:0 10px}
5
- :where(.graview-undo-words){min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
6
- :where(.graview-undo-refused){font-size:.8125rem;line-height:1.4;color:var(--graview-warn);border-radius:6px}`,F={display:"grid",justifyItems:"end",gap:4,maxWidth:"100%",minWidth:0},U={display:"inline-flex",alignItems:"center",gap:6,minHeight:36,maxWidth:"100%",minWidth:0,borderRadius:999,font:"inherit",fontSize:"0.875rem",cursor:"pointer",textAlign:"start",lineHeight:1.4,padding:"8px 4px 8px 14px",border:"none",background:"none",color:"inherit"},Z={display:"flex",alignItems:"center",gap:2,maxWidth:"100%",minWidth:0,paddingRight:6,borderRadius:"var(--graview-radius, 12px)",border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},$={flex:"0 0 auto",minWidth:28,minHeight:28,padding:0,border:"none",background:"none",boxShadow:"none",color:"var(--graview-ink-muted)",font:"inherit",fontSize:"1rem",cursor:"pointer"},K={minWidth:0,overflow:"hidden",overflowWrap:"anywhere",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:4},V={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};export{ee as TakeBack};
@@ -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,R as n,ua as o}from"./chunk.4JWT6LIS.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.ESU2DD3J.js","./chunk.PL2P2OON.js","./chunk.27ZVVPRZ.js","./chunk.IN4PKQO5.js","./chunk.3IUJ4GW7.js","./chunk.UG23RICT.js","./chunk.GZHZLJBF.js","./chunk.ATKKTPJS.js","./chunk.OJGHDWI6.js","./chunk.UZSZPMRC.js","./chunk.MZOIPCDA.js","./chunk.KERLVJ6I.js","./chunk.4EPT2CQG.js","./chunk.FNXW46U4.js","./chunk.4JWT6LIS.js","./chunk.SDO3U72B.js","./chunk.AW2T3KFV.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.YTZDCIX2.js")))),y=f.part((e,r)=>e.drawFiles(r),{quiet:!0});var d=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.GZHZLJBF.js","./chunk.ATKKTPJS.js","./chunk.OJGHDWI6.js","./chunk.UZSZPMRC.js","./chunk.MZOIPCDA.js","./chunk.KERLVJ6I.js","./chunk.4EPT2CQG.js","./chunk.FNXW46U4.js","./chunk.4JWT6LIS.js","./chunk.SDO3U72B.js","./chunk.AW2T3KFV.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.LKXYZK5H.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.GZHZLJBF.js","./chunk.ATKKTPJS.js","./chunk.OJGHDWI6.js","./chunk.UZSZPMRC.js","./chunk.MZOIPCDA.js","./chunk.KERLVJ6I.js","./chunk.4EPT2CQG.js","./chunk.FNXW46U4.js","./chunk.4JWT6LIS.js","./chunk.SDO3U72B.js","./chunk.AW2T3KFV.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.V4DR25S4.js")))),E=m.part((e,r)=>(0,s.jsx)(e.RepeatPicker,{...r}),{quiet:!0}),W=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.MZOIPCDA.js","./chunk.KERLVJ6I.js","./chunk.4EPT2CQG.js","./chunk.FNXW46U4.js","./chunk.4JWT6LIS.js","./chunk.SDO3U72B.js","./chunk.AW2T3KFV.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.4WCQWILK.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,E as d,W as e,M as f,N as g};
@@ -1 +0,0 @@
1
- import{b as c}from"./chunk.2EXY4AHX.js";import"./chunk.OAWAUB4P.js";import"./chunk.PSTE3LZL.js";import"./chunk.UGFDSE37.js";import{l as m}from"./chunk.JGYGSNQY.js";import"./chunk.JLOSQ5UY.js";import"./chunk.FNF6XQI5.js";import"./chunk.LUPBT6YM.js";import"./chunk.IBWPRK2R.js";import"./chunk.RNUGQRJI.js";import"./chunk.6NFR2LYQ.js";import"./chunk.PXQVXBNG.js";import"./chunk.YERDP6YF.js";import"./chunk.P5K7EYDK.js";import"./chunk.7AEE3VHC.js";import"./chunk.U3CV5CCL.js";import"./chunk.LKF4BBCW.js";import"./chunk.NPS2WN7T.js";import"./chunk.JUT2VCFW.js";import"./chunk.HKD5SR45.js";import"./chunk.JEMQ66FT.js";import"./chunk.7UV7ODXU.js";import"./chunk.IIB22IIP.js";import"./chunk.MWUP5X47.js";import"./chunk.OGF6UORU.js";import"./chunk.UT6642FC.js";import"./chunk.WE5SA6TP.js";import"./chunk.MB7LKKUD.js";import"./chunk.WVUJXDXZ.js";import"./chunk.ESU2DD3J.js";import"./chunk.PL2P2OON.js";import"./chunk.27ZVVPRZ.js";import"./chunk.IN4PKQO5.js";import"./chunk.3IUJ4GW7.js";import"./chunk.UG23RICT.js";import"./chunk.GZHZLJBF.js";import"./chunk.ATKKTPJS.js";import"./chunk.OJGHDWI6.js";import"./chunk.UZSZPMRC.js";import"./chunk.MZOIPCDA.js";import"./chunk.KERLVJ6I.js";import"./chunk.4EPT2CQG.js";import"./chunk.FNXW46U4.js";import{G as S,R as g}from"./chunk.4JWT6LIS.js";import"./chunk.SDO3U72B.js";import{rd as n}from"./chunk.AW2T3KFV.js";import"./chunk.2AZTW66C.js";import{b as t}from"./chunk.AJZBJBMO.js";var y=t(S(),1),a=t(g(),1);function E({store:h,auto:f,brand:i,views:u,presence:o,steering:r,overview:s,scope:d,titleLevel:v=2,quickAsk:l,props:e}){let b=(0,y.useMemo)(()=>m({scope:`.${d}`}),[d]);return(0,a.jsxs)("div",{"data-embed-content":"",style:f?{flex:"0 0 auto",background:"var(--graview-ground)"}:{flex:"1 1 auto",minHeight:0,overflow:"auto",background:"var(--graview-ground)"},children:[(0,a.jsx)("style",{children:b}),(0,a.jsx)("div",{"data-embed-measure":"",style:{display:"flow-root"},children:(0,a.jsx)(c,{context:{store:h,embedded:!0,...e.bar!==!1?{barAbove:!0}:{},...s?{overview:s}:{},titleLevel:v,views:u,settings:e.app.settings??[],...o?{presence:o}:{},...i?{brand:i}:{},...e.locale?{locale:e.locale}:{},...e.timeZone?{timeZone:e.timeZone}:{},...e.principal?{principal:e.principal}:{},...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{},...e.subscriptions?{subscriptions:e.subscriptions}:{},...e.signIn?{signIn:e.signIn}:{},...l!==void 0?{quickAsk:l}:{}},...e.pages?{registry:e.pages}:{},...r?{steering:r}:{},...e.routing==="address"?n(e.basePath)===""?{}:{basename:n(e.basePath)}:{initialPath:e.path??"/"},...e.path!==void 0?{path:e.path}:{},...e.onNavigate?{onNavigate:e.onNavigate}:{}})})]})}export{E as PagesContent};
@@ -1 +0,0 @@
1
- import{A as J,C as Q,E as X,I as Y,K as ee,N as ne,a as I,i as q,l as Z,p as z,s as W,t as j,x as _,y as U}from"./chunk.FNXW46U4.js";import{Ca as D,G as se,R as N,_ as T,aa as $,na as G,va as K}from"./chunk.4JWT6LIS.js";import{Pc as O,ac as V,jc as M,mc as P}from"./chunk.AW2T3KFV.js";import{b as F}from"./chunk.AJZBJBMO.js";var a=F(se(),1);function ce(e){let n=[e?.typography?.body,e?.typography?.display,e?.typography?.mono],t=[];for(let r of n){let o=r?.split(",")[0]?.trim().replace(/^["']|["']$/g,"");!o||P(o)||o.toLowerCase()!==V.toLowerCase()&&(t.includes(o)||t.push(o))}return t}function te(e){let n=ce(e);return n.length===0?null:`https://fonts.googleapis.com/css2?${n.map(r=>`family=${encodeURIComponent(r).replace(/%20/g,"+")}:wght@400;500;600;700`).join("&")}&display=swap`}var u=F(N(),1),ve=e=>typeof e=="object"?e:{};function we({rootRef:e,firstLook:n,app:t}){let r=(0,a.useCallback)(()=>e.current,[e]);return n?(0,u.jsx)(ne,{firstLook:n,root:r,app:t}):null}function Ee(e,n,t){let{app:r}=e,o=(0,a.useMemo)(()=>{let i=Y(n(r.schema,r.viewSpecs),r),c=t?de(i,t):i,s=e.views?e.views(r.schema,c):i,d=s===c?i:G(i,s);return ee(d,r.schema,Q(e.brand??r.brand,r.schema)),t?t.register(d):d},[e.views,r.schema,r.viewSpecs,r.lenses,r.pages,r.home,t]);return K(o,e.keptViews)}function de(e,n){let t={...e,register(r,o,i,c){return c?.name!==n.name&&e.register(r,o,i,c),t},...e.home?{home:r=>(n.home||e.home(r),t)}:{}};return t}function le(e,n){return new O({schema:e.schema,mutations:e.mutations??[],invariants:e.invariants??[],...n?{snapshot:n}:{},...e.policy?{policy:e.policy}:{},...e.intelligence?{intelligence:e.intelligence}:{},...e.brand?.timeZone?{timeZone:e.brand.timeZone}:{}})}function re(e){if(typeof document>"u")return e==="dark"?"dark":"light";let n=document.documentElement.dataset.theme;return n==="dark"||n==="light"?n:e==="dark"||e==="light"?e:typeof matchMedia=="function"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function ue(e,n){let[t,r]=(0,a.useState)(()=>re(n));return(0,a.useEffect)(()=>{if(!e||typeof document>"u")return;let o=()=>r(re(n));o();let i=new MutationObserver(o);i.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});let c=typeof matchMedia=="function"?matchMedia("(prefers-color-scheme: dark)"):null;return c?.addEventListener?.("change",o),()=>{i.disconnect(),c?.removeEventListener?.("change",o)}},[e,n]),t}var A=e=>e?e.getBoundingClientRect().height:0;function Re(e,n,t){let r=(0,a.useRef)(t);r.current=t;let o=t!==void 0;(0,a.useLayoutEffect)(()=>{let i=e.current;if(!i||!o)return;let c=()=>{let y=[...i.children],h=y.find(b=>b.hasAttribute("data-graview-app-bar")),p=y.find(b=>b.hasAttribute("data-embed-content")),g=p?.querySelector("[data-embed-measure]")??null,l=y.find(b=>b.hasAttribute("data-graview-place-line"));return{strip:h,line:l,content:p,measure:g}},s=-1,d=()=>{let{strip:y,line:h,content:p,measure:g}=c(),l=Math.ceil(A(y)+A(h)+A(g||p));l!==s&&(s=l,r.current?.(l))};if(d(),typeof ResizeObserver>"u")return;let m=new ResizeObserver(d),E=()=>{m.disconnect();let{strip:y,line:h,content:p,measure:g}=c();for(let l of[i,y,h,p,g])l&&m.observe(l)};E();let S=new MutationObserver(()=>{E(),d()});return S.observe(i,{childList:!0}),()=>{m.disconnect(),S.disconnect()}},[e,n,o])}var xe=480,me=0;function ke(e){let{app:n,seed:t,scheme:r="auto",brand:o=n.brand,fonts:i=!0,height:c="100%",label:s}=e,d=(0,a.useRef)(null);D(d);let m=c==="viewport"?"100dvh":c,E=Z(typeof m=="string"&&/vh\b/.test(m)),S=(0,a.useMemo)(()=>`graview-embed-${++me}`,[]),y=(0,a.useMemo)(()=>e.store??e.remote?.store??le(n,t),[e.store,e.remote,n,t]),h=e.presence??e.remote?.presence,p=e.hostContext?.theme,g=ue(r==="auto"&&p===void 0,o?.scheme),l=r==="auto"?p??g:r,b=(0,a.useMemo)(()=>I(l,o,{scope:`.${S}`}),[l,o,S]);q(e.favicon?M(o):void 0),(0,a.useEffect)(()=>{if(!i||typeof document>"u")return;let w=te(o);if(!w||document.querySelector(`link[href="${w}"]`))return;let f=document.createElement("link");f.rel="stylesheet",f.href=w,document.head.appendChild(f)},[o,i]);let k=(0,a.useRef)(void 0);(0,a.useLayoutEffect)(()=>{let w=d.current,f=k.current;if(k.current=s,!w||!s)return;let ie=v=>{let R=v.getAttribute("aria-label")??"",x=f&&f!==s?R.startsWith(`${f} \xB7 `)?R.slice(f.length+3):R===f?"":R:R;x===s&&(v.getAttribute("role")==="region"||v.tagName==="SECTION"&&!v.hasAttribute("role"))&&v.setAttribute("role","group");let C=x.startsWith(`${s} \xB7 `)||x===s?x:x?`${s} \xB7 ${x}`:s;C!==R&&v.setAttribute("aria-label",C)},B=()=>w.querySelectorAll("aside, nav, main, header, footer, section[aria-label]:not([role]), [role=region], [role=complementary], [role=navigation], [role=search]").forEach(v=>{v.hasAttribute("data-graview-named-by-lens")||ie(v)});B();let H=new MutationObserver(B);return H.observe(w,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["aria-label"]}),()=>H.disconnect()},[s]);let ae=E?`${m}`.replace(/([\d.]+)[sdl]?vh\b/g,(w,f)=>`${+f*E/100}px`):m;return{rootRef:d,scope:S,css:b,scheme:l,store:y,presence:h,brand:o,auto:c==="auto",height:ae}}function Ae({rootRef:e,board:n}){let t=(0,a.useCallback)(()=>e.current?.querySelector("[data-embed-content]")??e.current,[e]);return(0,u.jsx)(z,{board:n,anchor:t})}function Fe(e,n,t){return{brand:t,locale:e.locale,timeZone:e.timeZone,principal:e.principal,seats:e.seats,presence:n,people:e.people,memory:e.memory,presenceTtlMs:e.presenceTtlMs,onKeepLens:e.onKeepLens,ai:e.ai,files:e.files,resolveApp:e.resolveApp,history:e.history,linkedRecords:e.linkedRecords,subscriptions:e.subscriptions,keptViews:e.keptViews,signIn:e.signIn,menuSections:e.menuSections,app:e.app}}function Le({name:e,heading:n,faces:t,at:r,without:o,home:i,reach:c,standing:s,hostActions:d,keeping:m,onFind:E,switch:S,named:y=!0}){let{brand:h,store:p,principal:g,views:l}=T();$();let b=o?.has("places")?[]:W({store:p,principal:g,views:l}),k=J();return(0,u.jsx)(_,{brand:h,name:e,named:y,description:h?.subtitle,heading:n,faces:t,home:i,places:b,current:r===null?null:j(b,r),reach:c,onFind:E,...S?{switch:S}:{},...t||r===null?{scenePlaces:k}:{},tools:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(X,{clean:s}),(0,u.jsx)(U,{...d?{hostActions:d}:{},...m?{keeping:m}:{}})]})})}var Be=e=>e===!1?2:Math.min(e+1,6);function He(e){let[n,t]=(0,a.useState)(e),r=(0,a.useRef)(void 0),o=(0,a.useRef)(void 0),i=(0,a.useMemo)(()=>({go:r,at:t,pending:o}),[]),c=(0,a.useCallback)(s=>{if(r.current){r.current(s);return}o.current=s,t(s)},[]);return{at:n,setAt:t,steering:i,steer:c}}function ye(e){let n=typeof e=="object"&&e!==null?e.name:void 0;return{name:typeof n=="string"&&n.length>0?n:typeof e=="object"?"Error":typeof e}}var L=()=>typeof performance<"u"?performance.now():Date.now();function Ce(e,n){let t=(0,a.useRef)({onError:e,face:n});return t.current={onError:e,face:n},(0,a.useCallback)((r,o)=>t.current.onError?.(ye(r),{module:o.module,face:t.current.face}),[])}function Ve(e,n){let t=(0,a.useRef)(null);t.current===null&&(t.current=L());let r=(0,a.useRef)({onReady:e,face:n});r.current={onReady:e,face:n};let o=(0,a.useRef)(!1);return(0,a.useCallback)(i=>{o.current||(o.current=!0,r.current.onReady?.({ms:Math.max(0,L()-(t.current??L())),face:i}))},[])}var oe=class extends a.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(n,t){console.error(`[graview] ${this.props.module} threw while rendering`,n,t.componentStack),this.props.report(n,{module:this.props.module})}render(){return this.state.failed?(0,u.jsxs)("div",{role:"alert","data-graview-face-error":this.props.module,...this.props.content?{"data-embed-content":""}:{},style:this.props.content?{flex:"1 1 auto",display:"grid",alignContent:"center",justifyItems:"center",gap:8,padding:24,background:"var(--graview-ground)",color:"var(--graview-ink)",fontSize:"0.9375rem"}:{display:"inline-flex",alignItems:"center",gap:6,fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:[(0,u.jsx)("span",{children:this.props.content?"This part of the app could not draw.":"Could not draw."}),(0,u.jsx)("button",{type:"button",onClick:()=>this.setState({failed:!1}),style:{padding:"3px 11px",fontSize:"0.8125rem"},children:"Try again"})]}):this.props.children}};export{ve as a,we as b,Ee as c,le as d,Re as e,xe as f,ke as g,Ae as h,Fe as i,Le as j,Be as k,He as l,Ce as m,Ve as n,oe as o};
@@ -1 +0,0 @@
1
- import{a,b}from"./chunk.IQWKEGWG.js";import"./chunk.QNJYXB3U.js";import"./chunk.FNXW46U4.js";import"./chunk.4JWT6LIS.js";import"./chunk.SDO3U72B.js";import"./chunk.AW2T3KFV.js";import"./chunk.2AZTW66C.js";import"./chunk.AJZBJBMO.js";export{a as ActivityFilter,b as InteractionRow};
@@ -1 +0,0 @@
1
- import{a as r,b as m,d as k,e as h}from"./chunk.UGFDSE37.js";import"./chunk.FNXW46U4.js";import"./chunk.4JWT6LIS.js";import"./chunk.SDO3U72B.js";import"./chunk.AW2T3KFV.js";import"./chunk.2AZTW66C.js";import"./chunk.AJZBJBMO.js";var o="way-back",b='[data-testid="notices-toasts"]';function g(t){let a=document.activeElement;a!==null&&a!==document.body&&!a.closest(b)||(t??document).querySelector('[data-graview-app-bar] [data-testid="app-home"]')?.focus({preventScroll:!0})}function w(t,a,i,d,y){if(t.past)return i?.dismiss(o),()=>{};let c=y?.closest("[data-graview-embed]"),s,f=e=>{if(e!==void 0&&r(t,a)?.batch!==e)return!1;try{let n=k(t,a);return n&&i?.notify({kind:"toast",id:o,sentence:`Took back \u201C${n.intent}\u201D`}),n!==void 0}catch(n){return i?.notify({kind:"toast",id:o,tone:"warn",sentence:n instanceof Error?n.message:String(n)}),!0}},u=()=>{let e=m(t,a,d);if(d=t.batches().length,e){let n=s=e.batch;i?.notify({kind:"toast",id:o,sentence:e.intent,timeout:1e4,action:{label:"Take back",onSelect:()=>(g(c),f(n))}})}else s&&r(t,a)?.batch!==s&&(s=void 0,i?.dismiss(o))},l=e=>{h(e)&&(!c||c.contains(e.target))&&f()&&e.preventDefault()};u();let p=t.subscribe(u);return document.addEventListener("keydown",l),(e=!1)=>{p(),document.removeEventListener("keydown",l),e&&s&&i?.dismiss(o)}}export{w as sceneWay};
@@ -1 +0,0 @@
1
- import{j as a,k as o}from"./chunk.LUPBT6YM.js";import"./chunk.IBWPRK2R.js";import"./chunk.RNUGQRJI.js";import"./chunk.6NFR2LYQ.js";import"./chunk.U3CV5CCL.js";import"./chunk.LKF4BBCW.js";import"./chunk.NPS2WN7T.js";import"./chunk.JUT2VCFW.js";import"./chunk.HKD5SR45.js";import"./chunk.7UV7ODXU.js";import"./chunk.IIB22IIP.js";import"./chunk.MWUP5X47.js";import"./chunk.WVUJXDXZ.js";import"./chunk.ESU2DD3J.js";import"./chunk.PL2P2OON.js";import"./chunk.27ZVVPRZ.js";import"./chunk.IN4PKQO5.js";import"./chunk.3IUJ4GW7.js";import"./chunk.UG23RICT.js";import"./chunk.GZHZLJBF.js";import"./chunk.ATKKTPJS.js";import"./chunk.OJGHDWI6.js";import"./chunk.UZSZPMRC.js";import"./chunk.MZOIPCDA.js";import"./chunk.KERLVJ6I.js";import"./chunk.4EPT2CQG.js";import"./chunk.FNXW46U4.js";import{ma as n}from"./chunk.4JWT6LIS.js";import"./chunk.SDO3U72B.js";import"./chunk.AW2T3KFV.js";import"./chunk.2AZTW66C.js";import"./chunk.AJZBJBMO.js";var w=new WeakMap;function s(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{s as frameworkViews};