graview 0.1.41 → 0.1.42
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.22QEYFWI.js +1 -0
- package/dist/preview/{chunk.YWNHCZQ5.js → chunk.27P37343.js} +1 -1
- package/dist/preview/{chunk.D25XEVKO.js → chunk.2ZGICECC.js} +1 -1
- package/dist/preview/{chunk.2GQPLTV3.js → chunk.35FR36BQ.js} +1 -1
- package/dist/preview/chunk.36LP3I7Z.js +21 -0
- package/dist/preview/{chunk.JDRLSVOI.js → chunk.37NF3YXZ.js} +1 -1
- package/dist/preview/chunk.3JATXDSP.js +1 -0
- package/dist/preview/{chunk.VCX3HEIE.js → chunk.3K2KBIRG.js} +1 -1
- package/dist/preview/chunk.3SKUJWFC.js +1 -0
- package/dist/preview/{chunk.BQRAIU5R.js → chunk.3WABA2WQ.js} +1 -1
- package/dist/preview/{chunk.FFZBOP65.js → chunk.4NBB44YU.js} +1 -1
- package/dist/preview/chunk.4QEDYRES.js +349 -0
- package/dist/preview/{chunk.BELCPW66.js → chunk.4YBP552Z.js} +2 -2
- package/dist/preview/{chunk.57R2GXXN.js → chunk.4YRCKOX2.js} +1 -1
- package/dist/preview/{chunk.WVDKYUF3.js → chunk.57R4ZUMM.js} +1 -1
- package/dist/preview/{chunk.VNUHESMZ.js → chunk.5FHH5NR6.js} +1 -1
- package/dist/preview/{chunk.DMF35E7D.js → chunk.5NDYYTT4.js} +1 -1
- package/dist/preview/{chunk.RQGTHRRJ.js → chunk.6HUS5UHZ.js} +1 -1
- package/dist/preview/{chunk.YYFLTMNN.js → chunk.6MLAJKYM.js} +1 -1
- package/dist/preview/{chunk.F2MQJH6Y.js → chunk.6NF32PAT.js} +1 -1
- package/dist/preview/chunk.6WB24MS3.js +1 -0
- package/dist/preview/{chunk.Z7LDT55A.js → chunk.7EB6SDUQ.js} +1 -1
- package/dist/preview/chunk.7HZVCW3Q.js +1 -0
- package/dist/preview/{chunk.4Q7XJJZY.js → chunk.7MJM3OVC.js} +1 -1
- package/dist/preview/chunk.7OSL64QH.js +1 -0
- package/dist/preview/chunk.7XDNCCLG.js +6 -0
- package/dist/preview/{chunk.XOYJ26YB.js → chunk.7Z2GTKA4.js} +1 -1
- package/dist/preview/{chunk.GT2BITLW.js → chunk.AOC2KUFE.js} +1 -1
- package/dist/preview/{chunk.6FNMDAX5.js → chunk.AQTCN7KQ.js} +1 -1
- package/dist/preview/{chunk.5RABSIF7.js → chunk.ARTJL3X2.js} +1 -1
- package/dist/preview/{chunk.7YIFF6BF.js → chunk.AWSUMY3D.js} +1 -1
- package/dist/preview/{chunk.3ZILIZZ6.js → chunk.B65HPL4I.js} +1 -1
- package/dist/preview/{chunk.4QPVS2ZM.js → chunk.B6DKKNVR.js} +1 -1
- package/dist/preview/{chunk.W3FTEJH5.js → chunk.B7DCQJXV.js} +1 -1
- package/dist/preview/chunk.BBLIT7S7.js +1 -0
- package/dist/preview/chunk.BJET6KOG.js +1 -0
- package/dist/preview/{chunk.I7XSDXQ3.js → chunk.BZ4VZ6WQ.js} +1 -1
- package/dist/preview/{chunk.67WWRC6Y.js → chunk.CAZX6OPN.js} +1 -1
- package/dist/preview/{chunk.TN5PYGU7.js → chunk.CSWX7YGI.js} +1 -1
- package/dist/preview/chunk.D3ELYLME.js +1 -0
- package/dist/preview/{chunk.5P556A7W.js → chunk.DNMBZONP.js} +1 -1
- package/dist/preview/{chunk.5QXWMC6C.js → chunk.DXAUXGNN.js} +1 -1
- package/dist/preview/{chunk.C4TSM4W5.js → chunk.EC2T2UVH.js} +2 -2
- package/dist/preview/chunk.EHMCRUYR.js +1 -0
- package/dist/preview/{chunk.BK6RWVRE.js → chunk.EQIQPY4O.js} +1 -1
- package/dist/preview/{chunk.53CDFJNM.js → chunk.ETWOZQWL.js} +1 -1
- package/dist/preview/{chunk.6YPLZNVT.js → chunk.EVHXF7LZ.js} +1 -1
- package/dist/preview/{chunk.EQ4UAWRB.js → chunk.FFRWSODT.js} +1 -1
- package/dist/preview/chunk.G4AY6NGN.js +1 -0
- package/dist/preview/{chunk.DGCMEDQA.js → chunk.GN2SZEFH.js} +1 -1
- package/dist/preview/{chunk.B5724ULM.js → chunk.GXWOEOUY.js} +1 -1
- package/dist/preview/{chunk.ISXFH3CK.js → chunk.HAY22FPJ.js} +1 -1
- package/dist/preview/{chunk.42XSBKPO.js → chunk.HG2IO5NS.js} +1 -1
- package/dist/preview/{chunk.EAH47SCN.js → chunk.HOTOH7ZB.js} +1 -1
- package/dist/preview/chunk.HQMGTPDC.js +117 -0
- package/dist/preview/{chunk.C2PECN4C.js → chunk.I7QCXRP7.js} +1 -1
- package/dist/preview/{chunk.O75JKQPF.js → chunk.IGA7OD3L.js} +1 -1
- package/dist/preview/{chunk.HKCK3JI4.js → chunk.ILPD5CZG.js} +1 -1
- package/dist/preview/chunk.IQ3LUSD6.js +6 -0
- package/dist/preview/chunk.IWLVZGW5.js +1 -0
- package/dist/preview/chunk.IXS5XBG6.js +1 -0
- package/dist/preview/{chunk.ZHLQWMV5.js → chunk.J7ZMNAWB.js} +1 -1
- package/dist/preview/{chunk.UEXIKCLF.js → chunk.JCTT2LAK.js} +1 -1
- package/dist/preview/{chunk.FOQZADMA.js → chunk.JE4QQEJE.js} +1 -1
- package/dist/preview/{chunk.LPYVOBWB.js → chunk.JEBB3WM7.js} +1 -1
- package/dist/preview/{chunk.OW7NSJ4H.js → chunk.JPD2I4Z7.js} +1 -1
- package/dist/preview/{chunk.LPNIEPYI.js → chunk.K63BUJBF.js} +2 -2
- package/dist/preview/{chunk.HI7X6PLZ.js → chunk.KMGGP6XT.js} +2 -2
- package/dist/preview/{chunk.OF34OZ4V.js → chunk.KSXB4LDF.js} +1 -1
- package/dist/preview/{chunk.PMGXASFI.js → chunk.KZDLDXLB.js} +1 -1
- package/dist/preview/{chunk.BFNVG5JE.js → chunk.L6HKDIZB.js} +1 -1
- package/dist/preview/{chunk.2FLPDPEL.js → chunk.LFJH6X6O.js} +1 -1
- package/dist/preview/{chunk.M4T377LG.js → chunk.LKGDN25E.js} +1 -1
- package/dist/preview/{chunk.HEVC6HHP.js → chunk.LMUFLZYT.js} +1 -1
- package/dist/preview/chunk.LQGXUMUX.js +1 -0
- package/dist/preview/{chunk.ZRYSVOLA.js → chunk.LWAZ6ZO6.js} +2 -2
- package/dist/preview/{chunk.33KXSD6F.js → chunk.LZH65VSN.js} +1 -1
- package/dist/preview/{chunk.H5HWN7A2.js → chunk.MUBZIU6F.js} +1 -1
- package/dist/preview/chunk.MZ6I2Q4E.js +1 -0
- package/dist/preview/{chunk.UWW6ZEPY.js → chunk.NS3Z7QNP.js} +1 -1
- package/dist/preview/{chunk.7LIKEE5Z.js → chunk.NTJNBKWC.js} +1 -1
- package/dist/preview/chunk.O7VHAKSA.js +2 -0
- package/dist/preview/{chunk.Q4TZHWQX.js → chunk.OMCXJGDI.js} +1 -1
- package/dist/preview/chunk.OTHGZPUC.js +1 -0
- package/dist/preview/{chunk.PMDNFN7Z.js → chunk.P6FGIYWP.js} +1 -1
- package/dist/preview/{chunk.C7JKMOFC.js → chunk.P6J6VFF5.js} +1 -1
- package/dist/preview/{chunk.LOCSF3BR.js → chunk.P7ISPJAQ.js} +1 -1
- package/dist/preview/{chunk.HB7ELBVK.js → chunk.PACJFDDU.js} +1 -1
- package/dist/preview/{chunk.2RVUDRRY.js → chunk.PCTVLNOS.js} +1 -1
- package/dist/preview/{chunk.BXT6FDT4.js → chunk.PH5ITX3N.js} +1 -1
- package/dist/preview/chunk.PYFQGBU3.js +1 -0
- package/dist/preview/{chunk.L4STJLUV.js → chunk.QHLD4TZW.js} +1 -1
- package/dist/preview/{chunk.AIZQBPGU.js → chunk.QHP7AJUV.js} +1 -1
- package/dist/preview/{chunk.AKQXF7GW.js → chunk.QXMTGLHR.js} +1 -1
- package/dist/preview/{chunk.MSP73H5Z.js → chunk.RFCTUGMU.js} +1 -1
- package/dist/preview/chunk.ROHM3ETN.js +49 -0
- package/dist/preview/{chunk.SIGC3G7S.js → chunk.RR4RZH4S.js} +1 -1
- package/dist/preview/chunk.RRCPEHM4.js +1 -0
- package/dist/preview/{chunk.LOSMUESM.js → chunk.S5K4FLLG.js} +1 -1
- package/dist/preview/{chunk.ZRLXVYPG.js → chunk.SUQU4AXG.js} +1 -1
- package/dist/preview/{chunk.TIH2PDFH.js → chunk.SZKVNPEF.js} +1 -1
- package/dist/preview/chunk.T3F6BKIO.js +1 -0
- package/dist/preview/{chunk.V3V47QRE.js → chunk.U3MQUIJL.js} +1 -1
- package/dist/preview/{chunk.H5ADMSE7.js → chunk.U6YOAS4X.js} +1 -1
- package/dist/preview/chunk.UG727PEE.js +5 -0
- package/dist/preview/{chunk.NGDXH66B.js → chunk.V3K32XD7.js} +1 -1
- package/dist/preview/{chunk.QIV65FWE.js → chunk.V5VQCANB.js} +1 -1
- package/dist/preview/{chunk.RCM7NOPF.js → chunk.VEP4EJ2N.js} +1 -1
- package/dist/preview/chunk.VKJAGZNU.js +2 -0
- package/dist/preview/{chunk.N2K25KH3.js → chunk.VMBIFUYX.js} +1 -1
- package/dist/preview/{chunk.MUKDKVVC.js → chunk.VO6DBVZR.js} +1 -1
- package/dist/preview/{chunk.UUBYFBPN.js → chunk.VTUMPH4Z.js} +1 -1
- package/dist/preview/{chunk.3Q75TIGL.js → chunk.VXZFW52D.js} +1 -1
- package/dist/preview/{chunk.USZPOOLZ.js → chunk.VYPR2MZO.js} +1 -1
- package/dist/preview/chunk.W77OH637.js +1 -0
- package/dist/preview/{chunk.HPAGOEZG.js → chunk.WERBD5ZR.js} +1 -1
- package/dist/preview/{chunk.WUKHYLQT.js → chunk.WODEO2JF.js} +2 -2
- package/dist/preview/{chunk.JACGQ2PR.js → chunk.WUQOSVQU.js} +2 -2
- package/dist/preview/{chunk.N6MVK3KD.js → chunk.WVN62OMH.js} +1 -1
- package/dist/preview/{chunk.Z5AB2DBF.js → chunk.WZEA2UK6.js} +1 -1
- package/dist/preview/{chunk.VJXXCUKS.js → chunk.X2M7IOQA.js} +1 -1
- package/dist/preview/chunk.X5WIS4BC.js +1 -0
- package/dist/preview/{chunk.UHI3D7JC.js → chunk.XDPIS7RS.js} +1 -1
- package/dist/preview/{chunk.VIYECFKZ.js → chunk.XNW7PUAF.js} +1 -1
- package/dist/preview/chunk.XPML6T3P.js +1 -0
- package/dist/preview/{chunk.XEKLEHC3.js → chunk.Y2QDZLSY.js} +1 -1
- package/dist/preview/{chunk.2NB7U4EW.js → chunk.YJM23BJL.js} +1 -1
- package/dist/preview/chunk.YLGSXLXF.js +1 -0
- package/dist/preview/chunk.YLI6I6XP.js +1 -0
- package/dist/preview/chunk.YRYEWVNP.js +1 -0
- package/dist/preview/chunk.Z2TYCMBT.js +5 -0
- package/dist/preview/chunk.ZAFIZXGX.js +1 -0
- package/dist/preview/{chunk.I4JBWTZM.js → chunk.ZBYLAC3B.js} +1 -1
- package/dist/preview/chunk.ZOS5APMD.js +1 -0
- package/dist/preview/{chunk.TGVUIFKD.js → chunk.ZQCGDTQ3.js} +1 -1
- package/dist/preview/chunk.ZRIDKFTV.js +1 -0
- package/dist/preview/index.html +45 -45
- package/dist/preview/page.js +3 -3
- package/package.json +6 -6
- package/dist/preview/chunk.242EUAPE.js +0 -1
- package/dist/preview/chunk.2FGYWAID.js +0 -1
- package/dist/preview/chunk.4EEWBCT2.js +0 -1
- package/dist/preview/chunk.6CRRPXKP.js +0 -1
- package/dist/preview/chunk.6RID3OWK.js +0 -1
- package/dist/preview/chunk.A4UIM35E.js +0 -1
- package/dist/preview/chunk.DL26BKT7.js +0 -1
- package/dist/preview/chunk.H7POIT3V.js +0 -1
- package/dist/preview/chunk.HFYUAK5Z.js +0 -6
- package/dist/preview/chunk.HPUN5DKZ.js +0 -117
- package/dist/preview/chunk.J2CR4RRH.js +0 -1
- package/dist/preview/chunk.J4IULZFD.js +0 -1
- package/dist/preview/chunk.JHEVGLKB.js +0 -345
- package/dist/preview/chunk.JLBGJSCZ.js +0 -1
- package/dist/preview/chunk.JYJ4LZJJ.js +0 -5
- package/dist/preview/chunk.L3A6YLMT.js +0 -21
- package/dist/preview/chunk.LOZJQ5ZX.js +0 -1
- package/dist/preview/chunk.MUPO5S2A.js +0 -47
- package/dist/preview/chunk.O6F3K6CU.js +0 -1
- package/dist/preview/chunk.OVTCW3AI.js +0 -1
- package/dist/preview/chunk.QHYXXZRD.js +0 -1
- package/dist/preview/chunk.S2U5CEP4.js +0 -1
- package/dist/preview/chunk.SADG5RMV.js +0 -1
- package/dist/preview/chunk.SCYQSXW4.js +0 -1
- package/dist/preview/chunk.T3BWINOF.js +0 -1
- package/dist/preview/chunk.TNESS3LQ.js +0 -2
- package/dist/preview/chunk.UTWPZULC.js +0 -1
- package/dist/preview/chunk.V4KLBSC4.js +0 -1
- package/dist/preview/chunk.V5MYKNL7.js +0 -5
- package/dist/preview/chunk.VDAMCTNL.js +0 -1
- package/dist/preview/chunk.W4HBRXMY.js +0 -1
- package/dist/preview/chunk.XFZKP4IF.js +0 -2
- package/dist/preview/chunk.XQTMO5PW.js +0 -1
- package/dist/preview/chunk.Z7BCIYDW.js +0 -1
- package/dist/preview/chunk.ZOR6FKNI.js +0 -1
- package/dist/preview/chunk.ZTMEESII.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as rn,c as an}from"./chunk.UT6642FC.js";import{e as N}from"./chunk.2FLPDPEL.js";import{c as J}from"./chunk.2RVUDRRY.js";import{Gb as sn,Hb as E,Hc as on,Vb as V,Wa as H,Yb as Q,ba as F,ca as K,da as q,ea as nn,fa as en,ia as tn,ja as z,ka as B}from"./chunk.V5MYKNL7.js";function dn(){return{name:"insight",derive({store:n,nodes:d,kindSelection:t}){let f=[],y=l=>F(n.schema.tryDefinition(l.kind),l);for(let l of d){if([...n.schema.edgeKinds].reduce((c,S)=>c+n.graph.out(l.id,S).length+n.graph.in(l.id,S).length,0)===0){f.push({id:`insight:island:${l.id}`,text:`${y(l)} is connected to nothing yet`,nodeIds:[l.id]});continue}for(let c of n.schema.edgeKinds){let S=n.graph.in(l.id,c).length;if(S<3)continue;let s=[...n.graph.allEdges()].filter(a=>a.kind===c),e=s.length;e>=4&&S/e>.6&&f.push({id:`insight:load:${l.id}:${c}`,text:`${y(l)} ${mn(n,s,c,S)}`,nodeIds:[l.id]})}}for(let l of t){if(n.graph.nodesOfKind(l).length>0)continue;let A=n.schema.definitions.filter(c=>c.kind!==l).filter(c=>Object.values(c.edges).some(S=>S.to!=="*"&&S.to.includes(l))).map(c=>c.plural??`${c.kind}s`);A.length>0&&f.push({id:`insight:gap:${l}`,text:`Nothing here yet, though ${A.join(" and ")} expect to connect to these`,nodeIds:[]})}return{observations:f}}}}function mn(n,d,t,f){let y=new Set(d.map(s=>n.graph.getNode(s.from)?.kind).filter(s=>s!==void 0)),l=y.size===1?[...y][0]:void 0,A=d.length,c=J(n.schema,l??[...y][0]??"",t,"in"),S=s=>l?nn(n.schema,l,s):String(s);return f===A?`${c}: all ${S(f)}`:`${c}: ${f} of the ${S(A)}`}function cn(n){let d=new Map;if(n.length===0)return d;let t=n.slice(-512),f=new Set;for(let l of t)l.undoes&&f.add(l.undoes);let y=n[n.length-1].seq;for(let l of t){if(!l.mutation||f.has(l.id))continue;let A=Math.pow(.5,(y-l.seq)/64);d.set(l.mutation.name,(d.get(l.mutation.name)??0)+A)}return d}function un(n){return 8*(n/(n+1))}var kn=100;function fn(){return{name:"invariant",derive({store:n,selection:d,nodes:t,violations:f}){let y=s=>F(n.schema.tryDefinition(s.kind),s),l=new Set(d),A=f.filter(s=>s.nodeIds.some(e=>l.has(e))||s.subjectId!==void 0&&l.has(s.subjectId)),c=[],S=[];A.forEach((s,e)=>{S.push({id:`violation:${s.invariant}:${e}`,text:s.message,nodeIds:s.nodeIds}),s.repairs.forEach((a,h)=>{c.push({id:`invariant:${s.invariant}:${e}:${h}`,label:a.label,provider:"invariant",mutation:a.mutation,args:a.args??{},open:(a.missing??[]).map(m=>{let o=n.allMutations().find(g=>g.name===a.mutation);if(!o)return{name:m};let r=E(o.input).find(g=>g.name===m),k=r?r.kinds.includes("*")?n.graph.allNodes().map(g=>g.id):r.kinds.flatMap(g=>n.graph.nodesOfKind(g).map($=>$.id)):void 0;return{name:m,shape:N(o.input,m),...r?{kinds:r.kinds}:{},...k?{candidates:k}:{}}}),score:kn-h-(a.missing?.length??0),why:s.message,nodeIds:s.nodeIds,...s.subjectId===void 0?{}:{subjectId:s.subjectId}})})});for(let s of t){let e=n.allInvariants().filter(a=>{if(a.scope==="graph")return!1;let h=a.scope;return h.kind!==s.kind?!1:h.match?h.match(s):!0});e.length!==0&&(A.some(a=>a.subjectId===s.id||a.nodeIds.includes(s.id))||S.push({id:`holds:${s.id}`,text:`${y(s)} holds \u2014 nothing currently breaks ${e.length===1?"it":`any of its ${e.length} rules`}`,nodeIds:[s.id]}))}return{affordances:c,observations:S}}}}var U=40;function ln(){return{name:"schema",derive({store:n,selection:d,nodes:t,kindSelection:f,edgeSelection:y,principal:l}){let A=(e,a)=>l!==void 0&&!n.permits({name:e,args:a},l).ok,c=[];if(t.length===0&&y.length>0){for(let e of y){let a=n.graph.getNode(e.from),h=n.graph.getNode(e.to);if(!a||!h)continue;let m=an(n,e);m?.provisional&&c.push({id:`schema:edge:${V}:${e.kind}:${e.from}:${e.to}`,label:"Keep this link",provider:"schema",mutation:V,args:{kind:e.kind,from:e.from,to:e.to},open:[],score:64,why:rn(m),nodeIds:[e.from,e.to]});for(let o of n.allMutations()){let r=(o.connects??[]).includes(e.kind),k=(o.severs??[]).includes(e.kind);if(!r&&!k||o.derived?.relation!==void 0&&o.derived.kind!==a.kind)continue;let g={},$=[],j=E(o.input);for(let p of j){let w=p.kinds.includes("*")||p.kinds.includes(a.kind),P=p.kinds.includes("*")||p.kinds.includes(h.kind),v=w&&!j.some(I=>I!==p&&(I.kinds.includes(a.kind)||I.kinds.includes("*")));w&&!P?g[p.name]=e.from:P&&!w?g[p.name]=e.to:w&&P&&v?g[p.name]=e.from:$.push({name:p.name,kinds:p.kinds,candidates:[e.from,e.to],shape:N(o.input,p.name)})}for(let p of G(o.input,""))p in g||$.some(w=>w.name===p)||$.push({name:p,shape:N(o.input,p)});$.every(p=>p.optional===!0?!0:p.kinds!==void 0?(p.candidates?.length??0)>0:(p.candidates?.length??0)>0||p.shape!==void 0&&p.shape.type!=="unknown")&&(r&&!k&&$.length===0||c.push({id:`schema:edge:${o.name}:${e.kind}:${e.from}:${e.to}`,label:K(o),provider:"schema",mutation:o.name,args:g,open:$,...o.destructive?{destructive:!0}:{},score:(k?62:58)-$.length,why:`this line is "${J(n.schema,n.graph.getNode(e.from)?.kind??"",e.kind,"out")}"`,nodeIds:[e.from,e.to]}))}}return{affordances:c}}if(t.length===0&&f.length>0){let e=new Set(f),a=[];for(let h of n.allMutations()){if(!(h.creates??[]).some(r=>e.has(r)))continue;let m=[];for(let r of E(h.input)){let k=r.kinds.includes("*")?n.graph.allNodes().map(g=>g.id):r.kinds.flatMap(g=>n.graph.nodesOfKind(g).map($=>$.id));m.push({name:r.name,kinds:r.kinds,candidates:k,shape:N(h.input,r.name),...r.optional?{optional:!0}:{}})}for(let r of G(h.input,""))m.some(k=>k.name===r)||m.push({name:r,shape:N(h.input,r)});if(!m.every(r=>r.optional===!0?!0:r.kinds!==void 0?(r.candidates?.length??0)>0:(r.candidates?.length??0)>0||r.shape!==void 0&&r.shape.type!=="unknown")&&!A(h.name,{})){let r=m.filter(k=>k.optional!==!0&&k.kinds!==void 0&&!k.kinds.includes("*")&&(k.candidates?.length??0)===0);if(r.length>0){let k=[...new Set(r.flatMap(g=>g.kinds??[]))].map(g=>z(B(n.schema.tryDefinition(g),g)));a.push({id:`schema:waits:${h.name}`,text:`"${h.title??h.name}" cannot begin until there is ${k.length===1?k[0]:`${k.slice(0,-1).join(", ")} and ${k[k.length-1]}`}.`,nodeIds:[]})}continue}c.push({id:`schema:add:${h.name}`,label:K(h),provider:"schema",mutation:h.name,args:{},open:m,score:U-m.length,why:`this makes ${(h.creates??[]).filter(r=>e.has(r)).map(r=>z(B(n.schema.tryDefinition(r),r))).join(", ")}`,nodeIds:[]})}return{affordances:c,observations:a}}if(t.length===0)return{};let S=new Set(t.map(e=>e.kind)),s=(e,a,h)=>{let m=[];for(let o of n.graph.allEdges()){if(!a.includes(o.kind))continue;let r=o.from===e?o.to:o.to===e?o.from:null;if(!r)continue;let k=n.graph.getNode(r);k&&(!h.includes("*")&&!h.includes(k.kind)||m.includes(r)||m.push(r))}return m};for(let e of n.allMutations()){let a=e.subject;if(!a||!(a.kinds==="*"?!0:[...S].every(u=>a.kinds.includes(u))))continue;let m=e.derived?.act;if((m==="archive"||m==="merge")&&t.some(u=>H(u))||m==="unarchive"&&!t.some(u=>H(u))||m==="leave-alone"&&t.every(u=>Q(n,u.id))||m==="allow-tidying"&&!t.some(u=>Q(n,u.id)))continue;let o=t.length===1?t[0].id:null,r=e.severs??[],k=e.connects??[];if(o&&r.length>0&&k.length===0&&s(o,r,["*"]).length===0)continue;let g=[];for(let u of E(e.input)){if(u.name===a.arg)continue;let p=u.kinds.includes("*")?n.graph.allNodes().map(w=>w.id):u.kinds.flatMap(w=>n.graph.nodesOfKind(w).map(P=>P.id));if(o&&k.length>0){let w=new Set(s(o,k,u.kinds));p=p.filter(P=>!w.has(P))}else o&&r.length>0&&(p=s(o,r,u.kinds));g.push({name:u.name,kinds:u.kinds,candidates:p.filter(w=>!d.includes(w)),shape:N(e.input,u.name),...u.optional?{optional:!0}:{}})}for(let u of G(e.input,a.arg))g.some(p=>p.name===u)||g.push({name:u,shape:N(e.input,u)});if(g.length===0&&o){let u=yn(e.input,a.arg);if(u.length>0&&!vn(n,e.name,{[a.arg]:o}))for(let p of u){let w=E(e.input).find(P=>P.name===p);g.push({name:p,optional:!0,...w?{kinds:w.kinds}:{},shape:N(e.input,p)})}}if(!g.every(u=>u.optional===!0?!0:u.kinds!==void 0?(u.candidates?.length??0)>0:(u.candidates?.length??0)>0||u.shape!==void 0&&u.shape.type!=="unknown")&&!A(e.name,o?{[a.arg]:o}:{}))continue;let j=t.map(u=>({[a.arg]:u.id}));g.length===0&&!j.some(u=>n.wouldChange({name:e.name,args:u}))||c.push({id:`schema:${e.name}`,label:t.length>1?`${K(e)} (${t.length})`:K(e),provider:"schema",mutation:e.name,args:j[0]??{},open:g,...e.destructive?{destructive:!0}:{},...e.derived?.act==="archive"||e.derived?.act==="merge"||e.derived?.act==="leave-alone"||e.derived?.act==="allow-tidying"?{setsAside:!0}:{},...r.length>0||k.length>0?{ties:!0}:{},...t.length>1?{batch:j}:{},score:U-g.length,why:t.length>1?`all ${t.length} selected nodes are ${[...S].map(u=>en(n.schema,u).toLowerCase()).join(" or ")}`:`this is ${z(B(n.schema.tryDefinition(t[0].kind),t[0].kind))}`,nodeIds:t.map(u=>u.id)})}if(t.length===1){let e=t[0];for(let a of n.allMutations()){let h=a.subject,m=a.severs??[],o=a.connects??[];if(!h||m.length===0&&o.length===0)continue;let r=h.kinds==="*"?"*":h.kinds;if(r==="*"||r.includes(e.kind))continue;let k=E(a.input),g=k.find(v=>v.name!==h.arg&&(v.kinds.includes("*")||v.kinds.includes(e.kind)));if(!g)continue;let $=r,j=$.includes("*")?n.graph.allNodes().map(v=>v.id):$.flatMap(v=>n.graph.nodesOfKind(v).map(I=>I.id)),u=new Set(s(e.id,o.length>0?o:m,$)),p=o.length>0?j.filter(v=>!u.has(v)):j.filter(v=>u.has(v));if(p.length===0)continue;let w=[{name:h.arg,kinds:$,candidates:p,shape:N(a.input,h.arg)}];for(let v of k){if(v.name===g.name||v.name===h.arg)continue;let I=v.kinds.includes("*")?n.graph.allNodes().map(D=>D.id):v.kinds.flatMap(D=>n.graph.nodesOfKind(D).map(O=>O.id));w.push({name:v.name,kinds:v.kinds,candidates:I,shape:N(a.input,v.name),...v.optional?{optional:!0}:{}})}for(let v of G(a.input,g.name))v===h.arg||w.some(I=>I.name===v)||w.push({name:v,shape:N(a.input,v)});w.every(v=>v.optional===!0?!0:v.kinds!==void 0?(v.candidates?.length??0)>0:(v.candidates?.length??0)>0||v.shape!==void 0&&v.shape.type!=="unknown")&&c.push({id:`schema:tie:${a.name}:${e.id}`,label:a.fromTheOtherEnd??K(a),provider:"schema",mutation:a.name,args:{[g.name]:e.id},open:w,ties:!0,...a.destructive?{destructive:!0}:{},score:U-w.length+2,why:`${m.length>0?"this one is on":"this one could join"} ${w[0].candidates.length===1?"it":"one of these"}`,nodeIds:[e.id]})}}return{affordances:c}}}}function yn(n,d){let t=n.shape;return t?Object.entries(t).filter(([f,y])=>f!==d&&y.safeParse(void 0).success).map(([f])=>f):[]}function vn(n,d,t){try{return n.preview({name:d,args:t}),!0}catch{return!1}}function G(n,d){let t=n.shape;return t?Object.entries(t).filter(([f,y])=>f!==d&&!y.safeParse(void 0).success).map(([f])=>f):[]}var bn=70,Sn=80,wn=new Set(["id","kind"]);function hn(){return{name:"structure",derive({store:n,nodes:d}){let t=c=>F(n.schema.tryDefinition(c.kind),c);if(d.length<2)return{};let f=[],y=[],l=d.map(c=>c.id);for(let c of n.schema.edgeKinds){let S=An(d.map(e=>new Set([...n.graph.out(e.id,c).map(a=>a.id),...n.graph.in(e.id,c).map(a=>a.id)])));for(let e of S){let a=n.graph.getNode(e);a&&f.push({id:`shared:${c}:${e}`,text:`all ${d.length} share "${t(a)}" (${q(c).toLowerCase()})`,nodeIds:[...l,e]})}let s=new Map;for(let e of d)for(let a of[...n.graph.out(e.id,c),...n.graph.in(e.id,c)])s.set(a.id,(s.get(a.id)??0)+1);for(let[e,a]of s){if(a!==d.length-1||d.length<3||l.includes(e))continue;let h=n.graph.getNode(e);if(!h)continue;let m=d.find(o=>![...n.graph.out(o.id,c),...n.graph.in(o.id,c)].some(r=>r.id===e));if(m&&(f.push({id:`near-shared:${c}:${e}`,text:`all but "${t(m)}" share "${t(h)}" (${q(c).toLowerCase()})`,nodeIds:[...l,e]}),!(!n.schema.edgeAllowed(c,m.kind,h.kind)&&!n.schema.edgeAllowed(c,h.kind,m.kind))))for(let o of n.allMutations()){let r=o.subject;if(!r||r.kinds!=="*"&&!r.kinds.includes(m.kind)||(o.connects!==void 0||o.severs!==void 0)&&!(o.connects??[]).includes(c))continue;let g=$n(o.input,h.kind);g&&y.push({id:`structure:join:${o.name}:${m.id}:${e}`,label:`${K(o)}: bring "${t(m)}" in line with the others`,provider:"structure",mutation:o.name,args:{[r.arg]:m.id,[g]:e},open:[],score:bn,why:`every other selected node is connected to "${t(h)}"`,nodeIds:[m.id,e]})}}}let A=new Map;for(let c of d)A.set(c.kind,[...A.get(c.kind)??[],c]);for(let[c,S]of A){if(S.length<2)continue;let s=S,e=S.map(o=>o.id),a=A.size>1?`${c}:`:"",h=new Set;for(let o of s)for(let r of Object.keys(o))wn.has(r)||h.add(r);let m=o=>n.schema.definitions.find(r=>r.kind===o);for(let o of[...h].sort()){let r=m(s[0].kind),k=tn(r,o).toLowerCase(),g=r?.display?.format?.[o],$=O=>{if(!g)return O;try{return String(g(JSON.parse(O)))}catch{return O}},j=s.map(O=>O[o]),u=new Map;if(j.forEach((O,R)=>{let L=JSON.stringify(O??null),x=u.get(L);x?x.push(s[R]):u.set(L,[s[R]])}),u.size===1){let O=[...u.keys()][0];if(O==="null")continue;f.push({id:`agree:${a}${o}`,text:`all ${s.length} share the ${k} ${$(O)}`,nodeIds:e});continue}if(s.length<3||u.size!==2)continue;let p=[...u.entries()].sort((O,R)=>R[1].length-O[1].length),[w,P]=p[0],[,v]=p[1];if(v.length!==1||w==="null")continue;let I=v[0],D=JSON.parse(w);f.push({id:`odd-one-out:${a}${o}`,text:`${P.length} share the ${k} ${$(w)}; "${t(I)}" does not`,nodeIds:e});for(let O of n.allMutations()){let R=O.subject;if(!R||R.kinds!=="*"&&!R.kinds.includes(I.kind))continue;let L=gn(O.input);if(!L||!(o in L))continue;let x={[R.arg]:I.id,[o]:D},T=!0;for(let[C,Z]of Object.entries(L)){if(C in x||Z.safeParse(void 0).success)continue;let i=I[C];if(i===void 0){T=!1;break}x[C]=i}!T||!O.input.safeParse(x).success||y.push({id:`structure:align:${O.name}:${o}:${I.id}`,label:`Align the ${k} of "${t(I)}" with the other ${P.length}`,provider:"structure",mutation:O.name,args:x,open:[],score:Sn,why:`${P.length} of ${s.length} share the ${k} ${$(w)}`,nodeIds:e})}}}return{affordances:y,observations:f}}}}function An(n){if(n.length===0)return[];let[d,...t]=n;return[...d].filter(f=>t.every(y=>y.has(f))).sort()}function gn(n){return n.shape??null}function $n(n,d){let t=gn(n);if(!t)return null;for(let[f]of Object.entries(t)){let y=sn(t[f]);if(y&&(y.includes("*")||y.includes(d)))return f}return null}function On(){return[fn(),hn(),ln(),dn()]}function Vn(n,d,t={}){let f=pn(),y=t.providers??On(),l=d.map(i=>n.graph.getNode(i)).filter(i=>i!==void 0),A={store:n,selection:d,nodes:l,kindSelection:t.kindSelection??[],edgeSelection:t.edgeSelection??[],violations:n.violations(t.context),context:t.context??{},principal:t.principal??{kind:"human"}},c=[],S=[];for(let i of y){let b=i.derive(A);c.push(...b.affordances??[]),S.push(...b.observations??[])}let s=new Set(n.allMutations().filter(i=>i.pinned).map(i=>i.name)),e=new Set(t.pins?.pinned??[]),a=new Set(t.pins?.unpinned??[]),h=i=>e.has(i.mutation)?"user":s.has(i.mutation)&&!a.has(i.mutation)?"declared":void 0,m=i=>{let b=h(i);return b?{...i,pinned:b}:i},o=new Map;for(let[i,b]of cn(n.log.all()))o.set(i,un(b));let r=i=>i.pinned==="user"?0:i.pinned==="declared"?1:2,k=i=>i.score+(o.get(i.mutation)??0),g=new Map(n.allMutations().map(i=>[i.name,i])),$=new Map,j=i=>{let b=g.get(i.mutation);if(!b)return[];let M=$.get(i.mutation);M||(M=E(b.input).map(W=>W.name),$.set(i.mutation,M));let _=[];for(let W of i.batch??[i.args])for(let X of M){let Y=W[X]??i.args[X];typeof Y=="string"&&_.push(Y)}return _},u=t.focus,p=4,w=i=>i.open.length>0?1:0,P=i=>{if(u===void 0)return p;let b=j(i);return b.length>0?b.includes(u)?v(i,0):p:i.nodeIds.includes(u)||i.subjectId===u?v(i,1):p},v=(i,b)=>i.provider==="invariant"?b:2+w(i),I=i=>i.setsAside?1:0,D=In(c).map(m),O=new Map(D.map((i,b)=>[i,b])),R=D.sort((i,b)=>{let M=Number(i.destructive??!1)-Number(b.destructive??!1);if(M!==0)return M;let _=I(i)-I(b);if(_!==0)return _;let W=P(i)-P(b);return W!==0?W:P(i)<2?O.get(i)-O.get(b):+(b.provider==="invariant")-+(i.provider==="invariant")||r(i)-r(b)||k(b)-k(i)||i.id.localeCompare(b.id)}),L=t.principal??{kind:"human"},x=[],T=[];for(let i of R){let b=n.permits({name:i.mutation,args:{...i.args,...i.batch?.[0]??{}}},L);if(b.ok)x.push(i);else{let M=jn(n,i,L);if(M==="done")continue;M?x.push(M):T.push({...i,refusal:b.refusal})}}let C=x.map((i,b)=>({...i,rank:b})),Z=T.map((i,b)=>({...i,rank:x.length+b}));return{affordances:t.limit===void 0?C:C.slice(0,t.limit),withheld:Z,observations:Pn(S),ms:pn()-f}}function In(n){let d=new Map;for(let t of n){let f=[t.mutation,JSON.stringify(t.args),JSON.stringify(t.batch??null)].join("|"),y=d.get(f);(!y||t.score>y.score)&&d.set(f,t)}return[...d.values()]}function Pn(n){let d=new Map;for(let t of n)d.set(t.text,t);return[...d.values()]}function pn(){return typeof performance<"u"?performance.now():Date.now()}function Qn(n,d,t={},f={}){let y=(d.batch??[d.args]).map(A=>({name:d.mutation,args:{...d.args,...A,...t}})),l=n.allMutations().find(A=>A.name===d.mutation);return n.applyAll(y,{...l?.describe?{}:{intent:d.label},...f.author?{author:f.author}:{}})}function Un(n,d,t={},f={}){try{return n.preview({name:d.mutation,args:{...d.args,...t}})}catch(y){throw f.pressed&&on(y,f.pressed.author?.id),y}}function jn(n,d,t){let f=n.allMutations().find(s=>s.name===d.mutation)?.subject,y=f!==void 0&&d.args[f.arg]===void 0,l=y?d.open.find(s=>s.name===f.arg):d.open.find(s=>s.name!==f?.arg&&s.candidates);if(!l?.candidates)return;let A=s=>n.permits({name:d.mutation,args:{...d.args,...d.batch?.[0]??{},[l.name]:s}},t).ok,c=l.candidates.filter(A),S=t.id===void 0?void 0:n.graph.getNode(t.id);if(c.length===0){let s=y?f.kinds:"*";return S!==void 0&&(s==="*"||s.includes(S.kind))&&A(S.id)?"done":void 0}return c.length===1&&c[0]===t.id?{...d,args:{...d.args,[l.name]:t.id},open:d.open.filter(s=>s!==l)}:{...d,open:d.open.map(s=>s===l?{...s,candidates:c}:s)}}export{Vn as a,Qn as b,Un as c};
|
|
1
|
+
import{b as rn,c as an}from"./chunk.UT6642FC.js";import{e as N}from"./chunk.LFJH6X6O.js";import{c as J}from"./chunk.PCTVLNOS.js";import{Hb as sn,Ib as E,Jc as on,Wb as V,Xa as H,Zb as Q,ca as F,da as K,ea as q,fa as nn,ga as en,ja as tn,ka as z,la as B}from"./chunk.UG727PEE.js";function dn(){return{name:"insight",derive({store:n,nodes:d,kindSelection:t}){let f=[],y=l=>F(n.schema.tryDefinition(l.kind),l);for(let l of d){if([...n.schema.edgeKinds].reduce((c,S)=>c+n.graph.out(l.id,S).length+n.graph.in(l.id,S).length,0)===0){f.push({id:`insight:island:${l.id}`,text:`${y(l)} is connected to nothing yet`,nodeIds:[l.id]});continue}for(let c of n.schema.edgeKinds){let S=n.graph.in(l.id,c).length;if(S<3)continue;let s=[...n.graph.allEdges()].filter(a=>a.kind===c),e=s.length;e>=4&&S/e>.6&&f.push({id:`insight:load:${l.id}:${c}`,text:`${y(l)} ${mn(n,s,c,S)}`,nodeIds:[l.id]})}}for(let l of t){if(n.graph.nodesOfKind(l).length>0)continue;let A=n.schema.definitions.filter(c=>c.kind!==l).filter(c=>Object.values(c.edges).some(S=>S.to!=="*"&&S.to.includes(l))).map(c=>c.plural??`${c.kind}s`);A.length>0&&f.push({id:`insight:gap:${l}`,text:`Nothing here yet, though ${A.join(" and ")} expect to connect to these`,nodeIds:[]})}return{observations:f}}}}function mn(n,d,t,f){let y=new Set(d.map(s=>n.graph.getNode(s.from)?.kind).filter(s=>s!==void 0)),l=y.size===1?[...y][0]:void 0,A=d.length,c=J(n.schema,l??[...y][0]??"",t,"in"),S=s=>l?nn(n.schema,l,s):String(s);return f===A?`${c}: all ${S(f)}`:`${c}: ${f} of the ${S(A)}`}function cn(n){let d=new Map;if(n.length===0)return d;let t=n.slice(-512),f=new Set;for(let l of t)l.undoes&&f.add(l.undoes);let y=n[n.length-1].seq;for(let l of t){if(!l.mutation||f.has(l.id))continue;let A=Math.pow(.5,(y-l.seq)/64);d.set(l.mutation.name,(d.get(l.mutation.name)??0)+A)}return d}function un(n){return 8*(n/(n+1))}var kn=100;function fn(){return{name:"invariant",derive({store:n,selection:d,nodes:t,violations:f}){let y=s=>F(n.schema.tryDefinition(s.kind),s),l=new Set(d),A=f.filter(s=>s.nodeIds.some(e=>l.has(e))||s.subjectId!==void 0&&l.has(s.subjectId)),c=[],S=[];A.forEach((s,e)=>{S.push({id:`violation:${s.invariant}:${e}`,text:s.message,nodeIds:s.nodeIds}),s.repairs.forEach((a,h)=>{c.push({id:`invariant:${s.invariant}:${e}:${h}`,label:a.label,provider:"invariant",mutation:a.mutation,args:a.args??{},open:(a.missing??[]).map(m=>{let o=n.allMutations().find(g=>g.name===a.mutation);if(!o)return{name:m};let r=E(o.input).find(g=>g.name===m),k=r?r.kinds.includes("*")?n.graph.allNodes().map(g=>g.id):r.kinds.flatMap(g=>n.graph.nodesOfKind(g).map($=>$.id)):void 0;return{name:m,shape:N(o.input,m),...r?{kinds:r.kinds}:{},...k?{candidates:k}:{}}}),score:kn-h-(a.missing?.length??0),why:s.message,nodeIds:s.nodeIds,...s.subjectId===void 0?{}:{subjectId:s.subjectId}})})});for(let s of t){let e=n.allInvariants().filter(a=>{if(a.scope==="graph")return!1;let h=a.scope;return h.kind!==s.kind?!1:h.match?h.match(s):!0});e.length!==0&&(A.some(a=>a.subjectId===s.id||a.nodeIds.includes(s.id))||S.push({id:`holds:${s.id}`,text:`${y(s)} holds \u2014 nothing currently breaks ${e.length===1?"it":`any of its ${e.length} rules`}`,nodeIds:[s.id]}))}return{affordances:c,observations:S}}}}var U=40;function ln(){return{name:"schema",derive({store:n,selection:d,nodes:t,kindSelection:f,edgeSelection:y,principal:l}){let A=(e,a)=>l!==void 0&&!n.permits({name:e,args:a},l).ok,c=[];if(t.length===0&&y.length>0){for(let e of y){let a=n.graph.getNode(e.from),h=n.graph.getNode(e.to);if(!a||!h)continue;let m=an(n,e);m?.provisional&&c.push({id:`schema:edge:${V}:${e.kind}:${e.from}:${e.to}`,label:"Keep this link",provider:"schema",mutation:V,args:{kind:e.kind,from:e.from,to:e.to},open:[],score:64,why:rn(m),nodeIds:[e.from,e.to]});for(let o of n.allMutations()){let r=(o.connects??[]).includes(e.kind),k=(o.severs??[]).includes(e.kind);if(!r&&!k||o.derived?.relation!==void 0&&o.derived.kind!==a.kind)continue;let g={},$=[],j=E(o.input);for(let p of j){let w=p.kinds.includes("*")||p.kinds.includes(a.kind),P=p.kinds.includes("*")||p.kinds.includes(h.kind),v=w&&!j.some(I=>I!==p&&(I.kinds.includes(a.kind)||I.kinds.includes("*")));w&&!P?g[p.name]=e.from:P&&!w?g[p.name]=e.to:w&&P&&v?g[p.name]=e.from:$.push({name:p.name,kinds:p.kinds,candidates:[e.from,e.to],shape:N(o.input,p.name)})}for(let p of G(o.input,""))p in g||$.some(w=>w.name===p)||$.push({name:p,shape:N(o.input,p)});$.every(p=>p.optional===!0?!0:p.kinds!==void 0?(p.candidates?.length??0)>0:(p.candidates?.length??0)>0||p.shape!==void 0&&p.shape.type!=="unknown")&&(r&&!k&&$.length===0||c.push({id:`schema:edge:${o.name}:${e.kind}:${e.from}:${e.to}`,label:K(o),provider:"schema",mutation:o.name,args:g,open:$,...o.destructive?{destructive:!0}:{},score:(k?62:58)-$.length,why:`this line is "${J(n.schema,n.graph.getNode(e.from)?.kind??"",e.kind,"out")}"`,nodeIds:[e.from,e.to]}))}}return{affordances:c}}if(t.length===0&&f.length>0){let e=new Set(f),a=[];for(let h of n.allMutations()){if(!(h.creates??[]).some(r=>e.has(r)))continue;let m=[];for(let r of E(h.input)){let k=r.kinds.includes("*")?n.graph.allNodes().map(g=>g.id):r.kinds.flatMap(g=>n.graph.nodesOfKind(g).map($=>$.id));m.push({name:r.name,kinds:r.kinds,candidates:k,shape:N(h.input,r.name),...r.optional?{optional:!0}:{}})}for(let r of G(h.input,""))m.some(k=>k.name===r)||m.push({name:r,shape:N(h.input,r)});if(!m.every(r=>r.optional===!0?!0:r.kinds!==void 0?(r.candidates?.length??0)>0:(r.candidates?.length??0)>0||r.shape!==void 0&&r.shape.type!=="unknown")&&!A(h.name,{})){let r=m.filter(k=>k.optional!==!0&&k.kinds!==void 0&&!k.kinds.includes("*")&&(k.candidates?.length??0)===0);if(r.length>0){let k=[...new Set(r.flatMap(g=>g.kinds??[]))].map(g=>z(B(n.schema.tryDefinition(g),g)));a.push({id:`schema:waits:${h.name}`,text:`"${h.title??h.name}" cannot begin until there is ${k.length===1?k[0]:`${k.slice(0,-1).join(", ")} and ${k[k.length-1]}`}.`,nodeIds:[]})}continue}c.push({id:`schema:add:${h.name}`,label:K(h),provider:"schema",mutation:h.name,args:{},open:m,score:U-m.length,why:`this makes ${(h.creates??[]).filter(r=>e.has(r)).map(r=>z(B(n.schema.tryDefinition(r),r))).join(", ")}`,nodeIds:[]})}return{affordances:c,observations:a}}if(t.length===0)return{};let S=new Set(t.map(e=>e.kind)),s=(e,a,h)=>{let m=[];for(let o of n.graph.allEdges()){if(!a.includes(o.kind))continue;let r=o.from===e?o.to:o.to===e?o.from:null;if(!r)continue;let k=n.graph.getNode(r);k&&(!h.includes("*")&&!h.includes(k.kind)||m.includes(r)||m.push(r))}return m};for(let e of n.allMutations()){let a=e.subject;if(!a||!(a.kinds==="*"?!0:[...S].every(u=>a.kinds.includes(u))))continue;let m=e.derived?.act;if((m==="archive"||m==="merge")&&t.some(u=>H(u))||m==="unarchive"&&!t.some(u=>H(u))||m==="leave-alone"&&t.every(u=>Q(n,u.id))||m==="allow-tidying"&&!t.some(u=>Q(n,u.id)))continue;let o=t.length===1?t[0].id:null,r=e.severs??[],k=e.connects??[];if(o&&r.length>0&&k.length===0&&s(o,r,["*"]).length===0)continue;let g=[];for(let u of E(e.input)){if(u.name===a.arg)continue;let p=u.kinds.includes("*")?n.graph.allNodes().map(w=>w.id):u.kinds.flatMap(w=>n.graph.nodesOfKind(w).map(P=>P.id));if(o&&k.length>0){let w=new Set(s(o,k,u.kinds));p=p.filter(P=>!w.has(P))}else o&&r.length>0&&(p=s(o,r,u.kinds));g.push({name:u.name,kinds:u.kinds,candidates:p.filter(w=>!d.includes(w)),shape:N(e.input,u.name),...u.optional?{optional:!0}:{}})}for(let u of G(e.input,a.arg))g.some(p=>p.name===u)||g.push({name:u,shape:N(e.input,u)});if(g.length===0&&o){let u=yn(e.input,a.arg);if(u.length>0&&!vn(n,e.name,{[a.arg]:o}))for(let p of u){let w=E(e.input).find(P=>P.name===p);g.push({name:p,optional:!0,...w?{kinds:w.kinds}:{},shape:N(e.input,p)})}}if(!g.every(u=>u.optional===!0?!0:u.kinds!==void 0?(u.candidates?.length??0)>0:(u.candidates?.length??0)>0||u.shape!==void 0&&u.shape.type!=="unknown")&&!A(e.name,o?{[a.arg]:o}:{}))continue;let j=t.map(u=>({[a.arg]:u.id}));g.length===0&&!j.some(u=>n.wouldChange({name:e.name,args:u}))||c.push({id:`schema:${e.name}`,label:t.length>1?`${K(e)} (${t.length})`:K(e),provider:"schema",mutation:e.name,args:j[0]??{},open:g,...e.destructive?{destructive:!0}:{},...e.derived?.act==="archive"||e.derived?.act==="merge"||e.derived?.act==="leave-alone"||e.derived?.act==="allow-tidying"?{setsAside:!0}:{},...r.length>0||k.length>0?{ties:!0}:{},...t.length>1?{batch:j}:{},score:U-g.length,why:t.length>1?`all ${t.length} selected nodes are ${[...S].map(u=>en(n.schema,u).toLowerCase()).join(" or ")}`:`this is ${z(B(n.schema.tryDefinition(t[0].kind),t[0].kind))}`,nodeIds:t.map(u=>u.id)})}if(t.length===1){let e=t[0];for(let a of n.allMutations()){let h=a.subject,m=a.severs??[],o=a.connects??[];if(!h||m.length===0&&o.length===0)continue;let r=h.kinds==="*"?"*":h.kinds;if(r==="*"||r.includes(e.kind))continue;let k=E(a.input),g=k.find(v=>v.name!==h.arg&&(v.kinds.includes("*")||v.kinds.includes(e.kind)));if(!g)continue;let $=r,j=$.includes("*")?n.graph.allNodes().map(v=>v.id):$.flatMap(v=>n.graph.nodesOfKind(v).map(I=>I.id)),u=new Set(s(e.id,o.length>0?o:m,$)),p=o.length>0?j.filter(v=>!u.has(v)):j.filter(v=>u.has(v));if(p.length===0)continue;let w=[{name:h.arg,kinds:$,candidates:p,shape:N(a.input,h.arg)}];for(let v of k){if(v.name===g.name||v.name===h.arg)continue;let I=v.kinds.includes("*")?n.graph.allNodes().map(D=>D.id):v.kinds.flatMap(D=>n.graph.nodesOfKind(D).map(O=>O.id));w.push({name:v.name,kinds:v.kinds,candidates:I,shape:N(a.input,v.name),...v.optional?{optional:!0}:{}})}for(let v of G(a.input,g.name))v===h.arg||w.some(I=>I.name===v)||w.push({name:v,shape:N(a.input,v)});w.every(v=>v.optional===!0?!0:v.kinds!==void 0?(v.candidates?.length??0)>0:(v.candidates?.length??0)>0||v.shape!==void 0&&v.shape.type!=="unknown")&&c.push({id:`schema:tie:${a.name}:${e.id}`,label:a.fromTheOtherEnd??K(a),provider:"schema",mutation:a.name,args:{[g.name]:e.id},open:w,ties:!0,...a.destructive?{destructive:!0}:{},score:U-w.length+2,why:`${m.length>0?"this one is on":"this one could join"} ${w[0].candidates.length===1?"it":"one of these"}`,nodeIds:[e.id]})}}return{affordances:c}}}}function yn(n,d){let t=n.shape;return t?Object.entries(t).filter(([f,y])=>f!==d&&y.safeParse(void 0).success).map(([f])=>f):[]}function vn(n,d,t){try{return n.preview({name:d,args:t}),!0}catch{return!1}}function G(n,d){let t=n.shape;return t?Object.entries(t).filter(([f,y])=>f!==d&&!y.safeParse(void 0).success).map(([f])=>f):[]}var bn=70,Sn=80,wn=new Set(["id","kind"]);function hn(){return{name:"structure",derive({store:n,nodes:d}){let t=c=>F(n.schema.tryDefinition(c.kind),c);if(d.length<2)return{};let f=[],y=[],l=d.map(c=>c.id);for(let c of n.schema.edgeKinds){let S=An(d.map(e=>new Set([...n.graph.out(e.id,c).map(a=>a.id),...n.graph.in(e.id,c).map(a=>a.id)])));for(let e of S){let a=n.graph.getNode(e);a&&f.push({id:`shared:${c}:${e}`,text:`all ${d.length} share "${t(a)}" (${q(c).toLowerCase()})`,nodeIds:[...l,e]})}let s=new Map;for(let e of d)for(let a of[...n.graph.out(e.id,c),...n.graph.in(e.id,c)])s.set(a.id,(s.get(a.id)??0)+1);for(let[e,a]of s){if(a!==d.length-1||d.length<3||l.includes(e))continue;let h=n.graph.getNode(e);if(!h)continue;let m=d.find(o=>![...n.graph.out(o.id,c),...n.graph.in(o.id,c)].some(r=>r.id===e));if(m&&(f.push({id:`near-shared:${c}:${e}`,text:`all but "${t(m)}" share "${t(h)}" (${q(c).toLowerCase()})`,nodeIds:[...l,e]}),!(!n.schema.edgeAllowed(c,m.kind,h.kind)&&!n.schema.edgeAllowed(c,h.kind,m.kind))))for(let o of n.allMutations()){let r=o.subject;if(!r||r.kinds!=="*"&&!r.kinds.includes(m.kind)||(o.connects!==void 0||o.severs!==void 0)&&!(o.connects??[]).includes(c))continue;let g=$n(o.input,h.kind);g&&y.push({id:`structure:join:${o.name}:${m.id}:${e}`,label:`${K(o)}: bring "${t(m)}" in line with the others`,provider:"structure",mutation:o.name,args:{[r.arg]:m.id,[g]:e},open:[],score:bn,why:`every other selected node is connected to "${t(h)}"`,nodeIds:[m.id,e]})}}}let A=new Map;for(let c of d)A.set(c.kind,[...A.get(c.kind)??[],c]);for(let[c,S]of A){if(S.length<2)continue;let s=S,e=S.map(o=>o.id),a=A.size>1?`${c}:`:"",h=new Set;for(let o of s)for(let r of Object.keys(o))wn.has(r)||h.add(r);let m=o=>n.schema.definitions.find(r=>r.kind===o);for(let o of[...h].sort()){let r=m(s[0].kind),k=tn(r,o).toLowerCase(),g=r?.display?.format?.[o],$=O=>{if(!g)return O;try{return String(g(JSON.parse(O)))}catch{return O}},j=s.map(O=>O[o]),u=new Map;if(j.forEach((O,R)=>{let L=JSON.stringify(O??null),x=u.get(L);x?x.push(s[R]):u.set(L,[s[R]])}),u.size===1){let O=[...u.keys()][0];if(O==="null")continue;f.push({id:`agree:${a}${o}`,text:`all ${s.length} share the ${k} ${$(O)}`,nodeIds:e});continue}if(s.length<3||u.size!==2)continue;let p=[...u.entries()].sort((O,R)=>R[1].length-O[1].length),[w,P]=p[0],[,v]=p[1];if(v.length!==1||w==="null")continue;let I=v[0],D=JSON.parse(w);f.push({id:`odd-one-out:${a}${o}`,text:`${P.length} share the ${k} ${$(w)}; "${t(I)}" does not`,nodeIds:e});for(let O of n.allMutations()){let R=O.subject;if(!R||R.kinds!=="*"&&!R.kinds.includes(I.kind))continue;let L=gn(O.input);if(!L||!(o in L))continue;let x={[R.arg]:I.id,[o]:D},T=!0;for(let[C,Z]of Object.entries(L)){if(C in x||Z.safeParse(void 0).success)continue;let i=I[C];if(i===void 0){T=!1;break}x[C]=i}!T||!O.input.safeParse(x).success||y.push({id:`structure:align:${O.name}:${o}:${I.id}`,label:`Align the ${k} of "${t(I)}" with the other ${P.length}`,provider:"structure",mutation:O.name,args:x,open:[],score:Sn,why:`${P.length} of ${s.length} share the ${k} ${$(w)}`,nodeIds:e})}}}return{affordances:y,observations:f}}}}function An(n){if(n.length===0)return[];let[d,...t]=n;return[...d].filter(f=>t.every(y=>y.has(f))).sort()}function gn(n){return n.shape??null}function $n(n,d){let t=gn(n);if(!t)return null;for(let[f]of Object.entries(t)){let y=sn(t[f]);if(y&&(y.includes("*")||y.includes(d)))return f}return null}function On(){return[fn(),hn(),ln(),dn()]}function Vn(n,d,t={}){let f=pn(),y=t.providers??On(),l=d.map(i=>n.graph.getNode(i)).filter(i=>i!==void 0),A={store:n,selection:d,nodes:l,kindSelection:t.kindSelection??[],edgeSelection:t.edgeSelection??[],violations:n.violations(t.context),context:t.context??{},principal:t.principal??{kind:"human"}},c=[],S=[];for(let i of y){let b=i.derive(A);c.push(...b.affordances??[]),S.push(...b.observations??[])}let s=new Set(n.allMutations().filter(i=>i.pinned).map(i=>i.name)),e=new Set(t.pins?.pinned??[]),a=new Set(t.pins?.unpinned??[]),h=i=>e.has(i.mutation)?"user":s.has(i.mutation)&&!a.has(i.mutation)?"declared":void 0,m=i=>{let b=h(i);return b?{...i,pinned:b}:i},o=new Map;for(let[i,b]of cn(n.log.all()))o.set(i,un(b));let r=i=>i.pinned==="user"?0:i.pinned==="declared"?1:2,k=i=>i.score+(o.get(i.mutation)??0),g=new Map(n.allMutations().map(i=>[i.name,i])),$=new Map,j=i=>{let b=g.get(i.mutation);if(!b)return[];let M=$.get(i.mutation);M||(M=E(b.input).map(W=>W.name),$.set(i.mutation,M));let _=[];for(let W of i.batch??[i.args])for(let X of M){let Y=W[X]??i.args[X];typeof Y=="string"&&_.push(Y)}return _},u=t.focus,p=4,w=i=>i.open.length>0?1:0,P=i=>{if(u===void 0)return p;let b=j(i);return b.length>0?b.includes(u)?v(i,0):p:i.nodeIds.includes(u)||i.subjectId===u?v(i,1):p},v=(i,b)=>i.provider==="invariant"?b:2+w(i),I=i=>i.setsAside?1:0,D=In(c).map(m),O=new Map(D.map((i,b)=>[i,b])),R=D.sort((i,b)=>{let M=Number(i.destructive??!1)-Number(b.destructive??!1);if(M!==0)return M;let _=I(i)-I(b);if(_!==0)return _;let W=P(i)-P(b);return W!==0?W:P(i)<2?O.get(i)-O.get(b):+(b.provider==="invariant")-+(i.provider==="invariant")||r(i)-r(b)||k(b)-k(i)||i.id.localeCompare(b.id)}),L=t.principal??{kind:"human"},x=[],T=[];for(let i of R){let b=n.permits({name:i.mutation,args:{...i.args,...i.batch?.[0]??{}}},L);if(b.ok)x.push(i);else{let M=jn(n,i,L);if(M==="done")continue;M?x.push(M):T.push({...i,refusal:b.refusal})}}let C=x.map((i,b)=>({...i,rank:b})),Z=T.map((i,b)=>({...i,rank:x.length+b}));return{affordances:t.limit===void 0?C:C.slice(0,t.limit),withheld:Z,observations:Pn(S),ms:pn()-f}}function In(n){let d=new Map;for(let t of n){let f=[t.mutation,JSON.stringify(t.args),JSON.stringify(t.batch??null)].join("|"),y=d.get(f);(!y||t.score>y.score)&&d.set(f,t)}return[...d.values()]}function Pn(n){let d=new Map;for(let t of n)d.set(t.text,t);return[...d.values()]}function pn(){return typeof performance<"u"?performance.now():Date.now()}function Qn(n,d,t={},f={}){let y=(d.batch??[d.args]).map(A=>({name:d.mutation,args:{...d.args,...A,...t}})),l=n.allMutations().find(A=>A.name===d.mutation);return n.applyAll(y,{...l?.describe?{}:{intent:d.label},...f.author?{author:f.author}:{}})}function Un(n,d,t={},f={}){try{return n.preview({name:d.mutation,args:{...d.args,...t}})}catch(y){throw f.pressed&&on(y,f.pressed.author?.id),y}}function jn(n,d,t){let f=n.allMutations().find(s=>s.name===d.mutation)?.subject,y=f!==void 0&&d.args[f.arg]===void 0,l=y?d.open.find(s=>s.name===f.arg):d.open.find(s=>s.name!==f?.arg&&s.candidates);if(!l?.candidates)return;let A=s=>n.permits({name:d.mutation,args:{...d.args,...d.batch?.[0]??{},[l.name]:s}},t).ok,c=l.candidates.filter(A),S=t.id===void 0?void 0:n.graph.getNode(t.id);if(c.length===0){let s=y?f.kinds:"*";return S!==void 0&&(s==="*"||s.includes(S.kind))&&A(S.id)?"done":void 0}return c.length===1&&c[0]===t.id?{...d,args:{...d.args,[l.name]:t.id},open:d.open.filter(s=>s!==l)}:{...d,open:d.open.map(s=>s===l?{...s,candidates:c}:s)}}export{Vn as a,Qn as b,Un as c};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{vc as e}from"./chunk.UG727PEE.js";var a=`
|
|
2
2
|
.graview-spec{display:flex;flex-direction:column;gap:6px;min-width:0;color:var(--graview-ink)}
|
|
3
3
|
|
|
4
4
|
.graview-spec-row{flex-direction:row;flex-wrap:wrap;align-items:center;gap:4px 10px;box-sizing:border-box;max-width:100%;padding:5px 10px;border:1px solid var(--graview-edge);border-radius:var(--graview-radius-sm,8px);background:var(--graview-panel);font-size:.875rem}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{$ as Z,Ca as Q,Db as I,F,G as Y,I as L,Ka as X,Kb as en,O,R as j,S as B,T as U,U as K,Va as v,Xa as nn,_ as J,ka as P}from"./chunk.UG727PEE.js";var un=1e4,p=class{constructor(a){this.nodes=a}},rn=Symbol.for("@graview/core:far-record"),fn=e=>typeof e=="object"&&e!==null&&e[rn]===!0;function cn(e){let a={...e.fields,id:`@${e.address}/${e.kind}:${e.id}`,kind:`@${e.address}/${e.kind}`,label:e.label};return Object.defineProperty(a,rn,{value:!0}),a}function Nn(e){let a=`the linked record in ${e.ref.address}`;return e.reason==="denied"?`${a} is not one this viewer may open`:`${a} has not been read`}var pn="",f=class extends Error{constructor(g,l){super(g);this.sentence=g;this.at=l}},z=class extends f{},V=e=>e!==null&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof p)&&typeof e.id=="string",tn=e=>{let a=new Set;return new p(e.filter(g=>!a.has(g.id)&&a.add(g.id)))},w=e=>e===null?"nothing":e instanceof p?"a set of records":Array.isArray(e)?"a list":V(e)?"a record":typeof e=="string"?"a word":typeof e;function on(e,a){let g=a.budget??un,l=(n,s)=>{if(g-=n,g<0)throw new z("this rule looks at too much of the graph to judge in one go",s)},u=a.today??L(),b=a.now??new Date().toISOString(),k=new Map,S=new Set,A=a.bindings,q=(n,s,t,o)=>{let d=`${n?.id}\0${s}`;if(k.has(d))return k.get(d);if(S.has(d))throw new f(`"${s}"${n?` of ${P(n.kind)}`:""} depends on itself`,o);S.add(d);let r=A;A=void 0;try{let i=$(t,n);return k.set(d,i),i}finally{A=r,S.delete(d)}},E=(n,s,t)=>{l(1,t);let o=a.kinds.get(n.kind),d=o?.computed?.get(s);if(d)return q(n,s,d,t);let r=o?.linked?.get(s);if(r){let y=Q(Object.hasOwn(n,s)?n[s]:void 0,r);l(y.length,t);let m=a.linked??X(a.graph),h=y.flatMap(x=>{let C=m?m(x):{unread:!0};return"record"in C?[cn(C.record)]:(a.onUnread?.({relation:s,ref:x,reason:"denied"in C?"denied":"unread"}),[])});return r.cardinality==="one"?h[0]??null:new p(h)}let i=Object.hasOwn(n,s);if(o?.fields.has(s)||i){let y=i?v(n,s,u):void 0;return y===void 0?null:y}let c=o?.edges.get(s);if(c){let y=a.graph.out(n.id,s);return l(y.length,t),c==="one"?y[0]??null:new p(y)}if(s==="id")return n.id;if(fn(n))return null;throw new f(`${P(n.kind)} has no field or relation called "${s}"`,t)},N=(n,s,t)=>{if(n instanceof p)return n;if(n===null)return new p([]);if(V(n))return new p([n]);throw new f(`${t}(\u2026) needs a set of records, and was given ${w(n)}`,s)},G=(n,s,t)=>{if(n===null)return null;if(typeof n=="string")return n;if(typeof n=="number"||typeof n=="boolean")return String(n);throw new f(`${t}(\u2026) needs a word, and was given ${w(n)}`,s)},_=(n,s,t)=>{let o=G(n,s,t);if(o===null)return null;let d=Date.parse(o.length===10?`${o}T00:00:00Z`:o);if(Number.isNaN(d))throw new f(`${t}(\u2026) needs a date, and "${o}" is not one`,s);return d},M=(n,s)=>V(n)&&V(s)?n.id===s.id:V(n)&&typeof s=="string"?n.id===s:typeof n=="string"&&V(s)?n===s.id:Array.isArray(n)&&Array.isArray(s)?n.length===s.length&&n.every((t,o)=>M(t,s[o])):n===s,R=(n,s,t)=>{if(n===null)return!1;if(typeof n=="boolean")return n;throw new f(`${t} must be true or false, and was ${w(n)}`,s)},T=(n,s)=>$(s,n);function $(n,s){switch(l(1,n.at),n.t){case"lit":return n.value;case"list":return n.items.map(t=>$(t,s));case"ident":{let t=A&&Object.hasOwn(A,n.name)?A[n.name]:void 0;if(t!==void 0)return t;if(s)return E(s,n.name,n.at);throw new f(`"${n.name}" means nothing in a rule over the whole graph`,n.at)}case"member":{let t=$(n.object,s);if(t===null)return null;if(V(t))return E(t,n.name,n.at);throw new f(`".${n.name}" needs a record before it, and was given ${w(t)}`,n.at)}case"unary":{let t=$(n.operand,s);if(n.op==="!")return!R(t,n.at,"what follows not");if(t===null)return null;if(typeof t!="number")throw new f(`"-" needs a number, and was given ${w(t)}`,n.at);return-t}case"where":{let t=N($(n.set,s),n.at,"where");return l(t.nodes.length,n.at),new p(t.nodes.filter(o=>R(T(o,n.filter),n.at,"a where condition")))}case"binary":return dn(n,s);case"call":return ln(n,s)}}function dn(n,s){if(n.op==="&&")return R($(n.left,s),n.at,"each side of and")&&R($(n.right,s),n.at,"each side of and");if(n.op==="||")return R($(n.left,s),n.at,"each side of or")||R($(n.right,s),n.at,"each side of or");let t=$(n.left,s),o=$(n.right,s);if(n.op==="&"||n.op==="|"||n.op==="-"&&(t instanceof p||o instanceof p)){let d=N(t,n.at,n.op).nodes,r=N(o,n.at,n.op).nodes;l(d.length+r.length,n.at);let i=new Set(r.map(c=>c.id));return tn(n.op==="|"?[...d,...r]:d.filter(c=>i.has(c.id)===(n.op==="&")))}switch(n.op){case"==":return M(t,o);case"!=":return!M(t,o);case"in":{if(o===null)return!1;if(o instanceof p)return o.nodes.some(d=>M(t,d));if(Array.isArray(o))return o.some(d=>M(t,d));if(typeof o=="string"&&typeof t=="string")return o.includes(t);throw new f(`"in" needs a list or a set on its right, and was given ${w(o)}`,n.at)}case"<":case"<=":case">":case">=":{if(t===null||o===null)return!1;if(!(typeof t=="number"&&typeof o=="number"||typeof t=="string"&&typeof o=="string"))throw new f(`cannot compare ${w(t)} with ${w(o)}`,n.at);return n.op==="<"?t<o:n.op==="<="?t<=o:n.op===">"?t>o:t>=o}default:{if(t===null||o===null)return null;if(n.op==="+"&&(typeof t=="string"||typeof o=="string")){let d=`${G(t,n.at,"+")}${G(o,n.at,"+")}`;if(d.length>1e4)throw new f("that makes a word too long",n.at);return d}if(typeof t!="number"||typeof o!="number")throw new f(`"${n.op}" needs numbers, and was given ${w(t)} and ${w(o)}`,n.at);return(n.op==="/"||n.op==="%")&&o===0?null:n.op==="+"?t+o:n.op==="-"?t-o:n.op==="*"?t*o:n.op==="/"?t/o:t%o}}}function ln(n,s){let t=(r,i=r)=>{if(n.args.length<r||n.args.length>i)throw new f(`${n.fn}(\u2026) takes ${r===i?r:`${r} to ${i}`} argument${i===1?"":"s"}`,n.at)},o=r=>$(n.args[r],s),d=r=>{let i=o(r);if(typeof i!="string")throw new f(`${n.fn}(\u2026) needs a quoted name, like ${n.fn}('name')`,n.at);return i};switch(n.fn){case"out":case"in":{t(1,2);let r=(y,m)=>n.fn==="out"?a.graph.out(y,m):a.graph.in(y,m);if(n.args.length===2){let y=N(o(0),n.at,n.fn).nodes,m=d(1);return tn(y.flatMap(h=>{let x=r(h.id,m);return l(x.length+1,n.at),x}))}let i=d(0);if(!s)throw new f(`${n.fn}('${i}') needs a record to start from`,n.at);let c=r(s.id,i);return l(c.length,n.at),new p(c)}case"all":{t(1,2);let r=a.graph.nodesOfKind(d(0),{archived:n.args.length===2?o(1):!1});return l(r.length,n.at),new p(r)}case"archived":return t(0,1),nn(n.args.length===1?o(0):s);case"count":return t(1),N(o(0),n.at,"count").nodes.length;case"exists":return t(1),N(o(0),n.at,"exists").nodes.length>0;case"every":case"some":{t(2);let r=N(o(0),n.at,n.fn);l(r.nodes.length,n.at);let i=c=>R(T(c,n.args[1]),n.at,`the condition in ${n.fn}(\u2026)`);return n.fn==="every"?r.nodes.every(i):r.nodes.some(i)}case"sum":case"min":case"max":{t(2);let r=N(o(0),n.at,n.fn);l(r.nodes.length,n.at);let i=n.args[1],c=i.t==="lit"&&typeof i.value=="string"?i.value:void 0,y=i.t==="ident"?`'${i.name}'`:c!==void 0?`'${c}'`:"\u2026",m=r.nodes.map(h=>i.t==="ident"?E(h,i.name,n.at):c!==void 0?E(h,c,n.at):T(h,i)).filter(h=>{if(h===null)return!1;if(typeof h!="number")throw new f(`${n.fn}(\u2026, ${y}) needs a number for each member, and found ${w(h)}`,n.at);return!0});return n.fn==="sum"?m.reduce((h,x)=>h+x,0):m.length===0?null:n.fn==="min"?Math.min(...m):Math.max(...m)}case"fact":{t(1);let r=d(0),i=a.kinds.get(pn)?.computed?.get(r);if(!i)throw new f(`no fact is called "${r}"`,n.at);return q(null,r,i,n.at)}case"first":return t(1),N(o(0),n.at,"first").nodes[0]??null;case"sort":{t(2,3);let r=N(o(0),n.at,"sort"),i=n.args.length===3?o(2):"asc";if(i!=="asc"&&i!=="desc")throw new f("sort(\u2026) goes 'asc' or 'desc'",n.at);let c=r.nodes.length;l(c+c*Math.ceil(Math.log2(c+1)),n.at);let y=r.nodes.map((h,x)=>({node:h,i:x,key:T(h,n.args[1])})),m=i==="desc"?-1:1;return y.sort((h,x)=>H(h.key,x.key,m,n.at)||h.i-x.i),new p(y.map(h=>h.node))}case"either":{if(n.args.length<1)throw new f("either(\u2026) takes at least one argument",n.at);for(let r=0;r<n.args.length;r++){let i=o(r);if(i!==null&&!(i instanceof p&&i.nodes.length===0))return i}return null}case"present":{t(1);let r=o(0);return r===null||r===""?!1:Array.isArray(r)?r.length>0:r instanceof p?r.nodes.length>0:!0}case"len":{t(1);let r=o(0);if(r===null)return 0;if(typeof r=="string"||Array.isArray(r))return r.length;if(r instanceof p)return r.nodes.length;throw new f(`len(\u2026) needs a word or a list, and was given ${w(r)}`,n.at)}case"contains":case"startsWith":{t(2);let r=o(0),i=o(1);if(r===null||i===null)return!1;if(n.fn==="contains"&&Array.isArray(r))return r.some(m=>M(m,i));let c=G(r,n.at,n.fn),y=G(i,n.at,n.fn);return n.fn==="contains"?c.toLowerCase().includes(y.toLowerCase()):c.startsWith(y)}case"lower":{t(1);let r=G(o(0),n.at,"lower");return r===null?null:r.toLowerCase()}case"today":return t(0),u;case"now":return t(0),b;case"date":{t(1);let r=_(o(0),n.at,"date");return r===null?null:new Date(r).toISOString().slice(0,10)}case"days":case"hours":{t(2);let r=_(o(0),n.at,n.fn),i=_(o(1),n.at,n.fn);if(r===null||i===null)return null;let c=(i-r)/(n.fn==="days"?864e5:36e5);return n.fn==="days"?Math.round(c):c}case"if":return t(3),R(o(0),n.at,"the condition in if(\u2026)")?o(1):o(2);default:throw new f(`"${n.fn}" is not a function the rule language knows`,n.at)}}function H(n,s,t,o){if(n===null||s===null)return n===s?0:n===null?1:-1;if(Array.isArray(n)&&Array.isArray(s)){for(let r=0;r<Math.max(n.length,s.length);r++){let i=H(n[r]??null,s[r]??null,t,o);if(i!==0)return i}return 0}let d=r=>typeof r=="number"||typeof r=="string"||typeof r=="boolean"?typeof r:w(r);if(d(n)!==d(s)||typeof n=="object"||typeof s=="object")throw new f(`sort(\u2026) cannot put ${w(n)} and ${w(s)} in order`,o);return typeof n=="string"?t*(n<s?-1:n>s?1:0):t*(Number(n)-Number(s))}return $(e,a.subject)}var Sn=["out","in","all","count","exists","every","some","sum","min","max","present","len","contains","startsWith","lower","today","now","date","days","hours","if","first","sort","either","fact","archived"];var Vn=(e,a,g,l)=>({severity:"error",code:e,path:a,message:g,...l?{fix:l}:{}}),Gn=(e,a,g,l)=>({severity:"warning",code:e,path:a,message:g,...l?{fix:l}:{}}),Mn=e=>e.some(a=>a.severity==="error");function On(e){return e.map(a=>`${a.severity==="error"?"\u2717":a.severity==="warning"?"!":"\xB7"} ${a.path||"(document)"}: ${a.message}${a.fix?` \u2014 ${a.fix}`:""}`).join(`
|
|
2
|
+
`)}var Cn=["money","percent","date","time","datetime","relative","upper","lower","count","words","and","plural","excerpt"],gn={getNode:()=>{},allNodes:()=>[],allEdges:()=>[],nodesOfKind:()=>[],edgesOfKind:()=>[],out:()=>[],in:()=>[],neighbors:()=>[],has:()=>!1};function jn(e,a,g,l=[],u,b=D){return W(e,a,g,l,u,b)}var yn=(e,a)=>e.capital?J(a):a;function hn(e){return e?a=>{let g=e.tryDefinition(a.kind)?.label;return g?g(a):D(a)}:D}var sn=["zero","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen"],an=["","","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"];function mn(e,a){return!Number.isInteger(e)||e<0||e>99?K(e,a):e<20?sn[e]:e%10===0?an[e/10]:`${an[Math.floor(e/10)]}-${sn[e%10]}`}function wn(e){return/[^aeiou]y$/i.test(e)?`${e.slice(0,-1)}ies`:/(s|x|z|ch|sh)$/i.test(e)?`${e}es`:`${e}s`}var D=e=>String(e.name??e.title??e.label??e.id);function W(e,a,g,l=[],u,b=D){if(a==="plural"){let k=e instanceof p?e.nodes.length:Array.isArray(e)?e.length:typeof e=="number"?e:null;return k===null||l[0]===void 0?"\u2014":k===1?l[0]:l[1]??wn(l[0])}if(e===null)return"\u2014";if(e instanceof p)return a==="count"?String(e.nodes.length):a==="and"?Z(e.nodes.map(b)):e.nodes.map(b).join(", ");if(Array.isArray(e)){if(a==="count")return String(e.length);let k=e.map(S=>W(S,void 0,g,[],u,b));return a==="and"?Z(k):k.join(", ")}if(typeof e=="object")return b(e);switch(a){case"words":return typeof e=="number"?mn(e,u?.locale):String(e);case"money":return typeof e=="number"?I(e,u):String(e);case"percent":return typeof e=="number"?K(e,u?.locale,{style:"percent",maximumFractionDigits:0}):String(e);case"upper":return String(e).toUpperCase();case"lower":return String(e).toLowerCase();case"excerpt":return en(String(e),Number(l[0])||void 0);case"date":return O(U(String(e),u?.timeZone)??String(e).slice(0,10),u?.locale);case"time":return typeof e=="string"&&F.test(e)?O(e,u?.locale):B(String(e),u?.locale,u?.timeZone);case"datetime":return typeof e=="string"&&F.test(e)?O(e,u?.locale):j(String(e),u?.locale,u?.timeZone);case"relative":{let k=U(String(e),u?.timeZone),S=k===void 0?Date.parse(String(e)):Date.parse(`${k}T00:00:00Z`);if(Number.isNaN(S))return String(e);let A=Math.round((S-Date.parse(`${g}T00:00:00Z`))/864e5);return A===0?"today":A===1?"tomorrow":A===-1?"yesterday":A>0?`in ${A} days`:`${-A} days ago`}default:return typeof e=="string"&&F.test(e)?O(e,u?.locale):typeof e=="string"&&Y.test(e)?j(e,u?.locale,u?.timeZone):String(e)}}function Un(e,a){let g=a.today??L(),l=a.name??hn(a.graph?.schema);return e.map(u=>{if(u.text!==void 0)return u.text;try{let b=on(u.expr,{graph:a.graph??gn,subject:a.node,kinds:a.kinds,today:g,budget:a.budget??500,...a.bindings?{bindings:a.bindings}:{}});return yn(u,W(b,u.format,g,u.formatArgs,a.money,l))}catch(b){if(b instanceof f)return"\u2014";throw b}}).join("")}export{p as a,Nn as b,pn as c,f as d,z as e,on as f,Sn as g,Vn as h,Gn as i,Mn as j,On as k,Cn as l,gn as m,jn as n,yn as o,hn as p,Un as q};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{C as O}from"./chunk.UG727PEE.js";var k=3,A=k+1,P=A+1,z=(o,r)=>o<r?-1:o>r?1:0;function L(o){return(o??0)>4?k:2}function N(o,r,a){let n=[];for(let d of Object.values(o.tryDefinition(r)?.edges??{}))if(d.to!=="*")for(let i of d.to)i!==r&&a.includes(i)&&!n.includes(i)&&n.push(i);return n}function W(o,r={}){let a=[...o.kinds],n=[...(r.order??[]).filter(e=>a.includes(e)),...a.filter(e=>!(r.order??[]).includes(e)).sort(z)].filter((e,t,s)=>s.indexOf(e)===t),d=e=>n.indexOf(e),i=new Map,g=[],h=(e,t,s)=>{i.set(e,{col:t,row:s,side:L(r.counts?.[e])}),g.push({col:t,row:s})};for(let e of n){let t=o.tryDefinition(e)?.plot??r.plots?.[e];t&&h(e,t.col,t.row)}let l=new Map(n.map(e=>[e,N(o,e,a)])),b=new Set(n.filter(e=>l.get(e).length>0||n.some(t=>l.get(t).includes(e)))),v=new Map,C=new Set,D=e=>{let t=v.get(e);if(t!==void 0)return t;if(C.has(e))return-1;C.add(e);let s=0;for(let c of l.get(e))s=Math.max(s,D(c)+1);return C.delete(e),v.set(e,s),s};for(let e of n)b.has(e)&&D(e);let f=[];for(let e of n)b.has(e)&&(f[v.get(e)]??=[]).push(e);let I=new Map,T=Math.max(1,Math.ceil(Math.sqrt(f.length))),H=Math.max(1,...f.map(e=>e?.length??0)),w=Math.max(P,Math.round(r.pitch??P)),R=(e,t)=>r.upright?{col:e%T*w,row:(Math.floor(e/T)*(H+1)+t)*w}:{col:t*w,row:e===0?0:-e*w},$=e=>!g.some(t=>V(t,e)),S=(e,t,s)=>{let c=s;for(;!$(R(t,c))&&c<s+64;)c++;return i.has(e)||h(e,R(t,c).col,R(t,c).row),c},x=0;f.forEach((e=[],t)=>{let s=u=>{let m=l.get(u).map(p=>I.get(p)).filter(p=>p!==void 0);return m.length>0?m.reduce((p,q)=>p+q,0)/m.length:1/0},c=[...e].sort((u,m)=>s(u)-s(m)||d(u)-d(m)),y=0;for(let u of c)i.has(u)||(y=S(u,t,y),I.set(u,y),x=Math.max(x,y+1),y++)});let j=n.filter(e=>!b.has(e)&&!i.has(e)),M=Math.max(r.upright?x:f.length,Math.ceil(Math.sqrt(j.length*2)),1),E=b.size>0?1:0;return j.forEach((e,t)=>{r.upright?S(e,f.length+E+Math.floor(t/M),t%M):S(e,t%M,x+E+Math.floor(t/M))}),i}function V(o,r){return Math.abs(o.col-r.col)<A&&Math.abs(o.row-r.row)<A}function X(o,r,a,n=.5){return{x:(o-r)*a/2,y:(o+r)*a*n/2}}var G=1,B=/^(done|completed?|closed|finished|shipped|sent|won|lost|passed|declined|dropped|answered|resolved|fixed|archived|cancell?ed|retired|released|published|delivered|paid|merged|rejected|written[-_ ]?up|out)$/i,F=/^(doing|in[-_ ]?progress|active|building|started|working|in[-_ ]?review|review(ing)?|fixing|ongoing|underway|testing|drafting|writing|running)$/i;function _(o,r,a){let n=O(o.tryDefinition(r)?.fields.shape?.[a]);for(;n&&n.innerType!==void 0&&n.type!=="enum";)n=O(n.innerType);if(n?.type!=="enum")return;let d=(n.entries?Object.values(n.entries):n.values??[]).filter(i=>typeof i=="string");return d.length>0?d:void 0}function J(o,r){let a=o.tryDefinition(r);if(!a)return;let n=a.lifecycle,d=Object.keys(a.fields.shape??{}),i=[n?.field,...d.filter(l=>/^(status|stage|state|phase)$/i.test(l))].find(l=>l!==void 0&&_(o,r,l)!==void 0);if(!i)return;let g=_(o,r,i),h=n?.field===i&&Array.isArray(n.retired)?n.retired:[];return{field:i,values:g,tiers:g.map(l=>h.includes(l)||B.test(l)?"done":F.test(l)?"active":"waiting")}}export{P as a,W as b,X as c,G as d,J as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as J,C as Q,E as X,I as Y,K as ee,N as ne,a as I,i as q,l as Z,p as z,s as W,t as j,x as _,y as U}from"./chunk.
|
|
1
|
+
import{A as J,C as Q,E as X,I as Y,K as ee,N as ne,a as I,i as q,l as Z,p as z,s as W,t as j,x as _,y as U}from"./chunk.4QEDYRES.js";import{Ca as D,G as se,R as N,_ as T,aa as $,na as G,va as K}from"./chunk.JE4QQEJE.js";import{Pc as O,ac as V,jc as M,mc as P}from"./chunk.UG727PEE.js";import{b as F}from"./chunk.AJZBJBMO.js";var a=F(se(),1);function ce(e){let n=[e?.typography?.body,e?.typography?.display,e?.typography?.mono],t=[];for(let r of n){let o=r?.split(",")[0]?.trim().replace(/^["']|["']$/g,"");!o||P(o)||o.toLowerCase()!==V.toLowerCase()&&(t.includes(o)||t.push(o))}return t}function te(e){let n=ce(e);return n.length===0?null:`https://fonts.googleapis.com/css2?${n.map(r=>`family=${encodeURIComponent(r).replace(/%20/g,"+")}:wght@400;500;600;700`).join("&")}&display=swap`}var u=F(N(),1),ve=e=>typeof e=="object"?e:{};function we({rootRef:e,firstLook:n,app:t}){let r=(0,a.useCallback)(()=>e.current,[e]);return n?(0,u.jsx)(ne,{firstLook:n,root:r,app:t}):null}function Ee(e,n,t){let{app:r}=e,o=(0,a.useMemo)(()=>{let i=Y(n(r.schema,r.viewSpecs),r),c=t?de(i,t):i,s=e.views?e.views(r.schema,c):i,d=s===c?i:G(i,s);return ee(d,r.schema,Q(e.brand??r.brand,r.schema)),t?t.register(d):d},[e.views,r.schema,r.viewSpecs,r.lenses,r.pages,r.home,t]);return K(o,e.keptViews)}function de(e,n){let t={...e,register(r,o,i,c){return c?.name!==n.name&&e.register(r,o,i,c),t},...e.home?{home:r=>(n.home||e.home(r),t)}:{}};return t}function le(e,n){return new O({schema:e.schema,mutations:e.mutations??[],invariants:e.invariants??[],...n?{snapshot:n}:{},...e.policy?{policy:e.policy}:{},...e.intelligence?{intelligence:e.intelligence}:{},...e.brand?.timeZone?{timeZone:e.brand.timeZone}:{}})}function re(e){if(typeof document>"u")return e==="dark"?"dark":"light";let n=document.documentElement.dataset.theme;return n==="dark"||n==="light"?n:e==="dark"||e==="light"?e:typeof matchMedia=="function"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function ue(e,n){let[t,r]=(0,a.useState)(()=>re(n));return(0,a.useEffect)(()=>{if(!e||typeof document>"u")return;let o=()=>r(re(n));o();let i=new MutationObserver(o);i.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});let c=typeof matchMedia=="function"?matchMedia("(prefers-color-scheme: dark)"):null;return c?.addEventListener?.("change",o),()=>{i.disconnect(),c?.removeEventListener?.("change",o)}},[e,n]),t}var A=e=>e?e.getBoundingClientRect().height:0;function Re(e,n,t){let r=(0,a.useRef)(t);r.current=t;let o=t!==void 0;(0,a.useLayoutEffect)(()=>{let i=e.current;if(!i||!o)return;let c=()=>{let y=[...i.children],h=y.find(b=>b.hasAttribute("data-graview-app-bar")),p=y.find(b=>b.hasAttribute("data-embed-content")),g=p?.querySelector("[data-embed-measure]")??null,l=y.find(b=>b.hasAttribute("data-graview-place-line"));return{strip:h,line:l,content:p,measure:g}},s=-1,d=()=>{let{strip:y,line:h,content:p,measure:g}=c(),l=Math.ceil(A(y)+A(h)+A(g||p));l!==s&&(s=l,r.current?.(l))};if(d(),typeof ResizeObserver>"u")return;let m=new ResizeObserver(d),E=()=>{m.disconnect();let{strip:y,line:h,content:p,measure:g}=c();for(let l of[i,y,h,p,g])l&&m.observe(l)};E();let S=new MutationObserver(()=>{E(),d()});return S.observe(i,{childList:!0}),()=>{m.disconnect(),S.disconnect()}},[e,n,o])}var xe=480,me=0;function ke(e){let{app:n,seed:t,scheme:r="auto",brand:o=n.brand,fonts:i=!0,height:c="100%",label:s}=e,d=(0,a.useRef)(null);D(d);let m=c==="viewport"?"100dvh":c,E=Z(typeof m=="string"&&/vh\b/.test(m)),S=(0,a.useMemo)(()=>`graview-embed-${++me}`,[]),y=(0,a.useMemo)(()=>e.store??e.remote?.store??le(n,t),[e.store,e.remote,n,t]),h=e.presence??e.remote?.presence,p=e.hostContext?.theme,g=ue(r==="auto"&&p===void 0,o?.scheme),l=r==="auto"?p??g:r,b=(0,a.useMemo)(()=>I(l,o,{scope:`.${S}`}),[l,o,S]);q(e.favicon?M(o):void 0),(0,a.useEffect)(()=>{if(!i||typeof document>"u")return;let w=te(o);if(!w||document.querySelector(`link[href="${w}"]`))return;let f=document.createElement("link");f.rel="stylesheet",f.href=w,document.head.appendChild(f)},[o,i]);let k=(0,a.useRef)(void 0);(0,a.useLayoutEffect)(()=>{let w=d.current,f=k.current;if(k.current=s,!w||!s)return;let ie=v=>{let R=v.getAttribute("aria-label")??"",x=f&&f!==s?R.startsWith(`${f} \xB7 `)?R.slice(f.length+3):R===f?"":R:R;x===s&&(v.getAttribute("role")==="region"||v.tagName==="SECTION"&&!v.hasAttribute("role"))&&v.setAttribute("role","group");let C=x.startsWith(`${s} \xB7 `)||x===s?x:x?`${s} \xB7 ${x}`:s;C!==R&&v.setAttribute("aria-label",C)},B=()=>w.querySelectorAll("aside, nav, main, header, footer, section[aria-label]:not([role]), [role=region], [role=complementary], [role=navigation], [role=search]").forEach(v=>{v.hasAttribute("data-graview-named-by-lens")||ie(v)});B();let H=new MutationObserver(B);return H.observe(w,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["aria-label"]}),()=>H.disconnect()},[s]);let ae=E?`${m}`.replace(/([\d.]+)[sdl]?vh\b/g,(w,f)=>`${+f*E/100}px`):m;return{rootRef:d,scope:S,css:b,scheme:l,store:y,presence:h,brand:o,auto:c==="auto",height:ae}}function Ae({rootRef:e,board:n}){let t=(0,a.useCallback)(()=>e.current?.querySelector("[data-embed-content]")??e.current,[e]);return(0,u.jsx)(z,{board:n,anchor:t})}function Fe(e,n,t){return{brand:t,locale:e.locale,timeZone:e.timeZone,principal:e.principal,seats:e.seats,presence:n,people:e.people,memory:e.memory,presenceTtlMs:e.presenceTtlMs,onKeepLens:e.onKeepLens,ai:e.ai,files:e.files,resolveApp:e.resolveApp,history:e.history,linkedRecords:e.linkedRecords,subscriptions:e.subscriptions,keptViews:e.keptViews,signIn:e.signIn,menuSections:e.menuSections,app:e.app}}function Le({name:e,heading:n,faces:t,at:r,without:o,home:i,reach:c,standing:s,hostActions:d,keeping:m,onFind:E,switch:S,named:y=!0}){let{brand:h,store:p,principal:g,views:l}=T();$();let b=o?.has("places")?[]:W({store:p,principal:g,views:l}),k=J();return(0,u.jsx)(_,{brand:h,name:e,named:y,description:h?.subtitle,heading:n,faces:t,home:i,places:b,current:r===null?null:j(b,r),reach:c,onFind:E,...S?{switch:S}:{},...t||r===null?{scenePlaces:k}:{},tools:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(X,{clean:s}),(0,u.jsx)(U,{...d?{hostActions:d}:{},...m?{keeping:m}:{}})]})})}var Be=e=>e===!1?2:Math.min(e+1,6);function He(e){let[n,t]=(0,a.useState)(e),r=(0,a.useRef)(void 0),o=(0,a.useRef)(void 0),i=(0,a.useMemo)(()=>({go:r,at:t,pending:o}),[]),c=(0,a.useCallback)(s=>{if(r.current){r.current(s);return}o.current=s,t(s)},[]);return{at:n,setAt:t,steering:i,steer:c}}function ye(e){let n=typeof e=="object"&&e!==null?e.name:void 0;return{name:typeof n=="string"&&n.length>0?n:typeof e=="object"?"Error":typeof e}}var L=()=>typeof performance<"u"?performance.now():Date.now();function Ce(e,n){let t=(0,a.useRef)({onError:e,face:n});return t.current={onError:e,face:n},(0,a.useCallback)((r,o)=>t.current.onError?.(ye(r),{module:o.module,face:t.current.face}),[])}function Ve(e,n){let t=(0,a.useRef)(null);t.current===null&&(t.current=L());let r=(0,a.useRef)({onReady:e,face:n});r.current={onReady:e,face:n};let o=(0,a.useRef)(!1);return(0,a.useCallback)(i=>{o.current||(o.current=!0,r.current.onReady?.({ms:Math.max(0,L()-(t.current??L())),face:i}))},[])}var oe=class extends a.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(n,t){console.error(`[graview] ${this.props.module} threw while rendering`,n,t.componentStack),this.props.report(n,{module:this.props.module})}render(){return this.state.failed?(0,u.jsxs)("div",{role:"alert","data-graview-face-error":this.props.module,...this.props.content?{"data-embed-content":""}:{},style:this.props.content?{flex:"1 1 auto",display:"grid",alignContent:"center",justifyItems:"center",gap:8,padding:24,background:"var(--graview-ground)",color:"var(--graview-ink)",fontSize:"0.9375rem"}:{display:"inline-flex",alignItems:"center",gap:6,fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:[(0,u.jsx)("span",{children:this.props.content?"This part of the app could not draw.":"Could not draw."}),(0,u.jsx)("button",{type:"button",onClick:()=>this.setState({failed:!1}),style:{padding:"3px 11px",fontSize:"0.8125rem"},children:"Try again"})]}):this.props.children}};export{ve as a,we as b,Ee as c,le as d,Re as e,xe as f,ke as g,Ae as h,Fe as i,Le as j,Be as k,He as l,Ce as m,Ve as n,oe as o};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as te,b as E,d as re,g as ie,h as de,i as ae}from"./chunk.
|
|
1
|
+
import{a as te,b as E,d as re,g as ie,h as de,i as ae}from"./chunk.PCTVLNOS.js";import{Ca as J,Cb as oe,Ea as Q,Eb as se,F as I,G as x,I as P,Ma as M,O as A,Qa as X,R as K,S as Y,Sa as ee,Ua as ne,W as T,Y as Z,ca as v,ja as B,la as H,ra as U,sa as G,ta as V,xa as q}from"./chunk.UG727PEE.js";var ye=t=>`${t}${t%100>=11&&t%100<=13?"th":["th","st","nd","rd"][t%10]??"th"}`,ue={day:"day",week:"week",month:"month",year:"year"},S=t=>t.length<2?t[0]??"":`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`;function ge(t,e,n){let o=e.interval??1,d=ue[e.every],c=t.slice(0,10),y=o===1?`Every ${d}`:o===2?`Every other ${d}`:`Every ${o} ${d}s`,a;if(e.every==="week"){let u=(e.on?.length?e.on:[M[new Date(`${c}T00:00:00Z`).getUTCDay()]]).map(f=>Z(M.indexOf(f),"long",n));a=o===1?`Every ${S(u)}`:o===2?`Every other ${S(u)}`:`${y} on ${S(u)}`}else if(e.every==="month"){let u=(e.on?.length?e.on:[+c.slice(8,10)]).map(f=>f===-1?"the last day":`the ${ye(Number(f))}`);a=`${y} on ${S(u)}`}else e.every==="year"?a=`${y} on ${T(c,n)}`:a=y;return x.test(t)&&(a+=` at ${Y(t,n)}`),e.until&&(a+=`, until ${A(e.until,n)}`),e.count&&(a+=`, ${e.count===1?"once":`${e.count} times`}`),a}function le(t,e,n={}){if(!ee(e)||typeof t!="string")return;let o=n.today??P(),d=ne(t,e,o),c=ge(t,e,n.locale),y=d.slice(0,4)===o.slice(0,4)?T(d.slice(0,10),n.locale):A(d.slice(0,10),n.locale);return d.slice(0,10)<o?`${c}, last ${y}`:`${c}, next ${y}`}function Ye(t,e){let n=new Map,o=new Map;for(let d of t){let c=v(e(d.kind),d).trim().toLowerCase();o.set(c,[...o.get(c)??[],d])}for(let d of o.values()){if(d.length<2)continue;let c=new Map;for(let y of d)c.set(y.kind,[...c.get(y.kind)??[],y]);for(let[y,a]of c){if(a.length===1){n.set(a[0].id,H(e(y),y));continue}let u=a.map(r=>new Map(he(r,e(r.kind)).map(l=>[l.key,l.alone]))),f=[...new Set(u.flatMap(r=>[...r.keys()]))],h=r=>u.every(l=>!/\d/.test(l.get(r)??"")),$=[...f.filter(h),...f.filter(r=>!h(r))],O=(r,l)=>l.map(g=>u[r].get(g)??"").filter(Boolean).join(" \xB7 "),_=r=>new Set(a.map((l,g)=>O(g,r))).size===a.length&&a.every((l,g)=>O(g,r)!==""),i=$.find(r=>_([r])),s=i?void 0:$.flatMap((r,l)=>$.slice(l+1).map(g=>[r,g])).find(r=>_(r));a.forEach((r,l)=>{if(i||s)return void n.set(r.id,O(l,i?[i]:s));let g=$.find(b=>{let k=u[l].get(b);return k!==void 0&&k!==""&&u.every((R,m)=>m===l||R.get(b)!==k)});n.set(r.id,g?u[l].get(g):`${l+1} of ${a.length}`)})}}return n}function Ze(t,e){return t?.describe?t.describe(e):`${e.kind} ${v(t,e)}`}var pe=new Set(["id","kind","label"]);function me(t,e){if(e.length===0)return!1;let n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`(^|[\\s\xB7,(/])${n}($|[\\s\xB7,)/])`).test(t)}function he(t,e,n={}){let o=e?.display,d=new Set([...pe,...o?.hide??[]]);typeof t.label=="string"&&e?.label&&!v(e,t).includes(t.label)&&d.delete("label");let c=(n.said??[]).filter(i=>!!i),y=c.filter(i=>i.endsWith("\u2026")).map(i=>i.replace(/…$/,"").trim()).filter(i=>i.length>12),a=[],u=e?.fields?.shape,f=e?.fieldRoles,h=n.glance?o?.glance??[f?.who,f?.when].filter(i=>!!i):ce(o?.page),$=n.glance&&o?.glance!==void 0,_=[...new Set($?h:[...h,...be(e),...Object.keys(t)])].filter(i=>Object.hasOwn(t,i)).map(i=>[i,t[i]]);for(let[i,s]of _){if(d.has(i)||s===void 0||s===null)continue;let r=o?.format?.[i],l=r?[]:V(s);if(l[0]&&n.glance)continue;let g=e?.fields?.shape?.[i],b=!r&&typeof s=="string"&&q(g)?s:void 0,k=!r&&typeof s=="string"&&te(g);if(b&&n.glance)continue;let R=r?void 0:Q(g),m=R?{relation:R,refs:J(s,R)}:void 0;if(m&&(n.glance||m.refs.length===0)||!l[0]&&typeof s=="object"&&(!Array.isArray(s)||s.some(p=>typeof p=="object"&&p!==null))&&r===void 0)continue;let j=typeof s=="string"&&!r?le(s,t[`${i}Repeat`],{locale:n.locale}):void 0,F=l[0]?l.map(p=>`${p.caption?`${p.name} \u2014 ${p.caption}`:p.name}${U(p)?` (${G(p)})`:""}`).join(", "):Array.isArray(s)?s.join(", "):typeof s=="boolean"?s?"Yes":"No":String(s),N=r?void 0:ie(e,i),L=ae(N,s),W=!r&&!N&&typeof s=="number"?oe(e?.fields?.shape?.[i]):void 0,z=m?m.refs.length>1?`${m.refs.length} linked records`:"linked record":r?r(s):W?se(s,W):de(N,s,n.locale)??(Array.isArray(s)||typeof s=="boolean"?F:typeof s=="string"&&j!==void 0?j:typeof s=="string"&&I.test(s)?A(s,n.locale):typeof s=="string"&&x.test(s)?K(s,n.locale,n.timeZone):typeof s=="string"&&$e(e,i)?E(e,i,s):F),C=typeof s=="string"&&_e(e,i,z),w=(n.glance||n.excerpt)&&!r&&(C||k)?re(z,{markdown:k}):z;if(c.includes(w)||y.some(p=>w.startsWith(p))||n.glance&&(typeof s=="string"||typeof s=="number")&&c.some(p=>me(p,w)))continue;let D=B(e,i),fe=typeof s=="number"?`${D} ${w}`:typeof s=="boolean"&&!r?`${D}: ${w.toLowerCase()}`:w;if(a.push({key:i,label:D,value:w,stored:F,alone:fe,long:C,...k?{markdown:!0}:{},...l[0]?{files:l}:{},...b?{app:b}:{},...m?{linked:m}:{},...L?{href:L}:{},...X(u?.[`${i}Repeat`])?{repeats:!0}:{}}),n.limit!==void 0&&a.length>=n.limit)break}return ke(a,e)}function ke(t,e){let n=new Map;for(let o of t){let d=we(e,o.key);d&&n.set(o.key,new Set(d.map(c=>E(e,o.key,c).toLowerCase())))}return n.size<2?t:t.map(o=>{let d=n.get(o.key);return d!==void 0&&[...n].some(([y,a])=>y!==o.key&&[...d].some(u=>a.has(u)))?{...o,alone:`${o.label}: ${o.value.toLowerCase()}`}:o})}function we(t,e){let n=t?.fields?.shape?.[e];for(let o=0;o<6&&n?._zod?.def?.innerType!==void 0;o++)n=n._zod.def.innerType;return n?._zod?.def?.type==="enum"&&n._zod.def.entries?Object.values(n._zod.def.entries).map(String):void 0}function $e(t,e){let n=t?.fields?.shape?.[e];for(let o=0;o<6&&n?._zod?.def?.innerType!==void 0;o++)n=n._zod.def.innerType;return n?._zod?.def?.type==="enum"}function be(t){let e=t?.fields?.shape;return[...Object.keys(e??{}),...Object.keys(t?.computed??{})]}function ce(t){return[...t?.fields??[],...(t?.groups??[]).flatMap(e=>e.fields)]}var Re=500,Ae=160;function Oe(t){let e=t;for(let n=0;n<6&&e?._zod?.def?.innerType!==void 0;n++)e=e._zod.def.innerType;return e?._zod?.def?.type==="string"?e._zod.def:void 0}function _e(t,e,n){return Oe(t?.fields?.shape?.[e])?.checks?.some(d=>d._zod?.def?.check==="max_length"&&(d._zod.def.maximum??0)>Re)?!0:typeof n=="string"&&(n.includes(`
|
|
2
2
|
`)||n.length>Ae)}function Be(t,e){let n=t?.display?.page,o=n?.groups??[],d=new Map(e.map(f=>[f.key,f])),c=new Set(ce(n)),y=f=>f.flatMap(h=>d.has(h)?[d.get(h)]:[]),a=e.filter(f=>!c.has(f.key));return[{fields:[...y(n?.fields??[]),...o.length>0?[]:a]},...o.map(f=>({title:f.title,fields:y(f.fields)})),...o.length>0?[{title:"Details",fields:a}]:[]].filter(f=>f.fields.length>0)}export{ge as a,Ye as b,Ze as c,he as d,Be as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk.WVUJXDXZ.js";import{b as C}from"./chunk.
|
|
1
|
+
import"./chunk.WVUJXDXZ.js";import{b as C}from"./chunk.WVN62OMH.js";import"./chunk.BZ4VZ6WQ.js";import"./chunk.XDPIS7RS.js";import"./chunk.57R4ZUMM.js";import"./chunk.J7ZMNAWB.js";import"./chunk.VKJAGZNU.js";import"./chunk.PCTVLNOS.js";import{oa as $,qa as E,ra as b,sa as k}from"./chunk.UG727PEE.js";import"./chunk.AJZBJBMO.js";function M(r,l,t){let p=r.getAttribute("data-record")??"",g=r.getAttribute("data-field")??"",e=Number(r.getAttribute("data-index")??"0"),c=[...l?.node?[l.node]:[],...l?.nodes??[]].find(a=>a.id===p);if(!p||!c)return{why:p?`names a record it was not shown ("${p.slice(0,80)}")`:"names no record (data-record)"};let s=g&&Object.hasOwn(c,g)?c[g]:void 0,o=(Array.isArray(s)?s:[s]).filter($),u=Number.isInteger(e)&&e>=0?o[e]:void 0,n=c.label?`"${c.label}"`:"a record";return g?u?(t==="video"?!b(u):!b(u)&&!E(u))?{why:`names "${u.name}" on ${n}, which is not ${t==="video"?"a video":"a picture or a video"}`}:{file:u,on:c}:{why:o.length===0?`names "${g}" on ${n}, which holds no file it was shown`:`names file ${r.getAttribute("data-index")} of "${g}" on ${n}, which holds ${o.length}`}:{why:`names no field of ${n} (data-field)`}}var A=r=>`${r.caption?.trim()||r.name}, ${k(r)}`;function T(r,l,t,p,g){let e=r.createElement("video");e.setAttribute("data-graview-video",""),e.setAttribute("controls",""),e.setAttribute("preload","metadata"),e.setAttribute("playsinline",""),e.setAttribute("aria-label",A(t));let c=t.poster?p(t.poster):void 0;c&&e.setAttribute("poster",c),t.width&&t.height?(e.setAttribute("width",String(t.width)),e.setAttribute("height",String(t.height)),e.style.aspectRatio=`${t.width} / ${t.height}`):e.style.aspectRatio="16 / 9",e.style.cssText+=";display:block;width:100%;height:auto;max-height:80vh;background:#000;border-radius:var(--graview-radius, 8px)";let s=t.captions?p(t.captions):void 0;if(s){let o=r.createElement("track");o.setAttribute("kind","captions"),o.setAttribute("src",s),o.setAttribute("srclang","en"),o.setAttribute("label","Captions"),o.setAttribute("default",""),e.appendChild(o)}return t.duration===void 0&&e.addEventListener("loadedmetadata",()=>Number.isFinite(e.duration)&&e.duration>0&&e.setAttribute("aria-label",A({...t,duration:e.duration}))),e.setAttribute("src",g),l.appendChild(e),e}function N(r,l){let t=r.document,p=new Set,g=n=>{p.has(n)||(p.add(n),l.onProblem?.(n))},e=n=>{let a=l.file?l.file(n):n;if(a!==void 0)try{let h=new r.URL(a,t.baseURI);return h.origin===r.location.origin&&/^https?:$/.test(h.protocol)?a:void 0}catch{return}},c=new WeakMap,s,o=n=>{if(typeof n.close=="function")return n.close();n.removeAttribute("open"),n.dispatchEvent(new r.Event("close"))},u=(n,a)=>g(`The ${n} in the view ${l.view} was not drawn: it ${a}.`);return{refresh(n){let a=l.shown();for(let h of Array.from(n.querySelectorAll("graview-video"))){let d=h.shadowRoot??h.attachShadow({mode:"open"});if(!l.pictures){c.delete(h),d.replaceChildren(),u("video",`asks for no pictures: a view places a record's video where its manifest says "pictures": true`);continue}let f=M(h,a,"video"),i="file"in f?JSON.stringify(f.file):"";if(c.get(h)===i&&d.childNodes.length>0)continue;if(c.set(h,i),d.replaceChildren(),"why"in f){u("video",f.why);continue}let m=e(f.file.href);if(!m){u("video",`names "${f.file.name}", which this host does not say it serves on this page`);continue}let w=t.createElement("style");w.textContent=":host { display: block; min-width: 0; }",d.appendChild(w),T(t,d,f.file,e,m)}},open(n){if(!l.pictures)return u("full-screen viewer",`asks for no pictures: a view opens a record's picture or video full screen where its manifest says "pictures": true`),!1;let a=M(n,l.shown(),"any");if("why"in a)return u("full-screen viewer",a.why),!1;let h=e(a.file.href);if(!h)return u("full-screen viewer",`names "${a.file.name}", which this host does not say it serves on this page`),!1;s&&o(s);let d=a.file,f=d.caption?.trim()||d.name,i=t.createElement("dialog");i.setAttribute("data-graview-lightbox",""),i.setAttribute("aria-label",b(d)?A(d):f),i.style.cssText="padding:0;border:0;border-radius:var(--graview-radius, 8px);max-width:min(96vw, 1600px);max-height:94vh;background:var(--graview-panel, Canvas);color:var(--graview-ink, CanvasText)";let m=t.createElement("figure");if(m.style.cssText="margin:0;display:grid;gap:8px;padding:10px",b(d))T(t,m,d,e,h);else{let v=t.createElement("img");v.setAttribute("src",h),v.setAttribute("alt",f),v.style.cssText="max-width:100%;max-height:80vh;object-fit:contain;display:block;margin:0 auto",m.appendChild(v)}let w=t.createElement("figcaption");w.style.cssText="display:flex;gap:12px;align-items:center;justify-content:space-between";let x=t.createElement("span");x.textContent=b(d)&&d.duration!==void 0?`${f} \xB7 ${C(d.duration)}`:f;let y=t.createElement("button");return y.type="button",y.textContent="Close",y.addEventListener("click",()=>o(i)),w.append(x,y),m.appendChild(w),i.appendChild(m),i.addEventListener("click",v=>v.target===i&&o(i)),i.addEventListener("close",()=>{i.remove(),s===i&&(s=void 0),n.focus?.()}),t.body.appendChild(i),s=i,typeof i.showModal=="function"?i.showModal():i.setAttribute("open",""),y.focus(),!0},dispose(){s&&o(s),s?.remove(),s=void 0}}}export{N as createGuestMedia,M as namedFile};
|
|
@@ -1 +1 @@
|
|
|
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 ee}from"./chunk.RCM7NOPF.js";import{o as be,p as Z,s as F,t as Me}from"./chunk.42XSBKPO.js";import{m as j,n as we,o as ke,p as J,q as X}from"./chunk.OJGHDWI6.js";import{c as Se}from"./chunk.2RVUDRRY.js";import{b as pe,c as ve,d as U,e as K,g as ye,o as Ae}from"./chunk.JHEVGLKB.js";import{$ as q,Aa as B,D as z,F as Y,G as O,J as me,O as fe,R as M,_ as A,aa as H,m as ce,sa as ge,ta as he,ua as T,v as ue,ya as _,z as de}from"./chunk.FOQZADMA.js";import{a as E}from"./chunk.SDO3U72B.js";import{Qc as le,ga as ie,pc as ae,uc as se}from"./chunk.V5MYKNL7.js";import{b as v}from"./chunk.AJZBJBMO.js";var P=v(O(),1),D=v(M(),1),te=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.FOQZADMA.js","./chunk.SDO3U72B.js","./chunk.V5MYKNL7.js","./chunk.AJZBJBMO.js"]),import("./chunk.HEVC6HHP.js")))),De=te.part(t=>(0,D.jsx)(t.HoverChipDoor,{}),{quiet:!0}),xe="A",Q=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.5A4AOFOA.js","./chunk.OF34OZ4V.js","./chunk.SIGC3G7S.js","./chunk.JACGQ2PR.js","./chunk.Z7LDT55A.js","./chunk.HJCQ6I3S.js","./chunk.VNUHESMZ.js","./chunk.N2K25KH3.js","./chunk.C2PECN4C.js","./chunk.XFZKP4IF.js","./chunk.AKQXF7GW.js","./chunk.C7JKMOFC.js","./chunk.BFNVG5JE.js","./chunk.V3V47QRE.js","./chunk.QHYXXZRD.js","./chunk.NGDXH66B.js","./chunk.67WWRC6Y.js","./chunk.VJXXCUKS.js","./chunk.Z5AB2DBF.js","./chunk.QIV65FWE.js","./chunk.UT6642FC.js","./chunk.HPAGOEZG.js","./chunk.ISXFH3CK.js","./chunk.TI4OSTQV.js","./chunk.BXT6FDT4.js","./chunk.N6MVK3KD.js","./chunk.I7XSDXQ3.js","./chunk.UHI3D7JC.js","./chunk.WVDKYUF3.js","./chunk.ZHLQWMV5.js","./chunk.TNESS3LQ.js","./chunk.42XSBKPO.js","./chunk.OJGHDWI6.js","./chunk.6FNMDAX5.js","./chunk.2FLPDPEL.js","./chunk.UUBYFBPN.js","./chunk.2RVUDRRY.js","./chunk.JHEVGLKB.js","./chunk.FOQZADMA.js","./chunk.SDO3U72B.js","./chunk.V5MYKNL7.js","./chunk.AJZBJBMO.js"]),import("./chunk.I4JBWTZM.js"))));var Ce=Q.part((t,e)=>(0,D.jsx)(t.InspectorPane,{...e}),{what:"This card's acts"});function Le(t){let e=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&t()},n=globalThis;if(n.requestIdleCallback){let d=n.requestIdleCallback(e,{timeout:5e3});return()=>n.cancelIdleCallback?.(d)}let o=setTimeout(e,2500);return()=>clearTimeout(o)}var Oe=150,Ne="[data-graview-pick], [data-graview-view], [data-graview-record], [data-graview-act], [data-graview-field], a[href]";function Re(t){if(t.closest("[data-graview-face='pages'], [data-graview-popover]"))return null;let e=t.closest("[data-graview-pick]")?.getAttribute("data-graview-pick")??t.closest("[data-graview-view]")?.getAttribute("data-graview-view");return e?{face:"scene",on:e,about:[e]}:null}function We(t){let{store:e,principal:n,providers:o,ai:d}=A(),u=Me(),y=Y(d),s=(0,P.useRef)({aimAt:t,store:e,principal:n,providers:o,prepareSections:u,chipsOn:y});s.current={aimAt:t,store:e,principal:n,providers:o,prepareSections:u,chipsOn:y},(0,P.useEffect)(()=>{if(typeof document>"u")return;let r=null,w=null,k=null,p=g=>{let c=s.current,b=c.chipsOn?c.aimAt(g):null;b&&(k=g,te.load().then(G=>{k===g&&G.restOn(b,g)},()=>{}))},l=()=>{r&&clearTimeout(r.timer),r=null},m=g=>{let c=s.current,b=c.aimAt(g);if(!b)return;let G=JSON.stringify([b.face,b.on,b.about,b.field,b.place,b.act,c.store.log.length]);G!==w&&(w=G,c.prepareSections(b),Q.load().then(Pe=>Pe.prepareActs(c.store,b,{principal:c.principal,providers:c.providers}),()=>{}))},a=g=>g.target instanceof Element?g.target.closest(Ne):null,f=g=>{if(g.pointerType==="touch")return;let c=a(g);c!==null&&c===r?.element||(l(),c!==null&&(r={element:c,timer:setTimeout(()=>{r=null,m(c),p(c)},Oe)}))},h=g=>{let c=g.relatedTarget;k!==null&&!(c instanceof Node&&k.contains(c))&&(k=null,te.current?.leaveRest()),r!==null&&(c instanceof Node&&r.element.contains(c)||l())},S=g=>{if(g.pointerType==="mouse")return;let c=a(g);c&&m(c)},I=g=>{if(!ge())return;let c=a(g);c&&m(c)};return document.addEventListener("pointerover",f,{passive:!0}),document.addEventListener("pointerout",h,{passive:!0}),document.addEventListener("pointerdown",S,{capture:!0,passive:!0}),document.addEventListener("focusin",I),()=>{l(),document.removeEventListener("pointerover",f),document.removeEventListener("pointerout",h),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("focusin",I)}},[])}function rt({placement:t="float",openActs:e,aimAt:n}={}){let{menuAt:o,setMenuAt:d,registerActsDoor:u,ai:y}=A(),{selection:s}=_();We(n??Re),(0,P.useEffect)(()=>{if(Q.current)return;let l=()=>{h(),Q.prefetch()},m=()=>{},a=he(()=>void(m=Le(l))),f=["pointerdown","keydown"];for(let S of f)document.addEventListener(S,l,{capture:!0,passive:!0});function h(){a(),m();for(let S of f)document.removeEventListener(S,l,{capture:!0})}return h},[]),(0,P.useEffect)(()=>{if(t==="menu")return u({key:xe,open:e??(l=>{let m=l.getBoundingClientRect(),a=l.closest("[data-graview-pick]")?.getAttribute("data-graview-pick")??l.closest("[data-graview-view]")?.getAttribute("data-graview-view")??void 0;d({x:Math.round(m.left+Math.min(16,m.width/2)),y:Math.round(Math.min(m.bottom,m.top+36)),...a?{on:a}:{}})})}),()=>u(null)},[t,u,d,e]);let r=o!==null||s.length>0&&e===void 0,[w,k]=(0,P.useState)(r);(0,P.useEffect)(()=>{r&&k(!0)},[r]);let p=Y(y)?(0,D.jsx)(P.Suspense,{fallback:null,children:(0,D.jsx)(De,{})}):null;return!w&&!r?p:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(P.Suspense,{fallback:null,children:(0,D.jsx)(Ce,{placement:t,chosen:e===void 0})}),p]})}var $=v(O(),1),V=v(M(),1),Ge=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.5A4AOFOA.js","./chunk.OF34OZ4V.js","./chunk.SIGC3G7S.js","./chunk.HKCK3JI4.js","./chunk.PMGXASFI.js","./chunk.C4TSM4W5.js","./chunk.XEKLEHC3.js","./chunk.JACGQ2PR.js","./chunk.53CDFJNM.js","./chunk.4QPVS2ZM.js","./chunk.RCM7NOPF.js","./chunk.Z7LDT55A.js","./chunk.HJCQ6I3S.js","./chunk.VNUHESMZ.js","./chunk.N2K25KH3.js","./chunk.C2PECN4C.js","./chunk.XFZKP4IF.js","./chunk.AKQXF7GW.js","./chunk.C7JKMOFC.js","./chunk.BFNVG5JE.js","./chunk.AIZQBPGU.js","./chunk.V3V47QRE.js","./chunk.5P556A7W.js","./chunk.QHYXXZRD.js","./chunk.BELCPW66.js","./chunk.6YPLZNVT.js","./chunk.5RABSIF7.js","./chunk.NGDXH66B.js","./chunk.67WWRC6Y.js","./chunk.VJXXCUKS.js","./chunk.Z5AB2DBF.js","./chunk.QIV65FWE.js","./chunk.UT6642FC.js","./chunk.HPAGOEZG.js","./chunk.ISXFH3CK.js","./chunk.TI4OSTQV.js","./chunk.BXT6FDT4.js","./chunk.WVUJXDXZ.js","./chunk.N6MVK3KD.js","./chunk.I7XSDXQ3.js","./chunk.UHI3D7JC.js","./chunk.WVDKYUF3.js","./chunk.ZHLQWMV5.js","./chunk.TNESS3LQ.js","./chunk.GZHZLJBF.js","./chunk.42XSBKPO.js","./chunk.OJGHDWI6.js","./chunk.6FNMDAX5.js","./chunk.2FLPDPEL.js","./chunk.UUBYFBPN.js","./chunk.2RVUDRRY.js","./chunk.JHEVGLKB.js","./chunk.FOQZADMA.js","./chunk.SDO3U72B.js","./chunk.V5MYKNL7.js","./chunk.AJZBJBMO.js"]),import("./chunk.F2MQJH6Y.js")))),ze=Ge.part((t,e)=>{let n=t.DraftFrame;return(0,V.jsx)(n,{...e})},{what:"The view"});function lt(t){let{seatTalk:e}=A();return(0,$.useSyncExternalStore)(e.subscribe,()=>e.get().draft!==null,()=>!1)?(0,V.jsx)($.Suspense,{fallback:null,children:(0,V.jsx)(ze,{...t})}):null}var C=v(O(),1),x=v(M(),1),Ee=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.67WWRC6Y.js","./chunk.ZRYSVOLA.js","./chunk.QIV65FWE.js","./chunk.UT6642FC.js","./chunk.HPAGOEZG.js","./chunk.ISXFH3CK.js","./chunk.H5ADMSE7.js","./chunk.TI4OSTQV.js","./chunk.I7XSDXQ3.js","./chunk.2FLPDPEL.js","./chunk.UUBYFBPN.js","./chunk.2RVUDRRY.js","./chunk.JHEVGLKB.js","./chunk.FOQZADMA.js","./chunk.SDO3U72B.js","./chunk.V5MYKNL7.js","./chunk.AJZBJBMO.js"]),import("./chunk.O75JKQPF.js")))),qe=Ee.part((t,e)=>{let n=t.QuickAskCard;return(0,x.jsx)(n,{...e})},{what:"The quick ask"});function ft({face:t,on:e=!0}){let{ai:n,aiDesk:o,selection:d,view:u}=A(),y=fe()?.open??!1,s=e&&z(n)&&!y,r=ye(o),w=(0,C.useRef)(null),k=(0,C.useRef)({selection:d,place:u.within?.view});return k.current={selection:d,place:u.within?.view},(0,C.useEffect)(()=>{if(!s)return;let p=ve(o);return p.drawn+=1,U(p),()=>{p.drawn=Math.max(0,p.drawn-1),p.drawn===0&&(p.open=null),U(p)}},[s,o]),(0,C.useEffect)(()=>{if(!s)return;let p=l=>{if(l.defaultPrevented||l.key.toLowerCase()!=="k"||!(l.metaKey||l.ctrlKey)||l.altKey||l.shiftKey)return;let m=w.current?.closest("[data-graview-embed]"),a=l.target,f=!(a instanceof Node)||a===document.body||a===document.documentElement;if(m&&!(f||a instanceof Node&&m.contains(a)))return;l.preventDefault(),Ee.prefetch();let h=document.activeElement,{selection:S,place:I}=k.current;K(o,{pointed:{...S[0]!==void 0?{on:S[0]}:{},about:S,...I?{place:I}:{}},returnTo:h instanceof HTMLElement&&h!==document.body?h:null})};return window.addEventListener("keydown",p,!0),()=>window.removeEventListener("keydown",p,!0)},[s,o]),s?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("span",{ref:w,hidden:!0,"data-graview-quick-ask":t}),r?(0,x.jsx)(C.Suspense,{fallback:null,children:(0,x.jsx)(qe,{face:t,opening:r,close:()=>K(o,null)},r.at)}):null]}):null}var R=v(O(),1),L=v(M(),1),ne=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.ZRYSVOLA.js","./chunk.QIV65FWE.js","./chunk.UT6642FC.js","./chunk.HPAGOEZG.js","./chunk.ISXFH3CK.js","./chunk.H5ADMSE7.js","./chunk.TI4OSTQV.js","./chunk.I7XSDXQ3.js","./chunk.2FLPDPEL.js","./chunk.UUBYFBPN.js","./chunk.2RVUDRRY.js","./chunk.JHEVGLKB.js","./chunk.FOQZADMA.js","./chunk.SDO3U72B.js","./chunk.V5MYKNL7.js","./chunk.AJZBJBMO.js"]),import("./chunk.SCYQSXW4.js")))),He=ne.part((t,e)=>{let n=t.InlineAiMenu;return(0,L.jsx)(n,{...e})},{what:"The AI's suggestions"}),_e=ne.part((t,e)=>{let n=t.GhostTray;return(0,L.jsx)(n,{...e})},{quiet:!0});function Be(){let{ai:t}=A(),e=z(t);return(0,R.useMemo)(()=>e?n=>({id:"inline-ai",heading:"AI",render:o=>(0,L.jsx)(R.Suspense,{fallback:null,children:(0,L.jsx)(He,{target:n,close:o})}),prepare:()=>ne.prefetch()}):null,[e])}var Fe=[];function kt({children:t}){let e=Be(),n=(0,R.useMemo)(()=>e?[e]:Fe,[e]);return(0,L.jsx)(F,{sections:n,children:t})}function St(t){let{ai:e,aiDesk:n}=A(),{ghost:o}=me(n);return o===null||o.onCard||e.off?null:(0,L.jsx)(R.Suspense,{fallback:null,children:(0,L.jsx)(_e,{...t})})}var N=v(O(),1);var Te=v(M(),1),oe=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.JHEVGLKB.js","./chunk.FOQZADMA.js","./chunk.SDO3U72B.js","./chunk.V5MYKNL7.js","./chunk.AJZBJBMO.js"]),import("./chunk.33KXSD6F.js"))));function Ve(t){let e=t.about[0];if(t.about.length!==1||!e?.startsWith("aggregate:"))return;let n=e.slice(10).split("+");return n.length===1?n[0]:void 0}function $e(t,e){return t.filter(n=>n.as!==e.as&&!n.hidden&&(n.kind===e.kind||n.over?.includes(e.kind)===!0)).at(-1)}function Ye(t){let e=q(),n=e?.keptViews,o=e?.views,d=(0,N.useContext)(Ae);return(0,N.useMemo)(()=>!n||!o?null:u=>{if(u.place===void 0)return null;let y=n.current(),s=Ve(u),r=o.places().find(l=>l.as===u.place&&(s===void 0||l.kind===s||l.over?.includes(s)===!0));if(!r)return null;let w=le(r,y,n);if(!w)return null;let k=l=>void oe.load().then(m=>m.setHidden(r,w,n,l,d),String);return{id:"tidy-view",items:[r.hidden?{id:"show-view",label:"Show",hint:"Back in the places, for everyone",run:()=>k(!1)}:{id:"hide-view",label:"Hide",hint:"Off the places and the scene, for everyone",run:()=>k(!0)},{id:"delete-view",label:"Delete",hint:`Kept ${30} days under Recently deleted`,run:()=>{let l=$e(o.places(),r);oe.load().then(m=>m.remove(r,w,n,d).then(a=>a&&t?.(r,l)),String)}}],prepare:()=>oe.prefetch()}},[n,o,d,t])}var Ue=[];function Dt({children:t}){let{view:e,go:n}=B(),o=(0,N.useCallback)((y,s)=>{let r=e.within?.view;e.focusId===ue(y.kind)&&(r===void 0||r===y.as)&&n(s?de(e,s.kind,s.as):ce(e,!0))},[e,n]),d=Ye(o),u=(0,N.useMemo)(()=>d?[d]:Ue,[d]);return(0,Te.jsx)(F,{sections:u,children:t})}function Ot(t={}){return t.scope===void 0?ee:pe(ee,t.scope)}var W=v(O(),1),i=v(M(),1);function Ht({inside:t=!1,widthOf:e}={}){let{store:n,view:o,emphasis:d,setEmphasis:u}=A(),y=be(),{selection:s,set:r}=_(),{show:w}=B(),k=H(),p=(0,W.useMemo)(()=>{let a=new Map;for(let f of n.graph.allEdges()){let h=a.get(f.kind)??{count:0,ends:new Set};h.count+=1;for(let S of[f.from,f.to]){let I=n.graph.getNode(S);I&&h.ends.add(`kind:${I.kind}`)}a.set(f.kind,h)}return[...a.entries()].sort(([f],[h])=>f.localeCompare(h)).map(([f,h])=>({kind:f,count:h.count,ends:[...h.ends]}))},[n,k]),l=Math.max(0,...p.map(a=>a.count));if((0,W.useEffect)(()=>()=>u(null),[u]),!o.overview&&!t||p.length===0)return null;let m=new Set;for(let a of s){if(a.startsWith("kind:")){m.add(a);continue}let f=n.graph.getNode(a);f&&m.add(`kind:${f.kind}`)}return(0,i.jsxs)("section",{"aria-label":"What the lines mean",role:t?"group":void 0,"data-testid":"relation-key",style:t?{display:"grid",gap:1}:{position:"absolute",left:16,top:14,zIndex:se("rail"),display:"grid",gap:1,padding:"8px 10px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)",maxWidth:Ke,animation:"graview-settle 380ms 280ms ease backwards"},children:[t?null:(0,i.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.16em",textTransform:"uppercase",color:"var(--graview-ink-faint)",paddingBottom:2},children:p.length===1?"1 relation":`${p.length} relations`}),e?(0,i.jsx)(Je,{aloft:o.overview===!0}):null,p.map(({kind:a,count:f,ends:h})=>{let{connector:S,style:I}=Z(y,a),g=je(n.schema,a),c=d!==null?d===a:m.size===0||h.some(b=>m.has(b));return(0,i.jsxs)("button",{type:"button",title:n.schema.edge(a)?.description===void 0?`${f} of these`:g.words,onMouseEnter:()=>u(a),onMouseLeave:()=>u(null),onFocus:()=>u(a),onBlur:()=>u(null),onClick:()=>{r(h),w(null)},style:{all:"unset",outline:"revert-layer",cursor:"pointer",display:"grid",gridTemplateColumns:"30px 1fr auto",alignItems:"center",gap:8,minHeight:23,padding:"2px 4px",borderRadius:6,opacity:c?1:.4},children:[(0,i.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",style:{display:"block",opacity:S.visible?1:.35},children:o.overview&&e?(0,i.jsx)("path",{d:"M 1 5 L 29 5",fill:"none",className:"graview-key-ribbon",stroke:"var(--graview-ink)",strokeOpacity:.35,strokeWidth:e(f,l)}):(0,i.jsx)("path",{d:"M 1 5 L 29 5",fill:"none",stroke:J(I),strokeWidth:X(I,!0),strokeDasharray:j[I.pattern],strokeLinecap:"round"})}),(0,i.jsxs)("span",{style:{display:"grid",minWidth:0},"data-graview-relation-words":a,children:[(0,i.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink)"},children:g.words}),(0,i.jsx)("span",{style:{fontSize:"0.6875rem",color:"var(--graview-ink-faint)"},children:g.ends})]}),S.visible?null:(0,i.jsx)("span",{"data-graview-quiet":a,style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",fontStyle:"italic"},children:"not drawn"}),(0,i.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",fontVariantNumeric:"tabular-nums"},children:f})]},a)})]})}var Ke="min(280px, calc(100% - 28px))";function je(t,e,n){let o=t.edge(e)?.from??[],d=new Map;for(let s of n!==void 0&&o.includes(n)?[n]:o.length>0?o:[""]){let r=Se(t,s,e,"out");d.set(r,[...d.get(r)??[],s])}let u=s=>s==="*"?"anything":ie(t,s),y=[...d].map(([s,r])=>{let w=r.flatMap(p=>t.tryDefinition(p)?.edges[e]?.to??[]),k=r[0]&&w.length>0?`${r.map(u).join(", ")} \u2192 ${(w.includes("*")?["*"]:[...new Set(w)]).map(u).join(", ")}`:"";return[s.charAt(0).toUpperCase()+s.slice(1),k]});return{words:y.map(([s])=>s).join(" \xB7 "),ends:y.flatMap(([,s])=>s?[s]:[]).join(" \xB7 ")}}function _t({edgeKind:t,kit:e,width:n=30}){let o=q(),d=(0,W.useMemo)(()=>ae(e??o?.brand?.kit),[e,o?.brand?.kit]),{connector:u,style:y}=Z(d,t);return(0,i.jsx)("svg",{width:n,height:"8","aria-hidden":"true","data-testid":"relation-mark","data-graview-relation":t,style:{display:"inline-block",verticalAlign:"middle",opacity:u.visible?1:.35},children:(0,i.jsx)("path",{d:`M 1 4 L ${n-1} 4`,fill:"none",stroke:J(y),strokeWidth:X(y,!0),strokeDasharray:j[y.pattern],strokeLinecap:"round"})})}function Je({aloft:t}){let e={display:"grid",gridTemplateColumns:"30px 1fr",alignItems:"center",gap:8,minHeight:23,padding:"2px 4px"},n={fontSize:"0.75rem",color:"var(--graview-ink-muted)"};return(0,i.jsxs)("div",{role:"group","aria-label":"The lines","data-testid":"line-manners",style:{display:"grid",gap:1,paddingBottom:6,marginBottom:4,borderBottom:"1px solid var(--graview-edge)"},children:[t?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{style:e,"data-graview-manner":"ribbon",children:[(0,i.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-ink)",strokeOpacity:.35,strokeWidth:6})}),(0,i.jsx)("span",{style:n,children:"A relation between two districts, as wide as the links along it \u2014 point at one for its words"})]}),(0,i.jsxs)("div",{style:e,"data-graview-manner":"record",children:[(0,i.jsxs)("svg",{width:"30",height:"10","aria-hidden":"true",children:[(0,i.jsx)("path",{d:"M 1 5 L 25 5",stroke:"var(--graview-accent)",strokeWidth:1.8,strokeLinecap:"round"}),(0,i.jsx)("circle",{cx:26,cy:5,r:3,fill:"var(--graview-accent)"})]}),(0,i.jsx)("span",{style:n,children:"A chosen record's link to another record, labeled with the relation"})]}),(0,i.jsxs)("div",{style:e,"data-graview-manner":"district",children:[(0,i.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-accent)",strokeWidth:1.8,strokeDasharray:"5 4"})}),(0,i.jsx)("span",{style:n,children:"A chosen record's links into a district, with how many"})]})]}):null,(0,i.jsxs)("div",{style:e,"data-graview-manner":"unsure",children:[(0,i.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-accent)",strokeOpacity:ke,strokeWidth:1.8,strokeDasharray:we,strokeLinecap:"round"})}),(0,i.jsx)("span",{style:n,children:"Unsure: a link its maker was less than sure of, until a person keeps it \u2014 point at its words for what it was based on"})]})]})}var Ie=v(O(),1),re=v(M(),1),Xe=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.AKQXF7GW.js","./chunk.C7JKMOFC.js","./chunk.BFNVG5JE.js","./chunk.V3V47QRE.js","./chunk.QHYXXZRD.js","./chunk.UT6642FC.js","./chunk.TI4OSTQV.js","./chunk.2FLPDPEL.js","./chunk.UUBYFBPN.js","./chunk.2RVUDRRY.js","./chunk.JHEVGLKB.js","./chunk.FOQZADMA.js","./chunk.SDO3U72B.js","./chunk.V5MYKNL7.js","./chunk.AJZBJBMO.js"]),import("./chunk.XOYJ26YB.js")))),Ze=Xe.part(t=>(0,re.jsx)(t.SuggestedTray,{}),{quiet:!0});function Vt(){let{store:t}=A(),e=H();return(0,Ie.useMemo)(()=>t.log.all().some(o=>o.suggests!==void 0&&!o.withheld),[t,e])?(0,re.jsx)(Ze,{}):null}export{rt as a,lt as b,ft as c,Ht as d,Ke as e,_t as f,Be as g,kt as h,St as i,Ye as j,Dt as k,Ot as l,Vt as m};
|
|
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 ee}from"./chunk.VEP4EJ2N.js";import{o as be,p as Z,s as F,t as Me}from"./chunk.HG2IO5NS.js";import{m as j,n as we,o as ke,p as J,q as X}from"./chunk.OJGHDWI6.js";import{c as Se}from"./chunk.PCTVLNOS.js";import{b as pe,c as ve,d as U,e as K,g as ye,o as Ae}from"./chunk.4QEDYRES.js";import{$ as q,Aa as B,D as z,F as Y,G as O,J as me,O as fe,R as M,_ as A,aa as H,m as ce,sa as ge,ta as he,ua as T,v as ue,ya as _,z as de}from"./chunk.JE4QQEJE.js";import{a as E}from"./chunk.SDO3U72B.js";import{Sc as le,ha as ie,rc as ae,wc as se}from"./chunk.UG727PEE.js";import{b as v}from"./chunk.AJZBJBMO.js";var P=v(O(),1),D=v(M(),1),te=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.JE4QQEJE.js","./chunk.SDO3U72B.js","./chunk.UG727PEE.js","./chunk.AJZBJBMO.js"]),import("./chunk.LMUFLZYT.js")))),De=te.part(t=>(0,D.jsx)(t.HoverChipDoor,{}),{quiet:!0}),xe="A",Q=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.5A4AOFOA.js","./chunk.KSXB4LDF.js","./chunk.RR4RZH4S.js","./chunk.WUQOSVQU.js","./chunk.7EB6SDUQ.js","./chunk.HJCQ6I3S.js","./chunk.5FHH5NR6.js","./chunk.VMBIFUYX.js","./chunk.I7QCXRP7.js","./chunk.O7VHAKSA.js","./chunk.QXMTGLHR.js","./chunk.P6J6VFF5.js","./chunk.L6HKDIZB.js","./chunk.U3MQUIJL.js","./chunk.OTHGZPUC.js","./chunk.V3K32XD7.js","./chunk.CAZX6OPN.js","./chunk.X2M7IOQA.js","./chunk.WZEA2UK6.js","./chunk.V5VQCANB.js","./chunk.UT6642FC.js","./chunk.WERBD5ZR.js","./chunk.HAY22FPJ.js","./chunk.TI4OSTQV.js","./chunk.PH5ITX3N.js","./chunk.WVN62OMH.js","./chunk.BZ4VZ6WQ.js","./chunk.XDPIS7RS.js","./chunk.57R4ZUMM.js","./chunk.J7ZMNAWB.js","./chunk.VKJAGZNU.js","./chunk.HG2IO5NS.js","./chunk.OJGHDWI6.js","./chunk.AQTCN7KQ.js","./chunk.LFJH6X6O.js","./chunk.VTUMPH4Z.js","./chunk.PCTVLNOS.js","./chunk.4QEDYRES.js","./chunk.JE4QQEJE.js","./chunk.SDO3U72B.js","./chunk.UG727PEE.js","./chunk.AJZBJBMO.js"]),import("./chunk.ZBYLAC3B.js"))));var Ce=Q.part((t,e)=>(0,D.jsx)(t.InspectorPane,{...e}),{what:"This card's acts"});function Le(t){let e=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&t()},n=globalThis;if(n.requestIdleCallback){let d=n.requestIdleCallback(e,{timeout:5e3});return()=>n.cancelIdleCallback?.(d)}let o=setTimeout(e,2500);return()=>clearTimeout(o)}var Oe=150,Ne="[data-graview-pick], [data-graview-view], [data-graview-record], [data-graview-act], [data-graview-field], a[href]";function Re(t){if(t.closest("[data-graview-face='pages'], [data-graview-popover]"))return null;let e=t.closest("[data-graview-pick]")?.getAttribute("data-graview-pick")??t.closest("[data-graview-view]")?.getAttribute("data-graview-view");return e?{face:"scene",on:e,about:[e]}:null}function We(t){let{store:e,principal:n,providers:o,ai:d}=A(),u=Me(),y=Y(d),s=(0,P.useRef)({aimAt:t,store:e,principal:n,providers:o,prepareSections:u,chipsOn:y});s.current={aimAt:t,store:e,principal:n,providers:o,prepareSections:u,chipsOn:y},(0,P.useEffect)(()=>{if(typeof document>"u")return;let r=null,w=null,k=null,p=g=>{let c=s.current,b=c.chipsOn?c.aimAt(g):null;b&&(k=g,te.load().then(G=>{k===g&&G.restOn(b,g)},()=>{}))},l=()=>{r&&clearTimeout(r.timer),r=null},m=g=>{let c=s.current,b=c.aimAt(g);if(!b)return;let G=JSON.stringify([b.face,b.on,b.about,b.field,b.place,b.act,c.store.log.length]);G!==w&&(w=G,c.prepareSections(b),Q.load().then(Pe=>Pe.prepareActs(c.store,b,{principal:c.principal,providers:c.providers}),()=>{}))},a=g=>g.target instanceof Element?g.target.closest(Ne):null,f=g=>{if(g.pointerType==="touch")return;let c=a(g);c!==null&&c===r?.element||(l(),c!==null&&(r={element:c,timer:setTimeout(()=>{r=null,m(c),p(c)},Oe)}))},h=g=>{let c=g.relatedTarget;k!==null&&!(c instanceof Node&&k.contains(c))&&(k=null,te.current?.leaveRest()),r!==null&&(c instanceof Node&&r.element.contains(c)||l())},S=g=>{if(g.pointerType==="mouse")return;let c=a(g);c&&m(c)},I=g=>{if(!ge())return;let c=a(g);c&&m(c)};return document.addEventListener("pointerover",f,{passive:!0}),document.addEventListener("pointerout",h,{passive:!0}),document.addEventListener("pointerdown",S,{capture:!0,passive:!0}),document.addEventListener("focusin",I),()=>{l(),document.removeEventListener("pointerover",f),document.removeEventListener("pointerout",h),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("focusin",I)}},[])}function rt({placement:t="float",openActs:e,aimAt:n}={}){let{menuAt:o,setMenuAt:d,registerActsDoor:u,ai:y}=A(),{selection:s}=_();We(n??Re),(0,P.useEffect)(()=>{if(Q.current)return;let l=()=>{h(),Q.prefetch()},m=()=>{},a=he(()=>void(m=Le(l))),f=["pointerdown","keydown"];for(let S of f)document.addEventListener(S,l,{capture:!0,passive:!0});function h(){a(),m();for(let S of f)document.removeEventListener(S,l,{capture:!0})}return h},[]),(0,P.useEffect)(()=>{if(t==="menu")return u({key:xe,open:e??(l=>{let m=l.getBoundingClientRect(),a=l.closest("[data-graview-pick]")?.getAttribute("data-graview-pick")??l.closest("[data-graview-view]")?.getAttribute("data-graview-view")??void 0;d({x:Math.round(m.left+Math.min(16,m.width/2)),y:Math.round(Math.min(m.bottom,m.top+36)),...a?{on:a}:{}})})}),()=>u(null)},[t,u,d,e]);let r=o!==null||s.length>0&&e===void 0,[w,k]=(0,P.useState)(r);(0,P.useEffect)(()=>{r&&k(!0)},[r]);let p=Y(y)?(0,D.jsx)(P.Suspense,{fallback:null,children:(0,D.jsx)(De,{})}):null;return!w&&!r?p:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(P.Suspense,{fallback:null,children:(0,D.jsx)(Ce,{placement:t,chosen:e===void 0})}),p]})}var $=v(O(),1),V=v(M(),1),Ge=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.5A4AOFOA.js","./chunk.KSXB4LDF.js","./chunk.RR4RZH4S.js","./chunk.ILPD5CZG.js","./chunk.KZDLDXLB.js","./chunk.EC2T2UVH.js","./chunk.Y2QDZLSY.js","./chunk.WUQOSVQU.js","./chunk.ETWOZQWL.js","./chunk.B6DKKNVR.js","./chunk.VEP4EJ2N.js","./chunk.7EB6SDUQ.js","./chunk.HJCQ6I3S.js","./chunk.5FHH5NR6.js","./chunk.VMBIFUYX.js","./chunk.I7QCXRP7.js","./chunk.O7VHAKSA.js","./chunk.QXMTGLHR.js","./chunk.P6J6VFF5.js","./chunk.L6HKDIZB.js","./chunk.QHP7AJUV.js","./chunk.U3MQUIJL.js","./chunk.DNMBZONP.js","./chunk.OTHGZPUC.js","./chunk.4YBP552Z.js","./chunk.EVHXF7LZ.js","./chunk.ARTJL3X2.js","./chunk.V3K32XD7.js","./chunk.CAZX6OPN.js","./chunk.X2M7IOQA.js","./chunk.WZEA2UK6.js","./chunk.V5VQCANB.js","./chunk.UT6642FC.js","./chunk.WERBD5ZR.js","./chunk.HAY22FPJ.js","./chunk.TI4OSTQV.js","./chunk.PH5ITX3N.js","./chunk.WVUJXDXZ.js","./chunk.WVN62OMH.js","./chunk.BZ4VZ6WQ.js","./chunk.XDPIS7RS.js","./chunk.57R4ZUMM.js","./chunk.J7ZMNAWB.js","./chunk.VKJAGZNU.js","./chunk.GZHZLJBF.js","./chunk.HG2IO5NS.js","./chunk.OJGHDWI6.js","./chunk.AQTCN7KQ.js","./chunk.LFJH6X6O.js","./chunk.VTUMPH4Z.js","./chunk.PCTVLNOS.js","./chunk.4QEDYRES.js","./chunk.JE4QQEJE.js","./chunk.SDO3U72B.js","./chunk.UG727PEE.js","./chunk.AJZBJBMO.js"]),import("./chunk.6NF32PAT.js")))),ze=Ge.part((t,e)=>{let n=t.DraftFrame;return(0,V.jsx)(n,{...e})},{what:"The view"});function lt(t){let{seatTalk:e}=A();return(0,$.useSyncExternalStore)(e.subscribe,()=>e.get().draft!==null,()=>!1)?(0,V.jsx)($.Suspense,{fallback:null,children:(0,V.jsx)(ze,{...t})}):null}var C=v(O(),1),x=v(M(),1),Ee=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.CAZX6OPN.js","./chunk.LWAZ6ZO6.js","./chunk.V5VQCANB.js","./chunk.UT6642FC.js","./chunk.WERBD5ZR.js","./chunk.HAY22FPJ.js","./chunk.U6YOAS4X.js","./chunk.TI4OSTQV.js","./chunk.BZ4VZ6WQ.js","./chunk.LFJH6X6O.js","./chunk.VTUMPH4Z.js","./chunk.PCTVLNOS.js","./chunk.4QEDYRES.js","./chunk.JE4QQEJE.js","./chunk.SDO3U72B.js","./chunk.UG727PEE.js","./chunk.AJZBJBMO.js"]),import("./chunk.IGA7OD3L.js")))),qe=Ee.part((t,e)=>{let n=t.QuickAskCard;return(0,x.jsx)(n,{...e})},{what:"The quick ask"});function ft({face:t,on:e=!0}){let{ai:n,aiDesk:o,selection:d,view:u}=A(),y=fe()?.open??!1,s=e&&z(n)&&!y,r=ye(o),w=(0,C.useRef)(null),k=(0,C.useRef)({selection:d,place:u.within?.view});return k.current={selection:d,place:u.within?.view},(0,C.useEffect)(()=>{if(!s)return;let p=ve(o);return p.drawn+=1,U(p),()=>{p.drawn=Math.max(0,p.drawn-1),p.drawn===0&&(p.open=null),U(p)}},[s,o]),(0,C.useEffect)(()=>{if(!s)return;let p=l=>{if(l.defaultPrevented||l.key.toLowerCase()!=="k"||!(l.metaKey||l.ctrlKey)||l.altKey||l.shiftKey)return;let m=w.current?.closest("[data-graview-embed]"),a=l.target,f=!(a instanceof Node)||a===document.body||a===document.documentElement;if(m&&!(f||a instanceof Node&&m.contains(a)))return;l.preventDefault(),Ee.prefetch();let h=document.activeElement,{selection:S,place:I}=k.current;K(o,{pointed:{...S[0]!==void 0?{on:S[0]}:{},about:S,...I?{place:I}:{}},returnTo:h instanceof HTMLElement&&h!==document.body?h:null})};return window.addEventListener("keydown",p,!0),()=>window.removeEventListener("keydown",p,!0)},[s,o]),s?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("span",{ref:w,hidden:!0,"data-graview-quick-ask":t}),r?(0,x.jsx)(C.Suspense,{fallback:null,children:(0,x.jsx)(qe,{face:t,opening:r,close:()=>K(o,null)},r.at)}):null]}):null}var R=v(O(),1),L=v(M(),1),ne=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.LWAZ6ZO6.js","./chunk.V5VQCANB.js","./chunk.UT6642FC.js","./chunk.WERBD5ZR.js","./chunk.HAY22FPJ.js","./chunk.U6YOAS4X.js","./chunk.TI4OSTQV.js","./chunk.BZ4VZ6WQ.js","./chunk.LFJH6X6O.js","./chunk.VTUMPH4Z.js","./chunk.PCTVLNOS.js","./chunk.4QEDYRES.js","./chunk.JE4QQEJE.js","./chunk.SDO3U72B.js","./chunk.UG727PEE.js","./chunk.AJZBJBMO.js"]),import("./chunk.BJET6KOG.js")))),He=ne.part((t,e)=>{let n=t.InlineAiMenu;return(0,L.jsx)(n,{...e})},{what:"The AI's suggestions"}),_e=ne.part((t,e)=>{let n=t.GhostTray;return(0,L.jsx)(n,{...e})},{quiet:!0});function Be(){let{ai:t}=A(),e=z(t);return(0,R.useMemo)(()=>e?n=>({id:"inline-ai",heading:"AI",render:o=>(0,L.jsx)(R.Suspense,{fallback:null,children:(0,L.jsx)(He,{target:n,close:o})}),prepare:()=>ne.prefetch()}):null,[e])}var Fe=[];function kt({children:t}){let e=Be(),n=(0,R.useMemo)(()=>e?[e]:Fe,[e]);return(0,L.jsx)(F,{sections:n,children:t})}function St(t){let{ai:e,aiDesk:n}=A(),{ghost:o}=me(n);return o===null||o.onCard||e.off?null:(0,L.jsx)(R.Suspense,{fallback:null,children:(0,L.jsx)(_e,{...t})})}var N=v(O(),1);var Te=v(M(),1),oe=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.4QEDYRES.js","./chunk.JE4QQEJE.js","./chunk.SDO3U72B.js","./chunk.UG727PEE.js","./chunk.AJZBJBMO.js"]),import("./chunk.LZH65VSN.js"))));function Ve(t){let e=t.about[0];if(t.about.length!==1||!e?.startsWith("aggregate:"))return;let n=e.slice(10).split("+");return n.length===1?n[0]:void 0}function $e(t,e){return t.filter(n=>n.as!==e.as&&!n.hidden&&(n.kind===e.kind||n.over?.includes(e.kind)===!0)).at(-1)}function Ye(t){let e=q(),n=e?.keptViews,o=e?.views,d=(0,N.useContext)(Ae);return(0,N.useMemo)(()=>!n||!o?null:u=>{if(u.place===void 0)return null;let y=n.current(),s=Ve(u),r=o.places().find(l=>l.as===u.place&&(s===void 0||l.kind===s||l.over?.includes(s)===!0));if(!r)return null;let w=le(r,y,n);if(!w)return null;let k=l=>void oe.load().then(m=>m.setHidden(r,w,n,l,d),String);return{id:"tidy-view",items:[r.hidden?{id:"show-view",label:"Show",hint:"Back in the places, for everyone",run:()=>k(!1)}:{id:"hide-view",label:"Hide",hint:"Off the places and the scene, for everyone",run:()=>k(!0)},{id:"delete-view",label:"Delete",hint:`Kept ${30} days under Recently deleted`,run:()=>{let l=$e(o.places(),r);oe.load().then(m=>m.remove(r,w,n,d).then(a=>a&&t?.(r,l)),String)}}],prepare:()=>oe.prefetch()}},[n,o,d,t])}var Ue=[];function Dt({children:t}){let{view:e,go:n}=B(),o=(0,N.useCallback)((y,s)=>{let r=e.within?.view;e.focusId===ue(y.kind)&&(r===void 0||r===y.as)&&n(s?de(e,s.kind,s.as):ce(e,!0))},[e,n]),d=Ye(o),u=(0,N.useMemo)(()=>d?[d]:Ue,[d]);return(0,Te.jsx)(F,{sections:u,children:t})}function Ot(t={}){return t.scope===void 0?ee:pe(ee,t.scope)}var W=v(O(),1),i=v(M(),1);function Ht({inside:t=!1,widthOf:e}={}){let{store:n,view:o,emphasis:d,setEmphasis:u}=A(),y=be(),{selection:s,set:r}=_(),{show:w}=B(),k=H(),p=(0,W.useMemo)(()=>{let a=new Map;for(let f of n.graph.allEdges()){let h=a.get(f.kind)??{count:0,ends:new Set};h.count+=1;for(let S of[f.from,f.to]){let I=n.graph.getNode(S);I&&h.ends.add(`kind:${I.kind}`)}a.set(f.kind,h)}return[...a.entries()].sort(([f],[h])=>f.localeCompare(h)).map(([f,h])=>({kind:f,count:h.count,ends:[...h.ends]}))},[n,k]),l=Math.max(0,...p.map(a=>a.count));if((0,W.useEffect)(()=>()=>u(null),[u]),!o.overview&&!t||p.length===0)return null;let m=new Set;for(let a of s){if(a.startsWith("kind:")){m.add(a);continue}let f=n.graph.getNode(a);f&&m.add(`kind:${f.kind}`)}return(0,i.jsxs)("section",{"aria-label":"What the lines mean",role:t?"group":void 0,"data-testid":"relation-key",style:t?{display:"grid",gap:1}:{position:"absolute",left:16,top:14,zIndex:se("rail"),display:"grid",gap:1,padding:"8px 10px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)",maxWidth:Ke,animation:"graview-settle 380ms 280ms ease backwards"},children:[t?null:(0,i.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.16em",textTransform:"uppercase",color:"var(--graview-ink-faint)",paddingBottom:2},children:p.length===1?"1 relation":`${p.length} relations`}),e?(0,i.jsx)(Je,{aloft:o.overview===!0}):null,p.map(({kind:a,count:f,ends:h})=>{let{connector:S,style:I}=Z(y,a),g=je(n.schema,a),c=d!==null?d===a:m.size===0||h.some(b=>m.has(b));return(0,i.jsxs)("button",{type:"button",title:n.schema.edge(a)?.description===void 0?`${f} of these`:g.words,onMouseEnter:()=>u(a),onMouseLeave:()=>u(null),onFocus:()=>u(a),onBlur:()=>u(null),onClick:()=>{r(h),w(null)},style:{all:"unset",outline:"revert-layer",cursor:"pointer",display:"grid",gridTemplateColumns:"30px 1fr auto",alignItems:"center",gap:8,minHeight:23,padding:"2px 4px",borderRadius:6,opacity:c?1:.4},children:[(0,i.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",style:{display:"block",opacity:S.visible?1:.35},children:o.overview&&e?(0,i.jsx)("path",{d:"M 1 5 L 29 5",fill:"none",className:"graview-key-ribbon",stroke:"var(--graview-ink)",strokeOpacity:.35,strokeWidth:e(f,l)}):(0,i.jsx)("path",{d:"M 1 5 L 29 5",fill:"none",stroke:J(I),strokeWidth:X(I,!0),strokeDasharray:j[I.pattern],strokeLinecap:"round"})}),(0,i.jsxs)("span",{style:{display:"grid",minWidth:0},"data-graview-relation-words":a,children:[(0,i.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink)"},children:g.words}),(0,i.jsx)("span",{style:{fontSize:"0.6875rem",color:"var(--graview-ink-faint)"},children:g.ends})]}),S.visible?null:(0,i.jsx)("span",{"data-graview-quiet":a,style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",fontStyle:"italic"},children:"not drawn"}),(0,i.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",fontVariantNumeric:"tabular-nums"},children:f})]},a)})]})}var Ke="min(280px, calc(100% - 28px))";function je(t,e,n){let o=t.edge(e)?.from??[],d=new Map;for(let s of n!==void 0&&o.includes(n)?[n]:o.length>0?o:[""]){let r=Se(t,s,e,"out");d.set(r,[...d.get(r)??[],s])}let u=s=>s==="*"?"anything":ie(t,s),y=[...d].map(([s,r])=>{let w=r.flatMap(p=>t.tryDefinition(p)?.edges[e]?.to??[]),k=r[0]&&w.length>0?`${r.map(u).join(", ")} \u2192 ${(w.includes("*")?["*"]:[...new Set(w)]).map(u).join(", ")}`:"";return[s.charAt(0).toUpperCase()+s.slice(1),k]});return{words:y.map(([s])=>s).join(" \xB7 "),ends:y.flatMap(([,s])=>s?[s]:[]).join(" \xB7 ")}}function _t({edgeKind:t,kit:e,width:n=30}){let o=q(),d=(0,W.useMemo)(()=>ae(e??o?.brand?.kit),[e,o?.brand?.kit]),{connector:u,style:y}=Z(d,t);return(0,i.jsx)("svg",{width:n,height:"8","aria-hidden":"true","data-testid":"relation-mark","data-graview-relation":t,style:{display:"inline-block",verticalAlign:"middle",opacity:u.visible?1:.35},children:(0,i.jsx)("path",{d:`M 1 4 L ${n-1} 4`,fill:"none",stroke:J(y),strokeWidth:X(y,!0),strokeDasharray:j[y.pattern],strokeLinecap:"round"})})}function Je({aloft:t}){let e={display:"grid",gridTemplateColumns:"30px 1fr",alignItems:"center",gap:8,minHeight:23,padding:"2px 4px"},n={fontSize:"0.75rem",color:"var(--graview-ink-muted)"};return(0,i.jsxs)("div",{role:"group","aria-label":"The lines","data-testid":"line-manners",style:{display:"grid",gap:1,paddingBottom:6,marginBottom:4,borderBottom:"1px solid var(--graview-edge)"},children:[t?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{style:e,"data-graview-manner":"ribbon",children:[(0,i.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-ink)",strokeOpacity:.35,strokeWidth:6})}),(0,i.jsx)("span",{style:n,children:"A relation between two districts, as wide as the links along it \u2014 point at one for its words"})]}),(0,i.jsxs)("div",{style:e,"data-graview-manner":"record",children:[(0,i.jsxs)("svg",{width:"30",height:"10","aria-hidden":"true",children:[(0,i.jsx)("path",{d:"M 1 5 L 25 5",stroke:"var(--graview-accent)",strokeWidth:1.8,strokeLinecap:"round"}),(0,i.jsx)("circle",{cx:26,cy:5,r:3,fill:"var(--graview-accent)"})]}),(0,i.jsx)("span",{style:n,children:"A chosen record's link to another record, labeled with the relation"})]}),(0,i.jsxs)("div",{style:e,"data-graview-manner":"district",children:[(0,i.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-accent)",strokeWidth:1.8,strokeDasharray:"5 4"})}),(0,i.jsx)("span",{style:n,children:"A chosen record's links into a district, with how many"})]})]}):null,(0,i.jsxs)("div",{style:e,"data-graview-manner":"unsure",children:[(0,i.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-accent)",strokeOpacity:ke,strokeWidth:1.8,strokeDasharray:we,strokeLinecap:"round"})}),(0,i.jsx)("span",{style:n,children:"Unsure: a link its maker was less than sure of, until a person keeps it \u2014 point at its words for what it was based on"})]})]})}var Ie=v(O(),1),re=v(M(),1),Xe=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.QXMTGLHR.js","./chunk.P6J6VFF5.js","./chunk.L6HKDIZB.js","./chunk.U3MQUIJL.js","./chunk.OTHGZPUC.js","./chunk.UT6642FC.js","./chunk.TI4OSTQV.js","./chunk.LFJH6X6O.js","./chunk.VTUMPH4Z.js","./chunk.PCTVLNOS.js","./chunk.4QEDYRES.js","./chunk.JE4QQEJE.js","./chunk.SDO3U72B.js","./chunk.UG727PEE.js","./chunk.AJZBJBMO.js"]),import("./chunk.7Z2GTKA4.js")))),Ze=Xe.part(t=>(0,re.jsx)(t.SuggestedTray,{}),{quiet:!0});function Vt(){let{store:t}=A(),e=H();return(0,Ie.useMemo)(()=>t.log.all().some(o=>o.suggests!==void 0&&!o.withheld),[t,e])?(0,re.jsx)(Ze,{}):null}export{rt as a,lt as b,ft as c,Ht as d,Ke as e,_t as f,Be as g,kt as h,St as i,Ye as j,Dt as k,Ot as l,Vt as m};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}from"./chunk.37NF3YXZ.js";import"./chunk.G4JJXA63.js";import"./chunk.X2M7IOQA.js";import"./chunk.WZEA2UK6.js";import"./chunk.WERBD5ZR.js";import"./chunk.HAY22FPJ.js";import"./chunk.Q5WEOX3Q.js";import"./chunk.IWLVZGW5.js";import"./chunk.X5WIS4BC.js";import"./chunk.PH5ITX3N.js";import"./chunk.WVUJXDXZ.js";import"./chunk.WVN62OMH.js";import"./chunk.BZ4VZ6WQ.js";import"./chunk.XDPIS7RS.js";import"./chunk.57R4ZUMM.js";import"./chunk.J7ZMNAWB.js";import"./chunk.VKJAGZNU.js";import"./chunk.LFJH6X6O.js";import"./chunk.VTUMPH4Z.js";import"./chunk.PCTVLNOS.js";import"./chunk.UG727PEE.js";import"./chunk.AJZBJBMO.js";export{i as draftAnswer,h as draftFromLens,b as draftSight,l as draftView,a as isDraftFailure,c as judgeLens,d as lensEditOf,f as lensFromSpec,j as recipeDraft,g as recipeOfLens,m as refineDraft,o as runDraftTool,e as takeBackEditOf,k as templateDraft,n as withReaderLenses};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as f}from"./chunk.
|
|
1
|
+
import{a as f}from"./chunk.HAY22FPJ.js";import{ca as d}from"./chunk.UG727PEE.js";function w(n){let o=n.indexOf("{"),r=n.indexOf("["),t=r!==-1&&(o===-1||r<o)?r:o;if(t===-1)return;let e=n[t],a=e==="["?"]":"}",i=0,c=!1,l=!1;for(let s=t;s<n.length;s++){let u=n[s];if(c){l?l=!1:u==="\\"?l=!0:u==='"'&&(c=!1);continue}if(u==='"')c=!0;else if(u===e)i+=1;else if(u===a&&(i-=1,i===0))try{return JSON.parse(n.slice(t,s+1))}catch{return}}}function v(n,o){let r;try{r=n.mutation(o.mutation)}catch{return o}let t={...o.args},e=!1;for(let a of f(r.input)){if(a.control!=="node")continue;let i=t[a.name];if(typeof i!="string"||i.length===0||n.graph.getNode(i))continue;let c=i.trim().toLowerCase(),l=[...n.graph.allNodes()].filter(s=>(a.kinds.includes("*")||a.kinds.includes(s.kind))&&d(n.schema.tryDefinition(s.kind),s).trim().toLowerCase()===c);l.length===1&&(t[a.name]=l[0].id,e=!0)}return e?{...o,args:t}:o}function P(n,o,r){let t=r===void 0?null:new Set(r),e=[];for(let a of o){if(typeof a.mutation!="string")continue;let i=!0;try{n.mutation(a.mutation)}catch{i=!1}i?t&&!t.has(a.mutation)&&e.push({proposal:a,why:"not-allowed"}):e.push({proposal:a,why:"unknown"})}return e}function x(n,o,r){let t=r===void 0?null:new Set(r);return o.filter(e=>{if(typeof e.mutation!="string"||t&&!t.has(e.mutation))return!1;try{n.mutation(e.mutation)}catch{return!1}return e.args!==null&&typeof e.args=="object"})}export{w as a,v as b,P as c,x as d};
|
|
@@ -1,4 +1,4 @@
|
|
|
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 ae}from"./chunk.
|
|
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 ae}from"./chunk.LKGDN25E.js";import{a as Y,c as H,d as X,e as J}from"./chunk.3WABA2WQ.js";import"./chunk.4YRCKOX2.js";import"./chunk.QXMTGLHR.js";import"./chunk.P6J6VFF5.js";import"./chunk.L6HKDIZB.js";import"./chunk.QHP7AJUV.js";import"./chunk.U3MQUIJL.js";import"./chunk.OTHGZPUC.js";import"./chunk.UT6642FC.js";import"./chunk.TI4OSTQV.js";import"./chunk.GZHZLJBF.js";import"./chunk.HG2IO5NS.js";import"./chunk.OJGHDWI6.js";import"./chunk.AQTCN7KQ.js";import"./chunk.LFJH6X6O.js";import"./chunk.VTUMPH4Z.js";import"./chunk.PCTVLNOS.js";import"./chunk.4QEDYRES.js";import{Da as K,F as V,G as q,Ha as U,R as x,S as F,_ as b,c as W,ua as z,x as j}from"./chunk.JE4QQEJE.js";import{a as N}from"./chunk.SDO3U72B.js";import{Wa as _,ca as I,ea as G,ha as B,qb as D}from"./chunk.UG727PEE.js";import{b as w}from"./chunk.AJZBJBMO.js";var re=w(q(),1);function P(e){return{minHeight:24,padding:"3px 10px",borderRadius:6,fontSize:"0.875rem",borderWidth:1,borderStyle:"solid",borderColor:e?"transparent":"var(--graview-edge)",color:e?"var(--graview-ink)":"var(--graview-ink-muted)",fontWeight:e?600:400,background:e?"color-mix(in srgb, var(--graview-accent) 16%, transparent)":"transparent"}}var M=w(x(),1);function Q(){let{seats:e,principal:t,takeSeat:i}=b();return e.length<2?null:(0,M.jsxs)("div",{role:"group","aria-label":"Seat","data-testid":"seats",style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:6,rowGap:4},children:[(0,M.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:"As"}),e.map(a=>{let l=ie(t,a.principal);return(0,M.jsx)("button",{type:"button","aria-pressed":l,"data-testid":`seat-${a.principal.id??a.label}`,title:`Sit down as ${a.label}: the acts, the kinds and the pages narrow to what this seat may do`,onClick:()=>i(a.principal),style:{...P(l),whiteSpace:"nowrap"},children:a.label},a.principal.id??a.label)})]})}function ie(e,t){return e.kind===t.kind&&e.id===t.id}var L=w(q(),1),c=w(x(),1),oe=`
|
|
2
2
|
.graview-here{display:flex;flex:none}
|
|
3
3
|
.graview-here>button{display:inline-flex;align-items:center;gap:4px;height:30px;margin:0;padding:0 4px;border:1px solid transparent;border-radius:8px;background:none;box-shadow:none;font:inherit;font-size:.75rem;color:var(--graview-ink-muted);cursor:pointer}
|
|
4
4
|
.graview-here-mark{display:inline-flex;align-items:center;justify-content:center;flex:none;box-sizing:border-box;width:24px;height:24px;border-radius:50%;border:1.5px solid hsl(var(--graview-hue) 50% 48%);background:var(--graview-panel-muted);color:var(--graview-ink);font-size:.75rem;font-weight:600;box-shadow:0 0 0 2px var(--graview-bar)}
|
|
@@ -6,4 +6,4 @@ var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=gl
|
|
|
6
6
|
.graview-here-mark[data-agent]{border-radius:5px}
|
|
7
7
|
.graview-here-mark[data-counted]{--graview-hue:0;border-color:var(--graview-edge)}
|
|
8
8
|
.graview-here small{display:block;font-size:.75rem;color:var(--graview-ink-muted)}
|
|
9
|
-
.graview-bar[data-finding] .graview-here{display:none}`,se={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)"};function le(e,t){let i=t.id===void 0?null:`${t.kind}:${t.id}`,a=new Map;for(let l of e.values()){let d=l.participant.slice(0,l.participant.lastIndexOf(":"));if(d===i)continue;let s=d.endsWith(":")?l.participant:d,o=a.get(s);(!o||o.at<l.at)&&a.set(s,l)}return[...a.values()]}var Z=e=>e.name&&e.onBehalfOfName?`${e.name}, for ${e.onBehalfOfName}`:e.name??"",ee=e=>e===1?"1 viewer":`${e} viewers`;function de(e){let t=e.map(Z).filter(Boolean),i=t.length<e.length?[...t,ee(e.length-t.length)]:t,a=i.pop();return`${i.length>0?`${i.join(", ")} and ${a}`:a} ${e.length===1?"is":"are"} here`}function pe(e,t){let{store:i,hidden:a,pictures:l}=t,d=W(e),s=i.kindsKeptFrom(t.principal),o=u=>!a.has(u)&&!s.has(u)&&!i.modules.disabledKinds.has(u),g=l.find(u=>u.as===d.within?.view&&o(u.kind));if(g)return g.title;if(!d.focusId)return d.overview?"the whole thing":null;let p=j(d.focusId);if(p.length>0)return p.every(o)?p.map(u=>B(i.schema,u)).join(" and "):null;let h=i.graph.getNode(d.focusId);return h&&o(h.kind)?I(i.schema.tryDefinition(h.kind),h):null}function ce(e,t){let i=o=>o.id!==void 0&&(o.id===t.principal.id||o.onBehalfOf?.id===t.principal.id),a=e.filter(o=>!D(o)&&o.author.kind!=="system"&&!i(o.author)),l=a[0];if(!l)return null;let d=_(l.author,{graph:t.store.graph,schema:t.store.schema,...t.seats?{seats:t.seats}:{},...t.people?{people:t.people}:{}}),s=[...new Set(a.map(o=>o.intent))].join("; ");return`${d}: ${s}`}function ue(e,t,i){let a=ce(e,t);a&&(i(""),setTimeout(()=>i(a),50))}function ge({scene:e,compact:t}){let{who:i,principal:a,store:l,views:d,hiddenKinds:s,follow:o}=b(),g=U("here"),p=le(i,a),h=p.length===0?"":de(p),[u,S]=(0,L.useState)("");if((0,L.useEffect)(()=>S(h),[h]),p.length===0)return null;let f=p.filter(r=>r.name),y=f.slice(0,t?2:3),m=p.length-y.length,k=p.length-f.length,T=d.places();return(0,c.jsxs)("div",{className:"graview-here","data-testid":"here",children:[(0,c.jsx)("style",{children:oe}),(0,c.jsx)("span",{role:"status","aria-live":"polite",style:se,children:u}),(0,c.jsxs)("button",{type:"button","data-testid":"here-open",...g.trigger,onClick:g.toggle,"aria-label":`${h} \u2014 who and where`,title:h,children:[y.length>0?(0,c.jsx)("span",{style:{display:"flex"},children:y.map(r=>(0,c.jsx)(E,{one:r},r.participant))}):(0,c.jsx)(E,{count:m}),y.length>0&&m>0?(0,c.jsxs)("span",{"aria-hidden":"true",children:["+",m]}):null]}),(0,c.jsxs)("ul",{...g.pane,"aria-label":"Who is here","data-testid":"here-list",hidden:!g.open,className:"graview-bar-list",style:K,children:[f.map(r=>{let v=pe(r.stop,{store:l,principal:a,hidden:s,pictures:T}),A=Z(r);return(0,c.jsx)("li",{children:(0,c.jsxs)(e?"button":"span",{className:"graview-bar-item","data-testid":"here-one",...e?{type:"button",title:`Go where ${A} is`,onClick:()=>{g.setOpen(!1),o(r.participant)}}:{style:{cursor:"default"}},children:[(0,c.jsx)(E,{one:r}),(0,c.jsxs)("span",{children:[A,v?(0,c.jsxs)("small",{children:["On ",v]}):null]})]})},r.participant)}),k>0?(0,c.jsx)("li",{children:(0,c.jsxs)("span",{className:"graview-bar-item","data-testid":"here-viewers",style:{cursor:"default"},children:[(0,c.jsx)(E,{count:k}),(0,c.jsxs)("span",{children:[ee(k),(0,c.jsx)("small",{children:"Not signed in"})]})]})}):null]})]})}function E({one:e,count:t}){return(0,c.jsx)("span",{className:"graview-here-mark","aria-hidden":"true",...e?{style:{"--graview-hue":Math.round(e.hue)}}:{"data-counted":""},...e?.kind==="agent"?{"data-agent":""}:{},children:e?(e.name??"").trim().charAt(0).toUpperCase():t})}function he(e){let t=/^(?:place|scene):([^:]+):(.+)$/.exec(e.key);return t?{place:t[2],about:[`aggregate:${t[1]}`],title:e.label}:{about:e.group==="lists"&&e.kind?[`aggregate:${e.kind}`]:[],title:e.label}}function O(e,t,i,a,l,d){let s=he(t),o=e.getBoundingClientRect(),g={...s,face:i?"scene":"pages",x:Math.round(l??o.left+Math.min(16,o.width/2)),y:Math.round(d??Math.min(o.bottom,o.top+36)),returnTo:e},p=i?null:e.closest("[data-graview-embed], [data-graview-shell]")?.querySelector("[data-graview-face='pages']")??document.querySelector("[data-graview-face='pages']");p?p.dispatchEvent(new CustomEvent(F,{detail:g})):a(g)}var R={on:null,at:0},te=500,me=10;function ye(e,t,i,a,l,d,s){let o=t.getAttribute("data-testid")??"",g=o==="app-places-open"?a:o.slice(10),p=i.find(m=>m.key===g);if(!p)return;if(e.type==="keydown")return R={on:t,at:Date.now()},O(t,p,l,d);let{clientX:h,clientY:u}=e;if(e.type==="contextmenu")return R.on===t&&Date.now()-R.at<700?void 0:h===0&&u===0?O(t,p,l,d):O(t,p,l,d,h,u);let S=Date.now()-Math.max(0,performance.now()-e.timeStamp),f=!1,y=m=>{Math.hypot(m.clientX-h,m.clientY-u)>me&&(f=!0)};document.addEventListener("pointermove",y),setTimeout(()=>{document.removeEventListener("pointermove",y),!(f||s.at!==0&&s.at-S<te)&&(R={on:t,at:Date.now()},t.addEventListener("click",m=>{m.preventDefault(),m.stopPropagation()},{capture:!0,once:!0}),O(t,p,l,d,h,u))},Math.max(0,te-(Date.now()-S)))}var n=w(x(),1),Ie=z(N(()=>(__graviewPreload(import.meta.url,["./chunk.JHEVGLKB.js","./chunk.FOQZADMA.js","./chunk.SDO3U72B.js","./chunk.V5MYKNL7.js","./chunk.AJZBJBMO.js"]),import("./chunk.33KXSD6F.js")))).part((e,t)=>(0,n.jsx)(e.TidyGroups,{...t}),{quiet:!0}),fe=z(N(()=>(__graviewPreload(import.meta.url,["./chunk.FOQZADMA.js","./chunk.SDO3U72B.js","./chunk.V5MYKNL7.js","./chunk.AJZBJBMO.js"]),import("./chunk.HEVC6HHP.js")))).part((e,t)=>(0,n.jsx)(e.HoverChipsSwitch,{...t}),{quiet:!0});function Be({violations:e,pick:t}){let{store:i,brand:a,setMenuAt:l}=b(),d=Y(i,e);return(0,n.jsx)(n.Fragment,{children:d.map((s,o)=>{let g=J(s),p=s.repairs.length>0?`${s.repairs.length} ${s.repairs.length===1?"way":"ways"} to fix`:"";return(0,n.jsx)("li",{style:{borderTop:o===0?"none":"1px solid var(--graview-edge)"},children:(0,n.jsxs)("button",{type:"button",onClick:h=>{let u=h.currentTarget.closest("ol").getBoundingClientRect();t(s),l({x:u.left,y:u.top,on:s.subjectId})},...H(s)!==void 0?{title:H(s)}:{},style:{width:"100%",textAlign:"left",fontSize:"0.8125rem",lineHeight:1.4,padding:"7px 8px",border:"1px solid transparent",background:"none",boxShadow:"none",borderRadius:7},children:[s.line?(0,n.jsx)(X,{line:s.line,schema:i.schema,...a?{brand:a}:{},stacked:!0,style:{display:"block",color:"var(--graview-ink)"}}):(0,n.jsx)("span",{style:{display:"block",color:"var(--graview-ink)"},children:s.message}),g||p?(0,n.jsx)("span",{style:{color:"var(--graview-ink-faint)",fontSize:"0.75rem"},children:[g,p].filter(Boolean).join(" \xB7 ")}):null]})},`${s.invariant}:${o}`)})})}function _e({name:e,me:t,scheme:i,onScheme:a,profileHref:l,hostActions:d,close:s,part:o,signature:g=!1}){let{principal:p,seats:h,settings:u,settingValues:S,chooseSetting:f,sharing:y,ai:m}=b(),k=p.roles??[],T={setOpen:r=>s()};return(0,n.jsx)(n.Fragment,{children:o==="top"?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{style:{display:"grid",gap:3},children:[(0,n.jsx)("span",{style:$,children:"Signed in as"}),(0,n.jsx)("strong",{style:{fontSize:"1rem",fontWeight:550},children:e}),(0,n.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:k.length>0?k.map(r=>G(r)).join(", "):t===void 0?"This app has no sign-in; everything here is yours.":"No role in particular"}),t!==void 0&&l!==void 0?(0,n.jsx)("a",{href:l(t.id),"data-testid":"profile-record",style:{display:"inline-flex",alignItems:"center",minHeight:24,justifySelf:"start",fontSize:"0.875rem",color:"var(--graview-accent)"},children:"Your record \u2197"}):null,y?(0,n.jsxs)("span",{"data-testid":"profile-seen-as",style:{fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:["Seen by others as ",y.name]}):null]}),d.length>0?(0,n.jsx)("ul",{role:"list","aria-label":"From the host","data-testid":"host-actions",style:{...C,margin:0,paddingLeft:0,listStyle:"none",display:"grid",gap:2},children:d.map(r=>(0,n.jsx)("li",{children:r.href!==void 0?(0,n.jsx)("a",{href:r.href,"data-testid":"host-action",className:"graview-host-action",...r.target?{target:r.target,rel:"noopener"}:{},onClick:()=>{r.onSelect?.(),T.setOpen(!1)},style:ne,children:r.label}):(0,n.jsx)("button",{type:"button","data-testid":"host-action",className:"graview-host-action",onClick:()=>{T.setOpen(!1),r.onSelect?.()},style:{...ne,width:"100%",textAlign:"left",border:"none",background:"none",boxShadow:"none",font:"inherit",cursor:"pointer"},children:r.label})},r.label))}):null]}):(0,n.jsxs)(n.Fragment,{children:[h.length>1?(0,n.jsxs)("div",{style:{display:"grid",gap:6,...C},children:[(0,n.jsx)("span",{style:$,children:"Sit as somebody else"}),(0,n.jsx)(Q,{})]}):null,u.length>0?(0,n.jsx)("div",{style:{display:"grid",gap:10,...C},children:u.map(r=>(0,n.jsxs)("fieldset",{"data-testid":`setting-${r.name}`,style:{border:0,margin:0,padding:0,display:"grid",gap:5},children:[(0,n.jsx)("legend",{style:{...$,padding:0},children:r.title}),r.description?(0,n.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:r.description}):null,(0,n.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:r.options.map(v=>{let A=(S[r.name]??r.initial)===v.value;return(0,n.jsx)("button",{type:"button","aria-pressed":A,"data-testid":`setting-${r.name}-${v.value}`,onClick:()=>f(r.name,v.value),style:P(A),children:v.label},v.value)})})]},r.name))}):null,V(m)?(0,n.jsx)(re.Suspense,{fallback:null,children:(0,n.jsx)(fe,{legend:$,style:C,choice:P})}):null,i!==void 0&&a!==void 0?(0,n.jsxs)("div",{style:{display:"grid",gap:5,...C},children:[(0,n.jsx)("span",{style:$,children:"Scheme"}),(0,n.jsx)("div",{style:{display:"flex",gap:4},children:["light","dark"].map(r=>(0,n.jsx)("button",{type:"button","aria-pressed":i===r,"data-testid":`profile-scheme-${r}`,onClick:()=>a(r),style:P(i===r),children:r==="light"?"\u2600 Light":"\u263E Dark"},r))})]}):null,g?(0,n.jsxs)("p",{"data-testid":"graview-signature",style:{...C,margin:0,display:"flex",alignItems:"center",gap:6,fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:["Built with",(0,n.jsxs)("a",{href:"https://graview.dev",target:"_blank",rel:"noopener",style:{display:"inline-flex",alignItems:"center",gap:4,minHeight:24,color:"var(--graview-ink-muted)",fontWeight:600,textDecoration:"none"},children:[(0,n.jsx)("span",{"data-testid":"graview-mark",style:{display:"inline-flex",lineHeight:0},dangerouslySetInnerHTML:{__html:ve}}),"Graview"]})]}):null]})})}var ve='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="14" height="14" aria-hidden="true" focusable="false"><g fill="none" stroke="currentColor" stroke-width="2.4" stroke-linejoin="round"><path d="M13 11 L3 8 L14 3 H29 L21 9"/><path d="M10 18 L3 23 L16.5 28 L29 21 L22 19"/><path d="M16.5 18.5 V23.5" stroke-linecap="round"/></g><circle cx="16.5" cy="13.5" r="2" fill="var(--graview-mark-point, currentColor)"/></svg>',ne={display:"flex",alignItems:"center",minHeight:28,padding:"2px 8px",borderRadius:7,fontSize:"0.875rem",color:"var(--graview-ink)",textDecoration:"none"},$={fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},C={paddingTop:10,borderTop:"1px solid var(--graview-edge)"};export{ae as ActivityRail,ge as Here,Be as ProblemRows,_e as ProfilePane,Ie as TidyFoot,ye as placeGesture,ue as sayTheirChange};
|
|
9
|
+
.graview-bar[data-finding] .graview-here{display:none}`,se={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)"};function le(e,t){let i=t.id===void 0?null:`${t.kind}:${t.id}`,a=new Map;for(let l of e.values()){let d=l.participant.slice(0,l.participant.lastIndexOf(":"));if(d===i)continue;let s=d.endsWith(":")?l.participant:d,o=a.get(s);(!o||o.at<l.at)&&a.set(s,l)}return[...a.values()]}var Z=e=>e.name&&e.onBehalfOfName?`${e.name}, for ${e.onBehalfOfName}`:e.name??"",ee=e=>e===1?"1 viewer":`${e} viewers`;function de(e){let t=e.map(Z).filter(Boolean),i=t.length<e.length?[...t,ee(e.length-t.length)]:t,a=i.pop();return`${i.length>0?`${i.join(", ")} and ${a}`:a} ${e.length===1?"is":"are"} here`}function pe(e,t){let{store:i,hidden:a,pictures:l}=t,d=W(e),s=i.kindsKeptFrom(t.principal),o=u=>!a.has(u)&&!s.has(u)&&!i.modules.disabledKinds.has(u),g=l.find(u=>u.as===d.within?.view&&o(u.kind));if(g)return g.title;if(!d.focusId)return d.overview?"the whole thing":null;let p=j(d.focusId);if(p.length>0)return p.every(o)?p.map(u=>B(i.schema,u)).join(" and "):null;let h=i.graph.getNode(d.focusId);return h&&o(h.kind)?I(i.schema.tryDefinition(h.kind),h):null}function ce(e,t){let i=o=>o.id!==void 0&&(o.id===t.principal.id||o.onBehalfOf?.id===t.principal.id),a=e.filter(o=>!D(o)&&o.author.kind!=="system"&&!i(o.author)),l=a[0];if(!l)return null;let d=_(l.author,{graph:t.store.graph,schema:t.store.schema,...t.seats?{seats:t.seats}:{},...t.people?{people:t.people}:{}}),s=[...new Set(a.map(o=>o.intent))].join("; ");return`${d}: ${s}`}function ue(e,t,i){let a=ce(e,t);a&&(i(""),setTimeout(()=>i(a),50))}function ge({scene:e,compact:t}){let{who:i,principal:a,store:l,views:d,hiddenKinds:s,follow:o}=b(),g=U("here"),p=le(i,a),h=p.length===0?"":de(p),[u,S]=(0,L.useState)("");if((0,L.useEffect)(()=>S(h),[h]),p.length===0)return null;let f=p.filter(r=>r.name),y=f.slice(0,t?2:3),m=p.length-y.length,k=p.length-f.length,T=d.places();return(0,c.jsxs)("div",{className:"graview-here","data-testid":"here",children:[(0,c.jsx)("style",{children:oe}),(0,c.jsx)("span",{role:"status","aria-live":"polite",style:se,children:u}),(0,c.jsxs)("button",{type:"button","data-testid":"here-open",...g.trigger,onClick:g.toggle,"aria-label":`${h} \u2014 who and where`,title:h,children:[y.length>0?(0,c.jsx)("span",{style:{display:"flex"},children:y.map(r=>(0,c.jsx)(E,{one:r},r.participant))}):(0,c.jsx)(E,{count:m}),y.length>0&&m>0?(0,c.jsxs)("span",{"aria-hidden":"true",children:["+",m]}):null]}),(0,c.jsxs)("ul",{...g.pane,"aria-label":"Who is here","data-testid":"here-list",hidden:!g.open,className:"graview-bar-list",style:K,children:[f.map(r=>{let v=pe(r.stop,{store:l,principal:a,hidden:s,pictures:T}),A=Z(r);return(0,c.jsx)("li",{children:(0,c.jsxs)(e?"button":"span",{className:"graview-bar-item","data-testid":"here-one",...e?{type:"button",title:`Go where ${A} is`,onClick:()=>{g.setOpen(!1),o(r.participant)}}:{style:{cursor:"default"}},children:[(0,c.jsx)(E,{one:r}),(0,c.jsxs)("span",{children:[A,v?(0,c.jsxs)("small",{children:["On ",v]}):null]})]})},r.participant)}),k>0?(0,c.jsx)("li",{children:(0,c.jsxs)("span",{className:"graview-bar-item","data-testid":"here-viewers",style:{cursor:"default"},children:[(0,c.jsx)(E,{count:k}),(0,c.jsxs)("span",{children:[ee(k),(0,c.jsx)("small",{children:"Not signed in"})]})]})}):null]})]})}function E({one:e,count:t}){return(0,c.jsx)("span",{className:"graview-here-mark","aria-hidden":"true",...e?{style:{"--graview-hue":Math.round(e.hue)}}:{"data-counted":""},...e?.kind==="agent"?{"data-agent":""}:{},children:e?(e.name??"").trim().charAt(0).toUpperCase():t})}function he(e){let t=/^(?:place|scene):([^:]+):(.+)$/.exec(e.key);return t?{place:t[2],about:[`aggregate:${t[1]}`],title:e.label}:{about:e.group==="lists"&&e.kind?[`aggregate:${e.kind}`]:[],title:e.label}}function O(e,t,i,a,l,d){let s=he(t),o=e.getBoundingClientRect(),g={...s,face:i?"scene":"pages",x:Math.round(l??o.left+Math.min(16,o.width/2)),y:Math.round(d??Math.min(o.bottom,o.top+36)),returnTo:e},p=i?null:e.closest("[data-graview-embed], [data-graview-shell]")?.querySelector("[data-graview-face='pages']")??document.querySelector("[data-graview-face='pages']");p?p.dispatchEvent(new CustomEvent(F,{detail:g})):a(g)}var R={on:null,at:0},te=500,me=10;function ye(e,t,i,a,l,d,s){let o=t.getAttribute("data-testid")??"",g=o==="app-places-open"?a:o.slice(10),p=i.find(m=>m.key===g);if(!p)return;if(e.type==="keydown")return R={on:t,at:Date.now()},O(t,p,l,d);let{clientX:h,clientY:u}=e;if(e.type==="contextmenu")return R.on===t&&Date.now()-R.at<700?void 0:h===0&&u===0?O(t,p,l,d):O(t,p,l,d,h,u);let S=Date.now()-Math.max(0,performance.now()-e.timeStamp),f=!1,y=m=>{Math.hypot(m.clientX-h,m.clientY-u)>me&&(f=!0)};document.addEventListener("pointermove",y),setTimeout(()=>{document.removeEventListener("pointermove",y),!(f||s.at!==0&&s.at-S<te)&&(R={on:t,at:Date.now()},t.addEventListener("click",m=>{m.preventDefault(),m.stopPropagation()},{capture:!0,once:!0}),O(t,p,l,d,h,u))},Math.max(0,te-(Date.now()-S)))}var n=w(x(),1),Ie=z(N(()=>(__graviewPreload(import.meta.url,["./chunk.4QEDYRES.js","./chunk.JE4QQEJE.js","./chunk.SDO3U72B.js","./chunk.UG727PEE.js","./chunk.AJZBJBMO.js"]),import("./chunk.LZH65VSN.js")))).part((e,t)=>(0,n.jsx)(e.TidyGroups,{...t}),{quiet:!0}),fe=z(N(()=>(__graviewPreload(import.meta.url,["./chunk.JE4QQEJE.js","./chunk.SDO3U72B.js","./chunk.UG727PEE.js","./chunk.AJZBJBMO.js"]),import("./chunk.LMUFLZYT.js")))).part((e,t)=>(0,n.jsx)(e.HoverChipsSwitch,{...t}),{quiet:!0});function Be({violations:e,pick:t}){let{store:i,brand:a,setMenuAt:l}=b(),d=Y(i,e);return(0,n.jsx)(n.Fragment,{children:d.map((s,o)=>{let g=J(s),p=s.repairs.length>0?`${s.repairs.length} ${s.repairs.length===1?"way":"ways"} to fix`:"";return(0,n.jsx)("li",{style:{borderTop:o===0?"none":"1px solid var(--graview-edge)"},children:(0,n.jsxs)("button",{type:"button",onClick:h=>{let u=h.currentTarget.closest("ol").getBoundingClientRect();t(s),l({x:u.left,y:u.top,on:s.subjectId})},...H(s)!==void 0?{title:H(s)}:{},style:{width:"100%",textAlign:"left",fontSize:"0.8125rem",lineHeight:1.4,padding:"7px 8px",border:"1px solid transparent",background:"none",boxShadow:"none",borderRadius:7},children:[s.line?(0,n.jsx)(X,{line:s.line,schema:i.schema,...a?{brand:a}:{},stacked:!0,style:{display:"block",color:"var(--graview-ink)"}}):(0,n.jsx)("span",{style:{display:"block",color:"var(--graview-ink)"},children:s.message}),g||p?(0,n.jsx)("span",{style:{color:"var(--graview-ink-faint)",fontSize:"0.75rem"},children:[g,p].filter(Boolean).join(" \xB7 ")}):null]})},`${s.invariant}:${o}`)})})}function _e({name:e,me:t,scheme:i,onScheme:a,profileHref:l,hostActions:d,close:s,part:o,signature:g=!1}){let{principal:p,seats:h,settings:u,settingValues:S,chooseSetting:f,sharing:y,ai:m}=b(),k=p.roles??[],T={setOpen:r=>s()};return(0,n.jsx)(n.Fragment,{children:o==="top"?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{style:{display:"grid",gap:3},children:[(0,n.jsx)("span",{style:$,children:"Signed in as"}),(0,n.jsx)("strong",{style:{fontSize:"1rem",fontWeight:550},children:e}),(0,n.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:k.length>0?k.map(r=>G(r)).join(", "):t===void 0?"This app has no sign-in; everything here is yours.":"No role in particular"}),t!==void 0&&l!==void 0?(0,n.jsx)("a",{href:l(t.id),"data-testid":"profile-record",style:{display:"inline-flex",alignItems:"center",minHeight:24,justifySelf:"start",fontSize:"0.875rem",color:"var(--graview-accent)"},children:"Your record \u2197"}):null,y?(0,n.jsxs)("span",{"data-testid":"profile-seen-as",style:{fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:["Seen by others as ",y.name]}):null]}),d.length>0?(0,n.jsx)("ul",{role:"list","aria-label":"From the host","data-testid":"host-actions",style:{...C,margin:0,paddingLeft:0,listStyle:"none",display:"grid",gap:2},children:d.map(r=>(0,n.jsx)("li",{children:r.href!==void 0?(0,n.jsx)("a",{href:r.href,"data-testid":"host-action",className:"graview-host-action",...r.target?{target:r.target,rel:"noopener"}:{},onClick:()=>{r.onSelect?.(),T.setOpen(!1)},style:ne,children:r.label}):(0,n.jsx)("button",{type:"button","data-testid":"host-action",className:"graview-host-action",onClick:()=>{T.setOpen(!1),r.onSelect?.()},style:{...ne,width:"100%",textAlign:"left",border:"none",background:"none",boxShadow:"none",font:"inherit",cursor:"pointer"},children:r.label})},r.label))}):null]}):(0,n.jsxs)(n.Fragment,{children:[h.length>1?(0,n.jsxs)("div",{style:{display:"grid",gap:6,...C},children:[(0,n.jsx)("span",{style:$,children:"Sit as somebody else"}),(0,n.jsx)(Q,{})]}):null,u.length>0?(0,n.jsx)("div",{style:{display:"grid",gap:10,...C},children:u.map(r=>(0,n.jsxs)("fieldset",{"data-testid":`setting-${r.name}`,style:{border:0,margin:0,padding:0,display:"grid",gap:5},children:[(0,n.jsx)("legend",{style:{...$,padding:0},children:r.title}),r.description?(0,n.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:r.description}):null,(0,n.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:r.options.map(v=>{let A=(S[r.name]??r.initial)===v.value;return(0,n.jsx)("button",{type:"button","aria-pressed":A,"data-testid":`setting-${r.name}-${v.value}`,onClick:()=>f(r.name,v.value),style:P(A),children:v.label},v.value)})})]},r.name))}):null,V(m)?(0,n.jsx)(re.Suspense,{fallback:null,children:(0,n.jsx)(fe,{legend:$,style:C,choice:P})}):null,i!==void 0&&a!==void 0?(0,n.jsxs)("div",{style:{display:"grid",gap:5,...C},children:[(0,n.jsx)("span",{style:$,children:"Scheme"}),(0,n.jsx)("div",{style:{display:"flex",gap:4},children:["light","dark"].map(r=>(0,n.jsx)("button",{type:"button","aria-pressed":i===r,"data-testid":`profile-scheme-${r}`,onClick:()=>a(r),style:P(i===r),children:r==="light"?"\u2600 Light":"\u263E Dark"},r))})]}):null,g?(0,n.jsxs)("p",{"data-testid":"graview-signature",style:{...C,margin:0,display:"flex",alignItems:"center",gap:6,fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:["Built with",(0,n.jsxs)("a",{href:"https://graview.dev",target:"_blank",rel:"noopener",style:{display:"inline-flex",alignItems:"center",gap:4,minHeight:24,color:"var(--graview-ink-muted)",fontWeight:600,textDecoration:"none"},children:[(0,n.jsx)("span",{"data-testid":"graview-mark",style:{display:"inline-flex",lineHeight:0},dangerouslySetInnerHTML:{__html:ve}}),"Graview"]})]}):null]})})}var ve='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="14" height="14" aria-hidden="true" focusable="false"><g fill="none" stroke="currentColor" stroke-width="2.4" stroke-linejoin="round"><path d="M13 11 L3 8 L14 3 H29 L21 9"/><path d="M10 18 L3 23 L16.5 28 L29 21 L22 19"/><path d="M16.5 18.5 V23.5" stroke-linecap="round"/></g><circle cx="16.5" cy="13.5" r="2" fill="var(--graview-mark-point, currentColor)"/></svg>',ne={display:"flex",alignItems:"center",minHeight:28,padding:"2px 8px",borderRadius:7,fontSize:"0.875rem",color:"var(--graview-ink)",textDecoration:"none"},$={fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},C={paddingTop:10,borderTop:"1px solid var(--graview-edge)"};export{ae as ActivityRail,ge as Here,Be as ProblemRows,_e as ProfilePane,Ie as TidyFoot,ye as placeGesture,ue as sayTheirChange};
|