graview 0.1.29 → 0.1.30
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.
- package/dist/preview/{chunk.X53HI436.js → chunk.26CZTUY4.js} +1 -1
- package/dist/preview/chunk.2CIBWZJG.js +1 -0
- package/dist/preview/chunk.2EXGG6BB.js +1 -0
- package/dist/preview/chunk.2NBYNZRD.js +1 -0
- package/dist/preview/chunk.2XAONC66.js +1 -0
- package/dist/preview/chunk.34ZMMURV.js +27 -0
- package/dist/preview/{chunk.44FVJOK4.js → chunk.3ADPAGPY.js} +1 -1
- package/dist/preview/chunk.3JGGBLRB.js +1 -0
- package/dist/preview/chunk.3JNMSOFG.js +1 -0
- package/dist/preview/chunk.3R4W2P5X.js +1 -0
- package/dist/preview/chunk.3SKKIHU3.js +4 -0
- package/dist/preview/{chunk.OGXE2RHC.js → chunk.3URFMWXZ.js} +2 -2
- package/dist/preview/chunk.3VL5WECB.js +1 -0
- package/dist/preview/chunk.42YX6NOY.js +2 -0
- package/dist/preview/{chunk.XAXJHEMD.js → chunk.4ALKPNXM.js} +1 -1
- package/dist/preview/chunk.4HP7UWA2.js +1 -0
- package/dist/preview/{chunk.ZBXOX3W3.js → chunk.4SJUTBDV.js} +1 -1
- package/dist/preview/chunk.5U5J3ISK.js +1 -0
- package/dist/preview/{chunk.YCA7P5MK.js → chunk.6T2Q6NLO.js} +1 -1
- package/dist/preview/chunk.6V2RG5JG.js +5 -0
- package/dist/preview/chunk.6XMEU2Q2.js +1 -0
- package/dist/preview/chunk.7BWT5L2L.js +1 -0
- package/dist/preview/chunk.AK3IHFCF.js +1 -0
- package/dist/preview/chunk.BPWNWE7N.js +1 -0
- package/dist/preview/{chunk.YRQZZH5V.js → chunk.C5CYZNSJ.js} +1 -1
- package/dist/preview/chunk.CM6LOIQE.js +88 -0
- package/dist/preview/{chunk.IPBXAAQV.js → chunk.D3IECJ2S.js} +1 -1
- package/dist/preview/chunk.DT7LHWU2.js +1 -0
- package/dist/preview/chunk.DZRTOURR.js +1 -0
- package/dist/preview/{chunk.JNGUSAWX.js → chunk.ERXSYPYL.js} +17 -3
- package/dist/preview/chunk.FDELO7NY.js +116 -0
- package/dist/preview/chunk.FGVKJWNS.js +6 -0
- package/dist/preview/{chunk.7D77HEIJ.js → chunk.FWCOJDOD.js} +1 -1
- package/dist/preview/chunk.GFF2FB2J.js +25 -0
- package/dist/preview/chunk.GLBHQFJ2.js +1 -0
- package/dist/preview/{chunk.ZSKP6UQS.js → chunk.HHI65WFZ.js} +1 -1
- package/dist/preview/chunk.HHPGWJDO.js +2 -0
- package/dist/preview/chunk.HSCTWAUV.js +1 -0
- package/dist/preview/chunk.INZUEWC5.js +1 -0
- package/dist/preview/{chunk.QNHECGMH.js → chunk.J2ITFGN3.js} +1 -1
- package/dist/preview/chunk.JH6MU6TX.js +2 -0
- package/dist/preview/chunk.JISMMIMX.js +1 -0
- package/dist/preview/chunk.JN7DIFR3.js +1 -0
- package/dist/preview/chunk.JPHNKWTY.js +1 -0
- package/dist/preview/chunk.JTNWD2CN.js +1 -0
- package/dist/preview/chunk.K75FUIZI.js +1 -0
- package/dist/preview/chunk.K776HO42.js +2 -0
- package/dist/preview/chunk.KN3ULTGF.js +1 -0
- package/dist/preview/chunk.KOB6N3SL.js +1 -0
- package/dist/preview/chunk.KQT7WAQE.js +1 -0
- package/dist/preview/chunk.L4DECHXR.js +327 -0
- package/dist/preview/{chunk.J46KDTEZ.js → chunk.L6OMEYL6.js} +1 -1
- package/dist/preview/chunk.LQ7V6KEE.js +1 -0
- package/dist/preview/{chunk.AVUS5LMG.js → chunk.MD74YVRN.js} +2 -2
- package/dist/preview/chunk.MGNP4LAM.js +1 -0
- package/dist/preview/chunk.NCTOBUCT.js +1 -0
- package/dist/preview/chunk.NDADLJE6.js +1 -0
- package/dist/preview/{chunk.64P76WK4.js → chunk.NO52VON3.js} +1 -1
- package/dist/preview/{chunk.5AT4O4BN.js → chunk.O2LK2AO7.js} +1 -1
- package/dist/preview/chunk.OAF7TUMI.js +1 -0
- package/dist/preview/{chunk.WLRTPFAC.js → chunk.OQ4KFN6W.js} +1 -1
- package/dist/preview/chunk.OXQMNIRO.js +1 -0
- package/dist/preview/chunk.OZNW5W4Z.js +1 -0
- package/dist/preview/{chunk.HV6I74DF.js → chunk.PAVR5TK5.js} +1 -1
- package/dist/preview/chunk.PKK6FRZR.js +2 -0
- package/dist/preview/chunk.QIAKO27D.js +1 -0
- package/dist/preview/{chunk.CK7QWLMX.js → chunk.QNGWEV47.js} +1 -1
- package/dist/preview/{chunk.3G5MQFZK.js → chunk.QTA4ROAK.js} +1 -1
- package/dist/preview/chunk.QTMWHE5O.js +1 -0
- package/dist/preview/chunk.R26DREVU.js +1 -0
- package/dist/preview/chunk.RI3PYG5T.js +19 -0
- package/dist/preview/{chunk.ONGVH3ZM.js → chunk.RIEHYQLK.js} +44 -19
- package/dist/preview/chunk.RRVIXV7W.js +1 -0
- package/dist/preview/{chunk.BZ5OJYHU.js → chunk.RYT5U3QM.js} +1 -1
- package/dist/preview/chunk.SE5SKFQH.js +1 -0
- package/dist/preview/chunk.SHPXD6FC.js +1 -0
- package/dist/preview/chunk.SOBC3CTN.js +47 -0
- package/dist/preview/chunk.SOD3PBJM.js +1 -0
- package/dist/preview/{chunk.QSDT2RLY.js → chunk.T3VPD7JQ.js} +1 -1
- package/dist/preview/chunk.TI4OSTQV.js +1 -0
- package/dist/preview/chunk.UDSEJKCY.js +1 -0
- package/dist/preview/chunk.UGFDSE37.js +1 -0
- package/dist/preview/{chunk.IZW7DBK4.js → chunk.UWGWXFWZ.js} +1 -1
- package/dist/preview/{chunk.T4LY5QXO.js → chunk.UZWWDAGM.js} +1 -1
- package/dist/preview/chunk.V5ZYUVMH.js +1 -0
- package/dist/preview/chunk.V7BDAGDE.js +35 -0
- package/dist/preview/chunk.VG56IUIQ.js +9 -0
- package/dist/preview/chunk.VOAZBHCG.js +1 -0
- package/dist/preview/{chunk.O4QPITBD.js → chunk.VS7K3SCD.js} +1 -1
- package/dist/preview/{chunk.Z5V23DQN.js → chunk.VSZQXB4Q.js} +2 -2
- package/dist/preview/chunk.W3S6UXNA.js +1 -0
- package/dist/preview/chunk.WAFDCOOG.js +3 -0
- package/dist/preview/chunk.WYTIOLPP.js +1 -0
- package/dist/preview/chunk.X37L5TN5.js +1 -0
- package/dist/preview/{chunk.GZH6PTXN.js → chunk.XRJBLH4N.js} +1 -1
- package/dist/preview/{chunk.D4GOVA25.js → chunk.XS7YFNDU.js} +1 -1
- package/dist/preview/{chunk.V6TK4LHW.js → chunk.XSTXV6FP.js} +4 -4
- package/dist/preview/chunk.Y4UXEL6Y.js +1 -0
- package/dist/preview/chunk.YJUB4OD7.js +1 -0
- package/dist/preview/chunk.YLQB3KBA.js +1 -0
- package/dist/preview/{chunk.XXHNV24G.js → chunk.YNQDVGZM.js} +1 -1
- package/dist/preview/chunk.YV2LJFGS.js +1 -0
- package/dist/preview/chunk.Z2YUYZT4.js +1 -0
- package/dist/preview/chunk.ZYKAS4BT.js +1 -0
- package/dist/preview/page.js +6 -6
- package/package.json +6 -6
- package/dist/preview/chunk.2643W7FT.js +0 -1
- package/dist/preview/chunk.2CLPRG3I.js +0 -1
- package/dist/preview/chunk.2IZFIORK.js +0 -1
- package/dist/preview/chunk.2NCTM5K2.js +0 -2
- package/dist/preview/chunk.3JM2TNDD.js +0 -2
- package/dist/preview/chunk.4GGAPOMK.js +0 -2
- package/dist/preview/chunk.5JXUAMKI.js +0 -1
- package/dist/preview/chunk.5R66YTET.js +0 -2
- package/dist/preview/chunk.7DNFXJH3.js +0 -1
- package/dist/preview/chunk.7PRFYYVM.js +0 -1
- package/dist/preview/chunk.AE5GKL4C.js +0 -1
- package/dist/preview/chunk.ARR75WBP.js +0 -35
- package/dist/preview/chunk.BKPGDEES.js +0 -1
- package/dist/preview/chunk.COTG2IG5.js +0 -1
- package/dist/preview/chunk.DAA6XWLF.js +0 -1
- package/dist/preview/chunk.DKTCRFMS.js +0 -1
- package/dist/preview/chunk.DLGTFXGM.js +0 -1
- package/dist/preview/chunk.DN7SN6ZR.js +0 -1
- package/dist/preview/chunk.G4WQGTZR.js +0 -3
- package/dist/preview/chunk.GDA3G4U2.js +0 -6
- package/dist/preview/chunk.GS4T26WW.js +0 -328
- package/dist/preview/chunk.HFKMHLJ3.js +0 -1
- package/dist/preview/chunk.HGAMNIST.js +0 -1
- package/dist/preview/chunk.HKBKH7EK.js +0 -1
- package/dist/preview/chunk.HLLWKSZB.js +0 -5
- package/dist/preview/chunk.HONUT6OG.js +0 -1
- package/dist/preview/chunk.HRWLR7T4.js +0 -1
- package/dist/preview/chunk.IWYUFYDJ.js +0 -1
- package/dist/preview/chunk.JU2ZVKMT.js +0 -2
- package/dist/preview/chunk.K4ZUVH2G.js +0 -1
- package/dist/preview/chunk.KC6UZHBM.js +0 -1
- package/dist/preview/chunk.KLITC55P.js +0 -1
- package/dist/preview/chunk.KZ2376BD.js +0 -19
- package/dist/preview/chunk.LYJAVUST.js +0 -1
- package/dist/preview/chunk.MOUGB4H6.js +0 -1
- package/dist/preview/chunk.MYFWM572.js +0 -1
- package/dist/preview/chunk.N4FBDA2W.js +0 -1
- package/dist/preview/chunk.O42YET3W.js +0 -1
- package/dist/preview/chunk.ONDILMIX.js +0 -1
- package/dist/preview/chunk.OWBEV6FR.js +0 -1
- package/dist/preview/chunk.OWE6OJ4P.js +0 -1
- package/dist/preview/chunk.OYJSFO3A.js +0 -1
- package/dist/preview/chunk.P62SKNJS.js +0 -27
- package/dist/preview/chunk.PA5HYAEO.js +0 -1
- package/dist/preview/chunk.PMEDLEZY.js +0 -9
- package/dist/preview/chunk.PTXQHHKF.js +0 -1
- package/dist/preview/chunk.R2D373VG.js +0 -1
- package/dist/preview/chunk.RB4RTBRZ.js +0 -1
- package/dist/preview/chunk.RCLJ4H52.js +0 -116
- package/dist/preview/chunk.RKRSRKF3.js +0 -1
- package/dist/preview/chunk.RWGLKDWH.js +0 -1
- package/dist/preview/chunk.SIL4KD3K.js +0 -1
- package/dist/preview/chunk.SS76EIMI.js +0 -1
- package/dist/preview/chunk.UIIVEQAT.js +0 -1
- package/dist/preview/chunk.UTHHX2TJ.js +0 -1
- package/dist/preview/chunk.UWNYT7PF.js +0 -1
- package/dist/preview/chunk.VNBO2RXD.js +0 -1
- package/dist/preview/chunk.VPPUTA74.js +0 -1
- package/dist/preview/chunk.WKXNBHTL.js +0 -4
- package/dist/preview/chunk.XDZSTIS6.js +0 -88
- package/dist/preview/chunk.YUWRZWGX.js +0 -1
- package/dist/preview/chunk.Z2RGLFLS.js +0 -1
- package/dist/preview/chunk.Z56B2JR2.js +0 -25
- package/dist/preview/chunk.ZEGSQCSD.js +0 -1
- package/dist/preview/chunk.ZEVVWWNA.js +0 -44
- package/dist/preview/chunk.ZS4DJ76C.js +0 -1
- /package/dist/preview/{chunk.OHE5AMHH.js → chunk.EYZ7MHBZ.js} +0 -0
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import{A as Mr,B as ue,C as wn,D as Re,E as De,F as Er,G as vn,H as Se,I as Nr,J as $r,K as $,L as at,M as bn,N as Or,O as kn,P as Ht,Q as Fr,R as ne,S as se,T as Sn,a as X,b as Ce,c as J,d as Cr,e as yn,f as hn,g as nt,h as te,i as ye,j as oe,k as C,l as re,m as q,n as we,o as It,p as Oe,q as pe,r as Rr,s as ut,t as Dt,u as Q,v as Ie,w as Lr,x as Wt,y as ke,z as Tr}from"./chunk.SOBC3CTN.js";import{b as Ft,d as ee}from"./chunk.KN3ULTGF.js";import{a as xr,d as Pr,e as Ar}from"./chunk.UGFDSE37.js";import{a as br,b as kr,f as Sr}from"./chunk.R26DREVU.js";import{a as Nt,b as lr,c as dr,d as cr,e as pr}from"./chunk.JPHNKWTY.js";import{a as ur,b as gr,c as mr,d as fn}from"./chunk.FGVKJWNS.js";import{a as mn}from"./chunk.3JNMSOFG.js";import{a as fr,c as $t,d as yr,e as hr,h as Ot}from"./chunk.YV2LJFGS.js";import{a as Ct,b as Ra,c as La,e as Rt,f as Ta}from"./chunk.V5ZYUVMH.js";import{b as Wa}from"./chunk.GLBHQFJ2.js";import{a as dn,b as Ia,c as Da}from"./chunk.UT6642FC.js";import{a as Et,b as gn,c as ir,e as or}from"./chunk.RRVIXV7W.js";import{a as qe,b as qa,c as Ga,d as Va,e as Ua}from"./chunk.7BWT5L2L.js";import{m as sr}from"./chunk.RI3PYG5T.js";import{a as Qa,b as Za,c as er,e as rr,f as un,h as Mt}from"./chunk.SE5SKFQH.js";import{d as _a,e as Ya,f as Xa,g as Ja,n as tr,o as nr,q as ar,s as Tt}from"./chunk.W3S6UXNA.js";import{a as vi}from"./chunk.UZWWDAGM.js";import{c as Ha,d as Ka,j as pt}from"./chunk.OZNW5W4Z.js";import{s as cn,t as Ba}from"./chunk.KQT7WAQE.js";import{f as $a,g as tt,i as Oa,j as Fa,k as ln}from"./chunk.3VL5WECB.js";import{b as Lt,c as Ma,d as Ea,e as Na}from"./chunk.JH6MU6TX.js";import{C as wr,F as vr,f as Ca,k as ja,l as za,u as pn}from"./chunk.L4DECHXR.js";import{G as Ee,J as ma,L as fa,N as ya,Q as ha,R as _,U as wa,V as va,Z as ba,_ as fe,a as ua,ba as ka,ca as Sa,ea as xa,ia as et,ja as Pa,s as ga,sa as Aa,w as Me}from"./chunk.GFF2FB2J.js";import{$ as Ze,Ac as la,Bc as da,Dc as At,Fb as ra,H as Xn,Ib as ia,La as ta,Lc as sn,M as ct,Mc as ca,Na as na,Qc as pa,V as Qe,W as ce,Xa as rn,Y as he,Ya as aa,Z as xt,ba as Jn,ca as Qn,cc as oa,da as Fe,dc as sa,eb as Pt,ka as Zn,la as ea,vc as on}from"./chunk.6V2RG5JG.js";import{b as D}from"./chunk.AJZBJBMO.js";function Ir(t,e,n={}){let a=t.graph.getNode(e);if(!a)return;let i=t.schema.tryDefinition(a.kind),r=s=>ce(t.schema.tryDefinition(s.kind),s),o=new Map;for(let s of t.graph.allEdges()){let d=s.from===e?"out":s.to===e?"in":null;if(!d)continue;let c=d==="out"?s.to:s.from,p=t.graph.getNode(c);if(!p)continue;let f=(d==="out"?i:t.schema.tryDefinition(p.kind))?.edges?.[s.kind],u=d==="in"?f?.inverse??f?.description:f?.description,w=`${s.kind}|${d}|${u??""}`;(o.get(w)??(()=>{let v={edgeKind:s.kind,direction:d,...u?{description:u}:{},targets:[]};return o.set(w,v),v})()).targets.push({id:p.id,kind:p.kind,label:r(p)})}return{id:e,kind:a.kind,label:r(a),fields:Ea(pt(t.schema,t.graph,a),i),violations:rn(t.violations(n.context),[e]),actions:mn(t,[e],{focus:e,...n.principal?{principal:n.principal}:{},...n.context?{context:n.context}:{}}),links:[...o.values()].map(s=>{let d=Lt(s.targets.flatMap(c=>{let p=t.graph.getNode(c.id);return p?[p]:[]}),c=>t.schema.tryDefinition(c));return{...s,targets:[...s.targets].map(c=>d.has(c.id)?{...c,apart:d.get(c.id)}:c).sort((c,p)=>c.label.localeCompare(p.label))}})}}function Ge(t,e,n={}){return{kind:e,members:t.graph.nodesOfKind(e),actions:mn(t,[],{kindSelection:[e],...n.principal?{principal:n.principal}:{},...n.context?{context:n.context}:{}})}}function Dr(t,e){let n=(r,o)=>`${r}|${JSON.stringify(o)}`,a=new Map;for(let r of[...t.affordances,...t.withheld]){if(r.provider!=="invariant")continue;let o=n(r.mutation,r.args);a.has(o)||a.set(o,r.rank??Number.MAX_SAFE_INTEGER)}let i=Number.MAX_SAFE_INTEGER;return[...e].map((r,o)=>({repair:r,declared:o})).sort((r,o)=>(a.get(n(r.repair.mutation,r.repair.args??{}))??i)-(a.get(n(o.repair.mutation,o.repair.args??{}))??i)||r.declared-o.declared).map(r=>r.repair)}function Ve(t){let e=t.schema.kinds.map(i=>({kind:i,plural:Ze(t.schema,i),count:t.graph.nodesOfKind(i).length})),n=new Map;for(let i of t.graph.allEdges()){let r=t.graph.getNode(i.from),o=t.graph.getNode(i.to);if(!r||!o)continue;let s=`${i.kind}|${r.kind}|${o.kind}`;n.set(s,(n.get(s)??0)+1)}let a=[];for(let{kind:i}of e){let r=t.schema.tryDefinition(i)?.edges??{};for(let[o,s]of Object.entries(r)){let d=s.to==="*"||s.to===void 0?(()=>{let c=[...n.keys()].filter(p=>p.startsWith(`${o}|${i}|`)).map(p=>p.split("|")[2]);return c.length>0?c:["*"]})():s.to;for(let c of d)a.push({edgeKind:o,from:i,to:c,...s.description?{description:s.description}:{},...s.inverse?{inverse:s.inverse}:{},count:n.get(`${o}|${i}|${c}`)??0})}}return{kinds:e,relations:a}}var je=D(Ee(),1);var gt=D(Ee(),1),S=D(_(),1),bi=`
|
|
2
|
+
form:where([data-graview-part="form"]) {
|
|
3
|
+
/* A grid item of the section above it and a grid container for the
|
|
4
|
+
fields below: both halves are allowed to be narrower than what is in
|
|
5
|
+
them, or a big enough text size pushes the page sideways. See the note
|
|
6
|
+
on \`column\` in pages.tsx. */
|
|
7
|
+
display: grid;
|
|
8
|
+
grid-template-columns: minmax(0, 1fr);
|
|
9
|
+
min-width: 0;
|
|
10
|
+
gap: 12px;
|
|
11
|
+
}
|
|
12
|
+
label:where([data-graview-part="field"]) {
|
|
13
|
+
display: grid;
|
|
14
|
+
/* A track the width it was given: see the note on \`column\` in pages.tsx. */
|
|
15
|
+
grid-template-columns: minmax(0, 1fr);
|
|
16
|
+
min-width: 0;
|
|
17
|
+
gap: 4px;
|
|
18
|
+
}
|
|
19
|
+
label:where([data-graview-part="field"][data-graview-field="boolean"]) {
|
|
20
|
+
grid-auto-flow: column;
|
|
21
|
+
justify-content: start;
|
|
22
|
+
align-items: center;
|
|
23
|
+
}
|
|
24
|
+
span:where([data-graview-part="label"]),
|
|
25
|
+
legend:where([data-graview-part="label"]),
|
|
26
|
+
p:where([data-graview-part="unasked"]) {
|
|
27
|
+
font-size: 0.8125rem;
|
|
28
|
+
color: var(--graview-ink-muted);
|
|
29
|
+
}
|
|
30
|
+
p:where([data-graview-part="unasked"]) { margin: 0; }
|
|
31
|
+
input:where([data-graview-part="control"]:not([type="checkbox"])),
|
|
32
|
+
select:where([data-graview-part="control"]) {
|
|
33
|
+
font: inherit;
|
|
34
|
+
/* A TARGET IN EVERY ENGINE, not only in the one it was measured in.
|
|
35
|
+
Padding and line height alone came to 24 in Chromium and to 22 in
|
|
36
|
+
WebKit, which has its own intrinsic metrics for a \`select\` and rounds
|
|
37
|
+
nothing up for anybody. So every picker on the routed face was under
|
|
38
|
+
the WCAG 2.2 minimum in the browser iOS ships, and the check that says
|
|
39
|
+
so (\`verify-pages\`' \`bigEnoughToHit\`) only ever ran there through
|
|
40
|
+
\`pnpm engines\`. */
|
|
41
|
+
min-height: 24px;
|
|
42
|
+
/* NEVER WIDER THAN ITS FIELD. A select is as wide as its longest option,
|
|
43
|
+
and a picker over 320 vehicles ("2027 Mercedes-Benz GLE AMG 53 4MATIC+
|
|
44
|
+
Coupe") was 618 pixels on a 390 phone, and the whole page scrolled
|
|
45
|
+
sideways. It shrinks to its track and cuts the option inside its box. */
|
|
46
|
+
min-width: 0;
|
|
47
|
+
max-width: 100%;
|
|
48
|
+
text-overflow: ellipsis;
|
|
49
|
+
box-sizing: border-box;
|
|
50
|
+
padding: 7px 10px;
|
|
51
|
+
border-radius: 8px;
|
|
52
|
+
border: 1px solid var(--graview-edge);
|
|
53
|
+
background: var(--graview-panel);
|
|
54
|
+
color: var(--graview-ink);
|
|
55
|
+
}
|
|
56
|
+
/* A PICKER THAT STILL LOOKS LIKE ONE.
|
|
57
|
+
WebKit ignores an author's padding and minimum height on a \`select\`
|
|
58
|
+
while the native appearance is on \u2014 so every picker on the routed face
|
|
59
|
+
came out 22 pixels tall in the browser iOS ships, under the 24 WCAG 2.2
|
|
60
|
+
asks for, while the same element measured 35 in Chromium. Turning the
|
|
61
|
+
appearance off is what makes the box the size it was asked to be, and it
|
|
62
|
+
takes the platform's chevron with it; the chevron is put back, in the ink
|
|
63
|
+
the scheme is already using. */
|
|
64
|
+
span:where([data-graview-part="picker"]) {
|
|
65
|
+
position: relative;
|
|
66
|
+
display: grid;
|
|
67
|
+
min-width: 0;
|
|
68
|
+
}
|
|
69
|
+
span:where([data-graview-part="picker"]) > select:where([data-graview-part="control"]) {
|
|
70
|
+
appearance: none;
|
|
71
|
+
padding-right: 28px;
|
|
72
|
+
}
|
|
73
|
+
span:where([data-graview-part="chevron"]) {
|
|
74
|
+
position: absolute;
|
|
75
|
+
right: 10px;
|
|
76
|
+
top: 50%;
|
|
77
|
+
transform: translateY(-50%);
|
|
78
|
+
font-size: 0.75rem;
|
|
79
|
+
line-height: 1;
|
|
80
|
+
color: var(--graview-ink-muted);
|
|
81
|
+
pointer-events: none;
|
|
82
|
+
}
|
|
83
|
+
fieldset:where([data-graview-part="group"]) {
|
|
84
|
+
display: grid;
|
|
85
|
+
gap: 10px;
|
|
86
|
+
border: 1px solid var(--graview-edge);
|
|
87
|
+
border-radius: 10px;
|
|
88
|
+
padding: 12px;
|
|
89
|
+
}
|
|
90
|
+
fieldset:where([data-graview-part="group"][data-graview-field="list"]) { gap: 8px; }
|
|
91
|
+
div:where([data-graview-part="item"]) {
|
|
92
|
+
display: flex;
|
|
93
|
+
gap: 8px;
|
|
94
|
+
align-items: end;
|
|
95
|
+
}
|
|
96
|
+
button:where([data-graview-part="add"]),
|
|
97
|
+
button:where([data-graview-part="submit"]) { justify-self: start; }
|
|
98
|
+
p:where([data-graview-part="refused"]) {
|
|
99
|
+
margin: 0;
|
|
100
|
+
color: var(--graview-warn);
|
|
101
|
+
font-size: 0.875rem;
|
|
102
|
+
}
|
|
103
|
+
`;function ki({title:t,name:e,optional:n,amount:a,value:i,onChange:r}){let o=Oa(a),[s,d]=(0,gt.useState)(()=>typeof i=="number"?Fa(i,a):""),c=s.trim()!==""&&ln(s,a)===void 0;return(0,S.jsxs)("label",{"data-graview-part":"field","data-graview-field":"number","data-graview-amount":a.format??"unit",children:[(0,S.jsx)("span",{"data-graview-part":"label",children:t}),(0,S.jsxs)("span",{"data-graview-part":"amount",style:{display:"flex",alignItems:"center",gap:6},children:[o.prefix?(0,S.jsx)("span",{"data-graview-part":"amount-symbol","aria-hidden":"true",children:o.prefix}):null,(0,S.jsx)("input",{type:"text",inputMode:"decimal",name:e,required:!n,placeholder:o.placeholder,title:o.hint,"aria-invalid":c||void 0,value:s,onChange:p=>{d(p.target.value),r(ln(p.target.value,a))},"data-graview-part":"control",style:{flex:1,minWidth:0}}),o.suffix?(0,S.jsx)("span",{"data-graview-part":"amount-symbol","aria-hidden":"true",children:o.suffix}):null]}),c?(0,S.jsxs)("span",{"data-graview-part":"hint",role:"status",children:["Not an amount ",o.hint,": write it like ",o.prefix??"",o.placeholder,o.suffix?` ${o.suffix}`:""]}):null]})}function Wr({children:t}){return(0,S.jsxs)("span",{"data-graview-part":"picker",children:[t,(0,S.jsx)("span",{"aria-hidden":"true","data-graview-part":"chevron",children:"\u25BE"})]})}var Si=t=>({label:he(t),option:e=>e}),xi={phone:"+1 555 123 4567",place:"An address or a place's name",duration:"1h 30m, 90 or 1:30"};function Kt({store:t,spec:e,value:n,onChange:a,prefilled:i,open:r,words:o=Si,values:s}){if(e.name in i&&e.control!=="group"&&e.control!=="variant")return null;let d=e.control==="node"&&!e.kinds.includes("*")?e.kinds.map(g=>he(Fe(t.schema.tryDefinition(g),g))).join(" or "):o(e.name).label,c=!(e.optional||e.control==="boolean"),p=c?(0,S.jsxs)(S.Fragment,{children:[d,(0,S.jsx)("span",{"aria-hidden":"true",children:" *"})]}):d;switch(e.control){case"text":case"date":return e.control==="text"&&e.long?(0,S.jsxs)("label",{"data-graview-part":"field","data-graview-field":"text",children:[(0,S.jsxs)("span",{"data-graview-part":"label",children:[p,e.markdown?(0,S.jsx)("span",{style:{fontWeight:"normal",color:"var(--graview-ink-faint)"},children:" \xB7 Markdown"}):null]}),(0,S.jsx)("textarea",{name:e.name,required:!e.optional,rows:6,value:typeof n=="string"?n:"",onChange:g=>a(g.target.value),"data-graview-part":"control",style:{fieldSizing:"content",minHeight:"7.5em",resize:"vertical",font:"inherit",lineHeight:1.5}})]}):(0,S.jsxs)("label",{"data-graview-part":"field","data-graview-field":e.control==="text"&&e.holds?e.holds:e.control,children:[(0,S.jsx)("span",{"data-graview-part":"label",children:p}),(0,S.jsx)("input",{type:e.control==="date"?e.time?"datetime-local":"date":e.control==="text"&&e.holds==="phone"?"tel":"text",name:e.name,required:!e.optional,...e.control==="text"&&e.app?{placeholder:"@owner/app or https://\u2026"}:{},...e.control==="text"&&e.holds?{placeholder:xi[e.holds]}:{},...e.control==="text"&&e.holds==="phone"?{autoComplete:"tel"}:{},value:typeof n=="string"?e.control==="date"?e.time?n.slice(0,16).replace(" ","T"):n.slice(0,10):n:typeof n=="number"?String(n):"",onChange:g=>a(g.target.value),"data-graview-part":"control"})]});case"number":return e.amount?(0,S.jsx)(ki,{title:p,name:e.name,optional:e.optional,amount:e.amount,value:n,onChange:a}):(0,S.jsxs)("label",{"data-graview-part":"field","data-graview-field":e.control,children:[(0,S.jsx)("span",{"data-graview-part":"label",children:p}),(0,S.jsx)("input",{type:"number",name:e.name,required:!e.optional,...e.min===void 0?{}:{min:e.min},...e.max===void 0?{}:{max:e.max},...e.step===void 0?{}:{step:e.step},value:typeof n=="number"?n:"",onChange:g=>a(g.target.value===""?void 0:Number(g.target.value)),"data-graview-part":"control"})]});case"boolean":return(0,S.jsxs)("label",{"data-graview-part":"field","data-graview-field":"boolean",children:[(0,S.jsx)("input",{type:"checkbox",name:e.name,checked:n===!0,onChange:g=>a(g.target.checked),"data-graview-part":"control"}),(0,S.jsx)("span",{"data-graview-part":"label",children:p})]});case"choice":return(0,S.jsxs)("label",{"data-graview-part":"field","data-graview-field":e.control,children:[(0,S.jsx)("span",{"data-graview-part":"label",children:p}),(0,S.jsx)(Wr,{children:(0,S.jsxs)("select",{name:e.name,required:!e.optional,value:typeof n=="string"?n:"",onChange:g=>a(g.target.value||void 0),"data-graview-part":"control",children:[(0,S.jsx)("option",{value:"",children:"\u2014"}),(e.options??[]).map(g=>(0,S.jsx)("option",{value:g,children:o(e.name).option(g)},g))]})})]});case"node":{let g=r.find(v=>v.name===e.name)?.candidates,f=new Set(Object.values(i).filter(v=>typeof v=="string")),u=(e.kinds.includes("*")?[...t.graph.allNodes()]:e.kinds.flatMap(v=>t.graph.nodesOfKind(v))).filter(v=>!f.has(v.id)),w=g?g.map(v=>t.graph.getNode(v)).filter(v=>v!==void 0):u,W=Lt(w,v=>t.schema.tryDefinition(v));return(0,S.jsxs)("label",{"data-graview-part":"field","data-graview-field":e.control,children:[(0,S.jsx)("span",{"data-graview-part":"label",children:p}),(0,S.jsx)(Wr,{children:(0,S.jsxs)("select",{name:e.name,required:!e.optional,value:typeof n=="string"?n:"",onChange:v=>a(v.target.value||void 0),"data-graview-part":"control",children:[(0,S.jsx)("option",{value:"",children:"\u2014"}),w.map(v=>{let x=W.get(v.id);return(0,S.jsxs)("option",{value:v.id,children:[ce(t.schema.tryDefinition(v.kind),v),x?` \xB7 ${x}`:""]},v.id)})]})})]})}case"group":{let g=n??{};return(0,S.jsxs)("fieldset",{"data-graview-part":"group","data-graview-field":e.control,children:[(0,S.jsx)("legend",{"data-graview-part":"label",children:p}),e.fields.map(f=>(0,S.jsx)(Kt,{store:t,spec:f,value:g[f.name],onChange:u=>a({...g,[f.name]:u}),prefilled:i,open:r,words:o},f.name))]})}case"variant":{let g=n??{},f=typeof g[e.tag]=="string"?g[e.tag]:"",u=e.options.find(w=>w.value===f);return(0,S.jsxs)("fieldset",{"data-graview-part":"group","data-graview-field":e.control,children:[(0,S.jsx)("legend",{"data-graview-part":"label",children:p}),(0,S.jsxs)("label",{"data-graview-part":"field","data-graview-field":"choice",children:[(0,S.jsx)("span",{"data-graview-part":"label",children:he(e.tag)}),(0,S.jsxs)("select",{value:f,onChange:w=>a({[e.tag]:w.target.value}),"data-graview-part":"control",children:[(0,S.jsx)("option",{value:"",children:"\u2014"}),e.options.map(w=>(0,S.jsx)("option",{value:w.value,children:he(w.value)},w.value))]})]}),u?.fields.map(w=>(0,S.jsx)(Kt,{store:t,spec:w,value:g[w.name],onChange:W=>a({...g,[w.name]:W}),prefilled:i,open:r,words:o},w.name))]})}case"file":case"list":{let g=e.control==="file"?e:e.item.control==="file"?e.item:void 0;if(g||e.control==="file")return(0,S.jsx)(qe,{as:"control",title:c?`${d} *`:d,value:n,onChange:a,several:g!==e,image:g?.image===!0,label:d});let f=Array.isArray(n)?n:[];return(0,S.jsxs)("fieldset",{"data-graview-part":"group","data-graview-field":"list",children:[(0,S.jsx)("legend",{"data-graview-part":"label",children:p}),f.map((u,w)=>(0,S.jsxs)("div",{"data-graview-part":"item",children:[(0,S.jsx)("div",{style:{flex:1},children:(0,S.jsx)(Kt,{store:t,spec:{...e.item,optional:!1},value:u,onChange:W=>a(f.map((v,x)=>x===w?W:v)),prefilled:i,open:r,words:o})}),(0,S.jsx)("button",{type:"button","data-graview-part":"remove",onClick:()=>a(f.filter((W,v)=>v!==w)),children:"remove"})]},w)),(0,S.jsx)("button",{type:"button","data-graview-part":"add",onClick:()=>a([...f,void 0]),children:"add another"})]})}case"linked":return(0,S.jsx)("div",{"data-graview-part":"field","data-graview-field":"linked",children:(0,S.jsx)(Ga,{relation:e.relation,value:n,onChange:a,label:d})});case"repeat":return(0,S.jsx)(Va,{value:n,onChange:a,start:e.of?s?.[e.of]:void 0,label:`${e.of?o(e.of).label:d} repeats`,name:e.name});case"opaque":return(0,S.jsxs)("p",{"data-graview-part":"unasked",children:["\u201C",he(e.name),"\u201D needs a structured answer this form cannot ask for yet."]})}}function Ne({store:t,mutation:e,prefilled:n={},open:a=[],onDone:i,principal:r,initial:o,label:s,only:d}){let c=()=>dr(e,t.graph,n),[p,g]=(0,gt.useState)(c),[f,u]=(0,gt.useState)(()=>({...p,...o})),[w,W]=(0,gt.useState)(null),v=r??t.seenFor,x=e.subject&&n[e.subject.arg],H=v?pr(t,v,e,typeof x=="string"?x:void 0):void 0,N=Nt(e.input).filter(j=>(d===void 0||d.includes(j.name))&&!H?.has(j.name)),U=j=>$a(t.schema,e,j);return(0,S.jsxs)("form",{"data-testid":`form-${e.name}`,onSubmit:j=>{j.preventDefault();try{t.apply({name:e.name,args:{...cr(lr(N,f),p),...n}},r?{author:r}:{}),W(null);let Y=c();g(Y),u({...Y}),i?.()}catch(Y){W(tt(t.schema,t.allMutations(),Y))}},"data-graview-part":"form",children:[(0,S.jsx)("style",{children:bi}),N.map(j=>(0,S.jsx)(Kt,{store:t,spec:j,value:f[j.name],values:f,onChange:Y=>u(me=>({...me,[j.name]:Y})),prefilled:n,open:a,words:U},j.name)),w?(0,S.jsx)("p",{"data-testid":"refused","data-graview-part":"refused",role:"alert",children:w}):null,(0,S.jsx)("button",{type:"submit","data-graview-part":"submit",children:s??e.title??e.name})]})}var R=D(_(),1);function xe(t){let e=t.views;if(!e)return[];let n=new Set(Ie(t.store,t.principal));return e.places().filter(a=>n.has(a.kind))}function Bt(t,e){if(!e.over)return[e.kind];let n=new Set(Ie(t.store,t.principal));return e.over.filter(a=>a===e.kind||n.has(a))}var Ue=t=>`place:${t.kind}:${t.as}`;function ve(t,e){return Cr(e.as,la(e,t.views?.places()??[])?X(t.store.schema,e.kind):void 0)}function mt(t,e){let n=t.schema.tryDefinition(e);return t.graph.nodesOfKind(e).filter(a=>Qe(n,a))}function xn(t,e,n){let a=(r,o)=>xt(t.schema,o,r),i=(typeof e=="string"?[e]:e).map(r=>a(mt(t,r).length,r)).join(" and ");return n?`${i} across ${a(mt(t,n).length,n)}`:i}function Pn({context:t,place:e,chosen:n,filter:a}){let{store:i,views:r,invariantContext:o}=t,d=r?.resolve(e.kind,{cardinality:"many",fidelity:"full"},e.as)?.view,c=[...new Set(i.violations(o).flatMap(f=>f.nodeIds))],p=Bt(t,e).flatMap(f=>mt(i,f));if(!d)return null;let g=Pi(i,p,a,c);return(0,R.jsx)(cn,{kind:e.kind,view:e.title,children:(0,R.jsx)(d,{nodes:g,label:e.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1,...n&&n.length>0?{implicated:n}:{},...c.length>0?{flagged:c}:{}})})}function Pi(t,e,n,a){let i=n?At({filter:n}).filter??[]:[];return i.length===0?e:Mt(e,{filter:i},{schema:t.schema,graph:t.graph,flagged:new Set(a)}).nodes}function Ai({store:t,views:e,as:n,invariantContext:a}){ee(t);let i={store:t,views:e,...a?{invariantContext:a}:{}},r=e.places().find(o=>o.as===n);return r?(0,R.jsx)(Pn,{context:i,place:r}):null}function Ci({context:t,kind:e}){let{store:n,views:a,invariantContext:i}=t,r=mt(n,e),o=n.schema.tryDefinition(e),s=Q(n,e),c=a?.resolve(e,{cardinality:"many",fidelity:"full"})?.view,p=[...new Set(n.violations(i).flatMap(w=>w.nodeIds))];if(c&&!et(c))return(0,R.jsx)(cn,{kind:e,children:(0,R.jsx)(c,{nodes:r,label:s,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1,...p.length>0?{flagged:p}:{}})});let g=a?.resolve(e,{cardinality:"one",fidelity:"summary"})?.view,f=8,u=r.slice(0,f);return(0,R.jsxs)("div",{"data-testid":"kind-sheet",style:g?{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gridAutoRows:"max-content",alignContent:"center",gap:12,padding:24}:{display:"flex",flexWrap:"wrap",alignContent:"center",justifyContent:"center",gap:10,padding:24},children:[u.map(w=>g?(0,R.jsx)(g,{node:w,fidelity:"summary",cardinality:"one",mode:"fullscreen",selected:!1,...p.includes(w.id)?{flagged:[w.id]}:{}},w.id):(0,R.jsx)("span",{style:{padding:"8px 14px",borderRadius:8,border:"1px solid var(--graview-edge-bright)",background:"var(--graview-ground)",color:"var(--graview-ink)"},children:ce(o,w)},w.id)),r.length>f?(0,R.jsxs)("span",{style:{...C,alignSelf:"center",padding:"0 6px"},children:["+",r.length-f," more ",s.toLowerCase()]}):null]})}function An(t){let{store:e}=t,n=Lr(t),a=xe(t),i=on([...a].sort((o,s)=>n.indexOf(o.kind)-n.indexOf(s.kind))).filter(o=>!o.hidden),r=new Set(i.flatMap(o=>o.over??[o.kind]));return[...i.map(o=>({key:Ue(o),kind:o.kind,title:da(o,a,e.schema),to:ve(t,o),place:o})),...Wt(t).filter(o=>!r.has(o)).map(o=>({key:`kind:${o}`,kind:o,title:Q(e,o),to:`/${X(e.schema,o)}`}))]}var Hr=.72,Ri=540,Kr=16/10;function Li(t){let e=(0,je.useRef)(null),[n,a]=(0,je.useState)(t);return(0,je.useLayoutEffect)(()=>{let i=e.current;if(!i||typeof ResizeObserver>"u")return;let r=()=>{let s=i.getBoundingClientRect().width;s>0&&a(d=>Math.abs(d-s)<.5?d:s)};r();let o=new ResizeObserver(r);return o.observe(i),()=>o.disconnect()},[]),{ref:e,width:n}}function Cn({context:t,entry:e}){let{store:n,brand:a,principal:i}=t,{ref:r,width:o}=Li(Ri),s=o/Hr,d=mt(n,e.kind),c=n.schema.tryDefinition(e.kind),p=d.length===0?Ge(n,e.kind,{...i?{principal:i}:{},...t.invariantContext?{context:t.invariantContext}:{}}).actions.affordances[0]:void 0,g=e.place!==void 0;return(0,R.jsxs)($,{to:e.to,"data-testid":g?"place-card":"kind-card",className:"graview-gallery-card",style:{...we,display:"grid",gap:10,alignContent:"start",minWidth:0},children:[(0,R.jsxs)("span",{ref:r,"data-testid":g?"place-picture":"kind-picture","aria-hidden":"true",inert:!0,style:{display:"block",position:"relative",width:"100%",aspectRatio:`${Kr}`,overflow:"hidden",borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",pointerEvents:"none"},children:[(0,R.jsx)("span",{style:{position:"absolute",left:0,top:0,width:s,height:s/Kr,display:"grid",gridTemplateRows:"minmax(0, 1fr)",transform:`scale(${Hr})`,transformOrigin:"0 0"},children:(0,R.jsx)($t.Provider,{value:null,children:e.place?(0,R.jsx)(Pn,{context:t,place:e.place}):(0,R.jsx)(Ci,{context:t,kind:e.kind})})}),d.length===0?(0,R.jsx)("span",{"data-testid":"picture-empty",style:{position:"absolute",inset:0,display:"grid",placeContent:"center",justifyItems:"center",gap:2,padding:20,textAlign:"center"},children:(0,R.jsxs)("span",{style:{display:"grid",gap:2,padding:"10px 16px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-ground)",color:"var(--graview-ink)"},children:[(0,R.jsxs)("span",{style:{fontFamily:hn,fontWeight:"var(--graview-weight-display)"},children:["No ",Q(n,e.kind).toLowerCase()," yet"]}),p?(0,R.jsxs)("span",{style:C,children:["Begin with \u201C",p.label,"\u201D"]}):null]})}):null]}),(0,R.jsxs)("span",{style:{display:"grid",gap:2,minWidth:0},children:[(0,R.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0},children:[g?null:(0,R.jsx)(pe,{kind:e.kind,brand:a,schema:n.schema,size:8}),(0,R.jsx)("span",{style:{fontFamily:hn,fontSize:"var(--graview-text-heading)",fontWeight:"var(--graview-weight-display)",lineHeight:1.3,overflowWrap:"anywhere",textWrap:"balance"},children:e.title})]}),(0,R.jsxs)("span",{style:C,children:[e.place?xn(n,Bt(t,e.place),e.place.across):xn(n,e.kind),!g&&c?.description?` \xB7 ${c.description}`:null]})]})]})}var Br={display:"grid",gap:"32px 28px",gridTemplateColumns:"repeat(auto-fill, minmax(min(420px, 100%), 1fr))"},Ti=`
|
|
104
|
+
.graview-gallery-card > span:first-child { transition: border-color 160ms ease, box-shadow 160ms ease; }
|
|
105
|
+
.graview-gallery-card:hover > span:first-child,
|
|
106
|
+
.graview-gallery-card:focus-visible > span:first-child { border-color: var(--graview-edge-bright); box-shadow: 0 1px 0 var(--graview-edge), 0 10px 30px -18px var(--graview-ink); }
|
|
107
|
+
`;function Rn({context:t}){ee(t.store);let e=An(t);return e.length===0?null:(0,R.jsxs)("section",{style:Br,"data-testid":"gallery",children:[(0,R.jsx)("style",{children:Ti}),e.map(n=>(0,R.jsx)(Cn,{context:t,entry:n},n.key))]})}function Ln({context:t}){let{store:e}=t;ee(e);let n=on(xe(t)).filter(i=>!i.hidden),a=An(t);return(0,R.jsxs)(ne,{context:t,style:nt,children:[(0,R.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,R.jsx)("p",{style:ye,children:n.length===0?"None of its own yet":`${n.length} ${n.length===1?"picture":"pictures"}`}),(0,R.jsx)(se,{context:t,children:"Pictures"}),(0,R.jsx)("p",{style:oe,children:n.length===0?"Nothing here has a picture of its own yet, so each kind is drawn as the scene draws it. Title a group view and it appears here by name.":"The ways this installation looks at what it holds \u2014 each one the same picture the scene shows, here as a page."})]}),a.length>0?(0,R.jsx)("div",{style:Br,"data-testid":"places",children:a.map(i=>(0,R.jsx)(Cn,{context:t,entry:i},i.key))}):null]})}function Tn({context:t}){let{store:e,principal:n}=t;ee(e);let a=De(),i=Re(),[r]=at(),o=decodeURIComponent(a.as??""),[s,d]=(0,je.useState)(null),c=r.get("of"),p=r.get("filter"),f=xe(t).find(N=>N.as===o&&(!c||X(e.schema,N.kind)===c));if(!f)return(0,R.jsxs)(ne,{context:t,children:[(0,R.jsx)(se,{context:t,children:"No picture is called that."}),(0,R.jsx)("p",{style:oe,children:(0,R.jsxs)($,{to:"/places",style:q,children:["The pictures there are ",(0,R.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]})})]});let u=Q(e,f.kind),w=t.views?.resolve(f.kind,{cardinality:"many",fidelity:"full"},f.as)?.view,W=w?.flows===!0,v=w?.creates!==!1,x=Ge(e,f.kind,{...n?{principal:n}:{},...t.invariantContext?{context:t.invariantContext}:{}}),H=v?x.actions.affordances.map(N=>({affordance:N,mutation:e.allMutations().find(U=>U.name===N.mutation)})).filter(N=>N.mutation!==void 0):[];return(0,R.jsxs)(ne,{context:t,style:nt,children:[(0,R.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,R.jsx)(se,{context:t,children:f.title}),(0,R.jsxs)("p",{style:oe,"data-testid":"place-lede",children:[xn(e,Bt(t,f),f.across),"."]}),p&&!W?(0,R.jsxs)("p",{style:{...C,margin:0},"data-testid":"place-narrowed",children:[`Only those where ${p.split(",").map(N=>N.replace(":"," is ")).join(" and ")}. `,(0,R.jsx)($,{to:`?${(()=>{let N=new URLSearchParams(r);return N.delete("filter"),N.toString()})()}`,style:{...q,...C},children:"Show all"})]}):null,(0,R.jsx)("p",{style:{...C,margin:0,display:"flex",flexWrap:"wrap",gap:"4px 16px"},children:Bt(t,f).map((N,U)=>(0,R.jsxs)($,{to:`/${X(e.schema,N)}`,style:{...q,...C},...U===0?{"data-testid":"place-as-list"}:{},children:["All ",(N===f.kind?u:Q(e,N)).toLowerCase()," as a list ",(0,R.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]},N))})]}),(0,R.jsx)("div",{"data-testid":"place-lens","data-flows":W?"":void 0,style:W?{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",maxWidth:"100%"}:{height:"min(72vh, 760px)",display:"grid",gridTemplateRows:"minmax(0, 1fr)",overflow:"auto",maxWidth:"100%",borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)"},onClick:N=>{let U=N.target?.closest("[data-graview-pick]"),j=U?.getAttribute("data-graview-pick"),Y=U?.getAttribute("data-graview-joins");if(Y)try{let k=JSON.parse(Y);if(Array.isArray(k)&&k.every(A=>typeof A=="string")){N.preventDefault(),d({at:Ue(f),ids:k});return}}catch{}if(!j)return;let me=e.graph.getNode(j);me&&(N.preventDefault(),i(J(e.schema,me.kind,j)))},children:(0,R.jsx)(Pn,{context:t,place:f,filter:p,...s?.at===Ue(f)?{chosen:s.ids}:{}})}),H.length>0?(0,R.jsx)("div",{style:{maxWidth:760,display:"grid",gap:40},"data-testid":"place-creators",children:H.map(({affordance:N,mutation:U})=>(0,R.jsxs)("section",{style:{...re,display:"grid",gap:14},children:[(0,R.jsx)("h2",{style:te,children:U.title??U.name}),U.description?(0,R.jsx)("p",{style:{...C,margin:0,maxWidth:"58ch"},children:U.description}):null,(0,R.jsx)(Ne,{store:e,mutation:U,prefilled:N.args,open:N.open,label:N.label,...n?{principal:n}:{}})]},N.id))}):null]})}function rt(t){return t.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-|-$/g,"")}function ft(t,e={}){let[n="/",a=""]=t.split("#")[0].split("?"),i=new URLSearchParams(a);e.filter&&i.set("filter",e.filter);let r=i.toString(),o=e.section?rt(e.section):"";return`${n}${r?`?${r}`:""}${o?`#${o}`:""}`}function Mi(t,e=document){let n=rt(t);if(!n)return null;let a=[e,...[...e.querySelectorAll("[data-worker-view]")].flatMap(i=>i.shadowRoot?[i.shadowRoot]:[])];for(let i of a)for(let r of i.querySelectorAll("[id], [data-section]")){let o=r.getAttribute("data-section")??r.id;if(o===t||rt(o)===n)return r}for(let i of a)for(let r of i.querySelectorAll("h1, h2, h3, h4, h5, h6, [role=heading]"))if(rt(r.textContent??"")===n)return r;return null}function qr(t,e={}){if(typeof document>"u"||typeof requestAnimationFrame>"u")return()=>{};let n=e.frames??120,a=0,i=()=>{let r=Mi(t,e.root??document);if(r){r.hasAttribute("tabindex")||r.setAttribute("tabindex","-1"),r.scrollIntoView?.({block:"start"}),r.focus({preventScroll:!0});return}n-=1,n>0&&(a=requestAnimationFrame(i))};return a=requestAnimationFrame(()=>{a=requestAnimationFrame(i)}),()=>cancelAnimationFrame(a)}var V=D(Ee(),1);var ze=D(Ee(),1);function Gr(t,e,n){let a=Math.max(0,t.left),i=Math.min(e.width,t.right),r=Math.max(0,t.top),o=Math.min(e.height,t.bottom);return{shown:o-r>=n.height+2*16&&i-a>=n.width+2*16,left:Math.round(a),top:Math.round(r),width:Math.round(Math.max(0,i-a)),height:Math.round(Math.max(0,o-r))}}function Vr(t,e,n){let a=t.style;a.left=`${e.left}px`,a.top=`${e.top}px`,a.right="auto",a.bottom="auto",a.visibility=n?"":"hidden";let i=t.getBoundingClientRect();i.width!==0&&(a.left=`${Math.round(2*e.left-i.left)}px`,a.top=`${Math.round(2*e.top-i.top)}px`)}var We=D(_(),1);function Ur({context:t}){let e=Re(),n=fe(),{pathname:a}=ue(),[,i,r]=a.split("/"),o=i==="places"&&r?decodeURIComponent(r):void 0,s=(0,ze.useRef)(null);return Ni(s,n!==null),n?(0,We.jsxs)(We.Fragment,{children:[(0,We.jsx)($i,{context:t}),(0,We.jsx)("div",{ref:s,"data-testid":"page-seat",style:{position:"fixed",left:0,top:0,width:"100vw",height:"100dvh",pointerEvents:"none",zIndex:sa("rail"),containerType:"size"},children:(0,We.jsx)(kr,{onPick:d=>{let c=t.store.graph.getNode(d);c&&e(J(t.store.schema,c.kind,d))},onMove:d=>{if(n.seatTalk.get().draft&&n.seatTalk.setDraft(null),d.to==="place"&&(d.face==="scene"||d.slug==="overview")){t.overview?t.overview("#"):t.embedded||window.location.assign(t.sceneHref??"/");return}e(d.address)},...o?{place:o}:{},onDraft:()=>{a!=="/~draft"&&e("/~draft")}})})]}):null}var Ei={width:160,height:40};function Ni(t,e){let{pathname:n}=ue(),a=Ca(e);(0,ze.useLayoutEffect)(()=>{let i=t.current;if(!i)return;let r=i.parentElement?.closest("[data-embed-content]")??null,o=()=>r??document.querySelector("main")??null,s=()=>{let g=o(),f={width:document.documentElement.clientWidth||innerWidth,height:a??innerHeight},u=g?.getBoundingClientRect()??{left:0,top:0,right:f.width,bottom:f.height},w=Gr(r?u:{left:u.left,right:u.right,top:u.top,bottom:Math.max(u.bottom,f.height)},f,Ei);i.style.width=`${w.width}px`,i.style.height=`${w.height}px`,Vr(i,w,w.shown)};s(),addEventListener("resize",s),addEventListener("scroll",s,!0);let d=0,c=typeof ResizeObserver=="function"?new ResizeObserver(()=>{cancelAnimationFrame(d),d=requestAnimationFrame(s)}):null,p=o();return p&&c?.observe(p),()=>{cancelAnimationFrame(d),c?.disconnect(),removeEventListener("resize",s),removeEventListener("scroll",s,!0)}},[t,e,n,a])}function $i({context:t}){let{store:e}=t,n=fe(),{pathname:a}=ue(),i=(0,ze.useRef)(n?.setSelection);return i.current=n?.setSelection,(0,ze.useEffect)(()=>{let r=i.current;if(!r)return;let[,o,s]=a.split("/"),d=(()=>{if(o==="places"){let p=t.views?.places().find(g=>g.as===decodeURIComponent(s??""));return p?[Me(p.kind)]:[]}let c=o?Ce(e.schema,o):void 0;return c&&s?[decodeURIComponent(s)]:c?[ga(c)]:[]})();r(c=>c.length===d.length&&c.every((p,g)=>p===d[g])?c:d)},[a]),null}var ge=D(Ee(),1);var zr=D(vi(),1);var de=D(_(),1);var Oi=(0,ge.lazy)(ua(()=>import("./chunk.RYT5U3QM.js").then(t=>({default:t.TakeBack}))));function Fi({context:t,docked:e,at:n}){let{store:a}=t,i=ee(a),[r]=(0,ge.useState)(()=>a.batches().length),o=(0,ge.useRef)(!1);return o.current||=i>0||!e&&r>0,o.current?(0,de.jsx)(ge.Suspense,{fallback:null,children:(0,de.jsx)(Oi,{context:t,docked:e,at:n,since:r})}):null}function Ii(t,e,n){let{store:a,principal:i,embedded:r}=t;(0,ge.useEffect)(()=>{if(!n)return;let o=s=>{if(!Ar(s))return;let d=s.target,c=d instanceof Node&&e.current?.contains(d),p=d===document.body||d===document.documentElement||d===document;if(!(!c&&!(p&&!r))&&xr(a,i)){s.preventDefault();try{Pr(a,i)}catch{}}};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[a,i,r,e,n])}function _r({context:t,registry:e,root:n,children:a}){let i=(0,ge.useMemo)(Or,[]),r=e?.without()??new Set;return Ii(t,n,!r.has("undo")),(0,de.jsxs)(bn.Provider,{value:i,children:[(0,de.jsx)(Di,{context:t,placed:i,without:r}),a]})}function Di({context:t,placed:e,without:n}){let[a,i]=(0,ge.useState)(!1);(0,ge.useLayoutEffect)(()=>i(!0),[]);let r=kn(e,"find"),o=kn(e,"undo"),s=ue(),d=za();if(!a)return null;let c=s.pathname.split("/").filter(Boolean),g=(c.length===1?Ce(t.store.schema,c[0]):void 0)!==void 0;return(0,de.jsxs)(de.Fragment,{children:[!r&&!n.has("find")&&d?(0,zr.createPortal)((0,de.jsx)(jr,{context:t,narrowsLists:g}),d.slot):null,!r&&!n.has("find")&&!d?(0,de.jsx)("div",{"data-testid":"face-find-bar",style:{display:"flex",alignItems:"center",padding:"8px 16px",borderBottom:"1px solid var(--graview-edge)",background:"var(--graview-bar)",minWidth:0},children:(0,de.jsx)(jr,{context:t,narrowsLists:g})}):null,!o&&!n.has("undo")?(0,de.jsx)(Fi,{context:t,docked:!0,at:s.pathname+s.search}):null,d?.own&&!n.has("undo")?(0,de.jsx)(Tr,{context:t,own:d.own}):null]})}function jr({context:t,narrowsLists:e}){return(0,de.jsx)(bn.Provider,{value:null,children:(0,de.jsx)(Sn,{context:t,narrowsLists:e})})}var ie=D(Ee(),1);var Le=D(_(),1),Wi=500,Hi=10;function Mn(t){return t instanceof HTMLElement?t.isContentEditable||t.tagName==="TEXTAREA"||t.tagName==="SELECT"?!0:t.tagName==="INPUT"&&!["button","submit","reset","checkbox","radio","image","file","color","range"].includes(t.type):!1}function Ki(t){let e=typeof getSelection=="function"?getSelection():null;return e!==null&&!e.isCollapsed&&e.containsNode(t,!0)}function Bi(t){let e=t.closest('a[href], button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"])');if(e)return e;let n=document.activeElement;return n instanceof HTMLElement&&n!==document.body?n:null}function Yr({context:t,root:e,children:n}){return fe()===null?(0,Le.jsx)(Le.Fragment,{children:n}):(0,Le.jsx)(qi,{context:t,root:e,children:n})}function qi({context:t,root:e,children:n}){let{setMenuAt:a}=ba(),{store:i}=t,r=i.schema,o=Re(),{pathname:s,search:d}=ue(),c=Mr("/").replace(/\/$/,""),p=(0,ie.useCallback)((k,A)=>t.views?.places().find(T=>T.as===k&&(A===null||T.kind===A)),[t.views]),g=(0,ie.useCallback)((k,A)=>{let[T="",M,le]=k.split("/").filter(Boolean).map(Z=>{try{return decodeURIComponent(Z)}catch{return Z}});if(le!==void 0)return null;if(T==="places"&&M!==void 0){let Z=p(M,new URLSearchParams(A).get("of"));return Z?{face:"pages",place:Z.as,about:[Me(Z.kind)],title:Z.title}:null}let z=Ce(r,T);return z?M===void 0?{face:"pages",about:[Me(z)],title:Ze(r,z)}:i.graph.getNode(M)?{face:"pages",on:M,about:[M]}:null:null},[r,i,p]),f=(0,ie.useCallback)(k=>{let A=k.href;try{let T=new URL(A,location.href);if(T.origin===location.origin&&(c===""||T.pathname===c||T.pathname.startsWith(`${c}/`))){let M=g(T.pathname.slice(c.length),T.search);if(M)return{...M,href:A}}}catch{}return{face:"pages",about:[],href:A}},[c,g]),u=(0,ie.useCallback)(()=>g(s,d)??{face:"pages",about:[]},[g,s,d]),w=(0,ie.useCallback)(k=>{let A=u(),T=k.closest("[data-graview-field]")?.getAttribute("data-graview-field");if(T&&A.on!==void 0&&k.closest("[data-graview-pick], a[href]")===null)return{...A,field:T};let M=k.closest("[data-graview-pick]")?.getAttribute("data-graview-pick");if(M&&i.graph.getNode(M))return{face:"pages",on:M,about:[M],href:`${c}${J(r,i.graph.getNode(M).kind,M)}`};let le=k.closest("a[href]");if(le)return f(le);let z=k.closest("[data-graview-record]")?.getAttribute("data-graview-record");return z&&i.graph.getNode(z)?{face:"pages",on:z,about:[z]}:A},[u,f,i,r,c]),W=(0,ie.useCallback)((k,A,T)=>{let M=w(k);a({...M,x:Math.round(A),y:Math.round(T),returnTo:Bi(k)})},[w,a]),v=(0,ie.useCallback)(k=>{let A=k.getBoundingClientRect();W(k,A.left+Math.min(16,A.width/2),Math.min(A.bottom,A.top+36))},[W]),x=(0,ie.useRef)(0),H=(0,ie.useRef)(null),N=(0,ie.useRef)(!1),U=()=>{H.current&&clearTimeout(H.current.timer),H.current=null};(0,ie.useEffect)(()=>U,[]),(0,ie.useEffect)(()=>{let k=A=>{if(A.defaultPrevented||!(A.key==="ContextMenu"||A.key==="F10"&&A.shiftKey))return;let T=e.current,M=A.target instanceof Element?A.target:null,le=M===null||M===document.body||M===document.documentElement,z=T!==null&&M!==null&&T.contains(M);if(!z&&!(le&&document.querySelector("[data-graview-face='pages']")===T)||Mn(M)||M?.closest("[data-graview-popover]"))return;A.preventDefault(),x.current=Date.now();let Z=z&&M instanceof HTMLElement?M:T?.querySelector("[data-graview-page-title], main h1, main")??null;Z&&v(Z)};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[e,v]);let j=(0,ie.useMemo)(()=>k=>{if(k.face!=="pages")return null;let A=[],T=k.on===void 0?void 0:i.graph.getNode(k.on),M=k.place===void 0?void 0:t.views?.places().find(L=>L.as===k.place),le=T?void 0:k.about.length===1&&k.about[0].startsWith("aggregate:")&&!M?Gi(k.about[0]):void 0,z=T?J(r,T.kind,T.id):M?ve(t,M):le?`/${X(r,le)}`:void 0,Z=z!==void 0&&s===z.split("?")[0];z!==void 0&&!Z&&A.push({id:"open",label:"Open",run:()=>o(z)});let B=z!==void 0?`${c}${z}`:k.href;B!==void 0&&A.push({id:"open-in-a-new-tab",label:"Open in a new tab",run:()=>void window.open(B,"_blank","noopener")});let m=T?`#focus=${encodeURIComponent(T.id)}`:M?`#focus=${encodeURIComponent(Me(M.kind))}&view=${encodeURIComponent(M.as)}`:le?`#focus=${encodeURIComponent(Me(le))}`:void 0;if(m!==void 0&&(t.overview||!t.embedded)){let L=t.overview;A.push({id:"in-the-scene",label:"Show in the scene",run:()=>L?L(m):location.assign(`${t.sceneHref??"/"}${m}`)})}return T===void 0&&k.href===void 0&&A.push({id:"find",label:"Find\u2026",run:()=>{let L=e.current?.querySelector('[data-testid="nav-find"]')??document.querySelector('[data-testid="nav-find"]');L&&L.offsetParent!==null?L.focus():o("/search")}}),A.length>0?{id:"pages",items:A}:null},[i,r,t,s,c,o,e]),Y=(0,ie.useMemo)(()=>k=>{if(k.face!=="pages"||k.field===void 0||k.on===void 0)return null;let A=i.graph.getNode(k.on),T=k.element?.closest("[data-graview-field]")??e.current?.querySelector(`[data-graview-field="${CSS.escape(k.field)}"]`);return!A||!(T instanceof HTMLElement)||!T.hasAttribute("data-graview-editable")?null:{id:"field",at:"start",items:[{id:"change-field",label:`Change \u201C${Jn(r.tryDefinition(A.kind),k.field)}\u201D`,run:()=>T.click()}]}},[i,r,e]),me=(0,ie.useMemo)(()=>[Y,j],[Y,j]);return(0,Le.jsxs)(Ba,{sections:me,children:[(0,Le.jsx)("div",{"data-graview-menu-ground":"",style:{display:"contents"},onContextMenu:k=>{let A=k.target;k.shiftKey||Mn(A)||Ki(A)||(k.preventDefault(),!A.closest("[data-graview-popover]")&&(Date.now()-x.current<700||(k.clientX===0&&k.clientY===0&&A instanceof HTMLElement?v(A):W(A,k.clientX,k.clientY))))},onPointerDown:k=>{if(N.current=!1,k.pointerType==="mouse"||!k.isPrimary)return;let A=k.target;if(Mn(A)||A.closest("[data-graview-choose], [data-graview-popover]"))return;U();let{clientX:T,clientY:M}=k;H.current={x:T,y:M,timer:setTimeout(()=>{H.current=null,N.current=!0,x.current=Date.now(),W(A,T,M)},Wi)}},onPointerMove:k=>{let A=H.current;A&&Math.hypot(k.clientX-A.x,k.clientY-A.y)>Hi&&U()},onPointerUp:U,onPointerCancel:U,onClickCapture:k=>{N.current&&(N.current=!1,k.preventDefault(),k.stopPropagation())},children:n}),(0,Le.jsx)(Vi,{openAt:v})]})}function Gi(t){let e=t.slice(10).split("+");return e.length===1&&e[0]?e[0]:void 0}function Vi({openAt:t}){return(0,Le.jsx)("span",{"data-graview-menu-home":"",tabIndex:-1,onFocus:e=>{if(e.target!==e.currentTarget)return;let n=e.currentTarget.closest("[data-graview-face]"),a=n?.querySelector("[data-graview-page-title]")??n?.querySelector("main h1, main")??null;a&&(a.hasAttribute("tabindex")||a.setAttribute("tabindex","-1"),a.focus({preventScroll:!0}))},style:{position:"absolute",width:0,height:0,overflow:"hidden"},children:(0,Le.jsx)(br,{placement:"menu",openActs:t})})}var K=D(_(),1);function Xr(t,e){return e==="*"?{label:"anything",path:null}:{label:Q(t,e),path:`/${X(t.schema,e)}`}}function Ui({context:t,relation:e}){let{store:n}=t,a=Xr(n,e.from),i=Xr(n,e.to),r=o=>o.path?(0,K.jsx)($,{to:o.path,style:{...we,fontWeight:550},children:o.label}):(0,K.jsx)("span",{children:o.label});return(0,K.jsxs)("li",{"data-testid":"relation","data-relation":e.edgeKind,style:{display:"grid",gridTemplateColumns:"30px minmax(0, 1fr) auto",gap:12,alignItems:"baseline"},children:[(0,K.jsx)(Sr,{edgeKind:e.edgeKind,...t.brand?.kit?{kit:t.brand.kit}:{}}),(0,K.jsxs)("span",{style:{display:"grid",gap:1},children:[(0,K.jsxs)("span",{children:[r(a)," ",(0,K.jsxs)("span",{style:C,"data-graview-speaks-ids":"",children:[he(e.edgeKind)," \u2192"]})," ",r(i)]}),e.description||e.inverse?(0,K.jsxs)("span",{style:C,children:[e.description?ke(e.description):null,e.description&&e.inverse?" \xB7 ":null,e.inverse?`from the other end, ${e.inverse}`:null]}):null]}),i.path?(0,K.jsx)($,{to:`${i.path}?with=${encodeURIComponent(e.edgeKind)}`,style:{...q,...C,fontVariantNumeric:"tabular-nums",display:"inline-block",minWidth:24,minHeight:24,textAlign:"center"},title:`The ${i.label.toLowerCase()} that have this`,children:e.count}):(0,K.jsx)("span",{style:{...C,fontVariantNumeric:"tabular-nums"},children:e.count})]})}function Jr({context:t,heading:e=!0}){let{store:n}=t,a=new Set(Ie(n,t.principal)),i=Ve(n).relations.filter(r=>a.has(r.from)&&(r.to==="*"||a.has(r.to)));return i.length===0?null:(0,K.jsxs)("section",{style:{...re,display:"grid",gap:12},"data-testid":"kind-map",children:[e?(0,K.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[(0,K.jsx)("h2",{style:te,children:(0,K.jsx)($,{to:"/map",style:we,children:"Connections"})}),(0,K.jsx)("span",{style:C,children:i.length===1?"1 relation":`${i.length} relations`})]}):null,(0,K.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:i.map(r=>(0,K.jsx)(Ui,{context:t,relation:r},`${r.edgeKind}|${r.from}|${r.to}`))})]})}function En({context:t}){let{store:e}=t;ee(e);let n=new Set(Ie(e,t.principal)),a=Ve(e),i=a.relations.filter(r=>n.has(r.from));return(0,K.jsxs)(ne,{context:t,children:[(0,K.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,K.jsx)("p",{style:ye,children:i.length===0?"No relations":`${i.length} ${i.length===1?"relation":"relations"}`}),(0,K.jsx)(se,{context:t,children:"Connections"}),(0,K.jsx)("p",{style:oe,children:i.length===0?"Nothing here is declared to relate to anything else yet.":"The kinds this installation holds, and the relations declared between them \u2014 each in the declaration's own words, with how many of it there are."})]}),(0,K.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"6px 18px"},"data-testid":"map-kinds",children:a.kinds.filter(r=>n.has(r.kind)).map(r=>(0,K.jsxs)("li",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[(0,K.jsx)(pe,{kind:r.kind,brand:t.brand,schema:e.schema,size:7}),(0,K.jsx)($,{to:`/${X(e.schema,r.kind)}`,style:q,children:r.plural}),(0,K.jsx)("span",{style:C,children:r.count})]},r.kind))}),(0,K.jsx)(Jr,{context:t,heading:!1})]})}function Qr({context:t}){let n=[...fe()?.robots.values()??[]].filter(i=>i.mode==="asking"&&i.say);if(n.length===0)return null;let{store:a}=t;return(0,K.jsxs)("section",{style:{...re,display:"grid",gap:10},"data-testid":"seat-questions",children:[(0,K.jsx)("h2",{style:te,children:n.length===1?"The seat asked something":`The seat asked ${n.length} things`}),(0,K.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:8},children:n.map(i=>{let r=i.at?a.graph.getNode(i.at):void 0;return(0,K.jsxs)("li",{style:{display:"grid",gap:2},children:[(0,K.jsx)("span",{children:i.say}),r?(0,K.jsxs)($,{to:J(a.schema,r.kind,r.id),style:{...q,...C},children:[ce(a.schema.tryDefinition(r.kind),r)," \u2192"]}):null]},i.participant)})})]})}var G=D(_(),1);function Nn({context:t}){let{principal:e}=t,{store:n,brand:a,invariantContext:i}=t;ee(n);let r=n.violations(i),o=`${r.length===1?"A rule is broken":"Rules are broken"} \u2014 see what, and what would fix it`,s=[...n.log.all()].slice(-5).reverse(),c=Wt(t).map(x=>({kind:x,members:n.graph.nodesOfKind(x).filter(H=>Qe(n.schema.tryDefinition(x),H))})),p=c.filter(x=>x.members.length>0),g=c.map(x=>({entry:x,creator:n.allMutations().find(H=>(H.creates??[]).includes(x.kind)&&n.permits({name:H.name,args:{}},t.principal).ok)})).find(x=>x.creator!==void 0),f=p.length===0?"Nothing here yet.":`${p.map(x=>xt(n.schema,x.kind,x.members.length)).join(", ").replace(/, ([^,]*)$/," and $1")}.`,u=t.views?.homeView?.(),w=n.schema.kinds.some(x=>n.graph.nodesOfKind(x).length>0);if(u&&w){let x=a?.subtitle?(0,G.jsx)("p",{style:{...C,margin:0},"data-testid":"app-subtitle",children:a.subtitle}):null,H=u[Symbol.for("graview.home-blocks")]===!0;return(0,G.jsx)(ne,{context:t,style:nt,children:(0,G.jsxs)("div",{style:{display:"grid",gap:12},"data-testid":"home-view",children:[H?null:x,r.length>0?(0,G.jsx)($,{to:"/problems",style:{...q,color:"var(--graview-warn)"},children:o}):null,(0,G.jsx)(hr.Provider,{value:H?x:null,children:(0,G.jsx)(u,{cardinality:"many",fidelity:"full",mode:"fullscreen",selected:!1})})]})})}let W=new Set(Ie(n,t.principal)),v=Ve(n).relations.filter(x=>W.has(x.from)&&(x.to==="*"||W.has(x.to)));return(0,G.jsxs)(ne,{context:t,style:nt,children:[(0,G.jsxs)("header",{style:{display:"grid",gap:12},children:[a?.subtitle?(0,G.jsx)("p",{style:{...C,margin:0},"data-testid":"app-subtitle",children:a.subtitle}):null,(0,G.jsx)(se,{context:t,"data-testid":"standing",children:f}),(0,G.jsxs)("p",{style:{...oe,display:"grid",gap:4},"data-testid":"standing-card",children:[p.length===0&&g?(0,G.jsxs)("span",{children:["Begin with \u201C",g.creator?.title??g.creator?.name,"\u201D, under"," ",(0,G.jsx)($,{to:`/${X(n.schema,g.entry.kind)}`,style:q,children:Q(n,g.entry.kind)}),"."]}):null,r.length===0?(0,G.jsx)("span",{children:"All rules hold."}):(0,G.jsx)($,{to:"/problems",style:{...q,color:"var(--graview-warn)"},children:o})]})]}),(0,G.jsx)(Rn,{context:t}),(0,G.jsxs)("section",{style:{...re,display:"grid",gap:14},"data-testid":"kinds",children:[(0,G.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[(0,G.jsx)("h2",{style:te,children:"What is here"}),v.length>0?(0,G.jsxs)($,{to:"/map",style:{...q,...C,marginLeft:"auto"},"data-testid":"map-link",children:["Connections \xB7 ",v.length===1?"1 relation":`${v.length} relations`," ",(0,G.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]}):null]}),(0,G.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"8px 10px"},children:c.map(({kind:x,members:H})=>(0,G.jsx)("li",{style:{maxWidth:"100%"},children:(0,G.jsxs)($,{to:`/${X(n.schema,x)}`,style:{...we,flexWrap:"wrap",gap:8,padding:"6px 14px 6px 10px",borderRadius:8,border:"1px solid var(--graview-edge-bright)",background:"var(--graview-panel)"},children:[(0,G.jsx)(pe,{kind:x,brand:a,schema:n.schema,size:7}),(0,G.jsx)("span",{style:{fontWeight:550,overflowWrap:"anywhere"},children:Q(n,x)}),(0,G.jsx)("span",{style:{...C,fontVariantNumeric:"tabular-nums"},children:H.length===0?"none yet":ct(H.length)})]})},x))})]}),s.length>0?(0,G.jsxs)("section",{style:{...re,display:"grid",gap:10},children:[(0,G.jsx)("h2",{style:te,children:"Recently"}),(0,G.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:s.map(x=>(0,G.jsxs)("li",{style:C,children:[(0,G.jsx)("span",{style:{color:"var(--graview-ink)"},children:x.intent})," \u2014 ",ut(x,e,{graph:n.graph,schema:n.schema,...t.seats?{seats:t.seats}:{},...t.people?{people:t.people}:{}})]},x.id))})]}):null]})}var Pe=D(Ee(),1);var E=D(_(),1);function $n({context:t}){let{store:e,brand:n,principal:a,invariantContext:i}=t;ee(e);let[r]=at(),o=r.get("q")??"",s=typeof i?.today=="string"?i.today:void 0,d=ar(e,o,{...a?{principal:a}:{},places:xe(t),flagged:new Set(e.violations(i).flatMap(u=>u.nodeIds)),...s?{today:s}:{},limit:200}),c=d.hits.filter(u=>u.about==="node"),p=d.hits.filter(u=>u.about==="kind"||u.about==="place"||u.about==="rule"),g=[...new Set(c.map(u=>u.kind))],f=o.trim();return(0,E.jsxs)(ne,{context:t,children:[(0,E.jsx)("style",{children:It}),(0,E.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,E.jsx)("p",{style:ye,children:"Search"}),(0,E.jsx)(se,{context:t,"data-testid":"search-heading",children:f.length===0?"Find anything by its name":d.hits.length===0?(0,E.jsxs)(E.Fragment,{children:["Nothing here is called \u201C",f,"\u201D."]}):(0,E.jsxs)(E.Fragment,{children:[ji(e,d.byKind)," for \u201C",f,"\u201D"]})}),f.length>0?(0,E.jsxs)("p",{style:{...C,margin:0},"data-testid":"search-searched",children:[Tt(e.schema,d.searched),d.conditions.filter(u=>u.key!=="is"&&u.admittedBy.length<d.searched.kinds.length).map(u=>(0,E.jsxs)("span",{children:[" ",u.key,":",u.value," narrows"," ",u.admittedBy.length===0?"nothing here":u.admittedBy.map(w=>Q(e,w).toLowerCase()).join(" and "),"."]},`${u.key}:${u.value}`))]}):(0,E.jsxs)("p",{style:oe,children:["Type in the box above. Words find the start of words in names and in what each record says;"," ",(0,E.jsx)("code",{children:"done:false"})," and the like narrow as a list does, and ",(0,E.jsx)("code",{children:"is:any"})," includes what is past."]})]}),p.length>0?(0,E.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},"data-testid":"search-named",children:p.map(u=>(0,E.jsx)("li",{"data-testid":"search-hit","data-about":u.about,children:u.about==="kind"?(0,E.jsxs)($,{to:`/${X(e.schema,u.kind)}`,style:q,children:[u.label,u.count>0?(0,E.jsxs)("span",{style:C,children:[" \xB7 ",u.count," match"]}):null]}):u.about==="place"?(0,E.jsxs)($,{to:ve(t,u),style:q,children:["Go to ",u.title]}):u.about==="rule"?(0,E.jsxs)($,{to:"/problems",style:q,children:["The rule \u201C",u.label,"\u201D"]}):null},`${u.about}:${u.about==="rule"?u.name:u.about==="place"?u.as:u.kind}`))}):null,g.map(u=>(0,E.jsxs)("section",{className:"graview-list",style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",minWidth:0},"data-testid":"search-group","data-kind":u,children:[(0,E.jsxs)("h2",{className:"graview-group-head",style:{alignItems:"center"},children:[(0,E.jsx)(pe,{kind:u,brand:n,schema:e.schema,size:8}),(0,E.jsx)($,{to:`/${X(e.schema,u)}?${new URLSearchParams({q:f}).toString()}`,style:q,"data-testid":"search-kind-link",children:Q(e,u)}),(0,E.jsx)("span",{children:d.byKind[u]})]}),(0,E.jsx)("ul",{className:"graview-rows",children:c.filter(w=>w.kind===u).map(w=>(0,E.jsxs)("li",{"data-testid":"search-hit","data-about":"node",className:"graview-row",children:[(0,E.jsxs)($,{to:J(e.schema,u,w.id),className:"graview-row-title",...w.label.length>60?{title:w.label}:{},children:[w.flagged?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("span",{role:"img","aria-label":"Breaks a rule:",style:{color:"var(--graview-warn)"},children:"\u26A0"})," "]}):null,w.label]}),w.apart||!w.current?(0,E.jsx)("span",{className:"graview-row-glance",children:[w.apart,w.current?"":"past"].filter(Boolean).join(" \xB7 ")}):null,(0,E.jsx)(qt,{why:w.why})]},w.id))})]},u)),f.length>0?(0,E.jsx)(zi,{asked:f}):null,f.length>0&&d.hits.length===0?(0,E.jsx)(ei,{store:e,kinds:d.searched.kinds,words:d.words,...a?{principal:a}:{},...i?{invariantContext:i}:{}}):null]})}function qt({why:t}){return t.strength==="near"?(0,E.jsxs)("span",{style:C,"data-testid":"search-why","data-near":"",children:["Near \u201C",t.asked,"\u201D",t.field==="label"?"":` \u2014 ${t.reading}: ${t.fragment}`]}):t.field==="label"?null:(0,E.jsxs)("span",{style:C,"data-testid":"search-why",children:[t.reading,": ",t.fragment]})}function ji(t,e){let n=Object.entries(e).map(([a,i])=>`${i} ${i===1?Fe(t.schema.tryDefinition(a),a):Q(t,a).toLowerCase()}`);return n.length===0?"Found":n.length===1?ke(n[0]):ke(`${n.slice(0,-1).join(", ")} and ${n[n.length-1]}`)}function Zr(t,e,n={}){let a=[];for(let i of e){let r=Ge(t,i,{...n.principal?{principal:n.principal}:{},...n.invariantContext?{context:n.invariantContext}:{}});for(let o of Gt(t,i,r.actions.affordances))a.some(s=>s.mutation.name===o.mutation.name)||a.push(o)}return a}function Gt(t,e,n){let a=t.schema.tryDefinition(e)?.fieldRoles?.label,i=[];for(let r of n){let o=t.allMutations().find(c=>c.name===r.mutation);if(!o||!o.creates?.includes(e)||i.some(c=>c.mutation.name===o.name))continue;let s=Nt(o.input).map(c=>c.name),d=s.includes("label")?"label":a&&s.includes(a)?a:void 0;!d||r.args[d]!==void 0||i.push({kind:e,affordance:r,mutation:o,arg:d})}return i}function ei({store:t,kinds:e,words:n,principal:a,invariantContext:i}){let r=Zr(t,e,{...a?{principal:a}:{},...i?{invariantContext:i}:{}});return r.length===0||n.trim().length===0?null:(0,E.jsx)("div",{style:{display:"grid",gap:24},"data-testid":"search-to-create",children:r.map(({kind:o,affordance:s,mutation:d,arg:c})=>(0,E.jsxs)("section",{style:{...re,display:"grid",gap:14},children:[(0,E.jsxs)("h2",{style:te,children:[ke(Qn(Fe(t.schema.tryDefinition(o),o)))," called \u201C",n,"\u201D"]}),(0,E.jsx)(Ne,{store:t,mutation:d,prefilled:s.args,open:s.open,initial:{[c]:n},...a?{principal:a}:{}})]},`${s.id}|${n}`))})}function zi({asked:t}){let e=fe();return e?(0,E.jsx)(_i,{asked:t,talk:e.seatTalk}):null}function _i({asked:t,talk:e}){let{drawn:n}=ma(e);return n===0?null:(0,E.jsx)("p",{style:{margin:0},children:(0,E.jsxs)("button",{type:"button","data-testid":"search-ask",onClick:()=>e.ask(t),style:{...q,font:"inherit",padding:0,border:0,background:"transparent",cursor:"pointer",textAlign:"start"},children:["Ask: \u2018",t,"\u2019"]})})}var h=D(_(),1),ni=8,ai=40;function Yi(t,e){let n=e?.fields?.shape??{},a=Object.keys(n).find(i=>ea(n[i])&&Zn(t[i]));return a===void 0?void 0:t[a]}function On({context:t}){let e=De(),n=Ce(t.store.schema,e.slug??"");return n?(0,h.jsx)(ri,{context:t,kind:n}):(0,h.jsx)(ne,{context:t,children:(0,h.jsx)(se,{context:t,children:"No such kind of thing here."})})}function ri({context:t,kind:e,opening:n,row:a,layout:i="list",description:r,bare:o}){let{store:s,brand:d,invariantContext:c}=t;ee(s);let[p,g]=at(),f=`list-${(0,Pe.useId)().replace(/:/g,"")}`,u=s.schema.tryDefinition(e),w=na(p.get("archived")),W=s.graph.nodesOfKind(e,{archived:w}),v=Ve(s).relations.filter(l=>l.from===e||l.to===e),x=new Set(s.violations(c).flatMap(l=>l.nodeIds)),H=Ja(s.schema,Xa(s.schema,Ya(s.schema,e))),N=v.map(l=>l.edgeKind),U=to(p,H,N),j=["sort","filter","group","q","by","with","past","archived",...N].some(l=>p.has(l)),Y=W.length>=ai,me=u?.fieldRoles?.when,k=t.views?.arrangement?.()?.lists?.[e],A=Za(k),T=Qa(k?.group),M=eo(Y,me),le=n??(A?{...M,...A}:M),z=j?U.arrangement:un(le,H).arrangement,Z=A?.sort,B=z.sort&&Z?.then&&z.sort.by===Z.by&&z.sort.direction===Z.direction?{...z,sort:Z}:z,m=tr(B.query??""),L=[...B.filter??[],...m.conditions].some(l=>l.key==="is"&&(l.value==="past"||l.value==="any"))||_a(u,[...B.filter??[],...m.conditions]),ae=L||!u?.lifecycle?B:{...B,filter:[...B.filter??[],{key:"is",value:"current"}]},I=new Map,_e=Mt(W,ae,{schema:s.schema,graph:s.graph,flagged:x,...typeof c?.today=="string"?{today:c.today}:{},read:(l,b)=>{let O=I.get(l.id);return O||I.set(l.id,O=pt(s.schema,s.graph,l)),O[b]}}),Ke=T&&B.group?.by===T.by&&!B.group.bucket?H.groups.find(l=>l.key===T.by):void 0,Wn=T&&Ke&&(Ke.type==="choice"||Ke.type==="boolean")?er(_e.groups,T,{type:Ke.type,...Ke.options?{options:Ke.options}:{}}):_e.groups.map(l=>({...l,closed:!1})),Hn=new Set((p.get("open")??"").split(",").filter(Boolean)),li=!!B.query||(B.filter??[]).some(l=>l.key===T?.by),Kn=l=>Ke?.type==="boolean"?l==="1"?"true":"false":l,Bn=l=>l.closed&&!li&&!Hn.has(Kn(l.key)),di=l=>{let b=new URLSearchParams(p),O=new Set(Hn);O.has(l)?O.delete(l):O.add(l),O.size>0?b.set("open",[...O].join(",")):b.delete("open"),g(b,{replace:!0})},$e=_e.nodes,ot=u?.lifecycle&&!L?W.filter(l=>Qe(u,l)):W,qn=W.length-ot.length,jt=B.group?.by??null,ci=l=>{let b=new URLSearchParams(p);for(let be of["sort","filter","group","q","by","with","past","archived",...v.map(kt=>kt.edgeKind)])b.delete(be);let O=rr(l);for(let be of["sort","filter","group","q","archived"])O[be]&&b.set(be,O[be]);![...b.keys()].some(be=>["sort","filter","group","q"].includes(be))&&(n||A||Y||me)&&b.set("sort",""),g(b)},{principal:Ye}=t,zt=Ge(s,e,{...Ye?{principal:Ye}:{},...t.invariantContext?{context:t.invariantContext}:{}}),st=zt.actions.affordances.map(l=>({affordance:l,mutation:s.allMutations().find(b=>b.name===l.mutation)})).filter(l=>l.mutation!==void 0),Gn=zt.actions.withheld,Vn=m.words&&$e.length===0?Object.fromEntries(Gt(s,e,zt.actions.affordances).map(l=>[l.mutation.name,l.arg])):{},Xe=Q(s,e),ht=t.views?.lookup(e,{cardinality:"one",fidelity:"glyph"}),_t=ht!==void 0&&!et(ht)?ht:void 0,Yt=(B.group?.bucket??"day")==="day"?B.group?.by:void 0,Xt=(B.filter??[]).map(l=>l.key),pi=Xt.filter(l=>Xt.indexOf(l)===Xt.lastIndexOf(l)&&/choice|boolean/.test(H.filters.find(b=>b.key===l)?.type??"")),Jt=l=>{let b={...u?.computed?pt(s.schema,s.graph,l):l};Yt&&!String(b[Yt]).includes("T")&&delete b[Yt];for(let O of pi)delete b[O];return b},wt=l=>{let b=ce(u,l);if(a)return(0,h.jsxs)("li",{"data-testid":"record-row","data-graview-record":l.id,style:{minWidth:0},...nn(l.id),children:[tn(l,b),a(l,{label:b,href:J(s.schema,e,l.id),flagged:x.has(l.id),glance:Dt(Jt(l),u,b)})]},l.id);if(_t){let an=Ot(ht,l,s.graph),hi=Object.fromEntries(Object.entries(Jt(l)).filter(([wi])=>!an?.fields.has(wi))),Yn=an?Dt(hi,u,an.title??b):"";return(0,h.jsxs)("li",{"data-testid":"record-row","data-graview-record":l.id,style:{position:"relative",display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:16,rowGap:2,paddingBlock:10,borderTop:"1px solid var(--graview-edge)"},...nn(l.id),children:[tn(l,b),(0,h.jsx)("div",{style:{flex:"1 1 14rem",minWidth:0},children:(0,h.jsx)(_t,{node:l,cardinality:"one",fidelity:"glyph",mode:"fullscreen",selected:!1,...x.has(l.id)?{flagged:[l.id]}:{}})}),Yn?(0,h.jsx)("span",{style:{...C,flex:"0 1 auto",minWidth:0,overflowWrap:"anywhere"},"data-testid":"record-glance",children:Yn}):null,(0,h.jsx)($,{to:J(s.schema,e,l.id),"aria-label":x.has(l.id)?`${b} \u2014 implicated in a problem`:b,style:{position:"absolute",inset:0,borderRadius:6}})]},l.id)}let O=Dt(Jt(l),u,b),be=m.words?nr(u,l,m.words):void 0,kt=Y?void 0:Ka(l,u),St=Yi(l,u),_n=(0,h.jsxs)($,{to:J(s.schema,e,l.id),className:"graview-row-title",...b.length>60?{title:b}:{},children:[x.has(l.id)?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("span",{role:"img","aria-label":"Breaks a rule:",style:{color:"var(--graview-warn)"},children:"\u26A0"})," "]}):null,b]});return(0,h.jsxs)("li",{className:"graview-row","data-graview-record":l.id,...nn(l.id),children:[tn(l,b),kt?(0,h.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,minWidth:0},children:[(0,h.jsx)(qe,{as:"thumb",file:kt}),_n]}):_n,O||St?(0,h.jsxs)("span",{className:"graview-row-glance",children:[O,O&&St?" \xB7 ":null,St?(0,h.jsx)(Et,{address:St}):null]}):null,be?(0,h.jsx)(qt,{why:be}):null]},l.id)},Qt=xe(t).filter(l=>l.kind===e),Un=k?.filters,ui=(B.filter??[]).some(l=>l.key!=="is"||l.value!=="any"),gi=!!(B.sort||B.group||B.query||ui),mi=ot.length>=ni||j&&gi,Te=B.sort?H.sorts.find(l=>l.key===B.sort.by):void 0,Zt=Te?.type==="date"||Te!==void 0&&Te.key===me,jn=Y&&!_e.grouped&&Te&&(Te.about==="label"||Te.type==="text"||Zt)?l=>{let b=Te.about==="label"?ce(u,l):l[Te.key];if(typeof b!="string"||b.length===0)return Zt?"No date":"#";if(Zt)return b.slice(0,4);let O=b.trim().charAt(0).toLocaleUpperCase();return/\p{L}/u.test(O)?O:"#"}:void 0,Be=jn?$e.reduce((l,b)=>{let O=jn(b);return l.at(-1)?.key===O?l.at(-1).nodes.push(b):l.push({key:O,nodes:[b]}),l},[]):void 0,zn=_e.grouped&&jt?Wn.flatMap(l=>Bn(l)?[]:l.nodes):Be&&Be.length>1?Be.flatMap(l=>l.nodes):$e,en=(0,Pe.useMemo)(()=>zn.map(l=>l.id),[zn.map(l=>l.id).join(`
|
|
108
|
+
`)]),Ae=ur(en),lt=(Ye?s.permittedMutations(Ye):s.permittedMutations()).some(l=>{let b=l.subject?.kinds;return b!==void 0&&(b==="*"||b.includes(e))}),tn=(l,b)=>lt?(0,h.jsx)("span",{className:"graview-choose-at",children:(0,h.jsx)("input",{...Ae.boxProps(l.id,b),onPointerEnter:fn,onFocus:fn})}):null,nn=l=>lt?{"data-graview-choose":l}:{},fi=(0,Pe.useCallback)(l=>{Ae.choose(l),requestAnimationFrame(()=>{let b=Ae.list.current;((l[0]===void 0?null:b?.querySelector(`[data-graview-choose-box="${CSS.escape(l[0])}"]`))??b)?.focus({preventScroll:!0})})},[Ae]),Je=i==="grid"?{margin:0,padding:0,listStyle:"none",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 15rem), 1fr))",alignItems:"start",gap:12}:a||_t?{margin:0,padding:0,listStyle:"none",display:"grid",gap:a&&i==="list"?6:0}:void 0,vt=Je?void 0:"graview-rows",dt=l=>`list-at-${l.replace(/[^\p{L}\p{N}]/gu,"_")}`,bt=v.map(l=>{let b=l.from===e?l.to:l.from,O=l.from===e?l.description:l.inverse??l.description;return{relation:l,far:b,words:O}}),yi=new Set(bt.map(l=>(l.words??"").toLowerCase()).filter((l,b,O)=>l&&O.indexOf(l)!==b));return(0,h.jsxs)(o?Zi:ne,{context:t,children:[(0,h.jsxs)("div",{style:{display:"grid",gap:12},children:[(0,h.jsxs)("header",{style:{display:"grid",gap:4},children:[(0,h.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[(0,h.jsx)(pe,{kind:e,brand:d,schema:s.schema,size:8}),(0,h.jsx)(se,{context:t,children:Xe})]}),r??u?.description?(0,h.jsx)("p",{style:oe,children:r??u?.description}):null,bt.length>0||Qt.length>0?(0,h.jsxs)("p",{style:{...C,margin:0,display:"flex",flexWrap:"wrap",columnGap:18,rowGap:2},"data-testid":"kind-related",children:[bt.length>0?(0,h.jsxs)("span",{"data-testid":"kind-relations",children:["Related:"," ",bt.map(({relation:l,far:b,words:O},be)=>(0,h.jsxs)("span",{"data-relation":l.edgeKind,children:[be>0?(0,h.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,b==="*"?ke(O??he(l.edgeKind)):(0,h.jsx)($,{to:`/${X(s.schema,b)}`,style:q,title:Q(s,b),children:O&&yi.has(O.toLowerCase())?`${ke(O)}: ${Q(s,b).toLowerCase()}`:ke(O??Q(s,b))})]},`${l.edgeKind}|${l.from}|${l.to}`))]}):null,Qt.length>0?(0,h.jsxs)("span",{"data-testid":"kind-pictures",children:["Also as:"," ",Qt.map((l,b)=>(0,h.jsxs)("span",{children:[b>0?(0,h.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,(0,h.jsx)($,{to:ve(t,l),style:q,children:l.title})]},Ue(l)))]}):null]}):null]}),U.dropped.length>0?(0,h.jsxs)("p",{style:{...C,margin:0},"data-testid":"list-dropped",children:["This link asked for ",U.dropped.join(", "),", which ",Xe.toLowerCase()," cannot be arranged by; the rest is shown."]}):null,ot.length>0?(0,h.jsx)(sr,{schema:s.schema,graph:s.graph,kind:e,arrangement:B,onChange:ci,kept:{shown:$e.length,of:ot.length},noun:{one:Fe(u,e),many:Xe.toLowerCase()},...mi?{}:{allow:!1},...Un?{filters:Un}:{},offers:H,chips:{nodes:ot,flagged:x,...typeof c?.today=="string"?{today:c.today}:{}},query:t.framed===!0&&t.barAbove!==!0}):null,(0,h.jsx)("style",{children:It}),lt?(0,h.jsx)("style",{children:gr+Qi}):null,(0,h.jsx)("div",{className:"graview-list",...lt?{...Ae.listProps,ref:Ae.list,tabIndex:-1,"data-graview-choosable":"","aria-label":Ae.chosen.length>0?`${Xe}, ${Ae.chosen.length} chosen`:Xe,role:"group"}:{},children:$e.length===0&&m.words?(0,h.jsxs)("p",{style:oe,"data-testid":"none-yet",children:["Nothing here is called \u201C",m.words,"\u201D."," ",(0,h.jsx)("span",{style:C,"data-testid":"list-searched",children:Tt(s.schema,{kinds:[e],past:L})})," ",(0,h.jsx)($,{to:"?",style:q,children:"Show every one"})]}):$e.length===0?(0,h.jsxs)("p",{style:oe,"data-testid":"none-yet",children:[B.filter?.length||B.query?"None of them.":"None yet",!B.filter?.length&&!B.query&&st.length>0?` \u2014 the first one starts below, with \u201C${st[0]?.mutation.title??st[0]?.mutation.name}\u201D.`:!B.filter?.length&&!B.query?".":"",B.filter?.length||B.query?(0,h.jsxs)(h.Fragment,{children:[" ",(0,h.jsx)($,{to:"?",style:q,children:"Show every one"})]}):null]}):_e.grouped&&jt?(0,h.jsx)("div",{style:{display:"grid",gap:"1rem"},"data-testid":"records","data-grouped":jt,children:Wn.map(l=>{if(!l.closed)return(0,h.jsxs)("section",{style:{display:"grid",gap:0},"data-testid":"list-group",children:[(0,h.jsxs)("h2",{className:"graview-group-head",children:[l.label," ",(0,h.jsx)("span",{children:l.nodes.length})]}),(0,h.jsx)("ul",{style:Je,className:vt,"data-graview-rows":"",children:l.nodes.map(wt)})]},l.key||"-");let b=Bn(l),O=`${f}-${dt(l.key||"none")}`;return(0,h.jsxs)("section",{style:{display:"grid",gap:0},"data-testid":"list-group","data-closed":b?"shut":"open",children:[(0,h.jsx)("h2",{className:"graview-group-head",children:(0,h.jsxs)("button",{type:"button",className:"graview-group-toggle","aria-expanded":!b,"aria-controls":O,"data-testid":"list-group-toggle",onClick:()=>di(Kn(l.key)),children:[(0,h.jsx)("span",{"aria-hidden":"true",children:b?"\u25B8":"\u25BE"}),l.label," ",(0,h.jsxs)("span",{children:["\xB7 ",l.nodes.length]}),(0,h.jsxs)("span",{style:Xi,children:[" ",l.nodes.length===1?Fe(u,e):Xe.toLowerCase()]})]})}),(0,h.jsx)("ul",{id:O,style:b?{...Je,display:"none"}:Je,className:vt,"data-graview-rows":"",hidden:b,children:b?null:l.nodes.map(wt)})]},l.key||"-")})}):Be&&Be.length>1?(0,h.jsxs)("div",{style:{display:"grid",gap:14},"data-testid":"records","data-sectioned":Te?.type==="date"?"year":"letter",children:[(0,h.jsx)("nav",{"aria-label":"Jump to","data-testid":"list-index",style:{...C,display:"flex",flexWrap:"wrap",gap:Te?.type==="date"?"0 10px":"0 4px",lineHeight:1.3},children:Be.map(l=>(0,h.jsx)("a",{href:`#${dt(l.key)}`,onClick:b=>{b.preventDefault(),document.getElementById(dt(l.key))?.scrollIntoView({block:"start"})},style:{...we,minWidth:24,justifyContent:"center"},children:l.key},l.key))}),Be.map(l=>(0,h.jsxs)("section",{"data-testid":"list-section","aria-labelledby":dt(l.key),style:{display:"grid",gap:0},children:[(0,h.jsx)("h2",{id:dt(l.key),className:"graview-group-head",children:l.key}),(0,h.jsx)("ul",{style:Je,className:vt,"data-graview-rows":"",children:l.nodes.map(wt)})]},l.key))]}):(0,h.jsx)("ul",{style:Je,className:vt,"data-testid":"records","data-graview-rows":"",children:$e.map(wt)})}),lt?(0,h.jsx)(mr,{store:s,chosen:Ae.chosen,...Ye?{principal:Ye}:{},...c?{context:c}:{},anchor:Ji,of:en.length,onChooseAll:()=>Ae.choose(en),onClear:Ae.clear,onActed:fi}):null,qn>0?(0,h.jsxs)($,{to:ti(p,"filter","is:any"),style:{...q,...C,justifySelf:"start"},"data-testid":"past-link",children:["+",qn," past"]}):null,w===!1&&s.graph.count(e,{archived:!0})>0?(0,h.jsxs)($,{to:ti(p,"archived","true"),style:{...q,...C,justifySelf:"start"},"data-testid":"archived-link",children:["+",s.graph.count(e,{archived:!0})," archived"]}):null,st.length>0?(0,h.jsx)("div",{style:{display:"grid",gap:6},"data-testid":"beginnings",children:st.map(({affordance:l,mutation:b})=>{let O=!!(Vn[b.name]&&$e.length===0);return(0,h.jsx)(no,{name:b.name,title:b.title??b.name,description:b.description,open:$e.length===0,children:(0,h.jsx)(Ne,{store:s,mutation:b,prefilled:l.args,open:l.open,...O?{initial:{[Vn[b.name]]:m.words}}:{},...t.principal?{principal:t.principal}:{}},O?`${b.name}|${m.words}`:b.name)},l.id)})}):null]}),Gn.length>0?(0,h.jsx)("ul",{style:{...re,margin:0,padding:0,listStyle:"none",display:"grid",gap:4},"data-testid":"withheld",children:Gn.map(l=>(0,h.jsxs)("li",{style:C,children:[(0,h.jsx)("s",{children:l.label})," \u2014 ",l.refusal.message]},l.id))}):null]})}var Xi={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},Ji=()=>document.querySelector("[data-graview-choosable]")?.closest("[data-embed-content]")??null,Qi=`
|
|
109
|
+
.graview-list[data-graview-choosable]{outline:none}
|
|
110
|
+
.graview-list [data-graview-choose]{position:relative;padding-left:34px}
|
|
111
|
+
.graview-choose-at{position:absolute;left:2px;top:0;bottom:0;z-index:${oa.raised};display:flex;align-items:center}
|
|
112
|
+
@media (pointer: coarse){
|
|
113
|
+
.graview-list:not([data-graview-choosing]) [data-graview-choose]{padding-left:0}
|
|
114
|
+
.graview-list:not([data-graview-choosing]) .graview-choose-at{display:none}
|
|
115
|
+
}
|
|
116
|
+
`;function Zi({children:t}){return(0,h.jsx)("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:40,minWidth:0},children:t})}var eo=(t,e)=>e?{sort:{by:e,direction:"desc"}}:t?{sort:{by:"label",direction:"asc"}}:{};function to(t,e,n){let a=At({...t.get("sort")?{sort:t.get("sort")}:{},...t.get("filter")?{filter:t.get("filter")}:{},...t.get("group")?{group:t.get("group")}:{},...t.get("q")?{q:t.get("q")}:{},...t.get("archived")?{archived:t.get("archived")}:{}}),i=[...a.filter??[]],r=t.get("by"),o=a.group??(r?{by:r}:void 0);for(let d of n){let c=t.get(d);c&&i.push({key:d,value:c})}let s=t.get("with");return s&&i.push({key:s,value:"*"}),t.get("past")==="1"&&!i.some(d=>d.key==="is")&&i.push({key:"is",value:"any"}),un({...a.sort?{sort:a.sort}:{},...a.query?{query:a.query}:{},...i.length>0?{filter:i}:{},...o?{group:o}:{},...a.archived!==void 0?{archived:a.archived}:{}},e)}function ti(t,e,n){let a=new URLSearchParams(t);return a.set(e,n),a.delete("past"),`?${a.toString()}`}function no({name:t,title:e,description:n,open:a,children:i}){let[r,o]=(0,Pe.useState)(a),s=(0,Pe.useRef)(null),d=(0,Pe.useRef)(null),c=`begin-${(0,Pe.useId)().replace(/:/g,"")}`;return(0,h.jsxs)("div",{"data-testid":`act-${t}`,style:{display:"grid",gap:10},children:[(0,h.jsxs)("button",{ref:s,type:"button","data-testid":`act-open-${t}`,"aria-expanded":r,"aria-controls":c,onClick:()=>{o(!r),r||requestAnimationFrame(()=>d.current?.querySelector("input, select, textarea, button")?.focus())},style:{...we,justifySelf:"start",minHeight:32,padding:"0 2px",border:0,background:"none",font:"inherit",fontWeight:600,color:"var(--graview-ink)",cursor:"pointer"},children:[(0,h.jsx)("span",{"aria-hidden":"true",style:{marginRight:6},children:r?"\u2212":"+"}),e]}),(0,h.jsxs)("div",{ref:d,id:c,hidden:!r,onKeyDown:p=>{p.key==="Escape"&&(p.preventDefault(),o(!1),s.current?.focus())},style:r?{display:"grid",gap:12,padding:"4px 0 12px"}:void 0,children:[n?(0,h.jsx)("p",{style:{...C,margin:0,maxWidth:"58ch"},children:n}):null,i]})]})}var it=D(Ee(),1);var yt=D(Ee(),1);var F=D(_(),1);function Fn({context:t}){let{store:e,brand:n,invariantContext:a,principal:i}=t;ee(e);let r=e.violations(a),o=e.allInvariants(),s=Ct(e,r),d=Ra(e.schema,o);return(0,F.jsxs)(ne,{context:t,children:[(0,F.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,F.jsx)(se,{context:t,children:r.length===0?"All rules hold":"What is broken"}),(0,F.jsx)("p",{style:oe,"data-testid":"problems-count",children:r.length===0?"Every declared rule is satisfied by what is here.":aa(r)})]}),(0,F.jsx)(Qr,{context:t}),s.map((c,p)=>{let g=c.nodeIds[0],f=g?e.graph.getNode(g):void 0;return(0,F.jsxs)("section",{style:{display:"grid",gap:10,padding:"16px 18px",borderLeft:"3px solid var(--graview-warn)",background:"var(--graview-panel-warning)",borderRadius:"0 var(--graview-radius, 12px) var(--graview-radius, 12px) 0"},children:[c.line?null:(0,F.jsx)(Vt,{violation:c,schema:e.schema,...n?{brand:n}:{}}),f?(0,F.jsxs)("p",{style:{margin:0,display:"inline-flex",alignItems:"center",gap:8},children:[(0,F.jsx)(pe,{kind:f.kind,brand:n,schema:e.schema,size:7}),(0,F.jsx)($,{to:J(e.schema,f.kind,f.id),style:q,children:ce(e.schema.tryDefinition(f.kind),f)})]}):null,c.line?(0,F.jsx)(Vt,{violation:c,schema:e.schema,...n?{brand:n}:{}}):null,(0,F.jsx)(Ut,{store:e,repairs:c.repairs,...i?{principal:i}:{}})]},p)}),o.length>0?(0,F.jsxs)("section",{style:{...re,display:"grid",gap:12},"data-testid":"rules",children:[(0,F.jsx)("h2",{style:te,children:"The rules"}),(0,F.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:o.map(c=>{let p=r.filter(u=>u.invariant===c.name).length,g=d.get(c.name),f=c.label??c.name;return(0,F.jsxs)("li",{"data-graview-rule":c.name,style:{display:"grid",gap:2},children:[(0,F.jsxs)("span",{style:{display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:12,rowGap:2},children:[g?(0,F.jsx)(Rt,{line:g,schema:e.schema,...n?{brand:n}:{},style:{flex:"1 1 18rem"}}):(0,F.jsx)("span",{style:{flex:"1 1 18rem",fontWeight:550},children:f}),(0,F.jsx)("span",{style:{...C,color:p>0?"var(--graview-warn)":"var(--graview-ink-faint)"},children:p===0?"holds":`broken in ${p} ${p===1?"place":"places"}`})]}),g&&f.trim().length>0?(0,F.jsx)("span",{style:C,children:f}):null]},c.name)})})]}):null]})}function Vt({violation:t,schema:e,brand:n}){if(!t.line)return(0,F.jsx)("p",{style:{margin:0,color:"var(--graview-warn)",fontWeight:550},children:t.message});let a=Ta(t),i=La(t);return i?(0,F.jsxs)("div",{style:{display:"grid",gap:4},"data-testid":"problem-line",children:[(0,F.jsx)("p",{style:{margin:0,color:"var(--graview-warn)",fontWeight:550},"data-testid":"problem-says",children:i}),a?(0,F.jsx)("span",{style:C,children:a}):null,(0,F.jsxs)("details",{"data-testid":"problem-judged",style:C,children:[(0,F.jsx)("summary",{style:{cursor:"pointer",width:"fit-content",minHeight:24},children:"How it is judged"}),(0,F.jsx)(Rt,{line:t.line,schema:e,...n?{brand:n}:{},lead:"none"})]})]}):(0,F.jsxs)("div",{style:{display:"grid",gap:2},"data-testid":"problem-line",children:[(0,F.jsx)(Rt,{line:t.line,schema:e,...n?{brand:n}:{},lead:"none",style:{color:"var(--graview-warn)"}}),a?(0,F.jsx)("span",{style:C,children:a}):null]})}function Ut({store:t,repairs:e,principal:n}){let[a,i]=(0,yt.useState)(null),[r,o]=(0,yt.useState)(null),s=(0,yt.useRef)([]);if(e.length===0)return null;let d=a===null?null:e[a],c=d&&(d.missing??[]).length>0?t.allMutations().find(p=>p.name===d.mutation):void 0;return(0,F.jsxs)("div",{style:{display:"grid",gap:10},"data-testid":"repairs",children:[(0,F.jsx)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:e.map((p,g)=>{let f=(p.missing??[]).length>0,u=t.permits({name:p.mutation,args:{...p.args}},n);return u.ok?(0,F.jsx)("button",{ref:w=>{s.current[g]=w},type:"button","data-graview-repair":p.mutation,"data-graview-asks":f||void 0,"aria-expanded":f?a===g:void 0,onClick:()=>{if(o(null),f){i(a===g?null:g);return}i(null);try{t.apply({name:p.mutation,args:{...p.args}},n?{author:n}:{})}catch(w){o(tt(t.schema,t.allMutations(),w))}},style:Oe,children:f?`${p.label} \u2026`:p.label},g):(0,F.jsxs)("p",{"data-testid":"withheld","data-withheld":u.refusal.wouldNeed.join(",")||"nobody",style:{...C,margin:0},children:[(0,F.jsx)("s",{children:p.label})," \u2014 ",u.refusal.message]},g)})}),c&&d?(0,F.jsx)(Ne,{store:t,mutation:c,prefilled:{...d.args},only:d.missing??[],label:d.label,onDone:()=>{let p=a;i(null),requestAnimationFrame(()=>{let g=p===null?null:s.current[p];if(g?.isConnected){g.focus();return}let f=document.querySelector("[data-graview-page-title]")??document.querySelector("main h1, main h2");f&&(f.hasAttribute("tabindex")||(f.tabIndex=-1),f.focus())})},...n?{principal:n}:{}}):null,d&&!c&&(d.missing??[]).length>0?(0,F.jsxs)("p",{"data-testid":"refused",role:"alert",style:{margin:0,color:"var(--graview-warn)",fontSize:yn},children:["\u201C",d.label,"\u201D names ",d.mutation,", which this app does not declare."]}):null,r?(0,F.jsx)("p",{"data-testid":"refused",role:"alert",style:{margin:0,color:"var(--graview-warn)",fontSize:yn},children:r}):null]})}var In=D(Ee(),1);var He=D(_(),1);function ii({store:t,link:e,principal:n}){let[a,i]=(0,In.useState)(!1),[r,o]=(0,In.useState)(null),s=Ia(e);return(0,He.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[(0,He.jsx)("button",{type:"button","data-graview-provisional":"",title:s,"aria-label":`Unsure link: ${s}`,"aria-expanded":a,onClick:()=>i(!a),style:{border:"1px dashed var(--graview-ink-muted)",borderRadius:999,background:"transparent",color:"var(--graview-ink-muted)",font:"inherit",fontSize:"0.75rem",lineHeight:1,padding:"2px 6px",cursor:"pointer"},children:"unsure"}),a?(0,He.jsxs)("span",{style:{...C,display:"inline-flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,He.jsx)("span",{children:s}),(0,He.jsx)("button",{type:"button",style:{...Oe,padding:"4px 10px"},onClick:()=>{try{t.apply({name:ra,args:{kind:e.edge.kind,from:e.edge.from,to:e.edge.to}},n?{author:n}:{}),i(!1)}catch(d){o(tt(t.schema,t.allMutations(),d))}},children:"Keep this link"}),r?(0,He.jsx)("span",{role:"alert",children:r}):null]}):null]})}var y=D(_(),1),ao=[];function Dn({context:t}){let{store:e,brand:n,principal:a,invariantContext:i}=t;ee(e);let r=fe()!==null,o=De(),s=decodeURIComponent(o.id??""),d=Ir(e,s,{...a?{principal:a}:{},...i?{context:i}:{}}),c=Ct(e,d?.violations??ao),[p,g]=(0,it.useState)(null),[f,u]=(0,it.useState)(!1),w=(0,it.useRef)(null),W=(0,it.useRef)(null),v=m=>{(w.current?.parentElement?.querySelector(`[data-affordance="${m.replace(/["\\]/g,"\\$&")}"]`)??w.current)?.focus()};if(!d)return(0,y.jsx)(ne,{context:t,children:(0,y.jsx)(se,{context:t,children:"Nothing lives at this address."})});let x=e.graph.getNode(s),H=e.schema.tryDefinition(d.kind),N=H?.describe&&x?Ma(H,x):null,U=[...e.log.all()].filter(m=>!Pt(m)&&(m.writes.includes(s)||m.reads.includes(s))).slice(-8).reverse(),j=e.log.all().find(m=>!Pt(m)&&m.undoes===void 0&&m.primitives.some(L=>L.op==="add-node"&&L.node.id===s)),Y=d.actions.affordances.filter(m=>m.provider!=="invariant"),me=Y.filter(m=>m.destructive||m.setsAside),k=f||me.length<2?Y:Y.filter(m=>!me.includes(m)),A=t.views?.lookup(d.kind,{cardinality:"one",fidelity:"full"}),T=A!==void 0&&!et(A)?A:void 0,M=T&&x?Ot(A,x,e.graph):void 0,le=M?d.fields.filter(m=>!M.fields.has(m.key)):d.fields,z=M?d.links.flatMap(m=>{let L=m.targets.filter(ae=>!M.records.has(ae.id));return L.length>0?[{...m,targets:L}]:[]}):d.links,Z=T!==void 0&&Pa(A),B=r&&Ha(H).length>0;return(0,y.jsxs)(ne,{context:t,children:[(0,y.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,y.jsxs)("p",{style:{...ye,display:"flex",alignItems:"center",gap:8},children:[(0,y.jsx)(pe,{kind:d.kind,brand:n,schema:e.schema,size:8}),(0,y.jsx)($,{to:`/${X(e.schema,d.kind)}`,style:we,children:Q(e,d.kind)})]}),(0,y.jsx)(se,{context:t,children:r&&x?.label===d.label?(0,y.jsx)(gn,{nodeId:s,field:"label",value:d.label,said:d.label}):d.label}),N&&N!==d.label?(0,y.jsx)("p",{style:oe,children:N}):null,j?.lineage?(0,y.jsxs)("p",{style:{...C,margin:0},"data-testid":"record-lineage",children:["Made by ",ut(j,a,{graph:e.graph,schema:e.schema,...t.seats?{seats:t.seats}:{},...t.people?{people:t.people}:{}}),", ",dn(j.lineage)]}):null,(0,y.jsx)(Ft,{context:t,stop:`#focus=${encodeURIComponent(s)}`,style:{...q,...C},"data-testid":"spatial-link"}),xe(t).some(m=>m.kind===d.kind||m.across===d.kind)?(0,y.jsxs)("p",{style:{...C,margin:0},"data-testid":"seen-in",children:["Seen in:"," ",xe(t).filter(m=>m.kind===d.kind||m.across===d.kind).map((m,L)=>(0,y.jsxs)("span",{children:[L>0?(0,y.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,(0,y.jsx)($,{to:ve(t,m),style:q,children:m.title})," ",(0,y.jsx)(Ft,{context:t,stop:`#view=${encodeURIComponent(m.as)}`,style:{...q,...C,display:"inline-block",minWidth:24,textAlign:"center"},title:`${m.title}, in the scene`,label:`${m.title}, in the scene`,children:(0,y.jsx)("span",{"aria-hidden":"true",children:"\u2197"})})]},Ue(m)))]}):null]}),x&&ta(x)?(0,y.jsx)(io,{context:t,id:s,kind:d.kind}):null,x&&ia(e,s)?(0,y.jsx)(ro,{context:t,id:s,kind:d.kind}):null,T&&x?(0,y.jsx)("section",{"data-testid":"record-view",style:{display:"grid",minWidth:0},children:(0,y.jsx)(fr,{children:(0,y.jsx)(T,{node:x,cardinality:"one",fidelity:"full",mode:"fullscreen",selected:!1,...d.violations.length>0?{flagged:[s]}:{}})})}):null,d.violations.length>0?(0,y.jsx)("section",{"data-testid":"record-violations",style:{display:"grid",gap:12,padding:"16px 18px",borderLeft:"3px solid var(--graview-warn)",background:"var(--graview-panel-warning)",borderRadius:"0 var(--graview-radius, 12px) var(--graview-radius, 12px) 0"},children:c.map((m,L)=>(0,y.jsxs)("div",{style:{display:"grid",gap:8},children:[(0,y.jsx)(Vt,{violation:m,schema:e.schema,...n?{brand:n}:{}}),(0,y.jsx)(Ut,{store:e,repairs:Dr(d.actions,m.repairs),...a?{principal:a}:{}})]},L))}):null,!Z&&(le.length>0||B)?(0,y.jsxs)("section",{style:{...re,display:"grid",gap:14},"data-testid":"record-fields",children:[(0,y.jsx)("h2",{style:te,children:"The facts"}),Na(H,le).map((m,L)=>{let ae=(0,y.jsx)("dl",{style:{margin:0,display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gap:"14px 24px"},children:m.fields.map(I=>I.files?(0,y.jsx)(qe,{as:"field",read:!r,nodeId:s,field:I.key,label:I.label,files:I.files,labelStyle:ye,style:{gap:4}},I.key):I.long?(0,y.jsx)(or,{nodeId:s,field:I.key,label:I.label,value:I.value,markdown:I.markdown,style:{gridColumn:"1 / -1",gap:4},labelStyle:ye,valueStyle:{lineHeight:1.6}},I.key):(0,y.jsxs)("div",{style:{display:"grid",gap:2,minWidth:0,alignContent:"start"},children:[(0,y.jsx)("dt",{style:ye,children:I.label}),(0,y.jsx)("dd",{style:{margin:0,overflowWrap:"anywhere",minWidth:0},children:I.linked?(0,y.jsx)(qa,{relation:I.linked.relation,refs:I.linked.refs,...r?{nodeId:s,field:I.key}:{}}):I.app?(0,y.jsx)(Et,{address:I.app,as:"record",...r?{nodeId:s,field:I.key}:{}}):I.href?(0,y.jsx)(ir,{href:I.href,field:I.key,value:I.value,stored:I.stored,...r?{nodeId:s}:{}}):r?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(gn,{nodeId:s,field:I.key,value:I.value,stored:I.stored}),I.repeats?(0,y.jsx)(Ua,{nodeId:s,field:I.key,start:x?.[I.key],value:x?.[`${I.key}Repeat`],label:`${I.label} repeats`}):null]}):I.value})]},I.key))});return m.title?(0,y.jsxs)("section",{style:{display:"grid",gap:10,minWidth:0},children:[(0,y.jsx)("h3",{"data-graview-field-group":m.title,style:{...te,fontSize:"inherit"},children:m.title}),ae]},L):(0,y.jsx)("div",{children:ae},L)}),B?(0,y.jsx)(qe,{as:"unfilled",nodeId:s,skip:[...M?.fields??[]],labelStyle:ye,style:{gap:4}}):null]}):null,(Z?[]:z).map(m=>(0,y.jsxs)("section",{style:{...re,display:"grid",gap:10},children:[(0,y.jsx)("p",{style:ye,children:Rr(e,m)}),m.description?(0,y.jsx)("h2",{style:te,children:ke(m.description)}):(0,y.jsxs)("h2",{style:te,"aria-label":he(m.edgeKind),children:[m.direction==="in"?"\u2190 ":"\u2192 ",he(m.edgeKind)]}),(0,y.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"6px 18px"},children:m.targets.map(L=>{let ae=Da(e,m.direction==="in"?{kind:m.edgeKind,from:L.id,to:s}:{kind:m.edgeKind,from:s,to:L.id});return(0,y.jsxs)("li",{style:{display:"inline-flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,y.jsx)(pe,{kind:L.kind,brand:n,schema:e.schema,size:7}),(0,y.jsxs)($,{to:J(e.schema,L.kind,L.id),style:q,children:[L.label,L.apart?(0,y.jsxs)("span",{style:C,children:[" \xB7 ",L.apart]}):null]}),ae?.provisional?(0,y.jsx)(ii,{store:e,link:ae,...a?{principal:a}:{}}):null]},L.id)})}),(m.direction==="out"&&e.schema.edge(m.edgeKind)?.cardinality==="one"?[]:[...new Set(m.targets.map(L=>L.kind))]).map(L=>(0,y.jsxs)($,{to:`/${X(e.schema,L)}?${encodeURIComponent(m.edgeKind)}=${encodeURIComponent(s)}`,style:{...q,...C},"data-testid":"related-all",children:["Sort and filter ",m.description??`these ${Q(e,L).toLowerCase()}`,m.targets.some(ae=>ae.kind!==L)?` (${Q(e,L).toLowerCase()})`:""," ",(0,y.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]},L))]},`${m.edgeKind}|${m.direction}|${m.description??""}`)),!Z&&(Y.length>0||d.actions.withheld.length>0)?(0,y.jsxs)("section",{style:{...re,display:"grid",gap:14},"data-testid":"record-actions",children:[(0,y.jsx)("h2",{style:te,ref:w,tabIndex:-1,children:"What can be done"}),(0,y.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:8},children:[k.map(m=>{let L=p===m.id;return(0,y.jsx)("button",{type:"button","data-affordance":m.id,"data-rank":m.rank,autoFocus:f&&m===me[0],"aria-expanded":L,onClick:()=>{g(L?null:m.id),L||requestAnimationFrame(()=>W.current?.querySelector("input:not([type=hidden]), select, textarea, button")?.focus())},style:{...Oe,...L?{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"}:{}},children:m.label},m.id)}),k.length<Y.length?(0,y.jsxs)("button",{type:"button","aria-expanded":!1,onClick:()=>u(!0),style:{...Oe,...C},"data-testid":"record-actions-more",children:["Show ",Y.length-k.length," more"]}):null]}),Y.map(m=>{if(p!==m.id)return null;let L=e.allMutations().find(ae=>ae.name===m.mutation);return L?(0,y.jsxs)("div",{ref:W,onKeyDown:ae=>{if(ae.key!=="Escape"||ae.defaultPrevented)return;ae.preventDefault(),g(null);let I=m.id;requestAnimationFrame(()=>v(I))},style:{display:"grid",gap:10,padding:18,border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,y.jsx)("h3",{style:te,children:m.label}),L.description?(0,y.jsx)("p",{style:{...C,margin:0},children:L.description}):null,(0,y.jsx)(Ne,{store:e,mutation:L,prefilled:m.args,open:m.open,label:m.label,onDone:()=>{g(null);let ae=m.id;requestAnimationFrame(()=>v(ae))},...a?{principal:a}:{}})]},m.id):null}),d.actions.withheld.length>0?(0,y.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:4},children:d.actions.withheld.map(m=>(0,y.jsxs)("li",{style:C,children:[(0,y.jsx)("s",{children:m.label})," \u2014 ",m.refusal.message]},m.id))}):null]}):null,U.length>0?(0,y.jsxs)("section",{style:{...re,display:"grid",gap:10},"data-testid":"record-history",children:[(0,y.jsx)("h2",{style:te,children:"What has happened"}),(0,y.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:U.map(m=>(0,y.jsxs)("li",{style:C,children:[(0,y.jsx)("span",{style:{color:"var(--graview-ink)"},children:m.intent}),m.lineage?(0,y.jsxs)("span",{"data-graview-lineage":"",children:[" \xB7 ",dn(m.lineage)]}):null," \u2014 ",ut(m,a,{graph:e.graph,schema:e.schema,...t.seats?{seats:t.seats}:{},...t.people?{people:t.people}:{}})]},m.id))})]}):null]})}function ro({context:t,id:e,kind:n}){let{store:a,principal:i}=t,r={name:`allow-tidying-${n}`,args:{id:e}},o=a.allMutations().some(s=>s.name===r.name)&&a.permits(r,i).ok;return(0,y.jsxs)("section",{"data-testid":"record-left-alone",style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:12,padding:"12px 16px",border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,y.jsxs)("p",{style:{margin:0,flex:"1 1 16rem"},children:[(0,y.jsx)("strong",{children:"Left alone."})," Nothing automated changes it; tidying passes it by."]}),o?(0,y.jsx)("button",{type:"button",style:Oe,"data-testid":"allow-tidying",onClick:()=>a.apply(r,i?{author:i}:{}),children:"Allow tidying again"}):null]})}function io({context:t,id:e,kind:n}){let{store:a,principal:i}=t,r={name:`unarchive-${n}`,args:{id:e}},o=a.allMutations().some(c=>c.name===r.name)&&a.permits(r,i).ok,s=[...a.log.all()].reverse().find(c=>!Pt(c)&&c.mergedInto!==void 0&&c.writes.includes(e)),d=s?.mergedInto!==void 0?a.graph.getNode(s.mergedInto):void 0;return(0,y.jsxs)("section",{"data-testid":"record-archived",style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:12,padding:"12px 16px",border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,y.jsxs)("p",{style:{margin:0,flex:"1 1 16rem"},children:[(0,y.jsx)("strong",{children:"Archived."})," Kept with its ties and history, and out of lists, counts and rules.",d?(0,y.jsxs)(y.Fragment,{children:[" ","Merged into ",(0,y.jsx)($,{to:J(a.schema,d.kind,d.id),style:q,children:ce(a.schema.tryDefinition(d.kind),d)}),"."]}):null]}),o?(0,y.jsx)("button",{type:"button",style:Oe,"data-testid":"bring-it-back",onClick:()=>a.apply(r,i?{author:i}:{}),children:"Bring it back"}):null]})}var P=D(_(),1),oo=(0,V.lazy)(()=>import("./chunk.MGNP4LAM.js").then(t=>({default:t.DraftPage}))),so={kind:"human"};function lo({list:t,store:e}){let n=new Set(t.members.map(o=>o.kind)),a=t.total-t.members.length,i=n.size===1?[...n][0]:void 0;if(!i)return(0,P.jsx)("p",{className:"graview-spec-text graview-spec-more",children:`and ${a} more`});let r=Ze(e.schema,i).toLowerCase();return(0,P.jsx)("p",{className:"graview-spec-text graview-spec-more",children:(0,P.jsx)($,{to:`/${X(e.schema,i)}`,className:"graview-spec-link graview-spec-see-all","data-testid":"see-all",children:t.total===e.graph.nodesOfKind(i).length?`See all ${ct(t.total)} ${r}`:`${ct(a)} more \xB7 all ${r}`})})}function co({context:t,children:e}){let n=Re(),a=t.store.schema,i=(0,V.useMemo)(()=>({href:r=>J(a,r.kind,r.id),go:r=>n(J(a,r.kind,r.id)),more:r=>(0,P.jsx)(lo,{list:r,store:t.store})}),[a,n,t.store]);return(0,P.jsx)($t.Provider,{value:i,children:(0,P.jsx)(yr.Provider,{value:(t.titleLevel??(t.framed&&!t.barAbove?1:2))-1,children:e})})}function po({steering:t}){let e=ue(),n=Re(),a=`${e.pathname}${e.search}`;return(0,V.useLayoutEffect)(()=>t.at(a),[a,t]),(0,V.useLayoutEffect)(()=>{let i=o=>{o!==a&&n(o)};t.go.current=i;let r=t.pending?.current;return r!==void 0&&(t.pending.current=void 0,i(r)),()=>{t.go.current===i&&(t.go.current=void 0)}},[a,n,t]),null}function uo({context:t,to:e}){let{pathname:n}=ue(),a=fe(),i=(e??a)?.sayWhere,r=go(t,n);return(0,V.useEffect)(()=>(i?.(r),()=>i?.(null)),[i,r]),null}function go(t,e){let[n="",a,i]=e.split("/").filter(Boolean).map(o=>{try{return decodeURIComponent(o)}catch{return o}});if(i!==void 0)return"#";if(n==="places"&&a!==void 0){if(a===sn)return"#overview=1";let o=t.views?.places().find(s=>s.as===a);return o?`#focus=${encodeURIComponent(Me(o.kind))}&view=${encodeURIComponent(o.as)}`:"#"}let r=Ce(t.store.schema,n);return r?`#focus=${encodeURIComponent(a??Me(r))}`:"#"}function mo({onNavigate:t,path:e}){let n=ue(),a=wn(),i=Re(),r=n.hash&&!n.hash.includes("=")?n.hash:"",o=`${n.pathname}${n.search}${r}`,s=(0,V.useRef)(t);s.current=t;let d=(0,V.useRef)(null);(0,V.useEffect)(()=>{let p=d.current;d.current=o,p!==null&&(o===p&&a!=="PUSH"||s.current?.(o,a==="POP"?"pop":a==="REPLACE"?"replace":"push"))},[n.key]);let c=(0,V.useRef)(e);return(0,V.useEffect)(()=>{e===void 0||e===c.current||(c.current=e,e!==o&&i(e))},[e]),null}function oi({context:t,registry:e,page:n}){let a=De(),i=Ce(t.store.schema,a.slug??""),r=n==="list"?On:Dn,s=(i?e?.lookup(i,n):void 0)??r;return(0,P.jsx)(s,{context:t})}function fo({context:t,registry:e,children:n}){let a=(0,V.useRef)(null);return Aa(a),(0,P.jsx)("div",{ref:a,"data-graview-face":"pages",style:{display:"contents"},children:(0,P.jsx)(_r,{context:t,registry:e,root:a,children:(0,P.jsx)(Yr,{context:t,root:a,children:n})})})}function yo(t){return t instanceof HTMLElement?t.isContentEditable||t.tagName==="TEXTAREA"||t.tagName==="SELECT"?!0:t.tagName==="INPUT"&&!["button","submit","reset","checkbox","radio","image","file","color","range"].includes(t.type):!1}function ho(){let{pathname:t}=ue(),e=wn(),n=(0,V.useRef)(null);(0,V.useLayoutEffect)(()=>{if(e!=="POP"){for(let r=n.current?.parentElement;r;r=r.parentElement){let{overflowY:o}=getComputedStyle(r);if((o==="auto"||o==="scroll")&&r.scrollHeight>r.clientHeight){r.scrollTop=0;return}}window.scrollTo(0,0)}},[t]);let a=(0,V.useRef)(t),i=(0,V.useRef)(!1);return(0,V.useEffect)(()=>{if(!i.current&&t===a.current)return;i.current=!0;let r=document.activeElement;if(yo(r))return;let o=n.current?.closest("main")??document.querySelector("main"),d=n.current?.closest("[data-graview-face]")?.querySelector("[data-graview-page-title]")??o?.querySelector("h1, h2")??null??o??null;d&&(d.hasAttribute("tabindex")||d.setAttribute("tabindex","-1"),d.focus({preventScroll:!0}))},[t]),(0,P.jsx)("span",{ref:n,hidden:!0,"data-graview-scroll-reset":""})}function wo({context:t,children:e}){let n=Re(),a=(0,V.useMemo)(()=>({record:(i,r)=>{let o=t.store.graph.getNode(i);o&&n(ft(J(t.store.schema,o.kind,i),{section:r?.section}))},place:(i,r)=>{let o=t.views?.places().find(s=>s.as===i);o&&n(ft(ve(t,o),r))},list:(i,r)=>{t.store.schema.tryDefinition(i)&&n(ft(`/${X(t.store.schema,i)}`,r))}}),[t,n]);return(0,P.jsx)(xa.Provider,{value:a,children:e})}function vo(){let{pathname:t,search:e,hash:n}=ue();return(0,V.useEffect)(()=>{let a=decodeURIComponent(n.replace(/^#/,""));if(!(!a||a.includes("=")))return qr(a)},[t,e,n]),null}function bo({context:t,Home:e}){let n=ue(),a=t.views,i=n.key==="default"&&!(a&&ka(a));(0,V.useEffect)(()=>{a&&Sa(a)},[a]);let r=i?pa(t.views?.arrangement?.()?.first,t.store.schema,t.views?.places()??[]):void 0,o=r?.to==="place"?ve(t,r.place):r?.to==="kind"?`/${X(t.store.schema,r.kind)}`:void 0;return o?(0,P.jsx)(vn,{to:o,replace:!0}):(0,P.jsx)(e,{context:t})}function si({context:t,registry:e}){let n=e?.lookupSurface("shell"),a=n!==void 0,i=a&&(e?.without().has("bar")??!1),r=a&&!i&&!t.embedded?{...t,barAbove:!0}:t,o=w=>n===void 0?(0,P.jsx)(Ht,{context:t,children:w}):i?(0,P.jsx)(n,{context:t,children:w}):(0,P.jsx)(Ht,{context:t,children:(0,P.jsx)(n,{context:r,children:w})}),s=e?.lookupSurface("home")??Nn,d=e?.lookupSurface("problems")??Fn,c=a?{...r,framed:!0}:t,[p,g]=(0,V.useState)(null),f=(0,V.useMemo)(()=>({onFind:g,find:!(e?.without().has("find")??!1),places:!(e?.without().has("places")??!1)}),[e]),u=(0,P.jsx)(fo,{context:t,registry:e,children:(0,P.jsx)(wo,{context:t,children:o((0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Wa,{face:"pages"}),(0,P.jsxs)(co,{context:c,children:[(0,P.jsx)(ho,{}),(0,P.jsx)(vo,{}),(0,P.jsxs)(Nr,{children:[(e?.routes()??[]).map(({path:w,component:W})=>(0,P.jsx)(Se,{path:w,element:(0,P.jsx)(W,{context:c})},w)),(0,P.jsx)(Se,{path:"/",element:(0,P.jsx)(bo,{context:c,Home:s})}),(0,P.jsx)(Se,{path:"/problems",element:(0,P.jsx)(d,{context:c})}),(0,P.jsx)(Se,{path:"/~draft",element:(0,P.jsx)(V.Suspense,{fallback:null,children:(0,P.jsx)(oo,{context:c})})}),(0,P.jsx)(Se,{path:"/search",element:(0,P.jsx)($n,{context:c})}),(0,P.jsx)(Se,{path:"/map",element:(0,P.jsx)(En,{context:c})}),(0,P.jsx)(Se,{path:"/places",element:(0,P.jsx)(Ln,{context:c})}),xe(c).some(w=>w.as===sn)?null:(0,P.jsx)(Se,{path:ca,element:(0,P.jsx)(vn,{to:"/",replace:!0})}),(0,P.jsx)(Se,{path:"/places/:as",element:(0,P.jsx)(Tn,{context:c})}),(0,P.jsx)(Se,{path:"/:slug",element:(0,P.jsx)(oi,{context:c,registry:e,page:"list"})}),(0,P.jsx)(Se,{path:"/:slug/:id",element:(0,P.jsx)(oi,{context:c,registry:e,page:"record"})})]})]})]}))})});return t.embedded||!a||i?u:(0,P.jsx)(Fr.Provider,{value:f,children:(0,P.jsx)(ja.Provider,{value:p,children:u})})}var ko=()=>typeof document>"u"?null:document.body;function So({context:t,registry:e,basename:n,initialPath:a,onNavigate:i,path:r,steering:o,firstLook:s}){let[d,c]=(0,V.useState)(void 0),p=d!==void 0&&d.from===t.principal?{...t,principal:d.seat}:t;(0,V.useState)(()=>p.views?wr(p.views,p.store.schema,pn(p.brand,p.store.schema)):void 0);let g=fe();Xn({reader:p.locale??g?.locale,app:p.brand?.locale??p.app?.brand?.locale});let f=p.principal??so,u=ha(p.store,f,p.history),W=(u.past&&u.live===p.store?u.past.store:p.store).seenBy(f),v=W===p.store?p:{...p,store:W};wa(p.store,p.principal);let x=(0,P.jsxs)(P.Fragment,{children:[i||r!==void 0?(0,P.jsx)(mo,{onNavigate:i,path:r}):null,o?(0,P.jsx)(po,{steering:o}):null,v.presence||g?(0,P.jsx)(uo,{context:v,to:g}):null,(0,P.jsx)(si,{context:v,...e?{registry:e}:{}}),s?(0,P.jsx)(vr,{firstLook:s,root:ko,app:pn(p.brand,p.store.schema)}):null]}),H=v.views?(0,P.jsxs)(va,{store:v.store,views:v.views,...v.principal?{principal:v.principal}:{},...v.brand?{brand:v.brand}:{},...v.locale?{locale:v.locale}:{},...v.settings?{settings:v.settings}:{},...v.presence&&!g?{presence:v.presence}:{},...v.people?{people:v.people}:{},...v.seats?{seats:v.seats}:{},onSeat:j=>g?g.takeSeat(j):c({from:t.principal,seat:j}),...v.onKeepLens?{onKeepLens:v.onKeepLens}:{},...v.ai?{ai:v.ai}:{},resolveApp:v.resolveApp??g?.resolveApp,linkedRecords:v.linkedRecords??g?.linkedRecords,...v.app?{app:v.app}:{},...v.menuSections?{menuSections:v.menuSections}:{},children:[x,(0,P.jsx)(Ur,{context:v})]}):x,N=(0,P.jsx)(ya.Provider,{value:u,children:H}),U=v.files?(0,P.jsx)(fa.Provider,{value:v.files,children:N}):N;if(a!==void 0){let j=n===void 0?a:`${n.replace(/\/$/,"")}${a}`;return(0,P.jsx)(Er,{initialEntries:[j],...n===void 0?{}:{basename:n},children:U})}return(0,P.jsx)($r,{...n===void 0?{}:{basename:n},children:U})}export{Ai as a,So as b};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{G as H,R as k,a as C,ya as K}from"./chunk.GFF2FB2J.js";import{b as m}from"./chunk.AJZBJBMO.js";var n=m(H(),1),N=450,_=10,O=t=>t instanceof HTMLInputElement?t.dataset.graviewChooseBox??void 0:void 0,G={ArrowDown:1,ArrowRight:1,ArrowUp:-1,ArrowLeft:-1,Home:-1/0,End:1/0},T=t=>t instanceof Element?t.closest("[data-graview-choose]"):null,U=t=>t instanceof HTMLElement&&(t.isContentEditable||t instanceof HTMLInputElement&&t.type!=="checkbox"||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement);function $(t){let[i,g]=(0,n.useState)(()=>new Set),l=(0,n.useRef)(null),b=(0,n.useRef)(null),[x,P]=(0,n.useState)(null),R=x!==null&&t.includes(x)?x:t[0],S=(0,n.useMemo)(()=>t.filter(e=>i.has(e)),[t,i]),E=(0,n.useMemo)(()=>new Set(t),[t]);(0,n.useEffect)(()=>{[...i].some(e=>!E.has(e))&&g(e=>new Set([...e].filter(o=>E.has(o))))},[E,i]);let u=(0,n.useCallback)((e,o=!1)=>{let r=l.current;g(s=>{let a=new Set(s),f=r===null?-1:t.indexOf(r),y=t.indexOf(e);if(o&&f>=0&&y>=0){let v=s.has(r);for(let p of t.slice(Math.min(f,y),Math.max(f,y)+1))v?a.add(p):a.delete(p)}else a.has(e)?a.delete(e):a.add(e);return a}),l.current=e},[t]),L=(0,n.useCallback)(e=>g(new Set(e)),[]),A=(0,n.useCallback)(()=>{l.current=null,g(new Set)},[]),c=(0,n.useRef)(null),h=(0,n.useRef)(!1),M=S.length>0,d=()=>{c.current&&clearTimeout(c.current.timer),c.current=null};(0,n.useEffect)(()=>d,[]);let B={ref:b,onKeyDown:e=>{if(U(e.target))return;let o=O(e.target),r=G[e.key];if(o!==void 0&&r!==void 0&&!e.metaKey&&!e.ctrlKey&&!e.altKey){let s=t.indexOf(o),a=t[Math.max(0,Math.min(t.length-1,s+(Number.isFinite(r)?r:r>0?t.length:-t.length)))];if(e.preventDefault(),e.stopPropagation(),a===void 0||a===o)return;if(e.shiftKey){let f=l.current!==null&&t.includes(l.current)?l.current:o,[y,v]=[t.indexOf(f),t.indexOf(a)].sort((p,F)=>p-F);g(p=>new Set([...p,...t.slice(y,v+1)])),l.current=f}P(a),b.current?.querySelector(`[data-graview-choose-box="${CSS.escape(a)}"]`)?.focus();return}if((e.metaKey||e.ctrlKey)&&!e.altKey&&e.key.toLowerCase()==="a"){e.preventDefault(),e.stopPropagation(),L(t);return}if(e.key===" "&&!e.metaKey&&!e.ctrlKey){let s=T(e.target),a=e.target instanceof HTMLButtonElement||e.target instanceof HTMLInputElement&&e.target.type==="checkbox";if(!s||a)return;e.preventDefault(),u(s.dataset.graviewChoose,e.shiftKey)}},onFocus:e=>{let o=O(e.target);o!==void 0&&P(o)},onPointerDown:e=>{if(h.current=!1,e.pointerType==="mouse"||e.button>0)return;let o=T(e.target);if(!o||e.target instanceof HTMLInputElement&&e.target.type==="checkbox")return;let r=o.dataset.graviewChoose;d(),c.current={id:r,x:e.clientX,y:e.clientY,timer:setTimeout(()=>{c.current=null,h.current=!0,u(r)},N)}},onPointerMove:e=>{let o=c.current;o&&Math.hypot(e.clientX-o.x,e.clientY-o.y)>_&&d()},onPointerUp:d,onPointerCancel:d,onClickCapture:e=>{let o=T(e.target);if(!o||e.target instanceof HTMLInputElement&&e.target.type==="checkbox"&&e.target.hasAttribute("data-graview-choose-box"))return;if(h.current){h.current=!1,e.preventDefault(),e.stopPropagation();return}let s=o.dataset.graviewChoose;if(e.shiftKey&&(M||l.current!==null)){e.preventDefault(),e.stopPropagation(),u(s,!0);return}M&&matchMedia?.("(pointer: coarse)").matches&&(e.preventDefault(),e.stopPropagation(),u(s))},onContextMenu:e=>{(h.current||c.current)&&(e.preventDefault(),e.stopPropagation())},...M?{"data-graview-choosing":""}:{}},j=(0,n.useCallback)(e=>i.has(e),[i]);return{chosen:S,has:j,toggle:u,choose:L,clear:A,listProps:B,boxProps:(e,o)=>({type:"checkbox",className:"graview-choose-box","data-graview-choose-box":e,"aria-label":`Choose ${o}`,tabIndex:e===R?0:-1,checked:i.has(e),onChange:()=>{},onClick:r=>{r.stopPropagation(),u(e,r.shiftKey)}}),list:b}}var q=`
|
|
2
|
+
.graview-choose-box{width:24px;height:24px;margin:0;accent-color:var(--graview-accent);cursor:pointer;opacity:0}
|
|
3
|
+
[data-graview-choose]:hover .graview-choose-box,[data-graview-choose]:focus-within .graview-choose-box,.graview-choose-box:focus-visible,.graview-choose-box:checked,[data-graview-choosing] .graview-choose-box{opacity:1}
|
|
4
|
+
[data-graview-choose]{-webkit-touch-callout:none}
|
|
5
|
+
[data-graview-choosing] [data-graview-choose]{-webkit-user-select:none;user-select:none}
|
|
6
|
+
`;var I=m(H(),1),w=m(k(),1),D=K(C(()=>import("./chunk.D3IECJ2S.js"))),X=D.part((t,i)=>(0,w.jsx)(t.SeveralBar,{...i}),{what:"The selection bar"});function Q(t){return t.chosen.length===0?null:(0,w.jsx)(I.Suspense,{fallback:null,children:(0,w.jsx)(X,{...t})})}var W=()=>D.prefetch();export{$ as a,q as b,Q as c,W as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as y}from"./chunk.
|
|
1
|
+
import{b as y}from"./chunk.VSZQXB4Q.js";import"./chunk.L4DECHXR.js";import{G as w,R as c}from"./chunk.GFF2FB2J.js";import"./chunk.6V2RG5JG.js";import{b as l}from"./chunk.AJZBJBMO.js";var r=l(w(),1);var t=l(c(),1);function x({field:d,label:p,value:m,markdown:b,onSave:n,onCancel:u}){let[a,v]=(0,r.useState)(m),[i,h]=(0,r.useState)(!1),o=(0,r.useRef)(null);return(0,r.useEffect)(()=>o.current?.focus(),[i]),(0,r.useLayoutEffect)(()=>{let e=o.current;if(!e||i||typeof CSS<"u"&&CSS.supports?.("field-sizing","content"))return;let f=()=>{e.style.height="auto";let g=getComputedStyle(e);e.style.height=`${e.scrollHeight+parseFloat(g.borderTopWidth)+parseFloat(g.borderBottomWidth)}px`};f();let S=requestAnimationFrame(f);return()=>cancelAnimationFrame(S)},[a,i]),(0,t.jsxs)("form",{style:{display:"grid",gap:8,minWidth:0},onSubmit:e=>{e.preventDefault(),n(a,!1)},children:[i?(0,t.jsx)("div",{"data-graview-preview":d,"aria-label":`${p}, as it will read`,role:"region",style:C,children:(0,t.jsx)(y,{text:a,markdown:!0})}):(0,t.jsx)("textarea",{ref:o,"aria-label":p,"data-graview-field":d,value:a,rows:3,onChange:e=>v(e.target.value),onKeyDown:e=>{e.key==="Escape"?(e.preventDefault(),u()):e.key==="Enter"&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),n(a,!1))},onBlur:e=>{e.relatedTarget instanceof Node&&e.currentTarget.form?.contains(e.relatedTarget)||n(a,!0)},style:E}),(0,t.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:8},children:[(0,t.jsx)("button",{type:"submit",style:s,children:"Save"}),(0,t.jsx)("button",{type:"button",onClick:u,style:s,children:"Cancel"}),b?(0,t.jsx)("button",{type:"button","aria-pressed":i,onClick:()=>h(!i),style:s,children:i?"Write":"Preview"}):null,(0,t.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:"Ctrl or \u2318 Enter saves \xB7 Esc puts it back"})]})]})}var C={minHeight:"7.5em",padding:"8px 10px",border:"1px dashed var(--graview-edge-bright)",borderRadius:6,lineHeight:1.6,minWidth:0},s={font:"inherit",fontSize:"0.8125rem",minHeight:28,padding:"2px 12px"},E={font:"inherit",lineHeight:1.5,width:"100%",boxSizing:"border-box",minHeight:"7.5em",padding:"8px 10px",resize:"vertical",fieldSizing:"content",color:"var(--graview-ink)",background:"var(--graview-panel, transparent)",border:"1px solid var(--graview-edge-bright)",borderRadius:6};export{x as default};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import{Cc as kn,H as gn,Jb as vn,Ka as wn,Qc as Pn,Vc as Le,Wc as rt,dc as bn,oc as xn,rc as En,ta as hn,xa as ot,za as Sn}from"./chunk.6V2RG5JG.js";import{a as Ce,b as L}from"./chunk.AJZBJBMO.js";var $n=Ce(v=>{"use strict";var ut=Symbol.for("react.transitional.element"),er=Symbol.for("react.portal"),tr=Symbol.for("react.fragment"),nr=Symbol.for("react.strict_mode"),or=Symbol.for("react.profiler"),rr=Symbol.for("react.consumer"),ir=Symbol.for("react.context"),ar=Symbol.for("react.forward_ref"),sr=Symbol.for("react.suspense"),lr=Symbol.for("react.memo"),jn=Symbol.for("react.lazy"),dr=Symbol.for("react.activity"),In=Symbol.iterator;function ur(e){return e===null||typeof e!="object"?null:(e=In&&e[In]||e["@@iterator"],typeof e=="function"?e:null)}var Gn={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Wn=Object.assign,Fn={};function fe(e,t,n){this.props=e,this.context=t,this.refs=Fn,this.updater=n||Gn}fe.prototype.isReactComponent={};fe.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")};fe.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Kn(){}Kn.prototype=fe.prototype;function ct(e,t,n){this.props=e,this.context=t,this.refs=Fn,this.updater=n||Gn}var ft=ct.prototype=new Kn;ft.constructor=ct;Wn(ft,fe.prototype);ft.isPureReactComponent=!0;var Hn=Array.isArray;function dt(){}var A={H:null,A:null,T:null,S:null},Bn=Object.prototype.hasOwnProperty;function pt(e,t,n){var o=n.ref;return{$$typeof:ut,type:e,key:t,ref:o!==void 0?o:null,props:n}}function cr(e,t){return pt(e.type,t,e.props)}function yt(e){return typeof e=="object"&&e!==null&&e.$$typeof===ut}function fr(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Nn=/\/+/g;function lt(e,t){return typeof e=="object"&&e!==null&&e.key!=null?fr(""+e.key):t.toString(36)}function pr(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(dt,dt):(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 ce(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 ut:case er:a=!0;break;case jn:return a=e._init,ce(a(e._payload),t,n,o,r)}}if(a)return r=r(e),a=o===""?"."+lt(e,0):o,Hn(r)?(n="",a!=null&&(n=a.replace(Nn,"$&/")+"/"),ce(r,t,n,"",function(u){return u})):r!=null&&(yt(r)&&(r=cr(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(Nn,"$&/")+"/")+a)),t.push(r)),1;a=0;var d=o===""?".":o+":";if(Hn(e))for(var s=0;s<e.length;s++)o=e[s],i=d+lt(o,s),a+=ce(o,t,n,i,r);else if(s=ur(e),typeof s=="function")for(e=s.call(e),s=0;!(o=e.next()).done;)o=o.value,i=d+lt(o,s++),a+=ce(o,t,n,i,r);else if(i==="object"){if(typeof e.then=="function")return ce(pr(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 Fe(e,t,n){if(e==null)return e;var o=[],r=0;return ce(e,o,"","",function(i){return t.call(n,i,r++)}),o}function yr(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 Dn=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)},mr={map:Fe,forEach:function(e,t,n){Fe(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Fe(e,function(){t++}),t},toArray:function(e){return Fe(e,function(t){return t})||[]},only:function(e){if(!yt(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};v.Activity=dr;v.Children=mr;v.Component=fe;v.Fragment=tr;v.Profiler=or;v.PureComponent=ct;v.StrictMode=nr;v.Suspense=sr;v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A;v.__COMPILER_RUNTIME={__proto__:null,c:function(e){return A.H.useMemoCache(e)}};v.cache=function(e){return function(){return e.apply(null,arguments)}};v.cacheSignal=function(){return null};v.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var o=Wn({},e.props),r=e.key;if(t!=null)for(i in t.key!==void 0&&(r=""+t.key),t)!Bn.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 pt(e.type,r,o)};v.createContext=function(e){return e={$$typeof:ir,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:rr,_context:e},e};v.createElement=function(e,t,n){var o,r={},i=null;if(t!=null)for(o in t.key!==void 0&&(i=""+t.key),t)Bn.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 pt(e,i,r)};v.createRef=function(){return{current:null}};v.forwardRef=function(e){return{$$typeof:ar,render:e}};v.isValidElement=yt;v.lazy=function(e){return{$$typeof:jn,_payload:{_status:-1,_result:e},_init:yr}};v.memo=function(e,t){return{$$typeof:lr,type:e,compare:t===void 0?null:t}};v.startTransition=function(e){var t=A.T,n={};A.T=n;try{var o=e(),r=A.S;r!==null&&r(n,o),typeof o=="object"&&o!==null&&typeof o.then=="function"&&o.then(dt,Dn)}catch(i){Dn(i)}finally{t!==null&&n.types!==null&&(t.types=n.types),A.T=t}};v.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()};v.use=function(e){return A.H.use(e)};v.useActionState=function(e,t,n){return A.H.useActionState(e,t,n)};v.useCallback=function(e,t){return A.H.useCallback(e,t)};v.useContext=function(e){return A.H.useContext(e)};v.useDebugValue=function(){};v.useDeferredValue=function(e,t){return A.H.useDeferredValue(e,t)};v.useEffect=function(e,t){return A.H.useEffect(e,t)};v.useEffectEvent=function(e){return A.H.useEffectEvent(e)};v.useId=function(){return A.H.useId()};v.useImperativeHandle=function(e,t,n){return A.H.useImperativeHandle(e,t,n)};v.useInsertionEffect=function(e,t){return A.H.useInsertionEffect(e,t)};v.useLayoutEffect=function(e,t){return A.H.useLayoutEffect(e,t)};v.useMemo=function(e,t){return A.H.useMemo(e,t)};v.useOptimistic=function(e,t){return A.H.useOptimistic(e,t)};v.useReducer=function(e,t,n){return A.H.useReducer(e,t,n)};v.useRef=function(e){return A.H.useRef(e)};v.useState=function(e){return A.H.useState(e)};v.useSyncExternalStore=function(e,t,n){return A.H.useSyncExternalStore(e,t,n)};v.useTransition=function(){return A.H.useTransition()};v.version="19.2.8"});var j=Ce((Hi,zn)=>{"use strict";zn.exports=$n()});var Zn=Ce($e=>{"use strict";var kr=Symbol.for("react.transitional.element"),Pr=Symbol.for("react.fragment");function Jn(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:kr,type:e,key:o,ref:t!==void 0?t:null,props:n}}$e.Fragment=Pr;$e.jsx=Jn;$e.jsxs=Jn});var Te=Ce((Ki,Qn)=>{"use strict";Qn.exports=Zn()});function An(e){let t,n=!1,o,r,i=0;return()=>{if(n)return Promise.resolve(t);if(o)return o;let a=i>0&&r!==void 0?Yo(r):e();i+=1;let d=a.then(s=>(t=s,n=!0,o=void 0,s),s=>{throw o=void 0,r??=Xo(s),s});return o=d,d}}var Rn=0;function Yo(e){return Rn+=1,import(`${e}${e.includes("?")?"&":"?"}retry=${Rn}`)}function Xo(e,t=import.meta.url){let n=e instanceof Error?e.message:typeof e=="string"?e:"",o=/^(?:Failed to fetch|error loading) dynamically imported module: ([a-z]+:\/\/[^\s"'<>]+)/.exec(n)?.[1]?.replace(/[.,;:)\]]+$/,""),r=i=>i.split("/",3).join("/");return o&&r(o)===r(t)?o:void 0}var le={focusId:null,relation:null,expanded:[],pins:{}},Ie=e=>{let t=Number(e);return Number.isFinite(t)?t:null};function Q(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}`,`${He(r.x)},${He(r.y)}`)}e.pan&&(e.pan.x!==0||e.pan.y!==0)&&t.set("pan",`${He(e.pan.x)},${He(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 Jo(e){return e&&e.startsWith("agg:")?`aggregate:${e.slice(4)}`:e}function Ne(e){let t=e.includes("#")?e.slice(e.indexOf("#")+1):e,n=new URLSearchParams(t),o=Object.create(null);for(let[S,p]of n){if(!S.startsWith("pin."))continue;let[g,y]=p.split(","),x=g===void 0?null:Ie(g),m=y===void 0?null:Ie(y);x===null||m===null||(o[S.slice(4)]={x,y:m})}let r=Object.create(null);for(let[S,p]of n)!S.startsWith("in.")||p.length===0||(r[S.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:Ie(a[0]),s=a[1]===void 0?null:Ie(a[1]),u=(n.get("sel")??"").split(",").filter(S=>S.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:Jo(n.get("focus")),relation:n.get("relation"),expanded:(n.get("expand")??"").split(",").filter(S=>S.length>0&&(f||!S.startsWith("kind:"))).sort(),pins:o}}function Pi(e){let t=Ne(e);return Q(t)==="#"?{...t,overview:!0}:t}function Ri(e){let t=Q(e);return t==="#overview=1"?"":t}function He(e){return Math.round(e*100)/100}function Mn(e,t){return Q(e)===Q(t)}var Tn="edge:";function On(e){if(!e.startsWith(Tn))return null;let t=e.slice(Tn.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 it(e){let{pan:t,...n}=e;return{...n,pins:{}}}function z(e,t){if(t===e.focusId)return{...e,focusId:t};let n=it(e);return{...n.within?.q!==void 0?oe(n,"q",null):n,focusId:t}}function Vn(e,t){return{...e,relation:t}}function oe(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 de(e,t){if(t!==e.overview&&(e=it(e)),!t){let n=e.expanded.filter(o=>!o.startsWith("kind:"));return{...e,overview:!1,expanded:n}}return{...e,overview:t}}function De(e,t){if(t.length===0){let{selection:n,...o}=e;return o}return{...e,selection:[...t]}}function Re(e,t){if(t!==(e.zoom===!0)&&(e=it(e)),!t){let{zoom:n,...o}=e;return o}return{...e,zoom:!0}}function je(e,t){let n=new Set(e.expanded);return n.has(t)?n.delete(t):n.add(t),{...e,expanded:[...n].sort()}}var We="aggregate:",Ge="kind:";function at(e){return`${Ge}${e}`}function ue(e){return e.startsWith(Ge)?e.slice(Ge.length):null}var Mi="kinds:beyond";function Zo(e){let t=ue(e);return t?[t]:re(e)}function ee(...e){return`${We}${[...e].sort().join("+")}`}function _n(e){return e.startsWith(We)}function re(e){return!_n(e)||e.includes("|")?[]:e.slice(We.length).split("+").filter(Boolean)}function Cn(e,t,n={}){let o=ue(t);if(o!==null&&e.overview&&n.ownPicture!==!0)return je(e,t);let r=o!==null?ee(o):t;if(e.zoom&&e.focusId===r&&!(o!==null&&n.carry))return Re(e,!1);if(o!==null&&n.carry){let i=de({...z(e,r),relation:null},!1);return oe(Re(i,!0),"q",n.carry)}return Re({...z(e,r),relation:null},!0)}function Qo(e,t,n){return oe(de(z(e,ee(t)),!1),"view",n)}function Oi(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Ln="aggregate:";function st(e){return e.startsWith(Ln)&&e.includes("|")}var mt=L(j(),1),gr={turns:[],outcomes:new Map,busy:!1,open:!1,side:"left",pending:null,drawn:0,draft:null,draftNote:null},qn=e=>`graview:seat:${e}`;function hr(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)}:{},...typeof n.open=="boolean"?{open:n.open}:{},...n.side==="left"||n.side==="right"?{side:n.side}:{},...n.draft?.drawn?{draft:n.draft}:{}}}catch{return{}}}function Sr(e,t){if(e)try{sessionStorage.setItem(e,JSON.stringify({turns:t.turns.slice(-40),outcomes:[...t.outcomes],open:t.open,side:t.side,draft:t.draft}))}catch{}}function gt(e){let t=e===null?null:qn(e),n={...gr,...hr(t)},o=new Set,r=(i,a=!0)=>{n=i,a&&Sr(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),setOpen:i=>{n.open!==i&&r({...n,open:i})},setSide:i=>{n.side!==i&&r({...n,side:i})},ask:i=>r({...n,open:!0,pending:i.trim()||null}),takePending(){let i=n.pending;return i!==null&&r({...n,pending:null},!1),i},drawn(){return r({...n,drawn:n.drawn+1},!1),()=>r({...n,drawn:Math.max(0,n.drawn-1)},!1)},setDraft:(i,a=null)=>r({...n,draft:i,draftNote:a})}}function wr(e){let t=()=>e.get().drawn>0;return(0,mt.useSyncExternalStore)(e.subscribe,t,t)}function vr(e){return(0,mt.useSyncExternalStore)(e.subscribe,e.get,e.get)}function Un(e){return e?.closest?.("[data-graview-pick]")?.getAttribute("data-graview-pick")??null}var Ke=L(j(),1),Be=(0,Ke.createContext)(void 0),br=()=>(0,Ke.useContext)(Be);var V=L(j(),1),Ae=(0,V.createContext)(null);function Xn(){return(0,V.useContext)(Ae)}function xr(e,t){let n=Xn(),o=(0,V.useMemo)(()=>n?n.live.seenBy(t):e,[n,e,t]),r=(0,V.useRef)(0),i=(0,V.useCallback)(a=>o.subscribe(()=>{r.current+=1,a()}),[o]);return(0,V.useSyncExternalStore)(i,()=>r.current,()=>0),o}var Er=An(()=>import("./chunk.SHPXD6FC.js")),Yn;function ht(e,t,n){let o=(0,V.useContext)(Ae),r=o!==null&&o.owns(e,t),[i,a]=(0,V.useState)(null),[d,s]=(0,V.useState)(Yn);(0,V.useEffect)(()=>{if(d||r||i===null)return;let y=!0;return Er().then(x=>{Yn=x,y&&s(x)},()=>{}),()=>{y=!1}},[d,r,i]);let u=(0,V.useMemo)(()=>{if(r||i===null||i>=e.log.length||!d)return null;try{let y=d.pastAt(e,i,n);return{seq:i,at:y.past?.at,store:y}}catch{return null}},[r,e,i,n,d]),f=(0,V.useCallback)(y=>a(y===null?null:y>=e.log.length?Number.POSITIVE_INFINITY:y),[e]),S=(0,V.useCallback)((y,x)=>[e,u?.store].some(m=>m!==void 0&&(m===y||m.seenBy(x)===y)),[e,u]),p=i!==null,g=(0,V.useMemo)(()=>({past:u,open:p,show:f,live:e,host:n,owns:S}),[u,p,f,e,n,S]);return r?o:g}var St={};var Rr="I can answer about what's in this app. Open questions need AI, which isn't on here.",Ar="Answered with AI";var eo=e=>`graview:setting:${e}`;function to(){return localStorage}function no(e,t){try{let n=(t??to()).getItem(eo(e.name));if(n!==null&&e.options.some(o=>o.value===n))return n}catch{}return e.initial}function oo(e,t,n){try{(n??to()).setItem(eo(e.name),t)}catch{}}function ro(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(j(),1);function wt(e){return Le(e)}var Tr=12,Mr=4;function Or(e,t,n){let o=wt(t);return e.get(o)??{participant:o,who:t.id??t.kind,at:null,mode:"docked",since:n,trail:[]}}var ze=(e,t)=>t===null||e[e.length-1]===t?e:[...e,t].slice(-Tr);function io(e,t){let n=e.filter(r=>r.length>0);if(n.length===0)return null;if(n.length<=Mr)return n[0];let o=new Set(n.map(r=>t(r)).filter(r=>r!==void 0));return o.size===1?at([...o][0]):n[0]}function vt(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=Or(e,t.author,t.at),i=a=>o.set(r.participant,{...r,...a,since:t.at});switch(t.type){case"read":{let a=io(t.ids,n);return i({at:a,mode:"reading",trail:ze(r.trail,a)}),o}case"about-to-write":case"write":{let a=io(t.ids,n);return i({at:a,mode:"writing",trail:ze(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:ze(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:ze(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 ao="graview:session";function so(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(ao);if(o)return o;let r=t();return n.setItem(ao,r),r}catch{return t()}}var bt={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"},xt={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"},lo=[bt,xt],_r=800;function uo(e){let{channel:t,store:n,view:o,principal:r,session:i,robots:a,seatWho:d,settingValues:s,setView:u,ttlMs:f=1e4,people:S,seats:p}=e,[g,y]=(0,_.useState)(()=>new Map),[x,m]=(0,_.useState)(null),[b,w]=(0,_.useState)(null),[E,O]=(0,_.useState)(null),W=typeof r.id=="string"&&r.id.length>0,C=W&&(s[bt.name]??bt.initial)==="shared",K=C&&(s[xt.name]??xt.initial)==="shared",T=wt({kind:r.kind,...r.id?{id:r.id}:{},session:i}),I=W?wn(r,{graph:n.graph,schema:n.schema,...p?{seats:p}:{},...S?{people:S}:{}}):"",H=d?a.get(`agent:${d}:${i}`):void 0,D=(0,_.useMemo)(()=>!t||!C?null:{participant:T,kind:r.kind,name:I,...r.onBehalfOf?.id?{onBehalfOf:r.onBehalfOf.id,...r.onBehalfOf.name?{onBehalfOfName:r.onBehalfOf.name}:{}}:{},hue:vn(r.id??"nobody"),stop:E??Q(o),...K?{over:x}:{},...H?{robot:{at:H.at,mode:H.mode}}:{},at:new Date().toISOString()},[t,C,K,T,I,r.id,r.kind,r.onBehalfOf?.id,r.onBehalfOf?.name,o,E,x,H?.at,H?.mode]);(0,_.useEffect)(()=>{if(!t||!D)return;t.here(D);let M=setInterval(()=>t.here({...D,at:new Date().toISOString()}),_r);return()=>clearInterval(M)},[t,D]),(0,_.useEffect)(()=>t?t.onWho(F=>y(rt(new Map,F,Date.now(),f))):void 0,[t,f]);let Se=g.size>0;(0,_.useEffect)(()=>{if(!Se)return;let M=setInterval(()=>{y(F=>{let P=rt(F,[],Date.now(),f);return P.size===F.size?F:P})},Math.max(250,Math.min(1e3,f/4)));return()=>clearInterval(M)},[Se,f]),(0,_.useEffect)(()=>{if(!t||typeof window>"u")return;let M=()=>t.leave();return window.addEventListener("pagehide",M),()=>window.removeEventListener("pagehide",M)},[t]),(0,_.useEffect)(()=>{if(!K||typeof document>"u")return;let M=null,F=P=>{let B=Un(P.target);B!==M&&(M=B,m(B))};return document.addEventListener("pointermove",F,{passive:!0}),()=>document.removeEventListener("pointermove",F)},[K]);let ae=(0,_.useRef)(null),X=b?g.get(b)??null:null,J=(0,_.useCallback)(M=>{ae.current=null,w(M)},[]);return(0,_.useEffect)(()=>{if(b){if(!X){w(null);return}X.stop!==ae.current?.stop&&(ae.current={stop:X.stop,at:Date.now()},u(Ne(X.stop)))}},[b,X,u]),(0,_.useEffect)(()=>{let M=ae.current;!b||M===null||Date.now()-M.at<400||Mn(o,Ne(M.stop))||w(null)},[o,b]),(0,_.useEffect)(()=>{if(!b||typeof document>"u")return;let M=F=>{F.key==="Escape"&&w(null)};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[b]),(0,_.useMemo)(()=>({who:g,sharing:D?{participant:T,name:I}:null,following:X,follow:J,sayWhere:O}),[g,D,T,I,X,J])}var U=L(j(),1);function co(e){return Le(e.author)}function Cr(e,t){return e.length>1?"co-edited":t==="rule"?"rule":t==="agent"?"autonomous":"directed"}function fo(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 S=i.get(s),p=S?.participants.includes(co(u))?S.participants:[...S?.participants??[],co(u)];i.set(s,{at:o,manner:Cr(p,u.author.kind),intent:u.intent,wrote:(S?.wrote??!1)||(f.wrote??!1),read:(S?.read??!1)||(f.read??!1),broke:(S?.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 Lr=2600;function po(e,t=Lr){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,S)=>{let p=e.violations(),g=En(e.allInvariants(),s,p).introduces;s=p,a(fo(r.current,S,g.map(y=>({nodeIds:y.nodeIds,message:y.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(fo(r.current,[Ir(s)],[],Date.now(),t))},[t,a]);return{activity:n,noteAttention:d}}function Ir(e){return{id:`attention:${e.intent}`,seq:-1,batch:"attention",author:e.author,intent:e.intent,mutation:null,primitives:[],inverse:[],reads:e.reads,writes:[],at:new Date().toISOString()}}var l=L(j(),1);function yo(){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 qe=L(j(),1),Hr=e=>e.definitions.some(t=>hn(t).size>0);function mo(e,t,n){let[o,r]=(0,qe.useState)(void 0),i=(n.roles??[]).join("\0");return(0,qe.useEffect)(()=>{if(!t||!Hr(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=Sn(t,{kind:n.kind,...n.id===void 0?{}:{id:n.id},...n.roles?{roles:n.roles}:{}},u);return ot(s,f.read),r(f),e.reread(),()=>{a=!1,ot(s,void 0)}},[e,t,n.kind,n.id,i]),o}function go(){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 ie=L(Te(),1),Me=(0,l.createContext)(null),vo=(0,l.createContext)("scene");function Nr({mode:e,children:t}){return(0,ie.jsx)(vo.Provider,{value:e,children:t})}function Dr(){return(0,l.useContext)(vo)}var bo={kind:"human"},jr=[],Gr=[],Wr=[],Et=[];function xo(e,t){let n=(0,l.useId)();(0,l.useEffect)(()=>{if(!globalThis.__graviewWatch)return;let o=t??bo,r=()=>xn(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])}function Fr({store:e,views:t,initialView:n,scheme:o="dark",initialSelection:r,principal:i,seats:a=jr,onSeat:d,people:s=Gr,memory:u,presenceTtlMs:f,app:S,settings:p=S?.settings??Wr,presence:g,brand:y,locale:x,onKeepLens:m,providers:b,ai:w=St,files:E,resolveApp:O,history:W,linkedRecords:C,menuSections:K,view:T,onViewChange:I,children:H}){let D=(0,l.useContext)(Me),Se=K??D?.menuSections,[ae,X]=(0,l.useState)(null),J=ae??i??a[0]?.principal??bo,M=ht(e,J,W),F=M.past&&M.live===e?M.past.store:e,P=(0,l.useMemo)(()=>F.seenBy(J),[F,J]);xo(e,J);let[B]=(0,l.useState)(()=>so(u)),[Dt,Do]=(0,l.useState)(!1),jt=(0,l.useCallback)(()=>Do(!0),[]),ne=(0,l.useMemo)(()=>g?[...p,...lo]:p,[p,g]),[Ze]=(0,l.useState)(()=>n??At(t,e.schema)),[jo,Gt]=(0,l.useState)(()=>De(Ze??le,r??Ze?.selection??[])),we=(0,l.useRef)(Ze??le).current,[Wt,Go]=(0,l.useState)(null),[Ft,Wo]=(0,l.useState)(null),Ve=(0,l.useContext)(Me),[Kt]=(0,l.useState)(()=>Ve?.seatTalk??gt(y?.name??e.schema.kinds.join(","))),Qe=m??Ve?.onKeepLens,et=S??Ve?.app,_e=x??Ve?.locale,Fo=y?.locale??et?.brand?.locale;gn({reader:_e,app:Fo});let Bt=(0,l.useRef)(null),$t=(0,l.useCallback)(c=>{Bt.current=c},[]),zt=(0,l.useCallback)(c=>Bt.current?.whereIs(c)??null,[]),[qt]=(0,l.useState)(()=>yo()),[Ut]=(0,l.useState)(()=>go()),[tt,Ko]=(0,l.useState)(null),[ve,Yt]=(0,l.useState)(()=>new Map),be=(0,l.useRef)(ve);be.current=ve;let xe=(0,l.useRef)(null),nt=(0,l.useCallback)(c=>P.graph.getNode(c)?.kind,[P]),Z=(0,l.useCallback)(c=>{let h=vt(be.current,c,nt);be.current=h,Yt(h),xe.current&&clearTimeout(xe.current),[...h.values()].some(R=>R.mode!=="docked"&&R.mode!=="asking")&&(xe.current=setTimeout(()=>{let R=vt(be.current,{type:"rest",at:Date.now(),holdMs:Rt},nt);be.current=R,Yt(R)},Rt+20))},[nt]),Xt=(0,l.useCallback)(c=>Z({...c,at:c.at??Date.now()}),[Z]),Jt=(0,l.useCallback)(c=>{Ko(c),c&&Z({type:"home",author:{kind:"agent",id:c,session:B},at:Date.now()})},[Z,B]);(0,l.useEffect)(()=>P.subscribe((c,h)=>{for(let k of h)k.author.kind==="agent"&&Z({type:"write",author:k.author,ids:k.writes,at:Date.now()})}),[P,Z]),(0,l.useEffect)(()=>()=>{xe.current&&clearTimeout(xe.current)},[]);let q=(0,l.useMemo)(()=>({...J,session:B}),[J,B]),Zt=mo(P,C,q),Qt=(0,l.useCallback)(c=>{X(c),d?.(c)},[d]),[Ee,Bo]=(0,l.useState)(()=>Object.fromEntries(ne.map(c=>[c.name,no(c,u)])));(0,l.useEffect)(()=>{for(let c of ne)ro(c,Ee[c.name]??c.initial)},[ne,Ee]);let en=(0,l.useCallback)((c,h)=>{let k=ne.find(R=>R.name===c);!k||!k.options.some(R=>R.value===h)||(oo(k,h,u),Bo(R=>({...R,[c]:h})))},[ne,u]),[tn,$o]=(0,l.useState)(null),{activity:nn,noteAttention:on}=po(P),rn=(0,l.useCallback)(c=>{on(c),Z({type:"read",author:c.author,ids:c.reads,at:Date.now()})},[on,Z]),se=(0,l.useCallback)(c=>{if(ue(c)!==null||re(c).length>0||st(c))return!0;let h=On(c);return h?P.graph.allEdges().some(k=>k.kind===h.kind&&k.from===h.from&&k.to===h.to):P.graph.getNode(c)!==void 0},[P]),an=(0,l.useCallback)(c=>{let h=c.selection??Et,k=h.filter(se),R=k.length===h.length?c:De(c,k);return R.focusId!==null&&!se(R.focusId)&&(R=z(R,null)),R},[se]),ke=(0,l.useCallback)(c=>{let h=an(c),k=wo(P,q,h.shown);if(h.focusId!==null&&k.size>0){let R=re(h.focusId),mn=P.graph.getNode(h.focusId);(R.length>0?R.every(Uo=>k.has(Uo)):mn?k.has(mn.kind):!1)&&(h={...h,focusId:null})}if(!h.overview&&h.focusId===null){let R=we.focusId!==null&&!se(we.focusId)?At(t,e.schema)??{...le,overview:!0}:we;R.focusId!==null&&se(R.focusId)?h={...h,focusId:R.focusId}:R.overview===!0&&(h={...h,overview:!0})}return h},[an,se,P,we,q,t,e.schema]),$=ke(T??jo),sn=(0,l.useMemo)(()=>wo(P,q,$.shown),[P,q,$.shown]),ln=(0,l.useMemo)(()=>[...P.modules.administered.entries()].map(([c,h])=>{let k=P.mayAdminister(c,q);return{name:c,...h.description?{description:h.description}:{},kinds:h.kinds??[],canShow:k,shown:k&&($.shown??[]).includes(c)}}),[P,q,$.shown]),Pe=(0,l.useCallback)(c=>{let h=k=>ke(typeof c=="function"?c(k):c);if(T!==void 0){I?.(h(T));return}I&&I(h($)),Gt(k=>h(k))},[$,I,T,ke]);(0,l.useEffect)(()=>{T===void 0&&Gt(c=>{let h=ke(c);return h===c?c:h})},[$,T,ke]);let dn=$.selection??Et,un=(0,l.useCallback)(c=>{Pe(h=>De(h,typeof c=="function"?c(h.selection??Et):c))},[Pe]),{who:cn,following:fn,follow:pn,sayWhere:zo,sharing:yn}=uo({channel:g,store:P,view:$,principal:q,session:B,robots:ve,seatWho:tt,settingValues:Ee,setView:Pe,seats:a,people:s,...f!==void 0?{ttlMs:f}:{}}),qo=(0,l.useMemo)(()=>({store:P,scheme:o,views:t,view:$,setView:Pe,homeView:we,selection:dn,setSelection:un,menuAt:Wt,setMenuAt:Go,whereIs:zt,pointer:qt,motion:Ut,registerScene:$t,robots:ve,noteSeat:Xt,seatWho:tt,registerSeatWho:Jt,actsDoor:Ft,registerActsDoor:Wo,seatTalk:Kt,...u?{memory:u}:{},who:cn,following:fn,follow:pn,sayWhere:zo,sharing:yn,session:B,ai:w,resolveApp:O,linkedRecords:C,menuSections:Se,linkedReads:Zt,movedByHand:Dt,noteMoved:jt,emphasis:tn,setEmphasis:$o,activity:nn,noteAttention:rn,principal:q,seats:a,people:s,takeSeat:Qt,settings:ne,settingValues:Ee,chooseSetting:en,hiddenKinds:sn,administered:ln,...b?{providers:b}:{},...y?{brand:y}:{},...Qe?{onKeepLens:Qe}:{},app:et,..._e?{locale:_e}:{}}),[P,o,t,$,Pe,dn,un,Wt,zt,qt,Ut,$t,ve,Xt,tt,Jt,Ft,Kt,u,cn,fn,pn,yn,B,w,O,C,Se,Zt,Dt,jt,tn,nn,rn,q,a,s,Qt,ne,Ee,en,sn,ln,b,y,Qe,et,_e]);return(0,ie.jsx)(Me.Provider,{value:qo,children:(0,ie.jsx)(Ae.Provider,{value:M,children:(0,ie.jsx)(qr,{children:E?(0,ie.jsx)(Be.Provider,{value:E,children:H}):H})})})}var Eo=(0,l.createContext)(null),kt,Pt=new Set,Kr=e=>(Pt.add(e),()=>void Pt.delete(e)),ho=()=>kt;function Br(e){if(!kt){kt=e;for(let t of[...Pt])t()}}var $r=300;function zr(e){let t=0;return async(n,o)=>{let r=++t;return await new Promise(i=>setTimeout(i,$r)),r===t?e(n,o):[]}}function qr({children:e}){let{store:t,view:n,views:o,principal:r,hiddenKinds:i,selection:a,ai:d}=te(),s=Ue(),u=n.q,f=n.focusId,S=!!(u&&u.trim().length>0),p=(0,l.useSyncExternalStore)(Kr,ho,ho),g=(0,l.useMemo)(()=>S&&p?{flagged:new Set(t.violations().flatMap(E=>E.nodeIds)),touched:p.touchWeights(t.log.all())}:null,[t,s,S,p]),y=f?t.graph.getNode(f)?.kind??ue(f)??(re(f).length===1?re(f)[0]:void 0):void 0,x=(0,l.useMemo)(()=>d.near&&zr(d.near),[d.near]),m=(0,l.useMemo)(()=>!u||!g||!p?null:p.search(t,u,{...y?{inKind:y}:{},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:x}),[t,u,r,o,i,a,f,y,g,x]),[b,w]=(0,l.useState)();return(0,l.useEffect)(()=>void m?.later?.then(E=>w([m,E])),[m]),(0,ie.jsx)(Eo.Provider,{value:b?.[0]===m?b[1]:m,children:e})}var So=new WeakMap;function xa(e){let t=So.get(e);return t||So.set(e,t=new Set(e.matched)),t}function Ur(){return(0,l.useContext)(Eo)}function te(){let e=(0,l.useContext)(Me);if(!e)throw new Error("useGraview must be used inside a <GraviewProvider>.");return e}function Tt(){return(0,l.useContext)(Me)??null}function Ue(){let{store:e}=te(),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 Yr(e){let{store:t}=te(),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 wo(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 Rt=2600;var ko=new WeakSet,Xr=e=>ko.has(e),Jr=e=>void ko.add(e);function At(e,t){let n=Pn(e.arrangement?.()?.first,t,e.places());if(!(!n||n.to==="home"))return n.to==="place"?{...le,focusId:ee(n.place.kind),within:{view:n.place.as}}:{...le,focusId:ee(n.kind)}}var Po=L(j(),1),Zr=(0,Po.createContext)(!1);var Ye=Symbol.for("graview.default-view");function Ro(e){return Object.defineProperty(e,Ye,{value:!0,enumerable:!1}),e}function Ao(e){return typeof e=="function"&&e[Ye]===!0}var Mt=Symbol.for("graview.replaces-page");function To(e){return typeof e=="function"&&e[Mt]===!0}function ei(e){return kn(e)}function ti(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 ye=L(j(),1);function ni(){let{selection:e,setSelection:t}=te();return(0,ye.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 oi(){let{store:e}=te(),t=Ue();return(0,ye.useMemo)(()=>ri(e),[e,t])}var Mo=new WeakMap;function ri(e){let t=Mo.get(e);if(!t){let n={violations:null};e.subscribe(()=>{n.violations=null}),Mo.set(e,n),t=n}return t.violations??=e.violations(),t.violations}function ii(){let{view:e,setView:t}=te();return(0,ye.useMemo)(()=>({view:e,url:Q(e),focus:n=>t(o=>z(o,n)),show:n=>t(o=>Vn(o,n)),toggle:n=>t(o=>je(o,n)),go:n=>t(n)}),[e,t])}var pe={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;pe.at=typeof t?.graview=="number"?t.graview:0,pe.at>pe.depth&&(pe.depth=pe.at),pe.tell()});var N=L(j(),1),Vt={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"]}},ai={position:"fixed",inset:"auto",margin:0,zIndex:bn("popover"),boxSizing:"border-box"},Xe=6,me=8,si=e=>typeof e.showPopover=="function";function Je(e){try{return e.matches(":popover-open")}catch{return!1}}function li(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 _t(e,t,n={}){let o=li(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-Xe-me,s=o.top-Xe-me,u=a.height<=d||d>=s,f=Math.max(96,Math.floor(u?d:s)),S=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,y=typeof t=="function"?null:t.current?.closest("[data-graview-embed]")?.getBoundingClientRect();y&&p<=y.right-y.left&&(g<y.left?g=o.left+p<=y.right?o.left:y.left:g+p>y.right&&(g=o.right-p>=y.left?o.right-p:y.right-p));let x=p>=r.width-2*me?Math.max(0,(r.width-p)/2):Math.max(me,Math.min(g,r.width-me-p)),m=u?o.bottom+Xe:Math.max(me,o.top-Xe-S);e.style.left=`${Math.round(x)}px`,e.style.top=`${Math.round(m)}px`}function Oo(e,t,n,o={}){let r=o.align??"end";(0,N.useLayoutEffect)(()=>{let i=e.current;if(!t||!i)return;if(si(i)&&!Je(i))try{i.showPopover(),ui()}catch{}let a=0,d=u=>{u?.target instanceof Node&&i.contains(u.target)||(cancelAnimationFrame(a),a=requestAnimationFrame(()=>_t(i,n,{align:r})))};_t(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&&Je(i))try{i.hidePopover()}catch{}}},[t,e,r])}var Ct=new Set;function di(e){return Ct.add(e),()=>Ct.delete(e)}function ui(){for(let e of Ct)if(!(!e.isConnected||!Je(e)))try{e.hidePopover(),e.showPopover()}catch{}}var ge=null,ci='button:not([disabled]), [href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])';function fi(e){for(let t of e.querySelectorAll(ci))if(t.closest("[hidden]")===null&&getComputedStyle(t).visibility!=="hidden")return t;return e}var Ot=()=>{let e=document.activeElement;return e===null||e===document.body};function pi(e,t={}){let{at:n,returnTo:o,onOpenChange:r}=t,i=t.popover!==!1,[a,d]=(0,N.useState)(!1),s=t.open??a,u=(0,N.useRef)(null),f=(0,N.useRef)(null),S=(0,N.useCallback)(w=>{u.current=w},[]),p=(0,N.useCallback)(w=>{f.current=w},[]),g=`graview-popover-${(0,N.useId)().replace(/:/g,"")}`,y=(0,N.useRef)({onOpenChange:r,returnTo:o,controlled:t.open!==void 0});y.current={onOpenChange:r,returnTo:o,controlled:t.open!==void 0};let x=(0,N.useCallback)(w=>{y.current.controlled||d(w),y.current.onOpenChange?.(w)},[]),m=(0,N.useCallback)(()=>{(document.querySelector(`[aria-controls="${g}"]`)??u.current??y.current.returnTo?.()??null)?.focus({preventScroll:!0})},[g]),b=(0,N.useCallback)(w=>{let E=f.current,O=typeof document>"u"?null:document.activeElement,W=O===null||O===document.body||E!==null&&E.contains(O);x(!1),!(!w||!W)&&(m(),requestAnimationFrame(()=>{Ot()&&m()}))},[x,m]);return Oo(f,i&&s,n??u,t.align?{align:t.align}:{}),(0,N.useEffect)(()=>{if(!i||!s)return;let w={name:e,close:()=>b(!1)};if(ge&&ge.close!==w.close&&ge.close(),ge=w,Vt[e].focus==="into"){let T=f.current;T&&!T.contains(document.activeElement)&&fi(T).focus({preventScroll:!0})}let E=T=>{T.key==="Escape"&&b(!0)},O=T=>{let I=T.target;if(!(I instanceof Node))return;let H=f.current;if(H?.contains(I)||u.current?.contains(I))return;let D=I instanceof Element?I.closest('[role="dialog"], [role="alertdialog"]'):null;D&&!(H&&D.contains(H))||(b(!1),Vt[e].focus==="into"&&requestAnimationFrame(()=>{(Ot()||H!==null&&H.contains(document.activeElement))&&m()}))},W=null,C=null,K=T=>{let I=T.target;if(!(I instanceof Element))return;let H=f.current,D=I.closest('[role="dialog"], [role="alertdialog"]');!D||H&&(H.contains(D)||D.contains(H))||(W=D,b(!1))};return document.addEventListener("keydown",E),document.addEventListener("pointerdown",O,!0),document.addEventListener("focusin",K),()=>{document.removeEventListener("keydown",E),document.removeEventListener("pointerdown",O,!0),document.removeEventListener("focusin",K);let T=W;T&&typeof MutationObserver<"u"&&(C?.disconnect(),C=new MutationObserver(()=>{T.isConnected||(C?.disconnect(),requestAnimationFrame(()=>{(Ot()||document.activeElement.closest("[hidden]")!==null)&&m()}))}),C.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>C?.disconnect(),10*6e4)),ge?.close===w.close&&(ge=null)}},[i,s,e,b,m]),{open:s,setOpen:w=>w?x(!0):b(!0),toggle:()=>s?b(!0):x(!0),trigger:{ref:S,"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 G=L(j(),1),Y=L(Te(),1),Lt=new Set,Vo=!1;function It(){for(let e of[...Lt])e()}function yi(){Vo||typeof window>"u"||(Vo=!0,window.addEventListener("online",It))}function mi(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 S().catch(()=>{});function S(){if(n)return Promise.resolve(t);if(r)return r;let p=e().then(g=>(t=g,n=!0,o=!1,r=void 0,Lt.delete(f),d(),g),g=>{throw r=void 0,o=!0,Lt.add(f),yi(),d(),g});return p.catch(()=>{}),r=p,p}return{load:S,prefetch:f,get current(){return t},get failed(){return o},part(p,g={}){let y=g.what??"This part";function x(w){(0,G.useSyncExternalStore)(s,u,u);let E=(0,G.useRef)(null),O=(0,G.useRef)(null),W=(0,G.useRef)(!1);return(0,G.useEffect)(()=>{o&&r===void 0&&f()},[]),n&&typeof document<"u"&&E.current!==null&&document.activeElement===E.current&&(W.current=!0),(0,G.useLayoutEffect)(()=>{if(!(!n||!W.current)){W.current=!1;for(let C=O.current?.nextElementSibling??null;C!==null;C=C.nextElementSibling){let K=C.matches(_o)?C:C.querySelector(_o);if(K instanceof HTMLElement){K.focus();return}}}}),n?(0,Y.jsxs)(Y.Fragment,{children:[W.current?(0,Y.jsx)("span",{ref:O,hidden:!0}):null,p(t,w)]}):g.quiet?null:(0,Y.jsx)(gi,{what:y,button:E,...g.as?{as:g.as}:{}})}let m=(0,G.lazy)(()=>S().then(()=>({default:x}),()=>({default:x})));function b(w){let[E]=(0,G.useState)(()=>n||o);return(0,G.createElement)(E?x:m,w)}return b}}}var _o="button,a[href],input,select,textarea,[tabindex]:not([tabindex='-1'])";function gi({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:It,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 he=L(j(),1);var Co=(0,he.createContext)(null);function hi(){let e=(0,he.useContext)(Co),t=Tt(),n=(o,r,i)=>t?.setView(a=>oe(oe(de(z(a,ee(o)),!1),"view",r),"filter",i?.filter??null));return(0,he.useMemo)(()=>e??{record:o=>{t&&(t.setView(r=>z(de(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 Lo=L(j(),1),Si=(0,Lo.createContext)(!1);var Io=L(j(),1),wi=(0,Io.createContext)(null);var Ho=L(j(),1),Ht='button:not([disabled]), a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])',Nt=e=>e instanceof HTMLElement&&(e.matches(Ht)||e.hasAttribute("tabindex")),Oe=e=>typeof e.checkVisibility=="function"?e.checkVisibility():e.getClientRects().length>0;function vi(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&&Nt(d)&&Oe(d)?d:null}var bi=e=>e.isConnected&&Nt(e)&&!e.matches(":disabled")&&e instanceof HTMLElement&&Oe(e);function No(e,t){let n=t?vi(e,t):null;if(n)return n;let o=e.querySelector("[data-graview-view][tabindex]");if(o&&Oe(o))return o;for(let r of e.querySelectorAll(Ht))if(Oe(r))return r;return Nt(e)&&Oe(e)?e:null}function xi(e){(0,Ho.useEffect)(()=>{let t=e.current;if(!t||typeof MutationObserver>"u")return;let n=[],o=m=>{let b=m.target;if(b instanceof Element){n=[];for(let w=b;w&&w!==t.parentElement;w=w.parentElement)n.push(w)}},r=!1,i=!1,a=t.ownerDocument,d=()=>!i&&a.defaultView!==null,s=(m,b)=>void setTimeout(()=>d()&&b(),m),u=m=>void requestAnimationFrame(()=>d()&&m()),f=m=>{if(r=!1,i)return;let b=a.activeElement;if(!(!(b===null||b===a.body||b===a.documentElement)||n.length===0)){if(bi(n[0])){m&&n[0]instanceof HTMLElement&&n[0].focus({preventScroll:!0});return}for(let E of n.slice(1)){if(!E.isConnected)continue;let O=No(E,n[0]);if(O){O.focus({preventScroll:!0}),n=[];return}}}},S=(m,b=Date.now()+2500)=>{s(100,()=>{f(m);let w=a.activeElement;(w===null||w===a.body||w===a.documentElement)&&n.length>0&&Date.now()<b&&S(m,b)})},p=()=>{r||n.length===0||(r=!0,s(60,()=>u(()=>{f(!1),S(!1)})))},g=m=>{if(!(m instanceof KeyboardEvent&&!["Enter"," ","Escape"].includes(m.key))){if(!(m instanceof KeyboardEvent)){let b=m.target instanceof Element?m.target.closest(Ht):null,w=a.activeElement,E=w===null||w===a.body||w===a.documentElement;if(b&&E&&t.contains(b)){n=[];for(let O=b;O&&O!==t.parentElement;O=O.parentElement)n.push(O);s(150,()=>u(()=>{f(!1),S(!1)}));return}}!(m instanceof KeyboardEvent)&&!(m.target instanceof Node&&n[0]?.contains(m.target))||s(150,()=>u(()=>{f(!0),S(!0)}))}},y=new MutationObserver(()=>{n.length>0&&!n[0].isConnected&&p()}),x=m=>{m.relatedTarget===null&&p()};return t.addEventListener("focusin",o),t.addEventListener("focusout",x),t.addEventListener("click",g),t.addEventListener("keydown",g),y.observe(t,{childList:!0,subtree:!0}),()=>{i=!0,t.removeEventListener("focusin",o),t.removeEventListener("focusout",x),t.removeEventListener("click",g),t.removeEventListener("keydown",g),y.disconnect()}},[e])}export{An as a,le as b,Q as c,Ne as d,Pi as e,Ri as f,Mn as g,Tn as h,On as i,it as j,z as k,Vn as l,oe as m,de as n,De as o,Re as p,je as q,We as r,at as s,ue as t,Mi as u,Zo as v,ee as w,_n as x,re as y,Cn as z,Qo as A,Oi as B,Ln as C,st as D,Rr as E,Ar as F,j as G,gt as H,wr as I,vr as J,Un as K,Be as L,br as M,Ae as N,Xn as O,xr as P,ht as Q,Te as R,Nr as S,Dr as T,xo as U,Fr as V,Br as W,xa as X,Ur as Y,te as Z,Tt as _,Ue as $,Yr as aa,Xr as ba,Jr as ca,At as da,Co as ea,hi as fa,Zr as ga,Ro as ha,Ao as ia,To as ja,ei as ka,ti as la,Si as ma,wi as na,ni as oa,oi as pa,ii as qa,pe as ra,xi as sa,ai as ta,Je as ua,Oo as va,di as wa,pi as xa,mi as ya};
|
|
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
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{G as m,O as r,R as a,a as o,ya as l}from"./chunk.GFF2FB2J.js";import{b as n}from"./chunk.AJZBJBMO.js";var p=n(m(),1),e=n(a(),1),c=l(o(()=>import("./chunk.JISMMIMX.js"))),f=c.part((i,t)=>(0,e.jsx)(i.Timeline,{...t}),{what:"The timeline"}),u=()=>c.prefetch();function T({face:i}){return r()?.open?(0,e.jsx)(p.Suspense,{fallback:null,children:(0,e.jsx)(f,{face:i})}):null}export{u as a,T as b};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{b as ee}from"./chunk.
|
|
1
|
+
import{b as ee}from"./chunk.4SJUTBDV.js";import"./chunk.3VL5WECB.js";import"./chunk.JH6MU6TX.js";import{c as Z}from"./chunk.WAFDCOOG.js";import{G as ce,R as X}from"./chunk.GFF2FB2J.js";import{W as J,Z as U,bc as j}from"./chunk.6V2RG5JG.js";import{b as _}from"./chunk.AJZBJBMO.js";var B=_(ce(),1);var ue=6;function ne(v,b,h,f,L){let t=new Set(v),o=new Map;for(let r of b)for(let[u,a,S]of[[r.from,r.to,"out"],[r.to,r.from,"in"]]){if(!t.has(u)||t.has(a))continue;let p=h(a);if(p===void 0)continue;let m=`${u}|${r.kind}|${S}|${p}`,k=o.get(m);k?k.others.includes(a)||k.others.push(a):o.set(m,{self:u,edge:r.kind,direction:S,kind:p,others:[a]})}let d=[];for(let r of o.values()){let u=h(r.self)??"",a=Z(L,r.direction==="out"?u:r.kind,r.edge,r.direction),S=r.others.filter(f),p=r.others.filter(m=>!f(m));if(r.others.length>ue){d.push({...r,others:r.others,lands:"district",words:a});continue}for(let m of S)d.push({...r,others:[m],lands:"record",words:a});p.length>0&&d.push({...r,others:p,lands:"district",words:a})}return d}function te(v,b=[]){let h=[...b],f=new Map,L=t=>h.some(o=>t.x<o.x+o.width&&o.x<t.x+t.width&&t.y<o.y+o.height&&o.y<t.y+t.height);for(let t of[...v].sort((o,d)=>o.y-d.y||o.x-d.x)){let o={x:t.x-t.width/2,y:t.y-t.height,width:t.width,height:t.height};for(let d=0;d<12&&L(o);d++)o.y+=t.height+2;h.push(o),f.set(t.key,{x:o.x,y:o.y})}return f}var s=_(X(),1),ge=4;function we({frame:v,width:b,height:h,stageRef:f,tick:L,store:t,graphVersion:o,selection:d,view:r,rulers:{visibleRect:u,clipQuadratic:a,unsureOf:S,unsureDash:p,unsureOpacity:m}}){let k=n=>t.graph.getNode(n)?.kind,C=ee(d,r,k),$=C.lens===null&&C.records.length<=ge?C.records:[],re=$.join(`
|
|
2
2
|
`),[c,q]=(0,B.useState)(null);(0,B.useLayoutEffect)(()=>{let n=f.current;if(!r.overview||$.length===0||!n||typeof document>"u"||v.t<1){q(null);return}let g=n.getBoundingClientRect(),R=e=>({x:e.left-g.left,y:e.top-g.top,width:e.width,height:e.height}),N=new Map,oe=$.map(e=>`[data-graview-view="${CSS.escape(e)}"]`).join(","),D=e=>{if(N.has(e))return N.get(e);let i=null;for(let y of n.querySelectorAll(`[data-graview-pick="${CSS.escape(e)}"], [data-graview-view="${CSS.escape(e)}"]`))if(!y.closest("[data-graview-offstage], [data-graview-screen]")&&!(!$.includes(e)&&y.closest(oe))&&(i=u(y,n),i))break;if(!i){let y=n.querySelector(`[data-graview-building="${CSS.escape(e)}"]`);y&&(i=R(y.getBoundingClientRect()))}return N.set(e,i),i},T=e=>{let i=n.querySelector(`[data-graview-plot="kind:${CSS.escape(e)}"] .graview-plot-tile`);return i?R(i.getBoundingClientRect()):null},ie=ne($,t.graph.allEdges(),k,e=>D(e)!==null,t.schema),K=[];for(let e of n.querySelectorAll('[data-graview-view^="kind:"] .graview-kind-face')){let i=u(e,n);i&&K.push(i)}let H=e=>({x:e.x+e.width/2,y:e.y+e.height/2}),E=[],W=new Set($),A=new Set;for(let e of ie){let i=k(e.self),y=D(e.self)??(i?T(i):null),Q=e.lands==="record"?D(e.others[0]):T(e.kind);if(!y||!Q)continue;for(let l of e.others)W.add(l);A.add(e.kind),i&&A.add(i);let x=H(y),w=H(Q),O=Math.hypot(w.x-x.x,w.y-x.y);if(O<6)continue;let V=Math.min(40,O*.12)*(E.length%2===0?1:-1),de={x:(x.x+w.x)/2-(w.y-x.y)/O*V,y:(x.y+w.y)/2+(w.x-x.x)/O*V},Y=a({p0:x,c:de,p1:w},K);if(Y.length===0)continue;let ae=Y.map(l=>`M ${l.p0.x.toFixed(1)} ${l.p0.y.toFixed(1)} Q ${l.c.x.toFixed(1)} ${l.c.y.toFixed(1)} ${l.p1.x.toFixed(1)} ${l.p1.y.toFixed(1)}`).join(" "),le=l=>{let F=t.graph.getNode(l);return F?J(t.schema.tryDefinition(F.kind),F):l},G=e.lands==="record"?`${e.words}: ${le(e.others[0])}`:`${e.words}: ${U(t.schema,e.kind,e.others.length)}`,P=e.others[0],I=e.lands==="record"?S?.(e.edge,e.direction==="out"?e.self:P,e.direction==="out"?P:e.self):void 0;E.push({key:`${e.self}|${e.edge}|${e.direction}|${e.lands}|${P}`,link:e,d:ae,end:w,said:I!==void 0?`${G} \xB7 unsure`:G,...I!==void 0?{unsure:I}:{}})}let z=[];for(let e of n.querySelectorAll(".graview-kind-face[data-graview-nameplate]")){let i=u(e,n);i&&z.push(i)}let se=te(E.map(e=>({key:e.key,x:e.end.x,y:e.end.y-6,width:Math.min(260,14+e.said.length*6.6),height:20})),z);q({lines:E,labels:se,reached:[...W],districts:[...A]})},[re,r.overview,v,o,L,b,h,f,t]);let M=(0,B.useMemo)(()=>{if(!c)return"";let n=c.reached.map(R=>`[data-graview-building="${CSS.escape(R)}"]`).join(","),g=c.districts.map(R=>`[data-graview-plot="kind:${CSS.escape(R)}"]`).join(",");return[".graview-ground[data-graview-altitude] .graview-building { opacity: 0.22; }",n?`.graview-ground[data-graview-altitude] .graview-building:is(${n}) { opacity: 1; }`:"",g?`.graview-ground[data-graview-altitude] .graview-plot:not(:is(${g})) .graview-plot-tile { opacity: 0.4; }`:""].join(`
|
|
3
3
|
`)},[c]);return!c||c.lines.length===0?M?(0,s.jsx)("style",{children:M}):null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{children:M}),(0,s.jsx)("svg",{className:"graview-record-links","data-graview-world":"","data-graview-record-links":c.lines.length,"aria-hidden":"true",width:b,height:h,style:{position:"absolute",left:0,top:0,pointerEvents:"none",zIndex:j.lines},children:c.lines.map(n=>(0,s.jsxs)("g",{className:"graview-record-link","data-graview-link":n.link.edge,"data-graview-lands":n.link.lands,"data-graview-direction":n.link.direction,"data-graview-provisional":n.unsure!==void 0||void 0,children:[(0,s.jsx)("path",{className:"graview-record-link-line",d:n.d,...n.unsure!==void 0?{strokeDasharray:p,strokeOpacity:m}:{}}),n.link.lands==="record"?(0,s.jsx)("circle",{className:"graview-record-link-end",cx:n.end.x,cy:n.end.y,r:3}):null]},n.key))}),(0,s.jsx)("div",{"aria-hidden":"true","data-graview-world":"",style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:j.tieLabels},children:c.lines.map(n=>{let g=c.labels.get(n.key);return g?(0,s.jsx)("span",{className:"graview-record-link-said","data-graview-link-said":n.link.edge,"data-graview-lands":n.link.lands,...n.unsure!==void 0?{title:n.unsure}:{},style:{position:"absolute",left:g.x,top:g.y,...n.unsure!==void 0?{pointerEvents:"auto"}:{}},children:n.said},n.key):null})})]})}export{we as RecordLinks};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{g as F,l as b}from"./chunk.42YX6NOY.js";function L(t,o){return o===1&&["every","some","sum","min","max","sort"].includes(t.fn)}function M(t){let o=new Set,e=new Set,r=[],s=[],a=new Set(F),i=(l,f)=>{switch(l.t){case"lit":return;case"ident":f||o.add(l.name);return;case"list":l.items.forEach(c=>i(c,f));return;case"member":i(l.object,f);return;case"unary":i(l.operand,f);return;case"binary":i(l.left,f),i(l.right,f);return;case"where":i(l.set,f),i(l.filter,!0);return;case"call":{e.add(l.fn);let c=(l.fn==="out"||l.fn==="in")&&l.args.length===2?l.args[1]:l.args[0],m=c?.t==="lit"&&typeof c.value=="string"?c.value:void 0;l.fn==="all"&&m&&r.push(m),(l.fn==="out"||l.fn==="in")&&m&&s.push(m),l.args.forEach((v,k)=>i(v,f||L(l,k)));return}}};return i(t,!1),{names:o,functions:e,unknownFunctions:[...e].filter(l=>!a.has(l)),sweeps:r,edges:s}}var p=class extends Error{constructor(e,r,s){super(`${e} (at character ${r+1} of "${s}")`);this.sentence=e;this.at=r;this.source=s}},D=["||","&&","==","!=","<=",">=","<",">","!","|","&","+","-","*","/","%","(",")","[","]",",","."],j={and:"&&",or:"||",not:"!"},T=2e3;function H(t){let o=[],e=0;for(;e<t.length;){let r=t[e];if(r===" "||r===" "||r===`
|
|
2
|
+
`||r==="\r"){e++;continue}if(r>="0"&&r<="9"){let a=e;for(;e<t.length&&/[0-9.]/.test(t[e]);)e++;let i=t.slice(a,e),l=Number(i);if(!Number.isFinite(l)||i.split(".").length>2)throw new p(`"${i}" is not a number`,a,t);o.push({k:"num",v:l,at:a});continue}if(r==="'"||r==='"'){let a=e++,i="";for(;e<t.length&&t[e]!==r;)t[e]==="\\"&&e+1<t.length&&e++,i+=t[e++];if(e>=t.length)throw new p("a quoted word is never closed",a,t);e++,o.push({k:"str",v:i,at:a});continue}if(/[A-Za-z_]/.test(r)){let a=e;for(;e<t.length&&/[A-Za-z0-9_]/.test(t[e]);)e++;let i=t.slice(a,e),l=Object.hasOwn(j,i)?j[i]:void 0;o.push(l?{k:"op",v:l,at:a}:{k:"id",v:i,at:a});continue}let s=D.find(a=>t.startsWith(a,e));if(!s)throw new p(`"${r}" is not part of the rule language`,e,t);o.push({k:"op",v:s,at:e}),e+=s.length}return o.push({k:"end",at:t.length}),o}function w(t){if(t.length>T)throw new p(`an expression may be at most ${T} characters`,0,t.slice(0,40));let o=H(t),e=0,r=()=>o[e],s=n=>{let d=r();return d.k==="op"&&d.v===n},a=n=>{let d=r();return d.k==="id"&&d.v===n},i=(n,d)=>{if(!s(n))throw new p(`expected ${d}`,r().at,t);e++},l=0,f=(n,d)=>{if(++l>64)throw new p("the expression nests too deeply",n,t);try{return d()}finally{l--}},c=(n,d)=>()=>{let g=d();for(;;){let y=r(),S=y.k==="op"?n.find(q=>q===y.v):y.k==="id"&&y.v==="in"&&n.includes("in")?"in":void 0;if(!S)return g;e++,g={t:"binary",op:S,left:g,right:d(),at:y.at}}},m=()=>{let n=r();if(n.k==="num")return e++,{t:"lit",value:n.v,at:n.at};if(n.k==="str")return e++,{t:"lit",value:n.v,at:n.at};if(n.k==="id"){if(e++,n.v==="true"||n.v==="false")return{t:"lit",value:n.v==="true",at:n.at};if(n.v==="null")return{t:"lit",value:null,at:n.at};if(s("(")){e++;let d=[];if(!s(")"))for(;;){if(d.push(h()),s(",")){e++;continue}break}return i(")",`")" to close ${n.v}(\u2026)`),{t:"call",fn:n.v,args:d,at:n.at}}return{t:"ident",name:n.v,at:n.at}}if(n.k==="op"&&n.v==="("){e++;let d=f(n.at,h);return i(")",'a ")"'),d}if(n.k==="op"&&n.v==="["){e++;let d=[];if(!s("]"))for(;;){if(d.push(h()),s(",")){e++;continue}break}return i("]",'a "]" to close the list'),{t:"list",items:d,at:n.at}}throw n.k==="end"?new p("the expression ends too soon",n.at,t):new p(`"${n.k==="op"?n.v:""}" cannot start a value here`,n.at,t)},v=()=>{let n=m();for(;;){if(s(".")){let d=r();e++;let g=r();if(g.k!=="id")throw new p('expected a field name after "."',g.at,t);e++,n={t:"member",object:n,name:g.v,at:d.at};continue}if(a("where")){let d=r().at;e++,n={t:"where",set:n,filter:f(d,h),at:d};continue}return n}},k=()=>{let n=r();return n.k==="op"&&(n.v==="!"||n.v==="-")?(e++,{t:"unary",op:n.v,operand:f(n.at,k),at:n.at}):v()},P=c(["*","/","%"],k),z=c(["+","-"],P),N=c(["&"],z),R=c(["|"],N),_=()=>{let n=R(),d=r(),g=d.k==="op"&&["==","!=","<","<=",">",">="].includes(d.v)?d.v:d.k==="id"&&d.v==="in"?"in":void 0;return g?(e++,{t:"binary",op:g,left:n,right:R(),at:d.at}):n},O=()=>{let n=r();return n.k==="op"&&n.v==="!"?(e++,{t:"unary",op:"!",operand:f(n.at,O),at:n.at}):_()},B=c(["&&"],O),I=c(["||"],B);function h(){return I()}let K=h();if(r().k!=="end")throw new p("there is more after the end of the expression",r().at,t);return K}function E(t){let o,e=-1,r=0;for(let s=0;s<t.length;s++){let a=t[s];if(o){a==="\\"?s++:a===o&&(o=void 0);continue}a==="'"||a==='"'?o=a:a==="("||a==="["?r++:a===")"||a==="]"?r--:a==="|"&&r===0&&(t[s+1]==="|"?s++:e=s)}if(e>0&&t.slice(e+1).trim()===x){let s=E(t.slice(0,e));if(s>=0)return s}return e}var x="capital",$=/\s*(?:'((?:[^'\\]|\\.)*)'|"((?:[^"\\]|\\.)*)")\s*(,|$)/y;function U(t){let o=E(t);if(o>=0){if(t.slice(o+1).trim()!==x)throw new u('only "capital" may follow another formatter, like {n | words | capital}');let e=t.slice(0,o);if(e.trim()===x)throw new u('"capital" is said once');return{...C(e),capital:!0}}return t.trim()===x?{args:[],capital:!0}:C(t)}function C(t){let o=t.indexOf(":"),e=(o>=0?t.slice(0,o):t).trim();if(!b.includes(e))throw new u(`"${e}" is not a formatter; use one of ${[...b,x].join(", ")}`);let r=[];if(o>=0&&e==="excerpt"){let s=t.slice(o+1).trim();if(!/^\d+$/.test(s)||Number(s)<20||Number(s)>1e3)throw new u("excerpt is told at most how many characters, 20 to 1000: {summary | excerpt: 80}");r.push(s)}else if(o>=0){let s=t.slice(o+1),a=0;for(;a<s.length;){$.lastIndex=a;let i=$.exec(s);if(!i)throw new u(`"${e}" is told quoted words, like ${e}: 'offer'`);if(r.push((i[1]??i[2]??"").replace(/\\(.)/g,"$1")),a=$.lastIndex,i[3]==="")break}}if(e==="plural"&&(r.length<1||r.length>2))throw new u("plural is told its noun, like {count | plural: 'offer'}, and its plural where English does not make it: plural: 'person', 'people'");if(e!=="plural"&&e!=="excerpt"&&r.length>0)throw new u(`"${e}" takes nothing after it`);return{format:e,args:r}}var u=class extends Error{constructor(e){super(e);this.sentence=e}};function Y(t){let o=[],e=0;for(;e<t.length;){let r=t.indexOf("{",e);if(r<0){o.push({text:t.slice(e)});break}r>e&&o.push({text:t.slice(e,r)});let s=t.indexOf("}",r);if(s<0)throw new u(`a "{" at character ${r+1} is never closed`);let a=t.slice(r+1,s),i=E(a),l=(i>=0?a.slice(0,i):a).trim(),f=i>=0?U(a.slice(i+1)):void 0,c=E(l);if(c>=0&&b.includes(l.slice(c+1).split(":")[0].trim()))throw new u('only "capital" may follow another formatter, like {n | words | capital}');o.push({expr:w(l),source:l,...f?.format?{format:f.format}:{},...f&&f.args.length>0?{formatArgs:f.args}:{},...f?.capital?{capital:!0}:{}}),e=s+1}return o}function A(t){let o=new Map;for(let[e,r]of Object.entries(t?.computed??{}))o.set(e,typeof r=="string"?{expr:r}:r);return o}function re(t){let o=A(t);if(o.size===0)return;let e=new Map;for(let[r,s]of o)try{e.set(r,w(s.expr))}catch(a){if(!(a instanceof p))throw a}return e}function Z(t,o,e=new Set){let r=A(t).get(o);if(!r||e.has(o))return!1;let s;try{s=w(r.expr)}catch{return!1}let a=M(s);if(a.edges.length>0||a.sweeps.length>0||[...a.functions].some(c=>c==="out"||c==="in"||c==="all"))return!1;let i=t.fields,l=c=>i instanceof Set?i.has(c):Object.hasOwn(i,c),f=new Set([...e,o]);return[...a.names].every(c=>l(c)||Z(t,c,f))}export{M as a,p as b,w as c,u as d,Y as e,A as f,re as g,Z as h};
|