graview 0.1.34 → 0.1.35
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.XXMYKBLT.js → chunk.2OBIO5Y6.js} +1 -1
- package/dist/preview/{chunk.3MWBWSYF.js → chunk.2QQAOJET.js} +1 -1
- package/dist/preview/{chunk.FCRFQ7ZW.js → chunk.3P4IIXIT.js} +1 -1
- package/dist/preview/{chunk.FRS3S7DN.js → chunk.3QXHII5W.js} +1 -1
- package/dist/preview/chunk.4J75WRDG.js +1 -0
- package/dist/preview/{chunk.HP3ZEDCD.js → chunk.4NZBMZC7.js} +3 -3
- package/dist/preview/{chunk.HCDKSDIS.js → chunk.5B7NWF7C.js} +1 -1
- package/dist/preview/{chunk.B2WRXGFI.js → chunk.5FZQI2US.js} +1 -1
- package/dist/preview/{chunk.HUKAVTMX.js → chunk.5MCC54VM.js} +1 -1
- package/dist/preview/{chunk.ZTFW7RKP.js → chunk.5VB7DJTL.js} +1 -1
- package/dist/preview/{chunk.HPEGQN6E.js → chunk.656N5BHG.js} +1 -1
- package/dist/preview/{chunk.U5ACEYAN.js → chunk.6J7DR7XQ.js} +1 -1
- package/dist/preview/{chunk.OMMKD2NU.js → chunk.747GGBPR.js} +1 -1
- package/dist/preview/{chunk.CNMITOKP.js → chunk.A3F7MFDR.js} +1 -1
- package/dist/preview/{chunk.JZBBGY4B.js → chunk.AEHPDVLQ.js} +1 -1
- package/dist/preview/{chunk.MWJUZG3C.js → chunk.AINNENYD.js} +2 -2
- package/dist/preview/{chunk.7WHWD5YJ.js → chunk.B2KITMSD.js} +1 -1
- package/dist/preview/{chunk.UA5UYINM.js → chunk.BGW7XTMH.js} +1 -1
- package/dist/preview/{chunk.RH45AW2W.js → chunk.BL6VDLAW.js} +1 -1
- package/dist/preview/{chunk.AHCI7ZDO.js → chunk.CDMV6L5I.js} +1 -1
- package/dist/preview/{chunk.VOFUIWAX.js → chunk.CHJZ7LST.js} +1 -1
- package/dist/preview/{chunk.RN3EZVV4.js → chunk.D4WQEBWV.js} +1 -1
- package/dist/preview/{chunk.WAB6ZS2V.js → chunk.DLT3EE4D.js} +1 -1
- package/dist/preview/{chunk.YJCT3DV2.js → chunk.DPP7ITTU.js} +1 -1
- package/dist/preview/{chunk.6VRJII5M.js → chunk.DQ5HAB3N.js} +1 -1
- package/dist/preview/chunk.DTR5I4BI.js +1 -0
- package/dist/preview/{chunk.35KI7XYV.js → chunk.EAM4NAQH.js} +1 -1
- package/dist/preview/{chunk.VSOB2QEK.js → chunk.EQWOQOFJ.js} +1 -1
- package/dist/preview/{chunk.E7EQ2VTE.js → chunk.FHXXYWL3.js} +1 -1
- package/dist/preview/{chunk.B6VI576I.js → chunk.FIVLFXFB.js} +1 -1
- package/dist/preview/{chunk.T3M4FALL.js → chunk.FVPOSGNG.js} +2 -2
- package/dist/preview/{chunk.6A62UVAE.js → chunk.FX6GH57T.js} +1 -1
- package/dist/preview/{chunk.XZYJRNRY.js → chunk.G2ZPQUXM.js} +1 -1
- package/dist/preview/{chunk.TCSZZAYB.js → chunk.GCGITEON.js} +1 -1
- package/dist/preview/{chunk.RYEAMM73.js → chunk.GCVO6N26.js} +1 -1
- package/dist/preview/{chunk.34CYK2DF.js → chunk.GF7LA4QG.js} +1 -1
- package/dist/preview/{chunk.LCFDM7XY.js → chunk.GO4QBFED.js} +1 -1
- package/dist/preview/{chunk.ETWVQ3A2.js → chunk.H243UV3Z.js} +1 -1
- package/dist/preview/{chunk.VKH3ZPPQ.js → chunk.IX6RNGAT.js} +1 -1
- package/dist/preview/{chunk.7JNDZWD6.js → chunk.JAPYJ53U.js} +1 -1
- package/dist/preview/{chunk.ZJX6ZKKM.js → chunk.JLMLKDVX.js} +1 -1
- package/dist/preview/{chunk.CPW465TM.js → chunk.JMQ6YLQX.js} +1 -1
- package/dist/preview/{chunk.XK4FVT2X.js → chunk.KWCML3BF.js} +1 -1
- package/dist/preview/{chunk.7VUPKOKC.js → chunk.KYH4QIVI.js} +1 -1
- package/dist/preview/{chunk.7HPPJVIV.js → chunk.LRRVBM4F.js} +2 -2
- package/dist/preview/{chunk.2YCFK5HU.js → chunk.LWSTEZIP.js} +1 -1
- package/dist/preview/{chunk.7MTX33WD.js → chunk.MVN6H65Q.js} +1 -1
- package/dist/preview/{chunk.HH6P4BLT.js → chunk.O36ZDLWC.js} +1 -1
- package/dist/preview/{chunk.UCIQIPBQ.js → chunk.OEDCAHII.js} +1 -1
- package/dist/preview/{chunk.7X2ZO5BD.js → chunk.OZ5KJLA2.js} +1 -1
- package/dist/preview/{chunk.WYEYYCBH.js → chunk.PJ2DF6C7.js} +1 -1
- package/dist/preview/{chunk.CZRX2FDI.js → chunk.PKKA6JWA.js} +1 -1
- package/dist/preview/{chunk.GNSAKLP2.js → chunk.PQPTYNW2.js} +1 -1
- package/dist/preview/{chunk.WLBXBNNH.js → chunk.QRMWFEEH.js} +1 -1
- package/dist/preview/chunk.RHYA742Q.js +1 -0
- package/dist/preview/{chunk.BU2DSZ2L.js → chunk.RTB4MMF6.js} +1 -1
- package/dist/preview/{chunk.T2L4NPSB.js → chunk.SBBNIYVB.js} +1 -1
- package/dist/preview/{chunk.2UPGH6FT.js → chunk.SD33BD7A.js} +1 -1
- package/dist/preview/{chunk.JQDYGI6G.js → chunk.SECORXDP.js} +1 -1
- package/dist/preview/{chunk.HJ56Q6WB.js → chunk.TIBZZ2WY.js} +1 -1
- package/dist/preview/{chunk.6XO4PECH.js → chunk.TWWFWHK3.js} +1 -1
- package/dist/preview/{chunk.ZPQKAJRI.js → chunk.U2PYW5MS.js} +1 -1
- package/dist/preview/{chunk.F6WYSDSI.js → chunk.U5EJSTST.js} +2 -2
- package/dist/preview/chunk.UWIYKGYK.js +25 -0
- package/dist/preview/{chunk.G64AREGA.js → chunk.VWHMYPLL.js} +1 -1
- package/dist/preview/chunk.WQBDTLPZ.js +1 -0
- package/dist/preview/{chunk.SIH6RCAI.js → chunk.XSYBNUXF.js} +1 -1
- package/dist/preview/{chunk.PNVR3CXR.js → chunk.Y5Z4ZDTO.js} +2 -2
- package/dist/preview/{chunk.HWITWOP3.js → chunk.ZHXX22AT.js} +1 -1
- package/dist/preview/chunk.ZKXK22AH.js +1 -0
- package/dist/preview/{chunk.WPCGHGDA.js → chunk.ZQNLC33L.js} +1 -1
- package/dist/preview/{chunk.6FBQP336.js → chunk.ZZTDQKM2.js} +1 -1
- package/dist/preview/index.html +26 -26
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.KA3KI4UA.js +0 -1
- package/dist/preview/chunk.QPAUQJON.js +0 -1
- package/dist/preview/chunk.SHPXD6FC.js +0 -1
- package/dist/preview/chunk.YCIX53AR.js +0 -1
- package/dist/preview/chunk.YEYY273R.js +0 -1
- package/dist/preview/chunk.ZTD2CNC3.js +0 -25
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{A as zr,B as Se,C as Pn,D as Fe,E as qe,F as _r,G as An,H as Ce,I as Yr,J as Qr,K as F,L as ot,M as Cn,N as Xr,O as Rn,P as Ht,Q as Jr,R as ie,S as le,T as Ln,a as J,b as Te,c as te,d as Br,e as Sn,f as xn,g as it,h as ne,i as we,j as se,k as A,l as re,m as q,n as ke,o as Ft,p as be,q as ye,r as Vr,s as gt,t as Dt,u as ee,v as Ke,w as Ur,x as Wt,y as Ae,z as jr}from"./chunk.
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{A as zr,B as Se,C as Pn,D as Fe,E as qe,F as _r,G as An,H as Ce,I as Yr,J as Qr,K as F,L as ot,M as Cn,N as Xr,O as Rn,P as Ht,Q as Jr,R as ie,S as le,T as Ln,a as J,b as Te,c as te,d as Br,e as Sn,f as xn,g as it,h as ne,i as we,j as se,k as A,l as re,m as q,n as ke,o as Ft,p as be,q as ye,r as Vr,s as gt,t as Dt,u as ee,v as Ke,w as Ur,x as Wt,y as Ae,z as jr}from"./chunk.OZ5KJLA2.js";import{b as Gr,c as It,e as ae}from"./chunk.5MCC54VM.js";import{a as Hr,d as Kr,e as qr}from"./chunk.UGFDSE37.js";import{a as Or,c as Ir,f as Fr,g as Dr,i as Wr}from"./chunk.3QXHII5W.js";import{a as Ar,b as Cr,c as Rr,d as bn}from"./chunk.AINNENYD.js";import{a as Lr,b as Tr,d as $t,e as Mr,f as Nr,i as Ot}from"./chunk.SBBNIYVB.js";import{a as Et,b as kn,c as Sr,e as xr}from"./chunk.GCVO6N26.js";import{m as Pr}from"./chunk.H243UV3Z.js";import{a as dr,b as cr,c as pr,e as br,f as vn,h as Nt}from"./chunk.5EAQDBBE.js";import{d as mr,e as fr,f as yr,g as hr,n as wr,o as vr,q as kr,s as Mt}from"./chunk.YT2CYCVT.js";import{a as hn}from"./chunk.QVKKXMNK.js";import{a as Tt,b as ir,c as or,d as sr,e as lr}from"./chunk.ZE4CTZQ3.js";import{a as Ct,b as Ia,c as Fa,d as Rt,e as Da}from"./chunk.KWCML3BF.js";import{b as _a,c as ar,e as rr,f as yn}from"./chunk.DLT3EE4D.js";import{a as Ve,b as Ja,c as Za,d as er,e as tr,f as nr}from"./chunk.AEHPDVLQ.js";import{a as mn,b as ja,c as za}from"./chunk.UT6642FC.js";import{b as Ya,c as Qa,i as ut}from"./chunk.52QAIGCD.js";import{r as fn,s as Xa}from"./chunk.QRMWFEEH.js";import{f as qa,g as rt,i as Ba,j as Ga,k as gn,q as Va,r as Ua}from"./chunk.Z7ZCR4LN.js";import{b as Lt,c as Wa,d as Ha,e as Ka}from"./chunk.RIW7SQH4.js";import{C as wn,K as Er,N as $r,e as $a,f as Oa,j as Di,q as ur,r as gr}from"./chunk.Y5Z4ZDTO.js";import{F as $e,K as Sa,M as xa,P as Pa,Q as Y,T as Aa,U as Ca,Y as Ra,Z as ue,a as ka,aa as La,ba as Ta,da as Ma,ha as at,ia as Na,ra as Ea,s as ba,w as Ee}from"./chunk.UWIYKGYK.js";import{Ec as ya,Fc as ha,Gb as ua,Hc as At,I as ra,Jb as ga,Kb as ma,Ma as da,N as pt,Oa as ca,Pc as un,Qc as wa,Uc as va,W as tt,X as fe,Ya as cn,Z as ve,Za as pa,_ as xt,aa as nt,ca as ia,da as oa,ea as He,ec as fa,fb as Pt,la as sa,ma as la,zc as pn}from"./chunk.X7W27IRI.js";import{b as H}from"./chunk.AJZBJBMO.js";function Zr(t,e,n={}){let a=t.graph.getNode(e);if(!a)return;let i=t.schema.tryDefinition(a.kind),r=l=>fe(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 m=(d==="out"?i:t.schema.tryDefinition(p.kind))?.edges?.[l.kind],u=d==="in"?m?.inverse??m?.description:m?.description,k=`${l.kind}|${d}|${u??""}`;(o.get(k)??(()=>{let w={edgeKind:l.kind,direction:d,...u?{description:u}:{},targets:[]};return o.set(k,w),w})()).targets.push({id:p.id,kind:p.kind,label:r(p)})}return{id:e,kind:a.kind,label:r(a),fields:Ha(ut(t.schema,t.graph,a),i),violations:cn(t.violations(n.context),[e]),actions:hn(t,[e],{focus:e,...n.principal?{principal:n.principal}:{},...n.context?{context:n.context}:{}}),links:[...o.values()].map(l=>{let d=Lt(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 Ue(t,e,n={}){return{kind:e,members:t.graph.nodesOfKind(e),actions:hn(t,[],{kindSelection:[e],...n.principal?{principal:n.principal}:{},...n.context?{context:n.context}:{}})}}function ei(t,e){let n=(r,o)=>`${r}|${JSON.stringify(o)}`,a=new Map;for(let r of[...t.affordances,...t.withheld]){if(r.provider!=="invariant")continue;let o=n(r.mutation,r.args);a.has(o)||a.set(o,r.rank??Number.MAX_SAFE_INTEGER)}let i=Number.MAX_SAFE_INTEGER;return[...e].map((r,o)=>({repair:r,declared:o})).sort((r,o)=>(a.get(n(r.repair.mutation,r.repair.args??{}))??i)-(a.get(n(o.repair.mutation,o.repair.args??{}))??i)||r.declared-o.declared).map(r=>r.repair)}function je(t){let e=t.schema.kinds.map(i=>({kind:i,plural:nt(t.schema,i),count:t.graph.nodesOfKind(i).length})),n=new Map;for(let i of t.graph.allEdges()){let r=t.graph.getNode(i.from),o=t.graph.getNode(i.to);if(!r||!o)continue;let l=`${i.kind}|${r.kind}|${o.kind}`;n.set(l,(n.get(l)??0)+1)}let a=[];for(let{kind:i}of e){let r=t.schema.tryDefinition(i)?.edges??{};for(let[o,l]of Object.entries(r)){let d=l.to==="*"||l.to===void 0?(()=>{let c=[...n.keys()].filter(p=>p.startsWith(`${o}|${i}|`)).map(p=>p.split("|")[2]);return c.length>0?c:["*"]})():l.to;for(let c of d)a.push({edgeKind:o,from:i,to:c,...l.description?{description:l.description}:{},...l.inverse?{inverse:l.inverse}:{},count:n.get(`${o}|${i}|${c}`)??0})}}return{kinds:e,relations:a}}var De=H($e(),1);var ze=H($e(),1),S=H(Y(),1),Wi=`
|
|
2
2
|
form:where([data-graview-part="form"]) {
|
|
3
3
|
/* A grid item of the section above it and a grid container for the
|
|
4
4
|
fields below: both halves are allowed to be narrower than what is in
|
|
@@ -105,7 +105,7 @@ p:where([data-graview-part="refused"]) {
|
|
|
105
105
|
.graview-gallery-card > span:first-child { transition: border-color 160ms ease, box-shadow 160ms ease; }
|
|
106
106
|
.graview-gallery-card:hover > span:first-child,
|
|
107
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 $n({context:t}){ae(t.store);let e=Nn(t);return e.length===0?null:(0,T.jsxs)("section",{style:ri,"data-testid":"gallery",children:[(0,T.jsx)("style",{children:Yi}),e.map(n=>(0,T.jsx)(En,{context:t,entry:n},n.key))]})}function On({context:t}){let{store:e}=t;ae(e);let n=pn(Re(t)).filter(i=>!i.hidden),a=Nn(t);return(0,T.jsxs)(ie,{context:t,style:it,children:[(0,T.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,T.jsx)("p",{style:we,children:n.length===0?"None of its own yet":`${n.length} ${n.length===1?"picture":"pictures"}`}),(0,T.jsx)(le,{context:t,children:"Pictures"}),(0,T.jsx)("p",{style:se,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:ri,"data-testid":"places",children:a.map(i=>(0,T.jsx)(En,{context:t,entry:i},i.key))}):null]})}function In({context:t}){let{store:e,principal:n}=t;ae(e);let a=qe(),i=Fe(),[r]=ot(),o=decodeURIComponent(a.as??""),[l,d]=(0,De.useState)(null),c=r.get("of"),p=r.get("filter"),m=Re(t).find(R=>R.as===o&&(!c||J(e.schema,R.kind)===c));if(!m)return(0,T.jsxs)(ie,{context:t,children:[(0,T.jsx)(le,{context:t,children:"No picture is called that."}),(0,T.jsx)("p",{style:se,children:(0,T.jsxs)(F,{to:"/places",style:q,children:["The pictures there are ",(0,T.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]})})]});let u=ee(e,m.kind),k=t.views?.resolve(m.kind,{cardinality:"many",fidelity:"full"},m.as)?.view,V=k?.flows===!0,w=k?.creates!==!1,C=Ue(e,m.kind,{...n?{principal:n}:{},...t.invariantContext?{context:t.invariantContext}:{}}),U=w?C.actions.affordances.map(R=>({affordance:R,mutation:e.allMutations().find(j=>j.name===R.mutation)})).filter(R=>R.mutation!==void 0):[];return(0,T.jsxs)(ie,{context:t,style:it,children:[(0,T.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,T.jsx)(le,{context:t,children:m.title}),(0,T.jsxs)("p",{style:se,"data-testid":"place-lede",children:[Tn(e,qt(t,m),m.across),"."]}),p&&!V?(0,T.jsxs)("p",{style:{...A,margin:0},"data-testid":"place-narrowed",children:[`Only those where ${p.split(",").map(R=>R.replace(":"," is ")).join(" and ")}. `,(0,T.jsx)(F,{to:`?${(()=>{let R=new URLSearchParams(r);return R.delete("filter"),R.toString()})()}`,style:{...q,...A},children:"Show all"})]}):null,(0,T.jsx)("p",{style:{...A,margin:0,display:"flex",flexWrap:"wrap",gap:"4px 16px"},children:qt(t,m).map((R,j)=>(0,T.jsxs)(F,{to:`/${J(e.schema,R)}`,style:{...q,...A},...j===0?{"data-testid":"place-as-list"}:{},children:["All ",(R===m.kind?u:ee(e,R)).toLowerCase()," as a list ",(0,T.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]},R))})]}),(0,T.jsx)("div",{"data-testid":"place-lens","data-flows":V?"":void 0,style:V?{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:R=>{let j=R.target?.closest("[data-graview-pick]"),Q=j?.getAttribute("data-graview-pick"),de=j?.getAttribute("data-graview-joins");if(de)try{let D=JSON.parse(de);if(Array.isArray(D)&&D.every(X=>typeof X=="string")){R.preventDefault(),d({at:_e(m),ids:D});return}}catch{}if(!Q)return;let me=e.graph.getNode(Q);me&&(R.preventDefault(),i(te(e.schema,me.kind,Q)))},children:(0,T.jsx)(Mn,{context:t,place:m,filter:p,...l?.at===_e(m)?{chosen:l.ids}:{}})}),U.length>0?(0,T.jsx)("div",{style:{maxWidth:760,display:"grid",gap:40},"data-testid":"place-creators",children:U.map(({affordance:R,mutation:j})=>(0,T.jsxs)("section",{style:{...re,display:"grid",gap:14},children:[(0,T.jsx)("h2",{style:ne,children:j.title??j.name}),j.description?(0,T.jsx)("p",{style:{...A,margin:0,maxWidth:"58ch"},children:j.description}):null,(0,T.jsx)(Oe,{store:e,mutation:j,prefilled:R.args,open:R.open,label:R.label,...n?{principal:n}:{}})]},R.id))}):null]})}function st(t){return t.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-|-$/g,"")}function ft(t,e={}){let[n="/",a=""]=t.split("#")[0].split("?"),i=new URLSearchParams(a);e.filter&&i.set("filter",e.filter);let r=i.toString(),o=e.section?st(e.section):"";return`${n}${r?`?${r}`:""}${o?`#${o}`:""}`}function Qi(t,e=document){let n=st(t);if(!n)return null;let a=[e,...[...e.querySelectorAll("[data-worker-view]")].flatMap(i=>i.shadowRoot?[i.shadowRoot]:[])];for(let i of a)for(let r of i.querySelectorAll("[id], [data-section]")){let o=r.getAttribute("data-section")??r.id;if(o===t||st(o)===n)return r}for(let i of a)for(let r of i.querySelectorAll("h1, h2, h3, h4, h5, h6, [role=heading]"))if(st(r.textContent??"")===n)return r;return null}function ii(t,e={}){if(typeof document>"u"||typeof requestAnimationFrame>"u")return()=>{};let n=e.frames??120,a=0,i=()=>{let r=Qi(t,e.root??document);if(r){r.hasAttribute("tabindex")||r.setAttribute("tabindex","-1"),r.scrollIntoView?.({block:"start"}),r.focus({preventScroll:!0});return}n-=1,n>0&&(a=requestAnimationFrame(i))};return a=requestAnimationFrame(()=>{a=requestAnimationFrame(i)}),()=>cancelAnimationFrame(a)}var z=H($e(),1);var Bt=H($e(),1);var Ye=H(Y(),1);function oi({context:t}){return ue()?(0,Ye.jsxs)(Ye.Fragment,{children:[(0,Ye.jsx)(Xi,{context:t}),(0,Ye.jsx)(Ir,{face:"pages",on:t.quickAsk??!0})]}):null}function Xi({context:t}){let{store:e}=t,n=ue(),{pathname:a}=Se(),i=(0,Bt.useRef)(n?.setSelection);return i.current=n?.setSelection,(0,Bt.useEffect)(()=>{let r=i.current;if(!r)return;let[,o,l]=a.split("/"),d=(()=>{if(o==="places"){let p=t.views?.places().find(g=>g.as===decodeURIComponent(l??""));return p?[Ee(p.kind)]:[]}let c=o?Te(e.schema,o):void 0;return c&&l?[decodeURIComponent(l)]:c?[ba(c)]:[]})();r(c=>c.length===d.length&&c.every((p,g)=>p===d[g])?c:d)},[a]),null}var he=H($e(),1);var li=H(Di(),1);var ge=H(Y(),1);var Ji=(0,he.lazy)(ka(()=>(__graviewPreload(import.meta.url,["./chunk.HUKAVTMX.js","./chunk.UGFDSE37.js","./chunk.FRS3S7DN.js","./chunk.MWJUZG3C.js","./chunk.T2L4NPSB.js","./chunk.VKH3ZPPQ.js","./chunk.3H4NVUWV.js","./chunk.SIH6RCAI.js","./chunk.RYEAMM73.js","./chunk.7HPPJVIV.js","./chunk.ETWVQ3A2.js","./chunk.CZRX2FDI.js","./chunk.5EAQDBBE.js","./chunk.YT2CYCVT.js","./chunk.XK4FVT2X.js","./chunk.WAB6ZS2V.js","./chunk.XXMYKBLT.js","./chunk.34CYK2DF.js","./chunk.JZBBGY4B.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.52QAIGCD.js","./chunk.PPUAPAWR.js","./chunk.IHFNLKXV.js","./chunk.577PGFUT.js","./chunk.FBY5IUGU.js","./chunk.4K5QCJFH.js","./chunk.GZHZLJBF.js","./chunk.WLBXBNNH.js","./chunk.7MTX33WD.js","./chunk.OJGHDWI6.js","./chunk.Z7ZCR4LN.js","./chunk.RIW7SQH4.js","./chunk.FSAHO3LV.js","./chunk.PNVR3CXR.js","./chunk.ZTD2CNC3.js","./chunk.X7W27IRI.js","./chunk.AJZBJBMO.js"]),import("./chunk.B2WRXGFI.js")).then(t=>({default:t.TakeBack}))));function Zi({context:t,docked:e,at:n}){let{store:a}=t,i=ae(a),[r]=(0,he.useState)(()=>a.batches().length),o=(0,he.useRef)(!1);return o.current||=i>0||!e&&r>0,o.current?(0,ge.jsx)(he.Suspense,{fallback:null,children:(0,ge.jsx)(Ji,{context:t,docked:e,at:n,since:r})}):null}function eo(t,e,n){let{store:a,principal:i,embedded:r}=t;(0,he.useEffect)(()=>{if(!n)return;let o=l=>{if(!qr(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&&!r))&&Hr(a,i)){l.preventDefault();try{Kr(a,i)}catch{}}};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[a,i,r,e,n])}function di({context:t,registry:e,root:n,children:a}){let i=(0,he.useMemo)(Xr,[]),r=e?.without()??new Set;return eo(t,n,!r.has("undo")),(0,ge.jsxs)(Cn.Provider,{value:i,children:[(0,ge.jsx)(to,{context:t,placed:i,without:r}),a]})}function to({context:t,placed:e,without:n}){let[a,i]=(0,he.useState)(!1);(0,he.useLayoutEffect)(()=>i(!0),[]);let r=Rn(e,"find"),o=Rn(e,"undo"),l=Se(),d=gr();if(!a)return null;let c=l.pathname.split("/").filter(Boolean),g=(c.length===1?Te(t.store.schema,c[0]):void 0)!==void 0;return(0,ge.jsxs)(ge.Fragment,{children:[!r&&!n.has("find")&&d?(0,li.createPortal)((0,ge.jsx)(si,{context:t,narrowsLists:g}),d.slot):null,!r&&!n.has("find")&&!d?(0,ge.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,ge.jsx)(si,{context:t,narrowsLists:g})}):null,!o&&!n.has("undo")?(0,ge.jsx)(Zi,{context:t,docked:!0,at:l.pathname+l.search}):null,d?.own&&!n.has("undo")?(0,ge.jsx)(jr,{context:t,own:d.own}):null]})}function si({context:t,narrowsLists:e}){return(0,ge.jsx)(Cn.Provider,{value:null,children:(0,ge.jsx)(Ln,{context:t,narrowsLists:e})})}var oe=H($e(),1);var Pe=H(Y(),1),no=500,ao=10;function Gt(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 ro(t){let e=typeof getSelection=="function"?getSelection():null;return e!==null&&!e.isCollapsed&&e.containsNode(t,!0)}function ci(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 pi({context:t,root:e,children:n}){return ue()===null?(0,Pe.jsx)(Pe.Fragment,{children:n}):(0,Pe.jsx)(io,{context:t,root:e,children:n})}function io({context:t,root:e,children:n}){let{setMenuAt:a}=Ra(),{store:i}=t,r=i.schema,o=Fe(),{pathname:l,search:d}=Se(),c=zr("/").replace(/\/$/,""),p=(0,oe.useCallback)((b,x)=>t.views?.places().find(L=>L.as===b&&(x===null||L.kind===x)),[t.views]),g=(0,oe.useCallback)((b,x)=>{let[L="",M,E]=b.split("/").filter(Boolean).map(Z=>{try{return decodeURIComponent(Z)}catch{return Z}});if(E!==void 0)return null;if(L==="places"&&M!==void 0){let Z=p(M,new URLSearchParams(x).get("of"));return Z?{face:"pages",place:Z.as,about:[Ee(Z.kind)],title:Z.title}:null}let _=Te(r,L);return _?M===void 0?{face:"pages",about:[Ee(_)],title:nt(r,_)}:i.graph.getNode(M)?{face:"pages",on:M,about:[M]}:null:null},[r,i,p]),m=(0,oe.useCallback)(b=>{let x=b.href;try{let L=new URL(x,location.href);if(L.origin===location.origin&&(c===""||L.pathname===c||L.pathname.startsWith(`${c}/`))){let M=g(L.pathname.slice(c.length),L.search);if(M)return{...M,href:x}}}catch{}return{face:"pages",about:[],href:x}},[c,g]),u=(0,oe.useCallback)(()=>g(l,d)??{face:"pages",about:[]},[g,l,d]),k=(0,oe.useCallback)(b=>{let x=u(),L=b.closest("[data-graview-field]")?.getAttribute("data-graview-field");if(L&&x.on!==void 0&&b.closest("[data-graview-pick], a[href]")===null)return{...x,field:L};let M=b.closest("[data-graview-act]")?.getAttribute("data-graview-act");if(M)return{...x,act:M};let E=b.closest("[data-graview-pick]")?.getAttribute("data-graview-pick");if(E&&i.graph.getNode(E))return{face:"pages",on:E,about:[E],href:`${c}${te(r,i.graph.getNode(E).kind,E)}`};let _=b.closest("a[href]");if(_)return m(_);let Z=b.closest("[data-graview-record]")?.getAttribute("data-graview-record");return Z&&i.graph.getNode(Z)?{face:"pages",on:Z,about:[Z]}:x},[u,m,i,r,c]),V=(0,oe.useCallback)(b=>{let x=e.current;if(x===null||!x.contains(b)||Gt(b)||b.closest("[data-graview-popover]"))return null;let L=k(b);return{face:"pages",on:L.on,about:L.about??[],field:L.field,place:L.place,href:L.href,act:L.act,element:ci(b)}},[k,e]),w=(0,oe.useCallback)((b,x,L)=>{let M=k(b);a({...M,x:Math.round(x),y:Math.round(L),returnTo:ci(b)})},[k,a]),C=(0,oe.useCallback)(b=>{let x=b.getBoundingClientRect();w(b,x.left+Math.min(16,x.width/2),Math.min(x.bottom,x.top+36))},[w]),U=(0,oe.useRef)(0),R=(0,oe.useRef)(null),j=(0,oe.useRef)(!1),Q=()=>{R.current&&clearTimeout(R.current.timer),R.current=null};(0,oe.useEffect)(()=>Q,[]),(0,oe.useEffect)(()=>{let b=x=>{if(x.defaultPrevented||!(x.key==="ContextMenu"||x.key==="F10"&&x.shiftKey))return;let L=e.current,M=x.target instanceof Element?x.target:null,E=M===null||M===document.body||M===document.documentElement,_=L!==null&&M!==null&&L.contains(M);if(!_&&!(E&&document.querySelector("[data-graview-face='pages']")===L)||Gt(M)||M?.closest("[data-graview-popover]"))return;x.preventDefault(),U.current=Date.now();let Z=_&&M instanceof HTMLElement?M:L?.querySelector("[data-graview-page-title], main h1, main")??null;Z&&C(Z)};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[e,C]);let de=(0,oe.useMemo)(()=>b=>{if(b.face!=="pages")return null;let x=[],L=b.on===void 0?void 0:i.graph.getNode(b.on),M=b.place===void 0?void 0:t.views?.places().find(G=>G.as===b.place),E=L?void 0:b.about.length===1&&b.about[0].startsWith("aggregate:")&&!M?oo(b.about[0]):void 0,_=L?te(r,L.kind,L.id):M?xe(t,M):E?`/${J(r,E)}`:void 0,Z=_!==void 0&&l===_.split("?")[0];_!==void 0&&!Z&&x.push({id:"open",label:"Open",run:()=>o(_)});let f=_!==void 0?`${c}${_}`:b.href;f!==void 0&&x.push({id:"open-in-a-new-tab",label:"Open in a new tab",run:()=>void window.open(f,"_blank","noopener")});let N=L?`#focus=${encodeURIComponent(L.id)}`:M?`#focus=${encodeURIComponent(Ee(M.kind))}&view=${encodeURIComponent(M.as)}`:E?`#focus=${encodeURIComponent(Ee(E))}`:void 0;if(N!==void 0&&(t.overview||!t.embedded)){let G=t.overview;x.push({id:"in-the-scene",label:"Show in the scene",run:()=>G?G(N):location.assign(`${t.sceneHref??"/"}${N}`)})}return L===void 0&&b.href===void 0&&x.push({id:"find",label:"Find\u2026",run:()=>{let G=e.current?.querySelector('[data-testid="nav-find"]')??document.querySelector('[data-testid="nav-find"]');G&&G.offsetParent!==null?G.focus():o("/search")}}),x.length>0?{id:"pages",items:x}:null},[i,r,t,l,c,o,e]),me=(0,oe.useMemo)(()=>b=>{if(b.face!=="pages"||b.field===void 0||b.on===void 0)return null;let x=i.graph.getNode(b.on),L=b.element?.closest("[data-graview-field]")??e.current?.querySelector(`[data-graview-field="${CSS.escape(b.field)}"]`);return!x||!(L instanceof HTMLElement)||!L.hasAttribute("data-graview-editable")?null:{id:"field",at:"start",items:[{id:"change-field",label:`Change \u201C${ia(r.tryDefinition(x.kind),b.field)}\u201D`,run:()=>L.click()}]}},[i,r,e]),D=Dr(),X=ar(),ce=(0,oe.useMemo)(()=>[me,de,...X?[X]:[],...D?[D]:[]],[me,de,X,D]);return(0,Pe.jsxs)(Xa,{sections:ce,children:[(0,Pe.jsx)("div",{"data-graview-menu-ground":"",style:{display:"contents"},onContextMenu:b=>{let x=b.target;b.shiftKey||Gt(x)||ro(x)||(b.preventDefault(),!x.closest("[data-graview-popover]")&&(Date.now()-U.current<700||(b.clientX===0&&b.clientY===0&&x instanceof HTMLElement?C(x):w(x,b.clientX,b.clientY))))},onPointerDown:b=>{if(j.current=!1,b.pointerType==="mouse"||!b.isPrimary)return;let x=b.target;if(Gt(x)||x.closest("[data-graview-choose], [data-graview-popover]"))return;Q();let{clientX:L,clientY:M}=b;R.current={x:L,y:M,timer:setTimeout(()=>{R.current=null,j.current=!0,U.current=Date.now(),w(x,L,M)},no)}},onPointerMove:b=>{let x=R.current;x&&Math.hypot(b.clientX-x.x,b.clientY-x.y)>ao&&Q()},onPointerUp:Q,onPointerCancel:Q,onClickCapture:b=>{j.current&&(j.current=!1,b.preventDefault(),b.stopPropagation())},children:n}),(0,Pe.jsx)(so,{openAt:C,readyAt:V}),(0,Pe.jsx)(Wr,{placement:"page"}),(0,Pe.jsx)(rr,{})]})}function oo(t){let e=t.slice(10).split("+");return e.length===1&&e[0]?e[0]:void 0}function so({openAt:t,readyAt:e}){return(0,Pe.jsx)("span",{"data-graview-menu-home":"",tabIndex:-1,onFocus:n=>{if(n.target!==n.currentTarget)return;let a=n.currentTarget.closest("[data-graview-face]"),i=a?.querySelector("[data-graview-page-title]")??a?.querySelector("main h1, main")??null;i&&(i.hasAttribute("tabindex")||i.setAttribute("tabindex","-1"),i.focus({preventScroll:!0}))},style:{position:"absolute",width:0,height:0,overflow:"hidden"},children:(0,Pe.jsx)(Or,{placement:"menu",openActs:t,aimAt:e})})}var K=H(Y(),1);function ui(t,e){return e==="*"?{label:"anything",path:null}:{label:ee(t,e),path:`/${J(t.schema,e)}`}}function lo({context:t,relation:e}){let{store:n}=t,a=ui(n,e.from),i=ui(n,e.to),r=o=>o.path?(0,K.jsx)(F,{to:o.path,style:{...ke,fontWeight:550},children:o.label}):(0,K.jsx)("span",{children:o.label});return(0,K.jsxs)("li",{"data-testid":"relation","data-relation":e.edgeKind,style:{display:"grid",gridTemplateColumns:"30px minmax(0, 1fr) auto",gap:12,alignItems:"baseline"},children:[(0,K.jsx)(Fr,{edgeKind:e.edgeKind,...t.brand?.kit?{kit:t.brand.kit}:{}}),(0,K.jsxs)("span",{style:{display:"grid",gap:1},children:[(0,K.jsxs)("span",{children:[r(a)," ",(0,K.jsxs)("span",{style:A,"data-graview-speaks-ids":"",children:[ve(e.edgeKind)," \u2192"]})," ",r(i)]}),e.description||e.inverse?(0,K.jsxs)("span",{style:A,children:[e.description?Ae(e.description):null,e.description&&e.inverse?" \xB7 ":null,e.inverse?`from the other end, ${e.inverse}`:null]}):null]}),i.path?(0,K.jsx)(F,{to:`${i.path}?with=${encodeURIComponent(e.edgeKind)}`,style:{...q,...A,fontVariantNumeric:"tabular-nums",display:"inline-block",minWidth:24,minHeight:24,textAlign:"center"},title:`The ${i.label.toLowerCase()} that have this`,children:e.count}):(0,K.jsx)("span",{style:{...A,fontVariantNumeric:"tabular-nums"},children:e.count})]})}function gi({context:t,heading:e=!0}){let{store:n}=t,a=new Set(Ke(n,t.principal)),i=je(n).relations.filter(r=>a.has(r.from)&&(r.to==="*"||a.has(r.to)));return i.length===0?null:(0,K.jsxs)("section",{style:{...re,display:"grid",gap:12},"data-testid":"kind-map",children:[e?(0,K.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[(0,K.jsx)("h2",{style:ne,children:(0,K.jsx)(F,{to:"/map",style:ke,children:"Connections"})}),(0,K.jsx)("span",{style:A,children:i.length===1?"1 relation":`${i.length} relations`})]}):null,(0,K.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:i.map(r=>(0,K.jsx)(lo,{context:t,relation:r},`${r.edgeKind}|${r.from}|${r.to}`))})]})}function Fn({context:t}){let{store:e}=t;ae(e);let n=new Set(Ke(e,t.principal)),a=je(e),i=a.relations.filter(r=>n.has(r.from));return(0,K.jsxs)(ie,{context:t,children:[(0,K.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,K.jsx)("p",{style:we,children:i.length===0?"No relations":`${i.length} ${i.length===1?"relation":"relations"}`}),(0,K.jsx)(le,{context:t,children:"Connections"}),(0,K.jsx)("p",{style:se,children:i.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,K.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"6px 18px"},"data-testid":"map-kinds",children:a.kinds.filter(r=>n.has(r.kind)).map(r=>(0,K.jsxs)("li",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[(0,K.jsx)(ye,{kind:r.kind,brand:t.brand,schema:e.schema,size:7}),(0,K.jsx)(F,{to:`/${J(e.schema,r.kind)}`,style:q,children:r.plural}),(0,K.jsx)("span",{style:A,children:r.count})]},r.kind))}),(0,K.jsx)(gi,{context:t,heading:!1})]})}function mi({context:t}){let n=[...ue()?.robots.values()??[]].filter(i=>i.mode==="asking"&&i.say);if(n.length===0)return null;let{store:a}=t;return(0,K.jsxs)("section",{style:{...re,display:"grid",gap:10},"data-testid":"seat-questions",children:[(0,K.jsx)("h2",{style:ne,children:n.length===1?"The seat asked something":`The seat asked ${n.length} things`}),(0,K.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:8},children:n.map(i=>{let r=i.at?a.graph.getNode(i.at):void 0;return(0,K.jsxs)("li",{style:{display:"grid",gap:2},children:[(0,K.jsx)("span",{children:i.say}),r?(0,K.jsxs)(F,{to:te(a.schema,r.kind,r.id),style:{...q,...A},children:[fe(a.schema.tryDefinition(r.kind),r)," \u2192"]}):null]},i.participant)})})]})}var B=H(Y(),1);function Dn({context:t}){let{principal:e}=t,{store:n,brand:a,invariantContext:i}=t;ae(n);let r=n.violations(i),o=`${r.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=Wt(t).map(C=>({kind:C,members:n.graph.nodesOfKind(C).filter(U=>tt(n.schema.tryDefinition(C),U))})),p=c.filter(C=>C.members.length>0),g=c.map(C=>({entry:C,creator:n.allMutations().find(U=>(U.creates??[]).includes(C.kind)&&n.permits({name:U.name,args:{}},t.principal).ok)})).find(C=>C.creator!==void 0),m=p.length===0?"Nothing here yet.":`${p.map(C=>xt(n.schema,C.kind,C.members.length)).join(", ").replace(/, ([^,]*)$/," and $1")}.`,u=t.views?.homeView?.(),k=n.schema.kinds.some(C=>n.graph.nodesOfKind(C).length>0);if(u&&k){let C=a?.subtitle?(0,B.jsx)("p",{style:{...A,margin:0},"data-testid":"app-subtitle",children:a.subtitle}):null,U=u[Symbol.for("graview.home-blocks")]===!0;return(0,B.jsx)(ie,{context:t,style:it,children:(0,B.jsxs)("div",{style:{display:"grid",gap:12},"data-testid":"home-view",children:[U?null:C,r.length>0?(0,B.jsx)(F,{to:"/problems",style:{...q,color:"var(--graview-warn)"},children:o}):null,(0,B.jsx)(Nr.Provider,{value:U?C:null,children:(0,B.jsx)(u,{cardinality:"many",fidelity:"full",mode:"fullscreen",selected:!1})})]})})}let V=new Set(Ke(n,t.principal)),w=je(n).relations.filter(C=>V.has(C.from)&&(C.to==="*"||V.has(C.to)));return(0,B.jsxs)(ie,{context:t,style:it,children:[(0,B.jsxs)("header",{style:{display:"grid",gap:12},children:[a?.subtitle?(0,B.jsx)("p",{style:{...A,margin:0},"data-testid":"app-subtitle",children:a.subtitle}):null,(0,B.jsx)(le,{context:t,"data-testid":"standing",children:m}),(0,B.jsxs)("p",{style:{...se,display:"grid",gap:4},"data-testid":"standing-card",children:[p.length===0&&g?(0,B.jsxs)("span",{children:["Begin with \u201C",g.creator?.title??g.creator?.name,"\u201D, under"," ",(0,B.jsx)(F,{to:`/${J(n.schema,g.entry.kind)}`,style:q,children:ee(n,g.entry.kind)}),"."]}):null,r.length===0?(0,B.jsx)("span",{children:"All rules hold."}):(0,B.jsx)(F,{to:"/problems",style:{...q,color:"var(--graview-warn)"},children:o})]})]}),(0,B.jsx)($n,{context:t}),(0,B.jsxs)("section",{style:{...re,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:ne,children:"What is here"}),w.length>0?(0,B.jsxs)(F,{to:"/map",style:{...q,...A,marginLeft:"auto"},"data-testid":"map-link",children:["Connections \xB7 ",w.length===1?"1 relation":`${w.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:C,members:U})=>(0,B.jsx)("li",{style:{maxWidth:"100%"},children:(0,B.jsxs)(F,{to:`/${J(n.schema,C)}`,style:{...ke,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)(ye,{kind:C,brand:a,schema:n.schema,size:7}),(0,B.jsx)("span",{style:{fontWeight:550,overflowWrap:"anywhere"},children:ee(n,C)}),(0,B.jsx)("span",{style:{...A,fontVariantNumeric:"tabular-nums"},children:U.length===0?"none yet":pt(U.length)})]})},C))})]}),l.length>0?(0,B.jsxs)("section",{style:{...re,display:"grid",gap:10},children:[(0,B.jsx)("h2",{style:ne,children:"Recently"}),(0,B.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:l.map(C=>(0,B.jsxs)("li",{style:A,children:[(0,B.jsx)("span",{style:{color:"var(--graview-ink)"},children:C.intent})," \u2014 ",gt(C,e,{graph:n.graph,schema:n.schema,...t.seats?{seats:t.seats}:{},...t.people?{people:t.people}:{}})]},C.id))})]}):null]})}var Me=H($e(),1);var Qe=H(Y(),1);function Vt({context:t,withheld:e,style:n,testId:a}){let i=ue(),r=ma(e,t.signIn??i?.signIn);return r?(0,Qe.jsx)("p",{style:{...n,margin:0},children:(0,Qe.jsx)("button",{type:"button","data-testid":"sign-in",onClick:()=>r.run(),style:be,children:r.label})}):e.length===0?null:(0,Qe.jsx)("ul",{style:{...n,margin:0,padding:0,listStyle:"none",display:"grid",gap:4},...a?{"data-testid":a}:{},children:e.map(o=>(0,Qe.jsxs)("li",{style:A,children:[(0,Qe.jsx)("s",{children:o.label})," \u2014 ",o.refusal.message]},o.id))})}var $=H(Y(),1);function Wn({context:t}){let{store:e,brand:n,principal:a,invariantContext:i}=t;ae(e);let[r]=ot(),o=r.get("q")??"",l=typeof i?.today=="string"?i.today:void 0,d=kr(e,o,{...a?{principal:a}:{},places:Re(t),flagged:new Set(e.violations(i).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"),g=[...new Set(c.map(u=>u.kind))],m=o.trim();return(0,$.jsxs)(ie,{context:t,children:[(0,$.jsx)("style",{children:Ft}),(0,$.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,$.jsx)("p",{style:we,children:"Search"}),(0,$.jsx)(le,{context:t,"data-testid":"search-heading",children:m.length===0?"Find anything by its name":d.hits.length===0?(0,$.jsxs)($.Fragment,{children:["Nothing here is called \u201C",m,"\u201D."]}):(0,$.jsxs)($.Fragment,{children:[co(e,d.byKind)," for \u201C",m,"\u201D"]})}),m.length>0?(0,$.jsxs)("p",{style:{...A,margin:0},"data-testid":"search-searched",children:[Mt(e.schema,d.searched),d.conditions.filter(u=>u.key!=="is"&&u.admittedBy.length<d.searched.kinds.length).map(u=>(0,$.jsxs)("span",{children:[" ",u.key,":",u.value," narrows"," ",u.admittedBy.length===0?"nothing here":u.admittedBy.map(k=>ee(e,k).toLowerCase()).join(" and "),"."]},`${u.key}:${u.value}`))]}):(0,$.jsxs)("p",{style:se,children:["Type in the box above. Words find the start of words in names and in what each record says;"," ",(0,$.jsx)("code",{children:"done:false"})," and the like narrow as a list does, and ",(0,$.jsx)("code",{children:"is:any"})," includes what is past."]})]}),p.length>0?(0,$.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},"data-testid":"search-named",children:p.map(u=>(0,$.jsx)("li",{"data-testid":"search-hit","data-about":u.about,children:u.about==="kind"?(0,$.jsxs)(F,{to:`/${J(e.schema,u.kind)}`,style:q,children:[u.label,u.count>0?(0,$.jsxs)("span",{style:A,children:[" \xB7 ",u.count," match"]}):null]}):u.about==="place"?(0,$.jsxs)(F,{to:xe(t,u),style:q,children:["Go to ",u.title]}):u.about==="rule"?(0,$.jsxs)(F,{to:"/problems",style:q,children:["The rule \u201C",u.label,"\u201D"]}):null},`${u.about}:${u.about==="rule"?u.name:u.about==="place"?u.as:u.kind}`))}):null,g.map(u=>(0,$.jsxs)("section",{className:"graview-list",style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",minWidth:0},"data-testid":"search-group","data-kind":u,children:[(0,$.jsxs)("h2",{className:"graview-group-head",style:{alignItems:"center"},children:[(0,$.jsx)(ye,{kind:u,brand:n,schema:e.schema,size:8}),(0,$.jsx)(F,{to:`/${J(e.schema,u)}?${new URLSearchParams({q:m}).toString()}`,style:q,"data-testid":"search-kind-link",children:ee(e,u)}),(0,$.jsx)("span",{children:d.byKind[u]})]}),(0,$.jsx)("ul",{className:"graview-rows",children:c.filter(k=>k.kind===u).map(k=>(0,$.jsxs)("li",{"data-testid":"search-hit","data-about":"node",className:"graview-row",children:[(0,$.jsxs)(F,{to:te(e.schema,u,k.id),className:"graview-row-title",...k.label.length>60?{title:k.label}:{},children:[k.flagged?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)("span",{role:"img","aria-label":"Breaks a rule:",style:{color:"var(--graview-warn)"},children:"\u26A0"})," "]}):null,k.label]}),k.apart||!k.current?(0,$.jsx)("span",{className:"graview-row-glance",children:[k.apart,k.current?"":"past"].filter(Boolean).join(" \xB7 ")}):null,(0,$.jsx)(Ut,{why:k.why})]},k.id))})]},u)),m.length>0?(0,$.jsx)(po,{asked:m}):null,m.length>0&&d.hits.length===0?(0,$.jsx)(yi,{store:e,kinds:d.searched.kinds,words:d.words,...a?{principal:a}:{},...i?{invariantContext:i}:{}}):null]})}function Ut({why:t}){return t.strength==="near"?(0,$.jsxs)("span",{style:A,"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,$.jsxs)("span",{style:A,"data-testid":"search-why",children:[t.reading,": ",t.fragment]})}function co(t,e){let n=Object.entries(e).map(([a,i])=>`${i} ${i===1?He(t.schema.tryDefinition(a),a):ee(t,a).toLowerCase()}`);return n.length===0?"Found":n.length===1?Ae(n[0]):Ae(`${n.slice(0,-1).join(", ")} and ${n[n.length-1]}`)}function fi(t,e,n={}){let a=[];for(let i of e){let r=Ue(t,i,{...n.principal?{principal:n.principal}:{},...n.invariantContext?{context:n.invariantContext}:{}});for(let o of jt(t,i,r.actions.affordances))a.some(l=>l.mutation.name===o.mutation.name)||a.push(o)}return a}function jt(t,e,n){let a=t.schema.tryDefinition(e)?.fieldRoles?.label,i=[];for(let r of n){let o=t.allMutations().find(c=>c.name===r.mutation);if(!o||!o.creates?.includes(e)||i.some(c=>c.mutation.name===o.name))continue;let l=Tt(o.input).map(c=>c.name),d=l.includes("label")?"label":a&&l.includes(a)?a:void 0;!d||r.args[d]!==void 0||i.push({kind:e,affordance:r,mutation:o,arg:d})}return i}function yi({store:t,kinds:e,words:n,principal:a,invariantContext:i}){let r=fi(t,e,{...a?{principal:a}:{},...i?{invariantContext:i}:{}});return r.length===0||n.trim().length===0?null:(0,$.jsx)("div",{style:{display:"grid",gap:24},"data-testid":"search-to-create",children:r.map(({kind:o,affordance:l,mutation:d,arg:c})=>(0,$.jsxs)("section",{style:{...re,display:"grid",gap:14},children:[(0,$.jsxs)("h2",{style:ne,children:[Ae(oa(He(t.schema.tryDefinition(o),o)))," called \u201C",n,"\u201D"]}),(0,$.jsx)(Oe,{store:t,mutation:d,prefilled:l.args,open:l.open,initial:{[c]:n},...a?{principal:a}:{}})]},`${l.id}|${n}`))})}function po({asked:t}){let e=ue();return e?(0,$.jsx)(uo,{asked:t,desk:e.aiDesk}):null}function uo({asked:t,desk:e}){return Oa(e)?(0,$.jsx)("p",{style:{margin:0},children:(0,$.jsxs)("button",{type:"button","data-testid":"search-ask",onClick:a=>$a(e,{pointed:{about:[]},asked:t,returnTo:a.currentTarget}),style:{...q,font:"inherit",padding:0,border:0,background:"transparent",cursor:"pointer",textAlign:"start"},children:["Ask: \u2018",t,"\u2019"]})}):null}var v=H(Y(),1),wi=8,vi=40;function go(t,e){let n=e?.fields?.shape??{},a=Object.keys(n).find(i=>la(n[i])&&sa(t[i]));return a===void 0?void 0:t[a]}function Hn({context:t}){let e=qe(),n=Te(t.store.schema,e.slug??"");return n?(0,v.jsx)(ki,{context:t,kind:n}):(0,v.jsx)(ie,{context:t,children:(0,v.jsx)(le,{context:t,children:"No such kind of thing here."})})}function ki({context:t,kind:e,opening:n,row:a,layout:i="list",description:r,bare:o}){let{store:l,brand:d,invariantContext:c}=t;ae(l);let[p,g]=ot(),m=`list-${(0,Me.useId)().replace(/:/g,"")}`,u=l.schema.tryDefinition(e),k=ca(p.get("archived")),V=l.graph.nodesOfKind(e,{archived:k}),w=je(l).relations.filter(s=>s.from===e||s.to===e),C=new Set(l.violations(c).flatMap(s=>s.nodeIds)),U=hr(l.schema,yr(l.schema,fr(l.schema,e))),R=w.map(s=>s.edgeKind),j=vo(p,U,R),Q=["sort","filter","group","q","by","with","past","archived",...R].some(s=>p.has(s)),de=V.length>=vi,me=u?.fieldRoles?.when,D=t.views?.arrangement?.()?.lists?.[e],X=cr(D),ce=dr(D?.group),b=wo(de,me),x=n??(X?{...b,...X}:b),L=Q?j.arrangement:vn(x,U).arrangement,M=X?.sort,E=L.sort&&M?.then&&L.sort.by===M.by&&L.sort.direction===M.direction?{...L,sort:M}:L,_=wr(E.query??""),Z=[...E.filter??[],..._.conditions].some(s=>s.key==="is"&&(s.value==="past"||s.value==="any"))||mr(u,[...E.filter??[],..._.conditions]),f=Z||!u?.lifecycle?E:{...E,filter:[...E.filter??[],{key:"is",value:"current"}]},N=new Map,G=Nt(V,f,{schema:l.schema,graph:l.graph,flagged:C,...typeof c?.today=="string"?{today:c.today}:{},read:(s,y)=>{let O=N.get(s.id);return O||N.set(s.id,O=ut(l.schema,l.graph,s)),O[y]}}),I=ce&&E.group?.by===ce.by&&!E.group.bucket?U.groups.find(s=>s.key===ce.by):void 0,Gn=ce&&I&&(I.type==="choice"||I.type==="boolean")?pr(G.groups,ce,{type:I.type,...I.options?{options:I.options}:{}}):G.groups.map(s=>({...s,closed:!1})),Vn=new Set((p.get("open")??"").split(",").filter(Boolean)),Ai=!!E.query||(E.filter??[]).some(s=>s.key===ce?.by),Un=s=>I?.type==="boolean"?s==="1"?"true":"false":s,jn=s=>s.closed&&!Ai&&!Vn.has(Un(s.key)),Ci=s=>{let y=new URLSearchParams(p),O=new Set(Vn);O.has(s)?O.delete(s):O.add(s),O.size>0?y.set("open",[...O].join(",")):y.delete("open"),g(y,{replace:!0})},Ie=G.nodes,lt=u?.lifecycle&&!Z?V.filter(s=>tt(u,s)):V,zn=V.length-lt.length,Yt=E.group?.by??null,Ri=s=>{let y=new URLSearchParams(p);for(let pe of["sort","filter","group","q","by","with","past","archived",...w.map(bt=>bt.edgeKind)])y.delete(pe);let O=br(s);for(let pe of["sort","filter","group","q","archived"])O[pe]&&y.set(pe,O[pe]);![...y.keys()].some(pe=>["sort","filter","group","q"].includes(pe))&&(n||X||de||me)&&y.set("sort",""),g(y)},{principal:Je}=t,Qt=Ue(l,e,{...Je?{principal:Je}:{},...t.invariantContext?{context:t.invariantContext}:{}}),We=Qt.actions.affordances.map(s=>({affordance:s,mutation:l.allMutations().find(y=>y.name===s.mutation)})).filter(s=>s.mutation!==void 0),Li=Qt.actions.withheld,Xt=()=>new Set(Ie.length===0?We.map(({mutation:s})=>s.name):[]),[Jt,_n]=(0,Me.useState)(()=>({kind:e,open:Xt()}));Jt.kind!==e&&_n({kind:e,open:Xt()});let Yn=s=>(Jt.kind===e?Jt.open:Xt()).has(s),Qn=(s,y)=>_n(O=>{let pe=new Set(O.open);return y?pe.add(s):pe.delete(s),{kind:O.kind,open:pe}}),Xn=`begin-${(0,Me.useId)().replace(/:/g,"")}`,Jn=_.words&&Ie.length===0?Object.fromEntries(jt(l,e,Qt.actions.affordances).map(s=>[s.mutation.name,s.arg])):{},Ze=ee(l,e),ht=t.views?.lookup(e,{cardinality:"one",fidelity:"glyph"}),Zt=ht!==void 0&&!at(ht)?ht:void 0,en=(E.group?.bucket??"day")==="day"?E.group?.by:void 0,tn=(E.filter??[]).map(s=>s.key),Ti=tn.filter(s=>tn.indexOf(s)===tn.lastIndexOf(s)&&/choice|boolean/.test(U.filters.find(y=>y.key===s)?.type??"")),nn=s=>{let y={...u?.computed?ut(l.schema,l.graph,s):s};en&&!String(y[en]).includes("T")&&delete y[en];for(let O of Ti)delete y[O];return y},wt=s=>{let y=fe(u,s);if(a)return(0,v.jsxs)("li",{"data-testid":"record-row","data-graview-record":s.id,style:{minWidth:0},...ln(s.id),children:[sn(s,y),a(s,{label:y,href:te(l.schema,e,s.id),flagged:C.has(s.id),glance:Dt(nn(s),u,y)})]},s.id);if(Zt){let dn=Ot(ht,s,l.graph),Ii=Object.fromEntries(Object.entries(nn(s)).filter(([Fi])=>!dn?.fields.has(Fi))),aa=dn?Dt(Ii,u,dn.title??y):"";return(0,v.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)"},...ln(s.id),children:[sn(s,y),(0,v.jsx)("div",{style:{flex:"1 1 14rem",minWidth:0},children:(0,v.jsx)(Zt,{node:s,cardinality:"one",fidelity:"glyph",mode:"fullscreen",selected:!1,...C.has(s.id)?{flagged:[s.id]}:{}})}),aa?(0,v.jsx)("span",{style:{...A,flex:"0 1 auto",minWidth:0,overflowWrap:"anywhere"},"data-testid":"record-glance",children:aa}):null,(0,v.jsx)(So,{to:te(l.schema,e,s.id),label:C.has(s.id)?`${y} \u2014 implicated in a problem`:y})]},s.id)}let O=Dt(nn(s),u,y),pe=_.words?vr(u,s,_.words):void 0,bt=de?void 0:Qa(s,u),St=go(s,u),na=(0,v.jsxs)(F,{to:te(l.schema,e,s.id),className:"graview-row-title",...y.length>60?{title:y}:{},children:[C.has(s.id)?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("span",{role:"img","aria-label":"Breaks a rule:",style:{color:"var(--graview-warn)"},children:"\u26A0"})," "]}):null,y]});return(0,v.jsxs)("li",{className:"graview-row","data-graview-record":s.id,...ln(s.id),children:[sn(s,y),bt?(0,v.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,minWidth:0},children:[(0,v.jsx)(Ve,{as:"thumb",file:bt}),na]}):na,O||St?(0,v.jsxs)("span",{className:"graview-row-glance",children:[O,O&&St?" \xB7 ":null,St?(0,v.jsx)(Et,{address:St}):null]}):null,pe?(0,v.jsx)(Ut,{why:pe}):null]},s.id)},an=Re(t).filter(s=>s.kind===e),Zn=D?.filters,Mi=(E.filter??[]).some(s=>s.key!=="is"||s.value!=="any"),Ni=!!(E.sort||E.group||E.query||Mi),Ei=lt.length>=wi||Q&&Ni,Ne=E.sort?U.sorts.find(s=>s.key===E.sort.by):void 0,rn=Ne?.type==="date"||Ne!==void 0&&Ne.key===me,ea=de&&!G.grouped&&Ne&&(Ne.about==="label"||Ne.type==="text"||rn)?s=>{let y=Ne.about==="label"?fe(u,s):s[Ne.key];if(typeof y!="string"||y.length===0)return rn?"No date":"#";if(rn)return y.slice(0,4);let O=y.trim().charAt(0).toLocaleUpperCase();return/\p{L}/u.test(O)?O:"#"}:void 0,Ge=ea?Ie.reduce((s,y)=>{let O=ea(y);return s.at(-1)?.key===O?s.at(-1).nodes.push(y):s.push({key:O,nodes:[y]}),s},[]):void 0,ta=G.grouped&&Yt?Gn.flatMap(s=>jn(s)?[]:s.nodes):Ge&&Ge.length>1?Ge.flatMap(s=>s.nodes):Ie,on=(0,Me.useMemo)(()=>ta.map(s=>s.id),[ta.map(s=>s.id).join(`
|
|
108
|
+
`;function $n({context:t}){ae(t.store);let e=Nn(t);return e.length===0?null:(0,T.jsxs)("section",{style:ri,"data-testid":"gallery",children:[(0,T.jsx)("style",{children:Yi}),e.map(n=>(0,T.jsx)(En,{context:t,entry:n},n.key))]})}function On({context:t}){let{store:e}=t;ae(e);let n=pn(Re(t)).filter(i=>!i.hidden),a=Nn(t);return(0,T.jsxs)(ie,{context:t,style:it,children:[(0,T.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,T.jsx)("p",{style:we,children:n.length===0?"None of its own yet":`${n.length} ${n.length===1?"picture":"pictures"}`}),(0,T.jsx)(le,{context:t,children:"Pictures"}),(0,T.jsx)("p",{style:se,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:ri,"data-testid":"places",children:a.map(i=>(0,T.jsx)(En,{context:t,entry:i},i.key))}):null]})}function In({context:t}){let{store:e,principal:n}=t;ae(e);let a=qe(),i=Fe(),[r]=ot(),o=decodeURIComponent(a.as??""),[l,d]=(0,De.useState)(null),c=r.get("of"),p=r.get("filter"),m=Re(t).find(R=>R.as===o&&(!c||J(e.schema,R.kind)===c));if(!m)return(0,T.jsxs)(ie,{context:t,children:[(0,T.jsx)(le,{context:t,children:"No picture is called that."}),(0,T.jsx)("p",{style:se,children:(0,T.jsxs)(F,{to:"/places",style:q,children:["The pictures there are ",(0,T.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]})})]});let u=ee(e,m.kind),k=t.views?.resolve(m.kind,{cardinality:"many",fidelity:"full"},m.as)?.view,V=k?.flows===!0,w=k?.creates!==!1,C=Ue(e,m.kind,{...n?{principal:n}:{},...t.invariantContext?{context:t.invariantContext}:{}}),U=w?C.actions.affordances.map(R=>({affordance:R,mutation:e.allMutations().find(j=>j.name===R.mutation)})).filter(R=>R.mutation!==void 0):[];return(0,T.jsxs)(ie,{context:t,style:it,children:[(0,T.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,T.jsx)(le,{context:t,children:m.title}),(0,T.jsxs)("p",{style:se,"data-testid":"place-lede",children:[Tn(e,qt(t,m),m.across),"."]}),p&&!V?(0,T.jsxs)("p",{style:{...A,margin:0},"data-testid":"place-narrowed",children:[`Only those where ${p.split(",").map(R=>R.replace(":"," is ")).join(" and ")}. `,(0,T.jsx)(F,{to:`?${(()=>{let R=new URLSearchParams(r);return R.delete("filter"),R.toString()})()}`,style:{...q,...A},children:"Show all"})]}):null,(0,T.jsx)("p",{style:{...A,margin:0,display:"flex",flexWrap:"wrap",gap:"4px 16px"},children:qt(t,m).map((R,j)=>(0,T.jsxs)(F,{to:`/${J(e.schema,R)}`,style:{...q,...A},...j===0?{"data-testid":"place-as-list"}:{},children:["All ",(R===m.kind?u:ee(e,R)).toLowerCase()," as a list ",(0,T.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]},R))})]}),(0,T.jsx)("div",{"data-testid":"place-lens","data-flows":V?"":void 0,style:V?{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:R=>{let j=R.target?.closest("[data-graview-pick]"),Q=j?.getAttribute("data-graview-pick"),de=j?.getAttribute("data-graview-joins");if(de)try{let D=JSON.parse(de);if(Array.isArray(D)&&D.every(X=>typeof X=="string")){R.preventDefault(),d({at:_e(m),ids:D});return}}catch{}if(!Q)return;let me=e.graph.getNode(Q);me&&(R.preventDefault(),i(te(e.schema,me.kind,Q)))},children:(0,T.jsx)(Mn,{context:t,place:m,filter:p,...l?.at===_e(m)?{chosen:l.ids}:{}})}),U.length>0?(0,T.jsx)("div",{style:{maxWidth:760,display:"grid",gap:40},"data-testid":"place-creators",children:U.map(({affordance:R,mutation:j})=>(0,T.jsxs)("section",{style:{...re,display:"grid",gap:14},children:[(0,T.jsx)("h2",{style:ne,children:j.title??j.name}),j.description?(0,T.jsx)("p",{style:{...A,margin:0,maxWidth:"58ch"},children:j.description}):null,(0,T.jsx)(Oe,{store:e,mutation:j,prefilled:R.args,open:R.open,label:R.label,...n?{principal:n}:{}})]},R.id))}):null]})}function st(t){return t.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-|-$/g,"")}function ft(t,e={}){let[n="/",a=""]=t.split("#")[0].split("?"),i=new URLSearchParams(a);e.filter&&i.set("filter",e.filter);let r=i.toString(),o=e.section?st(e.section):"";return`${n}${r?`?${r}`:""}${o?`#${o}`:""}`}function Qi(t,e=document){let n=st(t);if(!n)return null;let a=[e,...[...e.querySelectorAll("[data-worker-view]")].flatMap(i=>i.shadowRoot?[i.shadowRoot]:[])];for(let i of a)for(let r of i.querySelectorAll("[id], [data-section]")){let o=r.getAttribute("data-section")??r.id;if(o===t||st(o)===n)return r}for(let i of a)for(let r of i.querySelectorAll("h1, h2, h3, h4, h5, h6, [role=heading]"))if(st(r.textContent??"")===n)return r;return null}function ii(t,e={}){if(typeof document>"u"||typeof requestAnimationFrame>"u")return()=>{};let n=e.frames??120,a=0,i=()=>{let r=Qi(t,e.root??document);if(r){r.hasAttribute("tabindex")||r.setAttribute("tabindex","-1"),r.scrollIntoView?.({block:"start"}),r.focus({preventScroll:!0});return}n-=1,n>0&&(a=requestAnimationFrame(i))};return a=requestAnimationFrame(()=>{a=requestAnimationFrame(i)}),()=>cancelAnimationFrame(a)}var z=H($e(),1);var Bt=H($e(),1);var Ye=H(Y(),1);function oi({context:t}){return ue()?(0,Ye.jsxs)(Ye.Fragment,{children:[(0,Ye.jsx)(Xi,{context:t}),(0,Ye.jsx)(Ir,{face:"pages",on:t.quickAsk??!0})]}):null}function Xi({context:t}){let{store:e}=t,n=ue(),{pathname:a}=Se(),i=(0,Bt.useRef)(n?.setSelection);return i.current=n?.setSelection,(0,Bt.useEffect)(()=>{let r=i.current;if(!r)return;let[,o,l]=a.split("/"),d=(()=>{if(o==="places"){let p=t.views?.places().find(g=>g.as===decodeURIComponent(l??""));return p?[Ee(p.kind)]:[]}let c=o?Te(e.schema,o):void 0;return c&&l?[decodeURIComponent(l)]:c?[ba(c)]:[]})();r(c=>c.length===d.length&&c.every((p,g)=>p===d[g])?c:d)},[a]),null}var he=H($e(),1);var li=H(Di(),1);var ge=H(Y(),1);var Ji=(0,he.lazy)(ka(()=>(__graviewPreload(import.meta.url,["./chunk.5MCC54VM.js","./chunk.UGFDSE37.js","./chunk.3QXHII5W.js","./chunk.AINNENYD.js","./chunk.SBBNIYVB.js","./chunk.IX6RNGAT.js","./chunk.3H4NVUWV.js","./chunk.XSYBNUXF.js","./chunk.GCVO6N26.js","./chunk.LRRVBM4F.js","./chunk.H243UV3Z.js","./chunk.PKKA6JWA.js","./chunk.5EAQDBBE.js","./chunk.YT2CYCVT.js","./chunk.KWCML3BF.js","./chunk.DLT3EE4D.js","./chunk.2OBIO5Y6.js","./chunk.GF7LA4QG.js","./chunk.AEHPDVLQ.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.52QAIGCD.js","./chunk.PPUAPAWR.js","./chunk.IHFNLKXV.js","./chunk.577PGFUT.js","./chunk.FBY5IUGU.js","./chunk.4K5QCJFH.js","./chunk.GZHZLJBF.js","./chunk.QRMWFEEH.js","./chunk.MVN6H65Q.js","./chunk.OJGHDWI6.js","./chunk.Z7ZCR4LN.js","./chunk.RIW7SQH4.js","./chunk.FSAHO3LV.js","./chunk.Y5Z4ZDTO.js","./chunk.UWIYKGYK.js","./chunk.X7W27IRI.js","./chunk.AJZBJBMO.js"]),import("./chunk.5FZQI2US.js")).then(t=>({default:t.TakeBack}))));function Zi({context:t,docked:e,at:n}){let{store:a}=t,i=ae(a),[r]=(0,he.useState)(()=>a.batches().length),o=(0,he.useRef)(!1);return o.current||=i>0||!e&&r>0,o.current?(0,ge.jsx)(he.Suspense,{fallback:null,children:(0,ge.jsx)(Ji,{context:t,docked:e,at:n,since:r})}):null}function eo(t,e,n){let{store:a,principal:i,embedded:r}=t;(0,he.useEffect)(()=>{if(!n)return;let o=l=>{if(!qr(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&&!r))&&Hr(a,i)){l.preventDefault();try{Kr(a,i)}catch{}}};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[a,i,r,e,n])}function di({context:t,registry:e,root:n,children:a}){let i=(0,he.useMemo)(Xr,[]),r=e?.without()??new Set;return eo(t,n,!r.has("undo")),(0,ge.jsxs)(Cn.Provider,{value:i,children:[(0,ge.jsx)(to,{context:t,placed:i,without:r}),a]})}function to({context:t,placed:e,without:n}){let[a,i]=(0,he.useState)(!1);(0,he.useLayoutEffect)(()=>i(!0),[]);let r=Rn(e,"find"),o=Rn(e,"undo"),l=Se(),d=gr();if(!a)return null;let c=l.pathname.split("/").filter(Boolean),g=(c.length===1?Te(t.store.schema,c[0]):void 0)!==void 0;return(0,ge.jsxs)(ge.Fragment,{children:[!r&&!n.has("find")&&d?(0,li.createPortal)((0,ge.jsx)(si,{context:t,narrowsLists:g}),d.slot):null,!r&&!n.has("find")&&!d?(0,ge.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,ge.jsx)(si,{context:t,narrowsLists:g})}):null,!o&&!n.has("undo")?(0,ge.jsx)(Zi,{context:t,docked:!0,at:l.pathname+l.search}):null,d?.own&&!n.has("undo")?(0,ge.jsx)(jr,{context:t,own:d.own}):null]})}function si({context:t,narrowsLists:e}){return(0,ge.jsx)(Cn.Provider,{value:null,children:(0,ge.jsx)(Ln,{context:t,narrowsLists:e})})}var oe=H($e(),1);var Pe=H(Y(),1),no=500,ao=10;function Gt(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 ro(t){let e=typeof getSelection=="function"?getSelection():null;return e!==null&&!e.isCollapsed&&e.containsNode(t,!0)}function ci(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 pi({context:t,root:e,children:n}){return ue()===null?(0,Pe.jsx)(Pe.Fragment,{children:n}):(0,Pe.jsx)(io,{context:t,root:e,children:n})}function io({context:t,root:e,children:n}){let{setMenuAt:a}=Ra(),{store:i}=t,r=i.schema,o=Fe(),{pathname:l,search:d}=Se(),c=zr("/").replace(/\/$/,""),p=(0,oe.useCallback)((b,x)=>t.views?.places().find(L=>L.as===b&&(x===null||L.kind===x)),[t.views]),g=(0,oe.useCallback)((b,x)=>{let[L="",M,E]=b.split("/").filter(Boolean).map(Z=>{try{return decodeURIComponent(Z)}catch{return Z}});if(E!==void 0)return null;if(L==="places"&&M!==void 0){let Z=p(M,new URLSearchParams(x).get("of"));return Z?{face:"pages",place:Z.as,about:[Ee(Z.kind)],title:Z.title}:null}let _=Te(r,L);return _?M===void 0?{face:"pages",about:[Ee(_)],title:nt(r,_)}:i.graph.getNode(M)?{face:"pages",on:M,about:[M]}:null:null},[r,i,p]),m=(0,oe.useCallback)(b=>{let x=b.href;try{let L=new URL(x,location.href);if(L.origin===location.origin&&(c===""||L.pathname===c||L.pathname.startsWith(`${c}/`))){let M=g(L.pathname.slice(c.length),L.search);if(M)return{...M,href:x}}}catch{}return{face:"pages",about:[],href:x}},[c,g]),u=(0,oe.useCallback)(()=>g(l,d)??{face:"pages",about:[]},[g,l,d]),k=(0,oe.useCallback)(b=>{let x=u(),L=b.closest("[data-graview-field]")?.getAttribute("data-graview-field");if(L&&x.on!==void 0&&b.closest("[data-graview-pick], a[href]")===null)return{...x,field:L};let M=b.closest("[data-graview-act]")?.getAttribute("data-graview-act");if(M)return{...x,act:M};let E=b.closest("[data-graview-pick]")?.getAttribute("data-graview-pick");if(E&&i.graph.getNode(E))return{face:"pages",on:E,about:[E],href:`${c}${te(r,i.graph.getNode(E).kind,E)}`};let _=b.closest("a[href]");if(_)return m(_);let Z=b.closest("[data-graview-record]")?.getAttribute("data-graview-record");return Z&&i.graph.getNode(Z)?{face:"pages",on:Z,about:[Z]}:x},[u,m,i,r,c]),V=(0,oe.useCallback)(b=>{let x=e.current;if(x===null||!x.contains(b)||Gt(b)||b.closest("[data-graview-popover]"))return null;let L=k(b);return{face:"pages",on:L.on,about:L.about??[],field:L.field,place:L.place,href:L.href,act:L.act,element:ci(b)}},[k,e]),w=(0,oe.useCallback)((b,x,L)=>{let M=k(b);a({...M,x:Math.round(x),y:Math.round(L),returnTo:ci(b)})},[k,a]),C=(0,oe.useCallback)(b=>{let x=b.getBoundingClientRect();w(b,x.left+Math.min(16,x.width/2),Math.min(x.bottom,x.top+36))},[w]),U=(0,oe.useRef)(0),R=(0,oe.useRef)(null),j=(0,oe.useRef)(!1),Q=()=>{R.current&&clearTimeout(R.current.timer),R.current=null};(0,oe.useEffect)(()=>Q,[]),(0,oe.useEffect)(()=>{let b=x=>{if(x.defaultPrevented||!(x.key==="ContextMenu"||x.key==="F10"&&x.shiftKey))return;let L=e.current,M=x.target instanceof Element?x.target:null,E=M===null||M===document.body||M===document.documentElement,_=L!==null&&M!==null&&L.contains(M);if(!_&&!(E&&document.querySelector("[data-graview-face='pages']")===L)||Gt(M)||M?.closest("[data-graview-popover]"))return;x.preventDefault(),U.current=Date.now();let Z=_&&M instanceof HTMLElement?M:L?.querySelector("[data-graview-page-title], main h1, main")??null;Z&&C(Z)};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[e,C]);let de=(0,oe.useMemo)(()=>b=>{if(b.face!=="pages")return null;let x=[],L=b.on===void 0?void 0:i.graph.getNode(b.on),M=b.place===void 0?void 0:t.views?.places().find(G=>G.as===b.place),E=L?void 0:b.about.length===1&&b.about[0].startsWith("aggregate:")&&!M?oo(b.about[0]):void 0,_=L?te(r,L.kind,L.id):M?xe(t,M):E?`/${J(r,E)}`:void 0,Z=_!==void 0&&l===_.split("?")[0];_!==void 0&&!Z&&x.push({id:"open",label:"Open",run:()=>o(_)});let f=_!==void 0?`${c}${_}`:b.href;f!==void 0&&x.push({id:"open-in-a-new-tab",label:"Open in a new tab",run:()=>void window.open(f,"_blank","noopener")});let N=L?`#focus=${encodeURIComponent(L.id)}`:M?`#focus=${encodeURIComponent(Ee(M.kind))}&view=${encodeURIComponent(M.as)}`:E?`#focus=${encodeURIComponent(Ee(E))}`:void 0;if(N!==void 0&&(t.overview||!t.embedded)){let G=t.overview;x.push({id:"in-the-scene",label:"Show in the scene",run:()=>G?G(N):location.assign(`${t.sceneHref??"/"}${N}`)})}return L===void 0&&b.href===void 0&&x.push({id:"find",label:"Find\u2026",run:()=>{let G=e.current?.querySelector('[data-testid="nav-find"]')??document.querySelector('[data-testid="nav-find"]');G&&G.offsetParent!==null?G.focus():o("/search")}}),x.length>0?{id:"pages",items:x}:null},[i,r,t,l,c,o,e]),me=(0,oe.useMemo)(()=>b=>{if(b.face!=="pages"||b.field===void 0||b.on===void 0)return null;let x=i.graph.getNode(b.on),L=b.element?.closest("[data-graview-field]")??e.current?.querySelector(`[data-graview-field="${CSS.escape(b.field)}"]`);return!x||!(L instanceof HTMLElement)||!L.hasAttribute("data-graview-editable")?null:{id:"field",at:"start",items:[{id:"change-field",label:`Change \u201C${ia(r.tryDefinition(x.kind),b.field)}\u201D`,run:()=>L.click()}]}},[i,r,e]),D=Dr(),X=ar(),ce=(0,oe.useMemo)(()=>[me,de,...X?[X]:[],...D?[D]:[]],[me,de,X,D]);return(0,Pe.jsxs)(Xa,{sections:ce,children:[(0,Pe.jsx)("div",{"data-graview-menu-ground":"",style:{display:"contents"},onContextMenu:b=>{let x=b.target;b.shiftKey||Gt(x)||ro(x)||(b.preventDefault(),!x.closest("[data-graview-popover]")&&(Date.now()-U.current<700||(b.clientX===0&&b.clientY===0&&x instanceof HTMLElement?C(x):w(x,b.clientX,b.clientY))))},onPointerDown:b=>{if(j.current=!1,b.pointerType==="mouse"||!b.isPrimary)return;let x=b.target;if(Gt(x)||x.closest("[data-graview-choose], [data-graview-popover]"))return;Q();let{clientX:L,clientY:M}=b;R.current={x:L,y:M,timer:setTimeout(()=>{R.current=null,j.current=!0,U.current=Date.now(),w(x,L,M)},no)}},onPointerMove:b=>{let x=R.current;x&&Math.hypot(b.clientX-x.x,b.clientY-x.y)>ao&&Q()},onPointerUp:Q,onPointerCancel:Q,onClickCapture:b=>{j.current&&(j.current=!1,b.preventDefault(),b.stopPropagation())},children:n}),(0,Pe.jsx)(so,{openAt:C,readyAt:V}),(0,Pe.jsx)(Wr,{placement:"page"}),(0,Pe.jsx)(rr,{})]})}function oo(t){let e=t.slice(10).split("+");return e.length===1&&e[0]?e[0]:void 0}function so({openAt:t,readyAt:e}){return(0,Pe.jsx)("span",{"data-graview-menu-home":"",tabIndex:-1,onFocus:n=>{if(n.target!==n.currentTarget)return;let a=n.currentTarget.closest("[data-graview-face]"),i=a?.querySelector("[data-graview-page-title]")??a?.querySelector("main h1, main")??null;i&&(i.hasAttribute("tabindex")||i.setAttribute("tabindex","-1"),i.focus({preventScroll:!0}))},style:{position:"absolute",width:0,height:0,overflow:"hidden"},children:(0,Pe.jsx)(Or,{placement:"menu",openActs:t,aimAt:e})})}var K=H(Y(),1);function ui(t,e){return e==="*"?{label:"anything",path:null}:{label:ee(t,e),path:`/${J(t.schema,e)}`}}function lo({context:t,relation:e}){let{store:n}=t,a=ui(n,e.from),i=ui(n,e.to),r=o=>o.path?(0,K.jsx)(F,{to:o.path,style:{...ke,fontWeight:550},children:o.label}):(0,K.jsx)("span",{children:o.label});return(0,K.jsxs)("li",{"data-testid":"relation","data-relation":e.edgeKind,style:{display:"grid",gridTemplateColumns:"30px minmax(0, 1fr) auto",gap:12,alignItems:"baseline"},children:[(0,K.jsx)(Fr,{edgeKind:e.edgeKind,...t.brand?.kit?{kit:t.brand.kit}:{}}),(0,K.jsxs)("span",{style:{display:"grid",gap:1},children:[(0,K.jsxs)("span",{children:[r(a)," ",(0,K.jsxs)("span",{style:A,"data-graview-speaks-ids":"",children:[ve(e.edgeKind)," \u2192"]})," ",r(i)]}),e.description||e.inverse?(0,K.jsxs)("span",{style:A,children:[e.description?Ae(e.description):null,e.description&&e.inverse?" \xB7 ":null,e.inverse?`from the other end, ${e.inverse}`:null]}):null]}),i.path?(0,K.jsx)(F,{to:`${i.path}?with=${encodeURIComponent(e.edgeKind)}`,style:{...q,...A,fontVariantNumeric:"tabular-nums",display:"inline-block",minWidth:24,minHeight:24,textAlign:"center"},title:`The ${i.label.toLowerCase()} that have this`,children:e.count}):(0,K.jsx)("span",{style:{...A,fontVariantNumeric:"tabular-nums"},children:e.count})]})}function gi({context:t,heading:e=!0}){let{store:n}=t,a=new Set(Ke(n,t.principal)),i=je(n).relations.filter(r=>a.has(r.from)&&(r.to==="*"||a.has(r.to)));return i.length===0?null:(0,K.jsxs)("section",{style:{...re,display:"grid",gap:12},"data-testid":"kind-map",children:[e?(0,K.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[(0,K.jsx)("h2",{style:ne,children:(0,K.jsx)(F,{to:"/map",style:ke,children:"Connections"})}),(0,K.jsx)("span",{style:A,children:i.length===1?"1 relation":`${i.length} relations`})]}):null,(0,K.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:i.map(r=>(0,K.jsx)(lo,{context:t,relation:r},`${r.edgeKind}|${r.from}|${r.to}`))})]})}function Fn({context:t}){let{store:e}=t;ae(e);let n=new Set(Ke(e,t.principal)),a=je(e),i=a.relations.filter(r=>n.has(r.from));return(0,K.jsxs)(ie,{context:t,children:[(0,K.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,K.jsx)("p",{style:we,children:i.length===0?"No relations":`${i.length} ${i.length===1?"relation":"relations"}`}),(0,K.jsx)(le,{context:t,children:"Connections"}),(0,K.jsx)("p",{style:se,children:i.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,K.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"6px 18px"},"data-testid":"map-kinds",children:a.kinds.filter(r=>n.has(r.kind)).map(r=>(0,K.jsxs)("li",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[(0,K.jsx)(ye,{kind:r.kind,brand:t.brand,schema:e.schema,size:7}),(0,K.jsx)(F,{to:`/${J(e.schema,r.kind)}`,style:q,children:r.plural}),(0,K.jsx)("span",{style:A,children:r.count})]},r.kind))}),(0,K.jsx)(gi,{context:t,heading:!1})]})}function mi({context:t}){let n=[...ue()?.robots.values()??[]].filter(i=>i.mode==="asking"&&i.say);if(n.length===0)return null;let{store:a}=t;return(0,K.jsxs)("section",{style:{...re,display:"grid",gap:10},"data-testid":"seat-questions",children:[(0,K.jsx)("h2",{style:ne,children:n.length===1?"The seat asked something":`The seat asked ${n.length} things`}),(0,K.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:8},children:n.map(i=>{let r=i.at?a.graph.getNode(i.at):void 0;return(0,K.jsxs)("li",{style:{display:"grid",gap:2},children:[(0,K.jsx)("span",{children:i.say}),r?(0,K.jsxs)(F,{to:te(a.schema,r.kind,r.id),style:{...q,...A},children:[fe(a.schema.tryDefinition(r.kind),r)," \u2192"]}):null]},i.participant)})})]})}var B=H(Y(),1);function Dn({context:t}){let{principal:e}=t,{store:n,brand:a,invariantContext:i}=t;ae(n);let r=n.violations(i),o=`${r.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=Wt(t).map(C=>({kind:C,members:n.graph.nodesOfKind(C).filter(U=>tt(n.schema.tryDefinition(C),U))})),p=c.filter(C=>C.members.length>0),g=c.map(C=>({entry:C,creator:n.allMutations().find(U=>(U.creates??[]).includes(C.kind)&&n.permits({name:U.name,args:{}},t.principal).ok)})).find(C=>C.creator!==void 0),m=p.length===0?"Nothing here yet.":`${p.map(C=>xt(n.schema,C.kind,C.members.length)).join(", ").replace(/, ([^,]*)$/," and $1")}.`,u=t.views?.homeView?.(),k=n.schema.kinds.some(C=>n.graph.nodesOfKind(C).length>0);if(u&&k){let C=a?.subtitle?(0,B.jsx)("p",{style:{...A,margin:0},"data-testid":"app-subtitle",children:a.subtitle}):null,U=u[Symbol.for("graview.home-blocks")]===!0;return(0,B.jsx)(ie,{context:t,style:it,children:(0,B.jsxs)("div",{style:{display:"grid",gap:12},"data-testid":"home-view",children:[U?null:C,r.length>0?(0,B.jsx)(F,{to:"/problems",style:{...q,color:"var(--graview-warn)"},children:o}):null,(0,B.jsx)(Nr.Provider,{value:U?C:null,children:(0,B.jsx)(u,{cardinality:"many",fidelity:"full",mode:"fullscreen",selected:!1})})]})})}let V=new Set(Ke(n,t.principal)),w=je(n).relations.filter(C=>V.has(C.from)&&(C.to==="*"||V.has(C.to)));return(0,B.jsxs)(ie,{context:t,style:it,children:[(0,B.jsxs)("header",{style:{display:"grid",gap:12},children:[a?.subtitle?(0,B.jsx)("p",{style:{...A,margin:0},"data-testid":"app-subtitle",children:a.subtitle}):null,(0,B.jsx)(le,{context:t,"data-testid":"standing",children:m}),(0,B.jsxs)("p",{style:{...se,display:"grid",gap:4},"data-testid":"standing-card",children:[p.length===0&&g?(0,B.jsxs)("span",{children:["Begin with \u201C",g.creator?.title??g.creator?.name,"\u201D, under"," ",(0,B.jsx)(F,{to:`/${J(n.schema,g.entry.kind)}`,style:q,children:ee(n,g.entry.kind)}),"."]}):null,r.length===0?(0,B.jsx)("span",{children:"All rules hold."}):(0,B.jsx)(F,{to:"/problems",style:{...q,color:"var(--graview-warn)"},children:o})]})]}),(0,B.jsx)($n,{context:t}),(0,B.jsxs)("section",{style:{...re,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:ne,children:"What is here"}),w.length>0?(0,B.jsxs)(F,{to:"/map",style:{...q,...A,marginLeft:"auto"},"data-testid":"map-link",children:["Connections \xB7 ",w.length===1?"1 relation":`${w.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:C,members:U})=>(0,B.jsx)("li",{style:{maxWidth:"100%"},children:(0,B.jsxs)(F,{to:`/${J(n.schema,C)}`,style:{...ke,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)(ye,{kind:C,brand:a,schema:n.schema,size:7}),(0,B.jsx)("span",{style:{fontWeight:550,overflowWrap:"anywhere"},children:ee(n,C)}),(0,B.jsx)("span",{style:{...A,fontVariantNumeric:"tabular-nums"},children:U.length===0?"none yet":pt(U.length)})]})},C))})]}),l.length>0?(0,B.jsxs)("section",{style:{...re,display:"grid",gap:10},children:[(0,B.jsx)("h2",{style:ne,children:"Recently"}),(0,B.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:l.map(C=>(0,B.jsxs)("li",{style:A,children:[(0,B.jsx)("span",{style:{color:"var(--graview-ink)"},children:C.intent})," \u2014 ",gt(C,e,{graph:n.graph,schema:n.schema,...t.seats?{seats:t.seats}:{},...t.people?{people:t.people}:{}})]},C.id))})]}):null]})}var Me=H($e(),1);var Qe=H(Y(),1);function Vt({context:t,withheld:e,style:n,testId:a}){let i=ue(),r=ma(e,t.signIn??i?.signIn);return r?(0,Qe.jsx)("p",{style:{...n,margin:0},children:(0,Qe.jsx)("button",{type:"button","data-testid":"sign-in",onClick:()=>r.run(),style:be,children:r.label})}):e.length===0?null:(0,Qe.jsx)("ul",{style:{...n,margin:0,padding:0,listStyle:"none",display:"grid",gap:4},...a?{"data-testid":a}:{},children:e.map(o=>(0,Qe.jsxs)("li",{style:A,children:[(0,Qe.jsx)("s",{children:o.label})," \u2014 ",o.refusal.message]},o.id))})}var $=H(Y(),1);function Wn({context:t}){let{store:e,brand:n,principal:a,invariantContext:i}=t;ae(e);let[r]=ot(),o=r.get("q")??"",l=typeof i?.today=="string"?i.today:void 0,d=kr(e,o,{...a?{principal:a}:{},places:Re(t),flagged:new Set(e.violations(i).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"),g=[...new Set(c.map(u=>u.kind))],m=o.trim();return(0,$.jsxs)(ie,{context:t,children:[(0,$.jsx)("style",{children:Ft}),(0,$.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,$.jsx)("p",{style:we,children:"Search"}),(0,$.jsx)(le,{context:t,"data-testid":"search-heading",children:m.length===0?"Find anything by its name":d.hits.length===0?(0,$.jsxs)($.Fragment,{children:["Nothing here is called \u201C",m,"\u201D."]}):(0,$.jsxs)($.Fragment,{children:[co(e,d.byKind)," for \u201C",m,"\u201D"]})}),m.length>0?(0,$.jsxs)("p",{style:{...A,margin:0},"data-testid":"search-searched",children:[Mt(e.schema,d.searched),d.conditions.filter(u=>u.key!=="is"&&u.admittedBy.length<d.searched.kinds.length).map(u=>(0,$.jsxs)("span",{children:[" ",u.key,":",u.value," narrows"," ",u.admittedBy.length===0?"nothing here":u.admittedBy.map(k=>ee(e,k).toLowerCase()).join(" and "),"."]},`${u.key}:${u.value}`))]}):(0,$.jsxs)("p",{style:se,children:["Type in the box above. Words find the start of words in names and in what each record says;"," ",(0,$.jsx)("code",{children:"done:false"})," and the like narrow as a list does, and ",(0,$.jsx)("code",{children:"is:any"})," includes what is past."]})]}),p.length>0?(0,$.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},"data-testid":"search-named",children:p.map(u=>(0,$.jsx)("li",{"data-testid":"search-hit","data-about":u.about,children:u.about==="kind"?(0,$.jsxs)(F,{to:`/${J(e.schema,u.kind)}`,style:q,children:[u.label,u.count>0?(0,$.jsxs)("span",{style:A,children:[" \xB7 ",u.count," match"]}):null]}):u.about==="place"?(0,$.jsxs)(F,{to:xe(t,u),style:q,children:["Go to ",u.title]}):u.about==="rule"?(0,$.jsxs)(F,{to:"/problems",style:q,children:["The rule \u201C",u.label,"\u201D"]}):null},`${u.about}:${u.about==="rule"?u.name:u.about==="place"?u.as:u.kind}`))}):null,g.map(u=>(0,$.jsxs)("section",{className:"graview-list",style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",minWidth:0},"data-testid":"search-group","data-kind":u,children:[(0,$.jsxs)("h2",{className:"graview-group-head",style:{alignItems:"center"},children:[(0,$.jsx)(ye,{kind:u,brand:n,schema:e.schema,size:8}),(0,$.jsx)(F,{to:`/${J(e.schema,u)}?${new URLSearchParams({q:m}).toString()}`,style:q,"data-testid":"search-kind-link",children:ee(e,u)}),(0,$.jsx)("span",{children:d.byKind[u]})]}),(0,$.jsx)("ul",{className:"graview-rows",children:c.filter(k=>k.kind===u).map(k=>(0,$.jsxs)("li",{"data-testid":"search-hit","data-about":"node",className:"graview-row",children:[(0,$.jsxs)(F,{to:te(e.schema,u,k.id),className:"graview-row-title",...k.label.length>60?{title:k.label}:{},children:[k.flagged?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)("span",{role:"img","aria-label":"Breaks a rule:",style:{color:"var(--graview-warn)"},children:"\u26A0"})," "]}):null,k.label]}),k.apart||!k.current?(0,$.jsx)("span",{className:"graview-row-glance",children:[k.apart,k.current?"":"past"].filter(Boolean).join(" \xB7 ")}):null,(0,$.jsx)(Ut,{why:k.why})]},k.id))})]},u)),m.length>0?(0,$.jsx)(po,{asked:m}):null,m.length>0&&d.hits.length===0?(0,$.jsx)(yi,{store:e,kinds:d.searched.kinds,words:d.words,...a?{principal:a}:{},...i?{invariantContext:i}:{}}):null]})}function Ut({why:t}){return t.strength==="near"?(0,$.jsxs)("span",{style:A,"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,$.jsxs)("span",{style:A,"data-testid":"search-why",children:[t.reading,": ",t.fragment]})}function co(t,e){let n=Object.entries(e).map(([a,i])=>`${i} ${i===1?He(t.schema.tryDefinition(a),a):ee(t,a).toLowerCase()}`);return n.length===0?"Found":n.length===1?Ae(n[0]):Ae(`${n.slice(0,-1).join(", ")} and ${n[n.length-1]}`)}function fi(t,e,n={}){let a=[];for(let i of e){let r=Ue(t,i,{...n.principal?{principal:n.principal}:{},...n.invariantContext?{context:n.invariantContext}:{}});for(let o of jt(t,i,r.actions.affordances))a.some(l=>l.mutation.name===o.mutation.name)||a.push(o)}return a}function jt(t,e,n){let a=t.schema.tryDefinition(e)?.fieldRoles?.label,i=[];for(let r of n){let o=t.allMutations().find(c=>c.name===r.mutation);if(!o||!o.creates?.includes(e)||i.some(c=>c.mutation.name===o.name))continue;let l=Tt(o.input).map(c=>c.name),d=l.includes("label")?"label":a&&l.includes(a)?a:void 0;!d||r.args[d]!==void 0||i.push({kind:e,affordance:r,mutation:o,arg:d})}return i}function yi({store:t,kinds:e,words:n,principal:a,invariantContext:i}){let r=fi(t,e,{...a?{principal:a}:{},...i?{invariantContext:i}:{}});return r.length===0||n.trim().length===0?null:(0,$.jsx)("div",{style:{display:"grid",gap:24},"data-testid":"search-to-create",children:r.map(({kind:o,affordance:l,mutation:d,arg:c})=>(0,$.jsxs)("section",{style:{...re,display:"grid",gap:14},children:[(0,$.jsxs)("h2",{style:ne,children:[Ae(oa(He(t.schema.tryDefinition(o),o)))," called \u201C",n,"\u201D"]}),(0,$.jsx)(Oe,{store:t,mutation:d,prefilled:l.args,open:l.open,initial:{[c]:n},...a?{principal:a}:{}})]},`${l.id}|${n}`))})}function po({asked:t}){let e=ue();return e?(0,$.jsx)(uo,{asked:t,desk:e.aiDesk}):null}function uo({asked:t,desk:e}){return Oa(e)?(0,$.jsx)("p",{style:{margin:0},children:(0,$.jsxs)("button",{type:"button","data-testid":"search-ask",onClick:a=>$a(e,{pointed:{about:[]},asked:t,returnTo:a.currentTarget}),style:{...q,font:"inherit",padding:0,border:0,background:"transparent",cursor:"pointer",textAlign:"start"},children:["Ask: \u2018",t,"\u2019"]})}):null}var v=H(Y(),1),wi=8,vi=40;function go(t,e){let n=e?.fields?.shape??{},a=Object.keys(n).find(i=>la(n[i])&&sa(t[i]));return a===void 0?void 0:t[a]}function Hn({context:t}){let e=qe(),n=Te(t.store.schema,e.slug??"");return n?(0,v.jsx)(ki,{context:t,kind:n}):(0,v.jsx)(ie,{context:t,children:(0,v.jsx)(le,{context:t,children:"No such kind of thing here."})})}function ki({context:t,kind:e,opening:n,row:a,layout:i="list",description:r,bare:o}){let{store:l,brand:d,invariantContext:c}=t;ae(l);let[p,g]=ot(),m=`list-${(0,Me.useId)().replace(/:/g,"")}`,u=l.schema.tryDefinition(e),k=ca(p.get("archived")),V=l.graph.nodesOfKind(e,{archived:k}),w=je(l).relations.filter(s=>s.from===e||s.to===e),C=new Set(l.violations(c).flatMap(s=>s.nodeIds)),U=hr(l.schema,yr(l.schema,fr(l.schema,e))),R=w.map(s=>s.edgeKind),j=vo(p,U,R),Q=["sort","filter","group","q","by","with","past","archived",...R].some(s=>p.has(s)),de=V.length>=vi,me=u?.fieldRoles?.when,D=t.views?.arrangement?.()?.lists?.[e],X=cr(D),ce=dr(D?.group),b=wo(de,me),x=n??(X?{...b,...X}:b),L=Q?j.arrangement:vn(x,U).arrangement,M=X?.sort,E=L.sort&&M?.then&&L.sort.by===M.by&&L.sort.direction===M.direction?{...L,sort:M}:L,_=wr(E.query??""),Z=[...E.filter??[],..._.conditions].some(s=>s.key==="is"&&(s.value==="past"||s.value==="any"))||mr(u,[...E.filter??[],..._.conditions]),f=Z||!u?.lifecycle?E:{...E,filter:[...E.filter??[],{key:"is",value:"current"}]},N=new Map,G=Nt(V,f,{schema:l.schema,graph:l.graph,flagged:C,...typeof c?.today=="string"?{today:c.today}:{},read:(s,y)=>{let O=N.get(s.id);return O||N.set(s.id,O=ut(l.schema,l.graph,s)),O[y]}}),I=ce&&E.group?.by===ce.by&&!E.group.bucket?U.groups.find(s=>s.key===ce.by):void 0,Gn=ce&&I&&(I.type==="choice"||I.type==="boolean")?pr(G.groups,ce,{type:I.type,...I.options?{options:I.options}:{}}):G.groups.map(s=>({...s,closed:!1})),Vn=new Set((p.get("open")??"").split(",").filter(Boolean)),Ai=!!E.query||(E.filter??[]).some(s=>s.key===ce?.by),Un=s=>I?.type==="boolean"?s==="1"?"true":"false":s,jn=s=>s.closed&&!Ai&&!Vn.has(Un(s.key)),Ci=s=>{let y=new URLSearchParams(p),O=new Set(Vn);O.has(s)?O.delete(s):O.add(s),O.size>0?y.set("open",[...O].join(",")):y.delete("open"),g(y,{replace:!0})},Ie=G.nodes,lt=u?.lifecycle&&!Z?V.filter(s=>tt(u,s)):V,zn=V.length-lt.length,Yt=E.group?.by??null,Ri=s=>{let y=new URLSearchParams(p);for(let pe of["sort","filter","group","q","by","with","past","archived",...w.map(bt=>bt.edgeKind)])y.delete(pe);let O=br(s);for(let pe of["sort","filter","group","q","archived"])O[pe]&&y.set(pe,O[pe]);![...y.keys()].some(pe=>["sort","filter","group","q"].includes(pe))&&(n||X||de||me)&&y.set("sort",""),g(y)},{principal:Je}=t,Qt=Ue(l,e,{...Je?{principal:Je}:{},...t.invariantContext?{context:t.invariantContext}:{}}),We=Qt.actions.affordances.map(s=>({affordance:s,mutation:l.allMutations().find(y=>y.name===s.mutation)})).filter(s=>s.mutation!==void 0),Li=Qt.actions.withheld,Xt=()=>new Set(Ie.length===0?We.map(({mutation:s})=>s.name):[]),[Jt,_n]=(0,Me.useState)(()=>({kind:e,open:Xt()}));Jt.kind!==e&&_n({kind:e,open:Xt()});let Yn=s=>(Jt.kind===e?Jt.open:Xt()).has(s),Qn=(s,y)=>_n(O=>{let pe=new Set(O.open);return y?pe.add(s):pe.delete(s),{kind:O.kind,open:pe}}),Xn=`begin-${(0,Me.useId)().replace(/:/g,"")}`,Jn=_.words&&Ie.length===0?Object.fromEntries(jt(l,e,Qt.actions.affordances).map(s=>[s.mutation.name,s.arg])):{},Ze=ee(l,e),ht=t.views?.lookup(e,{cardinality:"one",fidelity:"glyph"}),Zt=ht!==void 0&&!at(ht)?ht:void 0,en=(E.group?.bucket??"day")==="day"?E.group?.by:void 0,tn=(E.filter??[]).map(s=>s.key),Ti=tn.filter(s=>tn.indexOf(s)===tn.lastIndexOf(s)&&/choice|boolean/.test(U.filters.find(y=>y.key===s)?.type??"")),nn=s=>{let y={...u?.computed?ut(l.schema,l.graph,s):s};en&&!String(y[en]).includes("T")&&delete y[en];for(let O of Ti)delete y[O];return y},wt=s=>{let y=fe(u,s);if(a)return(0,v.jsxs)("li",{"data-testid":"record-row","data-graview-record":s.id,style:{minWidth:0},...ln(s.id),children:[sn(s,y),a(s,{label:y,href:te(l.schema,e,s.id),flagged:C.has(s.id),glance:Dt(nn(s),u,y)})]},s.id);if(Zt){let dn=Ot(ht,s,l.graph),Ii=Object.fromEntries(Object.entries(nn(s)).filter(([Fi])=>!dn?.fields.has(Fi))),aa=dn?Dt(Ii,u,dn.title??y):"";return(0,v.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)"},...ln(s.id),children:[sn(s,y),(0,v.jsx)("div",{style:{flex:"1 1 14rem",minWidth:0},children:(0,v.jsx)(Zt,{node:s,cardinality:"one",fidelity:"glyph",mode:"fullscreen",selected:!1,...C.has(s.id)?{flagged:[s.id]}:{}})}),aa?(0,v.jsx)("span",{style:{...A,flex:"0 1 auto",minWidth:0,overflowWrap:"anywhere"},"data-testid":"record-glance",children:aa}):null,(0,v.jsx)(So,{to:te(l.schema,e,s.id),label:C.has(s.id)?`${y} \u2014 implicated in a problem`:y})]},s.id)}let O=Dt(nn(s),u,y),pe=_.words?vr(u,s,_.words):void 0,bt=de?void 0:Qa(s,u),St=go(s,u),na=(0,v.jsxs)(F,{to:te(l.schema,e,s.id),className:"graview-row-title",...y.length>60?{title:y}:{},children:[C.has(s.id)?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("span",{role:"img","aria-label":"Breaks a rule:",style:{color:"var(--graview-warn)"},children:"\u26A0"})," "]}):null,y]});return(0,v.jsxs)("li",{className:"graview-row","data-graview-record":s.id,...ln(s.id),children:[sn(s,y),bt?(0,v.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,minWidth:0},children:[(0,v.jsx)(Ve,{as:"thumb",file:bt}),na]}):na,O||St?(0,v.jsxs)("span",{className:"graview-row-glance",children:[O,O&&St?" \xB7 ":null,St?(0,v.jsx)(Et,{address:St}):null]}):null,pe?(0,v.jsx)(Ut,{why:pe}):null]},s.id)},an=Re(t).filter(s=>s.kind===e),Zn=D?.filters,Mi=(E.filter??[]).some(s=>s.key!=="is"||s.value!=="any"),Ni=!!(E.sort||E.group||E.query||Mi),Ei=lt.length>=wi||Q&&Ni,Ne=E.sort?U.sorts.find(s=>s.key===E.sort.by):void 0,rn=Ne?.type==="date"||Ne!==void 0&&Ne.key===me,ea=de&&!G.grouped&&Ne&&(Ne.about==="label"||Ne.type==="text"||rn)?s=>{let y=Ne.about==="label"?fe(u,s):s[Ne.key];if(typeof y!="string"||y.length===0)return rn?"No date":"#";if(rn)return y.slice(0,4);let O=y.trim().charAt(0).toLocaleUpperCase();return/\p{L}/u.test(O)?O:"#"}:void 0,Ge=ea?Ie.reduce((s,y)=>{let O=ea(y);return s.at(-1)?.key===O?s.at(-1).nodes.push(y):s.push({key:O,nodes:[y]}),s},[]):void 0,ta=G.grouped&&Yt?Gn.flatMap(s=>jn(s)?[]:s.nodes):Ge&&Ge.length>1?Ge.flatMap(s=>s.nodes):Ie,on=(0,Me.useMemo)(()=>ta.map(s=>s.id),[ta.map(s=>s.id).join(`
|
|
109
109
|
`)]),Le=Ar(on),dt=(Je?l.permittedMutations(Je):l.permittedMutations()).some(s=>{let y=s.subject?.kinds;return y!==void 0&&(y==="*"||y.includes(e))}),sn=(s,y)=>dt?(0,v.jsx)("span",{className:"graview-choose-at",children:(0,v.jsx)("input",{...Le.boxProps(s.id,y),onPointerEnter:bn,onFocus:bn})}):null,ln=s=>dt?{"data-graview-choose":s}:{},$i=(0,Me.useCallback)(s=>{Le.choose(s),requestAnimationFrame(()=>{let y=Le.list.current;((s[0]===void 0?null:y?.querySelector(`[data-graview-choose-box="${CSS.escape(s[0])}"]`))??y)?.focus({preventScroll:!0})})},[Le]),et=i==="grid"?{margin:0,padding:0,listStyle:"none",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 15rem), 1fr))",alignItems:"start",gap:12}:a||Zt?{margin:0,padding:0,listStyle:"none",display:"grid",gap:a&&i==="list"?6:0}:void 0,vt=et?void 0:"graview-rows",ct=s=>`list-at-${s.replace(/[^\p{L}\p{N}]/gu,"_")}`,kt=w.map(s=>{let y=s.from===e?s.to:s.from,O=s.from===e?s.description:s.inverse??s.description;return{relation:s,far:y,words:O}}),Oi=new Set(kt.map(s=>(s.words??"").toLowerCase()).filter((s,y,O)=>s&&O.indexOf(s)!==y));return(0,v.jsxs)(o?ho:ie,{context:t,children:[(0,v.jsxs)("div",{style:{display:"grid",gap:12},children:[(0,v.jsxs)("header",{style:{display:"grid",gap:4},children:[(0,v.jsxs)("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",columnGap:10,rowGap:4,minWidth:0},children:[(0,v.jsx)(ye,{kind:e,brand:d,schema:l.schema,size:8}),(0,v.jsx)(le,{context:t,children:Ze}),We.length>0?(0,v.jsx)("span",{style:{marginLeft:"auto",display:"flex",flexWrap:"wrap",columnGap:14},"data-testid":"beginnings-open",children:We.map(({affordance:s,mutation:y})=>(0,v.jsx)(ko,{name:y.name,title:y.title??y.name,panel:`${Xn}-${y.name}`,open:Yn(y.name),onOpen:O=>Qn(y.name,O)},s.id))}):null]}),r??u?.description?(0,v.jsx)("p",{style:se,children:r??u?.description}):null,kt.length>0||an.length>0?(0,v.jsxs)("p",{style:{...A,margin:0,display:"flex",flexWrap:"wrap",columnGap:18,rowGap:2},"data-testid":"kind-related",children:[kt.length>0?(0,v.jsxs)("span",{"data-testid":"kind-relations",children:["Related:"," ",kt.map(({relation:s,far:y,words:O},pe)=>(0,v.jsxs)("span",{"data-relation":s.edgeKind,children:[pe>0?(0,v.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,y==="*"?Ae(O??ve(s.edgeKind)):(0,v.jsx)(F,{to:`/${J(l.schema,y)}`,style:q,title:ee(l,y),children:O&&Oi.has(O.toLowerCase())?`${Ae(O)}: ${ee(l,y).toLowerCase()}`:Ae(O??ee(l,y))})]},`${s.edgeKind}|${s.from}|${s.to}`))]}):null,an.length>0?(0,v.jsxs)("span",{"data-testid":"kind-pictures",children:["Also as:"," ",an.map((s,y)=>(0,v.jsxs)("span",{children:[y>0?(0,v.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,(0,v.jsx)(F,{to:xe(t,s),style:q,children:s.title})]},_e(s)))]}):null]}):null]}),We.length>0?(0,v.jsx)("div",{style:{display:"contents"},"data-testid":"beginnings",children:We.map(({affordance:s,mutation:y})=>{let O=!!(Jn[y.name]&&Ie.length===0);return(0,v.jsx)(bo,{name:y.name,id:`${Xn}-${y.name}`,description:y.description,open:Yn(y.name),onClose:()=>Qn(y.name,!1),children:(0,v.jsx)(Oe,{store:l,mutation:y,prefilled:s.args,open:s.open,...O?{initial:{[Jn[y.name]]:_.words}}:{},...t.principal?{principal:t.principal}:{}},O?`${y.name}|${_.words}`:y.name)},s.id)})}):null,j.dropped.length>0?(0,v.jsxs)("p",{style:{...A,margin:0},"data-testid":"list-dropped",children:["This link asked for ",j.dropped.join(", "),", which ",Ze.toLowerCase()," cannot be arranged by; the rest is shown."]}):null,lt.length>0?(0,v.jsx)(Pr,{schema:l.schema,graph:l.graph,kind:e,arrangement:E,onChange:Ri,kept:{shown:Ie.length,of:lt.length},noun:{one:He(u,e),many:Ze.toLowerCase()},...Ei?{}:{allow:!1},...Zn?{filters:Zn}:{},offers:U,chips:{nodes:lt,flagged:C,...typeof c?.today=="string"?{today:c.today}:{}},query:t.framed===!0&&t.barAbove!==!0}):null,(0,v.jsx)("style",{children:Ft}),dt?(0,v.jsx)("style",{children:Cr+yo}):null,(0,v.jsx)("div",{className:"graview-list",...dt?{...Le.listProps,ref:Le.list,tabIndex:-1,"data-graview-choosable":"","aria-label":Le.chosen.length>0?`${Ze}, ${Le.chosen.length} chosen`:Ze,role:"group"}:{},children:Ie.length===0&&_.words?(0,v.jsxs)("p",{style:se,"data-testid":"none-yet",children:["Nothing here is called \u201C",_.words,"\u201D."," ",(0,v.jsx)("span",{style:A,"data-testid":"list-searched",children:Mt(l.schema,{kinds:[e],past:Z})})," ",(0,v.jsx)(F,{to:"?",style:q,children:"Show every one"})]}):Ie.length===0?(0,v.jsxs)("p",{style:se,"data-testid":"none-yet",children:[E.filter?.length||E.query?"None of them.":"None yet",!E.filter?.length&&!E.query&&We.length>0?` \u2014 the first one starts above, with \u201C${We[0]?.mutation.title??We[0]?.mutation.name}\u201D.`:!E.filter?.length&&!E.query?".":"",E.filter?.length||E.query?(0,v.jsxs)(v.Fragment,{children:[" ",(0,v.jsx)(F,{to:"?",style:q,children:"Show every one"})]}):null]}):G.grouped&&Yt?(0,v.jsx)("div",{style:{display:"grid",gap:"1rem"},"data-testid":"records","data-grouped":Yt,children:Gn.map(s=>{if(!s.closed)return(0,v.jsxs)("section",{style:{display:"grid",gap:0},"data-testid":"list-group",children:[(0,v.jsxs)("h2",{className:"graview-group-head",children:[s.label," ",(0,v.jsx)("span",{children:s.nodes.length})]}),(0,v.jsx)("ul",{style:et,className:vt,"data-graview-rows":"",children:s.nodes.map(wt)})]},s.key||"-");let y=jn(s),O=`${m}-${ct(s.key||"none")}`;return(0,v.jsxs)("section",{style:{display:"grid",gap:0},"data-testid":"list-group","data-closed":y?"shut":"open",children:[(0,v.jsx)("h2",{className:"graview-group-head",children:(0,v.jsxs)("button",{type:"button",className:"graview-group-toggle","aria-expanded":!y,"aria-controls":O,"data-testid":"list-group-toggle",onClick:()=>Ci(Un(s.key)),children:[(0,v.jsx)("span",{"aria-hidden":"true",children:y?"\u25B8":"\u25BE"}),s.label," ",(0,v.jsxs)("span",{children:["\xB7 ",s.nodes.length]}),(0,v.jsxs)("span",{style:mo,children:[" ",s.nodes.length===1?He(u,e):Ze.toLowerCase()]})]})}),(0,v.jsx)("ul",{id:O,style:y?{...et,display:"none"}:et,className:vt,"data-graview-rows":"",hidden:y,children:y?null:s.nodes.map(wt)})]},s.key||"-")})}):Ge&&Ge.length>1?(0,v.jsxs)("div",{style:{display:"grid",gap:14},"data-testid":"records","data-sectioned":Ne?.type==="date"?"year":"letter",children:[(0,v.jsx)("nav",{"aria-label":"Jump to","data-testid":"list-index",style:{...A,display:"flex",flexWrap:"wrap",gap:Ne?.type==="date"?"0 10px":"0 4px",lineHeight:1.3},children:Ge.map(s=>(0,v.jsx)("a",{href:`#${ct(s.key)}`,onClick:y=>{y.preventDefault(),document.getElementById(ct(s.key))?.scrollIntoView({block:"start"})},style:{...ke,minWidth:24,justifyContent:"center"},children:s.key},s.key))}),Ge.map(s=>(0,v.jsxs)("section",{"data-testid":"list-section","aria-labelledby":ct(s.key),style:{display:"grid",gap:0},children:[(0,v.jsx)("h2",{id:ct(s.key),className:"graview-group-head",children:s.key}),(0,v.jsx)("ul",{style:et,className:vt,"data-graview-rows":"",children:s.nodes.map(wt)})]},s.key))]}):(0,v.jsx)("ul",{style:et,className:vt,"data-testid":"records","data-graview-rows":"",children:Ie.map(wt)})}),dt?(0,v.jsx)(Rr,{store:l,chosen:Le.chosen,...Je?{principal:Je}:{},...c?{context:c}:{},anchor:fo,of:on.length,onChooseAll:()=>Le.choose(on),onClear:Le.clear,onActed:$i}):null,zn>0?(0,v.jsxs)(F,{to:hi(p,"filter","is:any"),style:{...q,...A,justifySelf:"start"},"data-testid":"past-link",children:["+",zn," past"]}):null,k===!1&&l.graph.count(e,{archived:!0})>0?(0,v.jsxs)(F,{to:hi(p,"archived","true"),style:{...q,...A,justifySelf:"start"},"data-testid":"archived-link",children:["+",l.graph.count(e,{archived:!0})," archived"]}):null]}),(0,v.jsx)(Vt,{context:t,withheld:Li,style:re,testId:"withheld"})]})}var mo={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},fo=()=>document.querySelector("[data-graview-choosable]")?.closest("[data-embed-content]")??null,yo=`
|
|
110
110
|
.graview-list[data-graview-choosable]{outline:none}
|
|
111
111
|
.graview-list [data-graview-choose]{position:relative;padding-left:34px}
|
|
@@ -114,4 +114,4 @@ p:where([data-graview-part="refused"]) {
|
|
|
114
114
|
.graview-list:not([data-graview-choosing]) [data-graview-choose]{padding-left:0}
|
|
115
115
|
.graview-list:not([data-graview-choosing]) .graview-choose-at{display:none}
|
|
116
116
|
}
|
|
117
|
-
`;function ho({children:t}){return(0,v.jsx)("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:40,minWidth:0},children:t})}var wo=(t,e)=>e?{sort:{by:e,direction:"desc"}}:t?{sort:{by:"label",direction:"asc"}}:{};function vo(t,e,n){let a=At({...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")}:{}}),i=[...a.filter??[]],r=t.get("by"),o=a.group??(r?{by:r}:void 0);for(let d of n){let c=t.get(d);c&&i.push({key:d,value:c})}let l=t.get("with");return l&&i.push({key:l,value:"*"}),t.get("past")==="1"&&!i.some(d=>d.key==="is")&&i.push({key:"is",value:"any"}),vn({...a.sort?{sort:a.sort}:{},...a.query?{query:a.query}:{},...i.length>0?{filter:i}:{},...o?{group:o}:{},...a.archived!==void 0?{archived:a.archived}:{}},e)}function hi(t,e,n){let a=new URLSearchParams(t);return a.set(e,n),a.delete("past"),`?${a.toString()}`}function ko({name:t,title:e,panel:n,open:a,onOpen:i}){return(0,v.jsxs)("button",{type:"button","data-testid":`act-open-${t}`,"data-graview-act":t,"aria-expanded":a,"aria-controls":n,onClick:()=>{i(!a),a||requestAnimationFrame(()=>document.getElementById(n)?.querySelector("input, select, textarea, button")?.focus())},style:{...ke,minHeight:28,margin:"-4px 0",padding:"0 2px",border:0,background:"none",font:"inherit",fontWeight:600,color:"var(--graview-ink)",cursor:"pointer"},children:[(0,v.jsx)("span",{"aria-hidden":"true",style:{marginRight:6},children:a?"\u2212":"+"}),e]})}function bo({name:t,id:e,description:n,open:a,onClose:i,children:r}){return(0,v.jsxs)("div",{"data-testid":`act-${t}`,id:e,hidden:!a,onKeyDown:o=>{o.key==="Escape"&&(o.preventDefault(),i(),document.querySelector(`[aria-controls="${e}"]`)?.focus())},style:a?{display:"grid",gap:12,padding:"4px 0 12px"}:void 0,children:[n?(0,v.jsx)("p",{style:{...A,margin:0,maxWidth:"58ch"},children:n}):null,r]})}function So({to:t,label:e}){let n=(0,Me.useRef)(null);return Lr(n),(0,v.jsx)(F,{ref:n,to:t,"aria-label":e,style:{position:"absolute",inset:0,borderRadius:6}})}var Xe=H($e(),1);var yt=H($e(),1);var W=H(Y(),1);function Kn({context:t}){let{store:e,brand:n,invariantContext:a,principal:i}=t;ae(e);let r=e.violations(a),o=e.allInvariants(),l=Ct(e,r),d=Ia(e.schema,o);return(0,W.jsxs)(ie,{context:t,children:[(0,W.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,W.jsx)(le,{context:t,children:r.length===0?"All rules hold":"What is broken"}),(0,W.jsx)("p",{style:se,"data-testid":"problems-count",children:r.length===0?"Every declared rule is satisfied by what is here.":pa(r)})]}),(0,W.jsx)(mi,{context:t}),l.map((c,p)=>{let g=c.nodeIds[0],m=g?e.graph.getNode(g):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}:{}}),m?(0,W.jsxs)("p",{style:{margin:0,display:"inline-flex",alignItems:"center",gap:8},children:[(0,W.jsx)(ye,{kind:m.kind,brand:n,schema:e.schema,size:7}),(0,W.jsx)(F,{to:te(e.schema,m.kind,m.id),style:q,children:fe(e.schema.tryDefinition(m.kind),m)})]}):null,c.line?(0,W.jsx)(zt,{violation:c,schema:e.schema,...n?{brand:n}:{}}):null,(0,W.jsx)(_t,{store:e,repairs:c.repairs,...i?{principal:i}:{}})]},p)}),o.length>0?(0,W.jsxs)("section",{style:{...re,display:"grid",gap:12},"data-testid":"rules",children:[(0,W.jsx)("h2",{style:ne,children:"The rules"}),(0,W.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:o.map(c=>{let p=r.filter(u=>u.invariant===c.name).length,g=d.get(c.name),m=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:[g?(0,W.jsx)(Rt,{line:g,schema:e.schema,...n?{brand:n}:{},style:{flex:"1 1 18rem"}}):(0,W.jsx)("span",{style:{flex:"1 1 18rem",fontWeight:550},children:m}),(0,W.jsx)("span",{style:{...A,color:p>0?"var(--graview-warn)":"var(--graview-ink-faint)"},children:p===0?"holds":`broken in ${p} ${p===1?"place":"places"}`})]}),g&&m.trim().length>0?(0,W.jsx)("span",{style:A,children:m}):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=Da(t),i=Fa(t);return i?(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:i}),a?(0,W.jsx)("span",{style:A,children:a}):null,(0,W.jsxs)("details",{"data-testid":"problem-judged",style:A,children:[(0,W.jsx)("summary",{style:{cursor:"pointer",width:"fit-content",minHeight:24},children:"How it is judged"}),(0,W.jsx)(Rt,{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)(Rt,{line:t.line,schema:e,...n?{brand:n}:{},lead:"none",style:{color:"var(--graview-warn)"}}),a?(0,W.jsx)("span",{style:A,children:a}):null]})}function _t({store:t,repairs:e,principal:n}){let[a,i]=(0,yt.useState)(null),[r,o]=(0,yt.useState)(null),l=(0,yt.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,g)=>{let m=(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[g]=k},type:"button","data-graview-repair":p.mutation,"data-graview-asks":m||void 0,"aria-expanded":m?a===g:void 0,onClick:()=>{if(o(null),m){i(a===g?null:g);return}i(null);try{t.apply({name:p.mutation,args:{...p.args}},n?{author:n}:{})}catch(k){o(rt(t.schema,t.allMutations(),k))}},style:be,children:m?`${p.label} \u2026`:p.label},g):(0,W.jsxs)("p",{"data-testid":"withheld","data-withheld":u.refusal.wouldNeed.join(",")||"nobody",style:{...A,margin:0},children:[(0,W.jsx)("s",{children:p.label})," \u2014 ",u.refusal.message]},g)})}),c&&d?(0,W.jsx)(Oe,{store:t,mutation:c,prefilled:{...d.args},only:d.missing??[],label:d.label,onDone:()=>{let p=a;i(null),requestAnimationFrame(()=>{let g=p===null?null:l.current[p];if(g?.isConnected){g.focus();return}let m=document.querySelector("[data-graview-page-title]")??document.querySelector("main h1, main h2");m&&(m.hasAttribute("tabindex")||(m.tabIndex=-1),m.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:Sn},children:["\u201C",d.label,"\u201D names ",d.mutation,", which this app does not declare."]}):null,r?(0,W.jsx)("p",{"data-testid":"refused",role:"alert",style:{margin:0,color:"var(--graview-warn)",fontSize:Sn},children:r}):null]})}var qn=H($e(),1);var Be=H(Y(),1);function bi({store:t,link:e,principal:n}){let[a,i]=(0,qn.useState)(!1),[r,o]=(0,qn.useState)(null),l=ja(e);return(0,Be.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[(0,Be.jsx)("button",{type:"button","data-graview-provisional":"",title:l,"aria-label":`Unsure link: ${l}`,"aria-expanded":a,onClick:()=>i(!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,Be.jsxs)("span",{style:{...A,display:"inline-flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,Be.jsx)("span",{children:l}),(0,Be.jsx)("button",{type:"button",style:{...be,padding:"4px 10px"},onClick:()=>{try{t.apply({name:ua,args:{kind:e.edge.kind,from:e.edge.from,to:e.edge.to}},n?{author:n}:{}),i(!1)}catch(d){o(rt(t.schema,t.allMutations(),d))}},children:"Keep this link"}),r?(0,Be.jsx)("span",{role:"alert",children:r}):null]}):null]})}var h=H(Y(),1),xo=[];function Bn({context:t}){let{store:e,brand:n,principal:a,invariantContext:i}=t;ae(e);let r=ue()!==null,o=qe(),l=decodeURIComponent(o.id??""),d=Zr(e,l,{...a?{principal:a}:{},...i?{context:i}:{}}),c=Ct(e,d?.violations??xo),[p,g]=(0,Xe.useState)(null),[m,u]=(0,Xe.useState)(!1),[k,V]=(0,Xe.useState)(null),w=(0,Xe.useRef)(null),C=(0,Xe.useRef)(null),U=f=>{(w.current?.parentElement?.querySelector(`[data-affordance="${f.replace(/["\\]/g,"\\$&")}"]`)??w.current)?.focus()};if(!d)return(0,h.jsx)(ie,{context:t,children:(0,h.jsx)(le,{context:t,children:"Nothing lives at this address."})});let R=e.graph.getNode(l),j=e.schema.tryDefinition(d.kind),Q=j?.describe&&R?Wa(j,R):null,de=[...e.log.all()].filter(f=>!Pt(f)&&(f.writes.includes(l)||f.reads.includes(l))).slice(-8).reverse(),me=e.log.all().find(f=>!Pt(f)&&f.undoes===void 0&&f.primitives.some(N=>N.op==="add-node"&&N.node.id===l)),D=d.actions.affordances.filter(f=>f.provider!=="invariant"),X=D.filter(f=>f.destructive||f.setsAside),ce=m||X.length<2?D:D.filter(f=>!X.includes(f)),b=t.views?.lookup(d.kind,{cardinality:"one",fidelity:"full"}),x=b!==void 0&&!at(b)?b:void 0,L=x&&R?Ot(b,R,e.graph):void 0,M=L?d.fields.filter(f=>!L.fields.has(f.key)):d.fields,E=L?d.links.flatMap(f=>{let N=f.targets.filter(G=>!L.records.has(G.id));return N.length>0?[{...f,targets:N}]:[]}):d.links,_=x!==void 0&&Na(b),Z=r&&Ya(j).length>0;return(0,h.jsxs)(ie,{context:t,children:[(0,h.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,h.jsxs)("p",{style:{...we,display:"flex",alignItems:"center",gap:8},children:[(0,h.jsx)(ye,{kind:d.kind,brand:n,schema:e.schema,size:8}),(0,h.jsx)(F,{to:`/${J(e.schema,d.kind)}`,style:ke,children:ee(e,d.kind)})]}),(0,h.jsx)(le,{context:t,children:r&&R?.label===d.label?(0,h.jsx)(kn,{nodeId:l,field:"label",value:d.label,said:d.label}):d.label}),Q&&Q!==d.label?(0,h.jsx)("p",{style:se,children:Q}):null,me?.lineage?(0,h.jsxs)("p",{style:{...A,margin:0},"data-testid":"record-lineage",children:["Made by ",gt(me,a,{graph:e.graph,schema:e.schema,...t.seats?{seats:t.seats}:{},...t.people?{people:t.people}:{}}),", ",mn(me.lineage)]}):null,(0,h.jsx)(It,{context:t,stop:`#focus=${encodeURIComponent(l)}`,style:{...q,...A},"data-testid":"spatial-link"}),r&&R?(0,h.jsx)(yn,{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:{...be,...A,justifySelf:"start"}}):null,Re(t).some(f=>f.kind===d.kind||f.across===d.kind)?(0,h.jsxs)("p",{style:{...A,margin:0},"data-testid":"seen-in",children:["Seen in:"," ",Re(t).filter(f=>f.kind===d.kind||f.across===d.kind).map((f,N)=>(0,h.jsxs)("span",{children:[N>0?(0,h.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,(0,h.jsx)(F,{to:xe(t,f),style:q,children:f.title})," ",(0,h.jsx)(It,{context:t,stop:`#view=${encodeURIComponent(f.as)}`,style:{...q,...A,display:"inline-block",minWidth:24,textAlign:"center"},title:`${f.title}, in the scene`,label:`${f.title}, in the scene`,children:(0,h.jsx)("span",{"aria-hidden":"true",children:"\u2197"})})]},_e(f)))]}):null]}),R&&da(R)?(0,h.jsx)(Ao,{context:t,id:l,kind:d.kind}):null,R&&ga(e,l)?(0,h.jsx)(Po,{context:t,id:l,kind:d.kind}):null,x&&R?(0,h.jsx)("section",{"data-testid":"record-view",style:{display:"grid",minWidth:0},children:(0,h.jsx)(Tr,{children:(0,h.jsx)(x,{node:R,cardinality:"one",fidelity:"full",mode:"fullscreen",selected:!1,...d.violations.length>0?{flagged:[l]}:{}})})}):null,d.violations.length>0?(0,h.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((f,N)=>(0,h.jsxs)("div",{style:{display:"grid",gap:8},children:[(0,h.jsx)(zt,{violation:f,schema:e.schema,...n?{brand:n}:{}}),(0,h.jsx)(_t,{store:e,repairs:ei(d.actions,f.repairs),...a?{principal:a}:{}})]},N))}):null,!_&&(M.length>0||Z)?(0,h.jsxs)("section",{style:{...re,display:"grid",gap:14},"data-testid":"record-fields",children:[(0,h.jsx)("h2",{style:ne,children:"The facts"}),Ka(j,M).map((f,N)=>{let G=(0,h.jsx)("dl",{style:{margin:0,display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gap:"14px 24px"},children:f.fields.map(I=>I.files?(0,h.jsx)(Ve,{as:"field",read:!r,nodeId:l,field:I.key,label:I.label,files:I.files,labelStyle:we,style:{gap:4}},I.key):I.long?(0,h.jsx)(xr,{nodeId:l,field:I.key,label:I.label,value:I.value,markdown:I.markdown,style:{gridColumn:"1 / -1",gap:4},labelStyle:we,valueStyle:{lineHeight:1.6}},I.key):(0,h.jsxs)("div",{style:{display:"grid",gap:2,minWidth:0,alignContent:"start"},children:[(0,h.jsx)("dt",{style:we,children:I.label}),(0,h.jsx)("dd",{style:{margin:0,overflowWrap:"anywhere",minWidth:0},children:I.linked?(0,h.jsx)(Ja,{relation:I.linked.relation,refs:I.linked.refs,...r?{nodeId:l,field:I.key}:{}}):I.app?(0,h.jsx)(Et,{address:I.app,as:"record",...r?{nodeId:l,field:I.key}:{}}):I.href?(0,h.jsx)(Sr,{href:I.href,field:I.key,value:I.value,stored:I.stored,...r?{nodeId:l}:{}}):r?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(kn,{nodeId:l,field:I.key,value:I.value,stored:I.stored}),I.repeats?(0,h.jsx)(tr,{nodeId:l,field:I.key,start:R?.[I.key],value:R?.[`${I.key}Repeat`],label:`${I.label} repeats`}):null]}):I.value})]},I.key))});return f.title?(0,h.jsxs)("section",{style:{display:"grid",gap:10,minWidth:0},children:[(0,h.jsx)("h3",{"data-graview-field-group":f.title,style:{...ne,fontSize:"inherit"},children:f.title}),G]},N):(0,h.jsx)("div",{children:G},N)}),Z?(0,h.jsx)(Ve,{as:"unfilled",nodeId:l,skip:[...L?.fields??[]],labelStyle:we,style:{gap:4}}):null]}):null,(_?[]:E).map(f=>(0,h.jsxs)("section",{style:{...re,display:"grid",gap:10},children:[(0,h.jsx)("p",{style:we,children:Vr(e,f)}),f.description?(0,h.jsx)("h2",{style:ne,children:Ae(f.description)}):(0,h.jsxs)("h2",{style:ne,"aria-label":ve(f.edgeKind),children:[f.direction==="in"?"\u2190 ":"\u2192 ",ve(f.edgeKind)]}),(0,h.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"6px 18px"},children:f.targets.map(N=>{let G=za(e,f.direction==="in"?{kind:f.edgeKind,from:N.id,to:l}:{kind:f.edgeKind,from:l,to:N.id});return(0,h.jsxs)("li",{style:{display:"inline-flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,h.jsx)(ye,{kind:N.kind,brand:n,schema:e.schema,size:7}),(0,h.jsxs)(F,{to:te(e.schema,N.kind,N.id),style:q,children:[N.label,N.apart?(0,h.jsxs)("span",{style:A,children:[" \xB7 ",N.apart]}):null]}),G?.provisional?(0,h.jsx)(bi,{store:e,link:G,...a?{principal:a}:{}}):null]},N.id)})}),(f.direction==="out"&&e.schema.edge(f.edgeKind)?.cardinality==="one"?[]:[...new Set(f.targets.map(N=>N.kind))]).map(N=>(0,h.jsxs)(F,{to:`/${J(e.schema,N)}?${encodeURIComponent(f.edgeKind)}=${encodeURIComponent(l)}`,style:{...q,...A},"data-testid":"related-all",children:["Sort and filter ",f.description??`these ${ee(e,N).toLowerCase()}`,f.targets.some(G=>G.kind!==N)?` (${ee(e,N).toLowerCase()})`:""," ",(0,h.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]},N))]},`${f.edgeKind}|${f.direction}|${f.description??""}`)),!_&&(D.length>0||d.actions.withheld.length>0)?(0,h.jsxs)("section",{style:{...re,display:"grid",gap:14},"data-testid":"record-actions",children:[(0,h.jsx)("h2",{style:ne,ref:w,tabIndex:-1,children:"What can be done"}),(0,h.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:8},children:[ce.map(f=>{let N=p===f.id;return(0,h.jsx)("button",{type:"button","data-affordance":f.id,"data-rank":f.rank,"data-graview-act":f.mutation,autoFocus:m&&f===X[0],"aria-expanded":N,onClick:()=>{g(N?null:f.id),N||requestAnimationFrame(()=>C.current?.querySelector("input:not([type=hidden]), select, textarea, button")?.focus())},style:{...be,...N?{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"}:{}},children:f.label},f.id)}),ce.length<D.length?(0,h.jsxs)("button",{type:"button","aria-expanded":!1,onClick:()=>u(!0),style:{...be,...A},"data-testid":"record-actions-more",children:["Show ",D.length-ce.length," more"]}):null]}),D.map(f=>{if(p!==f.id)return null;let N=e.allMutations().find(G=>G.name===f.mutation);return N?(0,h.jsxs)("div",{ref:C,onKeyDown:G=>{if(G.key!=="Escape"||G.defaultPrevented)return;G.preventDefault(),g(null);let I=f.id;requestAnimationFrame(()=>U(I))},style:{display:"grid",gap:10,padding:18,border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,h.jsx)("h3",{style:ne,children:f.label}),N.description?(0,h.jsx)("p",{style:{...A,margin:0},children:N.description}):null,(0,h.jsx)(Oe,{store:e,mutation:N,prefilled:f.args,open:f.open,label:f.label,onDone:()=>{g(null),V(f.mutation);let G=f.id;requestAnimationFrame(()=>U(G))},...a?{principal:a}:{}})]},f.id):null}),r&&k!==null&&p===null?(0,h.jsx)(yn,{choices:[{on:"act",act:k,record:l},{on:"act",act:k}],label:"Notify me when someone else does this",testId:"notify-after-act",style:{...be,...A,justifySelf:"start"}}):null,(0,h.jsx)(Vt,{context:t,withheld:d.actions.withheld})]}):null,r?(0,h.jsx)(Gr,{id:l,style:re,headingStyle:ne}):null,de.length>0?(0,h.jsxs)("section",{style:{...re,display:"grid",gap:10},"data-testid":"record-history",children:[(0,h.jsx)("h2",{style:ne,children:"What has happened"}),(0,h.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:de.map(f=>(0,h.jsxs)("li",{style:A,children:[(0,h.jsx)("span",{style:{color:"var(--graview-ink)"},children:f.intent}),f.lineage?(0,h.jsxs)("span",{"data-graview-lineage":"",children:[" \xB7 ",mn(f.lineage)]}):null," \u2014 ",gt(f,a,{graph:e.graph,schema:e.schema,...t.seats?{seats:t.seats}:{},...t.people?{people:t.people}:{}})]},f.id))})]}):null]})}function Po({context:t,id:e,kind:n}){let{store:a,principal:i}=t,r={name:`allow-tidying-${n}`,args:{id:e}},o=a.allMutations().some(l=>l.name===r.name)&&a.permits(r,i).ok;return(0,h.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,h.jsxs)("p",{style:{margin:0,flex:"1 1 16rem"},children:[(0,h.jsx)("strong",{children:"Left alone."})," Nothing automated changes it; tidying passes it by."]}),o?(0,h.jsx)("button",{type:"button",style:be,"data-testid":"allow-tidying",onClick:()=>a.apply(r,i?{author:i}:{}),children:"Allow tidying again"}):null]})}function Ao({context:t,id:e,kind:n}){let{store:a,principal:i}=t,r={name:`unarchive-${n}`,args:{id:e}},o=a.allMutations().some(c=>c.name===r.name)&&a.permits(r,i).ok,l=[...a.log.all()].reverse().find(c=>!Pt(c)&&c.mergedInto!==void 0&&c.writes.includes(e)),d=l?.mergedInto!==void 0?a.graph.getNode(l.mergedInto):void 0;return(0,h.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,h.jsxs)("p",{style:{margin:0,flex:"1 1 16rem"},children:[(0,h.jsx)("strong",{children:"Archived."})," Kept with its ties and history, and out of lists, counts and rules.",d?(0,h.jsxs)(h.Fragment,{children:[" ","Merged into ",(0,h.jsx)(F,{to:te(a.schema,d.kind,d.id),style:q,children:fe(a.schema.tryDefinition(d.kind),d)}),"."]}):null]}),o?(0,h.jsx)("button",{type:"button",style:be,"data-testid":"bring-it-back",onClick:()=>a.apply(r,i?{author:i}:{}),children:"Bring it back"}):null]})}var P=H(Y(),1),Co=(0,z.lazy)(()=>(__graviewPreload(import.meta.url,["./chunk.7X2ZO5BD.js","./chunk.HUKAVTMX.js","./chunk.UGFDSE37.js","./chunk.FRS3S7DN.js","./chunk.MWJUZG3C.js","./chunk.T2L4NPSB.js","./chunk.VKH3ZPPQ.js","./chunk.3H4NVUWV.js","./chunk.SIH6RCAI.js","./chunk.RYEAMM73.js","./chunk.7HPPJVIV.js","./chunk.ETWVQ3A2.js","./chunk.CZRX2FDI.js","./chunk.5EAQDBBE.js","./chunk.YT2CYCVT.js","./chunk.XK4FVT2X.js","./chunk.WAB6ZS2V.js","./chunk.XXMYKBLT.js","./chunk.34CYK2DF.js","./chunk.JZBBGY4B.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.52QAIGCD.js","./chunk.PPUAPAWR.js","./chunk.IHFNLKXV.js","./chunk.577PGFUT.js","./chunk.FBY5IUGU.js","./chunk.4K5QCJFH.js","./chunk.GZHZLJBF.js","./chunk.WLBXBNNH.js","./chunk.7MTX33WD.js","./chunk.OJGHDWI6.js","./chunk.Z7ZCR4LN.js","./chunk.RIW7SQH4.js","./chunk.FSAHO3LV.js","./chunk.PNVR3CXR.js","./chunk.ZTD2CNC3.js","./chunk.X7W27IRI.js","./chunk.AJZBJBMO.js"]),import("./chunk.E7EQ2VTE.js")).then(t=>({default:t.DraftPage}))),Ro={kind:"human"};function Lo({list:t,store:e}){let n=new Set(t.members.map(o=>o.kind)),a=t.total-t.members.length,i=n.size===1?[...n][0]:void 0;if(!i)return(0,P.jsx)("p",{className:"graview-spec-text graview-spec-more",children:`and ${a} more`});let r=nt(e.schema,i).toLowerCase();return(0,P.jsx)("p",{className:"graview-spec-text graview-spec-more",children:(0,P.jsx)(F,{to:`/${J(e.schema,i)}`,className:"graview-spec-link graview-spec-see-all","data-testid":"see-all",children:t.total===e.graph.nodesOfKind(i).length?`See all ${pt(t.total)} ${r}`:`${pt(a)} more \xB7 all ${r}`})})}function To({context:t,children:e}){let n=Fe(),a=t.store.schema,i=(0,z.useMemo)(()=>({href:r=>te(a,r.kind,r.id),go:r=>n(te(a,r.kind,r.id)),more:r=>(0,P.jsx)(Lo,{list:r,store:t.store})}),[a,n,t.store]);return(0,P.jsx)($t.Provider,{value:i,children:(0,P.jsx)(Mr.Provider,{value:(t.titleLevel??(t.framed&&!t.barAbove?1:2))-1,children:e})})}function Mo({steering:t}){let e=Se(),n=Fe(),a=`${e.pathname}${e.search}`;return(0,z.useLayoutEffect)(()=>t.at(a),[a,t]),(0,z.useLayoutEffect)(()=>{let i=o=>{o!==a&&n(o)};t.go.current=i;let r=t.pending?.current;return r!==void 0&&(t.pending.current=void 0,i(r)),()=>{t.go.current===i&&(t.go.current=void 0)}},[a,n,t]),null}function No({context:t,to:e}){let{pathname:n}=Se(),a=ue(),i=(e??a)?.sayWhere,r=Eo(t,n);return(0,z.useEffect)(()=>(i?.(r),()=>i?.(null)),[i,r]),null}function Eo(t,e){let[n="",a,i]=e.split("/").filter(Boolean).map(o=>{try{return decodeURIComponent(o)}catch{return o}});if(i!==void 0)return"#";if(n==="places"&&a!==void 0){if(a===un)return"#overview=1";let o=t.views?.places().find(l=>l.as===a);return o?`#focus=${encodeURIComponent(Ee(o.kind))}&view=${encodeURIComponent(o.as)}`:"#"}let r=Te(t.store.schema,n);return r?`#focus=${encodeURIComponent(a??Ee(r))}`:"#"}function $o({onNavigate:t,path:e}){let n=Se(),a=Pn(),i=Fe(),r=n.hash&&!n.hash.includes("=")?n.hash:"",o=`${n.pathname}${n.search}${r}`,l=(0,z.useRef)(t);l.current=t;let d=(0,z.useRef)(null);(0,z.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,z.useRef)(e);return(0,z.useEffect)(()=>{e===void 0||e===c.current||(c.current=e,e!==o&&i(e))},[e]),null}function Si({context:t,registry:e,page:n}){let a=qe(),i=Te(t.store.schema,a.slug??""),r=n==="list"?Hn:Bn,l=(i?e?.lookup(i,n):void 0)??r;return(0,P.jsx)(l,{context:t})}function Oo({context:t,registry:e,children:n}){let a=(0,z.useRef)(null);return Ea(a),(0,P.jsx)("div",{ref:a,"data-graview-face":"pages",style:{display:"contents"},children:(0,P.jsx)(di,{context:t,registry:e,root:a,children:(0,P.jsx)(pi,{context:t,root:a,children:n})})})}function Io(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 Fo(){let{pathname:t}=Se(),e=Pn(),n=(0,z.useRef)(null);(0,z.useLayoutEffect)(()=>{if(e!=="POP"){for(let r=n.current?.parentElement;r;r=r.parentElement){let{overflowY:o}=getComputedStyle(r);if((o==="auto"||o==="scroll")&&r.scrollHeight>r.clientHeight){r.scrollTop=0;return}}window.scrollTo(0,0)}},[t]);let a=(0,z.useRef)(t),i=(0,z.useRef)(!1);return(0,z.useEffect)(()=>{if(!i.current&&t===a.current)return;i.current=!0;let r=document.activeElement;if(Io(r))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 xi({context:t,children:e}){let n=Fe(),a=(0,z.useMemo)(()=>({record:(i,r)=>{let o=t.store.graph.getNode(i);o&&n(ft(te(t.store.schema,o.kind,i),{section:r?.section}))},place:(i,r)=>{let o=t.views?.places().find(l=>l.as===i);o&&n(ft(xe(t,o),r))},list:(i,r)=>{t.store.schema.tryDefinition(i)&&n(ft(`/${J(t.store.schema,i)}`,r))},draft:()=>n("/~draft")}),[t,n]);return(0,P.jsx)(Ma.Provider,{value:a,children:e})}function Do(){let{pathname:t,search:e,hash:n}=Se();return(0,z.useEffect)(()=>{let a=decodeURIComponent(n.replace(/^#/,""));if(!(!a||a.includes("=")))return ii(a)},[t,e,n]),null}function Wo({context:t,Home:e}){let n=Se(),a=t.views,i=n.key==="default"&&!(a&&La(a));(0,z.useEffect)(()=>{a&&Ta(a)},[a]);let r=i?va(t.views?.arrangement?.()?.first,t.store.schema,t.views?.places()??[]):void 0,o=r?.to==="place"?xe(t,r.place):r?.to==="kind"?`/${J(t.store.schema,r.kind)}`:void 0;return o?(0,P.jsx)(An,{to:o,replace:!0}):(0,P.jsx)(e,{context:t})}function Pi({context:t,registry:e}){let n=e?.lookupSurface("shell"),a=n!==void 0,i=a&&(e?.without().has("bar")??!1),r=a&&!i&&!t.embedded?{...t,barAbove:!0}:t,o=k=>n===void 0?(0,P.jsx)(Ht,{context:t,children:k}):i?(0,P.jsx)(n,{context:t,children:k}):(0,P.jsx)(Ht,{context:t,children:(0,P.jsx)(n,{context:r,children:k})}),l=e?.lookupSurface("home")??Dn,d=e?.lookupSurface("problems")??Kn,c=a?{...r,framed:!0}:t,[p,g]=(0,z.useState)(null),m=(0,z.useMemo)(()=>({onFind:g,find:!(e?.without().has("find")??!1),places:!(e?.without().has("places")??!1)}),[e]),u=(0,P.jsx)(xi,{context:t,children:(0,P.jsx)(Oo,{context:t,registry:e,children:o((0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(_a,{face:"pages"}),(0,P.jsxs)(To,{context:c,children:[(0,P.jsx)(Fo,{}),(0,P.jsx)(Do,{}),(0,P.jsxs)(Yr,{children:[(e?.routes()??[]).map(({path:k,component:V})=>(0,P.jsx)(Ce,{path:k,element:(0,P.jsx)(V,{context:c})},k)),(0,P.jsx)(Ce,{path:"/",element:(0,P.jsx)(Wo,{context:c,Home:l})}),(0,P.jsx)(Ce,{path:"/problems",element:(0,P.jsx)(d,{context:c})}),(0,P.jsx)(Ce,{path:"/~draft",element:(0,P.jsx)(z.Suspense,{fallback:null,children:(0,P.jsx)(Co,{context:c})})}),(0,P.jsx)(Ce,{path:"/search",element:(0,P.jsx)(Wn,{context:c})}),(0,P.jsx)(Ce,{path:"/map",element:(0,P.jsx)(Fn,{context:c})}),(0,P.jsx)(Ce,{path:"/places",element:(0,P.jsx)(On,{context:c})}),Re(c).some(k=>k.as===un)?null:(0,P.jsx)(Ce,{path:wa,element:(0,P.jsx)(An,{to:"/",replace:!0})}),(0,P.jsx)(Ce,{path:"/places/:as",element:(0,P.jsx)(In,{context:c})}),(0,P.jsx)(Ce,{path:"/:slug",element:(0,P.jsx)(Si,{context:c,registry:e,page:"list"})}),(0,P.jsx)(Ce,{path:"/:slug/:id",element:(0,P.jsx)(Si,{context:c,registry:e,page:"record"})})]})]})]}))})});return t.embedded||!a||i?u:(0,P.jsx)(Jr.Provider,{value:m,children:(0,P.jsx)(ur.Provider,{value:p,children:u})})}var Ho=()=>typeof document>"u"?null:document.body;function Ko({context:t,registry:e,basename:n,initialPath:a,onNavigate:i,path:r,steering:o,firstLook:l}){let[d,c]=(0,z.useState)(void 0),p=d!==void 0&&d.from===t.principal?{...t,principal:d.seat}:t;(0,z.useState)(()=>p.views?Er(p.views,p.store.schema,wn(p.brand,p.store.schema)):void 0);let g=ue();ra({reader:p.locale??g?.locale,app:p.brand?.locale??p.app?.brand?.locale});let m=p.principal??Ro,u=Pa(p.store,m,p.history),V=(u.past&&u.live===p.store?u.past.store:p.store).seenBy(m),w=V===p.store?p:{...p,store:V};Aa(p.store,p.principal);let C=(0,P.jsxs)(P.Fragment,{children:[i||r!==void 0?(0,P.jsx)($o,{onNavigate:i,path:r}):null,o?(0,P.jsx)(Mo,{steering:o}):null,w.presence||g?(0,P.jsx)(No,{context:w,to:g}):null,(0,P.jsx)(Pi,{context:w,...e?{registry:e}:{}}),l?(0,P.jsx)($r,{firstLook:l,root:Ho,app:wn(p.brand,p.store.schema)}):null]}),U=w.views?(0,P.jsxs)(Ca,{store:w.store,views:w.views,...w.principal?{principal:w.principal}:{},...w.brand?{brand:w.brand}:{},...w.locale?{locale:w.locale}:{},...w.settings?{settings:w.settings}:{},...w.presence&&!g?{presence:w.presence}:{},...w.people?{people:w.people}:{},...w.seats?{seats:w.seats}:{},onSeat:Q=>g?g.takeSeat(Q):c({from:t.principal,seat:Q}),...w.onKeepLens?{onKeepLens:w.onKeepLens}:{},...w.ai?{ai:w.ai}:{},...w.subscriptions?{subscriptions:w.subscriptions}:{},...w.signIn?{signIn:w.signIn}:{},resolveApp:w.resolveApp??g?.resolveApp,linkedRecords:w.linkedRecords??g?.linkedRecords,...w.app?{app:w.app}:{},...w.menuSections?{menuSections:w.menuSections}:{},children:[C,(0,P.jsx)(xi,{context:w,children:(0,P.jsx)(oi,{context:w})})]}):C,R=(0,P.jsx)(xa.Provider,{value:u,children:U}),j=w.files?(0,P.jsx)(Sa.Provider,{value:w.files,children:R}):R;if(a!==void 0){let Q=n===void 0?a:`${n.replace(/\/$/,"")}${a}`;return(0,P.jsx)(_r,{initialEntries:[Q],...n===void 0?{}:{basename:n},children:j})}return(0,P.jsx)(Qr,{...n===void 0?{}:{basename:n},children:j})}export{Gi as a,Ko as b};
|
|
117
|
+
`;function ho({children:t}){return(0,v.jsx)("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:40,minWidth:0},children:t})}var wo=(t,e)=>e?{sort:{by:e,direction:"desc"}}:t?{sort:{by:"label",direction:"asc"}}:{};function vo(t,e,n){let a=At({...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")}:{}}),i=[...a.filter??[]],r=t.get("by"),o=a.group??(r?{by:r}:void 0);for(let d of n){let c=t.get(d);c&&i.push({key:d,value:c})}let l=t.get("with");return l&&i.push({key:l,value:"*"}),t.get("past")==="1"&&!i.some(d=>d.key==="is")&&i.push({key:"is",value:"any"}),vn({...a.sort?{sort:a.sort}:{},...a.query?{query:a.query}:{},...i.length>0?{filter:i}:{},...o?{group:o}:{},...a.archived!==void 0?{archived:a.archived}:{}},e)}function hi(t,e,n){let a=new URLSearchParams(t);return a.set(e,n),a.delete("past"),`?${a.toString()}`}function ko({name:t,title:e,panel:n,open:a,onOpen:i}){return(0,v.jsxs)("button",{type:"button","data-testid":`act-open-${t}`,"data-graview-act":t,"aria-expanded":a,"aria-controls":n,onClick:()=>{i(!a),a||requestAnimationFrame(()=>document.getElementById(n)?.querySelector("input, select, textarea, button")?.focus())},style:{...ke,minHeight:28,margin:"-4px 0",padding:"0 2px",border:0,background:"none",font:"inherit",fontWeight:600,color:"var(--graview-ink)",cursor:"pointer"},children:[(0,v.jsx)("span",{"aria-hidden":"true",style:{marginRight:6},children:a?"\u2212":"+"}),e]})}function bo({name:t,id:e,description:n,open:a,onClose:i,children:r}){return(0,v.jsxs)("div",{"data-testid":`act-${t}`,id:e,hidden:!a,onKeyDown:o=>{o.key==="Escape"&&(o.preventDefault(),i(),document.querySelector(`[aria-controls="${e}"]`)?.focus())},style:a?{display:"grid",gap:12,padding:"4px 0 12px"}:void 0,children:[n?(0,v.jsx)("p",{style:{...A,margin:0,maxWidth:"58ch"},children:n}):null,r]})}function So({to:t,label:e}){let n=(0,Me.useRef)(null);return Lr(n),(0,v.jsx)(F,{ref:n,to:t,"aria-label":e,style:{position:"absolute",inset:0,borderRadius:6}})}var Xe=H($e(),1);var yt=H($e(),1);var W=H(Y(),1);function Kn({context:t}){let{store:e,brand:n,invariantContext:a,principal:i}=t;ae(e);let r=e.violations(a),o=e.allInvariants(),l=Ct(e,r),d=Ia(e.schema,o);return(0,W.jsxs)(ie,{context:t,children:[(0,W.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,W.jsx)(le,{context:t,children:r.length===0?"All rules hold":"What is broken"}),(0,W.jsx)("p",{style:se,"data-testid":"problems-count",children:r.length===0?"Every declared rule is satisfied by what is here.":pa(r)})]}),(0,W.jsx)(mi,{context:t}),l.map((c,p)=>{let g=c.nodeIds[0],m=g?e.graph.getNode(g):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}:{}}),m?(0,W.jsxs)("p",{style:{margin:0,display:"inline-flex",alignItems:"center",gap:8},children:[(0,W.jsx)(ye,{kind:m.kind,brand:n,schema:e.schema,size:7}),(0,W.jsx)(F,{to:te(e.schema,m.kind,m.id),style:q,children:fe(e.schema.tryDefinition(m.kind),m)})]}):null,c.line?(0,W.jsx)(zt,{violation:c,schema:e.schema,...n?{brand:n}:{}}):null,(0,W.jsx)(_t,{store:e,repairs:c.repairs,...i?{principal:i}:{}})]},p)}),o.length>0?(0,W.jsxs)("section",{style:{...re,display:"grid",gap:12},"data-testid":"rules",children:[(0,W.jsx)("h2",{style:ne,children:"The rules"}),(0,W.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:o.map(c=>{let p=r.filter(u=>u.invariant===c.name).length,g=d.get(c.name),m=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:[g?(0,W.jsx)(Rt,{line:g,schema:e.schema,...n?{brand:n}:{},style:{flex:"1 1 18rem"}}):(0,W.jsx)("span",{style:{flex:"1 1 18rem",fontWeight:550},children:m}),(0,W.jsx)("span",{style:{...A,color:p>0?"var(--graview-warn)":"var(--graview-ink-faint)"},children:p===0?"holds":`broken in ${p} ${p===1?"place":"places"}`})]}),g&&m.trim().length>0?(0,W.jsx)("span",{style:A,children:m}):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=Da(t),i=Fa(t);return i?(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:i}),a?(0,W.jsx)("span",{style:A,children:a}):null,(0,W.jsxs)("details",{"data-testid":"problem-judged",style:A,children:[(0,W.jsx)("summary",{style:{cursor:"pointer",width:"fit-content",minHeight:24},children:"How it is judged"}),(0,W.jsx)(Rt,{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)(Rt,{line:t.line,schema:e,...n?{brand:n}:{},lead:"none",style:{color:"var(--graview-warn)"}}),a?(0,W.jsx)("span",{style:A,children:a}):null]})}function _t({store:t,repairs:e,principal:n}){let[a,i]=(0,yt.useState)(null),[r,o]=(0,yt.useState)(null),l=(0,yt.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,g)=>{let m=(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[g]=k},type:"button","data-graview-repair":p.mutation,"data-graview-asks":m||void 0,"aria-expanded":m?a===g:void 0,onClick:()=>{if(o(null),m){i(a===g?null:g);return}i(null);try{t.apply({name:p.mutation,args:{...p.args}},n?{author:n}:{})}catch(k){o(rt(t.schema,t.allMutations(),k))}},style:be,children:m?`${p.label} \u2026`:p.label},g):(0,W.jsxs)("p",{"data-testid":"withheld","data-withheld":u.refusal.wouldNeed.join(",")||"nobody",style:{...A,margin:0},children:[(0,W.jsx)("s",{children:p.label})," \u2014 ",u.refusal.message]},g)})}),c&&d?(0,W.jsx)(Oe,{store:t,mutation:c,prefilled:{...d.args},only:d.missing??[],label:d.label,onDone:()=>{let p=a;i(null),requestAnimationFrame(()=>{let g=p===null?null:l.current[p];if(g?.isConnected){g.focus();return}let m=document.querySelector("[data-graview-page-title]")??document.querySelector("main h1, main h2");m&&(m.hasAttribute("tabindex")||(m.tabIndex=-1),m.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:Sn},children:["\u201C",d.label,"\u201D names ",d.mutation,", which this app does not declare."]}):null,r?(0,W.jsx)("p",{"data-testid":"refused",role:"alert",style:{margin:0,color:"var(--graview-warn)",fontSize:Sn},children:r}):null]})}var qn=H($e(),1);var Be=H(Y(),1);function bi({store:t,link:e,principal:n}){let[a,i]=(0,qn.useState)(!1),[r,o]=(0,qn.useState)(null),l=ja(e);return(0,Be.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[(0,Be.jsx)("button",{type:"button","data-graview-provisional":"",title:l,"aria-label":`Unsure link: ${l}`,"aria-expanded":a,onClick:()=>i(!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,Be.jsxs)("span",{style:{...A,display:"inline-flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,Be.jsx)("span",{children:l}),(0,Be.jsx)("button",{type:"button",style:{...be,padding:"4px 10px"},onClick:()=>{try{t.apply({name:ua,args:{kind:e.edge.kind,from:e.edge.from,to:e.edge.to}},n?{author:n}:{}),i(!1)}catch(d){o(rt(t.schema,t.allMutations(),d))}},children:"Keep this link"}),r?(0,Be.jsx)("span",{role:"alert",children:r}):null]}):null]})}var h=H(Y(),1),xo=[];function Bn({context:t}){let{store:e,brand:n,principal:a,invariantContext:i}=t;ae(e);let r=ue()!==null,o=qe(),l=decodeURIComponent(o.id??""),d=Zr(e,l,{...a?{principal:a}:{},...i?{context:i}:{}}),c=Ct(e,d?.violations??xo),[p,g]=(0,Xe.useState)(null),[m,u]=(0,Xe.useState)(!1),[k,V]=(0,Xe.useState)(null),w=(0,Xe.useRef)(null),C=(0,Xe.useRef)(null),U=f=>{(w.current?.parentElement?.querySelector(`[data-affordance="${f.replace(/["\\]/g,"\\$&")}"]`)??w.current)?.focus()};if(!d)return(0,h.jsx)(ie,{context:t,children:(0,h.jsx)(le,{context:t,children:"Nothing lives at this address."})});let R=e.graph.getNode(l),j=e.schema.tryDefinition(d.kind),Q=j?.describe&&R?Wa(j,R):null,de=[...e.log.all()].filter(f=>!Pt(f)&&(f.writes.includes(l)||f.reads.includes(l))).slice(-8).reverse(),me=e.log.all().find(f=>!Pt(f)&&f.undoes===void 0&&f.primitives.some(N=>N.op==="add-node"&&N.node.id===l)),D=d.actions.affordances.filter(f=>f.provider!=="invariant"),X=D.filter(f=>f.destructive||f.setsAside),ce=m||X.length<2?D:D.filter(f=>!X.includes(f)),b=t.views?.lookup(d.kind,{cardinality:"one",fidelity:"full"}),x=b!==void 0&&!at(b)?b:void 0,L=x&&R?Ot(b,R,e.graph):void 0,M=L?d.fields.filter(f=>!L.fields.has(f.key)):d.fields,E=L?d.links.flatMap(f=>{let N=f.targets.filter(G=>!L.records.has(G.id));return N.length>0?[{...f,targets:N}]:[]}):d.links,_=x!==void 0&&Na(b),Z=r&&Ya(j).length>0;return(0,h.jsxs)(ie,{context:t,children:[(0,h.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,h.jsxs)("p",{style:{...we,display:"flex",alignItems:"center",gap:8},children:[(0,h.jsx)(ye,{kind:d.kind,brand:n,schema:e.schema,size:8}),(0,h.jsx)(F,{to:`/${J(e.schema,d.kind)}`,style:ke,children:ee(e,d.kind)})]}),(0,h.jsx)(le,{context:t,children:r&&R?.label===d.label?(0,h.jsx)(kn,{nodeId:l,field:"label",value:d.label,said:d.label}):d.label}),Q&&Q!==d.label?(0,h.jsx)("p",{style:se,children:Q}):null,me?.lineage?(0,h.jsxs)("p",{style:{...A,margin:0},"data-testid":"record-lineage",children:["Made by ",gt(me,a,{graph:e.graph,schema:e.schema,...t.seats?{seats:t.seats}:{},...t.people?{people:t.people}:{}}),", ",mn(me.lineage)]}):null,(0,h.jsx)(It,{context:t,stop:`#focus=${encodeURIComponent(l)}`,style:{...q,...A},"data-testid":"spatial-link"}),r&&R?(0,h.jsx)(yn,{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:{...be,...A,justifySelf:"start"}}):null,Re(t).some(f=>f.kind===d.kind||f.across===d.kind)?(0,h.jsxs)("p",{style:{...A,margin:0},"data-testid":"seen-in",children:["Seen in:"," ",Re(t).filter(f=>f.kind===d.kind||f.across===d.kind).map((f,N)=>(0,h.jsxs)("span",{children:[N>0?(0,h.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,(0,h.jsx)(F,{to:xe(t,f),style:q,children:f.title})," ",(0,h.jsx)(It,{context:t,stop:`#view=${encodeURIComponent(f.as)}`,style:{...q,...A,display:"inline-block",minWidth:24,textAlign:"center"},title:`${f.title}, in the scene`,label:`${f.title}, in the scene`,children:(0,h.jsx)("span",{"aria-hidden":"true",children:"\u2197"})})]},_e(f)))]}):null]}),R&&da(R)?(0,h.jsx)(Ao,{context:t,id:l,kind:d.kind}):null,R&&ga(e,l)?(0,h.jsx)(Po,{context:t,id:l,kind:d.kind}):null,x&&R?(0,h.jsx)("section",{"data-testid":"record-view",style:{display:"grid",minWidth:0},children:(0,h.jsx)(Tr,{children:(0,h.jsx)(x,{node:R,cardinality:"one",fidelity:"full",mode:"fullscreen",selected:!1,...d.violations.length>0?{flagged:[l]}:{}})})}):null,d.violations.length>0?(0,h.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((f,N)=>(0,h.jsxs)("div",{style:{display:"grid",gap:8},children:[(0,h.jsx)(zt,{violation:f,schema:e.schema,...n?{brand:n}:{}}),(0,h.jsx)(_t,{store:e,repairs:ei(d.actions,f.repairs),...a?{principal:a}:{}})]},N))}):null,!_&&(M.length>0||Z)?(0,h.jsxs)("section",{style:{...re,display:"grid",gap:14},"data-testid":"record-fields",children:[(0,h.jsx)("h2",{style:ne,children:"The facts"}),Ka(j,M).map((f,N)=>{let G=(0,h.jsx)("dl",{style:{margin:0,display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gap:"14px 24px"},children:f.fields.map(I=>I.files?(0,h.jsx)(Ve,{as:"field",read:!r,nodeId:l,field:I.key,label:I.label,files:I.files,labelStyle:we,style:{gap:4}},I.key):I.long?(0,h.jsx)(xr,{nodeId:l,field:I.key,label:I.label,value:I.value,markdown:I.markdown,style:{gridColumn:"1 / -1",gap:4},labelStyle:we,valueStyle:{lineHeight:1.6}},I.key):(0,h.jsxs)("div",{style:{display:"grid",gap:2,minWidth:0,alignContent:"start"},children:[(0,h.jsx)("dt",{style:we,children:I.label}),(0,h.jsx)("dd",{style:{margin:0,overflowWrap:"anywhere",minWidth:0},children:I.linked?(0,h.jsx)(Ja,{relation:I.linked.relation,refs:I.linked.refs,...r?{nodeId:l,field:I.key}:{}}):I.app?(0,h.jsx)(Et,{address:I.app,as:"record",...r?{nodeId:l,field:I.key}:{}}):I.href?(0,h.jsx)(Sr,{href:I.href,field:I.key,value:I.value,stored:I.stored,...r?{nodeId:l}:{}}):r?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(kn,{nodeId:l,field:I.key,value:I.value,stored:I.stored}),I.repeats?(0,h.jsx)(tr,{nodeId:l,field:I.key,start:R?.[I.key],value:R?.[`${I.key}Repeat`],label:`${I.label} repeats`}):null]}):I.value})]},I.key))});return f.title?(0,h.jsxs)("section",{style:{display:"grid",gap:10,minWidth:0},children:[(0,h.jsx)("h3",{"data-graview-field-group":f.title,style:{...ne,fontSize:"inherit"},children:f.title}),G]},N):(0,h.jsx)("div",{children:G},N)}),Z?(0,h.jsx)(Ve,{as:"unfilled",nodeId:l,skip:[...L?.fields??[]],labelStyle:we,style:{gap:4}}):null]}):null,(_?[]:E).map(f=>(0,h.jsxs)("section",{style:{...re,display:"grid",gap:10},children:[(0,h.jsx)("p",{style:we,children:Vr(e,f)}),f.description?(0,h.jsx)("h2",{style:ne,children:Ae(f.description)}):(0,h.jsxs)("h2",{style:ne,"aria-label":ve(f.edgeKind),children:[f.direction==="in"?"\u2190 ":"\u2192 ",ve(f.edgeKind)]}),(0,h.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"6px 18px"},children:f.targets.map(N=>{let G=za(e,f.direction==="in"?{kind:f.edgeKind,from:N.id,to:l}:{kind:f.edgeKind,from:l,to:N.id});return(0,h.jsxs)("li",{style:{display:"inline-flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,h.jsx)(ye,{kind:N.kind,brand:n,schema:e.schema,size:7}),(0,h.jsxs)(F,{to:te(e.schema,N.kind,N.id),style:q,children:[N.label,N.apart?(0,h.jsxs)("span",{style:A,children:[" \xB7 ",N.apart]}):null]}),G?.provisional?(0,h.jsx)(bi,{store:e,link:G,...a?{principal:a}:{}}):null]},N.id)})}),(f.direction==="out"&&e.schema.edge(f.edgeKind)?.cardinality==="one"?[]:[...new Set(f.targets.map(N=>N.kind))]).map(N=>(0,h.jsxs)(F,{to:`/${J(e.schema,N)}?${encodeURIComponent(f.edgeKind)}=${encodeURIComponent(l)}`,style:{...q,...A},"data-testid":"related-all",children:["Sort and filter ",f.description??`these ${ee(e,N).toLowerCase()}`,f.targets.some(G=>G.kind!==N)?` (${ee(e,N).toLowerCase()})`:""," ",(0,h.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]},N))]},`${f.edgeKind}|${f.direction}|${f.description??""}`)),!_&&(D.length>0||d.actions.withheld.length>0)?(0,h.jsxs)("section",{style:{...re,display:"grid",gap:14},"data-testid":"record-actions",children:[(0,h.jsx)("h2",{style:ne,ref:w,tabIndex:-1,children:"What can be done"}),(0,h.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:8},children:[ce.map(f=>{let N=p===f.id;return(0,h.jsx)("button",{type:"button","data-affordance":f.id,"data-rank":f.rank,"data-graview-act":f.mutation,autoFocus:m&&f===X[0],"aria-expanded":N,onClick:()=>{g(N?null:f.id),N||requestAnimationFrame(()=>C.current?.querySelector("input:not([type=hidden]), select, textarea, button")?.focus())},style:{...be,...N?{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"}:{}},children:f.label},f.id)}),ce.length<D.length?(0,h.jsxs)("button",{type:"button","aria-expanded":!1,onClick:()=>u(!0),style:{...be,...A},"data-testid":"record-actions-more",children:["Show ",D.length-ce.length," more"]}):null]}),D.map(f=>{if(p!==f.id)return null;let N=e.allMutations().find(G=>G.name===f.mutation);return N?(0,h.jsxs)("div",{ref:C,onKeyDown:G=>{if(G.key!=="Escape"||G.defaultPrevented)return;G.preventDefault(),g(null);let I=f.id;requestAnimationFrame(()=>U(I))},style:{display:"grid",gap:10,padding:18,border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,h.jsx)("h3",{style:ne,children:f.label}),N.description?(0,h.jsx)("p",{style:{...A,margin:0},children:N.description}):null,(0,h.jsx)(Oe,{store:e,mutation:N,prefilled:f.args,open:f.open,label:f.label,onDone:()=>{g(null),V(f.mutation);let G=f.id;requestAnimationFrame(()=>U(G))},...a?{principal:a}:{}})]},f.id):null}),r&&k!==null&&p===null?(0,h.jsx)(yn,{choices:[{on:"act",act:k,record:l},{on:"act",act:k}],label:"Notify me when someone else does this",testId:"notify-after-act",style:{...be,...A,justifySelf:"start"}}):null,(0,h.jsx)(Vt,{context:t,withheld:d.actions.withheld})]}):null,r?(0,h.jsx)(Gr,{id:l,style:re,headingStyle:ne}):null,de.length>0?(0,h.jsxs)("section",{style:{...re,display:"grid",gap:10},"data-testid":"record-history",children:[(0,h.jsx)("h2",{style:ne,children:"What has happened"}),(0,h.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:de.map(f=>(0,h.jsxs)("li",{style:A,children:[(0,h.jsx)("span",{style:{color:"var(--graview-ink)"},children:f.intent}),f.lineage?(0,h.jsxs)("span",{"data-graview-lineage":"",children:[" \xB7 ",mn(f.lineage)]}):null," \u2014 ",gt(f,a,{graph:e.graph,schema:e.schema,...t.seats?{seats:t.seats}:{},...t.people?{people:t.people}:{}})]},f.id))})]}):null]})}function Po({context:t,id:e,kind:n}){let{store:a,principal:i}=t,r={name:`allow-tidying-${n}`,args:{id:e}},o=a.allMutations().some(l=>l.name===r.name)&&a.permits(r,i).ok;return(0,h.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,h.jsxs)("p",{style:{margin:0,flex:"1 1 16rem"},children:[(0,h.jsx)("strong",{children:"Left alone."})," Nothing automated changes it; tidying passes it by."]}),o?(0,h.jsx)("button",{type:"button",style:be,"data-testid":"allow-tidying",onClick:()=>a.apply(r,i?{author:i}:{}),children:"Allow tidying again"}):null]})}function Ao({context:t,id:e,kind:n}){let{store:a,principal:i}=t,r={name:`unarchive-${n}`,args:{id:e}},o=a.allMutations().some(c=>c.name===r.name)&&a.permits(r,i).ok,l=[...a.log.all()].reverse().find(c=>!Pt(c)&&c.mergedInto!==void 0&&c.writes.includes(e)),d=l?.mergedInto!==void 0?a.graph.getNode(l.mergedInto):void 0;return(0,h.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,h.jsxs)("p",{style:{margin:0,flex:"1 1 16rem"},children:[(0,h.jsx)("strong",{children:"Archived."})," Kept with its ties and history, and out of lists, counts and rules.",d?(0,h.jsxs)(h.Fragment,{children:[" ","Merged into ",(0,h.jsx)(F,{to:te(a.schema,d.kind,d.id),style:q,children:fe(a.schema.tryDefinition(d.kind),d)}),"."]}):null]}),o?(0,h.jsx)("button",{type:"button",style:be,"data-testid":"bring-it-back",onClick:()=>a.apply(r,i?{author:i}:{}),children:"Bring it back"}):null]})}var P=H(Y(),1),Co=(0,z.lazy)(()=>(__graviewPreload(import.meta.url,["./chunk.OZ5KJLA2.js","./chunk.5MCC54VM.js","./chunk.UGFDSE37.js","./chunk.3QXHII5W.js","./chunk.AINNENYD.js","./chunk.SBBNIYVB.js","./chunk.IX6RNGAT.js","./chunk.3H4NVUWV.js","./chunk.XSYBNUXF.js","./chunk.GCVO6N26.js","./chunk.LRRVBM4F.js","./chunk.H243UV3Z.js","./chunk.PKKA6JWA.js","./chunk.5EAQDBBE.js","./chunk.YT2CYCVT.js","./chunk.KWCML3BF.js","./chunk.DLT3EE4D.js","./chunk.2OBIO5Y6.js","./chunk.GF7LA4QG.js","./chunk.AEHPDVLQ.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.52QAIGCD.js","./chunk.PPUAPAWR.js","./chunk.IHFNLKXV.js","./chunk.577PGFUT.js","./chunk.FBY5IUGU.js","./chunk.4K5QCJFH.js","./chunk.GZHZLJBF.js","./chunk.QRMWFEEH.js","./chunk.MVN6H65Q.js","./chunk.OJGHDWI6.js","./chunk.Z7ZCR4LN.js","./chunk.RIW7SQH4.js","./chunk.FSAHO3LV.js","./chunk.Y5Z4ZDTO.js","./chunk.UWIYKGYK.js","./chunk.X7W27IRI.js","./chunk.AJZBJBMO.js"]),import("./chunk.FHXXYWL3.js")).then(t=>({default:t.DraftPage}))),Ro={kind:"human"};function Lo({list:t,store:e}){let n=new Set(t.members.map(o=>o.kind)),a=t.total-t.members.length,i=n.size===1?[...n][0]:void 0;if(!i)return(0,P.jsx)("p",{className:"graview-spec-text graview-spec-more",children:`and ${a} more`});let r=nt(e.schema,i).toLowerCase();return(0,P.jsx)("p",{className:"graview-spec-text graview-spec-more",children:(0,P.jsx)(F,{to:`/${J(e.schema,i)}`,className:"graview-spec-link graview-spec-see-all","data-testid":"see-all",children:t.total===e.graph.nodesOfKind(i).length?`See all ${pt(t.total)} ${r}`:`${pt(a)} more \xB7 all ${r}`})})}function To({context:t,children:e}){let n=Fe(),a=t.store.schema,i=(0,z.useMemo)(()=>({href:r=>te(a,r.kind,r.id),go:r=>n(te(a,r.kind,r.id)),more:r=>(0,P.jsx)(Lo,{list:r,store:t.store})}),[a,n,t.store]);return(0,P.jsx)($t.Provider,{value:i,children:(0,P.jsx)(Mr.Provider,{value:(t.titleLevel??(t.framed&&!t.barAbove?1:2))-1,children:e})})}function Mo({steering:t}){let e=Se(),n=Fe(),a=`${e.pathname}${e.search}`;return(0,z.useLayoutEffect)(()=>t.at(a),[a,t]),(0,z.useLayoutEffect)(()=>{let i=o=>{o!==a&&n(o)};t.go.current=i;let r=t.pending?.current;return r!==void 0&&(t.pending.current=void 0,i(r)),()=>{t.go.current===i&&(t.go.current=void 0)}},[a,n,t]),null}function No({context:t,to:e}){let{pathname:n}=Se(),a=ue(),i=(e??a)?.sayWhere,r=Eo(t,n);return(0,z.useEffect)(()=>(i?.(r),()=>i?.(null)),[i,r]),null}function Eo(t,e){let[n="",a,i]=e.split("/").filter(Boolean).map(o=>{try{return decodeURIComponent(o)}catch{return o}});if(i!==void 0)return"#";if(n==="places"&&a!==void 0){if(a===un)return"#overview=1";let o=t.views?.places().find(l=>l.as===a);return o?`#focus=${encodeURIComponent(Ee(o.kind))}&view=${encodeURIComponent(o.as)}`:"#"}let r=Te(t.store.schema,n);return r?`#focus=${encodeURIComponent(a??Ee(r))}`:"#"}function $o({onNavigate:t,path:e}){let n=Se(),a=Pn(),i=Fe(),r=n.hash&&!n.hash.includes("=")?n.hash:"",o=`${n.pathname}${n.search}${r}`,l=(0,z.useRef)(t);l.current=t;let d=(0,z.useRef)(null);(0,z.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,z.useRef)(e);return(0,z.useEffect)(()=>{e===void 0||e===c.current||(c.current=e,e!==o&&i(e))},[e]),null}function Si({context:t,registry:e,page:n}){let a=qe(),i=Te(t.store.schema,a.slug??""),r=n==="list"?Hn:Bn,l=(i?e?.lookup(i,n):void 0)??r;return(0,P.jsx)(l,{context:t})}function Oo({context:t,registry:e,children:n}){let a=(0,z.useRef)(null);return Ea(a),(0,P.jsx)("div",{ref:a,"data-graview-face":"pages",style:{display:"contents"},children:(0,P.jsx)(di,{context:t,registry:e,root:a,children:(0,P.jsx)(pi,{context:t,root:a,children:n})})})}function Io(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 Fo(){let{pathname:t}=Se(),e=Pn(),n=(0,z.useRef)(null);(0,z.useLayoutEffect)(()=>{if(e!=="POP"){for(let r=n.current?.parentElement;r;r=r.parentElement){let{overflowY:o}=getComputedStyle(r);if((o==="auto"||o==="scroll")&&r.scrollHeight>r.clientHeight){r.scrollTop=0;return}}window.scrollTo(0,0)}},[t]);let a=(0,z.useRef)(t),i=(0,z.useRef)(!1);return(0,z.useEffect)(()=>{if(!i.current&&t===a.current)return;i.current=!0;let r=document.activeElement;if(Io(r))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 xi({context:t,children:e}){let n=Fe(),a=(0,z.useMemo)(()=>({record:(i,r)=>{let o=t.store.graph.getNode(i);o&&n(ft(te(t.store.schema,o.kind,i),{section:r?.section}))},place:(i,r)=>{let o=t.views?.places().find(l=>l.as===i);o&&n(ft(xe(t,o),r))},list:(i,r)=>{t.store.schema.tryDefinition(i)&&n(ft(`/${J(t.store.schema,i)}`,r))},draft:()=>n("/~draft")}),[t,n]);return(0,P.jsx)(Ma.Provider,{value:a,children:e})}function Do(){let{pathname:t,search:e,hash:n}=Se();return(0,z.useEffect)(()=>{let a=decodeURIComponent(n.replace(/^#/,""));if(!(!a||a.includes("=")))return ii(a)},[t,e,n]),null}function Wo({context:t,Home:e}){let n=Se(),a=t.views,i=n.key==="default"&&!(a&&La(a));(0,z.useEffect)(()=>{a&&Ta(a)},[a]);let r=i?va(t.views?.arrangement?.()?.first,t.store.schema,t.views?.places()??[]):void 0,o=r?.to==="place"?xe(t,r.place):r?.to==="kind"?`/${J(t.store.schema,r.kind)}`:void 0;return o?(0,P.jsx)(An,{to:o,replace:!0}):(0,P.jsx)(e,{context:t})}function Pi({context:t,registry:e}){let n=e?.lookupSurface("shell"),a=n!==void 0,i=a&&(e?.without().has("bar")??!1),r=a&&!i&&!t.embedded?{...t,barAbove:!0}:t,o=k=>n===void 0?(0,P.jsx)(Ht,{context:t,children:k}):i?(0,P.jsx)(n,{context:t,children:k}):(0,P.jsx)(Ht,{context:t,children:(0,P.jsx)(n,{context:r,children:k})}),l=e?.lookupSurface("home")??Dn,d=e?.lookupSurface("problems")??Kn,c=a?{...r,framed:!0}:t,[p,g]=(0,z.useState)(null),m=(0,z.useMemo)(()=>({onFind:g,find:!(e?.without().has("find")??!1),places:!(e?.without().has("places")??!1)}),[e]),u=(0,P.jsx)(xi,{context:t,children:(0,P.jsx)(Oo,{context:t,registry:e,children:o((0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(_a,{face:"pages"}),(0,P.jsxs)(To,{context:c,children:[(0,P.jsx)(Fo,{}),(0,P.jsx)(Do,{}),(0,P.jsxs)(Yr,{children:[(e?.routes()??[]).map(({path:k,component:V})=>(0,P.jsx)(Ce,{path:k,element:(0,P.jsx)(V,{context:c})},k)),(0,P.jsx)(Ce,{path:"/",element:(0,P.jsx)(Wo,{context:c,Home:l})}),(0,P.jsx)(Ce,{path:"/problems",element:(0,P.jsx)(d,{context:c})}),(0,P.jsx)(Ce,{path:"/~draft",element:(0,P.jsx)(z.Suspense,{fallback:null,children:(0,P.jsx)(Co,{context:c})})}),(0,P.jsx)(Ce,{path:"/search",element:(0,P.jsx)(Wn,{context:c})}),(0,P.jsx)(Ce,{path:"/map",element:(0,P.jsx)(Fn,{context:c})}),(0,P.jsx)(Ce,{path:"/places",element:(0,P.jsx)(On,{context:c})}),Re(c).some(k=>k.as===un)?null:(0,P.jsx)(Ce,{path:wa,element:(0,P.jsx)(An,{to:"/",replace:!0})}),(0,P.jsx)(Ce,{path:"/places/:as",element:(0,P.jsx)(In,{context:c})}),(0,P.jsx)(Ce,{path:"/:slug",element:(0,P.jsx)(Si,{context:c,registry:e,page:"list"})}),(0,P.jsx)(Ce,{path:"/:slug/:id",element:(0,P.jsx)(Si,{context:c,registry:e,page:"record"})})]})]})]}))})});return t.embedded||!a||i?u:(0,P.jsx)(Jr.Provider,{value:m,children:(0,P.jsx)(ur.Provider,{value:p,children:u})})}var Ho=()=>typeof document>"u"?null:document.body;function Ko({context:t,registry:e,basename:n,initialPath:a,onNavigate:i,path:r,steering:o,firstLook:l}){let[d,c]=(0,z.useState)(void 0),p=d!==void 0&&d.from===t.principal?{...t,principal:d.seat}:t;(0,z.useState)(()=>p.views?Er(p.views,p.store.schema,wn(p.brand,p.store.schema)):void 0);let g=ue();ra({reader:p.locale??g?.locale,app:p.brand?.locale??p.app?.brand?.locale});let m=p.principal??Ro,u=Pa(p.store,m,p.history),V=(u.past&&u.live===p.store?u.past.store:p.store).seenBy(m),w=V===p.store?p:{...p,store:V};Aa(p.store,p.principal);let C=(0,P.jsxs)(P.Fragment,{children:[i||r!==void 0?(0,P.jsx)($o,{onNavigate:i,path:r}):null,o?(0,P.jsx)(Mo,{steering:o}):null,w.presence||g?(0,P.jsx)(No,{context:w,to:g}):null,(0,P.jsx)(Pi,{context:w,...e?{registry:e}:{}}),l?(0,P.jsx)($r,{firstLook:l,root:Ho,app:wn(p.brand,p.store.schema)}):null]}),U=w.views?(0,P.jsxs)(Ca,{store:w.store,views:w.views,...w.principal?{principal:w.principal}:{},...w.brand?{brand:w.brand}:{},...w.locale?{locale:w.locale}:{},...w.settings?{settings:w.settings}:{},...w.presence&&!g?{presence:w.presence}:{},...w.people?{people:w.people}:{},...w.seats?{seats:w.seats}:{},onSeat:Q=>g?g.takeSeat(Q):c({from:t.principal,seat:Q}),...w.onKeepLens?{onKeepLens:w.onKeepLens}:{},...w.ai?{ai:w.ai}:{},...w.subscriptions?{subscriptions:w.subscriptions}:{},...w.signIn?{signIn:w.signIn}:{},resolveApp:w.resolveApp??g?.resolveApp,linkedRecords:w.linkedRecords??g?.linkedRecords,...w.app?{app:w.app}:{},...w.menuSections?{menuSections:w.menuSections}:{},children:[C,(0,P.jsx)(xi,{context:w,children:(0,P.jsx)(oi,{context:w})})]}):C,R=(0,P.jsx)(xa.Provider,{value:u,children:U}),j=w.files?(0,P.jsx)(Sa.Provider,{value:w.files,children:R}):R;if(a!==void 0){let Q=n===void 0?a:`${n.replace(/\/$/,"")}${a}`;return(0,P.jsx)(_r,{initialEntries:[Q],...n===void 0?{}:{basename:n},children:j})}return(0,P.jsx)(Qr,{...n===void 0?{}:{basename:n},children:j})}export{Gi as a,Ko as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as I,c as x}from"./chunk.
|
|
1
|
+
import{a as I,c as x}from"./chunk.ZZTDQKM2.js";import"./chunk.Y5Z4ZDTO.js";import{c as b,d as A,k as v,r as w,t as O,w as G}from"./chunk.UWIYKGYK.js";import{Bc as k,Qc as E,Wc as S,Xc as W}from"./chunk.X7W27IRI.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 +1 @@
|
|
|
1
|
-
import{e as L}from"./chunk.
|
|
1
|
+
import{e as L}from"./chunk.5MCC54VM.js";import{a as R,b as O,c as v,d as P}from"./chunk.UGFDSE37.js";import"./chunk.3QXHII5W.js";import"./chunk.AINNENYD.js";import"./chunk.SBBNIYVB.js";import"./chunk.IX6RNGAT.js";import"./chunk.3H4NVUWV.js";import"./chunk.XSYBNUXF.js";import"./chunk.GCVO6N26.js";import"./chunk.LRRVBM4F.js";import"./chunk.H243UV3Z.js";import"./chunk.PKKA6JWA.js";import"./chunk.5EAQDBBE.js";import"./chunk.YT2CYCVT.js";import"./chunk.KWCML3BF.js";import"./chunk.DLT3EE4D.js";import"./chunk.2OBIO5Y6.js";import"./chunk.GF7LA4QG.js";import"./chunk.AEHPDVLQ.js";import{a as E,b as T}from"./chunk.MB7LKKUD.js";import"./chunk.WVUJXDXZ.js";import"./chunk.52QAIGCD.js";import"./chunk.PPUAPAWR.js";import"./chunk.IHFNLKXV.js";import"./chunk.577PGFUT.js";import"./chunk.FBY5IUGU.js";import"./chunk.4K5QCJFH.js";import"./chunk.GZHZLJBF.js";import"./chunk.QRMWFEEH.js";import"./chunk.MVN6H65Q.js";import"./chunk.OJGHDWI6.js";import"./chunk.Z7ZCR4LN.js";import"./chunk.RIW7SQH4.js";import"./chunk.FSAHO3LV.js";import"./chunk.Y5Z4ZDTO.js";import{F as D,Q as C,ta as x}from"./chunk.UWIYKGYK.js";import{fc as k}from"./chunk.X7W27IRI.js";import{b as S}from"./chunk.AJZBJBMO.js";var o=S(D(),1);var i=S(C(),1);function W(c){let e=document.activeElement;if(e!==null&&e!==document.body&&e!==document.documentElement&&e.isConnected)return;let r=c??document,a=r.querySelector("main")??r.querySelector("[data-graview-page]")??null,n=r.querySelector("[data-graview-page-title]")??a?.querySelector("h1, h2")??a;n instanceof HTMLElement&&(n.hasAttribute("tabindex")||n.setAttribute("tabindex","-1"),n.focus({preventScroll:!0}))}var H=1500;function z(c,e,r){let{store:a,principal:n}=c,u=L(a),l=(0,o.useMemo)(()=>R(a,n),[a,n,u]),b=(0,o.useRef)(r),[p,m]=(0,o.useState)(),[s,f]=(0,o.useState)("");(0,o.useEffect)(()=>{let t=O(a,n,b.current);b.current=a.batches().length,t&&(m({batch:t.batch,at:e,when:Date.now()}),f(""))},[a,n,u]),(0,o.useEffect)(()=>{m(t=>!t||t.at===e?t:Date.now()-t.when<H?{...t,at:e}:void 0)},[e]);let[g,h]=(0,o.useState)(null),y=(0,o.useCallback)(()=>{m(void 0),h(null)},[]),w=(0,o.useCallback)(()=>{h(null);try{let t=P(a,n);t&&f(`Took back \u201C${t.intent}\u201D`)}catch(t){h(t instanceof Error?t.message:String(t))}},[a,n]),d=l&&p?.batch===l.batch&&p.at===e?l:void 0;return{change:l,offered:d,close:y,takeBack:w,refused:g,said:s}}function Y({context:c,docked:e,at:r,since:a}){let{change:n,offered:u,close:l,takeBack:b,refused:p,said:m}=z(c,r,a),s=e?u:n,f=(0,o.useRef)(null),g=e&&(s!==void 0||p!==null);B(f,g),(0,o.useEffect)(()=>{if(!g)return;let d,t=()=>d=setTimeout(()=>f.current?.matches(":hover, :focus-within")?t():l(),1e4);return t(),()=>clearTimeout(d)},[g,s?.batch,p,l]);let h=m||(e&&s?v(s):""),y=e?{position:"fixed",inset:"auto",margin:0,padding:0,border:"none",background:"none",overflow:"visible",zIndex:k("toast"),width:"max-content",height:"auto",bottom:"calc(16px + env(safe-area-inset-bottom, 0px))",left:16,justifyItems:"start",color:"var(--graview-ink)",...g?{}:{display:"none"}}:{},w=s?(0,i.jsxs)("button",{type:"button","data-testid":"page-undo",title:`${v(s)} \u2014 \u2318Z or Ctrl+Z`,"aria-keyshortcuts":"Meta+Z Control+Z",onClick:d=>{let t=d.currentTarget.closest("[data-graview-face]");b(),requestAnimationFrame(()=>W(t))},style:e?I:A,children:[(0,i.jsx)("span",{"aria-hidden":"true",children:"\u21B6"}),(0,i.jsx)("span",{style:e?j:F,children:v(s)})]}):null;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{role:"status","aria-live":"polite",style:N,children:h}),(0,i.jsxs)("div",{ref:f,...e?{popover:"manual","data-graview-foot":"","data-graview-offstage":""}:{},"data-testid":e?"face-undo-dock":"page-undo-place",style:{display:"grid",justifyItems:"end",gap:4,maxWidth:"100%",minWidth:0,...y},children:[e&&s?(0,i.jsxs)("div",{"data-testid":"page-undo-notice",style:_,children:[w,(0,i.jsx)("button",{type:"button","data-testid":"page-undo-dismiss","aria-label":`Dismiss: ${v(s)}`,title:"Dismiss",onClick:d=>{let t=d.currentTarget.closest("[data-graview-face]");l(),requestAnimationFrame(()=>W(t))},style:q,children:"\xD7"})]}):w,p?(0,i.jsx)("span",{"data-testid":"page-undo-refused",role:"alert",style:{fontSize:"0.8125rem",lineHeight:1.4,color:"var(--graview-warn)",background:e?"var(--graview-float)":void 0,padding:e?"4px 8px":void 0,borderRadius:6},children:p}):null]})]})}function B(c,e){(0,o.useLayoutEffect)(()=>{let r=c.current;if(!r||!e)return;if(typeof r.showPopover=="function"&&!x(r))try{r.showPopover()}catch{}let a=()=>r.parentElement?.closest("[data-embed-content]")??null,n=()=>{T(r,a()),dispatchEvent(new Event(E))};n(),addEventListener("resize",n),addEventListener("scroll",n,!0);let u=typeof ResizeObserver=="function"?new ResizeObserver(n):null;return u?.observe(r),()=>{if(u?.disconnect(),removeEventListener("resize",n),removeEventListener("scroll",n,!0),r.isConnected&&x(r))try{r.hidePopover()}catch{}dispatchEvent(new Event(E))}},[c,e])}var A={display:"inline-flex",alignItems:"center",gap:6,minHeight:36,maxWidth:"100%",minWidth:0,padding:"0 14px",borderRadius:999,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",color:"var(--graview-ink)",font:"inherit",fontSize:"0.875rem",cursor:"pointer"},I={...A,textAlign:"start",lineHeight:1.4,padding:"8px 4px 8px 14px",border:"none",background:"none",color:"inherit"},_={display:"flex",alignItems:"center",gap:2,maxWidth:"100%",minWidth:0,paddingRight:6,borderRadius:"var(--graview-radius, 12px)",border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},q={flex:"0 0 auto",minWidth:28,minHeight:28,padding:0,border:"none",background:"none",boxShadow:"none",color:"var(--graview-ink-muted)",font:"inherit",fontSize:"1rem",cursor:"pointer"},F={minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},j={minWidth:0,overflow:"hidden",overflowWrap:"anywhere",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:4},N={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};export{Y as TakeBack};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{n as v}from"./chunk.
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{n as v}from"./chunk.Y5Z4ZDTO.js";import{F as P,I as w,Q as p,Y as R,a as A,xa as b}from"./chunk.UWIYKGYK.js";import{Rc as h}from"./chunk.X7W27IRI.js";import{b as a}from"./chunk.AJZBJBMO.js";var L=a(p(),1),B=v.part(e=>(0,L.jsx)(e.ActivityRail,{calls:[]}),{quiet:!0});var l=a(P(),1),S=a(p(),1),C=b(A(()=>(__graviewPreload(import.meta.url,["./chunk.RTB4MMF6.js","./chunk.6J7DR7XQ.js","./chunk.VWHMYPLL.js","./chunk.DLT3EE4D.js","./chunk.3C4RJIJU.js","./chunk.DPP7ITTU.js","./chunk.GF7LA4QG.js","./chunk.AEHPDVLQ.js","./chunk.UT6642FC.js","./chunk.TI4OSTQV.js","./chunk.GZHZLJBF.js","./chunk.QRMWFEEH.js","./chunk.MVN6H65Q.js","./chunk.OJGHDWI6.js","./chunk.Z7ZCR4LN.js","./chunk.RIW7SQH4.js","./chunk.FSAHO3LV.js","./chunk.Y5Z4ZDTO.js","./chunk.UWIYKGYK.js","./chunk.X7W27IRI.js","./chunk.AJZBJBMO.js"]),import("./chunk.TIBZZ2WY.js")))),F=C.part((e,r)=>{let t=e.RecordInteractions;return(0,S.jsx)(t,{...r})},{quiet:!0});function I(e,r,t){let o=e.target;return(o.on==="record"||o.on==="field"?o.id===r:o.on==="selection"?o.ids.includes(r):o.on==="act"?o.id===r:!1)||e.offered.some(n=>n.id===`record:${r}`||n.id.startsWith(`fill:${r}:`))||(e.batches??[]).some(n=>t(n).includes(r))}function T({id:e,style:r,headingStyle:t,className:o}){let{ai:d,aiDesk:n,store:f}=R(),{entries:y}=w(n),s=d.off===!0;(0,l.useEffect)(()=>{s||n.load()},[n,s]);let g=f.log.length,m=(0,l.useMemo)(()=>{let x=u=>f.log.all().flatMap(k=>k.batch===u?k.writes:[]);return y.filter(u=>I(u,e,x))},[y,e,f,g]);return s||m.length===0?null:(0,S.jsx)(l.Suspense,{fallback:null,children:(0,S.jsx)(F,{entries:m,...r?{style:r}:{},...t?{headingStyle:t}:{},...o?{className:o}:{}})})}var c=a(P(),1),i=a(p(),1);function ro({context:e,stop:r,title:t,label:o,style:d,className:n,children:f,...y}){let s=h(e.views?.arrangement?.()),g=f??(0,i.jsxs)(i.Fragment,{children:["In ",s==="Scene"?"the scene":s.replace(/^The /,"the ")," ",(0,i.jsx)("span",{"aria-hidden":"true",children:"\u2197"})]}),m=o?{"aria-label":o}:{};if(e.overview){let x=e.overview;return(0,i.jsx)("a",{href:r,...y,...m,...t?{title:t}:{},style:d,...n?{className:n}:{},onClick:u=>{u.preventDefault(),x(r)},children:g})}return e.embedded?null:(0,i.jsx)("a",{href:`${e.sceneHref??"/"}${r}`,...y,...m,...t?{title:t}:{},style:d,...n?{className:n}:{},children:g})}function oo(){return(0,i.jsx)("a",{href:"#fresh","data-testid":"start-fresh",title:"Forget every edit made in this browser and return to the example",onClick:e=>{e.preventDefault();let r=new URL(window.location.href);r.searchParams.set("fresh","1"),window.location.assign(r.toString())},style:{color:"inherit",display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24},children:"Start fresh"})}function to(e){let r=(0,c.useRef)(0),t=(0,c.useCallback)(o=>e.subscribe(()=>{r.current+=1,o()}),[e]);return(0,c.useSyncExternalStore)(t,()=>r.current,()=>0)}export{B as a,T as b,ro as c,oo as d,to as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{l as k,n as M,o as I,p as B,s as P}from"./chunk.Z7ZCR4LN.js";import"./chunk.RIW7SQH4.js";import"./chunk.FSAHO3LV.js";import"./chunk.
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{l as k,n as M,o as I,p as B,s as P}from"./chunk.Z7ZCR4LN.js";import"./chunk.RIW7SQH4.js";import"./chunk.FSAHO3LV.js";import"./chunk.Y5Z4ZDTO.js";import{F as te,Q as W,a as L,xa as q}from"./chunk.UWIYKGYK.js";import"./chunk.X7W27IRI.js";import{b as h}from"./chunk.AJZBJBMO.js";var r=h(te(),1);var A=h(W(),1),U=q(L(()=>(__graviewPreload(import.meta.url,["./chunk.Y5Z4ZDTO.js","./chunk.UWIYKGYK.js","./chunk.X7W27IRI.js","./chunk.AJZBJBMO.js"]),import("./chunk.A3F7MFDR.js")))),v={Part:U.part((n,t)=>(0,A.jsx)(n.WhenMonth,{...t}),{quiet:!0}),prefetch:()=>U.prefetch()};var o=h(W(),1),z="try \u201Ctomorrow 3pm\u201D, \u201CFri 10:30\u201D or \u201C17 Oct\u201D";function K(n,t,d,p=!1){let S=Date.UTC(+n.day.slice(0,4),+n.day.slice(5,7)-1,+n.day.slice(8,10),0,t?n.minutes??0:0),g={weekday:p?"long":"short",year:"numeric",month:p?"long":"short",day:"numeric",...t?{hour:"numeric",minute:"2-digit"}:{},timeZone:"UTC"},m;try{m=new Intl.DateTimeFormat(d??"en-US",g)}catch{m=new Intl.DateTimeFormat("en-US",g)}return m.format(S).replace(/ /g," ")}function ce({value:n,time:t,instant:d=!1,label:p,name:S,required:g,autoFocus:m,autoSelect:H,locale:s,onChange:j,onLeave:_,onCancel:V,inputRef:w,boxStyle:Z}){let x=(0,r.useId)(),u=(0,r.useRef)(null),D=(0,r.useRef)(null),b=e=>{let a=M(e);return a?K(a,t,s):e??""},[T,C]=(0,r.useState)(()=>b(n)),[F,y]=(0,r.useState)(!1),[G,E]=(0,r.useState)(n),[J,Q]=(0,r.useState)(n);n!==J&&(Q(n),n!==G&&(E(n),C(b(n)))),(0,r.useEffect)(()=>{H&&(u.current?.focus(),u.current?.select())},[H]);let i=t&&d?B(s):void 0,N=T===b(n),l=M(n),c=N?l:P(T,{today:k().day,time:t,...l?{base:l}:{},...s?{locale:s}:{}}),X=N?n:c?I(c,{time:t,instant:d}):void 0,$=T.trim()==="",f=!$&&c===void 0;(0,r.useEffect)(()=>{u.current?.setCustomValidity(f?`Not a date this reads \u2014 ${z}`:"")},[f]);let O=e=>{E(e),j(e)},Y=e=>{C(e);let a=e.trim()===""?void 0:P(e,{today:k().day,time:t,...l?{base:l}:{},...s?{locale:s}:{}});O(a?I(a,{time:t,instant:d}):void 0)},ee=e=>{let a=t?{day:e,minutes:c?.minutes??l?.minutes??540}:{day:e},R=I(a,{time:t,instant:d});C(b(R)),O(R),y(!1),requestAnimationFrame(()=>{u.current?.focus(),u.current?.select()})},ne=$?`Type a date, or pick one \u2014 ${z}`:f?`Not a date this reads \u2014 ${z}`:c?`${K(c,t,s,!0)}${i?` ${i.short}`:""}`:"";return(0,o.jsxs)("span",{"data-graview-when":t?d?"instant":"moment":"day",style:{display:"inline-flex",flex:"1 1 14rem",flexWrap:"wrap",alignItems:"center",gap:"4px 6px",maxWidth:"100%",minWidth:0},onBlur:e=>{let a=e.relatedTarget;a&&e.currentTarget.contains(a)||!a&&typeof document<"u"&&!document.hasFocus()||(y(!1),_?.(X))},children:[(0,o.jsx)("input",{ref:e=>{u.current=e,typeof w=="function"?w(e):w&&(w.current=e)},type:"text",name:S,required:g,autoFocus:m,"aria-label":p,"aria-describedby":`${x}-said`,"aria-invalid":f||void 0,autoComplete:"off",spellCheck:!1,enterKeyHint:"done",placeholder:t?"tomorrow 3pm":"17 Oct",value:T,"data-graview-part":"control",onChange:e=>Y(e.target.value),onKeyDown:e=>{e.key==="Escape"?(e.preventDefault(),V?.()):e.key==="ArrowDown"&&e.altKey&&(e.preventDefault(),y(!0))},style:{flex:"1 1 12ch",minWidth:"10ch",maxWidth:"100%",boxSizing:"border-box",font:"inherit",...Z}}),(0,o.jsx)("button",{ref:D,type:"button","aria-label":`Pick a date for ${p}`,"aria-expanded":F,"aria-controls":`${x}-month`,"data-graview-part":"when-pick",onClick:()=>y(e=>!e),onPointerEnter:()=>v.prefetch(),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:32,minHeight:32,padding:0,borderRadius:6},children:(0,o.jsxs)("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.4",children:[(0,o.jsx)("rect",{x:"2",y:"3",width:"12",height:"11",rx:"1.5"}),(0,o.jsx)("path",{d:"M2 6.5h12M5.5 1.5v3M10.5 1.5v3"})]})}),(0,o.jsxs)("span",{id:`${x}-said`,"aria-live":"polite","data-graview-part":"when-said",...i?{"data-graview-zone":i.zone,title:`Times are in ${i.zone.replace(/_/g," ")} (${i.short})`}:{},style:{flexBasis:"100%",fontSize:"0.75rem",color:f?"var(--graview-bad)":"var(--graview-ink-faint)"},children:[ne,i&&!f&&!$?(0,o.jsx)("span",{"data-graview-part":"when-zone",children:` \xB7 ${(i.zone.split("/").at(-1)??i.zone).replace(/_/g," ")} time`}):null]}),F?(0,o.jsx)(r.Suspense,{fallback:null,children:(0,o.jsx)(v.Part,{id:`${x}-month`,label:p,selected:c?.day??l?.day,today:k().day,locale:s,onPick:ee,onClose:()=>{y(!1),D.current?.focus()}})}):null]})}export{ce as WhenInput,K as wallAsRead};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as n}from"./chunk.
|
|
1
|
+
import{a as n}from"./chunk.4NZBMZC7.js";import"./chunk.OZ5KJLA2.js";import"./chunk.5MCC54VM.js";import"./chunk.UGFDSE37.js";import{j as s}from"./chunk.3QXHII5W.js";import"./chunk.AINNENYD.js";import"./chunk.SBBNIYVB.js";import"./chunk.IX6RNGAT.js";import"./chunk.3H4NVUWV.js";import"./chunk.XSYBNUXF.js";import"./chunk.GCVO6N26.js";import"./chunk.LRRVBM4F.js";import"./chunk.H243UV3Z.js";import"./chunk.PKKA6JWA.js";import"./chunk.5EAQDBBE.js";import"./chunk.YT2CYCVT.js";import"./chunk.QVKKXMNK.js";import"./chunk.ZE4CTZQ3.js";import"./chunk.KWCML3BF.js";import"./chunk.DLT3EE4D.js";import"./chunk.2OBIO5Y6.js";import"./chunk.GF7LA4QG.js";import"./chunk.AEHPDVLQ.js";import"./chunk.UT6642FC.js";import"./chunk.MB7LKKUD.js";import"./chunk.WVUJXDXZ.js";import"./chunk.52QAIGCD.js";import"./chunk.PPUAPAWR.js";import"./chunk.IHFNLKXV.js";import"./chunk.577PGFUT.js";import"./chunk.FBY5IUGU.js";import"./chunk.4K5QCJFH.js";import"./chunk.GZHZLJBF.js";import"./chunk.QRMWFEEH.js";import"./chunk.MVN6H65Q.js";import"./chunk.OJGHDWI6.js";import"./chunk.Z7ZCR4LN.js";import"./chunk.RIW7SQH4.js";import"./chunk.FSAHO3LV.js";import"./chunk.Y5Z4ZDTO.js";import{F as y,Q as i}from"./chunk.UWIYKGYK.js";import"./chunk.X7W27IRI.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 +1 @@
|
|
|
1
|
-
import{F as g,O as m,Y as d,ea as v}from"./chunk.
|
|
1
|
+
import{F as g,O as m,Y as d,ea as v}from"./chunk.UWIYKGYK.js";import{b as S}from"./chunk.AJZBJBMO.js";var w=S(g(),1);function f(){let{store:A,principal:a,ai:i,aiDesk:r,seatTalk:t,views:p,app:l,brand:s,view:k,selection:c}=d(),e=m(A,a),y=v(),o=k.within?.view;return(0,w.useMemo)(()=>({store:e,principal:a,ai:i,desk:r,seatTalk:t,goTo:y,places:p.places().map(n=>({as:n.as,title:n.title,kind:n.kind})),app:l??{name:s?.name??"app",schema:e.schema,...e.policy?{policy:e.policy}:{}},...o?{place:o}:{},selection:c}),[e,a,i,r,t,y,p,l,s,o,c])}export{f as a};
|