graview 0.1.34 → 0.1.36
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.3C4RJIJU.js → chunk.272ZJXQP.js} +1 -1
- package/dist/preview/{chunk.ETWVQ3A2.js → chunk.27TLAVRR.js} +1 -1
- package/dist/preview/{chunk.34CYK2DF.js → chunk.2A2DLMT3.js} +1 -1
- package/dist/preview/{chunk.FBY5IUGU.js → chunk.2B4WVCVV.js} +1 -1
- package/dist/preview/{chunk.ZE4CTZQ3.js → chunk.3PT55HXT.js} +1 -1
- package/dist/preview/{chunk.YJCT3DV2.js → chunk.3SM2CHKF.js} +1 -1
- package/dist/preview/{chunk.G64AREGA.js → chunk.3ZIOAPI5.js} +1 -1
- package/dist/preview/{chunk.HCDKSDIS.js → chunk.42WJ6VJZ.js} +1 -1
- package/dist/preview/{chunk.RIW7SQH4.js → chunk.4B73P2WA.js} +1 -1
- package/dist/preview/{chunk.CPW465TM.js → chunk.4GXXD4NG.js} +1 -1
- package/dist/preview/chunk.4Q56V7GS.js +1 -0
- package/dist/preview/{chunk.T2L4NPSB.js → chunk.4STIUIT6.js} +1 -1
- package/dist/preview/chunk.53IKY7UP.js +1 -0
- package/dist/preview/chunk.56BPXB6E.js +1 -0
- package/dist/preview/{chunk.7HPPJVIV.js → chunk.5PU3RWYY.js} +2 -2
- package/dist/preview/chunk.64MJ5FRL.js +1 -0
- package/dist/preview/chunk.6II4BONS.js +25 -0
- package/dist/preview/{chunk.VMGWYCXU.js → chunk.6KMXLUOS.js} +1 -1
- package/dist/preview/{chunk.MWJUZG3C.js → chunk.6QDFBCV4.js} +2 -2
- package/dist/preview/{chunk.IHFNLKXV.js → chunk.6W7J76TK.js} +1 -1
- package/dist/preview/{chunk.ZTFW7RKP.js → chunk.6ZZZBDEG.js} +1 -1
- package/dist/preview/{chunk.VOFUIWAX.js → chunk.7CO7S6QM.js} +1 -1
- package/dist/preview/chunk.7G3B5QPH.js +1 -0
- package/dist/preview/chunk.7TBSVQSH.js +1 -0
- package/dist/preview/{chunk.QVKKXMNK.js → chunk.7YQYWOZR.js} +1 -1
- package/dist/preview/{chunk.4K5QCJFH.js → chunk.AAZFVCSP.js} +1 -1
- package/dist/preview/{chunk.ZSW74NVJ.js → chunk.ACEYGWMO.js} +1 -1
- package/dist/preview/{chunk.HJ56Q6WB.js → chunk.ACXA55GW.js} +1 -1
- package/dist/preview/{chunk.PNVR3CXR.js → chunk.BZ5VLPKB.js} +2 -2
- package/dist/preview/chunk.CE3NOADH.js +1 -0
- package/dist/preview/chunk.CNJENUPC.js +1 -0
- package/dist/preview/{chunk.DMNXYMLC.js → chunk.CRPT3ZT3.js} +1 -1
- package/dist/preview/{chunk.XXMYKBLT.js → chunk.CUCNT7MG.js} +1 -1
- package/dist/preview/{chunk.U5ACEYAN.js → chunk.D6RDTUX3.js} +1 -1
- package/dist/preview/{chunk.UHQD3NTK.js → chunk.DANDYIB5.js} +1 -1
- package/dist/preview/{chunk.UCIQIPBQ.js → chunk.DSP62QYK.js} +1 -1
- package/dist/preview/chunk.E77K6KBX.js +1 -0
- package/dist/preview/{chunk.HPD5ZDZH.js → chunk.EBLKEQ7O.js} +1 -1
- package/dist/preview/{chunk.VSOB2QEK.js → chunk.EDSPYKR4.js} +1 -1
- package/dist/preview/chunk.EQIGKXIG.js +1 -0
- package/dist/preview/{chunk.HWITWOP3.js → chunk.ER5ILWKY.js} +2 -2
- package/dist/preview/{chunk.7VUPKOKC.js → chunk.ET76FISZ.js} +1 -1
- package/dist/preview/{chunk.X7W27IRI.js → chunk.F5BCCGFK.js} +5 -5
- package/dist/preview/{chunk.7X2ZO5BD.js → chunk.FERBNBDE.js} +1 -1
- package/dist/preview/{chunk.FUQVNXLB.js → chunk.FQKH67BP.js} +1 -1
- package/dist/preview/{chunk.577PGFUT.js → chunk.FUR4IHWG.js} +1 -1
- package/dist/preview/chunk.FWBQVPMI.js +1 -0
- package/dist/preview/{chunk.FRS3S7DN.js → chunk.GOCUBIRW.js} +1 -1
- package/dist/preview/{chunk.CNMITOKP.js → chunk.GUDKPK42.js} +1 -1
- package/dist/preview/{chunk.QVUL2FSI.js → chunk.GXLAZGYT.js} +1 -1
- package/dist/preview/{chunk.Z7ZCR4LN.js → chunk.GZLYTPE7.js} +1 -1
- package/dist/preview/{chunk.35KI7XYV.js → chunk.H4T56OXM.js} +1 -1
- package/dist/preview/{chunk.JQDYGI6G.js → chunk.HPX3F7XX.js} +1 -1
- package/dist/preview/{chunk.WYEYYCBH.js → chunk.HZPTBPJY.js} +1 -1
- package/dist/preview/{chunk.PW7YH6JV.js → chunk.IB32NOV5.js} +1 -1
- package/dist/preview/{chunk.FSAHO3LV.js → chunk.IMRCAU4T.js} +1 -1
- package/dist/preview/{chunk.6A62UVAE.js → chunk.ITXIFDQ7.js} +1 -1
- package/dist/preview/{chunk.2YCFK5HU.js → chunk.J3TEJBI5.js} +1 -1
- package/dist/preview/{chunk.7WHWD5YJ.js → chunk.JLXQ6ZLI.js} +1 -1
- package/dist/preview/{chunk.6FBQP336.js → chunk.JZMA2AV7.js} +1 -1
- package/dist/preview/{chunk.B6VI576I.js → chunk.K5NJTE3F.js} +1 -1
- package/dist/preview/{chunk.FCRFQ7ZW.js → chunk.KBJG5SI2.js} +1 -1
- package/dist/preview/{chunk.3H4NVUWV.js → chunk.KU6NIMQX.js} +1 -1
- package/dist/preview/{chunk.LAF6GTBN.js → chunk.LA7535VO.js} +1 -1
- package/dist/preview/{chunk.RN3EZVV4.js → chunk.LMVCWYYG.js} +1 -1
- package/dist/preview/{chunk.2YGQVI6T.js → chunk.LNNFNJKN.js} +1 -1
- package/dist/preview/{chunk.RH45AW2W.js → chunk.M4FQ7SSM.js} +1 -1
- package/dist/preview/{chunk.UA5UYINM.js → chunk.MXJS67W4.js} +1 -1
- package/dist/preview/{chunk.LIIC25G6.js → chunk.NJ62C2GU.js} +1 -1
- package/dist/preview/{chunk.VZHV25JE.js → chunk.NNCTJSD3.js} +1 -1
- package/dist/preview/{chunk.LCFDM7XY.js → chunk.NWYOLGQ3.js} +1 -1
- package/dist/preview/{chunk.DNDHDDM6.js → chunk.O3OALXCI.js} +2 -2
- package/dist/preview/{chunk.ZJX6ZKKM.js → chunk.O6ROFVFD.js} +1 -1
- package/dist/preview/{chunk.KSXB4LDF.js → chunk.OF34OZ4V.js} +1 -1
- package/dist/preview/{chunk.RYEAMM73.js → chunk.OFJH7LDC.js} +1 -1
- package/dist/preview/{chunk.Q7TP4RFE.js → chunk.OH5BBE2B.js} +1 -1
- package/dist/preview/{chunk.CZRX2FDI.js → chunk.OREMUXB5.js} +1 -1
- package/dist/preview/{chunk.AHCI7ZDO.js → chunk.OXZRGP53.js} +1 -1
- package/dist/preview/chunk.OZR5NI4J.js +1 -0
- package/dist/preview/{chunk.PPUAPAWR.js → chunk.P75TPZWT.js} +1 -1
- package/dist/preview/{chunk.WLBXBNNH.js → chunk.PWOVXARZ.js} +1 -1
- package/dist/preview/chunk.Q63RPNUS.js +1 -0
- package/dist/preview/{chunk.XK4FVT2X.js → chunk.QDHUDLJB.js} +1 -1
- package/dist/preview/{chunk.HP3ZEDCD.js → chunk.QEALNWWL.js} +3 -3
- package/dist/preview/{chunk.APNN6BKF.js → chunk.QLMUGC7R.js} +1 -1
- package/dist/preview/{chunk.6VRJII5M.js → chunk.QTITRX5Q.js} +1 -1
- package/dist/preview/{chunk.GMOTRAKJ.js → chunk.R45BF6JV.js} +1 -1
- package/dist/preview/{chunk.F6WYSDSI.js → chunk.R7LRJS6B.js} +2 -2
- package/dist/preview/{chunk.3MWBWSYF.js → chunk.RKHEZ6KZ.js} +1 -1
- package/dist/preview/{chunk.XZYJRNRY.js → chunk.S6GJGTJE.js} +1 -1
- package/dist/preview/{chunk.7MTX33WD.js → chunk.SG23JC6D.js} +1 -1
- package/dist/preview/chunk.SSRP5SBR.js +1 -0
- package/dist/preview/{chunk.T3M4FALL.js → chunk.T2CN7UTZ.js} +2 -2
- package/dist/preview/{chunk.B2WRXGFI.js → chunk.T47DLH5Z.js} +1 -1
- package/dist/preview/{chunk.BU2DSZ2L.js → chunk.TGEF6TMM.js} +1 -1
- package/dist/preview/{chunk.7JNDZWD6.js → chunk.UJR3Y7MP.js} +1 -1
- package/dist/preview/{chunk.52QAIGCD.js → chunk.VHWUGSFW.js} +1 -1
- package/dist/preview/{chunk.6K2HASOH.js → chunk.W42P7NOL.js} +1 -1
- package/dist/preview/{chunk.2UPGH6FT.js → chunk.WGI5G6NM.js} +1 -1
- package/dist/preview/{chunk.VKH3ZPPQ.js → chunk.WHTQHU3M.js} +1 -1
- package/dist/preview/{chunk.6XO4PECH.js → chunk.WJ2TWU2I.js} +1 -1
- package/dist/preview/chunk.WQBDTLPZ.js +1 -0
- package/dist/preview/{chunk.TCSZZAYB.js → chunk.XBTZXWJX.js} +1 -1
- package/dist/preview/{chunk.OMMKD2NU.js → chunk.XRCGADKC.js} +1 -1
- package/dist/preview/{chunk.SIH6RCAI.js → chunk.Y3IJDWNS.js} +1 -1
- package/dist/preview/{chunk.HUKAVTMX.js → chunk.YNE5QR7Q.js} +1 -1
- package/dist/preview/{chunk.5EAQDBBE.js → chunk.ZDNJK2SX.js} +1 -1
- package/dist/preview/{chunk.QU356VB2.js → chunk.ZEW2OOZ5.js} +1 -1
- package/dist/preview/chunk.ZNS3LYJU.js +1 -0
- package/dist/preview/{chunk.YT2CYCVT.js → chunk.ZSSOTIFL.js} +1 -1
- package/dist/preview/{chunk.WAB6ZS2V.js → chunk.ZVMIHXVK.js} +1 -1
- package/dist/preview/{chunk.DUUARGPE.js → chunk.ZWZ5SEXT.js} +1 -1
- package/dist/preview/index.html +42 -42
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.6P7P2AW7.js +0 -1
- package/dist/preview/chunk.E7EQ2VTE.js +0 -1
- package/dist/preview/chunk.GNSAKLP2.js +0 -1
- package/dist/preview/chunk.HH6P4BLT.js +0 -1
- package/dist/preview/chunk.HPEGQN6E.js +0 -1
- package/dist/preview/chunk.JZBBGY4B.js +0 -1
- package/dist/preview/chunk.KA3KI4UA.js +0 -1
- package/dist/preview/chunk.M5HADQPP.js +0 -1
- package/dist/preview/chunk.QPAUQJON.js +0 -1
- package/dist/preview/chunk.SHPXD6FC.js +0 -1
- package/dist/preview/chunk.TPX6AVJL.js +0 -1
- package/dist/preview/chunk.WPCGHGDA.js +0 -1
- package/dist/preview/chunk.YCIX53AR.js +0 -1
- package/dist/preview/chunk.YEYY273R.js +0 -1
- package/dist/preview/chunk.ZFWV4JAJ.js +0 -1
- package/dist/preview/chunk.ZPQKAJRI.js +0 -1
- package/dist/preview/chunk.ZTD2CNC3.js +0 -25
|
@@ -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{d as Se,f as be}from"./chunk.VKH3ZPPQ.js";import{e as pt}from"./chunk.SIH6RCAI.js";import{a as yt,d as wt,f as vt}from"./chunk.RYEAMM73.js";import{a as Ce,b as ft}from"./chunk.7HPPJVIV.js";import{a as mt,b as ht}from"./chunk.CZRX2FDI.js";import{h as ut}from"./chunk.5EAQDBBE.js";import{a as ae,b as tt}from"./chunk.XXMYKBLT.js";import{b as Pe,c as U,d as X,e as it,f as rt}from"./chunk.34CYK2DF.js";import{a as ve,b as gt}from"./chunk.JZBBGY4B.js";import{c as ot,d as ie,e as J,f as ye,g as st,i as lt,j as re}from"./chunk.52QAIGCD.js";import{j as dt,o as we}from"./chunk.WLBXBNNH.js";import{c as ct}from"./chunk.7MTX33WD.js";import{c as at,d as Re}from"./chunk.RIW7SQH4.js";import{c as nt}from"./chunk.FSAHO3LV.js";import{A as Je,F as q,Q as I,R as Ye,X as Ze,Y as V,_ as ue,a as ge,fa as Qe,ga as j,ha as pe,ja as me,k as je,la as et,m as _e,n as qe,na as xe,oa as he,pa as Ne,s as ne,w as Ue,xa as fe,z as Xe}from"./chunk.ZTD2CNC3.js";import{Lb as te,N as Q,X as $,Ya as Ke,Z as ee,ea as H}from"./chunk.X7W27IRI.js";import{b as E}from"./chunk.AJZBJBMO.js";var v=E(q(),1);var St=E(q(),1);function bt(e){(0,St.useLayoutEffect)(()=>{let n=e.current,t=n?.parentElement;if(!n||!t)return;let a=n.style.bottom,o=()=>{let c=t.querySelector(zt);if(!c){n.style.bottom=a;return}let u=t.getBoundingClientRect(),m=c.getBoundingClientRect(),d=u.height>0?t.offsetHeight/u.height:1;n.style.bottom=`${Math.max(0,Math.round((u.bottom-m.top)*d))}px`};if(o(),typeof ResizeObserver>"u")return;let g=new ResizeObserver(o);return g.observe(t),()=>g.disconnect()},[e])}var zt=".graview-spec-listing";var $e=E(q(),1);var P=E(q(),1);var kt=E(q(),1);var B=E(I(),1);function xt({id:e,max:n=8,empty:t,hide:a}){let{store:o}=V();ue();let g=Kt(o,e,o.violations()),[c,u]=(0,kt.useState)(()=>new Set),m=a?g.flatMap(d=>{let f=d.ids.filter(r=>!a.has(r));return f.length>0?[{...d,ids:f}]:[]}):g;return m.length===0?t&&g.length===0?(0,B.jsx)("p",{style:{margin:0,fontSize:"0.875rem",color:"var(--graview-ink-faint)"},children:t}):null:(0,B.jsx)("div",{"data-graview-primitive":"connections",style:{display:"flex",flexDirection:"column",gap:12},children:m.map(d=>{let f=c.has(d.key),r=d.ids.length>n,l=f?d.ids:d.ids.slice(0,n),y=d.ids.length-Math.min(n,d.ids.length),k=`graview-more-${e}-${d.key}`.replace(/[^A-Za-z0-9_-]/g,"-");return(0,B.jsxs)("section",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,B.jsx)("h2",{...d.said?{"aria-label":d.said}:{},style:{margin:0,fontSize:"0.75rem",fontWeight:600,letterSpacing:"0.09em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:d.label}),(0,B.jsxs)("div",{id:k,style:{display:"flex",flexWrap:"wrap",gap:6},children:[l.map(h=>{let w=o.graph.getNode(h);return w?(0,B.jsx)(X,{pickId:h,hue:te(w.kind),title:`Go to the ${H(o.schema.tryDefinition(w.kind),w.kind)}`,label:$(o.schema.tryDefinition(w.kind),w)},h):null}),r?(0,B.jsx)("button",{type:"button","data-graview-more":d.key,"aria-expanded":f,"aria-controls":k,...f?{}:{"aria-label":`${y} more: ${d.said??d.label}`},onClick:h=>{h.stopPropagation(),u(w=>{let S=new Set(w);return S.has(d.key)?S.delete(d.key):S.add(d.key),S})},style:Ft,children:f?"Show fewer":`+${y} more`}):null]})]},d.key)})})}var Ft={display:"inline-flex",alignItems:"center",alignSelf:"flex-start",minHeight:24,boxSizing:"border-box",padding:"3px 9px",borderRadius:6,border:"1px solid var(--graview-edge)",background:"var(--graview-panel-muted)",color:"var(--graview-accent)",font:"inherit",fontSize:"0.8125rem",lineHeight:1.5,whiteSpace:"nowrap",cursor:"pointer"};function Kt(e,n,t=[]){let a=e.graph.getNode(n);if(!a)return[];let o=new Map,g=[];for(let c of t)if(c.subjectId===n)for(let u of c.nodeIds)u!==n&&!g.includes(u)&&e.graph.has(u)&&g.push(u);g.length>0&&o.set("judges",{key:"judges",label:"what it finds wrong",ids:g});for(let c of e.graph.allEdges()){let u=c.from===n?c.to:c.to===n?c.from:null;if(u===null||u===n)continue;let m=e.graph.getNode(u);if(!m)continue;let d=c.from===n?"out":"in",f=d==="out"?a.kind:m.kind,r=jt(e.schema,f,c.kind,d),l=`${c.kind}:${d}:${r.label}`,y=o.get(l)??{key:l,...r,ids:[]};y.ids.includes(u)||y.ids.push(u),o.set(l,y)}for(let c of o.values())c.ids.sort();return[...o.values()].sort((c,u)=>c.key<u.key?-1:c.key>u.key?1:0)}function jt(e,n,t,a){let o=nt(e,n,t,a),g=ee(t).toLowerCase();return o.trim().toLowerCase()!==g?{label:o}:a==="out"?{label:`\u2192 ${g}`,said:g}:{label:`\u2190 ${g}`,said:`${g}, pointing here`}}var Nt=E(q(),1),oe=(0,Nt.createContext)(null);var s=E(I(),1),_t=fe(ge(()=>(__graviewPreload(import.meta.url,["./chunk.ETWVQ3A2.js","./chunk.CZRX2FDI.js","./chunk.5EAQDBBE.js","./chunk.YT2CYCVT.js","./chunk.Z7ZCR4LN.js","./chunk.RIW7SQH4.js","./chunk.FSAHO3LV.js","./chunk.PNVR3CXR.js","./chunk.ZTD2CNC3.js","./chunk.X7W27IRI.js","./chunk.AJZBJBMO.js"]),import("./chunk.WPCGHGDA.js")))).part((e,n)=>(0,s.jsx)(e.ArrangeBar,{...n}),{what:"Arranging this list"}),qt=fe(ge(()=>(__graviewPreload(import.meta.url,["./chunk.JQDYGI6G.js","./chunk.VOFUIWAX.js","./chunk.MWJUZG3C.js","./chunk.F6WYSDSI.js","./chunk.PW7YH6JV.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.HJCQ6I3S.js","./chunk.DUUARGPE.js","./chunk.FUQVNXLB.js","./chunk.VMGWYCXU.js","./chunk.G4JJXA63.js","./chunk.LAF6GTBN.js","./chunk.QU356VB2.js","./chunk.QVKKXMNK.js","./chunk.ZSW74NVJ.js","./chunk.ZE4CTZQ3.js","./chunk.YJCT3DV2.js","./chunk.XXMYKBLT.js","./chunk.34CYK2DF.js","./chunk.JZBBGY4B.js","./chunk.UT6642FC.js","./chunk.Q5WEOX3Q.js","./chunk.DMNXYMLC.js","./chunk.2YGQVI6T.js","./chunk.HPD5ZDZH.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.ZJX6ZKKM.js")))).part((e,n)=>(0,s.jsx)(e.KindStop,{...n}),{what:"This list"});function Ae(e){let{brand:n}=V();return te(e,n?.accents)}function Ut(e,n){if(!n.endsWith("\u2026")&&!n.endsWith("..."))return;let t=n.replace(/[…]|\.\.\.$/g,"").trim();if(!(t.length<12)){for(let a of Object.values(e))if(typeof a=="string"&&a.length>t.length&&a.startsWith(t))return a}}function Xt(e,n){let a=Math.max(0,...e.slice(0,n*2).map(g=>g.length))*7.5+28<=212/2?2:1,o=n*a;return{columns:a,shown:Math.min(e.length,o)}}var Jt=8,Rt=500,Yt=12;function Ct(e){return{x:e.clientX,y:e.clientY,pointerType:e.pointerType??""}}function Zt(e,n,t){let a=performance.now()+Rt,o=["pointerdown","pointerup","mousedown","mouseup","dblclick"],g=r=>{if(performance.now()>a||!(r instanceof MouseEvent))return!1;let l=Ct(r);return n.pointerType&&l.pointerType&&n.pointerType!==l.pointerType?!1:Math.hypot(l.x-n.x,l.y-n.y)<=Yt},c=r=>{if(!g(r))return d();r.stopPropagation()},u=r=>{if(!g(r))return d();r.stopPropagation(),r.preventDefault(),e.removeEventListener("click",u,!0),setTimeout(d,50),t()},m=!1,d=()=>{if(!m){m=!0,clearTimeout(f),e.removeEventListener("click",u,!0);for(let r of o)e.removeEventListener(r,c,!0)}};for(let r of o)e.addEventListener(r,c,!0);e.addEventListener("click",u,!0);let f=setTimeout(d,Rt)}function Qt({View:e,members:n,mode:t,flagged:a}){let{isSelected:o}=xe(),g=n.slice(0,Jt);return(0,s.jsxs)("div",{"data-graview-rows":"",style:{display:"grid",gap:4,minWidth:0},children:[g.map(c=>(0,s.jsx)("div",{"data-graview-pick":c.id,style:{minWidth:0,cursor:"pointer"},children:(0,s.jsx)(e,{node:c,cardinality:"one",fidelity:"glyph",mode:t,selected:o(c.id),...a?.includes(c.id)?{flagged:[c.id]}:{}})},c.id)),n.length>g.length?(0,s.jsx)(X,{label:`+${n.length-g.length} more`}):null]})}var en=11/15,tn=fe(ge(()=>(__graviewPreload(import.meta.url,["./chunk.Z7ZCR4LN.js","./chunk.RIW7SQH4.js","./chunk.FSAHO3LV.js","./chunk.PNVR3CXR.js","./chunk.ZTD2CNC3.js","./chunk.X7W27IRI.js","./chunk.AJZBJBMO.js"]),import("./chunk.7JNDZWD6.js")))).part((e,n)=>(0,s.jsx)(e.StatesBar,{...n}),{quiet:!0});function nn({text:e,accent:n}){let t=(0,P.useRef)(null),a=(0,P.useRef)(null),[o,g]=(0,P.useState)(1),[c,u]=(0,P.useState)(!1),m=o<1?`${o}em`:void 0;return(0,P.useLayoutEffect)(()=>{let d=t.current,f=a.current;if(!d||!f)return;let r=()=>{let y=d.clientWidth,k=f.offsetWidth;if(y<=0||k<=0)return;let h=parseFloat(getComputedStyle(f).fontSize)/parseFloat(getComputedStyle(d).fontSize)||1,w=k/h,S=Math.max(en,Math.min(1,Math.floor(y/w*100)/100));g(x=>Math.abs(x-S)<.01?x:S),u(w*S>y+.5)};if(r(),typeof ResizeObserver>"u")return;let l=new ResizeObserver(r);return l.observe(d),()=>l.disconnect()},[e]),(0,s.jsx)("span",{ref:t,"data-graview-district-name":"",...o<1?{"data-graview-fitted":""}:{},...c?{title:e}:{},style:{display:"block",minWidth:0,fontSize:"0.9375rem",lineHeight:1.25,letterSpacing:"0.05em",textTransform:"uppercase",color:n?"var(--graview-accent)":"var(--graview-ink-muted)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:(0,s.jsx)("span",{ref:a,style:{fontSize:m},children:e})})}function Pt(e,n){return!!e?.display?.page?.groups?.length||Re(n,e).some(t=>t.long)}function At(e,n=me(e)){for(let t of e.kinds){let a=e.tryDefinition(t),o=a?.plural??`${String(t)}s`,g=r=>{let l=r.node,y=he(),k=(0,P.useContext)(oe);if(!l)return null;let h=k?.nodeId===l.id?k:null,w=$(a,l),S=r.mode==="fullscreen"?Ut(l,w)??w:w,x=Ke(y,[l.id]);return(0,s.jsxs)(U,{title:(0,s.jsx)(vt,{nodeId:l.id,children:h?.title??S}),...h?{}:{subtitle:a?.describe?at(a,l):a?.description??String(t)},selected:r.selected,...r.flagged?.includes(l.id)?{tone:"warning"}:{},fit:!0,children:[h?(0,s.jsx)(oe.Provider,{value:null,children:h.body}):null,(0,s.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:"22px 34px",alignItems:"flex-start"},children:[(0,s.jsx)("div",{style:{flex:Pt(a,l)?"1 1 100%":"1 1 0",minWidth:"min(200px, 100%)"},children:(0,s.jsx)(wt,{id:l.id,shown:[S,w,a?.description,h?.title],...h?{hide:[...h.fields]}:{}})}),(0,s.jsx)("div",{style:{flex:Pt(a,l)?"1 1 100%":"1.4 1 0",minWidth:"min(220px, 100%)"},children:(0,s.jsx)(xt,{id:l.id,empty:`Nothing is connected to this ${H(a,String(t))} yet.`,...h?{hide:h.records}:{}})})]}),x.length>0?(0,s.jsx)("p",{"data-graview-broken":"",style:{margin:"14px 0 0",paddingTop:12,borderTop:"1px solid var(--graview-edge)",fontSize:"0.875rem",color:"var(--graview-warn)"},children:x.map(b=>b.message).join(" \xB7 ")}):null]})},c=r=>{let l=r.node;if(!l)return null;let{store:y}=V(),k=a?.computed?lt(y.schema,y.graph,l):l,h=Re(k,a,{limit:3,said:[$(a,l)],glance:!0}),w=Ae(t),S=h.filter(N=>!N.long&&!N.markdown),x=h.find(N=>N.long||N.markdown),b=ot(l,a);return(0,s.jsxs)(U,{title:$(a,l),selected:r.selected,tone:r.flagged?.includes(l.id)?"warning":"muted",fit:!0,children:[b?(0,s.jsx)(ve,{as:"thumb",file:b,size:64,style:{marginBottom:6}}):null,(0,s.jsx)(it,{items:S.map(N=>({id:N.key,label:N.alone,hue:w})),max:3}),x?(0,s.jsx)("p",{"data-graview-excerpt":x.key,title:x.value,style:{margin:S.length>0?"6px 0 0":0,fontSize:"0.8125rem",lineHeight:1.35,color:"var(--graview-ink-muted)",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:x.value}):null]})},u=r=>{let l=r.node,y=Ae(t),k=we().marks.flag;if(!l)return null;let h=r.flagged?.includes(l.id)??!1;return(0,s.jsx)(X,{label:h?`${$(a,l)} ${k}`:$(a,l),hue:y,selected:r.selected,title:h?`${ee(H(a,String(t)))} \u2014 implicated in a problem`:ee(H(a,String(t)))})},m=r=>r.fidelity==="full"?(0,s.jsx)(P.Suspense,{fallback:(0,s.jsx)(d,{...r}),children:(0,s.jsx)(qt,{kind:String(t),members:r.nodes??[],...r.flagged?{flagged:r.flagged}:{},...r.label?{label:r.label}:{},...r.retired?{retired:r.retired}:{}})}):(0,s.jsx)(d,{...r}),d=r=>{let{brand:l,store:y,views:k}=V(),{view:h,go:w}=Ne(),S=r.nodes??[],x=k.lookup(String(t),{cardinality:"one",fidelity:"glyph"}),b=x!==void 0&&!pe(x)?x:void 0,N=mt(h),C=ut(S,N,{schema:e,graph:y.graph,flagged:new Set(r.flagged??[])}),L=R=>({id:R.id,label:$(e.tryDefinition(R.kind),R),hue:te(R.kind,l?.accents)}),W=r.fidelity==="full"&&S.length>1?(0,s.jsx)(P.Suspense,{fallback:null,children:(0,s.jsx)(_t,{schema:e,graph:y.graph,kind:String(t),arrangement:N,onChange:R=>w(ht(h,R)),kept:{shown:C.nodes.length,of:S.length},style:{marginBottom:8}})}):null,se=R=>R.some(A=>r.flagged?.includes(A.id)),le=he(),Y=we().marks.flag,z=(R,A,de)=>b?(0,s.jsx)(U,{title:R,meta:(0,s.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[(0,s.jsx)(be,{kind:String(t),plural:o,problems:Se(le,A),flag:Y}),(0,s.jsx)("span",{title:`${Q(A.length)} ${A.length===1?H(a,String(t)):o.toLowerCase()}`,children:Q(A.length)})]}),tone:se(A)?"warning":"muted",children:(0,s.jsx)(Qt,{View:b,members:A,mode:r.mode,...r.flagged?{flagged:r.flagged}:{}})},de):(0,s.jsx)(rt,{label:R,count:A.length,flagged:se(A),items:A.map(L),problems:(0,s.jsx)(be,{kind:String(t),plural:o,problems:Se(le,A),flag:Y})},de);return C.grouped?(0,s.jsxs)("div",{style:{display:"grid",gap:8},"data-graview-grouped":N.group?.by,children:[W,C.groups.map(R=>z(`${r.label??o} \xB7 ${R.label}`,R.nodes,R.key||"-"))]}):(0,s.jsxs)("div",{style:{display:"grid",gap:4},children:[W,z(r.label??o,C.nodes)]})},f=r=>{let l=r.nodes??[],y=Xt(l.map(p=>$(a,p)),r.openedRows??dt(l.length)),k=Ae(t),{brand:h}=V(),w=tt(String(t),e,h),S=we().marks.flag,{selection:x,set:b,clear:N}=xe(),{toggle:C,view:L,go:W}=Ne(),{views:se,hiddenKinds:le}=V(),Y=(0,P.useContext)(Qe),z=L.overview&&!le.has(String(t))?se.places().filter(p=>p.kind===String(t)):[],R=r.focused?L.within?.view??z[0]?.as:void 0,A=l.filter(p=>r.flagged?.includes(p.id)).length,de=A>0,Ot=he(),Ht=Se(Ot,l),F=(L.overview??!1)&&r.nestedUnder===void 0,G=r.focused||r.raised,He=r.rank==="secondary"&&!G,M=r.nestedUnder!==void 0,Ie=new Set(x),K=Y?x.length===1&&x[0]===ne(String(t)):r.opened??!1,It=ct(),O=G||F?0:l.filter(p=>It.includes(p.id)&&!Ie.has(p.id)).length,ke=O>0&&!de,ce=Ze(),_=ce&&!M?ce.byKind[String(t)]??0:0,We=(0,P.useRef)(null),ze=(0,P.useRef)(null);(0,P.useLayoutEffect)(()=>{let p=ze.current,D=We.current;if(!p||!D||!F)return;let T=()=>D.style.setProperty("--graview-plate-h",`${p.offsetHeight}px`);if(T(),typeof ResizeObserver>"u")return;let Z=new ResizeObserver(T);return Z.observe(p,{box:"border-box"}),()=>Z.disconnect()},[F]);let Wt=M?8:Math.min(46,10+Math.round(Math.sqrt(l.length)*8)),Fe=M?(0,s.jsx)("span",{style:{fontSize:"0.75rem",lineHeight:1.25,letterSpacing:"0.05em",textTransform:"uppercase",color:G?"var(--graview-accent)":"var(--graview-ink-muted)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r.label??o}):(0,s.jsx)(nn,{text:r.label??o,accent:!!G});return(0,s.jsxs)("div",{ref:We,className:"graview-kind-card","data-graview-rank":r.rank,"data-graview-landmark":w||void 0,"data-graview-nested":M||void 0,"data-graview-tied":O||void 0,"data-graview-hits":ce&&!M?_:void 0,"data-graview-emphasis":ce&&!M?_>0?"lit":"dimmed":void 0,...a?.description||M?{title:M?[r.label??o,a?.description].filter(Boolean).join(" \u2014 "):a.description}:{},style:{position:"relative",height:"100%","--graview-hue":Math.round(k)},children:[w?(0,s.jsx)("span",{className:"graview-kind-block graview-kind-landmark","data-graview-opened":r.opened||void 0,"aria-hidden":"true",style:{"--graview-rise":Wt},children:(0,s.jsx)(ae,{kind:String(t),schema:e,...h?{brand:h}:{},size:96})}):null,(0,s.jsxs)("div",{ref:ze,className:"graview-kind-face","data-graview-opened":r.opened||void 0,"data-graview-nameplate":F?r.nameplate??"full":void 0,style:{display:"flex",flexDirection:"column",gap:M?1:3,padding:M?"5px 7px":"7px 10px",borderRadius:"var(--graview-radius-sm, 9px)",justifyContent:"center",position:"relative",height:"100%",overflow:"hidden",boxSizing:"border-box",border:G?"1px solid var(--graview-accent)":O>0?"1px solid var(--graview-accent-dim)":`1px solid hsl(${Math.round(k)} 55% var(--graview-tint-lightness) / 0.34)`,backgroundColor:"var(--graview-panel)",backgroundImage:`linear-gradient(hsl(${Math.round(k)} 55% var(--graview-tint-lightness) / calc(var(--graview-tint-alpha) * ${G?1.1:He?.28:.5})), hsl(${Math.round(k)} 55% var(--graview-tint-lightness) / calc(var(--graview-tint-alpha) * ${G?1.1:He?.28:.5})))`,boxShadow:G?"0 0 0 1px var(--graview-accent-dim)":void 0},children:[!M&&!F&&l.length>0?(0,s.jsx)("div",{"data-graview-tally":l.length,"data-graview-broken":A||void 0,"aria-hidden":"true",style:{position:"absolute",left:0,right:0,top:0,display:"flex",height:3,background:`hsl(${Math.round(k)} 55% var(--graview-tint-lightness) / 0.4)`},children:A>0?(0,s.jsx)("span",{style:{width:`${Math.max(6,Math.round(A/l.length*100))}%`,background:"var(--graview-warn)"}}):null}):null,w?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:M?4:6},children:[(0,s.jsx)(ae,{kind:String(t),schema:e,...h?{brand:h}:{},size:M?14:18}),Fe]}):Fe,(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:5,fontSize:"0.875rem"},children:[(0,s.jsx)("span",{title:l.length>0?`${Q(l.length)} ${l.length===1?H(a,String(t)):o.toLowerCase()}`:void 0,style:{fontVariantNumeric:"tabular-nums",color:ke?"var(--graview-accent)":"var(--graview-ink-faint)"},children:l.length===0?"none yet":ke?O===l.length?`${O} tied`:`${O} of ${l.length} tied`:Q(l.length)}),(0,s.jsx)(be,{kind:String(t),plural:o,problems:Ht,flag:S,listed:K}),(r.retired??0)>0?(0,s.jsxs)("button",{type:"button",className:"graview-kind-past","data-graview-retired":r.retired,title:`${r.retired} retired ${o.toLowerCase()} \u2014 press to widen the view to the past`,onClick:p=>{p.stopPropagation(),W(pt(L,!0))},onDoubleClick:p=>p.stopPropagation(),onPointerDown:p=>p.stopPropagation(),children:["+",r.retired," past"]}):null,_>0?(0,s.jsxs)("button",{type:"button",className:"graview-kind-hits","data-testid":`hits-${String(t)}`,title:`${_} ${_===1?"match":"matches"} for \u201C${L.q??""}\u201D \u2014 press to go in, narrowed`,onClick:p=>{p.stopPropagation(),W(Xe(L,ne(String(t)),{ownPicture:!0,...L.q?{carry:L.q}:{}}))},onDoubleClick:p=>p.stopPropagation(),onPointerDown:p=>p.stopPropagation(),children:[_," match"]}):null,O>0&&!ke?(0,s.jsxs)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-accent)"},children:[O," tied"]}):null,r.hasOwnView&&!F?(0,s.jsx)("span",{title:`${o} has a view of its own`,"aria-label":"has its own view",style:{fontSize:"0.6875rem",color:"var(--graview-accent)"},children:"\u25C6"}):null,!M&&l.length>0&&!r.focused?(0,s.jsxs)("button",{type:"button",className:"graview-kind-open","data-testid":`open-${String(t)}`,"aria-expanded":K,"aria-label":K?`Close up the ${o}`:`See the ${o} in here`,title:K?"Close it up":`See the ${o} in here`,onClick:p=>{p.stopPropagation(),Y?K?N():b([ne(String(t))]):C(ne(String(t)))},onDoubleClick:p=>p.stopPropagation(),onPointerDown:p=>p.stopPropagation(),children:[(0,s.jsx)("span",{className:"graview-kind-open-word",children:K?"close":"open"})," ",(0,s.jsx)("span",{"aria-hidden":"true",children:K?"\u25B4":"\u25BE"})]}):null]}),F&&r.states?(0,s.jsx)(P.Suspense,{fallback:null,children:(0,s.jsx)(tn,{states:r.states,definition:a})}):null,r.opened?(0,s.jsxs)("div",{className:"graview-kind-members","data-graview-buildings":r.plot?.side??1,style:{display:"grid",gridTemplateColumns:`repeat(${y.columns}, minmax(0, 1fr))`,gap:3},children:[l.slice(0,y.shown).map(p=>{let D=r.flagged?.includes(p.id)??!1,T=$(a,p);return(0,s.jsx)(X,{pickId:p.id,label:D?`${T} ${S}`:T,title:D?`${T} \u2014 implicated in a problem`:void 0,hue:k,selected:Ie.has(p.id)},p.id)}),l.length>y.shown?(0,s.jsxs)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",padding:"2px 4px",gridColumn:"1 / -1"},children:["+",l.length-y.shown," more \u2014 double-click to go in"]}):null]}):null]}),!M&&z.length>0?(0,s.jsx)("div",{className:"graview-drive-in","data-testid":`drive-in-${String(t)}`,"data-graview-showing":R,onPointerDown:p=>p.stopPropagation(),onDoubleClick:p=>p.stopPropagation(),children:(0,s.jsx)("div",{className:"graview-drive-in-marquee",role:"group","aria-label":`${o}: pictures`,"data-graview-thumbs":z.length===1?"one":"two",children:z.map(p=>{let D=R===p.as;return(0,s.jsxs)("div",{className:"graview-drive-in-thumb","data-graview-pressed":D||void 0,children:[(0,s.jsx)("span",{className:"graview-drive-in-thumb-title","aria-hidden":"true",children:p.title}),(0,s.jsx)("button",{type:"button",className:"graview-drive-in-thumb-press","data-testid":`showing-${p.as}`,"aria-label":`${o}: ${p.title}`,"aria-pressed":D,title:D?`${p.title} is showing \u2014 press again to open it`:`Show ${p.title} on the billboard \u2014 double-click to open it`,onClick:T=>{T.stopPropagation();let Z=()=>W(Je(L,String(t),p.as));if(T.detail>=2||D&&r.focused){Z();return}W(_e(je(qe(L,!0),Ue(String(t))),"view",p.as)),T.detail===1&&Zt(T.currentTarget.ownerDocument,Ct(T.nativeEvent),Z)}})]},p.as)})})}):null]})};m.generic=!0,f.generic=!0,n.register(t,{cardinality:"one",fidelity:"full"},j(g)).register(t,{cardinality:"one",fidelity:"summary"},j(c)).register(t,{cardinality:"one",fidelity:"glyph"},j(u)).register(t,{cardinality:"many",fidelity:"full"},j(m)).register(t,{cardinality:"many",fidelity:"summary"},j(m)).register(t,{cardinality:"many",fidelity:"glyph"},j(f))}return n}var Me=E(I(),1),$t=new WeakMap;function an(e){let n=$t.get(e);return n||$t.set(e,n=At(e,me(e))),n}var Ve=et;function Vt(){return(0,$e.useContext)(Ve)}function jn({children:e}){return(0,Me.jsx)(Ve.Provider,{value:!0,children:e})}function Mt(e){let n=(0,$e.useContext)(Ve),{store:t}=V();if(n)return null;let a=e.kind??e.node?.kind??e.nodes?.[0]?.kind;if(!a)return null;let o=an(t.schema).lookup(a,{cardinality:e.cardinality,fidelity:e.fidelity});return o?(0,Me.jsx)(o,{...e}):null}var i=E(I(),1),Tt=(0,v.createContext)(null),Et=(e,n)=>e.trim().toLowerCase().replace(/[_-]+/g," ")===n.trim().toLowerCase().replace(/[_-]+/g," "),rn=(0,v.createContext)(null),Be=(0,v.createContext)(null);function Lt({block:e}){let n=(0,v.useContext)(Be),t=n?.slots?.[e.key],a=(0,i.jsx)(on,{block:e});return t?(0,i.jsx)(v.Suspense,{fallback:a,children:(0,i.jsx)(t,{block:e,node:n.node,drawn:a})}):a}function on({block:e}){let n=(0,v.useContext)(Tt),t=(0,v.useContext)(ln),a=(0,v.useContext)(Te),o=(0,v.useContext)(Pe);if(n&&e.t==="badge"&&n.values.some(g=>Et(g,e.text))||n&&e.t==="field"&&n.field!==void 0&&e.field===n.field||e.t==="badge"&&/^0(?:\s+\p{L}+)?$/u.test(e.text.trim()))return null;switch(e.t){case"title":return(0,i.jsx)("strong",{className:"graview-spec-title",...o!==null&&Et(o,e.text)?{"aria-hidden":!0}:{},children:e.text});case"text":return e.markdown||Ce(e.text)?(0,i.jsx)("div",{className:"graview-spec-text",...e.tone?{"data-graview-tone":e.tone}:{},children:(0,i.jsx)(ft,{text:e.text,markdown:e.markdown})}):(0,i.jsx)("p",{className:"graview-spec-text",...e.tone?{"data-graview-tone":e.tone}:{},children:e.text});case"badge":return(0,i.jsx)("span",{className:"graview-spec-badge","data-graview-tone":e.tone,children:e.text});case"field":return(0,i.jsxs)("span",{className:"graview-spec-field","data-graview-field":e.field,children:[(0,i.jsx)("span",{className:"graview-spec-label",children:e.label}),(0,i.jsx)("span",{className:"graview-spec-value",...Ce(e.text)?{style:{whiteSpace:"pre-line"}}:{},children:e.linked?(0,i.jsx)(gt,{relation:e.linked.relation,refs:e.linked.refs,as:"chip"}):e.app?(0,i.jsx)(yt,{address:e.app}):e.href?(0,i.jsx)("a",{className:"graview-spec-link",href:e.href,...e.href.startsWith("tel:")?{}:{rel:"noopener noreferrer",target:"_blank"},children:e.text}):e.text})]});case"image":return(0,i.jsx)(ve,{as:"block",field:e.field,files:e.files,label:e.label,view:e.as});case"progress":return e.value===void 0||e.max===void 0?(0,i.jsxs)("span",{className:"graview-spec-progress",children:[(0,i.jsx)("span",{className:"graview-spec-label",children:e.label}),(0,i.jsx)("span",{className:"graview-spec-value",children:e.text})]}):(0,i.jsxs)("span",{className:"graview-spec-progress",children:[(0,i.jsx)("span",{className:"graview-spec-label",children:e.label}),(0,i.jsx)("span",{className:"graview-spec-track",role:"progressbar","aria-label":e.label,"aria-valuemin":0,"aria-valuemax":e.max,"aria-valuenow":Math.max(0,Math.min(e.value,e.max)),"aria-valuetext":e.text,children:(0,i.jsx)("span",{className:"graview-spec-fill",style:{width:`${Math.round(Math.max(0,Math.min(e.value,e.max))/e.max*100)}%`}})}),(0,i.jsx)("span",{className:"graview-spec-value",children:e.text})]});case"group":return(0,i.jsx)("span",{className:"graview-spec-group","data-direction":e.direction,children:(0,i.jsx)(Ee,{blocks:e.blocks})});case"when":return e.shown?(0,i.jsx)(Ee,{blocks:e.blocks}):null;case"divider":return(0,i.jsx)("hr",{className:"graview-spec-divider"});case"figure":return(0,i.jsx)(sn,{});case"headline":{let g=`h${Math.min(6,e.level+t)}`,c=(0,i.jsx)(g,{className:"graview-spec-headline","data-level":e.level,children:e.text});return a!==null&&e.level===1?(0,i.jsxs)(i.Fragment,{children:[c,a]}):c}case"number":return(0,i.jsxs)("span",{className:"graview-spec-number",...e.emphasis?{"data-emphasis":e.emphasis}:{},children:[(0,i.jsx)("span",{className:"graview-spec-number-value",children:e.text}),e.label?(0,i.jsx)("span",{className:"graview-spec-label",children:e.label}):null]});case"list":return(0,i.jsx)(cn,{list:e})}}function sn(){let e=(0,v.useContext)(Be)?.figure;return e?(0,i.jsx)("span",{className:"graview-spec-figure","aria-hidden":"true",children:e()}):null}function Ee({blocks:e}){let n=[];for(let t=0;t<e.length;t++){let a=t;for(;e[a]?.t==="badge"&&e[a+1]?.t==="badge";)a++;if(a===t){n.push((0,i.jsx)(Lt,{block:e[t]},t));continue}n.push((0,i.jsx)("span",{className:"graview-spec-badges",children:e.slice(t,a+1).map((o,g)=>(0,i.jsx)(Lt,{block:o},g))},t)),t=a}return n}function Dt({blocks:e,ctx:n,view:t}){let a=(0,v.useContext)(rn)?.[t];return(0,i.jsx)(Be.Provider,{value:{figure:n.figure,slots:a,node:n.node},children:(0,i.jsx)(Ee,{blocks:e})})}function Ge({blocks:e,ctx:n,view:t}){return(0,i.jsx)(Dt,{blocks:J(e,n),ctx:n,view:t})}var Le=3,Bt=(0,v.createContext)(0),Gt=(0,v.createContext)(null),ln=(0,v.createContext)(0),Te=(0,v.createContext)(null);function dn({node:e,as:n,depth:t,said:a=null}){let{store:o,views:g}=V(),c=$(o.schema.tryDefinition(e.kind),e),u=g.lookup(e.kind,{cardinality:"one",fidelity:n==="card"?"summary":"glyph"});return n==="row"&&t<=Le&&(!u||pe(u))?(0,i.jsxs)("li",{className:"graview-spec-item","data-graview-listed":e.id,"data-as":n,children:[(0,i.jsx)(De,{node:e,label:c}),(0,i.jsx)("div",{className:"graview-spec graview-spec-row","data-graview-spec":"row","data-graview-kind":e.kind,"aria-hidden":"true",children:(0,i.jsx)("strong",{className:"graview-spec-title",children:c})})]}):(0,i.jsxs)("li",{className:"graview-spec-item","data-graview-listed":e.id,"data-as":n,children:[(0,i.jsx)(De,{node:e,label:c}),t<=Le&&u?(0,i.jsx)(Ye,{mode:"scene",children:(0,i.jsx)(Bt.Provider,{value:t,children:(0,i.jsx)(Tt.Provider,{value:a,children:(0,i.jsx)(Pe.Provider,{value:c,children:(0,i.jsx)(u,{node:e,cardinality:"one",fidelity:n==="card"?"summary":"glyph",mode:"scene",selected:!1})})})})}):(0,i.jsx)("span",{className:"graview-spec-item-name","aria-hidden":"true",children:c})]})}function De({node:e,label:n}){let t=(0,v.useContext)(Gt),a=(0,v.useRef)(null);return bt(a),t?(0,i.jsx)("a",{ref:a,className:"graview-spec-item-link",href:t.href(e),"aria-label":n,onClick:o=>{o.metaKey||o.ctrlKey||o.shiftKey||o.button!==0||(o.preventDefault(),o.stopPropagation(),t.go(e))}}):(0,i.jsx)("button",{ref:a,type:"button",className:"graview-spec-item-link","data-graview-pick":e.id,"aria-label":n})}function cn({list:e}){let n=(0,v.useContext)(Bt)+1,{store:t}=V(),a=(0,v.useContext)(Gt),[o,g]=(0,v.useState)(e.members.length);if(e.failed)return(0,i.jsx)("p",{className:"graview-spec-text",children:"\u2014"});if(e.members.length===0)return e.empty?(0,i.jsx)("p",{className:"graview-spec-text graview-spec-empty",children:e.empty}):null;let c=(b,N=null)=>n>Le?(0,i.jsx)("ul",{className:"graview-spec-list","data-as":"names",children:b.map(C=>(0,i.jsxs)("li",{className:"graview-spec-item","data-graview-listed":C.id,"data-as":"name",children:[(0,i.jsx)(De,{node:C,label:$(t.schema.tryDefinition(C.kind),C)}),(0,i.jsx)("span",{className:"graview-spec-item-name","aria-hidden":"true",children:$(t.schema.tryDefinition(C.kind),C)})]},C.id))}):(0,i.jsx)("ul",{className:"graview-spec-list","data-as":e.as,children:b.map(C=>(0,i.jsx)(dn,{node:C,as:e.as,depth:n,said:N},C.id))}),u=e.rest??[],m=Math.min(o,e.members.length+u.length),d=m>e.members.length?[...e.members,...u].slice(0,m):e.members,f=e.members.length+u.length-m,r=Math.max(1,e.members.length),l=f>0?(0,i.jsx)("p",{className:"graview-spec-text graview-spec-more",children:(0,i.jsx)("button",{type:"button",className:"graview-spec-show-more","data-graview-show-more":f,onClick:()=>g(m+r),children:`Show ${Math.min(r,f)} more`})}):null,y=e.total??e.members.length+e.more,k=e.more-u.length,h=l??(a?.more&&y>d.length?a.more({members:d,total:y}):k>0?(0,i.jsx)("p",{className:"graview-spec-text graview-spec-more",children:`and ${k} more`}):null);if(!e.groups)return(0,i.jsxs)("div",{className:"graview-spec-listing",children:[c(d),h]});let w=`h${e.headingLevel}`,S=m,x=m>e.members.length&&e.everyGroup?e.everyGroup.flatMap(b=>{if(S<=0)return[];let N=b.members.slice(0,S);return S-=N.length,[{...b,members:N}]}):e.groups;return(0,i.jsxs)("div",{className:"graview-spec-listing",children:[x.map(b=>(0,i.jsxs)("section",{className:"graview-spec-list-group","data-graview-group":b.value??"",children:[b.heading?(0,i.jsx)(w,{className:"graview-spec-list-heading",children:b.heading}):null,c(b.members,b.value!==null?{values:[b.value,...b.heading?[b.heading]:[]]}:null)]},b.value??"")),h]})}function sa({blocks:e,heading:n=2,firstHeading:t,slot:a,view:o=a}){let{store:g,brand:c}=V();ue();let u=re(g,null,null,{heading:n,firstHeading:t,money:c}),m=(0,v.useContext)(Te),d=e.some(f=>f.t==="headline");return(0,i.jsxs)("div",{className:`graview-spec graview-spec-${a}`,"data-graview-spec":a,children:[m!==null&&!d?m:null,(0,i.jsx)(Te.Provider,{value:d?m:null,children:(0,i.jsx)(Ge,{blocks:e,ctx:u,view:o})})]})}function Oe(e,n="card"){let{store:t,brand:a}=V(),o=t.schema;return{...re(t,null,e,{slot:n,money:a}),figure:()=>(0,i.jsx)(ae,{kind:e.kind,schema:o,...a?{brand:a}:{},size:22})}}function gn({slot:e,blocks:n,node:t,selected:a}){let o=Oe(t,e);return(0,i.jsx)("div",{className:`graview-spec graview-spec-${e}`,"data-graview-spec":e,"data-graview-kind":t.kind,...e==="row"&&n.some(st)?{"data-graview-tall":""}:{},...a?{"data-selected":""}:{},children:(0,i.jsx)(Ge,{blocks:n,ctx:o,view:`${t.kind}.${e}`})})}function un({blocks:e,node:n,selected:t,flagged:a}){let o=Oe(n),[g,...c]=e,u=g?.t==="title";return(0,i.jsx)(U,{...u?{title:J([g],o)[0].text}:{},selected:t,tone:a?"warning":"muted",fit:!0,children:(0,i.jsx)("div",{className:"graview-spec graview-spec-card","data-graview-spec":"card","data-graview-kind":n.kind,children:(0,i.jsx)(Ge,{blocks:u?c:e,ctx:o,view:`${n.kind}.card`})})})}function pn({blocks:e,props:n}){let t=n.node,a=Oe(t,"page"),o=Vt(),g=J(e,a),c=ye(e,g),u=c.title!==void 0&&(!o||c.title===$(a.schema?.tryDefinition(t.kind),t)),m=(0,i.jsx)("div",{className:"graview-spec graview-spec-page","data-graview-spec":"page","data-graview-kind":t.kind,children:(0,i.jsx)(Dt,{blocks:u?g.slice(1):g,ctx:a,view:`${t.kind}.page`})});return o?m:(0,i.jsx)(oe.Provider,{value:{nodeId:t.id,...c.title!==void 0?{title:c.title}:{},body:m,fields:c.fields,records:c.records},children:(0,i.jsx)(Mt,{...n})})}function la(e,n,t){return typeof e=="function"?e.says?.(n,t):void 0}function mn({blocks:e,node:n,selected:t}){let{store:a}=V();return(0,i.jsx)("div",{title:$(a.schema.tryDefinition(n.kind),n),style:{minWidth:0,maxWidth:"100%"},children:(0,i.jsx)(gn,{slot:"row",blocks:e,node:n,selected:t})})}function da(e,n,t){if(!t)return e;let a=new Set(n.kinds);for(let[o,g]of Object.entries(t)){if(!a.has(o)||!g)continue;let c=o;if(g.card){let u=ie(g.card),m=d=>d.node?(0,i.jsx)(un,{blocks:u,node:d.node,selected:d.selected,flagged:d.flagged?.includes(d.node.id)??!1}):null;e.register(c,{cardinality:"one",fidelity:"summary"},m)}if(g.row){let u=ie(g.row),m=d=>d.node?(0,i.jsx)(mn,{blocks:u,node:d.node,selected:d.selected}):null;m.says=(d,f)=>ye(u,J(u,re({graph:f,schema:n},null,d,{slot:"row"}))),e.register(c,{cardinality:"one",fidelity:"glyph"},m)}if(g.page){let u=ie(g.page),m=d=>d.node?(0,i.jsx)(pn,{blocks:u,props:d}):null;m.says=(d,f)=>ye(u,J(u,re({graph:f,schema:n},null,d))),e.register(c,{cardinality:"one",fidelity:"full"},m)}}return e}export{bt as a,jn as b,Tt as c,Gt as d,ln as e,Te as f,De as g,sa as h,la as i,da as j,At as k};
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{d as Se,f as be}from"./chunk.WHTQHU3M.js";import{e as pt}from"./chunk.Y3IJDWNS.js";import{a as yt,d as wt,f as vt}from"./chunk.OFJH7LDC.js";import{a as Ce,b as ft}from"./chunk.5PU3RWYY.js";import{a as mt,b as ht}from"./chunk.OREMUXB5.js";import{h as ut}from"./chunk.ZDNJK2SX.js";import{a as ae,b as tt}from"./chunk.CUCNT7MG.js";import{b as Pe,c as U,d as X,e as it,f as rt}from"./chunk.2A2DLMT3.js";import{a as ve,b as gt}from"./chunk.E77K6KBX.js";import{c as ot,d as ie,e as J,f as ye,g as st,i as lt,j as re}from"./chunk.VHWUGSFW.js";import{j as dt,o as we}from"./chunk.PWOVXARZ.js";import{c as ct}from"./chunk.SG23JC6D.js";import{c as at,d as Re}from"./chunk.4B73P2WA.js";import{c as nt}from"./chunk.IMRCAU4T.js";import{A as Je,F as q,Q as I,R as Ye,X as Ze,Y as V,_ as ue,a as ge,fa as Qe,ga as j,ha as pe,ja as me,k as je,la as et,m as _e,n as qe,na as xe,oa as he,pa as Ne,s as ne,w as Ue,xa as fe,z as Xe}from"./chunk.6II4BONS.js";import{Mb as te,N as Q,X as $,Z as ee,Za as Ke,ea as H}from"./chunk.F5BCCGFK.js";import{b as E}from"./chunk.AJZBJBMO.js";var v=E(q(),1);var St=E(q(),1);function bt(e){(0,St.useLayoutEffect)(()=>{let n=e.current,t=n?.parentElement;if(!n||!t)return;let a=n.style.bottom,o=()=>{let c=t.querySelector(zt);if(!c){n.style.bottom=a;return}let u=t.getBoundingClientRect(),m=c.getBoundingClientRect(),d=u.height>0?t.offsetHeight/u.height:1;n.style.bottom=`${Math.max(0,Math.round((u.bottom-m.top)*d))}px`};if(o(),typeof ResizeObserver>"u")return;let g=new ResizeObserver(o);return g.observe(t),()=>g.disconnect()},[e])}var zt=".graview-spec-listing";var $e=E(q(),1);var P=E(q(),1);var kt=E(q(),1);var B=E(I(),1);function xt({id:e,max:n=8,empty:t,hide:a}){let{store:o}=V();ue();let g=Kt(o,e,o.violations()),[c,u]=(0,kt.useState)(()=>new Set),m=a?g.flatMap(d=>{let f=d.ids.filter(r=>!a.has(r));return f.length>0?[{...d,ids:f}]:[]}):g;return m.length===0?t&&g.length===0?(0,B.jsx)("p",{style:{margin:0,fontSize:"0.875rem",color:"var(--graview-ink-faint)"},children:t}):null:(0,B.jsx)("div",{"data-graview-primitive":"connections",style:{display:"flex",flexDirection:"column",gap:12},children:m.map(d=>{let f=c.has(d.key),r=d.ids.length>n,l=f?d.ids:d.ids.slice(0,n),y=d.ids.length-Math.min(n,d.ids.length),k=`graview-more-${e}-${d.key}`.replace(/[^A-Za-z0-9_-]/g,"-");return(0,B.jsxs)("section",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,B.jsx)("h2",{...d.said?{"aria-label":d.said}:{},style:{margin:0,fontSize:"0.75rem",fontWeight:600,letterSpacing:"0.09em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:d.label}),(0,B.jsxs)("div",{id:k,style:{display:"flex",flexWrap:"wrap",gap:6},children:[l.map(h=>{let w=o.graph.getNode(h);return w?(0,B.jsx)(X,{pickId:h,hue:te(w.kind),title:`Go to the ${H(o.schema.tryDefinition(w.kind),w.kind)}`,label:$(o.schema.tryDefinition(w.kind),w)},h):null}),r?(0,B.jsx)("button",{type:"button","data-graview-more":d.key,"aria-expanded":f,"aria-controls":k,...f?{}:{"aria-label":`${y} more: ${d.said??d.label}`},onClick:h=>{h.stopPropagation(),u(w=>{let S=new Set(w);return S.has(d.key)?S.delete(d.key):S.add(d.key),S})},style:Ft,children:f?"Show fewer":`+${y} more`}):null]})]},d.key)})})}var Ft={display:"inline-flex",alignItems:"center",alignSelf:"flex-start",minHeight:24,boxSizing:"border-box",padding:"3px 9px",borderRadius:6,border:"1px solid var(--graview-edge)",background:"var(--graview-panel-muted)",color:"var(--graview-accent)",font:"inherit",fontSize:"0.8125rem",lineHeight:1.5,whiteSpace:"nowrap",cursor:"pointer"};function Kt(e,n,t=[]){let a=e.graph.getNode(n);if(!a)return[];let o=new Map,g=[];for(let c of t)if(c.subjectId===n)for(let u of c.nodeIds)u!==n&&!g.includes(u)&&e.graph.has(u)&&g.push(u);g.length>0&&o.set("judges",{key:"judges",label:"what it finds wrong",ids:g});for(let c of e.graph.allEdges()){let u=c.from===n?c.to:c.to===n?c.from:null;if(u===null||u===n)continue;let m=e.graph.getNode(u);if(!m)continue;let d=c.from===n?"out":"in",f=d==="out"?a.kind:m.kind,r=jt(e.schema,f,c.kind,d),l=`${c.kind}:${d}:${r.label}`,y=o.get(l)??{key:l,...r,ids:[]};y.ids.includes(u)||y.ids.push(u),o.set(l,y)}for(let c of o.values())c.ids.sort();return[...o.values()].sort((c,u)=>c.key<u.key?-1:c.key>u.key?1:0)}function jt(e,n,t,a){let o=nt(e,n,t,a),g=ee(t).toLowerCase();return o.trim().toLowerCase()!==g?{label:o}:a==="out"?{label:`\u2192 ${g}`,said:g}:{label:`\u2190 ${g}`,said:`${g}, pointing here`}}var Nt=E(q(),1),oe=(0,Nt.createContext)(null);var s=E(I(),1),_t=fe(ge(()=>(__graviewPreload(import.meta.url,["./chunk.27TLAVRR.js","./chunk.OREMUXB5.js","./chunk.ZDNJK2SX.js","./chunk.ZSSOTIFL.js","./chunk.GZLYTPE7.js","./chunk.4B73P2WA.js","./chunk.IMRCAU4T.js","./chunk.BZ5VLPKB.js","./chunk.6II4BONS.js","./chunk.F5BCCGFK.js","./chunk.AJZBJBMO.js"]),import("./chunk.7TBSVQSH.js")))).part((e,n)=>(0,s.jsx)(e.ArrangeBar,{...n}),{what:"Arranging this list"}),qt=fe(ge(()=>(__graviewPreload(import.meta.url,["./chunk.HPX3F7XX.js","./chunk.7CO7S6QM.js","./chunk.6QDFBCV4.js","./chunk.R7LRJS6B.js","./chunk.IB32NOV5.js","./chunk.4STIUIT6.js","./chunk.WHTQHU3M.js","./chunk.KU6NIMQX.js","./chunk.Y3IJDWNS.js","./chunk.OFJH7LDC.js","./chunk.5PU3RWYY.js","./chunk.27TLAVRR.js","./chunk.OREMUXB5.js","./chunk.ZDNJK2SX.js","./chunk.ZSSOTIFL.js","./chunk.HJCQ6I3S.js","./chunk.ZWZ5SEXT.js","./chunk.FQKH67BP.js","./chunk.6KMXLUOS.js","./chunk.G4JJXA63.js","./chunk.LA7535VO.js","./chunk.ZEW2OOZ5.js","./chunk.7YQYWOZR.js","./chunk.ACEYGWMO.js","./chunk.3PT55HXT.js","./chunk.3SM2CHKF.js","./chunk.CUCNT7MG.js","./chunk.2A2DLMT3.js","./chunk.E77K6KBX.js","./chunk.UT6642FC.js","./chunk.Q5WEOX3Q.js","./chunk.CRPT3ZT3.js","./chunk.LNNFNJKN.js","./chunk.EBLKEQ7O.js","./chunk.WVUJXDXZ.js","./chunk.VHWUGSFW.js","./chunk.P75TPZWT.js","./chunk.6W7J76TK.js","./chunk.FUR4IHWG.js","./chunk.2B4WVCVV.js","./chunk.AAZFVCSP.js","./chunk.GZHZLJBF.js","./chunk.PWOVXARZ.js","./chunk.SG23JC6D.js","./chunk.OJGHDWI6.js","./chunk.GZLYTPE7.js","./chunk.4B73P2WA.js","./chunk.IMRCAU4T.js","./chunk.BZ5VLPKB.js","./chunk.6II4BONS.js","./chunk.F5BCCGFK.js","./chunk.AJZBJBMO.js"]),import("./chunk.O6ROFVFD.js")))).part((e,n)=>(0,s.jsx)(e.KindStop,{...n}),{what:"This list"});function Ae(e){let{brand:n}=V();return te(e,n?.accents)}function Ut(e,n){if(!n.endsWith("\u2026")&&!n.endsWith("..."))return;let t=n.replace(/[…]|\.\.\.$/g,"").trim();if(!(t.length<12)){for(let a of Object.values(e))if(typeof a=="string"&&a.length>t.length&&a.startsWith(t))return a}}function Xt(e,n){let a=Math.max(0,...e.slice(0,n*2).map(g=>g.length))*7.5+28<=212/2?2:1,o=n*a;return{columns:a,shown:Math.min(e.length,o)}}var Jt=8,Rt=500,Yt=12;function Ct(e){return{x:e.clientX,y:e.clientY,pointerType:e.pointerType??""}}function Zt(e,n,t){let a=performance.now()+Rt,o=["pointerdown","pointerup","mousedown","mouseup","dblclick"],g=r=>{if(performance.now()>a||!(r instanceof MouseEvent))return!1;let l=Ct(r);return n.pointerType&&l.pointerType&&n.pointerType!==l.pointerType?!1:Math.hypot(l.x-n.x,l.y-n.y)<=Yt},c=r=>{if(!g(r))return d();r.stopPropagation()},u=r=>{if(!g(r))return d();r.stopPropagation(),r.preventDefault(),e.removeEventListener("click",u,!0),setTimeout(d,50),t()},m=!1,d=()=>{if(!m){m=!0,clearTimeout(f),e.removeEventListener("click",u,!0);for(let r of o)e.removeEventListener(r,c,!0)}};for(let r of o)e.addEventListener(r,c,!0);e.addEventListener("click",u,!0);let f=setTimeout(d,Rt)}function Qt({View:e,members:n,mode:t,flagged:a}){let{isSelected:o}=xe(),g=n.slice(0,Jt);return(0,s.jsxs)("div",{"data-graview-rows":"",style:{display:"grid",gap:4,minWidth:0},children:[g.map(c=>(0,s.jsx)("div",{"data-graview-pick":c.id,style:{minWidth:0,cursor:"pointer"},children:(0,s.jsx)(e,{node:c,cardinality:"one",fidelity:"glyph",mode:t,selected:o(c.id),...a?.includes(c.id)?{flagged:[c.id]}:{}})},c.id)),n.length>g.length?(0,s.jsx)(X,{label:`+${n.length-g.length} more`}):null]})}var en=11/15,tn=fe(ge(()=>(__graviewPreload(import.meta.url,["./chunk.GZLYTPE7.js","./chunk.4B73P2WA.js","./chunk.IMRCAU4T.js","./chunk.BZ5VLPKB.js","./chunk.6II4BONS.js","./chunk.F5BCCGFK.js","./chunk.AJZBJBMO.js"]),import("./chunk.UJR3Y7MP.js")))).part((e,n)=>(0,s.jsx)(e.StatesBar,{...n}),{quiet:!0});function nn({text:e,accent:n}){let t=(0,P.useRef)(null),a=(0,P.useRef)(null),[o,g]=(0,P.useState)(1),[c,u]=(0,P.useState)(!1),m=o<1?`${o}em`:void 0;return(0,P.useLayoutEffect)(()=>{let d=t.current,f=a.current;if(!d||!f)return;let r=()=>{let y=d.clientWidth,k=f.offsetWidth;if(y<=0||k<=0)return;let h=parseFloat(getComputedStyle(f).fontSize)/parseFloat(getComputedStyle(d).fontSize)||1,w=k/h,S=Math.max(en,Math.min(1,Math.floor(y/w*100)/100));g(x=>Math.abs(x-S)<.01?x:S),u(w*S>y+.5)};if(r(),typeof ResizeObserver>"u")return;let l=new ResizeObserver(r);return l.observe(d),()=>l.disconnect()},[e]),(0,s.jsx)("span",{ref:t,"data-graview-district-name":"",...o<1?{"data-graview-fitted":""}:{},...c?{title:e}:{},style:{display:"block",minWidth:0,fontSize:"0.9375rem",lineHeight:1.25,letterSpacing:"0.05em",textTransform:"uppercase",color:n?"var(--graview-accent)":"var(--graview-ink-muted)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:(0,s.jsx)("span",{ref:a,style:{fontSize:m},children:e})})}function Pt(e,n){return!!e?.display?.page?.groups?.length||Re(n,e).some(t=>t.long)}function At(e,n=me(e)){for(let t of e.kinds){let a=e.tryDefinition(t),o=a?.plural??`${String(t)}s`,g=r=>{let l=r.node,y=he(),k=(0,P.useContext)(oe);if(!l)return null;let h=k?.nodeId===l.id?k:null,w=$(a,l),S=r.mode==="fullscreen"?Ut(l,w)??w:w,x=Ke(y,[l.id]);return(0,s.jsxs)(U,{title:(0,s.jsx)(vt,{nodeId:l.id,children:h?.title??S}),...h?{}:{subtitle:a?.describe?at(a,l):a?.description??String(t)},selected:r.selected,...r.flagged?.includes(l.id)?{tone:"warning"}:{},fit:!0,children:[h?(0,s.jsx)(oe.Provider,{value:null,children:h.body}):null,(0,s.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:"22px 34px",alignItems:"flex-start"},children:[(0,s.jsx)("div",{style:{flex:Pt(a,l)?"1 1 100%":"1 1 0",minWidth:"min(200px, 100%)"},children:(0,s.jsx)(wt,{id:l.id,shown:[S,w,a?.description,h?.title],...h?{hide:[...h.fields]}:{}})}),(0,s.jsx)("div",{style:{flex:Pt(a,l)?"1 1 100%":"1.4 1 0",minWidth:"min(220px, 100%)"},children:(0,s.jsx)(xt,{id:l.id,empty:`Nothing is connected to this ${H(a,String(t))} yet.`,...h?{hide:h.records}:{}})})]}),x.length>0?(0,s.jsx)("p",{"data-graview-broken":"",style:{margin:"14px 0 0",paddingTop:12,borderTop:"1px solid var(--graview-edge)",fontSize:"0.875rem",color:"var(--graview-warn)"},children:x.map(b=>b.message).join(" \xB7 ")}):null]})},c=r=>{let l=r.node;if(!l)return null;let{store:y}=V(),k=a?.computed?lt(y.schema,y.graph,l):l,h=Re(k,a,{limit:3,said:[$(a,l)],glance:!0}),w=Ae(t),S=h.filter(N=>!N.long&&!N.markdown),x=h.find(N=>N.long||N.markdown),b=ot(l,a);return(0,s.jsxs)(U,{title:$(a,l),selected:r.selected,tone:r.flagged?.includes(l.id)?"warning":"muted",fit:!0,children:[b?(0,s.jsx)(ve,{as:"thumb",file:b,size:64,style:{marginBottom:6}}):null,(0,s.jsx)(it,{items:S.map(N=>({id:N.key,label:N.alone,hue:w})),max:3}),x?(0,s.jsx)("p",{"data-graview-excerpt":x.key,title:x.value,style:{margin:S.length>0?"6px 0 0":0,fontSize:"0.8125rem",lineHeight:1.35,color:"var(--graview-ink-muted)",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:x.value}):null]})},u=r=>{let l=r.node,y=Ae(t),k=we().marks.flag;if(!l)return null;let h=r.flagged?.includes(l.id)??!1;return(0,s.jsx)(X,{label:h?`${$(a,l)} ${k}`:$(a,l),hue:y,selected:r.selected,title:h?`${ee(H(a,String(t)))} \u2014 implicated in a problem`:ee(H(a,String(t)))})},m=r=>r.fidelity==="full"?(0,s.jsx)(P.Suspense,{fallback:(0,s.jsx)(d,{...r}),children:(0,s.jsx)(qt,{kind:String(t),members:r.nodes??[],...r.flagged?{flagged:r.flagged}:{},...r.label?{label:r.label}:{},...r.retired?{retired:r.retired}:{}})}):(0,s.jsx)(d,{...r}),d=r=>{let{brand:l,store:y,views:k}=V(),{view:h,go:w}=Ne(),S=r.nodes??[],x=k.lookup(String(t),{cardinality:"one",fidelity:"glyph"}),b=x!==void 0&&!pe(x)?x:void 0,N=mt(h),C=ut(S,N,{schema:e,graph:y.graph,flagged:new Set(r.flagged??[])}),L=R=>({id:R.id,label:$(e.tryDefinition(R.kind),R),hue:te(R.kind,l?.accents)}),W=r.fidelity==="full"&&S.length>1?(0,s.jsx)(P.Suspense,{fallback:null,children:(0,s.jsx)(_t,{schema:e,graph:y.graph,kind:String(t),arrangement:N,onChange:R=>w(ht(h,R)),kept:{shown:C.nodes.length,of:S.length},style:{marginBottom:8}})}):null,se=R=>R.some(A=>r.flagged?.includes(A.id)),le=he(),Y=we().marks.flag,z=(R,A,de)=>b?(0,s.jsx)(U,{title:R,meta:(0,s.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[(0,s.jsx)(be,{kind:String(t),plural:o,problems:Se(le,A),flag:Y}),(0,s.jsx)("span",{title:`${Q(A.length)} ${A.length===1?H(a,String(t)):o.toLowerCase()}`,children:Q(A.length)})]}),tone:se(A)?"warning":"muted",children:(0,s.jsx)(Qt,{View:b,members:A,mode:r.mode,...r.flagged?{flagged:r.flagged}:{}})},de):(0,s.jsx)(rt,{label:R,count:A.length,flagged:se(A),items:A.map(L),problems:(0,s.jsx)(be,{kind:String(t),plural:o,problems:Se(le,A),flag:Y})},de);return C.grouped?(0,s.jsxs)("div",{style:{display:"grid",gap:8},"data-graview-grouped":N.group?.by,children:[W,C.groups.map(R=>z(`${r.label??o} \xB7 ${R.label}`,R.nodes,R.key||"-"))]}):(0,s.jsxs)("div",{style:{display:"grid",gap:4},children:[W,z(r.label??o,C.nodes)]})},f=r=>{let l=r.nodes??[],y=Xt(l.map(p=>$(a,p)),r.openedRows??dt(l.length)),k=Ae(t),{brand:h}=V(),w=tt(String(t),e,h),S=we().marks.flag,{selection:x,set:b,clear:N}=xe(),{toggle:C,view:L,go:W}=Ne(),{views:se,hiddenKinds:le}=V(),Y=(0,P.useContext)(Qe),z=L.overview&&!le.has(String(t))?se.places().filter(p=>p.kind===String(t)):[],R=r.focused?L.within?.view??z[0]?.as:void 0,A=l.filter(p=>r.flagged?.includes(p.id)).length,de=A>0,Ot=he(),Ht=Se(Ot,l),F=(L.overview??!1)&&r.nestedUnder===void 0,G=r.focused||r.raised,He=r.rank==="secondary"&&!G,M=r.nestedUnder!==void 0,Ie=new Set(x),K=Y?x.length===1&&x[0]===ne(String(t)):r.opened??!1,It=ct(),O=G||F?0:l.filter(p=>It.includes(p.id)&&!Ie.has(p.id)).length,ke=O>0&&!de,ce=Ze(),_=ce&&!M?ce.byKind[String(t)]??0:0,We=(0,P.useRef)(null),ze=(0,P.useRef)(null);(0,P.useLayoutEffect)(()=>{let p=ze.current,D=We.current;if(!p||!D||!F)return;let T=()=>D.style.setProperty("--graview-plate-h",`${p.offsetHeight}px`);if(T(),typeof ResizeObserver>"u")return;let Z=new ResizeObserver(T);return Z.observe(p,{box:"border-box"}),()=>Z.disconnect()},[F]);let Wt=M?8:Math.min(46,10+Math.round(Math.sqrt(l.length)*8)),Fe=M?(0,s.jsx)("span",{style:{fontSize:"0.75rem",lineHeight:1.25,letterSpacing:"0.05em",textTransform:"uppercase",color:G?"var(--graview-accent)":"var(--graview-ink-muted)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r.label??o}):(0,s.jsx)(nn,{text:r.label??o,accent:!!G});return(0,s.jsxs)("div",{ref:We,className:"graview-kind-card","data-graview-rank":r.rank,"data-graview-landmark":w||void 0,"data-graview-nested":M||void 0,"data-graview-tied":O||void 0,"data-graview-hits":ce&&!M?_:void 0,"data-graview-emphasis":ce&&!M?_>0?"lit":"dimmed":void 0,...a?.description||M?{title:M?[r.label??o,a?.description].filter(Boolean).join(" \u2014 "):a.description}:{},style:{position:"relative",height:"100%","--graview-hue":Math.round(k)},children:[w?(0,s.jsx)("span",{className:"graview-kind-block graview-kind-landmark","data-graview-opened":r.opened||void 0,"aria-hidden":"true",style:{"--graview-rise":Wt},children:(0,s.jsx)(ae,{kind:String(t),schema:e,...h?{brand:h}:{},size:96})}):null,(0,s.jsxs)("div",{ref:ze,className:"graview-kind-face","data-graview-opened":r.opened||void 0,"data-graview-nameplate":F?r.nameplate??"full":void 0,style:{display:"flex",flexDirection:"column",gap:M?1:3,padding:M?"5px 7px":"7px 10px",borderRadius:"var(--graview-radius-sm, 9px)",justifyContent:"center",position:"relative",height:"100%",overflow:"hidden",boxSizing:"border-box",border:G?"1px solid var(--graview-accent)":O>0?"1px solid var(--graview-accent-dim)":`1px solid hsl(${Math.round(k)} 55% var(--graview-tint-lightness) / 0.34)`,backgroundColor:"var(--graview-panel)",backgroundImage:`linear-gradient(hsl(${Math.round(k)} 55% var(--graview-tint-lightness) / calc(var(--graview-tint-alpha) * ${G?1.1:He?.28:.5})), hsl(${Math.round(k)} 55% var(--graview-tint-lightness) / calc(var(--graview-tint-alpha) * ${G?1.1:He?.28:.5})))`,boxShadow:G?"0 0 0 1px var(--graview-accent-dim)":void 0},children:[!M&&!F&&l.length>0?(0,s.jsx)("div",{"data-graview-tally":l.length,"data-graview-broken":A||void 0,"aria-hidden":"true",style:{position:"absolute",left:0,right:0,top:0,display:"flex",height:3,background:`hsl(${Math.round(k)} 55% var(--graview-tint-lightness) / 0.4)`},children:A>0?(0,s.jsx)("span",{style:{width:`${Math.max(6,Math.round(A/l.length*100))}%`,background:"var(--graview-warn)"}}):null}):null,w?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:M?4:6},children:[(0,s.jsx)(ae,{kind:String(t),schema:e,...h?{brand:h}:{},size:M?14:18}),Fe]}):Fe,(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:5,fontSize:"0.875rem"},children:[(0,s.jsx)("span",{title:l.length>0?`${Q(l.length)} ${l.length===1?H(a,String(t)):o.toLowerCase()}`:void 0,style:{fontVariantNumeric:"tabular-nums",color:ke?"var(--graview-accent)":"var(--graview-ink-faint)"},children:l.length===0?"none yet":ke?O===l.length?`${O} tied`:`${O} of ${l.length} tied`:Q(l.length)}),(0,s.jsx)(be,{kind:String(t),plural:o,problems:Ht,flag:S,listed:K}),(r.retired??0)>0?(0,s.jsxs)("button",{type:"button",className:"graview-kind-past","data-graview-retired":r.retired,title:`${r.retired} retired ${o.toLowerCase()} \u2014 press to widen the view to the past`,onClick:p=>{p.stopPropagation(),W(pt(L,!0))},onDoubleClick:p=>p.stopPropagation(),onPointerDown:p=>p.stopPropagation(),children:["+",r.retired," past"]}):null,_>0?(0,s.jsxs)("button",{type:"button",className:"graview-kind-hits","data-testid":`hits-${String(t)}`,title:`${_} ${_===1?"match":"matches"} for \u201C${L.q??""}\u201D \u2014 press to go in, narrowed`,onClick:p=>{p.stopPropagation(),W(Xe(L,ne(String(t)),{ownPicture:!0,...L.q?{carry:L.q}:{}}))},onDoubleClick:p=>p.stopPropagation(),onPointerDown:p=>p.stopPropagation(),children:[_," match"]}):null,O>0&&!ke?(0,s.jsxs)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-accent)"},children:[O," tied"]}):null,r.hasOwnView&&!F?(0,s.jsx)("span",{title:`${o} has a view of its own`,"aria-label":"has its own view",style:{fontSize:"0.6875rem",color:"var(--graview-accent)"},children:"\u25C6"}):null,!M&&l.length>0&&!r.focused?(0,s.jsxs)("button",{type:"button",className:"graview-kind-open","data-testid":`open-${String(t)}`,"aria-expanded":K,"aria-label":K?`Close up the ${o}`:`See the ${o} in here`,title:K?"Close it up":`See the ${o} in here`,onClick:p=>{p.stopPropagation(),Y?K?N():b([ne(String(t))]):C(ne(String(t)))},onDoubleClick:p=>p.stopPropagation(),onPointerDown:p=>p.stopPropagation(),children:[(0,s.jsx)("span",{className:"graview-kind-open-word",children:K?"close":"open"})," ",(0,s.jsx)("span",{"aria-hidden":"true",children:K?"\u25B4":"\u25BE"})]}):null]}),F&&r.states?(0,s.jsx)(P.Suspense,{fallback:null,children:(0,s.jsx)(tn,{states:r.states,definition:a})}):null,r.opened?(0,s.jsxs)("div",{className:"graview-kind-members","data-graview-buildings":r.plot?.side??1,style:{display:"grid",gridTemplateColumns:`repeat(${y.columns}, minmax(0, 1fr))`,gap:3},children:[l.slice(0,y.shown).map(p=>{let D=r.flagged?.includes(p.id)??!1,T=$(a,p);return(0,s.jsx)(X,{pickId:p.id,label:D?`${T} ${S}`:T,title:D?`${T} \u2014 implicated in a problem`:void 0,hue:k,selected:Ie.has(p.id)},p.id)}),l.length>y.shown?(0,s.jsxs)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",padding:"2px 4px",gridColumn:"1 / -1"},children:["+",l.length-y.shown," more \u2014 double-click to go in"]}):null]}):null]}),!M&&z.length>0?(0,s.jsx)("div",{className:"graview-drive-in","data-testid":`drive-in-${String(t)}`,"data-graview-showing":R,onPointerDown:p=>p.stopPropagation(),onDoubleClick:p=>p.stopPropagation(),children:(0,s.jsx)("div",{className:"graview-drive-in-marquee",role:"group","aria-label":`${o}: pictures`,"data-graview-thumbs":z.length===1?"one":"two",children:z.map(p=>{let D=R===p.as;return(0,s.jsxs)("div",{className:"graview-drive-in-thumb","data-graview-pressed":D||void 0,children:[(0,s.jsx)("span",{className:"graview-drive-in-thumb-title","aria-hidden":"true",children:p.title}),(0,s.jsx)("button",{type:"button",className:"graview-drive-in-thumb-press","data-testid":`showing-${p.as}`,"aria-label":`${o}: ${p.title}`,"aria-pressed":D,title:D?`${p.title} is showing \u2014 press again to open it`:`Show ${p.title} on the billboard \u2014 double-click to open it`,onClick:T=>{T.stopPropagation();let Z=()=>W(Je(L,String(t),p.as));if(T.detail>=2||D&&r.focused){Z();return}W(_e(je(qe(L,!0),Ue(String(t))),"view",p.as)),T.detail===1&&Zt(T.currentTarget.ownerDocument,Ct(T.nativeEvent),Z)}})]},p.as)})})}):null]})};m.generic=!0,f.generic=!0,n.register(t,{cardinality:"one",fidelity:"full"},j(g)).register(t,{cardinality:"one",fidelity:"summary"},j(c)).register(t,{cardinality:"one",fidelity:"glyph"},j(u)).register(t,{cardinality:"many",fidelity:"full"},j(m)).register(t,{cardinality:"many",fidelity:"summary"},j(m)).register(t,{cardinality:"many",fidelity:"glyph"},j(f))}return n}var Me=E(I(),1),$t=new WeakMap;function an(e){let n=$t.get(e);return n||$t.set(e,n=At(e,me(e))),n}var Ve=et;function Vt(){return(0,$e.useContext)(Ve)}function jn({children:e}){return(0,Me.jsx)(Ve.Provider,{value:!0,children:e})}function Mt(e){let n=(0,$e.useContext)(Ve),{store:t}=V();if(n)return null;let a=e.kind??e.node?.kind??e.nodes?.[0]?.kind;if(!a)return null;let o=an(t.schema).lookup(a,{cardinality:e.cardinality,fidelity:e.fidelity});return o?(0,Me.jsx)(o,{...e}):null}var i=E(I(),1),Tt=(0,v.createContext)(null),Et=(e,n)=>e.trim().toLowerCase().replace(/[_-]+/g," ")===n.trim().toLowerCase().replace(/[_-]+/g," "),rn=(0,v.createContext)(null),Be=(0,v.createContext)(null);function Lt({block:e}){let n=(0,v.useContext)(Be),t=n?.slots?.[e.key],a=(0,i.jsx)(on,{block:e});return t?(0,i.jsx)(v.Suspense,{fallback:a,children:(0,i.jsx)(t,{block:e,node:n.node,drawn:a})}):a}function on({block:e}){let n=(0,v.useContext)(Tt),t=(0,v.useContext)(ln),a=(0,v.useContext)(Te),o=(0,v.useContext)(Pe);if(n&&e.t==="badge"&&n.values.some(g=>Et(g,e.text))||n&&e.t==="field"&&n.field!==void 0&&e.field===n.field||e.t==="badge"&&/^0(?:\s+\p{L}+)?$/u.test(e.text.trim()))return null;switch(e.t){case"title":return(0,i.jsx)("strong",{className:"graview-spec-title",...o!==null&&Et(o,e.text)?{"aria-hidden":!0}:{},children:e.text});case"text":return e.markdown||Ce(e.text)?(0,i.jsx)("div",{className:"graview-spec-text",...e.tone?{"data-graview-tone":e.tone}:{},children:(0,i.jsx)(ft,{text:e.text,markdown:e.markdown})}):(0,i.jsx)("p",{className:"graview-spec-text",...e.tone?{"data-graview-tone":e.tone}:{},children:e.text});case"badge":return(0,i.jsx)("span",{className:"graview-spec-badge","data-graview-tone":e.tone,children:e.text});case"field":return(0,i.jsxs)("span",{className:"graview-spec-field","data-graview-field":e.field,children:[(0,i.jsx)("span",{className:"graview-spec-label",children:e.label}),(0,i.jsx)("span",{className:"graview-spec-value",...Ce(e.text)?{style:{whiteSpace:"pre-line"}}:{},children:e.linked?(0,i.jsx)(gt,{relation:e.linked.relation,refs:e.linked.refs,as:"chip"}):e.app?(0,i.jsx)(yt,{address:e.app}):e.href?(0,i.jsx)("a",{className:"graview-spec-link",href:e.href,...e.href.startsWith("tel:")?{}:{rel:"noopener noreferrer",target:"_blank"},children:e.text}):e.text})]});case"image":return(0,i.jsx)(ve,{as:"block",field:e.field,files:e.files,label:e.label,view:e.as});case"progress":return e.value===void 0||e.max===void 0?(0,i.jsxs)("span",{className:"graview-spec-progress",children:[(0,i.jsx)("span",{className:"graview-spec-label",children:e.label}),(0,i.jsx)("span",{className:"graview-spec-value",children:e.text})]}):(0,i.jsxs)("span",{className:"graview-spec-progress",children:[(0,i.jsx)("span",{className:"graview-spec-label",children:e.label}),(0,i.jsx)("span",{className:"graview-spec-track",role:"progressbar","aria-label":e.label,"aria-valuemin":0,"aria-valuemax":e.max,"aria-valuenow":Math.max(0,Math.min(e.value,e.max)),"aria-valuetext":e.text,children:(0,i.jsx)("span",{className:"graview-spec-fill",style:{width:`${Math.round(Math.max(0,Math.min(e.value,e.max))/e.max*100)}%`}})}),(0,i.jsx)("span",{className:"graview-spec-value",children:e.text})]});case"group":return(0,i.jsx)("span",{className:"graview-spec-group","data-direction":e.direction,children:(0,i.jsx)(Ee,{blocks:e.blocks})});case"when":return e.shown?(0,i.jsx)(Ee,{blocks:e.blocks}):null;case"divider":return(0,i.jsx)("hr",{className:"graview-spec-divider"});case"figure":return(0,i.jsx)(sn,{});case"headline":{let g=`h${Math.min(6,e.level+t)}`,c=(0,i.jsx)(g,{className:"graview-spec-headline","data-level":e.level,children:e.text});return a!==null&&e.level===1?(0,i.jsxs)(i.Fragment,{children:[c,a]}):c}case"number":return(0,i.jsxs)("span",{className:"graview-spec-number",...e.emphasis?{"data-emphasis":e.emphasis}:{},children:[(0,i.jsx)("span",{className:"graview-spec-number-value",children:e.text}),e.label?(0,i.jsx)("span",{className:"graview-spec-label",children:e.label}):null]});case"list":return(0,i.jsx)(cn,{list:e})}}function sn(){let e=(0,v.useContext)(Be)?.figure;return e?(0,i.jsx)("span",{className:"graview-spec-figure","aria-hidden":"true",children:e()}):null}function Ee({blocks:e}){let n=[];for(let t=0;t<e.length;t++){let a=t;for(;e[a]?.t==="badge"&&e[a+1]?.t==="badge";)a++;if(a===t){n.push((0,i.jsx)(Lt,{block:e[t]},t));continue}n.push((0,i.jsx)("span",{className:"graview-spec-badges",children:e.slice(t,a+1).map((o,g)=>(0,i.jsx)(Lt,{block:o},g))},t)),t=a}return n}function Dt({blocks:e,ctx:n,view:t}){let a=(0,v.useContext)(rn)?.[t];return(0,i.jsx)(Be.Provider,{value:{figure:n.figure,slots:a,node:n.node},children:(0,i.jsx)(Ee,{blocks:e})})}function Ge({blocks:e,ctx:n,view:t}){return(0,i.jsx)(Dt,{blocks:J(e,n),ctx:n,view:t})}var Le=3,Bt=(0,v.createContext)(0),Gt=(0,v.createContext)(null),ln=(0,v.createContext)(0),Te=(0,v.createContext)(null);function dn({node:e,as:n,depth:t,said:a=null}){let{store:o,views:g}=V(),c=$(o.schema.tryDefinition(e.kind),e),u=g.lookup(e.kind,{cardinality:"one",fidelity:n==="card"?"summary":"glyph"});return n==="row"&&t<=Le&&(!u||pe(u))?(0,i.jsxs)("li",{className:"graview-spec-item","data-graview-listed":e.id,"data-as":n,children:[(0,i.jsx)(De,{node:e,label:c}),(0,i.jsx)("div",{className:"graview-spec graview-spec-row","data-graview-spec":"row","data-graview-kind":e.kind,"aria-hidden":"true",children:(0,i.jsx)("strong",{className:"graview-spec-title",children:c})})]}):(0,i.jsxs)("li",{className:"graview-spec-item","data-graview-listed":e.id,"data-as":n,children:[(0,i.jsx)(De,{node:e,label:c}),t<=Le&&u?(0,i.jsx)(Ye,{mode:"scene",children:(0,i.jsx)(Bt.Provider,{value:t,children:(0,i.jsx)(Tt.Provider,{value:a,children:(0,i.jsx)(Pe.Provider,{value:c,children:(0,i.jsx)(u,{node:e,cardinality:"one",fidelity:n==="card"?"summary":"glyph",mode:"scene",selected:!1})})})})}):(0,i.jsx)("span",{className:"graview-spec-item-name","aria-hidden":"true",children:c})]})}function De({node:e,label:n}){let t=(0,v.useContext)(Gt),a=(0,v.useRef)(null);return bt(a),t?(0,i.jsx)("a",{ref:a,className:"graview-spec-item-link",href:t.href(e),"aria-label":n,onClick:o=>{o.metaKey||o.ctrlKey||o.shiftKey||o.button!==0||(o.preventDefault(),o.stopPropagation(),t.go(e))}}):(0,i.jsx)("button",{ref:a,type:"button",className:"graview-spec-item-link","data-graview-pick":e.id,"aria-label":n})}function cn({list:e}){let n=(0,v.useContext)(Bt)+1,{store:t}=V(),a=(0,v.useContext)(Gt),[o,g]=(0,v.useState)(e.members.length);if(e.failed)return(0,i.jsx)("p",{className:"graview-spec-text",children:"\u2014"});if(e.members.length===0)return e.empty?(0,i.jsx)("p",{className:"graview-spec-text graview-spec-empty",children:e.empty}):null;let c=(b,N=null)=>n>Le?(0,i.jsx)("ul",{className:"graview-spec-list","data-as":"names",children:b.map(C=>(0,i.jsxs)("li",{className:"graview-spec-item","data-graview-listed":C.id,"data-as":"name",children:[(0,i.jsx)(De,{node:C,label:$(t.schema.tryDefinition(C.kind),C)}),(0,i.jsx)("span",{className:"graview-spec-item-name","aria-hidden":"true",children:$(t.schema.tryDefinition(C.kind),C)})]},C.id))}):(0,i.jsx)("ul",{className:"graview-spec-list","data-as":e.as,children:b.map(C=>(0,i.jsx)(dn,{node:C,as:e.as,depth:n,said:N},C.id))}),u=e.rest??[],m=Math.min(o,e.members.length+u.length),d=m>e.members.length?[...e.members,...u].slice(0,m):e.members,f=e.members.length+u.length-m,r=Math.max(1,e.members.length),l=f>0?(0,i.jsx)("p",{className:"graview-spec-text graview-spec-more",children:(0,i.jsx)("button",{type:"button",className:"graview-spec-show-more","data-graview-show-more":f,onClick:()=>g(m+r),children:`Show ${Math.min(r,f)} more`})}):null,y=e.total??e.members.length+e.more,k=e.more-u.length,h=l??(a?.more&&y>d.length?a.more({members:d,total:y}):k>0?(0,i.jsx)("p",{className:"graview-spec-text graview-spec-more",children:`and ${k} more`}):null);if(!e.groups)return(0,i.jsxs)("div",{className:"graview-spec-listing",children:[c(d),h]});let w=`h${e.headingLevel}`,S=m,x=m>e.members.length&&e.everyGroup?e.everyGroup.flatMap(b=>{if(S<=0)return[];let N=b.members.slice(0,S);return S-=N.length,[{...b,members:N}]}):e.groups;return(0,i.jsxs)("div",{className:"graview-spec-listing",children:[x.map(b=>(0,i.jsxs)("section",{className:"graview-spec-list-group","data-graview-group":b.value??"",children:[b.heading?(0,i.jsx)(w,{className:"graview-spec-list-heading",children:b.heading}):null,c(b.members,b.value!==null?{values:[b.value,...b.heading?[b.heading]:[]]}:null)]},b.value??"")),h]})}function sa({blocks:e,heading:n=2,firstHeading:t,slot:a,view:o=a}){let{store:g,brand:c}=V();ue();let u=re(g,null,null,{heading:n,firstHeading:t,money:c}),m=(0,v.useContext)(Te),d=e.some(f=>f.t==="headline");return(0,i.jsxs)("div",{className:`graview-spec graview-spec-${a}`,"data-graview-spec":a,children:[m!==null&&!d?m:null,(0,i.jsx)(Te.Provider,{value:d?m:null,children:(0,i.jsx)(Ge,{blocks:e,ctx:u,view:o})})]})}function Oe(e,n="card"){let{store:t,brand:a}=V(),o=t.schema;return{...re(t,null,e,{slot:n,money:a}),figure:()=>(0,i.jsx)(ae,{kind:e.kind,schema:o,...a?{brand:a}:{},size:22})}}function gn({slot:e,blocks:n,node:t,selected:a}){let o=Oe(t,e);return(0,i.jsx)("div",{className:`graview-spec graview-spec-${e}`,"data-graview-spec":e,"data-graview-kind":t.kind,...e==="row"&&n.some(st)?{"data-graview-tall":""}:{},...a?{"data-selected":""}:{},children:(0,i.jsx)(Ge,{blocks:n,ctx:o,view:`${t.kind}.${e}`})})}function un({blocks:e,node:n,selected:t,flagged:a}){let o=Oe(n),[g,...c]=e,u=g?.t==="title";return(0,i.jsx)(U,{...u?{title:J([g],o)[0].text}:{},selected:t,tone:a?"warning":"muted",fit:!0,children:(0,i.jsx)("div",{className:"graview-spec graview-spec-card","data-graview-spec":"card","data-graview-kind":n.kind,children:(0,i.jsx)(Ge,{blocks:u?c:e,ctx:o,view:`${n.kind}.card`})})})}function pn({blocks:e,props:n}){let t=n.node,a=Oe(t,"page"),o=Vt(),g=J(e,a),c=ye(e,g),u=c.title!==void 0&&(!o||c.title===$(a.schema?.tryDefinition(t.kind),t)),m=(0,i.jsx)("div",{className:"graview-spec graview-spec-page","data-graview-spec":"page","data-graview-kind":t.kind,children:(0,i.jsx)(Dt,{blocks:u?g.slice(1):g,ctx:a,view:`${t.kind}.page`})});return o?m:(0,i.jsx)(oe.Provider,{value:{nodeId:t.id,...c.title!==void 0?{title:c.title}:{},body:m,fields:c.fields,records:c.records},children:(0,i.jsx)(Mt,{...n})})}function la(e,n,t){return typeof e=="function"?e.says?.(n,t):void 0}function mn({blocks:e,node:n,selected:t}){let{store:a}=V();return(0,i.jsx)("div",{title:$(a.schema.tryDefinition(n.kind),n),style:{minWidth:0,maxWidth:"100%"},children:(0,i.jsx)(gn,{slot:"row",blocks:e,node:n,selected:t})})}function da(e,n,t){if(!t)return e;let a=new Set(n.kinds);for(let[o,g]of Object.entries(t)){if(!a.has(o)||!g)continue;let c=o;if(g.card){let u=ie(g.card),m=d=>d.node?(0,i.jsx)(un,{blocks:u,node:d.node,selected:d.selected,flagged:d.flagged?.includes(d.node.id)??!1}):null;e.register(c,{cardinality:"one",fidelity:"summary"},m)}if(g.row){let u=ie(g.row),m=d=>d.node?(0,i.jsx)(mn,{blocks:u,node:d.node,selected:d.selected}):null;m.says=(d,f)=>ye(u,J(u,re({graph:f,schema:n},null,d,{slot:"row"}))),e.register(c,{cardinality:"one",fidelity:"glyph"},m)}if(g.page){let u=ie(g.page),m=d=>d.node?(0,i.jsx)(pn,{blocks:u,props:d}):null;m.says=(d,f)=>ye(u,J(u,re({graph:f,schema:n},null,d))),e.register(c,{cardinality:"one",fidelity:"full"},m)}}return e}export{bt as a,jn as b,Tt as c,Gt as d,ln as e,Te as f,De as g,sa as h,la as i,da as j,At as k};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as c}from"./chunk.QEALNWWL.js";import"./chunk.FERBNBDE.js";import"./chunk.YNE5QR7Q.js";import"./chunk.UGFDSE37.js";import{j as m}from"./chunk.GOCUBIRW.js";import"./chunk.6QDFBCV4.js";import"./chunk.4STIUIT6.js";import"./chunk.WHTQHU3M.js";import"./chunk.KU6NIMQX.js";import"./chunk.Y3IJDWNS.js";import"./chunk.OFJH7LDC.js";import"./chunk.5PU3RWYY.js";import"./chunk.27TLAVRR.js";import"./chunk.OREMUXB5.js";import"./chunk.ZDNJK2SX.js";import"./chunk.ZSSOTIFL.js";import"./chunk.7YQYWOZR.js";import"./chunk.3PT55HXT.js";import"./chunk.QDHUDLJB.js";import"./chunk.ZVMIHXVK.js";import"./chunk.CUCNT7MG.js";import"./chunk.2A2DLMT3.js";import"./chunk.E77K6KBX.js";import"./chunk.UT6642FC.js";import"./chunk.MB7LKKUD.js";import"./chunk.WVUJXDXZ.js";import"./chunk.VHWUGSFW.js";import"./chunk.P75TPZWT.js";import"./chunk.6W7J76TK.js";import"./chunk.FUR4IHWG.js";import"./chunk.2B4WVCVV.js";import"./chunk.AAZFVCSP.js";import"./chunk.GZHZLJBF.js";import"./chunk.PWOVXARZ.js";import"./chunk.SG23JC6D.js";import"./chunk.OJGHDWI6.js";import"./chunk.GZLYTPE7.js";import"./chunk.4B73P2WA.js";import"./chunk.IMRCAU4T.js";import"./chunk.BZ5VLPKB.js";import{F as S,Q as g}from"./chunk.6II4BONS.js";import{Wc as n}from"./chunk.F5BCCGFK.js";import{b as t}from"./chunk.AJZBJBMO.js";var y=t(S(),1),a=t(g(),1);function E({store:h,auto:f,brand:i,views:u,presence:r,steering:o,overview:s,scope:d,titleLevel:v=2,quickAsk:l,props:e}){let b=(0,y.useMemo)(()=>m({scope:`.${d}`}),[d]);return(0,a.jsxs)("div",{"data-embed-content":"",style:f?{flex:"0 0 auto",background:"var(--graview-ground)"}:{flex:"1 1 auto",minHeight:0,overflow:"auto",background:"var(--graview-ground)"},children:[(0,a.jsx)("style",{children:b}),(0,a.jsx)("div",{"data-embed-measure":"",style:{display:"flow-root"},children:(0,a.jsx)(c,{context:{store:h,embedded:!0,...e.bar!==!1?{barAbove:!0}:{},...s?{overview:s}:{},titleLevel:v,views:u,settings:e.app.settings??[],...r?{presence:r}:{},...i?{brand:i}:{},...e.locale?{locale:e.locale}:{},...e.principal?{principal:e.principal}:{},...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{},...e.subscriptions?{subscriptions:e.subscriptions}:{},...e.signIn?{signIn:e.signIn}:{},...l!==void 0?{quickAsk:l}:{}},...e.pages?{registry:e.pages}:{},...o?{steering:o}:{},...e.routing==="address"?n(e.basePath)===""?{}:{basename:n(e.basePath)}:{initialPath:e.path??"/"},...e.path!==void 0?{path:e.path}:{},...e.onNavigate?{onNavigate:e.onNavigate}:{}})})]})}export{E as PagesContent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk.WVUJXDXZ.js";import{a as v,b as ie}from"./chunk.VHWUGSFW.js";import"./chunk.P75TPZWT.js";import"./chunk.6W7J76TK.js";import"./chunk.FUR4IHWG.js";import"./chunk.2B4WVCVV.js";import"./chunk.AAZFVCSP.js";import"./chunk.GZHZLJBF.js";import{n as le}from"./chunk.PWOVXARZ.js";import"./chunk.SG23JC6D.js";import"./chunk.OJGHDWI6.js";import"./chunk.GZLYTPE7.js";import"./chunk.4B73P2WA.js";import"./chunk.IMRCAU4T.js";import"./chunk.BZ5VLPKB.js";import{$ as re,F as xe,L as x,N as te,Q as ne,Y as ae}from"./chunk.6II4BONS.js";import{ca as X,fa as I,fc as ee,ha as Z,ia as F,ja as N}from"./chunk.F5BCCGFK.js";import{b as _}from"./chunk.AJZBJBMO.js";var g=_(xe(),1);async function oe(e,n){let r=await createImageBitmap(e);try{let a=Math.min(1,n/Math.max(r.width,r.height)),s=document.createElement("canvas");s.width=Math.max(1,Math.round(r.width*a)),s.height=Math.max(1,Math.round(r.height*a));let l=s.getContext("2d");if(l===null)throw new Error("This browser will not give us a canvas to resize with.");return l.drawImage(r,0,0,s.width,s.height),s}finally{r.close()}}var t=_(ne(),1),Se=2048,Ce=.85;function V(e){return e<1e3?`${e} bytes`:e<1e6?`${Math.round(e/1e3)} KB`:`${(e/1e6).toFixed(e<1e7?1:0)} MB`}function G(e){if(e.type==="application/pdf")return"PDF";let n=/\.([a-z0-9]{2,5})$/i.exec(e.name??"")?.[1];return n?n.toUpperCase():(e.type.split("/")[1]??e.type).replace(/^x-|^vnd\./,"").split(/[.+-]/)[0].toUpperCase()}function pe(e){let n=[...new Set(e.map(r=>r==="image/*"?"pictures":r==="*/*"||r==="*"?"any file":`${G({type:r})} files`))];return n.length<=1?n[0]??"no files":`${n.slice(0,-1).join(", ")} and ${n[n.length-1]}`}function me(e,n){if(e.length===0)return!0;let r=`${n.split("/")[0]}/*`;return e.some(a=>a==="*"||a==="*/*"||a===n||a===r)}var se=/^image\/hei[cf]$|\.hei[cf]$/i,de=e=>se.test(e.type)||se.test(e.name);async function Ee(e,n,r){let a=e.name||(r.camera?"photo.jpg":"file"),s=e.type||(de({type:"",name:a})?"image/heic":"application/octet-stream"),l=de({type:s,name:a}),d=s.startsWith("image/")||l;if(r.image&&!d)return{refused:`\u201C${a}\u201D isn\u2019t a picture.`};if(l||d&&/^image\/(jpeg|webp)$/.test(s)&&(r.camera||e.size>n.maxBytes||e.size>15e5))try{let u=await oe(e,Se),h=await new Promise(o=>u.toBlob(o,"image/jpeg",Ce));if(h)return ue({blob:h,name:l?a.replace(/\.hei[cf]$/i,"")+".jpg":a,type:"image/jpeg",width:u.width,height:u.height},n)}catch{if(l&&!me(n.kinds,s))return{refused:`\u201C${a}\u201D is a HEIC photo, which this browser can\u2019t turn into a JPEG and this host doesn\u2019t take. Save it as a JPEG and try again.`}}let p={};if(d&&!l)try{let u=await createImageBitmap(e);p={width:u.width,height:u.height},u.close()}catch{}return ue({blob:e,name:a,type:s,...p},n)}function ue(e,n){return me(n.kinds,e.type)?e.blob.size>n.maxBytes?{refused:`\u201C${e.name}\u201D is ${V(e.blob.size)}; this host takes files up to ${V(n.maxBytes)}.`}:e:{refused:`\u201C${e.name}\u201D is a ${G(e)} file; this host takes ${pe(n.kinds)}.`}}async function Pe(e,n,r){let a;try{a=await n.upload(e.blob,e.name)}catch(l){let d=l instanceof Error&&l.message.trim()?l.message.trim():"the host refused it";return{refused:`\u201C${e.name}\u201D wasn\u2019t kept: ${d}`}}return Z(a)?r&&!F(a)?{refused:`\u201C${e.name}\u201D isn\u2019t a picture.`}:{...a,...a.width===void 0&&e.width?{width:e.width}:{},...a.height===void 0&&e.height?{height:e.height}:{}}:{refused:`The host\u2019s answer for \u201C${e.name}\u201D isn\u2019t a file a record can keep.`}}var $="var(--graview-radius, 8px)",P={color:"var(--graview-ink-muted)",fontSize:"0.8125rem"};function he(e){let n=x(),r=te()?.past!=null,[a,s]=(0,g.useState)(!1),l=n?.kept?Re(n,e.href):!0,[,d]=(0,g.useState)(0);return(0,g.useEffect)(()=>{if(typeof l!="object")return;let y=!0;return l.then(()=>y&&d(p=>p+1)),()=>void(y=!1)},[l]),[l===!1||r&&a,()=>s(!0)]}var O=new WeakMap;function Re(e,n){let r=O.get(e)?.get(n);if(r!==void 0)return r;let a;try{a=e.kept(n)}catch{return!0}if(typeof a=="boolean")return a;let s=O.get(e)??new Map;O.set(e,s);let l=Promise.resolve(a).then(d=>d!==!1,()=>!0);return s.set(n,l),l.then(d=>s.set(n,d)),l}function ye({file:e,style:n}){return(0,t.jsx)("span",{role:"img","aria-label":`${v(e)}, removed later`,"data-graview-removed-later":e.href,style:{display:"grid",placeItems:"center",textAlign:"center",padding:4,boxSizing:"border-box",fontSize:"0.6875rem",lineHeight:1.2,color:"var(--graview-ink-muted)",border:"1px dashed var(--graview-edge-bright)",borderRadius:$,...n},children:"removed later"})}function A({file:e,size:n=56,style:r}){let a=x(),[s,l]=he(e);return s?(0,t.jsx)(ye,{file:e,style:{width:n,height:n,flex:"none",...r}}):(0,t.jsx)("img",{onError:l,src:I(a,e.href),alt:v(e),width:n,height:n,loading:"lazy",decoding:"async","data-graview-thumb":e.href,style:{width:n,height:n,objectFit:"cover",borderRadius:$,display:"block",flex:"none",background:"var(--graview-edge)",...r}})}function We({file:e,onOpen:n}){let r=x(),[a,s]=he(e);return a?(0,t.jsx)(ye,{file:e,style:{width:"100%",aspectRatio:"1"}}):(0,t.jsx)("button",{type:"button","aria-label":`Open ${v(e)} full size`,onClick:l=>n(l.currentTarget),style:{padding:0,border:0,background:"none",cursor:"zoom-in",display:"block",width:"100%",borderRadius:$},children:(0,t.jsx)("img",{src:I(r,e.href),alt:v(e),loading:"lazy",decoding:"async",onError:s,style:{width:"100%",aspectRatio:"1",objectFit:"cover",borderRadius:$,display:"block",background:"var(--graview-edge)"}})})}function U({files:e,label:n}){let r=x(),a=o=>I(r,o.href),s=e.filter(F),l=e.filter(o=>!F(o)),[d,y]=(0,g.useState)(null),p=(0,g.useRef)(null),u=(0,g.useRef)(null);(0,g.useEffect)(()=>{let o=p.current;d!==null&&o&&!o.open&&o.showModal?.()},[d]);let h=d===null?void 0:s[d];return(0,t.jsxs)("div",{style:{display:"grid",gap:10,minWidth:0},children:[s.length>0?(0,t.jsx)("ul",{"data-graview-gallery":"","aria-label":n,style:{listStyle:"none",margin:0,padding:0,display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(96px, 1fr))",gap:8},children:s.map((o,k)=>(0,t.jsx)("li",{style:{minWidth:0},children:(0,t.jsx)(We,{file:o,onOpen:S=>{u.current=S,y(k)}})},o.href))}):null,l.length>0?(0,t.jsx)("ul",{"data-graview-documents":"",style:{listStyle:"none",margin:0,padding:0,display:"grid",gap:10},children:l.map(o=>(0,t.jsxs)("li",{"data-graview-document":o.type,style:{display:"grid",gap:6,minWidth:0},children:[o.type==="application/pdf"?(0,t.jsx)("object",{data:a(o),type:"application/pdf","aria-label":v(o),style:{width:"100%",height:420,border:"1px solid var(--graview-edge)",borderRadius:$},children:(0,t.jsxs)("p",{style:{margin:0,padding:12},children:["This browser shows no PDF here: ",(0,t.jsxs)("a",{href:a(o),download:o.name,children:["download ",o.name]}),"."]})}):null,(0,t.jsxs)("span",{style:{display:"flex",flexWrap:"wrap",gap:"2px 10px",alignItems:"baseline",minWidth:0,overflowWrap:"anywhere"},children:[(0,t.jsx)("a",{href:a(o),download:o.name,...o.type==="application/pdf"?{target:"_blank",rel:"noopener"}:{},children:o.name}),(0,t.jsxs)("span",{style:P,children:[G(o)," \xB7 ",V(o.bytes)]})]}),o.caption?(0,t.jsx)("span",{style:P,children:o.caption}):null]},o.href))}):null,h?(0,t.jsx)("dialog",{ref:p,"data-graview-full":h.href,"aria-label":v(h),onClose:()=>{y(null),u.current?.focus()},onClick:o=>{o.target===o.currentTarget&&o.currentTarget.close()},style:{padding:0,border:0,borderRadius:$,maxWidth:"min(96vw, 1600px)",maxHeight:"94vh",background:"var(--graview-panel)",color:"var(--graview-ink)"},children:(0,t.jsxs)("figure",{style:{margin:0,display:"grid",gap:8,padding:10},children:[(0,t.jsx)("img",{src:a(h),alt:v(h),style:{maxWidth:"100%",maxHeight:"80vh",objectFit:"contain",display:"block",margin:"0 auto"}}),(0,t.jsxs)("figcaption",{style:{display:"flex",gap:12,alignItems:"center",justifyContent:"space-between"},children:[(0,t.jsx)("span",{children:h.caption??h.name}),(0,t.jsx)("form",{method:"dialog",style:{margin:0},children:(0,t.jsx)("button",{type:"submit",autoFocus:!0,children:"Close"})})]})]})}):null]})}function fe({value:e,onChange:n,several:r,image:a,label:s,thumbs:l=!0}){let d=x(),y=(0,g.useId)(),p=(0,g.useRef)(null),u=(0,g.useRef)(null),[h,o]=(0,g.useState)(null),[k,S]=(0,g.useState)(null),[q,R]=(0,g.useState)([]),[L,B]=(0,g.useState)(!1),C=d?a?d.kinds.filter(i=>i.startsWith("image/")||i==="*"||i==="*/*"):d.kinds:[],K=d?d.kinds.length===0||C.some(i=>i.startsWith("image/")||i.startsWith("*")):!1,W=!!d&&(!a||K),J=a?r?"pictures":"a picture":r?"files":"a file",Q=a?C.length>0?C.join(","):"image/*":d?.kinds.join(",")||void 0,ve=typeof matchMedia=="function"&&matchMedia("(pointer: coarse)").matches,z=(0,g.useRef)(e);z.current=e;let Y=(0,g.useRef)(null),T=(0,g.useRef)(null);(0,g.useEffect)(()=>{let i=T.current;if(!i||i.from===e)return;T.current=null;let c=Y.current?.children,f=c?.[Math.min(i.at,c.length-1)];((i.what==="move"?f?.querySelector("[data-graview-file-move]"):null)??f?.querySelector("[data-graview-file-remove]")??p.current?.parentElement?.querySelector("[data-graview-file-choose]"))?.focus()});let M=async(i,c)=>{if(!d||i.length===0)return;let f=r?i:i.slice(0,1),m=[],w=[];f.length<i.length&&w.push(`${s} holds one ${a?"picture":"file"}, so ${i.slice(1).map(b=>`\u201C${b.name||"the photo"}\u201D`).join(", ")} ${i.length>2?"were":"was"} left out.`),R([]),S(null);for(let b of f){o(`Sending ${b.name||"the photo"}\u2026`);let j=await Ee(b,d,{image:a,camera:c==="camera"});if("refused"in j){w.push(j.refused);continue}let E=await Pe(j,d,a);"refused"in E?w.push(E.refused):[...r?z.current:[],...m].some($e=>$e.href===E.href)?w.push(`\u201C${E.name}\u201D is already here.`):m.push(E)}if(o(null),R(w),m.length!==0)try{n(r?[...z.current,...m]:m.slice(-1)),S(`Added ${m.map(b=>b.name).join(", ")}.`)}catch(b){R([...w,b instanceof Error?b.message:String(b)])}},H=(i,c,f)=>{try{T.current=f?{...f,from:e}:null,n(i),S(c)}catch(m){T.current=null,R([m instanceof Error?m.message:String(m)])}},D=i=>i?Array.from(i):[],ke=i=>{let c=D(i.clipboardData?.files);!W||c.length===0||(i.preventDefault(),M(c,"pasted"))},Fe=i=>{B(!1),W&&(i.preventDefault(),M(D(i.dataTransfer?.files),"dropped"))};return(0,t.jsxs)("div",{role:"group","aria-labelledby":`${y}-label`,"data-graview-file-editor":"","data-graview-dropping":L?"":void 0,onPaste:ke,onDragOver:i=>{W&&(i.preventDefault(),B(!0))},onDragLeave:()=>B(!1),onDrop:Fe,style:{display:"grid",gap:8,minWidth:0,padding:L?6:0,outline:L?"2px dashed var(--graview-accent)":"none",borderRadius:$},children:[(0,t.jsx)("span",{id:`${y}-label`,style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap"},children:s}),e.length>0&&(r||e.length>1)?(0,t.jsx)("ul",{ref:Y,style:{listStyle:"none",margin:0,padding:0,display:"grid",gap:6},children:e.map((i,c)=>(0,t.jsxs)("li",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap",minWidth:0},children:[l&&F(i)?(0,t.jsx)(A,{file:i,size:40}):null,(0,t.jsx)("span",{style:{flex:"1 1 8rem",minWidth:0,overflowWrap:"anywhere"},children:i.name}),(0,t.jsx)(ge,{file:i,onCaption:f=>H(e.map((m,w)=>w===c?ce(m,f):m),f?`${i.name} now says \u201C${f}\u201D.`:`${i.name} says its name again.`)}),r&&c>0?(0,t.jsx)("button",{type:"button","data-graview-file-move":"","aria-label":`Move ${i.name} earlier`,onClick:()=>H(e.map((f,m)=>m===c-1?i:m===c?e[c-1]:f),`Moved ${i.name} earlier.`,{at:c-1,what:"move"}),children:"\u2191"}):null,r?(0,t.jsx)("button",{type:"button","data-graview-file-remove":"","aria-label":`Remove ${i.name}`,onClick:()=>H(e.filter((f,m)=>m!==c),`Removed ${i.name}.`,{at:c,what:"remove"}),children:"Remove"}):null]},`${c}:${i.href}`))}):e.length===1?(0,t.jsx)(ge,{file:e[0],onCaption:i=>H([ce(e[0],i)],i?`${e[0].name} now says \u201C${i}\u201D.`:`${e[0].name} says its name again.`)}):null,W?(0,t.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:8,alignItems:"center"},children:[(0,t.jsx)("input",{ref:p,type:"file",hidden:!0,multiple:r,...Q?{accept:Q}:{},"data-graview-file-input":"","aria-label":`Choose ${J}`,onChange:i=>{let c=D(i.currentTarget.files);i.currentTarget.value="",M(c,"picked")}}),(0,t.jsx)("button",{type:"button",disabled:h!==null,onClick:()=>p.current?.click(),"data-graview-file-choose":"",children:e.length>0&&!r?`Replace ${a?"the picture":"the file"}`:`Choose ${J}`}),K?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{ref:u,type:"file",hidden:!0,accept:"image/*",capture:"environment","data-graview-photo-input":"","aria-label":"Take a photo",onChange:i=>{let c=D(i.currentTarget.files);i.currentTarget.value="",M(c,"camera")}}),ve?(0,t.jsx)("button",{type:"button",disabled:h!==null,onClick:()=>u.current?.click(),children:"Take a photo"}):null]}):null,(0,t.jsxs)("span",{style:P,"data-graview-file-takes":"",children:["or drop or paste ",r?"them":"it"," here \xB7 ",d.kinds.length>0?pe(C.length>0?C:d.kinds):"any file",", up to ",V(d.maxBytes)]})]}):(0,t.jsx)("p",{style:{...P,margin:0},"data-graview-file-none":"",children:d?"This host doesn\u2019t take pictures, so none can be added here.":"This host doesn\u2019t take files, so none can be added here."}),(0,t.jsx)("p",{"aria-live":"polite",style:{...P,margin:0,minHeight:h||k?void 0:0},"data-graview-file-status":"",children:h??k??""}),q.length>0?(0,t.jsx)("div",{role:"alert","data-graview-file-refused":"",style:{color:"var(--graview-warn)",fontSize:"0.875rem",display:"grid",gap:2},children:q.map((i,c)=>(0,t.jsx)("p",{style:{margin:0},children:i},c))}):null]})}var ce=(e,n)=>{let{caption:r,...a}=e;return n?{...a,caption:n}:a};function ge({file:e,onCaption:n}){let[r,a]=(0,g.useState)(e.caption??"");(0,g.useEffect)(()=>a(e.caption??""),[e.caption]);let s=()=>{let l=r.trim().slice(0,500);l!==(e.caption??"")&&n(l)};return(0,t.jsx)("input",{type:"text",value:r,placeholder:F(e)?"What it shows":"What it is","aria-label":`What ${e.name} ${F(e)?"shows":"is"}`,"data-graview-file-caption":e.href,onChange:l=>a(l.target.value),onBlur:s,onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),s())},style:{flex:"1 1 10rem",minWidth:0,font:"inherit",fontSize:"0.875rem",minHeight:24}})}function be({field:e,label:n,labelStyle:r,valueStyle:a,style:s,children:l}){return(0,t.jsxs)("div",{"data-graview-files":e,style:{display:"grid",gap:6,minWidth:0,gridColumn:"1 / -1",...s},children:[(0,t.jsx)("dt",{style:r,children:n}),(0,t.jsx)("dd",{style:{margin:0,minWidth:0,display:"grid",gap:10,...a},children:l})]})}function we(e){let{nodeId:n,field:r,label:a,files:s}=e,{fields:l,commit:d}=le(n),y=l.find(o=>o.field===r&&o.takesValue),p=y?.shape,u=p?.type==="several"?p.of:p,h=p?.type==="several";return s.length===0&&u?.type!=="file"?null:(0,t.jsxs)(be,{...e,children:[(0,t.jsx)(U,{files:s,label:a}),y&&u?.type==="file"?(0,t.jsx)(fe,{value:s,thumbs:!1,several:h,image:u.image===!0,label:a,onChange:o=>{let k=h?o:o[o.length-1];k!==void 0&&d(y,k)}}):null]})}function ze(e){switch(e.as){case"field":return e.read?e.files.length>0?(0,t.jsx)(be,{...e,children:(0,t.jsx)(U,{files:e.files,label:e.label})}):null:(0,t.jsx)(we,{...e});case"unfilled":return(0,t.jsx)(Te,{...e});case"thumb":return(0,t.jsx)(A,{...e});case"block":return e.files.length>0?(0,t.jsx)("span",{className:"graview-spec-image","data-graview-field":e.field,"data-graview-image":e.view,style:{display:"block",minWidth:0,...e.view==="gallery"?{position:"relative",zIndex:ee.raised}:{}},children:e.view==="thumb"?(0,t.jsx)(A,{file:e.files[0],size:72}):(0,t.jsx)(U,{files:e.files,label:e.label})}):null;case"control":{let n=(0,t.jsx)(fe,{value:N(e.value),several:e.several,image:e.image,label:e.label,onChange:r=>e.onChange(e.several?r:r[r.length-1])});return e.title===void 0?n:(0,t.jsxs)("fieldset",{"data-graview-part":"group","data-graview-field":e.several?"files":"file",children:[(0,t.jsx)("legend",{"data-graview-part":"label",children:e.title}),n]})}}}function Te({nodeId:e,skip:n,labels:r,labelStyle:a,style:s}){let{store:l}=ae(),d=re(e),y=d?l.schema.tryDefinition(d.kind):void 0,p=ie(y).filter(u=>!n.includes(u)&&!(y?.display?.hide??[]).includes(u)&&N(d?.[u]).length===0);return p.length===0?null:(0,t.jsx)("dl",{style:{margin:0,display:"grid",gap:14,minWidth:0},children:p.map(u=>(0,t.jsx)(we,{nodeId:e,field:u,label:r?.[u]??X(y,u),files:[],...a?{labelStyle:a}:{},...s?{style:s}:{}},u))})}export{fe as FilesEditor,Se as SEND_EDGE,ze as drawFiles,pe as kindsWords,Ee as prepare,Pe as send,V as sizeWords,me as takes,G as typeWords};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{F as g,Q as u}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{F as g,Q as u}from"./chunk.6II4BONS.js";import{b as m}from"./chunk.AJZBJBMO.js";var d=m(g(),1),n=m(u(),1),f=/^\s*(\d{1,6})[.)]\s+(.*)$/s,c=/^\s*[-*•]\s+(.*)$/s;function S(o){let s=[];for(let p of o.replace(/\r\n?/g,`
|
|
2
2
|
`).split(/\n[ \t]*\n+/)){let t=null,a=()=>{t&&(t.t==="p"?t.lines.length>0:t.items.length>0)&&s.push(t),t=null};for(let e of p.split(`
|
|
3
|
-
`)){let i=f.exec(e),l=i?null:c.exec(e);if(i)t?.t!=="ol"&&(a(),t={t:"ol",start:Number(i[1]),items:[]}),t.items.push(i[2]);else if(l)t?.t!=="ul"&&(a(),t={t:"ul",items:[]}),t.items.push(l[1]);else if(t&&t.t!=="p"&&/^\s+\S/.test(e)){let r=t.items;r[r.length-1]=`${r[r.length-1]} ${e.trim()}`}else e.trim().length>0&&(t?.t!=="p"&&(a(),t={t:"p",lines:[]}),t.lines.push(e.trim()))}a()}return s}function b(o){return/[\r\n]/.test(o)}var h={display:"grid",gap:"0.7em",minWidth:0,overflowWrap:"anywhere"},k={margin:0},y={margin:0,paddingInlineStart:"1.6em",display:"grid",gap:"0.3em"},x=(0,d.lazy)(()=>(__graviewPreload(import.meta.url,["./chunk.
|
|
3
|
+
`)){let i=f.exec(e),l=i?null:c.exec(e);if(i)t?.t!=="ol"&&(a(),t={t:"ol",start:Number(i[1]),items:[]}),t.items.push(i[2]);else if(l)t?.t!=="ul"&&(a(),t={t:"ul",items:[]}),t.items.push(l[1]);else if(t&&t.t!=="p"&&/^\s+\S/.test(e)){let r=t.items;r[r.length-1]=`${r[r.length-1]} ${e.trim()}`}else e.trim().length>0&&(t?.t!=="p"&&(a(),t={t:"p",lines:[]}),t.lines.push(e.trim()))}a()}return s}function b(o){return/[\r\n]/.test(o)}var h={display:"grid",gap:"0.7em",minWidth:0,overflowWrap:"anywhere"},k={margin:0},y={margin:0,paddingInlineStart:"1.6em",display:"grid",gap:"0.3em"},x=(0,d.lazy)(()=>(__graviewPreload(import.meta.url,["./chunk.BZ5VLPKB.js","./chunk.6II4BONS.js","./chunk.F5BCCGFK.js","./chunk.AJZBJBMO.js"]),import("./chunk.J3TEJBI5.js")));function B({text:o,className:s,style:p,markdown:t,headingsFrom:a}){return t?(0,n.jsx)(d.Suspense,{fallback:(0,n.jsx)(B,{text:o,...s?{className:s}:{},...p?{style:p}:{}}),children:(0,n.jsx)(x,{text:o,...s?{className:s}:{},...p?{style:p}:{},...a?{headingsFrom:a}:{}})}):(0,n.jsx)("div",{"data-graview-text-body":"",...s?{className:s}:{},style:{...h,...p},children:S(o).map((e,i)=>e.t==="p"?(0,n.jsx)("p",{style:k,children:e.lines.map((l,r)=>(0,n.jsxs)("span",{children:[r>0?(0,n.jsx)("br",{}):null,l]},r))},i):e.t==="ol"?(0,n.jsx)("ol",{start:e.start,style:y,children:e.items.map((l,r)=>(0,n.jsx)("li",{children:l},r))},i):(0,n.jsx)("ul",{style:y,children:e.items.map((l,r)=>(0,n.jsx)("li",{children:l},r))},i))})}export{b as a,B as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{D as l,K as p,R as k,S as y,c}from"./chunk.FERBNBDE.js";import"./chunk.YNE5QR7Q.js";import"./chunk.UGFDSE37.js";import{b as m}from"./chunk.GOCUBIRW.js";import"./chunk.6QDFBCV4.js";import"./chunk.4STIUIT6.js";import"./chunk.WHTQHU3M.js";import"./chunk.KU6NIMQX.js";import"./chunk.Y3IJDWNS.js";import"./chunk.OFJH7LDC.js";import"./chunk.5PU3RWYY.js";import"./chunk.27TLAVRR.js";import"./chunk.OREMUXB5.js";import"./chunk.ZDNJK2SX.js";import"./chunk.ZSSOTIFL.js";import"./chunk.QDHUDLJB.js";import"./chunk.ZVMIHXVK.js";import"./chunk.CUCNT7MG.js";import"./chunk.2A2DLMT3.js";import"./chunk.E77K6KBX.js";import"./chunk.MB7LKKUD.js";import"./chunk.WVUJXDXZ.js";import"./chunk.VHWUGSFW.js";import"./chunk.P75TPZWT.js";import"./chunk.6W7J76TK.js";import"./chunk.FUR4IHWG.js";import"./chunk.2B4WVCVV.js";import"./chunk.AAZFVCSP.js";import"./chunk.GZHZLJBF.js";import"./chunk.PWOVXARZ.js";import"./chunk.SG23JC6D.js";import"./chunk.OJGHDWI6.js";import"./chunk.GZLYTPE7.js";import"./chunk.4B73P2WA.js";import"./chunk.IMRCAU4T.js";import"./chunk.BZ5VLPKB.js";import{F as S,G as s,H as d,Q as f,Z as g}from"./chunk.6II4BONS.js";import"./chunk.F5BCCGFK.js";import{b as n}from"./chunk.AJZBJBMO.js";var u=n(S(),1);var t=n(f(),1);function D({context:a}){let r=l(),h=g(),[w]=(0,u.useState)(()=>s(null)),o=d(h?.seatTalk??w),P=()=>{(window.history.state?.idx??0)>0?r(-1):r("/")};return(0,t.jsxs)(k,{context:a,"data-testid":"draft-page",children:[(0,t.jsx)(y,{context:a,...o.draft?{"data-testid":"draft-title"}:{},children:o.draft?o.draft.title:"Nothing drawn"}),o.draft?(0,t.jsx)(m,{page:!0,go:e=>r(e.address),onPick:e=>{let i=a.store.graph.getNode(e);i&&r(c(a.store.schema,i.kind,e))},onDiscard:P}):(0,t.jsxs)("p",{style:{margin:0,color:"var(--graview-ink-muted)"},children:["Ask for a way of seeing \u2014 \u201Ca board of tasks by status\u201D \u2014 and it is drawn here."," ",(0,t.jsx)(p,{to:"/",style:{color:"var(--graview-accent)"},children:"Home \u2192"})]})]})}export{D as DraftPage};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{$c as lt,Ba as Pn,Hc as _n,I as kn,Ma as Rn,Mb as Tn,Vc as Vn,_c as De,gc as Mn,rc as On,tc as In,va as An,wc as Cn,za as st}from"./chunk.F5BCCGFK.js";import{a as He,b as D}from"./chunk.AJZBJBMO.js";var to=He(v=>{"use strict";var mt=Symbol.for("react.transitional.element"),mr=Symbol.for("react.portal"),gr=Symbol.for("react.fragment"),hr=Symbol.for("react.strict_mode"),Sr=Symbol.for("react.profiler"),wr=Symbol.for("react.consumer"),vr=Symbol.for("react.context"),br=Symbol.for("react.forward_ref"),xr=Symbol.for("react.suspense"),Er=Symbol.for("react.memo"),Yn=Symbol.for("react.lazy"),kr=Symbol.for("react.activity"),$n=Symbol.iterator;function Ar(e){return e===null||typeof e!="object"?null:(e=$n&&e[$n]||e["@@iterator"],typeof e=="function"?e:null)}var Xn={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Jn=Object.assign,Zn={};function ye(e,t,n){this.props=e,this.context=t,this.refs=Zn,this.updater=n||Xn}ye.prototype.isReactComponent={};ye.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ye.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Qn(){}Qn.prototype=ye.prototype;function gt(e,t,n){this.props=e,this.context=t,this.refs=Zn,this.updater=n||Xn}var ht=gt.prototype=new Qn;ht.constructor=gt;Jn(ht,ye.prototype);ht.isPureReactComponent=!0;var qn=Array.isArray;function yt(){}var O={H:null,A:null,T:null,S:null},eo=Object.prototype.hasOwnProperty;function St(e,t,n){var o=n.ref;return{$$typeof:mt,type:e,key:t,ref:o!==void 0?o:null,props:n}}function Pr(e,t){return St(e.type,t,e.props)}function wt(e){return typeof e=="object"&&e!==null&&e.$$typeof===mt}function Rr(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var zn=/\/+/g;function pt(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Rr(""+e.key):t.toString(36)}function Tr(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(yt,yt):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function pe(e,t,n,o,r){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(i){case"bigint":case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case mt:case mr:a=!0;break;case Yn:return a=e._init,pe(a(e._payload),t,n,o,r)}}if(a)return r=r(e),a=o===""?"."+pt(e,0):o,qn(r)?(n="",a!=null&&(n=a.replace(zn,"$&/")+"/"),pe(r,t,n,"",function(u){return u})):r!=null&&(wt(r)&&(r=Pr(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(zn,"$&/")+"/")+a)),t.push(r)),1;a=0;var d=o===""?".":o+":";if(qn(e))for(var s=0;s<e.length;s++)o=e[s],i=d+pt(o,s),a+=pe(o,t,n,i,r);else if(s=Ar(e),typeof s=="function")for(e=s.call(e),s=0;!(o=e.next()).done;)o=o.value,i=d+pt(o,s++),a+=pe(o,t,n,i,r);else if(i==="object"){if(typeof e.then=="function")return pe(Tr(e),t,n,o,r);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return a}function $e(e,t,n){if(e==null)return e;var o=[],r=0;return pe(e,o,"","",function(i){return t.call(n,i,r++)}),o}function Mr(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Un=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Or={map:$e,forEach:function(e,t,n){$e(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return $e(e,function(){t++}),t},toArray:function(e){return $e(e,function(t){return t})||[]},only:function(e){if(!wt(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};v.Activity=kr;v.Children=Or;v.Component=ye;v.Fragment=gr;v.Profiler=Sr;v.PureComponent=gt;v.StrictMode=hr;v.Suspense=xr;v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O;v.__COMPILER_RUNTIME={__proto__:null,c:function(e){return O.H.useMemoCache(e)}};v.cache=function(e){return function(){return e.apply(null,arguments)}};v.cacheSignal=function(){return null};v.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var o=Jn({},e.props),r=e.key;if(t!=null)for(i in t.key!==void 0&&(r=""+t.key),t)!eo.call(t,i)||i==="key"||i==="__self"||i==="__source"||i==="ref"&&t.ref===void 0||(o[i]=t[i]);var i=arguments.length-2;if(i===1)o.children=n;else if(1<i){for(var a=Array(i),d=0;d<i;d++)a[d]=arguments[d+2];o.children=a}return St(e.type,r,o)};v.createContext=function(e){return e={$$typeof:vr,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:wr,_context:e},e};v.createElement=function(e,t,n){var o,r={},i=null;if(t!=null)for(o in t.key!==void 0&&(i=""+t.key),t)eo.call(t,o)&&o!=="key"&&o!=="__self"&&o!=="__source"&&(r[o]=t[o]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var d=Array(a),s=0;s<a;s++)d[s]=arguments[s+2];r.children=d}if(e&&e.defaultProps)for(o in a=e.defaultProps,a)r[o]===void 0&&(r[o]=a[o]);return St(e,i,r)};v.createRef=function(){return{current:null}};v.forwardRef=function(e){return{$$typeof:br,render:e}};v.isValidElement=wt;v.lazy=function(e){return{$$typeof:Yn,_payload:{_status:-1,_result:e},_init:Mr}};v.memo=function(e,t){return{$$typeof:Er,type:e,compare:t===void 0?null:t}};v.startTransition=function(e){var t=O.T,n={};O.T=n;try{var o=e(),r=O.S;r!==null&&r(n,o),typeof o=="object"&&o!==null&&typeof o.then=="function"&&o.then(yt,Un)}catch(i){Un(i)}finally{t!==null&&n.types!==null&&(t.types=n.types),O.T=t}};v.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()};v.use=function(e){return O.H.use(e)};v.useActionState=function(e,t,n){return O.H.useActionState(e,t,n)};v.useCallback=function(e,t){return O.H.useCallback(e,t)};v.useContext=function(e){return O.H.useContext(e)};v.useDebugValue=function(){};v.useDeferredValue=function(e,t){return O.H.useDeferredValue(e,t)};v.useEffect=function(e,t){return O.H.useEffect(e,t)};v.useEffectEvent=function(e){return O.H.useEffectEvent(e)};v.useId=function(){return O.H.useId()};v.useImperativeHandle=function(e,t,n){return O.H.useImperativeHandle(e,t,n)};v.useInsertionEffect=function(e,t){return O.H.useInsertionEffect(e,t)};v.useLayoutEffect=function(e,t){return O.H.useLayoutEffect(e,t)};v.useMemo=function(e,t){return O.H.useMemo(e,t)};v.useOptimistic=function(e,t){return O.H.useOptimistic(e,t)};v.useReducer=function(e,t,n){return O.H.useReducer(e,t,n)};v.useRef=function(e){return O.H.useRef(e)};v.useState=function(e){return O.H.useState(e)};v.useSyncExternalStore=function(e,t,n){return O.H.useSyncExternalStore(e,t,n)};v.useTransition=function(){return O.H.useTransition()};v.version="19.2.8"});var W=He((ra,no)=>{"use strict";no.exports=to()});var fo=He(Ue=>{"use strict";var Wr=Symbol.for("react.transitional.element"),Fr=Symbol.for("react.fragment");function co(e,t,n){var o=null;if(n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),"key"in t){n={};for(var r in t)r!=="key"&&(n[r]=t[r])}else n=t;return t=n.ref,{$$typeof:Wr,type:e,key:o,ref:t!==void 0?t:null,props:n}}Ue.Fragment=Fr;Ue.jsx=co;Ue.jsxs=co});var Ie=He((fa,po)=>{"use strict";po.exports=fo()});function Hn(e){let t,n=!1,o,r,i=0;return()=>{if(n)return Promise.resolve(t);if(o)return o;let a=i>0&&r!==void 0?dr(r):e();i+=1;let d=a.then(s=>(t=s,n=!0,o=void 0,s),s=>{throw o=void 0,r??=ur(s),s});return o=d,d}}var Ln=0;function dr(e){return Ln+=1,import(`${e}${e.includes("?")?"&":"?"}retry=${Ln}`)}function ur(e,t=import.meta.url){let n=e instanceof Error?e.message:typeof e=="string"?e:"",o=/^(?:Failed to fetch|error loading) dynamically imported module: ([a-z]+:\/\/[^\s"'<>]+)/.exec(n)?.[1]?.replace(/[.,;:)\]]+$/,""),r=i=>i.split("/",3).join("/");return o&&r(o)===r(t)?o:void 0}var ue={focusId:null,relation:null,expanded:[],pins:{}},Ne=e=>{let t=Number(e);return Number.isFinite(t)?t:null};function ee(e){let t=new URLSearchParams;e.focusId&&t.set("focus",e.focusId),e.relation&&t.set("relation",e.relation),e.overview&&t.set("overview","1"),e.zoom&&t.set("zoom","1"),e.past&&t.set("past","1"),e.shown&&e.shown.length>0&&t.set("show",[...e.shown].sort().join(",")),e.selection!==void 0&&e.selection.length>0&&t.set("sel",[...e.selection].sort().join(",")),e.expanded.length>0&&t.set("expand",[...e.expanded].sort().join(","));for(let o of Object.keys(e.pins).sort()){let r=e.pins[o];t.set(`pin.${o}`,`${je(r.x)},${je(r.y)}`)}e.pan&&(e.pan.x!==0||e.pan.y!==0)&&t.set("pan",`${je(e.pan.x)},${je(e.pan.y)}`);for(let o of Object.keys(e.within??{}).sort()){let r=e.within[o];r.length>0&&t.set(`in.${o}`,r)}e.q&&e.q.trim().length>0&&t.set("q",e.q);let n=t.toString();return n?`#${n}`:"#"}function cr(e){return e&&e.startsWith("agg:")?`aggregate:${e.slice(4)}`:e}function Ge(e){let t=e.includes("#")?e.slice(e.indexOf("#")+1):e,n=new URLSearchParams(t),o=Object.create(null);for(let[h,p]of n){if(!h.startsWith("pin."))continue;let[g,b]=p.split(","),k=g===void 0?null:Ne(g),m=b===void 0?null:Ne(b);k===null||m===null||(o[h.slice(4)]={x:k,y:m})}let r=Object.create(null);for(let[h,p]of n)!h.startsWith("in.")||p.length===0||(r[h.slice(3)]=p);let i=n.get("view");i&&i.length>0&&r.view===void 0&&(r.view=i);let a=n.get("pan")?.split(",")??[],d=a[0]===void 0?null:Ne(a[0]),s=a[1]===void 0?null:Ne(a[1]),u=(n.get("sel")??"").split(",").filter(h=>h.length>0).sort(),f=n.get("overview")==="1";return{...u.length>0?{selection:u}:{},...f?{overview:!0}:{},...n.get("zoom")==="1"?{zoom:!0}:{},...n.get("past")==="1"?{past:!0}:{},...n.get("show")?{shown:[...new Set(n.get("show").split(",").filter(Boolean))].sort()}:{},...d!==null&&s!==null?{pan:{x:d,y:s}}:{},...Object.keys(r).length>0?{within:r}:{},...n.get("q")?.trim()?{q:n.get("q")}:{},focusId:cr(n.get("focus")),relation:n.get("relation"),expanded:(n.get("expand")??"").split(",").filter(h=>h.length>0&&(f||!h.startsWith("kind:"))).sort(),pins:o}}function Wi(e){let t=Ge(e);return ee(t)==="#"?{...t,overview:!0}:t}function Fi(e){let t=ee(e);return t==="#overview=1"?"":t}function je(e){return Math.round(e*100)/100}function Nn(e,t){return ee(e)===ee(t)}var Dn="edge:";function jn(e){if(!e.startsWith(Dn))return null;let t=e.slice(Dn.length).split(":");if(t.length!==3)return null;let[n,o,r]=t;if(!n||!o||!r)return null;try{return{kind:decodeURIComponent(n),from:decodeURIComponent(o),to:decodeURIComponent(r)}}catch{return null}}function dt(e){let{pan:t,...n}=e;return{...n,pins:{}}}function q(e,t){if(t===e.focusId)return{...e,focusId:t};let n=dt(e);return{...n.within?.q!==void 0?ae(n,"q",null):n,focusId:t}}function Gn(e,t){return{...e,relation:t}}function ae(e,t,n){let o={...e.within??{}};if(n===null?delete o[t]:o[t]=n,Object.keys(o).length===0){let{within:r,...i}=e;return i}return{...e,within:o}}function ce(e,t){if(t!==e.overview&&(e=dt(e)),!t){let n=e.expanded.filter(o=>!o.startsWith("kind:"));return{...e,overview:!1,expanded:n}}return{...e,overview:t}}function We(e,t){if(t.length===0){let{selection:n,...o}=e;return o}return{...e,selection:[...t]}}function Me(e,t){if(t!==(e.zoom===!0)&&(e=dt(e)),!t){let{zoom:n,...o}=e;return o}return{...e,zoom:!0}}function Fe(e,t){let n=new Set(e.expanded);return n.has(t)?n.delete(t):n.add(t),{...e,expanded:[...n].sort()}}var Be="aggregate:",Ke="kind:";function ut(e){return`${Ke}${e}`}function fe(e){return e.startsWith(Ke)?e.slice(Ke.length):null}var $i="kinds:beyond";function fr(e){let t=fe(e);return t?[t]:se(e)}function te(...e){return`${Be}${[...e].sort().join("+")}`}function Wn(e){return e.startsWith(Be)}function se(e){return!Wn(e)||e.includes("|")?[]:e.slice(Be.length).split("+").filter(Boolean)}function Fn(e,t,n={}){let o=fe(t);if(o!==null&&e.overview&&n.ownPicture!==!0)return Fe(e,t);let r=o!==null?te(o):t;if(e.zoom&&e.focusId===r&&!(o!==null&&n.carry))return Me(e,!1);if(o!==null&&n.carry){let i=ce({...q(e,r),relation:null},!1);return ae(Me(i,!0),"q",n.carry)}return Me({...q(e,r),relation:null},!0)}function pr(e,t,n){return ae(ce(q(e,te(t)),!1),"view",n)}function qi(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Kn="aggregate:";function ct(e){return e.startsWith(Kn)&&e.includes("|")}var Bn=e=>e?.off===!0,yr=e=>e!==void 0&&!Bn(e)&&(e.fast!==void 0||e.thinking!==void 0||e.answer!==void 0||e.decide!==void 0||e.complete!==void 0||e.turn!==void 0),ft={};var oo=D(W(),1),Ir={turns:[],outcomes:new Map,busy:!1,pending:null,draft:null,draftNote:null},ro=e=>`graview:seat:${e}`;function Cr(e){if(!e)return{};try{let t=sessionStorage.getItem(e);if(!t)return{};let n=JSON.parse(t);return{...Array.isArray(n.turns)?{turns:n.turns}:{},...Array.isArray(n.outcomes)?{outcomes:new Map(n.outcomes)}:{},...n.draft?.drawn?{draft:n.draft}:{}}}catch{return{}}}function _r(e,t){if(e)try{sessionStorage.setItem(e,JSON.stringify({turns:t.turns.slice(-40),outcomes:[...t.outcomes],draft:t.draft}))}catch{}}function vt(e){let t=e===null?null:ro(e),n={...Ir,...Cr(t)},o=new Set,r=(i,a=!0)=>{n=i,a&&_r(t,n);for(let d of[...o])d()};return{get:()=>n,subscribe(i){return o.add(i),()=>void o.delete(i)},setTurns:i=>r({...n,turns:i(n.turns)}),settle:(i,a)=>r({...n,outcomes:new Map(n.outcomes).set(i,a)}),setBusy:i=>r({...n,busy:i},!1),ask:i=>r({...n,pending:i.trim()||null}),takePending(){let i=n.pending;return i!==null&&r({...n,pending:null},!1),i},setDraft:(i,a=null)=>r({...n,draft:i,draftNote:a})}}function Vr(e){return(0,oo.useSyncExternalStore)(e.subscribe,e.get,e.get)}var ao=D(W(),1),Lr={entries:[],ghost:null,loaded:!1};function io(e,t){let n=new Map(e.map(o=>[o.id,o]));for(let o of t)n.set(o.id,{...n.get(o.id),...o});return[...n.values()].sort((o,r)=>o.at<r.at?1:o.at>r.at?-1:0)}function bt(e){let t=Lr,n=new Set,o=r=>{t=r;for(let i of[...n])i()};return{get:()=>t,subscribe:r=>(n.add(r),()=>n.delete(r)),record:r=>{o({...t,entries:io(t.entries,[r])}),Promise.resolve(e()?.keep?.(r)).catch(i=>{console.warn("The host did not keep an AI interaction:",i)})},setGhost:r=>o({...t,ghost:r}),load:()=>{if(t.loaded)return;o({...t,loaded:!0});let r=e()?.load;r&&Promise.resolve(r()).then(i=>o({...t,entries:io(t.entries,i)})).catch(i=>{console.warn("The host's AI interactions could not be read:",i)})}}}function Hr(e){return(0,ao.useSyncExternalStore)(e.subscribe,e.get,e.get)}function so(e){return e?.closest?.("[data-graview-pick]")?.getAttribute("data-graview-pick")??null}var qe=D(W(),1),ze=(0,qe.createContext)(void 0),Dr=()=>(0,qe.useContext)(ze);var A=D(W(),1),Oe=(0,A.createContext)(null);function uo(){return(0,A.useContext)(Oe)}function Nr(e,t){let n=uo(),o=(0,A.useMemo)(()=>n?n.live.seenBy(t):e,[n,e,t]),r=(0,A.useRef)(0),i=(0,A.useCallback)(a=>o.subscribe(()=>{r.current+=1,a()}),[o]);return(0,A.useSyncExternalStore)(i,()=>r.current,()=>0),o}var jr=Hn(()=>(__graviewPreload(import.meta.url,["./chunk.TI4OSTQV.js","./chunk.AJZBJBMO.js"]),import("./chunk.WQBDTLPZ.js"))),lo,Gr=400;function xt(e,t,n){let o=(0,A.useContext)(Oe),r=o!==null&&o.owns(e,t),[i,a]=(0,A.useState)(null),[d,s]=(0,A.useState)(lo);(0,A.useEffect)(()=>{if(d||r||i===null)return;let E=!0;return jr().then(R=>{lo=R,E&&s(R)},()=>{}),()=>{E=!1}},[d,r,i]);let[u,f]=(0,A.useState)(0),h=(0,A.useMemo)(()=>r||i===null||i>=e.log.length||!d?void 0:d.askDeclaration(n,i),[r,e,i,n,d,u]),p=h&&"waiting"in h?h.waiting:void 0,[g,b]=(0,A.useState)(void 0);(0,A.useEffect)(()=>{if(!p)return;let E=!0,R=setTimeout(()=>E&&b(p),Gr);return p.then(()=>E&&f(_=>_+1)),()=>{E=!1,clearTimeout(R)}},[p]);let k=p!==void 0&&g!==p,m=(0,A.useMemo)(()=>{if(r||i===null||i>=e.log.length||!d||k)return null;try{let E=d.pastAt(e,i,n);return{seq:i,at:E.past?.at,store:E}}catch{return null}},[r,e,i,n,d,k,u]),w=(0,A.useRef)(null),y=k?w.current:m;(0,A.useEffect)(()=>{w.current=y},[y]);let x=(0,A.useCallback)(E=>a(E===null?null:E>=e.log.length?Number.POSITIVE_INFINITY:E),[e]),P=(0,A.useCallback)((E,R)=>[e,y?.store].some(_=>_!==void 0&&(_===E||_.seenBy(R)===E)),[e,y]),G=i!==null,I=(0,A.useMemo)(()=>({past:y,open:G,show:x,live:e,host:n,owns:P}),[y,G,x,e,n,P]);return r?o:I}var yo=e=>`graview:setting:${e}`;function mo(){return localStorage}function go(e,t){try{let n=(t??mo()).getItem(yo(e.name));if(n!==null&&e.options.some(o=>o.value===n))return n}catch{}return e.initial}function ho(e,t,n){try{(n??mo()).setItem(yo(e.name),t)}catch{}}function So(e,t){if(typeof document>"u")return;let n=document.documentElement;if(e.honored==="root-font-size"){n.style.fontSize=t===e.initial?"":t;return}let o=`graview${e.name.replace(/-([a-z0-9])/g,(r,i)=>i.toUpperCase()).replace(/^[a-z]/,r=>r.toUpperCase())}`;t===e.initial?delete n.dataset[o]:n.dataset[o]=t}var L=D(W(),1);function Et(e){return De(e)}var Kr=12,Br=4;function $r(e,t,n){let o=Et(t);return e.get(o)??{participant:o,who:t.id??t.kind,at:null,mode:"docked",since:n,trail:[]}}var Ye=(e,t)=>t===null||e[e.length-1]===t?e:[...e,t].slice(-Kr);function wo(e,t){let n=e.filter(r=>r.length>0);if(n.length===0)return null;if(n.length<=Br)return n[0];let o=new Set(n.map(r=>t(r)).filter(r=>r!==void 0));return o.size===1?ut([...o][0]):n[0]}function kt(e,t,n){let o=new Map(e);if(t.type==="rest"){for(let[a,d]of e)d.mode!=="asking"&&d.mode!=="docked"&&t.at-d.since>=t.holdMs&&o.set(a,{...d,mode:"docked",at:null,trail:[],say:void 0,confidence:void 0});return o}if(t.author.kind!=="agent")return o;let r=$r(e,t.author,t.at),i=a=>o.set(r.participant,{...r,...a,since:t.at});switch(t.type){case"read":{let a=wo(t.ids,n);return i({at:a,mode:"reading",trail:Ye(r.trail,a)}),o}case"about-to-write":case"write":{let a=wo(t.ids,n);return i({at:a,mode:"writing",trail:Ye(r.trail,a),say:void 0,confidence:void 0}),o}case"refused":return i({at:t.where,mode:"refused",say:t.say,confidence:void 0,trail:Ye(r.trail,t.where)}),o;case"asking":return i({at:t.where??r.at,mode:"asking",say:t.say,...t.confidence!==void 0?{confidence:t.confidence}:{confidence:void 0},trail:Ye(r.trail,t.where)}),o;case"said":return i({say:t.say,...t.confidence!==void 0?{confidence:t.confidence}:{confidence:void 0},...t.caption?{caption:t.caption}:{}}),o;case"over":return i({over:t.over}),o;case"home":return i({at:null,mode:"docked",trail:[],say:void 0,confidence:void 0,over:null}),o;default:return o}}var vo="graview:session";function bo(e){let t=()=>typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID().slice(0,8):Math.random().toString(36).slice(2,10);try{let n=e??sessionStorage,o=n.getItem(vo);if(o)return o;let r=t();return n.setItem(vo,r),r}catch{return t()}}var At={name:"share-where",title:"Where you are",description:"Whether the others here see which stop you are on.",honored:"root-attribute",options:[{value:"shared",label:"Shown"},{value:"private",label:"Hidden"}],initial:"shared"},Pt={name:"share-over",title:"What you point at",description:"Whether the others see the thing under your pointer, outlined in your color.",honored:"root-attribute",options:[{value:"private",label:"Kept to yourself"},{value:"shared",label:"Outlined for others"}],initial:"private"},xo=[At,Pt],zr=800;function Eo(e){let{channel:t,store:n,view:o,principal:r,session:i,robots:a,seatWho:d,settingValues:s,setView:u,ttlMs:f=1e4,people:h,seats:p}=e,[g,b]=(0,L.useState)(()=>new Map),[k,m]=(0,L.useState)(null),[w,y]=(0,L.useState)(null),[x,P]=(0,L.useState)(null),G=typeof r.id=="string"&&r.id.length>0,I=G&&(s[At.name]??At.initial)==="shared",E=I&&(s[Pt.name]??Pt.initial)==="shared",R=Et({kind:r.kind,...r.id?{id:r.id}:{},session:i}),_=G?Rn(r,{graph:n.graph,schema:n.schema,...p?{seats:p}:{},...h?{people:h}:{}}):"",C=d?a.get(`agent:${d}:${i}`):void 0,N=(0,L.useMemo)(()=>!t||!I?null:{participant:R,kind:r.kind,name:_,...r.onBehalfOf?.id?{onBehalfOf:r.onBehalfOf.id,...r.onBehalfOf.name?{onBehalfOfName:r.onBehalfOf.name}:{}}:{},hue:Tn(r.id??"nobody"),stop:x??ee(o),...E?{over:k}:{},...C?{robot:{at:C.at,mode:C.mode}}:{},at:new Date().toISOString()},[t,I,E,R,_,r.id,r.kind,r.onBehalfOf?.id,r.onBehalfOf?.name,o,x,k,C?.at,C?.mode]);(0,L.useEffect)(()=>{if(!t||!N)return;t.here(N);let V=setInterval(()=>t.here({...N,at:new Date().toISOString()}),zr);return()=>clearInterval(V)},[t,N]),(0,L.useEffect)(()=>t?t.onWho(K=>b(lt(new Map,K,Date.now(),f))):void 0,[t,f]);let ve=g.size>0;(0,L.useEffect)(()=>{if(!ve)return;let V=setInterval(()=>{b(K=>{let B=lt(K,[],Date.now(),f);return B.size===K.size?K:B})},Math.max(250,Math.min(1e3,f/4)));return()=>clearInterval(V)},[ve,f]),(0,L.useEffect)(()=>{if(!t||typeof window>"u")return;let V=()=>t.leave();return window.addEventListener("pagehide",V),()=>window.removeEventListener("pagehide",V)},[t]),(0,L.useEffect)(()=>{if(!E||typeof document>"u")return;let V=null,K=B=>{let J=so(B.target);J!==V&&(V=J,m(J))};return document.addEventListener("pointermove",K,{passive:!0}),()=>document.removeEventListener("pointermove",K)},[E]);let oe=(0,L.useRef)(null),z=w?g.get(w)??null:null,be=(0,L.useCallback)(V=>{oe.current=null,y(V)},[]);return(0,L.useEffect)(()=>{if(w){if(!z){y(null);return}z.stop!==oe.current?.stop&&(oe.current={stop:z.stop,at:Date.now()},u(Ge(z.stop)))}},[w,z,u]),(0,L.useEffect)(()=>{let V=oe.current;!w||V===null||Date.now()-V.at<400||Nn(o,Ge(V.stop))||y(null)},[o,w]),(0,L.useEffect)(()=>{if(!w||typeof document>"u")return;let V=K=>{K.key==="Escape"&&y(null)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[w]),(0,L.useMemo)(()=>({who:g,sharing:N?{participant:R,name:_}:null,following:z,follow:be,sayWhere:P}),[g,N,R,_,z,be])}var Y=D(W(),1);function ko(e){return De(e.author)}function Ur(e,t){return e.length>1?"co-edited":t==="rule"?"rule":t==="agent"?"autonomous":"directed"}function Ao(e,t,n,o,r){let i=new Map;for(let[s,u]of e)o-u.at<r&&i.set(s,u);let a=new Set(n.flatMap(s=>s.nodeIds)),d=(s,u,f)=>{let h=i.get(s),p=h?.participants.includes(ko(u))?h.participants:[...h?.participants??[],ko(u)];i.set(s,{at:o,manner:Ur(p,u.author.kind),intent:u.intent,wrote:(h?.wrote??!1)||(f.wrote??!1),read:(h?.read??!1)||(f.read??!1),broke:(h?.broke??!1)||a.has(s),participants:p})};for(let s of t){for(let u of s.writes)d(u,s,{wrote:!0});for(let u of s.reads)s.writes.includes(u)||d(u,s,{read:!0})}for(let s of n)for(let u of s.nodeIds){let f=i.get(u);i.set(u,{at:o,manner:f?.manner??"rule",intent:f?.intent??s.message,wrote:f?.wrote??!1,read:f?.read??!1,broke:!0,participants:f?.participants??["rule::"]})}return i}var Yr=2600;function Po(e,t=Yr){let[n,o]=(0,Y.useState)(()=>new Map),r=(0,Y.useRef)(n);r.current=n;let i=(0,Y.useRef)(null),a=(0,Y.useCallback)(s=>{r.current=s,o(s),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{r.current=new Map,o(new Map)},t)},[t]);(0,Y.useEffect)(()=>{let s=e.violations(),u=e.subscribe((f,h)=>{let p=e.violations(),g=Cn(e.allInvariants(),s,p).introduces;s=p,a(Ao(r.current,h,g.map(b=>({nodeIds:b.nodeIds,message:b.message})),Date.now(),t))});return()=>{u(),i.current&&clearTimeout(i.current)}},[e,t,a]);let d=(0,Y.useCallback)(s=>{s.reads.length!==0&&a(Ao(r.current,[Xr(s)],[],Date.now(),t))},[t,a]);return{activity:n,noteAttention:d}}function Xr(e){return{id:`attention:${e.intent}`,seq:-1,batch:"attention",author:e.author,intent:e.intent,mutation:null,primitives:[],inverse:[],reads:e.reads,writes:[],at:new Date().toISOString()}}var l=D(W(),1);function Ro(){let e=null,t=new Set,n=new Set,o=r=>{for(let i of n)i(r)};return{subscribe(r){return t.add(r),t.size===1&&o(!0),()=>{t.delete(r),t.size===0&&(e=null,o(!1))}},snapshot:()=>e,set(r){if(!(e===r||e&&r&&e.x===r.x&&e.y===r.y)){e=r;for(let i of t)i()}},get listeners(){return t.size},onActive(r){return n.add(r),()=>void n.delete(r)}}}var Xe=D(W(),1),Jr=e=>e.definitions.some(t=>An(t).size>0);function To(e,t,n){let[o,r]=(0,Xe.useState)(void 0),i=(n.roles??[]).join("\0");return(0,Xe.useEffect)(()=>{if(!t||!Jr(e.schema)){r(void 0);return}let a=!0,d=!1,s=e.graph,u=()=>{d||(d=!0,queueMicrotask(()=>{d=!1,a&&e.reread()}))},f=Pn(t,{kind:n.kind,...n.id===void 0?{}:{id:n.id},...n.roles?{roles:n.roles}:{}},u);return st(s,f.read),r(f),e.reread(),()=>{a=!1,st(s,void 0)}},[e,t,n.kind,n.id,i]),o}function Mo(){let e=!1,t=new Set;return{moving:()=>e,set(n){if(n!==e){e=n;for(let o of t)o()}},subscribe(n){return t.add(n),()=>t.delete(n)}}}var le=D(Ie(),1),Ce=(0,l.createContext)(null),_o=(0,l.createContext)("scene");function Zr({mode:e,children:t}){return(0,le.jsx)(_o.Provider,{value:e,children:t})}function Qr(){return(0,l.useContext)(_o)}var Vo={kind:"human"},ei=[],ti=[],ni=[],Rt=[];function Lo(e,t){let n=(0,l.useId)();(0,l.useEffect)(()=>{if(!globalThis.__graviewWatch)return;let o=t??Vo,r=()=>In(e,o,n);r();let i,a=e.subscribe(()=>{clearTimeout(i),i=setTimeout(r,250)});return()=>{clearTimeout(i),a(),globalThis.__graviewWatch?.unseen?.({words:[],from:n,gone:!0})}},[e,t,n])}var oi={off:!0};function ri({store:e,views:t,initialView:n,scheme:o="dark",initialSelection:r,principal:i,seats:a=ei,onSeat:d,people:s=ti,memory:u,presenceTtlMs:f,app:h,settings:p=h?.settings??ni,presence:g,brand:b,locale:k,onKeepLens:m,providers:w,ai:y,files:x,resolveApp:P,history:G,linkedRecords:I,menuSections:E,subscriptions:R,signIn:_,view:C,onViewChange:N,children:ve}){let oe=(0,l.useContext)(Ce),z=E??oe?.menuSections,be=_??oe?.signIn,[V,K]=(0,l.useState)(null),B=V??i??a[0]?.principal??Vo,J=xt(e,B,G),Ft=J.past&&J.live===e?J.past.store:e,H=(0,l.useMemo)(()=>Ft.seenBy(B),[Ft,B]);Lo(e,B);let[re]=(0,l.useState)(()=>bo(u)),[Kt,Jo]=(0,l.useState)(!1),Bt=(0,l.useCallback)(()=>Jo(!0),[]),ie=(0,l.useMemo)(()=>g?[...p,...xo]:p,[p,g]),[tt]=(0,l.useState)(()=>n??It(t,e.schema)),[Zo,$t]=(0,l.useState)(()=>We(tt??ue,r??tt?.selection??[])),xe=(0,l.useRef)(tt??ue).current,[qt,Qo]=(0,l.useState)(null),[zt,er]=(0,l.useState)(null),Z=(0,l.useContext)(Ce),[Ut]=(0,l.useState)(()=>Z?.seatTalk??vt(b?.name??e.schema.kinds.join(","))),nt=y??Z?.ai??ft,Ve=(0,l.useMemo)(()=>nt.off?oi:nt,[nt]),Yt=(0,l.useRef)(Ve.interactions);Yt.current=Ve.interactions;let[Xt]=(0,l.useState)(()=>Z?.aiDesk??bt(()=>Yt.current)),[tr]=(0,l.useState)(()=>Z?.subscriptions??On()),Jt=R??Z?.subscriptions??tr,ot=m??Z?.onKeepLens,rt=h??Z?.app,Le=k??Z?.locale,nr=b?.locale??rt?.brand?.locale;kn({reader:Le,app:nr});let Zt=(0,l.useRef)(null),Qt=(0,l.useCallback)(c=>{Zt.current=c},[]),en=(0,l.useCallback)(c=>Zt.current?.whereIs(c)??null,[]),[tn]=(0,l.useState)(()=>Ro()),[nn]=(0,l.useState)(()=>Mo()),[it,or]=(0,l.useState)(null),[Ee,on]=(0,l.useState)(()=>new Map),ke=(0,l.useRef)(Ee);ke.current=Ee;let Ae=(0,l.useRef)(null),at=(0,l.useCallback)(c=>H.graph.getNode(c)?.kind,[H]),Q=(0,l.useCallback)(c=>{let S=kt(ke.current,c,at);ke.current=S,on(S),Ae.current&&clearTimeout(Ae.current),[...S.values()].some(M=>M.mode!=="docked"&&M.mode!=="asking")&&(Ae.current=setTimeout(()=>{let M=kt(ke.current,{type:"rest",at:Date.now(),holdMs:Ot},at);ke.current=M,on(M)},Ot+20))},[at]),rn=(0,l.useCallback)(c=>Q({...c,at:c.at??Date.now()}),[Q]),an=(0,l.useCallback)(c=>{or(c),c&&Q({type:"home",author:{kind:"agent",id:c,session:re},at:Date.now()})},[Q,re]);(0,l.useEffect)(()=>H.subscribe((c,S)=>{for(let T of S)T.author.kind==="agent"&&Q({type:"write",author:T.author,ids:T.writes,at:Date.now()})}),[H,Q]),(0,l.useEffect)(()=>()=>{Ae.current&&clearTimeout(Ae.current)},[]);let U=(0,l.useMemo)(()=>({...B,session:re}),[B,re]),sn=To(H,I,U),ln=(0,l.useCallback)(c=>{K(c),d?.(c)},[d]),[Pe,rr]=(0,l.useState)(()=>Object.fromEntries(ie.map(c=>[c.name,go(c,u)])));(0,l.useEffect)(()=>{for(let c of ie)So(c,Pe[c.name]??c.initial)},[ie,Pe]);let dn=(0,l.useCallback)((c,S)=>{let T=ie.find(M=>M.name===c);!T||!T.options.some(M=>M.value===S)||(ho(T,S,u),rr(M=>({...M,[c]:S})))},[ie,u]),[un,ir]=(0,l.useState)(null),{activity:cn,noteAttention:fn}=Po(H),pn=(0,l.useCallback)(c=>{fn(c),Q({type:"read",author:c.author,ids:c.reads,at:Date.now()})},[fn,Q]),de=(0,l.useCallback)(c=>{if(fe(c)!==null||se(c).length>0||ct(c))return!0;let S=jn(c);return S?H.graph.allEdges().some(T=>T.kind===S.kind&&T.from===S.from&&T.to===S.to):H.graph.getNode(c)!==void 0},[H]),yn=(0,l.useCallback)(c=>{let S=c.selection??Rt,T=S.filter(de),M=T.length===S.length?c:We(c,T);return M.focusId!==null&&!de(M.focusId)&&(M=q(M,null)),M},[de]),Re=(0,l.useCallback)(c=>{let S=yn(c),T=Co(H,U,S.shown);if(S.focusId!==null&&T.size>0){let M=se(S.focusId),En=H.graph.getNode(S.focusId);(M.length>0?M.every(lr=>T.has(lr)):En?T.has(En.kind):!1)&&(S={...S,focusId:null})}if(!S.overview&&S.focusId===null){let M=xe.focusId!==null&&!de(xe.focusId)?It(t,e.schema)??{...ue,overview:!0}:xe;M.focusId!==null&&de(M.focusId)?S={...S,focusId:M.focusId}:M.overview===!0&&(S={...S,overview:!0})}return S},[yn,de,H,xe,U,t,e.schema]),$=Re(C??Zo),mn=(0,l.useMemo)(()=>Co(H,U,$.shown),[H,U,$.shown]),gn=(0,l.useMemo)(()=>[...H.modules.administered.entries()].map(([c,S])=>{let T=H.mayAdminister(c,U);return{name:c,...S.description?{description:S.description}:{},kinds:S.kinds??[],canShow:T,shown:T&&($.shown??[]).includes(c)}}),[H,U,$.shown]),Te=(0,l.useCallback)(c=>{let S=T=>Re(typeof c=="function"?c(T):c);if(C!==void 0){N?.(S(C));return}N&&N(S($)),$t(T=>S(T))},[$,N,C,Re]);(0,l.useEffect)(()=>{C===void 0&&$t(c=>{let S=Re(c);return S===c?c:S})},[$,C,Re]);let hn=$.selection??Rt,Sn=(0,l.useCallback)(c=>{Te(S=>We(S,typeof c=="function"?c(S.selection??Rt):c))},[Te]),{who:wn,following:vn,follow:bn,sayWhere:ar,sharing:xn}=Eo({channel:g,store:H,view:$,principal:U,session:re,robots:Ee,seatWho:it,settingValues:Pe,setView:Te,seats:a,people:s,...f!==void 0?{ttlMs:f}:{}}),sr=(0,l.useMemo)(()=>({store:H,scheme:o,views:t,view:$,setView:Te,homeView:xe,selection:hn,setSelection:Sn,menuAt:qt,setMenuAt:Qo,whereIs:en,pointer:tn,motion:nn,registerScene:Qt,robots:Ee,noteSeat:rn,seatWho:it,registerSeatWho:an,actsDoor:zt,registerActsDoor:er,seatTalk:Ut,aiDesk:Xt,...u?{memory:u}:{},who:wn,following:vn,follow:bn,sayWhere:ar,sharing:xn,session:re,ai:Ve,resolveApp:P,linkedRecords:I,menuSections:z,subscriptions:Jt,signIn:be,linkedReads:sn,movedByHand:Kt,noteMoved:Bt,emphasis:un,setEmphasis:ir,activity:cn,noteAttention:pn,principal:U,seats:a,people:s,takeSeat:ln,settings:ie,settingValues:Pe,chooseSetting:dn,hiddenKinds:mn,administered:gn,...w?{providers:w}:{},...b?{brand:b}:{},...ot?{onKeepLens:ot}:{},app:rt,...Le?{locale:Le}:{}}),[H,o,t,$,Te,hn,Sn,qt,en,tn,nn,Qt,Ee,rn,it,an,zt,Ut,Xt,u,wn,vn,bn,xn,re,Ve,P,I,z,Jt,be,sn,Kt,Bt,un,cn,pn,U,a,s,ln,ie,Pe,dn,mn,gn,w,b,ot,rt,Le]);return(0,le.jsx)(Ce.Provider,{value:sr,children:(0,le.jsx)(Oe.Provider,{value:J,children:(0,le.jsx)(di,{children:x?(0,le.jsx)(ze.Provider,{value:x,children:ve}):ve})})})}var Ho=(0,l.createContext)(null),Tt,Mt=new Set,ii=e=>(Mt.add(e),()=>void Mt.delete(e)),Oo=()=>Tt;function ai(e){if(!Tt){Tt=e;for(let t of[...Mt])t()}}var si=300;function li(e){let t=0;return async(n,o)=>{let r=++t;return await new Promise(i=>setTimeout(i,si)),r===t?e(n,o):[]}}function di({children:e}){let{store:t,view:n,views:o,principal:r,hiddenKinds:i,selection:a,ai:d}=ne(),s=Je(),u=n.q,f=n.focusId,h=!!(u&&u.trim().length>0),p=(0,l.useSyncExternalStore)(ii,Oo,Oo),g=(0,l.useMemo)(()=>h&&p?{flagged:new Set(t.violations().flatMap(x=>x.nodeIds)),touched:p.touchWeights(t.log.all())}:null,[t,s,h,p]),b=f?t.graph.getNode(f)?.kind??fe(f)??(se(f).length===1?se(f)[0]:void 0):void 0,k=(0,l.useMemo)(()=>d.near&&li(d.near),[d.near]),m=(0,l.useMemo)(()=>!u||!g||!p?null:p.search(t,u,{...b?{inKind:b}:{},principal:r,places:o.places(),kinds:t.schema.kinds.filter(x=>!i.has(x)),from:[...a,...f&&t.graph.has(f)?[f]:[]],flagged:g.flagged,touched:g.touched,limit:200,rank:k}),[t,u,r,o,i,a,f,b,g,k]),[w,y]=(0,l.useState)();return(0,l.useEffect)(()=>void m?.later?.then(x=>y([m,x])),[m]),(0,le.jsx)(Ho.Provider,{value:w?.[0]===m?w[1]:m,children:e})}var Io=new WeakMap;function Fa(e){let t=Io.get(e);return t||Io.set(e,t=new Set(e.matched)),t}function ui(){return(0,l.useContext)(Ho)}function ne(){let e=(0,l.useContext)(Ce);if(!e)throw new Error("useGraview must be used inside a <GraviewProvider>.");return e}function Ct(){return(0,l.useContext)(Ce)??null}function Je(){let{store:e}=ne(),t=(0,l.useRef)(null),n=(0,l.useRef)(null),o=(0,l.useCallback)(()=>(n.current!==e&&(n.current=e,t.current=null),t.current??=e.graph.allNodes(),t.current),[e]),r=(0,l.useCallback)(i=>e.subscribe(()=>{t.current=null,i()}),[e]);return(0,l.useSyncExternalStore)(r,o,o)}function ci(e){let{store:t}=ne(),n=(0,l.useCallback)(r=>t.subscribe(r),[t]),o=(0,l.useCallback)(()=>e===null?void 0:t.graph.getNode(e),[t,e]);return(0,l.useSyncExternalStore)(n,o,o)}function Co(e,t,n){let o=new Set(e.modules.disabledKinds);for(let r of e.kindsKeptFrom(t))o.add(r);for(let[r,i]of e.modules.administered)if(!(e.mayAdminister(r,t)&&(n??[]).includes(r)))for(let a of i.kinds??[])o.add(a);return o}var Ot=2600;var Do=new WeakSet,fi=e=>Do.has(e),pi=e=>void Do.add(e);function It(e,t){let n=Vn(e.arrangement?.()?.first,t,e.places());if(!(!n||n.to==="home"))return n.to==="place"?{...ue,focusId:te(n.place.kind),within:{view:n.place.as}}:{...ue,focusId:te(n.kind)}}var No=D(W(),1),yi=(0,No.createContext)(!1);var Ze=Symbol.for("graview.default-view");function jo(e){return Object.defineProperty(e,Ze,{value:!0,enumerable:!1}),e}function Go(e){return typeof e=="function"&&e[Ze]===!0}var _t=Symbol.for("graview.replaces-page");function Wo(e){return typeof e=="function"&&e[_t]===!0}function gi(e){return _n(e)}function hi(e,t){if(t===e)return e;for(let r of t.registrations())e.register(r.kind,r,r.view,r);let n=t.arrangement?.();n&&e.arrange?.(n);let o=t.homeView?.();return o&&e.home?.(o),e}var ge=D(W(),1);function Si(){let{selection:e,setSelection:t}=ne();return(0,ge.useMemo)(()=>({selection:e,set:n=>t(n),clear:()=>t([]),toggle:n=>t(o=>o.includes(n)?o.filter(r=>r!==n):[...o,n]),isSelected:n=>e.includes(n)}),[e,t])}function wi(){let{store:e}=ne(),t=Je();return(0,ge.useMemo)(()=>vi(e),[e,t])}var Fo=new WeakMap;function vi(e){let t=Fo.get(e);if(!t){let n={violations:null};e.subscribe(()=>{n.violations=null}),Fo.set(e,n),t=n}return t.violations??=e.violations(),t.violations}function bi(){let{view:e,setView:t}=ne();return(0,ge.useMemo)(()=>({view:e,url:ee(e),focus:n=>t(o=>q(o,n)),show:n=>t(o=>Gn(o,n)),toggle:n=>t(o=>Fe(o,n)),go:n=>t(n)}),[e,t])}var me={at:0,depth:0,listeners:new Set,tell(){for(let e of this.listeners)e()}};typeof window<"u"&&window.addEventListener("popstate",e=>{let t=e.state;me.at=typeof t?.graview=="number"?t.graview:0,me.at>me.depth&&(me.depth=me.at),me.tell()});var j=D(W(),1),Lt={profile:{trigger:"profile-button",pane:"profile",opens:"press",focus:"into",drawn:["shell","embed"]},problems:{trigger:"standing",pane:"problems",opens:"press",focus:"into",drawn:["shell","embed"]},places:{trigger:"app-places-open",pane:"app-places",opens:"press",focus:"into",drawn:["embed"]},here:{trigger:"here-open",pane:"here-list",opens:"press",focus:"into",drawn:["shell","embed","pages"]},suggested:{trigger:"suggested-button",pane:"suggested",opens:"press",focus:"into",drawn:["shell","embed","pages"]},activity:{trigger:"activity-button",pane:"activity",opens:"press",focus:"into",drawn:["shell","embed","pages"]},find:{trigger:"find-box",pane:"find-strip",opens:"typing",focus:"stays",drawn:["shell"]},districts:{trigger:"beyond-more",pane:"beyond-list",opens:"press",focus:"into",drawn:["shell","embed"]},acts:{trigger:null,pane:"context-menu",opens:"context-menu",focus:"into",drawn:["shell","embed","pages"]},arrange:{trigger:"arrange-add",pane:"arrange-list",opens:"press",focus:"into",drawn:["pages"]},"studio-ask":{trigger:"studio-agent",pane:"studio-agent-panel",opens:"press",focus:"into",drawn:["studio"]}},xi={position:"fixed",inset:"auto",margin:0,zIndex:Mn("popover"),boxSizing:"border-box"},Qe=6,he=8,Ei=e=>typeof e.showPopover=="function";function et(e){try{return e.matches(":popover-open")}catch{return!1}}function ki(e){if(typeof e=="function"){let o=e();return o?{left:o.x,right:o.x,top:o.y,bottom:o.y}:null}let t=e.current;if(!t||!t.isConnected)return null;let n=t.getBoundingClientRect();return{left:n.left,right:n.right,top:n.top,bottom:n.bottom}}function Ht(e,t,n={}){let o=ki(t);if(!o)return;let r={width:document.documentElement.clientWidth||innerWidth,height:innerHeight},i=e.dataset.graviewDesignedHeight??=e.style.maxHeight;e.style.maxHeight=i;let a=e.getBoundingClientRect(),d=r.height-o.bottom-Qe-he,s=o.top-Qe-he,u=a.height<=d||d>=s,f=Math.max(96,Math.floor(u?d:s)),h=Math.min(a.height,f);a.height>f&&(e.style.maxHeight=i?`min(${i}, ${f}px)`:`${f}px`);let p=a.width,g=n.align==="start"?o.left:o.right-p,b=typeof t=="function"?null:t.current?.closest("[data-graview-embed]")?.getBoundingClientRect();b&&p<=b.right-b.left&&(g<b.left?g=o.left+p<=b.right?o.left:b.left:g+p>b.right&&(g=o.right-p>=b.left?o.right-p:b.right-p));let k=p>=r.width-2*he?Math.max(0,(r.width-p)/2):Math.max(he,Math.min(g,r.width-he-p)),m=u?o.bottom+Qe:Math.max(he,o.top-Qe-h);e.style.left=`${Math.round(k)}px`,e.style.top=`${Math.round(m)}px`}function Ko(e,t,n,o={}){let r=o.align??"end";(0,j.useLayoutEffect)(()=>{let i=e.current;if(!t||!i)return;if(Ei(i)&&!et(i))try{i.showPopover(),Pi()}catch{}let a=0,d=u=>{u?.target instanceof Node&&i.contains(u.target)||(cancelAnimationFrame(a),a=requestAnimationFrame(()=>Ht(i,n,{align:r})))};Ht(i,n,{align:r}),addEventListener("resize",d),addEventListener("scroll",d,!0);let s=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>d());return s?.observe(i),()=>{if(cancelAnimationFrame(a),removeEventListener("resize",d),removeEventListener("scroll",d,!0),s?.disconnect(),i.isConnected&&et(i))try{i.hidePopover()}catch{}}},[t,e,r])}var Dt=new Set;function Ai(e){return Dt.add(e),()=>Dt.delete(e)}function Pi(){for(let e of Dt)if(!(!e.isConnected||!et(e)))try{e.hidePopover(),e.showPopover()}catch{}}var Se=null,Ri='button:not([disabled]), [href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])';function Ti(e){for(let t of e.querySelectorAll(Ri))if(t.closest("[hidden]")===null&&getComputedStyle(t).visibility!=="hidden")return t;return e}var Vt=()=>{let e=document.activeElement;return e===null||e===document.body};function Mi(e,t={}){let{at:n,returnTo:o,onOpenChange:r}=t,i=t.popover!==!1,[a,d]=(0,j.useState)(!1),s=t.open??a,u=(0,j.useRef)(null),f=(0,j.useRef)(null),h=(0,j.useCallback)(y=>{u.current=y},[]),p=(0,j.useCallback)(y=>{f.current=y},[]),g=`graview-popover-${(0,j.useId)().replace(/:/g,"")}`,b=(0,j.useRef)({onOpenChange:r,returnTo:o,controlled:t.open!==void 0});b.current={onOpenChange:r,returnTo:o,controlled:t.open!==void 0};let k=(0,j.useCallback)(y=>{b.current.controlled||d(y),b.current.onOpenChange?.(y)},[]),m=(0,j.useCallback)(()=>{(document.querySelector(`[aria-controls="${g}"]`)??u.current??b.current.returnTo?.()??null)?.focus({preventScroll:!0})},[g]),w=(0,j.useCallback)(y=>{let x=f.current,P=typeof document>"u"?null:document.activeElement,G=P===null||P===document.body||x!==null&&x.contains(P);k(!1),!(!y||!G)&&(m(),requestAnimationFrame(()=>{Vt()&&m()}))},[k,m]);return Ko(f,i&&s,n??u,t.align?{align:t.align}:{}),(0,j.useEffect)(()=>{if(!i||!s)return;let y={name:e,close:()=>w(!1)};if(Se&&Se.close!==y.close&&Se.close(),Se=y,Lt[e].focus==="into"){let R=f.current;R&&!R.contains(document.activeElement)&&Ti(R).focus({preventScroll:!0})}let x=R=>{R.key==="Escape"&&w(!0)},P=R=>{let _=R.target;if(!(_ instanceof Node))return;let C=f.current;if(C?.contains(_)||u.current?.contains(_))return;let N=_ instanceof Element?_.closest('[role="dialog"], [role="alertdialog"]'):null;N&&!(C&&N.contains(C))||(w(!1),Lt[e].focus==="into"&&requestAnimationFrame(()=>{(Vt()||C!==null&&C.contains(document.activeElement))&&m()}))},G=null,I=null,E=R=>{let _=R.target;if(!(_ instanceof Element))return;let C=f.current,N=_.closest('[role="dialog"], [role="alertdialog"]');!N||C&&(C.contains(N)||N.contains(C))||(G=N,w(!1))};return document.addEventListener("keydown",x),document.addEventListener("pointerdown",P,!0),document.addEventListener("focusin",E),()=>{document.removeEventListener("keydown",x),document.removeEventListener("pointerdown",P,!0),document.removeEventListener("focusin",E);let R=G;R&&typeof MutationObserver<"u"&&(I?.disconnect(),I=new MutationObserver(()=>{R.isConnected||(I?.disconnect(),requestAnimationFrame(()=>{(Vt()||document.activeElement.closest("[hidden]")!==null)&&m()}))}),I.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>I?.disconnect(),10*6e4)),Se?.close===y.close&&(Se=null)}},[i,s,e,w,m]),{open:s,setOpen:y=>y?k(!0):w(!0),toggle:()=>s?w(!0):k(!0),trigger:{ref:h,"aria-expanded":s,"aria-controls":g,"data-graview-popover-trigger":e},pane:{ref:p,id:g,popover:"manual",tabIndex:-1,"data-graview-popover":e,"data-graview-overlay":""}}}var F=D(W(),1),X=D(Ie(),1),Nt=new Set,Bo=!1;function jt(){for(let e of[...Nt])e()}function Oi(){Bo||typeof window>"u"||(Bo=!0,window.addEventListener("online",jt))}function Ii(e){let t,n=!1,o=!1,r,i=0,a=new Set,d=()=>{i+=1;for(let p of[...a])p()},s=p=>(a.add(p),()=>void a.delete(p)),u=()=>i,f=()=>void h().catch(()=>{});function h(){if(n)return Promise.resolve(t);if(r)return r;let p=e().then(g=>(t=g,n=!0,o=!1,r=void 0,Nt.delete(f),d(),g),g=>{throw r=void 0,o=!0,Nt.add(f),Oi(),d(),g});return p.catch(()=>{}),r=p,p}return{load:h,prefetch:f,get current(){return t},get failed(){return o},part(p,g={}){let b=g.what??"This part";function k(y){(0,F.useSyncExternalStore)(s,u,u);let x=(0,F.useRef)(null),P=(0,F.useRef)(null),G=(0,F.useRef)(!1);return(0,F.useEffect)(()=>{o&&r===void 0&&f()},[]),n&&typeof document<"u"&&x.current!==null&&document.activeElement===x.current&&(G.current=!0),(0,F.useLayoutEffect)(()=>{if(!(!n||!G.current)){G.current=!1;for(let I=P.current?.nextElementSibling??null;I!==null;I=I.nextElementSibling){let E=I.matches($o)?I:I.querySelector($o);if(E instanceof HTMLElement){E.focus();return}}}}),n?(0,X.jsxs)(X.Fragment,{children:[G.current?(0,X.jsx)("span",{ref:P,hidden:!0}):null,p(t,y)]}):g.quiet?null:(0,X.jsx)(Ci,{what:b,button:x,...g.as?{as:g.as}:{}})}let m=(0,F.lazy)(()=>h().then(()=>({default:k}),()=>({default:k})));function w(y){let[x]=(0,F.useState)(()=>n||o);return(0,F.createElement)(x?k:m,y)}return w}}}var $o="button,a[href],input,select,textarea,[tabindex]:not([tabindex='-1'])";function Ci({what:e,button:t,as:n="p"}){let r=typeof navigator<"u"&&navigator.onLine===!1?`${e} will load when you're back online.`:`${e} didn't load.`;return(0,X.jsxs)(n,{"data-testid":"lazy-part-missing",style:{margin:0,fontSize:"0.875rem",color:"var(--graview-ink-muted)"},children:[(0,X.jsx)("span",{role:"status",children:r})," ",(0,X.jsx)("button",{ref:t,type:"button","data-testid":"lazy-part-retry",onClick:jt,style:{font:"inherit",fontWeight:600,color:"var(--graview-ink)",background:"none",border:"1px solid var(--graview-edge)",borderRadius:6,padding:"2px 10px"},children:"Try again"})]})}var we=D(W(),1);var qo=(0,we.createContext)(null);function _i(){let e=(0,we.useContext)(qo),t=Ct(),n=(o,r,i)=>t?.setView(a=>ae(ae(ce(q(a,te(o)),!1),"view",r),"filter",i?.filter??null));return(0,we.useMemo)(()=>e??{record:o=>{t&&(t.setView(r=>q(ce(r,!1),o)),t.setSelection([o]))},place:(o,r)=>{let i=t?.views.places().find(a=>a.as===o);i&&n(i.kind,i.as,r)},list:(o,r)=>n(o,null,r)},[e,t])}var zo=D(W(),1),Vi=(0,zo.createContext)(!1);var Uo=D(W(),1),Li=(0,Uo.createContext)(null);var Yo=D(W(),1),Gt='button:not([disabled]), a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])',Wt=e=>e instanceof HTMLElement&&(e.matches(Gt)||e.hasAttribute("tabindex")),_e=e=>typeof e.checkVisibility=="function"?e.checkVisibility():e.getClientRects().length>0;function Hi(e,t){let n=s=>s.replace(/["\\]/g,"\\$&"),o=t.getAttribute("data-testid"),r=t.getAttribute("data-graview-pick"),i=t.getAttribute("aria-label"),a=o?`[data-testid="${n(o)}"]`:r?`[data-graview-pick="${n(r)}"]`:i?`${t.tagName.toLowerCase()}[aria-label="${n(i)}"]`:null;if(!a)return null;let d=e.querySelector(a);return d&&Wt(d)&&_e(d)?d:null}var Di=e=>e.isConnected&&Wt(e)&&!e.matches(":disabled")&&e instanceof HTMLElement&&_e(e);function Xo(e,t){let n=t?Hi(e,t):null;if(n)return n;let o=e.querySelector("[data-graview-view][tabindex]");if(o&&_e(o))return o;for(let r of e.querySelectorAll(Gt))if(_e(r))return r;return Wt(e)&&_e(e)?e:null}function Ni(e){(0,Yo.useEffect)(()=>{let t=e.current;if(!t||typeof MutationObserver>"u")return;let n=[],o=m=>{let w=m.target;if(w instanceof Element){n=[];for(let y=w;y&&y!==t.parentElement;y=y.parentElement)n.push(y)}},r=!1,i=!1,a=t.ownerDocument,d=()=>!i&&a.defaultView!==null,s=(m,w)=>void setTimeout(()=>d()&&w(),m),u=m=>void requestAnimationFrame(()=>d()&&m()),f=m=>{if(r=!1,i)return;let w=a.activeElement;if(!(!(w===null||w===a.body||w===a.documentElement)||n.length===0)){if(Di(n[0])){m&&n[0]instanceof HTMLElement&&n[0].focus({preventScroll:!0});return}for(let x of n.slice(1)){if(!x.isConnected)continue;let P=Xo(x,n[0]);if(P){P.focus({preventScroll:!0}),n=[];return}}}},h=(m,w=Date.now()+2500)=>{s(100,()=>{f(m);let y=a.activeElement;(y===null||y===a.body||y===a.documentElement)&&n.length>0&&Date.now()<w&&h(m,w)})},p=()=>{r||n.length===0||(r=!0,s(60,()=>u(()=>{f(!1),h(!1)})))},g=m=>{if(!(m instanceof KeyboardEvent&&!["Enter"," ","Escape"].includes(m.key))){if(!(m instanceof KeyboardEvent)){let w=m.target instanceof Element?m.target.closest(Gt):null,y=a.activeElement,x=y===null||y===a.body||y===a.documentElement;if(w&&x&&t.contains(w)){n=[];for(let P=w;P&&P!==t.parentElement;P=P.parentElement)n.push(P);s(150,()=>u(()=>{f(!1),h(!1)}));return}}!(m instanceof KeyboardEvent)&&!(m.target instanceof Node&&n[0]?.contains(m.target))||s(150,()=>u(()=>{f(!0),h(!0)}))}},b=new MutationObserver(()=>{n.length>0&&!n[0].isConnected&&p()}),k=m=>{m.relatedTarget===null&&p()};return t.addEventListener("focusin",o),t.addEventListener("focusout",k),t.addEventListener("click",g),t.addEventListener("keydown",g),b.observe(t,{childList:!0,subtree:!0}),()=>{i=!0,t.removeEventListener("focusin",o),t.removeEventListener("focusout",k),t.removeEventListener("click",g),t.removeEventListener("keydown",g),b.disconnect()}},[e])}export{Hn as a,ue as b,ee as c,Ge as d,Wi as e,Fi as f,Nn as g,Dn as h,jn as i,dt as j,q as k,Gn as l,ae as m,ce as n,We as o,Me as p,Fe as q,Be as r,ut as s,fe as t,$i as u,fr as v,te as w,Wn as x,se as y,Fn as z,pr as A,qi as B,Kn as C,ct as D,yr as E,W as F,vt as G,Vr as H,Hr as I,so as J,ze as K,Dr as L,Oe as M,uo as N,Nr as O,xt as P,Ie as Q,Zr as R,Qr as S,Lo as T,ri as U,ai as V,Fa as W,ui as X,ne as Y,Ct as Z,Je as _,ci as $,fi as aa,pi as ba,It as ca,qo as da,_i as ea,yi as fa,jo as ga,Go as ha,Wo as ia,gi as ja,hi as ka,Vi as la,Li as ma,Si as na,wi as oa,bi as pa,me as qa,Ni as ra,xi as sa,et as ta,Ko as ua,Ai as va,Mi as wa,Ii as xa};
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
react/cjs/react.production.js:
|
|
5
|
+
(**
|
|
6
|
+
* @license React
|
|
7
|
+
* react.production.js
|
|
8
|
+
*
|
|
9
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the MIT license found in the
|
|
12
|
+
* LICENSE file in the root directory of this source tree.
|
|
13
|
+
*)
|
|
14
|
+
|
|
15
|
+
react/cjs/react-jsx-runtime.production.js:
|
|
16
|
+
(**
|
|
17
|
+
* @license React
|
|
18
|
+
* react-jsx-runtime.production.js
|
|
19
|
+
*
|
|
20
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
21
|
+
*
|
|
22
|
+
* This source code is licensed under the MIT license found in the
|
|
23
|
+
* LICENSE file in the root directory of this source tree.
|
|
24
|
+
*)
|
|
25
|
+
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as k}from"./chunk.G4JJXA63.js";import{a as Q}from"./chunk.QU356VB2.js";import{a as Y}from"./chunk.ZSW74NVJ.js";import{a as X}from"./chunk.PPUAPAWR.js";import{c as _}from"./chunk.FBY5IUGU.js";import{$a as q,Ic as G,Jc as H,Kc as P,Lc as J,ab as z}from"./chunk.X7W27IRI.js";var O=e=>"failed"in e;function ue(e,n){let r=e.schema.kinds,t=e.policy?.sees;if(!t?.length||z(n))return{kinds:r};let o=q(n).roles??[],i=new Set(t.filter(s=>s.roles==="*"||o.some(a=>s.roles.includes(a))).flatMap(s=>s.kinds));return{kinds:r.filter(s=>i.has(s))}}function L(e,n){if(!n)return e;let r=new Set(n.kinds.filter(i=>e.tryDefinition(i)!==void 0));if(r.size===e.kinds.length)return e;let t=new Map,o=i=>{if(r.has(i)){if(!t.has(i)){let s=e.tryDefinition(i),a=Object.fromEntries(Object.entries(s?.edges??{}).flatMap(([l,d])=>{if(d.to==="*")return[[l,d]];let c=d.to.filter(u=>r.has(u));return c.length>0?[[l,{...d,to:c}]]:[]}));t.set(i,{...s,edges:a})}return t.get(i)}};return{...e,definitions:e.definitions.filter(i=>r.has(i.kind)),kinds:e.kinds.filter(i=>r.has(i)),tryDefinition:o,definition:i=>{let s=o(i);if(!s)throw new Error(`Unknown node kind "${i}"`);return s}}}var fe=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),y=e=>fe(e).replace(/[-_]+/g," ").trim();function I(e){let n=[];for(let t of e.kinds){let o=e.tryDefinition(t);if(!o)continue;let i=o.display?.labels??{},s=Object.entries(o.fields?.shape??{}).filter(([d])=>d!=="id"&&d!=="kind").map(([d,c])=>{let u=X(c);return{name:d,type:u?.type,...u?.options?{options:u.options}:{},words:(i[d]??y(d)).toLowerCase()}}),a=Object.entries(o.edges??{}).map(([d,c])=>({name:d,from:t,to:c.to==="*"?e.kinds.filter(u=>u!==t):c.to,words:y(d)})),l=(o.plural??`${y(t)}s`).toLowerCase();n.push({kind:t,plural:l,noun:(o.noun??y(t)).toLowerCase(),fields:s,roles:o.fieldRoles??{},edges:a})}let r=new Map(n.map(t=>[t.kind,t]));return{schema:e,kinds:n,info:t=>r.get(t)}}var $=(e,n)=>n===void 0?void 0:e.fields.find(r=>r.name===n),R=e=>e?.type==="date"||e?.type==="datetime",N=e=>e?.type==="number"||e?.type==="integer"||e?.type==="duration",re=e=>` ${e.toLowerCase().replace(/[“”"’‘]/g,"'").replace(/[^\p{L}\p{N}' -]+/gu," ").replace(/\s+/g," ").trim()} `,E=(e,n)=>e.includes(` ${n} `),x=e=>e.endsWith("ies")?`${e.slice(0,-3)}y`:e.endsWith("ses")?e.slice(0,-2):e.endsWith("s")?e.slice(0,-1):e;function pe(e,n){let r=[];for(let t of n.kinds){let o=new Set([t.plural,t.noun,`${t.noun}s`,y(t.kind),`${y(t.kind)}s`]),i=-1;for(let s of o){let a=e.indexOf(` ${s} `);a>=0&&(i<0||a<i)&&(i=a)}i>=0&&r.push({info:t,at:i})}return r.sort((t,o)=>t.at-o.at).map(t=>t.info)}function v(e,n,r){let t=n.trim().toLowerCase();if(t.length===0)return;let o=e.fields.filter(i=>!r||r(i));return o.find(i=>i.words===t||y(i.name)===t||i.name.toLowerCase()===t)??o.find(i=>i.words===x(t)||y(i.name)===x(t))??o.find(i=>t.split(" ").some(s=>s.length>2&&(i.words.split(" ").includes(s)||i.words.split(" ").includes(x(s)))))}function oe(e,n,r){let t=n.trim().toLowerCase();if(t.length!==0)return e.edges.find(o=>o.words===t||o.name.toLowerCase()===t)??e.edges.find(o=>o.to.some(i=>{let s=r.info(i);return s!==void 0&&(s.noun===x(t)||s.plural===t||y(i)===x(t))}))??e.edges.find(o=>t.split(" ").some(i=>i.length>2&&o.words.split(" ").includes(i)))}function U(e){return/ (?:grouped |group |split |sorted |organi[sz]ed )?by ([\p{L}\p{N}' -]+?)(?= (?:and|with|for|in|on|only|where|from|this|that|as|sorted|grouped) |\s*$)/u.exec(e)?.[1]?.trim()}var me=/\bwho\b.*\b(covers?|cover|tends?|owns?|handles?|does|works? on|looks? after|is on|is assigned|staffs?|runs?)\b|\bcoverage\b|\bmatrix\b|\bwho covers\b/,ge=/\bcalendar\b|\bmonth\b|\bagenda\b|\bschedule\b|\bdue\b|\bdeadlines?\b|\bdates?\b|\bwhen\b/,ye=/\btimeline\b|\bover time\b|\bgantt\b|\bspans?\b|\bweek\b/,he=/\bboard\b|\bkanban\b|\bcolumns?\b|\bpipeline\b|\bstages?\b|\bstatus\b/,be=/\blaid out\b|\blayout\b|\bseating\b|\bwhere (?:they|it|each) (?:sits?|lies?|stands?)\b|\bfloor\b/,we=/\bplan\b|\bmap\b|\bregions?\b/,ke=/\blist\b|\btable\b|\bgroup(?:ed)? by\b|\bsort(?:ed)? by\b|\bonly\b|\bjust the\b/;function $e(e){let n=[];return/\blist\b|\btable\b/.test(e)&&n.push("blocks"),me.test(e)&&n.push("coverage"),be.test(e)&&n.push("board"),(/\bfloor plan\b/.test(e)||we.test(e))&&n.push("plan"),ye.test(e)&&n.push("timeline"),ge.test(e)&&n.push("calendar"),he.test(e)&&n.push("columns"),ke.test(e)&&!n.includes("blocks")&&n.push("blocks"),n.length===0&&U(e)&&n.push("columns"),n}var se=e=>{let n=r=>r?` and not ${r}`:"";if(/\boverdue\b|\blate\b|\bpast due\b/.test(e))return{cond:(r,t)=>`days(today(), ${r}) < 0${n(t)}`,says:r=>`overdue by ${r.words}`};if(/\btoday\b/.test(e))return{range:"day",cond:r=>`days(today(), ${r}) == 0`,says:r=>`with ${r.words} today`};if(/\bthis week\b|\bnext 7 days\b|\bnext week\b/.test(e))return{range:"week",cond:r=>`days(today(), ${r}) >= 0 and days(today(), ${r}) <= 6`,says:r=>`with ${r.words} in the next week`};if(/\bthis month\b|\bnext 30 days\b|\bnext month\b/.test(e))return{range:"month",cond:r=>`days(today(), ${r}) >= 0 and days(today(), ${r}) <= 30`,says:r=>`with ${r.words} in the next month`};if(/\blast month\b|\bpast month\b/.test(e))return{range:"month",cond:r=>`days(today(), ${r}) >= -30 and days(today(), ${r}) <= 0`,says:r=>`with ${r.words} in the last month`};if(/\bthis year\b/.test(e))return{range:"year",cond:r=>`days(today(), ${r}) >= 0 and days(today(), ${r}) <= 365`,says:r=>`with ${r.words} in the next year`};if(/\bquarter\b/.test(e))return{range:"quarter",cond:r=>`days(today(), ${r}) >= 0 and days(today(), ${r}) <= 91`,says:r=>`with ${r.words} in the next quarter`}},M=e=>{if(/\bagenda\b|\bin order\b/.test(e))return"agenda";if(/\btoday\b|\bday\b/.test(e))return"day";if(/\bweek\b/.test(e))return"week";if(/\bquarter\b/.test(e))return"quarter";if(/\byears\b/.test(e))return"years";if(/\byear\b/.test(e))return"year";if(/\bmonth\b/.test(e))return"month"},Z=/^(user|person|people|member|staff|gardener|volunteer|owner|agent|employee|worker|team|player|customer|client|contact|party|attendee|guest)s?$/,j=class extends Error{},h=e=>{throw new j(e)};function Se(e,n){let r=e.fields.filter(i=>i.type==="enum");if(n){let i=v(e,n);if(i&&i.type==="enum")return i;i&&h(`${e.plural}' ${i.words} is not a choice, so it has no columns`)}let t=$(e,e.roles.status??e.roles.column);if(t?.type==="enum")return t;let o=r.find(i=>/^(status|stage|state|phase)$/.test(i.name));return o||(r[0]?r[0]:h(`${e.plural} have no choice field to put in columns`))}function ee(e,n){let r=e.fields.filter(R),t=l=>{let d=$(e,e.roles[l]);return R(d)?d:void 0},i=r.find(l=>E(n,l.words)||E(n,y(l.name)))??t("start")??r.find(l=>/^(due|date|on|at|start|starts|begins|from|sown|when)/i.test(l.name))??r[0];if(!i)return h(`no date field on ${e.plural}`);let s=t("end")??r.find(l=>l!==i&&/^(end|ends|until|to|finish|finished|harvested|due|closes|through)/i.test(l.name)),a=e.fields.find(l=>l.type==="boolean"&&/^(done|finished|complete|completed|closed)$/.test(l.name));return{start:i,...s&&s!==i?{end:s}:{},...a?{done:a}:{}}}function ie(e){let n=$(e,e.roles.start),r=$(e,e.roles.end),t=$(e,e.roles.column??e.roles.day??e.roles.columns);if(N(n)&&N(r)&&t?.type==="enum")return{start:n,end:r,column:t}}function De(e,n,r,t){let o=[];for(let s of e.kinds)for(let a of s.edges)for(let l of a.to){let d=e.info(l);if(!d||d.kind===s.kind)continue;let c=0;n.includes(s)&&(c+=4),n.includes(d)&&(c+=4),(Z.test(d.kind)||Z.test(d.noun))&&(c+=3),t&&(a.words.includes(t)||d.noun===x(t))&&(c+=5),a.words.split(" ").some(u=>u.length>2&&r.includes(` ${u}`))&&(c+=2),o.push({rows:s,across:d,link:a,score:c})}let i=o.sort((s,a)=>a.score-s.score)[0];return i||h(n[0]?`${n[0].plural} are joined to nothing else, so there is no who-covers-what to draw`:"nothing here is joined to anything else, so there is no who-covers-what to draw")}function ae(e,n,r,t,o){let i=U(t);switch(e){case"columns":{if(i){let s=v(n,i);if(!s||s.type!=="enum"){let a=oe(n,i,r);if(a){let l=r.info(a.to[0]);return{lens:"coverage",kind:n.kind,across:l.kind,link:a.name}}}}return{lens:"columns",kind:n.kind,column:Se(n,i).name}}case"calendar":{let s=ee(n,t),a=M(t);return{lens:"calendar",kind:n.kind,start:s.start.name,...s.end?{end:s.end.name}:{},...s.done?{done:s.done.name}:{},...a?{range:a}:{}}}case"timeline":{let s=ie(n);if(s&&!/\bdates?\b|\bdue\b|\bdeadlines?\b|\bmonths?\b|\byears?\b/.test(t))return{lens:"timeline",kind:n.kind,start:s.start.name,end:s.end.name,column:s.column.name};let a=ee(n,t);return{lens:"calendar",kind:n.kind,start:a.start.name,...a.end?{end:a.end.name}:{},...a.done?{done:a.done.name}:{},range:M(t)??"quarter"}}case"coverage":{let s=De(r,o,t,i);return{lens:"coverage",kind:s.rows.kind,across:s.across.kind,link:s.link.name}}case"board":{let s=$(n,n.roles.x)??n.fields.find(c=>c.name==="x"),a=$(n,n.roles.y)??n.fields.find(c=>c.name==="y");if(!N(s)||!N(a))return h(`${n.plural} have no x and y to be laid out by`);let d=r.kinds.flatMap(c=>c.edges.filter(u=>u.to.includes(n.kind)&&c.kind!==n.kind))[0]??n.edges[0];return d?{lens:"board",kind:n.kind,x:s.name,y:a.name,fill:d.name,...d.from!==n.kind?{fillFrom:"occupant"}:{}}:h(`nothing is joined to ${n.plural} to fill them`)}case"plan":{let s=$(n,n.roles.outline)??n.fields.find(a=>a.name==="outline");return s?{lens:"plan",kind:n.kind,outline:s.name}:h(`${n.plural} have no outline to draw a plan from`)}case"blocks":{let s={lens:"blocks",kind:n.kind,as:/\bcards?\b/.test(t)?"card":"row"},a=/ group(?:ed)? by ([\p{L}\p{N} -]+?)(?= (?:and|only|sorted|with)|\s*$)/u.exec(t)?.[1]??(i&&!/ sort(?:ed)? by /.test(t)?i:void 0);if(a){let c=v(n,a);if(!c||c.type!=="enum")return h(c?`${n.plural}' ${c.words} is not a choice, so they cannot be grouped by it`:`${n.plural} have nothing called ${a} to group by`);s.group=c.name}let l=/ sort(?:ed)? by ([\p{L}\p{N} -]+?)(?= (?:and|only|grouped|with)|\s*$)/u.exec(t)?.[1];if(l){let c=v(n,l);if(!c)return h(`${n.plural} have nothing called ${l} to sort by`);s.sort={by:c.name,.../\b(newest|latest|desc|descending|most)\b/.test(t)?{direction:"desc"}:{}}}let d=V(n,t);return d.length>0&&(s.where=d),s}}}function V(e,n){let r=[],t=se(n);if(t){let o=e.fields.filter(R),i=$(e,e.roles.start),s=o.find(l=>E(n,l.words))??(R(i)?i:void 0)??o[0];(!s||!R(s))&&h(`no date field on ${e.plural}`);let a=e.fields.find(l=>l.type==="boolean"&&/^(done|finished|complete|completed|closed)$/.test(l.name));r.push({expr:t.cond(s.name,/\boverdue\b|\blate\b|\bpast due\b/.test(n)?a?.name:void 0),says:t.says(s)})}if(/\bonly\b|\bjust\b|\bthat are\b|\bwhich are\b/.test(n)){for(let o of e.fields){if(o.type!=="enum")continue;let i=o.options?.find(s=>E(n,s.toLowerCase())||E(n,y(s)));i&&r.push({expr:`${o.name} == '${i.replace(/'/g,"")}'`,says:`that are ${y(i)}`})}if(/\bnot done\b|\bundone\b|\bunfinished\b|\bopen ones\b|\bstill to do\b/.test(n)){let o=e.fields.find(i=>i.type==="boolean"&&/^(done|finished|complete|completed)$/.test(i.name));o&&r.push({expr:`not ${o.name}`,says:`not ${o.words}`})}}return r}var B={columns:"A board",calendar:"A calendar",timeline:"A timeline",coverage:"A grid",board:"A layout",plan:"A plan",blocks:"A list",reach:"A picture"};function Ae(e,n){let r=n.info(e.kind),t=o=>o?$(r,o)?.words??y(o):"";switch(e.lens){case"columns":return{title:`${k(r.plural)} by ${t(e.column)}`,detail:`of ${r.plural} by ${t(e.column)}`};case"calendar":{let o=e.range??"month";if(o==="agenda")return{title:`${k(r.plural)} in date order`,detail:`of ${r.plural} in order of ${t(e.start)}`};let i=o==="years"?"year":o;return{title:`${k(r.plural)} by ${i}`,detail:`of ${r.plural} by ${t(e.start)}, a ${i} at a time`}}case"timeline":return{title:`${k(r.plural)} over the ${t(e.column)}`,detail:`of ${r.plural} from ${t(e.start)} to ${t(e.end)}, by ${t(e.column)}`};case"coverage":{let o=n.info(e.across);return{title:`${k(r.plural)} by ${o.noun}`,detail:`of which ${o.noun} covers which ${r.noun}`}}case"board":return{title:`${k(r.plural)} where they stand`,detail:`of ${r.plural} where they stand`};case"plan":return{title:`${k(r.plural)} on a plan`,detail:`of ${r.plural}`};default:{let o=[e.where?.map(i=>i.says).join(" and "),e.group?`by ${t(e.group)}`:void 0,e.sort?`in order of ${t(e.sort.by)}`:void 0].filter(i=>!!i);return{title:[k(r.plural),...o].join(" "),detail:[`of ${r.plural}`,...o].join(" ")}}}}function Re(e,n){let r={title:n,on:e.kind};switch(e.lens){case"columns":return{name:"columns",...r,bindings:{[e.kind]:{column:e.column}}};case"calendar":return{name:"calendar",...r,bindings:{[e.kind]:{start:e.start,...e.end?{end:e.end}:{},...e.done?{done:e.done}:{}}},...e.range?{options:{range:e.range}}:{}};case"timeline":return{name:"timeline",...r,bindings:{[e.kind]:{start:e.start,end:e.end,column:e.column}}};case"coverage":return{name:"coverage",...r,bindings:{rows:{kind:e.kind},columns:{kind:e.across},link:{edge:e.link}}};case"board":return{name:"board",...r,bindings:{slots:{kind:e.kind},x:{field:e.x,on:"slots"},y:{field:e.y,on:"slots"},fill:{edge:e.fill}},...e.fillFrom?{options:{fillFrom:e.fillFrom}}:{}};case"plan":return{name:"plan",...r,bindings:{regions:{kind:e.kind},outline:{field:e.outline,on:"regions"}}};default:{let t=e.where?.length?` where ${e.where.map(i=>e.where.length>1?`(${i.expr})`:i.expr).join(" and ")}`:"",o={list:`all('${e.kind}')${t}`,as:e.as??"row"};return e.group&&(o.group=e.group),e.sort&&(o.sort=e.sort.direction?{by:e.sort.by,direction:e.sort.direction}:e.sort.by),o.empty="Nothing here yet.",{name:"blocks",...r,options:{blocks:[o]}}}}}function C(e,n){let r=o=>o.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,""),t=new Set(["home","overview",...Q(n).map(o=>o.slug),...(n.lenses??[]).flatMap(o=>o.title?[r(o.title)]:[])]);if(!t.has(r(e)))return e;for(let o=2;;o++)if(!t.has(r(`${e} ${o}`)))return`${e} ${o}`}var ne={title:[],headline:[],text:["tone"],figure:["as","currency","label"],list:["sort","limit","group","empty","as"],progress:["label"],group:["direction"],when:["show"],divider:[]};function Ee(e,n){if(!Array.isArray(n)||n.length===0)return"it has no blocks to draw";if(n.length>40)return"it has more blocks than a place draws";let r=(s,a)=>{if(typeof s!="string"||s.trim()==="")return`its ${a} says nothing`;try{return _(s)}catch(l){return`its ${a} does not read: ${l instanceof Error?l.message.replace(/ \(at character.*$/,""):String(l)}`}},t=s=>{if(s.t==="where")return t(s.set);if(s.t==="call"&&s.fn==="all"){let a=s.args[0];return a?.t==="lit"&&typeof a.value=="string"?e.info(a.value)??null:void 0}},o=(s,a)=>{switch(s.t){case"lit":return;case"ident":return a&&!a.fields.some(l=>l.name===s.name)&&!a.edges.some(l=>l.name===s.name)?`${a.plural} have nothing called ${s.name}`:void 0;case"member":return o(s.object,a);case"list":return s.items.map(l=>o(l,a)).find(Boolean);case"unary":return o(s.operand,a);case"binary":return o(s.left,a)??o(s.right,a);case"where":{let l=t(s.set);return l===null?"Nothing by that name here":o(s.set,a)??o(s.filter,l??void 0)}case"call":return s.fn==="all"?t(s)===null?"Nothing by that name here":void 0:s.args.map(l=>o(l,a)).find(Boolean)}},i=(s,a)=>{if(a>4)return"its blocks nest deeper than a place draws";for(let l of s){if(!w(l))return"a block is not an object";let d=Object.keys(ne).find(p=>p in l);if(!d)return`"${Object.keys(l)[0]??""}" is not a block a place draws`;let c=Object.keys(l).find(p=>p!==d&&p!=="key"&&!ne[d].includes(p));if(c)return`a ${d} block takes no "${c}"`;let u=l[d];if(d==="list"||d==="figure"||d==="when"){if(d==="figure"&&u===!0)continue;let p=r(u,d);if(typeof p=="string")return p;let g=o(p,void 0);if(g)return g;if(d==="list"){let f=t(p);if(f==null)return f===null?"Nothing by that name here":"its list does not say which records it lists, like all('task')";for(let m of["group","sort"]){let b=l[m],S=typeof b=="string"?b:w(b)&&typeof b.by=="string"?b.by:void 0;if(b===void 0)continue;let D=S?f.fields.find(ce=>ce.name===S):void 0;if(!D)return`${f.plural} have nothing called ${String(S??b)} to ${m} by`;if(m==="group"&&D.type!=="enum")return`${f.plural}' ${D.words} is not a choice, so they cannot be grouped by it`}}if(d==="when"){let f=l.show;if(!Array.isArray(f))return"a when block shows a list of blocks";let m=i(f,a+1);if(m)return m}}else if(d==="group"){if(!Array.isArray(u))return"a group block holds a list of blocks";let p=i(u,a+1);if(p)return p}else{if(d!=="divider"&&typeof u!="string")return`a ${d} block says words`;if(typeof u=="string")for(let p of u.matchAll(/\{([^{}]*)\}/g)){let g=p[1].split(/\|(?![|])/)[0],f=r(g,`${d}'s braces`);if(typeof f=="string")return f;let m=o(f,void 0);if(m)return m}}}};return i(n,1)}function T(e,n,r){let t=L(e.schema,r),o=f=>({ok:!1,failed:`Couldn't draw that: ${f.replace(/\.$/,"")}.`});if(!P(n.name)||n.name==="reach")return o(`"${String(n.name)}" is not a picture the seat can draw; it draws ${H.filter(f=>f!=="reach").join(", ")}`);if(typeof n.title!="string"||n.title.trim().length===0||n.title.length>80)return o("it needs a title of a few words");if(typeof n.on!="string"||!t.tryDefinition(n.on))return o("Nothing by that name here");let i=G[n.name],s=n.bindings??{};if(i.binds==="fields")for(let[f,m]of Object.entries(s)){if(!t.tryDefinition(f))return o("Nothing by that name here");let b=Object.keys(t.tryDefinition(f).fields?.shape??{});for(let[S,D]of Object.entries(m??{}))if(typeof D!="string"||!b.includes(D))return o(`${y(f)} has no field "${String(D)}" for its ${S}`);for(let S of i.requiredRoles)if(!(S in(m??{})))return o(`a ${n.name} needs ${y(f)}'s ${S}`)}else if(i.binds==="entities")for(let f of i.requiredRoles){let m=s[f];if(!m)return o(`a ${n.name} needs its ${f}`);if(typeof m.kind=="string"&&!t.tryDefinition(m.kind))return o("Nothing by that name here")}let a={...e,schema:t,lenses:[...e.lenses??[],n]},l=a.lenses.length-1,d=J(a),c=`lenses.${l}`,u=d.findings.find(f=>f.path===c||f.path.startsWith(`${c}.`));if(u)return o(u.message.replace(/^"[^"]*" /,"it "));let p=d.undrawn.find(f=>f.index===l);if(p)return o(p.why);let g=d.drawn.find(f=>f.index===l);if(!g)return o("its bindings name something the app does not have");if(g.as==="overview")return o(`"${n.title}" is the scene's own address; give it another title`);if(n.name==="blocks"){let f=Ee(I(t),n.options?.blocks);if(f)return o(f)}return{ok:!0,drawn:g}}function K(e){return{op:"add-lens",title:e.title,lens:e.name,on:e.on,...e.bindings?{bindings:e.bindings}:{},...e.options?{options:e.options}:{}}}function xe(e){return{op:"remove-lens",title:e.title,on:e.on}}var w=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function de(e){let n=w(e)?e:{},r=String(n.lens??n.name??""),t=n.bindings,o=typeof n.on=="string"?n.on:w(t)&&G[r]?.binds==="fields"?Object.keys(t)[0]??"":"";return{name:r,title:typeof n.title=="string"?n.title.trim():"",on:o,...w(t)?{bindings:t}:{},...w(n.options)?{options:n.options}:{}}}function ve(e){let n=o=>w(e.bindings?.[o])?e.bindings[o]:{},r=o=>typeof o=="string"?o:void 0,t=n(e.on);switch(e.name){case"columns":return r(t.column)?{lens:"columns",kind:e.on,column:t.column}:void 0;case"calendar":{let o=r(e.options?.range);return r(t.start)?{lens:"calendar",kind:e.on,start:t.start,...r(t.end)?{end:t.end}:{},...r(t.done)?{done:t.done}:{},...o?{range:o}:{}}:void 0}case"timeline":return r(t.start)&&r(t.end)&&r(t.column)?{lens:"timeline",kind:e.on,start:t.start,end:t.end,column:t.column}:void 0;case"coverage":{let o=w(e.bindings?.columns)?r(e.bindings.columns.kind):void 0,i=w(e.bindings?.link)?r(e.bindings.link.edge):void 0;return o&&i?{lens:"coverage",kind:e.on,across:o,link:i}:void 0}case"blocks":{let o=e.options?.blocks;if(!Array.isArray(o)||o.length!==1||!w(o[0]))return;let i=o[0],s=new RegExp(`^all\\('${e.on}'\\)(?: where (.+))?$`).exec(String(i.list??""));if(!s)return;let a=i.sort;return{lens:"blocks",kind:e.on,as:i.as==="card"?"card":"row",...typeof i.group=="string"?{group:i.group}:{},...typeof a=="string"?{sort:{by:a}}:w(a)&&typeof a.by=="string"?{sort:{by:a.by,...a.direction==="desc"?{direction:"desc"}:{}}}:{},...s[1]?{where:[{expr:s[1],says:"as asked"}]}:{}}}default:return}}function W(e,n,r,t,o){let i=I(L(e.schema,t)).info(n.on),s=ve(n);return{title:n.title,said:`${B[n.name]??"A picture"} of ${i?.plural??y(n.on)}.`,kind:n.on,lens:n,drawn:r,edit:K(n),by:o,asks:[],...s?{recipe:s}:{}}}function te(e){return{title:e.title,said:e.said,lens:{title:e.lens.title,lens:e.lens.name,on:e.lens.on,...e.lens.bindings?{bindings:e.lens.bindings}:{},...e.lens.options?{options:e.lens.options}:{}},edit:e.edit,by:e.by,check:"It draws, and graview check would take it."}}function F(e,n,r,t,o){let i=Ae(e,n),s=e.title??o??C(i.title,r.app),a=Re(e,s),l=T(r.app,a,r.sight);return l.ok?{title:s,said:`${B[e.lens]} ${i.detail}.`,kind:e.kind,lens:a,drawn:l.drawn,edit:K(a),by:"template",asks:t,recipe:e}:{failed:l.failed,...r.lastGood?{lastGood:r.lastGood}:{}}}function Ye(e,n){let r=I(L(n.app.schema,n.sight)),t=r.info(e.kind);if(!t)return{failed:"Couldn't draw that: Nothing by that name here."};let o=e.lens==="blocks"&&!e.group&&!e.sort&&!e.where?.length&&e.title===void 0;return F(o?{...e,title:C(`Every ${t.noun}`,n.app)}:e,r,n,[])}function Le(e,n,r,t){if(r.length>0)return r;let o=s=>{switch(e){case"columns":return s.fields.some(a=>a.type==="enum");case"calendar":return s.fields.some(R);case"timeline":return ie(s)!==void 0||s.fields.some(R);case"coverage":return s.edges.some(a=>a.to.some(l=>l!==s.kind));case"board":return s.fields.some(a=>a.name==="x")&&s.fields.some(a=>a.name==="y");case"plan":return s.fields.some(a=>a.name==="outline")||s.roles.outline!==void 0;default:return!0}};return[...n.kinds.filter(o)].sort((s,a)=>Number(a.fields.some(l=>E(t,l.words)))-Number(s.fields.some(l=>E(t,l.words))))}function Ie(e,n){let r=I(L(n.app.schema,n.sight)),t=re(e),o=$e(t);if(o.length===0)return;let i=pe(t,r),s;for(let a of o){let l=a==="coverage"?[i[0]??r.kinds[0]].filter(d=>!!d):Le(a,r,i,t);for(let d of l)try{let c=ae(a,d,r,t,i),u=F(c,r,n,[e]);if(!O(u))return u;s??=u.failed}catch(c){if(!(c instanceof j))throw c;s??=`Couldn't draw that: ${c.message}.`}l.length===0&&i.length===0&&(s??=`Couldn't draw that: nothing here has what ${B[a].toLowerCase()} needs.`)}return{failed:s??"Couldn't draw that: Nothing by that name here.",...n.lastGood?{lastGood:n.lastGood}:{}}}async function Oe(e,n){let r=n.lastGood?{lastGood:n.lastGood}:{};if(e.trim().length===0)return{failed:"Say what you would like to see, like \u201Ca board of tasks by status\u201D.",...r};let t=Ie(e,n);if(t&&!O(t))return t;if(!n.complete)return t??{failed:"Couldn't draw that: drawing freely needs AI, which isn't on here. Ask for a board, a calendar, a timeline, a list or who covers what.",...r};let o=await le(e,n,void 0);return O(o)&&t?t:o}async function je(e,n,r){let t={lastGood:e},o={...r,lastGood:e},i=I(L(r.app.schema,r.sight)),s=re(n),a=i.info(e.kind),l=[...e.asks,n];if(!a)return{failed:"Couldn't change that: Nothing by that name here.",...t};let d=e.recipe,c=/^ (?:call|name|title) (?:it|this)? ?(.+?) $/.exec(s)??/ (?:call|name) it (.+?) $/.exec(s);try{if(c){let g=n.replace(/^.*?\b(?:call|name|title)\b\s*(?:it|this)?\s*/i,"").replace(/^["“']|["”']$/g,"").trim();if(g.length===0)return{failed:"Couldn't change that: say what to call it.",...t};let f={...e.lens,title:C(g,r.app)},m=T(r.app,f,r.sight);return m.ok?{...e,title:f.title,lens:f,drawn:m.drawn,edit:K(f),asks:l,...d?{recipe:{...d,title:f.title}}:{}}:{failed:m.failed,...t}}let p=/ as (?:a |an )?(board|kanban|calendar|timeline|list|table|cards|rows|grid|plan|layout)\b/.exec(s);if(p){let g=p[1]==="board"||p[1]==="kanban"?"columns":p[1]==="calendar"?"calendar":p[1]==="timeline"?"timeline":p[1]==="grid"?"coverage":p[1]==="plan"?"plan":p[1]==="layout"?"board":"blocks",f=ae(g,a,i,s,[a]),m=p[1]==="cards"?"card":p[1]==="rows"?"row":void 0,b=g==="blocks"&&d?.lens==="blocks"?{...d,...m?{as:m}:{}}:g==="blocks"&&d?.lens==="columns"?{...f,group:d.column,...m?{as:m}:{}}:f;return F(A(b),i,o,l)}if(d){let g=Te(d,a,i,s);if(g)return F(g,i,o,l)}}catch(p){if(!(p instanceof j))throw p;return{failed:`Couldn't change that: ${p.message}.`,...t}}if(!r.complete)return{failed:"Couldn't change that: changing it freely needs AI, which isn't on here. Try \u201Cgroup by status\u201D, \u201Conly this month\u201D or \u201Cas a calendar\u201D.",...t};let u=await le(n,o,e);return O(u)?u:{...u,asks:l}}var A=e=>{let{title:n,...r}=e;return r};function Te(e,n,r,t){let o=/ (?:group(?:ed)?|split|organi[sz]ed?|put them|columns) by ([\p{L}\p{N} -]+?)(?= (?:and|only|with)|\s*$)/u.exec(t)?.[1]??(/^ by /.test(t)?U(t):void 0);if(o){let d=v(n,o);if(d?.type==="enum")return e.lens==="blocks"?{...A(e),group:d.name}:{lens:"columns",kind:e.kind,column:d.name};let c=oe(n,o,r);return c?{lens:"coverage",kind:e.kind,across:c.to[0],link:c.name}:h(d?`${n.plural}' ${d.words} is not a choice, so they cannot be grouped by it`:`${n.plural} have nothing called ${o} to group by`)}let i=/ (?:sort(?:ed)?|order(?:ed)?) by ([\p{L}\p{N} -]+?)(?= (?:and|only|with)|\s*$)/u.exec(t)?.[1];if(i){let d=v(n,i);return d?{...e.lens==="blocks"?A(e):{lens:"blocks",kind:e.kind,as:"row",...e.lens==="columns"?{group:e.column}:{}},sort:{by:d.name,.../\b(newest|latest|desc|descending|most)\b/.test(t)?{direction:"desc"}:{}}}:h(`${n.plural} have nothing called ${i} to sort by`)}if(/\b(?:all of them|everything|show all|clear the filter|no filter|without the filter)\b/.test(t)){if(e.lens!=="blocks"||!e.where)return h("it already shows all of them");let{where:d,...c}=A(e);return c}let s=se(t);if(s&&e.lens==="calendar"&&s.range)return{...A(e),range:s.range};if(s&&e.lens==="calendar"&&!s.range)return{lens:"blocks",kind:e.kind,as:"row",sort:{by:e.start},where:V(n,t)};let a=V(n,t);if(a.length>0){let d=e.lens==="blocks"?A(e):{lens:"blocks",kind:e.kind,as:"row",...e.lens==="columns"?{group:e.column}:{}};return{...d,where:[...d.where??[],...a]}}let l=e.lens==="calendar"?M(t):void 0;if(l)return{...A(e),range:l}}function Ne(e){return e.kinds.map(n=>{let r=n.fields.map(i=>`${i.name} (${i.type??"value"}${i.options?`: ${i.options.join(" | ")}`:""})`).join(", "),t=n.edges.map(i=>`${i.name} \u2192 ${i.to.join(" | ")}`).join(", "),o=Object.entries(n.roles).map(([i,s])=>`${i}=${s}`).join(", ");return`- ${n.kind} ("${n.plural}"): ${r}${t?`; relations: ${t}`:""}${o?`; roles: ${o}`:""}`}).join(`
|
|
1
|
+
import{a as k}from"./chunk.G4JJXA63.js";import{a as Q}from"./chunk.ZEW2OOZ5.js";import{a as Y}from"./chunk.ACEYGWMO.js";import{a as X}from"./chunk.P75TPZWT.js";import{c as _}from"./chunk.2B4WVCVV.js";import{Jc as G,Kc as H,Lc as P,Mc as J,ab as q,bb as z}from"./chunk.F5BCCGFK.js";var O=e=>"failed"in e;function ue(e,n){let r=e.schema.kinds,t=e.policy?.sees;if(!t?.length||z(n))return{kinds:r};let o=q(n).roles??[],i=new Set(t.filter(s=>s.roles==="*"||o.some(a=>s.roles.includes(a))).flatMap(s=>s.kinds));return{kinds:r.filter(s=>i.has(s))}}function L(e,n){if(!n)return e;let r=new Set(n.kinds.filter(i=>e.tryDefinition(i)!==void 0));if(r.size===e.kinds.length)return e;let t=new Map,o=i=>{if(r.has(i)){if(!t.has(i)){let s=e.tryDefinition(i),a=Object.fromEntries(Object.entries(s?.edges??{}).flatMap(([l,d])=>{if(d.to==="*")return[[l,d]];let c=d.to.filter(u=>r.has(u));return c.length>0?[[l,{...d,to:c}]]:[]}));t.set(i,{...s,edges:a})}return t.get(i)}};return{...e,definitions:e.definitions.filter(i=>r.has(i.kind)),kinds:e.kinds.filter(i=>r.has(i)),tryDefinition:o,definition:i=>{let s=o(i);if(!s)throw new Error(`Unknown node kind "${i}"`);return s}}}var fe=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),y=e=>fe(e).replace(/[-_]+/g," ").trim();function I(e){let n=[];for(let t of e.kinds){let o=e.tryDefinition(t);if(!o)continue;let i=o.display?.labels??{},s=Object.entries(o.fields?.shape??{}).filter(([d])=>d!=="id"&&d!=="kind").map(([d,c])=>{let u=X(c);return{name:d,type:u?.type,...u?.options?{options:u.options}:{},words:(i[d]??y(d)).toLowerCase()}}),a=Object.entries(o.edges??{}).map(([d,c])=>({name:d,from:t,to:c.to==="*"?e.kinds.filter(u=>u!==t):c.to,words:y(d)})),l=(o.plural??`${y(t)}s`).toLowerCase();n.push({kind:t,plural:l,noun:(o.noun??y(t)).toLowerCase(),fields:s,roles:o.fieldRoles??{},edges:a})}let r=new Map(n.map(t=>[t.kind,t]));return{schema:e,kinds:n,info:t=>r.get(t)}}var $=(e,n)=>n===void 0?void 0:e.fields.find(r=>r.name===n),R=e=>e?.type==="date"||e?.type==="datetime",N=e=>e?.type==="number"||e?.type==="integer"||e?.type==="duration",re=e=>` ${e.toLowerCase().replace(/[“”"’‘]/g,"'").replace(/[^\p{L}\p{N}' -]+/gu," ").replace(/\s+/g," ").trim()} `,E=(e,n)=>e.includes(` ${n} `),x=e=>e.endsWith("ies")?`${e.slice(0,-3)}y`:e.endsWith("ses")?e.slice(0,-2):e.endsWith("s")?e.slice(0,-1):e;function pe(e,n){let r=[];for(let t of n.kinds){let o=new Set([t.plural,t.noun,`${t.noun}s`,y(t.kind),`${y(t.kind)}s`]),i=-1;for(let s of o){let a=e.indexOf(` ${s} `);a>=0&&(i<0||a<i)&&(i=a)}i>=0&&r.push({info:t,at:i})}return r.sort((t,o)=>t.at-o.at).map(t=>t.info)}function v(e,n,r){let t=n.trim().toLowerCase();if(t.length===0)return;let o=e.fields.filter(i=>!r||r(i));return o.find(i=>i.words===t||y(i.name)===t||i.name.toLowerCase()===t)??o.find(i=>i.words===x(t)||y(i.name)===x(t))??o.find(i=>t.split(" ").some(s=>s.length>2&&(i.words.split(" ").includes(s)||i.words.split(" ").includes(x(s)))))}function oe(e,n,r){let t=n.trim().toLowerCase();if(t.length!==0)return e.edges.find(o=>o.words===t||o.name.toLowerCase()===t)??e.edges.find(o=>o.to.some(i=>{let s=r.info(i);return s!==void 0&&(s.noun===x(t)||s.plural===t||y(i)===x(t))}))??e.edges.find(o=>t.split(" ").some(i=>i.length>2&&o.words.split(" ").includes(i)))}function U(e){return/ (?:grouped |group |split |sorted |organi[sz]ed )?by ([\p{L}\p{N}' -]+?)(?= (?:and|with|for|in|on|only|where|from|this|that|as|sorted|grouped) |\s*$)/u.exec(e)?.[1]?.trim()}var me=/\bwho\b.*\b(covers?|cover|tends?|owns?|handles?|does|works? on|looks? after|is on|is assigned|staffs?|runs?)\b|\bcoverage\b|\bmatrix\b|\bwho covers\b/,ge=/\bcalendar\b|\bmonth\b|\bagenda\b|\bschedule\b|\bdue\b|\bdeadlines?\b|\bdates?\b|\bwhen\b/,ye=/\btimeline\b|\bover time\b|\bgantt\b|\bspans?\b|\bweek\b/,he=/\bboard\b|\bkanban\b|\bcolumns?\b|\bpipeline\b|\bstages?\b|\bstatus\b/,be=/\blaid out\b|\blayout\b|\bseating\b|\bwhere (?:they|it|each) (?:sits?|lies?|stands?)\b|\bfloor\b/,we=/\bplan\b|\bmap\b|\bregions?\b/,ke=/\blist\b|\btable\b|\bgroup(?:ed)? by\b|\bsort(?:ed)? by\b|\bonly\b|\bjust the\b/;function $e(e){let n=[];return/\blist\b|\btable\b/.test(e)&&n.push("blocks"),me.test(e)&&n.push("coverage"),be.test(e)&&n.push("board"),(/\bfloor plan\b/.test(e)||we.test(e))&&n.push("plan"),ye.test(e)&&n.push("timeline"),ge.test(e)&&n.push("calendar"),he.test(e)&&n.push("columns"),ke.test(e)&&!n.includes("blocks")&&n.push("blocks"),n.length===0&&U(e)&&n.push("columns"),n}var se=e=>{let n=r=>r?` and not ${r}`:"";if(/\boverdue\b|\blate\b|\bpast due\b/.test(e))return{cond:(r,t)=>`days(today(), ${r}) < 0${n(t)}`,says:r=>`overdue by ${r.words}`};if(/\btoday\b/.test(e))return{range:"day",cond:r=>`days(today(), ${r}) == 0`,says:r=>`with ${r.words} today`};if(/\bthis week\b|\bnext 7 days\b|\bnext week\b/.test(e))return{range:"week",cond:r=>`days(today(), ${r}) >= 0 and days(today(), ${r}) <= 6`,says:r=>`with ${r.words} in the next week`};if(/\bthis month\b|\bnext 30 days\b|\bnext month\b/.test(e))return{range:"month",cond:r=>`days(today(), ${r}) >= 0 and days(today(), ${r}) <= 30`,says:r=>`with ${r.words} in the next month`};if(/\blast month\b|\bpast month\b/.test(e))return{range:"month",cond:r=>`days(today(), ${r}) >= -30 and days(today(), ${r}) <= 0`,says:r=>`with ${r.words} in the last month`};if(/\bthis year\b/.test(e))return{range:"year",cond:r=>`days(today(), ${r}) >= 0 and days(today(), ${r}) <= 365`,says:r=>`with ${r.words} in the next year`};if(/\bquarter\b/.test(e))return{range:"quarter",cond:r=>`days(today(), ${r}) >= 0 and days(today(), ${r}) <= 91`,says:r=>`with ${r.words} in the next quarter`}},M=e=>{if(/\bagenda\b|\bin order\b/.test(e))return"agenda";if(/\btoday\b|\bday\b/.test(e))return"day";if(/\bweek\b/.test(e))return"week";if(/\bquarter\b/.test(e))return"quarter";if(/\byears\b/.test(e))return"years";if(/\byear\b/.test(e))return"year";if(/\bmonth\b/.test(e))return"month"},Z=/^(user|person|people|member|staff|gardener|volunteer|owner|agent|employee|worker|team|player|customer|client|contact|party|attendee|guest)s?$/,j=class extends Error{},h=e=>{throw new j(e)};function Se(e,n){let r=e.fields.filter(i=>i.type==="enum");if(n){let i=v(e,n);if(i&&i.type==="enum")return i;i&&h(`${e.plural}' ${i.words} is not a choice, so it has no columns`)}let t=$(e,e.roles.status??e.roles.column);if(t?.type==="enum")return t;let o=r.find(i=>/^(status|stage|state|phase)$/.test(i.name));return o||(r[0]?r[0]:h(`${e.plural} have no choice field to put in columns`))}function ee(e,n){let r=e.fields.filter(R),t=l=>{let d=$(e,e.roles[l]);return R(d)?d:void 0},i=r.find(l=>E(n,l.words)||E(n,y(l.name)))??t("start")??r.find(l=>/^(due|date|on|at|start|starts|begins|from|sown|when)/i.test(l.name))??r[0];if(!i)return h(`no date field on ${e.plural}`);let s=t("end")??r.find(l=>l!==i&&/^(end|ends|until|to|finish|finished|harvested|due|closes|through)/i.test(l.name)),a=e.fields.find(l=>l.type==="boolean"&&/^(done|finished|complete|completed|closed)$/.test(l.name));return{start:i,...s&&s!==i?{end:s}:{},...a?{done:a}:{}}}function ie(e){let n=$(e,e.roles.start),r=$(e,e.roles.end),t=$(e,e.roles.column??e.roles.day??e.roles.columns);if(N(n)&&N(r)&&t?.type==="enum")return{start:n,end:r,column:t}}function De(e,n,r,t){let o=[];for(let s of e.kinds)for(let a of s.edges)for(let l of a.to){let d=e.info(l);if(!d||d.kind===s.kind)continue;let c=0;n.includes(s)&&(c+=4),n.includes(d)&&(c+=4),(Z.test(d.kind)||Z.test(d.noun))&&(c+=3),t&&(a.words.includes(t)||d.noun===x(t))&&(c+=5),a.words.split(" ").some(u=>u.length>2&&r.includes(` ${u}`))&&(c+=2),o.push({rows:s,across:d,link:a,score:c})}let i=o.sort((s,a)=>a.score-s.score)[0];return i||h(n[0]?`${n[0].plural} are joined to nothing else, so there is no who-covers-what to draw`:"nothing here is joined to anything else, so there is no who-covers-what to draw")}function ae(e,n,r,t,o){let i=U(t);switch(e){case"columns":{if(i){let s=v(n,i);if(!s||s.type!=="enum"){let a=oe(n,i,r);if(a){let l=r.info(a.to[0]);return{lens:"coverage",kind:n.kind,across:l.kind,link:a.name}}}}return{lens:"columns",kind:n.kind,column:Se(n,i).name}}case"calendar":{let s=ee(n,t),a=M(t);return{lens:"calendar",kind:n.kind,start:s.start.name,...s.end?{end:s.end.name}:{},...s.done?{done:s.done.name}:{},...a?{range:a}:{}}}case"timeline":{let s=ie(n);if(s&&!/\bdates?\b|\bdue\b|\bdeadlines?\b|\bmonths?\b|\byears?\b/.test(t))return{lens:"timeline",kind:n.kind,start:s.start.name,end:s.end.name,column:s.column.name};let a=ee(n,t);return{lens:"calendar",kind:n.kind,start:a.start.name,...a.end?{end:a.end.name}:{},...a.done?{done:a.done.name}:{},range:M(t)??"quarter"}}case"coverage":{let s=De(r,o,t,i);return{lens:"coverage",kind:s.rows.kind,across:s.across.kind,link:s.link.name}}case"board":{let s=$(n,n.roles.x)??n.fields.find(c=>c.name==="x"),a=$(n,n.roles.y)??n.fields.find(c=>c.name==="y");if(!N(s)||!N(a))return h(`${n.plural} have no x and y to be laid out by`);let d=r.kinds.flatMap(c=>c.edges.filter(u=>u.to.includes(n.kind)&&c.kind!==n.kind))[0]??n.edges[0];return d?{lens:"board",kind:n.kind,x:s.name,y:a.name,fill:d.name,...d.from!==n.kind?{fillFrom:"occupant"}:{}}:h(`nothing is joined to ${n.plural} to fill them`)}case"plan":{let s=$(n,n.roles.outline)??n.fields.find(a=>a.name==="outline");return s?{lens:"plan",kind:n.kind,outline:s.name}:h(`${n.plural} have no outline to draw a plan from`)}case"blocks":{let s={lens:"blocks",kind:n.kind,as:/\bcards?\b/.test(t)?"card":"row"},a=/ group(?:ed)? by ([\p{L}\p{N} -]+?)(?= (?:and|only|sorted|with)|\s*$)/u.exec(t)?.[1]??(i&&!/ sort(?:ed)? by /.test(t)?i:void 0);if(a){let c=v(n,a);if(!c||c.type!=="enum")return h(c?`${n.plural}' ${c.words} is not a choice, so they cannot be grouped by it`:`${n.plural} have nothing called ${a} to group by`);s.group=c.name}let l=/ sort(?:ed)? by ([\p{L}\p{N} -]+?)(?= (?:and|only|grouped|with)|\s*$)/u.exec(t)?.[1];if(l){let c=v(n,l);if(!c)return h(`${n.plural} have nothing called ${l} to sort by`);s.sort={by:c.name,.../\b(newest|latest|desc|descending|most)\b/.test(t)?{direction:"desc"}:{}}}let d=V(n,t);return d.length>0&&(s.where=d),s}}}function V(e,n){let r=[],t=se(n);if(t){let o=e.fields.filter(R),i=$(e,e.roles.start),s=o.find(l=>E(n,l.words))??(R(i)?i:void 0)??o[0];(!s||!R(s))&&h(`no date field on ${e.plural}`);let a=e.fields.find(l=>l.type==="boolean"&&/^(done|finished|complete|completed|closed)$/.test(l.name));r.push({expr:t.cond(s.name,/\boverdue\b|\blate\b|\bpast due\b/.test(n)?a?.name:void 0),says:t.says(s)})}if(/\bonly\b|\bjust\b|\bthat are\b|\bwhich are\b/.test(n)){for(let o of e.fields){if(o.type!=="enum")continue;let i=o.options?.find(s=>E(n,s.toLowerCase())||E(n,y(s)));i&&r.push({expr:`${o.name} == '${i.replace(/'/g,"")}'`,says:`that are ${y(i)}`})}if(/\bnot done\b|\bundone\b|\bunfinished\b|\bopen ones\b|\bstill to do\b/.test(n)){let o=e.fields.find(i=>i.type==="boolean"&&/^(done|finished|complete|completed)$/.test(i.name));o&&r.push({expr:`not ${o.name}`,says:`not ${o.words}`})}}return r}var B={columns:"A board",calendar:"A calendar",timeline:"A timeline",coverage:"A grid",board:"A layout",plan:"A plan",blocks:"A list",reach:"A picture"};function Ae(e,n){let r=n.info(e.kind),t=o=>o?$(r,o)?.words??y(o):"";switch(e.lens){case"columns":return{title:`${k(r.plural)} by ${t(e.column)}`,detail:`of ${r.plural} by ${t(e.column)}`};case"calendar":{let o=e.range??"month";if(o==="agenda")return{title:`${k(r.plural)} in date order`,detail:`of ${r.plural} in order of ${t(e.start)}`};let i=o==="years"?"year":o;return{title:`${k(r.plural)} by ${i}`,detail:`of ${r.plural} by ${t(e.start)}, a ${i} at a time`}}case"timeline":return{title:`${k(r.plural)} over the ${t(e.column)}`,detail:`of ${r.plural} from ${t(e.start)} to ${t(e.end)}, by ${t(e.column)}`};case"coverage":{let o=n.info(e.across);return{title:`${k(r.plural)} by ${o.noun}`,detail:`of which ${o.noun} covers which ${r.noun}`}}case"board":return{title:`${k(r.plural)} where they stand`,detail:`of ${r.plural} where they stand`};case"plan":return{title:`${k(r.plural)} on a plan`,detail:`of ${r.plural}`};default:{let o=[e.where?.map(i=>i.says).join(" and "),e.group?`by ${t(e.group)}`:void 0,e.sort?`in order of ${t(e.sort.by)}`:void 0].filter(i=>!!i);return{title:[k(r.plural),...o].join(" "),detail:[`of ${r.plural}`,...o].join(" ")}}}}function Re(e,n){let r={title:n,on:e.kind};switch(e.lens){case"columns":return{name:"columns",...r,bindings:{[e.kind]:{column:e.column}}};case"calendar":return{name:"calendar",...r,bindings:{[e.kind]:{start:e.start,...e.end?{end:e.end}:{},...e.done?{done:e.done}:{}}},...e.range?{options:{range:e.range}}:{}};case"timeline":return{name:"timeline",...r,bindings:{[e.kind]:{start:e.start,end:e.end,column:e.column}}};case"coverage":return{name:"coverage",...r,bindings:{rows:{kind:e.kind},columns:{kind:e.across},link:{edge:e.link}}};case"board":return{name:"board",...r,bindings:{slots:{kind:e.kind},x:{field:e.x,on:"slots"},y:{field:e.y,on:"slots"},fill:{edge:e.fill}},...e.fillFrom?{options:{fillFrom:e.fillFrom}}:{}};case"plan":return{name:"plan",...r,bindings:{regions:{kind:e.kind},outline:{field:e.outline,on:"regions"}}};default:{let t=e.where?.length?` where ${e.where.map(i=>e.where.length>1?`(${i.expr})`:i.expr).join(" and ")}`:"",o={list:`all('${e.kind}')${t}`,as:e.as??"row"};return e.group&&(o.group=e.group),e.sort&&(o.sort=e.sort.direction?{by:e.sort.by,direction:e.sort.direction}:e.sort.by),o.empty="Nothing here yet.",{name:"blocks",...r,options:{blocks:[o]}}}}}function C(e,n){let r=o=>o.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,""),t=new Set(["home","overview",...Q(n).map(o=>o.slug),...(n.lenses??[]).flatMap(o=>o.title?[r(o.title)]:[])]);if(!t.has(r(e)))return e;for(let o=2;;o++)if(!t.has(r(`${e} ${o}`)))return`${e} ${o}`}var ne={title:[],headline:[],text:["tone"],figure:["as","currency","label"],list:["sort","limit","group","empty","as"],progress:["label"],group:["direction"],when:["show"],divider:[]};function Ee(e,n){if(!Array.isArray(n)||n.length===0)return"it has no blocks to draw";if(n.length>40)return"it has more blocks than a place draws";let r=(s,a)=>{if(typeof s!="string"||s.trim()==="")return`its ${a} says nothing`;try{return _(s)}catch(l){return`its ${a} does not read: ${l instanceof Error?l.message.replace(/ \(at character.*$/,""):String(l)}`}},t=s=>{if(s.t==="where")return t(s.set);if(s.t==="call"&&s.fn==="all"){let a=s.args[0];return a?.t==="lit"&&typeof a.value=="string"?e.info(a.value)??null:void 0}},o=(s,a)=>{switch(s.t){case"lit":return;case"ident":return a&&!a.fields.some(l=>l.name===s.name)&&!a.edges.some(l=>l.name===s.name)?`${a.plural} have nothing called ${s.name}`:void 0;case"member":return o(s.object,a);case"list":return s.items.map(l=>o(l,a)).find(Boolean);case"unary":return o(s.operand,a);case"binary":return o(s.left,a)??o(s.right,a);case"where":{let l=t(s.set);return l===null?"Nothing by that name here":o(s.set,a)??o(s.filter,l??void 0)}case"call":return s.fn==="all"?t(s)===null?"Nothing by that name here":void 0:s.args.map(l=>o(l,a)).find(Boolean)}},i=(s,a)=>{if(a>4)return"its blocks nest deeper than a place draws";for(let l of s){if(!w(l))return"a block is not an object";let d=Object.keys(ne).find(p=>p in l);if(!d)return`"${Object.keys(l)[0]??""}" is not a block a place draws`;let c=Object.keys(l).find(p=>p!==d&&p!=="key"&&!ne[d].includes(p));if(c)return`a ${d} block takes no "${c}"`;let u=l[d];if(d==="list"||d==="figure"||d==="when"){if(d==="figure"&&u===!0)continue;let p=r(u,d);if(typeof p=="string")return p;let g=o(p,void 0);if(g)return g;if(d==="list"){let f=t(p);if(f==null)return f===null?"Nothing by that name here":"its list does not say which records it lists, like all('task')";for(let m of["group","sort"]){let b=l[m],S=typeof b=="string"?b:w(b)&&typeof b.by=="string"?b.by:void 0;if(b===void 0)continue;let D=S?f.fields.find(ce=>ce.name===S):void 0;if(!D)return`${f.plural} have nothing called ${String(S??b)} to ${m} by`;if(m==="group"&&D.type!=="enum")return`${f.plural}' ${D.words} is not a choice, so they cannot be grouped by it`}}if(d==="when"){let f=l.show;if(!Array.isArray(f))return"a when block shows a list of blocks";let m=i(f,a+1);if(m)return m}}else if(d==="group"){if(!Array.isArray(u))return"a group block holds a list of blocks";let p=i(u,a+1);if(p)return p}else{if(d!=="divider"&&typeof u!="string")return`a ${d} block says words`;if(typeof u=="string")for(let p of u.matchAll(/\{([^{}]*)\}/g)){let g=p[1].split(/\|(?![|])/)[0],f=r(g,`${d}'s braces`);if(typeof f=="string")return f;let m=o(f,void 0);if(m)return m}}}};return i(n,1)}function T(e,n,r){let t=L(e.schema,r),o=f=>({ok:!1,failed:`Couldn't draw that: ${f.replace(/\.$/,"")}.`});if(!P(n.name)||n.name==="reach")return o(`"${String(n.name)}" is not a picture the seat can draw; it draws ${H.filter(f=>f!=="reach").join(", ")}`);if(typeof n.title!="string"||n.title.trim().length===0||n.title.length>80)return o("it needs a title of a few words");if(typeof n.on!="string"||!t.tryDefinition(n.on))return o("Nothing by that name here");let i=G[n.name],s=n.bindings??{};if(i.binds==="fields")for(let[f,m]of Object.entries(s)){if(!t.tryDefinition(f))return o("Nothing by that name here");let b=Object.keys(t.tryDefinition(f).fields?.shape??{});for(let[S,D]of Object.entries(m??{}))if(typeof D!="string"||!b.includes(D))return o(`${y(f)} has no field "${String(D)}" for its ${S}`);for(let S of i.requiredRoles)if(!(S in(m??{})))return o(`a ${n.name} needs ${y(f)}'s ${S}`)}else if(i.binds==="entities")for(let f of i.requiredRoles){let m=s[f];if(!m)return o(`a ${n.name} needs its ${f}`);if(typeof m.kind=="string"&&!t.tryDefinition(m.kind))return o("Nothing by that name here")}let a={...e,schema:t,lenses:[...e.lenses??[],n]},l=a.lenses.length-1,d=J(a),c=`lenses.${l}`,u=d.findings.find(f=>f.path===c||f.path.startsWith(`${c}.`));if(u)return o(u.message.replace(/^"[^"]*" /,"it "));let p=d.undrawn.find(f=>f.index===l);if(p)return o(p.why);let g=d.drawn.find(f=>f.index===l);if(!g)return o("its bindings name something the app does not have");if(g.as==="overview")return o(`"${n.title}" is the scene's own address; give it another title`);if(n.name==="blocks"){let f=Ee(I(t),n.options?.blocks);if(f)return o(f)}return{ok:!0,drawn:g}}function K(e){return{op:"add-lens",title:e.title,lens:e.name,on:e.on,...e.bindings?{bindings:e.bindings}:{},...e.options?{options:e.options}:{}}}function xe(e){return{op:"remove-lens",title:e.title,on:e.on}}var w=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function de(e){let n=w(e)?e:{},r=String(n.lens??n.name??""),t=n.bindings,o=typeof n.on=="string"?n.on:w(t)&&G[r]?.binds==="fields"?Object.keys(t)[0]??"":"";return{name:r,title:typeof n.title=="string"?n.title.trim():"",on:o,...w(t)?{bindings:t}:{},...w(n.options)?{options:n.options}:{}}}function ve(e){let n=o=>w(e.bindings?.[o])?e.bindings[o]:{},r=o=>typeof o=="string"?o:void 0,t=n(e.on);switch(e.name){case"columns":return r(t.column)?{lens:"columns",kind:e.on,column:t.column}:void 0;case"calendar":{let o=r(e.options?.range);return r(t.start)?{lens:"calendar",kind:e.on,start:t.start,...r(t.end)?{end:t.end}:{},...r(t.done)?{done:t.done}:{},...o?{range:o}:{}}:void 0}case"timeline":return r(t.start)&&r(t.end)&&r(t.column)?{lens:"timeline",kind:e.on,start:t.start,end:t.end,column:t.column}:void 0;case"coverage":{let o=w(e.bindings?.columns)?r(e.bindings.columns.kind):void 0,i=w(e.bindings?.link)?r(e.bindings.link.edge):void 0;return o&&i?{lens:"coverage",kind:e.on,across:o,link:i}:void 0}case"blocks":{let o=e.options?.blocks;if(!Array.isArray(o)||o.length!==1||!w(o[0]))return;let i=o[0],s=new RegExp(`^all\\('${e.on}'\\)(?: where (.+))?$`).exec(String(i.list??""));if(!s)return;let a=i.sort;return{lens:"blocks",kind:e.on,as:i.as==="card"?"card":"row",...typeof i.group=="string"?{group:i.group}:{},...typeof a=="string"?{sort:{by:a}}:w(a)&&typeof a.by=="string"?{sort:{by:a.by,...a.direction==="desc"?{direction:"desc"}:{}}}:{},...s[1]?{where:[{expr:s[1],says:"as asked"}]}:{}}}default:return}}function W(e,n,r,t,o){let i=I(L(e.schema,t)).info(n.on),s=ve(n);return{title:n.title,said:`${B[n.name]??"A picture"} of ${i?.plural??y(n.on)}.`,kind:n.on,lens:n,drawn:r,edit:K(n),by:o,asks:[],...s?{recipe:s}:{}}}function te(e){return{title:e.title,said:e.said,lens:{title:e.lens.title,lens:e.lens.name,on:e.lens.on,...e.lens.bindings?{bindings:e.lens.bindings}:{},...e.lens.options?{options:e.lens.options}:{}},edit:e.edit,by:e.by,check:"It draws, and graview check would take it."}}function F(e,n,r,t,o){let i=Ae(e,n),s=e.title??o??C(i.title,r.app),a=Re(e,s),l=T(r.app,a,r.sight);return l.ok?{title:s,said:`${B[e.lens]} ${i.detail}.`,kind:e.kind,lens:a,drawn:l.drawn,edit:K(a),by:"template",asks:t,recipe:e}:{failed:l.failed,...r.lastGood?{lastGood:r.lastGood}:{}}}function Ye(e,n){let r=I(L(n.app.schema,n.sight)),t=r.info(e.kind);if(!t)return{failed:"Couldn't draw that: Nothing by that name here."};let o=e.lens==="blocks"&&!e.group&&!e.sort&&!e.where?.length&&e.title===void 0;return F(o?{...e,title:C(`Every ${t.noun}`,n.app)}:e,r,n,[])}function Le(e,n,r,t){if(r.length>0)return r;let o=s=>{switch(e){case"columns":return s.fields.some(a=>a.type==="enum");case"calendar":return s.fields.some(R);case"timeline":return ie(s)!==void 0||s.fields.some(R);case"coverage":return s.edges.some(a=>a.to.some(l=>l!==s.kind));case"board":return s.fields.some(a=>a.name==="x")&&s.fields.some(a=>a.name==="y");case"plan":return s.fields.some(a=>a.name==="outline")||s.roles.outline!==void 0;default:return!0}};return[...n.kinds.filter(o)].sort((s,a)=>Number(a.fields.some(l=>E(t,l.words)))-Number(s.fields.some(l=>E(t,l.words))))}function Ie(e,n){let r=I(L(n.app.schema,n.sight)),t=re(e),o=$e(t);if(o.length===0)return;let i=pe(t,r),s;for(let a of o){let l=a==="coverage"?[i[0]??r.kinds[0]].filter(d=>!!d):Le(a,r,i,t);for(let d of l)try{let c=ae(a,d,r,t,i),u=F(c,r,n,[e]);if(!O(u))return u;s??=u.failed}catch(c){if(!(c instanceof j))throw c;s??=`Couldn't draw that: ${c.message}.`}l.length===0&&i.length===0&&(s??=`Couldn't draw that: nothing here has what ${B[a].toLowerCase()} needs.`)}return{failed:s??"Couldn't draw that: Nothing by that name here.",...n.lastGood?{lastGood:n.lastGood}:{}}}async function Oe(e,n){let r=n.lastGood?{lastGood:n.lastGood}:{};if(e.trim().length===0)return{failed:"Say what you would like to see, like \u201Ca board of tasks by status\u201D.",...r};let t=Ie(e,n);if(t&&!O(t))return t;if(!n.complete)return t??{failed:"Couldn't draw that: drawing freely needs AI, which isn't on here. Ask for a board, a calendar, a timeline, a list or who covers what.",...r};let o=await le(e,n,void 0);return O(o)&&t?t:o}async function je(e,n,r){let t={lastGood:e},o={...r,lastGood:e},i=I(L(r.app.schema,r.sight)),s=re(n),a=i.info(e.kind),l=[...e.asks,n];if(!a)return{failed:"Couldn't change that: Nothing by that name here.",...t};let d=e.recipe,c=/^ (?:call|name|title) (?:it|this)? ?(.+?) $/.exec(s)??/ (?:call|name) it (.+?) $/.exec(s);try{if(c){let g=n.replace(/^.*?\b(?:call|name|title)\b\s*(?:it|this)?\s*/i,"").replace(/^["“']|["”']$/g,"").trim();if(g.length===0)return{failed:"Couldn't change that: say what to call it.",...t};let f={...e.lens,title:C(g,r.app)},m=T(r.app,f,r.sight);return m.ok?{...e,title:f.title,lens:f,drawn:m.drawn,edit:K(f),asks:l,...d?{recipe:{...d,title:f.title}}:{}}:{failed:m.failed,...t}}let p=/ as (?:a |an )?(board|kanban|calendar|timeline|list|table|cards|rows|grid|plan|layout)\b/.exec(s);if(p){let g=p[1]==="board"||p[1]==="kanban"?"columns":p[1]==="calendar"?"calendar":p[1]==="timeline"?"timeline":p[1]==="grid"?"coverage":p[1]==="plan"?"plan":p[1]==="layout"?"board":"blocks",f=ae(g,a,i,s,[a]),m=p[1]==="cards"?"card":p[1]==="rows"?"row":void 0,b=g==="blocks"&&d?.lens==="blocks"?{...d,...m?{as:m}:{}}:g==="blocks"&&d?.lens==="columns"?{...f,group:d.column,...m?{as:m}:{}}:f;return F(A(b),i,o,l)}if(d){let g=Te(d,a,i,s);if(g)return F(g,i,o,l)}}catch(p){if(!(p instanceof j))throw p;return{failed:`Couldn't change that: ${p.message}.`,...t}}if(!r.complete)return{failed:"Couldn't change that: changing it freely needs AI, which isn't on here. Try \u201Cgroup by status\u201D, \u201Conly this month\u201D or \u201Cas a calendar\u201D.",...t};let u=await le(n,o,e);return O(u)?u:{...u,asks:l}}var A=e=>{let{title:n,...r}=e;return r};function Te(e,n,r,t){let o=/ (?:group(?:ed)?|split|organi[sz]ed?|put them|columns) by ([\p{L}\p{N} -]+?)(?= (?:and|only|with)|\s*$)/u.exec(t)?.[1]??(/^ by /.test(t)?U(t):void 0);if(o){let d=v(n,o);if(d?.type==="enum")return e.lens==="blocks"?{...A(e),group:d.name}:{lens:"columns",kind:e.kind,column:d.name};let c=oe(n,o,r);return c?{lens:"coverage",kind:e.kind,across:c.to[0],link:c.name}:h(d?`${n.plural}' ${d.words} is not a choice, so they cannot be grouped by it`:`${n.plural} have nothing called ${o} to group by`)}let i=/ (?:sort(?:ed)?|order(?:ed)?) by ([\p{L}\p{N} -]+?)(?= (?:and|only|with)|\s*$)/u.exec(t)?.[1];if(i){let d=v(n,i);return d?{...e.lens==="blocks"?A(e):{lens:"blocks",kind:e.kind,as:"row",...e.lens==="columns"?{group:e.column}:{}},sort:{by:d.name,.../\b(newest|latest|desc|descending|most)\b/.test(t)?{direction:"desc"}:{}}}:h(`${n.plural} have nothing called ${i} to sort by`)}if(/\b(?:all of them|everything|show all|clear the filter|no filter|without the filter)\b/.test(t)){if(e.lens!=="blocks"||!e.where)return h("it already shows all of them");let{where:d,...c}=A(e);return c}let s=se(t);if(s&&e.lens==="calendar"&&s.range)return{...A(e),range:s.range};if(s&&e.lens==="calendar"&&!s.range)return{lens:"blocks",kind:e.kind,as:"row",sort:{by:e.start},where:V(n,t)};let a=V(n,t);if(a.length>0){let d=e.lens==="blocks"?A(e):{lens:"blocks",kind:e.kind,as:"row",...e.lens==="columns"?{group:e.column}:{}};return{...d,where:[...d.where??[],...a]}}let l=e.lens==="calendar"?M(t):void 0;if(l)return{...A(e),range:l}}function Ne(e){return e.kinds.map(n=>{let r=n.fields.map(i=>`${i.name} (${i.type??"value"}${i.options?`: ${i.options.join(" | ")}`:""})`).join(", "),t=n.edges.map(i=>`${i.name} \u2192 ${i.to.join(" | ")}`).join(", "),o=Object.entries(n.roles).map(([i,s])=>`${i}=${s}`).join(", ");return`- ${n.kind} ("${n.plural}"): ${r}${t?`; relations: ${t}`:""}${o?`; roles: ${o}`:""}`}).join(`
|
|
2
2
|
`)}var Fe=['columns \u2014 a board, records in columns by one choice field: {"lens": "columns", "on": K, "bindings": {K: {"column": "<enum field>"}}}','calendar \u2014 records on a calendar by a date: {"lens": "calendar", "on": K, "bindings": {K: {"start": "<date field>", "end"?: "<date field>", "done"?: "<boolean field>"}}, "options": {"range"?: "day" | "week" | "month" | "quarter" | "year" | "agenda"}}','timeline \u2014 minutes of a day in columns: {"lens": "timeline", "on": K, "bindings": {K: {"start": "<number field>", "end": "<number field>", "column": "<enum field>"}}}','coverage \u2014 who covers what, a grid of two kinds joined by a relation: {"lens": "coverage", "on": K, "bindings": {"rows": {"kind": K}, "columns": {"kind": J}, "link": {"edge": "<relation of K to J>"}}}',`blocks \u2014 anything else, as blocks: {"lens": "blocks", "on": K, "options": {"blocks": [{"headline": "words"}, {"list": "all('K') where <condition>", "group"?: "<enum field>", "sort"?: "<field>" | {"by": "<field>", "direction": "desc"}, "as"?: "row" | "card", "empty"?: "words"}, {"figure": "count(all('K'))", "label": "words"}]}}. Conditions read a record's own fields: status == 'open', not done, days(today(), due) <= 7.`].join(`
|
|
3
3
|
`);function Ce(e,n,r){return["You draw a view of an app's data as JSON \u2014 never code. The app's kinds, their fields (with types) and relations:",Ne(n),"","The lenses you may use (prefer the first four; use blocks only when none of them fits):",Fe,"",r?`The view on screen now:
|
|
4
4
|
${JSON.stringify(r.lens)}
|