graview 0.1.29 → 0.1.32
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.2NIOHEMX.js +1 -0
- package/dist/preview/{chunk.GZH6PTXN.js → chunk.3AGY4QVS.js} +1 -1
- package/dist/preview/chunk.3HXN4BOY.js +1 -0
- package/dist/preview/chunk.3K6YSVHC.js +1 -0
- package/dist/preview/{chunk.7D77HEIJ.js → chunk.3TVXGJTU.js} +1 -1
- package/dist/preview/chunk.3TY5NFLY.js +1 -0
- package/dist/preview/{chunk.IZW7DBK4.js → chunk.47STJVRV.js} +1 -1
- package/dist/preview/chunk.4HRAQNJO.js +27 -0
- package/dist/preview/chunk.4HZ7QTXZ.js +1 -0
- package/dist/preview/chunk.4MERAWS2.js +1 -0
- package/dist/preview/chunk.52W7WYME.js +1 -0
- package/dist/preview/chunk.5A4AOFOA.js +1 -0
- package/dist/preview/chunk.5H4VXLZF.js +88 -0
- package/dist/preview/{chunk.D4GOVA25.js → chunk.5T5XGILP.js} +1 -1
- package/dist/preview/chunk.5TVB6BUY.js +1 -0
- package/dist/preview/chunk.5UL7YDUD.js +1 -0
- package/dist/preview/chunk.63GXY2ME.js +1 -0
- package/dist/preview/chunk.6QWV5MVH.js +25 -0
- package/dist/preview/{chunk.HV6I74DF.js → chunk.6UGEYZAC.js} +1 -1
- package/dist/preview/chunk.6YCBYL2Y.js +2 -0
- package/dist/preview/chunk.7GKUVQVF.js +1 -0
- package/dist/preview/{chunk.QSDT2RLY.js → chunk.7T7NZZTC.js} +1 -1
- package/dist/preview/chunk.AKFKM4SW.js +3 -0
- package/dist/preview/chunk.AOSMJKLH.js +1 -0
- package/dist/preview/{chunk.IPBXAAQV.js → chunk.ASCLIM2P.js} +1 -1
- package/dist/preview/chunk.B2GLDIAS.js +1 -0
- package/dist/preview/chunk.BNV77BQZ.js +4 -0
- package/dist/preview/chunk.BOO6WVM4.js +117 -0
- package/dist/preview/chunk.BQ3JHEHV.js +1 -0
- package/dist/preview/chunk.CAVBSL27.js +1 -0
- package/dist/preview/chunk.CDP2XL66.js +1 -0
- package/dist/preview/chunk.CIPS2OGR.js +1 -0
- package/dist/preview/chunk.CJJLJ3KW.js +2 -0
- package/dist/preview/chunk.CN3UEF5N.js +90 -0
- package/dist/preview/chunk.COQKECUH.js +1 -0
- package/dist/preview/{chunk.3G5MQFZK.js → chunk.CWHRDBOF.js} +1 -1
- package/dist/preview/chunk.CX3KL2C5.js +1 -0
- package/dist/preview/chunk.D75KC3LL.js +1 -0
- package/dist/preview/chunk.DAZ2VSRD.js +1 -0
- package/dist/preview/{chunk.ONGVH3ZM.js → chunk.DHIUSUCL.js} +75 -24
- package/dist/preview/{chunk.44FVJOK4.js → chunk.DYSPCGXX.js} +1 -1
- package/dist/preview/chunk.E2YEOMPH.js +1 -0
- package/dist/preview/chunk.EBGAYL32.js +1 -0
- package/dist/preview/{chunk.HRWLR7T4.js → chunk.EF3XNU4O.js} +1 -1
- package/dist/preview/chunk.EJPI3ST6.js +1 -0
- package/dist/preview/chunk.EKPRNDUV.js +1 -0
- package/dist/preview/chunk.ERIT3R6N.js +1 -0
- package/dist/preview/chunk.EYTBDMTW.js +1 -0
- package/dist/preview/chunk.F6EH7HI2.js +1 -0
- package/dist/preview/{chunk.OGXE2RHC.js → chunk.F6ZK7RMB.js} +2 -2
- package/dist/preview/chunk.FSTCX2AI.js +1 -0
- package/dist/preview/chunk.FWTIUYXH.js +2 -0
- package/dist/preview/{chunk.YCA7P5MK.js → chunk.G5NZVPJU.js} +1 -1
- package/dist/preview/chunk.GO4XBWJO.js +9 -0
- package/dist/preview/chunk.GV2CQVKV.js +1 -0
- package/dist/preview/chunk.GYICGZMG.js +3 -0
- package/dist/preview/chunk.H7BST3XO.js +1 -0
- package/dist/preview/chunk.H7EPE74C.js +1 -0
- package/dist/preview/{chunk.X53HI436.js → chunk.HAIG6NVX.js} +1 -1
- package/dist/preview/chunk.HLTRQU4Y.js +35 -0
- package/dist/preview/{chunk.O4QPITBD.js → chunk.I6FPNX43.js} +1 -1
- package/dist/preview/chunk.IDVAR5HM.js +1 -0
- package/dist/preview/chunk.J25KOSNW.js +1 -0
- package/dist/preview/chunk.JDUJDAGA.js +1 -0
- package/dist/preview/chunk.JFAOHHJJ.js +1 -0
- package/dist/preview/chunk.JOOQUWLT.js +341 -0
- package/dist/preview/{chunk.ZBXOX3W3.js → chunk.JQU5GEU3.js} +1 -1
- package/dist/preview/chunk.K5ME5GCG.js +1 -0
- package/dist/preview/chunk.K7PMDSOL.js +1 -0
- package/dist/preview/chunk.KSES5U5B.js +1 -0
- package/dist/preview/chunk.LLLZEGRK.js +1 -0
- package/dist/preview/chunk.LR3VDXPI.js +1 -0
- package/dist/preview/chunk.LXBOVRFI.js +1 -0
- package/dist/preview/chunk.MAF7C3VM.js +2 -0
- package/dist/preview/chunk.MNP4JI33.js +5 -0
- package/dist/preview/{chunk.5AT4O4BN.js → chunk.MWGGV7DE.js} +1 -1
- package/dist/preview/chunk.N6OX4NEQ.js +1 -0
- package/dist/preview/chunk.NM6MZYFN.js +47 -0
- package/dist/preview/chunk.NRAYZY3X.js +1 -0
- package/dist/preview/chunk.NTF7FVB2.js +1 -0
- package/dist/preview/chunk.OC6IWRQ3.js +1 -0
- package/dist/preview/chunk.OF34OZ4V.js +1 -0
- package/dist/preview/chunk.OJGHDWI6.js +1 -0
- package/dist/preview/chunk.OKRNJXTV.js +1 -0
- package/dist/preview/chunk.PBSMLINK.js +1 -0
- package/dist/preview/chunk.PHKSMUIA.js +1 -0
- package/dist/preview/chunk.PIP6Z563.js +1 -0
- package/dist/preview/chunk.QGTSHKJL.js +1 -0
- package/dist/preview/chunk.QVVJRSRM.js +1 -0
- package/dist/preview/{chunk.J46KDTEZ.js → chunk.QYZNAUIR.js} +1 -1
- package/dist/preview/chunk.R6K6GF5R.js +1 -0
- package/dist/preview/chunk.RCKTBOY2.js +1 -0
- package/dist/preview/{chunk.CK7QWLMX.js → chunk.RIJUCHP4.js} +1 -1
- package/dist/preview/chunk.SHPXD6FC.js +1 -0
- package/dist/preview/chunk.SHTJZ6UX.js +1 -0
- package/dist/preview/chunk.SYAEBGDC.js +2 -0
- package/dist/preview/chunk.T5VG5A6V.js +1 -0
- package/dist/preview/{chunk.JNGUSAWX.js → chunk.TAQ764IQ.js} +17 -3
- package/dist/preview/chunk.TCNBCTWO.js +1 -0
- package/dist/preview/chunk.TI4OSTQV.js +1 -0
- package/dist/preview/{chunk.ZSKP6UQS.js → chunk.UATVTXZY.js} +1 -1
- package/dist/preview/{chunk.V6TK4LHW.js → chunk.UBFNZMUX.js} +4 -4
- package/dist/preview/chunk.UGFDSE37.js +1 -0
- package/dist/preview/chunk.UGFJKSHU.js +3 -0
- package/dist/preview/chunk.UHUGOTUU.js +19 -0
- package/dist/preview/chunk.ULRW47RP.js +1 -0
- package/dist/preview/chunk.UNL2HIF2.js +1 -0
- package/dist/preview/chunk.UZGRRDHD.js +1 -0
- package/dist/preview/chunk.VG3O4LWB.js +1 -0
- package/dist/preview/chunk.WAZ7OGBD.js +1 -0
- package/dist/preview/chunk.XANVHJQ4.js +1 -0
- package/dist/preview/chunk.XKABS745.js +1 -0
- package/dist/preview/chunk.XMC7YDWT.js +1 -0
- package/dist/preview/chunk.XNJEFUF7.js +3 -0
- package/dist/preview/chunk.Y6ZNFQK3.js +6 -0
- package/dist/preview/{chunk.QNHECGMH.js → chunk.YIR7PPF3.js} +1 -1
- package/dist/preview/index.html +51 -0
- package/dist/preview/page.js +6 -6
- package/package.json +6 -6
- package/dist/preview/chunk.2643W7FT.js +0 -1
- package/dist/preview/chunk.2CLPRG3I.js +0 -1
- package/dist/preview/chunk.2IZFIORK.js +0 -1
- package/dist/preview/chunk.2NCTM5K2.js +0 -2
- package/dist/preview/chunk.3JM2TNDD.js +0 -2
- package/dist/preview/chunk.4GGAPOMK.js +0 -2
- package/dist/preview/chunk.5JXUAMKI.js +0 -1
- package/dist/preview/chunk.5R66YTET.js +0 -2
- package/dist/preview/chunk.64P76WK4.js +0 -1
- package/dist/preview/chunk.7DNFXJH3.js +0 -1
- package/dist/preview/chunk.7PRFYYVM.js +0 -1
- package/dist/preview/chunk.AE5GKL4C.js +0 -1
- package/dist/preview/chunk.ARR75WBP.js +0 -35
- package/dist/preview/chunk.AVUS5LMG.js +0 -3
- package/dist/preview/chunk.BKPGDEES.js +0 -1
- package/dist/preview/chunk.BZ5OJYHU.js +0 -1
- package/dist/preview/chunk.COTG2IG5.js +0 -1
- package/dist/preview/chunk.DAA6XWLF.js +0 -1
- package/dist/preview/chunk.DKTCRFMS.js +0 -1
- package/dist/preview/chunk.DLGTFXGM.js +0 -1
- package/dist/preview/chunk.DN7SN6ZR.js +0 -1
- package/dist/preview/chunk.G4WQGTZR.js +0 -3
- package/dist/preview/chunk.GDA3G4U2.js +0 -6
- package/dist/preview/chunk.GS4T26WW.js +0 -328
- package/dist/preview/chunk.HFKMHLJ3.js +0 -1
- package/dist/preview/chunk.HGAMNIST.js +0 -1
- package/dist/preview/chunk.HKBKH7EK.js +0 -1
- package/dist/preview/chunk.HLLWKSZB.js +0 -5
- package/dist/preview/chunk.HONUT6OG.js +0 -1
- package/dist/preview/chunk.IWYUFYDJ.js +0 -1
- package/dist/preview/chunk.JU2ZVKMT.js +0 -2
- package/dist/preview/chunk.K4ZUVH2G.js +0 -1
- package/dist/preview/chunk.KC6UZHBM.js +0 -1
- package/dist/preview/chunk.KLITC55P.js +0 -1
- package/dist/preview/chunk.KZ2376BD.js +0 -19
- package/dist/preview/chunk.LYJAVUST.js +0 -1
- package/dist/preview/chunk.MOUGB4H6.js +0 -1
- package/dist/preview/chunk.MYFWM572.js +0 -1
- package/dist/preview/chunk.N4FBDA2W.js +0 -1
- package/dist/preview/chunk.O42YET3W.js +0 -1
- package/dist/preview/chunk.ONDILMIX.js +0 -1
- package/dist/preview/chunk.OQDETV4X.js +0 -1
- package/dist/preview/chunk.OWBEV6FR.js +0 -1
- package/dist/preview/chunk.OWE6OJ4P.js +0 -1
- package/dist/preview/chunk.OYJSFO3A.js +0 -1
- package/dist/preview/chunk.P62SKNJS.js +0 -27
- package/dist/preview/chunk.PA5HYAEO.js +0 -1
- package/dist/preview/chunk.PMEDLEZY.js +0 -9
- package/dist/preview/chunk.PTXQHHKF.js +0 -1
- package/dist/preview/chunk.R2D373VG.js +0 -1
- package/dist/preview/chunk.RB4RTBRZ.js +0 -1
- package/dist/preview/chunk.RCLJ4H52.js +0 -116
- package/dist/preview/chunk.RKRSRKF3.js +0 -1
- package/dist/preview/chunk.RWGLKDWH.js +0 -1
- package/dist/preview/chunk.SIL4KD3K.js +0 -1
- package/dist/preview/chunk.SS76EIMI.js +0 -1
- package/dist/preview/chunk.T4LY5QXO.js +0 -14
- package/dist/preview/chunk.UIIVEQAT.js +0 -1
- package/dist/preview/chunk.UTHHX2TJ.js +0 -1
- package/dist/preview/chunk.UWNYT7PF.js +0 -1
- package/dist/preview/chunk.VNBO2RXD.js +0 -1
- package/dist/preview/chunk.VPPUTA74.js +0 -1
- package/dist/preview/chunk.WKXNBHTL.js +0 -4
- package/dist/preview/chunk.WLRTPFAC.js +0 -1
- package/dist/preview/chunk.XAXJHEMD.js +0 -1
- package/dist/preview/chunk.XDZSTIS6.js +0 -88
- package/dist/preview/chunk.XXHNV24G.js +0 -1
- package/dist/preview/chunk.YRQZZH5V.js +0 -1
- package/dist/preview/chunk.YUWRZWGX.js +0 -1
- package/dist/preview/chunk.Z2RGLFLS.js +0 -1
- package/dist/preview/chunk.Z56B2JR2.js +0 -25
- package/dist/preview/chunk.Z5V23DQN.js +0 -3
- package/dist/preview/chunk.ZEGSQCSD.js +0 -1
- package/dist/preview/chunk.ZEVVWWNA.js +0 -44
- package/dist/preview/chunk.ZS4DJ76C.js +0 -1
- /package/dist/preview/{chunk.OHE5AMHH.js → chunk.GZHZLJBF.js} +0 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import{a as Ve,c as qe}from"./chunk.2NIOHEMX.js";import{b as Fe}from"./chunk.4HRAQNJO.js";import{a as Le,b as Ie,c as Ke,d as j}from"./chunk.Y6ZNFQK3.js";import{i as Pe,j as Me}from"./chunk.BNV77BQZ.js";import"./chunk.SYAEBGDC.js";import"./chunk.NRAYZY3X.js";import"./chunk.RIJUCHP4.js";import"./chunk.TAQ764IQ.js";import{e as $e}from"./chunk.YIR7PPF3.js";import"./chunk.3HXN4BOY.js";import"./chunk.GYICGZMG.js";import{m as Te}from"./chunk.UHUGOTUU.js";import{a as Ee,b as Oe}from"./chunk.47STJVRV.js";import{h as De}from"./chunk.EBGAYL32.js";import{e as Ce,f as Re}from"./chunk.DAZ2VSRD.js";import"./chunk.HJCQ6I3S.js";import{e as ne}from"./chunk.MWGGV7DE.js";import"./chunk.JQU5GEU3.js";import{a as xe,b as Se,j as Ne}from"./chunk.UBFNZMUX.js";import"./chunk.G4JJXA63.js";import"./chunk.HAIG6NVX.js";import"./chunk.UZGRRDHD.js";import"./chunk.XANVHJQ4.js";import"./chunk.OKRNJXTV.js";import"./chunk.CAVBSL27.js";import{a as ke}from"./chunk.EJPI3ST6.js";import"./chunk.CWHRDBOF.js";import"./chunk.3K6YSVHC.js";import"./chunk.SHTJZ6UX.js";import"./chunk.UT6642FC.js";import"./chunk.Q5WEOX3Q.js";import"./chunk.GV2CQVKV.js";import"./chunk.4HZ7QTXZ.js";import"./chunk.G5NZVPJU.js";import"./chunk.WVUJXDXZ.js";import"./chunk.ULRW47RP.js";import{a as be}from"./chunk.PBSMLINK.js";import"./chunk.3TY5NFLY.js";import"./chunk.D75KC3LL.js";import"./chunk.FWTIUYXH.js";import"./chunk.MAF7C3VM.js";import"./chunk.GZHZLJBF.js";import{r as ye}from"./chunk.XMC7YDWT.js";import"./chunk.6UGEYZAC.js";import"./chunk.OJGHDWI6.js";import{g as me}from"./chunk.B2GLDIAS.js";import{d as te}from"./chunk.6YCBYL2Y.js";import{c as he}from"./chunk.UGFJKSHU.js";import{C as Ae,n as J}from"./chunk.JOOQUWLT.js";import{F as et,Q as fe,R as we,Y as V,_ as X,ha as ve,k as ce,m as ge,n as ue,oa as ee,pa as Y,s as U}from"./chunk.6QWV5MVH.js";import{K as se,Ka as Z,N as D,X as G,_ as de,aa as le,ca as pe}from"./chunk.MNP4JI33.js";import{b as Q}from"./chunk.AJZBJBMO.js";var f=Q(et(),1);var tt=300,nt=14,z=50,it=3,at=2;function Be(e,n,o){let p=e.tryDefinition(n)?.fields?.shape;return(p?.[o]===void 0?void 0:be(p[o]))?.type}var ot=(e,n)=>Object.keys(e.tryDefinition(n)?.fields?.shape??{}),rt=e=>e==="date"||e==="datetime",_e=/^(due|dueOn|dueAt|dueDate|deadline|by)$/i,st=/^(date|on|day|when|at|start|starts|startsOn|startsAt|begins|from|sown|scheduled|scheduledFor|planned|plannedFor)$/i,dt=/^(done|finished|complete|completed|closed)$/i;function ae(e,n){let o=e.tryDefinition(n),p=ot(e,n),a=p.filter(u=>rt(Be(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=>_e.test(u))??a.find(u=>st.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=>dt.test(u)&&Be(e,n,u)==="boolean");return{field:c,due:_e.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 Ge(e,n,o,p){let a=ne(e,n);if(a&&o.length>0&&o.length<=tt)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<=nt){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 je(e,n){let o=ae(e,n);return o?{by:o.field,direction:o.due?"asc":"desc"}:void 0}function ze(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 lt=60;function He(e,n,o,p){let a=e.tryDefinition(n),i=o.slice(0,lt),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,it).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,at).map(([w,l])=>{let r=he(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 We(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 Ze(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 Ue=6;function Ye(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<=Ue&&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,Ue+1)}`}]}function Je(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.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(fe(),1),Qe="as",pt=(e,n)=>`graview:kind-seen:${e}:${n}`;function ct(e){try{return localStorage.getItem(e)}catch{return null}}function gt(e,n){try{localStorage.setItem(e,n)}catch{}}var ut=(e,n)=>({...ce(ue(e,!1),n),relation:null});function Yt({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??le(l,e),h=i.today()??new Date().toISOString().slice(0,10),m=n,b=(0,f.useId)(),A=(0,f.useMemo)(()=>Ge(l,e,m,h),[l,e,m,h]),x=g.within?.[Qe]==="table"?{shape:"table"}:A,k=Ee(g),C=x.shape==="table"&&!k.sort?je(l,e):void 0,v=C?{...k,sort:C}:k,R=(0,f.useMemo)(()=>new Set(o),[o]),O=(0,f.useMemo)(()=>De(m,v,{schema:l,graph:i.graph,flagged:R,today:h}),[m,v,l,i,R,h,w]),I=(0,f.useMemo)(()=>Re(l,Ce(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(ze(e,x,v)),P=(0,f.useMemo)(()=>{let $=Ne(JSON.parse(H),{app:B,sight:Se(B,c)});return xe($)?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:xt}),(0,t.jsx)(ft,{kind:e,plural:y,count:m.length,headingId:b,description:r?.description}),(0,t.jsx)(vt,{kind:e,plural:y,members:m,today:h,arrangement:v,onArrange:K}),(m.length>1||a>0)&&!W?(0,t.jsx)(Te,{schema:l,graph:i.graph,kind:e,arrangement:v,onChange:K,offers:I,...M?{filters:M}:{},kept:{shown:O.nodes.length,of:m.length},testId:"kind-arrange",chips:{nodes:m,flagged:R,today:h},...a>0?{past:{count:a,widen:()=>u($e(g,!0))}}:{}}):null,m.length>0?(0,t.jsx)(bt,{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)(yt,{draft:P,nodes:m}):O.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)(kt,{kind:e,nodes:O.nodes,groups:O.grouped?O.groups.map($=>({key:$.key,label:$.label,nodes:$.nodes})):void 0,flagged:R,plural:y,arrangement:v})})]})}function ft({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}=Pe(S),{apply:u,preview:w}=Me(),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 T=(x,k)=>{try{w(x,k),u(x,k),m(null),y(!1),requestAnimationFrame(()=>b.current?.focus())}catch(C){return m(me(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:[de(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?T(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)(ke,{affordance:l,onApply:x=>T(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 wt=J.part((e,n)=>(0,t.jsx)(e.ProblemRows,{...n}),{what:"The problems",as:"li"});function vt({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)(()=>Ze(u,w,v=>s.allInvariants().find(R=>R.name===v)?.label),[u,w,s]),r=(0,f.useMemo)(()=>Ye(g,e,o,p),[g,e,o,p]),y=pt(Ae(c,g),e),[h]=(0,f.useState)(()=>ct(y));(0,f.useEffect)(()=>()=>gt(y,new Date().toISOString()),[y]);let m=X(),b=(0,f.useMemo)(()=>h?Je(s.log.all(),e,h,v=>s.graph.getNode(v)?.kind):null,[h,s,e,m]),[A,T]=(0,f.useState)(null),x=v=>i({...a,filter:[...(a.filter??[]).filter(R=>!v?.some(O=>O.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 ",pe(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)(ht,{group:v,open:A===v.invariant,onToggle:()=>T(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 (",se(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 ht({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)(wt,{violations:e.violations,pick:i=>{let s=i.subjectId??e.records[0]??i.nodeIds[0];s!==void 0&&p(s)}})})}):null]})}var mt={board:"Board",calendar:"Calendar",table:"Table"};function bt({derived:e,shape:n,draft:o}){let{view:p}=V(),{go:a}=Y(),{keep:i}=Ve(qe()),[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(ge(p,Qe,g===e.shape?null:g)),children:mt[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 yt({draft:e,nodes:n}){let o=Fe(e.drawn);return(0,t.jsx)("div",{className:"graview-kind-stop-lens","data-graview-draft":e.lens.name,children:(0,t.jsx)(we,{mode:"scene",children:(0,t.jsx)(ye,{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 kt({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=Le(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]),T=(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&&!ve(C)?C:void 0,R=d=>g.includes(d),O=ee(),I=(0,f.useMemo)(()=>He(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=>O.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,Xe=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(ut(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=We(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(Xe)};return(0,t.jsxs)("div",{className:"graview-kind-stop-table-at",...A?{...b.listProps,ref:d=>{T.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:Ie}):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)(Ke,{store:s,chosen:b.chosen,principal:l,anchor:()=>T.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 xt=`
|
|
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{Yt as KindStop};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as v,b as m,c as h}from"./chunk.MB7LKKUD.js";import"./chunk.
|
|
1
|
+
import{a as v,b as m,c as h}from"./chunk.MB7LKKUD.js";import"./chunk.JOOQUWLT.js";import{F as N,Q as u,ta as p,va as b}from"./chunk.6QWV5MVH.js";import{ec as f}from"./chunk.MNP4JI33.js";import{b as c}from"./chunk.AJZBJBMO.js";var l=c(N(),1);var o=c(u(),1);function z({notices:r,anchor:n,board:a}){return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(w,{notices:r.filter(i=>i.kind==="banner"),at:"top",anchor:n,board:a}),(0,o.jsx)(w,{notices:r.filter(i=>i.kind==="toast"),at:"foot",anchor:n,board:a})]})}var y={info:"var(--graview-accent)",good:"var(--graview-good)",warn:"var(--graview-warn)",bad:"var(--graview-bad)"};function w({notices:r,at:n,anchor:a,board:i}){let s=(0,l.useRef)(null),t=r.length>0;return(0,l.useLayoutEffect)(()=>{let e=s.current;if(!t||!e)return;if(typeof e.showPopover=="function"&&!p(e))try{e.showPopover()}catch{}let d=()=>(n==="top"?h:m)(e,a());d(),n==="foot"&&i.hold?.(()=>e.matches(":hover, :focus-within"));let S=b(e);addEventListener("resize",d),addEventListener("scroll",d,!0),n==="foot"&&addEventListener(v,d);let g=typeof ResizeObserver=="function"?new ResizeObserver(d):null;return g?.observe(e),()=>{if(S(),g?.disconnect(),removeEventListener("resize",d),removeEventListener("scroll",d,!0),removeEventListener(v,d),e.isConnected&&p(e))try{e.hidePopover()}catch{}}},[t,n,a,i]),t?(0,o.jsx)("div",{ref:s,popover:"manual",role:"region","aria-label":n==="top"?"Notices":"Messages","data-testid":n==="top"?"notices-banners":"notices-toasts","data-graview-offstage":"",style:{position:"fixed",inset:"auto",margin:0,padding:0,border:"none",background:"none",overflow:"visible",zIndex:f("toast"),width:"max-content",height:"auto",maxWidth:"min(560px, calc(100vw - 32px))",display:"grid",gap:8,color:"var(--graview-ink)"},children:r.map(e=>(0,o.jsx)(T,{notice:e,board:i},e.id))}):null}function T({notice:r,board:n}){let a=r.tone??"info",i=[...r.action?[r.action]:[],...r.actions??[]],s=()=>n.dismiss(r.id);return(0,o.jsxs)("div",{"data-testid":"notice","data-kind":r.kind,"data-tone":a,style:{boxSizing:"border-box",display:"flex",flexWrap:"wrap",alignItems:"center",gap:"8px 12px",padding:r.kind==="banner"?"8px 10px 8px 14px":"10px 12px 10px 14px",borderRadius:"var(--graview-radius, 12px)",borderTop:"1px solid var(--graview-edge)",borderRight:"1px solid var(--graview-edge)",borderBottom:"1px solid var(--graview-edge)",borderLeft:`3px solid ${y[a]}`,background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",fontSize:"0.875rem",lineHeight:1.45},children:[(0,o.jsx)("span",{"aria-hidden":"true",style:{width:7,height:7,borderRadius:999,flex:"0 0 auto",background:y[a]}}),(0,o.jsx)("span",{style:{flex:"1 1 16rem",minWidth:0},children:r.sentence}),i.length>0?(0,o.jsx)("span",{style:{display:"flex",flexWrap:"wrap",gap:6},children:i.map((t,e)=>t.href!==void 0?(0,o.jsx)("a",{href:t.href,...t.target?{target:t.target,rel:"noopener"}:{},"data-testid":"notice-action",onClick:()=>{t.onSelect?.(),s()},style:{...x,...e===0?k:{}},children:t.label},t.label):(0,o.jsx)("button",{type:"button","data-testid":"notice-action",onClick:()=>{s(),t.onSelect?.()},style:{...x,...e===0?k:{}},children:t.label},t.label))}):null,(0,o.jsx)("button",{type:"button","data-testid":"notice-dismiss","aria-label":`Dismiss: ${r.sentence}`,title:"Dismiss",onClick:s,style:E,children:"\xD7"})]})}var x={display:"inline-flex",alignItems:"center",minHeight:28,padding:"2px 12px",borderRadius:9,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)",font:"inherit",fontWeight:500,textDecoration:"none",cursor:"pointer"},k={background:"var(--graview-accent)",borderColor:"var(--graview-accent)",color:"var(--graview-accent-ink)"},E={minWidth:28,minHeight:28,padding:0,border:"none",background:"none",boxShadow:"none",color:"var(--graview-ink-muted)",fontSize:"1rem",cursor:"pointer"};export{z as NoticeStacks};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as y}from"./chunk.BOO6WVM4.js";import"./chunk.NM6MZYFN.js";import"./chunk.63GXY2ME.js";import"./chunk.UGFDSE37.js";import{j as m}from"./chunk.FSTCX2AI.js";import"./chunk.Y6ZNFQK3.js";import"./chunk.NRAYZY3X.js";import"./chunk.RIJUCHP4.js";import"./chunk.TAQ764IQ.js";import"./chunk.YIR7PPF3.js";import"./chunk.3HXN4BOY.js";import"./chunk.GYICGZMG.js";import"./chunk.UHUGOTUU.js";import"./chunk.47STJVRV.js";import"./chunk.EBGAYL32.js";import"./chunk.DAZ2VSRD.js";import"./chunk.XANVHJQ4.js";import"./chunk.CAVBSL27.js";import"./chunk.J25KOSNW.js";import"./chunk.LR3VDXPI.js";import"./chunk.CWHRDBOF.js";import"./chunk.3K6YSVHC.js";import"./chunk.SHTJZ6UX.js";import"./chunk.UT6642FC.js";import"./chunk.MB7LKKUD.js";import"./chunk.WVUJXDXZ.js";import"./chunk.ULRW47RP.js";import"./chunk.PBSMLINK.js";import"./chunk.3TY5NFLY.js";import"./chunk.D75KC3LL.js";import"./chunk.FWTIUYXH.js";import"./chunk.MAF7C3VM.js";import"./chunk.GZHZLJBF.js";import"./chunk.XMC7YDWT.js";import"./chunk.6UGEYZAC.js";import"./chunk.OJGHDWI6.js";import"./chunk.B2GLDIAS.js";import"./chunk.6YCBYL2Y.js";import"./chunk.UGFJKSHU.js";import"./chunk.JOOQUWLT.js";import{F as S,Q as g}from"./chunk.6QWV5MVH.js";import{Uc as n}from"./chunk.MNP4JI33.js";import{b as t}from"./chunk.AJZBJBMO.js";var h=t(S(),1),a=t(g(),1);function R({store:c,auto:f,brand:r,views:u,presence:i,steering:o,overview:d,scope:s,titleLevel:v=2,quickAsk:l,props:e}){let b=(0,h.useMemo)(()=>m({scope:`.${s}`}),[s]);return(0,a.jsxs)("div",{"data-embed-content":"",style:f?{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:b}),(0,a.jsx)("div",{"data-embed-measure":"",style:{display:"flow-root"},children:(0,a.jsx)(y,{context:{store:c,embedded:!0,...e.bar!==!1?{barAbove:!0}:{},...d?{overview:d}:{},titleLevel:v,views:u,settings:e.app.settings??[],...i?{presence:i}:{},...r?{brand:r}:{},...e.locale?{locale:e.locale}:{},...e.principal?{principal:e.principal}:{},...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{},...l!==void 0?{quickAsk:l}:{}},...e.pages?{registry:e.pages}:{},...o?{steering:o}:{},...e.routing==="address"?n(e.basePath)===""?{}:{basename:n(e.basePath)}:{initialPath:e.path??"/"},...e.path!==void 0?{path:e.path}:{},...e.onNavigate?{onNavigate:e.onNavigate}:{}})})]})}export{R as PagesContent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as g,O as m,Y as d,ea as v}from"./chunk.6QWV5MVH.js";import{b as S}from"./chunk.AJZBJBMO.js";var w=S(g(),1);function f(){let{store:A,principal:a,ai:i,aiDesk:r,seatTalk:t,views:p,app:l,brand:s,view:k,selection:c}=d(),e=m(A,a),y=v(),o=k.within?.view;return(0,w.useMemo)(()=>({store:e,principal:a,ai:i,desk:r,seatTalk:t,goTo:y,places:p.places().map(n=>({as:n.as,title:n.title,kind:n.kind})),app:l??{name:s?.name??"app",schema:e.schema,...e.policy?{policy:e.policy}:{}},...o?{place:o}:{},selection:c}),[e,a,i,r,t,y,p,l,s,o,c])}export{f as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{n as v}from"./chunk.JOOQUWLT.js";import{F as P,I as w,Q as p,Y as R,a as A,xa as b}from"./chunk.6QWV5MVH.js";import{Qc as h}from"./chunk.MNP4JI33.js";import{b as i}from"./chunk.AJZBJBMO.js";var L=i(p(),1),B=v.part(e=>(0,L.jsx)(e.ActivityRail,{calls:[]}),{quiet:!0});var l=i(P(),1),g=i(p(),1),C=b(A(()=>(__graviewPreload(import.meta.url,["./chunk.NTF7FVB2.js","./chunk.5UL7YDUD.js","./chunk.JDUJDAGA.js","./chunk.LR3VDXPI.js","./chunk.COQKECUH.js","./chunk.EJPI3ST6.js","./chunk.3K6YSVHC.js","./chunk.SHTJZ6UX.js","./chunk.UT6642FC.js","./chunk.TI4OSTQV.js","./chunk.GZHZLJBF.js","./chunk.XMC7YDWT.js","./chunk.6UGEYZAC.js","./chunk.OJGHDWI6.js","./chunk.B2GLDIAS.js","./chunk.6YCBYL2Y.js","./chunk.UGFJKSHU.js","./chunk.JOOQUWLT.js","./chunk.6QWV5MVH.js","./chunk.MNP4JI33.js","./chunk.AJZBJBMO.js"]),import("./chunk.AOSMJKLH.js")))),F=C.part((e,r)=>{let t=e.RecordInteractions;return(0,g.jsx)(t,{...r})},{quiet:!0});function T(e,r,t){let o=e.target;return(o.on==="record"||o.on==="field"?o.id===r:o.on==="selection"?o.ids.includes(r):o.on==="act"?o.id===r:!1)||e.offered.some(n=>n.id===`record:${r}`||n.id.startsWith(`fill:${r}:`))||(e.batches??[]).some(n=>t(n).includes(r))}function D({id:e,style:r,headingStyle:t,className:o}){let{ai:d,aiDesk:n,store:f}=R(),{entries:y}=w(n),s=d.off===!0;(0,l.useEffect)(()=>{s||n.load()},[n,s]);let S=f.log.length,m=(0,l.useMemo)(()=>{let x=u=>f.log.all().flatMap(k=>k.batch===u?k.writes:[]);return y.filter(u=>T(u,e,x))},[y,e,f,S]);return s||m.length===0?null:(0,g.jsx)(l.Suspense,{fallback:null,children:(0,g.jsx)(F,{entries:m,...r?{style:r}:{},...t?{headingStyle:t}:{},...o?{className:o}:{}})})}var c=i(P(),1),a=i(p(),1);function ro({context:e,stop:r,title:t,label:o,style:d,className:n,children:f,...y}){let s=h(e.views?.arrangement?.()),S=f??(0,a.jsxs)(a.Fragment,{children:["In ",s==="Scene"?"the scene":s.replace(/^The /,"the ")," ",(0,a.jsx)("span",{"aria-hidden":"true",children:"\u2197"})]}),m=o?{"aria-label":o}:{};if(e.overview){let x=e.overview;return(0,a.jsx)("a",{href:r,...y,...m,...t?{title:t}:{},style:d,...n?{className:n}:{},onClick:u=>{u.preventDefault(),x(r)},children:S})}return e.embedded?null:(0,a.jsx)("a",{href:`${e.sceneHref??"/"}${r}`,...y,...m,...t?{title:t}:{},style:d,...n?{className:n}:{},children:S})}function oo(){return(0,a.jsx)("a",{href:"#fresh","data-testid":"start-fresh",title:"Forget every edit made in this browser and return to the example",onClick:e=>{e.preventDefault();let r=new URL(window.location.href);r.searchParams.set("fresh","1"),window.location.assign(r.toString())},style:{color:"inherit",display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24},children:"Start fresh"})}function to(e){let r=(0,c.useRef)(0),t=(0,c.useCallback)(o=>e.subscribe(()=>{r.current+=1,o()}),[e]);return(0,c.useSyncExternalStore)(t,()=>r.current,()=>0)}export{B as a,D as b,ro as c,oo as d,to as e};
|
|
@@ -0,0 +1,25 @@
|
|
|
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{Aa as kn,Fc as In,I as xn,Kb as Pn,La as An,Tc as Cn,Yc as He,Zc as st,ec as Rn,pc as Tn,rc as Mn,ua as En,uc as On,ya as at}from"./chunk.MNP4JI33.js";import{a as Le,b as L}from"./chunk.AJZBJBMO.js";var Qn=Le(w=>{"use strict";var yt=Symbol.for("react.transitional.element"),pr=Symbol.for("react.portal"),yr=Symbol.for("react.fragment"),mr=Symbol.for("react.strict_mode"),gr=Symbol.for("react.profiler"),hr=Symbol.for("react.consumer"),Sr=Symbol.for("react.context"),wr=Symbol.for("react.forward_ref"),vr=Symbol.for("react.suspense"),br=Symbol.for("react.memo"),zn=Symbol.for("react.lazy"),xr=Symbol.for("react.activity"),Kn=Symbol.iterator;function Er(e){return e===null||typeof e!="object"?null:(e=Kn&&e[Kn]||e["@@iterator"],typeof e=="function"?e:null)}var Un={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Yn=Object.assign,Xn={};function pe(e,t,n){this.props=e,this.context=t,this.refs=Xn,this.updater=n||Un}pe.prototype.isReactComponent={};pe.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};pe.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Jn(){}Jn.prototype=pe.prototype;function mt(e,t,n){this.props=e,this.context=t,this.refs=Xn,this.updater=n||Un}var gt=mt.prototype=new Jn;gt.constructor=mt;Yn(gt,pe.prototype);gt.isPureReactComponent=!0;var Bn=Array.isArray;function pt(){}var R={H:null,A:null,T:null,S:null},Zn=Object.prototype.hasOwnProperty;function ht(e,t,n){var o=n.ref;return{$$typeof:yt,type:e,key:t,ref:o!==void 0?o:null,props:n}}function kr(e,t){return ht(e.type,t,e.props)}function St(e){return typeof e=="object"&&e!==null&&e.$$typeof===yt}function Ar(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var $n=/\/+/g;function ft(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Ar(""+e.key):t.toString(36)}function Pr(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(pt,pt):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function fe(e,t,n,o,r){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(i){case"bigint":case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case yt:case pr:a=!0;break;case zn:return a=e._init,fe(a(e._payload),t,n,o,r)}}if(a)return r=r(e),a=o===""?"."+ft(e,0):o,Bn(r)?(n="",a!=null&&(n=a.replace($n,"$&/")+"/"),fe(r,t,n,"",function(u){return u})):r!=null&&(St(r)&&(r=kr(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace($n,"$&/")+"/")+a)),t.push(r)),1;a=0;var d=o===""?".":o+":";if(Bn(e))for(var s=0;s<e.length;s++)o=e[s],i=d+ft(o,s),a+=fe(o,t,n,i,r);else if(s=Er(e),typeof s=="function")for(e=s.call(e),s=0;!(o=e.next()).done;)o=o.value,i=d+ft(o,s++),a+=fe(o,t,n,i,r);else if(i==="object"){if(typeof e.then=="function")return fe(Pr(e),t,n,o,r);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return a}function Be(e,t,n){if(e==null)return e;var o=[],r=0;return fe(e,o,"","",function(i){return t.call(n,i,r++)}),o}function Rr(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var qn=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Tr={map:Be,forEach:function(e,t,n){Be(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Be(e,function(){t++}),t},toArray:function(e){return Be(e,function(t){return t})||[]},only:function(e){if(!St(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};w.Activity=xr;w.Children=Tr;w.Component=pe;w.Fragment=yr;w.Profiler=gr;w.PureComponent=mt;w.StrictMode=mr;w.Suspense=vr;w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=R;w.__COMPILER_RUNTIME={__proto__:null,c:function(e){return R.H.useMemoCache(e)}};w.cache=function(e){return function(){return e.apply(null,arguments)}};w.cacheSignal=function(){return null};w.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var o=Yn({},e.props),r=e.key;if(t!=null)for(i in t.key!==void 0&&(r=""+t.key),t)!Zn.call(t,i)||i==="key"||i==="__self"||i==="__source"||i==="ref"&&t.ref===void 0||(o[i]=t[i]);var i=arguments.length-2;if(i===1)o.children=n;else if(1<i){for(var a=Array(i),d=0;d<i;d++)a[d]=arguments[d+2];o.children=a}return ht(e.type,r,o)};w.createContext=function(e){return e={$$typeof:Sr,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:hr,_context:e},e};w.createElement=function(e,t,n){var o,r={},i=null;if(t!=null)for(o in t.key!==void 0&&(i=""+t.key),t)Zn.call(t,o)&&o!=="key"&&o!=="__self"&&o!=="__source"&&(r[o]=t[o]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var d=Array(a),s=0;s<a;s++)d[s]=arguments[s+2];r.children=d}if(e&&e.defaultProps)for(o in a=e.defaultProps,a)r[o]===void 0&&(r[o]=a[o]);return ht(e,i,r)};w.createRef=function(){return{current:null}};w.forwardRef=function(e){return{$$typeof:wr,render:e}};w.isValidElement=St;w.lazy=function(e){return{$$typeof:zn,_payload:{_status:-1,_result:e},_init:Rr}};w.memo=function(e,t){return{$$typeof:br,type:e,compare:t===void 0?null:t}};w.startTransition=function(e){var t=R.T,n={};R.T=n;try{var o=e(),r=R.S;r!==null&&r(n,o),typeof o=="object"&&o!==null&&typeof o.then=="function"&&o.then(pt,qn)}catch(i){qn(i)}finally{t!==null&&n.types!==null&&(t.types=n.types),R.T=t}};w.unstable_useCacheRefresh=function(){return R.H.useCacheRefresh()};w.use=function(e){return R.H.use(e)};w.useActionState=function(e,t,n){return R.H.useActionState(e,t,n)};w.useCallback=function(e,t){return R.H.useCallback(e,t)};w.useContext=function(e){return R.H.useContext(e)};w.useDebugValue=function(){};w.useDeferredValue=function(e,t){return R.H.useDeferredValue(e,t)};w.useEffect=function(e,t){return R.H.useEffect(e,t)};w.useEffectEvent=function(e){return R.H.useEffectEvent(e)};w.useId=function(){return R.H.useId()};w.useImperativeHandle=function(e,t,n){return R.H.useImperativeHandle(e,t,n)};w.useInsertionEffect=function(e,t){return R.H.useInsertionEffect(e,t)};w.useLayoutEffect=function(e,t){return R.H.useLayoutEffect(e,t)};w.useMemo=function(e,t){return R.H.useMemo(e,t)};w.useOptimistic=function(e,t){return R.H.useOptimistic(e,t)};w.useReducer=function(e,t,n){return R.H.useReducer(e,t,n)};w.useRef=function(e){return R.H.useRef(e)};w.useState=function(e){return R.H.useState(e)};w.useSyncExternalStore=function(e,t,n){return R.H.useSyncExternalStore(e,t,n)};w.useTransition=function(){return R.H.useTransition()};w.version="19.2.8"});var j=Le((ta,eo)=>{"use strict";eo.exports=Qn()});var uo=Le(ze=>{"use strict";var Nr=Symbol.for("react.transitional.element"),jr=Symbol.for("react.fragment");function lo(e,t,n){var o=null;if(n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),"key"in t){n={};for(var r in t)r!=="key"&&(n[r]=t[r])}else n=t;return t=n.ref,{$$typeof:Nr,type:e,key:o,ref:t!==void 0?t:null,props:n}}ze.Fragment=jr;ze.jsx=lo;ze.jsxs=lo});var Te=Le((da,co)=>{"use strict";co.exports=uo()});function _n(e){let t,n=!1,o,r,i=0;return()=>{if(n)return Promise.resolve(t);if(o)return o;let a=i>0&&r!==void 0?sr(r):e();i+=1;let d=a.then(s=>(t=s,n=!0,o=void 0,s),s=>{throw o=void 0,r??=lr(s),s});return o=d,d}}var Vn=0;function sr(e){return Vn+=1,import(`${e}${e.includes("?")?"&":"?"}retry=${Vn}`)}function lr(e,t=import.meta.url){let n=e instanceof Error?e.message:typeof e=="string"?e:"",o=/^(?:Failed to fetch|error loading) dynamically imported module: ([a-z]+:\/\/[^\s"'<>]+)/.exec(n)?.[1]?.replace(/[.,;:)\]]+$/,""),r=i=>i.split("/",3).join("/");return o&&r(o)===r(t)?o:void 0}var de={focusId:null,relation:null,expanded:[],pins:{}},De=e=>{let t=Number(e);return Number.isFinite(t)?t:null};function Z(e){let t=new URLSearchParams;e.focusId&&t.set("focus",e.focusId),e.relation&&t.set("relation",e.relation),e.overview&&t.set("overview","1"),e.zoom&&t.set("zoom","1"),e.past&&t.set("past","1"),e.shown&&e.shown.length>0&&t.set("show",[...e.shown].sort().join(",")),e.selection!==void 0&&e.selection.length>0&&t.set("sel",[...e.selection].sort().join(",")),e.expanded.length>0&&t.set("expand",[...e.expanded].sort().join(","));for(let o of Object.keys(e.pins).sort()){let r=e.pins[o];t.set(`pin.${o}`,`${Ne(r.x)},${Ne(r.y)}`)}e.pan&&(e.pan.x!==0||e.pan.y!==0)&&t.set("pan",`${Ne(e.pan.x)},${Ne(e.pan.y)}`);for(let o of Object.keys(e.within??{}).sort()){let r=e.within[o];r.length>0&&t.set(`in.${o}`,r)}e.q&&e.q.trim().length>0&&t.set("q",e.q);let n=t.toString();return n?`#${n}`:"#"}function dr(e){return e&&e.startsWith("agg:")?`aggregate:${e.slice(4)}`:e}function je(e){let t=e.includes("#")?e.slice(e.indexOf("#")+1):e,n=new URLSearchParams(t),o=Object.create(null);for(let[S,p]of n){if(!S.startsWith("pin."))continue;let[g,y]=p.split(","),x=g===void 0?null:De(g),m=y===void 0?null:De(y);x===null||m===null||(o[S.slice(4)]={x,y:m})}let r=Object.create(null);for(let[S,p]of n)!S.startsWith("in.")||p.length===0||(r[S.slice(3)]=p);let i=n.get("view");i&&i.length>0&&r.view===void 0&&(r.view=i);let a=n.get("pan")?.split(",")??[],d=a[0]===void 0?null:De(a[0]),s=a[1]===void 0?null:De(a[1]),u=(n.get("sel")??"").split(",").filter(S=>S.length>0).sort(),f=n.get("overview")==="1";return{...u.length>0?{selection:u}:{},...f?{overview:!0}:{},...n.get("zoom")==="1"?{zoom:!0}:{},...n.get("past")==="1"?{past:!0}:{},...n.get("show")?{shown:[...new Set(n.get("show").split(",").filter(Boolean))].sort()}:{},...d!==null&&s!==null?{pan:{x:d,y:s}}:{},...Object.keys(r).length>0?{within:r}:{},...n.get("q")?.trim()?{q:n.get("q")}:{},focusId:dr(n.get("focus")),relation:n.get("relation"),expanded:(n.get("expand")??"").split(",").filter(S=>S.length>0&&(f||!S.startsWith("kind:"))).sort(),pins:o}}function Ni(e){let t=je(e);return Z(t)==="#"?{...t,overview:!0}:t}function ji(e){let t=Z(e);return t==="#overview=1"?"":t}function Ne(e){return Math.round(e*100)/100}function Hn(e,t){return Z(e)===Z(t)}var Ln="edge:";function Dn(e){if(!e.startsWith(Ln))return null;let t=e.slice(Ln.length).split(":");if(t.length!==3)return null;let[n,o,r]=t;if(!n||!o||!r)return null;try{return{kind:decodeURIComponent(n),from:decodeURIComponent(o),to:decodeURIComponent(r)}}catch{return null}}function lt(e){let{pan:t,...n}=e;return{...n,pins:{}}}function $(e,t){if(t===e.focusId)return{...e,focusId:t};let n=lt(e);return{...n.within?.q!==void 0?ie(n,"q",null):n,focusId:t}}function Nn(e,t){return{...e,relation:t}}function ie(e,t,n){let o={...e.within??{}};if(n===null?delete o[t]:o[t]=n,Object.keys(o).length===0){let{within:r,...i}=e;return i}return{...e,within:o}}function ue(e,t){if(t!==e.overview&&(e=lt(e)),!t){let n=e.expanded.filter(o=>!o.startsWith("kind:"));return{...e,overview:!1,expanded:n}}return{...e,overview:t}}function Ge(e,t){if(t.length===0){let{selection:n,...o}=e;return o}return{...e,selection:[...t]}}function Pe(e,t){if(t!==(e.zoom===!0)&&(e=lt(e)),!t){let{zoom:n,...o}=e;return o}return{...e,zoom:!0}}function We(e,t){let n=new Set(e.expanded);return n.has(t)?n.delete(t):n.add(t),{...e,expanded:[...n].sort()}}var Ke="aggregate:",Fe="kind:";function dt(e){return`${Fe}${e}`}function ce(e){return e.startsWith(Fe)?e.slice(Fe.length):null}var Fi="kinds:beyond";function ur(e){let t=ce(e);return t?[t]:ae(e)}function Q(...e){return`${Ke}${[...e].sort().join("+")}`}function jn(e){return e.startsWith(Ke)}function ae(e){return!jn(e)||e.includes("|")?[]:e.slice(Ke.length).split("+").filter(Boolean)}function Gn(e,t,n={}){let o=ce(t);if(o!==null&&e.overview&&n.ownPicture!==!0)return We(e,t);let r=o!==null?Q(o):t;if(e.zoom&&e.focusId===r&&!(o!==null&&n.carry))return Pe(e,!1);if(o!==null&&n.carry){let i=ue({...$(e,r),relation:null},!1);return ie(Pe(i,!0),"q",n.carry)}return Pe({...$(e,r),relation:null},!0)}function cr(e,t,n){return ie(ue($(e,Q(t)),!1),"view",n)}function Ki(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Wn="aggregate:";function ut(e){return e.startsWith(Wn)&&e.includes("|")}var Fn=e=>e?.off===!0,fr=e=>e!==void 0&&!Fn(e)&&(e.fast!==void 0||e.thinking!==void 0||e.answer!==void 0||e.decide!==void 0||e.complete!==void 0||e.turn!==void 0),ct={};var to=L(j(),1),Mr={turns:[],outcomes:new Map,busy:!1,pending:null,draft:null,draftNote:null},no=e=>`graview:seat:${e}`;function Or(e){if(!e)return{};try{let t=sessionStorage.getItem(e);if(!t)return{};let n=JSON.parse(t);return{...Array.isArray(n.turns)?{turns:n.turns}:{},...Array.isArray(n.outcomes)?{outcomes:new Map(n.outcomes)}:{},...n.draft?.drawn?{draft:n.draft}:{}}}catch{return{}}}function Ir(e,t){if(e)try{sessionStorage.setItem(e,JSON.stringify({turns:t.turns.slice(-40),outcomes:[...t.outcomes],draft:t.draft}))}catch{}}function wt(e){let t=e===null?null:no(e),n={...Mr,...Or(t)},o=new Set,r=(i,a=!0)=>{n=i,a&&Ir(t,n);for(let d of[...o])d()};return{get:()=>n,subscribe(i){return o.add(i),()=>void o.delete(i)},setTurns:i=>r({...n,turns:i(n.turns)}),settle:(i,a)=>r({...n,outcomes:new Map(n.outcomes).set(i,a)}),setBusy:i=>r({...n,busy:i},!1),ask:i=>r({...n,pending:i.trim()||null}),takePending(){let i=n.pending;return i!==null&&r({...n,pending:null},!1),i},setDraft:(i,a=null)=>r({...n,draft:i,draftNote:a})}}function Cr(e){return(0,to.useSyncExternalStore)(e.subscribe,e.get,e.get)}var ro=L(j(),1),Vr={entries:[],ghost:null,loaded:!1};function oo(e,t){let n=new Map(e.map(o=>[o.id,o]));for(let o of t)n.set(o.id,{...n.get(o.id),...o});return[...n.values()].sort((o,r)=>o.at<r.at?1:o.at>r.at?-1:0)}function vt(e){let t=Vr,n=new Set,o=r=>{t=r;for(let i of[...n])i()};return{get:()=>t,subscribe:r=>(n.add(r),()=>n.delete(r)),record:r=>{o({...t,entries:oo(t.entries,[r])}),Promise.resolve(e()?.keep?.(r)).catch(i=>{console.warn("The host did not keep an AI interaction:",i)})},setGhost:r=>o({...t,ghost:r}),load:()=>{if(t.loaded)return;o({...t,loaded:!0});let r=e()?.load;r&&Promise.resolve(r()).then(i=>o({...t,entries:oo(t.entries,i)})).catch(i=>{console.warn("The host's AI interactions could not be read:",i)})}}}function _r(e){return(0,ro.useSyncExternalStore)(e.subscribe,e.get,e.get)}function io(e){return e?.closest?.("[data-graview-pick]")?.getAttribute("data-graview-pick")??null}var $e=L(j(),1),qe=(0,$e.createContext)(void 0),Lr=()=>(0,$e.useContext)(qe);var O=L(j(),1),Re=(0,O.createContext)(null);function so(){return(0,O.useContext)(Re)}function Hr(e,t){let n=so(),o=(0,O.useMemo)(()=>n?n.live.seenBy(t):e,[n,e,t]),r=(0,O.useRef)(0),i=(0,O.useCallback)(a=>o.subscribe(()=>{r.current+=1,a()}),[o]);return(0,O.useSyncExternalStore)(i,()=>r.current,()=>0),o}var Dr=_n(()=>(__graviewPreload(import.meta.url,["./chunk.TI4OSTQV.js","./chunk.AJZBJBMO.js"]),import("./chunk.SHPXD6FC.js"))),ao;function bt(e,t,n){let o=(0,O.useContext)(Re),r=o!==null&&o.owns(e,t),[i,a]=(0,O.useState)(null),[d,s]=(0,O.useState)(ao);(0,O.useEffect)(()=>{if(d||r||i===null)return;let y=!0;return Dr().then(x=>{ao=x,y&&s(x)},()=>{}),()=>{y=!1}},[d,r,i]);let u=(0,O.useMemo)(()=>{if(r||i===null||i>=e.log.length||!d)return null;try{let y=d.pastAt(e,i,n);return{seq:i,at:y.past?.at,store:y}}catch{return null}},[r,e,i,n,d]),f=(0,O.useCallback)(y=>a(y===null?null:y>=e.log.length?Number.POSITIVE_INFINITY:y),[e]),S=(0,O.useCallback)((y,x)=>[e,u?.store].some(m=>m!==void 0&&(m===y||m.seenBy(x)===y)),[e,u]),p=i!==null,g=(0,O.useMemo)(()=>({past:u,open:p,show:f,live:e,host:n,owns:S}),[u,p,f,e,n,S]);return r?o:g}var fo=e=>`graview:setting:${e}`;function po(){return localStorage}function yo(e,t){try{let n=(t??po()).getItem(fo(e.name));if(n!==null&&e.options.some(o=>o.value===n))return n}catch{}return e.initial}function mo(e,t,n){try{(n??po()).setItem(fo(e.name),t)}catch{}}function go(e,t){if(typeof document>"u")return;let n=document.documentElement;if(e.honored==="root-font-size"){n.style.fontSize=t===e.initial?"":t;return}let o=`graview${e.name.replace(/-([a-z0-9])/g,(r,i)=>i.toUpperCase()).replace(/^[a-z]/,r=>r.toUpperCase())}`;t===e.initial?delete n.dataset[o]:n.dataset[o]=t}var I=L(j(),1);function xt(e){return He(e)}var Gr=12,Wr=4;function Fr(e,t,n){let o=xt(t);return e.get(o)??{participant:o,who:t.id??t.kind,at:null,mode:"docked",since:n,trail:[]}}var Ue=(e,t)=>t===null||e[e.length-1]===t?e:[...e,t].slice(-Gr);function ho(e,t){let n=e.filter(r=>r.length>0);if(n.length===0)return null;if(n.length<=Wr)return n[0];let o=new Set(n.map(r=>t(r)).filter(r=>r!==void 0));return o.size===1?dt([...o][0]):n[0]}function Et(e,t,n){let o=new Map(e);if(t.type==="rest"){for(let[a,d]of e)d.mode!=="asking"&&d.mode!=="docked"&&t.at-d.since>=t.holdMs&&o.set(a,{...d,mode:"docked",at:null,trail:[],say:void 0,confidence:void 0});return o}if(t.author.kind!=="agent")return o;let r=Fr(e,t.author,t.at),i=a=>o.set(r.participant,{...r,...a,since:t.at});switch(t.type){case"read":{let a=ho(t.ids,n);return i({at:a,mode:"reading",trail:Ue(r.trail,a)}),o}case"about-to-write":case"write":{let a=ho(t.ids,n);return i({at:a,mode:"writing",trail:Ue(r.trail,a),say:void 0,confidence:void 0}),o}case"refused":return i({at:t.where,mode:"refused",say:t.say,confidence:void 0,trail:Ue(r.trail,t.where)}),o;case"asking":return i({at:t.where??r.at,mode:"asking",say:t.say,...t.confidence!==void 0?{confidence:t.confidence}:{confidence:void 0},trail:Ue(r.trail,t.where)}),o;case"said":return i({say:t.say,...t.confidence!==void 0?{confidence:t.confidence}:{confidence:void 0},...t.caption?{caption:t.caption}:{}}),o;case"over":return i({over:t.over}),o;case"home":return i({at:null,mode:"docked",trail:[],say:void 0,confidence:void 0,over:null}),o;default:return o}}var So="graview:session";function wo(e){let t=()=>typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID().slice(0,8):Math.random().toString(36).slice(2,10);try{let n=e??sessionStorage,o=n.getItem(So);if(o)return o;let r=t();return n.setItem(So,r),r}catch{return t()}}var kt={name:"share-where",title:"Where you are",description:"Whether the others here see which stop you are on.",honored:"root-attribute",options:[{value:"shared",label:"Shown"},{value:"private",label:"Hidden"}],initial:"shared"},At={name:"share-over",title:"What you point at",description:"Whether the others see the thing under your pointer, outlined in your color.",honored:"root-attribute",options:[{value:"private",label:"Kept to yourself"},{value:"shared",label:"Outlined for others"}],initial:"private"},vo=[kt,At],Br=800;function bo(e){let{channel:t,store:n,view:o,principal:r,session:i,robots:a,seatWho:d,settingValues:s,setView:u,ttlMs:f=1e4,people:S,seats:p}=e,[g,y]=(0,I.useState)(()=>new Map),[x,m]=(0,I.useState)(null),[b,v]=(0,I.useState)(null),[E,M]=(0,I.useState)(null),F=typeof r.id=="string"&&r.id.length>0,C=F&&(s[kt.name]??kt.initial)==="shared",K=C&&(s[At.name]??At.initial)==="shared",H=xt({kind:r.kind,...r.id?{id:r.id}:{},session:i}),V=F?An(r,{graph:n.graph,schema:n.schema,...p?{seats:p}:{},...S?{people:S}:{}}):"",_=d?a.get(`agent:${d}:${i}`):void 0,N=(0,I.useMemo)(()=>!t||!C?null:{participant:H,kind:r.kind,name:V,...r.onBehalfOf?.id?{onBehalfOf:r.onBehalfOf.id,...r.onBehalfOf.name?{onBehalfOfName:r.onBehalfOf.name}:{}}:{},hue:Pn(r.id??"nobody"),stop:E??Z(o),...K?{over:x}:{},..._?{robot:{at:_.at,mode:_.mode}}:{},at:new Date().toISOString()},[t,C,K,H,V,r.id,r.kind,r.onBehalfOf?.id,r.onBehalfOf?.name,o,E,x,_?.at,_?.mode]);(0,I.useEffect)(()=>{if(!t||!N)return;t.here(N);let k=setInterval(()=>t.here({...N,at:new Date().toISOString()}),Br);return()=>clearInterval(k)},[t,N]),(0,I.useEffect)(()=>t?t.onWho(W=>y(st(new Map,W,Date.now(),f))):void 0,[t,f]);let Ie=g.size>0;(0,I.useEffect)(()=>{if(!Ie)return;let k=setInterval(()=>{y(W=>{let ne=st(W,[],Date.now(),f);return ne.size===W.size?W:ne})},Math.max(250,Math.min(1e3,f/4)));return()=>clearInterval(k)},[Ie,f]),(0,I.useEffect)(()=>{if(!t||typeof window>"u")return;let k=()=>t.leave();return window.addEventListener("pagehide",k),()=>window.removeEventListener("pagehide",k)},[t]),(0,I.useEffect)(()=>{if(!K||typeof document>"u")return;let k=null,W=ne=>{let T=io(ne.target);T!==k&&(k=T,m(T))};return document.addEventListener("pointermove",W,{passive:!0}),()=>document.removeEventListener("pointermove",W)},[K]);let te=(0,I.useRef)(null),Y=b?g.get(b)??null:null,Ce=(0,I.useCallback)(k=>{te.current=null,v(k)},[]);return(0,I.useEffect)(()=>{if(b){if(!Y){v(null);return}Y.stop!==te.current?.stop&&(te.current={stop:Y.stop,at:Date.now()},u(je(Y.stop)))}},[b,Y,u]),(0,I.useEffect)(()=>{let k=te.current;!b||k===null||Date.now()-k.at<400||Hn(o,je(k.stop))||v(null)},[o,b]),(0,I.useEffect)(()=>{if(!b||typeof document>"u")return;let k=W=>{W.key==="Escape"&&v(null)};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[b]),(0,I.useMemo)(()=>({who:g,sharing:N?{participant:H,name:V}:null,following:Y,follow:Ce,sayWhere:M}),[g,N,H,V,Y,Ce])}var z=L(j(),1);function xo(e){return He(e.author)}function $r(e,t){return e.length>1?"co-edited":t==="rule"?"rule":t==="agent"?"autonomous":"directed"}function Eo(e,t,n,o,r){let i=new Map;for(let[s,u]of e)o-u.at<r&&i.set(s,u);let a=new Set(n.flatMap(s=>s.nodeIds)),d=(s,u,f)=>{let S=i.get(s),p=S?.participants.includes(xo(u))?S.participants:[...S?.participants??[],xo(u)];i.set(s,{at:o,manner:$r(p,u.author.kind),intent:u.intent,wrote:(S?.wrote??!1)||(f.wrote??!1),read:(S?.read??!1)||(f.read??!1),broke:(S?.broke??!1)||a.has(s),participants:p})};for(let s of t){for(let u of s.writes)d(u,s,{wrote:!0});for(let u of s.reads)s.writes.includes(u)||d(u,s,{read:!0})}for(let s of n)for(let u of s.nodeIds){let f=i.get(u);i.set(u,{at:o,manner:f?.manner??"rule",intent:f?.intent??s.message,wrote:f?.wrote??!1,read:f?.read??!1,broke:!0,participants:f?.participants??["rule::"]})}return i}var qr=2600;function ko(e,t=qr){let[n,o]=(0,z.useState)(()=>new Map),r=(0,z.useRef)(n);r.current=n;let i=(0,z.useRef)(null),a=(0,z.useCallback)(s=>{r.current=s,o(s),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{r.current=new Map,o(new Map)},t)},[t]);(0,z.useEffect)(()=>{let s=e.violations(),u=e.subscribe((f,S)=>{let p=e.violations(),g=On(e.allInvariants(),s,p).introduces;s=p,a(Eo(r.current,S,g.map(y=>({nodeIds:y.nodeIds,message:y.message})),Date.now(),t))});return()=>{u(),i.current&&clearTimeout(i.current)}},[e,t,a]);let d=(0,z.useCallback)(s=>{s.reads.length!==0&&a(Eo(r.current,[zr(s)],[],Date.now(),t))},[t,a]);return{activity:n,noteAttention:d}}function zr(e){return{id:`attention:${e.intent}`,seq:-1,batch:"attention",author:e.author,intent:e.intent,mutation:null,primitives:[],inverse:[],reads:e.reads,writes:[],at:new Date().toISOString()}}var l=L(j(),1);function Ao(){let e=null,t=new Set,n=new Set,o=r=>{for(let i of n)i(r)};return{subscribe(r){return t.add(r),t.size===1&&o(!0),()=>{t.delete(r),t.size===0&&(e=null,o(!1))}},snapshot:()=>e,set(r){if(!(e===r||e&&r&&e.x===r.x&&e.y===r.y)){e=r;for(let i of t)i()}},get listeners(){return t.size},onActive(r){return n.add(r),()=>void n.delete(r)}}}var Ye=L(j(),1),Ur=e=>e.definitions.some(t=>En(t).size>0);function Po(e,t,n){let[o,r]=(0,Ye.useState)(void 0),i=(n.roles??[]).join("\0");return(0,Ye.useEffect)(()=>{if(!t||!Ur(e.schema)){r(void 0);return}let a=!0,d=!1,s=e.graph,u=()=>{d||(d=!0,queueMicrotask(()=>{d=!1,a&&e.reread()}))},f=kn(t,{kind:n.kind,...n.id===void 0?{}:{id:n.id},...n.roles?{roles:n.roles}:{}},u);return at(s,f.read),r(f),e.reread(),()=>{a=!1,at(s,void 0)}},[e,t,n.kind,n.id,i]),o}function Ro(){let e=!1,t=new Set;return{moving:()=>e,set(n){if(n!==e){e=n;for(let o of t)o()}},subscribe(n){return t.add(n),()=>t.delete(n)}}}var se=L(Te(),1),Me=(0,l.createContext)(null),Io=(0,l.createContext)("scene");function Yr({mode:e,children:t}){return(0,se.jsx)(Io.Provider,{value:e,children:t})}function Xr(){return(0,l.useContext)(Io)}var Co={kind:"human"},Jr=[],Zr=[],Qr=[],Pt=[];function Vo(e,t){let n=(0,l.useId)();(0,l.useEffect)(()=>{if(!globalThis.__graviewWatch)return;let o=t??Co,r=()=>Mn(e,o,n);r();let i,a=e.subscribe(()=>{clearTimeout(i),i=setTimeout(r,250)});return()=>{clearTimeout(i),a(),globalThis.__graviewWatch?.unseen?.({words:[],from:n,gone:!0})}},[e,t,n])}var ei={off:!0};function ti({store:e,views:t,initialView:n,scheme:o="dark",initialSelection:r,principal:i,seats:a=Jr,onSeat:d,people:s=Zr,memory:u,presenceTtlMs:f,app:S,settings:p=S?.settings??Qr,presence:g,brand:y,locale:x,onKeepLens:m,providers:b,ai:v,files:E,resolveApp:M,history:F,linkedRecords:C,menuSections:K,subscriptions:H,view:V,onViewChange:_,children:N}){let Ie=(0,l.useContext)(Me),te=K??Ie?.menuSections,[Y,Ce]=(0,l.useState)(null),k=Y??i??a[0]?.principal??Co,W=bt(e,k,F),ne=W.past&&W.live===e?W.past.store:e,T=(0,l.useMemo)(()=>ne.seenBy(k),[ne,k]);Vo(e,k);let[oe]=(0,l.useState)(()=>wo(u)),[Wt,Yo]=(0,l.useState)(!1),Ft=(0,l.useCallback)(()=>Yo(!0),[]),re=(0,l.useMemo)(()=>g?[...p,...vo]:p,[p,g]),[et]=(0,l.useState)(()=>n??Ot(t,e.schema)),[Xo,Kt]=(0,l.useState)(()=>Ge(et??de,r??et?.selection??[])),we=(0,l.useRef)(et??de).current,[Bt,Jo]=(0,l.useState)(null),[$t,Zo]=(0,l.useState)(null),X=(0,l.useContext)(Me),[qt]=(0,l.useState)(()=>X?.seatTalk??wt(y?.name??e.schema.kinds.join(","))),tt=v??X?.ai??ct,Ve=(0,l.useMemo)(()=>tt.off?ei:tt,[tt]),zt=(0,l.useRef)(Ve.interactions);zt.current=Ve.interactions;let[Ut]=(0,l.useState)(()=>X?.aiDesk??vt(()=>zt.current)),[Qo]=(0,l.useState)(()=>X?.subscriptions??Tn()),Yt=H??X?.subscriptions??Qo,nt=m??X?.onKeepLens,ot=S??X?.app,_e=x??X?.locale,er=y?.locale??ot?.brand?.locale;xn({reader:_e,app:er});let Xt=(0,l.useRef)(null),Jt=(0,l.useCallback)(c=>{Xt.current=c},[]),Zt=(0,l.useCallback)(c=>Xt.current?.whereIs(c)??null,[]),[Qt]=(0,l.useState)(()=>Ao()),[en]=(0,l.useState)(()=>Ro()),[rt,tr]=(0,l.useState)(null),[ve,tn]=(0,l.useState)(()=>new Map),be=(0,l.useRef)(ve);be.current=ve;let xe=(0,l.useRef)(null),it=(0,l.useCallback)(c=>T.graph.getNode(c)?.kind,[T]),J=(0,l.useCallback)(c=>{let h=Et(be.current,c,it);be.current=h,tn(h),xe.current&&clearTimeout(xe.current),[...h.values()].some(P=>P.mode!=="docked"&&P.mode!=="asking")&&(xe.current=setTimeout(()=>{let P=Et(be.current,{type:"rest",at:Date.now(),holdMs:Mt},it);be.current=P,tn(P)},Mt+20))},[it]),nn=(0,l.useCallback)(c=>J({...c,at:c.at??Date.now()}),[J]),on=(0,l.useCallback)(c=>{tr(c),c&&J({type:"home",author:{kind:"agent",id:c,session:oe},at:Date.now()})},[J,oe]);(0,l.useEffect)(()=>T.subscribe((c,h)=>{for(let A of h)A.author.kind==="agent"&&J({type:"write",author:A.author,ids:A.writes,at:Date.now()})}),[T,J]),(0,l.useEffect)(()=>()=>{xe.current&&clearTimeout(xe.current)},[]);let q=(0,l.useMemo)(()=>({...k,session:oe}),[k,oe]),rn=Po(T,C,q),an=(0,l.useCallback)(c=>{Ce(c),d?.(c)},[d]),[Ee,nr]=(0,l.useState)(()=>Object.fromEntries(re.map(c=>[c.name,yo(c,u)])));(0,l.useEffect)(()=>{for(let c of re)go(c,Ee[c.name]??c.initial)},[re,Ee]);let sn=(0,l.useCallback)((c,h)=>{let A=re.find(P=>P.name===c);!A||!A.options.some(P=>P.value===h)||(mo(A,h,u),nr(P=>({...P,[c]:h})))},[re,u]),[ln,or]=(0,l.useState)(null),{activity:dn,noteAttention:un}=ko(T),cn=(0,l.useCallback)(c=>{un(c),J({type:"read",author:c.author,ids:c.reads,at:Date.now()})},[un,J]),le=(0,l.useCallback)(c=>{if(ce(c)!==null||ae(c).length>0||ut(c))return!0;let h=Dn(c);return h?T.graph.allEdges().some(A=>A.kind===h.kind&&A.from===h.from&&A.to===h.to):T.graph.getNode(c)!==void 0},[T]),fn=(0,l.useCallback)(c=>{let h=c.selection??Pt,A=h.filter(le),P=A.length===h.length?c:Ge(c,A);return P.focusId!==null&&!le(P.focusId)&&(P=$(P,null)),P},[le]),ke=(0,l.useCallback)(c=>{let h=fn(c),A=Oo(T,q,h.shown);if(h.focusId!==null&&A.size>0){let P=ae(h.focusId),bn=T.graph.getNode(h.focusId);(P.length>0?P.every(ar=>A.has(ar)):bn?A.has(bn.kind):!1)&&(h={...h,focusId:null})}if(!h.overview&&h.focusId===null){let P=we.focusId!==null&&!le(we.focusId)?Ot(t,e.schema)??{...de,overview:!0}:we;P.focusId!==null&&le(P.focusId)?h={...h,focusId:P.focusId}:P.overview===!0&&(h={...h,overview:!0})}return h},[fn,le,T,we,q,t,e.schema]),B=ke(V??Xo),pn=(0,l.useMemo)(()=>Oo(T,q,B.shown),[T,q,B.shown]),yn=(0,l.useMemo)(()=>[...T.modules.administered.entries()].map(([c,h])=>{let A=T.mayAdminister(c,q);return{name:c,...h.description?{description:h.description}:{},kinds:h.kinds??[],canShow:A,shown:A&&(B.shown??[]).includes(c)}}),[T,q,B.shown]),Ae=(0,l.useCallback)(c=>{let h=A=>ke(typeof c=="function"?c(A):c);if(V!==void 0){_?.(h(V));return}_&&_(h(B)),Kt(A=>h(A))},[B,_,V,ke]);(0,l.useEffect)(()=>{V===void 0&&Kt(c=>{let h=ke(c);return h===c?c:h})},[B,V,ke]);let mn=B.selection??Pt,gn=(0,l.useCallback)(c=>{Ae(h=>Ge(h,typeof c=="function"?c(h.selection??Pt):c))},[Ae]),{who:hn,following:Sn,follow:wn,sayWhere:rr,sharing:vn}=bo({channel:g,store:T,view:B,principal:q,session:oe,robots:ve,seatWho:rt,settingValues:Ee,setView:Ae,seats:a,people:s,...f!==void 0?{ttlMs:f}:{}}),ir=(0,l.useMemo)(()=>({store:T,scheme:o,views:t,view:B,setView:Ae,homeView:we,selection:mn,setSelection:gn,menuAt:Bt,setMenuAt:Jo,whereIs:Zt,pointer:Qt,motion:en,registerScene:Jt,robots:ve,noteSeat:nn,seatWho:rt,registerSeatWho:on,actsDoor:$t,registerActsDoor:Zo,seatTalk:qt,aiDesk:Ut,...u?{memory:u}:{},who:hn,following:Sn,follow:wn,sayWhere:rr,sharing:vn,session:oe,ai:Ve,resolveApp:M,linkedRecords:C,menuSections:te,subscriptions:Yt,linkedReads:rn,movedByHand:Wt,noteMoved:Ft,emphasis:ln,setEmphasis:or,activity:dn,noteAttention:cn,principal:q,seats:a,people:s,takeSeat:an,settings:re,settingValues:Ee,chooseSetting:sn,hiddenKinds:pn,administered:yn,...b?{providers:b}:{},...y?{brand:y}:{},...nt?{onKeepLens:nt}:{},app:ot,..._e?{locale:_e}:{}}),[T,o,t,B,Ae,mn,gn,Bt,Zt,Qt,en,Jt,ve,nn,rt,on,$t,qt,Ut,u,hn,Sn,wn,vn,oe,Ve,M,C,te,Yt,rn,Wt,Ft,ln,dn,cn,q,a,s,an,re,Ee,sn,pn,yn,b,y,nt,ot,_e]);return(0,se.jsx)(Me.Provider,{value:ir,children:(0,se.jsx)(Re.Provider,{value:W,children:(0,se.jsx)(ai,{children:E?(0,se.jsx)(qe.Provider,{value:E,children:N}):N})})})}var _o=(0,l.createContext)(null),Rt,Tt=new Set,ni=e=>(Tt.add(e),()=>void Tt.delete(e)),To=()=>Rt;function oi(e){if(!Rt){Rt=e;for(let t of[...Tt])t()}}var ri=300;function ii(e){let t=0;return async(n,o)=>{let r=++t;return await new Promise(i=>setTimeout(i,ri)),r===t?e(n,o):[]}}function ai({children:e}){let{store:t,view:n,views:o,principal:r,hiddenKinds:i,selection:a,ai:d}=ee(),s=Xe(),u=n.q,f=n.focusId,S=!!(u&&u.trim().length>0),p=(0,l.useSyncExternalStore)(ni,To,To),g=(0,l.useMemo)(()=>S&&p?{flagged:new Set(t.violations().flatMap(E=>E.nodeIds)),touched:p.touchWeights(t.log.all())}:null,[t,s,S,p]),y=f?t.graph.getNode(f)?.kind??ce(f)??(ae(f).length===1?ae(f)[0]:void 0):void 0,x=(0,l.useMemo)(()=>d.near&&ii(d.near),[d.near]),m=(0,l.useMemo)(()=>!u||!g||!p?null:p.search(t,u,{...y?{inKind:y}:{},principal:r,places:o.places(),kinds:t.schema.kinds.filter(E=>!i.has(E)),from:[...a,...f&&t.graph.has(f)?[f]:[]],flagged:g.flagged,touched:g.touched,limit:200,rank:x}),[t,u,r,o,i,a,f,y,g,x]),[b,v]=(0,l.useState)();return(0,l.useEffect)(()=>void m?.later?.then(E=>v([m,E])),[m]),(0,se.jsx)(_o.Provider,{value:b?.[0]===m?b[1]:m,children:e})}var Mo=new WeakMap;function ja(e){let t=Mo.get(e);return t||Mo.set(e,t=new Set(e.matched)),t}function si(){return(0,l.useContext)(_o)}function ee(){let e=(0,l.useContext)(Me);if(!e)throw new Error("useGraview must be used inside a <GraviewProvider>.");return e}function It(){return(0,l.useContext)(Me)??null}function Xe(){let{store:e}=ee(),t=(0,l.useRef)(null),n=(0,l.useRef)(null),o=(0,l.useCallback)(()=>(n.current!==e&&(n.current=e,t.current=null),t.current??=e.graph.allNodes(),t.current),[e]),r=(0,l.useCallback)(i=>e.subscribe(()=>{t.current=null,i()}),[e]);return(0,l.useSyncExternalStore)(r,o,o)}function li(e){let{store:t}=ee(),n=(0,l.useCallback)(r=>t.subscribe(r),[t]),o=(0,l.useCallback)(()=>e===null?void 0:t.graph.getNode(e),[t,e]);return(0,l.useSyncExternalStore)(n,o,o)}function Oo(e,t,n){let o=new Set(e.modules.disabledKinds);for(let r of e.kindsKeptFrom(t))o.add(r);for(let[r,i]of e.modules.administered)if(!(e.mayAdminister(r,t)&&(n??[]).includes(r)))for(let a of i.kinds??[])o.add(a);return o}var Mt=2600;var Lo=new WeakSet,di=e=>Lo.has(e),ui=e=>void Lo.add(e);function Ot(e,t){let n=Cn(e.arrangement?.()?.first,t,e.places());if(!(!n||n.to==="home"))return n.to==="place"?{...de,focusId:Q(n.place.kind),within:{view:n.place.as}}:{...de,focusId:Q(n.kind)}}var Ho=L(j(),1),ci=(0,Ho.createContext)(!1);var Je=Symbol.for("graview.default-view");function Do(e){return Object.defineProperty(e,Je,{value:!0,enumerable:!1}),e}function No(e){return typeof e=="function"&&e[Je]===!0}var Ct=Symbol.for("graview.replaces-page");function jo(e){return typeof e=="function"&&e[Ct]===!0}function pi(e){return In(e)}function yi(e,t){if(t===e)return e;for(let r of t.registrations())e.register(r.kind,r,r.view,r);let n=t.arrangement?.();n&&e.arrange?.(n);let o=t.homeView?.();return o&&e.home?.(o),e}var me=L(j(),1);function mi(){let{selection:e,setSelection:t}=ee();return(0,me.useMemo)(()=>({selection:e,set:n=>t(n),clear:()=>t([]),toggle:n=>t(o=>o.includes(n)?o.filter(r=>r!==n):[...o,n]),isSelected:n=>e.includes(n)}),[e,t])}function gi(){let{store:e}=ee(),t=Xe();return(0,me.useMemo)(()=>hi(e),[e,t])}var Go=new WeakMap;function hi(e){let t=Go.get(e);if(!t){let n={violations:null};e.subscribe(()=>{n.violations=null}),Go.set(e,n),t=n}return t.violations??=e.violations(),t.violations}function Si(){let{view:e,setView:t}=ee();return(0,me.useMemo)(()=>({view:e,url:Z(e),focus:n=>t(o=>$(o,n)),show:n=>t(o=>Nn(o,n)),toggle:n=>t(o=>We(o,n)),go:n=>t(n)}),[e,t])}var ye={at:0,depth:0,listeners:new Set,tell(){for(let e of this.listeners)e()}};typeof window<"u"&&window.addEventListener("popstate",e=>{let t=e.state;ye.at=typeof t?.graview=="number"?t.graview:0,ye.at>ye.depth&&(ye.depth=ye.at),ye.tell()});var D=L(j(),1),_t={profile:{trigger:"profile-button",pane:"profile",opens:"press",focus:"into",drawn:["shell","embed"]},problems:{trigger:"standing",pane:"problems",opens:"press",focus:"into",drawn:["shell","embed"]},places:{trigger:"app-places-open",pane:"app-places",opens:"press",focus:"into",drawn:["embed"]},here:{trigger:"here-open",pane:"here-list",opens:"press",focus:"into",drawn:["shell","embed","pages"]},suggested:{trigger:"suggested-button",pane:"suggested",opens:"press",focus:"into",drawn:["shell","embed","pages"]},activity:{trigger:"activity-button",pane:"activity",opens:"press",focus:"into",drawn:["shell","embed","pages"]},find:{trigger:"find-box",pane:"find-strip",opens:"typing",focus:"stays",drawn:["shell"]},districts:{trigger:"beyond-more",pane:"beyond-list",opens:"press",focus:"into",drawn:["shell","embed"]},acts:{trigger:null,pane:"context-menu",opens:"context-menu",focus:"into",drawn:["shell","embed","pages"]},arrange:{trigger:"arrange-add",pane:"arrange-list",opens:"press",focus:"into",drawn:["pages"]},"studio-ask":{trigger:"studio-agent",pane:"studio-agent-panel",opens:"press",focus:"into",drawn:["studio"]}},wi={position:"fixed",inset:"auto",margin:0,zIndex:Rn("popover"),boxSizing:"border-box"},Ze=6,ge=8,vi=e=>typeof e.showPopover=="function";function Qe(e){try{return e.matches(":popover-open")}catch{return!1}}function bi(e){if(typeof e=="function"){let o=e();return o?{left:o.x,right:o.x,top:o.y,bottom:o.y}:null}let t=e.current;if(!t||!t.isConnected)return null;let n=t.getBoundingClientRect();return{left:n.left,right:n.right,top:n.top,bottom:n.bottom}}function Lt(e,t,n={}){let o=bi(t);if(!o)return;let r={width:document.documentElement.clientWidth||innerWidth,height:innerHeight},i=e.dataset.graviewDesignedHeight??=e.style.maxHeight;e.style.maxHeight=i;let a=e.getBoundingClientRect(),d=r.height-o.bottom-Ze-ge,s=o.top-Ze-ge,u=a.height<=d||d>=s,f=Math.max(96,Math.floor(u?d:s)),S=Math.min(a.height,f);a.height>f&&(e.style.maxHeight=i?`min(${i}, ${f}px)`:`${f}px`);let p=a.width,g=n.align==="start"?o.left:o.right-p,y=typeof t=="function"?null:t.current?.closest("[data-graview-embed]")?.getBoundingClientRect();y&&p<=y.right-y.left&&(g<y.left?g=o.left+p<=y.right?o.left:y.left:g+p>y.right&&(g=o.right-p>=y.left?o.right-p:y.right-p));let x=p>=r.width-2*ge?Math.max(0,(r.width-p)/2):Math.max(ge,Math.min(g,r.width-ge-p)),m=u?o.bottom+Ze:Math.max(ge,o.top-Ze-S);e.style.left=`${Math.round(x)}px`,e.style.top=`${Math.round(m)}px`}function Wo(e,t,n,o={}){let r=o.align??"end";(0,D.useLayoutEffect)(()=>{let i=e.current;if(!t||!i)return;if(vi(i)&&!Qe(i))try{i.showPopover(),Ei()}catch{}let a=0,d=u=>{u?.target instanceof Node&&i.contains(u.target)||(cancelAnimationFrame(a),a=requestAnimationFrame(()=>Lt(i,n,{align:r})))};Lt(i,n,{align:r}),addEventListener("resize",d),addEventListener("scroll",d,!0);let s=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>d());return s?.observe(i),()=>{if(cancelAnimationFrame(a),removeEventListener("resize",d),removeEventListener("scroll",d,!0),s?.disconnect(),i.isConnected&&Qe(i))try{i.hidePopover()}catch{}}},[t,e,r])}var Ht=new Set;function xi(e){return Ht.add(e),()=>Ht.delete(e)}function Ei(){for(let e of Ht)if(!(!e.isConnected||!Qe(e)))try{e.hidePopover(),e.showPopover()}catch{}}var he=null,ki='button:not([disabled]), [href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])';function Ai(e){for(let t of e.querySelectorAll(ki))if(t.closest("[hidden]")===null&&getComputedStyle(t).visibility!=="hidden")return t;return e}var Vt=()=>{let e=document.activeElement;return e===null||e===document.body};function Pi(e,t={}){let{at:n,returnTo:o,onOpenChange:r}=t,i=t.popover!==!1,[a,d]=(0,D.useState)(!1),s=t.open??a,u=(0,D.useRef)(null),f=(0,D.useRef)(null),S=(0,D.useCallback)(v=>{u.current=v},[]),p=(0,D.useCallback)(v=>{f.current=v},[]),g=`graview-popover-${(0,D.useId)().replace(/:/g,"")}`,y=(0,D.useRef)({onOpenChange:r,returnTo:o,controlled:t.open!==void 0});y.current={onOpenChange:r,returnTo:o,controlled:t.open!==void 0};let x=(0,D.useCallback)(v=>{y.current.controlled||d(v),y.current.onOpenChange?.(v)},[]),m=(0,D.useCallback)(()=>{(document.querySelector(`[aria-controls="${g}"]`)??u.current??y.current.returnTo?.()??null)?.focus({preventScroll:!0})},[g]),b=(0,D.useCallback)(v=>{let E=f.current,M=typeof document>"u"?null:document.activeElement,F=M===null||M===document.body||E!==null&&E.contains(M);x(!1),!(!v||!F)&&(m(),requestAnimationFrame(()=>{Vt()&&m()}))},[x,m]);return Wo(f,i&&s,n??u,t.align?{align:t.align}:{}),(0,D.useEffect)(()=>{if(!i||!s)return;let v={name:e,close:()=>b(!1)};if(he&&he.close!==v.close&&he.close(),he=v,_t[e].focus==="into"){let H=f.current;H&&!H.contains(document.activeElement)&&Ai(H).focus({preventScroll:!0})}let E=H=>{H.key==="Escape"&&b(!0)},M=H=>{let V=H.target;if(!(V instanceof Node))return;let _=f.current;if(_?.contains(V)||u.current?.contains(V))return;let N=V instanceof Element?V.closest('[role="dialog"], [role="alertdialog"]'):null;N&&!(_&&N.contains(_))||(b(!1),_t[e].focus==="into"&&requestAnimationFrame(()=>{(Vt()||_!==null&&_.contains(document.activeElement))&&m()}))},F=null,C=null,K=H=>{let V=H.target;if(!(V instanceof Element))return;let _=f.current,N=V.closest('[role="dialog"], [role="alertdialog"]');!N||_&&(_.contains(N)||N.contains(_))||(F=N,b(!1))};return document.addEventListener("keydown",E),document.addEventListener("pointerdown",M,!0),document.addEventListener("focusin",K),()=>{document.removeEventListener("keydown",E),document.removeEventListener("pointerdown",M,!0),document.removeEventListener("focusin",K);let H=F;H&&typeof MutationObserver<"u"&&(C?.disconnect(),C=new MutationObserver(()=>{H.isConnected||(C?.disconnect(),requestAnimationFrame(()=>{(Vt()||document.activeElement.closest("[hidden]")!==null)&&m()}))}),C.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>C?.disconnect(),10*6e4)),he?.close===v.close&&(he=null)}},[i,s,e,b,m]),{open:s,setOpen:v=>v?x(!0):b(!0),toggle:()=>s?b(!0):x(!0),trigger:{ref:S,"aria-expanded":s,"aria-controls":g,"data-graview-popover-trigger":e},pane:{ref:p,id:g,popover:"manual",tabIndex:-1,"data-graview-popover":e,"data-graview-overlay":""}}}var G=L(j(),1),U=L(Te(),1),Dt=new Set,Fo=!1;function Nt(){for(let e of[...Dt])e()}function Ri(){Fo||typeof window>"u"||(Fo=!0,window.addEventListener("online",Nt))}function Ti(e){let t,n=!1,o=!1,r,i=0,a=new Set,d=()=>{i+=1;for(let p of[...a])p()},s=p=>(a.add(p),()=>void a.delete(p)),u=()=>i,f=()=>void S().catch(()=>{});function S(){if(n)return Promise.resolve(t);if(r)return r;let p=e().then(g=>(t=g,n=!0,o=!1,r=void 0,Dt.delete(f),d(),g),g=>{throw r=void 0,o=!0,Dt.add(f),Ri(),d(),g});return p.catch(()=>{}),r=p,p}return{load:S,prefetch:f,get current(){return t},get failed(){return o},part(p,g={}){let y=g.what??"This part";function x(v){(0,G.useSyncExternalStore)(s,u,u);let E=(0,G.useRef)(null),M=(0,G.useRef)(null),F=(0,G.useRef)(!1);return(0,G.useEffect)(()=>{o&&r===void 0&&f()},[]),n&&typeof document<"u"&&E.current!==null&&document.activeElement===E.current&&(F.current=!0),(0,G.useLayoutEffect)(()=>{if(!(!n||!F.current)){F.current=!1;for(let C=M.current?.nextElementSibling??null;C!==null;C=C.nextElementSibling){let K=C.matches(Ko)?C:C.querySelector(Ko);if(K instanceof HTMLElement){K.focus();return}}}}),n?(0,U.jsxs)(U.Fragment,{children:[F.current?(0,U.jsx)("span",{ref:M,hidden:!0}):null,p(t,v)]}):g.quiet?null:(0,U.jsx)(Mi,{what:y,button:E,...g.as?{as:g.as}:{}})}let m=(0,G.lazy)(()=>S().then(()=>({default:x}),()=>({default:x})));function b(v){let[E]=(0,G.useState)(()=>n||o);return(0,G.createElement)(E?x:m,v)}return b}}}var Ko="button,a[href],input,select,textarea,[tabindex]:not([tabindex='-1'])";function Mi({what:e,button:t,as:n="p"}){let r=typeof navigator<"u"&&navigator.onLine===!1?`${e} will load when you're back online.`:`${e} didn't load.`;return(0,U.jsxs)(n,{"data-testid":"lazy-part-missing",style:{margin:0,fontSize:"0.875rem",color:"var(--graview-ink-muted)"},children:[(0,U.jsx)("span",{role:"status",children:r})," ",(0,U.jsx)("button",{ref:t,type:"button","data-testid":"lazy-part-retry",onClick:Nt,style:{font:"inherit",fontWeight:600,color:"var(--graview-ink)",background:"none",border:"1px solid var(--graview-edge)",borderRadius:6,padding:"2px 10px"},children:"Try again"})]})}var Se=L(j(),1);var Bo=(0,Se.createContext)(null);function Oi(){let e=(0,Se.useContext)(Bo),t=It(),n=(o,r,i)=>t?.setView(a=>ie(ie(ue($(a,Q(o)),!1),"view",r),"filter",i?.filter??null));return(0,Se.useMemo)(()=>e??{record:o=>{t&&(t.setView(r=>$(ue(r,!1),o)),t.setSelection([o]))},place:(o,r)=>{let i=t?.views.places().find(a=>a.as===o);i&&n(i.kind,i.as,r)},list:(o,r)=>n(o,null,r)},[e,t])}var $o=L(j(),1),Ii=(0,$o.createContext)(!1);var qo=L(j(),1),Ci=(0,qo.createContext)(null);var zo=L(j(),1),jt='button:not([disabled]), a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])',Gt=e=>e instanceof HTMLElement&&(e.matches(jt)||e.hasAttribute("tabindex")),Oe=e=>typeof e.checkVisibility=="function"?e.checkVisibility():e.getClientRects().length>0;function Vi(e,t){let n=s=>s.replace(/["\\]/g,"\\$&"),o=t.getAttribute("data-testid"),r=t.getAttribute("data-graview-pick"),i=t.getAttribute("aria-label"),a=o?`[data-testid="${n(o)}"]`:r?`[data-graview-pick="${n(r)}"]`:i?`${t.tagName.toLowerCase()}[aria-label="${n(i)}"]`:null;if(!a)return null;let d=e.querySelector(a);return d&&Gt(d)&&Oe(d)?d:null}var _i=e=>e.isConnected&&Gt(e)&&!e.matches(":disabled")&&e instanceof HTMLElement&&Oe(e);function Uo(e,t){let n=t?Vi(e,t):null;if(n)return n;let o=e.querySelector("[data-graview-view][tabindex]");if(o&&Oe(o))return o;for(let r of e.querySelectorAll(jt))if(Oe(r))return r;return Gt(e)&&Oe(e)?e:null}function Li(e){(0,zo.useEffect)(()=>{let t=e.current;if(!t||typeof MutationObserver>"u")return;let n=[],o=m=>{let b=m.target;if(b instanceof Element){n=[];for(let v=b;v&&v!==t.parentElement;v=v.parentElement)n.push(v)}},r=!1,i=!1,a=t.ownerDocument,d=()=>!i&&a.defaultView!==null,s=(m,b)=>void setTimeout(()=>d()&&b(),m),u=m=>void requestAnimationFrame(()=>d()&&m()),f=m=>{if(r=!1,i)return;let b=a.activeElement;if(!(!(b===null||b===a.body||b===a.documentElement)||n.length===0)){if(_i(n[0])){m&&n[0]instanceof HTMLElement&&n[0].focus({preventScroll:!0});return}for(let E of n.slice(1)){if(!E.isConnected)continue;let M=Uo(E,n[0]);if(M){M.focus({preventScroll:!0}),n=[];return}}}},S=(m,b=Date.now()+2500)=>{s(100,()=>{f(m);let v=a.activeElement;(v===null||v===a.body||v===a.documentElement)&&n.length>0&&Date.now()<b&&S(m,b)})},p=()=>{r||n.length===0||(r=!0,s(60,()=>u(()=>{f(!1),S(!1)})))},g=m=>{if(!(m instanceof KeyboardEvent&&!["Enter"," ","Escape"].includes(m.key))){if(!(m instanceof KeyboardEvent)){let b=m.target instanceof Element?m.target.closest(jt):null,v=a.activeElement,E=v===null||v===a.body||v===a.documentElement;if(b&&E&&t.contains(b)){n=[];for(let M=b;M&&M!==t.parentElement;M=M.parentElement)n.push(M);s(150,()=>u(()=>{f(!1),S(!1)}));return}}!(m instanceof KeyboardEvent)&&!(m.target instanceof Node&&n[0]?.contains(m.target))||s(150,()=>u(()=>{f(!0),S(!0)}))}},y=new MutationObserver(()=>{n.length>0&&!n[0].isConnected&&p()}),x=m=>{m.relatedTarget===null&&p()};return t.addEventListener("focusin",o),t.addEventListener("focusout",x),t.addEventListener("click",g),t.addEventListener("keydown",g),y.observe(t,{childList:!0,subtree:!0}),()=>{i=!0,t.removeEventListener("focusin",o),t.removeEventListener("focusout",x),t.removeEventListener("click",g),t.removeEventListener("keydown",g),y.disconnect()}},[e])}export{_n as a,de as b,Z as c,je as d,Ni as e,ji as f,Hn as g,Ln as h,Dn as i,lt as j,$ as k,Nn as l,ie as m,ue as n,Ge as o,Pe as p,We as q,Ke as r,dt as s,ce as t,Fi as u,ur as v,Q as w,jn as x,ae as y,Gn as z,cr as A,Ki as B,Wn as C,ut as D,fr as E,j as F,wt as G,Cr as H,_r as I,io as J,qe as K,Lr as L,Re as M,so as N,Hr as O,bt as P,Te as Q,Yr as R,Xr as S,Vo as T,ti as U,oi as V,ja as W,si as X,ee as Y,It as Z,Xe as _,li as $,di as aa,ui as ba,Ot as ca,Bo as da,Oi as ea,ci as fa,Do as ga,No as ha,jo as ia,pi as ja,yi as ka,Ii as la,Ci as ma,mi as na,gi as oa,Si as pa,ye as qa,Li as ra,wi as sa,Qe as ta,Wo as ua,xi as va,Pi as wa,Ti as xa};
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
react/cjs/react.production.js:
|
|
5
|
+
(**
|
|
6
|
+
* @license React
|
|
7
|
+
* react.production.js
|
|
8
|
+
*
|
|
9
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the MIT license found in the
|
|
12
|
+
* LICENSE file in the root directory of this source tree.
|
|
13
|
+
*)
|
|
14
|
+
|
|
15
|
+
react/cjs/react-jsx-runtime.production.js:
|
|
16
|
+
(**
|
|
17
|
+
* @license React
|
|
18
|
+
* react-jsx-runtime.production.js
|
|
19
|
+
*
|
|
20
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
21
|
+
*
|
|
22
|
+
* This source code is licensed under the MIT license found in the
|
|
23
|
+
* LICENSE file in the root directory of this source tree.
|
|
24
|
+
*)
|
|
25
|
+
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as h,
|
|
1
|
+
import{F as h,X as d,Y as a,_ as c,oa as u}from"./chunk.6QWV5MVH.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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as ee,b as E,d as oe,g as se,h as re,i as ie}from"./chunk.UGFJKSHU.js";import{Ba as T,E as I,F as w,Fa as Q,H as P,Ha as V,Ja as X,K as b,L as K,M as Y,P as v,R as H,X as $,ca as U,ea as B,ia as G,ma as Z,qb as ne,ra as q,sb as te,ta as J}from"./chunk.MNP4JI33.js";var ce=t=>`${t}${t%100>=11&&t%100<=13?"th":["th","st","nd","rd"][t%10]??"th"}`,fe={day:"day",week:"week",month:"month",year:"year"},R=t=>t.length<2?t[0]??"":`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`;function ye(t,e,n){let o=e.interval??1,i=fe[e.every],a=t.slice(0,10),c=o===1?`Every ${i}`:o===2?`Every other ${i}`:`Every ${o} ${i}s`,d;if(e.every==="week"){let f=(e.on?.length?e.on:[T[new Date(`${a}T00:00:00Z`).getUTCDay()]]).map(l=>H(T.indexOf(l),"long",n));d=o===1?`Every ${R(f)}`:o===2?`Every other ${R(f)}`:`${c} on ${R(f)}`}else if(e.every==="month"){let f=(e.on?.length?e.on:[+a.slice(8,10)]).map(l=>l===-1?"the last day":`the ${ce(Number(l))}`);d=`${c} on ${R(f)}`}else e.every==="year"?d=`${c} on ${v(a,n)}`:d=c;return w.test(t)&&(d+=` at ${Y(t,n)}`),e.until&&(d+=`, until ${b(e.until,n)}`),e.count&&(d+=`, ${e.count===1?"once":`${e.count} times`}`),d}function de(t,e,n={}){if(!V(e)||typeof t!="string")return;let o=n.today??P(),i=X(t,e,o),a=ye(t,e,n.locale),c=i.slice(0,4)===o.slice(0,4)?v(i.slice(0,10),n.locale):b(i.slice(0,10),n.locale);return i.slice(0,10)<o?`${a}, last ${c}`:`${a}, next ${c}`}function Pe(t,e){let n=new Map,o=new Map;for(let i of t){let a=$(e(i.kind),i).trim().toLowerCase();o.set(a,[...o.get(a)??[],i])}for(let i of o.values()){if(i.length<2)continue;let a=new Map;for(let c of i)a.set(c.kind,[...a.get(c.kind)??[],c]);for(let[c,d]of a){if(d.length===1){n.set(d[0].id,B(e(c),c));continue}let f=d.map(y=>new Map(pe(y,e(y.kind)).map(r=>[r.key,r.alone]))),l=[...new Set(f.flatMap(y=>[...y.keys()]))],p=y=>f.every(r=>!/\d/.test(r.get(y)??"")),A=[...l.filter(p),...l.filter(y=>!p(y))].find(y=>new Set(f.map(r=>r.get(y)??"")).size===d.length);d.forEach((y,r)=>{let s=A?f[r].get(A):void 0;n.set(y.id,s??y.id)})}}return n}function Ke(t,e){return t?.describe?t.describe(e):`${e.kind} ${$(t,e)}`}var ue=new Set(["id","kind","label"]);function ge(t,e){if(e.length===0)return!1;let n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`(^|[\\s\xB7,(/])${n}($|[\\s\xB7,)/])`).test(t)}function pe(t,e,n={}){let o=e?.display,i=new Set([...ue,...o?.hide??[]]);typeof t.label=="string"&&e?.label&&!$(e,t).includes(t.label)&&i.delete("label");let a=(n.said??[]).filter(r=>!!r),c=a.filter(r=>r.endsWith("\u2026")).map(r=>r.replace(/…$/,"").trim()).filter(r=>r.length>12),d=[],f=e?.fields?.shape,l=e?.fieldRoles,p=n.glance?o?.glance??[l?.who,l?.when].filter(r=>!!r):ae(o?.page),M=n.glance&&o?.glance!==void 0,y=[...new Set(M?p:[...p,...be(e),...Object.keys(t)])].filter(r=>Object.hasOwn(t,r)).map(r=>[r,t[r]]);for(let[r,s]of y){if(i.has(r)||s===void 0||s===null)continue;let u=o?.format?.[r],k=u?[]:G(s);if(k[0]&&n.glance)continue;let O=e?.fields?.shape?.[r],_=!u&&typeof s=="string"&&Z(O)?s:void 0,x=!u&&typeof s=="string"&&ee(O);if(_&&n.glance)continue;let S=u?void 0:J(O),m=S?{relation:S,refs:q(s,S)}:void 0;if(m&&(n.glance||m.refs.length===0)||!k[0]&&typeof s=="object"&&(!Array.isArray(s)||s.some(g=>typeof g=="object"&&g!==null))&&u===void 0)continue;let j=typeof s=="string"&&!u?de(s,t[`${r}Repeat`],{locale:n.locale}):void 0,F=k[0]?k.map(g=>g.caption?`${g.name} \u2014 ${g.caption}`:g.name).join(", "):Array.isArray(s)?s.join(", "):typeof s=="boolean"?s?"Yes":"No":String(s),N=u?void 0:se(e,r),L=ie(N,s),W=!u&&!N&&typeof s=="number"?ne(e?.fields?.shape?.[r]):void 0,z=m?m.refs.length>1?`${m.refs.length} linked records`:"linked record":u?u(s):W?te(s,W):re(N,s,n.locale)??(Array.isArray(s)||typeof s=="boolean"?F:typeof s=="string"&&j!==void 0?j:typeof s=="string"&&I.test(s)?b(s,n.locale):typeof s=="string"&&w.test(s)?K(s,n.locale):typeof s=="string"&&ke(e,r)?E(e,r,s):F),C=typeof s=="string"&&Ae(e,r,z),h=(n.glance||n.excerpt)&&!u&&(C||x)?oe(z,{markdown:x}):z;if(a.includes(h)||c.some(g=>h.startsWith(g))||n.glance&&(typeof s=="string"||typeof s=="number")&&a.some(g=>ge(g,h)))continue;let D=U(e,r),le=typeof s=="number"?`${D} ${h}`:typeof s=="boolean"&&!u?`${D}: ${h.toLowerCase()}`:h;if(d.push({key:r,label:D,value:h,stored:F,alone:le,long:C,...x?{markdown:!0}:{},...k[0]?{files:k}:{},..._?{app:_}:{},...m?{linked:m}:{},...L?{href:L}:{},...Q(f?.[`${r}Repeat`])?{repeats:!0}:{}}),n.limit!==void 0&&d.length>=n.limit)break}return me(d,e)}function me(t,e){let n=new Map;for(let o of t){let i=he(e,o.key);i&&n.set(o.key,new Set(i.map(a=>E(e,o.key,a).toLowerCase())))}return n.size<2?t:t.map(o=>{let i=n.get(o.key);return i!==void 0&&[...n].some(([c,d])=>c!==o.key&&[...i].some(f=>d.has(f)))?{...o,alone:`${o.label}: ${o.value.toLowerCase()}`}:o})}function he(t,e){let n=t?.fields?.shape?.[e];for(let o=0;o<6&&n?._zod?.def?.innerType!==void 0;o++)n=n._zod.def.innerType;return n?._zod?.def?.type==="enum"&&n._zod.def.entries?Object.values(n._zod.def.entries).map(String):void 0}function ke(t,e){let n=t?.fields?.shape?.[e];for(let o=0;o<6&&n?._zod?.def?.innerType!==void 0;o++)n=n._zod.def.innerType;return n?._zod?.def?.type==="enum"}function be(t){let e=t?.fields?.shape;return[...Object.keys(e??{}),...Object.keys(t?.computed??{})]}function ae(t){return[...t?.fields??[],...(t?.groups??[]).flatMap(e=>e.fields)]}var we=500,$e=160;function Re(t){let e=t;for(let n=0;n<6&&e?._zod?.def?.innerType!==void 0;n++)e=e._zod.def.innerType;return e?._zod?.def?.type==="string"?e._zod.def:void 0}function Ae(t,e,n){return Re(t?.fields?.shape?.[e])?.checks?.some(i=>i._zod?.def?.check==="max_length"&&(i._zod.def.maximum??0)>we)?!0:typeof n=="string"&&(n.includes(`
|
|
2
|
+
`)||n.length>$e)}function Ye(t,e){let n=t?.display?.page,o=n?.groups??[],i=new Map(e.map(l=>[l.key,l])),a=new Set(ae(n)),c=l=>l.flatMap(p=>i.has(p)?[i.get(p)]:[]),d=e.filter(l=>!a.has(l.key));return[{fields:[...c(n?.fields??[]),...o.length>0?[]:d]},...o.map(l=>({title:l.title,fields:c(l.fields)})),...o.length>0?[{title:"Details",fields:d}]:[]].filter(l=>l.fields.length>0)}export{ye as a,Pe as b,Ke as c,pe as d,Ye as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as k,d as x,e as H}from"./chunk.COQKECUH.js";import{b as A}from"./chunk.EJPI3ST6.js";import{d as E}from"./chunk.3K6YSVHC.js";import"./chunk.SHTJZ6UX.js";import{a as b}from"./chunk.UT6642FC.js";import"./chunk.TI4OSTQV.js";import"./chunk.B2GLDIAS.js";import"./chunk.6YCBYL2Y.js";import"./chunk.UGFJKSHU.js";import{m as S}from"./chunk.JOOQUWLT.js";import{F as L,Q as h,Y as p,_ as f,sa as v,wa as w}from"./chunk.6QWV5MVH.js";import{La as m}from"./chunk.MNP4JI33.js";import{b as g}from"./chunk.AJZBJBMO.js";var l=g(L(),1);var e=g(h(),1);function I(){let{store:t,principal:r}=p(),a=f(),i=(0,l.useMemo)(()=>k(t,r),[t,r,a]),n=w("suggested");return i.length===0?null:(0,e.jsxs)("div",{style:{position:"relative"},children:[(0,e.jsxs)("button",{type:"button","data-testid":"suggested-button",...n.trigger,onClick:n.toggle,title:"What tidying suggests, waiting for you",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:"var(--graview-ink-muted)"},children:[i.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)("path",{d:"M3 4.5 H13 M3 8 H10 M3 11.5 H8",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),(0,e.jsx)("circle",{cx:"12.25",cy:"11.5",r:"1.6",fill:"none",stroke:"currentColor",strokeWidth:"1.3"})]}),(0,e.jsx)("span",{className:"graview-activity-word",children:" Suggested"})]}),n.open?(0,e.jsxs)("section",{...n.pane,"aria-label":"Suggested","data-testid":"suggested","data-graview-offstage":"",style:{...v,width:320,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:{...S,margin:0},children:"Suggested"}),(0,e.jsx)("p",{style:{margin:0,fontSize:"0.75rem",lineHeight:1.45,color:"var(--graview-ink-faint)"},children:"Not made yet: each waits for you."}),(0,e.jsx)("ol",{"data-testid":"suggestions",style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10,fontSize:"0.8125rem"},children:i.map(s=>(0,e.jsx)(O,{suggestion:s,...i.length===1?{settled:()=>{n.setOpen(!1),document.querySelector('[data-testid="activity-button"]')?.focus()}}:{}},s.id))})]}):null]})}function O({suggestion:t,settled:r}){let{store:a,principal:i,seats:n,people:s}=p(),[c,u]=(0,l.useState)(null),T=m(t.author,{graph:a.graph,schema:a.schema,seats:n,people:s}),y=o=>{u(null);try{o==="accept"?x(a,t.id,{author:i}):H(a,t.id,{author:i}),r?.()}catch(d){u(d instanceof Error?d.message:String(d))}};return(0,e.jsxs)("li",{"data-testid":"suggestion","data-suggestion":t.id,style:{display:"grid",gap:5,lineHeight:1.45},children:[(0,e.jsxs)("span",{children:[(0,e.jsx)("strong",{style:{fontWeight:600},children:T})," ",(0,e.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:"suggests"})," ",t.intent]}),t.lineage?(0,e.jsx)("span",{"data-graview-lineage":"",style:{color:"var(--graview-ink-faint)"},children:b(t.lineage)}):null,t.about.length>0?(0,e.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:t.about.slice(0,4).map(o=>(0,e.jsx)(E,{label:A(a,o),pickId:o},o))}):null,(0,e.jsxs)("div",{style:{display:"flex",gap:6},children:[(0,e.jsx)("button",{type:"button","data-testid":"suggestion-accept",onClick:()=>y("accept"),style:{minHeight:24,padding:"1px 10px",fontSize:"0.75rem"},children:"Accept"}),(0,e.jsx)("button",{type:"button","data-testid":"suggestion-decline",onClick:()=>y("decline"),style:{minHeight:24,padding:"1px 10px",fontSize:"0.75rem"},children:"Decline"})]}),c?(0,e.jsx)("span",{"data-testid":"suggestion-refused",role:"alert",style:{fontSize:"0.75rem",color:"var(--graview-warn)"},children:c}):null]})}export{I as SuggestedTray};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{H as W}from"./chunk.JOOQUWLT.js";import{F as H,b as A,c as T,d as v,e as f,f as x,k as I,n as b,pa as k,w as R}from"./chunk.6QWV5MVH.js";import{Pc as s,Vc as y,Wc as r}from"./chunk.MNP4JI33.js";import{b as B}from"./chunk.AJZBJBMO.js";var u=B(H(),1),L=e=>typeof e=="object"&&e!==null&&"idx"in e;function E(e){let n=r(window.location.pathname,e);return n===null?null:n!==s&&n!=="/"?"pages":n===s||window.location.href.includes("#")?f(window.location.hash).overview?"graview":"scene":L(window.history.state)?"pages":null}function J(e){let n=e.face??(e.stop&&v(e.stop).overview?"graview":"scene");return e.routing!=="address"||typeof window>"u"?n:E(e.basePath)??n}function K(e){return e.routing!=="address"||typeof window>"u"?!1:r(window.location.pathname,e.basePath)==="/"&&E(e.basePath)===null}function Q(e){if(typeof window>"u")return;let n=r(window.location.pathname,e);return n===s||n==="/"&&window.location.href.includes("#")?T(f(window.location.hash)):void 0}function X({basePath:e,pagesWere:n,shown:t,onFace:i,toggle:l,kinds:U,places:w,opens:$}){let{view:F,go:p}=k(),g=(0,u.useRef)({shown:t,view:F,onFace:i});g.current={shown:t,view:F,onFace:i};let S=(0,u.useRef)(n??"/"),M=()=>{S.current=`${r(window.location.pathname,e)??"/"}${window.location.search}`};return l.current=(o,c,a)=>{let{shown:d,view:N,onFace:V}=g.current;if(o==="pages"&&d!=="pages")window.history.pushState(null,"",y(c??S.current,{basePath:e}));else if(o!=="pages"&&d==="pages"){M();let m=a===void 0?N:j(v(a),w),h=Y(m)?q($):m,O=h!==m&&h.overview?"graview":o,P=_(O,h,U);p(P),window.history.pushState(null,"",`${y(s,{basePath:e})}${x(P)}`),V?.(O);return}V?.(o)},(0,u.useEffect)(()=>{let o=()=>{if(r(window.location.pathname,e)===null)return;let c=E(e)??"pages",{shown:a,onFace:d}=g.current;if(c==="pages"){a!=="pages"&&d?.("pages");return}a==="pages"&&(p(j(f(window.location.hash),w)),d?.(c))};return window.addEventListener("popstate",o),()=>window.removeEventListener("popstate",o)},[e,p,w]),null}function j(e,n){let t=e.within?.view,i=t!==void 0&&!e.focusId?n.find(l=>l.as===t):void 0;return i?{...e,focusId:R(i.kind)}:e}function _(e,n,t){return e==="graview"?b(n,!0):n.overview?I(b(n,!1),W(n,t)):n}function Y(e){return e.focusId===null&&e.overview!==!0}function q(e){return e??{...A,overview:!0}}export{J as a,K as b,Q as c,X as d,j as e,_ as f,Y as g,q as h};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as Ee}from"./chunk.XANVHJQ4.js";import{a as Ne}from"./chunk.OKRNJXTV.js";import{a as je}from"./chunk.5UL7YDUD.js";import{a as X}from"./chunk.TI4OSTQV.js";import{a as Z}from"./chunk.PBSMLINK.js";import{e as pe}from"./chunk.JOOQUWLT.js";import{F as Ze,I as ve,O as Ie,Q as Re,Y as Me}from"./chunk.6QWV5MVH.js";import{$ as G,Bb as Pe,X as Y,Z as L,ca as Ce,ea as fe,ec as Te,fb as Oe,wb as $e,zb as V}from"./chunk.MNP4JI33.js";import{b as ce}from"./chunk.AJZBJBMO.js";var en=n=>/^(?:aggregate|kind):([^,]+)$/.exec(n)?.[1];function De(n,e){let t=n.about??[];if(n.field!==void 0&&n.on!==void 0&&e(n.on))return{on:"field",id:n.on,field:n.field};let i=t.filter(e);if(i.length>1)return{on:"selection",ids:i};if(n.on!==void 0&&e(n.on))return{on:"record",id:n.on};if(i.length===1)return{on:"record",id:i[0]};let r=[n.on,...t].map(o=>o===void 0?void 0:en(o)).find(o=>o!==void 0);return n.place!==void 0?{on:"lens",place:n.place,...r?{kind:r}:{}}:r!==void 0?{on:"list",kind:r}:{on:"place",place:"home"}}var me=n=>n.on==="record"||n.on==="field"?[n.id]:n.on==="selection"?n.ids:n.on==="act"&&n.id!==void 0?[n.id]:[],ee=(n,e)=>n.tryDefinition(e)?.fields?.shape??{},B=(n,e)=>n.tryDefinition(e)?.edges??{},ne=(n,e)=>new Set(n.tryDefinition(e)?.display?.hide??[]),E=(n,e)=>Y(n.tryDefinition(e.kind),e),ue=(n,e,t)=>Ce(n.tryDefinition(e),t)||L(t),ye=n=>typeof n=="boolean"?n?"yes":"no":String(n);function ke(n,e){let t=n.kindsKeptFrom(e);return new Set(n.schema.kinds.filter(i=>!t.has(i)))}function ge(n,e,t,i){if(!n.permits(e,t).ok)return!1;if(!i)return!0;try{return n.previewAll([e],{author:t}).ops.length>0}catch{return!1}}function te(n,e,t){let i=n,{principal:r}=t,o=t.each??8,u=X(i)?.store??i,d=u.seenBy(r),l=u.schema,m=ke(u,r),c=a=>{let g=d.graph.getNode(a);return g&&m.has(g.kind)?g:void 0},f=u.allMutations(),y=new Map(f.map(a=>[a.name,a])),b=[],x=new Set,k=a=>{x.has(a.id)||(x.add(a.id),b.push(a))},s=a=>a.slice(0,o),S=me(e).filter(a=>c(a)!==void 0);if(me(e).length>0&&S.length===0)return{target:e,candidates:[]};let h=S.length===1?c(S[0]):void 0,p=h?.kind??(e.on==="list"?e.kind:e.on==="lens"?e.kind??t.places?.find(a=>a.as===e.place)?.kind:void 0)??(e.on==="selection"?c(S[0])?.kind:void 0);if(p!==void 0&&!m.has(p))return{target:e,candidates:[]};let M=(a,g)=>`act:${a}${Object.keys(g).length>0?`:${Object.values(g).map(O=>String(O)).join(",")}`:""}`,P=(a,g,O,T,C)=>{a.destructive||Object.values(g).some(N=>typeof N=="string"&&u.graph.has(N)&&c(N)===void 0)||ge(u,{name:a.name,args:{...g}},r,T.length===0)&&k({type:"act",id:M(a.name,g),label:O,description:C??a.description??O,mutation:a.name,args:g,asks:T})};if(e.on!=="place"||t.acts)if(t.acts)for(let a of t.acts){let g=y.get(a.mutation);!g||a.destructive||e.on==="act"&&a.mutation!==e.act||P(g,a.args,a.label,(a.open??[]).filter(O=>!O.optional).map(O=>O.name),a.why)}else{let a=h?[h]:[];for(let g of f){if(e.on==="act"&&g.name!==e.act)continue;let O=g.input.shape??{},T=C=>Object.entries(O).filter(([N,w])=>N!==C&&w.safeParse?.(void 0).success===!1).map(([N])=>N);if(g.subject)for(let C of a)V(l,g).includes(C.kind)&&P(g,{[g.subject.arg]:C.id},`${g.title??L(g.name)}: ${E(l,C)}`,T(g.subject.arg));else p!==void 0&&(g.creates??[]).includes(p)&&P(g,{},g.title??L(g.name),T(void 0))}}let Ye=b.filter(a=>a.type==="act");b.splice(0,b.length,...s(Ye));let we=(a,g)=>{let O=Pe(l,f).get(a.kind),T=ee(l,a.kind),C=ne(l,a.kind),N=[];for(let[w,j]of Object.entries(T)){if(g!==void 0?w!==g:C.has(w)||a[w]!==void 0)continue;let H=Z(j),J=H?.type==="enum"?H.options??[]:H?.type==="boolean"?[!0,!1]:[];if(J.length===0)continue;let D=(O?.get(w)??[]).map(v=>y.get(v)).find(v=>v?.subject!==void 0&&ge(u,{name:v.name,args:{[v.subject.arg]:a.id,[w]:J.find(le=>le!==a[w])??J[0]}},r,!0));if(D?.subject)for(let v of J)a[w]!==v&&N.push({type:"fill",id:`fill:${a.id}:${w}:${ye(v)}`,label:`${ue(l,a.kind,w)}: ${ye(v)}`,description:`Set ${ue(l,a.kind,w).toLowerCase()} of ${E(l,a)} to ${ye(v)}`,record:a.id,field:w,value:v,call:{name:D.name,args:{[D.subject.arg]:a.id,[w]:v}}})}for(let[w,j]of Object.entries(B(l,a.kind))){if(g!==void 0&&w!==g)continue;let H=j.to==="*"?[...m]:j.to.filter($=>m.has($)),J=new Set(d.graph.out(a.id,w).map($=>$.id)),D=f.find($=>($.connects??[]).includes(w)&&$.subject!==void 0&&V(l,$).includes(a.kind));if(!D?.subject)continue;let v=$e(D.input).find($=>$.name!==D.subject.arg);if(!v)continue;let le=H.flatMap($=>v.kinds.length===0||v.kinds.includes($)?d.graph.nodesOfKind($):[]).filter($=>$.id!==a.id&&!J.has($.id)&&c($.id)!==void 0);for(let $ of s(le)){let xe={name:D.name,args:{[D.subject.arg]:a.id,[v.name]:$.id}};ge(u,xe,r,!0)&&N.push({type:"fill",id:`fill:${a.id}:${w}:${$.id}`,label:`${L(w)}: ${E(l,$)}`,description:`Link ${E(l,a)} to ${E(l,$)}${j.description?` as ${j.description}`:""}`,record:a.id,field:w,value:$.id,call:xe})}}return N};if(e.on==="field"&&h)for(let a of we(h,e.field))k(a);else if(h&&e.on==="record")for(let a of s(we(h)))k(a);let Ve=a=>{let g=G(l,a).toLowerCase(),O=[{type:"panel",id:`panel:${a}:list`,label:`A list of ${g}`,description:`Every ${fe(l.tryDefinition(a),a).toLowerCase()} this viewer may see, as a list`,panel:{lens:"blocks",kind:a}}],T=ne(l,a);for(let[C,N]of Object.entries(ee(l,a))){if(T.has(C))continue;let w=Z(N),j=ue(l,a,C).toLowerCase();if(w?.type==="enum")O.push({type:"panel",id:`panel:${a}:group:${C}`,label:`${U(g)} by ${j}`,description:`A list of ${g} grouped by ${j}`,panel:{lens:"blocks",kind:a,group:C}}),O.push({type:"panel",id:`panel:${a}:columns:${C}`,label:`Columns of ${g} by ${j}`,description:`${U(g)} in a column for each ${j}`,panel:{lens:"columns",kind:a,column:C}});else if(w?.type==="number"||w?.type==="integer"||w?.type==="date"||w?.type==="datetime"){let H=w.type==="date"||w.type==="datetime";O.push({type:"panel",id:`panel:${a}:sort:${C}`,label:`${U(g)} by ${j}`,description:`A list of ${g}, the ${H?"latest":"highest"} ${j} first`,panel:{lens:"blocks",kind:a,sort:{by:C,direction:"desc"}}}),H&&O.push({type:"panel",id:`panel:${a}:calendar:${C}`,label:`A calendar of ${g}`,description:`${U(g)} on a calendar by ${j}`,panel:{lens:"calendar",kind:a,start:C}})}}return O},Xe=e.on==="place"?[...m]:p!==void 0?[p]:[];for(let a of Xe)for(let g of s(Ve(a)))k(g);for(let a of s((t.places??[]).filter(g=>g.kind===void 0?e.on==="place":m.has(g.kind)&&(e.on==="place"||g.kind===p))))e.on==="lens"&&a.as===e.place||k({type:"place",id:`place:${a.as}`,label:a.title,description:`Go to ${a.title}`,place:a.as});if(h){let a=[];for(let[g,O]of Object.entries(B(l,h.kind)))for(let T of d.graph.out(h.id,g))c(T.id)&&a.push({type:"record",id:`record:${T.id}`,label:E(l,T),description:`${U(O.description??L(g))}: ${E(l,T)}`,record:T.id,relation:g});for(let g of l.kinds)for(let[O,T]of Object.entries(B(l,g)))if(!(T.to!=="*"&&!T.to.includes(h.kind)))for(let C of d.graph.in(h.id,O))C.kind===g&&c(C.id)&&a.push({type:"record",id:`record:${C.id}`,label:E(l,C),description:`${U(T.inverse??L(O))}: ${E(l,C)}`,record:C.id,relation:O});for(let g of s(a))k(g)}else if(e.on==="list"||e.on==="lens")for(let a of s(p!==void 0?d.graph.nodesOfKind(p):[]))c(a.id)&&k({type:"record",id:`record:${a.id}`,label:E(l,a),description:`Open ${E(l,a)}`,record:a.id});else if(e.on==="selection")for(let a of S){let g=c(a);k({type:"record",id:`record:${a}`,label:E(l,g),description:`Open ${E(l,g)}`,record:a})}return{target:e,candidates:b}}var U=n=>n&&`${n[0].toUpperCase()}${n.slice(1)}`,he=new WeakMap;function nn(n){let e=2166136261;for(let t=0;t<n.length;t++)e^=n.charCodeAt(t),e=Math.imul(e,16777619)>>>0;return e.toString(36)}function tn(n,e){let t=n,i=X(t)?.store??t,r=i.schema,o=ke(i,e),d=i.allMutations().filter(k=>!k.destructive&&i.permits({name:k.name,args:{}},e).ok!==!1),l=`${[...o].join(",")}|${d.map(k=>k.name).join(",")}`,m=he.get(r)?.get(l);if(m)return m;let c=[...o].map(k=>{let s=ne(r,k),S={};for(let[p,M]of Object.entries(ee(r,k))){if(s.has(p))continue;let P=Z(M);P&&(S[p]=P.type==="enum"?`enum:${(P.options??[]).join("|")}`:P.type)}let h={};for(let[p,M]of Object.entries(B(r,k)))h[p]=M.to==="*"?[...o]:M.to.filter(P=>o.has(P));return{kind:k,noun:fe(r.tryDefinition(k),k),plural:G(r,k),fields:S,relations:h}}),f=d.map(k=>({name:k.name,title:k.title??L(k.name),...k.subject?{on:V(r,k).filter(s=>o.has(s))}:{}})),y={kinds:c,acts:f},b={version:nn(JSON.stringify(y)),...y},x=he.get(r)??new Map;return x.set(l,b),he.set(r,x),b}var on=n=>n.name??n.id??n.kind;function He(n,e,t){let i=n,{principal:r}=t,o=X(i)?.store??i,u=o.seenBy(r),d=o.schema,l=ke(o,r),m=h=>{let p=u.graph.getNode(h);return p&&l.has(p.kind)?p:void 0},c=h=>({id:h.id,kind:h.kind,label:E(d,h)}),f=me(e),y=f.length===1?m(f[0]):void 0,b=y?Object.fromEntries(Object.keys(ee(d,y.kind)).filter(h=>!ne(d,y.kind).has(h)&&y[h]!==void 0&&h!=="label").map(h=>[h,y[h]])):{},x={on:e.on,...y?{record:{...c(y),fields:b}}:{},...e.on==="field"&&y?{field:e.field}:{},...e.on==="list"&&l.has(e.kind)?{kind:e.kind}:{},...e.on==="lens"?{place:e.place,...e.kind&&l.has(e.kind)?{kind:e.kind}:{}}:{},...e.on==="place"?{place:e.place}:{},...e.on==="act"?{act:e.act}:{}},k=[...new Set([...e.on==="selection"?e.ids:[],...t.selection??[]])].flatMap(h=>{let p=m(h);return p?[c(p)]:[]}),s=[];if(y){for(let h of Object.keys(B(d,y.kind)))for(let p of u.graph.out(y.id,h))m(p.id)&&s.push({...c(p),relation:h,direction:"out"});for(let h of d.kinds)for(let p of Object.keys(B(d,h)))for(let M of u.graph.in(y.id,p))M.kind===h&&m(M.id)&&s.push({...c(M),relation:p,direction:"in"})}let S=u.batches().filter(h=>!h.ops.every(Oe)).slice(-(t.recent??6)).reverse().map(h=>({intent:h.intent,at:h.at,by:on(h.author)}));return{...t.place!==void 0?{place:t.place}:{},target:x,selection:k,neighbors:s.slice(0,24),recent:S,schema:tn(o,r)}}function oe(n){if(!n.off)return n.fast??(n.decide?{model:n.name??"decide",decide:n.decide}:void 0)}function F(n){if(n.off)return;if(n.thinking)return n.thinking;let e=n.name??"model";if(n.complete){let t=n.complete;return{model:e,think:async({system:i,prompt:r})=>({text:await t(`${i}
|
|
2
|
+
|
|
3
|
+
${r}`)})}}if(n.turn){let t=n.turn;return{model:e,think:async({system:i,prompt:r})=>({text:await t({system:i,messages:[{role:"user",content:r}],tools:[],call:async()=>({error:"No tools here."})})})}}}var be=(n,e,t)=>n?e/1e6*(n.inputPerMillion??0)+t/1e6*(n.outputPerMillion??0):void 0,Ae=()=>`ai-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;function rn(n,e,t=[]){let i=r=>{let o=n.graph.getNode(r);return o?Y(n.schema.tryDefinition(o.kind),o):"a record"};switch(e.on){case"record":return i(e.id);case"field":return`${i(e.id)} \xB7 ${e.field}`;case"selection":return`${e.ids.length} records`;case"list":return n.schema.tryDefinition(e.kind)?G(n.schema,e.kind):e.kind;case"lens":case"place":return t.find(r=>r.as===e.place)?.title??(e.place==="home"?"Home":e.place);case"act":return e.act}}var Le=n=>n.type!=="act"||n.asks.length===0,Se=(n,e)=>({id:n.id,type:n.type,label:n.label,...e!==void 0?{confidence:e}:{}});function W(n,e){let t=e.interaction??Ae(),i=te(e.store,e.target,{principal:e.principal,...e.acts?{acts:e.acts}:{},...e.places?{places:e.places}:{}}),r=He(e.store,e.target,{principal:e.principal,...e.place?{place:e.place}:{},...e.selection?{selection:e.selection}:{}}),o=[];return{id:t,catalog:i,state:r,entry:{id:t,at:new Date().toISOString(),by:e.by??e.principal,target:e.target,targetLabel:rn(e.store,e.target,e.places)},usage:o,meter:u=>{o.push(u),n.meter?.({...u,interaction:t})}}}async function re(n,e,t,i){let r=await n.decide(e,t),{inputTokens:o,outputTokens:u}=r.usage,d=be(n.price,o,u);return i({tier:"fast",model:n.model,inputTokens:o,outputTokens:u,...d!==void 0?{costUsd:d}:{}}),r.answers}async function q(n,e,t,i,r){let o=await n.think({system:e,prompt:t,state:i.state,catalog:i.catalog}),u=o.usage?.inputTokens,d=o.usage?.outputTokens,l=o.usage?.costUsd??(u!==void 0?be(n.price,u,d??0):void 0);return r({tier:"thinking",model:n.model,...u!==void 0?{inputTokens:u}:{},...d!==void 0?{outputTokens:d}:{},...l!==void 0?{costUsd:l}:{}}),Ne(o.text)}function ae(n,e){let t=new Map(n.map((i,r)=>[`c${r+1}`,i]));return{question:{type:"choice",instructions:e,criteria:Object.fromEntries([...t].map(([i,r])=>[i,`${r.label} \u2014 ${r.description}`]))},of:i=>t.get(i)}}function se(n,e,t){if(n?.type!=="choice")return[];let i=n,r=Object.entries(i.probabilities).sort((o,u)=>u[1]-o[1]);return r.some(([o])=>o===i.choice)||r.unshift([i.choice,i.confidence]),r.flatMap(([o,u])=>{let d=e(o);return d?[{candidate:d,confidence:u}]:[]}).slice(0,t)}var I=(n,e,t,i)=>({interaction:{...n.entry,ask:{kind:t,said:e??""},offered:[],outcome:"failed",failed:i,usage:[...n.usage]},offers:[]}),z="AI isn't on here.";async function Fe(n,e,t=3){let i=W(n,e),r=e.said??"Suggest",o=i.catalog.candidates.filter(Le).slice(0,24);if(o.length===0)return{interaction:{...i.entry,ask:{kind:"suggest",said:r},offered:[],outcome:"offered",usage:[]},offers:[]};let u=oe(n),d=F(n),l=[];try{if(u){let{question:m,of:c}=ae(o,"Which of these would the person most likely want to do next, here?"),f=await re(u,{...i.state,candidates:o.map(y=>({id:y.id,type:y.type,says:y.description}))},{next:m},i.meter);l=se(f.next,c,t)}else if(d){let m=await q(d,'You suggest what a person most likely wants to do next in an app. Answer only JSON: {"pick": [candidate ids, best first]}. Pick only ids from the candidates.',JSON.stringify({state:i.state,candidates:o.map(f=>({id:f.id,says:f.description}))}),i,i.meter);l=(Array.isArray(m?.pick)?m.pick.filter(f=>typeof f=="string"):[]).flatMap(f=>o.filter(y=>y.id===f)).slice(0,t).map(f=>({candidate:f}))}else return I(i,r,"suggest",z)}catch(m){return I(i,r,"suggest",m instanceof Error?m.message:String(m))}return{interaction:{...i.entry,ask:{kind:"suggest",said:r},offered:l.map(({candidate:m,confidence:c})=>Se(m,c)),outcome:"offered",usage:[...i.usage]},offers:l.map(({candidate:m})=>m)}}async function Je(n,e){let t=W(n,e),i=e.said??"Fill in",r=t.catalog.candidates.filter(f=>f.type==="fill"),o=new Map;for(let f of r)o.set(f.field,[...o.get(f.field)??[],f]);if(o.size===0)return{interaction:{...t.entry,ask:{kind:"fill",said:i},offered:[],outcome:"offered",usage:[]},offers:[]};let u=oe(n),d=F(n),l=[];try{if(u){let f=[...o].map(([b,x],k)=>({key:`f${k+1}`,field:b,...ae(x,`Which value fits "${b}" best for this record?`)})),y=await re(u,t.state,Object.fromEntries(f.map(b=>[b.key,b.question])),t.meter);for(let b of f){let x=!an(e.store,e.target,b.field)&&sn(e.store,e.target,b.field)!=="one";l.push(...se(y[b.key],b.of,x?3:1).filter((k,s)=>s===0||k.confidence>=.4))}}else if(d){let f=await q(d,`You fill in a record's fields in an app. Answer only JSON: {"fills": [candidate ids]}, at most one per field, only ids from the candidates.`,JSON.stringify({state:t.state,candidates:r.map(x=>({id:x.id,says:x.description}))}),t,t.meter),y=Array.isArray(f?.fills)?f.fills.filter(x=>typeof x=="string"):[],b=new Set;for(let x of y){let k=r.find(s=>s.id===x);k?.type==="fill"&&!b.has(k.field)&&(b.add(k.field),l.push({candidate:k}))}}else return I(t,i,"fill",z)}catch(f){return I(t,i,"fill",f instanceof Error?f.message:String(f))}let m=t.usage.at(-1)?.model,c=_(e.store,{interaction:t.id,target:e.target,basis:i,...m?{model:m}:{},proposals:l.flatMap(({candidate:f,confidence:y})=>f.type==="fill"?[{id:f.id,label:f.label,said:f.description,call:f.call,record:f.record,field:f.field,...y!==void 0?{confidence:y}:{}}]:[])},e.principal);return{interaction:{...t.entry,ask:{kind:"fill",said:i},offered:c.proposals.map(f=>({id:f.id,type:"fill",label:f.label,...f.confidence!==void 0?{confidence:f.confidence}:{}})),outcome:"offered",usage:[...t.usage]},offers:[],...c.proposals.length>0?{ghost:c}:{}}}function an(n,e,t){let i=e.on==="record"||e.on==="field"?e.id:void 0,r=i?n.graph.getNode(i)?.kind:void 0,o=(r?n.schema.tryDefinition(r)?.fields?.shape:void 0)??{};return t in o}function sn(n,e,t){let i=e.on==="record"||e.on==="field"?e.id:void 0,r=i?n.graph.getNode(i)?.kind:void 0;return r?n.schema.tryDefinition(r)?.edges?.[t]?.cardinality:void 0}async function Ue(n,e){let t=W(n,e),i=e.said??"Add one",r=new Set(e.store.allMutations().filter(c=>(c.creates??[]).length>0).map(c=>c.name)),o=t.catalog.candidates.filter(c=>c.type==="act"&&c.asks.length>0&&r.has(c.mutation));if(o.length===0)return I(t,i,"record","Nothing here makes a record.");let u=F(n);if(!u)return I(t,i,"record",z);let d;try{let c=await q(u,'You propose one new record for an app by filling in an act. Answer only JSON: {"act": a candidate id, "args": {argument: value}}. Use only the candidates, and fill every argument the act asks for with a value that fits the state.',JSON.stringify({ask:i,state:t.state,candidates:o.map(b=>({id:b.id,says:b.description,asks:b.asks}))}),t,t.meter),f=o.find(b=>b.id===c?.act),y=typeof c?.args=="object"&&c.args!==null?c.args:{};f&&(d={act:f,args:Object.fromEntries(Object.entries(y).filter(([b])=>f.asks.includes(b)))})}catch(c){return I(t,i,"record",c instanceof Error?c.message:String(c))}if(!d)return I(t,i,"record","The model named no act this app has here.");let l=t.usage.at(-1)?.model,m=_(e.store,{interaction:t.id,target:e.target,basis:i,...l?{model:l}:{},proposals:[{id:d.act.id,label:d.act.label,said:d.act.description,call:{name:d.act.mutation,args:{...d.act.args,...d.args}}}]},e.principal);return m.proposals.length===0?I(t,i,"record","What the model proposed could not be made here."):{interaction:{...t.entry,ask:{kind:"record",said:i},offered:m.proposals.map(c=>({id:c.id,type:"act",label:c.said})),outcome:"offered",usage:[...t.usage]},offers:[d.act],ghost:m}}async function Be(n,e){let t=W(n,e),i=e.said??"Make a panel",r=t.catalog.candidates.filter(c=>c.type==="panel");if(r.length===0)return I(t,i,"panel","Nothing here can be drawn as a panel.");let o=oe(n),u=F(n),d;try{if(u){let c=await q(u,'You choose a panel to draw in an app. Answer only JSON: {"panel": a candidate id, "title": a short title}. Choose only among the candidates.',JSON.stringify({ask:i,state:t.state,candidates:r.map(y=>({id:y.id,says:y.description}))}),t,t.meter),f=r.find(y=>y.id===c?.panel);f&&(d={panel:f,...typeof c?.title=="string"&&c.title.trim()?{title:c.title.trim().slice(0,60)}:{}})}else if(o){let{question:c,of:f}=ae(r,`Which panel answers this best: ${i}`),y=se((await re(o,t.state,{panel:c},t.meter)).panel,f,1)[0];y?.candidate.type==="panel"&&(d={panel:y.candidate,confidence:y.confidence})}else return I(t,i,"panel",z)}catch(c){return I(t,i,"panel",c instanceof Error?c.message:String(c))}if(!d)return I(t,i,"panel","The model named no panel this app can draw.");let l=d.title??d.panel.label,m={title:l,recipe:{...d.panel.panel,title:l}};return{interaction:{...t.entry,ask:{kind:"panel",said:i},offered:[Se(d.panel,d.confidence)],outcome:"drawn",panel:m,usage:[...t.usage]},offers:[d.panel],panel:m}}function dn(n){return n.off?void 0:n.answer}var ln=`You answer a person's question about what they are looking at in an app, from the state given and nothing else. Answer only JSON: {"answer": one to three short sentences, "pick": [candidate ids that act on the answer, best first, at most three]}. Pick only ids from the candidates, and none when nothing fits. Never say an id to the person.`;async function wn(n,e){let t=W(n,e),i=e.said.trim(),r=t.catalog.candidates.filter(s=>Le(s)||s.type==="panel"||s.type==="place"||s.type==="record").slice(0,32),o=dn(n),u=F(n),d=oe(n),l="",m=[],c=s=>s.flatMap(S=>r.filter(h=>h.id===S)).slice(0,3).map(S=>({candidate:S}));try{if(o){let s=await o.answer({said:i,target:e.target,targetLabel:t.entry.targetLabel,state:t.state,catalog:{target:t.catalog.target,candidates:r},...e.follows?{follows:e.follows}:{}}),S=s.usage?.inputTokens,h=s.usage?.outputTokens,p=s.usage?.costUsd??(S!==void 0?be(o.price,S,h??0):void 0);t.meter({tier:"thinking",model:o.model,...S!==void 0?{inputTokens:S}:{},...h!==void 0?{outputTokens:h}:{},...p!==void 0?{costUsd:p}:{}}),l=typeof s.text=="string"?s.text.trim():"",m=c(s.pick??[])}else if(u){let s=await q(u,ln,JSON.stringify({ask:i,about:t.entry.targetLabel,...e.follows?{follows:e.follows}:{},state:t.state,candidates:r.map(S=>({id:S.id,says:S.description}))}),t,t.meter);l=typeof s?.answer=="string"?s.answer.trim():"",m=c(Array.isArray(s?.pick)?s.pick:[])}else if(d&&r.length>0){let{question:s,of:S}=ae(r,`Which of these best answers, or acts on: ${i}`),h=await re(d,{...t.state,asked:i,candidates:r.map(p=>({id:p.id,type:p.type,says:p.description}))},{answer:s},t.meter);m=se(h.answer,S,3),l=m.length>0?`These fit \u201C${i}\u201D.`:""}else return I(t,i,"ask",z)}catch(s){return I(t,i,"ask",s instanceof Error?s.message:String(s))}if(!l&&m.length===0)return I(t,i,"ask","The AI had no answer to that here.");let f=t.usage.at(-1)?.model,y=m.flatMap(({candidate:s,confidence:S})=>{let h=ie(s);return h?[{...h,...S!==void 0?{confidence:S}:{}}]:[]}),b=y.length>0?_(e.store,{interaction:t.id,target:e.target,basis:i,...f?{model:f}:{},proposals:y},e.principal):void 0,x=m.map(({candidate:s})=>s).filter(s=>ie(s)===void 0),k=[...x.map(s=>Se(s,m.find(S=>S.candidate===s)?.confidence)),...(b?.proposals??[]).map(s=>({id:s.id,type:s.field!==void 0?"fill":"act",label:s.label,...s.confidence!==void 0?{confidence:s.confidence}:{}}))];return{interaction:{...t.entry,ask:{kind:"ask",said:i},offered:k,outcome:"offered",...l?{answer:l}:{},usage:[...t.usage]},offers:x,...b&&b.proposals.length>0?{ghost:b}:{},...l?{answer:l}:{}}}function _(n,e,t){let i=e.proposals.flatMap(r=>{try{let o=n.previewAll([r.call],{author:t}),u=o.ops.map(d=>d.intent).join("; ");return o.ops.length>0?[{...r,said:u||r.said}]:[]}catch{return[]}});return{...e,proposals:i}}function ie(n){if(n.type==="fill")return{id:n.id,label:n.label,said:n.description,call:n.call,record:n.record,field:n.field};if(n.type==="act"&&n.asks.length===0)return{id:n.id,label:n.label,said:n.description,call:{name:n.mutation,args:{...n.args}}}}function Ge(n,e,t){let i=e.proposals.filter(o=>t.ids===void 0||t.ids.includes(o.id));if(i.length===0)return{ok:!1,refused:"Nothing was chosen."};let r=i.flatMap(o=>o.confidence===void 0?[]:[o.confidence]);try{let u=n.applyAll(i.map(d=>d.call),{author:t.author,via:`ai:${e.interaction}`,intent:e.basis,lineage:{basis:`Asked \u201C${e.basis}\u201D`,...e.model?{model:e.model}:{},...r.length>0?{confidence:Math.min(...r)}:{},interaction:e.interaction}}).ops[0]?.batch;return u?{ok:!0,batch:u,accepted:i.map(d=>d.id)}:{ok:!1,refused:"That changes nothing now."}}catch(o){return{ok:!1,refused:o instanceof Error?o.message:String(o)}}}function We(n,e,t){let i=n.ask.kind==="suggest"?e.length>0:n.offered.length>0&&n.offered.every(r=>e.includes(r.id));return{...n,outcome:i?"accepted":"partly",accepted:e,batches:[...n.batches??[],t]}}var qe=n=>({...n,outcome:"dismissed"});var R=ce(Ze(),1);var A=ce(Re(),1);function _e(n,e,t){let i=e.on==="selection"?e.ids:e.on==="record"||e.on==="field"?[e.id]:[],r=i.length>0?Ee(n.store,i,{principal:n.principal,...i.length===1?{focus:i[0]}:{}}).affordances.map(o=>({mutation:o.mutation,label:o.label,args:o.args,open:o.open,why:o.why,...o.destructive?{destructive:!0}:{}})):void 0;return{store:n.store,target:e,principal:n.principal,interaction:Ae(),places:n.places,selection:n.selection,...r?{acts:r}:{},...n.place?{place:n.place}:{},...t?{said:t}:{}}}async function Ke(n,e){let t=await (__graviewPreload(import.meta.url,["./chunk.UBFNZMUX.js","./chunk.G4JJXA63.js","./chunk.HAIG6NVX.js","./chunk.UZGRRDHD.js","./chunk.OKRNJXTV.js","./chunk.CAVBSL27.js","./chunk.Q5WEOX3Q.js","./chunk.GV2CQVKV.js","./chunk.4HZ7QTXZ.js","./chunk.G5NZVPJU.js","./chunk.WVUJXDXZ.js","./chunk.ULRW47RP.js","./chunk.PBSMLINK.js","./chunk.3TY5NFLY.js","./chunk.D75KC3LL.js","./chunk.FWTIUYXH.js","./chunk.MAF7C3VM.js","./chunk.B2GLDIAS.js","./chunk.6YCBYL2Y.js","./chunk.UGFJKSHU.js","./chunk.MNP4JI33.js","./chunk.AJZBJBMO.js"]),import("./chunk.XKABS745.js")),i=t.recipeDraft(e.recipe,{app:n.app,sight:t.draftSight(n.app,n.principal)});if(t.isDraftFailure(i))return i.failed;n.seatTalk.setDraft(i,null),n.goTo.draft?.(),Qe()}function Qe(n=180){if(typeof document>"u")return;let e=document.querySelector('[data-testid="draft-keep"]'),t=document.activeElement,i=!t||t===document.body||t.closest?.("[inert]")!==null;if(e){i&&e.focus();return}n>0&&requestAnimationFrame(()=>Qe(n-1))}function cn(n,e,t){!t.ghost||t.ghost.proposals.length===0||(n.desk.setGhost({ghost:t.ghost}),n.desk.record(e))}async function Q(n,e,t,i){let r=_e(n,t,i),o=e==="suggest"?await Fe(n.ai,r):e==="fill"?await Je(n.ai,r):e==="record"?await Ue(n.ai,r):await Be(n.ai,r);if(o.interaction.outcome==="failed")return e!=="suggest"&&n.desk.record(o.interaction),o;if((e==="fill"||e==="record")&&(o.ghost?cn(n,o.interaction,o):n.desk.record({...o.interaction,outcome:"failed",failed:"Nothing here could be filled in."})),e==="panel"&&o.panel){let u=await Ke(n,o.panel);n.desk.record(u?{...o.interaction,outcome:"failed",failed:u}:o.interaction)}return o}async function fn(n,e,t){let i=e.interaction,r=ie(t);if(r){let o=i.usage?.at(-1)?.model,u=i.offered.find(l=>l.id===t.id)?.confidence,d=_(n.store,{interaction:i.id,target:i.target,basis:`${i.ask.said}: ${t.label}`,...o?{model:o}:{},proposals:[{...r,...u!==void 0?{confidence:u}:{}}]},n.principal);if(d.proposals.length===0){n.desk.record({...i,outcome:"failed",failed:"That can't be done now."});return}n.desk.setGhost({ghost:d}),n.desk.record(i);return}if(t.type==="panel"){let o=t.label,u={title:o,recipe:{...t.panel,title:o}},d=await Ke(n,u);n.desk.record(d?{...i,outcome:"failed",failed:d}:{...i,outcome:"drawn",accepted:[t.id],panel:u});return}t.type==="place"?n.goTo.place(t.place):t.type==="record"&&n.goTo.record(t.record),n.desk.record({...i,outcome:"accepted",accepted:[t.id]})}async function Mn(n,e){if(e.ask.kind==="ask")return pe(n.desk,{target:e.target,asked:e.ask.said}),null;let t=e.ask.kind==="panel"||e.ask.kind==="record"?e.ask.kind:"fill";return Q(n,t,e.target,e.ask.said)}var K={padding:"5px 10px",fontSize:"0.875rem",borderRadius:8,width:"100%",textAlign:"left",borderWidth:1,borderStyle:"solid",borderColor:"transparent",background:"none",boxShadow:"none"},ze={margin:0,padding:"4px 10px",fontSize:"0.8125rem",color:"var(--graview-ink-muted)"};function jn({target:n,close:e}){let t=je(),i=(0,R.useMemo)(()=>De(n,s=>t.store.graph.has(s)),[n,t.store]),r=(0,R.useMemo)(()=>{let s=_e(t,i);return te(t.store,i,{principal:t.principal,places:t.places,...s.acts?{acts:s.acts}:{}})},[t,i]),o=r.candidates.some(s=>s.type==="fill"),u=r.candidates.some(s=>s.type==="panel"),d=(0,R.useMemo)(()=>new Set(t.store.allMutations().filter(s=>(s.creates??[]).length>0).map(s=>s.name)),[t.store]),l=F(t.ai)!==void 0&&r.candidates.some(s=>s.type==="act"&&s.asks.length>0&&d.has(s.mutation)),[m,c]=(0,R.useState)(null),[f,y]=(0,R.useState)(!0),[b,x]=(0,R.useState)(null);(0,R.useEffect)(()=>{let s=!0;return y(!0),Q(t,"suggest",i).then(S=>{s&&(c(S),y(!1),S.interaction.outcome==="failed"&&x(S.interaction.failed??"The AI could not suggest anything here."))}),()=>{s=!1}},[i]);let k=s=>{e(),s()};return(0,A.jsxs)("div",{"data-testid":"inline-ai",style:{display:"grid",gap:2},children:[f?(0,A.jsx)("p",{role:"status","data-testid":"inline-ai-thinking",style:ze,children:"Thinking\u2026"}):b?(0,A.jsx)("p",{role:"status",style:ze,children:b}):null,(0,A.jsxs)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",gap:2},children:[(m?.offers??[]).map(s=>(0,A.jsx)("li",{children:(0,A.jsxs)("button",{type:"button","data-menu-item":`ai-offer:${s.id}`,"data-ai-offer":s.id,"data-ai-offer-type":s.type,onClick:()=>k(()=>fn(t,m,s)),style:K,children:[s.label,(0,A.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",s.type==="panel"?"a panel":s.type==="place"?"go there":s.type==="record"?"open it":"suggested"]})]})},s.id)),o?(0,A.jsx)("li",{children:(0,A.jsx)("button",{type:"button","data-menu-item":"ai-fill",onClick:()=>k(()=>Q(t,"fill",i,"Fill in")),style:K,children:"Fill in with AI"})}):null,l?(0,A.jsx)("li",{children:(0,A.jsx)("button",{type:"button","data-menu-item":"ai-record",onClick:()=>k(()=>Q(t,"record",i,"Add one")),style:K,children:"Add one with AI"})}):null,u?(0,A.jsx)("li",{children:(0,A.jsx)("button",{type:"button","data-menu-item":"ai-panel",onClick:()=>k(()=>Q(t,"panel",i,"Draw a panel")),style:K,children:"Draw a panel"})}):null,(0,A.jsx)("li",{children:(0,A.jsx)("button",{type:"button","data-menu-item":"ai-ask",onClick:()=>{let s=document.activeElement;e(),pe(t.desk,{target:i,returnTo:s instanceof HTMLElement&&s!==document.body?s:null})},style:K,children:"Ask about this\u2026"})})]})]})}var de={display:"inline-flex",alignItems:"center",minHeight:28,padding:"2px 10px",fontSize:"0.8125rem",borderRadius:8};function En({placement:n="picture"}){let{store:e,principal:t,aiDesk:i}=Me(),r=Ie(e,t),{ghost:o,entries:u}=ve(i),[d,l]=(0,R.useState)(new Set);(0,R.useEffect)(()=>l(new Set),[o?.ghost.interaction]);let m=(0,R.useRef)(null),c=(0,R.useRef)(null),f=o?.batch;if((0,R.useEffect)(()=>{f!==void 0&&c.current?.focus()},[f]),!o)return null;let{ghost:y}=o,b=u.find(p=>p.id===y.interaction),x=()=>{let p=y.target.on==="record"||y.target.on==="field"?y.target.id:void 0,M=m.current?.closest("[data-graview-face], main")?.parentElement??document,P=(p?M.querySelector(`[data-graview-view="${CSS.escape(p)}"][tabindex]`):null)??document.querySelector("[data-graview-page-title]")??m.current?.closest("main")??document.querySelector("main");P&&!P.hasAttribute("tabindex")&&P.setAttribute("tabindex","-1"),P?.focus({preventScroll:!0}),i.setGhost(null)},k=y.proposals.filter(p=>!d.has(p.id)).map(p=>p.id),s=()=>{let p=Ge(r,y,{author:t,ids:k});if(!p.ok){i.setGhost({...o,refused:p.refused});return}b&&i.record(We(b,p.accepted,p.batch)),i.setGhost({ghost:y,batch:p.batch,took:p.accepted.length,...o.onCard?{onCard:!0}:{}})},S=()=>{b&&o.batch===void 0&&i.record(qe(b)),x()},h=()=>{if(o.batch!==void 0)try{r.undo(o.batch,{author:t}),x()}catch(p){i.setGhost({...o,refused:p instanceof Error?p.message:String(p)})}};return(0,A.jsxs)("section",{ref:m,"data-testid":"ai-ghost","data-interaction":y.interaction,"aria-label":"Proposed by AI",style:{...n==="card"?{position:"static"}:{position:n==="page"?"fixed":"absolute",insetInline:"max(12px, calc(50% - 220px))",bottom:"calc(var(--graview-foot-room, 0px) + 72px)",zIndex:Te("toast"),boxShadow:"var(--graview-lift-high)"},display:"grid",gap:8,padding:12,borderRadius:12,border:"1px dashed var(--graview-accent)",background:"var(--graview-float)",fontSize:"0.875rem"},children:[(0,A.jsx)("p",{style:{margin:0,color:"var(--graview-ink-muted)"},children:o.batch!==void 0?`Done: ${o.took===1?"one change":`${o.took} changes`}, as one.`:`Proposed by AI \xB7 ${y.basis}`}),o.batch===void 0?(0,A.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:4},children:y.proposals.map(p=>(0,A.jsx)("li",{"data-ghost-proposal":p.id,children:(0,A.jsxs)("label",{style:{display:"flex",alignItems:"baseline",gap:8,cursor:"pointer"},children:[(0,A.jsx)("input",{type:"checkbox",checked:!d.has(p.id),onChange:M=>{let P=new Set(d);M.target.checked?P.delete(p.id):P.add(p.id),l(P)}}),(0,A.jsx)("span",{style:{fontStyle:"italic",color:"var(--graview-ink)"},children:p.said}),p.confidence!==void 0?(0,A.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[Math.round(p.confidence*100),"% sure"]}):null]})},p.id))}):null,o.refused?(0,A.jsx)("p",{role:"alert",style:{margin:0,color:"var(--graview-warn)"},children:o.refused}):null,(0,A.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:o.batch===void 0?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("button",{type:"button","data-testid":"ghost-accept",disabled:k.length===0,onClick:s,style:de,children:k.length===y.proposals.length?"Accept":`Accept ${k.length} of ${y.proposals.length}`}),(0,A.jsx)("button",{type:"button","data-testid":"ghost-dismiss",onClick:S,style:de,children:"Dismiss"})]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("button",{type:"button",ref:c,"data-testid":"ghost-undo",onClick:h,style:de,children:"Undo"}),(0,A.jsx)("button",{type:"button","data-testid":"ghost-close",onClick:x,style:de,children:"Close"})]})})]})}export{De as a,me as b,te as c,rn as d,wn as e,_e as f,Ke as g,Q as h,fn as i,Mn as j,jn as k,En as l};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as n}from"./chunk.NTF7FVB2.js";import"./chunk.5UL7YDUD.js";import{a}from"./chunk.JDUJDAGA.js";import"./chunk.LR3VDXPI.js";import"./chunk.COQKECUH.js";import"./chunk.EJPI3ST6.js";import"./chunk.3K6YSVHC.js";import"./chunk.SHTJZ6UX.js";import"./chunk.UT6642FC.js";import"./chunk.TI4OSTQV.js";import"./chunk.GZHZLJBF.js";import"./chunk.XMC7YDWT.js";import"./chunk.6UGEYZAC.js";import"./chunk.OJGHDWI6.js";import"./chunk.B2GLDIAS.js";import"./chunk.6YCBYL2Y.js";import"./chunk.UGFJKSHU.js";import"./chunk.JOOQUWLT.js";import{Q as i}from"./chunk.6QWV5MVH.js";import"./chunk.MNP4JI33.js";import{b as o}from"./chunk.AJZBJBMO.js";var e=o(i(),1);function g({entries:d,style:l,headingStyle:p,className:r}){return(0,e.jsxs)("section",{...r?{className:r}:{},"data-testid":"record-ai","aria-label":"What AI did here",style:{display:"grid",gap:10,...l},children:[(0,e.jsx)("h2",{style:p??{margin:0,fontSize:"1rem"},children:"What AI did here"}),(0,e.jsx)("ol",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:8,fontSize:"0.875rem"},children:d.slice(0,8).map(t=>(0,e.jsx)(n,{entry:t,undo:s=>(0,e.jsx)(a,{batch:s})},t.id))})]})}export{g as RecordInteractions};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as j,b as D}from"./chunk.
|
|
1
|
+
import{a as j,b as D}from"./chunk.3AGY4QVS.js";import"./chunk.SYAEBGDC.js";import"./chunk.UZGRRDHD.js";import"./chunk.XANVHJQ4.js";import{a as I}from"./chunk.EJPI3ST6.js";import"./chunk.SHTJZ6UX.js";import"./chunk.UT6642FC.js";import{a as k,b as V}from"./chunk.MB7LKKUD.js";import"./chunk.ULRW47RP.js";import"./chunk.PBSMLINK.js";import"./chunk.3TY5NFLY.js";import"./chunk.D75KC3LL.js";import"./chunk.FWTIUYXH.js";import"./chunk.MAF7C3VM.js";import"./chunk.B2GLDIAS.js";import"./chunk.6YCBYL2Y.js";import"./chunk.UGFJKSHU.js";import"./chunk.JOOQUWLT.js";import{F as Q,Q as H,ta as x}from"./chunk.6QWV5MVH.js";import{_ as B,ec as q}from"./chunk.MNP4JI33.js";import{b}from"./chunk.AJZBJBMO.js";var t=b(Q(),1);var a=b(H(),1);function U(r){let n=[];return r.applied.length>0&&r.intent&&n.push(`${r.intent}.`),r.unchanged.length>0&&n.push(`${r.unchanged.length} already so.`),r.allOrNothing&&n.push("None of it was kept."),n.join(" ")}function ie({store:r,chosen:n,principal:d,context:v,via:S,anchor:E,of:g,onChooseAll:A,onClear:p,onActed:F}){let[K,W]=(0,t.useState)(0);(0,t.useEffect)(()=>r.subscribe(()=>W(e=>e+1)),[r]);let m=n.join(`
|
|
2
2
|
`),{acts:h,withheld:N}=(0,t.useMemo)(()=>j(r,n,{...d?{principal:d}:{},...v?{context:v}:{}}),[r,m,d,v,K]),[L,u]=(0,t.useState)(!1),[l,c]=(0,t.useState)(null),[s,O]=(0,t.useState)(null),w=(0,t.useRef)(null),M=(0,t.useId)(),f=(0,t.useMemo)(()=>[...new Set(n.map(e=>r.graph.getNode(e)?.kind))],[r,m]),_=f.length===1&&f[0]?`${B(r.schema,f[0],n.length)} chosen`:`${n.length} chosen`,P=typeof matchMedia=="function"&&matchMedia("(pointer: coarse), (max-width: 599px)").matches?2:3,C=h.filter(e=>!e.more),G=C.slice(0,P),T=[...C.slice(P),...h.filter(e=>e.more)];(0,t.useEffect)(()=>{c(null),u(!1)},[m]),(0,t.useLayoutEffect)(()=>{let e=w.current;if(!e)return;if(typeof e.showPopover=="function"&&!x(e))try{e.showPopover()}catch{}let i=()=>{V(e,E?.()??null),dispatchEvent(new Event(k))};i(),addEventListener("resize",i),addEventListener("scroll",i,!0);let o=typeof ResizeObserver=="function"?new ResizeObserver(i):null;return o?.observe(e),()=>{if(o?.disconnect(),removeEventListener("resize",i),removeEventListener("scroll",i,!0),e.isConnected&&x(e))try{e.hidePopover()}catch{}dispatchEvent(new Event(k))}},[E]);let y=(0,t.useRef)({asking:l,onClear:p});y.current={asking:l,onClear:p},(0,t.useEffect)(()=>{let e=i=>{if(i.key!=="Escape"||i.defaultPrevented)return;let o=document.activeElement;if(!(!(w.current?.contains(o)??!1)&&(o instanceof HTMLTextAreaElement||o instanceof HTMLInputElement&&o.type!=="checkbox"||o instanceof HTMLSelectElement))){if(i.preventDefault(),i.stopPropagation(),y.current.asking){c(null);return}y.current.onClear()}};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[]);let R=(e,i={})=>{let o=D(r,{mutation:e.mutation,subject:e.subject,args:{...e.args,...i},label:e.label},n,{...d?{author:d}:{},...S?{via:S}:{},...v?{context:v}:{}});c(null),u(!1),O(o.refused.length>0||o.applied.length===0?o:null),F(o.refused.map(z=>z.id))},J=e=>{O(null),u(!1),e.open.length>0?c(e):R(e)},$=e=>(0,a.jsxs)("button",{type:"button",className:"graview-several-act","data-testid":"several-act","data-act":e.id,"data-mutation":e.mutation,...e.destructive?{"data-tone":"warn"}:{},"aria-pressed":l?.id===e.id?!0:void 0,onClick:()=>J(e),children:[e.label,e.open.length>0?"\u2026":""]},e.id);return(0,a.jsxs)("div",{ref:w,popover:"manual",role:"region","aria-label":"The chosen records",className:"graview-several-bar","data-testid":"several-bar","data-graview-foot":"","data-graview-overlay":"","data-graview-popover":"","data-graview-offstage":"",style:X,children:[(0,a.jsx)("style",{children:Y}),(0,a.jsxs)("div",{className:"graview-several-line",children:[(0,a.jsx)("span",{role:"status","aria-live":"polite",className:"graview-several-count","data-testid":"several-count",children:_}),(0,a.jsxs)("div",{role:"group","aria-label":`What to do with the ${n.length} chosen`,className:"graview-several-acts",children:[G.map($),T.length>0?(0,a.jsx)("button",{type:"button",className:"graview-several-act","data-testid":"several-more","aria-expanded":L,"aria-controls":M,onClick:()=>u(e=>!e),children:"More"}):null,A&&g!==void 0&&g>n.length?(0,a.jsxs)("button",{type:"button",className:"graview-several-quiet","data-testid":"several-all",onClick:A,children:["Choose all ",g]}):null,(0,a.jsx)("button",{type:"button",className:"graview-several-quiet","data-testid":"several-clear","aria-keyshortcuts":"Escape",title:"Put the choice down \u2014 Escape",onClick:p,children:"Clear"})]})]}),L?(0,a.jsx)("div",{id:M,role:"group","aria-label":"More",className:"graview-several-acts","data-testid":"several-more-acts",children:T.map($)}):null,h.length===0?(0,a.jsx)("p",{className:"graview-several-said","data-testid":"several-none",children:N.length>0?`Nothing here can be done to all of them by you: ${N[0].message}`:"Nothing can be done to all of these at once."}):null,l?(0,a.jsx)("div",{className:"graview-several-ask",role:"group","aria-label":`${l.label}, for all ${n.length}`,"data-testid":"several-ask",children:(0,a.jsx)(I,{store:r,affordance:l.affordance,onApply:e=>R(l,e),onCancel:()=>c(null)})}):null,s?(0,a.jsxs)("div",{role:"alert",className:"graview-several-said","data-testid":"several-outcome",children:[U(s),s.refused.length>0?(0,a.jsxs)(a.Fragment,{children:[" ",s.refused.length===1?"One was not changed, and is still chosen:":`${s.refused.length} were not changed, and are still chosen:`,(0,a.jsx)("ul",{"data-testid":"several-refused",children:s.refused.map(e=>(0,a.jsxs)("li",{"data-record":e.id,children:["\u201C",e.label,"\u201D \u2014 ",e.message]},e.id))})]}):null]}):null]})}var X={position:"fixed",inset:"auto",margin:0,zIndex:q("toast"),boxSizing:"border-box",width:"max-content",height:"auto",bottom:"calc(16px + env(safe-area-inset-bottom, 0px))",left:16,overflow:"visible"},Y=`
|
|
3
3
|
.graview-several-bar{display:grid;gap:8px;padding:8px 10px;border:1px solid var(--graview-edge);border-radius:var(--graview-radius,12px);background:var(--graview-float);color:var(--graview-ink);box-shadow:var(--graview-lift-high);font-size:.875rem;line-height:1.4;max-height:70vh;overflow:auto}
|
|
4
4
|
.graview-several-line{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;min-width:0}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{B as w,D as b,G as k,J as $,N as p,Z as N,ca as D,ja as E,kb as F,qb as S,tb as T}from"./chunk.MNP4JI33.js";function W(e,n,r){let o=[...n?.creates??[],...n?.subject&&n.subject.kinds!=="*"?n.subject.kinds:[]];for(let t of o){let i=e.tryDefinition(t),a=i?.fields?.shape??{};if(!i||!(r in a))continue;let d=i.display?.format?.[r];return{label:i.display?.labels?.[r]??D(i,r),option:u=>d?d(u):N(u)}}return{label:D(void 0,r),option:t=>N(t)}}function P(e,n,r){if(r instanceof F){let o=n.find(i=>i.name===r.mutation);return`Not yet: ${r.issues.map(i=>{let a=i.path.length>0?W(e,o,String(i.path[0])).label:void 0;return a?`${a} \u2014 ${i.message.replace(/^./,d=>d.toLowerCase())}`:i.message}).join("; ")}.`}return r instanceof Error?r.message:String(r)}var x=864e5,Z=/^(\d{4})-(\d{2})-(\d{2})/,y=e=>String(e).padStart(2,"0"),M=e=>new Date(e).toISOString().slice(0,10),m=e=>Date.UTC(+e.slice(0,4),+e.slice(5,7)-1,+e.slice(8,10)),g=(e,n)=>M(m(e)+n*x),R=e=>new Date(m(e)).getUTCDay();function l(e,n,r){if(!(n>=1&&n<=12&&r>=1&&r<=31))return;let o=`${String(e).padStart(4,"0")}-${y(n)}-${y(r)}`;return M(m(o))===o?o:void 0}function I(e=new Date){return{day:`${e.getFullYear()}-${y(e.getMonth()+1)}-${y(e.getDate())}`,minutes:e.getHours()*60+e.getMinutes()}}var j=e=>/T\d\d:\d\d(:[\d.]+)?(Z|[+-]\d\d:?\d\d)$/.test(e);function h(e){if(typeof e!="string")return;if(j(e)){let o=new Date(e);return Number.isNaN(o.getTime())?void 0:I(o)}let n=/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2}))?/.exec(e);if(!n||!l(Number(n[1]),Number(n[2]),Number(n[3])))return;let r=e.slice(0,10);return n[4]===void 0?{day:r}:{day:r,minutes:Number(n[4])*60+Number(n[5])}}function O(e,n){if(!n.time)return e.day;let r=e.minutes??9*60;if(!n.instant)return`${e.day}T${y(Math.floor(r/60))}:${y(r%60)}`;let[,o,t,i]=Z.exec(e.day);return new Date(Number(o),Number(t)-1,Number(i),Math.floor(r/60),r%60).toISOString().replace(/\.\d{3}Z$/,"Z")}function H(e,n=new Date){let r=Intl.DateTimeFormat().resolvedOptions().timeZone??"UTC",o=r;try{o=new Intl.DateTimeFormat(e??b,{timeZoneName:"short"}).formatToParts(n).find(t=>t.type==="timeZoneName")?.value??r}catch{o=r}return{zone:r,short:o}}function G(e,n,r,o){let t=h(n);if(!t)return r;let i=e===void 0?void 0:h(e),a=r===void 0?void 0:h(r),d=u=>m(u.day)+(u.minutes??0)*6e4,c=(u,s)=>{let f=d(u)+s;return{day:M(f),...o.time?{minutes:Math.round(f%x/6e4)}:{}}};return i&&a?O(c(a,d(t)-d(i)),o):a&&d(a)>=d(t)?r:o.time?O(c(t,36e5),o):r}var K=/^(start|starts|startsAt|startsOn|startAt|begins|from|opens|checkIn)$/i,X=/^(end|ends|endsAt|endsOn|endAt|until|to|finish|finishes|closes|through|checkOut)$/i;function V(e,n={}){let r=(n.start&&e.includes(n.start)?n.start:void 0)??e.find(t=>K.test(t)),o=(n.end&&e.includes(n.end)?n.end:void 0)??e.find(t=>t!==r&&X.test(t));return r&&o?{start:r,end:o}:void 0}var q=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],J=["sun","mon","tue","wed","thu","fri","sat"],v="(jan(?:uary)?|feb(?:ruary)?|mar(?:ch)?|apr(?:il)?|may|june?|july?|aug(?:ust)?|sept?(?:ember)?|oct(?:ober)?|nov(?:ember)?|dec(?:ember)?)",C="(sun(?:day)?|mon(?:day)?|tue(?:s|sday)?|wed(?:nesday)?|thu(?:r|rs|rsday)?|fri(?:day)?|sat(?:urday)?)",Q=e=>q.indexOf(e.slice(0,3))+1,L=e=>e===void 0?void 0:e.length===2?2e3+Number(e):Number(e);function ee(e){try{let n=new Intl.DateTimeFormat(e,{month:"numeric",day:"numeric"}).formatToParts(0).map(r=>r.type);return n.indexOf("month")<n.indexOf("day")}catch{return!0}}function ne(e){let n=(t,i)=>({minutes:i,rest:`${e.slice(0,t.index)} ${e.slice(t.index+t[0].length)}`}),r=/\b(noon|midday)\b/.exec(e);if(r)return n(r,12*60);if(r=/\bmidnight\b/.exec(e),r)return n(r,0);if(r=/\b(\d{1,2})(?::(\d{2}))?\s*([ap])\.?m?\.?(?=\s|$)/.exec(e),r){let t=Number(r[1]),i=Number(r[2]??0);return t<1||t>12||i>59?{rest:e,bad:!0}:n(r,(t%12+(r[3]==="p"?12:0))*60+i)}if(r=/\b(\d{1,2}):(\d{2})\b/.exec(e),r){let t=Number(r[1]),i=Number(r[2]);return t>23||i>59?{rest:e,bad:!0}:n(r,t*60+i)}if(r=/\bat\s+(\d{1,2})\b/.exec(e),r){let t=Number(r[1]);return t>23?{rest:e,bad:!0}:n(r,(t>=1&&t<=7?t+12:t)*60)}let o=/\b(morning|afternoon|evening|tonight)\b/.exec(e);return o?{minutes:{morning:9,afternoon:15,evening:18,tonight:20}[o[1]]*60,rest:o[1]==="tonight"?`${e.slice(0,o.index)} today ${e.slice(o.index+o[0].length)}`:`${e.slice(0,o.index)} ${e.slice(o.index+o[0].length)}`}:{rest:e}}function te(e,n,r){let o=e.replace(/\b(on|at|the|of|this)\b/g," ").replace(/\s+/g," ").trim();if(o==="")return null;if(o==="today"||o==="now")return n;if(o==="tomorrow"||o==="tmrw"||o==="tmr")return g(n,1);if(o==="yesterday")return g(n,-1);if(o==="next week")return g(n,7);let t=/^in (\d{1,3}) (day|days|week|weeks)$/.exec(o);if(t)return g(n,Number(t[1])*(t[2].startsWith("week")?7:1));if(t=new RegExp(`^(next )?${C}$`).exec(o),t){let u=(J.indexOf(t[2].slice(0,3))-R(n)+7)%7;return g(n,t[1]&&u===0?7:u)}if(t=/^(\d{4})-(\d{1,2})-(\d{1,2})$/.exec(o),t)return l(Number(t[1]),Number(t[2]),Number(t[3]));let i=o.replace(new RegExp(`^${C} `),"");t=new RegExp(`^(\\d{1,2})(?:st|nd|rd|th)? ${v}(?: (\\d{4}))?$`).exec(i);let a=t?{date:t[1],month:t[2],year:t[3]}:void 0;t=new RegExp(`^${v} (\\d{1,2})(?:st|nd|rd|th)?(?: (\\d{4}))?$`).exec(i);let d=a??(t?{date:t[2],month:t[1],year:t[3]}:void 0);if(d)return z(n,L(d.year),Q(d.month),Number(d.date));if(t=/^(\d{1,2})[/.-](\d{1,2})(?:[/.-](\d{2}|\d{4}))?$/.exec(i),t){let[c,u]=[Number(t[1]),Number(t[2])],[s,f]=ee(r)?[c,u]:[u,c];return z(n,L(t[3]),s,f)}}function z(e,n,r,o){if(n!==void 0)return l(n,r,o);let t=Number(e.slice(0,4)),i=l(t,r,o);return i===void 0?l(t+1,r,o):m(e)-m(i)>183*x?l(t+1,r,o):i}function re(e,n){let r=e.toLowerCase().replace(/,/g," ").replace(/(\d{4}-\d{2}-\d{2})t(?=\d)/,"$1 ").replace(/\s+/g," ").trim();if(r==="")return;let o=ne(r);if(o.bad)return;let t=te(o.rest,n.today,n.locale??b);if(t===void 0||t===null&&o.minutes===void 0)return;let i=t??n.base?.day??n.today;return n.time?{day:i,minutes:o.minutes??n.base?.minutes??9*60}:{day:i}}var oe=e=>/^[A-Z]{3}$/.test(e??"");function U(e){let{format:n,unit:r,currency:o,locale:t}=e,i=oe(r),a=n==="money"||!n&&i,d=a?i?r:o:void 0;return{...a?{format:"money"}:n?{format:n}:{},...r&&!(a&&i)?{unit:r}:{},...d?{currency:d}:{},...t?{locale:t}:{}}}function $e(e){switch(e.format){case"money":return e.currency?`An amount of money in ${e.currency}: a plain number, 1250.5 for 1,250.50 ${e.currency}.`:"An amount of money, in no named currency: a plain number.";case"percent":return"A fraction said as a percent: 0.15 is 15%.";default:return e.unit?`A number of ${e.unit}.`:"A number."}}function B(e){let n=w(e)?.innerType;return n===void 0?e:B(n)}var ie={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]},ue=e=>(e?._zod?.def?.checks??[]).map(n=>n._zod?.def).filter(n=>n!==void 0);function _(e){let n=B(e),r=w(n),o=r?.type,t=ue(n);if(o==="enum")return{type:"choice",options:Object.keys(r?.entries??{})};let i=E(n);if(i)return i==="image"?{type:"file",image:!0}:{type:"file"};if(o==="boolean")return{type:"boolean"};if(o==="array"){let a=_(r?.element);return a.type==="unknown"?{type:"unknown"}:{type:"several",of:a}}if(o==="number"){let a,d,c;for(let u of t){u.check==="multiple_of"&&typeof u.value=="number"?c=u.value:u.check==="number_format"&&(u.format==="safeint"||u.format==="int32"||u.format==="uint32")&&(c??=1);let s=u.check==="number_format"&&u.format?ie[u.format]:void 0,f=s?s[0]:u.check==="greater_than"&&u.inclusive&&typeof u.value=="number"?u.value:void 0,A=s?s[1]:u.check==="less_than"&&u.inclusive&&typeof u.value=="number"?u.value:void 0;f!==void 0&&(a=a===void 0?f:Math.max(a,f)),A!==void 0&&(d=d===void 0?A:Math.min(d,A))}return{type:"number",...a===void 0?{}:{min:a},...d===void 0?{}:{max:d},...c===void 0?{}:{step:c},...T(n)==="duration"?{duration:!0}:{},...S(e)?{amount:U(S(e))}:{}}}if(o==="string"){if(t.some(s=>s.fn===k||s.format==="datetime")||r?.format==="datetime")return{type:"date",time:!0,instant:!0};let d=[r?.pattern,...t.map(s=>s.pattern)].filter(s=>s instanceof RegExp).map(s=>s.source);if(d.some(s=>s.includes("\\d{4}")))return d.some(s=>s.includes("\\d{2}:\\d{2}"))?{type:"date",time:!0}:{type:"date"};let c=t.some(s=>s.check==="max_length"&&typeof s.maximum=="number"&&s.maximum>500),u=T(n);return c?{type:"text",long:!0}:u==="phone"||u==="place"?{type:"text",holds:u}:{type:"text"}}return{type:"unknown"}}function ae(e,n){let r=e?.shape;return!r||!(n in r)?{type:"unknown"}:_(r[n])}function de(e){if(e===void 0||e==="web"||e.startsWith("ai:")||e.startsWith("app:"))return;if(e==="api")return"via the API";if(e==="cli")return"via the command line";let[n,...r]=e.split(":"),o=r.join(":");return(n==="mcp"||n==="view")&&o?`via ${o}`:n==="mcp"?"via an agent's tools":`via ${e}`}var Y=e=>{if(!e.currency)return{before:!0};try{let n=$(e.locale),r=new Intl.NumberFormat(n,{style:"currency",currency:e.currency}).formatToParts(1),o=r.findIndex(a=>a.type==="currency"),t=r.findIndex(a=>a.type==="integer"),i;try{i=new Intl.DisplayNames([n],{type:"currency"}).of(e.currency)}catch{}return{...o>=0?{symbol:r[o].value}:{},before:o<t,...i?{name:i}:{}}}catch{return{symbol:e.currency,before:!0}}};function se(e){let n=e.locale;if(e.format==="money"){let{symbol:r,before:o,name:t}=Y(e),i=p(1250,n,{minimumFractionDigits:2,maximumFractionDigits:2});return{...r?o?{prefix:r}:{suffix:r}:{},placeholder:i,hint:t?`in ${t}`:e.currency?`in ${e.currency}`:"an amount of money"}}return e.format==="percent"?{suffix:"%",placeholder:p(15,n),hint:"as a percent"}:{...e.unit?{suffix:e.unit}:{},placeholder:"",hint:e.unit?`in ${e.unit}`:"a number"}}function ce(e,n){return e===void 0||!Number.isFinite(e)?"":n.format==="money"?p(e,n.locale,Number.isInteger(e)?{maximumFractionDigits:0}:{minimumFractionDigits:2,maximumFractionDigits:2}):n.format==="percent"?p(e*100,n.locale,{maximumFractionDigits:4}):p(e,n.locale,{maximumFractionDigits:6})}function fe(e){try{let n=new Intl.NumberFormat($(e)).formatToParts(12345.6);return{group:n.find(r=>r.type==="group")?.value??",",decimal:n.find(r=>r.type==="decimal")?.value??"."}}catch{return{group:",",decimal:"."}}}function me(e,n){let{group:r,decimal:o}=fe(n),t=e.replace(/[\s ']/g,"").replace(/[−–]/g,"-");if(o!=="."&&!t.includes(o)&&/^-?\d+\.\d{1,2}$/.test(t))return Number(t);if(r&&(t=t.split(r).join("")),o!=="."&&(t=t.replace(o,".")),!/^-?(\d+\.?\d*|\.\d+)$/.test(t))return;let i=Number(t);return Number.isFinite(i)?i:void 0}function le(e,n){let r=e.trim();if(r==="")return;let o=n?.format==="money"&&n.currency?Y(n).symbol:void 0,t=r;o&&(t=t.split(o).join("")),n?.currency&&(t=t.replace(new RegExp(n.currency,"gi"),"")),t=t.replace(/^[$€£¥₹]|[$€£¥₹]$/g,""),/%\s*$/.test(t)&&(t=t.replace(/%\s*$/,"")),n?.unit&&n.format!=="money"&&(t=t.replace(new RegExp(`\\s*${n.unit.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*$`),""));let a=me(t,n?.locale);if(a!==void 0)return n?.format==="percent"?a/100:a}export{U as a,$e as b,B as c,_ as d,ae as e,W as f,P as g,de as h,se as i,ce as j,le as k,I as l,j as m,h as n,O as o,H as p,G as q,V as r,re as s};
|