graview 0.1.47 → 0.1.49
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/index.d.ts +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/preview/{chunk.S5IQFZ5Z.js → chunk.2CO2EJQA.js} +1 -1
- package/dist/preview/{chunk.VAFSSSSI.js → chunk.2N6RQ427.js} +1 -1
- package/dist/preview/{chunk.C44MC5X3.js → chunk.2OLZ6BYI.js} +1 -1
- package/dist/preview/{chunk.GCKZ2YRJ.js → chunk.2OXXGN7C.js} +2 -2
- package/dist/preview/{chunk.Z6TMIAAB.js → chunk.2QKSWK4U.js} +1 -1
- package/dist/preview/chunk.35FUGOSG.js +1 -0
- package/dist/preview/{chunk.IKX4VDTW.js → chunk.3EW6L5DY.js} +1 -1
- package/dist/preview/chunk.3NEALGMI.js +1 -0
- package/dist/preview/{chunk.O4WEJ47H.js → chunk.423SZS7C.js} +3 -3
- package/dist/preview/{chunk.MBETS27C.js → chunk.4D26JY5U.js} +1 -1
- package/dist/preview/{chunk.5A4AOFOA.js → chunk.4HUB3N7I.js} +1 -1
- package/dist/preview/chunk.4K7I7WYF.js +1 -0
- package/dist/preview/{chunk.RUPRZDN3.js → chunk.4OTESF7W.js} +1 -1
- package/dist/preview/{chunk.TJEV5ZAM.js → chunk.4Q5KWYVY.js} +18 -18
- package/dist/preview/{chunk.VXVWUIGO.js → chunk.4QINLTDZ.js} +1 -1
- package/dist/preview/{chunk.EUPSAYEI.js → chunk.4SEY7VWZ.js} +1 -1
- package/dist/preview/chunk.4XKACWLT.js +1 -0
- package/dist/preview/chunk.52QB4YW2.js +1 -0
- package/dist/preview/{chunk.6YD2DLIC.js → chunk.54PZWX23.js} +1 -1
- package/dist/preview/chunk.5YFO6D7J.js +1 -0
- package/dist/preview/chunk.6EGHJCEM.js +1 -0
- package/dist/preview/{chunk.O2WWYZI7.js → chunk.6EHE26ZS.js} +1 -1
- package/dist/preview/{chunk.RG6WNOBW.js → chunk.6RLFO5GA.js} +1 -1
- package/dist/preview/chunk.6WRA3Y7D.js +1 -0
- package/dist/preview/{chunk.IQ2HKGJS.js → chunk.7C4IR4S7.js} +1 -1
- package/dist/preview/{chunk.4YXJPKXD.js → chunk.7JLYEZW4.js} +1 -1
- package/dist/preview/{chunk.VSNHCGKC.js → chunk.7JW5SHRR.js} +1 -1
- package/dist/preview/{chunk.76GF5US2.js → chunk.7MJGZHTS.js} +1 -1
- package/dist/preview/{chunk.F67F6QZ6.js → chunk.7MWLDDFL.js} +1 -1
- package/dist/preview/{chunk.QZEZHCOI.js → chunk.7SGQ3HFG.js} +1 -1
- package/dist/preview/chunk.A7HMVWMG.js +1 -0
- package/dist/preview/{chunk.PKUDIWIF.js → chunk.AGVFW6WC.js} +1 -1
- package/dist/preview/{chunk.FOQ27RAR.js → chunk.AOEXSQDG.js} +1 -1
- package/dist/preview/{chunk.IROYMLER.js → chunk.AP22NNIM.js} +1 -1
- package/dist/preview/{chunk.RNEJYIQ7.js → chunk.AVDXG57A.js} +1 -1
- package/dist/preview/{chunk.N7JT6MG2.js → chunk.B2BLZDBD.js} +1 -1
- package/dist/preview/chunk.B445DZOY.js +1 -0
- package/dist/preview/chunk.BH365UJ5.js +1 -0
- package/dist/preview/{chunk.IPAZOKMQ.js → chunk.BJR6E2CT.js} +1 -1
- package/dist/preview/{chunk.KSM6NVAT.js → chunk.BNU3KXKL.js} +1 -1
- package/dist/preview/chunk.BTORFVKO.js +1 -0
- package/dist/preview/{chunk.OONCUAOH.js → chunk.BU6V76EF.js} +1 -1
- package/dist/preview/{chunk.F2VMMCVK.js → chunk.BVXOLZQ3.js} +1 -1
- package/dist/preview/{chunk.CTQULC5F.js → chunk.C75I24Z5.js} +1 -1
- package/dist/preview/{chunk.WHEUTAXA.js → chunk.CXIIRL67.js} +1 -1
- package/dist/preview/{chunk.4YS7547F.js → chunk.D25QV6DK.js} +1 -1
- package/dist/preview/chunk.D4IKO5YA.js +18 -0
- package/dist/preview/{chunk.Q7RQC3F7.js → chunk.D4K23FUB.js} +1 -1
- package/dist/preview/{chunk.R6V37SR7.js → chunk.D53IGR45.js} +1 -1
- package/dist/preview/chunk.D66RI4QS.js +1 -0
- package/dist/preview/{chunk.BNPQUI3F.js → chunk.DFGXNFFE.js} +1 -1
- package/dist/preview/{chunk.RVJXO5GG.js → chunk.DSNHE4MZ.js} +1 -1
- package/dist/preview/{chunk.UHX4WTM7.js → chunk.DTRNDSMS.js} +1 -1
- package/dist/preview/{chunk.QGG6ZRJ5.js → chunk.DV4GSLGX.js} +2 -2
- package/dist/preview/{chunk.H7KCWCB4.js → chunk.EJAVIZ7Y.js} +1 -1
- package/dist/preview/{chunk.MF73YBJL.js → chunk.EM5CGFNB.js} +1 -1
- package/dist/preview/chunk.EPTUOPPC.js +1 -0
- package/dist/preview/{chunk.L4YNDNX7.js → chunk.ERWBI2NK.js} +1 -1
- package/dist/preview/chunk.EYSQPXVE.js +2 -0
- package/dist/preview/{chunk.47RTA6M3.js → chunk.FIS27KW4.js} +1 -1
- package/dist/preview/chunk.FNK2ZZ5E.js +1 -0
- package/dist/preview/{chunk.5AGW4NRZ.js → chunk.FOYVTN5B.js} +1 -1
- package/dist/preview/{chunk.7ELB37JU.js → chunk.FUMQLGNM.js} +1 -1
- package/dist/preview/chunk.G25JEYCC.js +1 -0
- package/dist/preview/{chunk.IXOQQBJE.js → chunk.G3Q5CYEM.js} +1 -1
- package/dist/preview/chunk.GEY4MA4D.js +6 -0
- package/dist/preview/chunk.GRLPNTUW.js +2 -0
- package/dist/preview/{chunk.2MCZ4CU5.js → chunk.H42WBU5C.js} +1 -1
- package/dist/preview/{chunk.WJS6P7GI.js → chunk.IQHVVQEA.js} +1 -1
- package/dist/preview/{chunk.TCXKPILZ.js → chunk.IVHPJUFM.js} +1 -1
- package/dist/preview/{chunk.FOJDVK2Q.js → chunk.IWEPDTVG.js} +1 -1
- package/dist/preview/{chunk.P4KCZRIG.js → chunk.IYLOA3MV.js} +1 -1
- package/dist/preview/chunk.JBG5UQLM.js +1 -0
- package/dist/preview/{chunk.NFIGGSMJ.js → chunk.KDTNKKOY.js} +1 -1
- package/dist/preview/chunk.KJBXNMIU.js +21 -0
- package/dist/preview/chunk.KLAEKRCA.js +1 -0
- package/dist/preview/{chunk.Z4UM4CMT.js → chunk.KQSD5MLY.js} +1 -1
- package/dist/preview/{chunk.ETR6AV47.js → chunk.KVEDMKUN.js} +1 -1
- package/dist/preview/{chunk.TBQOSI4J.js → chunk.LD6S2FL5.js} +1 -1
- package/dist/preview/{chunk.63JLXGYX.js → chunk.LUL6PFIQ.js} +1 -1
- package/dist/preview/chunk.MCFLCC42.js +12 -0
- package/dist/preview/{chunk.SWWAEOZ7.js → chunk.MJ4XTNTL.js} +1 -1
- package/dist/preview/{chunk.RZF3QM4E.js → chunk.MU5WUTVF.js} +1 -1
- package/dist/preview/{chunk.ZCYGUP3I.js → chunk.MUHFZXPS.js} +1 -1
- package/dist/preview/{chunk.AGIO2GRV.js → chunk.N2S3TMBC.js} +1 -1
- package/dist/preview/{chunk.63MS2LOP.js → chunk.N2S45SSL.js} +1 -1
- package/dist/preview/{chunk.KSXB4LDF.js → chunk.NB6WN4DO.js} +1 -1
- package/dist/preview/{chunk.5M4TMZXC.js → chunk.NBJ4C33P.js} +1 -1
- package/dist/preview/{chunk.WBHM5I3I.js → chunk.NQ7SRWXA.js} +1 -1
- package/dist/preview/chunk.NQDGUIUQ.js +1 -0
- package/dist/preview/{chunk.KRGM25HF.js → chunk.NUUT37ER.js} +1 -1
- package/dist/preview/{chunk.SZR3Z43B.js → chunk.O3ONLQUF.js} +1 -1
- package/dist/preview/chunk.OFBESPHJ.js +1 -0
- package/dist/preview/chunk.OKHEZJBX.js +1 -0
- package/dist/preview/{chunk.2W22AWSL.js → chunk.OL5D7YTW.js} +1 -1
- package/dist/preview/{chunk.SD6N4DGF.js → chunk.ON35FJ5H.js} +1 -1
- package/dist/preview/{chunk.3LDYUO77.js → chunk.OS75HEZP.js} +1 -1
- package/dist/preview/{chunk.DQS7D2W2.js → chunk.OTF3NNTI.js} +1 -1
- package/dist/preview/chunk.P2AC6JRL.js +88 -0
- package/dist/preview/chunk.PBCT33FF.js +1 -0
- package/dist/preview/{chunk.NEEOVRB7.js → chunk.PCVU3LY3.js} +1 -1
- package/dist/preview/chunk.PFEKS3KO.js +5 -0
- package/dist/preview/chunk.PFR3FQBR.js +1 -0
- package/dist/preview/{chunk.VC3UGFHY.js → chunk.Q4KNNJFL.js} +1 -1
- package/dist/preview/chunk.QBHVBL42.js +1 -0
- package/dist/preview/chunk.QPNFWP4Z.js +1 -0
- package/dist/preview/{chunk.24OZGU7J.js → chunk.QQE7N7LB.js} +1 -1
- package/dist/preview/{chunk.DNROW6LX.js → chunk.QQRLUBWQ.js} +1 -1
- package/dist/preview/{chunk.ETPKXUAN.js → chunk.QWX2N2VD.js} +2 -2
- package/dist/preview/chunk.R5IRHCLZ.js +1 -0
- package/dist/preview/{chunk.UV3YU64Z.js → chunk.REANMQ6K.js} +1 -1
- package/dist/preview/{chunk.5TM5VA2H.js → chunk.RI624PFK.js} +1 -1
- package/dist/preview/chunk.RMWLV3PR.js +20 -0
- package/dist/preview/{chunk.7N2GXZYI.js → chunk.RSR2M7ZO.js} +2 -2
- package/dist/preview/chunk.SGJSJGSR.js +1 -0
- package/dist/preview/chunk.SIVMZNHZ.js +1 -0
- package/dist/preview/{chunk.FWSCBHZ5.js → chunk.SPZVEQC5.js} +1 -1
- package/dist/preview/chunk.SR2345SW.js +1 -0
- package/dist/preview/chunk.ST4JHXPS.js +1 -0
- package/dist/preview/chunk.TABIRLQS.js +2 -0
- package/dist/preview/{chunk.52VGZBO3.js → chunk.TBA4GF34.js} +1 -1
- package/dist/preview/{chunk.6TIEX67B.js → chunk.THENABJU.js} +1 -1
- package/dist/preview/{chunk.Y4ZUJUUT.js → chunk.TM6JVVGW.js} +1 -1
- package/dist/preview/{chunk.57ZSMK3R.js → chunk.TSHBXCMU.js} +1 -1
- package/dist/preview/{chunk.PYE3WZM7.js → chunk.UL43GFVC.js} +1 -1
- package/dist/preview/{chunk.RBJAPOZ3.js → chunk.UTRIPGW6.js} +1 -1
- package/dist/preview/{chunk.V7XHNRQM.js → chunk.VSWEKNKS.js} +2 -2
- package/dist/preview/chunk.VV3PNZPI.js +1 -0
- package/dist/preview/chunk.W6CGAPNQ.js +1 -0
- package/dist/preview/{chunk.IJNOT4S4.js → chunk.WQN7EFW3.js} +2 -2
- package/dist/preview/{chunk.PC6PID5X.js → chunk.X4MTZKL3.js} +1 -1
- package/dist/preview/{chunk.C3NHNYA6.js → chunk.XJ7YGW6Y.js} +1 -1
- package/dist/preview/{chunk.MCB26YCQ.js → chunk.XMOIMPUC.js} +1 -1
- package/dist/preview/{chunk.6RY6OSE6.js → chunk.XN7PIWVC.js} +1 -1
- package/dist/preview/chunk.XOZU4OFA.js +1 -0
- package/dist/preview/{chunk.T42S2WMB.js → chunk.XXZFWZ4C.js} +1 -1
- package/dist/preview/{chunk.ZQY6ODXC.js → chunk.YECMUK4X.js} +1 -1
- package/dist/preview/chunk.YSFNPYCD.js +2 -0
- package/dist/preview/{chunk.ZWVN75EY.js → chunk.YXOJKGRC.js} +1 -1
- package/dist/preview/{chunk.CMOXKRWT.js → chunk.ZBL47SFK.js} +1 -1
- package/dist/preview/{chunk.EYI3Y2DY.js → chunk.ZILULTJJ.js} +1 -1
- package/dist/preview/index.html +50 -49
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.2CLANQHZ.js +0 -1
- package/dist/preview/chunk.2L3VFGHX.js +0 -1
- package/dist/preview/chunk.4OGOTHRD.js +0 -1
- package/dist/preview/chunk.5G53VDOC.js +0 -1
- package/dist/preview/chunk.64WM4IBI.js +0 -1
- package/dist/preview/chunk.6QVXXQCW.js +0 -2
- package/dist/preview/chunk.7NNI7YH4.js +0 -1
- package/dist/preview/chunk.A3RNSSUQ.js +0 -1
- package/dist/preview/chunk.A7RKTSOH.js +0 -20
- package/dist/preview/chunk.AS4CQBOQ.js +0 -5
- package/dist/preview/chunk.AWXDZUKH.js +0 -1
- package/dist/preview/chunk.AYA7SYIU.js +0 -1
- package/dist/preview/chunk.BBS5C2BY.js +0 -1
- package/dist/preview/chunk.COYLGLTI.js +0 -1
- package/dist/preview/chunk.DX357TZ3.js +0 -2
- package/dist/preview/chunk.GQHAAKJG.js +0 -1
- package/dist/preview/chunk.HDRD33II.js +0 -1
- package/dist/preview/chunk.I6JLOEJU.js +0 -1
- package/dist/preview/chunk.ISNEX772.js +0 -1
- package/dist/preview/chunk.IW7YFPGG.js +0 -1
- package/dist/preview/chunk.IYIN6VSN.js +0 -1
- package/dist/preview/chunk.JUWWRRHA.js +0 -1
- package/dist/preview/chunk.K2NCGPCL.js +0 -1
- package/dist/preview/chunk.KWQ7QOHD.js +0 -2
- package/dist/preview/chunk.MCCUVGTE.js +0 -1
- package/dist/preview/chunk.NDWW5EER.js +0 -1
- package/dist/preview/chunk.OCTOGZVJ.js +0 -3
- package/dist/preview/chunk.OJGUIWDD.js +0 -88
- package/dist/preview/chunk.PBKO5CKD.js +0 -1
- package/dist/preview/chunk.QGVLJTZS.js +0 -1
- package/dist/preview/chunk.RX2M4C5W.js +0 -2
- package/dist/preview/chunk.SGKK4UKP.js +0 -1
- package/dist/preview/chunk.T7RJCEJB.js +0 -18
- package/dist/preview/chunk.UKAPFIPJ.js +0 -1
- package/dist/preview/chunk.VW2VCPJX.js +0 -1
- package/dist/preview/chunk.W6COSBO2.js +0 -21
- package/dist/preview/chunk.WAB7UDHU.js +0 -1
- package/dist/preview/chunk.X5G7FOPY.js +0 -12
- package/dist/preview/chunk.XYEFZ2OO.js +0 -1
- package/dist/preview/chunk.YHH4TWZ2.js +0 -1
- package/dist/preview/chunk.YVONXFKE.js +0 -6
- package/dist/preview/chunk.ZIEHF67C.js +0 -1
- package/dist/preview/chunk.ZL7ZBJUU.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{b as te}from"./chunk.
|
|
1
|
+
import{b as te}from"./chunk.DFGXNFFE.js";import"./chunk.A7HMVWMG.js";import"./chunk.GRLPNTUW.js";import{c as ne}from"./chunk.EJAVIZ7Y.js";import{G as ge,R as ee}from"./chunk.TM6JVVGW.js";import"./chunk.SDO3U72B.js";import{Fc as q,da as X,ga as Z}from"./chunk.PFEKS3KO.js";import"./chunk.2AZTW66C.js";import{b as T}from"./chunk.AJZBJBMO.js";var M=T(ge(),1);var ye=6;function re($,S,m,x,E){let t=new Set($),o=new Map;for(let i of S)for(let[h,l,b]of[[i.from,i.to,"out"],[i.to,i.from,"in"]]){if(!t.has(h)||t.has(l))continue;let f=m(l);if(f===void 0)continue;let p=`${h}|${i.kind}|${b}|${f}`,v=o.get(p);v?v.others.includes(l)||v.others.push(l):o.set(p,{self:h,edge:i.kind,direction:b,kind:f,others:[l]})}let d=[];for(let i of o.values()){let h=m(i.self)??"",l=ne(E,i.direction==="out"?h:i.kind,i.edge,i.direction);if(i.others.length>ye){d.push({...i,others:i.others,lands:"district",words:l});continue}let b=[],f=[];for(let p of i.others)(x(p)?b:f).push(p);for(let p of b)d.push({...i,others:[p],lands:"record",words:l});f.length>0&&d.push({...i,others:f,lands:"district",words:l})}return d}function ie($,S=[]){let m=[...S],x=new Map,E=t=>m.some(o=>t.x<o.x+o.width&&o.x<t.x+t.width&&t.y<o.y+o.height&&o.y<t.y+t.height);for(let t of[...$].sort((o,d)=>o.y-d.y||o.x-d.x)){let o={x:t.x-t.width/2,y:t.y-t.height,width:t.width,height:t.height};for(let d=0;d<12&&E(o);d++)o.y+=t.height+2;m.push(o),x.set(t.key,{x:o.x,y:o.y})}return x}var s=T(ee(),1),he=4;function xe({frame:$,width:S,height:m,stageRef:x,tick:E,store:t,graphVersion:o,selection:d,view:i,rulers:{visibleRect:h,clipQuadratic:l,unsureOf:b,unsureDash:f,unsureOpacity:p}}){let v=n=>t.graph.getNode(n)?.kind,C=te(d,i,v),R=C.lens===null&&C.records.length<=he?C.records:[],oe=R.join(`
|
|
2
2
|
`),[y,K]=(0,M.useState)(null);(0,M.useLayoutEffect)(()=>{let n=x.current;if(!i.overview||R.length===0||!n||typeof document>"u"||$.t<1){K(null);return}let w=n.getBoundingClientRect(),B=e=>({x:e.left-w.left,y:e.top-w.top,width:e.width,height:e.height}),D=new Map,se=R.map(e=>`[data-graview-view="${CSS.escape(e)}"]`).join(","),k=null,H=()=>{if(k)return k;k={drawn:new Map,buildings:new Map};for(let e of n.querySelectorAll("[data-graview-pick], [data-graview-view], [data-graview-building]")){let r=e.getAttribute("data-graview-pick"),a=e.getAttribute("data-graview-view");for(let c of r!==null&&r===a?[r]:[r,a]){if(c===null)continue;let u=k.drawn.get(c);u?u.push(e):k.drawn.set(c,[e])}let L=e.getAttribute("data-graview-building");L!==null&&!k.buildings.has(L)&&k.buildings.set(L,e)}return k},P=e=>{if(D.has(e))return D.get(e);let r=null;for(let a of H().drawn.get(e)??[])if(!a.closest("[data-graview-offstage], [data-graview-screen]")&&!(!R.includes(e)&&a.closest(se))&&(r=h(a,n),r))break;if(!r){let a=H().buildings.get(e);a&&(r=B(a.getBoundingClientRect()))}return D.set(e,r),r},W=e=>{let r=n.querySelector(`[data-graview-plot="kind:${CSS.escape(e)}"] .graview-plot-tile`);return r?B(r.getBoundingClientRect()):null},de=re(R,t.graph.allEdges(),v,e=>P(e)!==null,t.schema),z=[];for(let e of n.querySelectorAll('[data-graview-view^="kind:"] .graview-kind-face')){let r=h(e,n);r&&z.push(r)}let Q=e=>({x:e.x+e.width/2,y:e.y+e.height/2}),O=[],V=new Set(R),I=new Set;for(let e of de){let r=v(e.self),a=P(e.self)??(r?W(r):null),L=e.lands==="record"?P(e.others[0]):W(e.kind);if(!a||!L)continue;for(let g of e.others)V.add(g);I.add(e.kind),r&&I.add(r);let c=Q(a),u=Q(L),A=Math.hypot(u.x-c.x,u.y-c.y);if(A<6)continue;let G=Math.min(40,A*.12)*(O.length%2===0?1:-1),le={x:(c.x+u.x)/2-(u.y-c.y)/A*G,y:(c.y+u.y)/2+(u.x-c.x)/A*G},J=l({p0:c,c:le,p1:u},z);if(J.length===0)continue;let ce=J.map(g=>`M ${g.p0.x.toFixed(1)} ${g.p0.y.toFixed(1)} Q ${g.c.x.toFixed(1)} ${g.c.y.toFixed(1)} ${g.p1.x.toFixed(1)} ${g.p1.y.toFixed(1)}`).join(" "),ue=g=>{let j=t.graph.getNode(g);return j?X(t.schema.tryDefinition(j.kind),j):g},U=e.lands==="record"?`${e.words}: ${ue(e.others[0])}`:`${e.words}: ${Z(t.schema,e.kind,e.others.length)}`,F=e.others[0],_=e.lands==="record"?b?.(e.edge,e.direction==="out"?e.self:F,e.direction==="out"?F:e.self):void 0;O.push({key:`${e.self}|${e.edge}|${e.direction}|${e.lands}|${F}`,link:e,d:ce,end:u,said:_!==void 0?`${U} \xB7 unsure`:U,..._!==void 0?{unsure:_}:{}})}let Y=[];for(let e of n.querySelectorAll(".graview-kind-face[data-graview-nameplate]")){let r=h(e,n);r&&Y.push(r)}let ae=ie(O.map(e=>({key:e.key,x:e.end.x,y:e.end.y-6,width:Math.min(260,14+e.said.length*6.6),height:20})),Y);K({lines:O,labels:ae,reached:[...V],districts:[...I]})},[oe,i.overview,$,o,E,S,m,x,t]);let N=(0,M.useMemo)(()=>{if(!y)return"";let n=y.reached.map(B=>`[data-graview-building="${CSS.escape(B)}"]`).join(","),w=y.districts.map(B=>`[data-graview-plot="kind:${CSS.escape(B)}"]`).join(",");return[".graview-ground[data-graview-altitude] .graview-building { opacity: 0.22; }",n?`.graview-ground[data-graview-altitude] .graview-building:is(${n}) { opacity: 1; }`:"",w?`.graview-ground[data-graview-altitude] .graview-plot:not(:is(${w})) .graview-plot-tile { opacity: 0.4; }`:""].join(`
|
|
3
3
|
`)},[y]);return!y||y.lines.length===0?N?(0,s.jsx)("style",{children:N}):null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{children:N}),(0,s.jsx)("svg",{className:"graview-record-links","data-graview-world":"","data-graview-record-links":y.lines.length,"aria-hidden":"true",width:S,height:m,style:{position:"absolute",left:0,top:0,pointerEvents:"none",zIndex:q.lines},children:y.lines.map(n=>(0,s.jsxs)("g",{className:"graview-record-link","data-graview-link":n.link.edge,"data-graview-lands":n.link.lands,"data-graview-direction":n.link.direction,"data-graview-provisional":n.unsure!==void 0||void 0,children:[(0,s.jsx)("path",{className:"graview-record-link-line",d:n.d,...n.unsure!==void 0?{strokeDasharray:f,strokeOpacity:p}:{}}),n.link.lands==="record"?(0,s.jsx)("circle",{className:"graview-record-link-end",cx:n.end.x,cy:n.end.y,r:3}):null]},n.key))}),(0,s.jsx)("div",{"aria-hidden":"true","data-graview-world":"",style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:q.tieLabels},children:y.lines.map(n=>{let w=y.labels.get(n.key);return w?(0,s.jsx)("span",{className:"graview-record-link-said","data-graview-link-said":n.link.edge,"data-graview-lands":n.link.lands,...n.unsure!==void 0?{title:n.unsure}:{},style:{position:"absolute",left:w.x,top:w.y,...n.unsure!==void 0?{pointerEvents:"auto"}:{}},children:n.said},n.key):null})})]})}export{xe as RecordLinks};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as g}from"./chunk.
|
|
1
|
+
import{a as g}from"./chunk.EJAVIZ7Y.js";import{D as m,H as y,Hb as w,va as a,ya as k}from"./chunk.PFEKS3KO.js";var d=i=>i?._zod?.def,h=/^\^\\d\{4\}-\\d\{2\}-\\d\{2\}\$$/;function b(i){let t=d(i),p=!0,f;for(let e=0;t&&e<4;e++){if(t.type==="optional"||t.type==="nullable")p=!1;else if(t.type==="default")p=!1,f=t.defaultValue;else break;t=d(t.innerType)}if(!t)return{why:"it is not a zod field"};let u=m(i),r={...p?{required:!0}:{},...f!==void 0?{default:f}:{},...u?{description:u}:{}},s=(t.checks??[]).map(e=>d(e)),c=a(i);if(c)return{spec:{type:c,...r}};if(k(i))return{spec:{type:"app-link",...r}};if(g(i))return{spec:{type:"text",format:"markdown",...r}};let l=w(i);if(l)return{spec:{type:l,...r}};switch(t.type){case"string":{let e=t.format;return e==="email"?{spec:{type:"email",...r}}:e==="url"?{spec:{type:"url",...r}}:e==="date"?{spec:{type:"date",...r}}:e==="datetime"||s.some(n=>n?.fn===y)?{spec:{type:"datetime",...r}}:s.some(n=>n?.format==="regex"&&h.test(String(n?.pattern?.source??"")))?{spec:{type:"date",...r}}:{spec:{type:"string",...r}}}case"number":{let e={};for(let n of s){let o=n?.value;typeof o=="number"&&(n?.check==="greater_than"&&n.inclusive?e.min=Math.max(e.min??o,o):n?.check==="less_than"&&n.inclusive?e.max=Math.min(e.max??o,o):n?.check==="multiple_of"&&(e.step=o))}return{spec:{type:s.some(n=>n?.format==="safeint"||n?.format==="int")?"integer":"number",...e,...r}}}case"boolean":return{spec:{type:"boolean",...r}};case"enum":{let e=Object.keys(t.entries??{});return e.length>0?{spec:{type:"enum",options:e,...r}}:{why:"it is an enum with no options"}}case"array":{let e=d(t.element),n=a(t.element)??(e?.type==="number"?"number":e?.type==="string"?"string":void 0);return n?{spec:{type:"list",of:n,...r}}:{why:`it is a list of ${String(e?.type??"something")}, and a document lists words, numbers, dates, images, videos or files`}}default:return{why:`it is a ${String(t.type)}, which a document has no field type for`}}}function L(i){let t=b(i);return"spec"in t?t.spec:void 0}export{L as a};
|
|
@@ -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.C75I24Z5.js";import{a as Y,c as H,d as X,e as J}from"./chunk.4SEY7VWZ.js";import"./chunk.IVHPJUFM.js";import"./chunk.W6CGAPNQ.js";import"./chunk.7C4IR4S7.js";import"./chunk.D53IGR45.js";import"./chunk.MJ4XTNTL.js";import"./chunk.AP22NNIM.js";import"./chunk.FNK2ZZ5E.js";import"./chunk.UT6642FC.js";import"./chunk.TI4OSTQV.js";import"./chunk.GZHZLJBF.js";import"./chunk.FOYVTN5B.js";import"./chunk.OJGHDWI6.js";import"./chunk.OTF3NNTI.js";import"./chunk.A7HMVWMG.js";import"./chunk.GRLPNTUW.js";import"./chunk.EJAVIZ7Y.js";import"./chunk.423SZS7C.js";import{Da as z,F as V,G as q,Oa as K,R as x,S as F,Sa as U,_ as b,c as W,x as j}from"./chunk.TM6JVVGW.js";import{a as N}from"./chunk.SDO3U72B.js";import{Xa as _,da as I,fa as G,ia as B,sb as D}from"./chunk.PFEKS3KO.js";import"./chunk.2AZTW66C.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.O4WEJ47H.js","./chunk.Y4ZUJUUT.js","./chunk.SDO3U72B.js","./chunk.AS4CQBOQ.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.57ZSMK3R.js")))).part((e,t)=>(0,n.jsx)(e.TidyGroups,{...t}),{quiet:!0}),fe=z(N(()=>(__graviewPreload(import.meta.url,["./chunk.Y4ZUJUUT.js","./chunk.SDO3U72B.js","./chunk.AS4CQBOQ.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.P4KCZRIG.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.423SZS7C.js","./chunk.TM6JVVGW.js","./chunk.SDO3U72B.js","./chunk.PFEKS3KO.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.TSHBXCMU.js")))).part((e,t)=>(0,n.jsx)(e.TidyGroups,{...t}),{quiet:!0}),fe=z(N(()=>(__graviewPreload(import.meta.url,["./chunk.TM6JVVGW.js","./chunk.SDO3U72B.js","./chunk.PFEKS3KO.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.IYLOA3MV.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};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{C as y,
|
|
1
|
+
import{C as y,Hb as $,L as h,Lb as x,U as g,fa as m}from"./chunk.PFEKS3KO.js";function B(n,e,t){let o=n?.display?.format?.[e];return o?o(t):typeof t=="string"?m(t):String(t)}function G(n,e,t,o){let s=n.tryDefinition(e)?.edges,i=s&&Object.hasOwn(s,t)?s[t]:void 0;return(o==="out"?i?.description:i?.inverse)??m(t).toLowerCase()}var O=Symbol.for("@graview/core:markdown");function S(n){let e=y(n);return!!e&&(e[O]===1||S(e.innerType))}var w=/^ {0,3}#{1,6}(?:[ \t]+|$)/,b=/^[ \t]*(?:[-*+•]|\d{1,9}[.)])[ \t]+(?:\[[ xX]\][ \t]+)?/,k=/^ {0,3}(?:(?:-[ \t]*){3,}|(?:\*[ \t]*){3,}|(?:_[ \t]*){3,})$/,R=/^ {0,3}(?:`{3,}|~{3,})/,F=/^ {0,3}(?:>[ \t]?)+/,A=/^\|?\s*:?-{2,}:?\s*(?:\|\s*:?-{2,}:?\s*)*\|?$/,_={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'",nbsp:" "};function E(n){return n.replace(/!?\[([^\]\n]{0,500})\]\([^)\n]{0,500}\)/g,"$1").replace(/<((?:https?:|mailto:)[^>\s]*)>/gi,"$1").replace(/<\/?[A-Za-z][^<>\n]*>/g,"").replace(/`+([^`\n]*)`+/g,"$1").replace(/(\*\*|__|~~)(?=\S)([^\n]{0,500}?\S)\1/g,"$2").replace(/(^|[^\w*])\*(?=\S)([^*\n]{0,500}?\S)\*(?![\w*])/g,"$1$2").replace(/(^|\W)_(?=\S)([^_\n]{0,500}?\S)_(?!\w)/g,"$1$2").replace(/\\([\\`*_{}[\]()#+\-.!>|~])/g,"$1").replace(/&(amp|lt|gt|quot|#39|nbsp);/g,(e,t)=>_[t]??"")}function N(n,e,t){let o=n.replace(/\r\n?/g,`
|
|
2
2
|
`).split(`
|
|
3
3
|
`),s=[],i=[],c=0,d=!1,u=()=>{let r=i.join(" ").replace(/\s+/g," ").trim();r&&(s.push(r),c+=r.length),i=[]},a=0;for(;a<o.length&&c<=t;){let r=o[a++];if(e&&R.test(r)){d=!d,d||u();continue}if(!d&&(r.trim().length===0||e&&(k.test(r)||A.test(r.trim())))){u();continue}let f=!d&&e&&w.test(r),l=!d&&b.test(r);if((f||l)&&u(),e&&!d?(r=r.replace(F,""),f&&(r=r.replace(w,"").replace(/[ \t]+#+[ \t]*$/,"")),l&&(r=r.replace(b,"")),r.includes("|")&&(r=r.replace(/^[ \t]*\||\|[ \t]*$/g,"").split("|").map(p=>p.trim()).filter(Boolean).join(" \xB7 ")),r=E(Number.isFinite(t)?r.slice(0,t*2+200):r)):l&&(r=r.replace(b,"")),i.push(r),f&&u(),i.reduce((p,T)=>p+T.length,0)>t)break}return u(),{blocks:s,more:o.slice(a).some(r=>r.trim().length>0&&!(e&&(R.test(r)||k.test(r))))}}function M(n,e){return`${(n.slice(0,e+1).replace(/\s+\S*$/,"")||n.slice(0,e)).replace(/[\s,;:.—-]+$/,"")}\u2026`}function Z(n,e={}){let t=e.most??160,{blocks:o,more:s}=N(n,e.markdown===!0,t),i=o[0]??"";if(i.length<=t)return(s||o.length>1)&&i.length>0&&!/[.!?…:]$/.test(i)?`${i}\u2026`:i;let c=x(i);return c&&c.length<=t?c:M(i,t)}var J=n=>N(n,!0,Number.POSITIVE_INFINITY).blocks.join(" ");var j={d:1440,h:60,m:1};function ne(n){if(typeof n=="number")return Number.isFinite(n)&&n>=0?Math.round(n):void 0;if(typeof n!="string")return;let e=n.trim().toLowerCase();if(/^\d+$/.test(e))return Number(e);let t=/^(\d+):([0-5]\d)(?::([0-5]\d))?$/.exec(e);if(t)return Number(t[1])*60+Number(t[2])+Math.round(Number(t[3]??0)/60);let o=0,s=!1,i=e.replace(/(\d*[.,]?\d+) *(days?|d|hours?|hrs?|hr|h|minutes?|mins?|min|m)(?![a-z])/g,(c,d,u)=>(s=!0,o+=Number(d.replace(",","."))*j[u[0]]," "));return s&&/^[\s,+]*(?:and[\s,+]*)*$/.test(i)?Math.round(o):void 0}function I(n,e){if(!Number.isFinite(n))return String(n);let t=Math.round(Math.abs(n)),o=Math.floor(t/60),s=t%60,i=[o?`${g(o,e)} h`:"",s||!o?`${g(s,e)} min`:""].filter(Boolean).join(" ");return n<0?`\u2212${i}`:i}var D=/^(\+?1[ .-]?)?\(?([2-9]\d\d)\)?[ .-]?(\d{3})[ .-]?(\d{4})(?: *(?:ext\.?|x|#) *(\d+))?$/i;function W(n,e){let t=n.trim(),o=/[-_](US|CA)\b/i.test(h(e))?D.exec(t):null;if(!o)return t;let[,s,i,c,d,u]=o;return`${s?.startsWith("+")?"+1 ":""}(${i}) ${c}-${d}${u?` ext. ${u}`:""}`}function P(n){let[,e="",t]=/^(.*?)(?: *(?:ext\.?|x|#) *(\d+))?$/i.exec(n.trim())??[],o=e.replace(/\D/g,"");return o.length<3?void 0:`tel:${e.startsWith("+")?"+":""}${o}${t?`;ext=${t}`:""}`}var L=()=>/Mac|iPhone|iPad|iPod/.test(globalThis.navigator?.userAgent??"");function q(n,e=L()){let t=encodeURIComponent(n.trim());return e?`https://maps.apple.com/?q=${t}`:`https://www.google.com/maps/search/?api=1&query=${t}`}var C=n=>n?.fields?.shape??{},U=(n,e)=>{let t=C(n);return Object.hasOwn(t,e)?$(t[e]):void 0},H=(n,e)=>{let t=n.computed,o=t&&Object.hasOwn(t,e)?t[e]:void 0;return typeof o=="object"?o.as:void 0};function te(n,e){return U(n,e)??(n&&H(n,e)==="duration"?"duration":void 0)}function re(n,e,t){return n==="duration"?typeof e=="number"?I(e,t):void 0:n==="phone"?typeof e=="string"?W(e,t):void 0:n==="place"&&typeof e=="string"?e.trim():void 0}function oe(n,e){if(!(typeof e!="string"||!e.trim()))return n==="phone"?P(e):n==="place"?q(e):void 0}export{S as a,B as b,G as c,Z as d,J as e,ne as f,te as g,re as h,oe as i};
|
|
@@ -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{d as C,e as re}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{d as C,e as re}from"./chunk.AGVFW6WC.js";import{e as ee}from"./chunk.SIVMZNHZ.js";import{b as S}from"./chunk.EJAVIZ7Y.js";import{m as X}from"./chunk.423SZS7C.js";import{Da as V,G as se,Oa as J,R as Z,Sa as Q}from"./chunk.TM6JVVGW.js";import{a as K}from"./chunk.SDO3U72B.js";import{O as Y,U as M,da as U}from"./chunk.PFEKS3KO.js";import{b as D}from"./chunk.AJZBJBMO.js";var h=D(se(),1);var n=D(Z(),1),Re=9,le=40,ge=2;function de(e){let r=new Map;for(let i of e.allNodes())r.set(i.kind,(r.get(i.kind)??0)+1);return r}var ue=(e,r)=>(e.far??[]).reduce((i,a)=>i+(r.get(a)??0),0);function ce(e,r,i){if(i)return i.flatMap(s=>e.filters.filter(u=>u.key===s));let a=de(r),o=new Set(e.filters.filter(s=>s.about==="edge"&&ue(s,a)>le).map(s=>s.key));return e.filters.filter(s=>s.about==="edge"?!o.has(s.key):s.about==="via"?o.has(s.key.split(".")[0]):!0)}function pe(e,r){let i=e.filter(a=>a.about==="field"&&a.type==="choice"&&(a.options?.length??0)>0);return r?i:i.slice(0,ge)}var fe=520;function ye(e,r,i,a){let o=i.filters.find(s=>s.key===a.key);if(!o)return`${a.key}: ${a.value}`;if(o.about==="is")return a.value.charAt(0).toUpperCase()+a.value.slice(1);if(o.about==="via")return`${o.label}: ${S(e.tryDefinition(o.far?.[0]??""),o.key.split(".")[1],a.value)}`;if(o.about==="edge"){if(a.value==="*")return`${o.label}: anything`;if(a.value==="none")return`${o.label}: nothing`;let s=r.getNode(a.value);return`${o.label}: ${s?U(e.tryDefinition(s.kind),s):a.value}`}if(o.type==="date"){let[s,u]=a.value.split(":");return`${o.label} ${s} ${u?Y(u):""}`.trim()}if(o.type==="boolean")return`${o.label}: ${a.value==="true"?"yes":"no"}`;if(o.type==="number"){let s=a.value.lastIndexOf(":"),u=a.value.slice(0,Math.max(0,s));if(u==="at-most"||u==="at-least")return`${o.label}: ${u==="at-most"?"at most":"at least"} ${S(e.tryDefinition(i.kind),o.key,Number(a.value.slice(s+1)))}`}return o.type==="text"?`${o.label}: ${a.value}`:`${o.label}: ${S(e.tryDefinition(i.kind),o.key,a.value)}`}var P=e=>/^[A-Z][a-z]/.test(e)?e.charAt(0).toLowerCase()+e.slice(1):e;function me(e){return e?.type==="date"?{asc:"Earliest first",desc:"Latest first"}:e?.type==="number"?{asc:"Lowest first",desc:"Highest first"}:e?.type==="boolean"?{asc:"No first",desc:"Yes first"}:e?.type==="choice"?{asc:"In their order",desc:"In reverse order"}:{asc:"A to Z",desc:"Z to A"}}var x=V(K(()=>(__graviewPreload(import.meta.url,["./chunk.EM5CGFNB.js","./chunk.N2S45SSL.js","./chunk.AGVFW6WC.js","./chunk.SIVMZNHZ.js","./chunk.A7HMVWMG.js","./chunk.GRLPNTUW.js","./chunk.EJAVIZ7Y.js","./chunk.423SZS7C.js","./chunk.TM6JVVGW.js","./chunk.SDO3U72B.js","./chunk.PFEKS3KO.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.XMOIMPUC.js")))),N=x.part((e,r)=>(0,n.jsx)(e.ArrangeLists,{...r}),{what:"This list",quiet:!0}),he=x.part((e,r)=>(0,n.jsx)(e.ArrangeChips,{...r}),{what:"This list",quiet:!0}),Te=()=>x.load(),q=new Map;function Ie(e){let{schema:r,graph:i,kind:a,arrangement:o,onChange:s}=e,u=e.offers??ee(r,a),g=e.testId??"arrange",y=C(e.allow,"sort")&&u.sorts.length>1,m=C(e.allow,"group")&&u.groups.length>0,F=C(e.allow,"filter")?ce(u,i,e.filters):[],L=e.chips?pe(F,e.filters):[],H=F.filter(t=>!L.includes(t)),G=H.length>0,_=e.query!==!1&&e.allow!==!1,w=we(e.noun,e.kept),v=e.past&&e.past.count>0?e.past:null;if(!y&&!m&&!G&&!_&&!w&&!v)return null;let z=t=>JSON.stringify(re(t)),O=`${g}|${a}`,p={current:q.get(O)??{words:new Set,latest:null,at:0}};q.set(O,p.current),p.current.latest&&Date.now()-p.current.at>1500&&!p.current.words.has(z(o))&&(p.current={words:new Set,latest:null,at:0},q.set(O,p.current));let d=p.current.latest??o,b=t=>{let l={...p.current.latest??o,...t};for(let c of Object.keys(l))l[c]===void 0&&delete l[c];p.current.latest=l,p.current.at=Date.now(),p.current.words.add(z(l)),s(l)},f=d.filter??[],R=t=>{let l=f.filter((c,I)=>I!==t);b({filter:l.length>0?l:void 0})},A=t=>f.some(l=>l.key===t.key&&l.value===t.value),te=t=>A(t)?R(f.findIndex(l=>l.key===t.key&&l.value===t.value)):b({filter:[...f,t]}),T=d.sort?u.sorts.find(t=>t.key===d.sort.by):void 0,j=d.group?u.groups.find(t=>t.key===d.group.by):void 0,ne=me(T),k={schema:r,graph:i,offers:{...u,filters:H},arrangement:d,set:b,toggle:te,has:A,testId:g},ae=(t,l)=>A({key:t,value:l})?R(f.findIndex(c=>c.key===t&&c.value===l)):b({filter:[...f.filter(c=>c.key!==t),{key:t,value:l}]}),oe=d.sort?(0,n.jsxs)(n.Fragment,{children:["Sorted by ",P(T?.label??d.sort.by),(0,n.jsx)("span",{"aria-hidden":"true",children:d.sort.direction==="desc"?" \u2193":" \u2191"})]}):"Sort",ie=d.group?.bucket&&j?.buckets?`, a ${d.group.bucket} each`:"",B=d.group?`Grouped by ${P(j?.label??d.group.by)}${ie}`:"Group";return(0,n.jsxs)("div",{"data-testid":`${g}-bar`,role:"group","aria-label":"Arrange",className:"graview-arrange",style:e.style,onPointerEnter:x.prefetch,onFocus:x.prefetch,children:[(0,n.jsx)("style",{children:xe}),(0,n.jsxs)("div",{className:"graview-arrange-line",children:[w?(0,n.jsxs)("span",{className:"graview-arrange-count","data-testid":`${g}-count`,children:[w.kept?(0,n.jsx)("span",{"data-testid":`${g}-kept`,children:w.kept}):null,w.words]}):null,v?(0,n.jsxs)("button",{type:"button",className:"graview-arrange-open","data-testid":`${g}-past`,title:`${M(v.count)} more behind the horizon \u2014 press to widen the view to the past`,onClick:t=>{let l=t.currentTarget.closest("[data-graview-view]"),c=t.currentTarget;v.widen();let I=0,W=()=>{if(document.activeElement!==c&&document.activeElement!==document.body&&c.isConnected)return;let $=l?.querySelector('[role="group"][aria-label="Arrange"] :is(button, input)');if($&&$!==c&&$.isConnected)return $.focus({preventScroll:!0});++I<120&&requestAnimationFrame(W)};requestAnimationFrame(W)},children:["+",M(v.count)," past"]}):null,f.map((t,l)=>{let c=ye(r,i,u,t);return(0,n.jsxs)("span",{className:"graview-arrange-token","data-testid":`${g}-condition`,children:[c,(0,n.jsx)("button",{type:"button","aria-label":`Remove: ${c}`,title:"Remove",onClick:()=>R(l),children:"\xD7"})]},`${t.key}:${t.value}`)}),y?(0,n.jsx)("span",{className:"graview-arrange-part graview-arrange-one",children:(0,n.jsx)(E,{testId:`${g}-sort`,value:d.sort?.by??"",set:d.sort!==void 0,label:"Sort",name:d.sort?`Sorted by ${P(T?.label??d.sort.by)}, ${ne[d.sort.direction].toLowerCase()}`:"Sort",list:t=>(0,n.jsx)(N,{which:"sort",done:t,...k}),children:oe})}):null,m?(0,n.jsx)("span",{className:"graview-arrange-part graview-arrange-one",children:(0,n.jsx)(E,{testId:`${g}-group`,value:d.group?.by??"",set:d.group!==void 0,label:"Group",name:B,list:t=>(0,n.jsx)(N,{which:"group",done:t,...k}),children:B})}):null,G?(0,n.jsx)("span",{className:"graview-arrange-part",children:(0,n.jsx)(E,{testId:`${g}-add`,value:"",set:!1,label:"Filter",name:f.length>0?`Filter \u2014 ${f.length} on`:"Filter",list:t=>(0,n.jsx)(N,{which:"filter",done:t,...k}),children:"Filter"})}):null,y||m?(0,n.jsx)("span",{className:"graview-arrange-part graview-arrange-all",children:(0,n.jsx)(E,{testId:`${g}-all`,value:"",set:!1,label:"Arrange",name:"Arrange: sort and group",list:t=>(0,n.jsx)(N,{which:"all",done:t,parts:{sort:y,group:m,filter:!1},...k}),children:"Arrange"})}):null,_?(0,n.jsxs)("label",{className:"graview-arrange-words-at",children:[(0,n.jsx)("span",{style:X,children:"Find"}),(0,n.jsx)("input",{type:"search",className:"graview-arrange-words","data-testid":`${g}-query`,value:d.query??"",placeholder:"Find\u2026",onChange:t=>b({query:t.target.value.length>0?t.target.value:void 0})})]}):null,L.length>0&&e.chips?(0,n.jsx)(h.Suspense,{fallback:null,children:(0,n.jsx)(he,{offers:L,chips:e.chips,schema:r,graph:i,kind:a,arrangement:d,has:A,choose:ae,testId:g})}):null]})]})}function we(e,r){if(!r)return null;let i=r.shown!==r.of;if(!e)return i?{words:"",kept:`${r.shown} of ${r.of}`}:null;let a=r.of===1?e.one:e.many;return i?{words:` ${a}`,kept:`${r.shown} of ${r.of}`}:{words:`${r.of} ${a}`}}function E({testId:e,value:r,set:i,label:a,name:o,list:s,children:u}){let g=Q("arrange",{align:"start"}),y=(0,h.useRef)(null);return(0,h.useEffect)(()=>{g.open&&y.current?.querySelector('[aria-pressed="true"]')?.focus({preventScroll:!0})},[g.open]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("button",{type:"button",className:"graview-arrange-open","data-testid":e,"data-set":i?"":void 0,value:r,"aria-label":o,...g.trigger,onClick:g.toggle,children:[u,(0,n.jsx)(be,{})]}),g.open?(0,n.jsx)("div",{...g.pane,ref:m=>{g.pane.ref(m),y.current=m},role:"group","aria-label":a,"data-testid":"arrange-list","data-arrange":e,className:"graview-arrange-list",style:J,onKeyDown:ve,children:s(()=>g.setOpen(!1))}):null]})}function ve(e){if(!["ArrowDown","ArrowUp","Home","End"].includes(e.key))return;let r=[...e.currentTarget.querySelectorAll("button:not([disabled]), input")];if(r.length===0)return;let i=r.indexOf(document.activeElement);if(document.activeElement instanceof HTMLInputElement&&document.activeElement.type==="date"&&(e.key==="ArrowUp"||e.key==="ArrowDown"))return;e.preventDefault();let a=e.key==="Home"?0:e.key==="End"?r.length-1:e.key==="ArrowDown"?(i+1)%r.length:(i-1+r.length)%r.length;r[a].focus()}function be(){return(0,n.jsx)("svg",{width:"9",height:"9",viewBox:"0 0 10 10","aria-hidden":"true",focusable:"false",style:{flex:"0 0 auto",opacity:.7},children:(0,n.jsx)("path",{d:"M2 3.5 L5 6.5 L8 3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}var xe=`
|
|
2
2
|
.graview-arrange{container-type:inline-size;box-sizing:border-box;width:100%;min-width:0;max-width:100%}
|
|
3
3
|
.graview-arrange-line{display:flex;flex-wrap:wrap;align-items:center;gap:2px 6px;min-width:0;font-size:.875rem;line-height:1.35;color:var(--graview-ink-muted)}
|
|
4
4
|
.graview-arrange-count{margin-right:2px;color:var(--graview-ink-muted)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk.BU6V76EF.js";import"./chunk.OL5D7YTW.js";import"./chunk.423SZS7C.js";import"./chunk.TM6JVVGW.js";import"./chunk.SDO3U72B.js";import"./chunk.PFEKS3KO.js";import"./chunk.2AZTW66C.js";import"./chunk.AJZBJBMO.js";export{a as ActivityFilter,b as InteractionRow};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Bt,b as It,c as Wt,d as Wn}from"./chunk.
|
|
1
|
+
import{a as Bt,b as It,c as Wt,d as Wn}from"./chunk.2OXXGN7C.js";import{a as zt}from"./chunk.Q4KNNJFL.js";import{a as Bn,b as Et,c as In,d as Mt,e as Lt,f as Tt}from"./chunk.WQN7EFW3.js";import{c as Ht,g as Vt,h as Gt,i as jt}from"./chunk.BH365UJ5.js";import{e as $t}from"./chunk.7JW5SHRR.js";import{a as Pt,b as tn,c as Nt,d as Dt}from"./chunk.EYSQPXVE.js";import{b as vt,c as pe,d as ke,e as ze}from"./chunk.AP22NNIM.js";import{m as At}from"./chunk.EM5CGFNB.js";import{a as Ot,b as Rt}from"./chunk.N2S45SSL.js";import{f as kt,h as Ct}from"./chunk.AGVFW6WC.js";import{e as St}from"./chunk.SIVMZNHZ.js";import{e as bt}from"./chunk.NQDGUIUQ.js";import{l as xt,m as zn}from"./chunk.FOYVTN5B.js";import{f as Nn,g as Dn}from"./chunk.A7HMVWMG.js";import{k as Fe,m as wt}from"./chunk.423SZS7C.js";import{G as De,Ka as yt,La as nn,R as te,T as ft,_ as oe,aa as ht,l as en}from"./chunk.TM6JVVGW.js";import{Ac as Ze,Bc as mt,Gc as Le,Pa as lt,Ta as dt,Tc as Pn,U as dn,Ua as ct,V as rt,Va as ut,W as at,Wb as gt,X as Mn,Y as it,Z as Xe,ca as Ve,da as Se,ga as qe,ha as cn,ia as ot,ka as Ln,kc as be,la as st,ma as un,od as pt,pb as Tn}from"./chunk.PFEKS3KO.js";import{b as U}from"./chunk.AJZBJBMO.js";var Dr=U(De(),1);var Hn=U(te(),1);function Be(e,t,n){let r=e.nodes?.length??0;if(e.total===void 0||e.total<=r)return n;let a=e.nodes?.[0]?.kind,i=a?cn(t,a).toLowerCase():"more";return(0,Hn.jsxs)("div",{style:{display:"grid",gridTemplateRows:"minmax(0, 1fr) auto",height:"100%",minHeight:0},children:[n,(0,Hn.jsxs)("p",{"data-testid":"lens-more",style:{margin:"4px 0 0",fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:["+",e.total-r," more ",i]})]})}var qt=U(te(),1),Br=(e,t)=>{if(e===!1||t===!1)return!1;let n=e===void 0||e===!0?{}:e,r=t===void 0||t===!0?{}:t;return{sort:n.sort!==!1&&r.sort!==!1,filter:n.filter!==!1&&r.filter!==!1,group:n.group!==!1&&r.group!==!1}},Ir=["sort","filter","group","q","archived"];function Te(e,t={}){let{store:n}=oe(),{view:r,go:a}=nn(),s=Ir.some(M=>r.within?.[M]!==void 0)?Ot(r):t.arrangedBy??{},m=e.nodes??[],u=t.kind??m[0]?.kind??e.node?.kind,b=s.archived!==void 0&&s.archived!==!1&&u!==void 0&&!t.subject?n.graph.nodesOfKind(u,{archived:s.archived}):m,l=t.subject??(t.only?b.filter(t.only):b),y=t.subject?[]:t.only?b.filter(M=>!t.only(M)):[],p=t.kind??l[0]?.kind,o=Br(t.allow,t.lensAllows),d=p?St(n.schema,String(p)):void 0,k=d?kt(s,d).arrangement:{},c=Ct(l,o===!1?{}:k,{schema:n.schema,graph:n.graph,flagged:new Set(e.flagged??[]),...t.search?{searchIn:t.search}:{}}),x=e.retired!==void 0&&e.retired>0&&(m[0]?.kind??p)===p?e.retired:0,R=p&&o!==!1&&e.fidelity==="full"&&e.budget===void 0&&(l.length>1||x>0)?(0,qt.jsx)(At,{schema:n.schema,graph:n.graph,kind:String(p),arrangement:k,allow:o,query:t.query!==!1,...t.filters?{filters:t.filters,chips:{nodes:l,flagged:new Set(e.flagged??[])}}:{},onChange:M=>a(Rt(r,M)),kept:{shown:c.nodes.length,of:l.length},...x>0?{past:{count:x,widen:()=>a($t(r,!0))}}:{}}):null;return{nodes:[...y,...c.nodes],arranged:c,arrangement:k,bar:R}}function _e(e,t,n){let r=new Set((n??[]).map(i=>i.kind)),a=new Set((n??[]).map(i=>i.id));return e.allNodes().filter(i=>r.has(i.kind)?a.has(i.id):Ve(t.tryDefinition(i.kind),i))}var Ie=U(De(),1);var j=U(te(),1),Wr=["slots","x","y","fill"],gn=class extends Error{constructor(n,r){super(`${n}
|
|
2
2
|
${r}`);this.hint=r;this.name="BoardBindingError"}},Ft=e=>Math.max(0,Math.min(1,e));function Vn(e,t,n,r){let a=d=>d,i=d=>r?Se(r.tryDefinition(d.kind),d):String(a(d).label??d.id);if(r&&r.tryDefinition(n.slots)===void 0)throw new gn(`No kind is declared for "${n.slots}".`,'Check the lens bindings: { slots: "<kind>", x: "<field>", y: "<field>", fill: "<edge kind>" }');let s=e.filter(d=>d.kind===n.slots);if(!r&&s.length===0)throw new gn(`Nothing to arrange: no "${n.slots}" nodes.`,'Check the lens bindings: { slots: "<kind>", x: "<field>", y: "<field>", fill: "<edge kind>" }');let m=t.filter(d=>d.kind===n.fill),u=new Map(e.map(d=>[d.id,d])),b=new Map(e.map((d,k)=>[d.id,k])),l=s.map(d=>{let k=a(d),c=n.fillFrom==="occupant",x=m.filter(R=>(c?R.to:R.from)===d.id).map(R=>u.get(c?R.from:R.to)).filter(R=>R!==void 0).sort((R,M)=>(b.get(R.id)??0)-(b.get(M.id)??0)).map(R=>({id:R.id,label:i(R)}));return{id:d.id,code:String(k[n.slotCode??""]??"").trim()||i(d),label:i(d),x:Ft(Number(k[n.x]??.5)),y:Ft(Number(k[n.y]??.5)),occupants:x}}).sort((d,k)=>d.y-k.y||d.x-k.x),y=new Set(l.flatMap(d=>d.occupants.map(k=>k.id))),p=new Set([...y].map(d=>u.get(d)?.kind).filter(d=>d!==void 0)),o=e.filter(d=>p.has(d.kind)&&!y.has(d.id)).map(d=>({id:d.id,label:i(d)})).sort((d,k)=>d.label<k.label?-1:d.label>k.label?1:0);return{slots:l,empty:l.filter(d=>d.occupants.length===0).map(d=>d.id),spare:o}}function Hr({nodes:e,occupants:t,label:n,fidelity:r,mode:a,options:i,schema:s,implicated:m=[],flagged:u=[]}){let{store:b}=oe(),l=_e(b.graph,b.schema,e),y=t?[...l.filter(f=>f.kind===i.slots),...t.map(f=>b.graph.getNode(f)).filter(f=>f!==void 0)]:l,p=Vn(y,b.graph.allEdges(),i,s),o=new Set(m),d=new Set(u),k=yt(),c=new Map;for(let f of k)for(let v of f.nodeIds)c.set(v,[...c.get(v)??[],f.message]);let x=f=>f?c.get(f)??[]:[];if(r==="glyph")return(0,j.jsx)(ke,{label:`${n??"Board"} \xB7 ${p.slots.length-p.empty.length}/${p.slots.length}`,hue:be("board")});if(r==="summary"){let f=p.slots.filter(v=>p.empty.includes(v.id));return(0,j.jsx)(pe,{title:n??"Board",meta:`${p.slots.length-p.empty.length}/${p.slots.length}`,tone:f.length>0?"warning":"muted",fit:!0,children:f.length>0?(0,j.jsx)(ze,{pick:!0,max:5,items:f.map(v=>({id:v.id,label:v.code}))}):(0,j.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink-faint)"},children:"Every slot filled."})})}let R=i.aspect??.68,M=(0,Ie.useRef)(null),[P,w]=(0,Ie.useState)(!1),[O,g]=(0,Ie.useState)(null),L=160,[N,G]=(0,Ie.useState)(!1);(0,Ie.useEffect)(()=>{let f=M.current;if(!f||typeof ResizeObserver>"u")return;let v=new ResizeObserver(S=>{let A=S[0]?.contentRect;if(!A)return;let h=A.height<L;G(h),w(!h&&R<1&&A.width/A.height>1.3),g(h?null:A.height)});return v.observe(f),()=>v.disconnect()},[R]);let C=(f,v)=>P?{x:1-v,y:f}:{x:f,y:v},q=(()=>{let f=new Map,v=(S,A,h)=>{let $=f.get(h)??{ids:[],codes:[]};$.ids.includes(S)||($.ids.push(S),$.codes.includes(A)||$.codes.push(A)),f.set(h,$)};for(let S of p.slots){for(let A of x(S.id))v(S.id,S.code,A);for(let A of S.occupants)for(let h of x(A.id))v(A.id,A.label,h)}return[...f.entries()].map(([S,A])=>({id:A.ids[0],code:A.codes.join(", "),text:S}))})(),W=a==="fullscreen",ce=q.length===0?null:(0,j.jsxs)("ul",{"data-graview-primitive":"board-key",style:{margin:"2px 0 0",padding:0,listStyle:"none",display:"grid",gap:3,flex:"0 0 auto"},children:[q.slice(0,W?6:2).map(f=>(0,j.jsxs)("li",{"data-graview-pick":f.id,"data-graview-emphasis":o.size===0?"plain":o.has(f.id)?"lit":"dimmed",title:f.text,style:{display:W?"grid":"flex",gap:W?1:7,alignItems:W?"start":"baseline",fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)",minHeight:24,width:"fit-content",maxWidth:"100%",padding:W?"2px 0":"3px 6px",marginLeft:W?0:-6,borderRadius:7,cursor:"pointer"},children:[(0,j.jsxs)("span",{style:{flex:"0 0 auto",fontWeight:600,color:"var(--graview-warn)",letterSpacing:"0.02em"},children:["\u26A0 ",f.code]}),(0,j.jsx)("span",{style:{minWidth:0,...W?{}:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},children:f.text})]},f.id)),q.length>(W?6:2)?(0,j.jsxs)("li",{style:{fontSize:"0.8125rem",color:"var(--graview-ink-faint)"},children:["+",q.length-(W?6:2)," more"]}):null]}),ae=i.arrange==="shelf",ne=p.slots.every(f=>f.code.length<=3&&!/\s/.test(f.code)),D=(f,v)=>{let S=f.occupants.length===0,A=o.size>0&&!o.has(f.id)&&!f.occupants.some(J=>o.has(J.id)),h=d.has(f.id),$=f.occupants.some(J=>d.has(J.id)),T=h,Z=[...x(f.id),...f.occupants.flatMap(J=>x(J.id))],H=f.occupants.length===1?f.occupants[0]:null,K=i.pickTarget==="slot"?f.id:H?H.id:f.id,Y=J=>H?{}:{"data-graview-pick":J.id,"data-graview-emphasis":o.size===0?"plain":A?"dimmed":"lit"},le=J=>d.has(J.id)?"var(--graview-warn)":"var(--graview-ink-muted)",ge=i.emptyLabel??"empty";return(0,j.jsxs)("div",{"data-graview-pick":K,"data-graview-slot":f.id,"data-graview-mark":ne?"disc":"token","data-graview-flagged":h&&$?"both":h?"slot":$?"occupant":void 0,"data-graview-emphasis":o.size===0?"plain":A?"dimmed":"lit",title:[S?`${f.label} \u2014 nobody in it`:`${f.occupants.map(J=>J.label).join(", ")} at ${f.label}`,...Z].join(`
|
|
3
3
|
`),style:{...v,display:"grid",justifyItems:ne?"center":"start",gap:3,opacity:A?.5:1,transition:"opacity 160ms ease"},children:[ne?(0,j.jsxs)("span",{style:{position:"relative",width:34,height:34,borderRadius:999,display:"grid",placeItems:"center",fontSize:"0.75rem",letterSpacing:"0.02em",border:S?"1.5px dashed var(--graview-warn)":`1px solid ${T?"var(--graview-warn)":"var(--graview-edge-bright)"}`,background:S?"transparent":T?"var(--graview-panel-warning)":"var(--graview-panel)",color:S||T?"var(--graview-warn)":"var(--graview-ink)",boxShadow:S?void 0:"var(--graview-lift-low)"},children:[f.code,h&&!S?(0,j.jsx)("span",{"aria-hidden":"true",style:{position:"absolute",top:-3,right:-3,fontSize:"0.6875rem",lineHeight:1,color:"var(--graview-warn)"},children:"\u26A0"}):null]}):(0,j.jsxs)("span",{style:{display:"grid",gap:1,minWidth:0,maxWidth:180,padding:"5px 10px 6px",borderRadius:8,border:S?"1.5px dashed var(--graview-warn)":`1px solid ${T?"var(--graview-warn)":"var(--graview-edge-bright)"}`,background:S?"transparent":T?"var(--graview-panel-warning)":"var(--graview-panel)",boxShadow:S?void 0:"var(--graview-lift-low)"},children:[(0,j.jsxs)("span",{style:{fontSize:"0.8125rem",fontWeight:550,lineHeight:1.25,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",color:S||T?"var(--graview-warn)":"var(--graview-ink)"},children:[f.code,h&&!S?" \u26A0":null]}),S?(0,j.jsx)("span",{style:{fontSize:"0.75rem",lineHeight:1.3,color:"var(--graview-warn)"},children:ge}):(0,j.jsx)("span",{style:{display:"flex",flexWrap:"wrap",gap:"0 8px",fontSize:"0.75rem",lineHeight:1.3},children:f.occupants.map(J=>(0,j.jsxs)("span",{...Y(J),style:{whiteSpace:"nowrap",color:le(J)},children:[J.label,d.has(J.id)?" \u26A0":""]},J.id))})]}),ne?S?(0,j.jsx)("span",{style:{fontSize:"0.75rem",whiteSpace:"nowrap",color:"var(--graview-warn)"},children:ge}):f.occupants.map(J=>(0,j.jsxs)("span",{...Y(J),style:{fontSize:"0.75rem",whiteSpace:"nowrap",color:le(J)},children:[J.label,d.has(J.id)?" \u26A0":""]},J.id)):null]},f.id)},Q=i.zones??[],ue=Q.map((f,v)=>({label:f.label,slots:p.slots.filter(S=>S.y>=f.from&&(S.y<f.to||v===Q.length-1&&S.y<=f.to))})),I=new Set(ue.flatMap(f=>f.slots.map(v=>v.id))),E=p.slots.filter(f=>!I.has(f.id));(E.length>0||ue.length===0)&&ue.push({label:"",slots:E});let _={boxSizing:"border-box",borderRadius:12,border:"1px solid var(--graview-edge)",background:"linear-gradient(var(--graview-panel-muted), var(--graview-panel-muted)), var(--graview-panel)",overflow:"hidden"};return(0,j.jsxs)(pe,{title:n??"Board",meta:p.slots.length===0?void 0:p.empty.length===0?`all ${p.slots.length} filled`:`${p.empty.length} unfilled`,...W?{style:{flex:"1 1 auto",minHeight:0,height:"100%"}}:{},children:[(0,j.jsxs)("div",{ref:M,style:{display:"flex",gap:28,alignItems:"stretch",justifyContent:"center",flex:"1 1 auto",minHeight:0},children:[W&&ce?(0,j.jsxs)("div",{style:{width:260,flex:"0 0 auto",alignSelf:"center",display:"grid",gap:8},children:[(0,j.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:"What is marked"}),ce]}):null,ae?(0,j.jsx)("div",{"data-graview-primitive":"board","data-graview-arrange":"shelf",style:{..._,overflow:"auto",flex:"1 1 auto",minWidth:0,alignSelf:"stretch",display:"grid",alignContent:"start"},children:ue.map((f,v)=>(0,j.jsxs)("section",{"data-graview-zone":f.label||void 0,style:{display:"grid",gap:8,padding:"10px 14px 14px",...v>0?{borderTop:"1px dashed var(--graview-edge)"}:{}},children:[f.label?(0,j.jsx)("span",{style:{fontSize:"0.6875rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:f.label}):null,f.slots.length>0?(0,j.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:"10px 12px",alignItems:"flex-start"},children:f.slots.map(S=>D(S,{}))}):(0,j.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:"nothing here"})]},f.label||`band-${v}`))}):(0,j.jsxs)("div",{style:{display:"flex",gap:5,alignItems:"stretch",minWidth:0,...N?{flex:"1 1 auto",alignSelf:"flex-start"}:{}},children:[!P&&Q.length>0?(0,j.jsx)("div",{"aria-hidden":"true",style:{position:"relative",width:15,flex:"0 0 auto",alignSelf:"stretch"},children:Q.map(f=>(0,j.jsx)("span",{title:f.label,style:{position:"absolute",top:`${f.from*100}%`,height:`${(f.to-f.from)*100}%`,right:0,writingMode:"vertical-rl",transform:"rotate(180deg)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"0.6875rem",letterSpacing:"0.14em",textTransform:"uppercase",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",color:"var(--graview-ink-faint)"},children:f.label},f.label))}):null,(0,j.jsxs)("div",{"data-graview-primitive":"board","data-graview-arrange":"exact",style:{..._,position:"relative",aspectRatio:`${P?1/R:R}`,...N?{width:"100%",height:"auto",flex:"1 1 auto",minWidth:0,alignSelf:"flex-start"}:{height:"100%",flex:"0 1 auto",...O!==null?{width:Math.round(O*(P?1/R:R))}:{}},maxWidth:"100%"},children:[Q.map(f=>(0,j.jsx)("div",{"aria-hidden":"true",style:{position:"absolute",...P?{top:0,bottom:0,left:`${(1-f.to)*100}%`,width:`${(f.to-f.from)*100}%`,borderLeft:"1px dashed var(--graview-edge)"}:{left:0,right:0,top:`${f.from*100}%`,height:`${(f.to-f.from)*100}%`,borderBottom:"1px dashed var(--graview-edge)"}}},f.label)),P?Q.map(f=>(0,j.jsx)("span",{"aria-hidden":"true",title:f.label,style:{position:"absolute",bottom:3,left:`${(1-f.to)*100}%`,width:`${(f.to-f.from)*100}%`,textAlign:"center",fontSize:"0.6875rem",letterSpacing:"0.14em",textTransform:"uppercase",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",color:"var(--graview-ink-faint)"},children:f.label},`label-${f.label}`)):null,p.slots.map(f=>D(f,{position:"absolute",left:`${C(f.x,f.y).x*100}%`,top:`${C(f.x,f.y).y*100}%`,transform:"translate(-50%, -50%)",width:"max-content",maxWidth:"100%"}))]})]}),p.spare.length>0?(0,j.jsxs)("div",{style:{display:"grid",gap:6,alignContent:"start",minWidth:0},children:[(0,j.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:"Not in"}),(0,j.jsx)(ze,{pick:!0,max:10,items:p.spare.map(f=>({...f,emphasis:o.size===0?"plain":o.has(f.id)?"lit":"dimmed"}))})]}):null]}),W?null:ce]})}function _t(e){function t(n){let{store:r}=oe(),a=Vn(_e(r.graph,r.schema,n.nodes),r.graph.allEdges(),e,r.schema),s=[...a.slots.flatMap(l=>l.occupants.map(y=>y.id)),...a.spare.map(l=>l.id)].map(l=>r.graph.getNode(l)).filter(l=>l!==void 0),{arranged:m,bar:u}=Te(n,{...e.arranging!==void 0?{allow:e.arranging}:{},lensAllows:{group:!1},...e.arrangedBy?{arrangedBy:e.arrangedBy}:{},subject:s}),b=(0,j.jsx)(Hr,{schema:r.schema,...n,options:e,...e.arranging===!1?{}:{occupants:m.nodes.map(l=>l.id)}});return Be(n,r.schema,u?(0,j.jsxs)("div",{style:{display:"grid",gap:6,height:"100%",minHeight:0,gridTemplateRows:"auto 1fr"},children:[u,b]}):b)}return{name:"board",requiredRoles:[...Wr],options:e,View:t,build(n,r,a){return Vn(n,r,e,a)}}}var xn=U(De(),1);var Ut=864e5;function Gn(e){if(typeof e!="string")return null;if(Nn(e))return Dn(e)?.day??null;let t=/^(\d{4}-\d{2}-\d{2})/.exec(e);return t?t[1]:null}function pn(e){if(typeof e!="string")return null;if(Nn(e))return Dn(e)?.minutes??null;let t=/^\d{4}-\d{2}-\d{2}[T ](\d{2}):(\d{2})/.exec(e);return t?Number(t[1])*60+Number(t[2]):null}var mn=e=>Date.UTC(Number(e.slice(0,4)),Number(e.slice(5,7))-1,Number(e.slice(8,10))),fn=e=>new Date(e).toISOString().slice(0,10);function Re(e,t){return fn(mn(e)+t*Ut)}function Ge(e,t){let n=Number(e.slice(0,4)),r=Number(e.slice(5,7))-1+t,a=Number(e.slice(8,10)),i=new Date(Date.UTC(n,r+1,0)).getUTCDate();return fn(Date.UTC(n,r,Math.min(a,i)))}var jn=e=>new Date(mn(e)).getUTCDay();function Ue(e,t=1){let n=(jn(e)-t+7)%7;return Re(e,-n)}var qn=e=>`${e.slice(0,7)}-01`;function we(e,t){return Math.round((mn(t)-mn(e))/Ut)}function Ke(e,t){return Array.from({length:t},(n,r)=>Re(e,r))}var Kt=e=>it(e,"short"),Pe=e=>rt(e,{weekday:"short"}),Fn=e=>Xe(e);function je(e,t){let n=t?.fieldRoles?.when;return e&&!e.start&&n?{...e,start:n}:e}function Yt(e,t){return t===void 0?!1:typeof t=="string"?e[t]===!0:t.is.includes(e[t.field])}var hn=["start"],Vr=["day","week","month","quarter","year","agenda"];function yn(e){return e.horizon?["day","week","month","quarter","year","years","agenda"]:Vr}function Qt(e,t){return e==="years"?t?.title??"Years":`The ${e}`}function Jt(){let e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}var _n=class extends Error{constructor(n,r){super(`The calendar lens has no binding for ${r.map(a=>`"${a}"`).join(", ")} on "${n}". Bind them in the lens declaration: bindings: { ${n}: { start: "<field>" } }.`);this.kind=n;this.missing=r;this.name="CalendarBindingError"}};function wn(e,t,n){let r=je(t[e.kind],n?.tryDefinition(e.kind));if(!r)return null;let a=e,i=n?.tryDefinition(e.kind)?.fields.shape,s=hn.filter(y=>{let p=r[y];return p?i?!(p in i):!(p in a):!0});if(s.length>0)throw new _n(e.kind,s);let m=Gn(a[r.start]);if(m===null)return null;let u=(r.end?Gn(a[r.end]):null)??m,b=pn(a[r.start]),l=r.label?a[r.label]:void 0;return{id:e.id,kind:e.kind,label:typeof l=="string"&&l.length>0?l:Se(n?.tryDefinition(e.kind),e),from:m,to:we(m,u)<0?m:u,at:r.allDay&&a[r.allDay]===!0?null:b,allDay:r.allDay&&a[r.allDay]===!0||b===null,done:Yt(a,r.done)}}function Xt(e,t,n,r){let a=wn(e,t,n);if(!a)return[];let i=je(t[e.kind],n?.tryDefinition(e.kind)).start,s=e,m=s[i],u=s[lt(i)];if(typeof m!="string"||!dt(u))return[a];let b=we(a.from,a.to);return("next"in r?[ut(m,u,r.next)]:ct(m,u,{from:Re(r.from,-b),to:r.to,limit:400})).map(y=>({...a,from:y.slice(0,10),to:Re(y.slice(0,10),b),repeats:!0}))}function vn(e,t){return e.filter(n=>we(n.from,t)>=0&&we(t,n.to)>=0).sort((n,r)=>n.allDay!==r.allDay?n.allDay?-1:1:n.at!==r.at?(n.at??0)-(r.at??0):n.label.localeCompare(r.label))}function Zt(e,t,n){let r=gt(e.schema,e.allMutations()).get(t)?.get(n)??[],a=new Map(e.allMutations().map(s=>[s.name,s]));for(let s of r){let m=a.get(s),u=m?.subject;if(!m||!u)continue;let b=m.input?.shape??{};if(n in b)return{name:m.name,arg:u.arg}}let i=e.allMutations().find(s=>s.derived?.act==="edit"&&s.derived.kind===t);return i?.subject?{name:i.name,arg:i.subject.arg}:null}var er=(e,t)=>({from:qn(e),to:nr(e),label:Mn(e,{short:!0,year:t})});function nr(e){return fn(Date.UTC(Number(e.slice(0,4)),Number(e.slice(5,7)),0))}function Gr(e){let t=Math.floor((Number(e.slice(5,7))-1)/3);return`${e.slice(0,4)}-${String(t*3+1).padStart(2,"0")}-01`}function tr(e,t,n={}){let r=n.weekStartsOn??1,a=(u,b)=>({from:u,to:u,label:String(Number(u.slice(8,10))),...b?{outside:!0}:{}});if(e==="day")return{title:Pe(t),grain:"day",columns:1,cells:[a(t)]};if(e==="week"){let u=Ue(t,r);return{title:`${Pe(u)} \u2013 ${Pe(Re(u,6))}`,grain:"day",columns:7,cells:Ke(u,7).map(b=>a(b))}}if(e==="agenda")return{title:`From ${Pe(t)}`,grain:"day",columns:1,cells:Ke(t,42).map(u=>a(u))};if(e==="quarter"){let u=Gr(t),b=nr(Ge(u,2)),l=[];for(let y=Ue(u,r);we(y,b)>=0;y=Re(y,7))l.push({from:y,to:Re(y,6),label:at(y),...we(y,u)>0&&we(Re(y,6),u)>0?{outside:!0}:{}});return{title:`Q${Math.floor((Number(t.slice(5,7))-1)/3)+1} ${t.slice(0,4)}`,grain:"week",columns:4,cells:l}}if(e==="year"){let u=t.slice(0,4);return{title:u,grain:"month",columns:4,cells:Array.from({length:12},(b,l)=>er(`${u}-${String(l+1).padStart(2,"0")}-01`,!1))}}if(e==="years"){let u=Number(t.slice(0,4)),b=u+Math.max(1,n.horizon?.years??1)-1,l=n.horizon?.from!==void 0||n.horizon?.to!==void 0,y=l?n.horizon?.from??u:Math.min(u,n.fit?.first??u),o=(l?Math.max(y,n.horizon?.to??y+Math.max(1,n.horizon?.years??1)-1):Math.max(b,n.fit?.last??b))-y+1,d=Array.from({length:o},(k,c)=>String(y+c));return o>jr?{title:`${n.horizon?.title??"Years"} \xB7 ${d[0]}\u2013${d[d.length-1]}`,grain:"year",columns:5,years:d,cells:d.map(k=>({from:`${k}-01-01`,to:`${k}-12-31`,label:k}))}:{title:`${n.horizon?.title??"Years"} \xB7 ${d[0]}\u2013${d[d.length-1]}`,grain:"month",columns:4,years:d,cells:d.flatMap(k=>Array.from({length:12},(c,x)=>er(`${k}-${String(x+1).padStart(2,"0")}-01`,!0)))}}let i=qn(t),s=Ue(i,r),m=t.slice(0,7);return{title:Mn(t),grain:"day",columns:7,cells:Ke(s,42).map(u=>a(u,u.slice(0,7)!==m))}}function rr(e,t,n){return e.filter(r=>we(r.from,n)>=0&&we(t,r.to)>=0).sort((r,a)=>r.allDay!==a.allDay?r.allDay?-1:1:r.from!==a.from?r.from.localeCompare(a.from):r.at!==a.at?(r.at??0)-(a.at??0):r.label.localeCompare(a.label))}var jr=10;function ar(e){return e==="year"?"year":e==="month"?"month":e==="week"?"week":"day"}var ir=U(De(),1);var ie=U(te(),1);function Un({label:e,glyph:t,onPress:n}){return(0,ie.jsx)("button",{type:"button","aria-label":e,title:e,onClick:n,style:Ye,children:t})}var Ye={minHeight:24,minWidth:24,padding:"2px 9px",borderRadius:6,fontSize:"0.8125rem",borderWidth:1,borderStyle:"solid",borderColor:"transparent",color:"var(--graview-ink-muted)",background:"transparent"},or={day:12,week:4,month:3,year:5};function sr({span:e,weekStartsOn:t,entries:n,today:r,perCell:a,emphasisOf:i,broken:s,hue:m,onOpen:u,onMove:b}){let l=(0,ir.useRef)(null),y=Fe(l),p=y===null?e.columns:Math.max(1,Math.floor(y/44)),o=p<e.columns,d=o?p:e.columns,k=!o&&e.grain==="day"&&e.columns===7?Ke(Ue(e.cells[0]?.from??r,t),7):e.grain==="day"&&e.columns===1?e.cells.map(c=>c.from):null;return o&&e.grain==="day"&&e.columns>1?(0,ie.jsx)("div",{ref:l,"data-calendar-shape":"agenda",style:{display:"grid",minHeight:0,flex:1},children:(0,ie.jsx)(bn,{days:e.cells.map(c=>c.from),entries:n,today:r,emphasisOf:i,broken:s,hue:m,onMove:(c,x)=>b(c,{from:x,to:x,label:x},"day")})}):(0,ie.jsxs)("div",{ref:l,"data-calendar-shape":o?"wrapped":"grid",style:{display:"grid",gap:4,gridTemplateRows:k?"auto 1fr":"1fr",minHeight:0,flex:1},children:[k?(0,ie.jsx)("div",{style:{display:"grid",gridTemplateColumns:`repeat(${d}, minmax(0, 1fr))`,gap:4},children:k.map(c=>(0,ie.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.16em",textTransform:"uppercase",color:"var(--graview-ink-muted)",textAlign:"center"},children:e.columns===7?Kt(jn(c)):Pe(c)},c))}):null,(0,ie.jsx)("div",{tabIndex:0,"aria-label":`The days of ${e.title}`,style:{display:"grid",gridTemplateColumns:`repeat(${d}, minmax(0, 1fr))`,gridAutoRows:"max-content",gap:4,minHeight:0,overflow:"auto"},children:e.cells.map((c,x)=>{let R=rr(n,c.from,c.to),M=R.slice(0,a),P=R.slice(a),w=P.filter(g=>s.has(g.id)).length,O=we(c.from,r)>=0&&we(r,c.to)>=0;return(0,ie.jsxs)("div",{"data-calendar-day":e.grain==="day"?c.from:void 0,"data-calendar-cell":c.from,"data-calendar-grain":e.grain,"data-calendar-count":R.length,"data-calendar-outside":c.outside||void 0,onDragOver:g=>{g.dataTransfer.types.includes("text/graview-node")&&(g.preventDefault(),g.dataTransfer.dropEffect="move")},onDrop:g=>{let L=g.dataTransfer.getData("text/graview-node");L&&(g.preventDefault(),g.stopPropagation(),b(L,c,e.grain))},style:{minHeight:62,display:"flex",flexDirection:"column",gap:2,padding:4,borderRadius:7,border:"1px solid var(--graview-edge)",background:O?"var(--graview-panel)":c.outside?"var(--graview-panel-muted)":"transparent"},children:[(0,ie.jsxs)("span",{style:{display:"flex",alignItems:"baseline",gap:4},children:[(0,ie.jsx)("span",{style:{fontSize:"0.75rem",fontVariantNumeric:"tabular-nums",color:O?"var(--graview-accent)":"var(--graview-ink-faint)"},children:c.label}),e.grain!=="day"&&R.length>0?(0,ie.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",marginLeft:"auto"},children:R.length}):null]}),M.map(g=>(0,ie.jsx)(lr,{entry:g,cell:c,rowStart:x%d===0,emphasis:i(g.id),flagged:s.has(g.id),hue:m(g)},`${g.id}:${g.from}:${c.from}`)),P.length>0?(0,ie.jsxs)("button",{type:"button","data-testid":`calendar-more-${c.from}`,onClick:()=>u(c),title:`Open ${c.label}`,style:{minHeight:24,padding:"1px 5px",fontSize:"0.75rem",borderRadius:5,border:"1px dashed var(--graview-edge)",background:"transparent",color:w>0?"var(--graview-warn)":"var(--graview-ink-muted)",textAlign:"left"},children:["+",P.length," more",w>0?` \xB7 ${w} flagged`:""]}):null]},c.from)})})]})}function bn({days:e,entries:t,today:n,emphasisOf:r,broken:a,hue:i,onMove:s}){let m=e.map(u=>({day:u,here:vn(t,u)})).filter(({here:u})=>u.length>0);return m.length===0?(0,ie.jsx)("p",{"data-testid":"calendar-empty",style:{margin:0,fontSize:"0.875rem",color:"var(--graview-ink-muted)"},children:"Nothing is scheduled in the next six weeks."}):(0,ie.jsx)("ol",{tabIndex:0,"aria-label":"What is scheduled",style:{margin:0,padding:0,listStyle:"none",display:"grid",alignContent:"start",gap:10,overflow:"auto",minHeight:0},children:m.map(({day:u,here:b})=>(0,ie.jsxs)("li",{"data-calendar-day":u,onDragOver:l=>{l.dataTransfer.types.includes("text/graview-node")&&(l.preventDefault(),l.dataTransfer.dropEffect="move")},onDrop:l=>{let y=l.dataTransfer.getData("text/graview-node");y&&(l.preventDefault(),l.stopPropagation(),s(y,u))},style:{display:"grid",gap:4},children:[(0,ie.jsxs)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.16em",textTransform:"uppercase",color:u===n?"var(--graview-accent)":"var(--graview-ink-muted)"},children:[Pe(u),u===n?" \xB7 today":""]}),b.map(l=>(0,ie.jsx)(lr,{entry:l,cell:{from:u,to:u,label:u},emphasis:r(l.id),flagged:a.has(l.id),hue:i(l)},`${l.id}:${l.from}:${u}`))]},u))})}function lr({entry:e,cell:t,emphasis:n,flagged:r,hue:a,rowStart:i=!1}){let s=we(t.from,e.from)>=0,m=we(e.to,t.to)>=0,u=!(s&&m),b=e.at!==null&&s&&e.from===t.from?`${Fn(e.at)} ${e.label}`:e.label;return(0,ie.jsx)("span",{"data-graview-pick":e.id,"data-calendar-entry":e.id,"data-calendar-repeat":e.repeats?e.from:void 0,draggable:!e.repeats,onDragStart:l=>{l.dataTransfer.setData("text/graview-node",e.id),l.dataTransfer.effectAllowed="move"},"data-graview-emphasis":n,"data-calendar-part":u?s?"opens":m?"closes":"through":void 0,"data-calendar-in":t.from,title:u?`${e.label} \xB7 ${e.from} \u2013 ${e.to}`:`${e.label}${e.at===null?" \xB7 all day":` \xB7 ${Fn(e.at)}`}${e.repeats?" \xB7 repeats":""}`,style:{display:"block",minHeight:24,boxSizing:"border-box",padding:"3px 6px",fontSize:"0.75rem",lineHeight:1.35,borderRadius:u?s?"5px 0 0 5px":m?"0 5px 5px 0":0:5,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textDecoration:e.done?"line-through":"none",opacity:n==="dimmed"?.35:e.done?.6:1,background:`color-mix(in oklab, hsl(${Math.round(a)} 70% 55%) ${n==="lit"?38:20}%, transparent)`,color:"var(--graview-ink)",...n==="lit"?{outline:"1px solid var(--graview-accent)"}:{},...r?{borderLeft:"3px solid var(--graview-warn)",paddingLeft:4}:{}},children:s||i?e.repeats?(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)("span",{"aria-hidden":"true",children:"\u21BB "}),b]}):b:" "})}var ee=U(te(),1);function qr(e){let t=1/0,n=-1/0;for(let r of e)r&&(t=Math.min(t,Number(r.from.slice(0,4))),n=Math.max(n,Number(r.to.slice(0,4))));return Number.isFinite(t)&&Number.isFinite(n)?{first:t,last:n}:void 0}function dr(e){let t=n=>function(a){let{store:i}=oe(),{view:s}=nn(),m=n?{...e,range:n}:e,u=s.within?.range??m.range??"month",b=Object.keys(e.bindings),{nodes:l,arranged:y,arrangement:p,bar:o}=Te(a,{...e.arranging!==void 0?{allow:e.arranging}:{},lensAllows:{sort:!1,group:u==="agenda"},...e.arrangedBy?{arrangedBy:e.arrangedBy}:{},...e.search?{search:e.search}:{},...e.filters?{filters:e.filters}:{},...b[0]?{kind:(a.nodes??[]).find(R=>b.includes(String(R.kind)))?.kind??b[0]}:{}}),d=u==="agenda"&&y.grouped&&p.group?y.groups.map(R=>({label:R.label,ids:new Set(R.nodes.map(M=>M.id))})):void 0,k=new Set((a.nodes??[]).map(R=>String(R.kind))),c=b.filter(R=>!k.has(R)&&i.schema.tryDefinition(R)!==void 0).flatMap(R=>{let M=i.schema.tryDefinition(R);return i.graph.nodesOfKind(R).filter(P=>s.past===!0||Ve(M,P))}),x=c.length===0?l:[...l,...a.budget!==void 0?c.slice(0,a.budget):c];return Be(a,i.schema,(0,ee.jsx)(Fr,{schema:i.schema,...a,nodes:x,options:{...m,today:m.today??i.today()??Jt()},...o?{bar:o}:{},...d?{groups:d}:{}}))};return{name:"calendar",requiredRoles:[...hn],bindings:e.bindings,options:e,View:t(),at:n=>t(n),ranges:()=>yn(e).map(n=>({range:n,title:Qt(n,e.horizon)})),place:(n,r)=>n.map(a=>wn(a,e.bindings,r)).filter(a=>a!==null)}}function Fr({nodes:e,label:t,fidelity:n,mode:r,options:a,schema:i,selectedIds:s=[],implicated:m=[],flagged:u=[],bar:b,groups:l}){let{view:y,go:p}=nn(),{store:o,principal:d}=oe(),k=y.within?.at??a.today,c=y.within?.range??a.range??"month",x=a.weekStartsOn??1,R=new Set([...m,...s]),M=E=>R.size===0?"plain":R.has(E)?"lit":"dimmed",P=new Set(u),w=c==="years"&&y.within?.at===void 0?qr((e??[]).map(E=>wn(E,a.bindings,i))):void 0,O=tr(c,k,{weekStartsOn:x,...a.horizon?{horizon:a.horizon}:{},...w?{fit:w}:{}}),L=n==="glyph"||n==="summary"?{next:a.today}:{from:O.cells[0]?.from??k,to:O.cells[O.cells.length-1]?.to??k},N=(e??[]).flatMap(E=>Xt(E,a.bindings,i,L)),G=a.hueOf??(E=>be(E.kind));if(n==="glyph")return(0,ee.jsx)(ke,{label:`${t??"Calendar"} \xB7 ${N.length}`,hue:be("calendar")});if(n==="summary"){let E=vn(N,a.today);return(0,ee.jsx)(pe,{title:t??"Calendar",meta:`${N.length} dated`,tone:"muted",children:(0,ee.jsx)(ze,{max:6,items:E.length>0?E.map(_=>({id:_.id,label:_.label,hue:G(_)})):N.filter(_=>we(a.today,_.from)>=0).sort((_,f)=>_.from.localeCompare(f.from)).slice(0,6).map(_=>({id:_.id,label:`${_.from.slice(5)} ${_.label}`,hue:G(_)}))})})}let C=r==="fullscreen",[q,W]=(0,xn.useState)(null),ce=(E,_,f)=>{let v=o.graph.getNode(E);if(!v)return;let S=je(a.bindings[v.kind],o.schema.tryDefinition(v.kind));if(!S)return;let A=Zt(o,v.kind,S.start);if(!A){W({text:`Nothing declared writes the ${Ln(o.schema.definitions.find(Y=>Y.kind===v.kind),S.start).toLowerCase()}, so this cannot be moved from here.`,tone:"refused"});return}let h=_.from,$=v[S.start],Z=pn($)===null?h:`${h}${String($).slice(10)}`,H={name:A.name,args:{[A.arg]:E,[S.start]:Z}},K=o.permits(H,d);if(!K.ok){W({text:K.refusal.message,tone:"refused"});return}try{o.apply(H,{author:d}),W(f==="day"?null:{text:`Moved to ${Pe(h)} \u2014 a ${f} is coarser than the ${Ln(o.schema.definitions.find(Y=>Y.kind===v.kind),S.start).toLowerCase()} holds, so it takes the first day of the cell. Undo puts it back.`,tone:"rounded"})}catch(Y){W({text:Y instanceof Error?Y.message:String(Y),tone:"refused"})}},ae=E=>{let _=c==="years"?Ge(`${O.years?.[0]??k.slice(0,4)}${k.slice(4)}`,E*12*Math.max(1,O.years?.length??a.horizon?.years??1)):c==="year"?Ge(k,E*12):c==="quarter"?Ge(k,E*3):c==="month"?Ge(k,E):c==="week"?Re(k,E*7):Re(k,E);p(en(y,"at",_))},ne=(E,_)=>{let f=en(y,"range",E);_!==void 0&&(f=en(f,"at",_)),p(f)},D=(0,xn.useRef)(null),Q=Fe(D),ue=Q!==null&&Q<420,I=E=>E==="years"?a.horizon?.title??"years":E.charAt(0).toUpperCase()+E.slice(1);return(0,ee.jsx)(pe,{title:t??"Calendar",meta:O.title,style:{gap:10,...C?{flex:"1 1 auto",minHeight:0,height:"100%"}:{}},children:(0,ee.jsxs)("div",{ref:D,"data-testid":"calendar","data-calendar-range":c,"data-calendar-at":k,style:{display:"flex",flexDirection:"column",height:"100%",minHeight:0,gap:8},children:[(0,ee.jsxs)("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:6},children:[(0,ee.jsxs)("nav",{"aria-label":"When",style:{display:"flex",gap:4},children:[(0,ee.jsx)(Un,{label:"Previous",glyph:"\u2039",onPress:()=>ae(-1)}),(0,ee.jsx)("button",{type:"button","data-testid":"calendar-today",onClick:()=>p(en(y,"at",a.today)),style:Ye,children:"Today"}),(0,ee.jsx)(Un,{label:"Next",glyph:"\u203A",onPress:()=>ae(1)})]}),ue?(0,ee.jsx)("select",{"aria-label":"Range","data-testid":"calendar-ranges",value:c,onChange:E=>ne(E.target.value),style:{...Ye,borderRadius:999,borderColor:"var(--graview-edge)",background:void 0,backgroundColor:"transparent",marginLeft:"auto",maxWidth:"50%",paddingRight:24,appearance:"none",WebkitAppearance:"none",backgroundImage:"linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%)",backgroundPosition:"calc(100% - 13px) 55%, calc(100% - 9px) 55%",backgroundSize:"4px 4px, 4px 4px",backgroundRepeat:"no-repeat"},children:yn(a).map(E=>(0,ee.jsx)("option",{value:E,children:I(E)},E))}):(0,ee.jsx)("div",{role:"group","aria-label":"Range","data-testid":"calendar-ranges",style:{display:"flex",flexWrap:"wrap",gap:4,marginLeft:"auto"},children:yn(a).map(E=>(0,ee.jsx)("button",{type:"button","aria-pressed":E===c,"data-testid":`calendar-range-${E}`,onClick:()=>ne(E),style:{...Ye,borderRadius:999,borderColor:"var(--graview-edge)",...E==="years"?{}:{textTransform:"capitalize"},...E===c?{borderColor:"var(--graview-accent)",color:"var(--graview-accent)",background:"var(--graview-panel)"}:{}},children:E==="years"?a.horizon?.title??"years":E},E))})]}),q?(0,ee.jsx)("p",{"data-testid":q.tone==="refused"?"calendar-refused":"calendar-rounded",role:"status",style:{margin:0,fontSize:"0.8125rem",color:q.tone==="refused"?"var(--graview-warn)":"var(--graview-ink-muted)"},children:q.text}):null,O.years?(0,ee.jsx)("nav",{"aria-label":"Years","data-testid":"calendar-years",style:{display:"flex",flexWrap:"wrap",gap:4},children:O.years.map(E=>(0,ee.jsx)("button",{type:"button","data-testid":`calendar-year-${E}`,onClick:()=>ne("year",`${E}-01-01`),style:Ye,children:E},E))}):null,b,c==="agenda"&&l?(0,ee.jsx)("div",{"data-testid":"calendar-groups",style:{display:"grid",gap:10,minHeight:0,overflow:"auto"},children:l.map(E=>(0,ee.jsxs)("section",{"data-testid":"calendar-group",style:{display:"grid",gap:4},children:[(0,ee.jsxs)("h3",{style:{margin:0,fontSize:"0.8125rem",letterSpacing:"0.08em",textTransform:"uppercase",color:"var(--graview-ink-muted)"},children:[E.label," ",(0,ee.jsx)("span",{style:{fontWeight:400},children:E.ids.size})]}),(0,ee.jsx)(bn,{days:O.cells.map(_=>_.from),entries:N.filter(_=>E.ids.has(_.id)),today:a.today,emphasisOf:M,broken:P,hue:G,onMove:(_,f)=>ce(_,{from:f,to:f,label:f},"day")})]},E.label))}):c==="agenda"?(0,ee.jsx)(bn,{days:O.cells.map(E=>E.from),entries:N,today:a.today,emphasisOf:M,broken:P,hue:G,onMove:(E,_)=>ce(E,{from:_,to:_,label:_},"day")}):(0,ee.jsx)(sr,{span:O,weekStartsOn:x,entries:N,today:a.today,perCell:a.perCell??or[O.grain],emphasisOf:M,broken:P,hue:G,onOpen:E=>ne(ar(O.grain),E.from),onMove:ce})]})})}var re=U(De(),1);var Qe=U(De(),1),Ae=U(te(),1),Sn={padding:"5px 10px",fontSize:"0.875rem",borderRadius:8,width:"100%",textAlign:"left",borderWidth:1,borderStyle:"solid",borderColor:"transparent",background:"none",boxShadow:"none"};function cr({choices:e,close:t}){let[n,r]=(0,Qe.useState)(!1),a=(0,Qe.useRef)(null);return(0,Qe.useLayoutEffect)(()=>{n&&a.current?.querySelector("button:not([disabled])")?.focus()},[n]),(0,Ae.jsxs)("div",{children:[(0,Ae.jsxs)("button",{type:"button","data-menu-item":"move-to","aria-expanded":n,onClick:()=>r(i=>!i),style:Sn,children:["Move to ",(0,Ae.jsx)("span",{"aria-hidden":"true",children:"\u203A"})]}),n?(0,Ae.jsx)("ul",{ref:a,"aria-label":"Move to","data-testid":"move-to",style:{margin:"2px 0 0 12px",padding:0,listStyle:"none",display:"flex",flexDirection:"column",gap:2},children:e.map(i=>i.run?(0,Ae.jsx)("li",{children:(0,Ae.jsx)("button",{type:"button","data-move-to":i.to,onClick:()=>{t(),i.run()},style:Sn,children:i.label})},i.to):(0,Ae.jsxs)("li",{style:{display:"grid",gap:2},children:[(0,Ae.jsx)("button",{type:"button",disabled:!0,"data-move-to":i.to,"data-withheld":"",style:{...Sn,borderStyle:"dashed"},children:(0,Ae.jsx)("s",{children:i.label})}),(0,Ae.jsx)("span",{"data-testid":"move-to-why",style:{fontSize:"0.8125rem",lineHeight:1.4,color:"var(--graview-ink-muted)",padding:"0 10px"},children:i.why})]},i.to))}):null]})}function ur({choose:e,close:t}){return(0,Ae.jsx)("button",{type:"button","data-menu-item":"choose-several",onClick:()=>{t(),e()},style:Sn,children:"Choose several"})}var z=U(te(),1),_r=`
|
|
4
4
|
.graview-columns { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as Ge}from"./chunk.AOEXSQDG.js";import{c as Me,d as Oe,f as Be}from"./chunk.35FUGOSG.js";import{e as Pe,f as Ce,j as Re,k as re,l as Fe}from"./chunk.NQDGUIUQ.js";import{f as Se}from"./chunk.LD6S2FL5.js";import{d as _,e as je,k as ne}from"./chunk.GRLPNTUW.js";import{b as De,e as Ae}from"./chunk.EJAVIZ7Y.js";import{$ as ue,Ac as U,Bc as be,C as Q,Cb as fe,I as de,Tc as ve,Ub as te,Vb as ge,ca as T,da as K,ea as me,fa as Z,ga as ee,ha as pe,hd as $e,ka as q,ma as z,rc as he,rd as ke,tc as ye,vc as we,zd as xe}from"./chunk.PFEKS3KO.js";function ze(r,e,t){let s=r.tryDefinition(e)?.fields.shape,n=Q(s?.[t]),a=!1,o=!1;for(;n&&(n.type==="optional"||n.type==="default"||n.type==="nullable"||n.type==="prefault");)(n.type==="optional"||n.type==="nullable")&&(a=!0),(n.type==="default"||n.type==="prefault")&&(o=!0),n=Q(n.innerType);if(n?.type!=="enum")return;let p=(n.entries?Object.values(n.entries):n.values??[]).filter(u=>typeof u=="string");return p.length>0?{values:p,empty:a&&!o}:void 0}function E(r,e,t){let s=ze(r,e,t);if(!s)return[];let n=r.tryDefinition(e),a=s.values.map(o=>({value:o,label:De(n,t,o)}));return s.empty&&a.push({value:null,label:`No ${q(n,t).toLowerCase()}`}),a}function X(r,e,t){let s=r[e];return typeof s=="string"&&t.some(n=>n.value===s)?s:null}function oe(r,e,t,s,n=E(r.schema,t.kind,s)){return Ie(r,e,t,s,n).flatMap(a=>a.move?[a.move]:[])}function Ie(r,e,t,s,n=E(r.schema,t.kind,s)){let a=Ne(r.schema,r.allMutations(),t.kind,s,n),o=X(t,s,n),p=z(r.schema.tryDefinition(t.kind),t.kind),u=[];for(let{value:A,label:R,by:F,acts:M}of a){if(A===o)continue;let x,G,I;for(let l of M){let w=F==="step"?{[l.subject.arg]:t.id}:{[l.subject.arg]:t.id,[s]:A},S={name:l.name,args:w};if(!l.input.safeParse(w).success){I??=`${l.title??l.name} asks for more than the ${p} itself.`;continue}let k=r.permits(S,e);if(!k.ok){G??=k.refusal?.message??`You may not ${l.title??l.name}.`;continue}try{fe(r.graph,l,w)}catch(f){G??=f instanceof Error?f.message:String(f);continue}x={to:A,call:S,title:l.title??l.name};break}u.push(x?{to:A,label:R,move:x}:{to:A,label:R,why:G??I??`Nothing in this app moves a ${p} to ${R}.`})}return u}function Ne(r,e,t,s,n=E(r,t,s)){let a=Ve(r,e,t,s),o=Ke(r,e,t,s);return n.flatMap(p=>{if(p.value===null)return[];let u=a.filter(A=>A.sets?.[s]===p.value);return[{value:p.value,label:p.label,by:u.length>0?"step":o.length>0?"value":"none",acts:u.length>0?u:o}]})}function Ve(r,e,t,s){return e.filter(n=>n.subject!==void 0&&n.derived===void 0&&typeof n.sets?.[s]=="string"&&te(r,n).includes(t))}function Ke(r,e,t,s){let n=r.tryDefinition(t);return n?e.filter(a=>{if(!a.subject||!te(r,a).includes(t)||!ge(a,n).includes(s))return!1;let o=a.input.shape;return o!==void 0&&s in o}).sort((a,o)=>+(a.derived!==void 0)-+(o.derived!==void 0)):[]}var se=(r,e)=>e&&r[e]!==void 0?String(r[e]):"";function Xe(r,e,t){let s=l=>r.tryDefinition(l)?e.nodesOfKind(l).filter(w=>T(r.tryDefinition(l),w)):[],n=s(t.rows),a=s(t.columns),o=new Set(n.map(l=>l.id)),p=new Set(a.map(l=>l.id)),u=e.allEdges(),A=[],R=t.link;if(typeof R=="string"){let l=f=>r.tryDefinition(f)?.edges?.[R]?.to,w=(l(t.columns)??[]).some(f=>f===t.rows||f==="*"),S=(l(t.rows)??[]).some(f=>f===t.columns||f==="*"),k=w||!S;for(let f of u){if(f.kind!==R)continue;let P=k?f.to:f.from,i=k?f.from:f.to;o.has(P)&&p.has(i)&&A.push({rowId:P,columnId:i,via:[]})}}else{let l=new Map(R.path.map(S=>[S,new Map]));for(let S of u){let k=l.get(S.kind);if(!k)continue;let f=k.get(S.from);f?f.push(S.to):k.set(S.from,[S.to]);let P=k.get(S.to);P?P.push(S.from):k.set(S.to,[S.from])}let w=new Set;for(let S of a){let k=[{id:S.id,via:[]}];for(let f of R.path){let P=[],i=new Set;for(let $ of k)for(let b of l.get(f).get($.id)??[])i.has(`${$.id}|${b}`)||(i.add(`${$.id}|${b}`),P.push({id:b,via:[...$.via,$.id]}));k=P}for(let f of k){let P=`${f.id}|${S.id}`;!o.has(f.id)||w.has(P)||(w.add(P),A.push({rowId:f.id,columnId:S.id,via:f.via.slice(1)}))}}}let F=t.groupOrder??[],M=l=>F.indexOf(l)===-1?F.length:F.indexOf(l),x=(l,w)=>w==="label"?K(r.tryDefinition(l.kind),l):l[w],G=U(n,t.sort,x).map(l=>{let w=l;return{node:l,label:K(r.tryDefinition(l.kind),l),group:se(w,t.rowGroup),ref:se(w,t.rowRef)}}).sort((l,w)=>M(l.group)-M(w.group)||(t.sort!==void 0?0:l.ref<w.ref?-1:l.ref>w.ref?1:0)),I=U(a,t.columnSort,x).map(l=>({node:l,label:K(r.tryDefinition(l.kind),l),group:se(l,t.columnGroup)})).sort((l,w)=>l.group<w.group?-1:l.group>w.group?1:t.columnSort!==void 0?0:l.node.id<w.node.id?-1:l.node.id>w.node.id?1:0);return{rows:G,columns:I,cells:A}}function We(r,e,t){let{rows:s,columns:n,cells:a}=Xe(r,e,t),o=(i,$)=>ee(r,i,$),p=i=>ee(r,i,1).replace(/^1 /,""),u=i=>({id:i.id,kind:i.kind,title:K(r.tryDefinition(i.kind),i),parts:[]}),A=i=>{let $=e.getNode(i);if(!$)return null;let b=r.tryDefinition($.kind),C=K(b,$),N=_($,b,{limit:3,said:[C],glance:!0}).map(V=>V.alone.startsWith(V.label)?`${V.label.toLowerCase()}${V.alone.slice(V.label.length)}`:V.alone);return[C,...N].join(", ")},R=typeof t.link=="string"?[]:t.link.path.slice(0,-1).flatMap((i,$,b)=>{let C=ve(r,t.columns,b.slice(0,$+1));return C.ok?[...C.reached]:[]}),F=be(r,t,{rows:s.length,columns:n.length,cells:a.length});if(F)return[{t:"text",text:`${o(t.rows,s.length)} against ${o(t.columns,n.length)}.`},{t:"text",text:F}];let M=[{t:"text",text:`${o(t.rows,s.length)} against ${o(t.columns,n.length)}${R.length>0?`, through ${[...new Set(R)].map(i=>o(i,2).replace(/^2 /,"")).join(" and ")}`:""}${n.length>0?`: ${n.map(i=>i.label).join(", ")}`:""}.`}],x=new Map(n.map(i=>[i.node.id,i.label])),G=new Map(n.map((i,$)=>[i.node.id,$])),I=new Map,l=new Map;for(let i of a){let $=I.get(i.rowId);$?$.push(i):I.set(i.rowId,[i]);let b=l.get(i.columnId);b?b.add(i.rowId):l.set(i.columnId,new Set([i.rowId]))}for(let i of s){let b=[...I.get(i.node.id)??[]].sort((C,N)=>G.get(C.columnId)-G.get(N.columnId)).map(C=>{let N=C.via.map(A).filter(V=>V!==null);return`${x.get(C.columnId)}${N.length>0?` (${N.join("; ")})`:""}`});M.push({t:"field",label:i.label,text:b.length>0?b.join(", "):"none"})}M.push({t:"list",as:"name",columns:1,groups:n.map(i=>{let $=l.get(i.node.id)??new Set,b=s.filter(C=>$.has(C.node.id)).map(C=>u(C.node));return{heading:`${i.label} (${b.length})`,items:b}})});let w=new Set(a.map(i=>i.rowId)),S=new Set(a.map(i=>i.columnId)),k=s.filter(i=>!w.has(i.node.id)),f=n.filter(i=>!S.has(i.node.id)),P=t.rows===t.columns;return k.length>0&&M.push({t:"text",text:`${P?`${k.length} with none across`:`${o(t.rows,k.length)} with no ${p(t.columns)}`}: ${k.map(i=>i.label).join(", ")}.`}),f.length>0&&M.push({t:"text",text:`${P?`${f.length} with none down`:`${o(t.columns,f.length)} on no ${p(t.rows)}`}: ${f.map(i=>i.label).join(", ")}.`}),M}function ie(r,e,t,s={}){let{app:n,blocks:a=t?n?.viewSpecs?.[t.kind]?.[s.slot??"page"]:n?.home}=s;if(!a?.length)return[];let o=s.firstHeading??(t||s.blocks?void 0:1),p=Fe(r,e,t,{...s,money:s.money??n?.brand,firstHeading:o});return t&&!p.node?[]:Ce(typeof a[0]?.t=="string"?a:Pe(a),p)}function Y(r,e,t){let s=!(e.optional||e.control==="boolean"),n=e.control==="node"&&!e.kinds.includes("*")?e.kinds.map(o=>Z(z(r.tryDefinition(o),o))).join(" or "):t(e.name).label,a={name:e.name,label:n,required:s};switch(e.control){case"text":return{...a,input:e.holds==="duration"?"length of time":e.holds??(e.markdown?"Markdown text":e.long?"long text":e.app?"app address":"text")};case"date":return{...a,input:e.time||e.instant?"date and time":"date"};case"number":return{...a,input:e.amount?"amount":"number",...e.min===void 0?{}:{min:e.min},...e.max===void 0?{}:{max:e.max}};case"choice":return{...a,input:"choice",choices:(e.options??[]).map(o=>t(e.name).option(o))};case"boolean":return{...a,input:"yes or no"};case"node":return{...a,input:"record",kinds:e.kinds};case"linked":return{...a,input:"record in another app"};case"file":return{...a,input:e.image?"picture":e.video?"video":"file"};case"repeat":return{...a,input:"how it repeats"};case"list":return{...a,input:`list of ${Y(r,e.item,t).input}`};case"group":return{...a,input:"group",fields:e.fields.map(o=>Y(r,o,t))};case"variant":return{...a,input:"one of",choices:e.options.map(o=>Z(o.value))};default:return{...a,input:"answer"}}}function Te(r,e,t){let s=Oe(r,e,t),n=r.schema,a=Me(n,t).filter(p=>p.name!==t.subject?.arg&&!s.has(p.name)),o=me(t);return{act:t.name,title:o,submit:o,fields:a.map(p=>Y(n,p,u=>ne(n,t,u)))}}function He(r,e){return{act:e.act.name,title:e.title,submit:e.submit,visitor:e.name,fields:e.fields.map(t=>Y(r,t,s=>ne(r,e.act,s)))}}function Ee(r,e,t){return r.permittedMutations(e).filter(s=>!s.derived&&!s.subject&&(s.creates??[]).includes(t))}function Le(r,e=""){let t=[`${e}Form "${r.title}" (${r.visitor?`the visitor form ${r.visitor}, running `:""}act ${r.act}), button "${r.submit}":`],s=(n,a)=>{for(let o of n){let p=o.choices?`${o.input}: ${o.choices.join(", ")}`:o.kinds?`${o.input} (${o.kinds.join(" or ")})`:o.input,u=o.min!==void 0||o.max!==void 0?`, ${o.min??"\u2026"} to ${o.max??"\u2026"}`:"";t.push(`${a}- ${o.label}${o.required?" *":""} (${o.name}) \u2014 ${p}${u}`),o.fields&&s(o.fields,`${a} `)}};return s(r.fields,`${e} `),r.fields.length===0&&t.push(`${e} (asks nothing)`),t}function Ue(r,e){let t=r.viewSpecs??{};return e.filter(s=>s.cardinality==="one"&&s.replaces==="page"&&(t[s.attach]?.page?.length??0)>0).map(s=>{let n=L(r.schema,s.attach,1);return{at:`views.${s.attach}.page`,says:`The view "${s.name}" replaces ${Ye(n)}'s page, so its page slot is never drawn: leave out replaces to draw the slot under the view, or draw what the slot says in the view.`}})}var Ye=r=>`${/^[aeiou]/i.test(r)?"an":"a"} ${r}`,Je=240,Ze=10,Qe=1160,et=40,_e=640,tt=3,nt=r=>Math.max(1,Math.floor((Math.min(r,Qe)-et+Ze)/(Je+Ze)));function rt(r,e,t,s){let{app:n}=s,a=s.width??1440,o=s.today??r.today()??de(n.brand?.timeZone),p=r.seenBy(e),u=p.schema,A=p.graph,R=Ge(n,s.views?{views:s.views}:{}),F=typeof t=="string"?t.trim():t.slug,M=typeof t=="string"?R.find(c=>c.slug===F||c.title===F||c.address===F):R.find(c=>c.slug===t.slug&&c.kind===t.kind)??t,x=!M&&typeof t=="string"?A.getNode(F):void 0,G=!M&&!x?/^\/?forms\/(.+)$/.exec(F)?.[1]:void 0,I=G!==void 0?Be(n,G):void 0;if(I)return{ok:!0,description:ot(u,I,a)};if(!M&&!x)return{ok:!1,error:`"${F}" is not a place this app has, nor a record this seat can see.`,places:[...R.map(c=>c.slug),...Object.keys(n.forms??{}).map(c=>`forms/${c}`)]};let l=[],w=n.viewSpecs??{},S=nt(a),k=(c,y)=>ie(p,null,c,{app:n,today:o,...y}),f=(c,y,g)=>{let m=u.tryDefinition(c.kind),D=K(m,c);if(y==="name")return{id:c.id,kind:c.kind,title:D,parts:[]};if(w[c.kind]?.[y]){let O=k(c,{slot:y}),[B,...h]=O,j=B?.t==="title"||y==="row"&&B?.t==="headline";return{id:c.id,kind:c.kind,title:j?B.text:D,parts:P(j?h:O,g,`views.${c.kind}.${y}`,` (${c.id})`,j?1:0)}}if(y==="row")return{id:c.id,kind:c.kind,title:D,parts:[]};let d=m?.computed?re(u,A,c):c,W=_(d,m,{limit:3,said:[D],glance:!0,locale:n.brand?.locale,timeZone:n.brand?.timeZone});return{id:c.id,kind:c.kind,title:D,parts:W.map(O=>({t:"text",text:O.alone}))}};function P(c,y,g,m="",D=0){let v=[];return c.forEach((d,W)=>{let O=`${g}.${W+D}`;switch("problem"in d&&d.problem&&l.push({at:`${O}${m}`,says:d.problem}),d.t){case"title":v.push({t:"heading",level:3,text:d.text});return;case"text":v.push({t:"text",text:d.markdown?Ae(d.text):d.runs?it(d.runs):d.text,...d.tone?{tone:d.tone}:{}});return;case"badge":v.push({t:"badge",text:d.text});return;case"field":case"image":v.push({t:"field",label:d.label,text:d.text});return;case"progress":v.push({t:"progress",label:d.label,text:d.text});return;case"group":v.push(...P(d.blocks,y,`${O}.group`,m));return;case"when":v.push(...P(d.blocks,y,`${O}.show`,m));return;case"divider":case"figure":return;case"headline":v.push({t:"heading",level:d.level,text:d.text});return;case"number":v.push({t:"figure",text:d.text,...d.label?{label:d.label}:{}});return;case"list":{if(d.failed){v.push({t:"text",text:"\u2014"});return}if(d.members.length===0){d.empty&&v.push({t:"list",as:d.as,columns:1,groups:[],empty:d.empty});return}let B=y+1,h=B>tt?"name":d.as,j=(d.groups??[{value:null,members:d.members}]).map(H=>({..."heading"in H&&H.heading?{heading:H.heading,count:(d.everyGroup?.find(J=>J.value===H.value)??H).members.length}:{},items:H.members.map(J=>f(J,h,B))}));v.push({t:"list",as:h,columns:h==="card"?S:1,groups:j,...d.more>0?{more:d.more}:{}});return}}}),v}let i=[],$,b,C,N=[];if(x){b="record";let c=u.tryDefinition(x.kind),y=K(c,x);C={slug:x.id,title:y,kind:x.kind,address:$e(u,x.kind,x.id)};let g=w[x.kind]?.page,m=s.views?.find(D=>D.attach===x.kind&&D.cardinality==="one");if(m&&i.push({t:"view",name:m.name,...m.title?{title:m.title}:{},...m.replaces==="page"?{replaces:!0}:{},...m.parts?{parts:m.parts}:{}}),m?.replaces==="page")b=`view:${m.name}`,l.push(...Ue(n,[m]));else{g&&i.push(...P(k(x,{slot:"page"}),1,`views.${x.kind}.page`));let D=c?.computed?re(u,A,x):x;for(let v of je(c,_(D,c,{said:[y],locale:n.brand?.locale,timeZone:n.brand?.timeZone}))){v.title&&i.push({t:"heading",level:2,text:v.title});for(let d of v.fields)i.push({t:"field",label:d.label,text:d.value,...d.long?{long:!0}:{},...d.markdown?{markdown:!0}:{}})}}}else{let c=M;C={slug:c.slug,title:c.title,kind:c.kind,address:c.address};let y=c.lens?ke(n).drawn.find(g=>g.as===c.slug&&(c.kind===null||g.kinds.includes(c.kind))):void 0;if(c.kind!==null&&y?.create!==!1&&c.view===void 0&&(N=Ee(r,e,c.kind).map(g=>Te(r,e,g))),c.view!==void 0&&!y){let g=s.views?.find(m=>m.name===c.view);b=`view:${c.view}`,i.push({t:"view",name:c.view,title:g?.title??c.title,...typeof g?.flows=="boolean"?{flows:g.flows}:{},...g?.parts?{parts:g.parts}:{}})}else if(c.kind===null){let g=n.brand,m=g?.name??n.name,D=we(g)?.light,v=D&&ye(D)?D:void 0;if($={name:m,...g?.subtitle&&g.subtitleDrawn!==!1?{subtitle:g.subtitle}:{},...v?{logo:{alt:g?.logoAlt??m,...he(v)?{drawn:"inline SVG"}:{drawn:"image",src:v}}}:{}},n.home)b="blocks",i=P(k(null,{}),0,"views.home");else{b="derived";let d=r.kindsKeptFrom(e),W=new Set([...n.pages?.hide??[],...d,...r.modules.disabledKinds]),O=xe(u.kinds,n.pages?.order).filter(B=>!W.has(B));i.push({t:"heading",level:1,text:n.name??"Home"});for(let B of O){let h=A.nodesOfKind(B).filter(j=>T(u.tryDefinition(B),j)).length;h>0&&i.push({t:"text",text:`${h} ${L(u,B,h)}`})}}}else if(y?.lens==="blocks")b="lens:blocks",i=P(k(null,{blocks:y.options.blocks??[]}),0,`lenses.${y.index}.options.blocks`);else if(y?.lens==="columns"){b="lens:columns";let g=y.options.bindings??{};for(let m of Object.keys(g)){let D=g[m]?.column;if(!D)continue;let v=E(u,m,D),d=U(A.nodesOfKind(m).filter(h=>T(u.tryDefinition(m),h)),y.options.sort,(h,j)=>j==="label"?K(u.tryDefinition(h.kind),h):h[j]);Object.keys(g).length>1&&i.push({t:"heading",level:2,text:L(u,m,2).replace(/^./,h=>h.toUpperCase())}),i.push({t:"text",text:`${d.length} ${L(u,m,d.length)} in columns by ${q(u.tryDefinition(m),D).toLowerCase()}.`});let W=v.map(h=>({column:h,items:d.filter(j=>X(j,D,v)===h.value).map(j=>f(j,"card",1))})).filter(({column:h,items:j})=>h.value!==null||j.length>0).map(({column:h,items:j})=>({heading:`${h.label} (${j.length})`,items:j}));i.push({t:"list",as:"card",columns:1,groups:W});let O=new Map;for(let h of d)for(let j of oe(r,e,h,D,v))O.set(j.to,(O.get(j.to)??new Set).add(`"${j.title}"`));let B=v.filter(h=>h.value!==null&&O.has(h.value)).map(h=>`to ${h.label} by ${[...O.get(h.value)].join(" or ")}`);i.push({t:"text",text:B.length>0?`Moves: ${B.join("; ")}.`:"Moves: none for this seat."})}}else if(y?.lens==="coverage")b="lens:coverage",i=We(u,A,y.options);else if(y){b=`lens:${y.lens}`;let g=y.kinds.flatMap(m=>A.nodesOfKind(m).filter(D=>T(u.tryDefinition(m),D)));i.push({t:"text",text:`A ${y.lens} of ${g.length} ${y.kinds.map(m=>L(u,m,g.length)).join(" and ")}.`}),i.push({t:"list",as:"name",columns:1,groups:[{items:g.map(m=>f(m,"name",1))}]})}else{b="derived";let g=A.nodesOfKind(c.kind).filter(m=>T(u.tryDefinition(c.kind),m));i.push({t:"heading",level:1,text:c.title}),g.length===0?i.push({t:"list",as:"row",columns:1,groups:[],empty:`No ${L(u,c.kind,0)} yet.`}):i.push({t:"list",as:"row",columns:1,groups:[{items:g.map(m=>f(m,"row",1))}]})}}let V=e.kind==="system"?"the system":(e.roles??[]).length>0?(e.roles??[]).join(", "):e.kind,qe=a<_e?"phone":"wide",le=C.kind===null?st(u,A):[],ce={...$?{masthead:$}:{},...le.length>0?{facts:le}:{},place:C,seat:V,width:a,variant:qe,drawnBy:b,parts:i,...N.length>0?{forms:N}:{},problems:l};return{ok:!0,description:{...ce,text:ae(ce)}}}function ot(r,e,t){let s=[{t:"heading",level:1,text:e.title},...e.intro?[{t:"text",text:e.intro}]:[]],n={place:{slug:`forms/${e.name}`,title:e.title,kind:null,address:`/forms/${e.name}`},seat:`a visitor (${e.role})`,width:t,variant:t<_e?"phone":"wide",drawnBy:"form",parts:s,forms:[He(r,e)],problems:[]};return{...n,text:ae(n)}}function st(r,e){let t=Re(r,e,null),s=n=>Array.isArray(n)?n.map(s).join(", "):n===null?"nothing":typeof n=="boolean"?n?"yes":"no":typeof n=="object"?n.label:String(n);return[...Se(r)].map(([n,a])=>{let o=a.label??Z(n);return Object.hasOwn(t.values,n)?{name:n,label:o,value:s(t.values[n])}:{name:n,label:o,refused:t.refused[n]??"it could not be worked out"}})}function L(r,e,t){let s=r.tryDefinition(e);if(t===1)return s?.noun??e;let n=pe(r,e);return ue(n)}function ae(r){let e=[`${r.place.title} (${r.place.address}) \u2014 as ${r.seat}, ${r.width} wide (${r.variant}).`],t=r.masthead;t&&e.push(`Masthead: ${t.logo?`the logo ("${t.logo.alt}", ${t.logo.drawn==="image"?t.logo.src:"inline SVG"}), `:""}${t.name}${t.subtitle?` \u2014 ${t.subtitle}`:""}`);let s=(n,a)=>{for(let o of n)switch(o.t){case"heading":e.push(`${a}${"#".repeat(o.level)} ${o.text}`);break;case"text":e.push(`${a}${o.text}`);break;case"badge":e.push(`${a}[${o.text}]`);break;case"field":case"progress":e.push(`${a}${o.label}: ${o.text}`);break;case"figure":e.push(`${a}${o.text}${o.label?` \u2014 ${o.label}`:""}`);break;case"list":if(o.groups.length===0){o.empty&&e.push(`${a}(${o.empty})`);break}for(let p of o.groups){p.heading&&e.push(`${a}${p.heading}${p.count!==void 0?` (${p.count})`:""}:`);for(let u of p.items)e.push(`${a}${p.heading?" ":""}- ${u.title}`),s(u.parts,`${a}${p.heading?" ":" "}`)}o.as==="card"&&o.columns>1&&e.push(`${a}(cards, ${o.columns} across)`),o.more&&e.push(`${a}and ${o.more} more`);break;case"view":e.push(`${a}[the view "${o.title??o.name}"${o.replaces?", in place of the page":""}${o.flows===!0?", flowing with the page":o.flows===!1?", in a frame of its own":""}]`),o.parts&&s(o.parts,`${a} `);break}};s(r.parts,"");for(let n of r.forms??[])e.push(...Le(n));if(r.facts){e.push("Facts of the whole graph (what fact('<name>') reads):");for(let n of r.facts)e.push(`- ${n.label} (${n.name}): ${n.value??`not worked out \u2014 ${n.refused}`}`)}if(r.problems.length>0){e.push("Problems:");for(let n of r.problems)e.push(`- ${n.at}: ${n.says}`)}return e.join(`
|
|
2
|
+
`)}function it(r){return r.map((e,t)=>(t===0?"":e.field===void 0&&r[t-1].field===void 0?" \xB7 ":" ")+e.text).join("")}export{E as a,X as b,oe as c,Ie as d,Ne as e,Ve as f,Ke as g,ie as h,Ue as i,rt as j,ae as k};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as $}from"./chunk.
|
|
1
|
+
import{e as $}from"./chunk.EYSQPXVE.js";import{a as C}from"./chunk.3NEALGMI.js";import{l as M}from"./chunk.GRLPNTUW.js";import{da as k,ea as v,ga as j,xb as x}from"./chunk.PFEKS3KO.js";function N(a,s){let c=a.tryDefinition(s),r=Object.keys(c?.fields?.shape??{}),m=[c?.lifecycle?.field,...r.filter(l=>/^(status|stage|state|phase)$/i.test(l))].filter(l=>l!==void 0&&r.includes(l));return[...new Set(m)].slice(0,1)}function P(a,s){return a.tryDefinition(s)?.fieldRoles?.title??"label"}function V(a,s,c={}){let r=s.map(e=>a.graph.getNode(e)).filter(e=>e!==void 0);if(r.length===0)return{acts:[],withheld:[]};let u=c.principal??{kind:"human"},m=C(a,r.map(e=>e.id),{...c.derive,principal:u,...c.context?{context:c.context}:{}}),l=new Map(a.allMutations().map(e=>[e.name,e])),g=[...new Set(r.map(e=>e.kind))],p=new Set(g.map(e=>P(a.schema,e))),h=new Set(m.affordances.filter(e=>e.provider==="schema").map(e=>e.mutation)),o=e=>{let n=l.get(e.mutation);if(!n?.subject)return;let t=r.length===1&&e.provider==="invariant"&&!h.has(e.mutation)&&e.args[n.subject.arg]===r[0].id;if(!(e.provider!=="schema"&&!t)&&!(r.length>1&&e.batch?.length!==r.length)&&n.derived?.act!=="edit"&&!e.open.some(i=>p.has(i.name)))return n},y=[],b=new Set;for(let e of m.affordances){let n=o(e);if(!n||b.has(n.name))continue;b.add(n.name);let{[n.subject.arg]:t,...i}=e.args;y.push({id:e.id,label:v(n),mutation:n.name,subject:n.subject.arg,args:i,open:e.open,...e.destructive||e.setsAside?{more:!0}:{},...e.destructive?{destructive:!0}:{},affordance:{...e,label:v(n)}})}if(g.length===1){let e=g[0];for(let n of N(a.schema,e))for(let t of $(a.schema,[...l.values()],e,n)){if(t.by==="none"||r.every(d=>d[n]===t.value))continue;let i=r.find(d=>d[n]!==t.value),f=t.acts.find(d=>{let D=t.by==="step"?{[d.subject.arg]:i.id}:{[d.subject.arg]:i.id,[n]:t.value};return a.permits({name:d.name,args:D},u).ok});if(!f)continue;let w=t.by==="step"?{}:{[n]:t.value};if(t.by==="step"&&y.some(d=>d.mutation===f.name))continue;let R=t.by==="step"?v(f):`Move to ${t.label}`,O=`set:${n}:${t.value}`;y.push({id:O,label:R,mutation:f.name,subject:f.subject.arg,args:w,open:[],affordance:{id:O,label:R,provider:"schema",mutation:f.name,args:{[f.subject.arg]:i.id,...w},open:[],score:0,why:`every one is ${e}`,nodeIds:r.map(d=>d.id)}})}}let S=[...y.filter(e=>!e.more),...y.filter(e=>e.more)],A=m.withheld.filter(e=>{let n=l.get(e.mutation);return n?.subject!==void 0&&n.derived?.act!=="edit"&&(r.length===1||e.batch?.length===r.length)}).map(e=>({label:v(l.get(e.mutation)),message:e.refusal.message}));return{acts:S,withheld:A}}function _(a,s,c,r={}){let u=r.author,m=a.allMutations().find(e=>e.name===s.mutation),l=e=>M(a.schema,a.allMutations(),e),g=e=>{let n=a.graph.getNode(e);return n?k(a.schema.tryDefinition(n.kind),n):e},p=[],h=[],o=[];for(let e of[...new Set(c)]){let n={name:s.mutation,args:{...s.args,[s.subject]:e}};if(!m){p.push({id:e,label:g(e),message:`There is no act \u201C${s.mutation}\u201D.`,reason:"invalid"});continue}let t=a.permits(n,u);if(!t.ok){p.push({id:e,label:g(e),message:t.refusal.message,reason:"forbidden"});continue}if(!a.wouldChange(n,u)){h.push(e);continue}o.push({id:e,call:n})}let y=e=>a.previewAll(e,{...u?{author:u}:{},...r.context?{context:r.context}:{}});for(let e=0;o.length>0;e+=1)try{y(o.map(n=>n.call));break}catch(n){let t=[];for(let i of o)try{y([i.call]),t.push(i)}catch(f){p.push({id:i.id,label:g(i.id),message:l(f),reason:x(f).reason})}if(t.length===o.length||e>o.length){for(let i of t)p.push({id:i.id,label:g(i.id),message:l(n),reason:x(n).reason});o=[];break}o=t}if(o.length===0)return{applied:[],unchanged:h,refused:p};let b=s.label??(m?v(m):s.mutation),S=[...new Set(o.map(e=>a.graph.getNode(e.id)?.kind))],A=`${b} \u2014 ${S.length===1&&S[0]?j(a.schema,S[0],o.length):`${o.length} records`}`;try{let e=a.applyAll(o.map(n=>n.call),{intent:A,...u?{author:u}:{},...r.via?{via:r.via}:{}});return{batch:e.batch,intent:A,applied:o.map(n=>n.id),unchanged:h,refused:p,result:e}}catch(e){let n=l(e),t=x(e).reason;return{applied:[],unchanged:h,refused:[...p,...o.map(i=>({id:i.id,label:g(i.id),message:n,reason:t}))],allOrNothing:!0}}}export{V as a,_ as b};
|
|
@@ -0,0 +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{Da as o,G as k,R as n}from"./chunk.TM6JVVGW.js";import{a as t}from"./chunk.SDO3U72B.js";import{b as p}from"./chunk.AJZBJBMO.js";var f=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.WVUJXDXZ.js","./chunk.NQDGUIUQ.js","./chunk.DTRNDSMS.js","./chunk.3EW6L5DY.js","./chunk.AVDXG57A.js","./chunk.LD6S2FL5.js","./chunk.TABIRLQS.js","./chunk.GZHZLJBF.js","./chunk.FOYVTN5B.js","./chunk.OJGHDWI6.js","./chunk.OTF3NNTI.js","./chunk.A7HMVWMG.js","./chunk.GRLPNTUW.js","./chunk.EJAVIZ7Y.js","./chunk.423SZS7C.js","./chunk.TM6JVVGW.js","./chunk.SDO3U72B.js","./chunk.PFEKS3KO.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.YXOJKGRC.js")))),y=f.part((e,r)=>e.drawFiles(r),{quiet:!0});var d=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.GZHZLJBF.js","./chunk.FOYVTN5B.js","./chunk.OJGHDWI6.js","./chunk.OTF3NNTI.js","./chunk.A7HMVWMG.js","./chunk.GRLPNTUW.js","./chunk.EJAVIZ7Y.js","./chunk.423SZS7C.js","./chunk.TM6JVVGW.js","./chunk.SDO3U72B.js","./chunk.PFEKS3KO.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.XJ7YGW6Y.js")))),I=d.part((e,r)=>e.drawLinkedRecord(r),{quiet:!0}),w=d.part((e,r)=>e.drawLinkedPicker(r),{what:"Picking a linked record"});var s=p(n(),1),m=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.GZHZLJBF.js","./chunk.FOYVTN5B.js","./chunk.OJGHDWI6.js","./chunk.OTF3NNTI.js","./chunk.A7HMVWMG.js","./chunk.GRLPNTUW.js","./chunk.EJAVIZ7Y.js","./chunk.423SZS7C.js","./chunk.TM6JVVGW.js","./chunk.SDO3U72B.js","./chunk.PFEKS3KO.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.4OTESF7W.js")))),E=m.part((e,r)=>(0,s.jsx)(e.RepeatPicker,{...r}),{quiet:!0}),W=m.part((e,r)=>(0,s.jsx)(e.RepeatEditor,{...r}),{quiet:!0});var a=p(k(),1),i=p(n(),1),c=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.A7HMVWMG.js","./chunk.GRLPNTUW.js","./chunk.EJAVIZ7Y.js","./chunk.423SZS7C.js","./chunk.TM6JVVGW.js","./chunk.SDO3U72B.js","./chunk.PFEKS3KO.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.PCVU3LY3.js")))),l=c.part((e,r)=>(0,i.jsx)(e.WhenInput,{...r}),{quiet:!0});function M(e){return(0,i.jsx)(a.Suspense,{fallback:(0,i.jsx)("span",{"data-graview-when-arriving":"",style:{display:"inline-block",minHeight:24}}),children:(0,i.jsx)(l,{...e})})}var N=()=>c.load().then(()=>{},()=>{});export{y as a,I as b,w as c,E as d,W as e,M as f,N as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as O}from"./chunk.OJGHDWI6.js";import{
|
|
1
|
+
import{l as O}from"./chunk.OJGHDWI6.js";import{j as C}from"./chunk.GRLPNTUW.js";import{$ as I,G as x,Ia as G,R as M,_ as w,aa as W,c as V,x as B}from"./chunk.TM6JVVGW.js";import{C as D,Cc as _,Dc as L,Jc as j,Kb as F,Vb as N}from"./chunk.PFEKS3KO.js";import{b as m}from"./chunk.AJZBJBMO.js";function H(t,e){let n=t.graph.getNode(e);if(!n)return[];let i=n.kind,a=t.schema.tryDefinition(i);if(!a)return[];let c=t.seenFor,u=c?j.keptFrom?.(t,c)?.(n):void 0,o=new Map;for(let r of t.allMutations()){let s=r.subject;if(!s||!(s.kinds==="*"||s.kinds.includes(i)))continue;let l=r.input.shape??{};for(let d of N(r,a)){if(u?.(d))continue;let b=d in l,k=[];for(let h of Object.keys(l)){if(h===s.arg||h===d||X(l[h]))continue;let v=F(r.input).find(S=>S.name===h);k.push({name:h,...v?{kinds:v.kinds}:{},...v?{candidates:v.kinds.includes("*")?t.graph.allNodes().map(S=>S.id):v.kinds.flatMap(S=>t.graph.nodesOfKind(S).map(J=>J.id))}:{},shape:C(r.input,h)})}let Q={field:d,mutation:r.name,title:r.title??r.name,shape:b?C(r.input,d):{type:"unknown"},takesValue:b,alternatives:[],open:k,call:h=>({name:r.name,args:b?{[s.arg]:e,[d]:h}:{[s.arg]:e}})};o.set(d,[...o.get(d)??[],Q])}}return[...o.values()].map(r=>{let s=[...r.filter(d=>d.takesValue),...r.filter(d=>!d.takesValue)],[f,...l]=s;return{...f,alternatives:l}})}function X(t){let e=D(t)?.type;return e==="optional"||e==="default"||e==="nullable"}var R=m(x(),1);function be(t){let{store:e,principal:n}=w(),i=W(),a=(0,R.useMemo)(()=>t===null?[]:H(e,t),[e,t,i]),c=(0,R.useCallback)((u,o,r={})=>{let s=u.call(o);e.apply({name:s.name,args:{...s.args,...r}},{author:n})},[e,n]);return{fields:a,commit:c}}var K=m(x(),1);function Qe(){let{brand:t}=w(),e=t?.kit;return(0,K.useMemo)(()=>_(e),[e])}function Je(t,e){let n=L(t,e),i={...n.color!==void 0?{color:n.color}:{},...n.pattern!==void 0?{pattern:n.pattern}:{},...n.width!==void 0?{width:n.width}:{},...n.cap!==void 0?{cap:n.cap}:{},...n.opacity!==void 0?{opacity:n.opacity}:{}};return{connector:n,style:O(e,{[e]:i})}}var $=m(x(),1);var g=m(M(),1);function Z(t){let e=t?.hint;return typeof e=="string"&&e.length>0?e:void 0}function ee(t){if(t instanceof Error&&t.message)return t.message;let e=String(t);return e==="[object Object]"?"The view threw without a message.":e}var U=class extends $.Component{static contextType=G;state={};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,n){console.error(`[graview] the ${this.props.view??"view"} of ${this.props.kind} threw while rendering`,e,n.componentStack),this.context?.(e,{module:"@graview/react"})}render(){let{error:e}=this.state;if(!e)return this.props.children;let n=Z(e);return(0,g.jsxs)("div",{role:"alert","data-graview-view-error":this.props.kind,style:{display:"flex",flexDirection:"column",gap:"0.375rem",padding:"var(--graview-pad, 12px)",height:"100%",overflow:"auto",boxSizing:"border-box",borderRadius:"var(--graview-radius-sm, 6px)",background:"var(--graview-panel-warning, #fdf3ec)",color:"var(--graview-ink, #1a1a1a)",font:"var(--graview-font-body, 13px/1.45 system-ui)",fontSize:"0.875rem",lineHeight:1.45},children:[(0,g.jsx)("strong",{style:{color:"var(--graview-warn, #b4462a)"},children:this.props.view?`${this.props.view} could not draw`:"This view could not draw"}),(0,g.jsx)("span",{style:{color:"var(--graview-ink-muted, #555)"},children:this.props.kind}),(0,g.jsx)("span",{children:ee(e)}),n?(0,g.jsx)("span",{style:{color:"var(--graview-ink-muted, #555)"},children:n}):null]})}};var y=m(x(),1);var q=m(M(),1),A=(0,y.createContext)([]);function nt({sections:t,children:e}){let n=(0,y.useContext)(A),i=(0,y.useMemo)(()=>[...n,...t.filter(a=>!n.includes(a))],[n,t]);return(0,q.jsx)(A.Provider,{value:i,children:e})}function z(){let t=(0,y.useContext)(A),e=I()?.menuSections;return(0,y.useMemo)(()=>e?[...t,...e.filter(n=>!t.includes(n))]:t,[t,e])}function rt(){let t=z();return(0,y.useCallback)(e=>{for(let n of t)try{n(e)?.prepare?.()}catch{}},[t])}function ot(t){let e=z();if(t===null||e.length===0)return{start:[],end:[]};let n=e.flatMap(i=>{try{let a=i(t);return a&&((a.items?.length??0)>0||a.render)?[a]:[]}catch{return[]}});return{start:n.filter(i=>i.at==="start"),end:n.filter(i=>i.at!=="start")}}var te=m(x(),1);function st(){return w().activity}var P=(t,e)=>t.length*e*.58;var ne=156,re=2,E=ne-18,oe=7.1,ie=16;function ae(t,e){let n=0,i=E;for(let a of t.split(" ")){let c=e(a),u=i+e(" ")+c;if(u<=E)i=u;else{let o=Math.ceil(c/E)||1;n+=o,i=c-(o-1)*E}}return n}var se=16.25,Y=27,ce=(t,e)=>{let n=Math.ceil(t.length*oe/E);return e?Math.max(Y,Math.ceil(Math.max(n,ae(t,e))*se)+6):Math.max(Y,n*ie+6)};function ut(t,e,n){return t.length===0?0:10+t.reduce((i,a)=>i+ce(a,n),0)+(t.length-1)*re}var de=27,ue=8,lt=4,le=64,pt=t=>Math.max(1,Math.min(ue,t)),ft=t=>t*de+le;var p=m(x(),1);function gt(t,{units:e,target:n=0,legibleAt:i=260}){let[a,c]=(0,p.useState)(e);(0,p.useEffect)(()=>{let o=t.current;if(o===null||typeof ResizeObserver>"u")return;let r=new ResizeObserver(([s])=>{let f=s?.contentRect.width??0;f>0&&c(f)});return r.observe(o),()=>r.disconnect()},[t]);let u=a/e;return{scale:u,width:a,touchable:u*n>=24,legible:a>=i}}function xt(t="--graview-font-body",e="sans-serif"){let n=(0,p.useRef)(void 0),i=(0,p.useMemo)(()=>{if(typeof getComputedStyle!="function"||typeof document>"u")return e;let a=getComputedStyle(document.documentElement).getPropertyValue(t).trim();return a.length>0?a:e},[t,e]);return(0,p.useMemo)(()=>{n.current===void 0&&(n.current=typeof document>"u"?null:document.createElement("canvas").getContext("2d")??null);let a=n.current;return a===null?P:(c,u)=>{a.font=`${u}px ${i}`;let o=a.measureText(c).width;return o>0?o:P(c,u)}},[i])}var wt=(0,p.createContext)(void 0);var T=3;function pe(t){let e=V(t),n=e.focusId;if(!n)return null;if(e.within?.view){let[a]=B(n);if(a)return{at:`screen:${a}`,audience:!0}}return{at:n,audience:!1}}var fe=102,me=32;function St(t,e,n){let i=[],a=new Map,c=new Map,u=0;for(let o of t){let r=pe(o.stop),s=r?e(r.at):null;if(!r||!s){o.name&&i.push({kind:"edge",presence:o,point:{x:n-8,y:fe+u++*me}});continue}if(!o.name){let k=c.get(r.at);c.set(r.at,{n:(k?.n??0)+1,box:s});continue}let f=a.get(r.at)??[];if(f.push(o),a.set(r.at,f),f.length>T)continue;let l=s,d=f.length-1,b=r.audience?{x:l.x+l.width*.5+(d-1)*26,y:l.y+Math.min(l.height,24)}:{x:l.x+l.width*.5-26-d*26,y:l.y+l.height-4};i.push({kind:"person",presence:o,point:b,at:r.at,index:d,of:f.length,audience:r.audience})}for(let[o,r]of a){if(r.length<=T)continue;let s=e(o);s&&i.push({kind:"count",at:o,point:{x:s.x+s.width*.5+2*26+18,y:s.y+s.height-4},n:r.length-T})}for(let[o,{n:r,box:s}]of c)i.push({kind:"count",at:o,point:{x:s.x+s.width*.5+40,y:s.y+s.height-4},n:r});for(let o of t)if(o.name){if(o.robot?.at&&o.robot.mode!=="docked"){let r=e(o.robot.at);r&&i.push({kind:"robot",presence:o,point:{x:r.x+r.width/2+22,y:r.y+r.height-4},mode:o.robot.mode})}if(o.over){let r=e(o.over);r&&i.push({kind:"over",presence:o,box:r})}}return i}export{st as a,P as b,ne as c,re as d,Y as e,ut as f,de as g,lt as h,le as i,pt as j,ft as k,gt as l,xt as m,be as n,Qe as o,Je as p,St as q,U as r,nt as s,rt as t,ot as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as c}from"./chunk.
|
|
1
|
+
import{e as c}from"./chunk.BVXOLZQ3.js";import{Zb as m}from"./chunk.PFEKS3KO.js";function k(e){let n=e.policy?.sees??[];return n.length===0?!0:e.schema.kinds.every(r=>n.some(o=>o.roles==="*"&&!o.own&&!o.via&&o.kinds.includes(r)))}function A(e){let n=e;for(let r=0;r<8&&n?._zod?.def;r+=1){let o=n._zod.def;if(o.type==="enum")return Object.values(o.entries);if(o.type==="literal")return o.values;if(!("innerType"in o))return;n=o.innerType}}var h=(e,n)=>({ok:!1,reason:e,message:n});function b(e,n){return c(e).find(r=>(r.as??r.act)===n)??c(e).find(r=>r.act===n&&r.as===void 0)}var w=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&"href"in e;function S(e,n,r,o,f){let l=b(n,r);if(!l)return h("undeclared",`This view may not ask for \u201C${r}\u201D: its manifest does not name it.`);let u={},g=0;for(let[y,i]of Object.entries(o)){let d=a=>{if(!w(a))return a;let s=typeof a.href=="string"?f?.file(a.href):void 0;if(!s)throw h("malformed",`\u201C${y}\u201D is a file the host did not hand this view: a view hands an act a file the person dropped (event.files), or one a record it was shown holds, as it was handed.`);return f?.dropped(s.href)&&(g+=1),s};try{u[y]=Array.isArray(i)?i.map(d):d(i)}catch(a){return a}}if(!k(e)){let i=e.allMutations().find(s=>s.name===l.act)?.input?.shape??{},d=(s,t)=>w(t)&&typeof t.href=="string"&&f?.dropped(t.href)===!0||m(t)||typeof t=="string"&&f?.shown.has(t)===!0||(A(i[s])?.some(p=>p===t)??!1);if(!(g>0&&Object.entries(u).every(([s,t])=>Array.isArray(t)?t.every(p=>d(s,p)):d(s,t))))return h("press-only","In this app some members may not see some records, so a view's act applies only when you press it.")}return{ok:!0,name:l.act,args:{...u,...l.constants??{}}}}export{k as a,A as b,h as c,b as d,S as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}from"./chunk.GEY4MA4D.js";import"./chunk.G4JJXA63.js";import"./chunk.NQ7SRWXA.js";import"./chunk.AOEXSQDG.js";import"./chunk.PBCT33FF.js";import"./chunk.XOZU4OFA.js";import"./chunk.35FUGOSG.js";import"./chunk.Q5WEOX3Q.js";import"./chunk.JBG5UQLM.js";import"./chunk.54PZWX23.js";import"./chunk.D4K23FUB.js";import"./chunk.WVUJXDXZ.js";import"./chunk.NQDGUIUQ.js";import"./chunk.DTRNDSMS.js";import"./chunk.3EW6L5DY.js";import"./chunk.AVDXG57A.js";import"./chunk.LD6S2FL5.js";import"./chunk.TABIRLQS.js";import"./chunk.A7HMVWMG.js";import"./chunk.GRLPNTUW.js";import"./chunk.EJAVIZ7Y.js";import"./chunk.PFEKS3KO.js";import"./chunk.2AZTW66C.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
|
-
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 t}from"./chunk.SDO3U72B.js";var d=t(()=>(__graviewPreload(import.meta.url,["./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{a as t}from"./chunk.SDO3U72B.js";var d=t(()=>(__graviewPreload(import.meta.url,["./chunk.OS75HEZP.js","./chunk.KVEDMKUN.js","./chunk.BRDAO2OF.js","./chunk.FUMQLGNM.js","./chunk.BVXOLZQ3.js","./chunk.KDTNKKOY.js","./chunk.BBLIT7S7.js","./chunk.H42WBU5C.js","./chunk.PXQVXBNG.js","./chunk.G446PWV6.js","./chunk.SDO3U72B.js","./chunk.PFEKS3KO.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.KJBXNMIU.js")));function v(i,r){let e=!1,n=()=>{window.removeEventListener("online",n),e||o()},o=()=>void i().then(m=>{e||r(m)},()=>{e||window.addEventListener("online",n)});return o(),()=>{e=!0,window.removeEventListener("online",n)}}export{d as a,v as b};
|