graview 0.1.38 → 0.1.39
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.23WYWIAJ.js +1 -0
- package/dist/preview/{chunk.5XJEGXDO.js → chunk.2BJRS3YJ.js} +1 -1
- package/dist/preview/{chunk.ROGYDMES.js → chunk.2GGDOFTF.js} +1 -1
- package/dist/preview/chunk.2HF54MYG.js +1 -0
- package/dist/preview/{chunk.OE4QOBJF.js → chunk.2IX3CZNP.js} +1 -1
- package/dist/preview/chunk.2NSTEREJ.js +1 -0
- package/dist/preview/chunk.2RCNSHXK.js +1 -0
- package/dist/preview/chunk.37ASLBGE.js +1 -0
- package/dist/preview/{chunk.33GN2NUT.js → chunk.3ZNQ5YKX.js} +1 -1
- package/dist/preview/{chunk.EUGWV3S6.js → chunk.4BBJ62ZO.js} +1 -1
- package/dist/preview/chunk.4ECICQ2S.js +1 -0
- package/dist/preview/{chunk.B5ILKGEF.js → chunk.4PNFX3TX.js} +1 -1
- package/dist/preview/{chunk.WG5NIR23.js → chunk.546WEHEX.js} +1 -1
- package/dist/preview/chunk.57OPL5WD.js +1 -0
- package/dist/preview/{chunk.36SQJMEE.js → chunk.5JPRFXYQ.js} +1 -1
- package/dist/preview/chunk.5OJJ2TKZ.js +9 -0
- package/dist/preview/chunk.5R4E5C76.js +1 -0
- package/dist/preview/{chunk.7H5KVW2F.js → chunk.5XNVN4HE.js} +1 -1
- package/dist/preview/chunk.5ZMENPY4.js +5 -0
- package/dist/preview/{chunk.YPY5BOEI.js → chunk.67USHK26.js} +1 -1
- package/dist/preview/chunk.6CFP5UYP.js +1 -0
- package/dist/preview/{chunk.74RMHUCX.js → chunk.6DHHUBSC.js} +1 -1
- package/dist/preview/chunk.6HBEYRJU.js +1 -0
- package/dist/preview/chunk.6L7IDF3J.js +1 -0
- package/dist/preview/{chunk.ZRQI5VJF.js → chunk.6XU2CXRZ.js} +1 -1
- package/dist/preview/{chunk.2VIGF4FO.js → chunk.7EFNLMKU.js} +1 -1
- package/dist/preview/chunk.7WSXVXP3.js +1 -0
- package/dist/preview/chunk.ALDLAQ7V.js +1 -0
- package/dist/preview/chunk.AYHCQWSU.js +1 -0
- package/dist/preview/{chunk.QYRPELLU.js → chunk.B2IRADR2.js} +1 -1
- package/dist/preview/{chunk.V2NBJDAX.js → chunk.B7TB6YRZ.js} +1 -1
- package/dist/preview/chunk.BCHHBGM6.js +1 -0
- package/dist/preview/{chunk.LHO7L3CS.js → chunk.BEC5ZH2L.js} +1 -1
- package/dist/preview/chunk.BL4S3I2N.js +1 -0
- package/dist/preview/chunk.BS3FX4PX.js +1 -0
- package/dist/preview/chunk.BTSXYZ6Z.js +25 -0
- package/dist/preview/chunk.BYKR7NEE.js +1 -0
- package/dist/preview/chunk.BZSU4HH2.js +1 -0
- package/dist/preview/chunk.C2OAKTZX.js +1 -0
- package/dist/preview/chunk.C4CFYTCW.js +1 -0
- package/dist/preview/{chunk.6ONRWFA6.js → chunk.C6X7CKU6.js} +1 -1
- package/dist/preview/chunk.CAMQ7MYJ.js +1 -0
- package/dist/preview/{chunk.NPX7SPXM.js → chunk.CC47O2DW.js} +1 -1
- package/dist/preview/{chunk.ZLXPIEUC.js → chunk.CF7DHTKL.js} +2 -2
- package/dist/preview/{chunk.SGB6IMWN.js → chunk.CMN6VVK2.js} +1 -1
- package/dist/preview/chunk.CTK2P4JV.js +3 -0
- package/dist/preview/chunk.DAA7IDQ4.js +1 -0
- package/dist/preview/{chunk.6UCRL4OF.js → chunk.DYNBWIPF.js} +1 -1
- package/dist/preview/chunk.E3HXXUKY.js +1 -0
- package/dist/preview/{chunk.GZ3IXNA4.js → chunk.EBHKKOPO.js} +1 -1
- package/dist/preview/chunk.EDC4EMIX.js +1 -0
- package/dist/preview/chunk.EM4Y4YAD.js +2 -0
- package/dist/preview/{chunk.IEDXW36H.js → chunk.EWWJMS6G.js} +1 -1
- package/dist/preview/chunk.F5UVEF2R.js +1 -0
- package/dist/preview/{chunk.TKSGC6XH.js → chunk.FCXBCKED.js} +1 -1
- package/dist/preview/chunk.FGDHEVH4.js +1 -0
- package/dist/preview/{chunk.IM7LXLIB.js → chunk.FILCNVGH.js} +1 -1
- package/dist/preview/chunk.FJBQ4UP3.js +32 -0
- package/dist/preview/{chunk.RZVZG2BQ.js → chunk.FMN5XDLE.js} +1 -1
- package/dist/preview/chunk.G23VFYGF.js +88 -0
- package/dist/preview/chunk.G46WGK5E.js +1 -0
- package/dist/preview/chunk.GAFYE37S.js +3 -0
- package/dist/preview/{chunk.VNBR4DHD.js → chunk.GP2F7TIN.js} +1 -1
- package/dist/preview/chunk.GXKECZ4S.js +19 -0
- package/dist/preview/{chunk.3D5T3XIE.js → chunk.H5CZZZLX.js} +1 -1
- package/dist/preview/{chunk.V5ZT5NSJ.js → chunk.HA3PPIEQ.js} +1 -1
- package/dist/preview/chunk.HFDYFPMJ.js +1 -0
- package/dist/preview/chunk.HFYUAK5Z.js +6 -0
- package/dist/preview/chunk.HGS32FT2.js +1 -0
- package/dist/preview/chunk.HHUCPVG5.js +1 -0
- package/dist/preview/{chunk.LF7PU77M.js → chunk.I7CU2E3C.js} +1 -1
- package/dist/preview/{chunk.MCVY6RRS.js → chunk.IAZRY42B.js} +1 -1
- package/dist/preview/{chunk.5MSO3KRO.js → chunk.ITEF3U2E.js} +1 -1
- package/dist/preview/{chunk.AZCFXPEL.js → chunk.IXYBIDAN.js} +1 -1
- package/dist/preview/{chunk.FTJBW25J.js → chunk.J3M2MZHG.js} +1 -1
- package/dist/preview/{chunk.MVNUWK5Y.js → chunk.JBTU2PJ4.js} +1 -1
- package/dist/preview/chunk.JCR3ECUM.js +1 -0
- package/dist/preview/{chunk.JWJQ2VXS.js → chunk.JEZTPXEB.js} +1 -1
- package/dist/preview/chunk.KIJCOW25.js +1 -0
- package/dist/preview/{chunk.2EJAIT33.js → chunk.KJNUZYXS.js} +1 -1
- package/dist/preview/chunk.L7DQKPJV.js +117 -0
- package/dist/preview/{chunk.RVJYEOFN.js → chunk.LCYMYLOP.js} +1 -1
- package/dist/preview/chunk.LP2DJ5ZB.js +6 -0
- package/dist/preview/chunk.LP3QUPCE.js +1 -0
- package/dist/preview/chunk.M5QFUGGG.js +1 -0
- package/dist/preview/chunk.N2SV3KX7.js +1 -0
- package/dist/preview/chunk.N7N5OFPL.js +1 -0
- package/dist/preview/{chunk.WERYQENC.js → chunk.NG3YMQ36.js} +1 -1
- package/dist/preview/{chunk.MWZK3HVG.js → chunk.NSNGPQGT.js} +1 -1
- package/dist/preview/chunk.OJKS3UQS.js +1 -0
- package/dist/preview/{chunk.KNJZ2YNJ.js → chunk.OM5CDW2S.js} +1 -1
- package/dist/preview/{chunk.QT4XGC5Z.js → chunk.ORXFUK6F.js} +2 -2
- package/dist/preview/chunk.OXTUXWMU.js +1 -0
- package/dist/preview/chunk.OYMM2UWE.js +1 -0
- package/dist/preview/chunk.P3JYH6HO.js +1 -0
- package/dist/preview/{chunk.FMVWXSQ7.js → chunk.P4WYBSYA.js} +1 -1
- package/dist/preview/chunk.P5325GYR.js +1 -0
- package/dist/preview/chunk.PMER4LVT.js +1 -0
- package/dist/preview/chunk.PONWLTTB.js +1 -0
- package/dist/preview/chunk.PXQVXBNG.js +1 -0
- package/dist/preview/chunk.QCF6Z2AZ.js +1 -0
- package/dist/preview/chunk.QEXXLWEU.js +6 -0
- package/dist/preview/chunk.QMFUPTR4.js +1 -0
- package/dist/preview/{chunk.BUVAMSOZ.js → chunk.RM7NVN7B.js} +2 -2
- package/dist/preview/{chunk.YUJG5SN5.js → chunk.ROINZMNO.js} +1 -1
- package/dist/preview/chunk.ROKRQRID.js +35 -0
- package/dist/preview/chunk.RWB4235L.js +1 -0
- package/dist/preview/chunk.RXSHFG6S.js +1 -0
- package/dist/preview/chunk.SDO3U72B.js +1 -0
- package/dist/preview/chunk.SHNYYBNW.js +1 -0
- package/dist/preview/{chunk.L73VUBXN.js → chunk.SK33IHL2.js} +2 -2
- package/dist/preview/chunk.STBJV6HJ.js +1 -0
- package/dist/preview/chunk.TCUB6IDY.js +1 -0
- package/dist/preview/chunk.TJCTTJWE.js +1 -0
- package/dist/preview/{chunk.SZWX56WR.js → chunk.TU4KG22J.js} +2 -2
- package/dist/preview/chunk.U4E5GQTK.js +1 -0
- package/dist/preview/{chunk.Z3ZKYSPN.js → chunk.U7QMA4H7.js} +1 -1
- package/dist/preview/{chunk.UXIFQIHA.js → chunk.UB3O3QJQ.js} +1 -1
- package/dist/preview/{chunk.6XJP7F3I.js → chunk.UCZR33MK.js} +1 -1
- package/dist/preview/chunk.UGCNMAPC.js +1 -0
- package/dist/preview/{chunk.VKHKYK5L.js → chunk.UIUHGA6W.js} +1 -1
- package/dist/preview/chunk.VC4JPG7O.js +1 -0
- package/dist/preview/{chunk.DL637Q3W.js → chunk.W4OX4BMP.js} +1 -1
- package/dist/preview/chunk.WJQY4E45.js +1 -0
- package/dist/preview/{chunk.XHWL7QBF.js → chunk.WQPNGBR7.js} +1 -1
- package/dist/preview/chunk.WTZOOAIW.js +1 -0
- package/dist/preview/{chunk.FUJM7GDV.js → chunk.WXYUWBKX.js} +1 -1
- package/dist/preview/chunk.XBOZTQQA.js +1 -0
- package/dist/preview/{chunk.TOWYHWPB.js → chunk.XLI44BBI.js} +1 -1
- package/dist/preview/chunk.XLZ2QRRS.js +1 -0
- package/dist/preview/chunk.XQTMO5PW.js +1 -0
- package/dist/preview/chunk.YWVOACSX.js +5 -0
- package/dist/preview/{chunk.67WL7BGF.js → chunk.YXGI7H4Y.js} +1 -1
- package/dist/preview/{chunk.GR5Q4HTW.js → chunk.Z7JRBKA7.js} +1 -1
- package/dist/preview/chunk.ZR5KVYWZ.js +21 -0
- package/dist/preview/{chunk.6IHXTT6Z.js → chunk.ZTMDU3OH.js} +1 -1
- package/dist/preview/index.html +45 -43
- package/dist/preview/page.js +7 -7
- package/package.json +6 -6
- package/dist/preview/chunk.2HFRVWWM.js +0 -1
- package/dist/preview/chunk.3FW4QNGV.js +0 -1
- package/dist/preview/chunk.3RT2GUZ5.js +0 -1
- package/dist/preview/chunk.3ZRHHB7X.js +0 -1
- package/dist/preview/chunk.4DEUD66C.js +0 -6
- package/dist/preview/chunk.4EQSP7I3.js +0 -1
- package/dist/preview/chunk.4Y6BCHV2.js +0 -1
- package/dist/preview/chunk.5VBBQ6Z3.js +0 -1
- package/dist/preview/chunk.6CKBIY7L.js +0 -1
- package/dist/preview/chunk.7RSZMIAL.js +0 -1
- package/dist/preview/chunk.AFY35RJP.js +0 -1
- package/dist/preview/chunk.BRHRAVU2.js +0 -3
- package/dist/preview/chunk.DFVVS6C5.js +0 -1
- package/dist/preview/chunk.DQJAEU4V.js +0 -1
- package/dist/preview/chunk.ESSQAMPM.js +0 -1
- package/dist/preview/chunk.EV553KRT.js +0 -1
- package/dist/preview/chunk.EZP4FHDX.js +0 -35
- package/dist/preview/chunk.F6PIK2J2.js +0 -1
- package/dist/preview/chunk.FYIQZMVF.js +0 -1
- package/dist/preview/chunk.HUSFMFXH.js +0 -1
- package/dist/preview/chunk.HVTGPEVW.js +0 -1
- package/dist/preview/chunk.I3SQJ2L2.js +0 -1
- package/dist/preview/chunk.IU6ISXXC.js +0 -1
- package/dist/preview/chunk.K5KEECHL.js +0 -88
- package/dist/preview/chunk.L34FY7QQ.js +0 -1
- package/dist/preview/chunk.L7JKEEMM.js +0 -1
- package/dist/preview/chunk.LAW5PQEM.js +0 -1
- package/dist/preview/chunk.LDD3QX7G.js +0 -1
- package/dist/preview/chunk.LU5LSXSW.js +0 -1
- package/dist/preview/chunk.MQ7FNHXG.js +0 -25
- package/dist/preview/chunk.NH5TDAB2.js +0 -1
- package/dist/preview/chunk.NORRCKGN.js +0 -1
- package/dist/preview/chunk.NQQHOSOK.js +0 -1
- package/dist/preview/chunk.NWWMUOZM.js +0 -1
- package/dist/preview/chunk.OEF3GPRM.js +0 -1
- package/dist/preview/chunk.OS3L4ZOF.js +0 -2
- package/dist/preview/chunk.OTL3Z345.js +0 -1
- package/dist/preview/chunk.P3UPCI23.js +0 -1
- package/dist/preview/chunk.PGKIEDYV.js +0 -9
- package/dist/preview/chunk.PKUWET2F.js +0 -1
- package/dist/preview/chunk.POHEWJKZ.js +0 -1
- package/dist/preview/chunk.PUBG2L6F.js +0 -117
- package/dist/preview/chunk.QTTBZJ6W.js +0 -1
- package/dist/preview/chunk.RJDZOF2L.js +0 -1
- package/dist/preview/chunk.SGLJTSTD.js +0 -1
- package/dist/preview/chunk.SITFEJES.js +0 -1
- package/dist/preview/chunk.UF3L6FJO.js +0 -1
- package/dist/preview/chunk.VSYHU5MA.js +0 -1
- package/dist/preview/chunk.VTWFVPKD.js +0 -19
- package/dist/preview/chunk.VV4BPOIK.js +0 -1
- package/dist/preview/chunk.W2HCJQVK.js +0 -32
- package/dist/preview/chunk.WLPTY4BF.js +0 -5
- package/dist/preview/chunk.XM3NPZLP.js +0 -1
- package/dist/preview/chunk.YAXZNQY6.js +0 -1
- package/dist/preview/chunk.YG423NEB.js +0 -1
- package/dist/preview/chunk.YVR3ZMTV.js +0 -1
- package/dist/preview/chunk.YXH3IWNR.js +0 -1
- package/dist/preview/chunk.ZYCNEOAQ.js +0 -1
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{b as ae}from"./chunk.RJDZOF2L.js";import{a as Y,c as H,d as X,e as J}from"./chunk.AFY35RJP.js";import"./chunk.POHEWJKZ.js";import"./chunk.IEDXW36H.js";import"./chunk.7RSZMIAL.js";import"./chunk.ROGYDMES.js";import"./chunk.6IHXTT6Z.js";import"./chunk.OEF3GPRM.js";import"./chunk.UT6642FC.js";import"./chunk.TI4OSTQV.js";import"./chunk.GZHZLJBF.js";import"./chunk.I3SQJ2L2.js";import"./chunk.OJGHDWI6.js";import"./chunk.FUJM7GDV.js";import"./chunk.MWZK3HVG.js";import"./chunk.3D5T3XIE.js";import"./chunk.GR5Q4HTW.js";import"./chunk.QT4XGC5Z.js";import{$ as b,Ba as U,G as V,H as q,S as x,T as F,a as N,d as W,oa as z,xa as K,y as j}from"./chunk.MQ7FNHXG.js";import{Ua as _,ba as I,da as G,ga as B,ob as D}from"./chunk.WLPTY4BF.js";import{b as w}from"./chunk.AJZBJBMO.js";var re=w(q(),1);function P(e){return{minHeight:24,padding:"3px 10px",borderRadius:6,fontSize:"0.875rem",borderWidth:1,borderStyle:"solid",borderColor:e?"transparent":"var(--graview-edge)",color:e?"var(--graview-ink)":"var(--graview-ink-muted)",fontWeight:e?600:400,background:e?"color-mix(in srgb, var(--graview-accent) 16%, transparent)":"transparent"}}var M=w(x(),1);function Q(){let{seats:e,principal:t,takeSeat:i}=b();return e.length<2?null:(0,M.jsxs)("div",{role:"group","aria-label":"Seat","data-testid":"seats",style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:6,rowGap:4},children:[(0,M.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:"As"}),e.map(a=>{let l=ie(t,a.principal);return(0,M.jsx)("button",{type:"button","aria-pressed":l,"data-testid":`seat-${a.principal.id??a.label}`,title:`Sit down as ${a.label}: the acts, the kinds and the pages narrow to what this seat may do`,onClick:()=>i(a.principal),style:{...P(l),whiteSpace:"nowrap"},children:a.label},a.principal.id??a.label)})]})}function ie(e,t){return e.kind===t.kind&&e.id===t.id}var L=w(q(),1),c=w(x(),1),oe=`
|
|
2
|
-
.graview-here{display:flex;flex:none}
|
|
3
|
-
.graview-here>button{display:inline-flex;align-items:center;gap:4px;height:30px;margin:0;padding:0 4px;border:1px solid transparent;border-radius:8px;background:none;box-shadow:none;font:inherit;font-size:.75rem;color:var(--graview-ink-muted);cursor:pointer}
|
|
4
|
-
.graview-here-mark{display:inline-flex;align-items:center;justify-content:center;flex:none;box-sizing:border-box;width:24px;height:24px;border-radius:50%;border:1.5px solid hsl(var(--graview-hue) 50% 48%);background:var(--graview-panel-muted);color:var(--graview-ink);font-size:.75rem;font-weight:600;box-shadow:0 0 0 2px var(--graview-bar)}
|
|
5
|
-
.graview-here-mark+.graview-here-mark{margin-left:-10px}
|
|
6
|
-
.graview-here-mark[data-agent]{border-radius:5px}
|
|
7
|
-
.graview-here-mark[data-counted]{--graview-hue:0;border-color:var(--graview-edge)}
|
|
8
|
-
.graview-here small{display:block;font-size:.75rem;color:var(--graview-ink-muted)}
|
|
9
|
-
.graview-bar[data-finding] .graview-here{display:none}`,se={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)"};function le(e,t){let i=t.id===void 0?null:`${t.kind}:${t.id}`,a=new Map;for(let l of e.values()){let d=l.participant.slice(0,l.participant.lastIndexOf(":"));if(d===i)continue;let s=d.endsWith(":")?l.participant:d,o=a.get(s);(!o||o.at<l.at)&&a.set(s,l)}return[...a.values()]}var Z=e=>e.name&&e.onBehalfOfName?`${e.name}, for ${e.onBehalfOfName}`:e.name??"",ee=e=>e===1?"1 viewer":`${e} viewers`;function de(e){let t=e.map(Z).filter(Boolean),i=t.length<e.length?[...t,ee(e.length-t.length)]:t,a=i.pop();return`${i.length>0?`${i.join(", ")} and ${a}`:a} ${e.length===1?"is":"are"} here`}function pe(e,t){let{store:i,hidden:a,pictures:l}=t,d=W(e),s=i.kindsKeptFrom(t.principal),o=u=>!a.has(u)&&!s.has(u)&&!i.modules.disabledKinds.has(u),g=l.find(u=>u.as===d.within?.view&&o(u.kind));if(g)return g.title;if(!d.focusId)return d.overview?"the whole thing":null;let p=j(d.focusId);if(p.length>0)return p.every(o)?p.map(u=>B(i.schema,u)).join(" and "):null;let h=i.graph.getNode(d.focusId);return h&&o(h.kind)?I(i.schema.tryDefinition(h.kind),h):null}function ce(e,t){let i=o=>o.id!==void 0&&(o.id===t.principal.id||o.onBehalfOf?.id===t.principal.id),a=e.filter(o=>!D(o)&&o.author.kind!=="system"&&!i(o.author)),l=a[0];if(!l)return null;let d=_(l.author,{graph:t.store.graph,schema:t.store.schema,...t.seats?{seats:t.seats}:{},...t.people?{people:t.people}:{}}),s=[...new Set(a.map(o=>o.intent))].join("; ");return`${d}: ${s}`}function ue(e,t,i){let a=ce(e,t);a&&(i(""),setTimeout(()=>i(a),50))}function ge({scene:e,compact:t}){let{who:i,principal:a,store:l,views:d,hiddenKinds:s,follow:o}=b(),g=U("here"),p=le(i,a),h=p.length===0?"":de(p),[u,S]=(0,L.useState)("");if((0,L.useEffect)(()=>S(h),[h]),p.length===0)return null;let f=p.filter(r=>r.name),y=f.slice(0,t?2:3),m=p.length-y.length,k=p.length-f.length,T=d.places();return(0,c.jsxs)("div",{className:"graview-here","data-testid":"here",children:[(0,c.jsx)("style",{children:oe}),(0,c.jsx)("span",{role:"status","aria-live":"polite",style:se,children:u}),(0,c.jsxs)("button",{type:"button","data-testid":"here-open",...g.trigger,onClick:g.toggle,"aria-label":`${h} \u2014 who and where`,title:h,children:[y.length>0?(0,c.jsx)("span",{style:{display:"flex"},children:y.map(r=>(0,c.jsx)(E,{one:r},r.participant))}):(0,c.jsx)(E,{count:m}),y.length>0&&m>0?(0,c.jsxs)("span",{"aria-hidden":"true",children:["+",m]}):null]}),(0,c.jsxs)("ul",{...g.pane,"aria-label":"Who is here","data-testid":"here-list",hidden:!g.open,className:"graview-bar-list",style:K,children:[f.map(r=>{let v=pe(r.stop,{store:l,principal:a,hidden:s,pictures:T}),A=Z(r);return(0,c.jsx)("li",{children:(0,c.jsxs)(e?"button":"span",{className:"graview-bar-item","data-testid":"here-one",...e?{type:"button",title:`Go where ${A} is`,onClick:()=>{g.setOpen(!1),o(r.participant)}}:{style:{cursor:"default"}},children:[(0,c.jsx)(E,{one:r}),(0,c.jsxs)("span",{children:[A,v?(0,c.jsxs)("small",{children:["On ",v]}):null]})]})},r.participant)}),k>0?(0,c.jsx)("li",{children:(0,c.jsxs)("span",{className:"graview-bar-item","data-testid":"here-viewers",style:{cursor:"default"},children:[(0,c.jsx)(E,{count:k}),(0,c.jsxs)("span",{children:[ee(k),(0,c.jsx)("small",{children:"Not signed in"})]})]})}):null]})]})}function E({one:e,count:t}){return(0,c.jsx)("span",{className:"graview-here-mark","aria-hidden":"true",...e?{style:{"--graview-hue":Math.round(e.hue)}}:{"data-counted":""},...e?.kind==="agent"?{"data-agent":""}:{},children:e?(e.name??"").trim().charAt(0).toUpperCase():t})}function he(e){let t=/^(?:place|scene):([^:]+):(.+)$/.exec(e.key);return t?{place:t[2],about:[`aggregate:${t[1]}`],title:e.label}:{about:e.group==="lists"&&e.kind?[`aggregate:${e.kind}`]:[],title:e.label}}function O(e,t,i,a,l,d){let s=he(t),o=e.getBoundingClientRect(),g={...s,face:i?"scene":"pages",x:Math.round(l??o.left+Math.min(16,o.width/2)),y:Math.round(d??Math.min(o.bottom,o.top+36)),returnTo:e},p=i?null:e.closest("[data-graview-embed], [data-graview-shell]")?.querySelector("[data-graview-face='pages']")??document.querySelector("[data-graview-face='pages']");p?p.dispatchEvent(new CustomEvent(F,{detail:g})):a(g)}var R={on:null,at:0},te=500,me=10;function ye(e,t,i,a,l,d,s){let o=t.getAttribute("data-testid")??"",g=o==="app-places-open"?a:o.slice(10),p=i.find(m=>m.key===g);if(!p)return;if(e.type==="keydown")return R={on:t,at:Date.now()},O(t,p,l,d);let{clientX:h,clientY:u}=e;if(e.type==="contextmenu")return R.on===t&&Date.now()-R.at<700?void 0:h===0&&u===0?O(t,p,l,d):O(t,p,l,d,h,u);let S=Date.now()-Math.max(0,performance.now()-e.timeStamp),f=!1,y=m=>{Math.hypot(m.clientX-h,m.clientY-u)>me&&(f=!0)};document.addEventListener("pointermove",y),setTimeout(()=>{document.removeEventListener("pointermove",y),!(f||s.at!==0&&s.at-S<te)&&(R={on:t,at:Date.now()},t.addEventListener("click",m=>{m.preventDefault(),m.stopPropagation()},{capture:!0,once:!0}),O(t,p,l,d,h,u))},Math.max(0,te-(Date.now()-S)))}var n=w(x(),1),Ie=z(N(()=>(__graviewPreload(import.meta.url,["./chunk.QT4XGC5Z.js","./chunk.MQ7FNHXG.js","./chunk.WLPTY4BF.js","./chunk.AJZBJBMO.js"]),import("./chunk.LF7PU77M.js")))).part((e,t)=>(0,n.jsx)(e.TidyGroups,{...t}),{quiet:!0}),fe=z(N(()=>(__graviewPreload(import.meta.url,["./chunk.MQ7FNHXG.js","./chunk.WLPTY4BF.js","./chunk.AJZBJBMO.js"]),import("./chunk.DQJAEU4V.js")))).part((e,t)=>(0,n.jsx)(e.HoverChipsSwitch,{...t}),{quiet:!0});function Be({violations:e,pick:t}){let{store:i,brand:a,setMenuAt:l}=b(),d=Y(i,e);return(0,n.jsx)(n.Fragment,{children:d.map((s,o)=>{let g=J(s),p=s.repairs.length>0?`${s.repairs.length} ${s.repairs.length===1?"way":"ways"} to fix`:"";return(0,n.jsx)("li",{style:{borderTop:o===0?"none":"1px solid var(--graview-edge)"},children:(0,n.jsxs)("button",{type:"button",onClick:h=>{let u=h.currentTarget.closest("ol").getBoundingClientRect();t(s),l({x:u.left,y:u.top,on:s.subjectId})},...H(s)!==void 0?{title:H(s)}:{},style:{width:"100%",textAlign:"left",fontSize:"0.8125rem",lineHeight:1.4,padding:"7px 8px",border:"1px solid transparent",background:"none",boxShadow:"none",borderRadius:7},children:[s.line?(0,n.jsx)(X,{line:s.line,schema:i.schema,...a?{brand:a}:{},stacked:!0,style:{display:"block",color:"var(--graview-ink)"}}):(0,n.jsx)("span",{style:{display:"block",color:"var(--graview-ink)"},children:s.message}),g||p?(0,n.jsx)("span",{style:{color:"var(--graview-ink-faint)",fontSize:"0.75rem"},children:[g,p].filter(Boolean).join(" \xB7 ")}):null]})},`${s.invariant}:${o}`)})})}function _e({name:e,me:t,scheme:i,onScheme:a,profileHref:l,hostActions:d,close:s,part:o,signature:g=!1}){let{principal:p,seats:h,settings:u,settingValues:S,chooseSetting:f,sharing:y,ai:m}=b(),k=p.roles??[],T={setOpen:r=>s()};return(0,n.jsx)(n.Fragment,{children:o==="top"?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{style:{display:"grid",gap:3},children:[(0,n.jsx)("span",{style:$,children:"Signed in as"}),(0,n.jsx)("strong",{style:{fontSize:"1rem",fontWeight:550},children:e}),(0,n.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:k.length>0?k.map(r=>G(r)).join(", "):t===void 0?"This app has no sign-in; everything here is yours.":"No role in particular"}),t!==void 0&&l!==void 0?(0,n.jsx)("a",{href:l(t.id),"data-testid":"profile-record",style:{display:"inline-flex",alignItems:"center",minHeight:24,justifySelf:"start",fontSize:"0.875rem",color:"var(--graview-accent)"},children:"Your record \u2197"}):null,y?(0,n.jsxs)("span",{"data-testid":"profile-seen-as",style:{fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:["Seen by others as ",y.name]}):null]}),d.length>0?(0,n.jsx)("ul",{role:"list","aria-label":"From the host","data-testid":"host-actions",style:{...C,margin:0,paddingLeft:0,listStyle:"none",display:"grid",gap:2},children:d.map(r=>(0,n.jsx)("li",{children:r.href!==void 0?(0,n.jsx)("a",{href:r.href,"data-testid":"host-action",className:"graview-host-action",...r.target?{target:r.target,rel:"noopener"}:{},onClick:()=>{r.onSelect?.(),T.setOpen(!1)},style:ne,children:r.label}):(0,n.jsx)("button",{type:"button","data-testid":"host-action",className:"graview-host-action",onClick:()=>{T.setOpen(!1),r.onSelect?.()},style:{...ne,width:"100%",textAlign:"left",border:"none",background:"none",boxShadow:"none",font:"inherit",cursor:"pointer"},children:r.label})},r.label))}):null]}):(0,n.jsxs)(n.Fragment,{children:[h.length>1?(0,n.jsxs)("div",{style:{display:"grid",gap:6,...C},children:[(0,n.jsx)("span",{style:$,children:"Sit as somebody else"}),(0,n.jsx)(Q,{})]}):null,u.length>0?(0,n.jsx)("div",{style:{display:"grid",gap:10,...C},children:u.map(r=>(0,n.jsxs)("fieldset",{"data-testid":`setting-${r.name}`,style:{border:0,margin:0,padding:0,display:"grid",gap:5},children:[(0,n.jsx)("legend",{style:{...$,padding:0},children:r.title}),r.description?(0,n.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:r.description}):null,(0,n.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:r.options.map(v=>{let A=(S[r.name]??r.initial)===v.value;return(0,n.jsx)("button",{type:"button","aria-pressed":A,"data-testid":`setting-${r.name}-${v.value}`,onClick:()=>f(r.name,v.value),style:P(A),children:v.label},v.value)})})]},r.name))}):null,V(m)?(0,n.jsx)(re.Suspense,{fallback:null,children:(0,n.jsx)(fe,{legend:$,style:C,choice:P})}):null,i!==void 0&&a!==void 0?(0,n.jsxs)("div",{style:{display:"grid",gap:5,...C},children:[(0,n.jsx)("span",{style:$,children:"Scheme"}),(0,n.jsx)("div",{style:{display:"flex",gap:4},children:["light","dark"].map(r=>(0,n.jsx)("button",{type:"button","aria-pressed":i===r,"data-testid":`profile-scheme-${r}`,onClick:()=>a(r),style:P(i===r),children:r==="light"?"\u2600 Light":"\u263E Dark"},r))})]}):null,g?(0,n.jsxs)("p",{"data-testid":"graview-signature",style:{...C,margin:0,display:"flex",alignItems:"center",gap:6,fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:["Built with",(0,n.jsxs)("a",{href:"https://graview.dev",target:"_blank",rel:"noopener",style:{display:"inline-flex",alignItems:"center",gap:4,minHeight:24,color:"var(--graview-ink-muted)",fontWeight:600,textDecoration:"none"},children:[(0,n.jsx)("span",{"data-testid":"graview-mark",style:{display:"inline-flex",lineHeight:0},dangerouslySetInnerHTML:{__html:ve}}),"Graview"]})]}):null]})})}var ve='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="14" height="14" aria-hidden="true" focusable="false"><g fill="none" stroke="currentColor" stroke-width="2.4" stroke-linejoin="round"><path d="M13 11 L3 8 L14 3 H29 L21 9"/><path d="M10 18 L3 23 L16.5 28 L29 21 L22 19"/><path d="M16.5 18.5 V23.5" stroke-linecap="round"/></g><circle cx="16.5" cy="13.5" r="2" fill="var(--graview-mark-point, currentColor)"/></svg>',ne={display:"flex",alignItems:"center",minHeight:28,padding:"2px 8px",borderRadius:7,fontSize:"0.875rem",color:"var(--graview-ink)",textDecoration:"none"},$={fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},C={paddingTop:10,borderTop:"1px solid var(--graview-edge)"};export{ae as ActivityRail,ge as Here,Be as ProblemRows,_e as ProfilePane,Ie as TidyFoot,ye as placeGesture,ue as sayTheirChange};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as I,c as x}from"./chunk.36SQJMEE.js";import"./chunk.QT4XGC5Z.js";import{c as b,d as A,k as v,r as w,t as O,w as G}from"./chunk.MQ7FNHXG.js";import{Qc as k,ed as E,kd as S,ld as W}from"./chunk.WLPTY4BF.js";import"./chunk.AJZBJBMO.js";var F=(e,i)=>k(e,i).slice(1);function j(e,i){let l=e.split("/").filter(Boolean);return l.length===i.length&&l.every((s,h)=>s.startsWith(":")||s==="*"||s===i[h])}var $=["problems","search","map","places"];function R(e,i,l,s,h=[]){let{schema:r}=i,o=r.kinds,f=t=>{if(t.startsWith(w))return(t.slice(w.length).split("|")[0]??"").split("+").every(V=>o.includes(V));let y=O(t);return y!==null?o.includes(y):t.startsWith("edge:")||l.graph.getNode(t)!==void 0},[p="/",u]=e.path.split("?"),n=p.split("/").filter(Boolean),m=u?`?${u}`:"",d=n.length>0&&!$.includes(n[0])?o.find(t=>F(r,t)===n[0]):void 0,c=e.path;if(n[0]==="places"&&n.length===2)`/places/${n[1]}`!==E&&!s.some(t=>t.as===decodeURIComponent(n[1]))&&(c="/");else if(d){let t=n[1]===void 0?void 0:decodeURIComponent(n[1]);c=`/${F(r,d)}${t!==void 0&&l.graph.getNode(t)?.kind===d?`/${n[1]}`:""}${m}`}else n.length>0&&n.length<=2&&!$.includes(n[0])&&!h.some(t=>j(t.path,n))&&(c="/");let g=A(e.stop),P=g.within?.view,U=P!==void 0&&!s.some(t=>t.as===P),a=g;if(U){let{view:t,...y}=g.within??{};a={...a,within:y}}if(g.focusId&&!f(g.focusId)){let t=e.kind&&o.includes(e.kind)?G(e.kind):null;a={...v(a,t),zoom:!1}}return a={...a,relation:a.relation&&(o.includes(a.relation)||r.edgeKinds.includes(a.relation))?a.relation:null,expanded:a.expanded.filter(f),pins:Object.fromEntries(Object.entries(a.pins).filter(([t])=>f(t))),...a.selection?{selection:a.selection.filter(f)}:{}},{face:e.face,path:c,stop:b(a),...e.kind?{kind:e.kind}:{}}}function B(e,i,l){let s=e.at,h=e.pages?.routes()??[];if(e.routing!=="address"||typeof window>"u")return R(s,e.app,i,l,h);let{pathname:r,search:o,hash:f}=window.location,p=W(r,e.basePath),u=I({routing:"address",...e.basePath===void 0?{}:{basePath:e.basePath},face:s.face}),n=u==="pages",m={...s,face:u,...p===null?{}:n?{path:p+o}:{stop:x(e.basePath)??s.stop}},d=R(m,e.app,i,l,h),c=n?d.path===m.path?null:S(d.path,e.basePath===void 0?{}:{basePath:e.basePath}):d.stop===b(A(m.stop))?null:r+o+d.stop;return p!==null&&c!==null&&c!==r+o+f&&window.history.replaceState(window.history.state,"",c),d}export{R as settle,B as settleAt};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{s as P}from"./chunk.I3SQJ2L2.js";import{$ as m,H as M,P as w,S as y,a as p,aa as I,oa as S,t as b,x as T,y as A}from"./chunk.MQ7FNHXG.js";import{b as f}from"./chunk.AJZBJBMO.js";var C=f(M(),1),h=f(y(),1),x=S(p(()=>(__graviewPreload(import.meta.url,["./chunk.QT4XGC5Z.js","./chunk.MQ7FNHXG.js","./chunk.WLPTY4BF.js","./chunk.AJZBJBMO.js"]),import("./chunk.LAW5PQEM.js")))),O=x.part((e,n)=>(0,h.jsx)(e.Timeline,{...n}),{what:"The timeline"}),q=()=>x.prefetch();function K({face:e}){return w()?.open?(0,h.jsx)(C.Suspense,{fallback:null,children:(0,h.jsx)(O,{face:e})}):null}var i=f(M(),1),u=f(y(),1),v=new WeakMap,D=e=>{let n=v.get(e);return n||v.set(e,n={ask:null,doors:[],listeners:new Set}),n},k=e=>{for(let n of e.listeners)n()};function g(e,n){let t=D(e);t.ask=n,k(t)}var N=S(p(()=>(__graviewPreload(import.meta.url,["./chunk.SGB6IMWN.js","./chunk.NPX7SPXM.js","./chunk.OE4QOBJF.js","./chunk.74RMHUCX.js","./chunk.QT4XGC5Z.js","./chunk.MQ7FNHXG.js","./chunk.WLPTY4BF.js","./chunk.AJZBJBMO.js"]),import("./chunk.L7JKEEMM.js")))),B=N.part((e,n)=>{let t=e.NotifySheet;return(0,u.jsx)(t,{...n})},{what:"Notify me"}),W=N.part((e,n)=>{let t=e.NotifiedList;return(0,u.jsx)(t,{...n})},{quiet:!0}),E=(e,n)=>n===void 0&&(e.onBehalfOf??e).id!==void 0;function F(e,n,t){let c=d=>t.tryDefinition(d)?.noun??d.replace(/[-_]+/g," "),o=e.on!==void 0?e.on:e.about.length===1?e.about[0]:void 0;if(e.act!==void 0){let d=o!==void 0&&n(o)!==void 0?o:void 0;return{label:"Notify me when someone does this\u2026",choices:[{on:"act",act:e.act,...d!==void 0?{record:d}:{}},...d!==void 0?[{on:"act",act:e.act}]:[]]}}if(o===void 0)return null;let s=n(o);if(s!==void 0)return{label:"Notify me when this changes\u2026",choices:[{on:"changed",record:o},{on:"act",record:o},{on:"reaches",kind:s,condition:"",record:o}]};let r=b(o)!==null?[b(o)]:T(o)?A(o):[];if(r.length!==1||!t.kinds.includes(r[0]))return null;let l=r[0],a=c(l);return{label:`Notify me when ${/^[aeiou]/i.test(a)?"an":"a"} ${a} is added\u2026`,choices:[{on:"created",kind:l},{on:"changed",kind:l},{on:"reaches",kind:l,condition:""}]}}function L(){let{store:e,principal:n,subscriptions:t,signIn:c}=m(),o=E(n,c);return(0,i.useMemo)(()=>o?s=>{let r=F(s,a=>e.graph.getNode(a)?.kind,e.schema);return r?{id:"notify",items:[{id:"notify-me",label:r.label,run:()=>g(t,{choices:r.choices,returnTo:s.element??null})}],prepare:()=>N.prefetch()}:null}:null,[o,e,t])}var z=[];function U({children:e}){let n=L(),t=(0,i.useMemo)(()=>n?[n]:z,[n]);return(0,u.jsx)(P,{sections:t,children:e})}function V(){let{subscriptions:e}=m(),n=(0,i.useId)(),t=D(e);(0,i.useEffect)(()=>(t.doors.push(n),k(t),()=>{t.doors.splice(t.doors.indexOf(n),1),k(t)}),[t,n]);let c=(0,i.useMemo)(()=>r=>(t.listeners.add(r),()=>void t.listeners.delete(r)),[t]),o=(0,i.useSyncExternalStore)(c,()=>t.ask,()=>null),s=(0,i.useSyncExternalStore)(c,()=>t.doors[0]===n,()=>!1);return!o||!s?null:(0,u.jsx)(i.Suspense,{fallback:null,children:(0,u.jsx)(B,{ask:o,close:()=>g(e,null)})})}function X({choices:e,label:n="Notify me",style:t,className:c,testId:o="notify-me"}){let{principal:s,subscriptions:r,signIn:l}=m();return E(s,l)?(0,u.jsx)("button",{type:"button","data-testid":o,className:c,onClick:a=>g(r,{choices:e,returnTo:a.currentTarget}),style:t,children:n}):null}function G(){let e=I(),n=e?.subscriptions,t=e?(e.principal.onBehalfOf??e.principal).id:void 0,[c,o]=(0,i.useState)(0);return(0,i.useEffect)(()=>{if(t===void 0||!n)return;let s=!0,r=()=>void Promise.resolve(n.list(t)).then(a=>s&&o(a.length),()=>s&&o(0));r();let l=n.onChange?.(r);return()=>{s=!1,l?.()}},[n,t]),c}function Y({style:e}){return G()===0?null:(0,u.jsx)(i.Suspense,{fallback:null,children:(0,u.jsx)(W,{...e?{style:e}:{}})})}export{q as a,K as b,L as c,U as d,V as e,X as f,G as g,Y as h};
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{A as Zr,B as Pe,C as Ln,D as We,E as Ve,F as Xr,G as Tn,H as Re,I as Jr,J as ei,K as F,L as dt,M as Mn,N as ti,O as En,P as Gt,Q as ni,R as ne,S as re,T as Nn,a as Y,b as Ee,c as Z,d as jr,e as Cn,f as Rn,g as lt,h as J,i as ke,j as ae,k as C,l as ee,m as K,n as Se,o as Ht,p as xe,q as fe,r as _r,s as yt,t as Kt,u as Q,v as Ge,w as Yr,x as Bt,y as Ce,z as Qr}from"./chunk.WG5NIR23.js";import{b as zr,c as qt,e as te}from"./chunk.3ZRHHB7X.js";import{a as Gr,d as Vr,e as Ur}from"./chunk.UGFDSE37.js";import{a as Dr,c as Wr,f as Hr,g as Kr,i as Br,j as qr}from"./chunk.ZYCNEOAQ.js";import{a as Lr,b as Tr,c as Mr,d as An}from"./chunk.4DEUD66C.js";import{b as Rr}from"./chunk.LHO7L3CS.js";import{a as Er,b as Nr,d as Dt,e as $r,f as Or,i as Wt}from"./chunk.YG423NEB.js";import{a as Tt,b as Da,c as Wa,d as Mt,e as Ha}from"./chunk.AFY35RJP.js";import{b as Qa,c as ir,e as or,f as kn}from"./chunk.POHEWJKZ.js";import{a as Ft,b as It,c as Pr,e as Ar}from"./chunk.YXH3IWNR.js";import{a as qe,b as er,c as tr,d as nr,e as ar,f as rr}from"./chunk.OEF3GPRM.js";import{m as Cr}from"./chunk.VTWFVPKD.js";import{a as pr,b as ur,c as gr,e as xr,f as Pn,h as Ot}from"./chunk.33GN2NUT.js";import{d as yr,e as hr,f as wr,g as vr,n as br,o as kr,q as Sr,s as $t}from"./chunk.2VIGF4FO.js";import{a as Sn}from"./chunk.FTJBW25J.js";import{a as vn,b as _a,c as Ya}from"./chunk.UT6642FC.js";import{a as Nt,b as sr,c as lr,d as dr,e as cr}from"./chunk.RZVZG2BQ.js";import{c as Za,d as Xa,j as ft}from"./chunk.2EJAIT33.js";import{r as bn,s as Ja}from"./chunk.I3SQJ2L2.js";import{f as Ga,g as st,i as Va,j as Ua,k as wn,q as ja,r as za}from"./chunk.MWZK3HVG.js";import{b as Et,c as Ka,d as Ba,e as qa}from"./chunk.3D5T3XIE.js";import{C as xn,K as Fr,N as Ir,e as Fa,f as Ia,j as qi,u as mr,v as fr}from"./chunk.QT4XGC5Z.js";import{$ as Ta,H as Fe,M as Pa,O as Aa,R as Ca,S as j,T as hn,W as Ra,X as La,a as Sa,aa as de,da as Ma,ea as Ea,ga as Na,ka as ot,la as $a,s as xa,w as Oe,wa as Oa}from"./chunk.MQ7FNHXG.js";import{I as oa,Oc as fn,Rb as ma,T as mt,Tc as wa,Ub as fa,Uc as va,Va as pa,Vb as ya,Wc as Lt,Xa as ua,aa as rt,ba as me,da as be,dd as yn,ea as Ct,ed as ba,fb as mn,ga as it,gb as ga,ia as sa,id as ka,ja as la,ka as Be,ob as Rt,pc as ha,ua as da,va as ca}from"./chunk.WLPTY4BF.js";import{b as D}from"./chunk.AJZBJBMO.js";function ai(t,e,n={}){let a=t.graph.getNode(e);if(!a)return;let r=t.schema.tryDefinition(a.kind),i=l=>me(t.schema.tryDefinition(l.kind),l),o=new Map;for(let l of t.graph.allEdges()){let d=l.from===e?"out":l.to===e?"in":null;if(!d)continue;let c=d==="out"?l.to:l.from,p=t.graph.getNode(c);if(!p)continue;let f=(d==="out"?r:t.schema.tryDefinition(p.kind))?.edges?.[l.kind],u=d==="in"?f?.inverse??f?.description:f?.description,k=`${l.kind}|${d}|${u??""}`;(o.get(k)??(()=>{let h={edgeKind:l.kind,direction:d,...u?{description:u}:{},targets:[]};return o.set(k,h),h})()).targets.push({id:p.id,kind:p.kind,label:i(p)})}return{id:e,kind:a.kind,label:i(a),fields:Ba(ft(t.schema,t.graph,a),r),violations:mn(t.violations(n.context),[e]),actions:Sn(t,[e],{focus:e,...n.principal?{principal:n.principal}:{},...n.context?{context:n.context}:{}}),links:[...o.values()].map(l=>{let d=Et(l.targets.flatMap(c=>{let p=t.graph.getNode(c.id);return p?[p]:[]}),c=>t.schema.tryDefinition(c));return{...l,targets:[...l.targets].map(c=>d.has(c.id)?{...c,apart:d.get(c.id)}:c).sort((c,p)=>c.label.localeCompare(p.label))}})}}function ze(t,e,n={}){return{kind:e,members:t.graph.nodesOfKind(e),actions:Sn(t,[],{kindSelection:[e],...n.principal?{principal:n.principal}:{},...n.context?{context:n.context}:{}})}}function ri(t,e){let n=(i,o)=>`${i}|${JSON.stringify(o)}`,a=new Map;for(let i of[...t.affordances,...t.withheld]){if(i.provider!=="invariant")continue;let o=n(i.mutation,i.args);a.has(o)||a.set(o,i.rank??Number.MAX_SAFE_INTEGER)}let r=Number.MAX_SAFE_INTEGER;return[...e].map((i,o)=>({repair:i,declared:o})).sort((i,o)=>(a.get(n(i.repair.mutation,i.repair.args??{}))??r)-(a.get(n(o.repair.mutation,o.repair.args??{}))??r)||i.declared-o.declared).map(i=>i.repair)}function _e(t){let e=t.schema.kinds.map(r=>({kind:r,plural:it(t.schema,r),count:t.graph.nodesOfKind(r).length})),n=new Map;for(let r of t.graph.allEdges()){let i=t.graph.getNode(r.from),o=t.graph.getNode(r.to);if(!i||!o)continue;let l=`${r.kind}|${i.kind}|${o.kind}`;n.set(l,(n.get(l)??0)+1)}let a=[];for(let{kind:r}of e){let i=t.schema.tryDefinition(r)?.edges??{};for(let[o,l]of Object.entries(i)){let d=l.to==="*"||l.to===void 0?(()=>{let c=[...n.keys()].filter(p=>p.startsWith(`${o}|${r}|`)).map(p=>p.split("|")[2]);return c.length>0?c:["*"]})():l.to;for(let c of d)a.push({edgeKind:o,from:r,to:c,...l.description?{description:l.description}:{},...l.inverse?{inverse:l.inverse}:{},count:n.get(`${o}|${r}|${c}`)??0})}}return{kinds:e,relations:a}}var He=D(Fe(),1);var Ye=D(Fe(),1),x=D(j(),1),Gi=`
|
|
2
|
-
form:where([data-graview-part="form"]) {
|
|
3
|
-
/* A grid item of the section above it and a grid container for the
|
|
4
|
-
fields below: both halves are allowed to be narrower than what is in
|
|
5
|
-
them, or a big enough text size pushes the page sideways. See the note
|
|
6
|
-
on \`column\` in pages.tsx. */
|
|
7
|
-
display: grid;
|
|
8
|
-
grid-template-columns: minmax(0, 1fr);
|
|
9
|
-
min-width: 0;
|
|
10
|
-
gap: 12px;
|
|
11
|
-
}
|
|
12
|
-
label:where([data-graview-part="field"]),
|
|
13
|
-
div:where([data-graview-part="field"][data-graview-field="date"]) {
|
|
14
|
-
display: grid;
|
|
15
|
-
/* A track the width it was given: see the note on \`column\` in pages.tsx. */
|
|
16
|
-
grid-template-columns: minmax(0, 1fr);
|
|
17
|
-
min-width: 0;
|
|
18
|
-
gap: 4px;
|
|
19
|
-
}
|
|
20
|
-
label:where([data-graview-part="field"][data-graview-field="boolean"]) {
|
|
21
|
-
grid-auto-flow: column;
|
|
22
|
-
justify-content: start;
|
|
23
|
-
align-items: center;
|
|
24
|
-
}
|
|
25
|
-
span:where([data-graview-part="label"]),
|
|
26
|
-
legend:where([data-graview-part="label"]),
|
|
27
|
-
p:where([data-graview-part="unasked"]) {
|
|
28
|
-
font-size: 0.8125rem;
|
|
29
|
-
color: var(--graview-ink-muted);
|
|
30
|
-
}
|
|
31
|
-
p:where([data-graview-part="unasked"]) { margin: 0; }
|
|
32
|
-
input:where([data-graview-part="control"]:not([type="checkbox"])),
|
|
33
|
-
select:where([data-graview-part="control"]) {
|
|
34
|
-
font: inherit;
|
|
35
|
-
/* A TARGET IN EVERY ENGINE, not only in the one it was measured in.
|
|
36
|
-
Padding and line height alone came to 24 in Chromium and to 22 in
|
|
37
|
-
WebKit, which has its own intrinsic metrics for a \`select\` and rounds
|
|
38
|
-
nothing up for anybody. So every picker on the routed face was under
|
|
39
|
-
the WCAG 2.2 minimum in the browser iOS ships, and the check that says
|
|
40
|
-
so (\`verify-pages\`' \`bigEnoughToHit\`) only ever ran there through
|
|
41
|
-
\`pnpm engines\`. */
|
|
42
|
-
min-height: 24px;
|
|
43
|
-
/* NEVER WIDER THAN ITS FIELD. A select is as wide as its longest option,
|
|
44
|
-
and a picker over 320 vehicles ("2027 Mercedes-Benz GLE AMG 53 4MATIC+
|
|
45
|
-
Coupe") was 618 pixels on a 390 phone, and the whole page scrolled
|
|
46
|
-
sideways. It shrinks to its track and cuts the option inside its box. */
|
|
47
|
-
min-width: 0;
|
|
48
|
-
max-width: 100%;
|
|
49
|
-
text-overflow: ellipsis;
|
|
50
|
-
box-sizing: border-box;
|
|
51
|
-
padding: 7px 10px;
|
|
52
|
-
border-radius: 8px;
|
|
53
|
-
border: 1px solid var(--graview-edge);
|
|
54
|
-
background: var(--graview-panel);
|
|
55
|
-
color: var(--graview-ink);
|
|
56
|
-
}
|
|
57
|
-
/* A PICKER THAT STILL LOOKS LIKE ONE.
|
|
58
|
-
WebKit ignores an author's padding and minimum height on a \`select\`
|
|
59
|
-
while the native appearance is on \u2014 so every picker on the routed face
|
|
60
|
-
came out 22 pixels tall in the browser iOS ships, under the 24 WCAG 2.2
|
|
61
|
-
asks for, while the same element measured 35 in Chromium. Turning the
|
|
62
|
-
appearance off is what makes the box the size it was asked to be, and it
|
|
63
|
-
takes the platform's chevron with it; the chevron is put back, in the ink
|
|
64
|
-
the scheme is already using. */
|
|
65
|
-
span:where([data-graview-part="picker"]) {
|
|
66
|
-
position: relative;
|
|
67
|
-
display: grid;
|
|
68
|
-
min-width: 0;
|
|
69
|
-
}
|
|
70
|
-
span:where([data-graview-part="picker"]) > select:where([data-graview-part="control"]) {
|
|
71
|
-
appearance: none;
|
|
72
|
-
padding-right: 28px;
|
|
73
|
-
}
|
|
74
|
-
span:where([data-graview-part="chevron"]) {
|
|
75
|
-
position: absolute;
|
|
76
|
-
right: 10px;
|
|
77
|
-
top: 50%;
|
|
78
|
-
transform: translateY(-50%);
|
|
79
|
-
font-size: 0.75rem;
|
|
80
|
-
line-height: 1;
|
|
81
|
-
color: var(--graview-ink-muted);
|
|
82
|
-
pointer-events: none;
|
|
83
|
-
}
|
|
84
|
-
fieldset:where([data-graview-part="group"]) {
|
|
85
|
-
display: grid;
|
|
86
|
-
gap: 10px;
|
|
87
|
-
border: 1px solid var(--graview-edge);
|
|
88
|
-
border-radius: 10px;
|
|
89
|
-
padding: 12px;
|
|
90
|
-
}
|
|
91
|
-
fieldset:where([data-graview-part="group"][data-graview-field="list"]) { gap: 8px; }
|
|
92
|
-
div:where([data-graview-part="item"]) {
|
|
93
|
-
display: flex;
|
|
94
|
-
gap: 8px;
|
|
95
|
-
align-items: end;
|
|
96
|
-
}
|
|
97
|
-
button:where([data-graview-part="add"]),
|
|
98
|
-
button:where([data-graview-part="submit"]) { justify-self: start; }
|
|
99
|
-
p:where([data-graview-part="refused"]) {
|
|
100
|
-
margin: 0;
|
|
101
|
-
color: var(--graview-warn);
|
|
102
|
-
font-size: 0.875rem;
|
|
103
|
-
}
|
|
104
|
-
`;function Vi({title:t,name:e,optional:n,amount:a,value:r,onChange:i}){let o=Va(a),[l,d]=(0,Ye.useState)(()=>typeof r=="number"?Ua(r,a):""),c=l.trim()!==""&&wn(l,a)===void 0;return(0,x.jsxs)("label",{"data-graview-part":"field","data-graview-field":"number","data-graview-amount":a.format??"unit",children:[(0,x.jsx)("span",{"data-graview-part":"label",children:t}),(0,x.jsxs)("span",{"data-graview-part":"amount",style:{display:"flex",alignItems:"center",gap:6},children:[o.prefix?(0,x.jsx)("span",{"data-graview-part":"amount-symbol","aria-hidden":"true",children:o.prefix}):null,(0,x.jsx)("input",{type:"text",inputMode:"decimal",name:e,required:!n,placeholder:o.placeholder,title:o.hint,"aria-invalid":c||void 0,value:l,onChange:p=>{d(p.target.value),i(wn(p.target.value,a))},"data-graview-part":"control",style:{flex:1,minWidth:0}}),o.suffix?(0,x.jsx)("span",{"data-graview-part":"amount-symbol","aria-hidden":"true",children:o.suffix}):null]}),c?(0,x.jsxs)("span",{"data-graview-part":"hint",role:"status",children:["Not an amount ",o.hint,": write it like ",o.prefix??"",o.placeholder,o.suffix?` ${o.suffix}`:""]}):null]})}function ii({children:t}){return(0,x.jsxs)("span",{"data-graview-part":"picker",children:[t,(0,x.jsx)("span",{"aria-hidden":"true","data-graview-part":"chevron",children:"\u25BE"})]})}var Ui=t=>({label:be(t),option:e=>e}),ji={phone:"+1 555 123 4567",place:"An address or a place's name",duration:"1h 30m, 90 or 1:30"};function Vt({store:t,spec:e,value:n,onChange:a,prefilled:r,open:i,words:o=Ui,values:l}){if(e.name in r&&e.control!=="group"&&e.control!=="variant")return null;let d=e.control==="node"&&!e.kinds.includes("*")?e.kinds.map(m=>be(Be(t.schema.tryDefinition(m),m))).join(" or "):o(e.name).label,c=!(e.optional||e.control==="boolean"),p=c?(0,x.jsxs)(x.Fragment,{children:[d,(0,x.jsx)("span",{"aria-hidden":"true",children:" *"})]}):d;switch(e.control){case"text":case"date":return e.control==="text"&&e.long?(0,x.jsxs)("label",{"data-graview-part":"field","data-graview-field":"text",children:[(0,x.jsxs)("span",{"data-graview-part":"label",children:[p,e.markdown?(0,x.jsx)("span",{style:{fontWeight:"normal",color:"var(--graview-ink-faint)"},children:" \xB7 Markdown"}):null]}),(0,x.jsx)("textarea",{name:e.name,required:!e.optional,rows:6,value:typeof n=="string"?n:"",onChange:m=>a(m.target.value),"data-graview-part":"control",style:{fieldSizing:"content",minHeight:"7.5em",resize:"vertical",font:"inherit",lineHeight:1.5}})]}):e.control==="date"?(0,x.jsxs)("div",{"data-graview-part":"field","data-graview-field":"date",children:[(0,x.jsx)("span",{"data-graview-part":"label",children:p}),(0,x.jsx)(rr,{name:e.name,label:o(e.name).label,required:!e.optional,value:typeof n=="string"&&n!==""?n:void 0,time:e.time===!0,instant:e.instant===!0,onChange:a})]}):(0,x.jsxs)("label",{"data-graview-part":"field","data-graview-field":e.control==="text"&&e.holds?e.holds:e.control,children:[(0,x.jsx)("span",{"data-graview-part":"label",children:p}),(0,x.jsx)("input",{type:e.control==="text"&&e.holds==="phone"?"tel":"text",name:e.name,required:!e.optional,...e.control==="text"&&e.app?{placeholder:"@owner/app or https://\u2026"}:{},...e.control==="text"&&e.holds?{placeholder:ji[e.holds]}:{},...e.control==="text"&&e.holds==="phone"?{autoComplete:"tel"}:{},value:typeof n=="string"?n:typeof n=="number"?String(n):"",onChange:m=>a(m.target.value),"data-graview-part":"control"})]});case"number":return e.amount?(0,x.jsx)(Vi,{title:p,name:e.name,optional:e.optional,amount:e.amount,value:n,onChange:a}):(0,x.jsxs)("label",{"data-graview-part":"field","data-graview-field":e.control,children:[(0,x.jsx)("span",{"data-graview-part":"label",children:p}),(0,x.jsx)("input",{type:"number",name:e.name,required:!e.optional,...e.min===void 0?{}:{min:e.min},...e.max===void 0?{}:{max:e.max},...e.step===void 0?{}:{step:e.step},value:typeof n=="number"?n:"",onChange:m=>a(m.target.value===""?void 0:Number(m.target.value)),"data-graview-part":"control"})]});case"boolean":return(0,x.jsxs)("label",{"data-graview-part":"field","data-graview-field":"boolean",children:[(0,x.jsx)("input",{type:"checkbox",name:e.name,checked:n===!0,onChange:m=>a(m.target.checked),"data-graview-part":"control"}),(0,x.jsx)("span",{"data-graview-part":"label",children:p})]});case"choice":return(0,x.jsxs)("label",{"data-graview-part":"field","data-graview-field":e.control,children:[(0,x.jsx)("span",{"data-graview-part":"label",children:p}),(0,x.jsx)(ii,{children:(0,x.jsxs)("select",{name:e.name,required:!e.optional,value:typeof n=="string"?n:"",onChange:m=>a(m.target.value||void 0),"data-graview-part":"control",children:[(0,x.jsx)("option",{value:"",children:"\u2014"}),(e.options??[]).map(m=>(0,x.jsx)("option",{value:m,children:o(e.name).option(m)},m))]})})]});case"node":{let m=i.find(h=>h.name===e.name)?.candidates,f=new Set(Object.values(r).filter(h=>typeof h=="string")),u=(e.kinds.includes("*")?[...t.graph.allNodes()]:e.kinds.flatMap(h=>t.graph.nodesOfKind(h))).filter(h=>!f.has(h.id)),k=m?m.map(h=>t.graph.getNode(h)).filter(h=>h!==void 0):u,q=Et(k,h=>t.schema.tryDefinition(h));return(0,x.jsxs)("label",{"data-graview-part":"field","data-graview-field":e.control,children:[(0,x.jsx)("span",{"data-graview-part":"label",children:p}),(0,x.jsx)(ii,{children:(0,x.jsxs)("select",{name:e.name,required:!e.optional,value:typeof n=="string"?n:"",onChange:h=>a(h.target.value||void 0),"data-graview-part":"control",children:[(0,x.jsx)("option",{value:"",children:"\u2014"}),k.map(h=>{let R=q.get(h.id);return(0,x.jsxs)("option",{value:h.id,children:[me(t.schema.tryDefinition(h.kind),h),R?` \xB7 ${R}`:""]},h.id)})]})})]})}case"group":{let m=n??{};return(0,x.jsxs)("fieldset",{"data-graview-part":"group","data-graview-field":e.control,children:[(0,x.jsx)("legend",{"data-graview-part":"label",children:p}),e.fields.map(f=>(0,x.jsx)(Vt,{store:t,spec:f,value:m[f.name],onChange:u=>a({...m,[f.name]:u}),prefilled:r,open:i,words:o},f.name))]})}case"variant":{let m=n??{},f=typeof m[e.tag]=="string"?m[e.tag]:"",u=e.options.find(k=>k.value===f);return(0,x.jsxs)("fieldset",{"data-graview-part":"group","data-graview-field":e.control,children:[(0,x.jsx)("legend",{"data-graview-part":"label",children:p}),(0,x.jsxs)("label",{"data-graview-part":"field","data-graview-field":"choice",children:[(0,x.jsx)("span",{"data-graview-part":"label",children:be(e.tag)}),(0,x.jsxs)("select",{value:f,onChange:k=>a({[e.tag]:k.target.value}),"data-graview-part":"control",children:[(0,x.jsx)("option",{value:"",children:"\u2014"}),e.options.map(k=>(0,x.jsx)("option",{value:k.value,children:be(k.value)},k.value))]})]}),u?.fields.map(k=>(0,x.jsx)(Vt,{store:t,spec:k,value:m[k.name],onChange:q=>a({...m,[k.name]:q}),prefilled:r,open:i,words:o},k.name))]})}case"file":case"list":{let m=e.control==="file"?e:e.item.control==="file"?e.item:void 0;if(m||e.control==="file")return(0,x.jsx)(qe,{as:"control",title:c?`${d} *`:d,value:n,onChange:a,several:m!==e,image:m?.image===!0,video:m?.video===!0,label:d});let f=Array.isArray(n)?n:[];return(0,x.jsxs)("fieldset",{"data-graview-part":"group","data-graview-field":"list",children:[(0,x.jsx)("legend",{"data-graview-part":"label",children:p}),f.map((u,k)=>(0,x.jsxs)("div",{"data-graview-part":"item",children:[(0,x.jsx)("div",{style:{flex:1},children:(0,x.jsx)(Vt,{store:t,spec:{...e.item,optional:!1},value:u,onChange:q=>a(f.map((h,R)=>R===k?q:h)),prefilled:r,open:i,words:o})}),(0,x.jsx)("button",{type:"button","data-graview-part":"remove",onClick:()=>a(f.filter((q,h)=>h!==k)),children:"remove"})]},k)),(0,x.jsx)("button",{type:"button","data-graview-part":"add",onClick:()=>a([...f,void 0]),children:"add another"})]})}case"linked":return(0,x.jsx)("div",{"data-graview-part":"field","data-graview-field":"linked",children:(0,x.jsx)(tr,{relation:e.relation,value:n,onChange:a,label:d})});case"repeat":return(0,x.jsx)(nr,{value:n,onChange:a,start:e.of?l?.[e.of]:void 0,label:`${e.of?o(e.of).label:d} repeats`,name:e.name});case"opaque":return(0,x.jsxs)("p",{"data-graview-part":"unasked",children:["\u201C",be(e.name),"\u201D needs a structured answer this form cannot ask for yet."]})}}function Ie({store:t,mutation:e,prefilled:n={},open:a=[],onDone:r,principal:i,initial:o,label:l,only:d}){let c=()=>lr(e,t.graph,n),[p,m]=(0,Ye.useState)(c),[f,u]=(0,Ye.useState)(()=>({...p,...o})),[k,q]=(0,Ye.useState)(null),h=i??t.seenFor,R=e.subject&&n[e.subject.arg],G=h?cr(t,h,e,typeof R=="string"?R:void 0):void 0,M=Nt(e.input).filter(I=>(d===void 0||d.includes(I.name))&&!G?.has(I.name)),V=I=>Ga(t.schema,e,I),z=za(M.filter(I=>I.control==="date").map(I=>I.name)),oe=(0,Ye.useRef)(void 0),pe=(I,_)=>u(ie=>{let ve={...ie,[I.name]:_};if(z&&I.name===z.start&&I.control==="date"){let se=v=>typeof v=="string"&&v!==""?v:void 0,ue=se(ie[z.start])??oe.current;if(se(_)){oe.current=se(_);let v=ja(ue,se(_),se(ie[z.end]),{time:I.time===!0,instant:I.instant===!0});v!==void 0&&(ve[z.end]=v)}}return ve});return(0,x.jsxs)("form",{"data-testid":`form-${e.name}`,onSubmit:I=>{I.preventDefault();try{t.apply({name:e.name,args:{...dr(sr(M,f),p),...n}},i?{author:i}:{}),q(null);let _=c();m(_),u({..._}),r?.()}catch(_){q(st(t.schema,t.allMutations(),_))}},"data-graview-part":"form",children:[(0,x.jsx)("style",{children:Gi}),M.map(I=>(0,x.jsx)(Vt,{store:t,spec:I,value:f[I.name],values:f,onChange:_=>pe(I,_),prefilled:n,open:a,words:V},I.name)),k?(0,x.jsx)("p",{"data-testid":"refused","data-graview-part":"refused",role:"alert",children:k}):null,(0,x.jsx)("button",{type:"submit","data-graview-part":"submit",children:l??e.title??e.name})]})}var T=D(j(),1);function Le(t){let e=t.views;if(!e)return[];let n=new Set(Ge(t.store,t.principal));return e.places().filter(a=>n.has(a.kind))}function Ut(t,e){if(!e.over)return[e.kind];let n=new Set(Ge(t.store,t.principal));return e.over.filter(a=>a===e.kind||n.has(a))}var Qe=t=>`place:${t.kind}:${t.as}`;function ye(t,e){return jr(e.as,wa(e,t.views?.places()??[])?Y(t.store.schema,e.kind):void 0)}function ht(t,e){let n=t.schema.tryDefinition(e);return t.graph.nodesOfKind(e).filter(a=>rt(n,a))}function $n(t,e,n){let a=(i,o)=>Ct(t.schema,o,i),r=(typeof e=="string"?[e]:e).map(i=>a(ht(t,i).length,i)).join(" and ");return n?`${r} across ${a(ht(t,n).length,n)}`:r}function On({context:t,place:e,chosen:n,filter:a}){let{store:r,views:i,invariantContext:o}=t,d=i?.resolve(e.kind,{cardinality:"many",fidelity:"full"},e.as)?.view,c=[...new Set(r.violations(o).flatMap(f=>f.nodeIds))],p=Ut(t,e).flatMap(f=>ht(r,f));if(!d)return null;let m=zi(r,p,a,c);return(0,T.jsx)(bn,{kind:e.kind,view:e.title,children:(0,T.jsx)(d,{nodes:m,label:e.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1,...n&&n.length>0?{implicated:n}:{},...c.length>0?{flagged:c}:{}})})}function zi(t,e,n,a){let r=n?Lt({filter:n}).filter??[]:[];return r.length===0?e:Ot(e,{filter:r},{schema:t.schema,graph:t.graph,flagged:new Set(a)}).nodes}function _i({store:t,views:e,as:n,invariantContext:a}){te(t);let r={store:t,views:e,...a?{invariantContext:a}:{}},i=e.places().find(o=>o.as===n);return i?(0,T.jsx)(On,{context:r,place:i}):null}function Yi({context:t,kind:e}){let{store:n,views:a,invariantContext:r}=t,i=ht(n,e),o=n.schema.tryDefinition(e),l=Q(n,e),c=a?.resolve(e,{cardinality:"many",fidelity:"full"})?.view,p=[...new Set(n.violations(r).flatMap(k=>k.nodeIds))];if(c&&!ot(c))return(0,T.jsx)(bn,{kind:e,children:(0,T.jsx)(c,{nodes:i,label:l,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1,...p.length>0?{flagged:p}:{}})});let m=a?.resolve(e,{cardinality:"one",fidelity:"summary"})?.view,f=8,u=i.slice(0,f);return(0,T.jsxs)("div",{"data-testid":"kind-sheet",style:m?{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gridAutoRows:"max-content",alignContent:"center",gap:12,padding:24}:{display:"flex",flexWrap:"wrap",alignContent:"center",justifyContent:"center",gap:10,padding:24},children:[u.map(k=>m?(0,T.jsx)(m,{node:k,fidelity:"summary",cardinality:"one",mode:"fullscreen",selected:!1,...p.includes(k.id)?{flagged:[k.id]}:{}},k.id):(0,T.jsx)("span",{style:{padding:"8px 14px",borderRadius:8,border:"1px solid var(--graview-edge-bright)",background:"var(--graview-ground)",color:"var(--graview-ink)"},children:me(o,k)},k.id)),i.length>f?(0,T.jsxs)("span",{style:{...C,alignSelf:"center",padding:"0 6px"},children:["+",i.length-f," more ",l.toLowerCase()]}):null]})}function Fn(t){let{store:e}=t,n=Yr(t),a=Le(t),r=fn([...a].sort((o,l)=>n.indexOf(o.kind)-n.indexOf(l.kind))).filter(o=>!o.hidden),i=new Set(r.flatMap(o=>o.over??[o.kind]));return[...r.map(o=>({key:Qe(o),kind:o.kind,title:va(o,a,e.schema),to:ye(t,o),place:o})),...Bt(t).filter(o=>!i.has(o)).map(o=>({key:`kind:${o}`,kind:o,title:Q(e,o),to:`/${Y(e.schema,o)}`}))]}var oi=.72,Qi=540,si=16/10;function Zi(t){let e=(0,He.useRef)(null),[n,a]=(0,He.useState)(t);return(0,He.useLayoutEffect)(()=>{let r=e.current;if(!r||typeof ResizeObserver>"u")return;let i=()=>{let l=r.getBoundingClientRect().width;l>0&&a(d=>Math.abs(d-l)<.5?d:l)};i();let o=new ResizeObserver(i);return o.observe(r),()=>o.disconnect()},[]),{ref:e,width:n}}function Xi(t){for(let e=t.parentElement;e;e=e.parentElement)if(/(auto|scroll)/.test(getComputedStyle(e).overflowY))return e;return null}function Ji(t){let[e,n]=(0,He.useState)(()=>typeof IntersectionObserver>"u");return(0,He.useLayoutEffect)(()=>{let a=t.current;if(e||!a)return;let r=new IntersectionObserver(i=>{i.some(o=>o.isIntersecting)&&(r.disconnect(),n(!0))},{root:Xi(a),rootMargin:"50% 0px"});return r.observe(a),()=>r.disconnect()},[e,t]),e}function In({context:t,entry:e}){let{store:n,brand:a,principal:r}=t,{ref:i,width:o}=Zi(Qi),l=Ji(i),d=o/oi,c=ht(n,e.kind),p=n.schema.tryDefinition(e.kind),m=c.length===0?ze(n,e.kind,{...r?{principal:r}:{},...t.invariantContext?{context:t.invariantContext}:{}}).actions.affordances[0]:void 0,f=e.place!==void 0;return(0,T.jsxs)(F,{to:e.to,"data-testid":f?"place-card":"kind-card",className:"graview-gallery-card",style:{...Se,display:"grid",gap:10,alignContent:"start",minWidth:0},children:[(0,T.jsxs)("span",{ref:i,"data-testid":f?"place-picture":"kind-picture","aria-hidden":"true",inert:!0,style:{display:"block",position:"relative",width:"100%",aspectRatio:`${si}`,overflow:"hidden",borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",pointerEvents:"none"},children:[(0,T.jsx)("span",{style:{position:"absolute",left:0,top:0,width:d,height:d/si,display:"grid",gridTemplateRows:"minmax(0, 1fr)",transform:`scale(${oi})`,transformOrigin:"0 0"},children:l?(0,T.jsx)(Dt.Provider,{value:null,children:e.place?(0,T.jsx)(On,{context:t,place:e.place}):(0,T.jsx)(Yi,{context:t,kind:e.kind})}):null}),c.length===0?(0,T.jsx)("span",{"data-testid":"picture-empty",style:{position:"absolute",inset:0,display:"grid",placeContent:"center",justifyItems:"center",gap:2,padding:20,textAlign:"center"},children:(0,T.jsxs)("span",{style:{display:"grid",gap:2,padding:"10px 16px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-ground)",color:"var(--graview-ink)"},children:[(0,T.jsxs)("span",{style:{fontFamily:Rn,fontWeight:"var(--graview-weight-display)"},children:["No ",Q(n,e.kind).toLowerCase()," yet"]}),m?(0,T.jsxs)("span",{style:C,children:["Begin with \u201C",m.label,"\u201D"]}):null]})}):null]}),(0,T.jsxs)("span",{style:{display:"grid",gap:2,minWidth:0},children:[(0,T.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0},children:[f?null:(0,T.jsx)(fe,{kind:e.kind,brand:a,schema:n.schema,size:8}),(0,T.jsx)("span",{style:{fontFamily:Rn,fontSize:"var(--graview-text-heading)",fontWeight:"var(--graview-weight-display)",lineHeight:1.3,overflowWrap:"anywhere",textWrap:"balance"},children:e.title})]}),(0,T.jsxs)("span",{style:C,children:[e.place?$n(n,Ut(t,e.place),e.place.across):$n(n,e.kind),!f&&p?.description?` \xB7 ${p.description}`:null]})]})]})}var li={display:"grid",gap:"32px 28px",gridTemplateColumns:"repeat(auto-fill, minmax(min(420px, 100%), 1fr))"},eo=`
|
|
105
|
-
.graview-gallery-card > span:first-child { transition: border-color 160ms ease, box-shadow 160ms ease; }
|
|
106
|
-
.graview-gallery-card:hover > span:first-child,
|
|
107
|
-
.graview-gallery-card:focus-visible > span:first-child { border-color: var(--graview-edge-bright); box-shadow: 0 1px 0 var(--graview-edge), 0 10px 30px -18px var(--graview-ink); }
|
|
108
|
-
`;function Dn({context:t}){te(t.store);let e=Fn(t);return e.length===0?null:(0,T.jsxs)("section",{style:li,"data-testid":"gallery",children:[(0,T.jsx)("style",{children:eo}),e.map(n=>(0,T.jsx)(In,{context:t,entry:n},n.key))]})}function Wn({context:t}){let{store:e}=t;te(e);let n=fn(Le(t)).filter(r=>!r.hidden),a=Fn(t);return(0,T.jsxs)(ne,{context:t,style:lt,children:[(0,T.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,T.jsx)("p",{style:ke,children:n.length===0?"None of its own yet":`${n.length} ${n.length===1?"picture":"pictures"}`}),(0,T.jsx)(re,{context:t,children:"Pictures"}),(0,T.jsx)("p",{style:ae,children:n.length===0?"Nothing here has a picture of its own yet, so each kind is drawn as the scene draws it. Title a group view and it appears here by name.":"The ways this installation looks at what it holds \u2014 each one the same picture the scene shows, here as a page."})]}),a.length>0?(0,T.jsx)("div",{style:li,"data-testid":"places",children:a.map(r=>(0,T.jsx)(In,{context:t,entry:r},r.key))}):null]})}function Hn({context:t}){let{store:e,principal:n}=t;te(e);let a=Ve(),r=We(),[i]=dt(),o=decodeURIComponent(a.as??""),[l,d]=(0,He.useState)(null),c=i.get("of"),p=i.get("filter"),f=Le(t).find(M=>M.as===o&&(!c||Y(e.schema,M.kind)===c));if(!f)return(0,T.jsxs)(ne,{context:t,children:[(0,T.jsx)(re,{context:t,children:"No picture is called that."}),(0,T.jsx)("p",{style:ae,children:(0,T.jsxs)(F,{to:"/places",style:K,children:["The pictures there are ",(0,T.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]})})]});let u=Q(e,f.kind),k=t.views?.resolve(f.kind,{cardinality:"many",fidelity:"full"},f.as)?.view,q=k?.flows===!0,h=k?.creates!==!1,R=ze(e,f.kind,{...n?{principal:n}:{},...t.invariantContext?{context:t.invariantContext}:{}}),G=h?R.actions.affordances.map(M=>({affordance:M,mutation:e.allMutations().find(V=>V.name===M.mutation)})).filter(M=>M.mutation!==void 0):[];return(0,T.jsxs)(ne,{context:t,style:lt,children:[(0,T.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,T.jsx)(re,{context:t,children:f.title}),(0,T.jsxs)("p",{style:ae,"data-testid":"place-lede",children:[$n(e,Ut(t,f),f.across),"."]}),p&&!q?(0,T.jsxs)("p",{style:{...C,margin:0},"data-testid":"place-narrowed",children:[`Only those where ${p.split(",").map(M=>M.replace(":"," is ")).join(" and ")}. `,(0,T.jsx)(F,{to:`?${(()=>{let M=new URLSearchParams(i);return M.delete("filter"),M.toString()})()}`,style:{...K,...C},children:"Show all"})]}):null,(0,T.jsx)("p",{style:{...C,margin:0,display:"flex",flexWrap:"wrap",gap:"4px 16px"},children:Ut(t,f).map((M,V)=>(0,T.jsxs)(F,{to:`/${Y(e.schema,M)}`,style:{...K,...C},...V===0?{"data-testid":"place-as-list"}:{},children:["All ",(M===f.kind?u:Q(e,M)).toLowerCase()," as a list ",(0,T.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]},M))})]}),(0,T.jsx)("div",{"data-testid":"place-lens","data-flows":q?"":void 0,style:q?{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",maxWidth:"100%"}:{height:"min(72vh, 760px)",display:"grid",gridTemplateRows:"minmax(0, 1fr)",overflow:"auto",maxWidth:"100%",borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)"},onClick:M=>{let V=M.target?.closest("[data-graview-pick]"),z=V?.getAttribute("data-graview-pick"),oe=V?.getAttribute("data-graview-joins");if(oe)try{let I=JSON.parse(oe);if(Array.isArray(I)&&I.every(_=>typeof _=="string")){M.preventDefault(),d({at:Qe(f),ids:I});return}}catch{}if(!z)return;let pe=e.graph.getNode(z);pe&&(M.preventDefault(),r(Z(e.schema,pe.kind,z)))},children:(0,T.jsx)(On,{context:t,place:f,filter:p,...l?.at===Qe(f)?{chosen:l.ids}:{}})}),G.length>0?(0,T.jsx)("div",{style:{maxWidth:760,display:"grid",gap:40},"data-testid":"place-creators",children:G.map(({affordance:M,mutation:V})=>(0,T.jsxs)("section",{style:{...ee,display:"grid",gap:14},children:[(0,T.jsx)("h2",{style:J,children:V.title??V.name}),V.description?(0,T.jsx)("p",{style:{...C,margin:0,maxWidth:"58ch"},children:V.description}):null,(0,T.jsx)(Ie,{store:e,mutation:V,prefilled:M.args,open:M.open,label:M.label,...n?{principal:n}:{}})]},M.id))}):null]})}function ct(t){return t.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-|-$/g,"")}function wt(t,e={}){let[n="/",a=""]=t.split("#")[0].split("?"),r=new URLSearchParams(a);e.filter&&r.set("filter",e.filter);let i=r.toString(),o=e.section?ct(e.section):"";return`${n}${i?`?${i}`:""}${o?`#${o}`:""}`}function to(t,e=document){let n=ct(t);if(!n)return null;let a=[e,...[...e.querySelectorAll("[data-worker-view]")].flatMap(r=>r.shadowRoot?[r.shadowRoot]:[])];for(let r of a)for(let i of r.querySelectorAll("[id], [data-section]")){let o=i.getAttribute("data-section")??i.id;if(o===t||ct(o)===n)return i}for(let r of a)for(let i of r.querySelectorAll("h1, h2, h3, h4, h5, h6, [role=heading]"))if(ct(i.textContent??"")===n)return i;return null}function di(t,e={}){if(typeof document>"u"||typeof requestAnimationFrame>"u")return()=>{};let n=e.frames??120,a=0,r=()=>{let i=to(t,e.root??document);if(i){i.hasAttribute("tabindex")||i.setAttribute("tabindex","-1"),i.scrollIntoView?.({block:"start"}),i.focus({preventScroll:!0});return}n-=1,n>0&&(a=requestAnimationFrame(r))};return a=requestAnimationFrame(()=>{a=requestAnimationFrame(r)}),()=>cancelAnimationFrame(a)}var U=D(Fe(),1);var jt=D(Fe(),1);var Ze=D(j(),1);function ci({context:t}){return de()?(0,Ze.jsxs)(Ze.Fragment,{children:[(0,Ze.jsx)(no,{context:t}),(0,Ze.jsx)(Wr,{face:"pages",on:t.quickAsk??!0})]}):null}function no({context:t}){let{store:e}=t,n=de(),{pathname:a}=Pe(),r=(0,jt.useRef)(n?.setSelection);return r.current=n?.setSelection,(0,jt.useEffect)(()=>{let i=r.current;if(!i)return;let[,o,l]=a.split("/"),d=(()=>{if(o==="places"){let p=t.views?.places().find(m=>m.as===decodeURIComponent(l??""));return p?[Oe(p.kind)]:[]}let c=o?Ee(e.schema,o):void 0;return c&&l?[decodeURIComponent(l)]:c?[xa(c)]:[]})();i(c=>c.length===d.length&&c.every((p,m)=>p===d[m])?c:d)},[a]),null}var he=D(Fe(),1);var ui=D(qi(),1);var ce=D(j(),1);var ao=(0,he.lazy)(Sa(()=>(__graviewPreload(import.meta.url,["./chunk.3ZRHHB7X.js","./chunk.UGFDSE37.js","./chunk.ZYCNEOAQ.js","./chunk.4DEUD66C.js","./chunk.LHO7L3CS.js","./chunk.YG423NEB.js","./chunk.VNBR4DHD.js","./chunk.Z3ZKYSPN.js","./chunk.6ONRWFA6.js","./chunk.AFY35RJP.js","./chunk.POHEWJKZ.js","./chunk.ROGYDMES.js","./chunk.6IHXTT6Z.js","./chunk.YXH3IWNR.js","./chunk.OEF3GPRM.js","./chunk.BRHRAVU2.js","./chunk.VTWFVPKD.js","./chunk.ZRQI5VJF.js","./chunk.33GN2NUT.js","./chunk.2VIGF4FO.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.2EJAIT33.js","./chunk.EUGWV3S6.js","./chunk.6XJP7F3I.js","./chunk.NPX7SPXM.js","./chunk.OE4QOBJF.js","./chunk.74RMHUCX.js","./chunk.GZHZLJBF.js","./chunk.I3SQJ2L2.js","./chunk.OJGHDWI6.js","./chunk.FUJM7GDV.js","./chunk.MWZK3HVG.js","./chunk.3D5T3XIE.js","./chunk.GR5Q4HTW.js","./chunk.QT4XGC5Z.js","./chunk.MQ7FNHXG.js","./chunk.WLPTY4BF.js","./chunk.AJZBJBMO.js"]),import("./chunk.5VBBQ6Z3.js")).then(t=>({default:t.TakeBack}))));function ro({context:t,docked:e,at:n}){let{store:a}=t,r=te(a),[i]=(0,he.useState)(()=>a.batches().length),o=(0,he.useRef)(!1);return o.current||=r>0||!e&&i>0,o.current?(0,ce.jsx)(he.Suspense,{fallback:null,children:(0,ce.jsx)(ao,{context:t,docked:e,at:n,since:i})}):null}function io(t,e,n){let{store:a,principal:r,embedded:i}=t;(0,he.useEffect)(()=>{if(!n)return;let o=l=>{if(!Ur(l))return;let d=l.target,c=d instanceof Node&&e.current?.contains(d),p=d===document.body||d===document.documentElement||d===document;if(!(!c&&!(p&&!i))&&Gr(a,r)){l.preventDefault();try{Vr(a,r)}catch{}}};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[a,r,i,e,n])}function gi({context:t,registry:e,root:n,children:a}){let r=(0,he.useMemo)(ti,[]),i=e?.without()??new Set;return io(t,n,!i.has("undo")),(0,ce.jsxs)(Mn.Provider,{value:r,children:[(0,ce.jsx)(oo,{context:t,placed:r,without:i}),a]})}function oo({context:t,placed:e,without:n}){let[a,r]=(0,he.useState)(!1);(0,he.useLayoutEffect)(()=>r(!0),[]);let i=En(e,"find"),o=En(e,"undo"),l=Pe(),d=fr();if(!a)return null;let c=l.pathname.split("/").filter(Boolean),m=(c.length===1?Ee(t.store.schema,c[0]):void 0)!==void 0;return(0,ce.jsxs)(ce.Fragment,{children:[!i&&!n.has("find")&&d?(0,ui.createPortal)((0,ce.jsx)(pi,{context:t,narrowsLists:m}),d.slot):null,!i&&!n.has("find")&&!d?(0,ce.jsx)("div",{"data-testid":"face-find-bar",style:{display:"flex",alignItems:"center",padding:"8px 16px",borderBottom:"1px solid var(--graview-edge)",background:"var(--graview-bar)",minWidth:0},children:(0,ce.jsx)(pi,{context:t,narrowsLists:m})}):null,!o&&!n.has("undo")?(0,ce.jsx)(ro,{context:t,docked:!0,at:l.pathname+l.search}):null,d?.own&&!n.has("undo")?(0,ce.jsx)(Qr,{context:t,own:d.own}):null]})}function pi({context:t,narrowsLists:e}){return(0,ce.jsx)(Mn.Provider,{value:null,children:(0,ce.jsx)(Nn,{context:t,narrowsLists:e})})}var X=D(Fe(),1);var Ae=D(j(),1),so=500,lo=10;function zt(t){return t instanceof HTMLElement?t.isContentEditable||t.tagName==="TEXTAREA"||t.tagName==="SELECT"?!0:t.tagName==="INPUT"&&!["button","submit","reset","checkbox","radio","image","file","color","range"].includes(t.type):!1}function co(t){let e=typeof getSelection=="function"?getSelection():null;return e!==null&&!e.isCollapsed&&e.containsNode(t,!0)}function mi(t){let e=t.closest('a[href], button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"])');if(e)return e;let n=document.activeElement;return n instanceof HTMLElement&&n!==document.body?n:null}function fi({context:t,root:e,children:n}){return de()===null?(0,Ae.jsx)(Ae.Fragment,{children:n}):(0,Ae.jsx)(po,{context:t,root:e,children:n})}function po({context:t,root:e,children:n}){let{setMenuAt:a}=Ta(),{store:r}=t,i=r.schema,o=We(),{pathname:l,search:d}=Pe(),c=Zr("/").replace(/\/$/,""),p=(0,X.useCallback)((v,y)=>t.views?.places().find(L=>L.as===v&&(y===null||L.kind===y)),[t.views]),m=(0,X.useCallback)((v,y)=>{let[L="",$,g]=v.split("/").filter(Boolean).map(O=>{try{return decodeURIComponent(O)}catch{return O}});if(g!==void 0)return null;if(L==="places"&&$!==void 0){let O=p($,new URLSearchParams(y).get("of"));return O?{face:"pages",place:O.as,about:[Oe(O.kind)],title:O.title}:null}let A=Ee(i,L);return A?$===void 0?{face:"pages",about:[Oe(A)],title:it(i,A)}:r.graph.getNode($)?{face:"pages",on:$,about:[$]}:null:null},[i,r,p]),f=(0,X.useCallback)(v=>{let y=v.href;try{let L=new URL(y,location.href);if(L.origin===location.origin&&(c===""||L.pathname===c||L.pathname.startsWith(`${c}/`))){let $=m(L.pathname.slice(c.length),L.search);if($)return{...$,href:y}}}catch{}return{face:"pages",about:[],href:y}},[c,m]),u=(0,X.useCallback)(()=>m(l,d)??{face:"pages",about:[]},[m,l,d]),k=(0,X.useCallback)(v=>{let y=u(),L=v.closest("[data-graview-field]")?.getAttribute("data-graview-field");if(L&&y.on!==void 0&&v.closest("[data-graview-pick], a[href]")===null)return{...y,field:L};let $=v.closest("[data-graview-act]")?.getAttribute("data-graview-act");if($)return{...y,act:$};let g=v.closest("[data-graview-pick]")?.getAttribute("data-graview-pick");if(g&&r.graph.getNode(g))return{face:"pages",on:g,about:[g],href:`${c}${Z(i,r.graph.getNode(g).kind,g)}`};let A=v.closest("a[href]");if(A)return f(A);let O=v.closest("[data-graview-record]")?.getAttribute("data-graview-record");return O&&r.graph.getNode(O)?{face:"pages",on:O,about:[O]}:y},[u,f,r,i,c]),q=(0,X.useCallback)(v=>{let y=e.current;if(y===null||!y.contains(v)||zt(v)||v.closest("[data-graview-popover]"))return null;let L=k(v);return{face:"pages",on:L.on,about:L.about??[],field:L.field,place:L.place,href:L.href,act:L.act,element:mi(v)}},[k,e]),h=(0,X.useCallback)((v,y,L)=>{let $=k(v);a({...$,x:Math.round(y),y:Math.round(L),returnTo:mi(v)})},[k,a]),R=(0,X.useCallback)(v=>{let y=v.getBoundingClientRect();h(v,y.left+Math.min(16,y.width/2),Math.min(y.bottom,y.top+36))},[h]),G=(0,X.useRef)(0),M=(0,X.useRef)(null),V=(0,X.useRef)(!1),z=()=>{M.current&&clearTimeout(M.current.timer),M.current=null};(0,X.useEffect)(()=>z,[]),(0,X.useEffect)(()=>{let v=y=>{if(y.defaultPrevented||!(y.key==="ContextMenu"||y.key==="F10"&&y.shiftKey))return;let L=e.current,$=y.target instanceof Element?y.target:null,g=$===null||$===document.body||$===document.documentElement,A=L!==null&&$!==null&&L.contains($);if(!A&&!(g&&document.querySelector("[data-graview-face='pages']")===L)||zt($)||$?.closest("[data-graview-popover]"))return;y.preventDefault(),G.current=Date.now();let O=A&&$ instanceof HTMLElement?$:L?.querySelector("[data-graview-page-title], main h1, main")??null;O&&R(O)};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[e,R]),(0,X.useEffect)(()=>{let v=e.current;if(!v)return;let y=L=>{let $=L.detail;$&&a({...$,face:"pages"})};return v.addEventListener(hn,y),()=>v.removeEventListener(hn,y)},[e,a]);let oe=(0,X.useMemo)(()=>v=>{if(v.face!=="pages")return null;let y=[],L=v.on===void 0?void 0:r.graph.getNode(v.on),$=v.place===void 0?void 0:t.views?.places().find(Te=>Te.as===v.place),g=L?void 0:v.about.length===1&&v.about[0].startsWith("aggregate:")&&!$?uo(v.about[0]):void 0,A=L?Z(i,L.kind,L.id):$?ye(t,$):g?`/${Y(i,g)}`:void 0,O=A!==void 0&&l===A.split("?")[0];A!==void 0&&!O&&y.push({id:"open",label:"Open",run:()=>o(A)});let ge=A!==void 0?`${c}${A}`:v.href;ge!==void 0&&y.push({id:"open-in-a-new-tab",label:"Open in a new tab",run:()=>void window.open(ge,"_blank","noopener")});let et=L?`#focus=${encodeURIComponent(L.id)}`:$?`#focus=${encodeURIComponent(Oe($.kind))}&view=${encodeURIComponent($.as)}`:g?`#focus=${encodeURIComponent(Oe(g))}`:void 0;if(et!==void 0&&(t.overview||!t.embedded)){let Te=t.overview;y.push({id:"in-the-scene",label:"Show in the scene",run:()=>Te?Te(et):location.assign(`${t.sceneHref??"/"}${et}`)})}return L===void 0&&v.href===void 0&&y.push({id:"find",label:"Find\u2026",run:()=>{let Te=e.current?.querySelector('[data-testid="nav-find"]')??document.querySelector('[data-testid="nav-find"]');Te&&Te.offsetParent!==null?Te.focus():o("/search")}}),y.length>0?{id:"pages",items:y}:null},[r,i,t,l,c,o,e]),pe=(0,X.useMemo)(()=>v=>{if(v.face!=="pages"||v.field===void 0||v.on===void 0)return null;let y=r.graph.getNode(v.on),L=v.element?.closest("[data-graview-field]")??e.current?.querySelector(`[data-graview-field="${CSS.escape(v.field)}"]`);return!y||!(L instanceof HTMLElement)||!L.hasAttribute("data-graview-editable")?null:{id:"field",at:"start",items:[{id:"change-field",label:`Change \u201C${sa(i.tryDefinition(y.kind),v.field)}\u201D`,run:()=>L.click()}]}},[r,i,e]),I=Kr(),_=ir(),ie=Rr(),ve=(0,X.useCallback)((v,y)=>{l===ye(t,v).split("?")[0]&&o(y?ye(t,y):"/")},[l,t,o]),se=qr(ve),ue=(0,X.useMemo)(()=>[pe,ie,oe,...se?[se]:[],..._?[_]:[],...I?[I]:[]],[pe,ie,oe,se,_,I]);return(0,Ae.jsxs)(Ja,{sections:ue,children:[(0,Ae.jsx)("div",{"data-graview-menu-ground":"",style:{display:"contents"},onContextMenu:v=>{let y=v.target;v.shiftKey||zt(y)||co(y)||(v.preventDefault(),!y.closest("[data-graview-popover]")&&(Date.now()-G.current<700||(v.clientX===0&&v.clientY===0&&y instanceof HTMLElement?R(y):h(y,v.clientX,v.clientY))))},onPointerDown:v=>{if(V.current=!1,v.pointerType==="mouse"||!v.isPrimary)return;let y=v.target;if(zt(y)||y.closest("[data-graview-choose], [data-graview-popover]"))return;z();let{clientX:L,clientY:$}=v;M.current={x:L,y:$,timer:setTimeout(()=>{M.current=null,V.current=!0,G.current=Date.now(),h(y,L,$)},so)}},onPointerMove:v=>{let y=M.current;y&&Math.hypot(v.clientX-y.x,v.clientY-y.y)>lo&&z()},onPointerUp:z,onPointerCancel:z,onClickCapture:v=>{V.current&&(V.current=!1,v.preventDefault(),v.stopPropagation())},children:n}),(0,Ae.jsx)(go,{openAt:R,readyAt:q}),(0,Ae.jsx)(Br,{placement:"page"}),(0,Ae.jsx)(or,{})]})}function uo(t){let e=t.slice(10).split("+");return e.length===1&&e[0]?e[0]:void 0}function go({openAt:t,readyAt:e}){return(0,Ae.jsx)("span",{"data-graview-menu-home":"",tabIndex:-1,onFocus:n=>{if(n.target!==n.currentTarget)return;let a=n.currentTarget.closest("[data-graview-face]"),r=a?.querySelector("[data-graview-page-title]")??a?.querySelector("main h1, main")??null;r&&(r.hasAttribute("tabindex")||r.setAttribute("tabindex","-1"),r.focus({preventScroll:!0}))},style:{position:"absolute",width:0,height:0,overflow:"hidden"},children:(0,Ae.jsx)(Dr,{placement:"menu",openActs:t,aimAt:e})})}var H=D(j(),1);function yi(t,e){return e==="*"?{label:"anything",path:null}:{label:Q(t,e),path:`/${Y(t.schema,e)}`}}function mo({context:t,relation:e}){let{store:n}=t,a=yi(n,e.from),r=yi(n,e.to),i=o=>o.path?(0,H.jsx)(F,{to:o.path,style:{...Se,fontWeight:550},children:o.label}):(0,H.jsx)("span",{children:o.label});return(0,H.jsxs)("li",{"data-testid":"relation","data-relation":e.edgeKind,style:{display:"grid",gridTemplateColumns:"30px minmax(0, 1fr) auto",gap:12,alignItems:"baseline"},children:[(0,H.jsx)(Hr,{edgeKind:e.edgeKind,...t.brand?.kit?{kit:t.brand.kit}:{}}),(0,H.jsxs)("span",{style:{display:"grid",gap:1},children:[(0,H.jsxs)("span",{children:[i(a)," ",(0,H.jsxs)("span",{style:C,"data-graview-speaks-ids":"",children:[be(e.edgeKind)," \u2192"]})," ",i(r)]}),e.description||e.inverse?(0,H.jsxs)("span",{style:C,children:[e.description?Ce(e.description):null,e.description&&e.inverse?" \xB7 ":null,e.inverse?`from the other end, ${e.inverse}`:null]}):null]}),r.path?(0,H.jsx)(F,{to:`${r.path}?with=${encodeURIComponent(e.edgeKind)}`,style:{...K,...C,fontVariantNumeric:"tabular-nums",display:"inline-block",minWidth:24,minHeight:24,textAlign:"center"},title:`The ${r.label.toLowerCase()} that have this`,children:e.count}):(0,H.jsx)("span",{style:{...C,fontVariantNumeric:"tabular-nums"},children:e.count})]})}function hi({context:t,heading:e=!0}){let{store:n}=t,a=new Set(Ge(n,t.principal)),r=_e(n).relations.filter(i=>a.has(i.from)&&(i.to==="*"||a.has(i.to)));return r.length===0?null:(0,H.jsxs)("section",{style:{...ee,display:"grid",gap:12},"data-testid":"kind-map",children:[e?(0,H.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[(0,H.jsx)("h2",{style:J,children:(0,H.jsx)(F,{to:"/map",style:Se,children:"Connections"})}),(0,H.jsx)("span",{style:C,children:r.length===1?"1 relation":`${r.length} relations`})]}):null,(0,H.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:r.map(i=>(0,H.jsx)(mo,{context:t,relation:i},`${i.edgeKind}|${i.from}|${i.to}`))})]})}function Kn({context:t}){let{store:e}=t;te(e);let n=new Set(Ge(e,t.principal)),a=_e(e),r=a.relations.filter(i=>n.has(i.from));return(0,H.jsxs)(ne,{context:t,children:[(0,H.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,H.jsx)("p",{style:ke,children:r.length===0?"No relations":`${r.length} ${r.length===1?"relation":"relations"}`}),(0,H.jsx)(re,{context:t,children:"Connections"}),(0,H.jsx)("p",{style:ae,children:r.length===0?"Nothing here is declared to relate to anything else yet.":"The kinds this installation holds, and the relations declared between them \u2014 each in the declaration's own words, with how many of it there are."})]}),(0,H.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"6px 18px"},"data-testid":"map-kinds",children:a.kinds.filter(i=>n.has(i.kind)).map(i=>(0,H.jsxs)("li",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[(0,H.jsx)(fe,{kind:i.kind,brand:t.brand,schema:e.schema,size:7}),(0,H.jsx)(F,{to:`/${Y(e.schema,i.kind)}`,style:K,children:i.plural}),(0,H.jsx)("span",{style:C,children:i.count})]},i.kind))}),(0,H.jsx)(hi,{context:t,heading:!1})]})}function wi({context:t}){let n=[...de()?.robots.values()??[]].filter(r=>r.mode==="asking"&&r.say);if(n.length===0)return null;let{store:a}=t;return(0,H.jsxs)("section",{style:{...ee,display:"grid",gap:10},"data-testid":"seat-questions",children:[(0,H.jsx)("h2",{style:J,children:n.length===1?"The seat asked something":`The seat asked ${n.length} things`}),(0,H.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:8},children:n.map(r=>{let i=r.at?a.graph.getNode(r.at):void 0;return(0,H.jsxs)("li",{style:{display:"grid",gap:2},children:[(0,H.jsx)("span",{children:r.say}),i?(0,H.jsxs)(F,{to:Z(a.schema,i.kind,i.id),style:{...K,...C},children:[me(a.schema.tryDefinition(i.kind),i)," \u2192"]}):null]},r.participant)})})]})}var B=D(j(),1);function Bn({context:t}){let{principal:e}=t,{store:n,brand:a,invariantContext:r}=t;te(n);let i=n.violations(r),o=`${i.length===1?"A rule is broken":"Rules are broken"} \u2014 see what, and what would fix it`,l=[...n.log.all()].slice(-5).reverse(),c=Bt(t).map(R=>({kind:R,members:n.graph.nodesOfKind(R).filter(G=>rt(n.schema.tryDefinition(R),G))})),p=c.filter(R=>R.members.length>0),m=c.map(R=>({entry:R,creator:n.allMutations().find(G=>(G.creates??[]).includes(R.kind)&&n.permits({name:G.name,args:{}},t.principal).ok)})).find(R=>R.creator!==void 0),f=p.length===0?"Nothing here yet.":`${p.map(R=>Ct(n.schema,R.kind,R.members.length)).join(", ").replace(/, ([^,]*)$/," and $1")}.`,u=t.views?.homeView?.(),k=n.schema.kinds.some(R=>n.graph.nodesOfKind(R).length>0);if(u&&k){let R=a?.subtitle?(0,B.jsx)("p",{style:{...C,margin:0},"data-testid":"app-subtitle",children:a.subtitle}):null,G=u[Symbol.for("graview.home-blocks")]===!0;return(0,B.jsx)(ne,{context:t,style:lt,children:(0,B.jsxs)("div",{style:{display:"grid",gap:12},"data-testid":"home-view",children:[G?null:R,i.length>0?(0,B.jsx)(F,{to:"/problems",style:{...K,color:"var(--graview-warn)"},children:o}):null,(0,B.jsx)(Or.Provider,{value:G?R:null,children:(0,B.jsx)(u,{cardinality:"many",fidelity:"full",mode:"fullscreen",selected:!1})})]})})}let q=new Set(Ge(n,t.principal)),h=_e(n).relations.filter(R=>q.has(R.from)&&(R.to==="*"||q.has(R.to)));return(0,B.jsxs)(ne,{context:t,style:lt,children:[(0,B.jsxs)("header",{style:{display:"grid",gap:12},children:[a?.subtitle?(0,B.jsx)("p",{style:{...C,margin:0},"data-testid":"app-subtitle",children:a.subtitle}):null,(0,B.jsx)(re,{context:t,"data-testid":"standing",children:f}),(0,B.jsxs)("p",{style:{...ae,display:"grid",gap:4},"data-testid":"standing-card",children:[p.length===0&&m?(0,B.jsxs)("span",{children:["Begin with \u201C",m.creator?.title??m.creator?.name,"\u201D, under"," ",(0,B.jsx)(F,{to:`/${Y(n.schema,m.entry.kind)}`,style:K,children:Q(n,m.entry.kind)}),"."]}):null,i.length===0?(0,B.jsx)("span",{children:"All rules hold."}):(0,B.jsx)(F,{to:"/problems",style:{...K,color:"var(--graview-warn)"},children:o})]})]}),(0,B.jsx)(Dn,{context:t}),(0,B.jsxs)("section",{style:{...ee,display:"grid",gap:14},"data-testid":"kinds",children:[(0,B.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[(0,B.jsx)("h2",{style:J,children:"What is here"}),h.length>0?(0,B.jsxs)(F,{to:"/map",style:{...K,...C,marginLeft:"auto"},"data-testid":"map-link",children:["Connections \xB7 ",h.length===1?"1 relation":`${h.length} relations`," ",(0,B.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]}):null]}),(0,B.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"8px 10px"},children:c.map(({kind:R,members:G})=>(0,B.jsx)("li",{style:{maxWidth:"100%"},children:(0,B.jsxs)(F,{to:`/${Y(n.schema,R)}`,style:{...Se,flexWrap:"wrap",gap:8,padding:"6px 14px 6px 10px",borderRadius:8,border:"1px solid var(--graview-edge-bright)",background:"var(--graview-panel)"},children:[(0,B.jsx)(fe,{kind:R,brand:a,schema:n.schema,size:7}),(0,B.jsx)("span",{style:{fontWeight:550,overflowWrap:"anywhere"},children:Q(n,R)}),(0,B.jsx)("span",{style:{...C,fontVariantNumeric:"tabular-nums"},children:G.length===0?"none yet":mt(G.length)})]})},R))})]}),l.length>0?(0,B.jsxs)("section",{style:{...ee,display:"grid",gap:10},children:[(0,B.jsx)("h2",{style:J,children:"Recently"}),(0,B.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:l.map(R=>(0,B.jsxs)("li",{style:C,children:[(0,B.jsx)("span",{style:{color:"var(--graview-ink)"},children:R.intent})," \u2014 ",yt(R,e,{graph:n.graph,schema:n.schema,...t.seats?{seats:t.seats}:{},...t.people?{people:t.people}:{}})]},R.id))})]}):null]})}var Ne=D(Fe(),1);var Xe=D(j(),1);function _t({context:t,withheld:e,style:n,testId:a}){let r=de(),i=ya(e,t.signIn??r?.signIn);return i?(0,Xe.jsx)("p",{style:{...n,margin:0},children:(0,Xe.jsx)("button",{type:"button","data-testid":"sign-in",onClick:()=>i.run(),style:xe,children:i.label})}):e.length===0?null:(0,Xe.jsx)("ul",{style:{...n,margin:0,padding:0,listStyle:"none",display:"grid",gap:4},...a?{"data-testid":a}:{},children:e.map(o=>(0,Xe.jsxs)("li",{style:C,children:[(0,Xe.jsx)("s",{children:o.label})," \u2014 ",o.refusal.message]},o.id))})}var E=D(j(),1);function qn({context:t}){let{store:e,brand:n,principal:a,invariantContext:r}=t;te(e);let[i]=dt(),o=i.get("q")??"",l=typeof r?.today=="string"?r.today:void 0,d=Sr(e,o,{...a?{principal:a}:{},places:Le(t),flagged:new Set(e.violations(r).flatMap(u=>u.nodeIds)),...l?{today:l}:{},limit:200}),c=d.hits.filter(u=>u.about==="node"),p=d.hits.filter(u=>u.about==="kind"||u.about==="place"||u.about==="rule"),m=[...new Set(c.map(u=>u.kind))],f=o.trim();return(0,E.jsxs)(ne,{context:t,children:[(0,E.jsx)("style",{children:Ht}),(0,E.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,E.jsx)("p",{style:ke,children:"Search"}),(0,E.jsx)(re,{context:t,"data-testid":"search-heading",children:f.length===0?"Find anything by its name":d.hits.length===0?(0,E.jsxs)(E.Fragment,{children:["Nothing here is called \u201C",f,"\u201D."]}):(0,E.jsxs)(E.Fragment,{children:[fo(e,d.byKind)," for \u201C",f,"\u201D"]})}),f.length>0?(0,E.jsxs)("p",{style:{...C,margin:0},"data-testid":"search-searched",children:[$t(e.schema,d.searched),d.conditions.filter(u=>u.key!=="is"&&u.admittedBy.length<d.searched.kinds.length).map(u=>(0,E.jsxs)("span",{children:[" ",u.key,":",u.value," narrows"," ",u.admittedBy.length===0?"nothing here":u.admittedBy.map(k=>Q(e,k).toLowerCase()).join(" and "),"."]},`${u.key}:${u.value}`))]}):(0,E.jsxs)("p",{style:ae,children:["Type in the box above. Words find the start of words in names and in what each record says;"," ",(0,E.jsx)("code",{children:"done:false"})," and the like narrow as a list does, and ",(0,E.jsx)("code",{children:"is:any"})," includes what is past."]})]}),p.length>0?(0,E.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},"data-testid":"search-named",children:p.map(u=>(0,E.jsx)("li",{"data-testid":"search-hit","data-about":u.about,children:u.about==="kind"?(0,E.jsxs)(F,{to:`/${Y(e.schema,u.kind)}`,style:K,children:[u.label,u.count>0?(0,E.jsxs)("span",{style:C,children:[" \xB7 ",u.count," match"]}):null]}):u.about==="place"?(0,E.jsxs)(F,{to:ye(t,u),style:K,children:["Go to ",u.title]}):u.about==="rule"?(0,E.jsxs)(F,{to:"/problems",style:K,children:["The rule \u201C",u.label,"\u201D"]}):null},`${u.about}:${u.about==="rule"?u.name:u.about==="place"?u.as:u.kind}`))}):null,m.map(u=>(0,E.jsxs)("section",{className:"graview-list",style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",minWidth:0},"data-testid":"search-group","data-kind":u,children:[(0,E.jsxs)("h2",{className:"graview-group-head",style:{alignItems:"center"},children:[(0,E.jsx)(fe,{kind:u,brand:n,schema:e.schema,size:8}),(0,E.jsx)(F,{to:`/${Y(e.schema,u)}?${new URLSearchParams({q:f}).toString()}`,style:K,"data-testid":"search-kind-link",children:Q(e,u)}),(0,E.jsx)("span",{children:d.byKind[u]})]}),(0,E.jsx)("ul",{className:"graview-rows",children:c.filter(k=>k.kind===u).map(k=>(0,E.jsxs)("li",{"data-testid":"search-hit","data-about":"node",className:"graview-row",children:[(0,E.jsxs)(F,{to:Z(e.schema,u,k.id),className:"graview-row-title",...k.label.length>60?{title:k.label}:{},children:[k.flagged?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("span",{role:"img","aria-label":"Breaks a rule:",style:{color:"var(--graview-warn)"},children:"\u26A0"})," "]}):null,k.label]}),k.apart||!k.current?(0,E.jsx)("span",{className:"graview-row-glance",children:[k.apart,k.current?"":"past"].filter(Boolean).join(" \xB7 ")}):null,(0,E.jsx)(Yt,{why:k.why})]},k.id))})]},u)),f.length>0?(0,E.jsx)(yo,{asked:f}):null,f.length>0&&d.hits.length===0?(0,E.jsx)(bi,{store:e,kinds:d.searched.kinds,words:d.words,...a?{principal:a}:{},...r?{invariantContext:r}:{}}):null]})}function Yt({why:t}){return t.strength==="near"?(0,E.jsxs)("span",{style:C,"data-testid":"search-why","data-near":"",children:["Near \u201C",t.asked,"\u201D",t.field==="label"?"":` \u2014 ${t.reading}: ${t.fragment}`]}):t.field==="label"?null:(0,E.jsxs)("span",{style:C,"data-testid":"search-why",children:[t.reading,": ",t.fragment]})}function fo(t,e){let n=Object.entries(e).map(([a,r])=>`${r} ${r===1?Be(t.schema.tryDefinition(a),a):Q(t,a).toLowerCase()}`);return n.length===0?"Found":n.length===1?Ce(n[0]):Ce(`${n.slice(0,-1).join(", ")} and ${n[n.length-1]}`)}function vi(t,e,n={}){let a=[];for(let r of e){let i=ze(t,r,{...n.principal?{principal:n.principal}:{},...n.invariantContext?{context:n.invariantContext}:{}});for(let o of Qt(t,r,i.actions.affordances))a.some(l=>l.mutation.name===o.mutation.name)||a.push(o)}return a}function Qt(t,e,n){let a=t.schema.tryDefinition(e)?.fieldRoles?.label,r=[];for(let i of n){let o=t.allMutations().find(c=>c.name===i.mutation);if(!o||!o.creates?.includes(e)||r.some(c=>c.mutation.name===o.name))continue;let l=Nt(o.input).map(c=>c.name),d=l.includes("label")?"label":a&&l.includes(a)?a:void 0;!d||i.args[d]!==void 0||r.push({kind:e,affordance:i,mutation:o,arg:d})}return r}function bi({store:t,kinds:e,words:n,principal:a,invariantContext:r}){let i=vi(t,e,{...a?{principal:a}:{},...r?{invariantContext:r}:{}});return i.length===0||n.trim().length===0?null:(0,E.jsx)("div",{style:{display:"grid",gap:24},"data-testid":"search-to-create",children:i.map(({kind:o,affordance:l,mutation:d,arg:c})=>(0,E.jsxs)("section",{style:{...ee,display:"grid",gap:14},children:[(0,E.jsxs)("h2",{style:J,children:[Ce(la(Be(t.schema.tryDefinition(o),o)))," called \u201C",n,"\u201D"]}),(0,E.jsx)(Ie,{store:t,mutation:d,prefilled:l.args,open:l.open,initial:{[c]:n},...a?{principal:a}:{}})]},`${l.id}|${n}`))})}function yo({asked:t}){let e=de();return e?(0,E.jsx)(ho,{asked:t,desk:e.aiDesk}):null}function ho({asked:t,desk:e}){return Ia(e)?(0,E.jsx)("p",{style:{margin:0},children:(0,E.jsxs)("button",{type:"button","data-testid":"search-ask",onClick:a=>Fa(e,{pointed:{about:[]},asked:t,returnTo:a.currentTarget}),style:{...K,font:"inherit",padding:0,border:0,background:"transparent",cursor:"pointer",textAlign:"start"},children:["Ask: \u2018",t,"\u2019"]})}):null}var b=D(j(),1),Si=8,xi=40;function wo(t,e){let n=e?.fields?.shape??{},a=Object.keys(n).find(r=>ca(n[r])&&da(t[r]));return a===void 0?void 0:t[a]}function Gn({context:t}){let e=Ve(),n=Ee(t.store.schema,e.slug??"");return n?(0,b.jsx)(Pi,{context:t,kind:n}):(0,b.jsx)(ne,{context:t,children:(0,b.jsx)(re,{context:t,children:"No such kind of thing here."})})}function Pi({context:t,kind:e,opening:n,row:a,layout:r="list",description:i,bare:o}){let{store:l,brand:d,invariantContext:c}=t;te(l);let[p,m]=dt(),f=`list-${(0,Ne.useId)().replace(/:/g,"")}`,u=l.schema.tryDefinition(e),k=ua(p.get("archived")),q=l.graph.nodesOfKind(e,{archived:k}),h=_e(l).relations.filter(s=>s.from===e||s.to===e),R=new Set(l.violations(c).flatMap(s=>s.nodeIds)),G=vr(l.schema,wr(l.schema,hr(l.schema,e))),M=h.map(s=>s.edgeKind),V=Po(p,G,M),z=["sort","filter","group","q","by","with","past","archived",...M].some(s=>p.has(s)),oe=q.length>=xi,pe=u?.fieldRoles?.when,I=t.views?.arrangement?.()?.lists?.[e],_=ur(I),ie=pr(I?.group),ve=xo(oe,pe),se=n??(_?{...ve,..._}:ve),ue=z?V.arrangement:Pn(se,G).arrangement,v=_?.sort,y=ue.sort&&v?.then&&ue.sort.by===v.by&&ue.sort.direction===v.direction?{...ue,sort:v}:ue,L=br(y.query??""),$=[...y.filter??[],...L.conditions].some(s=>s.key==="is"&&(s.value==="past"||s.value==="any"))||yr(u,[...y.filter??[],...L.conditions]),g=$||!u?.lifecycle?y:{...y,filter:[...y.filter??[],{key:"is",value:"current"}]},A=new Map,O=Ot(q,g,{schema:l.schema,graph:l.graph,flagged:R,...typeof c?.today=="string"?{today:c.today}:{},read:(s,w)=>{let N=A.get(s.id);return N||A.set(s.id,N=ft(l.schema,l.graph,s)),N[w]}}),ge=ie&&y.group?.by===ie.by&&!y.group.bucket?G.groups.find(s=>s.key===ie.by):void 0,et=ie&&ge&&(ge.type==="choice"||ge.type==="boolean")?gr(O.groups,ie,{type:ge.type,...ge.options?{options:ge.options}:{}}):O.groups.map(s=>({...s,closed:!1})),Te=new Set((p.get("open")??"").split(",").filter(Boolean)),Mi=!!y.query||(y.filter??[]).some(s=>s.key===ie?.by),zn=s=>ge?.type==="boolean"?s==="1"?"true":"false":s,_n=s=>s.closed&&!Mi&&!Te.has(zn(s.key)),Ei=s=>{let w=new URLSearchParams(p),N=new Set(Te);N.has(s)?N.delete(s):N.add(s),N.size>0?w.set("open",[...N].join(",")):w.delete("open"),m(w,{replace:!0})},De=O.nodes,pt=u?.lifecycle&&!$?q.filter(s=>rt(u,s)):q,Yn=q.length-pt.length,Jt=y.group?.by??null,Ni=s=>{let w=new URLSearchParams(p);for(let le of["sort","filter","group","q","by","with","past","archived",...h.map(Pt=>Pt.edgeKind)])w.delete(le);let N=xr(s);for(let le of["sort","filter","group","q","archived"])N[le]&&w.set(le,N[le]);![...w.keys()].some(le=>["sort","filter","group","q"].includes(le))&&(n||_||oe||pe)&&w.set("sort",""),m(w)},{principal:tt}=t,en=ze(l,e,{...tt?{principal:tt}:{},...t.invariantContext?{context:t.invariantContext}:{}}),Ke=en.actions.affordances.map(s=>({affordance:s,mutation:l.allMutations().find(w=>w.name===s.mutation)})).filter(s=>s.mutation!==void 0),$i=en.actions.withheld,tn=()=>new Set(De.length===0?Ke.map(({mutation:s})=>s.name):[]),[nn,Qn]=(0,Ne.useState)(()=>({kind:e,open:tn()}));nn.kind!==e&&Qn({kind:e,open:tn()});let Zn=s=>(nn.kind===e?nn.open:tn()).has(s),Xn=(s,w)=>Qn(N=>{let le=new Set(N.open);return w?le.add(s):le.delete(s),{kind:N.kind,open:le}}),Jn=`begin-${(0,Ne.useId)().replace(/:/g,"")}`,ea=L.words&&De.length===0?Object.fromEntries(Qt(l,e,en.actions.affordances).map(s=>[s.mutation.name,s.arg])):{},nt=Q(l,e),bt=t.views?.lookup(e,{cardinality:"one",fidelity:"glyph"}),an=bt!==void 0&&!ot(bt)?bt:void 0,rn=(y.group?.bucket??"day")==="day"?y.group?.by:void 0,on=(y.filter??[]).map(s=>s.key),Oi=on.filter(s=>on.indexOf(s)===on.lastIndexOf(s)&&/choice|boolean/.test(G.filters.find(w=>w.key===s)?.type??"")),sn=s=>{let w={...u?.computed?ft(l.schema,l.graph,s):s};rn&&!String(w[rn]).includes("T")&&delete w[rn];for(let N of Oi)delete w[N];return w},kt=s=>{let w=me(u,s);if(a)return(0,b.jsxs)("li",{"data-testid":"record-row","data-graview-record":s.id,style:{minWidth:0},...un(s.id),children:[pn(s,w),a(s,{label:w,href:Z(l.schema,e,s.id),flagged:R.has(s.id),glance:Kt(sn(s),u,w)})]},s.id);if(an){let gn=Wt(bt,s,l.graph),Ki=Object.fromEntries(Object.entries(sn(s)).filter(([Bi])=>!gn?.fields.has(Bi))),ia=gn?Kt(Ki,u,gn.title??w):"";return(0,b.jsxs)("li",{"data-testid":"record-row","data-graview-record":s.id,style:{position:"relative",display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:16,rowGap:2,paddingBlock:10,borderTop:"1px solid var(--graview-edge)"},...un(s.id),children:[pn(s,w),(0,b.jsx)("div",{style:{flex:"1 1 14rem",minWidth:0},children:(0,b.jsx)(an,{node:s,cardinality:"one",fidelity:"glyph",mode:"fullscreen",selected:!1,...R.has(s.id)?{flagged:[s.id]}:{}})}),ia?(0,b.jsx)("span",{style:{...C,flex:"0 1 auto",minWidth:0,overflowWrap:"anywhere"},"data-testid":"record-glance",children:ia}):null,(0,b.jsx)(Ro,{to:Z(l.schema,e,s.id),label:R.has(s.id)?`${w} \u2014 implicated in a problem`:w})]},s.id)}let N=Kt(sn(s),u,w),le=L.words?kr(u,s,L.words):void 0,Pt=oe?void 0:Xa(s,u),At=wo(s,u),ra=(0,b.jsxs)(F,{to:Z(l.schema,e,s.id),className:"graview-row-title",...w.length>60?{title:w}:{},children:[R.has(s.id)?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{role:"img","aria-label":"Breaks a rule:",style:{color:"var(--graview-warn)"},children:"\u26A0"})," "]}):null,w]});return(0,b.jsxs)("li",{className:"graview-row","data-graview-record":s.id,...un(s.id),children:[pn(s,w),Pt?(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,minWidth:0},children:[(0,b.jsx)(qe,{as:"thumb",file:Pt}),ra]}):ra,N||At?(0,b.jsxs)("span",{className:"graview-row-glance",children:[N,N&&At?" \xB7 ":null,At?(0,b.jsx)(Ft,{address:At}):null]}):null,le?(0,b.jsx)(Yt,{why:le}):null]},s.id)},ln=Le(t).filter(s=>s.kind===e),ta=I?.filters,Fi=(y.filter??[]).some(s=>s.key!=="is"||s.value!=="any"),Ii=!!(y.sort||y.group||y.query||Fi),Di=pt.length>=Si||z&&Ii,$e=y.sort?G.sorts.find(s=>s.key===y.sort.by):void 0,dn=$e?.type==="date"||$e!==void 0&&$e.key===pe,na=oe&&!O.grouped&&$e&&($e.about==="label"||$e.type==="text"||dn)?s=>{let w=$e.about==="label"?me(u,s):s[$e.key];if(typeof w!="string"||w.length===0)return dn?"No date":"#";if(dn)return w.slice(0,4);let N=w.trim().charAt(0).toLocaleUpperCase();return/\p{L}/u.test(N)?N:"#"}:void 0,je=na?De.reduce((s,w)=>{let N=na(w);return s.at(-1)?.key===N?s.at(-1).nodes.push(w):s.push({key:N,nodes:[w]}),s},[]):void 0,aa=O.grouped&&Jt?et.flatMap(s=>_n(s)?[]:s.nodes):je&&je.length>1?je.flatMap(s=>s.nodes):De,cn=(0,Ne.useMemo)(()=>aa.map(s=>s.id),[aa.map(s=>s.id).join(`
|
|
109
|
-
`)]),Me=Lr(cn),ut=(tt?l.permittedMutations(tt):l.permittedMutations()).some(s=>{let w=s.subject?.kinds;return w!==void 0&&(w==="*"||w.includes(e))}),pn=(s,w)=>ut?(0,b.jsx)("span",{className:"graview-choose-at",children:(0,b.jsx)("input",{...Me.boxProps(s.id,w),onPointerEnter:An,onFocus:An})}):null,un=s=>ut?{"data-graview-choose":s}:{},Wi=(0,Ne.useCallback)(s=>{Me.choose(s),requestAnimationFrame(()=>{let w=Me.list.current;((s[0]===void 0?null:w?.querySelector(`[data-graview-choose-box="${CSS.escape(s[0])}"]`))??w)?.focus({preventScroll:!0})})},[Me]),at=r==="grid"?{margin:0,padding:0,listStyle:"none",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 15rem), 1fr))",alignItems:"start",gap:12}:a||an?{margin:0,padding:0,listStyle:"none",display:"grid",gap:a&&r==="list"?6:0}:void 0,St=at?void 0:"graview-rows",gt=s=>`list-at-${s.replace(/[^\p{L}\p{N}]/gu,"_")}`,xt=h.map(s=>{let w=s.from===e?s.to:s.from,N=s.from===e?s.description:s.inverse??s.description;return{relation:s,far:w,words:N}}),Hi=new Set(xt.map(s=>(s.words??"").toLowerCase()).filter((s,w,N)=>s&&N.indexOf(s)!==w));return(0,b.jsxs)(o?So:ne,{context:t,children:[(0,b.jsxs)("div",{style:{display:"grid",gap:12},children:[(0,b.jsxs)("header",{style:{display:"grid",gap:4},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",columnGap:10,rowGap:4,minWidth:0},children:[(0,b.jsx)(fe,{kind:e,brand:d,schema:l.schema,size:8}),(0,b.jsx)(re,{context:t,children:nt}),Ke.length>0?(0,b.jsx)("span",{style:{marginLeft:"auto",display:"flex",flexWrap:"wrap",columnGap:14,rowGap:8},"data-testid":"beginnings-open",children:Ke.map(({affordance:s,mutation:w})=>(0,b.jsx)(Ao,{name:w.name,title:w.title??w.name,panel:`${Jn}-${w.name}`,open:Zn(w.name),onOpen:N=>Xn(w.name,N)},s.id))}):null]}),i??u?.description?(0,b.jsx)("p",{style:ae,children:i??u?.description}):null,xt.length>0||ln.length>0?(0,b.jsxs)("p",{style:{...C,margin:0,display:"flex",flexWrap:"wrap",columnGap:18,rowGap:2},"data-testid":"kind-related",children:[xt.length>0?(0,b.jsxs)("span",{"data-testid":"kind-relations",children:["Related:"," ",xt.map(({relation:s,far:w,words:N},le)=>(0,b.jsxs)("span",{"data-relation":s.edgeKind,children:[le>0?(0,b.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,w==="*"?Ce(N??be(s.edgeKind)):(0,b.jsx)(F,{to:`/${Y(l.schema,w)}`,style:K,title:Q(l,w),children:N&&Hi.has(N.toLowerCase())?`${Ce(N)}: ${Q(l,w).toLowerCase()}`:Ce(N??Q(l,w))})]},`${s.edgeKind}|${s.from}|${s.to}`))]}):null,ln.length>0?(0,b.jsxs)("span",{"data-testid":"kind-pictures",children:["Also as:"," ",ln.map((s,w)=>(0,b.jsxs)("span",{children:[w>0?(0,b.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,(0,b.jsx)(F,{to:ye(t,s),style:K,children:s.title})]},Qe(s)))]}):null]}):null]}),Ke.length>0?(0,b.jsx)("div",{style:{display:"contents"},"data-testid":"beginnings",children:Ke.map(({affordance:s,mutation:w})=>{let N=!!(ea[w.name]&&De.length===0);return(0,b.jsx)(Co,{name:w.name,id:`${Jn}-${w.name}`,description:w.description,open:Zn(w.name),onClose:()=>Xn(w.name,!1),children:(0,b.jsx)(Ie,{store:l,mutation:w,prefilled:s.args,open:s.open,...N?{initial:{[ea[w.name]]:L.words}}:{},...t.principal?{principal:t.principal}:{}},N?`${w.name}|${L.words}`:w.name)},s.id)})}):null,V.dropped.length>0?(0,b.jsxs)("p",{style:{...C,margin:0},"data-testid":"list-dropped",children:["This link asked for ",V.dropped.join(", "),", which ",nt.toLowerCase()," cannot be arranged by; the rest is shown."]}):null,pt.length>0?(0,b.jsx)(Cr,{schema:l.schema,graph:l.graph,kind:e,arrangement:y,onChange:Ni,kept:{shown:De.length,of:pt.length},noun:{one:Be(u,e),many:nt.toLowerCase()},...Di?{}:{allow:!1},...ta?{filters:ta}:{},offers:G,chips:{nodes:pt,flagged:R,...typeof c?.today=="string"?{today:c.today}:{}},query:t.framed===!0&&t.barAbove!==!0}):null,(0,b.jsx)("style",{children:Ht}),ut?(0,b.jsx)("style",{children:Tr+ko}):null,(0,b.jsx)("div",{className:"graview-list",...ut?{...Me.listProps,ref:Me.list,tabIndex:-1,"data-graview-choosable":"","aria-label":Me.chosen.length>0?`${nt}, ${Me.chosen.length} chosen`:nt,role:"group"}:{},children:De.length===0&&L.words?(0,b.jsxs)("p",{style:ae,"data-testid":"none-yet",children:["Nothing here is called \u201C",L.words,"\u201D."," ",(0,b.jsx)("span",{style:C,"data-testid":"list-searched",children:$t(l.schema,{kinds:[e],past:$})})," ",(0,b.jsx)(F,{to:"?",style:K,children:"Show every one"})]}):De.length===0?(0,b.jsxs)("p",{style:ae,"data-testid":"none-yet",children:[y.filter?.length||y.query?"None of them.":"None yet",!y.filter?.length&&!y.query&&Ke.length>0?` \u2014 the first one starts above, with \u201C${Ke[0]?.mutation.title??Ke[0]?.mutation.name}\u201D.`:!y.filter?.length&&!y.query?".":"",y.filter?.length||y.query?(0,b.jsxs)(b.Fragment,{children:[" ",(0,b.jsx)(F,{to:"?",style:K,children:"Show every one"})]}):null]}):O.grouped&&Jt?(0,b.jsx)("div",{style:{display:"grid",gap:"1rem"},"data-testid":"records","data-grouped":Jt,children:et.map(s=>{if(!s.closed)return(0,b.jsxs)("section",{style:{display:"grid",gap:0},"data-testid":"list-group",children:[(0,b.jsxs)("h2",{className:"graview-group-head",children:[s.label," ",(0,b.jsx)("span",{children:s.nodes.length})]}),(0,b.jsx)("ul",{style:at,className:St,"data-graview-rows":"",children:s.nodes.map(kt)})]},s.key||"-");let w=_n(s),N=`${f}-${gt(s.key||"none")}`;return(0,b.jsxs)("section",{style:{display:"grid",gap:0},"data-testid":"list-group","data-closed":w?"shut":"open",children:[(0,b.jsx)("h2",{className:"graview-group-head",children:(0,b.jsxs)("button",{type:"button",className:"graview-group-toggle","aria-expanded":!w,"aria-controls":N,"data-testid":"list-group-toggle",onClick:()=>Ei(zn(s.key)),children:[(0,b.jsx)("span",{"aria-hidden":"true",children:w?"\u25B8":"\u25BE"}),s.label," ",(0,b.jsxs)("span",{children:["\xB7 ",s.nodes.length]}),(0,b.jsxs)("span",{style:vo,children:[" ",s.nodes.length===1?Be(u,e):nt.toLowerCase()]})]})}),(0,b.jsx)("ul",{id:N,style:w?{...at,display:"none"}:at,className:St,"data-graview-rows":"",hidden:w,children:w?null:s.nodes.map(kt)})]},s.key||"-")})}):je&&je.length>1?(0,b.jsxs)("div",{style:{display:"grid",gap:14},"data-testid":"records","data-sectioned":$e?.type==="date"?"year":"letter",children:[(0,b.jsx)("nav",{"aria-label":"Jump to","data-testid":"list-index",style:{...C,display:"flex",flexWrap:"wrap",gap:$e?.type==="date"?"0 10px":"0 4px",lineHeight:1.3},children:je.map(s=>(0,b.jsx)("a",{href:`#${gt(s.key)}`,onClick:w=>{w.preventDefault(),document.getElementById(gt(s.key))?.scrollIntoView({block:"start"})},style:{...Se,minWidth:24,justifyContent:"center"},children:s.key},s.key))}),je.map(s=>(0,b.jsxs)("section",{"data-testid":"list-section","aria-labelledby":gt(s.key),style:{display:"grid",gap:0},children:[(0,b.jsx)("h2",{id:gt(s.key),className:"graview-group-head",children:s.key}),(0,b.jsx)("ul",{style:at,className:St,"data-graview-rows":"",children:s.nodes.map(kt)})]},s.key))]}):(0,b.jsx)("ul",{style:at,className:St,"data-testid":"records","data-graview-rows":"",children:De.map(kt)})}),ut?(0,b.jsx)(Mr,{store:l,chosen:Me.chosen,...tt?{principal:tt}:{},...c?{context:c}:{},anchor:bo,of:cn.length,onChooseAll:()=>Me.choose(cn),onClear:Me.clear,onActed:Wi}):null,Yn>0?(0,b.jsxs)(F,{to:ki(p,"filter","is:any"),style:{...K,...C,justifySelf:"start"},"data-testid":"past-link",children:["+",Yn," past"]}):null,k===!1&&l.graph.count(e,{archived:!0})>0?(0,b.jsxs)(F,{to:ki(p,"archived","true"),style:{...K,...C,justifySelf:"start"},"data-testid":"archived-link",children:["+",l.graph.count(e,{archived:!0})," archived"]}):null]}),(0,b.jsx)(_t,{context:t,withheld:$i,style:ee,testId:"withheld"})]})}var vo={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},bo=()=>document.querySelector("[data-graview-choosable]")?.closest("[data-embed-content]")??null,ko=`
|
|
110
|
-
.graview-list[data-graview-choosable]{outline:none}
|
|
111
|
-
.graview-list [data-graview-choose]{position:relative;padding-left:34px}
|
|
112
|
-
.graview-choose-at{position:absolute;left:2px;top:0;bottom:0;z-index:${ha.raised};display:flex;align-items:center}
|
|
113
|
-
@media (pointer: coarse){
|
|
114
|
-
.graview-list:not([data-graview-choosing]) [data-graview-choose]{padding-left:0}
|
|
115
|
-
.graview-list:not([data-graview-choosing]) .graview-choose-at{display:none}
|
|
116
|
-
}
|
|
117
|
-
`;function So({children:t}){return(0,b.jsx)("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:40,minWidth:0},children:t})}var xo=(t,e)=>e?{sort:{by:e,direction:"desc"}}:t?{sort:{by:"label",direction:"asc"}}:{};function Po(t,e,n){let a=Lt({...t.get("sort")?{sort:t.get("sort")}:{},...t.get("filter")?{filter:t.get("filter")}:{},...t.get("group")?{group:t.get("group")}:{},...t.get("q")?{q:t.get("q")}:{},...t.get("archived")?{archived:t.get("archived")}:{}}),r=[...a.filter??[]],i=t.get("by"),o=a.group??(i?{by:i}:void 0);for(let d of n){let c=t.get(d);c&&r.push({key:d,value:c})}let l=t.get("with");return l&&r.push({key:l,value:"*"}),t.get("past")==="1"&&!r.some(d=>d.key==="is")&&r.push({key:"is",value:"any"}),Pn({...a.sort?{sort:a.sort}:{},...a.query?{query:a.query}:{},...r.length>0?{filter:r}:{},...o?{group:o}:{},...a.archived!==void 0?{archived:a.archived}:{}},e)}function ki(t,e,n){let a=new URLSearchParams(t);return a.set(e,n),a.delete("past"),`?${a.toString()}`}function Ao({name:t,title:e,panel:n,open:a,onOpen:r}){return(0,b.jsxs)("button",{type:"button","data-testid":`act-open-${t}`,"data-graview-act":t,"aria-expanded":a,"aria-controls":n,onClick:()=>{r(!a),a||requestAnimationFrame(()=>document.getElementById(n)?.querySelector("input, select, textarea, button")?.focus())},style:{...Se,minHeight:28,margin:"-4px 0",padding:"0 2px",border:0,background:"none",font:"inherit",fontWeight:600,color:"var(--graview-ink)",cursor:"pointer"},children:[(0,b.jsx)("span",{"aria-hidden":"true",style:{marginRight:6},children:a?"\u2212":"+"}),e]})}function Co({name:t,id:e,description:n,open:a,onClose:r,children:i}){return(0,b.jsxs)("div",{"data-testid":`act-${t}`,id:e,hidden:!a,onKeyDown:o=>{o.key==="Escape"&&(o.preventDefault(),r(),document.querySelector(`[aria-controls="${e}"]`)?.focus())},style:a?{display:"grid",gap:12,padding:"4px 0 12px"}:void 0,children:[n?(0,b.jsx)("p",{style:{...C,margin:0,maxWidth:"58ch"},children:n}):null,i]})}function Ro({to:t,label:e}){let n=(0,Ne.useRef)(null);return Er(n),(0,b.jsx)(F,{ref:n,to:t,"aria-label":e,style:{position:"absolute",inset:0,borderRadius:6}})}var Je=D(Fe(),1);var vt=D(Fe(),1);var W=D(j(),1);function Vn({context:t}){let{store:e,brand:n,invariantContext:a,principal:r}=t;te(e);let i=e.violations(a),o=e.allInvariants(),l=Tt(e,i),d=Da(e.schema,o);return(0,W.jsxs)(ne,{context:t,children:[(0,W.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,W.jsx)(re,{context:t,children:i.length===0?"All rules hold":"What is broken"}),(0,W.jsx)("p",{style:ae,"data-testid":"problems-count",children:i.length===0?"Every declared rule is satisfied by what is here.":ga(i)})]}),(0,W.jsx)(wi,{context:t}),l.map((c,p)=>{let m=c.nodeIds[0],f=m?e.graph.getNode(m):void 0;return(0,W.jsxs)("section",{style:{display:"grid",gap:10,padding:"16px 18px",borderLeft:"3px solid var(--graview-warn)",background:"var(--graview-panel-warning)",borderRadius:"0 var(--graview-radius, 12px) var(--graview-radius, 12px) 0"},children:[c.line?null:(0,W.jsx)(Zt,{violation:c,schema:e.schema,...n?{brand:n}:{}}),f?(0,W.jsxs)("p",{style:{margin:0,display:"inline-flex",alignItems:"center",gap:8},children:[(0,W.jsx)(fe,{kind:f.kind,brand:n,schema:e.schema,size:7}),(0,W.jsx)(F,{to:Z(e.schema,f.kind,f.id),style:K,children:me(e.schema.tryDefinition(f.kind),f)})]}):null,c.line?(0,W.jsx)(Zt,{violation:c,schema:e.schema,...n?{brand:n}:{}}):null,(0,W.jsx)(Xt,{store:e,repairs:c.repairs,...r?{principal:r}:{}})]},p)}),o.length>0?(0,W.jsxs)("section",{style:{...ee,display:"grid",gap:12},"data-testid":"rules",children:[(0,W.jsx)("h2",{style:J,children:"The rules"}),(0,W.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:o.map(c=>{let p=i.filter(u=>u.invariant===c.name).length,m=d.get(c.name),f=c.label??c.name;return(0,W.jsxs)("li",{"data-graview-rule":c.name,style:{display:"grid",gap:2},children:[(0,W.jsxs)("span",{style:{display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:12,rowGap:2},children:[m?(0,W.jsx)(Mt,{line:m,schema:e.schema,...n?{brand:n}:{},style:{flex:"1 1 18rem"}}):(0,W.jsx)("span",{style:{flex:"1 1 18rem",fontWeight:550},children:f}),(0,W.jsx)("span",{style:{...C,color:p>0?"var(--graview-warn)":"var(--graview-ink-faint)"},children:p===0?"holds":`broken in ${p} ${p===1?"place":"places"}`})]}),m&&f.trim().length>0?(0,W.jsx)("span",{style:C,children:f}):null]},c.name)})})]}):null]})}function Zt({violation:t,schema:e,brand:n}){if(!t.line)return(0,W.jsx)("p",{style:{margin:0,color:"var(--graview-warn)",fontWeight:550},children:t.message});let a=Ha(t),r=Wa(t);return r?(0,W.jsxs)("div",{style:{display:"grid",gap:4},"data-testid":"problem-line",children:[(0,W.jsx)("p",{style:{margin:0,color:"var(--graview-warn)",fontWeight:550},"data-testid":"problem-says",children:r}),a?(0,W.jsx)("span",{style:C,children:a}):null,(0,W.jsxs)("details",{"data-testid":"problem-judged",style:C,children:[(0,W.jsx)("summary",{style:{cursor:"pointer",width:"fit-content",minHeight:24},children:"How it is judged"}),(0,W.jsx)(Mt,{line:t.line,schema:e,...n?{brand:n}:{},lead:"none"})]})]}):(0,W.jsxs)("div",{style:{display:"grid",gap:2},"data-testid":"problem-line",children:[(0,W.jsx)(Mt,{line:t.line,schema:e,...n?{brand:n}:{},lead:"none",style:{color:"var(--graview-warn)"}}),a?(0,W.jsx)("span",{style:C,children:a}):null]})}function Xt({store:t,repairs:e,principal:n}){let[a,r]=(0,vt.useState)(null),[i,o]=(0,vt.useState)(null),l=(0,vt.useRef)([]);if(e.length===0)return null;let d=a===null?null:e[a],c=d&&(d.missing??[]).length>0?t.allMutations().find(p=>p.name===d.mutation):void 0;return(0,W.jsxs)("div",{style:{display:"grid",gap:10},"data-testid":"repairs",children:[(0,W.jsx)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:e.map((p,m)=>{let f=(p.missing??[]).length>0,u=t.permits({name:p.mutation,args:{...p.args}},n);return u.ok?(0,W.jsx)("button",{ref:k=>{l.current[m]=k},type:"button","data-graview-repair":p.mutation,"data-graview-asks":f||void 0,"aria-expanded":f?a===m:void 0,onClick:()=>{if(o(null),f){r(a===m?null:m);return}r(null);try{t.apply({name:p.mutation,args:{...p.args}},n?{author:n}:{})}catch(k){o(st(t.schema,t.allMutations(),k))}},style:xe,children:f?`${p.label} \u2026`:p.label},m):(0,W.jsxs)("p",{"data-testid":"withheld","data-withheld":u.refusal.wouldNeed.join(",")||"nobody",style:{...C,margin:0},children:[(0,W.jsx)("s",{children:p.label})," \u2014 ",u.refusal.message]},m)})}),c&&d?(0,W.jsx)(Ie,{store:t,mutation:c,prefilled:{...d.args},only:d.missing??[],label:d.label,onDone:()=>{let p=a;r(null),requestAnimationFrame(()=>{let m=p===null?null:l.current[p];if(m?.isConnected){m.focus();return}let f=document.querySelector("[data-graview-page-title]")??document.querySelector("main h1, main h2");f&&(f.hasAttribute("tabindex")||(f.tabIndex=-1),f.focus())})},...n?{principal:n}:{}}):null,d&&!c&&(d.missing??[]).length>0?(0,W.jsxs)("p",{"data-testid":"refused",role:"alert",style:{margin:0,color:"var(--graview-warn)",fontSize:Cn},children:["\u201C",d.label,"\u201D names ",d.mutation,", which this app does not declare."]}):null,i?(0,W.jsx)("p",{"data-testid":"refused",role:"alert",style:{margin:0,color:"var(--graview-warn)",fontSize:Cn},children:i}):null]})}var Un=D(Fe(),1);var Ue=D(j(),1);function Ai({store:t,link:e,principal:n}){let[a,r]=(0,Un.useState)(!1),[i,o]=(0,Un.useState)(null),l=_a(e);return(0,Ue.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[(0,Ue.jsx)("button",{type:"button","data-graview-provisional":"",title:l,"aria-label":`Unsure link: ${l}`,"aria-expanded":a,onClick:()=>r(!a),style:{border:"1px dashed var(--graview-ink-muted)",borderRadius:999,background:"transparent",color:"var(--graview-ink-muted)",font:"inherit",fontSize:"0.75rem",lineHeight:1,padding:"2px 6px",cursor:"pointer"},children:"unsure"}),a?(0,Ue.jsxs)("span",{style:{...C,display:"inline-flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,Ue.jsx)("span",{children:l}),(0,Ue.jsx)("button",{type:"button",style:{...xe,padding:"4px 10px"},onClick:()=>{try{t.apply({name:ma,args:{kind:e.edge.kind,from:e.edge.from,to:e.edge.to}},n?{author:n}:{}),r(!1)}catch(d){o(st(t.schema,t.allMutations(),d))}},children:"Keep this link"}),i?(0,Ue.jsx)("span",{role:"alert",children:i}):null]}):null]})}var we=D(j(),1);function Ci({nodeId:t,node:e,field:n,inPlace:a,labelStyle:r=ke}){return n.files?(0,we.jsx)(qe,{as:"field",read:!a,nodeId:t,field:n.key,label:n.label,files:n.files,labelStyle:r,style:{gap:4}}):n.long?(0,we.jsx)(Ar,{nodeId:t,field:n.key,label:n.label,value:n.value,markdown:n.markdown,style:{gridColumn:"1 / -1",gap:4},labelStyle:r,valueStyle:{lineHeight:1.6}}):(0,we.jsxs)("div",{style:{display:"grid",gap:2,minWidth:0,alignContent:"start"},children:[(0,we.jsx)("dt",{style:r,children:n.label}),(0,we.jsx)("dd",{style:{margin:0,overflowWrap:"anywhere",minWidth:0},children:n.linked?(0,we.jsx)(er,{relation:n.linked.relation,refs:n.linked.refs,...a?{nodeId:t,field:n.key}:{}}):n.app?(0,we.jsx)(Ft,{address:n.app,as:"record",...a?{nodeId:t,field:n.key}:{}}):n.href?(0,we.jsx)(Pr,{href:n.href,field:n.key,value:n.value,stored:n.stored,...a?{nodeId:t}:{}}):a?(0,we.jsxs)(we.Fragment,{children:[(0,we.jsx)(It,{nodeId:t,field:n.key,value:n.value,stored:n.stored}),n.repeats?(0,we.jsx)(ar,{nodeId:t,field:n.key,start:e?.[n.key],value:e?.[`${n.key}Repeat`],label:`${n.label} repeats`}):null]}):n.value})]})}var S=D(j(),1),Lo=[];function jn({context:t}){let{store:e,brand:n,principal:a,invariantContext:r}=t;te(e);let i=de()!==null,o=Ve(),l=decodeURIComponent(o.id??""),d=ai(e,l,{...a?{principal:a}:{},...r?{context:r}:{}}),c=Tt(e,d?.violations??Lo),[p,m]=(0,Je.useState)(null),[f,u]=(0,Je.useState)(!1),[k,q]=(0,Je.useState)(null),h=(0,Je.useRef)(null),R=(0,Je.useRef)(null),G=g=>{(h.current?.parentElement?.querySelector(`[data-affordance="${g.replace(/["\\]/g,"\\$&")}"]`)??h.current)?.focus()};if(!d)return(0,S.jsx)(ne,{context:t,children:(0,S.jsx)(re,{context:t,children:"Nothing lives at this address."})});let M=e.graph.getNode(l),V=e.schema.tryDefinition(d.kind),z=V?.describe&&M?Ka(V,M):null,oe=[...e.log.all()].filter(g=>!Rt(g)&&(g.writes.includes(l)||g.reads.includes(l))).slice(-8).reverse(),pe=e.log.all().find(g=>!Rt(g)&&g.undoes===void 0&&g.primitives.some(A=>A.op==="add-node"&&A.node.id===l)),I=d.actions.affordances.filter(g=>g.provider!=="invariant"),_=I.filter(g=>g.destructive||g.setsAside),ie=f||_.length<2?I:I.filter(g=>!_.includes(g)),ve=t.views?.lookup(d.kind,{cardinality:"one",fidelity:"full"}),se=ve!==void 0&&!ot(ve)?ve:void 0,ue=se&&M?Wt(ve,M,e.graph):void 0,v=ue?d.fields.filter(g=>!ue.fields.has(g.key)):d.fields,y=ue?d.links.flatMap(g=>{let A=g.targets.filter(O=>!ue.records.has(O.id));return A.length>0?[{...g,targets:A}]:[]}):d.links,L=se!==void 0&&$a(ve),$=i&&Za(V).length>0;return(0,S.jsxs)(ne,{context:t,children:[(0,S.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,S.jsxs)("p",{style:{...ke,display:"flex",alignItems:"center",gap:8},children:[(0,S.jsx)(fe,{kind:d.kind,brand:n,schema:e.schema,size:8}),(0,S.jsx)(F,{to:`/${Y(e.schema,d.kind)}`,style:Se,children:Q(e,d.kind)})]}),(0,S.jsx)(re,{context:t,children:i&&M?.label===d.label?(0,S.jsx)(It,{nodeId:l,field:"label",value:d.label,said:d.label}):d.label}),z&&z!==d.label?(0,S.jsx)("p",{style:ae,children:z}):null,pe?.lineage?(0,S.jsxs)("p",{style:{...C,margin:0},"data-testid":"record-lineage",children:["Made by ",yt(pe,a,{graph:e.graph,schema:e.schema,...t.seats?{seats:t.seats}:{},...t.people?{people:t.people}:{}}),", ",vn(pe.lineage)]}):null,(0,S.jsx)(qt,{context:t,stop:`#focus=${encodeURIComponent(l)}`,style:{...K,...C},"data-testid":"spatial-link"}),i&&M?(0,S.jsx)(kn,{choices:[{on:"changed",record:l},{on:"act",record:l},{on:"reaches",kind:d.kind,condition:"",record:l}],label:"Notify me when this changes",testId:"record-notify",style:{...xe,...C,justifySelf:"start"}}):null,Le(t).some(g=>g.kind===d.kind||g.across===d.kind)?(0,S.jsxs)("p",{style:{...C,margin:0},"data-testid":"seen-in",children:["Seen in:"," ",Le(t).filter(g=>g.kind===d.kind||g.across===d.kind).map((g,A)=>(0,S.jsxs)("span",{children:[A>0?(0,S.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,(0,S.jsx)(F,{to:ye(t,g),style:K,children:g.title})," ",(0,S.jsx)(qt,{context:t,stop:`#view=${encodeURIComponent(g.as)}`,style:{...K,...C,display:"inline-block",minWidth:24,textAlign:"center"},title:`${g.title}, in the scene`,label:`${g.title}, in the scene`,children:(0,S.jsx)("span",{"aria-hidden":"true",children:"\u2197"})})]},Qe(g)))]}):null]}),M&&pa(M)?(0,S.jsx)(Mo,{context:t,id:l,kind:d.kind}):null,M&&fa(e,l)?(0,S.jsx)(To,{context:t,id:l,kind:d.kind}):null,se&&M?(0,S.jsx)("section",{"data-testid":"record-view",style:{display:"grid",minWidth:0},children:(0,S.jsx)(Nr,{children:(0,S.jsx)(se,{node:M,cardinality:"one",fidelity:"full",mode:"fullscreen",selected:!1,...d.violations.length>0?{flagged:[l]}:{}})})}):null,d.violations.length>0?(0,S.jsx)("section",{"data-testid":"record-violations",style:{display:"grid",gap:12,padding:"16px 18px",borderLeft:"3px solid var(--graview-warn)",background:"var(--graview-panel-warning)",borderRadius:"0 var(--graview-radius, 12px) var(--graview-radius, 12px) 0"},children:c.map((g,A)=>(0,S.jsxs)("div",{style:{display:"grid",gap:8},children:[(0,S.jsx)(Zt,{violation:g,schema:e.schema,...n?{brand:n}:{}}),(0,S.jsx)(Xt,{store:e,repairs:ri(d.actions,g.repairs),...a?{principal:a}:{}})]},A))}):null,!L&&(v.length>0||$)?(0,S.jsxs)("section",{style:{...ee,display:"grid",gap:14},"data-testid":"record-fields",children:[(0,S.jsx)("h2",{style:J,children:"The facts"}),qa(V,v).map((g,A)=>{let O=(0,S.jsx)("dl",{style:{margin:0,display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gap:"14px 24px"},children:g.fields.map(ge=>(0,S.jsx)(Ci,{nodeId:l,node:M,field:ge,inPlace:i},ge.key))});return g.title?(0,S.jsxs)("section",{style:{display:"grid",gap:10,minWidth:0},children:[(0,S.jsx)("h3",{"data-graview-field-group":g.title,style:{...J,fontSize:"inherit"},children:g.title}),O]},A):(0,S.jsx)("div",{children:O},A)}),$?(0,S.jsx)(qe,{as:"unfilled",nodeId:l,skip:[...ue?.fields??[]],labelStyle:ke,style:{gap:4}}):null]}):null,(L?[]:y).map(g=>(0,S.jsxs)("section",{style:{...ee,display:"grid",gap:10},children:[(0,S.jsx)("p",{style:ke,children:_r(e,g)}),g.description?(0,S.jsx)("h2",{style:J,children:Ce(g.description)}):(0,S.jsxs)("h2",{style:J,"aria-label":be(g.edgeKind),children:[g.direction==="in"?"\u2190 ":"\u2192 ",be(g.edgeKind)]}),(0,S.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"6px 18px"},children:g.targets.map(A=>{let O=Ya(e,g.direction==="in"?{kind:g.edgeKind,from:A.id,to:l}:{kind:g.edgeKind,from:l,to:A.id});return(0,S.jsxs)("li",{style:{display:"inline-flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,S.jsx)(fe,{kind:A.kind,brand:n,schema:e.schema,size:7}),(0,S.jsxs)(F,{to:Z(e.schema,A.kind,A.id),style:K,children:[A.label,A.apart?(0,S.jsxs)("span",{style:C,children:[" \xB7 ",A.apart]}):null]}),O?.provisional?(0,S.jsx)(Ai,{store:e,link:O,...a?{principal:a}:{}}):null]},A.id)})}),(g.direction==="out"&&e.schema.edge(g.edgeKind)?.cardinality==="one"?[]:[...new Set(g.targets.map(A=>A.kind))]).map(A=>(0,S.jsxs)(F,{to:`/${Y(e.schema,A)}?${encodeURIComponent(g.edgeKind)}=${encodeURIComponent(l)}`,style:{...K,...C},"data-testid":"related-all",children:["Sort and filter ",g.description??`these ${Q(e,A).toLowerCase()}`,g.targets.some(O=>O.kind!==A)?` (${Q(e,A).toLowerCase()})`:""," ",(0,S.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]},A))]},`${g.edgeKind}|${g.direction}|${g.description??""}`)),!L&&(I.length>0||d.actions.withheld.length>0)?(0,S.jsxs)("section",{style:{...ee,display:"grid",gap:14},"data-testid":"record-actions",children:[(0,S.jsx)("h2",{style:J,ref:h,tabIndex:-1,children:"What can be done"}),(0,S.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:8},children:[ie.map(g=>{let A=p===g.id;return(0,S.jsx)("button",{type:"button","data-affordance":g.id,"data-rank":g.rank,"data-graview-act":g.mutation,autoFocus:f&&g===_[0],"aria-expanded":A,onClick:()=>{m(A?null:g.id),A||requestAnimationFrame(()=>R.current?.querySelector("input:not([type=hidden]), select, textarea, button")?.focus())},style:{...xe,...A?{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"}:{}},children:g.label},g.id)}),ie.length<I.length?(0,S.jsxs)("button",{type:"button","aria-expanded":!1,onClick:()=>u(!0),style:{...xe,...C},"data-testid":"record-actions-more",children:["Show ",I.length-ie.length," more"]}):null]}),I.map(g=>{if(p!==g.id)return null;let A=e.allMutations().find(O=>O.name===g.mutation);return A?(0,S.jsxs)("div",{ref:R,onKeyDown:O=>{if(O.key!=="Escape"||O.defaultPrevented)return;O.preventDefault(),m(null);let ge=g.id;requestAnimationFrame(()=>G(ge))},style:{display:"grid",gap:10,padding:18,border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,S.jsx)("h3",{style:J,children:g.label}),A.description?(0,S.jsx)("p",{style:{...C,margin:0},children:A.description}):null,(0,S.jsx)(Ie,{store:e,mutation:A,prefilled:g.args,open:g.open,label:g.label,onDone:()=>{m(null),q(g.mutation);let O=g.id;requestAnimationFrame(()=>G(O))},...a?{principal:a}:{}})]},g.id):null}),i&&k!==null&&p===null?(0,S.jsx)(kn,{choices:[{on:"act",act:k,record:l},{on:"act",act:k}],label:"Notify me when someone else does this",testId:"notify-after-act",style:{...xe,...C,justifySelf:"start"}}):null,(0,S.jsx)(_t,{context:t,withheld:d.actions.withheld})]}):null,i?(0,S.jsx)(zr,{id:l,style:ee,headingStyle:J}):null,oe.length>0?(0,S.jsxs)("section",{style:{...ee,display:"grid",gap:10},"data-testid":"record-history",children:[(0,S.jsx)("h2",{style:J,children:"What has happened"}),(0,S.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:oe.map(g=>(0,S.jsxs)("li",{style:C,children:[(0,S.jsx)("span",{style:{color:"var(--graview-ink)"},children:g.intent}),g.lineage?(0,S.jsxs)("span",{"data-graview-lineage":"",children:[" \xB7 ",vn(g.lineage)]}):null," \u2014 ",yt(g,a,{graph:e.graph,schema:e.schema,...t.seats?{seats:t.seats}:{},...t.people?{people:t.people}:{}})]},g.id))})]}):null]})}function To({context:t,id:e,kind:n}){let{store:a,principal:r}=t,i={name:`allow-tidying-${n}`,args:{id:e}},o=a.allMutations().some(l=>l.name===i.name)&&a.permits(i,r).ok;return(0,S.jsxs)("section",{"data-testid":"record-left-alone",style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:12,padding:"12px 16px",border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,S.jsxs)("p",{style:{margin:0,flex:"1 1 16rem"},children:[(0,S.jsx)("strong",{children:"Left alone."})," Nothing automated changes it; tidying passes it by."]}),o?(0,S.jsx)("button",{type:"button",style:xe,"data-testid":"allow-tidying",onClick:()=>a.apply(i,r?{author:r}:{}),children:"Allow tidying again"}):null]})}function Mo({context:t,id:e,kind:n}){let{store:a,principal:r}=t,i={name:`unarchive-${n}`,args:{id:e}},o=a.allMutations().some(c=>c.name===i.name)&&a.permits(i,r).ok,l=[...a.log.all()].reverse().find(c=>!Rt(c)&&c.mergedInto!==void 0&&c.writes.includes(e)),d=l?.mergedInto!==void 0?a.graph.getNode(l.mergedInto):void 0;return(0,S.jsxs)("section",{"data-testid":"record-archived",style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:12,padding:"12px 16px",border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,S.jsxs)("p",{style:{margin:0,flex:"1 1 16rem"},children:[(0,S.jsx)("strong",{children:"Archived."})," Kept with its ties and history, and out of lists, counts and rules.",d?(0,S.jsxs)(S.Fragment,{children:[" ","Merged into ",(0,S.jsx)(F,{to:Z(a.schema,d.kind,d.id),style:K,children:me(a.schema.tryDefinition(d.kind),d)}),"."]}):null]}),o?(0,S.jsx)("button",{type:"button",style:xe,"data-testid":"bring-it-back",onClick:()=>a.apply(i,r?{author:r}:{}),children:"Bring it back"}):null]})}var P=D(j(),1),Eo=(0,U.lazy)(()=>(__graviewPreload(import.meta.url,["./chunk.WG5NIR23.js","./chunk.3ZRHHB7X.js","./chunk.UGFDSE37.js","./chunk.ZYCNEOAQ.js","./chunk.4DEUD66C.js","./chunk.LHO7L3CS.js","./chunk.YG423NEB.js","./chunk.VNBR4DHD.js","./chunk.Z3ZKYSPN.js","./chunk.6ONRWFA6.js","./chunk.AFY35RJP.js","./chunk.POHEWJKZ.js","./chunk.ROGYDMES.js","./chunk.6IHXTT6Z.js","./chunk.YXH3IWNR.js","./chunk.OEF3GPRM.js","./chunk.BRHRAVU2.js","./chunk.VTWFVPKD.js","./chunk.ZRQI5VJF.js","./chunk.33GN2NUT.js","./chunk.2VIGF4FO.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.2EJAIT33.js","./chunk.EUGWV3S6.js","./chunk.6XJP7F3I.js","./chunk.NPX7SPXM.js","./chunk.OE4QOBJF.js","./chunk.74RMHUCX.js","./chunk.GZHZLJBF.js","./chunk.I3SQJ2L2.js","./chunk.OJGHDWI6.js","./chunk.FUJM7GDV.js","./chunk.MWZK3HVG.js","./chunk.3D5T3XIE.js","./chunk.GR5Q4HTW.js","./chunk.QT4XGC5Z.js","./chunk.MQ7FNHXG.js","./chunk.WLPTY4BF.js","./chunk.AJZBJBMO.js"]),import("./chunk.L34FY7QQ.js")).then(t=>({default:t.DraftPage}))),No={kind:"human"};function $o({list:t,store:e}){let n=new Set(t.members.map(o=>o.kind)),a=t.total-t.members.length,r=n.size===1?[...n][0]:void 0;if(!r)return(0,P.jsx)("p",{className:"graview-spec-text graview-spec-more",children:`and ${a} more`});let i=it(e.schema,r).toLowerCase();return(0,P.jsx)("p",{className:"graview-spec-text graview-spec-more",children:(0,P.jsx)(F,{to:`/${Y(e.schema,r)}`,className:"graview-spec-link graview-spec-see-all","data-testid":"see-all",children:t.total===e.graph.nodesOfKind(r).length?`See all ${mt(t.total)} ${i}`:`${mt(a)} more \xB7 all ${i}`})})}function Oo({context:t,children:e}){let n=We(),a=t.store.schema,r=(0,U.useMemo)(()=>({href:i=>Z(a,i.kind,i.id),go:i=>n(Z(a,i.kind,i.id)),more:i=>(0,P.jsx)($o,{list:i,store:t.store})}),[a,n,t.store]);return(0,P.jsx)(Dt.Provider,{value:r,children:(0,P.jsx)($r.Provider,{value:(t.titleLevel??(t.framed&&!t.barAbove?1:2))-1,children:e})})}function Fo({steering:t}){let e=Pe(),n=We(),a=`${e.pathname}${e.search}`;return(0,U.useLayoutEffect)(()=>t.at(a),[a,t]),(0,U.useLayoutEffect)(()=>{let r=o=>{o!==a&&n(o)};t.go.current=r;let i=t.pending?.current;return i!==void 0&&(t.pending.current=void 0,r(i)),()=>{t.go.current===r&&(t.go.current=void 0)}},[a,n,t]),null}function Io({context:t,to:e}){let{pathname:n}=Pe(),a=de(),r=(e??a)?.sayWhere,i=Do(t,n);return(0,U.useEffect)(()=>(r?.(i),()=>r?.(null)),[r,i]),null}function Do(t,e){let[n="",a,r]=e.split("/").filter(Boolean).map(o=>{try{return decodeURIComponent(o)}catch{return o}});if(r!==void 0)return"#";if(n==="places"&&a!==void 0){if(a===yn)return"#overview=1";let o=t.views?.places().find(l=>l.as===a);return o?`#focus=${encodeURIComponent(Oe(o.kind))}&view=${encodeURIComponent(o.as)}`:"#"}let i=Ee(t.store.schema,n);return i?`#focus=${encodeURIComponent(a??Oe(i))}`:"#"}function Wo({onNavigate:t,path:e}){let n=Pe(),a=Ln(),r=We(),i=n.hash&&!n.hash.includes("=")?n.hash:"",o=`${n.pathname}${n.search}${i}`,l=(0,U.useRef)(t);l.current=t;let d=(0,U.useRef)(null);(0,U.useEffect)(()=>{let p=d.current;d.current=o,p!==null&&(o===p&&a!=="PUSH"||l.current?.(o,a==="POP"?"pop":a==="REPLACE"?"replace":"push"))},[n.key]);let c=(0,U.useRef)(e);return(0,U.useEffect)(()=>{e===void 0||e===c.current||(c.current=e,e!==o&&r(e))},[e]),null}function Ri({context:t,registry:e,page:n}){let a=Ve(),r=Ee(t.store.schema,a.slug??""),i=n==="list"?Gn:jn,l=(r?e?.lookup(r,n):void 0)??i;return(0,P.jsx)(l,{context:t})}function Ho({context:t,registry:e,children:n}){let a=(0,U.useRef)(null);return Oa(a),(0,P.jsx)("div",{ref:a,"data-graview-face":"pages",style:{display:"contents"},children:(0,P.jsx)(gi,{context:t,registry:e,root:a,children:(0,P.jsx)(fi,{context:t,root:a,children:n})})})}function Ko(t){return t instanceof HTMLElement?t.isContentEditable||t.tagName==="TEXTAREA"||t.tagName==="SELECT"?!0:t.tagName==="INPUT"&&!["button","submit","reset","checkbox","radio","image","file","color","range"].includes(t.type):!1}function Bo(){let{pathname:t}=Pe(),e=Ln(),n=(0,U.useRef)(null);(0,U.useLayoutEffect)(()=>{if(e!=="POP"){for(let i=n.current?.parentElement;i;i=i.parentElement){let{overflowY:o}=getComputedStyle(i);if((o==="auto"||o==="scroll")&&i.scrollHeight>i.clientHeight){i.scrollTop=0;return}}window.scrollTo(0,0)}},[t]);let a=(0,U.useRef)(t),r=(0,U.useRef)(!1);return(0,U.useEffect)(()=>{if(!r.current&&t===a.current)return;r.current=!0;let i=document.activeElement;if(Ko(i))return;let o=n.current?.closest("main")??document.querySelector("main"),d=n.current?.closest("[data-graview-face]")?.querySelector("[data-graview-page-title]")??o?.querySelector("h1, h2")??null??o??null;d&&(d.hasAttribute("tabindex")||d.setAttribute("tabindex","-1"),d.focus({preventScroll:!0}))},[t]),(0,P.jsx)("span",{ref:n,hidden:!0,"data-graview-scroll-reset":""})}function Li({context:t,children:e}){let n=We(),a=(0,U.useMemo)(()=>({record:(r,i)=>{let o=t.store.graph.getNode(r);o&&n(wt(Z(t.store.schema,o.kind,r),{section:i?.section}))},place:(r,i)=>{let o=t.views?.places().find(l=>l.as===r);o&&n(wt(ye(t,o),i))},list:(r,i)=>{t.store.schema.tryDefinition(r)&&n(wt(`/${Y(t.store.schema,r)}`,i))},draft:()=>n("/~draft")}),[t,n]);return(0,P.jsx)(Na.Provider,{value:a,children:e})}function qo(){let{pathname:t,search:e,hash:n}=Pe();return(0,U.useEffect)(()=>{let a=decodeURIComponent(n.replace(/^#/,""));if(!(!a||a.includes("=")))return di(a)},[t,e,n]),null}function Go({context:t,Home:e}){let n=Pe(),a=t.views,r=n.key==="default"&&!(a&&Ma(a));(0,U.useEffect)(()=>{a&&Ea(a)},[a]);let i=r?ka(t.views?.arrangement?.()?.first,t.store.schema,t.views?.places()??[]):void 0,o=i?.to==="place"?ye(t,i.place):i?.to==="kind"?`/${Y(t.store.schema,i.kind)}`:void 0;return o?(0,P.jsx)(Tn,{to:o,replace:!0}):(0,P.jsx)(e,{context:t})}function Ti({context:t,registry:e}){let n=e?.lookupSurface("shell"),a=n!==void 0,r=a&&(e?.without().has("bar")??!1),i=a&&!r&&!t.embedded?{...t,barAbove:!0}:t,o=k=>n===void 0?(0,P.jsx)(Gt,{context:t,children:k}):r?(0,P.jsx)(n,{context:t,children:k}):(0,P.jsx)(Gt,{context:t,children:(0,P.jsx)(n,{context:i,children:k})}),l=e?.lookupSurface("home")??Bn,d=e?.lookupSurface("problems")??Vn,c=a?{...i,framed:!0}:t,[p,m]=(0,U.useState)(null),f=(0,U.useMemo)(()=>({onFind:m,find:!(e?.without().has("find")??!1),places:!(e?.without().has("places")??!1)}),[e]),u=(0,P.jsx)(Li,{context:t,children:(0,P.jsx)(Ho,{context:t,registry:e,children:o((0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Qa,{face:"pages"}),(0,P.jsxs)(Oo,{context:c,children:[(0,P.jsx)(Bo,{}),(0,P.jsx)(qo,{}),(0,P.jsxs)(Jr,{children:[(e?.routes()??[]).map(({path:k,component:q})=>(0,P.jsx)(Re,{path:k,element:(0,P.jsx)(q,{context:c})},k)),(0,P.jsx)(Re,{path:"/",element:(0,P.jsx)(Go,{context:c,Home:l})}),(0,P.jsx)(Re,{path:"/problems",element:(0,P.jsx)(d,{context:c})}),(0,P.jsx)(Re,{path:"/~draft",element:(0,P.jsx)(U.Suspense,{fallback:null,children:(0,P.jsx)(Eo,{context:c})})}),(0,P.jsx)(Re,{path:"/search",element:(0,P.jsx)(qn,{context:c})}),(0,P.jsx)(Re,{path:"/map",element:(0,P.jsx)(Kn,{context:c})}),(0,P.jsx)(Re,{path:"/places",element:(0,P.jsx)(Wn,{context:c})}),Le(c).some(k=>k.as===yn)?null:(0,P.jsx)(Re,{path:ba,element:(0,P.jsx)(Tn,{to:"/",replace:!0})}),(0,P.jsx)(Re,{path:"/places/:as",element:(0,P.jsx)(Hn,{context:c})}),(0,P.jsx)(Re,{path:"/:slug",element:(0,P.jsx)(Ri,{context:c,registry:e,page:"list"})}),(0,P.jsx)(Re,{path:"/:slug/:id",element:(0,P.jsx)(Ri,{context:c,registry:e,page:"record"})})]})]})]}))})});return t.embedded||!a||r?u:(0,P.jsx)(ni.Provider,{value:f,children:(0,P.jsx)(mr.Provider,{value:p,children:u})})}var Vo=()=>typeof document>"u"?null:document.body;function Uo({context:t,registry:e,basename:n,initialPath:a,onNavigate:r,path:i,steering:o,firstLook:l}){let[d,c]=(0,U.useState)(void 0),p=d!==void 0&&d.from===t.principal?{...t,principal:d.seat}:t;(0,U.useState)(()=>p.views?Fr(p.views,p.store.schema,xn(p.brand,p.store.schema)):void 0);let m=de();oa({reader:p.locale??m?.locale,app:p.brand?.locale??p.app?.brand?.locale,readerTimeZone:p.timeZone??m?.timeZone,appTimeZone:p.brand?.timeZone??p.app?.brand?.timeZone});let f=p.principal??No,u=Ca(p.store,f,p.history),q=(u.past&&u.live===p.store?u.past.store:p.store).seenBy(f),h=q===p.store?p:{...p,store:q};Ra(p.store,p.principal);let R=(0,P.jsxs)(P.Fragment,{children:[r||i!==void 0?(0,P.jsx)(Wo,{onNavigate:r,path:i}):null,o?(0,P.jsx)(Fo,{steering:o}):null,h.presence||m?(0,P.jsx)(Io,{context:h,to:m}):null,(0,P.jsx)(Ti,{context:h,...e?{registry:e}:{}}),l?(0,P.jsx)(Ir,{firstLook:l,root:Vo,app:xn(p.brand,p.store.schema)}):null]}),G=h.views?(0,P.jsxs)(La,{store:h.store,views:h.views,...h.principal?{principal:h.principal}:{},...h.brand?{brand:h.brand}:{},...h.locale?{locale:h.locale}:{},...h.timeZone?{timeZone:h.timeZone}:{},...h.settings?{settings:h.settings}:{},...h.presence&&!m?{presence:h.presence}:{},...h.people?{people:h.people}:{},...h.seats?{seats:h.seats}:{},onSeat:z=>m?m.takeSeat(z):c({from:t.principal,seat:z}),...h.onKeepLens?{onKeepLens:h.onKeepLens}:{},...h.ai?{ai:h.ai}:{},...h.subscriptions?{subscriptions:h.subscriptions}:{},...h.signIn?{signIn:h.signIn}:{},resolveApp:h.resolveApp??m?.resolveApp,linkedRecords:h.linkedRecords??m?.linkedRecords,...h.app?{app:h.app}:{},...h.menuSections?{menuSections:h.menuSections}:{},children:[R,(0,P.jsx)(Li,{context:h,children:(0,P.jsx)(ci,{context:h})})]}):R,M=(0,P.jsx)(Aa.Provider,{value:u,children:G}),V=h.files?(0,P.jsx)(Pa.Provider,{value:h.files,children:M}):M;if(a!==void 0){let z=n===void 0?a:`${n.replace(/\/$/,"")}${a}`;return(0,P.jsx)(Xr,{initialEntries:[z],...n===void 0?{}:{basename:n},children:V})}return(0,P.jsx)(ei,{...n===void 0?{}:{basename:n},children:V})}export{_i as a,Uo as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b}from"./chunk.TKSGC6XH.js";import"./chunk.IM7LXLIB.js";import"./chunk.QYRPELLU.js";import"./chunk.FTJBW25J.js";import"./chunk.UT6642FC.js";import"./chunk.2EJAIT33.js";import"./chunk.EUGWV3S6.js";import"./chunk.6XJP7F3I.js";import"./chunk.NPX7SPXM.js";import"./chunk.OE4QOBJF.js";import"./chunk.74RMHUCX.js";import"./chunk.MWZK3HVG.js";import"./chunk.3D5T3XIE.js";import"./chunk.GR5Q4HTW.js";import"./chunk.WLPTY4BF.js";import"./chunk.AJZBJBMO.js";export{b as actOnSeveral,a as actsForSeveral};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as z,g as Z,h as ee}from"./chunk.POHEWJKZ.js";import{a as Q,b as X}from"./chunk.IEDXW36H.js";import{b}from"./chunk.7RSZMIAL.js";import{d as q}from"./chunk.6IHXTT6Z.js";import{a as K}from"./chunk.UT6642FC.js";import{h as I}from"./chunk.MWZK3HVG.js";import{m as J}from"./chunk.QT4XGC5Z.js";import{$ as v,Ba as _,H as F,K as P,P as L,Q as T,S as U,a as $,ha as G,oa as V,xa as Y}from"./chunk.MQ7FNHXG.js";import{Ua as H,ba as j,da as E,ob as A}from"./chunk.WLPTY4BF.js";import{b as W}from"./chunk.AJZBJBMO.js";var c=W(F(),1);var te=W(F(),1);function ne(){let{ai:i,aiDesk:n}=v(),{entries:r}=P(n),a=i.off===!0;return(0,te.useEffect)(()=>{a||n.load()},[n,a]),a?[]:r}var e=W(U(),1),ae=V($(()=>(__graviewPreload(import.meta.url,["./chunk.YPY5BOEI.js","./chunk.VKHKYK5L.js","./chunk.QT4XGC5Z.js","./chunk.MQ7FNHXG.js","./chunk.WLPTY4BF.js","./chunk.AJZBJBMO.js"]),import("./chunk.LU5LSXSW.js")))),ge=ae.part((i,n)=>(0,e.jsx)(i.InteractionRow,{...n}),{quiet:!0,as:"li"}),ue=ae.part((i,n)=>(0,e.jsx)(i.ActivityFilter,{...n}),{quiet:!0,as:"div"}),ie=(i,n,r=re(i,[n]))=>({intent:n.intent,author:n.author.kind,...n.author.id?{authorId:n.author.id}:{},by:n.author,...n.ops[0]?.via?{via:n.ops[0].via}:{},...n.lineage?{basis:K(n.lineage)}:{},touched:[...new Set(n.ops.filter(a=>!A(a)).flatMap(a=>a.writes))],...ce(n.ops.filter(a=>!A(a)).flatMap(a=>a.writes),r),batch:n.id,at:n.at,...n.lineage?.interaction?{interaction:n.lineage.interaction}:{},seq:n.ops.at(-1).seq+1,...n.ops.every(A)?{withheld:!0}:{}});function he(i=4){let{store:n,principal:r}=v(),a=T(n,r),d=a.log.length;return(0,c.useMemo)(()=>{let s=a.batches(),l=re(a,s);return Q(s,o=>a.log.get(o)).reverse().slice(0,i).map(o=>{if("batch"in o)return ie(a,o.batch,l);let g=[...o.digest.batches].reverse().map(u=>ie(a,u,l));return{intent:X(o.digest),author:o.digest.author.kind,...o.digest.author.id?{authorId:o.digest.author.id}:{},by:o.digest.author,touched:[...new Set(g.flatMap(u=>u.touched))],batch:"",...g[0]?.at?{at:g[0].at}:{},seq:g[0]?.seq??0,digest:g}})},[a,d,i])}function re(i,n){let r=new Map;for(let a of n)for(let d of a.ops)if(!A(d))for(let s of d.primitives)(s.op==="add-node"||s.op==="remove-node")&&s.node&&r.set(s.node.id,j(i.schema.tryDefinition(s.node.kind),s.node));return r}function ce(i,n){let r={};for(let a of i){let d=n.get(a);d!==void 0&&(r[a]=d)}return Object.keys(r).length>0?{named:r}:{}}function ye({change:i}){let{store:n,principal:r,seats:a,people:d}=v();return(0,e.jsxs)("strong",{style:{fontWeight:600},children:[i.author==="human"&&i.by?.onBehalfOf===void 0&&(i.authorId===void 0||r.id===void 0||i.authorId===r.id)?"you":H(i.by??{kind:i.author,id:i.authorId},{graph:n.graph,schema:n.schema,seats:a,people:d}),I(i.via)?(0,e.jsxs)("span",{style:{fontWeight:400,color:"var(--graview-ink-muted)"},children:[", ",I(i.via)]}):null]})}function fe({change:i,goes:n}){let{store:r}=v(),[a,d]=(0,c.useState)(!1),s=i.digest??[];return(0,e.jsxs)("li",{"data-testid":"activity-digest",style:{display:"grid",gap:5,lineHeight:1.45},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,e.jsxs)("span",{style:{minWidth:0},children:[(0,e.jsx)(ye,{change:i})," ",(0,e.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:i.intent})]}),(0,e.jsx)("button",{type:"button","data-testid":"digest-toggle","aria-expanded":a,onClick:()=>d(l=>!l),style:{marginLeft:"auto",flex:"0 0 auto",display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,padding:"1px 8px",fontSize:"0.75rem"},children:a?"Hide":"Show each"})]}),a?(0,e.jsx)("ol",{"data-testid":"digest-changes",style:{margin:0,padding:"0 0 0 10px",listStyle:"none",display:"grid",gap:6,borderLeft:"1px solid var(--graview-edge)"},children:s.map(l=>(0,e.jsxs)("li",{"data-testid":"digest-change",style:{display:"grid",gap:3},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,e.jsxs)("span",{style:{minWidth:0},children:[(0,e.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:l.intent}),l.basis?(0,e.jsxs)("span",{"data-graview-lineage":"",style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",l.basis]}):null]}),l.withheld?null:(0,e.jsx)(B,{batch:l.batch})]}),l.touched.length>0?(0,e.jsx)("div",{"data-touched":l.touched.join(" "),style:{display:"flex",flexWrap:"wrap",gap:4},children:l.touched.slice(0,4).map(o=>(0,e.jsx)(M,{id:o,label:r.graph.has(o)?b(r,o):l.named?.[o]??b(r,o),go:n(o)},o))}):null]},l.batch))}):null]})}function B({batch:i}){let{store:n,principal:r,noteSeat:a}=v(),d=T(n,r),s=L()?.open??!1,l=d.log.length,[o,g]=(0,c.useState)(null),u=(0,c.useMemo)(()=>d.canUndo(i),[d,i,l]);if(s||!u.ok&&u.ops.length===0)return null;let w=!u.ok,k=w?u.includeBatches:[];return(0,e.jsxs)("span",{style:{marginLeft:"auto",flex:"0 0 auto",display:"grid",justifyItems:"end",gap:2},children:[(0,e.jsx)("button",{type:"button","data-testid":"undo-turn",title:w?`${u.message} \u2014 undo those too`:"Take this back, keeping everything since",onClick:()=>{g(null);try{let m=d.log.all().find(x=>x.batch===i&&x.author.kind==="agent");d.undo(w?[i,...k]:i,{author:r}),m&&a({type:"home",author:m.author})}catch(m){g(m instanceof Error?m.message:String(m))}},style:{display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,padding:"1px 8px",fontSize:"0.75rem",...w?{borderColor:"var(--graview-warn)",color:"var(--graview-warn)"}:{}},children:w?`undo +${k.length}`:"undo"}),o?(0,e.jsx)("span",{"data-testid":"undo-refused",role:"alert",style:{fontSize:"0.75rem",lineHeight:1.4,color:"var(--graview-warn)",maxWidth:260,textAlign:"right"},children:o}):null]})}function me({seq:i,intent:n}){let r=L();if(!r)return null;let a=r.past?.seq===i;return(0,e.jsx)("button",{type:"button","data-testid":"show-past","aria-label":`Show the app as it was after \u201C${n}\u201D`,title:"Show the app as it was here","aria-pressed":a,onPointerEnter:z,onFocus:z,onClick:()=>r.show(i),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minHeight:24,minWidth:24,padding:"1px 6px",fontSize:"0.75rem",flex:"0 0 auto"},children:(0,e.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[(0,e.jsx)("path",{d:"M2.5 8 a5.5 5.5 0 1 0 1.6-3.9",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,e.jsx)("path",{d:"M2 2.5 V5.5 H5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,e.jsx)("path",{d:"M8 5 V8 L10 9.25",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})})}function ve(){let i=()=>{let n=new URL(window.location.href);return n.searchParams.set("fresh","1"),n.toString()};return(0,e.jsx)("a",{href:"#fresh","data-testid":"start-fresh",title:"Forget every edit made in this browser and return to the example",onClick:n=>{n.preventDefault(),window.location.assign(i())},style:{display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,fontSize:"0.8125rem",color:"var(--graview-ink-muted)",textDecoration:"underline",textDecorationColor:"var(--graview-edge-bright)",textUnderlineOffset:3},children:"Start fresh"})}function M({id:i,label:n,go:r}){return r?(0,e.jsx)("button",{type:"button","data-testid":"activity-record","data-record":i,title:`Go to ${n}`,onClick:()=>r(i),style:{all:"unset",display:"inline-flex",cursor:"pointer",borderRadius:7},className:"graview-activity-record",children:(0,e.jsx)(q,{label:n})}):(0,e.jsx)(q,{label:n})}function Oe({calls:i,seat:n,remembers:r=!1}){let a=he(),{store:d,principal:s,seats:l,people:o}=v(),g=ne(),[u,w]=(0,c.useState)("all"),[k,m]=(0,c.useState)(!1),x=t=>t!==void 0&&(t.id===s.id||t.onBehalfOf?.id===s.id)&&s.id!==void 0,oe=new Set(g.map(t=>t.id)),se=a.filter(t=>!(t.interaction!==void 0&&oe.has(t.interaction))&&(!k||x(t.by))),de=g.filter(t=>!k||x(t.by)).slice(0,4),C=[...u==="ai"?[]:se.map(t=>({at:t.at??"",change:t})),...u==="changes"?[]:de.map(t=>({at:t.at,entry:t}))].sort((t,y)=>t.at<y.at?1:t.at>y.at?-1:0),f=T(d,s),O=i.some(t=>t.phase==="running"),le=Z(),S=_("activity"),D=S.open,pe=G(),N=L(),R=t=>f.graph.has(t)?y=>{S.setOpen(!1),N?.past&&N.show(null),pe.record(y)}:null;return n===void 0&&i.length===0&&a.length===0&&g.length===0&&!r&&le===0?null:(0,e.jsxs)("div",{style:{position:"relative"},children:[(0,e.jsxs)("button",{type:"button","data-testid":"activity-button",...S.trigger,onClick:S.toggle,title:O?"An agent is working":"What has happened",style:{display:"inline-flex",alignItems:"center",gap:6,minHeight:30,padding:"0 8px",borderRadius:8,border:"1px solid transparent",background:"transparent",boxShadow:"none",fontSize:"0.875rem",whiteSpace:"nowrap",color:O?"var(--graview-accent)":"var(--graview-ink-muted)"},children:[O?(0,e.jsx)("span",{"aria-hidden":"true",style:{width:6,height:6,borderRadius:999,background:"var(--graview-accent)"}}):null,a.length>0?a.length:"",(0,e.jsxs)("svg",{className:"graview-activity-mark",width:"15",height:"15",viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",style:{display:"var(--graview-activity-mark, none)"},children:[(0,e.jsx)("circle",{cx:"8",cy:"8",r:"5.75",fill:"none",stroke:"currentColor",strokeWidth:"1.4"}),(0,e.jsx)("path",{d:"M8 4.75 V8 L10.25 9.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}),(0,e.jsx)("span",{className:"graview-activity-word",children:" Activity"})]}),!D&&n!==void 0?(0,e.jsx)("div",{hidden:!0,"data-testid":"agent-seat-seated",children:n}):null,D?(0,e.jsxs)("section",{...S.pane,"aria-label":"Activity","data-testid":"activity","data-graview-offstage":"",style:{...Y,width:300,maxHeight:"min(52cqh, 460px)",overflow:"auto",display:"flex",flexDirection:"column",gap:9,padding:12,borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:[(0,e.jsx)("h2",{style:{...J,margin:0},children:"Activity"}),n!==void 0?(0,e.jsxs)("div",{"data-testid":"agent-seat-row",style:{display:"grid",gap:5,paddingBottom:i.length>0||C.length>0?9:0,...i.length>0||C.length>0?{borderBottom:"1px solid var(--graview-edge)"}:{}},children:[(0,e.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:"The agent's seat"}),n]}):null,i.length>0?(0,e.jsx)("ol",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:7},children:i.slice(0,6).map((t,y)=>(0,e.jsxs)("li",{style:{display:"grid",gap:2,fontSize:"0.8125rem",lineHeight:1.45},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,e.jsx)("span",{"aria-hidden":"true",style:{width:6,height:6,borderRadius:999,flex:"0 0 auto",background:t.phase==="running"?"var(--graview-accent)":t.phase==="failed"?"var(--graview-warn)":"var(--graview-edge-bright)"}}),(0,e.jsxs)("span",{style:{color:"var(--graview-ink)"},children:[t.mutating?"changed":"read"," \xB7"," ",f.allMutations().find(p=>p.name===t.name)?.title??E(t.name)]})]}),!t.mutating&&t.reads&&t.reads.length>0?(0,e.jsxs)("div",{"data-testid":"activity-reads",style:{display:"flex",flexWrap:"wrap",gap:4,paddingLeft:12},children:[[...new Set(t.reads)].slice(0,3).map(p=>(0,e.jsx)(M,{id:p,label:b(f,p),go:R(p)},p)),new Set(t.reads).size>3?(0,e.jsxs)("span",{style:{color:"var(--graview-ink-muted)"},children:["+",new Set(t.reads).size-3]}):null]}):Object.values(t.args).some(p=>typeof p=="string")?(0,e.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4,paddingLeft:12},children:Object.entries(t.args).filter(p=>typeof p[1]=="string").slice(0,3).map(([p,h])=>(0,e.jsx)(M,{id:h,label:b(f,h),go:R(h)},p))}):null,t.error?(0,e.jsx)("div",{style:{paddingLeft:12,color:"var(--graview-warn)"},children:t.error}):null]},`${t.at}:${y}`))}):null,g.length>0?(0,e.jsx)(c.Suspense,{fallback:null,children:(0,e.jsx)(ue,{shows:u,onShows:w,mine:k,onMine:m})}):null,C.length>0?(0,e.jsx)("ol",{"data-testid":"diff-log",style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6,fontSize:"0.8125rem"},children:C.map(({change:t,entry:y},p)=>y!==void 0?(0,e.jsx)(c.Suspense,{fallback:null,children:(0,e.jsx)(ge,{entry:y,undo:h=>(0,e.jsx)(B,{batch:h})})},`ai:${y.id}`):t.digest?(0,e.jsx)(fe,{change:t,goes:R},`digest:${t.digest[0]?.batch??p}`):t.withheld?(0,e.jsx)("li",{"data-testid":"withheld-change",style:{display:"grid",gap:3,lineHeight:1.45},children:(0,e.jsx)("span",{"data-touched":"",style:{color:"var(--graview-ink-muted)",fontStyle:"italic"},children:t.intent})},`change:${p}`):(0,e.jsxs)("li",{"data-batch":t.batch,style:{display:"grid",gap:3,lineHeight:1.45},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,e.jsxs)("span",{style:{minWidth:0},children:[(0,e.jsxs)("strong",{style:{fontWeight:600},children:[t.author==="human"&&t.by?.onBehalfOf===void 0&&(t.authorId===void 0||s.id===void 0||t.authorId===s.id)?"you":H(t.by??{kind:t.author,id:t.authorId},{graph:f.graph,schema:f.schema,seats:l,people:o}),I(t.via)?(0,e.jsxs)("span",{style:{fontWeight:400,color:"var(--graview-ink-muted)"},children:[", ",I(t.via)]}):null]})," ",(0,e.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:t.intent}),t.basis?(0,e.jsxs)("span",{"data-graview-lineage":"",style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",t.basis]}):null]}),t.batch?(0,e.jsx)(me,{seq:t.seq,intent:t.intent}):null,t.batch?(0,e.jsx)(B,{batch:t.batch}):null]}),(0,e.jsx)("div",{"data-touched":t.touched.join(" "),style:{display:"flex",flexWrap:"wrap",gap:4},children:t.touched.slice(0,4).map(h=>(0,e.jsx)(M,{id:h,label:f.graph.has(h)?b(f,h):t.named?.[h]??b(f,h),go:R(h)},h))})]},`change:${p}`))}):null,(0,e.jsx)(ee,{style:{paddingTop:8,borderTop:"1px solid var(--graview-edge)"}}),r?(0,e.jsxs)("div",{"data-testid":"remembered",style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:10,paddingTop:8,borderTop:"1px solid var(--graview-edge)",fontSize:"0.8125rem",color:"var(--graview-ink-faint)"},children:[(0,e.jsx)("span",{children:"Remembered in this browser"}),(0,e.jsx)(ve,{})]}):null]}):null]})}export{B as a,Oe as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j}from"./chunk.IM7LXLIB.js";import"./chunk.QYRPELLU.js";import"./chunk.2EJAIT33.js";import"./chunk.EUGWV3S6.js";import"./chunk.6XJP7F3I.js";import"./chunk.NPX7SPXM.js";import"./chunk.OE4QOBJF.js";import"./chunk.74RMHUCX.js";import"./chunk.3D5T3XIE.js";import"./chunk.GR5Q4HTW.js";import"./chunk.WLPTY4BF.js";import"./chunk.AJZBJBMO.js";export{g as columnActs,d as columnChoices,c as columnMoves,b as columnOf,e as columnReach,f as columnSteps,i as describePlace,j as placeText,h as resolveFor,a as statusColumns};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk.GZHZLJBF.js";import{n as D}from"./chunk.I3SQJ2L2.js";import"./chunk.OJGHDWI6.js";import"./chunk.FUJM7GDV.js";import"./chunk.MWZK3HVG.js";import{a as $}from"./chunk.3D5T3XIE.js";import"./chunk.GR5Q4HTW.js";import"./chunk.QT4XGC5Z.js";import{H as P,S as C}from"./chunk.MQ7FNHXG.js";import{Ka as w,Ma as R,Qa as c,X as S}from"./chunk.WLPTY4BF.js";import{b as k}from"./chunk.AJZBJBMO.js";var m=k(P(),1);var e=k(C(),1),W=[["","Does not repeat"],["day","Daily"],["week","Weekly"],["month","Monthly"],["year","Yearly"]],E=r=>`${r}${r%100>=11&&r%100<=13?"th":["th","st","nd","rd"][r%10]??"th"}`,v={display:"flex",flexWrap:"wrap",gap:"6px 12px",alignItems:"center"};function N({value:r,onChange:d,start:p,label:s,name:l="repeat"}){let f=(0,m.useId)(),a=c(r)?r:void 0,i=typeof p=="string"&&/^\d{4}-\d{2}-\d{2}/.test(p)?p:void 0,u=i?w[new Date(`${i.slice(0,10)}T00:00:00Z`).getUTCDay()]:void 0,o=t=>{let n={...a??{every:"week"},...t};for(let b of Object.keys(n))n[b]===void 0&&delete n[b];d(n)},y=a?.every??"week",g=a?.on??(u?[u]:[]);return(0,e.jsxs)("fieldset",{"data-graview-part":"field","data-graview-field":"repeat","data-graview-repeat":l,style:{display:"grid",gap:8,border:"1px solid var(--graview-edge)",borderRadius:8,padding:"8px 12px",margin:0,minWidth:0},children:[(0,e.jsx)("legend",{"data-graview-part":"label",style:{padding:"0 4px"},children:s}),(0,e.jsxs)("div",{style:v,children:[(0,e.jsx)("label",{htmlFor:`${f}-every`,children:"Repeats"}),(0,e.jsx)("select",{id:`${f}-every`,name:`${l}.every`,value:a?.every??"",onChange:t=>{let n=t.target.value;d(n===""?void 0:{...a?.interval?{interval:a.interval}:{},...a?.until?{until:a.until}:{},every:n})},"data-graview-part":"control",children:W.map(([t,n])=>(0,e.jsx)("option",{value:t,children:n},t))}),a?(0,e.jsxs)("label",{style:v,children:["every",(0,e.jsx)("input",{type:"number",min:1,max:99,name:`${l}.interval`,"aria-label":`Every how many ${y}s`,value:a.interval??1,onChange:t=>o({interval:Number(t.target.value)>1?Math.min(99,Math.round(Number(t.target.value))):void 0}),style:{width:"4.5em"},"data-graview-part":"control"}),y,(a.interval??1)>1?"s":""]}):null]}),a?.every==="week"?(0,e.jsxs)("div",{role:"group","aria-label":"On",style:v,children:[(0,e.jsx)("span",{"aria-hidden":"true",children:"On"}),w.map((t,n)=>(0,e.jsxs)("label",{style:{display:"inline-flex",gap:4,alignItems:"center",minHeight:24},children:[(0,e.jsx)("input",{type:"checkbox",name:`${l}.on`,value:t,checked:g.includes(t),onChange:b=>{let h=w.filter(x=>x===t?b.target.checked:g.includes(x));o({on:h.length===0||h.length===1&&h[0]===u?void 0:h})}}),S(n,"short")]},t))]}):null,a?.every==="month"?(0,e.jsxs)("label",{style:v,children:["On",(0,e.jsxs)("select",{name:`${l}.on`,value:a.on?.[0]===-1?"last":"",onChange:t=>o({on:t.target.value==="last"?[-1]:void 0}),"data-graview-part":"control",children:[(0,e.jsx)("option",{value:"",children:i?`the ${E(Number(i.slice(8,10)))}`:"the same day"}),(0,e.jsx)("option",{value:"last",children:"the last day"})]})]}):null,a?(0,e.jsxs)("label",{style:v,children:["Until",(0,e.jsx)("input",{type:"date",name:`${l}.until`,value:a.until??"",onChange:t=>o({until:t.target.value||void 0}),"data-graview-part":"control"})]}):null,(0,e.jsx)("p",{"aria-live":"polite","data-graview-repeat-said":"",style:{margin:0,color:"var(--graview-ink-dim)",fontSize:"0.8125rem"},children:a?$(i??"",a):"Does not repeat"})]})}function M({nodeId:r,field:d,start:p,value:s,label:l}){let{fields:f,commit:a}=D(r),i=f.find(t=>t.field===R(d)&&t.takesValue&&t.open.length===0),[u,o]=(0,m.useState)(!1),[y,g]=(0,m.useState)(c(s)?s:void 0);return i?u?(0,e.jsxs)("form",{onSubmit:t=>{t.preventDefault(),o(!1),a(i,y??null)},style:{display:"grid",gap:6,marginTop:6},children:[(0,e.jsx)(N,{value:y,onChange:g,start:p,label:l,name:R(d)}),(0,e.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,e.jsx)("button",{type:"submit","data-graview-repeat-keep":d,children:"Keep"}),(0,e.jsx)("button",{type:"button",onClick:()=>o(!1),children:"Cancel"})]})]}):(0,e.jsx)("button",{type:"button","data-graview-repeat-open":d,onClick:()=>(g(c(s)?s:void 0),o(!0)),style:{marginInlineStart:8,fontSize:"0.75rem",padding:"1px 8px",borderRadius:999,minHeight:24},children:c(s)?"Change how it repeats":"Repeat\u2026"}):null}export{M as RepeatEditor,N as RepeatPicker};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk.MWZK3HVG.js";import"./chunk.3D5T3XIE.js";import{b as m}from"./chunk.GR5Q4HTW.js";import"./chunk.QT4XGC5Z.js";import{S as p}from"./chunk.MQ7FNHXG.js";import{T as l}from"./chunk.WLPTY4BF.js";import{b as f}from"./chunk.AJZBJBMO.js";var a=f(p(),1);function N({states:e,definition:v}){let s=e.values.reduce((t,n)=>t+n.count,0),u=t=>t===null?"with none":m(v,e.field,t).toLowerCase(),c=e.values.filter(t=>t.count>0).map(t=>`${l(t.count)} ${u(t.value)}`).join(", ");return s===0?null:(0,a.jsx)("div",{className:"graview-district-states",role:"img","aria-label":c,title:c,children:e.values.map((t,n)=>{if(t.count===0)return null;let y=e.values.filter(r=>r.count>0).length,w=t.count/s*(168-(y-1)),o=l(t.count),i=`${o} ${u(t.value)}`,d=r=>r.length*6.2+8<=w;return(0,a.jsx)("span",{"data-graview-tier":t.tier,style:{flexGrow:t.count},title:i,children:d(i)?i:d(o)?o:""},n)})})}export{N as StatesBar};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as n}from"./chunk.PUBG2L6F.js";import"./chunk.WG5NIR23.js";import"./chunk.3ZRHHB7X.js";import"./chunk.UGFDSE37.js";import{l as s}from"./chunk.ZYCNEOAQ.js";import"./chunk.4DEUD66C.js";import"./chunk.LHO7L3CS.js";import"./chunk.YG423NEB.js";import"./chunk.VNBR4DHD.js";import"./chunk.Z3ZKYSPN.js";import"./chunk.6ONRWFA6.js";import"./chunk.AFY35RJP.js";import"./chunk.POHEWJKZ.js";import"./chunk.ROGYDMES.js";import"./chunk.6IHXTT6Z.js";import"./chunk.YXH3IWNR.js";import"./chunk.OEF3GPRM.js";import"./chunk.BRHRAVU2.js";import"./chunk.VTWFVPKD.js";import"./chunk.ZRQI5VJF.js";import"./chunk.33GN2NUT.js";import"./chunk.2VIGF4FO.js";import"./chunk.FTJBW25J.js";import"./chunk.UT6642FC.js";import"./chunk.RZVZG2BQ.js";import"./chunk.MB7LKKUD.js";import"./chunk.WVUJXDXZ.js";import"./chunk.2EJAIT33.js";import"./chunk.EUGWV3S6.js";import"./chunk.6XJP7F3I.js";import"./chunk.NPX7SPXM.js";import"./chunk.OE4QOBJF.js";import"./chunk.74RMHUCX.js";import"./chunk.GZHZLJBF.js";import"./chunk.I3SQJ2L2.js";import"./chunk.OJGHDWI6.js";import"./chunk.FUJM7GDV.js";import"./chunk.MWZK3HVG.js";import"./chunk.3D5T3XIE.js";import"./chunk.GR5Q4HTW.js";import"./chunk.QT4XGC5Z.js";import{H as y,S as i}from"./chunk.MQ7FNHXG.js";import"./chunk.WLPTY4BF.js";import{b as r}from"./chunk.AJZBJBMO.js";var c=r(y(),1),e=r(i(),1);function v({store:d,views:t,as:a,scope:o}){let l=(0,c.useMemo)(()=>s({scope:`.${o}`}),[o]);return(0,e.jsxs)("div",{"data-testid":"embed-picture","data-embed-content":"",tabIndex:0,"aria-label":t.places().find(m=>m.as===a)?.title??"The picture",style:{flex:"1 1 auto",minHeight:0,display:"grid",gridTemplateRows:"minmax(0, 1fr)",overflow:"auto",background:"var(--graview-ground)",color:"var(--graview-ink)",fontFamily:"var(--graview-font-body, system-ui)"},children:[(0,e.jsx)("style",{children:l}),(0,e.jsx)(n,{store:d,views:t,as:a})]})}export{v as PictureFace};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{d as C,e as re}from"./chunk.33GN2NUT.js";import{e as ee}from"./chunk.2VIGF4FO.js";import{b as S}from"./chunk.GR5Q4HTW.js";import{m as X}from"./chunk.QT4XGC5Z.js";import{Ba as Q,H as se,S as Z,a as K,oa as V,xa as J}from"./chunk.MQ7FNHXG.js";import{N as Y,T as M,ba as U}from"./chunk.WLPTY4BF.js";import{b as D}from"./chunk.AJZBJBMO.js";var h=D(se(),1);var n=D(Z(),1),Re=9,le=40,ge=2;function de(e){let r=new Map;for(let i of e.allNodes())r.set(i.kind,(r.get(i.kind)??0)+1);return r}var ue=(e,r)=>(e.far??[]).reduce((i,a)=>i+(r.get(a)??0),0);function ce(e,r,i){if(i)return i.flatMap(s=>e.filters.filter(u=>u.key===s));let a=de(r),o=new Set(e.filters.filter(s=>s.about==="edge"&&ue(s,a)>le).map(s=>s.key));return e.filters.filter(s=>s.about==="edge"?!o.has(s.key):s.about==="via"?o.has(s.key.split(".")[0]):!0)}function pe(e,r){let i=e.filter(a=>a.about==="field"&&a.type==="choice"&&(a.options?.length??0)>0);return r?i:i.slice(0,ge)}var fe=520;function ye(e,r,i,a){let o=i.filters.find(s=>s.key===a.key);if(!o)return`${a.key}: ${a.value}`;if(o.about==="is")return a.value.charAt(0).toUpperCase()+a.value.slice(1);if(o.about==="via")return`${o.label}: ${S(e.tryDefinition(o.far?.[0]??""),o.key.split(".")[1],a.value)}`;if(o.about==="edge"){if(a.value==="*")return`${o.label}: anything`;if(a.value==="none")return`${o.label}: nothing`;let s=r.getNode(a.value);return`${o.label}: ${s?U(e.tryDefinition(s.kind),s):a.value}`}if(o.type==="date"){let[s,u]=a.value.split(":");return`${o.label} ${s} ${u?Y(u):""}`.trim()}if(o.type==="boolean")return`${o.label}: ${a.value==="true"?"yes":"no"}`;if(o.type==="number"){let s=a.value.lastIndexOf(":"),u=a.value.slice(0,Math.max(0,s));if(u==="at-most"||u==="at-least")return`${o.label}: ${u==="at-most"?"at most":"at least"} ${S(e.tryDefinition(i.kind),o.key,Number(a.value.slice(s+1)))}`}return o.type==="text"?`${o.label}: ${a.value}`:`${o.label}: ${S(e.tryDefinition(i.kind),o.key,a.value)}`}var P=e=>/^[A-Z][a-z]/.test(e)?e.charAt(0).toLowerCase()+e.slice(1):e;function me(e){return e?.type==="date"?{asc:"Earliest first",desc:"Latest first"}:e?.type==="number"?{asc:"Lowest first",desc:"Highest first"}:e?.type==="boolean"?{asc:"No first",desc:"Yes first"}:e?.type==="choice"?{asc:"In their order",desc:"In reverse order"}:{asc:"A to Z",desc:"Z to A"}}var x=V(K(()=>(__graviewPreload(import.meta.url,["./chunk.VTWFVPKD.js","./chunk.ZRQI5VJF.js","./chunk.33GN2NUT.js","./chunk.2VIGF4FO.js","./chunk.MWZK3HVG.js","./chunk.3D5T3XIE.js","./chunk.GR5Q4HTW.js","./chunk.QT4XGC5Z.js","./chunk.MQ7FNHXG.js","./chunk.WLPTY4BF.js","./chunk.AJZBJBMO.js"]),import("./chunk.EZP4FHDX.js")))),N=x.part((e,r)=>(0,n.jsx)(e.ArrangeLists,{...r}),{what:"This list",quiet:!0}),he=x.part((e,r)=>(0,n.jsx)(e.ArrangeChips,{...r}),{what:"This list",quiet:!0}),Te=()=>x.load(),q=new Map;function Ie(e){let{schema:r,graph:i,kind:a,arrangement:o,onChange:s}=e,u=e.offers??ee(r,a),g=e.testId??"arrange",y=C(e.allow,"sort")&&u.sorts.length>1,m=C(e.allow,"group")&&u.groups.length>0,F=C(e.allow,"filter")?ce(u,i,e.filters):[],L=e.chips?pe(F,e.filters):[],H=F.filter(t=>!L.includes(t)),G=H.length>0,_=e.query!==!1&&e.allow!==!1,w=we(e.noun,e.kept),v=e.past&&e.past.count>0?e.past:null;if(!y&&!m&&!G&&!_&&!w&&!v)return null;let z=t=>JSON.stringify(re(t)),O=`${g}|${a}`,p={current:q.get(O)??{words:new Set,latest:null,at:0}};q.set(O,p.current),p.current.latest&&Date.now()-p.current.at>1500&&!p.current.words.has(z(o))&&(p.current={words:new Set,latest:null,at:0},q.set(O,p.current));let d=p.current.latest??o,b=t=>{let l={...p.current.latest??o,...t};for(let c of Object.keys(l))l[c]===void 0&&delete l[c];p.current.latest=l,p.current.at=Date.now(),p.current.words.add(z(l)),s(l)},f=d.filter??[],R=t=>{let l=f.filter((c,I)=>I!==t);b({filter:l.length>0?l:void 0})},A=t=>f.some(l=>l.key===t.key&&l.value===t.value),te=t=>A(t)?R(f.findIndex(l=>l.key===t.key&&l.value===t.value)):b({filter:[...f,t]}),T=d.sort?u.sorts.find(t=>t.key===d.sort.by):void 0,j=d.group?u.groups.find(t=>t.key===d.group.by):void 0,ne=me(T),k={schema:r,graph:i,offers:{...u,filters:H},arrangement:d,set:b,toggle:te,has:A,testId:g},ae=(t,l)=>A({key:t,value:l})?R(f.findIndex(c=>c.key===t&&c.value===l)):b({filter:[...f.filter(c=>c.key!==t),{key:t,value:l}]}),oe=d.sort?(0,n.jsxs)(n.Fragment,{children:["Sorted by ",P(T?.label??d.sort.by),(0,n.jsx)("span",{"aria-hidden":"true",children:d.sort.direction==="desc"?" \u2193":" \u2191"})]}):"Sort",ie=d.group?.bucket&&j?.buckets?`, a ${d.group.bucket} each`:"",B=d.group?`Grouped by ${P(j?.label??d.group.by)}${ie}`:"Group";return(0,n.jsxs)("div",{"data-testid":`${g}-bar`,role:"group","aria-label":"Arrange",className:"graview-arrange",style:e.style,onPointerEnter:x.prefetch,onFocus:x.prefetch,children:[(0,n.jsx)("style",{children:xe}),(0,n.jsxs)("div",{className:"graview-arrange-line",children:[w?(0,n.jsxs)("span",{className:"graview-arrange-count","data-testid":`${g}-count`,children:[w.kept?(0,n.jsx)("span",{"data-testid":`${g}-kept`,children:w.kept}):null,w.words]}):null,v?(0,n.jsxs)("button",{type:"button",className:"graview-arrange-open","data-testid":`${g}-past`,title:`${M(v.count)} more behind the horizon \u2014 press to widen the view to the past`,onClick:t=>{let l=t.currentTarget.closest("[data-graview-view]"),c=t.currentTarget;v.widen();let I=0,W=()=>{if(document.activeElement!==c&&document.activeElement!==document.body&&c.isConnected)return;let $=l?.querySelector('[role="group"][aria-label="Arrange"] :is(button, input)');if($&&$!==c&&$.isConnected)return $.focus({preventScroll:!0});++I<120&&requestAnimationFrame(W)};requestAnimationFrame(W)},children:["+",M(v.count)," past"]}):null,f.map((t,l)=>{let c=ye(r,i,u,t);return(0,n.jsxs)("span",{className:"graview-arrange-token","data-testid":`${g}-condition`,children:[c,(0,n.jsx)("button",{type:"button","aria-label":`Remove: ${c}`,title:"Remove",onClick:()=>R(l),children:"\xD7"})]},`${t.key}:${t.value}`)}),y?(0,n.jsx)("span",{className:"graview-arrange-part graview-arrange-one",children:(0,n.jsx)(E,{testId:`${g}-sort`,value:d.sort?.by??"",set:d.sort!==void 0,label:"Sort",name:d.sort?`Sorted by ${P(T?.label??d.sort.by)}, ${ne[d.sort.direction].toLowerCase()}`:"Sort",list:t=>(0,n.jsx)(N,{which:"sort",done:t,...k}),children:oe})}):null,m?(0,n.jsx)("span",{className:"graview-arrange-part graview-arrange-one",children:(0,n.jsx)(E,{testId:`${g}-group`,value:d.group?.by??"",set:d.group!==void 0,label:"Group",name:B,list:t=>(0,n.jsx)(N,{which:"group",done:t,...k}),children:B})}):null,G?(0,n.jsx)("span",{className:"graview-arrange-part",children:(0,n.jsx)(E,{testId:`${g}-add`,value:"",set:!1,label:"Filter",name:f.length>0?`Filter \u2014 ${f.length} on`:"Filter",list:t=>(0,n.jsx)(N,{which:"filter",done:t,...k}),children:"Filter"})}):null,y||m?(0,n.jsx)("span",{className:"graview-arrange-part graview-arrange-all",children:(0,n.jsx)(E,{testId:`${g}-all`,value:"",set:!1,label:"Arrange",name:"Arrange: sort and group",list:t=>(0,n.jsx)(N,{which:"all",done:t,parts:{sort:y,group:m,filter:!1},...k}),children:"Arrange"})}):null,_?(0,n.jsxs)("label",{className:"graview-arrange-words-at",children:[(0,n.jsx)("span",{style:X,children:"Find"}),(0,n.jsx)("input",{type:"search",className:"graview-arrange-words","data-testid":`${g}-query`,value:d.query??"",placeholder:"Find\u2026",onChange:t=>b({query:t.target.value.length>0?t.target.value:void 0})})]}):null,L.length>0&&e.chips?(0,n.jsx)(h.Suspense,{fallback:null,children:(0,n.jsx)(he,{offers:L,chips:e.chips,schema:r,graph:i,kind:a,arrangement:d,has:A,choose:ae,testId:g})}):null]})]})}function we(e,r){if(!r)return null;let i=r.shown!==r.of;if(!e)return i?{words:"",kept:`${r.shown} of ${r.of}`}:null;let a=r.of===1?e.one:e.many;return i?{words:` ${a}`,kept:`${r.shown} of ${r.of}`}:{words:`${r.of} ${a}`}}function E({testId:e,value:r,set:i,label:a,name:o,list:s,children:u}){let g=Q("arrange",{align:"start"}),y=(0,h.useRef)(null);return(0,h.useEffect)(()=>{g.open&&y.current?.querySelector('[aria-pressed="true"]')?.focus({preventScroll:!0})},[g.open]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("button",{type:"button",className:"graview-arrange-open","data-testid":e,"data-set":i?"":void 0,value:r,"aria-label":o,...g.trigger,onClick:g.toggle,children:[u,(0,n.jsx)(be,{})]}),g.open?(0,n.jsx)("div",{...g.pane,ref:m=>{g.pane.ref(m),y.current=m},role:"group","aria-label":a,"data-testid":"arrange-list","data-arrange":e,className:"graview-arrange-list",style:J,onKeyDown:ve,children:s(()=>g.setOpen(!1))}):null]})}function ve(e){if(!["ArrowDown","ArrowUp","Home","End"].includes(e.key))return;let r=[...e.currentTarget.querySelectorAll("button:not([disabled]), input")];if(r.length===0)return;let i=r.indexOf(document.activeElement);if(document.activeElement instanceof HTMLInputElement&&document.activeElement.type==="date"&&(e.key==="ArrowUp"||e.key==="ArrowDown"))return;e.preventDefault();let a=e.key==="Home"?0:e.key==="End"?r.length-1:e.key==="ArrowDown"?(i+1)%r.length:(i-1+r.length)%r.length;r[a].focus()}function be(){return(0,n.jsx)("svg",{width:"9",height:"9",viewBox:"0 0 10 10","aria-hidden":"true",focusable:"false",style:{flex:"0 0 auto",opacity:.7},children:(0,n.jsx)("path",{d:"M2 3.5 L5 6.5 L8 3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}var xe=`
|
|
2
|
-
.graview-arrange{container-type:inline-size;box-sizing:border-box;width:100%;min-width:0;max-width:100%}
|
|
3
|
-
.graview-arrange-line{display:flex;flex-wrap:wrap;align-items:center;gap:2px 6px;min-width:0;font-size:.875rem;line-height:1.35;color:var(--graview-ink-muted)}
|
|
4
|
-
.graview-arrange-count{margin-right:2px;color:var(--graview-ink-muted)}
|
|
5
|
-
.graview-arrange-part{display:inline-flex;align-items:center;min-width:0}
|
|
6
|
-
.graview-arrange-count~.graview-arrange-part::before{content:"\xB7" / "";margin-right:6px;color:var(--graview-ink-muted)}
|
|
7
|
-
.graview-arrange-open{display:inline-flex;align-items:center;gap:5px;min-height:28px;min-width:0;max-width:100%;margin:0;padding:0 6px;border:1px solid transparent;border-radius:7px;background:none;box-shadow:none;font:inherit;letter-spacing:normal;text-transform:none;text-align:left;color:var(--graview-ink-muted);cursor:pointer}
|
|
8
|
-
.graview-arrange-open[data-set]{color:var(--graview-ink)}
|
|
9
|
-
.graview-arrange-open:hover,.graview-arrange-open[aria-expanded=true]{border-color:var(--graview-edge);color:var(--graview-ink)}
|
|
10
|
-
.graview-arrange :focus-visible,.graview-arrange-list :focus-visible{outline:2px solid var(--graview-accent);outline-offset:1px}
|
|
11
|
-
.graview-arrange-all{display:none}
|
|
12
|
-
@container (max-width: ${fe-1}px){.graview-arrange-one{display:none}.graview-arrange-all{display:inline-flex}}
|
|
13
|
-
.graview-arrange-token{display:inline-flex;align-items:center;gap:0;min-width:0;min-height:26px;box-sizing:border-box;padding:0 2px 0 10px;border:1px solid var(--graview-edge);border-radius:999px;background:var(--graview-panel);color:var(--graview-ink);overflow-wrap:anywhere}
|
|
14
|
-
.graview-arrange-token button{display:inline-flex;align-items:center;justify-content:center;min-width:24px;min-height:24px;margin:0;padding:0;border:0;border-radius:6px;background:none;font:inherit;line-height:1;color:var(--graview-ink-muted);cursor:pointer}
|
|
15
|
-
.graview-arrange-token button:hover{color:var(--graview-ink);background:color-mix(in srgb,var(--graview-ink) 7%,transparent)}
|
|
16
|
-
.graview-arrange-words-at{display:inline-flex;min-width:0;max-width:100%}
|
|
17
|
-
.graview-arrange-words{box-sizing:border-box;width:min(100%,12rem);min-height:28px;margin:0;padding:0 8px;border:1px solid transparent;border-radius:7px;background:transparent;font:inherit;color:var(--graview-ink)}
|
|
18
|
-
.graview-arrange-words:hover,.graview-arrange-words:focus{border-color:var(--graview-edge)}
|
|
19
|
-
`;function De(e){let r=[];return e.query&&r.push(`\u201C${e.query}\u201D`),e.filter?.length&&r.push(`${e.filter.length} condition${e.filter.length===1?"":"s"}`),e.group&&r.push(`by ${e.group.by}`),e.sort&&r.push(`sorted by ${e.sort.by}`),r.length>0?r.join(" \xB7 "):null}export{Re as a,le as b,ge as c,de as d,ue as e,ce as f,pe as g,fe as h,ye as i,P as j,me as k,Te as l,Ie as m,De as n};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as a,k as o}from"./chunk.YG423NEB.js";import"./chunk.VNBR4DHD.js";import"./chunk.Z3ZKYSPN.js";import"./chunk.6ONRWFA6.js";import"./chunk.ROGYDMES.js";import"./chunk.6IHXTT6Z.js";import"./chunk.YXH3IWNR.js";import"./chunk.OEF3GPRM.js";import"./chunk.BRHRAVU2.js";import"./chunk.ZRQI5VJF.js";import"./chunk.33GN2NUT.js";import"./chunk.2VIGF4FO.js";import"./chunk.WVUJXDXZ.js";import"./chunk.2EJAIT33.js";import"./chunk.EUGWV3S6.js";import"./chunk.6XJP7F3I.js";import"./chunk.NPX7SPXM.js";import"./chunk.OE4QOBJF.js";import"./chunk.74RMHUCX.js";import"./chunk.GZHZLJBF.js";import"./chunk.I3SQJ2L2.js";import"./chunk.OJGHDWI6.js";import"./chunk.FUJM7GDV.js";import"./chunk.MWZK3HVG.js";import"./chunk.3D5T3XIE.js";import"./chunk.GR5Q4HTW.js";import"./chunk.QT4XGC5Z.js";import{ma as n}from"./chunk.MQ7FNHXG.js";import"./chunk.WLPTY4BF.js";import"./chunk.AJZBJBMO.js";var w=new WeakMap;function s(e,i){let t=w.get(e);t||w.set(e,t=new Map);let r=t.get(i);return r||t.set(i,r=a(o(e,n(e)),e,i)),r}export{s as frameworkViews};
|