graview 0.1.44 → 0.1.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/preview/{chunk.RVQYXPCM.js → chunk.2JJYGYT2.js} +1 -1
- package/dist/preview/{chunk.P5K7EYDK.js → chunk.3MMLRSRC.js} +1 -1
- package/dist/preview/{chunk.D2RK2KJD.js → chunk.3OSGN463.js} +1 -1
- package/dist/preview/{chunk.3M4VCAA3.js → chunk.3VFYSXMQ.js} +1 -1
- package/dist/preview/{chunk.ZN77U6SU.js → chunk.4HYJHGI4.js} +1 -1
- package/dist/preview/{chunk.BA4KQR5H.js → chunk.4KNEBLB7.js} +1 -1
- package/dist/preview/chunk.4OGOTHRD.js +1 -0
- package/dist/preview/{chunk.UXLJZIYX.js → chunk.4RJZVTW7.js} +1 -1
- package/dist/preview/chunk.4Y6VGQVQ.js +1 -0
- package/dist/preview/{chunk.F4DWRBO7.js → chunk.55D33E5A.js} +1 -1
- package/dist/preview/{chunk.QJJKITXF.js → chunk.5ESCD57M.js} +1 -1
- package/dist/preview/chunk.5K6KX3UC.js +1 -0
- package/dist/preview/chunk.5R2R364Q.js +1 -0
- package/dist/preview/{chunk.ALFW4ZJQ.js → chunk.63JLXGYX.js} +1 -1
- package/dist/preview/{chunk.7PUFYK3B.js → chunk.64WM4IBI.js} +1 -1
- package/dist/preview/chunk.6BDM2XRX.js +1 -0
- package/dist/preview/{chunk.ATKKTPJS.js → chunk.6MADC6DM.js} +1 -1
- package/dist/preview/{chunk.6BIRNR5P.js → chunk.6OPI4WWO.js} +1 -1
- package/dist/preview/{chunk.YERDP6YF.js → chunk.6QYJ2K6K.js} +1 -1
- package/dist/preview/{chunk.N5ULWKR4.js → chunk.6RY6OSE6.js} +1 -1
- package/dist/preview/{chunk.P546VMA5.js → chunk.6SOUQNXR.js} +1 -1
- package/dist/preview/chunk.6UIW664O.js +6 -0
- package/dist/preview/{chunk.7B5BZZBG.js → chunk.6WA6ASQB.js} +1 -1
- package/dist/preview/chunk.6YD2DLIC.js +1 -0
- package/dist/preview/{chunk.DLVNW4HU.js → chunk.A5VGTO3E.js} +1 -1
- package/dist/preview/{chunk.RNUGQRJI.js → chunk.AGIO2GRV.js} +29 -7
- package/dist/preview/{chunk.HKD5SR45.js → chunk.AQQZY6OY.js} +2 -2
- package/dist/preview/{chunk.AW2T3KFV.js → chunk.AS4CQBOQ.js} +1 -1
- package/dist/preview/chunk.ATDU5Y7V.js +1 -0
- package/dist/preview/chunk.AYA7SYIU.js +1 -0
- package/dist/preview/{chunk.WPLKHIO5.js → chunk.BAMPYMUE.js} +1 -1
- package/dist/preview/{chunk.JEMQ66FT.js → chunk.BCWPV4WR.js} +1 -1
- package/dist/preview/{chunk.GAN77YDU.js → chunk.BFKV4GKP.js} +6 -6
- package/dist/preview/{chunk.B7FZLIAO.js → chunk.BNPQUI3F.js} +1 -1
- package/dist/preview/chunk.BRDAO2OF.js +4 -0
- package/dist/preview/{chunk.DGXWL4GC.js → chunk.CICGAEBW.js} +2 -2
- package/dist/preview/{chunk.LKF4BBCW.js → chunk.DEUTHHGI.js} +1 -1
- package/dist/preview/{chunk.7AEE3VHC.js → chunk.DQOCBKC3.js} +1 -1
- package/dist/preview/{chunk.KERLVJ6I.js → chunk.DX357TZ3.js} +1 -1
- package/dist/preview/{chunk.2CPC3HQI.js → chunk.EAJB2PJZ.js} +1 -1
- package/dist/preview/{chunk.NPS2WN7T.js → chunk.EPUBSKKL.js} +1 -1
- package/dist/preview/chunk.F37DHXA2.js +1 -0
- package/dist/preview/{chunk.EW364363.js → chunk.F5PBK4TF.js} +2 -2
- package/dist/preview/chunk.FGR7KCI6.js +1 -0
- package/dist/preview/chunk.FO5BOBYV.js +1 -0
- package/dist/preview/chunk.FVOJCVRX.js +1 -0
- package/dist/preview/chunk.FXTBMW3S.js +1 -0
- package/dist/preview/chunk.GEPNIMXW.js +1 -0
- package/dist/preview/chunk.GVY5UQTJ.js +1 -0
- package/dist/preview/{chunk.4EPT2CQG.js → chunk.H7KCWCB4.js} +1 -1
- package/dist/preview/{chunk.FVHECT47.js → chunk.HBD7FBZS.js} +1 -1
- package/dist/preview/{chunk.MZOIPCDA.js → chunk.HDRD33II.js} +1 -1
- package/dist/preview/chunk.HZCA3UWJ.js +1 -0
- package/dist/preview/{chunk.HP72LB3B.js → chunk.I3GP5JW7.js} +1 -1
- package/dist/preview/{chunk.LKXYZK5H.js → chunk.IJABD7SI.js} +1 -1
- package/dist/preview/{chunk.27ZVVPRZ.js → chunk.IKX4VDTW.js} +1 -1
- package/dist/preview/chunk.ITYQUSZI.js +6 -0
- package/dist/preview/chunk.IW7YFPGG.js +1 -0
- package/dist/preview/{chunk.IBWPRK2R.js → chunk.JBW3DI7E.js} +1 -1
- package/dist/preview/chunk.JF3GD4H5.js +50 -0
- package/dist/preview/{chunk.RYNCEZ6Q.js → chunk.JHIUG25Q.js} +1 -1
- package/dist/preview/{chunk.UZSZPMRC.js → chunk.JLEC3USG.js} +1 -1
- package/dist/preview/chunk.JLIUUFK2.js +1 -0
- package/dist/preview/{chunk.XPIDPZKS.js → chunk.JLYNMAME.js} +1 -1
- package/dist/preview/{chunk.EYEIDL3T.js → chunk.JNIGZEOF.js} +1 -1
- package/dist/preview/chunk.JQLR6KO2.js +1 -0
- package/dist/preview/chunk.JT3IZIU5.js +33 -0
- package/dist/preview/{chunk.NBOZPPSM.js → chunk.KRGM25HF.js} +1 -1
- package/dist/preview/{chunk.UG23RICT.js → chunk.KWQ7QOHD.js} +1 -1
- package/dist/preview/{chunk.H4GHKBMH.js → chunk.L2PI7V4R.js} +1 -1
- package/dist/preview/{chunk.ZP6PS5Z4.js → chunk.LETJC5TD.js} +1 -1
- package/dist/preview/{chunk.V4DR25S4.js → chunk.LKN734RR.js} +1 -1
- package/dist/preview/{chunk.5JPELFMA.js → chunk.LKVXSC5O.js} +1 -1
- package/dist/preview/{chunk.REEDZSCG.js → chunk.LUNATPAB.js} +2 -2
- package/dist/preview/{chunk.4WCQWILK.js → chunk.LVEFQLGQ.js} +1 -1
- package/dist/preview/{chunk.FNF6XQI5.js → chunk.M5GJHVWZ.js} +1 -1
- package/dist/preview/chunk.MWONSI3P.js +1 -0
- package/dist/preview/{chunk.56DR42FA.js → chunk.N7VNEUJR.js} +1 -1
- package/dist/preview/{chunk.FIJNKSMQ.js → chunk.NGIPVTTE.js} +1 -1
- package/dist/preview/chunk.NITU5H4J.js +1 -0
- package/dist/preview/{chunk.6NFR2LYQ.js → chunk.NIVTK2W5.js} +1 -1
- package/dist/preview/chunk.NMIXBH37.js +1 -0
- package/dist/preview/{chunk.JGYGSNQY.js → chunk.NWA7Q6CI.js} +1 -1
- package/dist/preview/{chunk.REOYQTFP.js → chunk.O24DD2VF.js} +1 -1
- package/dist/preview/{chunk.U3CV5CCL.js → chunk.OHSJQYJN.js} +1 -1
- package/dist/preview/chunk.ONEYVLC2.js +1 -0
- package/dist/preview/{chunk.CDFVEL2Y.js → chunk.P4O5DGLN.js} +1 -1
- package/dist/preview/{chunk.LULTKYE3.js → chunk.PC6PID5X.js} +1 -1
- package/dist/preview/{chunk.IIB22IIP.js → chunk.PKUDIWIF.js} +1 -1
- package/dist/preview/{chunk.YTXEPWVW.js → chunk.PLWVLW22.js} +1 -1
- package/dist/preview/{chunk.TDCO7LEA.js → chunk.Q7RQC3F7.js} +1 -1
- package/dist/preview/{chunk.ZKBSEUK4.js → chunk.QGVLJTZS.js} +1 -1
- package/dist/preview/{chunk.QNJYXB3U.js → chunk.R2AG4NHQ.js} +1 -1
- package/dist/preview/chunk.R4OU7O6C.js +1 -0
- package/dist/preview/{chunk.YGX2AE36.js → chunk.RNBPDB37.js} +1 -1
- package/dist/preview/{chunk.IN4PKQO5.js → chunk.RNEJYIQ7.js} +1 -1
- package/dist/preview/{chunk.VAUG5TGZ.js → chunk.RTI3FEDD.js} +1 -1
- package/dist/preview/{chunk.Y2MIG2C2.js → chunk.RZXPBOGT.js} +1 -1
- package/dist/preview/chunk.S5MQVPLF.js +1 -0
- package/dist/preview/{chunk.MFLJIFZD.js → chunk.S6WHA4CW.js} +1 -1
- package/dist/preview/{chunk.YTZDCIX2.js → chunk.SL2FZ54V.js} +1 -1
- package/dist/preview/{chunk.3L7OEBJH.js → chunk.SS27NH5O.js} +1 -1
- package/dist/preview/chunk.T7O6K3IN.js +1 -0
- package/dist/preview/{chunk.3IUJ4GW7.js → chunk.TBQOSI4J.js} +1 -1
- package/dist/preview/{chunk.FBIK4LTM.js → chunk.TFVFJFXC.js} +2 -2
- package/dist/preview/{chunk.2O2THM2R.js → chunk.TOZJZXWQ.js} +1 -1
- package/dist/preview/{chunk.PL2P2OON.js → chunk.UHX4WTM7.js} +1 -1
- package/dist/preview/{chunk.OGF6UORU.js → chunk.UKAPFIPJ.js} +1 -1
- package/dist/preview/{chunk.64QDUERE.js → chunk.UNCS63AM.js} +1 -1
- package/dist/preview/chunk.UOXFALRL.js +1 -0
- package/dist/preview/chunk.UPQZU7UO.js +21 -0
- package/dist/preview/chunk.UR3XYOQ6.js +104 -0
- package/dist/preview/chunk.URO2EGY7.js +1 -0
- package/dist/preview/{chunk.TJO5Y2OJ.js → chunk.UVNVDLV5.js} +1 -1
- package/dist/preview/chunk.V3QUTJR2.js +2 -0
- package/dist/preview/{chunk.RDGFZPKN.js → chunk.V5Z2OED6.js} +1 -1
- package/dist/preview/{chunk.EJAWDI2V.js → chunk.VAFSSSSI.js} +1 -1
- package/dist/preview/{chunk.5WEEZ7WD.js → chunk.VBPK6ARF.js} +1 -1
- package/dist/preview/{chunk.DAZEFSWI.js → chunk.VC3BX2ZF.js} +1 -1
- package/dist/preview/{chunk.IQWKEGWG.js → chunk.VDVJCLGS.js} +1 -1
- package/dist/preview/{chunk.MWUP5X47.js → chunk.VW2VCPJX.js} +1 -1
- package/dist/preview/{chunk.O4VSQ2ER.js → chunk.W45NKVSV.js} +1 -1
- package/dist/preview/{chunk.3TBH2FMZ.js → chunk.WAB7UDHU.js} +1 -1
- package/dist/preview/{chunk.OK4FSBHI.js → chunk.WBHM5I3I.js} +1 -1
- package/dist/preview/chunk.WM2LWHTJ.js +1 -0
- package/dist/preview/chunk.WO3DDFFY.js +1 -0
- package/dist/preview/{chunk.JLOSQ5UY.js → chunk.WP5W44Y4.js} +2 -2
- package/dist/preview/chunk.WQONZBA3.js +5 -0
- package/dist/preview/{chunk.T6S3CEW7.js → chunk.WSTBCWW7.js} +2 -2
- package/dist/preview/chunk.X233NILF.js +1 -0
- package/dist/preview/{chunk.FUYMLDNJ.js → chunk.X25KXCWI.js} +1 -1
- package/dist/preview/{chunk.FNXW46U4.js → chunk.XSNAG4JT.js} +82 -72
- package/dist/preview/chunk.XWAMQPUM.js +25 -0
- package/dist/preview/chunk.XXDBZQNY.js +18 -0
- package/dist/preview/{chunk.IQ3LUSD6.js → chunk.XXEYRHRG.js} +1 -1
- package/dist/preview/{chunk.7UV7ODXU.js → chunk.Y5ARSVH4.js} +1 -1
- package/dist/preview/{chunk.TTSNHX3F.js → chunk.Z5IGHCZX.js} +1 -1
- package/dist/preview/{chunk.B2CIQ66N.js → chunk.Z6TMIAAB.js} +1 -1
- package/dist/preview/chunk.ZIEHF67C.js +1 -0
- package/dist/preview/chunk.ZTIF23VF.js +1 -0
- package/dist/preview/index.html +49 -45
- package/dist/preview/page.js +2 -34
- package/package.json +6 -6
- package/dist/preview/chunk.2EXY4AHX.js +0 -117
- package/dist/preview/chunk.3JATXDSP.js +0 -1
- package/dist/preview/chunk.3OKJ4GOA.js +0 -1
- package/dist/preview/chunk.3PNDXNX6.js +0 -1
- package/dist/preview/chunk.4B4DKCS4.js +0 -1
- package/dist/preview/chunk.4JWT6LIS.js +0 -25
- package/dist/preview/chunk.6VIZGLDK.js +0 -1
- package/dist/preview/chunk.7HL7CFXJ.js +0 -1
- package/dist/preview/chunk.7JVBVB4A.js +0 -1
- package/dist/preview/chunk.CSQNDAEK.js +0 -1
- package/dist/preview/chunk.EJOTTZWZ.js +0 -1
- package/dist/preview/chunk.ESU2DD3J.js +0 -1
- package/dist/preview/chunk.EZRGGPAN.js +0 -1
- package/dist/preview/chunk.GAFYE37S.js +0 -3
- package/dist/preview/chunk.GBCWI2LF.js +0 -2
- package/dist/preview/chunk.HB34VQKQ.js +0 -1
- package/dist/preview/chunk.HKA27VJO.js +0 -1
- package/dist/preview/chunk.IPHWGBZE.js +0 -6
- package/dist/preview/chunk.JQ7WY2VZ.js +0 -1
- package/dist/preview/chunk.JUT2VCFW.js +0 -1
- package/dist/preview/chunk.L6FWIQXS.js +0 -1
- package/dist/preview/chunk.LUPBT6YM.js +0 -1
- package/dist/preview/chunk.LYSHLKAX.js +0 -1
- package/dist/preview/chunk.LYUPJ4VV.js +0 -1
- package/dist/preview/chunk.MOF2D6DV.js +0 -1
- package/dist/preview/chunk.NTFCZYOR.js +0 -1
- package/dist/preview/chunk.OAWAUB4P.js +0 -49
- package/dist/preview/chunk.OG6GNGTX.js +0 -21
- package/dist/preview/chunk.PSTE3LZL.js +0 -5
- package/dist/preview/chunk.PX6VAZFJ.js +0 -1
- package/dist/preview/chunk.RLMW7DU6.js +0 -1
- package/dist/preview/chunk.URCC626R.js +0 -1
- package/dist/preview/chunk.WE5SA6TP.js +0 -1
- package/dist/preview/chunk.WNYPP52L.js +0 -1
- package/dist/preview/chunk.YE4GZVOX.js +0 -1
- package/dist/preview/chunk.YWVOACSX.js +0 -5
- package/dist/preview/chunk.YYPK7IDM.js +0 -1
- package/dist/preview/chunk.ZZ5F5I3O.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.46",
|
|
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/core": "0.1.
|
|
33
|
-
"@graview/
|
|
34
|
-
"@graview/
|
|
35
|
-
"@graview/
|
|
36
|
-
"@graview/
|
|
32
|
+
"@graview/core": "0.1.46",
|
|
33
|
+
"@graview/guest": "0.1.46",
|
|
34
|
+
"@graview/tools": "0.1.46",
|
|
35
|
+
"@graview/ship": "0.1.46",
|
|
36
|
+
"@graview/skills": "0.1.46"
|
|
37
37
|
},
|
|
38
38
|
"engines": {
|
|
39
39
|
"node": ">=22"
|
|
@@ -1,117 +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 pt,B as ye,C as Dn,D as Be,E as ze,F as oi,G as Kn,H as Te,I as si,J as li,K as W,L as ut,M as vt,N as di,O as bt,P as Xt,Q as ci,R as ae,S as ie,T as qn,a as _,b as xe,c as Q,d as zt,e as Hn,f as Wn,g as ct,h as ee,i as be,j as re,k as L,l as ne,m as G,n as Pe,o as _t,p as Ae,q as ue,r as ai,s as wt,t as Yt,u as Z,v as We,w as ri,x as Qt,y as Le,z as ii}from"./chunk.OAWAUB4P.js";import{b as In,c as ti,d as ni,e as Zt,g as X}from"./chunk.PSTE3LZL.js";import{a as Xr,d as Jr,e as ei}from"./chunk.UGFDSE37.js";import{a as jr,c as zr,f as _r,g as Yr,i as Qr,j as Zr}from"./chunk.JGYGSNQY.js";import{a as Hr,b as Wr,c as Dr,d as Fn}from"./chunk.JLOSQ5UY.js";import{b as Ir}from"./chunk.FNF6XQI5.js";import{a as Kr,b as qr,d as Gt,e as Br,f as Gr,i as Ut}from"./chunk.LUPBT6YM.js";import{a as Vt,b as jt}from"./chunk.PXQVXBNG.js";import{a as Ft,b as ja,c as za,d as It,e as _a}from"./chunk.YERDP6YF.js";import{b as ir,c as mr,e as fr,f as En}from"./chunk.P5K7EYDK.js";import{a as qt,b as Bt,c as $r,e as Or}from"./chunk.NPS2WN7T.js";import{a as je,b as dr,c as cr,d as pr,e as ur,f as gr}from"./chunk.JUT2VCFW.js";import{m as Fr}from"./chunk.JEMQ66FT.js";import{a as br,b as kr,c as Sr,e as Nr,f as On,h as Kt}from"./chunk.IIB22IIP.js";import{d as Ar,e as Cr,f as Rr,g as Lr,n as Tr,o as Mr,q as Er,s as Dt}from"./chunk.MWUP5X47.js";import{a as Nn}from"./chunk.OGF6UORU.js";import{a as Tn,b as ar,c as rr}from"./chunk.UT6642FC.js";import{a as Wt,b as yr,c as hr,d as wr,e as vr}from"./chunk.WE5SA6TP.js";import{c as or,d as sr,j as ht}from"./chunk.ESU2DD3J.js";import{r as Mn,s as lr}from"./chunk.ATKKTPJS.js";import{f as Xa,g as dt,i as Ja,j as er,k as Ln,q as tr,r as nr}from"./chunk.MZOIPCDA.js";import{b as Ht,c as Ya,d as Qa,e as Za}from"./chunk.KERLVJ6I.js";import{C as $n,K as Ur,N as Vr,e as Ua,f as Va,j as Xi,u as xr,v as Pr}from"./chunk.FNXW46U4.js";import{$ as pe,Ca as Ga,G as Fe,L as $a,N as Oa,Q as Fa,R as j,S as Rn,V as Ia,W as Ha,_ as Wa,ca as Da,da as Ka,fa as qa,ja as lt,la as Ba,oa as Ot,r as Na,v as He}from"./chunk.4JWT6LIS.js";import{a as Ea}from"./chunk.SDO3U72B.js";import{$c as La,J as ya,U as yt,Vc as An,Wb as Pa,Xa as ka,Za as Sa,Zb as Aa,_b as Ca,_c as Nt,ba as st,bd as $t,ca as se,ea as Se,fa as Mt,gb as Pn,ha as Ve,hb as xa,ja as ha,ka as wa,kd as Cn,la as qe,ld as Ta,qb as Et,qd as Ma,vc as Ra,wa as va,xa as ba}from"./chunk.AW2T3KFV.js";import{b as I}from"./chunk.AJZBJBMO.js";function pi(t,e,n={}){let a=t.graph.getNode(e);if(!a)return;let r=t.schema.tryDefinition(a.kind),i=l=>se(t.schema.tryDefinition(l.kind),l),o=new Map;for(let l of t.graph.allEdges()){let d=l.from===e?"out":l.to===e?"in":null;if(!d)continue;let c=d==="out"?l.to:l.from,p=t.graph.getNode(c);if(!p)continue;let f=(d==="out"?r:t.schema.tryDefinition(p.kind))?.edges?.[l.kind],u=d==="in"?f?.inverse??f?.description:f?.description,k=`${l.kind}|${d}|${u??""}`;(o.get(k)??(()=>{let y={edgeKind:l.kind,direction:d,...u?{description:u}:{},targets:[]};return o.set(k,y),y})()).targets.push({id:p.id,kind:p.kind,label:i(p)})}return{id:e,kind:a.kind,label:i(a),fields:Qa(ht(t.schema,t.graph,a),r),violations:Pn(t.violations(n.context),[e]),actions:Nn(t,[e],{focus:e,...n.principal?{principal:n.principal}:{},...n.context?{context:n.context}:{}}),links:[...o.values()].map(l=>{let d=Ht(l.targets.flatMap(c=>{let p=t.graph.getNode(c.id);return p?[p]:[]}),c=>t.schema.tryDefinition(c));return{...l,targets:[...l.targets].map(c=>d.has(c.id)?{...c,apart:d.get(c.id)}:c).sort((c,p)=>c.label.localeCompare(p.label))}})}}function Ze(t,e,n={}){return{kind:e,members:t.graph.nodesOfKind(e),actions:Nn(t,[],{kindSelection:[e],...n.principal?{principal:n.principal}:{},...n.context?{context:n.context}:{}})}}function ui(t,e){let n=(i,o)=>`${i}|${JSON.stringify(o)}`,a=new Map;for(let i of[...t.affordances,...t.withheld]){if(i.provider!=="invariant")continue;let o=n(i.mutation,i.args);a.has(o)||a.set(o,i.rank??Number.MAX_SAFE_INTEGER)}let r=Number.MAX_SAFE_INTEGER;return[...e].map((i,o)=>({repair:i,declared:o})).sort((i,o)=>(a.get(n(i.repair.mutation,i.repair.args??{}))??r)-(a.get(n(o.repair.mutation,o.repair.args??{}))??r)||i.declared-o.declared).map(i=>i.repair)}function Xe(t){let e=t.schema.kinds.map(r=>({kind:r,plural:Ve(t.schema,r),count:t.graph.nodesOfKind(r).length})),n=new Map;for(let r of t.graph.allEdges()){let i=t.graph.getNode(r.from),o=t.graph.getNode(r.to);if(!i||!o)continue;let l=`${r.kind}|${i.kind}|${o.kind}`;n.set(l,(n.get(l)??0)+1)}let a=[];for(let{kind:r}of e){let i=t.schema.tryDefinition(r)?.edges??{};for(let[o,l]of Object.entries(i)){let d=l.to==="*"||l.to===void 0?(()=>{let c=[...n.keys()].filter(p=>p.startsWith(`${o}|${r}|`)).map(p=>p.split("|")[2]);return c.length>0?c:["*"]})():l.to;for(let c of d)a.push({edgeKind:o,from:r,to:c,...l.description?{description:l.description}:{},...l.inverse?{inverse:l.inverse}:{},count:n.get(`${o}|${r}|${c}`)??0})}}return{kinds:e,relations:a}}var Ge=I(Fe(),1);var Je=I(Fe(),1),P=I(j(),1),Ji=`
|
|
2
|
-
form:where([data-graview-part="form"]) {
|
|
3
|
-
/* A grid item of the section above it and a grid container for the
|
|
4
|
-
fields below: both halves are allowed to be narrower than what is in
|
|
5
|
-
them, or a big enough text size pushes the page sideways. See the note
|
|
6
|
-
on \`column\` in pages.tsx. */
|
|
7
|
-
display: grid;
|
|
8
|
-
grid-template-columns: minmax(0, 1fr);
|
|
9
|
-
min-width: 0;
|
|
10
|
-
gap: 12px;
|
|
11
|
-
}
|
|
12
|
-
label:where([data-graview-part="field"]),
|
|
13
|
-
div:where([data-graview-part="field"][data-graview-field="date"]) {
|
|
14
|
-
display: grid;
|
|
15
|
-
/* A track the width it was given: see the note on \`column\` in pages.tsx. */
|
|
16
|
-
grid-template-columns: minmax(0, 1fr);
|
|
17
|
-
min-width: 0;
|
|
18
|
-
gap: 4px;
|
|
19
|
-
}
|
|
20
|
-
label:where([data-graview-part="field"][data-graview-field="boolean"]) {
|
|
21
|
-
grid-auto-flow: column;
|
|
22
|
-
justify-content: start;
|
|
23
|
-
align-items: center;
|
|
24
|
-
}
|
|
25
|
-
span:where([data-graview-part="label"]),
|
|
26
|
-
legend:where([data-graview-part="label"]),
|
|
27
|
-
p:where([data-graview-part="unasked"]) {
|
|
28
|
-
font-size: 0.8125rem;
|
|
29
|
-
color: var(--graview-ink-muted);
|
|
30
|
-
}
|
|
31
|
-
p:where([data-graview-part="unasked"]) { margin: 0; }
|
|
32
|
-
input:where([data-graview-part="control"]:not([type="checkbox"])),
|
|
33
|
-
select:where([data-graview-part="control"]) {
|
|
34
|
-
font: inherit;
|
|
35
|
-
/* A TARGET IN EVERY ENGINE, not only in the one it was measured in.
|
|
36
|
-
Padding and line height alone came to 24 in Chromium and to 22 in
|
|
37
|
-
WebKit, which has its own intrinsic metrics for a \`select\` and rounds
|
|
38
|
-
nothing up for anybody. So every picker on the routed face was under
|
|
39
|
-
the WCAG 2.2 minimum in the browser iOS ships, and the check that says
|
|
40
|
-
so (\`verify-pages\`' \`bigEnoughToHit\`) only ever ran there through
|
|
41
|
-
\`pnpm engines\`. */
|
|
42
|
-
min-height: 24px;
|
|
43
|
-
/* NEVER WIDER THAN ITS FIELD. A select is as wide as its longest option,
|
|
44
|
-
and a picker over 320 vehicles ("2027 Mercedes-Benz GLE AMG 53 4MATIC+
|
|
45
|
-
Coupe") was 618 pixels on a 390 phone, and the whole page scrolled
|
|
46
|
-
sideways. It shrinks to its track and cuts the option inside its box. */
|
|
47
|
-
min-width: 0;
|
|
48
|
-
max-width: 100%;
|
|
49
|
-
text-overflow: ellipsis;
|
|
50
|
-
box-sizing: border-box;
|
|
51
|
-
padding: 7px 10px;
|
|
52
|
-
border-radius: 8px;
|
|
53
|
-
border: 1px solid var(--graview-edge);
|
|
54
|
-
background: var(--graview-panel);
|
|
55
|
-
color: var(--graview-ink);
|
|
56
|
-
}
|
|
57
|
-
/* A PICKER THAT STILL LOOKS LIKE ONE.
|
|
58
|
-
WebKit ignores an author's padding and minimum height on a \`select\`
|
|
59
|
-
while the native appearance is on \u2014 so every picker on the routed face
|
|
60
|
-
came out 22 pixels tall in the browser iOS ships, under the 24 WCAG 2.2
|
|
61
|
-
asks for, while the same element measured 35 in Chromium. Turning the
|
|
62
|
-
appearance off is what makes the box the size it was asked to be, and it
|
|
63
|
-
takes the platform's chevron with it; the chevron is put back, in the ink
|
|
64
|
-
the scheme is already using. */
|
|
65
|
-
span:where([data-graview-part="picker"]) {
|
|
66
|
-
position: relative;
|
|
67
|
-
display: grid;
|
|
68
|
-
min-width: 0;
|
|
69
|
-
}
|
|
70
|
-
span:where([data-graview-part="picker"]) > select:where([data-graview-part="control"]) {
|
|
71
|
-
appearance: none;
|
|
72
|
-
padding-right: 28px;
|
|
73
|
-
}
|
|
74
|
-
span:where([data-graview-part="chevron"]) {
|
|
75
|
-
position: absolute;
|
|
76
|
-
right: 10px;
|
|
77
|
-
top: 50%;
|
|
78
|
-
transform: translateY(-50%);
|
|
79
|
-
font-size: 0.75rem;
|
|
80
|
-
line-height: 1;
|
|
81
|
-
color: var(--graview-ink-muted);
|
|
82
|
-
pointer-events: none;
|
|
83
|
-
}
|
|
84
|
-
fieldset:where([data-graview-part="group"]) {
|
|
85
|
-
display: grid;
|
|
86
|
-
gap: 10px;
|
|
87
|
-
border: 1px solid var(--graview-edge);
|
|
88
|
-
border-radius: 10px;
|
|
89
|
-
padding: 12px;
|
|
90
|
-
}
|
|
91
|
-
fieldset:where([data-graview-part="group"][data-graview-field="list"]) { gap: 8px; }
|
|
92
|
-
div:where([data-graview-part="item"]) {
|
|
93
|
-
display: flex;
|
|
94
|
-
gap: 8px;
|
|
95
|
-
align-items: end;
|
|
96
|
-
}
|
|
97
|
-
button:where([data-graview-part="add"]),
|
|
98
|
-
button:where([data-graview-part="submit"]) { justify-self: start; }
|
|
99
|
-
p:where([data-graview-part="refused"]) {
|
|
100
|
-
margin: 0;
|
|
101
|
-
color: var(--graview-warn);
|
|
102
|
-
font-size: 0.875rem;
|
|
103
|
-
}
|
|
104
|
-
`;function eo({title:t,name:e,optional:n,amount:a,value:r,onChange:i}){let o=Ja(a),[l,d]=(0,Je.useState)(()=>typeof r=="number"?er(r,a):""),c=l.trim()!==""&&Ln(l,a)===void 0;return(0,P.jsxs)("label",{"data-graview-part":"field","data-graview-field":"number","data-graview-amount":a.format??"unit",children:[(0,P.jsx)("span",{"data-graview-part":"label",children:t}),(0,P.jsxs)("span",{"data-graview-part":"amount",style:{display:"flex",alignItems:"center",gap:6},children:[o.prefix?(0,P.jsx)("span",{"data-graview-part":"amount-symbol","aria-hidden":"true",children:o.prefix}):null,(0,P.jsx)("input",{type:"text",inputMode:"decimal",name:e,required:!n,placeholder:o.placeholder,title:o.hint,"aria-invalid":c||void 0,value:l,onChange:p=>{d(p.target.value),i(Ln(p.target.value,a))},"data-graview-part":"control",style:{flex:1,minWidth:0}}),o.suffix?(0,P.jsx)("span",{"data-graview-part":"amount-symbol","aria-hidden":"true",children:o.suffix}):null]}),c?(0,P.jsxs)("span",{"data-graview-part":"hint",role:"status",children:["Not an amount ",o.hint,": write it like ",o.prefix??"",o.placeholder,o.suffix?` ${o.suffix}`:""]}):null]})}function gi({children:t}){return(0,P.jsxs)("span",{"data-graview-part":"picker",children:[t,(0,P.jsx)("span",{"aria-hidden":"true","data-graview-part":"chevron",children:"\u25BE"})]})}var to=t=>({label:Se(t),option:e=>e}),no={phone:"+1 555 123 4567",place:"An address or a place's name",duration:"1h 30m, 90 or 1:30"};function Jt({store:t,spec:e,value:n,onChange:a,prefilled:r,open:i,words:o=to,values:l}){if(e.name in r&&e.control!=="group"&&e.control!=="variant")return null;let d=e.control==="node"&&!e.kinds.includes("*")?e.kinds.map(g=>Se(qe(t.schema.tryDefinition(g),g))).join(" or "):o(e.name).label,c=!(e.optional||e.control==="boolean"),p=c?(0,P.jsxs)(P.Fragment,{children:[d,(0,P.jsx)("span",{"aria-hidden":"true",children:" *"})]}):d;switch(e.control){case"text":case"date":return e.control==="text"&&e.long?(0,P.jsxs)("label",{"data-graview-part":"field","data-graview-field":"text",children:[(0,P.jsxs)("span",{"data-graview-part":"label",children:[p,e.markdown?(0,P.jsx)("span",{style:{fontWeight:"normal",color:"var(--graview-ink-faint)"},children:" \xB7 Markdown"}):null]}),(0,P.jsx)("textarea",{name:e.name,required:!e.optional,rows:6,value:typeof n=="string"?n:"",onChange:g=>a(g.target.value),"data-graview-part":"control",style:{fieldSizing:"content",minHeight:"7.5em",resize:"vertical",font:"inherit",lineHeight:1.5}})]}):e.control==="date"?(0,P.jsxs)("div",{"data-graview-part":"field","data-graview-field":"date",children:[(0,P.jsx)("span",{"data-graview-part":"label",children:p}),(0,P.jsx)(gr,{name:e.name,label:o(e.name).label,required:!e.optional,value:typeof n=="string"&&n!==""?n:void 0,time:e.time===!0,instant:e.instant===!0,onChange:a})]}):(0,P.jsxs)("label",{"data-graview-part":"field","data-graview-field":e.control==="text"&&e.holds?e.holds:e.control,children:[(0,P.jsx)("span",{"data-graview-part":"label",children:p}),(0,P.jsx)("input",{type:e.control==="text"&&e.holds==="phone"?"tel":"text",name:e.name,required:!e.optional,...e.control==="text"&&e.app?{placeholder:"@owner/app or https://\u2026"}:{},...e.control==="text"&&e.holds?{placeholder:no[e.holds]}:{},...e.control==="text"&&e.holds==="phone"?{autoComplete:"tel"}:{},value:typeof n=="string"?n:typeof n=="number"?String(n):"",onChange:g=>a(g.target.value),"data-graview-part":"control"})]});case"number":return e.amount?(0,P.jsx)(eo,{title:p,name:e.name,optional:e.optional,amount:e.amount,value:n,onChange:a}):(0,P.jsxs)("label",{"data-graview-part":"field","data-graview-field":e.control,children:[(0,P.jsx)("span",{"data-graview-part":"label",children:p}),(0,P.jsx)("input",{type:"number",name:e.name,required:!e.optional,...e.min===void 0?{}:{min:e.min},...e.max===void 0?{}:{max:e.max},...e.step===void 0?{}:{step:e.step},value:typeof n=="number"?n:"",onChange:g=>a(g.target.value===""?void 0:Number(g.target.value)),"data-graview-part":"control"})]});case"boolean":return(0,P.jsxs)("label",{"data-graview-part":"field","data-graview-field":"boolean",children:[(0,P.jsx)("input",{type:"checkbox",name:e.name,checked:n===!0,onChange:g=>a(g.target.checked),"data-graview-part":"control"}),(0,P.jsx)("span",{"data-graview-part":"label",children:p})]});case"choice":return(0,P.jsxs)("label",{"data-graview-part":"field","data-graview-field":e.control,children:[(0,P.jsx)("span",{"data-graview-part":"label",children:p}),(0,P.jsx)(gi,{children:(0,P.jsxs)("select",{name:e.name,required:!e.optional,value:typeof n=="string"?n:"",onChange:g=>a(g.target.value||void 0),"data-graview-part":"control",children:[(0,P.jsx)("option",{value:"",children:"\u2014"}),(e.options??[]).map(g=>(0,P.jsx)("option",{value:g,children:o(e.name).option(g)},g))]})})]});case"node":{let g=i.find(y=>y.name===e.name)?.candidates,f=new Set(Object.values(r).filter(y=>typeof y=="string")),u=(e.kinds.includes("*")?[...t.graph.allNodes()]:e.kinds.flatMap(y=>t.graph.nodesOfKind(y))).filter(y=>!f.has(y.id)),k=g?g.map(y=>t.graph.getNode(y)).filter(y=>y!==void 0):u,E=Ht(k,y=>t.schema.tryDefinition(y));return(0,P.jsxs)("label",{"data-graview-part":"field","data-graview-field":e.control,children:[(0,P.jsx)("span",{"data-graview-part":"label",children:p}),(0,P.jsx)(gi,{children:(0,P.jsxs)("select",{name:e.name,required:!e.optional,value:typeof n=="string"?n:"",onChange:y=>a(y.target.value||void 0),"data-graview-part":"control",children:[(0,P.jsx)("option",{value:"",children:"\u2014"}),k.map(y=>{let x=E.get(y.id);return(0,P.jsxs)("option",{value:y.id,children:[se(t.schema.tryDefinition(y.kind),y),x?` \xB7 ${x}`:""]},y.id)})]})})]})}case"group":{let g=n??{};return(0,P.jsxs)("fieldset",{"data-graview-part":"group","data-graview-field":e.control,children:[(0,P.jsx)("legend",{"data-graview-part":"label",children:p}),e.fields.map(f=>(0,P.jsx)(Jt,{store:t,spec:f,value:g[f.name],onChange:u=>a({...g,[f.name]:u}),prefilled:r,open:i,words:o},f.name))]})}case"variant":{let g=n??{},f=typeof g[e.tag]=="string"?g[e.tag]:"",u=e.options.find(k=>k.value===f);return(0,P.jsxs)("fieldset",{"data-graview-part":"group","data-graview-field":e.control,children:[(0,P.jsx)("legend",{"data-graview-part":"label",children:p}),(0,P.jsxs)("label",{"data-graview-part":"field","data-graview-field":"choice",children:[(0,P.jsx)("span",{"data-graview-part":"label",children:Se(e.tag)}),(0,P.jsxs)("select",{value:f,onChange:k=>a({[e.tag]:k.target.value}),"data-graview-part":"control",children:[(0,P.jsx)("option",{value:"",children:"\u2014"}),e.options.map(k=>(0,P.jsx)("option",{value:k.value,children:Se(k.value)},k.value))]})]}),u?.fields.map(k=>(0,P.jsx)(Jt,{store:t,spec:k,value:g[k.name],onChange:E=>a({...g,[k.name]:E}),prefilled:r,open:i,words:o},k.name))]})}case"file":case"list":{let g=e.control==="file"?e:e.item.control==="file"?e.item:void 0;if(g||e.control==="file")return(0,P.jsx)(je,{as:"control",title:c?`${d} *`:d,value:n,onChange:a,several:g!==e,image:g?.image===!0,video:g?.video===!0,label:d});let f=Array.isArray(n)?n:[];return(0,P.jsxs)("fieldset",{"data-graview-part":"group","data-graview-field":"list",children:[(0,P.jsx)("legend",{"data-graview-part":"label",children:p}),f.map((u,k)=>(0,P.jsxs)("div",{"data-graview-part":"item",children:[(0,P.jsx)("div",{style:{flex:1},children:(0,P.jsx)(Jt,{store:t,spec:{...e.item,optional:!1},value:u,onChange:E=>a(f.map((y,x)=>x===k?E:y)),prefilled:r,open:i,words:o})}),(0,P.jsx)("button",{type:"button","data-graview-part":"remove",onClick:()=>a(f.filter((E,y)=>y!==k)),children:"remove"})]},k)),(0,P.jsx)("button",{type:"button","data-graview-part":"add",onClick:()=>a([...f,void 0]),children:"add another"})]})}case"linked":return(0,P.jsx)("div",{"data-graview-part":"field","data-graview-field":"linked",children:(0,P.jsx)(cr,{relation:e.relation,value:n,onChange:a,label:d})});case"repeat":return(0,P.jsx)(pr,{value:n,onChange:a,start:e.of?l?.[e.of]:void 0,label:`${e.of?o(e.of).label:d} repeats`,name:e.name});case"opaque":return(0,P.jsxs)("p",{"data-graview-part":"unasked",children:["\u201C",Se(e.name),"\u201D needs a structured answer this form cannot ask for yet."]})}}function De({store:t,mutation:e,prefilled:n={},open:a=[],onDone:r,principal:i,initial:o,label:l,only:d}){let c=()=>hr(e,t.graph,n),[p,g]=(0,Je.useState)(c),[f,u]=(0,Je.useState)(()=>({...p,...o})),[k,E]=(0,Je.useState)(null),y=i??t.seenFor,x=e.subject&&n[e.subject.arg],N=y?vr(t,y,e,typeof x=="string"?x:void 0):void 0,C=Wt(e.input).filter(K=>(d===void 0||d.includes(K.name))&&!N?.has(K.name)),D=K=>Xa(t.schema,e,K),V=nr(C.filter(K=>K.control==="date").map(K=>K.name)),le=(0,Je.useRef)(void 0),me=(K,Y)=>u(oe=>{let ke={...oe,[K.name]:Y};if(V&&K.name===V.start&&K.control==="date"){let de=b=>typeof b=="string"&&b!==""?b:void 0,fe=de(oe[V.start])??le.current;if(de(Y)){le.current=de(Y);let b=tr(fe,de(Y),de(oe[V.end]),{time:K.time===!0,instant:K.instant===!0});b!==void 0&&(ke[V.end]=b)}}return ke});return(0,P.jsxs)("form",{"data-testid":`form-${e.name}`,onSubmit:K=>{K.preventDefault();try{t.apply({name:e.name,args:{...wr(yr(C,f),p),...n}},i?{author:i}:{}),E(null);let Y=c();g(Y),u({...Y}),r?.()}catch(Y){E(dt(t.schema,t.allMutations(),Y))}},"data-graview-part":"form",children:[(0,P.jsx)("style",{children:Ji}),C.map(K=>(0,P.jsx)(Jt,{store:t,spec:K,value:f[K.name],values:f,onChange:Y=>me(K,Y),prefilled:n,open:a,words:D},K.name)),k?(0,P.jsx)("p",{"data-testid":"refused","data-graview-part":"refused",role:"alert",children:k}):null,(0,P.jsx)("button",{type:"submit","data-graview-part":"submit",children:l??e.title??e.name})]})}var kt=I(Fe(),1);var Me=I(j(),1),ro={problems:"Problems",search:"Search",map:"Connections",places:"Pictures","~draft":"A view drawn"},io=t=>{try{return decodeURIComponent(t)}catch{return t}};function oo(t,e,n={}){let{store:a}=t,r=a.schema,i=(n.base??"").replace(/\/$/,""),[o="/",l=""]=e.split("#")[0].split("?"),d=(x,N,C)=>({label:x,href:`${i}${N}`,path:N,...C?{current:C}:{}}),c=x=>{let N=n.registry?.sectionOf(x);return N?[N.path===void 0?{label:N.label}:d(N.label,N.path)]:[]},p=x=>n.registry?.sectionOf(x)?.label,g=x=>{let N=p(x);return N===void 0?{}:{section:N}},[f,u,...k]=o.split("/").filter(Boolean).map(io);if(f===void 0)return{as:"home",label:"Home",trail:[d("Home","/",!0)]};if(f==="places"&&u!==void 0&&k.length===0){let x=new URLSearchParams(l).get("of"),N=new Set(We(a,t.principal)),C=t.views?.places()??[],D=C.find(V=>N.has(V.kind)&&V.as===u&&(!x||_(r,V.kind)===x));if(D){let V=zt(D.as,Nt(D,C)?_(r,D.kind):void 0);return{as:"place",kind:D.kind,label:D.title,...g(D.kind),trail:[...c(D.kind),d(D.title,V,!0)]}}}let E=k.length===0?xe(r,f):void 0;if(E!==void 0){let x=d(Ve(r,E),`/${_(r,E)}`);if(u===void 0)return{as:"list",kind:E,label:x.label,...g(E),trail:[...c(E),{...x,current:!0}]};let N=a.graph.getNode(u),C=N&&N.kind===E?se(r.tryDefinition(E),N):"Nothing lives here";return{as:"record",kind:E,id:u,label:C,...g(E),trail:[...c(E),x,d(C,Q(r,E,u),!0)]}}let y=ro[f]??so((k.at(-1)??u??f).replace(/[-_]+/g," "));return{as:"page",label:y,trail:[d(y,o,!0)]}}var so=t=>t.charAt(0).toUpperCase()+t.slice(1),Bn=(0,kt.createContext)(null);function lo(t){let e=ye(),n=pt("/");return X(t.context.store),oo(t.context,`${e.pathname}${e.search}`,{registry:t.registry,base:n})}var co={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0},mi={display:"flex",alignItems:"center",gap:6,minWidth:0},fi={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,lineHeight:"24px"};function gt({context:t,style:e}){let n=(0,kt.useContext)(Bn),a=(0,kt.useContext)(vt);return bt(a??uo,"trail")||n?.registry?.without().has("trail")?null:(0,Me.jsx)(po,{root:n??{context:t,registry:void 0},context:t,...e?{style:e}:{}})}function po({root:t,context:e,style:n}){let a=lo(t);return a.trail.length<2?null:(0,Me.jsx)(go,{here:a,mark:a.as==="record"?{kind:a.kind,context:e}:void 0,...n?{style:n}:{},"data-testid":"page-trail"})}var uo={count:()=>0,place:()=>()=>{},subscribe:()=>()=>{}};function go({here:t,mark:e,style:n,...a}){let r=t.as==="record"?t.trail.length-2:-1;return(0,Me.jsx)("nav",{"aria-label":"You are here","data-graview-trail":"",style:{minWidth:0,...n},...a,children:(0,Me.jsx)("ol",{style:{...be,listStyle:"none",padding:0,display:"flex",alignItems:"center",gap:6,minWidth:0,overflow:"hidden"},children:t.trail.map((i,o)=>(0,Me.jsxs)("li",{style:i.current?co:{...mi,flexShrink:o===t.trail.length-2?0:1,maxWidth:"100%"},...i.current?{"aria-current":"page"}:{},children:[o>0&&!i.current?(0,Me.jsx)("span",{"aria-hidden":"true",children:"\u203A"}):null,i.current?i.label:i.path!==void 0?(0,Me.jsxs)(W,{to:i.path,style:{...Pe,...mi},...o===r?{"data-testid":"trail-list"}:{},children:[o===r&&e?(0,Me.jsx)(ue,{kind:e.kind,brand:e.context.brand,schema:e.context.store.schema,size:8}):null,(0,Me.jsx)("span",{style:fi,children:i.label})]}):(0,Me.jsx)("span",{style:fi,children:i.label})]},`${o}:${i.label}`))})})}var M=I(j(),1);function Ee(t){let e=t.views;if(!e)return[];let n=new Set(We(t.store,t.principal));return e.places().filter(a=>n.has(a.kind))}function en(t,e){if(!e.over)return[e.kind];let n=new Set(We(t.store,t.principal));return e.over.filter(a=>a===e.kind||n.has(a))}var et=t=>`place:${t.kind}:${t.as}`;function he(t,e){return zt(e.as,Nt(e,t.views?.places()??[])?_(t.store.schema,e.kind):void 0)}function St(t,e){let n=t.schema.tryDefinition(e);return t.graph.nodesOfKind(e).filter(a=>st(n,a))}function Gn(t,e,n){let a=(i,o)=>Mt(t.schema,o,i),r=(typeof e=="string"?[e]:e).map(i=>a(St(t,i).length,i)).join(" and ");return n?`${r} across ${a(St(t,n).length,n)}`:r}function Un({context:t,place:e,chosen:n,filter:a}){let{store:r,views:i,invariantContext:o}=t,d=i?.resolve(e.kind,{cardinality:"many",fidelity:"full"},e.as)?.view,c=[...new Set(r.violations(o).flatMap(f=>f.nodeIds))],p=en(t,e).flatMap(f=>St(r,f));if(!d)return null;let g=mo(r,p,a,c);return(0,M.jsx)(Mn,{kind:e.kind,view:e.title,children:(0,M.jsx)(d,{nodes:g,label:e.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1,...n&&n.length>0?{implicated:n}:{},...c.length>0?{flagged:c}:{}})})}function mo(t,e,n,a){let r=n?$t({filter:n}).filter??[]:[];return r.length===0?e:Kt(e,{filter:r},{schema:t.schema,graph:t.graph,flagged:new Set(a)}).nodes}function fo({store:t,views:e,as:n,invariantContext:a}){X(t);let r={store:t,views:e,...a?{invariantContext:a}:{}},i=e.places().find(o=>o.as===n);return i?(0,M.jsx)(Un,{context:r,place:i}):null}function yo({context:t,kind:e}){let{store:n,views:a,invariantContext:r}=t,i=St(n,e),o=n.schema.tryDefinition(e),l=Z(n,e),c=a?.resolve(e,{cardinality:"many",fidelity:"full"})?.view,p=[...new Set(n.violations(r).flatMap(k=>k.nodeIds))];if(c&&!lt(c))return(0,M.jsx)(Mn,{kind:e,children:(0,M.jsx)(c,{nodes:i,label:l,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1,...p.length>0?{flagged:p}:{}})});let g=a?.resolve(e,{cardinality:"one",fidelity:"summary"})?.view,f=8,u=i.slice(0,f);return(0,M.jsxs)("div",{"data-testid":"kind-sheet",style:g?{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gridAutoRows:"max-content",alignContent:"center",gap:12,padding:24}:{display:"flex",flexWrap:"wrap",alignContent:"center",justifyContent:"center",gap:10,padding:24},children:[u.map(k=>g?(0,M.jsx)(g,{node:k,fidelity:"summary",cardinality:"one",mode:"fullscreen",selected:!1,...p.includes(k.id)?{flagged:[k.id]}:{}},k.id):(0,M.jsx)("span",{style:{padding:"8px 14px",borderRadius:8,border:"1px solid var(--graview-edge-bright)",background:"var(--graview-ground)",color:"var(--graview-ink)"},children:se(o,k)},k.id)),i.length>f?(0,M.jsxs)("span",{style:{...L,alignSelf:"center",padding:"0 6px"},children:["+",i.length-f," more ",l.toLowerCase()]}):null]})}function Vn(t){let{store:e}=t,n=ri(t),a=Ee(t),r=t.views?.arrangement?.()?.order??[],i=d=>{let c=d.name===void 0?-1:r.indexOf(`view:${d.name}`);return c>=0?c-r.length:n.indexOf(d.kind)},o=An([...a].sort((d,c)=>i(d)-i(c))).filter(d=>!d.hidden),l=new Set(o.flatMap(d=>d.over??[d.kind]));return[...o.map(d=>({key:et(d),kind:d.kind,title:La(d,a,e.schema),to:he(t,d),place:d})),...Qt(t).filter(d=>!l.has(d)).map(d=>({key:`kind:${d}`,kind:d,title:Z(e,d),to:`/${_(e.schema,d)}`}))]}var yi=.72,ho=540,hi=16/10;function wo(t){let e=(0,Ge.useRef)(null),[n,a]=(0,Ge.useState)(t);return(0,Ge.useLayoutEffect)(()=>{let r=e.current;if(!r||typeof ResizeObserver>"u")return;let i=()=>{let l=r.getBoundingClientRect().width;l>0&&a(d=>Math.abs(d-l)<.5?d:l)};i();let o=new ResizeObserver(i);return o.observe(r),()=>o.disconnect()},[]),{ref:e,width:n}}function vo(t){for(let e=t.parentElement;e;e=e.parentElement)if(/(auto|scroll)/.test(getComputedStyle(e).overflowY))return e;return null}function bo(t){let[e,n]=(0,Ge.useState)(()=>typeof IntersectionObserver>"u");return(0,Ge.useLayoutEffect)(()=>{let a=t.current;if(e||!a)return;let r=new IntersectionObserver(i=>{i.some(o=>o.isIntersecting)&&(r.disconnect(),n(!0))},{root:vo(a),rootMargin:"50% 0px"});return r.observe(a),()=>r.disconnect()},[e,t]),e}function jn({context:t,entry:e}){let{store:n,brand:a,principal:r}=t,{ref:i,width:o}=wo(ho),l=bo(i),d=o/yi,c=St(n,e.kind),p=n.schema.tryDefinition(e.kind),g=c.length===0?Ze(n,e.kind,{...r?{principal:r}:{},...t.invariantContext?{context:t.invariantContext}:{}}).actions.affordances[0]:void 0,f=e.place!==void 0;return(0,M.jsxs)(W,{to:e.to,"data-testid":f?"place-card":"kind-card",className:"graview-gallery-card",style:{...Pe,display:"grid",gap:10,alignContent:"start",minWidth:0},children:[(0,M.jsxs)("span",{ref:i,"data-testid":f?"place-picture":"kind-picture","aria-hidden":"true",inert:!0,style:{display:"block",position:"relative",width:"100%",aspectRatio:`${hi}`,overflow:"hidden",borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",pointerEvents:"none"},children:[(0,M.jsx)("span",{style:{position:"absolute",left:0,top:0,width:d,height:d/hi,display:"grid",gridTemplateRows:"minmax(0, 1fr)",transform:`scale(${yi})`,transformOrigin:"0 0"},children:l?(0,M.jsx)(Gt.Provider,{value:null,children:e.place?(0,M.jsx)(Un,{context:t,place:e.place}):(0,M.jsx)(yo,{context:t,kind:e.kind})}):null}),c.length===0?(0,M.jsx)("span",{"data-testid":"picture-empty",style:{position:"absolute",inset:0,display:"grid",placeContent:"center",justifyItems:"center",gap:2,padding:20,textAlign:"center"},children:(0,M.jsxs)("span",{style:{display:"grid",gap:2,padding:"10px 16px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-ground)",color:"var(--graview-ink)"},children:[(0,M.jsxs)("span",{style:{fontFamily:Wn,fontWeight:"var(--graview-weight-display)"},children:["No ",Z(n,e.kind).toLowerCase()," yet"]}),g?(0,M.jsxs)("span",{style:L,children:["Begin with \u201C",g.label,"\u201D"]}):null]})}):null]}),(0,M.jsxs)("span",{style:{display:"grid",gap:2,minWidth:0},children:[(0,M.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0},children:[f?null:(0,M.jsx)(ue,{kind:e.kind,brand:a,schema:n.schema,size:8}),(0,M.jsx)("span",{style:{fontFamily:Wn,fontSize:"var(--graview-text-heading)",fontWeight:"var(--graview-weight-display)",lineHeight:1.3,overflowWrap:"anywhere",textWrap:"balance"},children:e.title})]}),(0,M.jsxs)("span",{style:L,children:[e.place?Gn(n,en(t,e.place),e.place.across):Gn(n,e.kind),!f&&p?.description?` \xB7 ${p.description}`:null]})]})]})}var wi={display:"grid",gap:"32px 28px",gridTemplateColumns:"repeat(auto-fill, minmax(min(420px, 100%), 1fr))"},ko=`
|
|
105
|
-
.graview-gallery-card > span:first-child { transition: border-color 160ms ease, box-shadow 160ms ease; }
|
|
106
|
-
.graview-gallery-card:hover > span:first-child,
|
|
107
|
-
.graview-gallery-card:focus-visible > span:first-child { border-color: var(--graview-edge-bright); box-shadow: 0 1px 0 var(--graview-edge), 0 10px 30px -18px var(--graview-ink); }
|
|
108
|
-
`;function zn({context:t}){X(t.store);let e=Vn(t);return e.length===0?null:(0,M.jsxs)("section",{style:wi,"data-testid":"gallery",children:[(0,M.jsx)("style",{children:ko}),e.map(n=>(0,M.jsx)(jn,{context:t,entry:n},n.key))]})}function _n({context:t}){let{store:e}=t;X(e);let n=An(Ee(t)).filter(r=>!r.hidden),a=Vn(t);return(0,M.jsxs)(ae,{context:t,style:ct,children:[(0,M.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,M.jsx)("p",{style:be,children:n.length===0?"None of its own yet":`${n.length} ${n.length===1?"picture":"pictures"}`}),(0,M.jsx)(ie,{context:t,children:"Pictures"}),(0,M.jsx)("p",{style:re,children:n.length===0?"Nothing here has a picture of its own yet, so each kind is drawn as the scene draws it. Title a group view and it appears here by name.":"The ways this installation looks at what it holds \u2014 each one the same picture the scene shows, here as a page."})]}),a.length>0?(0,M.jsx)("div",{style:wi,"data-testid":"places",children:a.map(r=>(0,M.jsx)(jn,{context:t,entry:r},r.key))}):null]})}function Yn({context:t}){let{store:e,principal:n}=t;X(e);let a=ze(),r=Be(),[i]=ut(),o=decodeURIComponent(a.as??""),[l,d]=(0,Ge.useState)(null),c=i.get("of"),p=i.get("filter"),f=Ee(t).find(C=>C.as===o&&(!c||_(e.schema,C.kind)===c));if(!f)return(0,M.jsxs)(ae,{context:t,children:[(0,M.jsx)(ie,{context:t,children:"No picture is called that."}),(0,M.jsx)("p",{style:re,children:(0,M.jsxs)(W,{to:"/places",style:G,children:["The pictures there are ",(0,M.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]})})]});let u=Z(e,f.kind),k=t.views?.resolve(f.kind,{cardinality:"many",fidelity:"full"},f.as)?.view,E=k?.flows===!0,y=k?.creates!==!1,x=Ze(e,f.kind,{...n?{principal:n}:{},...t.invariantContext?{context:t.invariantContext}:{}}),N=y?x.actions.affordances.map(C=>({affordance:C,mutation:e.allMutations().find(D=>D.name===C.mutation)})).filter(C=>C.mutation!==void 0):[];return(0,M.jsxs)(ae,{context:t,style:ct,children:[(0,M.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,M.jsx)(gt,{context:t}),(0,M.jsx)(ie,{context:t,children:f.title}),(0,M.jsxs)("p",{style:re,"data-testid":"place-lede",children:[Gn(e,en(t,f),f.across),"."]}),p&&!E?(0,M.jsxs)("p",{style:{...L,margin:0},"data-testid":"place-narrowed",children:[`Only those where ${p.split(",").map(C=>C.replace(":"," is ")).join(" and ")}. `,(0,M.jsx)(W,{to:`?${(()=>{let C=new URLSearchParams(i);return C.delete("filter"),C.toString()})()}`,style:{...G,...L},children:"Show all"})]}):null,(0,M.jsx)("p",{style:{...L,margin:0,display:"flex",flexWrap:"wrap",gap:"4px 16px"},children:en(t,f).map((C,D)=>(0,M.jsxs)(W,{to:`/${_(e.schema,C)}`,style:{...G,...L},...D===0?{"data-testid":"place-as-list"}:{},children:["All ",(C===f.kind?u:Z(e,C)).toLowerCase()," as a list ",(0,M.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]},C))})]}),(0,M.jsx)("div",{"data-testid":"place-lens","data-flows":E?"":void 0,style:E?{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",maxWidth:"100%"}:{height:"min(72vh, 760px)",display:"grid",gridTemplateRows:"minmax(0, 1fr)",overflow:"auto",maxWidth:"100%",borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)"},onClick:C=>{let D=C.target?.closest("[data-graview-pick]"),V=D?.getAttribute("data-graview-pick"),le=D?.getAttribute("data-graview-joins");if(le)try{let K=JSON.parse(le);if(Array.isArray(K)&&K.every(Y=>typeof Y=="string")){C.preventDefault(),d({at:et(f),ids:K});return}}catch{}if(!V)return;let me=e.graph.getNode(V);me&&(C.preventDefault(),r(Q(e.schema,me.kind,V)))},children:(0,M.jsx)(Un,{context:t,place:f,filter:p,...l?.at===et(f)?{chosen:l.ids}:{}})}),N.length>0?(0,M.jsx)("div",{style:{maxWidth:760,display:"grid",gap:40},"data-testid":"place-creators",children:N.map(({affordance:C,mutation:D})=>(0,M.jsxs)("section",{style:{...ne,display:"grid",gap:14},children:[(0,M.jsx)("h2",{style:ee,children:D.title??D.name}),D.description?(0,M.jsx)("p",{style:{...L,margin:0,maxWidth:"58ch"},children:D.description}):null,(0,M.jsx)(De,{store:e,mutation:D,prefilled:C.args,open:C.open,label:C.label,...n?{principal:n}:{}})]},C.id))}):null]})}function So(t,e=document){let n=Vt(t);if(!n)return null;let a=[e,...[...e.querySelectorAll("[data-worker-view]")].flatMap(r=>r.shadowRoot?[r.shadowRoot]:[])];for(let r of a)for(let i of r.querySelectorAll("[id], [data-section]")){let o=i.getAttribute("data-section")??i.id;if(o===t||Vt(o)===n)return i}for(let r of a)for(let i of r.querySelectorAll("h1, h2, h3, h4, h5, h6, [role=heading]"))if(Vt(i.textContent??"")===n)return i;return null}function vi(t,e={}){if(typeof document>"u"||typeof requestAnimationFrame>"u")return()=>{};let n=e.frames??120,a=0,r=()=>{let i=So(t,e.root??document);if(i){i.hasAttribute("tabindex")||i.setAttribute("tabindex","-1"),i.scrollIntoView?.({block:"start"}),i.focus({preventScroll:!0});return}n-=1,n>0&&(a=requestAnimationFrame(r))};return a=requestAnimationFrame(()=>{a=requestAnimationFrame(r)}),()=>cancelAnimationFrame(a)}var z=I(Fe(),1);var tn=I(Fe(),1);var tt=I(j(),1);function bi({context:t}){return pe()?(0,tt.jsxs)(tt.Fragment,{children:[(0,tt.jsx)(xo,{context:t}),(0,tt.jsx)(zr,{face:"pages",on:t.quickAsk??!0})]}):null}function xo({context:t}){let{store:e}=t,n=pe(),{pathname:a}=ye(),r=(0,tn.useRef)(n?.setSelection);return r.current=n?.setSelection,(0,tn.useEffect)(()=>{let i=r.current;if(!i)return;let[,o,l]=a.split("/"),d=(()=>{if(o==="places"){let p=t.views?.places().find(g=>g.as===decodeURIComponent(l??""));return p?[He(p.kind)]:[]}let c=o?xe(e.schema,o):void 0;return c&&l?[decodeURIComponent(l)]:c?[Na(c)]:[]})();i(c=>c.length===d.length&&c.every((p,g)=>p===d[g])?c:d)},[a]),null}var we=I(Fe(),1);var Si=I(Xi(),1);var ge=I(j(),1);var Po=(0,we.lazy)(Ot(Ea(()=>(__graviewPreload(import.meta.url,["./chunk.PSTE3LZL.js","./chunk.UGFDSE37.js","./chunk.JGYGSNQY.js","./chunk.JLOSQ5UY.js","./chunk.FNF6XQI5.js","./chunk.LUPBT6YM.js","./chunk.IBWPRK2R.js","./chunk.RNUGQRJI.js","./chunk.6NFR2LYQ.js","./chunk.YERDP6YF.js","./chunk.P5K7EYDK.js","./chunk.7AEE3VHC.js","./chunk.U3CV5CCL.js","./chunk.LKF4BBCW.js","./chunk.NPS2WN7T.js","./chunk.JUT2VCFW.js","./chunk.HKD5SR45.js","./chunk.JEMQ66FT.js","./chunk.7UV7ODXU.js","./chunk.IIB22IIP.js","./chunk.MWUP5X47.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.ESU2DD3J.js","./chunk.PL2P2OON.js","./chunk.27ZVVPRZ.js","./chunk.IN4PKQO5.js","./chunk.3IUJ4GW7.js","./chunk.UG23RICT.js","./chunk.GZHZLJBF.js","./chunk.ATKKTPJS.js","./chunk.OJGHDWI6.js","./chunk.UZSZPMRC.js","./chunk.MZOIPCDA.js","./chunk.KERLVJ6I.js","./chunk.4EPT2CQG.js","./chunk.FNXW46U4.js","./chunk.4JWT6LIS.js","./chunk.SDO3U72B.js","./chunk.AW2T3KFV.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.IPHWGBZE.js")).then(t=>({default:t.TakeBack})))));function Ao({context:t,docked:e,at:n,...a}){let{store:r}=t,i=X(r),[o]=(0,we.useState)(()=>r.batches().length),l=(0,we.useRef)(!1);return l.current||=i>0||!e&&o>0,l.current?(0,ge.jsx)(we.Suspense,{fallback:null,children:(0,ge.jsx)(Po,{context:t,docked:e,at:n,since:o,...a})}):null}function Co(t,e,n){let{store:a,principal:r,embedded:i}=t;(0,we.useEffect)(()=>{if(!n)return;let o=l=>{if(!ei(l))return;let d=l.target,c=d instanceof Node&&e.current?.contains(d),p=d===document.body||d===document.documentElement||d===document;if(!(!c&&!(p&&!i))&&Xr(a,r)){l.preventDefault();try{Jr(a,r)}catch{}}};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[a,r,i,e,n])}function xi({context:t,registry:e,root:n,children:a}){let r=(0,we.useMemo)(di,[]),i=e?.without()??new Set;return Co(t,n,!i.has("undo")),(0,ge.jsxs)(vt.Provider,{value:r,children:[(0,ge.jsx)(Ro,{context:t,placed:r,without:i}),a]})}function Ro({context:t,placed:e,without:n}){let[a,r]=(0,we.useState)(!1);(0,we.useLayoutEffect)(()=>r(!0),[]);let i=bt(e,"find"),o=bt(e,"undo"),l=ye(),d=Pr();if(!a)return null;let c=l.pathname.split("/").filter(Boolean),g=(c.length===1?xe(t.store.schema,c[0]):void 0)!==void 0;return(0,ge.jsxs)(ge.Fragment,{children:[!i&&!n.has("find")&&d?(0,Si.createPortal)((0,ge.jsx)(ki,{context:t,narrowsLists:g}),d.slot):null,!i&&!n.has("find")&&!d?(0,ge.jsx)("div",{"data-testid":"face-find-bar",style:{display:"flex",alignItems:"center",padding:"8px 16px",borderBottom:"1px solid var(--graview-edge)",background:"var(--graview-bar)",minWidth:0},children:(0,ge.jsx)(ki,{context:t,narrowsLists:g})}):null,!o&&!n.has("undo")?(0,ge.jsx)(Ao,{context:t,docked:!0,at:l.pathname+l.search}):null,d?.own&&!n.has("undo")?(0,ge.jsx)(ii,{context:t,own:d.own}):null]})}function ki({context:t,narrowsLists:e}){return(0,ge.jsx)(vt.Provider,{value:null,children:(0,ge.jsx)(qn,{context:t,narrowsLists:e})})}var J=I(Fe(),1);var Ce=I(j(),1),Lo=500,To=10;function nn(t){return t instanceof HTMLElement?t.isContentEditable||t.tagName==="TEXTAREA"||t.tagName==="SELECT"?!0:t.tagName==="INPUT"&&!["button","submit","reset","checkbox","radio","image","file","color","range"].includes(t.type):!1}function Mo(t){let e=typeof getSelection=="function"?getSelection():null;return e!==null&&!e.isCollapsed&&e.containsNode(t,!0)}function Pi(t){let e=t.closest('a[href], button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"])');if(e)return e;let n=document.activeElement;return n instanceof HTMLElement&&n!==document.body?n:null}function Ai({context:t,root:e,children:n}){return pe()===null?(0,Ce.jsx)(Ce.Fragment,{children:n}):(0,Ce.jsx)(Eo,{context:t,root:e,children:n})}function Eo({context:t,root:e,children:n}){let{setMenuAt:a}=Wa(),{store:r}=t,i=r.schema,o=Be(),{pathname:l,search:d}=ye(),c=pt("/").replace(/\/$/,""),p=(0,J.useCallback)((b,h)=>t.views?.places().find(T=>T.as===b&&(h===null||T.kind===h)),[t.views]),g=(0,J.useCallback)((b,h)=>{let[T="",F,m]=b.split("/").filter(Boolean).map(H=>{try{return decodeURIComponent(H)}catch{return H}});if(m!==void 0)return null;if(T==="places"&&F!==void 0){let H=p(F,new URLSearchParams(h).get("of"));return H?{face:"pages",place:H.as,about:[He(H.kind)],title:H.title}:null}let R=xe(i,T);return R?F===void 0?{face:"pages",about:[He(R)],title:Ve(i,R)}:r.graph.getNode(F)?{face:"pages",on:F,about:[F]}:null:null},[i,r,p]),f=(0,J.useCallback)(b=>{let h=b.href;try{let T=new URL(h,location.href);if(T.origin===location.origin&&(c===""||T.pathname===c||T.pathname.startsWith(`${c}/`))){let F=g(T.pathname.slice(c.length),T.search);if(F)return{...F,href:h}}}catch{}return{face:"pages",about:[],href:h}},[c,g]),u=(0,J.useCallback)(()=>g(l,d)??{face:"pages",about:[]},[g,l,d]),k=(0,J.useCallback)(b=>{let h=u(),T=b.closest("[data-graview-field]")?.getAttribute("data-graview-field");if(T&&h.on!==void 0&&b.closest("[data-graview-pick], a[href]")===null)return{...h,field:T};let F=b.closest("[data-graview-act]")?.getAttribute("data-graview-act");if(F)return{...h,act:F};let m=b.closest("a[href]"),R=b.closest("[data-graview-listed]"),H=[b.closest("[data-graview-pick]")?.getAttribute("data-graview-pick"),R&&(!m||R.contains(m)&&m.classList.contains("graview-spec-item-link"))?R.getAttribute("data-graview-listed"):null].map(Ke=>Ke?r.graph.getNode(Ke):void 0).find(Boolean);if(H)return{face:"pages",on:H.id,about:[H.id],href:`${c}${Q(i,H.kind,H.id)}`};if(m)return f(m);let te=b.closest("[data-graview-record]")?.getAttribute("data-graview-record");return te&&r.graph.getNode(te)?{face:"pages",on:te,about:[te]}:h},[u,f,r,i,c]),E=(0,J.useCallback)(b=>{let h=e.current;if(h===null||!h.contains(b)||nn(b)||b.closest("[data-graview-popover]"))return null;let T=k(b);return{face:"pages",on:T.on,about:T.about??[],field:T.field,place:T.place,href:T.href,act:T.act,element:Pi(b)}},[k,e]),y=(0,J.useCallback)((b,h,T)=>{let F=k(b);a({...F,x:Math.round(h),y:Math.round(T),returnTo:Pi(b)})},[k,a]),x=(0,J.useCallback)(b=>{let h=b.getBoundingClientRect();y(b,h.left+Math.min(16,h.width/2),Math.min(h.bottom,h.top+36))},[y]),N=(0,J.useRef)(0),C=(0,J.useRef)(null),D=(0,J.useRef)(!1),V=()=>{C.current&&clearTimeout(C.current.timer),C.current=null};(0,J.useEffect)(()=>V,[]),(0,J.useEffect)(()=>{let b=h=>{if(h.defaultPrevented||!(h.key==="ContextMenu"||h.key==="F10"&&h.shiftKey))return;let T=e.current,F=h.target instanceof Element?h.target:null,m=F===null||F===document.body||F===document.documentElement,R=T!==null&&F!==null&&T.contains(F);if(!R&&!(m&&document.querySelector("[data-graview-face='pages']")===T)||nn(F)||F?.closest("[data-graview-popover]"))return;h.preventDefault(),N.current=Date.now();let H=R&&F instanceof HTMLElement?F:T?.querySelector("[data-graview-page-title], main h1, main")??null;H&&x(H)};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[e,x]),(0,J.useEffect)(()=>{let b=e.current;if(!b)return;let h=T=>{let F=T.detail;F&&a({...F,face:"pages"})};return b.addEventListener(Rn,h),()=>b.removeEventListener(Rn,h)},[e,a]);let le=(0,J.useMemo)(()=>b=>{if(b.face!=="pages")return null;let h=[],T=b.on===void 0?void 0:r.graph.getNode(b.on),F=b.place===void 0?void 0:t.views?.places().find($e=>$e.as===b.place),m=T?void 0:b.about.length===1&&b.about[0].startsWith("aggregate:")&&!F?No(b.about[0]):void 0,R=T?Q(i,T.kind,T.id):F?he(t,F):m?`/${_(i,m)}`:void 0,H=R!==void 0&&l===R.split("?")[0];R!==void 0&&!H&&h.push({id:"open",label:"Open",run:()=>o(R)});let te=R!==void 0?`${c}${R}`:b.href;te!==void 0&&h.push({id:"open-in-a-new-tab",label:"Open in a new tab",run:()=>void window.open(te,"_blank","noopener")});let Ke=T?`#focus=${encodeURIComponent(T.id)}`:F?`#focus=${encodeURIComponent(He(F.kind))}&view=${encodeURIComponent(F.as)}`:m?`#focus=${encodeURIComponent(He(m))}`:void 0;if(Ke!==void 0&&(t.overview||!t.embedded)){let $e=t.overview;h.push({id:"in-the-scene",label:"Show in the scene",run:()=>$e?$e(Ke):location.assign(`${t.sceneHref??"/"}${Ke}`)})}return T===void 0&&b.href===void 0&&h.push({id:"find",label:"Find\u2026",run:()=>{let $e=e.current?.querySelector('[data-testid="nav-find"]')??document.querySelector('[data-testid="nav-find"]');$e&&$e.offsetParent!==null?$e.focus():o("/search")}}),h.length>0?{id:"pages",items:h}:null},[r,i,t,l,c,o,e]),me=(0,J.useMemo)(()=>b=>{if(b.face!=="pages"||b.field===void 0||b.on===void 0)return null;let h=r.graph.getNode(b.on),T=b.element?.closest("[data-graview-field]")??e.current?.querySelector(`[data-graview-field="${CSS.escape(b.field)}"]`);return!h||!(T instanceof HTMLElement)||!T.hasAttribute("data-graview-editable")?null:{id:"field",at:"start",items:[{id:"change-field",label:`Change \u201C${ha(i.tryDefinition(h.kind),b.field)}\u201D`,run:()=>T.click()}]}},[r,i,e]),K=Yr(),Y=mr(),oe=Ir(),ke=(0,J.useCallback)((b,h)=>{l===he(t,b).split("?")[0]&&o(h?he(t,h):"/")},[l,t,o]),de=Zr(ke),fe=(0,J.useMemo)(()=>[me,oe,le,...de?[de]:[],...Y?[Y]:[],...K?[K]:[]],[me,oe,le,de,Y,K]);return(0,Ce.jsxs)(lr,{sections:fe,children:[(0,Ce.jsx)("div",{"data-graview-menu-ground":"",style:{display:"contents"},onContextMenu:b=>{let h=b.target;b.shiftKey||nn(h)||Mo(h)||(b.preventDefault(),!h.closest("[data-graview-popover]")&&(Date.now()-N.current<700||(b.clientX===0&&b.clientY===0&&h instanceof HTMLElement?x(h):y(h,b.clientX,b.clientY))))},onPointerDown:b=>{if(D.current=!1,b.pointerType==="mouse"||!b.isPrimary)return;let h=b.target;if(nn(h)||h.closest("[data-graview-choose], [data-graview-popover]"))return;V();let{clientX:T,clientY:F}=b;C.current={x:T,y:F,timer:setTimeout(()=>{C.current=null,D.current=!0,N.current=Date.now(),y(h,T,F)},Lo)}},onPointerMove:b=>{let h=C.current;h&&Math.hypot(b.clientX-h.x,b.clientY-h.y)>To&&V()},onPointerUp:V,onPointerCancel:V,onClickCapture:b=>{D.current&&(D.current=!1,b.preventDefault(),b.stopPropagation())},children:n}),(0,Ce.jsx)($o,{openAt:x,readyAt:E}),(0,Ce.jsx)(Qr,{placement:"page"}),(0,Ce.jsx)(fr,{})]})}function No(t){let e=t.slice(10).split("+");return e.length===1&&e[0]?e[0]:void 0}function $o({openAt:t,readyAt:e}){return(0,Ce.jsx)("span",{"data-graview-menu-home":"",tabIndex:-1,onFocus:n=>{if(n.target!==n.currentTarget)return;let a=n.currentTarget.closest("[data-graview-face]"),r=a?.querySelector("[data-graview-page-title]")??a?.querySelector("main h1, main")??null;r&&(r.hasAttribute("tabindex")||r.setAttribute("tabindex","-1"),r.focus({preventScroll:!0}))},style:{position:"absolute",width:0,height:0,overflow:"hidden"},children:(0,Ce.jsx)(jr,{placement:"menu",openActs:t,aimAt:e})})}var B=I(j(),1);function Ci(t,e){return e==="*"?{label:"anything",path:null}:{label:Z(t,e),path:`/${_(t.schema,e)}`}}function Oo({context:t,relation:e}){let{store:n}=t,a=Ci(n,e.from),r=Ci(n,e.to),i=o=>o.path?(0,B.jsx)(W,{to:o.path,style:{...Pe,fontWeight:550},children:o.label}):(0,B.jsx)("span",{children:o.label});return(0,B.jsxs)("li",{"data-testid":"relation","data-relation":e.edgeKind,style:{display:"grid",gridTemplateColumns:"30px minmax(0, 1fr) auto",gap:12,alignItems:"baseline"},children:[(0,B.jsx)(_r,{edgeKind:e.edgeKind,...t.brand?.kit?{kit:t.brand.kit}:{}}),(0,B.jsxs)("span",{style:{display:"grid",gap:1},children:[(0,B.jsxs)("span",{children:[i(a)," ",(0,B.jsxs)("span",{style:L,"data-graview-speaks-ids":"",children:[Se(e.edgeKind)," \u2192"]})," ",i(r)]}),e.description||e.inverse?(0,B.jsxs)("span",{style:L,children:[e.description?Le(e.description):null,e.description&&e.inverse?" \xB7 ":null,e.inverse?`from the other end, ${e.inverse}`:null]}):null]}),r.path?(0,B.jsx)(W,{to:`${r.path}?with=${encodeURIComponent(e.edgeKind)}`,style:{...G,...L,fontVariantNumeric:"tabular-nums",display:"inline-block",minWidth:24,minHeight:24,textAlign:"center"},title:`The ${r.label.toLowerCase()} that have this`,children:e.count}):(0,B.jsx)("span",{style:{...L,fontVariantNumeric:"tabular-nums"},children:e.count})]})}function Ri({context:t,heading:e=!0}){let{store:n}=t,a=new Set(We(n,t.principal)),r=Xe(n).relations.filter(i=>a.has(i.from)&&(i.to==="*"||a.has(i.to)));return r.length===0?null:(0,B.jsxs)("section",{style:{...ne,display:"grid",gap:12},"data-testid":"kind-map",children:[e?(0,B.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[(0,B.jsx)("h2",{style:ee,children:(0,B.jsx)(W,{to:"/map",style:Pe,children:"Connections"})}),(0,B.jsx)("span",{style:L,children:r.length===1?"1 relation":`${r.length} relations`})]}):null,(0,B.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:r.map(i=>(0,B.jsx)(Oo,{context:t,relation:i},`${i.edgeKind}|${i.from}|${i.to}`))})]})}function Qn({context:t}){let{store:e}=t;X(e);let n=new Set(We(e,t.principal)),a=Xe(e),r=a.relations.filter(i=>n.has(i.from));return(0,B.jsxs)(ae,{context:t,children:[(0,B.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,B.jsx)("p",{style:be,children:r.length===0?"No relations":`${r.length} ${r.length===1?"relation":"relations"}`}),(0,B.jsx)(ie,{context:t,children:"Connections"}),(0,B.jsx)("p",{style:re,children:r.length===0?"Nothing here is declared to relate to anything else yet.":"The kinds this installation holds, and the relations declared between them \u2014 each in the declaration's own words, with how many of it there are."})]}),(0,B.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"6px 18px"},"data-testid":"map-kinds",children:a.kinds.filter(i=>n.has(i.kind)).map(i=>(0,B.jsxs)("li",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[(0,B.jsx)(ue,{kind:i.kind,brand:t.brand,schema:e.schema,size:7}),(0,B.jsx)(W,{to:`/${_(e.schema,i.kind)}`,style:G,children:i.plural}),(0,B.jsx)("span",{style:L,children:i.count})]},i.kind))}),(0,B.jsx)(Ri,{context:t,heading:!1})]})}function Li({context:t}){let n=[...pe()?.robots.values()??[]].filter(r=>r.mode==="asking"&&r.say);if(n.length===0)return null;let{store:a}=t;return(0,B.jsxs)("section",{style:{...ne,display:"grid",gap:10},"data-testid":"seat-questions",children:[(0,B.jsx)("h2",{style:ee,children:n.length===1?"The seat asked something":`The seat asked ${n.length} things`}),(0,B.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:8},children:n.map(r=>{let i=r.at?a.graph.getNode(r.at):void 0;return(0,B.jsxs)("li",{style:{display:"grid",gap:2},children:[(0,B.jsx)("span",{children:r.say}),i?(0,B.jsxs)(W,{to:Q(a.schema,i.kind,i.id),style:{...G,...L},children:[se(a.schema.tryDefinition(i.kind),i)," \u2192"]}):null]},r.participant)})})]})}var U=I(j(),1);function Zn({context:t}){let{principal:e}=t,{store:n,brand:a,invariantContext:r}=t;X(n);let i=n.violations(r),o=`${i.length===1?"A rule is broken":"Rules are broken"} \u2014 see what, and what would fix it`,l=[...n.log.all()].slice(-5).reverse(),c=Qt(t).map(x=>({kind:x,members:n.graph.nodesOfKind(x).filter(N=>st(n.schema.tryDefinition(x),N))})),p=c.filter(x=>x.members.length>0),g=c.map(x=>({entry:x,creator:n.allMutations().find(N=>(N.creates??[]).includes(x.kind)&&n.permits({name:N.name,args:{}},t.principal).ok)})).find(x=>x.creator!==void 0),f=p.length===0?"Nothing here yet.":`${p.map(x=>Mt(n.schema,x.kind,x.members.length)).join(", ").replace(/, ([^,]*)$/," and $1")}.`,u=t.views?.homeView?.(),k=n.schema.kinds.some(x=>n.graph.nodesOfKind(x).length>0);if(u&&k){let x=a?.subtitle?(0,U.jsx)("p",{style:{...L,margin:0},"data-testid":"app-subtitle",children:a.subtitle}):null,N=u[Symbol.for("graview.home-blocks")]===!0;return(0,U.jsx)(ae,{context:t,style:ct,children:(0,U.jsxs)("div",{style:{display:"grid",gap:12},"data-testid":"home-view",children:[N?null:x,i.length>0?(0,U.jsx)(W,{to:"/problems",style:{...G,color:"var(--graview-warn)"},children:o}):null,(0,U.jsx)(Gr.Provider,{value:N?x:null,children:(0,U.jsx)(u,{cardinality:"many",fidelity:"full",mode:"fullscreen",selected:!1})})]})})}let E=new Set(We(n,t.principal)),y=Xe(n).relations.filter(x=>E.has(x.from)&&(x.to==="*"||E.has(x.to)));return(0,U.jsxs)(ae,{context:t,style:ct,children:[(0,U.jsxs)("header",{style:{display:"grid",gap:12},children:[a?.subtitle?(0,U.jsx)("p",{style:{...L,margin:0},"data-testid":"app-subtitle",children:a.subtitle}):null,(0,U.jsx)(ie,{context:t,"data-testid":"standing",children:f}),(0,U.jsxs)("p",{style:{...re,display:"grid",gap:4},"data-testid":"standing-card",children:[p.length===0&&g?(0,U.jsxs)("span",{children:["Begin with \u201C",g.creator?.title??g.creator?.name,"\u201D, under"," ",(0,U.jsx)(W,{to:`/${_(n.schema,g.entry.kind)}`,style:G,children:Z(n,g.entry.kind)}),"."]}):null,i.length===0?(0,U.jsx)("span",{children:"All rules hold."}):(0,U.jsx)(W,{to:"/problems",style:{...G,color:"var(--graview-warn)"},children:o})]})]}),(0,U.jsx)(zn,{context:t}),(0,U.jsxs)("section",{style:{...ne,display:"grid",gap:14},"data-testid":"kinds",children:[(0,U.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[(0,U.jsx)("h2",{style:ee,children:"What is here"}),y.length>0?(0,U.jsxs)(W,{to:"/map",style:{...G,...L,marginLeft:"auto"},"data-testid":"map-link",children:["Connections \xB7 ",y.length===1?"1 relation":`${y.length} relations`," ",(0,U.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]}):null]}),(0,U.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"8px 10px"},children:c.map(({kind:x,members:N})=>(0,U.jsx)("li",{style:{maxWidth:"100%"},children:(0,U.jsxs)(W,{to:`/${_(n.schema,x)}`,style:{...Pe,flexWrap:"wrap",gap:8,padding:"6px 14px 6px 10px",borderRadius:8,border:"1px solid var(--graview-edge-bright)",background:"var(--graview-panel)"},children:[(0,U.jsx)(ue,{kind:x,brand:a,schema:n.schema,size:7}),(0,U.jsx)("span",{style:{fontWeight:550,overflowWrap:"anywhere"},children:Z(n,x)}),(0,U.jsx)("span",{style:{...L,fontVariantNumeric:"tabular-nums"},children:N.length===0?"none yet":yt(N.length)})]})},x))})]}),l.length>0?(0,U.jsxs)("section",{style:{...ne,display:"grid",gap:10},children:[(0,U.jsx)("h2",{style:ee,children:"Recently"}),(0,U.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:l.map(x=>(0,U.jsxs)("li",{style:L,children:[(0,U.jsx)("span",{style:{color:"var(--graview-ink)"},children:x.intent})," \u2014 ",wt(x,e,{graph:n.graph,schema:n.schema,...t.seats?{seats:t.seats}:{},...t.people?{people:t.people}:{}})]},x.id))})]}):null]})}var Ne=I(Fe(),1);var nt=I(j(),1);function an({context:t,withheld:e,style:n,testId:a}){let r=pe(),i=Ca(e,t.signIn??r?.signIn);return i?(0,nt.jsx)("p",{style:{...n,margin:0},children:(0,nt.jsx)("button",{type:"button","data-testid":"sign-in",onClick:()=>i.run(),style:Ae,children:i.label})}):e.length===0?null:(0,nt.jsx)("ul",{style:{...n,margin:0,padding:0,listStyle:"none",display:"grid",gap:4},...a?{"data-testid":a}:{},children:e.map(o=>(0,nt.jsxs)("li",{style:L,children:[(0,nt.jsx)("s",{children:o.label})," \u2014 ",o.refusal.message]},o.id))})}var $=I(j(),1);function Xn({context:t}){let{store:e,brand:n,principal:a,invariantContext:r}=t;X(e);let[i]=ut(),o=i.get("q")??"",l=typeof r?.today=="string"?r.today:void 0,d=Er(e,o,{...a?{principal:a}:{},places:Ee(t),flagged:new Set(e.violations(r).flatMap(u=>u.nodeIds)),...l?{today:l}:{},limit:200}),c=d.hits.filter(u=>u.about==="node"),p=d.hits.filter(u=>u.about==="kind"||u.about==="place"||u.about==="rule"),g=[...new Set(c.map(u=>u.kind))],f=o.trim();return(0,$.jsxs)(ae,{context:t,children:[(0,$.jsx)("style",{children:_t}),(0,$.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,$.jsx)("p",{style:be,children:"Search"}),(0,$.jsx)(ie,{context:t,"data-testid":"search-heading",children:f.length===0?"Find anything by its name":d.hits.length===0?(0,$.jsxs)($.Fragment,{children:["Nothing here is called \u201C",f,"\u201D."]}):(0,$.jsxs)($.Fragment,{children:[Fo(e,d.byKind)," for \u201C",f,"\u201D"]})}),f.length>0?(0,$.jsxs)("p",{style:{...L,margin:0},"data-testid":"search-searched",children:[Dt(e.schema,d.searched),d.conditions.filter(u=>u.key!=="is"&&u.admittedBy.length<d.searched.kinds.length).map(u=>(0,$.jsxs)("span",{children:[" ",u.key,":",u.value," narrows"," ",u.admittedBy.length===0?"nothing here":u.admittedBy.map(k=>Z(e,k).toLowerCase()).join(" and "),"."]},`${u.key}:${u.value}`))]}):(0,$.jsxs)("p",{style:re,children:["Type in the box above. Words find the start of words in names and in what each record says;"," ",(0,$.jsx)("code",{children:"done:false"})," and the like narrow as a list does, and ",(0,$.jsx)("code",{children:"is:any"})," includes what is past."]})]}),p.length>0?(0,$.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},"data-testid":"search-named",children:p.map(u=>(0,$.jsx)("li",{"data-testid":"search-hit","data-about":u.about,children:u.about==="kind"?(0,$.jsxs)(W,{to:`/${_(e.schema,u.kind)}`,style:G,children:[u.label,u.count>0?(0,$.jsxs)("span",{style:L,children:[" \xB7 ",u.count," match"]}):null]}):u.about==="place"?(0,$.jsxs)(W,{to:he(t,u),style:G,children:["Go to ",u.title]}):u.about==="rule"?(0,$.jsxs)(W,{to:"/problems",style:G,children:["The rule \u201C",u.label,"\u201D"]}):null},`${u.about}:${u.about==="rule"?u.name:u.about==="place"?u.as:u.kind}`))}):null,g.map(u=>(0,$.jsxs)("section",{className:"graview-list",style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",minWidth:0},"data-testid":"search-group","data-kind":u,children:[(0,$.jsxs)("h2",{className:"graview-group-head",style:{alignItems:"center"},children:[(0,$.jsx)(ue,{kind:u,brand:n,schema:e.schema,size:8}),(0,$.jsx)(W,{to:`/${_(e.schema,u)}?${new URLSearchParams({q:f}).toString()}`,style:G,"data-testid":"search-kind-link",children:Z(e,u)}),(0,$.jsx)("span",{children:d.byKind[u]})]}),(0,$.jsx)("ul",{className:"graview-rows",children:c.filter(k=>k.kind===u).map(k=>(0,$.jsxs)("li",{"data-testid":"search-hit","data-about":"node",className:"graview-row",children:[(0,$.jsxs)(W,{to:Q(e.schema,u,k.id),className:"graview-row-title",...k.label.length>60?{title:k.label}:{},children:[k.flagged?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)("span",{role:"img","aria-label":"Breaks a rule:",style:{color:"var(--graview-warn)"},children:"\u26A0"})," "]}):null,k.label]}),k.apart||!k.current?(0,$.jsx)("span",{className:"graview-row-glance",children:[k.apart,k.current?"":"past"].filter(Boolean).join(" \xB7 ")}):null,(0,$.jsx)(rn,{why:k.why})]},k.id))})]},u)),f.length>0?(0,$.jsx)(Io,{asked:f}):null,f.length>0&&d.hits.length===0?(0,$.jsx)(Mi,{store:e,kinds:d.searched.kinds,words:d.words,...a?{principal:a}:{},...r?{invariantContext:r}:{}}):null]})}function rn({why:t}){return t.strength==="near"?(0,$.jsxs)("span",{style:L,"data-testid":"search-why","data-near":"",children:["Near \u201C",t.asked,"\u201D",t.field==="label"?"":` \u2014 ${t.reading}: ${t.fragment}`]}):t.field==="label"?null:(0,$.jsxs)("span",{style:L,"data-testid":"search-why",children:[t.reading,": ",t.fragment]})}function Fo(t,e){let n=Object.entries(e).map(([a,r])=>`${r} ${r===1?qe(t.schema.tryDefinition(a),a):Z(t,a).toLowerCase()}`);return n.length===0?"Found":n.length===1?Le(n[0]):Le(`${n.slice(0,-1).join(", ")} and ${n[n.length-1]}`)}function Ti(t,e,n={}){let a=[];for(let r of e){let i=Ze(t,r,{...n.principal?{principal:n.principal}:{},...n.invariantContext?{context:n.invariantContext}:{}});for(let o of on(t,r,i.actions.affordances))a.some(l=>l.mutation.name===o.mutation.name)||a.push(o)}return a}function on(t,e,n){let a=t.schema.tryDefinition(e)?.fieldRoles?.label,r=[];for(let i of n){let o=t.allMutations().find(c=>c.name===i.mutation);if(!o||!o.creates?.includes(e)||r.some(c=>c.mutation.name===o.name))continue;let l=Wt(o.input).map(c=>c.name),d=l.includes("label")?"label":a&&l.includes(a)?a:void 0;!d||i.args[d]!==void 0||r.push({kind:e,affordance:i,mutation:o,arg:d})}return r}function Mi({store:t,kinds:e,words:n,principal:a,invariantContext:r}){let i=Ti(t,e,{...a?{principal:a}:{},...r?{invariantContext:r}:{}});return i.length===0||n.trim().length===0?null:(0,$.jsx)("div",{style:{display:"grid",gap:24},"data-testid":"search-to-create",children:i.map(({kind:o,affordance:l,mutation:d,arg:c})=>(0,$.jsxs)("section",{style:{...ne,display:"grid",gap:14},children:[(0,$.jsxs)("h2",{style:ee,children:[Le(wa(qe(t.schema.tryDefinition(o),o)))," called \u201C",n,"\u201D"]}),(0,$.jsx)(De,{store:t,mutation:d,prefilled:l.args,open:l.open,initial:{[c]:n},...a?{principal:a}:{}})]},`${l.id}|${n}`))})}function Io({asked:t}){let e=pe();return e?(0,$.jsx)(Ho,{asked:t,desk:e.aiDesk}):null}function Ho({asked:t,desk:e}){return Va(e)?(0,$.jsx)("p",{style:{margin:0},children:(0,$.jsxs)("button",{type:"button","data-testid":"search-ask",onClick:a=>Ua(e,{pointed:{about:[]},asked:t,returnTo:a.currentTarget}),style:{...G,font:"inherit",padding:0,border:0,background:"transparent",cursor:"pointer",textAlign:"start"},children:["Ask: \u2018",t,"\u2019"]})}):null}var v=I(j(),1),Ni=8,$i=40;function Wo(t,e){let n=e?.fields?.shape??{},a=Object.keys(n).find(r=>ba(n[r])&&va(t[r]));return a===void 0?void 0:t[a]}function Jn({context:t}){let e=ze(),n=xe(t.store.schema,e.slug??"");return n?(0,v.jsx)(Oi,{context:t,kind:n}):(0,v.jsx)(ae,{context:t,children:(0,v.jsx)(ie,{context:t,children:"No such kind of thing here."})})}function Oi({context:t,kind:e,opening:n,row:a,layout:r="list",description:i,bare:o}){let{store:l,brand:d,invariantContext:c}=t;X(l);let[p,g]=ut(),f=`list-${(0,Ne.useId)().replace(/:/g,"")}`,u=l.schema.tryDefinition(e),k=Sa(p.get("archived")),E=l.graph.nodesOfKind(e,{archived:k}),y=Xe(l).relations.filter(s=>s.from===e||s.to===e),x=new Set(l.violations(c).flatMap(s=>s.nodeIds)),N=Lr(l.schema,Rr(l.schema,Cr(l.schema,e))),C=y.map(s=>s.edgeKind),D=Uo(p,N,C),V=["sort","filter","group","q","by","with","past","archived",...C].some(s=>p.has(s)),le=E.length>=$i,me=u?.fieldRoles?.when,K=t.views?.arrangement?.()?.lists?.[e],Y=kr(K),oe=br(K?.group),ke=Go(le,me),de=n??(Y?{...ke,...Y}:ke),fe=V?D.arrangement:On(de,N).arrangement,b=Y?.sort,h=fe.sort&&b?.then&&fe.sort.by===b.by&&fe.sort.direction===b.direction?{...fe,sort:b}:fe,T=Tr(h.query??""),F=[...h.filter??[],...T.conditions].some(s=>s.key==="is"&&(s.value==="past"||s.value==="any"))||Ar(u,[...h.filter??[],...T.conditions]),m=F||!u?.lifecycle?h:{...h,filter:[...h.filter??[],{key:"is",value:"current"}]},R=new Map,H=Kt(E,m,{schema:l.schema,graph:l.graph,flagged:x,...typeof c?.today=="string"?{today:c.today}:{},read:(s,w)=>{let O=R.get(s.id);return O||R.set(s.id,O=ht(l.schema,l.graph,s)),O[w]}}),te=oe&&h.group?.by===oe.by&&!h.group.bucket?N.groups.find(s=>s.key===oe.by):void 0,Ke=oe&&te&&(te.type==="choice"||te.type==="boolean")?Sr(H.groups,oe,{type:te.type,...te.options?{options:te.options}:{}}):H.groups.map(s=>({...s,closed:!1})),$e=new Set((p.get("open")??"").split(",").filter(Boolean)),Ki=!!h.query||(h.filter??[]).some(s=>s.key===oe?.by),aa=s=>te?.type==="boolean"?s==="1"?"true":"false":s,ra=s=>s.closed&&!Ki&&!$e.has(aa(s.key)),qi=s=>{let w=new URLSearchParams(p),O=new Set($e);O.has(s)?O.delete(s):O.add(s),O.size>0?w.set("open",[...O].join(",")):w.delete("open"),g(w,{replace:!0})},Re=H.nodes,rt=u?.lifecycle&&!F?E.filter(s=>st(u,s)):E,ia=E.length-rt.length,dn=h.group?.by??null,Bi=s=>{let w=new URLSearchParams(p);for(let ce of["sort","filter","group","q","by","with","past","archived",...y.map(Lt=>Lt.edgeKind)])w.delete(ce);let O=Nr(s);for(let ce of["sort","filter","group","q","archived"])O[ce]&&w.set(ce,O[ce]);![...w.keys()].some(ce=>["sort","filter","group","q"].includes(ce))&&(n||Y||le||me)&&w.set("sort",""),g(w)},{principal:it}=t,cn=Ze(l,e,{...it?{principal:it}:{},...t.invariantContext?{context:t.invariantContext}:{}}),Ue=cn.actions.affordances.map(s=>({affordance:s,mutation:l.allMutations().find(w=>w.name===s.mutation)})).filter(s=>s.mutation!==void 0),Gi=cn.actions.withheld,pn=()=>new Set(Re.length===0?Ue.map(({mutation:s})=>s.name):[]),[un,oa]=(0,Ne.useState)(()=>({kind:e,open:pn()}));un.kind!==e&&oa({kind:e,open:pn()});let sa=s=>(un.kind===e?un.open:pn()).has(s),la=(s,w)=>oa(O=>{let ce=new Set(O.open);return w?ce.add(s):ce.delete(s),{kind:O.kind,open:ce}}),da=`begin-${(0,Ne.useId)().replace(/:/g,"")}`,ca=T.words&&Re.length===0?Object.fromEntries(on(l,e,cn.actions.affordances).map(s=>[s.mutation.name,s.arg])):{},Ye=Z(l,e),Pt=t.views?.lookup(e,{cardinality:"one",fidelity:"glyph"}),gn=Pt!==void 0&&!lt(Pt)?Pt:void 0,mn=(h.group?.bucket??"day")==="day"?h.group?.by:void 0,fn=(h.filter??[]).map(s=>s.key),Ui=fn.filter(s=>fn.indexOf(s)===fn.lastIndexOf(s)&&/choice|boolean/.test(N.filters.find(w=>w.key===s)?.type??"")),yn=s=>{let w={...u?.computed?ht(l.schema,l.graph,s):s};mn&&!String(w[mn]).includes("T")&&delete w[mn];for(let O of Ui)delete w[O];return w},At=s=>{let w=se(u,s);if(a)return(0,v.jsxs)("li",{"data-testid":"record-row","data-graview-record":s.id,style:{minWidth:0},...Sn(s.id),children:[kn(s,w),a(s,{label:w,href:Q(l.schema,e,s.id),flagged:x.has(s.id),glance:Yt(yn(s),u,w)})]},s.id);if(gn){let xn=Ut(Pt,s,l.graph),Qi=Object.fromEntries(Object.entries(yn(s)).filter(([Zi])=>!xn?.fields.has(Zi))),fa=xn?Yt(Qi,u,xn.title??w):"";return(0,v.jsxs)("li",{"data-testid":"record-row","data-graview-record":s.id,style:{position:"relative",display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:16,rowGap:2,paddingBlock:10,borderTop:"1px solid var(--graview-edge)"},...Sn(s.id),children:[kn(s,w),(0,v.jsx)("div",{style:{flex:"1 1 14rem",minWidth:0},children:(0,v.jsx)(gn,{node:s,cardinality:"one",fidelity:"glyph",mode:"fullscreen",selected:!1,...x.has(s.id)?{flagged:[s.id]}:{}})}),fa?(0,v.jsx)("span",{style:{...L,flex:"0 1 auto",minWidth:0,overflowWrap:"anywhere"},"data-testid":"record-glance",children:fa}):null,(0,v.jsx)(zo,{to:Q(l.schema,e,s.id),label:x.has(s.id)?`${w} \u2014 implicated in a problem`:w})]},s.id)}let O=Yt(yn(s),u,w),ce=T.words?Mr(u,s,T.words):void 0,Lt=le?void 0:sr(s,u),Tt=Wo(s,u),ma=(0,v.jsxs)(W,{to:Q(l.schema,e,s.id),className:"graview-row-title",...w.length>60?{title:w}:{},children:[x.has(s.id)?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("span",{role:"img","aria-label":"Breaks a rule:",style:{color:"var(--graview-warn)"},children:"\u26A0"})," "]}):null,w]});return(0,v.jsxs)("li",{className:"graview-row","data-graview-record":s.id,...Sn(s.id),children:[kn(s,w),Lt?(0,v.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,minWidth:0},children:[(0,v.jsx)(je,{as:"thumb",file:Lt}),ma]}):ma,O||Tt?(0,v.jsxs)("span",{className:"graview-row-glance",children:[O,O&&Tt?" \xB7 ":null,Tt?(0,v.jsx)(qt,{address:Tt}):null]}):null,ce?(0,v.jsx)(rn,{why:ce}):null]},s.id)},hn=Ee(t).filter(s=>s.kind===e),pa=K?.filters,Vi=(h.filter??[]).some(s=>s.key!=="is"||s.value!=="any"),ji=!!(h.sort||h.group||h.query||Vi),zi=rt.length>=Ni||V&&ji,Ie=h.sort?N.sorts.find(s=>s.key===h.sort.by):void 0,wn=Ie?.type==="date"||Ie!==void 0&&Ie.key===me,ua=le&&!H.grouped&&Ie&&(Ie.about==="label"||Ie.type==="text"||wn)?s=>{let w=Ie.about==="label"?se(u,s):s[Ie.key];if(typeof w!="string"||w.length===0)return wn?"No date":"#";if(wn)return w.slice(0,4);let O=w.trim().charAt(0).toLocaleUpperCase();return/\p{L}/u.test(O)?O:"#"}:void 0,Qe=ua?Re.reduce((s,w)=>{let O=ua(w);return s.at(-1)?.key===O?s.at(-1).nodes.push(w):s.push({key:O,nodes:[w]}),s},[]):void 0,ga=H.grouped&&dn?Ke.flatMap(s=>ra(s)?[]:s.nodes):Qe&&Qe.length>1?Qe.flatMap(s=>s.nodes):Re,vn=(0,Ne.useMemo)(()=>ga.map(s=>s.id),[ga.map(s=>s.id).join(`
|
|
109
|
-
`)]),Oe=Hr(vn),bn=(0,Ne.useId)(),mt=(it?l.permittedMutations(it):l.permittedMutations()).some(s=>{let w=s.subject?.kinds;return w!==void 0&&(w==="*"||w.includes(e))}),kn=(s,w)=>mt?(0,v.jsx)("span",{className:"graview-choose-at",children:(0,v.jsx)("input",{...Oe.boxProps(s.id,w),onPointerEnter:Fn,onFocus:Fn})}):null,Sn=s=>mt?{"data-graview-choose":s}:{},_i=(0,Ne.useCallback)(s=>{Oe.choose(s),requestAnimationFrame(()=>{let w=Oe.list.current;((s[0]===void 0?null:w?.querySelector(`[data-graview-choose-box="${CSS.escape(s[0])}"]`))??w)?.focus({preventScroll:!0})})},[Oe]),ot=r==="grid"?{margin:0,padding:0,listStyle:"none",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 15rem), 1fr))",alignItems:"start",gap:12}:a||gn?{margin:0,padding:0,listStyle:"none",display:"grid",gap:a&&r==="list"?6:0}:void 0,Ct=ot?void 0:"graview-rows",ft=s=>`list-at-${s.replace(/[^\p{L}\p{N}]/gu,"_")}`,Rt=y.map(s=>{let w=s.from===e?s.to:s.from,O=s.from===e?s.description:s.inverse??s.description;return{relation:s,far:w,words:O}}),Yi=new Set(Rt.map(s=>(s.words??"").toLowerCase()).filter((s,w,O)=>s&&O.indexOf(s)!==w));return(0,v.jsxs)(o?Bo:ae,{context:t,children:[(0,v.jsxs)("div",{style:{display:"grid",gap:12},children:[(0,v.jsxs)("header",{style:{display:"grid",gap:4},children:[o?null:(0,v.jsx)(gt,{context:t}),(0,v.jsxs)("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",columnGap:10,rowGap:4,minWidth:0},children:[(0,v.jsx)(ue,{kind:e,brand:d,schema:l.schema,size:8}),(0,v.jsx)(ie,{context:t,children:Ye}),Ue.length>0?(0,v.jsx)("span",{style:{marginLeft:"auto",display:"flex",flexWrap:"wrap",columnGap:14,rowGap:8},"data-testid":"beginnings-open",children:Ue.map(({affordance:s,mutation:w})=>(0,v.jsx)(Vo,{name:w.name,title:w.title??w.name,panel:`${da}-${w.name}`,open:sa(w.name),onOpen:O=>la(w.name,O)},s.id))}):null]}),Re.length>0?(0,v.jsx)(ti,{place:"here",to:[{label:`Skip to the ${Re.length===1?qe(u,e):`${Re.length} ${Ye.toLowerCase()}`}`,testid:"records",go:()=>{let s=document.querySelector(`[data-graview-skip-target="${CSS.escape(bn)}"]`);In(s?.querySelector('[data-graview-choose-box][tabindex="0"]')??s)}},...rt.length>0?[{label:"Skip to arranging them",testid:"arranging",go:()=>{let s=document.querySelector(`[data-graview-skip-target="${CSS.escape(bn)}"]`)?.parentElement?.querySelector('[role="group"][aria-label="Arrange"]');In(s?.querySelector('button[data-testid$="-add"], button[data-testid$="-all"]')??s)}}]:[]]}):null,i??u?.description?(0,v.jsx)("p",{style:re,children:i??u?.description}):null,Rt.length>0||hn.length>0?(0,v.jsxs)("p",{style:{...L,margin:0,display:"flex",flexWrap:"wrap",columnGap:18,rowGap:2},"data-testid":"kind-related",children:[Rt.length>0?(0,v.jsxs)("span",{"data-testid":"kind-relations",children:["Related:"," ",Rt.map(({relation:s,far:w,words:O},ce)=>(0,v.jsxs)("span",{"data-relation":s.edgeKind,children:[ce>0?(0,v.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,w==="*"?Le(O??Se(s.edgeKind)):(0,v.jsx)(W,{to:`/${_(l.schema,w)}`,style:G,title:Z(l,w),children:O&&Yi.has(O.toLowerCase())?`${Le(O)}: ${Z(l,w).toLowerCase()}`:Le(O??Z(l,w))})]},`${s.edgeKind}|${s.from}|${s.to}`))]}):null,hn.length>0?(0,v.jsxs)("span",{"data-testid":"kind-pictures",children:["Also as:"," ",hn.map((s,w)=>(0,v.jsxs)("span",{children:[w>0?(0,v.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,(0,v.jsx)(W,{to:he(t,s),style:G,children:s.title})]},et(s)))]}):null]}):null]}),Ue.length>0?(0,v.jsx)("div",{style:{display:"contents"},"data-testid":"beginnings",children:Ue.map(({affordance:s,mutation:w})=>{let O=!!(ca[w.name]&&Re.length===0);return(0,v.jsx)(jo,{name:w.name,id:`${da}-${w.name}`,description:w.description,open:sa(w.name),onClose:()=>la(w.name,!1),children:(0,v.jsx)(De,{store:l,mutation:w,prefilled:s.args,open:s.open,...O?{initial:{[ca[w.name]]:T.words}}:{},...t.principal?{principal:t.principal}:{}},O?`${w.name}|${T.words}`:w.name)},s.id)})}):null,D.dropped.length>0?(0,v.jsxs)("p",{style:{...L,margin:0},"data-testid":"list-dropped",children:["This link asked for ",D.dropped.join(", "),", which ",Ye.toLowerCase()," cannot be arranged by; the rest is shown."]}):null,rt.length>0?(0,v.jsx)(Fr,{schema:l.schema,graph:l.graph,kind:e,arrangement:h,onChange:Bi,kept:{shown:Re.length,of:rt.length},noun:{one:qe(u,e),many:Ye.toLowerCase()},...zi?{}:{allow:!1},...pa?{filters:pa}:{},offers:N,chips:{nodes:rt,flagged:x,...typeof c?.today=="string"?{today:c.today}:{}},query:t.framed===!0&&t.barAbove!==!0}):null,(0,v.jsx)("style",{children:_t}),mt?(0,v.jsx)("style",{children:Wr+qo}):null,(0,v.jsx)("div",{className:"graview-list","data-graview-skip-target":bn,...mt?{...Oe.listProps,ref:Oe.list,tabIndex:-1,"data-graview-choosable":"","aria-label":Oe.chosen.length>0?`${Ye}, ${Oe.chosen.length} chosen`:Ye,role:"group"}:{},children:Re.length===0&&T.words?(0,v.jsxs)("p",{style:re,"data-testid":"none-yet",children:["Nothing here is called \u201C",T.words,"\u201D."," ",(0,v.jsx)("span",{style:L,"data-testid":"list-searched",children:Dt(l.schema,{kinds:[e],past:F})})," ",(0,v.jsx)(W,{to:"?",style:G,children:"Show every one"})]}):Re.length===0?(0,v.jsxs)("p",{style:re,"data-testid":"none-yet",children:[h.filter?.length||h.query?"None of them.":"None yet",!h.filter?.length&&!h.query&&Ue.length>0?` \u2014 the first one starts above, with \u201C${Ue[0]?.mutation.title??Ue[0]?.mutation.name}\u201D.`:!h.filter?.length&&!h.query?".":"",h.filter?.length||h.query?(0,v.jsxs)(v.Fragment,{children:[" ",(0,v.jsx)(W,{to:"?",style:G,children:"Show every one"})]}):null]}):H.grouped&&dn?(0,v.jsx)("div",{style:{display:"grid",gap:"1rem"},"data-testid":"records","data-grouped":dn,children:Ke.map(s=>{if(!s.closed)return(0,v.jsxs)("section",{style:{display:"grid",gap:0},"data-testid":"list-group",children:[(0,v.jsxs)("h2",{className:"graview-group-head",children:[s.label," ",(0,v.jsx)("span",{children:s.nodes.length})]}),(0,v.jsx)("ul",{style:ot,className:Ct,"data-graview-rows":"",children:s.nodes.map(At)})]},s.key||"-");let w=ra(s),O=`${f}-${ft(s.key||"none")}`;return(0,v.jsxs)("section",{style:{display:"grid",gap:0},"data-testid":"list-group","data-closed":w?"shut":"open",children:[(0,v.jsx)("h2",{className:"graview-group-head",children:(0,v.jsxs)("button",{type:"button",className:"graview-group-toggle","aria-expanded":!w,"aria-controls":O,"data-testid":"list-group-toggle",onClick:()=>qi(aa(s.key)),children:[(0,v.jsx)("span",{"aria-hidden":"true",children:w?"\u25B8":"\u25BE"}),s.label," ",(0,v.jsxs)("span",{children:["\xB7 ",s.nodes.length]}),(0,v.jsxs)("span",{style:Do,children:[" ",s.nodes.length===1?qe(u,e):Ye.toLowerCase()]})]})}),(0,v.jsx)("ul",{id:O,style:w?{...ot,display:"none"}:ot,className:Ct,"data-graview-rows":"",hidden:w,children:w?null:s.nodes.map(At)})]},s.key||"-")})}):Qe&&Qe.length>1?(0,v.jsxs)("div",{style:{display:"grid",gap:14},"data-testid":"records","data-sectioned":Ie?.type==="date"?"year":"letter",children:[(0,v.jsx)("nav",{"aria-label":"Jump to","data-testid":"list-index",style:{...L,display:"flex",flexWrap:"wrap",gap:Ie?.type==="date"?"0 10px":"0 4px",lineHeight:1.3},children:Qe.map(s=>(0,v.jsx)("a",{href:`#${ft(s.key)}`,onClick:w=>{w.preventDefault(),document.getElementById(ft(s.key))?.scrollIntoView({block:"start"})},style:{...Pe,minWidth:24,justifyContent:"center"},children:s.key},s.key))}),Qe.map(s=>(0,v.jsxs)("section",{"data-testid":"list-section","aria-labelledby":ft(s.key),style:{display:"grid",gap:0},children:[(0,v.jsx)("h2",{id:ft(s.key),className:"graview-group-head",children:s.key}),(0,v.jsx)("ul",{style:ot,className:Ct,"data-graview-rows":"",children:s.nodes.map(At)})]},s.key))]}):(0,v.jsx)("ul",{style:ot,className:Ct,"data-testid":"records","data-graview-rows":"",children:Re.map(At)})}),mt?(0,v.jsx)(Dr,{store:l,chosen:Oe.chosen,...it?{principal:it}:{},...c?{context:c}:{},anchor:Ko,of:vn.length,onChooseAll:()=>Oe.choose(vn),onClear:Oe.clear,onActed:_i}):null,ia>0?(0,v.jsxs)(W,{to:Ei(p,"filter","is:any"),style:{...G,...L,justifySelf:"start"},"data-testid":"past-link",children:["+",ia," past"]}):null,k===!1&&l.graph.count(e,{archived:!0})>0?(0,v.jsxs)(W,{to:Ei(p,"archived","true"),style:{...G,...L,justifySelf:"start"},"data-testid":"archived-link",children:["+",l.graph.count(e,{archived:!0})," archived"]}):null]}),(0,v.jsx)(an,{context:t,withheld:Gi,style:ne,testId:"withheld"})]})}var Do={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},Ko=()=>document.querySelector("[data-graview-choosable]")?.closest("[data-embed-content]")??null,qo=`
|
|
110
|
-
.graview-list[data-graview-choosable]{outline:none}
|
|
111
|
-
.graview-list [data-graview-choose]{position:relative;padding-left:34px}
|
|
112
|
-
.graview-choose-at{position:absolute;left:2px;top:0;bottom:0;z-index:${Ra.raised};display:flex;align-items:center}
|
|
113
|
-
@media (pointer: coarse){
|
|
114
|
-
.graview-list:not([data-graview-choosing]) [data-graview-choose]{padding-left:0}
|
|
115
|
-
.graview-list:not([data-graview-choosing]) .graview-choose-at{display:none}
|
|
116
|
-
}
|
|
117
|
-
`;function Bo({children:t}){return(0,v.jsx)("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:40,minWidth:0},children:t})}var Go=(t,e)=>e?{sort:{by:e,direction:"desc"}}:t?{sort:{by:"label",direction:"asc"}}:{};function Uo(t,e,n){let a=$t({...t.get("sort")?{sort:t.get("sort")}:{},...t.get("filter")?{filter:t.get("filter")}:{},...t.get("group")?{group:t.get("group")}:{},...t.get("q")?{q:t.get("q")}:{},...t.get("archived")?{archived:t.get("archived")}:{}}),r=[...a.filter??[]],i=t.get("by"),o=a.group??(i?{by:i}:void 0);for(let d of n){let c=t.get(d);c&&r.push({key:d,value:c})}let l=t.get("with");return l&&r.push({key:l,value:"*"}),t.get("past")==="1"&&!r.some(d=>d.key==="is")&&r.push({key:"is",value:"any"}),On({...a.sort?{sort:a.sort}:{},...a.query?{query:a.query}:{},...r.length>0?{filter:r}:{},...o?{group:o}:{},...a.archived!==void 0?{archived:a.archived}:{}},e)}function Ei(t,e,n){let a=new URLSearchParams(t);return a.set(e,n),a.delete("past"),`?${a.toString()}`}function Vo({name:t,title:e,panel:n,open:a,onOpen:r}){return(0,v.jsxs)("button",{type:"button","data-testid":`act-open-${t}`,"data-graview-act":t,"aria-expanded":a,"aria-controls":n,onClick:()=>{r(!a),a||requestAnimationFrame(()=>document.getElementById(n)?.querySelector("input, select, textarea, button")?.focus())},style:{...Pe,minHeight:28,margin:"-4px 0",padding:"0 2px",border:0,background:"none",font:"inherit",fontWeight:600,color:"var(--graview-ink)",cursor:"pointer"},children:[(0,v.jsx)("span",{"aria-hidden":"true",style:{marginRight:6},children:a?"\u2212":"+"}),e]})}function jo({name:t,id:e,description:n,open:a,onClose:r,children:i}){return(0,v.jsxs)("div",{"data-testid":`act-${t}`,id:e,hidden:!a,onKeyDown:o=>{o.key==="Escape"&&(o.preventDefault(),r(),document.querySelector(`[aria-controls="${e}"]`)?.focus())},style:a?{display:"grid",gap:12,padding:"4px 0 12px"}:void 0,children:[n?(0,v.jsx)("p",{style:{...L,margin:0,maxWidth:"58ch"},children:n}):null,i]})}function zo({to:t,label:e}){let n=(0,Ne.useRef)(null);return Kr(n),(0,v.jsx)(W,{ref:n,to:t,"aria-label":e,style:{position:"absolute",inset:0,borderRadius:6}})}var at=I(Fe(),1);var xt=I(Fe(),1);var q=I(j(),1);function ea({context:t}){let{store:e,brand:n,invariantContext:a,principal:r}=t;X(e);let i=e.violations(a),o=e.allInvariants(),l=Ft(e,i),d=ja(e.schema,o);return(0,q.jsxs)(ae,{context:t,children:[(0,q.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,q.jsx)(ie,{context:t,children:i.length===0?"All rules hold":"What is broken"}),(0,q.jsx)("p",{style:re,"data-testid":"problems-count",children:i.length===0?"Every declared rule is satisfied by what is here.":xa(i)})]}),(0,q.jsx)(Li,{context:t}),l.map((c,p)=>{let g=c.nodeIds[0],f=g?e.graph.getNode(g):void 0;return(0,q.jsxs)("section",{style:{display:"grid",gap:10,padding:"16px 18px",borderLeft:"3px solid var(--graview-warn)",background:"var(--graview-panel-warning)",borderRadius:"0 var(--graview-radius, 12px) var(--graview-radius, 12px) 0"},children:[c.line?null:(0,q.jsx)(sn,{violation:c,schema:e.schema,...n?{brand:n}:{}}),f?(0,q.jsxs)("p",{style:{margin:0,display:"inline-flex",alignItems:"center",gap:8},children:[(0,q.jsx)(ue,{kind:f.kind,brand:n,schema:e.schema,size:7}),(0,q.jsx)(W,{to:Q(e.schema,f.kind,f.id),style:G,children:se(e.schema.tryDefinition(f.kind),f)})]}):null,c.line?(0,q.jsx)(sn,{violation:c,schema:e.schema,...n?{brand:n}:{}}):null,(0,q.jsx)(ln,{store:e,repairs:c.repairs,...r?{principal:r}:{}})]},p)}),o.length>0?(0,q.jsxs)("section",{style:{...ne,display:"grid",gap:12},"data-testid":"rules",children:[(0,q.jsx)("h2",{style:ee,children:"The rules"}),(0,q.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:o.map(c=>{let p=i.filter(u=>u.invariant===c.name).length,g=d.get(c.name),f=c.label??c.name;return(0,q.jsxs)("li",{"data-graview-rule":c.name,style:{display:"grid",gap:2},children:[(0,q.jsxs)("span",{style:{display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:12,rowGap:2},children:[g?(0,q.jsx)(It,{line:g,schema:e.schema,...n?{brand:n}:{},style:{flex:"1 1 18rem"}}):(0,q.jsx)("span",{style:{flex:"1 1 18rem",fontWeight:550},children:f}),(0,q.jsx)("span",{style:{...L,color:p>0?"var(--graview-warn)":"var(--graview-ink-faint)"},children:p===0?"holds":`broken in ${p} ${p===1?"place":"places"}`})]}),g&&f.trim().length>0?(0,q.jsx)("span",{style:L,children:f}):null]},c.name)})})]}):null]})}function sn({violation:t,schema:e,brand:n}){if(!t.line)return(0,q.jsx)("p",{style:{margin:0,color:"var(--graview-warn)",fontWeight:550},children:t.message});let a=_a(t),r=za(t);return r?(0,q.jsxs)("div",{style:{display:"grid",gap:4},"data-testid":"problem-line",children:[(0,q.jsx)("p",{style:{margin:0,color:"var(--graview-warn)",fontWeight:550},"data-testid":"problem-says",children:r}),a?(0,q.jsx)("span",{style:L,children:a}):null,(0,q.jsxs)("details",{"data-testid":"problem-judged",style:L,children:[(0,q.jsx)("summary",{style:{cursor:"pointer",width:"fit-content",minHeight:24},children:"How it is judged"}),(0,q.jsx)(It,{line:t.line,schema:e,...n?{brand:n}:{},lead:"none"})]})]}):(0,q.jsxs)("div",{style:{display:"grid",gap:2},"data-testid":"problem-line",children:[(0,q.jsx)(It,{line:t.line,schema:e,...n?{brand:n}:{},lead:"none",style:{color:"var(--graview-warn)"}}),a?(0,q.jsx)("span",{style:L,children:a}):null]})}function ln({store:t,repairs:e,principal:n}){let[a,r]=(0,xt.useState)(null),[i,o]=(0,xt.useState)(null),l=(0,xt.useRef)([]);if(e.length===0)return null;let d=a===null?null:e[a],c=d&&(d.missing??[]).length>0?t.allMutations().find(p=>p.name===d.mutation):void 0;return(0,q.jsxs)("div",{style:{display:"grid",gap:10},"data-testid":"repairs",children:[(0,q.jsx)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:e.map((p,g)=>{let f=(p.missing??[]).length>0,u=t.permits({name:p.mutation,args:{...p.args}},n);return u.ok?(0,q.jsx)("button",{ref:k=>{l.current[g]=k},type:"button","data-graview-repair":p.mutation,"data-graview-asks":f||void 0,"aria-expanded":f?a===g:void 0,onClick:()=>{if(o(null),f){r(a===g?null:g);return}r(null);try{t.apply({name:p.mutation,args:{...p.args}},n?{author:n}:{})}catch(k){o(dt(t.schema,t.allMutations(),k))}},style:Ae,children:f?`${p.label} \u2026`:p.label},g):(0,q.jsxs)("p",{"data-testid":"withheld","data-withheld":u.refusal.wouldNeed.join(",")||"nobody",style:{...L,margin:0},children:[(0,q.jsx)("s",{children:p.label})," \u2014 ",u.refusal.message]},g)})}),c&&d?(0,q.jsx)(De,{store:t,mutation:c,prefilled:{...d.args},only:d.missing??[],label:d.label,onDone:()=>{let p=a;r(null),requestAnimationFrame(()=>{let g=p===null?null:l.current[p];if(g?.isConnected){g.focus();return}let f=document.querySelector("[data-graview-page-title]")??document.querySelector("main h1, main h2");f&&(f.hasAttribute("tabindex")||(f.tabIndex=-1),f.focus())})},...n?{principal:n}:{}}):null,d&&!c&&(d.missing??[]).length>0?(0,q.jsxs)("p",{"data-testid":"refused",role:"alert",style:{margin:0,color:"var(--graview-warn)",fontSize:Hn},children:["\u201C",d.label,"\u201D names ",d.mutation,", which this app does not declare."]}):null,i?(0,q.jsx)("p",{"data-testid":"refused",role:"alert",style:{margin:0,color:"var(--graview-warn)",fontSize:Hn},children:i}):null]})}var ta=I(Fe(),1);var _e=I(j(),1);function Fi({store:t,link:e,principal:n}){let[a,r]=(0,ta.useState)(!1),[i,o]=(0,ta.useState)(null),l=ar(e);return(0,_e.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[(0,_e.jsx)("button",{type:"button","data-graview-provisional":"",title:l,"aria-label":`Unsure link: ${l}`,"aria-expanded":a,onClick:()=>r(!a),style:{border:"1px dashed var(--graview-ink-muted)",borderRadius:999,background:"transparent",color:"var(--graview-ink-muted)",font:"inherit",fontSize:"0.75rem",lineHeight:1,padding:"2px 6px",cursor:"pointer"},children:"unsure"}),a?(0,_e.jsxs)("span",{style:{...L,display:"inline-flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,_e.jsx)("span",{children:l}),(0,_e.jsx)("button",{type:"button",style:{...Ae,padding:"4px 10px"},onClick:()=>{try{t.apply({name:Pa,args:{kind:e.edge.kind,from:e.edge.from,to:e.edge.to}},n?{author:n}:{}),r(!1)}catch(d){o(dt(t.schema,t.allMutations(),d))}},children:"Keep this link"}),i?(0,_e.jsx)("span",{role:"alert",children:i}):null]}):null]})}var ve=I(j(),1);function Ii({nodeId:t,node:e,field:n,inPlace:a,labelStyle:r=be}){return n.files?(0,ve.jsx)(je,{as:"field",read:!a,nodeId:t,field:n.key,label:n.label,files:n.files,labelStyle:r,style:{gap:4}}):n.long?(0,ve.jsx)(Or,{nodeId:t,field:n.key,label:n.label,value:n.value,markdown:n.markdown,style:{gridColumn:"1 / -1",gap:4},labelStyle:r,valueStyle:{lineHeight:1.6}}):(0,ve.jsxs)("div",{style:{display:"grid",gap:2,minWidth:0,alignContent:"start"},children:[(0,ve.jsx)("dt",{style:r,children:n.label}),(0,ve.jsx)("dd",{style:{margin:0,overflowWrap:"anywhere",minWidth:0},children:n.linked?(0,ve.jsx)(dr,{relation:n.linked.relation,refs:n.linked.refs,...a?{nodeId:t,field:n.key}:{}}):n.app?(0,ve.jsx)(qt,{address:n.app,as:"record",...a?{nodeId:t,field:n.key}:{}}):n.href?(0,ve.jsx)($r,{href:n.href,field:n.key,value:n.value,stored:n.stored,...a?{nodeId:t}:{}}):a?(0,ve.jsxs)(ve.Fragment,{children:[(0,ve.jsx)(Bt,{nodeId:t,field:n.key,value:n.value,stored:n.stored}),n.repeats?(0,ve.jsx)(ur,{nodeId:t,field:n.key,start:e?.[n.key],value:e?.[`${n.key}Repeat`],label:`${n.label} repeats`}):null]}):n.value})]})}var S=I(j(),1),_o=[];function na({context:t}){let{store:e,brand:n,principal:a,invariantContext:r}=t;X(e);let i=pe()!==null,o=ze(),l=decodeURIComponent(o.id??""),d=pi(e,l,{...a?{principal:a}:{},...r?{context:r}:{}}),c=Ft(e,d?.violations??_o),[p,g]=(0,at.useState)(null),[f,u]=(0,at.useState)(!1),[k,E]=(0,at.useState)(null),y=(0,at.useRef)(null),x=(0,at.useRef)(null),N=m=>{(y.current?.parentElement?.querySelector(`[data-affordance="${m.replace(/["\\]/g,"\\$&")}"]`)??y.current)?.focus()};if(!d)return(0,S.jsx)(ae,{context:t,children:(0,S.jsx)(ie,{context:t,children:"Nothing lives at this address."})});let C=e.graph.getNode(l),D=e.schema.tryDefinition(d.kind),V=D?.describe&&C?Ya(D,C):null,le=[...e.log.all()].filter(m=>!Et(m)&&(m.writes.includes(l)||m.reads.includes(l))).slice(-8).reverse(),me=e.log.all().find(m=>!Et(m)&&m.undoes===void 0&&m.primitives.some(R=>R.op==="add-node"&&R.node.id===l)),K=d.actions.affordances.filter(m=>m.provider!=="invariant"),Y=K.filter(m=>m.destructive||m.setsAside),oe=f||Y.length<2?K:K.filter(m=>!Y.includes(m)),ke=t.views?.lookup(d.kind,{cardinality:"one",fidelity:"full"}),de=ke!==void 0&&!lt(ke)?ke:void 0,fe=de&&C?Ut(ke,C,e.graph):void 0,b=fe?d.fields.filter(m=>!fe.fields.has(m.key)):d.fields,h=fe?d.links.flatMap(m=>{let R=m.targets.filter(H=>!fe.records.has(H.id));return R.length>0?[{...m,targets:R}]:[]}):d.links,T=de!==void 0&&Ba(ke),F=i&&or(D).length>0;return(0,S.jsxs)(ae,{context:t,children:[(0,S.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,S.jsx)(gt,{context:t}),(0,S.jsx)(ie,{context:t,children:i&&C?.label===d.label?(0,S.jsx)(Bt,{nodeId:l,field:"label",value:d.label,said:d.label}):d.label}),V&&V!==d.label?(0,S.jsx)("p",{style:re,children:V}):null,me?.lineage?(0,S.jsxs)("p",{style:{...L,margin:0},"data-testid":"record-lineage",children:["Made by ",wt(me,a,{graph:e.graph,schema:e.schema,...t.seats?{seats:t.seats}:{},...t.people?{people:t.people}:{}}),", ",Tn(me.lineage)]}):null,(0,S.jsx)(Zt,{context:t,stop:`#focus=${encodeURIComponent(l)}`,style:{...G,...L},"data-testid":"spatial-link"}),i&&C?(0,S.jsx)(En,{choices:[{on:"changed",record:l},{on:"act",record:l},{on:"reaches",kind:d.kind,condition:"",record:l}],label:"Notify me when this changes",testId:"record-notify",style:{...Ae,...L,justifySelf:"start"}}):null,Ee(t).some(m=>m.kind===d.kind||m.across===d.kind)?(0,S.jsxs)("p",{style:{...L,margin:0},"data-testid":"seen-in",children:["Seen in:"," ",Ee(t).filter(m=>m.kind===d.kind||m.across===d.kind).map((m,R)=>(0,S.jsxs)("span",{children:[R>0?(0,S.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,(0,S.jsx)(W,{to:he(t,m),style:G,children:m.title})," ",(0,S.jsx)(Zt,{context:t,stop:`#view=${encodeURIComponent(m.as)}`,style:{...G,...L,display:"inline-block",minWidth:24,textAlign:"center"},title:`${m.title}, in the scene`,label:`${m.title}, in the scene`,children:(0,S.jsx)("span",{"aria-hidden":"true",children:"\u2197"})})]},et(m)))]}):null]}),C&&ka(C)?(0,S.jsx)(Qo,{context:t,id:l,kind:d.kind}):null,C&&Aa(e,l)?(0,S.jsx)(Yo,{context:t,id:l,kind:d.kind}):null,de&&C?(0,S.jsx)("section",{"data-testid":"record-view",style:{display:"grid",minWidth:0},children:(0,S.jsx)(qr,{children:(0,S.jsx)(de,{node:C,cardinality:"one",fidelity:"full",mode:"fullscreen",selected:!1,...d.violations.length>0?{flagged:[l]}:{}})})}):null,d.violations.length>0?(0,S.jsx)("section",{"data-testid":"record-violations",style:{display:"grid",gap:12,padding:"16px 18px",borderLeft:"3px solid var(--graview-warn)",background:"var(--graview-panel-warning)",borderRadius:"0 var(--graview-radius, 12px) var(--graview-radius, 12px) 0"},children:c.map((m,R)=>(0,S.jsxs)("div",{style:{display:"grid",gap:8},children:[(0,S.jsx)(sn,{violation:m,schema:e.schema,...n?{brand:n}:{}}),(0,S.jsx)(ln,{store:e,repairs:ui(d.actions,m.repairs),...a?{principal:a}:{}})]},R))}):null,!T&&(b.length>0||F)?(0,S.jsxs)("section",{style:{...ne,display:"grid",gap:14},"data-testid":"record-fields",children:[(0,S.jsx)("h2",{style:ee,children:"The facts"}),Za(D,b).map((m,R)=>{let H=(0,S.jsx)("dl",{style:{margin:0,display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gap:"14px 24px"},children:m.fields.map(te=>(0,S.jsx)(Ii,{nodeId:l,node:C,field:te,inPlace:i},te.key))});return m.title?(0,S.jsxs)("section",{style:{display:"grid",gap:10,minWidth:0},children:[(0,S.jsx)("h3",{"data-graview-field-group":m.title,style:{...ee,fontSize:"inherit"},children:m.title}),H]},R):(0,S.jsx)("div",{children:H},R)}),F?(0,S.jsx)(je,{as:"unfilled",nodeId:l,skip:[...fe?.fields??[]],labelStyle:be,style:{gap:4}}):null]}):null,(T?[]:h).map(m=>(0,S.jsxs)("section",{style:{...ne,display:"grid",gap:10},children:[(0,S.jsx)("p",{style:be,children:ai(e,m)}),m.description?(0,S.jsx)("h2",{style:ee,children:Le(m.description)}):(0,S.jsxs)("h2",{style:ee,"aria-label":Se(m.edgeKind),children:[m.direction==="in"?"\u2190 ":"\u2192 ",Se(m.edgeKind)]}),(0,S.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"6px 18px"},children:m.targets.map(R=>{let H=rr(e,m.direction==="in"?{kind:m.edgeKind,from:R.id,to:l}:{kind:m.edgeKind,from:l,to:R.id});return(0,S.jsxs)("li",{style:{display:"inline-flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,S.jsx)(ue,{kind:R.kind,brand:n,schema:e.schema,size:7}),(0,S.jsxs)(W,{to:Q(e.schema,R.kind,R.id),style:G,children:[R.label,R.apart?(0,S.jsxs)("span",{style:L,children:[" \xB7 ",R.apart]}):null]}),H?.provisional?(0,S.jsx)(Fi,{store:e,link:H,...a?{principal:a}:{}}):null]},R.id)})}),(m.direction==="out"&&e.schema.edge(m.edgeKind)?.cardinality==="one"?[]:[...new Set(m.targets.map(R=>R.kind))]).map(R=>(0,S.jsxs)(W,{to:`/${_(e.schema,R)}?${encodeURIComponent(m.edgeKind)}=${encodeURIComponent(l)}`,style:{...G,...L},"data-testid":"related-all",children:["Sort and filter ",m.description??`these ${Z(e,R).toLowerCase()}`,m.targets.some(H=>H.kind!==R)?` (${Z(e,R).toLowerCase()})`:""," ",(0,S.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]},R))]},`${m.edgeKind}|${m.direction}|${m.description??""}`)),!T&&(K.length>0||d.actions.withheld.length>0)?(0,S.jsxs)("section",{style:{...ne,display:"grid",gap:14},"data-testid":"record-actions",children:[(0,S.jsx)("h2",{style:ee,ref:y,tabIndex:-1,children:"What can be done"}),(0,S.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:8},children:[oe.map(m=>{let R=p===m.id;return(0,S.jsx)("button",{type:"button","data-affordance":m.id,"data-rank":m.rank,"data-graview-act":m.mutation,autoFocus:f&&m===Y[0],"aria-expanded":R,onClick:()=>{g(R?null:m.id),R||requestAnimationFrame(()=>x.current?.querySelector("input:not([type=hidden]), select, textarea, button")?.focus())},style:{...Ae,...R?{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"}:{}},children:m.label},m.id)}),oe.length<K.length?(0,S.jsxs)("button",{type:"button","aria-expanded":!1,onClick:()=>u(!0),style:{...Ae,...L},"data-testid":"record-actions-more",children:["Show ",K.length-oe.length," more"]}):null]}),K.map(m=>{if(p!==m.id)return null;let R=e.allMutations().find(H=>H.name===m.mutation);return R?(0,S.jsxs)("div",{ref:x,onKeyDown:H=>{if(H.key!=="Escape"||H.defaultPrevented)return;H.preventDefault(),g(null);let te=m.id;requestAnimationFrame(()=>N(te))},style:{display:"grid",gap:10,padding:18,border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,S.jsx)("h3",{style:ee,children:m.label}),R.description?(0,S.jsx)("p",{style:{...L,margin:0},children:R.description}):null,(0,S.jsx)(De,{store:e,mutation:R,prefilled:m.args,open:m.open,label:m.label,onDone:()=>{g(null),E(m.mutation);let H=m.id;requestAnimationFrame(()=>N(H))},...a?{principal:a}:{}})]},m.id):null}),i&&k!==null&&p===null?(0,S.jsx)(En,{choices:[{on:"act",act:k,record:l},{on:"act",act:k}],label:"Notify me when someone else does this",testId:"notify-after-act",style:{...Ae,...L,justifySelf:"start"}}):null,(0,S.jsx)(an,{context:t,withheld:d.actions.withheld})]}):null,i?(0,S.jsx)(ni,{id:l,style:ne,headingStyle:ee}):null,le.length>0?(0,S.jsxs)("section",{style:{...ne,display:"grid",gap:10},"data-testid":"record-history",children:[(0,S.jsx)("h2",{style:ee,children:"What has happened"}),(0,S.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:le.map(m=>(0,S.jsxs)("li",{style:L,children:[(0,S.jsx)("span",{style:{color:"var(--graview-ink)"},children:m.intent}),m.lineage?(0,S.jsxs)("span",{"data-graview-lineage":"",children:[" \xB7 ",Tn(m.lineage)]}):null," \u2014 ",wt(m,a,{graph:e.graph,schema:e.schema,...t.seats?{seats:t.seats}:{},...t.people?{people:t.people}:{}})]},m.id))})]}):null]})}function Yo({context:t,id:e,kind:n}){let{store:a,principal:r}=t,i={name:`allow-tidying-${n}`,args:{id:e}},o=a.allMutations().some(l=>l.name===i.name)&&a.permits(i,r).ok;return(0,S.jsxs)("section",{"data-testid":"record-left-alone",style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:12,padding:"12px 16px",border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,S.jsxs)("p",{style:{margin:0,flex:"1 1 16rem"},children:[(0,S.jsx)("strong",{children:"Left alone."})," Nothing automated changes it; tidying passes it by."]}),o?(0,S.jsx)("button",{type:"button",style:Ae,"data-testid":"allow-tidying",onClick:()=>a.apply(i,r?{author:r}:{}),children:"Allow tidying again"}):null]})}function Qo({context:t,id:e,kind:n}){let{store:a,principal:r}=t,i={name:`unarchive-${n}`,args:{id:e}},o=a.allMutations().some(c=>c.name===i.name)&&a.permits(i,r).ok,l=[...a.log.all()].reverse().find(c=>!Et(c)&&c.mergedInto!==void 0&&c.writes.includes(e)),d=l?.mergedInto!==void 0?a.graph.getNode(l.mergedInto):void 0;return(0,S.jsxs)("section",{"data-testid":"record-archived",style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:12,padding:"12px 16px",border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,S.jsxs)("p",{style:{margin:0,flex:"1 1 16rem"},children:[(0,S.jsx)("strong",{children:"Archived."})," Kept with its ties and history, and out of lists, counts and rules.",d?(0,S.jsxs)(S.Fragment,{children:[" ","Merged into ",(0,S.jsx)(W,{to:Q(a.schema,d.kind,d.id),style:G,children:se(a.schema.tryDefinition(d.kind),d)}),"."]}):null]}),o?(0,S.jsx)("button",{type:"button",style:Ae,"data-testid":"bring-it-back",onClick:()=>a.apply(i,r?{author:r}:{}),children:"Bring it back"}):null]})}var A=I(j(),1),Zo=(0,z.lazy)(Ot(()=>(__graviewPreload(import.meta.url,["./chunk.OAWAUB4P.js","./chunk.PSTE3LZL.js","./chunk.UGFDSE37.js","./chunk.JGYGSNQY.js","./chunk.JLOSQ5UY.js","./chunk.FNF6XQI5.js","./chunk.LUPBT6YM.js","./chunk.IBWPRK2R.js","./chunk.RNUGQRJI.js","./chunk.6NFR2LYQ.js","./chunk.YERDP6YF.js","./chunk.P5K7EYDK.js","./chunk.7AEE3VHC.js","./chunk.U3CV5CCL.js","./chunk.LKF4BBCW.js","./chunk.NPS2WN7T.js","./chunk.JUT2VCFW.js","./chunk.HKD5SR45.js","./chunk.JEMQ66FT.js","./chunk.7UV7ODXU.js","./chunk.IIB22IIP.js","./chunk.MWUP5X47.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.ESU2DD3J.js","./chunk.PL2P2OON.js","./chunk.27ZVVPRZ.js","./chunk.IN4PKQO5.js","./chunk.3IUJ4GW7.js","./chunk.UG23RICT.js","./chunk.GZHZLJBF.js","./chunk.ATKKTPJS.js","./chunk.OJGHDWI6.js","./chunk.UZSZPMRC.js","./chunk.MZOIPCDA.js","./chunk.KERLVJ6I.js","./chunk.4EPT2CQG.js","./chunk.FNXW46U4.js","./chunk.4JWT6LIS.js","./chunk.SDO3U72B.js","./chunk.AW2T3KFV.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.PX6VAZFJ.js")).then(t=>({default:t.DraftPage})))),Xo={kind:"human"};function Jo({list:t,store:e}){let n=new Set(t.members.map(o=>o.kind)),a=t.total-t.members.length,r=n.size===1?[...n][0]:void 0;if(!r)return(0,A.jsx)("p",{className:"graview-spec-text graview-spec-more",children:`and ${a} more`});let i=Ve(e.schema,r).toLowerCase();return(0,A.jsx)("p",{className:"graview-spec-text graview-spec-more",children:(0,A.jsx)(W,{to:`/${_(e.schema,r)}`,className:"graview-spec-link graview-spec-see-all","data-testid":"see-all",children:t.total===e.graph.nodesOfKind(r).length?`See all ${yt(t.total)} ${i}`:`${yt(a)} more \xB7 all ${i}`})})}function es({context:t,children:e}){let n=Be(),a=t.store.schema,r=pt("/").replace(/\/$/,""),i=(0,z.useMemo)(()=>({href:o=>`${r}${Q(a,o.kind,o.id)}`,go:o=>n(Q(a,o.kind,o.id)),more:o=>(0,A.jsx)(Jo,{list:o,store:t.store})}),[r,a,n,t.store]);return(0,A.jsx)(Gt.Provider,{value:i,children:(0,A.jsx)(Br.Provider,{value:(t.titleLevel??(t.framed&&!t.barAbove?1:2))-1,children:e})})}function ts({steering:t}){let e=ye(),n=Be(),a=`${e.pathname}${e.search}`;return(0,z.useLayoutEffect)(()=>t.at(a),[a,t]),(0,z.useLayoutEffect)(()=>{let r=o=>{o!==a&&n(o)};t.go.current=r;let i=t.pending?.current;return i!==void 0&&(t.pending.current=void 0,r(i)),()=>{t.go.current===r&&(t.go.current=void 0)}},[a,n,t]),null}function ns({context:t,to:e}){let{pathname:n}=ye(),a=pe(),r=(e??a)?.sayWhere,i=as(t,n);return(0,z.useEffect)(()=>(r?.(i),()=>r?.(null)),[r,i]),null}function as(t,e){let[n="",a,r]=e.split("/").filter(Boolean).map(o=>{try{return decodeURIComponent(o)}catch{return o}});if(r!==void 0)return"#";if(n==="places"&&a!==void 0){if(a===Cn)return"#overview=1";let o=t.views?.places().find(l=>l.as===a);return o?`#focus=${encodeURIComponent(He(o.kind))}&view=${encodeURIComponent(o.as)}`:"#"}let i=xe(t.store.schema,n);return i?`#focus=${encodeURIComponent(a??He(i))}`:"#"}function rs({onNavigate:t,path:e}){let n=ye(),a=Dn(),r=Be(),i=n.hash&&!n.hash.includes("=")?n.hash:"",o=`${n.pathname}${n.search}${i}`,l=(0,z.useRef)(t);l.current=t;let d=(0,z.useRef)(null);(0,z.useEffect)(()=>{let p=d.current;d.current=o,p!==null&&(o===p&&a!=="PUSH"||l.current?.(o,a==="POP"?"pop":a==="REPLACE"?"replace":"push"))},[n.key]);let c=(0,z.useRef)(e);return(0,z.useEffect)(()=>{e===void 0||e===c.current||(c.current=e,e!==o&&r(e))},[e]),null}function Hi({context:t,registry:e,page:n}){let a=ze(),r=xe(t.store.schema,a.slug??""),i=n==="list"?Jn:na,l=(r?e?.lookup(r,n):void 0)??i;return(0,A.jsx)(l,{context:t})}function is({context:t,registry:e,children:n}){let a=(0,z.useRef)(null);return Ga(a),(0,A.jsx)("div",{ref:a,"data-graview-face":"pages",style:{display:"contents"},children:(0,A.jsx)(xi,{context:t,registry:e,root:a,children:(0,A.jsx)(Ai,{context:t,root:a,children:n})})})}function os(t){return t instanceof HTMLElement?t.isContentEditable||t.tagName==="TEXTAREA"||t.tagName==="SELECT"?!0:t.tagName==="INPUT"&&!["button","submit","reset","checkbox","radio","image","file","color","range"].includes(t.type):!1}function ss(){let{pathname:t}=ye(),e=Dn(),n=(0,z.useRef)(null);(0,z.useLayoutEffect)(()=>{if(e!=="POP"){for(let i=n.current?.parentElement;i;i=i.parentElement){let{overflowY:o}=getComputedStyle(i);if((o==="auto"||o==="scroll")&&i.scrollHeight>i.clientHeight){i.scrollTop=0;return}}window.scrollTo(0,0)}},[t]);let a=(0,z.useRef)(t),r=(0,z.useRef)(!1);return(0,z.useEffect)(()=>{if(!r.current&&t===a.current)return;r.current=!0;let i=document.activeElement;if(os(i))return;let o=n.current?.closest("main")??document.querySelector("main"),d=n.current?.closest("[data-graview-face]")?.querySelector("[data-graview-page-title]")??o?.querySelector("h1, h2")??null??o??null;d&&(d.hasAttribute("tabindex")||d.setAttribute("tabindex","-1"),d.focus({preventScroll:!0}))},[t]),(0,A.jsx)("span",{ref:n,hidden:!0,"data-graview-scroll-reset":""})}function Wi({context:t,children:e}){let n=Be(),a=(0,z.useMemo)(()=>({record:(r,i)=>{let o=t.store.graph.getNode(r);o&&n(jt(Q(t.store.schema,o.kind,r),{section:i?.section}))},place:(r,i)=>{let o=t.views?.places().find(l=>l.as===r);o&&n(jt(he(t,o),i))},list:(r,i)=>{t.store.schema.tryDefinition(r)&&n(jt(`/${_(t.store.schema,r)}`,i))},draft:()=>n("/~draft")}),[t,n]);return(0,A.jsx)(qa.Provider,{value:a,children:e})}function ls(){let{pathname:t,search:e,hash:n}=ye();return(0,z.useEffect)(()=>{let a=decodeURIComponent(n.replace(/^#/,""));if(!(!a||a.includes("=")))return vi(a)},[t,e,n]),null}function ds({context:t,Home:e}){let n=ye(),a=t.views,r=n.key==="default"&&!(a&&Da(a));(0,z.useEffect)(()=>{a&&Ka(a)},[a]);let i=r?Ma(t.views?.arrangement?.()?.first,t.store.schema,t.views?.places()??[]):void 0,o=i?.to==="place"?he(t,i.place):i?.to==="kind"?`/${_(t.store.schema,i.kind)}`:void 0;return o?(0,A.jsx)(Kn,{to:o,replace:!0}):(0,A.jsx)(e,{context:t})}function Di({context:t,registry:e}){let n=e?.lookupSurface("shell"),a=n!==void 0,r=a&&(e?.without().has("bar")??!1),i=a&&!r&&!t.embedded?{...t,barAbove:!0}:t,o=E=>n===void 0?(0,A.jsx)(Xt,{context:t,children:E}):r?(0,A.jsx)(n,{context:t,children:E}):(0,A.jsx)(Xt,{context:t,children:(0,A.jsx)(n,{context:i,children:E})}),l=e?.lookupSurface("home")??Zn,d=e?.lookupSurface("problems")??ea,c=a?{...i,framed:!0}:t,[p,g]=(0,z.useState)(null),f=(0,z.useMemo)(()=>({context:c,registry:e}),[c,e]),u=(0,z.useMemo)(()=>({onFind:g,find:!(e?.without().has("find")??!1),places:!(e?.without().has("places")??!1)}),[e]),k=(0,A.jsx)(Bn.Provider,{value:f,children:(0,A.jsx)(Wi,{context:t,children:(0,A.jsx)(is,{context:t,registry:e,children:o((0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(ir,{face:"pages"}),(0,A.jsxs)(es,{context:c,children:[(0,A.jsx)(ss,{}),(0,A.jsx)(ls,{}),(0,A.jsxs)(si,{children:[(e?.routes()??[]).map(({path:E,component:y})=>(0,A.jsx)(Te,{path:E,element:(0,A.jsx)(y,{context:c})},E)),(0,A.jsx)(Te,{path:"/",element:(0,A.jsx)(ds,{context:c,Home:l})}),(0,A.jsx)(Te,{path:"/problems",element:(0,A.jsx)(d,{context:c})}),(0,A.jsx)(Te,{path:"/~draft",element:(0,A.jsx)(z.Suspense,{fallback:null,children:(0,A.jsx)(Zo,{context:c})})}),(0,A.jsx)(Te,{path:"/search",element:(0,A.jsx)(Xn,{context:c})}),(0,A.jsx)(Te,{path:"/map",element:(0,A.jsx)(Qn,{context:c})}),(0,A.jsx)(Te,{path:"/places",element:(0,A.jsx)(_n,{context:c})}),Ee(c).some(E=>E.as===Cn)?null:(0,A.jsx)(Te,{path:Ta,element:(0,A.jsx)(Kn,{to:"/",replace:!0})}),(0,A.jsx)(Te,{path:"/places/:as",element:(0,A.jsx)(Yn,{context:c})}),(0,A.jsx)(Te,{path:"/:slug",element:(0,A.jsx)(Hi,{context:c,registry:e,page:"list"})}),(0,A.jsx)(Te,{path:"/:slug/:id",element:(0,A.jsx)(Hi,{context:c,registry:e,page:"record"})})]})]})]}))})})});return t.embedded||!a||r?k:(0,A.jsx)(ci.Provider,{value:u,children:(0,A.jsx)(xr.Provider,{value:p,children:k})})}var cs=()=>typeof document>"u"?null:document.body;function ps({context:t,registry:e,basename:n,initialPath:a,onNavigate:r,path:i,steering:o,firstLook:l}){let[d,c]=(0,z.useState)(void 0),p=d!==void 0&&d.from===t.principal?{...t,principal:d.seat}:t;(0,z.useState)(()=>p.views?Ur(p.views,p.store.schema,$n(p.brand,p.store.schema)):void 0);let g=pe();ya({reader:p.locale??g?.locale,app:p.brand?.locale??p.app?.brand?.locale,readerTimeZone:p.timeZone??g?.timeZone,appTimeZone:p.brand?.timeZone??p.app?.brand?.timeZone});let f=p.principal??Xo,u=Fa(p.store,f,p.history),E=(u.past&&u.live===p.store?u.past.store:p.store).seenBy(f),y=E===p.store?p:{...p,store:E};Ia(p.store,p.principal);let x=(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(rs,{onNavigate:r,path:i}),o?(0,A.jsx)(ts,{steering:o}):null,y.presence||g?(0,A.jsx)(ns,{context:y,to:g}):null,(0,A.jsx)(Di,{context:y,...e?{registry:e}:{}}),l?(0,A.jsx)(Vr,{firstLook:l,root:cs,app:$n(p.brand,p.store.schema)}):null]}),N=y.views?(0,A.jsxs)(Ha,{store:y.store,views:y.views,...y.principal?{principal:y.principal}:{},...y.brand?{brand:y.brand}:{},...y.locale?{locale:y.locale}:{},...y.timeZone?{timeZone:y.timeZone}:{},...y.settings?{settings:y.settings}:{},...y.presence&&!g?{presence:y.presence}:{},...y.people?{people:y.people}:{},...y.seats?{seats:y.seats}:{},onSeat:V=>g?g.takeSeat(V):c({from:t.principal,seat:V}),...y.onKeepLens?{onKeepLens:y.onKeepLens}:{},...y.ai?{ai:y.ai}:{},...y.subscriptions?{subscriptions:y.subscriptions}:{},...y.signIn?{signIn:y.signIn}:{},resolveApp:y.resolveApp??g?.resolveApp,linkedRecords:y.linkedRecords??g?.linkedRecords,...y.app?{app:y.app}:{},...y.menuSections?{menuSections:y.menuSections}:{},children:[x,(0,A.jsx)(Wi,{context:y,children:(0,A.jsx)(bi,{context:y})})]}):x,C=(0,A.jsx)(Oa.Provider,{value:u,children:N}),D=y.files?(0,A.jsx)($a.Provider,{value:y.files,children:C}):C;if(a!==void 0){let V=n===void 0?a:`${n.replace(/\/$/,"")}${a}`;return(0,A.jsx)(oi,{initialEntries:[V],...n===void 0?{}:{basename:n},children:D})}return(0,A.jsx)(li,{...n===void 0?{}:{basename:n},children:D})}export{fo as a,ps as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk.AJZBJBMO.js";var e='"use strict";\n/*! @remote-dom/core and @remote-dom/polyfill \u2014 Copyright 2020-present, Shopify Inc. \u2014 MIT License.\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n * @graview/guest\'s worker runtime \u2014 Elastic License 2.0. */\n"use strict";(()=>{var Oe=globalThis,Kr=Oe.addEventListener,Zr=Oe.removeEventListener,Qr=Oe.postMessage,Jr=globalThis.queueMicrotask,un=globalThis.performance,eo=un?un.now.bind(un):Date.now,Re={listen:t=>Kr.call(Oe,"message",t),unlisten:t=>Zr.call(Oe,"message",t),post:t=>Qr.call(Oe,t),microtask:t=>Jr.call(globalThis,t),now:()=>eo()};var v=Symbol("name"),ue=Symbol("prefix"),de=Symbol("value"),S=Symbol("ns"),q=Symbol("owner"),I=Symbol("owner_document"),ne=Symbol("attributes"),M=Symbol("prev"),f=Symbol("next"),R=Symbol("child"),Y=Symbol("parent"),me=Symbol("host"),$=Symbol("data"),Ee=Symbol("listeners"),dn=Symbol("isTrusted"),Ae=Symbol("path"),_e=Symbol("stop_immediate_propagation"),Pe=Symbol("dispatching"),se=Symbol("content"),D=Symbol("hooks"),mt=Symbol("extensions"),Ne=Symbol("hooks_dispatch"),U=Symbol("is_connected"),Ce=Symbol("create_element"),qn=0,X=1,ke=2,Ie=3,Me=8,Te=9,Yn=10,fe=11,A="http://www.w3.org/1999/xhtml",K="http://www.w3.org/2000/svg",Wn="http://www.w3.org/XML/1998/namespace",Xe="http://www.w3.org/2000/xmlns/";function ft(t){return t.split(/[\\t\\n\\f\\r ]+/).filter(Boolean)}function G(t){return t.replace(/[A-Z]/g,e=>String.fromCharCode(e.charCodeAt(0)+32))}function Xn(t){return t.replace(/[a-z]/g,e=>String.fromCharCode(e.charCodeAt(0)-32))}function C(t,e){let n=globalThis.DOMException;if(typeof n=="function")return new n(t,e);let r=new Error(t);return r.name=e,r}var $n=/^(?:[A-Za-z][^\\0\\t\\n\\f\\r\\u0020/>]*|[:_\\u0080-\\u{10FFFF}][A-Za-z0-9-.:_\\u0080-\\u{10FFFF}]*)$/u,Kn=/[\\0\\t\\n\\f\\r />=]/u,to=/[\\0\\t\\n\\f\\r />]/u;function ie(t){if(t==null)return null;let e=String(t);return e===""?null:e}function Zn(t){$n.test(t)||fn(t)}function mn(t){(t===""||Kn.test(t))&&fn(t)}function pt(t,e,n){let r=ie(t),o=String(e),s=o.indexOf(":"),i=s<0?null:o.slice(0,s),a=s<0?o:o.slice(s+1);if((i!=null&&(i===""||to.test(i))||(n==="element"?!$n.test(a):a===""||Kn.test(a)))&&fn(o),i!=null&&r==null)throw C(`A namespace is required for the prefix in "${o}"`,"NamespaceError");if(i==="xml"&&r!==Wn)throw C("The xml prefix requires the XML namespace","NamespaceError");if((o==="xmlns"||i==="xmlns")&&r!==Xe)throw C("The xmlns name requires the XMLNS namespace","NamespaceError");if(r===Xe&&o!=="xmlns"&&i!=="xmlns")throw C("The XMLNS namespace requires the xmlns name or prefix","NamespaceError");return{namespace:r,qualifiedName:o,prefix:i,localName:a}}function fn(t){throw C(`Invalid name: "${t}"`,"InvalidCharacterError")}var ht=0,gt=1,Qn=2,pn=3,no=typeof performance>"u"?Date.now:performance.now.bind(performance),V=class{static NONE=ht;static CAPTURING_PHASE=gt;static AT_TARGET=Qn;static BUBBLING_PHASE=pn;timeStamp=no();target=null;currentTarget=null;srcElement=null;bubbles=!1;cancelable=!1;composed=!1;defaultPrevented=!1;cancelBubble=!1;eventPhase=ht;[Ae]=[];[_e]=!1;[Pe]=!1;constructor(e,n){this.type=e,Object.defineProperty(this,dn,{writable:!0,value:!1}),n&&(n.bubbles&&(this.bubbles=n.bubbles),n.cancelable&&(this.cancelable=n.cancelable),n.composed&&(this.composed=n.composed))}get isTrusted(){return this[dn]}composedPath(){return[...this[Ae]]}stopPropagation(){this.cancelBubble=!0}stopImmediatePropagation(){this[_e]=!0,this.cancelBubble=!0}preventDefault(){this.cancelable&&(this.defaultPrevented=!0)}set returnValue(e){e||this.preventDefault()}get returnValue(){return!this.defaultPrevented}initEvent(e,n,r){this.type=e,this.bubbles=!!n,this.cancelable=!!r}};function hn(t,e,n){if(t.cancelBubble)return;let o=e[Ee]?.get(t.type)?.[n===gt?"capture":"bubble"];if(o)for(let s of[...o]){if(!o.has(s)||s.signal?.aborted)continue;t.eventPhase=t.target===e?Qn:n,t.currentTarget=e;let i=s.normalizedListener;try{typeof i=="object"?i.handleEvent(t):i.call(e,t)}catch(a){setTimeout(ro,0,a)}if(t[_e])break}}function ro(t){throw t}var $e=[],yt=new WeakMap;function bt(t,e){let n=yt.get(t);n?n.push(e):yt.set(t,[e]),$e[$e.length-1].push(t)}function B(t){let e=[];$e.push(e);let n;try{n=t()}catch(r){$e.pop();try{Jn(e)}catch{}throw r}return $e.pop(),Jn(e),n}function Jn(t){let e,n=!1;for(let r of t){let o=yt.get(r);if(o){for(;o.length>0;){let s=o.shift();try{s()}catch(i){n||(e=i,n=!0)}}yt.delete(r)}}if(n)throw e}var Et=[],Ke=[],gn=!1;function we(t){for(let e of t)Et.push(e),e[1]&&Ke.push(e[1]);if(!gn){gn=!0;try{let e,n=!1;for(let r=0;r<Et.length;r++){let[o,s]=Et[r];s&&Ke.splice(Ke.indexOf(s),1);try{o()}catch(i){n||(e=i,n=!0)}}if(n)throw e}finally{Et.length=0,Ke.length=0,gn=!1}}}function Ze(t){let e=t;for(;e;){if(Ke.includes(e))return!0;e=e[Y]??e[me]}return!1}var Qe=Symbol("listenerRegistrations"),pe=class{[Ee]=void 0;[Qe]=void 0;[I]=void 0;addEventListener(e,n,r){if(n==null)return;let o=r===!0||typeof r=="object"&&r.capture===!0,s=typeof r=="object"&&r.once===!0,i=typeof r=="object"?r.signal:void 0;if(i?.aborted)return;let a=yn(o),l=this[Qe];l||(l=new Map,this[Qe]=l);let c=l.get(e);c||(c={},l.set(e,c));let m=c[a];if(m||(m=new Map,c[a]=m),m.has(n))return;let p=this,h={type:e,listener:n,capture:o,once:s,normalizedListener:n,signal:i};(s||i)&&(h.normalizedListener=function(...k){if(h.signal?.aborted){Nt(p,h);return}return h.once&&Nt(p,h),typeof h.listener=="object"?h.listener.handleEvent(...k):h.listener.call(this,...k)});let g=this[Ee];g||(g=new Map,this[Ee]=g);let O=g.get(e);O||(O={},g.set(e,O));let b=O[a];if(b||(b=new Set,O[a]=b),m.set(n,h),b.add(h),i){let E=()=>{Nt(p,h)};h.abortListener=E,i.addEventListener("abort",E,{once:!0})}this[I]?.defaultView[Ne].addEventListener?.(this,e,n,r)}removeEventListener(e,n,r){return oo.call(this,e,n,r)}dispatchEvent(e){if(e[Pe])throw C("Failed to execute \'dispatchEvent\' on \'EventTarget\': The event is already being dispatched.","InvalidStateError");e[Pe]=!0;try{let n=[],r=this;for(;r!=null;)n.push(r),r=r.parentNode;e.target=this,e.srcElement=this,e[Ae]=n;for(let s=n.length;s--;)if(hn(e,n[s],gt),e.cancelBubble)return!e.defaultPrevented;let o=e.bubbles?n:n.slice(0,1);for(let s=0;s<o.length;s++)if(hn(e,o[s],pn),e.cancelBubble)return!e.defaultPrevented;return!e.defaultPrevented}finally{e[Pe]=!1,e.cancelBubble=!1,e[_e]=!1,e.eventPhase=ht,e.currentTarget=null,e[Ae]=[]}}};function oo(t,e,n){if(e==null)return;let r=n===!0||n&&n.capture===!0,o=yn(!!r),s=this[Qe]?.get(t)?.[o]?.get(e);s&&Nt(this,s)}function yn(t){return t?"capture":"bubble"}function Nt(t,e){let n=yn(e.capture),r=t[Qe],o=r?.get(e.type);if(!o)return;let s=o[n];if(!s||s.get(e.listener)!==e)return;s.delete(e.listener),s.size===0&&delete o[n],!o.bubble&&!o.capture&&r?.delete(e.type),e.signal&&e.abortListener&&e.signal.removeEventListener("abort",e.abortListener);let i=t[Ee],a=i?.get(e.type);if(!a)return;let l=a[n];l?.delete(e)&&(l.size===0&&delete a[n],!a.bubble&&!a.capture&&i?.delete(e.type),t[I]?.defaultView[Ne].removeEventListener?.(t,e.type,e.listener,e.capture))}var Z=class extends Array{item(e){return this[e]??null}};var et=0,er=1,Nn=2,Tn=3,tt=4,tr=0,nr=1,xt=2,vt=3,rr=4,En=5,or=6,sr=7,Tt=/^(?:--|-?[A-Za-z_\\u0080-\\u{10FFFF}])[A-Za-z0-9_\\u0080-\\u{10FFFF}-]*$/u;function so(t,e){let n=1,r=null;for(let o=e;o<t.length;o++){let s=t[o];if(r){s==="\\\\"?o++:s===r&&(r=null);continue}if(s===\'"\'||s==="\'")r=s;else if(s==="(")n++;else if(s===")"&&--n===0)return[t.slice(e,o),o+1]}return[t.slice(e),t.length]}function W(t){throw C(`Invalid or unsupported selector: "${t}"`,"SyntaxError")}function St(t,e){let n=typeof e=="string"?nt(e):[{combinator:tt,matchers:e}],r=null,o=t[R];return o&&n[0].matchers.length&&wn(o,n,s=>(r=s,!1)),r}function Ot(t,e){let n=typeof e=="string"?nt(e):[{combinator:tt,matchers:e}],r=new Z,o=t[R];return o&&n[0].matchers.length&&wn(o,n,s=>{r.push(s)}),r}function nt(t,e=!1,n=!1){let r={combinator:tt,matchers:[]},o=[r],s=/[\\t\\n\\f\\r ]*?([>\\t\\n\\f\\r +~]?)[\\t\\n\\f\\r ]*?(?:(?:\\[[\\t\\n\\f\\r ]*([^\\]=\\t\\n\\f\\r ]+)[\\t\\n\\f\\r ]*(?:=[\\t\\n\\f\\r ]*(?:([\'"])(.*?)\\3|([^\\]\\t\\n\\f\\r ]+)))?[\\t\\n\\f\\r ]*(?:\\]|$))|([#.]?)([^\\t\\n\\f\\r #.[>:+~()]+)|:(\\w+)(\\()?)/gi,i=t.replace(/^[\\t\\n\\f\\r ]+|[\\t\\n\\f\\r ]+$/g,"");i===""&&W(t);let a=0,l;for(;l=s.exec(i);){l.index!==a&&W(t),l[1]&&(r.matchers.length===0&&!(n&&o.length===1)&&W(t),l[1]===">"?r.combinator=er:l[1]==="+"?r.combinator=Tn:l[1]==="~"?r.combinator=Nn:r.combinator=et,r={combinator:tt,matchers:[]},o.push(r));let c=l[8]?G(l[8]):l[2]||l[7];l[7]!=null&&!l[6]&&r.matchers.length>0&&W(t);let p,h=l[4]??l[5]??l[7];if(l[2]){Tt.test(c)||W(t);let g=l[5],O=g?.[0];if(l[3]==null&&(O===\'"\'||O==="\'")){let b=l[0].lastIndexOf(g);h=i.slice(l.index+b+1),s.lastIndex=i.length}else g!=null&&!Tt.test(g)&&W(t);p=rr}else l[6]?(Tt.test(c)||W(t),p=l[6]==="#"?xt:vt):l[8]?p=l[9]==null?En:or:l[7]==="*"?p=tr:l[7]&&Tt.test(l[7])?p=nr:W(t);l[9]?([h,s.lastIndex]=so(i,s.lastIndex),c!=="has"&&c!=="not"&&W(t),c==="has"&&e&&W(t),nt(h,e||c==="has",c==="has")):p===En&&W(t),r.matchers.push({type:p,name:c,value:h}),a=s.lastIndex}return(a!==i.length||r.matchers.length===0)&&W(t),o}function io(t,e){let n=nt(e);return n[0]?.matchers.length?Je(t,n):!1}function ao(t,e){let n=nt(e,!0,!0),r=n[0];if(n.length===1&&r.matchers.length===0)return!1;let o=et,s={type:sr,name:":scope"};if(r.matchers.length===0?(o=r.combinator,r.matchers.push(s)):n.unshift({combinator:et,matchers:[s]}),n.some(({matchers:l})=>l.length===0))return!1;let i=o===Tn||o===Nn?t[f]:t[R];if(!i)return!1;let a=!1;return wn(i,n,()=>(a=!0,!1),t),a}function wn(t,e,n,r){let o=[],s=t;for(;s;){if(j(s)){if(Je(s,e,r)&&n(s)===!1)return!1;let i=s[R];if(i){let a=s[f];a&&o.push(a),s=i;continue}}s=s[f]??o.pop()??null}return!0}function Je(t,e,n){let{combinator:r,matchers:o}=e[e.length-1];if(r===tt){if(!wt(t,o,n))return!1;let a=e.slice(0,-1);return a.length===0||Je(t,a,n)}let s=r===er||r===et?Y:M,i=t[s];if(!i)return!1;if(r===et||r===Nn){for(;i;){if(j(i)&&wt(i,o,n)){let a=e.slice(0,-1);if(a.length===0||Je(i,a,n))return!0}i=i[s]}return!1}else{if(r===Tn&&!j(i)){for(;i&&!j(i);)i=i[s];if(!i)return!1}if(!j(i)||!wt(i,o,n))return!1;let a=e.slice(0,-1);return a.length===0||Je(i,a,n)}}function bn(t,e){return t.getAttributeNS(null,t.namespaceURI===A?G(e):e)}function wt(t,e,n){if(!t)return!1;if(Array.isArray(e)){for(let i of e)if(wt(t,i,n)===!1)return!1;return!0}let{type:r,name:o,value:s}=e;switch(r){case tr:return o==="*";case nr:return t.namespaceURI===A?t.localName===G(o):t.localName===o;case xt:return bn(t,"id")===o;case vt:let i=bn(t,"class");return i?ft(i).includes(o):!1;case rr:let a=bn(t,o);return s==null?a!=null:a===s;case sr:return t===n;case En:W(`:${o}`);case or:switch(o){case"has":return ao(t,s||"");case"not":return!io(t,s||"");default:W(`:${o}(${s})`)}}return!1}function lo(t){return t.nodeType===ke}function rt(t){return $ in t}function vn(t){return t.nodeType===Ie}function co(t){return t.nodeType===Me}function j(t){return t.nodeType===X}function xn(t){return t.nodeType===fe}function cr(t){return"appendChild"in t}function Rt(t){let e=[],n=[t],r=new Set(n),o=new Set,s;for(;n.length>0;){let i=n.pop();if(r.delete(i),o.has(i))continue;let a=[];for(let l of st(i)){if(o.has(l)||(o.add(l),e.push(l),a.push(l),!j(l)))continue;let c=l[ne];if(c)for(let p of c)o.has(p)||(o.add(p),e.push(p));let m=l[se];m&&!o.has(m)&&!r.has(m)&&(r.add(m),n.push(m))}s??=a}return{nodes:e,treeNodes:s}}function ot(t,e){for(let n of t)n[I]=e}function ir(t,e){let n=t.constructor,r=new n(t.name,t.value,t.namespaceURI);return r[I]=e,r}function ar(t,e){if(vn(t))return e.createTextNode(t.data);if(co(t))return e.createComment(t.data);if(lo(t))return ir(t,e);if(j(t)){let n=e[Ce](t[v],t.namespaceURI,t[ue],t.localName);if(t[ne])for(let r=0;r<t[ne].length;r++){let o=t[ne].item(r);n.attributes.setNamedItem(ir(o,e))}return n}else{if(xn(t))return e.createDocumentFragment();{let n=new t.constructor;return n[I]=e,n}}}function At(t,e,n=t.ownerDocument){if(t.nodeType===Te)throw C("Cannot clone a document node","NotSupportedError");let r=ar(t,n);if(!e||!j(t)&&!xn(t))return r;let o=new Set([t]),s=[{source:t,destination:r,childIndex:0,cloningContent:!1}];for(;s.length>0;){let i=s[s.length-1],a,l;if(i.cloningContent)if(i.contentSource&&i.contentDestination)a=i.contentSource.childNodes[i.childIndex++],l=i.contentDestination;else{s.pop(),i.appendTo&&i.appendTo.appendChild(i.destination);continue}else if(a=i.source.childNodes[i.childIndex++],l=i.destination,!a){if(i.cloningContent=!0,i.childIndex=0,j(i.source)&&i.source.namespaceURI===A&&i.source.localName==="template"){let m=i.source[se];m&&(o.has(m)&&lr(),o.add(m),i.contentSource=m,i.contentDestination=i.destination.content)}continue}if(!a){s.pop(),i.appendTo&&i.appendTo.appendChild(i.destination);continue}o.has(a)&&lr(),o.add(a);let c=ar(a,n);j(a)||xn(a)?s.push({source:a,destination:c,appendTo:l,childIndex:0,cloningContent:!1}):l.appendChild(c)}return r}function lr(){throw new Error("Cannot clone a cyclic or repeated node graph")}function _t(t,e){let n=String(e);return n===""?null:St(t,[{type:xt,name:n}])}function Pt(t,e){let n=[...new Set(ft(String(e)))];return Ot(t,n.map(r=>({type:vt,name:r})))}function Ct(t,e){let n=String(e),r=G(n),o=[];for(let s of kt(t))j(s)&&(n==="*"||(s.namespaceURI===A?s[v]===r:s[v]===n))&&o.push(s);return o}function kt(t){let e=[],n=[],r=t[R];for(;r;){e.push(r);let o=r[R],s=r[f];o?(s&&n.push(s),r=o):r=s??n.pop()??null}return e}function st(t){let e=kt(t);return e.unshift(t),e}var Q=class extends pe{nodeType=qn;[v]="";[Y]=null;[me]=null;[R]=null;[M]=null;[f]=null;[U]=!1;get[D](){return this[I].defaultView[Ne]}get localName(){return this[v]}get nodeName(){return this[v]}get ownerDocument(){return this[I]}get isConnected(){return this[U]}isDefaultNamespace(e){let n=ie(e);return uo(this)===n}get parentNode(){return this[Y]}set parentNode(e){}get parentElement(){let e=this[Y];return!e||e.nodeType!==1?null:e}set parentElement(e){}get previousSibling(){return this[M]}set previousSibling(e){}get nextSibling(){return this[f]}set nextSibling(e){}get previousElementSibling(){let e=this[M];for(;e&&e.nodeType!==1;)e=e[M];return e}set previousElementSibling(e){}get nextElementSibling(){let e=this[f];for(;e&&e.nodeType!==1;)e=e[f];return e}set nextElementSibling(e){}get firstChild(){return this[R]}set firstChild(e){}get lastChild(){let e=this[R];for(;e;){let n=e[f];if(n==null)break;e=n}return e}set lastChild(e){}get nodeValue(){return rt(this)?this.data:null}set nodeValue(e){rt(this)&&(this.data=e)}get textContent(){if(rt(this))return this.data;let e="";for(let n of kt(this))vn(n)&&(e+=n.data);return e}set textContent(e){if(rt(this))this.data=e;else if(cr(this)){let n=e==null?"":String(e);n===""?this.replaceChildren():this.replaceChildren(n)}}cloneNode(e){return At(this,e)}contains(e){let n=e;for(;n!=null;){if(n===this)return!0;n=n.parentNode}return!1}};function uo(t){let e=t;for(;e;)switch(e.nodeType){case X:{let n=e;if(n.prefix==null&&n.namespaceURI!=null)return n.namespaceURI;let r=n.attributes.getNamedItemNS(Xe,"xmlns");if(r!=null&&r.prefix==null)return ie(r.value);e=n.parentElement;break}case Te:e=e.documentElement;break;case Yn:case fe:return null;case ke:e=e.ownerElement;break;default:e=e.parentElement}return null}var J=Symbol("insertNode"),Rn=Symbol("preflightInsertions"),It=Symbol("replaceNode"),he=class extends Q{remove(){let e=this.parentNode;e&&e.removeChild(this)}replaceWith(...e){let n=xe(e),r=this.parentNode;if(r)return Sn(o=>{ae(r,n);let s=this[f];for(;s&&n.includes(s);)s=s[f];let i=On(r,n,o);this.parentNode===r?r[It](i,this,o):r[J](i,s,o)})}before(...e){let n=xe(e),r=this.parentNode;if(r)return Sn(o=>{ae(r,n);let s=this[M];for(;s&&n.includes(s);)s=s[M];let i=On(r,n,o);r[J](i,s?s[f]:r.firstChild,o)})}after(...e){let n=xe(e),r=this.parentNode;if(r)return Sn(o=>{ae(r,n);let s=this[f];for(;s&&n.includes(s);)s=s[f];let i=On(r,n,o);r[J](i,s,o)})}};function Sn(t){return B(()=>{let e=[];try{t(e)}catch(n){try{we(e)}catch{}throw n}we(e)})}function xe(t){return t.map(e=>e instanceof Q?e:String(e))}function it(t,e){return e instanceof Q?e:t.ownerDocument.createTextNode(String(e))}function ae(t,e){for(let n of e){if(!(n instanceof Q))continue;let r=t;for(;r;){if(r===n)throw C("Cannot insert a node into itself or one of its descendants","HierarchyRequestError");r=r[Y]??r[me]}}}function On(t,e,n){let r=[];for(let s of e)r.push(it(t,s));if(r.length===1)return r[0];let o=t.ownerDocument.createDocumentFragment();o[Rn](r);for(let s of r)o[J](s,null,n);return o}var Mt,An=0,ur=0,dr=0,mr=0,De=!1,Pn=!1,at=!1,Dt=class{#t;#n=[];#e=new Set;#r=!1;constructor(e){if(typeof e!="function")throw new TypeError("MutationObserver callback must be a function");this.#t=e}observe(e,n={}){let r=mo(n),o=Mt??=new WeakMap,s=o.get(e);s==null&&(s=new Map,o.set(e,s));let i=s.get(this);i==null?An++:_n(i,-1),s.set(this,r),_n(r,1),this.#e.add(e)}disconnect(){let e=Mt;if(e!=null){for(let n of this.#e){let r=e.get(n),o=r?.get(this);o!=null&&(r.delete(this),An--,_n(o,-1)),r?.size===0&&e.delete(n)}this.#e.clear(),this.#n.length=0,An===0&&(Mt=void 0)}}takeRecords(){return this.#n.splice(0)}enqueue(e){this.#n.push(e),!this.#r&&(this.#r=!0,queueMicrotask(()=>{this.#r=!1;let n=this.takeRecords();n.length>0&&this.#t.call(this,n,this)}))}};function ee(t){let e=Mt;if(e==null)return;let n=new Map,r=t.target;for(;r;){let o=e.get(r);if(o)for(let[s,i]of o){if(r!==t.target&&!i.subtree)continue;let a=!1;if(t.type==="attributes"){if(!i.attributes||i.attributeFilter&&!i.attributeFilter.has(t.attributeName??""))continue;a=i.attributeOldValue}else if(t.type==="characterData"){if(!i.characterData)continue;a=i.characterDataOldValue}else if(!i.childList)continue;n.set(s,n.get(s)===!0||a)}r=r.parentNode}for(let[o,s]of n)o.enqueue({addedNodes:t.addedNodes??new Z,attributeName:t.attributeName??null,attributeNamespace:t.attributeNamespace??null,nextSibling:t.nextSibling??null,oldValue:s?t.oldValue??null:null,previousSibling:t.previousSibling??null,removedNodes:t.removedNodes??new Z,target:t.target,type:t.type})}function Lt(...t){let e=new Z;return e.push(...t),e}function mo(t){if(t.attributes===!1&&(t.attributeOldValue||t.attributeFilter!=null))throw new TypeError("attributeOldValue and attributeFilter require attributes to be enabled");if(t.characterData===!1&&t.characterDataOldValue)throw new TypeError("characterDataOldValue requires characterData to be enabled");let e=t.attributes??(t.attributeOldValue===!0||t.attributeFilter!=null),n=t.characterData??t.characterDataOldValue===!0,r=t.childList===!0;if(!e&&!n&&!r)throw new TypeError("MutationObserver options must enable childList, attributes, or characterData");return{attributes:e,attributeFilter:t.attributeFilter==null?void 0:new Set(t.attributeFilter.map(String)),attributeOldValue:t.attributeOldValue===!0,characterData:n,characterDataOldValue:t.characterDataOldValue===!0,childList:r,subtree:t.subtree===!0}}function _n(t,e){t.attributes&&(ur+=e),t.characterData&&(dr+=e),t.childList&&(mr+=e),De=ur>0,Pn=dr>0,at=mr>0}var re=class extends he{childNodes=new Z;children=new Z;appendChild(e){return B(()=>this[J](e,null))}insertBefore(e,n){return B(()=>this[J](e,n||null))}append(...e){return B(()=>{let n=xe(e.filter(r=>r!=null));n.length>1&&ae(this,n);for(let r of n)this[J](it(this,r),null)})}prepend(...e){return B(()=>{let n=xe(e.filter(o=>o!=null));n.length>1&&ae(this,n);let r=this.firstChild;for(let o of n)this[J](it(this,o),r)})}replaceChildren(...e){return B(()=>{let n=xe(e.filter(o=>o!=null));ae(this,n);let r;for(;r=this.firstChild;)this.removeChildImmediately(r);for(let o of n)this[J](it(this,o),null)})}removeChild(e){return B(()=>(this.removeChildImmediately(e),e))}removeChildImmediately(e){if(e.parentNode!==this)throw C("The node is not a child of this node","NotFoundError");let n=this[U]?st(e):void 0,r=e[M],o=e[f],s=Gt(this,e);if(n)for(let i of n)i[U]=!1;this.queueRemovalMutationRecord(this,e,r,o),n&&this.enqueueTreeReactions(n,"disconnectedCallback"),we(this.collectRemovalHookEffects(e,s))}replaceChild(e,n){return B(()=>this[It](e,n))}[It](e,n,r){if(ae(this,[e]),n.parentNode!==this)throw C("The reference node is not a child of this parent","NotFoundError");let o=n[M],s=n[f],i=this.prepareInsertion(e),a=this[U]?st(n):void 0,l=new Set(i.map(({node:h})=>h)),c=s;for(;c&&l.has(c);)c=c[f];let m=Gt(this,n);if(a){for(let g of a)g[U]=!1;let h=new Set(a);for(let g of i)h.has(g.node)&&(g.shouldDisconnect=!1)}this.commitInsertion(i,c);let p=this[U];return this.queueRemovalMutationRecord(this,n,o,s),this.queueInsertionMutationRecords(i),a&&this.enqueueTreeReactions(a,"disconnectedCallback"),this.enqueueInsertionReactions(i,p),this.performOrCollectHookEffects([...this.collectRemovalHookEffects(n,m),...this.collectInsertionHookEffects(i)],r),n}querySelectorAll(e){return Ot(this,e)}querySelector(e){return St(this,e)}[J](e,n,r){return this.validateInsertion(e,n),this.insertIntoValidated(e,n,r),e}[Rn](e){for(let n of e)this.validateInsertion(n,null),this.prepareInsertion(n)}validateInsertion(e,n){if(ae(this,[e]),n&&n.parentNode!==this)throw C("The reference node is not a child of this parent","NotFoundError")}insertIntoValidated(e,n,r){e===n&&(n=e[f]);let o=this.prepareInsertion(e);this.commitInsertion(o,n);let s=this[U];this.queueInsertionMutationRecords(o),this.enqueueInsertionReactions(o,s),this.performOrCollectHookEffects(this.collectInsertionHookEffects(o),r)}performOrCollectHookEffects(e,n){n?n.push(...e):we(e)}prepareInsertion(e){let n=[];if(e.nodeType===fe){let i=e[R];for(;i;)n.push(i),i=i[f]}else n.push(e);let r=this[U],o=this[I],s=[];for(let i of n){let a=i[U],l=a||r,c,m;if(i[I]===o)l&&(c=st(i));else{let p=Rt(i);m=p.nodes,l&&(c=p.treeNodes)}s.push({node:i,nodes:c,adoption:m,shouldDisconnect:a})}return s}commitInsertion(e,n){for(let s of e){let i=s.node[Y];if(i){let a=s.node[M],l=s.node[f];s.source={parent:i,index:Gt(i,s.node),previousSibling:a,nextSibling:l}}}for(let s of e){let i=this.attachChild(s.node,n);s.insertIndex=i.index,s.previousSibling=i.previousSibling,s.nextSibling=i.nextSibling}let r=this[I];for(let{adoption:s}of e)s&&ot(s,r);let o=this[U];for(let{nodes:s}of e)if(s)for(let i of s)i[U]=o}attachChild(e,n){if(n){let s=n[M];e[f]=n,e[M]=s,s?s[f]=e:this[R]=e,n[M]=e}else{e[f]=null;let s=this[R];if(s){let i;for(;i=s[f];)s=i;s[f]=e,e[M]=s}else this[R]=e,e[M]=null}let r=j(e);e[Y]=this;let o;if(n){if(o=this.childNodes.indexOf(n),this.childNodes.splice(o,0,e),r){let s=n;for(;s&&!j(s);)s=s[f];s?this.children.splice(this.children.indexOf(s),0,e):this.children.push(e)}}else o=this.childNodes.length,this.childNodes.push(e),r&&this.children.push(e);return{index:o,previousSibling:e[M],nextSibling:e[f]}}queueRemovalMutationRecord(e,n,r,o){at&&ee({type:"childList",target:e,removedNodes:Lt(n),previousSibling:r,nextSibling:o})}queueInsertionMutationRecords(e){if(at)for(let n of e){let{node:r,source:o}=n;o&&this.queueRemovalMutationRecord(o.parent,r,o.previousSibling,o.nextSibling),ee({type:"childList",target:this,addedNodes:Lt(r),previousSibling:n.previousSibling,nextSibling:n.nextSibling})}}collectRemovalHookEffects(e,n){return this.nodeType!==X||Ze(this)?[]:[[()=>this[D].removeChild?.(this,e,n)]]}collectInsertionHookEffects(e){let n=[];for(let r of e){let{node:o,source:s}=r;s?.parent.nodeType===X&&!Ze(s.parent)&&n.push([()=>s.parent[D].removeChild?.(s.parent,o,s.index)]),this.nodeType===X&&!Ze(this)&&n.push([()=>this[D].insertChild?.(this,o,r.insertIndex),o])}return n}enqueueInsertionReactions(e,n){for(let r of e){let{nodes:o}=r;o&&(r.shouldDisconnect&&this.enqueueTreeReactions(o,"disconnectedCallback"),n&&this.enqueueTreeReactions(o,"connectedCallback"))}}enqueueTreeReactions(e,n){pr(e,n)}};function fr(t,e,n,r){if(e.parentNode!==t)throw Error("not a child of this node");let o=t[U]?n.treeNodes:void 0,s=e[M],i=e[f],a=Gt(t,e);if(o)for(let c of o)c[U]=!1;ot(n.nodes,r),at&&ee({type:"childList",target:t,removedNodes:Lt(e),previousSibling:s,nextSibling:i}),o&&pr(o,"disconnectedCallback");let l=[];t.nodeType===X&&!Ze(t)&&l.push([()=>t[D].removeChild?.(t,e,a)]),we(l)}function Gt(t,e){let n=e[M],r=e[f];n?n[f]=r:t[R]=r,r&&(r[M]=n);let o=t.childNodes.indexOf(e);return t.childNodes.splice(o,1),j(e)&&t.children.splice(t.children.indexOf(e),1),e[Y]=null,e[f]=null,e[M]=null,o}function pr(t,e){for(let n of t){let r=n[e];typeof r=="function"&&bt(n,()=>r.call(n))}}function lt(t,e,n,r,o){let{observedAttributes:s}=t.constructor,{attributeChangedCallback:i}=t;i==null||s==null||!s.includes(e)||bt(t,()=>i.call(t,e,n,r,o))}var Ht=class{[R]=null;constructor(e){this[q]=e}getNamedItem(e){let n=String(e),r=this[q][S]===A?G(n):n,o=this[R];for(;o;){if(o.name===r)return o;o=o[f]}return null}getNamedItemNS(e,n){let r=ie(e),o=String(n),s=this[R];for(;s;){if(s.localName===o&&s[S]===r)return s;s=s[f]}return null}item(e){let n=this[R],r=0;for(;n;){if(r++===e)return n;n=n[f]}return null}get length(){let e=0,n=this[R];for(;n;)e++,n=n[f];return e}removeNamedItem(e){let n=String(e),r=this[q][S]===A?G(n):n;return B(()=>this.removeNamedItemImmediately(o=>o.name===r))}removeNamedItemNS(e,n){let r=ie(e),o=String(n);return B(()=>this.removeNamedItemImmediately(s=>s.localName===o&&s[S]===r))}removeNamedItemImmediately(e){let n=this[q],r=this[R],o=null;for(;r!=null;){if(e(r)){o&&(o[f]=r[f]),this[R]===r&&(this[R]=r[f]);let s=r.value;return r[f]=null,r[q]=null,De&&ee({type:"attributes",target:n,attributeName:r.name,attributeNamespace:r[S],oldValue:s}),n[D].removeAttribute?.(n,r.name,r[S]),lt(n,r.localName,s,null,r[S]),r}o=r,r=r[f]}return null}setNamedItem(e){return B(()=>this.setNamedItemImmediately(e))}setNamedItemImmediately(e){let n=this[q],r=e[q];if(r!=null&&r!==n)throw C("The attribute is already in use by another element.","InUseAttributeError");let o=null,s=this[R],i=null;for(;s;){if(s.localName===e.localName&&s[S]===e[S]){if(s===e)return s;i?i[f]=e:this[R]=e,e[f]=s[f],s[f]=null,o=s;break}i=s,s=s[f]}o==null&&(i?i[f]=e:this[R]=e),e[q]=n,e[I]=n[I],o&&(o[q]=null);let a=o==null||o.value!==e.value,l=o!=null&&o.name!==e.name;return a&&De&&ee({type:"attributes",target:n,attributeName:e.name,attributeNamespace:e[S],oldValue:o?.value??null}),l&&n[D].removeAttribute?.(n,o.name,o[S]),(a||l)&&n[D].setAttribute?.(n,e.name,e.value,e[S]),a&<(n,e.localName,o?.value??null,e.value,e[S]),o}setNamedItemNS(e){return this.setNamedItem(e)}*[Symbol.iterator](){let e=this[R];for(;e;)yield e,e=e[f]}};var ve=class extends Q{nodeType=ke;[S]=null;[f]=null;[q]=null;constructor(e,n,r){super(),this[v]=e,this[de]=n,r&&(this[S]=r)}get nodeName(){return this[v]}set nodeName(e){}get name(){return this[v]}set name(e){}get localName(){if(this[S]==null)return this[v];let e=this[v].indexOf(":");return e<0?this[v]:this[v].slice(e+1)}get prefix(){if(this[S]==null)return null;let e=this[v].indexOf(":");return e<0?null:this[v].slice(0,e)}get value(){return this[de]}set value(e){let n=String(e),r=this[q];if(!r){this[de]=n;return}B(()=>{let o=this[de];this[de]=n,De&&o!==n&&ee({type:"attributes",target:r,attributeName:this[v],attributeNamespace:this[S],oldValue:o}),this[D].setAttribute?.(r,this[v],n,this[S]),lt(r,this.localName,o,n,this[S])})}get nodeValue(){return this.value}set nodeValue(e){this.value=e}get ownerElement(){return this[q]}get namespaceURI(){return this[S]}get specified(){return!0}};var fo={amp:"&",AMP:"&",apos:"\'",gt:">",GT:">",lt:"<",LT:"<",quot:\'"\',QUOT:\'"\'},po=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ho=/(?:<([a-z][a-z0-9-:]*)((?:[\\s]+[^<>\'"=/\\s]+(?:=([\'"])[^]*?\\3|=[^>\'"\\s]*|))*)[\\s]*(\\/?)\\s*>|<\\/([a-z][a-z0-9-:]*)>|<!--(.*?)-->|([^<>]+))/gi,yr=/\\s([^<>\'"=/\\n\\s]+)(?:=(["\'])([\\s\\S]*?)\\2|=([^>\'"\\n\\s]*)|)/g,go="|b|big|blockquote|body|br|center|code|dd|div|dl|dt|em|embed|h1|h2|h3|h4|h5|h6|head|hr|i|img|li|listing|menu|meta|nobr|ol|p|pre|ruby|s|small|span|strong|strike|sub|sup|table|tt|u|ul|var|",yo=/^(?:color|face|size)$/i;function hr(t){return t.replace(/&(?:(amp|AMP|apos|gt|GT|lt|LT|quot|QUOT)|#(\\d+)|#[xX]([\\da-fA-F]+));/g,(e,n,r,o)=>{if(n)return fo[n];let s=Number.parseInt(r??o,r?10:16);try{return String.fromCodePoint(s)}catch{return e}})}function br(t){return t.namespaceURI===A&&po.has(t.localName)}function gr(t){let e=t.localName;return t[S]===K&&(e==="foreignObject"||e==="desc"||e==="title")}function bo(t,e){if(go.includes(`|${t}|`))return!0;if(t!=="font")return!1;for(let n of e.matchAll(yr))if(yo.test(n[1]))return!0;return!1}function Ut(t,e){let n=e.ownerDocument,r=n.createDocumentFragment(),o=[],s=r;for(let i of t.matchAll(ho)){let a=i[1];if(a){let l=i[2],c=G(a),m=o[o.length-1]?.element??e,p=m[S]===K?K:A;if(c==="svg")p=K;else if(p===K){if(gr(m))p=A;else if(bo(c,l)){for(;o.length>0;){let O=o[o.length-1];if(O.element[S]!==K||gr(O.element))break;o.pop(),s=O.target}p=A}}let h=p===A?c:a,g=n[Ce](h,p,null,h);for(let O of l.matchAll(yr))g.setAttribute(O[1],hr(O[3]||O[4]||""));if(s.append(g),br(g)||p!==A&&i[4])continue;o.push({element:g,target:s}),s=p===A&&c==="template"?g.content:g}else if(i[5]){let l=G(i[5]);for(let c=o.length-1;c>=0;c--){let m=o[c],p=G(m.element[v]);if(p===l){s=m.target,o.length=c;break}if(m.element[S]===A&&p==="template")break}}else i[6]?s.append(n.createComment(i[6])):s.append(hr(i[7]))}return r}function Vt(t){return Nr([{type:"content",child:t[R]}])}function Er(t){return Nr([{type:"opening",node:t}])}function Nr(t){let e=[],n;for(;n=t.pop();)switch(n.type){case"opening":{let r=n.node;switch(r.nodeType){case X:{let o=r;e.push(`<${o[v]}`);let s=o[ne]?.[R];for(;s;){e.push(` ${s[v]}`);let a=s[de];a!==""&&(a=String(a).replace(/&/g,"&").replace(/"/g,"""),e.push(`="${a}"`)),s=s[f]}if(e.push(">"),br(o))break;let i=o.namespaceURI===A&&o.localName==="template"?o[se]:o;t.push({type:"closing",name:o[v]}),t.push({type:"content",child:i?.[R]??null});break}case Ie:{let o=r;e.push(o[$].replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">"));break}case Me:{let o=r;e.push(`<!--${o[$]}-->`);break}}break}case"content":{let r=n.child;r&&(t.push({type:"content",child:r[f]}),t.push({type:"opening",node:r}));break}case"closing":e.push(`</${n.name}>`);break}return e.join("")}var H=class extends re{nodeType=X;[S]=A;[ue]=null;get namespaceURI(){return this[S]}get prefix(){return this[ue]}get localName(){let e=this[ue];return e==null?this[v]:this[v].slice(e.length+1)}get nodeName(){return this[S]===A?Xn(this[v]):this[v]}get tagName(){return this.nodeName}get id(){return this.getAttributeNS(null,"id")??""}set id(e){this.setAttribute("id",String(e))}get slot(){return this.getAttributeNS(null,"slot")??""}set slot(e){let n=String(e);this.getAttributeNS(null,"slot")!==n&&this.attributes.setNamedItem(new ve("slot",n))}get attributes(){let e=this[ne];return e||(e=new Ht(this),this[ne]=e),e}getAttributeNames(){return[...this.attributes].map(e=>e.name)}getElementsByTagName(e){return Ct(this,e)}get firstElementChild(){return this.children[0]??null}getElementsByClassName(e){return Pt(this,e)}get lastElementChild(){return this.children[this.children.length-1]??null}get nextElementSibling(){let e=this.nextSibling;for(;e&&e.nodeType!==1;)e=e.nextSibling;return e}get previousElementSibling(){let e=this.previousSibling;for(;e&&e.nodeType!==1;)e=e.previousSibling;return e}setAttribute(e,n){let r=String(e),o=String(n);mn(r);let s=this[S]===A?G(r):r,i=this.attributes.getNamedItemNS(null,s);i?i.value=o:this.attributes.setNamedItem(new ve(s,o))}setAttributeNS(e,n,r){let o=ie(e),s=String(n),i=String(r),a=pt(o,s,"attribute"),l=this.attributes.getNamedItemNS(a.namespace,a.localName);l?l.value=i:this.attributes.setNamedItemNS(new ve(a.qualifiedName,i,a.namespace))}toggleAttribute(e,n){let r=String(e);mn(r);let o=this[S]===A?G(r):r,s=this.attributes.getNamedItemNS(null,o),i=n===void 0?void 0:!!n;return s==null?i===!1?!1:(this.attributes.setNamedItem(new ve(o,"")),!0):i===!0?!0:(this.attributes.removeNamedItemNS(null,o),!1)}getAttribute(e){let n=this.attributes.getNamedItem(e);return n&&n.value}getAttributeNS(e,n){let r=this.attributes.getNamedItemNS(e,n);return r&&r.value}hasAttribute(e){return this.attributes.getNamedItem(e)!=null}hasAttributeNS(e,n){return this.attributes.getNamedItemNS(e,n)!=null}removeAttribute(e){let n=String(e),r=this[S]===A?G(n):n;this.attributes.removeNamedItemNS(null,r)}removeAttributeNS(e,n){this.attributes.removeNamedItemNS(e,n)}get outerHTML(){return Er(this)}get innerHTML(){return Vt(this)}set innerHTML(e){if(e==null||e==="")this.replaceChildren();else{let n=Ut(String(e),this);this.replaceChildren(n)}}};var Le=class t extends H{[S]=K;get ownerSVGElement(){let e=null,n=this.parentNode;for(;n instanceof t;)e=n,n=n.parentNode;return e}};var ge=class extends he{[$]="";constructor(e){super(),this[$]=e==null?"":String(e)}setData(e){let n=Pn,r=n?this[$]:null,o="";e!=null&&(o=typeof e=="string"?e:String(e)),this[$]=o,n&&r!==o&&ee({type:"characterData",target:this,oldValue:r}),this[D].setText?.(this,o)}get data(){return this[$]}set data(e){this.setData(e)}};var Ge=class extends ge{nodeType=Ie;[v]="#text"};var He=class extends ge{nodeType=Me;[v]="#comment"};var Ue=class extends re{nodeType=fe;[v]="#document-fragment";[I]=typeof window<"u"?window.document:null;getElementById(e){return _t(this,e)}};var Ve=class extends H{get content(){let e=this[se];return e||(e=this.ownerDocument.createDocumentFragment(),e[me]=this,this[se]=e),e}set content(e){}set innerHTML(e){this.content.replaceChildren(Ut(String(e),this))}get innerHTML(){let e=this[se];return e?Vt(e):""}};var Bt=class extends H{};var zt=class extends H{};var jt=class extends H{};var ct=class extends re{nodeType=Te;[v]="#document";[U]=!0;constructor(e){super(),this.defaultView=e,this[I]=this,this.documentElement=qt(new jt,this,"html"),this.body=qt(new Bt,this,"body"),this.head=qt(new zt,this,"head"),this.appendChild(this.documentElement),this.documentElement.appendChild(this.head),this.documentElement.appendChild(this.body)}get textContent(){return null}set textContent(e){}getElementsByClassName(e){return Pt(this,e)}createElement(e){let n=String(e);return Zn(n),Cn(this,G(n))}createElementNS(e,n){let r=pt(e,n,"element");return Cn(this,r.qualifiedName,r.namespace,r.prefix,r.localName)}[Ce](e,n,r,o){return Cn(this,e,n,r,o)}createTextNode(e){let n=Ft(new Ge(e),this);return this[D].createText?.(n,n.data),n}createComment(e){return Ft(new He(e),this)}createDocumentFragment(){return Ft(new Ue,this)}createEvent(){return new V("")}getElementById(e){return _t(this,e)}getElementsByTagName(e){return Ct(this,e)}importNode(e,n){if(e.nodeType===Te)throw C("Cannot import a document node","NotSupportedError");return At(e,n,this)}adoptNode(e){if(e[I]===this)return e;let n=Rt(e);return B(()=>{let r=e.parentNode;return r?fr(r,e,n,this):ot(n.nodes,this),e})}};function Ft(t,e){return Object.defineProperty(t,I,{value:e,writable:!0,enumerable:!1}),t}function Cn(t,e,n=A,r=null,o=e){let s;if(n===K)s=new Le;else if(n===A&&o==="template")s=new Ve;else if(n===A){let i=t.defaultView.customElements.get(o);s=i?new i:new H}else s=new H;return qt(s,t,e,n,r)}function qt(t,e,n,r=A,o=null){return Ft(t,e),Object.defineProperties(t,{[v]:{value:n},[S]:{value:r},[ue]:{value:o}}),e[D].createElement?.(t,r),t}var Yt=class extends V{constructor(e,n){super(e,n),this.detail=n?.detail??null}initCustomEvent(e,n,r,o){super.initEvent(e,n,r),this.detail=o??null}};var Wt=class extends V{constructor(e,n){super(e,n),this.message=n.message,this.filename=n.filename,this.lineno=n.lineno,this.colno=n.colno,this.error=n.error}};var Xt=class extends V{constructor(e,n){super(e,n),this.promise=n.promise,this.reason=n.reason}};var $t=class extends V{constructor(e,n){super(e,n),this.oldState=n.oldState,this.newState=n.newState}};var Kt=class extends V{constructor(e,n={}){super(e,n),this.relatedTarget=n.relatedTarget??null}};var Zt=class extends V{constructor(e,n={}){super(e,n),this.clipboardData=n.clipboardData??null}};var Qt=class extends H{};var Eo=/^[a-z][^A-Z\\u0000\\t\\n\\f\\r />]*-[^A-Z\\u0000\\t\\n\\f\\r />]*$/u,No=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function Tr(t){return Eo.test(t)&&!No.has(t)}function wr(t){return C(`Invalid custom element name: "${t}"`,"SyntaxError")}var Jt=class{registry=new Map;listenersByName=new Map;define(e,n,r){if(!Tr(e))throw wr(e);if(this.registry.has(e))throw C(`A custom element named "${e}" has already been defined`,"NotSupportedError");if(this.getName(n)!=null)throw C("This constructor has already been registered in this custom element registry","NotSupportedError");this.registry.set(e,n);let o=this.listenersByName.get(e);if(o!=null){this.listenersByName.delete(e);for(let s of o)s(n)}}get(e){return this.registry.get(e)}getName(e){for(let[n,r]of this.registry)if(r===e)return n;return null}whenDefined(e){if(!Tr(e))return Promise.reject(wr(e));let n=this.registry.get(e);if(n!=null)return Promise.resolve(n);let r=this.listenersByName.get(e);return r==null&&(r=[],this.listenersByName.set(e,r)),new Promise(o=>{r.push(o)})}upgrade(e){}initialize(e){}};var To=["onerror","onunhandledrejection"],vr=Symbol.for("@remote-dom/polyfill/global-property");function Sr(t){return Object.getOwnPropertyDescriptors(t)}function Or(t){let e={};for(let[n,r]of Object.entries(Object.getOwnPropertyDescriptors(pe.prototype)))n!=="constructor"&&typeof r.value=="function"&&(r.value=kn(r.value.bind(t)),e[n]=r);return e}function Rr(t){let e={};for(let n of To)e[n]={configurable:!0,enumerable:!0,get:kn(()=>t[n]),set:kn(r=>{t[n]=r})};return e}function wo(t){return Object.assign(Sr(t),Or(t),Rr(t))}function kn(t){return Object.defineProperty(t,vr,{value:!0}),t}function xr(t,e){for(let n of Reflect.ownKeys(e)){let r=xo(t,n);(r==null||vo(r))&&Object.defineProperty(t,n,e[n])}}function xo(t,e){let n=t;for(;n;){let r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=Object.getPrototypeOf(n)}}function vo(t){return[t.value,t.get,t.set].some(e=>typeof e=="function"&&e[vr]===!0)}var Se=class extends pe{[D]={};[mt]=[];[Ne]=Oo(this);name="";window=this;parent=this;self=this;top=this;document=new ct(this);customElements=new Jt;location=globalThis.location;navigator=globalThis.navigator;Event=V;ErrorEvent=Wt;PromiseRejectionEvent=Xt;ToggleEvent=$t;FocusEvent=Kt;ClipboardEvent=Zt;EventTarget=pe;CustomEvent=Yt;Node=Q;ParentNode=re;ChildNode=he;DocumentFragment=Ue;Document=ct;CharacterData=ge;Comment=He;Text=Ge;Element=H;HTMLElement=Qt;SVGElement=Le;HTMLTemplateElement=Ve;MutationObserver=Dt;#t=null;#n=null;#e=null;static with(...e){let n=this;return class extends n{constructor(){super();for(let o of e)So(this,o)}}}get onerror(){return this.#n}set onerror(e){this.#t&&this.removeEventListener("error",this.#t),e&&typeof e=="function"?(this.#n=e,this.#t=n=>{e(n.message??"Error",n.filename,n.lineno,n.colno,n.error)},this.addEventListener("error",this.#t)):(this.#t=null,this.#n=null)}get onunhandledrejection(){return this.#e}set onunhandledrejection(e){this.#e&&this.removeEventListener("unhandledrejection",this.#e),e&&typeof e=="function"?(this.#e=e,this.addEventListener("unhandledrejection",this.#e)):this.#e=null}static setGlobal(e){let n=globalThis.self,r=globalThis.window,o=Sr(e),s=Object.assign(Or(e),Rr(e));delete o.self,Object.defineProperties(globalThis,o),xr(globalThis,s),typeof n>"u"||n===r&&n!==globalThis?Object.defineProperty(globalThis,"self",{value:e,configurable:!0,writable:!0,enumerable:!0}):n!==globalThis&&(Object.defineProperties(n,o),xr(n,s))}static setGlobalThis(e){for(let n in e)e[n]===e&&(e[n]=globalThis);Object.defineProperties(globalThis,wo(e))}};function So(t,e){t[mt].push(e(t)??{})}function Oo(t){return{createElement:le.bind(null,t,"createElement"),setAttribute:le.bind(null,t,"setAttribute"),removeAttribute:le.bind(null,t,"removeAttribute"),createText:le.bind(null,t,"createText"),setText:le.bind(null,t,"setText"),insertChild:le.bind(null,t,"insertChild"),removeChild:le.bind(null,t,"removeChild"),addEventListener:le.bind(null,t,"addEventListener"),removeEventListener:le.bind(null,t,"removeEventListener")}}function le(t,e,...n){for(let s of t[mt])s[e]?.apply(s,n);let r=t[D];r[e]?.apply(r,n)}var en=new Se;var In="~";var ye=new WeakMap;function Be(t){return ye.get(t)}var Gn=new WeakMap,Ao=0;function te(t){let e=Gn.get(t);return e==null&&(e=String(Ao++),tn(t,e)),e}function tn(t,e){Gn.set(t,e)}var Dn=new WeakMap;function _o(t){return Dn.get(t)}var Ln=new WeakMap;function Po(t){let e=Ln.get(t);if(e!=null)return e;if(!(!(t instanceof Element)||t.tagName.includes("-"))){e={};for(let{name:n,value:r}of t.attributes)e[n]=r;return e}}var Co=new WeakMap;function ko(t){return Co.get(t)}function Hn(t,e,n){let r=Dn.get(t);if(r==null&&(r={},Dn.set(t,r)),r[e]===n)return;r[e]=n;let o=ye.get(t);o?.mutate([[3,te(t),e,n,1]])}function be(t,e,n){let r=Ln.get(t);if(r==null&&(r={},Ln.set(t,r)),r[e]===n)return;n==null?delete r[e]:r[e]=String(n);let o=ye.get(t);o?.mutate([[3,te(t),e,n,2]])}function ze(t,e){if(ye.get(t)!==e&&(ye.set(t,e),t.childNodes))for(let r=0;r<t.childNodes.length;r++)ze(t.childNodes[r],e)}function nn(t){if(ye.get(t)!=null&&(ye.delete(t),t.childNodes))for(let n=0;n<t.childNodes.length;n++)nn(t.childNodes[n])}function je(t){let{nodeType:e}=t;switch(e){case 1:return{id:te(t),type:e,element:t.localName,properties:Mn(_o(t)),attributes:Mn(Po(t)),eventListeners:Mn(ko(t)),children:Array.from(t.childNodes).map(je)};case 3:case 8:return{id:te(t),type:e,data:t.data};default:throw new Error(`Cannot serialize node of type ${t.nodeType} (${typeof t.nodeType})`)}}function Mn(t){return t?{...t}:void 0}function Un(t,e,...n){let r=Gn.get(t),o=ye.get(t);if(r==null||o==null)throw new Error(`Cannot call method ${e} on an unconnected node`);return o.call(r,e,...n)}var Fe=en[D];Fe.insertChild=(t,e,n)=>{let r=Be(t);r!=null&&(ze(e,r),r.mutate([[0,te(t),je(e),n]]))};Fe.removeChild=(t,e,n)=>{let r=Be(t);r!=null&&(nn(e),r.mutate([[1,te(t),n]]))};Fe.setText=(t,e)=>{let n=Be(t);n?.mutate([[2,te(t),e]])};Fe.setAttribute=(t,e,n)=>{t.tagName.includes("-")||be(t,e,n)};Fe.removeAttribute=(t,e)=>{t.tagName.includes("-")||be(t,e)};Se.setGlobal(en);function rn(t){if(typeof t=="string")return{type:"navigate",to:t};let{place:e,record:n,where:r,section:o}=t??{},s={...r===void 0?{}:{where:r},...o===void 0?{}:{section:String(o)}};return typeof e=="string"?{type:"navigate",place:e,...s}:typeof n=="string"?{type:"navigate",to:n,...s}:void 0}var _r=["wheel","drag","pinch"];function Pr(t){let e=t;return typeof t=="object"&&t!==null&&e.graview==="host-hello"&&typeof e.nonce=="string"}function kr(t,e={}){let n,r="",o,s=0,i=new Set,a=new Map,l=[],c=b=>{n?n.postMessage({...b,nonce:r}):l.push(b)},m=b=>{let E=b.data;if(!(!E||typeof E!="object")){if(E.type==="props"){o=E.props;for(let k of i)k(E.props)}else E.type==="answer"?(a.get(E.id)?.(E),a.delete(E.id)):E.type==="event"&&typeof E.listener=="number"?e.onEvent?.(E):E.type==="heartbeat"&&typeof E.beat=="number"&&c({type:"heartbeat",beat:E.beat});e.onMessage?.(E)}},p=()=>{},h=b=>{if(n||!t.fromHost(b)||!Pr(b.data)||b.data.protocol!==1)return;let E=b.ports[0];if(E){n=E,r=b.data.nonce,n.onmessage=m,n.start?.(),p();for(let k of l.splice(0))c(k)}};p=t.listen(h),t.ready({graview:"guest-ready",protocol:1});let g,O={get props(){return o},subscribe(b){return i.add(b),()=>i.delete(b)},act(b,E={}){let k=s+=1;return new Promise(L=>{a.set(k,L),c({type:"act",id:k,name:b,args:E})})},navigate(b){let E=rn(b);E&&c(E)},size(b){c({type:"size",height:b})},autoSize(b){let E=b??globalThis.document?.documentElement,k=globalThis.ResizeObserver;if(!E||!k||typeof E.getBoundingClientRect!="function")return()=>{};g?.disconnect();let L=new k(()=>O.size(Math.ceil(E.getBoundingClientRect().height)));return L.observe(E),g=L,()=>L.disconnect()},close(){g?.disconnect(),p(),n?.close(),i.clear()}};return{guest:O,send:c}}var Mr=["globalThis","Infinity","NaN","undefined","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape","Object","Function","Array","Number","Boolean","String","Symbol","BigInt","Date","Promise","RegExp","Math","JSON","Reflect","Proxy","Intl","Error","AggregateError","EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError","SuppressedError","Map","Set","WeakMap","WeakSet","WeakRef","FinalizationRegistry","Iterator","AsyncIterator","DisposableStack","AsyncDisposableStack","ArrayBuffer","SharedArrayBuffer","DataView","Atomics","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float16Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"],Dr=["window","parent","top","document","customElements","Event","ErrorEvent","PromiseRejectionEvent","ToggleEvent","FocusEvent","ClipboardEvent","CustomEvent","EventTarget","Node","ParentNode","ChildNode","DocumentFragment","Document","CharacterData","Comment","Text","Element","HTMLElement","SVGElement","HTMLTemplateElement","MutationObserver"],Lr=["self","postMessage","setTimeout","clearTimeout","setInterval","clearInterval","queueMicrotask","structuredClone","crypto","console","DOMException"],Gr=["TEMPORARY","PERSISTENT"],ll=Object.freeze([...Mr,...Dr,...Lr,...Gr]),cl=Object.freeze(["constructor","__defineGetter__","__defineSetter__","hasOwnProperty","__lookupGetter__","__lookupSetter__","isPrototypeOf","propertyIsEnumerable","toString","valueOf","__proto__","toLocaleString"]),Ir=t=>typeof t=="symbol"?`[${t.description??"symbol"}]`:t;function Hr(t=globalThis,e=[],n={}){let r=[],o=[],s=new Set([...Mr,...Dr,...Lr,...e,"constructor",Symbol.toStringTag]),i=(T,P)=>{let F=Reflect.getOwnPropertyDescriptor(T,P);return F===void 0||!("value"in F)||F.writable||F.configurable?!1:n.primitivesStay&&typeof P=="symbol"&&(typeof F.value!="object"||F.value===null)&&typeof F.value!="function"?!0:Gr.includes(P)&&typeof F.value=="number"},a=t,l=a.setTimeout,c=a.setInterval,m=a.crypto,p=(T,P)=>function(F,Ye,...dt){if(typeof F!="function")throw new TypeError(`${P} takes a function: a guest view cannot run code from text`);return T.call(t,F,Ye,...dt)},h=m?Object.freeze({getRandomValues:T=>m.getRandomValues(T)}):void 0,g=a.document?.defaultView;if(g&&g!==a)for(let T of Reflect.ownKeys(g))typeof T=="symbol"||s.has(T)||Reflect.deleteProperty(g,T)||o.push(`window.${T}`);let O=[];for(let T=t;T&&T!==Object.prototype;T=Object.getPrototypeOf(T))O.push(T);for(let T of O)for(let P of Reflect.ownKeys(T))s.has(P)||(Reflect.deleteProperty(T,P)?r.push(Ir(P)):i(T,P)||o.push(Ir(P)));let b=()=>function(){throw new EvalError("A guest view cannot make code from text.")},E=[Function.prototype,Object.getPrototypeOf(async function(){}),Object.getPrototypeOf(function*(){}),Object.getPrototypeOf(async function*(){})];for(let T of E){let P=b();Object.defineProperty(P,"prototype",{value:T,writable:!1,enumerable:!1,configurable:!1}),Reflect.defineProperty(T,"constructor",{value:P,writable:!1,enumerable:!1,configurable:!1})||o.push("Function.prototype.constructor"),T===Function.prototype&&Reflect.defineProperty(t,"Function",{value:P,writable:!0,enumerable:!1,configurable:!0})}let k=(T,P)=>{Reflect.defineProperty(t,T,{value:P,writable:!0,enumerable:!0,configurable:!0})||o.push(T)};k("setTimeout",p(l,"setTimeout")),k("setInterval",p(c,"setInterval")),h&&k("crypto",h);for(let T of O.slice(1))Object.freeze(T);for(let T of Reflect.ownKeys(t)){let P=Reflect.getOwnPropertyDescriptor(t,T);Reflect.defineProperty(t,T,"value"in P?{...P,writable:!1,configurable:!1}:{...P,configurable:!1})}let L;try{L=Reflect.preventExtensions(t)}catch{L=!1}return{removed:r,stuck:o,sealed:L}}var ut=class extends HTMLElement{constructor(){super(),tn(this,In)}connect(e){if(Be(this)===e||(ze(this,e),this.childNodes.length===0))return;let n=[];for(let r=0;r<this.childNodes.length;r++){let o=this.childNodes[r];n.push([0,In,je(o),r])}e.mutate(n)}updateRemoteProperty(e,n){Hn(this,e,n)}callRemoteMethod(e,...n){return Un(this,e,...n)}};var d={},on={empty:!0},Io={id:"text",class:"text",title:"text",lang:"text",dir:{oneOf:["ltr","rtl","auto"]},hidden:"text",tabindex:{oneOf:["-1","0"]},role:"text",style:"style",translate:{oneOf:["yes","no"]},spellcheck:{oneOf:["true","false"]},draggable:{oneOf:["true","false"]},inert:"boolean"},Vn={div:d,section:d,article:d,aside:d,header:d,footer:d,nav:d,hgroup:d,search:d,address:d,figure:d,figcaption:d,blockquote:d,p:d,pre:d,hr:on,br:on,wbr:on,h1:d,h2:d,h3:d,h4:d,h5:d,h6:d,span:d,strong:d,em:d,b:d,i:d,u:d,s:d,small:d,mark:d,abbr:d,cite:d,q:d,code:d,kbd:d,samp:d,var:d,sub:d,sup:d,dfn:d,bdi:d,bdo:d,ruby:d,rt:d,rp:d,time:{attributes:{datetime:"text"}},data:{attributes:{value:"text"}},del:{attributes:{datetime:"text"}},ins:{attributes:{datetime:"text"}},a:d,ul:d,menu:d,dl:d,dt:d,dd:d,ol:{attributes:{start:"number",reversed:"boolean",type:{oneOf:["1","a","A","i","I"]}}},li:{attributes:{value:"number"}},table:d,caption:d,thead:d,tbody:d,tfoot:d,tr:d,colgroup:{attributes:{span:"number"}},col:{attributes:{span:"number"},empty:!0},th:{attributes:{colspan:"number",rowspan:"number",headers:"text",scope:{oneOf:["row","col","rowgroup","colgroup"]},abbr:"text"}},td:{attributes:{colspan:"number",rowspan:"number",headers:"text"}},details:{attributes:{open:"boolean",name:"text"}},summary:d,button:{attributes:{type:{oneOf:["button"]},disabled:"boolean",name:"text",value:"text"}},input:{empty:!0,attributes:{type:{oneOf:["text","search","number","range","checkbox","radio","date","time","datetime-local","month","week","color","email","tel","url"]},name:"text",value:"text",placeholder:"text",min:"text",max:"text",step:"text",checked:"boolean",disabled:"boolean",readonly:"boolean",required:"boolean",maxlength:"number",minlength:"number",size:"number",pattern:"text",multiple:"boolean",inputmode:"text",enterkeyhint:"text"}},select:{attributes:{name:"text",disabled:"boolean",multiple:"boolean",required:"boolean",size:"number"}},option:{attributes:{value:"text",selected:"boolean",disabled:"boolean",label:"text"}},optgroup:{attributes:{label:"text",disabled:"boolean"}},textarea:{attributes:{name:"text",placeholder:"text",rows:"number",cols:"number",disabled:"boolean",readonly:"boolean",required:"boolean",maxlength:"number",minlength:"number",wrap:{oneOf:["soft","hard","off"]}}},label:{attributes:{for:"text"}},fieldset:{attributes:{disabled:"boolean",name:"text"}},legend:d,output:d,meter:{attributes:{value:"number",min:"number",max:"number",low:"number",high:"number",optimum:"number"}},progress:{attributes:{value:"number",max:"number"}},img:{empty:!0,attributes:{src:"image",alt:"text",width:"number",height:"number",decoding:{oneOf:["async","sync","auto"]}}},"graview-video":on},Mo=["fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-dasharray","stroke-dashoffset","stroke-opacity","stroke-miterlimit","opacity","color","display","visibility","transform-origin","clip-path","clip-rule","marker-start","marker-mid","marker-end","font-family","font-size","font-weight","font-style","text-anchor","dominant-baseline","alignment-baseline","letter-spacing","text-decoration","paint-order","vector-effect","shape-rendering","pointer-events","stop-color","stop-opacity","overflow","mask"],Do={id:"text",class:"text",style:"style",lang:"text",role:"text",tabindex:{oneOf:["-1","0"]},transform:"geometry",...Object.fromEntries(Mo.map(t=>[t,"css"]))},qe={x:"geometry",y:"geometry",width:"geometry",height:"geometry"},sn={viewBox:"geometry",preserveAspectRatio:"geometry"},Ur={gradientUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},gradientTransform:"geometry",spreadMethod:{oneOf:["pad","reflect","repeat"]},href:"fragment"},Vr={svg:{attributes:{...qe,...sn}},g:d,defs:d,symbol:{attributes:{...qe,...sn,refX:"geometry",refY:"geometry"}},use:{attributes:{...qe,href:"fragment"}},title:d,desc:d,path:{attributes:{d:"geometry",pathLength:"number"}},rect:{attributes:{...qe,rx:"geometry",ry:"geometry",pathLength:"number"}},circle:{attributes:{cx:"geometry",cy:"geometry",r:"geometry",pathLength:"number"}},ellipse:{attributes:{cx:"geometry",cy:"geometry",rx:"geometry",ry:"geometry",pathLength:"number"}},line:{attributes:{x1:"geometry",y1:"geometry",x2:"geometry",y2:"geometry",pathLength:"number"}},polyline:{attributes:{points:"geometry",pathLength:"number"}},polygon:{attributes:{points:"geometry",pathLength:"number"}},text:{attributes:{x:"geometry",y:"geometry",dx:"geometry",dy:"geometry",rotate:"geometry",textLength:"geometry",lengthAdjust:{oneOf:["spacing","spacingAndGlyphs"]}}},tspan:{attributes:{x:"geometry",y:"geometry",dx:"geometry",dy:"geometry",rotate:"geometry",textLength:"geometry"}},textPath:{attributes:{href:"fragment",startOffset:"geometry",method:{oneOf:["align","stretch"]},spacing:{oneOf:["auto","exact"]},side:{oneOf:["left","right"]}}},linearGradient:{attributes:{x1:"geometry",y1:"geometry",x2:"geometry",y2:"geometry",...Ur}},radialGradient:{attributes:{cx:"geometry",cy:"geometry",r:"geometry",fx:"geometry",fy:"geometry",fr:"geometry",...Ur}},stop:{attributes:{offset:"geometry"}},clipPath:{attributes:{clipPathUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]}}},mask:{attributes:{...qe,maskUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},maskContentUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]}}},pattern:{attributes:{...qe,...sn,patternUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},patternContentUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},patternTransform:"geometry",href:"fragment"}},marker:{attributes:{...sn,markerWidth:"geometry",markerHeight:"geometry",refX:"geometry",refY:"geometry",orient:"geometry",markerUnits:{oneOf:["strokeWidth","userSpaceOnUse"]}}}};var Br={section:["aria-label","aria-labelledby","title"]};function Lo(t){return/^aria-[a-z]+$/.test(t)}function Go(t){return/^data-[a-z0-9][a-z0-9_.-]*$/.test(t)}var Ho=new Map(Object.keys(Vr).map(t=>[t.toLowerCase(),t]));function zr(t){return Ho.get(t.toLowerCase())}function jr(t,e,n){let r=n.toLowerCase(),o=t==="html"?[Vn[e]?.attributes,Io]:[Vr[e]?.attributes,Do],s=t==="svg"&&r==="xlink:href"?"href":r;for(let i of o)if(i){for(let[a,l]of Object.entries(i))if(a.toLowerCase()===s)return{name:a,kind:l}}if(Lo(r)||Go(r))return{name:r,kind:"text"}}var Fr="~",an=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),oe=(t,e=0)=>{if(t===null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"||t===void 0)return t;if(!(e>64||typeof t!="object"))return Array.isArray(t)?t.map(n=>oe(n,e+1)):Object.fromEntries(Object.entries(t).map(([n,r])=>[n,oe(r,e+1)]))};function qr(){let t=new Map,e=new Map,n=new Map([[Fr,{children:[],listeners:new Map}]]),r=0,o=c=>{let m=e.get(c);return m===void 0&&(m=r+=1,e.set(c,m),t.set(m,{listener:c,count:0})),t.get(m).count+=1,m},s=c=>{let m=t.get(c);m&&(m.count-=1,!(m.count>0)&&(t.delete(c),e.delete(m.listener)))},i=c=>{let m=n.get(c);if(m){n.delete(c);for(let p of m.listeners.values())s(p);for(let p of m.children)i(p)}},a=(c,m,p=0)=>{if(!an(c)||p>64)return oe(c);let h=typeof c.id=="string"?c.id:void 0,g=m&&h!==void 0&&h!==Fr;g&&i(h);let O={children:[],listeners:new Map};g&&n.set(h,O);let b={};for(let[E,k]of Object.entries(c))E==="children"&&Array.isArray(k)?b[E]=k.map(L=>{let T=a(L,g,p+1);return g&&an(L)&&typeof L.id=="string"&&O.children.push(L.id),T}):E==="eventListeners"&&an(k)?b[E]=Object.fromEntries(Object.entries(k).map(([L,T])=>{if(typeof T!="function"||!g)return[L,void 0];let P=o(T);return O.listeners.set(L,P),[L,{listener:P}]})):b[E]=oe(k,p+1);return b},l=c=>{if(!Array.isArray(c))return oe(c);let[m,p]=c,h=typeof p=="string"?n.get(p):void 0;if(m===0){let g=a(c[2],h!==void 0),O=an(c[2])?c[2].id:void 0;if(h&&typeof O=="string"&&n.has(O)){let b=Number(c[3]);h.children.splice(Number.isInteger(b)&&b>=0&&b<=h.children.length?b:h.children.length,0,O)}return[m,oe(p),g,oe(c[3])]}if(m===1){let g=Number(c[2]);return h&&Number.isInteger(g)&&g>=0&&g<h.children.length&&i(h.children.splice(g,1)[0]),oe(c)}if(m===3&&c[4]===3){let g=String(c[2]),O=c[3],b=h&&typeof O=="function"?o(O):void 0,E=h?.listeners.get(g);return E!==void 0&&s(E),b===void 0?h?.listeners.delete(g):h.listeners.set(g,b),[m,oe(p),g,b===void 0?void 0:{listener:b},3]}return oe(c)};return{encode:c=>c.map(l),listener:c=>t.get(c)?.listener,get listening(){return t.size},get nodes(){return n.size-1}}}var ln="graview-view-root",Uo=["value","checked","key","pressed","files","refused","x","y","width","height","deltaX","deltaY","deltaMode","ctrlKey","metaKey","phase","pointerId","button","pressure","dx","dy","scale","rotation"],Vo=t=>t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/\'/g,"'"),Bo=t=>Object.freeze({html:t,toString:()=>t}),Yr=t=>typeof t=="object"&&t!==null&&typeof t.html=="string"&&Object.isFrozen(t),Wr=t=>t==null||t===!1?"":Array.isArray(t)?t.map(Wr).join(""):Yr(t)?t.html:Vo(String(t));function Xr(t){customElements.get(ln)||customElements.define(ln,ut);let e=Event,n=qr(),r=new Set,o=new Set,s,i=[],a=new Set;for(let u of["closest","matches","dataset"]){let y=()=>{throw new TypeError(`A view\'s element has no ${u}: graview.on hands event.element, the element its selector matched; read event.element.getAttribute("data-\\u2026").`)};u in Element.prototype||Object.defineProperty(Element.prototype,u,u==="dataset"?{get:y}:{value:y})}let l=document.createElement(ln),c=u=>{let y=N=>{for(let w of Array.from(N.childNodes)){if(w.nodeType!==1)continue;if(te(w)===u)return w;let x=y(w);if(x)return x}};return y(l)},m=u=>{let y=c(u.target);if(!y)return;let N=new e(u.event,{bubbles:!0}),w={};for(let x of Uo)u[x]!==void 0&&(w[x]=u[x]);for(let x of Object.keys(w))Object.defineProperty(N,x,{value:w[x],enumerable:!0});y.dispatchEvent(N);for(let x of o){if(x.type!==u.event)continue;let _;try{_=new Set(Array.from(l.querySelectorAll(x.selector)))}catch{continue}for(let z=y;z&&z!==l;z=z.parentNode)if(_.has(z)){x.listener(Object.freeze({type:u.event,target:y,element:z,...w}));break}}},p=u=>{if(u.type==="dom-event"&&typeof u.target=="string")return m(u);if(u.type==="notice")return t.warn(u.text);if(u.type!=="props")return;s=u.props;let y=t.now();for(let x of r)try{x(u.props)}catch(_){t.threw(_)}let N=t.now()-y,w=u.push;typeof w=="number"&&t.microtask(()=>t.microtask(()=>t.send({type:"pushed",push:w,ms:N})))},h;l.connect({mutate(u){h||(h=[],t.microtask(()=>{let y=h??[];h=void 0,t.send({type:"render",records:n.encode(y)})})),h.push(...u)},call:()=>{}});let g=u=>u.nodeType===1?u.getAttribute("data-key")??u.getAttribute("id"):null,O=(u,y)=>u.nodeType===y.nodeType&&(u.nodeType!==1||u.localName===y.localName&&u.namespaceURI===y.namespaceURI&&g(u)===g(y));function b(u,y){let N=Array.from(y.childNodes),w=0;for(let x of N){let _=u.childNodes[w]??null;if(_&&O(_,x)){E(_,x),w+=1;continue}if(g(x)!==null){let ce=Array.from(u.childNodes).slice(w+1).find(We=>O(We,x));if(ce){u.insertBefore(ce,_),E(ce,x),w+=1;continue}}u.insertBefore(x,_),w+=1}for(;u.childNodes.length>w;)u.removeChild(u.lastChild)}function E(u,y){if(u.nodeType!==1){u.data!==y.data&&(u.data=y.data);return}let N=u,w=y,x=k(N);for(let _ of N.getAttributeNames())w.hasAttribute(_)||(N.removeAttribute(_),x&&be(N,_,void 0));for(let _ of w.getAttributeNames()){let z=w.getAttribute(_);N.getAttribute(_)!==z&&N.setAttribute(_,z),x&&be(N,_,z)}b(N,w)}let k=u=>u.localName.includes("-");function L(u){for(let y of Array.from(u.childNodes)){if(y.nodeType!==1)continue;let N=y;if(k(N))for(let w of N.getAttributeNames())be(N,w,N.getAttribute(w)??void 0);L(N)}}function T(u,y,N){for(let w of Array.from(u.childNodes)){if(w.nodeType!==1)continue;let x=w,_=x.localName,z=y||_.toLowerCase()==="svg",ce=z?zr(_):Object.prototype.hasOwnProperty.call(Vn,_.toLowerCase())?_.toLowerCase():void 0;if(!ce){N.add(`<${_}>`);continue}for(let We of x.getAttributeNames())(!jr(z?"svg":"html",ce,We)||!z&&Br[ce]?.includes(We.toLowerCase()))&&N.add(`${ce} ${We}`);T(x,z,N)}}function P(u){let y=document.createElement("div"),N=Array.isArray(u)?u:[u];for(let x of N)if(x!=null)if(typeof x=="string"||Yr(x)){let _=document.createElement("div");_.innerHTML=typeof x=="string"?x:x.html,y.append(...Array.from(_.childNodes))}else y.append(x);let w=new Set;T(y,!1,w),i=[...w],i.length>0&&t.warn(`The host will not draw: ${i.join(", ")}`),L(y),b(l,y)}let F,Ye=new Set(_r),dt="[]",cn=!1,Fn=()=>{cn||(cn=!0,t.microtask(()=>{cn=!1;let u=[...new Map([...o].filter(N=>Ye.has(N.type)).map(N=>[`${N.type} ${N.selector}`,{event:N.type,selector:N.selector}])).entries()].sort(([N],[w])=>N<w?-1:N>w?1:0).map(([,N])=>N),y=JSON.stringify(u);y!==dt&&(dt=y,t.send({type:"gestures",bound:u}))}))};return{view:Object.freeze({get props(){return s},onProps(u){return r.add(u),s&&u(s),()=>void r.delete(u)},render:P,style(u){typeof u!="string"||u===F||(F=u,t.send({type:"style",css:u}))},on(u,y,N){let w={type:u,selector:y,listener:N};return o.add(w),typeof u=="string"&&!a.has(u)&&(a.add(u),t.send({type:"hears",events:[u]})),Ye.has(u)&&Fn(),()=>{o.delete(w),Ye.has(u)&&Fn()}},act:(u,y={})=>t.act(u,y),navigate(u){if(typeof u=="string")return t.navigate(u);let y=rn(u);y&&t.send(y)},html(u,...y){return Bo(u.reduce((N,w,x)=>N+w+(x<y.length?Wr(y[x]):""),""))},get refused(){return i},get hardening(){return t.hardening()}}),hear:p}}var jn={removed:[],stuck:[],sealed:!1,worker:!1},Bn=kr({listen(t){return Re.listen(t),()=>Re.unlisten(t)},fromHost:()=>!0,ready:t=>Re.post(t)},{onMessage:t=>$r.hear(t)}),$r=Xr({send:t=>Bn.send(t),act:(t,e)=>Bn.guest.act(t,e),navigate:t=>Bn.guest.navigate(t),microtask:Re.microtask,now:Re.now,threw:t=>console.error(t),warn:t=>console.warn(t),hardening:()=>jn}),zo=$r.view;Object.defineProperty(globalThis,"graview",{value:zo,enumerable:!0,configurable:!0,writable:!1});var zn="WorkerGlobalScope"in globalThis?Hr(globalThis,["graview"]):jn;jn=zn;if(zn.stuck.length>0)throw new Error(`The view\'s worker could not be hardened: ${zn.stuck.join(", ")} would not go.`);})();\n';export{e as VIEW_RUNTIME};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as j,b as H}from"./chunk.7JVBVB4A.js";import{a as z,b as J,c as D}from"./chunk.IQ3LUSD6.js";import{a as K,e as q}from"./chunk.F4DWRBO7.js";import{e as E,f as N,g as $}from"./chunk.RVQYXPCM.js";import"./chunk.EJOTTZWZ.js";import{$ as b,G as B,M as F,O as P,R as A,ga as v,ja as V,ka as T,wa as G}from"./chunk.4JWT6LIS.js";import"./chunk.SDO3U72B.js";import"./chunk.AW2T3KFV.js";import"./chunk.2AZTW66C.js";import{b as W}from"./chunk.AJZBJBMO.js";var s=W(B(),1);var i=W(A(),1),_=e=>({...e.node?{node:{id:e.node.id}}:{},...e.nodes?{nodes:e.nodes.map(t=>({id:t.id}))}:{},...e.label!==void 0?{label:e.label}:{},fidelity:e.fidelity,cardinality:e.cardinality,mode:e.mode,selected:e.selected,...e.implicated?{implicated:e.implicated}:{},...e.flagged?{flagged:e.flagged}:{}});function I(e){let t=P(),r=t?.past?.seq,a=t?.host?.viewAt,n=(0,s.useMemo)(()=>r===void 0||!a||e.draft?void 0:a(e.manifest.name,r),[a,r,e]);return(0,s.useMemo)(()=>n===null?null:n===void 0?e:{...e,worker:n},[n,e])}function M({definition:e,store:t,principal:r,input:a,goTo:n,places:o,scheme:l,brand:u,onFailure:d,drawsItsOwn:m,tick:f}){let p=(0,s.useRef)(null),w=(0,s.useRef)(null),y=F(),c=(0,s.useRef)({input:a,goTo:n,places:o,onFailure:d,brand:u,hostFiles:y});c.current={input:a,goTo:n,places:o,onFailure:d,brand:u,hostFiles:y},(0,s.useEffect)(()=>{let S=p.current;if(!S)return;let C=e.file??(c.current.hostFiles?.src?g=>c.current.hostFiles?.src?.(g)??g:void 0);typeof e.worker=="function"&&D(e.worker).catch(()=>{});let L=H(j,({mountWorkerView:g})=>{w.current=g(S,{manifest:e.manifest,worker:e.worker,store:t,principal:r,input:()=>c.current.input?.()??{},goTo:()=>c.current.goTo,places:()=>c.current.places?.()??[],brand:()=>c.current.brand,onFailure:(O,R)=>c.current.onFailure(O,R),...m?{fallback:!1}:{},...e.limits?{limits:e.limits}:{},...e.author?{author:e.author}:{},...e.onProblem?{onProblem:e.onProblem}:{},...e.asset?{asset:e.asset}:{},...C?{file:C}:{},...e.images?{images:e.images}:{},files:()=>c.current.hostFiles})});return()=>{L(),w.current?.dispose(),w.current=null}},[e,t,r]),(0,s.useEffect)(()=>w.current?.update(),[l,u,f]);let k=(0,i.jsx)("div",{ref:p,"data-worker-view-place":e.manifest.name});if(!e.draft)return k;let h=e.manifest.title??e.manifest.name;return(0,i.jsxs)("div",{role:"group","aria-label":`Draft: ${h}`,"data-graview-draft-view":e.manifest.name,style:{display:"grid",gap:8,alignContent:"start",minWidth:0},children:[(0,i.jsxs)("p",{"data-testid":"draft-view-line",style:Q,children:[(0,i.jsxs)("span",{children:["Draft \u2014 ",(0,i.jsx)("span",{style:{color:"var(--graview-ink)",fontWeight:600},children:h})]}),(0,i.jsx)("span",{"aria-hidden":"true",children:"\xB7"}),(0,i.jsx)("span",{children:"Not kept"})]}),k]})}var Q={margin:0,display:"flex",flexWrap:"wrap",alignItems:"baseline",gap:"4px 8px",fontSize:"0.875rem",color:"var(--graview-ink-muted)",borderBottom:"1px solid var(--graview-edge)",paddingBottom:8};function x(e,t={}){let r=t.fallback,a=e.manifest.replaces==="page";function n(o){let l=b(),u=v(),d=(0,s.useContext)(G),[m,f]=(0,s.useState)(null),p=(0,s.useRef)(o);p.current=o;let w=I(e);if(!l)return null;if(w===null)return r&&!(d&&V(r)&&!a)?(0,i.jsx)(r,{...o}):null;if(m&&r)return d&&V(r)&&!a?null:(0,i.jsx)(r,{...o});let y=t.beside&&!(d&&V(t.beside))?t.beside:void 0,c=(0,i.jsx)(M,{definition:w,store:l.store,principal:l.principal,input:()=>_(p.current),goTo:u,places:()=>l.views.places(),scheme:l.scheme,brand:l.brand,tick:o,drawsItsOwn:r!==void 0,onFailure:(k,h)=>{f(k),e.onFailure?.(k,h)}});return y?(0,i.jsxs)("div",{"data-worker-view-beside":e.manifest.name,style:{display:"grid",gap:12,minWidth:0},children:[c,(0,i.jsx)(y,{...o})]}):c}return n.displayName=`WorkerView(${e.manifest.name})`,n}function U(e,t){let{manifest:r}=t;if(r.attach==="home"){if(!e.home)throw new Error(`The worker view "${r.name}" is the home's body: draw it with workerHome, on the home.`);let d=t.draft?void 0:e.homeView?.();return e.home(x(t,d?{fallback:d}:{})),e}let a={cardinality:r.cardinality,fidelity:"full"},n=e.lookup(r.attach,a)??e.resolve(r.attach,a)?.view,o=r.cardinality==="one",l=t.draft===!0,u=x(t,{...n&&!l?{fallback:n}:{},...o&&r.replaces!=="page"&&n?{beside:n}:{}});return e.register(r.attach,a,o&&r.replaces==="page"?T(u):u,r.title?{title:r.title,...l?{}:{name:r.name},lens:"view",...r.reads?.kinds?.length?{reads:r.reads.kinds}:{}}:void 0),e}function X(e,t={}){let r=t.fallback;function a({context:n}){let o=b(),l=v(),[u,d]=(0,s.useState)(null),m=I(e);return(u||m===null)&&r?(0,i.jsx)(r,{context:n}):m===null?null:(0,i.jsx)(M,{definition:m,store:n.store,principal:n.principal??o?.principal??{kind:"human"},goTo:l,...o?{places:()=>o.views.places(),scheme:o.scheme,brand:o.brand}:{},drawsItsOwn:r!==void 0,onFailure:(f,p)=>{d(f),e.onFailure?.(f,p)}})}return a.displayName=`WorkerHome(${e.manifest.name})`,a}export{N as checkManifest,z as checkViewSource,q as judgeCodeAct,E as manifestActs,U as registerWorkerView,K as sightIsTotal,J as viewScript,X as workerHome,x as workerView,$ as workerViewProps};
|