graview 0.1.52 → 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.C4EPMV7O.js → chunk.2LQ37DC2.js} +1 -1
- package/dist/preview/{chunk.IVI3HRSF.js → chunk.3377DLPA.js} +1 -1
- package/dist/preview/chunk.34Q7OKK3.js +1 -0
- package/dist/preview/{chunk.3FKP32RG.js → chunk.36XV4ZMC.js} +2 -2
- package/dist/preview/{chunk.LESRQN3Y.js → chunk.3FRVG6JW.js} +1 -1
- package/dist/preview/{chunk.XLM4ONUB.js → chunk.3FUFVVR4.js} +1 -1
- package/dist/preview/chunk.3Y7BDRP3.js +1 -0
- package/dist/preview/{chunk.7FZY5E2U.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.C4UNAJWC.js → chunk.5XFRWXYQ.js} +1 -1
- package/dist/preview/{chunk.ULAMIQ52.js → chunk.65F3DF5Q.js} +1 -1
- package/dist/preview/{chunk.QWQBPJ4U.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.VOHRQXCF.js → chunk.6W2DUW5S.js} +2 -2
- package/dist/preview/{chunk.7EA7THSM.js → chunk.72Q4R7N6.js} +1 -1
- package/dist/preview/chunk.7BXOQEUP.js +1 -0
- package/dist/preview/{chunk.7UJZP3YK.js → chunk.7NFCI4LH.js} +2 -2
- package/dist/preview/{chunk.4LI73QOY.js → chunk.7R6GXJS4.js} +1 -1
- package/dist/preview/chunk.A2RQFAZ6.js +1 -0
- package/dist/preview/{chunk.J2R55TM7.js → chunk.AQJD23AN.js} +1 -1
- package/dist/preview/{chunk.7XJ3XQZD.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.NAPTE3S6.js → chunk.BB5XKTVC.js} +1 -1
- package/dist/preview/{chunk.Y37DXEHG.js → chunk.BG2SC77J.js} +1 -1
- package/dist/preview/{chunk.7UXDIEPK.js → chunk.BPPDBPTL.js} +1 -1
- package/dist/preview/chunk.BQHRZJ5Z.js +1 -0
- package/dist/preview/{chunk.BJL6EL6B.js → chunk.CANTHIRO.js} +1 -1
- package/dist/preview/chunk.CIUQWCU4.js +1 -0
- package/dist/preview/{chunk.SZCZD2GM.js → chunk.CSA6SWTI.js} +1 -1
- package/dist/preview/{chunk.52J42KR5.js → chunk.CWPRQSED.js} +1 -1
- package/dist/preview/{chunk.5DDHFNZM.js → chunk.CYP5KXIQ.js} +1 -1
- package/dist/preview/chunk.D3A24PQ6.js +1 -0
- package/dist/preview/{chunk.CBGKWYGI.js → chunk.DQPEVPKQ.js} +1 -1
- package/dist/preview/{chunk.R7ZZJOJW.js → chunk.DUZS52WX.js} +1 -1
- package/dist/preview/chunk.E52UTLQ2.js +1 -0
- package/dist/preview/{chunk.QPP3OJVR.js → chunk.E647LWH5.js} +1 -1
- package/dist/preview/chunk.EG2N5F6L.js +1 -0
- package/dist/preview/{chunk.T2Q3AAQI.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.J263VQF5.js → chunk.FCAKLO5U.js} +1 -1
- package/dist/preview/{chunk.3TME4BG3.js → chunk.FGJM4LJO.js} +1 -1
- package/dist/preview/{chunk.OS3WZV6C.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.LTJYKQJG.js → chunk.GANAZIRD.js} +1 -1
- package/dist/preview/{chunk.KFTZLNHY.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.7KZ44FEU.js → chunk.GYO57LKD.js} +1 -1
- package/dist/preview/{chunk.NHIPVAGR.js → chunk.GZBODS7Z.js} +1 -1
- package/dist/preview/chunk.GZWC72HS.js +1 -0
- package/dist/preview/{chunk.FJEXINFF.js → chunk.H2B3SEI7.js} +1 -1
- package/dist/preview/{chunk.R6FHEEJ7.js → chunk.H6EMDQP5.js} +1 -1
- package/dist/preview/chunk.HAIHXBVX.js +1 -0
- package/dist/preview/{chunk.BHPZK4WJ.js → chunk.HBVURYWY.js} +2 -2
- package/dist/preview/{chunk.VKOCD5CL.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.C7EEYSAM.js → chunk.IYVBJDR7.js} +1 -1
- package/dist/preview/{chunk.RWCWRJJC.js → chunk.J6OT74RM.js} +1 -1
- package/dist/preview/{chunk.GZHEGKPF.js → chunk.JCJ7NTW4.js} +1 -1
- package/dist/preview/{chunk.P5PXWOHI.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.I43ONAEL.js → chunk.K7WME4P4.js} +1 -1
- package/dist/preview/{chunk.FLNYLE6S.js → chunk.KAKJYAHM.js} +1 -1
- package/dist/preview/chunk.KCM2VOC7.js +1 -0
- package/dist/preview/{chunk.LSL25VXW.js → chunk.KWMBRB6O.js} +1 -1
- package/dist/preview/{chunk.KVEDMKUN.js → chunk.KY7QD22S.js} +1 -1
- package/dist/preview/{chunk.RBWYXVUW.js → chunk.LAOZEYYQ.js} +1 -1
- package/dist/preview/{chunk.JQBP6QWQ.js → chunk.LCG3VLCB.js} +1 -1
- package/dist/preview/{chunk.7FMS57QO.js → chunk.LDLWYAHK.js} +1 -1
- package/dist/preview/chunk.LEKML4S4.js +1 -0
- package/dist/preview/{chunk.73EKJ4JN.js → chunk.MDIAWTNK.js} +1 -1
- package/dist/preview/chunk.MKWVNW4Q.js +35 -0
- package/dist/preview/{chunk.VGTEEANA.js → chunk.MSPRCR3Q.js} +1 -1
- package/dist/preview/{chunk.CV4QA4ZF.js → chunk.MT45H2T5.js} +1 -1
- package/dist/preview/chunk.MXTDQXVW.js +1 -0
- package/dist/preview/{chunk.M33LUF3Q.js → chunk.N6A3DIOY.js} +1 -1
- package/dist/preview/{chunk.DXZ5VYCQ.js → chunk.NAEEPUWJ.js} +1 -1
- package/dist/preview/{chunk.HSGUXMAO.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.J6IB2HUZ.js → chunk.OPKXCL5R.js} +1 -1
- package/dist/preview/chunk.OXLYDXQV.js +1 -0
- package/dist/preview/{chunk.DGWNVDZB.js → chunk.OZYZBRWO.js} +1 -1
- package/dist/preview/{chunk.CHMUL36A.js → chunk.P2W727C7.js} +1 -1
- package/dist/preview/{chunk.I2W7HSBU.js → chunk.P7FN3SFB.js} +1 -1
- package/dist/preview/{chunk.INL4OZI7.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.KPUX27ZT.js → chunk.R3DWF35R.js} +1 -1
- package/dist/preview/{chunk.XZLKTOJE.js → chunk.RIS3OKAI.js} +1 -1
- package/dist/preview/{chunk.R77TACXU.js → chunk.RUTZEEBR.js} +1 -1
- package/dist/preview/{chunk.OYRZ2DEI.js → chunk.S2ATSY6P.js} +1 -1
- package/dist/preview/{chunk.NB6WN4DO.js → chunk.S6TN3MLY.js} +1 -1
- package/dist/preview/{chunk.FJC6PMOG.js → chunk.T56SOSIR.js} +4 -4
- package/dist/preview/chunk.THL67D77.js +1 -0
- package/dist/preview/{chunk.GL3YVGAP.js → chunk.TLQTDKOL.js} +2 -2
- package/dist/preview/{chunk.5WU2UTP7.js → chunk.TRPPN2GD.js} +1 -1
- package/dist/preview/{chunk.YKACMLLU.js → chunk.TTFYXKLI.js} +1 -1
- package/dist/preview/{chunk.FEBCIEI3.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.ZK42LPF5.js → chunk.UVMLX4US.js} +1 -1
- package/dist/preview/{chunk.G7XKQNOL.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.2K3YQJW3.js → chunk.VOHDRH3P.js} +1 -1
- package/dist/preview/{chunk.R7CRV2FE.js → chunk.VRJ4TULC.js} +1 -1
- package/dist/preview/{chunk.QRCTTDDQ.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.NVNQSZ43.js → chunk.WDEMPWS4.js} +1 -1
- package/dist/preview/chunk.XBNASVTY.js +1 -0
- package/dist/preview/{chunk.EIWTZC4A.js → chunk.XDEKL6TJ.js} +1 -1
- package/dist/preview/chunk.XE72DFBV.js +13 -0
- package/dist/preview/{chunk.N7D5LKBI.js → chunk.XFIZLWYA.js} +1 -1
- package/dist/preview/{chunk.U6PCKJ26.js → chunk.XXCT6DLX.js} +1 -1
- package/dist/preview/{chunk.7354O67H.js → chunk.Y4VOCJ7R.js} +1 -1
- package/dist/preview/chunk.YA7ZMGOL.js +1 -0
- package/dist/preview/{chunk.D62V3TBW.js → chunk.YI7WHBAD.js} +2 -2
- package/dist/preview/{chunk.6CY3EA6U.js → chunk.Z4YSCHZT.js} +1 -1
- package/dist/preview/{chunk.MBNZ2HK7.js → chunk.ZQWKS6K5.js} +1 -1
- package/dist/preview/{chunk.7IOC6U3C.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.2EB7COX5.js +0 -1
- package/dist/preview/chunk.2X3UZJWI.js +0 -1
- package/dist/preview/chunk.337JMOTL.js +0 -1
- package/dist/preview/chunk.3ZQAPPJ5.js +0 -18
- package/dist/preview/chunk.4VI3EYDL.js +0 -1
- package/dist/preview/chunk.4ZLCMATU.js +0 -2
- package/dist/preview/chunk.5LWPNOJA.js +0 -1
- package/dist/preview/chunk.63SRVTG2.js +0 -19
- package/dist/preview/chunk.6BA6RUK7.js +0 -1
- package/dist/preview/chunk.6JERQFZI.js +0 -1
- package/dist/preview/chunk.6NIE3ILA.js +0 -1
- package/dist/preview/chunk.6QNBUBGD.js +0 -1
- package/dist/preview/chunk.7OAXW7QF.js +0 -1
- package/dist/preview/chunk.7SNIX56B.js +0 -1
- package/dist/preview/chunk.AI2HBKVP.js +0 -359
- package/dist/preview/chunk.BDQ4FUKO.js +0 -1
- package/dist/preview/chunk.BRDAO2OF.js +0 -4
- package/dist/preview/chunk.CC7E6NUQ.js +0 -1
- package/dist/preview/chunk.D2T563AA.js +0 -1
- package/dist/preview/chunk.DC7M56NM.js +0 -9
- package/dist/preview/chunk.DIS7JS7X.js +0 -1
- package/dist/preview/chunk.DVLWSCIC.js +0 -35
- package/dist/preview/chunk.EHOEMVQP.js +0 -1
- package/dist/preview/chunk.EME5HQ3H.js +0 -1
- package/dist/preview/chunk.G446PWV6.js +0 -1
- package/dist/preview/chunk.HST7BYFW.js +0 -1
- package/dist/preview/chunk.JOWJNIWH.js +0 -4
- package/dist/preview/chunk.JV7FLVUV.js +0 -1
- package/dist/preview/chunk.KQSD5MLY.js +0 -1
- package/dist/preview/chunk.KSJ3J5UN.js +0 -1
- package/dist/preview/chunk.LXJW2Z2M.js +0 -1
- package/dist/preview/chunk.MCFLCC42.js +0 -12
- package/dist/preview/chunk.MYKRJ4SV.js +0 -1
- package/dist/preview/chunk.NICCIJV4.js +0 -1
- package/dist/preview/chunk.NQPNK6I5.js +0 -1
- package/dist/preview/chunk.NWK4E7TJ.js +0 -1
- package/dist/preview/chunk.NZB5S5UO.js +0 -1
- package/dist/preview/chunk.PRCWGE7A.js +0 -1
- package/dist/preview/chunk.PXHBPLTQ.js +0 -1
- package/dist/preview/chunk.PXVJBL2C.js +0 -1
- package/dist/preview/chunk.Q3XKNZQW.js +0 -1
- package/dist/preview/chunk.Q5IAXTF5.js +0 -25
- package/dist/preview/chunk.QXCYAFRT.js +0 -1
- package/dist/preview/chunk.RMRO5JZX.js +0 -1
- package/dist/preview/chunk.S4ZWBCYC.js +0 -1
- package/dist/preview/chunk.SELLAVIQ.js +0 -1
- package/dist/preview/chunk.SM6HTPYF.js +0 -1
- package/dist/preview/chunk.T6KKNWZT.js +0 -1
- package/dist/preview/chunk.UEPVA6IS.js +0 -1
- package/dist/preview/chunk.UMS7XRPO.js +0 -1
- package/dist/preview/chunk.VGIWQNJB.js +0 -1
- package/dist/preview/chunk.W5UJLKIT.js +0 -1
- package/dist/preview/chunk.WUEU3QBL.js +0 -1
- package/dist/preview/chunk.WWUMSCYC.js +0 -1
- package/dist/preview/chunk.XPR3QFF4.js +0 -1
- package/dist/preview/chunk.YKXUDACI.js +0 -28
- package/dist/preview/chunk.YUEOUV7G.js +0 -5
- package/dist/preview/chunk.YYWLYVAW.js +0 -1
- package/dist/preview/chunk.Z2JMTRF4.js +0 -1
- package/dist/preview/chunk.Z2UFPOAN.js +0 -88
- package/dist/preview/chunk.ZEKKIMKI.js +0 -1
- package/dist/preview/chunk.ZZGXVYW2.js +0 -1
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as Ie}from"./chunk.D62V3TBW.js";import{A as Qt,B as Ae,C as ro,D as Xe,E as me,F as Gn,G as We,H as Ue,I as oo,J as Kn,K as Ce,L as io,M as so,N as $,O as pt,P as ht,Q as lo,R as wt,S as Xt,T as co,U as oe,V as Jt,W as le,X as Bn,a as j,b as Se,c as Y,d as zt,e as In,f as Fn,g as ct,h as ne,i as he,j as se,k as C,l as re,m as V,n as qe,o as we,p as Yt,q as ve,r as ue,s as to,t as yt,u as no,v as Dn,w as Wn,x as Q,y as Fe,z as ao}from"./chunk.FJC6PMOG.js";import{a as Ze,b as Zt,d as ee}from"./chunk.XPR3QFF4.js";import{b as Hn,c as Jr,d as eo}from"./chunk.YUEOUV7G.js";import{a as Qr,d as Zr,e as Xr}from"./chunk.UGFDSE37.js";import{a as Ur,c as Vr,f as jr,g as _r,i as zr,j as Yr}from"./chunk.W5UJLKIT.js";import{a as jt,b as _t}from"./chunk.PXQVXBNG.js";import{a as $r,b as Hr,c as Ir,d as $n}from"./chunk.7UJZP3YK.js";import{b as Or}from"./chunk.R77TACXU.js";import{a as Fr,b as Dr,d as Ut,e as Wr,f as Gr,g as Kr,j as Vt}from"./chunk.6JERQFZI.js";import{m as Nr}from"./chunk.63SRVTG2.js";import{a as wr,b as Sr,c as vr,e as Tr,f as On,h as Kt}from"./chunk.G7XKQNOL.js";import{d as xr,e as Pr,f as Ar,g as Cr,n as Wt,o as Rr,q as Lr,s as Gt}from"./chunk.7KZ44FEU.js";import{a as Ht,b as Qa,c as Za,d as It,e as Xa}from"./chunk.LSL25VXW.js";import{b as rr,c as fr,e as yr,f as En}from"./chunk.WWUMSCYC.js";import{a as Tn,b as mr}from"./chunk.J2R55TM7.js";import{a as Bt,b as qt,c as Er,e as Mr}from"./chunk.D2T563AA.js";import{a as dt,b as ur,e as gr}from"./chunk.JV7FLVUV.js";import{a as Mn}from"./chunk.7FZY5E2U.js";import{a as Rn,b as nr,c as ar}from"./chunk.7354O67H.js";import{a as hr}from"./chunk.C7EEYSAM.js";import{c as ir,d as sr,e as lr,f as dr,k as Qe,l as cr}from"./chunk.QRCTTDDQ.js";import{a as or}from"./chunk.3TME4BG3.js";import{r as Ln,s as pr}from"./chunk.YKACMLLU.js";import{b as Ja,c as er,d as Ft,e as tr,l as Dt}from"./chunk.OYRZ2DEI.js";import{C as Nn,K as Br,N as qr,e as za,f as Ya,j as ti,u as br,v as kr}from"./chunk.AI2HBKVP.js";import{Aa as $t,G as Me,L as Fa,N as Da,Pa as _a,R as Wa,T as U,U as Cn,X as Ga,Y as Ka,aa as Ba,ba as ie,ea as qa,fa as Ua,ha as Va,la as lt,na as ja,pa as Ot,r as Ia,v as He}from"./chunk.Q5IAXTF5.js";import{a as Ha}from"./chunk.SDO3U72B.js";import{$a as Ca,Ed as An,Fd as Oa,J as va,Kd as $a,Nc as Ma,U as ft,Za as Aa,ca as st,da as pe,fa as ze,ga as Tt,hc as La,ia as Be,ka as ba,la as ka,lb as xn,ma as Ye,mb as Ra,md as Pn,oc as Ta,qc as Ea,sd as Mt,td as Na,vd as Nt,wb as Et,xa,ya as Pa}from"./chunk.VOHRQXCF.js";import{b as I}from"./chunk.AJZBJBMO.js";function po(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,m=e.graph.getNode(c);if(!m)continue;let g=(s==="out"?r:e.schema.tryDefinition(m.kind))?.edges?.[i.kind],p=s==="in"?g?.inverse??g?.description:g?.description,P=`${i.kind}|${s}|${p??""}`;(l.get(P)??(()=>{let W={edgeKind:i.kind,direction:s,...p?{description:p}:{},targets:[]};return l.set(P,W),W})()).targets.push({id:m.id,kind:m.kind,label:o(m)})}return{id:t,kind:a.kind,label:o(a),fields:Ft(Qe(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=Ja(i.targets.flatMap(c=>{let m=e.graph.getNode(c.id);return m?[m]:[]}),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,m)=>c.label.localeCompare(m.label))}})}}function Je(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 uo(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 et(e){let t=e.schema.kinds.map(r=>({kind:r,plural:Be(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(m=>m.startsWith(`${l}|${r}|`)).map(m=>m.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 Ge=I(Me(),1);var St=I(Me(),1);var Re=I(U(),1),ai={problems:"Problems",search:"Search",map:"Connections",places:"Pictures","~draft":"A view drawn"},ri=e=>{try{return decodeURIComponent(e)}catch{return e}};function oi(e,t,n={}){let{store:a}=e,r=a.schema,o=(n.base??"").replace(/\/$/,""),[l="/",i=""]=t.split("#")[0].split("?"),s=(k,E,v)=>({label:k,href:`${o}${E}`,path:E,...v?{current:v}:{}}),c=k=>{let E=n.registry?.sectionOf(k);return E?[E.path===void 0?{label:E.label}:s(E.label,E.path)]:[]},m=k=>n.registry?.sectionOf(k)?.label,x=k=>{let E=m(k);return E===void 0?{}:{section:E}},[g,p,...P]=l.split("/").filter(Boolean).map(ri);if(g===void 0)return{as:"home",label:"Home",trail:[s("Home","/",!0)]};if(g==="places"&&p!==void 0&&P.length===0){let k=new URLSearchParams(i).get("of"),E=new Set(Fe(a,e.principal)),v=e.views?.places()??[],A=v.find(G=>E.has(G.kind)&&G.as===p&&(!k||j(r,G.kind)===k));if(A){let G=zt(A.as,Mt(A,v)?j(r,A.kind):void 0);return{as:"place",kind:A.kind,label:A.title,...x(A.kind),trail:[...c(A.kind),s(A.title,G,!0)]}}}let N=P.length===0?Se(r,g):void 0;if(N!==void 0){let k=s(Be(r,N),`/${j(r,N)}`);if(p===void 0)return{as:"list",kind:N,label:k.label,...x(N),trail:[...c(N),{...k,current:!0}]};let E=a.graph.getNode(p),v=E&&E.kind===N?pe(r.tryDefinition(N),E):"Nothing lives here";return{as:"record",kind:N,id:p,label:v,...x(N),trail:[...c(N),k,s(v,Y(r,N,p),!0)]}}let W=ai[g]??ii((P.at(-1)??p??g).replace(/[-_]+/g," "));return{as:"page",label:W,trail:[s(W,l,!0)]}}var ii=e=>e.charAt(0).toUpperCase()+e.slice(1),qn=(0,St.createContext)(null);function si(e){let t=me(),n=Xe("/");return ee(e.context.store),oi(e.context,`${t.pathname}${t.search}`,{registry:e.registry,base:n})}var li={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},go={display:"flex",alignItems:"center",gap:6,minWidth:0},mo={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,lineHeight:"24px"};function ut({context:e,style:t}){let n=(0,St.useContext)(qn),a=(0,St.useContext)(ht);return wt(a??ci,"trail")||n?.registry?.without().has("trail")?null:(0,Re.jsx)(di,{root:n??{context:e,registry:void 0},context:e,...t?{style:t}:{}})}function di({root:e,context:t,style:n}){let a=si(e);return a.trail.length<2?null:(0,Re.jsx)(pi,{here:a,mark:a.as==="record"?{kind:a.kind,context:t}:void 0,...n?{style:n}:{},"data-testid":"page-trail"})}var ci={count:()=>0,place:()=>()=>{},subscribe:()=>()=>{}};function pi({here:e,mark:t,style:n,...a}){let r=e.as==="record"?e.trail.length-2:-1;return(0,Re.jsx)("nav",{"aria-label":"You are here","data-graview-trail":"",style:{minWidth:0,...n},...a,children:(0,Re.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,Re.jsxs)("li",{style:o.current?li:{...go,flexShrink:l===e.trail.length-2?0:1,maxWidth:"100%"},...o.current?{"aria-current":"page"}:{},children:[l>0&&!o.current?(0,Re.jsx)("span",{"aria-hidden":"true",children:"\u203A"}):null,o.current?o.label:o.path!==void 0?(0,Re.jsxs)($,{to:o.path,style:{...we,...go},...l===r?{"data-testid":"trail-list"}:{},children:[l===r&&t?(0,Re.jsx)(ue,{kind:t.kind,brand:t.context.brand,schema:t.context.store.schema,size:8}):null,(0,Re.jsx)("span",{style:mo,children:o.label})]}):(0,Re.jsx)("span",{style:mo,children:o.label})]},`${l}:${o.label}`))})})}var R=I(U(),1);function Ne(e){let t=e.views;if(!t)return[];let n=new Set(Fe(e.store,e.principal));return t.places().filter(a=>n.has(a.kind))}function en(e,t){if(!t.over)return[t.kind];let n=new Set(Fe(e.store,e.principal));return t.over.filter(a=>a===t.kind||n.has(a))}var tt=e=>`place:${e.kind}:${e.as}`;function fe(e,t){return zt(t.as,Mt(t,e.views?.places()??[])?j(e.store.schema,t.kind):void 0)}function vt(e,t){let n=e.schema.tryDefinition(t);return e.graph.nodesOfKind(t).filter(a=>st(n,a))}function Un(e,t,n){let a=(o,l)=>Tt(e.schema,l,o),r=(typeof t=="string"?[t]:t).map(o=>a(vt(e,o).length,o)).join(" and ");return n?`${r} across ${a(vt(e,n).length,n)}`:r}function Vn({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(g=>g.nodeIds))],m=en(e,t).flatMap(g=>vt(r,g));if(!s)return null;let x=ui(r,m,a,c);return(0,R.jsx)(Ln,{kind:t.kind,view:t.title,children:(0,R.jsx)(s,{nodes:x,label:t.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1,...n&&n.length>0?{implicated:n}:{},...c.length>0?{flagged:c}:{}})})}function ui(e,t,n,a){let r=n?Nt({filter:n}).filter??[]:[];return r.length===0?t:Kt(t,{filter:r},{schema:e.schema,graph:e.graph,flagged:new Set(a)}).nodes}function gi({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,R.jsx)(Vn,{context:r,place:o}):null}function mi({context:e,kind:t}){let{store:n,views:a,invariantContext:r}=e,o=vt(n,t),l=n.schema.tryDefinition(t),i=Q(n,t),c=a?.resolve(t,{cardinality:"many",fidelity:"full"})?.view,m=[...new Set(n.violations(r).flatMap(P=>P.nodeIds))];if(c&&!lt(c))return(0,R.jsx)(Ln,{kind:t,children:(0,R.jsx)(c,{nodes:o,label:i,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1,...m.length>0?{flagged:m}:{}})});let x=a?.resolve(t,{cardinality:"one",fidelity:"summary"})?.view,g=8,p=o.slice(0,g);return(0,R.jsxs)("div",{"data-testid":"kind-sheet",style:x?{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(P=>x?(0,R.jsx)(x,{node:P,fidelity:"summary",cardinality:"one",mode:"fullscreen",selected:!1,...m.includes(P.id)?{flagged:[P.id]}:{}},P.id):(0,R.jsx)("span",{style:{padding:"8px 14px",borderRadius:8,border:"1px solid var(--graview-edge-bright)",background:"var(--graview-ground)",color:"var(--graview-ink)"},children:pe(l,P)},P.id)),o.length>g?(0,R.jsxs)("span",{style:{...C,alignSelf:"center",padding:"0 6px"},children:["+",o.length-g," more ",i.toLowerCase()]}):null]})}function jn(e){let{store:t}=e,n=ao(e),a=Ne(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:tt(s),kind:s.kind,title:Na(s,a,t.schema),to:fe(e,s),place:s})),...Qt(e).filter(s=>!i.has(s)).map(s=>({key:`kind:${s}`,kind:s,title:Q(t,s),to:`/${j(t.schema,s)}`}))]}var fo=.72,fi=540,yo=16/10;function yi(e){let t=(0,Ge.useRef)(null),[n,a]=(0,Ge.useState)(e);return(0,Ge.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 hi(e){for(let t=e.parentElement;t;t=t.parentElement)if(/(auto|scroll)/.test(getComputedStyle(t).overflowY))return t;return null}function wi(e){let[t,n]=(0,Ge.useState)(()=>typeof IntersectionObserver>"u");return(0,Ge.useLayoutEffect)(()=>{let a=e.current;if(t||!a)return;let r=new IntersectionObserver(o=>{o.some(l=>l.isIntersecting)&&(r.disconnect(),n(!0))},{root:hi(a),rootMargin:"50% 0px"});return r.observe(a),()=>r.disconnect()},[t,e]),t}function _n({context:e,entry:t}){let{store:n,brand:a,principal:r}=e,{ref:o,width:l}=yi(fi),i=wi(o),s=l/fo,c=vt(n,t.kind),m=n.schema.tryDefinition(t.kind),x=c.length===0?Je(n,t.kind,{...r?{principal:r}:{},...e.invariantContext?{context:e.invariantContext}:{}}).actions.affordances[0]:void 0,g=t.place!==void 0;return(0,R.jsxs)($,{to:t.to,"data-testid":g?"place-card":"kind-card",className:"graview-gallery-card",style:{...we,display:"grid",gap:10,alignContent:"start",minWidth:0},children:[(0,R.jsxs)("span",{ref:o,"data-testid":g?"place-picture":"kind-picture","aria-hidden":"true",inert:!0,style:{display:"block",position:"relative",width:"100%",aspectRatio:`${yo}`,overflow:"hidden",borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",pointerEvents:"none"},children:[(0,R.jsx)("span",{style:{position:"absolute",left:0,top:0,width:s,height:s/yo,display:"grid",gridTemplateRows:"minmax(0, 1fr)",transform:`scale(${fo})`,transformOrigin:"0 0"},children:i?(0,R.jsx)(Ut.Provider,{value:null,children:t.place?(0,R.jsx)(Vn,{context:e,place:t.place}):(0,R.jsx)(mi,{context:e,kind:t.kind})}):null}),c.length===0?(0,R.jsx)("span",{"data-testid":"picture-empty",style:{position:"absolute",inset:0,display:"grid",placeContent:"center",justifyItems:"center",gap:2,padding:20,textAlign:"center"},children:(0,R.jsxs)("span",{style:{display:"grid",gap:2,padding:"10px 16px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-ground)",color:"var(--graview-ink)"},children:[(0,R.jsxs)("span",{style:{fontFamily:Fn,fontWeight:"var(--graview-weight-display)"},children:["No ",Q(n,t.kind).toLowerCase()," yet"]}),x?(0,R.jsxs)("span",{style:C,children:["Begin with \u201C",x.label,"\u201D"]}):null]})}):null]}),(0,R.jsxs)("span",{style:{display:"grid",gap:2,minWidth:0},children:[(0,R.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0},children:[g?null:(0,R.jsx)(ue,{kind:t.kind,brand:a,schema:n.schema,size:8}),(0,R.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,R.jsxs)("span",{style:C,children:[t.place?Un(n,en(e,t.place),t.place.across):Un(n,t.kind),!g&&m?.description?` \xB7 ${m.description}`:null]})]})]})}var ho={display:"grid",gap:"32px 28px",gridTemplateColumns:"repeat(auto-fill, minmax(min(420px, 100%), 1fr))"},Si=`
|
|
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 zn({context:e}){ee(e.store);let t=jn(e);return t.length===0?null:(0,R.jsxs)("section",{style:ho,"data-testid":"gallery",children:[(0,R.jsx)("style",{children:Si}),t.map(n=>(0,R.jsx)(_n,{context:e,entry:n},n.key))]})}function Yn({context:e}){let{store:t}=e;ee(t);let n=Pn(Ne(e)).filter(r=>!r.hidden),a=jn(e);return(0,R.jsxs)(oe,{context:e,style:ct,children:[(0,R.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,R.jsx)("p",{style:he,children:n.length===0?"None of its own yet":`${n.length} ${n.length===1?"picture":"pictures"}`}),(0,R.jsx)(le,{context:e,children:"Pictures"}),(0,R.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,R.jsx)("div",{style:ho,"data-testid":"places",children:a.map(r=>(0,R.jsx)(_n,{context:e,entry:r},r.key))}):null]})}var vi={lede:!0},bi={lede:!1},ki={...se,textWrap:"pretty"};function xi(e,t){if(t===void 0)return;let[n]=dr(lr([t]),cr(e.store,null,null,e.brand?{money:e.brand}:{}));return n?.t==="headline"&&!n.problem&&n.text.trim()!==""?n.text:void 0}function Qn({context:e}){let{store:t,principal:n}=e;ee(t);let a=Ue(),r=We(),[o]=pt(),l=decodeURIComponent(a.as??""),[i,s]=(0,Ge.useState)(null),c=o.get("of"),m=o.get("filter"),g=Ne(e).find(A=>A.as===l&&(!c||j(t.schema,A.kind)===c));if(!g)return(0,R.jsxs)(oe,{context:e,children:[(0,R.jsx)(le,{context:e,children:"No picture is called that."}),(0,R.jsx)("p",{style:se,children:(0,R.jsx)($,{to:"/places",style:qe,children:(0,R.jsx)(Ze,{children:"The pictures there are"})})})]});let p=Q(t,g.kind),P=e.views?.resolve(g.kind,{cardinality:"many",fidelity:"full"},g.as)?.view,N=P?.flows===!0,W=P?.creates!==!1,k=xi(e,P?.lede),E=Je(t,g.kind,{...n?{principal:n}:{},...e.invariantContext?{context:e.invariantContext}:{}}),v=W?E.actions.affordances.map(A=>({affordance:A,mutation:t.allMutations().find(G=>G.name===A.mutation)})).filter(A=>A.mutation!==void 0):[];return(0,R.jsxs)(oe,{context:e,style:{...ct,gap:"var(--graview-space-6, 32px)"},children:[(0,R.jsxs)("header",{style:{display:"grid",gap:"var(--graview-space-2, 8px)"},children:[(0,R.jsx)(ut,{context:e}),(0,R.jsx)(le,{context:e,children:g.title}),(0,R.jsx)("p",{style:ki,"data-testid":"place-lede",...k!==void 0?{"data-graview-lede":"headline"}:{},children:k??`${Un(t,en(e,g),g.across)}.`}),m&&!N?(0,R.jsxs)("p",{style:{...C,margin:0},"data-testid":"place-narrowed",children:[`Only those where ${m.split(",").map(A=>A.replace(":"," is ")).join(" and ")}. `,(0,R.jsx)($,{to:`?${(()=>{let A=new URLSearchParams(o);return A.delete("filter"),A.toString()})()}`,style:{...V,...C},children:"Show all"})]}):null,(0,R.jsx)("p",{style:{...C,margin:0,display:"flex",flexWrap:"wrap",gap:"4px 16px"},children:en(e,g).map((A,G)=>(0,R.jsx)($,{to:`/${j(t.schema,A)}`,style:{...qe,...C},...G===0?{"data-testid":"place-as-list"}:{},children:(0,R.jsxs)(Ze,{children:["All ",(A===g.kind?p:Q(t,A)).toLowerCase()," as a list"]})},A))})]}),(0,R.jsx)("div",{"data-testid":"place-lens","data-flows":N?"":void 0,...N?{}:{role:"group","aria-label":g.title,tabIndex:0},style:N?{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:A=>{let G=A.target?.closest("[data-graview-pick]"),H=G?.getAttribute("data-graview-pick"),ae=G?.getAttribute("data-graview-joins");if(ae)try{let z=JSON.parse(ae);if(Array.isArray(z)&&z.every(Oe=>typeof Oe=="string")){A.preventDefault(),s({at:tt(g),ids:z});return}}catch{}if(!H)return;let J=t.graph.getNode(H);J&&(A.preventDefault(),r(Y(t.schema,J.kind,H)))},children:(0,R.jsx)(Kr.Provider,{value:k!==void 0?vi:bi,children:(0,R.jsx)(Vn,{context:e,place:g,filter:m,...i?.at===tt(g)?{chosen:i.ids}:{}})})}),v.length>0?(0,R.jsx)("div",{style:{maxWidth:760,display:"grid",gap:40},"data-testid":"place-creators",children:v.map(({affordance:A,mutation:G})=>(0,R.jsxs)("section",{style:{...re,display:"grid",gap:14},children:[(0,R.jsx)("h2",{style:ne,children:G.title??G.name}),G.description?(0,R.jsx)("p",{style:{...C,margin:0,maxWidth:"58ch"},children:G.description}):null,(0,R.jsx)(Ie,{store:t,mutation:G,prefilled:A.args,open:A.open,label:A.label,...n?{principal:n}:{}})]},A.id))}):null]})}function Pi(e,t=document){let n=jt(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||jt(l)===n)return o}for(let r of a)for(let o of r.querySelectorAll("h1, h2, h3, h4, h5, h6, [role=heading]"))if(jt(o.textContent??"")===n)return o;return null}function wo(e,t={}){if(typeof document>"u"||typeof requestAnimationFrame>"u")return()=>{};let n=t.frames??120,a=0,r=()=>{let o=Pi(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(Me(),1);var tn=I(Me(),1);var nt=I(U(),1);function So({context:e}){return ie()?(0,nt.jsxs)(nt.Fragment,{children:[(0,nt.jsx)(Ai,{context:e}),(0,nt.jsx)(Vr,{face:"pages",on:e.quickAsk??!0})]}):null}function Ai({context:e}){let{store:t}=e,n=ie(),{pathname:a}=me(),r=(0,tn.useRef)(n?.setSelection);return r.current=n?.setSelection,(0,tn.useEffect)(()=>{let o=r.current;if(!o)return;let[,l,i]=a.split("/"),s=(()=>{if(l==="places"){let m=e.views?.places().find(x=>x.as===decodeURIComponent(i??""));return m?[He(m.kind)]:[]}let c=l?Se(t.schema,l):void 0;return c&&i?[decodeURIComponent(i)]:c?[Ia(c)]:[]})();o(c=>c.length===s.length&&c.every((m,x)=>m===s[x])?c:s)},[a]),null}var be=I(Me(),1);var bo=I(ti(),1);var ge=I(U(),1);var Ci=$t(Ha(()=>(__graviewPreload(import.meta.url,["./chunk.XPR3QFF4.js","./chunk.YUEOUV7G.js","./chunk.UGFDSE37.js","./chunk.W5UJLKIT.js","./chunk.7UJZP3YK.js","./chunk.R77TACXU.js","./chunk.6JERQFZI.js","./chunk.7XJ3XQZD.js","./chunk.52J42KR5.js","./chunk.T2Q3AAQI.js","./chunk.63SRVTG2.js","./chunk.C4EPMV7O.js","./chunk.G7XKQNOL.js","./chunk.7KZ44FEU.js","./chunk.LSL25VXW.js","./chunk.WWUMSCYC.js","./chunk.J2R55TM7.js","./chunk.KPUX27ZT.js","./chunk.DIS7JS7X.js","./chunk.D2T563AA.js","./chunk.JV7FLVUV.js","./chunk.GL3YVGAP.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.QRCTTDDQ.js","./chunk.3TME4BG3.js","./chunk.I43ONAEL.js","./chunk.73EKJ4JN.js","./chunk.INL4OZI7.js","./chunk.5WU2UTP7.js","./chunk.GZHZLJBF.js","./chunk.YKACMLLU.js","./chunk.OJGHDWI6.js","./chunk.337JMOTL.js","./chunk.CV4QA4ZF.js","./chunk.OYRZ2DEI.js","./chunk.7EA7THSM.js","./chunk.AI2HBKVP.js","./chunk.Q5IAXTF5.js","./chunk.SDO3U72B.js","./chunk.VOHRQXCF.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.R7CRV2FE.js")).then(e=>({default:e.TakeBack}))));function Ri({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)(Ci,{context:e,docked:t,at:n,since:l,...a})}):null}function Li(e,t,n){let{store:a,principal:r,embedded:o}=e;(0,be.useEffect)(()=>{if(!n)return;let l=i=>{if(!Xr(i))return;let s=i.target,c=s instanceof Node&&t.current?.contains(s),m=s===document.body||s===document.documentElement||s===document;if(!(!c&&!(m&&!o))&&Qr(a,r)){i.preventDefault();try{Zr(a,r)}catch{}}};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[a,r,o,t,n])}function ko({context:e,registry:t,root:n,children:a}){let r=(0,be.useMemo)(lo,[]),o=t?.without()??new Set;return Li(e,n,!o.has("undo")),(0,ge.jsxs)(ht.Provider,{value:r,children:[(0,ge.jsx)(Ti,{context:e,placed:r,without:o}),a]})}function Ti({context:e,placed:t,without:n}){let[a,r]=(0,be.useState)(!1);(0,be.useLayoutEffect)(()=>r(!0),[]);let o=wt(t,"find"),l=wt(t,"undo"),i=me(),s=kr();if(!a)return null;let c=i.pathname.split("/").filter(Boolean),x=(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,bo.createPortal)((0,ge.jsx)(vo,{context:e,narrowsLists:x}),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)(vo,{context:e,narrowsLists:x})}):null,!l&&!n.has("undo")?(0,ge.jsx)(Ri,{context:e,docked:!0,at:i.pathname+i.search}):null,s?.own&&!n.has("undo")?(0,ge.jsx)(ro,{context:e,own:s.own}):null]})}function vo({context:e,narrowsLists:t}){return(0,ge.jsx)(ht.Provider,{value:null,children:(0,ge.jsx)(Bn,{context:e,narrowsLists:t})})}var te=I(Me(),1);var ke=I(U(),1),Ei=500,Mi=10;function nn(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 Ni(e){let t=typeof getSelection=="function"?getSelection():null;return t!==null&&!t.isCollapsed&&t.containsNode(e,!0)}function xo(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 Po({context:e,root:t,children:n}){return ie()===null?(0,ke.jsx)(ke.Fragment,{children:n}):(0,ke.jsx)(Oi,{context:e,root:t,children:n})}function Oi({context:e,root:t,children:n}){let{setMenuAt:a}=Ba(),{store:r}=e,o=r.schema,l=We(),{pathname:i,search:s}=me(),c=Xe("/").replace(/\/$/,""),m=(0,te.useCallback)((w,h)=>e.views?.places().find(L=>L.as===w&&(h===null||L.kind===h)),[e.views]),x=(0,te.useCallback)((w,h)=>{let[L="",O,Z]=w.split("/").filter(Boolean).map(u=>{try{return decodeURIComponent(u)}catch{return u}});if(Z!==void 0)return null;if(L==="places"&&O!==void 0){let u=m(O,new URLSearchParams(h).get("of"));return u?{face:"pages",place:u.as,about:[He(u.kind)],title:u.title}:null}let X=Se(o,L);return X?O===void 0?{face:"pages",about:[He(X)],title:Be(o,X)}:r.graph.getNode(O)?{face:"pages",on:O,about:[O]}:null:null},[o,r,m]),g=(0,te.useCallback)(w=>{let h=w.href;try{let L=new URL(h,location.href);if(L.origin===location.origin&&(c===""||L.pathname===c||L.pathname.startsWith(`${c}/`))){let O=x(L.pathname.slice(c.length),L.search);if(O)return{...O,href:h}}}catch{}return{face:"pages",about:[],href:h}},[c,x]),p=(0,te.useCallback)(()=>x(i,s)??{face:"pages",about:[]},[x,i,s]),P=(0,te.useCallback)(w=>{let h=p(),L=w.closest("[data-graview-field]")?.getAttribute("data-graview-field");if(L&&h.on!==void 0&&w.closest("[data-graview-pick], a[href]")===null)return{...h,field:L};let O=w.closest("[data-graview-act]")?.getAttribute("data-graview-act");if(O)return{...h,act:O};let Z=w.closest("a[href]"),X=w.closest("[data-graview-listed]"),u=[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(u)return{face:"pages",on:u.id,about:[u.id],href:`${c}${Y(o,u.kind,u.id)}`};if(Z)return g(Z);let T=w.closest("[data-graview-record]")?.getAttribute("data-graview-record");return T&&r.graph.getNode(T)?{face:"pages",on:T,about:[T]}:h},[p,g,r,o,c]),N=(0,te.useCallback)(w=>{let h=t.current;if(h===null||!h.contains(w)||nn(w)||w.closest("[data-graview-popover]"))return null;let L=P(w);return{face:"pages",on:L.on,about:L.about??[],field:L.field,place:L.place,href:L.href,act:L.act,element:xo(w)}},[P,t]),W=(0,te.useCallback)((w,h,L)=>{let O=P(w);a({...O,x:Math.round(h),y:Math.round(L),returnTo:xo(w)})},[P,a]),k=(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),v=(0,te.useRef)(null),A=(0,te.useRef)(!1),G=()=>{v.current&&clearTimeout(v.current.timer),v.current=null};(0,te.useEffect)(()=>G,[]),(0,te.useEffect)(()=>{let w=h=>{if(h.defaultPrevented||!(h.key==="ContextMenu"||h.key==="F10"&&h.shiftKey))return;let L=t.current,O=h.target instanceof Element?h.target:null,Z=O===null||O===document.body||O===document.documentElement,X=L!==null&&O!==null&&L.contains(O);if(!X&&!(Z&&document.querySelector("[data-graview-face='pages']")===L)||nn(O)||O?.closest("[data-graview-popover]"))return;h.preventDefault(),E.current=Date.now();let u=X&&O instanceof HTMLElement?O:L?.querySelector("[data-graview-page-title], main h1, main")??null;u&&k(u)};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[t,k]),(0,te.useEffect)(()=>{let w=t.current;if(!w)return;let h=L=>{let O=L.detail;O&&a({...O,face:"pages"})};return w.addEventListener(Cn,h),()=>w.removeEventListener(Cn,h)},[t,a]);let H=(0,te.useMemo)(()=>w=>{if(w.face!=="pages")return null;let h=[],L=w.on===void 0?void 0:r.graph.getNode(w.on),O=w.place===void 0?void 0:e.views?.places().find(de=>de.as===w.place),Z=L?void 0:w.about.length===1&&w.about[0].startsWith("aggregate:")&&!O?$i(w.about[0]):void 0,X=L?Y(o,L.kind,L.id):O?fe(e,O):Z?`/${j(o,Z)}`:void 0,u=X!==void 0&&i===X.split("?")[0];X!==void 0&&!u&&h.push({id:"open",label:"Open",run:()=>l(X)});let T=X!==void 0?`${c}${X}`:w.href;T!==void 0&&h.push({id:"open-in-a-new-tab",label:"Open in a new tab",run:()=>void window.open(T,"_blank","noopener")});let _=L?`#focus=${encodeURIComponent(L.id)}`:O?`#focus=${encodeURIComponent(He(O.kind))}&view=${encodeURIComponent(O.as)}`:Z?`#focus=${encodeURIComponent(He(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 L===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]),ae=(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),L=w.element?.closest("[data-graview-field]")??t.current?.querySelector(`[data-graview-field="${CSS.escape(w.field)}"]`);return!h||!(L instanceof HTMLElement)||!L.hasAttribute("data-graview-editable")?null:{id:"field",at:"start",items:[{id:"change-field",label:`Change \u201C${ba(o.tryDefinition(h.kind),w.field)}\u201D`,run:()=>L.click()}]}},[r,o,t]),J=_r(),z=fr(),Oe=Or(),Ke=(0,te.useCallback)((w,h)=>{i===fe(e,w).split("?")[0]&&l(h?fe(e,h):"/")},[i,e,l]),xe=Yr(Ke),Pe=(0,te.useMemo)(()=>[ae,Oe,H,...xe?[xe]:[],...z?[z]:[],...J?[J]:[]],[ae,Oe,H,xe,z,J]);return(0,ke.jsxs)(pr,{sections:Pe,children:[(0,ke.jsx)("div",{"data-graview-menu-ground":"",style:{display:"contents"},onContextMenu:w=>{let h=w.target;w.shiftKey||nn(h)||Ni(h)||(w.preventDefault(),!h.closest("[data-graview-popover]")&&(Date.now()-E.current<700||(w.clientX===0&&w.clientY===0&&h instanceof HTMLElement?k(h):W(h,w.clientX,w.clientY))))},onPointerDown:w=>{if(A.current=!1,w.pointerType==="mouse"||!w.isPrimary)return;let h=w.target;if(nn(h)||h.closest("[data-graview-choose], [data-graview-popover]"))return;G();let{clientX:L,clientY:O}=w;v.current={x:L,y:O,timer:setTimeout(()=>{v.current=null,A.current=!0,E.current=Date.now(),W(h,L,O)},Ei)}},onPointerMove:w=>{let h=v.current;h&&Math.hypot(w.clientX-h.x,w.clientY-h.y)>Mi&&G()},onPointerUp:G,onPointerCancel:G,onClickCapture:w=>{A.current&&(A.current=!1,w.preventDefault(),w.stopPropagation())},children:n}),(0,ke.jsx)(Hi,{openAt:k,readyAt:N}),(0,ke.jsx)(zr,{placement:"page"}),(0,ke.jsx)(yr,{})]})}function $i(e){let t=e.slice(10).split("+");return t.length===1&&t[0]?t[0]:void 0}function Hi({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)(Ur,{placement:"menu",openActs:e,aimAt:t})})}var K=I(U(),1);function Ao(e,t){return t==="*"?{label:"anything",path:null}:{label:Q(e,t),path:`/${j(e.schema,t)}`}}function Ii({context:e,relation:t}){let{store:n}=e,a=Ao(n,t.from),r=Ao(n,t.to),o=l=>l.path?(0,K.jsx)($,{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)(jr,{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:C,"data-graview-speaks-ids":"",children:[ze(t.edgeKind)," \u2192"]})," ",o(r)]}),t.description||t.inverse?(0,K.jsxs)("span",{style:C,children:[t.description?Ae(t.description):null,t.description&&t.inverse?" \xB7 ":null,t.inverse?`from the other end, ${t.inverse}`:null]}):null]}),r.path?(0,K.jsx)($,{to:`${r.path}?with=${encodeURIComponent(t.edgeKind)}`,style:{...V,...C,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:{...C,fontVariantNumeric:"tabular-nums"},children:t.count})]})}function Co({context:e,heading:t=!0}){let{store:n}=e,a=new Set(Fe(n,e.principal)),r=et(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:ne,children:(0,K.jsx)($,{to:"/map",style:we,children:"Connections"})}),(0,K.jsx)("span",{style:C,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)(Ii,{context:e,relation:o},`${o.edgeKind}|${o.from}|${o.to}`))})]})}function Zn({context:e}){let{store:t}=e;ee(t);let n=new Set(Fe(t,e.principal)),a=et(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)($,{to:`/${j(t.schema,o.kind)}`,style:V,children:o.plural}),(0,K.jsx)("span",{style:C,children:o.count})]},o.kind))}),(0,K.jsx)(Co,{context:e,heading:!1})]})}function Ro({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:ne,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)($,{to:Y(a.schema,o.kind,o.id),style:{...V,...C},children:[pe(a.schema.tryDefinition(o.kind),o)," \u2192"]}):null]},r.participant)})})]})}var B=I(U(),1);function Xn({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=Qt(e).map(k=>({kind:k,members:n.graph.nodesOfKind(k).filter(E=>st(n.schema.tryDefinition(k),E))})),m=c.filter(k=>k.members.length>0),x=c.map(k=>({entry:k,creator:n.allMutations().find(E=>(E.creates??[]).includes(k.kind)&&n.permits({name:E.name,args:{}},e.principal).ok)})).find(k=>k.creator!==void 0),g=m.length===0?"Nothing here yet.":`${m.map(k=>Tt(n.schema,k.kind,k.members.length)).join(", ").replace(/, ([^,]*)$/," and $1")}.`,p=e.views?.homeView?.(),P=n.schema.kinds.some(k=>n.graph.nodesOfKind(k).length>0);if(p&&P){let k=a?.subtitle&&a.subtitleDrawn!==!1?(0,B.jsx)("p",{style:{...C,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:ct,children:(0,B.jsxs)("div",{style:{display:"grid",gap:12},"data-testid":"home-view",children:[E?null:k,o.length>0?(0,B.jsx)($,{to:"/problems",style:{...V,color:"var(--graview-warn)"},children:l}):null,(0,B.jsx)(Gr.Provider,{value:E?k:null,children:(0,B.jsx)(Jt,{when:Ot(p),children:(0,B.jsx)(p,{cardinality:"many",fidelity:"full",mode:"fullscreen",selected:!1})})})]})})}let N=new Set(Fe(n,e.principal)),W=et(n).relations.filter(k=>N.has(k.from)&&(k.to==="*"||N.has(k.to)));return(0,B.jsxs)(oe,{context:e,style:ct,children:[(0,B.jsxs)("header",{style:{display:"grid",gap:12},children:[a?.subtitle&&a.subtitleDrawn!==!1?(0,B.jsx)("p",{style:{...C,margin:0},"data-testid":"app-subtitle",children:a.subtitle}):null,(0,B.jsx)(le,{context:e,"data-testid":"standing",children:g}),(0,B.jsxs)("p",{style:{...se,display:"grid",gap:4},"data-testid":"standing-card",children:[m.length===0&&x?(0,B.jsxs)("span",{children:["Begin with \u201C",x.creator?.title??x.creator?.name,"\u201D, under"," ",(0,B.jsx)($,{to:`/${j(n.schema,x.entry.kind)}`,style:V,children:Q(n,x.entry.kind)}),"."]}):null,o.length===0?(0,B.jsx)("span",{children:"All rules hold."}):(0,B.jsx)($,{to:"/problems",style:{...V,color:"var(--graview-warn)"},children:l})]})]}),(0,B.jsx)(zn,{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:ne,children:"What is here"}),W.length>0?(0,B.jsx)($,{to:"/map",style:{...qe,...C,marginLeft:"auto"},"data-testid":"map-link",children:(0,B.jsxs)(Ze,{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:k,members:E})=>(0,B.jsx)("li",{style:{maxWidth:"100%"},children:(0,B.jsxs)($,{to:`/${j(n.schema,k)}`,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:k,brand:a,schema:n.schema,size:7}),(0,B.jsx)("span",{style:{fontWeight:550,overflowWrap:"anywhere"},children:Q(n,k)}),(0,B.jsx)("span",{style:{...C,fontVariantNumeric:"tabular-nums"},children:E.length===0?"none yet":ft(E.length)})]})},k))})]}),i.length>0?(0,B.jsxs)("section",{style:{...re,display:"grid",gap:10},children:[(0,B.jsx)("h2",{style:ne,children:"Recently"}),(0,B.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:i.map(k=>(0,B.jsxs)("li",{style:C,children:[(0,B.jsx)("span",{style:{color:"var(--graview-ink)"},children:k.intent})," \u2014 ",yt(k,t,{graph:n.graph,schema:n.schema,...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{}})]},k.id))})]}):null]})}var Lo=I(Me(),1);function To(e,t){(0,Lo.useEffect)(()=>{let n=globalThis[Symbol.for("graview.shown-lists")]??=new Map;return n.set(e,()=>t),()=>void n.delete(e)})}var Jn=e=>(__graviewPreload(import.meta.url,["./chunk.AJZBJBMO.js"]),import("./chunk.6YGRRXJB.js")).then(t=>t.saveShownList(e.read()));function Eo(e,t,n){let a={off:e,about:t,read:n,menu:(r,o,l)=>[...e?[]:[{id:"export-csv",label:"Export CSV",run:()=>void Jn(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 ea(e){let{schema:t,graph:n,kind:a,nodes:r,arrangement:o,offers:l,declaredGroup:i}=e,s=t.tryDefinition(a),c=Wt(o.query??""),m=[...o.filter??[],...c.conditions],x=m.some(H=>H.key==="is"&&(H.value==="past"||H.value==="any"))||xr(s,m),g=x||!s?.lifecycle?o:{...o,filter:[...o.filter??[],{key:"is",value:"current"}]},p=new Map,P=Kt(r,g,{schema:t,graph:n,...e.flagged?{flagged:e.flagged}:{},...e.today!==void 0?{today:e.today}:{},read:(H,ae)=>{let J=p.get(H.id);return J||p.set(H.id,J=Qe(t,n,H)),J[ae]}}),N=P.grouped&&!!o.group?.by,W=i&&o.group?.by===i.by&&!o.group.bucket?l.groups.find(H=>H.key===i.by):void 0,k=i&&W&&(W.type==="choice"||W.type==="boolean")?vr(P.groups,i,{type:W.type,...W.options?{options:W.options}:{}}):P.groups.map(H=>({...H,closed:!1})),E=!!o.query||(o.filter??[]).some(H=>H.key===i?.by),v=H=>W?.type==="boolean"?H==="1"?"true":"false":H,A=e.opened??new Set,G=k.map(H=>{let ae=v(H.key);return{...H,value:ae,shut:H.closed&&!E&&!A.has(ae)}});return{arrangement:g,showingPast:x,arranged:P,grouped:N,groups:G,nodes:N?G.flatMap(H=>H.shut?[]:H.nodes):P.nodes}}var Le=I(Me(),1);var at=I(U(),1);function an({context:e,withheld:t,style:n,testId:a}){let r=ie(),o=Ea(t,e.signIn??r?.signIn);return o?(0,at.jsx)("p",{style:{...n,margin:0},children:(0,at.jsx)("button",{type:"button","data-testid":"sign-in",onClick:()=>o.run(),style:ve,children:o.label})}):t.length===0?null:(0,at.jsx)("ul",{style:{...n,margin:0,padding:0,listStyle:"none",display:"grid",gap:4},...a?{"data-testid":a}:{},children:t.map(l=>(0,at.jsxs)("li",{style:C,children:[(0,at.jsx)("s",{children:l.label})," \u2014 ",l.refusal.message]},l.id))})}var M=I(U(),1);function ta({context:e}){let{store:t,brand:n,principal:a,invariantContext:r}=e;ee(t);let[o]=pt(),l=o.get("q")??"",i=typeof r?.today=="string"?r.today:void 0,s=Lr(t,l,{...a?{principal:a}:{},places:Ne(e),flagged:new Set(t.violations(r).flatMap(p=>p.nodeIds)),...i?{today:i}:{},limit:200}),c=s.hits.filter(p=>p.about==="node"),m=s.hits.filter(p=>p.about==="kind"||p.about==="place"||p.about==="rule"),x=[...new Set(c.map(p=>p.kind))],g=l.trim();return(0,M.jsxs)(oe,{context:e,children:[(0,M.jsx)("style",{children:Yt}),(0,M.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,M.jsx)("p",{style:he,children:"Search"}),(0,M.jsx)(le,{context:e,"data-testid":"search-heading",children:g.length===0?"Find anything by its name":s.hits.length===0?(0,M.jsxs)(M.Fragment,{children:["Nothing here is called \u201C",g,"\u201D."]}):(0,M.jsxs)(M.Fragment,{children:[Fi(t,s.byKind)," for \u201C",g,"\u201D"]})}),g.length>0?(0,M.jsxs)("p",{style:{...C,margin:0},"data-testid":"search-searched",children:[Gt(t.schema,s.searched),s.conditions.filter(p=>p.key!=="is"&&p.admittedBy.length<s.searched.kinds.length).map(p=>(0,M.jsxs)("span",{children:[" ",p.key,":",p.value," narrows"," ",p.admittedBy.length===0?"nothing here":p.admittedBy.map(P=>Q(t,P).toLowerCase()).join(" and "),"."]},`${p.key}:${p.value}`))]}):(0,M.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,M.jsx)("code",{children:"done:false"})," and the like narrow as a list does, and ",(0,M.jsx)("code",{children:"is:any"})," includes what is past."]})]}),m.length>0?(0,M.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},"data-testid":"search-named",children:m.map(p=>(0,M.jsx)("li",{"data-testid":"search-hit","data-about":p.about,children:p.about==="kind"?(0,M.jsxs)($,{to:`/${j(t.schema,p.kind)}`,style:V,children:[p.label,p.count>0?(0,M.jsxs)("span",{style:C,children:[" \xB7 ",p.count," match"]}):null]}):p.about==="place"?(0,M.jsxs)($,{to:fe(e,p),style:V,children:["Go to ",p.title]}):p.about==="rule"?(0,M.jsxs)($,{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,x.map(p=>(0,M.jsxs)("section",{className:"graview-list",style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",minWidth:0},"data-testid":"search-group","data-kind":p,children:[(0,M.jsxs)("h2",{className:"graview-group-head",style:{alignItems:"center"},children:[(0,M.jsx)(ue,{kind:p,brand:n,schema:t.schema,size:8}),(0,M.jsx)($,{to:`/${j(t.schema,p)}?${new URLSearchParams({q:g}).toString()}`,style:V,"data-testid":"search-kind-link",children:Q(t,p)}),(0,M.jsx)("span",{children:s.byKind[p]})]}),(0,M.jsx)("ul",{className:"graview-rows",children:c.filter(P=>P.kind===p).map(P=>(0,M.jsxs)("li",{"data-testid":"search-hit","data-about":"node",className:"graview-row",children:[(0,M.jsxs)($,{to:Y(t.schema,p,P.id),className:"graview-row-title",...P.label.length>60?{title:P.label}:{},children:[P.flagged?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)("span",{role:"img","aria-label":"Breaks a rule:",style:{color:"var(--graview-warn)"},children:"\u26A0"})," "]}):null,P.label]}),P.apart||!P.current?(0,M.jsx)("span",{className:"graview-row-glance",children:[P.apart,P.current?"":"past"].filter(Boolean).join(" \xB7 ")}):null,(0,M.jsx)(rn,{why:P.why})]},P.id))})]},p)),g.length>0?(0,M.jsx)(Di,{asked:g}):null,g.length>0&&s.hits.length===0?(0,M.jsx)(No,{store:t,kinds:s.searched.kinds,words:s.words,...a?{principal:a}:{},...r?{invariantContext:r}:{}}):null]})}function rn({why:e}){return e.strength==="near"?(0,M.jsxs)("span",{style:C,"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,M.jsxs)("span",{style:C,"data-testid":"search-why",children:[e.reading,": ",e.fragment]})}function Fi(e,t){let n=Object.entries(t).map(([a,r])=>`${r} ${r===1?Ye(e.schema.tryDefinition(a),a):Q(e,a).toLowerCase()}`);return n.length===0?"Found":n.length===1?Ae(n[0]):Ae(`${n.slice(0,-1).join(", ")} and ${n[n.length-1]}`)}function Mo(e,t,n={}){let a=[];for(let r of t){let o=Je(e,r,{...n.principal?{principal:n.principal}:{},...n.invariantContext?{context:n.invariantContext}:{}});for(let l of on(e,r,o.actions.affordances))a.some(i=>i.mutation.name===l.mutation.name)||a.push(l)}return a}function on(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=hr(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 No({store:e,kinds:t,words:n,principal:a,invariantContext:r}){let o=Mo(e,t,{...a?{principal:a}:{},...r?{invariantContext:r}:{}});return o.length===0||n.trim().length===0?null:(0,M.jsx)("div",{style:{display:"grid",gap:24},"data-testid":"search-to-create",children:o.map(({kind:l,affordance:i,mutation:s,arg:c})=>(0,M.jsxs)("section",{style:{...re,display:"grid",gap:14},children:[(0,M.jsxs)("h2",{style:ne,children:[Ae(ka(Ye(e.schema.tryDefinition(l),l)))," called \u201C",n,"\u201D"]}),(0,M.jsx)(Ie,{store:e,mutation:s,prefilled:i.args,open:i.open,initial:{[c]:n},...a?{principal:a}:{}})]},`${i.id}|${n}`))})}function Di({asked:e}){let t=ie();return t?(0,M.jsx)(Wi,{asked:e,desk:t.aiDesk}):null}function Wi({asked:e,desk:t}){return Ya(t)?(0,M.jsx)("p",{style:{margin:0},children:(0,M.jsxs)("button",{type:"button","data-testid":"search-ask",onClick:a=>za(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),$o=8,Ho=40;function Gi(e,t){let n=t?.fields?.shape??{},a=Object.keys(n).find(r=>Pa(n[r])&&xa(e[r]));return a===void 0?void 0:e[a]}function na({context:e}){let t=Ue(),n=Se(e.store.schema,t.slug??"");return n?(0,f.jsx)(Io,{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 Io({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[m,x]=pt(),g=`list-${(0,Le.useId)().replace(/:/g,"")}`,p=i.schema.tryDefinition(t),P=Ca(m.get("archived")),N=i.graph.nodesOfKind(t,{archived:P}),W=et(i).relations.filter(d=>d.from===t||d.to===t),k=new Set(i.violations(c).flatMap(d=>d.nodeIds)),E=Cr(i.schema,Ar(i.schema,Pr(i.schema,t))),v=W.map(d=>d.edgeKind),A=ji(m,E,v),G=["sort","filter","group","q","by","with","past","archived",...v].some(d=>m.has(d)),H=N.length>=Ho,ae=p?.fieldRoles?.when,J=e.views?.arrangement?.()?.lists?.[t],z=Sr(J),Oe=wr(J?.group),Ke=Vi(H,ae),xe=n??(z?{...Ke,...z}:Ke),Pe=G?A.arrangement:On(xe,E).arrangement,w=z?.sort,h=Pe.sort&&w?.then&&Pe.sort.by===w.by&&Pe.sort.direction===w.direction?{...Pe,sort:w}:Pe,L=Wt(h.query??""),O=new Set((m.get("open")??"").split(",").filter(Boolean)),Z=ea({schema:i.schema,graph:i.graph,kind:t,nodes:N,arrangement:h,offers:E,declaredGroup:Oe,flagged:k,...typeof c?.today=="string"?{today:c.today}:{},opened:O}),{showingPast:X,arranged:u}=Z,T=Z.groups,_=ie(),de=Eo(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:Ft,withComputed:Qe}}));To(`list:${t}`,de);let qo=d=>d.shut,Uo=d=>{let y=new URLSearchParams(m),F=new Set(O);F.has(d)?F.delete(d):F.add(d),F.size>0?y.set("open",[...F].join(",")):y.delete("open"),x(y,{replace:!0})},Te=u.nodes,je=p?.lifecycle&&!X?N.filter(d=>st(p,d)):N,ia=N.length-je.length,sa=h.group?.by??null,Vo=d=>{let y=new URLSearchParams(m);for(let ce of["sort","filter","group","q","by","with","past","archived",...W.map(Rt=>Rt.edgeKind)])y.delete(ce);let F=Tr(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||H||ae)&&y.set("sort",""),x(y)},{principal:ot}=e,dn=Je(i,t,{...ot?{principal:ot}:{},...e.invariantContext?{context:e.invariantContext}:{}}),De=dn.actions.affordances.map(d=>({affordance:d,mutation:i.allMutations().find(y=>y.name===d.mutation)})).filter(d=>d.mutation!==void 0),jo=dn.actions.withheld,cn=()=>new Set(Te.length===0?De.map(({mutation:d})=>d.name):[]),[pn,la]=(0,Le.useState)(()=>({kind:t,open:cn()}));pn.kind!==t&&la({kind:t,open:cn()});let da=d=>(pn.kind===t?pn.open:cn()).has(d),ca=(d,y)=>la(F=>{let ce=new Set(F.open);return y?ce.add(d):ce.delete(d),{kind:F.kind,open:ce}}),pa=`begin-${(0,Le.useId)().replace(/:/g,"")}`,ua=L.words&&Te.length===0?Object.fromEntries(on(i,t,dn.actions.affordances).map(d=>[d.mutation.name,d.arg])):{},_e=Q(i,t),kt=e.views?.lookup(t,{cardinality:"one",fidelity:"glyph"}),un=kt!==void 0&&!lt(kt)?kt:void 0,gn=(h.group?.bucket??"day")==="day"?h.group?.by:void 0,mn=(h.filter??[]).map(d=>d.key),_o=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?Qe(i.schema,i.graph,d):d};gn&&!String(y[gn]).includes("T")&&delete y[gn];for(let F of _o)delete y[F];return y},ga=d=>or(p?.fields?.shape?.[d])?.type==="enum",xt=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:k.has(d.id),glance:no(fn(d),p,y)})]},d.id);if(un){let kn=Vt(kt,d,i.graph),Jo=Object.fromEntries(Object.entries(fn(d)).filter(([ei])=>!kn?.fields.has(ei))),Sa=kn?Dn(Jo,p,kn.title??y,ga):[];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,...k.has(d.id)?{flagged:[d.id]}:{}})}),Sa.length>0?(0,f.jsx)("span",{style:{...C,flex:"0 1 auto",minWidth:0,overflowWrap:"anywhere"},"data-testid":"record-glance",children:(0,f.jsx)(Wn,{runs:Sa})}):null,(0,f.jsx)(Yi,{to:Y(i.schema,t,d.id),label:k.has(d.id)?`${y} \u2014 implicated in a problem`:y})]},d.id)}let F=Dn(fn(d),p,y,ga),ce=F.length>0,Rt=L.words?Rr(p,d,L.words):void 0,ha=H?void 0:sr(d,p),Lt=Gi(d,p),wa=(0,f.jsxs)($,{to:Y(i.schema,t,d.id),className:"graview-row-title",...y.length>60?{title:y}:{},children:[k.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),ha?(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,minWidth:0},children:[(0,f.jsx)(dt,{as:"thumb",file:ha}),wa]}):wa,ce||Lt?(0,f.jsxs)("span",{className:"graview-row-glance",children:[(0,f.jsx)(Wn,{runs:F}),ce&&Lt?" \xB7 ":null,Lt?(0,f.jsx)(Bt,{address:Lt}):null]}):null,Rt?(0,f.jsx)(rn,{why:Rt}):null]},d.id)},yn=Ne(e).filter(d=>d.kind===t&&!d.hidden),ma=J?.filters,zo=(h.filter??[]).some(d=>d.key!=="is"||d.value!=="any"),Yo=!!(h.sort||h.group||h.query||zo),Qo=je.length>=$o||G&&Yo,$e=h.sort?E.sorts.find(d=>d.key===h.sort.by):void 0,hn=$e?.type==="date"||$e!==void 0&&$e.key===ae,fa=H&&!u.grouped&&$e&&($e.about==="label"||$e.type==="text"||hn)?d=>{let y=$e.about==="label"?pe(p,d):d[$e.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,Pt=fa?Te.reduce((d,y)=>{let F=fa(y);return d.at(-1)?.key===F?d.at(-1).nodes.push(y):d.push({key:F,nodes:[y]}),d},[]):void 0,ya=Z.nodes,wn=(0,Le.useMemo)(()=>ya.map(d=>d.id),[ya.map(d=>d.id).join(`
|
|
6
|
-
`)]),Ee=$r(wn),Sn=(0,Le.useId)(),gt=(ot?i.permittedMutations(ot):i.permittedMutations()).some(d=>{let y=d.subject?.kinds;return y!==void 0&&(y==="*"||y.includes(t))}),vn=(d,y)=>gt?(0,f.jsx)("span",{className:"graview-choose-at",children:(0,f.jsx)("input",{...Ee.boxProps(d.id,y),onPointerEnter:$n,onFocus:$n})}):null,bn=d=>gt?{"data-graview-choose":d}:{},Zo=(0,Le.useCallback)(d=>{Ee.choose(d),requestAnimationFrame(()=>{let y=Ee.list.current;((d[0]===void 0?null:y?.querySelector(`[data-graview-choose-box="${CSS.escape(d[0])}"]`))??y)?.focus({preventScroll:!0})})},[Ee]),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,At=it?void 0:"graview-rows",mt=d=>`list-at-${d.replace(/[^\p{L}\p{N}]/gu,"_")}`,Ct=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}}),Xo=new Set(Ct.map(d=>(d.words??"").toLowerCase()).filter((d,y,F)=>d&&F.indexOf(d)!==y));return(0,f.jsxs)(l?Ui: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)(ut,{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:_e}),De.length>0?(0,f.jsx)("span",{style:{marginLeft:"auto",display:"flex",flexWrap:"wrap",columnGap:14,rowGap:8},"data-testid":"beginnings-open",children:De.map(({affordance:d,mutation:y})=>(0,f.jsx)(_i,{name:y.name,title:y.title??y.name,panel:`${pa}-${y.name}`,open:da(y.name),onOpen:F=>ca(y.name,F)},d.id))}):null,!de.off&&je.length>0?(0,f.jsxs)("button",{type:"button","data-testid":"list-export","aria-label":"Export CSV",title:"Export CSV",onClick:()=>void Jn(de),style:{...we,minHeight:28,margin:"-4px 0",...De.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]}),Te.length>0?(0,f.jsx)(Jr,{place:"here",to:[{label:`Skip to the ${Te.length===1?Ye(p,t):`${Te.length} ${_e.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)}},...je.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,Ct.length>0||yn.length>0?(0,f.jsxs)("p",{style:{...C,margin:0,display:"flex",flexWrap:"wrap",columnGap:18,rowGap:2},"data-testid":"kind-related",children:[Ct.length>0?(0,f.jsxs)("span",{"data-testid":"kind-relations",children:["Related:"," ",Ct.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==="*"?Ae(F??ze(d.edgeKind)):(0,f.jsx)($,{to:`/${j(i.schema,y)}`,style:V,title:Q(i,y),children:F&&Xo.has(F.toLowerCase())?`${Ae(F)}: ${Q(i,y).toLowerCase()}`:Ae(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)($,{to:fe(e,d),style:V,children:d.title})]},tt(d)))]}):null]}):null]}),De.length>0?(0,f.jsx)("div",{style:{display:"contents"},"data-testid":"beginnings",children:De.map(({affordance:d,mutation:y})=>{let F=!!(ua[y.name]&&Te.length===0);return(0,f.jsx)(zi,{name:y.name,id:`${pa}-${y.name}`,description:y.description,open:da(y.name),onClose:()=>ca(y.name,!1),children:(0,f.jsx)(Ie,{store:i,mutation:y,prefilled:d.args,open:d.open,...F?{initial:{[ua[y.name]]:L.words}}:{},...e.principal?{principal:e.principal}:{}},F?`${y.name}|${L.words}`:y.name)},d.id)})}):null,A.dropped.length>0?(0,f.jsxs)("p",{style:{...C,margin:0},"data-testid":"list-dropped",children:["This link asked for ",A.dropped.join(", "),", which ",_e.toLowerCase()," cannot be arranged by; the rest is shown."]}):null,je.length>0?(0,f.jsx)(Nr,{schema:i.schema,graph:i.graph,kind:t,arrangement:h,onChange:Vo,kept:{shown:Te.length,of:je.length},noun:{one:Ye(p,t),many:_e.toLowerCase()},...Qo?{}:{allow:!1},...ma?{filters:ma}:{},offers:E,chips:{nodes:je,flagged:k,...typeof c?.today=="string"?{today:c.today}:{}},query:e.framed===!0&&e.barAbove!==!0}):null,(0,f.jsx)("style",{children:Yt}),gt?(0,f.jsx)("style",{children:Hr+qi}):null,(0,f.jsx)("div",{className:"graview-list","data-graview-skip-target":Sn,...gt?{...Ee.listProps,ref:Ee.list,tabIndex:-1,"data-graview-choosable":"","aria-label":Ee.chosen.length>0?`${_e}, ${Ee.chosen.length} chosen`:_e,role:"group"}:{},children:Te.length===0&&L.words?(0,f.jsxs)("p",{style:se,"data-testid":"none-yet",children:["Nothing here is called \u201C",L.words,"\u201D."," ",(0,f.jsx)("span",{style:C,"data-testid":"list-searched",children:Gt(i.schema,{kinds:[t],past:X})})," ",(0,f.jsx)($,{to:"?",style:V,children:"Show every one"})]}):Te.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&&De.length>0?` \u2014 the first one starts above, with \u201C${De[0]?.mutation.title??De[0]?.mutation.name}\u201D.`:!h.filter?.length&&!h.query?".":"",h.filter?.length||h.query?(0,f.jsxs)(f.Fragment,{children:[" ",(0,f.jsx)($,{to:"?",style:V,children:"Show every one"})]}):null]}):u.grouped&&sa?(0,f.jsx)("div",{style:{display:"grid",gap:"1rem"},"data-testid":"records","data-grouped":sa,children:T.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:At,"data-graview-rows":"",children:d.nodes.map(xt)})]},d.key||"-");let y=qo(d),F=`${g}-${mt(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:()=>Uo(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:Ki,children:[" ",d.nodes.length===1?Ye(p,t):_e.toLowerCase()]})]})}),(0,f.jsx)("ul",{id:F,style:y?{...it,display:"none"}:it,className:At,"data-graview-rows":"",hidden:y,children:y?null:d.nodes.map(xt)})]},d.key||"-")})}):Pt&&Pt.length>1?(0,f.jsxs)("div",{style:{display:"grid",gap:14},"data-testid":"records","data-sectioned":$e?.type==="date"?"year":"letter",children:[(0,f.jsx)("nav",{"aria-label":"Jump to","data-testid":"list-index",style:{...C,display:"flex",flexWrap:"wrap",gap:$e?.type==="date"?"0 10px":"0 4px",lineHeight:1.3},children:Pt.map(d=>(0,f.jsx)("a",{href:`#${mt(d.key)}`,onClick:y=>{y.preventDefault(),document.getElementById(mt(d.key))?.scrollIntoView({block:"start"})},style:{...we,minWidth:24,justifyContent:"center"},children:d.key},d.key))}),Pt.map(d=>(0,f.jsxs)("section",{"data-testid":"list-section","aria-labelledby":mt(d.key),style:{display:"grid",gap:0},children:[(0,f.jsx)("h2",{id:mt(d.key),className:"graview-group-head",children:d.key}),(0,f.jsx)("ul",{style:it,className:At,"data-graview-rows":"",children:d.nodes.map(xt)})]},d.key))]}):(0,f.jsx)("ul",{style:it,className:At,"data-testid":"records","data-graview-rows":"",children:Te.map(xt)})}),gt?(0,f.jsx)(Ir,{store:i,chosen:Ee.chosen,...ot?{principal:ot}:{},...c?{context:c}:{},anchor:Bi,of:wn.length,onChooseAll:()=>Ee.choose(wn),onClear:Ee.clear,onActed:Zo}):null,ia>0?(0,f.jsxs)($,{to:Oo(m,"filter","is:any"),style:{...V,...C,justifySelf:"start"},"data-testid":"past-link",children:["+",ia," past"]}):null,P===!1&&i.graph.count(t,{archived:!0})>0?(0,f.jsxs)($,{to:Oo(m,"archived","true"),style:{...V,...C,justifySelf:"start"},"data-testid":"archived-link",children:["+",i.graph.count(t,{archived:!0})," archived"]}):null]}),(0,f.jsx)(an,{context:e,withheld:jo,style:re,testId:"withheld"})]})}var Ki={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},Bi=()=>document.querySelector("[data-graview-choosable]")?.closest("[data-embed-content]")??null,qi=`
|
|
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:${Ma.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 Ui({children:e}){return(0,f.jsx)("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:40,minWidth:0},children:e})}var Vi=(e,t)=>t?{sort:{by:t,direction:"desc"}}:e?{sort:{by:"label",direction:"asc"}}:{};function ji(e,t,n){let a=Nt({...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 Oo(e,t,n){let a=new URLSearchParams(e);return a.set(t,n),a.delete("past"),`?${a.toString()}`}function _i({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 zi({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:{...C,margin:0,maxWidth:"58ch"},children:n}):null,o]})}function Yi({to:e,label:t}){let n=(0,Le.useRef)(null);return Fr(n),(0,f.jsx)($,{ref:n,to:e,"aria-label":t,style:{position:"absolute",inset:0,borderRadius:6}})}var rt=I(Me(),1);var bt=I(Me(),1);var D=I(U(),1);function aa({context:e}){let{store:t,brand:n,invariantContext:a,principal:r}=e;ee(t);let o=t.violations(a),l=t.allInvariants(),i=Ht(t,o),s=Qa(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.":Ra(o)})]}),(0,D.jsx)(Ro,{context:e}),i.map((c,m)=>{let x=c.nodeIds[0],g=x?t.graph.getNode(x):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)(sn,{violation:c,schema:t.schema,...n?{brand:n}:{}}),g?(0,D.jsxs)("p",{style:{margin:0,display:"inline-flex",alignItems:"center",gap:8},children:[(0,D.jsx)(ue,{kind:g.kind,brand:n,schema:t.schema,size:7}),(0,D.jsx)($,{to:Y(t.schema,g.kind,g.id),style:V,children:pe(t.schema.tryDefinition(g.kind),g)})]}):null,c.line?(0,D.jsx)(sn,{violation:c,schema:t.schema,...n?{brand:n}:{}}):null,(0,D.jsx)(ln,{store:t,repairs:c.repairs,...r?{principal:r}:{}})]},m)}),l.length>0?(0,D.jsxs)("section",{style:{...re,display:"grid",gap:12},"data-testid":"rules",children:[(0,D.jsx)("h2",{style:ne,children:"The rules"}),(0,D.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:l.map(c=>{let m=o.filter(p=>p.invariant===c.name).length,x=s.get(c.name),g=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:[x?(0,D.jsx)(It,{line:x,schema:t.schema,...n?{brand:n}:{},style:{flex:"1 1 18rem"}}):(0,D.jsx)("span",{style:{flex:"1 1 18rem",fontWeight:550},children:g}),(0,D.jsx)("span",{style:{...C,color:m>0?"var(--graview-warn)":"var(--graview-ink-faint)"},children:m===0?"holds":`broken in ${m} ${m===1?"place":"places"}`})]}),x&&g.trim().length>0?(0,D.jsx)("span",{style:C,children:g}):null]},c.name)})})]}):null]})}function sn({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=Xa(e),r=Za(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:C,children:a}):null,(0,D.jsxs)("details",{"data-testid":"problem-judged",style:C,children:[(0,D.jsx)("summary",{style:{cursor:"pointer",width:"fit-content",minHeight:24},children:"How it is judged"}),(0,D.jsx)(It,{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)(It,{line:e.line,schema:t,...n?{brand:n}:{},lead:"none",style:{color:"var(--graview-warn)"}}),a?(0,D.jsx)("span",{style:C,children:a}):null]})}function ln({store:e,repairs:t,principal:n}){let[a,r]=(0,bt.useState)(null),[o,l]=(0,bt.useState)(null),i=(0,bt.useRef)([]);if(t.length===0)return null;let s=a===null?null:t[a],c=s&&(s.missing??[]).length>0?e.allMutations().find(m=>m.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((m,x)=>{let g=(m.missing??[]).length>0,p=e.permits({name:m.mutation,args:{...m.args}},n);return p.ok?(0,D.jsx)("button",{ref:P=>{i.current[x]=P},type:"button","data-graview-repair":m.mutation,"data-graview-asks":g||void 0,"aria-expanded":g?a===x:void 0,onClick:()=>{if(l(null),g){r(a===x?null:x);return}r(null);try{e.apply({name:m.mutation,args:{...m.args}},n?{author:n}:{})}catch(P){l(Dt(e.schema,e.allMutations(),P))}},style:ve,children:g?`${m.label} \u2026`:m.label},x):(0,D.jsxs)("p",{"data-testid":"withheld","data-withheld":p.refusal.wouldNeed.join(",")||"nobody",style:{...C,margin:0},children:[(0,D.jsx)("s",{children:m.label})," \u2014 ",p.refusal.message]},x)})}),c&&s?(0,D.jsx)(Ie,{store:e,mutation:c,prefilled:{...s.args},only:s.missing??[],label:s.label,autoFocus:!0,onDone:()=>{let m=a;r(null),requestAnimationFrame(()=>{let x=m===null?null:i.current[m];if(x?.isConnected){x.focus();return}let g=document.querySelector("[data-graview-page-title]")??document.querySelector("main h1, main h2");g&&(g.hasAttribute("tabindex")||(g.tabIndex=-1),g.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 ra=I(Me(),1);var Ve=I(U(),1);function Fo({store:e,link:t,principal:n}){let[a,r]=(0,ra.useState)(!1),[o,l]=(0,ra.useState)(null),i=nr(t);return(0,Ve.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[(0,Ve.jsx)("button",{type:"button","data-graview-provisional":"",title: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,Ve.jsxs)("span",{style:{...C,display:"inline-flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,Ve.jsx)("span",{children:i}),(0,Ve.jsx)("button",{type:"button",style:{...ve,padding:"4px 10px"},onClick:()=>{try{e.apply({name:La,args:{kind:t.edge.kind,from:t.edge.from,to:t.edge.to}},n?{author:n}:{}),r(!1)}catch(s){l(Dt(e.schema,e.allMutations(),s))}},children:"Keep this link"}),o?(0,Ve.jsx)("span",{role:"alert",children:o}):null]}):null]})}var ye=I(U(),1);function Do({nodeId:e,node:t,field:n,inPlace:a,labelStyle:r=he}){return n.files?(0,ye.jsx)(dt,{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)(Mr,{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)(ur,{relation:n.linked.relation,refs:n.linked.refs,...a?{nodeId:e,field:n.key}:{}}):n.app?(0,ye.jsx)(Bt,{address:n.app,as:"record",...a?{nodeId:e,field:n.key}:{}}):n.href?(0,ye.jsx)(Er,{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)(qt,{nodeId:e,field:n.key,value:n.value,stored:n.stored}),n.repeats?(0,ye.jsx)(gr,{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),Qi=[];function oa({context:e}){let{store:t,brand:n,principal:a,invariantContext:r}=e;ee(t);let o=ie()!==null,l=Ue(),i=decodeURIComponent(l.id??""),s=po(t,i,{...a?{principal:a}:{},...r?{context:r}:{}}),c=Ht(t,s?.violations??Qi),[m,x]=(0,rt.useState)(null),[g,p]=(0,rt.useState)(!1),[P,N]=(0,rt.useState)(null),W=(0,rt.useRef)(null),k=(0,rt.useRef)(null),E=mr({flow:"both",letters:!0}),v=u=>{(W.current?.parentElement?.querySelector(`[data-affordance="${u.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 A=t.graph.getNode(i),G=t.schema.tryDefinition(s.kind),H=G?.describe&&A?er(G,A):null,ae=[...t.log.all()].filter(u=>!Et(u)&&(u.writes.includes(i)||u.reads.includes(i))).slice(-8).reverse(),J=t.log.all().find(u=>!Et(u)&&u.undoes===void 0&&u.primitives.some(T=>T.op==="add-node"&&T.node.id===i)),z=s.actions.affordances.filter(u=>u.provider!=="invariant"),Oe=z.filter(u=>u.destructive||u.setsAside),Ke=g||Oe.length<2?z:z.filter(u=>!Oe.includes(u)),xe=e.views?.lookup(s.kind,{cardinality:"one",fidelity:"full"}),Pe=xe!==void 0&&!lt(xe)?xe:void 0,w=Pe&&A?Vt(xe,A,t.graph):void 0,h=w?s.fields.filter(u=>!w.fields.has(u.key)):s.fields,L=w?s.links.flatMap(u=>{let T=u.targets.filter(_=>!w.records.has(_.id));return T.length>0?[{...u,targets:T}]:[]}):s.links,O=Pe!==void 0&&ja(xe),Z=o&&ir(G).length>0,X=Ne(e).filter(u=>!u.hidden&&(u.kind===s.kind||u.across===s.kind));return(0,S.jsxs)(oe,{context:e,children:[(0,S.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,S.jsx)(ut,{context:e}),(0,S.jsx)(le,{context:e,children:o&&A?.label===s.label?(0,S.jsx)(qt,{nodeId:i,field:"label",value:s.label,said:s.label}):s.label}),H&&H!==s.label?(0,S.jsx)("p",{style:se,children:H}):null,J?.lineage?(0,S.jsxs)("p",{style:{...C,margin:0},"data-testid":"record-lineage",children:["Made by ",yt(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)(Zt,{context:e,stop:`#focus=${encodeURIComponent(i)}`,style:{...qe,...C},"data-testid":"spatial-link"}),o&&A?(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,...C,justifySelf:"start"}}):null,X.length>0?(0,S.jsxs)("p",{style:{...C,margin:0},"data-testid":"seen-in",children:["Seen in:"," ",X.map((u,T)=>(0,S.jsxs)("span",{children:[T>0?(0,S.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,(0,S.jsx)($,{to:fe(e,u),style:V,children:u.title})," ",(0,S.jsx)(Zt,{context:e,stop:`#view=${encodeURIComponent(u.as)}`,style:{...V,...C,display:"inline-block",minWidth:24,textAlign:"center"},title:`${u.title}, in the scene`,label:`${u.title}, in the scene`,children:(0,S.jsx)("span",{"aria-hidden":"true",children:"\u2197"})})]},tt(u)))]}):null]}),A&&Aa(A)?(0,S.jsx)(Xi,{context:e,id:i,kind:s.kind}):null,A&&Ta(t,i)?(0,S.jsx)(Zi,{context:e,id:i,kind:s.kind}):null,Pe&&A?(0,S.jsx)("section",{"data-testid":"record-view",style:{display:"grid",minWidth:0},children:(0,S.jsx)(Dr,{children:(0,S.jsx)(Jt,{when:Ot(xe),children:(0,S.jsx)(Pe,{node:A,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((u,T)=>(0,S.jsxs)("div",{style:{display:"grid",gap:8},children:[(0,S.jsx)(sn,{violation:u,schema:t.schema,...n?{brand:n}:{}}),(0,S.jsx)(ln,{store:t,repairs:uo(s.actions,u.repairs),...a?{principal:a}:{}})]},T))}):null,!O&&(h.length>0||Z)?(0,S.jsxs)("section",{style:{...re,display:"grid",gap:14},"data-testid":"record-fields",children:[(0,S.jsx)("h2",{style:ne,children:"The facts"}),tr(G,h).map((u,T)=>{let _=(0,S.jsx)("dl",{style:{margin:0,display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gap:"14px 24px"},children:u.fields.map(de=>(0,S.jsx)(Do,{nodeId:i,node:A,field:de,inPlace:o},de.key))});return u.title?(0,S.jsxs)("section",{style:{display:"grid",gap:10,minWidth:0},children:[(0,S.jsx)("h3",{"data-graview-field-group":u.title,style:{...ne,fontSize:"inherit"},children:u.title}),_]},T):(0,S.jsx)("div",{children:_},T)}),Z?(0,S.jsx)(dt,{as:"unfilled",nodeId:i,skip:[...w?.fields??[]],labelStyle:he,style:{gap:4}}):null]}):null,(O?[]:L).map(u=>(0,S.jsxs)("section",{style:{...re,display:"grid",gap:10},children:[(0,S.jsx)("p",{style:he,children:to(t,u)}),u.description?(0,S.jsx)("h2",{style:ne,children:Ae(u.description)}):(0,S.jsxs)("h2",{style:ne,"aria-label":ze(u.edgeKind),children:[u.direction==="in"?"\u2190 ":"\u2192 ",ze(u.edgeKind)]}),(0,S.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"6px 18px"},children:u.targets.map(T=>{let _=ar(t,u.direction==="in"?{kind:u.edgeKind,from:T.id,to:i}:{kind:u.edgeKind,from:i,to:T.id});return(0,S.jsxs)("li",{style:{display:"inline-flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,S.jsx)(ue,{kind:T.kind,brand:n,schema:t.schema,size:7}),(0,S.jsxs)($,{to:Y(t.schema,T.kind,T.id),style:V,children:[T.label,T.apart?(0,S.jsxs)("span",{style:C,children:[" \xB7 ",T.apart]}):null]}),_?.provisional?(0,S.jsx)(Fo,{store:t,link:_,...a?{principal:a}:{}}):null]},T.id)})}),(u.direction==="out"&&t.schema.edge(u.edgeKind)?.cardinality==="one"?[]:[...new Set(u.targets.map(T=>T.kind))]).map(T=>(0,S.jsx)($,{to:`/${j(t.schema,T)}?${encodeURIComponent(u.edgeKind)}=${encodeURIComponent(i)}`,style:{...qe,...C},"data-testid":"related-all",children:(0,S.jsxs)(Ze,{children:["Sort and filter ",u.description??`these ${Q(t,T).toLowerCase()}`,u.targets.some(_=>_.kind!==T)?` (${Q(t,T).toLowerCase()})`:""]})},T))]},`${u.edgeKind}|${u.direction}|${u.description??""}`)),!O&&(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:ne,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:[Ke.map(u=>{let T=m===u.id;return(0,S.jsx)("button",{type:"button","data-affordance":u.id,"data-rank":u.rank,"data-graview-act":u.mutation,[Tn]:"",autoFocus:g&&u===Oe[0],"aria-expanded":T,onClick:()=>x(T?null:u.id),style:{...ve,...T?{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"}:{}},children:u.label},u.id)}),Ke.length<z.length?(0,S.jsxs)("button",{type:"button","aria-expanded":!1,onClick:()=>p(!0),style:{...ve,...C},"data-testid":"record-actions-more",[Tn]:"",children:["Show ",z.length-Ke.length," more"]}):null]}),z.map(u=>{if(m!==u.id)return null;let T=t.allMutations().find(_=>_.name===u.mutation);return T?(0,S.jsxs)("div",{ref:k,onKeyDown:_=>{if(_.key!=="Escape"||_.defaultPrevented)return;_.preventDefault(),x(null);let de=u.id;requestAnimationFrame(()=>v(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:ne,children:u.label}),T.description?(0,S.jsx)("p",{style:{...C,margin:0},children:T.description}):null,(0,S.jsx)(Ie,{store:t,mutation:T,prefilled:u.args,open:u.open,label:u.label,autoFocus:!0,onDone:()=>{x(null),N(u.mutation);let _=u.id;requestAnimationFrame(()=>v(_))},...a?{principal:a}:{}})]},u.id):null}),o&&P!==null&&m===null?(0,S.jsx)(En,{choices:[{on:"act",act:P,record:i},{on:"act",act:P}],label:"Notify me when someone else does this",testId:"notify-after-act",style:{...ve,...C,justifySelf:"start"}}):null,(0,S.jsx)(an,{context:e,withheld:s.actions.withheld})]}):null,o?(0,S.jsx)(eo,{id:i,style:re,headingStyle:ne}):null,ae.length>0?(0,S.jsxs)("section",{style:{...re,display:"grid",gap:10},"data-testid":"record-history",children:[(0,S.jsx)("h2",{style:ne,children:"What has happened"}),(0,S.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:ae.map(u=>(0,S.jsxs)("li",{style:C,children:[(0,S.jsx)("span",{style:{color:"var(--graview-ink)"},children:u.intent}),u.lineage?(0,S.jsxs)("span",{"data-graview-lineage":"",children:[" \xB7 ",Rn(u.lineage)]}):null," \u2014 ",yt(u,a,{graph:t.graph,schema:t.schema,...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{}})]},u.id))})]}):null]})}function Zi({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 Xi({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=>!Et(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)($,{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 b=I(U(),1),Ji=$t(()=>(__graviewPreload(import.meta.url,["./chunk.FJC6PMOG.js","./chunk.XPR3QFF4.js","./chunk.YUEOUV7G.js","./chunk.UGFDSE37.js","./chunk.W5UJLKIT.js","./chunk.7UJZP3YK.js","./chunk.R77TACXU.js","./chunk.6JERQFZI.js","./chunk.7XJ3XQZD.js","./chunk.52J42KR5.js","./chunk.T2Q3AAQI.js","./chunk.63SRVTG2.js","./chunk.C4EPMV7O.js","./chunk.G7XKQNOL.js","./chunk.7KZ44FEU.js","./chunk.LSL25VXW.js","./chunk.WWUMSCYC.js","./chunk.J2R55TM7.js","./chunk.KPUX27ZT.js","./chunk.DIS7JS7X.js","./chunk.D2T563AA.js","./chunk.JV7FLVUV.js","./chunk.GL3YVGAP.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.QRCTTDDQ.js","./chunk.3TME4BG3.js","./chunk.I43ONAEL.js","./chunk.73EKJ4JN.js","./chunk.INL4OZI7.js","./chunk.5WU2UTP7.js","./chunk.GZHZLJBF.js","./chunk.YKACMLLU.js","./chunk.OJGHDWI6.js","./chunk.337JMOTL.js","./chunk.CV4QA4ZF.js","./chunk.OYRZ2DEI.js","./chunk.7EA7THSM.js","./chunk.AI2HBKVP.js","./chunk.Q5IAXTF5.js","./chunk.SDO3U72B.js","./chunk.VOHRQXCF.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.EME5HQ3H.js")).then(e=>({default:e.DraftPage}))),es={kind:"human"};function ts({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,b.jsx)("p",{className:"graview-spec-text graview-spec-more",children:`and ${a} more`});let o=Be(t.schema,r).toLowerCase();return(0,b.jsx)("p",{className:"graview-spec-text graview-spec-more",children:(0,b.jsx)($,{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 ${ft(e.total)} ${o}`:`${ft(a)} more \xB7 all ${o}`})})}function ns({context:e,children:t}){let n=We(),a=e.store.schema,r=Xe("/").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,b.jsx)(ts,{list:l,store:e.store})}),[r,a,n,e.store]);return(0,b.jsx)(Ut.Provider,{value:o,children:(0,b.jsx)(Wr.Provider,{value:(e.titleLevel??(e.framed&&!e.barAbove?1:2))-1,children:t})})}var Go=(0,q.createContext)(void 0);function as({steering:e}){let t=me(),n=We(),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 rs({context:e,to:t}){let{pathname:n}=me(),a=ie(),r=(t??a)?.sayWhere,o=os(e,n);return(0,q.useEffect)(()=>(r?.(o),()=>r?.(null)),[r,o]),null}function os(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(He(l.kind))}&view=${encodeURIComponent(l.as)}`:"#"}let o=Se(e.store.schema,n);return o?`#focus=${encodeURIComponent(a??He(o))}`:"#"}function is({onNavigate:e,path:t}){let n=me(),a=Gn(),r=We(),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 m=s.current;s.current=l,m!==null&&(l===m&&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 Wo({context:e,registry:t,page:n}){let a=Ue(),r=Se(e.store.schema,a.slug??""),o=n==="list"?na:oa,i=(r?t?.lookup(r,n):void 0)??o;return(0,b.jsx)(i,{context:e})}function ss({context:e,registry:t,children:n}){let a=(0,q.useRef)(null);return _a(a),(0,b.jsx)("div",{ref:a,"data-graview-face":"pages",style:{display:"contents"},children:(0,b.jsx)(ko,{context:e,registry:t,root:a,children:(0,b.jsx)(Po,{context:e,root:a,children:n})})})}function ls(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 ds(){let{pathname:e}=me(),t=Gn(),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(ls(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,b.jsx)("span",{ref:n,hidden:!0,"data-graview-scroll-reset":""})}function Ko({context:e,children:t}){let n=We(),a=Xe("/").replace(/\/$/,""),r=(0,q.useContext)(Go),o=(0,q.useMemo)(()=>{let l=(s,c)=>{if("record"in s){let m=e.store.graph.getNode(s.record);return m?_t(Y(e.store.schema,m.kind,s.record),{section:c?.section}):void 0}if("place"in s){let m=e.views?.places().find(x=>x.as===s.place);return m?_t(fe(e,m),c):void 0}return e.store.schema.tryDefinition(s.list)?_t(`/${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 m=r===!1?void 0:l(s,c);if(m!==void 0)return r?r(m):`${a}${m}`}}},[e,n,a,r]);return(0,b.jsx)(Va.Provider,{value:o,children:t})}function cs(){let{pathname:e,search:t,hash:n}=me();return(0,q.useEffect)(()=>{let a=decodeURIComponent(n.replace(/^#/,""));if(!(!a||a.includes("=")))return wo(a)},[e,t,n]),null}function ps({context:e,Home:t}){let n=me(),a=e.views,r=n.key==="default"&&!(a&&qa(a));(0,q.useEffect)(()=>{a&&Ua(a)},[a]);let o=r?$a(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,b.jsx)(Kn,{to:l,replace:!0}):(0,b.jsx)(t,{context:e})}function Bo({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=N=>n===void 0?(0,b.jsx)(Xt,{context:e,children:N}):r?(0,b.jsx)(n,{context:e,children:N}):(0,b.jsx)(Xt,{context:e,children:(0,b.jsx)(n,{context:o,children:N})}),i=t?.lookupSurface("home")??Xn,s=t?.lookupSurface("problems")??aa,c=a?{...o,framed:!0}:e,[m,x]=(0,q.useState)(null),g=(0,q.useMemo)(()=>({context:c,registry:t}),[c,t]),p=(0,q.useMemo)(()=>({onFind:x,find:!(t?.without().has("find")??!1),places:!(t?.without().has("places")??!1)}),[t]),P=(0,b.jsx)(qn.Provider,{value:g,children:(0,b.jsx)(Ko,{context:e,children:(0,b.jsx)(ss,{context:e,registry:t,children:l((0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(rr,{face:"pages"}),(0,b.jsxs)(ns,{context:c,children:[(0,b.jsx)(ds,{}),(0,b.jsx)(cs,{}),(0,b.jsxs)(io,{children:[(t?.routes()??[]).map(({path:N,component:W})=>(0,b.jsx)(Ce,{path:N,element:(0,b.jsx)(W,{context:c})},N)),(0,b.jsx)(Ce,{path:"/",element:(0,b.jsx)(ps,{context:c,Home:i})}),(0,b.jsx)(Ce,{path:"/problems",element:(0,b.jsx)(s,{context:c})}),(0,b.jsx)(Ce,{path:"/~draft",element:(0,b.jsx)(q.Suspense,{fallback:null,children:(0,b.jsx)(Ji,{context:c})})}),(0,b.jsx)(Ce,{path:"/search",element:(0,b.jsx)(ta,{context:c})}),(0,b.jsx)(Ce,{path:"/map",element:(0,b.jsx)(Zn,{context:c})}),(0,b.jsx)(Ce,{path:"/places",element:(0,b.jsx)(Yn,{context:c})}),Ne(c).some(N=>N.as===An)?null:(0,b.jsx)(Ce,{path:Oa,element:(0,b.jsx)(Kn,{to:"/",replace:!0})}),(0,b.jsx)(Ce,{path:"/places/:as",element:(0,b.jsx)(Qn,{context:c})}),(0,b.jsx)(Ce,{path:"/:slug",element:(0,b.jsx)(Wo,{context:c,registry:t,page:"list"})}),(0,b.jsx)(Ce,{path:"/:slug/:id",element:(0,b.jsx)(Wo,{context:c,registry:t,page:"record"})})]})]})]}))})})});return e.embedded||!a||r?P:(0,b.jsx)(co.Provider,{value:p,children:(0,b.jsx)(br.Provider,{value:m,children:P})})}var us=()=>typeof document>"u"?null:document.body;function gs({context:e,registry:t,basename:n,initialPath:a,onNavigate:r,path:o,steering:l,firstLook:i,hrefOf:s,typing:c}){let[m,x]=(0,q.useState)(void 0),g=m!==void 0&&m.from===e.principal?{...e,principal:m.seat}:e;(0,q.useState)(()=>g.views?Br(g.views,g.store.schema,Nn(g.brand,g.store.schema)):void 0);let p=ie(),P=c??g.typing;va({reader:g.locale??p?.locale,app:g.brand?.locale??g.app?.brand?.locale,readerTimeZone:g.timeZone??p?.timeZone,appTimeZone:g.brand?.timeZone??g.app?.brand?.timeZone});let N=g.principal??es,W=Wa(g.store,N,g.history),E=(W.past&&W.live===g.store?W.past.store:g.store).seenBy(N),v=E===g.store?g:{...g,store:E};Ga(g.store,g.principal);let A=(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(is,{onNavigate:r,path:o}),l?(0,b.jsx)(as,{steering:l}):null,v.presence||p?(0,b.jsx)(rs,{context:v,to:p}):null,(0,b.jsx)(Bo,{context:v,...t?{registry:t}:{}}),i?(0,b.jsx)(qr,{firstLook:i,root:us,app:Nn(g.brand,g.store.schema)}):null]}),G=v.views?(0,b.jsxs)(Ka,{store:v.store,views:v.views,...v.principal?{principal:v.principal}:{},...v.brand?{brand:v.brand}:{},...v.locale?{locale:v.locale}:{},...v.timeZone?{timeZone:v.timeZone}:{},...v.settings?{settings:v.settings}:{},...v.presence&&!p?{presence:v.presence}:{},...P?{typing:P}:{},...v.people?{people:v.people}:{},...v.seats?{seats:v.seats}:{},onSeat:z=>p?p.takeSeat(z):x({from:e.principal,seat:z}),...v.onKeepLens?{onKeepLens:v.onKeepLens}:{},...v.onExport?{onExport:v.onExport}:{},...v.ai?{ai:v.ai}:{},...v.subscriptions?{subscriptions:v.subscriptions}:{},dismissals:v.dismissals,whileAway:v.whileAway,...v.signIn?{signIn:v.signIn}:{},resolveApp:v.resolveApp??p?.resolveApp,linkedRecords:v.linkedRecords??p?.linkedRecords,...v.app?{app:v.app}:{},...v.menuSections?{menuSections:v.menuSections}:{},children:[A,(0,b.jsx)(Ko,{context:v,children:(0,b.jsx)(So,{context:v})})]}):A,H=(0,b.jsx)(Da.Provider,{value:W,children:G}),ae=v.files?(0,b.jsx)(Fa.Provider,{value:v.files,children:H}):H,J=s===void 0?ae:(0,b.jsx)(Go.Provider,{value:s,children:ae});if(a!==void 0){let z=n===void 0?a:`${n.replace(/\/$/,"")}${a}`;return(0,b.jsx)(oo,{initialEntries:[z],...n===void 0?{}:{basename:n},children:J})}return(0,b.jsx)(so,{...n===void 0?{}:{basename:n},children:J})}export{gi as a,gs as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk.CV4QA4ZF.js";import"./chunk.OYRZ2DEI.js";import{b as m}from"./chunk.7EA7THSM.js";import"./chunk.AI2HBKVP.js";import{T as p}from"./chunk.Q5IAXTF5.js";import"./chunk.SDO3U72B.js";import{U as l}from"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import{b as f}from"./chunk.AJZBJBMO.js";var a=f(p(),1);function N({states:e,definition:v}){let s=e.values.reduce((t,n)=>t+n.count,0),u=t=>t===null?"with none":m(v,e.field,t).toLowerCase(),c=e.values.filter(t=>t.count>0).map(t=>`${l(t.count)} ${u(t.value)}`).join(", ");return s===0?null:(0,a.jsx)("div",{className:"graview-district-states",role:"img","aria-label":c,title:c,children:e.values.map((t,n)=>{if(t.count===0)return null;let y=e.values.filter(r=>r.count>0).length,w=t.count/s*(168-(y-1)),o=l(t.count),i=`${o} ${u(t.value)}`,d=r=>r.length*6.2+8<=w;return(0,a.jsx)("span",{"data-graview-tier":t.tier,style:{flexGrow:t.count},title:i,children:d(i)?i:d(o)?o:""},n)})})}export{N as StatesBar};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as Z,b as qe}from"./chunk.KHRS2SKB.js";import"./chunk.NB6WN4DO.js";import"./chunk.MBNZ2HK7.js";import"./chunk.NHIPVAGR.js";import{i as De,j as Ne,k as Oe}from"./chunk.JOWJNIWH.js";import"./chunk.T2Q3AAQI.js";import"./chunk.G7XKQNOL.js";import"./chunk.7KZ44FEU.js";import"./chunk.HJCQ6I3S.js";import"./chunk.JQBP6QWQ.js";import"./chunk.I2W7HSBU.js";import"./chunk.BJL6EL6B.js";import"./chunk.Y37DXEHG.js";import{a as We,b as S}from"./chunk.DXZ5VYCQ.js";import{a as X,b as $e}from"./chunk.J2R55TM7.js";import"./chunk.DIS7JS7X.js";import"./chunk.JV7FLVUV.js";import"./chunk.VGTEEANA.js";import"./chunk.SZCZD2GM.js";import"./chunk.7FZY5E2U.js";import{b as Pe,c as Le}from"./chunk.7354O67H.js";import"./chunk.XLM4ONUB.js";import"./chunk.XOZU4OFA.js";import"./chunk.C7EEYSAM.js";import"./chunk.ZJXUWOG3.js";import"./chunk.TI4OSTQV.js";import"./chunk.FEBCIEI3.js";import"./chunk.QRCTTDDQ.js";import"./chunk.3TME4BG3.js";import"./chunk.I43ONAEL.js";import"./chunk.73EKJ4JN.js";import"./chunk.INL4OZI7.js";import"./chunk.5WU2UTP7.js";import{u as Re}from"./chunk.YKACMLLU.js";import"./chunk.OJGHDWI6.js";import"./chunk.337JMOTL.js";import"./chunk.CV4QA4ZF.js";import{l as ze}from"./chunk.OYRZ2DEI.js";import{c as Ce}from"./chunk.7EA7THSM.js";import{m as Ie}from"./chunk.AI2HBKVP.js";import{G as ot,La as J,Qa as He,T as Me,Ua as Ee,aa as O,h as Ae,u as Te}from"./chunk.Q5IAXTF5.js";import"./chunk.SDO3U72B.js";import{Cb as be,Oc as Se,la as Q,ma as N,oc as xe,qc as ke}from"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import{b as Y}from"./chunk.AJZBJBMO.js";var a=Y(ot(),1);var t=Y(Me(),1);function bt(u,r,o){let c=r.on??r.about[r.about.length-1];De(u,r.about,{...o,pins:Z(),...c===void 0?{}:{focus:c}})}function xt({placement:u="float",chosen:r=!0}={}){let{menuAt:o}=O();return u==="menu"&&o===null?r?(0,t.jsx)(at,{}):null:(0,t.jsx)(lt,{placement:u})}function at(){let{store:u,setMenuAt:r,view:o}=O(),{selection:c}=J(),h=(0,a.useRef)(null),[E,y]=(0,a.useState)(null);(0,a.useLayoutEffect)(()=>{let b=h.current?.offsetParent??h.current?.parentElement;if(!b)return;let m=Math.round(b.getBoundingClientRect().width);m!==E&&y(m)});let v=c.length===1&&!o.overview?u.graph.getNode(c[0]):void 0;return!v||E===null||E>=Be?(0,t.jsx)("span",{ref:h,hidden:!0}):(0,t.jsx)("button",{type:"button",ref:h,"data-testid":"chosen-acts","aria-label":`What can be done with ${S(u,v.id)}`,"aria-haspopup":"menu",onClick:b=>{let m=b.currentTarget.getBoundingClientRect();r({x:Math.round(m.right),y:Math.round(m.bottom+4),on:v.id})},style:{position:"absolute",right:"calc(14px + var(--graview-dock, 0px))",top:98,zIndex:"var(--graview-layer-overview, 10)",minHeight:30,padding:"0 12px",borderRadius:8,fontSize:"0.8125rem",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)"},children:"Acts\u2026"})}var Be=564;function lt({placement:u}){let{store:r,menuAt:o,setMenuAt:c,view:h,signIn:E}=O(),y=(0,a.useRef)(null),v=(0,a.useRef)(null),b=(0,a.useRef)(null),m=(0,a.useRef)(null);o?.returnTo&&(m.current=o.returnTo);let Ke=e=>{let i=e.closest("[data-graview-asking]")?.getAttribute("data-graview-asking"),n=e.getAttribute("data-pin-for"),d=i??e.getAttribute("data-affordance")??(n===null?null:`pin:${n}`)??e.getAttribute("data-menu-item");v.current=d===null?null:{key:d,element:e}};(0,a.useEffect)(()=>{let e=y.current,i=v.current;if(i===null||document.activeElement!==document.body||i.element.isConnected)return;let n=i.key;if(!e){v.current=null;let k=m.current;m.current=null,(k?.isConnected?k:b.current)?.focus();return}((n.startsWith("pin:")?e.querySelector(`[data-pin-for="${CSS.escape(n.slice(4))}"]`):null)??e.querySelector(`[data-affordance="${CSS.escape(n)}"]:not([disabled])`)??e).focus()});let[_e,je]=(0,a.useState)(null);(0,a.useLayoutEffect)(()=>{let e=y.current?.offsetParent??y.current?.parentElement;if(e instanceof HTMLElement&&(b.current=e),!e)return;let i=e.getBoundingClientRect();je(n=>n&&n.left===i.left&&n.top===i.top&&n.width===i.width&&n.height===i.height?n:{left:i.left,top:i.top,width:i.width,height:i.height})});let{selection:Ue,set:Ve,clear:Ge}=J(),s=o?.about??Ue,[q,Ye]=(0,a.useState)(()=>Z()),F=o?.on??s[s.length-1],B=o?.about,Qe=(0,a.useMemo)(()=>({pins:q,...F===void 0?{}:{focus:F},...B?{about:B}:{}}),[q,F,B]),Je=(0,a.useMemo)(()=>new Set(r.allMutations().filter(e=>e.pinned).map(e=>e.name)),[r]),{affordances:g,withheld:ee,observations:te}=Ne(Qe),I=ke(ee,E),f=I?st:ee,Xe=o===null?null:{face:o.face??"scene",on:o.on,about:s,field:o.field,place:o.place,href:o.href,act:o.act,element:o.returnTo},ne=Re(Xe),ie=te.some(e=>e.id.startsWith("schema:waits:")),{apply:Ze,preview:et}=Oe(),[C,z]=(0,a.useState)(null),[tt,re]=(0,a.useState)(!1),[oe,ae]=(0,a.useState)(!1),[L,R]=(0,a.useState)(""),nt=$e({letters:!0}),[le,K]=(0,a.useState)(null),_=(0,a.useRef)([]),j=(e,i)=>{try{return et(e,i),Ze(e,i),K(null),c(null),_.current=[],!0}catch(n){return K(ze(r.schema,r.allMutations(),n)),_.current=n instanceof be?n.issues.map(d=>String(d.path[0]??"")).filter(Boolean):[],!1}},$=[...new Set(s.flatMap(e=>{let i=r.graph.getNode(e);return i?[i.kind]:[]}))],x=$.length>0?$:[...new Set(s.flatMap(e=>Te(e)))],p=s.length===1?Ae(s[0]):null,U=p?{from:r.graph.getNode(p.from),to:r.graph.getNode(p.to)}:null,se=p?Le(r,p):void 0,de=se?.provisional?se:void 0,ue=p?(()=>{let e=r.schema.tryDefinition(r.graph.getNode(p.from)?.kind??"")?.edges?.[p.kind],i=r.graph.getNode(p.to);return e?.inverse&&i?`From ${S(r,i.id)}: ${e.inverse}`:null})():null;(0,a.useEffect)(()=>{z(null),re(!1),ae(!1),K(null),R("")},[s,o?.about]);let l=o!==null,it=u==="menu"&&!l,A=(0,a.useRef)(o);A.current=o;let pe=Ee("acts",{open:l&&u==="menu",onOpenChange:e=>{e||c(null)},at:()=>A.current?{x:A.current.x,y:A.current.y}:null,returnTo:()=>{let e=A.current?.returnTo;if(e?.isConnected)return e;let i=A.current?.on;return i?document.querySelector(`[data-graview-view="${CSS.escape(i)}"]`):null},align:"start"}),ce=(_e?.width??Number.POSITIVE_INFINITY)<Be;if((0,a.useLayoutEffect)(()=>{let e=y.current?.offsetParent;if(!e||!ce||l)return;let i=y.current?.getBoundingClientRect().height??0,n=`${Math.round(i)+20}px`;if(e.style.paddingBottom===n)return;let d=e.style.paddingBottom;return e.style.paddingBottom=n,()=>{e.style.paddingBottom=d}}),s.length===0&&!l)return null;let ge=o?.title!==void 0||s.length>0&&!(s.length===1&&s[0]===h.focusId),he=Math.max(1,Math.min(9,g.length)),T=[...g.filter(e=>e.provider==="invariant"&&!e.destructive),...g.filter(e=>e.pinned&&e.provider!=="invariant"&&!e.destructive),...g.filter(e=>!e.ties&&!e.destructive&&!e.pinned&&e.provider!=="invariant"),...g.filter(e=>e.ties&&!e.destructive&&!e.pinned&&e.provider!=="invariant"),...g.filter(e=>e.destructive)],me=T.length>he&&!l,fe=L.trim().toLowerCase(),w=me&&fe.length>0?T.filter(e=>`${e.label} ${e.why}`.toLowerCase().includes(fe)):null,V=w??(tt||l?T:T.slice(0,he)),ye=w?0:T.length-V.length,W=[];for(let e of V){let i=!l&&e.provider==="invariant",n=!l&&!i&&e.pinned!==void 0&&!e.destructive,d=!l&&!i&&!n&&e.ties===!0&&!e.destructive,k=i?e.why:n?"pinned":d?"its ties":null,D=i?"violation":n||d?"ties":null,H=W[W.length-1];H&&H.heading===k?H.items.push(e):W.push({heading:k,tone:D,items:[e]})}let G=g.find(e=>e.id===C),P=s.length===1?S(r,s[0]):null,ve=e=>{if(!P)return e;let i=e.startsWith(`"${P}"`)?e.slice(P.length+2):e.startsWith(P)?e.slice(P.length):null;if(i===null)return e;let n=i.trimStart();return n.length===0?e:n[0].toUpperCase()+n.slice(1)},rt=new Set(l?[]:V.filter(e=>e.provider==="invariant").map(e=>e.why)),M=te.filter(e=>!rt.has(e.text)).map(e=>({...e,text:ve(e.text)}));return it?null:(0,t.jsxs)("section",{...l?pe.pane:{},ref:e=>{y.current=e,l&&pe.pane.ref(e)},"aria-label":"Inspector","data-graview-offstage":"","data-testid":l?"context-menu":"inspector-strip",tabIndex:-1,onFocus:e=>Ke(e.target),onBlur:e=>{e.relatedTarget!==null&&(v.current=null)},onMouseDown:e=>e.stopPropagation(),style:{...l?He:{position:"absolute",zIndex:Se("rail")},boxSizing:"border-box",display:"flex",flexDirection:"column",gap:7,padding:"9px 12px",borderRadius:"var(--graview-radius, 12px)",border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",...l?{width:300,maxHeight:"min(52cqh, 420px)",overflow:"auto"}:ce?{left:10,right:10,width:"auto",bottom:10,maxHeight:"min(42cqh, 300px)",overflow:"auto"}:{left:14,top:h.overview?"min(296px, 38cqh)":44,width:236,maxHeight:h.overview?"calc(100cqh - min(296px, 38cqh) - 20px)":"calc(68cqh - 94px)",overflow:"auto"}},children:[(0,t.jsx)("h2",{style:{...Ie,margin:0},children:"Inspector"}),(0,t.jsxs)("div",{style:{display:ge||!l?"flex":"none",alignItems:"baseline",flexWrap:"wrap",gap:"2px 8px",minWidth:0,paddingRight:l?0:24},children:[ge?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("strong",{style:{fontSize:"0.9375rem",whiteSpace:"nowrap"},children:o?.title??(s.length===1?S(r,s[0]):`${s.length} selected`)}),$.length>0||p?(0,t.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",whiteSpace:"nowrap"},children:p?"relation":$.map(e=>N(r.schema.tryDefinition(e),e)).join(" \xB7 ")}):null,s.length===1&&!p&&o?.face!=="pages"?(0,t.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",whiteSpace:"nowrap"},children:h.expanded.includes(s[0])?"\xB7 double-click closes":"\xB7 double-click opens"}):null]}):null,(0,t.jsx)("span",{style:{flex:"1 1 auto"}})]}),l?null:(0,t.jsx)("button",{type:"button",onClick:()=>{c(null),Ge()},"aria-label":"Clear selection",title:"Clear selection",style:{position:"absolute",top:6,right:6,flex:"0 0 auto",width:24,height:24,display:"grid",placeItems:"center",padding:0,fontSize:"0.875rem",lineHeight:1,borderRadius:7},children:"\xD7"}),p&&U?(0,t.jsxs)("div",{style:{display:"grid",gap:6},children:[ue?(0,t.jsx)("p",{"data-testid":"edge-said",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:ue}):null,de?(0,t.jsx)("p",{"data-testid":"edge-provisional",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:Pe(de)}):null,(0,t.jsx)("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[["from",U.from],["to",U.to]].map(([e,i],n)=>(0,t.jsxs)(a.Fragment,{children:[n===1?(0,t.jsx)("span",{"aria-hidden":"true",style:{color:"var(--graview-ink-faint)"},children:"\u2192"}):null,i?(0,t.jsx)("button",{type:"button","data-testid":`edge-${e}`,onClick:()=>Ve([i.id]),title:`Select ${S(r,i.id)}`,style:{fontSize:"0.8125rem",padding:"3px 9px",borderRadius:6},children:S(r,i.id)}):(0,t.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink-faint)"},children:"gone"})]},e))})]}):null,!p&&s.length===1&&xe(r,s[0])?(0,t.jsx)("p",{"data-testid":"left-alone",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:"Left alone: nothing automated changes it."}):null,M.length>0?(0,t.jsx)("div",{"data-testid":"observations",title:M.map(e=>e.text).join(`
|
|
2
|
-
`),style:{display:"grid",gap:3},children:M.slice(0,2).map(e=>(0,t.jsxs)("p",{style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:[e.text,e===M[1]&&M.length>2?(0,t.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" +",M.length-2]}):null]},e.id))}):null,l?ne.start.map(e=>(0,t.jsx)(Fe,{section:e,close:()=>c(null)},e.id)):null,le?(0,t.jsx)("p",{"data-testid":"refused",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-warn)"},children:le}):null,me?(0,t.jsx)("input",{"data-testid":"action-filter",value:L,onChange:e=>R(e.target.value),placeholder:`Filter ${T.length} actions\u2026`,"aria-label":"Filter actions",onKeyDown:e=>{if(e.key==="Escape"){e.stopPropagation(),L.length>0?R(""):e.currentTarget.blur();return}if(e.key==="Enter"&&w?.length===1){let i=w[0];if(i.destructive)return;i.open.length>0?z(i.id):j(i)&&R("")}},style:{font:"inherit",fontSize:"0.875rem",padding:"5px 9px",borderRadius:8,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)"}}):null,w!==null&&w.length===0?(0,t.jsxs)("p",{"data-testid":"no-matches",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:["Nothing offered here matches \u201C",L.trim(),"\u201D."]}):null,I&&g.length===0||g.length===0&&!ie&&s.length===0?null:g.length===0&&!ie?(0,t.jsx)("p",{"data-testid":"no-affordances",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:f.length>0?`Nothing you may do with ${p?"this relation":x.length===1?Q(N(r.schema.tryDefinition(x[0]),x[0])):"this mix of kinds"} \u2014 ${f.length} action${f.length===1?"":"s"} withheld.`:p?`Nothing can be done with this line yet \u2014 nothing this app declares makes or breaks \u201C${Ce(r.schema,r.graph.getNode(p.from)?.kind??"",p.kind,"out")}\u201D.`:`Nothing can be done with ${x.length===1?Q(N(r.schema.tryDefinition(x[0]),x[0])):"this mix of kinds"} yet \u2014 nothing this app declares acts on ${x.length===1?"it":"them"}.`}):(0,t.jsxs)("ol",{...nt,"data-testid":"affordances",style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",flexWrap:"nowrap",gap:2},children:[W.map((e,i)=>(0,t.jsxs)(a.Fragment,{children:[e.heading?(0,t.jsxs)("li",{"data-graview-heading":e.tone,style:{fontSize:"0.75rem",lineHeight:1.4,color:e.tone==="violation"?"var(--graview-warn)":"var(--graview-ink-faint)",...e.tone!=="violation"?{letterSpacing:"0.12em",textTransform:"uppercase",fontSize:"0.75rem"}:{},padding:"2px 2px 1px",marginTop:i>0?6:0},children:[e.tone==="violation"?"\u26A0 ":"",e.tone==="violation"?ve(e.heading):e.heading]}):i>0?(0,t.jsx)("li",{"aria-hidden":"true",style:{borderTop:"1px solid var(--graview-edge)",margin:"6px 0 3px"}}):null,e.items.map(n=>(0,t.jsxs)("li",{style:{display:"flex",gap:2,alignItems:"stretch"},onKeyDown:d=>{if(d.metaKey||d.ctrlKey||d.altKey)return;let k=d.currentTarget.querySelector("[data-affordance]"),D=d.currentTarget.querySelector("[data-pin-for]"),H=d.target===D,we=d.key==="ArrowRight"&&!H?D:H&&["ArrowLeft","ArrowUp","ArrowDown"].includes(d.key)?k:null;we&&(d.preventDefault(),d.stopPropagation(),we.focus())},children:[(0,t.jsxs)("button",{type:"button",[X]:"","data-affordance":n.id,"data-rank":n.rank,"data-graview-destructive":n.destructive||void 0,"aria-pressed":C===n.id,title:n.why,style:{padding:"5px 10px",fontSize:"0.875rem",borderRadius:8,width:"100%",textAlign:"left",borderWidth:1,borderStyle:"solid",borderColor:C===n.id?"var(--graview-accent)":l?"transparent":"var(--graview-edge)",background:l?"none":"var(--graview-panel)",boxShadow:"none",...n.destructive?{color:"var(--graview-warn)"}:{},...C===n.id?{color:"var(--graview-accent)"}:{}},onClick:()=>{if(n.open.length>0){z(C===n.id?null:n.id);return}j(n)},children:[n.label,n.open.length>0?(0,t.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:" \u2026"}):null,w?.length===1&&w[0]?.id===n.id&&!n.destructive?(0,t.jsx)("span",{"aria-hidden":"true",title:"Enter runs it",style:{float:"right",color:"var(--graview-ink-faint)",fontSize:"0.75rem"},children:"\u21B5"}):null]}),(0,t.jsx)("button",{type:"button","data-testid":"pin-toggle",tabIndex:-1,"data-pin-for":n.mutation,"aria-pressed":n.pinned!==void 0,"aria-label":n.pinned!==void 0?`Unpin ${n.label}`:`Pin ${n.label}`,title:n.pinned==="declared"?"Pinned by the app \u2014 unpin it for yourself":n.pinned==="user"?"Unpin":"Pin to the top",onClick:()=>Ye(qe(q,n.mutation,Je.has(n.mutation))),style:{flex:"0 0 auto",width:24,minHeight:24,display:"grid",placeItems:"center",padding:0,fontSize:"0.75rem",border:"1px solid transparent",background:"none",boxShadow:"none",borderRadius:7,color:n.pinned==="user"?"var(--graview-accent)":n.pinned==="declared"?"var(--graview-ink-muted)":"var(--graview-ink-faint)"},children:n.pinned!==void 0?"\u2605":"\u2606"})]},n.id))]},`${e.heading??"plain"}-${i}`)),ye>0?(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button",[X]:"",onClick:()=>re(!0),title:`Show all ${g.length} actions`,style:{padding:"4px 10px",fontSize:"0.875rem",borderRadius:8},children:["Show ",ye," more"]})}):null]}),I?(0,t.jsx)("button",{type:"button","data-testid":"sign-in",onClick:()=>{c(null),I.run()},style:{padding:"5px 10px",fontSize:"0.875rem",borderRadius:8,width:"100%",textAlign:"left"},children:I.label}):null,f.length>0?(0,t.jsxs)("ul",{"data-testid":"withheld",style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",flexWrap:"nowrap",gap:2},children:[f.slice(0,l||oe?f.length:3).map(e=>(0,t.jsxs)("li",{style:{display:"grid",gap:2},children:[(0,t.jsx)("button",{type:"button",disabled:!0,"data-affordance":e.id,"data-rank":e.rank,"data-withheld":e.refusal.wouldNeed.join(",")||"nobody",style:{padding:"4px 10px",fontSize:"0.875rem",borderRadius:8,borderStyle:"dashed",width:"100%",textAlign:"left",background:"none"},children:(0,t.jsx)("s",{children:e.label})}),(0,t.jsx)("span",{"data-testid":"withheld-why",style:{fontSize:"0.8125rem",lineHeight:1.4,color:"var(--graview-ink-muted)",padding:"0 10px"},children:e.refusal.message})]},e.id)),!l&&!oe&&f.length>3?(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button","data-testid":"withheld-more",onClick:()=>ae(!0),title:`Show all ${f.length} actions this seat may not take`,style:{padding:"4px 10px",fontSize:"0.875rem",borderRadius:8},children:["Show ",f.length-3," more withheld"]})}):null]}):null,l?ne.end.map(e=>(0,t.jsx)(Fe,{section:e,close:()=>c(null)},e.id)):null,G?(0,t.jsx)(We,{affordance:G,onApply:e=>{if(j(G,e))z(null);else return _.current},onCancel:()=>z(null)}):null]})}var st=[];function Fe({section:u,close:r}){return(0,t.jsxs)("div",{"data-menu-section":u.id,...u.heading?{role:"group","aria-label":u.heading}:{},style:{display:"grid",gap:2,borderTop:"1px solid var(--graview-edge)",paddingTop:5},children:[u.heading?(0,t.jsx)("p",{"aria-hidden":"true",style:{margin:0,padding:"2px 2px 1px",fontSize:"0.75rem",lineHeight:1.4,letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:u.heading}):null,u.items&&u.items.length>0?(0,t.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",gap:2},children:u.items.map(o=>(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button","data-menu-item":o.id,onClick:()=>{r(),o.run()},style:{padding:"5px 10px",fontSize:"0.875rem",borderRadius:8,width:"100%",textAlign:"left",borderWidth:1,borderStyle:"solid",borderColor:"transparent",background:"none",boxShadow:"none"},children:[o.label,o.hint?(0,t.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",o.hint]}):null]})},o.id))}):null,u.render?.(r)]})}export{xt as InspectorPane,bt as prepareActs};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j,k}from"./chunk.BJL6EL6B.js";import"./chunk.SZCZD2GM.js";import"./chunk.C7EEYSAM.js";import"./chunk.QRCTTDDQ.js";import"./chunk.3TME4BG3.js";import"./chunk.I43ONAEL.js";import"./chunk.73EKJ4JN.js";import"./chunk.INL4OZI7.js";import"./chunk.5WU2UTP7.js";import"./chunk.OYRZ2DEI.js";import"./chunk.7EA7THSM.js";import"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import"./chunk.AJZBJBMO.js";export{g as columnActs,d as columnChoices,c as columnMoves,b as columnOf,e as columnReach,f as columnSteps,j as describePlace,k as placeText,h as resolveFor,i as shadowedPageSlots,a as statusColumns};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{d as C,e as re}from"./chunk.G7XKQNOL.js";import{e as ee}from"./chunk.7KZ44FEU.js";import{b as S}from"./chunk.7EA7THSM.js";import{m as X}from"./chunk.AI2HBKVP.js";import{Fa as V,G as se,Qa as J,T as Z,Ua as Q}from"./chunk.Q5IAXTF5.js";import{a as K}from"./chunk.SDO3U72B.js";import{O as Y,U as M,da as U}from"./chunk.VOHRQXCF.js";import{b as D}from"./chunk.AJZBJBMO.js";var h=D(se(),1);var n=D(Z(),1),Oe=9,le=40,ge=2;function de(e){let r=new Map;for(let i of e.allNodes())r.set(i.kind,(r.get(i.kind)??0)+1);return r}var ue=(e,r)=>(e.far??[]).reduce((i,a)=>i+(r.get(a)??0),0);function ce(e,r,i){if(i)return i.flatMap(s=>e.filters.filter(u=>u.key===s));let a=de(r),o=new Set(e.filters.filter(s=>s.about==="edge"&&ue(s,a)>le).map(s=>s.key));return e.filters.filter(s=>s.about==="edge"?!o.has(s.key):s.about==="via"?o.has(s.key.split(".")[0]):!0)}function pe(e,r){let i=e.filter(a=>a.about==="field"&&a.type==="choice"&&(a.options?.length??0)>0);return r?i:i.slice(0,ge)}var fe=520;function ye(e,r,i,a){let o=i.filters.find(s=>s.key===a.key);if(!o)return`${a.key}: ${a.value}`;if(o.about==="is")return a.value.charAt(0).toUpperCase()+a.value.slice(1);if(o.about==="via")return`${o.label}: ${S(e.tryDefinition(o.far?.[0]??""),o.key.split(".")[1],a.value)}`;if(o.about==="edge"){if(a.value==="*")return`${o.label}: anything`;if(a.value==="none")return`${o.label}: nothing`;let s=r.getNode(a.value);return`${o.label}: ${s?U(e.tryDefinition(s.kind),s):a.value}`}if(o.type==="date"){let[s,u]=a.value.split(":");return`${o.label} ${s} ${u?Y(u):""}`.trim()}if(o.type==="boolean")return`${o.label}: ${a.value==="true"?"yes":"no"}`;if(o.type==="number"){let s=a.value.lastIndexOf(":"),u=a.value.slice(0,Math.max(0,s));if(u==="at-most"||u==="at-least")return`${o.label}: ${u==="at-most"?"at most":"at least"} ${S(e.tryDefinition(i.kind),o.key,Number(a.value.slice(s+1)))}`}return o.type==="text"?`${o.label}: ${a.value}`:`${o.label}: ${S(e.tryDefinition(i.kind),o.key,a.value)}`}var P=e=>/^[A-Z][a-z]/.test(e)?e.charAt(0).toLowerCase()+e.slice(1):e;function me(e){return e?.type==="date"?{asc:"Earliest first",desc:"Latest first"}:e?.type==="number"?{asc:"Lowest first",desc:"Highest first"}:e?.type==="boolean"?{asc:"No first",desc:"Yes first"}:e?.type==="choice"?{asc:"In their order",desc:"In reverse order"}:{asc:"A to Z",desc:"Z to A"}}var x=V(K(()=>(__graviewPreload(import.meta.url,["./chunk.63SRVTG2.js","./chunk.C4EPMV7O.js","./chunk.G7XKQNOL.js","./chunk.7KZ44FEU.js","./chunk.CV4QA4ZF.js","./chunk.OYRZ2DEI.js","./chunk.7EA7THSM.js","./chunk.AI2HBKVP.js","./chunk.Q5IAXTF5.js","./chunk.SDO3U72B.js","./chunk.VOHRQXCF.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.DVLWSCIC.js")))),N=x.part((e,r)=>(0,n.jsx)(e.ArrangeLists,{...r}),{what:"This list",quiet:!0}),he=x.part((e,r)=>(0,n.jsx)(e.ArrangeChips,{...r}),{what:"This list",quiet:!0}),Te=()=>x.load(),q=new Map;function Ie(e){let{schema:r,graph:i,kind:a,arrangement:o,onChange:s}=e,u=e.offers??ee(r,a),g=e.testId??"arrange",y=C(e.allow,"sort")&&u.sorts.length>1,m=C(e.allow,"group")&&u.groups.length>0,F=C(e.allow,"filter")?ce(u,i,e.filters):[],L=e.chips?pe(F,e.filters):[],H=F.filter(t=>!L.includes(t)),G=H.length>0,_=e.query!==!1&&e.allow!==!1,w=we(e.noun,e.kept),v=e.past&&e.past.count>0?e.past:null;if(!y&&!m&&!G&&!_&&!w&&!v)return null;let z=t=>JSON.stringify(re(t)),R=`${g}|${a}`,p={current:q.get(R)??{words:new Set,latest:null,at:0}};q.set(R,p.current),p.current.latest&&Date.now()-p.current.at>1500&&!p.current.words.has(z(o))&&(p.current={words:new Set,latest:null,at:0},q.set(R,p.current));let d=p.current.latest??o,b=t=>{let l={...p.current.latest??o,...t};for(let c of Object.keys(l))l[c]===void 0&&delete l[c];p.current.latest=l,p.current.at=Date.now(),p.current.words.add(z(l)),s(l)},f=d.filter??[],O=t=>{let l=f.filter((c,I)=>I!==t);b({filter:l.length>0?l:void 0})},A=t=>f.some(l=>l.key===t.key&&l.value===t.value),te=t=>A(t)?O(f.findIndex(l=>l.key===t.key&&l.value===t.value)):b({filter:[...f,t]}),T=d.sort?u.sorts.find(t=>t.key===d.sort.by):void 0,j=d.group?u.groups.find(t=>t.key===d.group.by):void 0,ne=me(T),k={schema:r,graph:i,offers:{...u,filters:H},arrangement:d,set:b,toggle:te,has:A,testId:g},ae=(t,l)=>A({key:t,value:l})?O(f.findIndex(c=>c.key===t&&c.value===l)):b({filter:[...f.filter(c=>c.key!==t),{key:t,value:l}]}),oe=d.sort?(0,n.jsxs)(n.Fragment,{children:["Sorted by ",P(T?.label??d.sort.by),(0,n.jsx)("span",{"aria-hidden":"true",children:d.sort.direction==="desc"?" \u2193":" \u2191"})]}):"Sort",ie=d.group?.bucket&&j?.buckets?`, a ${d.group.bucket} each`:"",B=d.group?`Grouped by ${P(j?.label??d.group.by)}${ie}`:"Group";return(0,n.jsxs)("div",{"data-testid":`${g}-bar`,role:"group","aria-label":"Arrange",className:"graview-arrange",style:e.style,onPointerEnter:x.prefetch,onFocus:x.prefetch,children:[(0,n.jsx)("style",{children:xe}),(0,n.jsxs)("div",{className:"graview-arrange-line",children:[w?(0,n.jsxs)("span",{className:"graview-arrange-count","data-testid":`${g}-count`,children:[w.kept?(0,n.jsx)("span",{"data-testid":`${g}-kept`,children:w.kept}):null,w.words]}):null,v?(0,n.jsxs)("button",{type:"button",className:"graview-arrange-open","data-testid":`${g}-past`,title:`${M(v.count)} more behind the horizon \u2014 press to widen the view to the past`,onClick:t=>{let l=t.currentTarget.closest("[data-graview-view]"),c=t.currentTarget;v.widen();let I=0,W=()=>{if(document.activeElement!==c&&document.activeElement!==document.body&&c.isConnected)return;let $=l?.querySelector('[role="group"][aria-label="Arrange"] :is(button, input)');if($&&$!==c&&$.isConnected)return $.focus({preventScroll:!0});++I<120&&requestAnimationFrame(W)};requestAnimationFrame(W)},children:["+",M(v.count)," past"]}):null,f.map((t,l)=>{let c=ye(r,i,u,t);return(0,n.jsxs)("span",{className:"graview-arrange-token","data-testid":`${g}-condition`,children:[c,(0,n.jsx)("button",{type:"button","aria-label":`Remove: ${c}`,title:"Remove",onClick:()=>O(l),children:"\xD7"})]},`${t.key}:${t.value}`)}),y?(0,n.jsx)("span",{className:"graview-arrange-part graview-arrange-one",children:(0,n.jsx)(E,{testId:`${g}-sort`,value:d.sort?.by??"",set:d.sort!==void 0,label:"Sort",name:d.sort?`Sorted by ${P(T?.label??d.sort.by)}, ${ne[d.sort.direction].toLowerCase()}`:"Sort",list:t=>(0,n.jsx)(N,{which:"sort",done:t,...k}),children:oe})}):null,m?(0,n.jsx)("span",{className:"graview-arrange-part graview-arrange-one",children:(0,n.jsx)(E,{testId:`${g}-group`,value:d.group?.by??"",set:d.group!==void 0,label:"Group",name:B,list:t=>(0,n.jsx)(N,{which:"group",done:t,...k}),children:B})}):null,G?(0,n.jsx)("span",{className:"graview-arrange-part",children:(0,n.jsx)(E,{testId:`${g}-add`,value:"",set:!1,label:"Filter",name:f.length>0?`Filter \u2014 ${f.length} on`:"Filter",list:t=>(0,n.jsx)(N,{which:"filter",done:t,...k}),children:"Filter"})}):null,y||m?(0,n.jsx)("span",{className:"graview-arrange-part graview-arrange-all",children:(0,n.jsx)(E,{testId:`${g}-all`,value:"",set:!1,label:"Arrange",name:"Arrange: sort and group",list:t=>(0,n.jsx)(N,{which:"all",done:t,parts:{sort:y,group:m,filter:!1},...k}),children:"Arrange"})}):null,_?(0,n.jsxs)("label",{className:"graview-arrange-words-at",children:[(0,n.jsx)("span",{style:X,children:"Find"}),(0,n.jsx)("input",{type:"search",className:"graview-arrange-words","data-testid":`${g}-query`,value:d.query??"",placeholder:"Find\u2026",onChange:t=>b({query:t.target.value.length>0?t.target.value:void 0})})]}):null,L.length>0&&e.chips?(0,n.jsx)(h.Suspense,{fallback:null,children:(0,n.jsx)(he,{offers:L,chips:e.chips,schema:r,graph:i,kind:a,arrangement:d,has:A,choose:ae,testId:g})}):null,e.end]})]})}function we(e,r){if(!r)return null;let i=r.shown!==r.of;if(!e)return i?{words:"",kept:`${r.shown} of ${r.of}`}:null;let a=r.of===1?e.one:e.many;return i?{words:` ${a}`,kept:`${r.shown} of ${r.of}`}:{words:`${r.of} ${a}`}}function E({testId:e,value:r,set:i,label:a,name:o,list:s,children:u}){let g=Q("arrange",{align:"start"}),y=(0,h.useRef)(null);return(0,h.useEffect)(()=>{g.open&&y.current?.querySelector('[aria-pressed="true"]')?.focus({preventScroll:!0})},[g.open]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("button",{type:"button",className:"graview-arrange-open","data-testid":e,"data-set":i?"":void 0,value:r,"aria-label":o,...g.trigger,onClick:g.toggle,children:[u,(0,n.jsx)(be,{})]}),g.open?(0,n.jsx)("div",{...g.pane,ref:m=>{g.pane.ref(m),y.current=m},role:"group","aria-label":a,"data-testid":"arrange-list","data-arrange":e,className:"graview-arrange-list",style:J,onKeyDown:ve,children:s(()=>g.setOpen(!1))}):null]})}function ve(e){if(!["ArrowDown","ArrowUp","Home","End"].includes(e.key))return;let r=[...e.currentTarget.querySelectorAll("button:not([disabled]), input")];if(r.length===0)return;let i=r.indexOf(document.activeElement);if(document.activeElement instanceof HTMLInputElement&&document.activeElement.type==="date"&&(e.key==="ArrowUp"||e.key==="ArrowDown"))return;e.preventDefault();let a=e.key==="Home"?0:e.key==="End"?r.length-1:e.key==="ArrowDown"?(i+1)%r.length:(i-1+r.length)%r.length;r[a].focus()}function be(){return(0,n.jsx)("svg",{width:"9",height:"9",viewBox:"0 0 10 10","aria-hidden":"true",focusable:"false",style:{flex:"0 0 auto",opacity:.7},children:(0,n.jsx)("path",{d:"M2 3.5 L5 6.5 L8 3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}var xe=`
|
|
2
|
-
.graview-arrange{container-type:inline-size;box-sizing:border-box;width:100%;min-width:0;max-width:100%}
|
|
3
|
-
.graview-arrange-line{display:flex;flex-wrap:wrap;align-items:center;gap:2px 6px;min-width:0;font-size:.875rem;line-height:1.35;color:var(--graview-ink-muted)}
|
|
4
|
-
.graview-arrange-count{margin-right:2px;color:var(--graview-ink-muted)}
|
|
5
|
-
.graview-arrange-part{display:inline-flex;align-items:center;min-width:0}
|
|
6
|
-
.graview-arrange-count~.graview-arrange-part::before{content:"\xB7" / "";margin-right:6px;color:var(--graview-ink-muted)}
|
|
7
|
-
.graview-arrange-open{display:inline-flex;align-items:center;gap:5px;min-height:28px;min-width:0;max-width:100%;margin:0;padding:0 6px;border:1px solid transparent;border-radius:7px;background:none;box-shadow:none;font:inherit;letter-spacing:normal;text-transform:none;text-align:left;color:var(--graview-ink-muted);cursor:pointer}
|
|
8
|
-
.graview-arrange-open[data-set]{color:var(--graview-ink)}
|
|
9
|
-
.graview-arrange-open:hover,.graview-arrange-open[aria-expanded=true]{border-color:var(--graview-edge);color:var(--graview-ink)}
|
|
10
|
-
.graview-arrange :focus-visible,.graview-arrange-list :focus-visible{outline:2px solid var(--graview-accent);outline-offset:1px}
|
|
11
|
-
.graview-arrange-all{display:none}
|
|
12
|
-
@container (max-width: ${fe-1}px){.graview-arrange-one{display:none}.graview-arrange-all{display:inline-flex}}
|
|
13
|
-
.graview-arrange-token{display:inline-flex;align-items:center;gap:0;min-width:0;min-height:26px;box-sizing:border-box;padding:0 2px 0 10px;border:1px solid var(--graview-edge);border-radius:999px;background:var(--graview-panel);color:var(--graview-ink);overflow-wrap:anywhere}
|
|
14
|
-
.graview-arrange-token button{display:inline-flex;align-items:center;justify-content:center;min-width:24px;min-height:24px;margin:0;padding:0;border:0;border-radius:6px;background:none;font:inherit;line-height:1;color:var(--graview-ink-muted);cursor:pointer}
|
|
15
|
-
.graview-arrange-token button:hover{color:var(--graview-ink);background:color-mix(in srgb,var(--graview-ink) 7%,transparent)}
|
|
16
|
-
.graview-arrange-words-at{display:inline-flex;min-width:0;max-width:100%}
|
|
17
|
-
.graview-arrange-words{box-sizing:border-box;width:min(100%,12rem);min-height:28px;margin:0;padding:0 8px;border:1px solid transparent;border-radius:7px;background:transparent;font:inherit;color:var(--graview-ink)}
|
|
18
|
-
.graview-arrange-words:hover,.graview-arrange-words:focus{border-color:var(--graview-edge)}
|
|
19
|
-
`;function De(e){let r=[];return e.query&&r.push(`\u201C${e.query}\u201D`),e.filter?.length&&r.push(`${e.filter.length} condition${e.filter.length===1?"":"s"}`),e.group&&r.push(`by ${e.group.by}`),e.sort&&r.push(`sorted by ${e.sort.by}`),r.length>0?r.join(" \xB7 "):null}export{Oe as a,le as b,ge as c,de as d,ue as e,ce as f,pe as g,fe as h,ye as i,P as j,me as k,Te as l,Ie as m,De as n};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{b as v}from"./chunk.GL3YVGAP.js";import"./chunk.AI2HBKVP.js";import{G as S,S as y,T as b}from"./chunk.Q5IAXTF5.js";import"./chunk.SDO3U72B.js";import"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import{b as u}from"./chunk.AJZBJBMO.js";var r=u(S(),1);var t=u(b(),1);function E(o){let a=(0,r.useContext)(y),l=(0,t.jsx)(C,{...o});return!a||o.nodeId===void 0?l:(0,t.jsx)(P,{nodeId:o.nodeId,field:o.field,label:o.label,...o.markdown?{markdown:!0}:{},live:a,onDone:d=>o.onDone?o.onDone(d):o.onCancel(),writtenWhole:l})}var P=(0,r.lazy)(()=>(__graviewPreload(import.meta.url,["./chunk.GL3YVGAP.js","./chunk.AI2HBKVP.js","./chunk.Q5IAXTF5.js","./chunk.SDO3U72B.js","./chunk.VOHRQXCF.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.Q3XKNZQW.js")));function C({field:o,label:a,value:l,markdown:d,onSave:s,onCancel:c}){let[i,h]=(0,r.useState)(l),[n,w]=(0,r.useState)(!1),f=(0,r.useRef)(null);return(0,r.useEffect)(()=>f.current?.focus(),[n]),(0,r.useLayoutEffect)(()=>{let e=f.current;if(!e||n||typeof CSS<"u"&&CSS.supports?.("field-sizing","content"))return;let p=()=>{e.style.height="auto";let m=getComputedStyle(e);e.style.height=`${e.scrollHeight+parseFloat(m.borderTopWidth)+parseFloat(m.borderBottomWidth)}px`};p();let x=requestAnimationFrame(p);return()=>cancelAnimationFrame(x)},[i,n]),(0,t.jsxs)("form",{style:{display:"grid",gap:8,minWidth:0},onSubmit:e=>{e.preventDefault(),s(i,!1)},children:[n?(0,t.jsx)("div",{"data-graview-preview":o,"aria-label":`${a}, as it will read`,role:"region",style:k,children:(0,t.jsx)(v,{text:i,markdown:!0})}):(0,t.jsx)("textarea",{ref:f,"aria-label":a,"data-graview-field":o,value:i,rows:3,onChange:e=>h(e.target.value),onKeyDown:e=>{e.key==="Escape"?(e.preventDefault(),c()):e.key==="Enter"&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),s(i,!1))},onBlur:e=>{e.relatedTarget instanceof Node&&e.currentTarget.form?.contains(e.relatedTarget)||s(i,!0)},style:T}),(0,t.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:8},children:[(0,t.jsx)("button",{type:"submit",style:g,children:"Save"}),(0,t.jsx)("button",{type:"button",onClick:c,style:g,children:"Cancel"}),d?(0,t.jsx)("button",{type:"button","aria-pressed":n,onClick:()=>w(!n),style:g,children:n?"Write":"Preview"}):null,(0,t.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:"Ctrl or \u2318 Enter saves \xB7 Esc puts it back"})]})]})}var k={minHeight:"7.5em",padding:"8px 10px",border:"1px dashed var(--graview-edge-bright)",borderRadius:6,lineHeight:1.6,minWidth:0},g={font:"inherit",fontSize:"0.8125rem",minHeight:28,padding:"2px 12px"},T={font:"inherit",lineHeight:1.5,width:"100%",boxSizing:"border-box",minHeight:"7.5em",padding:"8px 10px",resize:"vertical",fieldSizing:"content",color:"var(--graview-ink)",background:"var(--graview-panel, transparent)",border:"1px solid var(--graview-edge-bright)",borderRadius:6};export{E as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{d as be,f as ke}from"./chunk.7XJ3XQZD.js";import{e as ht}from"./chunk.T2Q3AAQI.js";import{a as ft,b as wt}from"./chunk.C4EPMV7O.js";import{h as mt}from"./chunk.G7XKQNOL.js";import{a as ae,b as nt}from"./chunk.KPUX27ZT.js";import{b as we,c as X,d as J,e as rt,f as ot}from"./chunk.DIS7JS7X.js";import{a as vt,d as St,f as bt}from"./chunk.D2T563AA.js";import{a as Se,b as pt}from"./chunk.JV7FLVUV.js";import{a as Ce,b as yt}from"./chunk.GL3YVGAP.js";import{d as st,e as ie,f as j,g as lt,h as ye,i as dt,k as ct,l as re}from"./chunk.QRCTTDDQ.js";import{j as gt,o as ve}from"./chunk.YKACMLLU.js";import{c as ut}from"./chunk.337JMOTL.js";import{c as it,d as Pe}from"./chunk.OYRZ2DEI.js";import{c as at}from"./chunk.7EA7THSM.js";import{$ as Qe,Fa as he,G as U,Ha as tt,La as Ne,Ma as fe,Na as Re,T as I,V as Ze,aa as V,ca as ue,j as je,ja as et,ka as _,l as qe,la as pe,m as Ue,r as ne,sa as me,v as Xe,y as Je,z as Ye}from"./chunk.Q5IAXTF5.js";import{a as ge}from"./chunk.SDO3U72B.js";import{U as Q,da as $,fa as ee,lb as _e,ma as H,rc as te}from"./chunk.VOHRQXCF.js";import{b as L}from"./chunk.AJZBJBMO.js";var f=L(U(),1);var kt=L(U(),1);function xt(e){(0,kt.useLayoutEffect)(()=>{let n=e.current,t=n?.parentElement;if(!n||!t)return;let a=n.style.bottom,o=()=>{let d=t.querySelector(Ft);if(!d){n.style.bottom=a;return}let u=t.getBoundingClientRect(),m=d.getBoundingClientRect(),g=u.height>0?t.offsetHeight/u.height:1;n.style.bottom=`${Math.max(0,Math.round((u.bottom-m.top)*g))}px`};if(o(),typeof ResizeObserver>"u")return;let s=new ResizeObserver(o);return s.observe(t),()=>s.disconnect()},[e])}var Ft=".graview-spec-listing";var $e=L(U(),1);var P=L(U(),1);var Nt=L(U(),1);var B=L(I(),1);function Rt({id:e,max:n=8,empty:t,hide:a}){let{store:o}=V();ue();let s=_t(o,e,o.violations()),[d,u]=(0,Nt.useState)(()=>new Set),m=a?s.flatMap(g=>{let w=g.ids.filter(r=>!a.has(r));return w.length>0?[{...g,ids:w}]:[]}):s;return m.length===0?t&&s.length===0?(0,B.jsx)("p",{style:{margin:0,fontSize:"0.875rem",color:"var(--graview-ink-faint)"},children:t}):null:(0,B.jsx)("div",{"data-graview-primitive":"connections",style:{display:"flex",flexDirection:"column",gap:12},children:m.map(g=>{let w=d.has(g.key),r=g.ids.length>n,c=w?g.ids:g.ids.slice(0,n),y=g.ids.length-Math.min(n,g.ids.length),k=`graview-more-${e}-${g.key}`.replace(/[^A-Za-z0-9_-]/g,"-");return(0,B.jsxs)("section",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,B.jsx)("h2",{...g.said?{"aria-label":g.said}:{},style:{margin:0,fontSize:"0.75rem",fontWeight:600,letterSpacing:"0.09em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:g.label}),(0,B.jsxs)("div",{id:k,style:{display:"flex",flexWrap:"wrap",gap:6},children:[c.map(h=>{let S=o.graph.getNode(h);return S?(0,B.jsx)(J,{pickId:h,hue:te(S.kind),title:`Go to the ${H(o.schema.tryDefinition(S.kind),S.kind)}`,label:$(o.schema.tryDefinition(S.kind),S)},h):null}),r?(0,B.jsx)("button",{type:"button","data-graview-more":g.key,"aria-expanded":w,"aria-controls":k,...w?{}:{"aria-label":`${y} more: ${g.said??g.label}`},onClick:h=>{h.stopPropagation(),u(S=>{let b=new Set(S);return b.has(g.key)?b.delete(g.key):b.add(g.key),b})},style:Kt,children:w?"Show fewer":`+${y} more`}):null]})]},g.key)})})}var Kt={display:"inline-flex",alignItems:"center",alignSelf:"flex-start",minHeight:24,boxSizing:"border-box",padding:"3px 9px",borderRadius:6,border:"1px solid var(--graview-edge)",background:"var(--graview-panel-muted)",color:"var(--graview-accent)",font:"inherit",fontSize:"0.8125rem",lineHeight:1.5,whiteSpace:"nowrap",cursor:"pointer"};function _t(e,n,t=[]){let a=e.graph.getNode(n);if(!a)return[];let o=new Map,s=[];for(let d of t)if(d.subjectId===n)for(let u of d.nodeIds)u!==n&&!s.includes(u)&&e.graph.has(u)&&s.push(u);s.length>0&&o.set("judges",{key:"judges",label:"what it finds wrong",ids:s});for(let d of e.graph.allEdges()){let u=d.from===n?d.to:d.to===n?d.from:null;if(u===null||u===n)continue;let m=e.graph.getNode(u);if(!m)continue;let g=d.from===n?"out":"in",w=g==="out"?a.kind:m.kind,r=jt(e.schema,w,d.kind,g),c=`${d.kind}:${g}:${r.label}`,y=o.get(c)??{key:c,...r,ids:[]};y.ids.includes(u)||y.ids.push(u),o.set(c,y)}for(let d of o.values())d.ids.sort();return[...o.values()].sort((d,u)=>d.key<u.key?-1:d.key>u.key?1:0)}function jt(e,n,t,a){let o=at(e,n,t,a),s=ee(t).toLowerCase();return o.trim().toLowerCase()!==s?{label:o}:a==="out"?{label:`\u2192 ${s}`,said:s}:{label:`\u2190 ${s}`,said:`${s}, pointing here`}}var Pt=L(U(),1),oe=(0,Pt.createContext)(null);var l=L(I(),1),qt=he(ge(()=>(__graviewPreload(import.meta.url,["./chunk.63SRVTG2.js","./chunk.C4EPMV7O.js","./chunk.G7XKQNOL.js","./chunk.7KZ44FEU.js","./chunk.CV4QA4ZF.js","./chunk.OYRZ2DEI.js","./chunk.7EA7THSM.js","./chunk.AI2HBKVP.js","./chunk.Q5IAXTF5.js","./chunk.SDO3U72B.js","./chunk.VOHRQXCF.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.NQPNK6I5.js")))).part((e,n)=>(0,l.jsx)(e.ArrangeBar,{...n}),{what:"Arranging this list"}),Ut=he(ge(()=>(__graviewPreload(import.meta.url,["./chunk.R6FHEEJ7.js","./chunk.LESRQN3Y.js","./chunk.7UJZP3YK.js","./chunk.R77TACXU.js","./chunk.JOWJNIWH.js","./chunk.6JERQFZI.js","./chunk.7XJ3XQZD.js","./chunk.52J42KR5.js","./chunk.T2Q3AAQI.js","./chunk.63SRVTG2.js","./chunk.C4EPMV7O.js","./chunk.G7XKQNOL.js","./chunk.7KZ44FEU.js","./chunk.HJCQ6I3S.js","./chunk.JQBP6QWQ.js","./chunk.I2W7HSBU.js","./chunk.BJL6EL6B.js","./chunk.DXZ5VYCQ.js","./chunk.J2R55TM7.js","./chunk.KPUX27ZT.js","./chunk.DIS7JS7X.js","./chunk.D2T563AA.js","./chunk.JV7FLVUV.js","./chunk.GL3YVGAP.js","./chunk.4LI73QOY.js","./chunk.G4JJXA63.js","./chunk.VGTEEANA.js","./chunk.SZCZD2GM.js","./chunk.7FZY5E2U.js","./chunk.7354O67H.js","./chunk.XLM4ONUB.js","./chunk.XOZU4OFA.js","./chunk.C7EEYSAM.js","./chunk.Q5WEOX3Q.js","./chunk.CHMUL36A.js","./chunk.U6PCKJ26.js","./chunk.FEBCIEI3.js","./chunk.WVUJXDXZ.js","./chunk.QRCTTDDQ.js","./chunk.3TME4BG3.js","./chunk.I43ONAEL.js","./chunk.73EKJ4JN.js","./chunk.INL4OZI7.js","./chunk.5WU2UTP7.js","./chunk.GZHZLJBF.js","./chunk.YKACMLLU.js","./chunk.OJGHDWI6.js","./chunk.337JMOTL.js","./chunk.CV4QA4ZF.js","./chunk.OYRZ2DEI.js","./chunk.7EA7THSM.js","./chunk.AI2HBKVP.js","./chunk.Q5IAXTF5.js","./chunk.SDO3U72B.js","./chunk.VOHRQXCF.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.Z2UFPOAN.js")))).part((e,n)=>(0,l.jsx)(e.KindStop,{...n}),{what:"This list"});function Ae(e){let{brand:n}=V();return te(e,n?.accents)}function Xt(e,n){if(!n.endsWith("\u2026")&&!n.endsWith("..."))return;let t=n.replace(/[…]|\.\.\.$/g,"").trim();if(!(t.length<12)){for(let a of Object.values(e))if(typeof a=="string"&&a.length>t.length&&a.startsWith(t))return a}}function Jt(e,n){let a=Math.max(0,...e.slice(0,n*2).map(s=>s.length))*7.5+28<=212/2?2:1,o=n*a;return{columns:a,shown:Math.min(e.length,o)}}var Yt=8,Ct=500,Zt=12;function $t(e){return{x:e.clientX,y:e.clientY,pointerType:e.pointerType??""}}function Qt(e,n,t){let a=performance.now()+Ct,o=["pointerdown","pointerup","mousedown","mouseup","dblclick"],s=r=>{if(performance.now()>a||!(r instanceof MouseEvent))return!1;let c=$t(r);return n.pointerType&&c.pointerType&&n.pointerType!==c.pointerType?!1:Math.hypot(c.x-n.x,c.y-n.y)<=Zt},d=r=>{if(!s(r))return g();r.stopPropagation()},u=r=>{if(!s(r))return g();r.stopPropagation(),r.preventDefault(),e.removeEventListener("click",u,!0),setTimeout(g,50),t()},m=!1,g=()=>{if(!m){m=!0,clearTimeout(w),e.removeEventListener("click",u,!0);for(let r of o)e.removeEventListener(r,d,!0)}};for(let r of o)e.addEventListener(r,d,!0);e.addEventListener("click",u,!0);let w=setTimeout(g,Ct)}function en({View:e,members:n,mode:t,flagged:a}){let{isSelected:o}=Ne(),s=n.slice(0,Yt);return(0,l.jsxs)("div",{"data-graview-rows":"",style:{display:"grid",gap:4,minWidth:0},children:[s.map(d=>(0,l.jsx)("div",{"data-graview-pick":d.id,style:{minWidth:0,cursor:"pointer"},children:(0,l.jsx)(e,{node:d,cardinality:"one",fidelity:"glyph",mode:t,selected:o(d.id),...a?.includes(d.id)?{flagged:[d.id]}:{}})},d.id)),n.length>s.length?(0,l.jsx)(J,{label:`+${n.length-s.length} more`}):null]})}var tn=11/15,nn=he(ge(()=>(__graviewPreload(import.meta.url,["./chunk.CV4QA4ZF.js","./chunk.OYRZ2DEI.js","./chunk.7EA7THSM.js","./chunk.AI2HBKVP.js","./chunk.Q5IAXTF5.js","./chunk.SDO3U72B.js","./chunk.VOHRQXCF.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.4VI3EYDL.js")))).part((e,n)=>(0,l.jsx)(e.StatesBar,{...n}),{quiet:!0});function an({text:e,accent:n}){let t=(0,P.useRef)(null),a=(0,P.useRef)(null),[o,s]=(0,P.useState)(1),[d,u]=(0,P.useState)(!1),m=o<1?`${o}em`:void 0;return(0,P.useLayoutEffect)(()=>{let g=t.current,w=a.current;if(!g||!w)return;let r=()=>{let y=g.clientWidth,k=w.offsetWidth;if(y<=0||k<=0)return;let h=parseFloat(getComputedStyle(w).fontSize)/parseFloat(getComputedStyle(g).fontSize)||1,S=k/h,b=Math.max(tn,Math.min(1,Math.floor(y/S*100)/100));s(N=>Math.abs(N-b)<.01?N:b),u(S*b>y+.5)};if(r(),typeof ResizeObserver>"u")return;let c=new ResizeObserver(r);return c.observe(g),()=>c.disconnect()},[e]),(0,l.jsx)("span",{ref:t,"data-graview-district-name":"",...o<1?{"data-graview-fitted":""}:{},...d?{title:e}:{},style:{display:"block",minWidth:0,fontSize:"0.9375rem",lineHeight:1.25,letterSpacing:"0.05em",textTransform:"uppercase",color:n?"var(--graview-accent)":"var(--graview-ink-muted)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:(0,l.jsx)("span",{ref:a,style:{fontSize:m},children:e})})}function At(e,n){return!!e?.display?.page?.groups?.length||Pe(n,e).some(t=>t.long)}function Vt(e,n=me(e)){for(let t of e.kinds){let a=e.tryDefinition(t),o=a?.plural??`${String(t)}s`,s=r=>{let c=r.node,y=fe(),k=(0,P.useContext)(oe);if(!c)return null;let h=k?.nodeId===c.id?k:null,S=$(a,c),b=r.mode==="fullscreen"?Xt(c,S)??S:S,N=_e(y,[c.id]);return(0,l.jsxs)(X,{title:(0,l.jsx)(bt,{nodeId:c.id,children:h?.title??b}),...h?{}:{subtitle:a?.describe?it(a,c):a?.description??String(t)},selected:r.selected,...r.flagged?.includes(c.id)?{tone:"warning"}:{},fit:!0,children:[h?(0,l.jsx)(oe.Provider,{value:null,children:h.body}):null,(0,l.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:"22px 34px",alignItems:"flex-start"},children:[(0,l.jsx)("div",{style:{flex:At(a,c)?"1 1 100%":"1 1 0",minWidth:"min(200px, 100%)"},children:(0,l.jsx)(St,{id:c.id,shown:[b,S,a?.description,h?.title],...h?{hide:[...h.fields]}:{}})}),(0,l.jsx)("div",{style:{flex:At(a,c)?"1 1 100%":"1.4 1 0",minWidth:"min(220px, 100%)"},children:(0,l.jsx)(Rt,{id:c.id,empty:`Nothing is connected to this ${H(a,String(t))} yet.`,...h?{hide:h.records}:{}})})]}),N.length>0?(0,l.jsx)("p",{"data-graview-broken":"",style:{margin:"14px 0 0",paddingTop:12,borderTop:"1px solid var(--graview-edge)",fontSize:"0.875rem",color:"var(--graview-warn)"},children:N.map(v=>v.message).join(" \xB7 ")}):null]})},d=r=>{let c=r.node;if(!c)return null;let{store:y}=V(),k=a?.computed?ct(y.schema,y.graph,c):c,h=Pe(k,a,{limit:3,said:[$(a,c)],glance:!0}),S=Ae(t),b=h.filter(x=>!x.long&&!x.markdown),N=h.find(x=>x.long||x.markdown),v=st(c,a);return(0,l.jsxs)(X,{title:$(a,c),selected:r.selected,tone:r.flagged?.includes(c.id)?"warning":"muted",fit:!0,children:[v?(0,l.jsx)(Se,{as:"thumb",file:v,size:64,style:{marginBottom:6}}):null,(0,l.jsx)(rt,{items:b.map(x=>({id:x.key,label:x.alone,hue:S})),max:3}),N?(0,l.jsx)("p",{"data-graview-excerpt":N.key,title:N.value,style:{margin:b.length>0?"6px 0 0":0,fontSize:"0.8125rem",lineHeight:1.35,color:"var(--graview-ink-muted)",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:N.value}):null]})},u=r=>{let c=r.node,y=Ae(t),k=ve().marks.flag;if(!c)return null;let h=r.flagged?.includes(c.id)??!1;return(0,l.jsx)(J,{label:h?`${$(a,c)} ${k}`:$(a,c),hue:y,selected:r.selected,title:h?`${ee(H(a,String(t)))} \u2014 implicated in a problem`:ee(H(a,String(t)))})},m=r=>r.fidelity==="full"?(0,l.jsx)(P.Suspense,{fallback:(0,l.jsx)(g,{...r}),children:(0,l.jsx)(Ut,{kind:String(t),members:r.nodes??[],...r.flagged?{flagged:r.flagged}:{},...r.label?{label:r.label}:{},...r.retired?{retired:r.retired}:{}})}):(0,l.jsx)(g,{...r}),g=r=>{let{brand:c,store:y,views:k}=V(),{view:h,go:S}=Re(),b=r.nodes??[],N=k.lookup(String(t),{cardinality:"one",fidelity:"glyph"}),v=N!==void 0&&!pe(N)?N:void 0,x=ft(h),C=mt(b,x,{schema:e,graph:y.graph,flagged:new Set(r.flagged??[])}),M=R=>({id:R.id,label:$(e.tryDefinition(R.kind),R),hue:te(R.kind,c?.accents)}),W=r.fidelity==="full"&&b.length>1?(0,l.jsx)(P.Suspense,{fallback:null,children:(0,l.jsx)(qt,{schema:e,graph:y.graph,kind:String(t),arrangement:x,onChange:R=>S(wt(h,R)),kept:{shown:C.nodes.length,of:b.length},style:{marginBottom:8}})}):null,se=R=>R.some(A=>r.flagged?.includes(A.id)),le=fe(),Y=ve().marks.flag,z=(R,A,de)=>v?(0,l.jsx)(X,{title:R,meta:(0,l.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[(0,l.jsx)(ke,{kind:String(t),plural:o,problems:be(le,A),flag:Y}),(0,l.jsx)("span",{title:`${Q(A.length)} ${A.length===1?H(a,String(t)):o.toLowerCase()}`,children:Q(A.length)})]}),tone:se(A)?"warning":"muted",children:(0,l.jsx)(en,{View:v,members:A,mode:r.mode,...r.flagged?{flagged:r.flagged}:{}})},de):(0,l.jsx)(ot,{label:R,count:A.length,flagged:se(A),items:A.map(M),problems:(0,l.jsx)(ke,{kind:String(t),plural:o,problems:be(le,A),flag:Y})},de);return C.grouped?(0,l.jsxs)("div",{style:{display:"grid",gap:8},"data-graview-grouped":x.group?.by,children:[W,C.groups.map(R=>z(`${r.label??o} \xB7 ${R.label}`,R.nodes,R.key||"-"))]}):(0,l.jsxs)("div",{style:{display:"grid",gap:4},children:[W,z(r.label??o,C.nodes)]})},w=r=>{let c=r.nodes??[],y=Jt(c.map(p=>$(a,p)),r.openedRows??gt(c.length)),k=Ae(t),{brand:h}=V(),S=nt(String(t),e,h),b=ve().marks.flag,{selection:N,set:v,clear:x}=Ne(),{toggle:C,view:M,go:W}=Re(),{views:se,hiddenKinds:le}=V(),Y=(0,P.useContext)(et),z=M.overview&&!le.has(String(t))?se.places().filter(p=>p.kind===String(t)):[],R=r.focused?M.within?.view??z[0]?.as:void 0,A=c.filter(p=>r.flagged?.includes(p.id)).length,de=A>0,Ht=fe(),It=be(Ht,c),F=(M.overview??!1)&&r.nestedUnder===void 0,G=r.focused||r.raised,Ie=r.rank==="secondary"&&!G,E=r.nestedUnder!==void 0,We=new Set(N),K=Y?N.length===1&&N[0]===ne(String(t)):r.opened??!1,Wt=ut(),O=G||F?0:c.filter(p=>Wt.includes(p.id)&&!We.has(p.id)).length,xe=O>0&&!de,ce=Qe(),q=ce&&!E?ce.byKind[String(t)]??0:0,ze=(0,P.useRef)(null),Fe=(0,P.useRef)(null);(0,P.useLayoutEffect)(()=>{let p=Fe.current,T=ze.current;if(!p||!T||!F)return;let D=()=>T.style.setProperty("--graview-plate-h",`${p.offsetHeight}px`);if(D(),typeof ResizeObserver>"u")return;let Z=new ResizeObserver(D);return Z.observe(p,{box:"border-box"}),()=>Z.disconnect()},[F]);let zt=E?8:Math.min(46,10+Math.round(Math.sqrt(c.length)*8)),Ke=E?(0,l.jsx)("span",{style:{fontSize:"0.75rem",lineHeight:1.25,letterSpacing:"0.05em",textTransform:"uppercase",color:G?"var(--graview-accent)":"var(--graview-ink-muted)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r.label??o}):(0,l.jsx)(an,{text:r.label??o,accent:!!G});return(0,l.jsxs)("div",{ref:ze,className:"graview-kind-card","data-graview-rank":r.rank,"data-graview-landmark":S||void 0,"data-graview-nested":E||void 0,"data-graview-tied":O||void 0,"data-graview-hits":ce&&!E?q:void 0,"data-graview-emphasis":ce&&!E?q>0?"lit":"dimmed":void 0,...a?.description||E?{title:E?[r.label??o,a?.description].filter(Boolean).join(" \u2014 "):a.description}:{},style:{position:"relative",height:"100%","--graview-hue":Math.round(k)},children:[S?(0,l.jsx)("span",{className:"graview-kind-block graview-kind-landmark","data-graview-opened":r.opened||void 0,"aria-hidden":"true",style:{"--graview-rise":zt},children:(0,l.jsx)(ae,{kind:String(t),schema:e,...h?{brand:h}:{},size:96})}):null,(0,l.jsxs)("div",{ref:Fe,className:"graview-kind-face","data-graview-opened":r.opened||void 0,"data-graview-nameplate":F?r.nameplate??"full":void 0,style:{display:"flex",flexDirection:"column",gap:E?1:3,padding:E?"5px 7px":"7px 10px",borderRadius:"var(--graview-radius-sm, 9px)",justifyContent:"center",position:"relative",height:"100%",overflow:"hidden",boxSizing:"border-box",border:G?"1px solid var(--graview-accent)":O>0?"1px solid var(--graview-accent-dim)":`1px solid hsl(${Math.round(k)} 55% var(--graview-tint-lightness) / 0.34)`,backgroundColor:"var(--graview-panel)",backgroundImage:`linear-gradient(hsl(${Math.round(k)} 55% var(--graview-tint-lightness) / calc(var(--graview-tint-alpha) * ${G?1.1:Ie?.28:.5})), hsl(${Math.round(k)} 55% var(--graview-tint-lightness) / calc(var(--graview-tint-alpha) * ${G?1.1:Ie?.28:.5})))`,boxShadow:G?"0 0 0 1px var(--graview-accent-dim)":void 0},children:[!E&&!F&&c.length>0?(0,l.jsx)("div",{"data-graview-tally":c.length,"data-graview-broken":A||void 0,"aria-hidden":"true",style:{position:"absolute",left:0,right:0,top:0,display:"flex",height:3,background:`hsl(${Math.round(k)} 55% var(--graview-tint-lightness) / 0.4)`},children:A>0?(0,l.jsx)("span",{style:{width:`${Math.max(6,Math.round(A/c.length*100))}%`,background:"var(--graview-warn)"}}):null}):null,S?(0,l.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:E?4:6},children:[(0,l.jsx)(ae,{kind:String(t),schema:e,...h?{brand:h}:{},size:E?14:18}),Ke]}):Ke,(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:5,fontSize:"0.875rem"},children:[(0,l.jsx)("span",{title:c.length>0?`${Q(c.length)} ${c.length===1?H(a,String(t)):o.toLowerCase()}`:void 0,style:{fontVariantNumeric:"tabular-nums",color:xe?"var(--graview-accent)":"var(--graview-ink-faint)"},children:c.length===0?"none yet":xe?O===c.length?`${O} tied`:`${O} of ${c.length} tied`:Q(c.length)}),(0,l.jsx)(ke,{kind:String(t),plural:o,problems:It,flag:b,listed:K}),(r.retired??0)>0?(0,l.jsxs)("button",{type:"button",className:"graview-kind-past","data-graview-retired":r.retired,title:`${r.retired} retired ${o.toLowerCase()} \u2014 press to widen the view to the past`,onClick:p=>{p.stopPropagation(),W(ht(M,!0))},onDoubleClick:p=>p.stopPropagation(),onPointerDown:p=>p.stopPropagation(),children:["+",r.retired," past"]}):null,q>0?(0,l.jsxs)("button",{type:"button",className:"graview-kind-hits","data-testid":`hits-${String(t)}`,title:`${q} ${q===1?"match":"matches"} for \u201C${M.q??""}\u201D \u2014 press to go in, narrowed`,onClick:p=>{p.stopPropagation(),W(Je(M,ne(String(t)),{ownPicture:!0,...M.q?{carry:M.q}:{}}))},onDoubleClick:p=>p.stopPropagation(),onPointerDown:p=>p.stopPropagation(),children:[q," match"]}):null,O>0&&!xe?(0,l.jsxs)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-accent)"},children:[O," tied"]}):null,r.hasOwnView&&!F?(0,l.jsx)("span",{title:`${o} has a view of its own`,"aria-label":"has its own view",style:{fontSize:"0.6875rem",color:"var(--graview-accent)"},children:"\u25C6"}):null,!E&&c.length>0&&!r.focused?(0,l.jsxs)("button",{type:"button",className:"graview-kind-open","data-testid":`open-${String(t)}`,"aria-expanded":K,"aria-label":K?`Close up the ${o}`:`See the ${o} in here`,title:K?"Close it up":`See the ${o} in here`,onClick:p=>{p.stopPropagation(),Y?K?x():v([ne(String(t))]):C(ne(String(t)))},onDoubleClick:p=>p.stopPropagation(),onPointerDown:p=>p.stopPropagation(),children:[(0,l.jsx)("span",{className:"graview-kind-open-word",children:K?"close":"open"})," ",(0,l.jsx)("span",{"aria-hidden":"true",children:K?"\u25B4":"\u25BE"})]}):null]}),F&&r.states?(0,l.jsx)(P.Suspense,{fallback:null,children:(0,l.jsx)(nn,{states:r.states,definition:a})}):null,r.opened?(0,l.jsxs)("div",{className:"graview-kind-members","data-graview-buildings":r.plot?.side??1,style:{display:"grid",gridTemplateColumns:`repeat(${y.columns}, minmax(0, 1fr))`,gap:3},children:[c.slice(0,y.shown).map(p=>{let T=r.flagged?.includes(p.id)??!1,D=$(a,p);return(0,l.jsx)(J,{pickId:p.id,label:T?`${D} ${b}`:D,title:T?`${D} \u2014 implicated in a problem`:void 0,hue:k,selected:We.has(p.id)},p.id)}),c.length>y.shown?(0,l.jsxs)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",padding:"2px 4px",gridColumn:"1 / -1"},children:["+",c.length-y.shown," more \u2014 double-click to go in"]}):null]}):null]}),!E&&z.length>0?(0,l.jsx)("div",{className:"graview-drive-in","data-testid":`drive-in-${String(t)}`,"data-graview-showing":R,onPointerDown:p=>p.stopPropagation(),onDoubleClick:p=>p.stopPropagation(),children:(0,l.jsx)("div",{className:"graview-drive-in-marquee",role:"group","aria-label":`${o}: pictures`,"data-graview-thumbs":z.length===1?"one":"two",children:z.map(p=>{let T=R===p.as;return(0,l.jsxs)("div",{className:"graview-drive-in-thumb","data-graview-pressed":T||void 0,children:[(0,l.jsx)("span",{className:"graview-drive-in-thumb-title","aria-hidden":"true",children:p.title}),(0,l.jsx)("button",{type:"button",className:"graview-drive-in-thumb-press","data-testid":`showing-${p.as}`,"aria-label":`${o}: ${p.title}`,"aria-pressed":T,title:T?`${p.title} is showing \u2014 press again to open it`:`Show ${p.title} on the billboard \u2014 double-click to open it`,onClick:D=>{D.stopPropagation();let Z=()=>W(Ye(M,String(t),p.as));if(D.detail>=2||T&&r.focused){Z();return}W(qe(je(Ue(M,!0),Xe(String(t))),"view",p.as)),D.detail===1&&Qt(D.currentTarget.ownerDocument,$t(D.nativeEvent),Z)}})]},p.as)})})}):null]})};m.generic=!0,w.generic=!0,n.register(t,{cardinality:"one",fidelity:"full"},_(s)).register(t,{cardinality:"one",fidelity:"summary"},_(d)).register(t,{cardinality:"one",fidelity:"glyph"},_(u)).register(t,{cardinality:"many",fidelity:"full"},_(m)).register(t,{cardinality:"many",fidelity:"summary"},_(m)).register(t,{cardinality:"many",fidelity:"glyph"},_(w))}return n}var Ee=L(I(),1),Et=new WeakMap;function rn(e){let n=Et.get(e);return n||Et.set(e,n=Vt(e,me(e))),n}var Ve=tt;function Lt(){return(0,$e.useContext)(Ve)}function qn({children:e}){return(0,Ee.jsx)(Ve.Provider,{value:!0,children:e})}function Mt(e){let n=(0,$e.useContext)(Ve),{store:t}=V();if(n)return null;let a=e.kind??e.node?.kind??e.nodes?.[0]?.kind;if(!a)return null;let o=rn(t.schema).lookup(a,{cardinality:e.cardinality,fidelity:e.fidelity});return o?(0,Ee.jsx)(o,{...e}):null}var i=L(I(),1),on=90,Tt=(0,f.createContext)(null),Le=(e,n)=>e.trim().toLowerCase().replace(/[_-]+/g," ")===n.trim().toLowerCase().replace(/[_-]+/g," "),sn=(0,f.createContext)(null),Ge=(0,f.createContext)(null);function Dt({block:e}){let n=(0,f.useContext)(Ge),t=n?.slots?.[e.key],a=(0,i.jsx)(ln,{block:e});return t?(0,i.jsx)(f.Suspense,{fallback:a,children:(0,i.jsx)(t,{block:e,node:n.node,drawn:a})}):a}function ln({block:e}){let n=(0,f.useContext)(Tt),t=(0,f.useContext)(cn),a=(0,f.useContext)(Te),o=(0,f.useContext)(we);if(n&&e.t==="badge"&&n.values.some(s=>Le(s,e.text))||n&&e.t==="field"&&n.field!==void 0&&e.field===n.field||e.t==="badge"&&/^0(?:\s+\p{L}+)?$/u.test(e.text.trim()))return null;switch(e.t){case"title":return(0,i.jsx)("strong",{className:"graview-spec-title",...o!==null&&Le(o,e.text)?{"aria-hidden":!0}:{},children:e.text});case"text":return e.markdown||Ce(e.text)?(0,i.jsx)("div",{className:"graview-spec-text",...e.tone?{"data-graview-tone":e.tone}:{},children:(0,i.jsx)(yt,{text:e.text,markdown:e.markdown})}):e.runs?(0,i.jsx)("p",{className:"graview-spec-text graview-spec-meta",...e.tone?{"data-graview-tone":e.tone}:{},children:e.runs.map((s,d)=>(0,i.jsxs)(f.Fragment,{children:[d>0?" ":null,s.field!==void 0?(0,i.jsx)("span",{className:"graview-spec-chip","data-graview-field":s.field,children:s.text}):(0,i.jsx)("span",{className:"graview-spec-meta-words",children:d>0&&e.runs[d-1].field===void 0?`\xB7 ${s.text}`:s.text})]},d))}):(0,i.jsx)("p",{className:"graview-spec-text",...e.tone?{"data-graview-tone":e.tone}:{},children:e.text});case"badge":return(0,i.jsx)("span",{className:"graview-spec-badge","data-graview-tone":e.tone,children:e.text});case"field":return(0,i.jsxs)("span",{className:"graview-spec-field","data-graview-field":e.field,children:[(0,i.jsx)("span",{className:"graview-spec-label",children:e.label}),(0,i.jsx)("span",{className:"graview-spec-value",...Ce(e.text)?{style:{whiteSpace:"pre-line"}}:{},children:e.linked?(0,i.jsx)(pt,{relation:e.linked.relation,refs:e.linked.refs,as:"chip"}):e.app?(0,i.jsx)(vt,{address:e.app}):e.href?(0,i.jsx)("a",{className:"graview-spec-link",href:e.href,...e.href.startsWith("tel:")?{}:{rel:"noopener noreferrer",target:"_blank"},children:e.text}):e.text})]});case"image":return(0,i.jsx)(Se,{as:"block",field:e.field,files:e.files,label:e.label,view:e.as});case"progress":return e.value===void 0||e.max===void 0?(0,i.jsxs)("span",{className:"graview-spec-progress",children:[(0,i.jsx)("span",{className:"graview-spec-label",children:e.label}),(0,i.jsx)("span",{className:"graview-spec-value",children:e.text})]}):(0,i.jsxs)("span",{className:"graview-spec-progress",children:[(0,i.jsx)("span",{className:"graview-spec-label",children:e.label}),(0,i.jsx)("span",{className:"graview-spec-track",role:"progressbar","aria-label":e.label,"aria-valuemin":0,"aria-valuemax":e.max,"aria-valuenow":Math.max(0,Math.min(e.value,e.max)),"aria-valuetext":e.text,children:(0,i.jsx)("span",{className:"graview-spec-fill",style:{width:`${Math.round(Math.max(0,Math.min(e.value,e.max))/e.max*100)}%`}})}),(0,i.jsx)("span",{className:"graview-spec-value",children:e.text})]});case"group":return(0,i.jsx)("span",{className:"graview-spec-group","data-direction":e.direction,children:(0,i.jsx)(Me,{blocks:e.blocks})});case"when":return e.shown?(0,i.jsx)(Me,{blocks:e.blocks}):null;case"divider":return(0,i.jsx)("hr",{className:"graview-spec-divider"});case"figure":return(0,i.jsx)(dn,{});case"headline":{let s=`h${Math.min(6,e.level+t)}`,d=(0,i.jsx)(s,{className:"graview-spec-headline","data-level":e.level,"data-long":e.text.length>on?"":void 0,children:e.text});return a!==null&&e.level===1?(0,i.jsxs)(i.Fragment,{children:[d,a]}):d}case"number":return(0,i.jsxs)("span",{className:"graview-spec-number",...e.emphasis?{"data-emphasis":e.emphasis}:{},children:[(0,i.jsx)("span",{className:"graview-spec-number-value",children:e.text}),e.label?(0,i.jsx)("span",{className:"graview-spec-label",children:e.label}):null]});case"list":return(0,i.jsx)(pn,{list:e})}}function dn(){let e=(0,f.useContext)(Ge)?.figure;return e?(0,i.jsx)("span",{className:"graview-spec-figure","aria-hidden":"true",children:e()}):null}function Me({blocks:e}){let n=[];for(let t=0;t<e.length;t++){let a=t;for(;e[a]?.t==="badge"&&e[a+1]?.t==="badge";)a++;if(a===t){n.push((0,i.jsx)(Dt,{block:e[t]},t));continue}n.push((0,i.jsx)("span",{className:"graview-spec-badges",children:e.slice(t,a+1).map((o,s)=>(0,i.jsx)(Dt,{block:o},s))},t)),t=a}return n}function Oe({blocks:e,ctx:n,view:t}){let a=(0,f.useContext)(sn)?.[t];return(0,i.jsx)(Ge.Provider,{value:{figure:n.figure,slots:a,node:n.node},children:(0,i.jsx)(Me,{blocks:e})})}function Bt({blocks:e,ctx:n,view:t}){return(0,i.jsx)(Oe,{blocks:j(e,n),ctx:n,view:t})}var De=3,Gt=(0,f.createContext)(0),Ot=(0,f.createContext)(null),cn=(0,f.createContext)(0),Te=(0,f.createContext)(null),gn=(0,f.createContext)(null);function un({node:e,as:n,depth:t,said:a=null}){let{store:o,views:s}=V(),d=$(o.schema.tryDefinition(e.kind),e),u=s.lookup(e.kind,{cardinality:"one",fidelity:n==="card"?"summary":"glyph"});return n==="row"&&t<=De&&(!u||pe(u))?(0,i.jsxs)("li",{className:"graview-spec-item","data-graview-listed":e.id,"data-as":n,children:[(0,i.jsx)(Be,{node:e,label:d}),(0,i.jsx)("div",{className:"graview-spec graview-spec-row","data-graview-spec":"row","data-graview-kind":e.kind,"aria-hidden":"true",children:(0,i.jsx)("strong",{className:"graview-spec-title",children:d})})]}):(0,i.jsxs)("li",{className:"graview-spec-item","data-graview-listed":e.id,"data-as":n,children:[(0,i.jsx)(Be,{node:e,label:d}),t<=De&&u?(0,i.jsx)(Ze,{mode:"scene",children:(0,i.jsx)(Gt.Provider,{value:t,children:(0,i.jsx)(Tt.Provider,{value:a,children:(0,i.jsx)(we.Provider,{value:d,children:(0,i.jsx)(u,{node:e,cardinality:"one",fidelity:n==="card"?"summary":"glyph",mode:"scene",selected:!1})})})})}):(0,i.jsx)("span",{className:"graview-spec-item-name","aria-hidden":"true",children:d})]})}function Be({node:e,label:n,describedBy:t}){let a=(0,f.useContext)(Ot),o=(0,f.useRef)(null);return xt(o),a?(0,i.jsx)("a",{ref:o,className:"graview-spec-item-link",href:a.href(e),"aria-label":n,...t?{"aria-describedby":t}:{},onClick:s=>{s.metaKey||s.ctrlKey||s.shiftKey||s.button!==0||(s.preventDefault(),s.stopPropagation(),a.go(e))}}):(0,i.jsx)("button",{ref:o,type:"button",className:"graview-spec-item-link","data-graview-pick":e.id,"aria-label":n,...t?{"aria-describedby":t}:{}})}function pn({list:e}){let n=(0,f.useContext)(Gt)+1,{store:t}=V(),a=(0,f.useContext)(Ot),[o,s]=(0,f.useState)(e.members.length);if(e.failed)return(0,i.jsx)("p",{className:"graview-spec-text",children:"\u2014"});if(e.members.length===0)return e.empty?(0,i.jsx)("p",{className:"graview-spec-text graview-spec-empty",children:e.empty}):null;let d=(v,x=null)=>n>De?(0,i.jsx)("ul",{className:"graview-spec-list","data-as":"names",children:v.map(C=>(0,i.jsxs)("li",{className:"graview-spec-item","data-graview-listed":C.id,"data-as":"name",children:[(0,i.jsx)(Be,{node:C,label:$(t.schema.tryDefinition(C.kind),C)}),(0,i.jsx)("span",{className:"graview-spec-item-name","aria-hidden":"true",children:$(t.schema.tryDefinition(C.kind),C)})]},C.id))}):(0,i.jsx)("ul",{className:"graview-spec-list","data-as":e.as,children:v.map(C=>(0,i.jsx)(un,{node:C,as:e.as,depth:n,said:x},C.id))}),u=e.rest??[],m=Math.min(o,e.members.length+u.length),g=m>e.members.length?[...e.members,...u].slice(0,m):e.members,w=e.members.length+u.length-m,r=Math.max(1,e.members.length),c=w>0?(0,i.jsx)("p",{className:"graview-spec-text graview-spec-more",children:(0,i.jsx)("button",{type:"button",className:"graview-spec-show-more","data-graview-show-more":w,onClick:()=>s(m+r),children:`Show ${Math.min(r,w)} more`})}):null,y=e.total??e.members.length+e.more,k=e.more-u.length,h=c??(a?.more&&y>g.length?a.more({members:g,total:y}):k>0?(0,i.jsx)("p",{className:"graview-spec-text graview-spec-more",children:`and ${k} more`}):null);if(!e.groups)return(0,i.jsxs)("div",{className:"graview-spec-listing",children:[d(g),h]});let S=`h${e.headingLevel}`,b=m,N=m>e.members.length&&e.everyGroup?e.everyGroup.flatMap(v=>{if(b<=0)return[];let x=v.members.slice(0,b);return b-=x.length,[{...v,members:x}]}):e.groups;return(0,i.jsxs)("div",{className:"graview-spec-listing",children:[N.map(v=>(0,i.jsxs)("section",{className:"graview-spec-list-group","data-graview-group":v.value??"",children:[v.heading?(0,i.jsxs)(S,{className:"graview-spec-list-heading",children:[v.heading," ",(0,i.jsx)("span",{className:"graview-spec-list-count",children:(e.everyGroup?.find(x=>x.value===v.value)??v).members.length})]}):null,d(v.members,v.value!==null?{values:[v.value,...v.heading?[v.heading]:[]]}:null)]},v.value??"")),h]})}function da({blocks:e,heading:n=2,firstHeading:t,slot:a,view:o=a}){let{store:s,brand:d}=V();ue();let u=re(s,null,null,{heading:n,firstHeading:t,money:d}),m=(0,f.useContext)(Te),w=(0,f.useContext)(gn)?.lede===!0&&a==="place"&&e[0]?.t==="headline"?e.slice(1):e,r=w.some(c=>c.t==="headline");return(0,i.jsxs)("div",{className:`graview-spec graview-spec-${a}`,"data-graview-spec":a,children:[m!==null&&!r?m:null,(0,i.jsx)(Te.Provider,{value:r?m:null,children:(0,i.jsx)(Bt,{blocks:w,ctx:u,view:o})})]})}function He(e,n="card"){let{store:t,brand:a}=V(),o=t.schema;return{...re(t,null,e,{slot:n,money:a}),figure:()=>(0,i.jsx)(ae,{kind:e.kind,schema:o,...a?{brand:a}:{},size:22})}}function mn({blocks:e,node:n,selected:t,flagged:a}){let o=He(n),[s,...d]=e,u=s?.t==="title";return(0,i.jsx)(X,{...u?{title:j([s],o)[0].text}:{},selected:t,tone:a?"warning":"muted",fit:!0,children:(0,i.jsx)("div",{className:"graview-spec graview-spec-card","data-graview-spec":"card","data-graview-kind":n.kind,children:(0,i.jsx)(Bt,{blocks:u?d:e,ctx:o,view:`${n.kind}.card`})})})}function hn({blocks:e,props:n}){let t=n.node,a=He(t,"page"),o=Lt(),s=j(e,a),d=ye(e,s),u=d.title!==void 0&&(!o||d.title===$(a.schema?.tryDefinition(t.kind),t)),m=(0,i.jsx)("div",{className:"graview-spec graview-spec-page","data-graview-spec":"page","data-graview-kind":t.kind,children:(0,i.jsx)(Oe,{blocks:u?s.slice(1):s,ctx:a,view:`${t.kind}.page`})});return o?m:(0,i.jsx)(oe.Provider,{value:{nodeId:t.id,...d.title!==void 0?{title:d.title}:{},body:m,fields:d.fields,records:d.records},children:(0,i.jsx)(Mt,{...n})})}function ca(e,n,t){return typeof e=="function"?e.says?.(n,t):void 0}function fn({blocks:e,node:n,selected:t}){let{store:a}=V(),o=$(a.schema.tryDefinition(n.kind),n),s=He(n,"row"),d=j(e,s),u=(0,f.useContext)(we);return(0,i.jsx)("div",{title:o,style:{minWidth:0,maxWidth:"100%"},children:(0,i.jsxs)("div",{className:"graview-spec graview-spec-row","data-graview-spec":"row","data-graview-kind":n.kind,...e.some(dt)?{"data-graview-tall":""}:{},...t?{"data-selected":""}:{},children:[lt(d,o)?null:(0,i.jsx)("strong",{className:"graview-spec-title","data-graview-row-name":"",...u!==null&&Le(u,o)?{"aria-hidden":!0}:{},children:o}),(0,i.jsx)(Oe,{blocks:d,ctx:s,view:`${n.kind}.row`})]})})}function ga(e,n,t){if(!t)return e;let a=new Set(n.kinds);for(let[o,s]of Object.entries(t)){if(!a.has(o)||!s)continue;let d=o;if(s.card){let u=ie(s.card),m=g=>g.node?(0,i.jsx)(mn,{blocks:u,node:g.node,selected:g.selected,flagged:g.flagged?.includes(g.node.id)??!1}):null;e.register(d,{cardinality:"one",fidelity:"summary"},m)}if(s.row){let u=ie(s.row),m=g=>g.node?(0,i.jsx)(fn,{blocks:u,node:g.node,selected:g.selected}):null;m.says=(g,w)=>ye(u,j(u,re({graph:w,schema:n},null,g,{slot:"row"}))),e.register(d,{cardinality:"one",fidelity:"glyph"},m)}if(s.page){let u=ie(s.page),m=g=>g.node?(0,i.jsx)(hn,{blocks:u,props:g}):null;m.says=(g,w)=>ye(u,j(u,re({graph:w,schema:n},null,g))),e.register(d,{cardinality:"one",fidelity:"full"},m)}}return e}export{xt as a,qn as b,Tt as c,Ot as d,cn as e,Te as f,gn as g,Be as h,da as i,ca as j,ga as k,Vt as l};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{q as ce}from"./chunk.7KZ44FEU.js";import{a as Z,b as C,c as ee,d as te,g as oe,j as re,k as P,l as se,p as le,s as de}from"./chunk.7IOC6U3C.js";import{a as ie,b as ne,c as ae}from"./chunk.7FZY5E2U.js";import"./chunk.7354O67H.js";import"./chunk.XLM4ONUB.js";import"./chunk.XOZU4OFA.js";import"./chunk.C7EEYSAM.js";import{a as X}from"./chunk.DGWNVDZB.js";import"./chunk.TI4OSTQV.js";import"./chunk.3TME4BG3.js";import"./chunk.CV4QA4ZF.js";import"./chunk.OYRZ2DEI.js";import"./chunk.7EA7THSM.js";import{e as _,m as J}from"./chunk.AI2HBKVP.js";import{G as me,J as U,T as V,aa as j}from"./chunk.Q5IAXTF5.js";import"./chunk.SDO3U72B.js";import{Oc as Y,ha as B}from"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import{b as O}from"./chunk.AJZBJBMO.js";var a=O(me(),1);var d=O(V(),1),ke=new Set(["show","go","to","open","the","a","an","me"]),ge=r=>r.toLowerCase().normalize("NFKD").replace(/[̀-ͯ]/g,""),W=(r,p)=>{let s=ge(r);return p.every(t=>s.includes(t))},pe=r=>r&&!/^.\p{Lu}/u.test(r)?`${r[0].toLowerCase()}${r.slice(1)}`:r,L={act:4,show:3,place:3,record:4},we=360,h=12;function Oe({face:r,opening:p,close:s}){let t=X(),{setMenuAt:v}=j(),n=(0,a.useMemo)(()=>p.target??Z(p.pointed??{about:[]},e=>t.store.graph.has(e)),[p,t.store]),f=(0,a.useMemo)(()=>oe(t.store,n,t.places),[t.store,n,t.places]),[u,y]=(0,a.useState)(""),[b,m]=(0,a.useState)(-1),[l,$]=(0,a.useState)(null),[A,I]=(0,a.useState)(null),E=(0,a.useRef)(null),z=(0,a.useRef)(null),T=(0,a.useId)(),R=(0,a.useRef)(!0),{ghost:G}=U(t.desk);(0,a.useEffect)(()=>()=>{R.current=!1;let e=t.desk.get().ghost;e?.onCard&&t.desk.setGhost({...e,onCard:!1})},[t.desk]);let M=(0,a.useMemo)(()=>{let e=P(t,n);return ee(t.store,n,{principal:t.principal,places:t.places,...e.acts?{acts:e.acts}:{}})},[t,n]),K=(0,a.useMemo)(()=>{let e=C(n);if(e.length===0)return[];let i=new Set(M.candidates.flatMap(c=>c.type==="act"?[c.mutation]:[]));return ie(t.store,e,{principal:t.principal,...e.length===1?{focus:e[0]}:{}}).affordances.filter(c=>!c.destructive&&i.has(c.mutation))},[t.store,t.principal,n,M]),q=(0,a.useCallback)(()=>{let e=p.returnTo,i=ue(E.current,n,r);s(),requestAnimationFrame(()=>{if(e?.isConnected&&!e.closest("[inert]"))return e.focus({preventScroll:!0});let c=(i&&i.tabIndex>=0?i:null)??document.querySelector("[data-graview-page-title]")??document.querySelector("main");c&&c.tabIndex<0&&!c.hasAttribute("tabindex")&&c.setAttribute("tabindex","-1"),c?.focus({preventScroll:!0})})},[p.returnTo,n,r,s]),F=(0,a.useCallback)(e=>{if(e.open.length>0){let i=E.current?.getBoundingClientRect();s(),v({x:i?.left??0,y:i?.top??0,on:e.args.id??C(n)[0],about:C(n)});return}try{ae(t.store,e,{},{pressed:t.principal?{author:t.principal}:{}}),ne(t.store,e,{},{author:t.principal}),q()}catch(i){I(i instanceof Error?i.message:String(i))}},[t.store,t.principal,s,q,v,n]),H=(0,a.useCallback)(async e=>{let i=e.trim();if(!i)return;let c=l?.result?.answer?{said:l.said,answer:l.result.answer}:void 0;y(""),m(-1),I(null),$({said:i,result:null});let S=await re(t.ai,{...P(t,n,i),said:i,...c?{follows:c}:{}});t.desk.record(S.interaction),S.ghost&&S.ghost.proposals.length>0&&t.desk.setGhost({ghost:S.ghost,onCard:!0}),R.current&&$({said:i,result:S})},[l,t,n]),N=(0,a.useRef)(p.asked);(0,a.useEffect)(()=>{let e=N.current;N.current=void 0,e&&H(e)},[]);let k=(0,a.useMemo)(()=>{let e=u.trim();if(!e&&l)return[];let i=ge(e).split(/\s+/).filter(o=>o&&!ke.has(o)),c=/^show\b/i.test(e),S=/^(go|open)\b/i.test(e),x=[];if(!c&&!S)for(let o of K.filter(g=>W(g.label,i)).slice(0,L.act))x.push({id:`act:${o.id}`,kind:"act",label:o.label,hint:o.open.length>0?"asks more":"do it",take:()=>F(o)});let Q=e&&!/\?\s*$/.test(e)?te(t.store,n,{principal:t.principal,places:t.places,said:e}):[];for(let o of Q)x.push({id:`place:${o.place}`,kind:"place",label:o.fit==="full"?`Open ${o.title}`:`Open and adjust ${o.title}`,hint:o.fit==="full"?"a view you have":"adjust it",take:()=>{s(),t.goTo.place(o.place),o.fit==="partial"&&_(t.desk,{target:{on:"lens",place:o.place,...o.kind?{kind:o.kind}:{}},asked:e})}});if(!S){let o=M.candidates.filter(g=>g.type==="panel");for(let g of o.filter(D=>W(`show ${D.label}`,i)).slice(0,L.show))x.push({id:g.id,kind:"show",label:`Show ${pe(g.label)}`,hint:"a panel",take:()=>{s(),se(t,{title:g.label,recipe:{...g.panel,title:g.label}})}})}if(!c){for(let o of t.places.filter(g=>W(g.title,i)&&!Q.some(D=>D.place===g.as)).slice(0,L.place))x.push({id:`place:${o.as}`,kind:"place",label:`Go to ${o.title}`,take:()=>(s(),t.goTo.place(o.as))});if(i.length>0){let o=ce(t.store,e.replace(/^(go to|open)\s+/i,""),{principal:t.principal,from:C(n),limit:L.record}).hits;for(let g of o)g.about==="node"&&x.push({id:`record:${g.id}`,kind:"record",label:g.label,hint:B(t.store.schema,g.kind),take:()=>(s(),t.goTo.record(g.id))})}}return e&&x.push({id:"ask",kind:"ask",label:e,take:()=>void H(e)}),x},[u,K,M,t,n,F,H,s,l]);(0,a.useEffect)(()=>m(u.trim()?0:-1),[u]),(0,a.useLayoutEffect)(()=>{let e=E.current;if(!e)return;if(typeof e.showPopover=="function")try{e.showPopover()}catch{}z.current?.focus({preventScroll:!0});let i=0,c=()=>{be(e,ue(e,n,r)),i=requestAnimationFrame(c)};return c(),()=>cancelAnimationFrame(i)},[n,r]),(0,a.useEffect)(()=>{if(l)return;let e=i=>{i.target instanceof Node&&E.current?.contains(i.target)||s()};return document.addEventListener("pointerdown",e,!0),()=>document.removeEventListener("pointerdown",e,!0)},[l,s]);let fe=e=>{if(e.key==="ArrowDown"&&k.length>0)e.preventDefault(),m(i=>Math.min(k.length-1,i+1));else if(e.key==="ArrowUp"&&k.length>0)e.preventDefault(),m(i=>Math.max(0,i-1));else if(e.key==="Enter"){e.preventDefault();let i=k[b];i?i.take():u.trim()&&H(u)}},w=l?.result??null,he=k[b];return(0,d.jsxs)("section",{ref:E,popover:"manual",role:"region","aria-label":l?`Answer about ${f}`:`Ask about ${f}`,"data-testid":"quick-ask","data-quick-ask":l?"answer":"bar","data-quick-ask-face":r,"data-graview-offstage":"","data-graview-overlay":"",onKeyDown:e=>{e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),q())},onMouseDown:e=>e.stopPropagation(),style:ve,children:[(0,d.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:8},children:[(0,d.jsxs)("p",{"data-testid":"quick-ask-about",style:{margin:0,flex:"1 1 auto",minWidth:0,fontSize:"0.75rem",color:"var(--graview-ink-muted)",overflowWrap:"anywhere"},children:["About ",f]}),(0,d.jsx)("button",{type:"button","data-testid":"quick-ask-close","aria-label":"Close",title:"Close",onClick:q,style:ye,children:(0,d.jsx)("span",{"aria-hidden":"true",children:"\u2715"})})]}),l?(0,d.jsxs)("div",{"data-testid":"quick-answer",style:{display:"grid",gap:8},children:[(0,d.jsxs)("p",{"data-testid":"quick-answer-asked",style:{margin:0,fontSize:"0.8125rem",color:"var(--graview-ink-muted)",fontStyle:"italic",overflowWrap:"anywhere"},children:["\u201C",l.said,"\u201D"]}),(0,d.jsx)("p",{"data-testid":"quick-answer-text","aria-live":"polite",style:{margin:0,fontSize:"0.9375rem",lineHeight:1.45,color:w?.interaction.outcome==="failed"?"var(--graview-warn)":"var(--graview-ink)",overflowWrap:"anywhere"},children:w===null?"Thinking\u2026":w.interaction.outcome==="failed"?w.interaction.failed??"The AI could not answer that here.":w.answer??""}),w&&w.offers.length>0?(0,d.jsx)("ul",{"aria-label":"What acts on it",style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:6},children:w.offers.map(e=>(0,d.jsx)("li",{children:(0,d.jsx)("button",{type:"button","data-testid":"quick-answer-offer","data-ai-offer":e.id,"data-ai-offer-type":e.type,onClick:()=>{le(t,w,e,s).then(i=>{i&&R.current&&I(i)})},style:xe,children:e.type==="panel"?`Show ${pe(e.label)}`:e.type==="place"?`Go to ${e.label}`:e.label})},e.id))}):null,G?.onCard&&G.ghost.interaction===w?.interaction.id?(0,d.jsx)(de,{placement:"card"}):null]}):null,(0,d.jsxs)("div",{style:{display:"grid",gap:4},children:[(0,d.jsx)("input",{ref:z,type:"text",role:"combobox","data-testid":"quick-ask-input","aria-label":l?`Ask a follow-up about ${f}`:`Ask about ${f}, or go somewhere`,"aria-expanded":k.length>0,"aria-controls":T,"aria-autocomplete":"list",...he?{"aria-activedescendant":`${T}-${b}`}:{},autoComplete:"off",enterKeyHint:"go",placeholder:l?"Ask a follow-up\u2026":"Ask, or go to\u2026",value:u,readOnly:l!==null&&w===null,"aria-busy":l!==null&&w===null,onChange:e=>y(e.target.value),onKeyDown:fe,style:Ae}),(0,d.jsx)("div",{id:T,role:"listbox","aria-label":u.trim()?`What \u201C${u.trim()}\u201D finds here`:"What can be done here",hidden:k.length===0,style:{display:k.length===0?"none":"grid",gap:1,maxHeight:280,overflowY:"auto"},children:k.map((e,i)=>(0,d.jsx)("div",{id:`${T}-${i}`,role:"option","aria-selected":i===b,"data-testid":"quick-ask-option","data-quick-ask-kind":e.kind,"data-quick-ask-row":e.id,onMouseEnter:()=>m(i),onMouseDown:c=>c.preventDefault(),onClick:e.take,style:{...Se,background:i===b?"var(--graview-panel-muted)":"transparent",...e.kind==="ask"?{borderTop:"1px solid var(--graview-edge)",marginTop:2}:{}},children:e.kind==="ask"?(0,d.jsxs)("span",{children:["Ask: ",(0,d.jsxs)("span",{style:{fontWeight:600},children:["\u2018",e.label,"\u2019"]})]}):(0,d.jsxs)("span",{children:[e.label,e.hint?(0,d.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",e.hint]}):null]})},e.id))})]}),A?(0,d.jsx)("p",{role:"alert","data-testid":"quick-ask-refused",style:{margin:0,fontSize:"0.8125rem",color:"var(--graview-warn)"},children:A}):null,(0,d.jsx)("span",{style:J,"aria-live":"polite",children:k.length>0&&u.trim()?`${k.length} ${k.length===1?"way":"ways"} to go on`:""})]})}function ue(r,p,s){let t=r?.closest("[data-graview-embed]")??document,v=p.on==="list"?[`aggregate:${p.kind}`,`kind:${p.kind}`]:p.on==="lens"&&p.kind?[`aggregate:${p.kind}`]:C(p);for(let n of v)for(let f of t.querySelectorAll(`[data-graview-view="${CSS.escape(n)}"], [data-graview-pick="${CSS.escape(n)}"]`)){if(r?.contains(f))continue;let u=f.getBoundingClientRect();if(u.width>0&&u.height>0)return f}return s==="pages"?t.querySelector("main [data-graview-page-title]")??t.querySelector("main h1"):null}function be(r,p){let s={width:document.documentElement.clientWidth||innerWidth,height:innerHeight},t=Math.min(we,s.width-2*h),v=r.getBoundingClientRect().height,n=p?.getBoundingClientRect(),f,u,y,b=A=>Math.max(h,Math.min(A,s.height-v-h));if(n&&n.width>0&&n.bottom>0&&n.top<s.height)if(n.right+h+t<=s.width-h)f=n.right+h,u=b(n.top),y="right";else if(n.left-h-t>=h)f=n.left-h-t,u=b(n.top),y="left";else{f=Math.max(h,Math.min(n.left,s.width-t-h));let A=n.bottom+h;u=A+v<=s.height-h?A:b(n.top-h-v),y=A+v<=s.height-h?"below":"above"}else f=(s.width-t)/2,u=b(72),y="top";let m=r.style,l={left:`${Math.round(f)}px`,top:`${Math.round(u)}px`,width:`${Math.round(t)}px`};m.left!==l.left&&(m.left=l.left),m.top!==l.top&&(m.top=l.top),m.width!==l.width&&(m.width=l.width);let $=p?.getAttribute("data-graview-view")??p?.getAttribute("data-graview-pick")??(p?"page":"");r.getAttribute("data-quick-ask-beside")!==$&&r.setAttribute("data-quick-ask-beside",$),r.getAttribute("data-quick-ask-side")!==y&&r.setAttribute("data-quick-ask-side",y)}var ve={position:"fixed",inset:"auto",margin:0,zIndex:Y("popover"),boxSizing:"border-box",display:"grid",gap:10,padding:12,borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",color:"var(--graview-ink)",boxShadow:"var(--graview-lift-high)",maxHeight:"calc(100dvh - 24px)",overflowY:"auto",fontSize:"0.875rem"},ye={display:"inline-grid",placeItems:"center",width:28,height:28,padding:0,font:"inherit",fontSize:"0.875rem",lineHeight:1,color:"var(--graview-ink-muted)",background:"transparent",border:"1px solid transparent",borderRadius:6,boxShadow:"none",cursor:"pointer"},Ae={boxSizing:"border-box",width:"100%",height:36,padding:"0 10px",font:"inherit",fontSize:"max(1rem,16px)",color:"var(--graview-ink)",background:"var(--graview-panel)",border:"1px solid var(--graview-edge)",borderRadius:8},Se={display:"flex",alignItems:"center",minHeight:30,padding:"4px 8px",borderRadius:6,cursor:"pointer",overflowWrap:"anywhere"},xe={display:"inline-flex",alignItems:"center",minHeight:30,padding:"2px 10px",font:"inherit",fontSize:"0.8125rem",borderRadius:8};export{Oe as QuickAskCard};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk.AI2HBKVP.js";import{G as W,T as x}from"./chunk.Q5IAXTF5.js";import"./chunk.SDO3U72B.js";import"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import{b as D}from"./chunk.AJZBJBMO.js";var g=D(W(),1);var o=D(x(),1),v=864e5,l=t=>Date.UTC(+t.slice(0,4),+t.slice(5,7)-1,+t.slice(8,10)),I=t=>new Date(t).toISOString().slice(0,10),s=(t,i)=>I(l(t)+i*v),m=(t,i)=>{let a=new Date(l(t)),u=a.getUTCMonth()+i,d=Date.UTC(a.getUTCFullYear(),u,1),w=new Date(Date.UTC(a.getUTCFullYear(),u+1,0)).getUTCDate();return I(d+(Math.min(a.getUTCDate(),w)-1)*v)};function p(t,i,a){try{return new Intl.DateTimeFormat(t??"en-US",{...i,timeZone:"UTC"}).format(a)}catch{return new Intl.DateTimeFormat("en-US",{...i,timeZone:"UTC"}).format(a)}}function F(t){try{let i=new Intl.Locale(t??"en-US"),a=i.getWeekInfo?.().firstDay??i.weekInfo?.firstDay;if(a!==void 0)return a%7}catch{return 0}return/^en-US|^en$|-(US|CA|JP|BR|IL|MX|PH)$/.test(t??"en-US")?0:1}function L({id:t,label:i,selected:a,today:u,locale:d,onPick:w,onClose:T}){let[r,f]=(0,g.useState)(a??u),U=(0,g.useRef)(null),y=F(d),b=`${r.slice(0,7)}-01`,M=(new Date(l(b)).getUTCDay()-y+7)%7,P=s(b,-M),A=Array.from({length:6},(e,n)=>Array.from({length:7},(S,c)=>s(P,n*7+c))),$=p(d,{month:"long",year:"numeric"},l(b)),h=(0,g.useRef)(!0);(0,g.useEffect)(()=>{h.current&&U.current?.querySelector(`[data-day="${r}"]`)?.focus(),h.current=!1},[r]);let E=e=>{let n={ArrowLeft:()=>s(r,-1),ArrowRight:()=>s(r,1),ArrowUp:()=>s(r,-7),ArrowDown:()=>s(r,7),PageUp:()=>m(r,e.shiftKey?-12:-1),PageDown:()=>m(r,e.shiftKey?12:1),Home:()=>s(r,-((new Date(l(r)).getUTCDay()-y+7)%7)),End:()=>s(r,6-(new Date(l(r)).getUTCDay()-y+7)%7)};n[e.key]?(e.preventDefault(),h.current=!0,f(n[e.key]())):e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),T())},R=Array.from({length:7},(e,n)=>l("1970-01-04")+(y+n)%7*v),C={minWidth:32,minHeight:32,padding:"0 8px",borderRadius:6};return(0,o.jsxs)("div",{id:t,role:"group","aria-label":`Pick a date for ${i}`,"data-graview-part":"when-month",onKeyDown:e=>{e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),T())},style:{flexBasis:"100%",width:"min(100%, 20rem)",boxSizing:"border-box",padding:8,border:"1px solid var(--graview-edge)",borderRadius:8,background:"var(--graview-panel)",color:"var(--graview-ink)"},children:[(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:6,marginBottom:6},children:[(0,o.jsx)("button",{type:"button","aria-label":"Previous month",onClick:()=>f(m(r,-1)),style:C,children:"\u2039"}),(0,o.jsx)("span",{id:`${t}-title`,"aria-live":"polite",style:{fontWeight:600,fontSize:"0.875rem"},children:$}),(0,o.jsx)("button",{type:"button","aria-label":"Next month",onClick:()=>f(m(r,1)),style:C,children:"\u203A"})]}),(0,o.jsxs)("table",{ref:U,role:"grid","aria-labelledby":`${t}-title`,onKeyDown:E,style:{width:"100%",borderCollapse:"collapse",tableLayout:"fixed",fontSize:"0.8125rem"},children:[(0,o.jsx)("thead",{children:(0,o.jsx)("tr",{children:R.map(e=>(0,o.jsx)("th",{scope:"col",abbr:p(d,{weekday:"long"},e),style:{fontWeight:500,color:"var(--graview-ink-faint)",padding:"2px 0"},children:p(d,{weekday:"narrow"},e)},e))})}),(0,o.jsx)("tbody",{children:A.map(e=>(0,o.jsx)("tr",{children:e.map(n=>{let S=n.slice(0,7)===b.slice(0,7),c=n===a,k=n===u;return(0,o.jsx)("td",{role:"gridcell","aria-selected":c||void 0,style:{padding:1,textAlign:"center"},children:(0,o.jsx)("button",{type:"button","data-day":n,tabIndex:n===r?0:-1,"aria-label":`${p(d,{weekday:"long",year:"numeric",month:"long",day:"numeric"},l(n))}${k?", today":""}${c?", selected":""}`,...k?{"aria-current":"date"}:{},onClick:()=>w(n),onFocus:()=>n!==r&&f(n),style:{width:"100%",minHeight:36,padding:0,borderRadius:6,border:k?"1px solid var(--graview-accent)":"1px solid transparent",background:c?"var(--graview-accent)":"transparent",color:c?"var(--graview-accent-ink)":S?"var(--graview-ink)":"var(--graview-ink-faint)",fontWeight:c?600:400},children:Number(n.slice(8,10))})},n)})},e[0]))})]})]})}export{L as WhenMonth};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{k as a,l as o}from"./chunk.6JERQFZI.js";import"./chunk.7XJ3XQZD.js";import"./chunk.52J42KR5.js";import"./chunk.T2Q3AAQI.js";import"./chunk.C4EPMV7O.js";import"./chunk.G7XKQNOL.js";import"./chunk.7KZ44FEU.js";import"./chunk.KPUX27ZT.js";import"./chunk.DIS7JS7X.js";import"./chunk.D2T563AA.js";import"./chunk.JV7FLVUV.js";import"./chunk.GL3YVGAP.js";import"./chunk.WVUJXDXZ.js";import"./chunk.QRCTTDDQ.js";import"./chunk.3TME4BG3.js";import"./chunk.I43ONAEL.js";import"./chunk.73EKJ4JN.js";import"./chunk.INL4OZI7.js";import"./chunk.5WU2UTP7.js";import"./chunk.GZHZLJBF.js";import"./chunk.YKACMLLU.js";import"./chunk.OJGHDWI6.js";import"./chunk.337JMOTL.js";import"./chunk.CV4QA4ZF.js";import"./chunk.OYRZ2DEI.js";import"./chunk.7EA7THSM.js";import"./chunk.AI2HBKVP.js";import{sa as n}from"./chunk.Q5IAXTF5.js";import"./chunk.SDO3U72B.js";import"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import"./chunk.AJZBJBMO.js";var w=new WeakMap;function s(e,i){let t=w.get(e);t||w.set(e,t=new Map);let r=t.get(i);return r||t.set(i,r=a(o(e,n(e)),e,i)),r}export{s as frameworkViews};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a}from"./chunk.UEPVA6IS.js";import"./chunk.WWUMSCYC.js";import"./chunk.Y37DXEHG.js";import"./chunk.DXZ5VYCQ.js";import"./chunk.J2R55TM7.js";import"./chunk.DIS7JS7X.js";import"./chunk.JV7FLVUV.js";import"./chunk.7354O67H.js";import{b as n}from"./chunk.PRCWGE7A.js";import"./chunk.DGWNVDZB.js";import"./chunk.TI4OSTQV.js";import"./chunk.GZHZLJBF.js";import"./chunk.YKACMLLU.js";import"./chunk.OJGHDWI6.js";import"./chunk.337JMOTL.js";import"./chunk.CV4QA4ZF.js";import"./chunk.OYRZ2DEI.js";import"./chunk.7EA7THSM.js";import"./chunk.AI2HBKVP.js";import{T as i}from"./chunk.Q5IAXTF5.js";import"./chunk.SDO3U72B.js";import"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import{b as o}from"./chunk.AJZBJBMO.js";var e=o(i(),1);function g({entries:d,style:l,headingStyle:p,className:r}){return(0,e.jsxs)("section",{...r?{className:r}:{},"data-testid":"record-ai","aria-label":"What AI did here",style:{display:"grid",gap:10,...l},children:[(0,e.jsx)("h2",{style:p??{margin:0,fontSize:"1rem"},children:"What AI did here"}),(0,e.jsx)("ol",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:8,fontSize:"0.875rem"},children:d.slice(0,8).map(t=>(0,e.jsx)(n,{entry:t,undo:s=>(0,e.jsx)(a,{batch:s})},t.id))})]})}export{g as RecordInteractions};
|