graview 0.1.28 → 0.1.30
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.26CZTUY4.js +1 -0
- package/dist/preview/chunk.2CIBWZJG.js +1 -0
- package/dist/preview/chunk.2EXGG6BB.js +1 -0
- package/dist/preview/chunk.2NBYNZRD.js +1 -0
- package/dist/preview/chunk.2XAONC66.js +1 -0
- package/dist/preview/chunk.34ZMMURV.js +27 -0
- package/dist/preview/chunk.3ADPAGPY.js +28 -0
- package/dist/preview/chunk.3JGGBLRB.js +1 -0
- package/dist/preview/chunk.3JNMSOFG.js +1 -0
- package/dist/preview/chunk.3R4W2P5X.js +1 -0
- package/dist/preview/chunk.3SKKIHU3.js +4 -0
- package/dist/preview/{chunk.5BGA2VUS.js → chunk.3URFMWXZ.js} +4 -4
- package/dist/preview/chunk.3VL5WECB.js +1 -0
- package/dist/preview/chunk.42YX6NOY.js +2 -0
- package/dist/preview/chunk.4ALKPNXM.js +1 -0
- package/dist/preview/chunk.4HP7UWA2.js +1 -0
- package/dist/preview/chunk.4SJUTBDV.js +1 -0
- package/dist/preview/chunk.5U5J3ISK.js +1 -0
- package/dist/preview/chunk.6T2Q6NLO.js +1 -0
- package/dist/preview/chunk.6V2RG5JG.js +5 -0
- package/dist/preview/chunk.6XMEU2Q2.js +1 -0
- package/dist/preview/chunk.7BWT5L2L.js +1 -0
- package/dist/preview/chunk.AK3IHFCF.js +1 -0
- package/dist/preview/chunk.BPWNWE7N.js +1 -0
- package/dist/preview/chunk.C5CYZNSJ.js +1 -0
- package/dist/preview/chunk.CM6LOIQE.js +88 -0
- package/dist/preview/chunk.D3IECJ2S.js +17 -0
- package/dist/preview/chunk.DT7LHWU2.js +1 -0
- package/dist/preview/chunk.DZRTOURR.js +1 -0
- package/dist/preview/chunk.ERXSYPYL.js +84 -0
- package/dist/preview/chunk.EYZ7MHBZ.js +0 -0
- package/dist/preview/chunk.FDELO7NY.js +116 -0
- package/dist/preview/chunk.FGVKJWNS.js +6 -0
- package/dist/preview/chunk.FWCOJDOD.js +1 -0
- package/dist/preview/chunk.GFF2FB2J.js +25 -0
- package/dist/preview/chunk.GLBHQFJ2.js +1 -0
- package/dist/preview/chunk.HHI65WFZ.js +3 -0
- package/dist/preview/chunk.HHPGWJDO.js +2 -0
- package/dist/preview/chunk.HJCQ6I3S.js +1 -0
- package/dist/preview/chunk.HSCTWAUV.js +1 -0
- package/dist/preview/chunk.INZUEWC5.js +1 -0
- package/dist/preview/chunk.J2ITFGN3.js +1 -0
- package/dist/preview/chunk.JH6MU6TX.js +2 -0
- package/dist/preview/chunk.JISMMIMX.js +1 -0
- package/dist/preview/chunk.JN7DIFR3.js +1 -0
- package/dist/preview/chunk.JPHNKWTY.js +1 -0
- package/dist/preview/chunk.JTNWD2CN.js +1 -0
- package/dist/preview/chunk.K75FUIZI.js +1 -0
- package/dist/preview/chunk.K776HO42.js +2 -0
- package/dist/preview/chunk.KN3ULTGF.js +1 -0
- package/dist/preview/chunk.KOB6N3SL.js +1 -0
- package/dist/preview/chunk.KQT7WAQE.js +1 -0
- package/dist/preview/chunk.L4DECHXR.js +327 -0
- package/dist/preview/chunk.L6OMEYL6.js +10 -0
- package/dist/preview/chunk.LQ7V6KEE.js +1 -0
- package/dist/preview/chunk.MB7LKKUD.js +1 -0
- package/dist/preview/chunk.MD74YVRN.js +3 -0
- package/dist/preview/chunk.MGNP4LAM.js +1 -0
- package/dist/preview/chunk.NCTOBUCT.js +1 -0
- package/dist/preview/chunk.NDADLJE6.js +1 -0
- package/dist/preview/chunk.NO52VON3.js +1 -0
- package/dist/preview/chunk.O2LK2AO7.js +1 -0
- package/dist/preview/chunk.OAF7TUMI.js +1 -0
- package/dist/preview/chunk.OQ4KFN6W.js +1 -0
- package/dist/preview/chunk.OQDETV4X.js +1 -0
- package/dist/preview/chunk.OXQMNIRO.js +1 -0
- package/dist/preview/chunk.OZNW5W4Z.js +1 -0
- package/dist/preview/chunk.PAVR5TK5.js +1 -0
- package/dist/preview/chunk.PKK6FRZR.js +2 -0
- package/dist/preview/chunk.Q5WEOX3Q.js +1 -0
- package/dist/preview/chunk.QIAKO27D.js +1 -0
- package/dist/preview/chunk.QNGWEV47.js +1 -0
- package/dist/preview/{chunk.EYF6ONTA.js → chunk.QTA4ROAK.js} +1 -1
- package/dist/preview/chunk.QTMWHE5O.js +1 -0
- package/dist/preview/chunk.R26DREVU.js +1 -0
- package/dist/preview/chunk.RI3PYG5T.js +19 -0
- package/dist/preview/chunk.RIEHYQLK.js +1101 -0
- package/dist/preview/chunk.RRVIXV7W.js +1 -0
- package/dist/preview/chunk.RYT5U3QM.js +1 -0
- package/dist/preview/chunk.SE5SKFQH.js +1 -0
- package/dist/preview/chunk.SHPXD6FC.js +1 -0
- package/dist/preview/chunk.SOBC3CTN.js +47 -0
- package/dist/preview/chunk.SOD3PBJM.js +1 -0
- package/dist/preview/chunk.T3VPD7JQ.js +1 -0
- package/dist/preview/chunk.TI4OSTQV.js +1 -0
- package/dist/preview/chunk.UDSEJKCY.js +1 -0
- package/dist/preview/chunk.UGFDSE37.js +1 -0
- package/dist/preview/chunk.UT6642FC.js +1 -0
- package/dist/preview/chunk.UWGWXFWZ.js +1 -0
- package/dist/preview/{chunk.IKT7JQUW.js → chunk.UZWWDAGM.js} +1 -1
- package/dist/preview/chunk.V5ZYUVMH.js +1 -0
- package/dist/preview/chunk.V7BDAGDE.js +35 -0
- package/dist/preview/chunk.VG56IUIQ.js +9 -0
- package/dist/preview/chunk.VOAZBHCG.js +1 -0
- package/dist/preview/chunk.VS7K3SCD.js +9 -0
- package/dist/preview/chunk.VSZQXB4Q.js +3 -0
- package/dist/preview/chunk.W3S6UXNA.js +1 -0
- package/dist/preview/chunk.WAFDCOOG.js +3 -0
- package/dist/preview/chunk.WYTIOLPP.js +1 -0
- package/dist/preview/chunk.X37L5TN5.js +1 -0
- package/dist/preview/chunk.XDYAG276.js +1 -0
- package/dist/preview/chunk.XRJBLH4N.js +1 -0
- package/dist/preview/chunk.XS7YFNDU.js +1 -0
- package/dist/preview/chunk.XSTXV6FP.js +6 -0
- package/dist/preview/chunk.Y4UXEL6Y.js +1 -0
- package/dist/preview/chunk.YJUB4OD7.js +1 -0
- package/dist/preview/chunk.YLQB3KBA.js +1 -0
- package/dist/preview/chunk.YNQDVGZM.js +1 -0
- package/dist/preview/chunk.YV2LJFGS.js +1 -0
- package/dist/preview/chunk.Z2YUYZT4.js +1 -0
- package/dist/preview/chunk.ZYKAS4BT.js +1 -0
- package/dist/preview/page.js +6 -6
- package/package.json +6 -6
- package/dist/preview/chunk.22H4JXTH.js +0 -8
- package/dist/preview/chunk.25OYH6MY.js +0 -1
- package/dist/preview/chunk.2GBQJXJH.js +0 -19
- package/dist/preview/chunk.2VUG6EAN.js +0 -1
- package/dist/preview/chunk.337WDTG3.js +0 -2
- package/dist/preview/chunk.3HLLQ5CJ.js +0 -1
- package/dist/preview/chunk.46KUPBQC.js +0 -1
- package/dist/preview/chunk.4H7CQE56.js +0 -1
- package/dist/preview/chunk.4HGBVU5B.js +0 -1
- package/dist/preview/chunk.4RO5DA22.js +0 -1
- package/dist/preview/chunk.4TUNX4WM.js +0 -29
- package/dist/preview/chunk.6LJ66MB7.js +0 -1
- package/dist/preview/chunk.6R4EI47C.js +0 -1
- package/dist/preview/chunk.7S22MBNN.js +0 -1
- package/dist/preview/chunk.A73BXXE4.js +0 -3
- package/dist/preview/chunk.AHDOKM4O.js +0 -1
- package/dist/preview/chunk.ARE3MEDN.js +0 -1
- package/dist/preview/chunk.ASFZTYFO.js +0 -1
- package/dist/preview/chunk.BBJZ6O7J.js +0 -1
- package/dist/preview/chunk.BCBH6WJF.js +0 -1
- package/dist/preview/chunk.CAZAB352.js +0 -1
- package/dist/preview/chunk.CY7MDLRS.js +0 -1
- package/dist/preview/chunk.DAVRLRGB.js +0 -1
- package/dist/preview/chunk.DCIC3YHX.js +0 -1
- package/dist/preview/chunk.EW4JFOJY.js +0 -1
- package/dist/preview/chunk.FP27W5MU.js +0 -1
- package/dist/preview/chunk.G2OOBROL.js +0 -1040
- package/dist/preview/chunk.GCKSQ52O.js +0 -1
- package/dist/preview/chunk.GE5EAN36.js +0 -2
- package/dist/preview/chunk.HOPIZMJR.js +0 -2
- package/dist/preview/chunk.IBGO4BUF.js +0 -1
- package/dist/preview/chunk.IDI2BQ7Y.js +0 -9
- package/dist/preview/chunk.IH42QTOM.js +0 -1
- package/dist/preview/chunk.ISRS7GOT.js +0 -321
- package/dist/preview/chunk.J6CBMLGR.js +0 -1
- package/dist/preview/chunk.JRCV6HVV.js +0 -1
- package/dist/preview/chunk.KWW3YHQ4.js +0 -23
- package/dist/preview/chunk.MKNXV4TM.js +0 -8
- package/dist/preview/chunk.MRK6QJV5.js +0 -25
- package/dist/preview/chunk.MVNIKZIC.js +0 -1
- package/dist/preview/chunk.N2WTNKEV.js +0 -1
- package/dist/preview/chunk.N7HCALRK.js +0 -61
- package/dist/preview/chunk.NRRUGG22.js +0 -1
- package/dist/preview/chunk.OGL4PHTY.js +0 -1
- package/dist/preview/chunk.ONDILMIX.js +0 -1
- package/dist/preview/chunk.PFQFPJ5L.js +0 -16
- package/dist/preview/chunk.PN2H6X7O.js +0 -1
- package/dist/preview/chunk.PWHJHFC4.js +0 -1
- package/dist/preview/chunk.Q3HVA6L4.js +0 -1
- package/dist/preview/chunk.RZLNDVGN.js +0 -107
- package/dist/preview/chunk.SBHVVJY7.js +0 -1
- package/dist/preview/chunk.SNBIZ3B6.js +0 -1
- package/dist/preview/chunk.TBG2QBOS.js +0 -1
- package/dist/preview/chunk.VR735ZQL.js +0 -1
- package/dist/preview/chunk.VSXCXPK2.js +0 -1
- package/dist/preview/chunk.W3LDQ6B2.js +0 -1
- package/dist/preview/chunk.WCNONCTL.js +0 -6
- package/dist/preview/chunk.WHTNSETN.js +0 -1
- package/dist/preview/chunk.XG67BWH6.js +0 -1
- package/dist/preview/chunk.XRM6WXPW.js +0 -1
- package/dist/preview/chunk.Y5LPZLDE.js +0 -1
- package/dist/preview/chunk.YETBY2LM.js +0 -1
- package/dist/preview/chunk.YSYT3ASK.js +0 -1
- package/dist/preview/chunk.ZEUBAAVQ.js +0 -1
- package/dist/preview/chunk.ZJDRD6PO.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as W}from"./chunk.25OYH6MY.js";import{B as R,a as A,b as T,c as v,d as f,e as x,i as I,l as b,sa as k}from"./chunk.NRRUGG22.js";import{Yb as s,va as y,wa as r}from"./chunk.MKNXV4TM.js";import{a as H}from"./chunk.MRK6QJV5.js";import{b as B}from"./chunk.AJZBJBMO.js";var u=B(H(),1),L=e=>typeof e=="object"&&e!==null&&"idx"in e;function E(e){let n=r(window.location.pathname,e);return n===null?null:n!==s&&n!=="/"?"pages":n===s||window.location.href.includes("#")?f(window.location.hash).overview?"graview":"scene":L(window.history.state)?"pages":null}function J(e){let n=e.face??(e.stop&&v(e.stop).overview?"graview":"scene");return e.routing!=="address"||typeof window>"u"?n:E(e.basePath)??n}function K(e){return e.routing!=="address"||typeof window>"u"?!1:r(window.location.pathname,e.basePath)==="/"&&E(e.basePath)===null}function Q(e){if(typeof window>"u")return;let n=r(window.location.pathname,e);return n===s||n==="/"&&window.location.href.includes("#")?T(f(window.location.hash)):void 0}function X({basePath:e,pagesWere:n,shown:t,onFace:i,toggle:l,kinds:U,places:w,opens:$}){let{view:F,go:p}=k(),g=(0,u.useRef)({shown:t,view:F,onFace:i});g.current={shown:t,view:F,onFace:i};let S=(0,u.useRef)(n??"/"),M=()=>{S.current=`${r(window.location.pathname,e)??"/"}${window.location.search}`};return l.current=(o,c,a)=>{let{shown:d,view:N,onFace:V}=g.current;if(o==="pages"&&d!=="pages")window.history.pushState(null,"",y(c??S.current,{basePath:e}));else if(o!=="pages"&&d==="pages"){M();let m=a===void 0?N:j(v(a),w),h=Y(m)?q($):m,O=h!==m&&h.overview?"graview":o,P=_(O,h,U);p(P),window.history.pushState(null,"",`${y(s,{basePath:e})}${x(P)}`),V?.(O);return}V?.(o)},(0,u.useEffect)(()=>{let o=()=>{if(r(window.location.pathname,e)===null)return;let c=E(e)??"pages",{shown:a,onFace:d}=g.current;if(c==="pages"){a!=="pages"&&d?.("pages");return}a==="pages"&&(p(j(f(window.location.hash),w)),d?.(c))};return window.addEventListener("popstate",o),()=>window.removeEventListener("popstate",o)},[e,p,w]),null}function j(e,n){let t=e.within?.view,i=t!==void 0&&!e.focusId?n.find(l=>l.as===t):void 0;return i?{...e,focusId:R(i.kind)}:e}function _(e,n,t){return e==="graview"?b(n,!0):n.overview?I(b(n,!1),W(n,t)):n}function Y(e){return e.focusId===null&&e.overview!==!0}function q(e){return e??{...A,overview:!0}}export{J as a,K as b,Q as c,X as d,j as e,_ as f,Y as g,q as h};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{f as O,k as b}from"./chunk.337WDTG3.js";function K(n,s){return s===1&&["every","some","sum","min","max","sort"].includes(n.fn)}function S(n){let s=new Set,e=new Set,r=[],i=[],o=new Set(O),a=(l,f)=>{switch(l.t){case"lit":return;case"ident":f||s.add(l.name);return;case"list":l.items.forEach(c=>a(c,f));return;case"member":a(l.object,f);return;case"unary":a(l.operand,f);return;case"binary":a(l.left,f),a(l.right,f);return;case"where":a(l.set,f),a(l.filter,!0);return;case"call":{e.add(l.fn);let c=(l.fn==="out"||l.fn==="in")&&l.args.length===2?l.args[1]:l.args[0],h=c?.t==="lit"&&typeof c.value=="string"?c.value:void 0;l.fn==="all"&&h&&r.push(h),(l.fn==="out"||l.fn==="in")&&h&&i.push(h),l.args.forEach((k,x)=>a(k,f||K(l,x)));return}}};return a(n,!1),{names:s,functions:e,unknownFunctions:[...e].filter(l=>!o.has(l)),sweeps:r,edges:i}}var p=class extends Error{constructor(e,r,i){super(`${e} (at character ${r+1} of "${i}")`);this.sentence=e;this.at=r;this.source=i}},q=["||","&&","==","!=","<=",">=","<",">","!","|","&","+","-","*","/","%","(",")","[","]",",","."],F={and:"&&",or:"||",not:"!"},M=2e3;function I(n){let s=[],e=0;for(;e<n.length;){let r=n[e];if(r===" "||r===" "||r===`
|
|
2
|
-
`||r==="\r"){e++;continue}if(r>="0"&&r<="9"){let o=e;for(;e<n.length&&/[0-9.]/.test(n[e]);)e++;let a=n.slice(o,e),l=Number(a);if(!Number.isFinite(l)||a.split(".").length>2)throw new p(`"${a}" is not a number`,o,n);s.push({k:"num",v:l,at:o});continue}if(r==="'"||r==='"'){let o=e++,a="";for(;e<n.length&&n[e]!==r;)n[e]==="\\"&&e+1<n.length&&e++,a+=n[e++];if(e>=n.length)throw new p("a quoted word is never closed",o,n);e++,s.push({k:"str",v:a,at:o});continue}if(/[A-Za-z_]/.test(r)){let o=e;for(;e<n.length&&/[A-Za-z0-9_]/.test(n[e]);)e++;let a=n.slice(o,e),l=Object.hasOwn(F,a)?F[a]:void 0;s.push(l?{k:"op",v:l,at:o}:{k:"id",v:a,at:o});continue}let i=q.find(o=>n.startsWith(o,e));if(!i)throw new p(`"${r}" is not part of the rule language`,e,n);s.push({k:"op",v:i,at:e}),e+=i.length}return s.push({k:"end",at:n.length}),s}function w(n){if(n.length>M)throw new p(`an expression may be at most ${M} characters`,0,n.slice(0,40));let s=I(n),e=0,r=()=>s[e],i=t=>{let d=r();return d.k==="op"&&d.v===t},o=t=>{let d=r();return d.k==="id"&&d.v===t},a=(t,d)=>{if(!i(t))throw new p(`expected ${d}`,r().at,n);e++},l=0,f=(t,d)=>{if(++l>64)throw new p("the expression nests too deeply",t,n);try{return d()}finally{l--}},c=(t,d)=>()=>{let u=d();for(;;){let y=r(),R=y.k==="op"?t.find(B=>B===y.v):y.k==="id"&&y.v==="in"&&t.includes("in")?"in":void 0;if(!R)return u;e++,u={t:"binary",op:R,left:u,right:d(),at:y.at}}},h=()=>{let t=r();if(t.k==="num")return e++,{t:"lit",value:t.v,at:t.at};if(t.k==="str")return e++,{t:"lit",value:t.v,at:t.at};if(t.k==="id"){if(e++,t.v==="true"||t.v==="false")return{t:"lit",value:t.v==="true",at:t.at};if(t.v==="null")return{t:"lit",value:null,at:t.at};if(i("(")){e++;let d=[];if(!i(")"))for(;;){if(d.push(m()),i(",")){e++;continue}break}return a(")",`")" to close ${t.v}(\u2026)`),{t:"call",fn:t.v,args:d,at:t.at}}return{t:"ident",name:t.v,at:t.at}}if(t.k==="op"&&t.v==="("){e++;let d=f(t.at,m);return a(")",'a ")"'),d}if(t.k==="op"&&t.v==="["){e++;let d=[];if(!i("]"))for(;;){if(d.push(m()),i(",")){e++;continue}break}return a("]",'a "]" to close the list'),{t:"list",items:d,at:t.at}}throw t.k==="end"?new p("the expression ends too soon",t.at,n):new p(`"${t.k==="op"?t.v:""}" cannot start a value here`,t.at,n)},k=()=>{let t=h();for(;;){if(i(".")){let d=r();e++;let u=r();if(u.k!=="id")throw new p('expected a field name after "."',u.at,n);e++,t={t:"member",object:t,name:u.v,at:d.at};continue}if(o("where")){let d=r().at;e++,t={t:"where",set:t,filter:f(d,m),at:d};continue}return t}},x=()=>{let t=r();return t.k==="op"&&(t.v==="!"||t.v==="-")?(e++,{t:"unary",op:t.v,operand:f(t.at,x),at:t.at}):k()},T=c(["*","/","%"],x),C=c(["+","-"],T),A=c(["&"],C),v=c(["|"],A),P=()=>{let t=v(),d=r(),u=d.k==="op"&&["==","!=","<","<=",">",">="].includes(d.v)?d.v:d.k==="id"&&d.v==="in"?"in":void 0;return u?(e++,{t:"binary",op:u,left:t,right:v(),at:d.at}):t},$=()=>{let t=r();return t.k==="op"&&t.v==="!"?(e++,{t:"unary",op:"!",operand:f(t.at,$),at:t.at}):P()},z=c(["&&"],$),_=c(["||"],z);function m(){return _()}let N=m();if(r().k!=="end")throw new p("there is more after the end of the expression",r().at,n);return N}function D(n){let s,e=-1,r=0;for(let i=0;i<n.length;i++){let o=n[i];if(s){o==="\\"?i++:o===s&&(s=void 0);continue}o==="'"||o==='"'?s=o:o==="("||o==="["?r++:o===")"||o==="]"?r--:o==="|"&&r===0&&(n[i+1]==="|"?i++:e=i)}return e}var E=/\s*(?:'((?:[^'\\]|\\.)*)'|"((?:[^"\\]|\\.)*)")\s*(,|$)/y;function H(n){let s=n.indexOf(":"),e=(s>=0?n.slice(0,s):n).trim();if(!b.includes(e))throw new g(`"${e}" is not a formatter; use one of ${b.join(", ")}`);let r=[];if(s>=0){let i=n.slice(s+1),o=0;for(;o<i.length;){E.lastIndex=o;let a=E.exec(i);if(!a)throw new g(`"${e}" is told quoted words, like ${e}: 'offer'`);if(r.push((a[1]??a[2]??"").replace(/\\(.)/g,"$1")),o=E.lastIndex,a[3]==="")break}}if(e==="plural"&&(r.length<1||r.length>2))throw new g("plural is told its noun, like {count | plural: 'offer'}, and its plural where English does not make it: plural: 'person', 'people'");if(e!=="plural"&&r.length>0)throw new g(`"${e}" takes nothing after it`);return{format:e,args:r}}var g=class extends Error{constructor(e){super(e);this.sentence=e}};function J(n){let s=[],e=0;for(;e<n.length;){let r=n.indexOf("{",e);if(r<0){s.push({text:n.slice(e)});break}r>e&&s.push({text:n.slice(e,r)});let i=n.indexOf("}",r);if(i<0)throw new g(`a "{" at character ${r+1} is never closed`);let o=n.slice(r+1,i),a=D(o),l=(a>=0?o.slice(0,a):o).trim(),f=a>=0?H(o.slice(a+1)):void 0;s.push({expr:w(l),source:l,...f?{format:f.format}:{},...f&&f.args.length>0?{formatArgs:f.args}:{}}),e=i+1}return s}function j(n){let s=new Map;for(let[e,r]of Object.entries(n?.computed??{}))s.set(e,typeof r=="string"?{expr:r}:r);return s}function te(n){let s=j(n);if(s.size===0)return;let e=new Map;for(let[r,i]of s)try{e.set(r,w(i.expr))}catch(o){if(!(o instanceof p))throw o}return e}function L(n,s,e=new Set){let r=j(n).get(s);if(!r||e.has(s))return!1;let i;try{i=w(r.expr)}catch{return!1}let o=S(i);if(o.edges.length>0||o.sweeps.length>0||[...o.functions].some(c=>c==="out"||c==="in"||c==="all"))return!1;let a=n.fields,l=c=>a instanceof Set?a.has(c):Object.hasOwn(a,c),f=new Set([...e,s]);return[...o.names].every(c=>l(c)||L(n,c,f))}export{S as a,p as b,w as c,g as d,J as e,j as f,te as g,L as h};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{e as ye,f as he,i as be,j as J,k as we}from"./chunk.46KUPBQC.js";import{f as ge}from"./chunk.GE5EAN36.js";import{$b as me,B as z,E as ne,Jb as ue,O as E,Q as T,Sa as ie,T as te,Tb as pe,U as re,V as X,W as oe,Z as _,aa as H,ba as se,bc as fe,hb as ae,ib as q,jb as le,vb as de,xb as ce}from"./chunk.MKNXV4TM.js";function Re(t,r,n){let s=t.tryDefinition(r)?.fields.shape,e=z(s?.[n]),l=!1,i=!1;for(;e&&(e.type==="optional"||e.type==="default"||e.type==="nullable"||e.type==="prefault");)(e.type==="optional"||e.type==="nullable")&&(l=!0),(e.type==="default"||e.type==="prefault")&&(i=!0),e=z(e.innerType);if(e?.type!=="enum")return;let y=(e.entries?Object.values(e.entries):e.values??[]).filter(u=>typeof u=="string");return y.length>0?{values:y,empty:l&&!i}:void 0}function L(t,r,n){let s=Re(t,r,n);if(!s)return[];let e=t.tryDefinition(r),l=s.values.map(i=>({value:i,label:re(e,n,i)}));return s.empty&&l.push({value:null,label:`No ${_(e,n).toLowerCase()}`}),l}function U(t,r,n){let s=t[r];return typeof s=="string"&&n.some(e=>e.value===s)?s:null}function Q(t,r,n,s,e=L(t.schema,n.kind,s)){let l=xe(t.schema,t.allMutations(),n.kind,s,e),i=U(n,s,e),y=[];for(let{value:u,by:A,acts:O}of l)if(u!==i)for(let $ of O){let B=A==="step"?{[$.subject.arg]:n.id}:{[$.subject.arg]:n.id,[s]:u},R={name:$.name,args:B};if($.input.safeParse(B).success&&t.permits(R,r).ok){try{ae(t.graph,$,B)}catch{continue}y.push({to:u,call:R,title:$.title??$.name});break}}return y}function xe(t,r,n,s,e=L(t,n,s)){let l=ve(t,r,n,s),i=$e(t,r,n,s);return e.flatMap(y=>{if(y.value===null)return[];let u=l.filter(A=>A.sets?.[s]===y.value);return[{value:y.value,label:y.label,by:u.length>0?"step":i.length>0?"value":"none",acts:u.length>0?u:i}]})}function ve(t,r,n,s){return r.filter(e=>e.subject!==void 0&&e.derived===void 0&&typeof e.sets?.[s]=="string"&&q(t,e).includes(n))}function $e(t,r,n,s){let e=t.tryDefinition(n);return e?r.filter(l=>{if(!l.subject||!q(t,l).includes(n)||!le(l,e).includes(s))return!1;let i=l.input.shape;return i!==void 0&&s in i}).sort((l,i)=>+(l.derived!==void 0)-+(i.derived!==void 0)):[]}var Y=(t,r)=>r&&t[r]!==void 0?String(t[r]):"";function Ae(t,r,n){let s=d=>t.tryDefinition(d)?r.nodesOfKind(d).filter(k=>E(t.tryDefinition(d),k)):[],e=s(n.rows),l=s(n.columns),i=new Set(e.map(d=>d.id)),y=new Set(l.map(d=>d.id)),u=r.allEdges(),A=[],O=n.link;if(typeof O=="string"){let d=p=>t.tryDefinition(p)?.edges?.[O]?.to,k=(d(n.columns)??[]).some(p=>p===n.rows||p==="*"),w=(d(n.rows)??[]).some(p=>p===n.columns||p==="*"),D=k||!w;for(let p of u){if(p.kind!==O)continue;let m=D?p.to:p.from,o=D?p.from:p.to;i.has(m)&&y.has(o)&&A.push({rowId:m,columnId:o,via:[]})}}else{let d=new Map(O.path.map(w=>[w,new Map]));for(let w of u){let D=d.get(w.kind);if(!D)continue;let p=D.get(w.from);p?p.push(w.to):D.set(w.from,[w.to]);let m=D.get(w.to);m?m.push(w.from):D.set(w.to,[w.from])}let k=new Set;for(let w of l){let D=[{id:w.id,via:[]}];for(let p of O.path){let m=[],o=new Set;for(let f of D)for(let P of d.get(p).get(f.id)??[])o.has(`${f.id}|${P}`)||(o.add(`${f.id}|${P}`),m.push({id:P,via:[...f.via,f.id]}));D=m}for(let p of D){let m=`${p.id}|${w.id}`;!i.has(p.id)||k.has(m)||(k.add(m),A.push({rowId:p.id,columnId:w.id,via:p.via.slice(1)}))}}}let $=n.groupOrder??[],B=d=>$.indexOf(d)===-1?$.length:$.indexOf(d),R=e.map(d=>{let k=d;return{node:d,label:String(k.label??T(t.tryDefinition(d.kind),d)),group:Y(k,n.rowGroup),ref:Y(k,n.rowRef)}}).sort((d,k)=>B(d.group)-B(k.group)||(d.ref<k.ref?-1:d.ref>k.ref?1:0)),N=l.map(d=>({node:d,label:T(t.tryDefinition(d.kind),d),group:Y(d,n.columnGroup)})).sort((d,k)=>d.group<k.group?-1:d.group>k.group?1:d.node.id<k.node.id?-1:d.node.id>k.node.id?1:0);return{rows:R,columns:N,cells:A}}function ke(t,r,n){let{rows:s,columns:e,cells:l}=Ae(t,r,n),i=(o,f)=>X(t,o,f),y=o=>X(t,o,1).replace(/^1 /,""),u=o=>({id:o.id,kind:o.kind,title:T(t.tryDefinition(o.kind),o),parts:[]}),A=o=>{let f=r.getNode(o);if(!f)return null;let P=t.tryDefinition(f.kind),M=T(P,f),K=H(f,P,{limit:3,said:[M],glance:!0}).map(I=>I.alone.startsWith(I.label)?`${I.label.toLowerCase()}${I.alone.slice(I.label.length)}`:I.alone);return[M,...K].join(", ")},O=typeof n.link=="string"?[]:n.link.path.slice(0,-1).flatMap((o,f,P)=>{let M=ue(t,n.columns,P.slice(0,f+1));return M.ok?[...M.reached]:[]}),$=[{t:"text",text:`${i(n.rows,s.length)} against ${i(n.columns,e.length)}${O.length>0?`, through ${[...new Set(O)].map(o=>i(o,2).replace(/^2 /,"")).join(" and ")}`:""}${e.length>0?`: ${e.map(o=>o.label).join(", ")}`:""}.`}],B=new Map(e.map(o=>[o.node.id,o.label])),R=new Map(e.map((o,f)=>[o.node.id,f])),N=new Map,d=new Map;for(let o of l){let f=N.get(o.rowId);f?f.push(o):N.set(o.rowId,[o]);let P=d.get(o.columnId);P?P.add(o.rowId):d.set(o.columnId,new Set([o.rowId]))}for(let o of s){let P=[...N.get(o.node.id)??[]].sort((M,K)=>R.get(M.columnId)-R.get(K.columnId)).map(M=>{let K=M.via.map(A).filter(I=>I!==null);return`${B.get(M.columnId)}${K.length>0?` (${K.join("; ")})`:""}`});$.push({t:"field",label:o.label,text:P.length>0?P.join(", "):"none"})}$.push({t:"list",as:"name",columns:1,groups:e.map(o=>{let f=d.get(o.node.id)??new Set,P=s.filter(M=>f.has(M.node.id)).map(M=>u(M.node));return{heading:`${o.label} (${P.length})`,items:P}})});let k=new Set(l.map(o=>o.rowId)),w=new Set(l.map(o=>o.columnId)),D=s.filter(o=>!k.has(o.node.id)),p=e.filter(o=>!w.has(o.node.id)),m=n.rows===n.columns;return D.length>0&&$.push({t:"text",text:`${m?`${D.length} with none across`:`${i(n.rows,D.length)} with no ${y(n.columns)}`}: ${D.map(o=>o.label).join(", ")}.`}),p.length>0&&$.push({t:"text",text:`${m?`${p.length} with none down`:`${i(n.columns,p.length)} on no ${y(n.rows)}`}: ${p.map(o=>o.label).join(", ")}.`}),$}function Z(t,r,n,s={}){let{app:e,blocks:l=n?e?.viewSpecs?.[n.kind]?.[s.slot??"page"]:e?.home}=s;if(!l?.length)return[];let i=s.firstHeading??(n||s.blocks?void 0:1),y=we(t,r,n,{...s,money:s.money??e?.brand,firstHeading:i});return n&&!y.node?[]:he(typeof l[0]?.t=="string"?l:ye(l),y)}var Ce=240,Se=10,je=1160,Me=40,Oe=640,Be=3,Ie=t=>Math.max(1,Math.floor((Math.min(t,je)-Me+Se)/(Ce+Se)));function Ge(t,r,n,s){let{app:e}=s,l=s.width??1440,i=s.today??ne(),y=t.seenBy(r),u=y.schema,A=y.graph,O=fe(e),$=typeof n=="string"?n.trim():n.slug,B=typeof n=="string"?O.find(a=>a.slug===$||a.title===$||a.address===$):O.find(a=>a.slug===n.slug&&a.kind===n.kind)??n,R=!B&&typeof n=="string"?A.getNode($):void 0;if(!B&&!R)return{ok:!1,error:`"${$}" is not a place this app has, nor a record this seat can see.`,places:O.map(a=>a.slug)};let N=[],d=e.viewSpecs??{},k=Ie(l),w=(a,h)=>Z(y,null,a,{app:e,today:i,...h}),D=(a,h,b)=>{let g=u.tryDefinition(a.kind),S=T(g,a);if(h==="name")return{id:a.id,kind:a.kind,title:S,parts:[]};if(d[a.kind]?.[h]){let j=w(a,{slot:h}),[F,...v]=j,C=F?.t==="title";return{id:a.id,kind:a.kind,title:C?F.text:S,parts:p(C?v:j,b,`views.${a.kind}.${h}`,` (${a.id})`,C?1:0)}}if(h==="row")return{id:a.id,kind:a.kind,title:S,parts:[]};let c=g?.computed?J(u,A,a):a,G=H(c,g,{limit:3,said:[S],glance:!0});return{id:a.id,kind:a.kind,title:S,parts:G.map(j=>({t:"text",text:j.alone}))}};function p(a,h,b,g="",S=0){let x=[];return a.forEach((c,G)=>{let j=`${b}.${G+S}`;switch("problem"in c&&c.problem&&N.push({at:`${j}${g}`,says:c.problem}),c.t){case"title":x.push({t:"heading",level:3,text:c.text});return;case"text":x.push({t:"text",text:c.text,...c.tone?{tone:c.tone}:{}});return;case"badge":x.push({t:"badge",text:c.text});return;case"field":case"image":x.push({t:"field",label:c.label,text:c.text});return;case"progress":x.push({t:"progress",label:c.label,text:c.text});return;case"group":x.push(...p(c.blocks,h,`${j}.group`,g));return;case"when":x.push(...p(c.blocks,h,`${j}.show`,g));return;case"divider":case"figure":return;case"headline":x.push({t:"heading",level:c.level,text:c.text});return;case"number":x.push({t:"figure",text:c.text,...c.label?{label:c.label}:{}});return;case"list":{if(c.failed){x.push({t:"text",text:"\u2014"});return}if(c.members.length===0){c.empty&&x.push({t:"list",as:c.as,columns:1,groups:[],empty:c.empty});return}let F=h+1,v=F>Be?"name":c.as,C=(c.groups??[{value:null,members:c.members}]).map(W=>({..."heading"in W&&W.heading?{heading:W.heading}:{},items:W.members.map(Pe=>D(Pe,v,F))}));x.push({t:"list",as:v,columns:v==="card"?k:1,groups:C,...c.more>0?{more:c.more}:{}});return}}}),x}let m=[],o,f,P;if(R){f="record";let a=u.tryDefinition(R.kind),h=T(a,R);P={slug:R.id,title:h,kind:R.kind,address:ie(u,R.kind,R.id)},d[R.kind]?.page&&m.push(...p(w(R,{slot:"page"}),1,`views.${R.kind}.page`));let g=a?.computed?J(u,A,R):R;for(let S of se(a,H(g,a,{said:[h]}))){S.title&&m.push({t:"heading",level:2,text:S.title});for(let x of S.fields)m.push({t:"field",label:x.label,text:x.value})}}else{let a=B;P={slug:a.slug,title:a.title,kind:a.kind,address:a.address};let h=a.lens?pe(e).drawn.find(b=>b.as===a.slug&&(a.kind===null||b.kinds.includes(a.kind))):void 0;if(a.kind===null){let b=e.brand,g=b?.name??e.name,S=b?.logo&&ce(b.logo)?b.logo:void 0;if(o={name:g,...b?.subtitle?{subtitle:b.subtitle}:{},...S?{logo:{alt:b?.logoAlt??g,...de(S)?{drawn:"inline SVG"}:{drawn:"image",src:S}}}:{}},e.home)f="blocks",m=p(w(null,{}),0,"views.home");else{f="derived";let x=new Set(e.pages?.hide??[]),c=me(u.kinds,e.pages?.order).filter(G=>!x.has(G));m.push({t:"heading",level:1,text:e.name??"Home"});for(let G of c){let j=A.nodesOfKind(G).filter(F=>E(u.tryDefinition(G),F)).length;j>0&&m.push({t:"text",text:`${j} ${V(u,G,j)}`})}}}else if(h?.lens==="blocks")f="lens:blocks",m=p(w(null,{blocks:h.options.blocks??[]}),0,`lenses.${h.index}.options.blocks`);else if(h?.lens==="columns"){f="lens:columns";let b=h.options.bindings??{};for(let g of Object.keys(b)){let S=b[g]?.column;if(!S)continue;let x=L(u,g,S),c=A.nodesOfKind(g).filter(v=>E(u.tryDefinition(g),v));Object.keys(b).length>1&&m.push({t:"heading",level:2,text:V(u,g,2).replace(/^./,v=>v.toUpperCase())}),m.push({t:"text",text:`${c.length} ${V(u,g,c.length)} in columns by ${_(u.tryDefinition(g),S).toLowerCase()}.`});let G=x.map(v=>({column:v,items:c.filter(C=>U(C,S,x)===v.value).map(C=>D(C,"card",1))})).filter(({column:v,items:C})=>v.value!==null||C.length>0).map(({column:v,items:C})=>({heading:`${v.label} (${C.length})`,items:C}));m.push({t:"list",as:"card",columns:1,groups:G});let j=new Map;for(let v of c)for(let C of Q(t,r,v,S,x))j.set(C.to,(j.get(C.to)??new Set).add(`"${C.title}"`));let F=x.filter(v=>v.value!==null&&j.has(v.value)).map(v=>`to ${v.label} by ${[...j.get(v.value)].join(" or ")}`);m.push({t:"text",text:F.length>0?`Moves: ${F.join("; ")}.`:"Moves: none for this seat."})}}else if(h?.lens==="coverage")f="lens:coverage",m=ke(u,A,h.options);else if(h){f=`lens:${h.lens}`;let b=h.kinds.flatMap(g=>A.nodesOfKind(g).filter(S=>E(u.tryDefinition(g),S)));m.push({t:"text",text:`A ${h.lens} of ${b.length} ${h.kinds.map(g=>V(u,g,b.length)).join(" and ")}.`}),m.push({t:"list",as:"name",columns:1,groups:[{items:b.map(g=>D(g,"name",1))}]})}else{f="derived";let b=A.nodesOfKind(a.kind).filter(g=>E(u.tryDefinition(a.kind),g));m.push({t:"heading",level:1,text:a.title}),b.length===0?m.push({t:"list",as:"row",columns:1,groups:[],empty:`No ${V(u,a.kind,0)} yet.`}):m.push({t:"list",as:"row",columns:1,groups:[{items:b.map(g=>D(g,"row",1))}]})}}let M=r.kind==="system"?"the system":(r.roles??[]).length>0?(r.roles??[]).join(", "):r.kind,K=l<Oe?"phone":"wide",I=P.kind===null?Fe(u,A):[],ee={...o?{masthead:o}:{},...I.length>0?{facts:I}:{},place:P,seat:M,width:l,variant:K,drawnBy:f,parts:m,problems:N};return{ok:!0,description:{...ee,text:De(ee)}}}function Fe(t,r){let n=be(t,r,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[...ge(t)].map(([e,l])=>{let i=l.label??te(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 V(t,r,n){let s=t.tryDefinition(r);if(n===1)return s?.noun??r;let e=oe(t,r);return e.charAt(0).toLowerCase()+e.slice(1)}function De(t){let r=[`${t.place.title} (${t.place.address}) \u2014 as ${t.seat}, ${t.width} wide (${t.variant}).`],n=t.masthead;n&&r.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,l)=>{for(let i of e)switch(i.t){case"heading":r.push(`${l}${"#".repeat(i.level)} ${i.text}`);break;case"text":r.push(`${l}${i.text}`);break;case"badge":r.push(`${l}[${i.text}]`);break;case"field":case"progress":r.push(`${l}${i.label}: ${i.text}`);break;case"figure":r.push(`${l}${i.text}${i.label?` \u2014 ${i.label}`:""}`);break;case"list":if(i.groups.length===0){i.empty&&r.push(`${l}(${i.empty})`);break}for(let y of i.groups){y.heading&&r.push(`${l}${y.heading}:`);for(let u of y.items)r.push(`${l}${y.heading?" ":""}- ${u.title}`),s(u.parts,`${l}${y.heading?" ":" "}`)}i.as==="card"&&i.columns>1&&r.push(`${l}(cards, ${i.columns} across)`),i.more&&r.push(`${l}and ${i.more} more`);break}};if(s(t.parts,""),t.facts){r.push("Facts of the whole graph (what fact('<name>') reads):");for(let e of t.facts)r.push(`- ${e.label} (${e.name}): ${e.value??`not worked out \u2014 ${e.refused}`}`)}if(t.problems.length>0){r.push("Problems:");for(let e of t.problems)r.push(`- ${e.at}: ${e.says}`)}return r.join(`
|
|
2
|
-
`)}export{L as a,U as b,Q as c,xe as d,ve as e,$e as f,Z as g,Ge as h,De as i};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as lt}from"./chunk.SBHVVJY7.js";import{f as it}from"./chunk.GE5EAN36.js";import{a as M,e as q,n as st}from"./chunk.337WDTG3.js";import{$ as tt,D as Y,E as Q,F as G,Nb as at,Pa as ot,Q as T,T as V,W as X,Z as k,ga as nt,ha as et,ka as rt}from"./chunk.MKNXV4TM.js";import"./chunk.AJZBJBMO.js";function _(t){let e=[],n=!0;for(let r of t){if(r.text.length===0)continue;let a=r.as==="close"||r.text===","||r.text===":"||r.text.startsWith("'")||n;e.push({part:r,space:!a}),n=r.as==="open"}return e}function F(t,e){return _(t).map(({part:n,space:r})=>`${r?" ":""}${e?n.said??n.text:n.text}`).join("")}function xt(t){return F(t,!1)}function bt(t){return F(t,!0)}function ut(t,e=!1){let n=e?t.said:t.text;return t.record!==void 0?`${t.record} \u2014 ${n}`:n}function J(t){let e=u=>_(u).map(({part:o,space:s})=>({...o,space:s})),n=e(t.parts),r=t.when&&t.when.length>0?e(t.when):void 0,a=u=>`${F(n,u)}${r?`, when ${F(r,u)}`:""}`;return{...t,parts:n,...r?{when:r}:{},text:a(!1),said:a(!0)}}function Rt(t,e=!1){return t.line?ut(t.line,e):t.message}var ft=60,L=t=>({text:t,as:"name"}),d=(t,e)=>e===void 0?{text:t,as:"word"}:{text:t,as:"word",said:e},P=(t,e)=>e===void 0||e===t?{text:t,as:"value"}:{text:t,as:"value",said:e},b=(t,e)=>({text:t,as:"op",said:e}),R={text:"(",as:"open"},w={text:")",as:"close"},N={text:"\u2014",as:"value",said:"empty"},K={">=":["\u2265","at least"],"<=":["\u2264","at most"],"<":["<","less than"],">":[">","more than"],"==":["=","is"],"!=":["\u2260","is not"]},z={">=":"<","<=":">","<":">=",">":"<=","==":"!=","!=":"=="},wt={"+":["+","plus"],"-":["\u2212","minus"],"*":["\xD7","times"],"/":["\xF7","divided by"],"%":["mod","modulo"]},dt=t=>t.t==="binary"&&t.op in K;function D(t){return t.length>1&&t[1]===t[1].toUpperCase()&&/[A-Z]/.test(t[1])?t:t.charAt(0).toLowerCase()+t.slice(1)}function pt(t){let{schema:e}=t,n=i=>i===null?void 0:e.tryDefinition(i),r=(i,c)=>{let y=n(i)?.edges;return y&&Object.hasOwn(y,c)?y[c]:void 0},a=(i,c)=>{let y=r(i,c)?.to;return Array.isArray(y)&&y.length===1?y[0]:null},u=(i,c)=>{let y=(e.edge(c)?.from??[]).filter(A=>{let $=r(A,c)?.to;return i===null||$==="*"||Array.isArray($)&&$.includes(i)});return y.length===1?y[0]:null},o=(i,c)=>r(i,c)?V(c).toLowerCase():D(k(n(i),c)),s=i=>D(X(e,i)),p=i=>D(it(e).get(i)?.label??V(i)),x=i=>D(tt(n(i),i)),l=(i,c)=>{let y=i===null?void 0:t.formatOf?.(i,c);if(y?.format)return y;let A=t.said?.get(c);return A?{...y,format:A}:y},m=i=>T(e.tryDefinition(i.kind),i),g=(i,c)=>{if(i==null)return N;if(i instanceof M){if(i.nodes.length===0)return N;let v=i.nodes.slice(0,3).map(m),H=i.nodes.length-v.length;return P(H>0?`${v.join(", ")} and ${H} more`:v.length>1?`${v.slice(0,-1).join(", ")} and ${v[v.length-1]}`:v[0])}if(Array.isArray(i))return P(`{${i.map(v=>g(v,c).text).join(", ")}}`,i.map(v=>g(v,c).text).join(" or "));if(typeof i=="object")return P(m(i));if(typeof i=="boolean")return P(i?"yes":"no");let y=c?.format??(c?l(c.kind,c.key):void 0);if(typeof i=="number"){if(y?.format==="money")return P(st(i,{...t.money,...y.unit&&/^[A-Z]{3}$/.test(y.unit)?{currency:y.unit}:{}}));if(y?.format==="percent")return P(`${Math.round(i*100)}%`);let v=i.toLocaleString("en-US",{maximumFractionDigits:2});return P(y?.unit&&!/^[A-Z]{3}$/.test(y.unit)?`${v} ${y.unit}`:v)}if(Y.test(i)||y?.format==="date")return P(G(i.slice(0,10)));let A=c&&c.kind!==null?n(c.kind)?.display?.format?.[c.key]:void 0;if(A)return P(A(i));let $=i.length>ft?`${i.slice(0,ft-1).trimEnd()}\u2026`:i;return P(/^[a-z][a-z0-9]*([-_][a-z0-9]+)*$/.test($)?$.replace(/[-_]+/g," "):$)};return{definition:n,relation:r,farOf:a,nearOf:u,fieldName:o,plural:s,noun:x,factName:p,formatOf:l,valueWords:g}}function E(t,e,n){if(t.t==="ident")return{kind:e,key:t.name};if(t.t==="member")return{kind:O(t.object,e,n),key:t.name};if(t.t==="call"&&(t.fn==="sum"||t.fn==="min"||t.fn==="max")&&t.args.length===2){let r=O(t.args[0],e,n),a=t.args[1];if(a.t==="ident")return{kind:r,key:a.name};if(a.t==="lit"&&typeof a.value=="string")return{kind:r,key:a.value}}if(t.t==="binary"&&(t.op==="+"||t.op==="-"))return E(t.left,e,n)??E(t.right,e,n);if(t.t==="call"&&t.fn==="if"&&t.args.length===3)return E(t.args[1],e,n)??E(t.args[2],e,n)}function O(t,e,n){switch(t.t){case"ident":return n.relation(e,t.name)?n.farOf(e,t.name):null;case"member":return n.farOf(O(t.object,e,n),t.name);case"where":return O(t.set,e,n);case"binary":return t.op==="|"||t.op==="&"||t.op==="-"?O(t.left,e,n):null;case"call":{let r=a=>{let u=t.args[a];return u?.t==="lit"&&typeof u.value=="string"?u.value:void 0};return t.fn==="all"?r(0)??null:t.fn==="out"?t.args.length===2?n.farOf(O(t.args[0],e,n),r(1)??""):n.farOf(e,r(0)??""):t.fn==="in"?t.args.length===2?n.nearOf(O(t.args[0],e,n),r(1)??""):n.nearOf(e,r(0)??""):(t.fn==="first"||t.fn==="sort")&&t.args[0]?O(t.args[0],e,n):null}default:return null}}function S(t){return t.t==="binary"?t.op==="||"?B(t)?4:1:t.op==="&&"?2:t.op in K||t.op==="in"?4:t.op==="+"||t.op==="-"?5:t.op==="*"||t.op==="/"||t.op==="%"?6:4.5:t.t==="unary"&&t.op==="!"?3:t.t==="where"?3.5:9}var W=t=>t.t==="lit",h=(t,e)=>t.t==="call"&&t.fn===e;function C(t,e){return t.t==="binary"&&t.op===e?[...C(t.left,e),...C(t.right,e)]:[t]}function B(t){if(t.t!=="binary"||t.op!=="||")return;let e=[];e.push(...C(t,"||"));let n,r=[];for(let a of e){if(a.t!=="binary"||a.op!=="=="||!W(a.right)||typeof a.right.value!="string"||n&&JSON.stringify(ct(n))!==JSON.stringify(ct(a.left)))return;n=a.left,r.push(a.right)}return n?{subject:n,values:r}:void 0}var ct=t=>JSON.parse(JSON.stringify(t,(e,n)=>e==="at"?void 0:n));function f(t,e,n,r){let a=(u,o,s=e)=>S(u)<o?[R,...f(u,s,n),w]:f(u,s,n);switch(t.t){case"lit":return[n.valueWords(t.value,r)];case"list":return[n.valueWords(t.items.map(u=>u.t==="lit"?u.value:null),r)];case"ident":return[L(n.fieldName(e,t.name))];case"member":{let u=h(t.object,"first")&&t.object.args[0]&&h(t.object.args[0],"all"),o=O(t.object,e,n);if(u&&o)return e!==null&&n.fieldName(e,t.name)===n.fieldName(o,t.name)&&n.definition(e)?.fields?.shape&&Object.prototype.hasOwnProperty.call(n.definition(e).fields.shape,t.name)?[L(`${n.noun(o)}'s ${n.fieldName(o,t.name)}`)]:[L(n.fieldName(o,t.name))];let s=f(t.object,e,n),p=s[s.length-1];return s.length===1&&p?.as==="name"?[L(`${p.text}'s ${n.fieldName(o,t.name)}`)]:[...s,d("'s"),L(n.fieldName(o,t.name))]}case"unary":return t.op==="-"?[b("\u2212","minus"),...a(t.operand,7)]:I(t.operand,e,n);case"where":{let u=O(t.set,e,n),o=f(t.filter,u,n),s=o.every(p=>p.as==="name"||p.as==="word"&&p.text==="not");return[...a(t.set,4),...s?[]:[d("with")],...S(t.filter)<=2?[R,...o,w]:o]}case"binary":return mt(t,e,n);case"call":return vt(t,e,n)}}function I(t,e,n){return dt(t)?mt({...t,op:z[t.op]},e,n):h(t,"present")||h(t,"exists")?[...f(t.args[0],e,n),b("=","is"),N]:t.t==="ident"?[d("not"),L(n.fieldName(e,t.name))]:[d("not"),R,...f(t,e,n),w]}function mt(t,e,n){let r=(o,s)=>S(o)<s?[R,...f(o,e,n),w]:f(o,e,n);if(t.op==="&&"||t.op==="||"){let o=B(t);if(o){let p=E(o.subject,e,n);return[...f(o.subject,e,n),b("\u2208","is one of"),n.valueWords(o.values.map(x=>x.value),p)]}let s=t.op==="&&"?2:1;return[...r(t.left,s),d(t.op==="&&"?"and":"or"),...r(t.right,s+.5)]}if(t.op in K){if(W(t.right)&&typeof t.right.value=="boolean"&&(t.op==="=="||t.op==="!="))return t.op==="=="===t.right.value?f(t.left,e,n):I(t.left,e,n);let[o,s]=K[t.op],p=E(t.left,e,n),x=E(t.right,e,n);return[...j(t.left,e,n,x),b(o,s),...j(t.right,e,n,p)]}if(t.op==="in")return[...r(t.left,5),b("\u2208","is one of"),...j(t.right,e,n,E(t.left,e,n))];let a=wt[t.op];if(a){let o=S(t);return[...r(t.left,o),b(a[0],a[1]),...r(t.right,o+.5)]}let u={"|":"or","&":"and also","-":"except"};return[...r(t.left,5),d(u[t.op]??t.op),...r(t.right,5)]}function j(t,e,n,r){return t.t==="lit"||t.t==="list"?f(t,e,n,r):S(t)<5?[R,...f(t,e,n),w]:f(t,e,n)}function vt(t,e,n){let r=o=>t.args[o],a=o=>{let s=t.args[o];return s?.t==="lit"&&typeof s.value=="string"?s.value:void 0},u=o=>{let s=r(o);return S(s)<9&&s.t!=="where"?[R,...f(s,e,n),w]:f(s,e,n)};switch(t.fn){case"out":{let o=a(t.args.length-1)??"",s=L(V(o).toLowerCase());return t.args.length===2?[s,d("of"),...u(0)]:[s]}case"in":{let o=a(t.args.length-1)??"",s=t.args.length===2?n.nearOf(O(r(0),e,n),o):n.nearOf(e,o),p=L(s?n.plural(s):V(o).toLowerCase());return t.args.length===2?[p,d("of"),...u(0)]:[p]}case"all":{let o=a(0);return[L(o?n.plural(o):"everything")]}case"fact":{let o=a(0);return[L(o?n.factName(o):"fact")]}case"count":return[d("number of"),...u(0)];case"exists":return[...u(0),b("\u2260","is not"),N];case"present":return[...f(r(0),e,n),b("\u2260","is not"),N];case"some":case"every":{let o=O(r(0),e,n),s=r(1);return[...t.fn==="some"?[d("some")]:[],...u(0),d(t.fn==="some"?"with":"all with"),...S(s)<=2?[R,...f(s,o,n),w]:f(s,o,n)]}case"sum":case"min":case"max":{let o=O(r(0),e,n),s=r(1),p=s.t==="lit"&&typeof s.value=="string"?[L(n.fieldName(o,s.value))]:S(s)<9?[R,...f(s,o,n),w]:f(s,o,n);return[d(t.fn==="sum"?"total":t.fn==="min"?"least":"most"),...p,d("of"),...u(0)]}case"first":{let o=r(0);if(h(o,"all")){let s=o.args[0]?.value;if(typeof s=="string")return[L(`the ${n.noun(s)}`)]}return[d("first of"),...u(0)]}case"sort":return[...u(0),d("by"),...f(r(1),O(r(0),e,n),n)];case"len":return[d("length of"),...f(r(0),e,n)];case"lower":return f(r(0),e,n);case"contains":case"startsWith":return[...f(r(0),e,n),d(t.fn==="contains"?"contains":"starts with"),...j(r(1),e,n,E(r(0),e,n))];case"today":return[P("today")];case"now":return[P("now")];case"date":return W(r(0))&&typeof r(0).value=="string"?[P(G(String(r(0).value)))]:f(r(0),e,n);case"days":case"hours":{let o=t.fn,[s,p]=[r(0),r(1)];return h(p,"today")||h(p,"now")?[d(`${o} since`),...f(s,e,n)]:h(s,"today")||h(s,"now")?[d(`${o} until`),...f(p,e,n)]:[d(`${o} from`),...f(s,e,n),d("to"),...f(p,e,n)]}case"if":return[R,...f(r(1),e,n),d("if"),...f(r(0),e,n),d(","),d("else"),...f(r(2),e,n),w];case"either":return t.args.flatMap((o,s)=>s===0?f(o,e,n):[d(","),d("else"),...f(o,e,n)]);default:return[d(t.fn),R,...t.args.flatMap((o,s)=>s===0?f(o,e,n):[d(","),...f(o,e,n)]),w]}}function U(t,e){let n=pt(e),r=t.over==="graph"?null:t.over;return J({...r===null?{}:{kind:r},parts:f(t.require,r,n),...t.when?{when:f(t.when,r,n)}:{}})}function Z(t,e,n){let r=pt(e),a=t.over==="graph"?null:t.over,u=n.subject,o=l=>{try{return q(l,{...n,budget:2e3})}catch{return}},s=(l,m)=>{let g=j(l,a,r,m);if(l.t==="lit"||l.t==="list"||h(l,"today")||h(l,"now")||h(l,"date"))return g;let i=o(l);if(i===void 0)return g;let c=E(l,a,r),y=r.valueWords(i,c?{...c,format:r.formatOf(c.kind,c.key)??(m?r.formatOf(m.kind,m.key):void 0)}:m);return i instanceof M?[...g,d(":"),y]:[...g,y]},p=l=>{if(l.t==="binary"&&l.op==="&&"){let m=[];m.push(...C(l,"&&"));let g=m.filter(i=>o(i)!==!0);return(g.length>0?g:m).flatMap((i,c)=>[...c>0?[d("and")]:[],...S(i)<=2?[R,...p(i),w]:p(i)])}if(l.t==="binary"&&l.op==="||"){let m=B(l);if(m){let i=E(m.subject,a,r);return[...s(m.subject),b("\u2209","is not one of"),r.valueWords(m.values.map(c=>c.value),i)]}let g=[];return g.push(...C(l,"||")),g.flatMap((i,c)=>[...c>0?[d("and")]:[],...S(i)<=2?[R,...p(i),w]:p(i)])}if(l.t==="binary"&&l.op in K){if(W(l.right)&&typeof l.right.value=="boolean"&&(l.op==="=="||l.op==="!="))return l.op==="=="===l.right.value?I(l.left,a,r):f(l.left,a,r);let m=z[l.op],[g,i]=K[m],c=E(l.left,a,r),y=E(l.right,a,r);if(W(l.right)&&l.right.value===null)return[...m==="=="?j(l.left,a,r,y):s(l.left,y),b(g,i),N];let A=m==="=="&&(W(l.right)||W(l.left));return[...A?j(l.left,a,r,y):s(l.left,y),b(g,i),...A?j(l.right,a,r,c):s(l.right,c)]}if(l.t==="binary"&&l.op==="in")return[...s(l.left),b("\u2209","is not one of"),...j(l.right,a,r,E(l.left,a,r))];if(l.t==="unary"&&l.op==="!"){let m=l.operand;return dt(m)?p({...m,op:z[m.op]}):h(m,"present")||h(m,"exists")?[...s(m.args[0]),b("\u2260","is not"),N]:m.t==="ident"?f(m,a,r):[d("not"),R,...I(m,a,r),w]}if(h(l,"present")||h(l,"exists"))return[...f(l.args[0],a,r),b("=","is"),N];if(h(l,"some"))return[...f(l,a,r).slice(1),b("=","is"),N];if(h(l,"every")&&l.args.length===2){let m=o(l.args[0]);if(m instanceof M){let g=m.nodes.filter(i=>{try{return q(l.args[1],{...n,subject:i,budget:2e3})!==!0}catch{return!0}});return[...f(l,a,r),d(","),d("not"),r.valueWords(new M(g))]}}return l.t==="ident"?[d("not"),L(r.fieldName(a,l.name))]:[d("not"),R,...f(l,a,r),w]},x;try{x=p(t.require)}catch{x=[d("not"),R,...f(t.require,a,r),w]}return J({...a===null?{}:{kind:a},parts:x,...u?{record:T(e.schema.tryDefinition(u.kind),u)}:{}})}function yt(t){let e=new Map;for(let n of t??[])n.expr?.t==="ident"&&n.format&&(n.format==="money"||n.format==="percent"||n.format==="date")&&e.set(n.expr.name,n.format);return e}function Ot(t){return(e,n)=>{let r=t[e]?.fields?.[n],a=r?.format??(r?.type==="date"?"date":void 0);return a||r?.unit?{...a?{format:a}:{},...r?.unit?{unit:r.unit}:{}}:void 0}}function ht(t,e){return{schema:e,said:yt(t.says),...t.declared?{formatOf:Ot(t.declared)}:{},...t.money?{money:t.money}:{}}}function Jt(t,e){return t.shape?U(t.shape,ht(t.shape,e)):void 0}var gt=new WeakMap;function Et(t,e){let n=new Map(t.allInvariants().map(r=>[r.name,r]));return e.map(r=>{let a=At(r),u=n.get(a.invariant)?.shape;if(!u||a.status&&a.status!=="violated")return a;let o=a.subjectId?t.graph.getNode(a.subjectId):void 0;if(u.over!=="graph"&&!o)return a;let s=u.kinds;s||(s=gt.get(t.schema),s||gt.set(t.schema,s=lt(t.schema)));try{let p=u.today?.()??t.today?.()??Q(),x=Z(u,ht(u,t.schema),{graph:t.graph,subject:o??null,kinds:s,today:p});return{...a,line:x,...u.says?{}:{message:`${a.message} \u2014 ${x.text}`}}}catch{return a}})}function Pt(){rt((t,e,n)=>Et({graph:t,schema:t.schema,allInvariants:()=>e},n)),ot(Lt)}function Lt(t,e,n,r){let a=e.graph,u=et.from(t.schema,a.snapshot(),{validate:!1});for(let x of n?[...r].reverse().map(nt):r)try{u.applyPrimitives([x],{restoring:!0})}catch{}let o=x=>t.violations(void 0,x),s=o(n?u:a),p=o(n?a:u);return{...at(t.allInvariants(),s,p),violationsAfter:p}}function At(t){if(!t.line)return t;let{line:e,...n}=t,r=` \u2014 ${e.text}`;return n.message.endsWith(r)?{...n,message:n.message.slice(0,-r.length)}:n}Pt();export{Z as brokenLineOf,Pt as judgeWithLines,Lt as judgedForASeat,Rt as problemWords,Jt as ruleLine,U as ruleLineOf,ut as ruleLineWords,_ as ruleSpacing,bt as ruleSpoken,xt as ruleText,At as unlined,Et as withLines};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{a as Y}from"./chunk.4H7CQE56.js";import"./chunk.W3LDQ6B2.js";import{a as E,c as H,e as V,f as _}from"./chunk.PWHJHFC4.js";import"./chunk.EYF6ONTA.js";import"./chunk.Q3HVA6L4.js";import"./chunk.AHDOKM4O.js";import"./chunk.6R4EI47C.js";import"./chunk.6LJ66MB7.js";import{D as W,c as M,da as w,va as G,ya as B}from"./chunk.NRRUGG22.js";import{Q as L,T as O,X as T}from"./chunk.MKNXV4TM.js";import{a as U,b as k}from"./chunk.MRK6QJV5.js";import{b as y}from"./chunk.AJZBJBMO.js";function A(t){return{minHeight:24,padding:"3px 10px",borderRadius:6,fontSize:"0.875rem",borderWidth:1,borderStyle:"solid",borderColor:t?"transparent":"var(--graview-edge)",color:t?"var(--graview-ink)":"var(--graview-ink-muted)",fontWeight:t?600:400,background:t?"color-mix(in srgb, var(--graview-accent) 16%, transparent)":"transparent"}}var P=y(k(),1);function j(){let{seats:t,principal:r,takeSeat:i}=w();return t.length<2?null:(0,P.jsxs)("div",{role:"group","aria-label":"Seat","data-testid":"seats",style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:6,rowGap:4},children:[(0,P.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:"As"}),t.map(a=>{let l=q(r,a.principal);return(0,P.jsx)("button",{type:"button","aria-pressed":l,"data-testid":`seat-${a.principal.id??a.label}`,title:`Sit down as ${a.label}: the acts, the kinds and the pages narrow to what this seat may do`,onClick:()=>i(a.principal),style:{...A(l),whiteSpace:"nowrap"},children:a.label},a.principal.id??a.label)})]})}function q(t,r){return t.kind===r.kind&&t.id===r.id}var z=y(U(),1),o=y(k(),1),J=`
|
|
2
|
-
.graview-here{display:flex;flex:none}
|
|
3
|
-
.graview-here>button{display:inline-flex;align-items:center;gap:4px;height:30px;margin:0;padding:0 4px;border:1px solid transparent;border-radius:8px;background:none;box-shadow:none;font:inherit;font-size:.75rem;color:var(--graview-ink-muted);cursor:pointer}
|
|
4
|
-
.graview-here-mark{display:inline-flex;align-items:center;justify-content:center;flex:none;box-sizing:border-box;width:24px;height:24px;border-radius:50%;border:1.5px solid hsl(var(--graview-hue) 50% 48%);background:var(--graview-panel-muted);color:var(--graview-ink);font-size:.75rem;font-weight:600;box-shadow:0 0 0 2px var(--graview-bar)}
|
|
5
|
-
.graview-here-mark+.graview-here-mark{margin-left:-10px}
|
|
6
|
-
.graview-here-mark[data-agent]{border-radius:5px}
|
|
7
|
-
.graview-here-mark[data-counted]{--graview-hue:0;border-color:var(--graview-edge)}
|
|
8
|
-
.graview-here small{display:block;font-size:.75rem;color:var(--graview-ink-muted)}
|
|
9
|
-
.graview-bar[data-finding] .graview-here{display:none}`,Q={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)"};function X(t,r){let i=r.id===void 0?null:`${r.kind}:${r.id}`,a=new Map;for(let l of t.values()){let d=l.participant.slice(0,l.participant.lastIndexOf(":"));if(d===i)continue;let s=d.endsWith(":")?l.participant:d,h=a.get(s);(!h||h.at<l.at)&&a.set(s,l)}return[...a.values()]}var D=t=>t.name&&t.onBehalfOfName?`${t.name}, for ${t.onBehalfOfName}`:t.name??"",K=t=>t===1?"1 viewer":`${t} viewers`;function Z(t){let r=t.map(D).filter(Boolean),i=r.length<t.length?[...r,K(t.length-r.length)]:r,a=i.pop();return`${i.length>0?`${i.join(", ")} and ${a}`:a} ${t.length===1?"is":"are"} here`}function ee(t,r){let{store:i,hidden:a,pictures:l}=r,d=M(t),s=i.kindsKeptFrom(r.principal),h=p=>!a.has(p)&&!s.has(p)&&!i.modules.disabledKinds.has(p),u=l.find(p=>p.as===d.within?.view&&h(p.kind));if(u)return u.title;if(!d.focusId)return d.overview?"the whole thing":null;let g=W(d.focusId);if(g.length>0)return g.every(h)?g.map(p=>T(i.schema,p)).join(" and "):null;let m=i.graph.getNode(d.focusId);return m&&h(m.kind)?L(i.schema.tryDefinition(m.kind),m):null}function te({scene:t,compact:r}){let{who:i,principal:a,store:l,views:d,hiddenKinds:s,follow:h}=w(),u=B("here"),g=X(i,a),m=g.length===0?"":Z(g),[p,N]=(0,z.useState)("");if((0,z.useEffect)(()=>N(m),[m]),g.length===0)return null;let S=g.filter(c=>c.name),f=S.slice(0,r?2:3),v=g.length-f.length,b=g.length-S.length,n=d.places();return(0,o.jsxs)("div",{className:"graview-here","data-testid":"here",children:[(0,o.jsx)("style",{children:J}),(0,o.jsx)("span",{role:"status","aria-live":"polite",style:Q,children:p}),(0,o.jsxs)("button",{type:"button","data-testid":"here-open",...u.trigger,onClick:u.toggle,"aria-label":`${m} \u2014 who and where`,title:m,children:[f.length>0?(0,o.jsx)("span",{style:{display:"flex"},children:f.map(c=>(0,o.jsx)(R,{one:c},c.participant))}):(0,o.jsx)(R,{count:v}),f.length>0&&v>0?(0,o.jsxs)("span",{"aria-hidden":"true",children:["+",v]}):null]}),(0,o.jsxs)("ul",{...u.pane,"aria-label":"Who is here","data-testid":"here-list",hidden:!u.open,className:"graview-bar-list",style:G,children:[S.map(c=>{let x=ee(c.stop,{store:l,principal:a,hidden:s,pictures:n}),I=D(c);return(0,o.jsx)("li",{children:(0,o.jsxs)(t?"button":"span",{className:"graview-bar-item","data-testid":"here-one",...t?{type:"button",title:`Go where ${I} is`,onClick:()=>{u.setOpen(!1),h(c.participant)}}:{style:{cursor:"default"}},children:[(0,o.jsx)(R,{one:c}),(0,o.jsxs)("span",{children:[I,x?(0,o.jsxs)("small",{children:["On ",x]}):null]})]})},c.participant)}),b>0?(0,o.jsx)("li",{children:(0,o.jsxs)("span",{className:"graview-bar-item","data-testid":"here-viewers",style:{cursor:"default"},children:[(0,o.jsx)(R,{count:b}),(0,o.jsxs)("span",{children:[K(b),(0,o.jsx)("small",{children:"Not signed in"})]})]})}):null]})]})}function R({one:t,count:r}){return(0,o.jsx)("span",{className:"graview-here-mark","aria-hidden":"true",...t?{style:{"--graview-hue":Math.round(t.hue)}}:{"data-counted":""},...t?.kind==="agent"?{"data-agent":""}:{},children:t?(t.name??"").trim().charAt(0).toUpperCase():r})}var e=y(k(),1);function ye({violations:t,pick:r}){let{store:i,brand:a,setMenuAt:l}=w(),d=E(i,t);return(0,e.jsx)(e.Fragment,{children:d.map((s,h)=>{let u=_(s),g=s.repairs.length>0?`${s.repairs.length} ${s.repairs.length===1?"way":"ways"} to fix`:"";return(0,e.jsx)("li",{style:{borderTop:h===0?"none":"1px solid var(--graview-edge)"},children:(0,e.jsxs)("button",{type:"button",onClick:m=>{let p=m.currentTarget.closest("ol").getBoundingClientRect();r(s),l({x:p.left,y:p.top,on:s.subjectId})},...H(s)!==void 0?{title:H(s)}:{},style:{width:"100%",textAlign:"left",fontSize:"0.8125rem",lineHeight:1.4,padding:"7px 8px",border:"1px solid transparent",background:"none",boxShadow:"none",borderRadius:7},children:[s.line?(0,e.jsx)(V,{line:s.line,schema:i.schema,...a?{brand:a}:{},stacked:!0,style:{display:"block",color:"var(--graview-ink)"}}):(0,e.jsx)("span",{style:{display:"block",color:"var(--graview-ink)"},children:s.message}),u||g?(0,e.jsx)("span",{style:{color:"var(--graview-ink-faint)",fontSize:"0.75rem"},children:[u,g].filter(Boolean).join(" \xB7 ")}):null]})},`${s.invariant}:${h}`)})})}function we({name:t,me:r,scheme:i,onScheme:a,profileHref:l,hostActions:d,close:s,part:h,signature:u=!1}){let{principal:g,seats:m,settings:p,settingValues:N,chooseSetting:S,sharing:f}=w(),v=g.roles??[],b={setOpen:n=>s()};return(0,e.jsx)(e.Fragment,{children:h==="top"?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{style:{display:"grid",gap:3},children:[(0,e.jsx)("span",{style:C,children:"Signed in as"}),(0,e.jsx)("strong",{style:{fontSize:"1rem",fontWeight:550},children:t}),(0,e.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:v.length>0?v.map(n=>O(n)).join(", "):r===void 0?"This app has no sign-in; everything here is yours.":"No role in particular"}),r!==void 0&&l!==void 0?(0,e.jsx)("a",{href:l(r.id),"data-testid":"profile-record",style:{display:"inline-flex",alignItems:"center",minHeight:24,justifySelf:"start",fontSize:"0.875rem",color:"var(--graview-accent)"},children:"Your record \u2197"}):null,f?(0,e.jsxs)("span",{"data-testid":"profile-seen-as",style:{fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:["Seen by others as ",f.name]}):null]}),d.length>0?(0,e.jsx)("ul",{role:"list","aria-label":"From the host","data-testid":"host-actions",style:{...$,margin:0,paddingLeft:0,listStyle:"none",display:"grid",gap:2},children:d.map(n=>(0,e.jsx)("li",{children:n.href!==void 0?(0,e.jsx)("a",{href:n.href,"data-testid":"host-action",className:"graview-host-action",...n.target?{target:n.target,rel:"noopener"}:{},onClick:()=>{n.onSelect?.(),b.setOpen(!1)},style:F,children:n.label}):(0,e.jsx)("button",{type:"button","data-testid":"host-action",className:"graview-host-action",onClick:()=>{b.setOpen(!1),n.onSelect?.()},style:{...F,width:"100%",textAlign:"left",border:"none",background:"none",boxShadow:"none",font:"inherit",cursor:"pointer"},children:n.label})},n.label))}):null]}):(0,e.jsxs)(e.Fragment,{children:[m.length>1?(0,e.jsxs)("div",{style:{display:"grid",gap:6,...$},children:[(0,e.jsx)("span",{style:C,children:"Sit as somebody else"}),(0,e.jsx)(j,{})]}):null,p.length>0?(0,e.jsx)("div",{style:{display:"grid",gap:10,...$},children:p.map(n=>(0,e.jsxs)("fieldset",{"data-testid":`setting-${n.name}`,style:{border:0,margin:0,padding:0,display:"grid",gap:5},children:[(0,e.jsx)("legend",{style:{...C,padding:0},children:n.title}),n.description?(0,e.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:n.description}):null,(0,e.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:n.options.map(c=>{let x=(N[n.name]??n.initial)===c.value;return(0,e.jsx)("button",{type:"button","aria-pressed":x,"data-testid":`setting-${n.name}-${c.value}`,onClick:()=>S(n.name,c.value),style:A(x),children:c.label},c.value)})})]},n.name))}):null,i!==void 0&&a!==void 0?(0,e.jsxs)("div",{style:{display:"grid",gap:5,...$},children:[(0,e.jsx)("span",{style:C,children:"Scheme"}),(0,e.jsx)("div",{style:{display:"flex",gap:4},children:["light","dark"].map(n=>(0,e.jsx)("button",{type:"button","aria-pressed":i===n,"data-testid":`profile-scheme-${n}`,onClick:()=>a(n),style:A(i===n),children:n==="light"?"\u2600 Light":"\u263E Dark"},n))})]}):null,u?(0,e.jsxs)("p",{"data-testid":"graview-signature",style:{...$,margin:0,display:"flex",alignItems:"center",gap:6,fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:["Built with",(0,e.jsxs)("a",{href:"https://graview.dev",target:"_blank",rel:"noopener",style:{display:"inline-flex",alignItems:"center",gap:4,minHeight:24,color:"var(--graview-ink-muted)",fontWeight:600,textDecoration:"none"},children:[(0,e.jsx)("span",{"data-testid":"graview-mark",style:{display:"inline-flex",lineHeight:0},dangerouslySetInnerHTML:{__html:ne}}),"Graview"]})]}):null]})})}var ne='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="14" height="14" aria-hidden="true" focusable="false"><g fill="none" stroke="currentColor" stroke-width="2.4" stroke-linejoin="round"><path d="M13 11 L3 8 L14 3 H29 L21 9"/><path d="M10 18 L3 23 L16.5 28 L29 21 L22 19"/><path d="M16.5 18.5 V23.5" stroke-linecap="round"/></g><circle cx="16.5" cy="13.5" r="2" fill="var(--graview-mark-point, currentColor)"/></svg>',F={display:"flex",alignItems:"center",minHeight:28,padding:"2px 8px",borderRadius:7,fontSize:"0.875rem",color:"var(--graview-ink)",textDecoration:"none"},C={fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},$={paddingTop:10,borderTop:"1px solid var(--graview-edge)"};export{Y as ActivityRail,te as Here,ye as ProblemRows,we as ProfilePane};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as G}from"./chunk.TBG2QBOS.js";import{Ba as W,Mb as V,Oa as j,S as B,_a as F,ca as C,fb as U,g as z,gb as q,ta as L,za as x}from"./chunk.MKNXV4TM.js";function K(e){return z(e,{io:"input",unrepresentable:"any",override:ae})}var re={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string"};function ae(e){let n=e.zodSchema._zod?.def;if(!n||n.type!=="string"||typeof n.format!="string"||n.format==="regex")return;let t=e.jsonSchema,f=(n.checks??[]).map(s=>s._zod?.def).filter(s=>s?.format==="regex"&&s.pattern instanceof RegExp).map(s=>s.pattern.source);delete t.pattern;let l=t.allOf;Array.isArray(l)&&l.every(s=>typeof s=="object"&&s!==null&&Object.keys(s).length===1&&"pattern"in s)&&delete t.allOf,t.format=re[n.format]??n.format,f.length===1?t.pattern=f[0]:f.length>1&&(t.allOf=f.map(s=>({pattern:s})))}function _(e){let n=x(e.input),t=K(e.input),f=t.properties??{};if(U(e)){let l=e.creates.join(" | ");f.id={type:"string",minLength:1,description:`Optional: the id for the ${l} this makes. Refused if the graph already has it; left out, one is minted from the label.`},t.properties=f}q(e)&&(t.additionalProperties=!1);for(let l of n){let s=f[l.name];if(!s)continue;let k=l.kinds.includes("*")?"any node kind":l.kinds.join(" | ");s.description=[s.description,`Id of a node (${k}).`].filter(Boolean).join(" ")}return{name:e.name,...e.title===void 0?{}:{title:e.title},description:e.description??e.title??e.name,inputSchema:t,nodeRefs:n}}function Z(e){let n=new Set;for(let t=e;t;t=t.onBehalfOf)t.id!==void 0&&n.add(`${t.kind}:${t.id}`);return n}function O(e,n){let t=Z(n),f=y=>{if(y.kind==="rule")return!1;let m=Z(y);if(m.size===0)return!1;for(let h of m)if(t.has(h))return!1;return!0},l,s=()=>{if(l)return l;l=new Map;for(let y of e.log.live()){if(y.undoes!==void 0)continue;let m=f(y.author)?y.author:void 0;for(let h of y.primitives){h.op==="remove-node"&&l.delete(h.node.id);let i=h.op==="add-node"?h.node.id:h.op==="patch-node"?h.id:void 0;if(i===void 0)continue;let r=h.op==="add-node"?Object.keys(h.node):Object.keys(h.after),c=l.get(i);(h.op==="add-node"||!c)&&l.set(i,c=new Map);for(let p of r)p==="id"||p==="kind"||(m?c.set(p,m):c.delete(p))}}return l},k=e.schema,g=new Map,v=(y,m)=>{let h=`${y}\0${m}`,i=g.get(h);if(i===void 0){let r=k.tryDefinition(y)?.fields?.shape;i=r!==void 0&&m in r&&W(r[m]).type==="text",g.set(h,i)}return i},b=y=>e.graph.getNode(y)?.kind;return{prose:v,say:y=>C(y,{graph:e.graph,schema:k}),fieldBy(y,m){let h=b(y);if(!(h===void 0||!v(h,m)))return s().get(y)?.get(m)},recordBy(y){let m=b(y),h=s().get(y);if(m===void 0||!h)return;let i;for(let[r,c]of h)v(m,r)&&(i=c);return i}}}var D=(e,n,t)=>({untrusted:!0,authoredBy:t.say(n),text:e});function I(e,n){return{...e,hits:e.hits.map(t=>{if(t.about!=="node")return t;let f=n.recordBy(t.id);if(!f)return t;let l=n.prose(t.kind,t.why.field)?n.fieldBy(t.id,t.why.field):f;return{...t,label:D(t.label,f,n),...t.apart!==void 0?{apart:D(t.apart,f,n)}:{},why:l?{...t.why,fragment:D(t.why.fragment,l,n)}:t.why}})}}var J=e=>{let n;return()=>n??=e().catch(t=>{throw n=void 0,t})},se=J(()=>import("./chunk.DAVRLRGB.js")),de=()=>import("./chunk.IBGO4BUF.js").catch(()=>{}),le=async()=>{(await de())?.judgeWithLines()},R=J(()=>import("./chunk.YETBY2LM.js")),ce=J(()=>import("./chunk.WCNONCTL.js")),S=e=>({title:e,readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}),M={type:"number",description:"Where the page starts; 0 when unsaid."},P=[{name:"search_graph",title:"Find by name",description:"Find things by name: records whose name or readable fields carry the words, and the kinds, places and rules the words name \u2014 each with why it matched. Reach for this before get_graph when you know what something is called. Words match the start of words, case and accents aside; key:value tokens narrow as a list's filter does (done:false, is:any for past records, kind:<kind>). Pass subject (a node id) to get the acts you may run on it as hits too.",inputSchema:{type:"object",properties:{query:{type:"string",description:"Words, with optional key:value conditions."},limit:{type:"number",description:"Most hits to return; at most 20."},subject:{type:"string",description:"A node id whose acts to include."}},required:["query"],additionalProperties:!1},mutating:!1,annotations:S("Find by name")},{name:"get_graph",title:"Read the graph",description:"Read the graph, 25 nodes a page: their fields, the edges out of them, and how many more. Start here when you need the shape of the domain rather than one thing in it.",inputSchema:{type:"object",properties:{offset:M},additionalProperties:!1},mutating:!1,annotations:S("Read the graph")},{name:"get_node",title:"Read one node",description:"Read one node: its fields, its links (id, kind and label, 20 each way a page), the violations that implicate it, and its computed values: read-only fields worked out from what you can see, which no act sets. Use this to check a thing before you change it.",inputSchema:{type:"object",properties:{id:{type:"string",description:"A node's id, or its name."},offset:M},required:["id"],additionalProperties:!1},mutating:!1,annotations:S("Read one node")},{name:"get_violations",title:"List the problems",description:"List the invariant violations the graph currently has, 20 a page, with the repairs that would resolve each one. Read this before proposing work: a rule that is already broken is more urgent than anything you could add.",inputSchema:{type:"object",properties:{offset:M,context:{type:"object",description:"Evaluation context, e.g. { weekStart }."}},additionalProperties:!1},mutating:!1,annotations:S("List the problems")},{name:"get_affordances",title:"Ask what can be done",description:"Ask what can legally be done with a selection, ranked. Prefer these over composing a mutation by hand: they are derived from the schema, the invariants and the shape of the graph, so they cannot name an action that does not exist.",inputSchema:{type:"object",properties:{selection:{type:"array",items:{type:"string"},description:"Node ids."},context:{type:"object"}},required:["selection"],additionalProperties:!1},mutating:!1,annotations:S("Ask what can be done")},{name:"describe_place",title:"Say what a place shows",description:`Say what one place of the app shows you, as a person in your seat would see it: its headings, its figures as drawn, its lists with each record's title and what its card or row says, the headings a list is grouped under, what an empty list says, and any block that could not be worked out. Pass a place's slug ("home", a lens's address like "the-offers", a kind's like "offers") or a record's id, and width 390 for a phone. Use it after a change to check what somebody now sees, instead of guessing.`,inputSchema:{type:"object",properties:{place:{type:"string",description:`"home", a place's slug, or a record's id.`},width:{type:"number",description:"The screen's width in CSS pixels; 390 is a phone, 1440 when unsaid."}},required:["place"],additionalProperties:!1},mutating:!1,annotations:S("Say what a place shows")},{name:"preview_mutation",title:"Try an act without applying it",description:"Try a mutation without applying it: get back the diff it would produce and any invariant it would break. Do this when you are unsure, rather than applying and undoing.",inputSchema:{type:"object",properties:{mutation:{type:"string"},args:{type:"object"}},required:["mutation","args"],additionalProperties:!1},mutating:!1,annotations:S("Try an act without applying it")},{name:"undo_batch",title:"Undo a batch",description:"Undo one batch of operations. Fails, naming the blocking operation, when a later operation read what it wrote.",inputSchema:{type:"object",properties:{batch:{type:"string"},include:{type:"array",items:{type:"string"}}},required:["batch"],additionalProperties:!1},mutating:!0,annotations:{title:"Undo a batch",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!1}}],N={type:"object",description:"A lens, as draft_view returns one.",properties:{title:{type:"string"},lens:{type:"string"},on:{type:"string"},bindings:{type:"object"},options:{type:"object"}},required:["title","lens","on"]},$={name:"draft_view",title:"Draw a view",description:'Draw a view of the data from words ("a board of tasks by status", "who covers what") as a lens the app could keep; or check a lens you wrote (lens); or change the one on screen (current, with ask: "only this month"). Returns the lens and its add-lens edit, or one sentence saying why not. Writes nothing.',inputSchema:{type:"object",properties:{ask:{type:"string",description:"What to see, in words."},lens:N,current:N},additionalProperties:!1},mutating:!1,annotations:S("Draw a view")},Y={name:"keep_lens",title:"Keep a view as a lens",description:"Keep a lens draft_view drew as one of the app's places: checked again, then written as the add-lens edit. Returns the remove-lens edit that takes it back.",inputSchema:{...N,additionalProperties:!1},mutating:!0,annotations:{title:"Keep a view as a lens",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}};function ue(e,n){return e===void 0?[]:e==="keep"&&!n?[$,Y]:[$]}var fe="An argument that names a record takes its id or its name.",Q=[...P.map(e=>e.name),$.name,Y.name],ee=64;function T(e){let{line:n,...t}=e;return t}function X(e){return{...e,...e.introduces?{introduces:e.introduces.map(T)}:{},...e.resolves?{resolves:e.resolves.map(T)}:{},...e.violationsAfter?{violationsAfter:e.violationsAfter.map(T)}:{}}}function pe(e){let n=e.normalize("NFKD").replace(/\p{M}/gu,"").replace(/[^A-Za-z0-9_-]/g,"_");return n.length===0&&(n="act"),/^[A-Za-z_]/.test(n)||(n=`act_${n}`),n.slice(0,ee)}function he(e){let n=new Set(Q),t=new Map;for(let f of e){let l=pe(f),s=l;for(let k=2;n.has(s);k+=1)s=`${l.slice(0,ee-`_${k}`.length)}_${k}`;n.add(s),t.set(f,s)}return t}function ye(e,n){let t=_(e),f=B(e),l=t.nodeRefs.length>0?`${t.description}${/[.!?]$/.test(t.description)?"":"."} ${fe}`:t.description;return{name:n,title:f,description:l,inputSchema:t.inputSchema,mutating:!0,annotations:{title:f,readOnlyHint:!1,destructiveHint:e.destructive===!0||(e.severs?.length??0)>0,idempotentHint:e.idempotent===!0,openWorldHint:!1},act:e.name}}function H(e){if(e===null||typeof e!="object")return JSON.stringify(e)??"null";if(Array.isArray(e))return`[${e.map(H).join(",")}]`;let n=e;return`{${Object.keys(n).filter(t=>n[t]!==void 0).sort().map(t=>`${JSON.stringify(t)}:${H(n[t])}`).join(",")}}`}function me(e){return`sha256:${V(H(e))}`}function ge(e,n,t,f){let l=he(e.map(g=>g.name)),s=ue(f,t);return{definitions:t?[...P.filter(g=>!g.mutating),...s]:[...P,...s,...e.filter(g=>n.has(g.name)).map(g=>ye(g,l.get(g.name)))],names:l}}function Fe(e,n={}){let t=n.author??{kind:"agent"},f=e.allMutations(),l=new Set(e.permittedMutations(t).map(i=>i.name)),{definitions:s,names:k}=ge(f,l,n.readOnly===!0,n.drafts?n.drafts.keep?"keep":"draw":void 0),g=me(s),v=i=>{if(!Q.includes(i)){for(let[r,c]of k)if(c===i)return r;return k.has(i)?i:void 0}},b=(i,r)=>{let c=f.find(a=>a.name===i);if(!c)return{args:r,resolved:[]};let p={...r},o=[];for(let a of x(c.input)){let d=p[a.name];if(typeof d!="string"||d.trim()==="")continue;let u=e.resolveRef(a,d,t);if(!u.ok){let w=u.reason==="none"?` Nothing was changed. Use search_graph to look it up, then pass its id as ${a.name}.`:" Nothing was changed.";return{ok:!1,error:`${u.message}${w}`,argument:a.name,candidates:u.candidates}}u.by!=="id"&&(p[a.name]=u.id,o.push({argument:a.name,given:d,id:u.id,label:u.label}))}return{args:p,resolved:o}},y=async(i,r)=>{try{await le();let c=s.find(o=>o.name===i)??s.find(o=>o.act===i);if(!c){let o=v(i);if(o){let a=e.permits({name:o,args:r},t);if(!a.ok)return{ok:!1,error:a.refusal.message,reason:"forbidden"}}return{ok:!1,error:`Unknown tool "${i}". Available: ${s.map(a=>a.name).join(", ")}`}}if(c.mutating&&n.readOnly)return{ok:!1,error:`"${i}" changes the graph, and this seat is read-only.`,reason:"forbidden"};if(c.act!==void 0){let o=b(c.act,r);if("ok"in o)return o;let a=j(e,t,e.apply({name:c.act,args:o.args},{...n.author?{author:n.author}:{},...we(n.via)}));return{ok:!0,data:{batch:a.batch,intent:a.intent,introduces:a.introduces.map(T),resolves:a.resolves.map(T),...o.resolved.length>0?{resolved:o.resolved}:{}},diff:a.diff}}let p=e.seenBy(t);switch(c.name){case"search_graph":{let o=typeof n.places=="function"?n.places():n.places,a=typeof r.subject=="string"?r.subject:void 0,d=F(p,String(r.query??""),{principal:t,limit:typeof r.limit=="number"&&r.limit>0?Math.min(r.limit,20):20,...o?{places:o}:{},...a?{subject:a,from:[a]}:{}});return{ok:!0,data:(await R()).searchRead(d,I(d,O(p,t))),reads:d.hits.flatMap(u=>u.about==="node"?[u.id]:[])}}case"get_graph":return{ok:!0,...(await R()).graphRead(p,O(p,t),r)};case"get_node":{let o=String(r.id??""),a=o,d;if(!p.graph.getNode(o)){let w=o.trim()===""?void 0:e.resolveRef({name:"id",kinds:["*"]},o,t);if(w?.ok)a=w.id,d={argument:"id",given:o,id:a,label:w.label};else return w?.reason==="ambiguous"?{ok:!1,error:w.message,argument:"id",candidates:w.candidates}:{ok:!1,error:`No node "${o}".`}}let u=(await R()).nodeRead(p,O(p,t),a,r);return{ok:!0,data:d?{...u.data,resolved:[d]}:u.data,reads:u.reads}}case"describe_place":{let o=n.app??{name:"",schema:e.schema},a=typeof r.width=="number"&&Number.isFinite(r.width)&&r.width>0?r.width:1440,{describePlace:d}=await se(),u=d(e,t,String(r.place??""),{app:o,width:a});if(!u.ok)return{ok:!1,error:`${u.error} The places are: ${u.places.join(", ")}.`};let w=new Set,A=ne=>{for(let te of ne)for(let oe of te.groups??[])for(let E of oe.items)w.add(E.id),A(E.parts)};return A(u.description.parts),{ok:!0,data:u.description,reads:[...w]}}case"draft_view":case"keep_lens":{let o=n.app??{name:"",schema:e.schema};return(await ce()).runDraftTool(c.name,r,{app:o,principal:t,...n.drafts?{drafts:n.drafts}:{}})}case"get_violations":{let o=p.violations(r.context);return{ok:!0,...(await R()).violationsRead(o,r)}}case"get_affordances":{let o=r.selection??[];return{ok:!0,data:G(p,o,{...typeof n.derive=="function"?n.derive():n.derive,...n.author?{principal:n.author}:{},...r.context?{context:r.context}:{}}),reads:o.filter(d=>p.graph.has(d))}}case"preview_mutation":{let o=String(r.mutation),a=v(o)??o,d=b(a,r.args??{});if("ok"in d)return d;let u=e.missingFor({name:a,args:d.args},t);if(u)return{ok:!1,error:u.message,reason:"missing"};let w=j(e,t,e.preview({name:a,args:d.args},void 0,{author:t})),A=X(w);return{ok:!0,data:d.resolved.length>0?{...A,resolved:d.resolved}:A}}case"undo_batch":{let o=String(r.batch),a=r.include??[],d=p.canUndo([o,...a]);if(!d.ok)return{ok:!1,error:d.message};let u=j(e,t,e.undo([o,...a],{...n.author?{author:n.author}:{}}));return{ok:!0,data:X(u),diff:u.diff}}default:return{ok:!1,error:`Unknown tool "${i}".`}}}catch(c){let{reason:p,wouldNeed:o}=L(c);return{ok:!1,error:c instanceof Error?c.message:String(c),reason:p,...o?{wouldNeed:o}:{}}}},m=new Set,h=i=>{for(let r of m)r(i)};return{definitions:s,hash:g,...n.author?{author:n.author}:{},onDiff(i){return e.subscribe(i)},onCall(i){return m.add(i),()=>m.delete(i)},async call(i,r){let c=(s.find(d=>d.name===i)??s.find(d=>d.act===i))?.mutating??!1,p={name:i,args:r,mutating:c,at:new Date().toISOString()};h({...p,phase:"running"});let o=d=>(h(d.ok?{...p,phase:"ok",...!c&&d.reads?{reads:d.reads}:{}}:{...p,phase:"failed",error:d.error}),d),a=await y(i,r);return o(a.ok&&!c?{...a,data:(await R()).withinReadChars(i,a.data)}:a)}}}function we(e){let n=typeof e=="function"?e():e;return n?{via:n}:{}}export{H as a,Fe as b};
|
|
@@ -1,321 +0,0 @@
|
|
|
1
|
-
import{a as Ne}from"./chunk.AHDOKM4O.js";import{a as Me}from"./chunk.6LJ66MB7.js";import{da as Ce,ea as Le,qa as He,ra as Ae,va as L,ya as H,za as Re}from"./chunk.NRRUGG22.js";import{$b as Ee,Cb as ye,Eb as xe,Hb as ke,Ib as $e,Q as se,Ra as U,Ub as Se,Vb as Pe,Wb as Be,X as de,Xb as Te,ca as ce,ma as pe,nb as ge,pb as ue,qb as ve,rb as Z,sb as we,tb as fe,vb as me,wb as he,xb as be}from"./chunk.MKNXV4TM.js";import{a as G,b as E}from"./chunk.MRK6QJV5.js";import{b as $}from"./chunk.AJZBJBMO.js";var w=$(G(),1);var Oe=$(G(),1);var K=$(E(),1);function ze({brand:e,size:a=22}){let t=e?.logo,r=t!==void 0&&me(t)&&he(t)===null?t:void 0,l=Ne(r);if(!t||!be(t))return null;let n=e?.logoAlt??e?.name??"",o=n!==""&&n!==e?.name,c={display:"inline-flex",flex:"0 0 auto",height:a,color:"var(--graview-accent)"};return r?(0,K.jsx)("span",{className:"graview-logo","data-testid":"app-mark",style:c,...o?{role:"img","aria-label":n}:{"aria-hidden":!0},dangerouslySetInnerHTML:l}):(0,K.jsx)("img",{className:"graview-logo","data-testid":"app-mark",src:t,alt:o?n:"",style:{...c,width:"auto"}})}function ja(e){(0,Oe.useEffect)(()=>{if(!e||typeof document>"u")return;let a=[...document.querySelectorAll('link[rel~="icon"]')],t=a.map(l=>l.getAttribute("href")),r;a.length===0&&(r=document.createElement("link"),r.rel="icon",r.setAttribute("data-graview-favicon",""),document.head.appendChild(r),a.push(r));for(let l of a)l.href=e;return()=>{r&&r.remove(),a.forEach((l,n)=>{l!==r&&t[n]!==null&&t[n]!==void 0&&l.setAttribute("href",t[n])})}},[e])}var B=Re(Me(()=>import("./chunk.IDI2BQ7Y.js")));var i=$(E(),1),da=B.part((e,a)=>(0,i.jsx)(e.Here,{...a}),{quiet:!0}),ca="home",pa="/",ga="scene:whole";function er(e){let{store:a,principal:t,views:r}=e,l=a.kindsKeptFrom(t),n=a.schema.kinds.filter(s=>!a.modules.disabledKinds.has(s)&&!l.has(s)),o=r?.arrangement?.(),c=r?.places()??[],p=Be(o,a.schema,c),d=Pe(a.schema,o,[...a.modules.administered.values()].flatMap(s=>s.kinds??[])),u=(s,m)=>(!a.graph.size.nodes||a.graph.count(s)>0)&&(p?m?p.places.has(`${s}|${m}`):p.kinds.has(s):!d.has(s)),g=[{key:ca,label:"Home",path:pa,group:"home",primary:!0}];for(let s of Ee(n,o?.order))g.push({key:`kind:${s}`,label:de(a.schema,s),path:U(a.schema,s),group:"lists",kind:s,primary:u(s)});for(let s of c){if(!n.includes(s.kind)||s.as===Te)continue;let m=c.some(P=>P.as===s.as&&P.kind!==s.kind),b=`/places/${encodeURIComponent(s.as)}${m?`?of=${U(a.schema,s.kind).slice(1)}`:""}`;g.some(P=>P.path===b)||g.push({key:`place:${s.kind}:${s.as}`,label:s.title,path:b,group:"pictures",kind:s.kind,primary:u(s.kind,s.as)})}return n.some(s=>Object.keys(a.schema.tryDefinition(s)?.edges??{}).length>0)&&g.push({key:"connections",label:"Connections",path:"/map",group:"pictures",primary:!1}),g}function ar(e,a){let[t="/",r=""]=a.split("?"),l=e.find(o=>o.path===(r?`${t}?${r}`:t))??e.find(o=>o.path===t);if(l)return l.key;let n=`/${t.split("/").filter(Boolean)[0]??""}`;return e.find(o=>o.group==="lists"&&o.path===n)?.key??null}var ua=(0,w.createContext)(null),rr=()=>(0,w.useContext)(ua),N=30,va=48,_=640,Ie=4,We=2;function wa(e){let{widths:a,current:t,room:r,more:l,gap:n=Ie,primary:o,most:c=Se}=e;if(a.length===0||!(r>0)||!(l>0)||a.some(g=>!(g>0)))return null;let p=(g,f)=>g.reduce((s,m)=>s+a[m],0)+n*Math.max(0,g.length-1)+(f?n+l:0),d=(g,f)=>t<0||!g.includes(t)||g.slice(0,f).includes(t)?g.slice(0,f):[...g.filter(s=>s!==t).slice(0,f-1),t].sort((s,m)=>s-m),u=d(a.map((g,f)=>f).filter(g=>o?.[g]!==!1||g===t),c);if(p(u,u.length<a.length)<=r)return u.length>=We?u:null;for(let g=u.length-1;g>=We;g--){let f=d(u,g);if(p(f,!0)<=r)return f}return null}var fa=`
|
|
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
|
-
.graview-bar-row{display:flex;flex-wrap:nowrap;align-items:center;gap:16px;height:${va-1}px;margin:0;padding:0 16px}
|
|
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}
|
|
5
|
-
.graview-bar-app{display:flex;flex:0 1 auto;max-width:50%}
|
|
6
|
-
.graview-bar-app::after{content:"";flex:0 100000 auto;width:2px;min-width:0}
|
|
7
|
-
.graview-bar-name{margin:0;display:flex;font-family:var(--graview-font-display,var(--graview-font-body,system-ui));font-size:.9375rem;font-weight:600;line-height:1.25}
|
|
8
|
-
.graview-bar-home{gap:8px;min-width:auto;min-height:30px;padding:0;letter-spacing:-.005em}
|
|
9
|
-
.graview-bar-app-name{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal;word-break:normal}
|
|
10
|
-
.graview-bar-faces{display:inline-flex;flex:0 0 auto;box-sizing:border-box;height:30px;margin:0;padding:2px;gap:2px;border:1px solid var(--graview-edge);border-radius:8px}
|
|
11
|
-
.graview-bar-face{gap:6px;padding:0 10px;border-radius:6px;font-size:.8125rem;white-space:nowrap;color:var(--graview-ink-muted)}
|
|
12
|
-
.graview-bar-face span{min-width:0;max-width:11em;overflow:hidden;text-overflow:ellipsis}
|
|
13
|
-
.graview-bar-face[aria-pressed=true]{color:var(--graview-ink);font-weight:600;background:color-mix(in srgb,var(--graview-accent) 16%,transparent)}
|
|
14
|
-
[data-switch-drawn=icons] .graview-bar-face{padding:0 8px}
|
|
15
|
-
[data-switch-drawn=icons] .graview-bar-face span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
|
|
16
|
-
.graview-bar-mid{display:flex;flex:1 100 0;min-width:0}
|
|
17
|
-
.graview-bar-mid[data-place]{min-width:9em;flex-basis:auto}
|
|
18
|
-
.graview-bar-place-at{position:relative;display:inline-flex;min-width:0;max-width:100%}
|
|
19
|
-
.graview-bar-place{gap:6px;height:30px;max-width:100%;padding:0 8px;border:1px solid transparent;border-radius:8px;font-size:.875rem;font-weight:600}
|
|
20
|
-
.graview-bar-face:hover,.graview-bar-place:hover{border-color:var(--graview-edge);color:var(--graview-ink)}
|
|
21
|
-
.graview-bar-place-words{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
22
|
-
.graview-bar-mid[data-places=standing]{flex:0 0 auto}
|
|
23
|
-
.graview-bar-places{display:flex;align-items:center;gap:${Ie}px;min-width:0;margin:0;padding:0}
|
|
24
|
-
.graview-bar-at{gap:6px;flex:0 0 auto;height:30px;padding:0 8px;border-block:2px solid transparent;border-radius:0;font-size:.875rem;font-weight:500;white-space:nowrap;color:var(--graview-ink-muted)}
|
|
25
|
-
.graview-bar-at:is(:hover,[aria-current],[aria-expanded=true]){color:var(--graview-ink)}
|
|
26
|
-
.graview-bar-at[aria-current]{font-weight:600;border-bottom-color:var(--graview-accent)}
|
|
27
|
-
.graview-bar-ruler{position:absolute;left:0;top:0;display:flex;width:0;height:0;overflow:hidden;visibility:hidden;pointer-events:none}
|
|
28
|
-
.graview-bar-ruler .graview-bar-at{font-weight:600}
|
|
29
|
-
.graview-bar-list{display:grid;align-content:start;width:min(320px,calc(100vw - 24px));height:auto;max-height:min(70vh,560px);overflow:auto;margin:0;padding:6px;border-radius:10px;border:1px solid var(--graview-edge);background:var(--graview-float);box-shadow:var(--graview-lift-high);color:var(--graview-ink)}
|
|
30
|
-
.graview-bar-list[hidden]{display:none}
|
|
31
|
-
.graview-bar-list p{margin:8px 8px 2px;font-size:.6875rem;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--graview-ink-muted)}
|
|
32
|
-
.graview-bar-list ul,.graview-bar-list li{display:grid;margin:0;padding:0;list-style:none}
|
|
33
|
-
.graview-bar-item{align-items:flex-start;gap:10px;width:100%;padding:7px 8px;border-radius:7px;font-size:.875rem;line-height:1.3;overflow-wrap:anywhere}
|
|
34
|
-
.graview-bar-item:hover{background:color-mix(in srgb,var(--graview-ink) 7%,transparent)}
|
|
35
|
-
.graview-bar-item[aria-current]{font-weight:600;background:color-mix(in srgb,var(--graview-accent) 14%,transparent)}
|
|
36
|
-
.graview-bar-mark{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:14px;height:1.3em;color:var(--graview-ink-muted)}
|
|
37
|
-
.graview-bar :focus-visible{outline:2px solid var(--graview-accent);outline-offset:1px}
|
|
38
|
-
.graview-bar-tools{display:contents}
|
|
39
|
-
.graview-bar-tools>*{margin-left:-8px}
|
|
40
|
-
.graview-bar-tools>:is(.graview-bar-find,.graview-bar-find-open){margin-left:auto}
|
|
41
|
-
.graview-bar-own{display:flex;align-items:center;flex:0 0 auto}
|
|
42
|
-
.graview-bar-own:empty{display:none}
|
|
43
|
-
.graview-bar-find{position:relative;display:flex;min-width:7.5rem;flex:0 600 9rem;--graview-bar-find-end:3.25em}
|
|
44
|
-
.graview-bar-find-slot{display:flex;flex:1;min-width:0}
|
|
45
|
-
.graview-bar-find-keys{position:absolute;right:10px;line-height:30px;pointer-events:none;font-size:.75rem;color:var(--graview-ink-faint)}
|
|
46
|
-
.graview-bar-find:is(:focus-within,:has(input:not(:placeholder-shown))){flex-basis:16rem;--graview-bar-find-end:10px}
|
|
47
|
-
:is(:focus-within,:has(input:not(:placeholder-shown)))>.graview-bar-find-keys,.graview-bar-find-open{display:none}
|
|
48
|
-
.graview-bar-line{display:flex;flex:0 0 auto;padding:6px 8px;background:var(--graview-ground);border-bottom:1px solid var(--graview-edge);font-family:var(--graview-font-body,system-ui)}
|
|
49
|
-
.graview-bar-line .graview-bar-place{height:auto;min-height:32px}
|
|
50
|
-
.graview-bar-line .graview-bar-place-words{white-space:normal}
|
|
51
|
-
@media (pointer:coarse){.graview-bar-find-keys{display:none}}
|
|
52
|
-
@container graview-bar (max-width: ${_-1}px){
|
|
53
|
-
.graview-bar-row{gap:10px;padding:0 12px}
|
|
54
|
-
.graview-bar-app,.graview-bar-home{max-width:none;flex:1 1 auto;min-width:0}
|
|
55
|
-
.graview-bar-mid,.graview-bar-find{display:none}
|
|
56
|
-
.graview-bar-find-open{display:inline-flex}
|
|
57
|
-
.graview-bar-own{--graview-activity-mark:inline}
|
|
58
|
-
.graview-bar-own .graview-activity-word{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
|
|
59
|
-
.graview-bar[data-finding] :is(.graview-bar-app,.graview-bar-faces,.graview-bar-find-open){display:none}
|
|
60
|
-
.graview-bar[data-finding] .graview-bar-find{display:flex;flex:1 1 auto;min-width:0}
|
|
61
|
-
}`,O={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:6,minWidth:N,height:N,padding:0,borderRadius:8,border:"1px solid transparent",background:"none",boxShadow:"none",color:"var(--graview-ink-muted)",font:"inherit",fontSize:"0.875rem",cursor:"pointer",flex:"0 0 auto"};function tr({brand:e,name:a,heading:t=1,home:r,faces:l,places:n,current:o,reach:c,tools:p,find:d=!0,description:u,findBox:g,onFind:f,switch:s="words",scenePlaces:m}){let b=(0,w.useRef)(null),P=Le()?.who.size,[R,Ue]=(0,w.useState)(null),[Q,Ze]=(0,w.useState)(null),[x,Xe]=(0,w.useState)(!1),[Je,ee]=(0,w.useState)(!1),[Qe,ea]=(0,w.useState)(!0),[ae,aa]=(0,w.useState)(null),W=l?l.pages.current:!m,D=W?{places:n,current:o,reach:c}:m,h=D&&D.places.length>0?D:null,re=h?h.places.findIndex(v=>v.key===h.current):-1,te=!!l&&s==="words",ne=h?h.places.map(v=>v.primary===!1?"0":"1").join(""):"",T=(0,w.useCallback)(()=>{let v=b.current;if(!v)return;let k=Ba(v,re,te,ne);k!==void 0&&aa(k);let C=k?!0:ha(v);C!==null&&ea(C)},[re,te,ne]);(0,w.useLayoutEffect)(()=>{let v=b.current;if(!v)return;let k=()=>{let q=v.getBoundingClientRect().width;Xe(q<_),v.style.setProperty("--graview-bar-width",`${Math.round(q)}px`),T()};k();let C=typeof document>"u"?void 0:document.fonts;if(C?.ready.then(T),C?.addEventListener?.("loadingdone",T),typeof ResizeObserver>"u")return()=>C?.removeEventListener?.("loadingdone",T);let Y=new ResizeObserver(k);Y.observe(v);for(let q of v.querySelectorAll(".graview-bar-tools > *"))Y.observe(q);return()=>{Y.disconnect(),C?.removeEventListener?.("loadingdone",T)}},[T]);let V=(0,w.useRef)(f);V.current=f,(0,w.useLayoutEffect)(()=>{V.current?.(d&&R?{slot:R,compact:x,own:Q}:null)},[d,R,x,Q]),(0,w.useLayoutEffect)(()=>()=>V.current?.(null),[]);let ra=(0,w.useCallback)(()=>{ee(!0),requestAnimationFrame(()=>R?.querySelector("input")?.focus())},[R]),ie=(0,w.useRef)(null),I=(0,w.useRef)(!1),oe=(0,w.useCallback)(()=>{ee(!1),I.current&&(I.current=!1,requestAnimationFrame(()=>ie.current?.focus()))},[]),ta=t===!1?"span":`h${t}`,na=r.href!==void 0?"a":"button",ia=v=>k=>{!v||!qe(k)||(k.preventDefault(),v())},oa=!W,le=h&&!x&&ae!==null?ae.split(",").map(Number).filter(v=>v<h.places.length):null,F=h?(0,i.jsx)(Pa,{places:h.places,current:h.current,reach:h.reach,scene:oa,stands:le}):null,la=h?h.places.map(v=>v.label).join(`
|
|
62
|
-
`):"";(0,w.useLayoutEffect)(T,[T,a,e,la,h?.current,W,x,s,d]);let sa=s==="icons"||!Qe||x?"icons":"words";return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("header",{ref:b,className:"graview-bar","data-testid":"app-bar","data-graview-app-bar":"",...Je&&x?{"data-finding":""}:{},children:[(0,i.jsx)("style",{children:fa}),(0,i.jsxs)("div",{className:"graview-bar-row",children:[(0,i.jsx)("div",{className:"graview-bar-app",children:(0,i.jsx)(ta,{className:"graview-bar-name",children:(0,i.jsxs)(na,{...r.href!==void 0?{href:r.href,onClick:ia(r.go)}:{type:"button",onClick:r.go},"data-testid":"app-home",...r.current?{"aria-current":"page"}:{},title:u?`${a} \u2014 ${u}`:`${a} \u2014 home`,className:"graview-bar-home",children:[(0,i.jsx)(ze,{brand:e,size:20}),(0,i.jsx)("span",{className:"graview-bar-app-name","data-testid":"app-name",children:a})]})})}),l?(0,i.jsx)(ma,{faces:l,form:s,drawn:sa}):null,(0,i.jsx)("div",{className:"graview-bar-mid",...le?{"data-places":"standing"}:!x&&F?{"data-place":""}:{},children:x?null:F}),!x&&h&&h.places.length>1?(0,i.jsxs)("span",{className:"graview-bar-ruler","aria-hidden":"true","data-graview-bar-ruler":"",children:[h.places.map(v=>(0,i.jsx)("span",{className:"graview-bar-at",children:v.label},v.key)),(0,i.jsxs)("span",{className:"graview-bar-at",children:[X,(0,i.jsx)(Ke,{})]})]}):null,(0,i.jsxs)("div",{className:"graview-bar-tools",children:[d?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("button",{type:"button",className:"graview-bar-find-open",ref:ie,"data-testid":"app-find-open","aria-label":"Find",title:"Find",onClick:ra,style:{...O,display:void 0},children:(0,i.jsx)(xa,{})}),(0,i.jsxs)("div",{className:"graview-bar-find","data-testid":"app-find",onBlur:v=>{let k=v.relatedTarget;k instanceof Node&&v.currentTarget.contains(k)||v.currentTarget.querySelector("input")?.value||oe()},onKeyDownCapture:v=>{v.key==="Escape"&&x&&(I.current=!0)},onKeyDown:v=>{v.key!=="Escape"||!x||(!v.defaultPrevented||!v.currentTarget.querySelector("input")?.value?oe():I.current=!1)},children:[(0,i.jsx)("div",{ref:Ue,className:"graview-bar-find-slot",children:g}),(0,i.jsx)("span",{className:"graview-bar-find-keys","data-testid":"app-find-keys","aria-hidden":"true",children:ba()})]})]}):null,(0,i.jsx)("div",{ref:Ze,className:"graview-bar-own","data-graview-bar-own":""}),P?(0,i.jsx)(w.Suspense,{fallback:null,children:(0,i.jsx)(da,{scene:!W,compact:x})}):null,p]})]})]}),x&&F?(0,i.jsx)("div",{className:"graview-bar-line","data-graview-place-line":"","data-testid":"app-place-line",children:F}):null]})}function ma({faces:e,form:a,drawn:t}){let r=l=>{let n=e[l];return(0,i.jsxs)("button",{type:"button",className:"graview-bar-face","data-testid":`app-face-${l}`,"aria-pressed":n.current,title:n.label,onClick:()=>{n.current||n.go()},children:[l==="scene"?(0,i.jsx)(Ge,{}):(0,i.jsx)(ya,{}),(0,i.jsx)("span",{children:n.label})]})};return(0,i.jsxs)("div",{className:"graview-bar-faces",role:"group","aria-label":`${e.scene.label} or ${e.pages.label}`,"data-testid":"app-faces","data-switch":a,"data-switch-drawn":t,children:[r("scene"),r("pages")]})}function ha(e){let a=e.querySelector(".graview-bar-faces"),t=e.querySelector(".graview-bar-mid"),r=e.querySelector(".graview-bar-find");if(!a||!t||r?.matches(":focus-within")||e.getBoundingClientRect().width<_)return null;let n=je(a),o=t.querySelector(".graview-bar-place-words"),c=o?parseFloat(getComputedStyle(o).fontSize)||14:0,p=o?Math.min(o.scrollWidth+34,14*c):0,d=t.getBoundingClientRect().width-p;if(r&&r.getBoundingClientRect().width>0){let u=parseFloat(getComputedStyle(r).flexBasis);isFinite(u)&&(d-=Math.max(0,u-r.getBoundingClientRect().width))}return Fe(e)?!1:a.getAttribute("data-switch-drawn")==="icons"?d>=n+2:d>=-1}function Fe(e){let a=e.querySelector(".graview-bar-app-name");return!!(a&&a.getBoundingClientRect().height>parseFloat(getComputedStyle(a).lineHeight)*1.5)}var qe=e=>e.button===0&&!(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey);function ba(){let e=globalThis.navigator?.platform??"";return/Mac|iPhone|iPad|iPod/.test(e)?"\u2318K":"Ctrl K"}function z({size:e,box:a=e,children:t}){return(0,i.jsx)("svg",{width:e,height:e,viewBox:`0 0 ${a} ${a}`,"aria-hidden":"true",focusable:"false",style:{flex:"0 0 auto"},children:t})}function Ge(){return(0,i.jsxs)(z,{size:14,children:[(0,i.jsx)("path",{d:"M7 1.5 L12.5 4.5 L7 7.5 L1.5 4.5 Z",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"}),(0,i.jsx)("path",{d:"M1.5 7.5 L7 10.5 L12.5 7.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round",strokeLinecap:"round"})]})}function ya(){return(0,i.jsxs)(z,{size:14,children:[(0,i.jsx)("rect",{x:"2.25",y:"1.75",width:"9.5",height:"10.5",rx:"1.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3"}),(0,i.jsx)("path",{d:"M4.5 5 H9.5 M4.5 7.25 H9.5 M4.5 9.5 H7.5",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function Ke(){return(0,i.jsx)(z,{size:10,children:(0,i.jsx)("path",{d:"M2 3.5 L5 6.5 L8 3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function xa(){return(0,i.jsxs)(z,{size:16,children:[(0,i.jsx)("circle",{cx:"7",cy:"7",r:"4.75",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),(0,i.jsx)("path",{d:"M10.5 10.5 L14 14",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function ka({place:e}){if(e.key===ga)return(0,i.jsx)(Ge,{});if(e.group==="home")return(0,i.jsx)(z,{size:13,box:14,children:(0,i.jsx)("path",{d:"M2 6.5 L7 2 L12 6.5 V12 H2 Z",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"})});let a=e.kind?`hsl(${Math.round(ge(e.kind))} 55% 52%`:"rgb(128 128 128";return(0,i.jsx)("span",{"aria-hidden":"true",style:{display:"inline-block",width:12,height:8,clipPath:"polygon(50% 0, 100% 50%, 50% 100%, 0 50%)",background:e.group==="lists"?`${a})`:`linear-gradient(${a}), ${a})) center / 6px 4px no-repeat, ${a} / 0.35)`}})}var $a=[{group:"home"},{group:"lists",heading:"Lists"},{group:"pictures",heading:"Pictures"}],X="More";function _e({place:e,current:a,reach:t,standing:r,done:l}){let n=e.key===a,o=t.href?.(e.path);return(0,i.jsxs)(o!==void 0?"a":"button",{className:r?"graview-bar-at":"graview-bar-item","data-testid":`app-place-${e.key}`,"data-place-path":e.path,...n?{"aria-current":"page"}:{},...o!==void 0?{href:o}:{type:"button"},onClick:p=>{l(),t.go&&(o!==void 0&&!qe(p)||(p.preventDefault(),t.go(e)))},children:[r?null:(0,i.jsx)("span",{className:"graview-bar-mark",children:(0,i.jsx)(ka,{place:e})}),r&&n?(0,i.jsx)("span",{"data-testid":"app-place-current",children:e.label}):(0,i.jsx)("span",{children:e.label})]})}function Sa({places:e,current:a,reach:t,id:r,done:l}){return(0,i.jsx)(i.Fragment,{children:$a.map(({group:n,heading:o})=>{let c=e.filter(d=>d.group===n);if(c.length===0)return null;let p=`${r}-${n}`;return(0,i.jsxs)("div",{role:"group",...o?{"aria-labelledby":p}:{"aria-label":c[0].label},"data-place-group":n,children:[o?(0,i.jsx)("p",{id:p,children:o}):null,(0,i.jsx)("ul",{children:c.map(d=>(0,i.jsx)("li",{children:(0,i.jsx)(_e,{place:d,current:a,reach:t,standing:!1,done:l})},d.key))})]},n)})})}function Pa({places:e,current:a,reach:t,scene:r,stands:l}){let n=H("places"),o=(0,w.useRef)(l);n.open||(o.current=l);let c=o.current,p=e.find(u=>u.key===a)?.label??"Places",d=c?e.filter((u,g)=>!c.includes(g)):e;return(0,i.jsxs)("nav",{className:c?"graview-bar-places":"graview-bar-place-at","aria-label":r?"What the scene shows":"The app\u2019s places",...c?{"data-testid":"app-places-standing"}:{},children:[c?.map(u=>(0,i.jsx)(_e,{place:e[u],current:a,reach:t,standing:!0,done:()=>{}},e[u].key)),d.length>0?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("button",{type:"button",className:c?"graview-bar-at":"graview-bar-place","data-testid":"app-places-open",...n.trigger,onClick:n.toggle,"aria-label":c?`${X} \u2014 ${d.length} more ${r?"pictures":"places"}`:`${p} \u2014 ${r?"everything the scene shows":"every place"}`,title:c?d.map(u=>u.label).join(", "):p,children:[c?X:(0,i.jsx)("span",{className:"graview-bar-place-words","data-testid":"app-place-current",children:p}),(0,i.jsx)(Ke,{})]}),(0,i.jsx)("div",{...n.pane,"data-testid":"app-places",hidden:!n.open,className:"graview-bar-list",style:L,children:(0,i.jsx)(Sa,{places:d,current:a,reach:t,id:n.pane.id,done:()=>n.setOpen(!1)})})]}):null]})}function Ba(e,a,t,r){let l=e.querySelector(".graview-bar-ruler"),n=e.querySelector(".graview-bar-mid");if(!l||!n)return null;let o=e.querySelector(".graview-bar-find");if(o?.matches(":focus-within"))return;if(e.getBoundingClientRect().width<_||Fe(e))return null;let c=[...l.children].map(P=>P.getBoundingClientRect().width),p=c.pop()??0,d=e.querySelector(".graview-bar-faces"),u=d&&t?je(d):0,g=d?.getAttribute("data-switch-drawn")==="words"?u:0,f=n.getBoundingClientRect().left,s=o?.getBoundingClientRect(),m=s&&s.width>0?s.right-f-(parseFloat(getComputedStyle(o).minWidth)||0)-8:n.getBoundingClientRect().width,b=[...r].map(P=>P!=="0");return wa({widths:c,current:a,room:Math.floor(m+g-u),more:p,primary:b})?.join(",")??null}function je(e){return[...e.querySelectorAll(".graview-bar-face span")].reduce((a,t)=>a+t.scrollWidth+10,0)}var Ta={name:"Graview",typography:{body:Z.body,mono:Z.mono},schemes:ve},De={ground:"--graview-ground",groundDeep:"--graview-ground-deep",wash:"--graview-wash",panel:"--graview-panel",panelMuted:"--graview-panel-muted",panelWarning:"--graview-panel-warning",edge:"--graview-edge",edgeBright:"--graview-edge-bright",ink:"--graview-ink",inkMuted:"--graview-ink-muted",inkFaint:"--graview-ink-faint",accent:"--graview-accent",accentDim:"--graview-accent-dim",accentInk:"--graview-accent-ink",warn:"--graview-warn",good:"--graview-good",bad:"--graview-bad",glow:"--graview-glow",bar:"--graview-bar",float:"--graview-float",liftLow:"--graview-lift-low",liftHigh:"--graview-lift-high",tintAlpha:"--graview-tint-alpha",tintLightness:"--graview-tint-lightness",gridAlpha:"--graview-grid-alpha"};function Ea(e){return Object.keys(De).map(a=>` ${De[a]}: ${e[a]};`).join(`
|
|
63
|
-
`)}function Ve(e,a){let t=e===a?e:`${e} ${a}`;return` ${t} [data-graview-view] { transition: none; }
|
|
64
|
-
${t} [data-graview-touched] > * { animation: none; }
|
|
65
|
-
${t} [data-graview-view][data-graview-wrote] > *,
|
|
66
|
-
${t} [data-graview-view][data-graview-read] > * {
|
|
67
|
-
animation: none;
|
|
68
|
-
box-shadow: 0 0 0 2px var(--graview-activity);
|
|
69
|
-
}
|
|
70
|
-
${t} [data-graview-view][data-graview-read] > * { box-shadow: 0 0 0 1px var(--graview-activity); }
|
|
71
|
-
${t} [data-graview-connector][data-graview-activity] { animation: none; stroke-opacity: 1; }`}function or(e="dark",a=Ta,t={}){let r=Ha(e,a,t);return t.scope===void 0?r:Ma(r,t.scope)}function Ma(e,a){let t=`:where(${a}) `,r=o=>o===a||o.startsWith(`${a} `)||o.startsWith(`${a}:`)||o.startsWith(`${a}[`)||o.startsWith(":root")&&o.includes(` ${a} `),l=o=>{let c=o.match(/^\s*/)[0],p=La(o.trim()).map(d=>r(d)?d:`${t}${d}`);return`${c}${p.join(", ")} `},n=o=>{let c="",p=0;for(;p<o.length;){let d=o.indexOf("{",p);if(d===-1)return c+o.slice(p);let u=Ca(o,d),g=o.slice(p,d),f=o.slice(d+1,u),s=g.trim().startsWith("@")?g.trim().split(/[\s(]/)[0]:null;s===null?c+=`${l(g)}{${f}}`:s==="@media"||s==="@supports"||s==="@container"||s==="@layer"?c+=`${g}{${n(f)}}`:c+=`${g}{${f}}`,p=u+1}return c};return n(e)}function Ca(e,a){let t=0,r=null;for(let l=a;l<e.length;l++){let n=e[l];if(r)n==="\\"?l++:n===r&&(r=null);else if(n==='"'||n==="'")r=n;else if(n==="/"&&e[l+1]==="*")l=e.indexOf("*/",l+2)+1||e.length;else if(n==="{")t++;else if(n==="}"&&--t===0)return l}return e.length}function La(e){let a=[],t=0,r=null,l="";for(let n of e){if(r)n===r&&(r=null);else if(n==='"'||n==="'")r=n;else if(n==="("||n==="[")t++;else if(n===")"||n==="]")t--;else if(n===","&&t===0){a.push(l.trim()),l="";continue}l+=n}return l.trim()&&a.push(l.trim()),a}function Ha(e,a,t){let r=a.schemes[e],l=t.scope??":root",n=t.scope??"html, body",o=t.scope??"body",c=":root",p=we(a),d=fe(a),u=ye(a.kit);return`${l} {
|
|
72
|
-
${Ea(r)}
|
|
73
|
-
${xe(u)}
|
|
74
|
-
|
|
75
|
-
${$e()}
|
|
76
|
-
--graview-font-body: ${d.body};
|
|
77
|
-
--graview-font-display: ${d.display};
|
|
78
|
-
--graview-font-mono: ${d.mono};
|
|
79
|
-
|
|
80
|
-
--graview-weight-display: ${d.weights.display};
|
|
81
|
-
--graview-weight-body: ${d.weights.body};
|
|
82
|
-
--graview-weight-label: ${d.weights.label};
|
|
83
|
-
|
|
84
|
-
--graview-radius: ${p.radius}px;
|
|
85
|
-
--graview-radius-sm: ${p.radiusSmall}px;
|
|
86
|
-
--graview-pad: ${p.pad}px;
|
|
87
|
-
--graview-pad-sm: ${p.padSmall}px;
|
|
88
|
-
--graview-gap: ${p.gap}px;
|
|
89
|
-
color-scheme: ${e};
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
${n} {
|
|
93
|
-
margin: 0;
|
|
94
|
-
background: var(--graview-ground-deep);
|
|
95
|
-
color: var(--graview-ink);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
${o} {
|
|
100
|
-
font: 0.875rem/1.55 var(--graview-font-body);
|
|
101
|
-
font-weight: var(--graview-weight-body);
|
|
102
|
-
font-variant-numeric: tabular-nums;
|
|
103
|
-
-webkit-font-smoothing: antialiased;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
h1, h2, h3, h4 { font-family: var(--graview-font-display); font-weight: var(--graview-weight-display); }
|
|
108
|
-
h1, h2 { letter-spacing: ${ue}; }
|
|
109
|
-
|
|
110
|
-
.graview-logo > svg { display: block; height: 100%; width: auto; }
|
|
111
|
-
code, kbd, samp { font-family: var(--graview-font-mono); }
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
[data-graview-figure] > svg {
|
|
115
|
-
width: 100%;
|
|
116
|
-
height: 100%;
|
|
117
|
-
display: block;
|
|
118
|
-
overflow: visible;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
@property --graview-altitude {
|
|
123
|
-
syntax: "<number>";
|
|
124
|
-
inherits: true;
|
|
125
|
-
initial-value: 0;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
.graview-ground {
|
|
130
|
-
position: relative;
|
|
131
|
-
|
|
132
|
-
isolation: isolate;
|
|
133
|
-
z-index: ${ke("scene")};
|
|
134
|
-
background: var(--graview-wash), var(--graview-ground);
|
|
135
|
-
--graview-altitude: 0;
|
|
136
|
-
transition: --graview-altitude 640ms cubic-bezier(0.33, 0, 0.2, 1);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
.graview-ground::before {
|
|
142
|
-
content: "";
|
|
143
|
-
position: absolute;
|
|
144
|
-
inset: 0;
|
|
145
|
-
pointer-events: none;
|
|
146
|
-
background-image:
|
|
147
|
-
linear-gradient(var(--graview-edge) 1px, transparent 1px),
|
|
148
|
-
linear-gradient(90deg, var(--graview-edge) 1px, transparent 1px);
|
|
149
|
-
background-size: var(--graview-kit-grid-size, 64px) var(--graview-kit-grid-size, 64px);
|
|
150
|
-
opacity: calc(var(--graview-kit-grid, 1) * var(--graview-grid-alpha) * (1 - var(--graview-altitude)));
|
|
151
|
-
mask-image: radial-gradient(120% 90% at 50% 40%, #000 30%, transparent 78%);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
.graview-scroll {
|
|
156
|
-
overflow: auto;
|
|
157
|
-
min-height: 0;
|
|
158
|
-
background:
|
|
159
|
-
linear-gradient(var(--graview-panel-bg, var(--graview-panel)) 30%, transparent) center top,
|
|
160
|
-
linear-gradient(transparent, var(--graview-panel-bg, var(--graview-panel)) 70%) center bottom,
|
|
161
|
-
radial-gradient(farthest-side at 50% 0, ${e==="light"?"rgba(20,30,32,0.30)":"rgba(0,0,0,0.7)"}, transparent) center top,
|
|
162
|
-
radial-gradient(farthest-side at 50% 100%, ${e==="light"?"rgba(20,30,32,0.30)":"rgba(0,0,0,0.7)"}, transparent) center bottom;
|
|
163
|
-
background-repeat: no-repeat;
|
|
164
|
-
background-size: 100% 24px, 100% 24px, 100% 10px, 100% 10px;
|
|
165
|
-
background-attachment: local, local, scroll, scroll;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
.graview-scroll[data-graview-overflowing]::after {
|
|
169
|
-
content: "";
|
|
170
|
-
position: sticky;
|
|
171
|
-
bottom: 0;
|
|
172
|
-
flex: 0 0 14px;
|
|
173
|
-
margin-top: calc(-14px - var(--graview-gap, 7px));
|
|
174
|
-
background: linear-gradient(transparent, var(--graview-panel-bg, var(--graview-panel)));
|
|
175
|
-
pointer-events: none;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
.graview-ground::after {
|
|
182
|
-
content: "";
|
|
183
|
-
position: absolute;
|
|
184
|
-
inset: 0;
|
|
185
|
-
pointer-events: none;
|
|
186
|
-
--graview-lattice-tile: var(--graview-lattice-cell, calc(var(--graview-kit-lattice-size, 46px) * 2.2361));
|
|
187
|
-
--graview-lattice-line: var(--graview-edge);
|
|
188
|
-
background-image:
|
|
189
|
-
linear-gradient(to top right, transparent calc(50% - 0.5px), var(--graview-lattice-line) calc(50% - 0.5px), var(--graview-lattice-line) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
|
|
190
|
-
linear-gradient(to top left, transparent calc(50% - 0.5px), var(--graview-lattice-line) calc(50% - 0.5px), var(--graview-lattice-line) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
|
|
191
|
-
linear-gradient(to top right, transparent calc(50% - 0.5px), var(--graview-lattice-line) calc(50% - 0.5px), var(--graview-lattice-line) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
|
|
192
|
-
linear-gradient(to top left, transparent calc(50% - 0.5px), var(--graview-lattice-line) calc(50% - 0.5px), var(--graview-lattice-line) calc(50% + 0.5px), transparent calc(50% + 0.5px));
|
|
193
|
-
background-size:
|
|
194
|
-
var(--graview-lattice-tile) calc(var(--graview-lattice-tile) / 2),
|
|
195
|
-
var(--graview-lattice-tile) calc(var(--graview-lattice-tile) / 2),
|
|
196
|
-
calc(var(--graview-lattice-tile) / 2) calc(var(--graview-lattice-tile) / 4),
|
|
197
|
-
calc(var(--graview-lattice-tile) / 2) calc(var(--graview-lattice-tile) / 4);
|
|
198
|
-
|
|
199
|
-
background-position: var(--graview-lattice-x, 0px) var(--graview-lattice-y, 0px);
|
|
200
|
-
|
|
201
|
-
opacity: calc(var(--graview-kit-lattice, 1) * var(--graview-grid-alpha) * 2 * var(--graview-altitude));
|
|
202
|
-
mask-image: linear-gradient(to top, #000 42%, rgba(0,0,0,0.35) 70%, transparent 92%);
|
|
203
|
-
-webkit-mask-image: linear-gradient(to top, #000 42%, rgba(0,0,0,0.35) 70%, transparent 92%);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
.graview-profile-keeping { display: grid; gap: 6px; }
|
|
208
|
-
.graview-profile-keeping:not(:has(button, a)) { display: none; }
|
|
209
|
-
.graview-profile-keeping > * { justify-self: start; }
|
|
210
|
-
|
|
211
|
-
.graview-host-action:hover,
|
|
212
|
-
.graview-host-action:focus-visible {
|
|
213
|
-
background: var(--graview-wash);
|
|
214
|
-
color: var(--graview-accent);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
@keyframes graview-settle {
|
|
220
|
-
from { opacity: 0; transform: translateY(7px); }
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
[data-graview-pick] {
|
|
225
|
-
cursor: pointer;
|
|
226
|
-
transition: filter 140ms ease, box-shadow 140ms ease;
|
|
227
|
-
}
|
|
228
|
-
[data-graview-pick]:hover {
|
|
229
|
-
filter: brightness(${e==="light"?.96:1.18});
|
|
230
|
-
}
|
|
231
|
-
[data-graview-pick]:focus-visible {
|
|
232
|
-
outline: 2px solid var(--graview-accent);
|
|
233
|
-
outline-offset: 2px;
|
|
234
|
-
border-radius: 7px;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
[data-graview-slot]:focus-visible {
|
|
238
|
-
outline: none;
|
|
239
|
-
}
|
|
240
|
-
[data-graview-slot]:focus-visible > span:first-of-type {
|
|
241
|
-
box-shadow: 0 0 0 2px var(--graview-ground), 0 0 0 4px var(--graview-accent);
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
[data-graview-view] { cursor: pointer; }
|
|
246
|
-
[data-graview-view]:hover { filter: brightness(${e==="light"?.985:1.12}); }
|
|
247
|
-
[data-graview-view]:focus-visible {
|
|
248
|
-
outline: 2px solid var(--graview-accent);
|
|
249
|
-
outline-offset: 3px;
|
|
250
|
-
border-radius: var(--graview-radius);
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
button {
|
|
254
|
-
font: inherit;
|
|
255
|
-
font-weight: var(--graview-weight-label);
|
|
256
|
-
color: var(--graview-ink);
|
|
257
|
-
padding: 7px 13px;
|
|
258
|
-
border: 1px solid var(--graview-edge);
|
|
259
|
-
border-radius: var(--graview-radius-sm, 8px);
|
|
260
|
-
background: var(--graview-panel);
|
|
261
|
-
box-shadow: ${e==="light"?"0 1px 2px rgba(24,33,58,0.05)":"none"};
|
|
262
|
-
cursor: pointer;
|
|
263
|
-
transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
button:hover:not(:disabled) {
|
|
267
|
-
border-color: var(--graview-edge-bright);
|
|
268
|
-
box-shadow: ${e==="light"?"0 1px 2px rgba(24,33,58,0.06), 0 6px 16px -8px rgba(24,33,58,0.2)":"0 0 0 1px var(--graview-accent-dim)"};
|
|
269
|
-
}
|
|
270
|
-
button:focus-visible {
|
|
271
|
-
outline: 2px solid var(--graview-accent);
|
|
272
|
-
outline-offset: 2px;
|
|
273
|
-
}
|
|
274
|
-
button:disabled { opacity: 0.45; cursor: default; }
|
|
275
|
-
|
|
276
|
-
code { color: var(--graview-ink-muted); font-size: 0.8125rem; letter-spacing: 0.02em; }
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
[data-graview-view] {
|
|
280
|
-
transition: filter 260ms cubic-bezier(0.22, 1, 0.36, 1);
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
[data-graview-stage="dom"] [data-graview-view],
|
|
285
|
-
[data-graview-stage="dom"] [data-graview-view] > [data-graview-natural] {
|
|
286
|
-
pointer-events: none;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
@keyframes graview-touched {
|
|
292
|
-
0% { box-shadow: 0 0 0 0 var(--graview-accent-dim); }
|
|
293
|
-
35% { box-shadow: 0 0 26px 3px var(--graview-accent-dim); }
|
|
294
|
-
100% { box-shadow: 0 0 0 0 transparent; }
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
@keyframes graview-landed {
|
|
298
|
-
0% { box-shadow: 0 0 0 0 var(--graview-activity); opacity: 0.55; }
|
|
299
|
-
30% { box-shadow: 0 0 30px 4px var(--graview-activity); opacity: 1; }
|
|
300
|
-
100% { box-shadow: 0 0 0 0 transparent; opacity: 1; }
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
@keyframes graview-considered {
|
|
305
|
-
0% { outline-color: transparent; }
|
|
306
|
-
25% { outline-color: var(--graview-activity); }
|
|
307
|
-
100% { outline-color: transparent; }
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
@keyframes graview-relation {
|
|
312
|
-
0% { stroke-opacity: 0.28; stroke-width: 1.4; }
|
|
313
|
-
30% { stroke-opacity: 1; stroke-width: 3; }
|
|
314
|
-
100% { stroke-opacity: 0.28; stroke-width: 1.4; }
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
@media (prefers-reduced-motion: reduce) {
|
|
319
|
-
${Ve(`${c}:not([data-graview-motion='full'])`,o)}
|
|
320
|
-
}
|
|
321
|
-
${Ve(`${c}[data-graview-motion='reduce']`,o)}`}var M=$(G(),1);var y=$(E(),1);function gr({scheme:e,onScheme:a,profileHref:t,keeping:r,hostActions:l=Aa,signature:n=!1}){let{store:o,principal:c,seats:p,people:d}=Ce(),u=H("profile"),g=u.open,[f,s]=(0,M.useState)(!1);(0,M.useEffect)(()=>Oa(j),[]),g&&!f&&s(!0),(0,M.useEffect)(()=>{g&&j()},[g]);let m=c.id===void 0?void 0:o.graph.getNode(c.id),b=m===void 0?c.id===void 0?"Nobody in particular":ce(c,{graph:o.graph,schema:o.schema,seats:p,people:d}):se(o.schema.tryDefinition(m.kind),m);return(0,y.jsxs)("div",{style:{position:"relative"},children:[(0,y.jsx)("button",{type:"button","data-testid":"profile-button",...u.trigger,onClick:u.toggle,onPointerEnter:j,onFocus:j,"aria-label":`${b} \u2014 you, your seat and your settings`,title:`${b} \u2014 you, your seat and your settings`,style:{...O,borderRadius:999},children:(0,y.jsx)("span",{"aria-hidden":"true","data-testid":"profile-mark",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:N-4,height:N-4,borderRadius:999,fontSize:"0.8125rem",fontWeight:600,background:"var(--graview-panel-muted)",color:"var(--graview-ink)",border:"1px solid var(--graview-edge)"},children:za(b)})}),(0,y.jsxs)("section",{...u.pane,"aria-label":"Profile","data-testid":"profile","data-graview-offstage":"",hidden:!g,style:{...L,width:280,maxWidth:"calc(100vw - 32px)",maxHeight:"min(62cqh, 520px)",overflowY:"auto",overflowX:"hidden",display:g?"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,y.jsx)(M.Suspense,{fallback:null,children:(0,y.jsx)(Ra,{part:"top",name:b,me:m,profileHref:t,hostActions:l,close:()=>u.setOpen(!1)})}):null,(0,y.jsxs)("div",{className:"graview-profile-keeping","data-testid":"profile-keeping",style:Ia,children:[(0,y.jsx)("span",{style:Wa,children:"Keeping this app"}),r]}),f?(0,y.jsx)(M.Suspense,{fallback:null,children:(0,y.jsx)(Na,{part:"rest",name:b,me:m,scheme:e,onScheme:a,hostActions:l,signature:n,close:()=>u.setOpen(!1)})}):null]})]})}var Aa=[],j=()=>B.prefetch(),Ra=B.part((e,a)=>(0,y.jsx)(e.ProfilePane,{...a}),{what:"The rest of your menu"}),Na=B.part((e,a)=>(0,y.jsx)(e.ProfilePane,{...a}),{quiet:!0});function Oa(e){let a=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&e()},t=globalThis;if(t.requestIdleCallback){let l=t.requestIdleCallback(a,{timeout:5e3});return()=>t.cancelIdleCallback?.(l)}let r=setTimeout(a,2500);return()=>clearTimeout(r)}function za(e){return(e.trim()[0]??"?").toUpperCase()}var Wa={fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},Ia={paddingTop:10,borderTop:"1px solid var(--graview-edge)"};var A=$(G(),1);var S=$(E(),1),Fa=B.part((e,a)=>(0,S.jsx)(e.ProblemRows,{...a}),{what:"The problems",as:"li"}),J=()=>B.prefetch();function hr({clean:e="All rules hold"}){let a=Ae(),{set:t}=He(),r=a.length,[l,n]=(0,A.useState)(!1),o=H("problems",{open:l&&r>0,onOpenChange:n}),c=o.open,p=qa(a,e);return(0,A.useEffect)(()=>{if(r===0)return;let d=setTimeout(J,1500);return()=>clearTimeout(d)},[r>0]),(0,S.jsxs)("div",{style:{position:"relative",display:"inline-flex"},children:[(0,S.jsxs)("button",{type:"button","data-testid":"standing",...o.trigger,"aria-disabled":r===0?!0:void 0,"aria-label":p,onClick:r===0?void 0:o.toggle,onPointerEnter:r===0?void 0:J,onFocus:r===0?void 0:J,title:p,style:{...O,padding:r===0?0:"0 8px",cursor:r===0?"default":"pointer",color:r===0?"var(--graview-ink-muted)":Ye(a),fontVariantNumeric:"tabular-nums",fontWeight:600},children:[(0,S.jsx)(Ga,{tone:r===0?"var(--graview-good)":Ye(a)}),r>0?(0,S.jsx)("span",{"aria-hidden":"true",children:r}):null]}),c?(0,S.jsx)("ol",{...o.pane,"data-testid":"problems",style:{...L,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,S.jsx)(A.Suspense,{fallback:null,children:(0,S.jsx)(Fa,{violations:a,pick:d=>{t(d.nodeIds),o.setOpen(!1)}})})}):null]})}function qa(e,a){return e.length===0?a:`${pe(e)} \u2014 open what is broken, and what would fix it`}var Ye=e=>e.some(a=>a.status==="could-not-judge"||a.status==="over-budget")?"var(--graview-bad)":"var(--graview-warn)";function Ga({tone:e}){return(0,S.jsx)("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:999,flex:"0 0 auto",background:e}})}export{or as a,Ma as b,ja as c,B as d,ga as e,er as f,ar as g,ua as h,rr as i,O as j,tr as k,gr as l,hr as m,qa as n,Ga as o};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as V}from"./chunk.N7HCALRK.js";import{b as K}from"./chunk.ISRS7GOT.js";import{a as ie}from"./chunk.DCIC3YHX.js";import{l as se,m as G}from"./chunk.WHTNSETN.js";import{f as _,g as N,h as B}from"./chunk.6R4EI47C.js";import{a as O,d as ae}from"./chunk.6LJ66MB7.js";import{V as ee,da as M,ea as te,fa as ne,qa as oe,sa as re,za as F}from"./chunk.NRRUGG22.js";import{Cb as Z,Hb as z,X as J,Y as Q}from"./chunk.MKNXV4TM.js";import{a as $,b as T}from"./chunk.MRK6QJV5.js";import{b as k}from"./chunk.AJZBJBMO.js";var i=k($(),1);var x=k(T(),1),le=336,w=16,ue=640,I=F(O(()=>import("./chunk.3HLLQ5CJ.js"))),fe=I.part((t,n)=>{let s=t.SeatPanel;return(0,x.jsx)(s,{...n})},{what:"The conversation"});function xe({respond:t,onCall:n,onPick:s,start:y="field",onMove:l,place:S,onDraft:v}){let{brand:r,seatTalk:d}=M(),f=ee(d),g=r?.name?.trim()||"this app",h=(0,i.useRef)(null),o=(0,i.useRef)(null),[a,c]=(0,i.useState)(""),[m,P]=(0,i.useState)(!1),C=(0,i.useRef)(null),b=y==="hidden",p=f.open&&!b;(0,i.useEffect)(()=>b?void 0:d.drawn(),[d,b]),(0,i.useLayoutEffect)(()=>{let e=h.current?.parentElement;if(!e)return;let E=()=>P(e.getBoundingClientRect().width<ue);if(E(),typeof ResizeObserver>"u")return;let D=new ResizeObserver(E);return D.observe(e),()=>D.disconnect()},[b]),(0,i.useEffect)(()=>{typeof window<"u"&&window.dispatchEvent(new Event(ie))},[p,f.side,m]),(0,i.useEffect)(()=>{let e=h.current;if(b||p||!e||typeof window>"u")return;let E=(e.closest("[data-graview-embed]")??document.documentElement).style,D=()=>{let Y=e.getBoundingClientRect(),X=e.offsetParent?.getBoundingClientRect(),ce=X?X.bottom-Y.top:Y.height+w;E.setProperty("--graview-foot-room",`${Math.max(0,Math.round(ce+w))}px`)};D();let U=typeof ResizeObserver>"u"?null:new ResizeObserver(D);return U?.observe(e),()=>{U?.disconnect(),E.removeProperty("--graview-foot-room")}},[b,p,m,f.side]),(0,i.useEffect)(()=>{!p||f.pending===null||(j(),o.current?.focus({preventScroll:!0}))},[p,f.pending]);let j=()=>{let e=typeof document>"u"?null:document.activeElement;e instanceof HTMLElement&&e!==document.body&&!h.current?.contains(e)&&(C.current=e)},H=()=>{j(),I.prefetch(),d.setOpen(!0)},q=()=>{d.setOpen(!1);let e=C.current;C.current=null,e?.isConnected&&!(m&&e instanceof HTMLInputElement)&&e.focus({preventScroll:!0}),document.activeElement!==e&&(m?h:o).current?.focus({preventScroll:!0})};if(b)return null;let R=!m&&f.side==="right",pe=m?p?{left:0,right:0,bottom:0,padding:"8px 12px calc(12px + env(safe-area-inset-bottom, 0px))",borderRadius:"12px 12px 0 0",...de}:{left:w,right:w,bottom:`calc(${w}px + env(safe-area-inset-bottom, 0px))`}:p?{[R?"right":"left"]:w/2-1,bottom:w/2-1,width:le+w+2,padding:w/2,borderRadius:12,...de}:{[R?"right":"left"]:w,bottom:w,width:le};return(0,x.jsxs)("section",{ref:h,role:"region","aria-label":`Ask ${g}`,tabIndex:-1,"data-testid":"seat","data-graview-seat":p?"open":"closed","data-graview-seat-side":R?"right":"left","data-graview-seat-shape":m?"phone":"desk","data-graview-foot":"","data-graview-offstage":"",onMouseDown:e=>e.stopPropagation(),onKeyDown:e=>{e.key!=="Escape"||!p||(e.preventDefault(),e.stopPropagation(),q())},style:{position:"absolute",zIndex:z("rail"),boxSizing:"border-box",display:"flex",flexDirection:"column",gap:8,pointerEvents:"auto",outline:"none",...pe},children:[(0,x.jsxs)("h2",{style:{...ae,margin:0},children:["Ask ",g]}),p?(0,x.jsx)(i.Suspense,{fallback:null,children:(0,x.jsx)(fe,{phone:m,side:R?"right":"left",name:g,onClose:q,...t?{respond:t}:{},...n?{onCall:n}:{},...s?{onPick:s}:{},...l?{onMove:l}:{},...S?{place:S}:{},...v?{onDraft:v}:{}})}):null,(0,x.jsx)("form",{onSubmit:e=>{e.preventDefault();let E=a.trim();p||H(),!(!E||f.busy)&&(d.ask(E),c(""))},style:{display:"flex",margin:0},children:(0,x.jsx)("input",{ref:o,"data-testid":"seat-field",type:"text",enterKeyHint:"send",autoComplete:"off",value:a,placeholder:`Ask ${g}\u2026`,"aria-label":`Ask ${g}`,onPointerEnter:()=>I.prefetch(),onFocus:()=>I.prefetch(),onClick:()=>{p||H()},onChange:e=>{c(e.target.value),p||H()},style:{flex:"1 1 auto",minWidth:0,boxSizing:"border-box",height:38,padding:"0 12px",font:"inherit",fontSize:"max(1rem,16px)",color:"var(--graview-ink)",background:"var(--graview-panel)",border:"1px solid var(--graview-edge)",borderRadius:8}})})]})}var de={background:"var(--graview-float)",border:"1px solid var(--graview-edge)",boxShadow:"var(--graview-lift-high)"};var W=k($(),1),L=k(T(),1),me=F(O(()=>import("./chunk.JRCV6HVV.js"))),ge=me.part((t,n)=>{let s=t.DraftFrame;return(0,L.jsx)(s,{...n})},{what:"The view"});function Te(t){let{seatTalk:n}=M();return(0,W.useSyncExternalStore)(n.subscribe,()=>n.get().draft!==null,()=>!1)?(0,L.jsx)(W.Suspense,{fallback:null,children:(0,L.jsx)(ge,{...t})}):null}function Re(t={}){return t.scope===void 0?V:K(V,t.scope)}var A=k($(),1),u=k(T(),1);function We({inside:t=!1}={}){let{store:n,view:s,emphasis:y,setEmphasis:l}=M(),S=se(),{selection:v,set:r}=oe(),{show:d}=re(),f=ne(),g=(0,A.useMemo)(()=>{let o=new Map;for(let a of n.graph.allEdges()){let c=o.get(a.kind)??{count:0,ends:new Set};c.count+=1;for(let m of[a.from,a.to]){let P=n.graph.getNode(m);P&&c.ends.add(`kind:${P.kind}`)}o.set(a.kind,c)}return[...o.entries()].sort(([a],[c])=>a.localeCompare(c)).map(([a,c])=>({kind:a,count:c.count,ends:[...c.ends]}))},[n,f]);if((0,A.useEffect)(()=>()=>l(null),[l]),!s.overview&&!t||g.length===0)return null;let h=new Set;for(let o of v){if(o.startsWith("kind:")){h.add(o);continue}let a=n.graph.getNode(o);a&&h.add(`kind:${a.kind}`)}return(0,u.jsxs)("section",{"aria-label":"What the lines mean",role:t?"group":void 0,"data-testid":"relation-key",style:t?{display:"grid",gap:1}:{position:"absolute",left:16,top:14,zIndex:z("rail"),display:"grid",gap:1,padding:"8px 10px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)",maxWidth:he,animation:"graview-settle 380ms 280ms ease backwards"},children:[t?null:(0,u.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.16em",textTransform:"uppercase",color:"var(--graview-ink-faint)",paddingBottom:2},children:g.length===1?"1 relation":`${g.length} relations`}),g.map(({kind:o,count:a,ends:c})=>{let{connector:m,style:P}=G(S,o),C=ye(n.schema,o),b=y!==null?y===o:h.size===0||c.some(p=>h.has(p));return(0,u.jsxs)("button",{type:"button",title:n.schema.edge(o)?.description===void 0?`${a} of these`:C.words,onMouseEnter:()=>l(o),onMouseLeave:()=>l(null),onFocus:()=>l(o),onBlur:()=>l(null),onClick:()=>{r(c),d(null)},style:{all:"unset",outline:"revert-layer",cursor:"pointer",display:"grid",gridTemplateColumns:"30px 1fr auto",alignItems:"center",gap:8,minHeight:23,padding:"2px 4px",borderRadius:6,opacity:b?1:.4},children:[(0,u.jsx)("svg",{width:"30",height:"8","aria-hidden":"true",style:{display:"block",opacity:m.visible?1:.35},children:(0,u.jsx)("path",{d:"M 1 4 L 29 4",fill:"none",stroke:N(P),strokeWidth:B(P,!0),strokeDasharray:_[P.pattern],strokeLinecap:"round"})}),(0,u.jsxs)("span",{style:{display:"grid",minWidth:0},"data-graview-relation-words":o,children:[(0,u.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink)"},children:C.words}),(0,u.jsx)("span",{style:{fontSize:"0.6875rem",color:"var(--graview-ink-faint)"},children:C.ends})]}),m.visible?null:(0,u.jsx)("span",{"data-graview-quiet":o,style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",fontStyle:"italic"},children:"not drawn"}),(0,u.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",fontVariantNumeric:"tabular-nums"},children:a})]},o)})]})}var he="min(280px, calc(100% - 28px))";function ye(t,n,s){let y=t.edge(n)?.from??[],l=new Map;for(let r of s!==void 0&&y.includes(s)?[s]:y.length>0?y:[""]){let d=Q(t,r,n,"out");l.set(d,[...l.get(d)??[],r])}let S=r=>r==="*"?"anything":J(t,r),v=[...l].map(([r,d])=>{let f=d.flatMap(h=>t.tryDefinition(h)?.edges[n]?.to??[]),g=d[0]&&f.length>0?`${d.map(S).join(", ")} \u2192 ${(f.includes("*")?["*"]:[...new Set(f)]).map(S).join(", ")}`:"";return[r.charAt(0).toUpperCase()+r.slice(1),g]});return{words:v.map(([r])=>r).join(" \xB7 "),ends:v.flatMap(([,r])=>r?[r]:[]).join(" \xB7 ")}}function He({edgeKind:t,kit:n,width:s=30}){let y=te(),l=(0,A.useMemo)(()=>Z(n??y?.brand?.kit),[n,y?.brand?.kit]),{connector:S,style:v}=G(l,t);return(0,u.jsx)("svg",{width:s,height:"8","aria-hidden":"true","data-testid":"relation-mark","data-graview-relation":t,style:{display:"inline-block",verticalAlign:"middle",opacity:S.visible?1:.35},children:(0,u.jsx)("path",{d:`M 1 4 L ${s-1} 4`,fill:"none",stroke:N(v),strokeWidth:B(v,!0),strokeDasharray:_[v.pattern],strokeLinecap:"round"})})}export{xe as a,Te as b,We as c,he as d,He as e,Re as f};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as x,b as S,c as D,g as f}from"./chunk.4RO5DA22.js";import{b as h}from"./chunk.KWW3YHQ4.js";import"./chunk.22H4JXTH.js";import"./chunk.HOPIZMJR.js";import"./chunk.2VUG6EAN.js";import"./chunk.IH42QTOM.js";import"./chunk.TBG2QBOS.js";import"./chunk.PN2H6X7O.js";import"./chunk.BCBH6WJF.js";import"./chunk.A73BXXE4.js";import"./chunk.N7HCALRK.js";import"./chunk.OGL4PHTY.js";import"./chunk.DCIC3YHX.js";import{o as k}from"./chunk.WHTNSETN.js";import"./chunk.WVUJXDXZ.js";import"./chunk.46KUPBQC.js";import"./chunk.N2WTNKEV.js";import"./chunk.SBHVVJY7.js";import"./chunk.GE5EAN36.js";import"./chunk.337WDTG3.js";import"./chunk.W3LDQ6B2.js";import"./chunk.EYF6ONTA.js";import"./chunk.Q3HVA6L4.js";import"./chunk.AHDOKM4O.js";import"./chunk.6R4EI47C.js";import"./chunk.2GBQJXJH.js";import"./chunk.ZJDRD6PO.js";import"./chunk.SNBIZ3B6.js";import"./chunk.6LJ66MB7.js";import{V as v,da as w,fa as b}from"./chunk.NRRUGG22.js";import{Hb as u,O as g}from"./chunk.MKNXV4TM.js";import{a as V,b as y}from"./chunk.MRK6QJV5.js";import{b as p}from"./chunk.AJZBJBMO.js";var i=p(V(),1);var e=p(y(),1);function O({page:a=!1,go:C,onPick:m,onDiscard:G}){let{store:o,seatTalk:s}=w(),d=v(s),K=D(),c=C??K,{keep:N}=x(c),[T,l]=(0,i.useState)(!1);b();let t=d.draft;if((0,i.useEffect)(()=>l(!1),[t]),(0,i.useEffect)(()=>{a||S(!1)},[a]),!t)return null;let L=h(t.drawn),B=o.schema.tryDefinition(t.kind),I=o.graph.nodesOfKind(t.kind).filter(n=>g(B,n)),P=()=>{s.setDraft(null),G?.()};return(0,e.jsxs)("section",{"data-testid":"draft-frame","aria-label":`Draft: ${t.title}`,style:a?{display:"grid",gap:12,minWidth:0}:{position:"absolute",inset:0,zIndex:u("rail"),display:"grid",gridTemplateRows:"auto auto minmax(0, 1fr)",background:"var(--graview-ground, var(--graview-panel))",minHeight:0},children:[(0,e.jsxs)("p",{"data-testid":"draft-line",style:{...z,...a?{}:{padding:"10px 16px"}},children:[a?(0,e.jsx)("span",{children:"Draft"}):(0,e.jsxs)("span",{children:["Draft \u2014 ",(0,e.jsx)("span",{"data-testid":"draft-title",style:{color:"var(--graview-ink)",fontWeight:600},children:t.title})]}),(0,e.jsx)("span",{"aria-hidden":"true",children:"\xB7"}),(0,e.jsx)("button",{type:"button","data-testid":"draft-keep",disabled:T,title:`Keep \u201C${t.title}\u201D as a lens: a place of its own`,onClick:()=>{l(!0),N(t).finally(()=>l(!1))},style:f,children:"Keep as a lens"}),(0,e.jsx)("span",{"aria-hidden":"true",children:"\xB7"}),(0,e.jsx)("button",{type:"button","data-testid":"draft-discard",onClick:P,style:f,children:"Discard"})]}),d.draftNote?(0,e.jsx)("p",{"data-testid":"draft-note",role:"status",style:{margin:0,padding:a?0:"0 16px 8px",fontSize:"0.8125rem",color:"var(--graview-warn)"},children:d.draftNote}):(0,e.jsx)("span",{}),(0,e.jsx)("div",{"data-testid":"draft-lens","data-graview-draft":t.lens.name,style:a?{height:"min(72vh, 760px)",display:"grid",gridTemplateRows:"minmax(0, 1fr)",overflow:"auto",scrollbarGutter:"stable",border:"1px solid var(--graview-edge)",borderRadius:12,background:"var(--graview-panel)"}:{minHeight:0,overflow:"auto",scrollbarGutter:"stable",display:"grid",gridTemplateRows:"minmax(0, 1fr)"},onClick:n=>{let r=n.target?.closest("[data-graview-pick]")?.getAttribute("data-graview-pick");if(!r||!o.graph.getNode(r))return;n.preventDefault();let R=o.graph.getNode(r);m?(s.setDraft(null),m(r)):c({to:"record",id:r,kind:R.kind,label:r,address:"",said:""})},children:(0,e.jsx)(k,{kind:t.kind,view:t.title,children:(0,e.jsx)(L,{nodes:I,label:t.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1})})})]})}var z={margin:0,display:"flex",flexWrap:"wrap",alignItems:"baseline",gap:"4px 8px",fontSize:"0.875rem",color:"var(--graview-ink-muted)",borderBottom:"1px solid var(--graview-edge)",paddingBottom:8};export{O as DraftFrame};
|