graview 0.1.59 → 0.1.60
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/README.md +4 -2
- package/dist/preview/chunk.2K4TT2BV.js +1 -0
- package/dist/preview/{chunk.J4HTSXUA.js → chunk.2USDHXB4.js} +1 -1
- package/dist/preview/{chunk.LHJWII6C.js → chunk.37TVS7CA.js} +1 -1
- package/dist/preview/chunk.3IZ3ABII.js +1 -0
- package/dist/preview/{chunk.E22DDEQI.js → chunk.3MOJF7BA.js} +1 -1
- package/dist/preview/{chunk.2XTCDFWU.js → chunk.3UOKUF5Z.js} +1 -1
- package/dist/preview/{chunk.MOAUE3N2.js → chunk.3V4WP7RY.js} +3 -3
- package/dist/preview/{chunk.IZ2ZTNEV.js → chunk.3XGA65Y3.js} +1 -1
- package/dist/preview/{chunk.TCPTVTFU.js → chunk.3ZT5WQYL.js} +1 -1
- package/dist/preview/{chunk.DWHPZBPZ.js → chunk.4LR64TPU.js} +1 -1
- package/dist/preview/{chunk.VNJKGSGZ.js → chunk.4MP72LPR.js} +1 -1
- package/dist/preview/{chunk.IPPZEGBX.js → chunk.4TCKEG6I.js} +1 -1
- package/dist/preview/{chunk.EZ3CRUBU.js → chunk.5DD62IOW.js} +2 -2
- package/dist/preview/{chunk.DGM3Y2FB.js → chunk.5YOLUDVO.js} +1 -1
- package/dist/preview/{chunk.VFRURRNI.js → chunk.67U6M7OV.js} +1 -1
- package/dist/preview/{chunk.2NJDT47T.js → chunk.6C2MHWSX.js} +1 -1
- package/dist/preview/{chunk.CYUMQPMH.js → chunk.6HF6POIX.js} +1 -1
- package/dist/preview/{chunk.KOGUYWHG.js → chunk.6WHAWOO7.js} +1 -1
- package/dist/preview/{chunk.N4LOI3YA.js → chunk.6ZQAR5ZA.js} +1 -1
- package/dist/preview/{chunk.2QESVWUW.js → chunk.7MHCGVGM.js} +1 -1
- package/dist/preview/{chunk.VNBEAF62.js → chunk.7N32AVIJ.js} +1 -1
- package/dist/preview/{chunk.CIB65YO6.js → chunk.7OPM55I2.js} +1 -1
- package/dist/preview/chunk.7TFLRR7D.js +1 -0
- package/dist/preview/{chunk.Q6LLURRM.js → chunk.7VKSXGTX.js} +1 -1
- package/dist/preview/{chunk.CLR6KAA3.js → chunk.A3ZXDG6V.js} +1 -1
- package/dist/preview/{chunk.2FOIJ5ID.js → chunk.A5PDXNY6.js} +1 -1
- package/dist/preview/{chunk.6O3YPUW3.js → chunk.AVBTPSQF.js} +1 -1
- package/dist/preview/{chunk.ZT3NEAFI.js → chunk.BF6S5UE4.js} +1 -1
- package/dist/preview/chunk.BLPYNNR4.js +1 -0
- package/dist/preview/{chunk.BDBLGGFJ.js → chunk.BQIHNT7C.js} +1 -1
- package/dist/preview/{chunk.B5HLA45D.js → chunk.BRT27WON.js} +1 -1
- package/dist/preview/{chunk.DO45KXLM.js → chunk.BXDM3UMN.js} +1 -1
- package/dist/preview/chunk.BYKD5RLA.js +1 -0
- package/dist/preview/chunk.C7OLSEWK.js +1 -0
- package/dist/preview/{chunk.WGTBQHHE.js → chunk.CC5BJH5A.js} +1 -1
- package/dist/preview/{chunk.HF5SNUTK.js → chunk.CFKZXLXS.js} +1 -1
- package/dist/preview/chunk.CMN6BBAD.js +1 -0
- package/dist/preview/{chunk.Z4CJJ4QP.js → chunk.CQT3W2SF.js} +1 -1
- package/dist/preview/{chunk.NOLGJFA4.js → chunk.D7YSL3NK.js} +2 -2
- package/dist/preview/{chunk.G2TCFWYX.js → chunk.DCHQHKSA.js} +1 -1
- package/dist/preview/{chunk.UFTAGUTU.js → chunk.EL5ICOOM.js} +1 -1
- package/dist/preview/{chunk.OVSZXILB.js → chunk.ENL2JJ47.js} +1 -1
- package/dist/preview/chunk.EQXB7LKI.js +1 -0
- package/dist/preview/{chunk.KE6ZRUMP.js → chunk.ERFT54HT.js} +1 -1
- package/dist/preview/{chunk.P6CHNBRR.js → chunk.F6V7RWDK.js} +1 -1
- package/dist/preview/{chunk.GDUM2UOM.js → chunk.FBJARKDT.js} +1 -1
- package/dist/preview/{chunk.QL555VQ2.js → chunk.FC6AF6CC.js} +1 -1
- package/dist/preview/{chunk.HVUUJQRE.js → chunk.FFTYMBBT.js} +1 -1
- package/dist/preview/chunk.FLUK3UXF.js +1 -0
- package/dist/preview/{chunk.UM5H2VVR.js → chunk.FRYBMS3W.js} +1 -1
- package/dist/preview/chunk.G3R4BTI7.js +1 -0
- package/dist/preview/{chunk.GQHFLOTZ.js → chunk.G4YJPKRG.js} +2 -2
- package/dist/preview/{chunk.MHILFBK6.js → chunk.GLWSVSQL.js} +1 -1
- package/dist/preview/{chunk.WTUB7W2D.js → chunk.GNBIVVL3.js} +1 -1
- package/dist/preview/{chunk.SU6WKQ73.js → chunk.GTKJJYQH.js} +1 -1
- package/dist/preview/{chunk.VS25R6R2.js → chunk.H45Q3O4F.js} +1 -1
- package/dist/preview/{chunk.6N7LNTB6.js → chunk.HDP3PS7N.js} +1 -1
- package/dist/preview/{chunk.QLTHHWBA.js → chunk.HDUO2USQ.js} +1 -1
- package/dist/preview/{chunk.2MFXP3FB.js → chunk.HUJ6YTWE.js} +1 -1
- package/dist/preview/{chunk.2FP4KEEG.js → chunk.I4XQBQRC.js} +1 -1
- package/dist/preview/chunk.IBOKXVWN.js +1 -0
- package/dist/preview/{chunk.4T5QIZKB.js → chunk.IGJZ4UH3.js} +2 -2
- package/dist/preview/{chunk.4QWTSI7V.js → chunk.IGVASEZU.js} +1 -1
- package/dist/preview/{chunk.CZH27V2R.js → chunk.IHBUBZQT.js} +1 -1
- package/dist/preview/chunk.IOK4GVJC.js +1 -0
- package/dist/preview/{chunk.ZUKYMU6C.js → chunk.JEYQBH33.js} +1 -1
- package/dist/preview/{chunk.S6VON4LU.js → chunk.JJGCTGWA.js} +1 -1
- package/dist/preview/{chunk.LKE2FBXL.js → chunk.JPONLMU7.js} +1 -1
- package/dist/preview/{chunk.Q3Y5EV5A.js → chunk.KBVTLNS5.js} +3 -3
- package/dist/preview/{chunk.YMRVKG6W.js → chunk.KDRLUBVF.js} +1 -1
- package/dist/preview/{chunk.YGZCESXY.js → chunk.KGW75Z5L.js} +1 -1
- package/dist/preview/{chunk.R4YDAJRL.js → chunk.KI37ZEV3.js} +1 -1
- package/dist/preview/chunk.L6AWE76F.js +1 -0
- package/dist/preview/{chunk.NIFQDN6R.js → chunk.LGEA5257.js} +1 -1
- package/dist/preview/{chunk.KKQXGN5U.js → chunk.LLYRFVIN.js} +1 -1
- package/dist/preview/{chunk.WEGPDJTB.js → chunk.LQVAABPS.js} +1 -1
- package/dist/preview/{chunk.4OMOP77U.js → chunk.LSY256J4.js} +1 -1
- package/dist/preview/{chunk.OLW44AP5.js → chunk.LZIBQ3VX.js} +1 -1
- package/dist/preview/{chunk.W2VOD6SD.js → chunk.M4UD4ARP.js} +1 -1
- package/dist/preview/chunk.MDJWK5W2.js +1 -0
- package/dist/preview/{chunk.QT6UV7HN.js → chunk.MJVYWLQQ.js} +1 -1
- package/dist/preview/{chunk.NSGQXCH6.js → chunk.MSWWWLEA.js} +1 -1
- package/dist/preview/{chunk.XOTES3PI.js → chunk.MVWC3VR3.js} +2 -2
- package/dist/preview/{chunk.V6EEDYYW.js → chunk.NC7FXY2H.js} +1 -1
- package/dist/preview/{chunk.MRYN42EQ.js → chunk.NGTRL5U4.js} +1 -1
- package/dist/preview/{chunk.ZLMI2NHC.js → chunk.NHUQ2N6J.js} +1 -1
- package/dist/preview/{chunk.LDYOQCY7.js → chunk.OLFJH4RK.js} +1 -1
- package/dist/preview/{chunk.3UTRR5YM.js → chunk.P6RORYOT.js} +1 -1
- package/dist/preview/{chunk.T227XQIO.js → chunk.PFSYXD6Q.js} +1 -1
- package/dist/preview/chunk.PHJ6WPWH.js +1 -0
- package/dist/preview/{chunk.HKINU7VO.js → chunk.PI44XMY2.js} +1 -1
- package/dist/preview/{chunk.P3CUCDHO.js → chunk.PNW5K7BW.js} +1 -1
- package/dist/preview/{chunk.6VNKGTLF.js → chunk.QBLKTFF4.js} +1 -1
- package/dist/preview/{chunk.ATVPAYS6.js → chunk.QDSEVPF3.js} +1 -1
- package/dist/preview/chunk.QFUMFQJU.js +1 -0
- package/dist/preview/{chunk.JPNBQFJ3.js → chunk.QHDCTAD7.js} +1 -1
- package/dist/preview/{chunk.P52UTBNO.js → chunk.QI4SLPQ4.js} +2 -2
- package/dist/preview/{chunk.ATSKKTUO.js → chunk.RQOX5YDW.js} +1 -1
- package/dist/preview/{chunk.VDGMFX5C.js → chunk.RXYNW5QB.js} +1 -1
- package/dist/preview/{chunk.ROHSF4WM.js → chunk.SB2PZKN5.js} +1 -1
- package/dist/preview/{chunk.3XIIJHQ6.js → chunk.SRVQJZRT.js} +1 -1
- package/dist/preview/{chunk.BPC4XQFZ.js → chunk.T7LQD67N.js} +2 -2
- package/dist/preview/{chunk.D3AISGQH.js → chunk.TAT2IQUR.js} +1 -1
- package/dist/preview/{chunk.E2REVMAG.js → chunk.TFWIG6LL.js} +1 -1
- package/dist/preview/{chunk.U5PX2ECA.js → chunk.TKVLNBRD.js} +1 -1
- package/dist/preview/{chunk.KSVJHSRH.js → chunk.TLJOZSDD.js} +1 -1
- package/dist/preview/{chunk.VGHZQEHS.js → chunk.TLWT67ON.js} +1 -1
- package/dist/preview/{chunk.AXXYJCSW.js → chunk.TY4GQJKC.js} +1 -1
- package/dist/preview/{chunk.SZG6HJWH.js → chunk.UITT6JWW.js} +1 -1
- package/dist/preview/{chunk.UHUBQ4EX.js → chunk.UJTE7UAP.js} +1 -1
- package/dist/preview/{chunk.GR2B7SKI.js → chunk.ULL6ZIJJ.js} +1 -1
- package/dist/preview/{chunk.HJOVOA52.js → chunk.UQWTZJBV.js} +1 -1
- package/dist/preview/{chunk.7JOG6XFC.js → chunk.URWAFZHF.js} +1 -1
- package/dist/preview/{chunk.BFN6B4C4.js → chunk.VADQ7ZGA.js} +1 -1
- package/dist/preview/chunk.VDMDPZ6U.js +1 -0
- package/dist/preview/{chunk.ZFH4SCCF.js → chunk.VFOON3Z3.js} +1 -1
- package/dist/preview/{chunk.QXMQUIQZ.js → chunk.VMV464JK.js} +1 -1
- package/dist/preview/{chunk.CUJX3IVA.js → chunk.VNDKKTED.js} +1 -1
- package/dist/preview/chunk.VSCIXAHN.js +5 -0
- package/dist/preview/{chunk.IIESMHXY.js → chunk.VUBNBTJP.js} +2 -2
- package/dist/preview/{chunk.MZJ3KTEU.js → chunk.VWJGQDCE.js} +1 -1
- package/dist/preview/{chunk.UITZ74YJ.js → chunk.VZJWJ5XM.js} +1 -1
- package/dist/preview/{chunk.RKZ4J3H2.js → chunk.W3W54DSX.js} +1 -1
- package/dist/preview/{chunk.6IUEGPCZ.js → chunk.WC3DENU4.js} +2 -2
- package/dist/preview/chunk.WQ6RCEUQ.js +1 -0
- package/dist/preview/{chunk.QC4YXFF7.js → chunk.WXUFATY5.js} +1 -1
- package/dist/preview/{chunk.QHU3KUZZ.js → chunk.X6A4VSSD.js} +1 -1
- package/dist/preview/{chunk.U7G56KXT.js → chunk.XGASJAV2.js} +1 -1
- package/dist/preview/{chunk.M3JIIF32.js → chunk.XR6YR6RV.js} +1 -1
- package/dist/preview/chunk.XZPKBHJT.js +1 -0
- package/dist/preview/{chunk.S7ZLGODY.js → chunk.Y5C4RXG7.js} +1 -1
- package/dist/preview/{chunk.L3K25NCS.js → chunk.Y7G3OGDE.js} +1 -1
- package/dist/preview/{chunk.E4SYOBGB.js → chunk.YEBGI6ED.js} +1 -1
- package/dist/preview/{chunk.G7HIAUEA.js → chunk.YFSBVZTG.js} +1 -1
- package/dist/preview/chunk.YFVJUHAK.js +1 -0
- package/dist/preview/{chunk.7XSDXX5Z.js → chunk.YH63KQ2G.js} +1 -1
- package/dist/preview/{chunk.F6P3WSMW.js → chunk.YZ7FUKAL.js} +1 -1
- package/dist/preview/{chunk.7AMBLGVB.js → chunk.Z2ERZ4S6.js} +1 -1
- package/dist/preview/{chunk.X2G4ZRB2.js → chunk.ZP5RT2EK.js} +1 -1
- package/dist/preview/{chunk.PS5SEND3.js → chunk.ZXOT3IXJ.js} +1 -1
- package/dist/preview/{chunk.EGJUFZD5.js → chunk.ZYM2SSGW.js} +1 -1
- package/dist/preview/index.html +50 -50
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.3XLOFZRM.js +0 -1
- package/dist/preview/chunk.6BLNFVB4.js +0 -1
- package/dist/preview/chunk.6E36I2GC.js +0 -1
- package/dist/preview/chunk.CJUIJ6TL.js +0 -1
- package/dist/preview/chunk.FJTVY6AE.js +0 -1
- package/dist/preview/chunk.KHZA5F7A.js +0 -1
- package/dist/preview/chunk.LDLTQNJ2.js +0 -1
- package/dist/preview/chunk.MMWLLWFS.js +0 -1
- package/dist/preview/chunk.PCVPH5KM.js +0 -1
- package/dist/preview/chunk.QDZAITMN.js +0 -1
- package/dist/preview/chunk.U37WZMUO.js +0 -1
- package/dist/preview/chunk.U5JFW2YM.js +0 -1
- package/dist/preview/chunk.V5MOMBZG.js +0 -1
- package/dist/preview/chunk.VUSJ7HPC.js +0 -1
- package/dist/preview/chunk.VXRECLX6.js +0 -1
- package/dist/preview/chunk.W66VMALY.js +0 -1
- package/dist/preview/chunk.WGVIJDV5.js +0 -1
- package/dist/preview/chunk.X3MMJ3QC.js +0 -5
- package/dist/preview/chunk.X5YRNNHU.js +0 -1
- package/dist/preview/chunk.YMC2T2HN.js +0 -1
- package/dist/preview/chunk.YN6BXZHO.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graview",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.60",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The Graview command line: start a product, check its declaration, write its agent docs, serve its store, preview a document with no product and photograph its places, say whether a product is on one release, host it for an agent over MCP, apply an act to it, sync its seed, install the authoring skills. The tool; @graview/* is the framework.",
|
|
6
6
|
"keywords": [
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@graview/
|
|
33
|
-
"@graview/
|
|
34
|
-
"@graview/
|
|
35
|
-
"@graview/
|
|
36
|
-
"@graview/tools": "0.1.
|
|
32
|
+
"@graview/core": "0.1.60",
|
|
33
|
+
"@graview/guest": "0.1.60",
|
|
34
|
+
"@graview/ship": "0.1.60",
|
|
35
|
+
"@graview/skills": "0.1.60",
|
|
36
|
+
"@graview/tools": "0.1.60"
|
|
37
37
|
},
|
|
38
38
|
"engines": {
|
|
39
39
|
"node": ">=22"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as n}from"./chunk.MOAUE3N2.js";import"./chunk.KKQXGN5U.js";import"./chunk.G7HIAUEA.js";import"./chunk.GQHFLOTZ.js";import{l as s}from"./chunk.2XTCDFWU.js";import"./chunk.Q355UPFG.js";import"./chunk.PXQVXBNG.js";import"./chunk.XOTES3PI.js";import"./chunk.WGTBQHHE.js";import"./chunk.HF5SNUTK.js";import"./chunk.S7ZLGODY.js";import"./chunk.2QESVWUW.js";import"./chunk.UM5H2VVR.js";import"./chunk.WEGPDJTB.js";import"./chunk.MRYN42EQ.js";import"./chunk.E22DDEQI.js";import"./chunk.OLW44AP5.js";import"./chunk.F6P3WSMW.js";import"./chunk.YMRVKG6W.js";import"./chunk.BDBLGGFJ.js";import"./chunk.D3AISGQH.js";import"./chunk.IZ2ZTNEV.js";import"./chunk.6E36I2GC.js";import"./chunk.CJUIJ6TL.js";import"./chunk.IIESMHXY.js";import"./chunk.BJUUSIQY.js";import"./chunk.X2G4ZRB2.js";import"./chunk.UITZ74YJ.js";import"./chunk.XOZU4OFA.js";import"./chunk.MHILFBK6.js";import"./chunk.MB7LKKUD.js";import"./chunk.WVUJXDXZ.js";import"./chunk.Q6LLURRM.js";import"./chunk.AXXYJCSW.js";import"./chunk.N4LOI3YA.js";import"./chunk.RKZ4J3H2.js";import"./chunk.HKINU7VO.js";import"./chunk.YGZCESXY.js";import"./chunk.GZHZLJBF.js";import"./chunk.KHZA5F7A.js";import"./chunk.OJGHDWI6.js";import"./chunk.KSVJHSRH.js";import"./chunk.NSGQXCH6.js";import"./chunk.SZG6HJWH.js";import"./chunk.2FOIJ5ID.js";import"./chunk.6IUEGPCZ.js";import"./chunk.CUJX3IVA.js";import{G as y,T as i}from"./chunk.VNJKGSGZ.js";import"./chunk.SDO3U72B.js";import"./chunk.X3MMJ3QC.js";import"./chunk.FQLNBIQ5.js";import{b as r}from"./chunk.AJZBJBMO.js";var c=r(y(),1),e=r(i(),1);function v({store:d,views:t,as:a,scope:o}){let l=(0,c.useMemo)(()=>s({scope:`.${o}`}),[o]);return(0,e.jsxs)("div",{"data-testid":"embed-picture","data-embed-content":"",tabIndex:0,"aria-label":t.places().find(m=>m.as===a)?.title??"The picture",style:{flex:"1 1 auto",minHeight:0,display:"grid",gridTemplateRows:"minmax(0, 1fr)",overflow:"auto",background:"var(--graview-ground)",color:"var(--graview-ink)",fontFamily:"var(--graview-font-body, system-ui)"},children:[(0,e.jsx)("style",{children:l}),(0,e.jsx)(n,{store:d,views:t,as:a})]})}export{v as PictureFace};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as n}from"./chunk.HF5SNUTK.js";import"./chunk.S7ZLGODY.js";import"./chunk.2QESVWUW.js";import"./chunk.UM5H2VVR.js";import"./chunk.MRYN42EQ.js";import"./chunk.E22DDEQI.js";import"./chunk.OLW44AP5.js";import"./chunk.D3AISGQH.js";import"./chunk.IZ2ZTNEV.js";import"./chunk.6E36I2GC.js";import"./chunk.CJUIJ6TL.js";import"./chunk.IIESMHXY.js";import"./chunk.WVUJXDXZ.js";import{e as p}from"./chunk.Q6LLURRM.js";import"./chunk.AXXYJCSW.js";import"./chunk.N4LOI3YA.js";import"./chunk.RKZ4J3H2.js";import"./chunk.HKINU7VO.js";import"./chunk.YGZCESXY.js";import"./chunk.GZHZLJBF.js";import"./chunk.KHZA5F7A.js";import"./chunk.OJGHDWI6.js";import"./chunk.KSVJHSRH.js";import"./chunk.NSGQXCH6.js";import"./chunk.SZG6HJWH.js";import"./chunk.2FOIJ5ID.js";import"./chunk.6IUEGPCZ.js";import"./chunk.CUJX3IVA.js";import{T as m}from"./chunk.VNJKGSGZ.js";import"./chunk.SDO3U72B.js";import"./chunk.X3MMJ3QC.js";import"./chunk.FQLNBIQ5.js";import{b as t}from"./chunk.AJZBJBMO.js";var i=t(m(),1),a=new WeakMap;function l(o){let e=a.get(o);if(!e){let r=p(o);e=c=>c.mode==="fullscreen"?(0,i.jsx)(n,{blocks:r,slot:"home",heading:2,firstHeading:1}):(0,i.jsx)(n,{blocks:r,slot:"home",heading:3,firstHeading:2}),a.set(o,e)}return e}export{l as homeView};
|
|
@@ -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{a as _,b as me,e as ce,f as ye,g as ge}from"./chunk.CJUIJ6TL.js";import{b as G}from"./chunk.IIESMHXY.js";import{c as ue}from"./chunk.Q6LLURRM.js";import{n as P}from"./chunk.KHZA5F7A.js";import{b as x,c as se,d as le,j as de,k as pe}from"./chunk.NSGQXCH6.js";import{d as ie,e as oe}from"./chunk.SZG6HJWH.js";import{b as ae,f as re}from"./chunk.2FOIJ5ID.js";import{Fa as te,G as ve,Ga as ne,T as Z,ba as O,ca as ee,ea as U}from"./chunk.VNJKGSGZ.js";import{a as Y}from"./chunk.SDO3U72B.js";import{da as E,ma as X}from"./chunk.X3MMJ3QC.js";import{b as D}from"./chunk.AJZBJBMO.js";var p=D(ve(),1);var ke=ne(Y(()=>(__graviewPreload(import.meta.url,["./chunk.6E36I2GC.js","./chunk.CJUIJ6TL.js","./chunk.IIESMHXY.js","./chunk.WVUJXDXZ.js","./chunk.Q6LLURRM.js","./chunk.AXXYJCSW.js","./chunk.N4LOI3YA.js","./chunk.RKZ4J3H2.js","./chunk.HKINU7VO.js","./chunk.YGZCESXY.js","./chunk.GZHZLJBF.js","./chunk.KHZA5F7A.js","./chunk.OJGHDWI6.js","./chunk.KSVJHSRH.js","./chunk.NSGQXCH6.js","./chunk.SZG6HJWH.js","./chunk.2FOIJ5ID.js","./chunk.6IUEGPCZ.js","./chunk.CUJX3IVA.js","./chunk.VNJKGSGZ.js","./chunk.SDO3U72B.js","./chunk.X3MMJ3QC.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.CYUMQPMH.js")))),fe=ke.part((i,n)=>i.drawAppLink(n),{quiet:!0});var e=D(Z(),1);function K({nodeId:i,field:n,value:l,stored:s=l,said:c}){let{fields:m,commit:o}=P(i),t=m.find(r=>r.field===n),{store:g,principal:I}=O(),u=g.graph.getNode(i)?.kind,f=g.schema.definitions.find(r=>r.kind===u),h=X(f,n),k=h.toLowerCase(),a=c??`${h.charAt(0).toUpperCase()}${h.slice(1)}: ${l}`,[w,L]=(0,p.useState)(!1),d=t?.shape.type==="number"?t.shape.amount:void 0,y=d&&s!==""&&Number.isFinite(Number(s))?se(Number(s),d):s,[v,z]=(0,p.useState)(y),W=(0,p.useRef)(null),j=(0,p.useRef)(null),M=(0,p.useRef)(!1),[q,J]=(0,p.useState)(void 0),S=r=>{M.current=r,L(!1)};(0,p.useEffect)(()=>z(y),[y,w]);let Q=t?.shape.type==="date";if((0,p.useEffect)(()=>{if(Q)return te(()=>void ge())},[Q]),(0,p.useEffect)(()=>{w?W.current?.focus():M.current&&(M.current=!1,j.current?.focus())},[w]),!t)return(0,e.jsx)("span",{"data-graview-field":n,"data-graview-readonly":"",title:`Read-only \u2014 nothing this app declares changes the ${k}`,style:{color:"var(--graview-ink)",cursor:"default",overflowWrap:"anywhere"},children:l});if(!w){let r=(0,e.jsx)("button",{ref:j,type:"button","data-graview-field":n,"data-graview-editable":t.mutation,...a===l?{}:{"aria-label":a},title:`${t.title} \u2014 changes the ${k}, and can be undone`,onClick:()=>{J(void 0),L(!0)},style:{all:"unset",cursor:"text",display:"inline-flex",alignItems:"flex-end",minHeight:24,minWidth:24,maxWidth:"100%",overflowWrap:"anywhere",paddingBottom:1,borderBottom:"1px dashed var(--graview-edge-bright)",color:"var(--graview-ink)"},children:l});return q?(0,e.jsxs)(e.Fragment,{children:[r,(0,e.jsx)("span",{role:"status","data-graview-refused":n,style:{marginLeft:6,fontSize:"0.75rem",color:"var(--graview-ink-muted)"},children:q})]}):r}let $=(r,{left:b=!1}={})=>{if(S(!b),r!==s){if(r===""||r===void 0||r===null){if(s==="")return;t.clearable?o(t,null):J(`${h.charAt(0).toUpperCase()}${h.slice(1)} can't be empty; it keeps ${l}.`);return}t.shape.type==="date"&&typeof r=="string"&&be(r)||o(t,r)}},be=r=>{if(t.shape.type!=="date")return!1;let b=m.filter(C=>C.shape.type==="date"&&C.takesValue),T=pe(b.map(C=>C.field),f?.fieldRoles??{}),A=T?.start===n?b.find(C=>C.field===T.end):void 0,F=g.graph.getNode(i)?.[T?.end??""];if(!A||typeof F!="string")return!1;let N=de(s===""?void 0:s,r,F,{time:t.shape.time===!0,instant:t.shape.instant===!0});if(N===void 0||N===F)return!1;let R=t.call(r),V=A.call(N);return g.applyAll(R.name===V.name?[{name:R.name,args:{...R.args,...V.args}}]:[R,V],{author:I}),!0};if(!t.takesValue){let r=[t,...t.alternatives];return(0,e.jsx)("span",{role:"group","aria-label":`Change ${E(n).toLowerCase()}`,"data-graview-field":n,style:{display:"inline-flex",gap:6,alignItems:"center",flexWrap:"wrap"},onKeyDown:b=>{b.key==="Escape"&&S(!0)},children:r.map((b,T)=>(0,e.jsx)("button",{type:"button",ref:T===0?W:void 0,"data-graview-act":b.mutation,onClick:()=>{S(!0),o(b,void 0)},onBlur:A=>{let H=A.relatedTarget;(!H||!A.currentTarget.parentElement?.contains(H))&&S(!1)},style:{padding:"2px 9px",fontSize:"0.8125rem",borderRadius:999},children:b.title},b.mutation))})}return(0,e.jsxs)("form",{style:{display:"inline-flex",flexWrap:"wrap",gap:4,maxWidth:"100%"},onSubmit:r=>{r.preventDefault(),$(he(t,v))},children:[t.shape.type==="choice"?(0,e.jsx)("select",{ref:W,"aria-label":E(n),"data-graview-field":n,value:v,onChange:r=>$(r.target.value),onBlur:()=>S(!1),style:{font:"inherit",fontSize:"inherit"},children:t.shape.options.map(r=>(0,e.jsx)("option",{value:r,children:ae(f,n,r)},r))}):t.shape.type==="date"?(0,e.jsx)(ye,{inputRef:W,label:E(n),value:v===""?void 0:v,time:t.shape.time===!0,instant:t.shape.instant===!0,partial:t.shape.partial===!0,onChange:r=>z(r??""),onLeave:r=>$(r,{left:!0}),onCancel:()=>S(!0),autoSelect:!0,boxStyle:{fontSize:"inherit",minHeight:24,padding:"0 3px"}}):(0,e.jsxs)(e.Fragment,{children:[d&&x(d).prefix?(0,e.jsx)("span",{"aria-hidden":"true",children:x(d).prefix}):null,(0,e.jsx)("input",{ref:W,"aria-label":d?`${E(n)}, ${x(d).hint}`:E(n),"data-graview-field":n,...d?{inputMode:"decimal",placeholder:x(d).placeholder,"data-graview-amount":d.format??"unit"}:{},type:d?"text":t.shape.type==="number"&&!t.shape.duration?"number":"text",...t.shape.type==="number"&&t.shape.duration?{placeholder:"1h 30m"}:{},...t.shape.type==="text"&&t.shape.holds==="phone"?{inputMode:"tel",autoComplete:"tel"}:{},...t.shape.type==="number"&&t.shape.min!==void 0&&!d?{min:t.shape.min}:{},...t.shape.type==="number"&&t.shape.max!==void 0&&!d?{max:t.shape.max}:{},...t.shape.type==="number"&&t.shape.step!==void 0&&!d?{step:t.shape.step}:{},value:v,onChange:r=>z(r.target.value),onBlur:()=>$(he(t,v),{left:!0}),onKeyDown:r=>{r.key==="Escape"&&S(!0)},style:{font:"inherit",fontSize:"inherit",width:`min(${Math.max(6,v.length+1)}ch, 100%)`,maxWidth:"100%",minWidth:0,boxSizing:"border-box",minHeight:24,display:"inline-flex",alignItems:"center",padding:"0 3px"}}),d&&x(d).suffix?(0,e.jsx)("span",{"aria-hidden":"true",children:x(d).suffix}):null]}),t.open.length>0?(0,e.jsxs)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:["also needs ",t.open.map(r=>r.name).join(", ")]}):null]})}function he(i,n){return n.trim()===""?"":i.shape.type==="number"&&i.shape.amount?le(n,i.shape.amount):i.shape.type==="number"?i.shape.duration?re(n)??n:Number(n):i.shape.type==="text"&&i.shape.holds?n.trim():n}function we({href:i,field:n,value:l,stored:s,nodeId:c}){let m=i.startsWith("tel:"),o=(t,g)=>(0,e.jsx)("a",{href:i,"data-graview-link":n,...g?{"aria-label":g}:{},...m?{}:{target:"_blank",rel:"noopener noreferrer"},style:{display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,maxWidth:"100%",overflowWrap:"anywhere",color:"var(--graview-accent)"},children:t});return c===void 0?o(l):(0,e.jsxs)("span",{style:{display:"inline-flex",flexWrap:"wrap",alignItems:"center",gap:"0 10px",maxWidth:"100%"},children:[(0,e.jsx)(K,{nodeId:c,field:n,value:l,...s===void 0?{}:{stored:s}}),o(m?"Call":"Map",m?`Call ${l}`:`Open ${l} in maps`)]})}function Ue({id:i,hide:n=[],limit:l=10,labels:s={},shown:c=[]}){let{store:m}=O(),o=U(i);if(!o)return null;let t=m.schema.tryDefinition(o.kind),g=ie(o,t,{limit:l,said:c}).filter(u=>!n.includes(u.key)),I=ue(t).length>0;return g.length===0&&!I?null:(0,e.jsxs)("div",{"data-graview-fields":o.id,style:{display:"grid",gap:14,alignContent:"start",minWidth:0,fontSize:"0.875rem"},children:[oe(t,g).map((u,f)=>{let h=(0,e.jsx)("dl",{style:{margin:0,display:"grid",gridTemplateColumns:"auto 1fr",gap:"5px 16px",alignContent:"start",minWidth:0},children:u.fields.map(a=>a.files?(0,e.jsx)(_,{as:"field",nodeId:o.id,field:a.key,label:s[a.key]??a.label,files:a.files,labelStyle:B,style:{marginTop:6}},a.key):a.long?(0,e.jsx)(xe,{nodeId:o.id,field:a.key,label:s[a.key]??a.label,value:a.value,markdown:a.markdown,labelStyle:B,style:{gridColumn:"1 / -1",marginTop:6}},a.key):(0,e.jsxs)("div",{style:{display:"contents"},children:[(0,e.jsx)("dt",{style:{...B,whiteSpace:"nowrap"},children:s[a.key]??a.label}),(0,e.jsxs)("dd",{style:{margin:0,minWidth:0},children:[a.linked?(0,e.jsx)(me,{relation:a.linked.relation,refs:a.linked.refs,nodeId:o.id,field:a.key}):a.app?(0,e.jsx)(fe,{address:a.app,as:"record",nodeId:o.id,field:a.key}):a.href?(0,e.jsx)(we,{href:a.href,field:a.key,value:a.value,stored:a.stored,nodeId:o.id}):(0,e.jsx)(K,{nodeId:o.id,field:a.key,value:a.value,stored:a.stored}),a.repeats?(0,e.jsx)(ce,{nodeId:o.id,field:a.key,start:o[a.key],value:o[`${a.key}Repeat`],label:`${s[a.key]??a.label} repeats`}):null]})]},a.key))});if(!u.title)return(0,e.jsx)("div",{children:h},f);let k=`graview-field-group-${o.id}-${f}`;return(0,e.jsxs)("div",{role:"group","aria-labelledby":k,style:{display:"grid",gap:6,minWidth:0},children:[(0,e.jsx)("p",{id:k,"data-graview-field-group":u.title,style:Se,children:u.title}),h]},f)}),I?(0,e.jsx)(_,{as:"unfilled",nodeId:o.id,skip:n,labels:s,labelStyle:B}):null]})}var B={color:"var(--graview-ink-faint)",fontSize:"0.8125rem"},Se={margin:0,fontSize:"0.75rem",letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--graview-ink-muted)",fontWeight:560};function xe(i){return ee()?(0,e.jsx)(Le,{...i}):(0,e.jsx)(Ie,{...i})}function Ie({field:i,label:n,value:l,labelStyle:s,valueStyle:c,style:m,markdown:o}){return(0,e.jsxs)("div",{"data-graview-long":i,style:{display:"grid",gap:6,minWidth:0,...m},children:[(0,e.jsx)("dt",{style:s,children:n}),(0,e.jsx)("dd",{style:{margin:0,minWidth:0,...c},children:(0,e.jsx)("div",{"data-graview-field":i,children:(0,e.jsx)(G,{text:l,markdown:o})})})]})}function Le({nodeId:i,field:n,label:l,value:s,labelStyle:c,valueStyle:m,style:o,markdown:t}){let{fields:g,commit:I}=P(i),u=g.find(y=>y.field===n&&y.takesValue),[f,h]=(0,p.useState)(!1),k=(0,p.useRef)(null),a=(0,p.useRef)(!1);(0,p.useEffect)(()=>{!f&&a.current&&(a.current=!1,k.current?.focus())},[f]);let w=y=>{a.current=y,h(!1)},L=l.toLowerCase(),d=(0,e.jsx)(G,{text:s,markdown:t});return(0,e.jsxs)("div",{"data-graview-long":n,style:{display:"grid",gap:6,minWidth:0,...o},children:[(0,e.jsxs)("dt",{style:{display:"flex",alignItems:"baseline",gap:10,...c},children:[(0,e.jsx)("span",{children:l}),u&&!f?(0,e.jsx)("button",{ref:k,type:"button","data-graview-editable":u.mutation,"aria-label":`Edit the ${L}`,title:`${u.title} \u2014 changes the ${L}, and can be undone`,onClick:()=>h(!0),style:Ee,children:"Edit"}):null]}),(0,e.jsx)("dd",{style:{margin:0,minWidth:0,...m},children:f&&u?(0,e.jsx)(p.Suspense,{fallback:d,children:(0,e.jsx)(Ce,{nodeId:i,field:n,label:l,value:s,...t?{markdown:!0}:{},onCancel:()=>w(!0),onDone:y=>w(!y),onSave:(y,v)=>{w(!v),y!==s&&I(u,y)}})}):(0,e.jsx)("div",{"data-graview-field":n,...u?{}:{"data-graview-readonly":"",title:`Read-only \u2014 nothing this app declares changes the ${L}`},...u?{onClick:()=>h(!0)}:{},style:{cursor:u?"text":"default",minWidth:0},children:d})})]})}var Ce=(0,p.lazy)(()=>(__graviewPreload(import.meta.url,["./chunk.IIESMHXY.js","./chunk.6IUEGPCZ.js","./chunk.CUJX3IVA.js","./chunk.VNJKGSGZ.js","./chunk.SDO3U72B.js","./chunk.X3MMJ3QC.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.QT6UV7HN.js"))),Ee={all:"unset",cursor:"pointer",fontSize:"0.75rem",letterSpacing:"normal",textTransform:"none",color:"var(--graview-accent)",borderBottom:"1px dashed currentColor",minHeight:24,minWidth:24,display:"inline-flex",alignItems:"flex-end"};function _e({nodeId:i,children:n}){let{fields:l}=P(i),s=U(i);if(!s)return(0,e.jsx)(e.Fragment,{children:n});let c=l.find(m=>{let o=s[m.field];return typeof o=="string"&&o===n});return c?(0,e.jsx)(K,{nodeId:i,field:c.field,value:n,said:n}):(0,e.jsx)(e.Fragment,{children:n})}export{fe as a,K as b,we as c,Ue as d,xe as e,_e as f};
|
|
@@ -1 +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{G as k,Ga as o,T as n}from"./chunk.VNJKGSGZ.js";import{a as t}from"./chunk.SDO3U72B.js";import{b as p}from"./chunk.AJZBJBMO.js";var f=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.WVUJXDXZ.js","./chunk.Q6LLURRM.js","./chunk.AXXYJCSW.js","./chunk.N4LOI3YA.js","./chunk.RKZ4J3H2.js","./chunk.HKINU7VO.js","./chunk.YGZCESXY.js","./chunk.GZHZLJBF.js","./chunk.KHZA5F7A.js","./chunk.OJGHDWI6.js","./chunk.KSVJHSRH.js","./chunk.NSGQXCH6.js","./chunk.SZG6HJWH.js","./chunk.2FOIJ5ID.js","./chunk.6IUEGPCZ.js","./chunk.CUJX3IVA.js","./chunk.VNJKGSGZ.js","./chunk.SDO3U72B.js","./chunk.X3MMJ3QC.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.ZT3NEAFI.js")))),y=f.part((e,r)=>e.drawFiles(r),{quiet:!0});var d=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.GZHZLJBF.js","./chunk.KHZA5F7A.js","./chunk.OJGHDWI6.js","./chunk.KSVJHSRH.js","./chunk.NSGQXCH6.js","./chunk.SZG6HJWH.js","./chunk.2FOIJ5ID.js","./chunk.6IUEGPCZ.js","./chunk.CUJX3IVA.js","./chunk.VNJKGSGZ.js","./chunk.SDO3U72B.js","./chunk.X3MMJ3QC.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.UFTAGUTU.js")))),I=d.part((e,r)=>e.drawLinkedRecord(r),{quiet:!0}),w=d.part((e,r)=>e.drawLinkedPicker(r),{what:"Picking a linked record"});var s=p(n(),1),m=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.GZHZLJBF.js","./chunk.KHZA5F7A.js","./chunk.OJGHDWI6.js","./chunk.KSVJHSRH.js","./chunk.NSGQXCH6.js","./chunk.SZG6HJWH.js","./chunk.2FOIJ5ID.js","./chunk.6IUEGPCZ.js","./chunk.CUJX3IVA.js","./chunk.VNJKGSGZ.js","./chunk.SDO3U72B.js","./chunk.X3MMJ3QC.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.HJOVOA52.js")))),E=m.part((e,r)=>(0,s.jsx)(e.RepeatPicker,{...r}),{quiet:!0}),W=m.part((e,r)=>(0,s.jsx)(e.RepeatEditor,{...r}),{quiet:!0});var a=p(k(),1),i=p(n(),1),c=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.NSGQXCH6.js","./chunk.SZG6HJWH.js","./chunk.2FOIJ5ID.js","./chunk.6IUEGPCZ.js","./chunk.CUJX3IVA.js","./chunk.VNJKGSGZ.js","./chunk.SDO3U72B.js","./chunk.X3MMJ3QC.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.JPNBQFJ3.js")))),l=c.part((e,r)=>(0,i.jsx)(e.WhenInput,{...r}),{quiet:!0});function M(e){return(0,i.jsx)(a.Suspense,{fallback:(0,i.jsx)("span",{"data-graview-when-arriving":"",style:{display:"inline-block",minHeight:24}}),children:(0,i.jsx)(l,{...e})})}var N=()=>c.load().then(()=>{},()=>{});export{y as a,I as b,w as c,E as d,W as e,M as f,N as g};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as _}from"./chunk.IIESMHXY.js";import"./chunk.6IUEGPCZ.js";import"./chunk.CUJX3IVA.js";import{G as se,T as U,ba as H,ea as Y}from"./chunk.VNJKGSGZ.js";import"./chunk.SDO3U72B.js";import{$d as $,vb as z}from"./chunk.X3MMJ3QC.js";import"./chunk.FQLNBIQ5.js";import{b as D}from"./chunk.AJZBJBMO.js";var u=D(se(),1);function L(e,t,s=!1){if(e<t.at||e===t.at&&s)return e;let i=t.at+t.removed.length;return e>=i?e+t.inserted.length-t.removed.length:s?t.at:t.at+t.inserted.length}var X=e=>e>=55296&&e<=56319,G=e=>e>=56320&&e<=57343;function V(e,t,s){let i=Math.min(e.length,t.length),n=0,l=Math.max(0,Math.min(i,t.length-s));for(;n<l&&e.charCodeAt(e.length-1-n)===t.charCodeAt(t.length-1-n);)n++;let r=0;for(;r<i-n&&e.charCodeAt(r)===t.charCodeAt(r);)r++;return r>0&&X(e.charCodeAt(r-1))&&r--,n>0&&G(e.charCodeAt(e.length-n))&&n--,{at:r,removed:e.slice(r,e.length-n),inserted:t.slice(r,t.length-n)}}function M(e,t){let s=Math.min(e.length,t.length),i=0;for(;i<s&&e.charCodeAt(i)===t.charCodeAt(i);)i++;i>0&&X(e.charCodeAt(i-1))&&i--;let n=0;for(;n<s-i&&e.charCodeAt(e.length-1-n)===t.charCodeAt(t.length-1-n);)n++;return n>0&&G(e.charCodeAt(e.length-n))&&n--,{at:i,removed:e.slice(i,e.length-n),inserted:t.slice(i,t.length-n)}}function q(e,t){let s=c=>c.at+c.removed.length;if(s(e)<t.at)return e;if(e.at>s(t))return{...e,at:e.at+t.inserted.length-t.removed.length};let i=Math.min(e.at,t.at),n=s(e)-s(t),l=e.removed.slice(0,t.at-i)+t.inserted+(n>0?e.removed.slice(e.removed.length-n):""),r=t.at<=e.at?t.inserted+e.inserted:e.inserted+t.inserted,d=M(l,r);return{...d,at:i+d.at}}function I(e,t){let s=L(e.start,t,!0),i=e.end===e.start?s:L(e.end,t);return{start:s,end:Math.max(s,i)}}function ce(e,t){let{kind:s,id:i,session:n}=e.author,l=`${s}:${i??""}:`;return t.startsWith(l)&&(!n||t.slice(l.length)===n)}function Z(e,t,s,i){let n=e.anchor,l=e.head;for(let d of s)if(!(d.seq<e.rev||ce(d,t)))for(let c of d.primitives)c.op!=="splice-text"||c.id!==e.node||c.field!==e.field||(n=L(n,c),l=L(l,c));let r=d=>Math.max(0,Math.min(i,d));return{start:r(n),end:r(l)}}var O=(e,t,s)=>e.ops.length>0&&e.ops.every(i=>{let n=i.mutation?.args;return i.mutation?.name===z&&n?.node===t&&n.field===s}),le=(e,t,s,i)=>t.ops.length>0&&t.ops.every(n=>n.undoes!==void 0)&&e.batches().some(n=>t.ops.some(l=>l.undoes===n.id||l.undoes===n.ops[0]?.id)&&O(n,s,i)),J=(e,t)=>e.author.kind==="human"&&(t?.id===void 0||e.author.id===void 0||e.author.id===t.id);function Q(e,t,s,i){let n=e.batches();for(let l=n.length-1;l>=0;l--){let r=n[l];if(!(!J(r,t)||r.undone||!O(r,s,i))&&e.canUndo(r.id).ok)return r.id}}function j(e,t,s,i){let n=e.batches();for(let l=n.length-1;l>=0;l--){let r=n[l];if(J(r,t)){if(O(r,s,i))return;if(le(e,r,s,i))return r.undone?void 0:r.id}}}var p=D(U(),1);function de(e){let{store:t}=H(),{live:s,nodeId:i,field:n}=e,[l,r]=(0,u.useState)(null);return(0,u.useEffect)(()=>{let d=!0;return s.typing(i,n).then(c=>d&&r(c)),()=>{d=!1}},[i,n]),l&&!t.collaborative(i,n)?(0,p.jsx)(p.Fragment,{children:e.writtenWhole}):(0,p.jsx)(ue,{...e,typing:l})}function ue({nodeId:e,field:t,label:s,markdown:i,live:n,onDone:l,typing:r}){let{store:d,principal:c}=H(),m=Y(e),f=te(m?.[t]),[x,oe]=(0,u.useState)(!1),y=(0,u.useRef)(null),R=(0,u.useRef)(f),E=(0,u.useRef)(!1),B=(0,u.useRef)(n);B.current=n;let N=()=>te(d.graph.getNode(e)?.[t]);(0,u.useEffect)(()=>y.current?.focus(),[x,r]);let b=(0,u.useRef)(void 0),C=()=>{b.current===void 0&&(b.current=setTimeout(()=>{b.current=void 0;let o=y.current;if(!o||o.ownerDocument.activeElement!==o)return;let a=o.selectionDirection==="backward";B.current.sayCaret({node:e,field:t,anchor:a?o.selectionEnd:o.selectionStart,head:a?o.selectionStart:o.selectionEnd,rev:d.log.length})},fe))};(0,u.useEffect)(()=>()=>{clearTimeout(b.current),B.current.sayCaret(null)},[]);let W=o=>{let a=y.current;if(a){if(a.value!==o){let h=I({start:a.selectionStart,end:a.selectionEnd},M(a.value,o)),g=a.selectionDirection??"none";a.value=o,a.setSelectionRange(h.start,h.end,g)}R.current=o}},K=()=>{let o=y.current;if(!o||!r||E.current)return;let a=R.current,h=N(),g=V(a,o.value,o.selectionEnd);if(g.removed===""&&g.inserted==="")return W(h);let v=a===h?g:q(g,M(a,h));try{r.splice(v.at,v.removed.length,v.inserted)}catch{}let w=N();if(o.value!==w){o.value=w;let S=Math.min(w.length,v.at+v.inserted.length);o.setSelectionRange(S,S)}R.current=w,C()};(0,u.useLayoutEffect)(()=>{E.current||W(f)},[f]);let ie=async o=>{if(!r)return;r.flush();for(let h=0;r.waiting()>0&&h<100;h++)await new Promise(g=>setTimeout(g,30));let a=o?j(d,c,e,t):Q(d,c,e,t);if(a)try{o?d.redo(a,{author:c}):d.undo(a,{author:c})}catch{}},T=o=>{r?.flush(),n.sayCaret(null),l(o)},k=(0,u.useRef)(void 0);(0,u.useEffect)(()=>()=>k.current?.(),[]);let ae=o=>{k.current?.();let a=o.ownerDocument,h=y.current?.closest("[data-graview-live]"),g=A=>{let P=A.target;if(P instanceof Node&&h?.contains(P))return S();P instanceof Element&&P.closest(ee)||(S(),T(!0))},v=()=>{let A=a.activeElement;A!==null&&A!==a.body||o.isConnected&&he(o)||(S(),y.current?.focus({preventScroll:!0}))},w=new MutationObserver(v);w.observe(a.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["open","hidden"]}),a.addEventListener("focusin",g),a.addEventListener("toggle",v,!0);let S=()=>{k.current=void 0,w.disconnect(),a.removeEventListener("focusin",g),a.removeEventListener("toggle",v,!0)};k.current=S},F=[...n.who.values()].filter(o=>o.caret?.node===e&&o.caret.field===t);return(0,p.jsxs)("div",{style:{display:"grid",gap:8,minWidth:0},"data-graview-live":t,children:[x?(0,p.jsx)("div",{"data-graview-preview":t,"aria-label":`${s}, as it will read`,role:"region",style:me,children:(0,p.jsx)(_,{text:f,markdown:!0})}):(0,p.jsxs)("div",{style:{position:"relative",minWidth:0},children:[(0,p.jsx)("textarea",{ref:y,"aria-label":s,"data-graview-field":t,defaultValue:f,readOnly:!r,rows:3,onInput:K,onCompositionStart:()=>{E.current=!0},onCompositionEnd:()=>{E.current=!1,K()},onSelect:C,onFocus:C,onPointerDown:()=>r?.flush(),onKeyDown:o=>{let a=o.key;a==="Escape"?(o.preventDefault(),T(!1)):(o.metaKey||o.ctrlKey)&&!o.altKey&&a.toLowerCase()==="z"?(o.preventDefault(),ie(o.shiftKey)):(o.metaKey||o.ctrlKey)&&a==="Enter"?(o.preventDefault(),T(!1)):(a==="Enter"||ge.has(a))&&r?.flush()},onKeyUp:C,onBlur:o=>{r?.flush(),n.sayCaret(null);let a=o.relatedTarget;if(a instanceof Node&&o.currentTarget.closest("[data-graview-live]")?.contains(a))return;let h=a instanceof Element?a.closest(ee):null;if(h)return ae(h);T(!0)},style:ve}),F.length>0?(0,p.jsx)(pe,{text:f,others:F,area:y,log:d.log.all()}):null]}),(0,p.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:8},children:[(0,p.jsx)("button",{type:"button",onClick:()=>T(!1),style:ne,children:"Done"}),i?(0,p.jsx)("button",{type:"button","aria-pressed":x,onClick:()=>oe(!x),style:ne,children:x?"Write":"Preview"}):null,(0,p.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:"Saved as you type \xB7 Ctrl or \u2318 Z takes back your typing"})]})]})}function pe({text:e,others:t,area:s,log:i}){let n=(0,u.useRef)(null);(0,u.useLayoutEffect)(()=>{let c=s.current,m=n.current;if(!c||!m)return;let f=()=>{m.scrollTop=c.scrollTop};return f(),c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)});let l=t.map(c=>({one:c,at:Z(c.caret,c.participant,i,e.length).end})).sort((c,m)=>c.at-m.at),r=[],d=0;for(let{one:c,at:m}of l){r.push(e.slice(d,m)),d=m;let f=$(c)||"Somebody";r.push((0,p.jsx)("span",{"data-graview-caret":c.participant,title:`${f} is typing here`,style:{borderLeft:`2px solid hsl(${Math.round(c.hue)} 55% 52%)`,marginLeft:-1,marginRight:-1,pointerEvents:"auto"}},c.participant))}return r.push(`${e.slice(d)}\u200B`),(0,p.jsx)("div",{ref:n,"aria-hidden":"true",style:ye,children:r})}var ee='[data-graview-overlay], dialog, [role="dialog"], [role="alertdialog"], [popover]',he=e=>{if(e.hasAttribute("hidden")||e instanceof HTMLDialogElement&&!e.open)return!1;if(e.hasAttribute("popover"))try{return e.matches(":popover-open")}catch{}return!0},fe=120,te=e=>typeof e=="string"?e:"",ge=new Set(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"]),me={minHeight:"7.5em",padding:"8px 10px",border:"1px dashed var(--graview-edge-bright)",borderRadius:6,lineHeight:1.6,minWidth:0},ne={font:"inherit",fontSize:"0.8125rem",minHeight:28,padding:"2px 12px"},re={font:"inherit",lineHeight:1.5,width:"100%",boxSizing:"border-box",minHeight:"7.5em",padding:"8px 10px",borderRadius:6},ve={...re,resize:"vertical",fieldSizing:"content",color:"var(--graview-ink)",background:"var(--graview-panel, transparent)",border:"1px solid var(--graview-edge-bright)"},ye={...re,position:"absolute",inset:0,height:"100%",border:"1px solid transparent",color:"transparent",whiteSpace:"pre-wrap",overflowWrap:"break-word",overflow:"hidden",pointerEvents:"none"};export{de as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as O}from"./chunk.OJGHDWI6.js";import{j as C}from"./chunk.SZG6HJWH.js";import{G as b,La as G,T as M,ba as w,c as V,ca as I,da as W,x as B}from"./chunk.VNJKGSGZ.js";import{C as D,Rb as F,Rc as _,Sc as L,Yc as j,ac as N}from"./chunk.X3MMJ3QC.js";import{b as m}from"./chunk.AJZBJBMO.js";function H(n,e){let t=n.graph.getNode(e);if(!t)return[];let i=t.kind,a=n.schema.tryDefinition(i);if(!a)return[];let c=n.seenFor,u=c?j.keptFrom?.(n,c)?.(t):void 0,o=new Map;for(let r of n.allMutations()){let s=r.subject;if(!s||!(s.kinds==="*"||s.kinds.includes(i)))continue;let l=r.input.shape??{};for(let d of N(r,a)){if(u?.(d))continue;let x=d in l,k=[];for(let h of Object.keys(l)){if(h===s.arg||h===d||X(l[h]))continue;let v=F(r.input).find(S=>S.name===h);k.push({name:h,...v?{kinds:v.kinds}:{},...v?{candidates:v.kinds.includes("*")?n.graph.allNodes().map(S=>S.id):v.kinds.flatMap(S=>n.graph.nodesOfKind(S).map(J=>J.id))}:{},shape:C(r.input,h)})}let Q={field:d,mutation:r.name,title:r.title??r.name,shape:x?C(r.input,d):{type:"unknown"},takesValue:x,alternatives:[],open:k,clearable:x&&(r.clearable?.includes(d)??!1),call:h=>({name:r.name,args:x?{[s.arg]:e,[d]:h}:{[s.arg]:e}})};o.set(d,[...o.get(d)??[],Q])}}return[...o.values()].map(r=>{let s=[...r.filter(d=>d.takesValue),...r.filter(d=>!d.takesValue)],[f,...l]=s;return{...f,alternatives:l}})}function X(n){let e=D(n)?.type;return e==="optional"||e==="default"||e==="nullable"}var R=m(b(),1);function we(n){let{store:e,principal:t}=w(),i=W(),a=(0,R.useMemo)(()=>n===null?[]:H(e,n),[e,n,i]),c=(0,R.useCallback)((u,o,r={})=>{let s=u.call(o);e.apply({name:s.name,args:{...s.args,...r}},{author:t})},[e,t]);return{fields:a,commit:c}}var K=m(b(),1);function Qe(){let{brand:n}=w(),e=n?.kit;return(0,K.useMemo)(()=>_(e),[e])}function Je(n,e){let t=L(n,e),i={...t.color!==void 0?{color:t.color}:{},...t.pattern!==void 0?{pattern:t.pattern}:{},...t.width!==void 0?{width:t.width}:{},...t.cap!==void 0?{cap:t.cap}:{},...t.opacity!==void 0?{opacity:t.opacity}:{}};return{connector:t,style:O(e,{[e]:i})}}var $=m(b(),1);var g=m(M(),1);function Z(n){let e=n?.hint;return typeof e=="string"&&e.length>0?e:void 0}function ee(n){if(n instanceof Error&&n.message)return n.message;let e=String(n);return e==="[object Object]"?"The view threw without a message.":e}var U=class extends $.Component{static contextType=G;state={};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(`[graview] the ${this.props.view??"view"} of ${this.props.kind} threw while rendering`,e,t.componentStack),this.context?.(e,{module:"@graview/react"})}render(){let{error:e}=this.state;if(!e)return this.props.children;let t=Z(e);return(0,g.jsxs)("div",{role:"alert","data-graview-view-error":this.props.kind,style:{display:"flex",flexDirection:"column",gap:"0.375rem",padding:"var(--graview-pad, 12px)",height:"100%",overflow:"auto",boxSizing:"border-box",borderRadius:"var(--graview-radius-sm, 6px)",background:"var(--graview-panel-warning, #fdf3ec)",color:"var(--graview-ink, #1a1a1a)",font:"var(--graview-font-body, 13px/1.45 system-ui)",fontSize:"0.875rem",lineHeight:1.45},children:[(0,g.jsx)("strong",{style:{color:"var(--graview-warn, #b4462a)"},children:this.props.view?`${this.props.view} could not draw`:"This view could not draw"}),(0,g.jsx)("span",{style:{color:"var(--graview-ink-muted, #555)"},children:this.props.kind}),(0,g.jsx)("span",{children:ee(e)}),t?(0,g.jsx)("span",{style:{color:"var(--graview-ink-muted, #555)"},children:t}):null]})}};var y=m(b(),1);var q=m(M(),1),A=(0,y.createContext)([]);function tn({sections:n,children:e}){let t=(0,y.useContext)(A),i=(0,y.useMemo)(()=>[...t,...n.filter(a=>!t.includes(a))],[t,n]);return(0,q.jsx)(A.Provider,{value:i,children:e})}function z(){let n=(0,y.useContext)(A),e=I()?.menuSections;return(0,y.useMemo)(()=>e?[...n,...e.filter(t=>!n.includes(t))]:n,[n,e])}function rn(){let n=z();return(0,y.useCallback)(e=>{for(let t of n)try{t(e)?.prepare?.()}catch{}},[n])}function on(n){let e=z();if(n===null||e.length===0)return{start:[],end:[]};let t=e.flatMap(i=>{try{let a=i(n);return a&&((a.items?.length??0)>0||a.render)?[a]:[]}catch{return[]}});return{start:t.filter(i=>i.at==="start"),end:t.filter(i=>i.at!=="start")}}var ne=m(b(),1);function cn(){return w().activity}var P=(n,e)=>n.length*e*.58;var te=156,re=2,E=te-18,oe=7.1,ie=16;function ae(n,e){let t=0,i=E;for(let a of n.split(" ")){let c=e(a),u=i+e(" ")+c;if(u<=E)i=u;else{let o=Math.ceil(c/E)||1;t+=o,i=c-(o-1)*E}}return t}var se=16.25,Y=27,ce=(n,e)=>{let t=Math.ceil(n.length*oe/E);return e?Math.max(Y,Math.ceil(Math.max(t,ae(n,e))*se)+6):Math.max(Y,t*ie+6)};function ln(n,e,t){return n.length===0?0:10+n.reduce((i,a)=>i+ce(a,t),0)+(n.length-1)*re}var de=27,ue=8,pn=4,le=64,fn=n=>Math.max(1,Math.min(ue,n)),mn=n=>n*de+le;var p=m(b(),1);function xn(n,{units:e,target:t=0,legibleAt:i=260}){let[a,c]=(0,p.useState)(e);(0,p.useEffect)(()=>{let o=n.current;if(o===null||typeof ResizeObserver>"u")return;let r=new ResizeObserver(([s])=>{let f=s?.contentRect.width??0;f>0&&c(f)});return r.observe(o),()=>r.disconnect()},[n]);let u=a/e;return{scale:u,width:a,touchable:u*t>=24,legible:a>=i}}function bn(n="--graview-font-body",e="sans-serif"){let t=(0,p.useRef)(void 0),i=(0,p.useMemo)(()=>{if(typeof getComputedStyle!="function"||typeof document>"u")return e;let a=getComputedStyle(document.documentElement).getPropertyValue(n).trim();return a.length>0?a:e},[n,e]);return(0,p.useMemo)(()=>{t.current===void 0&&(t.current=typeof document>"u"?null:document.createElement("canvas").getContext("2d")??null);let a=t.current;return a===null?P:(c,u)=>{a.font=`${u}px ${i}`;let o=a.measureText(c).width;return o>0?o:P(c,u)}},[i])}var wn=(0,p.createContext)(void 0);var T=3;function pe(n){let e=V(n),t=e.focusId;if(!t)return null;if(e.within?.view){let[a]=B(t);if(a)return{at:`screen:${a}`,audience:!0}}return{at:t,audience:!1}}var fe=102,me=32;function En(n,e,t){let i=[],a=new Map,c=new Map,u=0;for(let o of n){let r=pe(o.stop),s=r?e(r.at):null;if(!r||!s){o.name&&i.push({kind:"edge",presence:o,point:{x:t-8,y:fe+u++*me}});continue}if(!o.name){let k=c.get(r.at);c.set(r.at,{n:(k?.n??0)+1,box:s});continue}let f=a.get(r.at)??[];if(f.push(o),a.set(r.at,f),f.length>T)continue;let l=s,d=f.length-1,x=r.audience?{x:l.x+l.width*.5+(d-1)*26,y:l.y+Math.min(l.height,24)}:{x:l.x+l.width*.5-26-d*26,y:l.y+l.height-4};i.push({kind:"person",presence:o,point:x,at:r.at,index:d,of:f.length,audience:r.audience})}for(let[o,r]of a){if(r.length<=T)continue;let s=e(o);s&&i.push({kind:"count",at:o,point:{x:s.x+s.width*.5+2*26+18,y:s.y+s.height-4},n:r.length-T})}for(let[o,{n:r,box:s}]of c)i.push({kind:"count",at:o,point:{x:s.x+s.width*.5+40,y:s.y+s.height-4},n:r});for(let o of n)if(o.name){if(o.robot?.at&&o.robot.mode!=="docked"){let r=e(o.robot.at);r&&i.push({kind:"robot",presence:o,point:{x:r.x+r.width/2+22,y:r.y+r.height-4},mode:o.robot.mode})}if(o.over){let r=e(o.over);r&&i.push({kind:"over",presence:o,box:r})}}return i}export{cn as a,P as b,te as c,re as d,Y as e,ln as f,de as g,pn as h,le as i,fn as j,mn as k,xn as l,bn as m,we as n,Qe as o,Je as p,En as q,U as r,tn as s,rn as t,on as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as z,j as D}from"./chunk.FQLNBIQ5.js";var b=globalThis[Symbol.for("@graview/core:publishing")]??={},F=()=>b.kit,O="publish",N=e=>e?.mode==="on-publish",X=Symbol.for("@graview/core:seat"),$=(e,n)=>{let o=Reflect.get(e,n,e);return typeof o=="function"?o.bind(e):o},ee,ne=()=>ee??={name:O,title:"Publish",description:"Publish what collaborators have changed, so readers see it.",input:b.input(),apply(){}};function A(e,n,o){let r=e.all(),i=[],s;for(let t=r.length-1;t>=0&&i.length<o;t--){let a=r[t];a.seq>=n||a.publishedThrough===void 0||(s??=e.undoneIds()).has(a.id)||i.push(a.publishedThrough)}if(i.length<o){let t=[...e.epochs()].reverse().find(a=>a.horizon)?.publishedThrough;t!==void 0&&i.push(t)}return i}var R=new WeakMap;function K(e){let n=e.all(),o=n.at(-1)?.id,r=e.epochs(),i=R.get(e);if(i&&i.length===n.length&&i.last===o&&i.from===r)return i.seq;let s=A(e,Number.POSITIVE_INFINITY,1)[0];return R.set(e,{length:n.length,last:o,from:r,seq:s}),s}function te(e,n){if(!N(e))return{mutation:O,message:"this app is live: every edit reaches its readers as it is made, so there is nothing to publish.",wouldNeed:[]};let o=e.publishers??e.working;if(F().reads({mode:"on-publish",working:o},n))return{mutation:O,message:`only ${o.join(", ")||"nobody"} may publish.`,wouldNeed:[...o]}}var oe=(e,n,o,r,i,s)=>{let{log:t}=e,a=t.length,d=o.args.through;if(d!==void 0&&(!Number.isInteger(d)||d<t.horizon||d>a))throw new RangeError(`Cannot publish through seq ${String(d)}: this store holds seqs ${t.horizon} to ${a}.`);let u=d??a+1,l=K(t)??t.horizon,p=t.batches().filter(S=>!S.undone&&S.ops.some(m=>m.seq>=l&&m.seq<u&&m.publishedThrough===void 0)).length,g={id:n.id,seq:a,batch:r,author:i,intent:u<l?"Take back what was published":`Publish ${p===1?"1 change":`${p} changes`}`,...s.intent!==void 0?{batchIntent:s.intent}:{},mutation:o,primitives:[],reads:[],writes:[],at:n.at,...s.via!==void 0?{via:s.via}:{},publishedThrough:u};return t.append(g),g},se=new Set(["graph","log","snapshot","batches","violations","findings","canUndo","servedSeq","checkpoint"]);function re(e,n){let{seatView:o,viewsOf:r,viewKey:i,diff:s}=F(),t=r(e),a=i(n,"published"),d=t.get(a);if(d)return d;let u=o(e,n),l,p=()=>{let f=Math.max(e.publishedSeq??e.log.horizon,e.log.horizon);if(f>=e.log.length)return u;let h=e.log.all()[f-1-e.log.horizon]?.id;return(l?.seq!==f||l.id!==h)&&(l={seq:f,id:h,view:o(I(e,f),n)}),l.view},g=f=>f.servedSeq,S=f=>{let h=g(p()),v=p().graph.snapshot();return e.subscribe(()=>{let y=p(),k=g(y);if(k===h)return;let q=y.graph.snapshot(),M=k>h?y.log.all().filter(w=>w.seq>=h):[],c=s(v,q);[h,v]=[k,q],f(c,M)})},m=new Proxy(u,{get(f,h){switch(h){case X:return{store:e,principal:n};case"subscribe":return S;case"seenBy":return(v,y)=>e.seenBy(v,y);case"seenFor":return n;default:return se.has(h)?$(p(),h):$(f,h)}}});return t.set(a,m),m}b.served=re;b.act=(e,n)=>N(e.publishing)&&!e.past&&!n.has(O)?ne():void 0;b.verdict=(e,n)=>{let o=te(e.publishing,n);return o?{ok:!1,refusal:o}:{ok:!0}};b.seq=(e,n)=>{let{publishing:o,log:r}=e;if(N(o))return n===void 0?K(r):A(r,n,1)[0]};b.previous=e=>{let{publishing:n,log:o}=e;return N(n)?A(o,Number.POSITIVE_INFINITY,2).slice(1).filter(r=>r>=o.horizon):[]};b.op=oe;b.undo=(e,n,o)=>{if(o.seq===0)return;let r=new Set(n.map(t=>t.id)),i=A(e,Number.POSITIVE_INFINITY,1)[0],s=A({all:()=>e.all().filter(t=>!r.has(t.id)),undoneIds:()=>e.undoneIds(),epochs:()=>e.epochs()},Number.POSITIVE_INFINITY,1)[0];if(!(s===i||s!==void 0&&s>=o.seq))return`Cannot undo this publish: what was published before it is behind the undo horizon at op ${o.seq}, so readers could not be served it again. Publish through an earlier change instead.`};function L(e,n){let o;for(let r of[...e??[]].sort((i,s)=>i.seq-s.seq)){if(r.seq>n)break;r.declaration&&(o=r.declaration)}return o}var V=new WeakMap;function ie(e,n){let o=L(e?.declarations,n),r=e?.declarationAt,i=[...e?.declarations??[]].filter(a=>a.seq<=n).sort((a,d)=>a.seq-d.seq).at(-1);if(!r||!i||i.declaration)return{declaration:o};let s=V.get(r);s||V.set(r,s=new Map);let t=s.get(i.seq);if(!t){let a={settled:!0,declaration:void 0,waiting:Promise.resolve()};try{let d=r(i.seq);d instanceof Promise?(a.settled=!1,a.waiting=d.then(u=>void Object.assign(a,{settled:!0,declaration:u}),()=>void(a.settled=!0))):a.declaration=d}catch{}s.set(i.seq,t=a)}return t.settled?{declaration:t.declaration??o}:{waiting:t.waiting}}var U=e=>e,B=new WeakMap,C=new WeakMap;function H(e,n){let o=typeof n=="string"?Date.parse(n):n.getTime();if(Number.isNaN(o))throw new RangeError(`\u201C${String(n)}\u201D is not a time`);let i=e.log.all().findIndex(s=>Date.parse(s.at)>o);return i===-1?e.log.length:e.log.horizon+i}function I(e,n,o={}){let r=D(e);if(r){let c=typeof n=="number"?n:H(e,n);if(c>e.servedSeq)throw new RangeError(`No moment at seq ${c}: this seat is served through seq ${e.servedSeq}`);return I(r.store,c,o).seenBy(r.principal)}let i=e.log,s=i.horizon,t=typeof n=="number"?n:H(e,n);if(!Number.isInteger(t)||t<s||t>i.length)throw new RangeError(`No moment at seq ${t}: this store holds seqs ${s} to ${i.length}${s>0?"; what is before its horizon is in the archive":""}`);let a=i.all(),d=o.declaration,u=d?.schema??e.schema,l=i.epochs().filter(c=>c.seq<=t),p=l.at(-1),g=p?.seq??s,S=c=>c>s?a[c-1-s]?.id:void 0,m=(B.get(e)??[]).filter(c=>c.seq<=i.length&&S(c.seq)===c.id);B.set(e,m);let f=[...m].reverse().find(c=>c.seq>=g&&c.seq<=t),h=f?.seq??g,v=f?.base??p?.base??de(e),y=Y(e,u,v),k=e.pastEvery,q=(c,w)=>{m.some(x=>x.seq===c)||(m.push({seq:c,id:w,base:y.snapshot()}),m.sort((x,Q)=>x.seq-Q.seq))};for(let c=h;c<t;c++){let w=a[c-s];try{J(y,w)}catch{}(c+1)%k===0&&c+1<t&&q(c+1,w.id)}t-h>=k&&q(t,S(t));let M=a[t-1-s]?.at??p?.at;return W(e,d,{graph:y,log:a.slice(0,t-s),epochs:l,...s>0&&!l.some(c=>c.horizon)?{horizon:s}:{},seq:t,at:M,from:h})}var P=(e,n)=>n===void 0?{}:{[e]:n};function W(e,n,o){let r=U(e),i=e.constructor;return new i({schema:n?.schema??e.schema,invariants:n?.invariants??r.invariants,invariantOptions:r.invariantOptions,...P("policy",n?n.policy:e.policy),...P("modules",n?.modules??r.declaredModules),...P("enabledModules",r.startingModules),...P("timeZone",e.timeZone),intelligence:e.intelligence,principal:r.by,log:[...o.log],epochs:[...o.epochs],...P("horizon",o.horizon),snapshot:o.graph.snapshot(),validate:!1,now:r.now,past:{seq:o.seq,...P("at",o.at),foldedFrom:o.from,folded:o.seq-o.from}})}function Y(e,n,o){let r=e.graph.constructor;try{return r.from(n,o,{validate:U(e).validate})}catch{return r.from(n,o,{validate:!1})}}var E=256,_=new WeakMap;function j(e){let n=_.get(e);return n||_.set(e,n={ops:new Map,epochs:new Map,chunks:new Map,marks:new Map,keptFrom:0}),n}function G(e,n,o){let r=o?.kept?Date.parse(o.kept.since):Number.NaN;if(Number.isNaN(r))return-1;let i=u=>u!==void 0&&Date.parse(u)<=r,s=-1;for(let[u,l]of n.ops)u+1>s&&i(l.at)&&(s=u+1);let t=e.log.horizon,a=e.log.epochs().find(u=>u.seq===t);i(a?.at)&&(s=Math.max(s,t));let d=e.log.all();for(let u=0;u<d.length&&i(d[u].at);u++)s=Math.max(s,t+u+1);return s}function T(e,n,o,r=-1){let i=-1,s;for(let[u,l]of e.epochs)u<=n&&u>i&&([i,s]=[u,l.base]);for(let[u,l]of e.marks)u<=n&&u>i&&([i,s]=[u,l]);let t=-1;for(let u=n-1;u>=Math.max(i,0);u--)if(!e.ops.has(u)){t=u;break}if(t<0&&s)return{from:i,base:s};if(Math.max(t,0)<e.keptFrom)return{behindKept:!0};let a=t<0?0:t-t%E,d=e.chunks.get(a);return!d&&Math.min(a+E,o)<=r?{behindKept:!0}:!d||d.settled&&!d.refused&&t>=d.to?{ask:a}:d.settled?d.refused?{refused:d.refused}:t<0?{from:0,base:{nodes:[],edges:[]}}:{refused:`The archive is missing a change this moment needs (seq ${t})`}:{waiting:d.waiting}}function ae(e,n,o,r){let i=Math.min(o+E,r),s={to:i,settled:!1,waiting:Promise.resolve()};s.waiting=Promise.resolve().then(()=>n(o,i)).then(t=>{let a=Array.isArray(t)?{ops:t}:t;if(!Array.isArray(a?.ops))throw new Error("its answer held no ops");for(let d of a.ops)Number.isInteger(d?.seq)&&d.seq<r&&!e.ops.has(d.seq)&&e.ops.set(d.seq,d);for(let d of a.epochs??[])Number.isInteger(d?.seq)&&d.seq<r&&d.base&&e.epochs.set(d.seq,d);Number.isInteger(a.keptFrom)&&a.keptFrom>e.keptFrom&&(e.keptFrom=Math.min(a.keptFrom,r))}).then(()=>void(s.settled=!0),t=>void Object.assign(s,{settled:!0,refused:`Could not read the older changes from the archive: ${t instanceof Error?t.message:String(t)}`})),e.chunks.set(o,s)}function fe(e,n,o){let r=o?.archived,i=e.log.horizon;if(!r||n>=i)return;let s=j(r),t=G(e,s,o),a=T(s,n,i,t);return"ask"in a&&(ae(s,r,a.ask,i),a=T(s,n,i,t)),"base"in a||"ask"in a?void 0:{seq:n,...a}}function me(e,n){let o=n?.archived,r=e.log.horizon;if(!o||r===0)return;let i=j(o),s=G(e,i,n),t=Math.min(Math.max(i.keptFrom,s),r);return{stops:[...[...i.epochs.keys()].filter(d=>d<t).sort((d,u)=>d-u),...Array.from({length:r-t},(d,u)=>t+u)],from:t,through:s}}function Z(e,n,o,r){let i=D(e);if(i)return Z(i.store,n,o,r).seenBy(i.principal);if(!Number.isInteger(n)||n<0)throw new RangeError(`No moment at seq ${n}`);let s=j(o.archived),t=T(s,n,e.log.horizon,G(e,s,o));if(!("base"in t))throw new RangeError("refused"in t?t.refused:"behindKept"in t?`The moment at seq ${n} is before what the archive keeps`:`The changes before seq ${n} are still being read from the archive`);let a=Y(e,r?.schema??e.schema,t.base),d=[],u=e.pastEvery;for(let p=t.from;p<n;p++){let g=s.ops.get(p);d.push(g);try{J(a,g)}catch{}(p+1)%u===0&&p+1<n&&!s.marks.has(p+1)&&s.marks.set(p+1,a.snapshot())}n-t.from>=u&&s.marks.set(n,a.snapshot());let l=s.epochs.get(t.from);return W(e,r,{graph:a,log:d,epochs:l?[l]:[],...t.from>0?{horizon:t.from}:{},seq:n,at:d.at(-1)?.at??l?.at,from:t.from})}function de(e){let n=e.log.all(),o=e.log.horizon,r=n[0]?.id,i=C.get(e);if(i&&i.firstId===r)return i.base;let s=e.log.epochs().find(d=>d.seq>o),t=e.graph.constructor.from(e.schema,s?.base??e.graph.snapshot(),{validate:!1});for(let d=(s?.seq??e.log.length)-1;d>=o;d--)try{t.applyPrimitives(z(n[d-o]),{restoring:!0})}catch{}let a=t.snapshot();return C.set(e,{firstId:r,base:a}),a}function ge(e,n,o={}){let r=typeof n=="number"?n:H(e,n),i=ie(o,r),s="declaration"in i?i.declaration:L(o.declarations,r);return o.archived&&r<e.log.horizon?Z(e,r,o,s):I(e,r,{declaration:s})}function J(e,n){if(n.undoes!==void 0){e.applyPrimitives(n.primitives,{restoring:!0});return}try{e.applyPrimitives(n.primitives)}catch{e.applyPrimitives(n.primitives,{restoring:!0})}}export{L as a,ie as b,H as c,I as d,fe as e,me as f,ge as g};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as f}from"./chunk.MOAUE3N2.js";import"./chunk.KKQXGN5U.js";import"./chunk.G7HIAUEA.js";import"./chunk.GQHFLOTZ.js";import{l as g}from"./chunk.2XTCDFWU.js";import"./chunk.Q355UPFG.js";import"./chunk.PXQVXBNG.js";import"./chunk.XOTES3PI.js";import"./chunk.WGTBQHHE.js";import"./chunk.HF5SNUTK.js";import"./chunk.S7ZLGODY.js";import"./chunk.2QESVWUW.js";import"./chunk.UM5H2VVR.js";import"./chunk.WEGPDJTB.js";import"./chunk.MRYN42EQ.js";import"./chunk.E22DDEQI.js";import"./chunk.OLW44AP5.js";import"./chunk.F6P3WSMW.js";import"./chunk.YMRVKG6W.js";import"./chunk.BDBLGGFJ.js";import"./chunk.D3AISGQH.js";import"./chunk.IZ2ZTNEV.js";import"./chunk.6E36I2GC.js";import"./chunk.CJUIJ6TL.js";import"./chunk.IIESMHXY.js";import"./chunk.BJUUSIQY.js";import"./chunk.X2G4ZRB2.js";import"./chunk.UITZ74YJ.js";import"./chunk.XOZU4OFA.js";import"./chunk.MHILFBK6.js";import"./chunk.MB7LKKUD.js";import"./chunk.WVUJXDXZ.js";import"./chunk.Q6LLURRM.js";import"./chunk.AXXYJCSW.js";import"./chunk.N4LOI3YA.js";import"./chunk.RKZ4J3H2.js";import"./chunk.HKINU7VO.js";import"./chunk.YGZCESXY.js";import"./chunk.GZHZLJBF.js";import"./chunk.KHZA5F7A.js";import"./chunk.OJGHDWI6.js";import"./chunk.KSVJHSRH.js";import"./chunk.NSGQXCH6.js";import"./chunk.SZG6HJWH.js";import"./chunk.2FOIJ5ID.js";import"./chunk.6IUEGPCZ.js";import"./chunk.CUJX3IVA.js";import{G as b,T as h}from"./chunk.VNJKGSGZ.js";import"./chunk.SDO3U72B.js";import{Xd as n}from"./chunk.X3MMJ3QC.js";import"./chunk.FQLNBIQ5.js";import{b as t}from"./chunk.AJZBJBMO.js";var m=t(b(),1),a=t(h(),1);function P({store:c,auto:y,brand:i,views:u,presence:s,steering:r,overview:o,scope:d,titleLevel:w=2,quickAsk:l,props:e}){let v=(0,m.useMemo)(()=>g({scope:`.${d}`}),[d]);return(0,a.jsxs)("div",{"data-embed-content":"",style:y?{flex:"0 0 auto",background:"var(--graview-ground)"}:{flex:"1 1 auto",minHeight:0,overflow:"auto",background:"var(--graview-ground)"},children:[(0,a.jsx)("style",{children:v}),(0,a.jsx)("div",{"data-embed-measure":"",style:{display:"flow-root"},children:(0,a.jsx)(f,{context:{store:c,embedded:!0,...e.bar!==!1?{barAbove:!0}:{},...o?{overview:o}:{},titleLevel:w,views:u,settings:e.app.settings??[],app:e.app,...s?{presence:s}:{},...i?{brand:i}:{},...e.locale?{locale:e.locale}:{},...e.timeZone?{timeZone:e.timeZone}:{},...e.principal?{principal:e.principal}:{},...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{},...e.subscriptions?{subscriptions:e.subscriptions}:{},dismissals:e.dismissals,whileAway:e.whileAway,...e.signIn?{signIn:e.signIn}:{},...l!==void 0?{quickAsk:l}:{}},...e.pages?{registry:e.pages}:{},...r?{steering:r}:{},...e.routing==="address"?n(e.basePath)===""?{}:{basename:n(e.basePath)}:{initialPath:e.path??"/"},...e.path!==void 0?{path:e.path}:{},...e.hrefOf?{hrefOf:e.hrefOf}:e.routing==="address"?{}:{hrefOf:!1},...e.onNavigate?{onNavigate:e.onNavigate}:{}})})]})}export{P as PagesContent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as fn,c as pn,d as ie,e as un,f as ne,h as Se,i as Ae,n as mn,r as ae}from"./chunk.YGZCESXY.js";import{B as me,Ba as Ue,C as oe,Db as W,Ea as We,F as Ve,Ga as Je,Gb as tn,H as Ze,Ic as sn,J as qe,Jc as dn,K as Be,Ka as we,Kb as rn,Kc as xe,La as ve,Lc as cn,Mc as Re,Pb as on,Ra as Ye,Ua as Qe,_c as ln,b as $e,c as Ge,d as Pe,da as ke,e as V,ea as _e,eb as Xe,g as le,gb as en,h as F,i as Me,j as Fe,k as fe,l as Ne,lb as Oe,m as Ce,mb as nn,na as He,o as Ie,p as pe,q as he,v as Ke,x as re,xc as an,ya as be,z as ue}from"./chunk.X3MMJ3QC.js";function gn(e){if(typeof e=="string")return{form:"string",light:e};if(typeof e!="object"||e===null)return;let a=e,n=w=>typeof a[w]=="string"?a[w]:void 0,t=n("light")??n("src");if(t===void 0)return;let[i,f,u]=[n("dark"),n("alt"),n("darkFallback")];return{form:n("light")!==void 0?"light":"src",light:t,...i!==void 0?{dark:i}:{},...f!==void 0?{alt:f}:{},...u!==void 0?{darkFallback:u}:{}}}function Vn(e,a){let n=e.brand??{},t=n.ground,i=n.accent?Re(n.accent,t):void 0;t&&cn(i?.ok?i.schemes:xe(t),n.accent)&&(a.push(Ae("brand","brand.ground","words would not read on that page background, so the app keeps Graview's","pick a lighter ground for the light scheme, a darker one for the dark")),t=void 0,i=n.accent?Re(n.accent):void 0),i&&!i.ok&&a.push(Ae("brand","brand.accent",`that accent cannot make a readable brand, so the app keeps Graview's colors: ${i.why}`,"pick a color further from orange-red, or a darker one"));let f=gn(n.logo),u=n.name??e.name,w=n.typography?Object.fromEntries(Object.entries(n.typography).filter(([,z])=>typeof z=="string"&&dn(z)===null).map(([z,T])=>[z,sn(T)])):void 0;return{name:u,schemes:i?.ok?i.schemes:t?xe(t):an,...n.currency?{currency:n.currency}:{},...n.locale?{locale:n.locale}:{},...n.timeZone?{timeZone:n.timeZone}:{},...f?{logo:f.dark||f.darkFallback==="invert"?{light:f.light,...f.dark?{dark:f.dark}:{darkFallback:"invert"}}:f.light,logoAlt:f.alt??u}:{},...n.favicon?{favicon:n.favicon}:{},...e.description?{subtitle:e.description}:{},...n.subtitle===!1?{subtitleDrawn:!1}:{},...w?{typography:w}:{},...n.shape?{shape:n.shape}:{},...n.accents?{accents:n.accents}:{},...n.scheme?{scheme:n.scheme}:{}}}function yn(e){let{currency:a,locale:n,timeZone:t}=e.brand??{};return{...a?{currency:a}:{},...n?{locale:n}:{},...t?{timeZone:t}:{}}}var An=Symbol.for("@graview/core:typed-field"),hn=(e,a)=>(/^(phone|place|duration)$/.test(a)&&(oe(e)[An]=a),e),kn=/^(?=(?:\D*\d){3})\+?[\d ()./-]+(?: *(?:ext\.?|x|#) *\d+)?$/i;function bn(e){let a=F().check(V(300),ue(t=>We(t,e)!==void 0,`a record of ${e.kinds.join(" or ")} in ${e.address}, as "<kind>:<id>"`)),n=e.cardinality==="one"?a:pe(a).check(V(200));return Je(e.description?n.check(me(e.description)):n,e)}var zn=new WeakMap;function wn(e,a){zn.set(e,a)}var En=[{where:"settings[]",was:"honoured",now:"honored",since:"0.1.16"},{where:"pages",was:"overview",now:"scene",since:"0.1.17"}],Z=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function vn(e,a=En){if(!Z(e))return{document:e,respelled:[]};let n=[],t=e;for(let i of a)t=je(t,i.where.split("."),i,"",n);return{document:t,respelled:n}}function je(e,a,n,t,i){if(a.length===0){if(!Z(e)||!Object.hasOwn(e,n.was))return e;i.push(`${t}${n.was}`);let{[n.was]:G,...N}=e;return Object.hasOwn(e,n.now)?N:{...N,[n.now]:G}}if(!Z(e))return e;let[f,...u]=a,w=f.endsWith("[]"),z=w?f.slice(0,-2):f,T=e[z],B=T;if(!w)B=je(T,u,n,`${t}${z}.`,i);else if(Array.isArray(T)){let G=T.map((N,J)=>je(N,u,n,`${t}${z}.${J}.`,i));B=G.some((N,J)=>N!==T[J])?G:T}return B===T?e:{...e,[z]:B}}var On="graview-compiled@1";function Dn(e,a){return e.find(([n,t])=>n!==q&&"ref"in t&&(t.ref==="*"||t.ref.includes(a)))?.[0]}var q="id",ge=e=>typeof e=="string"&&/^\$[A-Za-z][A-Za-z0-9]*$/.test(e)?e.slice(1):void 0;function xn(e){let a=Object.entries(e.fields),n=t=>["name","title","label"].find(i=>t.some(([f])=>f===i))??t[0]?.[0];return n(a.filter(([,t])=>t.required&&(t.type==="string"||t.type==="text")))??n(a.filter(([,t])=>t.type==="string"))}function Rn(e,a,n){let t;switch(e.type){case"string":case"place":t=F().check(V(500));break;case"phone":t=F().check(V(40),le(kn,"a phone number"));break;case"text":t=F().check(V(2e4)),e.format&&(oe(t)[Symbol.for("@graview/core:markdown")]=1);break;case"number":case"integer":case"duration":{let f=e.min??(e.type==="duration"?0:void 0),u=[...e.type==="number"?[]:[Ne()],...f===void 0?[]:[Ge(f)],...e.max===void 0?[]:[$e(e.max)],...e.step===void 0?[]:[Pe(e.step)]];t=u.length>0?fe().check(...u):fe();break}case"boolean":t=Ce();break;case"date":t=F().check(le(Ze,"a date like 2026-10-02, or a month (2016-05) or a year (2006) alone"));break;case"datetime":t=F().check(ue(qe,"a date and time like 2026-10-02T14:30:00Z"));break;case"enum":t=Ke(e.options);break;case"list":t=pe(e.of==="number"?fe():e.of==="date"?F().check(le(Ve)):e.of==="image"||e.of==="video"||e.of==="file"?be(e.of):F().check(V(500))).check(V(200));break;case"image":case"video":case"file":t=be(e.type);break;case"app-link":t=Ue();break;case"url":t=Fe();break;case"email":t=Me();break}let i=e.type==="number"||e.type==="integer";return hn(t,i&&e.format==="duration"?"duration":e.type),e.collaborative!==void 0&&(e.type==="text"||e.type==="string")&&(oe(t)[Symbol.for("@graview/core:collaborative")]=e.collaborative?1:0),e.description&&(t=t.check(me(e.description))),i&&(e.format==="money"||e.format==="percent"||!e.format&&e.unit)&&rn(t,{...n,...e.format?{format:e.format}:{},...e.unit?{unit:e.unit}:{}}),a?re(t):t}var se=e=>{throw new W(`there is no record "${e}"`,"invalid")},Tn=(e,a)=>"field"in e?Rn(e.field,e.optional,a):"ref"in e?on(e.ref):re(Ie()),Ln=new WeakMap;var ze=(e,a)=>Z(a)&&Object.keys(e??{}).length===Object.keys(a).length&&Object.keys(e??{}).every(n=>Object.hasOwn(a,n));function mt(e,a={}){let n=Z(e)?e.format:void 0;if(n!==On)return{ok:!1,findings:[Se("compiled-format","format",n===void 0?"this is not a compiled Graview app":`this compiled app is ${JSON.stringify(n)}, and this build reads ${On}`,"compile the document instead")]};let t=e,i=vn(t.document).document,f=i===t.document?t:{...t,document:i},u=Z(i)&&typeof i.name=="string"&&Z(i.kinds)&&ze(i.kinds,f.kinds)&&ze(i.acts,f.acts)&&ze(i.rules,f.rules)&&Array.isArray(f.edges)&&Array.isArray(f.findings),w={ok:!1,findings:[Se("compiled-shape","","this compiled app's parts do not match its document","compile the document instead")]};if(!u)return w;try{return $n(f,a)}catch{return w}}function $n(e,a={}){let{document:n}=e,t=n.brand?.timeZone,i=a.today??(()=>Be(t)),f=new Map(e.edges.map(([y,o])=>[y,o])),u=new Map;for(let[y,o]of Object.entries(n.kinds)){let S=e.kinds[y]?.computed,x=ve(o.edges);u.set(y,{fields:new Set([...Object.keys(o.fields),...x.keys()]),edges:new Map(Object.entries(we(o.edges)).map(([L,E])=>[L,E.cardinality??"many"])),...S?{computed:new Map(S)}:{},...x.size>0?{linked:x}:{}})}e.facts&&u.set(pn,{computed:new Map(e.facts)});let w=yn(n),z=new Map,T=Object.entries(n.kinds).map(([y,o])=>{let S={};for(let[r,d]of Object.entries(o.fields))S[r]=Rn(d,!d.required,w),d.repeats&&(S[Ye(r)]=re(Qe()));for(let[r,d]of ve(o.edges))S[r]=re(bn(d));let{label:x,describe:L,durations:E}=e.kinds[y]??{},P=Object.entries(o.computed??{}).map(([r,d])=>[r,typeof d=="string"?{expr:d}:d]),Y=Object.hasOwn(o.fields,"label")&&!o.fields.label.label&&!/\{\s*label\b/.test(o.label??`{${xn(o)??""}}`),_=Object.fromEntries([...Y?[["label","Label"]]:[],...Object.entries(o.fields).filter(([,r])=>r.label).map(([r,d])=>[r,d.label]),...P.filter(([,r])=>r.label).map(([r,d])=>[r,d.label])]),A=Object.keys(_).length>0,h=Object.entries(o.fields).filter(([,r])=>r.type==="enum"&&r.optionLabels&&Object.keys(r.optionLabels).length>0),$=Object.fromEntries(h.map(([r,d])=>[r,R=>typeof R=="string"&&Object.hasOwn(d.optionLabels,R)?d.optionLabels[R]:ke(String(R))])),C=h.length>0,M=Object.fromEntries(Object.entries(o.fields).filter(([,r])=>r.default!==void 0).map(([r,d])=>[r,d.default]));z.set(y,M);let H=Object.fromEntries(Object.entries(we(o.edges)).map(([r,{renamedFrom:d,...R}])=>[r,R])),I=Object.entries(o.fields).flatMap(([r,d])=>d.aliases?[[r,d.aliases]]:[]),j=r=>o[r]?{[r]:o[r]}:{};return _e(y,{fields:he(S),edges:H,...j("plural"),...j("noun"),...j("aliases"),...I.length>0?{fieldAliases:Object.fromEntries(I)}:{},...j("description"),...x?{label:r=>ae(x,{node:r,kinds:u,today:i(),money:w})||r.id}:{},...L?{describe:r=>ae(L,{node:r,kinds:u,today:i(),money:w})}:{},...j("lifecycle"),...j("figure"),...j("fieldRoles"),...j("people"),archives:o.archives,...o.tidying?{tidying:o.tidying}:{},...P.length>0?{computed:Object.fromEntries(P.map(([r,d])=>[r,Gn(d,E?.includes(r)??!1,w)??o.computed[r]]))}:{},...A||C||o.glance||o.page?{display:{...A?{labels:_}:{},...C?{format:$}:{},...o.glance?{glance:[...o.glance]}:{},...o.page?{page:o.page}:{}}}:{},...Object.keys(M).length>0?{defaults:M}:{},...e.kinds[y]?.keptInStep?{keptInStep:e.kinds[y].keptInStep}:{}})}),B=Xe(T,n.computed);function G(y){return B.tryDefinition(y.kind)?.label?.(y)??y.id}let N=y=>({id:"",kind:y,...z.get(y)}),J=[];for(let[y,o]of Object.entries(n.acts??{})){let S=e.acts[y],{title:x,effects:L,guard:E,refusal:P,destructive:Y,idempotent:_,creates:A,connects:h,severs:$,writes:C,writesOther:M,sets:H}=S,I=new Map(S.args),j={};for(let[c,b]of I)j[c]=Tn(b,w);let r=[o.on??[]].flat(),d=new Map(S.exprs),R=L.find(c=>"create"in c),Q=(c,b,p,v=null)=>{if(Z(c)&&"expr"in c)return ne(d.get(c.expr),{graph:p,subject:v,kinds:u,bindings:b,today:i()});let k=ge(c);return k===void 0?typeof c=="string"&&c.startsWith("$$")?c.slice(1):c:k==="now"?new Date().toISOString():k==="today"?i():b[k]},Te=(c,b)=>{if(!R)return"";let p=n.kinds[R.create].fields,v=N(R.create),k=[];for(let[O,te]of Object.entries(R.set??{})){try{v[O]=Q(te,c,b)??v[O]}catch{}let X=ge(te);X&&c[X]!==void 0&&k.push(O)}let K=G(v).trim(),U=k.filter(O=>v[O]!==!1&&p[O].type!=="text"&&!(/[^]{41}/.test(v[O])||/ .*[.!?]$/.test(v[O])&&!/[ .][A-Z]\w{0,3}\.$/.test(v[O]))&&G({...v,[O]:void 0}).trim()===K).map(O=>v[O]===!0?p[O].label??ke(O):mn(v[O],p[O].format,i(),[],w));return K&&U.length>0?`${K} (${U.join(", ")})`:K};J.push(tn(y,{input:he(j),title:x,...o.description?{description:o.description}:{},...o.fromTheOtherEnd?{fromTheOtherEnd:o.fromTheOtherEnd}:{},...I.has(q)?{subject:{kinds:r.length>0?r:"*",arg:q}}:{},...Y?{destructive:!0}:{},..._?{idempotent:!0}:{},...A.length>0?{creates:A}:{},...h.length>0?{connects:h}:{},...$.length>0?{severs:$}:{},writes:C,...Object.keys(M).length>0?{writesOther:M}:{},...Object.keys(H).length>0?{sets:H}:{},...E?{allowedOn:(c,b)=>{let p=c.getNode(b);if(!p||r.length>0&&!r.includes(p.kind))return!1;try{return ne(E,{graph:c,subject:p,kinds:u,bindings:{},today:i()})===!0}catch{return!1}}}:{},describe:(c,b)=>{let p=typeof c[q]=="string"?b.getNode(c[q]):void 0,v=p?G(p):Te(c,b);return v?`${x}: ${v}`:x},apply(c,b){let p=c.graph,v=typeof b[q]=="string"?b[q]:void 0,k=v?p.getNode(v):void 0;if(v&&!k&&se(v),k&&r.length>0&&!r.includes(k.kind))throw new W(`"${x}" acts on ${r.join(" or ")}, not on ${He(k.kind)}`,"invalid");let K={};for(let[s,l]of Object.entries(b))l!==void 0&&(K[s]=l);if(E&&k){let s;try{s=ne(E,{graph:p,subject:k,kinds:u,bindings:K,today:i()})}catch(l){throw l instanceof ie?new W(`"${x}" could not be judged: ${l.sentence}`):l}if(s!==!0)throw new W(P?ae(P,{node:k,kinds:u,graph:p,bindings:K,today:i(),money:w}):`"${x}" is not allowed for ${G(k)} right now`)}let U=new Map,O=s=>p.has(s)||[...U.values()].includes(s),te=new Set,X=s=>{let l=en(s);te.has(l)||(te.add(l),c.removeEdge(s))},ee=(s,l)=>{let m=ge(s);if(m==="subject")return v;if(m==="me"){let g=c.me;if(g&&n.kinds[p.getNode(g)?.kind]?.people)return g;throw new W(`"${x}" is done as you, and you have no record here`)}if(U.has(m))return U.get(m);try{return Q(s,K,p,l??k??null)}catch(g){throw g instanceof ie?new W(`"${x}" could not work out a value: ${g.sentence}`):g}};for(let s of L)if("create"in s){let l=n.kinds[s.create],m=N(s.create);for(let[ce,Sn]of Object.entries(s.set??{})){let Le=ee(Sn,void 0);Le!==void 0&&(m[ce]=Le)}let g=xn(l),D=g!==void 0&&ln(n.policy?.sees,s.create,g),de=c.freshId(D?s.create:String((g&&m[g])??s.create),s.create);c.addNode({...m,id:de}),s.as&&U.set(s.as,de)}else if("connect"in s||"sever"in s){let l="connect"in s?s.connect:s.sever,m=String(ee(s.from,void 0)??""),g=String(ee(s.to,void 0)??"");if(O(m)||se(m),O(g)||se(g),"connect"in s){if(f.get(l)?.cardinality==="one")for(let D of p.out(m,l))D.id!==g&&X({kind:l,from:m,to:D.id});p.out(m,l).some(D=>D.id===g)||c.addEdge({kind:l,from:m,to:g})}else X({kind:l,from:m,to:g})}else if("set"in s){let l=String(ee(s.target??"$subject",void 0)??""),m=p.getNode(l);!m&&!O(l)&&se(l);let g={};for(let[D,de]of Object.entries(s.set)){let ce=ee(de,m);ce!==void 0&&(g[D]=ce)}Object.keys(g).length>0&&c.patchNode(l,g)}else if("remove"in s){let l=String(ee(s.remove,void 0)??"");p.has(l)||se(l),c.removeNode(l)}else if("replace"in s&&k){let l=b.to;for(let m of s.replace){let g=f.get(m)?.from.includes(k.kind)??!0;for(let D of g?p.out(k.id,m):p.in(k.id,m))m===s.keep&&D.id===l||X(g?{kind:m,from:k.id,to:D.id}:{kind:m,from:D.id,to:k.id})}}}}))}let Ee=[];for(let[y,o]of Object.entries(n.rules??{})){let{title:S,require:x,when:L,says:E}=e.rules[y],P=o.repairs??[],Y=(A,h,$=i(),C)=>{let M=[],H={graph:A,subject:h,kinds:u,today:$,...C?{linked:C}:{},onUnread:r=>M.push(r)},I;try{if(L&&ne(L,H)!==!0)return[];if(I=ne(x,H)===!0,!I&&M.length>0)throw new ie(`it reads ${fn(M[0])}`,0)}catch(r){throw r instanceof un?new nn(r.sentence):r instanceof ie?new Error(r.sentence):r}if(I)return[];let j=P.flatMap(r=>{let d=n.acts?.[r.act],R={},Q=h&&d?.on&&d.fromTheOtherEnd&&![d.on].flat().includes(h.kind)?Dn(e.acts[r.act].args,h.kind):void 0;Q?R[Q]=h.id:h&&(d?.on||/^(edit|remove|archive|unarchive|merge|skip|detach|split)-/.test(r.act))&&(R[q]=h.id);for(let[b,p]of Object.entries(r.args??{}))R[b]=ge(p)==="subject"?h?.id:p;let c=(d?e.acts[r.act].args:[]).filter(([b,p])=>p.required&&R[b]===void 0).map(([b])=>b);return[{mutation:r.act,label:r.label??(Q?d.fromTheOtherEnd:d?.title)??r.act.replace(/-/g," "),args:R,...c.length>0?{missing:c}:{}}]});return[{invariant:y,...h?{subjectId:h.id}:{},label:S,message:E?ae(E,{node:h,kinds:u,graph:A,today:$,money:w}):h?`${G(h)}: ${S}`:S,nodeIds:h?[h.id]:[],repairs:j}]},_={label:S,shape:{over:o.over,require:x,when:L,says:E,declared:n.kinds,money:w,kinds:u,today:i},judgment:{require:o.require,...o.when?{when:o.when}:{},...o.says?{says:o.says}:{}},...o.description?{description:o.description}:{},...P.length>0?{repairs:P.map(A=>A.act)}:{}};Ee.push(o.over==="graph"?Oe(y,{scope:"graph",..._,evaluate:({graph:A,today:h,context:$})=>Y(A,null,h,$?.linked)}):Oe(y,{scope:{kind:o.over},..._,evaluate:({graph:A,subject:h,today:$,context:C})=>Y(A,h,$,C?.linked)}))}let De=n.policy&&{...n.policy,...n.roles?{roles:n.roles}:{}},ye={name:n.name,schema:B,mutations:J,invariants:Ee,...De?{policy:De}:{},...e.brand?{brand:e.brand}:{},...n.modules?{modules:n.modules}:{},...n.lenses?{lenses:n.lenses}:{},...n.pages?{pages:n.pages}:{},...n.settings?{settings:n.settings}:{},...n.connections?{connections:n.connections}:{},...n.forms?{forms:n.forms}:{},...n.publishing?{publishing:n.publishing}:{},...n.purpose?{purpose:n.purpose}:{},...e.viewSpecs?{viewSpecs:e.viewSpecs}:{},...e.home?{home:e.home}:{},version:n.version??1};return wn(ye,n),Ln.set(ye,e),{ok:!0,app:ye,document:n,findings:e.findings,sights:n.policy?.sees,kinds:u}}function Gn(e,a,n){let t=a||e.format==="duration",i=e.format==="money"||e.format==="percent"||!e.format&&e.unit!==void 0;if(!(!t&&!i))return{...e,...t?{as:"duration"}:{},...i?{amount:{...n,...e.format?{format:e.format}:{},...e.unit?{unit:e.unit}:{}}}:{}}}export{vn as a,Vn as b,On as c,q as d,ge as e,xn as f,mt as g,$n as h};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}from"./chunk.NIFQDN6R.js";import"./chunk.G4JJXA63.js";import"./chunk.LDYOQCY7.js";import"./chunk.VFRURRNI.js";import"./chunk.2NJDT47T.js";import"./chunk.XOZU4OFA.js";import"./chunk.MHILFBK6.js";import"./chunk.ZFH4SCCF.js";import"./chunk.WVUJXDXZ.js";import"./chunk.Q6LLURRM.js";import"./chunk.AXXYJCSW.js";import"./chunk.N4LOI3YA.js";import"./chunk.RKZ4J3H2.js";import"./chunk.HKINU7VO.js";import"./chunk.YGZCESXY.js";import"./chunk.NSGQXCH6.js";import"./chunk.SZG6HJWH.js";import"./chunk.2FOIJ5ID.js";import"./chunk.X3MMJ3QC.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{i as draftAnswer,h as draftFromLens,b as draftSight,l as draftView,a as isDraftFailure,c as judgeLens,d as lensEditOf,f as lensFromSpec,j as recipeDraft,g as recipeOfLens,m as refineDraft,o as runDraftTool,e as takeBackEditOf,k as templateDraft,n as withReaderLenses};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{k as a,l as o}from"./chunk.HF5SNUTK.js";import"./chunk.S7ZLGODY.js";import"./chunk.2QESVWUW.js";import"./chunk.UM5H2VVR.js";import"./chunk.MRYN42EQ.js";import"./chunk.E22DDEQI.js";import"./chunk.OLW44AP5.js";import"./chunk.D3AISGQH.js";import"./chunk.IZ2ZTNEV.js";import"./chunk.6E36I2GC.js";import"./chunk.CJUIJ6TL.js";import"./chunk.IIESMHXY.js";import"./chunk.WVUJXDXZ.js";import"./chunk.Q6LLURRM.js";import"./chunk.AXXYJCSW.js";import"./chunk.N4LOI3YA.js";import"./chunk.RKZ4J3H2.js";import"./chunk.HKINU7VO.js";import"./chunk.YGZCESXY.js";import"./chunk.GZHZLJBF.js";import"./chunk.KHZA5F7A.js";import"./chunk.OJGHDWI6.js";import"./chunk.KSVJHSRH.js";import"./chunk.NSGQXCH6.js";import"./chunk.SZG6HJWH.js";import"./chunk.2FOIJ5ID.js";import"./chunk.6IUEGPCZ.js";import"./chunk.CUJX3IVA.js";import{ta as n}from"./chunk.VNJKGSGZ.js";import"./chunk.SDO3U72B.js";import"./chunk.X3MMJ3QC.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var w=new WeakMap;function p(e,i){let t=w.get(e);t||w.set(e,t=new Map);let r=t.get(i);return r||t.set(i,r=a(o(e,n(e)),e,i)),r}export{p as frameworkViews};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk.WVUJXDXZ.js";import{k as m,m as i}from"./chunk.Q6LLURRM.js";import"./chunk.AXXYJCSW.js";import"./chunk.N4LOI3YA.js";import"./chunk.RKZ4J3H2.js";import"./chunk.HKINU7VO.js";import"./chunk.YGZCESXY.js";import"./chunk.2FOIJ5ID.js";import"./chunk.X3MMJ3QC.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";function a(t){let r=new Map;return(s,o)=>{let e=o.kind,n=r.get(e);return n===void 0&&r.set(e,n=i(t,e).length),n===0?{}:m(t,s,o).values}}export{a as computedOn};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b}from"./chunk.4QWTSI7V.js";import"./chunk.CZH27V2R.js";import"./chunk.VFRURRNI.js";import"./chunk.X2G4ZRB2.js";import"./chunk.UITZ74YJ.js";import"./chunk.MHILFBK6.js";import"./chunk.Q6LLURRM.js";import"./chunk.AXXYJCSW.js";import"./chunk.N4LOI3YA.js";import"./chunk.RKZ4J3H2.js";import"./chunk.HKINU7VO.js";import"./chunk.YGZCESXY.js";import"./chunk.NSGQXCH6.js";import"./chunk.SZG6HJWH.js";import"./chunk.2FOIJ5ID.js";import"./chunk.X3MMJ3QC.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{b as actOnSeveral,a as actsForSeveral};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j,k}from"./chunk.CZH27V2R.js";import"./chunk.VFRURRNI.js";import"./chunk.MHILFBK6.js";import"./chunk.Q6LLURRM.js";import"./chunk.AXXYJCSW.js";import"./chunk.N4LOI3YA.js";import"./chunk.RKZ4J3H2.js";import"./chunk.HKINU7VO.js";import"./chunk.YGZCESXY.js";import"./chunk.SZG6HJWH.js";import"./chunk.2FOIJ5ID.js";import"./chunk.X3MMJ3QC.js";import"./chunk.FQLNBIQ5.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 +0,0 @@
|
|
|
1
|
-
import{a,b}from"./chunk.ZUKYMU6C.js";import"./chunk.XOTES3PI.js";import"./chunk.WGTBQHHE.js";import"./chunk.P52UTBNO.js";import"./chunk.HF5SNUTK.js";import"./chunk.S7ZLGODY.js";import"./chunk.2QESVWUW.js";import"./chunk.UM5H2VVR.js";import"./chunk.WEGPDJTB.js";import"./chunk.MRYN42EQ.js";import"./chunk.E22DDEQI.js";import"./chunk.OLW44AP5.js";import"./chunk.HJCQ6I3S.js";import"./chunk.ATVPAYS6.js";import"./chunk.VNBEAF62.js";import"./chunk.CZH27V2R.js";import"./chunk.D3AISGQH.js";import"./chunk.IZ2ZTNEV.js";import"./chunk.6E36I2GC.js";import"./chunk.CJUIJ6TL.js";import"./chunk.IIESMHXY.js";import"./chunk.LDYOQCY7.js";import"./chunk.VFRURRNI.js";import"./chunk.X2G4ZRB2.js";import"./chunk.UITZ74YJ.js";import"./chunk.MHILFBK6.js";import"./chunk.ZFH4SCCF.js";import"./chunk.WVUJXDXZ.js";import"./chunk.Q6LLURRM.js";import"./chunk.AXXYJCSW.js";import"./chunk.N4LOI3YA.js";import"./chunk.RKZ4J3H2.js";import"./chunk.HKINU7VO.js";import"./chunk.YGZCESXY.js";import"./chunk.GZHZLJBF.js";import"./chunk.KHZA5F7A.js";import"./chunk.OJGHDWI6.js";import"./chunk.KSVJHSRH.js";import"./chunk.NSGQXCH6.js";import"./chunk.SZG6HJWH.js";import"./chunk.2FOIJ5ID.js";import"./chunk.6IUEGPCZ.js";import"./chunk.CUJX3IVA.js";import"./chunk.VNJKGSGZ.js";import"./chunk.SDO3U72B.js";import"./chunk.X3MMJ3QC.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{b as declaredLensView,a as formatFor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as Ee,b as Ve,c as qe,d as me,e as R,f as ge,h as Be}from"./chunk.PCVPH5KM.js";import{h as Ze,i as We,j as Ye}from"./chunk.N4LOI3YA.js";import{a as re,b as ae,c as J,d as Ue,e as X,g as oe,h as He}from"./chunk.HKINU7VO.js";import{c as Ce,h as z,i as Le,j as ue}from"./chunk.YGZCESXY.js";import{A as De,Ca as Ne,Db as bn,Ja as Te,Ka as te,La as pe,Ub as Me,Vb as fe,Wb as Ke,Xb as _e,Yb as Ie,b as W,c as U,e as de,f as Re,g as K,h as S,k as G,l as ee,m as _,n as Fe,nc as Pe,o as Z,oc as Ge,p as N,r as w,s as ne,t as x,u as A,v as V,w as I,x as t,y as T,z as Y}from"./chunk.X3MMJ3QC.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var ze=e=>Object.entries(e).map(([o,s])=>[o,Object.keys(te(s?.edges))]),ye=(e,o)=>Ke(e,ze(o));function Je(e){return[...Object.keys(e.acts??{}),...Object.keys(e.kinds).flatMap(o=>Me(o)),..._e(ze(e.kinds))]}var B=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function Xe(e){if(!B(e)||!B(e.kinds))return e;let o;try{let f=Object.fromEntries(Object.entries(e.kinds).map(([g,a])=>[g,B(a)&&B(a.edges)?{edges:a.edges}:{}]));o=Je({acts:B(e.acts)?e.acts:{},kinds:f})}catch{return e}let s=new Set(o),n=!1,r=f=>{if(typeof f!="string"||s.has(f))return f;let g=Pe(f,o);return g===void 0?f:(n=!0,g)},l=B(e.policy)&&Array.isArray(e.policy.grants)?{...e.policy,grants:e.policy.grants.map(f=>B(f)&&Array.isArray(f.mutations)?{...f,mutations:f.mutations.map(r)}:f)}:void 0,u=B(e.rules)?Object.fromEntries(Object.entries(e.rules).map(([f,g])=>[f,B(g)&&Array.isArray(g.repairs)?{...g,repairs:g.repairs.map(a=>B(a)?{...a,act:r(a.act)}:a)}:g])):void 0;return n?{...e,...l?{policy:l}:{},...u?{rules:u}:{}}:e}function he(e,o){let s=Ge(e,Je(o));return s&&s!==e?`did you mean "${s}"?`:void 0}var $e="graview-document",we=1,Se=256*1024,se=64*1024,ke=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,be=/^[a-z][A-Za-z0-9]*$/,$n=/^[a-z0-9\u00df-\u00ff'-]+( [a-z0-9\u00df-\u00ff'-]+){0,2}$/,Qe=12,wn=new Set(["id","kind"]),Sn=/^(?:[a-z][a-z0-9]*(?:-[a-z0-9]+)*|[a-z][A-Za-z0-9]*)$/,On=["string","text","number","integer","boolean","date","datetime","enum","list","url","email","image","video","file","app-link","phone","place","duration"];function jn(){let e=$=>$ in Object.prototype,o=Y($=>!e($),"every object already has this name \u2014 choose another"),s=($,L)=>[...$===void 0?[]:[Re($)],...L===void 0?[]:[de(L)]],n=($,L)=>S().check(...s($,L)),r=($,L,Q)=>N($).check(...s(L,Q)),l=$=>S().check(K(ke,`${$} names are kebab-case, lower-case words joined by hyphens like "tool-note" (field and relation names are camelCase, like "supersededBy")`)),u=S().check(K(Sn,'relation names are one camelCase word, like "supersededBy" (kind names are kebab-case, like "tool-note")'),o),f=S().check(K(be,'field names are one word or camelCase, like "dueDate", so rules say them bare (kind names are kebab-case, like "tool-note")'),Y($=>!wn.has($),'a field cannot be called "id" or "kind" \u2014 the framework keeps those; try "type" or "category"'),o),g=n(1,500),a=S().check(de(40),K($n,'an alias is up to three lower-case words, like "supplier"')),i=n(1,2e3),d=n(1,300),h=w({type:V(On),required:t(_()),description:t(g),label:t(n(1,60)),aliases:t(r(a,1,Qe)),options:t(r(n(1,80),1,100)),optionLabels:t(A(n(1,80),n(1,80))),of:t(V(["string","number","date","image","video","file"])),default:t(Z()),unit:t(n(void 0,12)),format:t(V(["money","percent","duration","markdown"])),min:t(G()),max:t(G()),step:t(G()),renamedFrom:t(S().check(K(be))),repeats:t(_()),collaborative:t(_())}).check(De(($,L)=>{$.type==="enum"&&!$.options&&L.addIssue({code:"custom",message:'an enum field lists its "options"',path:["options"]}),$.type!=="enum"&&$.options&&L.addIssue({code:"custom",message:'"options" belongs only on an enum field',path:["options"]});for(let Q of Object.keys($.optionLabels??{}))$.options?.includes(Q)||L.addIssue({code:"custom",message:`"${Q}" is labeled, and is none of the field's options`,path:["optionLabels",Q]});$.type!=="list"&&$.of&&L.addIssue({code:"custom",message:'"of" belongs only on a list field',path:["of"]}),$.repeats&&$.type!=="date"&&$.type!=="datetime"&&L.addIssue({code:"custom",message:'"repeats" belongs only on a date or datetime field',path:["repeats"]})})),m=S().check(K(new RegExp(`${ke.source}|${Ne.source}`),'a relation goes to a kind of this document, like "house", or of another app, like "@nick/house/house"')),p=w({to:x([r(m,1),I("*")]),cardinality:t(V(["one","many"])),description:t(g),inverse:t(n(1,80)),appendOnly:t(_()),renamedFrom:t(S()),tidying:t(I("never"))}),c=x([i,w({expr:i,label:t(n(1,60)),description:t(g),format:t(V(["money","percent","duration"])),unit:t(n(1,12)),hidden:t(_())})]),j=w({noun:t(n(1,40)),plural:t(n(1,40)),aliases:t(r(a,1,Qe)),description:t(g),fields:A(f,h).check(Y($=>Object.keys($).length>0,"a kind has at least one field")),label:t(d),describe:t(d),lifecycle:t(w({field:f,retired:r(x([S(),G(),_()]),1)})),figure:t(n(void 0,2e4)),glance:t(r(f,1,20)),page:t(w({fields:t(r(f,1,40)),groups:t(r(w({title:n(1,60),fields:r(f,1,40)}),1,12))})),edges:t(A(u,p)),computed:t(A(S(),c).check(Y($=>Object.keys($).length<=20,"a kind works out at most 20 computed fields"))),fieldRoles:t(A(S(),S())),renamedFrom:t(S().check(K(ke))),people:t(_()),archives:t(I(!1)),tidying:t(V(["never","no-links"]))}),k=x([S(),G(),_(),Fe(),N(Z()),w({expr:i})]),O=S().check(K(/^\$[A-Za-z][A-Za-z0-9]*$/,'a reference is "$" and a name, like "$subject" or "$new"')),E=x([w({create:l("kind"),as:t(S().check(K(be))),set:t(A(f,k))}),w({set:A(f,k),target:t(O)}),w({connect:u,from:O,to:O}),w({sever:u,from:O,to:O}),w({remove:O})]),b=w({title:t(n(1,80)),description:t(g),fromTheOtherEnd:t(n(1,80)),on:t(x([l("kind"),r(l("kind"),1)])),creates:t(l("kind")),sets:t(A(f,k)),writes:t(r(f,1)),connects:t(u),severs:t(u),setsOther:t(A(f,k)),replaces:t(x([I(!0),r(u,1,10)])),removes:t(I(!0)),args:t(A(f,h)),effects:t(r(E,1,20)),allowedWhen:t(i),refusal:t(d),destructive:t(_())}),F=w({act:l("act"),label:t(n(1,80)),args:t(A(S(),k))}),M=w({title:t(n(1,120)),description:t(g),over:x([I("graph"),l("kind")]),when:t(i),require:i,says:t(d),repairs:t(r(F,void 0,10))}),C=w({roles:x([r(l("role"),1),I("*")]),mutations:x([r(l("act"),1),I("*")]),kinds:t(x([N(l("kind")),I("*")])),describe:t(g),self:t(_()),ownEnd:t(_())}),y=t(r(l("field"),1)),v=w({roles:x([r(l("role"),1),I("*")]),kinds:r(l("kind"),1),own:t(_()),via:t(u),fields:y,hide:y}),D=w({grants:N(C),sees:t(N(v))}),ie=w({accent:t(S().check(K(/^#[0-9a-fA-F]{6}$/,'an accent is a color like "#c2577a"'))),ground:t(x([S().check(K(/^#[0-9a-fA-F]{6}$/,'a ground is a color like "#eef3f8"')),w({light:t(S().check(K(/^#[0-9a-fA-F]{6}$/,'a ground is a color like "#eef3f8"'))),dark:t(S().check(K(/^#[0-9a-fA-F]{6}$/,'a ground is a color like "#101826"')))})])),name:t(n(1,60)),currency:t(S().check(K(/^[A-Z]{3}$/,'a currency is its three-letter code, like "USD" or "EUR"'))),locale:t(n(2,35)),timeZone:t(n(1,64)),logo:t(x([n(1,se),w({src:n(1,se),alt:t(n(1,120))}),w({light:n(1,se),dark:t(n(1,se)),alt:t(n(1,120)),darkFallback:t(I("invert"))})])),favicon:t(x([n(1,se),w({emoji:S()})])),typography:t(w({display:t(n(1,200)),body:t(n(1,200)),mono:t(n(1,200))})),shape:t(w({radius:t(G().check(U(0),W(32))),density:t(G().check(U(.75),W(1.5)))})),accents:t(A(S(),G().check(U(0),W(360)))),scheme:t(V(["light","dark","auto"])),subtitle:t(I(!1))}),q=A(S(),Z()),H=x([n(1,120),w({by:n(1,120),direction:t(V(["asc","desc"]))})]),xe=G().check(ee(),U(1),W(9999)),mn=ne({create:t(_()),options:t(ne({sort:t(H),columnSort:t(H),search:t(r(n(1,120),void 0,40)),filters:t(r(n(1,120),void 0,40)),horizon:t(x([G().check(ee(),U(1),W(200)),ne({years:G().check(ee(),U(1),W(200)),title:n(1,80),from:t(xe),to:t(xe)})]))}))}),gn=w({card:t(N(Z())),row:t(N(Z())),page:t(N(Z()))}),zn=()=>{let $=t(V(["asc","desc"]));return x([n(1,120),w({by:n(1,120),direction:$,then:t(x([n(1,120),w({by:n(1,120),direction:$})]))})])},yn=()=>x([n(1,120),w({by:n(1,120),order:t(r(n(1,80),void 0,40)),closed:t(r(n(1,80),void 0,40))})]),Ae=ne({order:t(N(S())),hide:t(N(S())),first:t(S()),primary:t(r(n(1,80),void 0,40)),scene:t(n(1,40)),pages:t(n(1,40)),lists:t(A(S(),w({filters:t(r(n(1,120),void 0,40)),sort:t(zn()),group:t(yn()),export:t(_())})))}),hn=w({act:l("act"),title:t(n(1,80)),intro:t(g),fields:t(r(f,1,40)),say:t(g),submit:t(n(1,80)),role:t(l("role"))}),kn=w({$schema:t(S()),format:I($e),formatVersion:I(we),name:n(1,80),description:t(g),version:t(G().check(ee(),U(1))),kinds:A(l("kind"),j).check(Y($=>Object.keys($).length>0,"a document declares at least one kind"),Y($=>Object.keys($).length<=40,"a document declares at most 40 kinds")),computed:t(A(S(),c)),acts:t(A(l("act"),b)),rules:t(A(l("rule"),M)),roles:t(N(l("role"))),policy:t(D),modules:t(q),lenses:t(N(mn)),pages:t(Ae),views:t(A(S(),x([gn,N(Z())]))),brand:t(ie),settings:t(N(q)),migrations:t(N(q)),connections:t(A(l("connection"),q)),purpose:t(q),forms:t(A(l("form"),hn)),publishing:t(w({mode:V(["live","on-publish"]),working:r(l("role"),void 0,40),publishers:t(r(l("role"),1,40))}))});return{FieldSpec:h,EdgeSpec:p,ComputedSpec:c,KindSpec:j,ValueSpec:k,EffectSpec:E,ActSpec:b,RepairSpec:F,RuleSpec:M,GrantSpec:C,SightSpec:v,PolicySpec:D,BrandSpec:ie,PagesSpec:Ae,DocumentSpec:kn}}var vn,P=()=>vn??=jn(),Un=T(()=>P().FieldSpec),Zn=T(()=>P().EdgeSpec),Wn=T(()=>P().ComputedSpec),Yn=T(()=>P().KindSpec),Hn=T(()=>P().ValueSpec),Jn=T(()=>P().EffectSpec),Xn=T(()=>P().ActSpec),Qn=T(()=>P().RepairSpec),et=T(()=>P().RuleSpec),nt=T(()=>P().GrantSpec),tt=T(()=>P().SightSpec),ot=T(()=>P().PolicySpec),st=T(()=>P().BrandSpec),it=T(()=>P().PagesSpec),en=T(()=>P().DocumentSpec);var xn={};function nn(e,o=xn,s=we){let{document:n,respelled:r}=Ee(e),l=r.length>0?{respelled:r}:{};if(!n||typeof n!="object"||Array.isArray(n))return{document:n};let u=n;if(u.format!==$e||typeof u.formatVersion!="number"||u.formatVersion>=s)return{document:n,...l};let f=u.formatVersion,g=structuredClone(u);for(let a=f;a<s;a++){let i=o[a];if(!i)throw new Error(`there is no upgrade from format ${a} to ${a+1}`);g={...i(g),formatVersion:a+1}}return{document:g,from:f,...l}}function tn(e,o,s){let n=Object.keys(e).filter(f=>e[f].edges?.[o]!==void 0);if(n.length===0)return;let r=n.map(f=>e[f].edges[o].to),l=r.some(f=>f==="*")?"*":[...new Set(r.flatMap(f=>f))];if(s.length===0||s.some(f=>n.includes(f)))return{reversed:!1,kinds:l};let u=n.filter(f=>{let g=e[f].edges[o].to;return g==="*"||s.every(a=>g.includes(a))});return u.length>0?{reversed:!0,kinds:u}:{reversed:!1,kinds:l}}var rn=(e,o)=>{let s=e?.fields[o];return s!==void 0&&(s.type==="duration"||(s.type==="number"||s.type==="integer")&&s.format==="duration")};function on(e,o,s,n){if(n==="out"){let r=e[o]?.edges?.[s]?.to;return r===void 0?[]:r==="*"?Object.keys(e):r}return Object.entries(e).filter(([,r])=>{let l=r.edges?.[s]?.to;return l!==void 0&&(l==="*"||l.includes(o))}).map(([r])=>r)}function Oe(e,o,s){if(s.t==="ident")return e[o]?.edges?.[s.name]?on(e,o,s.name,"out"):void 0;if(s.t==="where")return Oe(e,o,s.set);if(s.t==="call"&&(s.fn==="out"||s.fn==="in")&&s.args[0]?.t==="lit"&&typeof s.args[0].value=="string")return on(e,o,s.args[0].value,s.fn)}var sn=(e,o,s)=>{let n=o.filter(r=>e[r]?.fields[s]!==void 0);return n.length>0&&n.every(r=>rn(e[r],s))};function an(e,o,s){let n=e.kinds,r=n[o],l=new Map(s),u=new Map,f=(a,i)=>{if(i>8)return!1;switch(a.t){case"ident":return rn(r,a.name)||g(a.name,i+1);case"member":{let d=Oe(n,o,a.object);return d!==void 0&&sn(n,d,a.name)}case"call":{if(a.fn!=="sum"&&a.fn!=="min"&&a.fn!=="max")return!1;let[d,h]=a.args,m=d&&Oe(n,o,d);return m!==void 0&&h?.t==="ident"&&sn(n,m,h.name)}case"binary":return(a.op==="+"||a.op==="-")&&f(a.left,i)&&f(a.right,i);case"unary":return a.op==="-"&&f(a.operand,i);default:return!1}},g=(a,i)=>{if(r?.computed?.[a]===void 0)return!1;if(u.has(a))return u.get(a);u.set(a,!1);let d=l.get(a),h=d!==void 0&&f(d,i);return u.set(a,h),h};return s.map(([a])=>a).filter(a=>g(a,0))}var An={title:["string","text"],rich_text:["string","text"],number:["number","integer"],select:["enum","string"],status:["enum","string"],multi_select:["list"],date:["date","datetime"],checkbox:["boolean"],url:["url","string"],email:["email","string"],phone_number:["phone","string"],people:["string","text","list"]};var cn=new Set(Object.values(An).flat());function ln(e,o){let s=new Map;if(!e||typeof e!="object")return new Map;for(let n of Object.values(e)){if(!n||typeof n!="object"||typeof n.kind!="string")continue;let r=o[n.kind]?.fields;if(!r)continue;let l=[];n.system==="google-calendar"&&n.fields&&typeof n.fields=="object"?l=Object.values(n.fields).filter(f=>typeof f=="string"):n.system==="notion"&&(l=n.properties&&typeof n.properties=="object"?Object.keys(n.properties):Object.keys(r).filter(f=>cn.has(r[f].type)));let u=s.get(n.kind)??new Set;for(let f of l)Object.hasOwn(r,f)&&u.add(f);s.set(n.kind,u)}return new Map([...s].filter(([,n])=>n.size>0).map(([n,r])=>[n,Object.keys(o[n].fields).filter(l=>r.has(l))]))}function dn(e,o,s=`kinds.${e}.page`){let n=o.page;if(!n)return[];let r=[],l=[...Object.keys(o.fields),...Object.keys(o.computed??{})],u=new Set,f=(a,i)=>{l.includes(a)?u.has(a)&&r.push(z("page-field-twice",i,`"${a}" is on ${e}'s page twice; name each field once`)):r.push(z("page-field",i,`${e}'s page is to show "${a}", and ${e} has no field or computed field called that`,`use one of: ${l.join(", ")}`)),u.add(a)};(n.fields??[]).forEach((a,i)=>f(a,`${s}.fields.${i}`));let g=new Set;return(n.groups??[]).forEach((a,i)=>{let d=a.title.trim().toLowerCase();g.has(d)&&r.push(z("page-group-twice",`${s}.groups.${i}.title`,`${e}'s page has two groups called "${a.title}"; give each its own title`)),g.add(d),a.fields.forEach((h,m)=>f(h,`${s}.groups.${i}.fields.${m}`))}),r}function pn(e,o=[]){return Ie({declared:Object.keys(e.fields),paged:[...e.page?.fields??[],...(e.page?.groups??[]).flatMap(s=>s.fields)],must:s=>!!e.fields[s].required&&e.fields[s].default===void 0,naming:o})}var En=new Set(["subject","now","today","me"]);function Rn(e){if((typeof e=="string"?e:JSON.stringify(e??null)).length>Se)return{findings:[z("too-large","",`a document may be at most ${Se/1024} KB`)]};if(typeof e=="string")try{e=JSON.parse(e)}catch(n){return{findings:[z("not-json","",`this is not JSON: ${n.message}`)]}}try{e=nn(e).document}catch(n){return{findings:[z("format","formatVersion",n.message)]}}e=Xe(e);let o=en.safeParse(e);if(!o.success)return{findings:o.error.issues.map(n=>{let r=n.path.map(String).join(".");if(n.code==="unrecognized_keys")return z("unknown-key",r,`${n.keys.map(l=>`"${l}"`).join(", ")} ${n.keys.length===1?"is":"are"} not part of a Graview document here`,"check the spelling against docs/declaration-document.md");if(n.code==="invalid_union"&&/\.effects\.\d+$/.test(r))return z("effect-shape",r,"this effect is not one Graview knows",'an effect is one of {"create": kind, "as"?: name, "set"?: {field: value}}, {"set": {field: value, \u2026}, "target"?: "$ref"}, {"connect"|"sever": relation, "from": "$ref", "to": "$ref"}, {"remove": "$ref"}');if(n.code==="invalid_key"){let l=n.issues?.[0]?.message;return z("shape",r,`the name "${String(n.path.at(-1))}" is not allowed here${l?`: ${l}`:""}`)}return z("shape",r,n.message)})};let s=o.data;return{document:s,findings:Fn(s)}}var le=e=>[e??[]].flat();function fn(e){let o=new Map;for(let[s,n]of Object.entries(e.kinds))for(let[r,l]of Object.entries(te(n.edges))){let u=o.get(r);o.set(r,{name:r,from:[...u?.from??[],s],to:l.to==="*"||u?.to==="*"?"*":[...new Set([...u?.to??[],...l.to])],cardinality:l.cardinality??"many"})}return o}function It(e){let o=new Map;for(let[n,r]of Object.entries(e.kinds)){let l=oe(r),u=pe(r.edges);o.set(n,{fields:new Set([...Object.keys(r.fields),...u.keys()]),edges:new Map(Object.entries(te(r.edges)).map(([f,g])=>[f,g.cardinality??"many"])),...l?{computed:l}:{},...u.size>0?{linked:u}:{}})}let s=oe(e);return s&&o.set(Ce,{computed:s}),o}function un(e,o){let s=[],n=le(e.on),r=(l,u)=>{let f=tn(o.kinds,l,n)?.reversed===!0,[g,a]=f?["$to","$subject"]:["$subject","$to"];return u==="connect"?{connect:l,from:g,to:a}:{sever:l,from:g,to:a}};if(e.creates){let l=o.kinds[e.creates],u={};for(let f of Object.keys(l?.fields??{}))u[f]=`$${f}`;for(let f of e.effects??[])"set"in f&&!("create"in f)&&R(f.target)==="new"&&Object.assign(u,f.set);s.push({create:e.creates,as:"new",set:u})}return e.sets&&s.push({set:e.sets}),e.writes&&!(e.creates&&e.on===void 0)&&s.push({set:Object.fromEntries(e.writes.map(l=>[l,`$${l}`]))}),e.connects&&(e.replaces&&s.push({replace:e.replaces===!0?[e.connects]:[...e.replaces],keep:e.connects}),s.push(r(e.connects,"connect"))),e.severs&&s.push(r(e.severs,"sever")),e.setsOther&&(e.connects||e.severs)&&s.push({set:e.setsOther,target:"$to"}),e.removes&&s.push({remove:"$subject"}),e.effects&&s.push(...e.effects.filter(l=>!(e.creates&&"set"in l&&!("create"in l)&&R(l.target)==="new"))),s}function je(e,o,s){try{let n=J(e),r=re(n);for(let l of r.unknownFunctions)s.push(z("unknown-function",o,`"${l}" is not a function the rule language knows`,"see docs/declaration-document.md#expression-language"));return n}catch(n){if(n instanceof ae){s.push(z("expression",o,n.sentence+` (at character ${n.at+1})`));return}throw n}}function ve(e,o,s){try{return X(e)}catch(n){if(n instanceof Ue||n instanceof ae){s.push(z("template",o,(n instanceof ae,n.sentence)));return}throw n}}function Fn(e){let o=[],s=new Set(Object.keys(e.kinds)),n=fn(e),r=e.acts??{},l=new Set(e.roles??[]),u=(a,i)=>pe(e.kinds[a]?.edges).has(i),f=a=>Object.keys(e.kinds).some(i=>u(i,a));for(let[a,i]of Object.entries(e.kinds)){let d=`kinds.${a}`;for(let[m,p]of Object.entries(i.edges??{})){if(!Te(p)&&p.to!=="*")for(let c of p.to)s.has(c)||o.push(z("edge-target",`${d}.edges.${m}.to`,`"${c}" is not a kind this document declares`));i.fields[m]&&o.push(z("edge-field-clash",`${d}.edges.${m}`,`"${m}" is both a field and a relation of ${a}`,"rename one of them"))}i.lifecycle&&!i.fields[i.lifecycle.field]&&o.push(z("lifecycle-field",`${d}.lifecycle.field`,`${a} has no field "${i.lifecycle.field}"`));let h=m=>i.computed!==void 0&&Object.hasOwn(i.computed,m);for(let m of i.glance??[])!i.fields[m]&&!h(m)&&o.push(z("glance-field",`${d}.glance`,`a glance at ${a} is to say "${m}", and ${a} has no field or computed field called that`,`use one of: ${[...Object.keys(i.fields),...Object.keys(i.computed??{})].join(", ")}`));o.push(...dn(a,i));for(let m of["label","describe"]){let p=i[m];if(!p)continue;let c=ve(p,`${d}.${m}`,o);for(let j of c??[])if(j.expr){for(let k of re(j.expr).names)if(!i.fields[k]){if(h(k)){He(i,k)||o.push(z("template-field",`${d}.${m}`,`${a}'s ${k} is worked out from beyond the record, and a ${m} is said with no graph to read`,`show it in a view instead, or name a computed field worked out from ${a}'s own fields`));continue}o.push(z("template-field",`${d}.${m}`,`${a} has no field "${k}" for its ${m} to show`,m==="label"?"a label can only show the record's own fields and what they work out":void 0))}}}for(let[m,p]of Object.entries(i.fields)){p.default!==void 0&&p.type==="enum"&&!p.options?.includes(String(p.default))&&o.push(z("default-option",`${d}.fields.${m}.default`,`"${String(p.default)}" is not one of ${m}'s options`));let c=`${m}Repeat`;p.repeats&&(i.fields[c]||i.edges?.[c]||i.computed?.[c])&&o.push(z("repeat-clash",`${d}.fields.${m}.repeats`,`${a} already has "${c}", where how ${m} repeats is kept`))}}for(let[a,i]of Object.entries(r)){let d=`acts.${a}`;for(let c of le(i.on))s.has(c)||o.push(z("act-kind",`${d}.on`,`"${c}" is not a kind this document declares`));let h=le(i.on),m=un(i,e);if(i.creates&&i.on===void 0&&i.writes&&s.has(i.creates)){for(let c of i.writes)if(!e.kinds[i.creates].fields[c])if(e.kinds[i.creates].computed?.[c]!==void 0)o.push(z("computed-written",`${d}.writes`,`${i.creates}'s ${c} is worked out, not written: no act can set it`,"write the stored fields it is worked out from"));else{if(u(i.creates,c))continue;o.push(z("act-field",`${d}.writes`,`${i.creates} has no field "${c}"`))}}m.length===0&&o.push(z("act-empty",d,`"${a}" does nothing`,"give it effects or a shorthand such as sets or creates"));let p=new Map;m.forEach((c,j)=>{let k=m.length-(i.effects?.length??0),O=i.effects&&j>=k?`${d}.effects.${j-k}`:d;if("create"in c){if(!s.has(c.create))o.push(z("act-kind",`${O}.create`,`"${c.create}" is not a kind this document declares`));else for(let b of Object.keys(c.set??{}))e.kinds[c.create].fields[b]||(e.kinds[c.create].computed?.[b]!==void 0?o.push(z("computed-written",`${O}.set.${b}`,`${c.create}'s ${b} is worked out, not written: no act can set it`,"set the stored fields it is worked out from")):o.push(z("act-field",`${O}.set.${b}`,`${c.create} has no field "${b}"`)));c.as&&p.set(c.as,c.create)}else if("connect"in c||"sever"in c){let b="connect"in c?c.connect:c.sever;!n.has(b)&&!f(b)&&o.push(z("act-edge",`${O}.${"connect"in c?"connect":"sever"}`,`"${b}" is not a relation any kind declares`)),R(c.from)==="subject"&&h.length===0&&o.push(z("act-subject",`${d}.on`,`"${a}" acts on "$subject" but does not say which kinds it is "on"`))}else if("set"in c){let b=R(c.target??"$subject"),F=b==="subject"?h:p.has(b??"")?[p.get(b)]:[];b==="subject"&&h.length===0&&o.push(z("act-subject",`${d}.on`,`"${a}" changes "$subject" but does not say which kinds it is "on"`));for(let M of Object.keys(c.set))for(let C of F)if(!(!s.has(C)||e.kinds[C].fields[M]))if(e.kinds[C].computed?.[M]!==void 0)o.push(z("computed-written",`${O}.set.${M}`,`${C}'s ${M} is worked out, not written: no act can set it`,"set the stored fields it is worked out from"));else{if(u(C,M))continue;o.push(z("act-field",`${O}.set.${M}`,`${C} has no field "${M}"`))}}else"remove"in c&&R(c.remove)==="subject"&&h.length===0&&o.push(z("act-subject",`${d}.on`,`"${a}" removes "$subject" but does not say which kinds it is "on"`));("set"in c&&c.set?Object.values(c.set):[]).forEach(b=>{b&&typeof b=="object"&&!Array.isArray(b)&&"expr"in b&&je(b.expr,`${O}.set`,o)})}),i.allowedWhen&&je(i.allowedWhen,`${d}.allowedWhen`,o),i.refusal&&ve(i.refusal,`${d}.refusal`,o)}for(let[a,i]of Object.entries(e.rules??{})){let d=`rules.${a}`;i.over!=="graph"&&!s.has(i.over)&&o.push(z("rule-kind",`${d}.over`,`"${i.over}" is not a kind this document declares`));let h=i.over==="graph"?void 0:e.kinds[i.over];for(let m of["when","require"]){let p=i[m];if(!p)continue;let c=je(p,`${d}.${m}`,o);if(!c)continue;let j=re(c);for(let k of j.names)if(i.over==="graph")o.push(z("rule-name",`${d}.${m}`,`"${k}" means nothing in a rule over the whole graph`,`name a kind in "over", or use all('kind')`));else if(h&&!h.fields[k]&&!h.edges?.[k]&&h.computed?.[k]===void 0){let O=Object.keys(h.edges??{}).find(E=>E.includes("-")&&E.split("-").includes(k));o.push(z("rule-name",`${d}.${m}`,`${i.over} has no field or relation called "${k}"`,O?`"${O}" reads as a subtraction in a rule; rename the relation to one camelCase word, like "${O.replace(/-([a-z0-9])/g,(E,b)=>b.toUpperCase())}"`:void 0))}for(let k of j.edges)!n.has(k)&&!f(k)&&o.push(z("rule-edge",`${d}.${m}`,`"${k}" is not a relation any kind declares`));for(let k of j.sweeps)s.has(k)?i.over!=="graph"&&o.push(Le("rule-cost",`${d}.${m}`,`this rule looks at every ${k} for every ${i.over}, which grows slowly as the app grows`,"walk a relation with out()/in() instead of all() where you can")):o.push(z("rule-kind",`${d}.${m}`,`"${k}" is not a kind this document declares`))}i.says&&ve(i.says,`${d}.says`,o),(i.repairs??[]).forEach((m,p)=>{!r[m.act]&&!fe(m.act)&&!ye(m.act,e.kinds)&&o.push(z("repair-act",`${d}.repairs.${p}.act`,`"${m.act}" is not an act this document declares`,he(m.act,e)))})}let g=e.policy;return g&&(g.grants.forEach((a,i)=>{if(a.roles!=="*"&&l.size>0)for(let d of a.roles)l.has(d)||o.push(z("grant-role",`policy.grants.${i}.roles`,`"${d}" is not one of the document's roles`));if(a.mutations!=="*")for(let d of a.mutations)!r[d]&&!fe(d)&&!ye(d,e.kinds)&&o.push(z("grant-act",`policy.grants.${i}.mutations`,`"${d}" is not an act this document declares`,he(d,e)))}),(g.sees??[]).forEach((a,i)=>{for(let d of a.kinds)s.has(d)||o.push(z("sight-kind",`policy.sees.${i}.kinds`,`"${d}" is not a kind this document declares`));if(a.roles!=="*"&&l.size>0)for(let d of a.roles)l.has(d)||o.push(z("sight-role",`policy.sees.${i}.roles`,`"${d}" is not one of the document's roles`))})),o.push(...Ye(e)),o}function Dn(e){return e.label?[...e.label.matchAll(/\{\s*([A-Za-z_][A-Za-z0-9_]*)/g)].map(o=>o[1]):[ge(e)??[]].flat()}function Nn(e,o,s,n){let r=new Map,l=le(e.on),u=new Map,f=new Map;(l.length>0||o.some(p=>"remove"in p&&R(p.remove)==="subject"||"from"in p&&(R(p.from)==="subject"||R(p.to)==="subject")||"set"in p&&!("create"in p)&&R(p.target??"$subject")==="subject"))&&r.set(me,{ref:l.length>0?l:"*",required:!0});let a=e.args??{},i=e.writes?.length===1,d=(p,c)=>c&&p.type===c.type&&p.min===void 0&&p.max===void 0&&p.step===void 0?{...p,...c.min===void 0?{}:{min:c.min},...c.max===void 0?{}:{max:c.max},...c.step===void 0?{}:{step:c.step}}:p,h=(p,c)=>c&&p.type===c.type&&p.format===void 0&&p.unit===void 0?{...d(p,c),...c.format?{format:c.format}:{},...c.unit?{unit:c.unit}:{}}:d(p,c),m=(p,c,j)=>{if(p===me||En.has(p)||u.has(p)||r.has(p))return;let k=a[p]?h(a[p],j):void 0;r.set(p,k?{field:k,optional:!k.required,required:!!k.required}:c())};for(let p of o)if("create"in p){let c=s.kinds[p.create],j=c?pn(c,Dn(c)):[],k=O=>j.includes(O)?j.indexOf(O):j.length;for(let[O,E]of Object.entries(p.set??{}).sort(([b],[F])=>k(b)-k(F))){let b=R(E),F=c?.fields[O];if(b&&F){let M=!!F.required&&F.default===void 0;m(b,()=>({field:F,optional:!M,required:M}),F)}}p.as&&u.set(p.as,p.create)}else if("connect"in p||"sever"in p){let c=n.get("connect"in p?p.connect:p.sever);for(let[j,k]of[["from",p.from],["to",p.to]]){let O=R(k);if(!O)continue;let E=j==="to"?c?.to??"*":c?.from??"*";E!=="*"&&!f.has(O)&&f.set(O,E),m(O,()=>({ref:E,required:!0}))}}else if("set"in p){let c=R(p.target??"$subject"),j=c==="subject"?l[0]:u.get(c??"")??f.get(c??"")?.[0];c&&c!=="subject"&&!u.has(c)&&m(c,()=>({ref:"*",required:!0}));for(let[k,O]of Object.entries(p.set)){let E=R(O);if(!E)continue;let b=j?s.kinds[j]?.fields[k]:void 0;m(E,()=>b?{field:b,optional:!i,required:i}:{any:!0,required:!1},b)}}else if("remove"in p){let c=R(p.remove);c&&m(c,()=>({ref:"*",required:!0}))}for(let[p,c]of Object.entries(a))r.has(p)||r.set(p,{field:c,optional:!c.required,required:!!c.required});return r}function Pt(e,o={}){let s=Rn(e);if(!s.document||ue(s.findings))return{ok:!1,findings:s.findings};let n=s.document,r=[...s.findings];o.previous&&r.push(...Mn(n,o.previous));let l=Tn(n,r);return ue(l.findings)?{ok:!1,findings:l.findings}:Be(l,o)}function ce(e,o){return e.map(s=>{let n=!s.format&&s.expr?.t==="ident"?o?.[s.expr.name]?.format:void 0;return n==="money"||n==="percent"?{...s,format:n}:s})}function Tn(e,o){let s=fn(e),n={},r=ln(e.connections,e.kinds);for(let[i,d]of Object.entries(e.kinds)){let h=ge(d),m=d.label??(h?`{${h}}`:void 0),p=oe(d),c=p?an(e,i,[...p]):[];n[i]={...m?{label:ce(X(m),d.fields)}:{},...d.describe?{describe:ce(X(d.describe),d.fields)}:{},...p?{computed:[...p]}:{},...c.length>0?{durations:c}:{},...r.has(i)?{keptInStep:r.get(i)}:{}}}let l={};for(let[i,d]of Object.entries(e.acts??{})){let h=un(d,e),m=Nn(d,h,e,s),p=d.destructive??h.some(y=>"remove"in y||"sever"in y||"replace"in y),c=[...new Set(h.flatMap(y=>"create"in y?[y.create]:[]))],j=[...new Set(h.flatMap(y=>"connect"in y?[y.connect]:[]))],k=[...new Set(h.flatMap(y=>"sever"in y?[y.sever]:"replace"in y?y.replace:[]))],O=[...new Set(h.flatMap(y=>"set"in y&&!("create"in y)&&R(y.target??"$subject")==="subject"?Object.keys(y.set):[]))],E=new Map;for(let y of h){if(!("connect"in y)&&!("sever"in y))continue;let v=s.get("connect"in y?y.connect:y.sever);for(let[D,ie]of[["from",y.from],["to",y.to]]){let q=R(ie),H=D==="to"?v?.to:v?.from;q&&q!=="subject"&&H&&H!=="*"&&E.set(q,[...new Set([...E.get(q)??[],...H])])}}let b={};for(let y of h){if(!("set"in y)||"create"in y)continue;let v=R(y.target??"$subject");for(let D of v&&v!=="subject"&&E.get(v)||[])b[D]=[...new Set([...b[D]??[],...Object.keys(y.set)])]}let F={};for(let y of h)if(!(!("set"in y)||"create"in y||R(y.target??"$subject")!=="subject"))for(let[v,D]of Object.entries(y.set??{}))typeof D=="string"&&R(D)===void 0||typeof D=="number"||typeof D=="boolean"?F[v]=typeof D=="string"&&D.startsWith("$$")?D.slice(1):D:delete F[v];let M=c.length===0&&h.every(y=>!("set"in y)||!y.set||Object.values(y.set).every(v=>!(v&&typeof v=="object"&&!Array.isArray(v)&&"expr"in v))),C=new Map;for(let y of h)if(!(!("set"in y)||!y.set))for(let v of Object.values(y.set))v&&typeof v=="object"&&!Array.isArray(v)&&"expr"in v&&C.set(v.expr,J(v.expr));l[i]={title:d.title??i.replace(/-/g," "),effects:h,args:[...m],...d.allowedWhen?{guard:J(d.allowedWhen)}:{},...d.refusal?{refusal:ce(X(d.refusal),e.kinds[[d.on??[]].flat()[0]??""]?.fields)}:{},exprs:[...C],destructive:p,idempotent:M,creates:c,connects:j,severs:k,writes:O,writesOther:b,sets:F}}let u={};for(let[i,d]of Object.entries(e.rules??{}))u[i]={title:d.title??i.replace(/-/g," "),require:J(d.require),...d.when?{when:J(d.when)}:{},...d.says?{says:ce(X(d.says),e.kinds[d.over]?.fields)}:{}};let f=Ve(e,o),g=Ze(e),a=We(e);return{format:qe,document:e,findings:o,kinds:n,...e.computed?{facts:[...oe(e)??[]]}:{},edges:[...s].map(([i,{from:d,to:h,cardinality:m}])=>[i,{from:d,to:h,cardinality:m}]),acts:l,rules:u,brand:f,...Object.keys(g).length>0?{viewSpecs:g}:{},...a?{home:a}:{}}}function Gt(e,o,s){let n=/^defineNode\("([^"]+)"\)/.exec(o)?.[1],r=n?s.kinds[n]:void 0;if(!n||!r)return e;let l=Object.keys(r.fields).filter(u=>u!=="label").slice(0,3);return{...e,path:`kinds.${n}.glance`,fix:`Say which: "glance": [${l.map(u=>`"${u}"`).join(", ")}] on kinds.${n} \u2014 the facts a person compares one by, at a glance.`}}function Mn(e,o){let s=[],n=new Set(Object.values(o.kinds).flatMap(r=>Object.keys(r.edges??{})));for(let[r,l]of Object.entries(e.kinds)){let u=l.renamedFrom;u&&!o.kinds[u]&&s.push(z("renamed-from-nothing",`kinds.${r}.renamedFrom`,`${r} says it was ${u}, and the previous version has no kind called ${u}`,"name the kind it was, or drop renamedFrom"));let f=o.kinds[u??r];for(let[g,a]of Object.entries(l.fields)){let i=a.renamedFrom;i&&!f?.fields[i]&&s.push(z("renamed-from-nothing",`kinds.${r}.fields.${g}.renamedFrom`,`${g} says it was ${i}, and the previous ${u??r} has no field called ${i}`,"name the field it was, or drop renamedFrom"))}for(let[g,a]of Object.entries(l.edges??{})){let i=a.renamedFrom;i&&!n.has(i)&&s.push(z("renamed-from-nothing",`kinds.${r}.edges.${g}.renamedFrom`,`${g} says it was ${i}, and the previous version has no relation called ${i}`,"name the relation it was, or drop renamedFrom"))}}return s}export{bn as ActRefusal,Pt as compileDocumentWithoutCheck,un as effectsOf,Gt as inDocumentWords,It as kindShapes,Rn as readDocument};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a}from"./chunk.QHU3KUZZ.js";import"./chunk.YMRVKG6W.js";import"./chunk.P3CUCDHO.js";import"./chunk.OVSZXILB.js";import"./chunk.BDBLGGFJ.js";import"./chunk.IZ2ZTNEV.js";import"./chunk.CJUIJ6TL.js";import"./chunk.UITZ74YJ.js";import{b as n}from"./chunk.E4SYOBGB.js";import"./chunk.QLTHHWBA.js";import"./chunk.GZHZLJBF.js";import"./chunk.KHZA5F7A.js";import"./chunk.OJGHDWI6.js";import"./chunk.KSVJHSRH.js";import"./chunk.NSGQXCH6.js";import"./chunk.SZG6HJWH.js";import"./chunk.2FOIJ5ID.js";import"./chunk.6IUEGPCZ.js";import"./chunk.CUJX3IVA.js";import{T as i}from"./chunk.VNJKGSGZ.js";import"./chunk.SDO3U72B.js";import"./chunk.X3MMJ3QC.js";import"./chunk.FQLNBIQ5.js";import{b as o}from"./chunk.AJZBJBMO.js";var e=o(i(),1);function m({entries:d,style:l,headingStyle:p,className:r}){return(0,e.jsxs)("section",{...r?{className:r}:{},"data-testid":"record-ai","aria-label":"What AI did here",style:{display:"grid",gap:10,...l},children:[(0,e.jsx)("h2",{style:p??{margin:0,fontSize:"1rem"},children:"What AI did here"}),(0,e.jsx)("ol",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:8,fontSize:"0.875rem"},children:d.slice(0,8).map(t=>(0,e.jsx)(n,{entry:t,undo:s=>(0,e.jsx)(a,{batch:s})},t.id))})]})}export{m as RecordInteractions};
|