graview 0.1.52 → 0.1.54
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.25P5SDNR.js +1 -0
- package/dist/preview/chunk.27O4LIDU.js +1 -0
- package/dist/preview/{chunk.RWCWRJJC.js → chunk.2DFWOLL2.js} +1 -1
- package/dist/preview/{chunk.R6FHEEJ7.js → chunk.2LMB5E6N.js} +1 -1
- package/dist/preview/chunk.2WSRJGW2.js +1 -0
- package/dist/preview/{chunk.IVI3HRSF.js → chunk.33YC5RCB.js} +1 -1
- package/dist/preview/chunk.3G5DEGFA.js +1 -0
- package/dist/preview/{chunk.73EKJ4JN.js → chunk.3IEJQAK7.js} +1 -1
- package/dist/preview/chunk.3JMZHCB4.js +293 -0
- package/dist/preview/chunk.3MZIWKNG.js +5 -0
- package/dist/preview/{chunk.FLNYLE6S.js → chunk.3SOJJAMY.js} +1 -1
- package/dist/preview/{chunk.QRCTTDDQ.js → chunk.3V2WXZU3.js} +1 -1
- package/dist/preview/{chunk.R77TACXU.js → chunk.3ZONBC6L.js} +1 -1
- package/dist/preview/{chunk.SZCZD2GM.js → chunk.45HTFSWD.js} +1 -1
- package/dist/preview/chunk.463PGKOL.js +35 -0
- package/dist/preview/chunk.4BX3KLAA.js +1 -0
- package/dist/preview/chunk.4F5M5XZG.js +1 -0
- package/dist/preview/{chunk.ZK42LPF5.js → chunk.4GHXAWIE.js} +1 -1
- package/dist/preview/chunk.4KTHJY5N.js +19 -0
- package/dist/preview/{chunk.ULAMIQ52.js → chunk.4TGQ6Z6E.js} +1 -1
- package/dist/preview/{chunk.VKOCD5CL.js → chunk.4V64RBCK.js} +1 -1
- package/dist/preview/{chunk.I2W7HSBU.js → chunk.4WH4N4V7.js} +1 -1
- package/dist/preview/{chunk.NAPTE3S6.js → chunk.562IVJHX.js} +1 -1
- package/dist/preview/chunk.57VTD3CU.js +1 -0
- package/dist/preview/{chunk.JQBP6QWQ.js → chunk.5C43AM3X.js} +1 -1
- package/dist/preview/chunk.5M62CMLA.js +1 -0
- package/dist/preview/chunk.5RH6FO3K.js +1 -0
- package/dist/preview/chunk.5VF2RT4H.js +1 -0
- package/dist/preview/chunk.5XAIP3BS.js +1 -0
- package/dist/preview/{chunk.CV4QA4ZF.js → chunk.5ZWE72VJ.js} +1 -1
- package/dist/preview/{chunk.NB6WN4DO.js → chunk.644FUGSX.js} +1 -1
- package/dist/preview/chunk.6BBB7SJL.js +1 -0
- package/dist/preview/chunk.6SPORDJC.js +1 -0
- package/dist/preview/{chunk.C4UNAJWC.js → chunk.6TILXTP6.js} +1 -1
- package/dist/preview/{chunk.7UXDIEPK.js → chunk.7JCUSYS5.js} +1 -1
- package/dist/preview/{chunk.NHIPVAGR.js → chunk.7SCENHVG.js} +1 -1
- package/dist/preview/{chunk.HSGUXMAO.js → chunk.7TMWMW4W.js} +1 -1
- package/dist/preview/{chunk.3TME4BG3.js → chunk.7UD2JR6J.js} +1 -1
- package/dist/preview/{chunk.C7EEYSAM.js → chunk.AG7CUSSV.js} +1 -1
- package/dist/preview/{chunk.INL4OZI7.js → chunk.AKLVSZ5A.js} +1 -1
- package/dist/preview/chunk.AN5QCSVK.js +1 -0
- package/dist/preview/chunk.ARRLAAG6.js +1 -0
- package/dist/preview/{chunk.7354O67H.js → chunk.AZGXBTOQ.js} +1 -1
- package/dist/preview/{chunk.FJC6PMOG.js → chunk.B2X6DA2Q.js} +4 -4
- package/dist/preview/chunk.B3WVCSW5.js +1 -0
- package/dist/preview/chunk.B6PKKEY3.js +1 -0
- package/dist/preview/{chunk.VGTEEANA.js → chunk.BOMYLOCX.js} +1 -1
- package/dist/preview/chunk.BPWSQVEN.js +1 -0
- package/dist/preview/{chunk.I43ONAEL.js → chunk.BUDEUNBN.js} +1 -1
- package/dist/preview/chunk.C3AHDHX7.js +1 -0
- package/dist/preview/{chunk.FEBCIEI3.js → chunk.C6HBYRGJ.js} +1 -1
- package/dist/preview/chunk.C6HI3LRB.js +1 -0
- package/dist/preview/{chunk.7XJ3XQZD.js → chunk.CB5DGKR5.js} +1 -1
- package/dist/preview/{chunk.2K3YQJW3.js → chunk.CB7IUKY7.js} +2 -2
- package/dist/preview/{chunk.GZHEGKPF.js → chunk.COWJTVZV.js} +1 -1
- package/dist/preview/{chunk.5DDHFNZM.js → chunk.D2PJG5N7.js} +1 -1
- package/dist/preview/chunk.D6ACCKYJ.js +1 -0
- package/dist/preview/{chunk.CBGKWYGI.js → chunk.DF7IPT7V.js} +2 -2
- package/dist/preview/{chunk.R7CRV2FE.js → chunk.DTJ4FIHM.js} +1 -1
- package/dist/preview/chunk.DVG47BK3.js +1 -0
- package/dist/preview/{chunk.LTJYKQJG.js → chunk.E5JX5LWY.js} +1 -1
- package/dist/preview/chunk.EC7I33WI.js +1 -0
- package/dist/preview/chunk.F5RN6YXG.js +4 -0
- package/dist/preview/chunk.FCZ7UFJI.js +1 -0
- package/dist/preview/chunk.FMP6NDRZ.js +1 -0
- package/dist/preview/{chunk.OS3WZV6C.js → chunk.FRZQSSGE.js} +2 -2
- package/dist/preview/chunk.FWKNR7XF.js +4 -0
- package/dist/preview/chunk.FWZF7X6A.js +67 -0
- package/dist/preview/{chunk.BHPZK4WJ.js → chunk.GHPCSNM6.js} +2 -2
- package/dist/preview/{chunk.52J42KR5.js → chunk.GKLDSHHH.js} +1 -1
- package/dist/preview/{chunk.7UJZP3YK.js → chunk.GVUJCOKD.js} +2 -2
- package/dist/preview/chunk.HLDMTKUP.js +1 -0
- package/dist/preview/{chunk.DGWNVDZB.js → chunk.IDYPQ45A.js} +1 -1
- package/dist/preview/{chunk.RBWYXVUW.js → chunk.IMHUKSPM.js} +2 -2
- package/dist/preview/chunk.IYYP6QUH.js +1 -0
- package/dist/preview/chunk.J2Z6WLCH.js +88 -0
- package/dist/preview/chunk.J3OX474P.js +1 -0
- package/dist/preview/chunk.JCFYZEMY.js +1 -0
- package/dist/preview/chunk.JLB4QP6Q.js +1 -0
- package/dist/preview/{chunk.R7ZZJOJW.js → chunk.JTOAZ2IR.js} +1 -1
- package/dist/preview/chunk.JXGDVJ4N.js +1 -0
- package/dist/preview/{chunk.D62V3TBW.js → chunk.K2J26XMB.js} +2 -2
- package/dist/preview/{chunk.J6IB2HUZ.js → chunk.KI6M3EWZ.js} +1 -1
- package/dist/preview/{chunk.LESRQN3Y.js → chunk.KJGNLWU3.js} +2 -2
- package/dist/preview/chunk.KLJDBYAZ.js +1 -0
- package/dist/preview/{chunk.XLM4ONUB.js → chunk.KRVEAIKW.js} +1 -1
- package/dist/preview/{chunk.KVEDMKUN.js → chunk.KY7QD22S.js} +1 -1
- package/dist/preview/{chunk.J2R55TM7.js → chunk.L7MFTL5S.js} +1 -1
- package/dist/preview/chunk.LNOWO3IY.js +2 -0
- package/dist/preview/{chunk.DXZ5VYCQ.js → chunk.LOUICR7K.js} +1 -1
- package/dist/preview/{chunk.NVNQSZ43.js → chunk.LU3B3SZH.js} +1 -1
- package/dist/preview/chunk.LVOL2LEC.js +1 -0
- package/dist/preview/chunk.LYFEGG6E.js +1 -0
- package/dist/preview/chunk.MAWP27FD.js +28 -0
- package/dist/preview/chunk.MDWCX3YU.js +1 -0
- package/dist/preview/chunk.MNW2ZBQ6.js +1 -0
- package/dist/preview/{chunk.7KZ44FEU.js → chunk.MPMROUZA.js} +1 -1
- package/dist/preview/{chunk.BJL6EL6B.js → chunk.MVRNEC3Y.js} +1 -1
- package/dist/preview/chunk.NDI5OWIB.js +1 -0
- package/dist/preview/chunk.NEJSKMJV.js +2 -0
- package/dist/preview/{chunk.N7D5LKBI.js → chunk.NGWHV4G6.js} +1 -1
- package/dist/preview/{chunk.T2Q3AAQI.js → chunk.OCV46AFN.js} +1 -1
- package/dist/preview/{chunk.7IOC6U3C.js → chunk.OLKFEHWB.js} +1 -1
- package/dist/preview/{chunk.GL3YVGAP.js → chunk.OZ4EJ5M6.js} +2 -2
- package/dist/preview/chunk.PCNEM3WE.js +1 -0
- package/dist/preview/chunk.PR2TSHE7.js +9 -0
- package/dist/preview/{chunk.C4EPMV7O.js → chunk.PZ4G5QA5.js} +1 -1
- package/dist/preview/{chunk.YKACMLLU.js → chunk.PZWJUQAO.js} +1 -1
- package/dist/preview/{chunk.7FZY5E2U.js → chunk.Q6RUTFU3.js} +1 -1
- package/dist/preview/chunk.QB7RYJ67.js +5 -0
- package/dist/preview/{chunk.P5PXWOHI.js → chunk.R7RDUW37.js} +1 -1
- package/dist/preview/{chunk.XZLKTOJE.js → chunk.RBYRT2I2.js} +1 -1
- package/dist/preview/{chunk.6CY3EA6U.js → chunk.RCFAHV5N.js} +1 -1
- package/dist/preview/{chunk.OYRZ2DEI.js → chunk.RLO3RDYH.js} +1 -1
- package/dist/preview/chunk.RYMSHMLM.js +1 -0
- package/dist/preview/chunk.SDO3DD77.js +6 -0
- package/dist/preview/chunk.SF4BYBH6.js +25 -0
- package/dist/preview/chunk.SG7YVKH4.js +1 -0
- package/dist/preview/chunk.T42H5RXN.js +1 -0
- package/dist/preview/{chunk.7EA7THSM.js → chunk.TUNHUTQ5.js} +1 -1
- package/dist/preview/chunk.U7GN6UPR.js +1 -0
- package/dist/preview/{chunk.QWQBPJ4U.js → chunk.ULSN3ASK.js} +1 -1
- package/dist/preview/chunk.V6X3U3JF.js +1 -0
- package/dist/preview/chunk.VFMC45E7.js +1 -0
- package/dist/preview/{chunk.3FKP32RG.js → chunk.VGOWGOGD.js} +2 -2
- package/dist/preview/chunk.VTO6UWUP.js +1 -0
- package/dist/preview/chunk.VW6X53E7.js +1 -0
- package/dist/preview/chunk.VWQ57LTT.js +18 -0
- package/dist/preview/chunk.VYKEIKY5.js +1 -0
- package/dist/preview/{chunk.EIWTZC4A.js → chunk.W6NCLU5Y.js} +1 -1
- package/dist/preview/{chunk.KFTZLNHY.js → chunk.WHGEDJB2.js} +19 -14
- package/dist/preview/{chunk.J263VQF5.js → chunk.WICMCZ27.js} +1 -1
- package/dist/preview/{chunk.QPP3OJVR.js → chunk.WVWXNW74.js} +2 -2
- package/dist/preview/chunk.XBDFXFWM.js +1 -0
- package/dist/preview/chunk.XE72DFBV.js +13 -0
- package/dist/preview/{chunk.LSL25VXW.js → chunk.XTT6ERI3.js} +1 -1
- package/dist/preview/{chunk.KPUX27ZT.js → chunk.XZJ6XX5I.js} +1 -1
- package/dist/preview/chunk.Y2DFDMT6.js +1 -0
- package/dist/preview/{chunk.G7XKQNOL.js → chunk.Y36MLVMT.js} +1 -1
- package/dist/preview/chunk.Y36WSKL5.js +1 -0
- package/dist/preview/chunk.YXRKZMS5.js +1 -0
- package/dist/preview/chunk.Z6O7RUSR.js +1 -0
- package/dist/preview/chunk.ZAGP3OKY.js +1 -0
- package/dist/preview/{chunk.M33LUF3Q.js → chunk.ZBHFCSKO.js} +1 -1
- package/dist/preview/{chunk.Y37DXEHG.js → chunk.ZDDWXRPK.js} +1 -1
- package/dist/preview/{chunk.5WU2UTP7.js → chunk.ZUBC3UFG.js} +1 -1
- package/dist/preview/{chunk.7FMS57QO.js → chunk.ZYW7Q5EN.js} +1 -1
- package/dist/preview/index.html +50 -51
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.2EB7COX5.js +0 -1
- package/dist/preview/chunk.2X3UZJWI.js +0 -1
- package/dist/preview/chunk.337JMOTL.js +0 -1
- package/dist/preview/chunk.3ZQAPPJ5.js +0 -18
- package/dist/preview/chunk.4LI73QOY.js +0 -6
- package/dist/preview/chunk.4VI3EYDL.js +0 -1
- package/dist/preview/chunk.4ZLCMATU.js +0 -2
- package/dist/preview/chunk.5LWPNOJA.js +0 -1
- package/dist/preview/chunk.63SRVTG2.js +0 -19
- package/dist/preview/chunk.6BA6RUK7.js +0 -1
- package/dist/preview/chunk.6JERQFZI.js +0 -1
- package/dist/preview/chunk.6NIE3ILA.js +0 -1
- package/dist/preview/chunk.6QNBUBGD.js +0 -1
- package/dist/preview/chunk.7OAXW7QF.js +0 -1
- package/dist/preview/chunk.7SNIX56B.js +0 -1
- package/dist/preview/chunk.AI2HBKVP.js +0 -359
- package/dist/preview/chunk.BDQ4FUKO.js +0 -1
- package/dist/preview/chunk.BRDAO2OF.js +0 -4
- package/dist/preview/chunk.CC7E6NUQ.js +0 -1
- package/dist/preview/chunk.CHMUL36A.js +0 -1
- package/dist/preview/chunk.D2T563AA.js +0 -1
- package/dist/preview/chunk.DC7M56NM.js +0 -9
- package/dist/preview/chunk.DIS7JS7X.js +0 -1
- package/dist/preview/chunk.DVLWSCIC.js +0 -35
- package/dist/preview/chunk.EHOEMVQP.js +0 -1
- package/dist/preview/chunk.EME5HQ3H.js +0 -1
- package/dist/preview/chunk.FJEXINFF.js +0 -1
- package/dist/preview/chunk.G446PWV6.js +0 -1
- package/dist/preview/chunk.HST7BYFW.js +0 -1
- package/dist/preview/chunk.JOWJNIWH.js +0 -4
- package/dist/preview/chunk.JV7FLVUV.js +0 -1
- package/dist/preview/chunk.KQSD5MLY.js +0 -1
- package/dist/preview/chunk.KSJ3J5UN.js +0 -1
- package/dist/preview/chunk.LXJW2Z2M.js +0 -1
- package/dist/preview/chunk.MBNZ2HK7.js +0 -1
- package/dist/preview/chunk.MCFLCC42.js +0 -12
- package/dist/preview/chunk.MYKRJ4SV.js +0 -1
- package/dist/preview/chunk.NICCIJV4.js +0 -1
- package/dist/preview/chunk.NQPNK6I5.js +0 -1
- package/dist/preview/chunk.NWK4E7TJ.js +0 -1
- package/dist/preview/chunk.NZB5S5UO.js +0 -1
- package/dist/preview/chunk.PFXGWY3P.js +0 -1
- package/dist/preview/chunk.PRCWGE7A.js +0 -1
- package/dist/preview/chunk.PXHBPLTQ.js +0 -1
- package/dist/preview/chunk.PXVJBL2C.js +0 -1
- package/dist/preview/chunk.Q3XKNZQW.js +0 -1
- package/dist/preview/chunk.Q5IAXTF5.js +0 -25
- package/dist/preview/chunk.Q5WEOX3Q.js +0 -1
- package/dist/preview/chunk.QXCYAFRT.js +0 -1
- package/dist/preview/chunk.RMRO5JZX.js +0 -1
- package/dist/preview/chunk.S4ZWBCYC.js +0 -1
- package/dist/preview/chunk.SELLAVIQ.js +0 -1
- package/dist/preview/chunk.SHNYYBNW.js +0 -1
- package/dist/preview/chunk.SM6HTPYF.js +0 -1
- package/dist/preview/chunk.T6KKNWZT.js +0 -1
- package/dist/preview/chunk.U6PCKJ26.js +0 -1
- package/dist/preview/chunk.UEPVA6IS.js +0 -1
- package/dist/preview/chunk.UMS7XRPO.js +0 -1
- package/dist/preview/chunk.VGIWQNJB.js +0 -1
- package/dist/preview/chunk.VOHRQXCF.js +0 -5
- package/dist/preview/chunk.W5UJLKIT.js +0 -1
- package/dist/preview/chunk.WUEU3QBL.js +0 -1
- package/dist/preview/chunk.WWUMSCYC.js +0 -1
- package/dist/preview/chunk.XPR3QFF4.js +0 -1
- package/dist/preview/chunk.YKXUDACI.js +0 -28
- package/dist/preview/chunk.YUEOUV7G.js +0 -5
- package/dist/preview/chunk.YYWLYVAW.js +0 -1
- package/dist/preview/chunk.Z2JMTRF4.js +0 -1
- package/dist/preview/chunk.Z2UFPOAN.js +0 -88
- package/dist/preview/chunk.ZEKKIMKI.js +0 -1
- package/dist/preview/chunk.ZJXUWOG3.js +0 -1
- package/dist/preview/chunk.ZZGXVYW2.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{e as k,g as M,h as I,i as B,l as P}from"./chunk.CV4QA4ZF.js";import"./chunk.OYRZ2DEI.js";import"./chunk.7EA7THSM.js";import"./chunk.AI2HBKVP.js";import{Fa as q,G as te,T as W}from"./chunk.Q5IAXTF5.js";import{a as L}from"./chunk.SDO3U72B.js";import"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import{b as h}from"./chunk.AJZBJBMO.js";var r=h(te(),1);var A=h(W(),1),U=q(L(()=>(__graviewPreload(import.meta.url,["./chunk.AI2HBKVP.js","./chunk.Q5IAXTF5.js","./chunk.SDO3U72B.js","./chunk.VOHRQXCF.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.6QNBUBGD.js")))),v={Part:U.part((n,t)=>(0,A.jsx)(n.WhenMonth,{...t}),{quiet:!0}),prefetch:()=>U.prefetch()};var o=h(W(),1),z="try \u201Ctomorrow 3pm\u201D, \u201CFri 10:30\u201D or \u201C17 Oct\u201D";function K(n,t,d,p=!1){let S=Date.UTC(+n.day.slice(0,4),+n.day.slice(5,7)-1,+n.day.slice(8,10),0,t?n.minutes??0:0),g={weekday:p?"long":"short",year:"numeric",month:p?"long":"short",day:"numeric",...t?{hour:"numeric",minute:"2-digit"}:{},timeZone:"UTC"},m;try{m=new Intl.DateTimeFormat(d??"en-US",g)}catch{m=new Intl.DateTimeFormat("en-US",g)}return m.format(S).replace(/ /g," ")}function ce({value:n,time:t,instant:d=!1,label:p,name:S,required:g,autoFocus:m,autoSelect:H,locale:s,onChange:j,onLeave:_,onCancel:V,inputRef:w,boxStyle:Z}){let x=(0,r.useId)(),u=(0,r.useRef)(null),D=(0,r.useRef)(null),b=e=>{let a=M(e);return a?K(a,t,s):e??""},[T,C]=(0,r.useState)(()=>b(n)),[F,y]=(0,r.useState)(!1),[G,E]=(0,r.useState)(n),[J,Q]=(0,r.useState)(n);n!==J&&(Q(n),n!==G&&(E(n),C(b(n)))),(0,r.useEffect)(()=>{H&&(u.current?.focus(),u.current?.select())},[H]);let i=t&&d?B(s):void 0,N=T===b(n),l=M(n),c=N?l:P(T,{today:k().day,time:t,...l?{base:l}:{},...s?{locale:s}:{}}),X=N?n:c?I(c,{time:t,instant:d}):void 0,$=T.trim()==="",f=!$&&c===void 0;(0,r.useEffect)(()=>{u.current?.setCustomValidity(f?`Not a date this reads \u2014 ${z}`:"")},[f]);let O=e=>{E(e),j(e)},Y=e=>{C(e);let a=e.trim()===""?void 0:P(e,{today:k().day,time:t,...l?{base:l}:{},...s?{locale:s}:{}});O(a?I(a,{time:t,instant:d}):void 0)},ee=e=>{let a=t?{day:e,minutes:c?.minutes??l?.minutes??540}:{day:e},R=I(a,{time:t,instant:d});C(b(R)),O(R),y(!1),requestAnimationFrame(()=>{u.current?.focus(),u.current?.select()})},ne=$?`Type a date, or pick one \u2014 ${z}`:f?`Not a date this reads \u2014 ${z}`:c?`${K(c,t,s,!0)}${i?` ${i.short}`:""}`:"";return(0,o.jsxs)("span",{"data-graview-when":t?d?"instant":"moment":"day",style:{display:"inline-flex",flex:"1 1 14rem",flexWrap:"wrap",alignItems:"center",gap:"4px 6px",maxWidth:"100%",minWidth:0},onBlur:e=>{let a=e.relatedTarget;a&&e.currentTarget.contains(a)||!a&&typeof document<"u"&&!document.hasFocus()||(y(!1),_?.(X))},children:[(0,o.jsx)("input",{ref:e=>{u.current=e,typeof w=="function"?w(e):w&&(w.current=e)},type:"text",name:S,required:g,autoFocus:m,"aria-label":p,"aria-describedby":`${x}-said`,"aria-invalid":f||void 0,autoComplete:"off",spellCheck:!1,enterKeyHint:"done",placeholder:t?"tomorrow 3pm":"17 Oct",value:T,"data-graview-part":"control",onChange:e=>Y(e.target.value),onKeyDown:e=>{e.key==="Escape"?(e.preventDefault(),V?.()):e.key==="ArrowDown"&&e.altKey&&(e.preventDefault(),y(!0))},style:{flex:"1 1 12ch",minWidth:"10ch",maxWidth:"100%",boxSizing:"border-box",font:"inherit",...Z}}),(0,o.jsx)("button",{ref:D,type:"button","aria-label":`Pick a date for ${p}`,"aria-expanded":F,"aria-controls":`${x}-month`,"data-graview-part":"when-pick",onClick:()=>y(e=>!e),onPointerEnter:()=>v.prefetch(),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:32,minHeight:32,padding:0,borderRadius:6},children:(0,o.jsxs)("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.4",children:[(0,o.jsx)("rect",{x:"2",y:"3",width:"12",height:"11",rx:"1.5"}),(0,o.jsx)("path",{d:"M2 6.5h12M5.5 1.5v3M10.5 1.5v3"})]})}),(0,o.jsxs)("span",{id:`${x}-said`,"aria-live":"polite","data-graview-part":"when-said",...i?{"data-graview-zone":i.zone,title:`Times are in ${i.zone.replace(/_/g," ")} (${i.short})`}:{},style:{flexBasis:"100%",fontSize:"0.75rem",color:f?"var(--graview-bad)":"var(--graview-ink-faint)"},children:[ne,i&&!f&&!$?(0,o.jsx)("span",{"data-graview-part":"when-zone",children:` \xB7 ${(i.zone.split("/").at(-1)??i.zone).replace(/_/g," ")} time`}):null]}),F?(0,o.jsx)(r.Suspense,{fallback:null,children:(0,o.jsx)(v.Part,{id:`${x}-month`,label:p,selected:c?.day??l?.day,today:k().day,locale:s,onPick:ee,onClose:()=>{y(!1),D.current?.focus()}})}):null]})}export{ce as WhenInput,K as wallAsRead};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as d,G as h,Ma as u,aa as a,ca as c}from"./chunk.Q5IAXTF5.js";import{b as l}from"./chunk.AJZBJBMO.js";var i=l(h(),1);function w(){let e=u();return(0,i.useMemo)(()=>[...new Set(e.flatMap(o=>o.nodeIds))],[e])}function S(){let e=g(),o=d();return(0,i.useMemo)(()=>{if(!o)return e;let n=o.matched;return n.length===0&&e.length===0?[m]:[...new Set([...e,...n])]},[o,e])}function g(){let{store:e,selection:o}=a(),n=c();return(0,i.useMemo)(()=>{if(o.length===0)return[];let r=new Set(o),s=new Set(r);for(let t of e.graph.allEdges())r.has(t.from)&&s.add(t.to),r.has(t.to)&&s.add(t.from);for(let t of e.violations())if(t.subjectId!==void 0&&r.has(t.subjectId))for(let f of t.nodeIds)s.add(f);return[...s]},[e,o,n])}var m="search:nothing";export{w as a,S as b,g as c};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as Ie}from"./chunk.D62V3TBW.js";import{A as Qt,B as Ae,C as ro,D as Xe,E as me,F as Gn,G as We,H as Ue,I as oo,J as Kn,K as Ce,L as io,M as so,N as $,O as pt,P as ht,Q as lo,R as wt,S as Xt,T as co,U as oe,V as Jt,W as le,X as Bn,a as j,b as Se,c as Y,d as zt,e as In,f as Fn,g as ct,h as ne,i as he,j as se,k as C,l as re,m as V,n as qe,o as we,p as Yt,q as ve,r as ue,s as to,t as yt,u as no,v as Dn,w as Wn,x as Q,y as Fe,z as ao}from"./chunk.FJC6PMOG.js";import{a as Ze,b as Zt,d as ee}from"./chunk.XPR3QFF4.js";import{b as Hn,c as Jr,d as eo}from"./chunk.YUEOUV7G.js";import{a as Qr,d as Zr,e as Xr}from"./chunk.UGFDSE37.js";import{a as Ur,c as Vr,f as jr,g as _r,i as zr,j as Yr}from"./chunk.W5UJLKIT.js";import{a as jt,b as _t}from"./chunk.PXQVXBNG.js";import{a as $r,b as Hr,c as Ir,d as $n}from"./chunk.7UJZP3YK.js";import{b as Or}from"./chunk.R77TACXU.js";import{a as Fr,b as Dr,d as Ut,e as Wr,f as Gr,g as Kr,j as Vt}from"./chunk.6JERQFZI.js";import{m as Nr}from"./chunk.63SRVTG2.js";import{a as wr,b as Sr,c as vr,e as Tr,f as On,h as Kt}from"./chunk.G7XKQNOL.js";import{d as xr,e as Pr,f as Ar,g as Cr,n as Wt,o as Rr,q as Lr,s as Gt}from"./chunk.7KZ44FEU.js";import{a as Ht,b as Qa,c as Za,d as It,e as Xa}from"./chunk.LSL25VXW.js";import{b as rr,c as fr,e as yr,f as En}from"./chunk.WWUMSCYC.js";import{a as Tn,b as mr}from"./chunk.J2R55TM7.js";import{a as Bt,b as qt,c as Er,e as Mr}from"./chunk.D2T563AA.js";import{a as dt,b as ur,e as gr}from"./chunk.JV7FLVUV.js";import{a as Mn}from"./chunk.7FZY5E2U.js";import{a as Rn,b as nr,c as ar}from"./chunk.7354O67H.js";import{a as hr}from"./chunk.C7EEYSAM.js";import{c as ir,d as sr,e as lr,f as dr,k as Qe,l as cr}from"./chunk.QRCTTDDQ.js";import{a as or}from"./chunk.3TME4BG3.js";import{r as Ln,s as pr}from"./chunk.YKACMLLU.js";import{b as Ja,c as er,d as Ft,e as tr,l as Dt}from"./chunk.OYRZ2DEI.js";import{C as Nn,K as Br,N as qr,e as za,f as Ya,j as ti,u as br,v as kr}from"./chunk.AI2HBKVP.js";import{Aa as $t,G as Me,L as Fa,N as Da,Pa as _a,R as Wa,T as U,U as Cn,X as Ga,Y as Ka,aa as Ba,ba as ie,ea as qa,fa as Ua,ha as Va,la as lt,na as ja,pa as Ot,r as Ia,v as He}from"./chunk.Q5IAXTF5.js";import{a as Ha}from"./chunk.SDO3U72B.js";import{$a as Ca,Ed as An,Fd as Oa,J as va,Kd as $a,Nc as Ma,U as ft,Za as Aa,ca as st,da as pe,fa as ze,ga as Tt,hc as La,ia as Be,ka as ba,la as ka,lb as xn,ma as Ye,mb as Ra,md as Pn,oc as Ta,qc as Ea,sd as Mt,td as Na,vd as Nt,wb as Et,xa,ya as Pa}from"./chunk.VOHRQXCF.js";import{b as I}from"./chunk.AJZBJBMO.js";function po(e,t,n={}){let a=e.graph.getNode(t);if(!a)return;let r=e.schema.tryDefinition(a.kind),o=i=>pe(e.schema.tryDefinition(i.kind),i),l=new Map;for(let i of e.graph.allEdges()){let s=i.from===t?"out":i.to===t?"in":null;if(!s)continue;let c=s==="out"?i.to:i.from,m=e.graph.getNode(c);if(!m)continue;let g=(s==="out"?r:e.schema.tryDefinition(m.kind))?.edges?.[i.kind],p=s==="in"?g?.inverse??g?.description:g?.description,P=`${i.kind}|${s}|${p??""}`;(l.get(P)??(()=>{let W={edgeKind:i.kind,direction:s,...p?{description:p}:{},targets:[]};return l.set(P,W),W})()).targets.push({id:m.id,kind:m.kind,label:o(m)})}return{id:t,kind:a.kind,label:o(a),fields:Ft(Qe(e.schema,e.graph,a),r),violations:xn(e.violations(n.context),[t]),actions:Mn(e,[t],{focus:t,...n.principal?{principal:n.principal}:{},...n.context?{context:n.context}:{}}),links:[...l.values()].map(i=>{let s=Ja(i.targets.flatMap(c=>{let m=e.graph.getNode(c.id);return m?[m]:[]}),c=>e.schema.tryDefinition(c));return{...i,targets:[...i.targets].map(c=>s.has(c.id)?{...c,apart:s.get(c.id)}:c).sort((c,m)=>c.label.localeCompare(m.label))}})}}function Je(e,t,n={}){return{kind:t,members:e.graph.nodesOfKind(t),actions:Mn(e,[],{kindSelection:[t],...n.principal?{principal:n.principal}:{},...n.context?{context:n.context}:{}})}}function uo(e,t){let n=(o,l)=>`${o}|${JSON.stringify(l)}`,a=new Map;for(let o of[...e.affordances,...e.withheld]){if(o.provider!=="invariant")continue;let l=n(o.mutation,o.args);a.has(l)||a.set(l,o.rank??Number.MAX_SAFE_INTEGER)}let r=Number.MAX_SAFE_INTEGER;return[...t].map((o,l)=>({repair:o,declared:l})).sort((o,l)=>(a.get(n(o.repair.mutation,o.repair.args??{}))??r)-(a.get(n(l.repair.mutation,l.repair.args??{}))??r)||o.declared-l.declared).map(o=>o.repair)}function et(e){let t=e.schema.kinds.map(r=>({kind:r,plural:Be(e.schema,r),count:e.graph.nodesOfKind(r).length})),n=new Map;for(let r of e.graph.allEdges()){let o=e.graph.getNode(r.from),l=e.graph.getNode(r.to);if(!o||!l)continue;let i=`${r.kind}|${o.kind}|${l.kind}`;n.set(i,(n.get(i)??0)+1)}let a=[];for(let{kind:r}of t){let o=e.schema.tryDefinition(r)?.edges??{};for(let[l,i]of Object.entries(o)){let s=i.to==="*"||i.to===void 0?(()=>{let c=[...n.keys()].filter(m=>m.startsWith(`${l}|${r}|`)).map(m=>m.split("|")[2]);return c.length>0?c:["*"]})():i.to;for(let c of s)a.push({edgeKind:l,from:r,to:c,...i.description?{description:i.description}:{},...i.inverse?{inverse:i.inverse}:{},count:n.get(`${l}|${r}|${c}`)??0})}}return{kinds:t,relations:a}}var Ge=I(Me(),1);var St=I(Me(),1);var Re=I(U(),1),ai={problems:"Problems",search:"Search",map:"Connections",places:"Pictures","~draft":"A view drawn"},ri=e=>{try{return decodeURIComponent(e)}catch{return e}};function oi(e,t,n={}){let{store:a}=e,r=a.schema,o=(n.base??"").replace(/\/$/,""),[l="/",i=""]=t.split("#")[0].split("?"),s=(k,E,v)=>({label:k,href:`${o}${E}`,path:E,...v?{current:v}:{}}),c=k=>{let E=n.registry?.sectionOf(k);return E?[E.path===void 0?{label:E.label}:s(E.label,E.path)]:[]},m=k=>n.registry?.sectionOf(k)?.label,x=k=>{let E=m(k);return E===void 0?{}:{section:E}},[g,p,...P]=l.split("/").filter(Boolean).map(ri);if(g===void 0)return{as:"home",label:"Home",trail:[s("Home","/",!0)]};if(g==="places"&&p!==void 0&&P.length===0){let k=new URLSearchParams(i).get("of"),E=new Set(Fe(a,e.principal)),v=e.views?.places()??[],A=v.find(G=>E.has(G.kind)&&G.as===p&&(!k||j(r,G.kind)===k));if(A){let G=zt(A.as,Mt(A,v)?j(r,A.kind):void 0);return{as:"place",kind:A.kind,label:A.title,...x(A.kind),trail:[...c(A.kind),s(A.title,G,!0)]}}}let N=P.length===0?Se(r,g):void 0;if(N!==void 0){let k=s(Be(r,N),`/${j(r,N)}`);if(p===void 0)return{as:"list",kind:N,label:k.label,...x(N),trail:[...c(N),{...k,current:!0}]};let E=a.graph.getNode(p),v=E&&E.kind===N?pe(r.tryDefinition(N),E):"Nothing lives here";return{as:"record",kind:N,id:p,label:v,...x(N),trail:[...c(N),k,s(v,Y(r,N,p),!0)]}}let W=ai[g]??ii((P.at(-1)??p??g).replace(/[-_]+/g," "));return{as:"page",label:W,trail:[s(W,l,!0)]}}var ii=e=>e.charAt(0).toUpperCase()+e.slice(1),qn=(0,St.createContext)(null);function si(e){let t=me(),n=Xe("/");return ee(e.context.store),oi(e.context,`${t.pathname}${t.search}`,{registry:e.registry,base:n})}var li={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0},go={display:"flex",alignItems:"center",gap:6,minWidth:0},mo={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,lineHeight:"24px"};function ut({context:e,style:t}){let n=(0,St.useContext)(qn),a=(0,St.useContext)(ht);return wt(a??ci,"trail")||n?.registry?.without().has("trail")?null:(0,Re.jsx)(di,{root:n??{context:e,registry:void 0},context:e,...t?{style:t}:{}})}function di({root:e,context:t,style:n}){let a=si(e);return a.trail.length<2?null:(0,Re.jsx)(pi,{here:a,mark:a.as==="record"?{kind:a.kind,context:t}:void 0,...n?{style:n}:{},"data-testid":"page-trail"})}var ci={count:()=>0,place:()=>()=>{},subscribe:()=>()=>{}};function pi({here:e,mark:t,style:n,...a}){let r=e.as==="record"?e.trail.length-2:-1;return(0,Re.jsx)("nav",{"aria-label":"You are here","data-graview-trail":"",style:{minWidth:0,...n},...a,children:(0,Re.jsx)("ol",{style:{...he,listStyle:"none",padding:0,display:"flex",alignItems:"center",gap:6,minWidth:0,overflow:"hidden"},children:e.trail.map((o,l)=>(0,Re.jsxs)("li",{style:o.current?li:{...go,flexShrink:l===e.trail.length-2?0:1,maxWidth:"100%"},...o.current?{"aria-current":"page"}:{},children:[l>0&&!o.current?(0,Re.jsx)("span",{"aria-hidden":"true",children:"\u203A"}):null,o.current?o.label:o.path!==void 0?(0,Re.jsxs)($,{to:o.path,style:{...we,...go},...l===r?{"data-testid":"trail-list"}:{},children:[l===r&&t?(0,Re.jsx)(ue,{kind:t.kind,brand:t.context.brand,schema:t.context.store.schema,size:8}):null,(0,Re.jsx)("span",{style:mo,children:o.label})]}):(0,Re.jsx)("span",{style:mo,children:o.label})]},`${l}:${o.label}`))})})}var R=I(U(),1);function Ne(e){let t=e.views;if(!t)return[];let n=new Set(Fe(e.store,e.principal));return t.places().filter(a=>n.has(a.kind))}function en(e,t){if(!t.over)return[t.kind];let n=new Set(Fe(e.store,e.principal));return t.over.filter(a=>a===t.kind||n.has(a))}var tt=e=>`place:${e.kind}:${e.as}`;function fe(e,t){return zt(t.as,Mt(t,e.views?.places()??[])?j(e.store.schema,t.kind):void 0)}function vt(e,t){let n=e.schema.tryDefinition(t);return e.graph.nodesOfKind(t).filter(a=>st(n,a))}function Un(e,t,n){let a=(o,l)=>Tt(e.schema,l,o),r=(typeof t=="string"?[t]:t).map(o=>a(vt(e,o).length,o)).join(" and ");return n?`${r} across ${a(vt(e,n).length,n)}`:r}function Vn({context:e,place:t,chosen:n,filter:a}){let{store:r,views:o,invariantContext:l}=e,s=o?.resolve(t.kind,{cardinality:"many",fidelity:"full"},t.as)?.view,c=[...new Set(r.violations(l).flatMap(g=>g.nodeIds))],m=en(e,t).flatMap(g=>vt(r,g));if(!s)return null;let x=ui(r,m,a,c);return(0,R.jsx)(Ln,{kind:t.kind,view:t.title,children:(0,R.jsx)(s,{nodes:x,label:t.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1,...n&&n.length>0?{implicated:n}:{},...c.length>0?{flagged:c}:{}})})}function ui(e,t,n,a){let r=n?Nt({filter:n}).filter??[]:[];return r.length===0?t:Kt(t,{filter:r},{schema:e.schema,graph:e.graph,flagged:new Set(a)}).nodes}function gi({store:e,views:t,as:n,invariantContext:a}){ee(e);let r={store:e,views:t,...a?{invariantContext:a}:{}},o=t.places().find(l=>l.as===n);return o?(0,R.jsx)(Vn,{context:r,place:o}):null}function mi({context:e,kind:t}){let{store:n,views:a,invariantContext:r}=e,o=vt(n,t),l=n.schema.tryDefinition(t),i=Q(n,t),c=a?.resolve(t,{cardinality:"many",fidelity:"full"})?.view,m=[...new Set(n.violations(r).flatMap(P=>P.nodeIds))];if(c&&!lt(c))return(0,R.jsx)(Ln,{kind:t,children:(0,R.jsx)(c,{nodes:o,label:i,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1,...m.length>0?{flagged:m}:{}})});let x=a?.resolve(t,{cardinality:"one",fidelity:"summary"})?.view,g=8,p=o.slice(0,g);return(0,R.jsxs)("div",{"data-testid":"kind-sheet",style:x?{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gridAutoRows:"max-content",alignContent:"center",gap:12,padding:24}:{display:"flex",flexWrap:"wrap",alignContent:"center",justifyContent:"center",gap:10,padding:24},children:[p.map(P=>x?(0,R.jsx)(x,{node:P,fidelity:"summary",cardinality:"one",mode:"fullscreen",selected:!1,...m.includes(P.id)?{flagged:[P.id]}:{}},P.id):(0,R.jsx)("span",{style:{padding:"8px 14px",borderRadius:8,border:"1px solid var(--graview-edge-bright)",background:"var(--graview-ground)",color:"var(--graview-ink)"},children:pe(l,P)},P.id)),o.length>g?(0,R.jsxs)("span",{style:{...C,alignSelf:"center",padding:"0 6px"},children:["+",o.length-g," more ",i.toLowerCase()]}):null]})}function jn(e){let{store:t}=e,n=ao(e),a=Ne(e),r=e.views?.arrangement?.()?.order??[],o=s=>{let c=s.name===void 0?-1:r.indexOf(`view:${s.name}`);return c>=0?c-r.length:n.indexOf(s.kind)},l=Pn([...a].sort((s,c)=>o(s)-o(c))).filter(s=>!s.hidden),i=new Set(l.flatMap(s=>s.over??[s.kind]));return[...l.map(s=>({key:tt(s),kind:s.kind,title:Na(s,a,t.schema),to:fe(e,s),place:s})),...Qt(e).filter(s=>!i.has(s)).map(s=>({key:`kind:${s}`,kind:s,title:Q(t,s),to:`/${j(t.schema,s)}`}))]}var fo=.72,fi=540,yo=16/10;function yi(e){let t=(0,Ge.useRef)(null),[n,a]=(0,Ge.useState)(e);return(0,Ge.useLayoutEffect)(()=>{let r=t.current;if(!r||typeof ResizeObserver>"u")return;let o=()=>{let i=r.getBoundingClientRect().width;i>0&&a(s=>Math.abs(s-i)<.5?s:i)};o();let l=new ResizeObserver(o);return l.observe(r),()=>l.disconnect()},[]),{ref:t,width:n}}function hi(e){for(let t=e.parentElement;t;t=t.parentElement)if(/(auto|scroll)/.test(getComputedStyle(t).overflowY))return t;return null}function wi(e){let[t,n]=(0,Ge.useState)(()=>typeof IntersectionObserver>"u");return(0,Ge.useLayoutEffect)(()=>{let a=e.current;if(t||!a)return;let r=new IntersectionObserver(o=>{o.some(l=>l.isIntersecting)&&(r.disconnect(),n(!0))},{root:hi(a),rootMargin:"50% 0px"});return r.observe(a),()=>r.disconnect()},[t,e]),t}function _n({context:e,entry:t}){let{store:n,brand:a,principal:r}=e,{ref:o,width:l}=yi(fi),i=wi(o),s=l/fo,c=vt(n,t.kind),m=n.schema.tryDefinition(t.kind),x=c.length===0?Je(n,t.kind,{...r?{principal:r}:{},...e.invariantContext?{context:e.invariantContext}:{}}).actions.affordances[0]:void 0,g=t.place!==void 0;return(0,R.jsxs)($,{to:t.to,"data-testid":g?"place-card":"kind-card",className:"graview-gallery-card",style:{...we,display:"grid",gap:10,alignContent:"start",minWidth:0},children:[(0,R.jsxs)("span",{ref:o,"data-testid":g?"place-picture":"kind-picture","aria-hidden":"true",inert:!0,style:{display:"block",position:"relative",width:"100%",aspectRatio:`${yo}`,overflow:"hidden",borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",pointerEvents:"none"},children:[(0,R.jsx)("span",{style:{position:"absolute",left:0,top:0,width:s,height:s/yo,display:"grid",gridTemplateRows:"minmax(0, 1fr)",transform:`scale(${fo})`,transformOrigin:"0 0"},children:i?(0,R.jsx)(Ut.Provider,{value:null,children:t.place?(0,R.jsx)(Vn,{context:e,place:t.place}):(0,R.jsx)(mi,{context:e,kind:t.kind})}):null}),c.length===0?(0,R.jsx)("span",{"data-testid":"picture-empty",style:{position:"absolute",inset:0,display:"grid",placeContent:"center",justifyItems:"center",gap:2,padding:20,textAlign:"center"},children:(0,R.jsxs)("span",{style:{display:"grid",gap:2,padding:"10px 16px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-ground)",color:"var(--graview-ink)"},children:[(0,R.jsxs)("span",{style:{fontFamily:Fn,fontWeight:"var(--graview-weight-display)"},children:["No ",Q(n,t.kind).toLowerCase()," yet"]}),x?(0,R.jsxs)("span",{style:C,children:["Begin with \u201C",x.label,"\u201D"]}):null]})}):null]}),(0,R.jsxs)("span",{style:{display:"grid",gap:2,minWidth:0},children:[(0,R.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0},children:[g?null:(0,R.jsx)(ue,{kind:t.kind,brand:a,schema:n.schema,size:8}),(0,R.jsx)("span",{style:{fontFamily:Fn,fontSize:"var(--graview-text-heading)",fontWeight:"var(--graview-weight-display)",lineHeight:1.3,overflowWrap:"anywhere",textWrap:"balance"},children:t.title})]}),(0,R.jsxs)("span",{style:C,children:[t.place?Un(n,en(e,t.place),t.place.across):Un(n,t.kind),!g&&m?.description?` \xB7 ${m.description}`:null]})]})]})}var ho={display:"grid",gap:"32px 28px",gridTemplateColumns:"repeat(auto-fill, minmax(min(420px, 100%), 1fr))"},Si=`
|
|
2
|
-
.graview-gallery-card > span:first-child { transition: border-color 160ms ease, box-shadow 160ms ease; }
|
|
3
|
-
.graview-gallery-card:hover > span:first-child,
|
|
4
|
-
.graview-gallery-card:focus-visible > span:first-child { border-color: var(--graview-edge-bright); box-shadow: 0 1px 0 var(--graview-edge), 0 10px 30px -18px var(--graview-ink); }
|
|
5
|
-
`;function zn({context:e}){ee(e.store);let t=jn(e);return t.length===0?null:(0,R.jsxs)("section",{style:ho,"data-testid":"gallery",children:[(0,R.jsx)("style",{children:Si}),t.map(n=>(0,R.jsx)(_n,{context:e,entry:n},n.key))]})}function Yn({context:e}){let{store:t}=e;ee(t);let n=Pn(Ne(e)).filter(r=>!r.hidden),a=jn(e);return(0,R.jsxs)(oe,{context:e,style:ct,children:[(0,R.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,R.jsx)("p",{style:he,children:n.length===0?"None of its own yet":`${n.length} ${n.length===1?"picture":"pictures"}`}),(0,R.jsx)(le,{context:e,children:"Pictures"}),(0,R.jsx)("p",{style:se,children:n.length===0?"Nothing here has a picture of its own yet, so each kind is drawn as the scene draws it. Title a group view and it appears here by name.":"The ways this installation looks at what it holds \u2014 each one the same picture the scene shows, here as a page."})]}),a.length>0?(0,R.jsx)("div",{style:ho,"data-testid":"places",children:a.map(r=>(0,R.jsx)(_n,{context:e,entry:r},r.key))}):null]})}var vi={lede:!0},bi={lede:!1},ki={...se,textWrap:"pretty"};function xi(e,t){if(t===void 0)return;let[n]=dr(lr([t]),cr(e.store,null,null,e.brand?{money:e.brand}:{}));return n?.t==="headline"&&!n.problem&&n.text.trim()!==""?n.text:void 0}function Qn({context:e}){let{store:t,principal:n}=e;ee(t);let a=Ue(),r=We(),[o]=pt(),l=decodeURIComponent(a.as??""),[i,s]=(0,Ge.useState)(null),c=o.get("of"),m=o.get("filter"),g=Ne(e).find(A=>A.as===l&&(!c||j(t.schema,A.kind)===c));if(!g)return(0,R.jsxs)(oe,{context:e,children:[(0,R.jsx)(le,{context:e,children:"No picture is called that."}),(0,R.jsx)("p",{style:se,children:(0,R.jsx)($,{to:"/places",style:qe,children:(0,R.jsx)(Ze,{children:"The pictures there are"})})})]});let p=Q(t,g.kind),P=e.views?.resolve(g.kind,{cardinality:"many",fidelity:"full"},g.as)?.view,N=P?.flows===!0,W=P?.creates!==!1,k=xi(e,P?.lede),E=Je(t,g.kind,{...n?{principal:n}:{},...e.invariantContext?{context:e.invariantContext}:{}}),v=W?E.actions.affordances.map(A=>({affordance:A,mutation:t.allMutations().find(G=>G.name===A.mutation)})).filter(A=>A.mutation!==void 0):[];return(0,R.jsxs)(oe,{context:e,style:{...ct,gap:"var(--graview-space-6, 32px)"},children:[(0,R.jsxs)("header",{style:{display:"grid",gap:"var(--graview-space-2, 8px)"},children:[(0,R.jsx)(ut,{context:e}),(0,R.jsx)(le,{context:e,children:g.title}),(0,R.jsx)("p",{style:ki,"data-testid":"place-lede",...k!==void 0?{"data-graview-lede":"headline"}:{},children:k??`${Un(t,en(e,g),g.across)}.`}),m&&!N?(0,R.jsxs)("p",{style:{...C,margin:0},"data-testid":"place-narrowed",children:[`Only those where ${m.split(",").map(A=>A.replace(":"," is ")).join(" and ")}. `,(0,R.jsx)($,{to:`?${(()=>{let A=new URLSearchParams(o);return A.delete("filter"),A.toString()})()}`,style:{...V,...C},children:"Show all"})]}):null,(0,R.jsx)("p",{style:{...C,margin:0,display:"flex",flexWrap:"wrap",gap:"4px 16px"},children:en(e,g).map((A,G)=>(0,R.jsx)($,{to:`/${j(t.schema,A)}`,style:{...qe,...C},...G===0?{"data-testid":"place-as-list"}:{},children:(0,R.jsxs)(Ze,{children:["All ",(A===g.kind?p:Q(t,A)).toLowerCase()," as a list"]})},A))})]}),(0,R.jsx)("div",{"data-testid":"place-lens","data-flows":N?"":void 0,...N?{}:{role:"group","aria-label":g.title,tabIndex:0},style:N?{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",maxWidth:"100%"}:{height:"min(72vh, 760px)",display:"grid",gridTemplateRows:"minmax(0, 1fr)",overflow:"auto",maxWidth:"100%",borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)"},onClick:A=>{let G=A.target?.closest("[data-graview-pick]"),H=G?.getAttribute("data-graview-pick"),ae=G?.getAttribute("data-graview-joins");if(ae)try{let z=JSON.parse(ae);if(Array.isArray(z)&&z.every(Oe=>typeof Oe=="string")){A.preventDefault(),s({at:tt(g),ids:z});return}}catch{}if(!H)return;let J=t.graph.getNode(H);J&&(A.preventDefault(),r(Y(t.schema,J.kind,H)))},children:(0,R.jsx)(Kr.Provider,{value:k!==void 0?vi:bi,children:(0,R.jsx)(Vn,{context:e,place:g,filter:m,...i?.at===tt(g)?{chosen:i.ids}:{}})})}),v.length>0?(0,R.jsx)("div",{style:{maxWidth:760,display:"grid",gap:40},"data-testid":"place-creators",children:v.map(({affordance:A,mutation:G})=>(0,R.jsxs)("section",{style:{...re,display:"grid",gap:14},children:[(0,R.jsx)("h2",{style:ne,children:G.title??G.name}),G.description?(0,R.jsx)("p",{style:{...C,margin:0,maxWidth:"58ch"},children:G.description}):null,(0,R.jsx)(Ie,{store:t,mutation:G,prefilled:A.args,open:A.open,label:A.label,...n?{principal:n}:{}})]},A.id))}):null]})}function Pi(e,t=document){let n=jt(e);if(!n)return null;let a=[t,...[...t.querySelectorAll("[data-worker-view]")].flatMap(r=>r.shadowRoot?[r.shadowRoot]:[])];for(let r of a)for(let o of r.querySelectorAll("[id], [data-section]")){let l=o.getAttribute("data-section")??o.id;if(l===e||jt(l)===n)return o}for(let r of a)for(let o of r.querySelectorAll("h1, h2, h3, h4, h5, h6, [role=heading]"))if(jt(o.textContent??"")===n)return o;return null}function wo(e,t={}){if(typeof document>"u"||typeof requestAnimationFrame>"u")return()=>{};let n=t.frames??120,a=0,r=()=>{let o=Pi(e,t.root??document);if(o){o.hasAttribute("tabindex")||o.setAttribute("tabindex","-1"),o.scrollIntoView?.({block:"start"}),o.focus({preventScroll:!0});return}n-=1,n>0&&(a=requestAnimationFrame(r))};return a=requestAnimationFrame(()=>{a=requestAnimationFrame(r)}),()=>cancelAnimationFrame(a)}var q=I(Me(),1);var tn=I(Me(),1);var nt=I(U(),1);function So({context:e}){return ie()?(0,nt.jsxs)(nt.Fragment,{children:[(0,nt.jsx)(Ai,{context:e}),(0,nt.jsx)(Vr,{face:"pages",on:e.quickAsk??!0})]}):null}function Ai({context:e}){let{store:t}=e,n=ie(),{pathname:a}=me(),r=(0,tn.useRef)(n?.setSelection);return r.current=n?.setSelection,(0,tn.useEffect)(()=>{let o=r.current;if(!o)return;let[,l,i]=a.split("/"),s=(()=>{if(l==="places"){let m=e.views?.places().find(x=>x.as===decodeURIComponent(i??""));return m?[He(m.kind)]:[]}let c=l?Se(t.schema,l):void 0;return c&&i?[decodeURIComponent(i)]:c?[Ia(c)]:[]})();o(c=>c.length===s.length&&c.every((m,x)=>m===s[x])?c:s)},[a]),null}var be=I(Me(),1);var bo=I(ti(),1);var ge=I(U(),1);var Ci=$t(Ha(()=>(__graviewPreload(import.meta.url,["./chunk.XPR3QFF4.js","./chunk.YUEOUV7G.js","./chunk.UGFDSE37.js","./chunk.W5UJLKIT.js","./chunk.7UJZP3YK.js","./chunk.R77TACXU.js","./chunk.6JERQFZI.js","./chunk.7XJ3XQZD.js","./chunk.52J42KR5.js","./chunk.T2Q3AAQI.js","./chunk.63SRVTG2.js","./chunk.C4EPMV7O.js","./chunk.G7XKQNOL.js","./chunk.7KZ44FEU.js","./chunk.LSL25VXW.js","./chunk.WWUMSCYC.js","./chunk.J2R55TM7.js","./chunk.KPUX27ZT.js","./chunk.DIS7JS7X.js","./chunk.D2T563AA.js","./chunk.JV7FLVUV.js","./chunk.GL3YVGAP.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.QRCTTDDQ.js","./chunk.3TME4BG3.js","./chunk.I43ONAEL.js","./chunk.73EKJ4JN.js","./chunk.INL4OZI7.js","./chunk.5WU2UTP7.js","./chunk.GZHZLJBF.js","./chunk.YKACMLLU.js","./chunk.OJGHDWI6.js","./chunk.337JMOTL.js","./chunk.CV4QA4ZF.js","./chunk.OYRZ2DEI.js","./chunk.7EA7THSM.js","./chunk.AI2HBKVP.js","./chunk.Q5IAXTF5.js","./chunk.SDO3U72B.js","./chunk.VOHRQXCF.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.R7CRV2FE.js")).then(e=>({default:e.TakeBack}))));function Ri({context:e,docked:t,at:n,...a}){let{store:r}=e,o=ee(r),[l]=(0,be.useState)(()=>r.batches().length),i=(0,be.useRef)(!1);return i.current||=o>0||!t&&l>0,i.current?(0,ge.jsx)(be.Suspense,{fallback:null,children:(0,ge.jsx)(Ci,{context:e,docked:t,at:n,since:l,...a})}):null}function Li(e,t,n){let{store:a,principal:r,embedded:o}=e;(0,be.useEffect)(()=>{if(!n)return;let l=i=>{if(!Xr(i))return;let s=i.target,c=s instanceof Node&&t.current?.contains(s),m=s===document.body||s===document.documentElement||s===document;if(!(!c&&!(m&&!o))&&Qr(a,r)){i.preventDefault();try{Zr(a,r)}catch{}}};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[a,r,o,t,n])}function ko({context:e,registry:t,root:n,children:a}){let r=(0,be.useMemo)(lo,[]),o=t?.without()??new Set;return Li(e,n,!o.has("undo")),(0,ge.jsxs)(ht.Provider,{value:r,children:[(0,ge.jsx)(Ti,{context:e,placed:r,without:o}),a]})}function Ti({context:e,placed:t,without:n}){let[a,r]=(0,be.useState)(!1);(0,be.useLayoutEffect)(()=>r(!0),[]);let o=wt(t,"find"),l=wt(t,"undo"),i=me(),s=kr();if(!a)return null;let c=i.pathname.split("/").filter(Boolean),x=(c.length===1?Se(e.store.schema,c[0]):void 0)!==void 0;return(0,ge.jsxs)(ge.Fragment,{children:[!o&&!n.has("find")&&s?(0,bo.createPortal)((0,ge.jsx)(vo,{context:e,narrowsLists:x}),s.slot):null,!o&&!n.has("find")&&!s?(0,ge.jsx)("div",{"data-testid":"face-find-bar",style:{display:"flex",alignItems:"center",padding:"8px 16px",borderBottom:"1px solid var(--graview-edge)",background:"var(--graview-bar)",minWidth:0},children:(0,ge.jsx)(vo,{context:e,narrowsLists:x})}):null,!l&&!n.has("undo")?(0,ge.jsx)(Ri,{context:e,docked:!0,at:i.pathname+i.search}):null,s?.own&&!n.has("undo")?(0,ge.jsx)(ro,{context:e,own:s.own}):null]})}function vo({context:e,narrowsLists:t}){return(0,ge.jsx)(ht.Provider,{value:null,children:(0,ge.jsx)(Bn,{context:e,narrowsLists:t})})}var te=I(Me(),1);var ke=I(U(),1),Ei=500,Mi=10;function nn(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName==="TEXTAREA"||e.tagName==="SELECT"?!0:e.tagName==="INPUT"&&!["button","submit","reset","checkbox","radio","image","file","color","range"].includes(e.type):!1}function Ni(e){let t=typeof getSelection=="function"?getSelection():null;return t!==null&&!t.isCollapsed&&t.containsNode(e,!0)}function xo(e){let t=e.closest('a[href], button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"])');if(t)return t;let n=document.activeElement;return n instanceof HTMLElement&&n!==document.body?n:null}function Po({context:e,root:t,children:n}){return ie()===null?(0,ke.jsx)(ke.Fragment,{children:n}):(0,ke.jsx)(Oi,{context:e,root:t,children:n})}function Oi({context:e,root:t,children:n}){let{setMenuAt:a}=Ba(),{store:r}=e,o=r.schema,l=We(),{pathname:i,search:s}=me(),c=Xe("/").replace(/\/$/,""),m=(0,te.useCallback)((w,h)=>e.views?.places().find(L=>L.as===w&&(h===null||L.kind===h)),[e.views]),x=(0,te.useCallback)((w,h)=>{let[L="",O,Z]=w.split("/").filter(Boolean).map(u=>{try{return decodeURIComponent(u)}catch{return u}});if(Z!==void 0)return null;if(L==="places"&&O!==void 0){let u=m(O,new URLSearchParams(h).get("of"));return u?{face:"pages",place:u.as,about:[He(u.kind)],title:u.title}:null}let X=Se(o,L);return X?O===void 0?{face:"pages",about:[He(X)],title:Be(o,X)}:r.graph.getNode(O)?{face:"pages",on:O,about:[O]}:null:null},[o,r,m]),g=(0,te.useCallback)(w=>{let h=w.href;try{let L=new URL(h,location.href);if(L.origin===location.origin&&(c===""||L.pathname===c||L.pathname.startsWith(`${c}/`))){let O=x(L.pathname.slice(c.length),L.search);if(O)return{...O,href:h}}}catch{}return{face:"pages",about:[],href:h}},[c,x]),p=(0,te.useCallback)(()=>x(i,s)??{face:"pages",about:[]},[x,i,s]),P=(0,te.useCallback)(w=>{let h=p(),L=w.closest("[data-graview-field]")?.getAttribute("data-graview-field");if(L&&h.on!==void 0&&w.closest("[data-graview-pick], a[href]")===null)return{...h,field:L};let O=w.closest("[data-graview-act]")?.getAttribute("data-graview-act");if(O)return{...h,act:O};let Z=w.closest("a[href]"),X=w.closest("[data-graview-listed]"),u=[w.closest("[data-graview-pick]")?.getAttribute("data-graview-pick"),X&&(!Z||X.contains(Z)&&Z.classList.contains("graview-spec-item-link"))?X.getAttribute("data-graview-listed"):null].map(_=>_?r.graph.getNode(_):void 0).find(Boolean);if(u)return{face:"pages",on:u.id,about:[u.id],href:`${c}${Y(o,u.kind,u.id)}`};if(Z)return g(Z);let T=w.closest("[data-graview-record]")?.getAttribute("data-graview-record");return T&&r.graph.getNode(T)?{face:"pages",on:T,about:[T]}:h},[p,g,r,o,c]),N=(0,te.useCallback)(w=>{let h=t.current;if(h===null||!h.contains(w)||nn(w)||w.closest("[data-graview-popover]"))return null;let L=P(w);return{face:"pages",on:L.on,about:L.about??[],field:L.field,place:L.place,href:L.href,act:L.act,element:xo(w)}},[P,t]),W=(0,te.useCallback)((w,h,L)=>{let O=P(w);a({...O,x:Math.round(h),y:Math.round(L),returnTo:xo(w)})},[P,a]),k=(0,te.useCallback)(w=>{let h=w.getBoundingClientRect();W(w,h.left+Math.min(16,h.width/2),Math.min(h.bottom,h.top+36))},[W]),E=(0,te.useRef)(0),v=(0,te.useRef)(null),A=(0,te.useRef)(!1),G=()=>{v.current&&clearTimeout(v.current.timer),v.current=null};(0,te.useEffect)(()=>G,[]),(0,te.useEffect)(()=>{let w=h=>{if(h.defaultPrevented||!(h.key==="ContextMenu"||h.key==="F10"&&h.shiftKey))return;let L=t.current,O=h.target instanceof Element?h.target:null,Z=O===null||O===document.body||O===document.documentElement,X=L!==null&&O!==null&&L.contains(O);if(!X&&!(Z&&document.querySelector("[data-graview-face='pages']")===L)||nn(O)||O?.closest("[data-graview-popover]"))return;h.preventDefault(),E.current=Date.now();let u=X&&O instanceof HTMLElement?O:L?.querySelector("[data-graview-page-title], main h1, main")??null;u&&k(u)};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[t,k]),(0,te.useEffect)(()=>{let w=t.current;if(!w)return;let h=L=>{let O=L.detail;O&&a({...O,face:"pages"})};return w.addEventListener(Cn,h),()=>w.removeEventListener(Cn,h)},[t,a]);let H=(0,te.useMemo)(()=>w=>{if(w.face!=="pages")return null;let h=[],L=w.on===void 0?void 0:r.graph.getNode(w.on),O=w.place===void 0?void 0:e.views?.places().find(de=>de.as===w.place),Z=L?void 0:w.about.length===1&&w.about[0].startsWith("aggregate:")&&!O?$i(w.about[0]):void 0,X=L?Y(o,L.kind,L.id):O?fe(e,O):Z?`/${j(o,Z)}`:void 0,u=X!==void 0&&i===X.split("?")[0];X!==void 0&&!u&&h.push({id:"open",label:"Open",run:()=>l(X)});let T=X!==void 0?`${c}${X}`:w.href;T!==void 0&&h.push({id:"open-in-a-new-tab",label:"Open in a new tab",run:()=>void window.open(T,"_blank","noopener")});let _=L?`#focus=${encodeURIComponent(L.id)}`:O?`#focus=${encodeURIComponent(He(O.kind))}&view=${encodeURIComponent(O.as)}`:Z?`#focus=${encodeURIComponent(He(Z))}`:void 0;if(_!==void 0&&(e.overview||!e.embedded)){let de=e.overview;h.push({id:"in-the-scene",label:"Show in the scene",run:()=>de?de(_):location.assign(`${e.sceneHref??"/"}${_}`)})}return L===void 0&&w.href===void 0&&h.push({id:"find",label:"Find\u2026",run:()=>{let de=t.current?.querySelector('[data-testid="nav-find"]')??document.querySelector('[data-testid="nav-find"]');de&&de.offsetParent!==null?de.focus():l("/search")}}),h.length>0?{id:"pages",items:h}:null},[r,o,e,i,c,l,t]),ae=(0,te.useMemo)(()=>w=>{if(w.face!=="pages"||w.field===void 0||w.on===void 0)return null;let h=r.graph.getNode(w.on),L=w.element?.closest("[data-graview-field]")??t.current?.querySelector(`[data-graview-field="${CSS.escape(w.field)}"]`);return!h||!(L instanceof HTMLElement)||!L.hasAttribute("data-graview-editable")?null:{id:"field",at:"start",items:[{id:"change-field",label:`Change \u201C${ba(o.tryDefinition(h.kind),w.field)}\u201D`,run:()=>L.click()}]}},[r,o,t]),J=_r(),z=fr(),Oe=Or(),Ke=(0,te.useCallback)((w,h)=>{i===fe(e,w).split("?")[0]&&l(h?fe(e,h):"/")},[i,e,l]),xe=Yr(Ke),Pe=(0,te.useMemo)(()=>[ae,Oe,H,...xe?[xe]:[],...z?[z]:[],...J?[J]:[]],[ae,Oe,H,xe,z,J]);return(0,ke.jsxs)(pr,{sections:Pe,children:[(0,ke.jsx)("div",{"data-graview-menu-ground":"",style:{display:"contents"},onContextMenu:w=>{let h=w.target;w.shiftKey||nn(h)||Ni(h)||(w.preventDefault(),!h.closest("[data-graview-popover]")&&(Date.now()-E.current<700||(w.clientX===0&&w.clientY===0&&h instanceof HTMLElement?k(h):W(h,w.clientX,w.clientY))))},onPointerDown:w=>{if(A.current=!1,w.pointerType==="mouse"||!w.isPrimary)return;let h=w.target;if(nn(h)||h.closest("[data-graview-choose], [data-graview-popover]"))return;G();let{clientX:L,clientY:O}=w;v.current={x:L,y:O,timer:setTimeout(()=>{v.current=null,A.current=!0,E.current=Date.now(),W(h,L,O)},Ei)}},onPointerMove:w=>{let h=v.current;h&&Math.hypot(w.clientX-h.x,w.clientY-h.y)>Mi&&G()},onPointerUp:G,onPointerCancel:G,onClickCapture:w=>{A.current&&(A.current=!1,w.preventDefault(),w.stopPropagation())},children:n}),(0,ke.jsx)(Hi,{openAt:k,readyAt:N}),(0,ke.jsx)(zr,{placement:"page"}),(0,ke.jsx)(yr,{})]})}function $i(e){let t=e.slice(10).split("+");return t.length===1&&t[0]?t[0]:void 0}function Hi({openAt:e,readyAt:t}){return(0,ke.jsx)("span",{"data-graview-menu-home":"",tabIndex:-1,onFocus:n=>{if(n.target!==n.currentTarget)return;let a=n.currentTarget.closest("[data-graview-face]"),r=a?.querySelector("[data-graview-page-title]")??a?.querySelector("main h1, main")??null;r&&(r.hasAttribute("tabindex")||r.setAttribute("tabindex","-1"),r.focus({preventScroll:!0}))},style:{position:"absolute",width:0,height:0,overflow:"hidden"},children:(0,ke.jsx)(Ur,{placement:"menu",openActs:e,aimAt:t})})}var K=I(U(),1);function Ao(e,t){return t==="*"?{label:"anything",path:null}:{label:Q(e,t),path:`/${j(e.schema,t)}`}}function Ii({context:e,relation:t}){let{store:n}=e,a=Ao(n,t.from),r=Ao(n,t.to),o=l=>l.path?(0,K.jsx)($,{to:l.path,style:{...we,fontWeight:550},children:l.label}):(0,K.jsx)("span",{children:l.label});return(0,K.jsxs)("li",{"data-testid":"relation","data-relation":t.edgeKind,style:{display:"grid",gridTemplateColumns:"30px minmax(0, 1fr) auto",gap:12,alignItems:"baseline"},children:[(0,K.jsx)(jr,{edgeKind:t.edgeKind,...e.brand?.kit?{kit:e.brand.kit}:{}}),(0,K.jsxs)("span",{style:{display:"grid",gap:1},children:[(0,K.jsxs)("span",{children:[o(a)," ",(0,K.jsxs)("span",{style:C,"data-graview-speaks-ids":"",children:[ze(t.edgeKind)," \u2192"]})," ",o(r)]}),t.description||t.inverse?(0,K.jsxs)("span",{style:C,children:[t.description?Ae(t.description):null,t.description&&t.inverse?" \xB7 ":null,t.inverse?`from the other end, ${t.inverse}`:null]}):null]}),r.path?(0,K.jsx)($,{to:`${r.path}?with=${encodeURIComponent(t.edgeKind)}`,style:{...V,...C,fontVariantNumeric:"tabular-nums",display:"inline-block",minWidth:24,minHeight:24,textAlign:"center"},title:`The ${r.label.toLowerCase()} that have this`,children:t.count}):(0,K.jsx)("span",{style:{...C,fontVariantNumeric:"tabular-nums"},children:t.count})]})}function Co({context:e,heading:t=!0}){let{store:n}=e,a=new Set(Fe(n,e.principal)),r=et(n).relations.filter(o=>a.has(o.from)&&(o.to==="*"||a.has(o.to)));return r.length===0?null:(0,K.jsxs)("section",{style:{...re,display:"grid",gap:12},"data-testid":"kind-map",children:[t?(0,K.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[(0,K.jsx)("h2",{style:ne,children:(0,K.jsx)($,{to:"/map",style:we,children:"Connections"})}),(0,K.jsx)("span",{style:C,children:r.length===1?"1 relation":`${r.length} relations`})]}):null,(0,K.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:r.map(o=>(0,K.jsx)(Ii,{context:e,relation:o},`${o.edgeKind}|${o.from}|${o.to}`))})]})}function Zn({context:e}){let{store:t}=e;ee(t);let n=new Set(Fe(t,e.principal)),a=et(t),r=a.relations.filter(o=>n.has(o.from));return(0,K.jsxs)(oe,{context:e,children:[(0,K.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,K.jsx)("p",{style:he,children:r.length===0?"No relations":`${r.length} ${r.length===1?"relation":"relations"}`}),(0,K.jsx)(le,{context:e,children:"Connections"}),(0,K.jsx)("p",{style:se,children:r.length===0?"Nothing here is declared to relate to anything else yet.":"The kinds this installation holds, and the relations declared between them \u2014 each in the declaration's own words, with how many of it there are."})]}),(0,K.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"6px 18px"},"data-testid":"map-kinds",children:a.kinds.filter(o=>n.has(o.kind)).map(o=>(0,K.jsxs)("li",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[(0,K.jsx)(ue,{kind:o.kind,brand:e.brand,schema:t.schema,size:7}),(0,K.jsx)($,{to:`/${j(t.schema,o.kind)}`,style:V,children:o.plural}),(0,K.jsx)("span",{style:C,children:o.count})]},o.kind))}),(0,K.jsx)(Co,{context:e,heading:!1})]})}function Ro({context:e}){let n=[...ie()?.robots.values()??[]].filter(r=>r.mode==="asking"&&r.say);if(n.length===0)return null;let{store:a}=e;return(0,K.jsxs)("section",{style:{...re,display:"grid",gap:10},"data-testid":"seat-questions",children:[(0,K.jsx)("h2",{style:ne,children:n.length===1?"The seat asked something":`The seat asked ${n.length} things`}),(0,K.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:8},children:n.map(r=>{let o=r.at?a.graph.getNode(r.at):void 0;return(0,K.jsxs)("li",{style:{display:"grid",gap:2},children:[(0,K.jsx)("span",{children:r.say}),o?(0,K.jsxs)($,{to:Y(a.schema,o.kind,o.id),style:{...V,...C},children:[pe(a.schema.tryDefinition(o.kind),o)," \u2192"]}):null]},r.participant)})})]})}var B=I(U(),1);function Xn({context:e}){let{principal:t}=e,{store:n,brand:a,invariantContext:r}=e;ee(n);let o=n.violations(r),l=`${o.length===1?"A rule is broken":"Rules are broken"} \u2014 see what, and what would fix it`,i=[...n.log.all()].slice(-5).reverse(),c=Qt(e).map(k=>({kind:k,members:n.graph.nodesOfKind(k).filter(E=>st(n.schema.tryDefinition(k),E))})),m=c.filter(k=>k.members.length>0),x=c.map(k=>({entry:k,creator:n.allMutations().find(E=>(E.creates??[]).includes(k.kind)&&n.permits({name:E.name,args:{}},e.principal).ok)})).find(k=>k.creator!==void 0),g=m.length===0?"Nothing here yet.":`${m.map(k=>Tt(n.schema,k.kind,k.members.length)).join(", ").replace(/, ([^,]*)$/," and $1")}.`,p=e.views?.homeView?.(),P=n.schema.kinds.some(k=>n.graph.nodesOfKind(k).length>0);if(p&&P){let k=a?.subtitle&&a.subtitleDrawn!==!1?(0,B.jsx)("p",{style:{...C,margin:0},"data-testid":"app-subtitle",children:a.subtitle}):null,E=p[Symbol.for("graview.home-blocks")]===!0;return(0,B.jsx)(oe,{context:e,style:ct,children:(0,B.jsxs)("div",{style:{display:"grid",gap:12},"data-testid":"home-view",children:[E?null:k,o.length>0?(0,B.jsx)($,{to:"/problems",style:{...V,color:"var(--graview-warn)"},children:l}):null,(0,B.jsx)(Gr.Provider,{value:E?k:null,children:(0,B.jsx)(Jt,{when:Ot(p),children:(0,B.jsx)(p,{cardinality:"many",fidelity:"full",mode:"fullscreen",selected:!1})})})]})})}let N=new Set(Fe(n,e.principal)),W=et(n).relations.filter(k=>N.has(k.from)&&(k.to==="*"||N.has(k.to)));return(0,B.jsxs)(oe,{context:e,style:ct,children:[(0,B.jsxs)("header",{style:{display:"grid",gap:12},children:[a?.subtitle&&a.subtitleDrawn!==!1?(0,B.jsx)("p",{style:{...C,margin:0},"data-testid":"app-subtitle",children:a.subtitle}):null,(0,B.jsx)(le,{context:e,"data-testid":"standing",children:g}),(0,B.jsxs)("p",{style:{...se,display:"grid",gap:4},"data-testid":"standing-card",children:[m.length===0&&x?(0,B.jsxs)("span",{children:["Begin with \u201C",x.creator?.title??x.creator?.name,"\u201D, under"," ",(0,B.jsx)($,{to:`/${j(n.schema,x.entry.kind)}`,style:V,children:Q(n,x.entry.kind)}),"."]}):null,o.length===0?(0,B.jsx)("span",{children:"All rules hold."}):(0,B.jsx)($,{to:"/problems",style:{...V,color:"var(--graview-warn)"},children:l})]})]}),(0,B.jsx)(zn,{context:e}),(0,B.jsxs)("section",{style:{...re,display:"grid",gap:14},"data-testid":"kinds",children:[(0,B.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[(0,B.jsx)("h2",{style:ne,children:"What is here"}),W.length>0?(0,B.jsx)($,{to:"/map",style:{...qe,...C,marginLeft:"auto"},"data-testid":"map-link",children:(0,B.jsxs)(Ze,{children:["Connections \xB7 ",W.length===1?"1 relation":`${W.length} relations`]})}):null]}),(0,B.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"8px 10px"},children:c.map(({kind:k,members:E})=>(0,B.jsx)("li",{style:{maxWidth:"100%"},children:(0,B.jsxs)($,{to:`/${j(n.schema,k)}`,style:{...we,flexWrap:"wrap",gap:8,padding:"6px 14px 6px 10px",borderRadius:8,border:"1px solid var(--graview-edge-bright)",background:"var(--graview-panel)"},children:[(0,B.jsx)(ue,{kind:k,brand:a,schema:n.schema,size:7}),(0,B.jsx)("span",{style:{fontWeight:550,overflowWrap:"anywhere"},children:Q(n,k)}),(0,B.jsx)("span",{style:{...C,fontVariantNumeric:"tabular-nums"},children:E.length===0?"none yet":ft(E.length)})]})},k))})]}),i.length>0?(0,B.jsxs)("section",{style:{...re,display:"grid",gap:10},children:[(0,B.jsx)("h2",{style:ne,children:"Recently"}),(0,B.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:i.map(k=>(0,B.jsxs)("li",{style:C,children:[(0,B.jsx)("span",{style:{color:"var(--graview-ink)"},children:k.intent})," \u2014 ",yt(k,t,{graph:n.graph,schema:n.schema,...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{}})]},k.id))})]}):null]})}var Lo=I(Me(),1);function To(e,t){(0,Lo.useEffect)(()=>{let n=globalThis[Symbol.for("graview.shown-lists")]??=new Map;return n.set(e,()=>t),()=>void n.delete(e)})}var Jn=e=>(__graviewPreload(import.meta.url,["./chunk.AJZBJBMO.js"]),import("./chunk.6YGRRXJB.js")).then(t=>t.saveShownList(e.read()));function Eo(e,t,n){let a={off:e,about:t,read:n,menu:(r,o,l)=>[...e?[]:[{id:"export-csv",label:"Export CSV",run:()=>void Jn(a)}],...r&&o?[{id:e?"export-on":"export-off",label:e?"Turn on export":"Turn off export",run:()=>void (__graviewPreload(import.meta.url,["./chunk.AJZBJBMO.js"]),import("./chunk.6YGRRXJB.js")).then(i=>i.switchExport(a,o,e,l))}]:[]]};return a}function ea(e){let{schema:t,graph:n,kind:a,nodes:r,arrangement:o,offers:l,declaredGroup:i}=e,s=t.tryDefinition(a),c=Wt(o.query??""),m=[...o.filter??[],...c.conditions],x=m.some(H=>H.key==="is"&&(H.value==="past"||H.value==="any"))||xr(s,m),g=x||!s?.lifecycle?o:{...o,filter:[...o.filter??[],{key:"is",value:"current"}]},p=new Map,P=Kt(r,g,{schema:t,graph:n,...e.flagged?{flagged:e.flagged}:{},...e.today!==void 0?{today:e.today}:{},read:(H,ae)=>{let J=p.get(H.id);return J||p.set(H.id,J=Qe(t,n,H)),J[ae]}}),N=P.grouped&&!!o.group?.by,W=i&&o.group?.by===i.by&&!o.group.bucket?l.groups.find(H=>H.key===i.by):void 0,k=i&&W&&(W.type==="choice"||W.type==="boolean")?vr(P.groups,i,{type:W.type,...W.options?{options:W.options}:{}}):P.groups.map(H=>({...H,closed:!1})),E=!!o.query||(o.filter??[]).some(H=>H.key===i?.by),v=H=>W?.type==="boolean"?H==="1"?"true":"false":H,A=e.opened??new Set,G=k.map(H=>{let ae=v(H.key);return{...H,value:ae,shut:H.closed&&!E&&!A.has(ae)}});return{arrangement:g,showingPast:x,arranged:P,grouped:N,groups:G,nodes:N?G.flatMap(H=>H.shut?[]:H.nodes):P.nodes}}var Le=I(Me(),1);var at=I(U(),1);function an({context:e,withheld:t,style:n,testId:a}){let r=ie(),o=Ea(t,e.signIn??r?.signIn);return o?(0,at.jsx)("p",{style:{...n,margin:0},children:(0,at.jsx)("button",{type:"button","data-testid":"sign-in",onClick:()=>o.run(),style:ve,children:o.label})}):t.length===0?null:(0,at.jsx)("ul",{style:{...n,margin:0,padding:0,listStyle:"none",display:"grid",gap:4},...a?{"data-testid":a}:{},children:t.map(l=>(0,at.jsxs)("li",{style:C,children:[(0,at.jsx)("s",{children:l.label})," \u2014 ",l.refusal.message]},l.id))})}var M=I(U(),1);function ta({context:e}){let{store:t,brand:n,principal:a,invariantContext:r}=e;ee(t);let[o]=pt(),l=o.get("q")??"",i=typeof r?.today=="string"?r.today:void 0,s=Lr(t,l,{...a?{principal:a}:{},places:Ne(e),flagged:new Set(t.violations(r).flatMap(p=>p.nodeIds)),...i?{today:i}:{},limit:200}),c=s.hits.filter(p=>p.about==="node"),m=s.hits.filter(p=>p.about==="kind"||p.about==="place"||p.about==="rule"),x=[...new Set(c.map(p=>p.kind))],g=l.trim();return(0,M.jsxs)(oe,{context:e,children:[(0,M.jsx)("style",{children:Yt}),(0,M.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,M.jsx)("p",{style:he,children:"Search"}),(0,M.jsx)(le,{context:e,"data-testid":"search-heading",children:g.length===0?"Find anything by its name":s.hits.length===0?(0,M.jsxs)(M.Fragment,{children:["Nothing here is called \u201C",g,"\u201D."]}):(0,M.jsxs)(M.Fragment,{children:[Fi(t,s.byKind)," for \u201C",g,"\u201D"]})}),g.length>0?(0,M.jsxs)("p",{style:{...C,margin:0},"data-testid":"search-searched",children:[Gt(t.schema,s.searched),s.conditions.filter(p=>p.key!=="is"&&p.admittedBy.length<s.searched.kinds.length).map(p=>(0,M.jsxs)("span",{children:[" ",p.key,":",p.value," narrows"," ",p.admittedBy.length===0?"nothing here":p.admittedBy.map(P=>Q(t,P).toLowerCase()).join(" and "),"."]},`${p.key}:${p.value}`))]}):(0,M.jsxs)("p",{style:se,children:["Type in the box above. Words find the start of words in names and in what each record says;"," ",(0,M.jsx)("code",{children:"done:false"})," and the like narrow as a list does, and ",(0,M.jsx)("code",{children:"is:any"})," includes what is past."]})]}),m.length>0?(0,M.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},"data-testid":"search-named",children:m.map(p=>(0,M.jsx)("li",{"data-testid":"search-hit","data-about":p.about,children:p.about==="kind"?(0,M.jsxs)($,{to:`/${j(t.schema,p.kind)}`,style:V,children:[p.label,p.count>0?(0,M.jsxs)("span",{style:C,children:[" \xB7 ",p.count," match"]}):null]}):p.about==="place"?(0,M.jsxs)($,{to:fe(e,p),style:V,children:["Go to ",p.title]}):p.about==="rule"?(0,M.jsxs)($,{to:"/problems",style:V,children:["The rule \u201C",p.label,"\u201D"]}):null},`${p.about}:${p.about==="rule"?p.name:p.about==="place"?p.as:p.kind}`))}):null,x.map(p=>(0,M.jsxs)("section",{className:"graview-list",style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",minWidth:0},"data-testid":"search-group","data-kind":p,children:[(0,M.jsxs)("h2",{className:"graview-group-head",style:{alignItems:"center"},children:[(0,M.jsx)(ue,{kind:p,brand:n,schema:t.schema,size:8}),(0,M.jsx)($,{to:`/${j(t.schema,p)}?${new URLSearchParams({q:g}).toString()}`,style:V,"data-testid":"search-kind-link",children:Q(t,p)}),(0,M.jsx)("span",{children:s.byKind[p]})]}),(0,M.jsx)("ul",{className:"graview-rows",children:c.filter(P=>P.kind===p).map(P=>(0,M.jsxs)("li",{"data-testid":"search-hit","data-about":"node",className:"graview-row",children:[(0,M.jsxs)($,{to:Y(t.schema,p,P.id),className:"graview-row-title",...P.label.length>60?{title:P.label}:{},children:[P.flagged?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)("span",{role:"img","aria-label":"Breaks a rule:",style:{color:"var(--graview-warn)"},children:"\u26A0"})," "]}):null,P.label]}),P.apart||!P.current?(0,M.jsx)("span",{className:"graview-row-glance",children:[P.apart,P.current?"":"past"].filter(Boolean).join(" \xB7 ")}):null,(0,M.jsx)(rn,{why:P.why})]},P.id))})]},p)),g.length>0?(0,M.jsx)(Di,{asked:g}):null,g.length>0&&s.hits.length===0?(0,M.jsx)(No,{store:t,kinds:s.searched.kinds,words:s.words,...a?{principal:a}:{},...r?{invariantContext:r}:{}}):null]})}function rn({why:e}){return e.strength==="near"?(0,M.jsxs)("span",{style:C,"data-testid":"search-why","data-near":"",children:["Near \u201C",e.asked,"\u201D",e.field==="label"?"":` \u2014 ${e.reading}: ${e.fragment}`]}):e.field==="label"?null:(0,M.jsxs)("span",{style:C,"data-testid":"search-why",children:[e.reading,": ",e.fragment]})}function Fi(e,t){let n=Object.entries(t).map(([a,r])=>`${r} ${r===1?Ye(e.schema.tryDefinition(a),a):Q(e,a).toLowerCase()}`);return n.length===0?"Found":n.length===1?Ae(n[0]):Ae(`${n.slice(0,-1).join(", ")} and ${n[n.length-1]}`)}function Mo(e,t,n={}){let a=[];for(let r of t){let o=Je(e,r,{...n.principal?{principal:n.principal}:{},...n.invariantContext?{context:n.invariantContext}:{}});for(let l of on(e,r,o.actions.affordances))a.some(i=>i.mutation.name===l.mutation.name)||a.push(l)}return a}function on(e,t,n){let a=e.schema.tryDefinition(t)?.fieldRoles?.label,r=[];for(let o of n){let l=e.allMutations().find(c=>c.name===o.mutation);if(!l||!l.creates?.includes(t)||r.some(c=>c.mutation.name===l.name))continue;let i=hr(l.input).map(c=>c.name),s=i.includes("label")?"label":a&&i.includes(a)?a:void 0;!s||o.args[s]!==void 0||r.push({kind:t,affordance:o,mutation:l,arg:s})}return r}function No({store:e,kinds:t,words:n,principal:a,invariantContext:r}){let o=Mo(e,t,{...a?{principal:a}:{},...r?{invariantContext:r}:{}});return o.length===0||n.trim().length===0?null:(0,M.jsx)("div",{style:{display:"grid",gap:24},"data-testid":"search-to-create",children:o.map(({kind:l,affordance:i,mutation:s,arg:c})=>(0,M.jsxs)("section",{style:{...re,display:"grid",gap:14},children:[(0,M.jsxs)("h2",{style:ne,children:[Ae(ka(Ye(e.schema.tryDefinition(l),l)))," called \u201C",n,"\u201D"]}),(0,M.jsx)(Ie,{store:e,mutation:s,prefilled:i.args,open:i.open,initial:{[c]:n},...a?{principal:a}:{}})]},`${i.id}|${n}`))})}function Di({asked:e}){let t=ie();return t?(0,M.jsx)(Wi,{asked:e,desk:t.aiDesk}):null}function Wi({asked:e,desk:t}){return Ya(t)?(0,M.jsx)("p",{style:{margin:0},children:(0,M.jsxs)("button",{type:"button","data-testid":"search-ask",onClick:a=>za(t,{pointed:{about:[]},asked:e,returnTo:a.currentTarget}),style:{...V,font:"inherit",padding:0,border:0,background:"transparent",cursor:"pointer",textAlign:"start"},children:["Ask: \u2018",e,"\u2019"]})}):null}var f=I(U(),1),$o=8,Ho=40;function Gi(e,t){let n=t?.fields?.shape??{},a=Object.keys(n).find(r=>Pa(n[r])&&xa(e[r]));return a===void 0?void 0:e[a]}function na({context:e}){let t=Ue(),n=Se(e.store.schema,t.slug??"");return n?(0,f.jsx)(Io,{context:e,kind:n}):(0,f.jsx)(oe,{context:e,children:(0,f.jsx)(le,{context:e,children:"No such kind of thing here."})})}function Io({context:e,kind:t,opening:n,row:a,layout:r="list",description:o,bare:l}){let{store:i,brand:s,invariantContext:c}=e;ee(i);let[m,x]=pt(),g=`list-${(0,Le.useId)().replace(/:/g,"")}`,p=i.schema.tryDefinition(t),P=Ca(m.get("archived")),N=i.graph.nodesOfKind(t,{archived:P}),W=et(i).relations.filter(d=>d.from===t||d.to===t),k=new Set(i.violations(c).flatMap(d=>d.nodeIds)),E=Cr(i.schema,Ar(i.schema,Pr(i.schema,t))),v=W.map(d=>d.edgeKind),A=ji(m,E,v),G=["sort","filter","group","q","by","with","past","archived",...v].some(d=>m.has(d)),H=N.length>=Ho,ae=p?.fieldRoles?.when,J=e.views?.arrangement?.()?.lists?.[t],z=Sr(J),Oe=wr(J?.group),Ke=Vi(H,ae),xe=n??(z?{...Ke,...z}:Ke),Pe=G?A.arrangement:On(xe,E).arrangement,w=z?.sort,h=Pe.sort&&w?.then&&Pe.sort.by===w.by&&Pe.sort.direction===w.direction?{...Pe,sort:w}:Pe,L=Wt(h.query??""),O=new Set((m.get("open")??"").split(",").filter(Boolean)),Z=ea({schema:i.schema,graph:i.graph,kind:t,nodes:N,arrangement:h,offers:E,declaredGroup:Oe,flagged:k,...typeof c?.today=="string"?{today:c.today}:{},opened:O}),{showingPast:X,arranged:u}=Z,T=Z.groups,_=ie(),de=Eo(J?.export===!1,{kind:t},()=>({title:Q(i,t),schema:i.schema,graph:i.graph,kind:t,groups:Z.groups,grouped:Z.grouped,onExport:e.onExport??_?.onExport,words:{labelOf:pe,readableFields:Ft,withComputed:Qe}}));To(`list:${t}`,de);let qo=d=>d.shut,Uo=d=>{let y=new URLSearchParams(m),F=new Set(O);F.has(d)?F.delete(d):F.add(d),F.size>0?y.set("open",[...F].join(",")):y.delete("open"),x(y,{replace:!0})},Te=u.nodes,je=p?.lifecycle&&!X?N.filter(d=>st(p,d)):N,ia=N.length-je.length,sa=h.group?.by??null,Vo=d=>{let y=new URLSearchParams(m);for(let ce of["sort","filter","group","q","by","with","past","archived",...W.map(Rt=>Rt.edgeKind)])y.delete(ce);let F=Tr(d);for(let ce of["sort","filter","group","q","archived"])F[ce]&&y.set(ce,F[ce]);![...y.keys()].some(ce=>["sort","filter","group","q"].includes(ce))&&(n||z||H||ae)&&y.set("sort",""),x(y)},{principal:ot}=e,dn=Je(i,t,{...ot?{principal:ot}:{},...e.invariantContext?{context:e.invariantContext}:{}}),De=dn.actions.affordances.map(d=>({affordance:d,mutation:i.allMutations().find(y=>y.name===d.mutation)})).filter(d=>d.mutation!==void 0),jo=dn.actions.withheld,cn=()=>new Set(Te.length===0?De.map(({mutation:d})=>d.name):[]),[pn,la]=(0,Le.useState)(()=>({kind:t,open:cn()}));pn.kind!==t&&la({kind:t,open:cn()});let da=d=>(pn.kind===t?pn.open:cn()).has(d),ca=(d,y)=>la(F=>{let ce=new Set(F.open);return y?ce.add(d):ce.delete(d),{kind:F.kind,open:ce}}),pa=`begin-${(0,Le.useId)().replace(/:/g,"")}`,ua=L.words&&Te.length===0?Object.fromEntries(on(i,t,dn.actions.affordances).map(d=>[d.mutation.name,d.arg])):{},_e=Q(i,t),kt=e.views?.lookup(t,{cardinality:"one",fidelity:"glyph"}),un=kt!==void 0&&!lt(kt)?kt:void 0,gn=(h.group?.bucket??"day")==="day"?h.group?.by:void 0,mn=(h.filter??[]).map(d=>d.key),_o=mn.filter(d=>mn.indexOf(d)===mn.lastIndexOf(d)&&/choice|boolean/.test(E.filters.find(y=>y.key===d)?.type??"")),fn=d=>{let y={...p?.computed?Qe(i.schema,i.graph,d):d};gn&&!String(y[gn]).includes("T")&&delete y[gn];for(let F of _o)delete y[F];return y},ga=d=>or(p?.fields?.shape?.[d])?.type==="enum",xt=d=>{let y=pe(p,d);if(a)return(0,f.jsxs)("li",{"data-testid":"record-row","data-graview-record":d.id,style:{minWidth:0},...bn(d.id),children:[vn(d,y),a(d,{label:y,href:Y(i.schema,t,d.id),flagged:k.has(d.id),glance:no(fn(d),p,y)})]},d.id);if(un){let kn=Vt(kt,d,i.graph),Jo=Object.fromEntries(Object.entries(fn(d)).filter(([ei])=>!kn?.fields.has(ei))),Sa=kn?Dn(Jo,p,kn.title??y,ga):[];return(0,f.jsxs)("li",{"data-testid":"record-row","data-graview-record":d.id,style:{position:"relative",display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:16,rowGap:2,paddingBlock:10,borderTop:"1px solid var(--graview-edge)"},...bn(d.id),children:[vn(d,y),(0,f.jsx)("div",{style:{flex:"1 1 14rem",minWidth:0},children:(0,f.jsx)(un,{node:d,cardinality:"one",fidelity:"glyph",mode:"fullscreen",selected:!1,...k.has(d.id)?{flagged:[d.id]}:{}})}),Sa.length>0?(0,f.jsx)("span",{style:{...C,flex:"0 1 auto",minWidth:0,overflowWrap:"anywhere"},"data-testid":"record-glance",children:(0,f.jsx)(Wn,{runs:Sa})}):null,(0,f.jsx)(Yi,{to:Y(i.schema,t,d.id),label:k.has(d.id)?`${y} \u2014 implicated in a problem`:y})]},d.id)}let F=Dn(fn(d),p,y,ga),ce=F.length>0,Rt=L.words?Rr(p,d,L.words):void 0,ha=H?void 0:sr(d,p),Lt=Gi(d,p),wa=(0,f.jsxs)($,{to:Y(i.schema,t,d.id),className:"graview-row-title",...y.length>60?{title:y}:{},children:[k.has(d.id)?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("span",{role:"img","aria-label":"Breaks a rule:",style:{color:"var(--graview-warn)"},children:"\u26A0"})," "]}):null,y]});return(0,f.jsxs)("li",{className:"graview-row","data-graview-record":d.id,...bn(d.id),children:[vn(d,y),ha?(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,minWidth:0},children:[(0,f.jsx)(dt,{as:"thumb",file:ha}),wa]}):wa,ce||Lt?(0,f.jsxs)("span",{className:"graview-row-glance",children:[(0,f.jsx)(Wn,{runs:F}),ce&&Lt?" \xB7 ":null,Lt?(0,f.jsx)(Bt,{address:Lt}):null]}):null,Rt?(0,f.jsx)(rn,{why:Rt}):null]},d.id)},yn=Ne(e).filter(d=>d.kind===t&&!d.hidden),ma=J?.filters,zo=(h.filter??[]).some(d=>d.key!=="is"||d.value!=="any"),Yo=!!(h.sort||h.group||h.query||zo),Qo=je.length>=$o||G&&Yo,$e=h.sort?E.sorts.find(d=>d.key===h.sort.by):void 0,hn=$e?.type==="date"||$e!==void 0&&$e.key===ae,fa=H&&!u.grouped&&$e&&($e.about==="label"||$e.type==="text"||hn)?d=>{let y=$e.about==="label"?pe(p,d):d[$e.key];if(typeof y!="string"||y.length===0)return hn?"No date":"#";if(hn)return y.slice(0,4);let F=y.trim().charAt(0).toLocaleUpperCase();return/\p{L}/u.test(F)?F:"#"}:void 0,Pt=fa?Te.reduce((d,y)=>{let F=fa(y);return d.at(-1)?.key===F?d.at(-1).nodes.push(y):d.push({key:F,nodes:[y]}),d},[]):void 0,ya=Z.nodes,wn=(0,Le.useMemo)(()=>ya.map(d=>d.id),[ya.map(d=>d.id).join(`
|
|
6
|
-
`)]),Ee=$r(wn),Sn=(0,Le.useId)(),gt=(ot?i.permittedMutations(ot):i.permittedMutations()).some(d=>{let y=d.subject?.kinds;return y!==void 0&&(y==="*"||y.includes(t))}),vn=(d,y)=>gt?(0,f.jsx)("span",{className:"graview-choose-at",children:(0,f.jsx)("input",{...Ee.boxProps(d.id,y),onPointerEnter:$n,onFocus:$n})}):null,bn=d=>gt?{"data-graview-choose":d}:{},Zo=(0,Le.useCallback)(d=>{Ee.choose(d),requestAnimationFrame(()=>{let y=Ee.list.current;((d[0]===void 0?null:y?.querySelector(`[data-graview-choose-box="${CSS.escape(d[0])}"]`))??y)?.focus({preventScroll:!0})})},[Ee]),it=r==="grid"?{margin:0,padding:0,listStyle:"none",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 15rem), 1fr))",alignItems:"start",gap:12}:a||un?{margin:0,padding:0,listStyle:"none",display:"grid",gap:a&&r==="list"?6:0}:void 0,At=it?void 0:"graview-rows",mt=d=>`list-at-${d.replace(/[^\p{L}\p{N}]/gu,"_")}`,Ct=W.map(d=>{let y=d.from===t?d.to:d.from,F=d.from===t?d.description:d.inverse??d.description;return{relation:d,far:y,words:F}}),Xo=new Set(Ct.map(d=>(d.words??"").toLowerCase()).filter((d,y,F)=>d&&F.indexOf(d)!==y));return(0,f.jsxs)(l?Ui:oe,{context:e,children:[(0,f.jsxs)("div",{style:{display:"grid",gap:12},children:[(0,f.jsxs)("header",{style:{display:"grid",gap:4},children:[l?null:(0,f.jsx)(ut,{context:e}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",columnGap:10,rowGap:4,minWidth:0},children:[(0,f.jsx)(ue,{kind:t,brand:s,schema:i.schema,size:8}),(0,f.jsx)(le,{context:e,children:_e}),De.length>0?(0,f.jsx)("span",{style:{marginLeft:"auto",display:"flex",flexWrap:"wrap",columnGap:14,rowGap:8},"data-testid":"beginnings-open",children:De.map(({affordance:d,mutation:y})=>(0,f.jsx)(_i,{name:y.name,title:y.title??y.name,panel:`${pa}-${y.name}`,open:da(y.name),onOpen:F=>ca(y.name,F)},d.id))}):null,!de.off&&je.length>0?(0,f.jsxs)("button",{type:"button","data-testid":"list-export","aria-label":"Export CSV",title:"Export CSV",onClick:()=>void Jn(de),style:{...we,minHeight:28,margin:"-4px 0",...De.length>0?{}:{marginLeft:"auto"},padding:"0 2px",border:0,background:"none",font:"inherit",color:"var(--graview-ink-muted)",cursor:"pointer"},children:[(0,f.jsx)("span",{"aria-hidden":"true",style:{marginRight:4},children:"\u2193"}),"CSV"]}):null]}),Te.length>0?(0,f.jsx)(Jr,{place:"here",to:[{label:`Skip to the ${Te.length===1?Ye(p,t):`${Te.length} ${_e.toLowerCase()}`}`,testid:"records",go:()=>{let d=document.querySelector(`[data-graview-skip-target="${CSS.escape(Sn)}"]`);Hn(d?.querySelector('[data-graview-choose-box][tabindex="0"]')??d)}},...je.length>0?[{label:"Skip to arranging them",testid:"arranging",go:()=>{let d=document.querySelector(`[data-graview-skip-target="${CSS.escape(Sn)}"]`)?.parentElement?.querySelector('[role="group"][aria-label="Arrange"]');Hn(d?.querySelector('button[data-testid$="-add"], button[data-testid$="-all"]')??d)}}]:[]]}):null,o??p?.description?(0,f.jsx)("p",{style:se,children:o??p?.description}):null,Ct.length>0||yn.length>0?(0,f.jsxs)("p",{style:{...C,margin:0,display:"flex",flexWrap:"wrap",columnGap:18,rowGap:2},"data-testid":"kind-related",children:[Ct.length>0?(0,f.jsxs)("span",{"data-testid":"kind-relations",children:["Related:"," ",Ct.map(({relation:d,far:y,words:F},ce)=>(0,f.jsxs)("span",{"data-relation":d.edgeKind,children:[ce>0?(0,f.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,y==="*"?Ae(F??ze(d.edgeKind)):(0,f.jsx)($,{to:`/${j(i.schema,y)}`,style:V,title:Q(i,y),children:F&&Xo.has(F.toLowerCase())?`${Ae(F)}: ${Q(i,y).toLowerCase()}`:Ae(F??Q(i,y))})]},`${d.edgeKind}|${d.from}|${d.to}`))]}):null,yn.length>0?(0,f.jsxs)("span",{"data-testid":"kind-pictures",children:["Also as:"," ",yn.map((d,y)=>(0,f.jsxs)("span",{children:[y>0?(0,f.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,(0,f.jsx)($,{to:fe(e,d),style:V,children:d.title})]},tt(d)))]}):null]}):null]}),De.length>0?(0,f.jsx)("div",{style:{display:"contents"},"data-testid":"beginnings",children:De.map(({affordance:d,mutation:y})=>{let F=!!(ua[y.name]&&Te.length===0);return(0,f.jsx)(zi,{name:y.name,id:`${pa}-${y.name}`,description:y.description,open:da(y.name),onClose:()=>ca(y.name,!1),children:(0,f.jsx)(Ie,{store:i,mutation:y,prefilled:d.args,open:d.open,...F?{initial:{[ua[y.name]]:L.words}}:{},...e.principal?{principal:e.principal}:{}},F?`${y.name}|${L.words}`:y.name)},d.id)})}):null,A.dropped.length>0?(0,f.jsxs)("p",{style:{...C,margin:0},"data-testid":"list-dropped",children:["This link asked for ",A.dropped.join(", "),", which ",_e.toLowerCase()," cannot be arranged by; the rest is shown."]}):null,je.length>0?(0,f.jsx)(Nr,{schema:i.schema,graph:i.graph,kind:t,arrangement:h,onChange:Vo,kept:{shown:Te.length,of:je.length},noun:{one:Ye(p,t),many:_e.toLowerCase()},...Qo?{}:{allow:!1},...ma?{filters:ma}:{},offers:E,chips:{nodes:je,flagged:k,...typeof c?.today=="string"?{today:c.today}:{}},query:e.framed===!0&&e.barAbove!==!0}):null,(0,f.jsx)("style",{children:Yt}),gt?(0,f.jsx)("style",{children:Hr+qi}):null,(0,f.jsx)("div",{className:"graview-list","data-graview-skip-target":Sn,...gt?{...Ee.listProps,ref:Ee.list,tabIndex:-1,"data-graview-choosable":"","aria-label":Ee.chosen.length>0?`${_e}, ${Ee.chosen.length} chosen`:_e,role:"group"}:{},children:Te.length===0&&L.words?(0,f.jsxs)("p",{style:se,"data-testid":"none-yet",children:["Nothing here is called \u201C",L.words,"\u201D."," ",(0,f.jsx)("span",{style:C,"data-testid":"list-searched",children:Gt(i.schema,{kinds:[t],past:X})})," ",(0,f.jsx)($,{to:"?",style:V,children:"Show every one"})]}):Te.length===0?(0,f.jsxs)("p",{style:se,"data-testid":"none-yet",children:[h.filter?.length||h.query?"None of them.":"None yet",!h.filter?.length&&!h.query&&De.length>0?` \u2014 the first one starts above, with \u201C${De[0]?.mutation.title??De[0]?.mutation.name}\u201D.`:!h.filter?.length&&!h.query?".":"",h.filter?.length||h.query?(0,f.jsxs)(f.Fragment,{children:[" ",(0,f.jsx)($,{to:"?",style:V,children:"Show every one"})]}):null]}):u.grouped&&sa?(0,f.jsx)("div",{style:{display:"grid",gap:"1rem"},"data-testid":"records","data-grouped":sa,children:T.map(d=>{if(!d.closed)return(0,f.jsxs)("section",{style:{display:"grid",gap:0},"data-testid":"list-group",children:[(0,f.jsxs)("h2",{className:"graview-group-head",children:[d.label," ",(0,f.jsx)("span",{children:d.nodes.length})]}),(0,f.jsx)("ul",{style:it,className:At,"data-graview-rows":"",children:d.nodes.map(xt)})]},d.key||"-");let y=qo(d),F=`${g}-${mt(d.key||"none")}`;return(0,f.jsxs)("section",{style:{display:"grid",gap:0},"data-testid":"list-group","data-closed":y?"shut":"open",children:[(0,f.jsx)("h2",{className:"graview-group-head",children:(0,f.jsxs)("button",{type:"button",className:"graview-group-toggle","aria-expanded":!y,"aria-controls":F,"data-testid":"list-group-toggle",onClick:()=>Uo(d.value),children:[(0,f.jsx)("span",{"aria-hidden":"true",children:y?"\u25B8":"\u25BE"}),d.label," ",(0,f.jsxs)("span",{children:["\xB7 ",d.nodes.length]}),(0,f.jsxs)("span",{style:Ki,children:[" ",d.nodes.length===1?Ye(p,t):_e.toLowerCase()]})]})}),(0,f.jsx)("ul",{id:F,style:y?{...it,display:"none"}:it,className:At,"data-graview-rows":"",hidden:y,children:y?null:d.nodes.map(xt)})]},d.key||"-")})}):Pt&&Pt.length>1?(0,f.jsxs)("div",{style:{display:"grid",gap:14},"data-testid":"records","data-sectioned":$e?.type==="date"?"year":"letter",children:[(0,f.jsx)("nav",{"aria-label":"Jump to","data-testid":"list-index",style:{...C,display:"flex",flexWrap:"wrap",gap:$e?.type==="date"?"0 10px":"0 4px",lineHeight:1.3},children:Pt.map(d=>(0,f.jsx)("a",{href:`#${mt(d.key)}`,onClick:y=>{y.preventDefault(),document.getElementById(mt(d.key))?.scrollIntoView({block:"start"})},style:{...we,minWidth:24,justifyContent:"center"},children:d.key},d.key))}),Pt.map(d=>(0,f.jsxs)("section",{"data-testid":"list-section","aria-labelledby":mt(d.key),style:{display:"grid",gap:0},children:[(0,f.jsx)("h2",{id:mt(d.key),className:"graview-group-head",children:d.key}),(0,f.jsx)("ul",{style:it,className:At,"data-graview-rows":"",children:d.nodes.map(xt)})]},d.key))]}):(0,f.jsx)("ul",{style:it,className:At,"data-testid":"records","data-graview-rows":"",children:Te.map(xt)})}),gt?(0,f.jsx)(Ir,{store:i,chosen:Ee.chosen,...ot?{principal:ot}:{},...c?{context:c}:{},anchor:Bi,of:wn.length,onChooseAll:()=>Ee.choose(wn),onClear:Ee.clear,onActed:Zo}):null,ia>0?(0,f.jsxs)($,{to:Oo(m,"filter","is:any"),style:{...V,...C,justifySelf:"start"},"data-testid":"past-link",children:["+",ia," past"]}):null,P===!1&&i.graph.count(t,{archived:!0})>0?(0,f.jsxs)($,{to:Oo(m,"archived","true"),style:{...V,...C,justifySelf:"start"},"data-testid":"archived-link",children:["+",i.graph.count(t,{archived:!0})," archived"]}):null]}),(0,f.jsx)(an,{context:e,withheld:jo,style:re,testId:"withheld"})]})}var Ki={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},Bi=()=>document.querySelector("[data-graview-choosable]")?.closest("[data-embed-content]")??null,qi=`
|
|
7
|
-
.graview-list[data-graview-choosable]{outline:none}
|
|
8
|
-
.graview-list [data-graview-choose]{position:relative;padding-left:34px}
|
|
9
|
-
.graview-choose-at{position:absolute;left:2px;top:0;bottom:0;z-index:${Ma.raised};display:flex;align-items:center}
|
|
10
|
-
@media (min-width: 900px) and (pointer: fine){
|
|
11
|
-
.graview-list [data-graview-choose]{padding-left:0}
|
|
12
|
-
.graview-choose-at{left:-34px}
|
|
13
|
-
}
|
|
14
|
-
@media (pointer: coarse){
|
|
15
|
-
.graview-list:not([data-graview-choosing]) [data-graview-choose]{padding-left:0}
|
|
16
|
-
.graview-list:not([data-graview-choosing]) .graview-choose-at{display:none}
|
|
17
|
-
}
|
|
18
|
-
`;function Ui({children:e}){return(0,f.jsx)("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:40,minWidth:0},children:e})}var Vi=(e,t)=>t?{sort:{by:t,direction:"desc"}}:e?{sort:{by:"label",direction:"asc"}}:{};function ji(e,t,n){let a=Nt({...e.get("sort")?{sort:e.get("sort")}:{},...e.get("filter")?{filter:e.get("filter")}:{},...e.get("group")?{group:e.get("group")}:{},...e.get("q")?{q:e.get("q")}:{},...e.get("archived")?{archived:e.get("archived")}:{}}),r=[...a.filter??[]],o=e.get("by"),l=a.group??(o?{by:o}:void 0);for(let s of n){let c=e.get(s);c&&r.push({key:s,value:c})}let i=e.get("with");return i&&r.push({key:i,value:"*"}),e.get("past")==="1"&&!r.some(s=>s.key==="is")&&r.push({key:"is",value:"any"}),On({...a.sort?{sort:a.sort}:{},...a.query?{query:a.query}:{},...r.length>0?{filter:r}:{},...l?{group:l}:{},...a.archived!==void 0?{archived:a.archived}:{}},t)}function Oo(e,t,n){let a=new URLSearchParams(e);return a.set(t,n),a.delete("past"),`?${a.toString()}`}function _i({name:e,title:t,panel:n,open:a,onOpen:r}){return(0,f.jsxs)("button",{type:"button","data-testid":`act-open-${e}`,"data-graview-act":e,"aria-expanded":a,"aria-controls":n,onClick:()=>{r(!a),a||requestAnimationFrame(()=>document.getElementById(n)?.querySelector("input, select, textarea, button")?.focus())},style:{...we,minHeight:28,margin:"-4px 0",padding:"0 2px",border:0,background:"none",font:"inherit",fontWeight:600,color:"var(--graview-ink)",cursor:"pointer"},children:[(0,f.jsx)("span",{"aria-hidden":"true",style:{marginRight:6},children:a?"\u2212":"+"}),t]})}function zi({name:e,id:t,description:n,open:a,onClose:r,children:o}){return(0,f.jsxs)("div",{"data-testid":`act-${e}`,id:t,hidden:!a,onKeyDown:l=>{l.key==="Escape"&&(l.preventDefault(),r(),document.querySelector(`[aria-controls="${t}"]`)?.focus())},style:a?{display:"grid",gap:12,padding:"4px 0 12px"}:void 0,children:[n?(0,f.jsx)("p",{style:{...C,margin:0,maxWidth:"58ch"},children:n}):null,o]})}function Yi({to:e,label:t}){let n=(0,Le.useRef)(null);return Fr(n),(0,f.jsx)($,{ref:n,to:e,"aria-label":t,style:{position:"absolute",inset:0,borderRadius:6}})}var rt=I(Me(),1);var bt=I(Me(),1);var D=I(U(),1);function aa({context:e}){let{store:t,brand:n,invariantContext:a,principal:r}=e;ee(t);let o=t.violations(a),l=t.allInvariants(),i=Ht(t,o),s=Qa(t.schema,l);return(0,D.jsxs)(oe,{context:e,children:[(0,D.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,D.jsx)(le,{context:e,children:o.length===0?"All rules hold":"What is broken"}),(0,D.jsx)("p",{style:se,"data-testid":"problems-count",children:o.length===0?"Every declared rule is satisfied by what is here.":Ra(o)})]}),(0,D.jsx)(Ro,{context:e}),i.map((c,m)=>{let x=c.nodeIds[0],g=x?t.graph.getNode(x):void 0;return(0,D.jsxs)("section",{style:{display:"grid",gap:10,padding:"16px 18px",borderLeft:"3px solid var(--graview-warn)",background:"var(--graview-panel-warning)",borderRadius:"0 var(--graview-radius, 12px) var(--graview-radius, 12px) 0"},children:[c.line?null:(0,D.jsx)(sn,{violation:c,schema:t.schema,...n?{brand:n}:{}}),g?(0,D.jsxs)("p",{style:{margin:0,display:"inline-flex",alignItems:"center",gap:8},children:[(0,D.jsx)(ue,{kind:g.kind,brand:n,schema:t.schema,size:7}),(0,D.jsx)($,{to:Y(t.schema,g.kind,g.id),style:V,children:pe(t.schema.tryDefinition(g.kind),g)})]}):null,c.line?(0,D.jsx)(sn,{violation:c,schema:t.schema,...n?{brand:n}:{}}):null,(0,D.jsx)(ln,{store:t,repairs:c.repairs,...r?{principal:r}:{}})]},m)}),l.length>0?(0,D.jsxs)("section",{style:{...re,display:"grid",gap:12},"data-testid":"rules",children:[(0,D.jsx)("h2",{style:ne,children:"The rules"}),(0,D.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:l.map(c=>{let m=o.filter(p=>p.invariant===c.name).length,x=s.get(c.name),g=c.label??c.name;return(0,D.jsxs)("li",{"data-graview-rule":c.name,style:{display:"grid",gap:2},children:[(0,D.jsxs)("span",{style:{display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:12,rowGap:2},children:[x?(0,D.jsx)(It,{line:x,schema:t.schema,...n?{brand:n}:{},style:{flex:"1 1 18rem"}}):(0,D.jsx)("span",{style:{flex:"1 1 18rem",fontWeight:550},children:g}),(0,D.jsx)("span",{style:{...C,color:m>0?"var(--graview-warn)":"var(--graview-ink-faint)"},children:m===0?"holds":`broken in ${m} ${m===1?"place":"places"}`})]}),x&&g.trim().length>0?(0,D.jsx)("span",{style:C,children:g}):null]},c.name)})})]}):null]})}function sn({violation:e,schema:t,brand:n}){if(!e.line)return(0,D.jsx)("p",{style:{margin:0,color:"var(--graview-warn)",fontWeight:550},children:e.message});let a=Xa(e),r=Za(e);return r?(0,D.jsxs)("div",{style:{display:"grid",gap:4},"data-testid":"problem-line",children:[(0,D.jsx)("p",{style:{margin:0,color:"var(--graview-warn)",fontWeight:550},"data-testid":"problem-says",children:r}),a?(0,D.jsx)("span",{style:C,children:a}):null,(0,D.jsxs)("details",{"data-testid":"problem-judged",style:C,children:[(0,D.jsx)("summary",{style:{cursor:"pointer",width:"fit-content",minHeight:24},children:"How it is judged"}),(0,D.jsx)(It,{line:e.line,schema:t,...n?{brand:n}:{},lead:"none"})]})]}):(0,D.jsxs)("div",{style:{display:"grid",gap:2},"data-testid":"problem-line",children:[(0,D.jsx)(It,{line:e.line,schema:t,...n?{brand:n}:{},lead:"none",style:{color:"var(--graview-warn)"}}),a?(0,D.jsx)("span",{style:C,children:a}):null]})}function ln({store:e,repairs:t,principal:n}){let[a,r]=(0,bt.useState)(null),[o,l]=(0,bt.useState)(null),i=(0,bt.useRef)([]);if(t.length===0)return null;let s=a===null?null:t[a],c=s&&(s.missing??[]).length>0?e.allMutations().find(m=>m.name===s.mutation):void 0;return(0,D.jsxs)("div",{style:{display:"grid",gap:10},"data-testid":"repairs",children:[(0,D.jsx)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:t.map((m,x)=>{let g=(m.missing??[]).length>0,p=e.permits({name:m.mutation,args:{...m.args}},n);return p.ok?(0,D.jsx)("button",{ref:P=>{i.current[x]=P},type:"button","data-graview-repair":m.mutation,"data-graview-asks":g||void 0,"aria-expanded":g?a===x:void 0,onClick:()=>{if(l(null),g){r(a===x?null:x);return}r(null);try{e.apply({name:m.mutation,args:{...m.args}},n?{author:n}:{})}catch(P){l(Dt(e.schema,e.allMutations(),P))}},style:ve,children:g?`${m.label} \u2026`:m.label},x):(0,D.jsxs)("p",{"data-testid":"withheld","data-withheld":p.refusal.wouldNeed.join(",")||"nobody",style:{...C,margin:0},children:[(0,D.jsx)("s",{children:m.label})," \u2014 ",p.refusal.message]},x)})}),c&&s?(0,D.jsx)(Ie,{store:e,mutation:c,prefilled:{...s.args},only:s.missing??[],label:s.label,autoFocus:!0,onDone:()=>{let m=a;r(null),requestAnimationFrame(()=>{let x=m===null?null:i.current[m];if(x?.isConnected){x.focus();return}let g=document.querySelector("[data-graview-page-title]")??document.querySelector("main h1, main h2");g&&(g.hasAttribute("tabindex")||(g.tabIndex=-1),g.focus())})},...n?{principal:n}:{}}):null,s&&!c&&(s.missing??[]).length>0?(0,D.jsxs)("p",{"data-testid":"refused",role:"alert",style:{margin:0,color:"var(--graview-warn)",fontSize:In},children:["\u201C",s.label,"\u201D names ",s.mutation,", which this app does not declare."]}):null,o?(0,D.jsx)("p",{"data-testid":"refused",role:"alert",style:{margin:0,color:"var(--graview-warn)",fontSize:In},children:o}):null]})}var ra=I(Me(),1);var Ve=I(U(),1);function Fo({store:e,link:t,principal:n}){let[a,r]=(0,ra.useState)(!1),[o,l]=(0,ra.useState)(null),i=nr(t);return(0,Ve.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[(0,Ve.jsx)("button",{type:"button","data-graview-provisional":"",title:i,"aria-label":`Unsure link: ${i}`,"aria-expanded":a,onClick:()=>r(!a),style:{border:"1px dashed var(--graview-ink-muted)",borderRadius:999,background:"transparent",color:"var(--graview-ink-muted)",font:"inherit",fontSize:"0.75rem",lineHeight:1,padding:"2px 6px",cursor:"pointer"},children:"unsure"}),a?(0,Ve.jsxs)("span",{style:{...C,display:"inline-flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,Ve.jsx)("span",{children:i}),(0,Ve.jsx)("button",{type:"button",style:{...ve,padding:"4px 10px"},onClick:()=>{try{e.apply({name:La,args:{kind:t.edge.kind,from:t.edge.from,to:t.edge.to}},n?{author:n}:{}),r(!1)}catch(s){l(Dt(e.schema,e.allMutations(),s))}},children:"Keep this link"}),o?(0,Ve.jsx)("span",{role:"alert",children:o}):null]}):null]})}var ye=I(U(),1);function Do({nodeId:e,node:t,field:n,inPlace:a,labelStyle:r=he}){return n.files?(0,ye.jsx)(dt,{as:"field",read:!a,nodeId:e,field:n.key,label:n.label,files:n.files,labelStyle:r,style:{gap:4}}):n.long?(0,ye.jsx)(Mr,{nodeId:e,field:n.key,label:n.label,value:n.value,markdown:n.markdown,style:{gridColumn:"1 / -1",gap:4},labelStyle:r,valueStyle:{lineHeight:1.6}}):(0,ye.jsxs)("div",{style:{display:"grid",gap:2,minWidth:0,alignContent:"start"},children:[(0,ye.jsx)("dt",{style:r,children:n.label}),(0,ye.jsx)("dd",{style:{margin:0,overflowWrap:"anywhere",minWidth:0},children:n.linked?(0,ye.jsx)(ur,{relation:n.linked.relation,refs:n.linked.refs,...a?{nodeId:e,field:n.key}:{}}):n.app?(0,ye.jsx)(Bt,{address:n.app,as:"record",...a?{nodeId:e,field:n.key}:{}}):n.href?(0,ye.jsx)(Er,{href:n.href,field:n.key,value:n.value,stored:n.stored,...a?{nodeId:e}:{}}):a?(0,ye.jsxs)(ye.Fragment,{children:[(0,ye.jsx)(qt,{nodeId:e,field:n.key,value:n.value,stored:n.stored}),n.repeats?(0,ye.jsx)(gr,{nodeId:e,field:n.key,start:t?.[n.key],value:t?.[`${n.key}Repeat`],label:`${n.label} repeats`}):null]}):n.value})]})}var S=I(U(),1),Qi=[];function oa({context:e}){let{store:t,brand:n,principal:a,invariantContext:r}=e;ee(t);let o=ie()!==null,l=Ue(),i=decodeURIComponent(l.id??""),s=po(t,i,{...a?{principal:a}:{},...r?{context:r}:{}}),c=Ht(t,s?.violations??Qi),[m,x]=(0,rt.useState)(null),[g,p]=(0,rt.useState)(!1),[P,N]=(0,rt.useState)(null),W=(0,rt.useRef)(null),k=(0,rt.useRef)(null),E=mr({flow:"both",letters:!0}),v=u=>{(W.current?.parentElement?.querySelector(`[data-affordance="${u.replace(/["\\]/g,"\\$&")}"]`)??W.current)?.focus()};if(!s)return(0,S.jsx)(oe,{context:e,children:(0,S.jsx)(le,{context:e,children:"Nothing lives at this address."})});let A=t.graph.getNode(i),G=t.schema.tryDefinition(s.kind),H=G?.describe&&A?er(G,A):null,ae=[...t.log.all()].filter(u=>!Et(u)&&(u.writes.includes(i)||u.reads.includes(i))).slice(-8).reverse(),J=t.log.all().find(u=>!Et(u)&&u.undoes===void 0&&u.primitives.some(T=>T.op==="add-node"&&T.node.id===i)),z=s.actions.affordances.filter(u=>u.provider!=="invariant"),Oe=z.filter(u=>u.destructive||u.setsAside),Ke=g||Oe.length<2?z:z.filter(u=>!Oe.includes(u)),xe=e.views?.lookup(s.kind,{cardinality:"one",fidelity:"full"}),Pe=xe!==void 0&&!lt(xe)?xe:void 0,w=Pe&&A?Vt(xe,A,t.graph):void 0,h=w?s.fields.filter(u=>!w.fields.has(u.key)):s.fields,L=w?s.links.flatMap(u=>{let T=u.targets.filter(_=>!w.records.has(_.id));return T.length>0?[{...u,targets:T}]:[]}):s.links,O=Pe!==void 0&&ja(xe),Z=o&&ir(G).length>0,X=Ne(e).filter(u=>!u.hidden&&(u.kind===s.kind||u.across===s.kind));return(0,S.jsxs)(oe,{context:e,children:[(0,S.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,S.jsx)(ut,{context:e}),(0,S.jsx)(le,{context:e,children:o&&A?.label===s.label?(0,S.jsx)(qt,{nodeId:i,field:"label",value:s.label,said:s.label}):s.label}),H&&H!==s.label?(0,S.jsx)("p",{style:se,children:H}):null,J?.lineage?(0,S.jsxs)("p",{style:{...C,margin:0},"data-testid":"record-lineage",children:["Made by ",yt(J,a,{graph:t.graph,schema:t.schema,...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{}}),", ",Rn(J.lineage)]}):null,(0,S.jsx)(Zt,{context:e,stop:`#focus=${encodeURIComponent(i)}`,style:{...qe,...C},"data-testid":"spatial-link"}),o&&A?(0,S.jsx)(En,{choices:[{on:"changed",record:i},{on:"act",record:i},{on:"reaches",kind:s.kind,condition:"",record:i}],label:"Notify me when this changes",testId:"record-notify",style:{...ve,...C,justifySelf:"start"}}):null,X.length>0?(0,S.jsxs)("p",{style:{...C,margin:0},"data-testid":"seen-in",children:["Seen in:"," ",X.map((u,T)=>(0,S.jsxs)("span",{children:[T>0?(0,S.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,(0,S.jsx)($,{to:fe(e,u),style:V,children:u.title})," ",(0,S.jsx)(Zt,{context:e,stop:`#view=${encodeURIComponent(u.as)}`,style:{...V,...C,display:"inline-block",minWidth:24,textAlign:"center"},title:`${u.title}, in the scene`,label:`${u.title}, in the scene`,children:(0,S.jsx)("span",{"aria-hidden":"true",children:"\u2197"})})]},tt(u)))]}):null]}),A&&Aa(A)?(0,S.jsx)(Xi,{context:e,id:i,kind:s.kind}):null,A&&Ta(t,i)?(0,S.jsx)(Zi,{context:e,id:i,kind:s.kind}):null,Pe&&A?(0,S.jsx)("section",{"data-testid":"record-view",style:{display:"grid",minWidth:0},children:(0,S.jsx)(Dr,{children:(0,S.jsx)(Jt,{when:Ot(xe),children:(0,S.jsx)(Pe,{node:A,cardinality:"one",fidelity:"full",mode:"fullscreen",selected:!1,...s.violations.length>0?{flagged:[i]}:{}})})})}):null,s.violations.length>0?(0,S.jsx)("section",{"data-testid":"record-violations",style:{display:"grid",gap:12,padding:"16px 18px",borderLeft:"3px solid var(--graview-warn)",background:"var(--graview-panel-warning)",borderRadius:"0 var(--graview-radius, 12px) var(--graview-radius, 12px) 0"},children:c.map((u,T)=>(0,S.jsxs)("div",{style:{display:"grid",gap:8},children:[(0,S.jsx)(sn,{violation:u,schema:t.schema,...n?{brand:n}:{}}),(0,S.jsx)(ln,{store:t,repairs:uo(s.actions,u.repairs),...a?{principal:a}:{}})]},T))}):null,!O&&(h.length>0||Z)?(0,S.jsxs)("section",{style:{...re,display:"grid",gap:14},"data-testid":"record-fields",children:[(0,S.jsx)("h2",{style:ne,children:"The facts"}),tr(G,h).map((u,T)=>{let _=(0,S.jsx)("dl",{style:{margin:0,display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gap:"14px 24px"},children:u.fields.map(de=>(0,S.jsx)(Do,{nodeId:i,node:A,field:de,inPlace:o},de.key))});return u.title?(0,S.jsxs)("section",{style:{display:"grid",gap:10,minWidth:0},children:[(0,S.jsx)("h3",{"data-graview-field-group":u.title,style:{...ne,fontSize:"inherit"},children:u.title}),_]},T):(0,S.jsx)("div",{children:_},T)}),Z?(0,S.jsx)(dt,{as:"unfilled",nodeId:i,skip:[...w?.fields??[]],labelStyle:he,style:{gap:4}}):null]}):null,(O?[]:L).map(u=>(0,S.jsxs)("section",{style:{...re,display:"grid",gap:10},children:[(0,S.jsx)("p",{style:he,children:to(t,u)}),u.description?(0,S.jsx)("h2",{style:ne,children:Ae(u.description)}):(0,S.jsxs)("h2",{style:ne,"aria-label":ze(u.edgeKind),children:[u.direction==="in"?"\u2190 ":"\u2192 ",ze(u.edgeKind)]}),(0,S.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"6px 18px"},children:u.targets.map(T=>{let _=ar(t,u.direction==="in"?{kind:u.edgeKind,from:T.id,to:i}:{kind:u.edgeKind,from:i,to:T.id});return(0,S.jsxs)("li",{style:{display:"inline-flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,S.jsx)(ue,{kind:T.kind,brand:n,schema:t.schema,size:7}),(0,S.jsxs)($,{to:Y(t.schema,T.kind,T.id),style:V,children:[T.label,T.apart?(0,S.jsxs)("span",{style:C,children:[" \xB7 ",T.apart]}):null]}),_?.provisional?(0,S.jsx)(Fo,{store:t,link:_,...a?{principal:a}:{}}):null]},T.id)})}),(u.direction==="out"&&t.schema.edge(u.edgeKind)?.cardinality==="one"?[]:[...new Set(u.targets.map(T=>T.kind))]).map(T=>(0,S.jsx)($,{to:`/${j(t.schema,T)}?${encodeURIComponent(u.edgeKind)}=${encodeURIComponent(i)}`,style:{...qe,...C},"data-testid":"related-all",children:(0,S.jsxs)(Ze,{children:["Sort and filter ",u.description??`these ${Q(t,T).toLowerCase()}`,u.targets.some(_=>_.kind!==T)?` (${Q(t,T).toLowerCase()})`:""]})},T))]},`${u.edgeKind}|${u.direction}|${u.description??""}`)),!O&&(z.length>0||s.actions.withheld.length>0)?(0,S.jsxs)("section",{style:{...re,display:"grid",gap:14},"data-testid":"record-actions",children:[(0,S.jsx)("h2",{style:ne,ref:W,tabIndex:-1,children:"What can be done"}),(0,S.jsxs)("div",{role:"toolbar","aria-label":"What can be done",...E,style:{display:"flex",flexWrap:"wrap",gap:8},children:[Ke.map(u=>{let T=m===u.id;return(0,S.jsx)("button",{type:"button","data-affordance":u.id,"data-rank":u.rank,"data-graview-act":u.mutation,[Tn]:"",autoFocus:g&&u===Oe[0],"aria-expanded":T,onClick:()=>x(T?null:u.id),style:{...ve,...T?{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"}:{}},children:u.label},u.id)}),Ke.length<z.length?(0,S.jsxs)("button",{type:"button","aria-expanded":!1,onClick:()=>p(!0),style:{...ve,...C},"data-testid":"record-actions-more",[Tn]:"",children:["Show ",z.length-Ke.length," more"]}):null]}),z.map(u=>{if(m!==u.id)return null;let T=t.allMutations().find(_=>_.name===u.mutation);return T?(0,S.jsxs)("div",{ref:k,onKeyDown:_=>{if(_.key!=="Escape"||_.defaultPrevented)return;_.preventDefault(),x(null);let de=u.id;requestAnimationFrame(()=>v(de))},style:{display:"grid",gap:10,padding:18,border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,S.jsx)("h3",{style:ne,children:u.label}),T.description?(0,S.jsx)("p",{style:{...C,margin:0},children:T.description}):null,(0,S.jsx)(Ie,{store:t,mutation:T,prefilled:u.args,open:u.open,label:u.label,autoFocus:!0,onDone:()=>{x(null),N(u.mutation);let _=u.id;requestAnimationFrame(()=>v(_))},...a?{principal:a}:{}})]},u.id):null}),o&&P!==null&&m===null?(0,S.jsx)(En,{choices:[{on:"act",act:P,record:i},{on:"act",act:P}],label:"Notify me when someone else does this",testId:"notify-after-act",style:{...ve,...C,justifySelf:"start"}}):null,(0,S.jsx)(an,{context:e,withheld:s.actions.withheld})]}):null,o?(0,S.jsx)(eo,{id:i,style:re,headingStyle:ne}):null,ae.length>0?(0,S.jsxs)("section",{style:{...re,display:"grid",gap:10},"data-testid":"record-history",children:[(0,S.jsx)("h2",{style:ne,children:"What has happened"}),(0,S.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:ae.map(u=>(0,S.jsxs)("li",{style:C,children:[(0,S.jsx)("span",{style:{color:"var(--graview-ink)"},children:u.intent}),u.lineage?(0,S.jsxs)("span",{"data-graview-lineage":"",children:[" \xB7 ",Rn(u.lineage)]}):null," \u2014 ",yt(u,a,{graph:t.graph,schema:t.schema,...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{}})]},u.id))})]}):null]})}function Zi({context:e,id:t,kind:n}){let{store:a,principal:r}=e,o={name:`allow-tidying-${n}`,args:{id:t}},l=a.allMutations().some(i=>i.name===o.name)&&a.permits(o,r).ok;return(0,S.jsxs)("section",{"data-testid":"record-left-alone",style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:12,padding:"12px 16px",border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,S.jsxs)("p",{style:{margin:0,flex:"1 1 16rem"},children:[(0,S.jsx)("strong",{children:"Left alone."})," Nothing automated changes it; tidying passes it by."]}),l?(0,S.jsx)("button",{type:"button",style:ve,"data-testid":"allow-tidying",onClick:()=>a.apply(o,r?{author:r}:{}),children:"Allow tidying again"}):null]})}function Xi({context:e,id:t,kind:n}){let{store:a,principal:r}=e,o={name:`unarchive-${n}`,args:{id:t}},l=a.allMutations().some(c=>c.name===o.name)&&a.permits(o,r).ok,i=[...a.log.all()].reverse().find(c=>!Et(c)&&c.mergedInto!==void 0&&c.writes.includes(t)),s=i?.mergedInto!==void 0?a.graph.getNode(i.mergedInto):void 0;return(0,S.jsxs)("section",{"data-testid":"record-archived",style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:12,padding:"12px 16px",border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,S.jsxs)("p",{style:{margin:0,flex:"1 1 16rem"},children:[(0,S.jsx)("strong",{children:"Archived."})," Kept with its ties and history, and out of lists, counts and rules.",s?(0,S.jsxs)(S.Fragment,{children:[" ","Merged into ",(0,S.jsx)($,{to:Y(a.schema,s.kind,s.id),style:V,children:pe(a.schema.tryDefinition(s.kind),s)}),"."]}):null]}),l?(0,S.jsx)("button",{type:"button",style:ve,"data-testid":"bring-it-back",onClick:()=>a.apply(o,r?{author:r}:{}),children:"Bring it back"}):null]})}var b=I(U(),1),Ji=$t(()=>(__graviewPreload(import.meta.url,["./chunk.FJC6PMOG.js","./chunk.XPR3QFF4.js","./chunk.YUEOUV7G.js","./chunk.UGFDSE37.js","./chunk.W5UJLKIT.js","./chunk.7UJZP3YK.js","./chunk.R77TACXU.js","./chunk.6JERQFZI.js","./chunk.7XJ3XQZD.js","./chunk.52J42KR5.js","./chunk.T2Q3AAQI.js","./chunk.63SRVTG2.js","./chunk.C4EPMV7O.js","./chunk.G7XKQNOL.js","./chunk.7KZ44FEU.js","./chunk.LSL25VXW.js","./chunk.WWUMSCYC.js","./chunk.J2R55TM7.js","./chunk.KPUX27ZT.js","./chunk.DIS7JS7X.js","./chunk.D2T563AA.js","./chunk.JV7FLVUV.js","./chunk.GL3YVGAP.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.QRCTTDDQ.js","./chunk.3TME4BG3.js","./chunk.I43ONAEL.js","./chunk.73EKJ4JN.js","./chunk.INL4OZI7.js","./chunk.5WU2UTP7.js","./chunk.GZHZLJBF.js","./chunk.YKACMLLU.js","./chunk.OJGHDWI6.js","./chunk.337JMOTL.js","./chunk.CV4QA4ZF.js","./chunk.OYRZ2DEI.js","./chunk.7EA7THSM.js","./chunk.AI2HBKVP.js","./chunk.Q5IAXTF5.js","./chunk.SDO3U72B.js","./chunk.VOHRQXCF.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.EME5HQ3H.js")).then(e=>({default:e.DraftPage}))),es={kind:"human"};function ts({list:e,store:t}){let n=new Set(e.members.map(l=>l.kind)),a=e.total-e.members.length,r=n.size===1?[...n][0]:void 0;if(!r)return(0,b.jsx)("p",{className:"graview-spec-text graview-spec-more",children:`and ${a} more`});let o=Be(t.schema,r).toLowerCase();return(0,b.jsx)("p",{className:"graview-spec-text graview-spec-more",children:(0,b.jsx)($,{to:`/${j(t.schema,r)}`,className:"graview-spec-link graview-spec-see-all","data-testid":"see-all",children:e.total===t.graph.nodesOfKind(r).length?`See all ${ft(e.total)} ${o}`:`${ft(a)} more \xB7 all ${o}`})})}function ns({context:e,children:t}){let n=We(),a=e.store.schema,r=Xe("/").replace(/\/$/,""),o=(0,q.useMemo)(()=>({href:l=>`${r}${Y(a,l.kind,l.id)}`,go:l=>n(Y(a,l.kind,l.id)),more:l=>(0,b.jsx)(ts,{list:l,store:e.store})}),[r,a,n,e.store]);return(0,b.jsx)(Ut.Provider,{value:o,children:(0,b.jsx)(Wr.Provider,{value:(e.titleLevel??(e.framed&&!e.barAbove?1:2))-1,children:t})})}var Go=(0,q.createContext)(void 0);function as({steering:e}){let t=me(),n=We(),a=`${t.pathname}${t.search}`;return(0,q.useLayoutEffect)(()=>e.at(a),[a,e]),(0,q.useLayoutEffect)(()=>{let r=l=>{l!==a&&n(l)};e.go.current=r;let o=e.pending?.current;return o!==void 0&&(e.pending.current=void 0,r(o)),()=>{e.go.current===r&&(e.go.current=void 0)}},[a,n,e]),null}function rs({context:e,to:t}){let{pathname:n}=me(),a=ie(),r=(t??a)?.sayWhere,o=os(e,n);return(0,q.useEffect)(()=>(r?.(o),()=>r?.(null)),[r,o]),null}function os(e,t){let[n="",a,r]=t.split("/").filter(Boolean).map(l=>{try{return decodeURIComponent(l)}catch{return l}});if(r!==void 0)return"#";if(n==="places"&&a!==void 0){if(a===An)return"#overview=1";let l=e.views?.places().find(i=>i.as===a);return l?`#focus=${encodeURIComponent(He(l.kind))}&view=${encodeURIComponent(l.as)}`:"#"}let o=Se(e.store.schema,n);return o?`#focus=${encodeURIComponent(a??He(o))}`:"#"}function is({onNavigate:e,path:t}){let n=me(),a=Gn(),r=We(),o=n.hash&&!n.hash.includes("=")?n.hash:"",l=`${n.pathname}${n.search}${o}`,i=(0,q.useRef)(e);i.current=e;let s=(0,q.useRef)(null);(0,q.useEffect)(()=>{let m=s.current;s.current=l,m!==null&&(l===m&&a!=="PUSH"||i.current?.(l,a==="POP"?"pop":a==="REPLACE"?"replace":"push"))},[n.key]);let c=(0,q.useRef)(t);return(0,q.useEffect)(()=>{t===void 0||t===c.current||(c.current=t,t!==l&&r(t))},[t]),null}function Wo({context:e,registry:t,page:n}){let a=Ue(),r=Se(e.store.schema,a.slug??""),o=n==="list"?na:oa,i=(r?t?.lookup(r,n):void 0)??o;return(0,b.jsx)(i,{context:e})}function ss({context:e,registry:t,children:n}){let a=(0,q.useRef)(null);return _a(a),(0,b.jsx)("div",{ref:a,"data-graview-face":"pages",style:{display:"contents"},children:(0,b.jsx)(ko,{context:e,registry:t,root:a,children:(0,b.jsx)(Po,{context:e,root:a,children:n})})})}function ls(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName==="TEXTAREA"||e.tagName==="SELECT"?!0:e.tagName==="INPUT"&&!["button","submit","reset","checkbox","radio","image","file","color","range"].includes(e.type):!1}function ds(){let{pathname:e}=me(),t=Gn(),n=(0,q.useRef)(null);(0,q.useLayoutEffect)(()=>{if(t!=="POP"){for(let o=n.current?.parentElement;o;o=o.parentElement){let{overflowY:l}=getComputedStyle(o);if((l==="auto"||l==="scroll")&&o.scrollHeight>o.clientHeight){o.scrollTop=0;return}}window.scrollTo(0,0)}},[e]);let a=(0,q.useRef)(e),r=(0,q.useRef)(!1);return(0,q.useEffect)(()=>{if(!r.current&&e===a.current)return;r.current=!0;let o=document.activeElement;if(ls(o))return;let l=n.current?.closest("main")??document.querySelector("main"),s=n.current?.closest("[data-graview-face]")?.querySelector("[data-graview-page-title]")??l?.querySelector("h1, h2")??null??l??null;s&&(s.hasAttribute("tabindex")||s.setAttribute("tabindex","-1"),s.focus({preventScroll:!0}))},[e]),(0,b.jsx)("span",{ref:n,hidden:!0,"data-graview-scroll-reset":""})}function Ko({context:e,children:t}){let n=We(),a=Xe("/").replace(/\/$/,""),r=(0,q.useContext)(Go),o=(0,q.useMemo)(()=>{let l=(s,c)=>{if("record"in s){let m=e.store.graph.getNode(s.record);return m?_t(Y(e.store.schema,m.kind,s.record),{section:c?.section}):void 0}if("place"in s){let m=e.views?.places().find(x=>x.as===s.place);return m?_t(fe(e,m),c):void 0}return e.store.schema.tryDefinition(s.list)?_t(`/${j(e.store.schema,s.list)}`,c):void 0},i=s=>{s!==void 0&&n(s)};return{record:(s,c)=>i(l({record:s},c)),place:(s,c)=>i(l({place:s},c)),list:(s,c)=>i(l({list:s},c)),draft:()=>n("/~draft"),href:(s,c)=>{let m=r===!1?void 0:l(s,c);if(m!==void 0)return r?r(m):`${a}${m}`}}},[e,n,a,r]);return(0,b.jsx)(Va.Provider,{value:o,children:t})}function cs(){let{pathname:e,search:t,hash:n}=me();return(0,q.useEffect)(()=>{let a=decodeURIComponent(n.replace(/^#/,""));if(!(!a||a.includes("=")))return wo(a)},[e,t,n]),null}function ps({context:e,Home:t}){let n=me(),a=e.views,r=n.key==="default"&&!(a&&qa(a));(0,q.useEffect)(()=>{a&&Ua(a)},[a]);let o=r?$a(e.views?.arrangement?.()?.first,e.store.schema,e.views?.places()??[]):void 0,l=o?.to==="place"?fe(e,o.place):o?.to==="kind"?`/${j(e.store.schema,o.kind)}`:void 0;return l?(0,b.jsx)(Kn,{to:l,replace:!0}):(0,b.jsx)(t,{context:e})}function Bo({context:e,registry:t}){let n=t?.lookupSurface("shell"),a=n!==void 0,r=a&&(t?.without().has("bar")??!1),o=a&&!r&&!e.embedded?{...e,barAbove:!0}:e,l=N=>n===void 0?(0,b.jsx)(Xt,{context:e,children:N}):r?(0,b.jsx)(n,{context:e,children:N}):(0,b.jsx)(Xt,{context:e,children:(0,b.jsx)(n,{context:o,children:N})}),i=t?.lookupSurface("home")??Xn,s=t?.lookupSurface("problems")??aa,c=a?{...o,framed:!0}:e,[m,x]=(0,q.useState)(null),g=(0,q.useMemo)(()=>({context:c,registry:t}),[c,t]),p=(0,q.useMemo)(()=>({onFind:x,find:!(t?.without().has("find")??!1),places:!(t?.without().has("places")??!1)}),[t]),P=(0,b.jsx)(qn.Provider,{value:g,children:(0,b.jsx)(Ko,{context:e,children:(0,b.jsx)(ss,{context:e,registry:t,children:l((0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(rr,{face:"pages"}),(0,b.jsxs)(ns,{context:c,children:[(0,b.jsx)(ds,{}),(0,b.jsx)(cs,{}),(0,b.jsxs)(io,{children:[(t?.routes()??[]).map(({path:N,component:W})=>(0,b.jsx)(Ce,{path:N,element:(0,b.jsx)(W,{context:c})},N)),(0,b.jsx)(Ce,{path:"/",element:(0,b.jsx)(ps,{context:c,Home:i})}),(0,b.jsx)(Ce,{path:"/problems",element:(0,b.jsx)(s,{context:c})}),(0,b.jsx)(Ce,{path:"/~draft",element:(0,b.jsx)(q.Suspense,{fallback:null,children:(0,b.jsx)(Ji,{context:c})})}),(0,b.jsx)(Ce,{path:"/search",element:(0,b.jsx)(ta,{context:c})}),(0,b.jsx)(Ce,{path:"/map",element:(0,b.jsx)(Zn,{context:c})}),(0,b.jsx)(Ce,{path:"/places",element:(0,b.jsx)(Yn,{context:c})}),Ne(c).some(N=>N.as===An)?null:(0,b.jsx)(Ce,{path:Oa,element:(0,b.jsx)(Kn,{to:"/",replace:!0})}),(0,b.jsx)(Ce,{path:"/places/:as",element:(0,b.jsx)(Qn,{context:c})}),(0,b.jsx)(Ce,{path:"/:slug",element:(0,b.jsx)(Wo,{context:c,registry:t,page:"list"})}),(0,b.jsx)(Ce,{path:"/:slug/:id",element:(0,b.jsx)(Wo,{context:c,registry:t,page:"record"})})]})]})]}))})})});return e.embedded||!a||r?P:(0,b.jsx)(co.Provider,{value:p,children:(0,b.jsx)(br.Provider,{value:m,children:P})})}var us=()=>typeof document>"u"?null:document.body;function gs({context:e,registry:t,basename:n,initialPath:a,onNavigate:r,path:o,steering:l,firstLook:i,hrefOf:s,typing:c}){let[m,x]=(0,q.useState)(void 0),g=m!==void 0&&m.from===e.principal?{...e,principal:m.seat}:e;(0,q.useState)(()=>g.views?Br(g.views,g.store.schema,Nn(g.brand,g.store.schema)):void 0);let p=ie(),P=c??g.typing;va({reader:g.locale??p?.locale,app:g.brand?.locale??g.app?.brand?.locale,readerTimeZone:g.timeZone??p?.timeZone,appTimeZone:g.brand?.timeZone??g.app?.brand?.timeZone});let N=g.principal??es,W=Wa(g.store,N,g.history),E=(W.past&&W.live===g.store?W.past.store:g.store).seenBy(N),v=E===g.store?g:{...g,store:E};Ga(g.store,g.principal);let A=(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(is,{onNavigate:r,path:o}),l?(0,b.jsx)(as,{steering:l}):null,v.presence||p?(0,b.jsx)(rs,{context:v,to:p}):null,(0,b.jsx)(Bo,{context:v,...t?{registry:t}:{}}),i?(0,b.jsx)(qr,{firstLook:i,root:us,app:Nn(g.brand,g.store.schema)}):null]}),G=v.views?(0,b.jsxs)(Ka,{store:v.store,views:v.views,...v.principal?{principal:v.principal}:{},...v.brand?{brand:v.brand}:{},...v.locale?{locale:v.locale}:{},...v.timeZone?{timeZone:v.timeZone}:{},...v.settings?{settings:v.settings}:{},...v.presence&&!p?{presence:v.presence}:{},...P?{typing:P}:{},...v.people?{people:v.people}:{},...v.seats?{seats:v.seats}:{},onSeat:z=>p?p.takeSeat(z):x({from:e.principal,seat:z}),...v.onKeepLens?{onKeepLens:v.onKeepLens}:{},...v.onExport?{onExport:v.onExport}:{},...v.ai?{ai:v.ai}:{},...v.subscriptions?{subscriptions:v.subscriptions}:{},dismissals:v.dismissals,whileAway:v.whileAway,...v.signIn?{signIn:v.signIn}:{},resolveApp:v.resolveApp??p?.resolveApp,linkedRecords:v.linkedRecords??p?.linkedRecords,...v.app?{app:v.app}:{},...v.menuSections?{menuSections:v.menuSections}:{},children:[A,(0,b.jsx)(Ko,{context:v,children:(0,b.jsx)(So,{context:v})})]}):A,H=(0,b.jsx)(Da.Provider,{value:W,children:G}),ae=v.files?(0,b.jsx)(Fa.Provider,{value:v.files,children:H}):H,J=s===void 0?ae:(0,b.jsx)(Go.Provider,{value:s,children:ae});if(a!==void 0){let z=n===void 0?a:`${n.replace(/\/$/,"")}${a}`;return(0,b.jsx)(oo,{initialEntries:[z],...n===void 0?{}:{basename:n},children:J})}return(0,b.jsx)(so,{...n===void 0?{}:{basename:n},children:J})}export{gi as a,gs as b};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{a as k}from"./chunk.G4JJXA63.js";import{a as Q}from"./chunk.SZCZD2GM.js";import{a as Y}from"./chunk.XLM4ONUB.js";import{a as X}from"./chunk.3TME4BG3.js";import{c as _}from"./chunk.INL4OZI7.js";import{Ad as J,qb as H,rb as q,wd as P,yd as z,zd as G}from"./chunk.VOHRQXCF.js";var O=e=>"failed"in e;function ue(e,n){let r=e.schema.kinds,t=e.policy?.sees;if(!t?.length||q(n))return{kinds:r};let s=H(n).roles??[],o=new Set(t.filter(i=>i.roles==="*"||s.some(a=>i.roles.includes(a))).flatMap(i=>i.kinds));return{kinds:r.filter(i=>o.has(i))}}function L(e,n){if(!n)return e;let r=new Set(n.kinds.filter(o=>e.tryDefinition(o)!==void 0));if(r.size===e.kinds.length)return e;let t=new Map,s=o=>{if(r.has(o)){if(!t.has(o)){let i=e.tryDefinition(o),a=Object.fromEntries(Object.entries(i?.edges??{}).flatMap(([l,d])=>{if(d.to==="*")return[[l,d]];let c=d.to.filter(u=>r.has(u));return c.length>0?[[l,{...d,to:c}]]:[]}));t.set(o,{...i,edges:a})}return t.get(o)}};return{...e,definitions:e.definitions.filter(o=>r.has(o.kind)),kinds:e.kinds.filter(o=>r.has(o)),tryDefinition:s,definition:o=>{let i=s(o);if(!i)throw new Error(`Unknown node kind "${o}"`);return i}}}var fe=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),y=e=>fe(e).replace(/[-_]+/g," ").trim();function I(e){let n=[];for(let t of e.kinds){let s=e.tryDefinition(t);if(!s)continue;let o=s.display?.labels??{},i=Object.entries(s.fields?.shape??{}).filter(([d])=>d!=="id"&&d!=="kind").map(([d,c])=>{let u=X(c);return{name:d,type:u?.type,...u?.options?{options:u.options}:{},words:(o[d]??y(d)).toLowerCase()}}),a=Object.entries(s.edges??{}).map(([d,c])=>({name:d,from:t,to:c.to==="*"?e.kinds.filter(u=>u!==t):c.to,words:y(d)})),l=(s.plural??`${y(t)}s`).toLowerCase();n.push({kind:t,plural:l,noun:(s.noun??y(t)).toLowerCase(),fields:i,roles:s.fieldRoles??{},edges:a})}let r=new Map(n.map(t=>[t.kind,t]));return{schema:e,kinds:n,info:t=>r.get(t)}}var $=(e,n)=>n===void 0?void 0:e.fields.find(r=>r.name===n),A=e=>e?.type==="date"||e?.type==="datetime",N=e=>e?.type==="number"||e?.type==="integer"||e?.type==="duration",re=e=>` ${e.toLowerCase().replace(/[“”"’‘]/g,"'").replace(/[^\p{L}\p{N}' -]+/gu," ").replace(/\s+/g," ").trim()} `,E=(e,n)=>e.includes(` ${n} `),v=e=>e.endsWith("ies")?`${e.slice(0,-3)}y`:e.endsWith("ses")?e.slice(0,-2):e.endsWith("s")?e.slice(0,-1):e;function pe(e,n){let r=[];for(let t of n.kinds){let s=new Set([t.plural,t.noun,`${t.noun}s`,y(t.kind),`${y(t.kind)}s`]),o=-1;for(let i of s){let a=e.indexOf(` ${i} `);a>=0&&(o<0||a<o)&&(o=a)}o>=0&&r.push({info:t,at:o})}return r.sort((t,s)=>t.at-s.at).map(t=>t.info)}function x(e,n,r){let t=n.trim().toLowerCase();if(t.length===0)return;let s=e.fields.filter(o=>!r||r(o));return s.find(o=>o.words===t||y(o.name)===t||o.name.toLowerCase()===t)??s.find(o=>o.words===v(t)||y(o.name)===v(t))??s.find(o=>t.split(" ").some(i=>i.length>2&&(o.words.split(" ").includes(i)||o.words.split(" ").includes(v(i)))))}function oe(e,n,r){let t=n.trim().toLowerCase();if(t.length!==0)return e.edges.find(s=>s.words===t||s.name.toLowerCase()===t)??e.edges.find(s=>s.to.some(o=>{let i=r.info(o);return i!==void 0&&(i.noun===v(t)||i.plural===t||y(o)===v(t))}))??e.edges.find(s=>t.split(" ").some(o=>o.length>2&&s.words.split(" ").includes(o)))}function U(e){return/ (?:grouped |group |split |sorted |organi[sz]ed )?by ([\p{L}\p{N}' -]+?)(?= (?:and|with|for|in|on|only|where|from|this|that|as|sorted|grouped) |\s*$)/u.exec(e)?.[1]?.trim()}var me=/\bwho\b.*\b(covers?|cover|tends?|owns?|handles?|does|works? on|looks? after|is on|is assigned|staffs?|runs?)\b|\bcoverage\b|\bmatrix\b|\bwho covers\b/,ge=/\bcalendar\b|\bmonth\b|\bagenda\b|\bschedule\b|\bdue\b|\bdeadlines?\b|\bdates?\b|\bwhen\b/,ye=/\btimeline\b|\bover time\b|\bgantt\b|\bspans?\b|\bweek\b/,he=/\bboard\b|\bkanban\b|\bcolumns?\b|\bpipeline\b|\bstages?\b|\bstatus\b/,be=/\blaid out\b|\blayout\b|\bseating\b|\bwhere (?:they|it|each) (?:sits?|lies?|stands?)\b|\bfloor\b/,we=/\bplan\b|\bmap\b|\bregions?\b/,ke=/\blist\b|\btable\b|\bgroup(?:ed)? by\b|\bsort(?:ed)? by\b|\bonly\b|\bjust the\b/;function $e(e){let n=[];return/\blist\b|\btable\b/.test(e)&&n.push("blocks"),me.test(e)&&n.push("coverage"),be.test(e)&&n.push("board"),(/\bfloor plan\b/.test(e)||we.test(e))&&n.push("plan"),ye.test(e)&&n.push("timeline"),ge.test(e)&&n.push("calendar"),he.test(e)&&n.push("columns"),ke.test(e)&&!n.includes("blocks")&&n.push("blocks"),n.length===0&&U(e)&&n.push("columns"),n}var se=e=>{let n=r=>r?` and not ${r}`:"";if(/\boverdue\b|\blate\b|\bpast due\b/.test(e))return{cond:(r,t)=>`days(today(), ${r}) < 0${n(t)}`,says:r=>`overdue by ${r.words}`};if(/\btoday\b/.test(e))return{range:"day",cond:r=>`days(today(), ${r}) == 0`,says:r=>`with ${r.words} today`};if(/\bthis week\b|\bnext 7 days\b|\bnext week\b/.test(e))return{range:"week",cond:r=>`days(today(), ${r}) >= 0 and days(today(), ${r}) <= 6`,says:r=>`with ${r.words} in the next week`};if(/\bthis month\b|\bnext 30 days\b|\bnext month\b/.test(e))return{range:"month",cond:r=>`days(today(), ${r}) >= 0 and days(today(), ${r}) <= 30`,says:r=>`with ${r.words} in the next month`};if(/\blast month\b|\bpast month\b/.test(e))return{range:"month",cond:r=>`days(today(), ${r}) >= -30 and days(today(), ${r}) <= 0`,says:r=>`with ${r.words} in the last month`};if(/\bthis year\b/.test(e))return{range:"year",cond:r=>`days(today(), ${r}) >= 0 and days(today(), ${r}) <= 365`,says:r=>`with ${r.words} in the next year`};if(/\bquarter\b/.test(e))return{range:"quarter",cond:r=>`days(today(), ${r}) >= 0 and days(today(), ${r}) <= 91`,says:r=>`with ${r.words} in the next quarter`}},M=e=>{if(/\bagenda\b|\bin order\b/.test(e))return"agenda";if(/\btoday\b|\bday\b/.test(e))return"day";if(/\bweek\b/.test(e))return"week";if(/\bquarter\b/.test(e))return"quarter";if(/\byears\b/.test(e))return"years";if(/\byear\b/.test(e))return"year";if(/\bmonth\b/.test(e))return"month"},Z=/^(user|person|people|member|staff|gardener|volunteer|owner|agent|employee|worker|team|player|customer|client|contact|party|attendee|guest)s?$/,j=class extends Error{},h=e=>{throw new j(e)};function Se(e,n){let r=e.fields.filter(o=>o.type==="enum");if(n){let o=x(e,n);if(o&&o.type==="enum")return o;o&&h(`${e.plural}' ${o.words} is not a choice, so it has no columns`)}let t=$(e,e.roles.status??e.roles.column);if(t?.type==="enum")return t;let s=r.find(o=>/^(status|stage|state|phase)$/.test(o.name));return s||(r[0]?r[0]:h(`${e.plural} have no choice field to put in columns`))}function ee(e,n){let r=e.fields.filter(A),t=l=>{let d=$(e,e.roles[l]);return A(d)?d:void 0},o=r.find(l=>E(n,l.words)||E(n,y(l.name)))??t("start")??r.find(l=>/^(due|date|on|at|start|starts|begins|from|sown|when)/i.test(l.name))??r[0];if(!o)return h(`no date field on ${e.plural}`);let i=t("end")??r.find(l=>l!==o&&/^(end|ends|until|to|finish|finished|harvested|due|closes|through)/i.test(l.name)),a=e.fields.find(l=>l.type==="boolean"&&/^(done|finished|complete|completed|closed)$/.test(l.name));return{start:o,...i&&i!==o?{end:i}:{},...a?{done:a}:{}}}function ie(e){let n=$(e,e.roles.start),r=$(e,e.roles.end),t=$(e,e.roles.column??e.roles.day??e.roles.columns);if(N(n)&&N(r)&&t?.type==="enum")return{start:n,end:r,column:t}}function De(e,n,r,t){let s=[];for(let i of e.kinds)for(let a of i.edges)for(let l of a.to){let d=e.info(l);if(!d||d.kind===i.kind)continue;let c=0;n.includes(i)&&(c+=4),n.includes(d)&&(c+=4),(Z.test(d.kind)||Z.test(d.noun))&&(c+=3),t&&(a.words.includes(t)||d.noun===v(t))&&(c+=5),a.words.split(" ").some(u=>u.length>2&&r.includes(` ${u}`))&&(c+=2),s.push({rows:i,across:d,link:a,score:c})}let o=s.sort((i,a)=>a.score-i.score)[0];return o||h(n[0]?`${n[0].plural} are joined to nothing else, so there is no who-covers-what to draw`:"nothing here is joined to anything else, so there is no who-covers-what to draw")}function ae(e,n,r,t,s){let o=U(t);switch(e){case"columns":{if(o){let i=x(n,o);if(!i||i.type!=="enum"){let a=oe(n,o,r);if(a){let l=r.info(a.to[0]);return{lens:"coverage",kind:n.kind,across:l.kind,link:a.name}}}}return{lens:"columns",kind:n.kind,column:Se(n,o).name}}case"calendar":{let i=ee(n,t),a=M(t);return{lens:"calendar",kind:n.kind,start:i.start.name,...i.end?{end:i.end.name}:{},...i.done?{done:i.done.name}:{},...a?{range:a}:{}}}case"timeline":{let i=ie(n);if(i&&!/\bdates?\b|\bdue\b|\bdeadlines?\b|\bmonths?\b|\byears?\b/.test(t))return{lens:"timeline",kind:n.kind,start:i.start.name,end:i.end.name,column:i.column.name};let a=ee(n,t);return{lens:"calendar",kind:n.kind,start:a.start.name,...a.end?{end:a.end.name}:{},...a.done?{done:a.done.name}:{},range:M(t)??"quarter"}}case"coverage":{let i=De(r,s,t,o);return{lens:"coverage",kind:i.rows.kind,across:i.across.kind,link:i.link.name}}case"board":{let i=$(n,n.roles.x)??n.fields.find(c=>c.name==="x"),a=$(n,n.roles.y)??n.fields.find(c=>c.name==="y");if(!N(i)||!N(a))return h(`${n.plural} have no x and y to be laid out by`);let d=r.kinds.flatMap(c=>c.edges.filter(u=>u.to.includes(n.kind)&&c.kind!==n.kind))[0]??n.edges[0];return d?{lens:"board",kind:n.kind,x:i.name,y:a.name,fill:d.name,...d.from!==n.kind?{fillFrom:"occupant"}:{}}:h(`nothing is joined to ${n.plural} to fill them`)}case"plan":{let i=$(n,n.roles.outline)??n.fields.find(a=>a.name==="outline");return i?{lens:"plan",kind:n.kind,outline:i.name}:h(`${n.plural} have no outline to draw a plan from`)}case"blocks":{let i={lens:"blocks",kind:n.kind,as:/\bcards?\b/.test(t)?"card":"row"},a=/ group(?:ed)? by ([\p{L}\p{N} -]+?)(?= (?:and|only|sorted|with)|\s*$)/u.exec(t)?.[1]??(o&&!/ sort(?:ed)? by /.test(t)?o:void 0);if(a){let c=x(n,a);if(!c||c.type!=="enum")return h(c?`${n.plural}' ${c.words} is not a choice, so they cannot be grouped by it`:`${n.plural} have nothing called ${a} to group by`);i.group=c.name}let l=/ sort(?:ed)? by ([\p{L}\p{N} -]+?)(?= (?:and|only|grouped|with)|\s*$)/u.exec(t)?.[1];if(l){let c=x(n,l);if(!c)return h(`${n.plural} have nothing called ${l} to sort by`);i.sort={by:c.name,.../\b(newest|latest|desc|descending|most)\b/.test(t)?{direction:"desc"}:{}}}let d=V(n,t);return d.length>0&&(i.where=d),i}}}function V(e,n){let r=[],t=se(n);if(t){let s=e.fields.filter(A),o=$(e,e.roles.start),i=s.find(l=>E(n,l.words))??(A(o)?o:void 0)??s[0];(!i||!A(i))&&h(`no date field on ${e.plural}`);let a=e.fields.find(l=>l.type==="boolean"&&/^(done|finished|complete|completed|closed)$/.test(l.name));r.push({expr:t.cond(i.name,/\boverdue\b|\blate\b|\bpast due\b/.test(n)?a?.name:void 0),says:t.says(i)})}if(/\bonly\b|\bjust\b|\bthat are\b|\bwhich are\b/.test(n)){for(let s of e.fields){if(s.type!=="enum")continue;let o=s.options?.find(i=>E(n,i.toLowerCase())||E(n,y(i)));o&&r.push({expr:`${s.name} == '${o.replace(/'/g,"")}'`,says:`that are ${y(o)}`})}if(/\bnot done\b|\bundone\b|\bunfinished\b|\bopen ones\b|\bstill to do\b/.test(n)){let s=e.fields.find(o=>o.type==="boolean"&&/^(done|finished|complete|completed)$/.test(o.name));s&&r.push({expr:`not ${s.name}`,says:`not ${s.words}`})}}return r}var B={columns:"A board",calendar:"A calendar",timeline:"A timeline",coverage:"A grid",board:"A layout",plan:"A plan",blocks:"A list",reach:"A picture"};function Re(e,n){let r=n.info(e.kind),t=s=>s?$(r,s)?.words??y(s):"";switch(e.lens){case"columns":return{title:`${k(r.plural)} by ${t(e.column)}`,detail:`of ${r.plural} by ${t(e.column)}`};case"calendar":{let s=e.range??"month";if(s==="agenda")return{title:`${k(r.plural)} in date order`,detail:`of ${r.plural} in order of ${t(e.start)}`};let o=s==="years"?"year":s;return{title:`${k(r.plural)} by ${o}`,detail:`of ${r.plural} by ${t(e.start)}, a ${o} at a time`}}case"timeline":return{title:`${k(r.plural)} over the ${t(e.column)}`,detail:`of ${r.plural} from ${t(e.start)} to ${t(e.end)}, by ${t(e.column)}`};case"coverage":{let s=n.info(e.across);return{title:`${k(r.plural)} by ${s.noun}`,detail:`of which ${s.noun} covers which ${r.noun}`}}case"board":return{title:`${k(r.plural)} where they stand`,detail:`of ${r.plural} where they stand`};case"plan":return{title:`${k(r.plural)} on a plan`,detail:`of ${r.plural}`};default:{let s=[e.where?.map(o=>o.says).join(" and "),e.group?`by ${t(e.group)}`:void 0,e.sort?`in order of ${t(e.sort.by)}`:void 0].filter(o=>!!o);return{title:[k(r.plural),...s].join(" "),detail:[`of ${r.plural}`,...s].join(" ")}}}}function Ae(e,n){let r={title:n,on:e.kind};switch(e.lens){case"columns":return{name:"columns",...r,bindings:{[e.kind]:{column:e.column}}};case"calendar":return{name:"calendar",...r,bindings:{[e.kind]:{start:e.start,...e.end?{end:e.end}:{},...e.done?{done:e.done}:{}}},...e.range?{options:{range:e.range}}:{}};case"timeline":return{name:"timeline",...r,bindings:{[e.kind]:{start:e.start,end:e.end,column:e.column}}};case"coverage":return{name:"coverage",...r,bindings:{rows:{kind:e.kind},columns:{kind:e.across},link:{edge:e.link}}};case"board":return{name:"board",...r,bindings:{slots:{kind:e.kind},x:{field:e.x,on:"slots"},y:{field:e.y,on:"slots"},fill:{edge:e.fill}},...e.fillFrom?{options:{fillFrom:e.fillFrom}}:{}};case"plan":return{name:"plan",...r,bindings:{regions:{kind:e.kind},outline:{field:e.outline,on:"regions"}}};default:{let t=e.where?.length?` where ${e.where.map(o=>e.where.length>1?`(${o.expr})`:o.expr).join(" and ")}`:"",s={list:`all('${e.kind}')${t}`,as:e.as??"row"};return e.group&&(s.group=e.group),e.sort&&(s.sort=e.sort.direction?{by:e.sort.by,direction:e.sort.direction}:e.sort.by),s.empty="Nothing here yet.",{name:"blocks",...r,options:{blocks:[s]}}}}}function C(e,n){let{app:r}=n,t=o=>o.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,""),s=new Set(["home","overview",...Q(r,n.views?{views:n.views}:{}).map(o=>o.slug),...(r.lenses??[]).flatMap(o=>o.title?[t(o.title)]:[])]);if(!s.has(t(e)))return e;for(let o=2;;o++)if(!s.has(t(`${e} ${o}`)))return`${e} ${o}`}var ne={title:[],headline:[],text:["tone"],figure:["as","currency","label"],list:["sort","limit","group","empty","as"],progress:["label"],group:["direction"],when:["show"],divider:[]};function Ee(e,n){if(!Array.isArray(n)||n.length===0)return"it has no blocks to draw";if(n.length>40)return"it has more blocks than a place draws";let r=(i,a)=>{if(typeof i!="string"||i.trim()==="")return`its ${a} says nothing`;try{return _(i)}catch(l){return`its ${a} does not read: ${l instanceof Error?l.message.replace(/ \(at character.*$/,""):String(l)}`}},t=i=>{if(i.t==="where")return t(i.set);if(i.t==="call"&&i.fn==="all"){let a=i.args[0];return a?.t==="lit"&&typeof a.value=="string"?e.info(a.value)??null:void 0}},s=(i,a)=>{switch(i.t){case"lit":return;case"ident":return a&&!a.fields.some(l=>l.name===i.name)&&!a.edges.some(l=>l.name===i.name)?`${a.plural} have nothing called ${i.name}`:void 0;case"member":return s(i.object,a);case"list":return i.items.map(l=>s(l,a)).find(Boolean);case"unary":return s(i.operand,a);case"binary":return s(i.left,a)??s(i.right,a);case"where":{let l=t(i.set);return l===null?"Nothing by that name here":s(i.set,a)??s(i.filter,l??void 0)}case"call":return i.fn==="all"?t(i)===null?"Nothing by that name here":void 0:i.args.map(l=>s(l,a)).find(Boolean)}},o=(i,a)=>{if(a>4)return"its blocks nest deeper than a place draws";for(let l of i){if(!w(l))return"a block is not an object";let d=Object.keys(ne).find(p=>p in l);if(!d)return`"${Object.keys(l)[0]??""}" is not a block a place draws`;let c=Object.keys(l).find(p=>p!==d&&p!=="key"&&!ne[d].includes(p));if(c)return`a ${d} block takes no "${c}"`;let u=l[d];if(d==="list"||d==="figure"||d==="when"){if(d==="figure"&&u===!0)continue;let p=r(u,d);if(typeof p=="string")return p;let g=s(p,void 0);if(g)return g;if(d==="list"){let f=t(p);if(f==null)return f===null?"Nothing by that name here":"its list does not say which records it lists, like all('task')";for(let m of["group","sort"]){let b=l[m],S=typeof b=="string"?b:w(b)&&typeof b.by=="string"?b.by:void 0;if(b===void 0)continue;let D=S?f.fields.find(ce=>ce.name===S):void 0;if(!D)return`${f.plural} have nothing called ${String(S??b)} to ${m} by`;if(m==="group"&&D.type!=="enum")return`${f.plural}' ${D.words} is not a choice, so they cannot be grouped by it`}}if(d==="when"){let f=l.show;if(!Array.isArray(f))return"a when block shows a list of blocks";let m=o(f,a+1);if(m)return m}}else if(d==="group"){if(!Array.isArray(u))return"a group block holds a list of blocks";let p=o(u,a+1);if(p)return p}else{if(d!=="divider"&&typeof u!="string")return`a ${d} block says words`;if(typeof u=="string")for(let p of u.matchAll(/\{([^{}]*)\}/g)){let g=p[1].split(/\|(?![|])/)[0],f=r(g,`${d}'s braces`);if(typeof f=="string")return f;let m=s(f,void 0);if(m)return m}}}};return o(n,1)}function T(e,n,r){let t=L(e.schema,r),s=f=>({ok:!1,failed:`Couldn't draw that: ${f.replace(/\.$/,"")}.`});if(!G(n.name)||n.name==="reach")return s(`"${String(n.name)}" is not a picture the seat can draw; it draws ${z.filter(f=>f!=="reach").join(", ")}`);if(typeof n.title!="string"||n.title.trim().length===0||n.title.length>80)return s("it needs a title of a few words");if(typeof n.on!="string"||!t.tryDefinition(n.on))return s("Nothing by that name here");let o=P[n.name],i=n.bindings??{};if(o.binds==="fields")for(let[f,m]of Object.entries(i)){if(!t.tryDefinition(f))return s("Nothing by that name here");let b=Object.keys(t.tryDefinition(f).fields?.shape??{});for(let[S,D]of Object.entries(m??{}))if(typeof D!="string"||!b.includes(D))return s(`${y(f)} has no field "${String(D)}" for its ${S}`);for(let S of o.requiredRoles)if(!(S in(m??{})))return s(`a ${n.name} needs ${y(f)}'s ${S}`)}else if(o.binds==="entities")for(let f of o.requiredRoles){let m=i[f];if(!m)return s(`a ${n.name} needs its ${f}`);if(typeof m.kind=="string"&&!t.tryDefinition(m.kind))return s("Nothing by that name here")}let a={...e,schema:t,lenses:[...e.lenses??[],n]},l=a.lenses.length-1,d=J(a),c=`lenses.${l}`,u=d.findings.find(f=>f.path===c||f.path.startsWith(`${c}.`));if(u)return s(u.message.replace(/^"[^"]*" /,"it "));let p=d.undrawn.find(f=>f.index===l);if(p)return s(p.why);let g=d.drawn.find(f=>f.index===l);if(!g)return s("its bindings name something the app does not have");if(g.as==="overview")return s(`"${n.title}" is the scene's own address; give it another title`);if(n.name==="blocks"){let f=Ee(I(t),n.options?.blocks);if(f)return s(f)}return{ok:!0,drawn:g}}function K(e){return{op:"add-lens",title:e.title,lens:e.name,on:e.on,...e.bindings?{bindings:e.bindings}:{},...e.options?{options:e.options}:{}}}function ve(e){return{op:"remove-lens",title:e.title,on:e.on}}var w=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function de(e){let n=w(e)?e:{},r=String(n.lens??n.name??""),t=n.bindings,s=typeof n.on=="string"?n.on:w(t)&&P[r]?.binds==="fields"?Object.keys(t)[0]??"":"";return{name:r,title:typeof n.title=="string"?n.title.trim():"",on:s,...w(t)?{bindings:t}:{},...w(n.options)?{options:n.options}:{}}}function xe(e){let n=s=>w(e.bindings?.[s])?e.bindings[s]:{},r=s=>typeof s=="string"?s:void 0,t=n(e.on);switch(e.name){case"columns":return r(t.column)?{lens:"columns",kind:e.on,column:t.column}:void 0;case"calendar":{let s=r(e.options?.range);return r(t.start)?{lens:"calendar",kind:e.on,start:t.start,...r(t.end)?{end:t.end}:{},...r(t.done)?{done:t.done}:{},...s?{range:s}:{}}:void 0}case"timeline":return r(t.start)&&r(t.end)&&r(t.column)?{lens:"timeline",kind:e.on,start:t.start,end:t.end,column:t.column}:void 0;case"coverage":{let s=w(e.bindings?.columns)?r(e.bindings.columns.kind):void 0,o=w(e.bindings?.link)?r(e.bindings.link.edge):void 0;return s&&o?{lens:"coverage",kind:e.on,across:s,link:o}:void 0}case"blocks":{let s=e.options?.blocks;if(!Array.isArray(s)||s.length!==1||!w(s[0]))return;let o=s[0],i=new RegExp(`^all\\('${e.on}'\\)(?: where (.+))?$`).exec(String(o.list??""));if(!i)return;let a=o.sort;return{lens:"blocks",kind:e.on,as:o.as==="card"?"card":"row",...typeof o.group=="string"?{group:o.group}:{},...typeof a=="string"?{sort:{by:a}}:w(a)&&typeof a.by=="string"?{sort:{by:a.by,...a.direction==="desc"?{direction:"desc"}:{}}}:{},...i[1]?{where:[{expr:i[1],says:"as asked"}]}:{}}}default:return}}function W(e,n,r,t,s){let o=I(L(e.schema,t)).info(n.on),i=xe(n);return{title:n.title,said:`${B[n.name]??"A picture"} of ${o?.plural??y(n.on)}.`,kind:n.on,lens:n,drawn:r,edit:K(n),by:s,asks:[],...i?{recipe:i}:{}}}function te(e){return{title:e.title,said:e.said,lens:{title:e.lens.title,lens:e.lens.name,on:e.lens.on,...e.lens.bindings?{bindings:e.lens.bindings}:{},...e.lens.options?{options:e.lens.options}:{}},edit:e.edit,by:e.by,check:"It draws, and graview check would take it."}}function F(e,n,r,t,s){let o=Re(e,n),i=e.title??s??C(o.title,r),a=Ae(e,i),l=T(r.app,a,r.sight);return l.ok?{title:i,said:`${B[e.lens]} ${o.detail}.`,kind:e.kind,lens:a,drawn:l.drawn,edit:K(a),by:"template",asks:t,recipe:e}:{failed:l.failed,...r.lastGood?{lastGood:r.lastGood}:{}}}function Ye(e,n){let r=I(L(n.app.schema,n.sight)),t=r.info(e.kind);if(!t)return{failed:"Couldn't draw that: Nothing by that name here."};let s=e.lens==="blocks"&&!e.group&&!e.sort&&!e.where?.length&&e.title===void 0;return F(s?{...e,title:C(`Every ${t.noun}`,n)}:e,r,n,[])}function Le(e,n,r,t){if(r.length>0)return r;let s=i=>{switch(e){case"columns":return i.fields.some(a=>a.type==="enum");case"calendar":return i.fields.some(A);case"timeline":return ie(i)!==void 0||i.fields.some(A);case"coverage":return i.edges.some(a=>a.to.some(l=>l!==i.kind));case"board":return i.fields.some(a=>a.name==="x")&&i.fields.some(a=>a.name==="y");case"plan":return i.fields.some(a=>a.name==="outline")||i.roles.outline!==void 0;default:return!0}};return[...n.kinds.filter(s)].sort((i,a)=>Number(a.fields.some(l=>E(t,l.words)))-Number(i.fields.some(l=>E(t,l.words))))}function Ie(e,n){let r=I(L(n.app.schema,n.sight)),t=re(e),s=$e(t);if(s.length===0)return;let o=pe(t,r),i;for(let a of s){let l=a==="coverage"?[o[0]??r.kinds[0]].filter(d=>!!d):Le(a,r,o,t);for(let d of l)try{let c=ae(a,d,r,t,o),u=F(c,r,n,[e]);if(!O(u))return u;i??=u.failed}catch(c){if(!(c instanceof j))throw c;i??=`Couldn't draw that: ${c.message}.`}l.length===0&&o.length===0&&(i??=`Couldn't draw that: nothing here has what ${B[a].toLowerCase()} needs.`)}return{failed:i??"Couldn't draw that: Nothing by that name here.",...n.lastGood?{lastGood:n.lastGood}:{}}}async function Oe(e,n){let r=n.lastGood?{lastGood:n.lastGood}:{};if(e.trim().length===0)return{failed:"Say what you would like to see, like \u201Ca board of tasks by status\u201D.",...r};let t=Ie(e,n);if(t&&!O(t))return t;if(!n.complete)return t??{failed:"Couldn't draw that: drawing freely needs AI, which isn't on here. Ask for a board, a calendar, a timeline, a list or who covers what.",...r};let s=await le(e,n,void 0);return O(s)&&t?t:s}async function je(e,n,r){let t={lastGood:e},s={...r,lastGood:e},o=I(L(r.app.schema,r.sight)),i=re(n),a=o.info(e.kind),l=[...e.asks,n];if(!a)return{failed:"Couldn't change that: Nothing by that name here.",...t};let d=e.recipe,c=/^ (?:call|name|title) (?:it|this)? ?(.+?) $/.exec(i)??/ (?:call|name) it (.+?) $/.exec(i);try{if(c){let g=n.replace(/^.*?\b(?:call|name|title)\b\s*(?:it|this)?\s*/i,"").replace(/^["“']|["”']$/g,"").trim();if(g.length===0)return{failed:"Couldn't change that: say what to call it.",...t};let f={...e.lens,title:C(g,r)},m=T(r.app,f,r.sight);return m.ok?{...e,title:f.title,lens:f,drawn:m.drawn,edit:K(f),asks:l,...d?{recipe:{...d,title:f.title}}:{}}:{failed:m.failed,...t}}let p=/ as (?:a |an )?(board|kanban|calendar|timeline|list|table|cards|rows|grid|plan|layout)\b/.exec(i);if(p){let g=p[1]==="board"||p[1]==="kanban"?"columns":p[1]==="calendar"?"calendar":p[1]==="timeline"?"timeline":p[1]==="grid"?"coverage":p[1]==="plan"?"plan":p[1]==="layout"?"board":"blocks",f=ae(g,a,o,i,[a]),m=p[1]==="cards"?"card":p[1]==="rows"?"row":void 0,b=g==="blocks"&&d?.lens==="blocks"?{...d,...m?{as:m}:{}}:g==="blocks"&&d?.lens==="columns"?{...f,group:d.column,...m?{as:m}:{}}:f;return F(R(b),o,s,l)}if(d){let g=Te(d,a,o,i);if(g)return F(g,o,s,l)}}catch(p){if(!(p instanceof j))throw p;return{failed:`Couldn't change that: ${p.message}.`,...t}}if(!r.complete)return{failed:"Couldn't change that: changing it freely needs AI, which isn't on here. Try \u201Cgroup by status\u201D, \u201Conly this month\u201D or \u201Cas a calendar\u201D.",...t};let u=await le(n,s,e);return O(u)?u:{...u,asks:l}}var R=e=>{let{title:n,...r}=e;return r};function Te(e,n,r,t){let s=/ (?:group(?:ed)?|split|organi[sz]ed?|put them|columns) by ([\p{L}\p{N} -]+?)(?= (?:and|only|with)|\s*$)/u.exec(t)?.[1]??(/^ by /.test(t)?U(t):void 0);if(s){let d=x(n,s);if(d?.type==="enum")return e.lens==="blocks"?{...R(e),group:d.name}:{lens:"columns",kind:e.kind,column:d.name};let c=oe(n,s,r);return c?{lens:"coverage",kind:e.kind,across:c.to[0],link:c.name}:h(d?`${n.plural}' ${d.words} is not a choice, so they cannot be grouped by it`:`${n.plural} have nothing called ${s} to group by`)}let o=/ (?:sort(?:ed)?|order(?:ed)?) by ([\p{L}\p{N} -]+?)(?= (?:and|only|with)|\s*$)/u.exec(t)?.[1];if(o){let d=x(n,o);return d?{...e.lens==="blocks"?R(e):{lens:"blocks",kind:e.kind,as:"row",...e.lens==="columns"?{group:e.column}:{}},sort:{by:d.name,.../\b(newest|latest|desc|descending|most)\b/.test(t)?{direction:"desc"}:{}}}:h(`${n.plural} have nothing called ${o} to sort by`)}if(/\b(?:all of them|everything|show all|clear the filter|no filter|without the filter)\b/.test(t)){if(e.lens!=="blocks"||!e.where)return h("it already shows all of them");let{where:d,...c}=R(e);return c}let i=se(t);if(i&&e.lens==="calendar"&&i.range)return{...R(e),range:i.range};if(i&&e.lens==="calendar"&&!i.range)return{lens:"blocks",kind:e.kind,as:"row",sort:{by:e.start},where:V(n,t)};let a=V(n,t);if(a.length>0){let d=e.lens==="blocks"?R(e):{lens:"blocks",kind:e.kind,as:"row",...e.lens==="columns"?{group:e.column}:{}};return{...d,where:[...d.where??[],...a]}}let l=e.lens==="calendar"?M(t):void 0;if(l)return{...R(e),range:l}}function Ne(e){return e.kinds.map(n=>{let r=n.fields.map(o=>`${o.name} (${o.type??"value"}${o.options?`: ${o.options.join(" | ")}`:""})`).join(", "),t=n.edges.map(o=>`${o.name} \u2192 ${o.to.join(" | ")}`).join(", "),s=Object.entries(n.roles).map(([o,i])=>`${o}=${i}`).join(", ");return`- ${n.kind} ("${n.plural}"): ${r}${t?`; relations: ${t}`:""}${s?`; roles: ${s}`:""}`}).join(`
|
|
2
|
-
`)}var Fe=['columns \u2014 a board, records in columns by one choice field: {"lens": "columns", "on": K, "bindings": {K: {"column": "<enum field>"}}}','calendar \u2014 records on a calendar by a date: {"lens": "calendar", "on": K, "bindings": {K: {"start": "<date field>", "end"?: "<date field>", "done"?: "<boolean field>"}}, "options": {"range"?: "day" | "week" | "month" | "quarter" | "year" | "agenda"}}','timeline \u2014 minutes of a day in columns: {"lens": "timeline", "on": K, "bindings": {K: {"start": "<number field>", "end": "<number field>", "column": "<enum field>"}}}','coverage \u2014 who covers what, a grid of two kinds joined by a relation: {"lens": "coverage", "on": K, "bindings": {"rows": {"kind": K}, "columns": {"kind": J}, "link": {"edge": "<relation of K to J>"}}}',`blocks \u2014 anything else, as blocks: {"lens": "blocks", "on": K, "options": {"blocks": [{"headline": "words"}, {"list": "all('K') where <condition>", "group"?: "<enum field>", "sort"?: "<field>" | {"by": "<field>", "direction": "desc"}, "as"?: "row" | "card", "empty"?: "words"}, {"figure": "count(all('K'))", "label": "words"}]}}. Conditions read a record's own fields: status == 'open', not done, days(today(), due) <= 7.`].join(`
|
|
3
|
-
`);function Ce(e,n,r){return["You draw a view of an app's data as JSON \u2014 never code. The app's kinds, their fields (with types) and relations:",Ne(n),"","The lenses you may use (prefer the first four; use blocks only when none of them fits):",Fe,"",r?`The view on screen now:
|
|
4
|
-
${JSON.stringify(r.lens)}
|
|
5
|
-
Change it as asked, and keep everything not asked about.`:"",`Asked: ${JSON.stringify(e)}`,'Answer with ONE JSON object: {"title": "<a few words, like Deliverables by status>", "lens": \u2026, "on": \u2026, "bindings"?: \u2026, "options"?: \u2026}. Name only the kinds, fields and relations listed above. If it cannot be drawn from them, answer {"failed": "<one sentence saying why>"}.'].filter(t=>t!=="").join(`
|
|
6
|
-
`)}async function le(e,n,r){let t=n.lastGood?{lastGood:n.lastGood}:{},s=I(L(n.app.schema,n.sight)),o;try{o=(await n.complete({prompt:Ce(e,s,r)})).text}catch{return{failed:"Couldn't draw that: the model did not answer.",...t}}let i=Y(o);if(typeof i!="object"||i===null||Array.isArray(i))return{failed:"Couldn't draw that: the model's answer was not a view.",...t};let a=i;if(typeof a.failed=="string")return{failed:`Couldn't draw that: ${a.failed.replace(/^Couldn't draw that:\s*/i,"").replace(/\.$/,"")}.`,...t};let l=de(a);if(!G(l.name))return{failed:`Couldn't draw that: "${l.name}" is not a picture the seat can draw.`,...t};let d=l.title?l.title.slice(0,80):r?.title??k(e.trim()).slice(0,80),c={...l,title:r&&r.title===d?d:C(d,n)},u=T(n.app,c,n.sight);return u.ok?{...W(n.app,c,u.drawn,n.sight,"model"),asks:[e]}:{failed:u.failed,...t}}function Qe(e,n,r){let t=[...e.lenses??[]];for(let s of n){let o={name:s.lens,title:s.title,on:s.on,...s.bindings?{bindings:s.bindings}:{},...s.options?{options:s.options}:{}};if(t.some(a=>a.title===o.title))continue;T({...e,lenses:t},o,r).ok&&(t=[...t,o])}return t.length===(e.lenses??[]).length?e:{...e,lenses:t}}async function Ze(e,n,r){let{app:t,drafts:s}=r,o=ue(t,r.principal),i=c=>{let u=de(c);return{lens:u,verdict:T(t,u,o)}};if(e==="keep_lens"){let{lens:c,verdict:u}=i(n);if(!u.ok)return{ok:!1,error:u.failed,reason:"invalid"};if(!s?.keep)return{ok:!1,error:"This app's declaration cannot be written from here."};let p=K(c),g=await s.keep(p);return g.ok?{ok:!0,data:{kept:p,said:g.said??`Adds \u201C${p.title}\u201D to the places.`,undo:ve(p)}}:{ok:!1,error:g.error}}if(n.lens!==void 0){let{lens:c,verdict:u}=i(n.lens);return u.ok?{ok:!0,data:te(W(t,c,u.drawn,o,"model"))}:{ok:!1,error:u.failed,reason:"invalid"}}let a={app:t,sight:o,...s?.complete?{complete:s.complete}:{},...s?.views?{views:s.views}:{}},l=String(n.ask??""),d;if(n.current!==void 0){let{lens:c,verdict:u}=i(n.current);if(!u.ok)return{ok:!1,error:u.failed,reason:"invalid"};d=await je(W(t,c,u.drawn,o,"model"),l,a)}else d=await Oe(l,a);return O(d)?{ok:!1,error:d.failed,reason:"invalid"}:{ok:!0,data:te(d)}}export{O as a,ue as b,T as c,K as d,ve as e,de as f,xe as g,W as h,te as i,Ye as j,Ie as k,Oe as l,je as m,Qe as n,Ze as o};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk.CV4QA4ZF.js";import"./chunk.OYRZ2DEI.js";import{b as m}from"./chunk.7EA7THSM.js";import"./chunk.AI2HBKVP.js";import{T as p}from"./chunk.Q5IAXTF5.js";import"./chunk.SDO3U72B.js";import{U as l}from"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import{b as f}from"./chunk.AJZBJBMO.js";var a=f(p(),1);function N({states:e,definition:v}){let s=e.values.reduce((t,n)=>t+n.count,0),u=t=>t===null?"with none":m(v,e.field,t).toLowerCase(),c=e.values.filter(t=>t.count>0).map(t=>`${l(t.count)} ${u(t.value)}`).join(", ");return s===0?null:(0,a.jsx)("div",{className:"graview-district-states",role:"img","aria-label":c,title:c,children:e.values.map((t,n)=>{if(t.count===0)return null;let y=e.values.filter(r=>r.count>0).length,w=t.count/s*(168-(y-1)),o=l(t.count),i=`${o} ${u(t.value)}`,d=r=>r.length*6.2+8<=w;return(0,a.jsx)("span",{"data-graview-tier":t.tier,style:{flexGrow:t.count},title:i,children:d(i)?i:d(o)?o:""},n)})})}export{N as StatesBar};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as Z,b as qe}from"./chunk.KHRS2SKB.js";import"./chunk.NB6WN4DO.js";import"./chunk.MBNZ2HK7.js";import"./chunk.NHIPVAGR.js";import{i as De,j as Ne,k as Oe}from"./chunk.JOWJNIWH.js";import"./chunk.T2Q3AAQI.js";import"./chunk.G7XKQNOL.js";import"./chunk.7KZ44FEU.js";import"./chunk.HJCQ6I3S.js";import"./chunk.JQBP6QWQ.js";import"./chunk.I2W7HSBU.js";import"./chunk.BJL6EL6B.js";import"./chunk.Y37DXEHG.js";import{a as We,b as S}from"./chunk.DXZ5VYCQ.js";import{a as X,b as $e}from"./chunk.J2R55TM7.js";import"./chunk.DIS7JS7X.js";import"./chunk.JV7FLVUV.js";import"./chunk.VGTEEANA.js";import"./chunk.SZCZD2GM.js";import"./chunk.7FZY5E2U.js";import{b as Pe,c as Le}from"./chunk.7354O67H.js";import"./chunk.XLM4ONUB.js";import"./chunk.XOZU4OFA.js";import"./chunk.C7EEYSAM.js";import"./chunk.ZJXUWOG3.js";import"./chunk.TI4OSTQV.js";import"./chunk.FEBCIEI3.js";import"./chunk.QRCTTDDQ.js";import"./chunk.3TME4BG3.js";import"./chunk.I43ONAEL.js";import"./chunk.73EKJ4JN.js";import"./chunk.INL4OZI7.js";import"./chunk.5WU2UTP7.js";import{u as Re}from"./chunk.YKACMLLU.js";import"./chunk.OJGHDWI6.js";import"./chunk.337JMOTL.js";import"./chunk.CV4QA4ZF.js";import{l as ze}from"./chunk.OYRZ2DEI.js";import{c as Ce}from"./chunk.7EA7THSM.js";import{m as Ie}from"./chunk.AI2HBKVP.js";import{G as ot,La as J,Qa as He,T as Me,Ua as Ee,aa as O,h as Ae,u as Te}from"./chunk.Q5IAXTF5.js";import"./chunk.SDO3U72B.js";import{Cb as be,Oc as Se,la as Q,ma as N,oc as xe,qc as ke}from"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import{b as Y}from"./chunk.AJZBJBMO.js";var a=Y(ot(),1);var t=Y(Me(),1);function bt(u,r,o){let c=r.on??r.about[r.about.length-1];De(u,r.about,{...o,pins:Z(),...c===void 0?{}:{focus:c}})}function xt({placement:u="float",chosen:r=!0}={}){let{menuAt:o}=O();return u==="menu"&&o===null?r?(0,t.jsx)(at,{}):null:(0,t.jsx)(lt,{placement:u})}function at(){let{store:u,setMenuAt:r,view:o}=O(),{selection:c}=J(),h=(0,a.useRef)(null),[E,y]=(0,a.useState)(null);(0,a.useLayoutEffect)(()=>{let b=h.current?.offsetParent??h.current?.parentElement;if(!b)return;let m=Math.round(b.getBoundingClientRect().width);m!==E&&y(m)});let v=c.length===1&&!o.overview?u.graph.getNode(c[0]):void 0;return!v||E===null||E>=Be?(0,t.jsx)("span",{ref:h,hidden:!0}):(0,t.jsx)("button",{type:"button",ref:h,"data-testid":"chosen-acts","aria-label":`What can be done with ${S(u,v.id)}`,"aria-haspopup":"menu",onClick:b=>{let m=b.currentTarget.getBoundingClientRect();r({x:Math.round(m.right),y:Math.round(m.bottom+4),on:v.id})},style:{position:"absolute",right:"calc(14px + var(--graview-dock, 0px))",top:98,zIndex:"var(--graview-layer-overview, 10)",minHeight:30,padding:"0 12px",borderRadius:8,fontSize:"0.8125rem",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)"},children:"Acts\u2026"})}var Be=564;function lt({placement:u}){let{store:r,menuAt:o,setMenuAt:c,view:h,signIn:E}=O(),y=(0,a.useRef)(null),v=(0,a.useRef)(null),b=(0,a.useRef)(null),m=(0,a.useRef)(null);o?.returnTo&&(m.current=o.returnTo);let Ke=e=>{let i=e.closest("[data-graview-asking]")?.getAttribute("data-graview-asking"),n=e.getAttribute("data-pin-for"),d=i??e.getAttribute("data-affordance")??(n===null?null:`pin:${n}`)??e.getAttribute("data-menu-item");v.current=d===null?null:{key:d,element:e}};(0,a.useEffect)(()=>{let e=y.current,i=v.current;if(i===null||document.activeElement!==document.body||i.element.isConnected)return;let n=i.key;if(!e){v.current=null;let k=m.current;m.current=null,(k?.isConnected?k:b.current)?.focus();return}((n.startsWith("pin:")?e.querySelector(`[data-pin-for="${CSS.escape(n.slice(4))}"]`):null)??e.querySelector(`[data-affordance="${CSS.escape(n)}"]:not([disabled])`)??e).focus()});let[_e,je]=(0,a.useState)(null);(0,a.useLayoutEffect)(()=>{let e=y.current?.offsetParent??y.current?.parentElement;if(e instanceof HTMLElement&&(b.current=e),!e)return;let i=e.getBoundingClientRect();je(n=>n&&n.left===i.left&&n.top===i.top&&n.width===i.width&&n.height===i.height?n:{left:i.left,top:i.top,width:i.width,height:i.height})});let{selection:Ue,set:Ve,clear:Ge}=J(),s=o?.about??Ue,[q,Ye]=(0,a.useState)(()=>Z()),F=o?.on??s[s.length-1],B=o?.about,Qe=(0,a.useMemo)(()=>({pins:q,...F===void 0?{}:{focus:F},...B?{about:B}:{}}),[q,F,B]),Je=(0,a.useMemo)(()=>new Set(r.allMutations().filter(e=>e.pinned).map(e=>e.name)),[r]),{affordances:g,withheld:ee,observations:te}=Ne(Qe),I=ke(ee,E),f=I?st:ee,Xe=o===null?null:{face:o.face??"scene",on:o.on,about:s,field:o.field,place:o.place,href:o.href,act:o.act,element:o.returnTo},ne=Re(Xe),ie=te.some(e=>e.id.startsWith("schema:waits:")),{apply:Ze,preview:et}=Oe(),[C,z]=(0,a.useState)(null),[tt,re]=(0,a.useState)(!1),[oe,ae]=(0,a.useState)(!1),[L,R]=(0,a.useState)(""),nt=$e({letters:!0}),[le,K]=(0,a.useState)(null),_=(0,a.useRef)([]),j=(e,i)=>{try{return et(e,i),Ze(e,i),K(null),c(null),_.current=[],!0}catch(n){return K(ze(r.schema,r.allMutations(),n)),_.current=n instanceof be?n.issues.map(d=>String(d.path[0]??"")).filter(Boolean):[],!1}},$=[...new Set(s.flatMap(e=>{let i=r.graph.getNode(e);return i?[i.kind]:[]}))],x=$.length>0?$:[...new Set(s.flatMap(e=>Te(e)))],p=s.length===1?Ae(s[0]):null,U=p?{from:r.graph.getNode(p.from),to:r.graph.getNode(p.to)}:null,se=p?Le(r,p):void 0,de=se?.provisional?se:void 0,ue=p?(()=>{let e=r.schema.tryDefinition(r.graph.getNode(p.from)?.kind??"")?.edges?.[p.kind],i=r.graph.getNode(p.to);return e?.inverse&&i?`From ${S(r,i.id)}: ${e.inverse}`:null})():null;(0,a.useEffect)(()=>{z(null),re(!1),ae(!1),K(null),R("")},[s,o?.about]);let l=o!==null,it=u==="menu"&&!l,A=(0,a.useRef)(o);A.current=o;let pe=Ee("acts",{open:l&&u==="menu",onOpenChange:e=>{e||c(null)},at:()=>A.current?{x:A.current.x,y:A.current.y}:null,returnTo:()=>{let e=A.current?.returnTo;if(e?.isConnected)return e;let i=A.current?.on;return i?document.querySelector(`[data-graview-view="${CSS.escape(i)}"]`):null},align:"start"}),ce=(_e?.width??Number.POSITIVE_INFINITY)<Be;if((0,a.useLayoutEffect)(()=>{let e=y.current?.offsetParent;if(!e||!ce||l)return;let i=y.current?.getBoundingClientRect().height??0,n=`${Math.round(i)+20}px`;if(e.style.paddingBottom===n)return;let d=e.style.paddingBottom;return e.style.paddingBottom=n,()=>{e.style.paddingBottom=d}}),s.length===0&&!l)return null;let ge=o?.title!==void 0||s.length>0&&!(s.length===1&&s[0]===h.focusId),he=Math.max(1,Math.min(9,g.length)),T=[...g.filter(e=>e.provider==="invariant"&&!e.destructive),...g.filter(e=>e.pinned&&e.provider!=="invariant"&&!e.destructive),...g.filter(e=>!e.ties&&!e.destructive&&!e.pinned&&e.provider!=="invariant"),...g.filter(e=>e.ties&&!e.destructive&&!e.pinned&&e.provider!=="invariant"),...g.filter(e=>e.destructive)],me=T.length>he&&!l,fe=L.trim().toLowerCase(),w=me&&fe.length>0?T.filter(e=>`${e.label} ${e.why}`.toLowerCase().includes(fe)):null,V=w??(tt||l?T:T.slice(0,he)),ye=w?0:T.length-V.length,W=[];for(let e of V){let i=!l&&e.provider==="invariant",n=!l&&!i&&e.pinned!==void 0&&!e.destructive,d=!l&&!i&&!n&&e.ties===!0&&!e.destructive,k=i?e.why:n?"pinned":d?"its ties":null,D=i?"violation":n||d?"ties":null,H=W[W.length-1];H&&H.heading===k?H.items.push(e):W.push({heading:k,tone:D,items:[e]})}let G=g.find(e=>e.id===C),P=s.length===1?S(r,s[0]):null,ve=e=>{if(!P)return e;let i=e.startsWith(`"${P}"`)?e.slice(P.length+2):e.startsWith(P)?e.slice(P.length):null;if(i===null)return e;let n=i.trimStart();return n.length===0?e:n[0].toUpperCase()+n.slice(1)},rt=new Set(l?[]:V.filter(e=>e.provider==="invariant").map(e=>e.why)),M=te.filter(e=>!rt.has(e.text)).map(e=>({...e,text:ve(e.text)}));return it?null:(0,t.jsxs)("section",{...l?pe.pane:{},ref:e=>{y.current=e,l&&pe.pane.ref(e)},"aria-label":"Inspector","data-graview-offstage":"","data-testid":l?"context-menu":"inspector-strip",tabIndex:-1,onFocus:e=>Ke(e.target),onBlur:e=>{e.relatedTarget!==null&&(v.current=null)},onMouseDown:e=>e.stopPropagation(),style:{...l?He:{position:"absolute",zIndex:Se("rail")},boxSizing:"border-box",display:"flex",flexDirection:"column",gap:7,padding:"9px 12px",borderRadius:"var(--graview-radius, 12px)",border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",...l?{width:300,maxHeight:"min(52cqh, 420px)",overflow:"auto"}:ce?{left:10,right:10,width:"auto",bottom:10,maxHeight:"min(42cqh, 300px)",overflow:"auto"}:{left:14,top:h.overview?"min(296px, 38cqh)":44,width:236,maxHeight:h.overview?"calc(100cqh - min(296px, 38cqh) - 20px)":"calc(68cqh - 94px)",overflow:"auto"}},children:[(0,t.jsx)("h2",{style:{...Ie,margin:0},children:"Inspector"}),(0,t.jsxs)("div",{style:{display:ge||!l?"flex":"none",alignItems:"baseline",flexWrap:"wrap",gap:"2px 8px",minWidth:0,paddingRight:l?0:24},children:[ge?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("strong",{style:{fontSize:"0.9375rem",whiteSpace:"nowrap"},children:o?.title??(s.length===1?S(r,s[0]):`${s.length} selected`)}),$.length>0||p?(0,t.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",whiteSpace:"nowrap"},children:p?"relation":$.map(e=>N(r.schema.tryDefinition(e),e)).join(" \xB7 ")}):null,s.length===1&&!p&&o?.face!=="pages"?(0,t.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",whiteSpace:"nowrap"},children:h.expanded.includes(s[0])?"\xB7 double-click closes":"\xB7 double-click opens"}):null]}):null,(0,t.jsx)("span",{style:{flex:"1 1 auto"}})]}),l?null:(0,t.jsx)("button",{type:"button",onClick:()=>{c(null),Ge()},"aria-label":"Clear selection",title:"Clear selection",style:{position:"absolute",top:6,right:6,flex:"0 0 auto",width:24,height:24,display:"grid",placeItems:"center",padding:0,fontSize:"0.875rem",lineHeight:1,borderRadius:7},children:"\xD7"}),p&&U?(0,t.jsxs)("div",{style:{display:"grid",gap:6},children:[ue?(0,t.jsx)("p",{"data-testid":"edge-said",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:ue}):null,de?(0,t.jsx)("p",{"data-testid":"edge-provisional",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:Pe(de)}):null,(0,t.jsx)("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[["from",U.from],["to",U.to]].map(([e,i],n)=>(0,t.jsxs)(a.Fragment,{children:[n===1?(0,t.jsx)("span",{"aria-hidden":"true",style:{color:"var(--graview-ink-faint)"},children:"\u2192"}):null,i?(0,t.jsx)("button",{type:"button","data-testid":`edge-${e}`,onClick:()=>Ve([i.id]),title:`Select ${S(r,i.id)}`,style:{fontSize:"0.8125rem",padding:"3px 9px",borderRadius:6},children:S(r,i.id)}):(0,t.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink-faint)"},children:"gone"})]},e))})]}):null,!p&&s.length===1&&xe(r,s[0])?(0,t.jsx)("p",{"data-testid":"left-alone",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:"Left alone: nothing automated changes it."}):null,M.length>0?(0,t.jsx)("div",{"data-testid":"observations",title:M.map(e=>e.text).join(`
|
|
2
|
-
`),style:{display:"grid",gap:3},children:M.slice(0,2).map(e=>(0,t.jsxs)("p",{style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:[e.text,e===M[1]&&M.length>2?(0,t.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" +",M.length-2]}):null]},e.id))}):null,l?ne.start.map(e=>(0,t.jsx)(Fe,{section:e,close:()=>c(null)},e.id)):null,le?(0,t.jsx)("p",{"data-testid":"refused",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-warn)"},children:le}):null,me?(0,t.jsx)("input",{"data-testid":"action-filter",value:L,onChange:e=>R(e.target.value),placeholder:`Filter ${T.length} actions\u2026`,"aria-label":"Filter actions",onKeyDown:e=>{if(e.key==="Escape"){e.stopPropagation(),L.length>0?R(""):e.currentTarget.blur();return}if(e.key==="Enter"&&w?.length===1){let i=w[0];if(i.destructive)return;i.open.length>0?z(i.id):j(i)&&R("")}},style:{font:"inherit",fontSize:"0.875rem",padding:"5px 9px",borderRadius:8,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)"}}):null,w!==null&&w.length===0?(0,t.jsxs)("p",{"data-testid":"no-matches",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:["Nothing offered here matches \u201C",L.trim(),"\u201D."]}):null,I&&g.length===0||g.length===0&&!ie&&s.length===0?null:g.length===0&&!ie?(0,t.jsx)("p",{"data-testid":"no-affordances",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:f.length>0?`Nothing you may do with ${p?"this relation":x.length===1?Q(N(r.schema.tryDefinition(x[0]),x[0])):"this mix of kinds"} \u2014 ${f.length} action${f.length===1?"":"s"} withheld.`:p?`Nothing can be done with this line yet \u2014 nothing this app declares makes or breaks \u201C${Ce(r.schema,r.graph.getNode(p.from)?.kind??"",p.kind,"out")}\u201D.`:`Nothing can be done with ${x.length===1?Q(N(r.schema.tryDefinition(x[0]),x[0])):"this mix of kinds"} yet \u2014 nothing this app declares acts on ${x.length===1?"it":"them"}.`}):(0,t.jsxs)("ol",{...nt,"data-testid":"affordances",style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",flexWrap:"nowrap",gap:2},children:[W.map((e,i)=>(0,t.jsxs)(a.Fragment,{children:[e.heading?(0,t.jsxs)("li",{"data-graview-heading":e.tone,style:{fontSize:"0.75rem",lineHeight:1.4,color:e.tone==="violation"?"var(--graview-warn)":"var(--graview-ink-faint)",...e.tone!=="violation"?{letterSpacing:"0.12em",textTransform:"uppercase",fontSize:"0.75rem"}:{},padding:"2px 2px 1px",marginTop:i>0?6:0},children:[e.tone==="violation"?"\u26A0 ":"",e.tone==="violation"?ve(e.heading):e.heading]}):i>0?(0,t.jsx)("li",{"aria-hidden":"true",style:{borderTop:"1px solid var(--graview-edge)",margin:"6px 0 3px"}}):null,e.items.map(n=>(0,t.jsxs)("li",{style:{display:"flex",gap:2,alignItems:"stretch"},onKeyDown:d=>{if(d.metaKey||d.ctrlKey||d.altKey)return;let k=d.currentTarget.querySelector("[data-affordance]"),D=d.currentTarget.querySelector("[data-pin-for]"),H=d.target===D,we=d.key==="ArrowRight"&&!H?D:H&&["ArrowLeft","ArrowUp","ArrowDown"].includes(d.key)?k:null;we&&(d.preventDefault(),d.stopPropagation(),we.focus())},children:[(0,t.jsxs)("button",{type:"button",[X]:"","data-affordance":n.id,"data-rank":n.rank,"data-graview-destructive":n.destructive||void 0,"aria-pressed":C===n.id,title:n.why,style:{padding:"5px 10px",fontSize:"0.875rem",borderRadius:8,width:"100%",textAlign:"left",borderWidth:1,borderStyle:"solid",borderColor:C===n.id?"var(--graview-accent)":l?"transparent":"var(--graview-edge)",background:l?"none":"var(--graview-panel)",boxShadow:"none",...n.destructive?{color:"var(--graview-warn)"}:{},...C===n.id?{color:"var(--graview-accent)"}:{}},onClick:()=>{if(n.open.length>0){z(C===n.id?null:n.id);return}j(n)},children:[n.label,n.open.length>0?(0,t.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:" \u2026"}):null,w?.length===1&&w[0]?.id===n.id&&!n.destructive?(0,t.jsx)("span",{"aria-hidden":"true",title:"Enter runs it",style:{float:"right",color:"var(--graview-ink-faint)",fontSize:"0.75rem"},children:"\u21B5"}):null]}),(0,t.jsx)("button",{type:"button","data-testid":"pin-toggle",tabIndex:-1,"data-pin-for":n.mutation,"aria-pressed":n.pinned!==void 0,"aria-label":n.pinned!==void 0?`Unpin ${n.label}`:`Pin ${n.label}`,title:n.pinned==="declared"?"Pinned by the app \u2014 unpin it for yourself":n.pinned==="user"?"Unpin":"Pin to the top",onClick:()=>Ye(qe(q,n.mutation,Je.has(n.mutation))),style:{flex:"0 0 auto",width:24,minHeight:24,display:"grid",placeItems:"center",padding:0,fontSize:"0.75rem",border:"1px solid transparent",background:"none",boxShadow:"none",borderRadius:7,color:n.pinned==="user"?"var(--graview-accent)":n.pinned==="declared"?"var(--graview-ink-muted)":"var(--graview-ink-faint)"},children:n.pinned!==void 0?"\u2605":"\u2606"})]},n.id))]},`${e.heading??"plain"}-${i}`)),ye>0?(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button",[X]:"",onClick:()=>re(!0),title:`Show all ${g.length} actions`,style:{padding:"4px 10px",fontSize:"0.875rem",borderRadius:8},children:["Show ",ye," more"]})}):null]}),I?(0,t.jsx)("button",{type:"button","data-testid":"sign-in",onClick:()=>{c(null),I.run()},style:{padding:"5px 10px",fontSize:"0.875rem",borderRadius:8,width:"100%",textAlign:"left"},children:I.label}):null,f.length>0?(0,t.jsxs)("ul",{"data-testid":"withheld",style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",flexWrap:"nowrap",gap:2},children:[f.slice(0,l||oe?f.length:3).map(e=>(0,t.jsxs)("li",{style:{display:"grid",gap:2},children:[(0,t.jsx)("button",{type:"button",disabled:!0,"data-affordance":e.id,"data-rank":e.rank,"data-withheld":e.refusal.wouldNeed.join(",")||"nobody",style:{padding:"4px 10px",fontSize:"0.875rem",borderRadius:8,borderStyle:"dashed",width:"100%",textAlign:"left",background:"none"},children:(0,t.jsx)("s",{children:e.label})}),(0,t.jsx)("span",{"data-testid":"withheld-why",style:{fontSize:"0.8125rem",lineHeight:1.4,color:"var(--graview-ink-muted)",padding:"0 10px"},children:e.refusal.message})]},e.id)),!l&&!oe&&f.length>3?(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button","data-testid":"withheld-more",onClick:()=>ae(!0),title:`Show all ${f.length} actions this seat may not take`,style:{padding:"4px 10px",fontSize:"0.875rem",borderRadius:8},children:["Show ",f.length-3," more withheld"]})}):null]}):null,l?ne.end.map(e=>(0,t.jsx)(Fe,{section:e,close:()=>c(null)},e.id)):null,G?(0,t.jsx)(We,{affordance:G,onApply:e=>{if(j(G,e))z(null);else return _.current},onCancel:()=>z(null)}):null]})}var st=[];function Fe({section:u,close:r}){return(0,t.jsxs)("div",{"data-menu-section":u.id,...u.heading?{role:"group","aria-label":u.heading}:{},style:{display:"grid",gap:2,borderTop:"1px solid var(--graview-edge)",paddingTop:5},children:[u.heading?(0,t.jsx)("p",{"aria-hidden":"true",style:{margin:0,padding:"2px 2px 1px",fontSize:"0.75rem",lineHeight:1.4,letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:u.heading}):null,u.items&&u.items.length>0?(0,t.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",gap:2},children:u.items.map(o=>(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button","data-menu-item":o.id,onClick:()=>{r(),o.run()},style:{padding:"5px 10px",fontSize:"0.875rem",borderRadius:8,width:"100%",textAlign:"left",borderWidth:1,borderStyle:"solid",borderColor:"transparent",background:"none",boxShadow:"none"},children:[o.label,o.hint?(0,t.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",o.hint]}):null]})},o.id))}):null,u.render?.(r)]})}export{xt as InspectorPane,bt as prepareActs};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j,k}from"./chunk.BJL6EL6B.js";import"./chunk.SZCZD2GM.js";import"./chunk.C7EEYSAM.js";import"./chunk.QRCTTDDQ.js";import"./chunk.3TME4BG3.js";import"./chunk.I43ONAEL.js";import"./chunk.73EKJ4JN.js";import"./chunk.INL4OZI7.js";import"./chunk.5WU2UTP7.js";import"./chunk.OYRZ2DEI.js";import"./chunk.7EA7THSM.js";import"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import"./chunk.AJZBJBMO.js";export{g as columnActs,d as columnChoices,c as columnMoves,b as columnOf,e as columnReach,f as columnSteps,j as describePlace,k as placeText,h as resolveFor,i as shadowedPageSlots,a as statusColumns};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{d as C,e as re}from"./chunk.G7XKQNOL.js";import{e as ee}from"./chunk.7KZ44FEU.js";import{b as S}from"./chunk.7EA7THSM.js";import{m as X}from"./chunk.AI2HBKVP.js";import{Fa as V,G as se,Qa as J,T as Z,Ua as Q}from"./chunk.Q5IAXTF5.js";import{a as K}from"./chunk.SDO3U72B.js";import{O as Y,U as M,da as U}from"./chunk.VOHRQXCF.js";import{b as D}from"./chunk.AJZBJBMO.js";var h=D(se(),1);var n=D(Z(),1),Oe=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=V(K(()=>(__graviewPreload(import.meta.url,["./chunk.63SRVTG2.js","./chunk.C4EPMV7O.js","./chunk.G7XKQNOL.js","./chunk.7KZ44FEU.js","./chunk.CV4QA4ZF.js","./chunk.OYRZ2DEI.js","./chunk.7EA7THSM.js","./chunk.AI2HBKVP.js","./chunk.Q5IAXTF5.js","./chunk.SDO3U72B.js","./chunk.VOHRQXCF.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.DVLWSCIC.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)),R=`${g}|${a}`,p={current:q.get(R)??{words:new Set,latest:null,at:0}};q.set(R,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(R,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??[],O=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)?O(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})?O(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:()=>O(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,e.end]})]})}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=Q("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:J,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{Oe 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
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{b as v}from"./chunk.GL3YVGAP.js";import"./chunk.AI2HBKVP.js";import{G as S,S as y,T as b}from"./chunk.Q5IAXTF5.js";import"./chunk.SDO3U72B.js";import"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import{b as u}from"./chunk.AJZBJBMO.js";var r=u(S(),1);var t=u(b(),1);function E(o){let a=(0,r.useContext)(y),l=(0,t.jsx)(C,{...o});return!a||o.nodeId===void 0?l:(0,t.jsx)(P,{nodeId:o.nodeId,field:o.field,label:o.label,...o.markdown?{markdown:!0}:{},live:a,onDone:d=>o.onDone?o.onDone(d):o.onCancel(),writtenWhole:l})}var P=(0,r.lazy)(()=>(__graviewPreload(import.meta.url,["./chunk.GL3YVGAP.js","./chunk.AI2HBKVP.js","./chunk.Q5IAXTF5.js","./chunk.SDO3U72B.js","./chunk.VOHRQXCF.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.Q3XKNZQW.js")));function C({field:o,label:a,value:l,markdown:d,onSave:s,onCancel:c}){let[i,h]=(0,r.useState)(l),[n,w]=(0,r.useState)(!1),f=(0,r.useRef)(null);return(0,r.useEffect)(()=>f.current?.focus(),[n]),(0,r.useLayoutEffect)(()=>{let e=f.current;if(!e||n||typeof CSS<"u"&&CSS.supports?.("field-sizing","content"))return;let p=()=>{e.style.height="auto";let m=getComputedStyle(e);e.style.height=`${e.scrollHeight+parseFloat(m.borderTopWidth)+parseFloat(m.borderBottomWidth)}px`};p();let x=requestAnimationFrame(p);return()=>cancelAnimationFrame(x)},[i,n]),(0,t.jsxs)("form",{style:{display:"grid",gap:8,minWidth:0},onSubmit:e=>{e.preventDefault(),s(i,!1)},children:[n?(0,t.jsx)("div",{"data-graview-preview":o,"aria-label":`${a}, as it will read`,role:"region",style:k,children:(0,t.jsx)(v,{text:i,markdown:!0})}):(0,t.jsx)("textarea",{ref:f,"aria-label":a,"data-graview-field":o,value:i,rows:3,onChange:e=>h(e.target.value),onKeyDown:e=>{e.key==="Escape"?(e.preventDefault(),c()):e.key==="Enter"&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),s(i,!1))},onBlur:e=>{e.relatedTarget instanceof Node&&e.currentTarget.form?.contains(e.relatedTarget)||s(i,!0)},style:T}),(0,t.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:8},children:[(0,t.jsx)("button",{type:"submit",style:g,children:"Save"}),(0,t.jsx)("button",{type:"button",onClick:c,style:g,children:"Cancel"}),d?(0,t.jsx)("button",{type:"button","aria-pressed":n,onClick:()=>w(!n),style:g,children:n?"Write":"Preview"}):null,(0,t.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:"Ctrl or \u2318 Enter saves \xB7 Esc puts it back"})]})]})}var k={minHeight:"7.5em",padding:"8px 10px",border:"1px dashed var(--graview-edge-bright)",borderRadius:6,lineHeight:1.6,minWidth:0},g={font:"inherit",fontSize:"0.8125rem",minHeight:28,padding:"2px 12px"},T={font:"inherit",lineHeight:1.5,width:"100%",boxSizing:"border-box",minHeight:"7.5em",padding:"8px 10px",resize:"vertical",fieldSizing:"content",color:"var(--graview-ink)",background:"var(--graview-panel, transparent)",border:"1px solid var(--graview-edge-bright)",borderRadius:6};export{E as default};
|