graview 0.1.51 → 0.1.53
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.2IKVO743.js +1 -0
- package/dist/preview/{chunk.UK5F3S2N.js → chunk.2LQ37DC2.js} +1 -1
- package/dist/preview/{chunk.ALCH5H7U.js → chunk.3377DLPA.js} +1 -1
- package/dist/preview/chunk.34Q7OKK3.js +1 -0
- package/dist/preview/{chunk.5ZAK57JA.js → chunk.36XV4ZMC.js} +2 -2
- package/dist/preview/chunk.3FRVG6JW.js +32 -0
- package/dist/preview/{chunk.3MU37W5D.js → chunk.3FUFVVR4.js} +1 -1
- package/dist/preview/chunk.3Y7BDRP3.js +1 -0
- package/dist/preview/{chunk.3TVAE7LE.js → chunk.4DCPB67O.js} +1 -1
- package/dist/preview/chunk.4DFO43VM.js +1 -0
- package/dist/preview/chunk.4QVZXCV5.js +1 -0
- package/dist/preview/chunk.4SVAHPJA.js +1 -0
- package/dist/preview/chunk.52Y37IAD.js +1 -0
- package/dist/preview/chunk.56UFDIX5.js +1 -0
- package/dist/preview/chunk.5E4UGVAD.js +1 -0
- package/dist/preview/chunk.5H3VCAPN.js +1 -0
- package/dist/preview/chunk.5K5D4IMM.js +1 -0
- package/dist/preview/{chunk.DQNN5FE5.js → chunk.5XFRWXYQ.js} +1 -1
- package/dist/preview/{chunk.PYRJDTVS.js → chunk.65F3DF5Q.js} +1 -1
- package/dist/preview/{chunk.CMEETACI.js → chunk.6CVW53WA.js} +1 -1
- package/dist/preview/chunk.6ESAZJBN.js +1 -0
- package/dist/preview/chunk.6S3B4XC4.js +1 -0
- package/dist/preview/{chunk.P4CLT32V.js → chunk.6W2DUW5S.js} +5 -5
- package/dist/preview/chunk.6YGRRXJB.js +2 -0
- package/dist/preview/{chunk.CQPNDJAC.js → chunk.72Q4R7N6.js} +1 -1
- package/dist/preview/chunk.7BXOQEUP.js +1 -0
- package/dist/preview/{chunk.OJ64WTLW.js → chunk.7NFCI4LH.js} +2 -2
- package/dist/preview/{chunk.EA2NMVRE.js → chunk.7R6GXJS4.js} +1 -1
- package/dist/preview/chunk.A2RQFAZ6.js +1 -0
- package/dist/preview/{chunk.TNL2BVCH.js → chunk.AQJD23AN.js} +1 -1
- package/dist/preview/{chunk.NQ26KMSQ.js → chunk.ASCTAUFD.js} +1 -1
- package/dist/preview/chunk.B3T4N2XM.js +25 -0
- package/dist/preview/chunk.B3WVCSW5.js +1 -0
- package/dist/preview/{chunk.AL7LFNOS.js → chunk.BB5XKTVC.js} +1 -1
- package/dist/preview/{chunk.LYIHPVDZ.js → chunk.BG2SC77J.js} +1 -1
- package/dist/preview/{chunk.353CGK6C.js → chunk.BPPDBPTL.js} +1 -1
- package/dist/preview/chunk.BQHRZJ5Z.js +1 -0
- package/dist/preview/{chunk.W2DKFQ6R.js → chunk.CANTHIRO.js} +1 -1
- package/dist/preview/chunk.CIUQWCU4.js +1 -0
- package/dist/preview/chunk.CSA6SWTI.js +1 -0
- package/dist/preview/{chunk.GJQF7I22.js → chunk.CWPRQSED.js} +1 -1
- package/dist/preview/{chunk.4EZFOZBA.js → chunk.CYP5KXIQ.js} +1 -1
- package/dist/preview/chunk.D3A24PQ6.js +1 -0
- package/dist/preview/{chunk.7RIFDWDF.js → chunk.DQPEVPKQ.js} +1 -1
- package/dist/preview/{chunk.XWXYC3BJ.js → chunk.DUZS52WX.js} +1 -1
- package/dist/preview/chunk.E52UTLQ2.js +1 -0
- package/dist/preview/{chunk.2534FLZZ.js → chunk.E647LWH5.js} +1 -1
- package/dist/preview/chunk.EG2N5F6L.js +1 -0
- package/dist/preview/{chunk.SPU3BVAO.js → chunk.EZXGVTT2.js} +1 -1
- package/dist/preview/chunk.F5RN6YXG.js +4 -0
- package/dist/preview/chunk.FBRARPGR.js +4 -0
- package/dist/preview/{chunk.XCCBUWMC.js → chunk.FCAKLO5U.js} +1 -1
- package/dist/preview/{chunk.ACB4TD4W.js → chunk.FGJM4LJO.js} +1 -1
- package/dist/preview/{chunk.WESWDXRW.js → chunk.FJN4OGAS.js} +1 -1
- package/dist/preview/chunk.FXNUR5JI.js +88 -0
- package/dist/preview/chunk.G226CUJQ.js +1 -0
- package/dist/preview/chunk.G6DISMVT.js +67 -0
- package/dist/preview/{chunk.SRFZKDQ6.js → chunk.GANAZIRD.js} +1 -1
- package/dist/preview/{chunk.SJKHVIHA.js → chunk.GBIVIHGD.js} +19 -14
- package/dist/preview/chunk.GGHZEAAT.js +1 -0
- package/dist/preview/chunk.GPYZR6HE.js +1 -0
- package/dist/preview/{chunk.JI2UVZUU.js → chunk.GYO57LKD.js} +1 -1
- package/dist/preview/{chunk.MN6WHE4B.js → chunk.GZBODS7Z.js} +1 -1
- package/dist/preview/chunk.GZWC72HS.js +1 -0
- package/dist/preview/{chunk.2W2YVB6X.js → chunk.H2B3SEI7.js} +1 -1
- package/dist/preview/{chunk.ESK3UZRC.js → chunk.H6EMDQP5.js} +1 -1
- package/dist/preview/chunk.HAIHXBVX.js +1 -0
- package/dist/preview/{chunk.ESSENNHM.js → chunk.HBVURYWY.js} +2 -2
- package/dist/preview/{chunk.ZZODDJYK.js → chunk.HDXDYS4C.js} +1 -1
- package/dist/preview/chunk.HE545Z6I.js +1 -0
- package/dist/preview/chunk.HIDLE6BN.js +18 -0
- package/dist/preview/chunk.HIFLBWQJ.js +9 -0
- package/dist/preview/chunk.I62MCBQM.js +1 -0
- package/dist/preview/chunk.I6SUHXJF.js +1 -0
- package/dist/preview/chunk.I6W3IQ4W.js +1 -0
- package/dist/preview/chunk.ICYJ7QJG.js +2 -0
- package/dist/preview/{chunk.Z7N3MJ36.js → chunk.IYVBJDR7.js} +1 -1
- package/dist/preview/{chunk.FFCUZPTC.js → chunk.J6OT74RM.js} +1 -1
- package/dist/preview/{chunk.K7RKWB2K.js → chunk.JCJ7NTW4.js} +1 -1
- package/dist/preview/{chunk.4T67XS2D.js → chunk.JKCLYLT4.js} +1 -1
- package/dist/preview/chunk.JQTO52Q7.js +1 -0
- package/dist/preview/chunk.JRU5BT7K.js +5 -0
- package/dist/preview/{chunk.XCQ7ZPR5.js → chunk.K7WME4P4.js} +1 -1
- package/dist/preview/{chunk.APFRPN5S.js → chunk.KAKJYAHM.js} +1 -1
- package/dist/preview/chunk.KCM2VOC7.js +1 -0
- package/dist/preview/{chunk.CTOBNZLM.js → chunk.KWMBRB6O.js} +1 -1
- package/dist/preview/{chunk.KVEDMKUN.js → chunk.KY7QD22S.js} +1 -1
- package/dist/preview/{chunk.S32AGJ3W.js → chunk.LAOZEYYQ.js} +1 -1
- package/dist/preview/{chunk.7GAC7U34.js → chunk.LCG3VLCB.js} +1 -1
- package/dist/preview/{chunk.IUIDDNN3.js → chunk.LDLWYAHK.js} +1 -1
- package/dist/preview/chunk.LEKML4S4.js +1 -0
- package/dist/preview/{chunk.MY5OXSS7.js → chunk.MDIAWTNK.js} +1 -1
- package/dist/preview/chunk.MKWVNW4Q.js +35 -0
- package/dist/preview/{chunk.3H7YIKKC.js → chunk.MSPRCR3Q.js} +1 -1
- package/dist/preview/{chunk.VICCAWAN.js → chunk.MT45H2T5.js} +1 -1
- package/dist/preview/chunk.MXTDQXVW.js +1 -0
- package/dist/preview/{chunk.WQLAIEWJ.js → chunk.N6A3DIOY.js} +1 -1
- package/dist/preview/{chunk.FU4YSVWX.js → chunk.NAEEPUWJ.js} +1 -1
- package/dist/preview/{chunk.KK46XLGU.js → chunk.NCTTPW7A.js} +1 -1
- package/dist/preview/chunk.OCWZJNZF.js +1 -0
- package/dist/preview/chunk.OP3ZUI4W.js +1 -0
- package/dist/preview/{chunk.U7SNDY3F.js → chunk.OPKXCL5R.js} +1 -1
- package/dist/preview/chunk.OXLYDXQV.js +1 -0
- package/dist/preview/{chunk.6KYWJXZR.js → chunk.OZYZBRWO.js} +1 -1
- package/dist/preview/chunk.P2W727C7.js +1 -0
- package/dist/preview/{chunk.T3RTFTOZ.js → chunk.P7FN3SFB.js} +1 -1
- package/dist/preview/{chunk.NVRK6A7T.js → chunk.PEA4D66Y.js} +1 -1
- package/dist/preview/chunk.Q5JVKSEN.js +1 -0
- package/dist/preview/chunk.QATG5HNV.js +1 -0
- package/dist/preview/{chunk.NZDHXREL.js → chunk.R3DWF35R.js} +1 -1
- package/dist/preview/{chunk.BYY7YXBI.js → chunk.RIS3OKAI.js} +1 -1
- package/dist/preview/{chunk.GMAXA5GV.js → chunk.RUTZEEBR.js} +1 -1
- package/dist/preview/{chunk.OU5TRY4N.js → chunk.S2ATSY6P.js} +1 -1
- package/dist/preview/{chunk.MX3Y3LPH.js → chunk.S6TN3MLY.js} +1 -1
- package/dist/preview/{chunk.IE4ZJQV3.js → chunk.T56SOSIR.js} +4 -4
- package/dist/preview/chunk.THL67D77.js +1 -0
- package/dist/preview/{chunk.SSAY4ITS.js → chunk.TLQTDKOL.js} +2 -2
- package/dist/preview/{chunk.FKJ3HIA5.js → chunk.TRPPN2GD.js} +1 -1
- package/dist/preview/{chunk.OW72XZF4.js → chunk.TTFYXKLI.js} +1 -1
- package/dist/preview/{chunk.HVX7LFWR.js → chunk.TXEWSZGO.js} +1 -1
- package/dist/preview/chunk.U4T4Y2MT.js +1 -0
- package/dist/preview/chunk.ULTYDYTS.js +19 -0
- package/dist/preview/chunk.UQ4CASST.js +1 -0
- package/dist/preview/chunk.UQENE3VE.js +1 -0
- package/dist/preview/chunk.USAGE5C6.js +28 -0
- package/dist/preview/{chunk.RMMJQYJJ.js → chunk.UVMLX4US.js} +1 -1
- package/dist/preview/{chunk.2VJ52LGS.js → chunk.UXNZPPWR.js} +1 -1
- package/dist/preview/chunk.UYCPQ6IW.js +1 -0
- package/dist/preview/chunk.V6X3U3JF.js +1 -0
- package/dist/preview/{chunk.K7ECYKZL.js → chunk.VOHDRH3P.js} +1 -1
- package/dist/preview/{chunk.HFKGND5Q.js → chunk.VRJ4TULC.js} +1 -1
- package/dist/preview/{chunk.GLTWLQ6L.js → chunk.VTCPA4V4.js} +1 -1
- package/dist/preview/chunk.VTRI2MT2.js +2 -0
- package/dist/preview/chunk.W54NXXC5.js +293 -0
- package/dist/preview/{chunk.MG3DMURZ.js → chunk.WDEMPWS4.js} +1 -1
- package/dist/preview/chunk.XBNASVTY.js +1 -0
- package/dist/preview/{chunk.B4PUI3GO.js → chunk.XDEKL6TJ.js} +1 -1
- package/dist/preview/chunk.XE72DFBV.js +13 -0
- package/dist/preview/{chunk.UWFEXEY3.js → chunk.XFIZLWYA.js} +1 -1
- package/dist/preview/{chunk.76QSPWSJ.js → chunk.XXCT6DLX.js} +1 -1
- package/dist/preview/{chunk.JX2C3HVD.js → chunk.Y4VOCJ7R.js} +1 -1
- package/dist/preview/chunk.YA7ZMGOL.js +1 -0
- package/dist/preview/{chunk.B7LBG4UP.js → chunk.YI7WHBAD.js} +2 -2
- package/dist/preview/{chunk.WFHFWJ6E.js → chunk.Z4YSCHZT.js} +1 -1
- package/dist/preview/{chunk.B6LKLV32.js → chunk.ZQWKS6K5.js} +1 -1
- package/dist/preview/{chunk.R5R7CLOU.js → chunk.ZYYM52N5.js} +1 -1
- package/dist/preview/index.html +50 -50
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.2W45NM7Q.js +0 -9
- package/dist/preview/chunk.32BOL7OL.js +0 -1
- package/dist/preview/chunk.34HGT7HQ.js +0 -1
- package/dist/preview/chunk.3SBTQ66X.js +0 -1
- package/dist/preview/chunk.4N5R4K6O.js +0 -1
- package/dist/preview/chunk.5ON3JSAK.js +0 -1
- package/dist/preview/chunk.7G4M2PX3.js +0 -5
- package/dist/preview/chunk.7NQROWHU.js +0 -1
- package/dist/preview/chunk.AJAMTRZ3.js +0 -1
- package/dist/preview/chunk.AL45OI4A.js +0 -1
- package/dist/preview/chunk.AZOW57MT.js +0 -1
- package/dist/preview/chunk.BRDAO2OF.js +0 -4
- package/dist/preview/chunk.BV6HKTHK.js +0 -1
- package/dist/preview/chunk.CI4DEKPX.js +0 -1
- package/dist/preview/chunk.CUB4IAUJ.js +0 -1
- package/dist/preview/chunk.CUN4VN42.js +0 -1
- package/dist/preview/chunk.CV55N3Y6.js +0 -1
- package/dist/preview/chunk.CXC5FOIO.js +0 -1
- package/dist/preview/chunk.DEH6O3K4.js +0 -28
- package/dist/preview/chunk.DUY27OJV.js +0 -1
- package/dist/preview/chunk.E2R6VFZX.js +0 -1
- package/dist/preview/chunk.ET3XJDPX.js +0 -1
- package/dist/preview/chunk.FEIJ7ETK.js +0 -1
- package/dist/preview/chunk.FG5ZFYYL.js +0 -1
- package/dist/preview/chunk.FTBH7CPZ.js +0 -1
- package/dist/preview/chunk.FYDDFOSD.js +0 -35
- package/dist/preview/chunk.G446PWV6.js +0 -1
- package/dist/preview/chunk.GRYS6VSF.js +0 -1
- package/dist/preview/chunk.GYTVL6GR.js +0 -359
- package/dist/preview/chunk.HASVT7IC.js +0 -1
- package/dist/preview/chunk.IBJBCZKG.js +0 -1
- package/dist/preview/chunk.IFL2MYTQ.js +0 -1
- package/dist/preview/chunk.JBR66TUP.js +0 -1
- package/dist/preview/chunk.JG2FGZF2.js +0 -18
- package/dist/preview/chunk.JMDKAP23.js +0 -1
- package/dist/preview/chunk.KOBCLWPC.js +0 -1
- package/dist/preview/chunk.KQSD5MLY.js +0 -1
- package/dist/preview/chunk.KRODTMGR.js +0 -1
- package/dist/preview/chunk.KYKHZZT7.js +0 -1
- package/dist/preview/chunk.MCFLCC42.js +0 -12
- package/dist/preview/chunk.MMVCZOEX.js +0 -32
- package/dist/preview/chunk.MRXQBEPQ.js +0 -1
- package/dist/preview/chunk.N5XONWU2.js +0 -1
- package/dist/preview/chunk.NNUUD26E.js +0 -1
- package/dist/preview/chunk.OHDJYGH7.js +0 -2
- package/dist/preview/chunk.OPCBZNKF.js +0 -19
- package/dist/preview/chunk.PMV6XVVZ.js +0 -1
- package/dist/preview/chunk.PPZ2TOB5.js +0 -1
- package/dist/preview/chunk.QEQQXWYU.js +0 -1
- package/dist/preview/chunk.QPAJCRFB.js +0 -1
- package/dist/preview/chunk.RNOBACJ6.js +0 -1
- package/dist/preview/chunk.S4CKKT3C.js +0 -1
- package/dist/preview/chunk.SJYQ72EC.js +0 -1
- package/dist/preview/chunk.SKG4IHT5.js +0 -88
- package/dist/preview/chunk.TBSPEO2L.js +0 -1
- package/dist/preview/chunk.TMYGLXR6.js +0 -25
- package/dist/preview/chunk.TVWN5I4M.js +0 -1
- package/dist/preview/chunk.UCUWEYKM.js +0 -1
- package/dist/preview/chunk.UIWI4GKW.js +0 -1
- package/dist/preview/chunk.UVAWWCFW.js +0 -1
- package/dist/preview/chunk.V4GAOZAW.js +0 -1
- package/dist/preview/chunk.XZVPVAIS.js +0 -1
- package/dist/preview/chunk.Y2ZBVWII.js +0 -1
- package/dist/preview/chunk.Y3LTHEN7.js +0 -1
- package/dist/preview/chunk.Y5AMZBHA.js +0 -4
|
@@ -0,0 +1,18 @@
|
|
|
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 Fe}from"./chunk.YI7WHBAD.js";import{A as Zt,B as Ce,C as oo,D as Je,E as me,F as Kn,G as Ge,H as Ve,I as io,J as Bn,K as Re,L as so,M as lo,N as H,O as ut,P as St,Q as co,R as vt,S as Xt,T as po,U as oe,V as gt,W as le,X as qn,a as j,b as Se,c as Y,d as Yt,e as In,f as Fn,g as pt,h as ae,i as he,j as se,k as A,l as re,m as V,n as Ue,o as we,p as Qt,q as ve,r as ue,s as no,t as wt,u as ao,v as Dn,w as Wn,x as Q,y as De,z as ro}from"./chunk.T56SOSIR.js";import{b as Hn,c as eo,d as to,e as Xe,f as Gn,h as ee}from"./chunk.JRU5BT7K.js";import{a as Zr,d as Xr,e as Jr}from"./chunk.UGFDSE37.js";import{a as Vr,c as jr,f as _r,g as zr,i as Yr,j as Qr}from"./chunk.EG2N5F6L.js";import{a as _t,b as zt}from"./chunk.PXQVXBNG.js";import{a as Hr,b as Ir,c as Fr,d as $n}from"./chunk.7NFCI4LH.js";import{b as $r}from"./chunk.RUTZEEBR.js";import{a as Dr,b as Wr,d as Vt,e as Gr,f as Kr,g as Br,j as jt}from"./chunk.GZWC72HS.js";import{m as Or}from"./chunk.ULTYDYTS.js";import{a as Sr,b as vr,c as br,e as Er,f as On,h as Bt}from"./chunk.UXNZPPWR.js";import{d as Pr,e as Ar,f as Cr,g as Rr,n as Gt,o as Lr,q as Tr,s as Kt}from"./chunk.GYO57LKD.js";import{a as It,b as Za,c as Xa,d as Ft,e as Ja}from"./chunk.KWMBRB6O.js";import{b as or,c as yr,e as hr,f as En}from"./chunk.G226CUJQ.js";import{a as Tn,b as fr}from"./chunk.AQJD23AN.js";import{a as qt,b as Ut,c as Mr,e as Nr}from"./chunk.6S3B4XC4.js";import{a as ct,b as gr,e as mr}from"./chunk.52Y37IAD.js";import{a as Mn}from"./chunk.4DCPB67O.js";import{a as Rn,b as ar,c as rr}from"./chunk.Y4VOCJ7R.js";import{a as wr}from"./chunk.IYVBJDR7.js";import{c as sr,d as lr,e as dr,f as cr,k as Ze,l as pr}from"./chunk.VTCPA4V4.js";import{a as ir}from"./chunk.FGJM4LJO.js";import{r as Ln,s as ur}from"./chunk.TTFYXKLI.js";import{b as er,c as tr,d as Dt,e as nr,l as Wt}from"./chunk.S2ATSY6P.js";import{H as qr,K as Ur,c as Ya,d as Qa,r as kr,s as xr,z as Nn}from"./chunk.G6DISMVT.js";import{c as ni}from"./chunk.W54NXXC5.js";import{Ba as Ht,G as Ne,L as Da,N as Wa,Qa as za,R as Ga,T as U,U as Cn,Y as Ka,Z as Ba,ba as qa,ca as ie,fa as Ua,ga as Va,ia as ja,ma as lt,oa as _a,qa as dt,r as Fa,v as Ie}from"./chunk.B3T4N2XM.js";import{a as Ia}from"./chunk.SDO3U72B.js";import{$a as Ra,Ed as An,Fd as $a,J as ba,Kd as Ha,Nc as Na,U as ht,Za as Ca,ca as st,da as pe,fa as Ye,ga as Mt,hc as Ta,ia as qe,ka,la as xa,lb as xn,ma as Qe,mb as La,md as Pn,oc as Ea,qc as Ma,sd as Ot,td as Oa,vd as $t,wb as Nt,xa as Pa,ya as Aa}from"./chunk.6W2DUW5S.js";import{b as I}from"./chunk.AJZBJBMO.js";function uo(e,t,n={}){let a=e.graph.getNode(t);if(!a)return;let r=e.schema.tryDefinition(a.kind),o=i=>pe(e.schema.tryDefinition(i.kind),i),l=new Map;for(let i of e.graph.allEdges()){let s=i.from===t?"out":i.to===t?"in":null;if(!s)continue;let c=s==="out"?i.to:i.from,g=e.graph.getNode(c);if(!g)continue;let u=(s==="out"?r:e.schema.tryDefinition(g.kind))?.edges?.[i.kind],p=s==="in"?u?.inverse??u?.description:u?.description,x=`${i.kind}|${s}|${p??""}`;(l.get(x)??(()=>{let W={edgeKind:i.kind,direction:s,...p?{description:p}:{},targets:[]};return l.set(x,W),W})()).targets.push({id:g.id,kind:g.kind,label:o(g)})}return{id:t,kind:a.kind,label:o(a),fields:Dt(Ze(e.schema,e.graph,a),r),violations:xn(e.violations(n.context),[t]),actions:Mn(e,[t],{focus:t,...n.principal?{principal:n.principal}:{},...n.context?{context:n.context}:{}}),links:[...l.values()].map(i=>{let s=er(i.targets.flatMap(c=>{let g=e.graph.getNode(c.id);return g?[g]:[]}),c=>e.schema.tryDefinition(c));return{...i,targets:[...i.targets].map(c=>s.has(c.id)?{...c,apart:s.get(c.id)}:c).sort((c,g)=>c.label.localeCompare(g.label))}})}}function et(e,t,n={}){return{kind:t,members:e.graph.nodesOfKind(t),actions:Mn(e,[],{kindSelection:[t],...n.principal?{principal:n.principal}:{},...n.context?{context:n.context}:{}})}}function go(e,t){let n=(o,l)=>`${o}|${JSON.stringify(l)}`,a=new Map;for(let o of[...e.affordances,...e.withheld]){if(o.provider!=="invariant")continue;let l=n(o.mutation,o.args);a.has(l)||a.set(l,o.rank??Number.MAX_SAFE_INTEGER)}let r=Number.MAX_SAFE_INTEGER;return[...t].map((o,l)=>({repair:o,declared:l})).sort((o,l)=>(a.get(n(o.repair.mutation,o.repair.args??{}))??r)-(a.get(n(l.repair.mutation,l.repair.args??{}))??r)||o.declared-l.declared).map(o=>o.repair)}function tt(e){let t=e.schema.kinds.map(r=>({kind:r,plural:qe(e.schema,r),count:e.graph.nodesOfKind(r).length})),n=new Map;for(let r of e.graph.allEdges()){let o=e.graph.getNode(r.from),l=e.graph.getNode(r.to);if(!o||!l)continue;let i=`${r.kind}|${o.kind}|${l.kind}`;n.set(i,(n.get(i)??0)+1)}let a=[];for(let{kind:r}of t){let o=e.schema.tryDefinition(r)?.edges??{};for(let[l,i]of Object.entries(o)){let s=i.to==="*"||i.to===void 0?(()=>{let c=[...n.keys()].filter(g=>g.startsWith(`${l}|${r}|`)).map(g=>g.split("|")[2]);return c.length>0?c:["*"]})():i.to;for(let c of s)a.push({edgeKind:l,from:r,to:c,...i.description?{description:i.description}:{},...i.inverse?{inverse:i.inverse}:{},count:n.get(`${l}|${r}|${c}`)??0})}}return{kinds:t,relations:a}}var Ke=I(Ne(),1);var bt=I(Ne(),1);var Le=I(U(),1),ri={problems:"Problems",search:"Search",map:"Connections",places:"Pictures","~draft":"A view drawn"},oi=e=>{try{return decodeURIComponent(e)}catch{return e}};function ii(e,t,n={}){let{store:a}=e,r=a.schema,o=(n.base??"").replace(/\/$/,""),[l="/",i=""]=t.split("#")[0].split("?"),s=(P,E,b)=>({label:P,href:`${o}${E}`,path:E,...b?{current:b}:{}}),c=P=>{let E=n.registry?.sectionOf(P);return E?[E.path===void 0?{label:E.label}:s(E.label,E.path)]:[]},g=P=>n.registry?.sectionOf(P)?.label,k=P=>{let E=g(P);return E===void 0?{}:{section:E}},[u,p,...x]=l.split("/").filter(Boolean).map(oi);if(u===void 0)return{as:"home",label:"Home",trail:[s("Home","/",!0)]};if(u==="places"&&p!==void 0&&x.length===0){let P=new URLSearchParams(i).get("of"),E=new Set(De(a,e.principal)),b=e.views?.places()??[],G=b.find(L=>E.has(L.kind)&&L.as===p&&(!P||j(r,L.kind)===P));if(G){let L=Yt(G.as,Ot(G,b)?j(r,G.kind):void 0);return{as:"place",kind:G.kind,label:G.title,...k(G.kind),trail:[...c(G.kind),s(G.title,L,!0)]}}}let O=x.length===0?Se(r,u):void 0;if(O!==void 0){let P=s(qe(r,O),`/${j(r,O)}`);if(p===void 0)return{as:"list",kind:O,label:P.label,...k(O),trail:[...c(O),{...P,current:!0}]};let E=a.graph.getNode(p),b=E&&E.kind===O?pe(r.tryDefinition(O),E):"Nothing lives here";return{as:"record",kind:O,id:p,label:b,...k(O),trail:[...c(O),P,s(b,Y(r,O,p),!0)]}}let W=ri[u]??si((x.at(-1)??p??u).replace(/[-_]+/g," "));return{as:"page",label:W,trail:[s(W,l,!0)]}}var si=e=>e.charAt(0).toUpperCase()+e.slice(1),Un=(0,bt.createContext)(null);function li(e){let t=me(),n=Je("/");return ee(e.context.store),ii(e.context,`${t.pathname}${t.search}`,{registry:e.registry,base:n})}var di={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0},mo={display:"flex",alignItems:"center",gap:6,minWidth:0},fo={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,lineHeight:"24px"};function mt({context:e,style:t}){let n=(0,bt.useContext)(Un),a=(0,bt.useContext)(St);return vt(a??pi,"trail")||n?.registry?.without().has("trail")?null:(0,Le.jsx)(ci,{root:n??{context:e,registry:void 0},context:e,...t?{style:t}:{}})}function ci({root:e,context:t,style:n}){let a=li(e);return a.trail.length<2?null:(0,Le.jsx)(ui,{here:a,mark:a.as==="record"?{kind:a.kind,context:t}:void 0,...n?{style:n}:{},"data-testid":"page-trail"})}var pi={count:()=>0,place:()=>()=>{},subscribe:()=>()=>{}};function ui({here:e,mark:t,style:n,...a}){let r=e.as==="record"?e.trail.length-2:-1;return(0,Le.jsx)("nav",{"aria-label":"You are here","data-graview-trail":"",style:{minWidth:0,...n},...a,children:(0,Le.jsx)("ol",{style:{...he,listStyle:"none",padding:0,display:"flex",alignItems:"center",gap:6,minWidth:0,overflow:"hidden"},children:e.trail.map((o,l)=>(0,Le.jsxs)("li",{style:o.current?di:{...mo,flexShrink:l===e.trail.length-2?0:1,maxWidth:"100%"},...o.current?{"aria-current":"page"}:{},children:[l>0&&!o.current?(0,Le.jsx)("span",{"aria-hidden":"true",children:"\u203A"}):null,o.current?o.label:o.path!==void 0?(0,Le.jsxs)(H,{to:o.path,style:{...we,...mo},...l===r?{"data-testid":"trail-list"}:{},children:[l===r&&t?(0,Le.jsx)(ue,{kind:t.kind,brand:t.context.brand,schema:t.context.store.schema,size:8}):null,(0,Le.jsx)("span",{style:fo,children:o.label})]}):(0,Le.jsx)("span",{style:fo,children:o.label})]},`${l}:${o.label}`))})})}var C=I(U(),1);function Oe(e){let t=e.views;if(!t)return[];let n=new Set(De(e.store,e.principal));return t.places().filter(a=>n.has(a.kind))}function Jt(e,t){if(!t.over)return[t.kind];let n=new Set(De(e.store,e.principal));return t.over.filter(a=>a===t.kind||n.has(a))}var nt=e=>`place:${e.kind}:${e.as}`;function fe(e,t){return Yt(t.as,Ot(t,e.views?.places()??[])?j(e.store.schema,t.kind):void 0)}function kt(e,t){let n=e.schema.tryDefinition(t);return e.graph.nodesOfKind(t).filter(a=>st(n,a))}function Vn(e,t,n){let a=(o,l)=>Mt(e.schema,l,o),r=(typeof t=="string"?[t]:t).map(o=>a(kt(e,o).length,o)).join(" and ");return n?`${r} across ${a(kt(e,n).length,n)}`:r}function jn({context:e,place:t,chosen:n,filter:a}){let{store:r,views:o,invariantContext:l}=e,s=o?.resolve(t.kind,{cardinality:"many",fidelity:"full"},t.as)?.view,c=[...new Set(r.violations(l).flatMap(u=>u.nodeIds))],g=Jt(e,t).flatMap(u=>kt(r,u));if(!s)return null;let k=gi(r,g,a,c);return(0,C.jsx)(Ln,{kind:t.kind,view:t.title,children:(0,C.jsx)(gt,{when:dt(s),children:(0,C.jsx)(s,{nodes:k,label:t.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1,...n&&n.length>0?{implicated:n}:{},...c.length>0?{flagged:c}:{}})})})}function gi(e,t,n,a){let r=n?$t({filter:n}).filter??[]:[];return r.length===0?t:Bt(t,{filter:r},{schema:e.schema,graph:e.graph,flagged:new Set(a)}).nodes}function mi({store:e,views:t,as:n,invariantContext:a}){ee(e);let r={store:e,views:t,...a?{invariantContext:a}:{}},o=t.places().find(l=>l.as===n);return o?(0,C.jsx)(jn,{context:r,place:o}):null}function fi({context:e,kind:t}){let{store:n,views:a,invariantContext:r}=e,o=kt(n,t),l=n.schema.tryDefinition(t),i=Q(n,t),c=a?.resolve(t,{cardinality:"many",fidelity:"full"})?.view,g=[...new Set(n.violations(r).flatMap(x=>x.nodeIds))];if(c&&!lt(c))return(0,C.jsx)(Ln,{kind:t,children:(0,C.jsx)(c,{nodes:o,label:i,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1,...g.length>0?{flagged:g}:{}})});let k=a?.resolve(t,{cardinality:"one",fidelity:"summary"})?.view,u=8,p=o.slice(0,u);return(0,C.jsxs)("div",{"data-testid":"kind-sheet",style:k?{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:[p.map(x=>k?(0,C.jsx)(k,{node:x,fidelity:"summary",cardinality:"one",mode:"fullscreen",selected:!1,...g.includes(x.id)?{flagged:[x.id]}:{}},x.id):(0,C.jsx)("span",{style:{padding:"8px 14px",borderRadius:8,border:"1px solid var(--graview-edge-bright)",background:"var(--graview-ground)",color:"var(--graview-ink)"},children:pe(l,x)},x.id)),o.length>u?(0,C.jsxs)("span",{style:{...A,alignSelf:"center",padding:"0 6px"},children:["+",o.length-u," more ",i.toLowerCase()]}):null]})}function _n(e){let{store:t}=e,n=ro(e),a=Oe(e),r=e.views?.arrangement?.()?.order??[],o=s=>{let c=s.name===void 0?-1:r.indexOf(`view:${s.name}`);return c>=0?c-r.length:n.indexOf(s.kind)},l=Pn([...a].sort((s,c)=>o(s)-o(c))).filter(s=>!s.hidden),i=new Set(l.flatMap(s=>s.over??[s.kind]));return[...l.map(s=>({key:nt(s),kind:s.kind,title:Oa(s,a,t.schema),to:fe(e,s),place:s})),...Zt(e).filter(s=>!i.has(s)).map(s=>({key:`kind:${s}`,kind:s,title:Q(t,s),to:`/${j(t.schema,s)}`}))]}var yo=.72,yi=540,ho=16/10;function hi(e){let t=(0,Ke.useRef)(null),[n,a]=(0,Ke.useState)(e);return(0,Ke.useLayoutEffect)(()=>{let r=t.current;if(!r||typeof ResizeObserver>"u")return;let o=()=>{let i=r.getBoundingClientRect().width;i>0&&a(s=>Math.abs(s-i)<.5?s:i)};o();let l=new ResizeObserver(o);return l.observe(r),()=>l.disconnect()},[]),{ref:t,width:n}}function wi(e){for(let t=e.parentElement;t;t=t.parentElement)if(/(auto|scroll)/.test(getComputedStyle(t).overflowY))return t;return null}function Si(e){let[t,n]=(0,Ke.useState)(()=>typeof IntersectionObserver>"u");return(0,Ke.useLayoutEffect)(()=>{let a=e.current;if(t||!a)return;let r=new IntersectionObserver(o=>{o.some(l=>l.isIntersecting)&&(r.disconnect(),n(!0))},{root:wi(a),rootMargin:"50% 0px"});return r.observe(a),()=>r.disconnect()},[t,e]),t}function zn({context:e,entry:t}){let{store:n,brand:a,principal:r}=e,{ref:o,width:l}=hi(yi),i=Si(o),s=l/yo,c=kt(n,t.kind),g=n.schema.tryDefinition(t.kind),k=c.length===0?et(n,t.kind,{...r?{principal:r}:{},...e.invariantContext?{context:e.invariantContext}:{}}).actions.affordances[0]:void 0,u=t.place!==void 0;return(0,C.jsxs)(H,{to:t.to,"data-testid":u?"place-card":"kind-card",className:"graview-gallery-card",style:{...we,display:"grid",gap:10,alignContent:"start",minWidth:0},children:[(0,C.jsxs)("span",{ref:o,"data-testid":u?"place-picture":"kind-picture","aria-hidden":"true",inert:!0,style:{display:"block",position:"relative",width:"100%",aspectRatio:`${ho}`,overflow:"hidden",borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",pointerEvents:"none"},children:[(0,C.jsx)("span",{style:{position:"absolute",left:0,top:0,width:s,height:s/ho,display:"grid",gridTemplateRows:"minmax(0, 1fr)",transform:`scale(${yo})`,transformOrigin:"0 0"},children:i?(0,C.jsx)(Vt.Provider,{value:null,children:t.place?(0,C.jsx)(jn,{context:e,place:t.place}):(0,C.jsx)(fi,{context:e,kind:t.kind})}):null}),c.length===0?(0,C.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,C.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,C.jsxs)("span",{style:{fontFamily:Fn,fontWeight:"var(--graview-weight-display)"},children:["No ",Q(n,t.kind).toLowerCase()," yet"]}),k?(0,C.jsxs)("span",{style:A,children:["Begin with \u201C",k.label,"\u201D"]}):null]})}):null]}),(0,C.jsxs)("span",{style:{display:"grid",gap:2,minWidth:0},children:[(0,C.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0},children:[u?null:(0,C.jsx)(ue,{kind:t.kind,brand:a,schema:n.schema,size:8}),(0,C.jsx)("span",{style:{fontFamily:Fn,fontSize:"var(--graview-text-heading)",fontWeight:"var(--graview-weight-display)",lineHeight:1.3,overflowWrap:"anywhere",textWrap:"balance"},children:t.title})]}),(0,C.jsxs)("span",{style:A,children:[t.place?Vn(n,Jt(e,t.place),t.place.across):Vn(n,t.kind),!u&&g?.description?` \xB7 ${g.description}`:null]})]})]})}var wo={display:"grid",gap:"32px 28px",gridTemplateColumns:"repeat(auto-fill, minmax(min(420px, 100%), 1fr))"},vi=`
|
|
2
|
+
.graview-gallery-card > span:first-child { transition: border-color 160ms ease, box-shadow 160ms ease; }
|
|
3
|
+
.graview-gallery-card:hover > span:first-child,
|
|
4
|
+
.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); }
|
|
5
|
+
`;function Yn({context:e}){ee(e.store);let t=_n(e);return t.length===0?null:(0,C.jsxs)("section",{style:wo,"data-testid":"gallery",children:[(0,C.jsx)("style",{children:vi}),t.map(n=>(0,C.jsx)(zn,{context:e,entry:n},n.key))]})}function Qn({context:e}){let{store:t}=e;ee(t);let n=Pn(Oe(e)).filter(r=>!r.hidden),a=_n(e);return(0,C.jsxs)(oe,{context:e,style:pt,children:[(0,C.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,C.jsx)("p",{style:he,children:n.length===0?"None of its own yet":`${n.length} ${n.length===1?"picture":"pictures"}`}),(0,C.jsx)(le,{context:e,children:"Pictures"}),(0,C.jsx)("p",{style:se,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,C.jsx)("div",{style:wo,"data-testid":"places",children:a.map(r=>(0,C.jsx)(zn,{context:e,entry:r},r.key))}):null]})}var bi={lede:!0},ki={lede:!1},xi={...se,textWrap:"pretty"};function Pi(e,t){if(t===void 0)return;let[n]=cr(dr([t]),pr(e.store,null,null,e.brand?{money:e.brand}:{}));return n?.t==="headline"&&!n.problem&&n.text.trim()!==""?n.text:void 0}function Zn({context:e}){let{store:t,principal:n}=e;ee(t);let a=Ve(),r=Ge(),[o]=ut(),l=decodeURIComponent(a.as??""),[i,s]=(0,Ke.useState)(null),c=o.get("of"),g=o.get("filter"),u=Oe(e).find(L=>L.as===l&&(!c||j(t.schema,L.kind)===c));if(!u)return(0,C.jsxs)(oe,{context:e,children:[(0,C.jsx)(le,{context:e,children:"No picture is called that."}),(0,C.jsx)("p",{style:se,children:(0,C.jsx)(H,{to:"/places",style:Ue,children:(0,C.jsx)(Xe,{children:"The pictures there are"})})})]});let p=Q(t,u.kind),x=e.views?.resolve(u.kind,{cardinality:"many",fidelity:"full"},u.as)?.view,O=x?.flows===!0,W=x?.ownHeading===!0,P=x?.creates!==!1,E=Pi(e,x?.lede),b=et(t,u.kind,{...n?{principal:n}:{},...e.invariantContext?{context:e.invariantContext}:{}}),G=P?b.actions.affordances.map(L=>({affordance:L,mutation:t.allMutations().find(T=>T.name===L.mutation)})).filter(L=>L.mutation!==void 0):[];return(0,C.jsxs)(oe,{context:e,style:{...pt,gap:"var(--graview-space-6, 32px)"},children:[(0,C.jsxs)("header",{style:{display:"grid",gap:"var(--graview-space-2, 8px)"},children:[(0,C.jsx)(mt,{context:e}),(0,C.jsx)(le,{context:e,unseen:W,children:u.title}),W?null:(0,C.jsx)("p",{style:xi,"data-testid":"place-lede",...E!==void 0?{"data-graview-lede":"headline"}:{},children:E??`${Vn(t,Jt(e,u),u.across)}.`}),g&&!O?(0,C.jsxs)("p",{style:{...A,margin:0},"data-testid":"place-narrowed",children:[`Only those where ${g.split(",").map(L=>L.replace(":"," is ")).join(" and ")}. `,(0,C.jsx)(H,{to:`?${(()=>{let L=new URLSearchParams(o);return L.delete("filter"),L.toString()})()}`,style:{...V,...A},children:"Show all"})]}):null,(0,C.jsx)("p",{style:{...A,margin:0,display:"flex",flexWrap:"wrap",gap:"4px 16px"},children:Jt(e,u).map((L,T)=>(0,C.jsx)(H,{to:`/${j(t.schema,L)}`,style:{...Ue,...A},...T===0?{"data-testid":"place-as-list"}:{},children:(0,C.jsxs)(Xe,{children:["All ",(L===u.kind?p:Q(t,L)).toLowerCase()," as a list"]})},L))})]}),(0,C.jsx)("div",{"data-testid":"place-lens","data-flows":O?"":void 0,...O?{}:{role:"group","aria-label":u.title,tabIndex:0},style:O?{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:L=>{let T=L.target?.closest("[data-graview-pick]"),ne=T?.getAttribute("data-graview-pick"),J=T?.getAttribute("data-graview-joins");if(J)try{let xe=JSON.parse(J);if(Array.isArray(xe)&&xe.every($e=>typeof $e=="string")){L.preventDefault(),s({at:nt(u),ids:xe});return}}catch{}if(!ne)return;let z=t.graph.getNode(ne);z&&(L.preventDefault(),r(Y(t.schema,z.kind,ne)))},children:(0,C.jsx)(Br.Provider,{value:E!==void 0?bi:ki,children:(0,C.jsx)(jn,{context:e,place:u,filter:g,...i?.at===nt(u)?{chosen:i.ids}:{}})})}),G.length>0?(0,C.jsx)("div",{style:{maxWidth:760,display:"grid",gap:40},"data-testid":"place-creators",children:G.map(({affordance:L,mutation:T})=>(0,C.jsxs)("section",{style:{...re,display:"grid",gap:14},children:[(0,C.jsx)("h2",{style:ae,children:T.title??T.name}),T.description?(0,C.jsx)("p",{style:{...A,margin:0,maxWidth:"58ch"},children:T.description}):null,(0,C.jsx)(Fe,{store:t,mutation:T,prefilled:L.args,open:L.open,label:L.label,...n?{principal:n}:{}})]},L.id))}):null]})}function Ai(e,t=document){let n=_t(e);if(!n)return null;let a=[t,...[...t.querySelectorAll("[data-worker-view]")].flatMap(r=>r.shadowRoot?[r.shadowRoot]:[])];for(let r of a)for(let o of r.querySelectorAll("[id], [data-section]")){let l=o.getAttribute("data-section")??o.id;if(l===e||_t(l)===n)return o}for(let r of a)for(let o of r.querySelectorAll("h1, h2, h3, h4, h5, h6, [role=heading]"))if(_t(o.textContent??"")===n)return o;return null}function So(e,t={}){if(typeof document>"u"||typeof requestAnimationFrame>"u")return()=>{};let n=t.frames??120,a=0,r=()=>{let o=Ai(e,t.root??document);if(o){o.hasAttribute("tabindex")||o.setAttribute("tabindex","-1"),o.scrollIntoView?.({block:"start"}),o.focus({preventScroll:!0});return}n-=1,n>0&&(a=requestAnimationFrame(r))};return a=requestAnimationFrame(()=>{a=requestAnimationFrame(r)}),()=>cancelAnimationFrame(a)}var q=I(Ne(),1);var en=I(Ne(),1);var at=I(U(),1);function vo({context:e}){return ie()?(0,at.jsxs)(at.Fragment,{children:[(0,at.jsx)(Ci,{context:e}),(0,at.jsx)(jr,{face:"pages",on:e.quickAsk??!0})]}):null}function Ci({context:e}){let{store:t}=e,n=ie(),{pathname:a}=me(),r=(0,en.useRef)(n?.setSelection);return r.current=n?.setSelection,(0,en.useEffect)(()=>{let o=r.current;if(!o)return;let[,l,i]=a.split("/"),s=(()=>{if(l==="places"){let g=e.views?.places().find(k=>k.as===decodeURIComponent(i??""));return g?[Ie(g.kind)]:[]}let c=l?Se(t.schema,l):void 0;return c&&i?[decodeURIComponent(i)]:c?[Fa(c)]:[]})();o(c=>c.length===s.length&&c.every((g,k)=>g===s[k])?c:s)},[a]),null}var be=I(Ne(),1);var ko=I(ni(),1);var ge=I(U(),1);var Ri=Ht(Ia(()=>(__graviewPreload(import.meta.url,["./chunk.JRU5BT7K.js","./chunk.UGFDSE37.js","./chunk.EG2N5F6L.js","./chunk.7NFCI4LH.js","./chunk.RUTZEEBR.js","./chunk.GZWC72HS.js","./chunk.ASCTAUFD.js","./chunk.CWPRQSED.js","./chunk.EZXGVTT2.js","./chunk.ULTYDYTS.js","./chunk.2LQ37DC2.js","./chunk.UXNZPPWR.js","./chunk.GYO57LKD.js","./chunk.KWMBRB6O.js","./chunk.G226CUJQ.js","./chunk.AQJD23AN.js","./chunk.R3DWF35R.js","./chunk.XBNASVTY.js","./chunk.6S3B4XC4.js","./chunk.52Y37IAD.js","./chunk.TLQTDKOL.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.VTCPA4V4.js","./chunk.FGJM4LJO.js","./chunk.K7WME4P4.js","./chunk.MDIAWTNK.js","./chunk.PEA4D66Y.js","./chunk.TRPPN2GD.js","./chunk.GZHZLJBF.js","./chunk.TTFYXKLI.js","./chunk.OJGHDWI6.js","./chunk.ICYJ7QJG.js","./chunk.MT45H2T5.js","./chunk.S2ATSY6P.js","./chunk.72Q4R7N6.js","./chunk.G6DISMVT.js","./chunk.W54NXXC5.js","./chunk.B3T4N2XM.js","./chunk.SDO3U72B.js","./chunk.6W2DUW5S.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.VRJ4TULC.js")).then(e=>({default:e.TakeBack}))));function Li({context:e,docked:t,at:n,...a}){let{store:r}=e,o=ee(r),[l]=(0,be.useState)(()=>r.batches().length),i=(0,be.useRef)(!1);return i.current||=o>0||!t&&l>0,i.current?(0,ge.jsx)(be.Suspense,{fallback:null,children:(0,ge.jsx)(Ri,{context:e,docked:t,at:n,since:l,...a})}):null}function Ti(e,t,n){let{store:a,principal:r,embedded:o}=e;(0,be.useEffect)(()=>{if(!n)return;let l=i=>{if(!Jr(i))return;let s=i.target,c=s instanceof Node&&t.current?.contains(s),g=s===document.body||s===document.documentElement||s===document;if(!(!c&&!(g&&!o))&&Zr(a,r)){i.preventDefault();try{Xr(a,r)}catch{}}};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[a,r,o,t,n])}function xo({context:e,registry:t,root:n,children:a}){let r=(0,be.useMemo)(co,[]),o=t?.without()??new Set;return Ti(e,n,!o.has("undo")),(0,ge.jsxs)(St.Provider,{value:r,children:[(0,ge.jsx)(Ei,{context:e,placed:r,without:o}),a]})}function Ei({context:e,placed:t,without:n}){let[a,r]=(0,be.useState)(!1);(0,be.useLayoutEffect)(()=>r(!0),[]);let o=vt(t,"find"),l=vt(t,"undo"),i=me(),s=xr();if(!a)return null;let c=i.pathname.split("/").filter(Boolean),k=(c.length===1?Se(e.store.schema,c[0]):void 0)!==void 0;return(0,ge.jsxs)(ge.Fragment,{children:[!o&&!n.has("find")&&s?(0,ko.createPortal)((0,ge.jsx)(bo,{context:e,narrowsLists:k}),s.slot):null,!o&&!n.has("find")&&!s?(0,ge.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,ge.jsx)(bo,{context:e,narrowsLists:k})}):null,!l&&!n.has("undo")?(0,ge.jsx)(Li,{context:e,docked:!0,at:i.pathname+i.search}):null,s?.own&&!n.has("undo")?(0,ge.jsx)(oo,{context:e,own:s.own}):null]})}function bo({context:e,narrowsLists:t}){return(0,ge.jsx)(St.Provider,{value:null,children:(0,ge.jsx)(qn,{context:e,narrowsLists:t})})}var te=I(Ne(),1);var ke=I(U(),1),Mi=500,Ni=10;function tn(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName==="TEXTAREA"||e.tagName==="SELECT"?!0:e.tagName==="INPUT"&&!["button","submit","reset","checkbox","radio","image","file","color","range"].includes(e.type):!1}function Oi(e){let t=typeof getSelection=="function"?getSelection():null;return t!==null&&!t.isCollapsed&&t.containsNode(e,!0)}function Po(e){let t=e.closest('a[href], button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"])');if(t)return t;let n=document.activeElement;return n instanceof HTMLElement&&n!==document.body?n:null}function Ao({context:e,root:t,children:n}){return ie()===null?(0,ke.jsx)(ke.Fragment,{children:n}):(0,ke.jsx)($i,{context:e,root:t,children:n})}function $i({context:e,root:t,children:n}){let{setMenuAt:a}=qa(),{store:r}=e,o=r.schema,l=Ge(),{pathname:i,search:s}=me(),c=Je("/").replace(/\/$/,""),g=(0,te.useCallback)((w,h)=>e.views?.places().find(R=>R.as===w&&(h===null||R.kind===h)),[e.views]),k=(0,te.useCallback)((w,h)=>{let[R="",$,Z]=w.split("/").filter(Boolean).map(m=>{try{return decodeURIComponent(m)}catch{return m}});if(Z!==void 0)return null;if(R==="places"&&$!==void 0){let m=g($,new URLSearchParams(h).get("of"));return m?{face:"pages",place:m.as,about:[Ie(m.kind)],title:m.title}:null}let X=Se(o,R);return X?$===void 0?{face:"pages",about:[Ie(X)],title:qe(o,X)}:r.graph.getNode($)?{face:"pages",on:$,about:[$]}:null:null},[o,r,g]),u=(0,te.useCallback)(w=>{let h=w.href;try{let R=new URL(h,location.href);if(R.origin===location.origin&&(c===""||R.pathname===c||R.pathname.startsWith(`${c}/`))){let $=k(R.pathname.slice(c.length),R.search);if($)return{...$,href:h}}}catch{}return{face:"pages",about:[],href:h}},[c,k]),p=(0,te.useCallback)(()=>k(i,s)??{face:"pages",about:[]},[k,i,s]),x=(0,te.useCallback)(w=>{let h=p(),R=w.closest("[data-graview-field]")?.getAttribute("data-graview-field");if(R&&h.on!==void 0&&w.closest("[data-graview-pick], a[href]")===null)return{...h,field:R};let $=w.closest("[data-graview-act]")?.getAttribute("data-graview-act");if($)return{...h,act:$};let Z=w.closest("a[href]"),X=w.closest("[data-graview-listed]"),m=[w.closest("[data-graview-pick]")?.getAttribute("data-graview-pick"),X&&(!Z||X.contains(Z)&&Z.classList.contains("graview-spec-item-link"))?X.getAttribute("data-graview-listed"):null].map(_=>_?r.graph.getNode(_):void 0).find(Boolean);if(m)return{face:"pages",on:m.id,about:[m.id],href:`${c}${Y(o,m.kind,m.id)}`};if(Z)return u(Z);let M=w.closest("[data-graview-record]")?.getAttribute("data-graview-record");return M&&r.graph.getNode(M)?{face:"pages",on:M,about:[M]}:h},[p,u,r,o,c]),O=(0,te.useCallback)(w=>{let h=t.current;if(h===null||!h.contains(w)||tn(w)||w.closest("[data-graview-popover]"))return null;let R=x(w);return{face:"pages",on:R.on,about:R.about??[],field:R.field,place:R.place,href:R.href,act:R.act,element:Po(w)}},[x,t]),W=(0,te.useCallback)((w,h,R)=>{let $=x(w);a({...$,x:Math.round(h),y:Math.round(R),returnTo:Po(w)})},[x,a]),P=(0,te.useCallback)(w=>{let h=w.getBoundingClientRect();W(w,h.left+Math.min(16,h.width/2),Math.min(h.bottom,h.top+36))},[W]),E=(0,te.useRef)(0),b=(0,te.useRef)(null),G=(0,te.useRef)(!1),L=()=>{b.current&&clearTimeout(b.current.timer),b.current=null};(0,te.useEffect)(()=>L,[]),(0,te.useEffect)(()=>{let w=h=>{if(h.defaultPrevented||!(h.key==="ContextMenu"||h.key==="F10"&&h.shiftKey))return;let R=t.current,$=h.target instanceof Element?h.target:null,Z=$===null||$===document.body||$===document.documentElement,X=R!==null&&$!==null&&R.contains($);if(!X&&!(Z&&document.querySelector("[data-graview-face='pages']")===R)||tn($)||$?.closest("[data-graview-popover]"))return;h.preventDefault(),E.current=Date.now();let m=X&&$ instanceof HTMLElement?$:R?.querySelector("[data-graview-page-title], main h1, main")??null;m&&P(m)};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[t,P]),(0,te.useEffect)(()=>{let w=t.current;if(!w)return;let h=R=>{let $=R.detail;$&&a({...$,face:"pages"})};return w.addEventListener(Cn,h),()=>w.removeEventListener(Cn,h)},[t,a]);let T=(0,te.useMemo)(()=>w=>{if(w.face!=="pages")return null;let h=[],R=w.on===void 0?void 0:r.graph.getNode(w.on),$=w.place===void 0?void 0:e.views?.places().find(de=>de.as===w.place),Z=R?void 0:w.about.length===1&&w.about[0].startsWith("aggregate:")&&!$?Hi(w.about[0]):void 0,X=R?Y(o,R.kind,R.id):$?fe(e,$):Z?`/${j(o,Z)}`:void 0,m=X!==void 0&&i===X.split("?")[0];X!==void 0&&!m&&h.push({id:"open",label:"Open",run:()=>l(X)});let M=X!==void 0?`${c}${X}`:w.href;M!==void 0&&h.push({id:"open-in-a-new-tab",label:"Open in a new tab",run:()=>void window.open(M,"_blank","noopener")});let _=R?`#focus=${encodeURIComponent(R.id)}`:$?`#focus=${encodeURIComponent(Ie($.kind))}&view=${encodeURIComponent($.as)}`:Z?`#focus=${encodeURIComponent(Ie(Z))}`:void 0;if(_!==void 0&&(e.overview||!e.embedded)){let de=e.overview;h.push({id:"in-the-scene",label:"Show in the scene",run:()=>de?de(_):location.assign(`${e.sceneHref??"/"}${_}`)})}return R===void 0&&w.href===void 0&&h.push({id:"find",label:"Find\u2026",run:()=>{let de=t.current?.querySelector('[data-testid="nav-find"]')??document.querySelector('[data-testid="nav-find"]');de&&de.offsetParent!==null?de.focus():l("/search")}}),h.length>0?{id:"pages",items:h}:null},[r,o,e,i,c,l,t]),ne=(0,te.useMemo)(()=>w=>{if(w.face!=="pages"||w.field===void 0||w.on===void 0)return null;let h=r.graph.getNode(w.on),R=w.element?.closest("[data-graview-field]")??t.current?.querySelector(`[data-graview-field="${CSS.escape(w.field)}"]`);return!h||!(R instanceof HTMLElement)||!R.hasAttribute("data-graview-editable")?null:{id:"field",at:"start",items:[{id:"change-field",label:`Change \u201C${ka(o.tryDefinition(h.kind),w.field)}\u201D`,run:()=>R.click()}]}},[r,o,t]),J=zr(),z=yr(),xe=$r(),$e=(0,te.useCallback)((w,h)=>{i===fe(e,w).split("?")[0]&&l(h?fe(e,h):"/")},[i,e,l]),Pe=Qr($e),Ae=(0,te.useMemo)(()=>[ne,xe,T,...Pe?[Pe]:[],...z?[z]:[],...J?[J]:[]],[ne,xe,T,Pe,z,J]);return(0,ke.jsxs)(ur,{sections:Ae,children:[(0,ke.jsx)("div",{"data-graview-menu-ground":"",style:{display:"contents"},onContextMenu:w=>{let h=w.target;w.shiftKey||tn(h)||Oi(h)||(w.preventDefault(),!h.closest("[data-graview-popover]")&&(Date.now()-E.current<700||(w.clientX===0&&w.clientY===0&&h instanceof HTMLElement?P(h):W(h,w.clientX,w.clientY))))},onPointerDown:w=>{if(G.current=!1,w.pointerType==="mouse"||!w.isPrimary)return;let h=w.target;if(tn(h)||h.closest("[data-graview-choose], [data-graview-popover]"))return;L();let{clientX:R,clientY:$}=w;b.current={x:R,y:$,timer:setTimeout(()=>{b.current=null,G.current=!0,E.current=Date.now(),W(h,R,$)},Mi)}},onPointerMove:w=>{let h=b.current;h&&Math.hypot(w.clientX-h.x,w.clientY-h.y)>Ni&&L()},onPointerUp:L,onPointerCancel:L,onClickCapture:w=>{G.current&&(G.current=!1,w.preventDefault(),w.stopPropagation())},children:n}),(0,ke.jsx)(Ii,{openAt:P,readyAt:O}),(0,ke.jsx)(Yr,{placement:"page"}),(0,ke.jsx)(hr,{})]})}function Hi(e){let t=e.slice(10).split("+");return t.length===1&&t[0]?t[0]:void 0}function Ii({openAt:e,readyAt:t}){return(0,ke.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,ke.jsx)(Vr,{placement:"menu",openActs:e,aimAt:t})})}var K=I(U(),1);function Co(e,t){return t==="*"?{label:"anything",path:null}:{label:Q(e,t),path:`/${j(e.schema,t)}`}}function Fi({context:e,relation:t}){let{store:n}=e,a=Co(n,t.from),r=Co(n,t.to),o=l=>l.path?(0,K.jsx)(H,{to:l.path,style:{...we,fontWeight:550},children:l.label}):(0,K.jsx)("span",{children:l.label});return(0,K.jsxs)("li",{"data-testid":"relation","data-relation":t.edgeKind,style:{display:"grid",gridTemplateColumns:"30px minmax(0, 1fr) auto",gap:12,alignItems:"baseline"},children:[(0,K.jsx)(_r,{edgeKind:t.edgeKind,...e.brand?.kit?{kit:e.brand.kit}:{}}),(0,K.jsxs)("span",{style:{display:"grid",gap:1},children:[(0,K.jsxs)("span",{children:[o(a)," ",(0,K.jsxs)("span",{style:A,"data-graview-speaks-ids":"",children:[Ye(t.edgeKind)," \u2192"]})," ",o(r)]}),t.description||t.inverse?(0,K.jsxs)("span",{style:A,children:[t.description?Ce(t.description):null,t.description&&t.inverse?" \xB7 ":null,t.inverse?`from the other end, ${t.inverse}`:null]}):null]}),r.path?(0,K.jsx)(H,{to:`${r.path}?with=${encodeURIComponent(t.edgeKind)}`,style:{...V,...A,fontVariantNumeric:"tabular-nums",display:"inline-block",minWidth:24,minHeight:24,textAlign:"center"},title:`The ${r.label.toLowerCase()} that have this`,children:t.count}):(0,K.jsx)("span",{style:{...A,fontVariantNumeric:"tabular-nums"},children:t.count})]})}function Ro({context:e,heading:t=!0}){let{store:n}=e,a=new Set(De(n,e.principal)),r=tt(n).relations.filter(o=>a.has(o.from)&&(o.to==="*"||a.has(o.to)));return r.length===0?null:(0,K.jsxs)("section",{style:{...re,display:"grid",gap:12},"data-testid":"kind-map",children:[t?(0,K.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[(0,K.jsx)("h2",{style:ae,children:(0,K.jsx)(H,{to:"/map",style:we,children:"Connections"})}),(0,K.jsx)("span",{style:A,children:r.length===1?"1 relation":`${r.length} relations`})]}):null,(0,K.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:r.map(o=>(0,K.jsx)(Fi,{context:e,relation:o},`${o.edgeKind}|${o.from}|${o.to}`))})]})}function Xn({context:e}){let{store:t}=e;ee(t);let n=new Set(De(t,e.principal)),a=tt(t),r=a.relations.filter(o=>n.has(o.from));return(0,K.jsxs)(oe,{context:e,children:[(0,K.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,K.jsx)("p",{style:he,children:r.length===0?"No relations":`${r.length} ${r.length===1?"relation":"relations"}`}),(0,K.jsx)(le,{context:e,children:"Connections"}),(0,K.jsx)("p",{style:se,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,K.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"6px 18px"},"data-testid":"map-kinds",children:a.kinds.filter(o=>n.has(o.kind)).map(o=>(0,K.jsxs)("li",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[(0,K.jsx)(ue,{kind:o.kind,brand:e.brand,schema:t.schema,size:7}),(0,K.jsx)(H,{to:`/${j(t.schema,o.kind)}`,style:V,children:o.plural}),(0,K.jsx)("span",{style:A,children:o.count})]},o.kind))}),(0,K.jsx)(Ro,{context:e,heading:!1})]})}function Lo({context:e}){let n=[...ie()?.robots.values()??[]].filter(r=>r.mode==="asking"&&r.say);if(n.length===0)return null;let{store:a}=e;return(0,K.jsxs)("section",{style:{...re,display:"grid",gap:10},"data-testid":"seat-questions",children:[(0,K.jsx)("h2",{style:ae,children:n.length===1?"The seat asked something":`The seat asked ${n.length} things`}),(0,K.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:8},children:n.map(r=>{let o=r.at?a.graph.getNode(r.at):void 0;return(0,K.jsxs)("li",{style:{display:"grid",gap:2},children:[(0,K.jsx)("span",{children:r.say}),o?(0,K.jsxs)(H,{to:Y(a.schema,o.kind,o.id),style:{...V,...A},children:[pe(a.schema.tryDefinition(o.kind),o)," \u2192"]}):null]},r.participant)})})]})}var B=I(U(),1);function Jn({context:e}){let{principal:t}=e,{store:n,brand:a,invariantContext:r}=e;ee(n);let o=n.violations(r),l=`${o.length===1?"A rule is broken":"Rules are broken"} \u2014 see what, and what would fix it`,i=[...n.log.all()].slice(-5).reverse(),c=Zt(e).map(P=>({kind:P,members:n.graph.nodesOfKind(P).filter(E=>st(n.schema.tryDefinition(P),E))})),g=c.filter(P=>P.members.length>0),k=c.map(P=>({entry:P,creator:n.allMutations().find(E=>(E.creates??[]).includes(P.kind)&&n.permits({name:E.name,args:{}},e.principal).ok)})).find(P=>P.creator!==void 0),u=g.length===0?"Nothing here yet.":`${g.map(P=>Mt(n.schema,P.kind,P.members.length)).join(", ").replace(/, ([^,]*)$/," and $1")}.`,p=e.views?.homeView?.(),x=n.schema.kinds.some(P=>n.graph.nodesOfKind(P).length>0);if(p&&x){let P=a?.subtitle&&a.subtitleDrawn!==!1?(0,B.jsx)("p",{style:{...A,margin:0},"data-testid":"app-subtitle",children:a.subtitle}):null,E=p[Symbol.for("graview.home-blocks")]===!0;return(0,B.jsx)(oe,{context:e,style:pt,children:(0,B.jsxs)("div",{style:{display:"grid",gap:12},"data-testid":"home-view",children:[E?null:P,o.length>0?(0,B.jsx)(H,{to:"/problems",style:{...V,color:"var(--graview-warn)"},children:l}):null,(0,B.jsx)(Kr.Provider,{value:E?P:null,children:(0,B.jsx)(gt,{when:dt(p),children:(0,B.jsx)(p,{cardinality:"many",fidelity:"full",mode:"fullscreen",selected:!1})})})]})})}let O=new Set(De(n,e.principal)),W=tt(n).relations.filter(P=>O.has(P.from)&&(P.to==="*"||O.has(P.to)));return(0,B.jsxs)(oe,{context:e,style:pt,children:[(0,B.jsxs)("header",{style:{display:"grid",gap:12},children:[a?.subtitle&&a.subtitleDrawn!==!1?(0,B.jsx)("p",{style:{...A,margin:0},"data-testid":"app-subtitle",children:a.subtitle}):null,(0,B.jsx)(le,{context:e,"data-testid":"standing",children:u}),(0,B.jsxs)("p",{style:{...se,display:"grid",gap:4},"data-testid":"standing-card",children:[g.length===0&&k?(0,B.jsxs)("span",{children:["Begin with \u201C",k.creator?.title??k.creator?.name,"\u201D, under"," ",(0,B.jsx)(H,{to:`/${j(n.schema,k.entry.kind)}`,style:V,children:Q(n,k.entry.kind)}),"."]}):null,o.length===0?(0,B.jsx)("span",{children:"All rules hold."}):(0,B.jsx)(H,{to:"/problems",style:{...V,color:"var(--graview-warn)"},children:l})]})]}),(0,B.jsx)(Yn,{context:e}),(0,B.jsxs)("section",{style:{...re,display:"grid",gap:14},"data-testid":"kinds",children:[(0,B.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[(0,B.jsx)("h2",{style:ae,children:"What is here"}),W.length>0?(0,B.jsx)(H,{to:"/map",style:{...Ue,...A,marginLeft:"auto"},"data-testid":"map-link",children:(0,B.jsxs)(Xe,{children:["Connections \xB7 ",W.length===1?"1 relation":`${W.length} relations`]})}):null]}),(0,B.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"8px 10px"},children:c.map(({kind:P,members:E})=>(0,B.jsx)("li",{style:{maxWidth:"100%"},children:(0,B.jsxs)(H,{to:`/${j(n.schema,P)}`,style:{...we,flexWrap:"wrap",gap:8,padding:"6px 14px 6px 10px",borderRadius:8,border:"1px solid var(--graview-edge-bright)",background:"var(--graview-panel)"},children:[(0,B.jsx)(ue,{kind:P,brand:a,schema:n.schema,size:7}),(0,B.jsx)("span",{style:{fontWeight:550,overflowWrap:"anywhere"},children:Q(n,P)}),(0,B.jsx)("span",{style:{...A,fontVariantNumeric:"tabular-nums"},children:E.length===0?"none yet":ht(E.length)})]})},P))})]}),i.length>0?(0,B.jsxs)("section",{style:{...re,display:"grid",gap:10},children:[(0,B.jsx)("h2",{style:ae,children:"Recently"}),(0,B.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:i.map(P=>(0,B.jsxs)("li",{style:A,children:[(0,B.jsx)("span",{style:{color:"var(--graview-ink)"},children:P.intent})," \u2014 ",wt(P,t,{graph:n.graph,schema:n.schema,...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{}})]},P.id))})]}):null]})}var To=I(Ne(),1);function Eo(e,t){(0,To.useEffect)(()=>{let n=globalThis[Symbol.for("graview.shown-lists")]??=new Map;return n.set(e,()=>t),()=>void n.delete(e)})}var ea=e=>(__graviewPreload(import.meta.url,["./chunk.AJZBJBMO.js"]),import("./chunk.6YGRRXJB.js")).then(t=>t.saveShownList(e.read()));function Mo(e,t,n){let a={off:e,about:t,read:n,menu:(r,o,l)=>[...e?[]:[{id:"export-csv",label:"Export CSV",run:()=>void ea(a)}],...r&&o?[{id:e?"export-on":"export-off",label:e?"Turn on export":"Turn off export",run:()=>void (__graviewPreload(import.meta.url,["./chunk.AJZBJBMO.js"]),import("./chunk.6YGRRXJB.js")).then(i=>i.switchExport(a,o,e,l))}]:[]]};return a}function ta(e){let{schema:t,graph:n,kind:a,nodes:r,arrangement:o,offers:l,declaredGroup:i}=e,s=t.tryDefinition(a),c=Gt(o.query??""),g=[...o.filter??[],...c.conditions],k=g.some(T=>T.key==="is"&&(T.value==="past"||T.value==="any"))||Pr(s,g),u=k||!s?.lifecycle?o:{...o,filter:[...o.filter??[],{key:"is",value:"current"}]},p=new Map,x=Bt(r,u,{schema:t,graph:n,...e.flagged?{flagged:e.flagged}:{},...e.today!==void 0?{today:e.today}:{},read:(T,ne)=>{let J=p.get(T.id);return J||p.set(T.id,J=Ze(t,n,T)),J[ne]}}),O=x.grouped&&!!o.group?.by,W=i&&o.group?.by===i.by&&!o.group.bucket?l.groups.find(T=>T.key===i.by):void 0,P=i&&W&&(W.type==="choice"||W.type==="boolean")?br(x.groups,i,{type:W.type,...W.options?{options:W.options}:{}}):x.groups.map(T=>({...T,closed:!1})),E=!!o.query||(o.filter??[]).some(T=>T.key===i?.by),b=T=>W?.type==="boolean"?T==="1"?"true":"false":T,G=e.opened??new Set,L=P.map(T=>{let ne=b(T.key);return{...T,value:ne,shut:T.closed&&!E&&!G.has(ne)}});return{arrangement:u,showingPast:k,arranged:x,grouped:O,groups:L,nodes:O?L.flatMap(T=>T.shut?[]:T.nodes):x.nodes}}var Te=I(Ne(),1);var rt=I(U(),1);function nn({context:e,withheld:t,style:n,testId:a}){let r=ie(),o=Ma(t,e.signIn??r?.signIn);return o?(0,rt.jsx)("p",{style:{...n,margin:0},children:(0,rt.jsx)("button",{type:"button","data-testid":"sign-in",onClick:()=>o.run(),style:ve,children:o.label})}):t.length===0?null:(0,rt.jsx)("ul",{style:{...n,margin:0,padding:0,listStyle:"none",display:"grid",gap:4},...a?{"data-testid":a}:{},children:t.map(l=>(0,rt.jsxs)("li",{style:A,children:[(0,rt.jsx)("s",{children:l.label})," \u2014 ",l.refusal.message]},l.id))})}var N=I(U(),1);function na({context:e}){let{store:t,brand:n,principal:a,invariantContext:r}=e;ee(t);let[o]=ut(),l=o.get("q")??"",i=typeof r?.today=="string"?r.today:void 0,s=Tr(t,l,{...a?{principal:a}:{},places:Oe(e),flagged:new Set(t.violations(r).flatMap(p=>p.nodeIds)),...i?{today:i}:{},limit:200}),c=s.hits.filter(p=>p.about==="node"),g=s.hits.filter(p=>p.about==="kind"||p.about==="place"||p.about==="rule"),k=[...new Set(c.map(p=>p.kind))],u=l.trim();return(0,N.jsxs)(oe,{context:e,children:[(0,N.jsx)("style",{children:Qt}),(0,N.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,N.jsx)("p",{style:he,children:"Search"}),(0,N.jsx)(le,{context:e,"data-testid":"search-heading",children:u.length===0?"Find anything by its name":s.hits.length===0?(0,N.jsxs)(N.Fragment,{children:["Nothing here is called \u201C",u,"\u201D."]}):(0,N.jsxs)(N.Fragment,{children:[Di(t,s.byKind)," for \u201C",u,"\u201D"]})}),u.length>0?(0,N.jsxs)("p",{style:{...A,margin:0},"data-testid":"search-searched",children:[Kt(t.schema,s.searched),s.conditions.filter(p=>p.key!=="is"&&p.admittedBy.length<s.searched.kinds.length).map(p=>(0,N.jsxs)("span",{children:[" ",p.key,":",p.value," narrows"," ",p.admittedBy.length===0?"nothing here":p.admittedBy.map(x=>Q(t,x).toLowerCase()).join(" and "),"."]},`${p.key}:${p.value}`))]}):(0,N.jsxs)("p",{style:se,children:["Type in the box above. Words find the start of words in names and in what each record says;"," ",(0,N.jsx)("code",{children:"done:false"})," and the like narrow as a list does, and ",(0,N.jsx)("code",{children:"is:any"})," includes what is past."]})]}),g.length>0?(0,N.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},"data-testid":"search-named",children:g.map(p=>(0,N.jsx)("li",{"data-testid":"search-hit","data-about":p.about,children:p.about==="kind"?(0,N.jsxs)(H,{to:`/${j(t.schema,p.kind)}`,style:V,children:[p.label,p.count>0?(0,N.jsxs)("span",{style:A,children:[" \xB7 ",p.count," match"]}):null]}):p.about==="place"?(0,N.jsxs)(H,{to:fe(e,p),style:V,children:["Go to ",p.title]}):p.about==="rule"?(0,N.jsxs)(H,{to:"/problems",style:V,children:["The rule \u201C",p.label,"\u201D"]}):null},`${p.about}:${p.about==="rule"?p.name:p.about==="place"?p.as:p.kind}`))}):null,k.map(p=>(0,N.jsxs)("section",{className:"graview-list",style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",minWidth:0},"data-testid":"search-group","data-kind":p,children:[(0,N.jsxs)("h2",{className:"graview-group-head",style:{alignItems:"center"},children:[(0,N.jsx)(ue,{kind:p,brand:n,schema:t.schema,size:8}),(0,N.jsx)(H,{to:`/${j(t.schema,p)}?${new URLSearchParams({q:u}).toString()}`,style:V,"data-testid":"search-kind-link",children:Q(t,p)}),(0,N.jsx)("span",{children:s.byKind[p]})]}),(0,N.jsx)("ul",{className:"graview-rows",children:c.filter(x=>x.kind===p).map(x=>(0,N.jsxs)("li",{"data-testid":"search-hit","data-about":"node",className:"graview-row",children:[(0,N.jsxs)(H,{to:Y(t.schema,p,x.id),className:"graview-row-title",...x.label.length>60?{title:x.label}:{},children:[x.flagged?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("span",{role:"img","aria-label":"Breaks a rule:",style:{color:"var(--graview-warn)"},children:"\u26A0"})," "]}):null,x.label]}),x.apart||!x.current?(0,N.jsx)("span",{className:"graview-row-glance",children:[x.apart,x.current?"":"past"].filter(Boolean).join(" \xB7 ")}):null,(0,N.jsx)(an,{why:x.why})]},x.id))})]},p)),u.length>0?(0,N.jsx)(Wi,{asked:u}):null,u.length>0&&s.hits.length===0?(0,N.jsx)(Oo,{store:t,kinds:s.searched.kinds,words:s.words,...a?{principal:a}:{},...r?{invariantContext:r}:{}}):null]})}function an({why:e}){return e.strength==="near"?(0,N.jsxs)("span",{style:A,"data-testid":"search-why","data-near":"",children:["Near \u201C",e.asked,"\u201D",e.field==="label"?"":` \u2014 ${e.reading}: ${e.fragment}`]}):e.field==="label"?null:(0,N.jsxs)("span",{style:A,"data-testid":"search-why",children:[e.reading,": ",e.fragment]})}function Di(e,t){let n=Object.entries(t).map(([a,r])=>`${r} ${r===1?Qe(e.schema.tryDefinition(a),a):Q(e,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 No(e,t,n={}){let a=[];for(let r of t){let o=et(e,r,{...n.principal?{principal:n.principal}:{},...n.invariantContext?{context:n.invariantContext}:{}});for(let l of rn(e,r,o.actions.affordances))a.some(i=>i.mutation.name===l.mutation.name)||a.push(l)}return a}function rn(e,t,n){let a=e.schema.tryDefinition(t)?.fieldRoles?.label,r=[];for(let o of n){let l=e.allMutations().find(c=>c.name===o.mutation);if(!l||!l.creates?.includes(t)||r.some(c=>c.mutation.name===l.name))continue;let i=wr(l.input).map(c=>c.name),s=i.includes("label")?"label":a&&i.includes(a)?a:void 0;!s||o.args[s]!==void 0||r.push({kind:t,affordance:o,mutation:l,arg:s})}return r}function Oo({store:e,kinds:t,words:n,principal:a,invariantContext:r}){let o=No(e,t,{...a?{principal:a}:{},...r?{invariantContext:r}:{}});return o.length===0||n.trim().length===0?null:(0,N.jsx)("div",{style:{display:"grid",gap:24},"data-testid":"search-to-create",children:o.map(({kind:l,affordance:i,mutation:s,arg:c})=>(0,N.jsxs)("section",{style:{...re,display:"grid",gap:14},children:[(0,N.jsxs)("h2",{style:ae,children:[Ce(xa(Qe(e.schema.tryDefinition(l),l)))," called \u201C",n,"\u201D"]}),(0,N.jsx)(Fe,{store:e,mutation:s,prefilled:i.args,open:i.open,initial:{[c]:n},...a?{principal:a}:{}})]},`${i.id}|${n}`))})}function Wi({asked:e}){let t=ie();return t?(0,N.jsx)(Gi,{asked:e,desk:t.aiDesk}):null}function Gi({asked:e,desk:t}){return Qa(t)?(0,N.jsx)("p",{style:{margin:0},children:(0,N.jsxs)("button",{type:"button","data-testid":"search-ask",onClick:a=>Ya(t,{pointed:{about:[]},asked:e,returnTo:a.currentTarget}),style:{...V,font:"inherit",padding:0,border:0,background:"transparent",cursor:"pointer",textAlign:"start"},children:["Ask: \u2018",e,"\u2019"]})}):null}var f=I(U(),1),Ho=8,Io=40;function Ki(e,t){let n=t?.fields?.shape??{},a=Object.keys(n).find(r=>Aa(n[r])&&Pa(e[r]));return a===void 0?void 0:e[a]}function aa({context:e}){let t=Ve(),n=Se(e.store.schema,t.slug??"");return n?(0,f.jsx)(Fo,{context:e,kind:n}):(0,f.jsx)(oe,{context:e,children:(0,f.jsx)(le,{context:e,children:"No such kind of thing here."})})}function Fo({context:e,kind:t,opening:n,row:a,layout:r="list",description:o,bare:l}){let{store:i,brand:s,invariantContext:c}=e;ee(i);let[g,k]=ut(),u=`list-${(0,Te.useId)().replace(/:/g,"")}`,p=i.schema.tryDefinition(t),x=Ra(g.get("archived")),O=i.graph.nodesOfKind(t,{archived:x}),W=tt(i).relations.filter(d=>d.from===t||d.to===t),P=new Set(i.violations(c).flatMap(d=>d.nodeIds)),E=Rr(i.schema,Cr(i.schema,Ar(i.schema,t))),b=W.map(d=>d.edgeKind),G=_i(g,E,b),L=["sort","filter","group","q","by","with","past","archived",...b].some(d=>g.has(d)),T=O.length>=Io,ne=p?.fieldRoles?.when,J=e.views?.arrangement?.()?.lists?.[t],z=vr(J),xe=Sr(J?.group),$e=ji(T,ne),Pe=n??(z?{...$e,...z}:$e),Ae=L?G.arrangement:On(Pe,E).arrangement,w=z?.sort,h=Ae.sort&&w?.then&&Ae.sort.by===w.by&&Ae.sort.direction===w.direction?{...Ae,sort:w}:Ae,R=Gt(h.query??""),$=new Set((g.get("open")??"").split(",").filter(Boolean)),Z=ta({schema:i.schema,graph:i.graph,kind:t,nodes:O,arrangement:h,offers:E,declaredGroup:xe,flagged:P,...typeof c?.today=="string"?{today:c.today}:{},opened:$}),{showingPast:X,arranged:m}=Z,M=Z.groups,_=ie(),de=Mo(J?.export===!1,{kind:t},()=>({title:Q(i,t),schema:i.schema,graph:i.graph,kind:t,groups:Z.groups,grouped:Z.grouped,onExport:e.onExport??_?.onExport,words:{labelOf:pe,readableFields:Dt,withComputed:Ze}}));Eo(`list:${t}`,de);let Uo=d=>d.shut,Vo=d=>{let y=new URLSearchParams(g),F=new Set($);F.has(d)?F.delete(d):F.add(d),F.size>0?y.set("open",[...F].join(",")):y.delete("open"),k(y,{replace:!0})},Ee=m.nodes,_e=p?.lifecycle&&!X?O.filter(d=>st(p,d)):O,sa=O.length-_e.length,la=h.group?.by??null,jo=d=>{let y=new URLSearchParams(g);for(let ce of["sort","filter","group","q","by","with","past","archived",...W.map(Tt=>Tt.edgeKind)])y.delete(ce);let F=Er(d);for(let ce of["sort","filter","group","q","archived"])F[ce]&&y.set(ce,F[ce]);![...y.keys()].some(ce=>["sort","filter","group","q"].includes(ce))&&(n||z||T||ne)&&y.set("sort",""),k(y)},{principal:ot}=e,dn=et(i,t,{...ot?{principal:ot}:{},...e.invariantContext?{context:e.invariantContext}:{}}),We=dn.actions.affordances.map(d=>({affordance:d,mutation:i.allMutations().find(y=>y.name===d.mutation)})).filter(d=>d.mutation!==void 0),_o=dn.actions.withheld,cn=()=>new Set(Ee.length===0?We.map(({mutation:d})=>d.name):[]),[pn,da]=(0,Te.useState)(()=>({kind:t,open:cn()}));pn.kind!==t&&da({kind:t,open:cn()});let ca=d=>(pn.kind===t?pn.open:cn()).has(d),pa=(d,y)=>da(F=>{let ce=new Set(F.open);return y?ce.add(d):ce.delete(d),{kind:F.kind,open:ce}}),ua=`begin-${(0,Te.useId)().replace(/:/g,"")}`,ga=R.words&&Ee.length===0?Object.fromEntries(rn(i,t,dn.actions.affordances).map(d=>[d.mutation.name,d.arg])):{},ze=Q(i,t),Pt=e.views?.lookup(t,{cardinality:"one",fidelity:"glyph"}),un=Pt!==void 0&&!lt(Pt)?Pt:void 0,gn=(h.group?.bucket??"day")==="day"?h.group?.by:void 0,mn=(h.filter??[]).map(d=>d.key),zo=mn.filter(d=>mn.indexOf(d)===mn.lastIndexOf(d)&&/choice|boolean/.test(E.filters.find(y=>y.key===d)?.type??"")),fn=d=>{let y={...p?.computed?Ze(i.schema,i.graph,d):d};gn&&!String(y[gn]).includes("T")&&delete y[gn];for(let F of zo)delete y[F];return y},ma=d=>ir(p?.fields?.shape?.[d])?.type==="enum",At=d=>{let y=pe(p,d);if(a)return(0,f.jsxs)("li",{"data-testid":"record-row","data-graview-record":d.id,style:{minWidth:0},...bn(d.id),children:[vn(d,y),a(d,{label:y,href:Y(i.schema,t,d.id),flagged:P.has(d.id),glance:ao(fn(d),p,y)})]},d.id);if(un){let kn=jt(Pt,d,i.graph),ei=Object.fromEntries(Object.entries(fn(d)).filter(([ti])=>!kn?.fields.has(ti))),va=kn?Dn(ei,p,kn.title??y,ma):[];return(0,f.jsxs)("li",{"data-testid":"record-row","data-graview-record":d.id,style:{position:"relative",display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:16,rowGap:2,paddingBlock:10,borderTop:"1px solid var(--graview-edge)"},...bn(d.id),children:[vn(d,y),(0,f.jsx)("div",{style:{flex:"1 1 14rem",minWidth:0},children:(0,f.jsx)(un,{node:d,cardinality:"one",fidelity:"glyph",mode:"fullscreen",selected:!1,...P.has(d.id)?{flagged:[d.id]}:{}})}),va.length>0?(0,f.jsx)("span",{style:{...A,flex:"0 1 auto",minWidth:0,overflowWrap:"anywhere"},"data-testid":"record-glance",children:(0,f.jsx)(Wn,{runs:va})}):null,(0,f.jsx)(Qi,{to:Y(i.schema,t,d.id),label:P.has(d.id)?`${y} \u2014 implicated in a problem`:y})]},d.id)}let F=Dn(fn(d),p,y,ma),ce=F.length>0,Tt=R.words?Lr(p,d,R.words):void 0,wa=T?void 0:lr(d,p),Et=Ki(d,p),Sa=(0,f.jsxs)(H,{to:Y(i.schema,t,d.id),className:"graview-row-title",...y.length>60?{title:y}:{},children:[P.has(d.id)?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("span",{role:"img","aria-label":"Breaks a rule:",style:{color:"var(--graview-warn)"},children:"\u26A0"})," "]}):null,y]});return(0,f.jsxs)("li",{className:"graview-row","data-graview-record":d.id,...bn(d.id),children:[vn(d,y),wa?(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,minWidth:0},children:[(0,f.jsx)(ct,{as:"thumb",file:wa}),Sa]}):Sa,ce||Et?(0,f.jsxs)("span",{className:"graview-row-glance",children:[(0,f.jsx)(Wn,{runs:F}),ce&&Et?" \xB7 ":null,Et?(0,f.jsx)(qt,{address:Et}):null]}):null,Tt?(0,f.jsx)(an,{why:Tt}):null]},d.id)},yn=Oe(e).filter(d=>d.kind===t&&!d.hidden),fa=J?.filters,Yo=(h.filter??[]).some(d=>d.key!=="is"||d.value!=="any"),Qo=!!(h.sort||h.group||h.query||Yo),Zo=_e.length>=Ho||L&&Qo,He=h.sort?E.sorts.find(d=>d.key===h.sort.by):void 0,hn=He?.type==="date"||He!==void 0&&He.key===ne,ya=T&&!m.grouped&&He&&(He.about==="label"||He.type==="text"||hn)?d=>{let y=He.about==="label"?pe(p,d):d[He.key];if(typeof y!="string"||y.length===0)return hn?"No date":"#";if(hn)return y.slice(0,4);let F=y.trim().charAt(0).toLocaleUpperCase();return/\p{L}/u.test(F)?F:"#"}:void 0,Ct=ya?Ee.reduce((d,y)=>{let F=ya(y);return d.at(-1)?.key===F?d.at(-1).nodes.push(y):d.push({key:F,nodes:[y]}),d},[]):void 0,ha=Z.nodes,wn=(0,Te.useMemo)(()=>ha.map(d=>d.id),[ha.map(d=>d.id).join(`
|
|
6
|
+
`)]),Me=Hr(wn),Sn=(0,Te.useId)(),ft=(ot?i.permittedMutations(ot):i.permittedMutations()).some(d=>{let y=d.subject?.kinds;return y!==void 0&&(y==="*"||y.includes(t))}),vn=(d,y)=>ft?(0,f.jsx)("span",{className:"graview-choose-at",children:(0,f.jsx)("input",{...Me.boxProps(d.id,y),onPointerEnter:$n,onFocus:$n})}):null,bn=d=>ft?{"data-graview-choose":d}:{},Xo=(0,Te.useCallback)(d=>{Me.choose(d),requestAnimationFrame(()=>{let y=Me.list.current;((d[0]===void 0?null:y?.querySelector(`[data-graview-choose-box="${CSS.escape(d[0])}"]`))??y)?.focus({preventScroll:!0})})},[Me]),it=r==="grid"?{margin:0,padding:0,listStyle:"none",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 15rem), 1fr))",alignItems:"start",gap:12}:a||un?{margin:0,padding:0,listStyle:"none",display:"grid",gap:a&&r==="list"?6:0}:void 0,Rt=it?void 0:"graview-rows",yt=d=>`list-at-${d.replace(/[^\p{L}\p{N}]/gu,"_")}`,Lt=W.map(d=>{let y=d.from===t?d.to:d.from,F=d.from===t?d.description:d.inverse??d.description;return{relation:d,far:y,words:F}}),Jo=new Set(Lt.map(d=>(d.words??"").toLowerCase()).filter((d,y,F)=>d&&F.indexOf(d)!==y));return(0,f.jsxs)(l?Vi:oe,{context:e,children:[(0,f.jsxs)("div",{style:{display:"grid",gap:12},children:[(0,f.jsxs)("header",{style:{display:"grid",gap:4},children:[l?null:(0,f.jsx)(mt,{context:e}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",columnGap:10,rowGap:4,minWidth:0},children:[(0,f.jsx)(ue,{kind:t,brand:s,schema:i.schema,size:8}),(0,f.jsx)(le,{context:e,children:ze}),We.length>0?(0,f.jsx)("span",{style:{marginLeft:"auto",display:"flex",flexWrap:"wrap",columnGap:14,rowGap:8},"data-testid":"beginnings-open",children:We.map(({affordance:d,mutation:y})=>(0,f.jsx)(zi,{name:y.name,title:y.title??y.name,panel:`${ua}-${y.name}`,open:ca(y.name),onOpen:F=>pa(y.name,F)},d.id))}):null,!de.off&&_e.length>0?(0,f.jsxs)("button",{type:"button","data-testid":"list-export","aria-label":"Export CSV",title:"Export CSV",onClick:()=>void ea(de),style:{...we,minHeight:28,margin:"-4px 0",...We.length>0?{}:{marginLeft:"auto"},padding:"0 2px",border:0,background:"none",font:"inherit",color:"var(--graview-ink-muted)",cursor:"pointer"},children:[(0,f.jsx)("span",{"aria-hidden":"true",style:{marginRight:4},children:"\u2193"}),"CSV"]}):null]}),Ee.length>0?(0,f.jsx)(eo,{place:"here",to:[{label:`Skip to the ${Ee.length===1?Qe(p,t):`${Ee.length} ${ze.toLowerCase()}`}`,testid:"records",go:()=>{let d=document.querySelector(`[data-graview-skip-target="${CSS.escape(Sn)}"]`);Hn(d?.querySelector('[data-graview-choose-box][tabindex="0"]')??d)}},..._e.length>0?[{label:"Skip to arranging them",testid:"arranging",go:()=>{let d=document.querySelector(`[data-graview-skip-target="${CSS.escape(Sn)}"]`)?.parentElement?.querySelector('[role="group"][aria-label="Arrange"]');Hn(d?.querySelector('button[data-testid$="-add"], button[data-testid$="-all"]')??d)}}]:[]]}):null,o??p?.description?(0,f.jsx)("p",{style:se,children:o??p?.description}):null,Lt.length>0||yn.length>0?(0,f.jsxs)("p",{style:{...A,margin:0,display:"flex",flexWrap:"wrap",columnGap:18,rowGap:2},"data-testid":"kind-related",children:[Lt.length>0?(0,f.jsxs)("span",{"data-testid":"kind-relations",children:["Related:"," ",Lt.map(({relation:d,far:y,words:F},ce)=>(0,f.jsxs)("span",{"data-relation":d.edgeKind,children:[ce>0?(0,f.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,y==="*"?Ce(F??Ye(d.edgeKind)):(0,f.jsx)(H,{to:`/${j(i.schema,y)}`,style:V,title:Q(i,y),children:F&&Jo.has(F.toLowerCase())?`${Ce(F)}: ${Q(i,y).toLowerCase()}`:Ce(F??Q(i,y))})]},`${d.edgeKind}|${d.from}|${d.to}`))]}):null,yn.length>0?(0,f.jsxs)("span",{"data-testid":"kind-pictures",children:["Also as:"," ",yn.map((d,y)=>(0,f.jsxs)("span",{children:[y>0?(0,f.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,(0,f.jsx)(H,{to:fe(e,d),style:V,children:d.title})]},nt(d)))]}):null]}):null]}),We.length>0?(0,f.jsx)("div",{style:{display:"contents"},"data-testid":"beginnings",children:We.map(({affordance:d,mutation:y})=>{let F=!!(ga[y.name]&&Ee.length===0);return(0,f.jsx)(Yi,{name:y.name,id:`${ua}-${y.name}`,description:y.description,open:ca(y.name),onClose:()=>pa(y.name,!1),children:(0,f.jsx)(Fe,{store:i,mutation:y,prefilled:d.args,open:d.open,...F?{initial:{[ga[y.name]]:R.words}}:{},...e.principal?{principal:e.principal}:{}},F?`${y.name}|${R.words}`:y.name)},d.id)})}):null,G.dropped.length>0?(0,f.jsxs)("p",{style:{...A,margin:0},"data-testid":"list-dropped",children:["This link asked for ",G.dropped.join(", "),", which ",ze.toLowerCase()," cannot be arranged by; the rest is shown."]}):null,_e.length>0?(0,f.jsx)(Or,{schema:i.schema,graph:i.graph,kind:t,arrangement:h,onChange:jo,kept:{shown:Ee.length,of:_e.length},noun:{one:Qe(p,t),many:ze.toLowerCase()},...Zo?{}:{allow:!1},...fa?{filters:fa}:{},offers:E,chips:{nodes:_e,flagged:P,...typeof c?.today=="string"?{today:c.today}:{}},query:e.framed===!0&&e.barAbove!==!0}):null,(0,f.jsx)("style",{children:Qt}),ft?(0,f.jsx)("style",{children:Ir+Ui}):null,(0,f.jsx)("div",{className:"graview-list","data-graview-skip-target":Sn,...ft?{...Me.listProps,ref:Me.list,tabIndex:-1,"data-graview-choosable":"","aria-label":Me.chosen.length>0?`${ze}, ${Me.chosen.length} chosen`:ze,role:"group"}:{},children:Ee.length===0&&R.words?(0,f.jsxs)("p",{style:se,"data-testid":"none-yet",children:["Nothing here is called \u201C",R.words,"\u201D."," ",(0,f.jsx)("span",{style:A,"data-testid":"list-searched",children:Kt(i.schema,{kinds:[t],past:X})})," ",(0,f.jsx)(H,{to:"?",style:V,children:"Show every one"})]}):Ee.length===0?(0,f.jsxs)("p",{style:se,"data-testid":"none-yet",children:[h.filter?.length||h.query?"None of them.":"None yet",!h.filter?.length&&!h.query&&We.length>0?` \u2014 the first one starts above, with \u201C${We[0]?.mutation.title??We[0]?.mutation.name}\u201D.`:!h.filter?.length&&!h.query?".":"",h.filter?.length||h.query?(0,f.jsxs)(f.Fragment,{children:[" ",(0,f.jsx)(H,{to:"?",style:V,children:"Show every one"})]}):null]}):m.grouped&&la?(0,f.jsx)("div",{style:{display:"grid",gap:"1rem"},"data-testid":"records","data-grouped":la,children:M.map(d=>{if(!d.closed)return(0,f.jsxs)("section",{style:{display:"grid",gap:0},"data-testid":"list-group",children:[(0,f.jsxs)("h2",{className:"graview-group-head",children:[d.label," ",(0,f.jsx)("span",{children:d.nodes.length})]}),(0,f.jsx)("ul",{style:it,className:Rt,"data-graview-rows":"",children:d.nodes.map(At)})]},d.key||"-");let y=Uo(d),F=`${u}-${yt(d.key||"none")}`;return(0,f.jsxs)("section",{style:{display:"grid",gap:0},"data-testid":"list-group","data-closed":y?"shut":"open",children:[(0,f.jsx)("h2",{className:"graview-group-head",children:(0,f.jsxs)("button",{type:"button",className:"graview-group-toggle","aria-expanded":!y,"aria-controls":F,"data-testid":"list-group-toggle",onClick:()=>Vo(d.value),children:[(0,f.jsx)("span",{"aria-hidden":"true",children:y?"\u25B8":"\u25BE"}),d.label," ",(0,f.jsxs)("span",{children:["\xB7 ",d.nodes.length]}),(0,f.jsxs)("span",{style:Bi,children:[" ",d.nodes.length===1?Qe(p,t):ze.toLowerCase()]})]})}),(0,f.jsx)("ul",{id:F,style:y?{...it,display:"none"}:it,className:Rt,"data-graview-rows":"",hidden:y,children:y?null:d.nodes.map(At)})]},d.key||"-")})}):Ct&&Ct.length>1?(0,f.jsxs)("div",{style:{display:"grid",gap:14},"data-testid":"records","data-sectioned":He?.type==="date"?"year":"letter",children:[(0,f.jsx)("nav",{"aria-label":"Jump to","data-testid":"list-index",style:{...A,display:"flex",flexWrap:"wrap",gap:He?.type==="date"?"0 10px":"0 4px",lineHeight:1.3},children:Ct.map(d=>(0,f.jsx)("a",{href:`#${yt(d.key)}`,onClick:y=>{y.preventDefault(),document.getElementById(yt(d.key))?.scrollIntoView({block:"start"})},style:{...we,minWidth:24,justifyContent:"center"},children:d.key},d.key))}),Ct.map(d=>(0,f.jsxs)("section",{"data-testid":"list-section","aria-labelledby":yt(d.key),style:{display:"grid",gap:0},children:[(0,f.jsx)("h2",{id:yt(d.key),className:"graview-group-head",children:d.key}),(0,f.jsx)("ul",{style:it,className:Rt,"data-graview-rows":"",children:d.nodes.map(At)})]},d.key))]}):(0,f.jsx)("ul",{style:it,className:Rt,"data-testid":"records","data-graview-rows":"",children:Ee.map(At)})}),ft?(0,f.jsx)(Fr,{store:i,chosen:Me.chosen,...ot?{principal:ot}:{},...c?{context:c}:{},anchor:qi,of:wn.length,onChooseAll:()=>Me.choose(wn),onClear:Me.clear,onActed:Xo}):null,sa>0?(0,f.jsxs)(H,{to:$o(g,"filter","is:any"),style:{...V,...A,justifySelf:"start"},"data-testid":"past-link",children:["+",sa," past"]}):null,x===!1&&i.graph.count(t,{archived:!0})>0?(0,f.jsxs)(H,{to:$o(g,"archived","true"),style:{...V,...A,justifySelf:"start"},"data-testid":"archived-link",children:["+",i.graph.count(t,{archived:!0})," archived"]}):null]}),(0,f.jsx)(nn,{context:e,withheld:_o,style:re,testId:"withheld"})]})}var Bi={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},qi=()=>document.querySelector("[data-graview-choosable]")?.closest("[data-embed-content]")??null,Ui=`
|
|
7
|
+
.graview-list[data-graview-choosable]{outline:none}
|
|
8
|
+
.graview-list [data-graview-choose]{position:relative;padding-left:34px}
|
|
9
|
+
.graview-choose-at{position:absolute;left:2px;top:0;bottom:0;z-index:${Na.raised};display:flex;align-items:center}
|
|
10
|
+
@media (min-width: 900px) and (pointer: fine){
|
|
11
|
+
.graview-list [data-graview-choose]{padding-left:0}
|
|
12
|
+
.graview-choose-at{left:-34px}
|
|
13
|
+
}
|
|
14
|
+
@media (pointer: coarse){
|
|
15
|
+
.graview-list:not([data-graview-choosing]) [data-graview-choose]{padding-left:0}
|
|
16
|
+
.graview-list:not([data-graview-choosing]) .graview-choose-at{display:none}
|
|
17
|
+
}
|
|
18
|
+
`;function Vi({children:e}){return(0,f.jsx)("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:40,minWidth:0},children:e})}var ji=(e,t)=>t?{sort:{by:t,direction:"desc"}}:e?{sort:{by:"label",direction:"asc"}}:{};function _i(e,t,n){let a=$t({...e.get("sort")?{sort:e.get("sort")}:{},...e.get("filter")?{filter:e.get("filter")}:{},...e.get("group")?{group:e.get("group")}:{},...e.get("q")?{q:e.get("q")}:{},...e.get("archived")?{archived:e.get("archived")}:{}}),r=[...a.filter??[]],o=e.get("by"),l=a.group??(o?{by:o}:void 0);for(let s of n){let c=e.get(s);c&&r.push({key:s,value:c})}let i=e.get("with");return i&&r.push({key:i,value:"*"}),e.get("past")==="1"&&!r.some(s=>s.key==="is")&&r.push({key:"is",value:"any"}),On({...a.sort?{sort:a.sort}:{},...a.query?{query:a.query}:{},...r.length>0?{filter:r}:{},...l?{group:l}:{},...a.archived!==void 0?{archived:a.archived}:{}},t)}function $o(e,t,n){let a=new URLSearchParams(e);return a.set(t,n),a.delete("past"),`?${a.toString()}`}function zi({name:e,title:t,panel:n,open:a,onOpen:r}){return(0,f.jsxs)("button",{type:"button","data-testid":`act-open-${e}`,"data-graview-act":e,"aria-expanded":a,"aria-controls":n,onClick:()=>{r(!a),a||requestAnimationFrame(()=>document.getElementById(n)?.querySelector("input, select, textarea, button")?.focus())},style:{...we,minHeight:28,margin:"-4px 0",padding:"0 2px",border:0,background:"none",font:"inherit",fontWeight:600,color:"var(--graview-ink)",cursor:"pointer"},children:[(0,f.jsx)("span",{"aria-hidden":"true",style:{marginRight:6},children:a?"\u2212":"+"}),t]})}function Yi({name:e,id:t,description:n,open:a,onClose:r,children:o}){return(0,f.jsxs)("div",{"data-testid":`act-${e}`,id:t,hidden:!a,onKeyDown:l=>{l.key==="Escape"&&(l.preventDefault(),r(),document.querySelector(`[aria-controls="${t}"]`)?.focus())},style:a?{display:"grid",gap:12,padding:"4px 0 12px"}:void 0,children:[n?(0,f.jsx)("p",{style:{...A,margin:0,maxWidth:"58ch"},children:n}):null,o]})}function Qi({to:e,label:t}){let n=(0,Te.useRef)(null);return Dr(n),(0,f.jsx)(H,{ref:n,to:e,"aria-label":t,style:{position:"absolute",inset:0,borderRadius:6}})}var Be=I(Ne(),1);var xt=I(Ne(),1);var D=I(U(),1);function ra({context:e}){let{store:t,brand:n,invariantContext:a,principal:r}=e;ee(t);let o=t.violations(a),l=t.allInvariants(),i=It(t,o),s=Za(t.schema,l);return(0,D.jsxs)(oe,{context:e,children:[(0,D.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,D.jsx)(le,{context:e,children:o.length===0?"All rules hold":"What is broken"}),(0,D.jsx)("p",{style:se,"data-testid":"problems-count",children:o.length===0?"Every declared rule is satisfied by what is here.":La(o)})]}),(0,D.jsx)(Lo,{context:e}),i.map((c,g)=>{let k=c.nodeIds[0],u=k?t.graph.getNode(k):void 0;return(0,D.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,D.jsx)(on,{violation:c,schema:t.schema,...n?{brand:n}:{}}),u?(0,D.jsxs)("p",{style:{margin:0,display:"inline-flex",alignItems:"center",gap:8},children:[(0,D.jsx)(ue,{kind:u.kind,brand:n,schema:t.schema,size:7}),(0,D.jsx)(H,{to:Y(t.schema,u.kind,u.id),style:V,children:pe(t.schema.tryDefinition(u.kind),u)})]}):null,c.line?(0,D.jsx)(on,{violation:c,schema:t.schema,...n?{brand:n}:{}}):null,(0,D.jsx)(sn,{store:t,repairs:c.repairs,...r?{principal:r}:{}})]},g)}),l.length>0?(0,D.jsxs)("section",{style:{...re,display:"grid",gap:12},"data-testid":"rules",children:[(0,D.jsx)("h2",{style:ae,children:"The rules"}),(0,D.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:l.map(c=>{let g=o.filter(p=>p.invariant===c.name).length,k=s.get(c.name),u=c.label??c.name;return(0,D.jsxs)("li",{"data-graview-rule":c.name,style:{display:"grid",gap:2},children:[(0,D.jsxs)("span",{style:{display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:12,rowGap:2},children:[k?(0,D.jsx)(Ft,{line:k,schema:t.schema,...n?{brand:n}:{},style:{flex:"1 1 18rem"}}):(0,D.jsx)("span",{style:{flex:"1 1 18rem",fontWeight:550},children:u}),(0,D.jsx)("span",{style:{...A,color:g>0?"var(--graview-warn)":"var(--graview-ink-faint)"},children:g===0?"holds":`broken in ${g} ${g===1?"place":"places"}`})]}),k&&u.trim().length>0?(0,D.jsx)("span",{style:A,children:u}):null]},c.name)})})]}):null]})}function on({violation:e,schema:t,brand:n}){if(!e.line)return(0,D.jsx)("p",{style:{margin:0,color:"var(--graview-warn)",fontWeight:550},children:e.message});let a=Ja(e),r=Xa(e);return r?(0,D.jsxs)("div",{style:{display:"grid",gap:4},"data-testid":"problem-line",children:[(0,D.jsx)("p",{style:{margin:0,color:"var(--graview-warn)",fontWeight:550},"data-testid":"problem-says",children:r}),a?(0,D.jsx)("span",{style:A,children:a}):null,(0,D.jsxs)("details",{"data-testid":"problem-judged",style:A,children:[(0,D.jsx)("summary",{style:{cursor:"pointer",width:"fit-content",minHeight:24},children:"How it is judged"}),(0,D.jsx)(Ft,{line:e.line,schema:t,...n?{brand:n}:{},lead:"none"})]})]}):(0,D.jsxs)("div",{style:{display:"grid",gap:2},"data-testid":"problem-line",children:[(0,D.jsx)(Ft,{line:e.line,schema:t,...n?{brand:n}:{},lead:"none",style:{color:"var(--graview-warn)"}}),a?(0,D.jsx)("span",{style:A,children:a}):null]})}function sn({store:e,repairs:t,principal:n}){let[a,r]=(0,xt.useState)(null),[o,l]=(0,xt.useState)(null),i=(0,xt.useRef)([]);if(t.length===0)return null;let s=a===null?null:t[a],c=s&&(s.missing??[]).length>0?e.allMutations().find(g=>g.name===s.mutation):void 0;return(0,D.jsxs)("div",{style:{display:"grid",gap:10},"data-testid":"repairs",children:[(0,D.jsx)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:t.map((g,k)=>{let u=(g.missing??[]).length>0,p=e.permits({name:g.mutation,args:{...g.args}},n);return p.ok?(0,D.jsx)("button",{ref:x=>{i.current[k]=x},type:"button","data-graview-repair":g.mutation,"data-graview-asks":u||void 0,"aria-expanded":u?a===k:void 0,onClick:()=>{if(l(null),u){r(a===k?null:k);return}r(null);try{e.apply({name:g.mutation,args:{...g.args}},n?{author:n}:{})}catch(x){l(Wt(e.schema,e.allMutations(),x))}},style:ve,children:u?`${g.label} \u2026`:g.label},k):(0,D.jsxs)("p",{"data-testid":"withheld","data-withheld":p.refusal.wouldNeed.join(",")||"nobody",style:{...A,margin:0},children:[(0,D.jsx)("s",{children:g.label})," \u2014 ",p.refusal.message]},k)})}),c&&s?(0,D.jsx)(Fe,{store:e,mutation:c,prefilled:{...s.args},only:s.missing??[],label:s.label,autoFocus:!0,onDone:()=>{let g=a;r(null),requestAnimationFrame(()=>{let k=g===null?null:i.current[g];if(k?.isConnected){k.focus();return}let u=document.querySelector("[data-graview-page-title]")??document.querySelector("main h1, main h2");u&&(u.hasAttribute("tabindex")||(u.tabIndex=-1),u.focus())})},...n?{principal:n}:{}}):null,s&&!c&&(s.missing??[]).length>0?(0,D.jsxs)("p",{"data-testid":"refused",role:"alert",style:{margin:0,color:"var(--graview-warn)",fontSize:In},children:["\u201C",s.label,"\u201D names ",s.mutation,", which this app does not declare."]}):null,o?(0,D.jsx)("p",{"data-testid":"refused",role:"alert",style:{margin:0,color:"var(--graview-warn)",fontSize:In},children:o}):null]})}var oa=I(Ne(),1);var je=I(U(),1);function Do({store:e,link:t,principal:n}){let[a,r]=(0,oa.useState)(!1),[o,l]=(0,oa.useState)(null),i=ar(t);return(0,je.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[(0,je.jsx)("button",{type:"button","data-graview-provisional":"",title:i,"aria-label":`Unsure link: ${i}`,"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,je.jsxs)("span",{style:{...A,display:"inline-flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,je.jsx)("span",{children:i}),(0,je.jsx)("button",{type:"button",style:{...ve,padding:"4px 10px"},onClick:()=>{try{e.apply({name:Ta,args:{kind:t.edge.kind,from:t.edge.from,to:t.edge.to}},n?{author:n}:{}),r(!1)}catch(s){l(Wt(e.schema,e.allMutations(),s))}},children:"Keep this link"}),o?(0,je.jsx)("span",{role:"alert",children:o}):null]}):null]})}var ye=I(U(),1);function Wo({nodeId:e,node:t,field:n,inPlace:a,labelStyle:r=he}){return n.files?(0,ye.jsx)(ct,{as:"field",read:!a,nodeId:e,field:n.key,label:n.label,files:n.files,labelStyle:r,style:{gap:4}}):n.long?(0,ye.jsx)(Nr,{nodeId:e,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,ye.jsxs)("div",{style:{display:"grid",gap:2,minWidth:0,alignContent:"start"},children:[(0,ye.jsx)("dt",{style:r,children:n.label}),(0,ye.jsx)("dd",{style:{margin:0,overflowWrap:"anywhere",minWidth:0},children:n.linked?(0,ye.jsx)(gr,{relation:n.linked.relation,refs:n.linked.refs,...a?{nodeId:e,field:n.key}:{}}):n.app?(0,ye.jsx)(qt,{address:n.app,as:"record",...a?{nodeId:e,field:n.key}:{}}):n.href?(0,ye.jsx)(Mr,{href:n.href,field:n.key,value:n.value,stored:n.stored,...a?{nodeId:e}:{}}):a?(0,ye.jsxs)(ye.Fragment,{children:[(0,ye.jsx)(Ut,{nodeId:e,field:n.key,value:n.value,stored:n.stored}),n.repeats?(0,ye.jsx)(mr,{nodeId:e,field:n.key,start:t?.[n.key],value:t?.[`${n.key}Repeat`],label:`${n.label} repeats`}):null]}):n.value})]})}var S=I(U(),1),Zi=[];function ia({context:e}){let{store:t,brand:n,principal:a,invariantContext:r}=e;ee(t);let o=ie()!==null,l=Ve(),i=decodeURIComponent(l.id??""),s=uo(t,i,{...a?{principal:a}:{},...r?{context:r}:{}}),c=It(t,s?.violations??Zi),[g,k]=(0,Be.useState)(null),[u,p]=(0,Be.useState)(!1),[x,O]=(0,Be.useState)(null),W=(0,Be.useRef)(null),P=(0,Be.useRef)(null),E=fr({flow:"both",letters:!0}),b=m=>{(W.current?.parentElement?.querySelector(`[data-affordance="${m.replace(/["\\]/g,"\\$&")}"]`)??W.current)?.focus()};if(!s)return(0,S.jsx)(oe,{context:e,children:(0,S.jsx)(le,{context:e,children:"Nothing lives at this address."})});let G=t.graph.getNode(i),L=t.schema.tryDefinition(s.kind),T=L?.describe&&G?tr(L,G):null,ne=[...t.log.all()].filter(m=>!Nt(m)&&(m.writes.includes(i)||m.reads.includes(i))).slice(-8).reverse(),J=t.log.all().find(m=>!Nt(m)&&m.undoes===void 0&&m.primitives.some(M=>M.op==="add-node"&&M.node.id===i)),z=s.actions.affordances.filter(m=>m.provider!=="invariant"),xe=z.filter(m=>m.destructive||m.setsAside),$e=u||xe.length<2?z:z.filter(m=>!xe.includes(m)),Pe=e.views?.lookup(s.kind,{cardinality:"one",fidelity:"full"}),Ae=Pe!==void 0&&!lt(Pe)?Pe:void 0,w=Ae&&G?jt(Pe,G,t.graph):void 0,h=w?s.fields.filter(m=>!w.fields.has(m.key)):s.fields,R=w?s.links.flatMap(m=>{let M=m.targets.filter(_=>!w.records.has(_.id));return M.length>0?[{...m,targets:M}]:[]}):s.links,$=Ae!==void 0&&_a(Pe),Z=o&&sr(L).length>0,X=Oe(e).filter(m=>!m.hidden&&(m.kind===s.kind||m.across===s.kind));return(0,S.jsxs)(oe,{context:e,children:[(0,S.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,S.jsx)(mt,{context:e}),(0,S.jsx)(le,{context:e,children:o&&G?.label===s.label?(0,S.jsx)(Ut,{nodeId:i,field:"label",value:s.label,said:s.label}):s.label}),T&&T!==s.label?(0,S.jsx)("p",{style:se,children:T}):null,J?.lineage?(0,S.jsxs)("p",{style:{...A,margin:0},"data-testid":"record-lineage",children:["Made by ",wt(J,a,{graph:t.graph,schema:t.schema,...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{}}),", ",Rn(J.lineage)]}):null,(0,S.jsx)(Gn,{context:e,stop:`#focus=${encodeURIComponent(i)}`,style:{...Ue,...A},"data-testid":"spatial-link"}),o&&G?(0,S.jsx)(En,{choices:[{on:"changed",record:i},{on:"act",record:i},{on:"reaches",kind:s.kind,condition:"",record:i}],label:"Notify me when this changes",testId:"record-notify",style:{...ve,...A,justifySelf:"start"}}):null,X.length>0?(0,S.jsx)(Xi,{context:e,places:X}):null]}),G&&Ca(G)?(0,S.jsx)(ts,{context:e,id:i,kind:s.kind}):null,G&&Ea(t,i)?(0,S.jsx)(es,{context:e,id:i,kind:s.kind}):null,Ae&&G?(0,S.jsx)("section",{"data-testid":"record-view",style:{display:"grid",minWidth:0},children:(0,S.jsx)(Wr,{children:(0,S.jsx)(gt,{when:dt(Pe),children:(0,S.jsx)(Ae,{node:G,cardinality:"one",fidelity:"full",mode:"fullscreen",selected:!1,...s.violations.length>0?{flagged:[i]}:{}})})})}):null,s.violations.length>0?(0,S.jsx)("section",{"data-testid":"record-violations",style:{display:"grid",gap:12,padding:"16px 18px",borderLeft:"3px solid var(--graview-warn)",background:"var(--graview-panel-warning)",borderRadius:"0 var(--graview-radius, 12px) var(--graview-radius, 12px) 0"},children:c.map((m,M)=>(0,S.jsxs)("div",{style:{display:"grid",gap:8},children:[(0,S.jsx)(on,{violation:m,schema:t.schema,...n?{brand:n}:{}}),(0,S.jsx)(sn,{store:t,repairs:go(s.actions,m.repairs),...a?{principal:a}:{}})]},M))}):null,!$&&(h.length>0||Z)?(0,S.jsxs)("section",{style:{...re,display:"grid",gap:14},"data-testid":"record-fields",children:[(0,S.jsx)("h2",{style:ae,children:"The facts"}),nr(L,h).map((m,M)=>{let _=(0,S.jsx)("dl",{style:{margin:0,display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gap:"14px 24px"},children:m.fields.map(de=>(0,S.jsx)(Wo,{nodeId:i,node:G,field:de,inPlace:o},de.key))});return m.title?(0,S.jsxs)("section",{style:{display:"grid",gap:10,minWidth:0},children:[(0,S.jsx)("h3",{"data-graview-field-group":m.title,style:{...ae,fontSize:"inherit"},children:m.title}),_]},M):(0,S.jsx)("div",{children:_},M)}),Z?(0,S.jsx)(ct,{as:"unfilled",nodeId:i,skip:[...w?.fields??[]],labelStyle:he,style:{gap:4}}):null]}):null,($?[]:R).map(m=>(0,S.jsxs)("section",{style:{...re,display:"grid",gap:10},children:[(0,S.jsx)("p",{style:he,children:no(t,m)}),m.description?(0,S.jsx)("h2",{style:ae,children:Ce(m.description)}):(0,S.jsxs)("h2",{style:ae,"aria-label":Ye(m.edgeKind),children:[m.direction==="in"?"\u2190 ":"\u2192 ",Ye(m.edgeKind)]}),(0,S.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"6px 18px"},children:m.targets.map(M=>{let _=rr(t,m.direction==="in"?{kind:m.edgeKind,from:M.id,to:i}:{kind:m.edgeKind,from:i,to:M.id});return(0,S.jsxs)("li",{style:{display:"inline-flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,S.jsx)(ue,{kind:M.kind,brand:n,schema:t.schema,size:7}),(0,S.jsxs)(H,{to:Y(t.schema,M.kind,M.id),style:V,children:[M.label,M.apart?(0,S.jsxs)("span",{style:A,children:[" \xB7 ",M.apart]}):null]}),_?.provisional?(0,S.jsx)(Do,{store:t,link:_,...a?{principal:a}:{}}):null]},M.id)})}),(m.direction==="out"&&t.schema.edge(m.edgeKind)?.cardinality==="one"?[]:[...new Set(m.targets.map(M=>M.kind))]).map(M=>(0,S.jsx)(H,{to:`/${j(t.schema,M)}?${encodeURIComponent(m.edgeKind)}=${encodeURIComponent(i)}`,style:{...Ue,...A},"data-testid":"related-all",children:(0,S.jsxs)(Xe,{children:["Sort and filter ",m.description??`these ${Q(t,M).toLowerCase()}`,m.targets.some(_=>_.kind!==M)?` (${Q(t,M).toLowerCase()})`:""]})},M))]},`${m.edgeKind}|${m.direction}|${m.description??""}`)),!$&&(z.length>0||s.actions.withheld.length>0)?(0,S.jsxs)("section",{style:{...re,display:"grid",gap:14},"data-testid":"record-actions",children:[(0,S.jsx)("h2",{style:ae,ref:W,tabIndex:-1,children:"What can be done"}),(0,S.jsxs)("div",{role:"toolbar","aria-label":"What can be done",...E,style:{display:"flex",flexWrap:"wrap",gap:8},children:[$e.map(m=>{let M=g===m.id;return(0,S.jsx)("button",{type:"button","data-affordance":m.id,"data-rank":m.rank,"data-graview-act":m.mutation,[Tn]:"",autoFocus:u&&m===xe[0],"aria-expanded":M,onClick:()=>k(M?null:m.id),style:{...ve,...M?{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"}:{}},children:m.label},m.id)}),$e.length<z.length?(0,S.jsxs)("button",{type:"button","aria-expanded":!1,onClick:()=>p(!0),style:{...ve,...A},"data-testid":"record-actions-more",[Tn]:"",children:["Show ",z.length-$e.length," more"]}):null]}),z.map(m=>{if(g!==m.id)return null;let M=t.allMutations().find(_=>_.name===m.mutation);return M?(0,S.jsxs)("div",{ref:P,onKeyDown:_=>{if(_.key!=="Escape"||_.defaultPrevented)return;_.preventDefault(),k(null);let de=m.id;requestAnimationFrame(()=>b(de))},style:{display:"grid",gap:10,padding:18,border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,S.jsx)("h3",{style:ae,children:m.label}),M.description?(0,S.jsx)("p",{style:{...A,margin:0},children:M.description}):null,(0,S.jsx)(Fe,{store:t,mutation:M,prefilled:m.args,open:m.open,label:m.label,autoFocus:!0,onDone:()=>{k(null),O(m.mutation);let _=m.id;requestAnimationFrame(()=>b(_))},...a?{principal:a}:{}})]},m.id):null}),o&&x!==null&&g===null?(0,S.jsx)(En,{choices:[{on:"act",act:x,record:i},{on:"act",act:x}],label:"Notify me when someone else does this",testId:"notify-after-act",style:{...ve,...A,justifySelf:"start"}}):null,(0,S.jsx)(nn,{context:e,withheld:s.actions.withheld})]}):null,o?(0,S.jsx)(to,{id:i,style:re,headingStyle:ae}):null,ne.length>0?(0,S.jsxs)("section",{style:{...re,display:"grid",gap:10},"data-testid":"record-history",children:[(0,S.jsx)("h2",{style:ae,children:"What has happened"}),(0,S.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:ne.map(m=>(0,S.jsxs)("li",{style:A,children:[(0,S.jsx)("span",{style:{color:"var(--graview-ink)"},children:m.intent}),m.lineage?(0,S.jsxs)("span",{"data-graview-lineage":"",children:[" \xB7 ",Rn(m.lineage)]}):null," \u2014 ",wt(m,a,{graph:t.graph,schema:t.schema,...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{}})]},m.id))})]}):null]})}function Xi({context:e,places:t}){let[n,a]=(0,Be.useState)(!1),r=(0,Be.useRef)(null),o=n||t.length<=ln+1?0:t.length-ln;return(0,S.jsxs)("p",{ref:r,style:{...A,margin:0},"data-testid":"seen-in",...n?{"data-open":""}:{},children:["Seen in:"," ",t.map((l,i)=>(0,S.jsxs)("span",{...o>0&&i>=ln?{"data-graview-later":""}:{},children:[i>0?(0,S.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,(0,S.jsx)(H,{to:fe(e,l),style:V,children:l.title})]},nt(l))),o>0?(0,S.jsxs)(S.Fragment,{children:[" ",(0,S.jsxs)("button",{type:"button","data-graview-seen-more":"","aria-expanded":"false",style:{...V,...A,font:"inherit",background:"none",border:0,padding:0,cursor:"pointer"},onClick:()=>{a(!0),requestAnimationFrame(()=>r.current?.querySelectorAll("a")[ln]?.focus())},children:[o," more"]}),(0,S.jsx)("style",{children:Ji})]}):null]})}var ln=3,Ji="[data-graview-seen-more]{display:none!important}@media (max-width:680px){[data-graview-seen-more]{display:inline!important}[data-testid=seen-in] [data-graview-later]{display:none}}";function es({context:e,id:t,kind:n}){let{store:a,principal:r}=e,o={name:`allow-tidying-${n}`,args:{id:t}},l=a.allMutations().some(i=>i.name===o.name)&&a.permits(o,r).ok;return(0,S.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,S.jsxs)("p",{style:{margin:0,flex:"1 1 16rem"},children:[(0,S.jsx)("strong",{children:"Left alone."})," Nothing automated changes it; tidying passes it by."]}),l?(0,S.jsx)("button",{type:"button",style:ve,"data-testid":"allow-tidying",onClick:()=>a.apply(o,r?{author:r}:{}),children:"Allow tidying again"}):null]})}function ts({context:e,id:t,kind:n}){let{store:a,principal:r}=e,o={name:`unarchive-${n}`,args:{id:t}},l=a.allMutations().some(c=>c.name===o.name)&&a.permits(o,r).ok,i=[...a.log.all()].reverse().find(c=>!Nt(c)&&c.mergedInto!==void 0&&c.writes.includes(t)),s=i?.mergedInto!==void 0?a.graph.getNode(i.mergedInto):void 0;return(0,S.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,S.jsxs)("p",{style:{margin:0,flex:"1 1 16rem"},children:[(0,S.jsx)("strong",{children:"Archived."})," Kept with its ties and history, and out of lists, counts and rules.",s?(0,S.jsxs)(S.Fragment,{children:[" ","Merged into ",(0,S.jsx)(H,{to:Y(a.schema,s.kind,s.id),style:V,children:pe(a.schema.tryDefinition(s.kind),s)}),"."]}):null]}),l?(0,S.jsx)("button",{type:"button",style:ve,"data-testid":"bring-it-back",onClick:()=>a.apply(o,r?{author:r}:{}),children:"Bring it back"}):null]})}var v=I(U(),1),ns=Ht(()=>(__graviewPreload(import.meta.url,["./chunk.T56SOSIR.js","./chunk.JRU5BT7K.js","./chunk.UGFDSE37.js","./chunk.EG2N5F6L.js","./chunk.7NFCI4LH.js","./chunk.RUTZEEBR.js","./chunk.GZWC72HS.js","./chunk.ASCTAUFD.js","./chunk.CWPRQSED.js","./chunk.EZXGVTT2.js","./chunk.ULTYDYTS.js","./chunk.2LQ37DC2.js","./chunk.UXNZPPWR.js","./chunk.GYO57LKD.js","./chunk.KWMBRB6O.js","./chunk.G226CUJQ.js","./chunk.AQJD23AN.js","./chunk.R3DWF35R.js","./chunk.XBNASVTY.js","./chunk.6S3B4XC4.js","./chunk.52Y37IAD.js","./chunk.TLQTDKOL.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.VTCPA4V4.js","./chunk.FGJM4LJO.js","./chunk.K7WME4P4.js","./chunk.MDIAWTNK.js","./chunk.PEA4D66Y.js","./chunk.TRPPN2GD.js","./chunk.GZHZLJBF.js","./chunk.TTFYXKLI.js","./chunk.OJGHDWI6.js","./chunk.ICYJ7QJG.js","./chunk.MT45H2T5.js","./chunk.S2ATSY6P.js","./chunk.72Q4R7N6.js","./chunk.G6DISMVT.js","./chunk.W54NXXC5.js","./chunk.B3T4N2XM.js","./chunk.SDO3U72B.js","./chunk.6W2DUW5S.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.LEKML4S4.js")).then(e=>({default:e.DraftPage}))),as={kind:"human"};function rs({list:e,store:t}){let n=new Set(e.members.map(l=>l.kind)),a=e.total-e.members.length,r=n.size===1?[...n][0]:void 0;if(!r)return(0,v.jsx)("p",{className:"graview-spec-text graview-spec-more",children:`and ${a} more`});let o=qe(t.schema,r).toLowerCase();return(0,v.jsx)("p",{className:"graview-spec-text graview-spec-more",children:(0,v.jsx)(H,{to:`/${j(t.schema,r)}`,className:"graview-spec-link graview-spec-see-all","data-testid":"see-all",children:e.total===t.graph.nodesOfKind(r).length?`See all ${ht(e.total)} ${o}`:`${ht(a)} more \xB7 all ${o}`})})}function os({context:e,children:t}){let n=Ge(),a=e.store.schema,r=Je("/").replace(/\/$/,""),o=(0,q.useMemo)(()=>({href:l=>`${r}${Y(a,l.kind,l.id)}`,go:l=>n(Y(a,l.kind,l.id)),more:l=>(0,v.jsx)(rs,{list:l,store:e.store})}),[r,a,n,e.store]);return(0,v.jsx)(Vt.Provider,{value:o,children:(0,v.jsx)(Gr.Provider,{value:(e.titleLevel??(e.framed&&!e.barAbove?1:2))-1,children:t})})}var Ko=(0,q.createContext)(void 0);function is({steering:e}){let t=me(),n=Ge(),a=`${t.pathname}${t.search}`;return(0,q.useLayoutEffect)(()=>e.at(a),[a,e]),(0,q.useLayoutEffect)(()=>{let r=l=>{l!==a&&n(l)};e.go.current=r;let o=e.pending?.current;return o!==void 0&&(e.pending.current=void 0,r(o)),()=>{e.go.current===r&&(e.go.current=void 0)}},[a,n,e]),null}function ss({context:e,to:t}){let{pathname:n}=me(),a=ie(),r=(t??a)?.sayWhere,o=ls(e,n);return(0,q.useEffect)(()=>(r?.(o),()=>r?.(null)),[r,o]),null}function ls(e,t){let[n="",a,r]=t.split("/").filter(Boolean).map(l=>{try{return decodeURIComponent(l)}catch{return l}});if(r!==void 0)return"#";if(n==="places"&&a!==void 0){if(a===An)return"#overview=1";let l=e.views?.places().find(i=>i.as===a);return l?`#focus=${encodeURIComponent(Ie(l.kind))}&view=${encodeURIComponent(l.as)}`:"#"}let o=Se(e.store.schema,n);return o?`#focus=${encodeURIComponent(a??Ie(o))}`:"#"}function ds({onNavigate:e,path:t}){let n=me(),a=Kn(),r=Ge(),o=n.hash&&!n.hash.includes("=")?n.hash:"",l=`${n.pathname}${n.search}${o}`,i=(0,q.useRef)(e);i.current=e;let s=(0,q.useRef)(null);(0,q.useEffect)(()=>{let g=s.current;s.current=l,g!==null&&(l===g&&a!=="PUSH"||i.current?.(l,a==="POP"?"pop":a==="REPLACE"?"replace":"push"))},[n.key]);let c=(0,q.useRef)(t);return(0,q.useEffect)(()=>{t===void 0||t===c.current||(c.current=t,t!==l&&r(t))},[t]),null}function Go({context:e,registry:t,page:n}){let a=Ve(),r=Se(e.store.schema,a.slug??""),o=n==="list"?aa:ia,i=(r?t?.lookup(r,n):void 0)??o;return(0,v.jsx)(i,{context:e})}function cs({context:e,registry:t,children:n}){let a=(0,q.useRef)(null);return za(a),(0,v.jsx)("div",{ref:a,"data-graview-face":"pages",style:{display:"contents"},children:(0,v.jsx)(xo,{context:e,registry:t,root:a,children:(0,v.jsx)(Ao,{context:e,root:a,children:n})})})}function ps(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName==="TEXTAREA"||e.tagName==="SELECT"?!0:e.tagName==="INPUT"&&!["button","submit","reset","checkbox","radio","image","file","color","range"].includes(e.type):!1}function us(){let{pathname:e}=me(),t=Kn(),n=(0,q.useRef)(null);(0,q.useLayoutEffect)(()=>{if(t!=="POP"){for(let o=n.current?.parentElement;o;o=o.parentElement){let{overflowY:l}=getComputedStyle(o);if((l==="auto"||l==="scroll")&&o.scrollHeight>o.clientHeight){o.scrollTop=0;return}}window.scrollTo(0,0)}},[e]);let a=(0,q.useRef)(e),r=(0,q.useRef)(!1);return(0,q.useEffect)(()=>{if(!r.current&&e===a.current)return;r.current=!0;let o=document.activeElement;if(ps(o))return;let l=n.current?.closest("main")??document.querySelector("main"),s=n.current?.closest("[data-graview-face]")?.querySelector("[data-graview-page-title]")??l?.querySelector("h1, h2")??null??l??null;s&&(s.hasAttribute("tabindex")||s.setAttribute("tabindex","-1"),s.focus({preventScroll:!0}))},[e]),(0,v.jsx)("span",{ref:n,hidden:!0,"data-graview-scroll-reset":""})}function Bo({context:e,children:t}){let n=Ge(),a=Je("/").replace(/\/$/,""),r=(0,q.useContext)(Ko),o=(0,q.useMemo)(()=>{let l=(s,c)=>{if("record"in s){let g=e.store.graph.getNode(s.record);return g?zt(Y(e.store.schema,g.kind,s.record),{section:c?.section}):void 0}if("place"in s){let g=e.views?.places().find(k=>k.as===s.place);return g?zt(fe(e,g),c):void 0}return e.store.schema.tryDefinition(s.list)?zt(`/${j(e.store.schema,s.list)}`,c):void 0},i=s=>{s!==void 0&&n(s)};return{record:(s,c)=>i(l({record:s},c)),place:(s,c)=>i(l({place:s},c)),list:(s,c)=>i(l({list:s},c)),draft:()=>n("/~draft"),href:(s,c)=>{let g=r===!1?void 0:l(s,c);if(g!==void 0)return r?r(g):`${a}${g}`}}},[e,n,a,r]);return(0,v.jsx)(ja.Provider,{value:o,children:t})}function gs(){let{pathname:e,search:t,hash:n}=me();return(0,q.useEffect)(()=>{let a=decodeURIComponent(n.replace(/^#/,""));if(!(!a||a.includes("=")))return So(a)},[e,t,n]),null}function ms({context:e,Home:t}){let n=me(),a=e.views,r=n.key==="default"&&!(a&&Ua(a));(0,q.useEffect)(()=>{a&&Va(a)},[a]);let o=r?Ha(e.views?.arrangement?.()?.first,e.store.schema,e.views?.places()??[]):void 0,l=o?.to==="place"?fe(e,o.place):o?.to==="kind"?`/${j(e.store.schema,o.kind)}`:void 0;return l?(0,v.jsx)(Bn,{to:l,replace:!0}):(0,v.jsx)(t,{context:e})}function qo({context:e,registry:t}){let n=t?.lookupSurface("shell"),a=n!==void 0,r=a&&(t?.without().has("bar")??!1),o=a&&!r&&!e.embedded?{...e,barAbove:!0}:e,l=O=>n===void 0?(0,v.jsx)(Xt,{context:e,children:O}):r?(0,v.jsx)(n,{context:e,children:O}):(0,v.jsx)(Xt,{context:e,children:(0,v.jsx)(n,{context:o,children:O})}),i=t?.lookupSurface("home")??Jn,s=t?.lookupSurface("problems")??ra,c=a?{...o,framed:!0}:e,[g,k]=(0,q.useState)(null),u=(0,q.useMemo)(()=>({context:c,registry:t}),[c,t]),p=(0,q.useMemo)(()=>({onFind:k,find:!(t?.without().has("find")??!1),places:!(t?.without().has("places")??!1)}),[t]),x=(0,v.jsx)(Un.Provider,{value:u,children:(0,v.jsx)(Bo,{context:e,children:(0,v.jsx)(cs,{context:e,registry:t,children:l((0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(or,{face:"pages"}),(0,v.jsxs)(os,{context:c,children:[(0,v.jsx)(us,{}),(0,v.jsx)(gs,{}),(0,v.jsxs)(so,{children:[(t?.routes()??[]).map(({path:O,component:W})=>(0,v.jsx)(Re,{path:O,element:(0,v.jsx)(W,{context:c})},O)),(0,v.jsx)(Re,{path:"/",element:(0,v.jsx)(ms,{context:c,Home:i})}),(0,v.jsx)(Re,{path:"/problems",element:(0,v.jsx)(s,{context:c})}),(0,v.jsx)(Re,{path:"/~draft",element:(0,v.jsx)(q.Suspense,{fallback:null,children:(0,v.jsx)(ns,{context:c})})}),(0,v.jsx)(Re,{path:"/search",element:(0,v.jsx)(na,{context:c})}),(0,v.jsx)(Re,{path:"/map",element:(0,v.jsx)(Xn,{context:c})}),(0,v.jsx)(Re,{path:"/places",element:(0,v.jsx)(Qn,{context:c})}),Oe(c).some(O=>O.as===An)?null:(0,v.jsx)(Re,{path:$a,element:(0,v.jsx)(Bn,{to:"/",replace:!0})}),(0,v.jsx)(Re,{path:"/places/:as",element:(0,v.jsx)(Zn,{context:c})}),(0,v.jsx)(Re,{path:"/:slug",element:(0,v.jsx)(Go,{context:c,registry:t,page:"list"})}),(0,v.jsx)(Re,{path:"/:slug/:id",element:(0,v.jsx)(Go,{context:c,registry:t,page:"record"})})]})]})]}))})})});return e.embedded||!a||r?x:(0,v.jsx)(po.Provider,{value:p,children:(0,v.jsx)(kr.Provider,{value:g,children:x})})}var fs=()=>typeof document>"u"?null:document.body;function ys({context:e,registry:t,basename:n,initialPath:a,onNavigate:r,path:o,steering:l,firstLook:i,hrefOf:s,typing:c}){let[g,k]=(0,q.useState)(void 0),u=g!==void 0&&g.from===e.principal?{...e,principal:g.seat}:e;(0,q.useState)(()=>u.views?qr(u.views,u.store.schema,Nn(u.brand,u.store.schema)):void 0);let p=ie(),x=c??u.typing;ba({reader:u.locale??p?.locale,app:u.brand?.locale??u.app?.brand?.locale,readerTimeZone:u.timeZone??p?.timeZone,appTimeZone:u.brand?.timeZone??u.app?.brand?.timeZone});let O=u.principal??as,W=Ga(u.store,O,u.history),E=(W.past&&W.live===u.store?W.past.store:u.store).seenBy(O),b=E===u.store?u:{...u,store:E};Ka(u.store,u.principal);let G=(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(ds,{onNavigate:r,path:o}),l?(0,v.jsx)(is,{steering:l}):null,b.presence||p?(0,v.jsx)(ss,{context:b,to:p}):null,(0,v.jsx)(qo,{context:b,...t?{registry:t}:{}}),i?(0,v.jsx)(Ur,{firstLook:i,root:fs,app:Nn(u.brand,u.store.schema)}):null]}),L=b.views?(0,v.jsxs)(Ba,{store:b.store,views:b.views,...b.principal?{principal:b.principal}:{},...b.brand?{brand:b.brand}:{},...b.locale?{locale:b.locale}:{},...b.timeZone?{timeZone:b.timeZone}:{},...b.settings?{settings:b.settings}:{},...b.presence&&!p?{presence:b.presence}:{},...x?{typing:x}:{},...b.people?{people:b.people}:{},...b.seats?{seats:b.seats}:{},onSeat:z=>p?p.takeSeat(z):k({from:e.principal,seat:z}),...b.onKeepLens?{onKeepLens:b.onKeepLens}:{},...b.onExport?{onExport:b.onExport}:{},...b.ai?{ai:b.ai}:{},...b.subscriptions?{subscriptions:b.subscriptions}:{},dismissals:b.dismissals,whileAway:b.whileAway,...b.signIn?{signIn:b.signIn}:{},resolveApp:b.resolveApp??p?.resolveApp,linkedRecords:b.linkedRecords??p?.linkedRecords,...b.app?{app:b.app}:{},...b.menuSections?{menuSections:b.menuSections}:{},children:[G,(0,v.jsx)(Bo,{context:b,children:(0,v.jsx)(vo,{context:b})})]}):G,T=(0,v.jsx)(Wa.Provider,{value:W,children:L}),ne=b.files?(0,v.jsx)(Da.Provider,{value:b.files,children:T}):T,J=s===void 0?ne:(0,v.jsx)(Ko.Provider,{value:s,children:ne});if(a!==void 0){let z=n===void 0?a:`${n.replace(/\/$/,"")}${a}`;return(0,v.jsx)(io,{initialEntries:[z],...n===void 0?{}:{basename:n},children:J})}return(0,v.jsx)(lo,{...n===void 0?{}:{basename:n},children:J})}export{mi as a,ys as b};
|
|
@@ -0,0 +1,9 @@
|
|
|
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 X,c as H,d as J,e as Q}from"./chunk.KWMBRB6O.js";import{b as ie}from"./chunk.KCM2VOC7.js";import"./chunk.G226CUJQ.js";import"./chunk.BG2SC77J.js";import"./chunk.NAEEPUWJ.js";import"./chunk.AQJD23AN.js";import"./chunk.R3DWF35R.js";import"./chunk.XBNASVTY.js";import"./chunk.52Y37IAD.js";import"./chunk.Y4VOCJ7R.js";import"./chunk.TI4OSTQV.js";import"./chunk.GZHZLJBF.js";import"./chunk.TTFYXKLI.js";import"./chunk.OJGHDWI6.js";import"./chunk.ICYJ7QJG.js";import"./chunk.MT45H2T5.js";import"./chunk.S2ATSY6P.js";import"./chunk.72Q4R7N6.js";import"./chunk.G6DISMVT.js";import"./chunk.W54NXXC5.js";import{F as K,G as q,Ga as z,Ra as U,T as x,U as F,Va as Y,ba as b,c as j,x as V}from"./chunk.B3T4N2XM.js";import{a as N}from"./chunk.SDO3U72B.js";import{Xa as _,Ya as D,da as I,fa as G,ia as B,wb as W}from"./chunk.6W2DUW5S.js";import"./chunk.SLBWPVIY.js";import{b as w}from"./chunk.AJZBJBMO.js";var ae=w(q(),1);function P(e){return{minHeight:24,padding:"3px 10px",borderRadius:6,fontSize:"0.875rem",borderWidth:1,borderStyle:"solid",borderColor:e?"transparent":"var(--graview-edge)",color:e?"var(--graview-ink)":"var(--graview-ink-muted)",fontWeight:e?600:400,background:e?"color-mix(in srgb, var(--graview-accent) 16%, transparent)":"transparent"}}var M=w(x(),1);function Z(){let{seats:e,principal:t,takeSeat:i}=b();return e.length<2?null:(0,M.jsxs)("div",{role:"group","aria-label":"Seat","data-testid":"seats",style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:6,rowGap:4},children:[(0,M.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:"As"}),e.map(a=>{let l=oe(t,a.principal);return(0,M.jsx)("button",{type:"button","aria-pressed":l,"data-testid":`seat-${a.principal.id??a.label}`,title:`Sit down as ${a.label}: the acts, the kinds and the pages narrow to what this seat may do`,onClick:()=>i(a.principal),style:{...P(l),whiteSpace:"nowrap"},children:a.label},a.principal.id??a.label)})]})}function oe(e,t){return e.kind===t.kind&&e.id===t.id}var E=w(q(),1),c=w(x(),1),se=`
|
|
2
|
+
.graview-here{display:flex;flex:none}
|
|
3
|
+
.graview-here>button{display:inline-flex;align-items:center;gap:4px;height:30px;margin:0;padding:0 4px;border:1px solid transparent;border-radius:8px;background:none;box-shadow:none;font:inherit;font-size:.75rem;color:var(--graview-ink-muted);cursor:pointer}
|
|
4
|
+
.graview-here-mark{display:inline-flex;align-items:center;justify-content:center;flex:none;box-sizing:border-box;width:24px;height:24px;border-radius:50%;border:1.5px solid hsl(var(--graview-hue) 50% 48%);background:var(--graview-panel-muted);color:var(--graview-ink);font-size:.75rem;font-weight:600;box-shadow:0 0 0 2px var(--graview-bar)}
|
|
5
|
+
.graview-here-mark+.graview-here-mark{margin-left:-10px}
|
|
6
|
+
.graview-here-mark[data-agent]{border-radius:5px}
|
|
7
|
+
.graview-here-mark[data-counted]{--graview-hue:0;border-color:var(--graview-edge)}
|
|
8
|
+
.graview-here small{display:block;font-size:.75rem;color:var(--graview-ink-muted)}
|
|
9
|
+
.graview-bar[data-finding] .graview-here{display:none}`,le={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)"};function de(e,t){let i=t.id===void 0?null:`${t.kind}:${t.id}`,a=new Map;for(let l of e.values()){let d=l.participant.slice(0,l.participant.lastIndexOf(":"));if(d===i)continue;let s=d.endsWith(":")?l.participant:d,o=a.get(s);(!o||o.at<l.at)&&a.set(s,l)}return[...a.values()]}var ee=e=>e.name&&e.onBehalfOfName?`${e.name}, for ${e.onBehalfOfName}`:e.name??"",te=e=>e===1?"1 viewer":`${e} viewers`;function pe(e){let t=e.map(ee).filter(Boolean),i=t.length<e.length?[...t,te(e.length-t.length)]:t,a=i.pop();return`${i.length>0?`${i.join(", ")} and ${a}`:a} ${e.length===1?"is":"are"} here`}function ce(e,t){let{store:i,hidden:a,pictures:l}=t,d=j(e),s=i.kindsKeptFrom(t.principal),o=u=>!a.has(u)&&!s.has(u)&&!i.modules.disabledKinds.has(u),g=l.find(u=>u.as===d.within?.view&&o(u.kind));if(g)return g.title;if(!d.focusId)return d.overview?"the whole thing":null;let p=V(d.focusId);if(p.length>0)return p.every(o)?p.map(u=>B(i.schema,u)).join(" and "):null;let h=i.graph.getNode(d.focusId);return h&&o(h.kind)?I(i.schema.tryDefinition(h.kind),h):null}function ue(e,t){let i=o=>o.id!==void 0&&(o.id===t.principal.id||o.onBehalfOf?.id===t.principal.id),a=e.filter(o=>!W(o)&&_(o.author)!=="system"&&!i(o.author)),l=a[0];if(!l)return null;let d=D(l.author,{graph:t.store.graph,schema:t.store.schema,...t.seats?{seats:t.seats}:{},...t.people?{people:t.people}:{}}),s=[...new Set(a.map(o=>o.intent))].join("; ");return`${d}: ${s}`}function ge(e,t,i){let a=ue(e,t);a&&(i(""),setTimeout(()=>i(a),50))}function he({scene:e,compact:t}){let{who:i,principal:a,store:l,views:d,hiddenKinds:s,follow:o}=b(),g=Y("here"),p=de(i,a),h=p.length===0?"":pe(p),[u,S]=(0,E.useState)("");if((0,E.useEffect)(()=>S(h),[h]),p.length===0)return null;let f=p.filter(r=>r.name),y=f.slice(0,t?2:3),m=p.length-y.length,k=p.length-f.length,T=d.places();return(0,c.jsxs)("div",{className:"graview-here","data-testid":"here",children:[(0,c.jsx)("style",{children:se}),(0,c.jsx)("span",{role:"status","aria-live":"polite",style:le,children:u}),(0,c.jsxs)("button",{type:"button","data-testid":"here-open",...g.trigger,onClick:g.toggle,"aria-label":`${h} \u2014 who and where`,title:h,children:[y.length>0?(0,c.jsx)("span",{style:{display:"flex"},children:y.map(r=>(0,c.jsx)(O,{one:r},r.participant))}):(0,c.jsx)(O,{count:m}),y.length>0&&m>0?(0,c.jsxs)("span",{"aria-hidden":"true",children:["+",m]}):null]}),(0,c.jsxs)("ul",{...g.pane,"aria-label":"Who is here","data-testid":"here-list",hidden:!g.open,className:"graview-bar-list",style:U,children:[f.map(r=>{let v=ce(r.stop,{store:l,principal:a,hidden:s,pictures:T}),A=ee(r);return(0,c.jsx)("li",{children:(0,c.jsxs)(e?"button":"span",{className:"graview-bar-item","data-testid":"here-one",...e?{type:"button",title:`Go where ${A} is`,onClick:()=>{g.setOpen(!1),o(r.participant)}}:{style:{cursor:"default"}},children:[(0,c.jsx)(O,{one:r}),(0,c.jsxs)("span",{children:[A,v?(0,c.jsxs)("small",{children:["On ",v]}):null]})]})},r.participant)}),k>0?(0,c.jsx)("li",{children:(0,c.jsxs)("span",{className:"graview-bar-item","data-testid":"here-viewers",style:{cursor:"default"},children:[(0,c.jsx)(O,{count:k}),(0,c.jsxs)("span",{children:[te(k),(0,c.jsx)("small",{children:"Not signed in"})]})]})}):null]})]})}function O({one:e,count:t}){return(0,c.jsx)("span",{className:"graview-here-mark","aria-hidden":"true",...e?{style:{"--graview-hue":Math.round(e.hue)}}:{"data-counted":""},...e?.kind==="agent"?{"data-agent":""}:{},children:e?(e.name??"").trim().charAt(0).toUpperCase():t})}function me(e){let t=/^(?:place|scene):([^:]+):(.+)$/.exec(e.key);return t?{place:t[2],about:[`aggregate:${t[1]}`],title:e.label}:{about:e.group==="lists"&&e.kind?[`aggregate:${e.kind}`]:[],title:e.label}}function L(e,t,i,a,l,d){let s=me(t),o=e.getBoundingClientRect(),g={...s,face:i?"scene":"pages",x:Math.round(l??o.left+Math.min(16,o.width/2)),y:Math.round(d??Math.min(o.bottom,o.top+36)),returnTo:e},p=i?null:e.closest("[data-graview-embed], [data-graview-shell]")?.querySelector("[data-graview-face='pages']")??document.querySelector("[data-graview-face='pages']");p?p.dispatchEvent(new CustomEvent(F,{detail:g})):a(g)}var R={on:null,at:0},ne=500,ye=10;function fe(e,t,i,a,l,d,s){let o=t.getAttribute("data-testid")??"",g=o==="app-places-open"?a:o.slice(10),p=i.find(m=>m.key===g);if(!p)return;if(e.type==="keydown")return R={on:t,at:Date.now()},L(t,p,l,d);let{clientX:h,clientY:u}=e;if(e.type==="contextmenu")return R.on===t&&Date.now()-R.at<700?void 0:h===0&&u===0?L(t,p,l,d):L(t,p,l,d,h,u);let S=Date.now()-Math.max(0,performance.now()-e.timeStamp),f=!1,y=m=>{Math.hypot(m.clientX-h,m.clientY-u)>ye&&(f=!0)};document.addEventListener("pointermove",y),setTimeout(()=>{document.removeEventListener("pointermove",y),!(f||s.at!==0&&s.at-S<ne)&&(R={on:t,at:Date.now()},t.addEventListener("click",m=>{m.preventDefault(),m.stopPropagation()},{capture:!0,once:!0}),L(t,p,l,d,h,u))},Math.max(0,ne-(Date.now()-S)))}var n=w(x(),1),Ge=z(N(()=>(__graviewPreload(import.meta.url,["./chunk.G6DISMVT.js","./chunk.W54NXXC5.js","./chunk.B3T4N2XM.js","./chunk.SDO3U72B.js","./chunk.6W2DUW5S.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.FJN4OGAS.js")))).part((e,t)=>(0,n.jsx)(e.TidyGroups,{...t}),{quiet:!0}),ve=z(N(()=>(__graviewPreload(import.meta.url,["./chunk.B3T4N2XM.js","./chunk.SDO3U72B.js","./chunk.6W2DUW5S.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.GANAZIRD.js")))).part((e,t)=>(0,n.jsx)(e.HoverChipsSwitch,{...t}),{quiet:!0});function _e({violations:e,pick:t}){let{store:i,brand:a,setMenuAt:l}=b(),d=X(i,e);return(0,n.jsx)(n.Fragment,{children:d.map((s,o)=>{let g=Q(s),p=s.repairs.length>0?`${s.repairs.length} ${s.repairs.length===1?"way":"ways"} to fix`:"";return(0,n.jsx)("li",{style:{borderTop:o===0?"none":"1px solid var(--graview-edge)"},children:(0,n.jsxs)("button",{type:"button",onClick:h=>{let u=h.currentTarget.closest("ol").getBoundingClientRect();t(s),l({x:u.left,y:u.top,on:s.subjectId})},...H(s)!==void 0?{title:H(s)}:{},style:{width:"100%",textAlign:"left",fontSize:"0.8125rem",lineHeight:1.4,padding:"7px 8px",border:"1px solid transparent",background:"none",boxShadow:"none",borderRadius:7},children:[s.line?(0,n.jsx)(J,{line:s.line,schema:i.schema,...a?{brand:a}:{},stacked:!0,style:{display:"block",color:"var(--graview-ink)"}}):(0,n.jsx)("span",{style:{display:"block",color:"var(--graview-ink)"},children:s.message}),g||p?(0,n.jsx)("span",{style:{color:"var(--graview-ink-faint)",fontSize:"0.75rem"},children:[g,p].filter(Boolean).join(" \xB7 ")}):null]})},`${s.invariant}:${o}`)})})}function De({name:e,me:t,scheme:i,onScheme:a,profileHref:l,hostActions:d,close:s,part:o,signature:g=!1}){let{principal:p,seats:h,settings:u,settingValues:S,chooseSetting:f,sharing:y,ai:m}=b(),k=p.roles??[],T={setOpen:r=>s()};return(0,n.jsx)(n.Fragment,{children:o==="top"?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{style:{display:"grid",gap:3},children:[(0,n.jsx)("span",{style:$,children:"Signed in as"}),(0,n.jsx)("strong",{style:{fontSize:"1rem",fontWeight:550},children:e}),(0,n.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:k.length>0?k.map(r=>G(r)).join(", "):t===void 0?"This app has no sign-in; everything here is yours.":"No role in particular"}),t!==void 0&&l!==void 0?(0,n.jsx)("a",{href:l(t.id),"data-testid":"profile-record",style:{display:"inline-flex",alignItems:"center",minHeight:24,justifySelf:"start",fontSize:"0.875rem",color:"var(--graview-accent)"},children:"Your record \u2197"}):null,y?(0,n.jsxs)("span",{"data-testid":"profile-seen-as",style:{fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:["Seen by others as ",y.name]}):null]}),d.length>0?(0,n.jsx)("ul",{role:"list","aria-label":"From the host","data-testid":"host-actions",style:{...C,margin:0,paddingLeft:0,listStyle:"none",display:"grid",gap:2},children:d.map(r=>(0,n.jsx)("li",{children:r.href!==void 0?(0,n.jsx)("a",{href:r.href,"data-testid":"host-action",className:"graview-host-action",...r.target?{target:r.target,rel:"noopener"}:{},onClick:()=>{r.onSelect?.(),T.setOpen(!1)},style:re,children:r.label}):(0,n.jsx)("button",{type:"button","data-testid":"host-action",className:"graview-host-action",onClick:()=>{T.setOpen(!1),r.onSelect?.()},style:{...re,width:"100%",textAlign:"left",border:"none",background:"none",boxShadow:"none",font:"inherit",cursor:"pointer"},children:r.label})},r.label))}):null]}):(0,n.jsxs)(n.Fragment,{children:[h.length>1?(0,n.jsxs)("div",{style:{display:"grid",gap:6,...C},children:[(0,n.jsx)("span",{style:$,children:"Sit as somebody else"}),(0,n.jsx)(Z,{})]}):null,u.length>0?(0,n.jsx)("div",{style:{display:"grid",gap:10,...C},children:u.map(r=>(0,n.jsxs)("fieldset",{"data-testid":`setting-${r.name}`,style:{border:0,margin:0,padding:0,display:"grid",gap:5},children:[(0,n.jsx)("legend",{style:{...$,padding:0},children:r.title}),r.description?(0,n.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:r.description}):null,(0,n.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:r.options.map(v=>{let A=(S[r.name]??r.initial)===v.value;return(0,n.jsx)("button",{type:"button","aria-pressed":A,"data-testid":`setting-${r.name}-${v.value}`,onClick:()=>f(r.name,v.value),style:P(A),children:v.label},v.value)})})]},r.name))}):null,K(m)?(0,n.jsx)(ae.Suspense,{fallback:null,children:(0,n.jsx)(ve,{legend:$,style:C,choice:P})}):null,i!==void 0&&a!==void 0?(0,n.jsxs)("div",{style:{display:"grid",gap:5,...C},children:[(0,n.jsx)("span",{style:$,children:"Scheme"}),(0,n.jsx)("div",{style:{display:"flex",gap:4},children:["light","dark"].map(r=>(0,n.jsx)("button",{type:"button","aria-pressed":i===r,"data-testid":`profile-scheme-${r}`,onClick:()=>a(r),style:P(i===r),children:r==="light"?"\u2600 Light":"\u263E Dark"},r))})]}):null,g?(0,n.jsxs)("p",{"data-testid":"graview-signature",style:{...C,margin:0,display:"flex",alignItems:"center",gap:6,fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:["Built with",(0,n.jsxs)("a",{href:"https://graview.dev",target:"_blank",rel:"noopener",style:{display:"inline-flex",alignItems:"center",gap:4,minHeight:24,color:"var(--graview-ink-muted)",fontWeight:600,textDecoration:"none"},children:[(0,n.jsx)("span",{"data-testid":"graview-mark",style:{display:"inline-flex",lineHeight:0},dangerouslySetInnerHTML:{__html:we}}),"Graview"]})]}):null]})})}var we='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="14" height="14" aria-hidden="true" focusable="false"><g fill="none" stroke="currentColor" stroke-width="2.4" stroke-linejoin="round"><path d="M13 11 L3 8 L14 3 H29 L21 9"/><path d="M10 18 L3 23 L16.5 28 L29 21 L22 19"/><path d="M16.5 18.5 V23.5" stroke-linecap="round"/></g><circle cx="16.5" cy="13.5" r="2" fill="var(--graview-mark-point, currentColor)"/></svg>',re={display:"flex",alignItems:"center",minHeight:28,padding:"2px 8px",borderRadius:7,fontSize:"0.875rem",color:"var(--graview-ink)",textDecoration:"none"},$={fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},C={paddingTop:10,borderTop:"1px solid var(--graview-edge)"};export{ie as ActivityRail,he as Here,_e as ProblemRows,De as ProfilePane,Ge as TidyFoot,fe as placeGesture,ge as sayTheirChange};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as a,l as b,m as c,n as d,o as e,p as f,q as g,r as h,s as i}from"./chunk.ZYYM52N5.js";import"./chunk.4DCPB67O.js";import"./chunk.Y4VOCJ7R.js";import"./chunk.3FUFVVR4.js";import"./chunk.XOZU4OFA.js";import"./chunk.IYVBJDR7.js";import"./chunk.OZYZBRWO.js";import"./chunk.TI4OSTQV.js";import"./chunk.FGJM4LJO.js";import"./chunk.MT45H2T5.js";import"./chunk.S2ATSY6P.js";import"./chunk.72Q4R7N6.js";import"./chunk.G6DISMVT.js";import"./chunk.W54NXXC5.js";import"./chunk.B3T4N2XM.js";import"./chunk.SDO3U72B.js";import"./chunk.6W2DUW5S.js";import"./chunk.SLBWPVIY.js";import"./chunk.AJZBJBMO.js";export{i as GhostTray,h as InlineAiMenu,g as askAgain,c as askInline,a as askOf,b as drawPanel,d as heldSuggestion,e as suggestOnce,f as takeOffer};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as V,b as _,c as F,d as $}from"./chunk.DUZS52WX.js";import"./chunk.G6DISMVT.js";import"./chunk.W54NXXC5.js";import{G as ee,O as B,P as H,T as L,ca as K}from"./chunk.B3T4N2XM.js";import"./chunk.SDO3U72B.js";import{Oc as T,R as z,Xa as N,Ya as I}from"./chunk.6W2DUW5S.js";import"./chunk.SLBWPVIY.js";import{b as A}from"./chunk.AJZBJBMO.js";function x(t,n){let r=N(t);return r==="agent"?"agent":r!=="human"&&r!=="visitor"?"app":t.onBehalfOf!==void 0?"person":t.id===void 0||n?.id===void 0||t.id===n.id?"you":"person"}var te=t=>t.ops.filter(n=>n.withheld!==!0);function U(t,n={}){let r=[];for(let e of t.batches()){let s=e.ops[0],d=e.ops.at(-1),c=te(e).length===0,h=c?void 0:_(e.ops),l=r.at(-1);if(h&&l?.typed&&l.author&&V(l.author,e.author)&&l.typed.node===h.node&&l.typed.field===h.field){let y=F(l.typed,h);r[r.length-1]={...l,seq:d.seq+1,at:d.at,batch:e.id,batches:[...l.batches??[],e.id],typed:y,said:$(y,t.schema,t.graph,!1)};continue}r.push({seq:d.seq+1,from:s.seq,at:d.at,batch:e.id,maker:c?"person":x(e.author,n.me),author:c?void 0:e.author,said:h?$(h,t.schema,t.graph,!1):e.intent,declaration:!1,withheld:c,...h?{batches:[e.id],typed:h}:{}})}let i=[...t.log.epochs().filter(e=>e.change!==void 0).map(e=>({seq:e.seq,sentence:e.change,...e.at?{at:e.at}:{}})),...n.declarations??[]];for(let e of i){if(e.seq<t.log.horizon||e.seq>t.log.length)continue;let s=r.findIndex(d=>d.seq===e.seq);if(s>=0&&!r[s].withheld){r[s]={...r[s],declaration:!0,said:e.sentence};continue}r.push({seq:e.seq,from:e.seq,at:e.at,batch:void 0,maker:e.author?x(e.author,n.me):"app",author:e.author,said:e.sentence,declaration:!0,withheld:!1})}return r.sort((e,s)=>e.seq-s.seq||+(e.batch!==void 0)-+(s.batch!==void 0))}function Y(t,n){let r=t.log.all(),i=new Map(r.map(e=>[e.id,e.seq]));return t.batches().filter(e=>!e.undone&&e.ops[0].seq>=n).filter(e=>!e.ops.every(s=>s.undoes!==void 0&&(i.get(s.undoes)??-1)>=n)).map(e=>e.id)}function G(t,n){return t.withheld?"Someone":t.maker==="you"?"you":t.author?I(t.author,n):"the app"}var p=A(ee(),1);var o=A(L(),1),ne={kind:"human"},ae=[1,2,4,8],re=900,R={you:"You",person:"A person",agent:"An agent",app:"The app"},X={you:"var(--graview-accent)",person:"var(--graview-ink-muted)",agent:"var(--graview-activity, var(--graview-good))",app:"var(--graview-edge-bright)"};function oe(t,n,r){let i=r?Array.from({length:n},(e,s)=>s):[];return[...new Set([...i,n,...t.map(e=>e.seq)])].sort((e,s)=>e-s)}function se(t,n){let r=t.withheld===!0;return{seq:t.seq+1,from:t.seq,at:t.at,batch:t.batch,maker:r?"person":x(t.author,n),author:r?void 0:t.author,said:t.batchIntent??t.intent,declaration:!1,withheld:r}}function ie(t,n){let r=0;for(let i=0;i<t.length;i++)t[i]<=n&&(r=i);return r}function de(t,n,r){let i=Y(t,n);if(i.length===0)return null;let e=t.canUndo(i);if(!e.ok)return null;let s=new Set(t.permittedMutations(r).map(d=>d.name));return e.ops.every(d=>d.mutation!==null&&s.has(d.mutation.name))?i:null}function be({face:t}){let n=B(),r=K(),i=r?.principal??ne,e=H(n.live,i),s=e.log.length,d=(0,p.useMemo)(()=>U(e,{me:i,...n.host?.declarations?{declarations:n.host.declarations}:{}}),[e,i,n.host,s]),c=e.log.horizon,h=c>0&&n.host?.archived!==void 0,l=(0,p.useMemo)(()=>oe(d,c,h),[d,c,h]),y=n.archive,m=y?.seq??n.past?.seq??s,v=ie(l,m),f=l.length-1,M=m<c&&n.past?.seq===m?n.past.store.log.all().at(-1):void 0,k=M?se(M,i):m<c?void 0:[...d].reverse().find(a=>a.seq<=m&&a.seq>(l[v-1]??-1))??[...d].reverse().find(a=>a.seq<=m),[w,q]=(0,p.useState)(!1),[P,J]=(0,p.useState)(1),[D,E]=(0,p.useState)(null);(0,p.useEffect)(()=>{if(!w)return;if(v>=f){q(!1);return}let a=setTimeout(()=>n.show(l[v+1]),re/P);return()=>clearTimeout(a)},[w,v,f,P,l,n]);let j=(0,p.useMemo)(()=>n.past&&!y&&m>=c?de(e,m,i):null,[n.past,y,e,m,c,i,s]),C=a=>G(a,{graph:e.graph,schema:e.schema,...r?.seats?{seats:r.seats}:{},...r?.people?{people:r.people}:{}}),g=n.past?n.past.at?z(n.past.at,r?.locale):"the start":null,O=y?y.refused?"The archive could not be read":"Reading the older changes from the archive\u2026":k?`${C(k)==="you"?"You":C(k)}: ${k.said}`:"Nothing had happened yet",W=(0,p.useRef)(null);(0,p.useLayoutEffect)(()=>{let a=W.current,b=a?.parentElement;if(t!=="scene"||!a||!b)return;let u=()=>b.style.setProperty("--graview-sheet",`${Math.ceil(a.getBoundingClientRect().height)+24}px`);u();let S=typeof ResizeObserver>"u"?null:new ResizeObserver(u);return S?.observe(a),()=>{S?.disconnect(),b.style.removeProperty("--graview-sheet")}},[t]);let Q=t==="scene"?{position:"absolute",left:"50%",bottom:12,transform:"translateX(-50%)",width:"min(720px, calc(100% - 32px))",zIndex:T("rail")}:{position:"sticky",top:0,zIndex:T("rail"),margin:"0 auto 12px",maxWidth:960,width:"100%"};return(0,o.jsxs)("section",{ref:W,"aria-label":"Timeline","data-testid":"timeline","data-graview-past":n.past?String(n.past.seq):"now","data-graview-offstage":"",style:{...Q,boxSizing:"border-box",display:"grid",gap:8,padding:"10px 12px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",color:"var(--graview-ink)",fontSize:"0.8125rem"},children:[(0,o.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"baseline",gap:"4px 12px"},children:[(0,o.jsx)("strong",{"data-testid":"as-of",role:"status",style:{fontWeight:600},children:y?"Archived changes":g?`As of ${g}`:"Now"}),(0,o.jsx)("span",{"data-testid":"timeline-caption",style:{color:"var(--graview-ink-muted)",minWidth:0,overflowWrap:"anywhere"},children:O}),g?(0,o.jsx)("span",{style:{color:"var(--graview-ink-faint)"},"data-testid":"past-read-only",children:"Nothing changes while you look back."}):null]}),(0,o.jsxs)("div",{style:{position:"relative",height:22},"aria-hidden":"true",children:[h?(0,o.jsx)("span",{"data-testid":"timeline-archived",title:"Changes read from the archive as you scrub back",style:{position:"absolute",left:0,bottom:0,height:6,width:`${f===0?0:l.indexOf(c)/f*100}%`,borderRadius:2,background:"var(--graview-edge)"}}):null,l.slice(1).map((a,b)=>{let u=[...d].reverse().find(Z=>Z.seq===a);if(!u)return null;let S=f===0?0:(b+1)/f*100;return(0,o.jsx)("span",{"data-graview-tick":a,"data-maker":u.maker,...u.declaration?{"data-declaration":""}:{},title:`${R[u.maker]}: ${u.said}`,style:{position:"absolute",left:`calc(${S}% - 1px)`,bottom:0,width:u.declaration?4:2,height:u.declaration?22:12,borderRadius:2,background:u.declaration?"var(--graview-ink)":X[u.maker],opacity:a<=m?1:.45}},`${a}:${u.batch??"declaration"}`)})]}),(0,o.jsx)("input",{type:"range","data-testid":"scrubber","aria-label":"Moment",min:0,max:f,step:1,value:v,"aria-valuetext":g?`As of ${g}. ${O}`:`Now. ${O}`,onChange:a=>{q(!1),n.show(l[Number(a.currentTarget.value)]??s)},style:{width:"100%",margin:0,accentColor:"var(--graview-accent)"}}),(0,o.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:8},children:[(0,o.jsx)("button",{type:"button","data-testid":"play","aria-pressed":w,onClick:()=>{!w&&v>=f&&n.show(l[0]),q(!w)},style:{minHeight:28,minWidth:64},children:w?"Pause":"Play"}),(0,o.jsxs)("label",{style:{display:"inline-flex",alignItems:"center",gap:6,color:"var(--graview-ink-muted)"},children:["Speed",(0,o.jsx)("select",{"data-testid":"speed",value:P,onChange:a=>J(Number(a.currentTarget.value)),style:{minHeight:28},children:ae.map(a=>(0,o.jsxs)("option",{value:a,children:[a,"\xD7"]},a))})]}),(0,o.jsx)("span",{"aria-hidden":"true",style:{display:"inline-flex",gap:10,color:"var(--graview-ink-faint)",flexWrap:"wrap"},children:Object.keys(R).filter(a=>d.some(b=>b.maker===a)).map(a=>(0,o.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[(0,o.jsx)("span",{style:{width:8,height:8,borderRadius:2,background:X[a]}}),R[a]]},a))}),(0,o.jsxs)("span",{style:{marginLeft:"auto",display:"inline-flex",gap:8},children:[j?(0,o.jsx)("button",{type:"button","data-testid":"restore-here",title:"Take back every change since, as one change you can undo",onClick:()=>{E(null);try{e.undo([...j],{author:i,intent:g?`Restore to ${g}`:"Restore"}),n.show(null)}catch(a){E(a instanceof Error?a.message:String(a))}},style:{minHeight:28},children:"Restore to here"}):null,(0,o.jsx)("button",{type:"button","data-testid":"back-to-now",onClick:()=>n.show(null),style:{minHeight:28},children:"Back to now"})]})]}),D?(0,o.jsx)("span",{role:"alert","data-testid":"restore-refused",style:{color:"var(--graview-warn)"},children:D}):null,y?.refused?(0,o.jsx)("span",{role:"alert","data-testid":"archive-refused",style:{color:"var(--graview-warn)"},children:y.refused}):null,c>0&&!h?(0,o.jsx)("span",{"data-testid":"timeline-horizon",style:{color:"var(--graview-ink-faint)"},children:"The changes before the timeline's start were archived."}):null]})}export{be as Timeline};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as Ie}from"./chunk.HJCQ6I3S.js";import{a as Se,b as Fe,c as Te,d as Ce}from"./chunk.LCG3VLCB.js";import"./chunk.TKUNRFDE.js";import{c as Me}from"./chunk.P7FN3SFB.js";import"./chunk.MT45H2T5.js";import"./chunk.S2ATSY6P.js";import"./chunk.72Q4R7N6.js";import{G as Qe,T as Oe}from"./chunk.B3T4N2XM.js";import"./chunk.SDO3U72B.js";import"./chunk.6W2DUW5S.js";import"./chunk.SLBWPVIY.js";import{b as Re}from"./chunk.AJZBJBMO.js";var I=Re(Qe(),1);var O=.5,fe=1,Pe=.76,Ne=3,Ze=3,Ae=.6;function et(t){let n=De(t);for(;;){let s=n.next();if(s.done)return s.value}}function*De(t){let{ribbons:n,plots:s,cell:i}=t,u=t.tilt??.5,g=t.labels??[],k=[...s.values()],p=new Map;if(k.length===0||i<=0)return p;let R=1/0,j=1/0,E=-1/0,W=-1/0;for(let o of k)R=Math.min(R,o.col),j=Math.min(j,o.row),E=Math.max(E,o.col+o.side),W=Math.max(W,o.row+o.side);R-=3,j-=3,E+=3,W+=3;let M=Math.round((E-R)/O)+1,P=Math.round((W-j)/O)+1,H=o=>R+o*O,_=o=>j+o*O,B=4,te=(o,c)=>{if(g.length===0)return!1;let l=Me(o,c,i,u);for(let f of g)if(l.x>f.x-B&&l.x<f.x+f.width+B&&l.y>f.y-B&&l.y<f.y+f.height+B)return!0;return!1},L=(o,c)=>{for(let l of k)if(o>l.col-Pe&&o<l.col+l.side+Pe&&c>l.row-Pe&&c<l.row+l.side+Pe)return!0;return!1},A=M*P,N=new Uint8Array(A),S=new Uint8Array(A),ne=new Uint8Array(A),oe=new Uint8Array(A),G=new Uint8Array(A),re=new Uint8Array(A),V=new Float32Array(A);for(let o=0;o<P;o++){let c=_(o);for(let l=0;l<M;l++){let f=H(l),m=o*M+l;if(S[m]=L(f,c)?0:1,N[m]=S[m]&&!te(f,c)?1:0,l+1<M){let a=f+O/2;oe[m]=L(a,c)?0:1,ne[m]=oe[m]&&!te(a,c)?1:0}if(o+1<P){let a=c+O/2;re[m]=L(f,a)?0:1,G[m]=re[m]&&!te(f,a)?1:0}let e=1/0;for(let a of k)e=Math.min(e,Math.max(0,a.col-f,f-(a.col+a.side),a.row-c,c-(a.row+a.side)));V[m]=e}}let J=(o,c)=>{let l=[],f=(e,a)=>{let w=[],b=Math.min(1,a/3);for(let r=Math.ceil((e+b)/O-1e-9)*O;r<=e+a-b+1e-9;r+=O)w.push(r);return w},m=(e,a,w,b)=>{let r=Math.round((e-R)/O),d=Math.round((a-j)/O);r>=0&&d>=0&&r<M&&d<P&&c[d*M+r]&&l.push({i:r,j:d,out:w,curb:b})};for(let e of f(o.row,o.side))m(o.col-fe,e,1,{col:o.col,row:e}),m(o.col+o.side+fe,e,0,{col:o.col+o.side,row:e});for(let e of f(o.col,o.side))m(e,o.row-fe,3,{col:e,row:o.row}),m(e,o.row+o.side+fe,2,{col:e,row:o.row+o.side});return l};yield;let se=new Uint8Array(A),ie=new Uint8Array(A),le=[[1,0],[-1,0],[0,1],[0,-1]],ae=[1,0,3,2],D=A*4,X=new Float64Array(D),F=[new Int32Array(D),new Int32Array(D)],U=new je,ge=(o,c,l,f,m)=>{let e=l?N:S,a=l?ne:oe,w=l?G:re,b=J(o,e),r=J(c,e),d=new Map(r.map(h=>[h.j*M+h.i,h]));if(b.length===0||r.length===0)return{reached:-1,best:1/0,starts:b,goal:d,back:f};let y=(h,x)=>{let $=H(h),K=_(x);return(Math.max(0,c.col-$,$-(c.col+c.side))+Math.max(0,c.row-K,K-(c.row+c.side)))*Ae};X.fill(1/0),f.fill(-1),U.clear();let Y=-1,v=1/0;for(let h of b){let x=(h.j*M+h.i)*4+h.out;X[x]=0,U.push(x,y(h.i,h.j))}for(;U.size>0;){let h=U.peekKey();if(h>=v||h>=m)break;let x=U.pop(),$=x>>2,K=x&3,ee=$%M,ue=($-ee)/M,Ee=d.get($);if(Ee){let q=X[x]+(K===ae[Ee.out]?0:Ne);q<v&&(v=q,Y=x);continue}for(let q=0;q<4;q++){let[pe,Be]=le[q],be=ee+pe,xe=ue+Be;if(be<0||xe<0||be>=M||xe>=P)continue;let ke=xe*M+be;if(!e[ke])continue;let Le=pe+Be>0?$:ke;if(!(pe!==0?a:w)[Le])continue;let _e=(pe!==0?se:ie)[Le]?Ae:1,Je=O*_e*(1+Math.max(0,V[ke]-Ze))+(q===K?0:Ne),ve=ke*4+q,$e=X[x]+Je;$e<X[ve]&&(X[ve]=$e,f[ve]=x,U.push(ve,$e+y(be,xe)))}}return{reached:Y,best:v,starts:b,goal:d,back:f}},Q=new Map;for(let o of n){let c=s.get(o.from),l=s.get(o.to);if(!c||!l||c===l)continue;let f=ge(c,l,!1,F[1],1/0);if(f.reached===-1){yield;continue}let m=ge(c,l,!0,F[0],1.3*f.best+2+Ae*fe+1e-9),e=m.reached!==-1&&m.best<=1.3*f.best+2?m:f;if(e.reached===-1)continue;let{reached:a,starts:w,goal:b,back:r}=e,d=[];for(let v=a;v!==-1;v=r[v]){let h=v>>2,x=d[d.length-1],$={i:h%M,j:Math.floor(h/M)};(!x||x.i!==$.i||x.j!==$.j)&&d.push($)}d.reverse();for(let v=1;v<d.length;v++){let h=d[v-1],x=d[v],$=h.i+h.j<x.i+x.j?h:x;(h.i!==x.i?se:ie)[$.j*M+$.i]=1}let y=w.find(v=>v.i===d[0].i&&v.j===d[0].j),Y=b.get(d[d.length-1].j*M+d[d.length-1].i);Q.set(o.key,{cells:d,start:y.curb,end:Y.curb}),yield}let ce=new Map(n.map(o=>[o.key,o.width])),de=new Map(n.map((o,c)=>[o.key,c])),we=i*u/Math.sqrt(1+u*u),Z=(o,c)=>o==="col"?`r${c.row.toFixed(2)}`:`c${c.col.toFixed(2)}`,T=new Map;for(let[o,c]of Q)for(let l=1;l<c.cells.length;l++){let f=c.cells[l-1],m=c.cells[l],e=Z(f.i!==m.i?"col":"row",{col:H(f.i),row:_(f.j)});T.set(e,(T.get(e)??new Set).add(o))}for(let[o,c]of Q){let l=[c.start,...c.cells.map(r=>({col:H(r.i),row:_(r.j)})),c.end],f=r=>r>=2&&r<=c.cells.length,m=[];for(let r=1;r<l.length;r++){let d=Math.abs(l[r].col-l[r-1].col)>1e-9?"col":"row",y=m[m.length-1];y&&y.axis===d?y.to=r:m.push({from:r-1,to:r,axis:d})}if(m.length===0)continue;let e=m.map(r=>{if(!Array.from({length:r.to-r.from},(h,x)=>f(r.from+1+x)).some(Boolean))return 0;let d=T.get(Z(r.axis,l[r.from]))??new Set;if(!d.has(o))return 0;let y=[...d].sort((h,x)=>(de.get(h)??0)-(de.get(x)??0)),v=-(y.reduce((h,x)=>h+(ce.get(x)??2)+2,0)-2)/2;for(let h of y){if(h===o)return(v+(ce.get(h)??2)/2)/we;v+=(ce.get(h)??2)+2}return 0}),a=r=>{let d=m[r],y=l[d.from];return d.axis==="col"?{row:y.row+e[r]}:{col:y.col+e[r]}},w=(r,d,y)=>({col:r.col??d.col??y.col,row:r.row??d.row??y.row}),b=[w(a(0),{},l[0])];for(let r=0;r+1<m.length;r++)b.push(w(a(r),a(r+1),l[m[r].to]));b.push(w(a(m.length-1),{},l[l.length-1])),p.set(o,b.map(r=>Me(r.col,r.row,i,u)))}return p}var je=class{items=[];keys=[];get size(){return this.items.length}clear(){this.items.length=0,this.keys.length=0}peekKey(){return this.keys[0]??1/0}push(n,s){this.items.push(n),this.keys.push(s);let i=this.items.length-1;for(;i>0;){let u=i-1>>1;if(this.keys[u]<=this.keys[i])break;this.swap(i,u),i=u}}pop(){let n=this.items[0],s=this.items.pop(),i=this.keys.pop();if(this.items.length>0){this.items[0]=s,this.keys[0]=i;let u=0;for(;;){let g=2*u+1,k=g+1,p=u;if(g<this.items.length&&this.keys[g]<this.keys[p]&&(p=g),k<this.items.length&&this.keys[k]<this.keys[p]&&(p=k),p===u)break;this.swap(u,p),u=p}}return n}swap(n,s){let i=this.items[n];this.items[n]=this.items[s],this.items[s]=i;let u=this.keys[n];this.keys[n]=this.keys[s],this.keys[s]=u}},tt=16,z=new Map,Ue=0;function me(t){let n=[...t.plots].map(([s,i])=>`${s}:${i.col},${i.row},${i.side}`).join(";");return`${t.ribbons.map(s=>`${s.key}>${s.from}>${s.to}>${s.width}`).join(";")}|${n}`}var nt=t=>t.map(n=>`${Math.round(n.x)},${Math.round(n.y)},${Math.round(n.width)},${Math.round(n.height)}`).join(";"),Ke=(t,n)=>`${n}|${t.cell}|${t.tilt??.5}|${nt(t.labels??[])}`;function qe(t,n,s){for(z.set(Ke(t,n),{ground:n,cell:t.cell,tilt:t.tilt??.5,runs:s});z.size>tt;)z.delete(z.keys().next().value)}function ye(t){let n=Ke(t,me(t)),s=z.get(n);if(s)return z.delete(n),z.set(n,s),s.runs}function ze(t){let n=ye(t);if(n)return n;Ue+=1;let s=et(t);return qe(t,me(t),s),s}function We(t,n,s=8){let i=ye(t);if(i)return n(i),()=>{};let u=me(t),g=De(t),k=!1,p;Ue+=1;let R=()=>{if(p=void 0,k)return;let j=performance.now();for(;;){let E=g.next();if(E.done){qe(t,u,E.value),n(E.value);return}if(performance.now()-j>=s)break}p=setTimeout(R,0)};return p=setTimeout(R,0),()=>{k=!0,p!==void 0&&clearTimeout(p)}}function Ge(t,n,s){let i;for(let g of z.values())g.ground===t&&g.tilt===s&&(i=g);if(!i||n<=0)return;if(i.cell===n)return i.runs;let u=n/i.cell;return new Map([...i.runs].map(([g,k])=>[g,k.map(p=>({x:p.x*u,y:p.y*u}))]))}function Ve(t,n){let s=t.col+t.side,i=s+.25+.22*Math.max(0,n),u=t.row+t.side*Math.max(.1,.3-.06*n),g=t.row+t.side*Math.min(.9,.7+.06*n);return[{col:s,row:u},{col:i,row:u},{col:i,row:g},{col:s,row:g}]}function Xe(t,n){return t.map(s=>Me(s.col,s.row,n.cell,n.tilt))}function Ye(t){return t.map((n,s)=>`${s===0?"M":"L"} ${n.x.toFixed(1)} ${n.y.toFixed(1)}`).join(" ")}function He(t){if(t.length===0)return{x:0,y:0};let n=0;for(let i=1;i<t.length;i++)n+=Math.hypot(t[i].x-t[i-1].x,t[i].y-t[i-1].y);let s=n/2;for(let i=1;i<t.length;i++){let u=t[i-1],g=t[i],k=Math.hypot(g.x-u.x,g.y-u.y);if(k>=s&&k>0)return{x:u.x+(g.x-u.x)*s/k,y:u.y+(g.y-u.y)*s/k};s-=k}return t[t.length-1]}var C=Re(Oe(),1),he=new Map,ot=(t,n)=>t.length===n.length&&t.every((s,i)=>Math.round(s.x)===Math.round(n[i].x)&&Math.round(s.y)===Math.round(n[i].y)&&Math.round(s.width)===Math.round(n[i].width)&&Math.round(s.height)===Math.round(n[i].height));function dt({frame:t,width:n,height:s,pan:i,store:u,graphVersion:g,selection:k,view:p,emphasis:R,hiddenKinds:j,drawn:E}){let[W,M]=(0,I.useState)(null),P=t.city,H=e=>u.graph.getNode(e)?.kind,_=(0,I.useMemo)(()=>Se(u.graph.allEdges(),e=>u.graph.getNode(e)?.kind),[u,g]),B=new Map;for(let e of t.nodes){let a=e.id.startsWith("kind:")?Te(e.id):null;a!==null&&e.plot&&Math.round(e.plane)===2&&B.set(a,e.plot)}let te=[...B].map(([e,a])=>`${e}:${a.col},${a.row},${a.side}`).join(";"),L=P?.cell??0,A=_.filter(e=>B.has(e.from)&&B.has(e.to)&&!j.has(e.from)&&!j.has(e.to)&&E(e.edge)),N=P?.tilt??.5,S=`${te}|${L}|${N}`,[ne,oe]=(0,I.useState)(null),[G,re]=(0,I.useState)(null),V=t.t>=1,J=!!P&&!!p.overview;(0,I.useLayoutEffect)(()=>{let e=G?.parentElement;if(!e||!P||!V)return;let a=e.getBoundingClientRect(),w=P.originX+i.x,b=P.originY+i.y,r=[...e.querySelectorAll('[data-graview-view^="kind:"] .graview-kind-face')].flatMap(d=>{let y=d.getBoundingClientRect();return y.width>0&&y.height>0?[{x:y.left-a.left-w,y:y.top-a.top-b,width:y.width,height:y.height}]:[]});for(he.set(S,r);he.size>16;)he.delete(he.keys().next().value);oe(d=>d?.cards===S&&ot(d.labels,r)?d:{cards:S,labels:r})},[G,V,S]);let se=Math.max(0,...A.map(e=>e.links)),ie=A.map(e=>({key:e.key,from:e.from,to:e.to,width:Ie(e.links,se)})),le=me({ribbons:ie,plots:B}),ae=typeof window>"u",D=ne?.cards===S?ne.labels:he.get(S)??(ae?[]:void 0),F=L>0&&J&&V&&D!==void 0?{ribbons:ie,plots:B,cell:L,tilt:N,labels:D}:null,[U,ge]=(0,I.useState)(0),Q=F!==null&&!ae&&ye(F)===void 0,ce=`${le}|${L}|${N}|${(D??[]).map(e=>`${Math.round(e.x)},${Math.round(e.y)},${Math.round(e.width)},${Math.round(e.height)}`).join(";")}`;(0,I.useEffect)(()=>{if(!(!Q||!F))return We(F,()=>ge(e=>e+1))},[Q,ce]);let de=(0,I.useMemo)(()=>{if(L===0||!J)return[];let e=F?ae?ze(F):ye(F):Ge(le,L,N);if(!e)return[];let a=new Map;return A.flatMap(w=>{let b;if(w.from===w.to){let r=a.get(w.from)??0;a.set(w.from,r+1),b=Xe(Ve(B.get(w.from),r),{cell:L,tilt:N})}else b=e.get(w.key);return!b||b.length<2?[]:[{ribbon:w,points:b,d:Ye(b),middle:He(b),width:Ie(w.links,se)}]})},[L,N,le,D,V,J,U]),we=(0,I.useRef)([]),Z=(0,I.useRef)({x:0,y:0});if(Z.current=P?{x:P.originX+i.x,y:P.originY+i.y}:{x:0,y:0},(0,I.useEffect)(()=>{let e=G?.parentElement;if(!e||typeof window>"u")return;let a=0,w=null,b=()=>{a=0;let y=w;if(!y)return;let Y=y.target;if(y.pointerType==="touch"||y.buttons!==0||Y?.closest("[data-graview-view], button, a, input, select, textarea, [data-graview-overlay], [data-graview-offstage]")){M(null);return}let v=e.getBoundingClientRect(),h=y.clientX-v.left-Z.current.x,x=y.clientY-v.top-Z.current.y,$=null,K=1/0;for(let ee of we.current){let ue=rt(ee.points,h,x);ue<=ee.reach&&ue<K&&(K=ue,$=ee.key)}M($)},r=y=>{w=y,a===0&&(a=requestAnimationFrame(b))},d=()=>M(null);return e.addEventListener("pointermove",r,{passive:!0}),e.addEventListener("pointerleave",d),()=>{a!==0&&cancelAnimationFrame(a),e.removeEventListener("pointermove",r),e.removeEventListener("pointerleave",d)}},[G]),!P||!p.overview)return null;let T=Fe(k,p,H);if(T.records.length>0||T.lens!==null)return null;let o=T.districts.length>0?de.filter(({ribbon:e})=>T.districts.includes(e.from)||T.districts.includes(e.to)):de;if(o.length===0&&A.length===0)return null;let c=R??null,l=o.find(({ribbon:e})=>e.key===W);we.current=o.map(({ribbon:e,points:a,width:w})=>({key:e.key,points:a,reach:w/2+6}));let f={x:P.originX+i.x,y:P.originY+i.y},m=`translate(${f.x.toFixed(1)} ${f.y.toFixed(1)})`;return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("svg",{ref:re,className:"graview-ribbons","aria-hidden":"true","data-graview-world":"","data-graview-ribbons":o.length,width:n,height:s,style:{position:"absolute",left:0,top:0,pointerEvents:"none",overflow:"visible"},children:(0,C.jsx)("g",{transform:m,children:o.map(({ribbon:e,d:a,width:w})=>{let b=W===e.key||c!==null&&c===e.edge||T.districts.length>0,r=c!==null&&c!==e.edge;return(0,C.jsx)("g",{className:"graview-ribbon","data-graview-ribbon":e.edge,"data-graview-from":`kind:${e.from}`,"data-graview-to":`kind:${e.to}`,"data-graview-links":e.links,"data-graview-lit":b&&!r?"":void 0,"data-graview-receded":r?"":void 0,children:(0,C.jsx)("path",{className:"graview-ribbon-band",d:a,style:{strokeWidth:w}})},e.key)})})}),l?(0,C.jsx)("div",{className:"graview-ribbon-said","data-graview-world":"","data-testid":"ribbon-said",role:"status",style:{position:"absolute",left:f.x+l.middle.x,top:f.y+l.middle.y,pointerEvents:"none"},children:Ce(u.schema,l.ribbon)}):null]})}function rt(t,n,s){let i=1/0;for(let u=1;u<t.length;u++){let g=t[u-1],k=t[u],p=k.x-g.x,R=k.y-g.y,j=p*p+R*R,E=j===0?0:Math.max(0,Math.min(1,((n-g.x)*p+(s-g.y)*R)/j));i=Math.min(i,Math.hypot(n-(g.x+E*p),s-(g.y+E*R)))}return i}export{dt as Ribbons,rt as distanceTo};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{G as w,Na as c,aa as f,ba as h,da as g}from"./chunk.B3T4N2XM.js";import{b as m}from"./chunk.AJZBJBMO.js";var d=m(w(),1);function j(){let e=c();return(0,d.useMemo)(()=>[...new Set(e.flatMap(n=>n.nodeIds))],[e])}function x(){let e=I(),n=f();return(0,d.useMemo)(()=>{if(!n)return e;let t=n.matched;return t.length===0&&e.length===0?[k]:[...new Set([...e,...t])]},[n,e])}function I(){let{store:e,selection:n}=h(),t=g(),r=c();return(0,d.useMemo)(()=>{if(n.length===0)return v;let u=n.join(`
|
|
2
|
+
`),s=y.get(e);if(s&&s.violations===r&&s.key===u)return s.reached;let a=new Set(n),i=new Set(a);for(let o of e.graph.allEdges())a.has(o.from)&&i.add(o.to),a.has(o.to)&&i.add(o.from);for(let o of r)if(o.subjectId!==void 0&&a.has(o.subjectId))for(let p of o.nodeIds)i.add(p);let l=[...i];return y.set(e,{violations:r,key:u,reached:l}),l},[e,n,t,r])}var v=[],y=new WeakMap,k="search:nothing";export{j as a,x as b,I as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h,i as E}from"./chunk.
|
|
1
|
+
import{h,i as E}from"./chunk.S2ATSY6P.js";import{a as M,f as z}from"./chunk.72Q4R7N6.js";import{C as y,Fa as O,Nb as N,Qa as P,Qc as K,Ra as D,Rc as k,Wb as T,Xb as Z,Yb as q,Zb as v,ab as L,fa as S,qb as V,rb as I,sb as g,va as R,ya as j}from"./chunk.6W2DUW5S.js";var J=n=>n.safeParse?.(void 0).success??!1,C=n=>h(n).shape,A=n=>{let r=h(n);if(y(r)?.type!=="literal")return;let o=y(r)?.values;return o&&o.length===1&&typeof o[0]=="string"?o[0]:void 0};function F(n,r){let o=J(r),e=h(r),t=y(e)?.type,c=N(r);if(c)return{control:"node",name:n,optional:o,kinds:c};let p=O(r);if(p)return{control:"linked",name:n,optional:o,relation:p};if(D(r)){let d=P(n);return{control:"repeat",name:n,optional:o,...d?{of:d}:{}}}if(t==="boolean")return{control:"boolean",name:n,optional:o};let f=R(e);if(f)return{control:"file",name:n,optional:o,...f==="image"?{image:!0}:f==="video"?{video:!0}:{}};if(t==="object"){let d=e.shape??{};return{control:"group",name:n,optional:o,fields:Object.entries(d).map(([a,l])=>F(a,l))}}if(t==="union"){let d=y(e)?.options??[],a=d.map(s=>C(s));if(a.every(s=>s!==void 0)){let s=Object.keys(a[0]??{}).find(u=>a.every(m=>A(m?.[u])!==void 0));if(s)return{control:"variant",name:n,optional:o,tag:s,options:d.map((u,m)=>({value:A(a[m]?.[s])??"",fields:Object.entries(a[m]??{}).filter(([w])=>w!==s).map(([w,B])=>F(w,B))}))}}let l=d.map(s=>A(s));return l.every(s=>s!==void 0)?{control:"choice",name:n,optional:o,options:l}:{control:"opaque",name:n,optional:o}}if(t==="array"){let d=y(e)?.element;return d!==void 0?{control:"list",name:n,optional:o,item:F(n,d)}:{control:"opaque",name:n,optional:o}}let i=E(r);return i.type==="text"?{control:"text",name:n,optional:o,...i.long?{long:!0}:{},...j(e)?{app:!0}:{},...M(e)?{markdown:!0}:{},...i.holds?{holds:i.holds}:{}}:i.type==="number"&&i.duration?{control:"text",name:n,optional:o,holds:"duration"}:i.type==="date"?{control:"date",name:n,optional:o,...i.time?{time:!0}:{},...i.instant?{instant:!0}:{}}:i.type==="number"?{control:"number",name:n,optional:o,...i.min===void 0?{}:{min:i.min},...i.max===void 0?{}:{max:i.max},...i.step===void 0?{}:{step:i.step},...i.amount?{amount:i.amount}:{}}:i.type==="choice"?{control:"choice",name:n,optional:o,options:i.options}:{control:"opaque",name:n,optional:o}}function H(n){let r=n.shape;return r?Object.entries(r).map(([o,e])=>F(o,e)):[]}function W(n,r){let o={...r};for(let e of n){let t=r[e.name];t===void 0&&!e.optional&&(e.control==="list"||e.control==="boolean")&&(o[e.name]=e.control==="list"?[]:!1),e.control==="text"&&e.holds&&typeof t=="string"&&(o[e.name]=t.trim()===""?void 0:e.holds==="duration"?z(t)??t:t.trim()),e.control==="group"&&t!==void 0&&typeof t=="object"&&t!==null&&(o[e.name]=W(e.fields,t))}return o}function G(n,r){return Z(H(r.input),T(n,r))}var x="visitor";function gn(n,r,o,e){let t=K.keptFrom?.(n,r),c=new Set;if(!t)return c;let p=Object.keys(o.input.shape??{});for(let a of o.creates??[]){let l=t({id:"\0new",kind:a});for(let s of p)l?.(s)&&c.add(s)}let f=e===void 0?void 0:n.graph.getNode(e),i=f&&n.schema.tryDefinition(f.kind),d=f&&t(f);if(i&&d)for(let a of v(o,i))d(a)&&p.includes(a)&&c.add(a);return c}function _(n,r,o,e){let t=new Set,c=r?.sees??[];if(I(o)||!c.some(k))return t;let p=V(o),f=(l,s)=>{let u=c.filter(m=>m.kinds.includes(l)&&g(m,p));return u.some(k)?L.has(s)||u.some(m=>!k(m)||(m.fields===void 0||m.fields.includes(s))&&!m.hide?.includes(s)):!0},i=Object.keys(e.input.shape??{}),d=new Map,a=(l,s)=>d.set(l,d.get(l)===!0||s);for(let l of e.creates??[]){let s=Object.keys(n.tryDefinition(l)?.fields.shape??{});for(let u of i)s.includes(u)&&a(u,f(l,u))}for(let l of q(n,e)){let s=n.tryDefinition(l);if(s)for(let u of v(e,s))i.includes(u)&&a(u,f(l,u))}for(let[l,s]of d)s||t.add(l);return t}var $=(n,r)=>r.title??S(n);function Q(n,r,o){let e=n?.sees;return!e||e.length===0?!0:e.some(t=>t.kinds.includes(o)&&g(t,r)&&!t.own&&!t.via)}function b(n){switch(n.control){case"node":return[n];case"group":return n.fields.flatMap(b);case"variant":return n.options.flatMap(r=>r.fields.flatMap(b));case"list":return b(n.item);default:return[]}}function U(n,r,o,e){return e.has(o.name)?!1:b(o).every(t=>t.kinds.some(c=>c!=="*"&&Q(n,r,c)))}var X=n=>({kind:"human",id:"form:",roles:[n]});function vn(n,r,o=n.mutations??[]){let e=n.forms?.[r];if(!e)return;let t=o.find(a=>a.name===e.act);if(!t)return;let c=e.role??x,p=X(c),f=_(n.schema,n.policy,p,t),i=G(n.schema,t),d=e.fields?e.fields.flatMap(a=>i.find(l=>l.name===a)??[]):i.filter(a=>U(n.policy,p,a,f));return{name:r,title:$(r,e),...e.intro?{intro:e.intro}:{},...e.say?{say:e.say}:{},submit:e.submit??t.title??S(t.name),role:c,act:t,fields:d}}function An(n,r,o){let e=n.forms?.[r];if(!e)throw new Error(`There is no form called "${r}"${n.forms?`: the forms are ${Object.keys(n.forms).join(", ")}`:": the app declares none"}.`);return{kind:"visitor",id:o,name:`a visitor via the ${$(r,e)} form`,roles:[e.role??x]}}function xn(n){return{said:"Received \u2014 thank you.",...n.say?{next:n.say}:{}}}export{H as a,W as b,G as c,gn as d,_ as e,vn as f,An as g,xn as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as c}from"./chunk.
|
|
1
|
+
import{e as c}from"./chunk.WDEMPWS4.js";import{cc as m}from"./chunk.6W2DUW5S.js";function k(e){let n=e.policy?.sees??[];return n.length===0?!0:e.schema.kinds.every(r=>n.some(o=>o.roles==="*"&&!o.own&&!o.via&&o.kinds.includes(r)))}function A(e){let n=e;for(let r=0;r<8&&n?._zod?.def;r+=1){let o=n._zod.def;if(o.type==="enum")return Object.values(o.entries);if(o.type==="literal")return o.values;if(!("innerType"in o))return;n=o.innerType}}var h=(e,n)=>({ok:!1,reason:e,message:n});function b(e,n){return c(e).find(r=>(r.as??r.act)===n)??c(e).find(r=>r.act===n&&r.as===void 0)}var w=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&"href"in e;function S(e,n,r,o,f){let l=b(n,r);if(!l)return h("undeclared",`This view may not ask for \u201C${r}\u201D: its manifest does not name it.`);let u={},g=0;for(let[y,i]of Object.entries(o)){let d=a=>{if(!w(a))return a;let s=typeof a.href=="string"?f?.file(a.href):void 0;if(!s)throw h("malformed",`\u201C${y}\u201D is a file the host did not hand this view: a view hands an act a file the person dropped (event.files), or one a record it was shown holds, as it was handed.`);return f?.dropped(s.href)&&(g+=1),s};try{u[y]=Array.isArray(i)?i.map(d):d(i)}catch(a){return a}}if(!k(e)){let i=e.allMutations().find(s=>s.name===l.act)?.input?.shape??{},d=(s,t)=>w(t)&&typeof t.href=="string"&&f?.dropped(t.href)===!0||m(t)||typeof t=="string"&&f?.shown.has(t)===!0||(A(i[s])?.some(p=>p===t)??!1);if(!(g>0&&Object.entries(u).every(([s,t])=>Array.isArray(t)?t.every(p=>d(s,p)):d(s,t))))return h("press-only","In this app some members may not see some records, so a view's act applies only when you press it.")}return{ok:!0,name:l.act,args:{...u,...l.constants??{}}}}export{k as a,A as b,h as c,b as d,S as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk.WVUJXDXZ.js";import{j as x}from"./chunk.
|
|
1
|
+
import"./chunk.WVUJXDXZ.js";import{j as x}from"./chunk.VTCPA4V4.js";import"./chunk.FGJM4LJO.js";import"./chunk.K7WME4P4.js";import"./chunk.MDIAWTNK.js";import"./chunk.PEA4D66Y.js";import"./chunk.TRPPN2GD.js";import"./chunk.72Q4R7N6.js";import{$a as N,Za as f,da as S}from"./chunk.6W2DUW5S.js";import"./chunk.SLBWPVIY.js";import"./chunk.AJZBJBMO.js";var k=(n,r,t)=>({untrusted:!0,authoredBy:t.say(r),text:n});function O(n,r){let t;for(let[a,e]of Object.entries(n)){if(typeof e!="string"||a==="id"||a==="kind")continue;let o=r.fieldBy(n.id,a);o&&(t??={...n},t[a]=k(e,o,r))}return t??n}function L(n,r,t){let a=e=>{if(Array.isArray(e))return e.map(a);if(e!==null&&typeof e=="object"&&"id"in e&&"label"in e){let o=e,i=t.recordBy(o.id);return i?{...o,label:k(o.label,i,t)}:o}if(typeof e=="string"){let o=t.recordBy(n);return o?k(e,o,t):e}return e};return Object.fromEntries(Object.entries(r).map(([e,o])=>[e,a(o)]))}function $(n,r){return n.map(t=>{let a=r.recordBy(t.id);return a?{...t,label:k(t.label,a,r)}:t})}function D(n,r){return{...n,nodes:n.nodes.map(t=>O(t,r))}}var E=n=>(JSON.stringify(n)??"null").length,R=n=>typeof n=="number"&&Number.isFinite(n)&&n>0?Math.floor(n):0;function w(n,r,t,a,e,o=""){let i=n-r-t;return i>0?`and ${i} more ${e}: call ${a} with ${o}offset ${r+t} for the next page.`:void 0}var j=({line:n,...r})=>r;function T(n){let r;for(let[t,a]of Object.entries(n))typeof a!="string"||a.length<=600||(r??={...n},r[t]=`${a.slice(0,600)}\u2026 (cut at ${600} of ${a.length} characters)`);return r??n}function B(n,r,t,a){let e=Math.min(t,Math.max(0,n.length-r)),o=n.slice(r,r+e),i=a(o);for(;e>1&&E(i)>8e3;)e=Math.max(1,Math.floor(e*.75)),o=n.slice(r,r+e),i=a(o);return{page:o,answer:i}}function C(n,r){let t=JSON.stringify(r)??"null";if(t.length<=8e3)return r;let a=`This answer was ${t.length} characters, more than the ${8e3} one read answers, so it is cut. Ask ${n} for less, or use search_graph and get_node to read one thing.`;for(let e=8e3-a.length-40;;){let o={cut:a,partial:t.slice(0,e)},i=E(o)-8e3;if(i<=0)return o;e=Math.max(0,e-i-8)}}function I(n,r){let{matched:t,later:a,...e}=r,o=n.hits.filter(i=>i.about==="node").length;return n.total>o?{...e,more:`and ${n.total-o} more records match: narrow the words, or add kind:<kind>.`}:e}function P(n,r,t){let a=N(t.archived),e={nodes:n.graph.allNodes({archived:a}),edges:n.graph.allEdges({archived:"all"})},o=R(t.offset),i=e.nodes.length,{page:h,answer:u}=B(e.nodes,o,25,d=>{let g=new Set(d.map(s=>s.id)),l=new Set(d.map(s=>s.id)),c=w(i,o,d.length,"get_graph","nodes"),p=s=>l.has(s)||(a==="all"?n.graph.has(s):n.graph.has(s)&&f(n.graph.getNode(s))===a);return{...D({nodes:d.map(T),edges:e.edges.filter(s=>g.has(s.from)&&p(s.to))},r),total:i,...c?{more:c}:{}}});return{data:u,reads:h.map(d=>d.id)}}function U(n,r,t,a){let e=n.graph.getNode(t),o=R(a.offset),i=n.graph.outEdges(t),h=n.graph.inEdges(t),u=i.slice(o,o+20),d=h.slice(o,o+20),g=(s,A)=>{let m=n.graph.getNode(A);return{kind:s,id:A,label:m?S(n.schema.tryDefinition(m.kind),m):A,...f(m)?{archived:!0}:{}}},l=x(n.schema,n.graph,e),c=n.violations().filter(s=>s.nodeIds.includes(t)),p=[w(i.length,o,u.length,"get_node","links out",`id "${t}" and `),w(h.length,o,d.length,"get_node","links in",`id "${t}" and `),c.length>20?`and ${c.length-20} more problems: get_violations lists them.`:void 0].filter(Boolean);return{data:{node:O(T(e),r),...f(e)?{archived:!0}:{},...Object.keys(l.values).length>0?{computed:L(t,l.values,r)}:{},...Object.keys(l.refused).length>0?{uncomputed:l.refused}:{},out:$(u.map(s=>g(s.kind,s.to)),r),in:$(d.map(s=>g(s.kind,s.from)),r),violations:c.slice(0,20).map(j),...p.length>0?{more:p.join(" ")}:{}},reads:[t,...u.map(s=>s.to),...d.map(s=>s.from)]}}function F(n,r){let t=R(r.offset),{page:a,answer:e}=B(n,t,20,o=>{let i=w(n.length,t,o.length,"get_violations","problems");return{violations:o.map(j),total:n.length,...i?{more:i}:{}}});return{data:e,reads:[...new Set(a.flatMap(o=>o.nodeIds))]}}export{P as graphRead,U as nodeRead,I as searchRead,F as violationsRead,C as withinReadChars};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as k,b as A,c as L,d as _,e as E,r as B,s as V,t as H,u as N,v as q}from"./chunk.OJGHDWI6.js";import"./chunk.
|
|
1
|
+
import{a as k,b as A,c as L,d as _,e as E,r as B,s as V,t as H,u as N,v as q}from"./chunk.OJGHDWI6.js";import"./chunk.6W2DUW5S.js";import"./chunk.SLBWPVIY.js";import"./chunk.AJZBJBMO.js";var W=["drawElementImageToTexture","copyElementImageToTexture"],S=null,P=(r,e)=>r==="texture"?{texture:e}:{destination:{texture:e}};function Z(){return typeof globalThis>"u"?void 0:globalThis}function v(r,e){let t=[],n=Z(),o=!!(n?.navigator&&"gpu"in n.navigator);o||t.push("navigator.gpu is absent \u2014 WebGPU is unavailable.");let i=r??n?.GPUQueue?.prototype??void 0,a=null;if(i){for(let d of W)if(typeof i[d]=="function"){a=d;break}}a||t.push("No element-capture method on GPUQueue. Run Chromium 147+ with --enable-blink-features=CanvasDrawElement.");let c=e??n?.HTMLCanvasElement?.prototype??void 0,l=typeof c?.updateElementGeometry=="function";l||t.push("canvas.updateElementGeometry is absent \u2014 geometry cannot be reported.");let p=typeof c?.requestPaint=="function";p||t.push("canvas.requestPaint is absent \u2014 there is no capture-safe moment to hook.");let w=!1,h="unknown";if(typeof document<"u"){let d=document.createElement("canvas");w="layoutSubtree"in d||typeof d.captureElementImage=="function","layoutSubtree"in d?h="no":typeof d.captureElementImage=="function"&&(h="yes")}return{available:a!==null,captureMethod:a,geometrySync:l,hitTestFollowsGeometry:l?h:"no",layoutSubtree:w,paintEvents:p,webgpu:o,usable:o&&a!==null,notes:t}}var g=class extends Error{constructor(t){super(`HTML-in-Canvas is unavailable:
|
|
2
2
|
${t.notes.join(`
|
|
3
3
|
`)}`);this.capabilities=t;this.name="PlatformUnavailableError"}};function G(r,e,t){let n=r;for(let o of W){let i=n[o];if(typeof i=="function"){if(S){i.call(n,{source:e},P(S,t));return}try{i.call(n,{source:e},P("texture",t)),S="texture"}catch(a){if(!(a instanceof TypeError)||!/texture/i.test(a.message))throw a;i.call(n,{source:e},P("destination",t)),S="destination"}return}}throw new g(v(r))}function M(r,e=!0){e?r.setAttribute("drawable",""):r.removeAttribute("drawable")}function F(r){let e=r.changedElements;return e?new Set(Array.from(e)):null}function ee(r,e){let t=r;if(typeof t.captureElementImage!="function")throw new g(v(void 0,r));return t.captureElementImage(e)}function O(r,e,t){let n=r;if(typeof n.updateElementGeometry!="function")throw new g(v(void 0,r));n.updateElementGeometry(e,t)}function te(r,e){r.clearElementGeometry?.(e)}function m(r){r.requestPaint?.()}function D(r,e=!0){let t=r;e?t.setAttribute("content","drawable"):t.removeAttribute("content"),"layoutSubtree"in t?t.layoutSubtree=e:e?t.setAttribute("layoutsubtree",""):t.removeAttribute("layoutsubtree")}var I=`
|
|
4
4
|
struct Plane {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r,b as m,d as k,e as y}from"./chunk.UGFDSE37.js";import"./chunk.G6DISMVT.js";import"./chunk.W54NXXC5.js";import"./chunk.B3T4N2XM.js";import"./chunk.SDO3U72B.js";import"./chunk.6W2DUW5S.js";import"./chunk.SLBWPVIY.js";import"./chunk.AJZBJBMO.js";var i="way-back",b='[data-testid="notices-toasts"]';function g(t){let o=document.activeElement;o!==null&&o!==document.body&&!o.closest(b)||(t??document).querySelector('[data-graview-app-bar] [data-testid="app-home"]')?.focus({preventScroll:!0})}function w(t,o,a,d,h){if(t.past)return a?.dismiss(i),()=>{};let c=h?.closest("[data-graview-embed]"),s,f=e=>{if(e!==void 0&&r(t,o)?.batch!==e)return!1;try{let n=k(t,o);return n&&a?.notify({kind:"toast",id:i,sentence:`Took back \u201C${n.intent}\u201D`}),n!==void 0}catch(n){return a?.notify({kind:"toast",id:i,tone:"warn",sentence:n instanceof Error?n.message:String(n)}),!0}},u=()=>{let e=m(t,o,d);if(d=t.batches().length,e){let n=s=e.batch;a?.notify({kind:"toast",id:i,sentence:e.intent,timeout:1e4,action:{label:"Take back",keys:"Meta+Z Control+Z",onSelect:()=>(g(c),f(n))}})}else s&&r(t,o)?.batch!==s&&(s=void 0,a?.dismiss(i))},l=e=>{y(e)&&(!c||c.contains(e.target))&&f()&&e.preventDefault()};u();let p=t.subscribe(u);return document.addEventListener("keydown",l),(e=!1)=>{p(),document.removeEventListener("keydown",l),e&&s&&a?.dismiss(i)}}export{w as sceneWay};
|
|
@@ -0,0 +1,5 @@
|
|
|
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{o as T}from"./chunk.G6DISMVT.js";import{G as P,Ga as C,J as R,T as a,ba as L}from"./chunk.B3T4N2XM.js";import{a as A}from"./chunk.SDO3U72B.js";import{Gd as b,Oc as v}from"./chunk.6W2DUW5S.js";import{b as i}from"./chunk.AJZBJBMO.js";var B=i(a(),1),D=T.part(e=>(0,B.jsx)(e.ActivityRail,{calls:[]}),{quiet:!0});var x=i(a(),1),I=e=>e.tabIndex>=0&&!e.disabled&&e.getClientRects().length>0;function H(e){if(!e)return!1;if(I(e))return e.focus({preventScroll:!1}),!0;let r=[...e.querySelectorAll("a[href], button, input, select, textarea, [tabindex]")].find(I);return r?(r.focus(),!0):(e.hasAttribute("tabindex")||e.setAttribute("tabindex","-1"),e.focus(),!0)}var F=`.graview-skips{display:contents}
|
|
2
|
+
.graview-skip{position:absolute;width:0;height:0;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
|
|
3
|
+
.graview-skip:focus{width:auto;height:auto;overflow:visible;clip-path:none;padding:6px 12px;border-radius:8px;border:1px solid var(--graview-accent);background:var(--graview-float,var(--graview-panel));color:var(--graview-ink);font:inherit;font-size:.875rem;font-weight:600;box-shadow:var(--graview-lift-high);outline:2px solid var(--graview-accent);outline-offset:1px}
|
|
4
|
+
.graview-skips[data-place=bar] .graview-skip:focus{position:fixed;left:8px;top:6px;z-index:${v("toast")}}
|
|
5
|
+
.graview-skips[data-place=here] .graview-skip:focus{position:static;justify-self:start}`;function E({to:e,place:r="bar"}){return e.length===0?null:(0,x.jsxs)("span",{className:"graview-skips","data-place":r,children:[(0,x.jsx)("style",{children:F}),e.map(o=>(0,x.jsx)("button",{type:"button",className:"graview-skip","data-graview-skip":o.testid,"data-testid":`skip-${o.testid}`,...o.opens?{"data-graview-skip-opens":""}:{},onClick:o.go,children:o.label},o.testid))]})}var d=i(P(),1),h=i(a(),1),M=C(A(()=>(__graviewPreload(import.meta.url,["./chunk.KCM2VOC7.js","./chunk.G226CUJQ.js","./chunk.BG2SC77J.js","./chunk.NAEEPUWJ.js","./chunk.AQJD23AN.js","./chunk.XBNASVTY.js","./chunk.52Y37IAD.js","./chunk.Y4VOCJ7R.js","./chunk.6ESAZJBN.js","./chunk.OZYZBRWO.js","./chunk.TI4OSTQV.js","./chunk.GZHZLJBF.js","./chunk.TTFYXKLI.js","./chunk.OJGHDWI6.js","./chunk.ICYJ7QJG.js","./chunk.MT45H2T5.js","./chunk.S2ATSY6P.js","./chunk.72Q4R7N6.js","./chunk.G6DISMVT.js","./chunk.W54NXXC5.js","./chunk.B3T4N2XM.js","./chunk.SDO3U72B.js","./chunk.6W2DUW5S.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.2IKVO743.js")))),N=M.part((e,r)=>{let o=e.RecordInteractions;return(0,h.jsx)(o,{...r})},{quiet:!0});function j(e,r,o){let t=e.target;return(t.on==="record"||t.on==="field"?t.id===r:t.on==="selection"?t.ids.includes(r):t.on==="act"?t.id===r:!1)||e.offered.some(n=>n.id===`record:${r}`||n.id.startsWith(`fill:${r}:`))||(e.batches??[]).some(n=>o(n).includes(r))}function V({id:e,style:r,headingStyle:o,className:t}){let{ai:f,aiDesk:n,store:y}=L(),{entries:u}=R(n),l=f.off===!0;(0,d.useEffect)(()=>{l||n.load()},[n,l]);let S=y.log.length,m=(0,d.useMemo)(()=>{let k=g=>y.log.all().flatMap(w=>w.batch===g?w.writes:[]);return u.filter(g=>j(g,e,k))},[u,e,y,S]);return l||m.length===0?null:(0,h.jsx)(d.Suspense,{fallback:null,children:(0,h.jsx)(N,{entries:m,...r?{style:r}:{},...o?{headingStyle:o}:{},...t?{className:t}:{}})})}var c=i(P(),1);var p=i(a(),1),_={textDecorationLine:"underline",textDecorationColor:"color-mix(in srgb, currentColor 50%, transparent)",textDecorationThickness:1,textUnderlineOffset:"0.2em"};function O({children:e,mark:r="\u2192"}){return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("span",{style:_,children:e}),(0,p.jsx)("span",{"aria-hidden":"true",children:r})]})}var s=i(a(),1);function Ro({context:e,stop:r,title:o,label:t,style:f,className:n,children:y,...u}){let l=b(e.views?.arrangement?.()),S=y??(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)(O,{mark:"\u2197",children:["In ",l==="Scene"?"the scene":l.replace(/^The /,"the ")]})}),m=t?{"aria-label":t}:{};if(e.overview){let k=e.overview;return(0,s.jsx)("a",{href:r,...u,...m,...o?{title:o}:{},style:f,...n?{className:n}:{},onClick:g=>{g.preventDefault(),k(r)},children:S})}return e.embedded?null:(0,s.jsx)("a",{href:`${e.sceneHref??"/"}${r}`,...u,...m,...o?{title:o}:{},style:f,...n?{className:n}:{},children:S})}function Lo(){return(0,s.jsx)("a",{href:"#fresh","data-testid":"start-fresh",title:"Forget every edit made in this browser and return to the example",onClick:e=>{e.preventDefault();let r=new URL(window.location.href);r.searchParams.set("fresh","1"),window.location.assign(r.toString())},style:{color:"inherit",display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24},children:"Start fresh"})}function Co(e){let r=(0,c.useRef)(0),o=(0,c.useCallback)(t=>e.subscribe(()=>{r.current+=1,t()}),[e]);return(0,c.useSyncExternalStore)(o,()=>r.current,()=>0)}function Bo(e){return e===void 0?{}:e==="sm"||e==="md"?{"data-size":e}:{style:{"--graview-control-height":typeof e=="number"?`${e}px`:e}}}var Io=(e,r)=>r?`${e} ${r}`:e;export{D as a,H as b,E as c,V as d,O as e,Ro as f,Lo as g,Co as h,Bo as i,Io as j};
|