graview 0.1.57 → 0.1.58
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.N33WUCAN.js → chunk.27CW6SCT.js} +1 -1
- package/dist/preview/{chunk.XTBS64IT.js → chunk.2EDC63RI.js} +1 -1
- package/dist/preview/{chunk.JD5HSAMC.js → chunk.2VYNNWW5.js} +3 -3
- package/dist/preview/chunk.32FMOHZK.js +1 -0
- package/dist/preview/{chunk.LHIT3EZD.js → chunk.34TW32TB.js} +2 -2
- package/dist/preview/{chunk.QMYHXMRV.js → chunk.3FCOFEGW.js} +1 -1
- package/dist/preview/{chunk.JETT6ELP.js → chunk.3OYGXYQY.js} +1 -1
- package/dist/preview/{chunk.RQX4CQJN.js → chunk.3YZHZGTM.js} +1 -1
- package/dist/preview/{chunk.YS5U3DUX.js → chunk.43OKZU73.js} +1 -1
- package/dist/preview/{chunk.O47MN7E5.js → chunk.4444RPWW.js} +1 -1
- package/dist/preview/{chunk.N2DM42SG.js → chunk.47JQPYXL.js} +2 -2
- package/dist/preview/{chunk.57BKS5KD.js → chunk.4AFFPYOK.js} +1 -1
- package/dist/preview/chunk.4GGPPCMM.js +1 -0
- package/dist/preview/{chunk.534TBZJ3.js → chunk.4HSH2UIK.js} +2 -2
- package/dist/preview/{chunk.LKJ6FD6Y.js → chunk.4KC35UNR.js} +1 -1
- package/dist/preview/{chunk.EZ4NUZWX.js → chunk.4Y2JTY6Q.js} +1 -1
- package/dist/preview/{chunk.5BPRGXIW.js → chunk.5ICIMQE6.js} +1 -1
- package/dist/preview/{chunk.YR75TWDV.js → chunk.64R3K2OE.js} +1 -1
- package/dist/preview/chunk.6K7EN2YI.js +1 -0
- package/dist/preview/{chunk.YQXA4WAM.js → chunk.6VC6AGYV.js} +2 -2
- package/dist/preview/{chunk.4HPP35XQ.js → chunk.6W7O5YLL.js} +1 -1
- package/dist/preview/chunk.7BBGRTXM.js +5 -0
- package/dist/preview/{chunk.IRQOJATD.js → chunk.7MSFDD7J.js} +1 -1
- package/dist/preview/{chunk.XVN3CQKH.js → chunk.7SQAKSJD.js} +1 -1
- package/dist/preview/{chunk.DM5X3JBH.js → chunk.7V23SXGJ.js} +1 -1
- package/dist/preview/{chunk.DWLKJGVT.js → chunk.A6C4AGJJ.js} +1 -1
- package/dist/preview/{chunk.LWRXCO2Z.js → chunk.ACYDJQRC.js} +1 -1
- package/dist/preview/{chunk.RVR6FWAF.js → chunk.ARWBIBSI.js} +1 -1
- package/dist/preview/{chunk.7VIFAN3O.js → chunk.B2GVJD6H.js} +1 -1
- package/dist/preview/{chunk.NL3AJZ3N.js → chunk.B3WZHPM3.js} +1 -1
- package/dist/preview/{chunk.5NZDFT6R.js → chunk.BB33TI4S.js} +1 -1
- package/dist/preview/{chunk.UBNZDSS7.js → chunk.BKVBX2YB.js} +1 -1
- package/dist/preview/{chunk.FLMNWVSY.js → chunk.BTVBZ6KE.js} +2 -2
- package/dist/preview/{chunk.JBSW7ZNH.js → chunk.CCWPF5PK.js} +1 -1
- package/dist/preview/{chunk.7UBABS2T.js → chunk.D5KTGX7F.js} +1 -1
- package/dist/preview/{chunk.YPP7FSEZ.js → chunk.DBZHRYBK.js} +1 -1
- package/dist/preview/{chunk.NUS5K56R.js → chunk.DM767F2Q.js} +2 -2
- package/dist/preview/{chunk.MAZFQIL5.js → chunk.E34OQVSR.js} +1 -1
- package/dist/preview/{chunk.72IHABM5.js → chunk.E5MSFXL6.js} +1 -1
- package/dist/preview/{chunk.7ML2BWSP.js → chunk.EB4NVTJL.js} +1 -1
- package/dist/preview/{chunk.ZNXRHOUI.js → chunk.ELAMMS2V.js} +1 -1
- package/dist/preview/{chunk.QPL3OXW3.js → chunk.ELERUERU.js} +1 -1
- package/dist/preview/{chunk.I636CZE4.js → chunk.EPPXZZPK.js} +1 -1
- package/dist/preview/{chunk.LUIRQ5UF.js → chunk.EQTSV7BK.js} +1 -1
- package/dist/preview/{chunk.MRHPOUA4.js → chunk.ETBFD76E.js} +1 -1
- package/dist/preview/{chunk.VHPGGC2P.js → chunk.F7SF6EP2.js} +1 -1
- package/dist/preview/{chunk.DSLGMCB6.js → chunk.GCBZ3WE2.js} +1 -1
- package/dist/preview/{chunk.IX63LTRQ.js → chunk.GDOTG7YA.js} +1 -1
- package/dist/preview/{chunk.LE2KAR25.js → chunk.GEB2DFBU.js} +1 -1
- package/dist/preview/{chunk.V6FUYRZI.js → chunk.GKSUTAIX.js} +1 -1
- package/dist/preview/{chunk.4L4F47QP.js → chunk.GP7F3PEF.js} +1 -1
- package/dist/preview/{chunk.FJTWAU7N.js → chunk.GQBJVCSM.js} +1 -1
- package/dist/preview/{chunk.IV7AUO53.js → chunk.GUEHKCWN.js} +1 -1
- package/dist/preview/{chunk.4HFCOMR3.js → chunk.GZB6A6KF.js} +1 -1
- package/dist/preview/{chunk.D3LQJXVP.js → chunk.H3BFHI3G.js} +1 -1
- package/dist/preview/{chunk.NZDWXX6H.js → chunk.HEWVPXRE.js} +1 -1
- package/dist/preview/{chunk.4NPXMYA5.js → chunk.HMFJT4KO.js} +1 -1
- package/dist/preview/{chunk.UGOKORIF.js → chunk.HS3GHAUR.js} +1 -1
- package/dist/preview/{chunk.DBMZ3AQB.js → chunk.HT2BEOEV.js} +1 -1
- package/dist/preview/{chunk.7IXTNST2.js → chunk.HXRV3WVJ.js} +1 -1
- package/dist/preview/{chunk.PQMMISCQ.js → chunk.HZB5F476.js} +1 -1
- package/dist/preview/{chunk.H5CRRBNU.js → chunk.I3WWCPQ2.js} +1 -1
- package/dist/preview/{chunk.UWQ3I5OW.js → chunk.IDJPBWL2.js} +1 -1
- package/dist/preview/{chunk.HFSG3F5Z.js → chunk.ILRCNTGT.js} +1 -1
- package/dist/preview/{chunk.I5PSHASU.js → chunk.INZQ6WZM.js} +1 -1
- package/dist/preview/{chunk.FLVE6IBM.js → chunk.IULQRCEE.js} +1 -1
- package/dist/preview/{chunk.JNNBHD4Z.js → chunk.JB7TTJXQ.js} +1 -1
- package/dist/preview/{chunk.Q6OZLBNL.js → chunk.JES77WXG.js} +1 -1
- package/dist/preview/{chunk.BUSFJM6P.js → chunk.JGKA5QBX.js} +1 -1
- package/dist/preview/chunk.JOAN54PN.js +1 -0
- package/dist/preview/{chunk.EXZLG3HK.js → chunk.JUNMJYH5.js} +1 -1
- package/dist/preview/{chunk.TVURUMU4.js → chunk.KFQSYCY3.js} +1 -1
- package/dist/preview/{chunk.NGK6IRV3.js → chunk.KJ264E6K.js} +1 -1
- package/dist/preview/{chunk.4XKRCAJZ.js → chunk.KJHPDL4N.js} +1 -1
- package/dist/preview/{chunk.FPGU43SC.js → chunk.KKNDX4JT.js} +1 -1
- package/dist/preview/{chunk.KYOI7BG3.js → chunk.KWJWAIQJ.js} +1 -1
- package/dist/preview/{chunk.MBLFZF5R.js → chunk.KXPRILAO.js} +1 -1
- package/dist/preview/chunk.L7V24JPO.js +1 -0
- package/dist/preview/chunk.LA4CPZ2N.js +1 -0
- package/dist/preview/{chunk.EZ4TZUMM.js → chunk.LCPGZK7G.js} +1 -1
- package/dist/preview/{chunk.7INWDFNG.js → chunk.LDAYDCUO.js} +1 -1
- package/dist/preview/{chunk.C7EJPV2N.js → chunk.LL2MLSPH.js} +1 -1
- package/dist/preview/{chunk.C5EFUODO.js → chunk.LMN4TSAP.js} +1 -1
- package/dist/preview/{chunk.TBRXNU6T.js → chunk.LO3U3P55.js} +1 -1
- package/dist/preview/{chunk.VDS3IOTK.js → chunk.LRUNFSHP.js} +1 -1
- package/dist/preview/{chunk.4W5GCPAP.js → chunk.LY3YOWKV.js} +1 -1
- package/dist/preview/{chunk.33PZEW5A.js → chunk.M34CS7DI.js} +1 -1
- package/dist/preview/{chunk.D4EP7FEC.js → chunk.MQ5HBUBL.js} +1 -1
- package/dist/preview/chunk.MV3AJ7JH.js +1 -0
- package/dist/preview/chunk.MYNQWWCL.js +1 -0
- package/dist/preview/{chunk.5GTOF5D5.js → chunk.NFX24NUI.js} +1 -1
- package/dist/preview/{chunk.47T3KUAA.js → chunk.NKC3JILT.js} +1 -1
- package/dist/preview/{chunk.N5MQARN6.js → chunk.NOFWGDOT.js} +1 -1
- package/dist/preview/{chunk.4UQBMFJZ.js → chunk.O4CVKTPJ.js} +1 -1
- package/dist/preview/{chunk.4OP4IEEY.js → chunk.OASYYMG5.js} +1 -1
- package/dist/preview/{chunk.VW4JAQCH.js → chunk.OHQ3JH65.js} +1 -1
- package/dist/preview/{chunk.NF72Z2HG.js → chunk.PBCNOFQH.js} +1 -1
- package/dist/preview/chunk.PM3SYXKB.js +1 -0
- package/dist/preview/{chunk.66LWZIY5.js → chunk.POBMGM3X.js} +1 -1
- package/dist/preview/{chunk.DJ4A76SX.js → chunk.PZG3B7F4.js} +1 -1
- package/dist/preview/chunk.QB25SMP6.js +1 -0
- package/dist/preview/{chunk.BZEJM2PY.js → chunk.QGV7H7RQ.js} +1 -1
- package/dist/preview/chunk.QPXXY2DL.js +1133 -0
- package/dist/preview/{chunk.BPEUHOKH.js → chunk.R7LFO7KI.js} +1 -1
- package/dist/preview/{chunk.NX7CR4AE.js → chunk.RE7DELSR.js} +1 -1
- package/dist/preview/{chunk.KPIDJYIU.js → chunk.RRKYJYZJ.js} +1 -1
- package/dist/preview/{chunk.KTV24HY7.js → chunk.S2H7B6RG.js} +1 -1
- package/dist/preview/chunk.S5MGE2U5.js +1 -0
- package/dist/preview/{chunk.Y3EOGXRS.js → chunk.SDVPJYVF.js} +1 -1
- package/dist/preview/{chunk.VSGTNYM2.js → chunk.SPXRLO5K.js} +1 -1
- package/dist/preview/{chunk.Z5UVYOGC.js → chunk.TBW7CU4G.js} +1 -1
- package/dist/preview/{chunk.4JDHBNEA.js → chunk.TF5I4VHX.js} +1 -1
- package/dist/preview/{chunk.4K6VAC2S.js → chunk.TJ647W6J.js} +2 -2
- package/dist/preview/{chunk.QS6YW7UY.js → chunk.TJOXNEFU.js} +1 -1
- package/dist/preview/{chunk.EQAAKYLA.js → chunk.TUUVVO5U.js} +1 -1
- package/dist/preview/{chunk.M72JKVHP.js → chunk.TWKXSLYY.js} +1 -1
- package/dist/preview/chunk.TXGNPW76.js +1 -0
- package/dist/preview/{chunk.WASWMHND.js → chunk.U6O3MMQR.js} +1 -1
- package/dist/preview/{chunk.6SD7YZ4U.js → chunk.UAP5M3CD.js} +2 -2
- package/dist/preview/chunk.UKMVJV6Q.js +1 -0
- package/dist/preview/chunk.UUG3BYVN.js +1 -0
- package/dist/preview/{chunk.BCE6LIDR.js → chunk.VG7OWV2H.js} +1 -1
- package/dist/preview/{chunk.MWWOI5PW.js → chunk.VHSWBFXB.js} +1 -1
- package/dist/preview/{chunk.3DPTDMJ7.js → chunk.VUPLFUUS.js} +1 -1
- package/dist/preview/chunk.WJFQIE3Y.js +1 -0
- package/dist/preview/{chunk.547FQPYG.js → chunk.WNQFHMNR.js} +1 -1
- package/dist/preview/{chunk.SAJLIA5M.js → chunk.WNSC3RWD.js} +1 -1
- package/dist/preview/{chunk.UV3U4FRT.js → chunk.WQOI6BLM.js} +1 -1
- package/dist/preview/{chunk.CUKRUQQ2.js → chunk.WXIEQZLY.js} +1 -1
- package/dist/preview/{chunk.53U6E5LD.js → chunk.XN2RVXOI.js} +1 -1
- package/dist/preview/{chunk.RALAID6N.js → chunk.XU34T2H4.js} +1 -1
- package/dist/preview/{chunk.JQFIZRAZ.js → chunk.YD3TKV6P.js} +2 -2
- package/dist/preview/{chunk.FRERJWZJ.js → chunk.YHTE34RN.js} +1 -1
- package/dist/preview/{chunk.CMLNBJZG.js → chunk.YIA2EDVF.js} +1 -1
- package/dist/preview/{chunk.AD3EC5DU.js → chunk.YP2F5UGY.js} +1 -1
- package/dist/preview/{chunk.G3BDQ6EA.js → chunk.YS6GVLIP.js} +1 -1
- package/dist/preview/{chunk.S5ECRIG5.js → chunk.YZZONE4M.js} +1 -1
- package/dist/preview/{chunk.2PWVDUOU.js → chunk.ZN5HTWSI.js} +1 -1
- package/dist/preview/{chunk.4BRM5SGO.js → chunk.ZOHMWSHD.js} +1 -1
- package/dist/preview/index.html +50 -50
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.4SBYXHCQ.js +0 -1
- package/dist/preview/chunk.57KRCHQT.js +0 -1
- package/dist/preview/chunk.6AH26OL7.js +0 -1132
- package/dist/preview/chunk.7VZA34T4.js +0 -1
- package/dist/preview/chunk.CXB4BSI4.js +0 -1
- package/dist/preview/chunk.DIFR37EZ.js +0 -5
- package/dist/preview/chunk.DQUISKTC.js +0 -1
- package/dist/preview/chunk.DSWMXM57.js +0 -1
- package/dist/preview/chunk.GBAUQXXD.js +0 -1
- package/dist/preview/chunk.I2NI7CT7.js +0 -1
- package/dist/preview/chunk.I6H3HRWT.js +0 -1
- package/dist/preview/chunk.KO7IOFNY.js +0 -1
- package/dist/preview/chunk.OYUDK3LK.js +0 -1
- package/dist/preview/chunk.PF5P5YVD.js +0 -1
- package/dist/preview/chunk.WYPL2QUA.js +0 -1
- package/dist/preview/chunk.Y4KNR76Z.js +0 -1
- package/dist/preview/chunk.YDTXCVBU.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk.WVUJXDXZ.js";import{k as x}from"./chunk.
|
|
1
|
+
import"./chunk.WVUJXDXZ.js";import{k as x}from"./chunk.LDAYDCUO.js";import"./chunk.KKNDX4JT.js";import"./chunk.GKSUTAIX.js";import"./chunk.5ICIMQE6.js";import"./chunk.QGV7H7RQ.js";import"./chunk.YIA2EDVF.js";import"./chunk.27CW6SCT.js";import{ab as f,cb as N,ga as S}from"./chunk.7BBGRTXM.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var k=(n,r,t)=>({untrusted:!0,authoredBy:t.say(r),text:n});function O(n,r){let t;for(let[a,e]of Object.entries(n)){if(typeof e!="string"||a==="id"||a==="kind")continue;let o=r.fieldBy(n.id,a);o&&(t??={...n},t[a]=k(e,o,r))}return t??n}function L(n,r,t){let a=e=>{if(Array.isArray(e))return e.map(a);if(e!==null&&typeof e=="object"&&"id"in e&&"label"in e){let o=e,i=t.recordBy(o.id);return i?{...o,label:k(o.label,i,t)}:o}if(typeof e=="string"){let o=t.recordBy(n);return o?k(e,o,t):e}return e};return Object.fromEntries(Object.entries(r).map(([e,o])=>[e,a(o)]))}function $(n,r){return n.map(t=>{let a=r.recordBy(t.id);return a?{...t,label:k(t.label,a,r)}:t})}function D(n,r){return{...n,nodes:n.nodes.map(t=>O(t,r))}}var E=n=>(JSON.stringify(n)??"null").length,R=n=>typeof n=="number"&&Number.isFinite(n)&&n>0?Math.floor(n):0;function w(n,r,t,a,e,o=""){let i=n-r-t;return i>0?`and ${i} more ${e}: call ${a} with ${o}offset ${r+t} for the next page.`:void 0}var j=({line:n,...r})=>r;function T(n){let r;for(let[t,a]of Object.entries(n))typeof a!="string"||a.length<=600||(r??={...n},r[t]=`${a.slice(0,600)}\u2026 (cut at ${600} of ${a.length} characters)`);return r??n}function B(n,r,t,a){let e=Math.min(t,Math.max(0,n.length-r)),o=n.slice(r,r+e),i=a(o);for(;e>1&&E(i)>8e3;)e=Math.max(1,Math.floor(e*.75)),o=n.slice(r,r+e),i=a(o);return{page:o,answer:i}}function C(n,r){let t=JSON.stringify(r)??"null";if(t.length<=8e3)return r;let a=`This answer was ${t.length} characters, more than the ${8e3} one read answers, so it is cut. Ask ${n} for less, or use search_graph and get_node to read one thing.`;for(let e=8e3-a.length-40;;){let o={cut:a,partial:t.slice(0,e)},i=E(o)-8e3;if(i<=0)return o;e=Math.max(0,e-i-8)}}function I(n,r){let{matched:t,later:a,...e}=r,o=n.hits.filter(i=>i.about==="node").length;return n.total>o?{...e,more:`and ${n.total-o} more records match: narrow the words, or add kind:<kind>.`}:e}function P(n,r,t){let a=N(t.archived),e={nodes:n.graph.allNodes({archived:a}),edges:n.graph.allEdges({archived:"all"})},o=R(t.offset),i=e.nodes.length,{page:h,answer:u}=B(e.nodes,o,25,d=>{let g=new Set(d.map(s=>s.id)),l=new Set(d.map(s=>s.id)),c=w(i,o,d.length,"get_graph","nodes"),p=s=>l.has(s)||(a==="all"?n.graph.has(s):n.graph.has(s)&&f(n.graph.getNode(s))===a);return{...D({nodes:d.map(T),edges:e.edges.filter(s=>g.has(s.from)&&p(s.to))},r),total:i,...c?{more:c}:{}}});return{data:u,reads:h.map(d=>d.id)}}function U(n,r,t,a){let e=n.graph.getNode(t),o=R(a.offset),i=n.graph.outEdges(t),h=n.graph.inEdges(t),u=i.slice(o,o+20),d=h.slice(o,o+20),g=(s,A)=>{let m=n.graph.getNode(A);return{kind:s,id:A,label:m?S(n.schema.tryDefinition(m.kind),m):A,...f(m)?{archived:!0}:{}}},l=x(n.schema,n.graph,e),c=n.violations().filter(s=>s.nodeIds.includes(t)),p=[w(i.length,o,u.length,"get_node","links out",`id "${t}" and `),w(h.length,o,d.length,"get_node","links in",`id "${t}" and `),c.length>20?`and ${c.length-20} more problems: get_violations lists them.`:void 0].filter(Boolean);return{data:{node:O(T(e),r),...f(e)?{archived:!0}:{},...Object.keys(l.values).length>0?{computed:L(t,l.values,r)}:{},...Object.keys(l.refused).length>0?{uncomputed:l.refused}:{},out:$(u.map(s=>g(s.kind,s.to)),r),in:$(d.map(s=>g(s.kind,s.from)),r),violations:c.slice(0,20).map(j),...p.length>0?{more:p.join(" ")}:{}},reads:[t,...u.map(s=>s.to),...d.map(s=>s.from)]}}function F(n,r){let t=R(r.offset),{page:a,answer:e}=B(n,t,20,o=>{let i=w(n.length,t,o.length,"get_violations","problems");return{violations:o.map(j),total:n.length,...i?{more:i}:{}}});return{data:e,reads:[...new Set(a.flatMap(o=>o.nodeIds))]}}export{P as graphRead,U as nodeRead,I as searchRead,F as violationsRead,C as withinReadChars};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as O,b}from"./chunk.
|
|
1
|
+
import{a as O,b}from"./chunk.XN2RVXOI.js";import"./chunk.HZB5F476.js";import"./chunk.5ICIMQE6.js";import"./chunk.QGV7H7RQ.js";import"./chunk.YIA2EDVF.js";import"./chunk.YD3TKV6P.js";import"./chunk.4KC35UNR.js";import{G as z,T as M,ba as S}from"./chunk.HT2BEOEV.js";import"./chunk.SDO3U72B.js";import{ed as A}from"./chunk.7BBGRTXM.js";import"./chunk.FQLNBIQ5.js";import{b as v}from"./chunk.AJZBJBMO.js";var o=v(z(),1);var t=v(M(),1);function G(i){for(let d of i)for(let[r,s]of Object.entries(d))if(s===!1)return`${r} == true`;return""}var w={margin:0,fontSize:"0.8125rem",color:"var(--graview-ink-muted)"};function $({ask:i,close:d}){let{store:r,principal:s,subscriptions:h,app:f}=S(),c=(0,o.useRef)(null),p=(0,o.useId)(),[n,u]=(0,o.useState)(0),[l,y]=(0,o.useState)(!0),[m,P]=(0,o.useState)(()=>{let e=i.choices.find(g=>g.on==="reaches");if(!e)return"";let a=e.record!==void 0?r.graph.getNode(e.record):void 0;return G(a?[a]:r.graph.nodesOfKind(e.kind).slice(0,5))}),[C,x]=(0,o.useState)(null),[W,k]=(0,o.useState)(!1);(0,o.useEffect)(()=>{let e=c.current;e&&!e.open&&e.showModal()},[]);let T=()=>{let e=i.returnTo;d(),requestAnimationFrame(()=>{e?.isConnected?e.focus():document.querySelector("[data-graview-page-title], main h1, [data-testid='activity-button']")?.focus()})},N=e=>e.on==="reaches"?{...e,condition:m}:e,E=e=>b(r,{when:N(e),alsoMine:!l}),L=async()=>{let e=N(i.choices[n]),a=O(r,e);if(a){x(a);return}k(!0);try{await h.add({who:A(s),app:f?.name??"app",when:e,...l?{}:{alsoMine:!0}}),T()}catch(g){k(!1),x(g instanceof Error?g.message:String(g))}};return(0,t.jsx)("dialog",{ref:c,"aria-labelledby":p,"data-testid":"notify-sheet",onClose:T,onClick:e=>{e.target===e.currentTarget&&e.currentTarget.close()},style:{width:"min(92vw, 420px)",padding:0,border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)",color:"var(--graview-ink)",boxShadow:"var(--graview-lift-high)"},children:(0,t.jsxs)("form",{method:"dialog",onSubmit:e=>{e.preventDefault(),L()},style:{display:"grid",gap:12,padding:18},children:[(0,t.jsx)("h2",{id:p,style:{margin:0,fontSize:"1.0625rem"},children:"Notify me"}),(0,t.jsxs)("fieldset",{style:{margin:0,padding:0,border:0,display:"grid",gap:6},children:[(0,t.jsx)("legend",{style:{...w,marginBottom:6},children:"Tell me"}),i.choices.map((e,a)=>(0,t.jsxs)("label",{style:{display:"flex",gap:8,alignItems:"baseline",cursor:"pointer"},children:[(0,t.jsx)("input",{type:"radio",name:`${p}-when`,checked:n===a,onChange:()=>u(a),"data-notify-choice":e.on}),(0,t.jsx)("span",{children:e.on==="reaches"?`When ${e.record!==void 0?"it":"one"} reaches a condition`:E(e)})]},a))]}),i.choices[n]?.on==="reaches"?(0,t.jsxs)("label",{style:{display:"grid",gap:4},children:[(0,t.jsx)("span",{style:w,children:"The condition, in the app's own words (done == true, amount > 100)"}),(0,t.jsx)("input",{value:m,onChange:e=>P(e.target.value),"data-testid":"notify-condition",autoComplete:"off",spellCheck:!1})]}):null,(0,t.jsxs)("label",{style:{display:"flex",gap:8,alignItems:"center"},children:[(0,t.jsx)("input",{type:"checkbox",checked:l,onChange:e=>y(e.target.checked),"data-testid":"notify-others-only"}),"Only when someone else does it"]}),(0,t.jsxs)("p",{style:w,"data-testid":"notify-said",children:[E(i.choices[n]),"."]}),C?(0,t.jsx)("p",{role:"alert",style:{margin:0,color:"var(--graview-danger, var(--graview-ink))"},children:C}):null,(0,t.jsxs)("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[(0,t.jsx)("button",{type:"button",onClick:()=>c.current?.close(),children:"Cancel"}),(0,t.jsx)("button",{type:"submit",autoFocus:!0,disabled:W,"data-testid":"notify-keep",style:{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"},children:"Notify me"})]})]})})}function j({style:i}){let{store:d,principal:r,subscriptions:s,app:h}=S(),f=(r.onBehalfOf??r).id,[c,p]=(0,o.useState)([]);return(0,o.useEffect)(()=>{if(f===void 0)return;let n=!0,u=()=>void Promise.resolve(s.list(f)).then(y=>n&&p(y.filter(m=>m.app===(h?.name??"app"))),()=>n&&p([]));u();let l=s.onChange?.(u);return()=>{n=!1,l?.()}},[s,f,h]),c.length===0?null:(0,t.jsxs)("section",{"aria-label":"What you are told of","data-testid":"notified",style:{display:"grid",gap:6,...i},children:[(0,t.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:"You are told"}),(0,t.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:4},children:c.map(n=>(0,t.jsxs)("li",{style:{display:"flex",gap:8,alignItems:"baseline",justifyContent:"space-between"},"data-subscription":n.id,children:[(0,t.jsx)("span",{style:{fontSize:"0.8125rem"},children:b(d,n)}),(0,t.jsx)("button",{type:"button","data-testid":"notify-stop","aria-label":`Stop: ${b(d,n)}`,onClick:u=>{let l=u.currentTarget.closest("li"),y=(l?.nextElementSibling??l?.previousElementSibling)?.querySelector("button");Promise.resolve(s.remove(n.id)).then(()=>(y??document.querySelector("[data-testid='activity-button']"))?.focus())},style:{padding:"1px 8px",fontSize:"0.8125rem"},children:"Stop"})]},n.id))})]})}export{j as NotifiedList,$ as NotifySheet};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as D}from"./chunk.PXQVXBNG.js";import{a as L,f as P,g as N,h as R,i as T}from"./chunk.B3WVCSW5.js";import{zd as E}from"./chunk.
|
|
1
|
+
import{a as D}from"./chunk.PXQVXBNG.js";import{a as L,f as P,g as N,h as R,i as T}from"./chunk.B3WVCSW5.js";import{zd as E}from"./chunk.7BBGRTXM.js";var z=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),W=e=>e?._zod?.def;function I(e){let n=W(e);for(;n&&(n.type==="optional"||n.type==="default"||n.type==="nullable"||n.type==="prefault");)n=W(n.innerType);return n}function K(e){if(e?.type==="boolean")return["true","false"];if(e?.type==="enum")return(e.entries?Object.values(e.entries):e.values??[]).filter(n=>typeof n=="string")}var m=e=>e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]/g," ").replace(/^./,n=>n.toUpperCase());function J(e,n,i){let a=e.tryDefinition(n);if(!a)return[];let c=new Set(a.display?.hide??[]),o=[];for(let[s,l]of Object.entries(a.fields.shape??{})){if(s==="id"||s==="kind"||s==="label"||c.has(s))continue;let r=I(l);if(r?.type==="array"||r?.type==="object"||r?.type==="record")continue;let u=K(r);o.push({key:s,label:m(s),...u?{options:u}:{}})}let g=new Map;for(let[s,l]of Object.entries(a.edges??{}))g.set(s,l.to==="*"?[]:[...l.to]);for(let s of e.definitions)if(s.kind!==n)for(let[l,r]of Object.entries(s.edges??{}))!g.has(l)&&(r.to==="*"||r.to.includes(n))&&g.set(l,[s.kind]);let y=[];for(let[s,l]of g){o.push({key:s,label:m(s)});let r=i&&l.length===1&&l[0]!==n?e.tryDefinition(l[0]):void 0;for(let[u,f]of Object.entries(r?.fields.shape??{})){let p=I(f);p?.type==="enum"&&!r?.display?.hide?.includes(u)&&y.push({key:`${s}.${u}`,label:`${m(s)} \xB7 ${m(u)}`,options:K(p)})}}return o.push(...y),o.push({key:"is",label:"Is",options:a.lifecycle?["current","past","any","flagged","clear"]:["flagged","clear"]}),o}var G=e=>e.length<=1?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e.at(-1)}`;function q(e,n,i,a={}){if(i==null)return{ok:!0};if(!z(i))return{ok:!1,says:'A filter is an object of a field and the value it keeps, like { where: { stage: "building" } }.'};let c=Object.entries(i);if(c.length===0)return{ok:!0};let o=[];for(let l of n)for(let r of J(e,l,a.through===!0))o.some(u=>u.key===r.key)||o.push(r);let g=n[0]?e.tryDefinition(n[0]):void 0,y=g?g.plural??`${m(g.kind)}s`:"These",s=[];for(let[l,r]of c){let u=o.find(p=>p.key===l);if(!u)return{ok:!1,says:`${y.replace(/^./,p=>p.toUpperCase())} have no field "${l}" to filter by${o.length>0?`; they filter by ${G(o.map(p=>p.key))}`:""}.`};if(typeof r!="string"&&typeof r!="number"&&typeof r!="boolean")return{ok:!1,says:`The filter on "${l}" is ${Array.isArray(r)?"a list":r===null?"null":`a ${typeof r}`}; it keeps one value: a word, a number, or true or false.`};let f=String(r);if(f.trim().length===0)return{ok:!1,says:`The filter on "${l}" keeps nothing; give it a value, or leave "${l}" out.`};if(f.includes(","))return{ok:!1,says:`The filter on "${l}" holds a comma, which an address reads as a second filter; keep one value.`};if(u.options&&u.options.length>0&&!u.options.includes(f))return{ok:!1,says:`${u.label} has no choice "${f}"; its choices are ${G(u.options.map(p=>`"${p}"`))}.`};s.push(`${l}:${f}`)}return{ok:!0,filter:s.join(",")}}var C=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");function F(e,n){let i=e.find(o=>o.as===n);if(i)return i;let a=n.trim().toLowerCase(),c=C(n);return e.find(o=>o.title!==void 0&&o.title.trim().toLowerCase()===a)??(c?e.find(o=>o.as===c||o.title!==void 0&&C(o.title)===c):void 0)}function Q(e){let n=[];for(let i of e){if(typeof i!="object"||i===null)continue;let{as:a,slug:c,title:o,kind:g}=i,y=typeof a=="string"&&a.length>0?a:typeof c=="string"&&c.length>0?c:void 0;!y||n.some(s=>s.as===y)||n.push({as:y,title:typeof o=="string"?o:y,kind:typeof g=="string"?g:""})}return n}var M=e=>` Its places: ${e.map(n=>typeof n=="string"?`"${n}"`:n.title&&n.title!==n.as?`"${n.as}" (${n.title})`:`"${n.as}"`).join(", ")||"none"}.`;var b=e=>`"${e.length>80?`${e.slice(0,79)}\u2026`:e}"`,O=(e,n)=>`${"place"in e?`The place ${b(e.place)}`:`${b(e.record)} is no record this viewer may see and`} is no place of this app: it goes nowhere.${M(n)}`;function S(e){let n={};for(let i of e.split(",")){let a=i.indexOf(":");a>0&&(n[i.slice(0,a).trim()]=i.slice(a+1).trim())}return n}function oe(e,n=new Set){return e.kinds.filter(i=>!n.has(i)).map(i=>({slug:E(e,i).slice(1),kind:i}))}function V(e,n){let i=[...new Set(n.places.map(f=>f.as))],a=n.lists.map(f=>f.slug).filter(f=>!i.includes(f)),c;if(e.section!==void 0&&e.section!==null){if(typeof e.section!="string"||D(e.section).length===0||e.section.length>120)return{ok:!1,says:`The section ${typeof e.section=="string"?b(e.section):"asked for"} names nothing on a page: a section is a heading's words or an element's id, like "shipping-soon". It goes nowhere.`};c=e.section}let o=c!==void 0?{section:c}:{};if("record"in e&&n.sees(e.record))return e.where!==void 0&&e.where!==null?{ok:!1,says:`${b(e.record)} is one record, and a filter narrows a list or a place: it goes nowhere. Go to { place, where } for a list narrowed.`}:{ok:!0,arrival:{record:e.record,...o}};let g="place"in e?e.place:e.record,y=F(n.places,g),s=y?void 0:n.lists.find(f=>f.slug===g||f.kind===g);if(!y&&!s)return{ok:!1,says:`${O(e,n.places.filter((f,p,$)=>$.findIndex(t=>t.as===f.as)===p))}${_(a)}`};let l=y?[y.kind]:[s.kind],r;if(e.where!==void 0&&e.where!==null){if(!n.schema)return{ok:!1,says:`The place ${b(g)} cannot be narrowed here: it goes nowhere.`};let f=q(n.schema,l,e.where,{through:s!==void 0});if(!f.ok)return{ok:!1,says:`The filter on ${b(g)} goes nowhere: ${f.says}`};r=f.filter}let u=r?{filter:r}:{};return{ok:!0,arrival:y?{place:y.as,...u,...o}:{list:s.kind,...u,...o}}}var _=e=>e.length===0?"":` Its lists: ${e.slice(0,8).map(n=>`"${n}"`).join(", ")}${e.length>8?` and ${e.length-8} more`:""}.`,U="http://www.w3.org/1999/xhtml",H="http://www.w3.org/2000/svg",Z=e=>{let n=e;return n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||e.type==="click"&&typeof n.button=="number"&&n.button!==0};function se(e){let n=new WeakSet,i=new WeakSet,a=new WeakMap,c=new WeakMap,o=t=>V(t,{sees:e.sees,places:e.places(),lists:e.lists?.()??[],...e.schema?{schema:e.schema}:{}}),g=t=>{let d=o(t);return d.ok?e.onNavigate?.(d.arrival):e.onLost?.(d.says),d.ok},y=t=>{let d=t.getAttribute("data-record"),h=t.getAttribute("data-place"),k=t.getAttribute("data-filter"),w=t.getAttribute("data-section"),v={...k?{where:S(k)}:{},...w?{section:w}:{}};if(d)return{record:d,...v};if(h)return{place:h,...v}},s=t=>{if(!e.hrefOf)return;let d=y(t),h=d?o(d):void 0;return h?.ok?e.hrefOf(h.arrival):void 0},l=t=>t.hasAttribute("tabindex")?!1:(t.setAttribute("tabindex","0"),n.add(t),!0),r=t=>{n.delete(t)&&t.removeAttribute("tabindex")},u=t=>{i.delete(t)&&t.getAttribute("role")==="link"&&t.removeAttribute("role")},f=t=>{let d=a.get(t);d&&(a.delete(t),t.getAttribute("href")===d.href&&t.removeAttribute("href"),d.target!==null&&!t.hasAttribute("target")&&t.setAttribute("target",d.target))},p=t=>{let d=c.get(t);d&&(c.delete(t),r(d))},$={link(t){if(!N(t,[...t.querySelectorAll("input, select, textarea")].some(L))){if(!t.hasAttribute("data-graview-link"))return;t.removeAttribute("data-graview-link"),u(t),r(t),f(t),p(t);return}t.hasAttribute("data-graview-link")||t.setAttribute("data-graview-link","");let h=t.localName==="a"&&(t.namespaceURI===U||t.namespaceURI===H),k=t.getAttribute("href"),w=a.get(t),v=k!==null&&w?.href!==k,A=h&&!v?s(t):void 0;if(A!==void 0){k!==A&&t.setAttribute("href",A),a.set(t,{href:A,target:w?w.target:t.getAttribute("target")}),t.removeAttribute("target"),u(t),r(t);return}if(v?a.delete(t):f(t),R(t,t.querySelectorAll("a"))){u(t),r(t),p(t);return}if(!t.hasAttribute("role")&&(h||P(t))&&(t.setAttribute("role","link"),i.add(t)),t.localName==="tr"&&t.namespaceURI===U){r(t);let x=[...t.children].find(j=>j.localName==="td"||j.localName==="th");c.get(t)!==x&&p(t),x&&!c.has(t)&&l(x)&&c.set(t,x);return}t.localName!=="button"&&l(t)},refresh(t){for(let d of t.querySelectorAll("[data-record], [data-place], [data-graview-link]"))$.link(d)},pressed(t,d,h){if(t.type!=="click"&&!(t.type==="keydown"&&t.key==="Enter"))return!1;let k=T(d,h,w=>w.hasAttribute("data-graview-link"));return k?(t.stopPropagation(),a.has(k)&&Z(t)||(t.preventDefault(),$.follow(k)),!0):!1},follow(t){let d=y(t);d&&g(d)},go:g};return $}export{Q as a,M as b,b as c,O as d,S as e,oe as f,V as g,se as h};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as G,b as J}from"./chunk.
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as G,b as J}from"./chunk.WNQFHMNR.js";import"./chunk.7SQAKSJD.js";import{a as K}from"./chunk.PZG3B7F4.js";import"./chunk.LRUNFSHP.js";import"./chunk.S5MGE2U5.js";import"./chunk.EB4NVTJL.js";import"./chunk.VG7OWV2H.js";import"./chunk.KXPRILAO.js";import"./chunk.BB33TI4S.js";import{a as S,b as W}from"./chunk.MB7LKKUD.js";import"./chunk.LDAYDCUO.js";import"./chunk.KKNDX4JT.js";import"./chunk.GKSUTAIX.js";import"./chunk.5ICIMQE6.js";import"./chunk.QGV7H7RQ.js";import"./chunk.YIA2EDVF.js";import"./chunk.3YZHZGTM.js";import"./chunk.EQTSV7BK.js";import"./chunk.27CW6SCT.js";import"./chunk.YD3TKV6P.js";import"./chunk.4KC35UNR.js";import{D as H,E as V,G as ee,Ga as _,Sa as x,T as D,ca as F}from"./chunk.HT2BEOEV.js";import{a as j}from"./chunk.SDO3U72B.js";import{Vc as B,ia as q}from"./chunk.7BBGRTXM.js";import"./chunk.FQLNBIQ5.js";import{b}from"./chunk.AJZBJBMO.js";var t=b(ee(),1);var a=b(D(),1);function ae(n){let r=[];return n.applied.length>0&&n.intent&&r.push(`${n.intent}.`),n.unchanged.length>0&&r.push(`${n.unchanged.length} already so.`),n.allOrNothing&&r.push("None of it was kept."),r.join(" ")}var re=_(j(()=>(__graviewPreload(import.meta.url,["./chunk.47JQPYXL.js","./chunk.BJUUSIQY.js","./chunk.VG7OWV2H.js","./chunk.KXPRILAO.js","./chunk.XU34T2H4.js","./chunk.XOZU4OFA.js","./chunk.BB33TI4S.js","./chunk.CCWPF5PK.js","./chunk.KKNDX4JT.js","./chunk.3YZHZGTM.js","./chunk.EQTSV7BK.js","./chunk.27CW6SCT.js","./chunk.YD3TKV6P.js","./chunk.4KC35UNR.js","./chunk.HT2BEOEV.js","./chunk.SDO3U72B.js","./chunk.7BBGRTXM.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.TJOXNEFU.js")))),te=re.part((n,r)=>(0,a.jsx)(n.SeveralAi,{...r}),{quiet:!0});function ne(n){let r=F()?.ai;return!H(r)||!V(r)?null:(0,a.jsx)(t.Suspense,{fallback:null,children:(0,a.jsx)(te,{...n})})}function ge({store:n,chosen:r,principal:d,context:v,via:k,anchor:A,of:g,onChooseAll:E,onClear:m,onActed:Q}){let[U,X]=(0,t.useState)(0);(0,t.useEffect)(()=>n.subscribe(()=>X(e=>e+1)),[n]);let f=r.join(`
|
|
2
2
|
`),{acts:c,withheld:N}=(0,t.useMemo)(()=>G(n,r,{...d?{principal:d}:{},...v?{context:v}:{}}),[n,f,d,v,U]),[O,p]=(0,t.useState)(!1),[l,u]=(0,t.useState)(null),[s,P]=(0,t.useState)(null),h=(0,t.useRef)(null),L=(0,t.useId)(),w=(0,t.useMemo)(()=>[...new Set(r.map(e=>n.graph.getNode(e)?.kind))],[n,f]),Y=w.length===1&&w[0]?`${q(n.schema,w[0],r.length)} chosen`:`${r.length} chosen`,M=typeof matchMedia=="function"&&matchMedia("(pointer: coarse), (max-width: 599px)").matches?2:3,C=c.filter(e=>!e.more),Z=C.slice(0,M),R=[...C.slice(M),...c.filter(e=>e.more)];(0,t.useEffect)(()=>{u(null),p(!1)},[f]),(0,t.useLayoutEffect)(()=>{let e=h.current;if(!e)return;if(typeof e.showPopover=="function"&&!x(e))try{e.showPopover()}catch{}let i=()=>{W(e,A?.()??null),dispatchEvent(new Event(S))};i(),addEventListener("resize",i),addEventListener("scroll",i,!0);let o=typeof ResizeObserver=="function"?new ResizeObserver(i):null;return o?.observe(e),()=>{if(o?.disconnect(),removeEventListener("resize",i),removeEventListener("scroll",i,!0),e.isConnected&&x(e))try{e.hidePopover()}catch{}dispatchEvent(new Event(S))}},[A]);let y=(0,t.useRef)({asking:l,onClear:m});y.current={asking:l,onClear:m},(0,t.useEffect)(()=>{let e=i=>{if(i.key!=="Escape"||i.defaultPrevented)return;let o=document.activeElement;if(!(!(h.current?.contains(o)??!1)&&(o instanceof HTMLTextAreaElement||o instanceof HTMLInputElement&&o.type!=="checkbox"||o instanceof HTMLSelectElement))){if(i.preventDefault(),i.stopPropagation(),y.current.asking){u(null);return}y.current.onClear()}};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[]);let T=(e,i={})=>{let o=J(n,{mutation:e.mutation,subject:e.subject,args:{...e.args,...i},label:e.label},r,{...d?{author:d}:{},...k?{via:k}:{},...v?{context:v}:{}});u(null),p(!1),P(o.refused.length>0||o.applied.length===0?o:null),Q(o.refused.map(I=>I.id))},$=e=>{P(null),p(!1),e.open.length>0?u(e):T(e)},z=e=>(0,a.jsxs)("button",{type:"button",className:"graview-several-act","data-testid":"several-act","data-act":e.id,"data-mutation":e.mutation,...e.destructive?{"data-tone":"warn"}:{},"aria-pressed":l?.id===e.id?!0:void 0,onClick:()=>$(e),children:[e.label,e.open.length>0?"\u2026":""]},e.id);return(0,a.jsxs)("div",{ref:h,popover:"manual",role:"region","aria-label":"The chosen records",className:"graview-several-bar","data-testid":"several-bar","data-graview-foot":"","data-graview-overlay":"","data-graview-popover":"","data-graview-offstage":"",style:ie,children:[(0,a.jsx)("style",{children:oe}),(0,a.jsxs)("div",{className:"graview-several-line",children:[(0,a.jsx)("span",{role:"status","aria-live":"polite",className:"graview-several-count","data-testid":"several-count",children:Y}),(0,a.jsxs)("div",{role:"group","aria-label":`What to do with the ${r.length} chosen`,className:"graview-several-acts",children:[Z.map(z),R.length>0?(0,a.jsx)("button",{type:"button",className:"graview-several-act","data-testid":"several-more","aria-expanded":O,"aria-controls":L,onClick:()=>p(e=>!e),children:"More"}):null,E&&g!==void 0&&g>r.length?(0,a.jsxs)("button",{type:"button",className:"graview-several-quiet","data-testid":"several-all",onClick:E,children:["Choose all ",g]}):null,(0,a.jsx)("button",{type:"button",className:"graview-several-quiet","data-testid":"several-clear","aria-keyshortcuts":"Escape",title:"Put the choice down \u2014 Escape",onClick:m,children:"Clear"})]})]}),c.length>0&&r.length>1?(0,a.jsx)(ne,{chosen:r,acts:c,onAct:$}):null,O?(0,a.jsx)("div",{id:L,role:"group","aria-label":"More",className:"graview-several-acts","data-testid":"several-more-acts",children:R.map(z)}):null,c.length===0?(0,a.jsx)("p",{className:"graview-several-said","data-testid":"several-none",children:N.length>0?`Nothing here can be done to all of them by you: ${N[0].message}`:"Nothing can be done to all of these at once."}):null,l?(0,a.jsx)("div",{className:"graview-several-ask",role:"group","aria-label":`${l.label}, for all ${r.length}`,"data-testid":"several-ask",children:(0,a.jsx)(K,{store:n,affordance:l.affordance,onApply:e=>T(l,e),onCancel:()=>u(null)})}):null,s?(0,a.jsxs)("div",{role:"alert",className:"graview-several-said","data-testid":"several-outcome",children:[ae(s),s.refused.length>0?(0,a.jsxs)(a.Fragment,{children:[" ",s.refused.length===1?"One was not changed, and is still chosen:":`${s.refused.length} were not changed, and are still chosen:`,(0,a.jsx)("ul",{"data-testid":"several-refused",children:s.refused.map(e=>(0,a.jsxs)("li",{"data-record":e.id,children:["\u201C",e.label,"\u201D \u2014 ",e.message]},e.id))})]}):null]}):null]})}var ie={position:"fixed",inset:"auto",margin:0,zIndex:B("toast"),boxSizing:"border-box",width:"max-content",height:"auto",bottom:"calc(16px + env(safe-area-inset-bottom, 0px))",left:16,overflow:"visible"},oe=`
|
|
3
3
|
.graview-several-bar{display:grid;gap:8px;padding:8px 10px;border:1px solid var(--graview-edge);border-radius:var(--graview-radius,12px);background:var(--graview-float);color:var(--graview-ink);box-shadow:var(--graview-lift-high);font-size:.875rem;line-height:1.4;max-height:70vh;overflow:auto}
|
|
4
4
|
.graview-several-line{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;min-width:0}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as M}from"./chunk.
|
|
1
|
+
import{a as M}from"./chunk.TF5I4VHX.js";import"./chunk.S5MGE2U5.js";import"./chunk.XOZU4OFA.js";import{f as H,g as x,h as R}from"./chunk.BB33TI4S.js";import{a as $}from"./chunk.PBCNOFQH.js";import{a as T,b as A,c as C}from"./chunk.RRKYJYZJ.js";import"./chunk.3YZHZGTM.js";import"./chunk.EQTSV7BK.js";import"./chunk.27CW6SCT.js";import{a as P,c as O}from"./chunk.4KC35UNR.js";import{G as k,Q as E,T as g}from"./chunk.HT2BEOEV.js";import"./chunk.SDO3U72B.js";import"./chunk.7BBGRTXM.js";import"./chunk.FQLNBIQ5.js";import{b as l}from"./chunk.AJZBJBMO.js";var s=l(k());var n=l(g()),V={maxWidth:560,margin:"0 auto",padding:"40px 20px 64px",display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:16};function B({app:r,store:e,form:o,principal:i,heading:c=1,onSubmitted:a}){let t=(0,s.useMemo)(()=>H(r,o,e.allMutations()),[r,o,e]),d=E(e),v=(0,s.useMemo)(()=>d?e.seenBy(i):e,[d,e,i]),[p,b]=(0,s.useState)(!1),u=(0,s.useRef)(null);(0,s.useEffect)(()=>{p&&u.current?.focus()},[p]);let y=`h${c}`;if(!d)return null;if(!t)return(0,n.jsx)("main",{"data-graview-visitor-form":o,style:V,children:(0,n.jsx)("p",{role:"alert",children:"There is no form here."})});let S=R(t);return(0,n.jsxs)("main",{"data-graview-visitor-form":o,"aria-labelledby":"graview-visitor-form-title",style:V,children:[(0,n.jsx)(y,{id:"graview-visitor-form-title",style:{margin:0,fontSize:"var(--graview-text-title)"},children:t.title}),p?(0,n.jsxs)("div",{ref:u,role:"status",tabIndex:-1,"data-graview-part":"received",style:{display:"grid",gap:8,outline:"none"},children:[(0,n.jsx)("p",{style:{margin:0,fontWeight:600},children:S.said}),S.next?(0,n.jsx)("p",{style:{margin:0},children:S.next}):null]}):(0,n.jsxs)(n.Fragment,{children:[t.intro?(0,n.jsx)("p",{style:{margin:0,color:"var(--graview-ink-muted)"},children:t.intro}):null,(0,n.jsx)(M,{store:v,mutation:t.act,principal:i,only:t.fields.map(h=>h.name),label:t.submit,onDone:()=>{b(!0),a?.(o)}})]})]})}var m=l(k()),F=l(O()),G=l($());var f=l(g());function D(r){let{app:e,form:o,principal:i,scheme:c="auto",brand:a=e.brand,fonts:t=!0,height:d}=r,v=(0,m.useMemo)(()=>typeof i!="string"?i:e.forms?.[o]?x(e,o,i):{kind:"human",id:i,roles:[]},[e,o,i]),p=(0,m.useMemo)(()=>r.store??r.remote?.store??A(e,r.seed),[r.store,r.remote,e,r.seed]),b=C(c==="auto",a?.scheme),u=c==="auto"?b:c,y=`graview-form-${(0,m.useId)().replace(/[^a-zA-Z0-9_-]/g,"")}`,S=(0,m.useMemo)(()=>P(u,a,{scope:`.${y}`}),[u,a,y]);return(0,m.useEffect)(()=>{if(!t||typeof document>"u")return;let h=T(a);if(!h||document.querySelector(`link[href="${h}"]`))return;let w=document.createElement("link");w.rel="stylesheet",w.href=h,document.head.appendChild(w)},[a,t]),(0,f.jsxs)("section",{className:y,"aria-label":r.label??e.forms?.[o]?.title??e.name,"data-graview-embed":"form","data-graview-scheme":u,style:{position:"relative",isolation:"isolate",...d===void 0?{}:{minHeight:d},background:"var(--graview-ground)",color:"var(--graview-ink)",fontFamily:"var(--graview-font-body, system-ui)"},children:[(0,f.jsx)("style",{children:S}),(0,f.jsx)(B,{app:e,store:p,form:o,principal:v,heading:r.heading??1,...r.onSubmitted?{onSubmitted:r.onSubmitted}:{}})]})}function K(r,e){e.app.forms?.[e.form]||x(e.app,e.form,"form:");let o=e.store??e.remote?.store??A(e.app,e.seed),i=null;function c(){let[t,d]=(0,m.useState)(e.scheme??"auto");return i=d,(0,f.jsx)(D,{...e,store:o,scheme:t})}let a=(0,G.createRoot)(r);return(0,F.flushSync)(()=>a.render((0,f.jsx)(c,{}))),{store:o,setScheme:t=>(0,F.flushSync)(()=>i?.(t)),unmount:()=>a.unmount()}}export{D as FormEmbed,K as mount};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk.WVUJXDXZ.js";import{k as m,m as i}from"./chunk.LDAYDCUO.js";import"./chunk.KKNDX4JT.js";import"./chunk.GKSUTAIX.js";import"./chunk.5ICIMQE6.js";import"./chunk.QGV7H7RQ.js";import"./chunk.YIA2EDVF.js";import"./chunk.27CW6SCT.js";import"./chunk.7BBGRTXM.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";function a(t){let r=new Map;return(s,o)=>{let e=o.kind,n=r.get(e);return n===void 0&&r.set(e,n=i(t,e).length),n===0?{}:m(t,s,o).values}}export{a as computedOn};
|
|
@@ -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{F as g,G as T,Ga as C,T as v,ca as S}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,G as T,Ga as C,T as v,ca as S}from"./chunk.HT2BEOEV.js";import{a as m}from"./chunk.SDO3U72B.js";import"./chunk.7BBGRTXM.js";import"./chunk.FQLNBIQ5.js";import{b as c}from"./chunk.AJZBJBMO.js";var n=c(T(),1),r=c(v(),1),s=null,u=null,f=new Set,a=()=>{for(let e of f)e()},y=e=>(f.add(e),()=>void f.delete(e)),E=300,d=()=>{u!==null&&clearTimeout(u),u=null};function q(e,t){d(),x.prefetch(),!(s?.element===t&&s.target.on===e.on)&&(s={target:e,element:t},a())}function M(e=!1){if(d(),s!==null){if(e){s=null,a();return}u=setTimeout(()=>{u=null,s=null,a()},E)}}var R=()=>d(),P=()=>s,b="graview:hover-chips",h;function A(e){if(h!==void 0)return h;try{return(e??localStorage).getItem(b)!=="off"}catch{return!0}}function I(e,t){h=e;try{(t??localStorage).setItem(b,e?"on":"off")}catch{}e||(s=null),a()}function w(){let e=S(),t=g(e?.ai),o=e?.memory,l=(0,n.useSyncExternalStore)(y,()=>A(o),()=>!1),i=(0,n.useCallback)(H=>I(H,o),[o]);return{offered:t,on:t&&l,set:i}}function z({legend:e,style:t,choice:o}){let l=w();return l.offered?(0,r.jsxs)("fieldset",{"data-testid":"setting-hover-chips",style:{border:0,margin:0,padding:0,display:"grid",gap:5,...t},children:[(0,r.jsx)("legend",{style:{...e,padding:0},children:"AI suggestions on hover"}),(0,r.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:"A quiet suggestion beside a record the pointer rests on, when the AI is sure of one."}),(0,r.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:[!0,!1].map(i=>(0,r.jsx)("button",{type:"button","aria-pressed":l.on===i,"data-testid":`setting-hover-chips-${i?"on":"off"}`,onClick:()=>l.set(i),style:o(l.on===i),children:i?"On":"Off"},String(i)))})]}):null}var x=C(m(()=>(__graviewPreload(import.meta.url,["./chunk.47JQPYXL.js","./chunk.BJUUSIQY.js","./chunk.VG7OWV2H.js","./chunk.KXPRILAO.js","./chunk.XU34T2H4.js","./chunk.XOZU4OFA.js","./chunk.BB33TI4S.js","./chunk.CCWPF5PK.js","./chunk.KKNDX4JT.js","./chunk.3YZHZGTM.js","./chunk.EQTSV7BK.js","./chunk.27CW6SCT.js","./chunk.YD3TKV6P.js","./chunk.4KC35UNR.js","./chunk.HT2BEOEV.js","./chunk.SDO3U72B.js","./chunk.7BBGRTXM.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.7MSFDD7J.js")))),k=x.part((e,t)=>{let o=e.HoverChip;return(0,r.jsx)(o,{...t})},{quiet:!0}),p=null,O=()=>p;function L(){let{on:e}=w(),t=(0,n.useSyncExternalStore)(y,P,()=>null),[o]=(0,n.useState)(()=>Symbol("hover-chip")),l=(0,n.useSyncExternalStore)(y,O,()=>null);return(0,n.useEffect)(()=>{if(e)return p===null&&(p=o,a()),()=>{p===o&&(p=null,s=null,d(),a())}},[e,o,l]),!e||t===null||l!==o||!t.element.isConnected?null:(0,r.jsx)(n.Suspense,{fallback:null,children:(0,r.jsx)(k,{rest:t,hold:R,leave:M})})}export{L as HoverChipDoor,z as HoverChipsSwitch,R as holdRest,A as hoverChipsWanted,M as leaveRest,q as restOn,I as setHoverChipsWanted,w as useHoverChipsSetting};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as o,l as u}from"./chunk.
|
|
1
|
+
import{g as o,l as u}from"./chunk.HT2BEOEV.js";function c(t,n,i){let e=r=>encodeURIComponent(r);return`${o}${e(t)}:${e(n)}:${e(i)}`}function S(t,n,i){let e=new Set(t.shown??[]);if(i?e.add(n):e.delete(n),e.size===0){let{shown:r,...w}=t;return w}return{...t,shown:[...e].sort()}}function l(t,n){if(n===null||n.trim().length===0){let{q:i,...e}=t;return e}return{...t,q:n}}function p(t){let n=t.q!==void 0&&t.within?.q===t.q;return l(n?u(t,"q",null):t,null)}function h(t,n){if(!n){let{past:i,...e}=t;return e}return{...t,past:!0}}function f(t,n){if(n===null||n.x===0&&n.y===0){let{pan:i,...e}=t;return e}return{...t,pan:n}}function d(t,n,i){let e={...t.pins};return i===null?delete e[n]:e[n]=i,{...t,pins:e}}export{c as a,S as b,l as c,p as d,h as e,f,d as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk.WVUJXDXZ.js";import{b as C}from"./chunk.
|
|
1
|
+
import"./chunk.WVUJXDXZ.js";import{b as C}from"./chunk.LDAYDCUO.js";import"./chunk.KKNDX4JT.js";import"./chunk.GKSUTAIX.js";import"./chunk.5ICIMQE6.js";import"./chunk.QGV7H7RQ.js";import"./chunk.YIA2EDVF.js";import"./chunk.27CW6SCT.js";import{ra as $,ta as E,ua as b,va as k}from"./chunk.7BBGRTXM.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";function M(r,l,t){let p=r.getAttribute("data-record")??"",g=r.getAttribute("data-field")??"",e=Number(r.getAttribute("data-index")??"0"),c=[...l?.node?[l.node]:[],...l?.nodes??[]].find(a=>a.id===p);if(!p||!c)return{why:p?`names a record it was not shown ("${p.slice(0,80)}")`:"names no record (data-record)"};let s=g&&Object.hasOwn(c,g)?c[g]:void 0,o=(Array.isArray(s)?s:[s]).filter($),u=Number.isInteger(e)&&e>=0?o[e]:void 0,n=c.label?`"${c.label}"`:"a record";return g?u?(t==="video"?!b(u):!b(u)&&!E(u))?{why:`names "${u.name}" on ${n}, which is not ${t==="video"?"a video":"a picture or a video"}`}:{file:u,on:c}:{why:o.length===0?`names "${g}" on ${n}, which holds no file it was shown`:`names file ${r.getAttribute("data-index")} of "${g}" on ${n}, which holds ${o.length}`}:{why:`names no field of ${n} (data-field)`}}var A=r=>`${r.caption?.trim()||r.name}, ${k(r)}`;function T(r,l,t,p,g){let e=r.createElement("video");e.setAttribute("data-graview-video",""),e.setAttribute("controls",""),e.setAttribute("preload","metadata"),e.setAttribute("playsinline",""),e.setAttribute("aria-label",A(t));let c=t.poster?p(t.poster):void 0;c&&e.setAttribute("poster",c),t.width&&t.height?(e.setAttribute("width",String(t.width)),e.setAttribute("height",String(t.height)),e.style.aspectRatio=`${t.width} / ${t.height}`):e.style.aspectRatio="16 / 9",e.style.cssText+=";display:block;width:100%;height:auto;max-height:80vh;background:#000;border-radius:var(--graview-radius, 8px)";let s=t.captions?p(t.captions):void 0;if(s){let o=r.createElement("track");o.setAttribute("kind","captions"),o.setAttribute("src",s),o.setAttribute("srclang","en"),o.setAttribute("label","Captions"),o.setAttribute("default",""),e.appendChild(o)}return t.duration===void 0&&e.addEventListener("loadedmetadata",()=>Number.isFinite(e.duration)&&e.duration>0&&e.setAttribute("aria-label",A({...t,duration:e.duration}))),e.setAttribute("src",g),l.appendChild(e),e}function N(r,l){let t=r.document,p=new Set,g=n=>{p.has(n)||(p.add(n),l.onProblem?.(n))},e=n=>{let a=l.file?l.file(n):n;if(a!==void 0)try{let h=new r.URL(a,t.baseURI);return h.origin===r.location.origin&&/^https?:$/.test(h.protocol)?a:void 0}catch{return}},c=new WeakMap,s,o=n=>{if(typeof n.close=="function")return n.close();n.removeAttribute("open"),n.dispatchEvent(new r.Event("close"))},u=(n,a)=>g(`The ${n} in the view ${l.view} was not drawn: it ${a}.`);return{refresh(n){let a=l.shown();for(let h of Array.from(n.querySelectorAll("graview-video"))){let d=h.shadowRoot??h.attachShadow({mode:"open"});if(!l.pictures){c.delete(h),d.replaceChildren(),u("video",`asks for no pictures: a view places a record's video where its manifest says "pictures": true`);continue}let f=M(h,a,"video"),i="file"in f?JSON.stringify(f.file):"";if(c.get(h)===i&&d.childNodes.length>0)continue;if(c.set(h,i),d.replaceChildren(),"why"in f){u("video",f.why);continue}let m=e(f.file.href);if(!m){u("video",`names "${f.file.name}", which this host does not say it serves on this page`);continue}let w=t.createElement("style");w.textContent=":host { display: block; min-width: 0; }",d.appendChild(w),T(t,d,f.file,e,m)}},open(n){if(!l.pictures)return u("full-screen viewer",`asks for no pictures: a view opens a record's picture or video full screen where its manifest says "pictures": true`),!1;let a=M(n,l.shown(),"any");if("why"in a)return u("full-screen viewer",a.why),!1;let h=e(a.file.href);if(!h)return u("full-screen viewer",`names "${a.file.name}", which this host does not say it serves on this page`),!1;s&&o(s);let d=a.file,f=d.caption?.trim()||d.name,i=t.createElement("dialog");i.setAttribute("data-graview-lightbox",""),i.setAttribute("aria-label",b(d)?A(d):f),i.style.cssText="padding:0;border:0;border-radius:var(--graview-radius, 8px);max-width:min(96vw, 1600px);max-height:94vh;background:var(--graview-panel, Canvas);color:var(--graview-ink, CanvasText)";let m=t.createElement("figure");if(m.style.cssText="margin:0;display:grid;gap:8px;padding:10px",b(d))T(t,m,d,e,h);else{let v=t.createElement("img");v.setAttribute("src",h),v.setAttribute("alt",f),v.style.cssText="max-width:100%;max-height:80vh;object-fit:contain;display:block;margin:0 auto",m.appendChild(v)}let w=t.createElement("figcaption");w.style.cssText="display:flex;gap:12px;align-items:center;justify-content:space-between";let x=t.createElement("span");x.textContent=b(d)&&d.duration!==void 0?`${f} \xB7 ${C(d.duration)}`:f;let y=t.createElement("button");return y.type="button",y.textContent="Close",y.addEventListener("click",()=>o(i)),w.append(x,y),m.appendChild(w),i.appendChild(m),i.addEventListener("click",v=>v.target===i&&o(i)),i.addEventListener("close",()=>{i.remove(),s===i&&(s=void 0),n.focus?.()}),t.body.appendChild(i),s=i,typeof i.showModal=="function"?i.showModal():i.setAttribute("open",""),y.focus(),!0},dispose(){s&&o(s),s?.remove(),s=void 0}}}export{N as createGuestMedia,M as namedFile};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk.
|
|
1
|
+
import"./chunk.3YZHZGTM.js";import"./chunk.EQTSV7BK.js";import{b as m}from"./chunk.27CW6SCT.js";import"./chunk.YD3TKV6P.js";import"./chunk.4KC35UNR.js";import{T as p}from"./chunk.HT2BEOEV.js";import"./chunk.SDO3U72B.js";import{W as l}from"./chunk.7BBGRTXM.js";import"./chunk.FQLNBIQ5.js";import{b as f}from"./chunk.AJZBJBMO.js";var a=f(p(),1);function A({states:e,definition:v}){let s=e.values.reduce((t,n)=>t+n.count,0),u=t=>t===null?"with none":m(v,e.field,t).toLowerCase(),c=e.values.filter(t=>t.count>0).map(t=>`${l(t.count)} ${u(t.value)}`).join(", ");return s===0?null:(0,a.jsx)("div",{className:"graview-district-states",role:"img","aria-label":c,title:c,children:e.values.map((t,n)=>{if(t.count===0)return null;let y=e.values.filter(r=>r.count>0).length,w=t.count/s*(168-(y-1)),o=l(t.count),i=`${o} ${u(t.value)}`,d=r=>r.length*6.2+8<=w;return(0,a.jsx)("span",{"data-graview-tier":t.tier,style:{flexGrow:t.count},title:i,children:d(i)?i:d(o)?o:""},n)})})}export{A as StatesBar};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as h}from"./chunk.
|
|
1
|
+
import{a as h}from"./chunk.27CW6SCT.js";import{Aa as b,D as g,H as k,J as w,Ob as x,xa as u}from"./chunk.7BBGRTXM.js";var s=i=>i?._zod?.def,O=Symbol.for("@graview/core:collaborative"),v=/^\^\\d\{4\}-\\d\{2\}-\\d\{2\}\$$/;function S(i){let n=s(i),p=!0,a;for(let e=0;n&&e<4;e++){if(n.type==="optional"||n.type==="nullable")p=!1;else if(n.type==="default")p=!1,a=n.defaultValue;else break;n=s(n.innerType)}if(!n)return{why:"it is not a zod field"};let l=g(i),r={...p?{required:!0}:{},...a!==void 0?{default:a}:{},...l?{description:l}:{}},f=(n.checks??[]).map(e=>s(e)),c=u(i);if(c)return{spec:{type:c,...r}};if(b(i))return{spec:{type:"app-link",...r}};let d;for(let e=s(i),t=0;e&&d===void 0&&t<4;e=s(e.innerType),t++)d=e[O];let m=e=>d!==void 0&&d===1!=(e==="text")?{collaborative:d===1}:{};if(h(i))return{spec:{type:"text",format:"markdown",...r,...m("text")}};let y=x(i);if(y)return{spec:{type:y,...r}};switch(n.type){case"string":{let e=n.format;return e==="email"?{spec:{type:"email",...r}}:e==="url"?{spec:{type:"url",...r}}:e==="date"?{spec:{type:"date",...r}}:e==="datetime"||f.some(t=>t?.fn===w)?{spec:{type:"datetime",...r}}:f.some(t=>t?.format==="regex"&&(v.test(String(t?.pattern?.source??""))||t?.pattern?.source===k.source))?{spec:{type:"date",...r}}:{spec:{type:"string",...r,...m("string")}}}case"number":{let e={};for(let t of f){let o=t?.value;typeof o=="number"&&(t?.check==="greater_than"&&t.inclusive?e.min=Math.max(e.min??o,o):t?.check==="less_than"&&t.inclusive?e.max=Math.min(e.max??o,o):t?.check==="multiple_of"&&(e.step=o))}return{spec:{type:f.some(t=>t?.format==="safeint"||t?.format==="int")?"integer":"number",...e,...r}}}case"boolean":return{spec:{type:"boolean",...r}};case"enum":{let e=Object.keys(n.entries??{});return e.length>0?{spec:{type:"enum",options:e,...r}}:{why:"it is an enum with no options"}}case"array":{let e=s(n.element),t=u(n.element)??(e?.type==="number"?"number":e?.type==="string"?"string":void 0);return t?{spec:{type:"list",of:t,...r}}:{why:`it is a list of ${String(e?.type??"something")}, and a document lists words, numbers, dates, images, videos or files`}}default:return{why:`it is a ${String(n.type)}, which a document has no field type for`}}}function T(i){let n=S(i);return"spec"in n?n.spec:void 0}export{T as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as v,b as y,c as m}from"./chunk.MB7LKKUD.js";import"./chunk.
|
|
1
|
+
import{a as v,b as y,c as m}from"./chunk.MB7LKKUD.js";import"./chunk.YD3TKV6P.js";import"./chunk.4KC35UNR.js";import{G as N,Sa as c,T as u,Ua as b}from"./chunk.HT2BEOEV.js";import"./chunk.SDO3U72B.js";import{Vc as f}from"./chunk.7BBGRTXM.js";import"./chunk.FQLNBIQ5.js";import{b as p}from"./chunk.AJZBJBMO.js";var l=p(N(),1);var t=p(u(),1);function z({notices:o,anchor:n,board:a}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w,{notices:o.filter(i=>i.kind==="banner"),at:"top",anchor:n,board:a}),(0,t.jsx)(w,{notices:o.filter(i=>i.kind==="toast"),at:"foot",anchor:n,board:a})]})}var h={info:"var(--graview-accent)",good:"var(--graview-good)",warn:"var(--graview-warn)",bad:"var(--graview-bad)"};function w({notices:o,at:n,anchor:a,board:i}){let d=(0,l.useRef)(null),e=o.length>0;return(0,l.useLayoutEffect)(()=>{let r=d.current;if(!e||!r)return;if(typeof r.showPopover=="function"&&!c(r))try{r.showPopover()}catch{}let s=()=>(n==="top"?m:y)(r,a());s(),n==="foot"&&i.hold?.(()=>r.matches(":hover, :focus-within"));let S=b(r);addEventListener("resize",s),addEventListener("scroll",s,!0),n==="foot"&&addEventListener(v,s);let g=typeof ResizeObserver=="function"?new ResizeObserver(s):null;return g?.observe(r),()=>{if(S(),g?.disconnect(),removeEventListener("resize",s),removeEventListener("scroll",s,!0),removeEventListener(v,s),r.isConnected&&c(r))try{r.hidePopover()}catch{}}},[e,n,a,i]),e?(0,t.jsx)("div",{ref:d,popover:"manual",role:"region","aria-label":n==="top"?"Notices":"Messages","data-testid":n==="top"?"notices-banners":"notices-toasts","data-graview-offstage":"",style:{position:"fixed",inset:"auto",margin:0,padding:0,border:"none",background:"none",overflow:"visible",zIndex:f("toast"),width:"max-content",height:"auto",maxWidth:"min(560px, calc(100vw - 32px))",display:"grid",gap:8,color:"var(--graview-ink)"},children:o.map(r=>(0,t.jsx)(C,{notice:r,board:i},r.id))}):null}var T=o=>o.split(/\s+/).filter(Boolean).map(n=>n.replace(/^Meta\+/,"\u2318").replace(/^Control\+/,"Ctrl+").replace(/^Alt\+/,"Alt+")).join(" or ");function C({notice:o,board:n}){let a=o.tone??"info",i=[...o.action?[o.action]:[],...o.actions??[]],d=()=>n.dismiss(o.id);return(0,t.jsxs)("div",{"data-testid":"notice","data-kind":o.kind,"data-tone":a,style:{boxSizing:"border-box",display:"flex",flexWrap:"wrap",alignItems:"center",gap:"8px 12px",padding:o.kind==="banner"?"8px 10px 8px 14px":"10px 12px 10px 14px",borderRadius:"var(--graview-radius, 12px)",borderTop:"1px solid var(--graview-edge)",borderRight:"1px solid var(--graview-edge)",borderBottom:"1px solid var(--graview-edge)",borderLeft:`3px solid ${h[a]}`,background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",fontSize:"0.875rem",lineHeight:1.45},children:[(0,t.jsx)("span",{"aria-hidden":"true",style:{width:7,height:7,borderRadius:999,flex:"0 0 auto",background:h[a]}}),(0,t.jsx)("span",{style:{flex:"1 1 16rem",minWidth:0},children:o.sentence}),i.length>0?(0,t.jsx)("span",{style:{display:"flex",flexWrap:"wrap",gap:6},children:i.map((e,r)=>e.href!==void 0?(0,t.jsx)("a",{href:e.href,...e.target?{target:e.target,rel:"noopener"}:{},"data-testid":"notice-action",onClick:()=>{e.onSelect?.(),d()},style:{...x,...r===0?k:{}},children:e.label},e.label):(0,t.jsx)("button",{type:"button","data-testid":"notice-action",...e.keys?{"aria-keyshortcuts":e.keys,title:`${e.label} \u2014 ${T(e.keys)}`}:{},onClick:()=>{d(),e.onSelect?.()},style:{...x,...r===0?k:{}},children:e.label},e.label))}):null,(0,t.jsx)("button",{type:"button","data-testid":"notice-dismiss","aria-label":`Dismiss: ${o.sentence}`,title:"Dismiss",onClick:d,style:E,children:"\xD7"})]})}var x={display:"inline-flex",alignItems:"center",minHeight:28,padding:"2px 12px",borderRadius:9,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)",font:"inherit",fontWeight:500,textDecoration:"none",cursor:"pointer"},k={background:"var(--graview-accent)",borderColor:"var(--graview-accent)",color:"var(--graview-accent-ink)"},E={minWidth:28,minHeight:28,padding:0,border:"none",background:"none",boxShadow:"none",color:"var(--graview-ink-muted)",fontSize:"1rem",cursor:"pointer"};export{z as NoticeStacks};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Za as g}from"./chunk.
|
|
1
|
+
import{Za as g}from"./chunk.7BBGRTXM.js";function y(e){return[`based on \u201C${e.basis}\u201D`,...e.confidence!==void 0?[`${Math.round(e.confidence*100)}% sure`]:[],...e.model?[e.model]:[]].join(" \xB7 ")}var u=e=>`Not yet kept by a person. ${e.by.name??e.by.id??"Something"} made it${e.lineage?`, ${y(e.lineage)}`:""}.`,p=e=>`${e.kind}\0${e.from}\0${e.to}`;function k(e,o){let r=new Map;for(let n of e){if(n.undoes!==void 0||o.has(n.id)||n.withheld)continue;let l=g(n.author),s=l==="human"||l==="visitor",c=new Map;for(let t of n.primitives){if(t.op!=="add-edge"&&t.op!=="remove-edge")continue;let i=p(t.edge),a=r.get(i)??c.get(i);if(r.delete(i),t.op==="remove-edge")a&&c.set(i,a);else if(a&&(s||!n.lineage))r.set(i,s?{...a,provisional:!1,keptBy:n.id}:a);else{let d=n.lineage;r.set(i,{edge:t.edge,made:n.id,by:n.author,...d?{lineage:d}:{},provisional:!s&&(d?.confidence??1)<1})}}}return r}var f=new WeakMap;function v({log:e}){let o=e.all(),r=`${e.horizon}:${o.length}:${o.at(-1)?.id}`,n=f.get(e);return n?.at!==r&&f.set(e,n={at:r,links:k(o,e.undoneIds())}),n.links}var L=(e,o)=>v(e).get(p(o));var m=e=>[...v(e).values()].filter(o=>o.provisional);export{y as a,u as b,L as c,m as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}from"./chunk.LY3YOWKV.js";import"./chunk.G4JJXA63.js";import"./chunk.LL2MLSPH.js";import"./chunk.EB4NVTJL.js";import"./chunk.XU34T2H4.js";import"./chunk.XOZU4OFA.js";import"./chunk.BB33TI4S.js";import"./chunk.2EDC63RI.js";import"./chunk.WVUJXDXZ.js";import"./chunk.LDAYDCUO.js";import"./chunk.KKNDX4JT.js";import"./chunk.GKSUTAIX.js";import"./chunk.5ICIMQE6.js";import"./chunk.QGV7H7RQ.js";import"./chunk.YIA2EDVF.js";import"./chunk.3YZHZGTM.js";import"./chunk.EQTSV7BK.js";import"./chunk.27CW6SCT.js";import"./chunk.7BBGRTXM.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{i as draftAnswer,h as draftFromLens,b as draftSight,l as draftView,a as isDraftFailure,c as judgeLens,d as lensEditOf,f as lensFromSpec,j as recipeDraft,g as recipeOfLens,m as refineDraft,o as runDraftTool,e as takeBackEditOf,k as templateDraft,n as withReaderLenses};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as n}from"./chunk.GCBZ3WE2.js";import"./chunk.GDOTG7YA.js";import"./chunk.EPPXZZPK.js";import"./chunk.KFQSYCY3.js";import"./chunk.LCPGZK7G.js";import"./chunk.NKC3JILT.js";import"./chunk.HEWVPXRE.js";import"./chunk.43OKZU73.js";import"./chunk.WNSC3RWD.js";import"./chunk.ACYDJQRC.js";import"./chunk.S5MGE2U5.js";import"./chunk.34TW32TB.js";import"./chunk.WVUJXDXZ.js";import{e as p}from"./chunk.LDAYDCUO.js";import"./chunk.KKNDX4JT.js";import"./chunk.GKSUTAIX.js";import"./chunk.5ICIMQE6.js";import"./chunk.QGV7H7RQ.js";import"./chunk.YIA2EDVF.js";import"./chunk.GZHZLJBF.js";import"./chunk.ELERUERU.js";import"./chunk.OJGHDWI6.js";import"./chunk.YHTE34RN.js";import"./chunk.3YZHZGTM.js";import"./chunk.EQTSV7BK.js";import"./chunk.27CW6SCT.js";import"./chunk.YD3TKV6P.js";import"./chunk.4KC35UNR.js";import{T as m}from"./chunk.HT2BEOEV.js";import"./chunk.SDO3U72B.js";import"./chunk.7BBGRTXM.js";import"./chunk.FQLNBIQ5.js";import{b as t}from"./chunk.AJZBJBMO.js";var i=t(m(),1),a=new WeakMap;function l(o){let e=a.get(o);if(!e){let r=p(o);e=c=>c.mode==="fullscreen"?(0,i.jsx)(n,{blocks:r,slot:"home",heading:2,firstHeading:1}):(0,i.jsx)(n,{blocks:r,slot:"home",heading:3,firstHeading:2}),a.set(o,e)}return e}export{l as homeView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as a}from"./chunk.
|
|
1
|
+
import{e as a}from"./chunk.NKC3JILT.js";import{l as i}from"./chunk.HT2BEOEV.js";import{Fd as o}from"./chunk.7BBGRTXM.js";function p(t){let r=t.within??{};return o({...r.sort?{sort:r.sort}:{},...r.filter?{filter:r.filter}:{},...r.group?{group:r.group}:{},...r.q?{q:r.q}:{},...r.archived?{archived:r.archived}:{}})}function c(t,r){let m=a(r),e=t;for(let n of["sort","filter","group","q","archived"])e=i(e,n,m[n]??null);return e}export{p as a,c as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as I}from"./chunk.FPGU43SC.js";import{a as ie,b as de,c as se,d as le,e as V,f as L,g as ue}from"./chunk.V6FUYRZI.js";import{a as ye}from"./chunk.5BPRGXIW.js";import{c as T,e as ae,f as fe}from"./chunk.BZEJM2PY.js";import{a as j,b as ee,c as ne,d as re,f as E,m as te,n as b,o as oe,p as B,q as v}from"./chunk.CMLNBJZG.js";import{b as x,d as pe,e as me,g as ce,i as ge,j as he,k as be}from"./chunk.N33WUCAN.js";import{C as P,Fa as Y,K as H,Lb as q,Mb as Q,Nb as C,T as K,W as F,aa as J,ga as X,ma as N,oa as Z,ta as G,ua as A,va as z,wa as O,xa as M}from"./chunk.DIFR37EZ.js";var we=e=>e.caption?.trim()||e.name,_=e=>A(e)?`${we(e)}, ${z(e)}`:we(e);function tn(e){let n=Math.max(0,Math.round(e)),t=a=>String(a).padStart(2,"0"),r=Math.floor(n/3600),o=Math.floor(n%3600/60);return r>0?`${r}:${t(o)}:${t(n%60)}`:`${o}:${t(n%60)}`}function Pe(e){let n=e?.fields?.shape??{};return Object.keys(n).filter(t=>{let r=P(n[t]);for(;r?.innerType;)r=P(r.innerType);return M(n[t])!==void 0||r?.type==="array"&&M(r.element)!==void 0})}function on(e,n){for(let t of Pe(n)){let r=O(e[t]).find(o=>G(o)||A(o));if(r)return r}}var k=e=>{try{return e()}catch{return null}},Te=e=>typeof e=="string"&&ie.includes(e);function Fe(e){if(e!==void 0)return Te(e)?e:e&&typeof e=="object"&&typeof e.expr=="string"?{expr:k(()=>T(e.expr))}:"neutral"}var Ne=4;function Me(e){let n=typeof e.list=="string"?k(()=>T(e.list)):null,t=e.sort,r=typeof t=="string"?t:t&&typeof t=="object"&&typeof t.by=="string"?t.by:void 0,o=t&&typeof t=="object"?t.direction:void 0,a=n,d;if(n&&r!==void 0)if(o==="choices")d=r;else{let y=k(()=>T(r));a=y?{t:"call",fn:"sort",args:[n,y,{t:"lit",value:o==="desc"?"desc":"asc",at:0}],at:0}:null}let l=typeof e.limit=="number"&&Number.isInteger(e.limit)&&e.limit>=1?Math.min(e.limit,V):void 0,i=e.group,s=typeof i=="string"?i:i&&typeof i=="object"&&typeof i.by=="string"?i.by:void 0,f=i&&typeof i=="object"&&i.headings&&typeof i.headings=="object"?i.headings:{};return{t:"list",source:a,...d?{choiceOrder:d}:{},...l?{limit:l}:{},...s?{group:{by:s,headings:Object.fromEntries(Object.entries(f).filter(y=>typeof y[1]=="string"))}}:{},...typeof e.empty=="string"?{empty:e.empty}:{},as:e.as==="card"?"card":"row"}}function Se(e,n=1,t=""){if(!Array.isArray(e)||n>Ne)return[];let r={};return e.flatMap(o=>{if(!o||typeof o!="object"||Array.isArray(o))return[];let a=o,d=p=>typeof p=="string"?k(()=>ae(p)):null,l=p=>typeof p=="string"?k(()=>T(p)):null,i=Fe(a.tone),s=typeof a.label=="string"?a.label:void 0,f=p=>Object.hasOwn(a,p),y=typeof a.currency=="string"&&/^[A-Z]{3}$/.test(a.currency)?a.currency:void 0,u=f("list")?"list":f("headline")?"headline":typeof a.figure=="string"?"number":Ce.find(f);if(!u)return[];let m=r[u]=(r[u]??0)+1,c=a.key,R=typeof c=="string"&&c?c:`${t}${u}.${m}`;return[{...(()=>{switch(u){case"list":return Me(a);case"number":{let p=se.includes(a.as)?a.as:void 0,W=le.includes(a.emphasis)?a.emphasis:void 0;return{t:u,value:l(a.figure),...p?{as:p}:{},...y?{currency:y}:{},...s?{label:d(s)}:{},...W?{emphasis:W}:{}}}case"headline":case"title":return{t:u,parts:d(a[u])};case"text":{let p=a.lines;return{t:u,parts:d(a[u]),...i?{tone:i}:{},...typeof p=="number"&&Number.isInteger(p)&&p>=0?{lines:p}:{}}}case"badge":return{t:u,parts:d(a[u]),...i?{tone:i}:{}};case"field":{let p=de.includes(a.as)?a.as:void 0;return{t:u,field:String(a.field),...p?{as:p}:{},...y?{currency:y}:{},...s?{label:s}:{}}}case"image":return{t:u,field:String(a.image),as:a.as==="gallery"?"gallery":"thumb",...s?{label:s}:{}};case"progress":{let p=a.progress??{};return{t:u,value:l(p.value),max:l(p.max),...s?{label:d(s)}:{}}}case"group":return{t:u,blocks:Se(a.group,n+1,`${R}.`),direction:a.direction==="row"?"row":"column"};case"when":return{t:u,when:l(a.when),show:Se(a.show,n+1,`${R}.`)};default:return{t:u}}})(),key:R}]})}var Ce=["title","text","badge","field","image","progress","group","when","divider","figure"],g="\u2014",Ve=500;function w(e,n){if(!e)return{ok:!1,problem:"an expression that does not parse"};try{return{ok:!0,value:E(e,{graph:n.graph??te,subject:n.node,kinds:n.kinds,today:n.today,budget:n.budget??Ve})}}catch(t){return{ok:!1,problem:t instanceof Error?t.message:String(t)}}}var Le=(e,n,t)=>!e.format&&e.expr?.t==="ident"&&typeof t=="string"&&n.fields[e.expr.name]?.format==="markdown";function S(e,n,t){if(!e)return{text:g,problem:"a template that does not parse"};let r,o;return{text:e.map(d=>{if(d.text!==void 0)return d.text;let l=w(d.expr??null,n);if(!l.ok)return r??=`{${d.source??""}}: ${l.problem}`,g;if(Le(d,n,l.value))return n.glance?pe(l.value,{markdown:!0}):t&&e.length===1?(o=!0,l.value):me(l.value);let i=!d.format&&d.expr?.t==="ident"&&typeof l.value=="number"?Ge(n,d.expr.name):void 0;return oe(d,i?C(l.value,i):b(l.value,d.format,n.today,d.formatArgs,n.money,v(n.schema)))}).join(""),...r?{problem:r}:{},...o?{markdown:o}:{}}}var Ie=" \xB7 ";function _e(e,n){if(!e||!n.node)return;let t=[[]];for(let d of e){if(d.text===void 0){t[t.length-1].push(d);continue}d.text.split(Ie).forEach((i,s)=>{s>0&&t.push([]),i!==""&&t[t.length-1].push({text:i})})}if(t.length<2)return;let r=d=>{let[l]=d;if(!(d.length!==1||!l||l.format||l.expr?.t!=="ident"))return n.fields[l.expr.name]?.type==="enum"?l.expr.name:void 0},o=0,a=t.flatMap(d=>{let l=r(d);if(l){let s=Object.hasOwn(n.node,l)?n.node[l]:void 0;return s==null||s===""?[]:(o++,[{text:x(n.definition,l,s),field:l}])}let i=S(d,n).text.trim();return i===""||i===g?[]:[{text:i}]});return o>0?a:void 0}function Re(e,n){if(e===void 0)return;if(typeof e=="string")return e;let t=w(e.expr,n);return t.ok&&Te(t.value)?t.value:"neutral"}function De(e){if(typeof e=="string")try{let n=new URL(e);return n.protocol==="http:"||n.protocol==="https:"?n.href:void 0}catch{return}}var xe=(e,n)=>{let t=e.fields[n]?.type;return t==="phone"||t==="place"||t==="duration"?t:ge(e.definition,n)},Ge=(e,n)=>q(e.definition?.fields?.shape?.[n])??ce(e.definition,n);function $e(e,n,t,r,o){if(n==null||n==="")return g;if(typeof n=="boolean")return n?"yes":"no";if(r)return b(n,r,t.today,[],o?{...t.money,currency:o}:t.money);let a=t.fields[e];if(t.definition?.display?.format?.[e])return x(t.definition,e,n);let d=he(xe(t,e),n,t.money?.locale);if(d!==void 0)return d;if(a?.type==="date")return b(n,"date",t.today,[],t.money);if(a?.type==="datetime"&&typeof n=="string")return K(n,t.money?.locale,t.money?.timeZone);if(a?.type==="enum"&&typeof n=="string")return x(t.definition,e,n);let l=typeof n=="number"?Ge(t,e):void 0;if(l)return C(n,l);if(typeof n=="number")return F(n,t.money?.locale,{});let i=O(n);return i[0]?i.map(_).join(", "):Array.isArray(n)?n.map(s=>String(s)).join(", "):typeof n=="object"?g:String(n)}function Ue(e,n,t,r,o){return typeof e!="number"?String(e):n==="money"?Q(e,t?{...o,currency:t}:o):n==="percent"?b(e,n,r,[],o):F(e,o?.locale)}var h=(e,n)=>n?{...e,problem:n}:e;function ke(e){return e.firstHeading===void 0?e:{...e,firstHeading:void 0}}function We(e,n,t){switch(e.t){case"title":{let r=S(e.parts,n);return h({t:"title",text:r.text},r.problem)}case"text":{let r=S(e.parts,n,!0),o=Re(e.tone,n),a=n.glance&&!r.problem?_e(e.parts,n):void 0;return h({t:"text",text:r.text,...o?{tone:o}:{},...e.lines!==void 0?{lines:e.lines}:{},...r.markdown?{markdown:r.markdown}:{},...a?{runs:a}:{}},r.problem)}case"badge":{let r=S(e.parts,n);return h({t:"badge",text:r.text,tone:Re(e.tone,n)??"neutral"},r.problem)}case"field":{let r=e.label??N(n.definition,e.field);if(!n.node)return{t:"field",field:e.field,label:r,text:g,problem:`"${e.field}" names a field, and these blocks are about no one record`};let o=e.as===void 0?n.kinds.get(n.node.kind)?.linked?.get(e.field):void 0;if(o){let y=Y(Object.hasOwn(n.node,e.field)?n.node[e.field]:void 0,o);return{t:"field",field:e.field,label:r,text:y.length>0?"linked record":g,...y.length>0?{linked:{relation:o,refs:y}}:{}}}let a=n.kinds.get(n.node.kind)?.computed?.has(e.field),d,l;if(a){let y=w({t:"ident",name:e.field,at:0},n);y.ok?d=y.value!==null&&typeof y.value=="object"?b(y.value,void 0,n.today,[],n.money,v(n.schema)):y.value:l=y.problem}else d=Object.hasOwn(n.node,e.field)?n.node[e.field]:void 0;let i=e.as!==void 0?void 0:n.fields[e.field]?.type==="url"?De(d):be(xe(n,e.field),d),s=k(()=>$e(e.field,d,n,e.as,e.currency))??g,f=n.fields[e.field]?.type==="app-link"&&e.as===void 0&&typeof d=="string"?d:void 0;return h({t:"field",field:e.field,label:r,text:s,...i?{href:i}:{},...f?{app:f}:{}},l)}case"image":{let r=O(n.node&&Object.hasOwn(n.node,e.field)?n.node[e.field]:null),o=e.as==="gallery"?r:r.filter(a=>G(a)||A(a)).slice(0,1);return{t:"image",field:e.field,label:e.label??N(n.definition,e.field),as:e.as,files:o,text:o.map(_).join(", ")||g}}case"progress":{let r=w(e.value,n),o=w(e.max,n),a=e.label?S(e.label,n):{text:"Progress"},d=e.label?B(e.label,a.text):a.text,l=r.ok?o.ok?a.problem:o.problem:r.problem;return r.ok&&o.ok&&typeof r.value=="number"&&typeof o.value=="number"&&Number.isFinite(r.value)&&Number.isFinite(o.value)&&o.value>0?h({t:"progress",label:d,value:r.value,max:o.value,text:`${b(r.value,void 0,n.today)} of ${b(o.value,void 0,n.today)}`},l):h({t:"progress",label:d,text:g},l)}case"group":return{t:"group",direction:e.direction,blocks:Ae(e.blocks,ke(n))};case"when":{let r=w(e.when,n),o=r.ok&&r.value===!0;return h({t:"when",shown:o,blocks:o?Ae(e.show,ke(n)):[]},r.ok?void 0:r.problem)}case"divider":return{t:"divider"};case"figure":return{t:"figure"};case"headline":{let r=S(e.parts,n),o=Math.min(6,Math.max(1,(t?n.firstHeading:void 0)??n.heading??3));return h({t:"headline",level:o,text:e.parts?B(e.parts,r.text):r.text},r.problem)}case"number":{let r=w(e.value,n),o=!r.ok||r.value===null||typeof r.value=="object"?g:Ue(r.value,e.as,e.currency,n.today,n.money),a=e.label?S(e.label,n):void 0;return h({t:"number",text:o,...a&&e.label?{label:B(e.label,a.text)}:{},...e.emphasis?{emphasis:e.emphasis}:{}},r.ok?a?.problem:r.problem)}case"list":return Ke(e,n)}}function Ae(e,n){let t=e.findIndex(r=>r.t==="headline");return e.map((r,o)=>({...We(r,n,o===t),key:r.key}))}function Oe(e,n){let t=n.trim().toLowerCase();return e.some(r=>{switch(r.t){case"title":case"headline":return r.text.trim()!=="";case"text":case"badge":return t!==""&&r.text.toLowerCase().includes(t);case"group":return Oe(r.blocks,n);case"when":return r.shown&&Oe(r.blocks,n);default:return!1}})}var He=new Set(["every","some","sum","min","max","sort"]);function jn(e,n){let t=new Set,r=new Set,o=i=>{if(i)switch(i.t){case"ident":t.add(i.name);return;case"list":i.items.forEach(o);return;case"member":return o(i.object);case"unary":return o(i.operand);case"binary":return o(i.left),o(i.right);case"where":return o(i.set);case"call":i.args.forEach((s,f)=>{f===1&&He.has(i.fn)||o(s)});return;default:return}},a=i=>{for(let s of i??[])o(s.expr)},d=(i,s)=>{i.forEach((f,y)=>{let u=s[y];if(u)switch(f.t){case"field":case"image":t.add(f.field);return;case"title":case"text":case"badge":case"headline":a(f.parts);return;case"number":o(f.value),a(f.label);return;case"progress":o(f.value),o(f.max);return;case"group":u.t==="group"&&d(f.blocks,u.blocks);return;case"when":u.t==="when"&&u.shown&&d(f.show,u.blocks);return;case"list":if(u.t==="list")for(let m of u.members)r.add(m.id);return;default:return}})};d(e,n);let l=n[0];return{fields:t,records:r,...e[0]?.t==="title"&&l?.t==="title"?{title:l.text}:{}}}function Ke(e,n){let t=Math.min(6,(n.heading??3)+1),r=w(e.source,n);if(!r.ok)return{t:"list",as:e.as,failed:!0,members:[],headingLevel:t,more:0,problem:r.problem};let o=r.value,a=o instanceof j?o.nodes:o!==null&&typeof o=="object"&&!Array.isArray(o)?[o]:[];e.choiceOrder&&n.schema&&(a=Je(a,e.choiceOrder,n.schema));let d=a.length,l=a.slice(0,e.limit??V),i=l.slice(0,L),s=l.slice(L),f=(e.limit===void 0?d:l.length)-i.length,y=c=>e.group&&n.schema&&c.length>0?Xe(c,e.group,n.schema,n.graph):void 0,u=y(i),m=s.length>0?y(l):void 0;return{t:"list",as:e.as,failed:!1,members:i,...s.length>0?{rest:s}:{},...u?{groups:u}:{},...m?{everyGroup:m}:{},headingLevel:t,...i.length===0&&e.empty?{empty:e.empty}:{},more:f,total:d}}function D(e,n,t){let r=e.tryDefinition(n)?.fields?.shape,o=r&&Object.hasOwn(r,t)?I(r[t]):void 0;return o?.type==="enum"?o.options??[]:[]}var $=(e,n)=>Object.hasOwn(e,n)?e[n]:void 0;function Je(e,n,t){let r=o=>{let a=D(t,o.kind,n).indexOf(String($(o,n)));return a<0?Number.MAX_SAFE_INTEGER:a};return e.map((o,a)=>({node:o,i:a,rank:r(o)})).sort((o,a)=>o.rank-a.rank||o.i-a.i).map(o=>o.node)}function Xe(e,n,t,r){let o=e.some(i=>D(t,i.kind,n.by).length>0)?void 0:ue(n.by);if(o&&r)return Ze(e,o,n.headings,t,r);let a=[];for(let i of e)for(let s of D(t,i.kind,n.by))a.includes(s)||a.push(s);let d=[];for(let i of a){let s=e.filter(y=>$(y,n.by)===i);if(s.length===0)continue;let f=t.tryDefinition(s[0].kind);d.push({value:i,heading:n.headings[i]??J(x(f,n.by,i)),members:s})}let l=e.filter(i=>!a.includes(String($(i,n.by))));return l.length>0&&d.push({value:null,members:l}),d}function Ze(e,n,t,r,o){let a=u=>n.way??(Object.hasOwn(r.tryDefinition(u.kind)?.edges??{},n.edge)?"out":"in"),d=new Map,l=[],i=v(r),s;for(let u of e){let m=a(u)==="out"?o.out(u.id,n.edge):o.in(u.id,n.edge);m.length===0&&l.push(u);for(let c of m){s??=c.kind;let R=d.get(c.id)??{node:c,members:[]};R.members.push(u),d.set(c.id,R)}}let f=[...d.values()].map(({node:u,members:m})=>({value:u.id,heading:t[u.id]??i(u),members:m})).sort((u,m)=>u.heading.localeCompare(m.heading,void 0,{numeric:!0}));!s&&e[0]&&a(e[0])==="out"&&(s=(r.tryDefinition(e[0].kind)?.edges??{})[n.edge]?.to?.[0]);let y=s&&s!=="*"?Z(r.tryDefinition(s),s):void 0;return l.length>0&&f.push({value:null,...y?{heading:`No ${y}`}:{},members:l}),f}function je(e){return e.t==="list"||e.t==="headline"||e.t==="number"||e.t==="image"&&e.as==="gallery"?!0:e.t==="group"?e.blocks.some(je):e.t==="when"?e.show.some(je):!1}function Ee(e,n){let t=e.tryDefinition(n)?.fields?.shape??{},r={};for(let[o,a]of Object.entries(t)){let d=I(a);d&&(r[o]=d)}return r}var Be=new WeakMap;function U(e){let n=Be.get(e);return n||Be.set(e,n=ye(e)),n}function ze(e,n,t,r={}){let o=U(e),a={},d={},l=i=>{if(i instanceof j)return i.nodes.map(s=>l(s));if(Array.isArray(i))return i.map(s=>l(s));if(i!==null&&typeof i=="object"){let s=i;return{id:s.id,kind:s.kind,label:X(e.tryDefinition(s.kind),s)}}return i};for(let[i,s]of o.get(t?t.kind:ne)?.computed??[])try{let f=[],y=E(s,{graph:n,subject:t,kinds:o,...r.today?{today:r.today}:{},...r.budget?{budget:r.budget}:{},...r.linked?{linked:r.linked}:{},onUnread:u=>f.push(u)});f.length>0&&(y===null||y instanceof j&&y.nodes.length===0)?d[i]=ee(f[0]):a[i]=l(y)}catch(f){if(!(f instanceof re))throw f;d[i]=f.sentence}return{values:a,refused:d}}function vn(e,n,t){let{values:r}=ze(e,n,t);if(Object.keys(r).length===0)return t;let o=a=>Array.isArray(a)?a.map(o):a!==null&&typeof a=="object"?a.label:a;return{...t,...Object.fromEntries(Object.entries(r).map(([a,d])=>[a,o(d)]))}}function Pn(e,n){return[...fe(e.tryDefinition(n)).keys()]}var Ye=500,qe=2e4,ve=new WeakMap;function Qe(e,n){let t=ve.get(e);t||ve.set(e,t=new Map);let r=t.get(n);return r||t.set(n,r=Ee(e,n)),r}function Vn(e,n,t,r={}){if(n&&typeof e.seenBy!="function")throw new TypeError("blockContextFor: a seat is read from a store (its `seenBy`); a bare { graph, schema } is read as it is handed, with no principal");let o=n?e.seenBy(n):e,a=n&&t?o.graph.getNode(t.id)??null:t,d=o.schema,l=a&&d.tryDefinition(a.kind),i=!a||(r.slot??"page")==="page",{money:s,firstHeading:f}=r;return{node:a,graph:o.graph,schema:d,kinds:U(d),fields:a?Qe(d,a.kind):{},definition:l||void 0,today:r.today??o.today?.()??H(s?.timeZone),money:s,heading:r.heading??(i?2:3),firstHeading:f,budget:r.budget??(i?qe:Ye),...i?{}:{glance:!0}}}export{we as a,tn as b,Pe as c,on as d,Se as e,Ae as f,Oe as g,jn as h,je as i,U as j,ze as k,vn as l,Pn as m,Vn as n};
|
|
1
|
+
import{a as I}from"./chunk.KKNDX4JT.js";import{a as ie,b as de,c as se,d as le,e as V,f as L,g as ue}from"./chunk.GKSUTAIX.js";import{a as ye}from"./chunk.5ICIMQE6.js";import{c as T,e as ae,f as fe}from"./chunk.QGV7H7RQ.js";import{a as j,b as ee,c as ne,d as re,f as E,m as te,n as b,o as oe,p as B,q as v}from"./chunk.YIA2EDVF.js";import{b as x,d as pe,e as me,g as ce,i as ge,j as he,k as be}from"./chunk.27CW6SCT.js";import{C as P,Fa as Y,K as H,Lb as q,Mb as Q,Nb as C,T as K,W as F,aa as J,ga as X,ma as N,oa as Z,ta as G,ua as A,va as z,wa as O,xa as M}from"./chunk.7BBGRTXM.js";var we=e=>e.caption?.trim()||e.name,_=e=>A(e)?`${we(e)}, ${z(e)}`:we(e);function tn(e){let n=Math.max(0,Math.round(e)),t=a=>String(a).padStart(2,"0"),r=Math.floor(n/3600),o=Math.floor(n%3600/60);return r>0?`${r}:${t(o)}:${t(n%60)}`:`${o}:${t(n%60)}`}function Pe(e){let n=e?.fields?.shape??{};return Object.keys(n).filter(t=>{let r=P(n[t]);for(;r?.innerType;)r=P(r.innerType);return M(n[t])!==void 0||r?.type==="array"&&M(r.element)!==void 0})}function on(e,n){for(let t of Pe(n)){let r=O(e[t]).find(o=>G(o)||A(o));if(r)return r}}var k=e=>{try{return e()}catch{return null}},Te=e=>typeof e=="string"&&ie.includes(e);function Fe(e){if(e!==void 0)return Te(e)?e:e&&typeof e=="object"&&typeof e.expr=="string"?{expr:k(()=>T(e.expr))}:"neutral"}var Ne=4;function Me(e){let n=typeof e.list=="string"?k(()=>T(e.list)):null,t=e.sort,r=typeof t=="string"?t:t&&typeof t=="object"&&typeof t.by=="string"?t.by:void 0,o=t&&typeof t=="object"?t.direction:void 0,a=n,d;if(n&&r!==void 0)if(o==="choices")d=r;else{let y=k(()=>T(r));a=y?{t:"call",fn:"sort",args:[n,y,{t:"lit",value:o==="desc"?"desc":"asc",at:0}],at:0}:null}let l=typeof e.limit=="number"&&Number.isInteger(e.limit)&&e.limit>=1?Math.min(e.limit,V):void 0,i=e.group,s=typeof i=="string"?i:i&&typeof i=="object"&&typeof i.by=="string"?i.by:void 0,f=i&&typeof i=="object"&&i.headings&&typeof i.headings=="object"?i.headings:{};return{t:"list",source:a,...d?{choiceOrder:d}:{},...l?{limit:l}:{},...s?{group:{by:s,headings:Object.fromEntries(Object.entries(f).filter(y=>typeof y[1]=="string"))}}:{},...typeof e.empty=="string"?{empty:e.empty}:{},as:e.as==="card"?"card":"row"}}function Se(e,n=1,t=""){if(!Array.isArray(e)||n>Ne)return[];let r={};return e.flatMap(o=>{if(!o||typeof o!="object"||Array.isArray(o))return[];let a=o,d=p=>typeof p=="string"?k(()=>ae(p)):null,l=p=>typeof p=="string"?k(()=>T(p)):null,i=Fe(a.tone),s=typeof a.label=="string"?a.label:void 0,f=p=>Object.hasOwn(a,p),y=typeof a.currency=="string"&&/^[A-Z]{3}$/.test(a.currency)?a.currency:void 0,u=f("list")?"list":f("headline")?"headline":typeof a.figure=="string"?"number":Ce.find(f);if(!u)return[];let m=r[u]=(r[u]??0)+1,c=a.key,R=typeof c=="string"&&c?c:`${t}${u}.${m}`;return[{...(()=>{switch(u){case"list":return Me(a);case"number":{let p=se.includes(a.as)?a.as:void 0,W=le.includes(a.emphasis)?a.emphasis:void 0;return{t:u,value:l(a.figure),...p?{as:p}:{},...y?{currency:y}:{},...s?{label:d(s)}:{},...W?{emphasis:W}:{}}}case"headline":case"title":return{t:u,parts:d(a[u])};case"text":{let p=a.lines;return{t:u,parts:d(a[u]),...i?{tone:i}:{},...typeof p=="number"&&Number.isInteger(p)&&p>=0?{lines:p}:{}}}case"badge":return{t:u,parts:d(a[u]),...i?{tone:i}:{}};case"field":{let p=de.includes(a.as)?a.as:void 0;return{t:u,field:String(a.field),...p?{as:p}:{},...y?{currency:y}:{},...s?{label:s}:{}}}case"image":return{t:u,field:String(a.image),as:a.as==="gallery"?"gallery":"thumb",...s?{label:s}:{}};case"progress":{let p=a.progress??{};return{t:u,value:l(p.value),max:l(p.max),...s?{label:d(s)}:{}}}case"group":return{t:u,blocks:Se(a.group,n+1,`${R}.`),direction:a.direction==="row"?"row":"column"};case"when":return{t:u,when:l(a.when),show:Se(a.show,n+1,`${R}.`)};default:return{t:u}}})(),key:R}]})}var Ce=["title","text","badge","field","image","progress","group","when","divider","figure"],g="\u2014",Ve=500;function w(e,n){if(!e)return{ok:!1,problem:"an expression that does not parse"};try{return{ok:!0,value:E(e,{graph:n.graph??te,subject:n.node,kinds:n.kinds,today:n.today,budget:n.budget??Ve})}}catch(t){return{ok:!1,problem:t instanceof Error?t.message:String(t)}}}var Le=(e,n,t)=>!e.format&&e.expr?.t==="ident"&&typeof t=="string"&&n.fields[e.expr.name]?.format==="markdown";function S(e,n,t){if(!e)return{text:g,problem:"a template that does not parse"};let r,o;return{text:e.map(d=>{if(d.text!==void 0)return d.text;let l=w(d.expr??null,n);if(!l.ok)return r??=`{${d.source??""}}: ${l.problem}`,g;if(Le(d,n,l.value))return n.glance?pe(l.value,{markdown:!0}):t&&e.length===1?(o=!0,l.value):me(l.value);let i=!d.format&&d.expr?.t==="ident"&&typeof l.value=="number"?Ge(n,d.expr.name):void 0;return oe(d,i?C(l.value,i):b(l.value,d.format,n.today,d.formatArgs,n.money,v(n.schema)))}).join(""),...r?{problem:r}:{},...o?{markdown:o}:{}}}var Ie=" \xB7 ";function _e(e,n){if(!e||!n.node)return;let t=[[]];for(let d of e){if(d.text===void 0){t[t.length-1].push(d);continue}d.text.split(Ie).forEach((i,s)=>{s>0&&t.push([]),i!==""&&t[t.length-1].push({text:i})})}if(t.length<2)return;let r=d=>{let[l]=d;if(!(d.length!==1||!l||l.format||l.expr?.t!=="ident"))return n.fields[l.expr.name]?.type==="enum"?l.expr.name:void 0},o=0,a=t.flatMap(d=>{let l=r(d);if(l){let s=Object.hasOwn(n.node,l)?n.node[l]:void 0;return s==null||s===""?[]:(o++,[{text:x(n.definition,l,s),field:l}])}let i=S(d,n).text.trim();return i===""||i===g?[]:[{text:i}]});return o>0?a:void 0}function Re(e,n){if(e===void 0)return;if(typeof e=="string")return e;let t=w(e.expr,n);return t.ok&&Te(t.value)?t.value:"neutral"}function De(e){if(typeof e=="string")try{let n=new URL(e);return n.protocol==="http:"||n.protocol==="https:"?n.href:void 0}catch{return}}var xe=(e,n)=>{let t=e.fields[n]?.type;return t==="phone"||t==="place"||t==="duration"?t:ge(e.definition,n)},Ge=(e,n)=>q(e.definition?.fields?.shape?.[n])??ce(e.definition,n);function $e(e,n,t,r,o){if(n==null||n==="")return g;if(typeof n=="boolean")return n?"yes":"no";if(r)return b(n,r,t.today,[],o?{...t.money,currency:o}:t.money);let a=t.fields[e];if(t.definition?.display?.format?.[e])return x(t.definition,e,n);let d=he(xe(t,e),n,t.money?.locale);if(d!==void 0)return d;if(a?.type==="date")return b(n,"date",t.today,[],t.money);if(a?.type==="datetime"&&typeof n=="string")return K(n,t.money?.locale,t.money?.timeZone);if(a?.type==="enum"&&typeof n=="string")return x(t.definition,e,n);let l=typeof n=="number"?Ge(t,e):void 0;if(l)return C(n,l);if(typeof n=="number")return F(n,t.money?.locale,{});let i=O(n);return i[0]?i.map(_).join(", "):Array.isArray(n)?n.map(s=>String(s)).join(", "):typeof n=="object"?g:String(n)}function Ue(e,n,t,r,o){return typeof e!="number"?String(e):n==="money"?Q(e,t?{...o,currency:t}:o):n==="percent"?b(e,n,r,[],o):F(e,o?.locale)}var h=(e,n)=>n?{...e,problem:n}:e;function ke(e){return e.firstHeading===void 0?e:{...e,firstHeading:void 0}}function We(e,n,t){switch(e.t){case"title":{let r=S(e.parts,n);return h({t:"title",text:r.text},r.problem)}case"text":{let r=S(e.parts,n,!0),o=Re(e.tone,n),a=n.glance&&!r.problem?_e(e.parts,n):void 0;return h({t:"text",text:r.text,...o?{tone:o}:{},...e.lines!==void 0?{lines:e.lines}:{},...r.markdown?{markdown:r.markdown}:{},...a?{runs:a}:{}},r.problem)}case"badge":{let r=S(e.parts,n);return h({t:"badge",text:r.text,tone:Re(e.tone,n)??"neutral"},r.problem)}case"field":{let r=e.label??N(n.definition,e.field);if(!n.node)return{t:"field",field:e.field,label:r,text:g,problem:`"${e.field}" names a field, and these blocks are about no one record`};let o=e.as===void 0?n.kinds.get(n.node.kind)?.linked?.get(e.field):void 0;if(o){let y=Y(Object.hasOwn(n.node,e.field)?n.node[e.field]:void 0,o);return{t:"field",field:e.field,label:r,text:y.length>0?"linked record":g,...y.length>0?{linked:{relation:o,refs:y}}:{}}}let a=n.kinds.get(n.node.kind)?.computed?.has(e.field),d,l;if(a){let y=w({t:"ident",name:e.field,at:0},n);y.ok?d=y.value!==null&&typeof y.value=="object"?b(y.value,void 0,n.today,[],n.money,v(n.schema)):y.value:l=y.problem}else d=Object.hasOwn(n.node,e.field)?n.node[e.field]:void 0;let i=e.as!==void 0?void 0:n.fields[e.field]?.type==="url"?De(d):be(xe(n,e.field),d),s=k(()=>$e(e.field,d,n,e.as,e.currency))??g,f=n.fields[e.field]?.type==="app-link"&&e.as===void 0&&typeof d=="string"?d:void 0;return h({t:"field",field:e.field,label:r,text:s,...i?{href:i}:{},...f?{app:f}:{}},l)}case"image":{let r=O(n.node&&Object.hasOwn(n.node,e.field)?n.node[e.field]:null),o=e.as==="gallery"?r:r.filter(a=>G(a)||A(a)).slice(0,1);return{t:"image",field:e.field,label:e.label??N(n.definition,e.field),as:e.as,files:o,text:o.map(_).join(", ")||g}}case"progress":{let r=w(e.value,n),o=w(e.max,n),a=e.label?S(e.label,n):{text:"Progress"},d=e.label?B(e.label,a.text):a.text,l=r.ok?o.ok?a.problem:o.problem:r.problem;return r.ok&&o.ok&&typeof r.value=="number"&&typeof o.value=="number"&&Number.isFinite(r.value)&&Number.isFinite(o.value)&&o.value>0?h({t:"progress",label:d,value:r.value,max:o.value,text:`${b(r.value,void 0,n.today)} of ${b(o.value,void 0,n.today)}`},l):h({t:"progress",label:d,text:g},l)}case"group":return{t:"group",direction:e.direction,blocks:Ae(e.blocks,ke(n))};case"when":{let r=w(e.when,n),o=r.ok&&r.value===!0;return h({t:"when",shown:o,blocks:o?Ae(e.show,ke(n)):[]},r.ok?void 0:r.problem)}case"divider":return{t:"divider"};case"figure":return{t:"figure"};case"headline":{let r=S(e.parts,n),o=Math.min(6,Math.max(1,(t?n.firstHeading:void 0)??n.heading??3));return h({t:"headline",level:o,text:e.parts?B(e.parts,r.text):r.text},r.problem)}case"number":{let r=w(e.value,n),o=!r.ok||r.value===null||typeof r.value=="object"?g:Ue(r.value,e.as,e.currency,n.today,n.money),a=e.label?S(e.label,n):void 0;return h({t:"number",text:o,...a&&e.label?{label:B(e.label,a.text)}:{},...e.emphasis?{emphasis:e.emphasis}:{}},r.ok?a?.problem:r.problem)}case"list":return Ke(e,n)}}function Ae(e,n){let t=e.findIndex(r=>r.t==="headline");return e.map((r,o)=>({...We(r,n,o===t),key:r.key}))}function Oe(e,n){let t=n.trim().toLowerCase();return e.some(r=>{switch(r.t){case"title":case"headline":return r.text.trim()!=="";case"text":case"badge":return t!==""&&r.text.toLowerCase().includes(t);case"group":return Oe(r.blocks,n);case"when":return r.shown&&Oe(r.blocks,n);default:return!1}})}var He=new Set(["every","some","sum","min","max","sort"]);function jn(e,n){let t=new Set,r=new Set,o=i=>{if(i)switch(i.t){case"ident":t.add(i.name);return;case"list":i.items.forEach(o);return;case"member":return o(i.object);case"unary":return o(i.operand);case"binary":return o(i.left),o(i.right);case"where":return o(i.set);case"call":i.args.forEach((s,f)=>{f===1&&He.has(i.fn)||o(s)});return;default:return}},a=i=>{for(let s of i??[])o(s.expr)},d=(i,s)=>{i.forEach((f,y)=>{let u=s[y];if(u)switch(f.t){case"field":case"image":t.add(f.field);return;case"title":case"text":case"badge":case"headline":a(f.parts);return;case"number":o(f.value),a(f.label);return;case"progress":o(f.value),o(f.max);return;case"group":u.t==="group"&&d(f.blocks,u.blocks);return;case"when":u.t==="when"&&u.shown&&d(f.show,u.blocks);return;case"list":if(u.t==="list")for(let m of u.members)r.add(m.id);return;default:return}})};d(e,n);let l=n[0];return{fields:t,records:r,...e[0]?.t==="title"&&l?.t==="title"?{title:l.text}:{}}}function Ke(e,n){let t=Math.min(6,(n.heading??3)+1),r=w(e.source,n);if(!r.ok)return{t:"list",as:e.as,failed:!0,members:[],headingLevel:t,more:0,problem:r.problem};let o=r.value,a=o instanceof j?o.nodes:o!==null&&typeof o=="object"&&!Array.isArray(o)?[o]:[];e.choiceOrder&&n.schema&&(a=Je(a,e.choiceOrder,n.schema));let d=a.length,l=a.slice(0,e.limit??V),i=l.slice(0,L),s=l.slice(L),f=(e.limit===void 0?d:l.length)-i.length,y=c=>e.group&&n.schema&&c.length>0?Xe(c,e.group,n.schema,n.graph):void 0,u=y(i),m=s.length>0?y(l):void 0;return{t:"list",as:e.as,failed:!1,members:i,...s.length>0?{rest:s}:{},...u?{groups:u}:{},...m?{everyGroup:m}:{},headingLevel:t,...i.length===0&&e.empty?{empty:e.empty}:{},more:f,total:d}}function D(e,n,t){let r=e.tryDefinition(n)?.fields?.shape,o=r&&Object.hasOwn(r,t)?I(r[t]):void 0;return o?.type==="enum"?o.options??[]:[]}var $=(e,n)=>Object.hasOwn(e,n)?e[n]:void 0;function Je(e,n,t){let r=o=>{let a=D(t,o.kind,n).indexOf(String($(o,n)));return a<0?Number.MAX_SAFE_INTEGER:a};return e.map((o,a)=>({node:o,i:a,rank:r(o)})).sort((o,a)=>o.rank-a.rank||o.i-a.i).map(o=>o.node)}function Xe(e,n,t,r){let o=e.some(i=>D(t,i.kind,n.by).length>0)?void 0:ue(n.by);if(o&&r)return Ze(e,o,n.headings,t,r);let a=[];for(let i of e)for(let s of D(t,i.kind,n.by))a.includes(s)||a.push(s);let d=[];for(let i of a){let s=e.filter(y=>$(y,n.by)===i);if(s.length===0)continue;let f=t.tryDefinition(s[0].kind);d.push({value:i,heading:n.headings[i]??J(x(f,n.by,i)),members:s})}let l=e.filter(i=>!a.includes(String($(i,n.by))));return l.length>0&&d.push({value:null,members:l}),d}function Ze(e,n,t,r,o){let a=u=>n.way??(Object.hasOwn(r.tryDefinition(u.kind)?.edges??{},n.edge)?"out":"in"),d=new Map,l=[],i=v(r),s;for(let u of e){let m=a(u)==="out"?o.out(u.id,n.edge):o.in(u.id,n.edge);m.length===0&&l.push(u);for(let c of m){s??=c.kind;let R=d.get(c.id)??{node:c,members:[]};R.members.push(u),d.set(c.id,R)}}let f=[...d.values()].map(({node:u,members:m})=>({value:u.id,heading:t[u.id]??i(u),members:m})).sort((u,m)=>u.heading.localeCompare(m.heading,void 0,{numeric:!0}));!s&&e[0]&&a(e[0])==="out"&&(s=(r.tryDefinition(e[0].kind)?.edges??{})[n.edge]?.to?.[0]);let y=s&&s!=="*"?Z(r.tryDefinition(s),s):void 0;return l.length>0&&f.push({value:null,...y?{heading:`No ${y}`}:{},members:l}),f}function je(e){return e.t==="list"||e.t==="headline"||e.t==="number"||e.t==="image"&&e.as==="gallery"?!0:e.t==="group"?e.blocks.some(je):e.t==="when"?e.show.some(je):!1}function Ee(e,n){let t=e.tryDefinition(n)?.fields?.shape??{},r={};for(let[o,a]of Object.entries(t)){let d=I(a);d&&(r[o]=d)}return r}var Be=new WeakMap;function U(e){let n=Be.get(e);return n||Be.set(e,n=ye(e)),n}function ze(e,n,t,r={}){let o=U(e),a={},d={},l=i=>{if(i instanceof j)return i.nodes.map(s=>l(s));if(Array.isArray(i))return i.map(s=>l(s));if(i!==null&&typeof i=="object"){let s=i;return{id:s.id,kind:s.kind,label:X(e.tryDefinition(s.kind),s)}}return i};for(let[i,s]of o.get(t?t.kind:ne)?.computed??[])try{let f=[],y=E(s,{graph:n,subject:t,kinds:o,...r.today?{today:r.today}:{},...r.budget?{budget:r.budget}:{},...r.linked?{linked:r.linked}:{},onUnread:u=>f.push(u)});f.length>0&&(y===null||y instanceof j&&y.nodes.length===0)?d[i]=ee(f[0]):a[i]=l(y)}catch(f){if(!(f instanceof re))throw f;d[i]=f.sentence}return{values:a,refused:d}}function vn(e,n,t){let{values:r}=ze(e,n,t);if(Object.keys(r).length===0)return t;let o=a=>Array.isArray(a)?a.map(o):a!==null&&typeof a=="object"?a.label:a;return{...t,...Object.fromEntries(Object.entries(r).map(([a,d])=>[a,o(d)]))}}function Pn(e,n){return[...fe(e.tryDefinition(n)).keys()]}var Ye=500,qe=2e4,ve=new WeakMap;function Qe(e,n){let t=ve.get(e);t||ve.set(e,t=new Map);let r=t.get(n);return r||t.set(n,r=Ee(e,n)),r}function Vn(e,n,t,r={}){if(n&&typeof e.seenBy!="function")throw new TypeError("blockContextFor: a seat is read from a store (its `seenBy`); a bare { graph, schema } is read as it is handed, with no principal");let o=n?e.seenBy(n):e,a=n&&t?o.graph.getNode(t.id)??null:t,d=o.schema,l=a&&d.tryDefinition(a.kind),i=!a||(r.slot??"page")==="page",{money:s,firstHeading:f}=r;return{node:a,graph:o.graph,schema:d,kinds:U(d),fields:a?Qe(d,a.kind):{},definition:l||void 0,today:r.today??o.today?.()??H(s?.timeZone),money:s,heading:r.heading??(i?2:3),firstHeading:f,budget:r.budget??(i?qe:Ye),...i?{}:{glance:!0}}}export{we as a,tn as b,Pe as c,on as d,Se as e,Ae as f,Oe as g,jn as h,je as i,U as j,ze as k,vn as l,Pn as m,Vn as n};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Rb as w,cc as S}from"./chunk.
|
|
1
|
+
import{Rb as w,cc as S}from"./chunk.7BBGRTXM.js";function v(s){return[...s.mutations??[],...S(s.schema,s.mutations??[])]}function B(s){let i=[...s.schema.kinds],a=v(s),d=new Map,c=new Map;for(let e of a){c.set(e.name,e.creates??[]);let n=w(e.input).filter(t=>!t.optional&&!t.kinds.includes("*")).flatMap(t=>t.kinds);d.set(e.name,[...new Set(n)])}let g=new Map;for(let e of i)g.set(e,[]);for(let e of a)for(let n of c.get(e.name)??[])g.get(n)?.push(e.name);let p=new Map,l=new Set;for(let e=0;;e+=1){let n=[];for(let t of a)if((d.get(t.name)??[]).every(o=>l.has(o)))for(let o of c.get(t.name)??[])l.has(o)||n.push(o);if(n.length===0)break;for(let t of n)l.add(t),p.set(t,e)}let h=e=>{let n=g.get(e)??[];if(n.length===0)return[];let t=n.map(r=>d.get(r)??[]).sort((r,o)=>r.length-o.length)[0];return[...new Set(t)].filter(r=>r!==e)},y=new Map,u=e=>{let n=y.get(e);if(n)return n;let t=new Set;y.set(e,t);for(let r of h(e)){t.add(r);for(let o of u(r))t.add(o)}return t.delete(e),t},f=new Map(i.map(e=>[e,0]));for(let e of i)for(let n of u(e))f.set(n,(f.get(n)??0)+1);let m=i.map(e=>({kind:e,madeBy:[...g.get(e)??[]].sort(),needs:[...h(e)].sort(),depth:p.get(e)??null})).sort((e,n)=>(e.depth??Number.MAX_SAFE_INTEGER)-(n.depth??Number.MAX_SAFE_INTEGER)||(f.get(n.kind)??0)-(f.get(e.kind)??0)||e.kind.localeCompare(n.kind)),k=m.filter(e=>e.depth===0).map(e=>e.kind),A=[...new Set(a.filter(e=>(d.get(e.name)??[]).length===0).filter(e=>(c.get(e.name)??[]).length>0).map(e=>e.name))].sort(),M=m.filter(e=>e.depth===null).map(e=>({kind:e.kind,why:e.madeBy.length===0?"no act declares that it creates this kind":`every act that makes it needs ${e.needs.map(n=>`"${n}"`).join(", ")}, which nothing can make first`}));return{order:m,roots:k,doors:A,unreachable:M}}export{B as a};
|
|
@@ -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{a as y}from"./chunk.
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as y}from"./chunk.43OKZU73.js";import{j as g}from"./chunk.YD3TKV6P.js";import{G as R,Ga as m,T as c}from"./chunk.HT2BEOEV.js";import{a as f}from"./chunk.SDO3U72B.js";import{oa as p}from"./chunk.7BBGRTXM.js";import{b as u}from"./chunk.AJZBJBMO.js";var o=u(R(),1);var r=u(c(),1),S,h=()=>S??=m(f(()=>(__graviewPreload(import.meta.url,["./chunk.2EDC63RI.js","./chunk.5ICIMQE6.js","./chunk.QGV7H7RQ.js","./chunk.YIA2EDVF.js","./chunk.7BBGRTXM.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.D5KTGX7F.js"))));function L(e){let[n,t]=(0,o.useState)(()=>h().current);return(0,o.useEffect)(()=>{if(!e||n)return;let i=!0;return h().load().then(a=>i&&t(a),()=>{}),()=>{i=!1}},[e,n]),n}function D(e,n){let t=L(n.length>0);return(0,o.useMemo)(()=>t?t.withLines(e,n):n,[t,e,n])}function I(e,n){let t=L(n.some(i=>i.shape));return(0,o.useMemo)(()=>{let i=new Map;if(!t)return i;for(let a of n){let l=t.ruleLine(a,e);l&&i.set(a.name,l)}return i},[t,e,n])}function M(e){let n=e.line;if(!(!n||e.message.endsWith(` \u2014 ${n.text}`)||e.message===b(e)))return e.message}function b(e){let n=e.line;return n?n.record!==void 0?`${n.record} \u2014 ${n.text}`:n.text:e.message}var P={name:{},op:{color:"var(--graview-ink-muted)",fontWeight:500},value:{fontWeight:600,fontVariantNumeric:"tabular-nums"},word:{color:"var(--graview-ink-muted)"},open:{color:"var(--graview-ink-faint)"},close:{color:"var(--graview-ink-faint)"}};function w({parts:e}){return(0,r.jsx)(r.Fragment,{children:e.map((n,t)=>(0,r.jsxs)("span",{children:[n.space?" ":"",(0,r.jsx)("span",{"data-graview-rule-part":n.as,style:P[n.as],children:n.text})]},t))})}function x(e,n){let t=p(e?.tryDefinition(n),n);return t.charAt(0).toUpperCase()+t.slice(1)}function C({line:e,schema:n,brand:t,lead:i=e.record===void 0?"kind":"record",stacked:a=!1,style:l}){let d=e.kind,s=i==="kind"?d?x(n,d):void 0:i==="record"?e.record:void 0,k=i==="kind"&&s?`${s}: ${e.said}`:i==="record"&&s?`${s} \u2014 ${e.said}`:e.said;return(0,r.jsxs)("span",{"data-graview-rule-line":"",style:{overflowWrap:"anywhere",...l},children:[(0,r.jsx)("span",{style:g,children:k}),(0,r.jsxs)("span",{"aria-hidden":"true",children:[i!=="none"&&d?(0,r.jsx)("span",{style:{display:"inline-flex",verticalAlign:"-0.1em",marginRight:"0.4em"},children:(0,r.jsx)(y,{kind:d,...n?{schema:n}:{},...t?{brand:t}:{},size:13})}):null,s?(0,r.jsxs)("span",{"data-graview-rule-head":"",style:{fontWeight:600,marginRight:i==="record"||a?0:"0.6em"},children:[s,i==="record"&&!a?(0,r.jsx)("span",{style:{color:"var(--graview-ink-faint)",fontWeight:400},children:" \u2014 "}):null]}):null,a&&s?(0,r.jsx)("br",{}):null,(0,r.jsx)(w,{parts:e.parts}),e.when&&e.when.length>0?(0,r.jsxs)("span",{"data-graview-rule-when":"",style:{color:"var(--graview-ink-faint)"},children:[", when ",(0,r.jsx)(w,{parts:e.when})]}):null]})]})}function z(e){return e.line?e.label&&e.label.trim().length>0?e.label:void 0:e.label&&e.label!==e.message&&!e.message.startsWith(e.label)?e.label:void 0}export{D as a,I as b,M as c,C as d,z as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as S,G,l as O,y as v,z as C}from"./chunk.
|
|
1
|
+
import{A as S,G,l as O,y as v,z as C}from"./chunk.YD3TKV6P.js";import{G as I,ba as m,c as V,j as y,l as p,m as g,n as u,o as D,v as B,z as E}from"./chunk.HT2BEOEV.js";import{Bd as R,Cd as T,ka as M,yd as P,zd as k}from"./chunk.7BBGRTXM.js";import{b as A}from"./chunk.AJZBJBMO.js";var W=A(I(),1);function j(e,t){try{t.length===0?localStorage.removeItem(v(e)):localStorage.setItem(v(e),JSON.stringify(t))}catch{}}function F(e,t){j(e,[...S(e).filter(n=>n.title!==t.title),t])}function H(e,t){j(e,S(e).filter(n=>n.title!==t))}function J(e,t){for(let n of e.places().filter(o=>o.title===t))e.forget?.(n.kind,n.as)}var U=e=>e===!0?{written:!0}:typeof e=="object"&&e!==null?{written:e.kept===!0,...e.said?{said:e.said}:{}}:{written:!1},N=e=>({title:e.title,lens:e.lens,on:e.on,...e.bindings?{bindings:e.bindings}:{},...e.options?{options:e.options}:{}});function Z(e,t){let n=o=>t.some(r=>r.title===o||r.as===P(o));if(!n(e))return e;for(let o=2;;o++)if(!n(`${e} ${o}`))return`${e} ${o}`}function ie(e){let{store:t,views:n,brand:o,seatTalk:r,onKeepLens:d}=m(),h=(0,W.useContext)(O),L=C(o,t.schema),b=async f=>{let{edit:i}=f;if(f.written&&d)try{await d({op:"remove-lens",title:i.title,on:i.on})}catch{}H(L,i.title),J(n,i.title),h?.dismiss(`kept:${i.title}`),r.setTurns(l=>[...l.map(s=>s.kept&&s.kept.edit.title===i.title&&!s.kept.taken?{...s,kept:{...s.kept,taken:!0}}:s),{role:"seat",text:`Took \u201C${i.title}\u201D back out of the places.`}]);let a=M(t.schema,i.on);e({to:"kind",kind:i.on,title:a,address:k(t.schema,i.on),said:`Went to ${a}.`})};return{keep:async f=>{let i=Z(f.edit.title,n.places()),a={...f.edit,title:i},l=!1,s;if(d)try{({written:l,said:s}=U(await d(a)))}catch{l=!1}l||F(L,N(a)),G(n,t.schema,[N(a)]);let K=n.places(),c=K.find(w=>w.title===i),x=s??(l?`Kept \u201C${i}\u201D as a lens: it is in the places now.`:d?`Kept \u201C${i}\u201D as your own lens. Ask the owner to keep it for everyone.`:`Kept \u201C${i}\u201D as your own lens.`),$={edit:a,written:l};r.setDraft(null),r.setTurns(w=>[...w,{role:"seat",text:x,kept:$}]),h?.notify({kind:"toast",id:`kept:${i}`,sentence:x,timeout:1e4,action:{label:"Take back",onSelect:()=>void b($)}}),c&&e({to:"picture",kind:c.kind,as:c.as,title:i,address:R(c.as,T(c,K)?k(t.schema,c.kind).slice(1):void 0),said:`Went to ${i}.`})},takeBack:b}}var q=A(I(),1);function _(e,t){switch(t.to){case"place":return{view:V("#")};case"picture":return{view:u(E(p(e,"filter",null),t.kind,t.as),[])};case"kind":{let n=D(g({...y(e,B(t.kind)),relation:null},!1),!0);return{view:u(p(p(n,"view",null),"filter",t.filter??null),[])}}case"record":return{view:u(y(g(p(p(e,"view",null),"filter",null),!1),t.id),[t.id])};case"problems":return{pane:"problems"}}}function z(e){let t=typeof document>"u"?null:document.querySelector('[data-testid="standing"]');t&&t.getAttribute("aria-expanded")==="true"!==e&&t.click()}function ae(){let{setView:e,seatTalk:t}=m();return(0,q.useCallback)(n=>{t.get().draft&&t.setDraft(null),z(n.to==="problems"),n.to!=="problems"&&e(o=>{let r=_(o,n);return"view"in r?r.view:o})},[e,t])}export{ie as a,z as b,ae as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{G as T}from"./chunk.
|
|
1
|
+
import{G as T}from"./chunk.HT2BEOEV.js";import{b as g}from"./chunk.AJZBJBMO.js";var s=g(T(),1),m="data-graview-roving",E="data-graview-roving-item",L={ArrowDown:{column:1,both:1},ArrowUp:{column:-1,both:-1},ArrowRight:{column:0,both:1},ArrowLeft:{column:0,both:-1}},w=e=>e instanceof HTMLElement&&(e.isContentEditable||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e instanceof HTMLInputElement&&!["button","checkbox","radio","submit"].includes(e.type));function p(e){return[...e.querySelectorAll(`[${E}]`)].filter(c=>c.closest(`[${m}]`)===e&&!c.disabled&&c.getAttribute("aria-hidden")!=="true")}var M=e=>(e.textContent?.trim()||e.getAttribute("aria-label")||"").toLowerCase();function H({flow:e="column",letters:c=!1}={}){let a=(0,s.useRef)(null),i=(0,s.useRef)(null),f=(0,s.useCallback)(()=>{let t=a.current;if(!t)return;let n=p(t);if(n.length===0)return;let o=typeof document>"u"?null:document.activeElement,u=n.find(r=>r===o)??(i.current&&n.includes(i.current)?i.current:n[0]);for(let r of n){let l=r===u?"0":"-1";r.getAttribute("tabindex")!==l&&r.setAttribute("tabindex",l)}},[]);(0,s.useLayoutEffect)(f);let d=t=>{t&&(i.current=t,t.focus(),f())};return{ref:a,[m]:c?"letters":"",onFocus:t=>{let n=t.target.closest?.(`[${E}]`);n&&n.closest(`[${m}]`)===a.current&&i.current!==n&&(i.current=n,f())},onKeyDown:t=>{let n=a.current;if(!n||t.metaKey||t.ctrlKey||t.altKey||w(t.target))return;let o=p(n),u=o.findIndex(l=>l===t.target||l.contains(t.target));if(u<0)return;let r=L[t.key]?.[e];if(r){t.preventDefault(),t.stopPropagation(),d(o[Math.max(0,Math.min(o.length-1,u+r))]);return}if(t.key==="Home"||t.key==="End"){t.preventDefault(),t.stopPropagation(),d(t.key==="Home"?o[0]:o[o.length-1]);return}if(c&&t.key.length===1&&t.key.trim()!==""){let l=t.key.toLowerCase(),y=[...o.slice(u+1),...o.slice(0,u+1)].find(b=>M(b).startsWith(l));if(!y)return;t.preventDefault(),t.stopPropagation(),d(y)}}}}export{E as a,H as b};
|