graview 0.1.33 → 0.1.34
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.7GKUVQVF.js → chunk.2UPGH6FT.js} +1 -1
- package/dist/preview/{chunk.I6FPNX43.js → chunk.2YCFK5HU.js} +1 -1
- package/dist/preview/{chunk.4HZ7QTXZ.js → chunk.2YGQVI6T.js} +1 -1
- package/dist/preview/{chunk.3K6YSVHC.js → chunk.34CYK2DF.js} +1 -1
- package/dist/preview/{chunk.3TVXGJTU.js → chunk.35KI7XYV.js} +1 -1
- package/dist/preview/{chunk.COQKECUH.js → chunk.3C4RJIJU.js} +1 -1
- package/dist/preview/{chunk.TAQ764IQ.js → chunk.3H4NVUWV.js} +1 -1
- package/dist/preview/{chunk.K5ME5GCG.js → chunk.3MWBWSYF.js} +1 -1
- package/dist/preview/{chunk.MAF7C3VM.js → chunk.4K5QCJFH.js} +1 -1
- package/dist/preview/{chunk.ULRW47RP.js → chunk.52QAIGCD.js} +1 -1
- package/dist/preview/{chunk.D75KC3LL.js → chunk.577PGFUT.js} +1 -1
- package/dist/preview/{chunk.EBGAYL32.js → chunk.5EAQDBBE.js} +1 -1
- package/dist/preview/{chunk.4MERAWS2.js → chunk.6A62UVAE.js} +1 -1
- package/dist/preview/{chunk.7T7NZZTC.js → chunk.6FBQP336.js} +1 -1
- package/dist/preview/{chunk.EF3XNU4O.js → chunk.6K2HASOH.js} +1 -1
- package/dist/preview/chunk.6P7P2AW7.js +1 -0
- package/dist/preview/{chunk.LXBOVRFI.js → chunk.6VRJII5M.js} +1 -1
- package/dist/preview/{chunk.VG3O4LWB.js → chunk.6XO4PECH.js} +1 -1
- package/dist/preview/{chunk.GYICGZMG.js → chunk.7HPPJVIV.js} +2 -2
- package/dist/preview/{chunk.PIP6Z563.js → chunk.7JNDZWD6.js} +1 -1
- package/dist/preview/{chunk.6UGEYZAC.js → chunk.7MTX33WD.js} +1 -1
- package/dist/preview/{chunk.ASCLIM2P.js → chunk.7VUPKOKC.js} +1 -1
- package/dist/preview/{chunk.AR3DCDHU.js → chunk.7WHWD5YJ.js} +1 -1
- package/dist/preview/{chunk.3NDH3EDN.js → chunk.7X2ZO5BD.js} +1 -1
- package/dist/preview/{chunk.XNJEFUF7.js → chunk.AHCI7ZDO.js} +1 -1
- package/dist/preview/{chunk.4HNG4UXT.js → chunk.APNN6BKF.js} +1 -1
- package/dist/preview/{chunk.XBJYQNVE.js → chunk.B2WRXGFI.js} +1 -1
- package/dist/preview/{chunk.HLTRQU4Y.js → chunk.B6VI576I.js} +1 -1
- package/dist/preview/{chunk.NTF7FVB2.js → chunk.BU2DSZ2L.js} +1 -1
- package/dist/preview/{chunk.T5VG5A6V.js → chunk.CNMITOKP.js} +1 -1
- package/dist/preview/chunk.CPW465TM.js +1 -0
- package/dist/preview/{chunk.47STJVRV.js → chunk.CZRX2FDI.js} +1 -1
- package/dist/preview/{chunk.GV2CQVKV.js → chunk.DMNXYMLC.js} +1 -1
- package/dist/preview/{chunk.IWQCOGHW.js → chunk.DNDHDDM6.js} +2 -2
- package/dist/preview/{chunk.MWGGV7DE.js → chunk.DUUARGPE.js} +1 -1
- package/dist/preview/chunk.E7EQ2VTE.js +1 -0
- package/dist/preview/{chunk.UHUGOTUU.js → chunk.ETWVQ3A2.js} +1 -1
- package/dist/preview/{chunk.BNV77BQZ.js → chunk.F6WYSDSI.js} +3 -3
- package/dist/preview/{chunk.FWTIUYXH.js → chunk.FBY5IUGU.js} +1 -1
- package/dist/preview/{chunk.UATVTXZY.js → chunk.FCRFQ7ZW.js} +1 -1
- package/dist/preview/chunk.FRS3S7DN.js +1 -0
- package/dist/preview/{chunk.UGFJKSHU.js → chunk.FSAHO3LV.js} +1 -1
- package/dist/preview/{chunk.JQU5GEU3.js → chunk.FUQVNXLB.js} +1 -1
- package/dist/preview/{chunk.JDUJDAGA.js → chunk.G64AREGA.js} +1 -1
- package/dist/preview/{chunk.CN3UEF5N.js → chunk.GMOTRAKJ.js} +1 -1
- package/dist/preview/chunk.GNSAKLP2.js +1 -0
- package/dist/preview/{chunk.RCKTBOY2.js → chunk.HCDKSDIS.js} +1 -1
- package/dist/preview/chunk.HH6P4BLT.js +1 -0
- package/dist/preview/{chunk.AOSMJKLH.js → chunk.HJ56Q6WB.js} +1 -1
- package/dist/preview/chunk.HP3ZEDCD.js +117 -0
- package/dist/preview/{chunk.G5NZVPJU.js → chunk.HPD5ZDZH.js} +1 -1
- package/dist/preview/chunk.HPEGQN6E.js +1 -0
- package/dist/preview/chunk.HUKAVTMX.js +1 -0
- package/dist/preview/chunk.HWITWOP3.js +3 -0
- package/dist/preview/{chunk.3TY5NFLY.js → chunk.IHFNLKXV.js} +1 -1
- package/dist/preview/{chunk.2NIOHEMX.js → chunk.JQDYGI6G.js} +1 -1
- package/dist/preview/chunk.JZBBGY4B.js +1 -0
- package/dist/preview/chunk.KA3KI4UA.js +1 -0
- package/dist/preview/{chunk.HAIG6NVX.js → chunk.LAF6GTBN.js} +1 -1
- package/dist/preview/{chunk.UNL2HIF2.js → chunk.LCFDM7XY.js} +1 -1
- package/dist/preview/{chunk.E2YEOMPH.js → chunk.LIIC25G6.js} +1 -1
- package/dist/preview/chunk.M5HADQPP.js +1 -0
- package/dist/preview/chunk.MWJUZG3C.js +6 -0
- package/dist/preview/chunk.OMMKD2NU.js +2 -0
- package/dist/preview/{chunk.JOOQUWLT.js → chunk.PNVR3CXR.js} +2 -2
- package/dist/preview/{chunk.PBSMLINK.js → chunk.PPUAPAWR.js} +1 -1
- package/dist/preview/{chunk.SYAEBGDC.js → chunk.PW7YH6JV.js} +1 -1
- package/dist/preview/{chunk.OC6IWRQ3.js → chunk.Q7TP4RFE.js} +1 -1
- package/dist/preview/{chunk.CIPS2OGR.js → chunk.QPAUQJON.js} +1 -1
- package/dist/preview/{chunk.UZGRRDHD.js → chunk.QU356VB2.js} +1 -1
- package/dist/preview/chunk.QVKKXMNK.js +1 -0
- package/dist/preview/{chunk.3AGY4QVS.js → chunk.QVUL2FSI.js} +1 -1
- package/dist/preview/chunk.RH45AW2W.js +1 -0
- package/dist/preview/{chunk.6YCBYL2Y.js → chunk.RIW7SQH4.js} +1 -1
- package/dist/preview/{chunk.H7EPE74C.js → chunk.RN3EZVV4.js} +1 -1
- package/dist/preview/{chunk.3HXN4BOY.js → chunk.RYEAMM73.js} +1 -1
- package/dist/preview/{chunk.YIR7PPF3.js → chunk.SIH6RCAI.js} +1 -1
- package/dist/preview/{chunk.NRAYZY3X.js → chunk.T2L4NPSB.js} +1 -1
- package/dist/preview/{chunk.TMVCTBAD.js → chunk.T3M4FALL.js} +5 -5
- package/dist/preview/{chunk.CX3KL2C5.js → chunk.TCSZZAYB.js} +1 -1
- package/dist/preview/chunk.TPX6AVJL.js +1 -0
- package/dist/preview/{chunk.5UL7YDUD.js → chunk.U5ACEYAN.js} +1 -1
- package/dist/preview/{chunk.5T5XGILP.js → chunk.UA5UYINM.js} +1 -1
- package/dist/preview/{chunk.GO4XBWJO.js → chunk.UCIQIPBQ.js} +1 -1
- package/dist/preview/{chunk.EKPRNDUV.js → chunk.UHQD3NTK.js} +1 -1
- package/dist/preview/{chunk.RIJUCHP4.js → chunk.VKH3ZPPQ.js} +1 -1
- package/dist/preview/{chunk.UBFNZMUX.js → chunk.VMGWYCXU.js} +1 -1
- package/dist/preview/chunk.VOFUIWAX.js +27 -0
- package/dist/preview/{chunk.DYSPCGXX.js → chunk.VSOB2QEK.js} +1 -1
- package/dist/preview/{chunk.R6K6GF5R.js → chunk.VZHV25JE.js} +1 -1
- package/dist/preview/chunk.WAB6ZS2V.js +1 -0
- package/dist/preview/chunk.WLBXBNNH.js +1 -0
- package/dist/preview/chunk.WPCGHGDA.js +1 -0
- package/dist/preview/{chunk.QYZNAUIR.js → chunk.WYEYYCBH.js} +1 -1
- package/dist/preview/{chunk.MNP4JI33.js → chunk.X7W27IRI.js} +4 -4
- package/dist/preview/{chunk.J25KOSNW.js → chunk.XK4FVT2X.js} +1 -1
- package/dist/preview/{chunk.CWHRDBOF.js → chunk.XXMYKBLT.js} +1 -1
- package/dist/preview/{chunk.CDP2XL66.js → chunk.XZYJRNRY.js} +1 -1
- package/dist/preview/chunk.YCIX53AR.js +1 -0
- package/dist/preview/chunk.YEYY273R.js +1 -0
- package/dist/preview/{chunk.EJPI3ST6.js → chunk.YJCT3DV2.js} +1 -1
- package/dist/preview/chunk.YT2CYCVT.js +1 -0
- package/dist/preview/{chunk.B2GLDIAS.js → chunk.Z7ZCR4LN.js} +1 -1
- package/dist/preview/{chunk.CAVBSL27.js → chunk.ZE4CTZQ3.js} +1 -1
- package/dist/preview/chunk.ZFWV4JAJ.js +1 -0
- package/dist/preview/{chunk.5H4VXLZF.js → chunk.ZJX6ZKKM.js} +1 -1
- package/dist/preview/chunk.ZPQKAJRI.js +1 -0
- package/dist/preview/{chunk.OKRNJXTV.js → chunk.ZSW74NVJ.js} +1 -1
- package/dist/preview/chunk.ZTD2CNC3.js +25 -0
- package/dist/preview/{chunk.QVVJRSRM.js → chunk.ZTFW7RKP.js} +1 -1
- package/dist/preview/index.html +42 -42
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.26LLZN3C.js +0 -1
- package/dist/preview/chunk.2WPZXIRP.js +0 -2
- package/dist/preview/chunk.4HRAQNJO.js +0 -27
- package/dist/preview/chunk.52W7WYME.js +0 -1
- package/dist/preview/chunk.63GXY2ME.js +0 -1
- package/dist/preview/chunk.67TPUXAY.js +0 -1
- package/dist/preview/chunk.6QWV5MVH.js +0 -25
- package/dist/preview/chunk.AKFKM4SW.js +0 -3
- package/dist/preview/chunk.BHXGM3PV.js +0 -1
- package/dist/preview/chunk.BQ3JHEHV.js +0 -1
- package/dist/preview/chunk.DAZ2VSRD.js +0 -1
- package/dist/preview/chunk.ERIT3R6N.js +0 -1
- package/dist/preview/chunk.EYTBDMTW.js +0 -1
- package/dist/preview/chunk.GBRRGTIH.js +0 -1
- package/dist/preview/chunk.H7BST3XO.js +0 -1
- package/dist/preview/chunk.IDVAR5HM.js +0 -1
- package/dist/preview/chunk.KSES5U5B.js +0 -1
- package/dist/preview/chunk.LR3VDXPI.js +0 -1
- package/dist/preview/chunk.N6OX4NEQ.js +0 -1
- package/dist/preview/chunk.PHKSMUIA.js +0 -1
- package/dist/preview/chunk.SHTJZ6UX.js +0 -1
- package/dist/preview/chunk.UVR2Z5ZC.js +0 -1
- package/dist/preview/chunk.WAZ7OGBD.js +0 -1
- package/dist/preview/chunk.XANVHJQ4.js +0 -1
- package/dist/preview/chunk.XKABS745.js +0 -1
- package/dist/preview/chunk.XMC7YDWT.js +0 -1
- package/dist/preview/chunk.Y2SFUALD.js +0 -117
- package/dist/preview/chunk.Y6ZNFQK3.js +0 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as S,b as $,c as w,d as R,e as V}from"./chunk.FWTIUYXH.js";import{h as l,i as F}from"./chunk.MAF7C3VM.js";import{wa as b,xa as A}from"./chunk.MNP4JI33.js";var O=["card","row","page"],E=["good","warn","bad","neutral","accent"],P=["money","percent","date","relative","count"],_=4,T=40,I=120,L=["number","money","percent"],B=["large"],H=["card","row"],M=1e3,ue=100;function U(e){let n=/^\s*(out|in)\(\s*['"]([A-Za-z][A-Za-z0-9_-]*)['"]\s*\)\s*$/.exec(e);return n?{edge:n[2],way:n[1]}:/^[A-Za-z][A-Za-z0-9_-]*$/.test(e)?{edge:e}:void 0}var v={title:[],headline:[],list:["sort","limit","group","empty","as"],text:["tone"],badge:["tone"],field:["as","currency","label"],image:["as","label"],progress:["label"],group:["direction"],when:["show"],divider:[],figure:["as","currency","label","emphasis"]},C=Object.keys(v),G=`{"title": "{name}"}, {"headline": "{count(all('offer'))} offers"}, {"figure": expr, "as"?: "number"|"money"|"percent", "currency"?, "label"?, "emphasis"?: "large"}, {"list": expr, "sort"?, "limit"?, "group"?, "empty"?, "as"?: "card"|"row"}, {"text": "\u2026", "tone"?}, {"badge": "{status}", "tone"?}, {"field": "quote", "as"?, "currency"?, "label"?}, {"image": "photos", "as"?: "thumb"|"gallery"}, {"progress": {"value": expr, "max": expr}, "label"?}, {"group": [blocks], "direction"?: "row"|"column"}, {"when": expr, "show": [blocks]}, {"divider": true}, {"figure": true}`,Z=e=>/^(image|file)$/.test(e?.of??e?.type??"");function fe(e){return Object.fromEntries(Object.entries(e.views??{}).filter(([,n])=>!Array.isArray(n)))}function ce(e){let n=e.views?.home;return Array.isArray(n)?n:void 0}var X={field:()=>!1,relation:()=>!1,figure:!1},Y=e=>e.kind??"the home",p=(e,n)=>e!==void 0&&Object.hasOwn(e,n),g=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function z(e,n,o){let t=S(e);for(let d of t.unknownFunctions)o.findings.push(l("unknown-function",n,`"${d}" is not a function the rule language knows`,"see docs/declaration-document.md#expression-language"));for(let d of t.names){if(o.kind===null){o.findings.push(l("view-name",n,`"${d}" names nothing here: these blocks are about no one record`,"reach records with all('<kind>'), like count(all('offer')) or first(all('party') where role == 'client').name"));continue}d==="id"||o.spec.field(d)||o.spec.relation(d)||o.findings.push(l("view-name",n,`${o.kind} has no field or relation called "${d}"`))}for(let d of t.edges)o.edges.has(d)||o.findings.push(l("view-edge",n,`"${d}" is not a relation any kind declares`));for(let d of t.sweeps)o.kinds.has(d)||o.findings.push(l("view-kind",n,`"${d}" is not a kind this document declares`))}function k(e,n,o){if(typeof e!="string"||e.length===0||e.length>2e3){o.findings.push(l("view-expression",n,`an expression is a line of the rule language, like "status == 'booked'"`));return}try{z(w(e),n,o)}catch(t){if(!(t instanceof $))throw t;o.findings.push(l("expression",n,`${t.sentence} (at character ${t.at+1})`))}}function j(e,n,o,t=!1){if(typeof e!="string"||e.length===0||e.length>300){o.findings.push(l("view-template",n,'a template is words with {field} in braces, like "{name}" or "{quote|money}", at most 300 characters'));return}let d;try{d=V(e)}catch(a){if(a instanceof R||a instanceof $){o.findings.push(l("template",n,a.sentence));return}throw a}for(let a of d)if(a.expr&&(z(a.expr,n,o),t&&!a.format&&a.expr.t==="ident"&&(o.slot==="card"||o.slot==="row")&&o.spec.prose?.(a.expr.name))){let r=a.expr.name;o.findings.push(F("view-whole-text",n,`${o.kind} ${o.slot} shows ${r} whole; it will be clamped. Use {${r}|excerpt} or move it to the page.`,`write {${r}|excerpt}, or {${r}|excerpt: 80} for fewer characters`))}}function q(e,n,o){if(typeof e=="string"){E.includes(e)||o.findings.push(l("view-tone",n,`"${e}" is not a tone`,`use one of ${E.join(", ")}, or {"expr": "if(status == 'booked', 'good', 'neutral')"}`));return}if(g(e)&&Object.keys(e).length===1&&"expr"in e){k(e.expr,`${n}.expr`,o);return}o.findings.push(l("view-tone",n,'a tone is a word or {"expr": \u2026}',`one of ${E.join(", ")}`))}function x(e,n,o,t){if(!Array.isArray(e)){t.findings.push(l("view-shape",n,"a view is a list of blocks"));return}if(o>_){t.findings.push(l("view-depth",n,`blocks nest at most ${_} deep`,"flatten a group or a condition"));return}e.forEach((d,a)=>J(d,`${n}.${a}`,o,t))}function J(e,n,o,t){if(o===1&&t.count++,t.all++,!g(e)){t.findings.push(l("view-block",n,"a block is an object naming what it shows",`one of ${G}`));return}let d=Object.keys(e),a=d.filter(s=>C.includes(s)&&!(s==="group"&&d.includes("list")));if(a.length===0){t.findings.push(l("view-block",n,`${d.length>0?d.map(s=>`"${s}"`).join(", "):"an empty object"} is not a block Graview knows`,`one of ${G}`));return}if(a.length>1){t.findings.push(l("view-block",n,`a block is one thing, and this says ${a.map(s=>`"${s}"`).join(" and ")}`,"split it into two blocks"));return}let r=a[0];for(let s of d)s!==r&&s!="key"&&!v[r].includes(s)&&t.findings.push(l("unknown-key",`${n}.${s}`,`"${s}" is not part of a ${r} block`,v[r].length>0?`a ${r} block may also say ${v[r].map(u=>`"${u}"`).join(", ")}`:`a ${r} block says nothing else`));let i=e[r];switch(r){case"title":case"headline":case"text":case"badge":j(i,`${n}.${r}`,t,r==="text"),"tone"in e&&q(e.tone,`${n}.tone`,t);return;case"image":case"field":{let s=r==="image";if(typeof i!="string"||!(s?t.spec.files?.(i):t.spec.field(i))){let f=typeof i=="string"&&t.spec.relation(i);t.findings.push(l(`view-${r}`,`${n}.${r}`,`${t.kind} has no ${s?"image or file ":""}field ${typeof i=="string"?`"${i}"`:"by that name"}`,f?`"${i}" is a relation; show it with {"text": "{${i}.name}"}`:void 0))}let u=s?["thumb","gallery"]:P;"as"in e&&!u.includes(e.as)&&t.findings.push(l("view-format",`${n}.as`,`"${String(e.as)}" is not a way to show ${s?"pictures":"a field"}`,`use one of ${u.join(", ")}`)),s||N(e,n,t,"field"),"label"in e&&ie(e.label,`${n}.label`,t);return}case"progress":{!g(i)||Object.keys(i).some(s=>s!=="value"&&s!=="max")||!("value"in i)||!("max"in i)?t.findings.push(l("view-progress",`${n}.progress`,'progress is {"value": expression, "max": expression}')):(k(i.value,`${n}.progress.value`,t),k(i.max,`${n}.progress.max`,t)),"label"in e&&j(e.label,`${n}.label`,t);return}case"group":"direction"in e&&e.direction!=="row"&&e.direction!=="column"&&t.findings.push(l("view-direction",`${n}.direction`,`a group runs "row" or "column", not "${String(e.direction)}"`)),x(i,`${n}.group`,o+1,t);return;case"when":k(i,`${n}.when`,t),"show"in e?x(e.show,`${n}.show`,o+1,t):t.findings.push(l("view-when",n,'a condition says what it shows: {"when": expr, "show": [blocks]}'));return;case"figure":if(typeof i=="string")return Q(e,n,t);for(let s of["as","currency","label","emphasis"])s in e&&t.findings.push(l("unknown-key",`${n}.${s}`,`"${s}" belongs to a figure that works a number out; {"figure": true} is the kind's picture`,`write {"figure": "count(all('offer'))", "as": "number"}`));i!==!0?t.findings.push(l("view-block",`${n}.figure`,`a figure is a number worked out, {"figure": "sum(all('offer'), net)", "as": "money"}, or the kind's picture, {"figure": true}`)):t.spec.figure||t.findings.push(l("view-figure",`${n}.figure`,`${Y(t)} has no figure to show`,t.kind===null?`work a number out: {"figure": "count(all('offer'))"}`:'give the kind a "figure", or leave this block out'));return;case"list":return ne(e,n,t);case"divider":i!==!0&&t.findings.push(l("view-block",`${n}.${r}`,`write {"${r}": true}`));return}}function Q(e,n,o){k(e.figure,`${n}.figure`,o),"as"in e&&!L.includes(e.as)&&o.findings.push(l("view-format",`${n}.as`,`"${String(e.as)}" is not a way to say a figure`,`use one of ${L.join(", ")}`)),N(e,n,o,"figure"),"label"in e&&j(e.label,`${n}.label`,o),"emphasis"in e&&!B.includes(e.emphasis)&&o.findings.push(l("view-emphasis",`${n}.emphasis`,`"${String(e.emphasis)}" is not how loudly a figure is said`,`use ${B.map(t=>`"${t}"`).join(", ")}, or leave it out for the figure's own size`))}function N(e,n,o,t){"currency"in e&&(typeof e.currency!="string"||!/^[A-Z]{3}$/.test(e.currency)?o.findings.push(l("view-currency",`${n}.currency`,'a currency is its three-letter code, like "USD" or "EUR"')):e.as!=="money"&&o.findings.push(l("view-currency",`${n}.currency`,`a currency belongs on a ${t} shown as money`,'add "as": "money"')))}function ee(e,n){let o=[...n.kinds],t=(a,r)=>{let i=new Set;for(let s of a){let u=n.vocabulary.namesOf(s)?.targets?.(r);if(u==="*")return o;for(let f of u??[])i.add(f)}return i.size>0?[...i]:void 0},d=a=>{switch(a.t){case"ident":return n.kind!==null&&n.spec.relation(a.name)?t([n.kind],a.name):void 0;case"member":{let r=d(a.object);return r?t(r,a.name):void 0}case"where":return d(a.set);case"call":{let r=a.args[0],i=r?.t==="lit"&&typeof r.value=="string"?r.value:void 0;if(a.fn==="all")return i!==void 0&&n.kinds.has(i)?[i]:void 0;let s=a.args.length===2&&a.args[1]?.t==="lit"&&typeof a.args[1].value=="string"?a.args[1].value:void 0;if(a.fn==="out"&&s!==void 0){let u=d(r);return u?t(u,s):void 0}if(a.fn==="out")return i!==void 0&&n.kind!==null?t([n.kind],i):void 0;if(a.fn==="in"){let u=s??i,f=s!==void 0?d(r):n.kind!==null?[n.kind]:void 0,c=u!==void 0?n.vocabulary.sources(u).filter(m=>{let y=n.vocabulary.namesOf(m)?.targets?.(u);return!f||y==="*"||f.some(h=>y?.includes(h))}):[];return c.length>0?c:void 0}if((a.fn==="sort"||a.fn==="first")&&r)return d(r);if(a.fn==="either"){let u=a.args.map(d);return u.every(f=>f!==void 0)?[...new Set(u.flatMap(f=>f??[]))]:void 0}return}default:return}};return d(e)}function K(e,n,o,t){let d;try{d=w(e)}catch(r){if(!(r instanceof $))throw r;t.findings.push(l("expression",n,`${r.sentence} (at character ${r.at+1})`));return}let a=S(d);for(let r of a.unknownFunctions)t.findings.push(l("unknown-function",n,`"${r}" is not a function the rule language knows`,"see docs/declaration-document.md#expression-language"));for(let r of a.edges)t.edges.has(r)||t.findings.push(l("view-edge",n,`"${r}" is not a relation any kind declares`));if(o)for(let r of a.names)r==="id"||o.some(i=>t.vocabulary.namesOf(i)?.field(r)||t.vocabulary.namesOf(i)?.relation(r))||t.findings.push(l("view-name",n,`${o.join(" and ")} ${o.length===1?"has":"have"} no field or relation called "${r}"`))}function ne(e,n,o){let t=e.list;k(t,`${n}.list`,o);let d;if(typeof t=="string")try{d=ee(w(t),o)}catch{d=void 0}let a=i=>{if(!d)return[...o.kinds].map(u=>o.vocabulary.namesOf(u)?.choices?.(i)).find(u=>u!==void 0);let s=d.map(u=>o.vocabulary.namesOf(u)?.choices?.(i));return s.every(u=>u!==void 0)?[...new Set(s.flatMap(u=>u??[]))]:void 0},r=d?d.join(" and "):"any kind";if("sort"in e){let i=e.sort;if(typeof i=="string")K(i,`${n}.sort`,d,o);else if(g(i)&&typeof i.by=="string"&&Object.keys(i).every(s=>s==="by"||s==="direction")){let s=i.direction;s!==void 0&&s!=="asc"&&s!=="desc"&&s!=="choices"?o.findings.push(l("list-sort",`${n}.sort.direction`,`a list is sorted "asc", "desc" or "choices", not "${String(s)}"`,'"choices" puts a choice field in the order its choices are declared')):s==="choices"?a(i.by)===void 0&&o.findings.push(l("list-sort",`${n}.sort.by`,`"${i.by}" is not a choice field of ${r}, so it has no declared order`,'sort by a choice field, or say "asc" or "desc"')):K(i.by,`${n}.sort.by`,d,o)}else o.findings.push(l("list-sort",`${n}.sort`,'a sort is a key, like "net", or {"by": key, "direction": "asc" | "desc" | "choices"}'))}if("limit"in e){let i=e.limit;(typeof i!="number"||!Number.isInteger(i)||i<1||i>M)&&o.findings.push(l("list-limit",`${n}.limit`,`a limit is a whole number from 1 to ${M}`))}if("group"in e){let i=e.group,s=typeof i=="string"?i:g(i)&&typeof i.by=="string"?i.by:void 0;if(!(typeof i=="string"||g(i)&&Object.keys(i).every(f=>f==="by"||f==="headings"))||s===void 0)o.findings.push(l("list-group",`${n}.group`,'a group is a choice field, like "type", or {"by": "type", "headings": {"pain": "What hurts"}} \u2014 or a relation, like "inGenre", a heading per linked record'));else{let f=a(s),c=f===void 0?U(s):void 0,m=c!==void 0&&(c.way!==void 0?o.edges.has(c.edge):d?d.every(y=>o.vocabulary.namesOf(y)?.relation(c.edge)):o.edges.has(c.edge));if(f===void 0&&!m&&o.findings.push(l("list-group",`${n}.group`,`"${s}" is not a choice field or a relation of ${r}, so it has nothing to group by`,'group by a field whose type is enum, or by a relation of the kind listed, like "inGenre"')),g(i)&&"headings"in i){let y=i.headings;if(!g(y)||Object.values(y).some(h=>typeof h!="string"||h.length===0||h.length>80))o.findings.push(l("list-group",`${n}.group.headings`,'headings are words per choice, like {"pain": "What hurts"}, at most 80 characters each'));else if(f)for(let h of Object.keys(y))f.includes(h)||o.findings.push(l("list-group",`${n}.group.headings.${h}`,`"${h}" is not one of ${s}'s choices`,`use ${f.join(", ")}`))}}}"empty"in e&&(typeof e.empty!="string"||e.empty.length===0||e.empty.length>200)&&o.findings.push(l("list-empty",`${n}.empty`,"what an empty list says is a sentence, at most 200 characters")),"as"in e&&!H.includes(e.as)&&o.findings.push(l("list-as",`${n}.as`,`a list draws each record as its "card" or its "row", not "${String(e.as)}"`))}function ie(e,n,o){(typeof e!="string"||e.length===0||e.length>60)&&o.findings.push(l("view-label",n,"a label is a few words, at most 60 characters"))}function W(e,n,o,t,d,a,r){let i={kind:null,spec:X,kinds:t,edges:d,vocabulary:o,findings:a,count:0,all:0};Array.isArray(e)&&e.length===0&&a.push(l("view-shape",n,`${r} has no blocks`,'give it one: {"headline": "\u2026"}')),x(e,n,1,i),D(i,n,r,"show less")}function D(e,n,o,t){e.count>T?e.findings.push(l("view-size",n,`${o} has ${e.count} blocks at its top; a view has at most ${T} there, a group or a condition counting as one`,`${t}, or gather some into a group`)):e.all>I&&e.findings.push(l("view-size",n,`${o} has ${e.all} blocks counting the ones inside its groups and conditions; a view has at most ${I} in all`,t))}function oe(e,n,o,t,d){Array.isArray(e)&&e.forEach((a,r)=>{if(!g(a)||a.name!=="blocks"||!g(a.options)||!("blocks"in a.options))return;let i=[];W(a.options.blocks,`lenses.${r}.options.blocks`,n,o,t,i,`the lens "${String(a.title??r)}"`);for(let s of i)d.push({...s,severity:"warning"})})}function te(e,n,o,t,d,a,r){let i=[];if(e===void 0)return i;if(!g(e))return i.push(l("view-shape",n,'views are an object of kinds, each with a "card", a "row" or a "page"')),i;for(let[s,u]of Object.entries(e)){if(s==="home"&&Array.isArray(u)){W(u,`${n}.home`,r,t,d,i,"the home");continue}let f=o(s);if(!f){i.push(l("view-kind",`${n}.${s}`,`"${s}" is not a kind this ${a} declares`));continue}if(!g(u)){i.push(l("view-shape",`${n}.${s}`,`a kind's views are {"card": [blocks], "row": [blocks], "page": [blocks]}`));continue}for(let c of Object.keys(u))O.includes(c)||i.push(l("view-slot",`${n}.${s}.${c}`,`"${c}" is not a place a view is drawn`,`use ${O.map(m=>`"${m}"`).join(", ")}`));for(let c of O){let m=u[c];if(m===void 0)continue;let y={kind:s,spec:f,kinds:t,edges:d,vocabulary:r,findings:i,count:0,all:0,slot:c};x(m,`${n}.${s}.${c}`,1,y),D(y,`${n}.${s}.${c}`,`this ${c}`,"show less, or move detail to the page")}}return i}function ge(e){let n=new Set(Object.keys(e.kinds)),o=new Set(Object.values(e.kinds).flatMap(r=>Object.keys(b(r.edges)))),t=r=>{let i=p(e.kinds,r)?e.kinds[r]:void 0;return i?{field:s=>p(i.fields,s)||p(i.computed,s)||A(i.edges).has(s),relation:s=>p(b(i.edges),s),figure:i.figure!==void 0,files:s=>p(i.fields,s)&&Z(i.fields[s]),choices:s=>p(i.fields,s)&&i.fields[s].type==="enum"?i.fields[s].options:void 0,targets:s=>p(b(i.edges),s)?i.edges[s].to:void 0,prose:s=>p(i.fields,s)&&i.fields[s].type==="text"}:void 0},d={namesOf:t,sources:r=>Object.keys(e.kinds).filter(i=>p(e.kinds[i].edges,r))},a=te(e.views,"views",t,n,o,"document",d);return oe(e.lenses,d,n,o,a),a}export{E as a,P as b,L as c,B as d,M as e,ue as f,U as g,fe as h,ce as i,ge as j};
|
|
1
|
+
import{a as S,b as $,c as w,d as R,e as V}from"./chunk.FBY5IUGU.js";import{h as l,i as F}from"./chunk.4K5QCJFH.js";import{wa as b,xa as A}from"./chunk.X7W27IRI.js";var O=["card","row","page"],E=["good","warn","bad","neutral","accent"],P=["money","percent","date","relative","count"],_=4,T=40,I=120,L=["number","money","percent"],B=["large"],H=["card","row"],M=1e3,ue=100;function U(e){let n=/^\s*(out|in)\(\s*['"]([A-Za-z][A-Za-z0-9_-]*)['"]\s*\)\s*$/.exec(e);return n?{edge:n[2],way:n[1]}:/^[A-Za-z][A-Za-z0-9_-]*$/.test(e)?{edge:e}:void 0}var v={title:[],headline:[],list:["sort","limit","group","empty","as"],text:["tone"],badge:["tone"],field:["as","currency","label"],image:["as","label"],progress:["label"],group:["direction"],when:["show"],divider:[],figure:["as","currency","label","emphasis"]},C=Object.keys(v),G=`{"title": "{name}"}, {"headline": "{count(all('offer'))} offers"}, {"figure": expr, "as"?: "number"|"money"|"percent", "currency"?, "label"?, "emphasis"?: "large"}, {"list": expr, "sort"?, "limit"?, "group"?, "empty"?, "as"?: "card"|"row"}, {"text": "\u2026", "tone"?}, {"badge": "{status}", "tone"?}, {"field": "quote", "as"?, "currency"?, "label"?}, {"image": "photos", "as"?: "thumb"|"gallery"}, {"progress": {"value": expr, "max": expr}, "label"?}, {"group": [blocks], "direction"?: "row"|"column"}, {"when": expr, "show": [blocks]}, {"divider": true}, {"figure": true}`,Z=e=>/^(image|file)$/.test(e?.of??e?.type??"");function fe(e){return Object.fromEntries(Object.entries(e.views??{}).filter(([,n])=>!Array.isArray(n)))}function ce(e){let n=e.views?.home;return Array.isArray(n)?n:void 0}var X={field:()=>!1,relation:()=>!1,figure:!1},Y=e=>e.kind??"the home",p=(e,n)=>e!==void 0&&Object.hasOwn(e,n),g=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function z(e,n,o){let t=S(e);for(let d of t.unknownFunctions)o.findings.push(l("unknown-function",n,`"${d}" is not a function the rule language knows`,"see docs/declaration-document.md#expression-language"));for(let d of t.names){if(o.kind===null){o.findings.push(l("view-name",n,`"${d}" names nothing here: these blocks are about no one record`,"reach records with all('<kind>'), like count(all('offer')) or first(all('party') where role == 'client').name"));continue}d==="id"||o.spec.field(d)||o.spec.relation(d)||o.findings.push(l("view-name",n,`${o.kind} has no field or relation called "${d}"`))}for(let d of t.edges)o.edges.has(d)||o.findings.push(l("view-edge",n,`"${d}" is not a relation any kind declares`));for(let d of t.sweeps)o.kinds.has(d)||o.findings.push(l("view-kind",n,`"${d}" is not a kind this document declares`))}function k(e,n,o){if(typeof e!="string"||e.length===0||e.length>2e3){o.findings.push(l("view-expression",n,`an expression is a line of the rule language, like "status == 'booked'"`));return}try{z(w(e),n,o)}catch(t){if(!(t instanceof $))throw t;o.findings.push(l("expression",n,`${t.sentence} (at character ${t.at+1})`))}}function j(e,n,o,t=!1){if(typeof e!="string"||e.length===0||e.length>300){o.findings.push(l("view-template",n,'a template is words with {field} in braces, like "{name}" or "{quote|money}", at most 300 characters'));return}let d;try{d=V(e)}catch(a){if(a instanceof R||a instanceof $){o.findings.push(l("template",n,a.sentence));return}throw a}for(let a of d)if(a.expr&&(z(a.expr,n,o),t&&!a.format&&a.expr.t==="ident"&&(o.slot==="card"||o.slot==="row")&&o.spec.prose?.(a.expr.name))){let r=a.expr.name;o.findings.push(F("view-whole-text",n,`${o.kind} ${o.slot} shows ${r} whole; it will be clamped. Use {${r}|excerpt} or move it to the page.`,`write {${r}|excerpt}, or {${r}|excerpt: 80} for fewer characters`))}}function q(e,n,o){if(typeof e=="string"){E.includes(e)||o.findings.push(l("view-tone",n,`"${e}" is not a tone`,`use one of ${E.join(", ")}, or {"expr": "if(status == 'booked', 'good', 'neutral')"}`));return}if(g(e)&&Object.keys(e).length===1&&"expr"in e){k(e.expr,`${n}.expr`,o);return}o.findings.push(l("view-tone",n,'a tone is a word or {"expr": \u2026}',`one of ${E.join(", ")}`))}function x(e,n,o,t){if(!Array.isArray(e)){t.findings.push(l("view-shape",n,"a view is a list of blocks"));return}if(o>_){t.findings.push(l("view-depth",n,`blocks nest at most ${_} deep`,"flatten a group or a condition"));return}e.forEach((d,a)=>J(d,`${n}.${a}`,o,t))}function J(e,n,o,t){if(o===1&&t.count++,t.all++,!g(e)){t.findings.push(l("view-block",n,"a block is an object naming what it shows",`one of ${G}`));return}let d=Object.keys(e),a=d.filter(s=>C.includes(s)&&!(s==="group"&&d.includes("list")));if(a.length===0){t.findings.push(l("view-block",n,`${d.length>0?d.map(s=>`"${s}"`).join(", "):"an empty object"} is not a block Graview knows`,`one of ${G}`));return}if(a.length>1){t.findings.push(l("view-block",n,`a block is one thing, and this says ${a.map(s=>`"${s}"`).join(" and ")}`,"split it into two blocks"));return}let r=a[0];for(let s of d)s!==r&&s!="key"&&!v[r].includes(s)&&t.findings.push(l("unknown-key",`${n}.${s}`,`"${s}" is not part of a ${r} block`,v[r].length>0?`a ${r} block may also say ${v[r].map(u=>`"${u}"`).join(", ")}`:`a ${r} block says nothing else`));let i=e[r];switch(r){case"title":case"headline":case"text":case"badge":j(i,`${n}.${r}`,t,r==="text"),"tone"in e&&q(e.tone,`${n}.tone`,t);return;case"image":case"field":{let s=r==="image";if(typeof i!="string"||!(s?t.spec.files?.(i):t.spec.field(i))){let f=typeof i=="string"&&t.spec.relation(i);t.findings.push(l(`view-${r}`,`${n}.${r}`,`${t.kind} has no ${s?"image or file ":""}field ${typeof i=="string"?`"${i}"`:"by that name"}`,f?`"${i}" is a relation; show it with {"text": "{${i}.name}"}`:void 0))}let u=s?["thumb","gallery"]:P;"as"in e&&!u.includes(e.as)&&t.findings.push(l("view-format",`${n}.as`,`"${String(e.as)}" is not a way to show ${s?"pictures":"a field"}`,`use one of ${u.join(", ")}`)),s||N(e,n,t,"field"),"label"in e&&ie(e.label,`${n}.label`,t);return}case"progress":{!g(i)||Object.keys(i).some(s=>s!=="value"&&s!=="max")||!("value"in i)||!("max"in i)?t.findings.push(l("view-progress",`${n}.progress`,'progress is {"value": expression, "max": expression}')):(k(i.value,`${n}.progress.value`,t),k(i.max,`${n}.progress.max`,t)),"label"in e&&j(e.label,`${n}.label`,t);return}case"group":"direction"in e&&e.direction!=="row"&&e.direction!=="column"&&t.findings.push(l("view-direction",`${n}.direction`,`a group runs "row" or "column", not "${String(e.direction)}"`)),x(i,`${n}.group`,o+1,t);return;case"when":k(i,`${n}.when`,t),"show"in e?x(e.show,`${n}.show`,o+1,t):t.findings.push(l("view-when",n,'a condition says what it shows: {"when": expr, "show": [blocks]}'));return;case"figure":if(typeof i=="string")return Q(e,n,t);for(let s of["as","currency","label","emphasis"])s in e&&t.findings.push(l("unknown-key",`${n}.${s}`,`"${s}" belongs to a figure that works a number out; {"figure": true} is the kind's picture`,`write {"figure": "count(all('offer'))", "as": "number"}`));i!==!0?t.findings.push(l("view-block",`${n}.figure`,`a figure is a number worked out, {"figure": "sum(all('offer'), net)", "as": "money"}, or the kind's picture, {"figure": true}`)):t.spec.figure||t.findings.push(l("view-figure",`${n}.figure`,`${Y(t)} has no figure to show`,t.kind===null?`work a number out: {"figure": "count(all('offer'))"}`:'give the kind a "figure", or leave this block out'));return;case"list":return ne(e,n,t);case"divider":i!==!0&&t.findings.push(l("view-block",`${n}.${r}`,`write {"${r}": true}`));return}}function Q(e,n,o){k(e.figure,`${n}.figure`,o),"as"in e&&!L.includes(e.as)&&o.findings.push(l("view-format",`${n}.as`,`"${String(e.as)}" is not a way to say a figure`,`use one of ${L.join(", ")}`)),N(e,n,o,"figure"),"label"in e&&j(e.label,`${n}.label`,o),"emphasis"in e&&!B.includes(e.emphasis)&&o.findings.push(l("view-emphasis",`${n}.emphasis`,`"${String(e.emphasis)}" is not how loudly a figure is said`,`use ${B.map(t=>`"${t}"`).join(", ")}, or leave it out for the figure's own size`))}function N(e,n,o,t){"currency"in e&&(typeof e.currency!="string"||!/^[A-Z]{3}$/.test(e.currency)?o.findings.push(l("view-currency",`${n}.currency`,'a currency is its three-letter code, like "USD" or "EUR"')):e.as!=="money"&&o.findings.push(l("view-currency",`${n}.currency`,`a currency belongs on a ${t} shown as money`,'add "as": "money"')))}function ee(e,n){let o=[...n.kinds],t=(a,r)=>{let i=new Set;for(let s of a){let u=n.vocabulary.namesOf(s)?.targets?.(r);if(u==="*")return o;for(let f of u??[])i.add(f)}return i.size>0?[...i]:void 0},d=a=>{switch(a.t){case"ident":return n.kind!==null&&n.spec.relation(a.name)?t([n.kind],a.name):void 0;case"member":{let r=d(a.object);return r?t(r,a.name):void 0}case"where":return d(a.set);case"call":{let r=a.args[0],i=r?.t==="lit"&&typeof r.value=="string"?r.value:void 0;if(a.fn==="all")return i!==void 0&&n.kinds.has(i)?[i]:void 0;let s=a.args.length===2&&a.args[1]?.t==="lit"&&typeof a.args[1].value=="string"?a.args[1].value:void 0;if(a.fn==="out"&&s!==void 0){let u=d(r);return u?t(u,s):void 0}if(a.fn==="out")return i!==void 0&&n.kind!==null?t([n.kind],i):void 0;if(a.fn==="in"){let u=s??i,f=s!==void 0?d(r):n.kind!==null?[n.kind]:void 0,c=u!==void 0?n.vocabulary.sources(u).filter(m=>{let y=n.vocabulary.namesOf(m)?.targets?.(u);return!f||y==="*"||f.some(h=>y?.includes(h))}):[];return c.length>0?c:void 0}if((a.fn==="sort"||a.fn==="first")&&r)return d(r);if(a.fn==="either"){let u=a.args.map(d);return u.every(f=>f!==void 0)?[...new Set(u.flatMap(f=>f??[]))]:void 0}return}default:return}};return d(e)}function K(e,n,o,t){let d;try{d=w(e)}catch(r){if(!(r instanceof $))throw r;t.findings.push(l("expression",n,`${r.sentence} (at character ${r.at+1})`));return}let a=S(d);for(let r of a.unknownFunctions)t.findings.push(l("unknown-function",n,`"${r}" is not a function the rule language knows`,"see docs/declaration-document.md#expression-language"));for(let r of a.edges)t.edges.has(r)||t.findings.push(l("view-edge",n,`"${r}" is not a relation any kind declares`));if(o)for(let r of a.names)r==="id"||o.some(i=>t.vocabulary.namesOf(i)?.field(r)||t.vocabulary.namesOf(i)?.relation(r))||t.findings.push(l("view-name",n,`${o.join(" and ")} ${o.length===1?"has":"have"} no field or relation called "${r}"`))}function ne(e,n,o){let t=e.list;k(t,`${n}.list`,o);let d;if(typeof t=="string")try{d=ee(w(t),o)}catch{d=void 0}let a=i=>{if(!d)return[...o.kinds].map(u=>o.vocabulary.namesOf(u)?.choices?.(i)).find(u=>u!==void 0);let s=d.map(u=>o.vocabulary.namesOf(u)?.choices?.(i));return s.every(u=>u!==void 0)?[...new Set(s.flatMap(u=>u??[]))]:void 0},r=d?d.join(" and "):"any kind";if("sort"in e){let i=e.sort;if(typeof i=="string")K(i,`${n}.sort`,d,o);else if(g(i)&&typeof i.by=="string"&&Object.keys(i).every(s=>s==="by"||s==="direction")){let s=i.direction;s!==void 0&&s!=="asc"&&s!=="desc"&&s!=="choices"?o.findings.push(l("list-sort",`${n}.sort.direction`,`a list is sorted "asc", "desc" or "choices", not "${String(s)}"`,'"choices" puts a choice field in the order its choices are declared')):s==="choices"?a(i.by)===void 0&&o.findings.push(l("list-sort",`${n}.sort.by`,`"${i.by}" is not a choice field of ${r}, so it has no declared order`,'sort by a choice field, or say "asc" or "desc"')):K(i.by,`${n}.sort.by`,d,o)}else o.findings.push(l("list-sort",`${n}.sort`,'a sort is a key, like "net", or {"by": key, "direction": "asc" | "desc" | "choices"}'))}if("limit"in e){let i=e.limit;(typeof i!="number"||!Number.isInteger(i)||i<1||i>M)&&o.findings.push(l("list-limit",`${n}.limit`,`a limit is a whole number from 1 to ${M}`))}if("group"in e){let i=e.group,s=typeof i=="string"?i:g(i)&&typeof i.by=="string"?i.by:void 0;if(!(typeof i=="string"||g(i)&&Object.keys(i).every(f=>f==="by"||f==="headings"))||s===void 0)o.findings.push(l("list-group",`${n}.group`,'a group is a choice field, like "type", or {"by": "type", "headings": {"pain": "What hurts"}} \u2014 or a relation, like "inGenre", a heading per linked record'));else{let f=a(s),c=f===void 0?U(s):void 0,m=c!==void 0&&(c.way!==void 0?o.edges.has(c.edge):d?d.every(y=>o.vocabulary.namesOf(y)?.relation(c.edge)):o.edges.has(c.edge));if(f===void 0&&!m&&o.findings.push(l("list-group",`${n}.group`,`"${s}" is not a choice field or a relation of ${r}, so it has nothing to group by`,'group by a field whose type is enum, or by a relation of the kind listed, like "inGenre"')),g(i)&&"headings"in i){let y=i.headings;if(!g(y)||Object.values(y).some(h=>typeof h!="string"||h.length===0||h.length>80))o.findings.push(l("list-group",`${n}.group.headings`,'headings are words per choice, like {"pain": "What hurts"}, at most 80 characters each'));else if(f)for(let h of Object.keys(y))f.includes(h)||o.findings.push(l("list-group",`${n}.group.headings.${h}`,`"${h}" is not one of ${s}'s choices`,`use ${f.join(", ")}`))}}}"empty"in e&&(typeof e.empty!="string"||e.empty.length===0||e.empty.length>200)&&o.findings.push(l("list-empty",`${n}.empty`,"what an empty list says is a sentence, at most 200 characters")),"as"in e&&!H.includes(e.as)&&o.findings.push(l("list-as",`${n}.as`,`a list draws each record as its "card" or its "row", not "${String(e.as)}"`))}function ie(e,n,o){(typeof e!="string"||e.length===0||e.length>60)&&o.findings.push(l("view-label",n,"a label is a few words, at most 60 characters"))}function W(e,n,o,t,d,a,r){let i={kind:null,spec:X,kinds:t,edges:d,vocabulary:o,findings:a,count:0,all:0};Array.isArray(e)&&e.length===0&&a.push(l("view-shape",n,`${r} has no blocks`,'give it one: {"headline": "\u2026"}')),x(e,n,1,i),D(i,n,r,"show less")}function D(e,n,o,t){e.count>T?e.findings.push(l("view-size",n,`${o} has ${e.count} blocks at its top; a view has at most ${T} there, a group or a condition counting as one`,`${t}, or gather some into a group`)):e.all>I&&e.findings.push(l("view-size",n,`${o} has ${e.all} blocks counting the ones inside its groups and conditions; a view has at most ${I} in all`,t))}function oe(e,n,o,t,d){Array.isArray(e)&&e.forEach((a,r)=>{if(!g(a)||a.name!=="blocks"||!g(a.options)||!("blocks"in a.options))return;let i=[];W(a.options.blocks,`lenses.${r}.options.blocks`,n,o,t,i,`the lens "${String(a.title??r)}"`);for(let s of i)d.push({...s,severity:"warning"})})}function te(e,n,o,t,d,a,r){let i=[];if(e===void 0)return i;if(!g(e))return i.push(l("view-shape",n,'views are an object of kinds, each with a "card", a "row" or a "page"')),i;for(let[s,u]of Object.entries(e)){if(s==="home"&&Array.isArray(u)){W(u,`${n}.home`,r,t,d,i,"the home");continue}let f=o(s);if(!f){i.push(l("view-kind",`${n}.${s}`,`"${s}" is not a kind this ${a} declares`));continue}if(!g(u)){i.push(l("view-shape",`${n}.${s}`,`a kind's views are {"card": [blocks], "row": [blocks], "page": [blocks]}`));continue}for(let c of Object.keys(u))O.includes(c)||i.push(l("view-slot",`${n}.${s}.${c}`,`"${c}" is not a place a view is drawn`,`use ${O.map(m=>`"${m}"`).join(", ")}`));for(let c of O){let m=u[c];if(m===void 0)continue;let y={kind:s,spec:f,kinds:t,edges:d,vocabulary:r,findings:i,count:0,all:0,slot:c};x(m,`${n}.${s}.${c}`,1,y),D(y,`${n}.${s}.${c}`,`this ${c}`,"show less, or move detail to the page")}}return i}function ge(e){let n=new Set(Object.keys(e.kinds)),o=new Set(Object.values(e.kinds).flatMap(r=>Object.keys(b(r.edges)))),t=r=>{let i=p(e.kinds,r)?e.kinds[r]:void 0;return i?{field:s=>p(i.fields,s)||p(i.computed,s)||A(i.edges).has(s),relation:s=>p(b(i.edges),s),figure:i.figure!==void 0,files:s=>p(i.fields,s)&&Z(i.fields[s]),choices:s=>p(i.fields,s)&&i.fields[s].type==="enum"?i.fields[s].options:void 0,targets:s=>p(b(i.edges),s)?i.edges[s].to:void 0,prose:s=>p(i.fields,s)&&i.fields[s].type==="text"}:void 0},d={namesOf:t,sources:r=>Object.keys(e.kinds).filter(i=>p(e.kinds[i].edges,r))},a=te(e.views,"views",t,n,o,"document",d);return oe(e.lenses,d,n,o,a),a}export{E as a,P as b,L as c,B as d,M as e,ue as f,U as g,fe as h,ce as i,ge as j};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as v,C,D as S,J as G,y as O}from"./chunk.
|
|
1
|
+
import{B as v,C,D as S,J as G,y as O}from"./chunk.PNVR3CXR.js";import{A as E,F as I,Y as m,d as V,k as y,m as p,n as g,o as u,p as D,w as B}from"./chunk.ZTD2CNC3.js";import{Ac as P,Bc as k,Dc as R,Ec as T,aa as M}from"./chunk.X7W27IRI.js";import{b as A}from"./chunk.AJZBJBMO.js";var W=A(I(),1);function j(e,t){try{t.length===0?localStorage.removeItem(v(e)):localStorage.setItem(v(e),JSON.stringify(t))}catch{}}function F(e,t){j(e,[...S(e).filter(n=>n.title!==t.title),t])}function H(e,t){j(e,S(e).filter(n=>n.title!==t))}function J(e,t){for(let n of e.places().filter(o=>o.title===t))e.forget?.(n.kind,n.as)}var U=e=>e===!0?{written:!0}:typeof e=="object"&&e!==null?{written:e.kept===!0,...e.said?{said:e.said}:{}}:{written:!1},N=e=>({title:e.title,lens:e.lens,on:e.on,...e.bindings?{bindings:e.bindings}:{},...e.options?{options:e.options}:{}});function Z(e,t){let n=o=>t.some(r=>r.title===o||r.as===P(o));if(!n(e))return e;for(let o=2;;o++)if(!n(`${e} ${o}`))return`${e} ${o}`}function ie(e){let{store:t,views:n,brand:o,seatTalk:r,onKeepLens:d}=m(),h=(0,W.useContext)(O),L=C(o,t.schema),b=async f=>{let{edit:i}=f;if(f.written&&d)try{await d({op:"remove-lens",title:i.title,on:i.on})}catch{}H(L,i.title),J(n,i.title),h?.dismiss(`kept:${i.title}`),r.setTurns(l=>[...l.map(s=>s.kept&&s.kept.edit.title===i.title&&!s.kept.taken?{...s,kept:{...s.kept,taken:!0}}:s),{role:"seat",text:`Took \u201C${i.title}\u201D back out of the places.`}]);let a=M(t.schema,i.on);e({to:"kind",kind:i.on,title:a,address:k(t.schema,i.on),said:`Went to ${a}.`})};return{keep:async f=>{let i=Z(f.edit.title,n.places()),a={...f.edit,title:i},l=!1,s;if(d)try{({written:l,said:s}=U(await d(a)))}catch{l=!1}l||F(L,N(a)),G(n,t.schema,[N(a)]);let K=n.places(),c=K.find(w=>w.title===i),x=s??(l?`Kept \u201C${i}\u201D as a lens: it is in the places now.`:d?`Kept \u201C${i}\u201D as your own lens. Ask the owner to keep it for everyone.`:`Kept \u201C${i}\u201D as your own lens.`),$={edit:a,written:l};r.setDraft(null),r.setTurns(w=>[...w,{role:"seat",text:x,kept:$}]),h?.notify({kind:"toast",id:`kept:${i}`,sentence:x,timeout:1e4,action:{label:"Take back",onSelect:()=>void b($)}}),c&&e({to:"picture",kind:c.kind,as:c.as,title:i,address:R(c.as,T(c,K)?k(t.schema,c.kind).slice(1):void 0),said:`Went to ${i}.`})},takeBack:b}}var q=A(I(),1);function _(e,t){switch(t.to){case"place":return{view:V("#")};case"picture":return{view:u(E(p(e,"filter",null),t.kind,t.as),[])};case"kind":{let n=D(g({...y(e,B(t.kind)),relation:null},!1),!0);return{view:u(p(p(n,"view",null),"filter",t.filter??null),[])}}case"record":return{view:u(y(g(p(p(e,"view",null),"filter",null),!1),t.id),[t.id])};case"problems":return{pane:"problems"}}}function z(e){let t=typeof document>"u"?null:document.querySelector('[data-testid="standing"]');t&&t.getAttribute("aria-expanded")==="true"!==e&&t.click()}function ae(){let{setView:e,seatTalk:t}=m();return(0,q.useCallback)(n=>{t.get().draft&&t.setDraft(null),z(n.to==="problems"),n.to!=="problems"&&e(o=>{let r=_(o,n);return"view"in r?r.view:o})},[e,t])}export{ie as a,z as b,ae as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{F as k,Q as n,a as t,xa as o}from"./chunk.ZTD2CNC3.js";import{b as p}from"./chunk.AJZBJBMO.js";var f=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.WVUJXDXZ.js","./chunk.52QAIGCD.js","./chunk.PPUAPAWR.js","./chunk.IHFNLKXV.js","./chunk.577PGFUT.js","./chunk.FBY5IUGU.js","./chunk.4K5QCJFH.js","./chunk.GZHZLJBF.js","./chunk.WLBXBNNH.js","./chunk.7MTX33WD.js","./chunk.OJGHDWI6.js","./chunk.Z7ZCR4LN.js","./chunk.RIW7SQH4.js","./chunk.FSAHO3LV.js","./chunk.PNVR3CXR.js","./chunk.ZTD2CNC3.js","./chunk.X7W27IRI.js","./chunk.AJZBJBMO.js"]),import("./chunk.QPAUQJON.js")))),y=f.part((e,r)=>e.drawFiles(r),{quiet:!0});var d=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.GZHZLJBF.js","./chunk.WLBXBNNH.js","./chunk.7MTX33WD.js","./chunk.OJGHDWI6.js","./chunk.Z7ZCR4LN.js","./chunk.RIW7SQH4.js","./chunk.FSAHO3LV.js","./chunk.PNVR3CXR.js","./chunk.ZTD2CNC3.js","./chunk.X7W27IRI.js","./chunk.AJZBJBMO.js"]),import("./chunk.6VRJII5M.js")))),I=d.part((e,r)=>e.drawLinkedRecord(r),{quiet:!0}),w=d.part((e,r)=>e.drawLinkedPicker(r),{what:"Picking a linked record"});var s=p(n(),1),m=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.GZHZLJBF.js","./chunk.WLBXBNNH.js","./chunk.7MTX33WD.js","./chunk.OJGHDWI6.js","./chunk.Z7ZCR4LN.js","./chunk.RIW7SQH4.js","./chunk.FSAHO3LV.js","./chunk.PNVR3CXR.js","./chunk.ZTD2CNC3.js","./chunk.X7W27IRI.js","./chunk.AJZBJBMO.js"]),import("./chunk.6A62UVAE.js")))),E=m.part((e,r)=>(0,s.jsx)(e.RepeatPicker,{...r}),{quiet:!0}),W=m.part((e,r)=>(0,s.jsx)(e.RepeatEditor,{...r}),{quiet:!0});var a=p(k(),1),i=p(n(),1),c=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.Z7ZCR4LN.js","./chunk.RIW7SQH4.js","./chunk.FSAHO3LV.js","./chunk.PNVR3CXR.js","./chunk.ZTD2CNC3.js","./chunk.X7W27IRI.js","./chunk.AJZBJBMO.js"]),import("./chunk.ZTFW7RKP.js")))),l=c.part((e,r)=>(0,i.jsx)(e.WhenInput,{...r}),{quiet:!0});function M(e){return(0,i.jsx)(a.Suspense,{fallback:(0,i.jsx)("span",{"data-graview-when-arriving":"",style:{display:"inline-block",minHeight:24}}),children:(0,i.jsx)(l,{...e})})}var N=()=>c.load().then(()=>{},()=>{});export{y as a,I as b,w as c,E as d,W as e,M as f,N as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk.VOFUIWAX.js";import"./chunk.MWJUZG3C.js";import"./chunk.F6WYSDSI.js";import"./chunk.PW7YH6JV.js";import"./chunk.T2L4NPSB.js";import"./chunk.VKH3ZPPQ.js";import"./chunk.3H4NVUWV.js";import"./chunk.SIH6RCAI.js";import"./chunk.RYEAMM73.js";import"./chunk.7HPPJVIV.js";import"./chunk.ETWVQ3A2.js";import"./chunk.CZRX2FDI.js";import"./chunk.5EAQDBBE.js";import"./chunk.YT2CYCVT.js";import"./chunk.HJCQ6I3S.js";import"./chunk.DUUARGPE.js";import"./chunk.FUQVNXLB.js";import"./chunk.LAF6GTBN.js";import"./chunk.QU356VB2.js";import"./chunk.QVKKXMNK.js";import"./chunk.XXMYKBLT.js";import"./chunk.34CYK2DF.js";import"./chunk.JZBBGY4B.js";import"./chunk.UT6642FC.js";import"./chunk.HPD5ZDZH.js";import"./chunk.WVUJXDXZ.js";import"./chunk.52QAIGCD.js";import"./chunk.PPUAPAWR.js";import"./chunk.IHFNLKXV.js";import"./chunk.577PGFUT.js";import"./chunk.FBY5IUGU.js";import"./chunk.4K5QCJFH.js";import"./chunk.GZHZLJBF.js";import"./chunk.WLBXBNNH.js";import"./chunk.7MTX33WD.js";import"./chunk.OJGHDWI6.js";import"./chunk.Z7ZCR4LN.js";import"./chunk.RIW7SQH4.js";import"./chunk.FSAHO3LV.js";import"./chunk.PNVR3CXR.js";import"./chunk.ZTD2CNC3.js";import"./chunk.X7W27IRI.js";import"./chunk.AJZBJBMO.js";export{b as declaredLensView,a as formatFor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Cb as S,wb as w}from"./chunk.
|
|
1
|
+
import{Cb as S,wb as w}from"./chunk.X7W27IRI.js";function B(s){return[...s.mutations??[],...S(s.schema,s.mutations??[])]}function b(s){let i=[...s.schema.kinds],a=B(s),d=new Map,c=new Map;for(let n of a){c.set(n.name,n.creates??[]);let e=w(n.input).filter(t=>!t.optional&&!t.kinds.includes("*")).flatMap(t=>t.kinds);d.set(n.name,[...new Set(e)])}let g=new Map;for(let n of i)g.set(n,[]);for(let n of a)for(let e of c.get(n.name)??[])g.get(e)?.push(n.name);let p=new Map,l=new Set;for(let n=0;;n+=1){let e=[];for(let t of a)if((d.get(t.name)??[]).every(o=>l.has(o)))for(let o of c.get(t.name)??[])l.has(o)||e.push(o);if(e.length===0)break;for(let t of e)l.add(t),p.set(t,n)}let h=n=>{let e=g.get(n)??[];if(e.length===0)return[];let t=e.map(r=>d.get(r)??[]).sort((r,o)=>r.length-o.length)[0];return[...new Set(t)].filter(r=>r!==n)},y=new Map,u=n=>{let e=y.get(n);if(e)return e;let t=new Set;y.set(n,t);for(let r of h(n)){t.add(r);for(let o of u(r))t.add(o)}return t.delete(n),t},f=new Map(i.map(n=>[n,0]));for(let n of i)for(let e of u(n))f.set(e,(f.get(e)??0)+1);let m=i.map(n=>({kind:n,madeBy:[...g.get(n)??[]].sort(),needs:[...h(n)].sort(),depth:p.get(n)??null})).sort((n,e)=>(n.depth??Number.MAX_SAFE_INTEGER)-(e.depth??Number.MAX_SAFE_INTEGER)||(f.get(e.kind)??0)-(f.get(n.kind)??0)||n.kind.localeCompare(e.kind)),k=m.filter(n=>n.depth===0).map(n=>n.kind),A=[...new Set(a.filter(n=>(d.get(n.name)??[]).length===0).filter(n=>(c.get(n.name)??[]).length>0).map(n=>n.name))].sort(),M=m.filter(n=>n.depth===null).map(n=>({kind:n.kind,why:n.madeBy.length===0?"no act declares that it creates this kind":`every act that makes it needs ${n.needs.map(e=>`"${e}"`).join(", ")}, which nothing can make first`}));return{order:m,roots:k,doors:A,unreachable:M}}export{b as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk.
|
|
1
|
+
import"./chunk.PNVR3CXR.js";import{F as K,N as E,O as j,Q as C,Z as W}from"./chunk.ZTD2CNC3.js";import{L as R,La as T,fc as P}from"./chunk.X7W27IRI.js";import{b as x}from"./chunk.AJZBJBMO.js";function N(a,t){return a.kind==="agent"?"agent":a.kind!=="human"?"app":a.onBehalfOf!==void 0?"person":a.id===void 0||t?.id===void 0||a.id===t.id?"you":"person"}var Y=a=>a.ops.filter(t=>t.withheld!==!0);function z(a,t={}){let r=a.batches().map(e=>{let s=e.ops[0],l=e.ops.at(-1),c=Y(e).length===0;return{seq:l.seq+1,from:s.seq,at:l.at,batch:e.id,maker:c?"person":N(e.author,t.me),author:c?void 0:e.author,said:e.intent,declaration:!1,withheld:c}}),i=[...a.log.epochs().filter(e=>e.change!==void 0).map(e=>({seq:e.seq,sentence:e.change,...e.at?{at:e.at}:{}})),...t.declarations??[]];for(let e of i){if(e.seq<a.log.horizon||e.seq>a.log.length)continue;let s=r.findIndex(l=>l.seq===e.seq);if(s>=0&&!r[s].withheld){r[s]={...r[s],declaration:!0,said:e.sentence};continue}r.push({seq:e.seq,from:e.seq,at:e.at,batch:void 0,maker:e.author?N(e.author,t.me):"app",author:e.author,said:e.sentence,declaration:!0,withheld:!1})}return r.sort((e,s)=>e.seq-s.seq||+(e.batch!==void 0)-+(s.batch!==void 0))}function I(a,t){let r=a.log.all(),i=new Map(r.map(e=>[e.id,e.seq]));return a.batches().filter(e=>!e.undone&&e.ops[0].seq>=t).filter(e=>!e.ops.every(s=>s.undoes!==void 0&&(i.get(s.undoes)??-1)>=t)).map(e=>e.id)}function B(a,t){return a.withheld?"Someone":a.maker==="you"?"you":a.author?T(a.author,t):"the app"}var d=x(K(),1);var o=x(C(),1),_={kind:"human"},G=[1,2,4,8],U=900,q={you:"You",person:"A person",agent:"An agent",app:"The app"},H={you:"var(--graview-accent)",person:"var(--graview-ink-muted)",agent:"var(--graview-activity, var(--graview-good))",app:"var(--graview-edge-bright)"};function X(a,t){return[...new Set([t,...a.map(r=>r.seq)])].sort((r,i)=>r-i)}function J(a,t){let r=0;for(let i=0;i<a.length;i++)a[i]<=t&&(r=i);return r}function Q(a,t,r){let i=I(a,t);if(i.length===0)return null;let e=a.canUndo(i);if(!e.ok)return null;let s=new Set(a.permittedMutations(r).map(l=>l.name));return e.ops.every(l=>l.mutation!==null&&s.has(l.mutation.name))?i:null}function oe({face:a}){let t=E(),r=W(),i=r?.principal??_,e=j(t.live,i),s=e.log.length,l=(0,d.useMemo)(()=>z(e,{me:i,...t.host?.declarations?{declarations:t.host.declarations}:{}}),[e,i,t.host,s]),c=(0,d.useMemo)(()=>X(l,e.log.horizon),[l,e]),h=t.past?.seq??s,f=J(c,h),y=c.length-1,k=[...l].reverse().find(n=>n.seq<=h&&n.seq>(c[f-1]??-1))??[...l].reverse().find(n=>n.seq<=h),[g,v]=(0,d.useState)(!1),[w,L]=(0,d.useState)(1),[A,$]=(0,d.useState)(null);(0,d.useEffect)(()=>{if(!g)return;if(f>=y){v(!1);return}let n=setTimeout(()=>t.show(c[f+1]),U/w);return()=>clearTimeout(n)},[g,f,y,w,c,t]);let D=(0,d.useMemo)(()=>t.past?Q(e,h,i):null,[t.past,e,h,i,s]),M=n=>B(n,{graph:e.graph,schema:e.schema,...r?.seats?{seats:r.seats}:{},...r?.people?{people:r.people}:{}}),u=t.past?t.past.at?R(t.past.at,r?.locale):"the start":null,S=k?`${M(k)==="you"?"You":M(k)}: ${k.said}`:"Nothing had happened yet",O=(0,d.useRef)(null);(0,d.useLayoutEffect)(()=>{let n=O.current,m=n?.parentElement;if(a!=="scene"||!n||!m)return;let p=()=>m.style.setProperty("--graview-sheet",`${Math.ceil(n.getBoundingClientRect().height)+24}px`);p();let b=typeof ResizeObserver>"u"?null:new ResizeObserver(p);return b?.observe(n),()=>{b?.disconnect(),m.style.removeProperty("--graview-sheet")}},[a]);let V=a==="scene"?{position:"absolute",left:"50%",bottom:12,transform:"translateX(-50%)",width:"min(720px, calc(100% - 32px))",zIndex:P("rail")}:{position:"sticky",top:0,zIndex:P("rail"),margin:"0 auto 12px",maxWidth:960,width:"100%"};return(0,o.jsxs)("section",{ref:O,"aria-label":"Timeline","data-testid":"timeline","data-graview-past":t.past?String(t.past.seq):"now","data-graview-offstage":"",style:{...V,boxSizing:"border-box",display:"grid",gap:8,padding:"10px 12px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",color:"var(--graview-ink)",fontSize:"0.8125rem"},children:[(0,o.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"baseline",gap:"4px 12px"},children:[(0,o.jsx)("strong",{"data-testid":"as-of",role:"status",style:{fontWeight:600},children:u?`As of ${u}`:"Now"}),(0,o.jsx)("span",{"data-testid":"timeline-caption",style:{color:"var(--graview-ink-muted)",minWidth:0,overflowWrap:"anywhere"},children:S}),u?(0,o.jsx)("span",{style:{color:"var(--graview-ink-faint)"},"data-testid":"past-read-only",children:"Nothing changes while you look back."}):null]}),(0,o.jsx)("div",{style:{position:"relative",height:22},"aria-hidden":"true",children:c.slice(1).map((n,m)=>{let p=[...l].reverse().find(F=>F.seq===n),b=y===0?0:(m+1)/y*100;return(0,o.jsx)("span",{"data-graview-tick":n,"data-maker":p.maker,...p.declaration?{"data-declaration":""}:{},title:`${q[p.maker]}: ${p.said}`,style:{position:"absolute",left:`calc(${b}% - 1px)`,bottom:0,width:p.declaration?4:2,height:p.declaration?22:12,borderRadius:2,background:p.declaration?"var(--graview-ink)":H[p.maker],opacity:n<=h?1:.45}},`${n}:${p.batch??"declaration"}`)})}),(0,o.jsx)("input",{type:"range","data-testid":"scrubber","aria-label":"Moment",min:0,max:y,step:1,value:f,"aria-valuetext":u?`As of ${u}. ${S}`:`Now. ${S}`,onChange:n=>{v(!1),t.show(c[Number(n.currentTarget.value)]??s)},style:{width:"100%",margin:0,accentColor:"var(--graview-accent)"}}),(0,o.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:8},children:[(0,o.jsx)("button",{type:"button","data-testid":"play","aria-pressed":g,onClick:()=>{!g&&f>=y&&t.show(c[0]),v(!g)},style:{minHeight:28,minWidth:64},children:g?"Pause":"Play"}),(0,o.jsxs)("label",{style:{display:"inline-flex",alignItems:"center",gap:6,color:"var(--graview-ink-muted)"},children:["Speed",(0,o.jsx)("select",{"data-testid":"speed",value:w,onChange:n=>L(Number(n.currentTarget.value)),style:{minHeight:28},children:G.map(n=>(0,o.jsxs)("option",{value:n,children:[n,"\xD7"]},n))})]}),(0,o.jsx)("span",{"aria-hidden":"true",style:{display:"inline-flex",gap:10,color:"var(--graview-ink-faint)",flexWrap:"wrap"},children:Object.keys(q).filter(n=>l.some(m=>m.maker===n)).map(n=>(0,o.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[(0,o.jsx)("span",{style:{width:8,height:8,borderRadius:2,background:H[n]}}),q[n]]},n))}),(0,o.jsxs)("span",{style:{marginLeft:"auto",display:"inline-flex",gap:8},children:[D?(0,o.jsx)("button",{type:"button","data-testid":"restore-here",title:"Take back every change since, as one change you can undo",onClick:()=>{$(null);try{e.undo([...D],{author:i,intent:u?`Restore to ${u}`:"Restore"}),t.show(null)}catch(n){$(n instanceof Error?n.message:String(n))}},style:{minHeight:28},children:"Restore to here"}):null,(0,o.jsx)("button",{type:"button","data-testid":"back-to-now",onClick:()=>t.show(null),style:{minHeight:28},children:"Back to now"})]})]}),A?(0,o.jsx)("span",{role:"alert","data-testid":"restore-refused",style:{color:"var(--graview-warn)"},children:A}):null]})}export{oe as Timeline};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as m}from"./chunk.
|
|
1
|
+
import{c as m}from"./chunk.FBY5IUGU.js";import{$ as p,X as c,Y as u,Z as f,da as h,ea as l}from"./chunk.X7W27IRI.js";function A(t,e){let n=t.schema.kinds,r="kind"in e?e.kind:void 0;if(r!==void 0&&!n.includes(r))return`There is no kind "${r}" in this app. Its kinds are: ${n.join(", ")}.`;if(e.on==="act"&&e.act!==void 0&&t.allMutations&&!t.allMutations().some(i=>i.name===e.act))return`There is no act "${e.act}" in this app.`;let o="record"in e?e.record:void 0;if(o!==void 0&&t.graph&&!t.graph.getNode(o))return`No record "${o}" is here to be told about.`;if(o!==void 0&&r!==void 0&&t.graph&&t.graph.getNode(o)?.kind!==r)return`\u201C${o}\u201D is not ${h(r)}.`;if(e.on==="changed"&&e.kind===void 0&&e.record===void 0)return"Say which kind, or which record, to be told about.";if(e.on==="reaches"){if(e.condition.trim()==="")return"Say what it should reach: a condition like done == true.";try{m(e.condition)}catch(i){return`The condition does not read: ${i instanceof Error?i.message:String(i)}.`}}}function a(t,e){let n=t.graph?.getNode(e);return n?c(t.schema.tryDefinition(n.kind),n):e}function g(t,e){let n=t.allMutations?.().find(r=>r.name===e);return n?u(n):f(e)}function M(t,e){let{when:n}=e,r=e.alsoMine?"anyone":"someone else",o=d=>l(t.schema.tryDefinition(d),d),i=d=>{let s=o(d);return`${/^[aeiou]/i.test(s)?"an":"a"} ${s}`};switch(n.on){case"act":{let d=n.act!==void 0?`\u201C${g(t,n.act)}\u201D`:"an act";return`When ${r} runs ${d}${n.record!==void 0?` on \u201C${a(t,n.record)}\u201D`:""}`}case"created":return`When ${r} adds ${i(n.kind)}`;case"changed":return n.record!==void 0?`When ${r} changes \u201C${a(t,n.record)}\u201D`:`When ${r} changes any of the ${p(t.schema,n.kind)}`;case"reaches":return`When ${n.record!==void 0?`\u201C${a(t,n.record)}\u201D`:i(n.kind)} reaches ${n.condition}${e.alsoMine?"":" (by someone else)"}`}}export{A as a,M as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk.QVUL2FSI.js";import"./chunk.PW7YH6JV.js";import"./chunk.QU356VB2.js";import"./chunk.QVKKXMNK.js";import"./chunk.UT6642FC.js";import"./chunk.52QAIGCD.js";import"./chunk.PPUAPAWR.js";import"./chunk.IHFNLKXV.js";import"./chunk.577PGFUT.js";import"./chunk.FBY5IUGU.js";import"./chunk.4K5QCJFH.js";import"./chunk.Z7ZCR4LN.js";import"./chunk.RIW7SQH4.js";import"./chunk.FSAHO3LV.js";import"./chunk.X7W27IRI.js";import"./chunk.AJZBJBMO.js";export{b as actOnSeveral,a as actsForSeveral};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{F as C,Q as k,a as H,xa as K}from"./chunk.ZTD2CNC3.js";import{b}from"./chunk.AJZBJBMO.js";var n=b(C(),1),N=450,_=10,O=t=>t instanceof HTMLInputElement?t.dataset.graviewChooseBox??void 0:void 0,q={ArrowDown:1,ArrowRight:1,ArrowUp:-1,ArrowLeft:-1,Home:-1/0,End:1/0},S=t=>t instanceof Element?t.closest("[data-graview-choose]"):null,G=t=>t instanceof HTMLElement&&(t.isContentEditable||t instanceof HTMLInputElement&&t.type!=="checkbox"||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement);function Y(t){let[i,d]=(0,n.useState)(()=>new Set),l=(0,n.useRef)(null),x=(0,n.useRef)(null),[E,P]=(0,n.useState)(null),R=E!==null&&t.includes(E)?E:t[0],L=(0,n.useMemo)(()=>t.filter(e=>i.has(e)),[t,i]),M=(0,n.useMemo)(()=>new Set(t),[t]);(0,n.useEffect)(()=>{[...i].some(e=>!M.has(e))&&d(e=>new Set([...e].filter(o=>M.has(o))))},[M,i]);let u=(0,n.useCallback)((e,o=!1)=>{let a=l.current;d(s=>{let r=new Set(s),f=a===null?-1:t.indexOf(a),y=t.indexOf(e);if(o&&f>=0&&y>=0){let T=s.has(a);for(let p of t.slice(Math.min(f,y),Math.max(f,y)+1))T?r.add(p):r.delete(p)}else r.has(e)?r.delete(e):r.add(e);return r}),l.current=e},[t]),v=(0,n.useCallback)(e=>d(new Set(e)),[]),A=(0,n.useCallback)(()=>{l.current=null,d(new Set)},[]),c=(0,n.useRef)(null),g=(0,n.useRef)(!1),m=L.length>0,h=()=>{c.current&&clearTimeout(c.current.timer),c.current=null};(0,n.useEffect)(()=>h,[]);let B={ref:x,onKeyDown:e=>{if(G(e.target))return;let o=O(e.target);if(e.key==="Tab"&&!e.shiftKey&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&o!==void 0&&m){let s=document.querySelector('[data-testid="several-bar"]'),r=s?.querySelector("[data-mutation]:not([disabled])")??s?.querySelector("button:not([disabled])");if(r){e.preventDefault(),e.stopPropagation(),r.focus();return}}let a=q[e.key];if(o!==void 0&&a!==void 0&&!e.metaKey&&!e.ctrlKey&&!e.altKey){let s=t.indexOf(o),r=t[Math.max(0,Math.min(t.length-1,s+(Number.isFinite(a)?a:a>0?t.length:-t.length)))];if(e.preventDefault(),e.stopPropagation(),r===void 0||r===o)return;if(e.shiftKey){let f=l.current!==null&&t.includes(l.current)?l.current:o,[y,T]=[t.indexOf(f),t.indexOf(r)].sort((p,F)=>p-F);d(p=>new Set([...p,...t.slice(y,T+1)])),l.current=f}P(r),x.current?.querySelector(`[data-graview-choose-box="${CSS.escape(r)}"]`)?.focus();return}if((e.metaKey||e.ctrlKey)&&!e.altKey&&e.key.toLowerCase()==="a"){e.preventDefault(),e.stopPropagation(),v(t);return}if(e.key===" "&&!e.metaKey&&!e.ctrlKey){let s=S(e.target),r=e.target instanceof HTMLButtonElement||e.target instanceof HTMLInputElement&&e.target.type==="checkbox";if(!s||r)return;e.preventDefault(),u(s.dataset.graviewChoose,e.shiftKey)}},onFocus:e=>{let o=O(e.target);o!==void 0&&P(o)},onPointerDown:e=>{if(g.current=!1,e.pointerType==="mouse"||e.button>0)return;let o=S(e.target);if(!o||e.target instanceof HTMLInputElement&&e.target.type==="checkbox")return;let a=o.dataset.graviewChoose;h(),c.current={id:a,x:e.clientX,y:e.clientY,timer:setTimeout(()=>{c.current=null,g.current=!0,u(a)},N)}},onPointerMove:e=>{let o=c.current;o&&Math.hypot(e.clientX-o.x,e.clientY-o.y)>_&&h()},onPointerUp:h,onPointerCancel:h,onClickCapture:e=>{let o=S(e.target);if(!o||e.target instanceof HTMLInputElement&&e.target.type==="checkbox"&&e.target.hasAttribute("data-graview-choose-box"))return;if(g.current){g.current=!1,e.preventDefault(),e.stopPropagation();return}let s=o.dataset.graviewChoose;if(e.shiftKey&&(m||l.current!==null)){e.preventDefault(),e.stopPropagation(),u(s,!0);return}m&&matchMedia?.("(pointer: coarse)").matches&&(e.preventDefault(),e.stopPropagation(),u(s))},onContextMenu:e=>{(g.current||c.current)&&(e.preventDefault(),e.stopPropagation())},...m?{"data-graview-choosing":""}:{}},j=(0,n.useCallback)(e=>i.has(e),[i]);return{chosen:L,has:j,toggle:u,choose:v,clear:A,listProps:B,boxProps:(e,o)=>({type:"checkbox",className:"graview-choose-box","data-graview-choose-box":e,"aria-label":`Choose ${o}`,tabIndex:e===R?0:-1,checked:i.has(e),onChange:()=>{},onClick:a=>{a.stopPropagation(),u(e,a.shiftKey)}}),list:x}}var $=`
|
|
2
|
+
.graview-choose-box{width:24px;height:24px;margin:0;accent-color:var(--graview-accent);cursor:pointer;opacity:0}
|
|
3
|
+
[data-graview-choose]:hover .graview-choose-box,[data-graview-choose]:focus-within .graview-choose-box,.graview-choose-box:focus-visible,.graview-choose-box:checked,[data-graview-choosing] .graview-choose-box{opacity:1}
|
|
4
|
+
[data-graview-choose]{-webkit-touch-callout:none}
|
|
5
|
+
[data-graview-choosing] [data-graview-choose]{-webkit-user-select:none;user-select:none}
|
|
6
|
+
`;var D=b(C(),1),w=b(k(),1),I=K(H(()=>(__graviewPreload(import.meta.url,["./chunk.QVUL2FSI.js","./chunk.PW7YH6JV.js","./chunk.QU356VB2.js","./chunk.QVKKXMNK.js","./chunk.YJCT3DV2.js","./chunk.JZBBGY4B.js","./chunk.UT6642FC.js","./chunk.MB7LKKUD.js","./chunk.52QAIGCD.js","./chunk.PPUAPAWR.js","./chunk.IHFNLKXV.js","./chunk.577PGFUT.js","./chunk.FBY5IUGU.js","./chunk.4K5QCJFH.js","./chunk.Z7ZCR4LN.js","./chunk.RIW7SQH4.js","./chunk.FSAHO3LV.js","./chunk.PNVR3CXR.js","./chunk.ZTD2CNC3.js","./chunk.X7W27IRI.js","./chunk.AJZBJBMO.js"]),import("./chunk.7VUPKOKC.js")))),U=I.part((t,i)=>(0,w.jsx)(t.SeveralBar,{...i}),{what:"The selection bar"});function Q(t){return t.chosen.length===0?null:(0,w.jsx)(D.Suspense,{fallback:null,children:(0,w.jsx)(U,{...t})})}var W=()=>I.prefetch();export{Y as a,$ as b,Q as c,W as d};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as J,b as We}from"./chunk.5A4AOFOA.js";import"./chunk.KSXB4LDF.js";import"./chunk.VZHV25JE.js";import"./chunk.QVUL2FSI.js";import{i as $e,j as Re,k as Le}from"./chunk.F6WYSDSI.js";import"./chunk.PW7YH6JV.js";import"./chunk.SIH6RCAI.js";import"./chunk.5EAQDBBE.js";import"./chunk.YT2CYCVT.js";import"./chunk.HJCQ6I3S.js";import"./chunk.DUUARGPE.js";import"./chunk.FUQVNXLB.js";import"./chunk.LAF6GTBN.js";import"./chunk.QU356VB2.js";import"./chunk.QVKKXMNK.js";import"./chunk.ZSW74NVJ.js";import"./chunk.ZE4CTZQ3.js";import"./chunk.3C4RJIJU.js";import{a as Pe,b as k}from"./chunk.YJCT3DV2.js";import"./chunk.34CYK2DF.js";import"./chunk.JZBBGY4B.js";import{b as ze,c as Ee}from"./chunk.UT6642FC.js";import"./chunk.TI4OSTQV.js";import"./chunk.HPD5ZDZH.js";import"./chunk.52QAIGCD.js";import"./chunk.PPUAPAWR.js";import"./chunk.IHFNLKXV.js";import"./chunk.577PGFUT.js";import"./chunk.FBY5IUGU.js";import"./chunk.4K5QCJFH.js";import{u as Ie}from"./chunk.WLBXBNNH.js";import"./chunk.7MTX33WD.js";import"./chunk.OJGHDWI6.js";import{g as Ce}from"./chunk.Z7ZCR4LN.js";import"./chunk.RIW7SQH4.js";import{c as Me}from"./chunk.FSAHO3LV.js";import{m as He}from"./chunk.PNVR3CXR.js";import{F as tt,Q as Se,Y as N,i as xe,na as Q,sa as Ae,v as ke,wa as Te}from"./chunk.ZTD2CNC3.js";import{Jb as ye,Kb as we,da as K,ea as W,fc as be,kb as ve}from"./chunk.X7W27IRI.js";import{b as G}from"./chunk.AJZBJBMO.js";var o=G(tt(),1);var t=G(Se(),1);function mt(d,r,a){let p=r.on??r.about[r.about.length-1];$e(d,r.about,{...a,pins:J(),...p===void 0?{}:{focus:p}})}function ft({placement:d="float",chosen:r=!0}={}){let{menuAt:a}=N();return d==="menu"&&a===null?r?(0,t.jsx)(nt,{}):null:(0,t.jsx)(it,{placement:d})}function nt(){let{store:d,setMenuAt:r,view:a}=N(),{selection:p}=Q(),h=(0,o.useRef)(null),[H,v]=(0,o.useState)(null);(0,o.useLayoutEffect)(()=>{let b=h.current?.offsetParent??h.current?.parentElement;if(!b)return;let m=Math.round(b.getBoundingClientRect().width);m!==H&&v(m)});let y=p.length===1&&!a.overview?d.graph.getNode(p[0]):void 0;return!y||H===null||H>=De?(0,t.jsx)("span",{ref:h,hidden:!0}):(0,t.jsx)("button",{type:"button",ref:h,"data-testid":"chosen-acts","aria-label":`What can be done with ${k(d,y.id)}`,"aria-haspopup":"menu",onClick:b=>{let m=b.currentTarget.getBoundingClientRect();r({x:Math.round(m.right),y:Math.round(m.bottom+4),on:y.id})},style:{position:"absolute",right:"calc(14px + var(--graview-dock, 0px))",top:98,zIndex:"var(--graview-layer-overview, 10)",minHeight:30,padding:"0 12px",borderRadius:8,fontSize:"0.8125rem",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)"},children:"Acts\u2026"})}var De=564;function it({placement:d}){let{store:r,menuAt:a,setMenuAt:p,view:h,signIn:H}=N(),v=(0,o.useRef)(null),y=(0,o.useRef)(null),b=(0,o.useRef)(null),m=(0,o.useRef)(null);a?.returnTo&&(m.current=a.returnTo);let Oe=e=>{let i=e.closest("[data-graview-asking]")?.getAttribute("data-graview-asking"),n=e.getAttribute("data-pin-for"),g=i??e.getAttribute("data-affordance")??(n===null?null:`pin:${n}`)??e.getAttribute("data-menu-item");y.current=g===null?null:{key:g,element:e}};(0,o.useEffect)(()=>{let e=v.current,i=y.current;if(i===null||document.activeElement!==document.body||i.element.isConnected)return;let n=i.key;if(!e){y.current=null;let I=m.current;m.current=null,(I?.isConnected?I:b.current)?.focus();return}((n.startsWith("pin:")?e.querySelector(`[data-pin-for="${CSS.escape(n.slice(4))}"]`):null)??e.querySelector(`[data-affordance="${CSS.escape(n)}"]:not([disabled])`)??e).focus()});let[Fe,qe]=(0,o.useState)(null);(0,o.useLayoutEffect)(()=>{let e=v.current?.offsetParent??v.current?.parentElement;if(e instanceof HTMLElement&&(b.current=e),!e)return;let i=e.getBoundingClientRect();qe(n=>n&&n.left===i.left&&n.top===i.top&&n.width===i.width&&n.height===i.height?n:{left:i.left,top:i.top,width:i.width,height:i.height})});let{selection:Be,set:je,clear:_e}=Q(),s=a?.about??Be,[D,Ue]=(0,o.useState)(()=>J()),O=a?.on??s[s.length-1],F=a?.about,Ve=(0,o.useMemo)(()=>({pins:D,...O===void 0?{}:{focus:O},...F?{about:F}:{}}),[D,O,F]),Ye=(0,o.useMemo)(()=>new Set(r.allMutations().filter(e=>e.pinned).map(e=>e.name)),[r]),{affordances:c,withheld:X,observations:Z}=Re(Ve),M=we(X,H),f=M?rt:X,Ge=a===null?null:{face:a.face??"scene",on:a.on,about:s,field:a.field,place:a.place,href:a.href,act:a.act,element:a.returnTo},ee=Ie(Ge),te=Z.some(e=>e.id.startsWith("schema:waits:")),{apply:Ke,preview:Qe}=Le(),[C,z]=(0,o.useState)(null),[Je,ne]=(0,o.useState)(!1),[ie,re]=(0,o.useState)(!1),[P,$]=(0,o.useState)(""),[ae,q]=(0,o.useState)(null),B=(0,o.useRef)([]),j=(e,i)=>{try{return Qe(e,i),Ke(e,i),q(null),p(null),B.current=[],!0}catch(n){return q(Ce(r.schema,r.allMutations(),n)),B.current=n instanceof ve?n.issues.map(g=>String(g.path[0]??"")).filter(Boolean):[],!1}},R=[...new Set(s.flatMap(e=>{let i=r.graph.getNode(e);return i?[i.kind]:[]}))],x=R.length>0?R:[...new Set(s.flatMap(e=>ke(e)))],u=s.length===1?xe(s[0]):null,_=u?{from:r.graph.getNode(u.from),to:r.graph.getNode(u.to)}:null,oe=u?Ee(r,u):void 0,le=oe?.provisional?oe:void 0,se=u?(()=>{let e=r.schema.tryDefinition(r.graph.getNode(u.from)?.kind??"")?.edges?.[u.kind],i=r.graph.getNode(u.to);return e?.inverse&&i?`From ${k(r,i.id)}: ${e.inverse}`:null})():null;(0,o.useEffect)(()=>{z(null),ne(!1),re(!1),q(null),$("")},[s,a?.about]);let l=a!==null,Xe=d==="menu"&&!l,S=(0,o.useRef)(a);S.current=a;let de=Te("acts",{open:l&&d==="menu",onOpenChange:e=>{e||p(null)},at:()=>S.current?{x:S.current.x,y:S.current.y}:null,returnTo:()=>{let e=S.current?.returnTo;if(e?.isConnected)return e;let i=S.current?.on;return i?document.querySelector(`[data-graview-view="${CSS.escape(i)}"]`):null},align:"start"}),ue=(Fe?.width??Number.POSITIVE_INFINITY)<De;if((0,o.useLayoutEffect)(()=>{let e=v.current?.offsetParent;if(!e||!ue||l)return;let i=v.current?.getBoundingClientRect().height??0,n=`${Math.round(i)+20}px`;if(e.style.paddingBottom===n)return;let g=e.style.paddingBottom;return e.style.paddingBottom=n,()=>{e.style.paddingBottom=g}}),s.length===0&&!l)return null;let pe=a?.title!==void 0||s.length>0&&!(s.length===1&&s[0]===h.focusId),ce=Math.max(1,Math.min(9,c.length)),A=[...c.filter(e=>e.provider==="invariant"&&!e.destructive),...c.filter(e=>e.pinned&&e.provider!=="invariant"&&!e.destructive),...c.filter(e=>!e.ties&&!e.destructive&&!e.pinned&&e.provider!=="invariant"),...c.filter(e=>e.ties&&!e.destructive&&!e.pinned&&e.provider!=="invariant"),...c.filter(e=>e.destructive)],ge=A.length>ce&&!l,he=P.trim().toLowerCase(),w=ge&&he.length>0?A.filter(e=>`${e.label} ${e.why}`.toLowerCase().includes(he)):null,U=w??(Je||l?A:A.slice(0,ce)),me=w?0:A.length-U.length,L=[];for(let e of U){let i=!l&&e.provider==="invariant",n=!l&&!i&&e.pinned!==void 0&&!e.destructive,g=!l&&!i&&!n&&e.ties===!0&&!e.destructive,I=i?e.why:n?"pinned":g?"its ties":null,et=i?"violation":n||g?"ties":null,Y=L[L.length-1];Y&&Y.heading===I?Y.items.push(e):L.push({heading:I,tone:et,items:[e]})}let V=c.find(e=>e.id===C),E=s.length===1?k(r,s[0]):null,fe=e=>{if(!E)return e;let i=e.startsWith(`"${E}"`)?e.slice(E.length+2):e.startsWith(E)?e.slice(E.length):null;if(i===null)return e;let n=i.trimStart();return n.length===0?e:n[0].toUpperCase()+n.slice(1)},Ze=new Set(l?[]:U.filter(e=>e.provider==="invariant").map(e=>e.why)),T=Z.filter(e=>!Ze.has(e.text)).map(e=>({...e,text:fe(e.text)}));return Xe?null:(0,t.jsxs)("section",{...l?de.pane:{},ref:e=>{v.current=e,l&&de.pane.ref(e)},"aria-label":"Inspector","data-graview-offstage":"","data-testid":l?"context-menu":"inspector-strip",tabIndex:-1,onFocus:e=>Oe(e.target),onBlur:e=>{e.relatedTarget!==null&&(y.current=null)},onMouseDown:e=>e.stopPropagation(),style:{...l?Ae:{position:"absolute",zIndex:be("rail")},boxSizing:"border-box",display:"flex",flexDirection:"column",gap:7,padding:"9px 12px",borderRadius:"var(--graview-radius, 12px)",border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",...l?{width:300,maxHeight:"min(52cqh, 420px)",overflow:"auto"}:ue?{left:10,right:10,width:"auto",bottom:10,maxHeight:"min(42cqh, 300px)",overflow:"auto"}:{left:14,top:h.overview?"min(296px, 38cqh)":44,width:236,maxHeight:h.overview?"calc(100cqh - min(296px, 38cqh) - 20px)":"calc(68cqh - 94px)",overflow:"auto"}},children:[(0,t.jsx)("h2",{style:{...He,margin:0},children:"Inspector"}),(0,t.jsxs)("div",{style:{display:pe||!l?"flex":"none",alignItems:"baseline",flexWrap:"wrap",gap:"2px 8px",minWidth:0,paddingRight:l?0:24},children:[pe?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("strong",{style:{fontSize:"0.9375rem",whiteSpace:"nowrap"},children:a?.title??(s.length===1?k(r,s[0]):`${s.length} selected`)}),R.length>0||u?(0,t.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",whiteSpace:"nowrap"},children:u?"relation":R.map(e=>W(r.schema.tryDefinition(e),e)).join(" \xB7 ")}):null,s.length===1&&!u&&a?.face!=="pages"?(0,t.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",whiteSpace:"nowrap"},children:h.expanded.includes(s[0])?"\xB7 double-click closes":"\xB7 double-click opens"}):null]}):null,(0,t.jsx)("span",{style:{flex:"1 1 auto"}})]}),l?null:(0,t.jsx)("button",{type:"button",onClick:()=>{p(null),_e()},"aria-label":"Clear selection",title:"Clear selection",style:{position:"absolute",top:6,right:6,flex:"0 0 auto",width:24,height:24,display:"grid",placeItems:"center",padding:0,fontSize:"0.875rem",lineHeight:1,borderRadius:7},children:"\xD7"}),u&&_?(0,t.jsxs)("div",{style:{display:"grid",gap:6},children:[se?(0,t.jsx)("p",{"data-testid":"edge-said",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:se}):null,le?(0,t.jsx)("p",{"data-testid":"edge-provisional",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:ze(le)}):null,(0,t.jsx)("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[["from",_.from],["to",_.to]].map(([e,i],n)=>(0,t.jsxs)(o.Fragment,{children:[n===1?(0,t.jsx)("span",{"aria-hidden":"true",style:{color:"var(--graview-ink-faint)"},children:"\u2192"}):null,i?(0,t.jsx)("button",{type:"button","data-testid":`edge-${e}`,onClick:()=>je([i.id]),title:`Select ${k(r,i.id)}`,style:{fontSize:"0.8125rem",padding:"3px 9px",borderRadius:6},children:k(r,i.id)}):(0,t.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink-faint)"},children:"gone"})]},e))})]}):null,!u&&s.length===1&&ye(r,s[0])?(0,t.jsx)("p",{"data-testid":"left-alone",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:"Left alone: nothing automated changes it."}):null,T.length>0?(0,t.jsx)("div",{"data-testid":"observations",title:T.map(e=>e.text).join(`
|
|
2
|
+
`),style:{display:"grid",gap:3},children:T.slice(0,2).map(e=>(0,t.jsxs)("p",{style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:[e.text,e===T[1]&&T.length>2?(0,t.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" +",T.length-2]}):null]},e.id))}):null,l?ee.start.map(e=>(0,t.jsx)(Ne,{section:e,close:()=>p(null)},e.id)):null,ae?(0,t.jsx)("p",{"data-testid":"refused",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-warn)"},children:ae}):null,ge?(0,t.jsx)("input",{"data-testid":"action-filter",value:P,onChange:e=>$(e.target.value),placeholder:`Filter ${A.length} actions\u2026`,"aria-label":"Filter actions",onKeyDown:e=>{if(e.key==="Escape"){e.stopPropagation(),P.length>0?$(""):e.currentTarget.blur();return}if(e.key==="Enter"&&w?.length===1){let i=w[0];if(i.destructive)return;i.open.length>0?z(i.id):j(i)&&$("")}},style:{font:"inherit",fontSize:"0.875rem",padding:"5px 9px",borderRadius:8,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)"}}):null,w!==null&&w.length===0?(0,t.jsxs)("p",{"data-testid":"no-matches",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:["Nothing offered here matches \u201C",P.trim(),"\u201D."]}):null,M&&c.length===0||c.length===0&&!te&&s.length===0?null:c.length===0&&!te?(0,t.jsx)("p",{"data-testid":"no-affordances",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:f.length>0?`Nothing you may do with ${u?"this relation":x.length===1?K(W(r.schema.tryDefinition(x[0]),x[0])):"this mix of kinds"} \u2014 ${f.length} action${f.length===1?"":"s"} withheld.`:u?`Nothing can be done with this line yet \u2014 nothing this app declares makes or breaks \u201C${Me(r.schema,r.graph.getNode(u.from)?.kind??"",u.kind,"out")}\u201D.`:`Nothing can be done with ${x.length===1?K(W(r.schema.tryDefinition(x[0]),x[0])):"this mix of kinds"} yet \u2014 nothing this app declares acts on ${x.length===1?"it":"them"}.`}):(0,t.jsxs)("ol",{"data-testid":"affordances",style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",flexWrap:"nowrap",gap:2},children:[L.map((e,i)=>(0,t.jsxs)(o.Fragment,{children:[e.heading?(0,t.jsxs)("li",{"data-graview-heading":e.tone,style:{fontSize:"0.75rem",lineHeight:1.4,color:e.tone==="violation"?"var(--graview-warn)":"var(--graview-ink-faint)",...e.tone!=="violation"?{letterSpacing:"0.12em",textTransform:"uppercase",fontSize:"0.75rem"}:{},padding:"2px 2px 1px",marginTop:i>0?6:0},children:[e.tone==="violation"?"\u26A0 ":"",e.tone==="violation"?fe(e.heading):e.heading]}):i>0?(0,t.jsx)("li",{"aria-hidden":"true",style:{borderTop:"1px solid var(--graview-edge)",margin:"6px 0 3px"}}):null,e.items.map(n=>(0,t.jsxs)("li",{style:{display:"flex",gap:2,alignItems:"stretch"},children:[(0,t.jsxs)("button",{type:"button","data-affordance":n.id,"data-rank":n.rank,"data-graview-destructive":n.destructive||void 0,"aria-pressed":C===n.id,title:n.why,style:{padding:"5px 10px",fontSize:"0.875rem",borderRadius:8,width:"100%",textAlign:"left",borderWidth:1,borderStyle:"solid",borderColor:C===n.id?"var(--graview-accent)":l?"transparent":"var(--graview-edge)",background:l?"none":"var(--graview-panel)",boxShadow:"none",...n.destructive?{color:"var(--graview-warn)"}:{},...C===n.id?{color:"var(--graview-accent)"}:{}},onClick:()=>{if(n.open.length>0){z(C===n.id?null:n.id);return}j(n)},children:[n.label,n.open.length>0?(0,t.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:" \u2026"}):null,w?.length===1&&w[0]?.id===n.id&&!n.destructive?(0,t.jsx)("span",{"aria-hidden":"true",title:"Enter runs it",style:{float:"right",color:"var(--graview-ink-faint)",fontSize:"0.75rem"},children:"\u21B5"}):null]}),(0,t.jsx)("button",{type:"button","data-testid":"pin-toggle","data-pin-for":n.mutation,"aria-pressed":n.pinned!==void 0,"aria-label":n.pinned!==void 0?`Unpin ${n.label}`:`Pin ${n.label}`,title:n.pinned==="declared"?"Pinned by the app \u2014 unpin it for yourself":n.pinned==="user"?"Unpin":"Pin to the top",onClick:()=>Ue(We(D,n.mutation,Ye.has(n.mutation))),style:{flex:"0 0 auto",width:24,minHeight:24,display:"grid",placeItems:"center",padding:0,fontSize:"0.75rem",border:"1px solid transparent",background:"none",boxShadow:"none",borderRadius:7,color:n.pinned==="user"?"var(--graview-accent)":n.pinned==="declared"?"var(--graview-ink-muted)":"var(--graview-ink-faint)"},children:n.pinned!==void 0?"\u2605":"\u2606"})]},n.id))]},`${e.heading??"plain"}-${i}`)),me>0?(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button",onClick:()=>ne(!0),title:`Show all ${c.length} actions`,style:{padding:"4px 10px",fontSize:"0.875rem",borderRadius:8},children:["Show ",me," more"]})}):null]}),M?(0,t.jsx)("button",{type:"button","data-testid":"sign-in",onClick:()=>{p(null),M.run()},style:{padding:"5px 10px",fontSize:"0.875rem",borderRadius:8,width:"100%",textAlign:"left"},children:M.label}):null,f.length>0?(0,t.jsxs)("ul",{"data-testid":"withheld",style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",flexWrap:"nowrap",gap:2},children:[f.slice(0,l||ie?f.length:3).map(e=>(0,t.jsxs)("li",{style:{display:"grid",gap:2},children:[(0,t.jsx)("button",{type:"button",disabled:!0,"data-affordance":e.id,"data-rank":e.rank,"data-withheld":e.refusal.wouldNeed.join(",")||"nobody",style:{padding:"4px 10px",fontSize:"0.875rem",borderRadius:8,borderStyle:"dashed",width:"100%",textAlign:"left",background:"none"},children:(0,t.jsx)("s",{children:e.label})}),(0,t.jsx)("span",{"data-testid":"withheld-why",style:{fontSize:"0.8125rem",lineHeight:1.4,color:"var(--graview-ink-muted)",padding:"0 10px"},children:e.refusal.message})]},e.id)),!l&&!ie&&f.length>3?(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button","data-testid":"withheld-more",onClick:()=>re(!0),title:`Show all ${f.length} actions this seat may not take`,style:{padding:"4px 10px",fontSize:"0.875rem",borderRadius:8},children:["Show ",f.length-3," more withheld"]})}):null]}):null,l?ee.end.map(e=>(0,t.jsx)(Ne,{section:e,close:()=>p(null)},e.id)):null,V?(0,t.jsx)(Pe,{affordance:V,onApply:e=>{if(j(V,e))z(null);else return B.current},onCancel:()=>z(null)}):null]})}var rt=[];function Ne({section:d,close:r}){return(0,t.jsxs)("div",{"data-menu-section":d.id,...d.heading?{role:"group","aria-label":d.heading}:{},style:{display:"grid",gap:2,borderTop:"1px solid var(--graview-edge)",paddingTop:5},children:[d.heading?(0,t.jsx)("p",{"aria-hidden":"true",style:{margin:0,padding:"2px 2px 1px",fontSize:"0.75rem",lineHeight:1.4,letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:d.heading}):null,d.items&&d.items.length>0?(0,t.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",gap:2},children:d.items.map(a=>(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button","data-menu-item":a.id,onClick:()=>{r(),a.run()},style:{padding:"5px 10px",fontSize:"0.875rem",borderRadius:8,width:"100%",textAlign:"left",borderWidth:1,borderStyle:"solid",borderColor:"transparent",background:"none",boxShadow:"none"},children:[a.label,a.hint?(0,t.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",a.hint]}):null]})},a.id))}):null,d.render?.(r)]})}export{ft as InspectorPane,mt as prepareActs};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{A as kr,F as O,Q as b,Y as le,Z as de,a as H,b as Pe,f as Le,ga as Sr,ja as Pr,m as hr,n as br,na as Lr,oa as Tr,pa as Ar,sa as G,t as xr,w as Z,wa as q,xa as N}from"./chunk.6QWV5MVH.js";import{$b as or,Ac as ke,Cc as pr,Dc as ur,Ec as X,Kb as Ze,Kc as gr,La as Qe,Lc as fr,Mb as Je,Mc as mr,Nb as se,Nc as wr,Ob as xe,Oc as vr,Pb as er,Pc as Se,Qb as rr,Rb as tr,Sb as nr,Sc as yr,Tb as ar,Vb as ir,X as je,Za as Xe,aa as Ye,ba as Ue,bc as sr,ec as lr,fc as dr,xc as cr,yc as Q}from"./chunk.MNP4JI33.js";import{a as qe,b as y}from"./chunk.AJZBJBMO.js";var Nr=qe(S=>{"use strict";var At=O();function Hr(r){var e="https://react.dev/errors/"+r;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var t=2;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t])}return"Minified React error #"+r+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function V(){}var k={d:{f:V,r:function(){throw Error(Hr(522))},D:V,C:V,L:V,m:V,X:V,S:V,M:V},p:0,findDOMNode:null},Et=Symbol.for("react.portal");function $t(r,e,t){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Et,key:n==null?null:""+n,children:r,containerInfo:e,implementation:t}}var J=At.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function pe(r,e){if(r==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}S.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=k;S.createPortal=function(r,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(Hr(299));return $t(r,e,null,t)};S.flushSync=function(r){var e=J.T,t=k.p;try{if(J.T=null,k.p=2,r)return r()}finally{J.T=e,k.p=t,k.d.f()}};S.preconnect=function(r,e){typeof r=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,k.d.C(r,e))};S.prefetchDNS=function(r){typeof r=="string"&&k.d.D(r)};S.preinit=function(r,e){if(typeof r=="string"&&e&&typeof e.as=="string"){var t=e.as,n=pe(t,e.crossOrigin),i=typeof e.integrity=="string"?e.integrity:void 0,a=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;t==="style"?k.d.S(r,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:n,integrity:i,fetchPriority:a}):t==="script"&&k.d.X(r,{crossOrigin:n,integrity:i,fetchPriority:a,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};S.preinitModule=function(r,e){if(typeof r=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var t=pe(e.as,e.crossOrigin);k.d.M(r,{crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&k.d.M(r)};S.preload=function(r,e){if(typeof r=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var t=e.as,n=pe(t,e.crossOrigin);k.d.L(r,t,{crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};S.preloadModule=function(r,e){if(typeof r=="string")if(e){var t=pe(e.as,e.crossOrigin);k.d.m(r,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else k.d.m(r)};S.requestFormReset=function(r){k.d.r(r)};S.unstable_batchedUpdates=function(r,e){return r(e)};S.useFormState=function(r,e,t){return J.H.useFormState(r,e,t)};S.useFormStatus=function(){return J.H.useHostTransitionStatus()};S.version="19.2.8"});var Cr=qe((Qn,Rr)=>{"use strict";function Br(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Br)}catch(r){console.error(r)}}Br(),Rr.exports=Nr()});var Te=y(O(),1),Er=new WeakMap,ce=r=>{let e=Er.get(r);return e||Er.set(r,e={open:null,drawn:0,listeners:new Set}),e},Pt=r=>{for(let e of[...r.listeners])e()},Lt=0;function qn(r,e){let t=ce(r);t.open=e?{...e,at:++Lt}:null,Pt(t)}var $r=r=>e=>{let t=ce(r);return t.listeners.add(e),()=>void t.listeners.delete(e)};function Or(r){let e=()=>r?ce(r).drawn>0:!1;return(0,Te.useSyncExternalStore)(r?$r(r):Tt,e,e)}var Tt=()=>()=>{};function jn(r){let e=()=>ce(r).open;return(0,Te.useSyncExternalStore)($r(r),e,e)}var _=y(O(),1),_r=y(Cr(),1);function Ot(r){let[e,t]=(0,_.useState)(null),[n,i]=(0,_.useState)(null);return(0,_.useLayoutEffect)(()=>{r.current!==n&&i(r.current)}),(0,_.useLayoutEffect)(()=>{if(!n||typeof ResizeObserver>"u")return;let a=()=>Math.round(n.getBoundingClientRect().width);t(a());let o=new ResizeObserver(()=>{let d=a();(0,_r.flushSync)(()=>t(d))});return o.observe(n),()=>o.disconnect()},[n]),e}function Ht(r=!0){let[e,t]=(0,_.useState)();return(0,_.useEffect)(()=>{if(!r)return t(void 0);let n=0,i=()=>t(innerHeight),a=()=>{i(),clearTimeout(n),n=window.setTimeout(i,300)},o=d=>{for(let[p,s]of[[window,"resize"],[window,"orientationchange"],[window.visualViewport,"resize"]])p?.[d](s,a)};return o("addEventListener"),i(),()=>{clearTimeout(n),o("removeEventListener")}},[r]),e}var ue={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",whiteSpace:"nowrap"};var C=N(H(()=>(__graviewPreload(import.meta.url,["./chunk.JDUJDAGA.js","./chunk.J25KOSNW.js","./chunk.LR3VDXPI.js","./chunk.COQKECUH.js","./chunk.EJPI3ST6.js","./chunk.CWHRDBOF.js","./chunk.3K6YSVHC.js","./chunk.SHTJZ6UX.js","./chunk.UT6642FC.js","./chunk.TI4OSTQV.js","./chunk.GZHZLJBF.js","./chunk.XMC7YDWT.js","./chunk.6UGEYZAC.js","./chunk.OJGHDWI6.js","./chunk.B2GLDIAS.js","./chunk.6YCBYL2Y.js","./chunk.UGFJKSHU.js","./chunk.JOOQUWLT.js","./chunk.6QWV5MVH.js","./chunk.MNP4JI33.js","./chunk.AJZBJBMO.js"]),import("./chunk.GO4XBWJO.js"))));var w=y(O(),1);var Vr=y(O(),1);var Mr=y(O(),1);function Dr(r){return(0,Mr.useMemo)(()=>r===void 0||r===""?void 0:{__html:r},[r])}var ee=y(b(),1);function Ae({brand:r,size:e=22}){let t=r?.logo,n=t!==void 0&&tr(t)&&nr(t)===null?t:void 0,i=Dr(n),a={display:"inline-flex",flex:"0 0 auto",height:e,color:"var(--graview-accent)"},o=ir(r);if(o)return(0,ee.jsx)("span",{className:"graview-logo graview-emoji-mark","data-testid":"app-mark","aria-hidden":!0,style:{...a,alignItems:"center",fontSize:`${e*.86/16}rem`,lineHeight:1},children:o});if(!t||!ar(t))return null;let d=r?.logoAlt??r?.name??"",p=d!==""&&d!==r?.name;return n?(0,ee.jsx)("span",{className:"graview-logo","data-testid":"app-mark",style:a,...p?{role:"img","aria-label":d}:{"aria-hidden":!0},dangerouslySetInnerHTML:i}):(0,ee.jsx)("img",{className:"graview-logo","data-testid":"app-mark",src:t,alt:p?d:"",style:{...a,width:"auto"}})}function Nt(r){(0,Vr.useEffect)(()=>{if(!r||typeof document>"u")return;let e=[...document.querySelectorAll('link[rel~="icon"]')],t=e.map(i=>i.getAttribute("href")),n;e.length===0&&(n=document.createElement("link"),n.rel="icon",n.setAttribute("data-graview-favicon",""),document.head.appendChild(n),e.push(n));for(let i of e)i.href=r;return()=>{n&&n.remove(),e.forEach((i,a)=>{i!==n&&t[a]!==null&&t[a]!==void 0&&i.setAttribute("href",t[a])})}},[r])}var l=y(b(),1),Bt=C.part((r,e)=>(0,l.jsx)(r.Here,{...e}),{quiet:!0});function Rt(){let r=de(),[e,t]=(0,w.useState)("");return(0,w.useEffect)(()=>r?.store.subscribe((n,i)=>{i.some(a=>a.author.id!==r.principal.id)&&C.load().then(a=>a.sayTheirChange(i,r,t),String)}),[r]),(0,l.jsx)("span",{role:"status",className:"graview-bar-said",children:e})}var Fr="home",Ir="/",z="scene:whole";function Ct(r){let{store:e,principal:t,views:n}=r,i=e.kindsKeptFrom(t),a=e.schema.kinds.filter(g=>!e.modules.disabledKinds.has(g)&&!i.has(g)),o=n?.arrangement?.(),d=n?.places()??[],p=wr(o,e.schema,d),s=mr(e.schema,o,[...e.modules.administered.values()].flatMap(g=>g.kinds??[])),c=(g,P)=>(!e.graph.size.nodes||e.graph.count(g)>0)&&(p?P?p.places.has(`${g}|${P}`):p.kinds.has(g):!s.has(g)),u=[{key:Fr,label:"Home",path:Ir,group:"home",primary:!0}],f=d.filter(g=>a.includes(g.kind)&&g.as!==vr&&!g.hidden),v=new Set(Q(f).map(g=>X(g,d,e.schema).toLowerCase()));for(let g of yr(a,o?.order)){let P=Ye(e.schema,g),R=v.has(P.toLowerCase());u.push({key:`kind:${g}`,label:R?Ue(e.schema,g):P,path:ke(e.schema,g),group:"lists",kind:g,primary:R?!1:c(g)})}for(let g of Q(f)){let P=pr(g.as,ur(g,d)?ke(e.schema,g.kind).slice(1):void 0),R=[g.kind,...g.over??[]].some(K=>a.includes(K)&&c(K,g.as));u.some(K=>K.path===P)||u.push({key:`place:${g.kind}:${g.as}`,label:X(g,d,e.schema),path:P,group:"pictures",kind:g.kind,primary:R})}return a.some(g=>Object.keys(e.schema.tryDefinition(g)?.edges??{}).length>0)&&u.push({key:"connections",label:"Connections",path:"/map",group:"pictures",primary:!1}),u}function _t(r,e){let[t="/",n=""]=e.split("?"),i=r.find(o=>o.path===(n?`${t}?${n}`:t))??r.find(o=>o.path===t);if(i)return i.key;let a=`/${t.split("/").filter(Boolean)[0]??""}`;return r.find(o=>o.group==="lists"&&o.path===a)?.key??null}var Wr=(0,w.createContext)(null),Mt=()=>(0,w.useContext)(Wr),j=30,zr=48,re=640,Oe=4,Ee=2;function Kr(r){let{widths:e,current:t,room:n,more:i,gap:a=Oe,primary:o,most:d=fr}=r;if(e.length===0||!(n>0)||!(i>0)||e.some(u=>!(u>0)))return null;let p=(u,f)=>u.reduce((v,x)=>v+e[x],0)+a*Math.max(0,u.length-1)+(f?a+i:0),s=(u,f)=>t<0||!u.includes(t)||u.slice(0,f).includes(t)?u.slice(0,f):[...u.filter(v=>v!==t).slice(0,f-1),t].sort((v,x)=>v-x),c=s(e.map((u,f)=>f).filter(u=>o?.[u]!==!1||u===t),d);if(p(c,c.length<e.length)<=n)return c.length>=Ee?c:null;for(let u=c.length-1;u>=Ee;u--){let f=s(c,u);if(p(f,!0)<=n)return f}return null}var Dt=`
|
|
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 kr,F as O,Q as b,Y as le,Z as de,a as H,b as Pe,f as Le,ga as Sr,ja as Pr,m as hr,n as br,na as Lr,oa as Tr,pa as Ar,sa as G,t as xr,w as Z,wa as q,xa as N}from"./chunk.ZTD2CNC3.js";import{Bc as ke,Dc as pr,Ec as ur,Fc as X,La as Qe,Lb as Ze,Lc as gr,Mc as fr,Nb as Je,Nc as mr,Ob as se,Oc as wr,Pb as xe,Pc as vr,Qb as er,Qc as Se,Rb as rr,Sb as tr,Tb as nr,Tc as yr,Ub as ar,Wb as ir,X as je,Za as Xe,aa as Ye,ac as or,ba as Ue,cc as sr,fc as lr,gc as dr,yc as cr,zc as Q}from"./chunk.X7W27IRI.js";import{a as qe,b as y}from"./chunk.AJZBJBMO.js";var Nr=qe(S=>{"use strict";var At=O();function Hr(r){var e="https://react.dev/errors/"+r;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var t=2;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t])}return"Minified React error #"+r+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function V(){}var k={d:{f:V,r:function(){throw Error(Hr(522))},D:V,C:V,L:V,m:V,X:V,S:V,M:V},p:0,findDOMNode:null},Et=Symbol.for("react.portal");function $t(r,e,t){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Et,key:n==null?null:""+n,children:r,containerInfo:e,implementation:t}}var J=At.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function pe(r,e){if(r==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}S.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=k;S.createPortal=function(r,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(Hr(299));return $t(r,e,null,t)};S.flushSync=function(r){var e=J.T,t=k.p;try{if(J.T=null,k.p=2,r)return r()}finally{J.T=e,k.p=t,k.d.f()}};S.preconnect=function(r,e){typeof r=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,k.d.C(r,e))};S.prefetchDNS=function(r){typeof r=="string"&&k.d.D(r)};S.preinit=function(r,e){if(typeof r=="string"&&e&&typeof e.as=="string"){var t=e.as,n=pe(t,e.crossOrigin),i=typeof e.integrity=="string"?e.integrity:void 0,a=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;t==="style"?k.d.S(r,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:n,integrity:i,fetchPriority:a}):t==="script"&&k.d.X(r,{crossOrigin:n,integrity:i,fetchPriority:a,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};S.preinitModule=function(r,e){if(typeof r=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var t=pe(e.as,e.crossOrigin);k.d.M(r,{crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&k.d.M(r)};S.preload=function(r,e){if(typeof r=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var t=e.as,n=pe(t,e.crossOrigin);k.d.L(r,t,{crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};S.preloadModule=function(r,e){if(typeof r=="string")if(e){var t=pe(e.as,e.crossOrigin);k.d.m(r,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else k.d.m(r)};S.requestFormReset=function(r){k.d.r(r)};S.unstable_batchedUpdates=function(r,e){return r(e)};S.useFormState=function(r,e,t){return J.H.useFormState(r,e,t)};S.useFormStatus=function(){return J.H.useHostTransitionStatus()};S.version="19.2.8"});var Cr=qe((Qn,Rr)=>{"use strict";function Br(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Br)}catch(r){console.error(r)}}Br(),Rr.exports=Nr()});var Te=y(O(),1),Er=new WeakMap,ce=r=>{let e=Er.get(r);return e||Er.set(r,e={open:null,drawn:0,listeners:new Set}),e},Pt=r=>{for(let e of[...r.listeners])e()},Lt=0;function qn(r,e){let t=ce(r);t.open=e?{...e,at:++Lt}:null,Pt(t)}var $r=r=>e=>{let t=ce(r);return t.listeners.add(e),()=>void t.listeners.delete(e)};function Or(r){let e=()=>r?ce(r).drawn>0:!1;return(0,Te.useSyncExternalStore)(r?$r(r):Tt,e,e)}var Tt=()=>()=>{};function jn(r){let e=()=>ce(r).open;return(0,Te.useSyncExternalStore)($r(r),e,e)}var _=y(O(),1),_r=y(Cr(),1);function Ot(r){let[e,t]=(0,_.useState)(null),[n,i]=(0,_.useState)(null);return(0,_.useLayoutEffect)(()=>{r.current!==n&&i(r.current)}),(0,_.useLayoutEffect)(()=>{if(!n||typeof ResizeObserver>"u")return;let a=()=>Math.round(n.getBoundingClientRect().width);t(a());let o=new ResizeObserver(()=>{let d=a();(0,_r.flushSync)(()=>t(d))});return o.observe(n),()=>o.disconnect()},[n]),e}function Ht(r=!0){let[e,t]=(0,_.useState)();return(0,_.useEffect)(()=>{if(!r)return t(void 0);let n=0,i=()=>t(innerHeight),a=()=>{i(),clearTimeout(n),n=window.setTimeout(i,300)},o=d=>{for(let[p,s]of[[window,"resize"],[window,"orientationchange"],[window.visualViewport,"resize"]])p?.[d](s,a)};return o("addEventListener"),i(),()=>{clearTimeout(n),o("removeEventListener")}},[r]),e}var ue={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",whiteSpace:"nowrap"};var C=N(H(()=>(__graviewPreload(import.meta.url,["./chunk.G64AREGA.js","./chunk.XK4FVT2X.js","./chunk.WAB6ZS2V.js","./chunk.3C4RJIJU.js","./chunk.YJCT3DV2.js","./chunk.XXMYKBLT.js","./chunk.34CYK2DF.js","./chunk.JZBBGY4B.js","./chunk.UT6642FC.js","./chunk.TI4OSTQV.js","./chunk.GZHZLJBF.js","./chunk.WLBXBNNH.js","./chunk.7MTX33WD.js","./chunk.OJGHDWI6.js","./chunk.Z7ZCR4LN.js","./chunk.RIW7SQH4.js","./chunk.FSAHO3LV.js","./chunk.PNVR3CXR.js","./chunk.ZTD2CNC3.js","./chunk.X7W27IRI.js","./chunk.AJZBJBMO.js"]),import("./chunk.UCIQIPBQ.js"))));var w=y(O(),1);var Vr=y(O(),1);var Mr=y(O(),1);function Dr(r){return(0,Mr.useMemo)(()=>r===void 0||r===""?void 0:{__html:r},[r])}var ee=y(b(),1);function Ae({brand:r,size:e=22}){let t=r?.logo,n=t!==void 0&&tr(t)&&nr(t)===null?t:void 0,i=Dr(n),a={display:"inline-flex",flex:"0 0 auto",height:e,color:"var(--graview-accent)"},o=ir(r);if(o)return(0,ee.jsx)("span",{className:"graview-logo graview-emoji-mark","data-testid":"app-mark","aria-hidden":!0,style:{...a,alignItems:"center",fontSize:`${e*.86/16}rem`,lineHeight:1},children:o});if(!t||!ar(t))return null;let d=r?.logoAlt??r?.name??"",p=d!==""&&d!==r?.name;return n?(0,ee.jsx)("span",{className:"graview-logo","data-testid":"app-mark",style:a,...p?{role:"img","aria-label":d}:{"aria-hidden":!0},dangerouslySetInnerHTML:i}):(0,ee.jsx)("img",{className:"graview-logo","data-testid":"app-mark",src:t,alt:p?d:"",style:{...a,width:"auto"}})}function Nt(r){(0,Vr.useEffect)(()=>{if(!r||typeof document>"u")return;let e=[...document.querySelectorAll('link[rel~="icon"]')],t=e.map(i=>i.getAttribute("href")),n;e.length===0&&(n=document.createElement("link"),n.rel="icon",n.setAttribute("data-graview-favicon",""),document.head.appendChild(n),e.push(n));for(let i of e)i.href=r;return()=>{n&&n.remove(),e.forEach((i,a)=>{i!==n&&t[a]!==null&&t[a]!==void 0&&i.setAttribute("href",t[a])})}},[r])}var l=y(b(),1),Bt=C.part((r,e)=>(0,l.jsx)(r.Here,{...e}),{quiet:!0});function Rt(){let r=de(),[e,t]=(0,w.useState)("");return(0,w.useEffect)(()=>r?.store.subscribe((n,i)=>{i.some(a=>a.author.id!==r.principal.id)&&C.load().then(a=>a.sayTheirChange(i,r,t),String)}),[r]),(0,l.jsx)("span",{role:"status",className:"graview-bar-said",children:e})}var Fr="home",Ir="/",z="scene:whole";function Ct(r){let{store:e,principal:t,views:n}=r,i=e.kindsKeptFrom(t),a=e.schema.kinds.filter(g=>!e.modules.disabledKinds.has(g)&&!i.has(g)),o=n?.arrangement?.(),d=n?.places()??[],p=wr(o,e.schema,d),s=mr(e.schema,o,[...e.modules.administered.values()].flatMap(g=>g.kinds??[])),c=(g,P)=>(!e.graph.size.nodes||e.graph.count(g)>0)&&(p?P?p.places.has(`${g}|${P}`):p.kinds.has(g):!s.has(g)),u=[{key:Fr,label:"Home",path:Ir,group:"home",primary:!0}],f=d.filter(g=>a.includes(g.kind)&&g.as!==vr&&!g.hidden),v=new Set(Q(f).map(g=>X(g,d,e.schema).toLowerCase()));for(let g of yr(a,o?.order)){let P=Ye(e.schema,g),R=v.has(P.toLowerCase());u.push({key:`kind:${g}`,label:R?Ue(e.schema,g):P,path:ke(e.schema,g),group:"lists",kind:g,primary:R?!1:c(g)})}for(let g of Q(f)){let P=pr(g.as,ur(g,d)?ke(e.schema,g.kind).slice(1):void 0),R=[g.kind,...g.over??[]].some(K=>a.includes(K)&&c(K,g.as));u.some(K=>K.path===P)||u.push({key:`place:${g.kind}:${g.as}`,label:X(g,d,e.schema),path:P,group:"pictures",kind:g.kind,primary:R})}return a.some(g=>Object.keys(e.schema.tryDefinition(g)?.edges??{}).length>0)&&u.push({key:"connections",label:"Connections",path:"/map",group:"pictures",primary:!1}),u}function _t(r,e){let[t="/",n=""]=e.split("?"),i=r.find(o=>o.path===(n?`${t}?${n}`:t))??r.find(o=>o.path===t);if(i)return i.key;let a=`/${t.split("/").filter(Boolean)[0]??""}`;return r.find(o=>o.group==="lists"&&o.path===a)?.key??null}var Wr=(0,w.createContext)(null),Mt=()=>(0,w.useContext)(Wr),j=30,zr=48,re=640,Oe=4,Ee=2;function Kr(r){let{widths:e,current:t,room:n,more:i,gap:a=Oe,primary:o,most:d=fr}=r;if(e.length===0||!(n>0)||!(i>0)||e.some(u=>!(u>0)))return null;let p=(u,f)=>u.reduce((v,x)=>v+e[x],0)+a*Math.max(0,u.length-1)+(f?a+i:0),s=(u,f)=>t<0||!u.includes(t)||u.slice(0,f).includes(t)?u.slice(0,f):[...u.filter(v=>v!==t).slice(0,f-1),t].sort((v,x)=>v-x),c=s(e.map((u,f)=>f).filter(u=>o?.[u]!==!1||u===t),d);if(p(c,c.length<e.length)<=n)return c.length>=Ee?c:null;for(let u=c.length-1;u>=Ee;u--){let f=s(c,u);if(p(f,!0)<=n)return f}return null}var Dt=`
|
|
2
2
|
.graview-bar{display:block;margin:0;padding:0;container:graview-bar/inline-size;flex:0 0 auto;position:relative;background:var(--graview-bar);border-bottom:1px solid var(--graview-edge);color:var(--graview-ink);font-family:var(--graview-font-body,system-ui)}
|
|
3
3
|
.graview-bar-row{display:flex;flex-wrap:nowrap;align-items:center;gap:16px;height:${zr-1}px;margin:0;padding:0 16px}
|
|
4
4
|
.graview-bar-home,.graview-bar-face,.graview-bar-place,.graview-bar-item,.graview-bar-at{display:inline-flex;align-items:center;box-sizing:border-box;min-width:0;margin:0;border:0;background:none;box-shadow:none;font:inherit;letter-spacing:normal;text-transform:none;text-decoration:none;color:var(--graview-ink);cursor:pointer;text-align:left}
|
|
@@ -325,7 +325,7 @@ code { color: var(--graview-ink-muted); font-size: 0.8125rem; letter-spacing: 0.
|
|
|
325
325
|
@media (prefers-reduced-motion: reduce) {
|
|
326
326
|
${Zr(`${d}:not([data-graview-motion='full'])`,o)}
|
|
327
327
|
}
|
|
328
|
-
${Zr(`${d}[data-graview-motion='reduce']`,o)}`}var F=y(O(),1);var L=y(b(),1);function sn({scheme:r,onScheme:e,profileHref:t,keeping:n,hostActions:i=ln,signature:a=!1}){let{store:o,principal:d,seats:p,people:s}=le(),c=q("profile"),u=c.open,[f,v]=(0,F.useState)(!1);(0,F.useEffect)(()=>pn(ge),[]),u&&!f&&v(!0),(0,F.useEffect)(()=>{u&&ge()},[u]);let x=d.id===void 0?void 0:o.graph.getNode(d.id),g=x===void 0?d.id===void 0?"Nobody in particular":Qe(d,{graph:o.graph,schema:o.schema,seats:p,people:s}):je(o.schema.tryDefinition(x.kind),x);return(0,L.jsxs)("div",{style:{position:"relative"},children:[(0,L.jsx)("button",{type:"button","data-testid":"profile-button",...c.trigger,onClick:c.toggle,onPointerEnter:ge,onFocus:ge,"aria-label":`${g} \u2014 you, your seat and your settings`,title:`${g} \u2014 you, your seat and your settings`,style:{...Y,borderRadius:999},children:(0,L.jsx)("span",{"aria-hidden":"true","data-testid":"profile-mark",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:j-4,height:j-4,borderRadius:999,fontSize:"0.8125rem",fontWeight:600,background:"var(--graview-panel-muted)",color:"var(--graview-ink)",border:"1px solid var(--graview-edge)"},children:un(g)})}),(0,L.jsxs)("section",{...c.pane,"aria-label":"Profile","data-testid":"profile","data-graview-offstage":"",hidden:!u,style:{...G,width:280,maxWidth:"calc(100vw - 32px)",maxHeight:"min(62cqh, 520px)",overflowY:"auto",overflowX:"hidden",display:u?"grid":"none",gap:12,padding:12,borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:[f?(0,L.jsx)(F.Suspense,{fallback:null,children:(0,L.jsx)(dn,{part:"top",name:g,me:x,profileHref:t,hostActions:i,close:()=>c.setOpen(!1)})}):null,(0,L.jsxs)("div",{className:"graview-profile-keeping","data-testid":"profile-keeping",style:fn,children:[(0,L.jsx)("span",{style:gn,children:"Keeping this app"}),n]}),f?(0,L.jsx)(F.Suspense,{fallback:null,children:(0,L.jsx)(cn,{part:"rest",name:g,me:x,scheme:r,onScheme:e,hostActions:i,signature:a,close:()=>c.setOpen(!1)})}):null]})]})}var ln=[],ge=()=>C.prefetch(),dn=C.part((r,e)=>(0,L.jsx)(r.ProfilePane,{...e}),{what:"The rest of your menu"}),cn=C.part((r,e)=>(0,L.jsx)(r.ProfilePane,{...e}),{quiet:!0});function pn(r){let e=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&r()},t=globalThis;if(t.requestIdleCallback){let i=t.requestIdleCallback(e,{timeout:5e3});return()=>t.cancelIdleCallback?.(i)}let n=setTimeout(e,2500);return()=>clearTimeout(n)}function un(r){return(r.trim()[0]??"?").toUpperCase()}var gn={fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},fn={paddingTop:10,borderTop:"1px solid var(--graview-edge)"};function mn(r){return!(r==="hidden"||r===!1)}var Ne=y(O(),1);var rt="The whole thing",fe=r=>`scene:${r.kind}:${r.as}`;function tt(r){let{view:e}=r,t=r.places.filter(c=>!r.hidden.has(c.kind)),n=Q(t),i=(c,u)=>{if(c===z)return hr(br(u,!0),"view",null);let f=n.find(v=>fe(v)===c);return f?kr(u,f.over?.find(v=>u.focusId===Z(v))??f.kind,f.as):null},a=[{key:z,label:rt,path:`${Se}${Le(i(z,Pe))}`,group:"home"},...n.map(c=>({key:fe(c),label:X(c,t,r.schema),path:`${Se}${Le(i(fe(c),Pe))}`,group:"pictures",kind:c.kind}))],o=e.within?.view,d=c=>e.focusId===Z(c.kind)&&(o===void 0?t.filter(u=>u.kind===c.kind).at(-1)===c:o===c.as),p=t.find(c=>d(c)&&(o!==void 0||!e.overview)),s=p?n.find(c=>cr(c,p)):void 0;return{places:a,current:s?fe(s):z,to:i}}function wn(){let{store:r,views:e,hiddenKinds:t}=le(),{view:n,go:i}=Ar(),a=e.places(),o=(0,Ne.useMemo)(()=>tt({places:a,hidden:t,view:n,schema:r.schema}),[a,t,n,r.schema]),d=(0,Ne.useMemo)(()=>({go:p=>{let s=o.to(p.key,n);s&&i(s)}}),[o,n,i]);return{places:o.places,current:o.current,reach:d}}var T=y(O(),1);var E=y(b(),1),nt=6e3;function vn(){let r=[],e=0,t=new Set,n=new Map,i,a=()=>{for(let s of[...t])s()},o=s=>{if(clearTimeout(n.get(s.id)),n.delete(s.id),s.kind!=="toast")return;let c=(s.actions?.length??0)+(s.action?1:0),u=s.timeout??(c>0?!1:nt);u!==!1&&n.set(s.id,setTimeout(()=>i?.()?o(s):d(s.id),u))},d=s=>{clearTimeout(n.get(s)),n.delete(s),r.some(c=>c.id===s)&&(r=r.filter(c=>c.id!==s),a())},p=s=>{r=r.some(c=>c.id===s.id)?r.map(c=>c.id===s.id?s:c):[...r,s],o(s),a()};return{notify(s){let c=s.id??`notice-${++e}`;return p({...s,id:c,said:++e}),{id:c,dismiss:()=>d(c),update:u=>{let f=r.find(v=>v.id===c);f&&p({...f,...u,id:c,kind:f.kind,said:u.sentence!==void 0&&u.sentence!==f.sentence?++e:f.said})}}},dismiss:d,hold(s){i=s},list:()=>r,subscribe(s){return t.add(s),()=>t.delete(s)}}}function yn({notices:r}){let e=r.reduce((d,p)=>!d||p.said>d.said?p:d,void 0),[t,n]=(0,T.useState)(""),[i,a]=(0,T.useState)(""),o=(0,T.useRef)(0);return(0,T.useEffect)(()=>{if(!e||e.said===o.current)return;o.current=e.said;let d=e.tone==="bad";(d?a:n)("");let p=setTimeout(()=>(d?a:n)(e.sentence),50);return()=>clearTimeout(p)},[e]),(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("div",{role:"status","aria-live":"polite","data-testid":"notices-said",style:ue,children:t}),(0,E.jsx)("div",{role:"alert","data-testid":"notices-alarm",style:ue,children:i})]})}var hn=(0,T.createContext)(null);function bn({board:r,anchor:e}){let t=(0,T.useSyncExternalStore)(r.subscribe,r.list,r.list);return(0,T.useEffect)(()=>Sn(Be.prefetch),[]),(0,E.jsxs)(E.Fragment,{children:[t.length>0?(0,E.jsx)(T.Suspense,{fallback:null,children:(0,E.jsx)(kn,{notices:t,anchor:e,board:r})}):null,(0,E.jsx)(yn,{notices:t})]})}var Be=N(H(()=>(__graviewPreload(import.meta.url,["./chunk.MB7LKKUD.js","./chunk.JOOQUWLT.js","./chunk.6QWV5MVH.js","./chunk.MNP4JI33.js","./chunk.AJZBJBMO.js"]),import("./chunk.5T5XGILP.js")))),xn=()=>Be.load().then(()=>{},()=>{}),kn=Be.part((r,e)=>(0,E.jsx)(r.NoticeStacks,{...e}),{quiet:!0});function Sn(r){let e=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&r()},t=globalThis;if(t.requestIdleCallback){let i=t.requestIdleCallback(e,{timeout:5e3});return()=>t.cancelIdleCallback?.(i)}let n=setTimeout(e,2500);return()=>clearTimeout(n)}var U=y(O(),1);var B=y(b(),1),Pn=C.part((r,e)=>(0,B.jsx)(r.ProblemRows,{...e}),{what:"The problems",as:"li"}),Re=()=>C.prefetch();function Ln({clean:r="All rules hold"}){let e=Tr(),{set:t}=Lr(),n=e.length,[i,a]=(0,U.useState)(!1),o=q("problems",{open:i&&n>0,onOpenChange:a}),d=o.open,p=it(e,r);return(0,U.useEffect)(()=>{if(n===0)return;let s=setTimeout(Re,1500);return()=>clearTimeout(s)},[n>0]),(0,B.jsxs)("div",{style:{position:"relative",display:"inline-flex"},children:[(0,B.jsxs)("button",{type:"button","data-testid":"standing",...o.trigger,"aria-disabled":n===0?!0:void 0,"aria-label":p,onClick:n===0?void 0:o.toggle,onPointerEnter:n===0?void 0:Re,onFocus:n===0?void 0:Re,title:p,style:{...Y,padding:n===0?0:"0 8px",cursor:n===0?"default":"pointer",color:n===0?"var(--graview-ink-muted)":at(e),fontVariantNumeric:"tabular-nums",fontWeight:600},children:[(0,B.jsx)(ot,{tone:n===0?"var(--graview-good)":at(e)}),n>0?(0,B.jsx)("span",{"aria-hidden":"true",children:n}):null]}),d?(0,B.jsx)("ol",{...o.pane,"data-testid":"problems",style:{...G,width:300,maxHeight:"min(48cqh, 420px)",overflow:"auto",margin:0,padding:4,listStyle:"none",display:"grid",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:(0,B.jsx)(U.Suspense,{fallback:null,children:(0,B.jsx)(Pn,{violations:e,pick:s=>{t(s.nodeIds),o.setOpen(!1)}})})}):null]})}function it(r,e){return r.length===0?e:`${Xe(r)} \u2014 open what is broken, and what would fix it`}var at=r=>r.some(e=>e.status==="could-not-judge"||e.status==="over-budget")?"var(--graview-bad)":"var(--graview-warn)";function ot({tone:r}){return(0,B.jsx)("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:999,flex:"0 0 auto",background:r}})}function Tn(r,e,t=[]){if(r.focusId)return r.focusId;let i=(r.selection??[]).map(xr).find(a=>a!==null)??t.find(a=>e.includes(a))??e[0]??null;return i===null?null:Z(i)}var we=y(b(),1),me=N(H(()=>(__graviewPreload(import.meta.url,["./chunk.NRAYZY3X.js","./chunk.RIJUCHP4.js","./chunk.TAQ764IQ.js","./chunk.YIR7PPF3.js","./chunk.3HXN4BOY.js","./chunk.GYICGZMG.js","./chunk.47STJVRV.js","./chunk.EBGAYL32.js","./chunk.DAZ2VSRD.js","./chunk.CWHRDBOF.js","./chunk.3K6YSVHC.js","./chunk.SHTJZ6UX.js","./chunk.WVUJXDXZ.js","./chunk.ULRW47RP.js","./chunk.PBSMLINK.js","./chunk.3TY5NFLY.js","./chunk.D75KC3LL.js","./chunk.FWTIUYXH.js","./chunk.MAF7C3VM.js","./chunk.GZHZLJBF.js","./chunk.XMC7YDWT.js","./chunk.6UGEYZAC.js","./chunk.OJGHDWI6.js","./chunk.B2GLDIAS.js","./chunk.6YCBYL2Y.js","./chunk.UGFJKSHU.js","./chunk.JOOQUWLT.js","./chunk.6QWV5MVH.js","./chunk.MNP4JI33.js","./chunk.AJZBJBMO.js"]),import("./chunk.ERIT3R6N.js"))));function An(){return me.load().then(()=>{})}var En=[{cardinality:"one",fidelity:"full",slot:"page"},{cardinality:"one",fidelity:"summary",slot:"card"},{cardinality:"one",fidelity:"glyph",slot:"row"},{cardinality:"many",fidelity:"full"},{cardinality:"many",fidelity:"summary"},{cardinality:"many",fidelity:"glyph"}];function $n({schema:r,specs:e,kind:t,view:n}){let i=me.current.frameworkViews(r,e).lookup(t,{cardinality:n.cardinality,fidelity:n.fidelity});return i?(0,we.jsx)(i,{...n}):null}var On=me.part((r,e)=>(0,we.jsx)($n,{...e}),{what:"This view"});function st(r,e,t){for(let n of e.kinds){let i=t?.[n];for(let a of En){let o=p=>(0,we.jsx)(On,{schema:e,specs:t,kind:n,view:p}),d=a.slot!==void 0&&i?.[a.slot]!==void 0;d&&(o.says=(p,s)=>me.current?.frameworkViews(e,t).lookup(n,{cardinality:a.cardinality,fidelity:a.fidelity})?.says?.(p,s)),r.register(n,{cardinality:a.cardinality,fidelity:a.fidelity},d?o:Sr(o))}}return r}function Hn(r,e){return st(Pr(r),r,e)}var Ce=y(O(),1);var M=y(b(),1),lt=N(H(()=>(__graviewPreload(import.meta.url,["./chunk.4HRAQNJO.js","./chunk.Y6ZNFQK3.js","./chunk.BNV77BQZ.js","./chunk.SYAEBGDC.js","./chunk.NRAYZY3X.js","./chunk.RIJUCHP4.js","./chunk.TAQ764IQ.js","./chunk.YIR7PPF3.js","./chunk.3HXN4BOY.js","./chunk.GYICGZMG.js","./chunk.UHUGOTUU.js","./chunk.47STJVRV.js","./chunk.EBGAYL32.js","./chunk.DAZ2VSRD.js","./chunk.HJCQ6I3S.js","./chunk.MWGGV7DE.js","./chunk.JQU5GEU3.js","./chunk.HAIG6NVX.js","./chunk.UZGRRDHD.js","./chunk.XANVHJQ4.js","./chunk.CWHRDBOF.js","./chunk.3K6YSVHC.js","./chunk.SHTJZ6UX.js","./chunk.UT6642FC.js","./chunk.G5NZVPJU.js","./chunk.WVUJXDXZ.js","./chunk.ULRW47RP.js","./chunk.PBSMLINK.js","./chunk.3TY5NFLY.js","./chunk.D75KC3LL.js","./chunk.FWTIUYXH.js","./chunk.MAF7C3VM.js","./chunk.GZHZLJBF.js","./chunk.XMC7YDWT.js","./chunk.6UGEYZAC.js","./chunk.OJGHDWI6.js","./chunk.B2GLDIAS.js","./chunk.6YCBYL2Y.js","./chunk.UGFJKSHU.js","./chunk.JOOQUWLT.js","./chunk.6QWV5MVH.js","./chunk.MNP4JI33.js","./chunk.AJZBJBMO.js"]),import("./chunk.H7BST3XO.js"))));function Nn({lens:r,view:e}){let t=lt.current.declaredLensView(r);return(0,M.jsx)(t,{...e})}var Bn=lt.part((r,e)=>(0,M.jsx)(Nn,{...e}),{what:"This picture"});function Rn(r){let e=t=>(0,M.jsx)(Ce.Suspense,{fallback:null,children:(0,M.jsx)(Bn,{lens:r,view:t})});return r.lens==="blocks"&&(e.flows=!0),r.create===!1&&(e.creates=!1),e}var dt=N(H(()=>(__graviewPreload(import.meta.url,["./chunk.NRAYZY3X.js","./chunk.RIJUCHP4.js","./chunk.TAQ764IQ.js","./chunk.YIR7PPF3.js","./chunk.3HXN4BOY.js","./chunk.GYICGZMG.js","./chunk.47STJVRV.js","./chunk.EBGAYL32.js","./chunk.DAZ2VSRD.js","./chunk.CWHRDBOF.js","./chunk.3K6YSVHC.js","./chunk.SHTJZ6UX.js","./chunk.WVUJXDXZ.js","./chunk.ULRW47RP.js","./chunk.PBSMLINK.js","./chunk.3TY5NFLY.js","./chunk.D75KC3LL.js","./chunk.FWTIUYXH.js","./chunk.MAF7C3VM.js","./chunk.GZHZLJBF.js","./chunk.XMC7YDWT.js","./chunk.6UGEYZAC.js","./chunk.OJGHDWI6.js","./chunk.B2GLDIAS.js","./chunk.6YCBYL2Y.js","./chunk.UGFJKSHU.js","./chunk.JOOQUWLT.js","./chunk.6QWV5MVH.js","./chunk.MNP4JI33.js","./chunk.AJZBJBMO.js"]),import("./chunk.PHKSMUIA.js"))));function Cn({blocks:r,view:e}){let t=dt.current.homeView(r);return(0,M.jsx)(t,{...e})}var _n=dt.part((r,e)=>(0,M.jsx)(Cn,{...e}),{what:"The home"});function Mn(r){let e=t=>(0,M.jsx)(Ce.Suspense,{fallback:null,children:(0,M.jsx)(_n,{blocks:r,view:t})});return Object.defineProperty(e,Symbol.for("graview.home-blocks"),{value:!0}),e}function Dn(r,e){return e.home&&e.home.length>0&&r.home?.(Mn(e.home)),ct(r,e),r.arrange?.(e.pages),r}function ct(r,e,t){for(let n of gr(e).drawn){if(t&&r.places().some(o=>o.title===n.title))continue;let i=Rn(n),a={title:n.title,...n.across?{across:n.across}:{},...t?{beside:t}:{},...n.hidden?{hidden:!0}:{},over:n.kinds};for(let o of n.kinds)r.register(o,{cardinality:"many",fidelity:"full"},i,a),r.register(o,{cardinality:"many",fidelity:"summary"},i,a)}}function Vn(r,e,t){t.length>0&&ct(r,{schema:e,lenses:t.map(({lens:n,...i})=>({...i,name:n}))},!0)}function Fn(r,e,t){Vn(r,e,He(t))}var I=y(O(),1),ve=y(b(),1);var _e=r=>`graview:first-look:${r}`;function In(r,e){if(r.seen!==void 0)try{return typeof r.seen=="function"?r.seen():r.seen}catch{return!0}try{return window.localStorage.getItem(_e(e))!==null}catch{return!1}}function Wn(r,e){if(r.seen===void 0)try{window.localStorage.setItem(_e(e),"seen")}catch{}}var zn=N(H(()=>(__graviewPreload(import.meta.url,["./chunk.6QWV5MVH.js","./chunk.MNP4JI33.js","./chunk.AJZBJBMO.js"]),import("./chunk.K5ME5GCG.js")))),Kn=zn.part((r,e)=>{let t=r.FirstLookHints;return(0,ve.jsx)(t,{...e})},{quiet:!0});function Gn({firstLook:r,root:e,app:t}){let n=(0,I.useRef)(null);n.current=r===!0?{}:r||null;let[i,a]=(0,I.useState)(()=>n.current!==null&&typeof window<"u"&&!In(n.current,t)),o=(0,I.useCallback)(d=>{if(a(!1),d===null)return;let p=n.current??{};Wn(p,t),p.onDone?.(d)},[t]);return!i||n.current===null?null:(0,ve.jsx)(I.Suspense,{fallback:null,children:(0,ve.jsx)(Kn,{root:e,steps:n.current.steps??[],onEnd:o})})}export{rn as a,tn as b,ce as c,Pt as d,qn as e,Or as f,jn as g,Dr as h,Nt as i,Cr as j,Ot as k,Ht as l,ue as m,C as n,Ct as o,_t as p,Wr as q,Mt as r,Y as s,Vt as t,sn as u,mn as v,wn as w,vn as x,hn as y,bn as z,xn as A,Xt as B,Zt as C,He as D,Ln as E,it as F,ot as G,Tn as H,Dn as I,Vn as J,Fn as K,An as L,Hn as M,Gn as N};
|
|
328
|
+
${Zr(`${d}[data-graview-motion='reduce']`,o)}`}var F=y(O(),1);var L=y(b(),1);function sn({scheme:r,onScheme:e,profileHref:t,keeping:n,hostActions:i=ln,signature:a=!1}){let{store:o,principal:d,seats:p,people:s}=le(),c=q("profile"),u=c.open,[f,v]=(0,F.useState)(!1);(0,F.useEffect)(()=>pn(ge),[]),u&&!f&&v(!0),(0,F.useEffect)(()=>{u&&ge()},[u]);let x=d.id===void 0?void 0:o.graph.getNode(d.id),g=x===void 0?d.id===void 0?"Nobody in particular":Qe(d,{graph:o.graph,schema:o.schema,seats:p,people:s}):je(o.schema.tryDefinition(x.kind),x);return(0,L.jsxs)("div",{style:{position:"relative"},children:[(0,L.jsx)("button",{type:"button","data-testid":"profile-button",...c.trigger,onClick:c.toggle,onPointerEnter:ge,onFocus:ge,"aria-label":`${g} \u2014 you, your seat and your settings`,title:`${g} \u2014 you, your seat and your settings`,style:{...Y,borderRadius:999},children:(0,L.jsx)("span",{"aria-hidden":"true","data-testid":"profile-mark",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:j-4,height:j-4,borderRadius:999,fontSize:"0.8125rem",fontWeight:600,background:"var(--graview-panel-muted)",color:"var(--graview-ink)",border:"1px solid var(--graview-edge)"},children:un(g)})}),(0,L.jsxs)("section",{...c.pane,"aria-label":"Profile","data-testid":"profile","data-graview-offstage":"",hidden:!u,style:{...G,width:280,maxWidth:"calc(100vw - 32px)",maxHeight:"min(62cqh, 520px)",overflowY:"auto",overflowX:"hidden",display:u?"grid":"none",gap:12,padding:12,borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:[f?(0,L.jsx)(F.Suspense,{fallback:null,children:(0,L.jsx)(dn,{part:"top",name:g,me:x,profileHref:t,hostActions:i,close:()=>c.setOpen(!1)})}):null,(0,L.jsxs)("div",{className:"graview-profile-keeping","data-testid":"profile-keeping",style:fn,children:[(0,L.jsx)("span",{style:gn,children:"Keeping this app"}),n]}),f?(0,L.jsx)(F.Suspense,{fallback:null,children:(0,L.jsx)(cn,{part:"rest",name:g,me:x,scheme:r,onScheme:e,hostActions:i,signature:a,close:()=>c.setOpen(!1)})}):null]})]})}var ln=[],ge=()=>C.prefetch(),dn=C.part((r,e)=>(0,L.jsx)(r.ProfilePane,{...e}),{what:"The rest of your menu"}),cn=C.part((r,e)=>(0,L.jsx)(r.ProfilePane,{...e}),{quiet:!0});function pn(r){let e=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&r()},t=globalThis;if(t.requestIdleCallback){let i=t.requestIdleCallback(e,{timeout:5e3});return()=>t.cancelIdleCallback?.(i)}let n=setTimeout(e,2500);return()=>clearTimeout(n)}function un(r){return(r.trim()[0]??"?").toUpperCase()}var gn={fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},fn={paddingTop:10,borderTop:"1px solid var(--graview-edge)"};function mn(r){return!(r==="hidden"||r===!1)}var Ne=y(O(),1);var rt="The whole thing",fe=r=>`scene:${r.kind}:${r.as}`;function tt(r){let{view:e}=r,t=r.places.filter(c=>!r.hidden.has(c.kind)),n=Q(t),i=(c,u)=>{if(c===z)return hr(br(u,!0),"view",null);let f=n.find(v=>fe(v)===c);return f?kr(u,f.over?.find(v=>u.focusId===Z(v))??f.kind,f.as):null},a=[{key:z,label:rt,path:`${Se}${Le(i(z,Pe))}`,group:"home"},...n.map(c=>({key:fe(c),label:X(c,t,r.schema),path:`${Se}${Le(i(fe(c),Pe))}`,group:"pictures",kind:c.kind}))],o=e.within?.view,d=c=>e.focusId===Z(c.kind)&&(o===void 0?t.filter(u=>u.kind===c.kind).at(-1)===c:o===c.as),p=t.find(c=>d(c)&&(o!==void 0||!e.overview)),s=p?n.find(c=>cr(c,p)):void 0;return{places:a,current:s?fe(s):z,to:i}}function wn(){let{store:r,views:e,hiddenKinds:t}=le(),{view:n,go:i}=Ar(),a=e.places(),o=(0,Ne.useMemo)(()=>tt({places:a,hidden:t,view:n,schema:r.schema}),[a,t,n,r.schema]),d=(0,Ne.useMemo)(()=>({go:p=>{let s=o.to(p.key,n);s&&i(s)}}),[o,n,i]);return{places:o.places,current:o.current,reach:d}}var T=y(O(),1);var E=y(b(),1),nt=6e3;function vn(){let r=[],e=0,t=new Set,n=new Map,i,a=()=>{for(let s of[...t])s()},o=s=>{if(clearTimeout(n.get(s.id)),n.delete(s.id),s.kind!=="toast")return;let c=(s.actions?.length??0)+(s.action?1:0),u=s.timeout??(c>0?!1:nt);u!==!1&&n.set(s.id,setTimeout(()=>i?.()?o(s):d(s.id),u))},d=s=>{clearTimeout(n.get(s)),n.delete(s),r.some(c=>c.id===s)&&(r=r.filter(c=>c.id!==s),a())},p=s=>{r=r.some(c=>c.id===s.id)?r.map(c=>c.id===s.id?s:c):[...r,s],o(s),a()};return{notify(s){let c=s.id??`notice-${++e}`;return p({...s,id:c,said:++e}),{id:c,dismiss:()=>d(c),update:u=>{let f=r.find(v=>v.id===c);f&&p({...f,...u,id:c,kind:f.kind,said:u.sentence!==void 0&&u.sentence!==f.sentence?++e:f.said})}}},dismiss:d,hold(s){i=s},list:()=>r,subscribe(s){return t.add(s),()=>t.delete(s)}}}function yn({notices:r}){let e=r.reduce((d,p)=>!d||p.said>d.said?p:d,void 0),[t,n]=(0,T.useState)(""),[i,a]=(0,T.useState)(""),o=(0,T.useRef)(0);return(0,T.useEffect)(()=>{if(!e||e.said===o.current)return;o.current=e.said;let d=e.tone==="bad";(d?a:n)("");let p=setTimeout(()=>(d?a:n)(e.sentence),50);return()=>clearTimeout(p)},[e]),(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("div",{role:"status","aria-live":"polite","data-testid":"notices-said",style:ue,children:t}),(0,E.jsx)("div",{role:"alert","data-testid":"notices-alarm",style:ue,children:i})]})}var hn=(0,T.createContext)(null);function bn({board:r,anchor:e}){let t=(0,T.useSyncExternalStore)(r.subscribe,r.list,r.list);return(0,T.useEffect)(()=>Sn(Be.prefetch),[]),(0,E.jsxs)(E.Fragment,{children:[t.length>0?(0,E.jsx)(T.Suspense,{fallback:null,children:(0,E.jsx)(kn,{notices:t,anchor:e,board:r})}):null,(0,E.jsx)(yn,{notices:t})]})}var Be=N(H(()=>(__graviewPreload(import.meta.url,["./chunk.MB7LKKUD.js","./chunk.PNVR3CXR.js","./chunk.ZTD2CNC3.js","./chunk.X7W27IRI.js","./chunk.AJZBJBMO.js"]),import("./chunk.UA5UYINM.js")))),xn=()=>Be.load().then(()=>{},()=>{}),kn=Be.part((r,e)=>(0,E.jsx)(r.NoticeStacks,{...e}),{quiet:!0});function Sn(r){let e=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&r()},t=globalThis;if(t.requestIdleCallback){let i=t.requestIdleCallback(e,{timeout:5e3});return()=>t.cancelIdleCallback?.(i)}let n=setTimeout(e,2500);return()=>clearTimeout(n)}var U=y(O(),1);var B=y(b(),1),Pn=C.part((r,e)=>(0,B.jsx)(r.ProblemRows,{...e}),{what:"The problems",as:"li"}),Re=()=>C.prefetch();function Ln({clean:r="All rules hold"}){let e=Tr(),{set:t}=Lr(),n=e.length,[i,a]=(0,U.useState)(!1),o=q("problems",{open:i&&n>0,onOpenChange:a}),d=o.open,p=it(e,r);return(0,U.useEffect)(()=>{if(n===0)return;let s=setTimeout(Re,1500);return()=>clearTimeout(s)},[n>0]),(0,B.jsxs)("div",{style:{position:"relative",display:"inline-flex"},children:[(0,B.jsxs)("button",{type:"button","data-testid":"standing",...o.trigger,"aria-disabled":n===0?!0:void 0,"aria-label":p,onClick:n===0?void 0:o.toggle,onPointerEnter:n===0?void 0:Re,onFocus:n===0?void 0:Re,title:p,style:{...Y,padding:n===0?0:"0 8px",cursor:n===0?"default":"pointer",color:n===0?"var(--graview-ink-muted)":at(e),fontVariantNumeric:"tabular-nums",fontWeight:600},children:[(0,B.jsx)(ot,{tone:n===0?"var(--graview-good)":at(e)}),n>0?(0,B.jsx)("span",{"aria-hidden":"true",children:n}):null]}),d?(0,B.jsx)("ol",{...o.pane,"data-testid":"problems",style:{...G,width:300,maxHeight:"min(48cqh, 420px)",overflow:"auto",margin:0,padding:4,listStyle:"none",display:"grid",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:(0,B.jsx)(U.Suspense,{fallback:null,children:(0,B.jsx)(Pn,{violations:e,pick:s=>{t(s.nodeIds),o.setOpen(!1)}})})}):null]})}function it(r,e){return r.length===0?e:`${Xe(r)} \u2014 open what is broken, and what would fix it`}var at=r=>r.some(e=>e.status==="could-not-judge"||e.status==="over-budget")?"var(--graview-bad)":"var(--graview-warn)";function ot({tone:r}){return(0,B.jsx)("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:999,flex:"0 0 auto",background:r}})}function Tn(r,e,t=[]){if(r.focusId)return r.focusId;let i=(r.selection??[]).map(xr).find(a=>a!==null)??t.find(a=>e.includes(a))??e[0]??null;return i===null?null:Z(i)}var we=y(b(),1),me=N(H(()=>(__graviewPreload(import.meta.url,["./chunk.T2L4NPSB.js","./chunk.VKH3ZPPQ.js","./chunk.3H4NVUWV.js","./chunk.SIH6RCAI.js","./chunk.RYEAMM73.js","./chunk.7HPPJVIV.js","./chunk.CZRX2FDI.js","./chunk.5EAQDBBE.js","./chunk.YT2CYCVT.js","./chunk.XXMYKBLT.js","./chunk.34CYK2DF.js","./chunk.JZBBGY4B.js","./chunk.WVUJXDXZ.js","./chunk.52QAIGCD.js","./chunk.PPUAPAWR.js","./chunk.IHFNLKXV.js","./chunk.577PGFUT.js","./chunk.FBY5IUGU.js","./chunk.4K5QCJFH.js","./chunk.GZHZLJBF.js","./chunk.WLBXBNNH.js","./chunk.7MTX33WD.js","./chunk.OJGHDWI6.js","./chunk.Z7ZCR4LN.js","./chunk.RIW7SQH4.js","./chunk.FSAHO3LV.js","./chunk.PNVR3CXR.js","./chunk.ZTD2CNC3.js","./chunk.X7W27IRI.js","./chunk.AJZBJBMO.js"]),import("./chunk.YEYY273R.js"))));function An(){return me.load().then(()=>{})}var En=[{cardinality:"one",fidelity:"full",slot:"page"},{cardinality:"one",fidelity:"summary",slot:"card"},{cardinality:"one",fidelity:"glyph",slot:"row"},{cardinality:"many",fidelity:"full"},{cardinality:"many",fidelity:"summary"},{cardinality:"many",fidelity:"glyph"}];function $n({schema:r,specs:e,kind:t,view:n}){let i=me.current.frameworkViews(r,e).lookup(t,{cardinality:n.cardinality,fidelity:n.fidelity});return i?(0,we.jsx)(i,{...n}):null}var On=me.part((r,e)=>(0,we.jsx)($n,{...e}),{what:"This view"});function st(r,e,t){for(let n of e.kinds){let i=t?.[n];for(let a of En){let o=p=>(0,we.jsx)(On,{schema:e,specs:t,kind:n,view:p}),d=a.slot!==void 0&&i?.[a.slot]!==void 0;d&&(o.says=(p,s)=>me.current?.frameworkViews(e,t).lookup(n,{cardinality:a.cardinality,fidelity:a.fidelity})?.says?.(p,s)),r.register(n,{cardinality:a.cardinality,fidelity:a.fidelity},d?o:Sr(o))}}return r}function Hn(r,e){return st(Pr(r),r,e)}var Ce=y(O(),1);var M=y(b(),1),lt=N(H(()=>(__graviewPreload(import.meta.url,["./chunk.VOFUIWAX.js","./chunk.MWJUZG3C.js","./chunk.F6WYSDSI.js","./chunk.PW7YH6JV.js","./chunk.T2L4NPSB.js","./chunk.VKH3ZPPQ.js","./chunk.3H4NVUWV.js","./chunk.SIH6RCAI.js","./chunk.RYEAMM73.js","./chunk.7HPPJVIV.js","./chunk.ETWVQ3A2.js","./chunk.CZRX2FDI.js","./chunk.5EAQDBBE.js","./chunk.YT2CYCVT.js","./chunk.HJCQ6I3S.js","./chunk.DUUARGPE.js","./chunk.FUQVNXLB.js","./chunk.LAF6GTBN.js","./chunk.QU356VB2.js","./chunk.QVKKXMNK.js","./chunk.XXMYKBLT.js","./chunk.34CYK2DF.js","./chunk.JZBBGY4B.js","./chunk.UT6642FC.js","./chunk.HPD5ZDZH.js","./chunk.WVUJXDXZ.js","./chunk.52QAIGCD.js","./chunk.PPUAPAWR.js","./chunk.IHFNLKXV.js","./chunk.577PGFUT.js","./chunk.FBY5IUGU.js","./chunk.4K5QCJFH.js","./chunk.GZHZLJBF.js","./chunk.WLBXBNNH.js","./chunk.7MTX33WD.js","./chunk.OJGHDWI6.js","./chunk.Z7ZCR4LN.js","./chunk.RIW7SQH4.js","./chunk.FSAHO3LV.js","./chunk.PNVR3CXR.js","./chunk.ZTD2CNC3.js","./chunk.X7W27IRI.js","./chunk.AJZBJBMO.js"]),import("./chunk.KA3KI4UA.js"))));function Nn({lens:r,view:e}){let t=lt.current.declaredLensView(r);return(0,M.jsx)(t,{...e})}var Bn=lt.part((r,e)=>(0,M.jsx)(Nn,{...e}),{what:"This picture"});function Rn(r){let e=t=>(0,M.jsx)(Ce.Suspense,{fallback:null,children:(0,M.jsx)(Bn,{lens:r,view:t})});return r.lens==="blocks"&&(e.flows=!0),r.create===!1&&(e.creates=!1),e}var dt=N(H(()=>(__graviewPreload(import.meta.url,["./chunk.T2L4NPSB.js","./chunk.VKH3ZPPQ.js","./chunk.3H4NVUWV.js","./chunk.SIH6RCAI.js","./chunk.RYEAMM73.js","./chunk.7HPPJVIV.js","./chunk.CZRX2FDI.js","./chunk.5EAQDBBE.js","./chunk.YT2CYCVT.js","./chunk.XXMYKBLT.js","./chunk.34CYK2DF.js","./chunk.JZBBGY4B.js","./chunk.WVUJXDXZ.js","./chunk.52QAIGCD.js","./chunk.PPUAPAWR.js","./chunk.IHFNLKXV.js","./chunk.577PGFUT.js","./chunk.FBY5IUGU.js","./chunk.4K5QCJFH.js","./chunk.GZHZLJBF.js","./chunk.WLBXBNNH.js","./chunk.7MTX33WD.js","./chunk.OJGHDWI6.js","./chunk.Z7ZCR4LN.js","./chunk.RIW7SQH4.js","./chunk.FSAHO3LV.js","./chunk.PNVR3CXR.js","./chunk.ZTD2CNC3.js","./chunk.X7W27IRI.js","./chunk.AJZBJBMO.js"]),import("./chunk.GNSAKLP2.js"))));function Cn({blocks:r,view:e}){let t=dt.current.homeView(r);return(0,M.jsx)(t,{...e})}var _n=dt.part((r,e)=>(0,M.jsx)(Cn,{...e}),{what:"The home"});function Mn(r){let e=t=>(0,M.jsx)(Ce.Suspense,{fallback:null,children:(0,M.jsx)(_n,{blocks:r,view:t})});return Object.defineProperty(e,Symbol.for("graview.home-blocks"),{value:!0}),e}function Dn(r,e){return e.home&&e.home.length>0&&r.home?.(Mn(e.home)),ct(r,e),r.arrange?.(e.pages),r}function ct(r,e,t){for(let n of gr(e).drawn){if(t&&r.places().some(o=>o.title===n.title))continue;let i=Rn(n),a={title:n.title,...n.across?{across:n.across}:{},...t?{beside:t}:{},...n.hidden?{hidden:!0}:{},over:n.kinds};for(let o of n.kinds)r.register(o,{cardinality:"many",fidelity:"full"},i,a),r.register(o,{cardinality:"many",fidelity:"summary"},i,a)}}function Vn(r,e,t){t.length>0&&ct(r,{schema:e,lenses:t.map(({lens:n,...i})=>({...i,name:n}))},!0)}function Fn(r,e,t){Vn(r,e,He(t))}var I=y(O(),1),ve=y(b(),1);var _e=r=>`graview:first-look:${r}`;function In(r,e){if(r.seen!==void 0)try{return typeof r.seen=="function"?r.seen():r.seen}catch{return!0}try{return window.localStorage.getItem(_e(e))!==null}catch{return!1}}function Wn(r,e){if(r.seen===void 0)try{window.localStorage.setItem(_e(e),"seen")}catch{}}var zn=N(H(()=>(__graviewPreload(import.meta.url,["./chunk.ZTD2CNC3.js","./chunk.X7W27IRI.js","./chunk.AJZBJBMO.js"]),import("./chunk.3MWBWSYF.js")))),Kn=zn.part((r,e)=>{let t=r.FirstLookHints;return(0,ve.jsx)(t,{...e})},{quiet:!0});function Gn({firstLook:r,root:e,app:t}){let n=(0,I.useRef)(null);n.current=r===!0?{}:r||null;let[i,a]=(0,I.useState)(()=>n.current!==null&&typeof window<"u"&&!In(n.current,t)),o=(0,I.useCallback)(d=>{if(a(!1),d===null)return;let p=n.current??{};Wn(p,t),p.onDone?.(d)},[t]);return!i||n.current===null?null:(0,ve.jsx)(I.Suspense,{fallback:null,children:(0,ve.jsx)(Kn,{root:e,steps:n.current.steps??[],onEnd:o})})}export{rn as a,tn as b,ce as c,Pt as d,qn as e,Or as f,jn as g,Dr as h,Nt as i,Cr as j,Ot as k,Ht as l,ue as m,C as n,Ct as o,_t as p,Wr as q,Mt as r,Y as s,Vt as t,sn as u,mn as v,wn as w,vn as x,hn as y,bn as z,xn as A,Xt as B,Zt as C,He as D,Ln as E,it as F,ot as G,Tn as H,Dn as I,Vn as J,Fn as K,An as L,Hn as M,Gn as N};
|
|
329
329
|
/*! Bundled license information:
|
|
330
330
|
|
|
331
331
|
react-dom/cjs/react-dom.production.js:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as g}from"./chunk.
|
|
1
|
+
import{a as g}from"./chunk.FSAHO3LV.js";import{C as m,G as y,ja as a,ma as k,tb as w}from"./chunk.X7W27IRI.js";var p=i=>i?._zod?.def,h=/^\^\\d\{4\}-\\d\{2\}-\\d\{2\}\$$/;function b(i){let t=p(i),d=!0,f;for(let e=0;t&&e<4;e++){if(t.type==="optional"||t.type==="nullable")d=!1;else if(t.type==="default")d=!1,f=t.defaultValue;else break;t=p(t.innerType)}if(!t)return{why:"it is not a zod field"};let u=m(i),r={...d?{required:!0}:{},...f!==void 0?{default:f}:{},...u?{description:u}:{}},s=(t.checks??[]).map(e=>p(e)),c=a(i);if(c)return{spec:{type:c,...r}};if(k(i))return{spec:{type:"app-link",...r}};if(g(i))return{spec:{type:"text",format:"markdown",...r}};let l=w(i);if(l)return{spec:{type:l,...r}};switch(t.type){case"string":{let e=t.format;return e==="email"?{spec:{type:"email",...r}}:e==="url"?{spec:{type:"url",...r}}:e==="date"?{spec:{type:"date",...r}}:e==="datetime"||s.some(n=>n?.fn===y)?{spec:{type:"datetime",...r}}:s.some(n=>n?.format==="regex"&&h.test(String(n?.pattern?.source??"")))?{spec:{type:"date",...r}}:{spec:{type:"string",...r}}}case"number":{let e={};for(let n of s){let o=n?.value;typeof o=="number"&&(n?.check==="greater_than"&&n.inclusive?e.min=Math.max(e.min??o,o):n?.check==="less_than"&&n.inclusive?e.max=Math.min(e.max??o,o):n?.check==="multiple_of"&&(e.step=o))}return{spec:{type:s.some(n=>n?.format==="safeint"||n?.format==="int")?"integer":"number",...e,...r}}}case"boolean":return{spec:{type:"boolean",...r}};case"enum":{let e=Object.keys(t.entries??{});return e.length>0?{spec:{type:"enum",options:e,...r}}:{why:"it is an enum with no options"}}case"array":{let e=p(t.element),n=a(t.element)??(e?.type==="number"?"number":e?.type==="string"?"string":void 0);return n?{spec:{type:"list",of:n,...r}}:{why:`it is a list of ${String(e?.type??"something")}, and a document lists words, numbers, dates, images or files`}}default:return{why:`it is a ${String(t.type)}, which a document has no field type for`}}}function L(i){let t=b(i);return"spec"in t?t.spec:void 0}export{L as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as $e}from"./chunk.UZGRRDHD.js";import{d as be,e as we,h as xe,i as Y,j as ke}from"./chunk.ULRW47RP.js";import{f as fe}from"./chunk.FWTIUYXH.js";import{d as L,e as he}from"./chunk.6YCBYL2Y.js";import{b as ge,e as ye}from"./chunk.UGFJKSHU.js";import{$ as oe,Ab as ie,B as q,Bc as ue,H as te,Kc as pe,Rb as ae,Sc as me,Tb as le,W as E,X as F,Z as re,Zb as H,_ as J,_b as de,ca as z,ob as se,qc as ce,zb as Q}from"./chunk.MNP4JI33.js";function je(t,o,n){let s=t.tryDefinition(o)?.fields.shape,e=q(s?.[n]),a=!1,i=!1;for(;e&&(e.type==="optional"||e.type==="default"||e.type==="nullable"||e.type==="prefault");)(e.type==="optional"||e.type==="nullable")&&(a=!0),(e.type==="default"||e.type==="prefault")&&(i=!0),e=q(e.innerType);if(e?.type!=="enum")return;let g=(e.entries?Object.values(e.entries):e.values??[]).filter(p=>typeof p=="string");return g.length>0?{values:g,empty:a&&!i}:void 0}function V(t,o,n){let s=je(t,o,n);if(!s)return[];let e=t.tryDefinition(o),a=s.values.map(i=>({value:i,label:ge(e,n,i)}));return s.empty&&a.push({value:null,label:`No ${z(e,n).toLowerCase()}`}),a}function X(t,o,n){let s=t[o];return typeof s=="string"&&n.some(e=>e.value===s)?s:null}function Z(t,o,n,s,e=V(t.schema,n.kind,s)){let a=ve(t.schema,t.allMutations(),n.kind,s,e),i=X(n,s,e),g=[];for(let{value:p,by:R,acts:B}of a)if(p!==i)for(let P of B){let M=R==="step"?{[P.subject.arg]:n.id}:{[P.subject.arg]:n.id,[s]:p},S={name:P.name,args:M};if(P.input.safeParse(M).success&&t.permits(S,o).ok){try{se(t.graph,P,M)}catch{continue}g.push({to:p,call:S,title:P.title??P.name});break}}return g}function ve(t,o,n,s,e=V(t,n,s)){let a=Se(t,o,n,s),i=De(t,o,n,s);return e.flatMap(g=>{if(g.value===null)return[];let p=a.filter(R=>R.sets?.[s]===g.value);return[{value:g.value,label:g.label,by:p.length>0?"step":i.length>0?"value":"none",acts:p.length>0?p:i}]})}function Se(t,o,n,s){return o.filter(e=>e.subject!==void 0&&e.derived===void 0&&typeof e.sets?.[s]=="string"&&Q(t,e).includes(n))}function De(t,o,n,s){let e=t.tryDefinition(n);return e?o.filter(a=>{if(!a.subject||!Q(t,a).includes(n)||!ie(a,e).includes(s))return!1;let i=a.input.shape;return i!==void 0&&s in i}).sort((a,i)=>+(a.derived!==void 0)-+(i.derived!==void 0)):[]}var ee=(t,o)=>o&&t[o]!==void 0?String(t[o]):"";function Me(t,o,n){let s=c=>t.tryDefinition(c)?o.nodesOfKind(c).filter(y=>E(t.tryDefinition(c),y)):[],e=s(n.rows),a=s(n.columns),i=new Set(e.map(c=>c.id)),g=new Set(a.map(c=>c.id)),p=o.allEdges(),R=[],B=n.link;if(typeof B=="string"){let c=d=>t.tryDefinition(d)?.edges?.[B]?.to,y=(c(n.columns)??[]).some(d=>d===n.rows||d==="*"),k=(c(n.rows)??[]).some(d=>d===n.columns||d==="*"),$=y||!k;for(let d of p){if(d.kind!==B)continue;let j=$?d.to:d.from,r=$?d.from:d.to;i.has(j)&&g.has(r)&&R.push({rowId:j,columnId:r,via:[]})}}else{let c=new Map(B.path.map(k=>[k,new Map]));for(let k of p){let $=c.get(k.kind);if(!$)continue;let d=$.get(k.from);d?d.push(k.to):$.set(k.from,[k.to]);let j=$.get(k.to);j?j.push(k.from):$.set(k.to,[k.from])}let y=new Set;for(let k of a){let $=[{id:k.id,via:[]}];for(let d of B.path){let j=[],r=new Set;for(let b of $)for(let A of c.get(d).get(b.id)??[])r.has(`${b.id}|${A}`)||(r.add(`${b.id}|${A}`),j.push({id:A,via:[...b.via,b.id]}));$=j}for(let d of $){let j=`${d.id}|${k.id}`;!i.has(d.id)||y.has(j)||(y.add(j),R.push({rowId:d.id,columnId:k.id,via:d.via.slice(1)}))}}}let P=n.groupOrder??[],M=c=>P.indexOf(c)===-1?P.length:P.indexOf(c),S=(c,y)=>y==="label"?F(t.tryDefinition(c.kind),c):c[y],T=H(e,n.sort,S).map(c=>{let y=c;return{node:c,label:F(t.tryDefinition(c.kind),c),group:ee(y,n.rowGroup),ref:ee(y,n.rowRef)}}).sort((c,y)=>M(c.group)-M(y.group)||(n.sort!==void 0?0:c.ref<y.ref?-1:c.ref>y.ref?1:0)),K=H(a,n.columnSort,S).map(c=>({node:c,label:F(t.tryDefinition(c.kind),c),group:ee(c,n.columnGroup)})).sort((c,y)=>c.group<y.group?-1:c.group>y.group?1:n.columnSort!==void 0?0:c.node.id<y.node.id?-1:c.node.id>y.node.id?1:0);return{rows:T,columns:K,cells:R}}function Pe(t,o,n){let{rows:s,columns:e,cells:a}=Me(t,o,n),i=(r,b)=>J(t,r,b),g=r=>J(t,r,1).replace(/^1 /,""),p=r=>({id:r.id,kind:r.kind,title:F(t.tryDefinition(r.kind),r),parts:[]}),R=r=>{let b=o.getNode(r);if(!b)return null;let A=t.tryDefinition(b.kind),O=F(A,b),N=L(b,A,{limit:3,said:[O],glance:!0}).map(G=>G.alone.startsWith(G.label)?`${G.label.toLowerCase()}${G.alone.slice(G.label.length)}`:G.alone);return[O,...N].join(", ")},B=typeof n.link=="string"?[]:n.link.path.slice(0,-1).flatMap((r,b,A)=>{let O=ce(t,n.columns,A.slice(0,b+1));return O.ok?[...O.reached]:[]}),P=de(t,n,{rows:s.length,columns:e.length,cells:a.length});if(P)return[{t:"text",text:`${i(n.rows,s.length)} against ${i(n.columns,e.length)}.`},{t:"text",text:P}];let M=[{t:"text",text:`${i(n.rows,s.length)} against ${i(n.columns,e.length)}${B.length>0?`, through ${[...new Set(B)].map(r=>i(r,2).replace(/^2 /,"")).join(" and ")}`:""}${e.length>0?`: ${e.map(r=>r.label).join(", ")}`:""}.`}],S=new Map(e.map(r=>[r.node.id,r.label])),T=new Map(e.map((r,b)=>[r.node.id,b])),K=new Map,c=new Map;for(let r of a){let b=K.get(r.rowId);b?b.push(r):K.set(r.rowId,[r]);let A=c.get(r.columnId);A?A.add(r.rowId):c.set(r.columnId,new Set([r.rowId]))}for(let r of s){let A=[...K.get(r.node.id)??[]].sort((O,N)=>T.get(O.columnId)-T.get(N.columnId)).map(O=>{let N=O.via.map(R).filter(G=>G!==null);return`${S.get(O.columnId)}${N.length>0?` (${N.join("; ")})`:""}`});M.push({t:"field",label:r.label,text:A.length>0?A.join(", "):"none"})}M.push({t:"list",as:"name",columns:1,groups:e.map(r=>{let b=c.get(r.node.id)??new Set,A=s.filter(O=>b.has(O.node.id)).map(O=>p(O.node));return{heading:`${r.label} (${A.length})`,items:A}})});let y=new Set(a.map(r=>r.rowId)),k=new Set(a.map(r=>r.columnId)),$=s.filter(r=>!y.has(r.node.id)),d=e.filter(r=>!k.has(r.node.id)),j=n.rows===n.columns;return $.length>0&&M.push({t:"text",text:`${j?`${$.length} with none across`:`${i(n.rows,$.length)} with no ${g(n.columns)}`}: ${$.map(r=>r.label).join(", ")}.`}),d.length>0&&M.push({t:"text",text:`${j?`${d.length} with none down`:`${i(n.columns,d.length)} on no ${g(n.rows)}`}: ${d.map(r=>r.label).join(", ")}.`}),M}function ne(t,o,n,s={}){let{app:e,blocks:a=n?e?.viewSpecs?.[n.kind]?.[s.slot??"page"]:e?.home}=s;if(!a?.length)return[];let i=s.firstHeading??(n||s.blocks?void 0:1),g=ke(t,o,n,{...s,money:s.money??e?.brand,firstHeading:i});return n&&!g.node?[]:we(typeof a[0]?.t=="string"?a:be(a),g)}var Oe=240,Re=10,Be=1160,Ie=40,Ge=640,Fe=3,Ne=t=>Math.max(1,Math.floor((Math.min(t,Be)-Ie+Re)/(Oe+Re)));function Ke(t,o,n,s){let{app:e}=s,a=s.width??1440,i=s.today??t.today()??te(),g=t.seenBy(o),p=g.schema,R=g.graph,B=$e(e),P=typeof n=="string"?n.trim():n.slug,M=typeof n=="string"?B.find(l=>l.slug===P||l.title===P||l.address===P):B.find(l=>l.slug===n.slug&&l.kind===n.kind)??n,S=!M&&typeof n=="string"?R.getNode(P):void 0;if(!M&&!S)return{ok:!1,error:`"${P}" is not a place this app has, nor a record this seat can see.`,places:B.map(l=>l.slug)};let T=[],K=e.viewSpecs??{},c=Ne(a),y=(l,h)=>ne(g,null,l,{app:e,today:i,...h}),k=(l,h,w)=>{let m=p.tryDefinition(l.kind),v=F(m,l);if(h==="name")return{id:l.id,kind:l.kind,title:v,parts:[]};if(K[l.kind]?.[h]){let C=y(l,{slot:h}),[I,...f]=C,D=I?.t==="title";return{id:l.id,kind:l.kind,title:D?I.text:v,parts:$(D?f:C,w,`views.${l.kind}.${h}`,` (${l.id})`,D?1:0)}}if(h==="row")return{id:l.id,kind:l.kind,title:v,parts:[]};let u=m?.computed?Y(p,R,l):l,W=L(u,m,{limit:3,said:[v],glance:!0,locale:e.brand?.locale});return{id:l.id,kind:l.kind,title:v,parts:W.map(C=>({t:"text",text:C.alone}))}};function $(l,h,w,m="",v=0){let x=[];return l.forEach((u,W)=>{let C=`${w}.${W+v}`;switch("problem"in u&&u.problem&&T.push({at:`${C}${m}`,says:u.problem}),u.t){case"title":x.push({t:"heading",level:3,text:u.text});return;case"text":x.push({t:"text",text:u.markdown?ye(u.text):u.text,...u.tone?{tone:u.tone}:{}});return;case"badge":x.push({t:"badge",text:u.text});return;case"field":case"image":x.push({t:"field",label:u.label,text:u.text});return;case"progress":x.push({t:"progress",label:u.label,text:u.text});return;case"group":x.push(...$(u.blocks,h,`${C}.group`,m));return;case"when":x.push(...$(u.blocks,h,`${C}.show`,m));return;case"divider":case"figure":return;case"headline":x.push({t:"heading",level:u.level,text:u.text});return;case"number":x.push({t:"figure",text:u.text,...u.label?{label:u.label}:{}});return;case"list":{if(u.failed){x.push({t:"text",text:"\u2014"});return}if(u.members.length===0){u.empty&&x.push({t:"list",as:u.as,columns:1,groups:[],empty:u.empty});return}let I=h+1,f=I>Fe?"name":u.as,D=(u.groups??[{value:null,members:u.members}]).map(_=>({..."heading"in _&&_.heading?{heading:_.heading}:{},items:_.members.map(Ce=>k(Ce,f,I))}));x.push({t:"list",as:f,columns:f==="card"?c:1,groups:D,...u.more>0?{more:u.more}:{}});return}}}),x}let d=[],j,r,b;if(S){r="record";let l=p.tryDefinition(S.kind),h=F(l,S);b={slug:S.id,title:h,kind:S.kind,address:ue(p,S.kind,S.id)},K[S.kind]?.page&&d.push(...$(y(S,{slot:"page"}),1,`views.${S.kind}.page`));let m=l?.computed?Y(p,R,S):S;for(let v of he(l,L(m,l,{said:[h],locale:e.brand?.locale}))){v.title&&d.push({t:"heading",level:2,text:v.title});for(let x of v.fields)d.push({t:"field",label:x.label,text:x.value,...x.long?{long:!0}:{},...x.markdown?{markdown:!0}:{}})}}else{let l=M;b={slug:l.slug,title:l.title,kind:l.kind,address:l.address};let h=l.lens?pe(e).drawn.find(w=>w.as===l.slug&&(l.kind===null||w.kinds.includes(l.kind))):void 0;if(l.kind===null){let w=e.brand,m=w?.name??e.name,v=w?.logo&&le(w.logo)?w.logo:void 0;if(j={name:m,...w?.subtitle?{subtitle:w.subtitle}:{},...v?{logo:{alt:w?.logoAlt??m,...ae(v)?{drawn:"inline SVG"}:{drawn:"image",src:v}}}:{}},e.home)r="blocks",d=$(y(null,{}),0,"views.home");else{r="derived";let x=t.kindsKeptFrom(o),u=new Set([...e.pages?.hide??[],...x,...t.modules.disabledKinds]),W=me(p.kinds,e.pages?.order).filter(C=>!u.has(C));d.push({t:"heading",level:1,text:e.name??"Home"});for(let C of W){let I=R.nodesOfKind(C).filter(f=>E(p.tryDefinition(C),f)).length;I>0&&d.push({t:"text",text:`${I} ${U(p,C,I)}`})}}}else if(h?.lens==="blocks")r="lens:blocks",d=$(y(null,{blocks:h.options.blocks??[]}),0,`lenses.${h.index}.options.blocks`);else if(h?.lens==="columns"){r="lens:columns";let w=h.options.bindings??{};for(let m of Object.keys(w)){let v=w[m]?.column;if(!v)continue;let x=V(p,m,v),u=H(R.nodesOfKind(m).filter(f=>E(p.tryDefinition(m),f)),h.options.sort,(f,D)=>D==="label"?F(p.tryDefinition(f.kind),f):f[D]);Object.keys(w).length>1&&d.push({t:"heading",level:2,text:U(p,m,2).replace(/^./,f=>f.toUpperCase())}),d.push({t:"text",text:`${u.length} ${U(p,m,u.length)} in columns by ${z(p.tryDefinition(m),v).toLowerCase()}.`});let W=x.map(f=>({column:f,items:u.filter(D=>X(D,v,x)===f.value).map(D=>k(D,"card",1))})).filter(({column:f,items:D})=>f.value!==null||D.length>0).map(({column:f,items:D})=>({heading:`${f.label} (${D.length})`,items:D}));d.push({t:"list",as:"card",columns:1,groups:W});let C=new Map;for(let f of u)for(let D of Z(t,o,f,v,x))C.set(D.to,(C.get(D.to)??new Set).add(`"${D.title}"`));let I=x.filter(f=>f.value!==null&&C.has(f.value)).map(f=>`to ${f.label} by ${[...C.get(f.value)].join(" or ")}`);d.push({t:"text",text:I.length>0?`Moves: ${I.join("; ")}.`:"Moves: none for this seat."})}}else if(h?.lens==="coverage")r="lens:coverage",d=Pe(p,R,h.options);else if(h){r=`lens:${h.lens}`;let w=h.kinds.flatMap(m=>R.nodesOfKind(m).filter(v=>E(p.tryDefinition(m),v)));d.push({t:"text",text:`A ${h.lens} of ${w.length} ${h.kinds.map(m=>U(p,m,w.length)).join(" and ")}.`}),d.push({t:"list",as:"name",columns:1,groups:[{items:w.map(m=>k(m,"name",1))}]})}else{r="derived";let w=R.nodesOfKind(l.kind).filter(m=>E(p.tryDefinition(l.kind),m));d.push({t:"heading",level:1,text:l.title}),w.length===0?d.push({t:"list",as:"row",columns:1,groups:[],empty:`No ${U(p,l.kind,0)} yet.`}):d.push({t:"list",as:"row",columns:1,groups:[{items:w.map(m=>k(m,"row",1))}]})}}let A=o.kind==="system"?"the system":(o.roles??[]).length>0?(o.roles??[]).join(", "):o.kind,O=a<Ge?"phone":"wide",N=b.kind===null?Te(p,R):[],G={...j?{masthead:j}:{},...N.length>0?{facts:N}:{},place:b,seat:A,width:a,variant:O,drawnBy:r,parts:d,problems:T};return{ok:!0,description:{...G,text:Ae(G)}}}function Te(t,o){let n=xe(t,o,null),s=e=>Array.isArray(e)?e.map(s).join(", "):e===null?"nothing":typeof e=="boolean"?e?"yes":"no":typeof e=="object"?e.label:String(e);return[...fe(t)].map(([e,a])=>{let i=a.label??re(e);return Object.hasOwn(n.values,e)?{name:e,label:i,value:s(n.values[e])}:{name:e,label:i,refused:n.refused[e]??"it could not be worked out"}})}function U(t,o,n){let s=t.tryDefinition(o);if(n===1)return s?.noun??o;let e=oe(t,o);return e.charAt(0).toLowerCase()+e.slice(1)}function Ae(t){let o=[`${t.place.title} (${t.place.address}) \u2014 as ${t.seat}, ${t.width} wide (${t.variant}).`],n=t.masthead;n&&o.push(`Masthead: ${n.logo?`the logo ("${n.logo.alt}", ${n.logo.drawn==="image"?n.logo.src:"inline SVG"}), `:""}${n.name}${n.subtitle?` \u2014 ${n.subtitle}`:""}`);let s=(e,a)=>{for(let i of e)switch(i.t){case"heading":o.push(`${a}${"#".repeat(i.level)} ${i.text}`);break;case"text":o.push(`${a}${i.text}`);break;case"badge":o.push(`${a}[${i.text}]`);break;case"field":case"progress":o.push(`${a}${i.label}: ${i.text}`);break;case"figure":o.push(`${a}${i.text}${i.label?` \u2014 ${i.label}`:""}`);break;case"list":if(i.groups.length===0){i.empty&&o.push(`${a}(${i.empty})`);break}for(let g of i.groups){g.heading&&o.push(`${a}${g.heading}:`);for(let p of g.items)o.push(`${a}${g.heading?" ":""}- ${p.title}`),s(p.parts,`${a}${g.heading?" ":" "}`)}i.as==="card"&&i.columns>1&&o.push(`${a}(cards, ${i.columns} across)`),i.more&&o.push(`${a}and ${i.more} more`);break}};if(s(t.parts,""),t.facts){o.push("Facts of the whole graph (what fact('<name>') reads):");for(let e of t.facts)o.push(`- ${e.label} (${e.name}): ${e.value??`not worked out \u2014 ${e.refused}`}`)}if(t.problems.length>0){o.push("Problems:");for(let e of t.problems)o.push(`- ${e.at}: ${e.says}`)}return o.join(`
|
|
1
|
+
import{a as $e}from"./chunk.QU356VB2.js";import{d as be,e as we,h as xe,i as Y,j as ke}from"./chunk.52QAIGCD.js";import{f as fe}from"./chunk.FBY5IUGU.js";import{d as L,e as he}from"./chunk.RIW7SQH4.js";import{b as ge,e as ye}from"./chunk.FSAHO3LV.js";import{$ as oe,$b as de,Ab as ie,B as q,Cc as ue,H as te,Lc as pe,Sb as ae,Tc as me,Ub as le,W as E,X as F,Z as re,_ as J,_b as H,ca as z,ob as se,rc as ce,zb as Q}from"./chunk.X7W27IRI.js";function je(t,o,n){let s=t.tryDefinition(o)?.fields.shape,e=q(s?.[n]),a=!1,i=!1;for(;e&&(e.type==="optional"||e.type==="default"||e.type==="nullable"||e.type==="prefault");)(e.type==="optional"||e.type==="nullable")&&(a=!0),(e.type==="default"||e.type==="prefault")&&(i=!0),e=q(e.innerType);if(e?.type!=="enum")return;let g=(e.entries?Object.values(e.entries):e.values??[]).filter(p=>typeof p=="string");return g.length>0?{values:g,empty:a&&!i}:void 0}function V(t,o,n){let s=je(t,o,n);if(!s)return[];let e=t.tryDefinition(o),a=s.values.map(i=>({value:i,label:ge(e,n,i)}));return s.empty&&a.push({value:null,label:`No ${z(e,n).toLowerCase()}`}),a}function X(t,o,n){let s=t[o];return typeof s=="string"&&n.some(e=>e.value===s)?s:null}function Z(t,o,n,s,e=V(t.schema,n.kind,s)){let a=ve(t.schema,t.allMutations(),n.kind,s,e),i=X(n,s,e),g=[];for(let{value:p,by:R,acts:B}of a)if(p!==i)for(let P of B){let M=R==="step"?{[P.subject.arg]:n.id}:{[P.subject.arg]:n.id,[s]:p},S={name:P.name,args:M};if(P.input.safeParse(M).success&&t.permits(S,o).ok){try{se(t.graph,P,M)}catch{continue}g.push({to:p,call:S,title:P.title??P.name});break}}return g}function ve(t,o,n,s,e=V(t,n,s)){let a=Se(t,o,n,s),i=De(t,o,n,s);return e.flatMap(g=>{if(g.value===null)return[];let p=a.filter(R=>R.sets?.[s]===g.value);return[{value:g.value,label:g.label,by:p.length>0?"step":i.length>0?"value":"none",acts:p.length>0?p:i}]})}function Se(t,o,n,s){return o.filter(e=>e.subject!==void 0&&e.derived===void 0&&typeof e.sets?.[s]=="string"&&Q(t,e).includes(n))}function De(t,o,n,s){let e=t.tryDefinition(n);return e?o.filter(a=>{if(!a.subject||!Q(t,a).includes(n)||!ie(a,e).includes(s))return!1;let i=a.input.shape;return i!==void 0&&s in i}).sort((a,i)=>+(a.derived!==void 0)-+(i.derived!==void 0)):[]}var ee=(t,o)=>o&&t[o]!==void 0?String(t[o]):"";function Me(t,o,n){let s=c=>t.tryDefinition(c)?o.nodesOfKind(c).filter(y=>E(t.tryDefinition(c),y)):[],e=s(n.rows),a=s(n.columns),i=new Set(e.map(c=>c.id)),g=new Set(a.map(c=>c.id)),p=o.allEdges(),R=[],B=n.link;if(typeof B=="string"){let c=d=>t.tryDefinition(d)?.edges?.[B]?.to,y=(c(n.columns)??[]).some(d=>d===n.rows||d==="*"),k=(c(n.rows)??[]).some(d=>d===n.columns||d==="*"),$=y||!k;for(let d of p){if(d.kind!==B)continue;let j=$?d.to:d.from,r=$?d.from:d.to;i.has(j)&&g.has(r)&&R.push({rowId:j,columnId:r,via:[]})}}else{let c=new Map(B.path.map(k=>[k,new Map]));for(let k of p){let $=c.get(k.kind);if(!$)continue;let d=$.get(k.from);d?d.push(k.to):$.set(k.from,[k.to]);let j=$.get(k.to);j?j.push(k.from):$.set(k.to,[k.from])}let y=new Set;for(let k of a){let $=[{id:k.id,via:[]}];for(let d of B.path){let j=[],r=new Set;for(let b of $)for(let A of c.get(d).get(b.id)??[])r.has(`${b.id}|${A}`)||(r.add(`${b.id}|${A}`),j.push({id:A,via:[...b.via,b.id]}));$=j}for(let d of $){let j=`${d.id}|${k.id}`;!i.has(d.id)||y.has(j)||(y.add(j),R.push({rowId:d.id,columnId:k.id,via:d.via.slice(1)}))}}}let P=n.groupOrder??[],M=c=>P.indexOf(c)===-1?P.length:P.indexOf(c),S=(c,y)=>y==="label"?F(t.tryDefinition(c.kind),c):c[y],T=H(e,n.sort,S).map(c=>{let y=c;return{node:c,label:F(t.tryDefinition(c.kind),c),group:ee(y,n.rowGroup),ref:ee(y,n.rowRef)}}).sort((c,y)=>M(c.group)-M(y.group)||(n.sort!==void 0?0:c.ref<y.ref?-1:c.ref>y.ref?1:0)),K=H(a,n.columnSort,S).map(c=>({node:c,label:F(t.tryDefinition(c.kind),c),group:ee(c,n.columnGroup)})).sort((c,y)=>c.group<y.group?-1:c.group>y.group?1:n.columnSort!==void 0?0:c.node.id<y.node.id?-1:c.node.id>y.node.id?1:0);return{rows:T,columns:K,cells:R}}function Pe(t,o,n){let{rows:s,columns:e,cells:a}=Me(t,o,n),i=(r,b)=>J(t,r,b),g=r=>J(t,r,1).replace(/^1 /,""),p=r=>({id:r.id,kind:r.kind,title:F(t.tryDefinition(r.kind),r),parts:[]}),R=r=>{let b=o.getNode(r);if(!b)return null;let A=t.tryDefinition(b.kind),O=F(A,b),N=L(b,A,{limit:3,said:[O],glance:!0}).map(G=>G.alone.startsWith(G.label)?`${G.label.toLowerCase()}${G.alone.slice(G.label.length)}`:G.alone);return[O,...N].join(", ")},B=typeof n.link=="string"?[]:n.link.path.slice(0,-1).flatMap((r,b,A)=>{let O=ce(t,n.columns,A.slice(0,b+1));return O.ok?[...O.reached]:[]}),P=de(t,n,{rows:s.length,columns:e.length,cells:a.length});if(P)return[{t:"text",text:`${i(n.rows,s.length)} against ${i(n.columns,e.length)}.`},{t:"text",text:P}];let M=[{t:"text",text:`${i(n.rows,s.length)} against ${i(n.columns,e.length)}${B.length>0?`, through ${[...new Set(B)].map(r=>i(r,2).replace(/^2 /,"")).join(" and ")}`:""}${e.length>0?`: ${e.map(r=>r.label).join(", ")}`:""}.`}],S=new Map(e.map(r=>[r.node.id,r.label])),T=new Map(e.map((r,b)=>[r.node.id,b])),K=new Map,c=new Map;for(let r of a){let b=K.get(r.rowId);b?b.push(r):K.set(r.rowId,[r]);let A=c.get(r.columnId);A?A.add(r.rowId):c.set(r.columnId,new Set([r.rowId]))}for(let r of s){let A=[...K.get(r.node.id)??[]].sort((O,N)=>T.get(O.columnId)-T.get(N.columnId)).map(O=>{let N=O.via.map(R).filter(G=>G!==null);return`${S.get(O.columnId)}${N.length>0?` (${N.join("; ")})`:""}`});M.push({t:"field",label:r.label,text:A.length>0?A.join(", "):"none"})}M.push({t:"list",as:"name",columns:1,groups:e.map(r=>{let b=c.get(r.node.id)??new Set,A=s.filter(O=>b.has(O.node.id)).map(O=>p(O.node));return{heading:`${r.label} (${A.length})`,items:A}})});let y=new Set(a.map(r=>r.rowId)),k=new Set(a.map(r=>r.columnId)),$=s.filter(r=>!y.has(r.node.id)),d=e.filter(r=>!k.has(r.node.id)),j=n.rows===n.columns;return $.length>0&&M.push({t:"text",text:`${j?`${$.length} with none across`:`${i(n.rows,$.length)} with no ${g(n.columns)}`}: ${$.map(r=>r.label).join(", ")}.`}),d.length>0&&M.push({t:"text",text:`${j?`${d.length} with none down`:`${i(n.columns,d.length)} on no ${g(n.rows)}`}: ${d.map(r=>r.label).join(", ")}.`}),M}function ne(t,o,n,s={}){let{app:e,blocks:a=n?e?.viewSpecs?.[n.kind]?.[s.slot??"page"]:e?.home}=s;if(!a?.length)return[];let i=s.firstHeading??(n||s.blocks?void 0:1),g=ke(t,o,n,{...s,money:s.money??e?.brand,firstHeading:i});return n&&!g.node?[]:we(typeof a[0]?.t=="string"?a:be(a),g)}var Oe=240,Re=10,Be=1160,Ie=40,Ge=640,Fe=3,Ne=t=>Math.max(1,Math.floor((Math.min(t,Be)-Ie+Re)/(Oe+Re)));function Ke(t,o,n,s){let{app:e}=s,a=s.width??1440,i=s.today??t.today()??te(),g=t.seenBy(o),p=g.schema,R=g.graph,B=$e(e),P=typeof n=="string"?n.trim():n.slug,M=typeof n=="string"?B.find(l=>l.slug===P||l.title===P||l.address===P):B.find(l=>l.slug===n.slug&&l.kind===n.kind)??n,S=!M&&typeof n=="string"?R.getNode(P):void 0;if(!M&&!S)return{ok:!1,error:`"${P}" is not a place this app has, nor a record this seat can see.`,places:B.map(l=>l.slug)};let T=[],K=e.viewSpecs??{},c=Ne(a),y=(l,h)=>ne(g,null,l,{app:e,today:i,...h}),k=(l,h,w)=>{let m=p.tryDefinition(l.kind),v=F(m,l);if(h==="name")return{id:l.id,kind:l.kind,title:v,parts:[]};if(K[l.kind]?.[h]){let C=y(l,{slot:h}),[I,...f]=C,D=I?.t==="title";return{id:l.id,kind:l.kind,title:D?I.text:v,parts:$(D?f:C,w,`views.${l.kind}.${h}`,` (${l.id})`,D?1:0)}}if(h==="row")return{id:l.id,kind:l.kind,title:v,parts:[]};let u=m?.computed?Y(p,R,l):l,W=L(u,m,{limit:3,said:[v],glance:!0,locale:e.brand?.locale});return{id:l.id,kind:l.kind,title:v,parts:W.map(C=>({t:"text",text:C.alone}))}};function $(l,h,w,m="",v=0){let x=[];return l.forEach((u,W)=>{let C=`${w}.${W+v}`;switch("problem"in u&&u.problem&&T.push({at:`${C}${m}`,says:u.problem}),u.t){case"title":x.push({t:"heading",level:3,text:u.text});return;case"text":x.push({t:"text",text:u.markdown?ye(u.text):u.text,...u.tone?{tone:u.tone}:{}});return;case"badge":x.push({t:"badge",text:u.text});return;case"field":case"image":x.push({t:"field",label:u.label,text:u.text});return;case"progress":x.push({t:"progress",label:u.label,text:u.text});return;case"group":x.push(...$(u.blocks,h,`${C}.group`,m));return;case"when":x.push(...$(u.blocks,h,`${C}.show`,m));return;case"divider":case"figure":return;case"headline":x.push({t:"heading",level:u.level,text:u.text});return;case"number":x.push({t:"figure",text:u.text,...u.label?{label:u.label}:{}});return;case"list":{if(u.failed){x.push({t:"text",text:"\u2014"});return}if(u.members.length===0){u.empty&&x.push({t:"list",as:u.as,columns:1,groups:[],empty:u.empty});return}let I=h+1,f=I>Fe?"name":u.as,D=(u.groups??[{value:null,members:u.members}]).map(_=>({..."heading"in _&&_.heading?{heading:_.heading}:{},items:_.members.map(Ce=>k(Ce,f,I))}));x.push({t:"list",as:f,columns:f==="card"?c:1,groups:D,...u.more>0?{more:u.more}:{}});return}}}),x}let d=[],j,r,b;if(S){r="record";let l=p.tryDefinition(S.kind),h=F(l,S);b={slug:S.id,title:h,kind:S.kind,address:ue(p,S.kind,S.id)},K[S.kind]?.page&&d.push(...$(y(S,{slot:"page"}),1,`views.${S.kind}.page`));let m=l?.computed?Y(p,R,S):S;for(let v of he(l,L(m,l,{said:[h],locale:e.brand?.locale}))){v.title&&d.push({t:"heading",level:2,text:v.title});for(let x of v.fields)d.push({t:"field",label:x.label,text:x.value,...x.long?{long:!0}:{},...x.markdown?{markdown:!0}:{}})}}else{let l=M;b={slug:l.slug,title:l.title,kind:l.kind,address:l.address};let h=l.lens?pe(e).drawn.find(w=>w.as===l.slug&&(l.kind===null||w.kinds.includes(l.kind))):void 0;if(l.kind===null){let w=e.brand,m=w?.name??e.name,v=w?.logo&&le(w.logo)?w.logo:void 0;if(j={name:m,...w?.subtitle?{subtitle:w.subtitle}:{},...v?{logo:{alt:w?.logoAlt??m,...ae(v)?{drawn:"inline SVG"}:{drawn:"image",src:v}}}:{}},e.home)r="blocks",d=$(y(null,{}),0,"views.home");else{r="derived";let x=t.kindsKeptFrom(o),u=new Set([...e.pages?.hide??[],...x,...t.modules.disabledKinds]),W=me(p.kinds,e.pages?.order).filter(C=>!u.has(C));d.push({t:"heading",level:1,text:e.name??"Home"});for(let C of W){let I=R.nodesOfKind(C).filter(f=>E(p.tryDefinition(C),f)).length;I>0&&d.push({t:"text",text:`${I} ${U(p,C,I)}`})}}}else if(h?.lens==="blocks")r="lens:blocks",d=$(y(null,{blocks:h.options.blocks??[]}),0,`lenses.${h.index}.options.blocks`);else if(h?.lens==="columns"){r="lens:columns";let w=h.options.bindings??{};for(let m of Object.keys(w)){let v=w[m]?.column;if(!v)continue;let x=V(p,m,v),u=H(R.nodesOfKind(m).filter(f=>E(p.tryDefinition(m),f)),h.options.sort,(f,D)=>D==="label"?F(p.tryDefinition(f.kind),f):f[D]);Object.keys(w).length>1&&d.push({t:"heading",level:2,text:U(p,m,2).replace(/^./,f=>f.toUpperCase())}),d.push({t:"text",text:`${u.length} ${U(p,m,u.length)} in columns by ${z(p.tryDefinition(m),v).toLowerCase()}.`});let W=x.map(f=>({column:f,items:u.filter(D=>X(D,v,x)===f.value).map(D=>k(D,"card",1))})).filter(({column:f,items:D})=>f.value!==null||D.length>0).map(({column:f,items:D})=>({heading:`${f.label} (${D.length})`,items:D}));d.push({t:"list",as:"card",columns:1,groups:W});let C=new Map;for(let f of u)for(let D of Z(t,o,f,v,x))C.set(D.to,(C.get(D.to)??new Set).add(`"${D.title}"`));let I=x.filter(f=>f.value!==null&&C.has(f.value)).map(f=>`to ${f.label} by ${[...C.get(f.value)].join(" or ")}`);d.push({t:"text",text:I.length>0?`Moves: ${I.join("; ")}.`:"Moves: none for this seat."})}}else if(h?.lens==="coverage")r="lens:coverage",d=Pe(p,R,h.options);else if(h){r=`lens:${h.lens}`;let w=h.kinds.flatMap(m=>R.nodesOfKind(m).filter(v=>E(p.tryDefinition(m),v)));d.push({t:"text",text:`A ${h.lens} of ${w.length} ${h.kinds.map(m=>U(p,m,w.length)).join(" and ")}.`}),d.push({t:"list",as:"name",columns:1,groups:[{items:w.map(m=>k(m,"name",1))}]})}else{r="derived";let w=R.nodesOfKind(l.kind).filter(m=>E(p.tryDefinition(l.kind),m));d.push({t:"heading",level:1,text:l.title}),w.length===0?d.push({t:"list",as:"row",columns:1,groups:[],empty:`No ${U(p,l.kind,0)} yet.`}):d.push({t:"list",as:"row",columns:1,groups:[{items:w.map(m=>k(m,"row",1))}]})}}let A=o.kind==="system"?"the system":(o.roles??[]).length>0?(o.roles??[]).join(", "):o.kind,O=a<Ge?"phone":"wide",N=b.kind===null?Te(p,R):[],G={...j?{masthead:j}:{},...N.length>0?{facts:N}:{},place:b,seat:A,width:a,variant:O,drawnBy:r,parts:d,problems:T};return{ok:!0,description:{...G,text:Ae(G)}}}function Te(t,o){let n=xe(t,o,null),s=e=>Array.isArray(e)?e.map(s).join(", "):e===null?"nothing":typeof e=="boolean"?e?"yes":"no":typeof e=="object"?e.label:String(e);return[...fe(t)].map(([e,a])=>{let i=a.label??re(e);return Object.hasOwn(n.values,e)?{name:e,label:i,value:s(n.values[e])}:{name:e,label:i,refused:n.refused[e]??"it could not be worked out"}})}function U(t,o,n){let s=t.tryDefinition(o);if(n===1)return s?.noun??o;let e=oe(t,o);return e.charAt(0).toLowerCase()+e.slice(1)}function Ae(t){let o=[`${t.place.title} (${t.place.address}) \u2014 as ${t.seat}, ${t.width} wide (${t.variant}).`],n=t.masthead;n&&o.push(`Masthead: ${n.logo?`the logo ("${n.logo.alt}", ${n.logo.drawn==="image"?n.logo.src:"inline SVG"}), `:""}${n.name}${n.subtitle?` \u2014 ${n.subtitle}`:""}`);let s=(e,a)=>{for(let i of e)switch(i.t){case"heading":o.push(`${a}${"#".repeat(i.level)} ${i.text}`);break;case"text":o.push(`${a}${i.text}`);break;case"badge":o.push(`${a}[${i.text}]`);break;case"field":case"progress":o.push(`${a}${i.label}: ${i.text}`);break;case"figure":o.push(`${a}${i.text}${i.label?` \u2014 ${i.label}`:""}`);break;case"list":if(i.groups.length===0){i.empty&&o.push(`${a}(${i.empty})`);break}for(let g of i.groups){g.heading&&o.push(`${a}${g.heading}:`);for(let p of g.items)o.push(`${a}${g.heading?" ":""}- ${p.title}`),s(p.parts,`${a}${g.heading?" ":" "}`)}i.as==="card"&&i.columns>1&&o.push(`${a}(cards, ${i.columns} across)`),i.more&&o.push(`${a}and ${i.more} more`);break}};if(s(t.parts,""),t.facts){o.push("Facts of the whole graph (what fact('<name>') reads):");for(let e of t.facts)o.push(`- ${e.label} (${e.name}): ${e.value??`not worked out \u2014 ${e.refused}`}`)}if(t.problems.length>0){o.push("Problems:");for(let e of t.problems)o.push(`- ${e.at}: ${e.says}`)}return o.join(`
|
|
2
2
|
`)}export{V as a,X as b,Z as c,ve as d,Se as e,De as f,ne as g,Ke as h,Ae as i};
|