graview 0.1.27 → 0.1.29

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 (167) hide show
  1. package/dist/preview/chunk.2643W7FT.js +1 -0
  2. package/dist/preview/chunk.2CLPRG3I.js +1 -0
  3. package/dist/preview/chunk.2IZFIORK.js +1 -0
  4. package/dist/preview/chunk.2NCTM5K2.js +2 -0
  5. package/dist/preview/{chunk.5BN2ARQ2.js → chunk.3G5MQFZK.js} +1 -1
  6. package/dist/preview/chunk.3JM2TNDD.js +2 -0
  7. package/dist/preview/chunk.44FVJOK4.js +28 -0
  8. package/dist/preview/chunk.4GGAPOMK.js +2 -0
  9. package/dist/preview/chunk.5AT4O4BN.js +1 -0
  10. package/dist/preview/chunk.5JXUAMKI.js +1 -0
  11. package/dist/preview/chunk.5R66YTET.js +2 -0
  12. package/dist/preview/chunk.64P76WK4.js +1 -0
  13. package/dist/preview/chunk.7D77HEIJ.js +1 -0
  14. package/dist/preview/chunk.7DNFXJH3.js +1 -0
  15. package/dist/preview/{chunk.HPD3DSTP.js → chunk.7PRFYYVM.js} +1 -1
  16. package/dist/preview/chunk.AE5GKL4C.js +1 -0
  17. package/dist/preview/chunk.ARR75WBP.js +35 -0
  18. package/dist/preview/chunk.AVUS5LMG.js +3 -0
  19. package/dist/preview/chunk.BKPGDEES.js +1 -0
  20. package/dist/preview/chunk.BZ5OJYHU.js +1 -0
  21. package/dist/preview/chunk.CK7QWLMX.js +1 -0
  22. package/dist/preview/chunk.COTG2IG5.js +1 -0
  23. package/dist/preview/chunk.D4GOVA25.js +1 -0
  24. package/dist/preview/chunk.DAA6XWLF.js +1 -0
  25. package/dist/preview/chunk.DKTCRFMS.js +1 -0
  26. package/dist/preview/chunk.DLGTFXGM.js +1 -0
  27. package/dist/preview/chunk.DN7SN6ZR.js +1 -0
  28. package/dist/preview/chunk.G4WQGTZR.js +3 -0
  29. package/dist/preview/chunk.GDA3G4U2.js +6 -0
  30. package/dist/preview/chunk.GS4T26WW.js +328 -0
  31. package/dist/preview/chunk.GZH6PTXN.js +1 -0
  32. package/dist/preview/chunk.HFKMHLJ3.js +1 -0
  33. package/dist/preview/chunk.HGAMNIST.js +1 -0
  34. package/dist/preview/chunk.HJCQ6I3S.js +1 -0
  35. package/dist/preview/chunk.HKBKH7EK.js +1 -0
  36. package/dist/preview/chunk.HLLWKSZB.js +5 -0
  37. package/dist/preview/chunk.HONUT6OG.js +1 -0
  38. package/dist/preview/chunk.HRWLR7T4.js +1 -0
  39. package/dist/preview/chunk.HV6I74DF.js +1 -0
  40. package/dist/preview/chunk.IPBXAAQV.js +17 -0
  41. package/dist/preview/chunk.IWYUFYDJ.js +1 -0
  42. package/dist/preview/chunk.IZW7DBK4.js +1 -0
  43. package/dist/preview/chunk.J46KDTEZ.js +10 -0
  44. package/dist/preview/chunk.JNGUSAWX.js +70 -0
  45. package/dist/preview/chunk.JU2ZVKMT.js +2 -0
  46. package/dist/preview/chunk.K4ZUVH2G.js +1 -0
  47. package/dist/preview/chunk.KC6UZHBM.js +1 -0
  48. package/dist/preview/chunk.KLITC55P.js +1 -0
  49. package/dist/preview/chunk.KZ2376BD.js +19 -0
  50. package/dist/preview/chunk.LYJAVUST.js +1 -0
  51. package/dist/preview/chunk.MB7LKKUD.js +1 -0
  52. package/dist/preview/chunk.MOUGB4H6.js +1 -0
  53. package/dist/preview/chunk.MYFWM572.js +1 -0
  54. package/dist/preview/chunk.N4FBDA2W.js +1 -0
  55. package/dist/preview/chunk.O42YET3W.js +1 -0
  56. package/dist/preview/chunk.O4QPITBD.js +9 -0
  57. package/dist/preview/{chunk.IXVSJJQH.js → chunk.OGXE2RHC.js} +4 -4
  58. package/dist/preview/chunk.OHE5AMHH.js +0 -0
  59. package/dist/preview/chunk.ONGVH3ZM.js +1076 -0
  60. package/dist/preview/chunk.OQDETV4X.js +1 -0
  61. package/dist/preview/chunk.OWBEV6FR.js +1 -0
  62. package/dist/preview/chunk.OWE6OJ4P.js +1 -0
  63. package/dist/preview/chunk.OYJSFO3A.js +1 -0
  64. package/dist/preview/chunk.P62SKNJS.js +27 -0
  65. package/dist/preview/chunk.PA5HYAEO.js +1 -0
  66. package/dist/preview/{chunk.OA5BVKJH.js → chunk.PMEDLEZY.js} +2 -2
  67. package/dist/preview/chunk.PTXQHHKF.js +1 -0
  68. package/dist/preview/chunk.Q5WEOX3Q.js +1 -0
  69. package/dist/preview/chunk.QNHECGMH.js +1 -0
  70. package/dist/preview/chunk.QSDT2RLY.js +1 -0
  71. package/dist/preview/chunk.R2D373VG.js +1 -0
  72. package/dist/preview/chunk.RB4RTBRZ.js +1 -0
  73. package/dist/preview/chunk.RCLJ4H52.js +116 -0
  74. package/dist/preview/chunk.RKRSRKF3.js +1 -0
  75. package/dist/preview/chunk.RWGLKDWH.js +1 -0
  76. package/dist/preview/chunk.SIL4KD3K.js +1 -0
  77. package/dist/preview/chunk.SS76EIMI.js +1 -0
  78. package/dist/preview/{chunk.IKT7JQUW.js → chunk.T4LY5QXO.js} +1 -1
  79. package/dist/preview/chunk.UIIVEQAT.js +1 -0
  80. package/dist/preview/chunk.UT6642FC.js +1 -0
  81. package/dist/preview/chunk.UTHHX2TJ.js +1 -0
  82. package/dist/preview/chunk.UWNYT7PF.js +1 -0
  83. package/dist/preview/chunk.V6TK4LHW.js +6 -0
  84. package/dist/preview/chunk.VNBO2RXD.js +1 -0
  85. package/dist/preview/chunk.VPPUTA74.js +1 -0
  86. package/dist/preview/chunk.WKXNBHTL.js +4 -0
  87. package/dist/preview/chunk.WLRTPFAC.js +1 -0
  88. package/dist/preview/chunk.X53HI436.js +1 -0
  89. package/dist/preview/chunk.XAXJHEMD.js +1 -0
  90. package/dist/preview/chunk.XDYAG276.js +1 -0
  91. package/dist/preview/chunk.XDZSTIS6.js +88 -0
  92. package/dist/preview/chunk.XXHNV24G.js +1 -0
  93. package/dist/preview/chunk.YCA7P5MK.js +1 -0
  94. package/dist/preview/chunk.YRQZZH5V.js +1 -0
  95. package/dist/preview/chunk.YUWRZWGX.js +1 -0
  96. package/dist/preview/chunk.Z2RGLFLS.js +1 -0
  97. package/dist/preview/chunk.Z56B2JR2.js +25 -0
  98. package/dist/preview/chunk.Z5V23DQN.js +3 -0
  99. package/dist/preview/chunk.ZBXOX3W3.js +1 -0
  100. package/dist/preview/chunk.ZEGSQCSD.js +1 -0
  101. package/dist/preview/chunk.ZEVVWWNA.js +44 -0
  102. package/dist/preview/chunk.ZS4DJ76C.js +1 -0
  103. package/dist/preview/chunk.ZSKP6UQS.js +3 -0
  104. package/dist/preview/page.js +6 -6
  105. package/package.json +6 -6
  106. package/dist/preview/chunk.4HGBVU5B.js +0 -1
  107. package/dist/preview/chunk.4JXWQO6Y.js +0 -1
  108. package/dist/preview/chunk.4R7LDCDO.js +0 -1
  109. package/dist/preview/chunk.4W24TPMR.js +0 -1
  110. package/dist/preview/chunk.6LJ66MB7.js +0 -1
  111. package/dist/preview/chunk.6R4EI47C.js +0 -1
  112. package/dist/preview/chunk.7CO6VP6F.js +0 -1
  113. package/dist/preview/chunk.7QTBDACG.js +0 -1
  114. package/dist/preview/chunk.7SVIRYBB.js +0 -1
  115. package/dist/preview/chunk.7THQFY52.js +0 -1
  116. package/dist/preview/chunk.AHDOKM4O.js +0 -1
  117. package/dist/preview/chunk.AS35X6KA.js +0 -1
  118. package/dist/preview/chunk.ATLUMYAJ.js +0 -23
  119. package/dist/preview/chunk.CW7BMVBG.js +0 -321
  120. package/dist/preview/chunk.DG2UE7PJ.js +0 -1
  121. package/dist/preview/chunk.DG2WKNMX.js +0 -1
  122. package/dist/preview/chunk.DQ5OWYLQ.js +0 -1
  123. package/dist/preview/chunk.DY2FFBWF.js +0 -1
  124. package/dist/preview/chunk.E3SZ7T75.js +0 -1
  125. package/dist/preview/chunk.EVTZE2OZ.js +0 -1
  126. package/dist/preview/chunk.FS5K4AVA.js +0 -8
  127. package/dist/preview/chunk.FTBKJ5RZ.js +0 -16
  128. package/dist/preview/chunk.GHMICJIB.js +0 -1
  129. package/dist/preview/chunk.HO6JR7VY.js +0 -1
  130. package/dist/preview/chunk.I5KD54S6.js +0 -1
  131. package/dist/preview/chunk.IZDKEFPJ.js +0 -1
  132. package/dist/preview/chunk.J36GTQTV.js +0 -1
  133. package/dist/preview/chunk.KAKX5TZN.js +0 -3
  134. package/dist/preview/chunk.LHAAZQNQ.js +0 -19
  135. package/dist/preview/chunk.LQZ2VQWN.js +0 -107
  136. package/dist/preview/chunk.MHJJEGQO.js +0 -1
  137. package/dist/preview/chunk.MNPNW4BQ.js +0 -1
  138. package/dist/preview/chunk.MRK6QJV5.js +0 -25
  139. package/dist/preview/chunk.NKIFVPS3.js +0 -1
  140. package/dist/preview/chunk.NQNQPPPM.js +0 -1
  141. package/dist/preview/chunk.OHGJ5BZ4.js +0 -2
  142. package/dist/preview/chunk.OYULDOQP.js +0 -1
  143. package/dist/preview/chunk.PHY3AH3L.js +0 -1
  144. package/dist/preview/chunk.Q7544RCB.js +0 -1
  145. package/dist/preview/chunk.QZWN46V6.js +0 -1
  146. package/dist/preview/chunk.RUC4HFVC.js +0 -1
  147. package/dist/preview/chunk.S5JWZIVE.js +0 -1
  148. package/dist/preview/chunk.SHDYLMZE.js +0 -2
  149. package/dist/preview/chunk.T2EZ5MTH.js +0 -1
  150. package/dist/preview/chunk.TMPV4HLQ.js +0 -1
  151. package/dist/preview/chunk.TX2GOL65.js +0 -29
  152. package/dist/preview/chunk.U5ZUXGWM.js +0 -1040
  153. package/dist/preview/chunk.UMMN5Z6V.js +0 -1
  154. package/dist/preview/chunk.UPGDSOBY.js +0 -1
  155. package/dist/preview/chunk.V57P4LIZ.js +0 -1
  156. package/dist/preview/chunk.VD6FJ6KJ.js +0 -2
  157. package/dist/preview/chunk.VFICMX5G.js +0 -61
  158. package/dist/preview/chunk.VMD4PDYJ.js +0 -1
  159. package/dist/preview/chunk.VMEX2KZ4.js +0 -8
  160. package/dist/preview/chunk.XDHBV5K5.js +0 -1
  161. package/dist/preview/chunk.YO7UFBJP.js +0 -1
  162. package/dist/preview/chunk.YSYT3ASK.js +0 -1
  163. package/dist/preview/chunk.YV2RTNPU.js +0 -6
  164. package/dist/preview/chunk.ZD5HGRPR.js +0 -1
  165. package/dist/preview/chunk.ZKM4P7US.js +0 -1
  166. package/dist/preview/chunk.ZMMMKTAG.js +0 -1
  167. package/dist/preview/chunk.ZNIJONZN.js +0 -1
