graview 0.1.50 → 0.1.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/preview/{chunk.V5IWJ3ZV.js → chunk.2534FLZZ.js} +1 -1
- package/dist/preview/{chunk.QSZLY62B.js → chunk.2VJ52LGS.js} +1 -1
- package/dist/preview/{chunk.U2M4SGUU.js → chunk.2W2YVB6X.js} +1 -1
- package/dist/preview/{chunk.ECSWXLBI.js → chunk.2W45NM7Q.js} +2 -2
- package/dist/preview/chunk.32BOL7OL.js +1 -0
- package/dist/preview/chunk.34HGT7HQ.js +1 -0
- package/dist/preview/{chunk.YUV7HZYG.js → chunk.353CGK6C.js} +1 -1
- package/dist/preview/{chunk.64TFAR5Z.js → chunk.3H7YIKKC.js} +1 -1
- package/dist/preview/{chunk.Q7RI4SI4.js → chunk.3MU37W5D.js} +1 -1
- package/dist/preview/chunk.3SBTQ66X.js +1 -0
- package/dist/preview/{chunk.L5MDUZLQ.js → chunk.3TVAE7LE.js} +1 -1
- package/dist/preview/{chunk.ETX4QMM2.js → chunk.4EZFOZBA.js} +1 -1
- package/dist/preview/chunk.4N5R4K6O.js +1 -0
- package/dist/preview/{chunk.KGGWFL54.js → chunk.4T67XS2D.js} +1 -1
- package/dist/preview/chunk.5ON3JSAK.js +1 -0
- package/dist/preview/{chunk.YEKHDZ45.js → chunk.5ZAK57JA.js} +2 -2
- package/dist/preview/chunk.6KYWJXZR.js +1 -0
- package/dist/preview/{chunk.BJAQRV2R.js → chunk.76QSPWSJ.js} +1 -1
- package/dist/preview/{chunk.3SY6WWWQ.js → chunk.7G4M2PX3.js} +2 -2
- package/dist/preview/{chunk.XWLGHTH6.js → chunk.7GAC7U34.js} +1 -1
- package/dist/preview/{chunk.GDYI5QDS.js → chunk.7NQROWHU.js} +1 -1
- package/dist/preview/{chunk.LGHMUUTG.js → chunk.7RIFDWDF.js} +1 -1
- package/dist/preview/{chunk.MQISKON2.js → chunk.ACB4TD4W.js} +1 -1
- package/dist/preview/chunk.AJAMTRZ3.js +1 -0
- package/dist/preview/chunk.AL45OI4A.js +1 -0
- package/dist/preview/{chunk.WGRF6EHC.js → chunk.AL7LFNOS.js} +1 -1
- package/dist/preview/{chunk.ZBBCUK2K.js → chunk.ALCH5H7U.js} +1 -1
- package/dist/preview/{chunk.UOC3SIYT.js → chunk.APFRPN5S.js} +1 -1
- package/dist/preview/{chunk.ODHCSYXX.js → chunk.AZOW57MT.js} +1 -1
- package/dist/preview/chunk.B4PUI3GO.js +1 -0
- package/dist/preview/chunk.B6LKLV32.js +1 -0
- package/dist/preview/{chunk.UDTBFAS5.js → chunk.B7LBG4UP.js} +1 -1
- package/dist/preview/{chunk.YCJ74LZS.js → chunk.BV6HKTHK.js} +1 -1
- package/dist/preview/{chunk.UN2OB6OD.js → chunk.BYY7YXBI.js} +1 -1
- package/dist/preview/{chunk.7QW6JYGP.js → chunk.CI4DEKPX.js} +1 -1
- package/dist/preview/{chunk.ZOQ3OKKI.js → chunk.CMEETACI.js} +1 -1
- package/dist/preview/{chunk.O6SKKF4V.js → chunk.CQPNDJAC.js} +1 -1
- package/dist/preview/{chunk.FFPG4PHX.js → chunk.CTOBNZLM.js} +1 -1
- package/dist/preview/chunk.CUB4IAUJ.js +1 -0
- package/dist/preview/chunk.CUN4VN42.js +1 -0
- package/dist/preview/chunk.CV55N3Y6.js +1 -0
- package/dist/preview/{chunk.M55U47A6.js → chunk.CXC5FOIO.js} +1 -1
- package/dist/preview/{chunk.DUJUJN35.js → chunk.DEH6O3K4.js} +1 -1
- package/dist/preview/chunk.DQNN5FE5.js +1 -0
- package/dist/preview/{chunk.4SHSEIHT.js → chunk.DUY27OJV.js} +1 -1
- package/dist/preview/chunk.E2R6VFZX.js +1 -0
- package/dist/preview/{chunk.KZ3UPV2L.js → chunk.EA2NMVRE.js} +1 -1
- package/dist/preview/chunk.ESK3UZRC.js +1 -0
- package/dist/preview/{chunk.IMFAPZ6J.js → chunk.ESSENNHM.js} +2 -2
- package/dist/preview/{chunk.5DZR46YG.js → chunk.ET3XJDPX.js} +1 -1
- package/dist/preview/chunk.FEIJ7ETK.js +1 -0
- package/dist/preview/{chunk.4XOSDCCE.js → chunk.FFCUZPTC.js} +1 -1
- package/dist/preview/chunk.FG5ZFYYL.js +1 -0
- package/dist/preview/{chunk.KFHXTHIY.js → chunk.FKJ3HIA5.js} +1 -1
- package/dist/preview/chunk.FTBH7CPZ.js +1 -0
- package/dist/preview/{chunk.LDE5HLTM.js → chunk.FU4YSVWX.js} +1 -1
- package/dist/preview/{chunk.A53G42QO.js → chunk.FYDDFOSD.js} +1 -1
- package/dist/preview/{chunk.ETWREHXF.js → chunk.GJQF7I22.js} +1 -1
- package/dist/preview/{chunk.6SHF6IL5.js → chunk.GLTWLQ6L.js} +1 -1
- package/dist/preview/chunk.GMAXA5GV.js +1 -0
- package/dist/preview/{chunk.SRU2YDTJ.js → chunk.GRYS6VSF.js} +1 -1
- package/dist/preview/{chunk.ZK446PSX.js → chunk.GYTVL6GR.js} +3 -3
- package/dist/preview/chunk.HASVT7IC.js +1 -0
- package/dist/preview/{chunk.RK6BK5FD.js → chunk.HFKGND5Q.js} +1 -1
- package/dist/preview/{chunk.JJP5OL5E.js → chunk.HVX7LFWR.js} +1 -1
- package/dist/preview/chunk.IBJBCZKG.js +1 -0
- package/dist/preview/{chunk.CDZVUCEK.js → chunk.IE4ZJQV3.js} +1 -1
- package/dist/preview/chunk.IFL2MYTQ.js +1 -0
- package/dist/preview/{chunk.F7AFJRPP.js → chunk.IUIDDNN3.js} +1 -1
- package/dist/preview/{chunk.RXJBYP7B.js → chunk.JBR66TUP.js} +1 -1
- package/dist/preview/chunk.JG2FGZF2.js +18 -0
- package/dist/preview/{chunk.7VX6TBNY.js → chunk.JI2UVZUU.js} +1 -1
- package/dist/preview/{chunk.OB7XLVK6.js → chunk.JMDKAP23.js} +1 -1
- package/dist/preview/{chunk.IDQHSAAQ.js → chunk.JX2C3HVD.js} +1 -1
- package/dist/preview/{chunk.FKUVIG6D.js → chunk.K7ECYKZL.js} +1 -1
- package/dist/preview/{chunk.UGJ32SEL.js → chunk.K7RKWB2K.js} +1 -1
- package/dist/preview/{chunk.S64LCR23.js → chunk.KK46XLGU.js} +1 -1
- package/dist/preview/chunk.KOBCLWPC.js +1 -0
- package/dist/preview/chunk.KRODTMGR.js +1 -0
- package/dist/preview/chunk.KYKHZZT7.js +1 -0
- package/dist/preview/chunk.LYIHPVDZ.js +1 -0
- package/dist/preview/{chunk.JLPBXG4P.js → chunk.MG3DMURZ.js} +1 -1
- package/dist/preview/{chunk.YG3BLY67.js → chunk.MMVCZOEX.js} +1 -1
- package/dist/preview/{chunk.BBNF52IB.js → chunk.MN6WHE4B.js} +1 -1
- package/dist/preview/{chunk.UJTRKSCK.js → chunk.MRXQBEPQ.js} +1 -1
- package/dist/preview/{chunk.NB6WN4DO.js → chunk.MX3Y3LPH.js} +1 -1
- package/dist/preview/{chunk.LJXAZ5TF.js → chunk.MY5OXSS7.js} +1 -1
- package/dist/preview/chunk.N5XONWU2.js +1 -0
- package/dist/preview/chunk.NNUUD26E.js +1 -0
- package/dist/preview/{chunk.ZITDUHX3.js → chunk.NQ26KMSQ.js} +1 -1
- package/dist/preview/{chunk.QFI4L2HK.js → chunk.NVRK6A7T.js} +1 -1
- package/dist/preview/{chunk.DUIKIJKC.js → chunk.NZDHXREL.js} +1 -1
- package/dist/preview/chunk.OHDJYGH7.js +2 -0
- package/dist/preview/{chunk.GZEZMU2T.js → chunk.OJ64WTLW.js} +2 -2
- package/dist/preview/{chunk.OUNLAMBA.js → chunk.OPCBZNKF.js} +1 -1
- package/dist/preview/{chunk.UCS3CBT4.js → chunk.OU5TRY4N.js} +1 -1
- package/dist/preview/chunk.OW72XZF4.js +1 -0
- package/dist/preview/chunk.P4CLT32V.js +5 -0
- package/dist/preview/chunk.PFXGWY3P.js +1 -0
- package/dist/preview/{chunk.GPJFNLEJ.js → chunk.PMV6XVVZ.js} +1 -1
- package/dist/preview/{chunk.2P66HH5Y.js → chunk.PPZ2TOB5.js} +1 -1
- package/dist/preview/{chunk.JC5NXMG3.js → chunk.PYRJDTVS.js} +1 -1
- package/dist/preview/chunk.QEQQXWYU.js +1 -0
- package/dist/preview/chunk.QPAJCRFB.js +1 -0
- package/dist/preview/chunk.R5R7CLOU.js +1 -0
- package/dist/preview/{chunk.SWLDDQJS.js → chunk.RMMJQYJJ.js} +1 -1
- package/dist/preview/{chunk.FDFVGHQE.js → chunk.RNOBACJ6.js} +1 -1
- package/dist/preview/{chunk.4BQNG3W3.js → chunk.S32AGJ3W.js} +1 -1
- package/dist/preview/chunk.S4CKKT3C.js +1 -0
- package/dist/preview/{chunk.KOPRZLJH.js → chunk.SJKHVIHA.js} +2 -2
- package/dist/preview/chunk.SJYQ72EC.js +1 -0
- package/dist/preview/chunk.SKG4IHT5.js +88 -0
- package/dist/preview/chunk.SLBWPVIY.js +1 -0
- package/dist/preview/{chunk.YZ6UKKEL.js → chunk.SPU3BVAO.js} +1 -1
- package/dist/preview/{chunk.VVRI7DNK.js → chunk.SRFZKDQ6.js} +1 -1
- package/dist/preview/{chunk.MRUDTYOL.js → chunk.SSAY4ITS.js} +2 -2
- package/dist/preview/{chunk.TY6VILZB.js → chunk.T3RTFTOZ.js} +1 -1
- package/dist/preview/{chunk.73BJYIYS.js → chunk.TBSPEO2L.js} +1 -1
- package/dist/preview/chunk.TMYGLXR6.js +25 -0
- package/dist/preview/{chunk.GTUBIJTP.js → chunk.TNL2BVCH.js} +1 -1
- package/dist/preview/{chunk.QAUZDLDA.js → chunk.TVWN5I4M.js} +1 -1
- package/dist/preview/{chunk.MCPLU2U4.js → chunk.U7SNDY3F.js} +1 -1
- package/dist/preview/chunk.UCUWEYKM.js +1 -0
- package/dist/preview/{chunk.T4UYLB3Y.js → chunk.UIWI4GKW.js} +1 -1
- package/dist/preview/{chunk.HGP3Q7QX.js → chunk.UK5F3S2N.js} +1 -1
- package/dist/preview/{chunk.ZKDJQDKX.js → chunk.UVAWWCFW.js} +1 -1
- package/dist/preview/{chunk.L2AV6JRA.js → chunk.UWFEXEY3.js} +1 -1
- package/dist/preview/chunk.V4GAOZAW.js +1 -0
- package/dist/preview/{chunk.TT6QBWRA.js → chunk.VICCAWAN.js} +1 -1
- package/dist/preview/{chunk.AXMC6XVT.js → chunk.W2DKFQ6R.js} +1 -1
- package/dist/preview/{chunk.53BGPCM6.js → chunk.WESWDXRW.js} +1 -1
- package/dist/preview/{chunk.QZMBEG4E.js → chunk.WFHFWJ6E.js} +1 -1
- package/dist/preview/{chunk.AXCRFJDL.js → chunk.WQLAIEWJ.js} +1 -1
- package/dist/preview/{chunk.JYJNRCK5.js → chunk.XCCBUWMC.js} +1 -1
- package/dist/preview/{chunk.GQX57JIE.js → chunk.XCQ7ZPR5.js} +1 -1
- package/dist/preview/chunk.XWXYC3BJ.js +1 -0
- package/dist/preview/chunk.XZVPVAIS.js +1 -0
- package/dist/preview/chunk.Y2ZBVWII.js +1 -0
- package/dist/preview/chunk.Y3LTHEN7.js +1 -0
- package/dist/preview/{chunk.TL7UGUY4.js → chunk.Y5AMZBHA.js} +2 -2
- package/dist/preview/{chunk.CR5MQMOL.js → chunk.Z7N3MJ36.js} +1 -1
- package/dist/preview/{chunk.SVH3OMU2.js → chunk.ZJXUWOG3.js} +1 -1
- package/dist/preview/{chunk.BORCUDGS.js → chunk.ZZODDJYK.js} +1 -1
- package/dist/preview/index.html +51 -51
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.24MUPV4Y.js +0 -1
- package/dist/preview/chunk.2VZSC2MB.js +0 -1
- package/dist/preview/chunk.3L5USMQD.js +0 -1
- package/dist/preview/chunk.3O3H37WD.js +0 -1
- package/dist/preview/chunk.4VJARLJ5.js +0 -1
- package/dist/preview/chunk.5RNB6IC5.js +0 -1
- package/dist/preview/chunk.6BMCZPT6.js +0 -1
- package/dist/preview/chunk.6VA5XFRR.js +0 -1
- package/dist/preview/chunk.7PJVMADH.js +0 -2
- package/dist/preview/chunk.ATWNWPME.js +0 -1
- package/dist/preview/chunk.AVCW7C6V.js +0 -1
- package/dist/preview/chunk.BLS2G3CD.js +0 -5
- package/dist/preview/chunk.BNQL37AC.js +0 -88
- package/dist/preview/chunk.CBJHYNNT.js +0 -1
- package/dist/preview/chunk.EF3UB7US.js +0 -1
- package/dist/preview/chunk.EJUZGIQ5.js +0 -1
- package/dist/preview/chunk.F5FJHKWV.js +0 -1
- package/dist/preview/chunk.GQI53L5P.js +0 -1
- package/dist/preview/chunk.HG34MT7C.js +0 -1
- package/dist/preview/chunk.IATLUWAD.js +0 -1
- package/dist/preview/chunk.JLR74UFP.js +0 -1
- package/dist/preview/chunk.K4ITS63T.js +0 -1
- package/dist/preview/chunk.KT2LXHSI.js +0 -1
- package/dist/preview/chunk.M5RHVUZ6.js +0 -1
- package/dist/preview/chunk.MBZ6N5SO.js +0 -1
- package/dist/preview/chunk.N7FIUTVY.js +0 -1
- package/dist/preview/chunk.NPU4WYRB.js +0 -1
- package/dist/preview/chunk.OHAWUOUN.js +0 -1
- package/dist/preview/chunk.OKQ4JXTW.js +0 -1
- package/dist/preview/chunk.OYQ6ZA6T.js +0 -1
- package/dist/preview/chunk.Q7UQ5OXA.js +0 -1
- package/dist/preview/chunk.ROJZLOKZ.js +0 -1
- package/dist/preview/chunk.S7OFTGBQ.js +0 -18
- package/dist/preview/chunk.SGMVLKZO.js +0 -25
- package/dist/preview/chunk.SJRXBTGP.js +0 -1
- package/dist/preview/chunk.THTHNY4N.js +0 -1
- package/dist/preview/chunk.U6FGWVGB.js +0 -1
- package/dist/preview/chunk.UEL7FLL7.js +0 -1
- package/dist/preview/chunk.VM43YREJ.js +0 -1
- package/dist/preview/chunk.YAS6LXQ7.js +0 -1
- package/dist/preview/chunk.YEMNR4WU.js +0 -1
- package/dist/preview/chunk.YYS45ZGQ.js +0 -1
- package/dist/preview/chunk.ZI66HRES.js +0 -1
- package/dist/preview/chunk.ZVETGRUM.js +0 -1
- package/dist/preview/chunk.ZVOP2HHI.js +0 -1
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import{a as qe,c as Be}from"./chunk.YYS45ZGQ.js";import{b as Ve}from"./chunk.YG3BLY67.js";import{a as Ie,b as Ke,c as Fe,d as j}from"./chunk.GZEZMU2T.js";import"./chunk.4VJARLJ5.js";import{j as Me,k as Le}from"./chunk.TL7UGUY4.js";import"./chunk.5RNB6IC5.js";import"./chunk.ZITDUHX3.js";import"./chunk.ETWREHXF.js";import{e as Ee}from"./chunk.YZ6UKKEL.js";import"./chunk.HJCQ6I3S.js";import"./chunk.XWLGHTH6.js";import{e as ne}from"./chunk.TY6VILZB.js";import"./chunk.AXMC6XVT.js";import{a as xe}from"./chunk.LDE5HLTM.js";import"./chunk.GTUBIJTP.js";import"./chunk.DUIKIJKC.js";import"./chunk.73BJYIYS.js";import"./chunk.OKQ4JXTW.js";import"./chunk.M5RHVUZ6.js";import"./chunk.MRUDTYOL.js";import{m as Pe}from"./chunk.OUNLAMBA.js";import{a as Te,b as Oe}from"./chunk.HGP3Q7QX.js";import{h as $e}from"./chunk.QSZLY62B.js";import{e as Re,f as De}from"./chunk.7VX6TBNY.js";import{a as Se,b as Ne,j as Ae}from"./chunk.KZ3UPV2L.js";import"./chunk.G4JJXA63.js";import"./chunk.64TFAR5Z.js";import"./chunk.5DZR46YG.js";import"./chunk.L5MDUZLQ.js";import"./chunk.IDQHSAAQ.js";import"./chunk.Q7RI4SI4.js";import"./chunk.XOZU4OFA.js";import"./chunk.CR5MQMOL.js";import"./chunk.Q5WEOX3Q.js";import"./chunk.RXJBYP7B.js";import"./chunk.BJAQRV2R.js";import"./chunk.JJP5OL5E.js";import"./chunk.WVUJXDXZ.js";import"./chunk.6SHF6IL5.js";import{a as ye}from"./chunk.MQISKON2.js";import"./chunk.GQX57JIE.js";import"./chunk.LJXAZ5TF.js";import"./chunk.QFI4L2HK.js";import"./chunk.KFHXTHIY.js";import"./chunk.GZHZLJBF.js";import{r as ke}from"./chunk.JLR74UFP.js";import"./chunk.OJGHDWI6.js";import"./chunk.HG34MT7C.js";import"./chunk.TT6QBWRA.js";import{d as te,l as be}from"./chunk.UCS3CBT4.js";import{c as me}from"./chunk.O6SKKF4V.js";import{C as Ce,r as J}from"./chunk.ZK446PSX.js";import{$ as V,G as tt,La as ee,Ma as Y,S as we,U as ve,ba as X,j as ge,ka as he,l as ue,m as fe,r as U}from"./chunk.SGMVLKZO.js";import"./chunk.SDO3U72B.js";import{I as se,O as de,U as D,Wa as Z,da as G,ga as le,ia as pe,ka as ce}from"./chunk.BLS2G3CD.js";import"./chunk.EJUZGIQ5.js";import{b as Q}from"./chunk.AJZBJBMO.js";var f=Q(tt(),1);var nt=300,it=14,z=50,at=3,ot=2;function _e(e,n,o){let p=e.tryDefinition(n)?.fields?.shape;return(p?.[o]===void 0?void 0:ye(p[o]))?.type}var rt=(e,n)=>Object.keys(e.tryDefinition(n)?.fields?.shape??{}),st=e=>e==="date"||e==="datetime",Ge=/^(due|dueOn|dueAt|dueDate|deadline|by)$/i,dt=/^(date|on|day|when|at|start|starts|startsOn|startsAt|begins|from|sown|scheduled|scheduledFor|planned|plannedFor)$/i,lt=/^(done|finished|complete|completed|closed)$/i;function ae(e,n){let o=e.tryDefinition(n),p=rt(e,n),a=p.filter(u=>st(_e(e,n,u)));if(a.length===0)return;let i=o?.fieldRoles??{},s=u=>i[u]!==void 0&&a.includes(i[u])?i[u]:void 0,c=s("start")??s("when")??a.find(u=>Ge.test(u))??a.find(u=>dt.test(u));if(!c)return;let S=s("end")??a.find(u=>u!==c&&/^(end|ends|until|to|finish|finished|harvested|through)$/i.test(u)),g=p.find(u=>lt.test(u)&&_e(e,n,u)==="boolean");return{field:c,due:Ge.test(c),...S?{end:S}:{},...g?{done:g}:{}}}function ie(e,n){return Math.round((Date.parse(`${n.slice(0,10)}T00:00:00Z`)-Date.parse(`${e.slice(0,10)}T00:00:00Z`))/864e5)}var q=e=>typeof e=="string"&&/^\d{4}-\d{2}-\d{2}/.test(e)?e.slice(0,10):void 0;function je(e,n,o,p){let a=ne(e,n);if(a&&o.length>0&&o.length<=nt)return{shape:"board",field:a.field};let i=ae(e,n);if(i&&!i.due){let s=r=>{let y=q(r[i.field]),h=q(Z(r,i.field,p));return y&&h?ie(y,h):0},c=o.map(r=>({from:q(Z(r,i.field,p)),to:i.end&&q(r[i.end])?L(q(r[i.end]),s(r)):void 0})).filter(r=>r.from!==void 0).map(r=>({from:r.from,to:r.to&&r.to>r.from?r.to:r.from})),S=`${p.slice(0,7)}-01`,g=L(`${L(S,31).slice(0,7)}-01`,-1),u=c.filter(r=>r.from<=g&&r.to>=S),w=c.map(r=>ie(r.from,r.to)).sort((r,y)=>r-y),l=w[Math.floor(w.length/2)]??0;if(u.length>0&&l<=it){let r=L(p,-((new Date(`${p}T00:00:00Z`).getUTCDay()+6)%7)),y=L(r,6),h=u.every(m=>m.from>=r&&m.to<=y);return{shape:"calendar",start:i.field,...i.end?{end:i.end}:{},...i.done?{done:i.done}:{},range:h?"week":"month"}}}return{shape:"table"}}function ze(e,n){let o=ae(e,n);return o?{by:o.field,direction:o.due?"asc":"desc"}:void 0}function He(e,n,o={}){switch(n.shape){case"board":return{lens:"columns",kind:e,column:n.field};case"calendar":return{lens:"calendar",kind:e,start:n.start,...n.end?{end:n.end}:{},...n.done?{done:n.done}:{},range:n.range};case"table":return{lens:"blocks",kind:e,as:"row",...o.group?.by?{group:o.group.by}:{},...o.sort?{sort:{by:o.sort.by,...o.sort.direction==="desc"?{direction:"desc"}:{}}}:{}}}}var pt=60;function We(e,n,o,p){let a=e.tryDefinition(n),i=o.slice(0,pt),s=new Map;i.forEach(w=>{let l=G(a,w);te(w,a,{glance:!0,said:[l]}).forEach((r,y)=>{if(r.long||r.files||r.app)return;let h=s.get(r.key);h?h.count++:s.set(r.key,{label:r.label,count:1,at:y})})});let c=Math.max(1,Math.ceil(i.length/3)),S=[...s.entries()].filter(([,w])=>w.count>=c).sort((w,l)=>w[1].at-l[1].at).slice(0,at).map(([w,l])=>({about:"field",key:w,label:l.label})),g=new Map;for(let w of i){let l=new Set;for(let[r,y]of[["out",p.outEdges(w.id)],["in",p.inEdges(w.id)]])for(let h of y){let m=p.getNode(r==="out"?h.to:h.from);if(!m||m.id===w.id)continue;let b=`${h.kind}|${r}`;if(l.has(b))continue;l.add(b);let A=g.get(b);A?A.count++:g.set(b,{edge:h.kind,direction:r,far:m.kind,count:1})}}let u=[...g.entries()].sort((w,l)=>l[1].count-w[1].count).slice(0,ot).map(([w,l])=>{let r=me(e,l.direction==="out"?n:l.far,l.edge,l.direction);return{about:"edge",key:w,label:r.charAt(0).toUpperCase()+r.slice(1),edge:l.edge,direction:l.direction}});return[...S,...u]}function Ze(e,n,o,p){if(o.about==="field"){let s=e.tryDefinition(n.kind);return{text:te(n,s,{excerpt:!0}).find(S=>S.key===o.key)?.value??""}}let i=(o.direction==="out"?p.outEdges(n.id):p.inEdges(n.id)).filter(s=>s.kind===o.edge).map(s=>p.getNode(o.direction==="out"?s.to:s.from)).filter(s=>s!==void 0).map(s=>G(e.tryDefinition(s.kind),s));return i.length===0?{text:""}:i.length===1?{text:i[0]}:{text:`${i[0]} +${i.length-1}`,title:i.join(", ")}}function Ue(e,n,o=()=>{}){let p=new Map;for(let a of e){let i=a.nodeIds.filter(c=>n.has(c));if(i.length===0&&!(a.subjectId!==void 0&&n.has(a.subjectId)))continue;let s=p.get(a.invariant)??{invariant:a.invariant,label:o(a.invariant)||a.label||a.message,violations:[],records:new Set};s.violations.push(a);for(let c of i)s.records.add(c);a.subjectId!==void 0&&n.has(a.subjectId)&&s.records.add(a.subjectId),p.set(a.invariant,s)}return[...p.values()].sort((a,i)=>i.violations.length-a.violations.length).map(a=>({invariant:a.invariant,label:a.label,violations:a.violations,records:[...a.records]}))}var Ye=6;function Je(e,n,o,p){let a=ae(e,n);if(!a)return;let i=ne(e,n),s=g=>{if(a.done!==void 0&&g[a.done]===!0)return!0;if(!i)return!1;let u=i.values.indexOf(String(g[i.field]));return u>=0&&i.tiers[u]==="done"},c=0,S=0;for(let g of o){let u=q(Z(g,a.field,p));if(!u||s(g))continue;let w=ie(p,u);a.due&&w<0?c++:w>=0&&w<=Ye&&S++}if(!(c===0&&S===0))return{field:a.field,due:a.due,overdue:c,soon:S}}function L(e,n){return new Date(Date.parse(`${e.slice(0,10)}T00:00:00Z`)+n*864e5).toISOString().slice(0,10)}function oe(e,n,o){return n==="overdue"?[{key:e.field,value:`before:${o}`}]:[{key:e.field,value:`after:${L(o,-1)}`},{key:e.field,value:`before:${L(o,Ye+1)}`}]}function Qe(e,n,o,p){let a=new Set,i=new Set;for(let s of e)if(!(s.at<=o))for(let c of s.primitives)c.op==="add-node"&&c.node?.kind===n?a.add(c.node.id):(c.op==="patch-node"||c.op==="splice-text")&&c.id!==void 0&&p(c.id)===n&&i.add(c.id);for(let s of a)i.delete(s);return{added:[...a].filter(s=>p(s)===n).length,changed:[...i].filter(s=>p(s)===n).length}}var t=Q(we(),1),Xe="as",ct=(e,n)=>`graview:kind-seen:${e}:${n}`;function gt(e){try{return localStorage.getItem(e)}catch{return null}}function ut(e,n){try{localStorage.setItem(e,n)}catch{}}var ft=(e,n)=>({...ge(fe(e,!1),n),relation:null});function Jt({kind:e,members:n,flagged:o=[],label:p,retired:a=0}){let{store:i,brand:s,principal:c,views:S,view:g}=V(),{go:u}=Y(),w=X(),l=i.schema,r=l.tryDefinition(e),y=p??pe(l,e),h=i.today()??se(),m=n,b=(0,f.useId)(),A=(0,f.useMemo)(()=>je(l,e,m,h),[l,e,m,h]),x=g.within?.[Xe]==="table"?{shape:"table"}:A,k=Te(g),C=x.shape==="table"&&!k.sort?ze(l,e):void 0,v=C?{...k,sort:C}:k,R=(0,f.useMemo)(()=>new Set(o),[o]),T=(0,f.useMemo)(()=>$e(m,v,{schema:l,graph:i.graph,flagged:R,today:h}),[m,v,l,i,R,h,w]),I=(0,f.useMemo)(()=>De(l,Re(l,e)),[l,e]),M=S.arrangement?.()?.lists?.[e]?.filters,K=$=>u(Oe(g,$)),B=(0,f.useMemo)(()=>({name:s?.name??"app",schema:l,...i.policy?{policy:i.policy}:{}}),[s,l,i]),H=JSON.stringify(He(e,x,v)),P=(0,f.useMemo)(()=>{let $=Ae(JSON.parse(H),{app:B,sight:Ne(B,c)});return Se($)?void 0:$},[H,B,c]),W=x.shape!=="table"&&P!==void 0;return(0,t.jsxs)("section",{"aria-labelledby":b,className:"graview-kind-stop","data-testid":"kind-stop","data-graview-kind-stop":e,"data-graview-shape":x.shape,children:[(0,t.jsx)("style",{children:St}),(0,t.jsx)(wt,{kind:e,plural:y,count:m.length,headingId:b,description:r?.description}),(0,t.jsx)(ht,{kind:e,plural:y,members:m,today:h,arrangement:v,onArrange:K}),(m.length>1||a>0)&&!W?(0,t.jsx)(Pe,{schema:l,graph:i.graph,kind:e,arrangement:v,onChange:K,offers:I,...M?{filters:M}:{},kept:{shown:T.nodes.length,of:m.length},testId:"kind-arrange",chips:{nodes:m,flagged:R,today:h},...a>0?{past:{count:a,widen:()=>u(Ee(g,!0))}}:{}}):null,m.length>0?(0,t.jsx)(yt,{derived:A,shape:x,draft:P}):null,(0,t.jsx)("div",{className:"graview-kind-stop-body","data-testid":"kind-stop-body",children:m.length===0?(0,t.jsx)("p",{className:"graview-kind-stop-empty","data-testid":"kind-stop-empty",children:"Nothing here yet."}):W?(0,t.jsx)(kt,{draft:P,nodes:m}):T.nodes.length===0?(0,t.jsxs)("p",{className:"graview-kind-stop-empty","data-testid":"kind-stop-none-kept",children:["None of the ",D(m.length)," ",y.toLowerCase()," ",v.query?`says \u201C${v.query}\u201D`:"is kept by these filters","."," ",(0,t.jsx)("button",{type:"button",className:"graview-kind-stop-link",onClick:()=>K({}),children:"Show them all"})]}):(0,t.jsx)(xt,{kind:e,nodes:T.nodes,groups:T.grouped?T.groups.map($=>({key:$.key,label:$.label,nodes:$.nodes})):void 0,flagged:R,plural:y,arrangement:v})})]})}function wt({kind:e,plural:n,count:o,headingId:p,description:a}){let{store:i,setSelection:s,setMenuAt:c}=V(),S=(0,f.useMemo)(()=>({about:[U(e)]}),[e]),{affordances:g}=Me(S),{apply:u,preview:w}=Le(),l=(0,f.useMemo)(()=>{let x=k=>i.allMutations().find(C=>C.name===k.mutation)?.creates?.includes(e)??!1;return g.find(k=>!k.destructive&&!k.setsAside&&x(k))},[g,i,e]),[r,y]=(0,f.useState)(!1),[h,m]=(0,f.useState)(null),b=(0,f.useRef)(null),A=(0,f.useRef)(null);(0,f.useEffect)(()=>{let x=A.current;!x||x.closest('[data-testid="kind-stop"]')?.contains(document.activeElement)||x.focus({preventScroll:!0})},[e]);let O=(x,k)=>{try{w(x,k),u(x,k),m(null),y(!1),requestAnimationFrame(()=>b.current?.focus())}catch(C){return m(be(i.schema,i.allMutations(),C)),[]}};return(0,t.jsxs)("header",{className:"graview-kind-stop-head",children:[(0,t.jsxs)("div",{className:"graview-kind-stop-title",children:[(0,t.jsx)("h2",{id:p,ref:A,tabIndex:-1,"data-testid":"kind-stop-title",children:n}),(0,t.jsxs)("p",{"data-testid":"kind-stop-count",children:[le(i.schema,e,o),a?` \xB7 ${a}`:""]})]}),(0,t.jsxs)("div",{className:"graview-kind-stop-acts",children:[l?(0,t.jsx)("button",{ref:b,type:"button",className:"graview-kind-stop-primary","data-testid":"kind-stop-primary","data-affordance":l.id,"aria-expanded":l.open.length>0?r:void 0,onClick:()=>{m(null),l.open.length===0?O(l):y(x=>!x)},children:l.label}):null,(0,t.jsx)("button",{type:"button",className:"graview-kind-stop-quiet","data-testid":"kind-stop-acts","aria-haspopup":"menu","aria-label":`What can be done with the ${n.toLowerCase()}`,onClick:x=>{let k=x.currentTarget.getBoundingClientRect();s([U(e)]),c({x:Math.round(k.left),y:Math.round(k.bottom+4),on:U(e)})},children:"Acts\u2026"})]}),r&&l?(0,t.jsx)("div",{className:"graview-kind-stop-ask","data-testid":"kind-stop-ask","aria-label":l.label,role:"group",children:(0,t.jsx)(xe,{affordance:l,onApply:x=>O(l,x),onCancel:()=>{y(!1),b.current?.focus()}})}):null,h?(0,t.jsx)("p",{role:"alert",className:"graview-kind-stop-failed","data-testid":"kind-stop-failed",children:h}):null]})}var vt=J.part((e,n)=>(0,t.jsx)(e.ProblemRows,{...n}),{what:"The problems",as:"li"});function ht({kind:e,plural:n,members:o,today:p,arrangement:a,onArrange:i}){let{store:s,brand:c,setSelection:S}=V(),g=s.schema,u=ee(),w=(0,f.useMemo)(()=>new Set(o.map(v=>v.id)),[o]),l=(0,f.useMemo)(()=>Ue(u,w,v=>s.allInvariants().find(R=>R.name===v)?.label),[u,w,s]),r=(0,f.useMemo)(()=>Je(g,e,o,p),[g,e,o,p]),y=ct(Ce(c,g),e),[h]=(0,f.useState)(()=>gt(y));(0,f.useEffect)(()=>()=>ut(y,new Date().toISOString()),[y]);let m=X(),b=(0,f.useMemo)(()=>h?Qe(s.log.all(),e,h,v=>s.graph.getNode(v)?.kind):null,[h,s,e,m]),[A,O]=(0,f.useState)(null),x=v=>i({...a,filter:[...(a.filter??[]).filter(R=>!v?.some(T=>T.key===R.key)),...v??[]]}),k=l.reduce((v,R)=>v+R.violations.length,0),C=[];if(r&&(r.overdue>0||r.soon>0)){let v=r.field;C.push((0,t.jsxs)("li",{"data-testid":"kind-stop-dates",children:[r.overdue>0?(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-fact","data-tone":"warn",onClick:()=>x(oe(r,"overdue",p)),"aria-label":`${D(r.overdue)} overdue \u2014 show only these`,children:[D(r.overdue)," overdue"]}):null,r.soon>0?(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-fact",onClick:()=>x(oe(r,"soon",p)),"aria-label":`${D(r.soon)} in the next 7 days \u2014 show only these`,children:[D(r.soon)," ",r.due?"due":""," in the next 7 days"]}):null,(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:[" by ",ce(g.tryDefinition(e),v).toLowerCase()]})]},"dates"))}if(l.length>0&&C.push((0,t.jsxs)("li",{"data-testid":"kind-stop-problems","data-graview-problems":k,children:[(0,t.jsxs)("span",{className:"graview-kind-stop-warn",children:[(0,t.jsx)("span",{"aria-hidden":"true",children:"\u26A0 "}),k===1?"1 problem":`${D(k)} problems`]}),(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:[" in ",n.toLowerCase(),":"]}),(0,t.jsx)("ul",{className:"graview-kind-stop-rules",children:l.map(v=>(0,t.jsx)(mt,{group:v,open:A===v.invariant,onToggle:()=>O(R=>R===v.invariant?null:v.invariant),onPick:R=>S([R])},v.invariant))}),(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-link","data-testid":"kind-stop-only-problems",onClick:()=>x([{key:"is",value:"flagged"}]),children:["Show only the ",n.toLowerCase()," with a problem"]})]},"problems")),b&&(b.added>0||b.changed>0)){let v=[b.added>0?`${D(b.added)} added`:"",b.changed>0?`${D(b.changed)} changed`:""].filter(Boolean);C.push((0,t.jsxs)("li",{"data-testid":"kind-stop-since",children:[(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:["Since you last looked (",de(h.slice(0,10)),"):"]})," ",v.join(", ")]},"since"))}return C.length===0?null:(0,t.jsx)("ul",{className:"graview-kind-stop-going-on","aria-label":`What is going on in the ${n.toLowerCase()}`,"data-testid":"kind-stop-going-on",children:C})}function mt({group:e,open:n,onToggle:o,onPick:p}){let a=(0,f.useId)();return(0,t.jsxs)("li",{"data-graview-rule":e.invariant,children:[(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-rule","aria-expanded":n,"aria-controls":a,onClick:o,onPointerEnter:J.prefetch,onFocus:J.prefetch,children:[(0,t.jsx)("span",{"aria-hidden":"true",className:"graview-kind-stop-chevron","data-open":n||void 0,children:"\u203A"}),e.label," ",(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:["\xB7 ",D(e.violations.length)]})]}),n?(0,t.jsx)("ol",{id:a,className:"graview-kind-stop-problem-rows","data-testid":"kind-stop-problem-rows",children:(0,t.jsx)(f.Suspense,{fallback:null,children:(0,t.jsx)(vt,{violations:e.violations,pick:i=>{let s=i.subjectId??e.records[0]??i.nodeIds[0];s!==void 0&&p(s)}})})}):null]})}var bt={board:"Board",calendar:"Calendar",table:"Table"};function yt({derived:e,shape:n,draft:o}){let{view:p}=V(),{go:a}=Y(),{keep:i}=qe(Be()),[s,c]=(0,f.useState)(!1),S=e.shape==="table"?[]:[e.shape,"table"];return(0,t.jsxs)("div",{className:"graview-kind-stop-shape","data-testid":"kind-stop-shape",children:[S.length>0?(0,t.jsx)("span",{role:"group","aria-label":"Show as",className:"graview-kind-stop-switch",children:S.map(g=>(0,t.jsx)("button",{type:"button","aria-pressed":n.shape===g,"data-testid":`kind-stop-as-${g}`,onClick:()=>a(ue(p,Xe,g===e.shape?null:g)),children:bt[g]},g))}):null,(0,t.jsx)("span",{className:"graview-kind-stop-quiet-text","data-testid":"kind-stop-derived",children:o?`${o.said.replace(/\.$/,"")}, derived from the declaration`:"Derived from the declaration"}),o?(0,t.jsx)("button",{type:"button",className:"graview-kind-stop-link","data-testid":"kind-stop-keep",disabled:s,title:`Keep \u201C${o.title}\u201D as a lens: a place of its own`,onClick:()=>{c(!0),i(o).finally(()=>c(!1))},children:"Keep as a lens"}):null]})}function kt({draft:e,nodes:n}){let o=Ve(e.drawn);return(0,t.jsx)("div",{className:"graview-kind-stop-lens","data-graview-draft":e.lens.name,children:(0,t.jsx)(ve,{mode:"scene",children:(0,t.jsx)(ke,{kind:e.kind,view:e.title,children:(0,t.jsx)(o,{nodes:n,label:e.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1})})})})}function xt({kind:e,nodes:n,groups:o,flagged:p,plural:a,arrangement:i}){let{store:s,views:c,view:S,selection:g,setSelection:u,setMenuAt:w,principal:l}=V(),{go:r}=Y(),y=s.schema,h=s.graph,m=(0,f.useMemo)(()=>(o?o.flatMap(d=>d.nodes):n).map(d=>d.id),[n,o]),b=Ie(m),A=(0,f.useMemo)(()=>s.permittedMutations(l).some(d=>{let N=d.subject?.kinds;return N!==void 0&&(N==="*"||N.includes(e))}),[s,l,e]),O=(0,f.useRef)(null),x=d=>{b.choose(d),requestAnimationFrame(()=>{let N=b.list.current;((d[0]===void 0?null:N?.querySelector(`[data-graview-choose-box="${CSS.escape(d[0])}"]`))??N)?.focus({preventScroll:!0})})},k=b.chosen.length,C=c.lookup(e,{cardinality:"one",fidelity:"glyph"}),v=C!==void 0&&!he(C)?C:void 0,R=d=>g.includes(d),T=ee(),I=(0,f.useMemo)(()=>We(y,e,n,h),[y,e,n,h]),[M,K]=(0,f.useState)(z);(0,f.useEffect)(()=>K(z),[i.query,i.filter?.length,i.sort?.by,i.group?.by]);let B=y.tryDefinition(e),H=d=>T.filter(N=>N.nodeIds.includes(d)||N.subjectId===d).map(N=>N.message),P=i.sort?.by,W=`${a}${i.sort?`, in order of ${I.find(d=>d.key===P)?.label.toLowerCase()??P}`:""}`,$=M,et=d=>{let N=G(B,d),F=p.has(d.id)?H(d.id):[];return(0,t.jsxs)("tr",{"data-graview-pick":d.id,tabIndex:-1,"data-graview-record":d.id,"data-flagged":F.length>0||void 0,...A?{"data-graview-choose":d.id}:{},children:[A?(0,t.jsx)("td",{className:"graview-choose-at",children:(0,t.jsx)("input",{...b.boxProps(d.id,N),onPointerEnter:j,onFocus:j})}):null,(0,t.jsxs)("th",{scope:"row",className:"graview-kind-stop-name",children:[v?(0,t.jsx)("div",{"data-graview-pick":d.id,className:"graview-kind-stop-own-row",children:(0,t.jsx)(v,{node:d,cardinality:"one",fidelity:"glyph",mode:"scene",selected:R(d.id),...F.length>0?{flagged:[d.id]}:{}})}):(0,t.jsx)("button",{type:"button","data-testid":"kind-stop-row-go",title:`Go to ${N}`,onClick:()=>r(ft(S,d.id)),children:N}),F.length>0?(0,t.jsxs)("span",{className:"graview-kind-stop-flag",title:F.join(" \xB7 "),children:[(0,t.jsx)("span",{"aria-hidden":"true",children:"\u26A0"}),(0,t.jsx)("span",{className:"graview-kind-stop-hidden",children:`Problem: ${F.join(". ")}`})]}):null]}),I.map(_=>{let E=Ze(y,d,_,h);return(0,t.jsx)("td",{"data-label":_.label,"data-short":E.text.length>0&&E.text.length<=14||void 0,"data-empty":E.text?void 0:"",...E.title?{title:E.title}:{},children:E.text?(0,t.jsx)("span",{children:E.text}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{"aria-hidden":"true",children:"\u2014"}),(0,t.jsx)("i",{className:"graview-kind-stop-hidden",children:"none"})]})},_.key)}),(0,t.jsx)("td",{className:"graview-kind-stop-row-acts",children:(0,t.jsx)("button",{type:"button","data-testid":"kind-stop-row-acts","aria-haspopup":"menu","aria-label":`What can be done with ${N}`,onClick:_=>{let E=_.currentTarget.getBoundingClientRect();u([d.id]),w({x:Math.round(E.left),y:Math.round(E.bottom+4),on:d.id})},children:(0,t.jsx)("span",{"aria-hidden":"true",children:"\u22EF"})})})]},d.id)},re=d=>{let N=d.slice(0,Math.max(0,$));return $-=N.length,N.map(et)};return(0,t.jsxs)("div",{className:"graview-kind-stop-table-at",...A?{...b.listProps,ref:d=>{O.current=d,b.list.current=d},tabIndex:-1,role:"group","aria-label":k>0?`${a}, ${k} chosen`:a,"data-graview-choosable":""}:{},children:[A?(0,t.jsx)("style",{children:Ke}):null,(0,t.jsxs)("table",{className:"graview-kind-stop-table","data-testid":"kind-stop-table",children:[(0,t.jsx)("caption",{className:"graview-kind-stop-hidden",children:W}),(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[A?(0,t.jsx)("td",{className:"graview-choose-at graview-choose-all",children:(0,t.jsx)("input",{type:"checkbox",className:"graview-choose-box","data-testid":"kind-stop-choose-all","aria-label":`Choose all ${D(n.length)} ${a.toLowerCase()}`,checked:k>0&&k===n.length,ref:d=>{d&&(d.indeterminate=k>0&&k<n.length)},onPointerEnter:j,onFocus:j,onChange:()=>k===n.length?b.clear():b.choose(m)})}):null,(0,t.jsx)("th",{scope:"col","aria-sort":P==="label"?i.sort?.direction==="desc"?"descending":"ascending":void 0,children:"Name"}),I.map(d=>(0,t.jsx)("th",{scope:"col","aria-sort":d.about==="field"&&d.key===P?i.sort?.direction==="desc"?"descending":"ascending":void 0,children:d.label},d.key)),(0,t.jsx)("th",{scope:"col",children:(0,t.jsx)("span",{className:"graview-kind-stop-hidden",children:"Acts"})})]})}),o?o.map(d=>$<=0?null:(0,t.jsxs)("tbody",{"data-graview-group":d.key,children:[(0,t.jsx)("tr",{className:"graview-kind-stop-group",children:(0,t.jsxs)("th",{scope:"rowgroup",colSpan:I.length+(A?3:2),children:[d.label," ",(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:["\xB7 ",D(d.nodes.length)]})]})}),re(d.nodes)]},d.key||"-")):(0,t.jsx)("tbody",{children:re(n)})]}),A?(0,t.jsx)(Fe,{store:s,chosen:b.chosen,principal:l,anchor:()=>O.current?.closest('[data-testid="kind-stop"]')??null,of:m.length,onChooseAll:()=>b.choose(m),onClear:b.clear,onActed:x}):null,n.length>M?(0,t.jsxs)("p",{className:"graview-kind-stop-more",children:[(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text","data-testid":"kind-stop-shown",children:[D(M)," of ",D(n.length)," shown"]})," ",(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-link","data-testid":"kind-stop-more",onClick:()=>K(d=>d+z),children:["Show ",D(Math.min(z,n.length-M))," more"]})]}):null]})}var St=`
|
|
2
|
-
.graview-kind-stop{container-type:inline-size;box-sizing:border-box;height:100%;min-height:0;display:flex;flex-direction:column;gap:10px;padding:16px 18px 12px;border:1px solid var(--graview-edge);border-radius:var(--graview-radius,12px);background:var(--graview-panel);color:var(--graview-ink);box-shadow:var(--graview-lift-low);overflow:auto;overscroll-behavior:contain}
|
|
3
|
-
[data-graview-map-panel] .graview-kind-stop{height:auto;padding:4px 6px 12px;border:0;box-shadow:none;background:none;overflow:visible}
|
|
4
|
-
.graview-kind-stop :focus-visible{outline:2px solid var(--graview-accent);outline-offset:2px}
|
|
5
|
-
.graview-kind-stop button{font:inherit;cursor:pointer}
|
|
6
|
-
.graview-kind-stop :is(.graview-kind-stop-link,.graview-kind-stop-rule,.graview-kind-stop-name button,.graview-kind-stop-row-acts button,.graview-kind-stop-fact,.graview-kind-stop-switch button){box-shadow:none}
|
|
7
|
-
.graview-kind-stop-head{display:flex;flex-wrap:wrap;align-items:flex-start;gap:8px 16px}
|
|
8
|
-
.graview-kind-stop-title{flex:1 1 16rem;min-width:0}
|
|
9
|
-
.graview-kind-stop-title h2{margin:0;outline-offset:2px;font-size:var(--graview-text-heading);line-height:1.3;overflow-wrap:anywhere}
|
|
10
|
-
.graview-kind-stop-title p{margin:2px 0 0;font-size:.875rem;color:var(--graview-ink-muted);overflow-wrap:anywhere}
|
|
11
|
-
.graview-kind-stop-acts{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
|
|
12
|
-
.graview-kind-stop-primary,.graview-kind-stop-quiet{min-height:32px;padding:0 14px;border-radius:8px;font-size:.875rem}
|
|
13
|
-
.graview-kind-stop-primary{border:1px solid var(--graview-accent);background:var(--graview-accent);color:var(--graview-accent-ink);font-weight:600}
|
|
14
|
-
.graview-kind-stop-quiet{border:1px solid var(--graview-edge);background:transparent;color:var(--graview-ink)}
|
|
15
|
-
.graview-kind-stop-ask{flex:1 1 100%;min-width:0;padding:10px 12px;border:1px solid var(--graview-edge);border-radius:10px}
|
|
16
|
-
.graview-kind-stop-failed{flex:1 1 100%;margin:0;font-size:var(--graview-text-small);color:var(--graview-warn)}
|
|
17
|
-
.graview-kind-stop-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
|
|
18
|
-
.graview-kind-stop-going-on{list-style:none;margin:0;padding:0;display:grid;gap:6px;font-size:.875rem}
|
|
19
|
-
.graview-kind-stop-going-on>li{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;min-width:0}
|
|
20
|
-
.graview-kind-stop-fact{min-height:28px;padding:0 10px;border:1px solid var(--graview-edge);border-radius:999px;background:transparent;color:var(--graview-ink)}
|
|
21
|
-
.graview-kind-stop-fact[data-tone=warn],.graview-kind-stop-warn{color:var(--graview-warn);font-weight:600}
|
|
22
|
-
.graview-kind-stop-quiet-text{color:var(--graview-ink-muted)}
|
|
23
|
-
.graview-kind-stop-rules{list-style:none;margin:0;padding:0;flex:1 1 100%;display:grid;gap:2px}
|
|
24
|
-
.graview-kind-stop-rule{display:inline-flex;align-items:center;gap:6px;min-height:28px;max-width:100%;padding:0 6px;border:1px solid transparent;border-radius:7px;background:none;color:var(--graview-ink);text-align:left;overflow-wrap:anywhere}
|
|
25
|
-
.graview-kind-stop-rule:hover{border-color:var(--graview-edge)}
|
|
26
|
-
.graview-kind-stop-chevron{display:inline-block;width:.8em}
|
|
27
|
-
.graview-kind-stop-chevron[data-open]{transform:rotate(90deg)}
|
|
28
|
-
.graview-kind-stop-problem-rows{list-style:none;margin:2px 0 6px 18px;padding:0;max-width:44rem}
|
|
29
|
-
.graview-kind-stop-link{min-height:28px;padding:0 4px;border:0;background:none;color:var(--graview-accent);text-decoration:underline;text-underline-offset:2px}
|
|
30
|
-
.graview-kind-stop-link:disabled{opacity:.6;cursor:default}
|
|
31
|
-
.graview-kind-stop-shape{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;font-size:var(--graview-text-small)}
|
|
32
|
-
.graview-kind-stop-switch{display:inline-flex;border:1px solid var(--graview-edge);border-radius:8px;overflow:hidden}
|
|
33
|
-
.graview-kind-stop-switch button{min-height:28px;padding:0 12px;border:0;background:transparent;color:var(--graview-ink-muted)}
|
|
34
|
-
.graview-kind-stop-switch button+button{border-left:1px solid var(--graview-edge)}
|
|
35
|
-
.graview-kind-stop-switch button[aria-pressed=true]{background:color-mix(in srgb,var(--graview-accent) 16%,transparent);color:var(--graview-ink);font-weight:600}
|
|
36
|
-
.graview-kind-stop-body{flex:1 0 auto;min-width:0}
|
|
37
|
-
.graview-kind-stop-empty{margin:24px 0;color:var(--graview-ink-muted)}
|
|
38
|
-
.graview-kind-stop-lens{min-width:0}
|
|
39
|
-
|
|
40
|
-
.graview-kind-stop-table-at{min-width:0}
|
|
41
|
-
.graview-kind-stop-table{width:100%;border-collapse:collapse;font-size:.875rem}
|
|
42
|
-
.graview-kind-stop-table th,.graview-kind-stop-table td{padding:7px 8px;text-align:left;vertical-align:top;border-top:1px solid var(--graview-edge);overflow-wrap:break-word}
|
|
43
|
-
.graview-kind-stop-table td{color:var(--graview-ink)}
|
|
44
|
-
.graview-kind-stop-table td>span{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
|
|
45
|
-
.graview-kind-stop-table td[data-short]{white-space:nowrap;font-variant-numeric:tabular-nums}
|
|
46
|
-
.graview-kind-stop-table thead th{border-top:0;font-size:var(--graview-text-small);font-weight:600;letter-spacing:.04em;color:var(--graview-ink-muted)}
|
|
47
|
-
.graview-kind-stop-name{font-weight:500;min-width:8rem;max-width:22rem}
|
|
48
|
-
.graview-kind-stop-name button{display:inline-block;min-width:24px;min-height:24px;padding:0;border:0;background:none;color:var(--graview-ink);font-weight:500;text-align:left;text-decoration:underline;text-decoration-color:var(--graview-edge);text-underline-offset:3px}
|
|
49
|
-
.graview-kind-stop-name button:hover{text-decoration-color:currentColor}
|
|
50
|
-
.graview-kind-stop-own-row{display:inline-block;max-width:100%;cursor:pointer}
|
|
51
|
-
.graview-kind-stop-flag{margin-left:6px;color:var(--graview-warn)}
|
|
52
|
-
.graview-kind-stop-group th{padding-top:12px;font-weight:600;color:var(--graview-ink)}
|
|
53
|
-
.graview-kind-stop-row-acts{width:1%;white-space:nowrap;text-align:right}
|
|
54
|
-
.graview-kind-stop-row-acts button{min-width:32px;min-height:28px;border:1px solid var(--graview-edge-bright,var(--graview-edge));border-radius:7px;background:none;color:var(--graview-ink);font-size:1.125rem;font-weight:700;line-height:1}
|
|
55
|
-
.graview-kind-stop-row-acts button:hover{background:color-mix(in srgb,var(--graview-ink) 8%,transparent)}
|
|
56
|
-
.graview-kind-stop-table td[data-empty] b{font-weight:400;color:var(--graview-ink-faint)}
|
|
57
|
-
.graview-kind-stop-table tr[data-graview-pick]{cursor:default}
|
|
58
|
-
.graview-kind-stop-more{margin:10px 0 0;font-size:.875rem}
|
|
59
|
-
.graview-kind-stop-table-at[data-graview-choosable]{outline:none}
|
|
60
|
-
[data-graview-choosable]:hover .graview-choose-all .graview-choose-box{opacity:1}
|
|
61
|
-
.graview-kind-stop-table .graview-choose-at{width:1%;padding-right:0;vertical-align:middle}
|
|
62
|
-
@container (max-width: 559px){
|
|
63
|
-
.graview-kind-stop{padding:12px}
|
|
64
|
-
.graview-kind-stop-acts{flex:1 1 100%}
|
|
65
|
-
.graview-kind-stop-primary{flex:1 1 auto}
|
|
66
|
-
.graview-kind-stop-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
|
|
67
|
-
.graview-kind-stop-table,.graview-kind-stop-table tbody,.graview-kind-stop-table tr{display:block}
|
|
68
|
-
.graview-kind-stop-table tr{position:relative;padding:8px 40px 8px 0;border-top:1px solid var(--graview-edge)}
|
|
69
|
-
.graview-kind-stop-table th,.graview-kind-stop-table td{display:block;padding:1px 0;border:0}
|
|
70
|
-
.graview-kind-stop-table td>span{display:inline}
|
|
71
|
-
.graview-kind-stop-table td[data-short]{white-space:normal}
|
|
72
|
-
.graview-kind-stop-table td[data-label]::before{content:attr(data-label) " \xB7 ";color:var(--graview-ink-muted)}
|
|
73
|
-
.graview-kind-stop-row-acts{position:absolute;top:6px;right:0;width:auto}
|
|
74
|
-
.graview-kind-stop-table [data-graview-choose]{padding-left:34px}
|
|
75
|
-
.graview-kind-stop-table td.graview-choose-at{position:absolute;left:0;top:8px;width:auto;padding:0}
|
|
76
|
-
.graview-kind-stop-table thead .graview-choose-at{position:static}
|
|
77
|
-
}
|
|
78
|
-
@media (pointer: coarse){
|
|
79
|
-
.graview-kind-stop-table-at:not([data-graview-choosing]) .graview-choose-at{display:none}
|
|
80
|
-
.graview-kind-stop-table-at:not([data-graview-choosing]) [data-graview-choose]{padding-left:0}
|
|
81
|
-
}
|
|
82
|
-
@media (pointer: coarse){
|
|
83
|
-
.graview-kind-stop-primary,.graview-kind-stop-quiet,.graview-kind-stop-fact,.graview-kind-stop-rule,.graview-kind-stop-link,.graview-kind-stop-switch button,.graview-kind-stop-row-acts button{min-height:44px}
|
|
84
|
-
.graview-kind-stop-row-acts button{min-width:44px}
|
|
85
|
-
.graview-kind-stop-name button{min-height:44px}
|
|
86
|
-
}
|
|
87
|
-
@media (prefers-reduced-motion: reduce){.graview-kind-stop *{transition:none!important;animation:none!important}}
|
|
88
|
-
`;export{Jt as KindStop};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as O,b}from"./chunk.UN2OB6OD.js";import"./chunk.LJXAZ5TF.js";import"./chunk.QFI4L2HK.js";import"./chunk.KFHXTHIY.js";import"./chunk.ZK446PSX.js";import{$ as S,G as z,S as M}from"./chunk.SGMVLKZO.js";import"./chunk.SDO3U72B.js";import{Tc as A}from"./chunk.BLS2G3CD.js";import"./chunk.EJUZGIQ5.js";import{b as v}from"./chunk.AJZBJBMO.js";var o=v(z(),1);var t=v(M(),1);function G(i){for(let d of i)for(let[r,s]of Object.entries(d))if(s===!1)return`${r} == true`;return""}var w={margin:0,fontSize:"0.8125rem",color:"var(--graview-ink-muted)"};function j({ask:i,close:d}){let{store:r,principal:s,subscriptions:h,app:f}=S(),c=(0,o.useRef)(null),p=(0,o.useId)(),[n,u]=(0,o.useState)(0),[l,y]=(0,o.useState)(!0),[m,P]=(0,o.useState)(()=>{let e=i.choices.find(g=>g.on==="reaches");if(!e)return"";let a=e.record!==void 0?r.graph.getNode(e.record):void 0;return G(a?[a]:r.graph.nodesOfKind(e.kind).slice(0,5))}),[C,x]=(0,o.useState)(null),[W,k]=(0,o.useState)(!1);(0,o.useEffect)(()=>{let e=c.current;e&&!e.open&&e.showModal()},[]);let T=()=>{let e=i.returnTo;d(),requestAnimationFrame(()=>{e?.isConnected?e.focus():document.querySelector("[data-graview-page-title], main h1, [data-testid='activity-button']")?.focus()})},N=e=>e.on==="reaches"?{...e,condition:m}:e,E=e=>b(r,{when:N(e),alsoMine:!l}),L=async()=>{let e=N(i.choices[n]),a=O(r,e);if(a){x(a);return}k(!0);try{await h.add({who:A(s),app:f?.name??"app",when:e,...l?{}:{alsoMine:!0}}),T()}catch(g){k(!1),x(g instanceof Error?g.message:String(g))}};return(0,t.jsx)("dialog",{ref:c,"aria-labelledby":p,"data-testid":"notify-sheet",onClose:T,onClick:e=>{e.target===e.currentTarget&&e.currentTarget.close()},style:{width:"min(92vw, 420px)",padding:0,border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)",color:"var(--graview-ink)",boxShadow:"var(--graview-lift-high)"},children:(0,t.jsxs)("form",{method:"dialog",onSubmit:e=>{e.preventDefault(),L()},style:{display:"grid",gap:12,padding:18},children:[(0,t.jsx)("h2",{id:p,style:{margin:0,fontSize:"1.0625rem"},children:"Notify me"}),(0,t.jsxs)("fieldset",{style:{margin:0,padding:0,border:0,display:"grid",gap:6},children:[(0,t.jsx)("legend",{style:{...w,marginBottom:6},children:"Tell me"}),i.choices.map((e,a)=>(0,t.jsxs)("label",{style:{display:"flex",gap:8,alignItems:"baseline",cursor:"pointer"},children:[(0,t.jsx)("input",{type:"radio",name:`${p}-when`,checked:n===a,onChange:()=>u(a),"data-notify-choice":e.on}),(0,t.jsx)("span",{children:e.on==="reaches"?`When ${e.record!==void 0?"it":"one"} reaches a condition`:E(e)})]},a))]}),i.choices[n]?.on==="reaches"?(0,t.jsxs)("label",{style:{display:"grid",gap:4},children:[(0,t.jsx)("span",{style:w,children:"The condition, in the app's own words (done == true, amount > 100)"}),(0,t.jsx)("input",{value:m,onChange:e=>P(e.target.value),"data-testid":"notify-condition",autoComplete:"off",spellCheck:!1})]}):null,(0,t.jsxs)("label",{style:{display:"flex",gap:8,alignItems:"center"},children:[(0,t.jsx)("input",{type:"checkbox",checked:l,onChange:e=>y(e.target.checked),"data-testid":"notify-others-only"}),"Only when someone else does it"]}),(0,t.jsxs)("p",{style:w,"data-testid":"notify-said",children:[E(i.choices[n]),"."]}),C?(0,t.jsx)("p",{role:"alert",style:{margin:0,color:"var(--graview-danger, var(--graview-ink))"},children:C}):null,(0,t.jsxs)("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[(0,t.jsx)("button",{type:"button",onClick:()=>c.current?.close(),children:"Cancel"}),(0,t.jsx)("button",{type:"submit",autoFocus:!0,disabled:W,"data-testid":"notify-keep",style:{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"},children:"Notify me"})]})]})})}function B({style:i}){let{store:d,principal:r,subscriptions:s,app:h}=S(),f=(r.onBehalfOf??r).id,[c,p]=(0,o.useState)([]);return(0,o.useEffect)(()=>{if(f===void 0)return;let n=!0,u=()=>void Promise.resolve(s.list(f)).then(y=>n&&p(y.filter(m=>m.app===(h?.name??"app"))),()=>n&&p([]));u();let l=s.onChange?.(u);return()=>{n=!1,l?.()}},[s,f,h]),c.length===0?null:(0,t.jsxs)("section",{"aria-label":"What you are told of","data-testid":"notified",style:{display:"grid",gap:6,...i},children:[(0,t.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:"You are told"}),(0,t.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:4},children:c.map(n=>(0,t.jsxs)("li",{style:{display:"flex",gap:8,alignItems:"baseline",justifyContent:"space-between"},"data-subscription":n.id,children:[(0,t.jsx)("span",{style:{fontSize:"0.8125rem"},children:b(d,n)}),(0,t.jsx)("button",{type:"button","data-testid":"notify-stop","aria-label":`Stop: ${b(d,n)}`,onClick:u=>{let l=u.currentTarget.closest("li"),y=(l?.nextElementSibling??l?.previousElementSibling)?.querySelector("button");Promise.resolve(s.remove(n.id)).then(()=>(y??document.querySelector("[data-testid='activity-button']"))?.focus())},style:{padding:"1px 8px",fontSize:"0.8125rem"},children:"Stop"})]},n.id))})]})}export{B as NotifiedList,j as NotifySheet};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as y}from"./chunk.MRUDTYOL.js";import"./chunk.ZK446PSX.js";import{G as w,S as c}from"./chunk.SGMVLKZO.js";import"./chunk.SDO3U72B.js";import"./chunk.BLS2G3CD.js";import"./chunk.EJUZGIQ5.js";import{b as l}from"./chunk.AJZBJBMO.js";var r=l(w(),1);var t=l(c(),1);function x({field:d,label:p,value:m,markdown:b,onSave:n,onCancel:u}){let[a,v]=(0,r.useState)(m),[i,h]=(0,r.useState)(!1),o=(0,r.useRef)(null);return(0,r.useEffect)(()=>o.current?.focus(),[i]),(0,r.useLayoutEffect)(()=>{let e=o.current;if(!e||i||typeof CSS<"u"&&CSS.supports?.("field-sizing","content"))return;let f=()=>{e.style.height="auto";let g=getComputedStyle(e);e.style.height=`${e.scrollHeight+parseFloat(g.borderTopWidth)+parseFloat(g.borderBottomWidth)}px`};f();let S=requestAnimationFrame(f);return()=>cancelAnimationFrame(S)},[a,i]),(0,t.jsxs)("form",{style:{display:"grid",gap:8,minWidth:0},onSubmit:e=>{e.preventDefault(),n(a,!1)},children:[i?(0,t.jsx)("div",{"data-graview-preview":d,"aria-label":`${p}, as it will read`,role:"region",style:C,children:(0,t.jsx)(y,{text:a,markdown:!0})}):(0,t.jsx)("textarea",{ref:o,"aria-label":p,"data-graview-field":d,value:a,rows:3,onChange:e=>v(e.target.value),onKeyDown:e=>{e.key==="Escape"?(e.preventDefault(),u()):e.key==="Enter"&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),n(a,!1))},onBlur:e=>{e.relatedTarget instanceof Node&&e.currentTarget.form?.contains(e.relatedTarget)||n(a,!0)},style:E}),(0,t.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:8},children:[(0,t.jsx)("button",{type:"submit",style:s,children:"Save"}),(0,t.jsx)("button",{type:"button",onClick:u,style:s,children:"Cancel"}),b?(0,t.jsx)("button",{type:"button","aria-pressed":i,onClick:()=>h(!i),style:s,children:i?"Write":"Preview"}):null,(0,t.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:"Ctrl or \u2318 Enter saves \xB7 Esc puts it back"})]})]})}var C={minHeight:"7.5em",padding:"8px 10px",border:"1px dashed var(--graview-edge-bright)",borderRadius:6,lineHeight:1.6,minWidth:0},s={font:"inherit",fontSize:"0.8125rem",minHeight:28,padding:"2px 12px"},E={font:"inherit",lineHeight:1.5,width:"100%",boxSizing:"border-box",minHeight:"7.5em",padding:"8px 10px",resize:"vertical",fieldSizing:"content",color:"var(--graview-ink)",background:"var(--graview-panel, transparent)",border:"1px solid var(--graview-edge-bright)",borderRadius:6};export{x as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var a=e=>e.at+e.removed.length;function i(e,t){if(!Number.isInteger(t.at)||t.at<0||t.at>e.length||e.slice(t.at,a(t))!==t.removed)throw new RangeError(`The text does not hold ${JSON.stringify(t.removed)} at ${t.at}.`);return e.slice(0,t.at)+t.inserted+e.slice(a(t))}var s="\0graview:unset",y=e=>e===void 0||e===s;function f(e){if(e.op!=="patch-node")return e;let t=r=>Object.fromEntries(Object.entries(r).map(([n,d])=>[n,d===void 0?s:d]));return{...e,before:t(e.before),after:t(e.after)}}function o(e){switch(e.op){case"add-node":return{op:"remove-node",node:e.node};case"remove-node":return{op:"add-node",node:e.node};case"patch-node":return{op:"patch-node",id:e.id,before:e.after,after:e.before};case"add-edge":return{op:"remove-edge",edge:e.edge};case"remove-edge":return{op:"add-edge",edge:e.edge};case"splice-text":return{...e,removed:e.inserted,inserted:e.removed}}}function p(e){switch(e.op){case"add-node":case"remove-node":return[e.node.id];case"patch-node":case"splice-text":return[e.id];case"add-edge":case"remove-edge":return[e.edge.from,e.edge.to]}}function x(e,t,r=!1){let n=e[t.field];if(typeof n!="string")return e;try{return{...e,[t.field]:i(n,r?o(t):t)}}catch{return e}}var u=new WeakMap;function m(e){return[...e].reverse().map(f).map(o)}function S(e){if(e.inverse)return e.inverse;let t=u.get(e);return t||u.set(e,t=m(e.primitives)),t}function c(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r]&&JSON.stringify(e[r])!==JSON.stringify(t[r]))return!1;return!0}function T(e){if(e.inverse===void 0||!c(e.inverse,m(e.primitives)))return e;let{inverse:t,...r}=e;return r}export{i as a,s as b,y as c,f as d,o as e,p as f,x as g,S as h,T as i};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as z,g as Z,h as ee}from"./chunk.3L5USMQD.js";import{a as Q,b as X}from"./chunk.GQI53L5P.js";import{b}from"./chunk.LDE5HLTM.js";import{d as q}from"./chunk.73BJYIYS.js";import{a as K}from"./chunk.IDQHSAAQ.js";import{a as I}from"./chunk.TT6QBWRA.js";import{m as J}from"./chunk.ZK446PSX.js";import{$ as v,Ea as V,G as F,J as P,O as L,P as T,Pa as Y,S as U,Ta as _,ha as G}from"./chunk.SGMVLKZO.js";import{a as $}from"./chunk.SDO3U72B.js";import{Ya as H,da as j,fa as E,tb as A}from"./chunk.BLS2G3CD.js";import{b as W}from"./chunk.AJZBJBMO.js";var c=W(F(),1);var te=W(F(),1);function ne(){let{ai:i,aiDesk:n}=v(),{entries:r}=P(n),a=i.off===!0;return(0,te.useEffect)(()=>{a||n.load()},[n,a]),a?[]:r}var e=W(U(),1),ae=V($(()=>(__graviewPreload(import.meta.url,["./chunk.ROJZLOKZ.js","./chunk.VM43YREJ.js","./chunk.ZK446PSX.js","./chunk.SGMVLKZO.js","./chunk.SDO3U72B.js","./chunk.BLS2G3CD.js","./chunk.EJUZGIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.3O3H37WD.js")))),ge=ae.part((i,n)=>(0,e.jsx)(i.InteractionRow,{...n}),{quiet:!0,as:"li"}),ue=ae.part((i,n)=>(0,e.jsx)(i.ActivityFilter,{...n}),{quiet:!0,as:"div"}),ie=(i,n,r=re(i,[n]))=>({intent:n.intent,author:n.author.kind,...n.author.id?{authorId:n.author.id}:{},by:n.author,...n.ops[0]?.via?{via:n.ops[0].via}:{},...n.lineage?{basis:K(n.lineage)}:{},touched:[...new Set(n.ops.filter(a=>!A(a)).flatMap(a=>a.writes))],...ce(n.ops.filter(a=>!A(a)).flatMap(a=>a.writes),r),batch:n.id,at:n.at,...n.lineage?.interaction?{interaction:n.lineage.interaction}:{},seq:n.ops.at(-1).seq+1,...n.ops.every(A)?{withheld:!0}:{}});function he(i=4){let{store:n,principal:r}=v(),a=T(n,r),d=a.log.length;return(0,c.useMemo)(()=>{let s=a.batches(),l=re(a,s);return Q(s,o=>a.log.get(o)).reverse().slice(0,i).map(o=>{if("batch"in o)return ie(a,o.batch,l);let g=[...o.digest.batches].reverse().map(u=>ie(a,u,l));return{intent:X(o.digest),author:o.digest.author.kind,...o.digest.author.id?{authorId:o.digest.author.id}:{},by:o.digest.author,touched:[...new Set(g.flatMap(u=>u.touched))],batch:"",...g[0]?.at?{at:g[0].at}:{},seq:g[0]?.seq??0,digest:g}})},[a,d,i])}function re(i,n){let r=new Map;for(let a of n)for(let d of a.ops)if(!A(d))for(let s of d.primitives)(s.op==="add-node"||s.op==="remove-node")&&s.node&&r.set(s.node.id,j(i.schema.tryDefinition(s.node.kind),s.node));return r}function ce(i,n){let r={};for(let a of i){let d=n.get(a);d!==void 0&&(r[a]=d)}return Object.keys(r).length>0?{named:r}:{}}function ye({change:i}){let{store:n,principal:r,seats:a,people:d}=v();return(0,e.jsxs)("strong",{style:{fontWeight:600},children:[i.author==="human"&&i.by?.onBehalfOf===void 0&&(i.authorId===void 0||r.id===void 0||i.authorId===r.id)?"you":H(i.by??{kind:i.author,id:i.authorId},{graph:n.graph,schema:n.schema,seats:a,people:d}),I(i.via)?(0,e.jsxs)("span",{style:{fontWeight:400,color:"var(--graview-ink-muted)"},children:[", ",I(i.via)]}):null]})}function fe({change:i,goes:n}){let{store:r}=v(),[a,d]=(0,c.useState)(!1),s=i.digest??[];return(0,e.jsxs)("li",{"data-testid":"activity-digest",style:{display:"grid",gap:5,lineHeight:1.45},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,e.jsxs)("span",{style:{minWidth:0},children:[(0,e.jsx)(ye,{change:i})," ",(0,e.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:i.intent})]}),(0,e.jsx)("button",{type:"button","data-testid":"digest-toggle","aria-expanded":a,onClick:()=>d(l=>!l),style:{marginLeft:"auto",flex:"0 0 auto",display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,padding:"1px 8px",fontSize:"0.75rem"},children:a?"Hide":"Show each"})]}),a?(0,e.jsx)("ol",{"data-testid":"digest-changes",style:{margin:0,padding:"0 0 0 10px",listStyle:"none",display:"grid",gap:6,borderLeft:"1px solid var(--graview-edge)"},children:s.map(l=>(0,e.jsxs)("li",{"data-testid":"digest-change",style:{display:"grid",gap:3},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,e.jsxs)("span",{style:{minWidth:0},children:[(0,e.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:l.intent}),l.basis?(0,e.jsxs)("span",{"data-graview-lineage":"",style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",l.basis]}):null]}),l.withheld?null:(0,e.jsx)(B,{batch:l.batch})]}),l.touched.length>0?(0,e.jsx)("div",{"data-touched":l.touched.join(" "),style:{display:"flex",flexWrap:"wrap",gap:4},children:l.touched.slice(0,4).map(o=>(0,e.jsx)(M,{id:o,label:r.graph.has(o)?b(r,o):l.named?.[o]??b(r,o),go:n(o)},o))}):null]},l.batch))}):null]})}function B({batch:i}){let{store:n,principal:r,noteSeat:a}=v(),d=T(n,r),s=L()?.open??!1,l=d.log.length,[o,g]=(0,c.useState)(null),u=(0,c.useMemo)(()=>d.canUndo(i),[d,i,l]);if(s||!u.ok&&u.ops.length===0)return null;let w=!u.ok,k=w?u.includeBatches:[];return(0,e.jsxs)("span",{style:{marginLeft:"auto",flex:"0 0 auto",display:"grid",justifyItems:"end",gap:2},children:[(0,e.jsx)("button",{type:"button","data-testid":"undo-turn",title:w?`${u.message} \u2014 undo those too`:"Take this back, keeping everything since",onClick:()=>{g(null);try{let m=d.log.all().find(x=>x.batch===i&&x.author.kind==="agent");d.undo(w?[i,...k]:i,{author:r}),m&&a({type:"home",author:m.author})}catch(m){g(m instanceof Error?m.message:String(m))}},style:{display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,padding:"1px 8px",fontSize:"0.75rem",...w?{borderColor:"var(--graview-warn)",color:"var(--graview-warn)"}:{}},children:w?`undo +${k.length}`:"undo"}),o?(0,e.jsx)("span",{"data-testid":"undo-refused",role:"alert",style:{fontSize:"0.75rem",lineHeight:1.4,color:"var(--graview-warn)",maxWidth:260,textAlign:"right"},children:o}):null]})}function me({seq:i,intent:n}){let r=L();if(!r)return null;let a=r.past?.seq===i;return(0,e.jsx)("button",{type:"button","data-testid":"show-past","aria-label":`Show the app as it was after \u201C${n}\u201D`,title:"Show the app as it was here","aria-pressed":a,onPointerEnter:z,onFocus:z,onClick:()=>r.show(i),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minHeight:24,minWidth:24,padding:"1px 6px",fontSize:"0.75rem",flex:"0 0 auto"},children:(0,e.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[(0,e.jsx)("path",{d:"M2.5 8 a5.5 5.5 0 1 0 1.6-3.9",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,e.jsx)("path",{d:"M2 2.5 V5.5 H5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,e.jsx)("path",{d:"M8 5 V8 L10 9.25",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})})}function ve(){let i=()=>{let n=new URL(window.location.href);return n.searchParams.set("fresh","1"),n.toString()};return(0,e.jsx)("a",{href:"#fresh","data-testid":"start-fresh",title:"Forget every edit made in this browser and return to the example",onClick:n=>{n.preventDefault(),window.location.assign(i())},style:{display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,fontSize:"0.8125rem",color:"var(--graview-ink-muted)",textDecoration:"underline",textDecorationColor:"var(--graview-edge-bright)",textUnderlineOffset:3},children:"Start fresh"})}function M({id:i,label:n,go:r}){return r?(0,e.jsx)("button",{type:"button","data-testid":"activity-record","data-record":i,title:`Go to ${n}`,onClick:()=>r(i),style:{all:"unset",display:"inline-flex",cursor:"pointer",borderRadius:7},className:"graview-activity-record",children:(0,e.jsx)(q,{label:n})}):(0,e.jsx)(q,{label:n})}function Oe({calls:i,seat:n,remembers:r=!1}){let a=he(),{store:d,principal:s,seats:l,people:o}=v(),g=ne(),[u,w]=(0,c.useState)("all"),[k,m]=(0,c.useState)(!1),x=t=>t!==void 0&&(t.id===s.id||t.onBehalfOf?.id===s.id)&&s.id!==void 0,oe=new Set(g.map(t=>t.id)),se=a.filter(t=>!(t.interaction!==void 0&&oe.has(t.interaction))&&(!k||x(t.by))),de=g.filter(t=>!k||x(t.by)).slice(0,4),C=[...u==="ai"?[]:se.map(t=>({at:t.at??"",change:t})),...u==="changes"?[]:de.map(t=>({at:t.at,entry:t}))].sort((t,y)=>t.at<y.at?1:t.at>y.at?-1:0),f=T(d,s),O=i.some(t=>t.phase==="running"),le=Z(),S=_("activity"),D=S.open,pe=G(),N=L(),R=t=>f.graph.has(t)?y=>{S.setOpen(!1),N?.past&&N.show(null),pe.record(y)}:null;return n===void 0&&i.length===0&&a.length===0&&g.length===0&&!r&&le===0?null:(0,e.jsxs)("div",{style:{position:"relative"},children:[(0,e.jsxs)("button",{type:"button","data-testid":"activity-button",...S.trigger,onClick:S.toggle,title:O?"An agent is working":"What has happened",style:{display:"inline-flex",alignItems:"center",gap:6,minHeight:30,padding:"0 8px",borderRadius:8,border:"1px solid transparent",background:"transparent",boxShadow:"none",fontSize:"0.875rem",whiteSpace:"nowrap",color:O?"var(--graview-accent)":"var(--graview-ink-muted)"},children:[O?(0,e.jsx)("span",{"aria-hidden":"true",style:{width:6,height:6,borderRadius:999,background:"var(--graview-accent)"}}):null,a.length>0?a.length:"",(0,e.jsxs)("svg",{className:"graview-activity-mark",width:"15",height:"15",viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",style:{display:"var(--graview-activity-mark, none)"},children:[(0,e.jsx)("circle",{cx:"8",cy:"8",r:"5.75",fill:"none",stroke:"currentColor",strokeWidth:"1.4"}),(0,e.jsx)("path",{d:"M8 4.75 V8 L10.25 9.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}),(0,e.jsx)("span",{className:"graview-activity-word",children:" Activity"})]}),!D&&n!==void 0?(0,e.jsx)("div",{hidden:!0,"data-testid":"agent-seat-seated",children:n}):null,D?(0,e.jsxs)("section",{...S.pane,"aria-label":"Activity","data-testid":"activity","data-graview-offstage":"",style:{...Y,width:300,maxHeight:"min(52cqh, 460px)",overflow:"auto",display:"flex",flexDirection:"column",gap:9,padding:12,borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:[(0,e.jsx)("h2",{style:{...J,margin:0},children:"Activity"}),n!==void 0?(0,e.jsxs)("div",{"data-testid":"agent-seat-row",style:{display:"grid",gap:5,paddingBottom:i.length>0||C.length>0?9:0,...i.length>0||C.length>0?{borderBottom:"1px solid var(--graview-edge)"}:{}},children:[(0,e.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:"The agent's seat"}),n]}):null,i.length>0?(0,e.jsx)("ol",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:7},children:i.slice(0,6).map((t,y)=>(0,e.jsxs)("li",{style:{display:"grid",gap:2,fontSize:"0.8125rem",lineHeight:1.45},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,e.jsx)("span",{"aria-hidden":"true",style:{width:6,height:6,borderRadius:999,flex:"0 0 auto",background:t.phase==="running"?"var(--graview-accent)":t.phase==="failed"?"var(--graview-warn)":"var(--graview-edge-bright)"}}),(0,e.jsxs)("span",{style:{color:"var(--graview-ink)"},children:[t.mutating?"changed":"read"," \xB7"," ",f.allMutations().find(p=>p.name===t.name)?.title??E(t.name)]})]}),!t.mutating&&t.reads&&t.reads.length>0?(0,e.jsxs)("div",{"data-testid":"activity-reads",style:{display:"flex",flexWrap:"wrap",gap:4,paddingLeft:12},children:[[...new Set(t.reads)].slice(0,3).map(p=>(0,e.jsx)(M,{id:p,label:b(f,p),go:R(p)},p)),new Set(t.reads).size>3?(0,e.jsxs)("span",{style:{color:"var(--graview-ink-muted)"},children:["+",new Set(t.reads).size-3]}):null]}):Object.values(t.args).some(p=>typeof p=="string")?(0,e.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4,paddingLeft:12},children:Object.entries(t.args).filter(p=>typeof p[1]=="string").slice(0,3).map(([p,h])=>(0,e.jsx)(M,{id:h,label:b(f,h),go:R(h)},p))}):null,t.error?(0,e.jsx)("div",{style:{paddingLeft:12,color:"var(--graview-warn)"},children:t.error}):null]},`${t.at}:${y}`))}):null,g.length>0?(0,e.jsx)(c.Suspense,{fallback:null,children:(0,e.jsx)(ue,{shows:u,onShows:w,mine:k,onMine:m})}):null,C.length>0?(0,e.jsx)("ol",{"data-testid":"diff-log",style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6,fontSize:"0.8125rem"},children:C.map(({change:t,entry:y},p)=>y!==void 0?(0,e.jsx)(c.Suspense,{fallback:null,children:(0,e.jsx)(ge,{entry:y,undo:h=>(0,e.jsx)(B,{batch:h})})},`ai:${y.id}`):t.digest?(0,e.jsx)(fe,{change:t,goes:R},`digest:${t.digest[0]?.batch??p}`):t.withheld?(0,e.jsx)("li",{"data-testid":"withheld-change",style:{display:"grid",gap:3,lineHeight:1.45},children:(0,e.jsx)("span",{"data-touched":"",style:{color:"var(--graview-ink-muted)",fontStyle:"italic"},children:t.intent})},`change:${p}`):(0,e.jsxs)("li",{"data-batch":t.batch,style:{display:"grid",gap:3,lineHeight:1.45},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,e.jsxs)("span",{style:{minWidth:0},children:[(0,e.jsxs)("strong",{style:{fontWeight:600},children:[t.author==="human"&&t.by?.onBehalfOf===void 0&&(t.authorId===void 0||s.id===void 0||t.authorId===s.id)?"you":H(t.by??{kind:t.author,id:t.authorId},{graph:f.graph,schema:f.schema,seats:l,people:o}),I(t.via)?(0,e.jsxs)("span",{style:{fontWeight:400,color:"var(--graview-ink-muted)"},children:[", ",I(t.via)]}):null]})," ",(0,e.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:t.intent}),t.basis?(0,e.jsxs)("span",{"data-graview-lineage":"",style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",t.basis]}):null]}),t.batch?(0,e.jsx)(me,{seq:t.seq,intent:t.intent}):null,t.batch?(0,e.jsx)(B,{batch:t.batch}):null]}),(0,e.jsx)("div",{"data-touched":t.touched.join(" "),style:{display:"flex",flexWrap:"wrap",gap:4},children:t.touched.slice(0,4).map(h=>(0,e.jsx)(M,{id:h,label:f.graph.has(h)?b(f,h):t.named?.[h]??b(f,h),go:R(h)},h))})]},`change:${p}`))}):null,(0,e.jsx)(ee,{style:{paddingTop:8,borderTop:"1px solid var(--graview-edge)"}}),r?(0,e.jsxs)("div",{"data-testid":"remembered",style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:10,paddingTop:8,borderTop:"1px solid var(--graview-edge)",fontSize:"0.8125rem",color:"var(--graview-ink-faint)"},children:[(0,e.jsx)("span",{children:"Remembered in this browser"}),(0,e.jsx)(ve,{})]}):null]}):null]})}export{B as a,Oe as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as f}from"./chunk.TI4OSTQV.js";import{$b as k,I as v,M,P as I,T as x,W as P,cc as B,eb as j,fb as y,gc as K,jc as w}from"./chunk.BLS2G3CD.js";var O=(e,t)=>e.expiresAt!==void 0&&Date.parse(e.expiresAt)<=Date.parse(t),L=(e,t,n)=>(e??[]).some(i=>i.suggestion===t&&(i.until===void 0||Date.parse(i.until)>Date.parse(n)));function N(e,t=()=>!0,n={}){let i=k(e),s=new Set(e.map(r=>r.lineage?.suggestion)),o=n.now??new Date().toISOString();return e.filter(r=>r.suggests&&!r.withheld&&!i.has(r.id)&&!s.has(r.id)&&!O(r,o)&&!L(n.dismissed,r.id,o)).map(({id:r,batch:a,suggests:l,intent:u,author:d,lineage:p,at:m,expiresAt:c})=>{let g=new Set;return JSON.stringify(l.map(D=>D.args),(D,S)=>(typeof S=="string"&&t(S)&&g.add(S),S)),{id:r,batch:a,calls:l,intent:u,author:d,...p?{lineage:p}:{},at:m,expiresAt:c,about:[...g]}})}function R(e,t){return e.ops.length>0&&e.ops.every(n=>n.suggests!==void 0||n.undoes!==void 0&&t(n.undoes)?.suggests!==void 0)}var b=e=>JSON.stringify([e.kind,e.id??"",e.name??""]),$=e=>e.ops.find(t=>t.lineage?.run!==void 0)?.lineage?.run;function F(e,t=()=>{}){let n=[];for(let i of e){if(R(i,t))continue;if(!K(i.author)){n.push({batch:i});continue}let s=$(i),o=b(i.author),r=s!==void 0?n.findIndex(d=>"digest"in d&&d.digest.run===s&&b(d.digest.author)===o):n.length-1,a=n[r],l=a!==void 0&&"digest"in a&&b(a.digest.author)===o&&a.digest.run===s?a.digest:void 0,u=[...l?.batches??[],i];l&&n.splice(r,1),n.push({digest:{author:i.author,batches:u,things:V(u),at:i.at,...s!==void 0?{run:s}:{}}})}return n}var V=e=>e.reduce((t,n)=>t+(n.undone?0:n.ops.length),0),W=e=>{let t=Date.parse(e);if(Number.isNaN(t))return!1;let{minutes:n}=I(t,M());return n<6*60||n>=21*60};function E(e,t=x(new Date().toISOString())??v()){let n=x(e.at)??e.at.slice(0,10),s=e.run!==void 0&&n===t&&[e.at,...(e.batches??[]).map(o=>o.at)].every(W)?"overnight":n===t?"today":`on ${P(n)}`;return`Tidied ${e.things===1?"one thing":`${e.things} things`} ${s}`}var h=e=>e,A=(e,t)=>t===void 0?{}:{[e]:t};function ne(e,t,n){let i=f(e)?.store??e,s=h(i),o=B(n.lineage);if(o===void 0)throw new y("A suggestion says what it is based on: { basis, confidence? }");let r=n.author??s.by;if(n.expiresAt!==void 0&&Number.isNaN(Date.parse(n.expiresAt)))throw new y(`A suggestion expires at a time: "${n.expiresAt}" is not one (an ISO time, like 2026-10-23T06:00:00Z).`);let a=s.actMeanings(),l=w(t,a),u=C(i).find(g=>w(g.calls,a)===l);if(u)return i.log.get(u.id);s.refuseDeclined(t,r);let d=s.rehearsal();d.suggesting=!0;let p=d.applying(t,{author:r,lineage:o,...A("via",n.via)});if(p.ops.length===0)return;let m=[...new Set(p.ops.flatMap(g=>g.described??[]))],c={id:s.nextId(),seq:i.log.length,batch:s.mintBatch("batch"),author:r,intent:p.ops.map(g=>g.intent).join("; "),...A("batchIntent",n.intent),mutation:null,primitives:[],reads:[],writes:[],...m.length>0?{described:m}:{},at:s.now(),...A("via",n.via),lineage:o,suggests:t,...A("expiresAt",n.expiresAt)};return i.log.append(c),i.notify(j,[c]),c}function C(e,t,n={}){let i=f(e),s=i?.store??e,o=t??i?.principal,r=(o!==void 0?s.seenBy(o):s).log.all();return N(r,a=>s.graph.has(a),{now:h(s).now(),dismissed:n.dismissed})}function T(e,t,n){let i=C(e,n).find(o=>o.id===t),s=i?void 0:e.log.get(t);if(s?.suggests&&O(s,h(e).now()))throw new y(`That suggestion expired on ${s.expiresAt.slice(0,10)}.`);if(!i)throw new y("That suggestion is no longer waiting: it was accepted or declined, or it is not one you can see.");return i}function te(e,t,n={}){let i=f(e)?.store??e,s=n.author??h(i).by,o=T(i,t,s);return i.applyAll(o.calls,{...n,author:s,lineage:{...o.lineage,suggestion:t}})}function ie(e,t,n={}){let i=f(e)?.store??e,s=n.author??h(i).by,o=T(i,t,s);return i.undo(o.batch,{...n,author:s})}export{F as a,E as b,ne as c,C as d,te as e,ie as f};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as a,G as h,La as u,_ as d,ba as c}from"./chunk.SGMVLKZO.js";import{b as l}from"./chunk.AJZBJBMO.js";var i=l(h(),1);function w(){let e=u();return(0,i.useMemo)(()=>[...new Set(e.flatMap(o=>o.nodeIds))],[e])}function S(){let e=g(),o=d();return(0,i.useMemo)(()=>{if(!o)return e;let n=o.matched;return n.length===0&&e.length===0?[m]:[...new Set([...e,...n])]},[o,e])}function g(){let{store:e,selection:o}=a(),n=c();return(0,i.useMemo)(()=>{if(o.length===0)return[];let r=new Set(o),s=new Set(r);for(let t of e.graph.allEdges())r.has(t.from)&&s.add(t.to),r.has(t.to)&&s.add(t.from);for(let t of e.violations())if(t.subjectId!==void 0&&r.has(t.subjectId))for(let f of t.nodeIds)s.add(f);return[...s]},[e,o,n])}var m="search:nothing";export{w as a,S as b,g as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk.25VJPUDH.js";import"./chunk.KHRS2SKB.js";import"./chunk.NB6WN4DO.js";import"./chunk.N7FIUTVY.js";import{a as L,b as R,c as N}from"./chunk.YYS45ZGQ.js";import{b as T}from"./chunk.YG3BLY67.js";import"./chunk.GZEZMU2T.js";import"./chunk.4VJARLJ5.js";import"./chunk.TL7UGUY4.js";import"./chunk.5RNB6IC5.js";import"./chunk.ZITDUHX3.js";import"./chunk.ETWREHXF.js";import"./chunk.YZ6UKKEL.js";import"./chunk.HJCQ6I3S.js";import"./chunk.XWLGHTH6.js";import"./chunk.TY6VILZB.js";import"./chunk.BBNF52IB.js";import"./chunk.AXMC6XVT.js";import"./chunk.GQI53L5P.js";import"./chunk.LDE5HLTM.js";import"./chunk.GTUBIJTP.js";import"./chunk.DUIKIJKC.js";import"./chunk.73BJYIYS.js";import"./chunk.OKQ4JXTW.js";import"./chunk.M5RHVUZ6.js";import"./chunk.MRUDTYOL.js";import"./chunk.OUNLAMBA.js";import"./chunk.HGP3Q7QX.js";import"./chunk.QSZLY62B.js";import"./chunk.7VX6TBNY.js";import"./chunk.64TFAR5Z.js";import"./chunk.5DZR46YG.js";import"./chunk.L5MDUZLQ.js";import"./chunk.IDQHSAAQ.js";import"./chunk.Q7RI4SI4.js";import"./chunk.XOZU4OFA.js";import"./chunk.CR5MQMOL.js";import"./chunk.SVH3OMU2.js";import"./chunk.TI4OSTQV.js";import"./chunk.JJP5OL5E.js";import"./chunk.WVUJXDXZ.js";import"./chunk.6SHF6IL5.js";import"./chunk.MQISKON2.js";import"./chunk.GQX57JIE.js";import"./chunk.LJXAZ5TF.js";import"./chunk.QFI4L2HK.js";import"./chunk.KFHXTHIY.js";import"./chunk.GZHZLJBF.js";import{r as C}from"./chunk.JLR74UFP.js";import"./chunk.OJGHDWI6.js";import"./chunk.HG34MT7C.js";import"./chunk.TT6QBWRA.js";import"./chunk.UCS3CBT4.js";import"./chunk.O6SKKF4V.js";import"./chunk.ZK446PSX.js";import{$ as x,G as S,I as $,S as p,ba as A}from"./chunk.SGMVLKZO.js";import"./chunk.SDO3U72B.js";import{Ic as k,ca as h}from"./chunk.BLS2G3CD.js";import"./chunk.EJUZGIQ5.js";import{b as i}from"./chunk.AJZBJBMO.js";var r=i(S(),1);var l=i(S(),1);var g=i(p(),1);var m={font:"inherit",fontSize:"0.875rem",minHeight:24,padding:0,border:0,borderRadius:2,background:"transparent",boxShadow:"none",color:"var(--graview-accent)",textDecoration:"underline",textUnderlineOffset:3,textAlign:"start",cursor:"pointer"};var e=i(p(),1);function Y({page:n=!1,go:E,onPick:y,onDiscard:D}){let{store:d,seatTalk:c}=x(),u=$(c),M=N(),b=E??M,{keep:P}=L(b),[H,f]=(0,r.useState)(!1);A();let t=u.draft;(0,r.useEffect)(()=>f(!1),[t]),(0,r.useEffect)(()=>{n||R(!1)},[n]);let v=(0,r.useRef)(null),w=t!==null&&!n;if((0,r.useLayoutEffect)(()=>{let s=v.current;if(!w||!s?.parentElement)return;let o=[];for(let a=s.previousElementSibling;a;a=a.previousElementSibling)a instanceof HTMLElement&&!a.inert&&a.tagName!=="STYLE"&&(a.inert=!0,o.push(a));return()=>{for(let a of o)a.inert=!1}},[w]),!t)return null;let G=T(t.drawn),F=d.schema.tryDefinition(t.kind),q=d.graph.nodesOfKind(t.kind).filter(s=>h(F,s)),z=()=>{c.setDraft(null),D?.()};return(0,e.jsxs)("section",{ref:v,"data-testid":"draft-frame","data-graview-draft-frame":n?"page":"scene","aria-label":`Draft: ${t.title}`,style:n?{display:"grid",gap:12,minWidth:0}:{position:"absolute",inset:12,zIndex:k("rail"),display:"grid",gridTemplateRows:"auto auto minmax(0, 1fr)",background:"var(--graview-panel)",border:"1px solid var(--graview-edge)",borderRadius:12,boxShadow:"var(--graview-lift-high)",overflow:"hidden",minHeight:0},children:[(0,e.jsxs)("p",{"data-testid":"draft-line",style:{...K,...n?{}:{padding:"10px 16px"}},children:[n?(0,e.jsx)("span",{children:"Draft"}):(0,e.jsxs)("span",{children:["Draft \u2014 ",(0,e.jsx)("span",{"data-testid":"draft-title",style:{color:"var(--graview-ink)",fontWeight:600},children:t.title})]}),(0,e.jsx)("span",{"aria-hidden":"true",children:"\xB7"}),(0,e.jsx)("button",{type:"button","data-testid":"draft-keep",disabled:H,title:`Keep \u201C${t.title}\u201D as a lens: a place of its own`,onClick:()=>{f(!0),P(t).finally(()=>f(!1))},style:m,children:"Keep as a lens"}),(0,e.jsx)("span",{"aria-hidden":"true",children:"\xB7"}),(0,e.jsx)("button",{type:"button","data-testid":"draft-discard",onClick:z,style:m,children:"Discard"})]}),u.draftNote?(0,e.jsx)("p",{"data-testid":"draft-note",role:"status",style:{margin:0,padding:n?0:"0 16px 8px",fontSize:"0.8125rem",color:"var(--graview-warn)"},children:u.draftNote}):(0,e.jsx)("span",{}),(0,e.jsx)("div",{"data-testid":"draft-lens","data-graview-draft":t.lens.name,role:"group","aria-label":t.title,tabIndex:0,style:n?{height:"min(72vh, 760px)",display:"grid",gridTemplateRows:"minmax(0, 1fr)",overflow:"auto",scrollbarGutter:"stable",border:"1px solid var(--graview-edge)",borderRadius:12,background:"var(--graview-panel)"}:{minHeight:0,overflow:"auto",scrollbarGutter:"stable",display:"grid",gridTemplateRows:"minmax(0, 1fr)"},onClick:s=>{let o=s.target?.closest("[data-graview-pick]")?.getAttribute("data-graview-pick");if(!o||!d.graph.getNode(o))return;s.preventDefault();let a=d.graph.getNode(o);y?(c.setDraft(null),y(o)):b({to:"record",id:o,kind:a.kind,label:o,address:"",said:""})},children:(0,e.jsx)(C,{kind:t.kind,view:t.title,children:(0,e.jsx)(G,{nodes:q,label:t.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1})})})]})}var K={margin:0,display:"flex",flexWrap:"wrap",alignItems:"baseline",gap:"4px 8px",fontSize:"0.875rem",color:"var(--graview-ink-muted)",borderBottom:"1px solid var(--graview-edge)",paddingBottom:8};export{Y as DraftFrame};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as O}from"./chunk.OJGHDWI6.js";import{j as C}from"./chunk.UCS3CBT4.js";import{$ as w,G as x,Ja as G,S as M,aa as I,ba as W,c as V,x as B}from"./chunk.SGMVLKZO.js";import{C as D,Dc as _,Ec as L,Kc as j,Lb as F,Wb as N}from"./chunk.BLS2G3CD.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 +0,0 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}from"./chunk.KZ3UPV2L.js";import"./chunk.G4JJXA63.js";import"./chunk.64TFAR5Z.js";import"./chunk.5DZR46YG.js";import"./chunk.Q7RI4SI4.js";import"./chunk.XOZU4OFA.js";import"./chunk.CR5MQMOL.js";import"./chunk.Q5WEOX3Q.js";import"./chunk.RXJBYP7B.js";import"./chunk.BJAQRV2R.js";import"./chunk.JJP5OL5E.js";import"./chunk.WVUJXDXZ.js";import"./chunk.6SHF6IL5.js";import"./chunk.MQISKON2.js";import"./chunk.GQX57JIE.js";import"./chunk.LJXAZ5TF.js";import"./chunk.QFI4L2HK.js";import"./chunk.KFHXTHIY.js";import"./chunk.TT6QBWRA.js";import"./chunk.UCS3CBT4.js";import"./chunk.O6SKKF4V.js";import"./chunk.BLS2G3CD.js";import"./chunk.EJUZGIQ5.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 +0,0 @@
|
|
|
1
|
-
import{a as y,b as h}from"./chunk.UN2OB6OD.js";import"./chunk.LJXAZ5TF.js";import"./chunk.QFI4L2HK.js";import"./chunk.KFHXTHIY.js";import{Tc as b}from"./chunk.BLS2G3CD.js";import"./chunk.EJUZGIQ5.js";import"./chunk.AJZBJBMO.js";var k=(d,i)=>({id:i.id,said:h(d,i),when:i.when,...i.alsoMine?{alsoMine:!0}:{}});async function A(d,i,t){let a=b(t.principal);if(a.id===void 0)return{ok:!1,error:"This seat acts for nobody the app knows by id, so there is nobody to tell. Nothing was kept."};let r=t.store.seenBy(a),p=async()=>(await t.subscriptions.list(a.id)).filter(n=>n.app===t.app);if(d==="list_subscriptions")return{ok:!0,data:{subscriptions:(await p()).map(n=>k(r,n))}};if(d==="unsubscribe"){let n=String(i.id??"");return(await p()).some(g=>g.id===n)?(await t.subscriptions.remove(n),{ok:!0,data:{removed:n}}):{ok:!1,error:`No subscription "${n}" of yours. list_subscriptions says which there are.`}}let o=String(i.on??""),c=n=>typeof i[n]=="string"&&i[n].trim()!==""?i[n].trim():void 0,e=c("record");if(e!==void 0&&!r.graph.getNode(e)){let n=t.store.resolveRef({name:"record",kinds:["*"]},e,a);if(!n.ok)return{ok:!1,error:`${n.message} Nothing was kept.`};e=n.id}let s=c("kind")??(e!==void 0&&o!=="act"?r.graph.getNode(e)?.kind:void 0),f=c("act"),m=c("condition"),u=o==="act"?{on:o,...f!==void 0?{act:f}:{},...e!==void 0?{record:e}:{}}:o==="created"&&s!==void 0?{on:o,kind:s}:o==="changed"?{on:o,...s!==void 0&&e===void 0?{kind:s}:{},...e!==void 0?{record:e}:{}}:o==="reaches"&&s!==void 0?{on:o,kind:s,condition:m??"",...e!==void 0?{record:e}:{}}:void 0;if(!u)return{ok:!1,error:'Say what to be told of: on is "act", "created", "changed" or "reaches", with a kind (or a record) for all but act. Nothing was kept.'};let l=y({schema:r.schema,allMutations:()=>t.store.allMutations(),graph:r.graph},u);if(l)return{ok:!1,error:`${l} Nothing was kept.`};let S=await t.subscriptions.add({who:a,app:t.app,when:u,...i.alsoMine===!0?{alsoMine:!0}:{}});return{ok:!0,data:{subscription:k(r,S)}}}export{A as runSubscriptionTool};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{Ea as o,G as k,S as n}from"./chunk.SGMVLKZO.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.6SHF6IL5.js","./chunk.MQISKON2.js","./chunk.GQX57JIE.js","./chunk.LJXAZ5TF.js","./chunk.QFI4L2HK.js","./chunk.KFHXTHIY.js","./chunk.GZHZLJBF.js","./chunk.JLR74UFP.js","./chunk.OJGHDWI6.js","./chunk.HG34MT7C.js","./chunk.TT6QBWRA.js","./chunk.UCS3CBT4.js","./chunk.O6SKKF4V.js","./chunk.ZK446PSX.js","./chunk.SGMVLKZO.js","./chunk.SDO3U72B.js","./chunk.BLS2G3CD.js","./chunk.EJUZGIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.6VA5XFRR.js")))),y=f.part((e,r)=>e.drawFiles(r),{quiet:!0});var d=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.GZHZLJBF.js","./chunk.JLR74UFP.js","./chunk.OJGHDWI6.js","./chunk.HG34MT7C.js","./chunk.TT6QBWRA.js","./chunk.UCS3CBT4.js","./chunk.O6SKKF4V.js","./chunk.ZK446PSX.js","./chunk.SGMVLKZO.js","./chunk.SDO3U72B.js","./chunk.BLS2G3CD.js","./chunk.EJUZGIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.2VZSC2MB.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.JLR74UFP.js","./chunk.OJGHDWI6.js","./chunk.HG34MT7C.js","./chunk.TT6QBWRA.js","./chunk.UCS3CBT4.js","./chunk.O6SKKF4V.js","./chunk.ZK446PSX.js","./chunk.SGMVLKZO.js","./chunk.SDO3U72B.js","./chunk.BLS2G3CD.js","./chunk.EJUZGIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.M55U47A6.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.TT6QBWRA.js","./chunk.UCS3CBT4.js","./chunk.O6SKKF4V.js","./chunk.ZK446PSX.js","./chunk.SGMVLKZO.js","./chunk.SDO3U72B.js","./chunk.BLS2G3CD.js","./chunk.EJUZGIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.2P66HH5Y.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 +0,0 @@
|
|
|
1
|
-
import{k as a,l as b,m as c,n as d,o as e,p as f,q as g,r as h,s as i}from"./chunk.SJRXBTGP.js";import"./chunk.L5MDUZLQ.js";import"./chunk.IDQHSAAQ.js";import"./chunk.Q7RI4SI4.js";import"./chunk.XOZU4OFA.js";import"./chunk.CR5MQMOL.js";import"./chunk.VM43YREJ.js";import"./chunk.TI4OSTQV.js";import"./chunk.MQISKON2.js";import"./chunk.TT6QBWRA.js";import"./chunk.UCS3CBT4.js";import"./chunk.O6SKKF4V.js";import"./chunk.ZK446PSX.js";import"./chunk.SGMVLKZO.js";import"./chunk.SDO3U72B.js";import"./chunk.BLS2G3CD.js";import"./chunk.EJUZGIQ5.js";import"./chunk.AJZBJBMO.js";export{i as GhostTray,h as InlineAiMenu,g as askAgain,c as askInline,a as askOf,b as drawPanel,d as heldSuggestion,e as suggestOnce,f as takeOffer};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{c as Je,d as Ee,e as ze,f as je}from"./chunk.GQI53L5P.js";import{q as He}from"./chunk.7VX6TBNY.js";import{a as Ie}from"./chunk.L5MDUZLQ.js";import{e as X}from"./chunk.CR5MQMOL.js";import{a as j}from"./chunk.JJP5OL5E.js";import{f as De,g as Y,i as Pe}from"./chunk.UCS3CBT4.js";import{a as Se}from"./chunk.O6SKKF4V.js";import{$a as ke,Ba as K,Bb as Ae,Cb as Oe,Da as he,Fa as ye,Fb as Re,Ga as Z,Ib as Te,K as pe,Lb as C,Na as ge,Oa as be,Ra as we,Tb as _e,Ya as W,Yc as $e,a as fe,ea as G,ec as xe,fc as Me,gc as Ne,ya as me,yb as ve}from"./chunk.BLS2G3CD.js";var E=(t,e,n)=>{(t[e]===void 0||n>t[e])&&(t[e]=n)},z=(t,e,n)=>{(t[e]===void 0||n<t[e])&&(t[e]=n)},Q=(t,e)=>{t.format=e,e.includes("int")&&(t.isInt=!0)},Le=(t,e)=>{t.mime=t.mime?t.mime.filter(n=>e.includes(n)):[...e]},qe=(t,e)=>{t.multipleOf??=[],t.multipleOf.includes(e)||t.multipleOf.push(e)},Fe=(t,e)=>(t.patterns??=new Set).add(e),sn={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function I(t){let e={},{def:n,bag:r}=t._zod,i=t._zod.traits.has("$ZodCheck")?[t,...n.checks??[]]:n.checks??[];for(let o of i){let a=o._zod.def;switch(a.check){case"greater_than":E(e,a.inclusive?"minimum":"exclusiveMinimum",a.value);break;case"less_than":z(e,a.inclusive?"maximum":"exclusiveMaximum",a.value);break;case"multiple_of":qe(e,a.value);break;case"number_format":{Q(e,a.format);let d=sn[a.format];d&&(E(e,"minimum",d[0]),z(e,"maximum",d[1]));break}case"bigint_format":Q(e,a.format);break;case"min_length":case"min_size":E(e,"minimum",a.minimum);break;case"max_length":case"max_size":z(e,"maximum",a.maximum);break;case"length_equals":E(e,"minimum",a.length),z(e,"maximum",a.length);break;case"size_equals":E(e,"minimum",a.size),z(e,"maximum",a.size);break;case"string_format":Q(e,a.format),a.pattern&&Fe(e,a.pattern),(a.format==="base64"||a.format==="base64url")&&(e.contentEncoding=a.format),(a.local||a.precision===-1)&&(e.laxFormat=!0);break;case"mime_type":Le(e,a.mime);break}}r.minimum!==void 0&&E(e,"minimum",r.minimum),r.exclusiveMinimum!==void 0&&E(e,"exclusiveMinimum",r.exclusiveMinimum),r.maximum!==void 0&&z(e,"maximum",r.maximum),r.exclusiveMaximum!==void 0&&z(e,"exclusiveMaximum",r.exclusiveMaximum),r.multipleOf!==void 0&&qe(e,r.multipleOf),r.format!==void 0&&(e.format??=r.format,r.format.includes("int")&&(e.isInt=!0)),r.mime&&Le(e,r.mime);for(let o of r.patterns??[])Fe(e,o);return e}var dn={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""};function L(t){let e=t._zod.def;return e.type==="pipe"&&e.in._zod.traits.has("$ZodTransform")?L(e.out):e.type==="catch"?L(e.innerType):t._zod.optin}var cn=new Set(["promise","optional","nonoptional","nullable","readonly","default","prefault","catch"]);function _(t,e=new Set){if(e.has(t))return!1;e.add(t);let n=t._zod.def,r=n.type;return r==="transform"?!0:r==="array"?_(n.element,e):r==="set"?_(n.valueType,e):r==="lazy"?_(n.getter(),e):cn.has(r)?_(n.innerType,e):r==="intersection"?_(n.left,e)||_(n.right,e):r==="record"||r==="map"?_(n.keyType,e)||_(n.valueType,e):r==="pipe"?t._zod.traits.has("$ZodCodec")||_(n.in,e)||_(n.out,e):r==="object"?Object.values(n.shape).some(i=>_(i,e)):r==="union"?n.options.some(i=>_(i,e)):r==="tuple"?n.items.some(i=>_(i,e))||(n.rest?_(n.rest,e):!1):!1}function ln(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n])=>e.indexOf(+n)===-1).map(([,n])=>n)}function Be(t){let e=t.anyOf;if(!Array.isArray(e)||e.length===0||t.type!==void 0)return;let n=[];for(let r of e){if(!r||typeof r!="object")return;Be(r);let i=Object.keys(r);if(i.length!==1||i[0]!=="type")return;for(let o of[r.type].flat()){if(typeof o!="string")return;n.includes(o)||n.push(o)}}delete t.anyOf,t.type=n.length===1?n[0]:n}var Ue=new Set(["type","properties","required","additionalProperties"]),We=t=>{let e=t.additionalProperties;return e&&typeof e=="object"&&Object.keys(e).length?e:null},Ce=(t,e)=>JSON.stringify(t)===JSON.stringify(e);function ee(t){for(let i of t){if(typeof i!="object"||i.type!=="object")return null;for(let o in i)if(!Ue.has(o))return null}let e={},n=new Set;for(let i of t){for(let o in i.properties){if(Object.prototype.hasOwnProperty.call(e,o))continue;let a=[];for(let d of t){let s=d.properties?.[o]??We(d);s&&!a.some(y=>Ce(y,s))&&a.push(s)}e[o]=a.length===1?a[0]:ee(a)??{allOf:a}}for(let o of i.required??[])n.add(o)}let r={type:"object",properties:e};if(n.size&&(r.required=[...n]),t.every(i=>i.additionalProperties===!1))r.additionalProperties=!1;else{let i=[];for(let o of t){let a=We(o);a&&!i.some(d=>Ce(d,a))&&i.push(a)}i.length===1?r.additionalProperties=i[0]:i.length>1&&(r.additionalProperties={allOf:i})}return r}function un(t){let e=t.allOf;if(!Array.isArray(e)||e.length<2)return;for(let i of Ue)if(i in t)return;let n=e.filter(i=>Array.isArray(i.oneOf)||Array.isArray(i.anyOf)),r;if(!n.length)r=ee(e);else{let i=n[0],o=Array.isArray(i.oneOf)?"oneOf":"anyOf";if(Object.keys(i).length!==1)return;let a=e.filter(s=>s!==i),d=i[o].map(s=>ee([...a,s]));if(d.some(s=>!s))return;r={[o]:d}}r&&(delete t.allOf,Object.assign(t,r))}function Ve(t){let e=t;for(let S of["anyOf","oneOf"]){let T=e[S];if(!Array.isArray(T))continue;let O=T.map(Ve);O.some((v,h)=>v!==T[h])&&(e={...e,[S]:O})}let n=[e.type].flat(),r=!n.includes("string")&&n.some(S=>S==="number"||S==="integer"),i=e.enum??(e.const!==void 0?[e.const]:void 0);if(!r&&!i?.some(S=>typeof S=="number"))return e;let{minimum:o,maximum:a,exclusiveMinimum:d,exclusiveMaximum:s,multipleOf:y,format:p,id:b,...f}=e;return f.enum?f.enum=f.enum.map(S=>typeof S=="number"?String(S):S):typeof f.const=="number"&&(f.const=String(f.const)),r&&(f.type="string",i||(f.pattern=n.includes("number")?"^-?\\d+(?:\\.\\d+)?$":"^-?\\d+$")),f}var B=class{constructor(e,n){this.override=e;this.refs=n}done=new Map;path=[];cyclic=new Map;write(e,n=!1){let r=this.refs.get(e);if(r!==void 0&&!n)return{$ref:r};if(this.path.includes(e))return this.cyclic.has(e)||this.cyclic.set(e,""),{};let i=this.done.get(e);if(i)return i;this.path.push(e);try{let o=this.written(e);return this.done.set(e,o),o}finally{this.path.pop()}}written(e){let n={},r,i=e._zod.toJSONSchema?.();i?Object.assign(n,i):r=this.process(e,n);let o=fe.get(e);if(o)for(let d of Object.keys(o))n[d]=o[d];_(e)&&(delete n.examples,delete n.default),"_prefault"in n&&(n.default??=n._prefault,delete n._prefault);let a=n;if(r){let d=this.write(r);a={...n};for(let s of Object.keys(d))s in n||(a[s]=d[s])}return this.override({zodSchema:e,jsonSchema:a}),Be(a),e._zod.def.type==="intersection"&&un(a),a}process(e,n){let r=e._zod.def;switch(r.type){case"string":{n.type="string";let{minimum:i,maximum:o,format:a,patterns:d,contentEncoding:s,laxFormat:y}=I(e);if(typeof i=="number"&&(n.minLength=i),typeof o=="number"&&(n.maxLength=o),a&&(n.format=dn[a]??a,(n.format===""||a==="time"||y)&&delete n.format),s&&(n.contentEncoding=s),d&&d.size>0){let p=[...d];p.length===1?n.pattern=p[0].source:n.allOf=p.map(b=>({pattern:b.source}))}return}case"number":{let{minimum:i,maximum:o,multipleOf:a,exclusiveMinimum:d,exclusiveMaximum:s,isInt:y}=I(e);if(n.type=y?"integer":"number",typeof d=="number"&&d>=(i??Number.NEGATIVE_INFINITY)?n.exclusiveMinimum=d:typeof i=="number"&&(n.minimum=i),typeof s=="number"&&s<=(o??Number.POSITIVE_INFINITY)?n.exclusiveMaximum=s:typeof o=="number"&&(n.maximum=o),a){let[p,...b]=new Set(a.filter(f=>Number.isFinite(f)&&f!==0).map(Math.abs));p!==void 0&&(n.multipleOf=p),b.length&&(n.allOf=[...n.allOf??[],...b.map(f=>({multipleOf:f}))])}return}case"boolean":case"success":n.type="boolean";return;case"null":n.type="null";return;case"never":n.not={};return;case"enum":{let i=ln(r.entries);i.length===0?n.not={}:(i.every(o=>typeof o=="number")&&(n.type="number"),i.every(o=>typeof o=="string")&&(n.type="string"),n.enum=i);return}case"literal":{let i=r.values.filter(o=>o!==void 0).map(o=>typeof o=="bigint"?Number(o):o);if(r.values.length===0)n.not={};else if(i.length===1)n.type=i[0]===null?"null":typeof i[0],n.const=i[0];else if(i.length>1){for(let o of["number","string","boolean"])i.every(a=>typeof a===o)&&(n.type=o);i.every(o=>o===null)&&(n.type="null"),n.enum=i}return}case"template_literal":n.type="string",n.pattern=e._zod.pattern.source;return;case"file":{n.type="string",n.format="binary",n.contentEncoding="binary";let{minimum:i,maximum:o,mime:a}=I(e);i!==void 0&&(n.minLength=i),o!==void 0&&(n.maxLength=o),a&&(a.length===0?n.not={}:a.length===1?n.contentMediaType=a[0]:n.anyOf=a.map(d=>({contentMediaType:d})));return}case"array":{let{minimum:i,maximum:o}=I(e);typeof i=="number"&&(n.minItems=i),typeof o=="number"&&(n.maxItems=o),n.type="array",n.items=this.write(r.element);return}case"object":{let i=r.shape;n.type="object";let o={};n.properties=o;for(let d in i)Object.defineProperty(o,d,{value:this.write(i[d]),writable:!0,enumerable:!0,configurable:!0});let a=Object.keys(i).filter(d=>L(i[d])===void 0);a.length>0&&(n.required=a),r.catchall?._zod.def.type==="never"?n.additionalProperties=!1:r.catchall&&(n.additionalProperties=this.write(r.catchall));return}case"union":n[r.inclusive===!1?"oneOf":"anyOf"]=r.options.map(i=>this.write(i));return;case"intersection":{let i=d=>"allOf"in d&&Object.keys(d).length===1,o=this.write(r.left),a=this.write(r.right);n.allOf=[...i(o)?o.allOf:[o],...i(a)?a.allOf:[a]];return}case"tuple":{let i=r.items;n.type="array",n.prefixItems=i.map(s=>this.write(s)),r.rest?n.items=this.write(r.rest):n.items=!1;let o=i.length;for(;o>0&&L(i[o-1])!==void 0;)o-=1;o>0&&(n.minItems=o),r.rest||(n.maxItems=i.length);let{minimum:a,maximum:d}=I(e);typeof a=="number"&&(n.minItems=a),typeof d=="number"&&(n.maxItems=d);return}case"record":{let i=r.keyType;n.type="object";let o=I(i).patterns;if(r.mode==="loose"&&o&&o.size>0){let d=this.write(r.valueType),s={};for(let y of o)s[y.source]=d;n.patternProperties=s}else n.propertyNames=Ve(this.write(i)),n.additionalProperties=this.write(r.valueType);let a=i._zod.values;if(a&&!r.partial&&L(r.valueType)===void 0){let d=[...a].filter(s=>typeof s=="string"||typeof s=="number");d.length>0&&(n.required=d.map(String))}return}case"nullable":n.anyOf=[this.write(r.innerType),{type:"null"}];return;case"default":case"prefault":{let i=r.defaultValue,o,a=!1,d=JSON.stringify(i,(s,y)=>typeof y=="bigint"?(a=!0,null):y);return!a&&d!==void 0&&(o=JSON.parse(d)),a||(n[r.type==="default"?"default":"_prefault"]=o),r.innerType}case"catch":{try{n.default=r.catchValue(void 0)}catch{}return r.innerType}case"readonly":return n.readOnly=!0,r.innerType;case"pipe":return r.in._zod.traits.has("$ZodTransform")?r.out:r.in;case"lazy":return e._zod.innerType;case"optional":case"nonoptional":case"promise":return r.innerType;default:return}}};function Ge(t,e=()=>{}){let n=t,r=new B(e,new Map),i=r.write(n,!0);if(r.cyclic.size>0){let o=new Map,a=0,d=[];for(let y of r.cyclic.keys())if(y===n)o.set(y,"#");else{let p=`__schema${a++}`;o.set(y,`#/$defs/${p}`),d.push([y,p])}r=new B(e,o),i=r.write(n,!0);let s={};for(let[y,p]of d)s[p]=r.write(y,!0);d.length>0&&(i={...i,$defs:s})}return JSON.parse(JSON.stringify({$schema:"https://json-schema.org/draft/2020-12/schema",...i}))}function Ke(t){return Ge(t,mn)}var fn={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string"},pn={phone:"A phone number as it is written, like +1 555 123 4567 or 020 7946 0958 ext. 12.",place:"An address or a place's name, as a person would search a map for it.",duration:"A length of time in whole minutes: 90 is 1 h 30 min."};function mn(t){me(t.zodSchema)&&(t.jsonSchema["x-graview-app-link"]=!0);let e=ye(t.zodSchema);if(e&&(t.jsonSchema.type==="string"||t.jsonSchema.type==="array")){t.jsonSchema["x-graview-linked"]={address:e.address,kinds:[...e.kinds],cardinality:e.cardinality};let s=e.kinds.join(" or "),y=`${e.cardinality==="many"?"Records":"A record"}: a ${s} in the app ${e.address}, as "${e.kinds[0]}:<id>" \u2014 an id found there with find_linked. Linking never changes that app.`,p=t.jsonSchema.description;typeof p=="string"&&p.includes(y)||(t.jsonSchema.description=`${typeof p=="string"&&p?`${p.replace(/\.?$/,".")} `:""}${y}`)}if(we(t.zodSchema)&&(t.jsonSchema["x-graview-repeat"]=!0,!t.jsonSchema.type&&!t.jsonSchema.anyOf&&!t.jsonSchema.oneOf&&Object.assign(t.jsonSchema,hn())),Se(t.zodSchema)){t.jsonSchema.contentMediaType="text/markdown";let s=t.jsonSchema.description;typeof s=="string"&&s.endsWith("Written in Markdown.")||(t.jsonSchema.description=`${typeof s=="string"&&s?`${s.replace(/\.?$/,".")} `:""}Written in Markdown.`)}let n=Te(t.zodSchema);if(n){let s=t.jsonSchema;s["x-graview-type"]=n,n==="duration"&&(s["x-graview-unit"]="minutes"),s.description??=pn[n]}let r=Re(t.zodSchema,!1);if(r){let s=De(r);t.jsonSchema["x-graview-format"]=s.format??"unit",s.currency&&(t.jsonSchema["x-graview-currency"]=s.currency),s.unit&&s.format!=="money"&&(t.jsonSchema["x-graview-unit"]=s.unit);let y=t.jsonSchema.description;t.jsonSchema.description=typeof y=="string"&&y.length>0?`${y} ${Y(s)}`:Y(s)}let i=t.zodSchema._zod?.def;if(!i||i.type!=="string"||typeof i.format!="string"||i.format==="regex")return;let o=t.jsonSchema,a=(i.checks??[]).map(s=>s._zod?.def).filter(s=>s?.format==="regex"&&s.pattern instanceof RegExp).map(s=>s.pattern.source);delete o.pattern;let d=o.allOf;Array.isArray(d)&&d.every(s=>typeof s=="object"&&s!==null&&Object.keys(s).length===1&&"pattern"in s)&&delete o.allOf,o.format=fn[i.format]??i.format,a.length===1?o.pattern=a[0]:a.length>1&&(o.allOf=a.map(s=>({pattern:s})))}function ne(t,e){let n=C(t.input),r=Ke(t.input);if(e&&r.properties){let o=a=>e.includes(a)?e.indexOf(a):e.length;r.properties=Object.fromEntries(Object.entries(r.properties).sort(([a],[d])=>o(a)-o(d)))}let i=r.properties??{};if(Ae(t)){let o=t.creates.join(" | ");i.id={type:"string",minLength:1,description:`Optional: the id for the ${o} this makes. Refused if the graph already has it; left out, one is minted from the label.`},r.properties=i}Oe(t)&&(r.additionalProperties=!1);for(let o of n){let a=i[o.name];if(!a)continue;let d=o.kinds.includes("*")?"any node kind":o.kinds.join(" | ");a.description=[a.description,`Id of a node (${d}).`].filter(Boolean).join(" ")}return{name:t.name,...t.title===void 0?{}:{title:t.title},description:t.description??t.title??t.name,inputSchema:r,nodeRefs:n}}function hn(){let t={type:"string",pattern:"^\\d{4}-\\d{2}-\\d{2}$"},e=(n,r)=>({type:"integer",minimum:n,maximum:r});return{type:"object",description:'How the date beside it repeats; the date is the first occurrence. "on" is weekdays for "week", days of the month (-1 the last) for "month".',properties:{every:{type:"string",enum:[...be]},interval:e(1,99),on:{type:"array",minItems:1,maxItems:31,items:{anyOf:[{type:"string",enum:[...ge]},e(-1,31)]}},until:t,count:e(1,1e3),except:{type:"array",maxItems:500,items:t},continues:{type:"string",maxLength:200}},required:["every"],additionalProperties:!1}}function Ze(t){let e=new Set;for(let n=t;n;n=n.onBehalfOf)n.id!==void 0&&e.add(`${n.kind}:${n.id}`);return e}function U(t,e){let n=Ze(e),r=p=>{if(p.kind==="rule")return!1;let b=Ze(p);if(b.size===0)return!1;for(let f of b)if(n.has(f))return!1;return!0},i,o=()=>{if(i)return i;i=new Map;for(let p of t.log.live()){if(p.undoes!==void 0)continue;let b=r(p.author)?p.author:void 0;for(let f of p.primitives){f.op==="remove-node"&&i.delete(f.node.id);let S=f.op==="add-node"?f.node.id:f.op==="patch-node"||f.op==="splice-text"?f.id:void 0;if(S===void 0)continue;let T=f.op==="add-node"?Object.keys(f.node):f.op==="splice-text"?[f.field]:Object.keys(f.after),O=i.get(S);(f.op==="add-node"||!O)&&i.set(S,O=new Map);for(let v of T)v==="id"||v==="kind"||(b?O.set(v,b):O.delete(v))}}return i},a=t.schema,d=new Map,s=(p,b)=>{let f=`${p}\0${b}`,S=d.get(f);if(S===void 0){let T=a.tryDefinition(p)?.fields?.shape;S=T!==void 0&&b in T&&Pe(T[b]).type==="text",d.set(f,S)}return S},y=p=>t.graph.getNode(p)?.kind;return{prose:s,say:p=>W(p,{graph:t.graph,schema:a}),fieldBy(p,b){let f=y(p);if(!(f===void 0||!s(f,b)))return o().get(p)?.get(b)},recordBy(p){let b=y(p),f=o().get(p);if(b===void 0||!f)return;let S;for(let[T,O]of f)s(b,T)&&(S=O);return S}}}var te=(t,e,n)=>({untrusted:!0,authoredBy:n.say(e),text:t}),yn="the host's ranker";function Ye(t,e){return{...t,hits:t.hits.map(n=>{if(n.about!=="node")return n;n.why.by==="meaning"&&n.why.matched!==void 0&&(n={...n,why:{...n.why,matched:{untrusted:!0,authoredBy:yn,text:n.why.matched}}});let r=e.recordBy(n.id);if(!r)return n;let i=e.prose(n.kind,n.why.field)?e.fieldBy(n.id,n.why.field):r;return{...n,label:te(n.label,r,e),...n.apart!==void 0?{apart:te(n.apart,r,e)}:{},why:i?{...n.why,fragment:te(n.why.fragment,i,e)}:n.why}})}}var ie=(t,e,n)=>({title:t,readOnlyHint:e,destructiveHint:!1,idempotentHint:n,openWorldHint:!1}),gn={name:"subscribe",title:"Notify me when something happens",description:`Subscribe the person you act for to be told when something happens in this app \u2014 their host delivers it (an email, a push). on is one of: "act" (an act runs; give act, its declared name, and/or record), "created" (a record of kind is added), "changed" (a record of kind, or the one record, changes), "reaches" (a record of kind, or the one record, comes to satisfy condition, an expression in the app's rule language such as done == true or amount > 100). They are told only of changes someone else made, unless alsoMine is true, and only of records they may see. Returns the subscription and its sentence. Changes nothing in the app.`,inputSchema:{type:"object",properties:{on:{type:"string",enum:["act","created","changed","reaches"],description:"What to be told of."},act:{type:"string",description:"An act's declared name, for on: act."},kind:{type:"string",description:"A kind, for created, changed and reaches."},record:{type:"string",description:"One record, by id or name: for act, changed and reaches."},condition:{type:"string",description:"For reaches: what the record should come to satisfy, in the rule language (done == true)."},alsoMine:{type:"boolean",description:"Also when the person themselves made the change; false when unsaid."}},required:["on"],additionalProperties:!1},mutating:!1,annotations:ie("Notify me when something happens",!1,!1)},bn={name:"unsubscribe",title:"Stop notifying me",description:"Take away one of the person's subscriptions, by the id list_subscriptions or subscribe answered. Changes nothing in the app.",inputSchema:{type:"object",properties:{id:{type:"string",description:"The subscription's id."}},required:["id"],additionalProperties:!1},mutating:!1,annotations:ie("Stop notifying me",!1,!0)},wn={name:"list_subscriptions",title:"What I am notified of",description:`List what the person you act for is told of in this app: each subscription's id and its sentence ("When someone else adds a task").`,inputSchema:{type:"object",properties:{},additionalProperties:!1},mutating:!1,annotations:ie("What I am notified of",!0,!0)},re=[gn,bn,wn];var F=t=>{let e;return()=>e??=t().catch(n=>{throw e=void 0,n})},Sn=F(()=>(__graviewPreload(import.meta.url,["./chunk.AXMC6XVT.js","./chunk.5DZR46YG.js","./chunk.CR5MQMOL.js","./chunk.6SHF6IL5.js","./chunk.MQISKON2.js","./chunk.GQX57JIE.js","./chunk.LJXAZ5TF.js","./chunk.QFI4L2HK.js","./chunk.KFHXTHIY.js","./chunk.UCS3CBT4.js","./chunk.O6SKKF4V.js","./chunk.BLS2G3CD.js","./chunk.EJUZGIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.NPU4WYRB.js"))),kn=()=>(__graviewPreload(import.meta.url,["./chunk.JJP5OL5E.js","./chunk.LJXAZ5TF.js","./chunk.QFI4L2HK.js","./chunk.KFHXTHIY.js","./chunk.BLS2G3CD.js","./chunk.EJUZGIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.JC5NXMG3.js")).catch(()=>{}),vn=async()=>{(await kn())?.judgeWithLines()},q=F(()=>(__graviewPreload(import.meta.url,["./chunk.WVUJXDXZ.js","./chunk.6SHF6IL5.js","./chunk.MQISKON2.js","./chunk.GQX57JIE.js","./chunk.LJXAZ5TF.js","./chunk.QFI4L2HK.js","./chunk.KFHXTHIY.js","./chunk.O6SKKF4V.js","./chunk.BLS2G3CD.js","./chunk.EJUZGIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.UGJ32SEL.js"))),An=F(()=>(__graviewPreload(import.meta.url,["./chunk.KZ3UPV2L.js","./chunk.G4JJXA63.js","./chunk.64TFAR5Z.js","./chunk.5DZR46YG.js","./chunk.Q7RI4SI4.js","./chunk.XOZU4OFA.js","./chunk.CR5MQMOL.js","./chunk.Q5WEOX3Q.js","./chunk.RXJBYP7B.js","./chunk.BJAQRV2R.js","./chunk.JJP5OL5E.js","./chunk.WVUJXDXZ.js","./chunk.6SHF6IL5.js","./chunk.MQISKON2.js","./chunk.GQX57JIE.js","./chunk.LJXAZ5TF.js","./chunk.QFI4L2HK.js","./chunk.KFHXTHIY.js","./chunk.TT6QBWRA.js","./chunk.UCS3CBT4.js","./chunk.O6SKKF4V.js","./chunk.BLS2G3CD.js","./chunk.EJUZGIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.K4ITS63T.js"))),On=F(()=>(__graviewPreload(import.meta.url,["./chunk.BBNF52IB.js","./chunk.AXMC6XVT.js","./chunk.5DZR46YG.js","./chunk.L5MDUZLQ.js","./chunk.IDQHSAAQ.js","./chunk.CR5MQMOL.js","./chunk.6SHF6IL5.js","./chunk.MQISKON2.js","./chunk.GQX57JIE.js","./chunk.LJXAZ5TF.js","./chunk.QFI4L2HK.js","./chunk.KFHXTHIY.js","./chunk.TT6QBWRA.js","./chunk.UCS3CBT4.js","./chunk.O6SKKF4V.js","./chunk.BLS2G3CD.js","./chunk.EJUZGIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.ZVETGRUM.js"))),Rn=F(()=>(__graviewPreload(import.meta.url,["./chunk.UN2OB6OD.js","./chunk.LJXAZ5TF.js","./chunk.QFI4L2HK.js","./chunk.KFHXTHIY.js","./chunk.BLS2G3CD.js","./chunk.EJUZGIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.KT2LXHSI.js"))),Tn=t=>t.definitions.some(e=>Z(e).size>0),Xe=t=>({value:K(t),label:t.label,...t.describe?{describe:t.describe}:{},...t.card?{card:t.card}:{},fields:t.fields,...t.app?{app:t.app}:{}});async function _n(t,e,n,r){let i=String(n.relation??""),[o,a]=i.includes(".")?i.split(".",2):[void 0,i],d=t.schema.definitions.flatMap(v=>[...Z(v)].map(([h,u])=>({kind:v.kind,name:h,relation:u}))),s=d.filter(v=>v.name===a&&(o===void 0||v.kind===o));if(s.length!==1){let v=d.map(h=>`${h.kind}.${h.name}`).join(", ")||"none";return{ok:!1,error:`${s.length===0?`No relation to another app is called "${i}"`:`"${i}" names a relation of several kinds`}. The relations to other apps are: ${v}.`}}let{kind:y,name:p,relation:b}=s[0];if(!r)return{ok:!1,error:`This seat cannot read ${b.address}: its host reads no other app's records. Nothing was changed.`};let f={kind:e.kind,...e.id===void 0?{}:{id:e.id},...e.roles?{roles:e.roles}:{}},S=typeof n.of=="string"?n.of:void 0;if(S!==void 0){let v=t.graph.getNode(S);if(!v||v.kind!==y)return{ok:!1,error:`No ${y} "${S}".`};let h=he(v[p],b),u=await Promise.all(h.map(w=>Promise.resolve().then(()=>r.resolve(w,f)).catch(()=>null)));return{ok:!0,data:{relation:`${y}.${p}`,app:b.address,records:u.map((w,k)=>w===null?{value:K(h[k]),missing:!0}:"denied"in w?{denied:!0,said:"linked record (no access)"}:Xe(w))},reads:[S]}}let T=typeof n.limit=="number"&&n.limit>0?Math.min(n.limit,20):20,O=await Promise.resolve().then(()=>r.find({address:b.address,kinds:b.kinds,query:String(n.query??""),limit:T},f)).catch(()=>[]);return Array.isArray(O)?{ok:!0,data:{relation:`${y}.${p}`,app:b.address,records:O.map(Xe),link:`edit-${y} with ${p} set to a record's value`}}:{ok:!0,data:{relation:`${y}.${p}`,app:b.address,denied:!0,said:"linked record (no access)"}}}var M=t=>({title:t,readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}),Qe={description:'Which records: false (the default) the live ones, true only the archived ones, "all" both. An archived record is set aside, not gone: unarchive-<kind> brings it back.',anyOf:[{type:"boolean"},{type:"string",enum:["all"]}]},oe={type:"number",description:"Where the page starts; 0 when unsaid."},se=[{name:"search_graph",title:"Find by name",description:"Find things by name: records whose name or readable fields carry the words, and the kinds, places and rules the words name \u2014 each with why it matched. Reach for this before get_graph when you know what something is called. Words match the start of words, case and accents aside; key:value tokens narrow as a list's filter does (done:false, is:any for past records, kind:<kind>). Pass subject (a node id) to get the acts you may run on it as hits too. When few records match exactly, records with a near word follow \u2014 a typo, another form of the word, a meaning \u2014 each with near: true and why.matched, the record's own word that answered.",inputSchema:{type:"object",properties:{query:{type:"string",description:"Words, with optional key:value conditions."},limit:{type:"number",description:"Most hits to return; at most 20."},subject:{type:"string",description:"A node id whose acts to include."},archived:Qe},required:["query"],additionalProperties:!1},mutating:!1,annotations:M("Find by name")},{name:"get_graph",title:"Read the graph",description:"Read the graph, 25 nodes a page: their fields, the edges out of them, and how many more. Start here when you need the shape of the domain rather than one thing in it.",inputSchema:{type:"object",properties:{offset:oe,archived:Qe},additionalProperties:!1},mutating:!1,annotations:M("Read the graph")},{name:"get_node",title:"Read one node",description:"Read one node: its fields, its links (id, kind and label, 20 each way a page), the violations that implicate it, and its computed values: read-only fields worked out from what you can see, which no act sets. Use this to check a thing before you change it.",inputSchema:{type:"object",properties:{id:{type:"string",description:"A node's id, or its name."},offset:oe},required:["id"],additionalProperties:!1},mutating:!1,annotations:M("Read one node")},{name:"get_violations",title:"List the problems",description:"List the invariant violations the graph currently has, 20 a page, with the repairs that would resolve each one. Read this before proposing work: a rule that is already broken is more urgent than anything you could add.",inputSchema:{type:"object",properties:{offset:oe,context:{type:"object",description:"Evaluation context, e.g. { weekStart }."}},additionalProperties:!1},mutating:!1,annotations:M("List the problems")},{name:"get_affordances",title:"Ask what can be done",description:"Ask what can legally be done with a selection, ranked. Prefer these over composing a mutation by hand: they are derived from the schema, the invariants and the shape of the graph, so they cannot name an action that does not exist.",inputSchema:{type:"object",properties:{selection:{type:"array",items:{type:"string"},description:"Node ids."},context:{type:"object"}},required:["selection"],additionalProperties:!1},mutating:!1,annotations:M("Ask what can be done")},{name:"describe_place",title:"Say what a place shows",description:`Say what one place of the app shows you, as a person in your seat would see it: its headings, its figures as drawn, its lists with each record's title and what its card or row says, the headings a list is grouped under, what an empty list says, the forms it offers (each field in the order asked, its label, whether it must be answered, what it takes and its choices), and any block that could not be worked out. Pass a place's slug ("home", a lens's address like "the-offers", a kind's like "offers"), a record's id, or a visitor form's "forms/<name>", and width 390 for a phone. Use it after a change to check what somebody now sees, instead of guessing.`,inputSchema:{type:"object",properties:{place:{type:"string",description:`"home", a place's slug, a record's id, or "forms/<name>" for a visitor form.`},width:{type:"number",description:"The screen's width in CSS pixels; 390 is a phone, 1440 when unsaid."}},required:["place"],additionalProperties:!1},mutating:!1,annotations:M("Say what a place shows")},{name:"preview_mutation",title:"Try an act without applying it",description:"Try a mutation without applying it: get back the diff it would produce and any invariant it would break. Do this when you are unsure, rather than applying and undoing.",inputSchema:{type:"object",properties:{mutation:{type:"string"},args:{type:"object"}},required:["mutation","args"],additionalProperties:!1},mutating:!1,annotations:M("Try an act without applying it")},{name:"undo_batch",title:"Undo a batch",description:"Undo one batch of operations. Fails, naming the blocking operation, when a later operation read what it wrote.",inputSchema:{type:"object",properties:{batch:{type:"string"},include:{type:"array",items:{type:"string"}}},required:["batch"],additionalProperties:!1},mutating:!0,annotations:{title:"Undo a batch",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!1}},{name:"list_suggestions",title:"List what is suggested",description:"List the suggestions waiting for a person: changes the app's own actor proposed and did not make, each with its id, what it would do, who suggested it, what it was based on and how sure (0 to 1). Nothing changes until one is accepted (accept_suggestion) or declined (decline_suggestion); a declined one is never suggested again.",inputSchema:{type:"object",properties:{},additionalProperties:!1},mutating:!1,annotations:M("List what is suggested")},{name:"accept_suggestion",title:"Accept a suggestion",description:"Make a waiting suggestion's change, as this seat, carrying what it was based on. Returns the batch (undo_batch takes it back).",inputSchema:{type:"object",properties:{suggestion:{type:"string",description:"The suggestion's id, from list_suggestions."}},required:["suggestion"],additionalProperties:!1},mutating:!0,annotations:{title:"Accept a suggestion",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1}},{name:"decline_suggestion",title:"Decline a suggestion",description:"Decline a waiting suggestion: nothing changes, the decline is kept in the log, and the same change is never suggested or made by the app's own actor again.",inputSchema:{type:"object",properties:{suggestion:{type:"string",description:"The suggestion's id, from list_suggestions."}},required:["suggestion"],additionalProperties:!1},mutating:!0,annotations:{title:"Decline a suggestion",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}}],nn={name:"act_on_several",title:"Do one act to several records",description:`Run one act on several records at once, as one change with one undo. act is the act (its tool name or its declared name), records the records it runs on (ids or names; each goes in the act's subject), args what every call shares ("Set stage to Declined" is args { stage: "declined" }). Each record is judged on its own: one this seat may not change is named with why, and the rest still apply. Returns the batch (undo_batch takes it all back), the records changed, those already so, and those refused.`,inputSchema:{type:"object",properties:{act:{type:"string",description:"The act to run on each record."},records:{type:"array",items:{type:"string"},minItems:1,maxItems:200,description:"Ids or names of the records."},args:{type:"object",description:"Arguments every call shares, besides the record."}},required:["act","records"],additionalProperties:!1},mutating:!0,annotations:{title:"Do one act to several records",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!1}},ue={name:"suggest_changes",title:"Suggest changes",description:"Keep calls ({ act, args }) as one suggestion a person accepts or declines, with its basis and confidence (0 to 1). Changes nothing; a declined change is refused.",inputSchema:{type:"object",properties:{calls:{type:"array",items:{type:"object"}},basis:{type:"string"},confidence:{type:"number"}},required:["calls","basis"]},mutating:!0,annotations:{title:"Suggest changes",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}},de={type:"object",description:"A lens, as draft_view returns one.",properties:{title:{type:"string"},lens:{type:"string"},on:{type:"string"},bindings:{type:"object"},options:{type:"object"}},required:["title","lens","on"]},ce={name:"draft_view",title:"Draw a view",description:'Draw a view of the data from words ("a board of tasks by status", "who covers what") as a lens the app could keep; or check a lens you wrote (lens); or change the one on screen (current, with ask: "only this month"). Returns the lens and its add-lens edit, or one sentence saying why not. Writes nothing.',inputSchema:{type:"object",properties:{ask:{type:"string",description:"What to see, in words."},lens:de,current:de},additionalProperties:!1},mutating:!1,annotations:M("Draw a view")},tn={name:"keep_lens",title:"Keep a view as a lens",description:"Keep a lens draft_view drew as one of the app's places: checked again, then written as the add-lens edit. Returns the remove-lens edit that takes it back.",inputSchema:{...de,additionalProperties:!1},mutating:!0,annotations:{title:"Keep a view as a lens",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}},rn={name:"find_linked",title:"Find a record in another app",description:`A relation may go to a kind in another app (describe_app lists them under "Linked from other apps"). With relation and words, list the records there this seat may link \u2014 each with the value to link it by ("house:h1"), its name and its describe line. With of (a record id here), read the records that record links, as this seat may see them there. Linking one is the record's edit (edit-<kind>) with the relation set to the value. Another app this seat may not open answers denied, and nothing of it. Writes nothing; never changes the other app.`,inputSchema:{type:"object",properties:{relation:{type:"string",description:"The relation, by name (forHouse) or as <kind>.<relation> (scenario.forHouse)."},query:{type:"string",description:"Words to find by, in the other app's names; empty for the first few."},of:{type:"string",description:"A record here whose linked records to read, instead of finding."},limit:{type:"number",description:"Most records to return; at most 20."}},required:["relation"],additionalProperties:!1},mutating:!1,annotations:M("Find a record in another app")};function xn(t,e){return t===void 0?[]:t==="keep"&&!e?[ce,tn]:[ce]}var Mn="An argument that names a record takes its id or its name.",on=[...se.map(t=>t.name),nn.name,ue.name,ce.name,tn.name,rn.name,...re.map(t=>t.name)],an=64;function N(t){let{line:e,...n}=t;return n}function en(t){return{...t,...t.introduces?{introduces:t.introduces.map(N)}:{},...t.resolves?{resolves:t.resolves.map(N)}:{},...t.violationsAfter?{violationsAfter:t.violationsAfter.map(N)}:{}}}function Nn(t){let e=t.normalize("NFKD").replace(/\p{M}/gu,"").replace(/[^A-Za-z0-9_-]/g,"_");return e.length===0&&(e="act"),/^[A-Za-z_]/.test(e)||(e=`act_${e}`),e.slice(0,an)}function $n(t){let e=new Set(on),n=new Map;for(let r of t){let i=Nn(r),o=i;for(let a=2;e.has(o);a+=1)o=`${i.slice(0,an-`_${a}`.length)}_${a}`;e.add(o),n.set(r,o)}return n}function Dn(t,e){if(e.size===0)return t;let n=Object.fromEntries(Object.entries(t.properties??{}).filter(([i])=>!e.has(i))),r=(t.required??[]).filter(i=>!e.has(i));return{...t,properties:n,...t.required?{required:r}:{}}}function Pn(t,e,n,r){let i=ne(t,_e(r,t)),o=G(t),a=i.nodeRefs.length>0?`${i.description}${/[.!?]$/.test(i.description)?"":"."} ${Mn}`:i.description;return{name:e,title:o,description:a,inputSchema:Dn(i.inputSchema,n),mutating:!0,annotations:{title:o,readOnlyHint:!1,destructiveHint:t.destructive===!0||(t.severs?.length??0)>0,idempotentHint:t.idempotent===!0,openWorldHint:!1},act:t.name}}function le(t){if(t===null||typeof t!="object")return JSON.stringify(t)??"null";if(Array.isArray(t))return`[${t.map(le).join(",")}]`;let e=t;return`{${Object.keys(e).filter(n=>e[n]!==void 0).sort().map(n=>`${JSON.stringify(n)}:${le(e[n])}`).join(",")}}`}function Jn(t){return`sha256:${$e(le(t))}`}function En(t,e,n,r,i,o=!1,a=!1,d=!1,s){let y=$n(t.map(f=>f.name)),p=[...xn(r,n),...o?[rn]:[],...a?re:[]];return{definitions:n?[...se.filter(f=>!f.mutating),...p]:[...se,nn,...d?[ue]:[],...p,...t.filter(f=>e.has(f.name)).map(f=>Pn(f,y.get(f.name),i(f),s))],names:y}}function At(t,e={}){let n=e.author??{kind:"agent"},r=t.allMutations(),i=new Set(t.permittedMutations(n).map(h=>h.name)),{definitions:o,names:a}=En(r,i,e.readOnly===!0,e.drafts?e.drafts.keep?"keep":"draw":void 0,h=>X(t.schema,t.policy,n,h),Tn(t.schema),e.subscriptions!==void 0,Ne(n),t.schema),d=Jn(o),s={app:e.app?.brand?.locale,appTimeZone:e.app?.brand?.timeZone},y=h=>pe(s,h),p=h=>{if(!on.includes(h)){for(let[u,w]of a)if(w===h)return u;return a.has(h)?h:xe(h,a.keys())}},b=h=>{let u=Me(h,a.keys());return u?` Did you mean "${u}"?`:""},f=h=>{let u=o.find(k=>k.name===h)??o.find(k=>k.act===h);if(u)return u;let w=p(h);return w===void 0?void 0:o.find(k=>k.act===w)},S=(h,u)=>{let w=r.find(c=>c.name===h);if(!w)return{args:u,resolved:[]};let k={...u},l=[];for(let c of C(w.input)){let m=k[c.name];if(typeof m!="string"||m.trim()==="")continue;let g=t.resolveRef(c,m,n);if(!g.ok){let A=g.reason==="none"?` Nothing was changed. Use search_graph to look it up, then pass its id as ${c.name}.`:" Nothing was changed.";return{ok:!1,error:`${g.message}${A}`,argument:c.name,candidates:g.candidates}}g.by!=="id"&&(k[c.name]=g.id,l.push({argument:c.name,given:m,id:g.id,label:g.label}))}return{args:k,resolved:l}},T=async(h,u)=>{try{await vn();let w=f(h);if(!w&&h===ue.name)return{ok:!1,error:"Only the app's own actor (automated: true) suggests changes.",reason:"forbidden"};if(!w){let l=p(h);if(l){let c=t.permits({name:l,args:u},n);if(!c.ok)return{ok:!1,error:c.refusal.message,reason:"forbidden"}}return{ok:!1,error:`Unknown tool "${h}".${b(h)} Available: ${o.map(c=>c.name).join(", ")}`}}if(w.mutating&&e.readOnly)return{ok:!1,error:`"${h}" changes the graph, and this seat is read-only.`,reason:"forbidden"};if(w.act!==void 0){let l=S(w.act,u);if("ok"in l)return l;let c=w.act,m=y(()=>j(t,n,t.apply({name:c,args:l.args},{...e.author?{author:e.author}:{},...V(e.via)})));return{ok:!0,data:{batch:m.batch,intent:m.intent,introduces:m.introduces.map(N),resolves:m.resolves.map(N),...l.resolved.length>0?{resolved:l.resolved}:{}},diff:m.diff}}let k=t.seenBy(n);switch(w.name){case"search_graph":{let l=typeof e.places=="function"?e.places():e.places,c=typeof u.subject=="string"?u.subject:void 0,m=He(k,String(u.query??""),{principal:n,rank:e.near,archived:ke(u.archived),limit:typeof u.limit=="number"&&u.limit>0?Math.min(u.limit,20):20,...l?{places:l}:{},...c?{subject:c,from:[c]}:{}}),g=m.later?await m.later:m;return{ok:!0,data:(await q()).searchRead(g,Ye(g,U(k,n))),reads:g.hits.flatMap(A=>A.about==="node"?[A.id]:[])}}case"get_graph":return{ok:!0,...(await q()).graphRead(k,U(k,n),u)};case"get_node":{let l=String(u.id??""),c=l,m;if(!k.graph.getNode(l)){let A=l.trim()===""?void 0:t.resolveRef({name:"id",kinds:["*"]},l,n);if(A?.ok)c=A.id,m={argument:"id",given:l,id:c,label:A.label};else return A?.reason==="ambiguous"?{ok:!1,error:A.message,argument:"id",candidates:A.candidates}:{ok:!1,error:`No node "${l}".`}}let g=(await q()).nodeRead(k,U(k,n),c,u);return{ok:!0,data:m?{...g.data,resolved:[m]}:g.data,reads:g.reads}}case"describe_place":{let l=e.app??{name:"",schema:t.schema},c=typeof u.width=="number"&&Number.isFinite(u.width)&&u.width>0?u.width:1440,{describePlace:m}=await Sn(),g=m(t,n,String(u.place??""),{app:l,width:c});if(!g.ok)return{ok:!1,error:`${g.error} The places are: ${g.places.join(", ")}.`};let A=new Set,$=H=>{for(let P of H)for(let x of P.groups??[])for(let D of x.items)A.add(D.id),$(D.parts)};return $(g.description.parts),{ok:!0,data:g.description,reads:[...A]}}case"find_linked":return _n(k,n,u,e.linked);case"draft_view":case"keep_lens":{let l=e.app??{name:"",schema:t.schema};return(await An()).runDraftTool(w.name,u,{app:l,principal:n,...e.drafts?{drafts:e.drafts}:{}})}case"get_violations":{let l=k.violations(u.context);return{ok:!0,...(await q()).violationsRead(l,u)}}case"get_affordances":{let l=u.selection??[];return{ok:!0,data:Ie(k,l,{...typeof e.derive=="function"?e.derive():e.derive,...e.author?{principal:e.author}:{},...u.context?{context:u.context}:{}}),reads:l.filter(m=>k.graph.has(m))}}case"preview_mutation":{let l=String(u.mutation),c=p(l)??l,m=S(c,u.args??{});if("ok"in m)return m;let g=t.missingFor({name:c,args:m.args},n);if(g)return{ok:!1,error:g.message,reason:"missing"};let A=j(t,n,t.preview({name:c,args:m.args},void 0,{author:n})),$=en(A);return{ok:!0,data:m.resolved.length>0?{...$,resolved:m.resolved}:$}}case"act_on_several":{let l=String(u.act??""),c=p(l)??l,m=r.find(R=>R.name===c);if(!m||!i.has(c)){let R=m?t.permits({name:c,args:{}},n):void 0;return R&&!R.ok?{ok:!1,error:R.refusal.message,reason:"forbidden"}:{ok:!1,error:`There is no act "${l}" this seat may run.${b(l)} Nothing was changed.`,reason:"invalid"}}let g=m.subject;if(!g)return{ok:!1,error:`"${G(m)}" does not act on a record, so it cannot be run on several. Nothing was changed.`,reason:"invalid"};let A=Array.isArray(u.records)?u.records.filter(R=>typeof R=="string"&&R.trim()!==""):[];if(A.length===0)return{ok:!1,error:"Name at least one record. Nothing was changed.",reason:"invalid"};let $=[],H=[];for(let R of A.slice(0,200)){let J=t.resolveRef({name:g.arg,kinds:g.kinds},R,n);if(!J.ok)return{ok:!1,error:`${J.message} Nothing was changed.`,argument:"records",candidates:J.candidates};$.push(J.id),J.by!=="id"&&H.push({argument:"records",given:R,id:J.id,label:J.label})}let P=S(c,{...u.args??{}});if("ok"in P)return P;let x=(await On()).actOnSeveral(t,{mutation:c,subject:g.arg,args:P.args},$,{author:n,...V(e.via)}),D=x.result?j(t,n,x.result):void 0;return{ok:!0,data:{...x.batch?{batch:x.batch,intent:x.intent}:{},applied:x.applied,unchanged:x.unchanged,refused:x.refused.map(R=>({record:R.id,label:R.label,error:R.message,reason:R.reason})),...x.allOrNothing?{keptNone:!0}:{},...D?{introduces:D.introduces.map(N),resolves:D.resolves.map(N)}:{},...H.length>0||P.resolved.length>0?{resolved:[...H,...P.resolved]}:{}},...D?{diff:D.diff}:{}}}case"subscribe":case"unsubscribe":case"list_subscriptions":{let l=await(await Rn()).runSubscriptionTool(w.name,u,{store:t,principal:e.subscriber??n,app:e.app?.name??"app",subscriptions:e.subscriptions});return l.ok?{ok:!0,data:l.data}:{ok:!1,error:l.error}}case"list_suggestions":{let l=Ee(t,n).map(c=>{let m=W(c.author,{graph:k.graph,schema:t.schema});return{id:c.id,intent:c.intent,by:m,at:c.at,about:c.about,...c.lineage?{basis:{untrusted:!0,authoredBy:m,text:c.lineage.basis},...c.lineage.confidence!==void 0?{confidence:c.lineage.confidence}:{}}:{}}});return{ok:!0,data:{suggestions:l},reads:[...new Set(l.flatMap(c=>c.about))]}}case"suggest_changes":{let l=u.calls.map(m=>({name:p(m.act)??m.act,args:m.args}));return{ok:!0,data:{suggestion:Je(t,l,{author:n,lineage:{basis:u.basis,confidence:u.confidence},...V(e.via)})?.id??null}}}case"accept_suggestion":case"decline_suggestion":{let l=String(u.suggestion??""),c={author:n,...V(e.via)},m=w.name==="accept_suggestion"?ze(t,l,c):je(t,l,c),g=j(t,n,m);return{ok:!0,data:{batch:g.batch,intent:g.intent,introduces:g.introduces.map(N),resolves:g.resolves.map(N)},diff:g.diff}}case"undo_batch":{let l=String(u.batch),c=u.include??[],m=k.canUndo([l,...c]);if(!m.ok)return{ok:!1,error:m.message};let g=j(t,n,t.undo([l,...c],{...e.author?{author:e.author}:{}}));return{ok:!0,data:en(g),diff:g.diff}}default:return{ok:!1,error:`Unknown tool "${h}".`}}}catch(w){let{reason:k,wouldNeed:l}=ve(w);return{ok:!1,error:w instanceof Error?w.message:String(w),reason:k,...l?{wouldNeed:l}:{}}}},O=new Set,v=h=>{for(let u of O)u(h)};return{definitions:o,hash:d,...e.author?{author:e.author}:{},onDiff(h){return t.subscribe(h)},onCall(h){return O.add(h),()=>O.delete(h)},async call(h,u){let w=f(h)?.mutating??!1,k={name:h,args:u,mutating:w,at:new Date().toISOString()};v({...k,phase:"running"});let l=m=>(v(m.ok?{...k,phase:"ok",...!w&&m.reads?{reads:m.reads}:{}}:{...k,phase:"failed",error:m.error}),m),c=await T(h,u);return l(c.ok&&!w?{...c,data:(await q()).withinReadChars(h,c.data)}:c)}}}function V(t){let e=typeof t=="function"?t():t;return e?{via:e}:{}}export{le as a,At as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j,k}from"./chunk.AXMC6XVT.js";import"./chunk.5DZR46YG.js";import"./chunk.CR5MQMOL.js";import"./chunk.6SHF6IL5.js";import"./chunk.MQISKON2.js";import"./chunk.GQX57JIE.js";import"./chunk.LJXAZ5TF.js";import"./chunk.QFI4L2HK.js";import"./chunk.KFHXTHIY.js";import"./chunk.UCS3CBT4.js";import"./chunk.O6SKKF4V.js";import"./chunk.BLS2G3CD.js";import"./chunk.EJUZGIQ5.js";import"./chunk.AJZBJBMO.js";export{g as columnActs,d as columnChoices,c as columnMoves,b as columnOf,e as columnReach,f as columnSteps,j as describePlace,k as placeText,h as resolveFor,i as shadowedPageSlots,a as statusColumns};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as n}from"./chunk.S7OFTGBQ.js";import"./chunk.CDZVUCEK.js";import"./chunk.UDTBFAS5.js";import"./chunk.QAUZDLDA.js";import"./chunk.3SY6WWWQ.js";import"./chunk.UGFDSE37.js";import{l as s}from"./chunk.ATWNWPME.js";import"./chunk.GZEZMU2T.js";import"./chunk.4VJARLJ5.js";import"./chunk.5RNB6IC5.js";import"./chunk.ZITDUHX3.js";import"./chunk.ETWREHXF.js";import"./chunk.YZ6UKKEL.js";import"./chunk.PXQVXBNG.js";import"./chunk.FFPG4PHX.js";import"./chunk.3L5USMQD.js";import"./chunk.GTUBIJTP.js";import"./chunk.DUIKIJKC.js";import"./chunk.73BJYIYS.js";import"./chunk.OKQ4JXTW.js";import"./chunk.M5RHVUZ6.js";import"./chunk.MRUDTYOL.js";import"./chunk.OUNLAMBA.js";import"./chunk.HGP3Q7QX.js";import"./chunk.QSZLY62B.js";import"./chunk.7VX6TBNY.js";import"./chunk.L5MDUZLQ.js";import"./chunk.IDQHSAAQ.js";import"./chunk.XOZU4OFA.js";import"./chunk.CR5MQMOL.js";import"./chunk.MB7LKKUD.js";import"./chunk.WVUJXDXZ.js";import"./chunk.6SHF6IL5.js";import"./chunk.MQISKON2.js";import"./chunk.GQX57JIE.js";import"./chunk.LJXAZ5TF.js";import"./chunk.QFI4L2HK.js";import"./chunk.KFHXTHIY.js";import"./chunk.GZHZLJBF.js";import"./chunk.JLR74UFP.js";import"./chunk.OJGHDWI6.js";import"./chunk.HG34MT7C.js";import"./chunk.TT6QBWRA.js";import"./chunk.UCS3CBT4.js";import"./chunk.O6SKKF4V.js";import"./chunk.ZK446PSX.js";import{G as y,S as i}from"./chunk.SGMVLKZO.js";import"./chunk.SDO3U72B.js";import"./chunk.BLS2G3CD.js";import"./chunk.EJUZGIQ5.js";import{b as r}from"./chunk.AJZBJBMO.js";var c=r(y(),1),e=r(i(),1);function v({store:d,views:t,as:a,scope:o}){let l=(0,c.useMemo)(()=>s({scope:`.${o}`}),[o]);return(0,e.jsxs)("div",{"data-testid":"embed-picture","data-embed-content":"",tabIndex:0,"aria-label":t.places().find(m=>m.as===a)?.title??"The picture",style:{flex:"1 1 auto",minHeight:0,display:"grid",gridTemplateRows:"minmax(0, 1fr)",overflow:"auto",background:"var(--graview-ground)",color:"var(--graview-ink)",fontFamily:"var(--graview-font-body, system-ui)"},children:[(0,e.jsx)("style",{children:l}),(0,e.jsx)(n,{store:d,views:t,as:a})]})}export{v as PictureFace};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as _,b as pe,e as ue,f as me,g as ce}from"./chunk.M5RHVUZ6.js";import{b as G}from"./chunk.MRUDTYOL.js";import{c as de}from"./chunk.6SHF6IL5.js";import{n as P}from"./chunk.JLR74UFP.js";import{b as x,c as ie,d as oe,j as se,k as le}from"./chunk.TT6QBWRA.js";import{d as ae,e as re}from"./chunk.UCS3CBT4.js";import{b as te,f as ne}from"./chunk.O6SKKF4V.js";import{$ as O,Da as Z,Ea as ee,G as he,S as X,aa as Y,ca as U}from"./chunk.SGMVLKZO.js";import{a as Q}from"./chunk.SDO3U72B.js";import{fa as W,ka as J}from"./chunk.BLS2G3CD.js";import{b as D}from"./chunk.AJZBJBMO.js";var p=D(he(),1);var ve=ee(Q(()=>(__graviewPreload(import.meta.url,["./chunk.OKQ4JXTW.js","./chunk.M5RHVUZ6.js","./chunk.MRUDTYOL.js","./chunk.WVUJXDXZ.js","./chunk.6SHF6IL5.js","./chunk.MQISKON2.js","./chunk.GQX57JIE.js","./chunk.LJXAZ5TF.js","./chunk.QFI4L2HK.js","./chunk.KFHXTHIY.js","./chunk.GZHZLJBF.js","./chunk.JLR74UFP.js","./chunk.OJGHDWI6.js","./chunk.HG34MT7C.js","./chunk.TT6QBWRA.js","./chunk.UCS3CBT4.js","./chunk.O6SKKF4V.js","./chunk.ZK446PSX.js","./chunk.SGMVLKZO.js","./chunk.SDO3U72B.js","./chunk.BLS2G3CD.js","./chunk.EJUZGIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.GDYI5QDS.js")))),ye=ve.part((i,a)=>i.drawAppLink(a),{quiet:!0});var e=D(X(),1);function K({nodeId:i,field:a,value:l,stored:s=l,said:c}){let{fields:m,commit:o}=P(i),t=m.find(r=>r.field===a),{store:y,principal:I}=O(),u=y.graph.getNode(i)?.kind,g=y.schema.definitions.find(r=>r.kind===u),v=J(g,a),k=v.toLowerCase(),n=c??`${v.charAt(0).toUpperCase()}${v.slice(1)}: ${l}`,[w,E]=(0,p.useState)(!1),d=t?.shape.type==="number"?t.shape.amount:void 0,f=d&&s!==""&&Number.isFinite(Number(s))?ie(Number(s),d):s,[b,M]=(0,p.useState)(f),C=(0,p.useRef)(null),j=(0,p.useRef)(null),z=(0,p.useRef)(!1),S=r=>{z.current=r,E(!1)};(0,p.useEffect)(()=>M(f),[f,w]);let q=t?.shape.type==="date";if((0,p.useEffect)(()=>{if(q)return Z(()=>void ce())},[q]),(0,p.useEffect)(()=>{w?C.current?.focus():z.current&&(z.current=!1,j.current?.focus())},[w]),!t)return(0,e.jsx)("span",{"data-graview-field":a,"data-graview-readonly":"",title:`Read-only \u2014 nothing this app declares changes the ${k}`,style:{color:"var(--graview-ink)",cursor:"default",overflowWrap:"anywhere"},children:l});if(!w)return(0,e.jsx)("button",{ref:j,type:"button","data-graview-field":a,"data-graview-editable":t.mutation,...n===l?{}:{"aria-label":n},title:`${t.title} \u2014 changes the ${k}, and can be undone`,onClick:()=>E(!0),style:{all:"unset",cursor:"text",display:"inline-flex",alignItems:"flex-end",minHeight:24,minWidth:24,maxWidth:"100%",overflowWrap:"anywhere",paddingBottom:1,borderBottom:"1px dashed var(--graview-edge-bright)",color:"var(--graview-ink)"},children:l});let R=(r,{left:h=!1}={})=>{S(!h),!(r===s||r===""||r===void 0)&&(t.shape.type==="date"&&typeof r=="string"&&fe(r)||o(t,r))},fe=r=>{if(t.shape.type!=="date")return!1;let h=m.filter(L=>L.shape.type==="date"&&L.takesValue),T=le(h.map(L=>L.field),g?.fieldRoles??{}),A=T?.start===a?h.find(L=>L.field===T.end):void 0,F=y.graph.getNode(i)?.[T?.end??""];if(!A||typeof F!="string")return!1;let N=se(s===""?void 0:s,r,F,{time:t.shape.time===!0,instant:t.shape.instant===!0});if(N===void 0||N===F)return!1;let $=t.call(r),V=A.call(N);return y.applyAll($.name===V.name?[{name:$.name,args:{...$.args,...V.args}}]:[$,V],{author:I}),!0};if(!t.takesValue){let r=[t,...t.alternatives];return(0,e.jsx)("span",{role:"group","aria-label":`Change ${W(a).toLowerCase()}`,"data-graview-field":a,style:{display:"inline-flex",gap:6,alignItems:"center",flexWrap:"wrap"},onKeyDown:h=>{h.key==="Escape"&&S(!0)},children:r.map((h,T)=>(0,e.jsx)("button",{type:"button",ref:T===0?C:void 0,"data-graview-act":h.mutation,onClick:()=>{S(!0),o(h,void 0)},onBlur:A=>{let H=A.relatedTarget;(!H||!A.currentTarget.parentElement?.contains(H))&&S(!1)},style:{padding:"2px 9px",fontSize:"0.8125rem",borderRadius:999},children:h.title},h.mutation))})}return(0,e.jsxs)("form",{style:{display:"inline-flex",flexWrap:"wrap",gap:4,maxWidth:"100%"},onSubmit:r=>{r.preventDefault(),R(ge(t,b))},children:[t.shape.type==="choice"?(0,e.jsx)("select",{ref:C,"aria-label":W(a),"data-graview-field":a,value:b,onChange:r=>R(r.target.value),onBlur:()=>S(!1),style:{font:"inherit",fontSize:"inherit"},children:t.shape.options.map(r=>(0,e.jsx)("option",{value:r,children:te(g,a,r)},r))}):t.shape.type==="date"?(0,e.jsx)(me,{inputRef:C,label:W(a),value:b===""?void 0:b,time:t.shape.time===!0,instant:t.shape.instant===!0,onChange:r=>M(r??""),onLeave:r=>R(r,{left:!0}),onCancel:()=>S(!0),autoSelect:!0,boxStyle:{fontSize:"inherit",minHeight:24,padding:"0 3px"}}):(0,e.jsxs)(e.Fragment,{children:[d&&x(d).prefix?(0,e.jsx)("span",{"aria-hidden":"true",children:x(d).prefix}):null,(0,e.jsx)("input",{ref:C,"aria-label":d?`${W(a)}, ${x(d).hint}`:W(a),"data-graview-field":a,...d?{inputMode:"decimal",placeholder:x(d).placeholder,"data-graview-amount":d.format??"unit"}:{},type:d?"text":t.shape.type==="number"&&!t.shape.duration?"number":"text",...t.shape.type==="number"&&t.shape.duration?{placeholder:"1h 30m"}:{},...t.shape.type==="text"&&t.shape.holds==="phone"?{inputMode:"tel",autoComplete:"tel"}:{},...t.shape.type==="number"&&t.shape.min!==void 0&&!d?{min:t.shape.min}:{},...t.shape.type==="number"&&t.shape.max!==void 0&&!d?{max:t.shape.max}:{},...t.shape.type==="number"&&t.shape.step!==void 0&&!d?{step:t.shape.step}:{},value:b,onChange:r=>M(r.target.value),onBlur:()=>R(ge(t,b),{left:!0}),onKeyDown:r=>{r.key==="Escape"&&S(!0)},style:{font:"inherit",fontSize:"inherit",width:`min(${Math.max(6,b.length+1)}ch, 100%)`,maxWidth:"100%",minWidth:0,boxSizing:"border-box",minHeight:24,display:"inline-flex",alignItems:"center",padding:"0 3px"}}),d&&x(d).suffix?(0,e.jsx)("span",{"aria-hidden":"true",children:x(d).suffix}):null]}),t.open.length>0?(0,e.jsxs)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:["also needs ",t.open.map(r=>r.name).join(", ")]}):null]})}function ge(i,a){return i.shape.type==="number"&&i.shape.amount?oe(a,i.shape.amount):i.shape.type==="number"?i.shape.duration?ne(a)??a:Number(a):i.shape.type==="text"&&i.shape.holds?a.trim():a}function be({href:i,field:a,value:l,stored:s,nodeId:c}){let m=i.startsWith("tel:"),o=(t,y)=>(0,e.jsx)("a",{href:i,"data-graview-link":a,...y?{"aria-label":y}:{},...m?{}:{target:"_blank",rel:"noopener noreferrer"},style:{display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,maxWidth:"100%",overflowWrap:"anywhere",color:"var(--graview-accent)"},children:t});return c===void 0?o(l):(0,e.jsxs)("span",{style:{display:"inline-flex",flexWrap:"wrap",alignItems:"center",gap:"0 10px",maxWidth:"100%"},children:[(0,e.jsx)(K,{nodeId:c,field:a,value:l,...s===void 0?{}:{stored:s}}),o(m?"Call":"Map",m?`Call ${l}`:`Open ${l} in maps`)]})}function De({id:i,hide:a=[],limit:l=10,labels:s={},shown:c=[]}){let{store:m}=O(),o=U(i);if(!o)return null;let t=m.schema.tryDefinition(o.kind),y=ae(o,t,{limit:l,said:c}).filter(u=>!a.includes(u.key)),I=de(t).length>0;return y.length===0&&!I?null:(0,e.jsxs)("div",{"data-graview-fields":o.id,style:{display:"grid",gap:14,alignContent:"start",minWidth:0,fontSize:"0.875rem"},children:[re(t,y).map((u,g)=>{let v=(0,e.jsx)("dl",{style:{margin:0,display:"grid",gridTemplateColumns:"auto 1fr",gap:"5px 16px",alignContent:"start",minWidth:0},children:u.fields.map(n=>n.files?(0,e.jsx)(_,{as:"field",nodeId:o.id,field:n.key,label:s[n.key]??n.label,files:n.files,labelStyle:B,style:{marginTop:6}},n.key):n.long?(0,e.jsx)(we,{nodeId:o.id,field:n.key,label:s[n.key]??n.label,value:n.value,markdown:n.markdown,labelStyle:B,style:{gridColumn:"1 / -1",marginTop:6}},n.key):(0,e.jsxs)("div",{style:{display:"contents"},children:[(0,e.jsx)("dt",{style:{...B,whiteSpace:"nowrap"},children:s[n.key]??n.label}),(0,e.jsxs)("dd",{style:{margin:0,minWidth:0},children:[n.linked?(0,e.jsx)(pe,{relation:n.linked.relation,refs:n.linked.refs,nodeId:o.id,field:n.key}):n.app?(0,e.jsx)(ye,{address:n.app,as:"record",nodeId:o.id,field:n.key}):n.href?(0,e.jsx)(be,{href:n.href,field:n.key,value:n.value,stored:n.stored,nodeId:o.id}):(0,e.jsx)(K,{nodeId:o.id,field:n.key,value:n.value,stored:n.stored}),n.repeats?(0,e.jsx)(ue,{nodeId:o.id,field:n.key,start:o[n.key],value:o[`${n.key}Repeat`],label:`${s[n.key]??n.label} repeats`}):null]})]},n.key))});if(!u.title)return(0,e.jsx)("div",{children:v},g);let k=`graview-field-group-${o.id}-${g}`;return(0,e.jsxs)("div",{role:"group","aria-labelledby":k,style:{display:"grid",gap:6,minWidth:0},children:[(0,e.jsx)("p",{id:k,"data-graview-field-group":u.title,style:ke,children:u.title}),v]},g)}),I?(0,e.jsx)(_,{as:"unfilled",nodeId:o.id,skip:a,labels:s,labelStyle:B}):null]})}var B={color:"var(--graview-ink-faint)",fontSize:"0.8125rem"},ke={margin:0,fontSize:"0.75rem",letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--graview-ink-muted)",fontWeight:560};function we(i){return Y()?(0,e.jsx)(xe,{...i}):(0,e.jsx)(Se,{...i})}function Se({field:i,label:a,value:l,labelStyle:s,valueStyle:c,style:m,markdown:o}){return(0,e.jsxs)("div",{"data-graview-long":i,style:{display:"grid",gap:6,minWidth:0,...m},children:[(0,e.jsx)("dt",{style:s,children:a}),(0,e.jsx)("dd",{style:{margin:0,minWidth:0,...c},children:(0,e.jsx)("div",{"data-graview-field":i,children:(0,e.jsx)(G,{text:l,markdown:o})})})]})}function xe({nodeId:i,field:a,label:l,value:s,labelStyle:c,valueStyle:m,style:o,markdown:t}){let{fields:y,commit:I}=P(i),u=y.find(f=>f.field===a&&f.takesValue),[g,v]=(0,p.useState)(!1),k=(0,p.useRef)(null),n=(0,p.useRef)(!1);(0,p.useEffect)(()=>{!g&&n.current&&(n.current=!1,k.current?.focus())},[g]);let w=f=>{n.current=f,v(!1)},E=l.toLowerCase(),d=(0,e.jsx)(G,{text:s,markdown:t});return(0,e.jsxs)("div",{"data-graview-long":a,style:{display:"grid",gap:6,minWidth:0,...o},children:[(0,e.jsxs)("dt",{style:{display:"flex",alignItems:"baseline",gap:10,...c},children:[(0,e.jsx)("span",{children:l}),u&&!g?(0,e.jsx)("button",{ref:k,type:"button","data-graview-editable":u.mutation,"aria-label":`Edit the ${E}`,title:`${u.title} \u2014 changes the ${E}, and can be undone`,onClick:()=>v(!0),style:Ee,children:"Edit"}):null]}),(0,e.jsx)("dd",{style:{margin:0,minWidth:0,...m},children:g&&u?(0,e.jsx)(p.Suspense,{fallback:d,children:(0,e.jsx)(Ie,{field:a,label:l,value:s,...t?{markdown:!0}:{},onCancel:()=>w(!0),onSave:(f,b)=>{w(!b),f!==s&&I(u,f)}})}):(0,e.jsx)("div",{"data-graview-field":a,...u?{}:{"data-graview-readonly":"",title:`Read-only \u2014 nothing this app declares changes the ${E}`},...u?{onClick:()=>v(!0)}:{},style:{cursor:u?"text":"default",minWidth:0},children:d})})]})}var Ie=(0,p.lazy)(()=>(__graviewPreload(import.meta.url,["./chunk.MRUDTYOL.js","./chunk.ZK446PSX.js","./chunk.SGMVLKZO.js","./chunk.SDO3U72B.js","./chunk.BLS2G3CD.js","./chunk.EJUZGIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.EF3UB7US.js"))),Ee={all:"unset",cursor:"pointer",fontSize:"0.75rem",letterSpacing:"normal",textTransform:"none",color:"var(--graview-accent)",borderBottom:"1px dashed currentColor",minHeight:24,minWidth:24,display:"inline-flex",alignItems:"flex-end"};function Oe({nodeId:i,children:a}){let{fields:l}=P(i),s=U(i);if(!s)return(0,e.jsx)(e.Fragment,{children:a});let c=l.find(m=>{let o=s[m.field];return typeof o=="string"&&o===a});return c?(0,e.jsx)(K,{nodeId:i,field:c.field,value:a,said:a}):(0,e.jsx)(e.Fragment,{children:a})}export{ye as a,K as b,be as c,De as d,we as e,Oe as f};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c,d,e,f}from"./chunk.SVH3OMU2.js";import"./chunk.TI4OSTQV.js";import"./chunk.EJUZGIQ5.js";import"./chunk.AJZBJBMO.js";export{e as askArchived,b as askDeclaration,a as declarationAt,f as pastAt,d as pastOf,c as seqAt};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as f}from"./chunk.S7OFTGBQ.js";import"./chunk.CDZVUCEK.js";import"./chunk.UDTBFAS5.js";import"./chunk.QAUZDLDA.js";import"./chunk.3SY6WWWQ.js";import"./chunk.UGFDSE37.js";import{l as g}from"./chunk.ATWNWPME.js";import"./chunk.GZEZMU2T.js";import"./chunk.4VJARLJ5.js";import"./chunk.5RNB6IC5.js";import"./chunk.ZITDUHX3.js";import"./chunk.ETWREHXF.js";import"./chunk.YZ6UKKEL.js";import"./chunk.PXQVXBNG.js";import"./chunk.FFPG4PHX.js";import"./chunk.3L5USMQD.js";import"./chunk.GTUBIJTP.js";import"./chunk.DUIKIJKC.js";import"./chunk.73BJYIYS.js";import"./chunk.OKQ4JXTW.js";import"./chunk.M5RHVUZ6.js";import"./chunk.MRUDTYOL.js";import"./chunk.OUNLAMBA.js";import"./chunk.HGP3Q7QX.js";import"./chunk.QSZLY62B.js";import"./chunk.7VX6TBNY.js";import"./chunk.L5MDUZLQ.js";import"./chunk.IDQHSAAQ.js";import"./chunk.XOZU4OFA.js";import"./chunk.CR5MQMOL.js";import"./chunk.MB7LKKUD.js";import"./chunk.WVUJXDXZ.js";import"./chunk.6SHF6IL5.js";import"./chunk.MQISKON2.js";import"./chunk.GQX57JIE.js";import"./chunk.LJXAZ5TF.js";import"./chunk.QFI4L2HK.js";import"./chunk.KFHXTHIY.js";import"./chunk.GZHZLJBF.js";import"./chunk.JLR74UFP.js";import"./chunk.OJGHDWI6.js";import"./chunk.HG34MT7C.js";import"./chunk.TT6QBWRA.js";import"./chunk.UCS3CBT4.js";import"./chunk.O6SKKF4V.js";import"./chunk.ZK446PSX.js";import{G as b,S as h}from"./chunk.SGMVLKZO.js";import"./chunk.SDO3U72B.js";import{Ed as n}from"./chunk.BLS2G3CD.js";import"./chunk.EJUZGIQ5.js";import{b as t}from"./chunk.AJZBJBMO.js";var m=t(b(),1),a=t(h(),1);function P({store:c,auto:y,brand:i,views:u,presence:s,steering:r,overview:o,scope:d,titleLevel:w=2,quickAsk:l,props:e}){let v=(0,m.useMemo)(()=>g({scope:`.${d}`}),[d]);return(0,a.jsxs)("div",{"data-embed-content":"",style:y?{flex:"0 0 auto",background:"var(--graview-ground)"}:{flex:"1 1 auto",minHeight:0,overflow:"auto",background:"var(--graview-ground)"},children:[(0,a.jsx)("style",{children:v}),(0,a.jsx)("div",{"data-embed-measure":"",style:{display:"flow-root"},children:(0,a.jsx)(f,{context:{store:c,embedded:!0,...e.bar!==!1?{barAbove:!0}:{},...o?{overview:o}:{},titleLevel:w,views:u,settings:e.app.settings??[],...s?{presence:s}:{},...i?{brand:i}:{},...e.locale?{locale:e.locale}:{},...e.timeZone?{timeZone:e.timeZone}:{},...e.principal?{principal:e.principal}:{},...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{},...e.subscriptions?{subscriptions:e.subscriptions}:{},dismissals:e.dismissals,whileAway:e.whileAway,...e.signIn?{signIn:e.signIn}:{},...l!==void 0?{quickAsk:l}:{}},...e.pages?{registry:e.pages}:{},...r?{steering:r}:{},...e.routing==="address"?n(e.basePath)===""?{}:{basename:n(e.basePath)}:{initialPath:e.path??"/"},...e.path!==void 0?{path:e.path}:{},...e.hrefOf?{hrefOf:e.hrefOf}:e.routing==="address"?{}:{hrefOf:!1},...e.onNavigate?{onNavigate:e.onNavigate}:{}})})]})}export{P as PagesContent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as y}from"./chunk.VM43YREJ.js";import{$ as w,D as v,G as I,S as h}from"./chunk.SGMVLKZO.js";import{Ya as g}from"./chunk.BLS2G3CD.js";import{b as d}from"./chunk.AJZBJBMO.js";var k=d(I(),1);var t=d(h(),1),r={display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,padding:"1px 8px",fontSize:"0.75rem"};function E({shows:e,onShows:i,mine:a,onMine:l}){let o={all:"All",changes:"Changes",ai:"AI"};return(0,t.jsxs)("div",{"data-testid":"activity-filter",role:"group","aria-label":"Show",style:{display:"flex",flexWrap:"wrap",gap:4,alignItems:"center"},children:[["all","changes","ai"].map(s=>(0,t.jsx)("button",{type:"button","data-shows":s,"aria-pressed":e===s,onClick:()=>i(s),style:{...r,...e===s?{borderColor:"var(--graview-accent)",color:"var(--graview-ink)"}:{}},children:o[s]},s)),(0,t.jsx)("button",{type:"button","data-testid":"activity-mine","aria-pressed":a,onClick:()=>l(!a),style:{...r,marginLeft:"auto",...a?{borderColor:"var(--graview-accent)",color:"var(--graview-ink)"}:{}},children:"Just mine"})]})}var x=e=>e.ask.kind==="suggest"?"suggest":e.ask.kind==="fill"?"fill in":e.ask.kind==="record"?"add one":e.ask.kind==="panel"?"draw a panel":`answer \u201C${e.ask.said}\u201D`;function $(e){let i=e.offered.filter(a=>e.accepted?.includes(a.id)).map(a=>a.label);switch(e.outcome){case"accepted":return i.length>0?`Took ${i.join(", ")}`:"Taken";case"partly":return`Took ${i.length} of ${e.offered.length}: ${i.join(", ")}`;case"dismissed":return"Dismissed";case"drawn":return e.panel?`Drew \u201C${e.panel.title}\u201D`:"Drew a panel";case"failed":return e.failed??"Failed";default:return"Offered, not yet taken"}}function C(e){let i=[...new Set((e.usage??[]).map(o=>o.model))];if(i.length===0)return null;let a=(e.usage??[]).flatMap(o=>o.costUsd===void 0?[]:[o.costUsd]),l=a.length>0?a.reduce((o,s)=>o+s,0):void 0;return`${i.join(", ")}${l!==void 0?` \xB7 $${l<.01?l.toPrecision(2):l.toFixed(2)}`:""}`}function F({entry:e,undo:i}){let{store:a,principal:l,seats:o,people:s,ai:b}=w(),c=y(),[p,u]=(0,k.useState)(!1),A=e.by.kind==="human"&&e.by.onBehalfOf===void 0&&(e.by.id===void 0||l.id===void 0||e.by.id===l.id)?"you":g(e.by,{graph:a.graph,schema:a.schema,seats:o,people:s}),f=C(e),S=v(b),m=n=>{u(!0),(__graviewPreload(import.meta.url,["./chunk.SJRXBTGP.js","./chunk.L5MDUZLQ.js","./chunk.IDQHSAAQ.js","./chunk.Q7RI4SI4.js","./chunk.XOZU4OFA.js","./chunk.CR5MQMOL.js","./chunk.VM43YREJ.js","./chunk.TI4OSTQV.js","./chunk.MQISKON2.js","./chunk.TT6QBWRA.js","./chunk.UCS3CBT4.js","./chunk.O6SKKF4V.js","./chunk.ZK446PSX.js","./chunk.SGMVLKZO.js","./chunk.SDO3U72B.js","./chunk.BLS2G3CD.js","./chunk.EJUZGIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.MBZ6N5SO.js")).then(n).finally(()=>u(!1))};return(0,t.jsxs)("li",{"data-testid":"activity-interaction","data-interaction":e.id,"data-outcome":e.outcome,style:{display:"grid",gap:3,lineHeight:1.45},children:[(0,t.jsx)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:(0,t.jsxs)("span",{style:{minWidth:0},children:[(0,t.jsx)("strong",{style:{fontWeight:600},children:A})," ",(0,t.jsxs)("span",{style:{color:"var(--graview-ink-muted)"},children:["asked AI to ",x(e)]}),(0,t.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",e.targetLabel]})]})}),e.offered.length>0&&e.outcome!=="accepted"&&e.outcome!=="partly"?(0,t.jsxs)("div",{"data-testid":"interaction-offered",style:{color:"var(--graview-ink-muted)"},children:["Offered ",e.offered.map(n=>n.label).join(", ")]}):null,(0,t.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6,flexWrap:"wrap"},children:[(0,t.jsx)("span",{"data-testid":"interaction-outcome",style:{color:e.outcome==="failed"?"var(--graview-warn)":"var(--graview-ink)"},children:$(e)}),(e.batches??[]).map(n=>(0,t.jsx)("span",{"data-interaction-batch":n,style:{marginLeft:"auto"},children:i(n)},n))]}),f?(0,t.jsx)("div",{"data-testid":"interaction-model",style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:f}):null,S?(0,t.jsxs)("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:[e.panel?(0,t.jsx)("button",{type:"button","data-testid":"interaction-reopen",disabled:p,onClick:()=>m(n=>n.drawPanel(c,e.panel)),style:r,children:"Show the panel"}):null,(0,t.jsx)("button",{type:"button","data-testid":"interaction-again",disabled:p,onClick:()=>m(n=>n.askAgain(c,e)),style:r,children:"Ask again"})]}):null]})}export{E as a,F as b};
|