graview 0.1.67 → 0.1.68
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.YCD4JSXD.js → chunk.2BMZPALF.js} +1 -1
- package/dist/preview/{chunk.SNHKYH72.js → chunk.2KCDLCB2.js} +1 -1
- package/dist/preview/{chunk.O2OL6RQQ.js → chunk.2ME4DVBI.js} +1 -1
- package/dist/preview/chunk.2TUEBU7X.js +8 -0
- package/dist/preview/{chunk.LYEGRY77.js → chunk.2U6HB4XU.js} +1 -1
- package/dist/preview/{chunk.7S6ZRMW4.js → chunk.32JE2WS7.js} +1 -1
- package/dist/preview/{chunk.RG5G6YQD.js → chunk.3DEWQDP7.js} +1 -1
- package/dist/preview/{chunk.GVT4UUQA.js → chunk.3JMQKANL.js} +1 -1
- package/dist/preview/{chunk.A5PSEU3W.js → chunk.3VEZ5MOC.js} +1 -1
- package/dist/preview/chunk.3WPCS6KP.js +1 -0
- package/dist/preview/{chunk.5R744JGZ.js → chunk.42C3FIKK.js} +1 -1
- package/dist/preview/{chunk.IAEGJDF3.js → chunk.42KHFGN6.js} +1 -1
- package/dist/preview/{chunk.DZMIYEHQ.js → chunk.4DXPPM6T.js} +1 -1
- package/dist/preview/chunk.4GVKKBQL.js +1 -0
- package/dist/preview/{chunk.KX5ZBHMA.js → chunk.4TT3ZHSJ.js} +1 -1
- package/dist/preview/{chunk.QXLJGHMC.js → chunk.4YAO3A5Q.js} +3 -3
- package/dist/preview/{chunk.Z4TY44CD.js → chunk.5JKUT2OM.js} +1 -1
- package/dist/preview/chunk.5L4ADKTW.js +1 -0
- package/dist/preview/{chunk.BKYZSV2Y.js → chunk.64LCHHZB.js} +1 -1
- package/dist/preview/{chunk.ZEZUKRC6.js → chunk.6AANHELP.js} +1 -1
- package/dist/preview/{chunk.ZAQ4IDX6.js → chunk.6DMCEBSO.js} +1 -1
- package/dist/preview/{chunk.NKLPL7QD.js → chunk.6IR5LBJU.js} +1 -1
- package/dist/preview/{chunk.X226YATK.js → chunk.6WB2TYK7.js} +1 -1
- package/dist/preview/chunk.6ZENHSTQ.js +1 -0
- package/dist/preview/{chunk.EJ2EZL2G.js → chunk.7K2V5FUB.js} +1 -1
- package/dist/preview/chunk.7OL6H4LF.js +1 -0
- package/dist/preview/{chunk.4W57E7AX.js → chunk.7TDML5YU.js} +1 -1
- package/dist/preview/{chunk.AJMVRFYX.js → chunk.7WPVLEX2.js} +2 -2
- package/dist/preview/{chunk.XSWSBTUO.js → chunk.7ZTGB4O7.js} +1 -1
- package/dist/preview/{chunk.FRQSLWP4.js → chunk.ACNOP2IU.js} +1 -1
- package/dist/preview/{chunk.N4ZKZ4GM.js → chunk.AENP662H.js} +1 -1
- package/dist/preview/{chunk.SFBHPYRD.js → chunk.AQ2PI6MR.js} +1 -1
- package/dist/preview/chunk.ARS4HJD2.js +1 -0
- package/dist/preview/{chunk.STPA7HBK.js → chunk.AWV57UBJ.js} +1 -1
- package/dist/preview/{chunk.D7NWMXSX.js → chunk.AYZL3LCR.js} +3 -3
- package/dist/preview/{chunk.URQTF5SY.js → chunk.BHJRT57H.js} +1 -1
- package/dist/preview/{chunk.7UHPHEH5.js → chunk.BPNW5KCP.js} +1 -1
- package/dist/preview/{chunk.TTSGCNPT.js → chunk.BQAFFEOA.js} +1 -1
- package/dist/preview/chunk.C2QKA6XY.js +1 -0
- package/dist/preview/{chunk.6KJGRM7A.js → chunk.CE3NKAF7.js} +1 -1
- package/dist/preview/{chunk.QRQ5WPZI.js → chunk.CFE3MHWZ.js} +1 -1
- package/dist/preview/{chunk.H6KIEDZN.js → chunk.CGBOPPNL.js} +1 -1
- package/dist/preview/{chunk.LP2ZMAT2.js → chunk.CNN32262.js} +1 -1
- package/dist/preview/{chunk.HJUZMOW2.js → chunk.DCLF4WWZ.js} +1 -1
- package/dist/preview/{chunk.GMLONS5L.js → chunk.DGDW54KE.js} +1 -1
- package/dist/preview/{chunk.3GNT5MKP.js → chunk.DLSS56EU.js} +1 -1
- package/dist/preview/{chunk.QAM76AXV.js → chunk.DMZRFXH7.js} +1 -1
- package/dist/preview/{chunk.Z2XUVJAL.js → chunk.DPHH5ZVL.js} +1 -1
- package/dist/preview/{chunk.Z27NSSYL.js → chunk.DZ6UDZOB.js} +2 -2
- package/dist/preview/{chunk.6W6XMLSF.js → chunk.E423JCOS.js} +1 -1
- package/dist/preview/{chunk.35KMZHB7.js → chunk.EB7PZJEO.js} +1 -1
- package/dist/preview/{chunk.V7H4BUEB.js → chunk.ECNGVD25.js} +1 -1
- package/dist/preview/{chunk.B7KZBT27.js → chunk.EGSOHTZZ.js} +1 -1
- package/dist/preview/{chunk.OCXY5DCD.js → chunk.EGVM24ND.js} +1 -1
- package/dist/preview/{chunk.UDHPMVC4.js → chunk.ENLIIZF2.js} +1 -1
- package/dist/preview/{chunk.H3EGBDW2.js → chunk.EP5JS7ZH.js} +1 -1
- package/dist/preview/{chunk.TI5FR2QQ.js → chunk.F5GNNVSQ.js} +1 -1
- package/dist/preview/chunk.FHQ25SWY.js +1 -0
- package/dist/preview/{chunk.F464JKHZ.js → chunk.FSW535EA.js} +1 -1
- package/dist/preview/{chunk.G5GVT6JY.js → chunk.FZELUSK5.js} +1 -1
- package/dist/preview/{chunk.UWS4RMM3.js → chunk.G2BDEWJC.js} +1 -1
- package/dist/preview/chunk.GF3ZCX46.js +2 -0
- package/dist/preview/{chunk.UW52CMGJ.js → chunk.GJTEV6CK.js} +1 -1
- package/dist/preview/{chunk.A7GVTE5Y.js → chunk.GKTQ5CZA.js} +2 -2
- package/dist/preview/{chunk.ZG5VGP5U.js → chunk.GONZB3J3.js} +1 -1
- package/dist/preview/{chunk.FLJXYESX.js → chunk.GRBWXTST.js} +1 -1
- package/dist/preview/{chunk.Z3O2VZAJ.js → chunk.GRTBEA7O.js} +1 -1
- package/dist/preview/{chunk.QNP5OR3P.js → chunk.H3IGXHZR.js} +2 -2
- package/dist/preview/{chunk.ILJDLBPJ.js → chunk.H3W5C3XQ.js} +1 -1
- package/dist/preview/{chunk.O5VFKVZS.js → chunk.H4VNIAHN.js} +1 -1
- package/dist/preview/{chunk.7ARRVNUR.js → chunk.HH4D3JEI.js} +1 -1
- package/dist/preview/{chunk.MUSMNKE4.js → chunk.HWFJQ42Y.js} +1 -1
- package/dist/preview/{chunk.37RFCHSS.js → chunk.HXTKBISQ.js} +1 -1
- package/dist/preview/{chunk.J2OPIS3H.js → chunk.I34BWUB4.js} +1 -1
- package/dist/preview/{chunk.ZAPS4J6G.js → chunk.I63462I3.js} +1 -1
- package/dist/preview/{chunk.6UQFV53C.js → chunk.IKKKHHRN.js} +1 -1
- package/dist/preview/{chunk.GRFD42WM.js → chunk.IPGLITWA.js} +1 -1
- package/dist/preview/{chunk.3NSV3WKM.js → chunk.IT5DVKXY.js} +2 -2
- package/dist/preview/{chunk.JQ2WNKDW.js → chunk.IXMIU4D4.js} +1 -1
- package/dist/preview/{chunk.JVB5KDSG.js → chunk.JCETQQ7J.js} +1 -1
- package/dist/preview/{chunk.M7KXQGQL.js → chunk.JGRSUTPJ.js} +1 -1
- package/dist/preview/{chunk.KFT7JIEH.js → chunk.JLDJZET2.js} +1 -1
- package/dist/preview/{chunk.JQ63N4MZ.js → chunk.JULD4XFB.js} +1 -1
- package/dist/preview/{chunk.LVOTLGJB.js → chunk.JV432T4Q.js} +1 -1
- package/dist/preview/{chunk.6SJEZWH3.js → chunk.KAM73WVF.js} +1 -1
- package/dist/preview/{chunk.AKJS2NUM.js → chunk.KUCBNMIY.js} +1 -1
- package/dist/preview/{chunk.DWM7AR5Y.js → chunk.L7XKYGV7.js} +1 -1
- package/dist/preview/{chunk.EP6Q32WT.js → chunk.LFFJB6D3.js} +1 -1
- package/dist/preview/{chunk.264PB572.js → chunk.LMTG5NPG.js} +1 -1
- package/dist/preview/{chunk.EGPCVMDU.js → chunk.LOKGUALC.js} +1 -1
- package/dist/preview/{chunk.FPHRAO3R.js → chunk.LZ6MSQ5O.js} +1 -1
- package/dist/preview/chunk.MBTEOF4R.js +1 -0
- package/dist/preview/{chunk.RJY7VJBH.js → chunk.MIOLBZBS.js} +1 -1
- package/dist/preview/{chunk.G3GFDVO2.js → chunk.MK5RPEB2.js} +1 -1
- package/dist/preview/{chunk.NSOPYIT4.js → chunk.MKL4THIV.js} +1 -1
- package/dist/preview/{chunk.FVQKSN33.js → chunk.MPWLDQOG.js} +1 -1
- package/dist/preview/chunk.MSUZAJ2K.js +4 -0
- package/dist/preview/{chunk.MSAYU25L.js → chunk.N5Z34V7U.js} +1 -1
- package/dist/preview/chunk.N64RVSH3.js +1 -0
- package/dist/preview/{chunk.HAOB6O72.js → chunk.ND3DEDWB.js} +1 -1
- package/dist/preview/{chunk.GFLH7RCI.js → chunk.NFTPJAMJ.js} +1 -1
- package/dist/preview/{chunk.QZQCQWQG.js → chunk.NRCWMYLH.js} +1 -1
- package/dist/preview/{chunk.47XEJZ3O.js → chunk.O2VXTYUJ.js} +1 -1
- package/dist/preview/{chunk.6N4PE3U5.js → chunk.O32F6LGK.js} +1 -1
- package/dist/preview/{chunk.PZ7KY6XH.js → chunk.O5FTWXA2.js} +1 -1
- package/dist/preview/{chunk.T2OUHRAA.js → chunk.ODYJEDIW.js} +1 -1
- package/dist/preview/{chunk.DKEIEH2D.js → chunk.OQ4ZO3YY.js} +1 -1
- package/dist/preview/chunk.PI4RFOBU.js +1 -0
- package/dist/preview/{chunk.E5PYNAYT.js → chunk.PIMAG4WT.js} +2 -2
- package/dist/preview/{chunk.EFVSZKB5.js → chunk.PLIV3IQK.js} +1 -1
- package/dist/preview/{chunk.77C556NM.js → chunk.PPCDPYYU.js} +1 -1
- package/dist/preview/{chunk.MW7R5G3C.js → chunk.PZQ5P6WK.js} +1 -1
- package/dist/preview/chunk.Q42R2KW4.js +1 -0
- package/dist/preview/{chunk.WEMUKZKH.js → chunk.Q4VFLLUT.js} +1 -1
- package/dist/preview/{chunk.SY5ID44D.js → chunk.Q6H5HESF.js} +1 -1
- package/dist/preview/chunk.QM54TGU6.js +3 -0
- package/dist/preview/{chunk.HN4ZJ4B4.js → chunk.QOQ26NXM.js} +1 -1
- package/dist/preview/{chunk.SJQPTDAT.js → chunk.QUETLFBJ.js} +1 -1
- package/dist/preview/{chunk.P2EKKKK2.js → chunk.QWLK3GKG.js} +1 -1
- package/dist/preview/{chunk.JEC5FDKX.js → chunk.QYPU444Y.js} +1 -1
- package/dist/preview/{chunk.TXZQEJ5T.js → chunk.QZP3ARLH.js} +1 -1
- package/dist/preview/{chunk.WALVW3KJ.js → chunk.R3GE37OI.js} +1 -1
- package/dist/preview/chunk.R66ZVMWB.js +1 -0
- package/dist/preview/{chunk.YZPESGCP.js → chunk.RQG672MJ.js} +1 -1
- package/dist/preview/chunk.RYA7A4NA.js +1 -0
- package/dist/preview/{chunk.LRNFE3UK.js → chunk.SADR3MQI.js} +1 -1
- package/dist/preview/{chunk.MJY4SLWA.js → chunk.SS6KL5NT.js} +1 -1
- package/dist/preview/chunk.SUG6LIOX.js +1 -0
- package/dist/preview/{chunk.SO6NT5K7.js → chunk.TFJA4QV4.js} +1 -1
- package/dist/preview/{chunk.D4WJ7OM5.js → chunk.TOUSIUJF.js} +1 -1
- package/dist/preview/{chunk.ARWO4WOV.js → chunk.TR4YFVZN.js} +1 -1
- package/dist/preview/{chunk.XFLGSUYO.js → chunk.TRNJKHIA.js} +1 -1
- package/dist/preview/{chunk.5AKZROMR.js → chunk.TVWK3SGD.js} +1 -1
- package/dist/preview/chunk.U7PAFLUM.js +1 -0
- package/dist/preview/{chunk.NKYWIGC7.js → chunk.UAMPR4MD.js} +1 -1
- package/dist/preview/{chunk.UGQYMN4J.js → chunk.UD7VLXPM.js} +1 -1
- package/dist/preview/{chunk.UQIPEMJ5.js → chunk.UFURYU4R.js} +1 -1
- package/dist/preview/{chunk.R6JBA7UK.js → chunk.UODTUBQ7.js} +1 -1
- package/dist/preview/{chunk.NRURQGXV.js → chunk.VES4XMZX.js} +1 -1
- package/dist/preview/{chunk.QWGWOEBZ.js → chunk.VLXLBGMY.js} +1 -1
- package/dist/preview/{chunk.IDALEKIW.js → chunk.VTDOWXCP.js} +1 -1
- package/dist/preview/{chunk.4EMKCKDB.js → chunk.VV5JAM5W.js} +1 -1
- package/dist/preview/{chunk.JU6UFWS3.js → chunk.VW632VNJ.js} +1 -1
- package/dist/preview/{chunk.25QFDTCU.js → chunk.WC5WE34A.js} +1 -1
- package/dist/preview/chunk.WN7SAAH6.js +1 -0
- package/dist/preview/{chunk.4UUJHLHR.js → chunk.WV45KLXC.js} +1 -1
- package/dist/preview/{chunk.NAXOXBOF.js → chunk.XDZDNZ7B.js} +1 -1
- package/dist/preview/{chunk.MAKCZ6B6.js → chunk.XFH6GHBQ.js} +1 -1
- package/dist/preview/{chunk.2VUX54XH.js → chunk.XRE7SHLD.js} +1 -1
- package/dist/preview/{chunk.J6HF7IRQ.js → chunk.XXCHO2A5.js} +1 -1
- package/dist/preview/{chunk.A4EZAGG7.js → chunk.Y7OGJOPA.js} +1 -1
- package/dist/preview/{chunk.6NG76MDA.js → chunk.YBQ5GVAX.js} +2 -2
- package/dist/preview/{chunk.QF5QB5YR.js → chunk.YL2RBZFE.js} +1 -1
- package/dist/preview/{chunk.RSQ432QN.js → chunk.YM6SWEUI.js} +1 -1
- package/dist/preview/{chunk.7BJRHPE3.js → chunk.Z2X7BFCB.js} +2 -2
- package/dist/preview/{chunk.VBLQJVQ5.js → chunk.Z67LBSQO.js} +1 -1
- package/dist/preview/{chunk.OHAO6KKH.js → chunk.ZKXIZBCN.js} +1 -1
- package/dist/preview/{chunk.BDNQMKDG.js → chunk.ZLEBOR5T.js} +1 -1
- package/dist/preview/{chunk.CKDCTFLU.js → chunk.ZLNUZ6LR.js} +1 -1
- package/dist/preview/chunk.ZMADWPJO.js +1 -0
- package/dist/preview/chunk.ZO6VMEPP.js +1 -0
- package/dist/preview/chunk.ZUG7U7AT.js +1 -0
- package/dist/preview/index.html +55 -55
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.2FHIINXG.js +0 -2
- package/dist/preview/chunk.3ENPWZBG.js +0 -1
- package/dist/preview/chunk.3ZODN6BW.js +0 -1
- package/dist/preview/chunk.55G4IPOO.js +0 -1
- package/dist/preview/chunk.5J6DVR7S.js +0 -1
- package/dist/preview/chunk.7WHQWLL6.js +0 -1
- package/dist/preview/chunk.B5SJMCTT.js +0 -7
- package/dist/preview/chunk.CTUJZ3IV.js +0 -1
- package/dist/preview/chunk.CY7FFKEZ.js +0 -1
- package/dist/preview/chunk.DEKRFTRN.js +0 -4
- package/dist/preview/chunk.EBKH3ILT.js +0 -1
- package/dist/preview/chunk.FOUBDGL3.js +0 -1
- package/dist/preview/chunk.HB5NWHFP.js +0 -3
- package/dist/preview/chunk.HVBKI5ZO.js +0 -1
- package/dist/preview/chunk.I3SDKMQS.js +0 -1
- package/dist/preview/chunk.J5OLYVZ4.js +0 -1
- package/dist/preview/chunk.JKFVNQY7.js +0 -1
- package/dist/preview/chunk.KGMSSXZL.js +0 -1
- package/dist/preview/chunk.NXZL5CA2.js +0 -1
- package/dist/preview/chunk.PSNMZBVS.js +0 -1
- package/dist/preview/chunk.R7CRBRD4.js +0 -1
- package/dist/preview/chunk.RR25BGWP.js +0 -1
- package/dist/preview/chunk.T27QKVKP.js +0 -1
- package/dist/preview/chunk.T3WCRS6M.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as _}from"./chunk.6KJGRM7A.js";import{a as se,b as le,c as ue,d as fe,e as L,f as I,g as ye}from"./chunk.WALVW3KJ.js";import{a as me}from"./chunk.SNHKYH72.js";import{c as T,e as de,f as pe}from"./chunk.UGQYMN4J.js";import{a as j,b as re,c as te,d as oe,f as G,m as ae,n as b,o as V,p as B,q as v,r as ie}from"./chunk.RG5G6YQD.js";import{a as x,c as ce,d as ge,f as he,h as be,i as we,j as Se}from"./chunk.JQ63N4MZ.js";import{$b as ee,Aa as A,Ba as q,C as P,Ca as O,Da as M,L as K,La as Q,W as z,Z as F,ac as ne,bc as C,da as J,ha as X,la as Z,ra as N,ua as Y,za as E}from"./chunk.ZEZUKRC6.js";var Re=e=>e.caption?.trim()||e.name,D=e=>A(e)?`${Re(e)}, ${q(e)}`:Re(e);function dn(e){let n=Math.max(0,Math.round(e)),t=a=>String(a).padStart(2,"0"),r=Math.floor(n/3600),o=Math.floor(n%3600/60);return r>0?`${r}:${t(o)}:${t(n%60)}`:`${o}:${t(n%60)}`}function Ne(e){let n=e?.fields?.shape??{};return Object.keys(n).filter(t=>{let r=P(n[t]);for(;r?.innerType;)r=P(r.innerType);return M(n[t])!==void 0||r?.type==="array"&&M(r.element)!==void 0})}function sn(e,n){for(let t of Ne(n)){let r=O(e[t]).find(o=>E(o)||A(o));if(r)return r}}var k=e=>{try{return e()}catch{return null}},Ee=e=>typeof e=="string"&&se.includes(e);function Me(e){if(e!==void 0)return Ee(e)?e:e&&typeof e=="object"&&typeof e.expr=="string"?{expr:k(()=>T(e.expr))}:"neutral"}var Ce=4;function Ve(e){let n=typeof e.list=="string"?k(()=>T(e.list)):null,t=e.sort,r=typeof t=="string"?t:t&&typeof t=="object"&&typeof t.by=="string"?t.by:void 0,o=t&&typeof t=="object"?t.direction:void 0,a=n,d;if(n&&r!==void 0)if(o==="choices")d=r;else{let y=k(()=>T(r));a=y?{t:"call",fn:"sort",args:[n,y,{t:"lit",value:o==="desc"?"desc":"asc",at:0}],at:0}:null}let l=typeof e.limit=="number"&&Number.isInteger(e.limit)&&e.limit>=1?Math.min(e.limit,L):void 0,i=e.group,s=typeof i=="string"?i:i&&typeof i=="object"&&typeof i.by=="string"?i.by:void 0,f=i&&typeof i=="object"&&i.headings&&typeof i.headings=="object"?i.headings:{};return{t:"list",source:a,...d?{choiceOrder:d}:{},...l?{limit:l}:{},...s?{group:{by:s,headings:Object.fromEntries(Object.entries(f).filter(y=>typeof y[1]=="string"))}}:{},...typeof e.empty=="string"?{empty:e.empty}:{},as:e.as==="card"?"card":"row"}}function ke(e,n=1,t=""){if(!Array.isArray(e)||n>Ce)return[];let r={};return e.flatMap(o=>{if(!o||typeof o!="object"||Array.isArray(o))return[];let a=o,d=p=>typeof p=="string"?k(()=>de(p)):null,l=p=>typeof p=="string"?k(()=>T(p)):null,i=Me(a.tone),s=typeof a.label=="string"?a.label:void 0,f=p=>Object.hasOwn(a,p),y=typeof a.currency=="string"&&/^[A-Z]{3}$/.test(a.currency)?a.currency:void 0,u=f("list")?"list":f("headline")?"headline":typeof a.figure=="string"?"number":Le.find(f);if(!u)return[];let m=r[u]=(r[u]??0)+1,c=a.key,R=typeof c=="string"&&c?c:`${t}${u}.${m}`;return[{...(()=>{switch(u){case"list":return Ve(a);case"number":{let p=ue.includes(a.as)?a.as:void 0,H=fe.includes(a.emphasis)?a.emphasis:void 0;return{t:u,value:l(a.figure),...p?{as:p}:{},...y?{currency:y}:{},...s?{label:d(s)}:{},...H?{emphasis:H}:{}}}case"headline":case"title":return{t:u,parts:d(a[u])};case"text":{let p=a.lines;return{t:u,parts:d(a[u]),...i?{tone:i}:{},...typeof p=="number"&&Number.isInteger(p)&&p>=0?{lines:p}:{}}}case"badge":return{t:u,parts:d(a[u]),...i?{tone:i}:{}};case"field":{let p=le.includes(a.as)?a.as:void 0;return{t:u,field:String(a.field),...p?{as:p}:{},...y?{currency:y}:{},...s?{label:s}:{}}}case"image":return{t:u,field:String(a.image),as:a.as==="gallery"?"gallery":"thumb",...s?{label:s}:{}};case"progress":{let p=a.progress??{};return{t:u,value:l(p.value),max:l(p.max),...s?{label:d(s)}:{}}}case"group":return{t:u,blocks:ke(a.group,n+1,`${R}.`),direction:a.direction==="row"?"row":"column"};case"when":return{t:u,when:l(a.when),show:ke(a.show,n+1,`${R}.`)};default:return{t:u}}})(),key:R}]})}var Le=["title","text","badge","field","image","progress","group","when","divider","figure"],g="\u2014",Ie=500;function w(e,n){if(!e)return{ok:!1,problem:"an expression that does not parse"};try{return{ok:!0,value:G(e,{graph:n.graph??ae,subject:n.node,kinds:n.kinds,today:n.today,budget:n.budget??Ie})}}catch(t){return{ok:!1,problem:t instanceof Error?t.message:String(t)}}}function _e(e,n){let t=e.definition?.display?.format?.[n],r=e.fields[n]?.options??[];return t?Object.fromEntries(r.flatMap(o=>{let a=t(o);return a!==X(o)?[[o,a]]:[]})):{}}var De=(e,n,t)=>!e.format&&e.expr?.t==="ident"&&typeof t=="string"&&n.fields[e.expr.name]?.format==="markdown";function S(e,n,t){if(!e)return{text:g,problem:"a template that does not parse"};let r,o;return{text:e.map(d=>{if(d.text!==void 0)return d.text;let l=w(d.expr??null,n);if(!l.ok)return r??=`{${d.source??""}}: ${l.problem}`,g;if(De(d,n,l.value))return n.glance?ce(l.value,{markdown:!0}):t&&e.length===1?(o=!0,l.value):ge(l.value);let i=!d.format&&d.expr?.t==="ident"&&n.fields[d.expr.name]?.type==="enum"?d.expr.name:void 0;if(i&&(typeof l.value=="string"||Array.isArray(l.value)))return V(d,ie(l.value,_e(n,i),e.length===1));let s=!d.format&&d.expr?.t==="ident"&&typeof l.value=="number"?Be(n,d.expr.name):void 0;return V(d,s?C(l.value,s):b(l.value,d.format,n.today,d.formatArgs,n.money,v(n.schema)))}).join(""),...r?{problem:r}:{},...o?{markdown:o}:{}}}var $e=" \xB7 ";function Ue(e,n){if(!e||!n.node)return;let t=[[]];for(let d of e){if(d.text===void 0){t[t.length-1].push(d);continue}d.text.split($e).forEach((i,s)=>{s>0&&t.push([]),i!==""&&t[t.length-1].push({text:i})})}if(t.length<2)return;let r=d=>{let[l]=d;if(!(d.length!==1||!l||l.format||l.expr?.t!=="ident"))return n.fields[l.expr.name]?.type==="enum"?l.expr.name:void 0},o=0,a=t.flatMap(d=>{let l=r(d);if(l){let s=Object.hasOwn(n.node,l)?n.node[l]:void 0;return s==null||s===""?[]:(o++,[{text:x(n.definition,l,s),field:l}])}let i=S(d,n).text.trim();return i===""||i===g?[]:[{text:i}]});return o>0?a:void 0}function Ae(e,n){if(e===void 0)return;if(typeof e=="string")return e;let t=w(e.expr,n);return t.ok&&Ee(t.value)?t.value:"neutral"}function We(e){if(typeof e=="string")try{let n=new URL(e);return n.protocol==="http:"||n.protocol==="https:"?n.href:void 0}catch{return}}var Ge=(e,n)=>{let t=e.fields[n]?.type;return t==="phone"||t==="place"||t==="duration"?t:be(e.definition,n)},Be=(e,n)=>ee(e.definition?.fields?.shape?.[n])??he(e.definition,n);function He(e,n,t,r,o){if(n==null||n==="")return g;if(typeof n=="boolean")return n?"yes":"no";if(r)return b(n,r,t.today,[],o?{...t.money,currency:o}:t.money);let a=t.fields[e];if(t.definition?.display?.format?.[e])return x(t.definition,e,n);let d=we(Ge(t,e),n,t.money?.locale);if(d!==void 0)return d;if(a?.type==="date")return b(n,"date",t.today,[],t.money);if(a?.type==="datetime"&&typeof n=="string")return z(n,t.money?.locale,t.money?.timeZone);if(a?.type==="enum"&&(typeof n=="string"||Array.isArray(n)))return x(t.definition,e,n);let l=typeof n=="number"?Be(t,e):void 0;if(l)return C(n,l);if(typeof n=="number")return F(n,t.money?.locale,{});let i=O(n);return i[0]?i.map(D).join(", "):Array.isArray(n)?n.map(s=>String(s)).join(", "):typeof n=="object"?g:String(n)}function Ke(e,n,t,r,o){return typeof e!="number"?String(e):n==="money"?ne(e,t?{...o,currency:t}:o):n==="percent"?b(e,n,r,[],o):F(e,o?.locale)}var h=(e,n)=>n?{...e,problem:n}:e;function Oe(e){return e.firstHeading===void 0?e:{...e,firstHeading:void 0}}function ze(e,n,t){switch(e.t){case"title":{let r=S(e.parts,n);return h({t:"title",text:r.text},r.problem)}case"text":{let r=S(e.parts,n,!0),o=Ae(e.tone,n),a=n.glance&&!r.problem?Ue(e.parts,n):void 0;return h({t:"text",text:r.text,...o?{tone:o}:{},...e.lines!==void 0?{lines:e.lines}:{},...r.markdown?{markdown:r.markdown}:{},...a?{runs:a}:{}},r.problem)}case"badge":{let r=S(e.parts,n);return h({t:"badge",text:r.text,tone:Ae(e.tone,n)??"neutral"},r.problem)}case"field":{let r=e.label??N(n.definition,e.field);if(!n.node)return{t:"field",field:e.field,label:r,text:g,problem:`"${e.field}" names a field, and these blocks are about no one record`};let o=e.as===void 0?n.kinds.get(n.node.kind)?.linked?.get(e.field):void 0;if(o){let y=Q(Object.hasOwn(n.node,e.field)?n.node[e.field]:void 0,o);return{t:"field",field:e.field,label:r,text:y.length>0?"linked record":g,...y.length>0?{linked:{relation:o,refs:y}}:{}}}let a=n.kinds.get(n.node.kind)?.computed?.has(e.field),d,l;if(a){let y=w({t:"ident",name:e.field,at:0},n);y.ok?d=y.value!==null&&typeof y.value=="object"?b(y.value,void 0,n.today,[],n.money,v(n.schema)):y.value:l=y.problem}else d=Object.hasOwn(n.node,e.field)?n.node[e.field]:void 0;let i=e.as!==void 0?void 0:n.fields[e.field]?.type==="url"?We(d):Se(Ge(n,e.field),d),s=k(()=>He(e.field,d,n,e.as,e.currency))??g,f=n.fields[e.field]?.type==="app-link"&&e.as===void 0&&typeof d=="string"?d:void 0;return h({t:"field",field:e.field,label:r,text:s,...i?{href:i}:{},...f?{app:f}:{}},l)}case"image":{let r=O(n.node&&Object.hasOwn(n.node,e.field)?n.node[e.field]:null),o=e.as==="gallery"?r:r.filter(a=>E(a)||A(a)).slice(0,1);return{t:"image",field:e.field,label:e.label??N(n.definition,e.field),as:e.as,files:o,text:o.map(D).join(", ")||g}}case"progress":{let r=w(e.value,n),o=w(e.max,n),a=e.label?S(e.label,n):{text:"Progress"},d=e.label?B(e.label,a.text):a.text,l=r.ok?o.ok?a.problem:o.problem:r.problem;return r.ok&&o.ok&&typeof r.value=="number"&&typeof o.value=="number"&&Number.isFinite(r.value)&&Number.isFinite(o.value)&&o.value>0?h({t:"progress",label:d,value:r.value,max:o.value,text:`${b(r.value,void 0,n.today)} of ${b(o.value,void 0,n.today)}`},l):h({t:"progress",label:d,text:g},l)}case"group":return{t:"group",direction:e.direction,blocks:je(e.blocks,Oe(n))};case"when":{let r=w(e.when,n),o=r.ok&&r.value===!0;return h({t:"when",shown:o,blocks:o?je(e.show,Oe(n)):[]},r.ok?void 0:r.problem)}case"divider":return{t:"divider"};case"figure":return{t:"figure"};case"headline":{let r=S(e.parts,n),o=Math.min(6,Math.max(1,(t?n.firstHeading:void 0)??n.heading??3));return h({t:"headline",level:o,text:e.parts?B(e.parts,r.text):r.text},r.problem)}case"number":{let r=w(e.value,n),o=!r.ok||r.value===null||typeof r.value=="object"?g:Ke(r.value,e.as,e.currency,n.today,n.money),a=e.label?S(e.label,n):void 0;return h({t:"number",text:o,...a&&e.label?{label:B(e.label,a.text)}:{},...e.emphasis?{emphasis:e.emphasis}:{}},r.ok?a?.problem:r.problem)}case"list":return Xe(e,n)}}function je(e,n){let t=e.findIndex(r=>r.t==="headline");return e.map((r,o)=>({...ze(r,n,o===t),key:r.key}))}function Te(e,n){let t=n.trim().toLowerCase();return e.some(r=>{switch(r.t){case"title":case"headline":return r.text.trim()!=="";case"text":case"badge":return t!==""&&r.text.toLowerCase().includes(t);case"group":return Te(r.blocks,n);case"when":return r.shown&&Te(r.blocks,n);default:return!1}})}var Je=new Set(["every","some","sum","min","max","sort"]);function Gn(e,n){let t=new Set,r=new Set,o=i=>{if(i)switch(i.t){case"ident":t.add(i.name);return;case"list":i.items.forEach(o);return;case"member":return o(i.object);case"unary":return o(i.operand);case"binary":return o(i.left),o(i.right);case"where":return o(i.set);case"call":i.args.forEach((s,f)=>{f===1&&Je.has(i.fn)||o(s)});return;default:return}},a=i=>{for(let s of i??[])o(s.expr)},d=(i,s)=>{i.forEach((f,y)=>{let u=s[y];if(u)switch(f.t){case"field":case"image":t.add(f.field);return;case"title":case"text":case"badge":case"headline":a(f.parts);return;case"number":o(f.value),a(f.label);return;case"progress":o(f.value),o(f.max);return;case"group":u.t==="group"&&d(f.blocks,u.blocks);return;case"when":u.t==="when"&&u.shown&&d(f.show,u.blocks);return;case"list":if(u.t==="list")for(let m of u.members)r.add(m.id);return;default:return}})};d(e,n);let l=n[0];return{fields:t,records:r,...e[0]?.t==="title"&&l?.t==="title"?{title:l.text}:{}}}function Xe(e,n){let t=Math.min(6,(n.heading??3)+1),r=w(e.source,n);if(!r.ok)return{t:"list",as:e.as,failed:!0,members:[],headingLevel:t,more:0,problem:r.problem};let o=r.value,a=o instanceof j?o.nodes:o!==null&&typeof o=="object"&&!Array.isArray(o)?[o]:[];e.choiceOrder&&n.schema&&(a=Ze(a,e.choiceOrder,n.schema));let d=a.length,l=a.slice(0,e.limit??L),i=l.slice(0,I),s=l.slice(I),f=(e.limit===void 0?d:l.length)-i.length,y=c=>e.group&&n.schema&&c.length>0?Ye(c,e.group,n.schema,n.graph):void 0,u=y(i),m=s.length>0?y(l):void 0;return{t:"list",as:e.as,failed:!1,members:i,...s.length>0?{rest:s}:{},...u?{groups:u}:{},...m?{everyGroup:m}:{},headingLevel:t,...i.length===0&&e.empty?{empty:e.empty}:{},more:f,total:d}}function $(e,n,t){let r=e.tryDefinition(n)?.fields?.shape,o=r&&Object.hasOwn(r,t)?_(r[t]):void 0;return o?.type==="enum"?o.options??[]:[]}var U=(e,n)=>Object.hasOwn(e,n)?e[n]:void 0;function Ze(e,n,t){let r=o=>{let a=$(t,o.kind,n).indexOf(String(U(o,n)));return a<0?Number.MAX_SAFE_INTEGER:a};return e.map((o,a)=>({node:o,i:a,rank:r(o)})).sort((o,a)=>o.rank-a.rank||o.i-a.i).map(o=>o.node)}function Ye(e,n,t,r){let o=e.some(i=>$(t,i.kind,n.by).length>0)?void 0:ye(n.by);if(o&&r)return qe(e,o,n.headings,t,r);let a=[];for(let i of e)for(let s of $(t,i.kind,n.by))a.includes(s)||a.push(s);let d=[];for(let i of a){let s=e.filter(y=>U(y,n.by)===i);if(s.length===0)continue;let f=t.tryDefinition(s[0].kind);d.push({value:i,heading:n.headings[i]??J(x(f,n.by,i)),members:s})}let l=e.filter(i=>!a.includes(String(U(i,n.by))));return l.length>0&&d.push({value:null,members:l}),d}function qe(e,n,t,r,o){let a=u=>n.way??(Object.hasOwn(r.tryDefinition(u.kind)?.edges??{},n.edge)?"out":"in"),d=new Map,l=[],i=v(r),s;for(let u of e){let m=a(u)==="out"?o.out(u.id,n.edge):o.in(u.id,n.edge);m.length===0&&l.push(u);for(let c of m){s??=c.kind;let R=d.get(c.id)??{node:c,members:[]};R.members.push(u),d.set(c.id,R)}}let f=[...d.values()].map(({node:u,members:m})=>({value:u.id,heading:t[u.id]??i(u),members:m})).sort((u,m)=>u.heading.localeCompare(m.heading,void 0,{numeric:!0}));!s&&e[0]&&a(e[0])==="out"&&(s=(r.tryDefinition(e[0].kind)?.edges??{})[n.edge]?.to?.[0]);let y=s&&s!=="*"?Y(r.tryDefinition(s),s):void 0;return l.length>0&&f.push({value:null,...y?{heading:`No ${y}`}:{},members:l}),f}function xe(e){return e.t==="list"||e.t==="headline"||e.t==="number"||e.t==="image"&&e.as==="gallery"?!0:e.t==="group"?e.blocks.some(xe):e.t==="when"?e.show.some(xe):!1}function ve(e,n){let t=e.tryDefinition(n)?.fields?.shape??{},r={};for(let[o,a]of Object.entries(t)){let d=_(a);d&&(r[o]=d)}return r}var Pe=new WeakMap;function W(e){let n=Pe.get(e);return n||Pe.set(e,n=me(e)),n}function Qe(e,n,t,r={}){let o=W(e),a={},d={},l=i=>{if(i instanceof j)return i.nodes.map(s=>l(s));if(Array.isArray(i))return i.map(s=>l(s));if(i!==null&&typeof i=="object"){let s=i;return{id:s.id,kind:s.kind,label:Z(e.tryDefinition(s.kind),s)}}return i};for(let[i,s]of o.get(t?t.kind:te)?.computed??[])try{let f=[],y=G(s,{graph:n,subject:t,kinds:o,...r.today?{today:r.today}:{},...r.budget?{budget:r.budget}:{},...r.linked?{linked:r.linked}:{},onUnread:u=>f.push(u)});f.length>0&&(y===null||y instanceof j&&y.nodes.length===0)?d[i]=re(f[0]):a[i]=l(y)}catch(f){if(!(f instanceof oe))throw f;d[i]=f.sentence}return{values:a,refused:d}}function Mn(e,n,t){let{values:r}=Qe(e,n,t);if(Object.keys(r).length===0)return t;let o=a=>Array.isArray(a)?a.map(o):a!==null&&typeof a=="object"?a.label:a;return{...t,...Object.fromEntries(Object.entries(r).map(([a,d])=>[a,o(d)]))}}function Cn(e,n){return[...pe(e.tryDefinition(n)).keys()]}var en=500,nn=2e4,Fe=new WeakMap;function rn(e,n){let t=Fe.get(e);t||Fe.set(e,t=new Map);let r=t.get(n);return r||t.set(n,r=ve(e,n)),r}function Dn(e,n,t,r={}){if(n&&typeof e.seenBy!="function")throw new TypeError("blockContextFor: a seat is read from a store (its `seenBy`); a bare { graph, schema } is read as it is handed, with no principal");let o=n?e.seenBy(n):e,a=n&&t?o.graph.getNode(t.id)??null:t,d=o.schema,l=a&&d.tryDefinition(a.kind),i=!a||(r.slot??"page")==="page",{money:s,firstHeading:f}=r;return{node:a,graph:o.graph,schema:d,kinds:W(d),fields:a?rn(d,a.kind):{},definition:l||void 0,today:r.today??o.today?.()??K(s?.timeZone),money:s,heading:r.heading??(i?2:3),firstHeading:f,budget:r.budget??(i?nn:en),...i?{}:{glance:!0}}}export{Re as a,dn as b,Ne as c,sn as d,ke as e,je as f,Te as g,Gn as h,xe as i,W as j,Qe as k,Mn as l,Cn as m,Dn as n};
|
|
1
|
+
import{a as _}from"./chunk.CE3NKAF7.js";import{a as se,b as le,c as ue,d as fe,e as L,f as I,g as ye}from"./chunk.R3GE37OI.js";import{a as me}from"./chunk.2KCDLCB2.js";import{c as T,e as de,f as pe}from"./chunk.UD7VLXPM.js";import{a as j,b as re,c as te,d as oe,f as G,m as ae,n as b,o as V,p as B,q as v,r as ie}from"./chunk.3DEWQDP7.js";import{a as x,c as ce,d as ge,f as he,h as be,i as we,j as Se}from"./chunk.JULD4XFB.js";import{$b as ee,Aa as A,Ba as q,C as P,Ca as O,Da as M,L as K,La as Q,W as z,Z as F,ac as ne,bc as C,da as J,ha as X,la as Z,ra as N,ua as Y,za as E}from"./chunk.6AANHELP.js";var Re=e=>e.caption?.trim()||e.name,D=e=>A(e)?`${Re(e)}, ${q(e)}`:Re(e);function dn(e){let n=Math.max(0,Math.round(e)),t=a=>String(a).padStart(2,"0"),r=Math.floor(n/3600),o=Math.floor(n%3600/60);return r>0?`${r}:${t(o)}:${t(n%60)}`:`${o}:${t(n%60)}`}function Ne(e){let n=e?.fields?.shape??{};return Object.keys(n).filter(t=>{let r=P(n[t]);for(;r?.innerType;)r=P(r.innerType);return M(n[t])!==void 0||r?.type==="array"&&M(r.element)!==void 0})}function sn(e,n){for(let t of Ne(n)){let r=O(e[t]).find(o=>E(o)||A(o));if(r)return r}}var k=e=>{try{return e()}catch{return null}},Ee=e=>typeof e=="string"&&se.includes(e);function Me(e){if(e!==void 0)return Ee(e)?e:e&&typeof e=="object"&&typeof e.expr=="string"?{expr:k(()=>T(e.expr))}:"neutral"}var Ce=4;function Ve(e){let n=typeof e.list=="string"?k(()=>T(e.list)):null,t=e.sort,r=typeof t=="string"?t:t&&typeof t=="object"&&typeof t.by=="string"?t.by:void 0,o=t&&typeof t=="object"?t.direction:void 0,a=n,d;if(n&&r!==void 0)if(o==="choices")d=r;else{let y=k(()=>T(r));a=y?{t:"call",fn:"sort",args:[n,y,{t:"lit",value:o==="desc"?"desc":"asc",at:0}],at:0}:null}let l=typeof e.limit=="number"&&Number.isInteger(e.limit)&&e.limit>=1?Math.min(e.limit,L):void 0,i=e.group,s=typeof i=="string"?i:i&&typeof i=="object"&&typeof i.by=="string"?i.by:void 0,f=i&&typeof i=="object"&&i.headings&&typeof i.headings=="object"?i.headings:{};return{t:"list",source:a,...d?{choiceOrder:d}:{},...l?{limit:l}:{},...s?{group:{by:s,headings:Object.fromEntries(Object.entries(f).filter(y=>typeof y[1]=="string"))}}:{},...typeof e.empty=="string"?{empty:e.empty}:{},as:e.as==="card"?"card":"row"}}function ke(e,n=1,t=""){if(!Array.isArray(e)||n>Ce)return[];let r={};return e.flatMap(o=>{if(!o||typeof o!="object"||Array.isArray(o))return[];let a=o,d=p=>typeof p=="string"?k(()=>de(p)):null,l=p=>typeof p=="string"?k(()=>T(p)):null,i=Me(a.tone),s=typeof a.label=="string"?a.label:void 0,f=p=>Object.hasOwn(a,p),y=typeof a.currency=="string"&&/^[A-Z]{3}$/.test(a.currency)?a.currency:void 0,u=f("list")?"list":f("headline")?"headline":typeof a.figure=="string"?"number":Le.find(f);if(!u)return[];let m=r[u]=(r[u]??0)+1,c=a.key,R=typeof c=="string"&&c?c:`${t}${u}.${m}`;return[{...(()=>{switch(u){case"list":return Ve(a);case"number":{let p=ue.includes(a.as)?a.as:void 0,H=fe.includes(a.emphasis)?a.emphasis:void 0;return{t:u,value:l(a.figure),...p?{as:p}:{},...y?{currency:y}:{},...s?{label:d(s)}:{},...H?{emphasis:H}:{}}}case"headline":case"title":return{t:u,parts:d(a[u])};case"text":{let p=a.lines;return{t:u,parts:d(a[u]),...i?{tone:i}:{},...typeof p=="number"&&Number.isInteger(p)&&p>=0?{lines:p}:{}}}case"badge":return{t:u,parts:d(a[u]),...i?{tone:i}:{}};case"field":{let p=le.includes(a.as)?a.as:void 0;return{t:u,field:String(a.field),...p?{as:p}:{},...y?{currency:y}:{},...s?{label:s}:{}}}case"image":return{t:u,field:String(a.image),as:a.as==="gallery"?"gallery":"thumb",...s?{label:s}:{}};case"progress":{let p=a.progress??{};return{t:u,value:l(p.value),max:l(p.max),...s?{label:d(s)}:{}}}case"group":return{t:u,blocks:ke(a.group,n+1,`${R}.`),direction:a.direction==="row"?"row":"column"};case"when":return{t:u,when:l(a.when),show:ke(a.show,n+1,`${R}.`)};default:return{t:u}}})(),key:R}]})}var Le=["title","text","badge","field","image","progress","group","when","divider","figure"],g="\u2014",Ie=500;function w(e,n){if(!e)return{ok:!1,problem:"an expression that does not parse"};try{return{ok:!0,value:G(e,{graph:n.graph??ae,subject:n.node,kinds:n.kinds,today:n.today,budget:n.budget??Ie})}}catch(t){return{ok:!1,problem:t instanceof Error?t.message:String(t)}}}function _e(e,n){let t=e.definition?.display?.format?.[n],r=e.fields[n]?.options??[];return t?Object.fromEntries(r.flatMap(o=>{let a=t(o);return a!==X(o)?[[o,a]]:[]})):{}}var De=(e,n,t)=>!e.format&&e.expr?.t==="ident"&&typeof t=="string"&&n.fields[e.expr.name]?.format==="markdown";function S(e,n,t){if(!e)return{text:g,problem:"a template that does not parse"};let r,o;return{text:e.map(d=>{if(d.text!==void 0)return d.text;let l=w(d.expr??null,n);if(!l.ok)return r??=`{${d.source??""}}: ${l.problem}`,g;if(De(d,n,l.value))return n.glance?ce(l.value,{markdown:!0}):t&&e.length===1?(o=!0,l.value):ge(l.value);let i=!d.format&&d.expr?.t==="ident"&&n.fields[d.expr.name]?.type==="enum"?d.expr.name:void 0;if(i&&(typeof l.value=="string"||Array.isArray(l.value)))return V(d,ie(l.value,_e(n,i),e.length===1));let s=!d.format&&d.expr?.t==="ident"&&typeof l.value=="number"?Be(n,d.expr.name):void 0;return V(d,s?C(l.value,s):b(l.value,d.format,n.today,d.formatArgs,n.money,v(n.schema)))}).join(""),...r?{problem:r}:{},...o?{markdown:o}:{}}}var $e=" \xB7 ";function Ue(e,n){if(!e||!n.node)return;let t=[[]];for(let d of e){if(d.text===void 0){t[t.length-1].push(d);continue}d.text.split($e).forEach((i,s)=>{s>0&&t.push([]),i!==""&&t[t.length-1].push({text:i})})}if(t.length<2)return;let r=d=>{let[l]=d;if(!(d.length!==1||!l||l.format||l.expr?.t!=="ident"))return n.fields[l.expr.name]?.type==="enum"?l.expr.name:void 0},o=0,a=t.flatMap(d=>{let l=r(d);if(l){let s=Object.hasOwn(n.node,l)?n.node[l]:void 0;return s==null||s===""?[]:(o++,[{text:x(n.definition,l,s),field:l}])}let i=S(d,n).text.trim();return i===""||i===g?[]:[{text:i}]});return o>0?a:void 0}function Ae(e,n){if(e===void 0)return;if(typeof e=="string")return e;let t=w(e.expr,n);return t.ok&&Ee(t.value)?t.value:"neutral"}function We(e){if(typeof e=="string")try{let n=new URL(e);return n.protocol==="http:"||n.protocol==="https:"?n.href:void 0}catch{return}}var Ge=(e,n)=>{let t=e.fields[n]?.type;return t==="phone"||t==="place"||t==="duration"?t:be(e.definition,n)},Be=(e,n)=>ee(e.definition?.fields?.shape?.[n])??he(e.definition,n);function He(e,n,t,r,o){if(n==null||n==="")return g;if(typeof n=="boolean")return n?"yes":"no";if(r)return b(n,r,t.today,[],o?{...t.money,currency:o}:t.money);let a=t.fields[e];if(t.definition?.display?.format?.[e])return x(t.definition,e,n);let d=we(Ge(t,e),n,t.money?.locale);if(d!==void 0)return d;if(a?.type==="date")return b(n,"date",t.today,[],t.money);if(a?.type==="datetime"&&typeof n=="string")return z(n,t.money?.locale,t.money?.timeZone);if(a?.type==="enum"&&(typeof n=="string"||Array.isArray(n)))return x(t.definition,e,n);let l=typeof n=="number"?Be(t,e):void 0;if(l)return C(n,l);if(typeof n=="number")return F(n,t.money?.locale,{});let i=O(n);return i[0]?i.map(D).join(", "):Array.isArray(n)?n.map(s=>String(s)).join(", "):typeof n=="object"?g:String(n)}function Ke(e,n,t,r,o){return typeof e!="number"?String(e):n==="money"?ne(e,t?{...o,currency:t}:o):n==="percent"?b(e,n,r,[],o):F(e,o?.locale)}var h=(e,n)=>n?{...e,problem:n}:e;function Oe(e){return e.firstHeading===void 0?e:{...e,firstHeading:void 0}}function ze(e,n,t){switch(e.t){case"title":{let r=S(e.parts,n);return h({t:"title",text:r.text},r.problem)}case"text":{let r=S(e.parts,n,!0),o=Ae(e.tone,n),a=n.glance&&!r.problem?Ue(e.parts,n):void 0;return h({t:"text",text:r.text,...o?{tone:o}:{},...e.lines!==void 0?{lines:e.lines}:{},...r.markdown?{markdown:r.markdown}:{},...a?{runs:a}:{}},r.problem)}case"badge":{let r=S(e.parts,n);return h({t:"badge",text:r.text,tone:Ae(e.tone,n)??"neutral"},r.problem)}case"field":{let r=e.label??N(n.definition,e.field);if(!n.node)return{t:"field",field:e.field,label:r,text:g,problem:`"${e.field}" names a field, and these blocks are about no one record`};let o=e.as===void 0?n.kinds.get(n.node.kind)?.linked?.get(e.field):void 0;if(o){let y=Q(Object.hasOwn(n.node,e.field)?n.node[e.field]:void 0,o);return{t:"field",field:e.field,label:r,text:y.length>0?"linked record":g,...y.length>0?{linked:{relation:o,refs:y}}:{}}}let a=n.kinds.get(n.node.kind)?.computed?.has(e.field),d,l;if(a){let y=w({t:"ident",name:e.field,at:0},n);y.ok?d=y.value!==null&&typeof y.value=="object"?b(y.value,void 0,n.today,[],n.money,v(n.schema)):y.value:l=y.problem}else d=Object.hasOwn(n.node,e.field)?n.node[e.field]:void 0;let i=e.as!==void 0?void 0:n.fields[e.field]?.type==="url"?We(d):Se(Ge(n,e.field),d),s=k(()=>He(e.field,d,n,e.as,e.currency))??g,f=n.fields[e.field]?.type==="app-link"&&e.as===void 0&&typeof d=="string"?d:void 0;return h({t:"field",field:e.field,label:r,text:s,...i?{href:i}:{},...f?{app:f}:{}},l)}case"image":{let r=O(n.node&&Object.hasOwn(n.node,e.field)?n.node[e.field]:null),o=e.as==="gallery"?r:r.filter(a=>E(a)||A(a)).slice(0,1);return{t:"image",field:e.field,label:e.label??N(n.definition,e.field),as:e.as,files:o,text:o.map(D).join(", ")||g}}case"progress":{let r=w(e.value,n),o=w(e.max,n),a=e.label?S(e.label,n):{text:"Progress"},d=e.label?B(e.label,a.text):a.text,l=r.ok?o.ok?a.problem:o.problem:r.problem;return r.ok&&o.ok&&typeof r.value=="number"&&typeof o.value=="number"&&Number.isFinite(r.value)&&Number.isFinite(o.value)&&o.value>0?h({t:"progress",label:d,value:r.value,max:o.value,text:`${b(r.value,void 0,n.today)} of ${b(o.value,void 0,n.today)}`},l):h({t:"progress",label:d,text:g},l)}case"group":return{t:"group",direction:e.direction,blocks:je(e.blocks,Oe(n))};case"when":{let r=w(e.when,n),o=r.ok&&r.value===!0;return h({t:"when",shown:o,blocks:o?je(e.show,Oe(n)):[]},r.ok?void 0:r.problem)}case"divider":return{t:"divider"};case"figure":return{t:"figure"};case"headline":{let r=S(e.parts,n),o=Math.min(6,Math.max(1,(t?n.firstHeading:void 0)??n.heading??3));return h({t:"headline",level:o,text:e.parts?B(e.parts,r.text):r.text},r.problem)}case"number":{let r=w(e.value,n),o=!r.ok||r.value===null||typeof r.value=="object"?g:Ke(r.value,e.as,e.currency,n.today,n.money),a=e.label?S(e.label,n):void 0;return h({t:"number",text:o,...a&&e.label?{label:B(e.label,a.text)}:{},...e.emphasis?{emphasis:e.emphasis}:{}},r.ok?a?.problem:r.problem)}case"list":return Xe(e,n)}}function je(e,n){let t=e.findIndex(r=>r.t==="headline");return e.map((r,o)=>({...ze(r,n,o===t),key:r.key}))}function Te(e,n){let t=n.trim().toLowerCase();return e.some(r=>{switch(r.t){case"title":case"headline":return r.text.trim()!=="";case"text":case"badge":return t!==""&&r.text.toLowerCase().includes(t);case"group":return Te(r.blocks,n);case"when":return r.shown&&Te(r.blocks,n);default:return!1}})}var Je=new Set(["every","some","sum","min","max","sort"]);function Gn(e,n){let t=new Set,r=new Set,o=i=>{if(i)switch(i.t){case"ident":t.add(i.name);return;case"list":i.items.forEach(o);return;case"member":return o(i.object);case"unary":return o(i.operand);case"binary":return o(i.left),o(i.right);case"where":return o(i.set);case"call":i.args.forEach((s,f)=>{f===1&&Je.has(i.fn)||o(s)});return;default:return}},a=i=>{for(let s of i??[])o(s.expr)},d=(i,s)=>{i.forEach((f,y)=>{let u=s[y];if(u)switch(f.t){case"field":case"image":t.add(f.field);return;case"title":case"text":case"badge":case"headline":a(f.parts);return;case"number":o(f.value),a(f.label);return;case"progress":o(f.value),o(f.max);return;case"group":u.t==="group"&&d(f.blocks,u.blocks);return;case"when":u.t==="when"&&u.shown&&d(f.show,u.blocks);return;case"list":if(u.t==="list")for(let m of u.members)r.add(m.id);return;default:return}})};d(e,n);let l=n[0];return{fields:t,records:r,...e[0]?.t==="title"&&l?.t==="title"?{title:l.text}:{}}}function Xe(e,n){let t=Math.min(6,(n.heading??3)+1),r=w(e.source,n);if(!r.ok)return{t:"list",as:e.as,failed:!0,members:[],headingLevel:t,more:0,problem:r.problem};let o=r.value,a=o instanceof j?o.nodes:o!==null&&typeof o=="object"&&!Array.isArray(o)?[o]:[];e.choiceOrder&&n.schema&&(a=Ze(a,e.choiceOrder,n.schema));let d=a.length,l=a.slice(0,e.limit??L),i=l.slice(0,I),s=l.slice(I),f=(e.limit===void 0?d:l.length)-i.length,y=c=>e.group&&n.schema&&c.length>0?Ye(c,e.group,n.schema,n.graph):void 0,u=y(i),m=s.length>0?y(l):void 0;return{t:"list",as:e.as,failed:!1,members:i,...s.length>0?{rest:s}:{},...u?{groups:u}:{},...m?{everyGroup:m}:{},headingLevel:t,...i.length===0&&e.empty?{empty:e.empty}:{},more:f,total:d}}function $(e,n,t){let r=e.tryDefinition(n)?.fields?.shape,o=r&&Object.hasOwn(r,t)?_(r[t]):void 0;return o?.type==="enum"?o.options??[]:[]}var U=(e,n)=>Object.hasOwn(e,n)?e[n]:void 0;function Ze(e,n,t){let r=o=>{let a=$(t,o.kind,n).indexOf(String(U(o,n)));return a<0?Number.MAX_SAFE_INTEGER:a};return e.map((o,a)=>({node:o,i:a,rank:r(o)})).sort((o,a)=>o.rank-a.rank||o.i-a.i).map(o=>o.node)}function Ye(e,n,t,r){let o=e.some(i=>$(t,i.kind,n.by).length>0)?void 0:ye(n.by);if(o&&r)return qe(e,o,n.headings,t,r);let a=[];for(let i of e)for(let s of $(t,i.kind,n.by))a.includes(s)||a.push(s);let d=[];for(let i of a){let s=e.filter(y=>U(y,n.by)===i);if(s.length===0)continue;let f=t.tryDefinition(s[0].kind);d.push({value:i,heading:n.headings[i]??J(x(f,n.by,i)),members:s})}let l=e.filter(i=>!a.includes(String(U(i,n.by))));return l.length>0&&d.push({value:null,members:l}),d}function qe(e,n,t,r,o){let a=u=>n.way??(Object.hasOwn(r.tryDefinition(u.kind)?.edges??{},n.edge)?"out":"in"),d=new Map,l=[],i=v(r),s;for(let u of e){let m=a(u)==="out"?o.out(u.id,n.edge):o.in(u.id,n.edge);m.length===0&&l.push(u);for(let c of m){s??=c.kind;let R=d.get(c.id)??{node:c,members:[]};R.members.push(u),d.set(c.id,R)}}let f=[...d.values()].map(({node:u,members:m})=>({value:u.id,heading:t[u.id]??i(u),members:m})).sort((u,m)=>u.heading.localeCompare(m.heading,void 0,{numeric:!0}));!s&&e[0]&&a(e[0])==="out"&&(s=(r.tryDefinition(e[0].kind)?.edges??{})[n.edge]?.to?.[0]);let y=s&&s!=="*"?Y(r.tryDefinition(s),s):void 0;return l.length>0&&f.push({value:null,...y?{heading:`No ${y}`}:{},members:l}),f}function xe(e){return e.t==="list"||e.t==="headline"||e.t==="number"||e.t==="image"&&e.as==="gallery"?!0:e.t==="group"?e.blocks.some(xe):e.t==="when"?e.show.some(xe):!1}function ve(e,n){let t=e.tryDefinition(n)?.fields?.shape??{},r={};for(let[o,a]of Object.entries(t)){let d=_(a);d&&(r[o]=d)}return r}var Pe=new WeakMap;function W(e){let n=Pe.get(e);return n||Pe.set(e,n=me(e)),n}function Qe(e,n,t,r={}){let o=W(e),a={},d={},l=i=>{if(i instanceof j)return i.nodes.map(s=>l(s));if(Array.isArray(i))return i.map(s=>l(s));if(i!==null&&typeof i=="object"){let s=i;return{id:s.id,kind:s.kind,label:Z(e.tryDefinition(s.kind),s)}}return i};for(let[i,s]of o.get(t?t.kind:te)?.computed??[])try{let f=[],y=G(s,{graph:n,subject:t,kinds:o,...r.today?{today:r.today}:{},...r.budget?{budget:r.budget}:{},...r.linked?{linked:r.linked}:{},onUnread:u=>f.push(u)});f.length>0&&(y===null||y instanceof j&&y.nodes.length===0)?d[i]=re(f[0]):a[i]=l(y)}catch(f){if(!(f instanceof oe))throw f;d[i]=f.sentence}return{values:a,refused:d}}function Mn(e,n,t){let{values:r}=Qe(e,n,t);if(Object.keys(r).length===0)return t;let o=a=>Array.isArray(a)?a.map(o):a!==null&&typeof a=="object"?a.label:a;return{...t,...Object.fromEntries(Object.entries(r).map(([a,d])=>[a,o(d)]))}}function Cn(e,n){return[...pe(e.tryDefinition(n)).keys()]}var en=500,nn=2e4,Fe=new WeakMap;function rn(e,n){let t=Fe.get(e);t||Fe.set(e,t=new Map);let r=t.get(n);return r||t.set(n,r=ve(e,n)),r}function Dn(e,n,t,r={}){if(n&&typeof e.seenBy!="function")throw new TypeError("blockContextFor: a seat is read from a store (its `seenBy`); a bare { graph, schema } is read as it is handed, with no principal");let o=n?e.seenBy(n):e,a=n&&t?o.graph.getNode(t.id)??null:t,d=o.schema,l=a&&d.tryDefinition(a.kind),i=!a||(r.slot??"page")==="page",{money:s,firstHeading:f}=r;return{node:a,graph:o.graph,schema:d,kinds:W(d),fields:a?rn(d,a.kind):{},definition:l||void 0,today:r.today??o.today?.()??K(s?.timeZone),money:s,heading:r.heading??(i?2:3),firstHeading:f,budget:r.budget??(i?nn:en),...i?{}:{glance:!0}}}export{Re as a,dn as b,Ne as c,sn as d,ke as e,je as f,Te as g,Gn as h,xe as i,W as j,Qe as k,Mn as l,Cn as m,Dn as n};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as g}from"./chunk.
|
|
1
|
+
import{h as g}from"./chunk.H3IGXHZR.js";import{W as p}from"./chunk.3VEZ5MOC.js";import{Rc as u,Zc as c}from"./chunk.6AANHELP.js";import{b as h}from"./chunk.AJZBJBMO.js";var s={person:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"><circle cx="11.6" cy="5.4" r="2.5"/><path d="M7.9 12.4c0-2.1 1.7-3.8 3.7-3.8s3.7 1.7 3.7 3.8v3.2H7.9z"/><path d="M8 12.6 6.4 17.2"/><path d="M15.2 12.6 16.8 17.2"/><path d="M9.8 15.6v5"/><path d="M13.4 15.6v5"/></svg>',plot:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"><path d="M2.6 9.4 12 4.6l9.4 4.8-9.4 4.8z"/><path d="M2.6 9.4v4.4l9.4 4.8 9.4-4.8V9.4"/><path d="M12 14.2v4.4"/><path d="M7 11.9v3"/><path d="M17 11.9v3"/></svg>',box:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"><path d="M3.4 7.9 12 3.6l8.6 4.3-8.6 4.3z"/><path d="M3.4 7.9v8.2L12 20.4l8.6-4.3V7.9"/><path d="M12 12.2v8.2"/></svg>',task:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"><path d="M4.4 6.6 12 2.9l7.6 3.7v9.5L12 19.8 4.4 16.1z"/><path d="M12 12.4v7.4"/><path d="M4.4 6.6 12 10.3l7.6-3.7"/><path d="M8 9.6l2.4 2.4L16 8.4"/></svg>',shift:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"><path d="M3.2 8.2 12 4l8.8 4.2-8.8 4.2z"/><path d="M3.2 8.2v7.2L12 19.6l8.8-4.2V8.2"/><path d="M12 12.4v7.2"/><path d="M6.6 10.8v3.4"/><path d="M9.3 12v3.4"/></svg>',list:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"><path d="M2.8 10.4 12 6l9.2 4.4-9.2 4.4z"/><path d="M2.8 10.4v3.2L12 18l9.2-4.4v-3.2"/><path d="M6.6 8.6 15.8 13"/><path d="M9.4 7.2 18.6 11.6"/></svg>',vehicle:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"><path d="M2.8 14.2 5 9.4l8.6-1.6 5.4 3-1 3.6z"/><path d="M2.8 14.2v2.2h2.4"/><path d="M18 16.4h1.9l.1-2.2"/><circle cx="7.6" cy="16.6" r="1.9"/><circle cx="16.1" cy="16.6" r="1.9"/><path d="M8.6 8.2 9.8 12l7.2-1"/></svg>',rule:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"><path d="M5.4 19.4V6.6l12 12.8z"/><path d="M5.4 6.6 7.6 5.5l12 12.8-2.2 1.1"/><path d="M5.4 19.4 7.6 18.3h12"/><path d="M5.4 10.1h1.7"/><path d="M5.4 13.3h1.7"/><path d="M5.4 16.5h1.7"/></svg>',note:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"><path d="M6.2 6.2 14.8 10.5v9L6.2 15.2z"/><path d="M12.4 9.3 14.8 10.5l-.6 2.3"/><path d="M8.2 10.6 12.8 12.9"/><path d="M8.2 13.2 11.4 14.8"/></svg>'},w=Object.keys(s);function o(e){if(!e)return;let t=s[e];return t||(e.trimStart().startsWith("<svg")&&c(e)===null?e:void 0)}var a=h(p(),1);function j({kind:e,schema:t,brand:i,size:r=16,title:n}){let f=t?.tryDefinition?.(e)?.figure,d=o(i?.figures?.[e]??f),l=Math.round(u(e,i?.accents)),v=g(d);return d?(0,a.jsx)("span",{"aria-hidden":n===void 0?"true":void 0,...n===void 0?{}:{role:"img","aria-label":n},"data-graview-figure":e,"data-graview-figure-kind":"figure",dangerouslySetInnerHTML:v,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:r,height:r,flex:"0 0 auto",color:`hsl(${l} 55% 52%)`,"--graview-figure-size":`${r}px`}}):(0,a.jsx)("span",{"aria-hidden":n===void 0?"true":void 0,...n===void 0?{}:{role:"img","aria-label":n},"data-graview-figure":e,"data-graview-figure-kind":"dot",style:{display:"inline-block",width:Math.round(r*.8),height:Math.round(r*.5),flex:"0 0 auto",background:`hsl(${l} 55% 52%)`,clipPath:"polygon(50% 0, 100% 50%, 50% 100%, 0 50%)"}})}function A(e,t,i){return o(i?.figures?.[e]??t?.tryDefinition?.(e)?.figure)!==void 0}export{j as a,A as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as l}from"./chunk.
|
|
1
|
+
import{c as l}from"./chunk.CNN32262.js";import{me as i}from"./chunk.6AANHELP.js";function c(e){return e.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-|-$/g,"")}function p(e,n={}){let[t="/",a=""]=e.split("#")[0].split("?"),r=new URLSearchParams(a);n.filter&&r.set("filter",n.filter);let s=r.toString(),o=n.section?c(n.section):"";return`${t}${s?`?${s}`:""}${o?`#${o}`:""}`}var m=e=>({as:e.slug,title:e.title,kind:e.kind,is:e.kind===null?e.slug===i?"home":"overview":e.address.startsWith("/places/")?"place":"list",...e.hidden?{hidden:!0}:{}});function d(e,n){let t=[];for(let a of e)a.kind!==null&&n.has(a.kind)||a.over?.some(r=>n.has(r))||t.some(r=>r.as===a.slug)||t.push(m(a));return t}function y(e,n,t={}){return d(l(e,n,t.pages?{pages:t.pages}:{}),t.kept??new Set)}export{c as a,p as b,y as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{db as g}from"./chunk.
|
|
1
|
+
import{db as g}from"./chunk.6AANHELP.js";function y(e){return[e.basis,...e.confidence!==void 0?[`${Math.round(e.confidence*100)}% sure`]:[],...e.model?[e.model]:[]].join(" \xB7 ")}var u=e=>`Not yet kept by a person. ${e.by.name??e.by.id??"Something"} made it${e.lineage?`: ${y(e.lineage)}`:""}.`,p=e=>`${e.kind}\0${e.from}\0${e.to}`;function k(e,o){let r=new Map;for(let n of e){if(n.undoes!==void 0||o.has(n.id)||n.withheld)continue;let l=g(n.author),s=l==="human"||l==="visitor",c=new Map;for(let t of n.primitives){if(t.op!=="add-edge"&&t.op!=="remove-edge")continue;let i=p(t.edge),a=r.get(i)??c.get(i);if(r.delete(i),t.op==="remove-edge")a&&c.set(i,a);else if(a&&(s||!n.lineage))r.set(i,s?{...a,provisional:!1,keptBy:n.id}:a);else{let d=n.lineage;r.set(i,{edge:t.edge,made:n.id,by:n.author,...d?{lineage:d}:{},provisional:!s&&(d?.confidence??1)<1})}}}return r}var f=new WeakMap;function v({log:e}){let o=e.all(),r=`${e.horizon}:${o.length}:${o.at(-1)?.id}`,n=f.get(e);return n?.at!==r&&f.set(e,n={at:r,links:k(o,e.undoneIds())}),n.links}var L=(e,o)=>v(e).get(p(o));var m=e=>[...v(e).values()].filter(o=>o.provisional);export{y as a,u as b,L as c,m as d};
|
|
@@ -1 +1 @@
|
|
|
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 le,b as O,c as ue}from"./chunk.LVOTLGJB.js";import{B as re,D as oe,F as ae,H as ie,L as se,N as de,Q as ce,i as J,j as Q,l as X,r as Y,u as ee,v as ne,z as te}from"./chunk.QNP5OR3P.js";import{a as W}from"./chunk.4W57E7AX.js";import{Aa as j,G as $,Ma as Z,Ta as U,W as G,ea as q,ga as z,ya as _,za as V}from"./chunk.A5PSEU3W.js";import{a as K}from"./chunk.SDO3U72B.js";import{$c as T,dd as I}from"./chunk.ZEZUKRC6.js";import{b as F}from"./chunk.AJZBJBMO.js";var o=F($(),1);var h=F($(),1),k,he=K(()=>(__graviewPreload(import.meta.url,["./chunk.ZRBGYXAO.js","./chunk.CEQQIW7Z.js","./chunk.G3GFDVO2.js","./chunk.D4WJ7OM5.js","./chunk.QDVGHI7R.js","./chunk.AKJS2NUM.js","./chunk.5AKZROMR.js","./chunk.MIE4TJRW.js","./chunk.QRQ5WPZI.js","./chunk.RD2FSSLV.js","./chunk.37RFCHSS.js","./chunk.SO6NT5K7.js","./chunk.MUSMNKE4.js","./chunk.SJQPTDAT.js","./chunk.JQ63N4MZ.js","./chunk.Z3O2VZAJ.js","./chunk.A5PSEU3W.js","./chunk.SDO3U72B.js","./chunk.ZEZUKRC6.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.JEC5FDKX.js"))),ye=()=>he().then(e=>void(k=e),()=>new Promise(e=>setTimeout(e,2e3)).then(ye)),pe=j(ye),ke=e=>!!e&&k===void 0;function Ae({onReady:e,fetch:n}){return(0,h.useLayoutEffect)(()=>void n().then(e),[e,n]),null}var ge=0;function xe(e){let[n,t]=(0,h.useState)(()=>k);(0,h.useEffect)(()=>{if(!e||n)return;let i=!1;return pe().then(()=>{i||t(k)}),()=>{i=!0}},[e,n]);let r=(0,h.useMemo)(()=>ge+=1,[e]);return{over:(0,h.useMemo)(()=>{let i=n??k;if(!e||!i)return;let{source:s,worker:d,...l}=e,c={...l,worker:d??{source:s},draft:!0};return{name:e.manifest.name,home:e.manifest.attach==="home",register:g=>i.registerWorkerView(g,c)}},[e,n]),n:r}}var we=[];function me(e,n,t){let[r,a]=(0,h.useState)(we);return(0,h.useEffect)(()=>{let i=()=>void pe().then(()=>a(n.forked()));if(n?.forked)return n.forked().length>0&&i(),n.onChange?.(i)},[n]),(0,h.useMemo)(()=>r.length>0&&k?r.reduce((i,s)=>k.registerWorkerView(i,{manifest:s.manifest,worker:{source:s.source}}),V(_(t),e)):e,[e,r,t])}var p=F(G(),1),Le=e=>typeof e=="object"?e:{};function Ne({rootRef:e,firstLook:n,app:t}){let r=(0,o.useCallback)(()=>e.current,[e]);return n?(0,p.jsx)(ce,{firstLook:n,root:r,app:t}):null}function De(e,n,t){let{app:r}=e,a=(0,o.useMemo)(()=>{let s=se(n(r.schema,r.viewSpecs),r),d=t?Se(s,t):s,l=e.views?e.views(r.schema,d):s,c=l===d?s:V(s,l);return de(c,r.schema,ae(e.brand??r.brand,r.schema)),t?t.register(c):c},[e.views,r.schema,r.viewSpecs,r.lenses,r.pages,r.home,t]),i=me(a,e.keptViews,r.schema);return Z(i,e.keptViews)}function Se(e,n){let t={...e,register(r,a,i,s){return s?.name!==n.name&&e.register(r,a,i,s),t},...e.home?{home:(r,a)=>(n.home||e.home(r,a),t)}:{}};return t}var B=e=>e?e.getBoundingClientRect().height:0;function Te(e,n,t){let r=(0,o.useRef)(t);r.current=t;let a=t!==void 0;(0,o.useLayoutEffect)(()=>{let i=e.current;if(!i||!a)return;let s=()=>{let m=[...i.children],w=m.find(v=>v.hasAttribute("data-graview-app-bar")),f=m.find(v=>v.hasAttribute("data-embed-content")),S=f?.querySelector("[data-embed-measure]")??null,u=m.find(v=>v.hasAttribute("data-graview-place-line"));return{strip:w,line:u,content:f,measure:S}},d=-1,l=()=>{let{strip:m,line:w,content:f,measure:S}=s(),u=Math.ceil(B(m)+B(w)+B(S||f));u!==d&&(d=u,r.current?.(u))};if(l(),typeof ResizeObserver>"u")return;let c=new ResizeObserver(l),g=()=>{c.disconnect();let{strip:m,line:w,content:f,measure:S}=s();for(let u of[i,m,w,f,S])u&&c.observe(u)};g();let R=new MutationObserver(()=>{g(),l()});return R.observe(i,{childList:!0}),()=>{c.disconnect(),R.disconnect()}},[e,n,a])}var Ie=480,ve=0;function Ke(e){let{app:n,seed:t,scheme:r="auto",brand:a=n.brand,fonts:i=!0,height:s="100%",label:d}=e,l=(0,o.useRef)(null);U(l);let c=s==="viewport"?"100dvh":s,g=X(typeof c=="string"&&/vh\b/.test(c)),R=(0,o.useMemo)(()=>`graview-embed-${++ve}`,[]),m=(0,o.useMemo)(()=>e.store??e.remote?.store??O(n,t),[e.store,e.remote,n,t]),w=e.presence??e.remote?.presence,f=e.hostContext?.theme,S=ue(r==="auto"&&f===void 0,a?.scheme),u=r==="auto"?f??S:r,v=(0,o.useMemo)(()=>W(u,a,{scope:`.${R}`}),[u,a,R]);J(e.favicon?I(e.assetsAt,T(a)):void 0),Q(e.favicon?a:void 0),(0,o.useEffect)(()=>{if(!i||typeof document>"u")return;let b=le(a);if(!b||document.querySelector(`link[href="${b}"]`))return;let y=document.createElement("link");y.rel="stylesheet",y.href=b,document.head.appendChild(y)},[a,i]);let C=(0,o.useRef)(void 0);(0,o.useLayoutEffect)(()=>{let b=l.current,y=C.current;if(C.current=d,!b||!d)return;let P=E=>{let A=E.getAttribute("aria-label")??"",x=y&&y!==d?A.startsWith(`${y} \xB7 `)?A.slice(y.length+3):A===y?"":A:A;x===d&&(E.getAttribute("role")==="region"||E.tagName==="SECTION"&&!E.hasAttribute("role"))&&E.setAttribute("role","group");let D=x.startsWith(`${d} \xB7 `)||x===d?x:x?`${d} \xB7 ${x}`:d;D!==A&&E.setAttribute("aria-label",D)},L=()=>b.querySelectorAll("aside, nav, main, header, footer, section[aria-label]:not([role]), [role=region], [role=complementary], [role=navigation], [role=search]").forEach(E=>{E.hasAttribute("data-graview-named-by-lens")||P(E)});L();let N=new MutationObserver(L);return N.observe(b,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["aria-label"]}),()=>N.disconnect()},[d]);let H=g?`${c}`.replace(/([\d.]+)[sdl]?vh\b/g,(b,y)=>`${+y*g/100}px`):c;return{rootRef:l,scope:R,css:v,scheme:u,store:m,presence:w,brand:a,auto:s==="auto",height:H}}function We({rootRef:e,board:n,onReport:t,where:r}){let a=(0,o.useCallback)(()=>e.current?.querySelector("[data-embed-content]")??e.current,[e]),i=(0,o.useRef)(r);i.current=r;let s=(0,o.useMemo)(()=>t?{tell:t,where:()=>i.current()}:void 0,[t]);return(0,p.jsx)(Y,{board:n,anchor:a,report:s})}function $e(e){let n=e.split(/[?#]/)[0].split("/").filter(Boolean).map(t=>{try{return decodeURIComponent(t)}catch{return t}});return n.length===0?{place:"home"}:n[0]==="places"?{place:n[1]??"places"}:{place:n[0],...n[1]!==void 0?{record:n[1]}:{}}}function Ge(e,n,t){return{brand:t,locale:e.locale,timeZone:e.timeZone,principal:e.principal,seats:e.seats,presence:n,typing:e.remote?.typing,people:e.people,memory:e.memory,presenceTtlMs:e.presenceTtlMs,onKeepLens:e.onKeepLens,onProposeChange:e.onProposeChange,composeChange:e.composeChange,onDraftChange:e.onDraftChange,ai:e.ai,files:e.files,assetsAt:e.assetsAt,resolveApp:e.resolveApp,history:e.history,linkedRecords:e.linkedRecords,subscriptions:e.subscriptions,dismissals:e.dismissals,whileAway:e.whileAway,notifications:e.notifications,onNotificationsSeen:e.onNotificationsSeen,workflowRuns:e.workflowRuns,keptViews:e.keptViews,onExport:e.onExport,signIn:e.signIn,menuSections:e.menuSections,app:e.app}}function qe({name:e,heading:n,faces:t,at:r,without:a,home:i,reach:s,standing:d,hostActions:l,barActions:c,appMenu:g,schemeChoice:R,share:m,status:w,keeping:f,onFind:S,named:u=!0}){let{brand:v,store:C,principal:H,views:b}=q();z();let y=a?.has("places")?[]:ee({store:C,principal:H,views:b}),P=oe();return(0,p.jsx)(te,{brand:v,name:e,named:u,description:v?.subtitle,heading:n,faces:t,home:i,places:y,current:r===null?null:ne(y,r),reach:s,onFind:S,...t||r===null?{scenePlaces:P}:{},...c?{actions:c}:{},...g?{appMenu:g}:{},...R?{scheme:R}:{},...m?{share:m}:{},...w?{status:w}:{},tools:(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(ie,{clean:d}),(0,p.jsx)(re,{...l?{hostActions:l}:{},...f?{keeping:f}:{}})]})})}var ze=e=>({appMenu:e.appMenu,share:e.share,status:e.status,schemeChoice:e.schemeChoice,notifications:e.notifications});function _e(e){return{...e.appMenu?{appMenu:e.appMenu}:{},...e.share?{share:e.share}:{},...e.status?{status:e.status}:{},...e.schemeChoice?{schemeChoice:e.schemeChoice}:{},...e.notifications?{notifications:e.notifications}:{}}}var je=e=>e===!1?2:Math.min(e+1,6);function Ze(e){let[n,t]=(0,o.useState)(e),r=(0,o.useRef)(void 0),a=(0,o.useRef)(void 0),i=(0,o.useMemo)(()=>({go:r,at:t,pending:a}),[]),s=(0,o.useCallback)(d=>{if(r.current){r.current(d);return}a.current=d,t(d)},[]);return{at:n,setAt:t,steering:i,steer:s}}function be(e){let n=typeof e=="object"&&e!==null?e.name:void 0;return{name:typeof n=="string"&&n.length>0?n:typeof e=="object"?"Error":typeof e}}var M=()=>typeof performance<"u"?performance.now():Date.now();function Ue(e,n){let t=(0,o.useRef)({onError:e,face:n});return t.current={onError:e,face:n},(0,o.useCallback)((r,a)=>t.current.onError?.(be(r),{module:a.module,face:t.current.face}),[])}function Je(e,n){let t=(0,o.useRef)(null);t.current===null&&(t.current=M());let r=(0,o.useRef)({onReady:e,face:n});r.current={onReady:e,face:n};let a=(0,o.useRef)(!1);return(0,o.useCallback)(i=>{a.current||(a.current=!0,r.current.onReady?.({ms:Math.max(0,M()-(t.current??M())),face:i}))},[])}var fe=class extends o.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(n,t){console.error(`[graview] ${this.props.module} threw while rendering`,n,t.componentStack),this.props.report(n,{module:this.props.module})}render(){return this.state.failed?(0,p.jsxs)("div",{role:"alert","data-graview-face-error":this.props.module,...this.props.content?{"data-embed-content":""}:{},style:this.props.content?{flex:"1 1 auto",display:"grid",alignContent:"center",justifyItems:"center",gap:8,padding:24,background:"var(--graview-ground)",color:"var(--graview-ink)",fontSize:"0.9375rem"}:{display:"inline-flex",alignItems:"center",gap:6,fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:[(0,p.jsx)("span",{children:this.props.content?"This part of the app could not draw.":"Could not draw."}),(0,p.jsx)("button",{type:"button",onClick:()=>this.setState({failed:!1}),style:{padding:"3px 11px",fontSize:"0.8125rem"},children:"Try again"})]}):this.props.children}};export{pe as a,ke as b,Ae as c,xe as d,Le as e,Ne as f,De as g,Te as h,Ie as i,Ke as j,We as k,$e as l,Ge as m,qe as n,ze as o,_e as p,je as q,Ze as r,Ue as s,Je as t,fe as u};
|
|
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 le,b as O,c as ue}from"./chunk.JV432T4Q.js";import{B as re,D as oe,F as ae,H as ie,L as se,N as de,Q as ce,i as J,j as Q,l as X,r as Y,u as ee,v as ne,z as te}from"./chunk.H3IGXHZR.js";import{a as W}from"./chunk.7TDML5YU.js";import{Aa as j,G as $,Ma as Z,Ta as U,W as G,ea as q,ga as z,ya as _,za as V}from"./chunk.3VEZ5MOC.js";import{a as K}from"./chunk.SDO3U72B.js";import{$c as T,dd as I}from"./chunk.6AANHELP.js";import{b as F}from"./chunk.AJZBJBMO.js";var o=F($(),1);var h=F($(),1),k,he=K(()=>(__graviewPreload(import.meta.url,["./chunk.ZRBGYXAO.js","./chunk.CEQQIW7Z.js","./chunk.MK5RPEB2.js","./chunk.TOUSIUJF.js","./chunk.QDVGHI7R.js","./chunk.KUCBNMIY.js","./chunk.TVWK3SGD.js","./chunk.MIE4TJRW.js","./chunk.CFE3MHWZ.js","./chunk.RD2FSSLV.js","./chunk.HXTKBISQ.js","./chunk.TFJA4QV4.js","./chunk.HWFJQ42Y.js","./chunk.QUETLFBJ.js","./chunk.JULD4XFB.js","./chunk.GRTBEA7O.js","./chunk.3VEZ5MOC.js","./chunk.SDO3U72B.js","./chunk.6AANHELP.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.QYPU444Y.js"))),ye=()=>he().then(e=>void(k=e),()=>new Promise(e=>setTimeout(e,2e3)).then(ye)),pe=j(ye),ke=e=>!!e&&k===void 0;function Ae({onReady:e,fetch:n}){return(0,h.useLayoutEffect)(()=>void n().then(e),[e,n]),null}var ge=0;function xe(e){let[n,t]=(0,h.useState)(()=>k);(0,h.useEffect)(()=>{if(!e||n)return;let i=!1;return pe().then(()=>{i||t(k)}),()=>{i=!0}},[e,n]);let r=(0,h.useMemo)(()=>ge+=1,[e]);return{over:(0,h.useMemo)(()=>{let i=n??k;if(!e||!i)return;let{source:s,worker:d,...l}=e,c={...l,worker:d??{source:s},draft:!0};return{name:e.manifest.name,home:e.manifest.attach==="home",register:g=>i.registerWorkerView(g,c)}},[e,n]),n:r}}var we=[];function me(e,n,t){let[r,a]=(0,h.useState)(we);return(0,h.useEffect)(()=>{let i=()=>void pe().then(()=>a(n.forked()));if(n?.forked)return n.forked().length>0&&i(),n.onChange?.(i)},[n]),(0,h.useMemo)(()=>r.length>0&&k?r.reduce((i,s)=>k.registerWorkerView(i,{manifest:s.manifest,worker:{source:s.source}}),V(_(t),e)):e,[e,r,t])}var p=F(G(),1),Le=e=>typeof e=="object"?e:{};function Ne({rootRef:e,firstLook:n,app:t}){let r=(0,o.useCallback)(()=>e.current,[e]);return n?(0,p.jsx)(ce,{firstLook:n,root:r,app:t}):null}function De(e,n,t){let{app:r}=e,a=(0,o.useMemo)(()=>{let s=se(n(r.schema,r.viewSpecs),r),d=t?Se(s,t):s,l=e.views?e.views(r.schema,d):s,c=l===d?s:V(s,l);return de(c,r.schema,ae(e.brand??r.brand,r.schema)),t?t.register(c):c},[e.views,r.schema,r.viewSpecs,r.lenses,r.pages,r.home,t]),i=me(a,e.keptViews,r.schema);return Z(i,e.keptViews)}function Se(e,n){let t={...e,register(r,a,i,s){return s?.name!==n.name&&e.register(r,a,i,s),t},...e.home?{home:(r,a)=>(n.home||e.home(r,a),t)}:{}};return t}var B=e=>e?e.getBoundingClientRect().height:0;function Te(e,n,t){let r=(0,o.useRef)(t);r.current=t;let a=t!==void 0;(0,o.useLayoutEffect)(()=>{let i=e.current;if(!i||!a)return;let s=()=>{let m=[...i.children],w=m.find(v=>v.hasAttribute("data-graview-app-bar")),f=m.find(v=>v.hasAttribute("data-embed-content")),S=f?.querySelector("[data-embed-measure]")??null,u=m.find(v=>v.hasAttribute("data-graview-place-line"));return{strip:w,line:u,content:f,measure:S}},d=-1,l=()=>{let{strip:m,line:w,content:f,measure:S}=s(),u=Math.ceil(B(m)+B(w)+B(S||f));u!==d&&(d=u,r.current?.(u))};if(l(),typeof ResizeObserver>"u")return;let c=new ResizeObserver(l),g=()=>{c.disconnect();let{strip:m,line:w,content:f,measure:S}=s();for(let u of[i,m,w,f,S])u&&c.observe(u)};g();let R=new MutationObserver(()=>{g(),l()});return R.observe(i,{childList:!0}),()=>{c.disconnect(),R.disconnect()}},[e,n,a])}var Ie=480,ve=0;function Ke(e){let{app:n,seed:t,scheme:r="auto",brand:a=n.brand,fonts:i=!0,height:s="100%",label:d}=e,l=(0,o.useRef)(null);U(l);let c=s==="viewport"?"100dvh":s,g=X(typeof c=="string"&&/vh\b/.test(c)),R=(0,o.useMemo)(()=>`graview-embed-${++ve}`,[]),m=(0,o.useMemo)(()=>e.store??e.remote?.store??O(n,t),[e.store,e.remote,n,t]),w=e.presence??e.remote?.presence,f=e.hostContext?.theme,S=ue(r==="auto"&&f===void 0,a?.scheme),u=r==="auto"?f??S:r,v=(0,o.useMemo)(()=>W(u,a,{scope:`.${R}`}),[u,a,R]);J(e.favicon?I(e.assetsAt,T(a)):void 0),Q(e.favicon?a:void 0),(0,o.useEffect)(()=>{if(!i||typeof document>"u")return;let b=le(a);if(!b||document.querySelector(`link[href="${b}"]`))return;let y=document.createElement("link");y.rel="stylesheet",y.href=b,document.head.appendChild(y)},[a,i]);let C=(0,o.useRef)(void 0);(0,o.useLayoutEffect)(()=>{let b=l.current,y=C.current;if(C.current=d,!b||!d)return;let P=E=>{let A=E.getAttribute("aria-label")??"",x=y&&y!==d?A.startsWith(`${y} \xB7 `)?A.slice(y.length+3):A===y?"":A:A;x===d&&(E.getAttribute("role")==="region"||E.tagName==="SECTION"&&!E.hasAttribute("role"))&&E.setAttribute("role","group");let D=x.startsWith(`${d} \xB7 `)||x===d?x:x?`${d} \xB7 ${x}`:d;D!==A&&E.setAttribute("aria-label",D)},L=()=>b.querySelectorAll("aside, nav, main, header, footer, section[aria-label]:not([role]), [role=region], [role=complementary], [role=navigation], [role=search]").forEach(E=>{E.hasAttribute("data-graview-named-by-lens")||P(E)});L();let N=new MutationObserver(L);return N.observe(b,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["aria-label"]}),()=>N.disconnect()},[d]);let H=g?`${c}`.replace(/([\d.]+)[sdl]?vh\b/g,(b,y)=>`${+y*g/100}px`):c;return{rootRef:l,scope:R,css:v,scheme:u,store:m,presence:w,brand:a,auto:s==="auto",height:H}}function We({rootRef:e,board:n,onReport:t,where:r}){let a=(0,o.useCallback)(()=>e.current?.querySelector("[data-embed-content]")??e.current,[e]),i=(0,o.useRef)(r);i.current=r;let s=(0,o.useMemo)(()=>t?{tell:t,where:()=>i.current()}:void 0,[t]);return(0,p.jsx)(Y,{board:n,anchor:a,report:s})}function $e(e){let n=e.split(/[?#]/)[0].split("/").filter(Boolean).map(t=>{try{return decodeURIComponent(t)}catch{return t}});return n.length===0?{place:"home"}:n[0]==="places"?{place:n[1]??"places"}:{place:n[0],...n[1]!==void 0?{record:n[1]}:{}}}function Ge(e,n,t){return{brand:t,locale:e.locale,timeZone:e.timeZone,principal:e.principal,seats:e.seats,presence:n,typing:e.remote?.typing,people:e.people,memory:e.memory,presenceTtlMs:e.presenceTtlMs,onKeepLens:e.onKeepLens,onProposeChange:e.onProposeChange,composeChange:e.composeChange,onDraftChange:e.onDraftChange,ai:e.ai,files:e.files,assetsAt:e.assetsAt,resolveApp:e.resolveApp,history:e.history,linkedRecords:e.linkedRecords,subscriptions:e.subscriptions,dismissals:e.dismissals,whileAway:e.whileAway,notifications:e.notifications,onNotificationsSeen:e.onNotificationsSeen,workflowRuns:e.workflowRuns,keptViews:e.keptViews,onExport:e.onExport,signIn:e.signIn,menuSections:e.menuSections,app:e.app}}function qe({name:e,heading:n,faces:t,at:r,without:a,home:i,reach:s,standing:d,hostActions:l,barActions:c,appMenu:g,schemeChoice:R,share:m,status:w,keeping:f,onFind:S,named:u=!0}){let{brand:v,store:C,principal:H,views:b}=q();z();let y=a?.has("places")?[]:ee({store:C,principal:H,views:b}),P=oe();return(0,p.jsx)(te,{brand:v,name:e,named:u,description:v?.subtitle,heading:n,faces:t,home:i,places:y,current:r===null?null:ne(y,r),reach:s,onFind:S,...t||r===null?{scenePlaces:P}:{},...c?{actions:c}:{},...g?{appMenu:g}:{},...R?{scheme:R}:{},...m?{share:m}:{},...w?{status:w}:{},tools:(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(ie,{clean:d}),(0,p.jsx)(re,{...l?{hostActions:l}:{},...f?{keeping:f}:{}})]})})}var ze=e=>({appMenu:e.appMenu,share:e.share,status:e.status,schemeChoice:e.schemeChoice,notifications:e.notifications});function _e(e){return{...e.appMenu?{appMenu:e.appMenu}:{},...e.share?{share:e.share}:{},...e.status?{status:e.status}:{},...e.schemeChoice?{schemeChoice:e.schemeChoice}:{},...e.notifications?{notifications:e.notifications}:{}}}var je=e=>e===!1?2:Math.min(e+1,6);function Ze(e){let[n,t]=(0,o.useState)(e),r=(0,o.useRef)(void 0),a=(0,o.useRef)(void 0),i=(0,o.useMemo)(()=>({go:r,at:t,pending:a}),[]),s=(0,o.useCallback)(d=>{if(r.current){r.current(d);return}a.current=d,t(d)},[]);return{at:n,setAt:t,steering:i,steer:s}}function be(e){let n=typeof e=="object"&&e!==null?e.name:void 0;return{name:typeof n=="string"&&n.length>0?n:typeof e=="object"?"Error":typeof e}}var M=()=>typeof performance<"u"?performance.now():Date.now();function Ue(e,n){let t=(0,o.useRef)({onError:e,face:n});return t.current={onError:e,face:n},(0,o.useCallback)((r,a)=>t.current.onError?.(be(r),{module:a.module,face:t.current.face}),[])}function Je(e,n){let t=(0,o.useRef)(null);t.current===null&&(t.current=M());let r=(0,o.useRef)({onReady:e,face:n});r.current={onReady:e,face:n};let a=(0,o.useRef)(!1);return(0,o.useCallback)(i=>{a.current||(a.current=!0,r.current.onReady?.({ms:Math.max(0,M()-(t.current??M())),face:i}))},[])}var fe=class extends o.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(n,t){console.error(`[graview] ${this.props.module} threw while rendering`,n,t.componentStack),this.props.report(n,{module:this.props.module})}render(){return this.state.failed?(0,p.jsxs)("div",{role:"alert","data-graview-face-error":this.props.module,...this.props.content?{"data-embed-content":""}:{},style:this.props.content?{flex:"1 1 auto",display:"grid",alignContent:"center",justifyItems:"center",gap:8,padding:24,background:"var(--graview-ground)",color:"var(--graview-ink)",fontSize:"0.9375rem"}:{display:"inline-flex",alignItems:"center",gap:6,fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:[(0,p.jsx)("span",{children:this.props.content?"This part of the app could not draw.":"Could not draw."}),(0,p.jsx)("button",{type:"button",onClick:()=>this.setState({failed:!1}),style:{padding:"3px 11px",fontSize:"0.8125rem"},children:"Try again"})]}):this.props.children}};export{pe as a,ke as b,Ae as c,xe as d,Le as e,Ne as f,De as g,Te as h,Ie as i,Ke as j,We as k,$e as l,Ge as m,qe as n,ze as o,_e as p,je as q,Ze as r,Ue as s,Je as t,fe as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as n}from"./chunk.4YAO3A5Q.js";import"./chunk.4DXPPM6T.js";import"./chunk.DLSS56EU.js";import"./chunk.7WPVLEX2.js";import"./chunk.Q355UPFG.js";import{o as s}from"./chunk.DGDW54KE.js";import"./chunk.LMTG5NPG.js";import"./chunk.YBQ5GVAX.js";import"./chunk.EB7PZJEO.js";import"./chunk.42KHFGN6.js";import"./chunk.RQG672MJ.js";import"./chunk.Q6H5HESF.js";import"./chunk.3JMQKANL.js";import"./chunk.42C3FIKK.js";import"./chunk.2ME4DVBI.js";import"./chunk.XXCHO2A5.js";import"./chunk.SADR3MQI.js";import"./chunk.MB7LKKUD.js";import"./chunk.ODYJEDIW.js";import"./chunk.IPGLITWA.js";import"./chunk.LFFJB6D3.js";import"./chunk.DMZRFXH7.js";import"./chunk.DZ6UDZOB.js";import"./chunk.O5FTWXA2.js";import"./chunk.Q4VFLLUT.js";import"./chunk.6ZENHSTQ.js";import"./chunk.CNN32262.js";import"./chunk.BJUUSIQY.js";import"./chunk.N5Z34V7U.js";import"./chunk.LOKGUALC.js";import"./chunk.XOZU4OFA.js";import"./chunk.EP5JS7ZH.js";import"./chunk.WVUJXDXZ.js";import"./chunk.L7XKYGV7.js";import"./chunk.CE3NKAF7.js";import"./chunk.R3GE37OI.js";import"./chunk.2KCDLCB2.js";import"./chunk.UD7VLXPM.js";import"./chunk.3DEWQDP7.js";import"./chunk.MIE4TJRW.js";import"./chunk.CFE3MHWZ.js";import"./chunk.RD2FSSLV.js";import"./chunk.HXTKBISQ.js";import"./chunk.TFJA4QV4.js";import"./chunk.HWFJQ42Y.js";import"./chunk.QUETLFBJ.js";import"./chunk.JULD4XFB.js";import"./chunk.GRTBEA7O.js";import"./chunk.H3IGXHZR.js";import"./chunk.7TDML5YU.js";import{G as y,W as i}from"./chunk.3VEZ5MOC.js";import"./chunk.SDO3U72B.js";import"./chunk.6AANHELP.js";import"./chunk.FQLNBIQ5.js";import{b as r}from"./chunk.AJZBJBMO.js";var c=r(y(),1),e=r(i(),1);function v({store:d,views:t,as:a,scope:o}){let l=(0,c.useMemo)(()=>s({scope:`.${o}`}),[o]);return(0,e.jsxs)("div",{"data-testid":"embed-picture","data-embed-content":"",tabIndex:0,"aria-label":t.places().find(m=>m.as===a)?.title??"The picture",style:{flex:"1 1 auto",minHeight:0,display:"grid",gridTemplateRows:"minmax(0, 1fr)",overflow:"auto",background:"var(--graview-ground)",color:"var(--graview-ink)",fontFamily:"var(--graview-font-body, system-ui)"},children:[(0,e.jsx)("style",{children:l}),(0,e.jsx)(n,{store:d,views:t,as:a})]})}export{v as PictureFace};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as te}from"./chunk.
|
|
1
|
+
import{a as te}from"./chunk.TOUSIUJF.js";import{b as H,c as ee}from"./chunk.QDVGHI7R.js";import"./chunk.KUCBNMIY.js";import{la as U,oa as X,ua as Y,uc as Q,ya as z}from"./chunk.6AANHELP.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";function ue(t){let n=t?.indexOf(":")??-1;if(!(!t||n<=0||n===t.length-1))return{relation:t.slice(0,n),record:t.slice(n+1)}}function re(t,n){if(t.length===0)return!0;let d=`${n.split("/")[0]}/*`;return t.some(a=>a==="*"||a==="*/*"||a===n||a===d)}function ie(t,n){let d=n.startsWith("image/")?"image":n.startsWith("video/")?"video":"file";return t.find(a=>a.as===d)??t.find(a=>a.as==="file")}function pe(t,n){let d=new Set(t.map(w=>w.as==="image"?"image/":w.as==="video"?"video/":""));if(d.has("")||n.kinds.length===0)return n.kinds.join(",");let a=[];for(let w of d){let p=n.kinds.filter(l=>l.startsWith(w));a.push(...p.length>0?p:[`${w}*`])}return a.join(",")}var W=t=>t.input?.shape??{},ae=(t,n)=>W(t)[n]?.safeParse(void 0).success===!1;function se(t,n){let d=new Set(H(t.input).map(a=>a.name));return Object.keys(W(t)).filter(a=>!n.has(a)&&!d.has(a)&&ae(t,a)&&W(t)[a].safeParse("a name").success&&!W(t)[a].safeParse(1).success)}var me=t=>t.replace(/\.[a-z0-9]{1,5}$/i,"")||t,oe=(t,n)=>{let d=Number.isFinite(Date.parse(n))?new Date(Date.parse(n)).toISOString():n;return[n,d,d.replace(/\.\d{3}Z$/,"Z"),n.slice(0,10)].find(a=>t.safeParse(a).success)},ge="2026-01-01T00:00:00.000Z";function ne(t,n){let d=W(t),a=new Set(se(t,n)),w=Object.keys(d).filter(l=>!n.has(l)&&!a.has(l)&&ae(t,l)),p=w.filter(l=>oe(d[l],ge)!==void 0);return{timed:p,left:w.filter(l=>!p.includes(l))}}function de(t,n,d,a,w){let p=e=>({ok:!1,says:e}),{kind:l}=a,R=(d.accepts??[]).filter(e=>e.kind===l&&(a.field===void 0||e.field===a.field));if(R.length===0)return p(a.field===void 0?`The view's accepts names no field of "${l}", so nothing dropped there can become one.`:`The view's accepts does not name ${l}'s "${a.field}".`);let k=w.files;if(!k||!(k.maxBytes>0))return p("This host takes no files.");let O=R.flatMap(e=>{let r=te(t,e.kind,e.field);return r?[{field:e.field,...r}]:[]}),v=O.filter(e=>e.as==="file"||k.kinds.length===0||k.kinds.some(r=>r==="*"||r==="*/*"||r.startsWith(e.as==="image"?"image/":"video/")));if(v.length===0)return p(`This host takes none of what ${l}'s ${O.map(e=>`"${e.field}"`).join(" or ")} holds.`);let c=a.connect===void 0?void 0:ue(a.connect);if(a.connect!==void 0&&(!c||w.shown.has(a.connect)))return p(`data-drop-connect is "<relation>:<record id>", not "${a.connect}".`);if(c&&!w.shown.has(c.record))return p(`data-drop-connect names "${c.record}", which this view was not shown.`);let m=c?t.seenBy(n).graph.getNode(c.record):void 0;if(c&&!m)return p(`data-drop-connect names "${c.record}", which this seat does not see.`);let $=e=>Object.hasOwn(t.schema.tryDefinition(e)?.edges??{},c.relation),D=c?$(l):!1;if(c&&!D&&!$(m.kind))return p(`Neither a "${l}" nor a "${m.kind}" has the relation "${c.relation}".`);let K=t.allMutations(),S=e=>t.permits(e,n).ok,J=e=>v.every(r=>Object.hasOwn(W(e),r.field)),V=K.filter(e=>(e.creates??[]).includes(l)&&J(e)),F=Y(t.schema.tryDefinition(l),l),T=X(t.schema,l).toLowerCase(),E=m?U(t.schema.tryDefinition(m.kind),m):void 0,B=e=>`${e===1?`a ${F}`:`${e} ${T}`}${E?` to ${E}`:""}`,q=e=>`Add ${B(e)}`,C=e=>`Added ${B(e)}.`,N=`Drop to add ${T}${E?` to ${E}`:""}.`,I=(e,r,h,g)=>{let A=new Set(Object.keys(r)),b=z(h.at)??g??new Date().toISOString();for(let L of ne(e,A).timed)r[L]=oe(W(e)[L],b);for(let L of se(e,A))r[L]=me(h.name);return r},Z=(e,...r)=>new Set([...v.map(h=>h.field),...r,...H(e.input).map(h=>h.name)]),x=(e,...r)=>ne(e,Z(e,...r)).left,i=(e,r)=>p(`"${e.title??e.name}" asks for ${r.map(h=>`"${h}"`).join(" and ")}, which no dropped file says, so nothing dropped here can become a ${F}.`),o=(e,r)=>e.list?[r]:r,f={ok:!0,kind:l,fields:v,accept:pe(v,k),...c?{connect:c}:{},intent:q,invite:N,added:C};if(!c){let e=V.find(r=>!r.subject&&S({name:r.name,args:{}}));return e?x(e).length>0?i(e,x(e)):{...f,calls:r=>[{name:e.name,args:I(e,{[r.field]:o(v.find(h=>h.field===r.field),r.value)},r.value,r.at)}]}:p(`This seat may not make a "${l}" here.`)}let s=V.find(e=>e.subject&&(e.subject.kinds==="*"||e.subject.kinds.includes(m.kind))&&(e.connects??[]).includes(c.relation)&&S({name:e.name,args:{[e.subject.arg]:c.record}}));if(s){let e=s.subject.arg;return x(s,e).length>0?i(s,x(s,e)):{...f,calls:r=>[{name:s.name,args:I(s,{[e]:c.record,[r.field]:o(v.find(h=>h.field===r.field),r.value)},r.value,r.at)}]}}let u=V.find(e=>!e.subject&&S({name:e.name,args:{}}));if(!u)return p(`This seat may not make a "${l}" here.`);if(x(u).length>0)return i(u,x(u));let y=D?l:m.kind,P=D?m.kind:l,M=K.find(e=>{if(!(e.connects??[]).includes(c.relation)||!e.subject)return!1;let r=e.subject.kinds;if(r!=="*"&&!r.includes(y))return!1;let h=H(e.input).find(g=>g.name!==e.subject.arg&&(g.kinds.includes("*")||g.kinds.includes(P)));return h?S({name:e.name,args:D?{[h.name]:c.record}:{[e.subject.arg]:c.record}}):!1});if(!M)return p(`This seat may not link a "${l}" to ${c.record} by "${c.relation}".`);let G=M.subject.arg,_=H(M.input).find(e=>e.name!==G&&(e.kinds.includes("*")||e.kinds.includes(P))).name;return{...f,calls:(e,r)=>[{name:u.name,args:I(u,{[e.field]:o(v.find(h=>h.field===e.field),e.value)},e.value,e.at)},{name:M.name,args:D?{[G]:Q(r*2),[_]:c.record}:{[G]:c.record,[_]:Q(r*2)}}]}}var le=t=>t.type.startsWith("image/"),ye=t=>t.type.startsWith("video/"),he=`
|
|
2
2
|
[data-graview-drop-over] { outline: 2px dashed var(--graview-accent, Highlight) !important; outline-offset: 2px !important; background-color: color-mix(in srgb, var(--graview-accent, Highlight) 10%, transparent) !important; }
|
|
3
3
|
[data-graview-drop-status], [data-graview-drop-refused] { margin: 4px 0 0; font: 0.8125rem/1.4 var(--graview-font-body, system-ui, sans-serif); color: var(--graview-ink-muted, GrayText); }
|
|
4
4
|
[data-graview-drop-refused] { color: var(--graview-warn, var(--graview-ink, CanvasText)); }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as p}from"./chunk.
|
|
1
|
+
import{b as p}from"./chunk.TOUSIUJF.js";import{vc as g}from"./chunk.6AANHELP.js";function w(n){let r=n.policy?.sees??[];if(r.length===0)return!0;let t=o=>o.fields===void 0&&(o.hide?.length??0)===0;return n.schema.kinds.every(o=>r.some(s=>s.roles==="*"&&!s.own&&!s.via&&t(s)&&s.kinds.includes(o)))}function b(n){let r=n;for(let t=0;t<8&&r?._zod?.def;t+=1){let o=r._zod.def;if(o.type==="enum")return Object.values(o.entries);if(o.type==="literal")return o.values;if(!("innerType"in o))return;r=o.innerType}}var c=(n,r)=>({ok:!1,reason:n,message:r});function k(n,r){return p(n).find(t=>(t.as??t.act)===r)??p(n).find(t=>t.act===r&&t.as===void 0)}var m=n=>typeof n=="object"&&n!==null&&!Array.isArray(n)&&"href"in n;function S(n,r,t,o,s){let l=k(r,t);if(!l)return c("undeclared",`This view may not ask for \u201C${t}\u201D: its manifest does not name it.`);let u={},f=new Map;for(let[a,d]of Object.entries(o)){let y=i=>{if(!m(i))return i;let e=typeof i.href=="string"?s?.file(i.href):void 0;if(!e)throw c("malformed",`\u201C${a}\u201D is a file the host did not hand this view: a view hands an act a file the person dropped (event.files), or one a record it was shown holds, as it was handed.`);let h=s?.dropped(e.href);if(h){if(f.has(e.href))throw c("malformed",`\u201C${a}\u201D hands the act a dropped file it already carries: each file a person dropped goes in one act, once.`);f.set(e.href,h)}return e};try{u[a]=Array.isArray(d)?d.map(y):y(d)}catch(i){return i}}if(!w(n)){let a=new Set([...f.values()].map(e=>e.target)),d=a.size===1?[...a][0]:void 0,y=e=>m(e)&&typeof e.href=="string"&&f.has(e.href)||g(e)||d!==void 0&&e===d&&s?.shown.has(d)===!0;return f.size>0&&a.size===1&&Object.values(u).every(e=>Array.isArray(e)?e.every(y):y(e))?{ok:!0,name:l.act,args:{...u,...l.constants??{}},spent:[...f.keys()]}:c("press-only","In this app some members may not see some records, so a view's act applies only when you press it.")}return{ok:!0,name:l.act,args:{...u,...l.constants??{}}}}export{w as a,b,c,k as d,S as e};
|
|
@@ -1 +1 @@
|
|
|
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{r as We}from"./chunk.LRNFE3UK.js";import{a as ae,b as Oe,f as Ne,i as ze}from"./chunk.SFBHPYRD.js";import{a as Le,e as Re,l as De}from"./chunk.ILJDLBPJ.js";import{b as $e,c as O,d as qe,e as Ee}from"./chunk.X226YATK.js";import"./chunk.BJUUSIQY.js";import{a as He,b as Ie,c as Pe}from"./chunk.MSAYU25L.js";import{a as Me}from"./chunk.QF5QB5YR.js";import"./chunk.EGPCVMDU.js";import"./chunk.M7KXQGQL.js";import"./chunk.XOZU4OFA.js";import"./chunk.H3EGBDW2.js";import"./chunk.6KJGRM7A.js";import"./chunk.SO6NT5K7.js";import"./chunk.MUSMNKE4.js";import"./chunk.SJQPTDAT.js";import"./chunk.JQ63N4MZ.js";import"./chunk.Z3O2VZAJ.js";import{e as Te,m as Ce}from"./chunk.QNP5OR3P.js";import"./chunk.4W57E7AX.js";import{G as Je,J as be,La as xe,W as Se,ea as Ae}from"./chunk.A5PSEU3W.js";import{a as ve}from"./chunk.SDO3U72B.js";import{eb as ke,oa as ye,td as we}from"./chunk.ZEZUKRC6.js";import"./chunk.FQLNBIQ5.js";import{b as ie}from"./chunk.AJZBJBMO.js";var s=ie(Je(),1);var r=ie(Se(),1),N=xe(ve(()=>(__graviewPreload(import.meta.url,["./chunk.X226YATK.js","./chunk.BJUUSIQY.js","./chunk.6KJGRM7A.js","./chunk.Z3O2VZAJ.js","./chunk.QNP5OR3P.js","./chunk.4W57E7AX.js","./chunk.A5PSEU3W.js","./chunk.SDO3U72B.js","./chunk.ZEZUKRC6.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.CKDCTFLU.js")))),Xe=N.part((a,i)=>(0,r.jsx)(a.RateTelling,{...i}),{quiet:!0}),Ze=a=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>setTimeout(a,0)):setTimeout(a,0)},et=()=>`tl-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,tt=/^(yes|yep|yeah|sure|ok(ay)?|do it|go ahead|please do)\b/i,nt=/^(no|nope|don'?t|not now|never ?mind)\b/i;function it(a,i,o){let t=i.on==="list"||i.on==="lens"?i.kind:void 0;if(i.on==="selection")return i.ids;if(i.on!=="list"&&i.on!=="lens")return[];if(o==="pages"&&typeof document<"u"){let y=new Set;for(let u of document.querySelectorAll("main [data-graview-listed], main [data-graview-record], main [data-graview-pick]")){let m=u.getAttribute("data-graview-listed")??u.getAttribute("data-graview-record")??u.getAttribute("data-graview-pick"),b=m?a.graph.getNode(m):void 0;m&&b&&(t===void 0||b.kind===t)&&y.add(m)}if(y.size>0)return[...y]}return t?a.graph.allNodes().filter(y=>y.kind===t).map(y=>y.id):[]}var at=new Set(["show","go","to","open","the","a","an","me"]),Fe=a=>a.toLowerCase().normalize("NFKD").replace(/[̀-ͯ]/g,""),oe=(a,i)=>{let o=Fe(a);return i.every(t=>o.includes(t))},Ge=a=>a&&!/^.\p{Lu}/u.test(a)?`${a[0].toLowerCase()}${a.slice(1)}`:a,X={act:4,show:3,place:3,record:4},Ke=360,f=12;function $t({face:a,opening:i,close:o}){let t=Me(),{setMenuAt:y,aiHere:u,session:m,people:b,seats:E,onProposeChange:C,composeChange:$}=Ae(),[g,q]=(0,s.useState)({state:"offered"}),l=(0,s.useMemo)(()=>i.target??$e(i.pointed??{about:[]},e=>t.store.graph.has(e)),[i,t.store]),z=(0,s.useMemo)(()=>Re(t.store,l,t.places),[t.store,l,t.places]),[A,Q]=(0,s.useState)(""),[B,F]=(0,s.useState)(-1),[p,re]=(0,s.useState)(null),[se,ee]=(0,s.useState)(null),K=(0,s.useRef)(null),le=(0,s.useRef)(null),Y=(0,s.useRef)(null),j=(0,s.useId)(),I=(0,s.useRef)(!0),{ghost:de}=be(t.desk),[te,Qe]=(0,s.useState)(null),P=(0,s.useRef)(null),H=(0,s.useCallback)(e=>{let n=P.current;!n||!t.ai.told||(n.kept&&N.current?N.current.changeTelling(t.ai.told,n.id,e):n.queued={...n.queued,...e})},[t.ai.told]);(0,s.useEffect)(()=>{let e=t.ai.told;if(!e)return;let n=globalThis,d=()=>void N.load().then(w=>w.toldListed(e),()=>{});if(n.requestIdleCallback){let w=n.requestIdleCallback(d,{timeout:1500});return()=>n.cancelIdleCallback?.(w)}let T=setTimeout(d,200);return()=>clearTimeout(T)},[t.ai.told]),(0,s.useEffect)(()=>()=>{I.current=!1;let e=P.current,n=t.desk.get().ghost;e&&!(n&&n.ghost.interaction===e.interaction&&n.batch===void 0)&&H({outcome:"abandoned"});let d=t.desk.get().ghost;d?.onCard&&t.desk.setGhost({...d,onCard:!1})},[t.desk]);let ce=p!==null;(0,s.useEffect)(()=>{if(!ce)return;let e=O(l)[0]??(l.on==="list"?`kind:${l.kind}`:l.on==="lens"&&l.kind?`kind:${l.kind}`:null),n=t.principal,d=n.id?ke(n,{graph:t.store.graph,schema:t.store.schema,...E?{seats:E}:{},...b?{people:b}:{}}):void 0;return u({participant:`agent:graview-for-${n.id??"anyone"}:${m}`,kind:"agent",name:"Graview",...n.id?{onBehalfOf:n.id,...d?{onBehalfOfName:d}:{}}:{},over:e,robot:{at:e,mode:"thinking"}}),()=>u(null)},[ce]);let U=(0,s.useMemo)(()=>{let e=ae(t,l);return qe(t.store,l,{principal:t.principal,places:t.places,...e.acts?{acts:e.acts}:{}})},[t,l]),ue=(0,s.useMemo)(()=>{let e=O(l);if(e.length===0)return[];let n=new Set(U.candidates.flatMap(d=>d.type==="act"?[d.mutation]:[]));return He(t.store,e,{principal:t.principal,...e.length===1?{focus:e[0]}:{}}).affordances.filter(d=>!d.destructive&&n.has(d.mutation))},[t.store,t.principal,l,U]),V=(0,s.useCallback)(()=>{let e=i.returnTo,n=Be(K.current,l,a);o(),requestAnimationFrame(()=>{if(e?.isConnected&&!e.closest("[inert]"))return e.focus({preventScroll:!0});let d=(n&&n.tabIndex>=0?n:null)??document.querySelector("[data-graview-page-title]")??document.querySelector("main");d&&d.tabIndex<0&&!d.hasAttribute("tabindex")&&d.setAttribute("tabindex","-1"),d?.focus({preventScroll:!0})})},[i.returnTo,l,a,o]),pe=(0,s.useCallback)(e=>{if(e.open.length>0){let n=K.current?.getBoundingClientRect();o(),y({x:n?.left??0,y:n?.top??0,on:e.args.id??O(l)[0],about:O(l)});return}try{Pe(t.store,e,{},{pressed:t.principal?{author:t.principal}:{}}),Ie(t.store,e,{},{author:t.principal}),V()}catch(n){ee(n instanceof Error?n.message:String(n))}},[t.store,t.principal,o,V,y,l]),_=(0,s.useCallback)(async e=>{let n=e.trim();if(!n)return;let d=p?.result?.answer?{said:p.said,answer:p.result.answer,...p.result.reading?{reading:p.result.reading.which}:{}}:void 0,T=l.on==="lens"?t.places.find(M=>M.as===l.place)?.title:(l.on==="list",void 0);Q(""),F(-1),ee(null),re({said:n,result:null}),q({state:"offered"});let w=it(t.store,l,a),S=P.current;S&&H({outcome:"abandoned"});let c=Date.now(),k=t.ai.told?N.current??await Promise.race([N.load().catch(()=>{}),new Promise(M=>setTimeout(M,50))]):void 0,R=t.ai.told&&k?k.examplesHere(t.ai.told,t.store,t.principal,n,l):{examples:[],ids:[]},Ve=[...new Set([...S?[]:i.suggested?[i.suggested]:[],...R.ids])],v=await De(t.ai,{...ae(t,l,n),said:n,...d?{follows:d}:{},...w.length>0?{members:w}:{},...T?{where:T}:{},...R.examples.length>0?{examples:R.examples}:{}});t.desk.record(v.interaction),v.ghost&&v.ghost.proposals.length>0&&t.desk.setGhost({ghost:v.ghost,onCard:!0});let W;if(v.missing)try{let{planFor:M}=await (__graviewPreload(import.meta.url,["./chunk.X226YATK.js","./chunk.BJUUSIQY.js","./chunk.6KJGRM7A.js","./chunk.Z3O2VZAJ.js","./chunk.ZEZUKRC6.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.7ARRVNUR.js")),G=Date.now(),me=T??(v.reading&&v.reading.which==="held"&&l.on==="record"?v.reading.words.replace(/^the \d+ \S+ in /,""):void 0);W=await M(t,{said:n,missing:v.missing,members:v.reading?.records??w,host:C!==void 0,...$?{compose:$}:{},...me?{where:me}:{}}),t.desk.record({...v.interaction,stages:[...v.interaction.stages??[],{stage:"compose",ms:Date.now()-G}]})}catch{W={refused:`${v.missing.said} That change could not be made here.`}}I.current&&re({said:n,result:v,...W?{plan:W}:{}});let J=t.ai.told;if(!J)return;let _e=Date.now()-c;P.current?.stop?.();let ne={id:et(),conversation:S?.conversation??"",interaction:v.interaction.id};P.current={...ne,conversation:ne.conversation||ne.id};let D=P.current;Ze(()=>void N.load().then(M=>{let G=M.keepTelling(J,{...M.tellingDraftOf(t.store,{words:n,target:l,result:v,...W?{plan:W}:{},ms:_e,...S?{conversation:S.conversation,follows:S.id}:{},examples:Ve}),id:D.id,conversation:D.conversation},t.principal);G&&(D.kept=!0,D.queued&&M.changeTelling(J,G.id,D.queued),D.stop=M.watchTelling(t.desk,J,G),I.current&&P.current===D&&Qe(G))},()=>{}))},[p,t,l,a,C,$,i.suggested,H]),L=p?.plan&&"question"in p.plan?p.plan:void 0,ge=(0,s.useCallback)(async()=>{let e=L?.proposal;if(!(!e||!C||g.state!=="offered")){q({state:"applying"});try{let n=await C(e);if(!I.current)return;H({outcome:n==="declined"?"declined":"accepted"}),q(n==="declined"?{state:"declined",said:"The host declined this change to the app."}:{state:"applied",...typeof n=="object"?{undo:n.undo,...n.note?{note:n.note}:{}}:{}})}catch(n){I.current&&q({state:"declined",said:n instanceof Error?n.message:String(n)})}}},[L,C,g,H]),fe=(0,s.useCallback)(()=>{H({outcome:"declined"}),q({state:"declined",said:"Left as it is."})},[H]),Ye=(0,s.useCallback)(async()=>{g.state!=="applied"||!g.undo||(await g.undo(),H({outcome:"undone"}),I.current&&q({state:"undone"}))},[g,H]),he=(0,s.useRef)(i.asked);(0,s.useEffect)(()=>{let e=he.current;he.current=void 0,e&&_(e)},[]);let x=(0,s.useMemo)(()=>{let e=A.trim();if(!e&&p)return[];let n=Fe(e).split(/\s+/).filter(c=>c&&!at.has(c)),d=/^show\b/i.test(e),T=/^(go|open)\b/i.test(e),w=[];if(!d&&!T)for(let c of ue.filter(k=>oe(k.label,n)).slice(0,X.act))w.push({id:`act:${c.id}`,kind:"act",label:c.label,hint:c.open.length>0?"asks more":"do it",take:()=>pe(c)});let S=e&&!/\?\s*$/.test(e)?Ee(t.store,l,{principal:t.principal,places:t.places,said:e}):[];for(let c of S)w.push({id:`place:${c.place}`,kind:"place",label:c.fit==="full"?`Open ${c.title}`:`Open and adjust ${c.title}`,hint:c.fit==="full"?"a view you have":"adjust it",take:()=>{o(),t.goTo.place(c.place),c.fit==="partial"&&Te(t.desk,{target:{on:"lens",place:c.place,...c.kind?{kind:c.kind}:{}},asked:e})}});if(!T){let c=U.candidates.filter(k=>k.type==="panel");for(let k of c.filter(R=>oe(`show ${R.label}`,n)).slice(0,X.show))w.push({id:k.id,kind:"show",label:`Show ${Ge(k.label)}`,hint:"a panel",take:()=>{o(),Oe(t,{title:k.label,recipe:{...k.panel,title:k.label}})}})}if(!d){for(let c of t.places.filter(k=>oe(k.title,n)&&!S.some(R=>R.place===k.as)).slice(0,X.place))w.push({id:`place:${c.as}`,kind:"place",label:`Go to ${c.title}`,take:()=>(o(),t.goTo.place(c.as))});if(n.length>0){let c=We(t.store,e.replace(/^(go to|open)\s+/i,""),{principal:t.principal,from:O(l),limit:X.record}).hits;for(let k of c)k.about==="node"&&w.push({id:`record:${k.id}`,kind:"record",label:k.label,hint:ye(t.store.schema,k.kind),take:()=>(o(),t.goTo.record(k.id))})}}return e&&w.push({id:"ask",kind:"ask",label:e,take:()=>void _(e)}),w},[A,ue,U,t,l,pe,_,o,p]);(0,s.useEffect)(()=>F(A.trim()?0:-1),[A]),(0,s.useLayoutEffect)(()=>{let e=K.current;if(!e)return;if(typeof e.showPopover=="function")try{e.showPopover()}catch{}le.current?.focus({preventScroll:!0});let n=0,d=null,T=i.from;T&&rt(e,T);let w=()=>{let S=Be(e,l,a);T?st(e,S):ot(e,S);let c=Y.current?S:null;d!==c&&(d?.removeAttribute("data-graview-ai-thinking"),c?.setAttribute("data-graview-ai-thinking",""),d=c),Y.current&<(Y.current,c),n=requestAnimationFrame(w)};return w(),()=>{cancelAnimationFrame(n),d?.removeAttribute("data-graview-ai-thinking")}},[l,a,i.from]),(0,s.useEffect)(()=>{if(p)return;let e=n=>{n.target instanceof Node&&K.current?.contains(n.target)||o()};return document.addEventListener("pointerdown",e,!0),()=>document.removeEventListener("pointerdown",e,!0)},[p,o]);let je=e=>{if(e.key==="ArrowDown"&&x.length>0)e.preventDefault(),F(n=>Math.min(x.length-1,n+1));else if(e.key==="ArrowUp"&&x.length>0)e.preventDefault(),F(n=>Math.max(0,n-1));else if(e.key==="Enter"){e.preventDefault();let n=x[B];n?n.take():L?.proposal&&g.state==="offered"&&tt.test(A.trim())?(Q(""),ge()):L&&g.state==="offered"&&nt.test(A.trim())?(Q(""),fe()):A.trim()&&_(A)}},h=p?.result??null,Ue=x[B];return(0,r.jsxs)("section",{ref:K,popover:"manual",role:"region","aria-label":p?`Answer about ${z}`:`Tell Graview about ${z}`,"data-testid":"quick-ask","data-quick-ask":p?"answer":"bar","data-quick-ask-face":a,"data-graview-offstage":"","data-graview-overlay":"",onKeyDown:e=>{e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),V())},onMouseDown:e=>e.stopPropagation(),style:pt,children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:8},children:[(0,r.jsxs)("p",{"data-testid":"quick-ask-about",style:{margin:0,flex:"1 1 auto",minWidth:0,fontSize:"0.75rem",color:"var(--graview-ink-muted)",overflowWrap:"anywhere"},children:["About ",z]}),(0,r.jsx)("button",{type:"button","data-testid":"quick-ask-close","aria-label":"Close",title:"Close",onClick:V,style:gt,children:(0,r.jsx)("span",{"aria-hidden":"true",children:"\u2715"})})]}),p?(0,r.jsxs)("div",{"data-testid":"quick-answer",style:{display:"grid",gap:8},children:[(0,r.jsxs)("p",{"data-testid":"quick-answer-asked",style:{margin:0,fontSize:"0.8125rem",color:"var(--graview-ink-muted)",fontStyle:"italic",overflowWrap:"anywhere"},children:["\u201C",p.said,"\u201D"]}),(0,r.jsx)("p",{"data-testid":"quick-answer-text","aria-live":"polite",style:{margin:0,fontSize:"0.9375rem",lineHeight:1.45,color:h?.interaction.outcome==="failed"?"var(--graview-warn)":"var(--graview-ink)",overflowWrap:"anywhere"},children:h===null?"Thinking\u2026":h.interaction.outcome==="failed"?h.interaction.failed??"The AI could not answer that here.":Le(p.plan?"question"in p.plan?p.plan.question:p.plan.refused:h.answer,h.ghost&&h.ghost.proposals.length>0?"Here is what I would change.":h.offers.length>0?"These may help.":void 0)}),h?.taken?(0,r.jsxs)("p",{"data-testid":"quick-ask-taken",style:{margin:0,fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:["Taking \u201C",h.taken.said,"\u201D as ",h.taken.as,"."]}):null,h?.reading?.close?(0,r.jsxs)("p",{"data-testid":"quick-ask-reading",style:{margin:0,fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:["Taking this as ",h.reading.words,"."]}):null,L?(0,r.jsxs)("section",{"data-testid":"quick-ask-plan","data-plan-state":g.state,"aria-label":"What I would do",style:ut,children:[(0,r.jsx)("ol",{style:{margin:0,paddingInlineStart:18,display:"grid",gap:2},children:L.parts.map((e,n)=>(0,r.jsx)("li",{"data-plan-part":e.part,style:{fontStyle:g.state==="applied"?"normal":"italic"},children:e.said},n))}),L.proposal&&C?g.state==="offered"||g.state==="applying"?(0,r.jsxs)("div",{style:{display:"flex",gap:6},children:[(0,r.jsx)("button",{type:"button","data-testid":"quick-ask-plan-yes",disabled:g.state==="applying",onClick:()=>void ge(),style:Z,children:"Yes"}),(0,r.jsx)("button",{type:"button","data-testid":"quick-ask-plan-no",disabled:g.state==="applying",onClick:fe,style:Z,children:"No"})]}):g.state==="applied"?(0,r.jsxs)("div",{role:"status",style:{display:"flex",gap:6,alignItems:"center"},children:[(0,r.jsxs)("span",{"data-testid":"quick-ask-plan-done",children:["Done, as one change.",g.note?` ${g.note}`:""]}),g.undo?(0,r.jsx)("button",{type:"button","data-testid":"quick-ask-plan-undo",onClick:()=>void Ye(),style:Z,children:"Undo"}):null]}):(0,r.jsx)("p",{role:"status",style:{margin:0,color:"var(--graview-ink-muted)"},children:g.state==="undone"?"Taken back.":g.said}):null]}):null,h&&h.offers.length>0?(0,r.jsx)("ul",{"aria-label":"What acts on it",style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:6},children:h.offers.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)("button",{type:"button","data-testid":"quick-answer-offer","data-ai-offer":e.id,"data-ai-offer-type":e.type,onClick:()=>{Ne(t,h,e,o,{onCard:e.type==="act"||e.type==="fill"}).then(n=>{n&&I.current&&ee(n)})},style:Z,children:e.type==="panel"?`Show ${Ge(e.label)}`:e.type==="place"?`Go to ${e.label}`:e.type==="act"||e.type==="fill"?`${e.label.replace(/[.?]$/,"")}?`:e.label})},e.id))}):null,de?.onCard&&de.ghost.interaction===h?.interaction.id?(0,r.jsx)(ze,{placement:"card"}):null,h&&te&&t.ai.told&&te.interaction===h.interaction.id?(0,r.jsx)(Xe,{told:t.ai.told,telling:te}):null]}):null,(0,r.jsxs)("div",{style:{display:"grid",gap:4},children:[(0,r.jsx)("input",{ref:le,type:"text",role:"combobox","data-testid":"quick-ask-input","aria-label":p?`Reply about ${z}`:`Tell Graview about ${z}, or go somewhere`,"aria-expanded":x.length>0,"aria-controls":j,"aria-autocomplete":"list",...Ue?{"aria-activedescendant":`${j}-${B}`}:{},autoComplete:"off",enterKeyHint:"go",placeholder:p?"Reply\u2026":"Tell Graview, or go to\u2026",value:A,readOnly:p!==null&&h===null,"aria-busy":p!==null&&h===null,onChange:e=>Q(e.target.value),onKeyDown:je,style:ft}),(0,r.jsx)("div",{id:j,role:"listbox","aria-label":A.trim()?`What \u201C${A.trim()}\u201D finds here`:"What can be done here",hidden:x.length===0,style:{display:x.length===0?"none":"grid",gap:1,maxHeight:280,overflowY:"auto"},children:x.map((e,n)=>(0,r.jsx)("div",{id:`${j}-${n}`,role:"option","aria-selected":n===B,"data-testid":"quick-ask-option","data-quick-ask-kind":e.kind,"data-quick-ask-row":e.id,onMouseEnter:()=>F(n),onMouseDown:d=>d.preventDefault(),onClick:e.take,style:{...ht,background:n===B?"var(--graview-panel-muted)":"transparent",...e.kind==="ask"?{borderTop:"1px solid var(--graview-edge)",marginTop:2}:{}},children:e.kind==="ask"?(0,r.jsxs)("span",{children:["Tell Graview: ",(0,r.jsxs)("span",{style:{fontWeight:600},children:["\u2018",e.label,"\u2019"]})]}):(0,r.jsxs)("span",{children:[e.label,e.hint?(0,r.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",e.hint]}):null]})},e.id))})]}),se?(0,r.jsx)("p",{role:"alert","data-testid":"quick-ask-refused",style:{margin:0,fontSize:"0.8125rem",color:"var(--graview-warn)"},children:se}):null,(0,r.jsx)("span",{style:Ce,"aria-live":"polite",children:x.length>0&&A.trim()?`${x.length} ${x.length===1?"way":"ways"} to go on`:""}),p!==null&&h===null?(0,r.jsxs)("span",{ref:Y,role:"status","data-testid":"ai-thinking-mark",style:dt,children:[(0,r.jsx)("style",{children:"@keyframes graview-thinking{from{opacity:.35}to{opacity:1}}@media (prefers-reduced-motion:reduce){[data-testid=ai-thinking-mark]>span{animation:none!important}}"}),(0,r.jsx)("span",{"aria-hidden":"true",style:ct}),(0,r.jsxs)("span",{children:["Thinking about ",z,"\u2026"]})]}):null]})}function Be(a,i,o){let t=a?.closest("[data-graview-embed]")??document,y=i.on==="list"?[`aggregate:${i.kind}`,`kind:${i.kind}`]:i.on==="lens"&&i.kind?[`aggregate:${i.kind}`]:O(i);for(let u of y)for(let m of t.querySelectorAll(`[data-graview-view="${CSS.escape(u)}"], [data-graview-pick="${CSS.escape(u)}"], [data-graview-record="${CSS.escape(u)}"], [data-graview-listed="${CSS.escape(u)}"]`)){if(a?.contains(m))continue;let b=m.getBoundingClientRect();if(b.width>0&&b.height>0)return m}return o==="pages"?t.querySelector("main [data-graview-page-title]")??t.querySelector("main h1"):null}function ot(a,i){let o={width:document.documentElement.clientWidth||innerWidth,height:innerHeight},t=Math.min(Ke,o.width-2*f),y=a.getBoundingClientRect().height,u=i?.getBoundingClientRect(),m,b,E,C=l=>Math.max(f,Math.min(l,o.height-y-f));if(u&&u.width>0&&u.bottom>0&&u.top<o.height)if(u.right+f+t<=o.width-f)m=u.right+f,b=C(u.top),E="right";else if(u.left-f-t>=f)m=u.left-f-t,b=C(u.top),E="left";else{m=Math.max(f,Math.min(u.left,o.width-t-f));let l=u.bottom+f;b=l+y<=o.height-f?l:C(u.top-f-y),E=l+y<=o.height-f?"below":"above"}else m=(o.width-t)/2,b=C(72),E="top";let $=a.style,g={left:`${Math.round(m)}px`,top:`${Math.round(b)}px`,width:`${Math.round(t)}px`};$.left!==g.left&&($.left=g.left),$.top!==g.top&&($.top=g.top),$.width!==g.width&&($.width=g.width);let q=i?.getAttribute("data-graview-view")??i?.getAttribute("data-graview-pick")??i?.getAttribute("data-graview-record")??i?.getAttribute("data-graview-listed")??(i?"page":"");a.getAttribute("data-quick-ask-beside")!==q&&a.setAttribute("data-quick-ask-beside",q),a.getAttribute("data-quick-ask-side")!==E&&a.setAttribute("data-quick-ask-side",E)}function rt(a,i){let o={width:document.documentElement.clientWidth||innerWidth,height:innerHeight},t=Math.min(Ke,o.width-2*f),y=i.left+t>o.width-f?Math.max(f,o.width-f-t):Math.max(f,i.left),u=240,m=i.top+u>o.height-f?Math.max(f,o.height-f-u):Math.max(f,i.top);a.style.left=`${Math.round(y)}px`,a.style.top=`${Math.round(m)}px`,a.style.width=`${Math.round(t)}px`,a.style.maxHeight=`${Math.round(o.height-m-f)}px`,a.setAttribute("data-quick-ask-side","where-the-menu-stood"),a.setAttribute("data-quick-ask-from",`${Math.round(i.left)},${Math.round(i.top)}`)}function st(a,i){let o=i?.getAttribute("data-graview-view")??i?.getAttribute("data-graview-pick")??i?.getAttribute("data-graview-record")??i?.getAttribute("data-graview-listed")??(i?"page":"");a.getAttribute("data-quick-ask-beside")!==o&&a.setAttribute("data-quick-ask-beside",o)}function lt(a,i){let o=i?.getBoundingClientRect(),t=i?.getAttribute("data-graview-view")??i?.getAttribute("data-graview-pick")??i?.getAttribute("data-graview-record")??i?.getAttribute("data-graview-listed")??(i?"page":"");if(a.getAttribute("data-thinking-on")!==t&&a.setAttribute("data-thinking-on",t),!o||o.width===0){a.style.visibility!=="hidden"&&(a.style.visibility="hidden");return}let y=a.getBoundingClientRect().width,u=`${Math.round(Math.max(f/2,o.right-y-6))}px`,m=`${Math.round(Math.max(f/2,o.top-10))}px`;a.style.left!==u&&(a.style.left=u),a.style.top!==m&&(a.style.top=m),a.style.visibility!=="visible"&&(a.style.visibility="visible")}var dt={position:"fixed",visibility:"hidden",display:"inline-flex",alignItems:"center",gap:6,padding:"2px 8px",borderRadius:999,fontSize:"0.75rem",lineHeight:1.4,whiteSpace:"nowrap",color:"var(--graview-ink)",background:"var(--graview-float)",border:"1px dashed var(--graview-accent)",boxShadow:"var(--graview-lift-low)",pointerEvents:"none"},ct={width:7,height:7,borderRadius:999,background:"var(--graview-accent)",animation:"graview-thinking 1s ease-in-out infinite alternate"},ut={display:"grid",gap:8,padding:10,borderRadius:10,border:"1px dashed var(--graview-accent)",fontSize:"0.875rem"},pt={position:"fixed",inset:"auto",height:"auto",margin:0,zIndex:we("popover"),boxSizing:"border-box",display:"grid",gap:10,padding:12,borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",color:"var(--graview-ink)",boxShadow:"var(--graview-lift-high)",maxHeight:"calc(100dvh - 24px)",overflowY:"auto",fontSize:"0.875rem"},gt={display:"inline-grid",placeItems:"center",width:28,height:28,padding:0,font:"inherit",fontSize:"0.875rem",lineHeight:1,color:"var(--graview-ink-muted)",background:"transparent",border:"1px solid transparent",borderRadius:6,boxShadow:"none",cursor:"pointer"},ft={boxSizing:"border-box",width:"100%",height:36,padding:"0 10px",font:"inherit",fontSize:"max(1rem,16px)",color:"var(--graview-ink)",background:"var(--graview-panel)",border:"1px solid var(--graview-edge)",borderRadius:8},ht={display:"flex",alignItems:"center",minHeight:30,padding:"4px 8px",borderRadius:6,cursor:"pointer",overflowWrap:"anywhere"},Z={display:"inline-flex",alignItems:"center",minHeight:30,padding:"2px 10px",font:"inherit",fontSize:"0.8125rem",borderRadius:8};export{$t as QuickAskCard};
|
|
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{r as We}from"./chunk.SADR3MQI.js";import{a as ae,b as Oe,f as Ne,i as ze}from"./chunk.AQ2PI6MR.js";import{a as Le,e as Re,l as De}from"./chunk.H3W5C3XQ.js";import{b as $e,c as O,d as qe,e as Ee}from"./chunk.6WB2TYK7.js";import"./chunk.BJUUSIQY.js";import{a as He,b as Ie,c as Pe}from"./chunk.N5Z34V7U.js";import{a as Me}from"./chunk.YL2RBZFE.js";import"./chunk.LOKGUALC.js";import"./chunk.JGRSUTPJ.js";import"./chunk.XOZU4OFA.js";import"./chunk.EP5JS7ZH.js";import"./chunk.CE3NKAF7.js";import"./chunk.TFJA4QV4.js";import"./chunk.HWFJQ42Y.js";import"./chunk.QUETLFBJ.js";import"./chunk.JULD4XFB.js";import"./chunk.GRTBEA7O.js";import{e as Te,m as Ce}from"./chunk.H3IGXHZR.js";import"./chunk.7TDML5YU.js";import{G as Je,J as be,La as xe,W as Se,ea as Ae}from"./chunk.3VEZ5MOC.js";import{a as ve}from"./chunk.SDO3U72B.js";import{eb as ke,oa as ye,td as we}from"./chunk.6AANHELP.js";import"./chunk.FQLNBIQ5.js";import{b as ie}from"./chunk.AJZBJBMO.js";var s=ie(Je(),1);var r=ie(Se(),1),N=xe(ve(()=>(__graviewPreload(import.meta.url,["./chunk.6WB2TYK7.js","./chunk.BJUUSIQY.js","./chunk.CE3NKAF7.js","./chunk.GRTBEA7O.js","./chunk.H3IGXHZR.js","./chunk.7TDML5YU.js","./chunk.3VEZ5MOC.js","./chunk.SDO3U72B.js","./chunk.6AANHELP.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.ZLNUZ6LR.js")))),Xe=N.part((a,i)=>(0,r.jsx)(a.RateTelling,{...i}),{quiet:!0}),Ze=a=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>setTimeout(a,0)):setTimeout(a,0)},et=()=>`tl-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,tt=/^(yes|yep|yeah|sure|ok(ay)?|do it|go ahead|please do)\b/i,nt=/^(no|nope|don'?t|not now|never ?mind)\b/i;function it(a,i,o){let t=i.on==="list"||i.on==="lens"?i.kind:void 0;if(i.on==="selection")return i.ids;if(i.on!=="list"&&i.on!=="lens")return[];if(o==="pages"&&typeof document<"u"){let y=new Set;for(let u of document.querySelectorAll("main [data-graview-listed], main [data-graview-record], main [data-graview-pick]")){let m=u.getAttribute("data-graview-listed")??u.getAttribute("data-graview-record")??u.getAttribute("data-graview-pick"),b=m?a.graph.getNode(m):void 0;m&&b&&(t===void 0||b.kind===t)&&y.add(m)}if(y.size>0)return[...y]}return t?a.graph.allNodes().filter(y=>y.kind===t).map(y=>y.id):[]}var at=new Set(["show","go","to","open","the","a","an","me"]),Fe=a=>a.toLowerCase().normalize("NFKD").replace(/[̀-ͯ]/g,""),oe=(a,i)=>{let o=Fe(a);return i.every(t=>o.includes(t))},Ge=a=>a&&!/^.\p{Lu}/u.test(a)?`${a[0].toLowerCase()}${a.slice(1)}`:a,X={act:4,show:3,place:3,record:4},Ke=360,f=12;function $t({face:a,opening:i,close:o}){let t=Me(),{setMenuAt:y,aiHere:u,session:m,people:b,seats:E,onProposeChange:C,composeChange:$}=Ae(),[g,q]=(0,s.useState)({state:"offered"}),l=(0,s.useMemo)(()=>i.target??$e(i.pointed??{about:[]},e=>t.store.graph.has(e)),[i,t.store]),z=(0,s.useMemo)(()=>Re(t.store,l,t.places),[t.store,l,t.places]),[A,Q]=(0,s.useState)(""),[B,F]=(0,s.useState)(-1),[p,re]=(0,s.useState)(null),[se,ee]=(0,s.useState)(null),K=(0,s.useRef)(null),le=(0,s.useRef)(null),Y=(0,s.useRef)(null),j=(0,s.useId)(),I=(0,s.useRef)(!0),{ghost:de}=be(t.desk),[te,Qe]=(0,s.useState)(null),P=(0,s.useRef)(null),H=(0,s.useCallback)(e=>{let n=P.current;!n||!t.ai.told||(n.kept&&N.current?N.current.changeTelling(t.ai.told,n.id,e):n.queued={...n.queued,...e})},[t.ai.told]);(0,s.useEffect)(()=>{let e=t.ai.told;if(!e)return;let n=globalThis,d=()=>void N.load().then(w=>w.toldListed(e),()=>{});if(n.requestIdleCallback){let w=n.requestIdleCallback(d,{timeout:1500});return()=>n.cancelIdleCallback?.(w)}let T=setTimeout(d,200);return()=>clearTimeout(T)},[t.ai.told]),(0,s.useEffect)(()=>()=>{I.current=!1;let e=P.current,n=t.desk.get().ghost;e&&!(n&&n.ghost.interaction===e.interaction&&n.batch===void 0)&&H({outcome:"abandoned"});let d=t.desk.get().ghost;d?.onCard&&t.desk.setGhost({...d,onCard:!1})},[t.desk]);let ce=p!==null;(0,s.useEffect)(()=>{if(!ce)return;let e=O(l)[0]??(l.on==="list"?`kind:${l.kind}`:l.on==="lens"&&l.kind?`kind:${l.kind}`:null),n=t.principal,d=n.id?ke(n,{graph:t.store.graph,schema:t.store.schema,...E?{seats:E}:{},...b?{people:b}:{}}):void 0;return u({participant:`agent:graview-for-${n.id??"anyone"}:${m}`,kind:"agent",name:"Graview",...n.id?{onBehalfOf:n.id,...d?{onBehalfOfName:d}:{}}:{},over:e,robot:{at:e,mode:"thinking"}}),()=>u(null)},[ce]);let U=(0,s.useMemo)(()=>{let e=ae(t,l);return qe(t.store,l,{principal:t.principal,places:t.places,...e.acts?{acts:e.acts}:{}})},[t,l]),ue=(0,s.useMemo)(()=>{let e=O(l);if(e.length===0)return[];let n=new Set(U.candidates.flatMap(d=>d.type==="act"?[d.mutation]:[]));return He(t.store,e,{principal:t.principal,...e.length===1?{focus:e[0]}:{}}).affordances.filter(d=>!d.destructive&&n.has(d.mutation))},[t.store,t.principal,l,U]),V=(0,s.useCallback)(()=>{let e=i.returnTo,n=Be(K.current,l,a);o(),requestAnimationFrame(()=>{if(e?.isConnected&&!e.closest("[inert]"))return e.focus({preventScroll:!0});let d=(n&&n.tabIndex>=0?n:null)??document.querySelector("[data-graview-page-title]")??document.querySelector("main");d&&d.tabIndex<0&&!d.hasAttribute("tabindex")&&d.setAttribute("tabindex","-1"),d?.focus({preventScroll:!0})})},[i.returnTo,l,a,o]),pe=(0,s.useCallback)(e=>{if(e.open.length>0){let n=K.current?.getBoundingClientRect();o(),y({x:n?.left??0,y:n?.top??0,on:e.args.id??O(l)[0],about:O(l)});return}try{Pe(t.store,e,{},{pressed:t.principal?{author:t.principal}:{}}),Ie(t.store,e,{},{author:t.principal}),V()}catch(n){ee(n instanceof Error?n.message:String(n))}},[t.store,t.principal,o,V,y,l]),_=(0,s.useCallback)(async e=>{let n=e.trim();if(!n)return;let d=p?.result?.answer?{said:p.said,answer:p.result.answer,...p.result.reading?{reading:p.result.reading.which}:{}}:void 0,T=l.on==="lens"?t.places.find(M=>M.as===l.place)?.title:(l.on==="list",void 0);Q(""),F(-1),ee(null),re({said:n,result:null}),q({state:"offered"});let w=it(t.store,l,a),S=P.current;S&&H({outcome:"abandoned"});let c=Date.now(),k=t.ai.told?N.current??await Promise.race([N.load().catch(()=>{}),new Promise(M=>setTimeout(M,50))]):void 0,R=t.ai.told&&k?k.examplesHere(t.ai.told,t.store,t.principal,n,l):{examples:[],ids:[]},Ve=[...new Set([...S?[]:i.suggested?[i.suggested]:[],...R.ids])],v=await De(t.ai,{...ae(t,l,n),said:n,...d?{follows:d}:{},...w.length>0?{members:w}:{},...T?{where:T}:{},...R.examples.length>0?{examples:R.examples}:{}});t.desk.record(v.interaction),v.ghost&&v.ghost.proposals.length>0&&t.desk.setGhost({ghost:v.ghost,onCard:!0});let W;if(v.missing)try{let{planFor:M}=await (__graviewPreload(import.meta.url,["./chunk.6WB2TYK7.js","./chunk.BJUUSIQY.js","./chunk.CE3NKAF7.js","./chunk.GRTBEA7O.js","./chunk.6AANHELP.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.HH4D3JEI.js")),G=Date.now(),me=T??(v.reading&&v.reading.which==="held"&&l.on==="record"?v.reading.words.replace(/^the \d+ \S+ in /,""):void 0);W=await M(t,{said:n,missing:v.missing,members:v.reading?.records??w,host:C!==void 0,...$?{compose:$}:{},...me?{where:me}:{}}),t.desk.record({...v.interaction,stages:[...v.interaction.stages??[],{stage:"compose",ms:Date.now()-G}]})}catch{W={refused:`${v.missing.said} That change could not be made here.`}}I.current&&re({said:n,result:v,...W?{plan:W}:{}});let J=t.ai.told;if(!J)return;let _e=Date.now()-c;P.current?.stop?.();let ne={id:et(),conversation:S?.conversation??"",interaction:v.interaction.id};P.current={...ne,conversation:ne.conversation||ne.id};let D=P.current;Ze(()=>void N.load().then(M=>{let G=M.keepTelling(J,{...M.tellingDraftOf(t.store,{words:n,target:l,result:v,...W?{plan:W}:{},ms:_e,...S?{conversation:S.conversation,follows:S.id}:{},examples:Ve}),id:D.id,conversation:D.conversation},t.principal);G&&(D.kept=!0,D.queued&&M.changeTelling(J,G.id,D.queued),D.stop=M.watchTelling(t.desk,J,G),I.current&&P.current===D&&Qe(G))},()=>{}))},[p,t,l,a,C,$,i.suggested,H]),L=p?.plan&&"question"in p.plan?p.plan:void 0,ge=(0,s.useCallback)(async()=>{let e=L?.proposal;if(!(!e||!C||g.state!=="offered")){q({state:"applying"});try{let n=await C(e);if(!I.current)return;H({outcome:n==="declined"?"declined":"accepted"}),q(n==="declined"?{state:"declined",said:"The host declined this change to the app."}:{state:"applied",...typeof n=="object"?{undo:n.undo,...n.note?{note:n.note}:{}}:{}})}catch(n){I.current&&q({state:"declined",said:n instanceof Error?n.message:String(n)})}}},[L,C,g,H]),fe=(0,s.useCallback)(()=>{H({outcome:"declined"}),q({state:"declined",said:"Left as it is."})},[H]),Ye=(0,s.useCallback)(async()=>{g.state!=="applied"||!g.undo||(await g.undo(),H({outcome:"undone"}),I.current&&q({state:"undone"}))},[g,H]),he=(0,s.useRef)(i.asked);(0,s.useEffect)(()=>{let e=he.current;he.current=void 0,e&&_(e)},[]);let x=(0,s.useMemo)(()=>{let e=A.trim();if(!e&&p)return[];let n=Fe(e).split(/\s+/).filter(c=>c&&!at.has(c)),d=/^show\b/i.test(e),T=/^(go|open)\b/i.test(e),w=[];if(!d&&!T)for(let c of ue.filter(k=>oe(k.label,n)).slice(0,X.act))w.push({id:`act:${c.id}`,kind:"act",label:c.label,hint:c.open.length>0?"asks more":"do it",take:()=>pe(c)});let S=e&&!/\?\s*$/.test(e)?Ee(t.store,l,{principal:t.principal,places:t.places,said:e}):[];for(let c of S)w.push({id:`place:${c.place}`,kind:"place",label:c.fit==="full"?`Open ${c.title}`:`Open and adjust ${c.title}`,hint:c.fit==="full"?"a view you have":"adjust it",take:()=>{o(),t.goTo.place(c.place),c.fit==="partial"&&Te(t.desk,{target:{on:"lens",place:c.place,...c.kind?{kind:c.kind}:{}},asked:e})}});if(!T){let c=U.candidates.filter(k=>k.type==="panel");for(let k of c.filter(R=>oe(`show ${R.label}`,n)).slice(0,X.show))w.push({id:k.id,kind:"show",label:`Show ${Ge(k.label)}`,hint:"a panel",take:()=>{o(),Oe(t,{title:k.label,recipe:{...k.panel,title:k.label}})}})}if(!d){for(let c of t.places.filter(k=>oe(k.title,n)&&!S.some(R=>R.place===k.as)).slice(0,X.place))w.push({id:`place:${c.as}`,kind:"place",label:`Go to ${c.title}`,take:()=>(o(),t.goTo.place(c.as))});if(n.length>0){let c=We(t.store,e.replace(/^(go to|open)\s+/i,""),{principal:t.principal,from:O(l),limit:X.record}).hits;for(let k of c)k.about==="node"&&w.push({id:`record:${k.id}`,kind:"record",label:k.label,hint:ye(t.store.schema,k.kind),take:()=>(o(),t.goTo.record(k.id))})}}return e&&w.push({id:"ask",kind:"ask",label:e,take:()=>void _(e)}),w},[A,ue,U,t,l,pe,_,o,p]);(0,s.useEffect)(()=>F(A.trim()?0:-1),[A]),(0,s.useLayoutEffect)(()=>{let e=K.current;if(!e)return;if(typeof e.showPopover=="function")try{e.showPopover()}catch{}le.current?.focus({preventScroll:!0});let n=0,d=null,T=i.from;T&&rt(e,T);let w=()=>{let S=Be(e,l,a);T?st(e,S):ot(e,S);let c=Y.current?S:null;d!==c&&(d?.removeAttribute("data-graview-ai-thinking"),c?.setAttribute("data-graview-ai-thinking",""),d=c),Y.current&<(Y.current,c),n=requestAnimationFrame(w)};return w(),()=>{cancelAnimationFrame(n),d?.removeAttribute("data-graview-ai-thinking")}},[l,a,i.from]),(0,s.useEffect)(()=>{if(p)return;let e=n=>{n.target instanceof Node&&K.current?.contains(n.target)||o()};return document.addEventListener("pointerdown",e,!0),()=>document.removeEventListener("pointerdown",e,!0)},[p,o]);let je=e=>{if(e.key==="ArrowDown"&&x.length>0)e.preventDefault(),F(n=>Math.min(x.length-1,n+1));else if(e.key==="ArrowUp"&&x.length>0)e.preventDefault(),F(n=>Math.max(0,n-1));else if(e.key==="Enter"){e.preventDefault();let n=x[B];n?n.take():L?.proposal&&g.state==="offered"&&tt.test(A.trim())?(Q(""),ge()):L&&g.state==="offered"&&nt.test(A.trim())?(Q(""),fe()):A.trim()&&_(A)}},h=p?.result??null,Ue=x[B];return(0,r.jsxs)("section",{ref:K,popover:"manual",role:"region","aria-label":p?`Answer about ${z}`:`Tell Graview about ${z}`,"data-testid":"quick-ask","data-quick-ask":p?"answer":"bar","data-quick-ask-face":a,"data-graview-offstage":"","data-graview-overlay":"",onKeyDown:e=>{e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),V())},onMouseDown:e=>e.stopPropagation(),style:pt,children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:8},children:[(0,r.jsxs)("p",{"data-testid":"quick-ask-about",style:{margin:0,flex:"1 1 auto",minWidth:0,fontSize:"0.75rem",color:"var(--graview-ink-muted)",overflowWrap:"anywhere"},children:["About ",z]}),(0,r.jsx)("button",{type:"button","data-testid":"quick-ask-close","aria-label":"Close",title:"Close",onClick:V,style:gt,children:(0,r.jsx)("span",{"aria-hidden":"true",children:"\u2715"})})]}),p?(0,r.jsxs)("div",{"data-testid":"quick-answer",style:{display:"grid",gap:8},children:[(0,r.jsxs)("p",{"data-testid":"quick-answer-asked",style:{margin:0,fontSize:"0.8125rem",color:"var(--graview-ink-muted)",fontStyle:"italic",overflowWrap:"anywhere"},children:["\u201C",p.said,"\u201D"]}),(0,r.jsx)("p",{"data-testid":"quick-answer-text","aria-live":"polite",style:{margin:0,fontSize:"0.9375rem",lineHeight:1.45,color:h?.interaction.outcome==="failed"?"var(--graview-warn)":"var(--graview-ink)",overflowWrap:"anywhere"},children:h===null?"Thinking\u2026":h.interaction.outcome==="failed"?h.interaction.failed??"The AI could not answer that here.":Le(p.plan?"question"in p.plan?p.plan.question:p.plan.refused:h.answer,h.ghost&&h.ghost.proposals.length>0?"Here is what I would change.":h.offers.length>0?"These may help.":void 0)}),h?.taken?(0,r.jsxs)("p",{"data-testid":"quick-ask-taken",style:{margin:0,fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:["Taking \u201C",h.taken.said,"\u201D as ",h.taken.as,"."]}):null,h?.reading?.close?(0,r.jsxs)("p",{"data-testid":"quick-ask-reading",style:{margin:0,fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:["Taking this as ",h.reading.words,"."]}):null,L?(0,r.jsxs)("section",{"data-testid":"quick-ask-plan","data-plan-state":g.state,"aria-label":"What I would do",style:ut,children:[(0,r.jsx)("ol",{style:{margin:0,paddingInlineStart:18,display:"grid",gap:2},children:L.parts.map((e,n)=>(0,r.jsx)("li",{"data-plan-part":e.part,style:{fontStyle:g.state==="applied"?"normal":"italic"},children:e.said},n))}),L.proposal&&C?g.state==="offered"||g.state==="applying"?(0,r.jsxs)("div",{style:{display:"flex",gap:6},children:[(0,r.jsx)("button",{type:"button","data-testid":"quick-ask-plan-yes",disabled:g.state==="applying",onClick:()=>void ge(),style:Z,children:"Yes"}),(0,r.jsx)("button",{type:"button","data-testid":"quick-ask-plan-no",disabled:g.state==="applying",onClick:fe,style:Z,children:"No"})]}):g.state==="applied"?(0,r.jsxs)("div",{role:"status",style:{display:"flex",gap:6,alignItems:"center"},children:[(0,r.jsxs)("span",{"data-testid":"quick-ask-plan-done",children:["Done, as one change.",g.note?` ${g.note}`:""]}),g.undo?(0,r.jsx)("button",{type:"button","data-testid":"quick-ask-plan-undo",onClick:()=>void Ye(),style:Z,children:"Undo"}):null]}):(0,r.jsx)("p",{role:"status",style:{margin:0,color:"var(--graview-ink-muted)"},children:g.state==="undone"?"Taken back.":g.said}):null]}):null,h&&h.offers.length>0?(0,r.jsx)("ul",{"aria-label":"What acts on it",style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:6},children:h.offers.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)("button",{type:"button","data-testid":"quick-answer-offer","data-ai-offer":e.id,"data-ai-offer-type":e.type,onClick:()=>{Ne(t,h,e,o,{onCard:e.type==="act"||e.type==="fill"}).then(n=>{n&&I.current&&ee(n)})},style:Z,children:e.type==="panel"?`Show ${Ge(e.label)}`:e.type==="place"?`Go to ${e.label}`:e.type==="act"||e.type==="fill"?`${e.label.replace(/[.?]$/,"")}?`:e.label})},e.id))}):null,de?.onCard&&de.ghost.interaction===h?.interaction.id?(0,r.jsx)(ze,{placement:"card"}):null,h&&te&&t.ai.told&&te.interaction===h.interaction.id?(0,r.jsx)(Xe,{told:t.ai.told,telling:te}):null]}):null,(0,r.jsxs)("div",{style:{display:"grid",gap:4},children:[(0,r.jsx)("input",{ref:le,type:"text",role:"combobox","data-testid":"quick-ask-input","aria-label":p?`Reply about ${z}`:`Tell Graview about ${z}, or go somewhere`,"aria-expanded":x.length>0,"aria-controls":j,"aria-autocomplete":"list",...Ue?{"aria-activedescendant":`${j}-${B}`}:{},autoComplete:"off",enterKeyHint:"go",placeholder:p?"Reply\u2026":"Tell Graview, or go to\u2026",value:A,readOnly:p!==null&&h===null,"aria-busy":p!==null&&h===null,onChange:e=>Q(e.target.value),onKeyDown:je,style:ft}),(0,r.jsx)("div",{id:j,role:"listbox","aria-label":A.trim()?`What \u201C${A.trim()}\u201D finds here`:"What can be done here",hidden:x.length===0,style:{display:x.length===0?"none":"grid",gap:1,maxHeight:280,overflowY:"auto"},children:x.map((e,n)=>(0,r.jsx)("div",{id:`${j}-${n}`,role:"option","aria-selected":n===B,"data-testid":"quick-ask-option","data-quick-ask-kind":e.kind,"data-quick-ask-row":e.id,onMouseEnter:()=>F(n),onMouseDown:d=>d.preventDefault(),onClick:e.take,style:{...ht,background:n===B?"var(--graview-panel-muted)":"transparent",...e.kind==="ask"?{borderTop:"1px solid var(--graview-edge)",marginTop:2}:{}},children:e.kind==="ask"?(0,r.jsxs)("span",{children:["Tell Graview: ",(0,r.jsxs)("span",{style:{fontWeight:600},children:["\u2018",e.label,"\u2019"]})]}):(0,r.jsxs)("span",{children:[e.label,e.hint?(0,r.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",e.hint]}):null]})},e.id))})]}),se?(0,r.jsx)("p",{role:"alert","data-testid":"quick-ask-refused",style:{margin:0,fontSize:"0.8125rem",color:"var(--graview-warn)"},children:se}):null,(0,r.jsx)("span",{style:Ce,"aria-live":"polite",children:x.length>0&&A.trim()?`${x.length} ${x.length===1?"way":"ways"} to go on`:""}),p!==null&&h===null?(0,r.jsxs)("span",{ref:Y,role:"status","data-testid":"ai-thinking-mark",style:dt,children:[(0,r.jsx)("style",{children:"@keyframes graview-thinking{from{opacity:.35}to{opacity:1}}@media (prefers-reduced-motion:reduce){[data-testid=ai-thinking-mark]>span{animation:none!important}}"}),(0,r.jsx)("span",{"aria-hidden":"true",style:ct}),(0,r.jsxs)("span",{children:["Thinking about ",z,"\u2026"]})]}):null]})}function Be(a,i,o){let t=a?.closest("[data-graview-embed]")??document,y=i.on==="list"?[`aggregate:${i.kind}`,`kind:${i.kind}`]:i.on==="lens"&&i.kind?[`aggregate:${i.kind}`]:O(i);for(let u of y)for(let m of t.querySelectorAll(`[data-graview-view="${CSS.escape(u)}"], [data-graview-pick="${CSS.escape(u)}"], [data-graview-record="${CSS.escape(u)}"], [data-graview-listed="${CSS.escape(u)}"]`)){if(a?.contains(m))continue;let b=m.getBoundingClientRect();if(b.width>0&&b.height>0)return m}return o==="pages"?t.querySelector("main [data-graview-page-title]")??t.querySelector("main h1"):null}function ot(a,i){let o={width:document.documentElement.clientWidth||innerWidth,height:innerHeight},t=Math.min(Ke,o.width-2*f),y=a.getBoundingClientRect().height,u=i?.getBoundingClientRect(),m,b,E,C=l=>Math.max(f,Math.min(l,o.height-y-f));if(u&&u.width>0&&u.bottom>0&&u.top<o.height)if(u.right+f+t<=o.width-f)m=u.right+f,b=C(u.top),E="right";else if(u.left-f-t>=f)m=u.left-f-t,b=C(u.top),E="left";else{m=Math.max(f,Math.min(u.left,o.width-t-f));let l=u.bottom+f;b=l+y<=o.height-f?l:C(u.top-f-y),E=l+y<=o.height-f?"below":"above"}else m=(o.width-t)/2,b=C(72),E="top";let $=a.style,g={left:`${Math.round(m)}px`,top:`${Math.round(b)}px`,width:`${Math.round(t)}px`};$.left!==g.left&&($.left=g.left),$.top!==g.top&&($.top=g.top),$.width!==g.width&&($.width=g.width);let q=i?.getAttribute("data-graview-view")??i?.getAttribute("data-graview-pick")??i?.getAttribute("data-graview-record")??i?.getAttribute("data-graview-listed")??(i?"page":"");a.getAttribute("data-quick-ask-beside")!==q&&a.setAttribute("data-quick-ask-beside",q),a.getAttribute("data-quick-ask-side")!==E&&a.setAttribute("data-quick-ask-side",E)}function rt(a,i){let o={width:document.documentElement.clientWidth||innerWidth,height:innerHeight},t=Math.min(Ke,o.width-2*f),y=i.left+t>o.width-f?Math.max(f,o.width-f-t):Math.max(f,i.left),u=240,m=i.top+u>o.height-f?Math.max(f,o.height-f-u):Math.max(f,i.top);a.style.left=`${Math.round(y)}px`,a.style.top=`${Math.round(m)}px`,a.style.width=`${Math.round(t)}px`,a.style.maxHeight=`${Math.round(o.height-m-f)}px`,a.setAttribute("data-quick-ask-side","where-the-menu-stood"),a.setAttribute("data-quick-ask-from",`${Math.round(i.left)},${Math.round(i.top)}`)}function st(a,i){let o=i?.getAttribute("data-graview-view")??i?.getAttribute("data-graview-pick")??i?.getAttribute("data-graview-record")??i?.getAttribute("data-graview-listed")??(i?"page":"");a.getAttribute("data-quick-ask-beside")!==o&&a.setAttribute("data-quick-ask-beside",o)}function lt(a,i){let o=i?.getBoundingClientRect(),t=i?.getAttribute("data-graview-view")??i?.getAttribute("data-graview-pick")??i?.getAttribute("data-graview-record")??i?.getAttribute("data-graview-listed")??(i?"page":"");if(a.getAttribute("data-thinking-on")!==t&&a.setAttribute("data-thinking-on",t),!o||o.width===0){a.style.visibility!=="hidden"&&(a.style.visibility="hidden");return}let y=a.getBoundingClientRect().width,u=`${Math.round(Math.max(f/2,o.right-y-6))}px`,m=`${Math.round(Math.max(f/2,o.top-10))}px`;a.style.left!==u&&(a.style.left=u),a.style.top!==m&&(a.style.top=m),a.style.visibility!=="visible"&&(a.style.visibility="visible")}var dt={position:"fixed",visibility:"hidden",display:"inline-flex",alignItems:"center",gap:6,padding:"2px 8px",borderRadius:999,fontSize:"0.75rem",lineHeight:1.4,whiteSpace:"nowrap",color:"var(--graview-ink)",background:"var(--graview-float)",border:"1px dashed var(--graview-accent)",boxShadow:"var(--graview-lift-low)",pointerEvents:"none"},ct={width:7,height:7,borderRadius:999,background:"var(--graview-accent)",animation:"graview-thinking 1s ease-in-out infinite alternate"},ut={display:"grid",gap:8,padding:10,borderRadius:10,border:"1px dashed var(--graview-accent)",fontSize:"0.875rem"},pt={position:"fixed",inset:"auto",height:"auto",margin:0,zIndex:we("popover"),boxSizing:"border-box",display:"grid",gap:10,padding:12,borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",color:"var(--graview-ink)",boxShadow:"var(--graview-lift-high)",maxHeight:"calc(100dvh - 24px)",overflowY:"auto",fontSize:"0.875rem"},gt={display:"inline-grid",placeItems:"center",width:28,height:28,padding:0,font:"inherit",fontSize:"0.875rem",lineHeight:1,color:"var(--graview-ink-muted)",background:"transparent",border:"1px solid transparent",borderRadius:6,boxShadow:"none",cursor:"pointer"},ft={boxSizing:"border-box",width:"100%",height:36,padding:"0 10px",font:"inherit",fontSize:"max(1rem,16px)",color:"var(--graview-ink)",background:"var(--graview-panel)",border:"1px solid var(--graview-edge)",borderRadius:8},ht={display:"flex",alignItems:"center",minHeight:30,padding:"4px 8px",borderRadius:6,cursor:"pointer",overflowWrap:"anywhere"},Z={display:"inline-flex",alignItems:"center",minHeight:30,padding:"2px 10px",font:"inherit",fontSize:"0.8125rem",borderRadius:8};export{$t as QuickAskCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as V}from"./chunk.
|
|
1
|
+
import{a as V}from"./chunk.4DXPPM6T.js";import"./chunk.6ZENHSTQ.js";import"./chunk.XOZU4OFA.js";import{f as C,g as x,h as R}from"./chunk.EP5JS7ZH.js";import{a as D}from"./chunk.IXMIU4D4.js";import{a as T,b as A,c as M}from"./chunk.JV432T4Q.js";import"./chunk.TFJA4QV4.js";import"./chunk.HWFJQ42Y.js";import"./chunk.QUETLFBJ.js";import"./chunk.JULD4XFB.js";import"./chunk.GRTBEA7O.js";import{a as F,c as $}from"./chunk.7TDML5YU.js";import{G as k,O as E,T as H,W as g}from"./chunk.3VEZ5MOC.js";import"./chunk.SDO3U72B.js";import"./chunk.6AANHELP.js";import"./chunk.FQLNBIQ5.js";import{b as l}from"./chunk.AJZBJBMO.js";var m=l(k());var n=l(g()),B={maxWidth:560,margin:"0 auto",padding:"40px 20px 64px",display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:16};function G({app:r,store:e,form:o,principal:i,heading:f=1,onSubmitted:a}){let t=(0,m.useMemo)(()=>C(r,o,e.allMutations()),[r,o,e]),d=H(e),v=(0,m.useMemo)(()=>d?e.seenBy(i):e,[d,e,i]),[p,b]=(0,m.useState)(!1),u=(0,m.useRef)(null);(0,m.useEffect)(()=>{p&&u.current?.focus()},[p]);let y=`h${f}`;if(!d)return null;if(!t)return(0,n.jsx)("main",{"data-graview-visitor-form":o,style:B,children:(0,n.jsx)("p",{role:"alert",children:"There is no form here."})});let S=R(t);return(0,n.jsxs)("main",{"data-graview-visitor-form":o,"aria-labelledby":"graview-visitor-form-title",style:B,children:[(0,n.jsx)(y,{id:"graview-visitor-form-title",style:{margin:0,fontSize:"var(--graview-text-title)"},children:t.title}),p?(0,n.jsxs)("div",{ref:u,role:"status",tabIndex:-1,"data-graview-part":"received",style:{display:"grid",gap:8,outline:"none"},children:[(0,n.jsx)("p",{style:{margin:0,fontWeight:600},children:S.said}),S.next?(0,n.jsx)("p",{style:{margin:0},children:S.next}):null]}):(0,n.jsxs)(n.Fragment,{children:[t.intro?(0,n.jsx)("p",{style:{margin:0,color:"var(--graview-ink-muted)"},children:t.intro}):null,(0,n.jsx)(V,{store:v,mutation:t.act,principal:i,only:t.fields.map(h=>h.name),label:t.submit,onDone:()=>{b(!0),a?.(o)}})]})]})}var s=l(k()),P=l($()),O=l(D());var c=l(g());function L(r){let{app:e,form:o,principal:i,scheme:f="auto",brand:a=e.brand,fonts:t=!0,height:d}=r,v=(0,s.useMemo)(()=>typeof i!="string"?i:e.forms?.[o]?x(e,o,i):{kind:"human",id:i,roles:[]},[e,o,i]),p=(0,s.useMemo)(()=>r.store??r.remote?.store??A(e,r.seed),[r.store,r.remote,e,r.seed]),b=M(f==="auto",a?.scheme),u=f==="auto"?b:f,y=`graview-form-${(0,s.useId)().replace(/[^a-zA-Z0-9_-]/g,"")}`,S=(0,s.useMemo)(()=>F(u,a,{scope:`.${y}`}),[u,a,y]);return(0,s.useEffect)(()=>{if(!t||typeof document>"u")return;let h=T(a);if(!h||document.querySelector(`link[href="${h}"]`))return;let w=document.createElement("link");w.rel="stylesheet",w.href=h,document.head.appendChild(w)},[a,t]),(0,c.jsxs)("section",{className:y,"aria-label":r.label??e.forms?.[o]?.title??e.name,"data-graview-embed":"form","data-graview-scheme":u,style:{position:"relative",isolation:"isolate",...d===void 0?{}:{minHeight:d},background:"var(--graview-ground)",color:"var(--graview-ink)",fontFamily:"var(--graview-font-body, system-ui)"},children:[(0,c.jsx)("style",{children:S}),(0,c.jsx)(E.Provider,{value:r.assetsAt,children:(0,c.jsx)(G,{app:e,store:p,form:o,principal:v,heading:r.heading??1,...r.onSubmitted?{onSubmitted:r.onSubmitted}:{}})})]})}function U(r,e){e.app.forms?.[e.form]||x(e.app,e.form,"form:");let o=e.store??e.remote?.store??A(e.app,e.seed),i=null;function f(){let[t,d]=(0,s.useState)(e.scheme??"auto");return i=d,(0,c.jsx)(L,{...e,store:o,scheme:t})}let a=(0,O.createRoot)(r);return(0,P.flushSync)(()=>a.render((0,c.jsx)(f,{}))),{store:o,setScheme:t=>(0,P.flushSync)(()=>i?.(t)),unmount:()=>a.unmount()}}export{L as FormEmbed,U as mount};
|