graview 0.1.36 → 0.1.37
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.T47DLH5Z.js → chunk.24E4R4ZH.js} +1 -1
- package/dist/preview/{chunk.DSP62QYK.js → chunk.2JF254FO.js} +1 -1
- package/dist/preview/chunk.2TDB4D6Y.js +1 -0
- package/dist/preview/{chunk.YNE5QR7Q.js → chunk.3IVVXVG7.js} +1 -1
- package/dist/preview/{chunk.WJ2TWU2I.js → chunk.3KJQXYCA.js} +1 -1
- package/dist/preview/chunk.3V2M3S4U.js +1 -0
- package/dist/preview/{chunk.WHTQHU3M.js → chunk.4NCXMVPY.js} +1 -1
- package/dist/preview/chunk.57XTDW57.js +1 -0
- package/dist/preview/chunk.5CLFTXP3.js +1 -0
- package/dist/preview/chunk.5EXYDBAL.js +88 -0
- package/dist/preview/chunk.5JPRRV47.js +1 -0
- package/dist/preview/{chunk.ZVMIHXVK.js → chunk.67PVRVAC.js} +1 -1
- package/dist/preview/{chunk.FERBNBDE.js → chunk.6DYZBDWT.js} +1 -1
- package/dist/preview/chunk.6SK2K72G.js +1 -0
- package/dist/preview/{chunk.TGEF6TMM.js → chunk.74DXEKUV.js} +1 -1
- package/dist/preview/chunk.76QUEWYD.js +1 -0
- package/dist/preview/{chunk.QDHUDLJB.js → chunk.7MMNMZLF.js} +1 -1
- package/dist/preview/chunk.7OLVQ2FZ.js +1 -0
- package/dist/preview/{chunk.MXJS67W4.js → chunk.7UQOXYJX.js} +1 -1
- package/dist/preview/{chunk.ER5ILWKY.js → chunk.AHC4EXLW.js} +2 -2
- package/dist/preview/{chunk.ZWZ5SEXT.js → chunk.AWRS6TUN.js} +1 -1
- package/dist/preview/{chunk.H4T56OXM.js → chunk.AZ333RB3.js} +1 -1
- package/dist/preview/{chunk.HZPTBPJY.js → chunk.BA3REPV5.js} +1 -1
- package/dist/preview/{chunk.5PU3RWYY.js → chunk.BRBY5WJT.js} +2 -2
- package/dist/preview/{chunk.6KMXLUOS.js → chunk.BXWO6ILK.js} +1 -1
- package/dist/preview/chunk.CGQLE7JW.js +1 -0
- package/dist/preview/chunk.CV4CBHFT.js +1 -0
- package/dist/preview/chunk.CYPTJNES.js +1 -0
- package/dist/preview/{chunk.ACXA55GW.js → chunk.D2ILIAND.js} +1 -1
- package/dist/preview/chunk.DLCFCMKX.js +1 -0
- package/dist/preview/chunk.DMUUYZ37.js +1 -0
- package/dist/preview/chunk.DNNL7F3P.js +25 -0
- package/dist/preview/chunk.EHT4HBH5.js +35 -0
- package/dist/preview/chunk.EKUAI5YL.js +1 -0
- package/dist/preview/chunk.ELY2RMGE.js +19 -0
- package/dist/preview/{chunk.6ZZZBDEG.js → chunk.ENEOGGFM.js} +1 -1
- package/dist/preview/chunk.ENJKCSNX.js +1 -0
- package/dist/preview/chunk.FEPYKPZE.js +1 -0
- package/dist/preview/{chunk.ET76FISZ.js → chunk.FFW6XWHB.js} +1 -1
- package/dist/preview/{chunk.ZEW2OOZ5.js → chunk.FGYCYLUS.js} +1 -1
- package/dist/preview/{chunk.ITXIFDQ7.js → chunk.G7S7GLDK.js} +1 -1
- package/dist/preview/chunk.GMZAQGH7.js +1 -0
- package/dist/preview/chunk.GXPBRYSR.js +1 -0
- package/dist/preview/{chunk.42WJ6VJZ.js → chunk.H4LFJPDV.js} +1 -1
- package/dist/preview/chunk.HBBVVALN.js +5 -0
- package/dist/preview/{chunk.NWYOLGQ3.js → chunk.HCK4Y6C5.js} +1 -1
- package/dist/preview/chunk.HSRGYZOR.js +1 -0
- package/dist/preview/chunk.HYAKRLPT.js +4 -0
- package/dist/preview/chunk.IHBIRAC4.js +2 -0
- package/dist/preview/chunk.IWK5QL6P.js +1 -0
- package/dist/preview/{chunk.WQBDTLPZ.js → chunk.J2CR4RRH.js} +1 -1
- package/dist/preview/chunk.J2HQEUYA.js +1 -0
- package/dist/preview/{chunk.R45BF6JV.js → chunk.JBRXGPPM.js} +1 -1
- package/dist/preview/chunk.JDRM6XXD.js +2 -0
- package/dist/preview/chunk.JFLUVZNW.js +1 -0
- package/dist/preview/chunk.KAWP4RNR.js +1 -0
- package/dist/preview/{chunk.OF34OZ4V.js → chunk.KSXB4LDF.js} +1 -1
- package/dist/preview/{chunk.FUR4IHWG.js → chunk.LJE5J3JK.js} +1 -1
- package/dist/preview/chunk.LPJY6V5D.js +1 -0
- package/dist/preview/chunk.LVLAS5GL.js +1 -0
- package/dist/preview/{chunk.7CO7S6QM.js → chunk.LVNAB2BW.js} +1 -1
- package/dist/preview/{chunk.XRCGADKC.js → chunk.LYJXX6BU.js} +1 -1
- package/dist/preview/{chunk.CUCNT7MG.js → chunk.MJLUAGEV.js} +1 -1
- package/dist/preview/chunk.MKPJKZAP.js +1 -0
- package/dist/preview/chunk.MMBMVHIG.js +1 -0
- package/dist/preview/chunk.NNNVB6RV.js +1 -0
- package/dist/preview/chunk.NOZEHLWG.js +2 -0
- package/dist/preview/{chunk.SG23JC6D.js → chunk.NV6IZJKA.js} +1 -1
- package/dist/preview/{chunk.RKHEZ6KZ.js → chunk.NWHFFOXW.js} +1 -1
- package/dist/preview/chunk.NZJZIYDK.js +1 -0
- package/dist/preview/chunk.O6KNGFWH.js +1 -0
- package/dist/preview/chunk.PMK73A53.js +1 -0
- package/dist/preview/chunk.PQPZZ7ZW.js +117 -0
- package/dist/preview/{chunk.Y3IJDWNS.js → chunk.QJYALCIW.js} +1 -1
- package/dist/preview/chunk.QMZUKAPJ.js +1 -0
- package/dist/preview/{chunk.GUDKPK42.js → chunk.QNGFBJWP.js} +1 -1
- package/dist/preview/{chunk.LMVCWYYG.js → chunk.QOXTBRKE.js} +1 -1
- package/dist/preview/{chunk.BZ5VLPKB.js → chunk.QXARGANF.js} +6 -6
- package/dist/preview/{chunk.P75TPZWT.js → chunk.QYWBQ5NX.js} +1 -1
- package/dist/preview/{chunk.EDSPYKR4.js → chunk.RPOYSIVQ.js} +1 -1
- package/dist/preview/{chunk.HPX3F7XX.js → chunk.SNKOPWAD.js} +1 -1
- package/dist/preview/{chunk.EBLKEQ7O.js → chunk.SZMWJHU2.js} +1 -1
- package/dist/preview/{chunk.KU6NIMQX.js → chunk.TN4GY6LW.js} +1 -1
- package/dist/preview/{chunk.O3OALXCI.js → chunk.TRLVFHFT.js} +2 -2
- package/dist/preview/chunk.TSI4O3GH.js +1 -0
- package/dist/preview/chunk.TX5QIZEP.js +1 -0
- package/dist/preview/{chunk.UJR3Y7MP.js → chunk.TXS4I326.js} +1 -1
- package/dist/preview/chunk.U4URQDC5.js +1 -0
- package/dist/preview/chunk.UCVZG7S4.js +1 -0
- package/dist/preview/{chunk.LA7535VO.js → chunk.UPBUF7KR.js} +1 -1
- package/dist/preview/{chunk.DANDYIB5.js → chunk.UR5TT4JH.js} +1 -1
- package/dist/preview/{chunk.OREMUXB5.js → chunk.UV2TSAB4.js} +1 -1
- package/dist/preview/{chunk.IMRCAU4T.js → chunk.UVLPVHID.js} +1 -1
- package/dist/preview/chunk.VUKHDZNI.js +1 -0
- package/dist/preview/{chunk.S6GJGTJE.js → chunk.VW6WGFL6.js} +1 -1
- package/dist/preview/chunk.VX7MGVP5.js +1 -0
- package/dist/preview/{chunk.WGI5G6NM.js → chunk.WLV2QYTS.js} +1 -1
- package/dist/preview/{chunk.GOCUBIRW.js → chunk.WNKRXL3O.js} +1 -1
- package/dist/preview/chunk.WNMLA4YW.js +1 -0
- package/dist/preview/{chunk.T2CN7UTZ.js → chunk.WVEKYJSI.js} +2 -2
- package/dist/preview/{chunk.2B4WVCVV.js → chunk.X2OLXTRL.js} +1 -1
- package/dist/preview/{chunk.J3TEJBI5.js → chunk.XS3SAH6U.js} +1 -1
- package/dist/preview/chunk.XWJ2MRQF.js +1 -0
- package/dist/preview/{chunk.D6RDTUX3.js → chunk.Y44TR4WG.js} +1 -1
- package/dist/preview/{chunk.OXZRGP53.js → chunk.YAXOIJVH.js} +1 -1
- package/dist/preview/chunk.YFW5BF6J.js +1 -0
- package/dist/preview/chunk.YNJOLOFG.js +1 -0
- package/dist/preview/{chunk.6QDFBCV4.js → chunk.YW2BZ2LH.js} +2 -2
- package/dist/preview/chunk.YX354FRV.js +1 -0
- package/dist/preview/{chunk.QTITRX5Q.js → chunk.ZB7GV3IT.js} +1 -1
- package/dist/preview/{chunk.KBJG5SI2.js → chunk.ZOT4V66Q.js} +1 -1
- package/dist/preview/chunk.ZYPCE2LZ.js +1 -0
- package/dist/preview/index.html +42 -42
- package/dist/preview/page.js +5 -5
- package/package.json +6 -6
- package/dist/preview/chunk.272ZJXQP.js +0 -1
- package/dist/preview/chunk.27TLAVRR.js +0 -19
- package/dist/preview/chunk.2A2DLMT3.js +0 -1
- package/dist/preview/chunk.3PT55HXT.js +0 -1
- package/dist/preview/chunk.3SM2CHKF.js +0 -1
- package/dist/preview/chunk.3ZIOAPI5.js +0 -1
- package/dist/preview/chunk.4B73P2WA.js +0 -2
- package/dist/preview/chunk.4GXXD4NG.js +0 -1
- package/dist/preview/chunk.4Q56V7GS.js +0 -1
- package/dist/preview/chunk.4STIUIT6.js +0 -1
- package/dist/preview/chunk.53IKY7UP.js +0 -1
- package/dist/preview/chunk.56BPXB6E.js +0 -1
- package/dist/preview/chunk.64MJ5FRL.js +0 -1
- package/dist/preview/chunk.6II4BONS.js +0 -25
- package/dist/preview/chunk.6W7J76TK.js +0 -1
- package/dist/preview/chunk.7G3B5QPH.js +0 -1
- package/dist/preview/chunk.7TBSVQSH.js +0 -1
- package/dist/preview/chunk.7YQYWOZR.js +0 -1
- package/dist/preview/chunk.AAZFVCSP.js +0 -2
- package/dist/preview/chunk.ACEYGWMO.js +0 -1
- package/dist/preview/chunk.CE3NOADH.js +0 -1
- package/dist/preview/chunk.CNJENUPC.js +0 -1
- package/dist/preview/chunk.CRPT3ZT3.js +0 -1
- package/dist/preview/chunk.E77K6KBX.js +0 -1
- package/dist/preview/chunk.EQIGKXIG.js +0 -1
- package/dist/preview/chunk.F5BCCGFK.js +0 -5
- package/dist/preview/chunk.FQKH67BP.js +0 -1
- package/dist/preview/chunk.FWBQVPMI.js +0 -1
- package/dist/preview/chunk.GXLAZGYT.js +0 -1
- package/dist/preview/chunk.GZLYTPE7.js +0 -1
- package/dist/preview/chunk.IB32NOV5.js +0 -2
- package/dist/preview/chunk.JLXQ6ZLI.js +0 -1
- package/dist/preview/chunk.JZMA2AV7.js +0 -1
- package/dist/preview/chunk.K5NJTE3F.js +0 -35
- package/dist/preview/chunk.LNNFNJKN.js +0 -1
- package/dist/preview/chunk.M4FQ7SSM.js +0 -1
- package/dist/preview/chunk.NJ62C2GU.js +0 -1
- package/dist/preview/chunk.NNCTJSD3.js +0 -1
- package/dist/preview/chunk.O6ROFVFD.js +0 -88
- package/dist/preview/chunk.OFJH7LDC.js +0 -1
- package/dist/preview/chunk.OH5BBE2B.js +0 -1
- package/dist/preview/chunk.OZR5NI4J.js +0 -1
- package/dist/preview/chunk.PWOVXARZ.js +0 -1
- package/dist/preview/chunk.Q63RPNUS.js +0 -1
- package/dist/preview/chunk.QEALNWWL.js +0 -117
- package/dist/preview/chunk.QLMUGC7R.js +0 -1
- package/dist/preview/chunk.R7LRJS6B.js +0 -4
- package/dist/preview/chunk.SSRP5SBR.js +0 -1
- package/dist/preview/chunk.VHWUGSFW.js +0 -1
- package/dist/preview/chunk.W42P7NOL.js +0 -1
- package/dist/preview/chunk.XBTZXWJX.js +0 -1
- package/dist/preview/chunk.ZDNJK2SX.js +0 -1
- package/dist/preview/chunk.ZNS3LYJU.js +0 -1
- package/dist/preview/chunk.ZSSOTIFL.js +0 -1
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{A as _r,B as Se,C as An,D as De,E as Ge,F as Yr,G as Cn,H as Re,I as Qr,J as Zr,K as F,L as st,M as Rn,N as Xr,O as Ln,P as qt,Q as Jr,R as re,S as se,T as Tn,a as Z,b as Me,c as ee,d as Gr,e as xn,f as Pn,g as ot,h as te,i as ve,j as oe,k as A,l as ne,m as K,n as be,o as Dt,p as ke,q as fe,r as Ur,s as mt,t as Wt,u as J,v as Be,w as jr,x as Ht,y as Ce,z as zr}from"./chunk.6DYZBDWT.js";import{b as Vr,c as Kt,e as ae}from"./chunk.3IVVXVG7.js";import{a as Kr,d as qr,e as Br}from"./chunk.UGFDSE37.js";import{a as Fr,c as Ir,f as Dr,g as Wr,i as Hr}from"./chunk.WNKRXL3O.js";import{a as Cr,b as Rr,c as Lr,d as Sn}from"./chunk.YW2BZ2LH.js";import{a as Tr,b as Mr,d as Ft,e as Nr,f as Er,i as It}from"./chunk.CYPTJNES.js";import{a as $t,b as Ot,c as xr,e as Pr}from"./chunk.HSRGYZOR.js";import{m as Ar}from"./chunk.ELY2RMGE.js";import{a as cr,b as pr,c as ur,e as Sr,f as kn,h as Et}from"./chunk.6SK2K72G.js";import{d as fr,e as yr,f as hr,g as wr,n as vr,o as br,q as kr,s as Nt}from"./chunk.NNNVB6RV.js";import{a as vn}from"./chunk.NZJZIYDK.js";import{a as Mt,b as or,c as sr,d as lr,e as dr}from"./chunk.EKUAI5YL.js";import{a as Rt,b as Ia,c as Da,d as Lt,e as Wa}from"./chunk.7MMNMZLF.js";import{b as Ya,c as rr,e as ir,f as wn}from"./chunk.67PVRVAC.js";import{a as qe,b as Ja,c as er,d as tr,e as nr,f as ar}from"./chunk.VUKHDZNI.js";import{a as yn,b as za,c as _a}from"./chunk.UT6642FC.js";import{c as Qa,d as Za,j as gt}from"./chunk.YFW5BF6J.js";import{r as hn,s as Xa}from"./chunk.GXPBRYSR.js";import{f as Ba,g as it,i as Ga,j as Va,k as fn,q as Ua,r as ja}from"./chunk.7OLVQ2FZ.js";import{b as Tt,c as Ha,d as Ka,e as qa}from"./chunk.NOZEHLWG.js";import{C as bn,K as $r,N as Or,e as Oa,f as Fa,j as Hi,q as gr,r as mr}from"./chunk.QXARGANF.js";import{F as Oe,K as xa,M as Pa,P as Aa,Q as _,T as Ca,U as Ra,Y as La,Z as pe,a as ka,aa as Ta,ba as Ma,da as Na,ha as rt,ia as Ea,ra as $a,s as Sa,w as $e}from"./chunk.DNNL7F3P.js";import{$c as va,I as ia,Kc as gn,Pc as ha,Qc as wa,Rb as ga,Sc as Ct,T as ut,Ub as ma,Va as ca,Vb as fa,Xa as pa,_c as mn,aa as nt,ba as me,da as we,dd as ba,ea as Pt,fb as un,ga as at,gb as ua,ia as oa,ja as sa,ka as Ke,ob as At,pc as ya,ua as la,va as da}from"./chunk.HBBVVALN.js";import{b as D}from"./chunk.AJZBJBMO.js";function ei(t,e,n={}){let a=t.graph.getNode(e);if(!a)return;let r=t.schema.tryDefinition(a.kind),i=l=>me(t.schema.tryDefinition(l.kind),l),o=new Map;for(let l of t.graph.allEdges()){let d=l.from===e?"out":l.to===e?"in":null;if(!d)continue;let c=d==="out"?l.to:l.from,p=t.graph.getNode(c);if(!p)continue;let m=(d==="out"?r:t.schema.tryDefinition(p.kind))?.edges?.[l.kind],u=d==="in"?m?.inverse??m?.description:m?.description,v=`${l.kind}|${d}|${u??""}`;(o.get(v)??(()=>{let y={edgeKind:l.kind,direction:d,...u?{description:u}:{},targets:[]};return o.set(v,y),y})()).targets.push({id:p.id,kind:p.kind,label:i(p)})}return{id:e,kind:a.kind,label:i(a),fields:Ka(gt(t.schema,t.graph,a),r),violations:un(t.violations(n.context),[e]),actions:vn(t,[e],{focus:e,...n.principal?{principal:n.principal}:{},...n.context?{context:n.context}:{}}),links:[...o.values()].map(l=>{let d=Tt(l.targets.flatMap(c=>{let p=t.graph.getNode(c.id);return p?[p]:[]}),c=>t.schema.tryDefinition(c));return{...l,targets:[...l.targets].map(c=>d.has(c.id)?{...c,apart:d.get(c.id)}:c).sort((c,p)=>c.label.localeCompare(p.label))}})}}function je(t,e,n={}){return{kind:e,members:t.graph.nodesOfKind(e),actions:vn(t,[],{kindSelection:[e],...n.principal?{principal:n.principal}:{},...n.context?{context:n.context}:{}})}}function ti(t,e){let n=(i,o)=>`${i}|${JSON.stringify(o)}`,a=new Map;for(let i of[...t.affordances,...t.withheld]){if(i.provider!=="invariant")continue;let o=n(i.mutation,i.args);a.has(o)||a.set(o,i.rank??Number.MAX_SAFE_INTEGER)}let r=Number.MAX_SAFE_INTEGER;return[...e].map((i,o)=>({repair:i,declared:o})).sort((i,o)=>(a.get(n(i.repair.mutation,i.repair.args??{}))??r)-(a.get(n(o.repair.mutation,o.repair.args??{}))??r)||i.declared-o.declared).map(i=>i.repair)}function ze(t){let e=t.schema.kinds.map(r=>({kind:r,plural:at(t.schema,r),count:t.graph.nodesOfKind(r).length})),n=new Map;for(let r of t.graph.allEdges()){let i=t.graph.getNode(r.from),o=t.graph.getNode(r.to);if(!i||!o)continue;let l=`${r.kind}|${i.kind}|${o.kind}`;n.set(l,(n.get(l)??0)+1)}let a=[];for(let{kind:r}of e){let i=t.schema.tryDefinition(r)?.edges??{};for(let[o,l]of Object.entries(i)){let d=l.to==="*"||l.to===void 0?(()=>{let c=[...n.keys()].filter(p=>p.startsWith(`${o}|${r}|`)).map(p=>p.split("|")[2]);return c.length>0?c:["*"]})():l.to;for(let c of d)a.push({edgeKind:o,from:r,to:c,...l.description?{description:l.description}:{},...l.inverse?{inverse:l.inverse}:{},count:n.get(`${o}|${r}|${c}`)??0})}}return{kinds:e,relations:a}}var We=D(Oe(),1);var _e=D(Oe(),1),S=D(_(),1),Ki=`
|
|
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
|
+
div:where([data-graview-part="field"][data-graview-field="date"]) {
|
|
14
|
+
display: grid;
|
|
15
|
+
/* A track the width it was given: see the note on \`column\` in pages.tsx. */
|
|
16
|
+
grid-template-columns: minmax(0, 1fr);
|
|
17
|
+
min-width: 0;
|
|
18
|
+
gap: 4px;
|
|
19
|
+
}
|
|
20
|
+
label:where([data-graview-part="field"][data-graview-field="boolean"]) {
|
|
21
|
+
grid-auto-flow: column;
|
|
22
|
+
justify-content: start;
|
|
23
|
+
align-items: center;
|
|
24
|
+
}
|
|
25
|
+
span:where([data-graview-part="label"]),
|
|
26
|
+
legend:where([data-graview-part="label"]),
|
|
27
|
+
p:where([data-graview-part="unasked"]) {
|
|
28
|
+
font-size: 0.8125rem;
|
|
29
|
+
color: var(--graview-ink-muted);
|
|
30
|
+
}
|
|
31
|
+
p:where([data-graview-part="unasked"]) { margin: 0; }
|
|
32
|
+
input:where([data-graview-part="control"]:not([type="checkbox"])),
|
|
33
|
+
select:where([data-graview-part="control"]) {
|
|
34
|
+
font: inherit;
|
|
35
|
+
/* A TARGET IN EVERY ENGINE, not only in the one it was measured in.
|
|
36
|
+
Padding and line height alone came to 24 in Chromium and to 22 in
|
|
37
|
+
WebKit, which has its own intrinsic metrics for a \`select\` and rounds
|
|
38
|
+
nothing up for anybody. So every picker on the routed face was under
|
|
39
|
+
the WCAG 2.2 minimum in the browser iOS ships, and the check that says
|
|
40
|
+
so (\`verify-pages\`' \`bigEnoughToHit\`) only ever ran there through
|
|
41
|
+
\`pnpm engines\`. */
|
|
42
|
+
min-height: 24px;
|
|
43
|
+
/* NEVER WIDER THAN ITS FIELD. A select is as wide as its longest option,
|
|
44
|
+
and a picker over 320 vehicles ("2027 Mercedes-Benz GLE AMG 53 4MATIC+
|
|
45
|
+
Coupe") was 618 pixels on a 390 phone, and the whole page scrolled
|
|
46
|
+
sideways. It shrinks to its track and cuts the option inside its box. */
|
|
47
|
+
min-width: 0;
|
|
48
|
+
max-width: 100%;
|
|
49
|
+
text-overflow: ellipsis;
|
|
50
|
+
box-sizing: border-box;
|
|
51
|
+
padding: 7px 10px;
|
|
52
|
+
border-radius: 8px;
|
|
53
|
+
border: 1px solid var(--graview-edge);
|
|
54
|
+
background: var(--graview-panel);
|
|
55
|
+
color: var(--graview-ink);
|
|
56
|
+
}
|
|
57
|
+
/* A PICKER THAT STILL LOOKS LIKE ONE.
|
|
58
|
+
WebKit ignores an author's padding and minimum height on a \`select\`
|
|
59
|
+
while the native appearance is on \u2014 so every picker on the routed face
|
|
60
|
+
came out 22 pixels tall in the browser iOS ships, under the 24 WCAG 2.2
|
|
61
|
+
asks for, while the same element measured 35 in Chromium. Turning the
|
|
62
|
+
appearance off is what makes the box the size it was asked to be, and it
|
|
63
|
+
takes the platform's chevron with it; the chevron is put back, in the ink
|
|
64
|
+
the scheme is already using. */
|
|
65
|
+
span:where([data-graview-part="picker"]) {
|
|
66
|
+
position: relative;
|
|
67
|
+
display: grid;
|
|
68
|
+
min-width: 0;
|
|
69
|
+
}
|
|
70
|
+
span:where([data-graview-part="picker"]) > select:where([data-graview-part="control"]) {
|
|
71
|
+
appearance: none;
|
|
72
|
+
padding-right: 28px;
|
|
73
|
+
}
|
|
74
|
+
span:where([data-graview-part="chevron"]) {
|
|
75
|
+
position: absolute;
|
|
76
|
+
right: 10px;
|
|
77
|
+
top: 50%;
|
|
78
|
+
transform: translateY(-50%);
|
|
79
|
+
font-size: 0.75rem;
|
|
80
|
+
line-height: 1;
|
|
81
|
+
color: var(--graview-ink-muted);
|
|
82
|
+
pointer-events: none;
|
|
83
|
+
}
|
|
84
|
+
fieldset:where([data-graview-part="group"]) {
|
|
85
|
+
display: grid;
|
|
86
|
+
gap: 10px;
|
|
87
|
+
border: 1px solid var(--graview-edge);
|
|
88
|
+
border-radius: 10px;
|
|
89
|
+
padding: 12px;
|
|
90
|
+
}
|
|
91
|
+
fieldset:where([data-graview-part="group"][data-graview-field="list"]) { gap: 8px; }
|
|
92
|
+
div:where([data-graview-part="item"]) {
|
|
93
|
+
display: flex;
|
|
94
|
+
gap: 8px;
|
|
95
|
+
align-items: end;
|
|
96
|
+
}
|
|
97
|
+
button:where([data-graview-part="add"]),
|
|
98
|
+
button:where([data-graview-part="submit"]) { justify-self: start; }
|
|
99
|
+
p:where([data-graview-part="refused"]) {
|
|
100
|
+
margin: 0;
|
|
101
|
+
color: var(--graview-warn);
|
|
102
|
+
font-size: 0.875rem;
|
|
103
|
+
}
|
|
104
|
+
`;function qi({title:t,name:e,optional:n,amount:a,value:r,onChange:i}){let o=Ga(a),[l,d]=(0,_e.useState)(()=>typeof r=="number"?Va(r,a):""),c=l.trim()!==""&&fn(l,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:l,onChange:p=>{d(p.target.value),i(fn(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 ni({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 Bi=t=>({label:we(t),option:e=>e}),Gi={phone:"+1 555 123 4567",place:"An address or a place's name",duration:"1h 30m, 90 or 1:30"};function Bt({store:t,spec:e,value:n,onChange:a,prefilled:r,open:i,words:o=Bi,values:l}){if(e.name in r&&e.control!=="group"&&e.control!=="variant")return null;let d=e.control==="node"&&!e.kinds.includes("*")?e.kinds.map(g=>we(Ke(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}})]}):e.control==="date"?(0,S.jsxs)("div",{"data-graview-part":"field","data-graview-field":"date",children:[(0,S.jsx)("span",{"data-graview-part":"label",children:p}),(0,S.jsx)(ar,{name:e.name,label:o(e.name).label,required:!e.optional,value:typeof n=="string"&&n!==""?n:void 0,time:e.time===!0,instant:e.instant===!0,onChange:a})]}):(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==="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:Gi[e.holds]}:{},...e.control==="text"&&e.holds==="phone"?{autoComplete:"tel"}:{},value:typeof n=="string"?n:typeof n=="number"?String(n):"",onChange:g=>a(g.target.value),"data-graview-part":"control"})]});case"number":return e.amount?(0,S.jsx)(qi,{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)(ni,{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=i.find(y=>y.name===e.name)?.candidates,m=new Set(Object.values(r).filter(y=>typeof y=="string")),u=(e.kinds.includes("*")?[...t.graph.allNodes()]:e.kinds.flatMap(y=>t.graph.nodesOfKind(y))).filter(y=>!m.has(y.id)),v=g?g.map(y=>t.graph.getNode(y)).filter(y=>y!==void 0):u,G=Tt(v,y=>t.schema.tryDefinition(y));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)(ni,{children:(0,S.jsxs)("select",{name:e.name,required:!e.optional,value:typeof n=="string"?n:"",onChange:y=>a(y.target.value||void 0),"data-graview-part":"control",children:[(0,S.jsx)("option",{value:"",children:"\u2014"}),v.map(y=>{let C=G.get(y.id);return(0,S.jsxs)("option",{value:y.id,children:[me(t.schema.tryDefinition(y.kind),y),C?` \xB7 ${C}`:""]},y.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(m=>(0,S.jsx)(Bt,{store:t,spec:m,value:g[m.name],onChange:u=>a({...g,[m.name]:u}),prefilled:r,open:i,words:o},m.name))]})}case"variant":{let g=n??{},m=typeof g[e.tag]=="string"?g[e.tag]:"",u=e.options.find(v=>v.value===m);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:we(e.tag)}),(0,S.jsxs)("select",{value:m,onChange:v=>a({[e.tag]:v.target.value}),"data-graview-part":"control",children:[(0,S.jsx)("option",{value:"",children:"\u2014"}),e.options.map(v=>(0,S.jsx)("option",{value:v.value,children:we(v.value)},v.value))]})]}),u?.fields.map(v=>(0,S.jsx)(Bt,{store:t,spec:v,value:g[v.name],onChange:G=>a({...g,[v.name]:G}),prefilled:r,open:i,words:o},v.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,video:g?.video===!0,label:d});let m=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}),m.map((u,v)=>(0,S.jsxs)("div",{"data-graview-part":"item",children:[(0,S.jsx)("div",{style:{flex:1},children:(0,S.jsx)(Bt,{store:t,spec:{...e.item,optional:!1},value:u,onChange:G=>a(m.map((y,C)=>C===v?G:y)),prefilled:r,open:i,words:o})}),(0,S.jsx)("button",{type:"button","data-graview-part":"remove",onClick:()=>a(m.filter((G,y)=>y!==v)),children:"remove"})]},v)),(0,S.jsx)("button",{type:"button","data-graview-part":"add",onClick:()=>a([...m,void 0]),children:"add another"})]})}case"linked":return(0,S.jsx)("div",{"data-graview-part":"field","data-graview-field":"linked",children:(0,S.jsx)(er,{relation:e.relation,value:n,onChange:a,label:d})});case"repeat":return(0,S.jsx)(tr,{value:n,onChange:a,start:e.of?l?.[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",we(e.name),"\u201D needs a structured answer this form cannot ask for yet."]})}}function Fe({store:t,mutation:e,prefilled:n={},open:a=[],onDone:r,principal:i,initial:o,label:l,only:d}){let c=()=>sr(e,t.graph,n),[p,g]=(0,_e.useState)(c),[m,u]=(0,_e.useState)(()=>({...p,...o})),[v,G]=(0,_e.useState)(null),y=i??t.seenFor,C=e.subject&&n[e.subject.arg],V=y?dr(t,y,e,typeof C=="string"?C:void 0):void 0,T=Mt(e.input).filter(I=>(d===void 0||d.includes(I.name))&&!V?.has(I.name)),U=I=>Ba(t.schema,e,I),Y=ja(T.filter(I=>I.control==="date").map(I=>I.name)),le=(0,_e.useRef)(void 0),ge=(I,Q)=>u(de=>{let k={...de,[I.name]:Q};if(Y&&I.name===Y.start&&I.control==="date"){let x=M=>typeof M=="string"&&M!==""?M:void 0,R=x(de[Y.start])??le.current;if(x(Q)){le.current=x(Q);let M=Ua(R,x(Q),x(de[Y.end]),{time:I.time===!0,instant:I.instant===!0});M!==void 0&&(k[Y.end]=M)}}return k});return(0,S.jsxs)("form",{"data-testid":`form-${e.name}`,onSubmit:I=>{I.preventDefault();try{t.apply({name:e.name,args:{...lr(or(T,m),p),...n}},i?{author:i}:{}),G(null);let Q=c();g(Q),u({...Q}),r?.()}catch(Q){G(it(t.schema,t.allMutations(),Q))}},"data-graview-part":"form",children:[(0,S.jsx)("style",{children:Ki}),T.map(I=>(0,S.jsx)(Bt,{store:t,spec:I,value:m[I.name],values:m,onChange:Q=>ge(I,Q),prefilled:n,open:a,words:U},I.name)),v?(0,S.jsx)("p",{"data-testid":"refused","data-graview-part":"refused",role:"alert",children:v}):null,(0,S.jsx)("button",{type:"submit","data-graview-part":"submit",children:l??e.title??e.name})]})}var L=D(_(),1);function Le(t){let e=t.views;if(!e)return[];let n=new Set(Be(t.store,t.principal));return e.places().filter(a=>n.has(a.kind))}function Gt(t,e){if(!e.over)return[e.kind];let n=new Set(Be(t.store,t.principal));return e.over.filter(a=>a===e.kind||n.has(a))}var Ye=t=>`place:${t.kind}:${t.as}`;function xe(t,e){return Gr(e.as,ha(e,t.views?.places()??[])?Z(t.store.schema,e.kind):void 0)}function ft(t,e){let n=t.schema.tryDefinition(e);return t.graph.nodesOfKind(e).filter(a=>nt(n,a))}function Mn(t,e,n){let a=(i,o)=>Pt(t.schema,o,i),r=(typeof e=="string"?[e]:e).map(i=>a(ft(t,i).length,i)).join(" and ");return n?`${r} across ${a(ft(t,n).length,n)}`:r}function Nn({context:t,place:e,chosen:n,filter:a}){let{store:r,views:i,invariantContext:o}=t,d=i?.resolve(e.kind,{cardinality:"many",fidelity:"full"},e.as)?.view,c=[...new Set(r.violations(o).flatMap(m=>m.nodeIds))],p=Gt(t,e).flatMap(m=>ft(r,m));if(!d)return null;let g=Vi(r,p,a,c);return(0,L.jsx)(hn,{kind:e.kind,view:e.title,children:(0,L.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 Vi(t,e,n,a){let r=n?Ct({filter:n}).filter??[]:[];return r.length===0?e:Et(e,{filter:r},{schema:t.schema,graph:t.graph,flagged:new Set(a)}).nodes}function Ui({store:t,views:e,as:n,invariantContext:a}){ae(t);let r={store:t,views:e,...a?{invariantContext:a}:{}},i=e.places().find(o=>o.as===n);return i?(0,L.jsx)(Nn,{context:r,place:i}):null}function ji({context:t,kind:e}){let{store:n,views:a,invariantContext:r}=t,i=ft(n,e),o=n.schema.tryDefinition(e),l=J(n,e),c=a?.resolve(e,{cardinality:"many",fidelity:"full"})?.view,p=[...new Set(n.violations(r).flatMap(v=>v.nodeIds))];if(c&&!rt(c))return(0,L.jsx)(hn,{kind:e,children:(0,L.jsx)(c,{nodes:i,label:l,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1,...p.length>0?{flagged:p}:{}})});let g=a?.resolve(e,{cardinality:"one",fidelity:"summary"})?.view,m=8,u=i.slice(0,m);return(0,L.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(v=>g?(0,L.jsx)(g,{node:v,fidelity:"summary",cardinality:"one",mode:"fullscreen",selected:!1,...p.includes(v.id)?{flagged:[v.id]}:{}},v.id):(0,L.jsx)("span",{style:{padding:"8px 14px",borderRadius:8,border:"1px solid var(--graview-edge-bright)",background:"var(--graview-ground)",color:"var(--graview-ink)"},children:me(o,v)},v.id)),i.length>m?(0,L.jsxs)("span",{style:{...A,alignSelf:"center",padding:"0 6px"},children:["+",i.length-m," more ",l.toLowerCase()]}):null]})}function En(t){let{store:e}=t,n=jr(t),a=Le(t),r=gn([...a].sort((o,l)=>n.indexOf(o.kind)-n.indexOf(l.kind))).filter(o=>!o.hidden),i=new Set(r.flatMap(o=>o.over??[o.kind]));return[...r.map(o=>({key:Ye(o),kind:o.kind,title:wa(o,a,e.schema),to:xe(t,o),place:o})),...Ht(t).filter(o=>!i.has(o)).map(o=>({key:`kind:${o}`,kind:o,title:J(e,o),to:`/${Z(e.schema,o)}`}))]}var ai=.72,zi=540,ri=16/10;function _i(t){let e=(0,We.useRef)(null),[n,a]=(0,We.useState)(t);return(0,We.useLayoutEffect)(()=>{let r=e.current;if(!r||typeof ResizeObserver>"u")return;let i=()=>{let l=r.getBoundingClientRect().width;l>0&&a(d=>Math.abs(d-l)<.5?d:l)};i();let o=new ResizeObserver(i);return o.observe(r),()=>o.disconnect()},[]),{ref:e,width:n}}function Yi(t){for(let e=t.parentElement;e;e=e.parentElement)if(/(auto|scroll)/.test(getComputedStyle(e).overflowY))return e;return null}function Qi(t){let[e,n]=(0,We.useState)(()=>typeof IntersectionObserver>"u");return(0,We.useLayoutEffect)(()=>{let a=t.current;if(e||!a)return;let r=new IntersectionObserver(i=>{i.some(o=>o.isIntersecting)&&(r.disconnect(),n(!0))},{root:Yi(a),rootMargin:"50% 0px"});return r.observe(a),()=>r.disconnect()},[e,t]),e}function $n({context:t,entry:e}){let{store:n,brand:a,principal:r}=t,{ref:i,width:o}=_i(zi),l=Qi(i),d=o/ai,c=ft(n,e.kind),p=n.schema.tryDefinition(e.kind),g=c.length===0?je(n,e.kind,{...r?{principal:r}:{},...t.invariantContext?{context:t.invariantContext}:{}}).actions.affordances[0]:void 0,m=e.place!==void 0;return(0,L.jsxs)(F,{to:e.to,"data-testid":m?"place-card":"kind-card",className:"graview-gallery-card",style:{...be,display:"grid",gap:10,alignContent:"start",minWidth:0},children:[(0,L.jsxs)("span",{ref:i,"data-testid":m?"place-picture":"kind-picture","aria-hidden":"true",inert:!0,style:{display:"block",position:"relative",width:"100%",aspectRatio:`${ri}`,overflow:"hidden",borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",pointerEvents:"none"},children:[(0,L.jsx)("span",{style:{position:"absolute",left:0,top:0,width:d,height:d/ri,display:"grid",gridTemplateRows:"minmax(0, 1fr)",transform:`scale(${ai})`,transformOrigin:"0 0"},children:l?(0,L.jsx)(Ft.Provider,{value:null,children:e.place?(0,L.jsx)(Nn,{context:t,place:e.place}):(0,L.jsx)(ji,{context:t,kind:e.kind})}):null}),c.length===0?(0,L.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,L.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,L.jsxs)("span",{style:{fontFamily:Pn,fontWeight:"var(--graview-weight-display)"},children:["No ",J(n,e.kind).toLowerCase()," yet"]}),g?(0,L.jsxs)("span",{style:A,children:["Begin with \u201C",g.label,"\u201D"]}):null]})}):null]}),(0,L.jsxs)("span",{style:{display:"grid",gap:2,minWidth:0},children:[(0,L.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0},children:[m?null:(0,L.jsx)(fe,{kind:e.kind,brand:a,schema:n.schema,size:8}),(0,L.jsx)("span",{style:{fontFamily:Pn,fontSize:"var(--graview-text-heading)",fontWeight:"var(--graview-weight-display)",lineHeight:1.3,overflowWrap:"anywhere",textWrap:"balance"},children:e.title})]}),(0,L.jsxs)("span",{style:A,children:[e.place?Mn(n,Gt(t,e.place),e.place.across):Mn(n,e.kind),!m&&p?.description?` \xB7 ${p.description}`:null]})]})]})}var ii={display:"grid",gap:"32px 28px",gridTemplateColumns:"repeat(auto-fill, minmax(min(420px, 100%), 1fr))"},Zi=`
|
|
105
|
+
.graview-gallery-card > span:first-child { transition: border-color 160ms ease, box-shadow 160ms ease; }
|
|
106
|
+
.graview-gallery-card:hover > span:first-child,
|
|
107
|
+
.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); }
|
|
108
|
+
`;function On({context:t}){ae(t.store);let e=En(t);return e.length===0?null:(0,L.jsxs)("section",{style:ii,"data-testid":"gallery",children:[(0,L.jsx)("style",{children:Zi}),e.map(n=>(0,L.jsx)($n,{context:t,entry:n},n.key))]})}function Fn({context:t}){let{store:e}=t;ae(e);let n=gn(Le(t)).filter(r=>!r.hidden),a=En(t);return(0,L.jsxs)(re,{context:t,style:ot,children:[(0,L.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,L.jsx)("p",{style:ve,children:n.length===0?"None of its own yet":`${n.length} ${n.length===1?"picture":"pictures"}`}),(0,L.jsx)(se,{context:t,children:"Pictures"}),(0,L.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,L.jsx)("div",{style:ii,"data-testid":"places",children:a.map(r=>(0,L.jsx)($n,{context:t,entry:r},r.key))}):null]})}function In({context:t}){let{store:e,principal:n}=t;ae(e);let a=Ge(),r=De(),[i]=st(),o=decodeURIComponent(a.as??""),[l,d]=(0,We.useState)(null),c=i.get("of"),p=i.get("filter"),m=Le(t).find(T=>T.as===o&&(!c||Z(e.schema,T.kind)===c));if(!m)return(0,L.jsxs)(re,{context:t,children:[(0,L.jsx)(se,{context:t,children:"No picture is called that."}),(0,L.jsx)("p",{style:oe,children:(0,L.jsxs)(F,{to:"/places",style:K,children:["The pictures there are ",(0,L.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]})})]});let u=J(e,m.kind),v=t.views?.resolve(m.kind,{cardinality:"many",fidelity:"full"},m.as)?.view,G=v?.flows===!0,y=v?.creates!==!1,C=je(e,m.kind,{...n?{principal:n}:{},...t.invariantContext?{context:t.invariantContext}:{}}),V=y?C.actions.affordances.map(T=>({affordance:T,mutation:e.allMutations().find(U=>U.name===T.mutation)})).filter(T=>T.mutation!==void 0):[];return(0,L.jsxs)(re,{context:t,style:ot,children:[(0,L.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,L.jsx)(se,{context:t,children:m.title}),(0,L.jsxs)("p",{style:oe,"data-testid":"place-lede",children:[Mn(e,Gt(t,m),m.across),"."]}),p&&!G?(0,L.jsxs)("p",{style:{...A,margin:0},"data-testid":"place-narrowed",children:[`Only those where ${p.split(",").map(T=>T.replace(":"," is ")).join(" and ")}. `,(0,L.jsx)(F,{to:`?${(()=>{let T=new URLSearchParams(i);return T.delete("filter"),T.toString()})()}`,style:{...K,...A},children:"Show all"})]}):null,(0,L.jsx)("p",{style:{...A,margin:0,display:"flex",flexWrap:"wrap",gap:"4px 16px"},children:Gt(t,m).map((T,U)=>(0,L.jsxs)(F,{to:`/${Z(e.schema,T)}`,style:{...K,...A},...U===0?{"data-testid":"place-as-list"}:{},children:["All ",(T===m.kind?u:J(e,T)).toLowerCase()," as a list ",(0,L.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]},T))})]}),(0,L.jsx)("div",{"data-testid":"place-lens","data-flows":G?"":void 0,style:G?{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:T=>{let U=T.target?.closest("[data-graview-pick]"),Y=U?.getAttribute("data-graview-pick"),le=U?.getAttribute("data-graview-joins");if(le)try{let I=JSON.parse(le);if(Array.isArray(I)&&I.every(Q=>typeof Q=="string")){T.preventDefault(),d({at:Ye(m),ids:I});return}}catch{}if(!Y)return;let ge=e.graph.getNode(Y);ge&&(T.preventDefault(),r(ee(e.schema,ge.kind,Y)))},children:(0,L.jsx)(Nn,{context:t,place:m,filter:p,...l?.at===Ye(m)?{chosen:l.ids}:{}})}),V.length>0?(0,L.jsx)("div",{style:{maxWidth:760,display:"grid",gap:40},"data-testid":"place-creators",children:V.map(({affordance:T,mutation:U})=>(0,L.jsxs)("section",{style:{...ne,display:"grid",gap:14},children:[(0,L.jsx)("h2",{style:te,children:U.title??U.name}),U.description?(0,L.jsx)("p",{style:{...A,margin:0,maxWidth:"58ch"},children:U.description}):null,(0,L.jsx)(Fe,{store:e,mutation:U,prefilled:T.args,open:T.open,label:T.label,...n?{principal:n}:{}})]},T.id))}):null]})}function lt(t){return t.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-|-$/g,"")}function yt(t,e={}){let[n="/",a=""]=t.split("#")[0].split("?"),r=new URLSearchParams(a);e.filter&&r.set("filter",e.filter);let i=r.toString(),o=e.section?lt(e.section):"";return`${n}${i?`?${i}`:""}${o?`#${o}`:""}`}function Xi(t,e=document){let n=lt(t);if(!n)return null;let a=[e,...[...e.querySelectorAll("[data-worker-view]")].flatMap(r=>r.shadowRoot?[r.shadowRoot]:[])];for(let r of a)for(let i of r.querySelectorAll("[id], [data-section]")){let o=i.getAttribute("data-section")??i.id;if(o===t||lt(o)===n)return i}for(let r of a)for(let i of r.querySelectorAll("h1, h2, h3, h4, h5, h6, [role=heading]"))if(lt(i.textContent??"")===n)return i;return null}function oi(t,e={}){if(typeof document>"u"||typeof requestAnimationFrame>"u")return()=>{};let n=e.frames??120,a=0,r=()=>{let i=Xi(t,e.root??document);if(i){i.hasAttribute("tabindex")||i.setAttribute("tabindex","-1"),i.scrollIntoView?.({block:"start"}),i.focus({preventScroll:!0});return}n-=1,n>0&&(a=requestAnimationFrame(r))};return a=requestAnimationFrame(()=>{a=requestAnimationFrame(r)}),()=>cancelAnimationFrame(a)}var j=D(Oe(),1);var Vt=D(Oe(),1);var Qe=D(_(),1);function si({context:t}){return pe()?(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(Ji,{context:t}),(0,Qe.jsx)(Ir,{face:"pages",on:t.quickAsk??!0})]}):null}function Ji({context:t}){let{store:e}=t,n=pe(),{pathname:a}=Se(),r=(0,Vt.useRef)(n?.setSelection);return r.current=n?.setSelection,(0,Vt.useEffect)(()=>{let i=r.current;if(!i)return;let[,o,l]=a.split("/"),d=(()=>{if(o==="places"){let p=t.views?.places().find(g=>g.as===decodeURIComponent(l??""));return p?[$e(p.kind)]:[]}let c=o?Me(e.schema,o):void 0;return c&&l?[decodeURIComponent(l)]:c?[Sa(c)]:[]})();i(c=>c.length===d.length&&c.every((p,g)=>p===d[g])?c:d)},[a]),null}var ye=D(Oe(),1);var di=D(Hi(),1);var ue=D(_(),1);var eo=(0,ye.lazy)(ka(()=>(__graviewPreload(import.meta.url,["./chunk.3IVVXVG7.js","./chunk.UGFDSE37.js","./chunk.WNKRXL3O.js","./chunk.YW2BZ2LH.js","./chunk.CYPTJNES.js","./chunk.4NCXMVPY.js","./chunk.TN4GY6LW.js","./chunk.QJYALCIW.js","./chunk.HSRGYZOR.js","./chunk.BRBY5WJT.js","./chunk.ELY2RMGE.js","./chunk.UV2TSAB4.js","./chunk.6SK2K72G.js","./chunk.NNNVB6RV.js","./chunk.7MMNMZLF.js","./chunk.67PVRVAC.js","./chunk.MJLUAGEV.js","./chunk.WNMLA4YW.js","./chunk.VUKHDZNI.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.YFW5BF6J.js","./chunk.QYWBQ5NX.js","./chunk.ENJKCSNX.js","./chunk.LJE5J3JK.js","./chunk.X2OLXTRL.js","./chunk.JDRM6XXD.js","./chunk.GZHZLJBF.js","./chunk.GXPBRYSR.js","./chunk.NV6IZJKA.js","./chunk.OJGHDWI6.js","./chunk.7OLVQ2FZ.js","./chunk.NOZEHLWG.js","./chunk.UVLPVHID.js","./chunk.QXARGANF.js","./chunk.DNNL7F3P.js","./chunk.HBBVVALN.js","./chunk.AJZBJBMO.js"]),import("./chunk.24E4R4ZH.js")).then(t=>({default:t.TakeBack}))));function to({context:t,docked:e,at:n}){let{store:a}=t,r=ae(a),[i]=(0,ye.useState)(()=>a.batches().length),o=(0,ye.useRef)(!1);return o.current||=r>0||!e&&i>0,o.current?(0,ue.jsx)(ye.Suspense,{fallback:null,children:(0,ue.jsx)(eo,{context:t,docked:e,at:n,since:i})}):null}function no(t,e,n){let{store:a,principal:r,embedded:i}=t;(0,ye.useEffect)(()=>{if(!n)return;let o=l=>{if(!Br(l))return;let d=l.target,c=d instanceof Node&&e.current?.contains(d),p=d===document.body||d===document.documentElement||d===document;if(!(!c&&!(p&&!i))&&Kr(a,r)){l.preventDefault();try{qr(a,r)}catch{}}};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[a,r,i,e,n])}function ci({context:t,registry:e,root:n,children:a}){let r=(0,ye.useMemo)(Xr,[]),i=e?.without()??new Set;return no(t,n,!i.has("undo")),(0,ue.jsxs)(Rn.Provider,{value:r,children:[(0,ue.jsx)(ao,{context:t,placed:r,without:i}),a]})}function ao({context:t,placed:e,without:n}){let[a,r]=(0,ye.useState)(!1);(0,ye.useLayoutEffect)(()=>r(!0),[]);let i=Ln(e,"find"),o=Ln(e,"undo"),l=Se(),d=mr();if(!a)return null;let c=l.pathname.split("/").filter(Boolean),g=(c.length===1?Me(t.store.schema,c[0]):void 0)!==void 0;return(0,ue.jsxs)(ue.Fragment,{children:[!i&&!n.has("find")&&d?(0,di.createPortal)((0,ue.jsx)(li,{context:t,narrowsLists:g}),d.slot):null,!i&&!n.has("find")&&!d?(0,ue.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,ue.jsx)(li,{context:t,narrowsLists:g})}):null,!o&&!n.has("undo")?(0,ue.jsx)(to,{context:t,docked:!0,at:l.pathname+l.search}):null,d?.own&&!n.has("undo")?(0,ue.jsx)(zr,{context:t,own:d.own}):null]})}function li({context:t,narrowsLists:e}){return(0,ue.jsx)(Rn.Provider,{value:null,children:(0,ue.jsx)(Tn,{context:t,narrowsLists:e})})}var ie=D(Oe(),1);var Pe=D(_(),1),ro=500,io=10;function Ut(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 oo(t){let e=typeof getSelection=="function"?getSelection():null;return e!==null&&!e.isCollapsed&&e.containsNode(t,!0)}function pi(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 ui({context:t,root:e,children:n}){return pe()===null?(0,Pe.jsx)(Pe.Fragment,{children:n}):(0,Pe.jsx)(so,{context:t,root:e,children:n})}function so({context:t,root:e,children:n}){let{setMenuAt:a}=La(),{store:r}=t,i=r.schema,o=De(),{pathname:l,search:d}=Se(),c=_r("/").replace(/\/$/,""),p=(0,ie.useCallback)((k,x)=>t.views?.places().find(R=>R.as===k&&(x===null||R.kind===x)),[t.views]),g=(0,ie.useCallback)((k,x)=>{let[R="",M,E]=k.split("/").filter(Boolean).map(X=>{try{return decodeURIComponent(X)}catch{return X}});if(E!==void 0)return null;if(R==="places"&&M!==void 0){let X=p(M,new URLSearchParams(x).get("of"));return X?{face:"pages",place:X.as,about:[$e(X.kind)],title:X.title}:null}let z=Me(i,R);return z?M===void 0?{face:"pages",about:[$e(z)],title:at(i,z)}:r.graph.getNode(M)?{face:"pages",on:M,about:[M]}:null:null},[i,r,p]),m=(0,ie.useCallback)(k=>{let x=k.href;try{let R=new URL(x,location.href);if(R.origin===location.origin&&(c===""||R.pathname===c||R.pathname.startsWith(`${c}/`))){let M=g(R.pathname.slice(c.length),R.search);if(M)return{...M,href:x}}}catch{}return{face:"pages",about:[],href:x}},[c,g]),u=(0,ie.useCallback)(()=>g(l,d)??{face:"pages",about:[]},[g,l,d]),v=(0,ie.useCallback)(k=>{let x=u(),R=k.closest("[data-graview-field]")?.getAttribute("data-graview-field");if(R&&x.on!==void 0&&k.closest("[data-graview-pick], a[href]")===null)return{...x,field:R};let M=k.closest("[data-graview-act]")?.getAttribute("data-graview-act");if(M)return{...x,act:M};let E=k.closest("[data-graview-pick]")?.getAttribute("data-graview-pick");if(E&&r.graph.getNode(E))return{face:"pages",on:E,about:[E],href:`${c}${ee(i,r.graph.getNode(E).kind,E)}`};let z=k.closest("a[href]");if(z)return m(z);let X=k.closest("[data-graview-record]")?.getAttribute("data-graview-record");return X&&r.graph.getNode(X)?{face:"pages",on:X,about:[X]}:x},[u,m,r,i,c]),G=(0,ie.useCallback)(k=>{let x=e.current;if(x===null||!x.contains(k)||Ut(k)||k.closest("[data-graview-popover]"))return null;let R=v(k);return{face:"pages",on:R.on,about:R.about??[],field:R.field,place:R.place,href:R.href,act:R.act,element:pi(k)}},[v,e]),y=(0,ie.useCallback)((k,x,R)=>{let M=v(k);a({...M,x:Math.round(x),y:Math.round(R),returnTo:pi(k)})},[v,a]),C=(0,ie.useCallback)(k=>{let x=k.getBoundingClientRect();y(k,x.left+Math.min(16,x.width/2),Math.min(x.bottom,x.top+36))},[y]),V=(0,ie.useRef)(0),T=(0,ie.useRef)(null),U=(0,ie.useRef)(!1),Y=()=>{T.current&&clearTimeout(T.current.timer),T.current=null};(0,ie.useEffect)(()=>Y,[]),(0,ie.useEffect)(()=>{let k=x=>{if(x.defaultPrevented||!(x.key==="ContextMenu"||x.key==="F10"&&x.shiftKey))return;let R=e.current,M=x.target instanceof Element?x.target:null,E=M===null||M===document.body||M===document.documentElement,z=R!==null&&M!==null&&R.contains(M);if(!z&&!(E&&document.querySelector("[data-graview-face='pages']")===R)||Ut(M)||M?.closest("[data-graview-popover]"))return;x.preventDefault(),V.current=Date.now();let X=z&&M instanceof HTMLElement?M:R?.querySelector("[data-graview-page-title], main h1, main")??null;X&&C(X)};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[e,C]);let le=(0,ie.useMemo)(()=>k=>{if(k.face!=="pages")return null;let x=[],R=k.on===void 0?void 0:r.graph.getNode(k.on),M=k.place===void 0?void 0:t.views?.places().find(B=>B.as===k.place),E=R?void 0:k.about.length===1&&k.about[0].startsWith("aggregate:")&&!M?lo(k.about[0]):void 0,z=R?ee(i,R.kind,R.id):M?xe(t,M):E?`/${Z(i,E)}`:void 0,X=z!==void 0&&l===z.split("?")[0];z!==void 0&&!X&&x.push({id:"open",label:"Open",run:()=>o(z)});let f=z!==void 0?`${c}${z}`:k.href;f!==void 0&&x.push({id:"open-in-a-new-tab",label:"Open in a new tab",run:()=>void window.open(f,"_blank","noopener")});let N=R?`#focus=${encodeURIComponent(R.id)}`:M?`#focus=${encodeURIComponent($e(M.kind))}&view=${encodeURIComponent(M.as)}`:E?`#focus=${encodeURIComponent($e(E))}`:void 0;if(N!==void 0&&(t.overview||!t.embedded)){let B=t.overview;x.push({id:"in-the-scene",label:"Show in the scene",run:()=>B?B(N):location.assign(`${t.sceneHref??"/"}${N}`)})}return R===void 0&&k.href===void 0&&x.push({id:"find",label:"Find\u2026",run:()=>{let B=e.current?.querySelector('[data-testid="nav-find"]')??document.querySelector('[data-testid="nav-find"]');B&&B.offsetParent!==null?B.focus():o("/search")}}),x.length>0?{id:"pages",items:x}:null},[r,i,t,l,c,o,e]),ge=(0,ie.useMemo)(()=>k=>{if(k.face!=="pages"||k.field===void 0||k.on===void 0)return null;let x=r.graph.getNode(k.on),R=k.element?.closest("[data-graview-field]")??e.current?.querySelector(`[data-graview-field="${CSS.escape(k.field)}"]`);return!x||!(R instanceof HTMLElement)||!R.hasAttribute("data-graview-editable")?null:{id:"field",at:"start",items:[{id:"change-field",label:`Change \u201C${oa(i.tryDefinition(x.kind),k.field)}\u201D`,run:()=>R.click()}]}},[r,i,e]),I=Wr(),Q=rr(),de=(0,ie.useMemo)(()=>[ge,le,...Q?[Q]:[],...I?[I]:[]],[ge,le,Q,I]);return(0,Pe.jsxs)(Xa,{sections:de,children:[(0,Pe.jsx)("div",{"data-graview-menu-ground":"",style:{display:"contents"},onContextMenu:k=>{let x=k.target;k.shiftKey||Ut(x)||oo(x)||(k.preventDefault(),!x.closest("[data-graview-popover]")&&(Date.now()-V.current<700||(k.clientX===0&&k.clientY===0&&x instanceof HTMLElement?C(x):y(x,k.clientX,k.clientY))))},onPointerDown:k=>{if(U.current=!1,k.pointerType==="mouse"||!k.isPrimary)return;let x=k.target;if(Ut(x)||x.closest("[data-graview-choose], [data-graview-popover]"))return;Y();let{clientX:R,clientY:M}=k;T.current={x:R,y:M,timer:setTimeout(()=>{T.current=null,U.current=!0,V.current=Date.now(),y(x,R,M)},ro)}},onPointerMove:k=>{let x=T.current;x&&Math.hypot(k.clientX-x.x,k.clientY-x.y)>io&&Y()},onPointerUp:Y,onPointerCancel:Y,onClickCapture:k=>{U.current&&(U.current=!1,k.preventDefault(),k.stopPropagation())},children:n}),(0,Pe.jsx)(co,{openAt:C,readyAt:G}),(0,Pe.jsx)(Hr,{placement:"page"}),(0,Pe.jsx)(ir,{})]})}function lo(t){let e=t.slice(10).split("+");return e.length===1&&e[0]?e[0]:void 0}function co({openAt:t,readyAt:e}){return(0,Pe.jsx)("span",{"data-graview-menu-home":"",tabIndex:-1,onFocus:n=>{if(n.target!==n.currentTarget)return;let a=n.currentTarget.closest("[data-graview-face]"),r=a?.querySelector("[data-graview-page-title]")??a?.querySelector("main h1, main")??null;r&&(r.hasAttribute("tabindex")||r.setAttribute("tabindex","-1"),r.focus({preventScroll:!0}))},style:{position:"absolute",width:0,height:0,overflow:"hidden"},children:(0,Pe.jsx)(Fr,{placement:"menu",openActs:t,aimAt:e})})}var H=D(_(),1);function gi(t,e){return e==="*"?{label:"anything",path:null}:{label:J(t,e),path:`/${Z(t.schema,e)}`}}function po({context:t,relation:e}){let{store:n}=t,a=gi(n,e.from),r=gi(n,e.to),i=o=>o.path?(0,H.jsx)(F,{to:o.path,style:{...be,fontWeight:550},children:o.label}):(0,H.jsx)("span",{children:o.label});return(0,H.jsxs)("li",{"data-testid":"relation","data-relation":e.edgeKind,style:{display:"grid",gridTemplateColumns:"30px minmax(0, 1fr) auto",gap:12,alignItems:"baseline"},children:[(0,H.jsx)(Dr,{edgeKind:e.edgeKind,...t.brand?.kit?{kit:t.brand.kit}:{}}),(0,H.jsxs)("span",{style:{display:"grid",gap:1},children:[(0,H.jsxs)("span",{children:[i(a)," ",(0,H.jsxs)("span",{style:A,"data-graview-speaks-ids":"",children:[we(e.edgeKind)," \u2192"]})," ",i(r)]}),e.description||e.inverse?(0,H.jsxs)("span",{style:A,children:[e.description?Ce(e.description):null,e.description&&e.inverse?" \xB7 ":null,e.inverse?`from the other end, ${e.inverse}`:null]}):null]}),r.path?(0,H.jsx)(F,{to:`${r.path}?with=${encodeURIComponent(e.edgeKind)}`,style:{...K,...A,fontVariantNumeric:"tabular-nums",display:"inline-block",minWidth:24,minHeight:24,textAlign:"center"},title:`The ${r.label.toLowerCase()} that have this`,children:e.count}):(0,H.jsx)("span",{style:{...A,fontVariantNumeric:"tabular-nums"},children:e.count})]})}function mi({context:t,heading:e=!0}){let{store:n}=t,a=new Set(Be(n,t.principal)),r=ze(n).relations.filter(i=>a.has(i.from)&&(i.to==="*"||a.has(i.to)));return r.length===0?null:(0,H.jsxs)("section",{style:{...ne,display:"grid",gap:12},"data-testid":"kind-map",children:[e?(0,H.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[(0,H.jsx)("h2",{style:te,children:(0,H.jsx)(F,{to:"/map",style:be,children:"Connections"})}),(0,H.jsx)("span",{style:A,children:r.length===1?"1 relation":`${r.length} relations`})]}):null,(0,H.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:r.map(i=>(0,H.jsx)(po,{context:t,relation:i},`${i.edgeKind}|${i.from}|${i.to}`))})]})}function Dn({context:t}){let{store:e}=t;ae(e);let n=new Set(Be(e,t.principal)),a=ze(e),r=a.relations.filter(i=>n.has(i.from));return(0,H.jsxs)(re,{context:t,children:[(0,H.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,H.jsx)("p",{style:ve,children:r.length===0?"No relations":`${r.length} ${r.length===1?"relation":"relations"}`}),(0,H.jsx)(se,{context:t,children:"Connections"}),(0,H.jsx)("p",{style:oe,children:r.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,H.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"6px 18px"},"data-testid":"map-kinds",children:a.kinds.filter(i=>n.has(i.kind)).map(i=>(0,H.jsxs)("li",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[(0,H.jsx)(fe,{kind:i.kind,brand:t.brand,schema:e.schema,size:7}),(0,H.jsx)(F,{to:`/${Z(e.schema,i.kind)}`,style:K,children:i.plural}),(0,H.jsx)("span",{style:A,children:i.count})]},i.kind))}),(0,H.jsx)(mi,{context:t,heading:!1})]})}function fi({context:t}){let n=[...pe()?.robots.values()??[]].filter(r=>r.mode==="asking"&&r.say);if(n.length===0)return null;let{store:a}=t;return(0,H.jsxs)("section",{style:{...ne,display:"grid",gap:10},"data-testid":"seat-questions",children:[(0,H.jsx)("h2",{style:te,children:n.length===1?"The seat asked something":`The seat asked ${n.length} things`}),(0,H.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:8},children:n.map(r=>{let i=r.at?a.graph.getNode(r.at):void 0;return(0,H.jsxs)("li",{style:{display:"grid",gap:2},children:[(0,H.jsx)("span",{children:r.say}),i?(0,H.jsxs)(F,{to:ee(a.schema,i.kind,i.id),style:{...K,...A},children:[me(a.schema.tryDefinition(i.kind),i)," \u2192"]}):null]},r.participant)})})]})}var q=D(_(),1);function Wn({context:t}){let{principal:e}=t,{store:n,brand:a,invariantContext:r}=t;ae(n);let i=n.violations(r),o=`${i.length===1?"A rule is broken":"Rules are broken"} \u2014 see what, and what would fix it`,l=[...n.log.all()].slice(-5).reverse(),c=Ht(t).map(C=>({kind:C,members:n.graph.nodesOfKind(C).filter(V=>nt(n.schema.tryDefinition(C),V))})),p=c.filter(C=>C.members.length>0),g=c.map(C=>({entry:C,creator:n.allMutations().find(V=>(V.creates??[]).includes(C.kind)&&n.permits({name:V.name,args:{}},t.principal).ok)})).find(C=>C.creator!==void 0),m=p.length===0?"Nothing here yet.":`${p.map(C=>Pt(n.schema,C.kind,C.members.length)).join(", ").replace(/, ([^,]*)$/," and $1")}.`,u=t.views?.homeView?.(),v=n.schema.kinds.some(C=>n.graph.nodesOfKind(C).length>0);if(u&&v){let C=a?.subtitle?(0,q.jsx)("p",{style:{...A,margin:0},"data-testid":"app-subtitle",children:a.subtitle}):null,V=u[Symbol.for("graview.home-blocks")]===!0;return(0,q.jsx)(re,{context:t,style:ot,children:(0,q.jsxs)("div",{style:{display:"grid",gap:12},"data-testid":"home-view",children:[V?null:C,i.length>0?(0,q.jsx)(F,{to:"/problems",style:{...K,color:"var(--graview-warn)"},children:o}):null,(0,q.jsx)(Er.Provider,{value:V?C:null,children:(0,q.jsx)(u,{cardinality:"many",fidelity:"full",mode:"fullscreen",selected:!1})})]})})}let G=new Set(Be(n,t.principal)),y=ze(n).relations.filter(C=>G.has(C.from)&&(C.to==="*"||G.has(C.to)));return(0,q.jsxs)(re,{context:t,style:ot,children:[(0,q.jsxs)("header",{style:{display:"grid",gap:12},children:[a?.subtitle?(0,q.jsx)("p",{style:{...A,margin:0},"data-testid":"app-subtitle",children:a.subtitle}):null,(0,q.jsx)(se,{context:t,"data-testid":"standing",children:m}),(0,q.jsxs)("p",{style:{...oe,display:"grid",gap:4},"data-testid":"standing-card",children:[p.length===0&&g?(0,q.jsxs)("span",{children:["Begin with \u201C",g.creator?.title??g.creator?.name,"\u201D, under"," ",(0,q.jsx)(F,{to:`/${Z(n.schema,g.entry.kind)}`,style:K,children:J(n,g.entry.kind)}),"."]}):null,i.length===0?(0,q.jsx)("span",{children:"All rules hold."}):(0,q.jsx)(F,{to:"/problems",style:{...K,color:"var(--graview-warn)"},children:o})]})]}),(0,q.jsx)(On,{context:t}),(0,q.jsxs)("section",{style:{...ne,display:"grid",gap:14},"data-testid":"kinds",children:[(0,q.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[(0,q.jsx)("h2",{style:te,children:"What is here"}),y.length>0?(0,q.jsxs)(F,{to:"/map",style:{...K,...A,marginLeft:"auto"},"data-testid":"map-link",children:["Connections \xB7 ",y.length===1?"1 relation":`${y.length} relations`," ",(0,q.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]}):null]}),(0,q.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"8px 10px"},children:c.map(({kind:C,members:V})=>(0,q.jsx)("li",{style:{maxWidth:"100%"},children:(0,q.jsxs)(F,{to:`/${Z(n.schema,C)}`,style:{...be,flexWrap:"wrap",gap:8,padding:"6px 14px 6px 10px",borderRadius:8,border:"1px solid var(--graview-edge-bright)",background:"var(--graview-panel)"},children:[(0,q.jsx)(fe,{kind:C,brand:a,schema:n.schema,size:7}),(0,q.jsx)("span",{style:{fontWeight:550,overflowWrap:"anywhere"},children:J(n,C)}),(0,q.jsx)("span",{style:{...A,fontVariantNumeric:"tabular-nums"},children:V.length===0?"none yet":ut(V.length)})]})},C))})]}),l.length>0?(0,q.jsxs)("section",{style:{...ne,display:"grid",gap:10},children:[(0,q.jsx)("h2",{style:te,children:"Recently"}),(0,q.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:l.map(C=>(0,q.jsxs)("li",{style:A,children:[(0,q.jsx)("span",{style:{color:"var(--graview-ink)"},children:C.intent})," \u2014 ",mt(C,e,{graph:n.graph,schema:n.schema,...t.seats?{seats:t.seats}:{},...t.people?{people:t.people}:{}})]},C.id))})]}):null]})}var Ne=D(Oe(),1);var Ze=D(_(),1);function jt({context:t,withheld:e,style:n,testId:a}){let r=pe(),i=fa(e,t.signIn??r?.signIn);return i?(0,Ze.jsx)("p",{style:{...n,margin:0},children:(0,Ze.jsx)("button",{type:"button","data-testid":"sign-in",onClick:()=>i.run(),style:ke,children:i.label})}):e.length===0?null:(0,Ze.jsx)("ul",{style:{...n,margin:0,padding:0,listStyle:"none",display:"grid",gap:4},...a?{"data-testid":a}:{},children:e.map(o=>(0,Ze.jsxs)("li",{style:A,children:[(0,Ze.jsx)("s",{children:o.label})," \u2014 ",o.refusal.message]},o.id))})}var $=D(_(),1);function Hn({context:t}){let{store:e,brand:n,principal:a,invariantContext:r}=t;ae(e);let[i]=st(),o=i.get("q")??"",l=typeof r?.today=="string"?r.today:void 0,d=kr(e,o,{...a?{principal:a}:{},places:Le(t),flagged:new Set(e.violations(r).flatMap(u=>u.nodeIds)),...l?{today:l}:{},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))],m=o.trim();return(0,$.jsxs)(re,{context:t,children:[(0,$.jsx)("style",{children:Dt}),(0,$.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,$.jsx)("p",{style:ve,children:"Search"}),(0,$.jsx)(se,{context:t,"data-testid":"search-heading",children:m.length===0?"Find anything by its name":d.hits.length===0?(0,$.jsxs)($.Fragment,{children:["Nothing here is called \u201C",m,"\u201D."]}):(0,$.jsxs)($.Fragment,{children:[uo(e,d.byKind)," for \u201C",m,"\u201D"]})}),m.length>0?(0,$.jsxs)("p",{style:{...A,margin:0},"data-testid":"search-searched",children:[Nt(e.schema,d.searched),d.conditions.filter(u=>u.key!=="is"&&u.admittedBy.length<d.searched.kinds.length).map(u=>(0,$.jsxs)("span",{children:[" ",u.key,":",u.value," narrows"," ",u.admittedBy.length===0?"nothing here":u.admittedBy.map(v=>J(e,v).toLowerCase()).join(" and "),"."]},`${u.key}:${u.value}`))]}):(0,$.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,$.jsx)("code",{children:"done:false"})," and the like narrow as a list does, and ",(0,$.jsx)("code",{children:"is:any"})," includes what is past."]})]}),p.length>0?(0,$.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},"data-testid":"search-named",children:p.map(u=>(0,$.jsx)("li",{"data-testid":"search-hit","data-about":u.about,children:u.about==="kind"?(0,$.jsxs)(F,{to:`/${Z(e.schema,u.kind)}`,style:K,children:[u.label,u.count>0?(0,$.jsxs)("span",{style:A,children:[" \xB7 ",u.count," match"]}):null]}):u.about==="place"?(0,$.jsxs)(F,{to:xe(t,u),style:K,children:["Go to ",u.title]}):u.about==="rule"?(0,$.jsxs)(F,{to:"/problems",style:K,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,$.jsxs)("section",{className:"graview-list",style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",minWidth:0},"data-testid":"search-group","data-kind":u,children:[(0,$.jsxs)("h2",{className:"graview-group-head",style:{alignItems:"center"},children:[(0,$.jsx)(fe,{kind:u,brand:n,schema:e.schema,size:8}),(0,$.jsx)(F,{to:`/${Z(e.schema,u)}?${new URLSearchParams({q:m}).toString()}`,style:K,"data-testid":"search-kind-link",children:J(e,u)}),(0,$.jsx)("span",{children:d.byKind[u]})]}),(0,$.jsx)("ul",{className:"graview-rows",children:c.filter(v=>v.kind===u).map(v=>(0,$.jsxs)("li",{"data-testid":"search-hit","data-about":"node",className:"graview-row",children:[(0,$.jsxs)(F,{to:ee(e.schema,u,v.id),className:"graview-row-title",...v.label.length>60?{title:v.label}:{},children:[v.flagged?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)("span",{role:"img","aria-label":"Breaks a rule:",style:{color:"var(--graview-warn)"},children:"\u26A0"})," "]}):null,v.label]}),v.apart||!v.current?(0,$.jsx)("span",{className:"graview-row-glance",children:[v.apart,v.current?"":"past"].filter(Boolean).join(" \xB7 ")}):null,(0,$.jsx)(zt,{why:v.why})]},v.id))})]},u)),m.length>0?(0,$.jsx)(go,{asked:m}):null,m.length>0&&d.hits.length===0?(0,$.jsx)(hi,{store:e,kinds:d.searched.kinds,words:d.words,...a?{principal:a}:{},...r?{invariantContext:r}:{}}):null]})}function zt({why:t}){return t.strength==="near"?(0,$.jsxs)("span",{style:A,"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,$.jsxs)("span",{style:A,"data-testid":"search-why",children:[t.reading,": ",t.fragment]})}function uo(t,e){let n=Object.entries(e).map(([a,r])=>`${r} ${r===1?Ke(t.schema.tryDefinition(a),a):J(t,a).toLowerCase()}`);return n.length===0?"Found":n.length===1?Ce(n[0]):Ce(`${n.slice(0,-1).join(", ")} and ${n[n.length-1]}`)}function yi(t,e,n={}){let a=[];for(let r of e){let i=je(t,r,{...n.principal?{principal:n.principal}:{},...n.invariantContext?{context:n.invariantContext}:{}});for(let o of _t(t,r,i.actions.affordances))a.some(l=>l.mutation.name===o.mutation.name)||a.push(o)}return a}function _t(t,e,n){let a=t.schema.tryDefinition(e)?.fieldRoles?.label,r=[];for(let i of n){let o=t.allMutations().find(c=>c.name===i.mutation);if(!o||!o.creates?.includes(e)||r.some(c=>c.mutation.name===o.name))continue;let l=Mt(o.input).map(c=>c.name),d=l.includes("label")?"label":a&&l.includes(a)?a:void 0;!d||i.args[d]!==void 0||r.push({kind:e,affordance:i,mutation:o,arg:d})}return r}function hi({store:t,kinds:e,words:n,principal:a,invariantContext:r}){let i=yi(t,e,{...a?{principal:a}:{},...r?{invariantContext:r}:{}});return i.length===0||n.trim().length===0?null:(0,$.jsx)("div",{style:{display:"grid",gap:24},"data-testid":"search-to-create",children:i.map(({kind:o,affordance:l,mutation:d,arg:c})=>(0,$.jsxs)("section",{style:{...ne,display:"grid",gap:14},children:[(0,$.jsxs)("h2",{style:te,children:[Ce(sa(Ke(t.schema.tryDefinition(o),o)))," called \u201C",n,"\u201D"]}),(0,$.jsx)(Fe,{store:t,mutation:d,prefilled:l.args,open:l.open,initial:{[c]:n},...a?{principal:a}:{}})]},`${l.id}|${n}`))})}function go({asked:t}){let e=pe();return e?(0,$.jsx)(mo,{asked:t,desk:e.aiDesk}):null}function mo({asked:t,desk:e}){return Fa(e)?(0,$.jsx)("p",{style:{margin:0},children:(0,$.jsxs)("button",{type:"button","data-testid":"search-ask",onClick:a=>Oa(e,{pointed:{about:[]},asked:t,returnTo:a.currentTarget}),style:{...K,font:"inherit",padding:0,border:0,background:"transparent",cursor:"pointer",textAlign:"start"},children:["Ask: \u2018",t,"\u2019"]})}):null}var w=D(_(),1),vi=8,bi=40;function fo(t,e){let n=e?.fields?.shape??{},a=Object.keys(n).find(r=>da(n[r])&&la(t[r]));return a===void 0?void 0:t[a]}function Kn({context:t}){let e=Ge(),n=Me(t.store.schema,e.slug??"");return n?(0,w.jsx)(ki,{context:t,kind:n}):(0,w.jsx)(re,{context:t,children:(0,w.jsx)(se,{context:t,children:"No such kind of thing here."})})}function ki({context:t,kind:e,opening:n,row:a,layout:r="list",description:i,bare:o}){let{store:l,brand:d,invariantContext:c}=t;ae(l);let[p,g]=st(),m=`list-${(0,Ne.useId)().replace(/:/g,"")}`,u=l.schema.tryDefinition(e),v=pa(p.get("archived")),G=l.graph.nodesOfKind(e,{archived:v}),y=ze(l).relations.filter(s=>s.from===e||s.to===e),C=new Set(l.violations(c).flatMap(s=>s.nodeIds)),V=wr(l.schema,hr(l.schema,yr(l.schema,e))),T=y.map(s=>s.edgeKind),U=ko(p,V,T),Y=["sort","filter","group","q","by","with","past","archived",...T].some(s=>p.has(s)),le=G.length>=bi,ge=u?.fieldRoles?.when,I=t.views?.arrangement?.()?.lists?.[e],Q=pr(I),de=cr(I?.group),k=bo(le,ge),x=n??(Q?{...k,...Q}:k),R=Y?U.arrangement:kn(x,V).arrangement,M=Q?.sort,E=R.sort&&M?.then&&R.sort.by===M.by&&R.sort.direction===M.direction?{...R,sort:M}:R,z=vr(E.query??""),X=[...E.filter??[],...z.conditions].some(s=>s.key==="is"&&(s.value==="past"||s.value==="any"))||fr(u,[...E.filter??[],...z.conditions]),f=X||!u?.lifecycle?E:{...E,filter:[...E.filter??[],{key:"is",value:"current"}]},N=new Map,B=Et(G,f,{schema:l.schema,graph:l.graph,flagged:C,...typeof c?.today=="string"?{today:c.today}:{},read:(s,h)=>{let O=N.get(s.id);return O||N.set(s.id,O=gt(l.schema,l.graph,s)),O[h]}}),Ae=de&&E.group?.by===de.by&&!E.group.bucket?V.groups.find(s=>s.key===de.by):void 0,Vn=de&&Ae&&(Ae.type==="choice"||Ae.type==="boolean")?ur(B.groups,de,{type:Ae.type,...Ae.options?{options:Ae.options}:{}}):B.groups.map(s=>({...s,closed:!1})),Un=new Set((p.get("open")??"").split(",").filter(Boolean)),Ri=!!E.query||(E.filter??[]).some(s=>s.key===de?.by),jn=s=>Ae?.type==="boolean"?s==="1"?"true":"false":s,zn=s=>s.closed&&!Ri&&!Un.has(jn(s.key)),Li=s=>{let h=new URLSearchParams(p),O=new Set(Un);O.has(s)?O.delete(s):O.add(s),O.size>0?h.set("open",[...O].join(",")):h.delete("open"),g(h,{replace:!0})},Ie=B.nodes,dt=u?.lifecycle&&!X?G.filter(s=>nt(u,s)):G,_n=G.length-dt.length,Zt=E.group?.by??null,Ti=s=>{let h=new URLSearchParams(p);for(let ce of["sort","filter","group","q","by","with","past","archived",...y.map(St=>St.edgeKind)])h.delete(ce);let O=Sr(s);for(let ce of["sort","filter","group","q","archived"])O[ce]&&h.set(ce,O[ce]);![...h.keys()].some(ce=>["sort","filter","group","q"].includes(ce))&&(n||Q||le||ge)&&h.set("sort",""),g(h)},{principal:Je}=t,Xt=je(l,e,{...Je?{principal:Je}:{},...t.invariantContext?{context:t.invariantContext}:{}}),He=Xt.actions.affordances.map(s=>({affordance:s,mutation:l.allMutations().find(h=>h.name===s.mutation)})).filter(s=>s.mutation!==void 0),Mi=Xt.actions.withheld,Jt=()=>new Set(Ie.length===0?He.map(({mutation:s})=>s.name):[]),[en,Yn]=(0,Ne.useState)(()=>({kind:e,open:Jt()}));en.kind!==e&&Yn({kind:e,open:Jt()});let Qn=s=>(en.kind===e?en.open:Jt()).has(s),Zn=(s,h)=>Yn(O=>{let ce=new Set(O.open);return h?ce.add(s):ce.delete(s),{kind:O.kind,open:ce}}),Xn=`begin-${(0,Ne.useId)().replace(/:/g,"")}`,Jn=z.words&&Ie.length===0?Object.fromEntries(_t(l,e,Xt.actions.affordances).map(s=>[s.mutation.name,s.arg])):{},et=J(l,e),wt=t.views?.lookup(e,{cardinality:"one",fidelity:"glyph"}),tn=wt!==void 0&&!rt(wt)?wt:void 0,nn=(E.group?.bucket??"day")==="day"?E.group?.by:void 0,an=(E.filter??[]).map(s=>s.key),Ni=an.filter(s=>an.indexOf(s)===an.lastIndexOf(s)&&/choice|boolean/.test(V.filters.find(h=>h.key===s)?.type??"")),rn=s=>{let h={...u?.computed?gt(l.schema,l.graph,s):s};nn&&!String(h[nn]).includes("T")&&delete h[nn];for(let O of Ni)delete h[O];return h},vt=s=>{let h=me(u,s);if(a)return(0,w.jsxs)("li",{"data-testid":"record-row","data-graview-record":s.id,style:{minWidth:0},...cn(s.id),children:[dn(s,h),a(s,{label:h,href:ee(l.schema,e,s.id),flagged:C.has(s.id),glance:Wt(rn(s),u,h)})]},s.id);if(tn){let pn=It(wt,s,l.graph),Di=Object.fromEntries(Object.entries(rn(s)).filter(([Wi])=>!pn?.fields.has(Wi))),ra=pn?Wt(Di,u,pn.title??h):"";return(0,w.jsxs)("li",{"data-testid":"record-row","data-graview-record":s.id,style:{position:"relative",display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:16,rowGap:2,paddingBlock:10,borderTop:"1px solid var(--graview-edge)"},...cn(s.id),children:[dn(s,h),(0,w.jsx)("div",{style:{flex:"1 1 14rem",minWidth:0},children:(0,w.jsx)(tn,{node:s,cardinality:"one",fidelity:"glyph",mode:"fullscreen",selected:!1,...C.has(s.id)?{flagged:[s.id]}:{}})}),ra?(0,w.jsx)("span",{style:{...A,flex:"0 1 auto",minWidth:0,overflowWrap:"anywhere"},"data-testid":"record-glance",children:ra}):null,(0,w.jsx)(Po,{to:ee(l.schema,e,s.id),label:C.has(s.id)?`${h} \u2014 implicated in a problem`:h})]},s.id)}let O=Wt(rn(s),u,h),ce=z.words?br(u,s,z.words):void 0,St=le?void 0:Za(s,u),xt=fo(s,u),aa=(0,w.jsxs)(F,{to:ee(l.schema,e,s.id),className:"graview-row-title",...h.length>60?{title:h}:{},children:[C.has(s.id)?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)("span",{role:"img","aria-label":"Breaks a rule:",style:{color:"var(--graview-warn)"},children:"\u26A0"})," "]}):null,h]});return(0,w.jsxs)("li",{className:"graview-row","data-graview-record":s.id,...cn(s.id),children:[dn(s,h),St?(0,w.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,minWidth:0},children:[(0,w.jsx)(qe,{as:"thumb",file:St}),aa]}):aa,O||xt?(0,w.jsxs)("span",{className:"graview-row-glance",children:[O,O&&xt?" \xB7 ":null,xt?(0,w.jsx)($t,{address:xt}):null]}):null,ce?(0,w.jsx)(zt,{why:ce}):null]},s.id)},on=Le(t).filter(s=>s.kind===e),ea=I?.filters,Ei=(E.filter??[]).some(s=>s.key!=="is"||s.value!=="any"),$i=!!(E.sort||E.group||E.query||Ei),Oi=dt.length>=vi||Y&&$i,Ee=E.sort?V.sorts.find(s=>s.key===E.sort.by):void 0,sn=Ee?.type==="date"||Ee!==void 0&&Ee.key===ge,ta=le&&!B.grouped&&Ee&&(Ee.about==="label"||Ee.type==="text"||sn)?s=>{let h=Ee.about==="label"?me(u,s):s[Ee.key];if(typeof h!="string"||h.length===0)return sn?"No date":"#";if(sn)return h.slice(0,4);let O=h.trim().charAt(0).toLocaleUpperCase();return/\p{L}/u.test(O)?O:"#"}:void 0,Ue=ta?Ie.reduce((s,h)=>{let O=ta(h);return s.at(-1)?.key===O?s.at(-1).nodes.push(h):s.push({key:O,nodes:[h]}),s},[]):void 0,na=B.grouped&&Zt?Vn.flatMap(s=>zn(s)?[]:s.nodes):Ue&&Ue.length>1?Ue.flatMap(s=>s.nodes):Ie,ln=(0,Ne.useMemo)(()=>na.map(s=>s.id),[na.map(s=>s.id).join(`
|
|
109
|
+
`)]),Te=Cr(ln),ct=(Je?l.permittedMutations(Je):l.permittedMutations()).some(s=>{let h=s.subject?.kinds;return h!==void 0&&(h==="*"||h.includes(e))}),dn=(s,h)=>ct?(0,w.jsx)("span",{className:"graview-choose-at",children:(0,w.jsx)("input",{...Te.boxProps(s.id,h),onPointerEnter:Sn,onFocus:Sn})}):null,cn=s=>ct?{"data-graview-choose":s}:{},Fi=(0,Ne.useCallback)(s=>{Te.choose(s),requestAnimationFrame(()=>{let h=Te.list.current;((s[0]===void 0?null:h?.querySelector(`[data-graview-choose-box="${CSS.escape(s[0])}"]`))??h)?.focus({preventScroll:!0})})},[Te]),tt=r==="grid"?{margin:0,padding:0,listStyle:"none",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 15rem), 1fr))",alignItems:"start",gap:12}:a||tn?{margin:0,padding:0,listStyle:"none",display:"grid",gap:a&&r==="list"?6:0}:void 0,bt=tt?void 0:"graview-rows",pt=s=>`list-at-${s.replace(/[^\p{L}\p{N}]/gu,"_")}`,kt=y.map(s=>{let h=s.from===e?s.to:s.from,O=s.from===e?s.description:s.inverse??s.description;return{relation:s,far:h,words:O}}),Ii=new Set(kt.map(s=>(s.words??"").toLowerCase()).filter((s,h,O)=>s&&O.indexOf(s)!==h));return(0,w.jsxs)(o?vo:re,{context:t,children:[(0,w.jsxs)("div",{style:{display:"grid",gap:12},children:[(0,w.jsxs)("header",{style:{display:"grid",gap:4},children:[(0,w.jsxs)("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",columnGap:10,rowGap:4,minWidth:0},children:[(0,w.jsx)(fe,{kind:e,brand:d,schema:l.schema,size:8}),(0,w.jsx)(se,{context:t,children:et}),He.length>0?(0,w.jsx)("span",{style:{marginLeft:"auto",display:"flex",flexWrap:"wrap",columnGap:14,rowGap:8},"data-testid":"beginnings-open",children:He.map(({affordance:s,mutation:h})=>(0,w.jsx)(So,{name:h.name,title:h.title??h.name,panel:`${Xn}-${h.name}`,open:Qn(h.name),onOpen:O=>Zn(h.name,O)},s.id))}):null]}),i??u?.description?(0,w.jsx)("p",{style:oe,children:i??u?.description}):null,kt.length>0||on.length>0?(0,w.jsxs)("p",{style:{...A,margin:0,display:"flex",flexWrap:"wrap",columnGap:18,rowGap:2},"data-testid":"kind-related",children:[kt.length>0?(0,w.jsxs)("span",{"data-testid":"kind-relations",children:["Related:"," ",kt.map(({relation:s,far:h,words:O},ce)=>(0,w.jsxs)("span",{"data-relation":s.edgeKind,children:[ce>0?(0,w.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,h==="*"?Ce(O??we(s.edgeKind)):(0,w.jsx)(F,{to:`/${Z(l.schema,h)}`,style:K,title:J(l,h),children:O&&Ii.has(O.toLowerCase())?`${Ce(O)}: ${J(l,h).toLowerCase()}`:Ce(O??J(l,h))})]},`${s.edgeKind}|${s.from}|${s.to}`))]}):null,on.length>0?(0,w.jsxs)("span",{"data-testid":"kind-pictures",children:["Also as:"," ",on.map((s,h)=>(0,w.jsxs)("span",{children:[h>0?(0,w.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,(0,w.jsx)(F,{to:xe(t,s),style:K,children:s.title})]},Ye(s)))]}):null]}):null]}),He.length>0?(0,w.jsx)("div",{style:{display:"contents"},"data-testid":"beginnings",children:He.map(({affordance:s,mutation:h})=>{let O=!!(Jn[h.name]&&Ie.length===0);return(0,w.jsx)(xo,{name:h.name,id:`${Xn}-${h.name}`,description:h.description,open:Qn(h.name),onClose:()=>Zn(h.name,!1),children:(0,w.jsx)(Fe,{store:l,mutation:h,prefilled:s.args,open:s.open,...O?{initial:{[Jn[h.name]]:z.words}}:{},...t.principal?{principal:t.principal}:{}},O?`${h.name}|${z.words}`:h.name)},s.id)})}):null,U.dropped.length>0?(0,w.jsxs)("p",{style:{...A,margin:0},"data-testid":"list-dropped",children:["This link asked for ",U.dropped.join(", "),", which ",et.toLowerCase()," cannot be arranged by; the rest is shown."]}):null,dt.length>0?(0,w.jsx)(Ar,{schema:l.schema,graph:l.graph,kind:e,arrangement:E,onChange:Ti,kept:{shown:Ie.length,of:dt.length},noun:{one:Ke(u,e),many:et.toLowerCase()},...Oi?{}:{allow:!1},...ea?{filters:ea}:{},offers:V,chips:{nodes:dt,flagged:C,...typeof c?.today=="string"?{today:c.today}:{}},query:t.framed===!0&&t.barAbove!==!0}):null,(0,w.jsx)("style",{children:Dt}),ct?(0,w.jsx)("style",{children:Rr+wo}):null,(0,w.jsx)("div",{className:"graview-list",...ct?{...Te.listProps,ref:Te.list,tabIndex:-1,"data-graview-choosable":"","aria-label":Te.chosen.length>0?`${et}, ${Te.chosen.length} chosen`:et,role:"group"}:{},children:Ie.length===0&&z.words?(0,w.jsxs)("p",{style:oe,"data-testid":"none-yet",children:["Nothing here is called \u201C",z.words,"\u201D."," ",(0,w.jsx)("span",{style:A,"data-testid":"list-searched",children:Nt(l.schema,{kinds:[e],past:X})})," ",(0,w.jsx)(F,{to:"?",style:K,children:"Show every one"})]}):Ie.length===0?(0,w.jsxs)("p",{style:oe,"data-testid":"none-yet",children:[E.filter?.length||E.query?"None of them.":"None yet",!E.filter?.length&&!E.query&&He.length>0?` \u2014 the first one starts above, with \u201C${He[0]?.mutation.title??He[0]?.mutation.name}\u201D.`:!E.filter?.length&&!E.query?".":"",E.filter?.length||E.query?(0,w.jsxs)(w.Fragment,{children:[" ",(0,w.jsx)(F,{to:"?",style:K,children:"Show every one"})]}):null]}):B.grouped&&Zt?(0,w.jsx)("div",{style:{display:"grid",gap:"1rem"},"data-testid":"records","data-grouped":Zt,children:Vn.map(s=>{if(!s.closed)return(0,w.jsxs)("section",{style:{display:"grid",gap:0},"data-testid":"list-group",children:[(0,w.jsxs)("h2",{className:"graview-group-head",children:[s.label," ",(0,w.jsx)("span",{children:s.nodes.length})]}),(0,w.jsx)("ul",{style:tt,className:bt,"data-graview-rows":"",children:s.nodes.map(vt)})]},s.key||"-");let h=zn(s),O=`${m}-${pt(s.key||"none")}`;return(0,w.jsxs)("section",{style:{display:"grid",gap:0},"data-testid":"list-group","data-closed":h?"shut":"open",children:[(0,w.jsx)("h2",{className:"graview-group-head",children:(0,w.jsxs)("button",{type:"button",className:"graview-group-toggle","aria-expanded":!h,"aria-controls":O,"data-testid":"list-group-toggle",onClick:()=>Li(jn(s.key)),children:[(0,w.jsx)("span",{"aria-hidden":"true",children:h?"\u25B8":"\u25BE"}),s.label," ",(0,w.jsxs)("span",{children:["\xB7 ",s.nodes.length]}),(0,w.jsxs)("span",{style:yo,children:[" ",s.nodes.length===1?Ke(u,e):et.toLowerCase()]})]})}),(0,w.jsx)("ul",{id:O,style:h?{...tt,display:"none"}:tt,className:bt,"data-graview-rows":"",hidden:h,children:h?null:s.nodes.map(vt)})]},s.key||"-")})}):Ue&&Ue.length>1?(0,w.jsxs)("div",{style:{display:"grid",gap:14},"data-testid":"records","data-sectioned":Ee?.type==="date"?"year":"letter",children:[(0,w.jsx)("nav",{"aria-label":"Jump to","data-testid":"list-index",style:{...A,display:"flex",flexWrap:"wrap",gap:Ee?.type==="date"?"0 10px":"0 4px",lineHeight:1.3},children:Ue.map(s=>(0,w.jsx)("a",{href:`#${pt(s.key)}`,onClick:h=>{h.preventDefault(),document.getElementById(pt(s.key))?.scrollIntoView({block:"start"})},style:{...be,minWidth:24,justifyContent:"center"},children:s.key},s.key))}),Ue.map(s=>(0,w.jsxs)("section",{"data-testid":"list-section","aria-labelledby":pt(s.key),style:{display:"grid",gap:0},children:[(0,w.jsx)("h2",{id:pt(s.key),className:"graview-group-head",children:s.key}),(0,w.jsx)("ul",{style:tt,className:bt,"data-graview-rows":"",children:s.nodes.map(vt)})]},s.key))]}):(0,w.jsx)("ul",{style:tt,className:bt,"data-testid":"records","data-graview-rows":"",children:Ie.map(vt)})}),ct?(0,w.jsx)(Lr,{store:l,chosen:Te.chosen,...Je?{principal:Je}:{},...c?{context:c}:{},anchor:ho,of:ln.length,onChooseAll:()=>Te.choose(ln),onClear:Te.clear,onActed:Fi}):null,_n>0?(0,w.jsxs)(F,{to:wi(p,"filter","is:any"),style:{...K,...A,justifySelf:"start"},"data-testid":"past-link",children:["+",_n," past"]}):null,v===!1&&l.graph.count(e,{archived:!0})>0?(0,w.jsxs)(F,{to:wi(p,"archived","true"),style:{...K,...A,justifySelf:"start"},"data-testid":"archived-link",children:["+",l.graph.count(e,{archived:!0})," archived"]}):null]}),(0,w.jsx)(jt,{context:t,withheld:Mi,style:ne,testId:"withheld"})]})}var yo={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},ho=()=>document.querySelector("[data-graview-choosable]")?.closest("[data-embed-content]")??null,wo=`
|
|
110
|
+
.graview-list[data-graview-choosable]{outline:none}
|
|
111
|
+
.graview-list [data-graview-choose]{position:relative;padding-left:34px}
|
|
112
|
+
.graview-choose-at{position:absolute;left:2px;top:0;bottom:0;z-index:${ya.raised};display:flex;align-items:center}
|
|
113
|
+
@media (pointer: coarse){
|
|
114
|
+
.graview-list:not([data-graview-choosing]) [data-graview-choose]{padding-left:0}
|
|
115
|
+
.graview-list:not([data-graview-choosing]) .graview-choose-at{display:none}
|
|
116
|
+
}
|
|
117
|
+
`;function vo({children:t}){return(0,w.jsx)("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:40,minWidth:0},children:t})}var bo=(t,e)=>e?{sort:{by:e,direction:"desc"}}:t?{sort:{by:"label",direction:"asc"}}:{};function ko(t,e,n){let a=Ct({...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")}:{}}),r=[...a.filter??[]],i=t.get("by"),o=a.group??(i?{by:i}:void 0);for(let d of n){let c=t.get(d);c&&r.push({key:d,value:c})}let l=t.get("with");return l&&r.push({key:l,value:"*"}),t.get("past")==="1"&&!r.some(d=>d.key==="is")&&r.push({key:"is",value:"any"}),kn({...a.sort?{sort:a.sort}:{},...a.query?{query:a.query}:{},...r.length>0?{filter:r}:{},...o?{group:o}:{},...a.archived!==void 0?{archived:a.archived}:{}},e)}function wi(t,e,n){let a=new URLSearchParams(t);return a.set(e,n),a.delete("past"),`?${a.toString()}`}function So({name:t,title:e,panel:n,open:a,onOpen:r}){return(0,w.jsxs)("button",{type:"button","data-testid":`act-open-${t}`,"data-graview-act":t,"aria-expanded":a,"aria-controls":n,onClick:()=>{r(!a),a||requestAnimationFrame(()=>document.getElementById(n)?.querySelector("input, select, textarea, button")?.focus())},style:{...be,minHeight:28,margin:"-4px 0",padding:"0 2px",border:0,background:"none",font:"inherit",fontWeight:600,color:"var(--graview-ink)",cursor:"pointer"},children:[(0,w.jsx)("span",{"aria-hidden":"true",style:{marginRight:6},children:a?"\u2212":"+"}),e]})}function xo({name:t,id:e,description:n,open:a,onClose:r,children:i}){return(0,w.jsxs)("div",{"data-testid":`act-${t}`,id:e,hidden:!a,onKeyDown:o=>{o.key==="Escape"&&(o.preventDefault(),r(),document.querySelector(`[aria-controls="${e}"]`)?.focus())},style:a?{display:"grid",gap:12,padding:"4px 0 12px"}:void 0,children:[n?(0,w.jsx)("p",{style:{...A,margin:0,maxWidth:"58ch"},children:n}):null,i]})}function Po({to:t,label:e}){let n=(0,Ne.useRef)(null);return Tr(n),(0,w.jsx)(F,{ref:n,to:t,"aria-label":e,style:{position:"absolute",inset:0,borderRadius:6}})}var Xe=D(Oe(),1);var ht=D(Oe(),1);var W=D(_(),1);function qn({context:t}){let{store:e,brand:n,invariantContext:a,principal:r}=t;ae(e);let i=e.violations(a),o=e.allInvariants(),l=Rt(e,i),d=Ia(e.schema,o);return(0,W.jsxs)(re,{context:t,children:[(0,W.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,W.jsx)(se,{context:t,children:i.length===0?"All rules hold":"What is broken"}),(0,W.jsx)("p",{style:oe,"data-testid":"problems-count",children:i.length===0?"Every declared rule is satisfied by what is here.":ua(i)})]}),(0,W.jsx)(fi,{context:t}),l.map((c,p)=>{let g=c.nodeIds[0],m=g?e.graph.getNode(g):void 0;return(0,W.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,W.jsx)(Yt,{violation:c,schema:e.schema,...n?{brand:n}:{}}),m?(0,W.jsxs)("p",{style:{margin:0,display:"inline-flex",alignItems:"center",gap:8},children:[(0,W.jsx)(fe,{kind:m.kind,brand:n,schema:e.schema,size:7}),(0,W.jsx)(F,{to:ee(e.schema,m.kind,m.id),style:K,children:me(e.schema.tryDefinition(m.kind),m)})]}):null,c.line?(0,W.jsx)(Yt,{violation:c,schema:e.schema,...n?{brand:n}:{}}):null,(0,W.jsx)(Qt,{store:e,repairs:c.repairs,...r?{principal:r}:{}})]},p)}),o.length>0?(0,W.jsxs)("section",{style:{...ne,display:"grid",gap:12},"data-testid":"rules",children:[(0,W.jsx)("h2",{style:te,children:"The rules"}),(0,W.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:o.map(c=>{let p=i.filter(u=>u.invariant===c.name).length,g=d.get(c.name),m=c.label??c.name;return(0,W.jsxs)("li",{"data-graview-rule":c.name,style:{display:"grid",gap:2},children:[(0,W.jsxs)("span",{style:{display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:12,rowGap:2},children:[g?(0,W.jsx)(Lt,{line:g,schema:e.schema,...n?{brand:n}:{},style:{flex:"1 1 18rem"}}):(0,W.jsx)("span",{style:{flex:"1 1 18rem",fontWeight:550},children:m}),(0,W.jsx)("span",{style:{...A,color:p>0?"var(--graview-warn)":"var(--graview-ink-faint)"},children:p===0?"holds":`broken in ${p} ${p===1?"place":"places"}`})]}),g&&m.trim().length>0?(0,W.jsx)("span",{style:A,children:m}):null]},c.name)})})]}):null]})}function Yt({violation:t,schema:e,brand:n}){if(!t.line)return(0,W.jsx)("p",{style:{margin:0,color:"var(--graview-warn)",fontWeight:550},children:t.message});let a=Wa(t),r=Da(t);return r?(0,W.jsxs)("div",{style:{display:"grid",gap:4},"data-testid":"problem-line",children:[(0,W.jsx)("p",{style:{margin:0,color:"var(--graview-warn)",fontWeight:550},"data-testid":"problem-says",children:r}),a?(0,W.jsx)("span",{style:A,children:a}):null,(0,W.jsxs)("details",{"data-testid":"problem-judged",style:A,children:[(0,W.jsx)("summary",{style:{cursor:"pointer",width:"fit-content",minHeight:24},children:"How it is judged"}),(0,W.jsx)(Lt,{line:t.line,schema:e,...n?{brand:n}:{},lead:"none"})]})]}):(0,W.jsxs)("div",{style:{display:"grid",gap:2},"data-testid":"problem-line",children:[(0,W.jsx)(Lt,{line:t.line,schema:e,...n?{brand:n}:{},lead:"none",style:{color:"var(--graview-warn)"}}),a?(0,W.jsx)("span",{style:A,children:a}):null]})}function Qt({store:t,repairs:e,principal:n}){let[a,r]=(0,ht.useState)(null),[i,o]=(0,ht.useState)(null),l=(0,ht.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,W.jsxs)("div",{style:{display:"grid",gap:10},"data-testid":"repairs",children:[(0,W.jsx)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:e.map((p,g)=>{let m=(p.missing??[]).length>0,u=t.permits({name:p.mutation,args:{...p.args}},n);return u.ok?(0,W.jsx)("button",{ref:v=>{l.current[g]=v},type:"button","data-graview-repair":p.mutation,"data-graview-asks":m||void 0,"aria-expanded":m?a===g:void 0,onClick:()=>{if(o(null),m){r(a===g?null:g);return}r(null);try{t.apply({name:p.mutation,args:{...p.args}},n?{author:n}:{})}catch(v){o(it(t.schema,t.allMutations(),v))}},style:ke,children:m?`${p.label} \u2026`:p.label},g):(0,W.jsxs)("p",{"data-testid":"withheld","data-withheld":u.refusal.wouldNeed.join(",")||"nobody",style:{...A,margin:0},children:[(0,W.jsx)("s",{children:p.label})," \u2014 ",u.refusal.message]},g)})}),c&&d?(0,W.jsx)(Fe,{store:t,mutation:c,prefilled:{...d.args},only:d.missing??[],label:d.label,onDone:()=>{let p=a;r(null),requestAnimationFrame(()=>{let g=p===null?null:l.current[p];if(g?.isConnected){g.focus();return}let m=document.querySelector("[data-graview-page-title]")??document.querySelector("main h1, main h2");m&&(m.hasAttribute("tabindex")||(m.tabIndex=-1),m.focus())})},...n?{principal:n}:{}}):null,d&&!c&&(d.missing??[]).length>0?(0,W.jsxs)("p",{"data-testid":"refused",role:"alert",style:{margin:0,color:"var(--graview-warn)",fontSize:xn},children:["\u201C",d.label,"\u201D names ",d.mutation,", which this app does not declare."]}):null,i?(0,W.jsx)("p",{"data-testid":"refused",role:"alert",style:{margin:0,color:"var(--graview-warn)",fontSize:xn},children:i}):null]})}var Bn=D(Oe(),1);var Ve=D(_(),1);function Si({store:t,link:e,principal:n}){let[a,r]=(0,Bn.useState)(!1),[i,o]=(0,Bn.useState)(null),l=za(e);return(0,Ve.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[(0,Ve.jsx)("button",{type:"button","data-graview-provisional":"",title:l,"aria-label":`Unsure link: ${l}`,"aria-expanded":a,onClick:()=>r(!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,Ve.jsxs)("span",{style:{...A,display:"inline-flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,Ve.jsx)("span",{children:l}),(0,Ve.jsx)("button",{type:"button",style:{...ke,padding:"4px 10px"},onClick:()=>{try{t.apply({name:ga,args:{kind:e.edge.kind,from:e.edge.from,to:e.edge.to}},n?{author:n}:{}),r(!1)}catch(d){o(it(t.schema,t.allMutations(),d))}},children:"Keep this link"}),i?(0,Ve.jsx)("span",{role:"alert",children:i}):null]}):null]})}var he=D(_(),1);function xi({nodeId:t,node:e,field:n,inPlace:a,labelStyle:r=ve}){return n.files?(0,he.jsx)(qe,{as:"field",read:!a,nodeId:t,field:n.key,label:n.label,files:n.files,labelStyle:r,style:{gap:4}}):n.long?(0,he.jsx)(Pr,{nodeId:t,field:n.key,label:n.label,value:n.value,markdown:n.markdown,style:{gridColumn:"1 / -1",gap:4},labelStyle:r,valueStyle:{lineHeight:1.6}}):(0,he.jsxs)("div",{style:{display:"grid",gap:2,minWidth:0,alignContent:"start"},children:[(0,he.jsx)("dt",{style:r,children:n.label}),(0,he.jsx)("dd",{style:{margin:0,overflowWrap:"anywhere",minWidth:0},children:n.linked?(0,he.jsx)(Ja,{relation:n.linked.relation,refs:n.linked.refs,...a?{nodeId:t,field:n.key}:{}}):n.app?(0,he.jsx)($t,{address:n.app,as:"record",...a?{nodeId:t,field:n.key}:{}}):n.href?(0,he.jsx)(xr,{href:n.href,field:n.key,value:n.value,stored:n.stored,...a?{nodeId:t}:{}}):a?(0,he.jsxs)(he.Fragment,{children:[(0,he.jsx)(Ot,{nodeId:t,field:n.key,value:n.value,stored:n.stored}),n.repeats?(0,he.jsx)(nr,{nodeId:t,field:n.key,start:e?.[n.key],value:e?.[`${n.key}Repeat`],label:`${n.label} repeats`}):null]}):n.value})]})}var b=D(_(),1),Ao=[];function Gn({context:t}){let{store:e,brand:n,principal:a,invariantContext:r}=t;ae(e);let i=pe()!==null,o=Ge(),l=decodeURIComponent(o.id??""),d=ei(e,l,{...a?{principal:a}:{},...r?{context:r}:{}}),c=Rt(e,d?.violations??Ao),[p,g]=(0,Xe.useState)(null),[m,u]=(0,Xe.useState)(!1),[v,G]=(0,Xe.useState)(null),y=(0,Xe.useRef)(null),C=(0,Xe.useRef)(null),V=f=>{(y.current?.parentElement?.querySelector(`[data-affordance="${f.replace(/["\\]/g,"\\$&")}"]`)??y.current)?.focus()};if(!d)return(0,b.jsx)(re,{context:t,children:(0,b.jsx)(se,{context:t,children:"Nothing lives at this address."})});let T=e.graph.getNode(l),U=e.schema.tryDefinition(d.kind),Y=U?.describe&&T?Ha(U,T):null,le=[...e.log.all()].filter(f=>!At(f)&&(f.writes.includes(l)||f.reads.includes(l))).slice(-8).reverse(),ge=e.log.all().find(f=>!At(f)&&f.undoes===void 0&&f.primitives.some(N=>N.op==="add-node"&&N.node.id===l)),I=d.actions.affordances.filter(f=>f.provider!=="invariant"),Q=I.filter(f=>f.destructive||f.setsAside),de=m||Q.length<2?I:I.filter(f=>!Q.includes(f)),k=t.views?.lookup(d.kind,{cardinality:"one",fidelity:"full"}),x=k!==void 0&&!rt(k)?k:void 0,R=x&&T?It(k,T,e.graph):void 0,M=R?d.fields.filter(f=>!R.fields.has(f.key)):d.fields,E=R?d.links.flatMap(f=>{let N=f.targets.filter(B=>!R.records.has(B.id));return N.length>0?[{...f,targets:N}]:[]}):d.links,z=x!==void 0&&Ea(k),X=i&&Qa(U).length>0;return(0,b.jsxs)(re,{context:t,children:[(0,b.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,b.jsxs)("p",{style:{...ve,display:"flex",alignItems:"center",gap:8},children:[(0,b.jsx)(fe,{kind:d.kind,brand:n,schema:e.schema,size:8}),(0,b.jsx)(F,{to:`/${Z(e.schema,d.kind)}`,style:be,children:J(e,d.kind)})]}),(0,b.jsx)(se,{context:t,children:i&&T?.label===d.label?(0,b.jsx)(Ot,{nodeId:l,field:"label",value:d.label,said:d.label}):d.label}),Y&&Y!==d.label?(0,b.jsx)("p",{style:oe,children:Y}):null,ge?.lineage?(0,b.jsxs)("p",{style:{...A,margin:0},"data-testid":"record-lineage",children:["Made by ",mt(ge,a,{graph:e.graph,schema:e.schema,...t.seats?{seats:t.seats}:{},...t.people?{people:t.people}:{}}),", ",yn(ge.lineage)]}):null,(0,b.jsx)(Kt,{context:t,stop:`#focus=${encodeURIComponent(l)}`,style:{...K,...A},"data-testid":"spatial-link"}),i&&T?(0,b.jsx)(wn,{choices:[{on:"changed",record:l},{on:"act",record:l},{on:"reaches",kind:d.kind,condition:"",record:l}],label:"Notify me when this changes",testId:"record-notify",style:{...ke,...A,justifySelf:"start"}}):null,Le(t).some(f=>f.kind===d.kind||f.across===d.kind)?(0,b.jsxs)("p",{style:{...A,margin:0},"data-testid":"seen-in",children:["Seen in:"," ",Le(t).filter(f=>f.kind===d.kind||f.across===d.kind).map((f,N)=>(0,b.jsxs)("span",{children:[N>0?(0,b.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,(0,b.jsx)(F,{to:xe(t,f),style:K,children:f.title})," ",(0,b.jsx)(Kt,{context:t,stop:`#view=${encodeURIComponent(f.as)}`,style:{...K,...A,display:"inline-block",minWidth:24,textAlign:"center"},title:`${f.title}, in the scene`,label:`${f.title}, in the scene`,children:(0,b.jsx)("span",{"aria-hidden":"true",children:"\u2197"})})]},Ye(f)))]}):null]}),T&&ca(T)?(0,b.jsx)(Ro,{context:t,id:l,kind:d.kind}):null,T&&ma(e,l)?(0,b.jsx)(Co,{context:t,id:l,kind:d.kind}):null,x&&T?(0,b.jsx)("section",{"data-testid":"record-view",style:{display:"grid",minWidth:0},children:(0,b.jsx)(Mr,{children:(0,b.jsx)(x,{node:T,cardinality:"one",fidelity:"full",mode:"fullscreen",selected:!1,...d.violations.length>0?{flagged:[l]}:{}})})}):null,d.violations.length>0?(0,b.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((f,N)=>(0,b.jsxs)("div",{style:{display:"grid",gap:8},children:[(0,b.jsx)(Yt,{violation:f,schema:e.schema,...n?{brand:n}:{}}),(0,b.jsx)(Qt,{store:e,repairs:ti(d.actions,f.repairs),...a?{principal:a}:{}})]},N))}):null,!z&&(M.length>0||X)?(0,b.jsxs)("section",{style:{...ne,display:"grid",gap:14},"data-testid":"record-fields",children:[(0,b.jsx)("h2",{style:te,children:"The facts"}),qa(U,M).map((f,N)=>{let B=(0,b.jsx)("dl",{style:{margin:0,display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gap:"14px 24px"},children:f.fields.map(Ae=>(0,b.jsx)(xi,{nodeId:l,node:T,field:Ae,inPlace:i},Ae.key))});return f.title?(0,b.jsxs)("section",{style:{display:"grid",gap:10,minWidth:0},children:[(0,b.jsx)("h3",{"data-graview-field-group":f.title,style:{...te,fontSize:"inherit"},children:f.title}),B]},N):(0,b.jsx)("div",{children:B},N)}),X?(0,b.jsx)(qe,{as:"unfilled",nodeId:l,skip:[...R?.fields??[]],labelStyle:ve,style:{gap:4}}):null]}):null,(z?[]:E).map(f=>(0,b.jsxs)("section",{style:{...ne,display:"grid",gap:10},children:[(0,b.jsx)("p",{style:ve,children:Ur(e,f)}),f.description?(0,b.jsx)("h2",{style:te,children:Ce(f.description)}):(0,b.jsxs)("h2",{style:te,"aria-label":we(f.edgeKind),children:[f.direction==="in"?"\u2190 ":"\u2192 ",we(f.edgeKind)]}),(0,b.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"6px 18px"},children:f.targets.map(N=>{let B=_a(e,f.direction==="in"?{kind:f.edgeKind,from:N.id,to:l}:{kind:f.edgeKind,from:l,to:N.id});return(0,b.jsxs)("li",{style:{display:"inline-flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,b.jsx)(fe,{kind:N.kind,brand:n,schema:e.schema,size:7}),(0,b.jsxs)(F,{to:ee(e.schema,N.kind,N.id),style:K,children:[N.label,N.apart?(0,b.jsxs)("span",{style:A,children:[" \xB7 ",N.apart]}):null]}),B?.provisional?(0,b.jsx)(Si,{store:e,link:B,...a?{principal:a}:{}}):null]},N.id)})}),(f.direction==="out"&&e.schema.edge(f.edgeKind)?.cardinality==="one"?[]:[...new Set(f.targets.map(N=>N.kind))]).map(N=>(0,b.jsxs)(F,{to:`/${Z(e.schema,N)}?${encodeURIComponent(f.edgeKind)}=${encodeURIComponent(l)}`,style:{...K,...A},"data-testid":"related-all",children:["Sort and filter ",f.description??`these ${J(e,N).toLowerCase()}`,f.targets.some(B=>B.kind!==N)?` (${J(e,N).toLowerCase()})`:""," ",(0,b.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]},N))]},`${f.edgeKind}|${f.direction}|${f.description??""}`)),!z&&(I.length>0||d.actions.withheld.length>0)?(0,b.jsxs)("section",{style:{...ne,display:"grid",gap:14},"data-testid":"record-actions",children:[(0,b.jsx)("h2",{style:te,ref:y,tabIndex:-1,children:"What can be done"}),(0,b.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:8},children:[de.map(f=>{let N=p===f.id;return(0,b.jsx)("button",{type:"button","data-affordance":f.id,"data-rank":f.rank,"data-graview-act":f.mutation,autoFocus:m&&f===Q[0],"aria-expanded":N,onClick:()=>{g(N?null:f.id),N||requestAnimationFrame(()=>C.current?.querySelector("input:not([type=hidden]), select, textarea, button")?.focus())},style:{...ke,...N?{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"}:{}},children:f.label},f.id)}),de.length<I.length?(0,b.jsxs)("button",{type:"button","aria-expanded":!1,onClick:()=>u(!0),style:{...ke,...A},"data-testid":"record-actions-more",children:["Show ",I.length-de.length," more"]}):null]}),I.map(f=>{if(p!==f.id)return null;let N=e.allMutations().find(B=>B.name===f.mutation);return N?(0,b.jsxs)("div",{ref:C,onKeyDown:B=>{if(B.key!=="Escape"||B.defaultPrevented)return;B.preventDefault(),g(null);let Ae=f.id;requestAnimationFrame(()=>V(Ae))},style:{display:"grid",gap:10,padding:18,border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,b.jsx)("h3",{style:te,children:f.label}),N.description?(0,b.jsx)("p",{style:{...A,margin:0},children:N.description}):null,(0,b.jsx)(Fe,{store:e,mutation:N,prefilled:f.args,open:f.open,label:f.label,onDone:()=>{g(null),G(f.mutation);let B=f.id;requestAnimationFrame(()=>V(B))},...a?{principal:a}:{}})]},f.id):null}),i&&v!==null&&p===null?(0,b.jsx)(wn,{choices:[{on:"act",act:v,record:l},{on:"act",act:v}],label:"Notify me when someone else does this",testId:"notify-after-act",style:{...ke,...A,justifySelf:"start"}}):null,(0,b.jsx)(jt,{context:t,withheld:d.actions.withheld})]}):null,i?(0,b.jsx)(Vr,{id:l,style:ne,headingStyle:te}):null,le.length>0?(0,b.jsxs)("section",{style:{...ne,display:"grid",gap:10},"data-testid":"record-history",children:[(0,b.jsx)("h2",{style:te,children:"What has happened"}),(0,b.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:le.map(f=>(0,b.jsxs)("li",{style:A,children:[(0,b.jsx)("span",{style:{color:"var(--graview-ink)"},children:f.intent}),f.lineage?(0,b.jsxs)("span",{"data-graview-lineage":"",children:[" \xB7 ",yn(f.lineage)]}):null," \u2014 ",mt(f,a,{graph:e.graph,schema:e.schema,...t.seats?{seats:t.seats}:{},...t.people?{people:t.people}:{}})]},f.id))})]}):null]})}function Co({context:t,id:e,kind:n}){let{store:a,principal:r}=t,i={name:`allow-tidying-${n}`,args:{id:e}},o=a.allMutations().some(l=>l.name===i.name)&&a.permits(i,r).ok;return(0,b.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,b.jsxs)("p",{style:{margin:0,flex:"1 1 16rem"},children:[(0,b.jsx)("strong",{children:"Left alone."})," Nothing automated changes it; tidying passes it by."]}),o?(0,b.jsx)("button",{type:"button",style:ke,"data-testid":"allow-tidying",onClick:()=>a.apply(i,r?{author:r}:{}),children:"Allow tidying again"}):null]})}function Ro({context:t,id:e,kind:n}){let{store:a,principal:r}=t,i={name:`unarchive-${n}`,args:{id:e}},o=a.allMutations().some(c=>c.name===i.name)&&a.permits(i,r).ok,l=[...a.log.all()].reverse().find(c=>!At(c)&&c.mergedInto!==void 0&&c.writes.includes(e)),d=l?.mergedInto!==void 0?a.graph.getNode(l.mergedInto):void 0;return(0,b.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,b.jsxs)("p",{style:{margin:0,flex:"1 1 16rem"},children:[(0,b.jsx)("strong",{children:"Archived."})," Kept with its ties and history, and out of lists, counts and rules.",d?(0,b.jsxs)(b.Fragment,{children:[" ","Merged into ",(0,b.jsx)(F,{to:ee(a.schema,d.kind,d.id),style:K,children:me(a.schema.tryDefinition(d.kind),d)}),"."]}):null]}),o?(0,b.jsx)("button",{type:"button",style:ke,"data-testid":"bring-it-back",onClick:()=>a.apply(i,r?{author:r}:{}),children:"Bring it back"}):null]})}var P=D(_(),1),Lo=(0,j.lazy)(()=>(__graviewPreload(import.meta.url,["./chunk.6DYZBDWT.js","./chunk.3IVVXVG7.js","./chunk.UGFDSE37.js","./chunk.WNKRXL3O.js","./chunk.YW2BZ2LH.js","./chunk.CYPTJNES.js","./chunk.4NCXMVPY.js","./chunk.TN4GY6LW.js","./chunk.QJYALCIW.js","./chunk.HSRGYZOR.js","./chunk.BRBY5WJT.js","./chunk.ELY2RMGE.js","./chunk.UV2TSAB4.js","./chunk.6SK2K72G.js","./chunk.NNNVB6RV.js","./chunk.7MMNMZLF.js","./chunk.67PVRVAC.js","./chunk.MJLUAGEV.js","./chunk.WNMLA4YW.js","./chunk.VUKHDZNI.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.YFW5BF6J.js","./chunk.QYWBQ5NX.js","./chunk.ENJKCSNX.js","./chunk.LJE5J3JK.js","./chunk.X2OLXTRL.js","./chunk.JDRM6XXD.js","./chunk.GZHZLJBF.js","./chunk.GXPBRYSR.js","./chunk.NV6IZJKA.js","./chunk.OJGHDWI6.js","./chunk.7OLVQ2FZ.js","./chunk.NOZEHLWG.js","./chunk.UVLPVHID.js","./chunk.QXARGANF.js","./chunk.DNNL7F3P.js","./chunk.HBBVVALN.js","./chunk.AJZBJBMO.js"]),import("./chunk.VX7MGVP5.js")).then(t=>({default:t.DraftPage}))),To={kind:"human"};function Mo({list:t,store:e}){let n=new Set(t.members.map(o=>o.kind)),a=t.total-t.members.length,r=n.size===1?[...n][0]:void 0;if(!r)return(0,P.jsx)("p",{className:"graview-spec-text graview-spec-more",children:`and ${a} more`});let i=at(e.schema,r).toLowerCase();return(0,P.jsx)("p",{className:"graview-spec-text graview-spec-more",children:(0,P.jsx)(F,{to:`/${Z(e.schema,r)}`,className:"graview-spec-link graview-spec-see-all","data-testid":"see-all",children:t.total===e.graph.nodesOfKind(r).length?`See all ${ut(t.total)} ${i}`:`${ut(a)} more \xB7 all ${i}`})})}function No({context:t,children:e}){let n=De(),a=t.store.schema,r=(0,j.useMemo)(()=>({href:i=>ee(a,i.kind,i.id),go:i=>n(ee(a,i.kind,i.id)),more:i=>(0,P.jsx)(Mo,{list:i,store:t.store})}),[a,n,t.store]);return(0,P.jsx)(Ft.Provider,{value:r,children:(0,P.jsx)(Nr.Provider,{value:(t.titleLevel??(t.framed&&!t.barAbove?1:2))-1,children:e})})}function Eo({steering:t}){let e=Se(),n=De(),a=`${e.pathname}${e.search}`;return(0,j.useLayoutEffect)(()=>t.at(a),[a,t]),(0,j.useLayoutEffect)(()=>{let r=o=>{o!==a&&n(o)};t.go.current=r;let i=t.pending?.current;return i!==void 0&&(t.pending.current=void 0,r(i)),()=>{t.go.current===r&&(t.go.current=void 0)}},[a,n,t]),null}function $o({context:t,to:e}){let{pathname:n}=Se(),a=pe(),r=(e??a)?.sayWhere,i=Oo(t,n);return(0,j.useEffect)(()=>(r?.(i),()=>r?.(null)),[r,i]),null}function Oo(t,e){let[n="",a,r]=e.split("/").filter(Boolean).map(o=>{try{return decodeURIComponent(o)}catch{return o}});if(r!==void 0)return"#";if(n==="places"&&a!==void 0){if(a===mn)return"#overview=1";let o=t.views?.places().find(l=>l.as===a);return o?`#focus=${encodeURIComponent($e(o.kind))}&view=${encodeURIComponent(o.as)}`:"#"}let i=Me(t.store.schema,n);return i?`#focus=${encodeURIComponent(a??$e(i))}`:"#"}function Fo({onNavigate:t,path:e}){let n=Se(),a=An(),r=De(),i=n.hash&&!n.hash.includes("=")?n.hash:"",o=`${n.pathname}${n.search}${i}`,l=(0,j.useRef)(t);l.current=t;let d=(0,j.useRef)(null);(0,j.useEffect)(()=>{let p=d.current;d.current=o,p!==null&&(o===p&&a!=="PUSH"||l.current?.(o,a==="POP"?"pop":a==="REPLACE"?"replace":"push"))},[n.key]);let c=(0,j.useRef)(e);return(0,j.useEffect)(()=>{e===void 0||e===c.current||(c.current=e,e!==o&&r(e))},[e]),null}function Pi({context:t,registry:e,page:n}){let a=Ge(),r=Me(t.store.schema,a.slug??""),i=n==="list"?Kn:Gn,l=(r?e?.lookup(r,n):void 0)??i;return(0,P.jsx)(l,{context:t})}function Io({context:t,registry:e,children:n}){let a=(0,j.useRef)(null);return $a(a),(0,P.jsx)("div",{ref:a,"data-graview-face":"pages",style:{display:"contents"},children:(0,P.jsx)(ci,{context:t,registry:e,root:a,children:(0,P.jsx)(ui,{context:t,root:a,children:n})})})}function Do(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 Wo(){let{pathname:t}=Se(),e=An(),n=(0,j.useRef)(null);(0,j.useLayoutEffect)(()=>{if(e!=="POP"){for(let i=n.current?.parentElement;i;i=i.parentElement){let{overflowY:o}=getComputedStyle(i);if((o==="auto"||o==="scroll")&&i.scrollHeight>i.clientHeight){i.scrollTop=0;return}}window.scrollTo(0,0)}},[t]);let a=(0,j.useRef)(t),r=(0,j.useRef)(!1);return(0,j.useEffect)(()=>{if(!r.current&&t===a.current)return;r.current=!0;let i=document.activeElement;if(Do(i))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 Ai({context:t,children:e}){let n=De(),a=(0,j.useMemo)(()=>({record:(r,i)=>{let o=t.store.graph.getNode(r);o&&n(yt(ee(t.store.schema,o.kind,r),{section:i?.section}))},place:(r,i)=>{let o=t.views?.places().find(l=>l.as===r);o&&n(yt(xe(t,o),i))},list:(r,i)=>{t.store.schema.tryDefinition(r)&&n(yt(`/${Z(t.store.schema,r)}`,i))},draft:()=>n("/~draft")}),[t,n]);return(0,P.jsx)(Na.Provider,{value:a,children:e})}function Ho(){let{pathname:t,search:e,hash:n}=Se();return(0,j.useEffect)(()=>{let a=decodeURIComponent(n.replace(/^#/,""));if(!(!a||a.includes("=")))return oi(a)},[t,e,n]),null}function Ko({context:t,Home:e}){let n=Se(),a=t.views,r=n.key==="default"&&!(a&&Ta(a));(0,j.useEffect)(()=>{a&&Ma(a)},[a]);let i=r?ba(t.views?.arrangement?.()?.first,t.store.schema,t.views?.places()??[]):void 0,o=i?.to==="place"?xe(t,i.place):i?.to==="kind"?`/${Z(t.store.schema,i.kind)}`:void 0;return o?(0,P.jsx)(Cn,{to:o,replace:!0}):(0,P.jsx)(e,{context:t})}function Ci({context:t,registry:e}){let n=e?.lookupSurface("shell"),a=n!==void 0,r=a&&(e?.without().has("bar")??!1),i=a&&!r&&!t.embedded?{...t,barAbove:!0}:t,o=v=>n===void 0?(0,P.jsx)(qt,{context:t,children:v}):r?(0,P.jsx)(n,{context:t,children:v}):(0,P.jsx)(qt,{context:t,children:(0,P.jsx)(n,{context:i,children:v})}),l=e?.lookupSurface("home")??Wn,d=e?.lookupSurface("problems")??qn,c=a?{...i,framed:!0}:t,[p,g]=(0,j.useState)(null),m=(0,j.useMemo)(()=>({onFind:g,find:!(e?.without().has("find")??!1),places:!(e?.without().has("places")??!1)}),[e]),u=(0,P.jsx)(Ai,{context:t,children:(0,P.jsx)(Io,{context:t,registry:e,children:o((0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Ya,{face:"pages"}),(0,P.jsxs)(No,{context:c,children:[(0,P.jsx)(Wo,{}),(0,P.jsx)(Ho,{}),(0,P.jsxs)(Qr,{children:[(e?.routes()??[]).map(({path:v,component:G})=>(0,P.jsx)(Re,{path:v,element:(0,P.jsx)(G,{context:c})},v)),(0,P.jsx)(Re,{path:"/",element:(0,P.jsx)(Ko,{context:c,Home:l})}),(0,P.jsx)(Re,{path:"/problems",element:(0,P.jsx)(d,{context:c})}),(0,P.jsx)(Re,{path:"/~draft",element:(0,P.jsx)(j.Suspense,{fallback:null,children:(0,P.jsx)(Lo,{context:c})})}),(0,P.jsx)(Re,{path:"/search",element:(0,P.jsx)(Hn,{context:c})}),(0,P.jsx)(Re,{path:"/map",element:(0,P.jsx)(Dn,{context:c})}),(0,P.jsx)(Re,{path:"/places",element:(0,P.jsx)(Fn,{context:c})}),Le(c).some(v=>v.as===mn)?null:(0,P.jsx)(Re,{path:va,element:(0,P.jsx)(Cn,{to:"/",replace:!0})}),(0,P.jsx)(Re,{path:"/places/:as",element:(0,P.jsx)(In,{context:c})}),(0,P.jsx)(Re,{path:"/:slug",element:(0,P.jsx)(Pi,{context:c,registry:e,page:"list"})}),(0,P.jsx)(Re,{path:"/:slug/:id",element:(0,P.jsx)(Pi,{context:c,registry:e,page:"record"})})]})]})]}))})});return t.embedded||!a||r?u:(0,P.jsx)(Jr.Provider,{value:m,children:(0,P.jsx)(gr.Provider,{value:p,children:u})})}var qo=()=>typeof document>"u"?null:document.body;function Bo({context:t,registry:e,basename:n,initialPath:a,onNavigate:r,path:i,steering:o,firstLook:l}){let[d,c]=(0,j.useState)(void 0),p=d!==void 0&&d.from===t.principal?{...t,principal:d.seat}:t;(0,j.useState)(()=>p.views?$r(p.views,p.store.schema,bn(p.brand,p.store.schema)):void 0);let g=pe();ia({reader:p.locale??g?.locale,app:p.brand?.locale??p.app?.brand?.locale,readerTimeZone:p.timeZone??g?.timeZone,appTimeZone:p.brand?.timeZone??p.app?.brand?.timeZone});let m=p.principal??To,u=Aa(p.store,m,p.history),G=(u.past&&u.live===p.store?u.past.store:p.store).seenBy(m),y=G===p.store?p:{...p,store:G};Ca(p.store,p.principal);let C=(0,P.jsxs)(P.Fragment,{children:[r||i!==void 0?(0,P.jsx)(Fo,{onNavigate:r,path:i}):null,o?(0,P.jsx)(Eo,{steering:o}):null,y.presence||g?(0,P.jsx)($o,{context:y,to:g}):null,(0,P.jsx)(Ci,{context:y,...e?{registry:e}:{}}),l?(0,P.jsx)(Or,{firstLook:l,root:qo,app:bn(p.brand,p.store.schema)}):null]}),V=y.views?(0,P.jsxs)(Ra,{store:y.store,views:y.views,...y.principal?{principal:y.principal}:{},...y.brand?{brand:y.brand}:{},...y.locale?{locale:y.locale}:{},...y.timeZone?{timeZone:y.timeZone}:{},...y.settings?{settings:y.settings}:{},...y.presence&&!g?{presence:y.presence}:{},...y.people?{people:y.people}:{},...y.seats?{seats:y.seats}:{},onSeat:Y=>g?g.takeSeat(Y):c({from:t.principal,seat:Y}),...y.onKeepLens?{onKeepLens:y.onKeepLens}:{},...y.ai?{ai:y.ai}:{},...y.subscriptions?{subscriptions:y.subscriptions}:{},...y.signIn?{signIn:y.signIn}:{},resolveApp:y.resolveApp??g?.resolveApp,linkedRecords:y.linkedRecords??g?.linkedRecords,...y.app?{app:y.app}:{},...y.menuSections?{menuSections:y.menuSections}:{},children:[C,(0,P.jsx)(Ai,{context:y,children:(0,P.jsx)(si,{context:y})})]}):C,T=(0,P.jsx)(Pa.Provider,{value:u,children:V}),U=y.files?(0,P.jsx)(xa.Provider,{value:y.files,children:T}):T;if(a!==void 0){let Y=n===void 0?a:`${n.replace(/\/$/,"")}${a}`;return(0,P.jsx)(Yr,{initialEntries:[Y],...n===void 0?{}:{basename:n},children:U})}return(0,P.jsx)(Zr,{...n===void 0?{}:{basename:n},children:U})}export{Ui as a,Bo as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as o,m as u}from"./chunk.
|
|
1
|
+
import{h as o,m as u}from"./chunk.DNNL7F3P.js";function c(t,n,i){let e=r=>encodeURIComponent(r);return`${o}${e(t)}:${e(n)}:${e(i)}`}function S(t,n,i){let e=new Set(t.shown??[]);if(i?e.add(n):e.delete(n),e.size===0){let{shown:r,...w}=t;return w}return{...t,shown:[...e].sort()}}function l(t,n){if(n===null||n.trim().length===0){let{q:i,...e}=t;return e}return{...t,q:n}}function p(t){let n=t.q!==void 0&&t.within?.q===t.q;return l(n?u(t,"q",null):t,null)}function h(t,n){if(!n){let{past:i,...e}=t;return e}return{...t,past:!0}}function f(t,n){if(n===null||n.x===0&&n.y===0){let{pan:i,...e}=t;return e}return{...t,pan:n}}function d(t,n,i){let e={...t.pins};return i===null?delete e[n]:e[n]=i,{...t,pins:e}}export{c as a,S as b,l as c,p as d,h as e,f,d as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as a,k as o}from"./chunk.CYPTJNES.js";import"./chunk.4NCXMVPY.js";import"./chunk.TN4GY6LW.js";import"./chunk.QJYALCIW.js";import"./chunk.HSRGYZOR.js";import"./chunk.BRBY5WJT.js";import"./chunk.UV2TSAB4.js";import"./chunk.6SK2K72G.js";import"./chunk.NNNVB6RV.js";import"./chunk.MJLUAGEV.js";import"./chunk.WNMLA4YW.js";import"./chunk.VUKHDZNI.js";import"./chunk.WVUJXDXZ.js";import"./chunk.YFW5BF6J.js";import"./chunk.QYWBQ5NX.js";import"./chunk.ENJKCSNX.js";import"./chunk.LJE5J3JK.js";import"./chunk.X2OLXTRL.js";import"./chunk.JDRM6XXD.js";import"./chunk.GZHZLJBF.js";import"./chunk.GXPBRYSR.js";import"./chunk.NV6IZJKA.js";import"./chunk.OJGHDWI6.js";import"./chunk.7OLVQ2FZ.js";import"./chunk.NOZEHLWG.js";import"./chunk.UVLPVHID.js";import"./chunk.QXARGANF.js";import{ja as n}from"./chunk.DNNL7F3P.js";import"./chunk.HBBVVALN.js";import"./chunk.AJZBJBMO.js";var w=new WeakMap;function s(e,i){let t=w.get(e);t||w.set(e,t=new Map);let r=t.get(i);return r||t.set(i,r=a(o(e,n(e)),e,i)),r}export{s as frameworkViews};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk.
|
|
1
|
+
import"./chunk.QXARGANF.js";import{F as W,Q as x}from"./chunk.DNNL7F3P.js";import"./chunk.HBBVVALN.js";import{b as D}from"./chunk.AJZBJBMO.js";var g=D(W(),1);var o=D(x(),1),v=864e5,l=t=>Date.UTC(+t.slice(0,4),+t.slice(5,7)-1,+t.slice(8,10)),I=t=>new Date(t).toISOString().slice(0,10),s=(t,i)=>I(l(t)+i*v),m=(t,i)=>{let a=new Date(l(t)),u=a.getUTCMonth()+i,d=Date.UTC(a.getUTCFullYear(),u,1),w=new Date(Date.UTC(a.getUTCFullYear(),u+1,0)).getUTCDate();return I(d+(Math.min(a.getUTCDate(),w)-1)*v)};function p(t,i,a){try{return new Intl.DateTimeFormat(t??"en-US",{...i,timeZone:"UTC"}).format(a)}catch{return new Intl.DateTimeFormat("en-US",{...i,timeZone:"UTC"}).format(a)}}function F(t){try{let i=new Intl.Locale(t??"en-US"),a=i.getWeekInfo?.().firstDay??i.weekInfo?.firstDay;if(a!==void 0)return a%7}catch{return 0}return/^en-US|^en$|-(US|CA|JP|BR|IL|MX|PH)$/.test(t??"en-US")?0:1}function L({id:t,label:i,selected:a,today:u,locale:d,onPick:w,onClose:T}){let[r,f]=(0,g.useState)(a??u),U=(0,g.useRef)(null),y=F(d),b=`${r.slice(0,7)}-01`,M=(new Date(l(b)).getUTCDay()-y+7)%7,P=s(b,-M),A=Array.from({length:6},(e,n)=>Array.from({length:7},(S,c)=>s(P,n*7+c))),$=p(d,{month:"long",year:"numeric"},l(b)),h=(0,g.useRef)(!0);(0,g.useEffect)(()=>{h.current&&U.current?.querySelector(`[data-day="${r}"]`)?.focus(),h.current=!1},[r]);let E=e=>{let n={ArrowLeft:()=>s(r,-1),ArrowRight:()=>s(r,1),ArrowUp:()=>s(r,-7),ArrowDown:()=>s(r,7),PageUp:()=>m(r,e.shiftKey?-12:-1),PageDown:()=>m(r,e.shiftKey?12:1),Home:()=>s(r,-((new Date(l(r)).getUTCDay()-y+7)%7)),End:()=>s(r,6-(new Date(l(r)).getUTCDay()-y+7)%7)};n[e.key]?(e.preventDefault(),h.current=!0,f(n[e.key]())):e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),T())},R=Array.from({length:7},(e,n)=>l("1970-01-04")+(y+n)%7*v),C={minWidth:32,minHeight:32,padding:"0 8px",borderRadius:6};return(0,o.jsxs)("div",{id:t,role:"group","aria-label":`Pick a date for ${i}`,"data-graview-part":"when-month",onKeyDown:e=>{e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),T())},style:{flexBasis:"100%",width:"min(100%, 20rem)",boxSizing:"border-box",padding:8,border:"1px solid var(--graview-edge)",borderRadius:8,background:"var(--graview-panel)",color:"var(--graview-ink)"},children:[(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:6,marginBottom:6},children:[(0,o.jsx)("button",{type:"button","aria-label":"Previous month",onClick:()=>f(m(r,-1)),style:C,children:"\u2039"}),(0,o.jsx)("span",{id:`${t}-title`,"aria-live":"polite",style:{fontWeight:600,fontSize:"0.875rem"},children:$}),(0,o.jsx)("button",{type:"button","aria-label":"Next month",onClick:()=>f(m(r,1)),style:C,children:"\u203A"})]}),(0,o.jsxs)("table",{ref:U,role:"grid","aria-labelledby":`${t}-title`,onKeyDown:E,style:{width:"100%",borderCollapse:"collapse",tableLayout:"fixed",fontSize:"0.8125rem"},children:[(0,o.jsx)("thead",{children:(0,o.jsx)("tr",{children:R.map(e=>(0,o.jsx)("th",{scope:"col",abbr:p(d,{weekday:"long"},e),style:{fontWeight:500,color:"var(--graview-ink-faint)",padding:"2px 0"},children:p(d,{weekday:"narrow"},e)},e))})}),(0,o.jsx)("tbody",{children:A.map(e=>(0,o.jsx)("tr",{children:e.map(n=>{let S=n.slice(0,7)===b.slice(0,7),c=n===a,k=n===u;return(0,o.jsx)("td",{role:"gridcell","aria-selected":c||void 0,style:{padding:1,textAlign:"center"},children:(0,o.jsx)("button",{type:"button","data-day":n,tabIndex:n===r?0:-1,"aria-label":`${p(d,{weekday:"long",year:"numeric",month:"long",day:"numeric"},l(n))}${k?", today":""}${c?", selected":""}`,...k?{"aria-current":"date"}:{},onClick:()=>w(n),onFocus:()=>n!==r&&f(n),style:{width:"100%",minHeight:36,padding:0,borderRadius:6,border:k?"1px solid var(--graview-accent)":"1px solid transparent",background:c?"var(--graview-accent)":"transparent",color:c?"var(--graview-accent-ink)":S?"var(--graview-ink)":"var(--graview-ink-faint)",fontWeight:c?600:400},children:Number(n.slice(8,10))})},n)})},e[0]))})]})]})}export{L as WhenMonth};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as O,b}from"./chunk.CV4CBHFT.js";import"./chunk.LJE5J3JK.js";import"./chunk.X2OLXTRL.js";import"./chunk.JDRM6XXD.js";import"./chunk.QXARGANF.js";import{F as z,Q as M,Y as S}from"./chunk.DNNL7F3P.js";import{Ac as A}from"./chunk.HBBVVALN.js";import{b as v}from"./chunk.AJZBJBMO.js";var o=v(z(),1);var t=v(M(),1);function G(i){for(let d of i)for(let[r,s]of Object.entries(d))if(s===!1)return`${r} == true`;return""}var w={margin:0,fontSize:"0.8125rem",color:"var(--graview-ink-muted)"};function j({ask:i,close:d}){let{store:r,principal:s,subscriptions:h,app:f}=S(),c=(0,o.useRef)(null),p=(0,o.useId)(),[n,u]=(0,o.useState)(0),[l,y]=(0,o.useState)(!0),[m,P]=(0,o.useState)(()=>{let e=i.choices.find(g=>g.on==="reaches");if(!e)return"";let a=e.record!==void 0?r.graph.getNode(e.record):void 0;return G(a?[a]:r.graph.nodesOfKind(e.kind).slice(0,5))}),[C,x]=(0,o.useState)(null),[W,k]=(0,o.useState)(!1);(0,o.useEffect)(()=>{let e=c.current;e&&!e.open&&e.showModal()},[]);let T=()=>{let e=i.returnTo;d(),requestAnimationFrame(()=>{e?.isConnected?e.focus():document.querySelector("[data-graview-page-title], main h1, [data-testid='activity-button']")?.focus()})},N=e=>e.on==="reaches"?{...e,condition:m}:e,E=e=>b(r,{when:N(e),alsoMine:!l}),L=async()=>{let e=N(i.choices[n]),a=O(r,e);if(a){x(a);return}k(!0);try{await h.add({who:A(s),app:f?.name??"app",when:e,...l?{}:{alsoMine:!0}}),T()}catch(g){k(!1),x(g instanceof Error?g.message:String(g))}};return(0,t.jsx)("dialog",{ref:c,"aria-labelledby":p,"data-testid":"notify-sheet",onClose:T,onClick:e=>{e.target===e.currentTarget&&e.currentTarget.close()},style:{width:"min(92vw, 420px)",padding:0,border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)",color:"var(--graview-ink)",boxShadow:"var(--graview-lift-high)"},children:(0,t.jsxs)("form",{method:"dialog",onSubmit:e=>{e.preventDefault(),L()},style:{display:"grid",gap:12,padding:18},children:[(0,t.jsx)("h2",{id:p,style:{margin:0,fontSize:"1.0625rem"},children:"Notify me"}),(0,t.jsxs)("fieldset",{style:{margin:0,padding:0,border:0,display:"grid",gap:6},children:[(0,t.jsx)("legend",{style:{...w,marginBottom:6},children:"Tell me"}),i.choices.map((e,a)=>(0,t.jsxs)("label",{style:{display:"flex",gap:8,alignItems:"baseline",cursor:"pointer"},children:[(0,t.jsx)("input",{type:"radio",name:`${p}-when`,checked:n===a,onChange:()=>u(a),"data-notify-choice":e.on}),(0,t.jsx)("span",{children:e.on==="reaches"?`When ${e.record!==void 0?"it":"one"} reaches a condition`:E(e)})]},a))]}),i.choices[n]?.on==="reaches"?(0,t.jsxs)("label",{style:{display:"grid",gap:4},children:[(0,t.jsx)("span",{style:w,children:"The condition, in the app's own words (done == true, amount > 100)"}),(0,t.jsx)("input",{value:m,onChange:e=>P(e.target.value),"data-testid":"notify-condition",autoComplete:"off",spellCheck:!1})]}):null,(0,t.jsxs)("label",{style:{display:"flex",gap:8,alignItems:"center"},children:[(0,t.jsx)("input",{type:"checkbox",checked:l,onChange:e=>y(e.target.checked),"data-testid":"notify-others-only"}),"Only when someone else does it"]}),(0,t.jsxs)("p",{style:w,"data-testid":"notify-said",children:[E(i.choices[n]),"."]}),C?(0,t.jsx)("p",{role:"alert",style:{margin:0,color:"var(--graview-danger, var(--graview-ink))"},children:C}):null,(0,t.jsxs)("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[(0,t.jsx)("button",{type:"button",onClick:()=>c.current?.close(),children:"Cancel"}),(0,t.jsx)("button",{type:"submit",autoFocus:!0,disabled:W,"data-testid":"notify-keep",style:{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"},children:"Notify me"})]})]})})}function B({style:i}){let{store:d,principal:r,subscriptions:s,app:h}=S(),f=(r.onBehalfOf??r).id,[c,p]=(0,o.useState)([]);return(0,o.useEffect)(()=>{if(f===void 0)return;let n=!0,u=()=>void Promise.resolve(s.list(f)).then(y=>n&&p(y.filter(m=>m.app===(h?.name??"app"))),()=>n&&p([]));u();let l=s.onChange?.(u);return()=>{n=!1,l?.()}},[s,f,h]),c.length===0?null:(0,t.jsxs)("section",{"aria-label":"What you are told of","data-testid":"notified",style:{display:"grid",gap:6,...i},children:[(0,t.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:"You are told"}),(0,t.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:4},children:c.map(n=>(0,t.jsxs)("li",{style:{display:"flex",gap:8,alignItems:"baseline",justifyContent:"space-between"},"data-subscription":n.id,children:[(0,t.jsx)("span",{style:{fontSize:"0.8125rem"},children:b(d,n)}),(0,t.jsx)("button",{type:"button","data-testid":"notify-stop","aria-label":`Stop: ${b(d,n)}`,onClick:u=>{let l=u.currentTarget.closest("li"),y=(l?.nextElementSibling??l?.previousElementSibling)?.querySelector("button");Promise.resolve(s.remove(n.id)).then(()=>(y??document.querySelector("[data-testid='activity-button']"))?.focus())},style:{padding:"1px 8px",fontSize:"0.8125rem"},children:"Stop"})]},n.id))})]})}export{B as NotifiedList,j as NotifySheet};
|