@@ -1,321 +0,0 @@
1
- import{a as Ne}from"./chunk.AHDOKM4O.js";import{a as Me}from"./chunk.6LJ66MB7.js";import{da as Ce,ea as Le,qa as He,ra as Ae,va as L,ya as H,za as Re}from"./chunk.OYULDOQP.js";import{Bb as ye,Db as xe,Gb as ke,Hb as $e,P as se,Qa as U,Tb as Se,Ub as Pe,Vb as Be,W as de,Wb as Te,_b as Ee,ba as ce,la as pe,mb as ge,ob as ue,pb as ve,qb as Z,rb as we,sb as fe,ub as me,vb as he,wb as be}from"./chunk.VMEX2KZ4.js";import{a as G,b as E}from"./chunk.MRK6QJV5.js";import{b as $}from"./chunk.AJZBJBMO.js";var w=$(G(),1);var Oe=$(G(),1);var K=$(E(),1);function ze({brand:e,size:a=22}){let t=e?.logo,r=t!==void 0&&me(t)&&he(t)===null?t:void 0,l=Ne(r);if(!t||!be(t))return null;let n=e?.logoAlt??e?.name??"",o=n!==""&&n!==e?.name,c={display:"inline-flex",flex:"0 0 auto",height:a,color:"var(--graview-accent)"};return r?(0,K.jsx)("span",{className:"graview-logo","data-testid":"app-mark",style:c,...o?{role:"img","aria-label":n}:{"aria-hidden":!0},dangerouslySetInnerHTML:l}):(0,K.jsx)("img",{className:"graview-logo","data-testid":"app-mark",src:t,alt:o?n:"",style:{...c,width:"auto"}})}function ja(e){(0,Oe.useEffect)(()=>{if(!e||typeof document>"u")return;let a=[...document.querySelectorAll('link[rel~="icon"]')],t=a.map(l=>l.getAttribute("href")),r;a.length===0&&(r=document.createElement("link"),r.rel="icon",r.setAttribute("data-graview-favicon",""),document.head.appendChild(r),a.push(r));for(let l of a)l.href=e;return()=>{r&&r.remove(),a.forEach((l,n)=>{l!==r&&t[n]!==null&&t[n]!==void 0&&l.setAttribute("href",t[n])})}},[e])}var B=Re(Me(()=>import("./chunk.OA5BVKJH.js")));var i=$(E(),1),da=B.part((e,a)=>(0,i.jsx)(e.Here,{...a}),{quiet:!0}),ca="home",pa="/",ga="scene:whole";function er(e){let{store:a,principal:t,views:r}=e,l=a.kindsKeptFrom(t),n=a.schema.kinds.filter(s=>!a.modules.disabledKinds.has(s)&&!l.has(s)),o=r?.arrangement?.(),c=r?.places()??[],p=Be(o,a.schema,c),d=Pe(a.schema,o,[...a.modules.administered.values()].flatMap(s=>s.kinds??[])),u=(s,m)=>(!a.graph.size.nodes||a.graph.count(s)>0)&&(p?m?p.places.has(`${s}|${m}`):p.kinds.has(s):!d.has(s)),g=[{key:ca,label:"Home",path:pa,group:"home",primary:!0}];for(let s of Ee(n,o?.order))g.push({key:`kind:${s}`,label:de(a.schema,s),path:U(a.schema,s),group:"lists",kind:s,primary:u(s)});for(let s of c){if(!n.includes(s.kind)||s.as===Te)continue;let m=c.some(P=>P.as===s.as&&P.kind!==s.kind),b=`/places/${encodeURIComponent(s.as)}${m?`?of=${U(a.schema,s.kind).slice(1)}`:""}`;g.some(P=>P.path===b)||g.push({key:`place:${s.kind}:${s.as}`,label:s.title,path:b,group:"pictures",kind:s.kind,primary:u(s.kind,s.as)})}return n.some(s=>Object.keys(a.schema.tryDefinition(s)?.edges??{}).length>0)&&g.push({key:"connections",label:"Connections",path:"/map",group:"pictures",primary:!1}),g}function ar(e,a){let[t="/",r=""]=a.split("?"),l=e.find(o=>o.path===(r?`${t}?${r}`:t))??e.find(o=>o.path===t);if(l)return l.key;let n=`/${t.split("/").filter(Boolean)[0]??""}`;return e.find(o=>o.group==="lists"&&o.path===n)?.key??null}var ua=(0,w.createContext)(null),rr=()=>(0,w.useContext)(ua),N=30,va=48,_=640,Ie=4,We=2;function wa(e){let{widths:a,current:t,room:r,more:l,gap:n=Ie,primary:o,most:c=Se}=e;if(a.length===0||!(r>0)||!(l>0)||a.some(g=>!(g>0)))return null;let p=(g,f)=>g.reduce((s,m)=>s+a[m],0)+n*Math.max(0,g.length-1)+(f?n+l:0),d=(g,f)=>t<0||!g.includes(t)||g.slice(0,f).includes(t)?g.slice(0,f):[...g.filter(s=>s!==t).slice(0,f-1),t].sort((s,m)=>s-m),u=d(a.map((g,f)=>f).filter(g=>o?.[g]!==!1||g===t),c);if(p(u,u.length<a.length)<=r)return u.length>=We?u:null;for(let g=u.length-1;g>=We;g--){let f=d(u,g);if(p(f,!0)<=r)return f}return null}var fa=`
2
- .graview-bar{display:block;margin:0;padding:0;container:graview-bar/inline-size;flex:0 0 auto;position:relative;background:var(--graview-bar);border-bottom:1px solid var(--graview-edge);color:var(--graview-ink);font-family:var(--graview-font-body,system-ui)}
3
- .graview-bar-row{display:flex;flex-wrap:nowrap;align-items:center;gap:16px;height:${va-1}px;margin:0;padding:0 16px}
4
- .graview-bar-home,.graview-bar-face,.graview-bar-place,.graview-bar-item,.graview-bar-at{display:inline-flex;align-items:center;box-sizing:border-box;min-width:0;margin:0;border:0;background:none;box-shadow:none;font:inherit;letter-spacing:normal;text-transform:none;text-decoration:none;color:var(--graview-ink);cursor:pointer;text-align:left}
5
- .graview-bar-app{display:flex;flex:0 1 auto;max-width:50%}
6
- .graview-bar-app::after{content:"";flex:0 100000 auto;width:2px;min-width:0}
7
- .graview-bar-name{margin:0;display:flex;font-family:var(--graview-font-display,var(--graview-font-body,system-ui));font-size:.9375rem;font-weight:600;line-height:1.25}
8
- .graview-bar-home{gap:8px;min-width:auto;min-height:30px;padding:0;letter-spacing:-.005em}
9
- .graview-bar-app-name{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal;word-break:normal}
10
- .graview-bar-faces{display:inline-flex;flex:0 0 auto;box-sizing:border-box;height:30px;margin:0;padding:2px;gap:2px;border:1px solid var(--graview-edge);border-radius:8px}
11
- .graview-bar-face{gap:6px;padding:0 10px;border-radius:6px;font-size:.8125rem;white-space:nowrap;color:var(--graview-ink-muted)}
12
- .graview-bar-face span{min-width:0;max-width:11em;overflow:hidden;text-overflow:ellipsis}
13
- .graview-bar-face[aria-pressed=true]{color:var(--graview-ink);font-weight:600;background:color-mix(in srgb,var(--graview-accent) 16%,transparent)}
14
- [data-switch-drawn=icons] .graview-bar-face{padding:0 8px}
15
- [data-switch-drawn=icons] .graview-bar-face span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
16
- .graview-bar-mid{display:flex;flex:1 100 0;min-width:0}
17
- .graview-bar-mid[data-place]{min-width:9em;flex-basis:auto}
18
- .graview-bar-place-at{position:relative;display:inline-flex;min-width:0;max-width:100%}
19
- .graview-bar-place{gap:6px;height:30px;max-width:100%;padding:0 8px;border:1px solid transparent;border-radius:8px;font-size:.875rem;font-weight:600}
20
- .graview-bar-face:hover,.graview-bar-place:hover{border-color:var(--graview-edge);color:var(--graview-ink)}
21
- .graview-bar-place-words{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
22
- .graview-bar-mid[data-places=standing]{flex:0 0 auto}
23
- .graview-bar-places{display:flex;align-items:center;gap:${Ie}px;min-width:0;margin:0;padding:0}
24
- .graview-bar-at{gap:6px;flex:0 0 auto;height:30px;padding:0 8px;border-block:2px solid transparent;border-radius:0;font-size:.875rem;font-weight:500;white-space:nowrap;color:var(--graview-ink-muted)}
25
- .graview-bar-at:is(:hover,[aria-current],[aria-expanded=true]){color:var(--graview-ink)}
26
- .graview-bar-at[aria-current]{font-weight:600;border-bottom-color:var(--graview-accent)}
27
- .graview-bar-ruler{position:absolute;left:0;top:0;display:flex;width:0;height:0;overflow:hidden;visibility:hidden;pointer-events:none}
28
- .graview-bar-ruler .graview-bar-at{font-weight:600}
29
- .graview-bar-list{display:grid;align-content:start;width:min(320px,calc(100vw - 24px));height:auto;max-height:min(70vh,560px);overflow:auto;margin:0;padding:6px;border-radius:10px;border:1px solid var(--graview-edge);background:var(--graview-float);box-shadow:var(--graview-lift-high);color:var(--graview-ink)}
30
- .graview-bar-list[hidden]{display:none}
31
- .graview-bar-list p{margin:8px 8px 2px;font-size:.6875rem;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--graview-ink-muted)}
32
- .graview-bar-list ul,.graview-bar-list li{display:grid;margin:0;padding:0;list-style:none}
33
- .graview-bar-item{align-items:flex-start;gap:10px;width:100%;padding:7px 8px;border-radius:7px;font-size:.875rem;line-height:1.3;overflow-wrap:anywhere}
34
- .graview-bar-item:hover{background:color-mix(in srgb,var(--graview-ink) 7%,transparent)}
35
- .graview-bar-item[aria-current]{font-weight:600;background:color-mix(in srgb,var(--graview-accent) 14%,transparent)}
36
- .graview-bar-mark{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:14px;height:1.3em;color:var(--graview-ink-muted)}
37
- .graview-bar :focus-visible{outline:2px solid var(--graview-accent);outline-offset:1px}
38
- .graview-bar-tools{display:contents}
39
- .graview-bar-tools>*{margin-left:-8px}
40
- .graview-bar-tools>:is(.graview-bar-find,.graview-bar-find-open){margin-left:auto}
41
- .graview-bar-own{display:flex;align-items:center;flex:0 0 auto}
42
- .graview-bar-own:empty{display:none}
43
- .graview-bar-find{position:relative;display:flex;min-width:7.5rem;flex:0 600 9rem;--graview-bar-find-end:3.25em}
44
- .graview-bar-find-slot{display:flex;flex:1;min-width:0}
45
- .graview-bar-find-keys{position:absolute;right:10px;line-height:30px;pointer-events:none;font-size:.75rem;color:var(--graview-ink-faint)}
46
- .graview-bar-find:is(:focus-within,:has(input:not(:placeholder-shown))){flex-basis:16rem;--graview-bar-find-end:10px}
47
- :is(:focus-within,:has(input:not(:placeholder-shown)))>.graview-bar-find-keys,.graview-bar-find-open{display:none}
48
- .graview-bar-line{display:flex;flex:0 0 auto;padding:6px 8px;background:var(--graview-ground);border-bottom:1px solid var(--graview-edge);font-family:var(--graview-font-body,system-ui)}
49
- .graview-bar-line .graview-bar-place{height:auto;min-height:32px}
50
- .graview-bar-line .graview-bar-place-words{white-space:normal}
51
- @media (pointer:coarse){.graview-bar-find-keys{display:none}}
52
- @container graview-bar (max-width: ${_-1}px){
53
- .graview-bar-row{gap:10px;padding:0 12px}
54
- .graview-bar-app,.graview-bar-home{max-width:none;flex:1 1 auto;min-width:0}
55
- .graview-bar-mid,.graview-bar-find{display:none}
56
- .graview-bar-find-open{display:inline-flex}
57
- .graview-bar-own{--graview-activity-mark:inline}
58
- .graview-bar-own .graview-activity-word{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
59
- .graview-bar[data-finding] :is(.graview-bar-app,.graview-bar-faces,.graview-bar-find-open){display:none}
60
- .graview-bar[data-finding] .graview-bar-find{display:flex;flex:1 1 auto;min-width:0}
61
- }`,O={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:6,minWidth:N,height:N,padding:0,borderRadius:8,border:"1px solid transparent",background:"none",boxShadow:"none",color:"var(--graview-ink-muted)",font:"inherit",fontSize:"0.875rem",cursor:"pointer",flex:"0 0 auto"};function tr({brand:e,name:a,heading:t=1,home:r,faces:l,places:n,current:o,reach:c,tools:p,find:d=!0,description:u,findBox:g,onFind:f,switch:s="words",scenePlaces:m}){let b=(0,w.useRef)(null),P=Le()?.who.size,[R,Ue]=(0,w.useState)(null),[Q,Ze]=(0,w.useState)(null),[x,Xe]=(0,w.useState)(!1),[Je,ee]=(0,w.useState)(!1),[Qe,ea]=(0,w.useState)(!0),[ae,aa]=(0,w.useState)(null),W=l?l.pages.current:!m,D=W?{places:n,current:o,reach:c}:m,h=D&&D.places.length>0?D:null,re=h?h.places.findIndex(v=>v.key===h.current):-1,te=!!l&&s==="words",ne=h?h.places.map(v=>v.primary===!1?"0":"1").join(""):"",T=(0,w.useCallback)(()=>{let v=b.current;if(!v)return;let k=Ba(v,re,te,ne);k!==void 0&&aa(k);let C=k?!0:ha(v);C!==null&&ea(C)},[re,te,ne]);(0,w.useLayoutEffect)(()=>{let v=b.current;if(!v)return;let k=()=>{let q=v.getBoundingClientRect().width;Xe(q<_),v.style.setProperty("--graview-bar-width",`${Math.round(q)}px`),T()};k();let C=typeof document>"u"?void 0:document.fonts;if(C?.ready.then(T),C?.addEventListener?.("loadingdone",T),typeof ResizeObserver>"u")return()=>C?.removeEventListener?.("loadingdone",T);let Y=new ResizeObserver(k);Y.observe(v);for(let q of v.querySelectorAll(".graview-bar-tools > *"))Y.observe(q);return()=>{Y.disconnect(),C?.removeEventListener?.("loadingdone",T)}},[T]);let V=(0,w.useRef)(f);V.current=f,(0,w.useLayoutEffect)(()=>{V.current?.(d&&R?{slot:R,compact:x,own:Q}:null)},[d,R,x,Q]),(0,w.useLayoutEffect)(()=>()=>V.current?.(null),[]);let ra=(0,w.useCallback)(()=>{ee(!0),requestAnimationFrame(()=>R?.querySelector("input")?.focus())},[R]),ie=(0,w.useRef)(null),I=(0,w.useRef)(!1),oe=(0,w.useCallback)(()=>{ee(!1),I.current&&(I.current=!1,requestAnimationFrame(()=>ie.current?.focus()))},[]),ta=t===!1?"span":`h${t}`,na=r.href!==void 0?"a":"button",ia=v=>k=>{!v||!qe(k)||(k.preventDefault(),v())},oa=!W,le=h&&!x&&ae!==null?ae.split(",").map(Number).filter(v=>v<h.places.length):null,F=h?(0,i.jsx)(Pa,{places:h.places,current:h.current,reach:h.reach,scene:oa,stands:le}):null,la=h?h.places.map(v=>v.label).join(`
62
- `):"";(0,w.useLayoutEffect)(T,[T,a,e,la,h?.current,W,x,s,d]);let sa=s==="icons"||!Qe||x?"icons":"words";return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("header",{ref:b,className:"graview-bar","data-testid":"app-bar","data-graview-app-bar":"",...Je&&x?{"data-finding":""}:{},children:[(0,i.jsx)("style",{children:fa}),(0,i.jsxs)("div",{className:"graview-bar-row",children:[(0,i.jsx)("div",{className:"graview-bar-app",children:(0,i.jsx)(ta,{className:"graview-bar-name",children:(0,i.jsxs)(na,{...r.href!==void 0?{href:r.href,onClick:ia(r.go)}:{type:"button",onClick:r.go},"data-testid":"app-home",...r.current?{"aria-current":"page"}:{},title:u?`${a} \u2014 ${u}`:`${a} \u2014 home`,className:"graview-bar-home",children:[(0,i.jsx)(ze,{brand:e,size:20}),(0,i.jsx)("span",{className:"graview-bar-app-name","data-testid":"app-name",children:a})]})})}),l?(0,i.jsx)(ma,{faces:l,form:s,drawn:sa}):null,(0,i.jsx)("div",{className:"graview-bar-mid",...le?{"data-places":"standing"}:!x&&F?{"data-place":""}:{},children:x?null:F}),!x&&h&&h.places.length>1?(0,i.jsxs)("span",{className:"graview-bar-ruler","aria-hidden":"true","data-graview-bar-ruler":"",children:[h.places.map(v=>(0,i.jsx)("span",{className:"graview-bar-at",children:v.label},v.key)),(0,i.jsxs)("span",{className:"graview-bar-at",children:[X,(0,i.jsx)(Ke,{})]})]}):null,(0,i.jsxs)("div",{className:"graview-bar-tools",children:[d?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("button",{type:"button",className:"graview-bar-find-open",ref:ie,"data-testid":"app-find-open","aria-label":"Find",title:"Find",onClick:ra,style:{...O,display:void 0},children:(0,i.jsx)(xa,{})}),(0,i.jsxs)("div",{className:"graview-bar-find","data-testid":"app-find",onBlur:v=>{let k=v.relatedTarget;k instanceof Node&&v.currentTarget.contains(k)||v.currentTarget.querySelector("input")?.value||oe()},onKeyDownCapture:v=>{v.key==="Escape"&&x&&(I.current=!0)},onKeyDown:v=>{v.key!=="Escape"||!x||(!v.defaultPrevented||!v.currentTarget.querySelector("input")?.value?oe():I.current=!1)},children:[(0,i.jsx)("div",{ref:Ue,className:"graview-bar-find-slot",children:g}),(0,i.jsx)("span",{className:"graview-bar-find-keys","data-testid":"app-find-keys","aria-hidden":"true",children:ba()})]})]}):null,(0,i.jsx)("div",{ref:Ze,className:"graview-bar-own","data-graview-bar-own":""}),P?(0,i.jsx)(w.Suspense,{fallback:null,children:(0,i.jsx)(da,{scene:!W,compact:x})}):null,p]})]})]}),x&&F?(0,i.jsx)("div",{className:"graview-bar-line","data-graview-place-line":"","data-testid":"app-place-line",children:F}):null]})}function ma({faces:e,form:a,drawn:t}){let r=l=>{let n=e[l];return(0,i.jsxs)("button",{type:"button",className:"graview-bar-face","data-testid":`app-face-${l}`,"aria-pressed":n.current,title:n.label,onClick:()=>{n.current||n.go()},children:[l==="scene"?(0,i.jsx)(Ge,{}):(0,i.jsx)(ya,{}),(0,i.jsx)("span",{children:n.label})]})};return(0,i.jsxs)("div",{className:"graview-bar-faces",role:"group","aria-label":`${e.scene.label} or ${e.pages.label}`,"data-testid":"app-faces","data-switch":a,"data-switch-drawn":t,children:[r("scene"),r("pages")]})}function ha(e){let a=e.querySelector(".graview-bar-faces"),t=e.querySelector(".graview-bar-mid"),r=e.querySelector(".graview-bar-find");if(!a||!t||r?.matches(":focus-within")||e.getBoundingClientRect().width<_)return null;let n=je(a),o=t.querySelector(".graview-bar-place-words"),c=o?parseFloat(getComputedStyle(o).fontSize)||14:0,p=o?Math.min(o.scrollWidth+34,14*c):0,d=t.getBoundingClientRect().width-p;if(r&&r.getBoundingClientRect().width>0){let u=parseFloat(getComputedStyle(r).flexBasis);isFinite(u)&&(d-=Math.max(0,u-r.getBoundingClientRect().width))}return Fe(e)?!1:a.getAttribute("data-switch-drawn")==="icons"?d>=n+2:d>=-1}function Fe(e){let a=e.querySelector(".graview-bar-app-name");return!!(a&&a.getBoundingClientRect().height>parseFloat(getComputedStyle(a).lineHeight)*1.5)}var qe=e=>e.button===0&&!(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey);function ba(){let e=globalThis.navigator?.platform??"";return/Mac|iPhone|iPad|iPod/.test(e)?"\u2318K":"Ctrl K"}function z({size:e,box:a=e,children:t}){return(0,i.jsx)("svg",{width:e,height:e,viewBox:`0 0 ${a} ${a}`,"aria-hidden":"true",focusable:"false",style:{flex:"0 0 auto"},children:t})}function Ge(){return(0,i.jsxs)(z,{size:14,children:[(0,i.jsx)("path",{d:"M7 1.5 L12.5 4.5 L7 7.5 L1.5 4.5 Z",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"}),(0,i.jsx)("path",{d:"M1.5 7.5 L7 10.5 L12.5 7.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round",strokeLinecap:"round"})]})}function ya(){return(0,i.jsxs)(z,{size:14,children:[(0,i.jsx)("rect",{x:"2.25",y:"1.75",width:"9.5",height:"10.5",rx:"1.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3"}),(0,i.jsx)("path",{d:"M4.5 5 H9.5 M4.5 7.25 H9.5 M4.5 9.5 H7.5",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function Ke(){return(0,i.jsx)(z,{size:10,children:(0,i.jsx)("path",{d:"M2 3.5 L5 6.5 L8 3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function xa(){return(0,i.jsxs)(z,{size:16,children:[(0,i.jsx)("circle",{cx:"7",cy:"7",r:"4.75",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),(0,i.jsx)("path",{d:"M10.5 10.5 L14 14",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function ka({place:e}){if(e.key===ga)return(0,i.jsx)(Ge,{});if(e.group==="home")return(0,i.jsx)(z,{size:13,box:14,children:(0,i.jsx)("path",{d:"M2 6.5 L7 2 L12 6.5 V12 H2 Z",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"})});let a=e.kind?`hsl(${Math.round(ge(e.kind))} 55% 52%`:"rgb(128 128 128";return(0,i.jsx)("span",{"aria-hidden":"true",style:{display:"inline-block",width:12,height:8,clipPath:"polygon(50% 0, 100% 50%, 50% 100%, 0 50%)",background:e.group==="lists"?`${a})`:`linear-gradient(${a}), ${a})) center / 6px 4px no-repeat, ${a} / 0.35)`}})}var $a=[{group:"home"},{group:"lists",heading:"Lists"},{group:"pictures",heading:"Pictures"}],X="More";function _e({place:e,current:a,reach:t,standing:r,done:l}){let n=e.key===a,o=t.href?.(e.path);return(0,i.jsxs)(o!==void 0?"a":"button",{className:r?"graview-bar-at":"graview-bar-item","data-testid":`app-place-${e.key}`,"data-place-path":e.path,...n?{"aria-current":"page"}:{},...o!==void 0?{href:o}:{type:"button"},onClick:p=>{l(),t.go&&(o!==void 0&&!qe(p)||(p.preventDefault(),t.go(e)))},children:[r?null:(0,i.jsx)("span",{className:"graview-bar-mark",children:(0,i.jsx)(ka,{place:e})}),r&&n?(0,i.jsx)("span",{"data-testid":"app-place-current",children:e.label}):(0,i.jsx)("span",{children:e.label})]})}function Sa({places:e,current:a,reach:t,id:r,done:l}){return(0,i.jsx)(i.Fragment,{children:$a.map(({group:n,heading:o})=>{let c=e.filter(d=>d.group===n);if(c.length===0)return null;let p=`${r}-${n}`;return(0,i.jsxs)("div",{role:"group",...o?{"aria-labelledby":p}:{"aria-label":c[0].label},"data-place-group":n,children:[o?(0,i.jsx)("p",{id:p,children:o}):null,(0,i.jsx)("ul",{children:c.map(d=>(0,i.jsx)("li",{children:(0,i.jsx)(_e,{place:d,current:a,reach:t,standing:!1,done:l})},d.key))})]},n)})})}function Pa({places:e,current:a,reach:t,scene:r,stands:l}){let n=H("places"),o=(0,w.useRef)(l);n.open||(o.current=l);let c=o.current,p=e.find(u=>u.key===a)?.label??"Places",d=c?e.filter((u,g)=>!c.includes(g)):e;return(0,i.jsxs)("nav",{className:c?"graview-bar-places":"graview-bar-place-at","aria-label":r?"What the scene shows":"The app\u2019s places",...c?{"data-testid":"app-places-standing"}:{},children:[c?.map(u=>(0,i.jsx)(_e,{place:e[u],current:a,reach:t,standing:!0,done:()=>{}},e[u].key)),d.length>0?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("button",{type:"button",className:c?"graview-bar-at":"graview-bar-place","data-testid":"app-places-open",...n.trigger,onClick:n.toggle,"aria-label":c?`${X} \u2014 ${d.length} more ${r?"pictures":"places"}`:`${p} \u2014 ${r?"everything the scene shows":"every place"}`,title:c?d.map(u=>u.label).join(", "):p,children:[c?X:(0,i.jsx)("span",{className:"graview-bar-place-words","data-testid":"app-place-current",children:p}),(0,i.jsx)(Ke,{})]}),(0,i.jsx)("div",{...n.pane,"data-testid":"app-places",hidden:!n.open,className:"graview-bar-list",style:L,children:(0,i.jsx)(Sa,{places:d,current:a,reach:t,id:n.pane.id,done:()=>n.setOpen(!1)})})]}):null]})}function Ba(e,a,t,r){let l=e.querySelector(".graview-bar-ruler"),n=e.querySelector(".graview-bar-mid");if(!l||!n)return null;let o=e.querySelector(".graview-bar-find");if(o?.matches(":focus-within"))return;if(e.getBoundingClientRect().width<_||Fe(e))return null;let c=[...l.children].map(P=>P.getBoundingClientRect().width),p=c.pop()??0,d=e.querySelector(".graview-bar-faces"),u=d&&t?je(d):0,g=d?.getAttribute("data-switch-drawn")==="words"?u:0,f=n.getBoundingClientRect().left,s=o?.getBoundingClientRect(),m=s&&s.width>0?s.right-f-(parseFloat(getComputedStyle(o).minWidth)||0)-8:n.getBoundingClientRect().width,b=[...r].map(P=>P!=="0");return wa({widths:c,current:a,room:Math.floor(m+g-u),more:p,primary:b})?.join(",")??null}function je(e){return[...e.querySelectorAll(".graview-bar-face span")].reduce((a,t)=>a+t.scrollWidth+10,0)}var Ta={name:"Graview",typography:{body:Z.body,mono:Z.mono},schemes:ve},De={ground:"--graview-ground",groundDeep:"--graview-ground-deep",wash:"--graview-wash",panel:"--graview-panel",panelMuted:"--graview-panel-muted",panelWarning:"--graview-panel-warning",edge:"--graview-edge",edgeBright:"--graview-edge-bright",ink:"--graview-ink",inkMuted:"--graview-ink-muted",inkFaint:"--graview-ink-faint",accent:"--graview-accent",accentDim:"--graview-accent-dim",accentInk:"--graview-accent-ink",warn:"--graview-warn",good:"--graview-good",bad:"--graview-bad",glow:"--graview-glow",bar:"--graview-bar",float:"--graview-float",liftLow:"--graview-lift-low",liftHigh:"--graview-lift-high",tintAlpha:"--graview-tint-alpha",tintLightness:"--graview-tint-lightness",gridAlpha:"--graview-grid-alpha"};function Ea(e){return Object.keys(De).map(a=>` ${De[a]}: ${e[a]};`).join(`
63
- `)}function Ve(e,a){let t=e===a?e:`${e} ${a}`;return` ${t} [data-graview-view] { transition: none; }
64
- ${t} [data-graview-touched] > * { animation: none; }
65
- ${t} [data-graview-view][data-graview-wrote] > *,
66
- ${t} [data-graview-view][data-graview-read] > * {
67
- animation: none;
68
- box-shadow: 0 0 0 2px var(--graview-activity);
69
- }
70
- ${t} [data-graview-view][data-graview-read] > * { box-shadow: 0 0 0 1px var(--graview-activity); }
71
- ${t} [data-graview-connector][data-graview-activity] { animation: none; stroke-opacity: 1; }`}function or(e="dark",a=Ta,t={}){let r=Ha(e,a,t);return t.scope===void 0?r:Ma(r,t.scope)}function Ma(e,a){let t=`:where(${a}) `,r=o=>o===a||o.startsWith(`${a} `)||o.startsWith(`${a}:`)||o.startsWith(`${a}[`)||o.startsWith(":root")&&o.includes(` ${a} `),l=o=>{let c=o.match(/^\s*/)[0],p=La(o.trim()).map(d=>r(d)?d:`${t}${d}`);return`${c}${p.join(", ")} `},n=o=>{let c="",p=0;for(;p<o.length;){let d=o.indexOf("{",p);if(d===-1)return c+o.slice(p);let u=Ca(o,d),g=o.slice(p,d),f=o.slice(d+1,u),s=g.trim().startsWith("@")?g.trim().split(/[\s(]/)[0]:null;s===null?c+=`${l(g)}{${f}}`:s==="@media"||s==="@supports"||s==="@container"||s==="@layer"?c+=`${g}{${n(f)}}`:c+=`${g}{${f}}`,p=u+1}return c};return n(e)}function Ca(e,a){let t=0,r=null;for(let l=a;l<e.length;l++){let n=e[l];if(r)n==="\\"?l++:n===r&&(r=null);else if(n==='"'||n==="'")r=n;else if(n==="/"&&e[l+1]==="*")l=e.indexOf("*/",l+2)+1||e.length;else if(n==="{")t++;else if(n==="}"&&--t===0)return l}return e.length}function La(e){let a=[],t=0,r=null,l="";for(let n of e){if(r)n===r&&(r=null);else if(n==='"'||n==="'")r=n;else if(n==="("||n==="[")t++;else if(n===")"||n==="]")t--;else if(n===","&&t===0){a.push(l.trim()),l="";continue}l+=n}return l.trim()&&a.push(l.trim()),a}function Ha(e,a,t){let r=a.schemes[e],l=t.scope??":root",n=t.scope??"html, body",o=t.scope??"body",c=":root",p=we(a),d=fe(a),u=ye(a.kit);return`${l} {
72
- ${Ea(r)}
73
- ${xe(u)}
74
-
75
- ${$e()}
76
- --graview-font-body: ${d.body};
77
- --graview-font-display: ${d.display};
78
- --graview-font-mono: ${d.mono};
79
-
80
- --graview-weight-display: ${d.weights.display};
81
- --graview-weight-body: ${d.weights.body};
82
- --graview-weight-label: ${d.weights.label};
83
-
84
- --graview-radius: ${p.radius}px;
85
- --graview-radius-sm: ${p.radiusSmall}px;
86
- --graview-pad: ${p.pad}px;
87
- --graview-pad-sm: ${p.padSmall}px;
88
- --graview-gap: ${p.gap}px;
89
- color-scheme: ${e};
90
- }
91
-
92
- ${n} {
93
- margin: 0;
94
- background: var(--graview-ground-deep);
95
- color: var(--graview-ink);
96
- }
97
-
98
-
99
- ${o} {
100
- font: 0.875rem/1.55 var(--graview-font-body);
101
- font-weight: var(--graview-weight-body);
102
- font-variant-numeric: tabular-nums;
103
- -webkit-font-smoothing: antialiased;
104
- }
105
-
106
-
107
- h1, h2, h3, h4 { font-family: var(--graview-font-display); font-weight: var(--graview-weight-display); }
108
- h1, h2 { letter-spacing: ${ue}; }
109
-
110
- .graview-logo > svg { display: block; height: 100%; width: auto; }
111
- code, kbd, samp { font-family: var(--graview-font-mono); }
112
-
113
-
114
- [data-graview-figure] > svg {
115
- width: 100%;
116
- height: 100%;
117
- display: block;
118
- overflow: visible;
119
- }
120
-
121
-
122
- @property --graview-altitude {
123
- syntax: "<number>";
124
- inherits: true;
125
- initial-value: 0;
126
- }
127
-
128
-
129
- .graview-ground {
130
- position: relative;
131
-
132
- isolation: isolate;
133
- z-index: ${ke("scene")};
134
- background: var(--graview-wash), var(--graview-ground);
135
- --graview-altitude: 0;
136
- transition: --graview-altitude 640ms cubic-bezier(0.33, 0, 0.2, 1);
137
- }
138
-
139
-
140
-
141
- .graview-ground::before {
142
- content: "";
143
- position: absolute;
144
- inset: 0;
145
- pointer-events: none;
146
- background-image:
147
- linear-gradient(var(--graview-edge) 1px, transparent 1px),
148
- linear-gradient(90deg, var(--graview-edge) 1px, transparent 1px);
149
- background-size: var(--graview-kit-grid-size, 64px) var(--graview-kit-grid-size, 64px);
150
- opacity: calc(var(--graview-kit-grid, 1) * var(--graview-grid-alpha) * (1 - var(--graview-altitude)));
151
- mask-image: radial-gradient(120% 90% at 50% 40%, #000 30%, transparent 78%);
152
- }
153
-
154
-
155
- .graview-scroll {
156
- overflow: auto;
157
- min-height: 0;
158
- background:
159
- linear-gradient(var(--graview-panel-bg, var(--graview-panel)) 30%, transparent) center top,
160
- linear-gradient(transparent, var(--graview-panel-bg, var(--graview-panel)) 70%) center bottom,
161
- radial-gradient(farthest-side at 50% 0, ${e==="light"?"rgba(20,30,32,0.30)":"rgba(0,0,0,0.7)"}, transparent) center top,
162
- radial-gradient(farthest-side at 50% 100%, ${e==="light"?"rgba(20,30,32,0.30)":"rgba(0,0,0,0.7)"}, transparent) center bottom;
163
- background-repeat: no-repeat;
164
- background-size: 100% 24px, 100% 24px, 100% 10px, 100% 10px;
165
- background-attachment: local, local, scroll, scroll;
166
- }
167
-
168
- .graview-scroll[data-graview-overflowing]::after {
169
- content: "";
170
- position: sticky;
171
- bottom: 0;
172
- flex: 0 0 14px;
173
- margin-top: calc(-14px - var(--graview-gap, 7px));
174
- background: linear-gradient(transparent, var(--graview-panel-bg, var(--graview-panel)));
175
- pointer-events: none;
176
- }
177
-
178
-
179
-
180
-
181
- .graview-ground::after {
182
- content: "";
183
- position: absolute;
184
- inset: 0;
185
- pointer-events: none;
186
- --graview-lattice-tile: var(--graview-lattice-cell, calc(var(--graview-kit-lattice-size, 46px) * 2.2361));
187
- --graview-lattice-line: var(--graview-edge);
188
- background-image:
189
- linear-gradient(to top right, transparent calc(50% - 0.5px), var(--graview-lattice-line) calc(50% - 0.5px), var(--graview-lattice-line) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
190
- linear-gradient(to top left, transparent calc(50% - 0.5px), var(--graview-lattice-line) calc(50% - 0.5px), var(--graview-lattice-line) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
191
- linear-gradient(to top right, transparent calc(50% - 0.5px), var(--graview-lattice-line) calc(50% - 0.5px), var(--graview-lattice-line) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
192
- linear-gradient(to top left, transparent calc(50% - 0.5px), var(--graview-lattice-line) calc(50% - 0.5px), var(--graview-lattice-line) calc(50% + 0.5px), transparent calc(50% + 0.5px));
193
- background-size:
194
- var(--graview-lattice-tile) calc(var(--graview-lattice-tile) / 2),
195
- var(--graview-lattice-tile) calc(var(--graview-lattice-tile) / 2),
196
- calc(var(--graview-lattice-tile) / 2) calc(var(--graview-lattice-tile) / 4),
197
- calc(var(--graview-lattice-tile) / 2) calc(var(--graview-lattice-tile) / 4);
198
-
199
- background-position: var(--graview-lattice-x, 0px) var(--graview-lattice-y, 0px);
200
-
201
- opacity: calc(var(--graview-kit-lattice, 1) * var(--graview-grid-alpha) * 2 * var(--graview-altitude));
202
- mask-image: linear-gradient(to top, #000 42%, rgba(0,0,0,0.35) 70%, transparent 92%);
203
- -webkit-mask-image: linear-gradient(to top, #000 42%, rgba(0,0,0,0.35) 70%, transparent 92%);
204
- }
205
-
206
-
207
- .graview-profile-keeping { display: grid; gap: 6px; }
208
- .graview-profile-keeping:not(:has(button, a)) { display: none; }
209
- .graview-profile-keeping > * { justify-self: start; }
210
-
211
- .graview-host-action:hover,
212
- .graview-host-action:focus-visible {
213
- background: var(--graview-wash);
214
- color: var(--graview-accent);
215
- }
216
-
217
-
218
-
219
- @keyframes graview-settle {
220
- from { opacity: 0; transform: translateY(7px); }
221
- }
222
-
223
-
224
- [data-graview-pick] {
225
- cursor: pointer;
226
- transition: filter 140ms ease, box-shadow 140ms ease;
227
- }
228
- [data-graview-pick]:hover {
229
- filter: brightness(${e==="light"?.96:1.18});
230
- }
231
- [data-graview-pick]:focus-visible {
232
- outline: 2px solid var(--graview-accent);
233
- outline-offset: 2px;
234
- border-radius: 7px;
235
- }
236
-
237
- [data-graview-slot]:focus-visible {
238
- outline: none;
239
- }
240
- [data-graview-slot]:focus-visible > span:first-of-type {
241
- box-shadow: 0 0 0 2px var(--graview-ground), 0 0 0 4px var(--graview-accent);
242
- }
243
-
244
-
245
- [data-graview-view] { cursor: pointer; }
246
- [data-graview-view]:hover { filter: brightness(${e==="light"?.985:1.12}); }
247
- [data-graview-view]:focus-visible {
248
- outline: 2px solid var(--graview-accent);
249
- outline-offset: 3px;
250
- border-radius: var(--graview-radius);
251
- }
252
-
253
- button {
254
- font: inherit;
255
- font-weight: var(--graview-weight-label);
256
- color: var(--graview-ink);
257
- padding: 7px 13px;
258
- border: 1px solid var(--graview-edge);
259
- border-radius: var(--graview-radius-sm, 8px);
260
- background: var(--graview-panel);
261
- box-shadow: ${e==="light"?"0 1px 2px rgba(24,33,58,0.05)":"none"};
262
- cursor: pointer;
263
- transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
264
- }
265
-
266
- button:hover:not(:disabled) {
267
- border-color: var(--graview-edge-bright);
268
- box-shadow: ${e==="light"?"0 1px 2px rgba(24,33,58,0.06), 0 6px 16px -8px rgba(24,33,58,0.2)":"0 0 0 1px var(--graview-accent-dim)"};
269
- }
270
- button:focus-visible {
271
- outline: 2px solid var(--graview-accent);
272
- outline-offset: 2px;
273
- }
274
- button:disabled { opacity: 0.45; cursor: default; }
275
-
276
- code { color: var(--graview-ink-muted); font-size: 0.8125rem; letter-spacing: 0.02em; }
277
-
278
-
279
- [data-graview-view] {
280
- transition: filter 260ms cubic-bezier(0.22, 1, 0.36, 1);
281
- }
282
-
283
-
284
- [data-graview-stage="dom"] [data-graview-view],
285
- [data-graview-stage="dom"] [data-graview-view] > [data-graview-natural] {
286
- pointer-events: none;
287
- }
288
-
289
-
290
-
291
- @keyframes graview-touched {
292
- 0% { box-shadow: 0 0 0 0 var(--graview-accent-dim); }
293
- 35% { box-shadow: 0 0 26px 3px var(--graview-accent-dim); }
294
- 100% { box-shadow: 0 0 0 0 transparent; }
295
- }
296
-
297
- @keyframes graview-landed {
298
- 0% { box-shadow: 0 0 0 0 var(--graview-activity); opacity: 0.55; }
299
- 30% { box-shadow: 0 0 30px 4px var(--graview-activity); opacity: 1; }
300
- 100% { box-shadow: 0 0 0 0 transparent; opacity: 1; }
301
- }
302
-
303
-
304
- @keyframes graview-considered {
305
- 0% { outline-color: transparent; }
306
- 25% { outline-color: var(--graview-activity); }
307
- 100% { outline-color: transparent; }
308
- }
309
-
310
-
311
- @keyframes graview-relation {
312
- 0% { stroke-opacity: 0.28; stroke-width: 1.4; }
313
- 30% { stroke-opacity: 1; stroke-width: 3; }
314
- 100% { stroke-opacity: 0.28; stroke-width: 1.4; }
315
- }
316
-
317
-
318
- @media (prefers-reduced-motion: reduce) {
319
- ${Ve(`${c}:not([data-graview-motion='full'])`,o)}
320
- }
321
- ${Ve(`${c}[data-graview-motion='reduce']`,o)}`}var M=$(G(),1);var y=$(E(),1);function gr({scheme:e,onScheme:a,profileHref:t,keeping:r,hostActions:l=Aa,signature:n=!1}){let{store:o,principal:c,seats:p,people:d}=Ce(),u=H("profile"),g=u.open,[f,s]=(0,M.useState)(!1);(0,M.useEffect)(()=>Oa(j),[]),g&&!f&&s(!0),(0,M.useEffect)(()=>{g&&j()},[g]);let m=c.id===void 0?void 0:o.graph.getNode(c.id),b=m===void 0?c.id===void 0?"Nobody in particular":ce(c,{graph:o.graph,schema:o.schema,seats:p,people:d}):se(o.schema.tryDefinition(m.kind),m);return(0,y.jsxs)("div",{style:{position:"relative"},children:[(0,y.jsx)("button",{type:"button","data-testid":"profile-button",...u.trigger,onClick:u.toggle,onPointerEnter:j,onFocus:j,"aria-label":`${b} \u2014 you, your seat and your settings`,title:`${b} \u2014 you, your seat and your settings`,style:{...O,borderRadius:999},children:(0,y.jsx)("span",{"aria-hidden":"true","data-testid":"profile-mark",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:N-4,height:N-4,borderRadius:999,fontSize:"0.8125rem",fontWeight:600,background:"var(--graview-panel-muted)",color:"var(--graview-ink)",border:"1px solid var(--graview-edge)"},children:za(b)})}),(0,y.jsxs)("section",{...u.pane,"aria-label":"Profile","data-testid":"profile","data-graview-offstage":"",hidden:!g,style:{...L,width:280,maxWidth:"calc(100vw - 32px)",maxHeight:"min(62cqh, 520px)",overflowY:"auto",overflowX:"hidden",display:g?"grid":"none",gap:12,padding:12,borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:[f?(0,y.jsx)(M.Suspense,{fallback:null,children:(0,y.jsx)(Ra,{part:"top",name:b,me:m,profileHref:t,hostActions:l,close:()=>u.setOpen(!1)})}):null,(0,y.jsxs)("div",{className:"graview-profile-keeping","data-testid":"profile-keeping",style:Ia,children:[(0,y.jsx)("span",{style:Wa,children:"Keeping this app"}),r]}),f?(0,y.jsx)(M.Suspense,{fallback:null,children:(0,y.jsx)(Na,{part:"rest",name:b,me:m,scheme:e,onScheme:a,hostActions:l,signature:n,close:()=>u.setOpen(!1)})}):null]})]})}var Aa=[],j=()=>B.prefetch(),Ra=B.part((e,a)=>(0,y.jsx)(e.ProfilePane,{...a}),{what:"The rest of your menu"}),Na=B.part((e,a)=>(0,y.jsx)(e.ProfilePane,{...a}),{quiet:!0});function Oa(e){let a=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&e()},t=globalThis;if(t.requestIdleCallback){let l=t.requestIdleCallback(a,{timeout:5e3});return()=>t.cancelIdleCallback?.(l)}let r=setTimeout(a,2500);return()=>clearTimeout(r)}function za(e){return(e.trim()[0]??"?").toUpperCase()}var Wa={fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},Ia={paddingTop:10,borderTop:"1px solid var(--graview-edge)"};var A=$(G(),1);var S=$(E(),1),Fa=B.part((e,a)=>(0,S.jsx)(e.ProblemRows,{...a}),{what:"The problems",as:"li"}),J=()=>B.prefetch();function hr({clean:e="All rules hold"}){let a=Ae(),{set:t}=He(),r=a.length,[l,n]=(0,A.useState)(!1),o=H("problems",{open:l&&r>0,onOpenChange:n}),c=o.open,p=qa(a,e);return(0,A.useEffect)(()=>{if(r===0)return;let d=setTimeout(J,1500);return()=>clearTimeout(d)},[r>0]),(0,S.jsxs)("div",{style:{position:"relative",display:"inline-flex"},children:[(0,S.jsxs)("button",{type:"button","data-testid":"standing",...o.trigger,"aria-disabled":r===0?!0:void 0,"aria-label":p,onClick:r===0?void 0:o.toggle,onPointerEnter:r===0?void 0:J,onFocus:r===0?void 0:J,title:p,style:{...O,padding:r===0?0:"0 8px",cursor:r===0?"default":"pointer",color:r===0?"var(--graview-ink-muted)":Ye(a),fontVariantNumeric:"tabular-nums",fontWeight:600},children:[(0,S.jsx)(Ga,{tone:r===0?"var(--graview-good)":Ye(a)}),r>0?(0,S.jsx)("span",{"aria-hidden":"true",children:r}):null]}),c?(0,S.jsx)("ol",{...o.pane,"data-testid":"problems",style:{...L,width:300,maxHeight:"min(48cqh, 420px)",overflow:"auto",margin:0,padding:4,listStyle:"none",display:"grid",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:(0,S.jsx)(A.Suspense,{fallback:null,children:(0,S.jsx)(Fa,{violations:a,pick:d=>{t(d.nodeIds),o.setOpen(!1)}})})}):null]})}function qa(e,a){return e.length===0?a:`${pe(e)} \u2014 open what is broken, and what would fix it`}var Ye=e=>e.some(a=>a.status==="could-not-judge"||a.status==="over-budget")?"var(--graview-bad)":"var(--graview-warn)";function Ga({tone:e}){return(0,S.jsx)("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:999,flex:"0 0 auto",background:e}})}export{or as a,Ma as b,ja as c,B as d,ga as e,er as f,ar as g,ua as h,rr as i,O as j,tr as k,gr as l,hr as m,qa as n,Ga as o};
@@ -1 +0,0 @@
1
- import{a as I,c as x}from"./chunk.7CO6VP6F.js";import"./chunk.7SVIRYBB.js";import"./chunk.ZMMMKTAG.js";import"./chunk.CW7BMVBG.js";import"./chunk.IZDKEFPJ.js";import"./chunk.AHDOKM4O.js";import"./chunk.6LJ66MB7.js";import{B as G,b,c as A,i as v,w,y as O}from"./chunk.OYULDOQP.js";import{Qa as S,Xb as W,ua as k,va as E}from"./chunk.VMEX2KZ4.js";import"./chunk.MRK6QJV5.js";import"./chunk.AJZBJBMO.js";var F=(e,i)=>S(e,i).slice(1);function j(e,i){let l=e.split("/").filter(Boolean);return l.length===i.length&&l.every((s,h)=>s.startsWith(":")||s==="*"||s===i[h])}var $=["problems","search","map","places"];function R(e,i,l,s,h=[]){let{schema:r}=i,o=r.kinds,f=t=>{if(t.startsWith(w))return(t.slice(w.length).split("|")[0]??"").split("+").every(V=>o.includes(V));let y=O(t);return y!==null?o.includes(y):t.startsWith("edge:")||l.graph.getNode(t)!==void 0},[p="/",u]=e.path.split("?"),n=p.split("/").filter(Boolean),m=u?`?${u}`:"",d=n.length>0&&!$.includes(n[0])?o.find(t=>F(r,t)===n[0]):void 0,c=e.path;if(n[0]==="places"&&n.length===2)`/places/${n[1]}`!==W&&!s.some(t=>t.as===decodeURIComponent(n[1]))&&(c="/");else if(d){let t=n[1]===void 0?void 0:decodeURIComponent(n[1]);c=`/${F(r,d)}${t!==void 0&&l.graph.getNode(t)?.kind===d?`/${n[1]}`:""}${m}`}else n.length>0&&n.length<=2&&!$.includes(n[0])&&!h.some(t=>j(t.path,n))&&(c="/");let g=A(e.stop),P=g.within?.view,U=P!==void 0&&!s.some(t=>t.as===P),a=g;if(U){let{view:t,...y}=g.within??{};a={...a,within:y}}if(g.focusId&&!f(g.focusId)){let t=e.kind&&o.includes(e.kind)?G(e.kind):null;a={...v(a,t),zoom:!1}}return a={...a,relation:a.relation&&(o.includes(a.relation)||r.edgeKinds.includes(a.relation))?a.relation:null,expanded:a.expanded.filter(f),pins:Object.fromEntries(Object.entries(a.pins).filter(([t])=>f(t))),...a.selection?{selection:a.selection.filter(f)}:{}},{face:e.face,path:c,stop:b(a),...e.kind?{kind:e.kind}:{}}}function B(e,i,l){let s=e.at,h=e.pages?.routes()??[];if(e.routing!=="address"||typeof window>"u")return R(s,e.app,i,l,h);let{pathname:r,search:o,hash:f}=window.location,p=E(r,e.basePath),u=I({routing:"address",...e.basePath===void 0?{}:{basePath:e.basePath},face:s.face}),n=u==="pages",m={...s,face:u,...p===null?{}:n?{path:p+o}:{stop:x(e.basePath)??s.stop}},d=R(m,e.app,i,l,h),c=n?d.path===m.path?null:k(d.path,e.basePath===void 0?{}:{basePath:e.basePath}):d.stop===b(A(m.stop))?null:r+o+d.stop;return p!==null&&c!==null&&c!==r+o+f&&window.history.replaceState(window.history.state,"",c),d}export{R as settle,B as settleAt};
@@ -1 +0,0 @@
1
- import{a as x,b as k,c as b,d as E,e as V}from"./chunk.VD6FJ6KJ.js";import{g as d}from"./chunk.OHGJ5BZ4.js";var S=["card","row","page"],O=["good","warn","bad","neutral","accent"],M=["money","percent","date","relative","count"],R=4,w=40,A=["number","money","percent"],N=["card","row"],F=100,$={title:[],headline:[],list:["sort","limit","group","empty","as"],text:["tone"],badge:["tone"],field:["as","currency","label"],image:["as","label"],progress:["label"],group:["direction"],when:["show"],divider:[],figure:["as","currency","label"]},W=Object.keys($),T=`{"title": "{name}"}, {"headline": "{count(all('offer'))} offers"}, {"figure": expr, "as"?: "number"|"money"|"percent", "currency"?, "label"?}, {"list": expr, "sort"?, "limit"?, "group"?, "empty"?, "as"?: "card"|"row"}, {"text": "\u2026", "tone"?}, {"badge": "{status}", "tone"?}, {"field": "quote", "as"?, "currency"?, "label"?}, {"image": "photos", "as"?: "thumb"|"gallery"}, {"progress": {"value": expr, "max": expr}, "label"?}, {"group": [blocks], "direction"?: "row"|"column"}, {"when": expr, "show": [blocks]}, {"divider": true}, {"figure": true}`,D=n=>/^(image|file)$/.test(n?.of??n?.type??"");function tn(n){return Object.fromEntries(Object.entries(n.views??{}).filter(([,e])=>!Array.isArray(e)))}function sn(n){let e=n.views?.home;return Array.isArray(e)?e:void 0}var G={field:()=>!1,relation:()=>!1,figure:!1},z=n=>n.kind??"the home",h=(n,e)=>n!==void 0&&Object.hasOwn(n,e),y=n=>typeof n=="object"&&n!==null&&!Array.isArray(n);function I(n,e,s){let o=x(n);for(let a of o.unknownFunctions)s.findings.push(d("unknown-function",e,`"${a}" is not a function the rule language knows`,"see docs/declaration-document.md#expression-language"));for(let a of o.names){if(s.kind===null){s.findings.push(d("view-name",e,`"${a}" names nothing here: these blocks are about no one record`,"reach records with all('<kind>'), like count(all('offer')) or first(all('party') where role == 'client').name"));continue}a==="id"||s.spec.field(a)||s.spec.relation(a)||s.findings.push(d("view-name",e,`${s.kind} has no field or relation called "${a}"`))}for(let a of o.edges)s.edges.has(a)||s.findings.push(d("view-edge",e,`"${a}" is not a relation any kind declares`));for(let a of o.sweeps)s.kinds.has(a)||s.findings.push(d("view-kind",e,`"${a}" is not a kind this document declares`))}function m(n,e,s){if(typeof n!="string"||n.length===0||n.length>2e3){s.findings.push(d("view-expression",e,`an expression is a line of the rule language, like "status == 'booked'"`));return}try{I(b(n),e,s)}catch(o){if(!(o instanceof k))throw o;s.findings.push(d("expression",e,`${o.sentence} (at character ${o.at+1})`))}}function j(n,e,s){if(typeof n!="string"||n.length===0||n.length>300){s.findings.push(d("view-template",e,'a template is words with {field} in braces, like "{name}" or "{quote|money}", at most 300 characters'));return}let o;try{o=V(n)}catch(a){if(a instanceof E||a instanceof k){s.findings.push(d("template",e,a.sentence));return}throw a}for(let a of o)a.expr&&I(a.expr,e,s)}function C(n,e,s){if(typeof n=="string"){O.includes(n)||s.findings.push(d("view-tone",e,`"${n}" is not a tone`,`use one of ${O.join(", ")}, or {"expr": "if(status == 'booked', 'good', 'neutral')"}`));return}if(y(n)&&Object.keys(n).length===1&&"expr"in n){m(n.expr,`${e}.expr`,s);return}s.findings.push(d("view-tone",e,'a tone is a word or {"expr": \u2026}',`one of ${O.join(", ")}`))}function v(n,e,s,o){if(!Array.isArray(n)){o.findings.push(d("view-shape",e,"a view is a list of blocks"));return}if(s>R){o.findings.push(d("view-depth",e,`blocks nest at most ${R} deep`,"flatten a group or a condition"));return}n.forEach((a,l)=>H(a,`${e}.${l}`,s,o))}function H(n,e,s,o){if(o.count++,!y(n)){o.findings.push(d("view-block",e,"a block is an object naming what it shows",`one of ${T}`));return}let a=Object.keys(n),l=a.filter(t=>W.includes(t)&&!(t==="group"&&a.includes("list")));if(l.length===0){o.findings.push(d("view-block",e,`${a.length>0?a.map(t=>`"${t}"`).join(", "):"an empty object"} is not a block Graview knows`,`one of ${T}`));return}if(l.length>1){o.findings.push(d("view-block",e,`a block is one thing, and this says ${l.map(t=>`"${t}"`).join(" and ")}`,"split it into two blocks"));return}let r=l[0];for(let t of a)t!==r&&t!="key"&&!$[r].includes(t)&&o.findings.push(d("unknown-key",`${e}.${t}`,`"${t}" is not part of a ${r} block`,$[r].length>0?`a ${r} block may also say ${$[r].map(f=>`"${f}"`).join(", ")}`:`a ${r} block says nothing else`));let i=n[r];switch(r){case"title":case"headline":case"text":case"badge":j(i,`${e}.${r}`,o),"tone"in n&&C(n.tone,`${e}.tone`,o);return;case"image":case"field":{let t=r==="image";if(typeof i!="string"||!(t?o.spec.files?.(i):o.spec.field(i))){let u=typeof i=="string"&&o.spec.relation(i);o.findings.push(d(`view-${r}`,`${e}.${r}`,`${o.kind} has no ${t?"image or file ":""}field ${typeof i=="string"?`"${i}"`:"by that name"}`,u?`"${i}" is a relation; show it with {"text": "{${i}.name}"}`:void 0))}let f=t?["thumb","gallery"]:M;"as"in n&&!f.includes(n.as)&&o.findings.push(d("view-format",`${e}.as`,`"${String(n.as)}" is not a way to show ${t?"pictures":"a field"}`,`use one of ${f.join(", ")}`)),t||L(n,e,o,"field"),"label"in n&&Y(n.label,`${e}.label`,o);return}case"progress":{!y(i)||Object.keys(i).some(t=>t!=="value"&&t!=="max")||!("value"in i)||!("max"in i)?o.findings.push(d("view-progress",`${e}.progress`,'progress is {"value": expression, "max": expression}')):(m(i.value,`${e}.progress.value`,o),m(i.max,`${e}.progress.max`,o)),"label"in n&&j(n.label,`${e}.label`,o);return}case"group":"direction"in n&&n.direction!=="row"&&n.direction!=="column"&&o.findings.push(d("view-direction",`${e}.direction`,`a group runs "row" or "column", not "${String(n.direction)}"`)),v(i,`${e}.group`,s+1,o);return;case"when":m(i,`${e}.when`,o),"show"in n?v(n.show,`${e}.show`,s+1,o):o.findings.push(d("view-when",e,'a condition says what it shows: {"when": expr, "show": [blocks]}'));return;case"figure":if(typeof i=="string")return P(n,e,o);for(let t of["as","currency","label"])t in n&&o.findings.push(d("unknown-key",`${e}.${t}`,`"${t}" belongs to a figure that works a number out; {"figure": true} is the kind's picture`,`write {"figure": "count(all('offer'))", "as": "number"}`));i!==!0?o.findings.push(d("view-block",`${e}.figure`,`a figure is a number worked out, {"figure": "sum(all('offer'), net)", "as": "money"}, or the kind's picture, {"figure": true}`)):o.spec.figure||o.findings.push(d("view-figure",`${e}.figure`,`${z(o)} has no figure to show`,o.kind===null?`work a number out: {"figure": "count(all('offer'))"}`:'give the kind a "figure", or leave this block out'));return;case"list":return X(n,e,o);case"divider":i!==!0&&o.findings.push(d("view-block",`${e}.${r}`,`write {"${r}": true}`));return}}function P(n,e,s){m(n.figure,`${e}.figure`,s),"as"in n&&!A.includes(n.as)&&s.findings.push(d("view-format",`${e}.as`,`"${String(n.as)}" is not a way to say a figure`,`use one of ${A.join(", ")}`)),L(n,e,s,"figure"),"label"in n&&j(n.label,`${e}.label`,s)}function L(n,e,s,o){"currency"in n&&(typeof n.currency!="string"||!/^[A-Z]{3}$/.test(n.currency)?s.findings.push(d("view-currency",`${e}.currency`,'a currency is its three-letter code, like "USD" or "EUR"')):n.as!=="money"&&s.findings.push(d("view-currency",`${e}.currency`,`a currency belongs on a ${o} shown as money`,'add "as": "money"')))}function U(n,e){let s=[...e.kinds],o=(l,r)=>{let i=new Set;for(let t of l){let f=e.vocabulary.namesOf(t)?.targets?.(r);if(f==="*")return s;for(let u of f??[])i.add(u)}return i.size>0?[...i]:void 0},a=l=>{switch(l.t){case"ident":return e.kind!==null&&e.spec.relation(l.name)?o([e.kind],l.name):void 0;case"member":{let r=a(l.object);return r?o(r,l.name):void 0}case"where":return a(l.set);case"call":{let r=l.args[0],i=r?.t==="lit"&&typeof r.value=="string"?r.value:void 0;if(l.fn==="all")return i!==void 0&&e.kinds.has(i)?[i]:void 0;let t=l.args.length===2&&l.args[1]?.t==="lit"&&typeof l.args[1].value=="string"?l.args[1].value:void 0;if(l.fn==="out"&&t!==void 0){let f=a(r);return f?o(f,t):void 0}if(l.fn==="out")return i!==void 0&&e.kind!==null?o([e.kind],i):void 0;if(l.fn==="in"){let f=t??i,u=t!==void 0?a(r):e.kind!==null?[e.kind]:void 0,c=f!==void 0?e.vocabulary.sources(f).filter(g=>{let p=e.vocabulary.namesOf(g)?.targets?.(f);return!u||p==="*"||u.some(K=>p?.includes(K))}):[];return c.length>0?c:void 0}if((l.fn==="sort"||l.fn==="first")&&r)return a(r);if(l.fn==="either"){let f=l.args.map(a);return f.every(u=>u!==void 0)?[...new Set(f.flatMap(u=>u??[]))]:void 0}return}default:return}};return a(n)}function _(n,e,s,o){let a;try{a=b(n)}catch(r){if(!(r instanceof k))throw r;o.findings.push(d("expression",e,`${r.sentence} (at character ${r.at+1})`));return}let l=x(a);for(let r of l.unknownFunctions)o.findings.push(d("unknown-function",e,`"${r}" is not a function the rule language knows`,"see docs/declaration-document.md#expression-language"));for(let r of l.edges)o.edges.has(r)||o.findings.push(d("view-edge",e,`"${r}" is not a relation any kind declares`));if(s)for(let r of l.names)r==="id"||s.some(i=>o.vocabulary.namesOf(i)?.field(r)||o.vocabulary.namesOf(i)?.relation(r))||o.findings.push(d("view-name",e,`${s.join(" and ")} ${s.length===1?"has":"have"} no field or relation called "${r}"`))}function X(n,e,s){let o=n.list;m(o,`${e}.list`,s);let a;if(typeof o=="string")try{a=U(b(o),s)}catch{a=void 0}let l=i=>{if(!a)return[...s.kinds].map(f=>s.vocabulary.namesOf(f)?.choices?.(i)).find(f=>f!==void 0);let t=a.map(f=>s.vocabulary.namesOf(f)?.choices?.(i));return t.every(f=>f!==void 0)?[...new Set(t.flatMap(f=>f??[]))]:void 0},r=a?a.join(" and "):"any kind";if("sort"in n){let i=n.sort;if(typeof i=="string")_(i,`${e}.sort`,a,s);else if(y(i)&&typeof i.by=="string"&&Object.keys(i).every(t=>t==="by"||t==="direction")){let t=i.direction;t!==void 0&&t!=="asc"&&t!=="desc"&&t!=="choices"?s.findings.push(d("list-sort",`${e}.sort.direction`,`a list is sorted "asc", "desc" or "choices", not "${String(t)}"`,'"choices" puts a choice field in the order its choices are declared')):t==="choices"?l(i.by)===void 0&&s.findings.push(d("list-sort",`${e}.sort.by`,`"${i.by}" is not a choice field of ${r}, so it has no declared order`,'sort by a choice field, or say "asc" or "desc"')):_(i.by,`${e}.sort.by`,a,s)}else s.findings.push(d("list-sort",`${e}.sort`,'a sort is a key, like "net", or {"by": key, "direction": "asc" | "desc" | "choices"}'))}if("limit"in n){let i=n.limit;(typeof i!="number"||!Number.isInteger(i)||i<1||i>F)&&s.findings.push(d("list-limit",`${e}.limit`,`a limit is a whole number from 1 to ${F}`))}if("group"in n){let i=n.group,t=typeof i=="string"?i:y(i)&&typeof i.by=="string"?i.by:void 0;if(!(typeof i=="string"||y(i)&&Object.keys(i).every(u=>u==="by"||u==="headings"))||t===void 0)s.findings.push(d("list-group",`${e}.group`,'a group is a choice field, like "type", or {"by": "type", "headings": {"pain": "What hurts"}}'));else{let u=l(t);if(u===void 0&&s.findings.push(d("list-group",`${e}.group`,`"${t}" is not a choice field of ${r}, so it has no choices to group by`,"group by a field whose type is enum")),y(i)&&"headings"in i){let c=i.headings;if(!y(c)||Object.values(c).some(g=>typeof g!="string"||g.length===0||g.length>80))s.findings.push(d("list-group",`${e}.group.headings`,'headings are words per choice, like {"pain": "What hurts"}, at most 80 characters each'));else if(u)for(let g of Object.keys(c))u.includes(g)||s.findings.push(d("list-group",`${e}.group.headings.${g}`,`"${g}" is not one of ${t}'s choices`,`use ${u.join(", ")}`))}}}"empty"in n&&(typeof n.empty!="string"||n.empty.length===0||n.empty.length>200)&&s.findings.push(d("list-empty",`${e}.empty`,"what an empty list says is a sentence, at most 200 characters")),"as"in n&&!N.includes(n.as)&&s.findings.push(d("list-as",`${e}.as`,`a list draws each record as its "card" or its "row", not "${String(n.as)}"`))}function Y(n,e,s){(typeof n!="string"||n.length===0||n.length>60)&&s.findings.push(d("view-label",e,"a label is a few words, at most 60 characters"))}function B(n,e,s,o,a,l,r){let i={kind:null,spec:G,kinds:o,edges:a,vocabulary:s,findings:l,count:0};Array.isArray(n)&&n.length===0&&l.push(d("view-shape",e,`${r} has no blocks`,'give it one: {"headline": "\u2026"}')),v(n,e,1,i),i.count>w&&l.push(d("view-size",e,`${r} has ${i.count} blocks; a view has at most ${w}`,"show less"))}function q(n,e,s,o,a){Array.isArray(n)&&n.forEach((l,r)=>{if(!y(l)||l.name!=="blocks"||!y(l.options)||!("blocks"in l.options))return;let i=[];B(l.options.blocks,`lenses.${r}.options.blocks`,e,s,o,i,`the lens "${String(l.title??r)}"`);for(let t of i)a.push({...t,severity:"warning"})})}function Z(n,e,s,o,a,l,r){let i=[];if(n===void 0)return i;if(!y(n))return i.push(d("view-shape",e,'views are an object of kinds, each with a "card", a "row" or a "page"')),i;for(let[t,f]of Object.entries(n)){if(t==="home"&&Array.isArray(f)){B(f,`${e}.home`,r,o,a,i,"the home");continue}let u=s(t);if(!u){i.push(d("view-kind",`${e}.${t}`,`"${t}" is not a kind this ${l} declares`));continue}if(!y(f)){i.push(d("view-shape",`${e}.${t}`,`a kind's views are {"card": [blocks], "row": [blocks], "page": [blocks]}`));continue}for(let c of Object.keys(f))S.includes(c)||i.push(d("view-slot",`${e}.${t}.${c}`,`"${c}" is not a place a view is drawn`,`use ${S.map(g=>`"${g}"`).join(", ")}`));for(let c of S){let g=f[c];if(g===void 0)continue;let p={kind:t,spec:u,kinds:o,edges:a,vocabulary:r,findings:i,count:0};v(g,`${e}.${t}.${c}`,1,p),p.count>w&&i.push(d("view-size",`${e}.${t}.${c}`,`this ${c} has ${p.count} blocks; a view has at most ${w}`,"show less, or move detail to the page"))}}return i}function rn(n){let e=new Set(Object.keys(n.kinds)),s=new Set(Object.values(n.kinds).flatMap(r=>Object.keys(r.edges??{}))),o=r=>{let i=h(n.kinds,r)?n.kinds[r]:void 0;return i?{field:t=>h(i.fields,t)||h(i.computed,t),relation:t=>h(i.edges,t),figure:i.figure!==void 0,files:t=>h(i.fields,t)&&D(i.fields[t]),choices:t=>h(i.fields,t)&&i.fields[t].type==="enum"?i.fields[t].options:void 0,targets:t=>h(i.edges,t)?i.edges[t].to:void 0}:void 0},a={namesOf:o,sources:r=>Object.keys(n.kinds).filter(i=>h(n.kinds[i].edges,r))},l=Z(n.views,"views",o,e,s,"document",a);return q(n.lenses,a,e,s,l),l}export{O as a,M as b,A as c,F as d,tn as e,sn as f,rn as g};
@@ -1 +0,0 @@
1
- import{a as c,b as d,c as e,d as f,e as g,f as h,g as i}from"./chunk.LHAAZQNQ.js";import{a,b}from"./chunk.PHY3AH3L.js";import"./chunk.QZWN46V6.js";import"./chunk.6LJ66MB7.js";import"./chunk.OYULDOQP.js";import"./chunk.VMEX2KZ4.js";import"./chunk.MRK6QJV5.js";import"./chunk.AJZBJBMO.js";export{c as ARRANGE_NARROW,h as ArrangeBar,i as arrangementCaption,a as arrangementOf,f as directionWords,e as inSentence,g as preloadArrangeLists,d as sayCondition,b as withArrangement};
@@ -1 +0,0 @@
1
- import{d as R}from"./chunk.EVTZE2OZ.js";import{a as q}from"./chunk.NQNQPPPM.js";import{$ as X,O as Q,P as V,S as z,V as Y,Z as A,Za as nn,_ as D,ab as B,ka as L,la as Z}from"./chunk.VMEX2KZ4.js";var E=c=>c.filter(Boolean).join(" "),en=new Set(["tell","me","about","what","how","show","describe","the","a","an","and","please"]),an=new Set([...en,"where","is","are","was","find","any","anything","something","things","called","named","which","who","of","for","with","to","in","on","i","my","do","does","have","has","can","you","it","that","this","there","we","our","got","be"]),dn=c=>c.length<=1?A(c[0]??"something"):`${c.slice(0,-1).map(A).join(", ")} and ${A(c[c.length-1])}`;function bn(c={}){return async(t,u,g={})=>{let w=u.toLowerCase(),h=n=>V(t.schema.tryDefinition(n.kind),n),y=(await import("./chunk.GHMICJIB.js")).goingFrom(t,u,g,c.today);if(y.reply)return y.reply;let v=y.told,S=n=>y.moves?{...n,moves:y.moves}:n,p=[],C=w.split(/[^a-z0-9]+/).filter(Boolean),I=new Set;for(let n=0;n<C.length;n++){let e="";for(let s=n;s<Math.min(C.length,n+6);s++)e+=C[s],I.add(e)}let T=n=>n.toLowerCase().replace(/[^a-z0-9]+/g,""),H=[...t.graph.allNodes()].map(n=>({node:n,label:T(h(n))})).filter(({label:n})=>n.length>=2&&I.has(n)).sort((n,e)=>e.label.length-n.label.length),N=new Map;for(let{label:n}of H)N.set(n,(N.get(n)??0)+1);for(let{node:n,label:e}of H)(N.get(e)??0)>1||p.some(s=>s.id===n.id)||p.push(n);for(let n of g.selection??[]){let e=t.graph.getNode(n);e&&!p.some(s=>s.id===e.id)&&p.push(e)}let M=v&&t.graph.getNode(v);if(M){let n=p.findIndex(e=>e.id===M.id);n>=0&&p.splice(n,1),p.unshift(M)}let b=t.violations(),O=(n=b)=>ln(n);if(y.problems||!v&&/\b(wrong|broken|problem|violat|standing)\b/.test(w)){if(b.length===0)return S({say:"Nothing is wrong: every rule holds.",proposals:[],grounded:!0});let n=R(t,O().slice(0,4)),e=(i,r)=>{let d=t.allMutations().find(l=>l.name===i),a=d?q(d.input).find(l=>l.name===r):void 0;return a?.control==="node"&&!a.kinds.includes("*")?a.kinds.map(l=>D(t.schema.tryDefinition(l),l)).join(" or "):B(t.schema,d,r).label},s=[...new Set(b.flatMap(i=>i.repairs).filter(i=>(i.missing??[]).length>0).map(i=>`\u201C${i.label}\u201D (${(i.missing??[]).map(r=>e(i.mutation,r)).join(", ")})`))];return S({say:E([y.moves?.[0]?.said??"",`${Z(b)}:`,b.slice(0,4).map(i=>i.message).join("; ")+(b.length>4?"\u2026":"."),n.length>0?"The repairs below come from the rules themselves.":s.length>0?`Each way to fix ${b.length===1?"it":"these"} asks something first \u2014 ${s.slice(0,4).join(" or ")} \u2014 select the record and its own actions will ask.`:"No rule here names a way to fix it."]),proposals:n,grounded:!0})}let K=/\?\s*$/.test(u)||/^\s*(what|who|whom|whose|which|when|where|why|how|is|are|was|were|does|do|did|can|could|should|would|will|has|have)\b/.test(w),$=K?void 0:t.allMutations().find(n=>{let e=(n.title??n.name).toLowerCase();return e.length>3&&w.includes(e)});if($){let n={},e=[],s=u.slice(u.toLowerCase().indexOf(($.title??$.name).toLowerCase())+($.title??$.name).length),i=p.reduce((a,l)=>{let f=h(l).toLowerCase(),m=a.toLowerCase().indexOf(f);return m<0?a:`${a.slice(0,m)} it${a.slice(m+f.length)}`},s),r=u.match(/"([^"]+)"/)?.[1]??i.match(/^(?:\s+(?:it|this|that|them))?\s+(?:to|as)\s+(.+?)\s*[.!]?$/i)?.[1],d=[...p];for(let a of q($.input)){let l=un(a,d,r,c.today??g.today,w);if(l!==void 0){n[a.name]=l;let f=d.findIndex(m=>m.id===l);f>=0&&d.splice(f,1)}else a.optional||e.push(B(t.schema,$,a.name).label.toLowerCase())}return e.length===0?{say:"I can do that. Review it below.",proposals:R(t,[{mutation:$.name,args:n,why:"you asked in words"}])}:{say:`\u201C${$.title??z($.name)}\u201D needs ${dn(e)} \u2014 say ${e.length===1?"it":"them"} (or select ${e.length===1?"it":"them"}) and ask again.`,proposals:[]}}let tn={mon:"mon",monday:"mon",tue:"tue",tues:"tue",tuesday:"tue",wed:"wed",wednesday:"wed",thu:"thu",thur:"thu",thurs:"thu",thursday:"thu",fri:"fri",friday:"fri",sat:"sat",saturday:"sat",sun:"sun",sunday:"sun"},x=C.map(n=>tn[n]).find(Boolean),_=(n,e,s)=>{let i=t.schema.tryDefinition(n)?.display?.format?.[e];return i?i(s):String(s)},F=n=>{let e=t.schema.tryDefinition(n.kind)?.fieldRoles;if(!e?.start)return null;let s=n[e.start],i=e.end?n[e.end]:void 0,r=e.day?n[e.day]:e.days?n[e.days]:void 0;return s===void 0&&i===void 0?null:[s!==void 0?_(n.kind,e.start,s):null,i!==void 0&&e.end?`\u2013${_(n.kind,e.end,i)}`:null,Array.isArray(r)?` on ${r.join(", ")}`:r!==void 0?` on ${String(r)}`:null].filter(Boolean).join("")||null},sn=n=>{let e=[];for(let s of t.graph.allEdges()){let i=s.from===n?s.to:s.to===n?s.from:null;if(!i)continue;let r=t.graph.getNode(i);r&&!e.some(d=>d.id===r.id)&&e.push(r)}return e},G=n=>{let e=p[0];if(!e)return[];let s=[];for(let r of sn(e.id)){let d=0,a=T(h(r));for(let l of C)l.length>2&&a.includes(l)&&(d+=1);if(x){let l=t.schema.tryDefinition(r.kind)?.fieldRoles,f=l?.day?r[l.day]:void 0,m=l?.days?r[l.days]:void 0;f===x?d+=4:Array.isArray(m)&&m.includes(x)&&(d+=1)}n&&!F(r)||d>0&&s.push({node:r,score:d})}let i=s.sort((r,d)=>d.score-r.score).map(r=>r.node);return n&&F(e)?i.unshift(e):n||i.push(e),i};if(p.length>0&&/\bwhen\b/.test(w)){let n=G(!0)[0]??null,e=n?F(n):null;if(n&&e)return S({say:`${h(n)} runs ${e}.`,proposals:R(t,O(L(b,[n.id])).slice(0,3)),grounded:!0})}if(p.length>0&&/\bwho(m|se)?\b/.test(w))for(let n of G(!1)){let e=[],s=new Set;for(let i of t.schema.definitions)for(let[r,d]of Object.entries(i.edges)){let a=/\bwho\b/i.test(d.description??""),l=/\bwho\b/i.test(d.inverse??"");if(!a&&!l||s.has(r))continue;s.add(r);let f=[...t.graph.in(n.id,r),...t.graph.out(n.id,r)];if(f.length===0)continue;let m=a?d.description:d.inverse;e.push(`${m}: ${f.map(o=>h(o)).join(", ")}`)}if(e.length>0)return S({say:`${h(n)} \u2014 ${e.join("; ")}.`,proposals:R(t,O(L(b,[n.id])).slice(0,3)),grounded:!0})}if(p.length>0){let n=p[0],e=new Set(h(n).toLowerCase().split(/[^a-z0-9]+/).filter(Boolean)),s=C.every(o=>e.has(o)||en.has(o)),i=K||s,r=t.schema.tryDefinition(n.kind),d=o=>o===o.toUpperCase()?o:o.charAt(0).toLowerCase()+o.slice(1),a=X(n,r,{limit:3}).map(o=>{let k=n[o.key];return typeof k=="boolean"&&!/\s/.test(o.label)?k?d(o.label):`not ${d(o.label)}`:typeof k=="string"&&hn.test(k)?`${d(o.label)} ${pn(k)}`:o.alone.startsWith(o.label)?d(o.label)+o.alone.slice(o.label.length):`${d(o.label)} ${o.alone}`}).join(", "),l=L(b,[n.id]),f=new Map;for(let o of[...t.graph.allEdges()]){let k=o.from===n.id?"out":o.to===n.id?"in":null;if(!k)continue;let J=t.graph.getNode(k==="out"?o.to:o.from);if(!J)continue;let P=`${o.kind}|${k}`;if(!f.has(P)){let W;for(let rn of t.schema.definitions){let j=rn.edges[o.kind];if(j&&(W=k==="out"?j.description:j.inverse??j.description,W))break}f.set(P,{sentence:W??z(o.kind).toLowerCase(),names:[]})}let U=f.get(P);U.names.length<6&&U.names.push(h(J))}let m=[...f.values()].slice(0,4).map(o=>`${o.sentence.charAt(0).toUpperCase()}${o.sentence.slice(1)}: ${o.names.join(", ")}`).join(". ");return S({say:E([y.moves?.[0]?.said??"",`${h(n)} \u2014 ${A(D(t.schema.tryDefinition(n.kind),n.kind))}${a?` (${a})`:""}.`,m?`${m}.`:"Connected to nothing yet.",l.length>0?`Trouble: ${l.map(o=>o.message).join("; ")}.`:"Nothing about it is broken."]),proposals:R(t,O(l).slice(0,3)),...i||v?{grounded:!0}:{}})}{let n=w.split(/[^\p{L}\p{N}]+/u).filter(e=>e.length>0&&!an.has(e));if(n.length>0){let e=nn(t,n.join(" "),{...g.principal?{principal:g.principal}:{},...g.selection?{from:g.selection}:{},...c.today??g.today?{today:c.today??g.today}:{},limit:6}),s=e.hits.filter(i=>i.about==="node");if(s.length>0){let i=Q(s.flatMap(a=>{let l=t.graph.getNode(a.id);return l?[l]:[]}),a=>t.schema.tryDefinition(a)),r=s.map(a=>`${a.label}${i.has(a.id)?` \xB7 ${i.get(a.id)}`:""} (${D(t.schema.tryDefinition(a.kind),a.kind)}${a.why.field==="label"?"":`, ${a.why.reading.toLowerCase()}: ${a.why.fragment}`})`);return{say:`${e.total===1?"One thing is":`${gn(e.total)} things are`} called \u201C${e.words}\u201D \u2014 ${r.join("; ")}${e.total>s.length?`; and ${e.total-s.length} more`:""}.`,proposals:[],picks:s}}}}let on=t.schema.kinds.filter(n=>!t.modules.disabledKinds.has(n)).map(n=>{let e=Y(t.schema,n);return`${t.graph.nodesOfKind(n).length} ${e}`}).join(", ");return{say:E([`This graph holds ${on}.`,"Ask about anything by name, ask what's wrong, or say a change in its own words \u2014",`like "${t.allMutations()[0]?.title??"an action"}".`]),proposals:[],unsure:!0}}}function ln(c){return c.flatMap(t=>{let u=t.repairs.find(g=>!g.missing?.length);return u?[{mutation:u.mutation,args:{...u.args},why:t.message}]:[]})}var cn=["No","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten"],gn=c=>cn[c]??String(c);function un(c,t,u,g,w=""){switch(c.control){case"node":return t.find(y=>c.kinds.includes("*")||c.kinds.includes(y.kind))?.id;case"text":return u;case"date":{let h=g??new Date().toISOString().slice(0,10);return c.time?`${h}T09:00`:h}case"choice":{let h=new Set(w.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean)),y=(c.options??[]).filter(v=>v.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean).every(S=>h.has(S)));return y.length===1?y[0]:void 0}default:return}}function $n(c){return async(t,u,g={})=>(await import("./chunk.IXVSJJQH.js")).answerWithModel(c,t,u,g)}var hn=/^\d{4}-\d{2}-\d{2}$/,fn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function pn(c){let[t,u,g]=c.split("-").map(Number);return`${g} ${fn[u-1]??""} ${t}`}export{bn as a,ln as b,$n as c};
@@ -1 +0,0 @@
1
- import"./chunk.WVUJXDXZ.js";import{i as S}from"./chunk.UMMN5Z6V.js";import"./chunk.DG2WKNMX.js";import"./chunk.HPD3DSTP.js";import"./chunk.VD6FJ6KJ.js";import"./chunk.OHGJ5BZ4.js";import{P as R}from"./chunk.VMEX2KZ4.js";import"./chunk.AJZBJBMO.js";var p=(n,e,t)=>({untrusted:!0,authoredBy:t.say(e),text:n});function $(n,e){let t;for(let[s,r]of Object.entries(n)){if(typeof r!="string"||s==="id"||s==="kind")continue;let o=e.fieldBy(n.id,s);o&&(t??={...n},t[s]=p(r,o,e))}return t??n}function B(n,e,t){let s=r=>{if(Array.isArray(r))return r.map(s);if(r!==null&&typeof r=="object"&&"id"in r&&"label"in r){let o=r,a=t.recordBy(o.id);return a?{...o,label:p(o.label,a,t)}:o}if(typeof r=="string"){let o=t.recordBy(n);return o?p(r,o,t):r}return r};return Object.fromEntries(Object.entries(e).map(([r,o])=>[r,s(o)]))}function N(n,e){return n.map(t=>{let s=e.recordBy(t.id);return s?{...t,label:p(t.label,s,e)}:t})}function M(n,e){return{...n,nodes:n.nodes.map(t=>$(t,e))}}var O=n=>(JSON.stringify(n)??"null").length,A=n=>typeof n=="number"&&Number.isFinite(n)&&n>0?Math.floor(n):0;function f(n,e,t,s,r,o=""){let a=n-e-t;return a>0?`and ${a} more ${r}: call ${s} with ${o}offset ${e+t} for the next page.`:void 0}var _=({line:n,...e})=>e;function j(n){let e;for(let[t,s]of Object.entries(n))typeof s!="string"||s.length<=600||(e??={...n},e[t]=`${s.slice(0,600)}\u2026 (cut at ${600} of ${s.length} characters)`);return e??n}function E(n,e,t,s){let r=Math.min(t,Math.max(0,n.length-e)),o=n.slice(e,e+r),a=s(o);for(;r>1&&O(a)>8e3;)r=Math.max(1,Math.floor(r*.75)),o=n.slice(e,e+r),a=s(o);return{page:o,answer:a}}function V(n,e){let t=JSON.stringify(e)??"null";if(t.length<=8e3)return e;let s=`This answer was ${t.length} characters, more than the ${8e3} one read answers, so it is cut. Ask ${n} for less, or use search_graph and get_node to read one thing.`;for(let r=8e3-s.length-40;;){let o={cut:s,partial:t.slice(0,r)},a=O(o)-8e3;if(a<=0)return o;r=Math.max(0,r-a-8)}}function C(n,e){let{matched:t,...s}=e,r=n.hits.filter(o=>o.about==="node").length;return n.total>r?{...s,more:`and ${n.total-r} more records match: narrow the words, or add kind:<kind>.`}:s}function I(n,e,t){let s=n.graph.snapshot(),r=A(t.offset),o=s.nodes.length,{page:a,answer:h}=E(s.nodes,r,25,d=>{let c=new Set(d.map(l=>l.id)),u=f(o,r,d.length,"get_graph","nodes");return{...M({nodes:d.map(j),edges:s.edges.filter(l=>c.has(l.from))},e),total:o,...u?{more:u}:{}}});return{data:h,reads:a.map(d=>d.id)}}function P(n,e,t,s){let r=n.graph.getNode(t),o=A(s.offset),a=n.graph.outEdges(t),h=n.graph.inEdges(t),d=a.slice(o,o+20),c=h.slice(o,o+20),u=(i,y)=>{let k=n.graph.getNode(y);return{kind:i,id:y,label:k?R(n.schema.tryDefinition(k.kind),k):y}},l=S(n.schema,n.graph,r),m=n.violations().filter(i=>i.nodeIds.includes(t)),b=[f(a.length,o,d.length,"get_node","links out",`id "${t}" and `),f(h.length,o,c.length,"get_node","links in",`id "${t}" and `),m.length>20?`and ${m.length-20} more problems: get_violations lists them.`:void 0].filter(Boolean);return{data:{node:$(j(r),e),...Object.keys(l.values).length>0?{computed:B(t,l.values,e)}:{},...Object.keys(l.refused).length>0?{uncomputed:l.refused}:{},out:N(d.map(i=>u(i.kind,i.to)),e),in:N(c.map(i=>u(i.kind,i.from)),e),violations:m.slice(0,20).map(_),...b.length>0?{more:b.join(" ")}:{}},reads:[t,...d.map(i=>i.to),...c.map(i=>i.from)]}}function U(n,e){let t=A(e.offset),{page:s,answer:r}=E(n,t,20,o=>{let a=f(n.length,t,o.length,"get_violations","problems");return{violations:o.map(_),total:n.length,...a?{more:a}:{}}});return{data:r,reads:[...new Set(s.flatMap(o=>o.nodeIds))]}}export{I as graphRead,P as nodeRead,C as searchRead,U as violationsRead,V as withinReadChars};
@@ -1 +0,0 @@
1
- import{a as y}from"./chunk.NQNQPPPM.js";import{B as f,Ba as p,P as d,ya as m}from"./chunk.VMEX2KZ4.js";function P(n){let e=n.indexOf("{"),t=n.indexOf("["),a=t!==-1&&(e===-1||t<e)?t:e;if(a===-1)return;let r=n[a],i=r==="["?"]":"}",o=0,l=!1,s=!1;for(let u=a;u<n.length;u++){let c=n[u];if(l){s?s=!1:c==="\\"?s=!0:c==='"'&&(l=!1);continue}if(c==='"')l=!0;else if(c===r)o+=1;else if(c===i&&(o-=1,o===0))try{return JSON.parse(n.slice(a,u+1))}catch{return}}}function g(n,e){let t;try{t=n.mutation(e.mutation)}catch{return e}let a={...e.args},r=!1;for(let i of y(t.input)){if(i.control!=="node")continue;let o=a[i.name];if(typeof o!="string"||o.length===0||n.graph.getNode(o))continue;let l=o.trim().toLowerCase(),s=[...n.graph.allNodes()].filter(u=>(i.kinds.includes("*")||i.kinds.includes(u.kind))&&d(n.schema.tryDefinition(u.kind),u).trim().toLowerCase()===l);s.length===1&&(a[i.name]=s[0].id,r=!0)}return r?{...e,args:a}:e}function x(n,e,t){let a=t===void 0?null:new Set(t),r=[];for(let i of e){if(typeof i.mutation!="string")continue;let o=!0;try{n.mutation(i.mutation)}catch{o=!1}o?a&&!a.has(i.mutation)&&r.push({proposal:i,why:"not-allowed"}):r.push({proposal:i,why:"unknown"})}return r}function C(n,e,t){let a=t===void 0?null:new Set(t);return e.filter(r=>{if(typeof r.mutation!="string"||a&&!a.has(r.mutation))return!1;try{n.mutation(r.mutation)}catch{return!1}return r.args!==null&&typeof r.args=="object"})}function b(n,e){let t=n.allMutations().find(l=>l.name===e.mutation);if(t?.describe){let l=g(n,e),s=t.input.safeParse?.(l.args);if(s?.success)try{return t.describe(s.data,n.graph)}catch{}}let a=t?.subject?.arg,r=a?e.args[a]:void 0,i=typeof r=="string"?n.graph.getNode(r):void 0,o=t?.title??e.mutation;return i?`${o} \u2014 ${d(n.schema.tryDefinition(i.kind),i)}`:o}function A(n,e){let t=n.allMutations().find(o=>o.name===e.mutation);if(!t)return[];e=g(n,e);let a=t.input.shape??{},r=m(t.input),i=[];for(let o of Object.keys(a)){if(k(a[o]))continue;let l=e.args[o],s=r.find(c=>c.name===o);l!=null&&l!==""&&(!s||typeof l!="string"||n.graph.getNode(l)!==void 0)||i.push({name:o,...s?{kinds:s.kinds}:{},...s?{candidates:s.kinds.includes("*")?n.graph.allNodes().map(c=>c.id):s.kinds.flatMap(c=>n.graph.nodesOfKind(c).map(h=>h.id))}:{},shape:p(t.input,o)})}return i}function k(n){let e=f(n)?.type;return e==="optional"||e==="default"||e==="nullable"}export{P as a,g as b,x as c,C as d,b as e,A as f};