graview 0.1.30 → 0.1.32
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.2NIOHEMX.js +1 -0
- package/dist/preview/{chunk.XRJBLH4N.js → chunk.3AGY4QVS.js} +1 -1
- package/dist/preview/chunk.3HXN4BOY.js +1 -0
- package/dist/preview/{chunk.2CIBWZJG.js → chunk.3K6YSVHC.js} +1 -1
- package/dist/preview/{chunk.FWCOJDOD.js → chunk.3TVXGJTU.js} +1 -1
- package/dist/preview/{chunk.NDADLJE6.js → chunk.3TY5NFLY.js} +1 -1
- package/dist/preview/{chunk.UWGWXFWZ.js → chunk.47STJVRV.js} +1 -1
- package/dist/preview/{chunk.34ZMMURV.js → chunk.4HRAQNJO.js} +6 -6
- package/dist/preview/{chunk.QTMWHE5O.js → chunk.4HZ7QTXZ.js} +1 -1
- package/dist/preview/{chunk.3JGGBLRB.js → chunk.4MERAWS2.js} +1 -1
- package/dist/preview/chunk.52W7WYME.js +1 -0
- package/dist/preview/chunk.5A4AOFOA.js +1 -0
- package/dist/preview/chunk.5H4VXLZF.js +88 -0
- package/dist/preview/{chunk.XS7YFNDU.js → chunk.5T5XGILP.js} +1 -1
- package/dist/preview/chunk.5TVB6BUY.js +1 -0
- package/dist/preview/chunk.5UL7YDUD.js +1 -0
- package/dist/preview/chunk.63GXY2ME.js +1 -0
- package/dist/preview/chunk.6QWV5MVH.js +25 -0
- package/dist/preview/{chunk.PAVR5TK5.js → chunk.6UGEYZAC.js} +1 -1
- package/dist/preview/chunk.6YCBYL2Y.js +2 -0
- package/dist/preview/{chunk.ZYKAS4BT.js → chunk.7GKUVQVF.js} +1 -1
- package/dist/preview/{chunk.T3VPD7JQ.js → chunk.7T7NZZTC.js} +1 -1
- package/dist/preview/chunk.AKFKM4SW.js +3 -0
- package/dist/preview/chunk.AOSMJKLH.js +1 -0
- package/dist/preview/{chunk.D3IECJ2S.js → chunk.ASCLIM2P.js} +1 -1
- package/dist/preview/chunk.B2GLDIAS.js +1 -0
- package/dist/preview/chunk.BNV77BQZ.js +4 -0
- package/dist/preview/chunk.BOO6WVM4.js +117 -0
- package/dist/preview/chunk.BQ3JHEHV.js +1 -0
- package/dist/preview/chunk.CAVBSL27.js +1 -0
- package/dist/preview/{chunk.YLQB3KBA.js → chunk.CDP2XL66.js} +1 -1
- package/dist/preview/chunk.CIPS2OGR.js +1 -0
- package/dist/preview/chunk.CJJLJ3KW.js +2 -0
- package/dist/preview/chunk.CN3UEF5N.js +90 -0
- package/dist/preview/{chunk.6XMEU2Q2.js → chunk.COQKECUH.js} +1 -1
- package/dist/preview/{chunk.QTA4ROAK.js → chunk.CWHRDBOF.js} +1 -1
- package/dist/preview/chunk.CX3KL2C5.js +1 -0
- package/dist/preview/{chunk.AK3IHFCF.js → chunk.D75KC3LL.js} +1 -1
- package/dist/preview/chunk.DAZ2VSRD.js +1 -0
- package/dist/preview/{chunk.RIEHYQLK.js → chunk.DHIUSUCL.js} +50 -24
- package/dist/preview/{chunk.3ADPAGPY.js → chunk.DYSPCGXX.js} +1 -1
- package/dist/preview/chunk.E2YEOMPH.js +1 -0
- package/dist/preview/chunk.EBGAYL32.js +1 -0
- package/dist/preview/chunk.EF3XNU4O.js +1 -0
- package/dist/preview/chunk.EJPI3ST6.js +1 -0
- package/dist/preview/chunk.EKPRNDUV.js +1 -0
- package/dist/preview/chunk.ERIT3R6N.js +1 -0
- package/dist/preview/chunk.EYTBDMTW.js +1 -0
- package/dist/preview/chunk.F6EH7HI2.js +1 -0
- package/dist/preview/{chunk.3URFMWXZ.js → chunk.F6ZK7RMB.js} +2 -2
- package/dist/preview/chunk.FSTCX2AI.js +1 -0
- package/dist/preview/{chunk.HHPGWJDO.js → chunk.FWTIUYXH.js} +1 -1
- package/dist/preview/{chunk.6T2Q6NLO.js → chunk.G5NZVPJU.js} +1 -1
- package/dist/preview/{chunk.VG56IUIQ.js → chunk.GO4XBWJO.js} +1 -1
- package/dist/preview/chunk.GV2CQVKV.js +1 -0
- package/dist/preview/chunk.GYICGZMG.js +3 -0
- package/dist/preview/chunk.H7BST3XO.js +1 -0
- package/dist/preview/chunk.H7EPE74C.js +1 -0
- package/dist/preview/{chunk.26CZTUY4.js → chunk.HAIG6NVX.js} +1 -1
- package/dist/preview/{chunk.V7BDAGDE.js → chunk.HLTRQU4Y.js} +1 -1
- package/dist/preview/{chunk.VS7K3SCD.js → chunk.I6FPNX43.js} +1 -1
- package/dist/preview/chunk.IDVAR5HM.js +1 -0
- package/dist/preview/chunk.J25KOSNW.js +1 -0
- package/dist/preview/chunk.JDUJDAGA.js +1 -0
- package/dist/preview/{chunk.X37L5TN5.js → chunk.JFAOHHJJ.js} +1 -1
- package/dist/preview/chunk.JOOQUWLT.js +341 -0
- package/dist/preview/{chunk.4SJUTBDV.js → chunk.JQU5GEU3.js} +1 -1
- package/dist/preview/chunk.K5ME5GCG.js +1 -0
- package/dist/preview/chunk.K7PMDSOL.js +1 -0
- package/dist/preview/chunk.KSES5U5B.js +1 -0
- package/dist/preview/{chunk.DT7LHWU2.js → chunk.LLLZEGRK.js} +1 -1
- package/dist/preview/chunk.LR3VDXPI.js +1 -0
- package/dist/preview/{chunk.WYTIOLPP.js → chunk.LXBOVRFI.js} +1 -1
- package/dist/preview/{chunk.42YX6NOY.js → chunk.MAF7C3VM.js} +1 -1
- package/dist/preview/chunk.MNP4JI33.js +5 -0
- package/dist/preview/{chunk.O2LK2AO7.js → chunk.MWGGV7DE.js} +1 -1
- package/dist/preview/chunk.N6OX4NEQ.js +1 -0
- package/dist/preview/chunk.NM6MZYFN.js +47 -0
- package/dist/preview/chunk.NRAYZY3X.js +1 -0
- package/dist/preview/chunk.NTF7FVB2.js +1 -0
- package/dist/preview/{chunk.DZRTOURR.js → chunk.OC6IWRQ3.js} +1 -1
- package/dist/preview/chunk.OF34OZ4V.js +1 -0
- package/dist/preview/chunk.OJGHDWI6.js +1 -0
- package/dist/preview/chunk.OKRNJXTV.js +1 -0
- package/dist/preview/chunk.PBSMLINK.js +1 -0
- package/dist/preview/chunk.PHKSMUIA.js +1 -0
- package/dist/preview/{chunk.JN7DIFR3.js → chunk.PIP6Z563.js} +1 -1
- package/dist/preview/chunk.QGTSHKJL.js +1 -0
- package/dist/preview/chunk.QVVJRSRM.js +1 -0
- package/dist/preview/{chunk.L6OMEYL6.js → chunk.QYZNAUIR.js} +1 -1
- package/dist/preview/chunk.R6K6GF5R.js +1 -0
- package/dist/preview/{chunk.JTNWD2CN.js → chunk.RCKTBOY2.js} +1 -1
- package/dist/preview/{chunk.QNGWEV47.js → chunk.RIJUCHP4.js} +1 -1
- package/dist/preview/chunk.SHTJZ6UX.js +1 -0
- package/dist/preview/{chunk.PKK6FRZR.js → chunk.SYAEBGDC.js} +1 -1
- package/dist/preview/chunk.T5VG5A6V.js +1 -0
- package/dist/preview/{chunk.ERXSYPYL.js → chunk.TAQ764IQ.js} +1 -1
- package/dist/preview/chunk.TCNBCTWO.js +1 -0
- package/dist/preview/{chunk.HHI65WFZ.js → chunk.UATVTXZY.js} +1 -1
- package/dist/preview/{chunk.XSTXV6FP.js → chunk.UBFNZMUX.js} +2 -2
- package/dist/preview/{chunk.WAFDCOOG.js → chunk.UGFJKSHU.js} +1 -1
- package/dist/preview/chunk.UHUGOTUU.js +19 -0
- package/dist/preview/chunk.ULRW47RP.js +1 -0
- package/dist/preview/chunk.UNL2HIF2.js +1 -0
- package/dist/preview/chunk.UZGRRDHD.js +1 -0
- package/dist/preview/{chunk.BPWNWE7N.js → chunk.VG3O4LWB.js} +1 -1
- package/dist/preview/chunk.WAZ7OGBD.js +1 -0
- package/dist/preview/{chunk.3JNMSOFG.js → chunk.XANVHJQ4.js} +1 -1
- package/dist/preview/chunk.XKABS745.js +1 -0
- package/dist/preview/chunk.XMC7YDWT.js +1 -0
- package/dist/preview/chunk.XNJEFUF7.js +3 -0
- package/dist/preview/chunk.Y6ZNFQK3.js +6 -0
- package/dist/preview/{chunk.J2ITFGN3.js → chunk.YIR7PPF3.js} +1 -1
- package/dist/preview/index.html +51 -0
- package/dist/preview/page.js +6 -6
- package/package.json +6 -6
- package/dist/preview/chunk.2EXGG6BB.js +0 -1
- package/dist/preview/chunk.2NBYNZRD.js +0 -1
- package/dist/preview/chunk.2XAONC66.js +0 -1
- package/dist/preview/chunk.3R4W2P5X.js +0 -1
- package/dist/preview/chunk.3SKKIHU3.js +0 -4
- package/dist/preview/chunk.3VL5WECB.js +0 -1
- package/dist/preview/chunk.4ALKPNXM.js +0 -1
- package/dist/preview/chunk.4HP7UWA2.js +0 -1
- package/dist/preview/chunk.5U5J3ISK.js +0 -1
- package/dist/preview/chunk.6V2RG5JG.js +0 -5
- package/dist/preview/chunk.7BWT5L2L.js +0 -1
- package/dist/preview/chunk.C5CYZNSJ.js +0 -1
- package/dist/preview/chunk.CM6LOIQE.js +0 -88
- package/dist/preview/chunk.FDELO7NY.js +0 -116
- package/dist/preview/chunk.FGVKJWNS.js +0 -6
- package/dist/preview/chunk.GFF2FB2J.js +0 -25
- package/dist/preview/chunk.GLBHQFJ2.js +0 -1
- package/dist/preview/chunk.HSCTWAUV.js +0 -1
- package/dist/preview/chunk.INZUEWC5.js +0 -1
- package/dist/preview/chunk.JH6MU6TX.js +0 -2
- package/dist/preview/chunk.JISMMIMX.js +0 -1
- package/dist/preview/chunk.JPHNKWTY.js +0 -1
- package/dist/preview/chunk.K75FUIZI.js +0 -1
- package/dist/preview/chunk.K776HO42.js +0 -2
- package/dist/preview/chunk.KN3ULTGF.js +0 -1
- package/dist/preview/chunk.KOB6N3SL.js +0 -1
- package/dist/preview/chunk.KQT7WAQE.js +0 -1
- package/dist/preview/chunk.L4DECHXR.js +0 -327
- package/dist/preview/chunk.LQ7V6KEE.js +0 -1
- package/dist/preview/chunk.MD74YVRN.js +0 -3
- package/dist/preview/chunk.MGNP4LAM.js +0 -1
- package/dist/preview/chunk.NCTOBUCT.js +0 -1
- package/dist/preview/chunk.NO52VON3.js +0 -1
- package/dist/preview/chunk.OAF7TUMI.js +0 -1
- package/dist/preview/chunk.OQ4KFN6W.js +0 -1
- package/dist/preview/chunk.OQDETV4X.js +0 -1
- package/dist/preview/chunk.OXQMNIRO.js +0 -1
- package/dist/preview/chunk.OZNW5W4Z.js +0 -1
- package/dist/preview/chunk.QIAKO27D.js +0 -1
- package/dist/preview/chunk.R26DREVU.js +0 -1
- package/dist/preview/chunk.RI3PYG5T.js +0 -19
- package/dist/preview/chunk.RRVIXV7W.js +0 -1
- package/dist/preview/chunk.RYT5U3QM.js +0 -1
- package/dist/preview/chunk.SE5SKFQH.js +0 -1
- package/dist/preview/chunk.SOBC3CTN.js +0 -47
- package/dist/preview/chunk.SOD3PBJM.js +0 -1
- package/dist/preview/chunk.UDSEJKCY.js +0 -1
- package/dist/preview/chunk.UZWWDAGM.js +0 -14
- package/dist/preview/chunk.V5ZYUVMH.js +0 -1
- package/dist/preview/chunk.VOAZBHCG.js +0 -1
- package/dist/preview/chunk.VSZQXB4Q.js +0 -3
- package/dist/preview/chunk.W3S6UXNA.js +0 -1
- package/dist/preview/chunk.Y4UXEL6Y.js +0 -1
- package/dist/preview/chunk.YJUB4OD7.js +0 -1
- package/dist/preview/chunk.YNQDVGZM.js +0 -1
- package/dist/preview/chunk.YV2LJFGS.js +0 -1
- package/dist/preview/chunk.Z2YUYZT4.js +0 -1
- /package/dist/preview/{chunk.EYZ7MHBZ.js → chunk.GZHZLJBF.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as ue,c as fe,d as me}from"./chunk.7BWT5L2L.js";import{f as T,i as v,j as de,k as pe}from"./chunk.3VL5WECB.js";import{b as le}from"./chunk.JH6MU6TX.js";import{c as ae,f as se}from"./chunk.WAFDCOOG.js";import{G as we,R as oe,_ as ie,i as te,v as re}from"./chunk.GFF2FB2J.js";import{Da as ee,Ea as ne,W as Y,Y as Q,da as X,sa as Z}from"./chunk.6V2RG5JG.js";import{b as H}from"./chunk.AJZBJBMO.js";var l=H(we(),1),a=H(oe(),1);function Pe({affordance:n,onApply:r,onCancel:p,store:b}){let y=ie(),i=b??y?.store,[R,M]=(0,l.useState)({}),[f,z]=(0,l.useState)(""),[E,P]=(0,l.useState)(K),[q,B]=(0,l.useState)(void 0),G=(0,l.useId)(),j=(0,l.useRef)(null),S=n.open.filter(e=>!(e.name in R)),s=S[0],w=i.allMutations().find(e=>e.name===n.mutation),J=(0,l.useMemo)(()=>ke(w,i,n.args??{}),[w,i,n.args]),u=s?J[s.name]:void 0;if((0,l.useEffect)(()=>{z(ce(u,s?.shape)),P(Array.isArray(u)?u:K),B(u)},[s?.name]),(0,l.useEffect)(()=>{j.current?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[s?.name]),(0,l.useLayoutEffect)(()=>{let e=j.current,o=typeof document>"u"?null:document.activeElement;if(!e||o&&o!==document.body&&!e.contains(o))return;let d=e.querySelector("form input, [role=group] button:not([disabled])");d&&d!==o&&d.focus()},[s?.name]),!s)return null;let h=e=>{let o=u!==void 0&&JSON.stringify(e)===JSON.stringify(u)?void 0:e,d={...R,[s.name]:o};if(n.open.filter(N=>!(N.name in d)).length===0){let N=r(Object.fromEntries(Object.entries(d).filter(([,L])=>L!==void 0)));N&&N.length>0&&M(Object.fromEntries(Object.entries(d).filter(([L])=>!N.includes(L))))}else M(d)},x=s.optional?(0,a.jsx)("button",{type:"button",onClick:()=>h(void 0),style:{fontSize:"0.8125rem"},children:"Skip"}):null,t=s.shape??{type:"unknown"},m=t.type==="number"?t.amount:void 0,c=ve(s,t),g=T(i.schema,w,s.name),_=Z((w?.input?.shape??{})[s.name]),ge=ne((w?.input?.shape??{})[s.name]),A=ee(s.name),ye=typeof u=="boolean"?u?"yes":"no":u,[F,he]=(0,l.useState)(""),U=(0,l.useMemo)(()=>{let e=c.map(o=>i.graph.getNode(o)).filter(o=>o!==void 0);return le(e,o=>i.schema.tryDefinition(o))},[c,i]),I=e=>{let o=xe(i,t,e),d=t.type==="choice"||t.type==="several"&&t.of.type==="choice"?g.option(e):o,O=U.get(e);return O?`${d} \xB7 ${O}`:d},$=(0,l.useMemo)(()=>{let e=F.trim().toLowerCase();return e===""?c:c.filter(o=>I(o).toLowerCase().includes(e))},[c,F,i,t,U]),k=t.type==="several",V=t.type==="file"?t:t.type==="several"&&t.of.type==="file"?t.of:void 0,W=k&&c.length===0,C=s.kinds&&s.kinds.length>0&&!s.kinds.includes("*")?s.kinds.map(e=>Q(X(i.schema.tryDefinition(e),e))).join(" or "):g.label,be=n.open.length>1?`${C} \xB7 ${n.open.length-S.length+1} of ${n.open.length}`:C;return(0,a.jsxs)("div",{ref:j,"data-graview-asking":n.id,style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:4,padding:"5px 0 2px"},children:[n.open.length>1||c.length>0?(0,a.jsx)("span",{id:G,style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:be}):null,c.length>D?(0,a.jsx)("input",{type:"search",value:F,onChange:e=>he(e.target.value),placeholder:`Filter ${c.length}\u2026`,"aria-label":`Filter ${C}`,"data-testid":"ask-filter",style:{font:"inherit",fontSize:"0.8125rem",minWidth:0,padding:"3px 7px"}}):null,ge?(0,a.jsxs)("form",{style:{display:"grid",gap:4},onSubmit:e=>{e.preventDefault(),h(q??(u===void 0?void 0:null))},children:[(0,a.jsx)(me,{value:q,onChange:B,start:A?R[A]??J[A]:void 0,label:`${A?T(i.schema,w,A).label:g.label} repeats`,name:s.name}),(0,a.jsxs)("span",{style:{display:"flex",gap:4},children:[(0,a.jsx)("button",{type:"submit",style:{fontSize:"0.8125rem"},children:S.length>1?"Next":"Apply"}),x]})]}):_?(0,a.jsxs)("div",{style:{display:"grid",gap:4},children:[(0,a.jsx)(fe,{relation:_,value:u,onChange:h,label:g.label}),x]}):V?(0,a.jsxs)("div",{style:{display:"grid",gap:4},children:[(0,a.jsx)(ue,{as:"control",value:u,onChange:h,several:k,image:V.image===!0,label:g.label}),x]}):c.length>0?(0,a.jsxs)("div",{role:"group","aria-labelledby":G,style:{display:"flex",flexWrap:"wrap",gap:4},children:[$.slice(0,D).map(e=>{let o=k?E.includes(e):e===ye;return(0,a.jsx)("button",{type:"button","aria-label":`${C}: ${I(e)}`,...k?{"aria-pressed":o}:o?{"aria-current":!0}:{},style:{padding:"3px 9px",fontSize:"0.8125rem",...o?{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"}:{}},onClick:()=>k?P(d=>d.includes(e)?d.filter(O=>O!==e):[...d,e]):h(t.type==="boolean"?e==="yes":e),children:I(e)},e)}),$.length>D?(0,a.jsxs)("span",{"data-testid":"ask-more",style:{alignSelf:"center",fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:[$.length-D," more \u2014 type to narrow"]}):null,$.length===0?(0,a.jsxs)("span",{"data-testid":"ask-none",style:{alignSelf:"center",fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:["None of the ",c.length," match that."]}):null,k?(0,a.jsx)("button",{type:"button",disabled:E.length===0,style:{fontSize:"0.8125rem"},onClick:()=>{let e=E;P(K),h(e)},children:S.length>1?"Next":"Apply"}):null,x]}):(0,a.jsxs)("form",{style:{display:"flex",flexWrap:"wrap",gap:4},onSubmit:e=>{if(e.preventDefault(),u!==void 0&&f===ce(u,t)){h(void 0);return}if(W){h(f.split(/[,\n]/).map(o=>o.trim()).filter(Boolean));return}if(f.trim().length!==0){if(m){let o=pe(f,m);o!==void 0&&h(o);return}h(t.type==="number"?t.duration?se(f)??f:Number(f):f)}},children:[t.type==="text"&&t.long?(0,a.jsx)("textarea",{autoFocus:!0,name:s.name,"aria-label":g.label,placeholder:g.label,value:f,rows:4,onChange:e=>z(e.target.value),onKeyDown:e=>{e.key==="Escape"?p():e.key==="Enter"&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())},style:{flex:"1 1 100%",minWidth:0,font:"inherit",fontSize:"0.875rem",lineHeight:1.45,padding:"5px 8px",borderRadius:7,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)",resize:"vertical",fieldSizing:"content",minHeight:"5.5em",maxHeight:"40vh"}}):(0,a.jsx)("input",{autoFocus:!0,type:t.type==="date"?t.time?"datetime-local":"date":t.type==="number"&&!t.duration&&!m?"number":t.type==="text"&&t.holds==="phone"?"tel":"text",...m?{inputMode:"decimal","data-graview-amount":m.format??"unit"}:{},name:s.name,"aria-label":g.label,placeholder:W?`${g.label}, separated by commas`:m?`${g.label}, ${v(m).hint} \u2014 ${v(m).prefix??""}${v(m).placeholder}${v(m).suffix?` ${v(m).suffix}`:""}`:g.label,value:f,...t.type==="number"&&t.min!==void 0?{min:t.min}:{},...t.type==="number"&&t.max!==void 0?{max:t.max}:{},...t.type==="number"&&t.step!==void 0?{step:t.step}:{},onChange:e=>z(e.target.value),onKeyDown:e=>{e.key==="Escape"&&p()},style:{flex:1,minWidth:0,font:"inherit",fontSize:"0.875rem",padding:"5px 8px",borderRadius:7,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)"}}),(0,a.jsx)("button",{type:"submit",disabled:!W&&f.trim().length===0,style:{fontSize:"0.8125rem"},children:S.length>1?"Next":"Apply"}),x]})]})}var K=[];function ke(n,r,p){let b=n?.derived?.act==="edit"&&n.subject?p[n.subject.arg]:void 0,y=typeof b=="string"?r.graph.getNode(b):void 0;return y?Object.fromEntries((n.writes??[]).filter(i=>y[i]!==void 0&&y[i]!==null).map(i=>[i,y[i]])):{}}function ce(n,r){return typeof n=="number"?r?.type==="number"&&r.amount?de(n,r.amount):String(n):Array.isArray(n)?n.every(p=>typeof p=="string")?n.join(", "):"":typeof n!="string"?"":r?.type==="date"?r.time?n.slice(0,16).replace(" ","T"):n.slice(0,10):n}var D=10;function ve(n,r){return n.candidates&&n.candidates.length>0?n.candidates:r.type==="choice"?r.options:r.type==="several"&&r.of.type==="choice"?r.of.options:r.type==="boolean"?Se:[]}var Se=["yes","no"];function xe(n,r,p){return r.type==="boolean"||r.type==="choice"||r.type==="several"&&r.of.type==="choice"?p:Ae(n,p)}function Ae(n,r){let p=te(r);if(p){let i=ae(n.schema,n.graph.getNode(p.from)?.kind??"",p.kind,"out");return i.charAt(0).toUpperCase()+i.slice(1)}let b=re(r);if(b.length>0)return b.map(i=>n.schema.tryDefinition(i)?.plural??`${i}s`).join(" + ");let y=n.graph.getNode(r);return y?Y(n.schema.tryDefinition(y.kind),y):r}export{Pe as a,Ae as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as J}from"./chunk.ERXSYPYL.js";import{a as ge}from"./chunk.MB7LKKUD.js";import{p as fe,q as X}from"./chunk.KQT7WAQE.js";import{f as Y,g as ce,h as pe,i as U,j}from"./chunk.OQDETV4X.js";import{c as me}from"./chunk.WAFDCOOG.js";import{b as ae,g as ue}from"./chunk.L4DECHXR.js";import{$ as B,G as z,J as se,O as ie,R as x,Z as P,_ as le,a as I,oa as _,qa as de,ya as L}from"./chunk.GFF2FB2J.js";import{$ as oe,_b as re,dc as H}from"./chunk.6V2RG5JG.js";import{b as y}from"./chunk.AJZBJBMO.js";var D=y(z(),1),$=y(x(),1),be="A",Q=L(I(()=>import("./chunk.K776HO42.js")));var Se=Q.part((e,n)=>(0,$.jsx)(e.InspectorPane,{...n}),{what:"This card's acts"});function xe(e){let n=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&e()},o=globalThis;if(o.requestIdleCallback){let p=o.requestIdleCallback(n,{timeout:5e3});return()=>o.cancelIdleCallback?.(p)}let l=setTimeout(n,2500);return()=>clearTimeout(l)}function ze({placement:e="float",openActs:n}={}){let{menuAt:o,setMenuAt:l,registerActsDoor:p}=P(),{selection:m}=_();(0,D.useEffect)(()=>{if(Q.current)return;let i=()=>{C(),Q.prefetch()},g=xe(i),c=["pointerdown","keydown"];for(let b of c)document.addEventListener(b,i,{capture:!0,passive:!0});function C(){g();for(let b of c)document.removeEventListener(b,i,{capture:!0})}return C},[]),(0,D.useEffect)(()=>{if(e==="menu")return p({key:be,open:n??(i=>{let g=i.getBoundingClientRect(),c=i.closest("[data-graview-pick]")?.getAttribute("data-graview-pick")??i.closest("[data-graview-view]")?.getAttribute("data-graview-view")??void 0;l({x:Math.round(g.left+Math.min(16,g.width/2)),y:Math.round(Math.min(g.bottom,g.top+36)),...c?{on:c}:{}})})}),()=>p(null)},[e,p,l,n]);let f=o!==null||m.length>0,[d,u]=(0,D.useState)(f);return(0,D.useEffect)(()=>{f&&u(!0)},[f]),!d&&!f?null:(0,$.jsx)(D.Suspense,{fallback:null,children:(0,$.jsx)(Se,{placement:e,chosen:n===void 0})})}var h=y(z(),1);var M=y(x(),1),he=336,k=16,Pe=640,N=L(I(()=>import("./chunk.HSCTWAUV.js"))),Me=N.part((e,n)=>{let o=e.SeatPanel;return(0,M.jsx)(o,{...n})},{what:"The conversation"});function Ne({respond:e,onCall:n,onPick:o,start:l="field",onMove:p,place:m,onDraft:f}){let{brand:d,seatTalk:u}=P(),i=se(u),g=d?.name?.trim()||"this app",c=(0,h.useRef)(null),C=(0,h.useRef)(null),[b,s]=(0,h.useState)(""),[a,w]=(0,h.useState)(!1),E=(0,h.useRef)(null),T=ie()?.open??!1,S=l==="hidden"||T,v=i.open&&!S;(0,h.useEffect)(()=>S?void 0:u.drawn(),[u,S]),(0,h.useLayoutEffect)(()=>{let r=c.current?.parentElement;if(!r)return;let A=()=>w(r.getBoundingClientRect().width<Pe);if(A(),typeof ResizeObserver>"u")return;let R=new ResizeObserver(A);return R.observe(r),()=>R.disconnect()},[S]),(0,h.useEffect)(()=>{typeof window<"u"&&window.dispatchEvent(new Event(ge))},[v,i.side,a]),(0,h.useEffect)(()=>{let r=c.current;if(S||v||!r||typeof window>"u")return;let A=(r.closest("[data-graview-embed]")??document.documentElement).style,R=()=>{let te=r.getBoundingClientRect(),ne=r.offsetParent?.getBoundingClientRect(),ke=ne?ne.bottom-te.top:te.height+k;A.setProperty("--graview-foot-room",`${Math.max(0,Math.round(ke+k))}px`)};R();let ee=typeof ResizeObserver>"u"?null:new ResizeObserver(R);return ee?.observe(r),()=>{ee?.disconnect(),A.removeProperty("--graview-foot-room")}},[S,v,a,i.side]),(0,h.useEffect)(()=>{!v||i.pending===null||(F(),C.current?.focus({preventScroll:!0}))},[v,i.pending]);let F=()=>{let r=typeof document>"u"?null:document.activeElement;r instanceof HTMLElement&&r!==document.body&&!c.current?.contains(r)&&(E.current=r)},V=()=>{F(),N.prefetch(),u.setOpen(!0)},K=()=>{u.setOpen(!1);let r=E.current;E.current=null,r?.isConnected&&!(a&&r instanceof HTMLInputElement)&&r.focus({preventScroll:!0}),document.activeElement!==r&&(a?c:C).current?.focus({preventScroll:!0})};if(S)return null;let O=!a&&i.side==="right",we=a?v?{left:0,right:0,bottom:0,padding:"8px 12px calc(12px + env(safe-area-inset-bottom, 0px))",borderRadius:"12px 12px 0 0",...ve}:{left:k,right:k,bottom:`calc(${k}px + env(safe-area-inset-bottom, 0px))`}:v?{[O?"right":"left"]:O?`calc(${k/2-1}px + var(--graview-dock, 0px))`:k/2-1,bottom:k/2-1,width:he+k+2,padding:k/2,borderRadius:12,...ve}:{[O?"right":"left"]:O?`calc(${k}px + var(--graview-dock, 0px))`:k,bottom:k,width:he};return(0,M.jsxs)("section",{ref:c,role:"region","aria-label":`Ask ${g}`,tabIndex:-1,"data-testid":"seat","data-graview-seat":v?"open":"closed","data-graview-seat-side":O?"right":"left","data-graview-seat-shape":a?"phone":"desk","data-graview-foot":"","data-graview-offstage":"",onMouseDown:r=>r.stopPropagation(),onKeyDown:r=>{r.key!=="Escape"||!v||(r.preventDefault(),r.stopPropagation(),K())},style:{position:"absolute",zIndex:H("rail"),boxSizing:"border-box",display:"flex",flexDirection:"column",gap:8,pointerEvents:"auto",outline:"none",...we},children:[(0,M.jsxs)("h2",{style:{...ue,margin:0},children:["Ask ",g]}),v?(0,M.jsx)(h.Suspense,{fallback:null,children:(0,M.jsx)(Me,{phone:a,side:O?"right":"left",name:g,onClose:K,...e?{respond:e}:{},...n?{onCall:n}:{},...o?{onPick:o}:{},...p?{onMove:p}:{},...m?{place:m}:{},...f?{onDraft:f}:{}})}):null,(0,M.jsx)("form",{onSubmit:r=>{r.preventDefault();let A=b.trim();v||V(),!(!A||i.busy)&&(u.ask(A),s(""))},style:{display:"flex",margin:0},children:(0,M.jsx)("input",{ref:C,"data-testid":"seat-field",type:"text",enterKeyHint:"send",autoComplete:"off",value:b,placeholder:`Ask ${g}\u2026`,"aria-label":`Ask ${g}`,onPointerEnter:()=>N.prefetch(),onFocus:()=>N.prefetch(),onClick:()=>{v||V()},onChange:r=>{s(r.target.value),v||V()},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 ve={background:"var(--graview-float)",border:"1px solid var(--graview-edge)",boxShadow:"var(--graview-lift-high)"};var q=y(z(),1),G=y(x(),1),Ce=L(I(()=>import("./chunk.5U5J3ISK.js"))),Ee=Ce.part((e,n)=>{let o=e.DraftFrame;return(0,G.jsx)(o,{...n})},{what:"The view"});function Ye(e){let{seatTalk:n}=P();return(0,q.useSyncExternalStore)(n.subscribe,()=>n.get().draft!==null,()=>!1)?(0,G.jsx)(q.Suspense,{fallback:null,children:(0,G.jsx)(Ee,{...e})}):null}function Je(e={}){return e.scope===void 0?J:ae(J,e.scope)}var W=y(z(),1),t=y(x(),1);function ot({inside:e=!1,widthOf:n}={}){let{store:o,view:l,emphasis:p,setEmphasis:m}=P(),f=fe(),{selection:d,set:u}=_(),{show:i}=de(),g=B(),c=(0,W.useMemo)(()=>{let s=new Map;for(let a of o.graph.allEdges()){let w=s.get(a.kind)??{count:0,ends:new Set};w.count+=1;for(let E of[a.from,a.to]){let T=o.graph.getNode(E);T&&w.ends.add(`kind:${T.kind}`)}s.set(a.kind,w)}return[...s.entries()].sort(([a],[w])=>a.localeCompare(w)).map(([a,w])=>({kind:a,count:w.count,ends:[...w.ends]}))},[o,g]),C=Math.max(0,...c.map(s=>s.count));if((0,W.useEffect)(()=>()=>m(null),[m]),!l.overview&&!e||c.length===0)return null;let b=new Set;for(let s of d){if(s.startsWith("kind:")){b.add(s);continue}let a=o.graph.getNode(s);a&&b.add(`kind:${a.kind}`)}return(0,t.jsxs)("section",{"aria-label":"What the lines mean",role:e?"group":void 0,"data-testid":"relation-key",style:e?{display:"grid",gap:1}:{position:"absolute",left:16,top:14,zIndex:H("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:Te,animation:"graview-settle 380ms 280ms ease backwards"},children:[e?null:(0,t.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.16em",textTransform:"uppercase",color:"var(--graview-ink-faint)",paddingBottom:2},children:c.length===1?"1 relation":`${c.length} relations`}),n?(0,t.jsx)(Ie,{aloft:l.overview===!0}):null,c.map(({kind:s,count:a,ends:w})=>{let{connector:E,style:T}=X(f,s),S=Ae(o.schema,s),v=p!==null?p===s:b.size===0||w.some(F=>b.has(F));return(0,t.jsxs)("button",{type:"button",title:o.schema.edge(s)?.description===void 0?`${a} of these`:S.words,onMouseEnter:()=>m(s),onMouseLeave:()=>m(null),onFocus:()=>m(s),onBlur:()=>m(null),onClick:()=>{u(w),i(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:v?1:.4},children:[(0,t.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",style:{display:"block",opacity:E.visible?1:.35},children:l.overview&&n?(0,t.jsx)("path",{d:"M 1 5 L 29 5",fill:"none",className:"graview-key-ribbon",stroke:"var(--graview-ink)",strokeOpacity:.35,strokeWidth:n(a,C)}):(0,t.jsx)("path",{d:"M 1 5 L 29 5",fill:"none",stroke:U(T),strokeWidth:j(T,!0),strokeDasharray:Y[T.pattern],strokeLinecap:"round"})}),(0,t.jsxs)("span",{style:{display:"grid",minWidth:0},"data-graview-relation-words":s,children:[(0,t.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink)"},children:S.words}),(0,t.jsx)("span",{style:{fontSize:"0.6875rem",color:"var(--graview-ink-faint)"},children:S.ends})]}),E.visible?null:(0,t.jsx)("span",{"data-graview-quiet":s,style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",fontStyle:"italic"},children:"not drawn"}),(0,t.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",fontVariantNumeric:"tabular-nums"},children:a})]},s)})]})}var Te="min(280px, calc(100% - 28px))";function Ae(e,n,o){let l=e.edge(n)?.from??[],p=new Map;for(let d of o!==void 0&&l.includes(o)?[o]:l.length>0?l:[""]){let u=me(e,d,n,"out");p.set(u,[...p.get(u)??[],d])}let m=d=>d==="*"?"anything":oe(e,d),f=[...p].map(([d,u])=>{let i=u.flatMap(c=>e.tryDefinition(c)?.edges[n]?.to??[]),g=u[0]&&i.length>0?`${u.map(m).join(", ")} \u2192 ${(i.includes("*")?["*"]:[...new Set(i)]).map(m).join(", ")}`:"";return[d.charAt(0).toUpperCase()+d.slice(1),g]});return{words:f.map(([d])=>d).join(" \xB7 "),ends:f.flatMap(([,d])=>d?[d]:[]).join(" \xB7 ")}}function rt({edgeKind:e,kit:n,width:o=30}){let l=le(),p=(0,W.useMemo)(()=>re(n??l?.brand?.kit),[n,l?.brand?.kit]),{connector:m,style:f}=X(p,e);return(0,t.jsx)("svg",{width:o,height:"8","aria-hidden":"true","data-testid":"relation-mark","data-graview-relation":e,style:{display:"inline-block",verticalAlign:"middle",opacity:m.visible?1:.35},children:(0,t.jsx)("path",{d:`M 1 4 L ${o-1} 4`,fill:"none",stroke:U(f),strokeWidth:j(f,!0),strokeDasharray:Y[f.pattern],strokeLinecap:"round"})})}function Ie({aloft:e}){let n={display:"grid",gridTemplateColumns:"30px 1fr",alignItems:"center",gap:8,minHeight:23,padding:"2px 4px"},o={fontSize:"0.75rem",color:"var(--graview-ink-muted)"};return(0,t.jsxs)("div",{role:"group","aria-label":"The lines","data-testid":"line-manners",style:{display:"grid",gap:1,paddingBottom:6,marginBottom:4,borderBottom:"1px solid var(--graview-edge)"},children:[e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{style:n,"data-graview-manner":"ribbon",children:[(0,t.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-ink)",strokeOpacity:.35,strokeWidth:6})}),(0,t.jsx)("span",{style:o,children:"A relation between two districts, as wide as the links along it \u2014 point at one for its words"})]}),(0,t.jsxs)("div",{style:n,"data-graview-manner":"record",children:[(0,t.jsxs)("svg",{width:"30",height:"10","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M 1 5 L 25 5",stroke:"var(--graview-accent)",strokeWidth:1.8,strokeLinecap:"round"}),(0,t.jsx)("circle",{cx:26,cy:5,r:3,fill:"var(--graview-accent)"})]}),(0,t.jsx)("span",{style:o,children:"A chosen record's link to another record, labeled with the relation"})]}),(0,t.jsxs)("div",{style:n,"data-graview-manner":"district",children:[(0,t.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-accent)",strokeWidth:1.8,strokeDasharray:"5 4"})}),(0,t.jsx)("span",{style:o,children:"A chosen record's links into a district, with how many"})]})]}):null,(0,t.jsxs)("div",{style:n,"data-graview-manner":"unsure",children:[(0,t.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-accent)",strokeOpacity:pe,strokeWidth:1.8,strokeDasharray:ce,strokeLinecap:"round"})}),(0,t.jsx)("span",{style:o,children:"Unsure: a link its maker was less than sure of, until a person keeps it \u2014 point at its words for what it was based on"})]})]})}var ye=y(z(),1),Z=y(x(),1),Le=L(I(()=>import("./chunk.ZYKAS4BT.js"))),De=Le.part(e=>(0,Z.jsx)(e.SuggestedTray,{}),{quiet:!0});function lt(){let{store:e}=P(),n=B();return(0,ye.useMemo)(()=>e.log.all().some(l=>l.suggests!==void 0&&!l.withheld),[e,n])?(0,Z.jsx)(De,{}):null}export{ze as a,Ne as b,Ye as c,ot as d,Te as e,rt as f,Je as g,lt as h};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import{d as C,e as re}from"./chunk.SE5SKFQH.js";import{e as ee}from"./chunk.W3S6UXNA.js";import{b as S}from"./chunk.WAFDCOOG.js";import{g as X}from"./chunk.L4DECHXR.js";import{G as se,R as Z,a as K,ta as V,xa as J,ya as Q}from"./chunk.GFF2FB2J.js";import{J as Y,M,W as U}from"./chunk.6V2RG5JG.js";import{b as D}from"./chunk.AJZBJBMO.js";var h=D(se(),1);var n=D(Z(),1),Re=9,le=40,ge=2;function de(e){let r=new Map;for(let i of e.allNodes())r.set(i.kind,(r.get(i.kind)??0)+1);return r}var ue=(e,r)=>(e.far??[]).reduce((i,a)=>i+(r.get(a)??0),0);function ce(e,r,i){if(i)return i.flatMap(s=>e.filters.filter(u=>u.key===s));let a=de(r),o=new Set(e.filters.filter(s=>s.about==="edge"&&ue(s,a)>le).map(s=>s.key));return e.filters.filter(s=>s.about==="edge"?!o.has(s.key):s.about==="via"?o.has(s.key.split(".")[0]):!0)}function pe(e,r){let i=e.filter(a=>a.about==="field"&&a.type==="choice"&&(a.options?.length??0)>0);return r?i:i.slice(0,ge)}var fe=520;function ye(e,r,i,a){let o=i.filters.find(s=>s.key===a.key);if(!o)return`${a.key}: ${a.value}`;if(o.about==="is")return a.value.charAt(0).toUpperCase()+a.value.slice(1);if(o.about==="via")return`${o.label}: ${S(e.tryDefinition(o.far?.[0]??""),o.key.split(".")[1],a.value)}`;if(o.about==="edge"){if(a.value==="*")return`${o.label}: anything`;if(a.value==="none")return`${o.label}: nothing`;let s=r.getNode(a.value);return`${o.label}: ${s?U(e.tryDefinition(s.kind),s):a.value}`}if(o.type==="date"){let[s,u]=a.value.split(":");return`${o.label} ${s} ${u?Y(u):""}`.trim()}if(o.type==="boolean")return`${o.label}: ${a.value==="true"?"yes":"no"}`;if(o.type==="number"){let s=a.value.lastIndexOf(":"),u=a.value.slice(0,Math.max(0,s));if(u==="at-most"||u==="at-least")return`${o.label}: ${u==="at-most"?"at most":"at least"} ${S(e.tryDefinition(i.kind),o.key,Number(a.value.slice(s+1)))}`}return o.type==="text"?`${o.label}: ${a.value}`:`${o.label}: ${S(e.tryDefinition(i.kind),o.key,a.value)}`}var P=e=>/^[A-Z][a-z]/.test(e)?e.charAt(0).toLowerCase()+e.slice(1):e;function me(e){return e?.type==="date"?{asc:"Earliest first",desc:"Latest first"}:e?.type==="number"?{asc:"Lowest first",desc:"Highest first"}:e?.type==="boolean"?{asc:"No first",desc:"Yes first"}:e?.type==="choice"?{asc:"In their order",desc:"In reverse order"}:{asc:"A to Z",desc:"Z to A"}}var x=Q(K(()=>import("./chunk.V7BDAGDE.js"))),N=x.part((e,r)=>(0,n.jsx)(e.ArrangeLists,{...r}),{what:"This list",quiet:!0}),he=x.part((e,r)=>(0,n.jsx)(e.ArrangeChips,{...r}),{what:"This list",quiet:!0}),Te=()=>x.load(),q=new Map;function Ie(e){let{schema:r,graph:i,kind:a,arrangement:o,onChange:s}=e,u=e.offers??ee(r,a),g=e.testId??"arrange",y=C(e.allow,"sort")&&u.sorts.length>1,m=C(e.allow,"group")&&u.groups.length>0,F=C(e.allow,"filter")?ce(u,i,e.filters):[],L=e.chips?pe(F,e.filters):[],H=F.filter(t=>!L.includes(t)),G=H.length>0,_=e.query!==!1&&e.allow!==!1,w=we(e.noun,e.kept),v=e.past&&e.past.count>0?e.past:null;if(!y&&!m&&!G&&!_&&!w&&!v)return null;let z=t=>JSON.stringify(re(t)),O=`${g}|${a}`,p={current:q.get(O)??{words:new Set,latest:null,at:0}};q.set(O,p.current),p.current.latest&&Date.now()-p.current.at>1500&&!p.current.words.has(z(o))&&(p.current={words:new Set,latest:null,at:0},q.set(O,p.current));let d=p.current.latest??o,b=t=>{let l={...p.current.latest??o,...t};for(let c of Object.keys(l))l[c]===void 0&&delete l[c];p.current.latest=l,p.current.at=Date.now(),p.current.words.add(z(l)),s(l)},f=d.filter??[],R=t=>{let l=f.filter((c,I)=>I!==t);b({filter:l.length>0?l:void 0})},A=t=>f.some(l=>l.key===t.key&&l.value===t.value),te=t=>A(t)?R(f.findIndex(l=>l.key===t.key&&l.value===t.value)):b({filter:[...f,t]}),T=d.sort?u.sorts.find(t=>t.key===d.sort.by):void 0,j=d.group?u.groups.find(t=>t.key===d.group.by):void 0,ne=me(T),k={schema:r,graph:i,offers:{...u,filters:H},arrangement:d,set:b,toggle:te,has:A,testId:g},ae=(t,l)=>A({key:t,value:l})?R(f.findIndex(c=>c.key===t&&c.value===l)):b({filter:[...f.filter(c=>c.key!==t),{key:t,value:l}]}),oe=d.sort?(0,n.jsxs)(n.Fragment,{children:["Sorted by ",P(T?.label??d.sort.by),(0,n.jsx)("span",{"aria-hidden":"true",children:d.sort.direction==="desc"?" \u2193":" \u2191"})]}):"Sort",ie=d.group?.bucket&&j?.buckets?`, a ${d.group.bucket} each`:"",B=d.group?`Grouped by ${P(j?.label??d.group.by)}${ie}`:"Group";return(0,n.jsxs)("div",{"data-testid":`${g}-bar`,role:"group","aria-label":"Arrange",className:"graview-arrange",style:e.style,onPointerEnter:x.prefetch,onFocus:x.prefetch,children:[(0,n.jsx)("style",{children:xe}),(0,n.jsxs)("div",{className:"graview-arrange-line",children:[w?(0,n.jsxs)("span",{className:"graview-arrange-count","data-testid":`${g}-count`,children:[w.kept?(0,n.jsx)("span",{"data-testid":`${g}-kept`,children:w.kept}):null,w.words]}):null,v?(0,n.jsxs)("button",{type:"button",className:"graview-arrange-open","data-testid":`${g}-past`,title:`${M(v.count)} more behind the horizon \u2014 press to widen the view to the past`,onClick:t=>{let l=t.currentTarget.closest("[data-graview-view]"),c=t.currentTarget;v.widen();let I=0,W=()=>{if(document.activeElement!==c&&document.activeElement!==document.body&&c.isConnected)return;let $=l?.querySelector('[role="group"][aria-label="Arrange"] :is(button, input)');if($&&$!==c&&$.isConnected)return $.focus({preventScroll:!0});++I<120&&requestAnimationFrame(W)};requestAnimationFrame(W)},children:["+",M(v.count)," past"]}):null,f.map((t,l)=>{let c=ye(r,i,u,t);return(0,n.jsxs)("span",{className:"graview-arrange-token","data-testid":`${g}-condition`,children:[c,(0,n.jsx)("button",{type:"button","aria-label":`Remove: ${c}`,title:"Remove",onClick:()=>R(l),children:"\xD7"})]},`${t.key}:${t.value}`)}),y?(0,n.jsx)("span",{className:"graview-arrange-part graview-arrange-one",children:(0,n.jsx)(E,{testId:`${g}-sort`,value:d.sort?.by??"",set:d.sort!==void 0,label:"Sort",name:d.sort?`Sorted by ${P(T?.label??d.sort.by)}, ${ne[d.sort.direction].toLowerCase()}`:"Sort",list:t=>(0,n.jsx)(N,{which:"sort",done:t,...k}),children:oe})}):null,m?(0,n.jsx)("span",{className:"graview-arrange-part graview-arrange-one",children:(0,n.jsx)(E,{testId:`${g}-group`,value:d.group?.by??"",set:d.group!==void 0,label:"Group",name:B,list:t=>(0,n.jsx)(N,{which:"group",done:t,...k}),children:B})}):null,G?(0,n.jsx)("span",{className:"graview-arrange-part",children:(0,n.jsx)(E,{testId:`${g}-add`,value:"",set:!1,label:"Filter",name:f.length>0?`Filter \u2014 ${f.length} on`:"Filter",list:t=>(0,n.jsx)(N,{which:"filter",done:t,...k}),children:"Filter"})}):null,y||m?(0,n.jsx)("span",{className:"graview-arrange-part graview-arrange-all",children:(0,n.jsx)(E,{testId:`${g}-all`,value:"",set:!1,label:"Arrange",name:"Arrange: sort and group",list:t=>(0,n.jsx)(N,{which:"all",done:t,parts:{sort:y,group:m,filter:!1},...k}),children:"Arrange"})}):null,_?(0,n.jsxs)("label",{className:"graview-arrange-words-at",children:[(0,n.jsx)("span",{style:X,children:"Find"}),(0,n.jsx)("input",{type:"search",className:"graview-arrange-words","data-testid":`${g}-query`,value:d.query??"",placeholder:"Find\u2026",onChange:t=>b({query:t.target.value.length>0?t.target.value:void 0})})]}):null,L.length>0&&e.chips?(0,n.jsx)(h.Suspense,{fallback:null,children:(0,n.jsx)(he,{offers:L,chips:e.chips,schema:r,graph:i,kind:a,arrangement:d,has:A,choose:ae,testId:g})}):null]})]})}function we(e,r){if(!r)return null;let i=r.shown!==r.of;if(!e)return i?{words:"",kept:`${r.shown} of ${r.of}`}:null;let a=r.of===1?e.one:e.many;return i?{words:` ${a}`,kept:`${r.shown} of ${r.of}`}:{words:`${r.of} ${a}`}}function E({testId:e,value:r,set:i,label:a,name:o,list:s,children:u}){let g=J("arrange",{align:"start"}),y=(0,h.useRef)(null);return(0,h.useEffect)(()=>{g.open&&y.current?.querySelector('[aria-pressed="true"]')?.focus({preventScroll:!0})},[g.open]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("button",{type:"button",className:"graview-arrange-open","data-testid":e,"data-set":i?"":void 0,value:r,"aria-label":o,...g.trigger,onClick:g.toggle,children:[u,(0,n.jsx)(be,{})]}),g.open?(0,n.jsx)("div",{...g.pane,ref:m=>{g.pane.ref(m),y.current=m},role:"group","aria-label":a,"data-testid":"arrange-list","data-arrange":e,className:"graview-arrange-list",style:V,onKeyDown:ve,children:s(()=>g.setOpen(!1))}):null]})}function ve(e){if(!["ArrowDown","ArrowUp","Home","End"].includes(e.key))return;let r=[...e.currentTarget.querySelectorAll("button:not([disabled]), input")];if(r.length===0)return;let i=r.indexOf(document.activeElement);if(document.activeElement instanceof HTMLInputElement&&document.activeElement.type==="date"&&(e.key==="ArrowUp"||e.key==="ArrowDown"))return;e.preventDefault();let a=e.key==="Home"?0:e.key==="End"?r.length-1:e.key==="ArrowDown"?(i+1)%r.length:(i-1+r.length)%r.length;r[a].focus()}function be(){return(0,n.jsx)("svg",{width:"9",height:"9",viewBox:"0 0 10 10","aria-hidden":"true",focusable:"false",style:{flex:"0 0 auto",opacity:.7},children:(0,n.jsx)("path",{d:"M2 3.5 L5 6.5 L8 3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}var xe=`
|
|
2
|
-
.graview-arrange{container-type:inline-size;box-sizing:border-box;width:100%;min-width:0;max-width:100%}
|
|
3
|
-
.graview-arrange-line{display:flex;flex-wrap:wrap;align-items:center;gap:2px 6px;min-width:0;font-size:.875rem;line-height:1.35;color:var(--graview-ink-muted)}
|
|
4
|
-
.graview-arrange-count{margin-right:2px;color:var(--graview-ink-muted)}
|
|
5
|
-
.graview-arrange-part{display:inline-flex;align-items:center;min-width:0}
|
|
6
|
-
.graview-arrange-count~.graview-arrange-part::before{content:"\xB7" / "";margin-right:6px;color:var(--graview-ink-muted)}
|
|
7
|
-
.graview-arrange-open{display:inline-flex;align-items:center;gap:5px;min-height:28px;min-width:0;max-width:100%;margin:0;padding:0 6px;border:1px solid transparent;border-radius:7px;background:none;box-shadow:none;font:inherit;letter-spacing:normal;text-transform:none;text-align:left;color:var(--graview-ink-muted);cursor:pointer}
|
|
8
|
-
.graview-arrange-open[data-set]{color:var(--graview-ink)}
|
|
9
|
-
.graview-arrange-open:hover,.graview-arrange-open[aria-expanded=true]{border-color:var(--graview-edge);color:var(--graview-ink)}
|
|
10
|
-
.graview-arrange :focus-visible,.graview-arrange-list :focus-visible{outline:2px solid var(--graview-accent);outline-offset:1px}
|
|
11
|
-
.graview-arrange-all{display:none}
|
|
12
|
-
@container (max-width: ${fe-1}px){.graview-arrange-one{display:none}.graview-arrange-all{display:inline-flex}}
|
|
13
|
-
.graview-arrange-token{display:inline-flex;align-items:center;gap:0;min-width:0;min-height:26px;box-sizing:border-box;padding:0 2px 0 10px;border:1px solid var(--graview-edge);border-radius:999px;background:var(--graview-panel);color:var(--graview-ink);overflow-wrap:anywhere}
|
|
14
|
-
.graview-arrange-token button{display:inline-flex;align-items:center;justify-content:center;min-width:24px;min-height:24px;margin:0;padding:0;border:0;border-radius:6px;background:none;font:inherit;line-height:1;color:var(--graview-ink-muted);cursor:pointer}
|
|
15
|
-
.graview-arrange-token button:hover{color:var(--graview-ink);background:color-mix(in srgb,var(--graview-ink) 7%,transparent)}
|
|
16
|
-
.graview-arrange-words-at{display:inline-flex;min-width:0;max-width:100%}
|
|
17
|
-
.graview-arrange-words{box-sizing:border-box;width:min(100%,12rem);min-height:28px;margin:0;padding:0 8px;border:1px solid transparent;border-radius:7px;background:transparent;font:inherit;color:var(--graview-ink)}
|
|
18
|
-
.graview-arrange-words:hover,.graview-arrange-words:focus{border-color:var(--graview-edge)}
|
|
19
|
-
`;function De(e){let r=[];return e.query&&r.push(`\u201C${e.query}\u201D`),e.filter?.length&&r.push(`${e.filter.length} condition${e.filter.length===1?"":"s"}`),e.group&&r.push(`by ${e.group.by}`),e.sort&&r.push(`sorted by ${e.sort.by}`),r.length>0?r.join(" \xB7 "):null}export{Re as a,le as b,ge as c,de as d,ue as e,ce as f,pe as g,fe as h,ye as i,P as j,me as k,Te as l,Ie as m,De as n};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as z,b as Z,e as ee}from"./chunk.7BWT5L2L.js";import{b as M}from"./chunk.VSZQXB4Q.js";import{c as Y}from"./chunk.OZNW5W4Z.js";import{o as C}from"./chunk.KQT7WAQE.js";import{i as v,j as Q,k as X}from"./chunk.3VL5WECB.js";import{d as q,e as J}from"./chunk.JH6MU6TX.js";import{b as G,f as K}from"./chunk.WAFDCOOG.js";import{G as re,R as U,Z as P,_,a as O,aa as R,ya as j}from"./chunk.GFF2FB2J.js";import{Y as E,ba as D}from"./chunk.6V2RG5JG.js";import{b as B}from"./chunk.AJZBJBMO.js";var u=B(re(),1);var ie=j(O(()=>import("./chunk.UDSEJKCY.js"))),te=ie.part((r,a)=>r.drawAppLink(a),{quiet:!0});var e=B(U(),1);function H({nodeId:r,field:a,value:d,stored:s=d,said:m}){let{fields:y,commit:i}=C(r),n=y.find(o=>o.field===a),{store:h}=P(),w=h.graph.getNode(r)?.kind,p=h.schema.definitions.find(o=>o.kind===w),g=D(p,a),f=g.toLowerCase(),k=m??`${g.charAt(0).toUpperCase()}${g.slice(1)}: ${d}`,[t,L]=(0,u.useState)(!1),l=n?.shape.type==="number"?n.shape.amount:void 0,S=l&&s!==""&&Number.isFinite(Number(s))?Q(Number(s),l):s,[c,I]=(0,u.useState)(S),W=(0,u.useRef)(null),F=(0,u.useRef)(null),$=(0,u.useRef)(!1),x=o=>{$.current=o,L(!1)};if((0,u.useEffect)(()=>I(S),[S,t]),(0,u.useEffect)(()=>{t?W.current?.focus():$.current&&($.current=!1,F.current?.focus())},[t]),!n)return(0,e.jsx)("span",{"data-graview-field":a,"data-graview-readonly":"",title:`Read-only \u2014 nothing this app declares changes the ${f}`,style:{color:"var(--graview-ink)",cursor:"default",overflowWrap:"anywhere"},children:d});if(!t)return(0,e.jsx)("button",{ref:F,type:"button","data-graview-field":a,"data-graview-editable":n.mutation,...k===d?{}:{"aria-label":k},title:`${n.title} \u2014 changes the ${f}, and can be undone`,onClick:()=>L(!0),style:{all:"unset",cursor:"text",display:"inline-flex",alignItems:"flex-end",minHeight:24,minWidth:24,maxWidth:"100%",overflowWrap:"anywhere",paddingBottom:1,borderBottom:"1px dashed var(--graview-edge-bright)",color:"var(--graview-ink)"},children:d});let A=(o,{left:b=!1}={})=>{x(!b),!(o===s||o===""||o===void 0)&&i(n,o)};if(!n.takesValue){let o=[n,...n.alternatives];return(0,e.jsx)("span",{role:"group","aria-label":`Change ${E(a).toLowerCase()}`,"data-graview-field":a,style:{display:"inline-flex",gap:6,alignItems:"center",flexWrap:"wrap"},onKeyDown:b=>{b.key==="Escape"&&x(!0)},children:o.map((b,ae)=>(0,e.jsx)("button",{type:"button",ref:ae===0?W:void 0,"data-graview-act":b.mutation,onClick:()=>{x(!0),i(b,void 0)},onBlur:N=>{let V=N.relatedTarget;(!V||!N.currentTarget.parentElement?.contains(V))&&x(!1)},style:{padding:"2px 9px",fontSize:"0.8125rem",borderRadius:999},children:b.title},b.mutation))})}return(0,e.jsxs)("form",{style:{display:"inline-flex",gap:4,maxWidth:"100%"},onSubmit:o=>{o.preventDefault(),A(ne(n,c))},children:[n.shape.type==="choice"?(0,e.jsx)("select",{ref:W,"aria-label":E(a),"data-graview-field":a,value:c,onChange:o=>A(o.target.value),onBlur:()=>x(!1),style:{font:"inherit",fontSize:"inherit"},children:n.shape.options.map(o=>(0,e.jsx)("option",{value:o,children:G(p,a,o)},o))}):(0,e.jsxs)(e.Fragment,{children:[l&&v(l).prefix?(0,e.jsx)("span",{"aria-hidden":"true",children:v(l).prefix}):null,(0,e.jsx)("input",{ref:W,"aria-label":l?`${E(a)}, ${v(l).hint}`:E(a),"data-graview-field":a,...l?{inputMode:"decimal",placeholder:v(l).placeholder,"data-graview-amount":l.format??"unit"}:{},type:l?"text":n.shape.type==="number"&&!n.shape.duration?"number":n.shape.type==="date"?n.shape.time?"datetime-local":"date":"text",...n.shape.type==="number"&&n.shape.duration?{placeholder:"1h 30m"}:{},...n.shape.type==="text"&&n.shape.holds==="phone"?{inputMode:"tel",autoComplete:"tel"}:{},...n.shape.type==="number"&&n.shape.min!==void 0&&!l?{min:n.shape.min}:{},...n.shape.type==="number"&&n.shape.max!==void 0&&!l?{max:n.shape.max}:{},...n.shape.type==="number"&&n.shape.step!==void 0&&!l?{step:n.shape.step}:{},value:c,onChange:o=>I(o.target.value),onBlur:()=>A(ne(n,c),{left:!0}),onKeyDown:o=>{o.key==="Escape"&&x(!0)},style:{font:"inherit",fontSize:"inherit",width:`min(${Math.max(6,c.length+1)}ch, 100%)`,maxWidth:"100%",minWidth:0,boxSizing:"border-box",minHeight:24,display:"inline-flex",alignItems:"center",padding:"0 3px"}}),l&&v(l).suffix?(0,e.jsx)("span",{"aria-hidden":"true",children:v(l).suffix}):null]}),n.open.length>0?(0,e.jsxs)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:["also needs ",n.open.map(o=>o.name).join(", ")]}):null]})}function ne(r,a){return r.shape.type==="number"&&r.shape.amount?X(a,r.shape.amount):r.shape.type==="number"?r.shape.duration?K(a)??a:Number(a):r.shape.type==="text"&&r.shape.holds?a.trim():a}function oe({href:r,field:a,value:d,stored:s,nodeId:m}){let y=r.startsWith("tel:"),i=(n,h)=>(0,e.jsx)("a",{href:r,"data-graview-link":a,...h?{"aria-label":h}:{},...y?{}:{target:"_blank",rel:"noopener noreferrer"},style:{display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,maxWidth:"100%",overflowWrap:"anywhere",color:"var(--graview-accent)"},children:n});return m===void 0?i(d):(0,e.jsxs)("span",{style:{display:"inline-flex",flexWrap:"wrap",alignItems:"center",gap:"0 10px",maxWidth:"100%"},children:[(0,e.jsx)(H,{nodeId:m,field:a,value:d,...s===void 0?{}:{stored:s}}),i(y?"Call":"Map",y?`Call ${d}`:`Open ${d} in maps`)]})}function We({id:r,hide:a=[],limit:d=10,labels:s={},shown:m=[]}){let{store:y}=P(),i=R(r);if(!i)return null;let n=y.schema.tryDefinition(i.kind),h=q(i,n,{limit:d,said:m}).filter(p=>!a.includes(p.key)),w=Y(n).length>0;return h.length===0&&!w?null:(0,e.jsxs)("div",{"data-graview-fields":i.id,style:{display:"grid",gap:14,alignContent:"start",minWidth:0,fontSize:"0.875rem"},children:[J(n,h).map((p,g)=>{let f=(0,e.jsx)("dl",{style:{margin:0,display:"grid",gridTemplateColumns:"auto 1fr",gap:"5px 16px",alignContent:"start",minWidth:0},children:p.fields.map(t=>t.files?(0,e.jsx)(z,{as:"field",nodeId:i.id,field:t.key,label:s[t.key]??t.label,files:t.files,labelStyle:T,style:{marginTop:6}},t.key):t.long?(0,e.jsx)(le,{nodeId:i.id,field:t.key,label:s[t.key]??t.label,value:t.value,markdown:t.markdown,labelStyle:T,style:{gridColumn:"1 / -1",marginTop:6}},t.key):(0,e.jsxs)("div",{style:{display:"contents"},children:[(0,e.jsx)("dt",{style:{...T,whiteSpace:"nowrap"},children:s[t.key]??t.label}),(0,e.jsxs)("dd",{style:{margin:0,minWidth:0},children:[t.linked?(0,e.jsx)(Z,{relation:t.linked.relation,refs:t.linked.refs,nodeId:i.id,field:t.key}):t.app?(0,e.jsx)(te,{address:t.app,as:"record",nodeId:i.id,field:t.key}):t.href?(0,e.jsx)(oe,{href:t.href,field:t.key,value:t.value,stored:t.stored,nodeId:i.id}):(0,e.jsx)(H,{nodeId:i.id,field:t.key,value:t.value,stored:t.stored}),t.repeats?(0,e.jsx)(ee,{nodeId:i.id,field:t.key,start:i[t.key],value:i[`${t.key}Repeat`],label:`${s[t.key]??t.label} repeats`}):null]})]},t.key))});if(!p.title)return(0,e.jsx)("div",{children:f},g);let k=`graview-field-group-${i.id}-${g}`;return(0,e.jsxs)("div",{role:"group","aria-labelledby":k,style:{display:"grid",gap:6,minWidth:0},children:[(0,e.jsx)("p",{id:k,"data-graview-field-group":p.title,style:se,children:p.title}),f]},g)}),w?(0,e.jsx)(z,{as:"unfilled",nodeId:i.id,skip:a,labels:s,labelStyle:T}):null]})}var T={color:"var(--graview-ink-faint)",fontSize:"0.8125rem"},se={margin:0,fontSize:"0.75rem",letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--graview-ink-muted)",fontWeight:560};function le(r){return _()?(0,e.jsx)(pe,{...r}):(0,e.jsx)(de,{...r})}function de({field:r,label:a,value:d,labelStyle:s,valueStyle:m,style:y,markdown:i}){return(0,e.jsxs)("div",{"data-graview-long":r,style:{display:"grid",gap:6,minWidth:0,...y},children:[(0,e.jsx)("dt",{style:s,children:a}),(0,e.jsx)("dd",{style:{margin:0,minWidth:0,...m},children:(0,e.jsx)("div",{"data-graview-field":r,children:(0,e.jsx)(M,{text:d,markdown:i})})})]})}function pe({nodeId:r,field:a,label:d,value:s,labelStyle:m,valueStyle:y,style:i,markdown:n}){let{fields:h,commit:w}=C(r),p=h.find(c=>c.field===a&&c.takesValue),[g,f]=(0,u.useState)(!1),k=(0,u.useRef)(null),t=(0,u.useRef)(!1);(0,u.useEffect)(()=>{!g&&t.current&&(t.current=!1,k.current?.focus())},[g]);let L=c=>{t.current=c,f(!1)},l=d.toLowerCase(),S=(0,e.jsx)(M,{text:s,markdown:n});return(0,e.jsxs)("div",{"data-graview-long":a,style:{display:"grid",gap:6,minWidth:0,...i},children:[(0,e.jsxs)("dt",{style:{display:"flex",alignItems:"baseline",gap:10,...m},children:[(0,e.jsx)("span",{children:d}),p&&!g?(0,e.jsx)("button",{ref:k,type:"button","data-graview-editable":p.mutation,"aria-label":`Edit the ${l}`,title:`${p.title} \u2014 changes the ${l}, and can be undone`,onClick:()=>f(!0),style:me,children:"Edit"}):null]}),(0,e.jsx)("dd",{style:{margin:0,minWidth:0,...y},children:g&&p?(0,e.jsx)(u.Suspense,{fallback:S,children:(0,e.jsx)(ue,{field:a,label:d,value:s,...n?{markdown:!0}:{},onCancel:()=>L(!0),onSave:(c,I)=>{L(!I),c!==s&&w(p,c)}})}):(0,e.jsx)("div",{"data-graview-field":a,...p?{}:{"data-graview-readonly":"",title:`Read-only \u2014 nothing this app declares changes the ${l}`},...p?{onClick:()=>f(!0)}:{},style:{cursor:p?"text":"default",minWidth:0},children:S})})]})}var ue=(0,u.lazy)(()=>import("./chunk.FWCOJDOD.js")),me={all:"unset",cursor:"pointer",fontSize:"0.75rem",letterSpacing:"normal",textTransform:"none",color:"var(--graview-accent)",borderBottom:"1px dashed currentColor",minHeight:24,minWidth:24,display:"inline-flex",alignItems:"flex-end"};function Ce({nodeId:r,children:a}){let{fields:d}=C(r),s=R(r);if(!s)return(0,e.jsx)(e.Fragment,{children:a});let m=d.find(y=>{let i=s[y.field];return typeof i=="string"&&i===a});return m?(0,e.jsx)(H,{nodeId:r,field:m.field,value:a,said:a}):(0,e.jsx)(e.Fragment,{children:a})}export{te as a,H as b,oe as c,We as d,le as e,Ce as f};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as L}from"./chunk.KN3ULTGF.js";import{a as R,b as O,c as v,d as P}from"./chunk.UGFDSE37.js";import"./chunk.R26DREVU.js";import"./chunk.FGVKJWNS.js";import"./chunk.YV2LJFGS.js";import"./chunk.QNGWEV47.js";import"./chunk.ERXSYPYL.js";import"./chunk.J2ITFGN3.js";import"./chunk.V5ZYUVMH.js";import"./chunk.GLBHQFJ2.js";import"./chunk.QTA4ROAK.js";import"./chunk.2CIBWZJG.js";import{a as E,b as T}from"./chunk.MB7LKKUD.js";import"./chunk.RRVIXV7W.js";import"./chunk.7BWT5L2L.js";import"./chunk.VSZQXB4Q.js";import"./chunk.RI3PYG5T.js";import"./chunk.UWGWXFWZ.js";import"./chunk.SE5SKFQH.js";import"./chunk.W3S6UXNA.js";import"./chunk.WVUJXDXZ.js";import"./chunk.OZNW5W4Z.js";import"./chunk.NDADLJE6.js";import"./chunk.AK3IHFCF.js";import"./chunk.HHPGWJDO.js";import"./chunk.42YX6NOY.js";import"./chunk.EYZ7MHBZ.js";import"./chunk.KQT7WAQE.js";import"./chunk.PAVR5TK5.js";import"./chunk.OQDETV4X.js";import"./chunk.3VL5WECB.js";import"./chunk.JH6MU6TX.js";import"./chunk.WAFDCOOG.js";import"./chunk.L4DECHXR.js";import{G as D,R as C,ua as x}from"./chunk.GFF2FB2J.js";import{dc as k}from"./chunk.6V2RG5JG.js";import{b as S}from"./chunk.AJZBJBMO.js";var o=S(D(),1);var i=S(C(),1);function W(c){let e=document.activeElement;if(e!==null&&e!==document.body&&e!==document.documentElement&&e.isConnected)return;let r=c??document,a=r.querySelector("main")??r.querySelector("[data-graview-page]")??null,n=r.querySelector("[data-graview-page-title]")??a?.querySelector("h1, h2")??a;n instanceof HTMLElement&&(n.hasAttribute("tabindex")||n.setAttribute("tabindex","-1"),n.focus({preventScroll:!0}))}var H=1500;function z(c,e,r){let{store:a,principal:n}=c,u=L(a),l=(0,o.useMemo)(()=>R(a,n),[a,n,u]),b=(0,o.useRef)(r),[p,m]=(0,o.useState)(),[s,f]=(0,o.useState)("");(0,o.useEffect)(()=>{let t=O(a,n,b.current);b.current=a.batches().length,t&&(m({batch:t.batch,at:e,when:Date.now()}),f(""))},[a,n,u]),(0,o.useEffect)(()=>{m(t=>!t||t.at===e?t:Date.now()-t.when<H?{...t,at:e}:void 0)},[e]);let[g,h]=(0,o.useState)(null),y=(0,o.useCallback)(()=>{m(void 0),h(null)},[]),w=(0,o.useCallback)(()=>{h(null);try{let t=P(a,n);t&&f(`Took back \u201C${t.intent}\u201D`)}catch(t){h(t instanceof Error?t.message:String(t))}},[a,n]),d=l&&p?.batch===l.batch&&p.at===e?l:void 0;return{change:l,offered:d,close:y,takeBack:w,refused:g,said:s}}function Y({context:c,docked:e,at:r,since:a}){let{change:n,offered:u,close:l,takeBack:b,refused:p,said:m}=z(c,r,a),s=e?u:n,f=(0,o.useRef)(null),g=e&&(s!==void 0||p!==null);B(f,g),(0,o.useEffect)(()=>{if(!g)return;let d,t=()=>d=setTimeout(()=>f.current?.matches(":hover, :focus-within")?t():l(),1e4);return t(),()=>clearTimeout(d)},[g,s?.batch,p,l]);let h=m||(e&&s?v(s):""),y=e?{position:"fixed",inset:"auto",margin:0,padding:0,border:"none",background:"none",overflow:"visible",zIndex:k("toast"),width:"max-content",height:"auto",bottom:"calc(16px + env(safe-area-inset-bottom, 0px))",left:16,justifyItems:"start",color:"var(--graview-ink)",...g?{}:{display:"none"}}:{},w=s?(0,i.jsxs)("button",{type:"button","data-testid":"page-undo",title:`${v(s)} \u2014 \u2318Z or Ctrl+Z`,"aria-keyshortcuts":"Meta+Z Control+Z",onClick:d=>{let t=d.currentTarget.closest("[data-graview-face]");b(),requestAnimationFrame(()=>W(t))},style:e?I:A,children:[(0,i.jsx)("span",{"aria-hidden":"true",children:"\u21B6"}),(0,i.jsx)("span",{style:e?j:F,children:v(s)})]}):null;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{role:"status","aria-live":"polite",style:N,children:h}),(0,i.jsxs)("div",{ref:f,...e?{popover:"manual","data-graview-foot":"","data-graview-offstage":""}:{},"data-testid":e?"face-undo-dock":"page-undo-place",style:{display:"grid",justifyItems:"end",gap:4,maxWidth:"100%",minWidth:0,...y},children:[e&&s?(0,i.jsxs)("div",{"data-testid":"page-undo-notice",style:_,children:[w,(0,i.jsx)("button",{type:"button","data-testid":"page-undo-dismiss","aria-label":`Dismiss: ${v(s)}`,title:"Dismiss",onClick:d=>{let t=d.currentTarget.closest("[data-graview-face]");l(),requestAnimationFrame(()=>W(t))},style:q,children:"\xD7"})]}):w,p?(0,i.jsx)("span",{"data-testid":"page-undo-refused",role:"alert",style:{fontSize:"0.8125rem",lineHeight:1.4,color:"var(--graview-warn)",background:e?"var(--graview-float)":void 0,padding:e?"4px 8px":void 0,borderRadius:6},children:p}):null]})]})}function B(c,e){(0,o.useLayoutEffect)(()=>{let r=c.current;if(!r||!e)return;if(typeof r.showPopover=="function"&&!x(r))try{r.showPopover()}catch{}let a=()=>r.parentElement?.closest("[data-embed-content]")??null,n=()=>{T(r,a()),dispatchEvent(new Event(E))};n(),addEventListener("resize",n),addEventListener("scroll",n,!0);let u=typeof ResizeObserver=="function"?new ResizeObserver(n):null;return u?.observe(r),()=>{if(u?.disconnect(),removeEventListener("resize",n),removeEventListener("scroll",n,!0),r.isConnected&&x(r))try{r.hidePopover()}catch{}dispatchEvent(new Event(E))}},[c,e])}var A={display:"inline-flex",alignItems:"center",gap:6,minHeight:36,maxWidth:"100%",minWidth:0,padding:"0 14px",borderRadius:999,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",color:"var(--graview-ink)",font:"inherit",fontSize:"0.875rem",cursor:"pointer"},I={...A,textAlign:"start",lineHeight:1.4,padding:"8px 4px 8px 14px",border:"none",background:"none",color:"inherit"},_={display:"flex",alignItems:"center",gap:2,maxWidth:"100%",minWidth:0,paddingRight:6,borderRadius:"var(--graview-radius, 12px)",border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},q={flex:"0 0 auto",minWidth:28,minHeight:28,padding:0,border:"none",background:"none",boxShadow:"none",color:"var(--graview-ink-muted)",font:"inherit",fontSize:"1rem",cursor:"pointer"},F={minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},j={minWidth:0,overflow:"hidden",overflowWrap:"anywhere",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:4},N={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};export{Y as TakeBack};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as H,b as I,c as j,e as R,h as V,i as D,j as A,k,l as x,n as Y,o as Z}from"./chunk.W3S6UXNA.js";import{b as U}from"./chunk.JH6MU6TX.js";import{G as C,J as G,Ja as T,Ma as B,P as M,W,Y as F}from"./chunk.6V2RG5JG.js";function re(e,r){return e===void 0||e===!0?!0:e===!1?!1:e[r]!==!1}function te(e){let r={};return e.query&&e.query.trim().length>0&&(r.q=e.query),e.archived!==void 0&&e.archived!==!1&&(r.archived=String(e.archived)),e.sort&&(r.sort=e.sort.direction==="desc"?`${e.sort.by}:desc`:e.sort.by),e.filter?.length&&(r.filter=e.filter.map(n=>`${n.key}:${n.value}`).join(",")),e.group&&(r.group=e.group.bucket?`${e.group.by}:${e.group.bucket}`:e.group.by),r}function ne(e,r){let n=[],s={};if(e.query&&(s.query=e.query),e.archived!==void 0&&e.archived!==!1&&(s.archived=e.archived),e.sort&&(r.sorts.some(u=>u.key===e.sort.by)?s.sort=e.sort:n.push(`sort ${e.sort.by}`)),e.filter){let u=e.filter.filter(c=>r.filters.find(l=>l.key===c.key)?!0:(n.push(`filter ${c.key}`),!1));u.length>0&&(s.filter=u)}return e.group&&(r.groups.some(u=>u.key===e.group.by)?s.group=e.group:n.push(`group ${e.group.by}`)),{arrangement:s,dropped:n}}function S(e,r){return W(e.schema.tryDefinition(r.kind),A(r))}var oe=(e,r)=>e==null?r==null?0:1:r==null?-1:typeof e=="number"&&typeof r=="number"?e-r:typeof e=="boolean"&&typeof r=="boolean"?e===r?0:e?1:-1:String(e).localeCompare(String(r),void 0,{numeric:!0,sensitivity:"base"});function ie(e,r,n){if(n==="label")return S(e,r);let s=e.schema.tryDefinition(r.kind);return s&&n in(s.fields.shape??{})?T(D(r),n,e.today??C()):s?.computed?.[n]!==void 0?e.read?.(r,n):k(e.graph,r.id,n).map(c=>S(e,c)).sort()[0]}var se=/^(\d{4})-(\d{2})-(\d{2})/;function _(e,r){let n=se.exec(e);if(!n)return;let[,s,u,c]=n;if(r==="day")return`${s}-${u}-${c}`;if(r==="month")return`${s}-${u}-01`;if(r==="year")return`${s}-01-01`;if(r==="decade")return`${String(Number(s)-Number(s)%10).padStart(4,"0")}-01-01`;let a=new Date(Date.UTC(Number(s),Number(u)-1,Number(c))),l=(a.getUTCDay()+6)%7;return a.setUTCDate(a.getUTCDate()-l),a.toISOString().slice(0,10)}function de(e,r){return r==="month"?M(e):r==="week"?`Week of ${G(e)}`:r==="year"?e.slice(0,4):r==="decade"?`The ${e.slice(0,4)}s`:G(e)}function ue(e,r,n){return z(e,n)(r)}function z(e,r){let{words:n,conditions:s}=Y(r);if(n.length===0&&s.length===0)return()=>!0;let u=new Map,c=a=>{let l=u.get(a);return l||(l=new Set(R(e.schema,a).filters.map(d=>d.key)),u.set(a,l)),l};return a=>{let l=c(a.kind),d=s.filter(i=>l.has(i.key));return d.every(i=>x(e,a,i))?n.length>0?Z(e.schema.tryDefinition(a.kind),A(a),n)!==void 0:d.length>0:!1}}function ae(e,r,n){let s=r.query?.trim(),u=r.archived===void 0?e:e.filter(t=>B(t,r.archived)),c=s?u.filter(z(n,s)):u,a=r.filter?.length?c.filter(t=>r.filter.every(f=>x(n,t,f))):[...c],l=[];for(let t=r.sort;t&&l.length<4;t=t.then)l.push(t);let d=l.length>0?a.map((t,f)=>({node:t,index:f,values:l.map(o=>ie(n,t,o.by))})).sort((t,f)=>{for(let[o,p]of l.entries()){let[h,K]=[t.values[o],f.values[o]],v=oe(h,K),E=p.direction==="desc"&&v!==0&&h!==void 0&&K!==void 0?-v:v;if(E!==0)return E}return t.index-f.index}).map(t=>t.node):a,i=r.group;if(!i)return{nodes:d,groups:[{key:"",label:"",nodes:d}],grouped:!1};let y=new Map,g=(t,f,o)=>{let p=y.get(t)??{label:f,nodes:[]};p.nodes.push(o),y.set(t,p)},N=d[0],m=N?n.schema.tryDefinition(N.kind):void 0,O=m?.fields.shape??{},J=m?H(m,i.by):F(i.by),$=i.by in O,b=$?I(O[i.by]):void 0,X=j(n.schema,N?.kind??"").find(t=>t.key===i.by)?.label,L=$?`No ${J.toLowerCase()}`:`Without ${(X??F(i.by)).toLowerCase()}`,q=$?new Map:U([...new Map(d.flatMap(t=>k(n.graph,t.id,i.by)).map(t=>[t.id,t])).values()].map(A),t=>n.schema.tryDefinition(t));for(let t of d){if($){let o=T(D(t),i.by,n.today??C());if(o==null||o==="")g("",L,t);else if(b==="date"){let p=i.bucket??"day",h=_(String(o),p);h?g(h,de(h,p),t):g("",L,t)}else if(b==="boolean")g(o?"1":"0",o?"Yes":"No",t);else{let p=m?.display?.format?.[i.by];g(String(o),p?p(o):String(o),t)}continue}let f=k(n.graph,t.id,i.by).map(o=>({id:o.id,label:q.has(o.id)?`${S(n,o)} \xB7 ${q.get(o.id)}`:S(n,o)})).sort((o,p)=>o.label.localeCompare(p.label));f.length===0?g("",L,t):g(f.map(o=>o.id).join(","),f.map(o=>o.label).join(", "),t)}let w=b==="choice"?V(O[i.by]):void 0,ee=[...y.entries()].sort(([t,f],[o,p])=>t===""?1:o===""?-1:w?w.indexOf(t)-w.indexOf(o):b==="boolean"?o.localeCompare(t):b==="date"?t.localeCompare(o):f.label.localeCompare(p.label)).map(([t,f])=>({key:t,label:f.label,nodes:f.nodes}));return{nodes:d,groups:ee,grouped:!0}}function P(e){if(e===void 0)return;if(typeof e=="string")return{by:e,direction:"asc"};let r=e.then===void 0?void 0:typeof e.then=="string"?{by:e.then,direction:"asc"}:{by:e.then.by,direction:e.then.direction??"asc"};return{by:e.by,direction:e.direction??"asc",...r?{then:r}:{}}}function Q(e){if(e!==void 0)return typeof e=="string"?{by:e}:e}function le(e){let r=P(e?.sort),n=Q(e?.group);if(!(!r&&!n))return{...r?{sort:r}:{},...n?{group:{by:n.by}}:{}}}var fe=(e,r)=>r?e==="1"?"true":"false":e;function ce(e,r,n){let s=n.type==="boolean",u=s?["true","false"]:n.options??[],c=[...new Set([...(r.order??[]).filter(d=>u.includes(d)),...u])],a=r.closed??[],l=d=>{if(d.key==="")return[1,0];let i=fe(d.key,s);if(a.includes(i))return[2,a.indexOf(i)];let y=c.indexOf(i);return[0,y<0?c.length:y]};return e.map((d,i)=>({group:d,at:i,rank:l(d)})).sort((d,i)=>d.rank[0]-i.rank[0]||d.rank[1]-i.rank[1]||d.at-i.at).map(({group:d,rank:i})=>({...d,closed:i[0]===2}))}export{Q as a,le as b,ce as c,re as d,te as e,ne as f,ue as g,ae as h};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import{a as bt,c as Et,d as te}from"./chunk.KN3ULTGF.js";import{h as St}from"./chunk.R26DREVU.js";import{a as dt}from"./chunk.QTA4ROAK.js";import{a as Cr}from"./chunk.UZWWDAGM.js";import{d as ht}from"./chunk.JH6MU6TX.js";import{d as ft}from"./chunk.WAFDCOOG.js";import{d as ct,i as mt,j as pt,m as yt,n as gt,o as vt,x as Rt,y as wt}from"./chunk.L4DECHXR.js";import{G as M,O as st,R as X,_ as ut}from"./chunk.GFF2FB2J.js";import{$ as ie,Ka as qe,Nc as ot,Oc as it,Pc as lt,Tb as et,Y as Se,cc as tt,xc as rt,yc as at,zc as nt}from"./chunk.6V2RG5JG.js";import{b as D}from"./chunk.AJZBJBMO.js";function Lr(e,t){return rt(e,t).slice(1)}function be(e,t){return e.kinds.find(r=>Lr(e,r)===t)}function vn(e,t,r){return at(e,t,r)}function Rn(e,t){return nt(e,t)}var A=D(M(),1),g=D(M(),1),E=D(M(),1),je=D(M(),1),or=D(M(),1),b=D(M(),1),Ga=D(M(),1),Xa=D(M(),1),Qa=D(M(),1),v=D(M(),1),gr=D(M(),1);var ke=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Nt=/^[\\/]{2}/;function Dr(e,t){return t+e.replace(/\\/g,"/")}var xt="popstate";function de(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function Ot(e={}){let{initialEntries:t=["/"],initialIndex:r,v5Compat:a=!1}=e,n;n=t.map((f,y)=>c(f,typeof f=="string"?null:f.state,y===0?"default":void 0,typeof f=="string"?void 0:f.mask));let o=s(r??n.length-1),i="POP",l=null;function s(f){return Math.min(Math.max(f,0),n.length-1)}function u(){return n[o]}function c(f,y=null,m,h){let S=fe(n?u().pathname:"/",f,y,m,h);return N(S.pathname.charAt(0)==="/",`relative pathnames are not supported in memory history: ${JSON.stringify(f)}`),S}function d(f){return typeof f=="string"?f:j(f)}return{get index(){return o},get action(){return i},get location(){return u()},createHref:d,createURL(f){return new URL(d(f),"http://localhost")},encodeLocation(f){let y=typeof f=="string"?B(f):f;return{pathname:y.pathname||"",search:y.search||"",hash:y.hash||""}},push(f,y){i="PUSH";let m=de(f)?f:c(f,y);o+=1,n.splice(o,n.length,m),a&&l&&l({action:i,location:m,delta:1})},replace(f,y){i="REPLACE";let m=de(f)?f:c(f,y);n[o]=m,a&&l&&l({action:i,location:m,delta:0})},go(f){i="POP";let y=s(o+f),m=n[y];o=y,l&&l({action:i,location:m,delta:f})},listen(f){return l=f,()=>{l=null}}}}function Mt(e={}){function t(a,n){let o=n.state?.masked,{pathname:i,search:l,hash:s}=o||a.location;return fe("",{pathname:i,search:l,hash:s},n.state&&n.state.usr||null,n.state&&n.state.key||"default",o?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function r(a,n){return typeof n=="string"?n:j(n)}return kr(t,r,null,e)}function P(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function N(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Fr(){return Math.random().toString(36).substring(2,10)}function Pt(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function fe(e,t,r=null,a,n){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?B(t):t,state:r,key:t&&t.key||a||Fr(),mask:n}}function j({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function B(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function kr(e,t,r,a={}){let{window:n=document.defaultView,v5Compat:o=!1}=a,i=n.history,l="POP",s=null,u=c();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function c(){return(i.state||{idx:null}).idx}function d(){l="POP";let h=c(),S=h==null?null:h-u;u=h,s&&s({action:l,location:m.location,delta:S})}function p(h,S){l="PUSH";let R=de(h)?h:fe(m.location,h,S);r&&r(R,h),u=c()+1;let w=Pt(R,u),x=m.createHref(R.mask||R);try{i.pushState(w,"",x)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;n.location.assign(x)}o&&s&&s({action:l,location:m.location,delta:1})}function f(h,S){l="REPLACE";let R=de(h)?h:fe(m.location,h,S);r&&r(R,h),u=c();let w=Pt(R,u),x=m.createHref(R.mask||R);i.replaceState(w,"",x),o&&s&&s({action:l,location:m.location,delta:0})}function y(h){return Tr(n,h)}let m={get action(){return l},get location(){return e(n,i)},listen(h){if(s)throw new Error("A history only accepts one active listener");return n.addEventListener(xt,d),s=h,()=>{n.removeEventListener(xt,d),s=null}},createHref(h){return t(n,h)},createURL:y,encodeLocation(h){let S=y(h);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:p,replace:f,go(h){return i.go(h)}};return m}function Tr(e,t,r=!1){let a="http://localhost";e&&(a=e.location.origin!=="null"?e.location.origin:e.location.href),P(a,"No window.location.(origin|href) available to create URL");let n=typeof t=="string"?t:j(t);return n=n.replace(/ $/,"%20"),!r&&Nt.test(n)&&(n=a+n),new URL(n,a)}var Nr;Nr=new WeakMap;function Te(e,t,r="/"){return Or(e,t,r,!1)}function Or(e,t,r,a,n){let o=typeof t=="string"?B(t):t,i=H(o.pathname||"/",r);if(i==null)return null;let l=n??Ar(e),s=null,u=Vr(i);for(let c=0;s==null&&c<l.length;++c)s=Yr(l[c],u,a);return s}function Mr(e,t){let{route:r,pathname:a,params:n}=e;return{id:r.id,pathname:a,params:n,data:t[r.id],loaderData:t[r.id],handle:r.handle}}function Ar(e){let t=At(e);return _r(t),t}function At(e,t=[],r=[],a="",n=!1){let o=(i,l,s=n,u)=>{let c={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};if(c.relativePath.startsWith("/")){if(!c.relativePath.startsWith(a)&&s)return;P(c.relativePath.startsWith(a),`Absolute route path "${c.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(a.length)}let d=$([a,c.relativePath]),p=r.concat(c);i.children&&i.children.length>0&&(P(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),At(i.children,t,p,d,s)),!(i.path==null&&!i.index)&&t.push({path:d,score:Br(d,i.index),routesMeta:p.map((f,y)=>{let[m,h]=It(f.relativePath,f.caseSensitive,y===p.length-1);return{...f,matcher:m,compiledParams:h}})})};return e.forEach((i,l)=>{if(i.path===""||!i.path?.includes("?"))o(i,l);else for(let s of _t(i.path))o(i,l,!0,s)}),t}function _t(e){let t=e.split("/");if(t.length===0)return[];let[r,...a]=t,n=r.endsWith("?"),o=r.replace(/\?$/,"");if(a.length===0)return n?[o,""]:[o];let i=_t(a.join("/")),l=[];return l.push(...i.map(s=>s===""?o:[o,s].join("/"))),n&&l.push(...i),l.map(s=>e.startsWith("/")&&s===""?"/":s)}function _r(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Wr(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var $r=/^:[\w-]+$/,Ir=3,Hr=2,Ur=1,jr=10,zr=-2,Ct=e=>e==="*";function Br(e,t){let r=e.split("/"),a=r.length;return r.some(Ct)&&(a+=zr),t&&(a+=Hr),r.filter(n=>!Ct(n)).reduce((n,o)=>n+($r.test(o)?Ir:o===""?Ur:jr),a)}function Wr(e,t){return e.length===t.length&&e.slice(0,-1).every((a,n)=>a===t[n])?e[e.length-1]-t[t.length-1]:0}function Yr(e,t,r=!1){let{routesMeta:a}=e,n={},o="/",i=[];for(let l=0;l<a.length;++l){let s=a[l],u=l===a.length-1,c=o==="/"?t:t.slice(o.length)||"/",d={path:s.relativePath,caseSensitive:s.caseSensitive,end:u},p=s.matcher&&s.compiledParams?$t(d,c,s.matcher,s.compiledParams):ae(d,c),f=s.route;if(!p&&u&&r&&!a[a.length-1].route.index&&(p=ae({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},c)),!p)return null;Object.assign(n,p.params),i.push({params:n,pathname:$([o,p.pathname]),pathnameBase:Kr($([o,p.pathnameBase])),route:f}),p.pathnameBase!=="/"&&(o=$([o,p.pathnameBase]))}return i}function ae(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=It(e.path,e.caseSensitive,e.end);return $t(e,t,r,a)}function $t(e,t,r,a){let n=t.match(r);if(!n)return null;let o=n[0],i=Q(o,1),l=n.slice(1);return{params:a.reduce((u,{paramName:c,isOptional:d},p)=>{if(c==="*"){let y=l[p]||"";i=Q(o.slice(0,o.length-y.length),1)}let f=l[p];return d&&!f?u[c]=void 0:u[c]=(f||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function It(e,t=!1,r=!0){N(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],n="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,l,s,u,c)=>{if(a.push({paramName:l,isOptional:s!=null}),s){let d=c.charAt(u+i.length);return d&&d!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),n+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?n+="\\/*$":e!==""&&e!=="/"&&(n+="(?:(?=\\/|$))"),[new RegExp(n,t?void 0:"i"),a]}function Vr(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return N(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function H(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}function Ht(e,t="/"){let{pathname:r,search:a="",hash:n=""}=typeof e=="string"?B(e):e,o;return r?(r=Ut(r),r.startsWith("/")||r.startsWith("\\")?o=Lt(r.substring(1),"/"):o=Lt(r,t)):o=t,{pathname:o,search:Gr(a),hash:Xr(n)}}function Lt(e,t){let r=Q(t).split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}function Ee(e,t,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Jr(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Ne(e){let t=Jr(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function pe(e,t,r,a=!1){let n;typeof e=="string"?n=B(e):(n={...e},P(!n.pathname||!n.pathname.includes("?"),Ee("?","pathname","search",n)),P(!n.pathname||!n.pathname.includes("#"),Ee("#","pathname","hash",n)),P(!n.search||!n.search.includes("#"),Ee("#","search","hash",n)));let o=e===""||n.pathname==="",i=o?"/":n.pathname,l;if(i==null)l=r;else{let d=t.length-1;if(!a&&i.startsWith("..")){let p=i.split("/");for(;p[0]==="..";)p.shift(),d-=1;n.pathname=p.join("/")}l=d>=0?t[d]:"/"}let s=Ht(n,l),u=i&&i!=="/"&&i.endsWith("/"),c=(o||i===".")&&r.endsWith("/");return!s.pathname.endsWith("/")&&(u||c)&&(s.pathname+="/"),s}var Ut=e=>e.replace(/[\\/]{2,}/g,"/"),$=e=>Ut(e.join("/"));function Q(e,t=0){let r=e.length;for(;r>t&&e.charCodeAt(r-1)===47;)r--;return r===e.length?e:e.slice(0,r)}var Kr=e=>Q(e).replace(/^\/*/,"/"),Gr=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Xr=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;var jt=class{constructor(e,t,r,a=!1){this.status=e,this.statusText=t||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function zt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Qr(e){let t=e.map(r=>r.route.path).filter(Boolean);return $(t)||"/"}var Bt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Wt(e,t){let r=e;if(typeof r!="string"||!ke.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,n=!1;if(Bt)try{let o=new URL(window.location.href),i=Nt.test(r)?new URL(Dr(r,o.protocol)):new URL(r),l=H(i.pathname,t);i.origin===o.origin&&l!=null?r=l+i.search+i.hash:n=!0}catch{N(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:n,to:r}}var Sn=Symbol("Uninstrumented");var bn=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Dt=new URL("http://localhost");function Oe(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),Dt)}catch{return Dt}}function xe(e,t){return e.origin===t.origin&&(e.origin!=="null"||e.protocol===t.protocol&&e.host===t.host)}function Zr(e,t){if(e.startsWith("//"))return!0;let r=t.protocol.toLowerCase();return e.toLowerCase().startsWith(r)?t.host===""||e.slice(r.length).startsWith("//"):!1}function Me(e,t,r,a){let n=null;try{n=e==null?null:new URL(e,r)}catch{}let o=new URL(t,r),i=n!=null&&!xe(n,r),l=!xe(o,r);if(a==="reject"){if(i||l)throw new Error("External navigation is not allowed")}else if(l&&(n==null||!Zr(e,n)||!xe(n,o)))throw new Error("External navigation is not allowed")}var Yt=["POST","PUT","PATCH","DELETE"],En=new Set(Yt),qr=["GET",...Yt],xn=new Set(qr);var Pn=Symbol("ResetLoaderData"),ea,ta,ra,aa;ea=new WeakMap;ta=new WeakMap;ra=new WeakMap;aa=new WeakMap;var na=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function oa(e){try{return na.includes(new URL(e).protocol)}catch{return!1}}var Y=A.createContext(null);Y.displayName="DataRouter";var Z=A.createContext(null);Z.displayName="DataRouterState";var Vt=A.createContext(!1);function ia(){return A.useContext(Vt)}var Ae=A.createContext({isTransitioning:!1});Ae.displayName="ViewTransition";var Jt=A.createContext(new Map);Jt.displayName="Fetchers";var la=A.createContext(null);la.displayName="Await";var T=A.createContext(null);T.displayName="Navigation";var V=A.createContext(null);V.displayName="Location";var _=A.createContext({outlet:null,matches:[],isDataRoute:!1});_.displayName="Route";var _e=A.createContext(null);_e.displayName="RouteError";var Le=!0,Kt="REACT_ROUTER_ERROR",sa="REDIRECT",ua="ROUTE_ERROR_RESPONSE";function ca(e){if(e.startsWith(`${Kt}:${sa}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function da(e){if(e.startsWith(`${Kt}:${ua}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new jt(t.status,t.statusText,t.data)}catch{}}function ye(e,{relative:t}={}){P(J(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=g.useContext(T),{hash:n,pathname:o,search:i}=q(e,{relative:t}),l=o;return r!=="/"&&(l=o==="/"?r:$([r,o])),a.createHref({pathname:l,search:i,hash:n})}function J(){return g.useContext(V)!=null}function k(){return P(J(),"useLocation() may be used only in the context of a <Router> component."),g.useContext(V).location}function fa(){return g.useContext(V).navigationType}var Gt="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Xt(e){g.useContext(T).static||g.useLayoutEffect(e)}function K(){let{isDataRoute:e}=g.useContext(_);return e?Ea():ha()}function ha(){P(J(),"useNavigate() may be used only in the context of a <Router> component.");let e=g.useContext(Y),{basename:t,navigator:r}=g.useContext(T),{matches:a}=g.useContext(_),{pathname:n}=k(),o=JSON.stringify(Ne(a)),i=g.useRef(!1);return Xt(()=>{i.current=!0}),g.useCallback((s,u={})=>{if(N(i.current,Gt),!i.current)return;if(typeof s=="number"){r.go(s);return}let c=pe(s,JSON.parse(o),n,u.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:$([t,c.pathname])),Me(typeof s=="string"?s:j(s),r.createHref(c),Oe(r),"reject"),(u.replace?r.replace:r.push)(c,u.state,u)},[t,r,o,n,e])}var Cn=g.createContext(null);function ma(){let{matches:e}=g.useContext(_);return e[e.length-1]?.params??{}}function q(e,{relative:t}={}){let{matches:r}=g.useContext(_),{pathname:a}=k(),n=JSON.stringify(Ne(r));return g.useMemo(()=>pe(e,JSON.parse(n),a,t==="path"),[e,n,a,t])}function Qt(e,t){return Zt(e,t)}function Zt(e,t,r){P(J(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=g.useContext(T),{matches:n}=g.useContext(_),o=n[n.length-1],i=o?o.params:{},l=o?o.pathname:"/",s=o?o.pathnameBase:"/",u=o&&o.route;if(Le){let h=u&&u.path||"";rr(l,!u||h.endsWith("*")||h.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${h}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
2
|
-
|
|
3
|
-
Please change the parent <Route path="${h}"> to <Route path="${h==="/"?"*":`${h}/*`}">.`)}let c=k(),d;if(t){let h=typeof t=="string"?B(t):t;P(s==="/"||h.pathname?.startsWith(s),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${s}" but pathname "${h.pathname}" was given in the \`location\` prop.`),d=h}else d=c;let p=d.pathname||"/",f=p;if(s!=="/"){let h=s.replace(/^\//,"").split("/");f="/"+p.replace(/^\//,"").split("/").slice(h.length).join("/")}let y=r&&r.state.matches.length?r.state.matches.map(h=>Object.assign(h,{route:r.manifest[h.route.id]||h.route})):Te(e,{pathname:f});Le&&(N(u||y!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),N(y==null||y[y.length-1].route.element!==void 0||y[y.length-1].route.Component!==void 0||y[y.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`));let m=Ra(y&&y.map(h=>Object.assign({},h,{params:Object.assign({},i,h.params),pathname:$([s,a.encodeLocation?a.encodeLocation(h.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:h.pathname]),pathnameBase:h.pathnameBase==="/"?s:$([s,a.encodeLocation?a.encodeLocation(h.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:h.pathnameBase])})),n,r);return t&&m?g.createElement(V.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...d},navigationType:"POP"}},m):m}function pa(){let e=tr(),t=zt(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",n={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},i=null;return Le&&(console.error("Error handled by React Router default ErrorBoundary:",e),i=g.createElement(g.Fragment,null,g.createElement("p",null,"\u{1F4BF} Hey developer \u{1F44B}"),g.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",g.createElement("code",{style:o},"ErrorBoundary")," or"," ",g.createElement("code",{style:o},"errorElement")," prop on your route."))),g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),r?g.createElement("pre",{style:n},r):null,i)}var ya=g.createElement(pa,null),qt=class extends g.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let r=da(e.digest);r&&(e=r)}let t=e!==void 0?g.createElement(_.Provider,{value:this.props.routeContext},g.createElement(_e.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?g.createElement(ga,{error:e},t):t}};qt.contextType=Vt;var Pe=new WeakMap;function ga({children:e,error:t}){let{basename:r,navigator:a}=g.useContext(T);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let n=ca(t.digest);if(n){let o=Pe.get(t);if(o)throw o;let i=Wt(n.location,r),l=i.absoluteURL||i.to;if(Me(n.location,l,Oe(a),"allow-explicit"),oa(l))throw new Error("Invalid redirect location");if(Bt&&!Pe.get(t))if(i.isExternal||n.reloadDocument)window.location.href=l;else{let s=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:n.replace}));throw Pe.set(t,s),s}return g.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l}`})}}return e}function va({routeContext:e,match:t,children:r}){let a=g.useContext(Y);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),g.createElement(_.Provider,{value:e},r)}function Ra(e,t=[],r){let a=r?.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(t.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let n=e,o=a?.errors;if(o!=null){let c=n.findIndex(d=>d.route.id&&o?.[d.route.id]!==void 0);P(c>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),n=n.slice(0,Math.min(n.length,c+1))}let i=!1,l=-1;if(r&&a){i=a.renderFallback;for(let c=0;c<n.length;c++){let d=n[c];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(l=c),d.route.id){let{loaderData:p,errors:f}=a,y=d.route.loader&&!p.hasOwnProperty(d.route.id)&&(!f||f[d.route.id]===void 0);if(d.route.lazy||y){r.isStatic&&(i=!0),l>=0?n=n.slice(0,l+1):n=[n[0]];break}}}}let s=r?.onError,u=a&&s?(c,d)=>{s(c,{location:a.location,params:a.matches?.[0]?.params??{},pattern:Qr(a.matches),errorInfo:d})}:void 0;return n.reduceRight((c,d,p)=>{let f,y=!1,m=null,h=null;a&&(f=o&&d.route.id?o[d.route.id]:void 0,m=d.route.errorElement||ya,i&&(l<0&&p===0?(rr("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),y=!0,h=null):l===p&&(y=!0,h=d.route.hydrateFallbackElement||null)));let S=t.concat(n.slice(0,p+1)),R=()=>{let w;return f?w=m:y?w=h:d.route.Component?w=g.createElement(d.route.Component,null):d.route.element?w=d.route.element:w=c,g.createElement(va,{match:d,routeContext:{outlet:c,matches:S,isDataRoute:a!=null},children:w})};return a&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?g.createElement(qt,{location:a.location,revalidation:a.revalidation,component:m,error:f,children:R(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:u}):R()},null)}function $e(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function wa(e){let t=g.useContext(Y);return P(t,$e(e)),t}function Ie(e){let t=g.useContext(Z);return P(t,$e(e)),t}function Sa(e){let t=g.useContext(_);return P(t,$e(e)),t}function He(e){let t=Sa(e),r=t.matches[t.matches.length-1];return P(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function ba(){return He("useRouteId")}function er(){let e=Ie("useNavigation");return g.useMemo(()=>{let{matches:t,historyAction:r,...a}=e.navigation;return a},[e.navigation])}function Ue(){let{matches:e,loaderData:t}=Ie("useMatches");return g.useMemo(()=>e.map(r=>Mr(r,t)),[e,t])}function tr(){let e=g.useContext(_e),t=Ie("useRouteError"),r=He("useRouteError");return e!==void 0?e:t.errors?.[r]}function Ea(){let{router:e}=wa("useNavigate"),t=He("useNavigate"),r=g.useRef(!1);return Xt(()=>{r.current=!0}),g.useCallback(async(n,o={})=>{N(r.current,Gt),r.current&&(typeof n=="number"?await e.navigate(n):await e.navigate(n,{fromRouteId:t,...o}))},[e,t])}var Ft={};function rr(e,t,r){!t&&!Ft[e]&&(Ft[e]=!0,N(!1,r))}var xa="useOptimistic",Ln=E[xa];var Dn=E.memo(Pa);function Pa({routes:e,manifest:t,future:r,state:a,isStatic:n,onError:o}){return Zt(e,void 0,{manifest:t,state:a,isStatic:n,onError:o,future:r})}function Ca({basename:e,children:t,initialEntries:r,initialIndex:a,useTransitions:n}){let o=E.useRef();o.current==null&&(o.current=Ot({initialEntries:r,initialIndex:a,v5Compat:!0}));let i=o.current,[l,s]=E.useState({action:i.action,location:i.location}),u=E.useCallback(c=>{n===!1?s(c):E.startTransition(()=>s(c))},[n]);return E.useLayoutEffect(()=>i.listen(u),[i,u]),E.createElement(ge,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:i,useTransitions:n})}function La({to:e,replace:t,state:r,relative:a}){P(J(),"<Navigate> may be used only in the context of a <Router> component.");let{static:n,navigator:o}=E.useContext(T);N(!n,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:i}=E.useContext(_),{pathname:l}=k(),s=K(),u=pe(e,Ne(i),l,a==="path");Me(typeof e=="string"?e:j(e),o.createHref(u),Oe(o),"reject");let c=JSON.stringify(u);return E.useEffect(()=>{s(JSON.parse(c),{replace:t,state:r,relative:a})},[s,c,a,t,r]),null}function ar(e){P(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function ge({basename:e="/",children:t=null,location:r,navigationType:a="POP",navigator:n,static:o=!1,useTransitions:i}){P(!J(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),s=E.useMemo(()=>({basename:l,navigator:n,static:o,useTransitions:i,future:{}}),[l,n,o,i]);typeof r=="string"&&(r=B(r));let{pathname:u="/",search:c="",hash:d="",state:p=null,key:f="default",mask:y}=r,m=E.useMemo(()=>{let h=H(u,l);return h==null?null:{location:{pathname:h,search:c,hash:d,state:p,key:f,mask:y},navigationType:a}},[l,u,c,d,p,f,a,y]);return N(m!=null,`<Router basename="${l}"> is not able to match the URL "${u}${c}${d}" because it does not start with the basename, so the <Router> won't render anything.`),m==null?null:E.createElement(T.Provider,{value:s},E.createElement(V.Provider,{children:t,value:m}))}function Da({children:e,location:t}){return Qt(he(e),t)}function he(e,t=[]){let r=[];return E.Children.forEach(e,(a,n)=>{if(!E.isValidElement(a))return;let o=[...t,n];if(a.type===E.Fragment){r.push.apply(r,he(a.props.children,o));return}P(a.type===ar,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),P(!a.props.index||!a.props.children,"An index route cannot have child routes.");let i={id:a.props.id||o.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(i.children=he(a.props.children,o)),r.push(i)}),r}var ue="get",ce="application/x-www-form-urlencoded";function ve(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Fa(e){return ve(e)&&e.tagName.toLowerCase()==="button"}function ka(e){return ve(e)&&e.tagName.toLowerCase()==="form"}function Ta(e){return ve(e)&&e.tagName.toLowerCase()==="input"}function Na(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Oa(e,t){return e.button===0&&(!t||t==="_self")&&!Na(e)}function me(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let a=e[r];return t.concat(Array.isArray(a)?a.map(n=>[r,n]):[[r,a]])},[]))}function Ma(e,t){let r=me(e);return t&&t.forEach((a,n)=>{r.has(n)||t.getAll(n).forEach(o=>{r.append(n,o)})}),r}var le=null;function Aa(){if(le===null)try{new FormData(document.createElement("form"),0),le=!1}catch{le=!0}return le}var _a=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ce(e){return e!=null&&!_a.has(e)?(N(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ce}"`),null):e}function $a(e,t){let r,a,n,o,i;if(ka(e)){let l=e.getAttribute("action");a=l?H(l,t):null,r=e.getAttribute("method")||ue,n=Ce(e.getAttribute("enctype"))||ce,o=new FormData(e)}else if(Fa(e)||Ta(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||l.getAttribute("action");if(a=s?H(s,t):null,r=e.getAttribute("formmethod")||l.getAttribute("method")||ue,n=Ce(e.getAttribute("formenctype"))||Ce(l.getAttribute("enctype"))||ce,o=new FormData(l,e),!Aa()){let{name:u,type:c,value:d}=e;if(c==="image"){let p=u?`${u}.`:"";o.append(`${p}x`,"0"),o.append(`${p}y`,"0")}else u&&o.append(u,d)}}else{if(ve(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=ue,a=null,n=ce,i=e}return o&&n==="text/plain"&&(i=o,o=void 0),{action:a,method:r.toLowerCase(),encType:n,formData:o,body:i}}var Fn=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Ia={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},Ha=/[&><\u2028\u2029]/g;function kt(e){return e.replace(Ha,t=>Ia[t])}function ze(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}var Ua=Symbol("SingleFetchRedirect");function nr(e,t,r,a){let n=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?n.pathname.endsWith("/")?n.pathname=`${n.pathname}_.${a}`:n.pathname=`${n.pathname}.${a}`:n.pathname==="/"?n.pathname=`_root.${a}`:t&&H(n.pathname,t)==="/"?n.pathname=`${Q(t)}/_root.${a}`:n.pathname=`${Q(n.pathname)}.${a}`,n}async function ja(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){if(console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode&&import.meta.hot)throw r;return window.location.reload(),new Promise(()=>{})}}function za(e){return e!=null&&typeof e.page=="string"}function Ba(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function Wa(e,t,r){let a=await Promise.all(e.map(async n=>{let o=t.routes[n.route.id];if(o){let i=await ja(o,r);return i.links?i.links():[]}return[]}));return Ka(a.flat(1).filter(Ba).filter(n=>n.rel==="stylesheet"||n.rel==="preload").map(n=>n.rel==="stylesheet"?{...n,rel:"prefetch",as:"style"}:{...n,rel:"prefetch"}))}function Tt(e,t,r,a,n,o){let i=(s,u)=>r[u]?s.route.id!==r[u].route.id:!0,l=(s,u)=>r[u].pathname!==s.pathname||r[u].route.path?.endsWith("*")&&r[u].params["*"]!==s.params["*"];return o==="assets"?t.filter((s,u)=>i(s,u)||l(s,u)):o==="data"?t.filter((s,u)=>{let c=a.routes[s.route.id];if(!c||!c.hasLoader)return!1;if(i(s,u)||l(s,u))return!0;if(s.route.shouldRevalidate){let d=s.route.shouldRevalidate({currentUrl:new URL(n.pathname+n.search+n.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:s.params,defaultShouldRevalidate:!0});if(typeof d=="boolean")return d}return!0}):[]}function Ya(e,t,{includeHydrateFallback:r}={}){return Va(e.map(a=>{let n=t.routes[a.route.id];if(!n)return[];let o=[n.module];return n.clientActionModule&&(o=o.concat(n.clientActionModule)),n.clientLoaderModule&&(o=o.concat(n.clientLoaderModule)),r&&n.hydrateFallbackModule&&(o=o.concat(n.hydrateFallbackModule)),n.imports&&(o=o.concat(n.imports)),o}).flat(1))}function Va(e){return[...new Set(e)]}function Ja(e){let t={},r=Object.keys(e).sort();for(let a of r)t[a]=e[a];return t}function Ka(e,t){let r=new Set,a=new Set(t);return e.reduce((n,o)=>{if(t&&!za(o)&&o.as==="script"&&o.href&&a.has(o.href))return n;let l=JSON.stringify(Ja(o));return r.has(l)||(r.add(l),n.push({key:l,link:o})),n},[])}function Be(){let e=b.useContext(Y);return ze(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Za(){let e=b.useContext(Z);return ze(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var ne=b.createContext(void 0);ne.displayName="FrameworkContext";function Re(){let e=b.useContext(ne);return ze(e,"You must render this element inside a <HydratedRouter> element"),e}function qa(e,t){let r=b.useContext(ne),[a,n]=b.useState(!1),[o,i]=b.useState(!1),{onFocus:l,onBlur:s,onMouseEnter:u,onMouseLeave:c,onTouchStart:d}=t,p=b.useRef(null);b.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let m=S=>{S.forEach(R=>{i(R.isIntersecting)})},h=new IntersectionObserver(m,{threshold:.5});return p.current&&h.observe(p.current),()=>{h.disconnect()}}},[e]),b.useEffect(()=>{if(a){let m=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(m)}}},[a]);let f=()=>{n(!0)},y=()=>{n(!1),i(!1)};return r?e!=="intent"?[o,p,{}]:[o,p,{onFocus:re(l,f),onBlur:re(s,y),onMouseEnter:re(u,f),onMouseLeave:re(c,y),onTouchStart:re(d,f)}]:[!1,p,{}]}function re(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function ir({page:e,...t}){let r=ia(),{nonce:a}=Re(),{router:n}=Be(),o=b.useMemo(()=>Te(n.routes,e,n.basename),[n.routes,e,n.basename]);return o?(t.nonce==null&&a&&(t={...t,nonce:a}),r?b.createElement(tn,{page:e,matches:o,...t}):b.createElement(rn,{page:e,matches:o,...t})):null}function en(e){let{manifest:t,routeModules:r}=Re(),[a,n]=b.useState([]);return b.useEffect(()=>{let o=!1;return Wa(e,t,r).then(i=>{o||n(i)}),()=>{o=!0}},[e,t,r]),a}function tn({page:e,matches:t,...r}){let a=k(),{future:n}=Re(),{basename:o}=Be(),i=b.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let l=nr(e,o,n.v8_trailingSlashAwareDataRequests,"rsc"),s=!1,u=[];for(let c of t)typeof c.route.shouldRevalidate=="function"?s=!0:u.push(c.route.id);return s&&u.length>0&&l.searchParams.set("_routes",u.join(",")),[l.pathname+l.search]},[o,n.v8_trailingSlashAwareDataRequests,e,a,t]);return b.createElement(b.Fragment,null,i.map(l=>b.createElement("link",{key:l,rel:"prefetch",as:"fetch",href:l,...r})))}function rn({page:e,matches:t,...r}){let a=k(),{future:n,manifest:o,routeModules:i}=Re(),{basename:l}=Be(),{loaderData:s,matches:u}=Za(),c=b.useMemo(()=>Tt(e,t,u,o,a,"data"),[e,t,u,o,a]),d=b.useMemo(()=>Tt(e,t,u,o,a,"assets"),[e,t,u,o,a]),p=b.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let m=new Set,h=!1;if(t.forEach(R=>{let w=o.routes[R.route.id];!w||!w.hasLoader||(!c.some(x=>x.route.id===R.route.id)&&R.route.id in s&&i[R.route.id]?.shouldRevalidate||w.hasClientLoader?h=!0:m.add(R.route.id))}),m.size===0)return[];let S=nr(e,l,n.v8_trailingSlashAwareDataRequests,"data");return h&&m.size>0&&S.searchParams.set("_routes",t.filter(R=>m.has(R.route.id)).map(R=>R.route.id).join(",")),[S.pathname+S.search]},[l,n.v8_trailingSlashAwareDataRequests,s,a,o,c,t,e,i]),f=b.useMemo(()=>Ya(d,o),[d,o]),y=en(d);return b.createElement(b.Fragment,null,p.map(m=>b.createElement("link",{key:m,rel:"prefetch",as:"fetch",href:m,...r})),f.map(m=>b.createElement("link",{key:m,rel:"modulepreload",href:m,...r})),y.map(({key:m,link:h})=>b.createElement("link",{key:m,nonce:r.nonce,...h,crossOrigin:h.crossOrigin??r.crossOrigin})))}function an(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var nn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{nn&&(window.__reactRouterVersion="7.18.3")}catch{}function on({basename:e,children:t,useTransitions:r,window:a}){let n=v.useRef();n.current==null&&(n.current=Mt({window:a,v5Compat:!0}));let o=n.current,[i,l]=v.useState({action:o.action,location:o.location}),s=v.useCallback(u=>{r===!1?l(u):v.startTransition(()=>l(u))},[r]);return v.useLayoutEffect(()=>o.listen(s),[o,s]),v.createElement(ge,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:o,useTransitions:r})}function lr({basename:e,children:t,history:r,useTransitions:a}){let[n,o]=v.useState({action:r.action,location:r.location}),i=v.useCallback(l=>{a===!1?o(l):v.startTransition(()=>o(l))},[a]);return v.useLayoutEffect(()=>r.listen(i),[r,i]),v.createElement(ge,{basename:e,children:t,location:n.location,navigationType:n.action,navigator:r,useTransitions:a})}lr.displayName="unstable_HistoryRouter";var oe=v.forwardRef(function({onClick:t,discover:r="render",prefetch:a="none",relative:n,reloadDocument:o,replace:i,mask:l,state:s,target:u,to:c,preventScrollReset:d,viewTransition:p,defaultShouldRevalidate:f,...y},m){let{basename:h,navigator:S,useTransitions:R}=v.useContext(T),w=typeof c=="string"&&ke.test(c),x=Wt(c,h);c=x.to;let C=ye(c,{relative:n}),F=k(),I=null;if(l){let z=pe(l,[],F.mask?F.mask.pathname:"/",!0);h!=="/"&&(z.pathname=z.pathname==="/"?h:$([h,z.pathname])),I=S.createHref(z)}let[G,ee,we]=qa(a,y),xr=fr(c,{replace:i,mask:l,state:s,target:u,preventScrollReset:d,relative:n,viewTransition:p,defaultShouldRevalidate:f,useTransitions:R});function Pr(z){t&&t(z),z.defaultPrevented||xr(z)}let Qe=!(x.isExternal||o),Ze=v.createElement("a",{...y,...we,href:(Qe?I:void 0)||x.absoluteURL||C,onClick:Qe?Pr:t,ref:an(m,ee),target:u,"data-discover":!w&&r==="render"?"true":void 0});return G&&!w?v.createElement(v.Fragment,null,Ze,v.createElement(ir,{page:C})):Ze});oe.displayName="Link";var sr=v.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:a="",end:n=!1,style:o,to:i,viewTransition:l,children:s,...u},c){let d=q(i,{relative:u.relative}),p=k(),f=v.useContext(Z),{navigator:y,basename:m}=v.useContext(T),h=f!=null&&yr(d)&&l===!0,S=y.encodeLocation?y.encodeLocation(d).pathname:d.pathname,R=p.pathname,w=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;r||(R=R.toLowerCase(),w=w?w.toLowerCase():null,S=S.toLowerCase()),w&&m&&(w=H(w,m)||w);let x=S!=="/"&&S.endsWith("/")?S.length-1:S.length,C=R===S||!n&&R.startsWith(S)&&R.charAt(x)==="/",F=w!=null&&(w===S||!n&&w.startsWith(S)&&w.charAt(S.length)==="/"),I={isActive:C,isPending:F,isTransitioning:h},G=C?t:void 0,ee;typeof a=="function"?ee=a(I):ee=[a,C?"active":null,F?"pending":null,h?"transitioning":null].filter(Boolean).join(" ");let we=typeof o=="function"?o(I):o;return v.createElement(oe,{...u,"aria-current":G,className:ee,ref:c,style:we,to:i,viewTransition:l},typeof s=="function"?s(I):s)});sr.displayName="NavLink";var ur=v.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:a,replace:n,state:o,method:i=ue,action:l,onSubmit:s,relative:u,preventScrollReset:c,viewTransition:d,defaultShouldRevalidate:p,...f},y)=>{let{useTransitions:m}=v.useContext(T),h=hr(),S=mr(l,{relative:u}),R=i.toLowerCase()==="get"?"get":"post",w=typeof l=="string"&&ke.test(l);return v.createElement("form",{ref:y,method:R,action:S,onSubmit:a?s:C=>{if(s&&s(C),C.defaultPrevented)return;C.preventDefault();let F=C.nativeEvent.submitter,I=F?.getAttribute("formmethod")||i,G=()=>h(F||C.currentTarget,{fetcherKey:t,method:I,navigate:r,replace:n,state:o,relative:u,preventScrollReset:c,viewTransition:d,defaultShouldRevalidate:p});m&&r!==!1?v.startTransition(()=>G()):G()},...f,"data-discover":!w&&e==="render"?"true":void 0})});ur.displayName="Form";function cr({getKey:e,storageKey:t,...r}){let a=v.useContext(ne),{basename:n}=v.useContext(T),o=k(),i=Ue();pr({getKey:e,storageKey:t});let l=v.useMemo(()=>{if(!a||!e)return null;let u=Fe(o,i,n,e);return u!==o.key?u:null},[]);if(!a||a.isSpaMode)return null;let s=((u,c)=>{if(!window.history.state||!window.history.state.key){let d=Math.random().toString(32).slice(2);window.history.replaceState({key:d},"")}try{let p=JSON.parse(sessionStorage.getItem(u)||"{}")[c||window.history.state.key];typeof p=="number"&&window.scrollTo(0,p)}catch(d){console.error(d),sessionStorage.removeItem(u)}}).toString();return r.nonce==null&&a?.nonce&&(r.nonce=a.nonce),v.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${s})(${kt(JSON.stringify(t||De))}, ${kt(JSON.stringify(l))})`}})}cr.displayName="ScrollRestoration";function dr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function We(e){let t=v.useContext(Y);return P(t,dr(e)),t}function ln(e){let t=v.useContext(Z);return P(t,dr(e)),t}function fr(e,{target:t,replace:r,mask:a,state:n,preventScrollReset:o,relative:i,viewTransition:l,defaultShouldRevalidate:s,useTransitions:u}={}){let c=K(),d=k(),p=q(e,{relative:i});return v.useCallback(f=>{if(Oa(f,t)){f.preventDefault();let y=r!==void 0?r:j(d)===j(p),m=()=>c(e,{replace:y,mask:a,state:n,preventScrollReset:o,relative:i,viewTransition:l,defaultShouldRevalidate:s});u?v.startTransition(()=>m()):m()}},[d,c,p,r,a,n,t,e,o,i,l,s,u])}function Ye(e){N(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=v.useRef(me(e)),r=v.useRef(!1),a=k(),n=v.useMemo(()=>Ma(a.search,r.current?null:t.current),[a.search]),o=K(),i=v.useCallback((l,s)=>{let u=me(typeof l=="function"?l(new URLSearchParams(n)):l);r.current=!0,o("?"+u,s)},[o,n]);return[n,i]}var sn=0,un=()=>`__${String(++sn)}__`;function hr(){let{router:e}=We("useSubmit"),{basename:t}=v.useContext(T),r=ba(),a=e.fetch,n=e.navigate;return v.useCallback(async(o,i={})=>{let{action:l,method:s,encType:u,formData:c,body:d}=$a(o,t);if(i.navigate===!1){let p=i.fetcherKey||un();await a(p,r,i.action||l,{defaultShouldRevalidate:i.defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:c,body:d,formMethod:i.method||s,formEncType:i.encType||u,flushSync:i.flushSync})}else await n(i.action||l,{defaultShouldRevalidate:i.defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:c,body:d,formMethod:i.method||s,formEncType:i.encType||u,replace:i.replace,state:i.state,fromRouteId:r,flushSync:i.flushSync,viewTransition:i.viewTransition})},[a,n,t,r])}function mr(e,{relative:t}={}){let{basename:r}=v.useContext(T),a=v.useContext(_);P(a,"useFormAction must be used inside a RouteContext");let[n]=a.matches.slice(-1),o={...q(e||".",{relative:t})},i=k();if(e==null){o.search=i.search;let l=new URLSearchParams(o.search),s=l.getAll("index");if(s.some(c=>c==="")){l.delete("index"),s.filter(d=>d).forEach(d=>l.append("index",d));let c=l.toString();o.search=c?`?${c}`:""}}return(!e||e===".")&&n.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:$([r,o.pathname])),j(o)}var De="react-router-scroll-positions",se={};function Fe(e,t,r,a){let n=null;return a&&(r!=="/"?n=a({...e,pathname:H(e.pathname,r)||e.pathname},t):n=a(e,t)),n==null&&(n=e.key),n}function pr({getKey:e,storageKey:t}={}){let{router:r}=We("useScrollRestoration"),{restoreScrollPosition:a,preventScrollReset:n}=ln("useScrollRestoration"),{basename:o}=v.useContext(T),i=k(),l=Ue(),s=er();v.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),cn(v.useCallback(()=>{if(s.state==="idle"){let u=Fe(i,l,o,e);se[u]=window.scrollY}try{sessionStorage.setItem(t||De,JSON.stringify(se))}catch(u){N(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${u}).`)}window.history.scrollRestoration="auto"},[s.state,e,o,i,l,t])),typeof document<"u"&&(v.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(t||De);u&&(se=JSON.parse(u))}catch{}},[t]),v.useLayoutEffect(()=>{let u=r?.enableScrollRestoration(se,()=>window.scrollY,e?(c,d)=>Fe(c,d,o,e):void 0);return()=>u&&u()},[r,o,e]),v.useLayoutEffect(()=>{if(a!==!1){if(typeof a=="number"){window.scrollTo(0,a);return}try{if(i.hash){let u=document.getElementById(decodeURIComponent(i.hash.slice(1)));if(u){u.scrollIntoView();return}}}catch{N(!1,`"${i.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}n!==!0&&window.scrollTo(0,0)}},[i,a,n]))}function cn(e,t){let{capture:r}=t||{};v.useEffect(()=>{let a=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,a),()=>{window.removeEventListener("pagehide",e,a)}},[e,r])}function yr(e,{relative:t}={}){let r=v.useContext(Ae);P(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=We("useViewTransitionState"),n=q(e,{relative:t});if(!r.isTransitioning)return!1;let o=H(r.currentLocation.pathname,a)||r.currentLocation.pathname,i=H(r.nextLocation.pathname,a)||r.nextLocation.pathname;return ae(n.pathname,i)!=null||ae(n.pathname,o)!=null}var Ve=D(M(),1),vr=D(Cr(),1);var U=D(X(),1);function Rr({context:e,own:t}){te(e.store);let r=ut(),a=st()?.live??e.store;if(te(a),!r||a.batches().length===0)return null;let n=(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Ve.Suspense,{fallback:null,children:(0,U.jsx)(St,{})}),(0,U.jsx)(Ve.Suspense,{fallback:null,children:(0,U.jsx)(bt,{})})]});return t?(0,vr.createPortal)(n,t):(0,U.jsx)("div",{className:"graview-bar-own",children:n})}var O=D(M(),1);var W=D(M(),1),dn=(0,W.createContext)(null);function Ko(){let e=new Map,t=new Set,r=()=>{for(let a of t)a()};return{count:a=>e.get(a)??0,place(a){return e.set(a,(e.get(a)??0)+1),r(),()=>{e.set(a,(e.get(a)??1)-1),r()}},subscribe(a){return t.add(a),()=>t.delete(a)}}}function wr(e){let t=(0,W.useContext)(dn);(0,W.useLayoutEffect)(()=>t?.place(e),[t,e])}function Go(e,t){return(0,W.useSyncExternalStore)(e.subscribe,()=>e.count(t)>0,()=>!1)}var Er=D(X(),1),Je="var(--graview-text-small)",Ke="var(--graview-text-body)",ti="var(--graview-font-display, var(--graview-font-body, system-ui))",Ge={maxWidth:760,margin:"0 auto",padding:"40px 20px max(96px, calc(var(--graview-foot-room, 0px) + env(safe-area-inset-bottom, 0px)))",display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:40},Xe=1160,ri={...Ge,maxWidth:Xe},Sr={margin:0,fontSize:"var(--graview-text-title)",lineHeight:1.2,letterSpacing:"-0.012em",overflowWrap:"anywhere",textWrap:"balance"},ai={margin:0,fontSize:"var(--graview-text-heading)",lineHeight:1.3,textWrap:"balance"},ni={margin:0,fontSize:Je,letterSpacing:"0.08em",textTransform:"uppercase",color:"var(--graview-ink-muted)"},oi={margin:0,fontSize:Ke,color:"var(--graview-ink-muted)",maxWidth:"60ch"},br={color:"var(--graview-ink-muted)",fontSize:Je},ii={borderTop:"1px solid var(--graview-edge)",paddingTop:24},li={color:"var(--graview-accent)",textDecorationColor:"color-mix(in srgb, currentColor 50%, transparent)",textDecorationThickness:1,textUnderlineOffset:"0.2em",display:"inline-flex",alignItems:"center",minHeight:24},si={color:"inherit",textDecoration:"none",display:"inline-flex",alignItems:"center",minHeight:24},ui=`.graview-list{container-type:inline-size}
|
|
4
|
-
.graview-rows{display:grid;grid-template-columns:minmax(0,1fr);column-gap:1.5rem;margin:0;padding:0;list-style:none;border-top:1px solid var(--graview-edge)}
|
|
5
|
-
.graview-row{grid-column:1/-1;display:grid;grid-template-columns:subgrid;align-items:baseline;align-content:center;position:relative;box-sizing:border-box;min-height:2.75rem;padding:.5rem 0;border-bottom:1px solid var(--graview-edge);overflow-wrap:anywhere}
|
|
6
|
-
.graview-row-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;min-height:24px;color:inherit;text-decoration:none;font-size:var(--graview-text-body);font-weight:500;line-height:1.3;text-wrap:pretty;hyphens:manual}
|
|
7
|
-
.graview-row-title::after{content:"";position:absolute;inset:0}
|
|
8
|
-
.graview-row-title:focus-visible{outline:0}
|
|
9
|
-
.graview-row-title:focus-visible::after{outline:2px solid var(--graview-accent);outline-offset:-2px;border-radius:var(--graview-radius-sm)}
|
|
10
|
-
.graview-row:hover .graview-row-title{text-decoration:underline 1px color-mix(in srgb,currentColor 50%,transparent);text-underline-offset:.2em}
|
|
11
|
-
.graview-row:active .graview-row-title{color:var(--graview-accent)}
|
|
12
|
-
.graview-row :is(a,button):not(.graview-row-title){position:relative}
|
|
13
|
-
.graview-row-glance,.graview-row>[data-testid=search-why]{font-size:var(--graview-text-small);line-height:1.5;color:var(--graview-ink-muted)}
|
|
14
|
-
.graview-row>[data-testid=search-why]{grid-column:1/-1}
|
|
15
|
-
.graview-row-glance{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
|
|
16
|
-
.graview-group-head{display:flex;gap:.5em;align-items:baseline;margin:0;padding:.375rem 0;font-family:var(--graview-font-body);font-size:var(--graview-text-small);font-weight:var(--graview-weight-label);line-height:1.3;letter-spacing:.02em;scroll-margin-top:4rem}
|
|
17
|
-
.graview-group-head>span{color:var(--graview-ink-muted);font-weight:var(--graview-weight-body)}
|
|
18
|
-
.graview-group-toggle{display:inline-flex;gap:.5em;align-items:center;min-height:2.75rem;margin:-.375rem 0;padding:0 .5rem 0 0;border:0;background:none;color:inherit;font:inherit;letter-spacing:inherit;text-align:start;cursor:pointer;border-radius:var(--graview-radius-sm)}
|
|
19
|
-
.graview-group-toggle:focus-visible{outline:2px solid var(--graview-accent);outline-offset:2px}
|
|
20
|
-
.graview-group-toggle>span{color:var(--graview-ink-muted);font-weight:var(--graview-weight-body)}
|
|
21
|
-
@container (min-width:36rem){.graview-rows{grid-template-columns:minmax(0,1fr) fit-content(40%)}.graview-group-head:has(+.graview-rows){position:sticky;top:0;z-index:${tt.raised};background:var(--graview-ground)}}`,ci={font:"inherit",fontSize:Je,padding:"8px 14px",borderRadius:"var(--graview-radius-sm, 8px)",border:"1px solid var(--graview-edge-bright)",background:"var(--graview-panel)",color:"var(--graview-ink)",cursor:"pointer"};function di({kind:e,brand:t,size:r=10,schema:a}){return(0,Er.jsx)(dt,{kind:e,...a?{schema:a}:{},...t?{brand:t}:{},size:Math.round(r*1.6)})}function fi(e,t){let a=[...new Set(t.targets.map(n=>n.kind))].map(n=>e.schema.tryDefinition(n)?.plural??Se(n));return a.length>0?a.join(" and "):Se(t.edgeKind)}function hi(e,t,r){return e.author.kind==="human"&&(e.author.id===void 0||t?.id===void 0||e.author.id===t.id)?"you":r?qe(e.author,r):e.author.kind==="agent"?e.author.id??"an agent":e.author.id??e.author.kind}function mi(e,t,r){return ht(e,t,{limit:3,said:[r],glance:!0}).map(a=>a.long?ft(a.stored,{markdown:a.markdown,most:100}):a.alone).join(" \xB7 ")}var pi=(e,t)=>ie(e.schema,t),fn=(e,t)=>{let r=e.kindsKeptFrom(t);return e.schema.kinds.filter(a=>!e.modules.disabledKinds.has(a)&&!r.has(a))},hn=e=>lt(fn(e.store,e.principal),e.views?.arrangement?.()?.order),yi=e=>{let t=new Set(e.views?.arrangement?.()?.hide??[]);return hn(e).filter(r=>!t.has(r))},gi=e=>e.charAt(0).toUpperCase()+e.slice(1);var L=D(X(),1);function Li({context:e,children:t}){let{store:r,brand:a}=e;return te(r),ct(e.embedded?void 0:et(a)),(0,L.jsxs)("div",{style:{...e.embedded?{}:{minHeight:"100vh"},display:"flex",flexDirection:"column",background:"var(--graview-ground)",color:"var(--graview-ink)",fontFamily:"var(--graview-font-body, system-ui)",fontSize:Ke,lineHeight:1.5},children:[e.embedded?null:(0,L.jsx)(pn,{context:e}),(0,L.jsx)("div",{style:{flex:1},children:t}),e.remembers?(0,L.jsx)("footer",{style:{borderTop:"1px solid var(--graview-edge)",padding:"14px 20px max(20px, calc(var(--graview-foot-room, 0px) + env(safe-area-inset-bottom, 0px)))",...br},children:(0,L.jsx)("div",{style:{maxWidth:Xe,margin:"0 auto",display:"flex",gap:14,flexWrap:"wrap",alignItems:"center",justifyContent:"flex-end"},children:(0,L.jsxs)("span",{"data-testid":"remembered",children:["Remembered in this browser \xB7 ",(0,L.jsx)(Et,{})]})})}):null]})}var mn=(0,O.createContext)(null);function pn({context:e}){let{store:t,brand:r,sceneHref:a="/",invariantContext:n}=e,o=k(),i=K(),l=ye("/").replace(/\/$/,""),s=(0,O.useContext)(mn),u=s?.places===!1?[]:mt({store:t,principal:e.principal,views:e.views}),c=e.views?.arrangement?.(),d=`${o.pathname}${o.search}`,p=t.violations(n),f=p.length,y=Rt(p,"All rules hold");return(0,L.jsx)(L.Fragment,{children:(0,L.jsx)(gt,{brand:r,name:r?.name??"Graview",description:r?.subtitle,home:{href:`${l}/`,go:()=>i("/"),current:o.pathname==="/"},faces:{scene:{label:ot(c),current:!1,go:()=>window.location.assign(a)},pages:{label:it(c),current:!0,go:()=>{}}},places:u,current:pt(u,d),reach:{href:m=>`${l}${m}`,go:m=>i(m.path)},...s?{onFind:s.onFind,find:s.find}:{findBox:(0,L.jsx)(yn,{context:e})},tools:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(oe,{to:"/problems","data-testid":"standing-link","aria-label":y,title:y,style:{...yt,padding:f===0?0:"0 8px",textDecoration:"none",fontWeight:600,fontVariantNumeric:"tabular-nums",color:f===0?"var(--graview-ink-muted)":"var(--graview-warn)"},children:[(0,L.jsx)(wt,{tone:f===0?"var(--graview-good)":"var(--graview-warn)"}),f>0?(0,L.jsx)("span",{"aria-hidden":"true",children:f}):null]}),s?null:(0,L.jsx)(Rr,{context:e}),e.views?(0,L.jsx)(vt,{...e.signature?{signature:!0}:{}}):null]})})})}function Di({context:e,style:t,children:r,...a}){let n=e.embedded||e.framed?"section":"main";return(0,L.jsx)(n,{style:{...Ge,...t},...a,children:r})}function Fi({context:e,children:t,...r}){let a=`h${e.titleLevel??(e.framed&&!e.barAbove?1:2)}`;return(0,L.jsx)(a,{style:Sr,"data-graview-page-title":"",...r,children:t})}function yn({context:e,narrowsLists:t=!0}){wr("find");let r=k(),a=K(),[n,o]=Ye(),i=r.pathname.split("/").filter(Boolean),l=t&&i.length===1&&be(e.store.schema,i[0])!==void 0,s=r.pathname==="/search",u=l||s?n.get("q")??"":"",c=l?`Narrow ${ie(e.store.schema,be(e.store.schema,i[0])).toLowerCase()}\u2026`:"",[d,p]=(0,O.useState)(!0);(0,O.useLayoutEffect)(()=>{let R=m.current;if(!R||!c||typeof ResizeObserver>"u")return;let w=()=>{let C=getComputedStyle(R),F=document.createElement("canvas").getContext("2d");F&&(F.font=`${C.fontWeight} ${C.fontSize} ${C.fontFamily}`,p(F.measureText(c).width<=R.clientWidth-parseFloat(C.paddingLeft)-parseFloat(C.paddingRight)))};w();let x=new ResizeObserver(w);return x.observe(R),()=>x.disconnect()},[c]);let[f,y]=(0,O.useState)(u),m=(0,O.useRef)(null);(0,O.useEffect)(()=>{let R=w=>{if(w.defaultPrevented||w.altKey||w.shiftKey||!(w.metaKey||w.ctrlKey)||w.key.toLowerCase()!=="k")return;let x=m.current,C=x?.closest("[data-graview-embed]"),F=w.target,I=F===document.body||F===document.documentElement;!x||!(I||!C||F instanceof Node&&C.contains(F))||(w.preventDefault(),x.closest("[data-graview-app-bar]")?.querySelector('[data-testid="app-find-open"]')?.click(),requestAnimationFrame(()=>{x.focus(),x.select()}))};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[]);let h=(0,O.useRef)(new Set([u]));(0,O.useEffect)(()=>{h.current.has(u)||(h.current=new Set([u]),y(u))},[u]);let S=R=>{if(y(R),h.current.add(R),l){let x=new URLSearchParams(n);R.trim()?x.set("q",R):x.delete("q"),o(x,{replace:!0});return}let w=R.trim()?`/search?${new URLSearchParams({q:R}).toString()}`:"/search";a(w,{replace:s})};return(0,L.jsx)("form",{role:"search","aria-label":l?"Narrow this list":"Find anything",style:{display:"flex",minWidth:0,flex:"1 1 auto"},onSubmit:R=>{R.preventDefault(),l&&f.trim()&&a(`/search?${new URLSearchParams({q:f}).toString()}`)},children:(0,L.jsx)("input",{ref:m,type:"search","data-testid":"nav-find",value:f,onChange:R=>S(R.target.value),placeholder:l?d?c:"Narrow\u2026":"Find\u2026","aria-keyshortcuts":"Meta+K Control+K","aria-label":l?"Narrow this list":"Find anything",style:{width:"100%",minWidth:0,height:30,padding:"0 var(--graview-bar-find-end, 10px) 0 10px",font:"inherit",fontSize:"0.875rem",color:"var(--graview-ink)",background:"var(--graview-ground)",border:"1px solid var(--graview-edge)",borderRadius:8}})})}export{Lr as a,be as b,vn as c,Rn as d,Je as e,ti as f,ri as g,ai as h,ni as i,oi as j,br as k,ii as l,li as m,si as n,ui as o,ci as p,di as q,fi as r,hi as s,mi as t,pi as u,fn as v,hn as w,yi as x,gi as y,Rr as z,ye as A,k as B,fa as C,K as D,ma as E,Ca as F,La as G,ar as H,Da as I,on as J,oe as K,Ye as L,dn as M,Ko as N,Go as O,Li as P,mn as Q,Di as R,Fi as S,yn as T};
|
|
22
|
-
/*! Bundled license information:
|
|
23
|
-
|
|
24
|
-
react-router/dist/development/chunk-BV7QT456.mjs:
|
|
25
|
-
(**
|
|
26
|
-
* react-router v7.18.3
|
|
27
|
-
*
|
|
28
|
-
* Copyright (c) Remix Software Inc.
|
|
29
|
-
*
|
|
30
|
-
* This source code is licensed under the MIT license found in the
|
|
31
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
32
|
-
*
|
|
33
|
-
* @license MIT
|
|
34
|
-
*)
|
|
35
|
-
|
|
36
|
-
react-router/dist/development/index.mjs:
|
|
37
|
-
(**
|
|
38
|
-
* react-router v7.18.3
|
|
39
|
-
*
|
|
40
|
-
* Copyright (c) Remix Software Inc.
|
|
41
|
-
*
|
|
42
|
-
* This source code is licensed under the MIT license found in the
|
|
43
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
44
|
-
*
|
|
45
|
-
* @license MIT
|
|
46
|
-
*)
|
|
47
|
-
*/
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i}from"./chunk.PKK6FRZR.js";import"./chunk.OAF7TUMI.js";import"./chunk.OZNW5W4Z.js";import"./chunk.NDADLJE6.js";import"./chunk.AK3IHFCF.js";import"./chunk.HHPGWJDO.js";import"./chunk.42YX6NOY.js";import"./chunk.JH6MU6TX.js";import"./chunk.WAFDCOOG.js";import"./chunk.6V2RG5JG.js";import"./chunk.AJZBJBMO.js";export{f as columnActs,c as columnMoves,b as columnOf,d as columnReach,e as columnSteps,h as describePlace,i as placeText,g as resolveFor,a as statusColumns};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as R}from"./chunk.RRVIXV7W.js";import"./chunk.7BWT5L2L.js";import"./chunk.VSZQXB4Q.js";import"./chunk.WVUJXDXZ.js";import"./chunk.OZNW5W4Z.js";import"./chunk.NDADLJE6.js";import"./chunk.AK3IHFCF.js";import"./chunk.HHPGWJDO.js";import"./chunk.42YX6NOY.js";import"./chunk.EYZ7MHBZ.js";import{o as x}from"./chunk.KQT7WAQE.js";import"./chunk.PAVR5TK5.js";import"./chunk.OQDETV4X.js";import"./chunk.3VL5WECB.js";import"./chunk.JH6MU6TX.js";import"./chunk.WAFDCOOG.js";import"./chunk.L4DECHXR.js";import{G as k,R as v,_ as g}from"./chunk.GFF2FB2J.js";import{ba as m,cc as A,ea as c}from"./chunk.6V2RG5JG.js";import{b as u}from"./chunk.AJZBJBMO.js";var f=u(k(),1);var S=u(k(),1),L=(0,S.createContext)(void 0);var i=u(v(),1),W=new WeakMap,y=new WeakMap,P=(e,n)=>`${n.kind}\0${n.id??""}\0${e}`;function C(e,n,r){let o=P(n,r),p=W.get(e);p||W.set(e,p=new Map);let t=p.get(o);return t||(t=Promise.resolve().then(()=>e(n,r)).then(a=>b(a)?a:null,()=>null).then(a=>{let s=y.get(e);return s||y.set(e,s=new Map),s.set(o,a),a}),p.set(o,t)),t}function b(e){if(e===null)return!0;if(typeof e!="object"||e===void 0)return!1;if(e.denied===!0)return!0;let n=e;return typeof n.name=="string"&&n.name.trim()!==""&&typeof n.href=="string"}function h(e){if(/^https?:\/\//i.test(e))try{return new URL(e).href}catch{return}}var N=e=>h(e)??(c(e)?e:void 0),E=e=>h(e)??(e.startsWith("/")&&c(e)?e:void 0),I={kind:"human"},w={color:"var(--graview-ink-muted)"};function M({icon:e}){if(!e)return null;let n=E(e);if(n)return(0,i.jsx)("img",{src:n,alt:"",width:20,height:20,"data-graview-app-icon":"",style:{width:20,height:20,borderRadius:5,objectFit:"cover",flex:"0 0 auto"}});let r=[...e.trim()].slice(0,2).join("");return r?(0,i.jsx)("span",{"aria-hidden":"true","data-graview-app-icon":"",style:{flex:"0 0 auto",lineHeight:"20px"},children:r}):null}function V(e){let n=g(),r=(0,f.useContext)(L)??n?.resolveApp,o=n?.principal??I,p=()=>r?y.get(r)?.get(P(e,o))??"asking":null,[t,a]=(0,f.useState)(p);return(0,f.useEffect)(()=>{let s=p();if(a(s),s!=="asking"||!r)return;let l=!0;return C(r,e,o).then(d=>l&&a(d)),()=>{l=!1}},[r,e,o.kind,o.id]),t}function D({address:e,as:n="chip",nodeId:r,field:o,style:p}){let t=V(e),a={position:"relative",zIndex:A.raised,overflowWrap:"anywhere",minWidth:0,maxWidth:"100%",...p},s;if(t==="asking")s=(0,i.jsx)("span",{"data-graview-app-link":"","data-graview-app-state":"asking","aria-busy":"true",style:{...w,...a},children:"Linked app"});else if(t&&"denied"in t)s=(0,i.jsx)("span",{"data-graview-app-link":"","data-graview-app-state":"denied",style:{...w,fontStyle:"italic",...a},children:"linked app (no access)"});else if(t){let l=N(t.href),d=n==="record"?t.headline?.trim():void 0;s=(0,i.jsxs)(l?"a":"span",{"data-graview-app-link":"","data-graview-app-state":"found",...l?{href:l}:{},...!d&&t.headline?{title:t.headline}:{},style:{display:"inline-flex",alignItems:d?"flex-start":"center",minHeight:24,gap:8,color:"inherit",textUnderlineOffset:3,...a},children:[(0,i.jsx)(M,{icon:t.icon}),(0,i.jsxs)("span",{style:{display:"grid",minWidth:0},children:[(0,i.jsx)("span",{"data-graview-app-name":"",style:{fontWeight:600},children:t.name}),d?(0,i.jsx)("span",{"data-graview-app-headline":"",style:{...w,fontSize:"0.8125em",fontWeight:400},children:d}):null]})]})}else{let l=h(e);s=l?(0,i.jsx)("a",{"data-graview-app-link":"","data-graview-app-state":"plain",href:l,rel:"noopener noreferrer",target:"_blank",style:{color:"var(--graview-accent)",display:"inline-flex",alignItems:"center",minHeight:24,...a},children:e}):(0,i.jsx)("span",{"data-graview-app-link":"","data-graview-app-state":"plain",style:a,children:e})}return r&&o?(0,i.jsx)(H,{nodeId:r,field:o,address:e,drawn:s}):s}function H({nodeId:e,field:n,address:r,drawn:o}){let p=x(e).fields.some(s=>s.field===n),t=g()?.store;if(!p)return o;let a=m(t?t.schema.tryDefinition(String(t.graph.getNode(e)?.kind)):void 0,n).toLowerCase();return(0,i.jsxs)("span",{style:{display:"inline-flex",flexWrap:"wrap",alignItems:"baseline",gap:"4px 12px",maxWidth:"100%",minWidth:0},children:[o,(0,i.jsx)("span",{style:{fontSize:"0.8125rem"},children:(0,i.jsx)(R,{nodeId:e,field:n,value:"Change",stored:r,said:`Change the ${a}`})})]})}var _=e=>(0,i.jsx)(D,{...e});export{D as AppLink,_ as drawAppLink};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import{G as v}from"./chunk.GFF2FB2J.js";import{a as s}from"./chunk.AJZBJBMO.js";var l=s(i=>{"use strict";var m=v();function y(r){var e="https://react.dev/errors/"+r;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var t=2;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t])}return"Minified React error #"+r+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(){}var n={d:{f:c,r:function(){throw Error(y(522))},D:c,C:c,L:c,m:c,X:c,S:c,M:c},p:0,findDOMNode:null},O=Symbol.for("react.portal");function S(r,e,t){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:O,key:f==null?null:""+f,children:r,containerInfo:e,implementation:t}}var u=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function a(r,e){if(r==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n;i.createPortal=function(r,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(y(299));return S(r,e,null,t)};i.flushSync=function(r){var e=u.T,t=n.p;try{if(u.T=null,n.p=2,r)return r()}finally{u.T=e,n.p=t,n.d.f()}};i.preconnect=function(r,e){typeof r=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,n.d.C(r,e))};i.prefetchDNS=function(r){typeof r=="string"&&n.d.D(r)};i.preinit=function(r,e){if(typeof r=="string"&&e&&typeof e.as=="string"){var t=e.as,f=a(t,e.crossOrigin),g=typeof e.integrity=="string"?e.integrity:void 0,d=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;t==="style"?n.d.S(r,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:f,integrity:g,fetchPriority:d}):t==="script"&&n.d.X(r,{crossOrigin:f,integrity:g,fetchPriority:d,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};i.preinitModule=function(r,e){if(typeof r=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var t=a(e.as,e.crossOrigin);n.d.M(r,{crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&n.d.M(r)};i.preload=function(r,e){if(typeof r=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var t=e.as,f=a(t,e.crossOrigin);n.d.L(r,t,{crossOrigin:f,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};i.preloadModule=function(r,e){if(typeof r=="string")if(e){var t=a(e.as,e.crossOrigin);n.d.m(r,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else n.d.m(r)};i.requestFormReset=function(r){n.d.r(r)};i.unstable_batchedUpdates=function(r,e){return r(e)};i.useFormState=function(r,e,t){return u.H.useFormState(r,e,t)};i.useFormStatus=function(){return u.H.useHostTransitionStatus()};i.version="19.2.8"});var E=s((R,_)=>{"use strict";function o(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o)}catch(r){console.error(r)}}o(),_.exports=l()});export{E as a};
|
|
2
|
-
/*! Bundled license information:
|
|
3
|
-
|
|
4
|
-
react-dom/cjs/react-dom.production.js:
|
|
5
|
-
(**
|
|
6
|
-
* @license React
|
|
7
|
-
* react-dom.production.js
|
|
8
|
-
*
|
|
9
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
10
|
-
*
|
|
11
|
-
* This source code is licensed under the MIT license found in the
|
|
12
|
-
* LICENSE file in the root directory of this source tree.
|
|
13
|
-
*)
|
|
14
|
-
*/
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as y}from"./chunk.QTA4ROAK.js";import{g}from"./chunk.L4DECHXR.js";import{G as R,R as c,a as f,ya as m}from"./chunk.GFF2FB2J.js";import{da as p}from"./chunk.6V2RG5JG.js";import{b as u}from"./chunk.AJZBJBMO.js";var o=u(R(),1);var r=u(c(),1),S,h=()=>S??=m(f(()=>import("./chunk.DZRTOURR.js")));function L(e){let[n,t]=(0,o.useState)(()=>h().current);return(0,o.useEffect)(()=>{if(!e||n)return;let i=!0;return h().load().then(a=>i&&t(a),()=>{}),()=>{i=!1}},[e,n]),n}function D(e,n){let t=L(n.length>0);return(0,o.useMemo)(()=>t?t.withLines(e,n):n,[t,e,n])}function I(e,n){let t=L(n.some(i=>i.shape));return(0,o.useMemo)(()=>{let i=new Map;if(!t)return i;for(let a of n){let l=t.ruleLine(a,e);l&&i.set(a.name,l)}return i},[t,e,n])}function M(e){let n=e.line;if(!(!n||e.message.endsWith(` \u2014 ${n.text}`)||e.message===b(e)))return e.message}function b(e){let n=e.line;return n?n.record!==void 0?`${n.record} \u2014 ${n.text}`:n.text:e.message}var P={name:{},op:{color:"var(--graview-ink-muted)",fontWeight:500},value:{fontWeight:600,fontVariantNumeric:"tabular-nums"},word:{color:"var(--graview-ink-muted)"},open:{color:"var(--graview-ink-faint)"},close:{color:"var(--graview-ink-faint)"}};function w({parts:e}){return(0,r.jsx)(r.Fragment,{children:e.map((n,t)=>(0,r.jsxs)("span",{children:[n.space?" ":"",(0,r.jsx)("span",{"data-graview-rule-part":n.as,style:P[n.as],children:n.text})]},t))})}function x(e,n){let t=p(e?.tryDefinition(n),n);return t.charAt(0).toUpperCase()+t.slice(1)}function C({line:e,schema:n,brand:t,lead:i=e.record===void 0?"kind":"record",stacked:a=!1,style:l}){let d=e.kind,s=i==="kind"?d?x(n,d):void 0:i==="record"?e.record:void 0,k=i==="kind"&&s?`${s}: ${e.said}`:i==="record"&&s?`${s} \u2014 ${e.said}`:e.said;return(0,r.jsxs)("span",{"data-graview-rule-line":"",style:{overflowWrap:"anywhere",...l},children:[(0,r.jsx)("span",{style:g,children:k}),(0,r.jsxs)("span",{"aria-hidden":"true",children:[i!=="none"&&d?(0,r.jsx)("span",{style:{display:"inline-flex",verticalAlign:"-0.1em",marginRight:"0.4em"},children:(0,r.jsx)(y,{kind:d,...n?{schema:n}:{},...t?{brand:t}:{},size:13})}):null,s?(0,r.jsxs)("span",{"data-graview-rule-head":"",style:{fontWeight:600,marginRight:i==="record"||a?0:"0.6em"},children:[s,i==="record"&&!a?(0,r.jsx)("span",{style:{color:"var(--graview-ink-faint)",fontWeight:400},children:" \u2014 "}):null]}):null,a&&s?(0,r.jsx)("br",{}):null,(0,r.jsx)(w,{parts:e.parts}),e.when&&e.when.length>0?(0,r.jsxs)("span",{"data-graview-rule-when":"",style:{color:"var(--graview-ink-faint)"},children:[", when ",(0,r.jsx)(w,{parts:e.when})]}):null]})]})}function z(e){return e.line?e.label&&e.label.trim().length>0?e.label:void 0:e.label&&e.label!==e.message&&!e.message.startsWith(e.label)?e.label:void 0}export{D as a,I as b,M as c,b as d,C as e,z as f};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as Se,b as Me,c as Ke,d as ue,e as F,f as Pe,h as Ce}from"./chunk.QTMWHE5O.js";import{h as Ne,i as _e,j as Ie}from"./chunk.NDADLJE6.js";import{a as oe,b as se,c as Z,d as Ge,e as Y,g as ee,h as qe}from"./chunk.HHPGWJDO.js";import{c as Re,h as g,i as Te,j as fe}from"./chunk.42YX6NOY.js";import{b as L,c as q,e as Oe,f as xe,g as G,h as v,k as K,l as X,m as C,n as Ee,na as Fe,o as V,p as R,r as k,s as Q,t as x,u as D,ua as De,v as I,va as le,w as P,wa as pe,x as n,y as U,z as Ae}from"./chunk.6V2RG5JG.js";function me(e){let o=/^(edit|remove|archive|unarchive|merge|leave-alone|allow-tidying|skip|detach|split)-(.+)$/.exec(e);return o?{act:o[1],kind:o[2]}:void 0}var he="graview-document",ye=1,be=256*1024,ge=64*1024,ke=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,$e=/^[a-z][A-Za-z0-9]*$/,cn=new Set(["id","kind"]),dn=e=>e in Object.prototype,Ue=U(e=>!dn(e),"every object already has this name \u2014 choose another"),We=(e,o)=>[...e===void 0?[]:[xe(e)],...o===void 0?[]:[Oe(o)]],h=(e,o)=>v().check(...We(e,o)),E=(e,o,r)=>R(e).check(...We(o,r)),T=e=>v().check(G(ke,`${e} names are kebab-case, lower-case words joined by hyphens like "tool-note" (field and relation names are camelCase, like "supersededBy")`)),ln=/^(?:[a-z][a-z0-9]*(?:-[a-z0-9]+)*|[a-z][A-Za-z0-9]*)$/,W=v().check(G(ln,'relation names are one camelCase word, like "supersededBy" (kind names are kebab-case, like "tool-note")'),Ue),N=v().check(G($e,'field names are one word or camelCase, like "dueDate", so rules say them bare (kind names are kebab-case, like "tool-note")'),U(e=>!cn.has(e),'a field cannot be called "id" or "kind" \u2014 the framework keeps those; try "type" or "category"'),Ue),B=h(1,500),H=h(1,2e3),re=h(1,300),pn=["string","text","number","integer","boolean","date","datetime","enum","list","url","email","image","file","app-link","phone","place","duration"],Ze=k({type:I(pn),required:n(C()),description:n(B),label:n(h(1,60)),options:n(E(h(1,80),1,100)),of:n(I(["string","number","date","image","file"])),default:n(V()),unit:n(h(void 0,12)),format:n(I(["money","percent","duration","markdown"])),min:n(K()),max:n(K()),step:n(K()),renamedFrom:n(v().check(G($e))),repeats:n(C())}).check(Ae((e,o)=>{e.type==="enum"&&!e.options&&o.addIssue({code:"custom",message:'an enum field lists its "options"',path:["options"]}),e.type!=="enum"&&e.options&&o.addIssue({code:"custom",message:'"options" belongs only on an enum field',path:["options"]}),e.type!=="list"&&e.of&&o.addIssue({code:"custom",message:'"of" belongs only on a list field',path:["of"]}),e.repeats&&e.type!=="date"&&e.type!=="datetime"&&o.addIssue({code:"custom",message:'"repeats" belongs only on a date or datetime field',path:["repeats"]})})),fn=v().check(G(new RegExp(`${ke.source}|${Fe.source}`),'a relation goes to a kind of this document, like "house", or of another app, like "@nick/house/house"')),un=k({to:x([E(fn,1),P("*")]),cardinality:n(I(["one","many"])),description:n(B),inverse:n(h(1,80)),appendOnly:n(C()),renamedFrom:n(v()),tidying:n(P("never"))}),Ye=x([H,k({expr:H,label:n(h(1,60)),description:n(B)})]),mn=k({noun:n(h(1,40)),plural:n(h(1,40)),description:n(B),fields:D(N,Ze).check(U(e=>Object.keys(e).length>0,"a kind has at least one field")),label:n(re),describe:n(re),lifecycle:n(k({field:N,retired:E(x([v(),K(),C()]),1)})),figure:n(h(void 0,2e4)),glance:n(E(N,1,20)),page:n(k({fields:n(E(N,1,40)),groups:n(E(k({title:h(1,60),fields:E(N,1,40)}),1,12))})),edges:n(D(W,un)),computed:n(D(v(),Ye).check(U(e=>Object.keys(e).length<=20,"a kind works out at most 20 computed fields"))),fieldRoles:n(D(v(),v())),renamedFrom:n(v().check(G(ke))),people:n(C()),archives:n(P(!1)),tidying:n(I(["never","no-links"]))}),ne=x([v(),K(),C(),Ee(),R(V()),k({expr:H})]),J=v().check(G(/^\$[A-Za-z][A-Za-z0-9]*$/,'a reference is "$" and a name, like "$subject" or "$new"')),gn=x([k({create:T("kind"),as:n(v().check(G($e))),set:n(D(N,ne))}),k({set:D(N,ne),target:n(J)}),k({connect:W,from:J,to:J}),k({sever:W,from:J,to:J}),k({remove:J})]),zn=k({title:n(h(1,80)),description:n(B),fromTheOtherEnd:n(h(1,80)),on:n(x([T("kind"),E(T("kind"),1)])),creates:n(T("kind")),sets:n(D(N,ne)),writes:n(E(N,1)),connects:n(W),severs:n(W),setsOther:n(D(N,ne)),replaces:n(x([P(!0),E(W,1,10)])),removes:n(P(!0)),args:n(D(N,Ze)),effects:n(E(gn,1,20)),allowedWhen:n(H),refusal:n(re),destructive:n(C())}),hn=k({act:T("act"),label:n(h(1,80)),args:n(D(v(),ne))}),yn=k({title:n(h(1,120)),description:n(B),over:x([P("graph"),T("kind")]),when:n(H),require:H,says:n(re),repairs:n(E(hn,void 0,10))}),bn=k({roles:x([E(T("role"),1),P("*")]),mutations:x([E(T("act"),1),P("*")]),kinds:n(x([R(T("kind")),P("*")])),describe:n(B),self:n(C()),ownEnd:n(C())}),Ve=n(E(T("field"),1)),kn=k({roles:x([E(T("role"),1),P("*")]),kinds:E(T("kind"),1),own:n(C()),via:n(W),fields:Ve,hide:Ve}),$n=k({grants:R(bn),sees:n(R(kn))}),wn=k({accent:n(v().check(G(/^#[0-9a-fA-F]{6}$/,'an accent is a color like "#c2577a"'))),name:n(h(1,60)),currency:n(v().check(G(/^[A-Z]{3}$/,'a currency is its three-letter code, like "USD" or "EUR"'))),locale:n(h(2,35)),logo:n(x([h(1,ge),k({src:h(1,ge),alt:n(h(1,120))})])),favicon:n(x([h(1,ge),k({emoji:v()})])),typography:n(k({display:n(h(1,200)),body:n(h(1,200)),mono:n(h(1,200))})),shape:n(k({radius:n(K().check(q(0),L(32))),density:n(K().check(q(.75),L(1.5)))})),accents:n(D(v(),K().check(q(0),L(360)))),scheme:n(I(["light","dark","auto"]))}),ze=D(v(),V()),Be=x([h(1,120),k({by:h(1,120),direction:n(I(["asc","desc"]))})]),Le=K().check(X(),q(1),L(9999)),vn=Q({create:n(C()),options:n(Q({sort:n(Be),columnSort:n(Be),horizon:n(x([K().check(X(),q(1),L(200)),Q({years:K().check(X(),q(1),L(200)),title:h(1,80),from:n(Le),to:n(Le)})]))}))}),jn=k({card:n(R(V())),row:n(R(V())),page:n(R(V()))}),Sn=()=>{let e=n(I(["asc","desc"]));return x([h(1,120),k({by:h(1,120),direction:e,then:n(x([h(1,120),k({by:h(1,120),direction:e})]))})])},On=()=>x([h(1,120),k({by:h(1,120),order:n(E(h(1,80),void 0,40)),closed:n(E(h(1,80),void 0,40))})]),xn=Q({order:n(R(v())),hide:n(R(v())),first:n(v()),primary:n(E(h(1,80),void 0,40)),scene:n(h(1,40)),pages:n(h(1,40)),lists:n(D(v(),k({filters:n(E(h(1,120),void 0,40)),sort:n(Sn()),group:n(On())})))}),Je=k({$schema:n(v()),format:P(he),formatVersion:P(ye),name:h(1,80),description:n(B),version:n(K().check(X(),q(1))),kinds:D(T("kind"),mn).check(U(e=>Object.keys(e).length>0,"a document declares at least one kind"),U(e=>Object.keys(e).length<=40,"a document declares at most 40 kinds")),computed:n(D(v(),Ye)),acts:n(D(T("act"),zn)),rules:n(D(T("rule"),yn)),roles:n(R(T("role"))),policy:n($n),modules:n(ze),lenses:n(R(vn)),pages:n(xn),views:n(D(v(),x([jn,R(V())]))),brand:n(wn),settings:n(R(ze)),migrations:n(R(ze))});var En={};function He(e,o=En,r=ye){let{document:a,respelled:l}=Se(e),p=l.length>0?{respelled:l}:{};if(!a||typeof a!="object"||Array.isArray(a))return{document:a};let u=a;if(u.format!==he||typeof u.formatVersion!="number"||u.formatVersion>=r)return{document:a,...p};let z=u.formatVersion,$=structuredClone(u);for(let s=z;s<r;s++){let t=o[s];if(!t)throw new Error(`there is no upgrade from format ${s} to ${s+1}`);$={...t($),formatVersion:s+1}}return{document:$,from:z,...p}}function Xe(e,o,r){let a=Object.keys(e).filter(z=>e[z].edges?.[o]!==void 0);if(a.length===0)return;let l=a.map(z=>e[z].edges[o].to),p=l.some(z=>z==="*")?"*":[...new Set(l.flatMap(z=>z))];if(r.length===0||r.some(z=>a.includes(z)))return{reversed:!1,kinds:p};let u=a.filter(z=>{let $=e[z].edges[o].to;return $==="*"||r.every(s=>$.includes(s))});return u.length>0?{reversed:!0,kinds:u}:{reversed:!1,kinds:p}}var nn=(e,o)=>{let r=e?.fields[o];return r!==void 0&&(r.type==="duration"||(r.type==="number"||r.type==="integer")&&r.format==="duration")};function Qe(e,o,r,a){if(a==="out"){let l=e[o]?.edges?.[r]?.to;return l===void 0?[]:l==="*"?Object.keys(e):l}return Object.entries(e).filter(([,l])=>{let p=l.edges?.[r]?.to;return p!==void 0&&(p==="*"||p.includes(o))}).map(([l])=>l)}function we(e,o,r){if(r.t==="ident")return e[o]?.edges?.[r.name]?Qe(e,o,r.name,"out"):void 0;if(r.t==="where")return we(e,o,r.set);if(r.t==="call"&&(r.fn==="out"||r.fn==="in")&&r.args[0]?.t==="lit"&&typeof r.args[0].value=="string")return Qe(e,o,r.args[0].value,r.fn)}var en=(e,o,r)=>{let a=o.filter(l=>e[l]?.fields[r]!==void 0);return a.length>0&&a.every(l=>nn(e[l],r))};function tn(e,o,r){let a=e.kinds,l=a[o],p=new Map(r),u=new Map,z=(s,t)=>{if(t>8)return!1;switch(s.t){case"ident":return nn(l,s.name)||$(s.name,t+1);case"member":{let d=we(a,o,s.object);return d!==void 0&&en(a,d,s.name)}case"call":{if(s.fn!=="sum"&&s.fn!=="min"&&s.fn!=="max")return!1;let[d,w]=s.args,f=d&&we(a,o,d);return f!==void 0&&w?.t==="ident"&&en(a,f,w.name)}case"binary":return(s.op==="+"||s.op==="-")&&z(s.left,t)&&z(s.right,t);case"unary":return s.op==="-"&&z(s.operand,t);default:return!1}},$=(s,t)=>{if(l?.computed?.[s]===void 0)return!1;if(u.has(s))return u.get(s);u.set(s,!1);let d=p.get(s),w=d!==void 0&&z(d,t);return u.set(s,w),w};return r.map(([s])=>s).filter(s=>$(s,0))}function on(e,o,r=`kinds.${e}.page`){let a=o.page;if(!a)return[];let l=[],p=[...Object.keys(o.fields),...Object.keys(o.computed??{})],u=new Set,z=(s,t)=>{p.includes(s)?u.has(s)&&l.push(g("page-field-twice",t,`"${s}" is on ${e}'s page twice; name each field once`)):l.push(g("page-field",t,`${e}'s page is to show "${s}", and ${e} has no field or computed field called that`,`use one of: ${p.join(", ")}`)),u.add(s)};(a.fields??[]).forEach((s,t)=>z(s,`${r}.fields.${t}`));let $=new Set;return(a.groups??[]).forEach((s,t)=>{let d=s.title.trim().toLowerCase();$.has(d)&&l.push(g("page-group-twice",`${r}.groups.${t}.title`,`${e}'s page has two groups called "${s.title}"; give each its own title`)),$.add(d),s.fields.forEach((w,f)=>z(w,`${r}.groups.${t}.fields.${f}`))}),l}var An=new Set(["subject","now","today","me"]);function Fn(e){if((typeof e=="string"?e:JSON.stringify(e??null)).length>be)return{findings:[g("too-large","",`a document may be at most ${be/1024} KB`)]};if(typeof e=="string")try{e=JSON.parse(e)}catch(a){return{findings:[g("not-json","",`this is not JSON: ${a.message}`)]}}try{e=He(e).document}catch(a){return{findings:[g("format","formatVersion",a.message)]}}let o=Je.safeParse(e);if(!o.success)return{findings:o.error.issues.map(a=>{let l=a.path.map(String).join(".");if(a.code==="unrecognized_keys")return g("unknown-key",l,`${a.keys.map(p=>`"${p}"`).join(", ")} ${a.keys.length===1?"is":"are"} not part of a Graview document here`,"check the spelling against docs/declaration-document.md");if(a.code==="invalid_union"&&/\.effects\.\d+$/.test(l))return g("effect-shape",l,"this effect is not one Graview knows",'an effect is one of {"create": kind, "as"?: name, "set"?: {field: value}}, {"set": {field: value, \u2026}, "target"?: "$ref"}, {"connect"|"sever": relation, "from": "$ref", "to": "$ref"}, {"remove": "$ref"}');if(a.code==="invalid_key"){let p=a.issues?.[0]?.message;return g("shape",l,`the name "${String(a.path.at(-1))}" is not allowed here${p?`: ${p}`:""}`)}return g("shape",l,a.message)})};let r=o.data;return{document:r,findings:Dn(r)}}var ae=e=>[e??[]].flat();function sn(e){let o=new Map;for(let[r,a]of Object.entries(e.kinds))for(let[l,p]of Object.entries(le(a.edges))){let u=o.get(l);o.set(l,{name:l,from:[...u?.from??[],r],to:p.to==="*"||u?.to==="*"?"*":[...new Set([...u?.to??[],...p.to])],cardinality:p.cardinality??"many"})}return o}function lt(e){let o=new Map;for(let[a,l]of Object.entries(e.kinds)){let p=ee(l),u=pe(l.edges);o.set(a,{fields:new Set([...Object.keys(l.fields),...u.keys()]),edges:new Map(Object.entries(le(l.edges)).map(([z,$])=>[z,$.cardinality??"many"])),...p?{computed:p}:{},...u.size>0?{linked:u}:{}})}let r=ee(e);return r&&o.set(Re,{computed:r}),o}function rn(e,o){let r=[],a=ae(e.on),l=(p,u)=>{let z=Xe(o.kinds,p,a)?.reversed===!0,[$,s]=z?["$to","$subject"]:["$subject","$to"];return u==="connect"?{connect:p,from:$,to:s}:{sever:p,from:$,to:s}};if(e.creates){let p=o.kinds[e.creates],u={};for(let z of Object.keys(p?.fields??{}))u[z]=`$${z}`;for(let z of e.effects??[])"set"in z&&!("create"in z)&&F(z.target)==="new"&&Object.assign(u,z.set);r.push({create:e.creates,as:"new",set:u})}return e.sets&&r.push({set:e.sets}),e.writes&&!(e.creates&&e.on===void 0)&&r.push({set:Object.fromEntries(e.writes.map(p=>[p,`$${p}`]))}),e.connects&&(e.replaces&&r.push({replace:e.replaces===!0?[e.connects]:[...e.replaces],keep:e.connects}),r.push(l(e.connects,"connect"))),e.severs&&r.push(l(e.severs,"sever")),e.setsOther&&(e.connects||e.severs)&&r.push({set:e.setsOther,target:"$to"}),e.removes&&r.push({remove:"$subject"}),e.effects&&r.push(...e.effects.filter(p=>!(e.creates&&"set"in p&&!("create"in p)&&F(p.target)==="new"))),r}function ve(e,o,r){try{let a=Z(e),l=oe(a);for(let p of l.unknownFunctions)r.push(g("unknown-function",o,`"${p}" is not a function the rule language knows`,"see docs/declaration-document.md#expression-language"));return a}catch(a){if(a instanceof se){r.push(g("expression",o,a.sentence+` (at character ${a.at+1})`));return}throw a}}function je(e,o,r){try{return Y(e)}catch(a){if(a instanceof Ge||a instanceof se){r.push(g("template",o,(a instanceof se,a.sentence)));return}throw a}}function Dn(e){let o=[],r=new Set(Object.keys(e.kinds)),a=sn(e),l=e.acts??{},p=new Set(e.roles??[]),u=(s,t)=>pe(e.kinds[s]?.edges).has(t),z=s=>Object.keys(e.kinds).some(t=>u(t,s));for(let[s,t]of Object.entries(e.kinds)){let d=`kinds.${s}`;for(let[f,c]of Object.entries(t.edges??{})){if(!De(c)&&c.to!=="*")for(let i of c.to)r.has(i)||o.push(g("edge-target",`${d}.edges.${f}.to`,`"${i}" is not a kind this document declares`));t.fields[f]&&o.push(g("edge-field-clash",`${d}.edges.${f}`,`"${f}" is both a field and a relation of ${s}`,"rename one of them"))}t.lifecycle&&!t.fields[t.lifecycle.field]&&o.push(g("lifecycle-field",`${d}.lifecycle.field`,`${s} has no field "${t.lifecycle.field}"`));let w=f=>t.computed!==void 0&&Object.hasOwn(t.computed,f);for(let f of t.glance??[])!t.fields[f]&&!w(f)&&o.push(g("glance-field",`${d}.glance`,`a glance at ${s} is to say "${f}", and ${s} has no field or computed field called that`,`use one of: ${[...Object.keys(t.fields),...Object.keys(t.computed??{})].join(", ")}`));o.push(...on(s,t));for(let f of["label","describe"]){let c=t[f];if(!c)continue;let i=je(c,`${d}.${f}`,o);for(let A of i??[])if(A.expr){for(let y of oe(A.expr).names)if(!t.fields[y]){if(w(y)){qe(t,y)||o.push(g("template-field",`${d}.${f}`,`${s}'s ${y} is worked out from beyond the record, and a ${f} is said with no graph to read`,`show it in a view instead, or name a computed field worked out from ${s}'s own fields`));continue}o.push(g("template-field",`${d}.${f}`,`${s} has no field "${y}" for its ${f} to show`,f==="label"?"a label can only show the record's own fields and what they work out":void 0))}}}for(let[f,c]of Object.entries(t.fields)){c.default!==void 0&&c.type==="enum"&&!c.options?.includes(String(c.default))&&o.push(g("default-option",`${d}.fields.${f}.default`,`"${String(c.default)}" is not one of ${f}'s options`));let i=`${f}Repeat`;c.repeats&&(t.fields[i]||t.edges?.[i]||t.computed?.[i])&&o.push(g("repeat-clash",`${d}.fields.${f}.repeats`,`${s} already has "${i}", where how ${f} repeats is kept`))}}for(let[s,t]of Object.entries(l)){let d=`acts.${s}`;for(let i of ae(t.on))r.has(i)||o.push(g("act-kind",`${d}.on`,`"${i}" is not a kind this document declares`));let w=ae(t.on),f=rn(t,e);if(t.creates&&t.on===void 0&&t.writes&&r.has(t.creates)){for(let i of t.writes)if(!e.kinds[t.creates].fields[i])if(e.kinds[t.creates].computed?.[i]!==void 0)o.push(g("computed-written",`${d}.writes`,`${t.creates}'s ${i} is worked out, not written: no act can set it`,"write the stored fields it is worked out from"));else{if(u(t.creates,i))continue;o.push(g("act-field",`${d}.writes`,`${t.creates} has no field "${i}"`))}}f.length===0&&o.push(g("act-empty",d,`"${s}" does nothing`,"give it effects or a shorthand such as sets or creates"));let c=new Map;f.forEach((i,A)=>{let y=f.length-(t.effects?.length??0),j=t.effects&&A>=y?`${d}.effects.${A-y}`:d;if("create"in i){if(!r.has(i.create))o.push(g("act-kind",`${j}.create`,`"${i.create}" is not a kind this document declares`));else for(let b of Object.keys(i.set??{}))e.kinds[i.create].fields[b]||(e.kinds[i.create].computed?.[b]!==void 0?o.push(g("computed-written",`${j}.set.${b}`,`${i.create}'s ${b} is worked out, not written: no act can set it`,"set the stored fields it is worked out from")):o.push(g("act-field",`${j}.set.${b}`,`${i.create} has no field "${b}"`)));i.as&&c.set(i.as,i.create)}else if("connect"in i||"sever"in i){let b="connect"in i?i.connect:i.sever;!a.has(b)&&!z(b)&&o.push(g("act-edge",`${j}.${"connect"in i?"connect":"sever"}`,`"${b}" is not a relation any kind declares`)),F(i.from)==="subject"&&w.length===0&&o.push(g("act-subject",`${d}.on`,`"${s}" acts on "$subject" but does not say which kinds it is "on"`))}else if("set"in i){let b=F(i.target??"$subject"),ce=b==="subject"?w:c.has(b??"")?[c.get(b)]:[];b==="subject"&&w.length===0&&o.push(g("act-subject",`${d}.on`,`"${s}" changes "$subject" but does not say which kinds it is "on"`));for(let _ of Object.keys(i.set))for(let m of ce)if(!(!r.has(m)||e.kinds[m].fields[_]))if(e.kinds[m].computed?.[_]!==void 0)o.push(g("computed-written",`${j}.set.${_}`,`${m}'s ${_} is worked out, not written: no act can set it`,"set the stored fields it is worked out from"));else{if(u(m,_))continue;o.push(g("act-field",`${j}.set.${_}`,`${m} has no field "${_}"`))}}else"remove"in i&&F(i.remove)==="subject"&&w.length===0&&o.push(g("act-subject",`${d}.on`,`"${s}" removes "$subject" but does not say which kinds it is "on"`));("set"in i&&i.set?Object.values(i.set):[]).forEach(b=>{b&&typeof b=="object"&&!Array.isArray(b)&&"expr"in b&&ve(b.expr,`${j}.set`,o)})}),t.allowedWhen&&ve(t.allowedWhen,`${d}.allowedWhen`,o),t.refusal&&je(t.refusal,`${d}.refusal`,o)}for(let[s,t]of Object.entries(e.rules??{})){let d=`rules.${s}`;t.over!=="graph"&&!r.has(t.over)&&o.push(g("rule-kind",`${d}.over`,`"${t.over}" is not a kind this document declares`));let w=t.over==="graph"?void 0:e.kinds[t.over];for(let f of["when","require"]){let c=t[f];if(!c)continue;let i=ve(c,`${d}.${f}`,o);if(!i)continue;let A=oe(i);for(let y of A.names)if(t.over==="graph")o.push(g("rule-name",`${d}.${f}`,`"${y}" means nothing in a rule over the whole graph`,`name a kind in "over", or use all('kind')`));else if(w&&!w.fields[y]&&!w.edges?.[y]&&w.computed?.[y]===void 0){let j=Object.keys(w.edges??{}).find(S=>S.includes("-")&&S.split("-").includes(y));o.push(g("rule-name",`${d}.${f}`,`${t.over} has no field or relation called "${y}"`,j?`"${j}" reads as a subtraction in a rule; rename the relation to one camelCase word, like "${j.replace(/-([a-z0-9])/g,(S,b)=>b.toUpperCase())}"`:void 0))}for(let y of A.edges)!a.has(y)&&!z(y)&&o.push(g("rule-edge",`${d}.${f}`,`"${y}" is not a relation any kind declares`));for(let y of A.sweeps)r.has(y)?t.over!=="graph"&&o.push(Te("rule-cost",`${d}.${f}`,`this rule looks at every ${y} for every ${t.over}, which grows slowly as the app grows`,"walk a relation with out()/in() instead of all() where you can")):o.push(g("rule-kind",`${d}.${f}`,`"${y}" is not a kind this document declares`))}t.says&&je(t.says,`${d}.says`,o),(t.repairs??[]).forEach((f,c)=>{!l[f.act]&&!me(f.act)&&o.push(g("repair-act",`${d}.repairs.${c}.act`,`"${f.act}" is not an act this document declares`))})}let $=e.policy;return $&&($.grants.forEach((s,t)=>{if(s.roles!=="*"&&p.size>0)for(let d of s.roles)p.has(d)||o.push(g("grant-role",`policy.grants.${t}.roles`,`"${d}" is not one of the document's roles`));if(s.mutations!=="*")for(let d of s.mutations)!l[d]&&!me(d)&&o.push(g("grant-act",`policy.grants.${t}.mutations`,`"${d}" is not an act this document declares`))}),($.sees??[]).forEach((s,t)=>{for(let d of s.kinds)r.has(d)||o.push(g("sight-kind",`policy.sees.${t}.kinds`,`"${d}" is not a kind this document declares`));if(s.roles!=="*"&&p.size>0)for(let d of s.roles)p.has(d)||o.push(g("sight-role",`policy.sees.${t}.roles`,`"${d}" is not one of the document's roles`))})),o.push(...Ie(e)),o}function Rn(e,o,r,a){let l=new Map,p=ae(e.on),u=new Map,z=new Map;(p.length>0||o.some(c=>"remove"in c&&F(c.remove)==="subject"||"from"in c&&(F(c.from)==="subject"||F(c.to)==="subject")||"set"in c&&!("create"in c)&&F(c.target??"$subject")==="subject"))&&l.set(ue,{ref:p.length>0?p:"*",required:!0});let s=e.args??{},t=e.writes?.length===1,d=(c,i)=>i&&c.type===i.type&&c.min===void 0&&c.max===void 0&&c.step===void 0?{...c,...i.min===void 0?{}:{min:i.min},...i.max===void 0?{}:{max:i.max},...i.step===void 0?{}:{step:i.step}}:c,w=(c,i)=>i&&c.type===i.type&&c.format===void 0&&c.unit===void 0?{...d(c,i),...i.format?{format:i.format}:{},...i.unit?{unit:i.unit}:{}}:d(c,i),f=(c,i,A)=>{if(c===ue||An.has(c)||u.has(c)||l.has(c))return;let y=s[c]?w(s[c],A):void 0;l.set(c,y?{field:y,optional:!y.required,required:!!y.required}:i())};for(let c of o)if("create"in c){let i=r.kinds[c.create];for(let[A,y]of Object.entries(c.set??{})){let j=F(y),S=i?.fields[A];if(j&&S){let b=!!S.required&&S.default===void 0;f(j,()=>({field:S,optional:!b,required:b}),S)}}c.as&&u.set(c.as,c.create)}else if("connect"in c||"sever"in c){let i=a.get("connect"in c?c.connect:c.sever);for(let[A,y]of[["from",c.from],["to",c.to]]){let j=F(y);if(!j)continue;let S=A==="to"?i?.to??"*":i?.from??"*";S!=="*"&&!z.has(j)&&z.set(j,S),f(j,()=>({ref:S,required:!0}))}}else if("set"in c){let i=F(c.target??"$subject"),A=i==="subject"?p[0]:u.get(i??"")??z.get(i??"")?.[0];i&&i!=="subject"&&!u.has(i)&&f(i,()=>({ref:"*",required:!0}));for(let[y,j]of Object.entries(c.set)){let S=F(j);if(!S)continue;let b=A?r.kinds[A]?.fields[y]:void 0;f(S,()=>b?{field:b,optional:!t,required:t}:{any:!0,required:!1},b)}}else if("remove"in c){let i=F(c.remove);i&&f(i,()=>({ref:"*",required:!0}))}for(let[c,i]of Object.entries(s))l.has(c)||l.set(c,{field:i,optional:!i.required,required:!!i.required});return l}function pt(e,o={}){let r=Fn(e);if(!r.document||fe(r.findings))return{ok:!1,findings:r.findings};let a=r.document,l=[...r.findings];o.previous&&l.push(...Mn(a,o.previous));let p=Tn(a,l);return fe(p.findings)?{ok:!1,findings:p.findings}:Ce(p,o)}function ie(e,o){return e.map(r=>{let a=!r.format&&r.expr?.t==="ident"?o?.[r.expr.name]?.format:void 0;return a==="money"||a==="percent"?{...r,format:a}:r})}function Tn(e,o){let r=sn(e),a={};for(let[s,t]of Object.entries(e.kinds)){let d=Pe(t),w=t.label??(d?`{${d}}`:void 0),f=ee(t),c=f?tn(e,s,[...f]):[];a[s]={...w?{label:ie(Y(w),t.fields)}:{},...t.describe?{describe:ie(Y(t.describe),t.fields)}:{},...f?{computed:[...f]}:{},...c.length>0?{durations:c}:{}}}let l={};for(let[s,t]of Object.entries(e.acts??{})){let d=rn(t,e),w=Rn(t,d,e,r),f=t.destructive??d.some(m=>"remove"in m||"sever"in m||"replace"in m),c=[...new Set(d.flatMap(m=>"create"in m?[m.create]:[]))],i=[...new Set(d.flatMap(m=>"connect"in m?[m.connect]:[]))],A=[...new Set(d.flatMap(m=>"sever"in m?[m.sever]:"replace"in m?m.replace:[]))],y=[...new Set(d.flatMap(m=>"set"in m&&!("create"in m)&&F(m.target??"$subject")==="subject"?Object.keys(m.set):[]))],j=new Map;for(let m of d){if(!("connect"in m)&&!("sever"in m))continue;let O=r.get("connect"in m?m.connect:m.sever);for(let[M,an]of[["from",m.from],["to",m.to]]){let te=F(an),de=M==="to"?O?.to:O?.from;te&&te!=="subject"&&de&&de!=="*"&&j.set(te,[...new Set([...j.get(te)??[],...de])])}}let S={};for(let m of d){if(!("set"in m)||"create"in m)continue;let O=F(m.target??"$subject");for(let M of O&&O!=="subject"&&j.get(O)||[])S[M]=[...new Set([...S[M]??[],...Object.keys(m.set)])]}let b={};for(let m of d)if(!(!("set"in m)||"create"in m||F(m.target??"$subject")!=="subject"))for(let[O,M]of Object.entries(m.set??{}))typeof M=="string"&&F(M)===void 0||typeof M=="number"||typeof M=="boolean"?b[O]=typeof M=="string"&&M.startsWith("$$")?M.slice(1):M:delete b[O];let ce=c.length===0&&d.every(m=>!("set"in m)||!m.set||Object.values(m.set).every(O=>!(O&&typeof O=="object"&&!Array.isArray(O)&&"expr"in O))),_=new Map;for(let m of d)if(!(!("set"in m)||!m.set))for(let O of Object.values(m.set))O&&typeof O=="object"&&!Array.isArray(O)&&"expr"in O&&_.set(O.expr,Z(O.expr));l[s]={title:t.title??s.replace(/-/g," "),effects:d,args:[...w],...t.allowedWhen?{guard:Z(t.allowedWhen)}:{},...t.refusal?{refusal:ie(Y(t.refusal),e.kinds[[t.on??[]].flat()[0]??""]?.fields)}:{},exprs:[..._],destructive:f,idempotent:ce,creates:c,connects:i,severs:A,writes:y,writesOther:S,sets:b}}let p={};for(let[s,t]of Object.entries(e.rules??{}))p[s]={title:t.title??s.replace(/-/g," "),require:Z(t.require),...t.when?{when:Z(t.when)}:{},...t.says?{says:ie(Y(t.says),e.kinds[t.over]?.fields)}:{}};let u=Me(e,o),z=Ne(e),$=_e(e);return{format:Ke,document:e,findings:o,kinds:a,...e.computed?{facts:[...ee(e)??[]]}:{},edges:[...r].map(([s,{from:t,to:d,cardinality:w}])=>[s,{from:t,to:d,cardinality:w}]),acts:l,rules:p,brand:u,...Object.keys(z).length>0?{viewSpecs:z}:{},...$?{home:$}:{}}}function ft(e,o,r){let a=/^defineNode\("([^"]+)"\)/.exec(o)?.[1],l=a?r.kinds[a]:void 0;if(!a||!l)return e;let p=Object.keys(l.fields).filter(u=>u!=="label").slice(0,3);return{...e,path:`kinds.${a}.glance`,fix:`Say which: "glance": [${p.map(u=>`"${u}"`).join(", ")}] on kinds.${a} \u2014 the facts a person compares one by, at a glance.`}}function Mn(e,o){let r=[],a=new Set(Object.values(o.kinds).flatMap(l=>Object.keys(l.edges??{})));for(let[l,p]of Object.entries(e.kinds)){let u=p.renamedFrom;u&&!o.kinds[u]&&r.push(g("renamed-from-nothing",`kinds.${l}.renamedFrom`,`${l} says it was ${u}, and the previous version has no kind called ${u}`,"name the kind it was, or drop renamedFrom"));let z=o.kinds[u??l];for(let[$,s]of Object.entries(p.fields)){let t=s.renamedFrom;t&&!z?.fields[t]&&r.push(g("renamed-from-nothing",`kinds.${l}.fields.${$}.renamedFrom`,`${$} says it was ${t}, and the previous ${u??l} has no field called ${t}`,"name the field it was, or drop renamedFrom"))}for(let[$,s]of Object.entries(p.edges??{})){let t=s.renamedFrom;t&&!a.has(t)&&r.push(g("renamed-from-nothing",`kinds.${l}.edges.${$}.renamedFrom`,`${$} says it was ${t}, and the previous version has no relation called ${t}`,"name the relation it was, or drop renamedFrom"))}}return r}export{Fn as a,lt as b,rn as c,pt as d,ft as e};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{G as g,R as u}from"./chunk.GFF2FB2J.js";import{b as m}from"./chunk.AJZBJBMO.js";var d=m(g(),1),n=m(u(),1),f=/^\s*(\d{1,6})[.)]\s+(.*)$/s,c=/^\s*[-*•]\s+(.*)$/s;function S(o){let s=[];for(let p of o.replace(/\r\n?/g,`
|
|
2
|
-
`).split(/\n[ \t]*\n+/)){let t=null,a=()=>{t&&(t.t==="p"?t.lines.length>0:t.items.length>0)&&s.push(t),t=null};for(let e of p.split(`
|
|
3
|
-
`)){let i=f.exec(e),l=i?null:c.exec(e);if(i)t?.t!=="ol"&&(a(),t={t:"ol",start:Number(i[1]),items:[]}),t.items.push(i[2]);else if(l)t?.t!=="ul"&&(a(),t={t:"ul",items:[]}),t.items.push(l[1]);else if(t&&t.t!=="p"&&/^\s+\S/.test(e)){let r=t.items;r[r.length-1]=`${r[r.length-1]} ${e.trim()}`}else e.trim().length>0&&(t?.t!=="p"&&(a(),t={t:"p",lines:[]}),t.lines.push(e.trim()))}a()}return s}function b(o){return/[\r\n]/.test(o)}var h={display:"grid",gap:"0.7em",minWidth:0,overflowWrap:"anywhere"},k={margin:0},y={margin:0,paddingInlineStart:"1.6em",display:"grid",gap:"0.3em"},x=(0,d.lazy)(()=>import("./chunk.VS7K3SCD.js"));function B({text:o,className:s,style:p,markdown:t,headingsFrom:a}){return t?(0,n.jsx)(d.Suspense,{fallback:(0,n.jsx)(B,{text:o,...s?{className:s}:{},...p?{style:p}:{}}),children:(0,n.jsx)(x,{text:o,...s?{className:s}:{},...p?{style:p}:{},...a?{headingsFrom:a}:{}})}):(0,n.jsx)("div",{"data-graview-text-body":"",...s?{className:s}:{},style:{...h,...p},children:S(o).map((e,i)=>e.t==="p"?(0,n.jsx)("p",{style:k,children:e.lines.map((l,r)=>(0,n.jsxs)("span",{children:[r>0?(0,n.jsx)("br",{}):null,l]},r))},i):e.t==="ol"?(0,n.jsx)("ol",{start:e.start,style:y,children:e.items.map((l,r)=>(0,n.jsx)("li",{children:l},r))},i):(0,n.jsx)("ul",{style:y,children:e.items.map((l,r)=>(0,n.jsx)("li",{children:l},r))},i))})}export{b as a,B as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as ie}from"./chunk.3VL5WECB.js";import{b as Te,d as Ce}from"./chunk.JH6MU6TX.js";import{e as je}from"./chunk.WAFDCOOG.js";import{$ as Ne,Ac as We,G as be,Hb as te,Ja as we,La as E,S as R,Sc as Me,T as ke,V as B,W as L,X as xe,Y as v,_ as Ae,fc as re,jc as Se,kc as ve,vc as Oe,xc as Re,zc as De}from"./chunk.6V2RG5JG.js";function oe(n,e){return n.display?.labels?.[e]??v(e)}function ae(n){let e=ie(n);switch(e.type){case"text":case"date":case"number":case"boolean":case"choice":return e.type;default:return}}function Ye(n,e){let t=new Map,r=n.tryDefinition(e);for(let[o,i]of Object.entries(r?.edges??{}))t.set(o,{key:o,label:i.description?R(i.description):v(o),about:"edge",far:i.to==="*"?[...n.kinds]:[...i.to]});for(let o of n.definitions)if(o.kind!==e)for(let[i,d]of Object.entries(o.edges??{}))t.has(i)||d.to!=="*"&&!d.to.includes(e)||t.set(i,{key:i,label:d.inverse?R(d.inverse):v(i),about:"edge",far:[o.kind]});return[...t.values()]}var Je=["current","past","any","flagged","clear"];function Ie(n,e){let t=n?.lifecycle;if(!t||t.retired==="date")return!1;let r=t.retired.map(String);return e.some(o=>o.key===t.field&&r.includes(o.value))}function Fe(n,e){let t=n.tryDefinition(e);if(!t)return{kind:e,sorts:[],filters:[],groups:[]};let r=new Set(t.display?.hide??[]),o=t.fields.shape??{},i=[{key:"label",label:"Name",about:"label",type:"text"}],d=[],f=[];for(let[g,p]of Object.entries(o)){if(g==="id"||g==="kind"||g==="label"||r.has(g))continue;let A=ae(p);if(!A)continue;let O=oe(t,g),N=A==="choice"?Be(p):A==="boolean"?["true","false"]:void 0,w={key:g,label:O,about:"field",type:A,...N?{options:N}:{}};i.push(w),d.push(w),(A==="boolean"||A==="choice")&&f.push(w),A==="date"&&f.push({...w,buckets:["day","week","month","year","decade"]})}for(let g of Ye(n,e))i.push(g),d.push(g),f.push(g);let l={key:"is",label:t.lifecycle?"Standing and currency":"Standing",about:"is",type:"choice",options:t.lifecycle?[...Je]:["flagged","clear"]};d.push(l);let y=t.fieldRoles?.order,u=y&&(y in o||y==="label")?{by:y,direction:"asc"}:void 0;return{kind:e,sorts:i,filters:d,groups:f,...u?{natural:u}:{}}}function vn(n,e){let t=[];for(let o of e.filters){let i=o.about==="edge"&&o.far?.length===1?n.tryDefinition(o.far[0]):void 0;if(!(!i||i.kind===e.kind))for(let[d,f]of Object.entries(i.fields.shape??{}))ae(f)!=="choice"||i.display?.hide?.includes(d)||t.push({key:`${o.key}.${d}`,label:`${o.label} \xB7 ${oe(i,d)}`,about:"via",type:"choice",options:Be(f),far:[i.kind]})}if(t.length===0)return e;let r=e.filters.filter(o=>o.about!=="is");return{...e,filters:[...r,...t,...e.filters.filter(o=>o.about==="is")]}}function On(n,e){let t=n.tryDefinition(e.kind),r=Object.entries(t?.computed??{});if(!t||r.length===0)return e;let o=r.filter(([i])=>!e.sorts.some(d=>d.key===i)).map(([i,d])=>({key:i,label:(typeof d=="object"?d.label:void 0)??oe(t,i),about:"field",type:"number"}));return{...e,sorts:[...e.sorts,...o]}}function Be(n){let e=ie(n);return e.type==="choice"?e.options:[]}var $e=n=>n,Pe=n=>n;function Ze(n,e,t){let r=new Map;for(let o of[...n.out(e,t),...n.in(e,t)])r.set(o.id,o);return[...r.values()]}function se(n,e,t){let r=n.schema.tryDefinition(e.kind);if(t.key==="is")switch(t.value){case"current":return B(r,Pe(e),n.today);case"past":return!B(r,Pe(e),n.today);case"any":return!0;case"flagged":return n.flagged?.has(e.id)??!1;case"clear":return!(n.flagged?.has(e.id)??!1);default:return!0}let o=r?.fields.shape??{};if(t.key in o){let l=we($e(e),t.key,n.today??be()),y=ae(o[t.key]);if(y==="date"){let[u,g]=t.value.split(":");if(typeof l!="string"||!g)return!1;let p=l.slice(0,10);return u==="before"?p<g:u==="after"?p>g:p===g}if(y==="boolean")return String(l)===t.value;if(y==="number"){let u=t.value.lastIndexOf(":"),g=u>0?t.value.slice(0,u):"",p=Number(t.value.slice(u+1));if(g==="at-most"||g==="at-least")return typeof l!="number"||!Number.isFinite(p)?!1:g==="at-most"?l<=p:l>=p}return String(l)===t.value}let[i,d]=t.key.split("."),f=Ze(n.graph,e.id,i);return d?f.some(l=>String($e(l)[d])===t.value):t.value==="*"?f.length>0:t.value==="none"?f.length===0:f.some(l=>l.id===t.value)}var en=5;function _e(n){return n.normalize("NFD").replace(/\p{M}+/gu,"").toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim()}function de(n){return _e(n).replace(/ /g,"")}var _=new Map,nn=5e4;function K(n){let e=_.get(n);if(e===void 0){_.size>=nn&&_.clear();let t=_e(n);e={tokens:t.split(" ").filter(Boolean),whole:t.replace(/ /g,"")},_.set(n,e)}return e}var D=n=>[...K(n).tokens];function j(n,e){if(e.length===0)return;let{whole:t,tokens:r}=K(n),o=e.join("");if(t.length===0)return;if(t===o)return"exact";if(e.every(d=>r.some(f=>f.startsWith(d))))return t.startsWith(o)?"prefix":e.every(d=>r.includes(d))?"word":"part"}function q(n,e,t=48){let r=n.replace(/\s+/g," ").trim();if(r.length<=t)return r;let o=e[0],i=r.normalize("NFD").replace(/\p{M}/gu,"").toLowerCase(),d=o?i.search(new RegExp(`(^|[^\\p{L}\\p{N}])${tn(o)}`,"u")):-1,f=d<0?0:d+(i[d]&&/[\p{L}\p{N}]/u.test(i[d])?0:1),l=Math.max(0,f-Math.floor(t/3));if(l>0){let u=r.lastIndexOf(" ",l);l=u<0?0:u+1}let y=Math.min(r.length,l+t);if(y<r.length){let u=r.indexOf(" ",y);y=u<0||u-y>16?y:u}return`${l>0?"\u2026":""}${r.slice(l,y).trim()}${y<r.length?"\u2026":""}`}var tn=n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),rn=/^([\p{L}][\p{L}\p{N}_-]*):(\S+)$/u;function on(n){let e=[],t=[];for(let r of n.trim().split(/\s+/).filter(Boolean)){let o=rn.exec(r);o?t.push({key:o[1],value:o[2]}):e.push(r)}return{words:e.join(" "),conditions:t}}var Le=new WeakMap;function G(n,e){let t=Le.get(e);if(t&&t.definition===n)return t.texts;let r=an(n,e);return Le.set(e,{definition:n,texts:r}),r}function an(n,e){let t=L(n,e),r=[{field:"label",reading:"Name",text:t}];for(let o of Ce(e,n,{limit:Number.POSITIVE_INFINITY}))o.key==="label"||o.value===t||typeof e[o.key]!="boolean"&&r.push({field:o.key,reading:o.label,text:o.markdown?je(o.value):o.value});return r}var T={exact:0,prefix:1,word:2,part:3,field:4,near:5},ze=new Set(["a","an","the","of","and","or","for","to","in","on","at","by","with","my","our","is"]);function Ee(n){let e=n;e.length>4&&e.endsWith("ies")?e=`${e.slice(0,-3)}y`:e.length>4&&/(ss|x|ch|sh|z)es$/.test(e)?e=e.slice(0,-2):e.length>3&&e.endsWith("s")&&!/(ss|us|is)$/.test(e)&&(e=e.slice(0,-1));for(let t of["ing","ed"])if(e.length>t.length+2&&e.endsWith(t)){e=e.slice(0,-t.length),/([b-df-hj-km-np-rtv-z])\1$/.test(e)&&(e=e.slice(0,-1));break}return e.length>3&&e.endsWith("e")?e.slice(0,-1):e}function Ke(n,e,t){if(Math.abs(n.length-e.length)>t)return t+1;let r=[],o=Array.from({length:e.length+1},(i,d)=>d);for(let i=1;i<=n.length;i++){let d=[i],f=i;for(let l=1;l<=e.length;l++){let y=Math.min(o[l]+1,d[l-1]+1,o[l-1]+(n[i-1]===e[l-1]?0:1));i>1&&l>1&&n[i-1]===e[l-2]&&n[i-2]===e[l-1]&&(y=Math.min(y,r[l-2]+1)),d[l]=y,y<f&&(f=y)}if(f>t)return t+1;r=o,o=d}return o[e.length]}var z=new Map;function sn(n,e){let t=z.get(n);t||(z.size>=64&&z.clear(),z.set(n,t=new Map));let r=t.get(e);return r===void 0&&(r=dn(n,e)??null,t.set(e,r)),r??void 0}function dn(n,e){if(/\d/.test(n))return;let t=Ee(n);if(t.length>=3&&(Ee(e)===t||t.length>=4&&e.startsWith(t)))return"stem";let r=n.length<4?0:n.length<=7?1:2;if(r!==0){if(Ke(n,e,r)<=r)return"spelling";if(n.length>=5){for(let o=n.length-r;o<=n.length+r;o++)if(o<e.length&&Ke(n,e.slice(0,o),r)<=r)return"spelling"}}}function ln(n,e){let t=e.length>1?e.filter(o=>!ze.has(o)):e;if(t.length===0)return;let r;for(let o of t){let i;for(let d of n){for(let f of K(d.text).tokens){if(f.startsWith(o)){i={text:d,matched:f};break}let l=i?void 0:sn(o,f);l&&(i={text:d,matched:f,by:l})}if(i&&!i.by)break}if(!i)return;i.by&&!r&&(r={text:i.text,asked:o,matched:i.matched,by:i.by})}if(r)return{field:r.text.field,reading:r.text.reading,fragment:q(r.text.text,[r.matched]),strength:"near",asked:r.asked,matched:r.matched,by:r.by}}var cn=80;function fn(n,e,t){let r=D(e).filter(d=>!ze.has(d)).join(" ")||e,o=t===void 0?[]:D(t),i=o.length>0&&n.find(d=>o.every(f=>K(d.text).tokens.some(l=>l.startsWith(f))))||n[0];return{field:i.field,reading:i.reading,fragment:q(i.text,o),strength:"near",asked:r,matched:(t??i.text).slice(0,cn),by:"meaning"}}function He(n,e,t){let r=D(t);if(r.length===0)return;let o=G(n,e),[i,...d]=o,f=j(i.text,r);if(f)return{field:"label",reading:i.reading,fragment:q(i.text,r),strength:f};let l=p=>A=>K(A.text).tokens.some(O=>O.startsWith(p));if(!r.every(p=>o.some(l(p))))return;let y=D(i.text),u=r.find(p=>!y.some(A=>A.startsWith(p)))??r[0],g=d.find(l(u));return{field:g.field,reading:g.reading,fragment:q(g.text,[u]),strength:"field"}}var un=512,gn=64;function yn(n){let e=new Map;if(n.length===0)return e;let t=n.slice(-un),r=n[n.length-1].seq;for(let o of t){let i=Math.pow(.5,(r-o.seq)/gn);for(let d of o.writes)e.set(d,(e.get(d)??0)+i)}return e}var ce=(n,e)=>Ae({tryDefinition:()=>n},e),le=(n,e)=>Re({tryDefinition:()=>n},e);function hn(n,e,t){let r=n.tryDefinition(e),o=[{field:"plural",text:ce(r,e)},{field:"kind",text:v(e)},...r?.noun?[{field:"noun",text:r.noun}]:[]],i;for(let d of o){let f=j(d.text,t);f&&(!i||T[f]<T[i.strength])&&(i={strength:f,...d})}return i}var pn,mn=(n,e)=>(pn??=new Intl.Collator(void 0,{sensitivity:"base",numeric:!0})).compare(n,e),Ge=(n,e)=>(n.nearly??0)-(e.nearly??0)||(n.archived??0)-(e.archived??0)||n.tier-e.tier||n.inKind-e.inKind||n.near-e.near||n.past-e.past||n.touched-e.touched||n.flagged-e.flagged||mn(n.name,e.name)||(n.id<e.id?-1:n.id>e.id?1:0);function En(n,e,t={}){let r=n.schema,o=on(e),i=D(o.words),d=t.principal??{kind:"human"},f=n.kindsKeptFrom(d),l=n.modules.disabledKinds,y=o.conditions.filter(a=>a.key==="kind").map(a=>a.value),u=o.conditions.filter(a=>a.key==="is").map(a=>a.value),g=u.includes("any")||u.includes("past"),p=u.includes("past")&&!u.includes("any")&&!u.includes("current"),A=u.includes("archived")?!0:t.archived??"all",O=(a,s)=>{let c=de(s),h=r.tryDefinition(a);return de(a)===c||de(ce(h,a))===c},N=r.kinds.filter(a=>!f.has(a)&&!l.has(a)&&(t.kinds===void 0||t.kinds.includes(a))&&(y.length===0||y.some(s=>O(a,s)))),W=o.conditions.filter(a=>a.key!=="kind").map(a=>({...a,admittedBy:N.filter(s=>Fe(r,s).filters.some(c=>c.key===a.key))})),Q=W.filter(a=>a.key!=="is"),C=u.filter(a=>a==="flagged"||a==="clear"||a==="past"||a==="archived"),U={kinds:N,past:g},qe={hits:[],words:o.words,conditions:W,searched:U,byKind:{},total:0,matched:[]};if(i.length===0&&Q.length===0&&C.length===0)return qe;let V=t.today,$=t.flagged??new Set(n.violations().flatMap(a=>a.nodeIds)),Qe=t.touched??yn(n.log.all()),X=new Set;for(let a of t.from??[]){X.add(a);for(let s of n.graph.neighbors(a))X.add(s.id)}let fe=Se(n,d)?ve(n,d):void 0,Y=re.keptFrom?.(n,d)&&n.seenBy(d).graph,J=a=>Me(a,t.basePath===void 0?{}:{basePath:t.basePath}),ue={schema:r,graph:n.graph,flagged:$,...V?{today:V}:{}},S=[],P={},I=[],Z=[],H=(a,s,c,h,m,b)=>{let x=L(c,a);P[s]=(P[s]??0)+1,S.push({hit:{about:"node",id:a.id,kind:s,label:x,why:m,current:h,flagged:$.has(a.id),address:J(`${le(c,s)}/${encodeURIComponent(a.id)}`),...b===void 0?{}:{near:!0},...E(a)?{archived:!0}:{}},...b===void 0?{}:{nearly:2-b},tier:T[m.strength],inKind:s===t.inKind?0:1,near:X.has(a.id)?0:1,past:h?0:1,archived:E(a)?1:0,touched:-(Qe.get(a.id)??0),flagged:$.has(a.id)?0:1,name:x,id:a.id})};for(let a of N){let s=r.tryDefinition(a),c=W.filter(m=>m.key!=="is"&&m.admittedBy.includes(a));if(i.length===0&&c.length===0&&C.length===0)continue;let h=Ie(s,c);for(let m of n.graph.nodesOfKind(a,{archived:A})){if(fe&&!fe(m.id))continue;let b=Y?Y.getNode(m.id):m;if(!b)continue;let x=B(s,b,V);if(!g&&!h&&!x){if(i.length>0&&u.length===0&&c.every(k=>se(ue,b,k))){let k=He(s,b,o.words);k&&Z.push({node:b,kind:a,definition:s,why:k})}continue}if(p&&x||!c.every(k=>se(ue,b,k))||u.includes("flagged")&&!$.has(b.id)||u.includes("clear")&&$.has(b.id))continue;let M=i.length>0?He(s,b,o.words):c[0]?{field:c[0].key,reading:v(c[0].key),fragment:`${c[0].key}:${c[0].value}`,strength:"field"}:{field:"is",reading:"Is",fragment:`is:${C[0]}`,strength:"field"};M?H(b,a,s,x,M):i.length>0&&I.push({node:b,kind:a,definition:s,current:x})}}let ge=!1;if(Z.length>0&&S.length===0){ge=!0;for(let a of Z)H(a.node,a.kind,a.definition,!1,a.why)}let ye=t.near!==!1&&i.length>0&&S.length<en&&I.length>0,ee=new Set;if(ye)for(let a of I){let s=ln(G(a.definition,a.node),i);s&&(ee.add(a.node.id),H(a.node,a.kind,a.definition,a.current,s,s.by==="stem"?.9:.8))}let Ue=a=>a==="exact"||a==="prefix"?-1:T[a],ne=(a,s,c,h)=>({hit:a,tier:Ue(s),inKind:1,near:1,past:0,touched:0,flagged:1,name:c,id:h});if(i.length>0){for(let s of N){let c=hn(r,s,i);if(!c)continue;let h=Ne(r,s),m={field:c.field,reading:c.field==="plural"?"Plural":"Kind",fragment:c.text,strength:c.strength};S.push(ne({about:"kind",kind:s,label:h,why:m,count:P[s]??0,address:J(le(r.tryDefinition(s),s))},c.strength,h,`kind:${s}`))}let a=t.places??[];for(let s of Oe(a.filter(c=>N.includes(c.kind)))){if(s.across&&f.has(s.across))continue;let c=j(s.title,i);if(!c)continue;let h={field:"title",reading:"Title",fragment:s.title,strength:c},m=We(s,a)?le(r.tryDefinition(s.kind),s.kind).slice(1):void 0,b=J(De(s.as,m));S.push(ne({about:"place",kind:s.kind,title:s.title,as:s.as,why:h,address:b},c,s.title,`place:${s.kind}:${s.as}`))}for(let s of n.allInvariants()){let c=s.scope==="graph"?void 0:s.scope.kind;if(c&&!N.includes(c))continue;let h=s.label??v(s.name),m=j(h,i),b=m?void 0:j(v(s.name),i),x=m??b;if(!x)continue;let M={field:m?"label":"name",reading:m?"Rule":"Name",fragment:m?h:s.name,strength:x};S.push(ne({about:"rule",name:s.name,label:h,...c?{kind:c}:{},why:M},x,h,`rule:${s.name}`))}}let he=()=>{S.sort(Ge);let a=t.limit??50,s=S.slice(0,a).map(k=>k.hit),c=s.flatMap(k=>k.about==="node"?[(Y||n.graph).getNode(k.id)]:[]).filter(Boolean),h=Te(c,k=>r.tryDefinition(k)),m=s.map(k=>k.about==="node"&&h.has(k.id)?{...k,apart:h.get(k.id)}:k),b=Object.values(P).reduce((k,Xe)=>k+Xe,0),x=S.flatMap(k=>k.hit.about==="node"?[k.hit.id]:[]),M=t.subject&&N.includes(String(n.graph.getNode(t.subject)?.kind))?bn(n,t.subject,o.words,{principal:d}):[];return{hits:[...m,...M],words:o.words,conditions:W,searched:ge?{...U,past:!0}:U,byKind:{...P},total:b,matched:x}},F=he(),pe=t.rank;if(!ye||!pe)return F;let me=I.filter(a=>!ee.has(a.node.id)).map(({node:a,kind:s,definition:c})=>({id:a.id,kind:s,label:L(c,a),texts:G(c,a)}));if(me.length===0)return F;let Ve=(async()=>{let a;try{a=await pe(o.words,me)}catch{return F}let s=new Map(I.filter(h=>!ee.has(h.node.id)).map(h=>[h.node.id,h])),c=!1;for(let{id:h,score:m,matched:b}of Array.isArray(a)?a:[]){let x=s.get(h);!x||!(m>0)||(s.delete(h),c=!0,H(x.node,x.kind,x.definition,x.current,fn(G(x.definition,x.node),o.words,typeof b=="string"?b:void 0),Math.min(1,m)))}return c?he():F})();return{...F,later:Ve}}function bn(n,e,t,r={}){let o=r.principal??{kind:"human"},i=(re.keptFrom?.(n,o)?n.seenBy(o):n).graph.getNode(e);if(!i)return[];if(n.kindsKeptFrom(o).has(i.kind))return[];let d=D(t),f=L(n.schema.tryDefinition(i.kind),i),l=[];for(let u of n.allMutations()){let g=u.subject;if(!g||g.kinds!=="*"&&!g.kinds.includes(i.kind))continue;let p=u.derived?.act;if((p==="archive"||p==="merge")&&E(i)||p==="unarchive"&&!E(i)||p==="leave-alone"&&te(i)||p==="allow-tidying"&&!te(i)||!n.permits({name:u.name,args:{[g.arg]:i.id}},o).ok)continue;let A=xe(u),O=D(A),N=d.filter(Q=>O.some(C=>C.startsWith(Q))),w=N.length>0?j(A,N):void 0,W=w?{field:"title",reading:"Act",fragment:A,strength:w}:{field:"subject",reading:"On",fragment:f,strength:"field"};l.push({hit:{about:"act",name:u.name,title:A,subject:i.id,why:W,destructive:u.destructive===!0},tier:w?T[w]:T.field+1,inKind:0,near:0,past:u.destructive?1:0,touched:0,flagged:u.pinned?0:1,name:A,id:`act:${u.name}`})}l.sort(Ge);let y=l.map(u=>u.hit);return r.limit===void 0?y:y.slice(0,r.limit)}function Kn(n,e){let t=e.kinds.map((i,d)=>{let f=ce(n.tryDefinition(i),i);return d===0?f:f.toLowerCase()}),r=ke(t)||"Nothing";return e.kinds.some(i=>n.tryDefinition(i)?.lifecycle)?e.past?`${R(r)}, past ones included.`:`${R(r)}, current ones; add is:any for past ones.`:`${R(r)}.`}export{oe as a,ae as b,Ye as c,Ie as d,Fe as e,vn as f,On as g,Be as h,$e as i,Pe as j,Ze as k,se as l,de as m,on as n,He as o,yn as p,En as q,bn as r,Kn as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as n}from"./chunk.YV2LJFGS.js";import"./chunk.QNGWEV47.js";import"./chunk.ERXSYPYL.js";import"./chunk.J2ITFGN3.js";import"./chunk.QTA4ROAK.js";import"./chunk.2CIBWZJG.js";import"./chunk.RRVIXV7W.js";import"./chunk.7BWT5L2L.js";import"./chunk.VSZQXB4Q.js";import"./chunk.UWGWXFWZ.js";import"./chunk.SE5SKFQH.js";import"./chunk.W3S6UXNA.js";import"./chunk.WVUJXDXZ.js";import{e as p}from"./chunk.OZNW5W4Z.js";import"./chunk.NDADLJE6.js";import"./chunk.AK3IHFCF.js";import"./chunk.HHPGWJDO.js";import"./chunk.42YX6NOY.js";import"./chunk.EYZ7MHBZ.js";import"./chunk.KQT7WAQE.js";import"./chunk.PAVR5TK5.js";import"./chunk.OQDETV4X.js";import"./chunk.3VL5WECB.js";import"./chunk.JH6MU6TX.js";import"./chunk.WAFDCOOG.js";import"./chunk.L4DECHXR.js";import{R as m}from"./chunk.GFF2FB2J.js";import"./chunk.6V2RG5JG.js";import{b as t}from"./chunk.AJZBJBMO.js";var i=t(m(),1),a=new WeakMap;function s(o){let e=a.get(o);if(!e){let r=p(o);e=c=>c.mode==="fullscreen"?(0,i.jsx)(n,{blocks:r,slot:"home",heading:2,firstHeading:1}):(0,i.jsx)(n,{blocks:r,slot:"home",heading:3,firstHeading:2}),a.set(o,e)}return e}export{s as homeView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as n}from"./chunk.FDELO7NY.js";import"./chunk.SOBC3CTN.js";import"./chunk.KN3ULTGF.js";import"./chunk.UGFDSE37.js";import{g as s}from"./chunk.R26DREVU.js";import"./chunk.JPHNKWTY.js";import"./chunk.FGVKJWNS.js";import"./chunk.3JNMSOFG.js";import"./chunk.YV2LJFGS.js";import"./chunk.QNGWEV47.js";import"./chunk.ERXSYPYL.js";import"./chunk.J2ITFGN3.js";import"./chunk.V5ZYUVMH.js";import"./chunk.GLBHQFJ2.js";import"./chunk.UT6642FC.js";import"./chunk.QTA4ROAK.js";import"./chunk.2CIBWZJG.js";import"./chunk.MB7LKKUD.js";import"./chunk.RRVIXV7W.js";import"./chunk.7BWT5L2L.js";import"./chunk.VSZQXB4Q.js";import"./chunk.RI3PYG5T.js";import"./chunk.UWGWXFWZ.js";import"./chunk.SE5SKFQH.js";import"./chunk.W3S6UXNA.js";import"./chunk.UZWWDAGM.js";import"./chunk.WVUJXDXZ.js";import"./chunk.OZNW5W4Z.js";import"./chunk.NDADLJE6.js";import"./chunk.AK3IHFCF.js";import"./chunk.HHPGWJDO.js";import"./chunk.42YX6NOY.js";import"./chunk.EYZ7MHBZ.js";import"./chunk.KQT7WAQE.js";import"./chunk.PAVR5TK5.js";import"./chunk.OQDETV4X.js";import"./chunk.3VL5WECB.js";import"./chunk.JH6MU6TX.js";import"./chunk.WAFDCOOG.js";import"./chunk.L4DECHXR.js";import{G as y,R as i}from"./chunk.GFF2FB2J.js";import"./chunk.6V2RG5JG.js";import{b as r}from"./chunk.AJZBJBMO.js";var c=r(y(),1),e=r(i(),1);function v({store:d,views:t,as:a,scope:o}){let l=(0,c.useMemo)(()=>s({scope:`.${o}`}),[o]);return(0,e.jsxs)("div",{"data-testid":"embed-picture","data-embed-content":"",tabIndex:0,"aria-label":t.places().find(m=>m.as===a)?.title??"The picture",style:{flex:"1 1 auto",minHeight:0,display:"grid",gridTemplateRows:"minmax(0, 1fr)",overflow:"auto",background:"var(--graview-ground)",color:"var(--graview-ink)",fontFamily:"var(--graview-font-body, system-ui)"},children:[(0,e.jsx)("style",{children:l}),(0,e.jsx)(n,{store:d,views:t,as:a})]})}export{v as PictureFace};
|