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,2 +1,2 @@
|
|
|
1
|
-
import{a as Ge}from"./chunk.7ML2BWSP.js";import{c as Me,d as Oe,f as Be}from"./chunk.5NZDFT6R.js";import{e as Pe,f as Ce,k as Re,l as re,n as Fe}from"./chunk.7INWDFNG.js";import{f as Se}from"./chunk.BZEJM2PY.js";import{d as _,e as je,k as ne}from"./chunk.LUIRQ5UF.js";import{b as De,e as Ae}from"./chunk.N33WUCAN.js";import{$b as te,Ad as $e,Bc as he,C as Q,Dc as ye,Fc as we,Jb as fe,K as de,Kd as ke,Nc as U,Oc as be,Sd as xe,ac as ge,ba as ue,da as Z,fa as H,ga as T,ha as me,ia as ee,ja as pe,jd as ve,ma as q,oa as z}from"./chunk.DIFR37EZ.js";function ze(r,e,t){let o=r.tryDefinition(e)?.fields.shape,n=Q(o?.[t]),a=!1,s=!1;for(;n&&(n.type==="optional"||n.type==="default"||n.type==="nullable"||n.type==="prefault");)(n.type==="optional"||n.type==="nullable")&&(a=!0),(n.type==="default"||n.type==="prefault")&&(s=!0),n=Q(n.innerType);if(n?.type!=="enum")return;let p=(n.entries?Object.values(n.entries):n.values??[]).filter(m=>typeof m=="string");return p.length>0?{values:p,empty:a&&!s}:void 0}function E(r,e,t){let o=ze(r,e,t);if(!o)return[];let n=r.tryDefinition(e),a=o.values.map(s=>({value:s,label:De(n,t,s)}));return o.empty&&a.push({value:null,label:`No ${q(n,t).toLowerCase()}`}),a}function X(r,e,t){let o=r[e];return typeof o=="string"&&t.some(n=>n.value===o)?o:null}function se(r,e,t,o,n=E(r.schema,t.kind,o)){return Ie(r,e,t,o,n).flatMap(a=>a.move?[a.move]:[])}function Ie(r,e,t,o,n=E(r.schema,t.kind,o)){let a=Ne(r.schema,r.allMutations(),t.kind,o,n),s=X(t,o,n),p=z(r.schema.tryDefinition(t.kind),t.kind),m=[];for(let{value:A,label:C,by:R,acts:F}of a){if(A===s)continue;let x,I,N;for(let c of F){let w=R==="step"?{[c.subject.arg]:t.id}:{[c.subject.arg]:t.id,[o]:A},S={name:c.name,args:w};if(!c.input.safeParse(w).success){N??=`${c.title??c.name} asks for more than the ${p} itself.`;continue}let k=r.permits(S,e);if(!k.ok){I??=k.refusal?.message??`You may not ${c.title??c.name}.`;continue}try{fe(r.graph,c,w)}catch(f){I??=f instanceof Error?f.message:String(f);continue}x={to:A,call:S,title:c.title??c.name};break}m.push(x?{to:A,label:C,move:x}:{to:A,label:C,why:I??N??`Nothing in this app moves a ${p} to ${C}.`})}return m}function Ne(r,e,t,o,n=E(r,t,o)){let a=Ve(r,e,t,o),s=Ke(r,e,t,o);return n.flatMap(p=>{if(p.value===null)return[];let m=a.filter(A=>A.sets?.[o]===p.value);return[{value:p.value,label:p.label,by:m.length>0?"step":s.length>0?"value":"none",acts:m.length>0?m:s}]})}function Ve(r,e,t,o){return e.filter(n=>n.subject!==void 0&&n.derived===void 0&&typeof n.sets?.[o]=="string"&&te(r,n).includes(t))}function Ke(r,e,t,o){let n=r.tryDefinition(t);return n?e.filter(a=>{if(!a.subject||!te(r,a).includes(t)||!ge(a,n).includes(o))return!1;let s=a.input.shape;return s!==void 0&&o in s}).sort((a,s)=>+(a.derived!==void 0)-+(s.derived!==void 0)):[]}var oe=(r,e)=>e&&r[e]!==void 0?String(r[e]):"";function Xe(r,e,t){let o=c=>r.tryDefinition(c)?e.nodesOfKind(c).filter(w=>H(r.tryDefinition(c),w)):[],n=o(t.rows),a=o(t.columns),s=new Set(n.map(c=>c.id)),p=new Set(a.map(c=>c.id)),m=e.allEdges(),A=[],C=t.link;if(typeof C=="string"){let c=f=>r.tryDefinition(f)?.edges?.[C]?.to,w=(c(t.columns)??[]).some(f=>f===t.rows||f==="*"),S=(c(t.rows)??[]).some(f=>f===t.columns||f==="*"),k=w||!S;for(let f of m){if(f.kind!==C)continue;let j=k?f.to:f.from,i=k?f.from:f.to;s.has(j)&&p.has(i)&&A.push({rowId:j,columnId:i,via:[]})}}else{let c=new Map(C.path.map(S=>[S,new Map]));for(let S of m){let k=c.get(S.kind);if(!k)continue;let f=k.get(S.from);f?f.push(S.to):k.set(S.from,[S.to]);let j=k.get(S.to);j?j.push(S.from):k.set(S.to,[S.from])}let w=new Set;for(let S of a){let k=[{id:S.id,via:[]}];for(let f of C.path){let j=[],i=new Set;for(let $ of k)for(let b of c.get(f).get($.id)??[])i.has(`${$.id}|${b}`)||(i.add(`${$.id}|${b}`),j.push({id:b,via:[...$.via,$.id]}));k=j}for(let f of k){let j=`${f.id}|${S.id}`;!s.has(f.id)||w.has(j)||(w.add(j),A.push({rowId:f.id,columnId:S.id,via:f.via.slice(1)}))}}}let R=t.groupOrder??[],F=c=>R.indexOf(c)===-1?R.length:R.indexOf(c),x=(c,w)=>w==="label"?T(r.tryDefinition(c.kind),c):c[w],I=U(n,t.sort,x).map(c=>{let w=c;return{node:c,label:T(r.tryDefinition(c.kind),c),group:oe(w,t.rowGroup),ref:oe(w,t.rowRef)}}).sort((c,w)=>F(c.group)-F(w.group)||(t.sort!==void 0?0:c.ref<w.ref?-1:c.ref>w.ref?1:0)),N=U(a,t.columnSort,x).map(c=>({node:c,label:T(r.tryDefinition(c.kind),c),group:oe(c,t.columnGroup)})).sort((c,w)=>c.group<w.group?-1:c.group>w.group?1:t.columnSort!==void 0?0:c.node.id<w.node.id?-1:c.node.id>w.node.id?1:0);return{rows:I,columns:N,cells:A}}function We(r,e,t){let{rows:o,columns:n,cells:a}=Xe(r,e,t),s=(i,$)=>ee(r,i,$),p=i=>ee(r,i,1).replace(/^1 /,""),m=i=>({id:i.id,kind:i.kind,title:T(r.tryDefinition(i.kind),i),parts:[]}),A=i=>{let $=e.getNode(i);if(!$)return null;let b=r.tryDefinition($.kind),P=T(b,$),V=_($,b,{limit:3,said:[P],glance:!0}).map(K=>K.alone.startsWith(K.label)?`${K.label.toLowerCase()}${K.alone.slice(K.label.length)}`:K.alone);return[P,...V].join(", ")},C=typeof t.link=="string"?[]:t.link.path.slice(0,-1).flatMap((i,$,b)=>{let P=ve(r,t.columns,b.slice(0,$+1));return P.ok?[...P.reached]:[]}),R=be(r,t,{rows:o.length,columns:n.length,cells:a.length});if(R)return[{t:"text",text:`${s(t.rows,o.length)} against ${s(t.columns,n.length)}.`},{t:"text",text:R}];let F=[{t:"text",text:`${s(t.rows,o.length)} against ${s(t.columns,n.length)}${C.length>0?`, through ${[...new Set(C)].map(i=>s(i,2).replace(/^2 /,"")).join(" and ")}`:""}${n.length>0?`: ${n.map(i=>i.label).join(", ")}`:""}.`}],x=new Map(n.map(i=>[i.node.id,i.label])),I=new Map(n.map((i,$)=>[i.node.id,$])),N=new Map,c=new Map;for(let i of a){let $=N.get(i.rowId);$?$.push(i):N.set(i.rowId,[i]);let b=c.get(i.columnId);b?b.add(i.rowId):c.set(i.columnId,new Set([i.rowId]))}for(let i of o){let b=[...N.get(i.node.id)??[]].sort((P,V)=>I.get(P.columnId)-I.get(V.columnId)).map(P=>{let V=P.via.map(A).filter(K=>K!==null);return`${x.get(P.columnId)}${V.length>0?` (${V.join("; ")})`:""}`});F.push({t:"field",label:i.label,text:b.length>0?b.join(", "):"none"})}F.push({t:"list",as:"name",columns:1,groups:n.map(i=>{let $=c.get(i.node.id)??new Set,b=o.filter(P=>$.has(P.node.id)).map(P=>m(P.node));return{heading:`${i.label} (${b.length})`,items:b}})});let w=new Set(a.map(i=>i.rowId)),S=new Set(a.map(i=>i.columnId)),k=o.filter(i=>!w.has(i.node.id)),f=n.filter(i=>!S.has(i.node.id)),j=t.rows===t.columns;return k.length>0&&F.push({t:"text",text:`${j?`${k.length} with none across`:`${s(t.rows,k.length)} with no ${p(t.columns)}`}: ${k.map(i=>i.label).join(", ")}.`}),f.length>0&&F.push({t:"text",text:`${j?`${f.length} with none down`:`${s(t.columns,f.length)} on no ${p(t.rows)}`}: ${f.map(i=>i.label).join(", ")}.`}),F}function ie(r,e,t,o={}){let{app:n,blocks:a=t?n?.viewSpecs?.[t.kind]?.[o.slot??"page"]:n?.home}=o;if(!a?.length)return[];let s=o.firstHeading??(t||o.blocks?void 0:1),p=Fe(r,e,t,{...o,money:o.money??n?.brand,firstHeading:s});return t&&!p.node?[]:Ce(typeof a[0]?.t=="string"?a:Pe(a),p)}function Y(r,e,t){let o=!(e.optional||e.control==="boolean"),n=e.control==="node"&&!e.kinds.includes("*")?e.kinds.map(s=>Z(z(r.tryDefinition(s),s))).join(" or "):t(e.name).label,a={name:e.name,label:n,required:o};switch(e.control){case"text":return{...a,input:e.holds==="duration"?"length of time":e.holds??(e.markdown?"Markdown text":e.long?"long text":e.app?"app address":"text")};case"date":return{...a,input:e.time||e.instant?"date and time":"date"};case"number":return{...a,input:e.amount?"amount":"number",...e.min===void 0?{}:{min:e.min},...e.max===void 0?{}:{max:e.max}};case"choice":return{...a,input:"choice",choices:(e.options??[]).map(s=>t(e.name).option(s))};case"boolean":return{...a,input:"yes or no"};case"node":return{...a,input:"record",kinds:e.kinds};case"linked":return{...a,input:"record in another app"};case"file":return{...a,input:e.image?"picture":e.video?"video":"file"};case"repeat":return{...a,input:"how it repeats"};case"list":return{...a,input:`list of ${Y(r,e.item,t).input}`};case"group":return{...a,input:"group",fields:e.fields.map(s=>Y(r,s,t))};case"variant":return{...a,input:"one of",choices:e.options.map(s=>Z(s.value))};default:return{...a,input:"answer"}}}function Te(r,e,t){let o=Oe(r,e,t),n=r.schema,a=Me(n,t).filter(p=>p.name!==t.subject?.arg&&!o.has(p.name)),s=me(t);return{act:t.name,title:s,submit:s,fields:a.map(p=>Y(n,p,m=>ne(n,t,m)))}}function He(r,e){return{act:e.act.name,title:e.title,submit:e.submit,visitor:e.name,fields:e.fields.map(t=>Y(r,t,o=>ne(r,e.act,o)))}}function Ee(r,e,t){return r.permittedMutations(e).filter(o=>!o.derived&&!o.subject&&(o.creates??[]).includes(t))}function Le(r,e=""){let t=[`${e}Form "${r.title}" (${r.visitor?`the visitor form ${r.visitor}, running `:""}act ${r.act}), button "${r.submit}":`],o=(n,a)=>{for(let s of n){let p=s.choices?`${s.input}: ${s.choices.join(", ")}`:s.kinds?`${s.input} (${s.kinds.join(" or ")})`:s.input,m=s.min!==void 0||s.max!==void 0?`, ${s.min??"\u2026"} to ${s.max??"\u2026"}`:"";t.push(`${a}- ${s.label}${s.required?" *":""} (${s.name}) \u2014 ${p}${m}`),s.fields&&o(s.fields,`${a} `)}};return o(r.fields,`${e} `),r.fields.length===0&&t.push(`${e} (asks nothing)`),t}function Ue(r,e){let t=r.viewSpecs??{};return e.filter(o=>o.cardinality==="one"&&o.replaces==="page"&&(t[o.attach]?.page?.length??0)>0).map(o=>{let n=L(r.schema,o.attach,1);return{at:`views.${o.attach}.page`,says:`The view "${o.name}" replaces ${Ye(n)}'s page, so its page slot is never drawn: leave out replaces to draw the slot under the view, or draw what the slot says in the view.`}})}var Ye=r=>`${/^[aeiou]/i.test(r)?"an":"a"} ${r}`,Je=240,Ze=10,Qe=1160,et=40,_e=640,tt=3,nt=r=>Math.max(1,Math.floor((Math.min(r,Qe)-et+Ze)/(Je+Ze)));function rt(r,e,t,o){let{app:n}=o,a=o.width??1440,s=o.today??r.today()??de(n.brand?.timeZone),p=r.seenBy(e),m=p.schema,A=p.graph,C=Ge(n,o.views?{views:o.views}:{}),R=typeof t=="string"?t.trim():t.slug,F=typeof t=="string"?C.find(l=>l.slug===R||l.title===R||l.address===R):C.find(l=>l.slug===t.slug&&l.kind===t.kind)??t,x=!F&&typeof t=="string"?A.getNode(R):void 0,I=!F&&!x?/^\/?forms\/(.+)$/.exec(R)?.[1]:void 0,N=I!==void 0?Be(n,I):void 0;if(N)return{ok:!0,description:st(m,N,a)};if(!F&&!x)return{ok:!1,error:`"${R}" is not a place this app has, nor a record this seat can see.`,places:[...C.map(l=>l.slug),...Object.keys(n.forms??{}).map(l=>`forms/${l}`)]};let c=[],w=n.viewSpecs??{},S=nt(a),k=(l,h)=>ie(p,null,l,{app:n,today:s,...h}),f=(l,h,M)=>{let d=m.tryDefinition(l.kind),g=T(d,l);if(h==="name")return{id:l.id,kind:l.kind,title:g,parts:[]};if(w[l.kind]?.[h]){let G=k(l,{slot:h}),[B,...O]=G,y=B?.t==="title"||h==="row"&&B?.t==="headline";return{id:l.id,kind:l.kind,title:y?B.text:g,parts:j(y?O:G,M,`views.${l.kind}.${h}`,` (${l.id})`,y?1:0)}}if(h==="row")return{id:l.id,kind:l.kind,title:g,parts:[]};let u=d?.computed?re(m,A,l):l,W=_(u,d,{limit:3,said:[g],glance:!0,locale:n.brand?.locale,timeZone:n.brand?.timeZone});return{id:l.id,kind:l.kind,title:g,parts:W.map(G=>({t:"text",text:G.alone}))}};function j(l,h,M,d="",g=0){let v=[];return l.forEach((u,W)=>{let G=`${M}.${W+g}`;switch("problem"in u&&u.problem&&c.push({at:`${G}${d}`,says:u.problem}),u.t){case"title":v.push({t:"heading",level:3,text:u.text});return;case"text":v.push({t:"text",text:u.markdown?Ae(u.text):u.runs?it(u.runs):u.text,...u.tone?{tone:u.tone}:{}});return;case"badge":v.push({t:"badge",text:u.text});return;case"field":case"image":v.push({t:"field",label:u.label,text:u.text});return;case"progress":v.push({t:"progress",label:u.label,text:u.text});return;case"group":v.push(...j(u.blocks,h,`${G}.group`,d));return;case"when":v.push(...j(u.blocks,h,`${G}.show`,d));return;case"divider":case"figure":return;case"headline":v.push({t:"heading",level:u.level,text:u.text});return;case"number":v.push({t:"figure",text:u.text,...u.label?{label:u.label}:{}});return;case"list":{if(u.failed){v.push({t:"text",text:"\u2014"});return}if(u.members.length===0){u.empty&&v.push({t:"list",as:u.as,columns:1,groups:[],empty:u.empty});return}let B=h+1,O=B>tt?"name":u.as,y=(u.groups??[{value:null,members:u.members}]).map(D=>({..."heading"in D&&D.heading?{heading:D.heading,count:(u.everyGroup?.find(J=>J.value===D.value)??D).members.length}:{},items:D.members.map(J=>f(J,O,B))}));v.push({t:"list",as:O,columns:O==="card"?S:1,groups:y,...u.more>0?{more:u.more}:{}});return}}}),v}let i=[],$,b,P,V=[];if(x){b="record";let l=m.tryDefinition(x.kind),h=T(l,x);P={slug:x.id,title:h,kind:x.kind,address:$e(m,x.kind,x.id)};let M=w[x.kind]?.page,d=o.views?.find(g=>g.attach===x.kind&&g.cardinality==="one");if(d&&i.push({t:"view",name:d.name,...d.title?{title:d.title}:{},...d.replaces==="page"?{replaces:!0}:{},...d.parts?{parts:d.parts}:{}}),d?.replaces==="page")b=`view:${d.name}`,c.push(...Ue(n,[d]));else{M&&i.push(...j(k(x,{slot:"page"}),1,`views.${x.kind}.page`));let g=l?.computed?re(m,A,x):x;for(let v of je(l,_(g,l,{said:[h],locale:n.brand?.locale,timeZone:n.brand?.timeZone}))){v.title&&i.push({t:"heading",level:2,text:v.title});for(let u of v.fields)i.push({t:"field",label:u.label,text:u.value,...u.long?{long:!0}:{},...u.markdown?{markdown:!0}:{}})}}}else{let l=F;P={slug:l.slug,title:l.title,kind:l.kind,address:l.address};let h=l.lens?ke(n).drawn.find(d=>d.as===l.slug&&(l.kind===null||d.kinds.includes(l.kind))):void 0,M=l.kind!==null&&l.view===void 0&&!h?o.views?.find(d=>d.attach===l.kind&&d.cardinality==="many"&&d.replaces==="page"&&!d.hidden):void 0;if(l.kind!==null&&h?.create!==!1&&l.view===void 0&&!M&&(V=Ee(r,e,l.kind).map(d=>Te(r,e,d))),l.view!==void 0&&!h){let d=o.views?.find(g=>g.name===l.view);b=`view:${l.view}`,i.push({t:"view",name:l.view,title:d?.title??l.title,...typeof d?.flows=="boolean"?{flows:d.flows}:{},...d?.parts?{parts:d.parts}:{}})}else if(l.kind===null){let d=n.brand,g=d?.name??n.name,v=we(d)?.light,u=v&&ye(v)?v:void 0;if($={name:g,...d?.subtitle&&d.subtitleDrawn!==!1?{subtitle:d.subtitle}:{},...u?{logo:{alt:d?.logoAlt??g,...he(u)?{drawn:"inline SVG"}:{drawn:"image",src:u}}}:{}},n.home)b="blocks",i=j(k(null,{}),0,"views.home");else{b="derived";let W=r.kindsKeptFrom(e),G=new Set([...n.pages?.hide??[],...W,...r.modules.disabledKinds]),B=xe(m.kinds,n.pages?.order).filter(O=>!G.has(O));i.push({t:"heading",level:1,text:n.name??"Home"});for(let O of B){let y=A.nodesOfKind(O).filter(D=>H(m.tryDefinition(O),D)).length;y>0&&i.push({t:"text",text:`${y} ${L(m,O,y)}`})}}}else if(h?.lens==="blocks")b="lens:blocks",i=j(k(null,{blocks:h.options.blocks??[]}),0,`lenses.${h.index}.options.blocks`);else if(h?.lens==="columns"){b="lens:columns";let d=h.options.bindings??{};for(let g of Object.keys(d)){let v=d[g]?.column;if(!v)continue;let u=E(m,g,v),W=U(A.nodesOfKind(g).filter(y=>H(m.tryDefinition(g),y)),h.options.sort,(y,D)=>D==="label"?T(m.tryDefinition(y.kind),y):y[D]);Object.keys(d).length>1&&i.push({t:"heading",level:2,text:L(m,g,2).replace(/^./,y=>y.toUpperCase())}),i.push({t:"text",text:`${W.length} ${L(m,g,W.length)} in columns by ${q(m.tryDefinition(g),v).toLowerCase()}.`});let G=u.map(y=>({column:y,items:W.filter(D=>X(D,v,u)===y.value).map(D=>f(D,"card",1))})).filter(({column:y,items:D})=>y.value!==null||D.length>0).map(({column:y,items:D})=>({heading:`${y.label} (${D.length})`,items:D}));i.push({t:"list",as:"card",columns:1,groups:G});let B=new Map;for(let y of W)for(let D of se(r,e,y,v,u))B.set(D.to,(B.get(D.to)??new Set).add(`"${D.title}"`));let O=u.filter(y=>y.value!==null&&B.has(y.value)).map(y=>`to ${y.label} by ${[...B.get(y.value)].join(" or ")}`);i.push({t:"text",text:O.length>0?`Moves: ${O.join("; ")}.`:"Moves: none for this seat."})}}else if(h?.lens==="coverage")b="lens:coverage",i=We(m,A,h.options);else if(h){b=`lens:${h.lens}`;let d=h.kinds.flatMap(g=>A.nodesOfKind(g).filter(v=>H(m.tryDefinition(g),v)));i.push({t:"text",text:`A ${h.lens} of ${d.length} ${h.kinds.map(g=>L(m,g,d.length)).join(" and ")}.`}),i.push({t:"list",as:"name",columns:1,groups:[{items:d.map(g=>f(g,"name",1))}]})}else if(M)b=`view:${M.name}`,i.push({t:"heading",level:1,text:l.title}),i.push({t:"view",name:M.name,...M.title?{title:M.title}:{},replaces:!0,...M.parts?{parts:M.parts}:{}});else{b="derived";let d=A.nodesOfKind(l.kind).filter(g=>H(m.tryDefinition(l.kind),g));i.push({t:"heading",level:1,text:l.title}),d.length===0?i.push({t:"list",as:"row",columns:1,groups:[],empty:`No ${L(m,l.kind,0)} yet.`}):i.push({t:"list",as:"row",columns:1,groups:[{items:d.map(g=>f(g,"row",1))}]})}}let K=e.kind==="system"?"the system":(e.roles??[]).length>0?(e.roles??[]).join(", "):e.kind,qe=a<_e?"phone":"wide",le=P.kind===null?ot(m,A):[],ce={...$?{masthead:$}:{},...le.length>0?{facts:le}:{},place:P,seat:K,width:a,variant:qe,drawnBy:b,parts:i,...V.length>0?{forms:V}:{},problems:c};return{ok:!0,description:{...ce,text:ae(ce)}}}function st(r,e,t){let o=[{t:"heading",level:1,text:e.title},...e.intro?[{t:"text",text:e.intro}]:[]],n={place:{slug:`forms/${e.name}`,title:e.title,kind:null,address:`/forms/${e.name}`},seat:`a visitor (${e.role})`,width:t,variant:t<_e?"phone":"wide",drawnBy:"form",parts:o,forms:[He(r,e)],problems:[]};return{...n,text:ae(n)}}function ot(r,e){let t=Re(r,e,null),o=n=>Array.isArray(n)?n.map(o).join(", "):n===null?"nothing":typeof n=="boolean"?n?"yes":"no":typeof n=="object"?n.label:String(n);return[...Se(r)].map(([n,a])=>{let s=a.label??Z(n);return Object.hasOwn(t.values,n)?{name:n,label:s,value:o(t.values[n])}:{name:n,label:s,refused:t.refused[n]??"it could not be worked out"}})}function L(r,e,t){let o=r.tryDefinition(e);if(t===1)return o?.noun??e;let n=pe(r,e);return ue(n)}function ae(r){let e=[`${r.place.title} (${r.place.address}) \u2014 as ${r.seat}, ${r.width} wide (${r.variant}).`],t=r.masthead;t&&e.push(`Masthead: ${t.logo?`the logo ("${t.logo.alt}", ${t.logo.drawn==="image"?t.logo.src:"inline SVG"}), `:""}${t.name}${t.subtitle?` \u2014 ${t.subtitle}`:""}`);let o=(n,a)=>{for(let s of n)switch(s.t){case"heading":e.push(`${a}${"#".repeat(s.level)} ${s.text}`);break;case"text":e.push(`${a}${s.text}`);break;case"badge":e.push(`${a}[${s.text}]`);break;case"field":case"progress":e.push(`${a}${s.label}: ${s.text}`);break;case"figure":e.push(`${a}${s.text}${s.label?` \u2014 ${s.label}`:""}`);break;case"list":if(s.groups.length===0){s.empty&&e.push(`${a}(${s.empty})`);break}for(let p of s.groups){p.heading&&e.push(`${a}${p.heading}${p.count!==void 0?` (${p.count})`:""}:`);for(let m of p.items)e.push(`${a}${p.heading?" ":""}- ${m.title}`),o(m.parts,`${a}${p.heading?" ":" "}`)}s.as==="card"&&s.columns>1&&e.push(`${a}(cards, ${s.columns} across)`),s.more&&e.push(`${a}and ${s.more} more`);break;case"view":e.push(`${a}[the view "${s.title??s.name}"${s.replaces?", in place of the page":""}${s.flows===!0?", flowing with the page":s.flows===!1?", in a frame of its own":""}]`),s.parts&&o(s.parts,`${a} `);break}};o(r.parts,"");for(let n of r.forms??[])e.push(...Le(n));if(r.facts){e.push("Facts of the whole graph (what fact('<name>') reads):");for(let n of r.facts)e.push(`- ${n.label} (${n.name}): ${n.value??`not worked out \u2014 ${n.refused}`}`)}if(r.problems.length>0){e.push("Problems:");for(let n of r.problems)e.push(`- ${n.at}: ${n.says}`)}return e.join(`
|
|
1
|
+
import{a as Ge}from"./chunk.EB4NVTJL.js";import{c as Me,d as Oe,f as Be}from"./chunk.BB33TI4S.js";import{e as Pe,f as Ce,k as Re,l as re,n as Fe}from"./chunk.LDAYDCUO.js";import{f as Se}from"./chunk.QGV7H7RQ.js";import{d as _,e as je,k as ne}from"./chunk.EQTSV7BK.js";import{b as De,e as Ae}from"./chunk.27CW6SCT.js";import{$b as te,Ad as $e,Bc as he,C as Q,Dc as ye,Fc as we,Jb as fe,K as de,Kd as ke,Nc as U,Oc as be,Sd as xe,ac as ge,ba as ue,da as Z,fa as H,ga as T,ha as me,ia as ee,ja as pe,jd as ve,ma as q,oa as z}from"./chunk.7BBGRTXM.js";function ze(r,e,t){let o=r.tryDefinition(e)?.fields.shape,n=Q(o?.[t]),a=!1,s=!1;for(;n&&(n.type==="optional"||n.type==="default"||n.type==="nullable"||n.type==="prefault");)(n.type==="optional"||n.type==="nullable")&&(a=!0),(n.type==="default"||n.type==="prefault")&&(s=!0),n=Q(n.innerType);if(n?.type!=="enum")return;let p=(n.entries?Object.values(n.entries):n.values??[]).filter(m=>typeof m=="string");return p.length>0?{values:p,empty:a&&!s}:void 0}function E(r,e,t){let o=ze(r,e,t);if(!o)return[];let n=r.tryDefinition(e),a=o.values.map(s=>({value:s,label:De(n,t,s)}));return o.empty&&a.push({value:null,label:`No ${q(n,t).toLowerCase()}`}),a}function X(r,e,t){let o=r[e];return typeof o=="string"&&t.some(n=>n.value===o)?o:null}function se(r,e,t,o,n=E(r.schema,t.kind,o)){return Ie(r,e,t,o,n).flatMap(a=>a.move?[a.move]:[])}function Ie(r,e,t,o,n=E(r.schema,t.kind,o)){let a=Ne(r.schema,r.allMutations(),t.kind,o,n),s=X(t,o,n),p=z(r.schema.tryDefinition(t.kind),t.kind),m=[];for(let{value:A,label:C,by:R,acts:F}of a){if(A===s)continue;let x,I,N;for(let c of F){let w=R==="step"?{[c.subject.arg]:t.id}:{[c.subject.arg]:t.id,[o]:A},S={name:c.name,args:w};if(!c.input.safeParse(w).success){N??=`${c.title??c.name} asks for more than the ${p} itself.`;continue}let k=r.permits(S,e);if(!k.ok){I??=k.refusal?.message??`You may not ${c.title??c.name}.`;continue}try{fe(r.graph,c,w)}catch(f){I??=f instanceof Error?f.message:String(f);continue}x={to:A,call:S,title:c.title??c.name};break}m.push(x?{to:A,label:C,move:x}:{to:A,label:C,why:I??N??`Nothing in this app moves a ${p} to ${C}.`})}return m}function Ne(r,e,t,o,n=E(r,t,o)){let a=Ve(r,e,t,o),s=Ke(r,e,t,o);return n.flatMap(p=>{if(p.value===null)return[];let m=a.filter(A=>A.sets?.[o]===p.value);return[{value:p.value,label:p.label,by:m.length>0?"step":s.length>0?"value":"none",acts:m.length>0?m:s}]})}function Ve(r,e,t,o){return e.filter(n=>n.subject!==void 0&&n.derived===void 0&&typeof n.sets?.[o]=="string"&&te(r,n).includes(t))}function Ke(r,e,t,o){let n=r.tryDefinition(t);return n?e.filter(a=>{if(!a.subject||!te(r,a).includes(t)||!ge(a,n).includes(o))return!1;let s=a.input.shape;return s!==void 0&&o in s}).sort((a,s)=>+(a.derived!==void 0)-+(s.derived!==void 0)):[]}var oe=(r,e)=>e&&r[e]!==void 0?String(r[e]):"";function Xe(r,e,t){let o=c=>r.tryDefinition(c)?e.nodesOfKind(c).filter(w=>H(r.tryDefinition(c),w)):[],n=o(t.rows),a=o(t.columns),s=new Set(n.map(c=>c.id)),p=new Set(a.map(c=>c.id)),m=e.allEdges(),A=[],C=t.link;if(typeof C=="string"){let c=f=>r.tryDefinition(f)?.edges?.[C]?.to,w=(c(t.columns)??[]).some(f=>f===t.rows||f==="*"),S=(c(t.rows)??[]).some(f=>f===t.columns||f==="*"),k=w||!S;for(let f of m){if(f.kind!==C)continue;let j=k?f.to:f.from,i=k?f.from:f.to;s.has(j)&&p.has(i)&&A.push({rowId:j,columnId:i,via:[]})}}else{let c=new Map(C.path.map(S=>[S,new Map]));for(let S of m){let k=c.get(S.kind);if(!k)continue;let f=k.get(S.from);f?f.push(S.to):k.set(S.from,[S.to]);let j=k.get(S.to);j?j.push(S.from):k.set(S.to,[S.from])}let w=new Set;for(let S of a){let k=[{id:S.id,via:[]}];for(let f of C.path){let j=[],i=new Set;for(let $ of k)for(let b of c.get(f).get($.id)??[])i.has(`${$.id}|${b}`)||(i.add(`${$.id}|${b}`),j.push({id:b,via:[...$.via,$.id]}));k=j}for(let f of k){let j=`${f.id}|${S.id}`;!s.has(f.id)||w.has(j)||(w.add(j),A.push({rowId:f.id,columnId:S.id,via:f.via.slice(1)}))}}}let R=t.groupOrder??[],F=c=>R.indexOf(c)===-1?R.length:R.indexOf(c),x=(c,w)=>w==="label"?T(r.tryDefinition(c.kind),c):c[w],I=U(n,t.sort,x).map(c=>{let w=c;return{node:c,label:T(r.tryDefinition(c.kind),c),group:oe(w,t.rowGroup),ref:oe(w,t.rowRef)}}).sort((c,w)=>F(c.group)-F(w.group)||(t.sort!==void 0?0:c.ref<w.ref?-1:c.ref>w.ref?1:0)),N=U(a,t.columnSort,x).map(c=>({node:c,label:T(r.tryDefinition(c.kind),c),group:oe(c,t.columnGroup)})).sort((c,w)=>c.group<w.group?-1:c.group>w.group?1:t.columnSort!==void 0?0:c.node.id<w.node.id?-1:c.node.id>w.node.id?1:0);return{rows:I,columns:N,cells:A}}function We(r,e,t){let{rows:o,columns:n,cells:a}=Xe(r,e,t),s=(i,$)=>ee(r,i,$),p=i=>ee(r,i,1).replace(/^1 /,""),m=i=>({id:i.id,kind:i.kind,title:T(r.tryDefinition(i.kind),i),parts:[]}),A=i=>{let $=e.getNode(i);if(!$)return null;let b=r.tryDefinition($.kind),P=T(b,$),V=_($,b,{limit:3,said:[P],glance:!0}).map(K=>K.alone.startsWith(K.label)?`${K.label.toLowerCase()}${K.alone.slice(K.label.length)}`:K.alone);return[P,...V].join(", ")},C=typeof t.link=="string"?[]:t.link.path.slice(0,-1).flatMap((i,$,b)=>{let P=ve(r,t.columns,b.slice(0,$+1));return P.ok?[...P.reached]:[]}),R=be(r,t,{rows:o.length,columns:n.length,cells:a.length});if(R)return[{t:"text",text:`${s(t.rows,o.length)} against ${s(t.columns,n.length)}.`},{t:"text",text:R}];let F=[{t:"text",text:`${s(t.rows,o.length)} against ${s(t.columns,n.length)}${C.length>0?`, through ${[...new Set(C)].map(i=>s(i,2).replace(/^2 /,"")).join(" and ")}`:""}${n.length>0?`: ${n.map(i=>i.label).join(", ")}`:""}.`}],x=new Map(n.map(i=>[i.node.id,i.label])),I=new Map(n.map((i,$)=>[i.node.id,$])),N=new Map,c=new Map;for(let i of a){let $=N.get(i.rowId);$?$.push(i):N.set(i.rowId,[i]);let b=c.get(i.columnId);b?b.add(i.rowId):c.set(i.columnId,new Set([i.rowId]))}for(let i of o){let b=[...N.get(i.node.id)??[]].sort((P,V)=>I.get(P.columnId)-I.get(V.columnId)).map(P=>{let V=P.via.map(A).filter(K=>K!==null);return`${x.get(P.columnId)}${V.length>0?` (${V.join("; ")})`:""}`});F.push({t:"field",label:i.label,text:b.length>0?b.join(", "):"none"})}F.push({t:"list",as:"name",columns:1,groups:n.map(i=>{let $=c.get(i.node.id)??new Set,b=o.filter(P=>$.has(P.node.id)).map(P=>m(P.node));return{heading:`${i.label} (${b.length})`,items:b}})});let w=new Set(a.map(i=>i.rowId)),S=new Set(a.map(i=>i.columnId)),k=o.filter(i=>!w.has(i.node.id)),f=n.filter(i=>!S.has(i.node.id)),j=t.rows===t.columns;return k.length>0&&F.push({t:"text",text:`${j?`${k.length} with none across`:`${s(t.rows,k.length)} with no ${p(t.columns)}`}: ${k.map(i=>i.label).join(", ")}.`}),f.length>0&&F.push({t:"text",text:`${j?`${f.length} with none down`:`${s(t.columns,f.length)} on no ${p(t.rows)}`}: ${f.map(i=>i.label).join(", ")}.`}),F}function ie(r,e,t,o={}){let{app:n,blocks:a=t?n?.viewSpecs?.[t.kind]?.[o.slot??"page"]:n?.home}=o;if(!a?.length)return[];let s=o.firstHeading??(t||o.blocks?void 0:1),p=Fe(r,e,t,{...o,money:o.money??n?.brand,firstHeading:s});return t&&!p.node?[]:Ce(typeof a[0]?.t=="string"?a:Pe(a),p)}function Y(r,e,t){let o=!(e.optional||e.control==="boolean"),n=e.control==="node"&&!e.kinds.includes("*")?e.kinds.map(s=>Z(z(r.tryDefinition(s),s))).join(" or "):t(e.name).label,a={name:e.name,label:n,required:o};switch(e.control){case"text":return{...a,input:e.holds==="duration"?"length of time":e.holds??(e.markdown?"Markdown text":e.long?"long text":e.app?"app address":"text")};case"date":return{...a,input:e.time||e.instant?"date and time":"date"};case"number":return{...a,input:e.amount?"amount":"number",...e.min===void 0?{}:{min:e.min},...e.max===void 0?{}:{max:e.max}};case"choice":return{...a,input:"choice",choices:(e.options??[]).map(s=>t(e.name).option(s))};case"boolean":return{...a,input:"yes or no"};case"node":return{...a,input:"record",kinds:e.kinds};case"linked":return{...a,input:"record in another app"};case"file":return{...a,input:e.image?"picture":e.video?"video":"file"};case"repeat":return{...a,input:"how it repeats"};case"list":return{...a,input:`list of ${Y(r,e.item,t).input}`};case"group":return{...a,input:"group",fields:e.fields.map(s=>Y(r,s,t))};case"variant":return{...a,input:"one of",choices:e.options.map(s=>Z(s.value))};default:return{...a,input:"answer"}}}function Te(r,e,t){let o=Oe(r,e,t),n=r.schema,a=Me(n,t).filter(p=>p.name!==t.subject?.arg&&!o.has(p.name)),s=me(t);return{act:t.name,title:s,submit:s,fields:a.map(p=>Y(n,p,m=>ne(n,t,m)))}}function He(r,e){return{act:e.act.name,title:e.title,submit:e.submit,visitor:e.name,fields:e.fields.map(t=>Y(r,t,o=>ne(r,e.act,o)))}}function Ee(r,e,t){return r.permittedMutations(e).filter(o=>!o.derived&&!o.subject&&(o.creates??[]).includes(t))}function Le(r,e=""){let t=[`${e}Form "${r.title}" (${r.visitor?`the visitor form ${r.visitor}, running `:""}act ${r.act}), button "${r.submit}":`],o=(n,a)=>{for(let s of n){let p=s.choices?`${s.input}: ${s.choices.join(", ")}`:s.kinds?`${s.input} (${s.kinds.join(" or ")})`:s.input,m=s.min!==void 0||s.max!==void 0?`, ${s.min??"\u2026"} to ${s.max??"\u2026"}`:"";t.push(`${a}- ${s.label}${s.required?" *":""} (${s.name}) \u2014 ${p}${m}`),s.fields&&o(s.fields,`${a} `)}};return o(r.fields,`${e} `),r.fields.length===0&&t.push(`${e} (asks nothing)`),t}function Ue(r,e){let t=r.viewSpecs??{};return e.filter(o=>o.cardinality==="one"&&o.replaces==="page"&&(t[o.attach]?.page?.length??0)>0).map(o=>{let n=L(r.schema,o.attach,1);return{at:`views.${o.attach}.page`,says:`The view "${o.name}" replaces ${Ye(n)}'s page, so its page slot is never drawn: leave out replaces to draw the slot under the view, or draw what the slot says in the view.`}})}var Ye=r=>`${/^[aeiou]/i.test(r)?"an":"a"} ${r}`,Je=240,Ze=10,Qe=1160,et=40,_e=640,tt=3,nt=r=>Math.max(1,Math.floor((Math.min(r,Qe)-et+Ze)/(Je+Ze)));function rt(r,e,t,o){let{app:n}=o,a=o.width??1440,s=o.today??r.today()??de(n.brand?.timeZone),p=r.seenBy(e),m=p.schema,A=p.graph,C=Ge(n,o.views?{views:o.views}:{}),R=typeof t=="string"?t.trim():t.slug,F=typeof t=="string"?C.find(l=>l.slug===R||l.title===R||l.address===R):C.find(l=>l.slug===t.slug&&l.kind===t.kind)??t,x=!F&&typeof t=="string"?A.getNode(R):void 0,I=!F&&!x?/^\/?forms\/(.+)$/.exec(R)?.[1]:void 0,N=I!==void 0?Be(n,I):void 0;if(N)return{ok:!0,description:st(m,N,a)};if(!F&&!x)return{ok:!1,error:`"${R}" is not a place this app has, nor a record this seat can see.`,places:[...C.map(l=>l.slug),...Object.keys(n.forms??{}).map(l=>`forms/${l}`)]};let c=[],w=n.viewSpecs??{},S=nt(a),k=(l,h)=>ie(p,null,l,{app:n,today:s,...h}),f=(l,h,M)=>{let d=m.tryDefinition(l.kind),g=T(d,l);if(h==="name")return{id:l.id,kind:l.kind,title:g,parts:[]};if(w[l.kind]?.[h]){let G=k(l,{slot:h}),[B,...O]=G,y=B?.t==="title"||h==="row"&&B?.t==="headline";return{id:l.id,kind:l.kind,title:y?B.text:g,parts:j(y?O:G,M,`views.${l.kind}.${h}`,` (${l.id})`,y?1:0)}}if(h==="row")return{id:l.id,kind:l.kind,title:g,parts:[]};let u=d?.computed?re(m,A,l):l,W=_(u,d,{limit:3,said:[g],glance:!0,locale:n.brand?.locale,timeZone:n.brand?.timeZone});return{id:l.id,kind:l.kind,title:g,parts:W.map(G=>({t:"text",text:G.alone}))}};function j(l,h,M,d="",g=0){let v=[];return l.forEach((u,W)=>{let G=`${M}.${W+g}`;switch("problem"in u&&u.problem&&c.push({at:`${G}${d}`,says:u.problem}),u.t){case"title":v.push({t:"heading",level:3,text:u.text});return;case"text":v.push({t:"text",text:u.markdown?Ae(u.text):u.runs?it(u.runs):u.text,...u.tone?{tone:u.tone}:{}});return;case"badge":v.push({t:"badge",text:u.text});return;case"field":case"image":v.push({t:"field",label:u.label,text:u.text});return;case"progress":v.push({t:"progress",label:u.label,text:u.text});return;case"group":v.push(...j(u.blocks,h,`${G}.group`,d));return;case"when":v.push(...j(u.blocks,h,`${G}.show`,d));return;case"divider":case"figure":return;case"headline":v.push({t:"heading",level:u.level,text:u.text});return;case"number":v.push({t:"figure",text:u.text,...u.label?{label:u.label}:{}});return;case"list":{if(u.failed){v.push({t:"text",text:"\u2014"});return}if(u.members.length===0){u.empty&&v.push({t:"list",as:u.as,columns:1,groups:[],empty:u.empty});return}let B=h+1,O=B>tt?"name":u.as,y=(u.groups??[{value:null,members:u.members}]).map(D=>({..."heading"in D&&D.heading?{heading:D.heading,count:(u.everyGroup?.find(J=>J.value===D.value)??D).members.length}:{},items:D.members.map(J=>f(J,O,B))}));v.push({t:"list",as:O,columns:O==="card"?S:1,groups:y,...u.more>0?{more:u.more}:{}});return}}}),v}let i=[],$,b,P,V=[];if(x){b="record";let l=m.tryDefinition(x.kind),h=T(l,x);P={slug:x.id,title:h,kind:x.kind,address:$e(m,x.kind,x.id)};let M=w[x.kind]?.page,d=o.views?.find(g=>g.attach===x.kind&&g.cardinality==="one");if(d&&i.push({t:"view",name:d.name,...d.title?{title:d.title}:{},...d.replaces==="page"?{replaces:!0}:{},...d.parts?{parts:d.parts}:{}}),d?.replaces==="page")b=`view:${d.name}`,c.push(...Ue(n,[d]));else{M&&i.push(...j(k(x,{slot:"page"}),1,`views.${x.kind}.page`));let g=l?.computed?re(m,A,x):x;for(let v of je(l,_(g,l,{said:[h],locale:n.brand?.locale,timeZone:n.brand?.timeZone}))){v.title&&i.push({t:"heading",level:2,text:v.title});for(let u of v.fields)i.push({t:"field",label:u.label,text:u.value,...u.long?{long:!0}:{},...u.markdown?{markdown:!0}:{}})}}}else{let l=F;P={slug:l.slug,title:l.title,kind:l.kind,address:l.address};let h=l.lens?ke(n).drawn.find(d=>d.as===l.slug&&(l.kind===null||d.kinds.includes(l.kind))):void 0,M=l.kind!==null&&l.view===void 0&&!h?o.views?.find(d=>d.attach===l.kind&&d.cardinality==="many"&&d.replaces==="page"&&!d.hidden):void 0;if(l.kind!==null&&h?.create!==!1&&l.view===void 0&&!M&&(V=Ee(r,e,l.kind).map(d=>Te(r,e,d))),l.view!==void 0&&!h){let d=o.views?.find(g=>g.name===l.view);b=`view:${l.view}`,i.push({t:"view",name:l.view,title:d?.title??l.title,...typeof d?.flows=="boolean"?{flows:d.flows}:{},...d?.parts?{parts:d.parts}:{}})}else if(l.kind===null){let d=n.brand,g=d?.name??n.name,v=we(d)?.light,u=v&&ye(v)?v:void 0;if($={name:g,...d?.subtitle&&d.subtitleDrawn!==!1?{subtitle:d.subtitle}:{},...u?{logo:{alt:d?.logoAlt??g,...he(u)?{drawn:"inline SVG"}:{drawn:"image",src:u}}}:{}},n.home)b="blocks",i=j(k(null,{}),0,"views.home");else{b="derived";let W=r.kindsKeptFrom(e),G=new Set([...n.pages?.hide??[],...W,...r.modules.disabledKinds]),B=xe(m.kinds,n.pages?.order).filter(O=>!G.has(O));i.push({t:"heading",level:1,text:n.name??"Home"});for(let O of B){let y=A.nodesOfKind(O).filter(D=>H(m.tryDefinition(O),D)).length;y>0&&i.push({t:"text",text:`${y} ${L(m,O,y)}`})}}}else if(h?.lens==="blocks")b="lens:blocks",i=j(k(null,{blocks:h.options.blocks??[]}),0,`lenses.${h.index}.options.blocks`);else if(h?.lens==="columns"){b="lens:columns";let d=h.options.bindings??{};for(let g of Object.keys(d)){let v=d[g]?.column;if(!v)continue;let u=E(m,g,v),W=U(A.nodesOfKind(g).filter(y=>H(m.tryDefinition(g),y)),h.options.sort,(y,D)=>D==="label"?T(m.tryDefinition(y.kind),y):y[D]);Object.keys(d).length>1&&i.push({t:"heading",level:2,text:L(m,g,2).replace(/^./,y=>y.toUpperCase())}),i.push({t:"text",text:`${W.length} ${L(m,g,W.length)} in columns by ${q(m.tryDefinition(g),v).toLowerCase()}.`});let G=u.map(y=>({column:y,items:W.filter(D=>X(D,v,u)===y.value).map(D=>f(D,"card",1))})).filter(({column:y,items:D})=>y.value!==null||D.length>0).map(({column:y,items:D})=>({heading:`${y.label} (${D.length})`,items:D}));i.push({t:"list",as:"card",columns:1,groups:G});let B=new Map;for(let y of W)for(let D of se(r,e,y,v,u))B.set(D.to,(B.get(D.to)??new Set).add(`"${D.title}"`));let O=u.filter(y=>y.value!==null&&B.has(y.value)).map(y=>`to ${y.label} by ${[...B.get(y.value)].join(" or ")}`);i.push({t:"text",text:O.length>0?`Moves: ${O.join("; ")}.`:"Moves: none for this seat."})}}else if(h?.lens==="coverage")b="lens:coverage",i=We(m,A,h.options);else if(h){b=`lens:${h.lens}`;let d=h.kinds.flatMap(g=>A.nodesOfKind(g).filter(v=>H(m.tryDefinition(g),v)));i.push({t:"text",text:`A ${h.lens} of ${d.length} ${h.kinds.map(g=>L(m,g,d.length)).join(" and ")}.`}),i.push({t:"list",as:"name",columns:1,groups:[{items:d.map(g=>f(g,"name",1))}]})}else if(M)b=`view:${M.name}`,i.push({t:"heading",level:1,text:l.title}),i.push({t:"view",name:M.name,...M.title?{title:M.title}:{},replaces:!0,...M.parts?{parts:M.parts}:{}});else{b="derived";let d=A.nodesOfKind(l.kind).filter(g=>H(m.tryDefinition(l.kind),g));i.push({t:"heading",level:1,text:l.title}),d.length===0?i.push({t:"list",as:"row",columns:1,groups:[],empty:`No ${L(m,l.kind,0)} yet.`}):i.push({t:"list",as:"row",columns:1,groups:[{items:d.map(g=>f(g,"row",1))}]})}}let K=e.kind==="system"?"the system":(e.roles??[]).length>0?(e.roles??[]).join(", "):e.kind,qe=a<_e?"phone":"wide",le=P.kind===null?ot(m,A):[],ce={...$?{masthead:$}:{},...le.length>0?{facts:le}:{},place:P,seat:K,width:a,variant:qe,drawnBy:b,parts:i,...V.length>0?{forms:V}:{},problems:c};return{ok:!0,description:{...ce,text:ae(ce)}}}function st(r,e,t){let o=[{t:"heading",level:1,text:e.title},...e.intro?[{t:"text",text:e.intro}]:[]],n={place:{slug:`forms/${e.name}`,title:e.title,kind:null,address:`/forms/${e.name}`},seat:`a visitor (${e.role})`,width:t,variant:t<_e?"phone":"wide",drawnBy:"form",parts:o,forms:[He(r,e)],problems:[]};return{...n,text:ae(n)}}function ot(r,e){let t=Re(r,e,null),o=n=>Array.isArray(n)?n.map(o).join(", "):n===null?"nothing":typeof n=="boolean"?n?"yes":"no":typeof n=="object"?n.label:String(n);return[...Se(r)].map(([n,a])=>{let s=a.label??Z(n);return Object.hasOwn(t.values,n)?{name:n,label:s,value:o(t.values[n])}:{name:n,label:s,refused:t.refused[n]??"it could not be worked out"}})}function L(r,e,t){let o=r.tryDefinition(e);if(t===1)return o?.noun??e;let n=pe(r,e);return ue(n)}function ae(r){let e=[`${r.place.title} (${r.place.address}) \u2014 as ${r.seat}, ${r.width} wide (${r.variant}).`],t=r.masthead;t&&e.push(`Masthead: ${t.logo?`the logo ("${t.logo.alt}", ${t.logo.drawn==="image"?t.logo.src:"inline SVG"}), `:""}${t.name}${t.subtitle?` \u2014 ${t.subtitle}`:""}`);let o=(n,a)=>{for(let s of n)switch(s.t){case"heading":e.push(`${a}${"#".repeat(s.level)} ${s.text}`);break;case"text":e.push(`${a}${s.text}`);break;case"badge":e.push(`${a}[${s.text}]`);break;case"field":case"progress":e.push(`${a}${s.label}: ${s.text}`);break;case"figure":e.push(`${a}${s.text}${s.label?` \u2014 ${s.label}`:""}`);break;case"list":if(s.groups.length===0){s.empty&&e.push(`${a}(${s.empty})`);break}for(let p of s.groups){p.heading&&e.push(`${a}${p.heading}${p.count!==void 0?` (${p.count})`:""}:`);for(let m of p.items)e.push(`${a}${p.heading?" ":""}- ${m.title}`),o(m.parts,`${a}${p.heading?" ":" "}`)}s.as==="card"&&s.columns>1&&e.push(`${a}(cards, ${s.columns} across)`),s.more&&e.push(`${a}and ${s.more} more`);break;case"view":e.push(`${a}[the view "${s.title??s.name}"${s.replaces?", in place of the page":""}${s.flows===!0?", flowing with the page":s.flows===!1?", in a frame of its own":""}]`),s.parts&&o(s.parts,`${a} `);break}};o(r.parts,"");for(let n of r.forms??[])e.push(...Le(n));if(r.facts){e.push("Facts of the whole graph (what fact('<name>') reads):");for(let n of r.facts)e.push(`- ${n.label} (${n.name}): ${n.value??`not worked out \u2014 ${n.refused}`}`)}if(r.problems.length>0){e.push("Problems:");for(let n of r.problems)e.push(`- ${n.at}: ${n.says}`)}return e.join(`
|
|
2
2
|
`)}function it(r){return r.map((e,t)=>(t===0?"":e.field===void 0&&r[t-1].field===void 0?" \xB7 ":" ")+e.text).join("")}export{E as a,X as b,se as c,Ie as d,Ne as e,Ve as f,Ke as g,ie as h,Ue as i,rt as j,ae as k};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{b as te}from"./chunk.
|
|
1
|
+
import{b as te}from"./chunk.HXRV3WVJ.js";import"./chunk.3YZHZGTM.js";import"./chunk.EQTSV7BK.js";import{c as ne}from"./chunk.27CW6SCT.js";import{G as ge,T as ee}from"./chunk.HT2BEOEV.js";import"./chunk.SDO3U72B.js";import{Tc as q,ga as X,ia as Z}from"./chunk.7BBGRTXM.js";import"./chunk.FQLNBIQ5.js";import{b as T}from"./chunk.AJZBJBMO.js";var M=T(ge(),1);var ye=6;function re($,S,m,x,E){let t=new Set($),o=new Map;for(let i of S)for(let[h,l,b]of[[i.from,i.to,"out"],[i.to,i.from,"in"]]){if(!t.has(h)||t.has(l))continue;let f=m(l);if(f===void 0)continue;let p=`${h}|${i.kind}|${b}|${f}`,v=o.get(p);v?v.others.includes(l)||v.others.push(l):o.set(p,{self:h,edge:i.kind,direction:b,kind:f,others:[l]})}let d=[];for(let i of o.values()){let h=m(i.self)??"",l=ne(E,i.direction==="out"?h:i.kind,i.edge,i.direction);if(i.others.length>ye){d.push({...i,others:i.others,lands:"district",words:l});continue}let b=[],f=[];for(let p of i.others)(x(p)?b:f).push(p);for(let p of b)d.push({...i,others:[p],lands:"record",words:l});f.length>0&&d.push({...i,others:f,lands:"district",words:l})}return d}function ie($,S=[]){let m=[...S],x=new Map,E=t=>m.some(o=>t.x<o.x+o.width&&o.x<t.x+t.width&&t.y<o.y+o.height&&o.y<t.y+t.height);for(let t of[...$].sort((o,d)=>o.y-d.y||o.x-d.x)){let o={x:t.x-t.width/2,y:t.y-t.height,width:t.width,height:t.height};for(let d=0;d<12&&E(o);d++)o.y+=t.height+2;m.push(o),x.set(t.key,{x:o.x,y:o.y})}return x}var s=T(ee(),1),he=4;function xe({frame:$,width:S,height:m,stageRef:x,tick:E,store:t,graphVersion:o,selection:d,view:i,rulers:{visibleRect:h,clipQuadratic:l,unsureOf:b,unsureDash:f,unsureOpacity:p}}){let v=n=>t.graph.getNode(n)?.kind,C=te(d,i,v),R=C.lens===null&&C.records.length<=he?C.records:[],oe=R.join(`
|
|
2
2
|
`),[y,K]=(0,M.useState)(null);(0,M.useLayoutEffect)(()=>{let n=x.current;if(!i.overview||R.length===0||!n||typeof document>"u"||$.t<1){K(null);return}let w=n.getBoundingClientRect(),B=e=>({x:e.left-w.left,y:e.top-w.top,width:e.width,height:e.height}),D=new Map,se=R.map(e=>`[data-graview-view="${CSS.escape(e)}"]`).join(","),k=null,H=()=>{if(k)return k;k={drawn:new Map,buildings:new Map};for(let e of n.querySelectorAll("[data-graview-pick], [data-graview-view], [data-graview-building]")){let r=e.getAttribute("data-graview-pick"),a=e.getAttribute("data-graview-view");for(let c of r!==null&&r===a?[r]:[r,a]){if(c===null)continue;let u=k.drawn.get(c);u?u.push(e):k.drawn.set(c,[e])}let L=e.getAttribute("data-graview-building");L!==null&&!k.buildings.has(L)&&k.buildings.set(L,e)}return k},P=e=>{if(D.has(e))return D.get(e);let r=null;for(let a of H().drawn.get(e)??[])if(!a.closest("[data-graview-offstage], [data-graview-screen]")&&!(!R.includes(e)&&a.closest(se))&&(r=h(a,n),r))break;if(!r){let a=H().buildings.get(e);a&&(r=B(a.getBoundingClientRect()))}return D.set(e,r),r},W=e=>{let r=n.querySelector(`[data-graview-plot="kind:${CSS.escape(e)}"] .graview-plot-tile`);return r?B(r.getBoundingClientRect()):null},de=re(R,t.graph.allEdges(),v,e=>P(e)!==null,t.schema),z=[];for(let e of n.querySelectorAll('[data-graview-view^="kind:"] .graview-kind-face')){let r=h(e,n);r&&z.push(r)}let Q=e=>({x:e.x+e.width/2,y:e.y+e.height/2}),O=[],V=new Set(R),I=new Set;for(let e of de){let r=v(e.self),a=P(e.self)??(r?W(r):null),L=e.lands==="record"?P(e.others[0]):W(e.kind);if(!a||!L)continue;for(let g of e.others)V.add(g);I.add(e.kind),r&&I.add(r);let c=Q(a),u=Q(L),A=Math.hypot(u.x-c.x,u.y-c.y);if(A<6)continue;let G=Math.min(40,A*.12)*(O.length%2===0?1:-1),le={x:(c.x+u.x)/2-(u.y-c.y)/A*G,y:(c.y+u.y)/2+(u.x-c.x)/A*G},J=l({p0:c,c:le,p1:u},z);if(J.length===0)continue;let ce=J.map(g=>`M ${g.p0.x.toFixed(1)} ${g.p0.y.toFixed(1)} Q ${g.c.x.toFixed(1)} ${g.c.y.toFixed(1)} ${g.p1.x.toFixed(1)} ${g.p1.y.toFixed(1)}`).join(" "),ue=g=>{let j=t.graph.getNode(g);return j?X(t.schema.tryDefinition(j.kind),j):g},U=e.lands==="record"?`${e.words}: ${ue(e.others[0])}`:`${e.words}: ${Z(t.schema,e.kind,e.others.length)}`,F=e.others[0],_=e.lands==="record"?b?.(e.edge,e.direction==="out"?e.self:F,e.direction==="out"?F:e.self):void 0;O.push({key:`${e.self}|${e.edge}|${e.direction}|${e.lands}|${F}`,link:e,d:ce,end:u,said:_!==void 0?`${U} \xB7 unsure`:U,..._!==void 0?{unsure:_}:{}})}let Y=[];for(let e of n.querySelectorAll(".graview-kind-face[data-graview-nameplate]")){let r=h(e,n);r&&Y.push(r)}let ae=ie(O.map(e=>({key:e.key,x:e.end.x,y:e.end.y-6,width:Math.min(260,14+e.said.length*6.6),height:20})),Y);K({lines:O,labels:ae,reached:[...V],districts:[...I]})},[oe,i.overview,$,o,E,S,m,x,t]);let N=(0,M.useMemo)(()=>{if(!y)return"";let n=y.reached.map(B=>`[data-graview-building="${CSS.escape(B)}"]`).join(","),w=y.districts.map(B=>`[data-graview-plot="kind:${CSS.escape(B)}"]`).join(",");return[".graview-ground[data-graview-altitude] .graview-building { opacity: 0.22; }",n?`.graview-ground[data-graview-altitude] .graview-building:is(${n}) { opacity: 1; }`:"",w?`.graview-ground[data-graview-altitude] .graview-plot:not(:is(${w})) .graview-plot-tile { opacity: 0.4; }`:""].join(`
|
|
3
3
|
`)},[y]);return!y||y.lines.length===0?N?(0,s.jsx)("style",{children:N}):null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{children:N}),(0,s.jsx)("svg",{className:"graview-record-links","data-graview-world":"","data-graview-record-links":y.lines.length,"aria-hidden":"true",width:S,height:m,style:{position:"absolute",left:0,top:0,pointerEvents:"none",zIndex:q.lines},children:y.lines.map(n=>(0,s.jsxs)("g",{className:"graview-record-link","data-graview-link":n.link.edge,"data-graview-lands":n.link.lands,"data-graview-direction":n.link.direction,"data-graview-provisional":n.unsure!==void 0||void 0,children:[(0,s.jsx)("path",{className:"graview-record-link-line",d:n.d,...n.unsure!==void 0?{strokeDasharray:f,strokeOpacity:p}:{}}),n.link.lands==="record"?(0,s.jsx)("circle",{className:"graview-record-link-end",cx:n.end.x,cy:n.end.y,r:3}):null]},n.key))}),(0,s.jsx)("div",{"aria-hidden":"true","data-graview-world":"",style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:q.tieLabels},children:y.lines.map(n=>{let w=y.labels.get(n.key);return w?(0,s.jsx)("span",{className:"graview-record-link-said","data-graview-link-said":n.link.edge,"data-graview-lands":n.link.lands,...n.unsure!==void 0?{title:n.unsure}:{},style:{position:"absolute",left:w.x,top:w.y,...n.unsure!==void 0?{pointerEvents:"auto"}:{}},children:n.said},n.key):null})})]})}export{xe as RecordLinks};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{G as C,Ra as H,T as F,Ta as A}from"./chunk.
|
|
1
|
+
import{G as C,Ra as H,T as F,Ta as A}from"./chunk.HT2BEOEV.js";import"./chunk.SDO3U72B.js";import"./chunk.7BBGRTXM.js";import"./chunk.FQLNBIQ5.js";import{b as x}from"./chunk.AJZBJBMO.js";var t=x(C(),1),f=x(F(),1),q={faces:'[data-testid="app-faces"]',problems:'[data-testid="standing"], [data-testid="standing-link"]',activity:'[data-testid="activity-button"]',ask:'[data-testid="app-find"], [data-testid="app-find-open"]',find:'[data-testid="app-find"], [data-testid="app-find-open"]',profile:'[data-testid="profile-button"]',home:'[data-testid="app-home"]'};function D(e){if(!e.isConnected||e.closest("[hidden], [inert], [aria-hidden='true']"))return!1;if(typeof e.checkVisibility!="function")return!0;if(!e.checkVisibility({visibilityProperty:!0}))return!1;let a=e.getBoundingClientRect();return a.width>1&&a.height>1}function E(e,a){if(!e||a==="ask"&&!e.querySelector("[data-graview-quick-ask]"))return null;for(let d of e.querySelectorAll(q[a]))if(D(d))return d;return null}function W(e){let a=(u,h,c)=>e.querySelector(u)?.getAttribute(h)?.trim()||c,d=a('[data-testid="app-face-scene"]',"title","Scene"),n=a('[data-testid="app-face-pages"]',"title","Pages");return[{anchor:"faces",title:`${d} or ${n}`,words:`One app, two ways to see it: ${d} draws every record as one picture, ${n} as lists and pages to read and change.`},{anchor:"problems",title:"Whether all is in order",words:"The dot is green while every rule holds. When one is broken it counts what is wrong, and pressing it shows each one and where."},{anchor:"activity",title:"Activity",words:"What has happened here and who did it, each change with its way back."},{anchor:"ask",title:"Ask",words:"Press \u2318K (Ctrl+K) to ask about what you have selected, or right-click it and choose Ask about this\u2026. The answer stands beside it, and a change it proposes waits for you to accept it."}]}var R=300,O=1200,$=15e3;function _({root:e,steps:a,onEnd:d}){let[n,u]=(0,t.useState)(null),h=(0,t.useRef)(null),c=(0,t.useRef)(!1),p=(0,t.useRef)(d);p.current=d,(0,t.useEffect)(()=>{let r=Date.now(),o=Date.now(),s=null,i,v=new MutationObserver(()=>o=Date.now());v.observe(document.body,{childList:!0,subtree:!0});let k=()=>{let L=e(),S=Date.now();if(L?.querySelector('[data-testid="app-bar"]')){if(s??=S,S-o>=R||S-s>=O){let T=[...W(L),...a].filter(P=>E(L,P.anchor)!==null);if(T.length===0){c.current=!0,p.current(null);return}h.current=document.activeElement,u({list:T,at:0});return}}else if(S-r>=$){c.current=!0,p.current(null);return}i=setTimeout(k,100)};return i=setTimeout(k,100),()=>{clearTimeout(i),v.disconnect()}},[]);let y=(0,t.useCallback)(()=>{let r=h.current;(r instanceof HTMLElement&&r!==document.body&&r.isConnected?r:e()?.querySelector('[data-testid="app-home"]'))?.focus({preventScroll:!0})},[e]),m=(0,t.useCallback)((r,o)=>{if(c.current)return;c.current=!0;let s=document.querySelector("[data-testid='first-look']"),i=document.activeElement,v=i===null||i===document.body||s!==null&&s.contains(i);u(null),p.current(r),!(!o&&!v)&&(y(),requestAnimationFrame(()=>{let k=document.activeElement;(k===null||k===document.body)&&y()}))},[y]),b=(0,t.useCallback)((r,o)=>{let s=e();for(let i=o;i<r.length;i++)if(E(s,r[i].anchor))return i;return-1},[e]),g=(0,t.useCallback)(()=>{if(!n)return;let r=b(n.list,n.at+1);r<0?m("finished",!0):u({list:n.list,at:r})},[n,b,m]);if((0,t.useEffect)(()=>{if(!n)return;let r=e();if(!r)return;let o=0,s=()=>{cancelAnimationFrame(o),o=requestAnimationFrame(()=>{E(e(),n.list[n.at].anchor)||g()})},i=new MutationObserver(s);return i.observe(r,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["hidden","class","data-switch-drawn"]}),()=>{cancelAnimationFrame(o),i.disconnect()}},[n,e,g]),!n)return null;let w=n.list[n.at],l=b(n.list,n.at+1)<0;return(0,f.jsx)(I,{root:e,step:w,position:n.at+1,total:n.list.length,last:l,onNext:g,onEnd:m},n.at)}var N={...H,width:"min(320px, calc(100vw - 24px))",maxHeight:"min(70vh, 420px)",overflow:"auto",padding:"12px 14px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",color:"var(--graview-ink)",fontFamily:"var(--graview-font-body, system-ui)",fontSize:"0.875rem",lineHeight:1.45,overflowWrap:"anywhere"},M={minHeight:32,padding:"0 12px",borderRadius:8,font:"inherit",fontWeight:600,cursor:"pointer"};function I({root:e,step:a,position:d,total:n,last:u,onNext:h,onEnd:c}){let p=(0,t.useRef)(null),y=(0,t.useRef)(null),m=(0,t.useId)().replace(/:/g,""),b=(0,t.useMemo)(()=>({get current(){return E(e(),a.anchor)}}),[e,a.anchor]),[g]=(0,t.useState)(()=>{let l=b.current?.getBoundingClientRect(),r=typeof document>"u"?0:document.documentElement.clientWidth||innerWidth;return l&&l.left+l.width/2<r/2?"start":"end"});A(p,!0,b,{align:g}),(0,t.useLayoutEffect)(()=>{y.current?.focus({preventScroll:!0})},[]);let w=(0,t.useRef)(c);return w.current=c,(0,t.useEffect)(()=>{let l=o=>{o.target instanceof Node&&p.current?.contains(o.target)||w.current("dismissed",!1)},r=o=>{if(o.key!=="Escape"||o.defaultPrevented)return;let s=o.target;s instanceof Node&&p.current?.contains(s)||s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement||[...document.querySelectorAll("[data-graview-overlay]:not([hidden])")].some(i=>i!==p.current)||w.current("dismissed",!0)};return document.addEventListener("pointerdown",l,!0),document.addEventListener("keydown",r),()=>{document.removeEventListener("pointerdown",l,!0),document.removeEventListener("keydown",r)}},[]),(0,f.jsxs)("div",{ref:p,popover:"manual",role:"dialog","aria-modal":"false","aria-labelledby":`${m}-title`,"aria-describedby":`${m}-words`,tabIndex:-1,"data-testid":"first-look","data-first-look-anchor":a.anchor,"data-graview-overlay":"",onKeyDown:l=>{l.key==="Escape"&&(l.preventDefault(),l.stopPropagation(),c("dismissed",!0))},style:N,children:[(0,f.jsxs)("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--graview-ink-muted)"},"data-testid":"first-look-count",children:[d," of ",n]}),(0,f.jsx)("p",{id:`${m}-title`,style:{margin:"2px 0 4px",fontWeight:600,fontSize:"0.9375rem"},"data-testid":"first-look-title",children:a.title}),(0,f.jsx)("p",{id:`${m}-words`,style:{margin:0},"data-testid":"first-look-words",children:a.words}),(0,f.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-end",gap:8,marginTop:12},children:[u?null:(0,f.jsx)("button",{type:"button","data-testid":"first-look-skip",onClick:()=>c("dismissed",!0),style:{...M,fontWeight:500,border:"1px solid transparent",background:"none",color:"var(--graview-ink-muted)"},children:"Skip"}),(0,f.jsx)("button",{ref:y,type:"button","data-testid":u?"first-look-done":"first-look-next",onClick:()=>u?c("finished",!0):h(),style:{...M,border:"1px solid var(--graview-accent)",background:"var(--graview-accent)",color:"var(--graview-accent-ink)"},children:u?"Done":"Next"})]})]})}export{_ as FirstLookHints,E as firstLookAnchor};
|
|
@@ -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 _,b as me,e as ce,f as ye,g as ge}from"./chunk.I2NI7CT7.js";import{b as G}from"./chunk.LHIT3EZD.js";import{c as ue}from"./chunk.7INWDFNG.js";import{n as P}from"./chunk.QPL3OXW3.js";import{b as x,c as se,d as le,j as de,k as pe}from"./chunk.RQX4CQJN.js";import{d as ie,e as oe}from"./chunk.LUIRQ5UF.js";import{b as ae,f as re}from"./chunk.N33WUCAN.js";import{Fa as te,G as ve,Ga as ne,T as Z,ba as O,ca as ee,ea as U}from"./chunk.DBMZ3AQB.js";import{a as Y}from"./chunk.SDO3U72B.js";import{da as E,ma as X}from"./chunk.DIFR37EZ.js";import{b as D}from"./chunk.AJZBJBMO.js";var p=D(ve(),1);var ke=ne(Y(()=>(__graviewPreload(import.meta.url,["./chunk.LWRXCO2Z.js","./chunk.I2NI7CT7.js","./chunk.LHIT3EZD.js","./chunk.WVUJXDXZ.js","./chunk.7INWDFNG.js","./chunk.FPGU43SC.js","./chunk.V6FUYRZI.js","./chunk.5BPRGXIW.js","./chunk.BZEJM2PY.js","./chunk.CMLNBJZG.js","./chunk.GZHZLJBF.js","./chunk.QPL3OXW3.js","./chunk.OJGHDWI6.js","./chunk.FRERJWZJ.js","./chunk.RQX4CQJN.js","./chunk.LUIRQ5UF.js","./chunk.N33WUCAN.js","./chunk.JQFIZRAZ.js","./chunk.LKJ6FD6Y.js","./chunk.DBMZ3AQB.js","./chunk.SDO3U72B.js","./chunk.DIFR37EZ.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.HFSG3F5Z.js")))),fe=ke.part((i,n)=>i.drawAppLink(n),{quiet:!0});var e=D(Z(),1);function K({nodeId:i,field:n,value:l,stored:s=l,said:c}){let{fields:m,commit:o}=P(i),t=m.find(r=>r.field===n),{store:g,principal:I}=O(),u=g.graph.getNode(i)?.kind,f=g.schema.definitions.find(r=>r.kind===u),h=X(f,n),k=h.toLowerCase(),a=c??`${h.charAt(0).toUpperCase()}${h.slice(1)}: ${l}`,[w,L]=(0,p.useState)(!1),d=t?.shape.type==="number"?t.shape.amount:void 0,y=d&&s!==""&&Number.isFinite(Number(s))?se(Number(s),d):s,[v,z]=(0,p.useState)(y),W=(0,p.useRef)(null),j=(0,p.useRef)(null),M=(0,p.useRef)(!1),[q,J]=(0,p.useState)(void 0),S=r=>{M.current=r,L(!1)};(0,p.useEffect)(()=>z(y),[y,w]);let Q=t?.shape.type==="date";if((0,p.useEffect)(()=>{if(Q)return te(()=>void ge())},[Q]),(0,p.useEffect)(()=>{w?W.current?.focus():M.current&&(M.current=!1,j.current?.focus())},[w]),!t)return(0,e.jsx)("span",{"data-graview-field":n,"data-graview-readonly":"",title:`Read-only \u2014 nothing this app declares changes the ${k}`,style:{color:"var(--graview-ink)",cursor:"default",overflowWrap:"anywhere"},children:l});if(!w){let r=(0,e.jsx)("button",{ref:j,type:"button","data-graview-field":n,"data-graview-editable":t.mutation,...a===l?{}:{"aria-label":a},title:`${t.title} \u2014 changes the ${k}, and can be undone`,onClick:()=>{J(void 0),L(!0)},style:{all:"unset",cursor:"text",display:"inline-flex",alignItems:"flex-end",minHeight:24,minWidth:24,maxWidth:"100%",overflowWrap:"anywhere",paddingBottom:1,borderBottom:"1px dashed var(--graview-edge-bright)",color:"var(--graview-ink)"},children:l});return q?(0,e.jsxs)(e.Fragment,{children:[r,(0,e.jsx)("span",{role:"status","data-graview-refused":n,style:{marginLeft:6,fontSize:"0.75rem",color:"var(--graview-ink-muted)"},children:q})]}):r}let $=(r,{left:b=!1}={})=>{if(S(!b),r!==s){if(r===""||r===void 0||r===null){if(s==="")return;t.clearable?o(t,null):J(`${h.charAt(0).toUpperCase()}${h.slice(1)} can't be empty; it keeps ${l}.`);return}t.shape.type==="date"&&typeof r=="string"&&be(r)||o(t,r)}},be=r=>{if(t.shape.type!=="date")return!1;let b=m.filter(C=>C.shape.type==="date"&&C.takesValue),T=pe(b.map(C=>C.field),f?.fieldRoles??{}),A=T?.start===n?b.find(C=>C.field===T.end):void 0,F=g.graph.getNode(i)?.[T?.end??""];if(!A||typeof F!="string")return!1;let N=de(s===""?void 0:s,r,F,{time:t.shape.time===!0,instant:t.shape.instant===!0});if(N===void 0||N===F)return!1;let R=t.call(r),V=A.call(N);return g.applyAll(R.name===V.name?[{name:R.name,args:{...R.args,...V.args}}]:[R,V],{author:I}),!0};if(!t.takesValue){let r=[t,...t.alternatives];return(0,e.jsx)("span",{role:"group","aria-label":`Change ${E(n).toLowerCase()}`,"data-graview-field":n,style:{display:"inline-flex",gap:6,alignItems:"center",flexWrap:"wrap"},onKeyDown:b=>{b.key==="Escape"&&S(!0)},children:r.map((b,T)=>(0,e.jsx)("button",{type:"button",ref:T===0?W:void 0,"data-graview-act":b.mutation,onClick:()=>{S(!0),o(b,void 0)},onBlur:A=>{let H=A.relatedTarget;(!H||!A.currentTarget.parentElement?.contains(H))&&S(!1)},style:{padding:"2px 9px",fontSize:"0.8125rem",borderRadius:999},children:b.title},b.mutation))})}return(0,e.jsxs)("form",{style:{display:"inline-flex",flexWrap:"wrap",gap:4,maxWidth:"100%"},onSubmit:r=>{r.preventDefault(),$(he(t,v))},children:[t.shape.type==="choice"?(0,e.jsx)("select",{ref:W,"aria-label":E(n),"data-graview-field":n,value:v,onChange:r=>$(r.target.value),onBlur:()=>S(!1),style:{font:"inherit",fontSize:"inherit"},children:t.shape.options.map(r=>(0,e.jsx)("option",{value:r,children:ae(f,n,r)},r))}):t.shape.type==="date"?(0,e.jsx)(ye,{inputRef:W,label:E(n),value:v===""?void 0:v,time:t.shape.time===!0,instant:t.shape.instant===!0,partial:t.shape.partial===!0,onChange:r=>z(r??""),onLeave:r=>$(r,{left:!0}),onCancel:()=>S(!0),autoSelect:!0,boxStyle:{fontSize:"inherit",minHeight:24,padding:"0 3px"}}):(0,e.jsxs)(e.Fragment,{children:[d&&x(d).prefix?(0,e.jsx)("span",{"aria-hidden":"true",children:x(d).prefix}):null,(0,e.jsx)("input",{ref:W,"aria-label":d?`${E(n)}, ${x(d).hint}`:E(n),"data-graview-field":n,...d?{inputMode:"decimal",placeholder:x(d).placeholder,"data-graview-amount":d.format??"unit"}:{},type:d?"text":t.shape.type==="number"&&!t.shape.duration?"number":"text",...t.shape.type==="number"&&t.shape.duration?{placeholder:"1h 30m"}:{},...t.shape.type==="text"&&t.shape.holds==="phone"?{inputMode:"tel",autoComplete:"tel"}:{},...t.shape.type==="number"&&t.shape.min!==void 0&&!d?{min:t.shape.min}:{},...t.shape.type==="number"&&t.shape.max!==void 0&&!d?{max:t.shape.max}:{},...t.shape.type==="number"&&t.shape.step!==void 0&&!d?{step:t.shape.step}:{},value:v,onChange:r=>z(r.target.value),onBlur:()=>$(he(t,v),{left:!0}),onKeyDown:r=>{r.key==="Escape"&&S(!0)},style:{font:"inherit",fontSize:"inherit",width:`min(${Math.max(6,v.length+1)}ch, 100%)`,maxWidth:"100%",minWidth:0,boxSizing:"border-box",minHeight:24,display:"inline-flex",alignItems:"center",padding:"0 3px"}}),d&&x(d).suffix?(0,e.jsx)("span",{"aria-hidden":"true",children:x(d).suffix}):null]}),t.open.length>0?(0,e.jsxs)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:["also needs ",t.open.map(r=>r.name).join(", ")]}):null]})}function he(i,n){return n.trim()===""?"":i.shape.type==="number"&&i.shape.amount?le(n,i.shape.amount):i.shape.type==="number"?i.shape.duration?re(n)??n:Number(n):i.shape.type==="text"&&i.shape.holds?n.trim():n}function we({href:i,field:n,value:l,stored:s,nodeId:c}){let m=i.startsWith("tel:"),o=(t,g)=>(0,e.jsx)("a",{href:i,"data-graview-link":n,...g?{"aria-label":g}:{},...m?{}:{target:"_blank",rel:"noopener noreferrer"},style:{display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,maxWidth:"100%",overflowWrap:"anywhere",color:"var(--graview-accent)"},children:t});return c===void 0?o(l):(0,e.jsxs)("span",{style:{display:"inline-flex",flexWrap:"wrap",alignItems:"center",gap:"0 10px",maxWidth:"100%"},children:[(0,e.jsx)(K,{nodeId:c,field:n,value:l,...s===void 0?{}:{stored:s}}),o(m?"Call":"Map",m?`Call ${l}`:`Open ${l} in maps`)]})}function Ue({id:i,hide:n=[],limit:l=10,labels:s={},shown:c=[]}){let{store:m}=O(),o=U(i);if(!o)return null;let t=m.schema.tryDefinition(o.kind),g=ie(o,t,{limit:l,said:c}).filter(u=>!n.includes(u.key)),I=ue(t).length>0;return g.length===0&&!I?null:(0,e.jsxs)("div",{"data-graview-fields":o.id,style:{display:"grid",gap:14,alignContent:"start",minWidth:0,fontSize:"0.875rem"},children:[oe(t,g).map((u,f)=>{let h=(0,e.jsx)("dl",{style:{margin:0,display:"grid",gridTemplateColumns:"auto 1fr",gap:"5px 16px",alignContent:"start",minWidth:0},children:u.fields.map(a=>a.files?(0,e.jsx)(_,{as:"field",nodeId:o.id,field:a.key,label:s[a.key]??a.label,files:a.files,labelStyle:B,style:{marginTop:6}},a.key):a.long?(0,e.jsx)(xe,{nodeId:o.id,field:a.key,label:s[a.key]??a.label,value:a.value,markdown:a.markdown,labelStyle:B,style:{gridColumn:"1 / -1",marginTop:6}},a.key):(0,e.jsxs)("div",{style:{display:"contents"},children:[(0,e.jsx)("dt",{style:{...B,whiteSpace:"nowrap"},children:s[a.key]??a.label}),(0,e.jsxs)("dd",{style:{margin:0,minWidth:0},children:[a.linked?(0,e.jsx)(me,{relation:a.linked.relation,refs:a.linked.refs,nodeId:o.id,field:a.key}):a.app?(0,e.jsx)(fe,{address:a.app,as:"record",nodeId:o.id,field:a.key}):a.href?(0,e.jsx)(we,{href:a.href,field:a.key,value:a.value,stored:a.stored,nodeId:o.id}):(0,e.jsx)(K,{nodeId:o.id,field:a.key,value:a.value,stored:a.stored}),a.repeats?(0,e.jsx)(ce,{nodeId:o.id,field:a.key,start:o[a.key],value:o[`${a.key}Repeat`],label:`${s[a.key]??a.label} repeats`}):null]})]},a.key))});if(!u.title)return(0,e.jsx)("div",{children:h},f);let k=`graview-field-group-${o.id}-${f}`;return(0,e.jsxs)("div",{role:"group","aria-labelledby":k,style:{display:"grid",gap:6,minWidth:0},children:[(0,e.jsx)("p",{id:k,"data-graview-field-group":u.title,style:Se,children:u.title}),h]},f)}),I?(0,e.jsx)(_,{as:"unfilled",nodeId:o.id,skip:n,labels:s,labelStyle:B}):null]})}var B={color:"var(--graview-ink-faint)",fontSize:"0.8125rem"},Se={margin:0,fontSize:"0.75rem",letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--graview-ink-muted)",fontWeight:560};function xe(i){return ee()?(0,e.jsx)(Le,{...i}):(0,e.jsx)(Ie,{...i})}function Ie({field:i,label:n,value:l,labelStyle:s,valueStyle:c,style:m,markdown:o}){return(0,e.jsxs)("div",{"data-graview-long":i,style:{display:"grid",gap:6,minWidth:0,...m},children:[(0,e.jsx)("dt",{style:s,children:n}),(0,e.jsx)("dd",{style:{margin:0,minWidth:0,...c},children:(0,e.jsx)("div",{"data-graview-field":i,children:(0,e.jsx)(G,{text:l,markdown:o})})})]})}function Le({nodeId:i,field:n,label:l,value:s,labelStyle:c,valueStyle:m,style:o,markdown:t}){let{fields:g,commit:I}=P(i),u=g.find(y=>y.field===n&&y.takesValue),[f,h]=(0,p.useState)(!1),k=(0,p.useRef)(null),a=(0,p.useRef)(!1);(0,p.useEffect)(()=>{!f&&a.current&&(a.current=!1,k.current?.focus())},[f]);let w=y=>{a.current=y,h(!1)},L=l.toLowerCase(),d=(0,e.jsx)(G,{text:s,markdown:t});return(0,e.jsxs)("div",{"data-graview-long":n,style:{display:"grid",gap:6,minWidth:0,...o},children:[(0,e.jsxs)("dt",{style:{display:"flex",alignItems:"baseline",gap:10,...c},children:[(0,e.jsx)("span",{children:l}),u&&!f?(0,e.jsx)("button",{ref:k,type:"button","data-graview-editable":u.mutation,"aria-label":`Edit the ${L}`,title:`${u.title} \u2014 changes the ${L}, and can be undone`,onClick:()=>h(!0),style:Ee,children:"Edit"}):null]}),(0,e.jsx)("dd",{style:{margin:0,minWidth:0,...m},children:f&&u?(0,e.jsx)(p.Suspense,{fallback:d,children:(0,e.jsx)(Ce,{nodeId:i,field:n,label:l,value:s,...t?{markdown:!0}:{},onCancel:()=>w(!0),onDone:y=>w(!y),onSave:(y,v)=>{w(!v),y!==s&&I(u,y)}})}):(0,e.jsx)("div",{"data-graview-field":n,...u?{}:{"data-graview-readonly":"",title:`Read-only \u2014 nothing this app declares changes the ${L}`},...u?{onClick:()=>h(!0)}:{},style:{cursor:u?"text":"default",minWidth:0},children:d})})]})}var Ce=(0,p.lazy)(()=>(__graviewPreload(import.meta.url,["./chunk.LHIT3EZD.js","./chunk.JQFIZRAZ.js","./chunk.LKJ6FD6Y.js","./chunk.DBMZ3AQB.js","./chunk.SDO3U72B.js","./chunk.DIFR37EZ.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.57BKS5KD.js"))),Ee={all:"unset",cursor:"pointer",fontSize:"0.75rem",letterSpacing:"normal",textTransform:"none",color:"var(--graview-accent)",borderBottom:"1px dashed currentColor",minHeight:24,minWidth:24,display:"inline-flex",alignItems:"flex-end"};function _e({nodeId:i,children:n}){let{fields:l}=P(i),s=U(i);if(!s)return(0,e.jsx)(e.Fragment,{children:n});let c=l.find(m=>{let o=s[m.field];return typeof o=="string"&&o===n});return c?(0,e.jsx)(K,{nodeId:i,field:c.field,value:n,said:n}):(0,e.jsx)(e.Fragment,{children:n})}export{fe as a,K as b,we as c,Ue as d,xe as e,_e as f};
|
|
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 _,b as me,e as ce,f as ye,g as ge}from"./chunk.S5MGE2U5.js";import{b as G}from"./chunk.34TW32TB.js";import{c as ue}from"./chunk.LDAYDCUO.js";import{n as P}from"./chunk.ELERUERU.js";import{b as x,c as se,d as le,j as de,k as pe}from"./chunk.3YZHZGTM.js";import{d as ie,e as oe}from"./chunk.EQTSV7BK.js";import{b as ae,f as re}from"./chunk.27CW6SCT.js";import{Fa as te,G as ve,Ga as ne,T as Z,ba as O,ca as ee,ea as U}from"./chunk.HT2BEOEV.js";import{a as Y}from"./chunk.SDO3U72B.js";import{da as E,ma as X}from"./chunk.7BBGRTXM.js";import{b as D}from"./chunk.AJZBJBMO.js";var p=D(ve(),1);var ke=ne(Y(()=>(__graviewPreload(import.meta.url,["./chunk.ACYDJQRC.js","./chunk.S5MGE2U5.js","./chunk.34TW32TB.js","./chunk.WVUJXDXZ.js","./chunk.LDAYDCUO.js","./chunk.KKNDX4JT.js","./chunk.GKSUTAIX.js","./chunk.5ICIMQE6.js","./chunk.QGV7H7RQ.js","./chunk.YIA2EDVF.js","./chunk.GZHZLJBF.js","./chunk.ELERUERU.js","./chunk.OJGHDWI6.js","./chunk.YHTE34RN.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.ILRCNTGT.js")))),fe=ke.part((i,n)=>i.drawAppLink(n),{quiet:!0});var e=D(Z(),1);function K({nodeId:i,field:n,value:l,stored:s=l,said:c}){let{fields:m,commit:o}=P(i),t=m.find(r=>r.field===n),{store:g,principal:I}=O(),u=g.graph.getNode(i)?.kind,f=g.schema.definitions.find(r=>r.kind===u),h=X(f,n),k=h.toLowerCase(),a=c??`${h.charAt(0).toUpperCase()}${h.slice(1)}: ${l}`,[w,L]=(0,p.useState)(!1),d=t?.shape.type==="number"?t.shape.amount:void 0,y=d&&s!==""&&Number.isFinite(Number(s))?se(Number(s),d):s,[v,z]=(0,p.useState)(y),W=(0,p.useRef)(null),j=(0,p.useRef)(null),M=(0,p.useRef)(!1),[q,J]=(0,p.useState)(void 0),S=r=>{M.current=r,L(!1)};(0,p.useEffect)(()=>z(y),[y,w]);let Q=t?.shape.type==="date";if((0,p.useEffect)(()=>{if(Q)return te(()=>void ge())},[Q]),(0,p.useEffect)(()=>{w?W.current?.focus():M.current&&(M.current=!1,j.current?.focus())},[w]),!t)return(0,e.jsx)("span",{"data-graview-field":n,"data-graview-readonly":"",title:`Read-only \u2014 nothing this app declares changes the ${k}`,style:{color:"var(--graview-ink)",cursor:"default",overflowWrap:"anywhere"},children:l});if(!w){let r=(0,e.jsx)("button",{ref:j,type:"button","data-graview-field":n,"data-graview-editable":t.mutation,...a===l?{}:{"aria-label":a},title:`${t.title} \u2014 changes the ${k}, and can be undone`,onClick:()=>{J(void 0),L(!0)},style:{all:"unset",cursor:"text",display:"inline-flex",alignItems:"flex-end",minHeight:24,minWidth:24,maxWidth:"100%",overflowWrap:"anywhere",paddingBottom:1,borderBottom:"1px dashed var(--graview-edge-bright)",color:"var(--graview-ink)"},children:l});return q?(0,e.jsxs)(e.Fragment,{children:[r,(0,e.jsx)("span",{role:"status","data-graview-refused":n,style:{marginLeft:6,fontSize:"0.75rem",color:"var(--graview-ink-muted)"},children:q})]}):r}let $=(r,{left:b=!1}={})=>{if(S(!b),r!==s){if(r===""||r===void 0||r===null){if(s==="")return;t.clearable?o(t,null):J(`${h.charAt(0).toUpperCase()}${h.slice(1)} can't be empty; it keeps ${l}.`);return}t.shape.type==="date"&&typeof r=="string"&&be(r)||o(t,r)}},be=r=>{if(t.shape.type!=="date")return!1;let b=m.filter(C=>C.shape.type==="date"&&C.takesValue),T=pe(b.map(C=>C.field),f?.fieldRoles??{}),A=T?.start===n?b.find(C=>C.field===T.end):void 0,F=g.graph.getNode(i)?.[T?.end??""];if(!A||typeof F!="string")return!1;let N=de(s===""?void 0:s,r,F,{time:t.shape.time===!0,instant:t.shape.instant===!0});if(N===void 0||N===F)return!1;let R=t.call(r),V=A.call(N);return g.applyAll(R.name===V.name?[{name:R.name,args:{...R.args,...V.args}}]:[R,V],{author:I}),!0};if(!t.takesValue){let r=[t,...t.alternatives];return(0,e.jsx)("span",{role:"group","aria-label":`Change ${E(n).toLowerCase()}`,"data-graview-field":n,style:{display:"inline-flex",gap:6,alignItems:"center",flexWrap:"wrap"},onKeyDown:b=>{b.key==="Escape"&&S(!0)},children:r.map((b,T)=>(0,e.jsx)("button",{type:"button",ref:T===0?W:void 0,"data-graview-act":b.mutation,onClick:()=>{S(!0),o(b,void 0)},onBlur:A=>{let H=A.relatedTarget;(!H||!A.currentTarget.parentElement?.contains(H))&&S(!1)},style:{padding:"2px 9px",fontSize:"0.8125rem",borderRadius:999},children:b.title},b.mutation))})}return(0,e.jsxs)("form",{style:{display:"inline-flex",flexWrap:"wrap",gap:4,maxWidth:"100%"},onSubmit:r=>{r.preventDefault(),$(he(t,v))},children:[t.shape.type==="choice"?(0,e.jsx)("select",{ref:W,"aria-label":E(n),"data-graview-field":n,value:v,onChange:r=>$(r.target.value),onBlur:()=>S(!1),style:{font:"inherit",fontSize:"inherit"},children:t.shape.options.map(r=>(0,e.jsx)("option",{value:r,children:ae(f,n,r)},r))}):t.shape.type==="date"?(0,e.jsx)(ye,{inputRef:W,label:E(n),value:v===""?void 0:v,time:t.shape.time===!0,instant:t.shape.instant===!0,partial:t.shape.partial===!0,onChange:r=>z(r??""),onLeave:r=>$(r,{left:!0}),onCancel:()=>S(!0),autoSelect:!0,boxStyle:{fontSize:"inherit",minHeight:24,padding:"0 3px"}}):(0,e.jsxs)(e.Fragment,{children:[d&&x(d).prefix?(0,e.jsx)("span",{"aria-hidden":"true",children:x(d).prefix}):null,(0,e.jsx)("input",{ref:W,"aria-label":d?`${E(n)}, ${x(d).hint}`:E(n),"data-graview-field":n,...d?{inputMode:"decimal",placeholder:x(d).placeholder,"data-graview-amount":d.format??"unit"}:{},type:d?"text":t.shape.type==="number"&&!t.shape.duration?"number":"text",...t.shape.type==="number"&&t.shape.duration?{placeholder:"1h 30m"}:{},...t.shape.type==="text"&&t.shape.holds==="phone"?{inputMode:"tel",autoComplete:"tel"}:{},...t.shape.type==="number"&&t.shape.min!==void 0&&!d?{min:t.shape.min}:{},...t.shape.type==="number"&&t.shape.max!==void 0&&!d?{max:t.shape.max}:{},...t.shape.type==="number"&&t.shape.step!==void 0&&!d?{step:t.shape.step}:{},value:v,onChange:r=>z(r.target.value),onBlur:()=>$(he(t,v),{left:!0}),onKeyDown:r=>{r.key==="Escape"&&S(!0)},style:{font:"inherit",fontSize:"inherit",width:`min(${Math.max(6,v.length+1)}ch, 100%)`,maxWidth:"100%",minWidth:0,boxSizing:"border-box",minHeight:24,display:"inline-flex",alignItems:"center",padding:"0 3px"}}),d&&x(d).suffix?(0,e.jsx)("span",{"aria-hidden":"true",children:x(d).suffix}):null]}),t.open.length>0?(0,e.jsxs)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:["also needs ",t.open.map(r=>r.name).join(", ")]}):null]})}function he(i,n){return n.trim()===""?"":i.shape.type==="number"&&i.shape.amount?le(n,i.shape.amount):i.shape.type==="number"?i.shape.duration?re(n)??n:Number(n):i.shape.type==="text"&&i.shape.holds?n.trim():n}function we({href:i,field:n,value:l,stored:s,nodeId:c}){let m=i.startsWith("tel:"),o=(t,g)=>(0,e.jsx)("a",{href:i,"data-graview-link":n,...g?{"aria-label":g}:{},...m?{}:{target:"_blank",rel:"noopener noreferrer"},style:{display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,maxWidth:"100%",overflowWrap:"anywhere",color:"var(--graview-accent)"},children:t});return c===void 0?o(l):(0,e.jsxs)("span",{style:{display:"inline-flex",flexWrap:"wrap",alignItems:"center",gap:"0 10px",maxWidth:"100%"},children:[(0,e.jsx)(K,{nodeId:c,field:n,value:l,...s===void 0?{}:{stored:s}}),o(m?"Call":"Map",m?`Call ${l}`:`Open ${l} in maps`)]})}function Ue({id:i,hide:n=[],limit:l=10,labels:s={},shown:c=[]}){let{store:m}=O(),o=U(i);if(!o)return null;let t=m.schema.tryDefinition(o.kind),g=ie(o,t,{limit:l,said:c}).filter(u=>!n.includes(u.key)),I=ue(t).length>0;return g.length===0&&!I?null:(0,e.jsxs)("div",{"data-graview-fields":o.id,style:{display:"grid",gap:14,alignContent:"start",minWidth:0,fontSize:"0.875rem"},children:[oe(t,g).map((u,f)=>{let h=(0,e.jsx)("dl",{style:{margin:0,display:"grid",gridTemplateColumns:"auto 1fr",gap:"5px 16px",alignContent:"start",minWidth:0},children:u.fields.map(a=>a.files?(0,e.jsx)(_,{as:"field",nodeId:o.id,field:a.key,label:s[a.key]??a.label,files:a.files,labelStyle:B,style:{marginTop:6}},a.key):a.long?(0,e.jsx)(xe,{nodeId:o.id,field:a.key,label:s[a.key]??a.label,value:a.value,markdown:a.markdown,labelStyle:B,style:{gridColumn:"1 / -1",marginTop:6}},a.key):(0,e.jsxs)("div",{style:{display:"contents"},children:[(0,e.jsx)("dt",{style:{...B,whiteSpace:"nowrap"},children:s[a.key]??a.label}),(0,e.jsxs)("dd",{style:{margin:0,minWidth:0},children:[a.linked?(0,e.jsx)(me,{relation:a.linked.relation,refs:a.linked.refs,nodeId:o.id,field:a.key}):a.app?(0,e.jsx)(fe,{address:a.app,as:"record",nodeId:o.id,field:a.key}):a.href?(0,e.jsx)(we,{href:a.href,field:a.key,value:a.value,stored:a.stored,nodeId:o.id}):(0,e.jsx)(K,{nodeId:o.id,field:a.key,value:a.value,stored:a.stored}),a.repeats?(0,e.jsx)(ce,{nodeId:o.id,field:a.key,start:o[a.key],value:o[`${a.key}Repeat`],label:`${s[a.key]??a.label} repeats`}):null]})]},a.key))});if(!u.title)return(0,e.jsx)("div",{children:h},f);let k=`graview-field-group-${o.id}-${f}`;return(0,e.jsxs)("div",{role:"group","aria-labelledby":k,style:{display:"grid",gap:6,minWidth:0},children:[(0,e.jsx)("p",{id:k,"data-graview-field-group":u.title,style:Se,children:u.title}),h]},f)}),I?(0,e.jsx)(_,{as:"unfilled",nodeId:o.id,skip:n,labels:s,labelStyle:B}):null]})}var B={color:"var(--graview-ink-faint)",fontSize:"0.8125rem"},Se={margin:0,fontSize:"0.75rem",letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--graview-ink-muted)",fontWeight:560};function xe(i){return ee()?(0,e.jsx)(Le,{...i}):(0,e.jsx)(Ie,{...i})}function Ie({field:i,label:n,value:l,labelStyle:s,valueStyle:c,style:m,markdown:o}){return(0,e.jsxs)("div",{"data-graview-long":i,style:{display:"grid",gap:6,minWidth:0,...m},children:[(0,e.jsx)("dt",{style:s,children:n}),(0,e.jsx)("dd",{style:{margin:0,minWidth:0,...c},children:(0,e.jsx)("div",{"data-graview-field":i,children:(0,e.jsx)(G,{text:l,markdown:o})})})]})}function Le({nodeId:i,field:n,label:l,value:s,labelStyle:c,valueStyle:m,style:o,markdown:t}){let{fields:g,commit:I}=P(i),u=g.find(y=>y.field===n&&y.takesValue),[f,h]=(0,p.useState)(!1),k=(0,p.useRef)(null),a=(0,p.useRef)(!1);(0,p.useEffect)(()=>{!f&&a.current&&(a.current=!1,k.current?.focus())},[f]);let w=y=>{a.current=y,h(!1)},L=l.toLowerCase(),d=(0,e.jsx)(G,{text:s,markdown:t});return(0,e.jsxs)("div",{"data-graview-long":n,style:{display:"grid",gap:6,minWidth:0,...o},children:[(0,e.jsxs)("dt",{style:{display:"flex",alignItems:"baseline",gap:10,...c},children:[(0,e.jsx)("span",{children:l}),u&&!f?(0,e.jsx)("button",{ref:k,type:"button","data-graview-editable":u.mutation,"aria-label":`Edit the ${L}`,title:`${u.title} \u2014 changes the ${L}, and can be undone`,onClick:()=>h(!0),style:Ee,children:"Edit"}):null]}),(0,e.jsx)("dd",{style:{margin:0,minWidth:0,...m},children:f&&u?(0,e.jsx)(p.Suspense,{fallback:d,children:(0,e.jsx)(Ce,{nodeId:i,field:n,label:l,value:s,...t?{markdown:!0}:{},onCancel:()=>w(!0),onDone:y=>w(!y),onSave:(y,v)=>{w(!v),y!==s&&I(u,y)}})}):(0,e.jsx)("div",{"data-graview-field":n,...u?{}:{"data-graview-readonly":"",title:`Read-only \u2014 nothing this app declares changes the ${L}`},...u?{onClick:()=>h(!0)}:{},style:{cursor:u?"text":"default",minWidth:0},children:d})})]})}var Ce=(0,p.lazy)(()=>(__graviewPreload(import.meta.url,["./chunk.34TW32TB.js","./chunk.YD3TKV6P.js","./chunk.4KC35UNR.js","./chunk.HT2BEOEV.js","./chunk.SDO3U72B.js","./chunk.7BBGRTXM.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.4AFFPYOK.js"))),Ee={all:"unset",cursor:"pointer",fontSize:"0.75rem",letterSpacing:"normal",textTransform:"none",color:"var(--graview-accent)",borderBottom:"1px dashed currentColor",minHeight:24,minWidth:24,display:"inline-flex",alignItems:"flex-end"};function _e({nodeId:i,children:n}){let{fields:l}=P(i),s=U(i);if(!s)return(0,e.jsx)(e.Fragment,{children:n});let c=l.find(m=>{let o=s[m.field];return typeof o=="string"&&o===n});return c?(0,e.jsx)(K,{nodeId:i,field:c.field,value:n,said:n}):(0,e.jsx)(e.Fragment,{children:n})}export{fe as a,K as b,we as c,Ue as d,xe as e,_e as f};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as z,b as Y,d as ee}from"./chunk.
|
|
1
|
+
import{a as z,b as Y,d as ee}from"./chunk.TBW7CU4G.js";import"./chunk.SPXRLO5K.js";import{ec as J,ga as Q,ja as U,oa as X,sa as _}from"./chunk.7BBGRTXM.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";function ce(t){let r=t?.indexOf(":")??-1;if(!(!t||r<=0||r===t.length-1))return{relation:t.slice(0,r),record:t.slice(r+1)}}function ne(t,r){if(t.length===0)return!0;let d=`${r.split("/")[0]}/*`;return t.some(a=>a==="*"||a==="*/*"||a===r||a===d)}function re(t,r){let d=r.startsWith("image/")?"image":r.startsWith("video/")?"video":"file";return t.find(a=>a.as===d)??t.find(a=>a.as==="file")}function fe(t,r){let d=new Set(t.map(k=>k.as==="image"?"image/":k.as==="video"?"video/":""));if(d.has("")||r.kinds.length===0)return r.kinds.join(",");let a=[];for(let k of d){let m=r.kinds.filter(l=>l.startsWith(k));a.push(...m.length>0?m:[`${k}*`])}return a.join(",")}var T=t=>t.input?.shape??{},ie=(t,r)=>T(t)[r]?.safeParse(void 0).success===!1;function ae(t,r){let d=new Set(z(t.input).map(a=>a.name));return Object.keys(T(t)).filter(a=>!r.has(a)&&!d.has(a)&&ie(t,a)&&T(t)[a].safeParse("a name").success&&!T(t)[a].safeParse(1).success)}var ue=t=>t.replace(/\.[a-z0-9]{1,5}$/i,"")||t,se=(t,r)=>{let d=Number.isFinite(Date.parse(r))?new Date(Date.parse(r)).toISOString():r;return[r,d,d.replace(/\.\d{3}Z$/,"Z"),r.slice(0,10)].find(a=>t.safeParse(a).success)},pe="2026-01-01T00:00:00.000Z";function te(t,r){let d=T(t),a=new Set(ae(t,r)),k=Object.keys(d).filter(l=>!r.has(l)&&!a.has(l)&&ie(t,l)),m=k.filter(l=>se(d[l],pe)!==void 0);return{timed:m,left:k.filter(l=>!m.includes(l))}}function oe(t,r,d,a,k){let m=e=>({ok:!1,says:e}),{kind:l}=a,R=(d.accepts??[]).filter(e=>e.kind===l&&(a.field===void 0||e.field===a.field));if(R.length===0)return m(a.field===void 0?`The view's accepts names no field of "${l}", so nothing dropped there can become one.`:`The view's accepts does not name ${l}'s "${a.field}".`);let A=k.files;if(!A||!(A.maxBytes>0))return m("This host takes no files.");let j=R.flatMap(e=>{let n=ee(t,e.kind,e.field);return n?[{field:e.field,...n}]:[]}),w=j.filter(e=>e.as==="file"||A.kinds.length===0||A.kinds.some(n=>n==="*"||n==="*/*"||n.startsWith(e.as==="image"?"image/":"video/")));if(w.length===0)return m(`This host takes none of what ${l}'s ${j.map(e=>`"${e.field}"`).join(" or ")} holds.`);let c=a.connect===void 0?void 0:ce(a.connect);if(a.connect!==void 0&&(!c||k.shown.has(a.connect)))return m(`data-drop-connect is "<relation>:<record id>", not "${a.connect}".`);if(c&&!k.shown.has(c.record))return m(`data-drop-connect names "${c.record}", which this view was not shown.`);let g=c?t.seenBy(r).graph.getNode(c.record):void 0;if(c&&!g)return m(`data-drop-connect names "${c.record}", which this seat does not see.`);let $=e=>Object.hasOwn(t.schema.tryDefinition(e)?.edges??{},c.relation),E=c?$(l):!1;if(c&&!E&&!$(g.kind))return m(`Neither a "${l}" nor a "${g.kind}" has the relation "${c.relation}".`);let H=t.allMutations(),F=e=>t.permits(e,r).ok,Z=e=>w.every(n=>Object.hasOwn(T(e),n.field)),V=H.filter(e=>(e.creates??[]).includes(l)&&Z(e)),x=X(t.schema.tryDefinition(l),l),O=U(t.schema,l).toLowerCase(),S=g?Q(t.schema.tryDefinition(g.kind),g):void 0,G=e=>`${e===1?`a ${x}`:`${e} ${O}`}${S?` to ${S}`:""}`,K=e=>`Add ${G(e)}`,L=e=>`Added ${G(e)}.`,B=`Drop to add ${O}${S?` to ${S}`:""}.`,N=(e,n,u,v)=>{let I=new Set(Object.keys(n)),D=_(u.at)??v??new Date().toISOString();for(let C of te(e,I).timed)n[C]=se(T(e)[C],D);for(let C of ae(e,I))n[C]=ue(u.name);return n},q=(e,...n)=>new Set([...w.map(u=>u.field),...n,...z(e.input).map(u=>u.name)]),P=(e,...n)=>te(e,q(e,...n)).left,i=(e,n)=>m(`"${e.title??e.name}" asks for ${n.map(u=>`"${u}"`).join(" and ")}, which no dropped file says, so nothing dropped here can become a ${x}.`),o=(e,n)=>e.list?[n]:n,f={ok:!0,kind:l,fields:w,accept:fe(w,A),...c?{connect:c}:{},intent:K,invite:B,added:L};if(!c){let e=V.find(n=>!n.subject&&F({name:n.name,args:{}}));return e?P(e).length>0?i(e,P(e)):{...f,calls:n=>[{name:e.name,args:N(e,{[n.field]:o(w.find(u=>u.field===n.field),n.value)},n.value,n.at)}]}:m(`This seat may not make a "${l}" here.`)}let s=V.find(e=>e.subject&&(e.subject.kinds==="*"||e.subject.kinds.includes(g.kind))&&(e.connects??[]).includes(c.relation)&&F({name:e.name,args:{[e.subject.arg]:c.record}}));if(s){let e=s.subject.arg;return P(s,e).length>0?i(s,P(s,e)):{...f,calls:n=>[{name:s.name,args:N(s,{[e]:c.record,[n.field]:o(w.find(u=>u.field===n.field),n.value)},n.value,n.at)}]}}let p=V.find(e=>!e.subject&&F({name:e.name,args:{}}));if(!p)return m(`This seat may not make a "${l}" here.`);if(P(p).length>0)return i(p,P(p));let y=E?l:g.kind,W=E?g.kind:l,M=H.find(e=>{if(!(e.connects??[]).includes(c.relation)||!e.subject)return!1;let n=e.subject.kinds;if(n!=="*"&&!n.includes(y))return!1;let u=z(e.input).find(v=>v.name!==e.subject.arg&&(v.kinds.includes("*")||v.kinds.includes(W)));return u?F({name:e.name,args:E?{[u.name]:c.record}:{[e.subject.arg]:c.record}}):!1});if(!M)return m(`This seat may not link a "${l}" to ${c.record} by "${c.relation}".`);let h=M.subject.arg,b=z(M.input).find(e=>e.name!==h&&(e.kinds.includes("*")||e.kinds.includes(W))).name;return{...f,calls:(e,n)=>[{name:p.name,args:N(p,{[e.field]:o(w.find(u=>u.field===e.field),e.value)},e.value,e.at)},{name:M.name,args:E?{[h]:J(n*2),[b]:c.record}:{[h]:c.record,[b]:J(n*2)}}]}}var de=t=>t.type.startsWith("image/"),me=t=>t.type.startsWith("video/"),ge=`
|
|
2
2
|
[data-graview-drop-over] { outline: 2px dashed var(--graview-accent, Highlight) !important; outline-offset: 2px !important; background-color: color-mix(in srgb, var(--graview-accent, Highlight) 10%, transparent) !important; }
|
|
3
3
|
[data-graview-drop-status], [data-graview-drop-refused] { margin: 4px 0 0; font: 0.8125rem/1.4 var(--graview-font-body, system-ui, sans-serif); color: var(--graview-ink-muted, GrayText); }
|
|
4
4
|
[data-graview-drop-refused] { color: var(--graview-warn, var(--graview-ink, CanvasText)); }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./chunk.
|
|
1
|
+
import"./chunk.YD3TKV6P.js";import"./chunk.4KC35UNR.js";import{T as o,ba as n}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 a=t(o(),1),d=[["waiting","Waiting"],["active","Under way: darker and taller"],["done","Done: flat and pale"],["flagged","A problem, or past its due date"],["recent","Changed since you were last here"],["own","Yours"]],g=i=>{let e=r=>`color-mix(in oklab,var(--graview-ink) ${r}%,var(--graview-panel))`;return`.graview-map-key{display:grid;gap:4px;padding:2px 4px 8px;margin-bottom:6px;border-bottom:1px solid var(--graview-edge);font-size:.8125rem;color:var(--graview-ink-muted)}
|
|
2
2
|
.graview-map-key>div{display:flex;align-items:center;gap:8px}
|
|
3
3
|
.graview-map-key>div:first-child{color:var(--graview-ink)}
|
|
4
4
|
.graview-map-key i{flex:none;width:14px;height:10px;border-radius:2px;background:${e(i?34:42)}}
|
|
@@ -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{e as $,g as F,h as P,i as B,l as K,m as H}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{e as $,g as F,h as P,i as B,l as K,m as H}from"./chunk.3YZHZGTM.js";import"./chunk.EQTSV7BK.js";import"./chunk.27CW6SCT.js";import"./chunk.YD3TKV6P.js";import"./chunk.4KC35UNR.js";import{G as se,Ga as A,T as S}from"./chunk.HT2BEOEV.js";import{a as q}from"./chunk.SDO3U72B.js";import"./chunk.7BBGRTXM.js";import"./chunk.FQLNBIQ5.js";import{b as T}from"./chunk.AJZBJBMO.js";var r=T(se(),1);var j=T(S(),1),Z=A(q(()=>(__graviewPreload(import.meta.url,["./chunk.YD3TKV6P.js","./chunk.4KC35UNR.js","./chunk.HT2BEOEV.js","./chunk.SDO3U72B.js","./chunk.7BBGRTXM.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.M34CS7DI.js")))),U={Part:Z.part((n,t)=>(0,j.jsx)(n.WhenMonth,{...t}),{quiet:!0}),prefetch:()=>Z.prefetch()};var o=T(S(),1),E="try \u201Ctomorrow 3pm\u201D, \u201CFri 10:30\u201D or \u201C17 Oct\u201D";function _(n,t,i,b=!1){let y=Date.UTC(+n.day.slice(0,4),+n.day.slice(5,7)-1,+n.day.slice(8,10),0,t?n.minutes??0:0),x={weekday:b?"long":"short",year:"numeric",month:b?"long":"short",day:"numeric",...t?{hour:"numeric",minute:"2-digit"}:{},timeZone:"UTC"},h;try{h=new Intl.DateTimeFormat(i??"en-US",x)}catch{h=new Intl.DateTimeFormat("en-US",x)}return h.format(y).replace(/ /g," ")}function V(n,t){if(n.length===4)return n;let i=Date.UTC(+n.slice(0,4),+n.slice(5,7)-1,1);try{return new Intl.DateTimeFormat(t??"en-US",{month:"long",year:"numeric",timeZone:"UTC"}).format(i)}catch{return new Intl.DateTimeFormat("en-US",{month:"long",year:"numeric",timeZone:"UTC"}).format(i)}}function me({value:n,time:t,instant:i=!1,partial:b=!1,label:y,name:x,required:h,autoFocus:G,autoSelect:N,locale:s,onChange:J,onLeave:Q,onCancel:X,inputRef:W,boxStyle:Y}){let k=(0,r.useId)(),p=(0,r.useRef)(null),O=(0,r.useRef)(null),I=e=>b&&!t&&e!==void 0?K(e):void 0,C=e=>{let a=I(e);if(a!==void 0)return V(a,s);let l=F(e);return l?_(l,t,s):e??""},[g,D]=(0,r.useState)(()=>C(n)),[R,w]=(0,r.useState)(!1),[ee,L]=(0,r.useState)(n),[ne,te]=(0,r.useState)(n);n!==ne&&(te(n),n!==ee&&(L(n),D(C(n)))),(0,r.useEffect)(()=>{N&&(p.current?.focus(),p.current?.select())},[N]);let d=t&&i?B(s):void 0,M=g===C(n),u=F(n),c=I(M?n:g),f=c!==void 0?void 0:M?u:H(g,{today:$().day,time:t,...u?{base:u}:{},...s?{locale:s}:{}}),re=M?n:c!==void 0?c:f?P(f,{time:t,instant:i}):void 0,v=g.trim()==="",m=!v&&f===void 0&&c===void 0;(0,r.useEffect)(()=>{p.current?.setCustomValidity(m?`Not a date this reads \u2014 ${E}`:"")},[m]);let z=e=>{L(e),J(e)},oe=e=>{D(e);let a=I(e);if(a!==void 0)return z(a);let l=e.trim()===""?void 0:H(e,{today:$().day,time:t,...u?{base:u}:{},...s?{locale:s}:{}});z(l?P(l,{time:t,instant:i}):void 0)},ae=e=>{let a=t?{day:e,minutes:f?.minutes??u?.minutes??540}:{day:e},l=P(a,{time:t,instant:i});D(C(l)),z(l),w(!1),requestAnimationFrame(()=>{p.current?.focus(),p.current?.select()})},ie=v?`Type a date, or pick one \u2014 ${E}`:m?`Not a date this reads \u2014 ${E}`:c!==void 0?`${V(c,s)} (${c.length===4?"a year":"a month"} alone)`:f?`${_(f,t,s,!0)}${d?` ${d.short}`:""}`:"";return(0,o.jsxs)("span",{"data-graview-when":t?i?"instant":"moment":"day",style:{display:"inline-flex",flex:"1 1 14rem",flexWrap:"wrap",alignItems:"center",gap:"4px 6px",maxWidth:"100%",minWidth:0},onBlur:e=>{let a=e.relatedTarget;a&&e.currentTarget.contains(a)||!a&&typeof document<"u"&&!document.hasFocus()||(w(!1),Q?.(re))},children:[(0,o.jsx)("input",{ref:e=>{p.current=e,typeof W=="function"?W(e):W&&(W.current=e)},type:"text",name:x,required:h,autoFocus:G,"aria-label":y,"aria-describedby":`${k}-said`,"aria-invalid":m||void 0,autoComplete:"off",spellCheck:!1,enterKeyHint:"done",placeholder:t?"tomorrow 3pm":"17 Oct",value:g,"data-graview-part":"control",onChange:e=>oe(e.target.value),onKeyDown:e=>{e.key==="Escape"?(e.preventDefault(),X?.()):e.key==="ArrowDown"&&e.altKey&&(e.preventDefault(),w(!0))},style:{flex:"1 1 12ch",minWidth:"10ch",maxWidth:"100%",boxSizing:"border-box",font:"inherit",...Y}}),(0,o.jsx)("button",{ref:O,type:"button","aria-label":`Pick a date for ${y}`,"aria-expanded":R,"aria-controls":`${k}-month`,"data-graview-part":"when-pick",onClick:()=>w(e=>!e),onPointerEnter:()=>U.prefetch(),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:32,minHeight:32,padding:0,borderRadius:6},children:(0,o.jsxs)("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.4",children:[(0,o.jsx)("rect",{x:"2",y:"3",width:"12",height:"11",rx:"1.5"}),(0,o.jsx)("path",{d:"M2 6.5h12M5.5 1.5v3M10.5 1.5v3"})]})}),(0,o.jsxs)("span",{id:`${k}-said`,"aria-live":"polite","data-graview-part":"when-said",...d?{"data-graview-zone":d.zone,title:`Times are in ${d.zone.replace(/_/g," ")} (${d.short})`}:{},style:{flexBasis:"100%",fontSize:"0.75rem",color:m?"var(--graview-bad)":"var(--graview-ink-faint)"},children:[ie,d&&!m&&!v?(0,o.jsx)("span",{"data-graview-part":"when-zone",children:` \xB7 ${(d.zone.split("/").at(-1)??d.zone).replace(/_/g," ")} time`}):null]}),R?(0,o.jsx)(r.Suspense,{fallback:null,children:(0,o.jsx)(U.Part,{id:`${k}-month`,label:y,selected:f?.day??u?.day,today:$().day,locale:s,onPick:ae,onClose:()=>{w(!1),O.current?.focus()}})}):null]})}export{me as WhenInput,_ as wallAsRead};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h,i as E}from"./chunk.
|
|
1
|
+
import{h,i as E}from"./chunk.EQTSV7BK.js";import{a as M,f as z}from"./chunk.27CW6SCT.js";import{$b as q,Aa as j,C as y,Ha as O,Qb as N,Sa as P,Ta as D,Xc as K,Yc as k,Zb as T,_b as Z,ac as v,da as S,db as L,tb as V,ub as I,vb as g,xa as R}from"./chunk.7BBGRTXM.js";var J=n=>n.safeParse?.(void 0).success??!1,C=n=>h(n).shape,A=n=>{let r=h(n);if(y(r)?.type!=="literal")return;let o=y(r)?.values;return o&&o.length===1&&typeof o[0]=="string"?o[0]:void 0};function F(n,r){let o=J(r),e=h(r),t=y(e)?.type,c=N(r);if(c)return{control:"node",name:n,optional:o,kinds:c};let m=O(r);if(m)return{control:"linked",name:n,optional:o,relation:m};if(D(r)){let d=P(n);return{control:"repeat",name:n,optional:o,...d?{of:d}:{}}}if(t==="boolean")return{control:"boolean",name:n,optional:o};let f=R(e);if(f)return{control:"file",name:n,optional:o,...f==="image"?{image:!0}:f==="video"?{video:!0}:{}};if(t==="object"){let d=e.shape??{};return{control:"group",name:n,optional:o,fields:Object.entries(d).map(([a,l])=>F(a,l))}}if(t==="union"){let d=y(e)?.options??[],a=d.map(s=>C(s));if(a.every(s=>s!==void 0)){let s=Object.keys(a[0]??{}).find(u=>a.every(p=>A(p?.[u])!==void 0));if(s)return{control:"variant",name:n,optional:o,tag:s,options:d.map((u,p)=>({value:A(a[p]?.[s])??"",fields:Object.entries(a[p]??{}).filter(([w])=>w!==s).map(([w,B])=>F(w,B))}))}}let l=d.map(s=>A(s));return l.every(s=>s!==void 0)?{control:"choice",name:n,optional:o,options:l}:{control:"opaque",name:n,optional:o}}if(t==="array"){let d=y(e)?.element;return d!==void 0?{control:"list",name:n,optional:o,item:F(n,d)}:{control:"opaque",name:n,optional:o}}let i=E(r);return i.type==="text"?{control:"text",name:n,optional:o,...i.long?{long:!0}:{},...j(e)?{app:!0}:{},...M(e)?{markdown:!0}:{},...i.holds?{holds:i.holds}:{}}:i.type==="number"&&i.duration?{control:"text",name:n,optional:o,holds:"duration"}:i.type==="date"?{control:"date",name:n,optional:o,...i.time?{time:!0}:{},...i.instant?{instant:!0}:{},...i.partial?{partial:!0}:{}}:i.type==="number"?{control:"number",name:n,optional:o,...i.min===void 0?{}:{min:i.min},...i.max===void 0?{}:{max:i.max},...i.step===void 0?{}:{step:i.step},...i.amount?{amount:i.amount}:{}}:i.type==="choice"?{control:"choice",name:n,optional:o,options:i.options}:{control:"opaque",name:n,optional:o}}function H(n){let r=n.shape;return r?Object.entries(r).map(([o,e])=>F(o,e)):[]}function W(n,r){let o={...r};for(let e of n){let t=r[e.name];t===void 0&&!e.optional&&(e.control==="list"||e.control==="boolean")&&(o[e.name]=e.control==="list"?[]:!1),e.control==="text"&&e.holds&&typeof t=="string"&&(o[e.name]=t.trim()===""?void 0:e.holds==="duration"?z(t)??t:t.trim()),e.control==="group"&&t!==void 0&&typeof t=="object"&&t!==null&&(o[e.name]=W(e.fields,t))}return o}function G(n,r){return Z(H(r.input),T(n,r))}var x="visitor";function gn(n,r,o,e){let t=K.keptFrom?.(n,r),c=new Set;if(!t)return c;let m=Object.keys(o.input.shape??{});for(let a of o.creates??[]){let l=t({id:"\0new",kind:a});for(let s of m)l?.(s)&&c.add(s)}let f=e===void 0?void 0:n.graph.getNode(e),i=f&&n.schema.tryDefinition(f.kind),d=f&&t(f);if(i&&d)for(let a of v(o,i))d(a)&&m.includes(a)&&c.add(a);return c}function _(n,r,o,e){let t=new Set,c=r?.sees??[];if(I(o)||!c.some(k))return t;let m=V(o),f=(l,s)=>{let u=c.filter(p=>p.kinds.includes(l)&&g(p,m));return u.some(k)?L.has(s)||u.some(p=>!k(p)||(p.fields===void 0||p.fields.includes(s))&&!p.hide?.includes(s)):!0},i=Object.keys(e.input.shape??{}),d=new Map,a=(l,s)=>d.set(l,d.get(l)===!0||s);for(let l of e.creates??[]){let s=Object.keys(n.tryDefinition(l)?.fields.shape??{});for(let u of i)s.includes(u)&&a(u,f(l,u))}for(let l of q(n,e)){let s=n.tryDefinition(l);if(s)for(let u of v(e,s))i.includes(u)&&a(u,f(l,u))}for(let[l,s]of d)s||t.add(l);return t}var $=(n,r)=>r.title??S(n);function Q(n,r,o){let e=n?.sees;return!e||e.length===0?!0:e.some(t=>t.kinds.includes(o)&&g(t,r)&&!t.own&&!t.via)}function b(n){switch(n.control){case"node":return[n];case"group":return n.fields.flatMap(b);case"variant":return n.options.flatMap(r=>r.fields.flatMap(b));case"list":return b(n.item);default:return[]}}function U(n,r,o,e){return e.has(o.name)?!1:b(o).every(t=>t.kinds.some(c=>c!=="*"&&Q(n,r,c)))}var X=n=>({kind:"human",id:"form:",roles:[n]});function vn(n,r,o=n.mutations??[]){let e=n.forms?.[r];if(!e)return;let t=o.find(a=>a.name===e.act);if(!t)return;let c=e.role??x,m=X(c),f=_(n.schema,n.policy,m,t),i=G(n.schema,t),d=e.fields?e.fields.flatMap(a=>i.find(l=>l.name===a)??[]):i.filter(a=>U(n.policy,m,a,f));return{name:r,title:$(r,e),...e.intro?{intro:e.intro}:{},...e.say?{say:e.say}:{},submit:e.submit??t.title??S(t.name),role:c,act:t,fields:d}}function An(n,r,o){let e=n.forms?.[r];if(!e)throw new Error(`There is no form called "${r}"${n.forms?`: the forms are ${Object.keys(n.forms).join(", ")}`:": the app declares none"}.`);return{kind:"visitor",id:o,name:`a visitor via the ${$(r,e)} form`,roles:[e.role??x]}}function xn(n){return{said:"Received \u2014 thank you.",...n.say?{next:n.say}:{}}}export{H as a,W as b,G as c,gn as d,_ as e,vn as f,An as g,xn as h};
|