graview 0.1.71 → 0.1.72
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.2IOJNFCR.js +1 -0
- package/dist/preview/{chunk.5EQRIZ6I.js → chunk.2Q4ZXP7P.js} +1 -1
- package/dist/preview/{chunk.MEAUTBVM.js → chunk.2TTKQAWQ.js} +1 -1
- package/dist/preview/{chunk.6BBUTKFC.js → chunk.2YSE3SQN.js} +3 -3
- package/dist/preview/{chunk.CGRX6SDE.js → chunk.2ZPR6FRI.js} +1 -1
- package/dist/preview/chunk.3BE4SHZD.js +1 -0
- package/dist/preview/{chunk.TSZ2S3VG.js → chunk.43HWCHBN.js} +1 -1
- package/dist/preview/{chunk.TQ3MNB6K.js → chunk.45OLF6BK.js} +1 -1
- package/dist/preview/{chunk.ZY3NAJDM.js → chunk.47QWCVZD.js} +1 -1
- package/dist/preview/{chunk.WU6D3SPL.js → chunk.4A7BRBEA.js} +1 -1
- package/dist/preview/chunk.4EPCI6VY.js +1 -0
- package/dist/preview/{chunk.UZKBFI52.js → chunk.4PB5UFUJ.js} +1 -1
- package/dist/preview/{chunk.MKJV3BM5.js → chunk.4TDYDIIM.js} +1 -1
- package/dist/preview/{chunk.HXRHEPPJ.js → chunk.4VX7GPFS.js} +1 -1
- package/dist/preview/{chunk.OUF2QFZL.js → chunk.523X2YEQ.js} +1 -1
- package/dist/preview/{chunk.KBJ3UUER.js → chunk.53GQQETN.js} +1 -1
- package/dist/preview/{chunk.DHO3QZYK.js → chunk.5MKZTHU2.js} +1 -1
- package/dist/preview/{chunk.F5O3HR7X.js → chunk.5ZT4R227.js} +1 -1
- package/dist/preview/{chunk.LHCGC3K6.js → chunk.65SI77M7.js} +1 -1
- package/dist/preview/chunk.6ESAFTWB.js +1 -0
- package/dist/preview/chunk.6GUIFP2A.js +1 -0
- package/dist/preview/{chunk.D6ODKMOV.js → chunk.6GZYKHEN.js} +1 -1
- package/dist/preview/{chunk.F7KVEWFH.js → chunk.6YKKZI4H.js} +1 -1
- package/dist/preview/{chunk.Z2BCOZDZ.js → chunk.73RMM4W7.js} +1 -1
- package/dist/preview/{chunk.4O64QV2Y.js → chunk.7DCBIMOI.js} +1 -1
- package/dist/preview/chunk.7JE3J7H4.js +1 -0
- package/dist/preview/{chunk.RDUGUC7R.js → chunk.7QGDWAHH.js} +1 -1
- package/dist/preview/{chunk.7PWLRRUS.js → chunk.7VCYVCYM.js} +2 -2
- package/dist/preview/{chunk.GFBE4VNT.js → chunk.A4TBVXHQ.js} +1 -1
- package/dist/preview/{chunk.LDWWUKKX.js → chunk.A6LJPXJ3.js} +1 -1
- package/dist/preview/chunk.AAPXF6NP.js +1 -0
- package/dist/preview/{chunk.UJ7RTNT4.js → chunk.APUICV5Z.js} +1 -1
- package/dist/preview/chunk.ASNVH2G4.js +25 -0
- package/dist/preview/{chunk.OKHXXIMN.js → chunk.CJHCUHVN.js} +1 -1
- package/dist/preview/chunk.CUEPNS3Z.js +1 -0
- package/dist/preview/{chunk.H33XWGAY.js → chunk.CUJRWBPX.js} +1 -1
- package/dist/preview/{chunk.4YZ2A6SJ.js → chunk.D5PW6YWF.js} +3 -3
- package/dist/preview/chunk.DCIYOZYP.js +1 -0
- package/dist/preview/{chunk.3CLTABGP.js → chunk.DEBW4FH6.js} +1 -1
- package/dist/preview/{chunk.UQZ2P6KD.js → chunk.DYPSFTRP.js} +1 -1
- package/dist/preview/{chunk.BWMPC7LK.js → chunk.E6QZUT4L.js} +1 -1
- package/dist/preview/{chunk.MEBKTW7H.js → chunk.E7QZZRAQ.js} +1 -1
- package/dist/preview/chunk.EHCMBAZO.js +3 -0
- package/dist/preview/chunk.EXTD5JWD.js +1 -0
- package/dist/preview/{chunk.S2BMI23H.js → chunk.EZF2T3XQ.js} +1 -1
- package/dist/preview/chunk.EZSST3IU.js +1 -0
- package/dist/preview/{chunk.7THS3DLZ.js → chunk.F2BZ4SC4.js} +1 -1
- package/dist/preview/chunk.F2I7ERGM.js +1 -0
- package/dist/preview/{chunk.VUDNQOOX.js → chunk.FCV3NX6L.js} +1 -1
- package/dist/preview/{chunk.QVBP4UZG.js → chunk.FFTBUXKX.js} +2 -2
- package/dist/preview/{chunk.7MDGPTYF.js → chunk.FILBI7XA.js} +1 -1
- package/dist/preview/{chunk.D4F6QX5L.js → chunk.FKSI5522.js} +1 -1
- package/dist/preview/{chunk.QNWGDG2Z.js → chunk.FQ2QUDZS.js} +1 -1
- package/dist/preview/{chunk.O5RPSUXV.js → chunk.G2ZDDO3C.js} +1 -1
- package/dist/preview/{chunk.IPKODEOZ.js → chunk.GAVEWSXU.js} +1 -1
- package/dist/preview/chunk.GH6QX7JR.js +87 -0
- package/dist/preview/chunk.GMHBAS45.js +1 -0
- package/dist/preview/{chunk.OYMN3IFX.js → chunk.GXK5PI7I.js} +1 -1
- package/dist/preview/{chunk.DDSAFU3B.js → chunk.GYP3EF6Z.js} +1 -1
- package/dist/preview/chunk.H2RVMT4Y.js +111 -0
- package/dist/preview/chunk.HCHGKI64.js +1 -0
- package/dist/preview/chunk.HE7SAJKZ.js +1 -0
- package/dist/preview/{chunk.JLNTE5CH.js → chunk.HIIYDKFC.js} +2 -2
- package/dist/preview/chunk.HPDUGKEF.js +32 -0
- package/dist/preview/{chunk.H4BPTMED.js → chunk.HQRPOGTS.js} +1 -1
- package/dist/preview/chunk.HUJLELZ3.js +1 -0
- package/dist/preview/chunk.HVRUHRXR.js +1 -0
- package/dist/preview/{chunk.QJJWAYHB.js → chunk.I46VNAMS.js} +1 -1
- package/dist/preview/{chunk.QK4QZVQG.js → chunk.ID4GOKT6.js} +1 -1
- package/dist/preview/{chunk.64K5ELSQ.js → chunk.IZKCTF2R.js} +1 -1
- package/dist/preview/{chunk.4HU2ILFY.js → chunk.IZUAZ6EV.js} +1 -1
- package/dist/preview/{chunk.5PQV7GFE.js → chunk.J3CUBMUZ.js} +1 -1
- package/dist/preview/{chunk.P43LPXXJ.js → chunk.J4D4BIB4.js} +1 -1
- package/dist/preview/{chunk.NI4OPHTL.js → chunk.J7GH2CGV.js} +1 -1
- package/dist/preview/{chunk.5WCSQFS5.js → chunk.JE4RBRKH.js} +1 -1
- package/dist/preview/{chunk.ARGEGV5T.js → chunk.JJSZLCNU.js} +1 -1
- package/dist/preview/{chunk.WS5ORRGS.js → chunk.JKX4J3KG.js} +1 -1
- package/dist/preview/{chunk.ZONRIOIA.js → chunk.JMXBMLKH.js} +1 -1
- package/dist/preview/{chunk.6ZRVVRDQ.js → chunk.JOB3EKS6.js} +1 -1
- package/dist/preview/{chunk.PQTXM4VY.js → chunk.JP33TNCH.js} +1 -1
- package/dist/preview/{chunk.Z3TK2LJM.js → chunk.K6EN2YR4.js} +1 -1
- package/dist/preview/chunk.K6YKXTKC.js +1 -0
- package/dist/preview/{chunk.VPFUOTY7.js → chunk.KAIZDIRK.js} +1 -1
- package/dist/preview/{chunk.KZUHXOZU.js → chunk.KAQGSLC6.js} +3 -3
- package/dist/preview/{chunk.WGH2P2YL.js → chunk.KFYSKZC4.js} +1 -1
- package/dist/preview/chunk.KHVW6Q3T.js +1 -0
- package/dist/preview/chunk.KMFH26SS.js +1 -0
- package/dist/preview/{chunk.67S2UWBT.js → chunk.L3ST2YKI.js} +1 -1
- package/dist/preview/{chunk.V5JB5UJS.js → chunk.L6BLZJ6K.js} +1 -1
- package/dist/preview/{chunk.MQNW3O67.js → chunk.LG2BQ5LB.js} +1 -1
- package/dist/preview/{chunk.T6KOL7TW.js → chunk.LLYHHG67.js} +1 -1
- package/dist/preview/{chunk.MWWNKM3I.js → chunk.LPWANRBL.js} +1 -1
- package/dist/preview/{chunk.EJC7ACZT.js → chunk.LSS64NAA.js} +1 -1
- package/dist/preview/{chunk.NH3VXTGX.js → chunk.MFNWHXGL.js} +1 -1
- package/dist/preview/{chunk.DG3YNOH3.js → chunk.MNH3WUAB.js} +1 -1
- package/dist/preview/chunk.MQ7AB5N4.js +1 -0
- package/dist/preview/{chunk.KJPLX72N.js → chunk.MU5JK5TK.js} +1 -1
- package/dist/preview/{chunk.L6P55HFW.js → chunk.N5CACZ5F.js} +1 -1
- package/dist/preview/{chunk.W3TJF4EH.js → chunk.NFC2TYA6.js} +1 -1
- package/dist/preview/{chunk.VL3YDD7D.js → chunk.NKRDVOLJ.js} +1 -1
- package/dist/preview/{chunk.SGYZM6ZU.js → chunk.NNK2E2EP.js} +1 -1
- package/dist/preview/{chunk.W332P5T3.js → chunk.NVPKYWMF.js} +1 -1
- package/dist/preview/{chunk.EEGVI266.js → chunk.NWJ7ELHN.js} +1 -1
- package/dist/preview/{chunk.7KX36ENH.js → chunk.O5P6LXHF.js} +1 -1
- package/dist/preview/{chunk.DX7RGK5G.js → chunk.OFK6673S.js} +1 -1
- package/dist/preview/{chunk.HPFEYMGP.js → chunk.OG6FEP3K.js} +1 -1
- package/dist/preview/{chunk.EA2KYBBR.js → chunk.OHGAZ3D5.js} +1 -1
- package/dist/preview/{chunk.SPJ34VHA.js → chunk.ONVYKLRX.js} +1 -1
- package/dist/preview/chunk.OQ3FKUP2.js +1 -0
- package/dist/preview/chunk.OUJV4CYS.js +1 -0
- package/dist/preview/{chunk.CVN2XFMF.js → chunk.OWHH7JDV.js} +1 -1
- package/dist/preview/{chunk.G767NLBH.js → chunk.OXDCGGZV.js} +1 -1
- package/dist/preview/{chunk.VVIQSFM4.js → chunk.P3Z4ZCL3.js} +1 -1
- package/dist/preview/{chunk.FNSVGSZI.js → chunk.PF7XQ5R5.js} +1 -1
- package/dist/preview/chunk.PH547SON.js +1 -0
- package/dist/preview/{chunk.N3MXLORL.js → chunk.PS765ODQ.js} +1 -1
- package/dist/preview/{chunk.NXHEOHRR.js → chunk.PVAYYFT2.js} +1 -1
- package/dist/preview/{chunk.Z22C2JJ4.js → chunk.Q6WOIE5I.js} +1 -1
- package/dist/preview/{chunk.CEJIH3CN.js → chunk.QE257AXE.js} +1 -1
- package/dist/preview/chunk.QKNC5OUC.js +1 -0
- package/dist/preview/{chunk.W6L2VAJG.js → chunk.QMGBAKX6.js} +1 -1
- package/dist/preview/{chunk.DJGZOPAS.js → chunk.QNFX5VHW.js} +1 -1
- package/dist/preview/chunk.QPCDAQTW.js +1 -0
- package/dist/preview/{chunk.Y5WQD6KV.js → chunk.QPTQIGLX.js} +1 -1
- package/dist/preview/{chunk.IXYG65TM.js → chunk.R5YGW5ZX.js} +1 -1
- package/dist/preview/{chunk.7FI75ZVE.js → chunk.RJ6KEVZC.js} +1 -1
- package/dist/preview/{chunk.OVSKPBPS.js → chunk.RKVMRP7B.js} +1 -1
- package/dist/preview/{chunk.7TACFS7Q.js → chunk.S7U2CHHG.js} +1 -1
- package/dist/preview/{chunk.HT35PAHI.js → chunk.SD2UYSV6.js} +2 -2
- package/dist/preview/{chunk.LQ5J6YQW.js → chunk.SI5GGFQR.js} +1 -1
- package/dist/preview/{chunk.U5KJQFAP.js → chunk.SMF5S4DQ.js} +1 -1
- package/dist/preview/{chunk.RO3D2RNP.js → chunk.SNDFIJVX.js} +1 -1
- package/dist/preview/{chunk.CEOQY5KS.js → chunk.STHWM422.js} +2 -2
- package/dist/preview/{chunk.X7U3JMBR.js → chunk.SV75TRCH.js} +1 -1
- package/dist/preview/{chunk.Q6GEPVQ7.js → chunk.SXGPRFA4.js} +1 -1
- package/dist/preview/{chunk.6TBQV3NO.js → chunk.T3RFZ66S.js} +1 -1
- package/dist/preview/{chunk.VGYG2IBZ.js → chunk.T6ISUVUP.js} +1 -1
- package/dist/preview/{chunk.L3MLGFIS.js → chunk.TBLOBXZ2.js} +1 -1
- package/dist/preview/{chunk.MT252WP4.js → chunk.TDWJU6GW.js} +1 -1
- package/dist/preview/{chunk.EPSYX2SF.js → chunk.THLT6NVO.js} +1 -1
- package/dist/preview/{chunk.W5O5F4FT.js → chunk.TQCVEKPH.js} +1 -1
- package/dist/preview/{chunk.4ZEHLUXV.js → chunk.TQF5XCUS.js} +1 -1
- package/dist/preview/{chunk.VICBF3MQ.js → chunk.TWXYI5AP.js} +1 -1
- package/dist/preview/{chunk.LNKY6MT4.js → chunk.UOUQZYVD.js} +1 -1
- package/dist/preview/{chunk.FIUPDGUZ.js → chunk.UPL3D3ZO.js} +1 -1
- package/dist/preview/{chunk.GFOZVQBQ.js → chunk.UXW43HNW.js} +1 -1
- package/dist/preview/{chunk.MM7MLBGB.js → chunk.V4GSVXSV.js} +1 -1
- package/dist/preview/chunk.VCEDSOAK.js +1 -0
- package/dist/preview/{chunk.3RRK6UTN.js → chunk.VE4AQFLW.js} +1 -1
- package/dist/preview/{chunk.QDDDKEBH.js → chunk.VGQDPEB5.js} +1 -1
- package/dist/preview/{chunk.XTHSPLZZ.js → chunk.VMYXBFPE.js} +1 -1
- package/dist/preview/{chunk.EHLV3LND.js → chunk.VNI6HZEF.js} +2 -2
- package/dist/preview/chunk.VQRY2NQ6.js +1 -0
- package/dist/preview/{chunk.MFMC35ET.js → chunk.VUE6ILQV.js} +1 -1
- package/dist/preview/{chunk.BSWR5SGX.js → chunk.W2VSEEKX.js} +1 -1
- package/dist/preview/{chunk.4QMAYVPU.js → chunk.WAPY4RCS.js} +1 -1
- package/dist/preview/chunk.WFRSGGU5.js +1 -0
- package/dist/preview/{chunk.QKRQPUCE.js → chunk.WIVNFOQR.js} +1 -1
- package/dist/preview/chunk.WRIBFLVG.js +1 -0
- package/dist/preview/{chunk.RHIP2UYE.js → chunk.WWD2TS47.js} +1 -1
- package/dist/preview/{chunk.7XGU6KVF.js → chunk.WWFOQDPR.js} +2 -2
- package/dist/preview/{chunk.JNK5WBSU.js → chunk.X5MCAUFX.js} +1 -1
- package/dist/preview/{chunk.G5AF5IXL.js → chunk.XBWFQ54R.js} +1 -1
- package/dist/preview/{chunk.7LPHWJB4.js → chunk.XMBGT6UT.js} +1 -1
- package/dist/preview/{chunk.FOHZPYUV.js → chunk.XP4IVKKR.js} +1 -1
- package/dist/preview/chunk.XYBWBMNU.js +1 -0
- package/dist/preview/{chunk.OPMGQS5J.js → chunk.YC2IDHQX.js} +1 -1
- package/dist/preview/{chunk.JAPTTM6Y.js → chunk.YCYJHPWS.js} +1 -1
- package/dist/preview/{chunk.T6UJEXFL.js → chunk.YF5GCOSZ.js} +1 -1
- package/dist/preview/{chunk.VDFQFLTU.js → chunk.YGGBGHZU.js} +1 -1
- package/dist/preview/{chunk.U6V4KZF5.js → chunk.YRC6PKXP.js} +1 -1
- package/dist/preview/{chunk.EJIQDMLU.js → chunk.YRN67Z5K.js} +1 -1
- package/dist/preview/{chunk.6L6RUOSF.js → chunk.ZDUKVXBI.js} +1 -1
- package/dist/preview/index.html +55 -55
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.23DATB5Y.js +0 -1
- package/dist/preview/chunk.2INDKSJI.js +0 -1
- package/dist/preview/chunk.45HUV56Z.js +0 -1
- package/dist/preview/chunk.4LWWXIM4.js +0 -1
- package/dist/preview/chunk.4UDST6IF.js +0 -1
- package/dist/preview/chunk.6A3KTD66.js +0 -1
- package/dist/preview/chunk.6IMRCKB4.js +0 -1
- package/dist/preview/chunk.7ZLCA3WK.js +0 -1
- package/dist/preview/chunk.CPK6CYKN.js +0 -111
- package/dist/preview/chunk.DGYWNM5U.js +0 -1
- package/dist/preview/chunk.EOSN5DWW.js +0 -1
- package/dist/preview/chunk.EUXAIG73.js +0 -1
- package/dist/preview/chunk.EZQK23AB.js +0 -1
- package/dist/preview/chunk.F6MY6WJ4.js +0 -1
- package/dist/preview/chunk.FW6M6GIU.js +0 -32
- package/dist/preview/chunk.GKYJQE5A.js +0 -1
- package/dist/preview/chunk.HLKDYI6J.js +0 -1
- package/dist/preview/chunk.IZDB777E.js +0 -1
- package/dist/preview/chunk.JCKIJSW7.js +0 -25
- package/dist/preview/chunk.JREA2XDG.js +0 -1
- package/dist/preview/chunk.MJ4T6YXI.js +0 -1
- package/dist/preview/chunk.ML4X7VVK.js +0 -1
- package/dist/preview/chunk.NNGG7RCO.js +0 -1
- package/dist/preview/chunk.OOQG2AEF.js +0 -1
- package/dist/preview/chunk.RJ7VSWTA.js +0 -87
- package/dist/preview/chunk.RSMCTI2N.js +0 -1
- package/dist/preview/chunk.TBEKEHFS.js +0 -1
- package/dist/preview/chunk.TO3ZKCA2.js +0 -1
- package/dist/preview/chunk.TTM5GQ2U.js +0 -1
- package/dist/preview/chunk.TUBY6SV3.js +0 -1
- package/dist/preview/chunk.UJPX3BUV.js +0 -1
- package/dist/preview/chunk.X2UYEA7H.js +0 -1
- package/dist/preview/chunk.XSM4OTF4.js +0 -1
- package/dist/preview/chunk.YXVUJ3NB.js +0 -1
- package/dist/preview/chunk.ZGLOXN7O.js +0 -1
- package/dist/preview/chunk.ZLQIGZXO.js +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as G,b as q}from"./chunk.LQ5J6YQW.js";import{e as Ke}from"./chunk.7LPHWJB4.js";import"./chunk.W332P5T3.js";import{b as je}from"./chunk.VDFQFLTU.js";import"./chunk.PGT4ZQDG.js";import{a as Ne,c as K,d as Me}from"./chunk.D4F6QX5L.js";import{b as He}from"./chunk.V5JB5UJS.js";import"./chunk.EHLV3LND.js";import"./chunk.EPSYX2SF.js";import"./chunk.JLNTE5CH.js";import"./chunk.DDSAFU3B.js";import"./chunk.EOSN5DWW.js";import"./chunk.T6UJEXFL.js";import"./chunk.7THS3DLZ.js";import"./chunk.4QMAYVPU.js";import"./chunk.ARGEGV5T.js";import"./chunk.WS5ORRGS.js";import"./chunk.ZONRIOIA.js";import"./chunk.NXHEOHRR.js";import"./chunk.HJCQ6I3S.js";import"./chunk.DJGZOPAS.js";import{e as Te}from"./chunk.GFOZVQBQ.js";import"./chunk.MQNW3O67.js";import"./chunk.67S2UWBT.js";import"./chunk.7PWLRRUS.js";import"./chunk.NH3VXTGX.js";import"./chunk.6IMRCKB4.js";import{a as ee,b as Ie,c as ne,f as Pe,j as $e,l as Re}from"./chunk.64K5ELSQ.js";import"./chunk.G4JJXA63.js";import{a as xe}from"./chunk.TBY5IR7C.js";import"./chunk.PQTXM4VY.js";import"./chunk.BIDL7GQD.js";import"./chunk.7KX36ENH.js";import"./chunk.HXRHEPPJ.js";import"./chunk.QNWGDG2Z.js";import"./chunk.BJUUSIQY.js";import"./chunk.QDDDKEBH.js";import"./chunk.QKRQPUCE.js";import"./chunk.SPJ34VHA.js";import"./chunk.XOZU4OFA.js";import"./chunk.KBJ3UUER.js";import"./chunk.Q5WEOX3Q.js";import"./chunk.4O64QV2Y.js";import"./chunk.OYMN3IFX.js";import"./chunk.UQZ2P6KD.js";import"./chunk.WVUJXDXZ.js";import"./chunk.NI4OPHTL.js";import{a as Ae}from"./chunk.U5KJQFAP.js";import"./chunk.FOHZPYUV.js";import"./chunk.IXYG65TM.js";import"./chunk.W6L2VAJG.js";import"./chunk.N3MXLORL.js";import"./chunk.MIE4TJRW.js";import{s as Ee}from"./chunk.3CLTABGP.js";import"./chunk.RD2FSSLV.js";import"./chunk.CVN2XFMF.js";import"./chunk.6TBQV3NO.js";import"./chunk.MT252WP4.js";import"./chunk.VVIQSFM4.js";import"./chunk.TQ3MNB6K.js";import"./chunk.VGYG2IBZ.js";import{G as Le}from"./chunk.RJ7VSWTA.js";import{c as mn}from"./chunk.P43LPXXJ.js";import{D as ve,G as hn,Y as De,ga as Z,ia as Ce}from"./chunk.JCKIJSW7.js";import"./chunk.SDO3U72B.js";import{L as we,ea as ke,la as Y,ma as be,sa as Oe,va as Se}from"./chunk.6L6RUOSF.js";import"./chunk.FQLNBIQ5.js";import{b as _}from"./chunk.AJZBJBMO.js";var u=_(hn(),1),sn=_(mn(),1);var ie=e=>e.lens==="blocks",te=(e,n)=>e.place===void 0&&e.filter!==void 0&&e.filter!==""&&ie(n),Fe=4,gn=/^\d{4}-\d{2}-\d{2}/,wn=e=>e.charAt(0).toUpperCase()+e.slice(1),We=(e,n)=>e.tryDefinition(n)?.fields?.shape??{};function kn(e,n){let t=We(e,n),r=Object.keys(t).filter(i=>{let d=Ae(t[i]);return d?.type==="enum"&&!d.multiple}),o=Te(e,n)?.field;return o&&r.includes(o)?[o,...r.filter(i=>i!==o)]:r}function bn(e,n,t){let r=d=>t.some(c=>typeof c[d]=="string"&&gn.test(c[d])),o=Me(e,n);if(o&&r(o.field))return{start:o.field,...o.end?{end:o.end}:{},...o.done?{done:o.done}:{}};let i=Object.keys(We(e,n)).find(d=>["date","datetime"].includes(K(e,n,d)??"")&&r(d));return i?{start:i}:void 0}function On(e){let{app:n,kind:t,nodes:r,today:o}=e,i=n.schema,d=i.tryDefinition(t),c=m=>Oe(d,m).toLowerCase(),s=m=>r.some(C=>C[m]!==void 0&&C[m]!==null&&C[m]!==""),h=kn(i,t).filter(s),p=[],l=h[0];l&&r.length<=Ne&&p.push({recipe:{lens:"columns",kind:t,column:l},label:`Board by ${c(l)}`,phrase:`a board by ${c(l)}`,shape:"board"});let y=bn(i,t,r);if(y){let m=o.slice(0,7),C=r.some(b=>typeof b[y.start]=="string"&&b[y.start].startsWith(m)),A={lens:"calendar",kind:t,start:y.start,...y.end?{end:y.end}:{},...y.done?{done:y.done}:{},range:"month"};p.push(C?{recipe:A,label:`Calendar by ${c(y.start)}`,phrase:`a calendar by ${c(y.start)}`,shape:"calendar"}:{recipe:{lens:"blocks",kind:t,as:"row",sort:{by:y.start}},label:`In order of ${c(y.start)}`,phrase:`a list in order of ${c(y.start)}`,shape:"order"})}let S=d?.fieldRoles??{},[v,I,D]=[S.start,S.end,S.column??S.day];v&&I&&D&&K(i,t,v)==="number"&&K(i,t,I)==="number"&&K(i,t,D)==="enum"&&s(v)&&s(D)&&p.push({recipe:{lens:"timeline",kind:t,start:v,end:I,column:D},label:`Timeline by ${c(D)}`,phrase:`a timeline by ${c(D)}`,shape:"timeline"});for(let[m,C]of Object.entries(d?.edges??{})){let A=Array.isArray(C?.to)?C.to.find(w=>w!==t&&i.tryDefinition(w)):void 0;if(!A||!e.linked||!r.some(w=>e.linked(w.id,m)))continue;let b=Se(i.tryDefinition(A),A);p.push({recipe:{lens:"coverage",kind:t,across:A,link:m},label:`Grid by ${b}`,phrase:`a grid by ${b}`,shape:"grid"});break}return p.push({recipe:{lens:"blocks",kind:t,as:"card"},label:"Cards",phrase:"cards",shape:"cards"}),l?p.push({recipe:{lens:"blocks",kind:t,as:"row",group:l},label:`Rows by ${c(l)}`,phrase:`rows by ${c(l)}`,shape:"rows"}):e.place!==void 0&&p.push({recipe:{lens:"blocks",kind:t,as:"row"},label:"Rows",phrase:"rows",shape:"rows"}),p}var L=e=>JSON.stringify([e.name??e.lens,e.bindings??{},e.options?.blocks??e.options?.range??null]);function _e(e){return e.name==="columns"?"board":e.name==="coverage"?"grid":e.name==="blocks"?e.options?.blocks?.some(n=>n.as==="card")?"cards":"rows":e.name}var T=e=>e.lenses??[],Ge=(e,n)=>e.on===n||e.on===void 0&&Object.prototype.hasOwnProperty.call(e.bindings??{},n),se=e=>e.app.pages?.lists?.[e.kind]?.opens;function qe(e,n){let t={lens:n.name,on:e.kind,...n.bindings?{bindings:n.bindings}:{},...n.options?{options:n.options}:{}};if(e.place!==void 0){let r=T(e.app).find(o=>o.title===e.place);return[{op:"add-lens",title:e.place,...t,replace:e.place,...r?.create===!1?{create:!1}:{}}]}return[{op:"add-lens",title:n.title,...t},{op:"set-lens-hidden",title:n.title,on:e.kind,hidden:!0},B(e,n.title)]}var B=(e,n)=>({op:"arrange-pages",opens:{[e.kind]:n}}),Be=(e,n)=>{if(e.place!==void 0)return;let t=L(n),r=JSON.stringify(n.options??{});return T(e.app).find(o=>o.hidden===!0&&Ge(o,e.kind)&&L(o)===t&&JSON.stringify(o.options??{})===r)};function oe(e,n){if(!e.compose||!e.document)return!1;try{return e.compose({document:e.document,edits:n}).ok}catch{return!1}}function Sn(e,n){let t=new Set(T(e).map(r=>r.title));if(!t.has(n))return n;for(let r=2;;r++)if(!t.has(`${n} ${r}`))return`${n} ${r}`}var Ue=e=>{let n=e.place===void 0?void 0:T(e.app).find(t=>t.title===e.place);return n!==void 0&&G(n,e.kind)};function Je(e){let n=e.place??se(e),t=n===void 0?void 0:T(e.app).find(r=>r.title===n);return t&&!G(t,e.kind)?L(t):void 0}function Ve(e,n,t){if(Ue(e))return;let r=Pe(n),o=L(r);if(o===Je(e))return;let i={...r,on:e.kind,title:Sn(e.app,r.title)},d=ne(e.app,i,e.sight);if(!d.ok||te(e,d.drawn))return;let c=Be(e,i);if(c&&c.title===se(e))return;let s=c?[B(e,c.title)]:qe(e,i);if(oe(e,s))return{...t,shape:_e(i),title:c?.title??i.title,drawing:o,drawn:d.drawn,edits:s}}function ze(e){if(e.nodes.length===0||Ue(e))return[];let n=Je(e),t=new Set(n?[n]:[]),r=[];if(e.place===void 0)for(let o of T(e.app)){if(o.title===void 0||o.hidden===!0||!Ge(o,e.kind)||o.title===se(e)||G(o,e.kind))continue;let i=ne({...e.app,lenses:T(e.app).filter(s=>s!==o)},{...o,on:e.kind},e.sight);if(!i.ok||te(e,i.drawn))continue;let d=[B(e,o.title)];if(!oe(e,d))continue;let c=L(o);t.add(c),r.push({key:`place:${o.title}`,label:o.title,phrase:`\u201C${o.title}\u201D`,shape:_e(o),from:"place",title:o.title,drawing:c,drawn:i.drawn,edits:d})}for(let o of On(e)){let i=$e(o.recipe,{app:e.app,...e.sight?{sight:e.sight}:{}});if(ee(i)||te(e,i.drawn))continue;let d=L(i.lens);if(t.has(d))continue;let c=Be(e,i.lens),s=c?[B(e,c.title)]:qe(e,i.lens);oe(e,s)&&(t.add(d),r.push({key:`${o.shape}:${d}`,label:o.label,phrase:o.phrase,shape:o.shape,from:"graview",title:c?.title??i.lens.title,drawing:d,drawn:i.drawn,edits:s}))}for(let o of e.offers??[]){let i=ae(e,o);!i||t.has(i.drawing)||(t.add(i.drawing),r.push(i))}return Cn(r,e.choices??[],e.kind)}var vn=e=>{let n=e;return typeof n?.id=="string"&&n.id!==""&&typeof n.label=="string"&&n.label!==""&&typeof n.lens=="object"&&n.lens!==null};function ae(e,n){if(vn(n))try{return Ve(e,n.lens,{key:`host:${n.id}`,label:n.label,phrase:ke(n.label),from:"host",hostId:n.id,...typeof n.weight=="number"?{weight:n.weight}:{}})}catch{return}}function Qe(e,n){try{let t=e?.offers?.(n);if(Array.isArray(t))return{now:t};if(typeof t?.then=="function")return{now:[],late:Promise.resolve(t).then(r=>Array.isArray(r)?r:[],()=>[])}}catch{}return{now:[]}}function Xe(e){try{let n=e?.chosen?.();return Array.isArray(n)?n.filter(Ze):[]}catch{return[]}}async function Ye(e,n){try{let t=await Re(`Whatever would make ${e.name.toLowerCase()} clearest to read`,{app:e.app,complete:n,...e.sight?{sight:e.sight}:{}});if(ee(t))return;let r=t.lens;return Ve(e,{lens:r.name,title:r.title,...r.bindings?{bindings:r.bindings}:{},...r.options?{options:r.options}:{}},{key:`model:${L(r)}`,label:wn(r.title),phrase:`\u201C${r.title}\u201D`,from:"model"})}catch{return}}function Dn(e,n,t){let r=o=>n.reduce((i,d)=>i+(d.key===o.key||d.shape===o.shape?d.kind===t?3:1:0),o.weight??0);return e.map((o,i)=>({option:o,at:i,score:r(o)})).sort((o,i)=>i.score-o.score||o.at-i.at).map(o=>o.option)}function Cn(e,n,t){let r=Dn(e,n,t),o=r.slice(0,Fe),i=r.find(d=>d.from==="host");return i&&!o.includes(i)&&(o[o.length-1]=i),o}var Ze=e=>{let n=e;return typeof n?.key=="string"&&typeof n.shape=="string"&&typeof n.kind=="string"},re=e=>`graview:display-choices:${e}`,An=40,en=new Map;function U(e){try{let n=JSON.parse(localStorage.getItem(re(e))??"null");if(Array.isArray(n))return n.filter(Ze)}catch{}return en.get(e)??[]}function nn(e,n){en.set(e,n);try{n.length===0?localStorage.removeItem(re(e)):localStorage.setItem(re(e),JSON.stringify(n))}catch{}}function En(e,n){nn(e,[...U(e),n].slice(-An))}function xn(e,n,t){nn(e,U(e).filter(r=>!(r.key===n&&r.at===t)))}function In(e,n){let t=`${n} shows as ${e.phrase}.`;return{said:t,add:[],drop:[],card:{said:t,adds:[],keeps:[],drops:[],breaking:[]},edits:e.edits}}function tn(e){let n=new Set,t={options:e.options,shown:null,phase:"choosing",canUndo:!1},r,o,i=[],d=s=>{t={...t,...s},n.forEach(h=>h())},c=s=>{if(o)try{e.onKept?.({kept:o,offered:i,undone:s})}catch{}};return{get:()=>t,subscribe(s){return n.add(s),()=>void n.delete(s)},flip(s){if(t.phase!=="choosing"||s===t.shown||s!==null&&!t.options.some(l=>l.key===s))return;let{said:h,...p}=t;t=p,d({shown:s})},join(s){if(t.phase!=="choosing")return;let h=s.filter(l=>!t.options.some(y=>y.key===l.key||y.drawing===l.drawing));if(h.length===0)return;let p=[...t.options,...h];for(let l=p.length-1;l>=0&&p.length>Fe;l--)p[l].from!=="host"&&p[l].from!=="model"&&p[l].key!==t.shown&&p.splice(l,1);d({options:p})},drop(s){t.options.some(h=>h.key===s)&&d({options:t.options.filter(h=>h.key!==s),shown:t.shown===s?null:t.shown})},async keep(){let s=t.options.find(p=>p.key===t.shown);if(!s||t.phase!=="choosing")return;d({phase:"keeping"});let h;try{h=await e.propose(In(s,e.name))}catch{return d({phase:"choosing",said:"It couldn't be kept."})}if(h==="declined")return d({phase:"choosing",said:"It wasn't kept."});typeof h=="object"&&(r=h.undo),i=t.options.map(p=>p.key),o={key:s.key,kind:e.kind??"",shape:s.shape,from:s.from,...s.hostId?{hostId:s.hostId}:{},at:new Date().toISOString()},e.appKey!==void 0&&En(e.appKey,o),c(!1),d({phase:"kept",said:`${e.name} now shows as ${s.phrase}.`,canUndo:r!==void 0,...typeof h=="object"&&h.note?{note:h.note}:{}})},async undo(){let s=r;if(t.phase!=="kept"||!s)return;r=void 0;try{await s()}catch{return r=s,d({said:"It couldn't be put back."})}o&&e.appKey!==void 0&&xn(e.appKey,o.key,o.at),c(!0);let{note:h,...p}=t;t=p,d({phase:"undone",said:`${e.name} is as it was.`,canUndo:!1})}}}function on(e,n,t){let r=e.tryDefinition(n);return t.slice(0,200).map(o=>be(r,o)).filter(o=>o.length>1)}var k=_(De(),1),de=new Map,Pn=e=>e?.querySelector("main")??e??null,J=e=>Pn(e.main?.isConnected?e.main:document.querySelector("[data-graview-page-main], main")??document.querySelector("[data-graview-face]"));function rn(e){let n=e.querySelector("[data-graview-page-title]"),t=n?.closest("header")??n?.parentElement??null;return t&&t!==e&&e.contains(t)?t:null}var M="data-graview-under-option",le="data-graview-option-wide",N="__now__",$n=(0,u.memo)(function({option:n,shown:t,names:r,nodes:o,drew:i,failed:d}){let c=(0,u.useRef)(null),s=(0,u.useRef)(null);(0,u.useLayoutEffect)(()=>{s.current&&(s.current.inert=!0)},[]),(0,u.useLayoutEffect)(()=>{let l=()=>{let S=(c.current?.textContent??"").toLowerCase();return r.some(v=>S.includes(v.toLowerCase()))};if(l())return i(n.key);let y=[100,400,1500].map((S,v,I)=>setTimeout(()=>{l()?i(n.key):v===I.length-1&&d(n.key)},S));return()=>y.forEach(clearTimeout)},[n.key]);let h=(0,u.useMemo)(()=>He(n.drawn),[n.drawn]),p=ie(n.drawn);return(0,k.jsx)("div",{ref:c,"data-testid":"display-option-pane","data-display-option":n.key,"data-shown":t?"":void 0,style:{...p?Hn:Tn,...t?{}:Nn},children:(0,k.jsx)("div",{ref:s,style:p?void 0:Mn,children:(0,k.jsx)(Ee,{kind:n.drawn.kinds[0]??"",view:n.title,children:(0,k.jsx)(h,{nodes:o,label:n.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1})})})})});function Rn({options:e,shown:n,names:t,drew:r,failed:o,kind:i,filter:d}){let{store:c}=Z();Ce();let s=c.schema.tryDefinition(i),h=c.graph.nodesOfKind(i).filter(y=>Y(s,y)),p=d?new Set(c.violations().flatMap(y=>y.nodeIds)):void 0,l=q(c.schema,c.graph,i,h,d,p);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("style",{children:`[${M}]{display:none !important}[${le}]{max-width:1160px !important}`}),e.map(y=>(0,k.jsx)($n,{option:y,shown:y.key===n,names:t,nodes:l,drew:r,failed:o},y.key))]})}function rt({ask:e,close:n}){let t=Z(),{ai:r,app:o,brand:i,composeChange:d,displayOptions:c,onProposeChange:s,principal:h,store:p}=t,l=e.part,y=l.kind,S=Le(i,p.schema),v=()=>p.graph.nodesOfKind(y).filter(a=>Y(p.schema.tryDefinition(y),a)),[I]=(0,u.useState)(()=>on(p.schema,y,q(p.schema,p.graph,y,v(),l.filter,l.filter?new Set(p.violations().flatMap(a=>a.nodeIds)):void 0))),[D]=(0,u.useState)(()=>{let a=de.get(e.at);if(a)return a;let f={...o,schema:p.schema},g={app:f,document:je(o??{}),compose:d,kind:y,name:l.name,nodes:v(),today:p.today()??we(),sight:Ie(f,h),linked:(x,H)=>p.graph.outEdges(x).some(R=>R.kind===H),...l.slot==="place"?{place:l.name}:{},...l.filter?{filter:l.filter}:{}},E=[...U(S),...Xe(c)],un={kind:y,name:l.name,...l.slot==="place"?{place:l.name}:{}},me=Qe(c,un),X=tn({options:ze({...g,choices:E,offers:me.now}),name:l.name,kind:y,appKey:S,propose:x=>s(x),...c?.onChoice?{onKept:c.onChoice}:{}});if(me.late?.then(x=>X.join(x.flatMap(H=>ae(g,H)??[]))),ve(r)){let x=r.thinking,H=x?R=>x.think({prompt:R.prompt,system:R.system??"",state:{},catalog:[]}):r.complete;H&&Ye(g,H).then(R=>R?X.join([R]):void 0)}let ge={flips:X,opened:!1};return de.set(e.at,ge),ge}),{flips:m}=D,C=(0,u.useSyncExternalStore)(m.subscribe,m.get,m.get),{options:A,shown:b,phase:w,said:ce,note:pe}=C,P=w==="choosing"||w==="keeping",[dn,ln]=(0,u.useState)(()=>new Set),cn=(0,u.useMemo)(()=>a=>ln(f=>f.has(a)?f:new Set([...f,a])),[]),pn=(0,u.useMemo)(()=>a=>m.drop(a),[m]),j=A.filter(a=>dn.has(a.key));(0,u.useEffect)(()=>{D.opened||w!=="choosing"||j.length===0||(D.opened=!0,m.flip(j[0].key))},[D,m,w,j]);let[O,fe]=(0,u.useState)(null);(0,u.useLayoutEffect)(()=>{if(!P)return;let a=J(l);if(!a)return;let f=document.createElement("div");f.setAttribute("data-testid","display-options-stage"),Object.assign(f.style,Ln);let g=rn(a);return g?.parentElement?g.parentElement.insertBefore(f,g.nextSibling):a.insertBefore(f,a.firstChild),fe(f),()=>{f.remove(),fe(null)}},[P]),(0,u.useLayoutEffect)(()=>{let a=O?J(l):null;if(!a)return;let f=b===null;if(O.style.position=f?"absolute":"relative",O.style.height=f?"0":"auto",O.style.visibility=f?"hidden":"visible",O.setAttribute("data-display-shown",b??N),!f){a.setAttribute(le,"");for(let g=O;g!==a&&g.parentElement;g=g.parentElement)for(let E of g.parentElement.children)E!==g&&E!==rn(a)&&E.localName!=="style"&&E.setAttribute(M,"")}return()=>{a.removeAttribute(le);for(let g of a.querySelectorAll(`[${M}]`))g.removeAttribute(M)}});let ye=()=>{de.delete(e.at),n()},F=()=>{let a=J(l);for(let g of a?.querySelectorAll(`[${M}]`)??[])g.removeAttribute(M);O&&(O.style.display="none");let f=e.returnTo?.isConnected?e.returnTo:document.querySelector("[data-graview-page-title], main h1");f&&!f.hasAttribute("tabindex")&&!f.matches("a[href], button, input, select, textarea")&&f.setAttribute("tabindex","-1"),f?.focus?.({preventScroll:!0}),ye()};(0,u.useEffect)(()=>{if(!P||!O)return;let a=location.pathname,f=()=>J(l)?.querySelector("[data-graview-page-title]")?.textContent??null,g=f(),E=setInterval(()=>{m.get().phase!=="keeping"&&(location.pathname!==a||!O.isConnected||f()!==g)&&ye()},250);return()=>clearInterval(E)},[P,O]);let ue=(0,u.useRef)(F);ue.current=F,(0,u.useEffect)(()=>{let a=f=>{f.key!=="Escape"||m.get().phase==="keeping"||document.querySelector("[data-graview-popover]:not([data-better-bar]):not([hidden]), [data-testid='context-menu']")||(f.preventDefault(),ue.current())};return document.addEventListener("keydown",a,!0),()=>document.removeEventListener("keydown",a,!0)},[m]);let W=xe(p,h);(0,u.useEffect)(()=>{!W&&w==="choosing"&&F()},[W,w]);let V=(0,u.useRef)(null),he=(0,u.useRef)(!1);(0,u.useEffect)(()=>{w!=="choosing"||b===null||he.current||(he.current=!0,V.current?.querySelector('[role="radio"][aria-checked="true"]')?.focus({preventScroll:!0}))},[w,j.length,b]);let $=[{key:N,label:"As it is now"},...j],fn=a=>{let f=a.key==="ArrowRight"||a.key==="ArrowDown"?1:a.key==="ArrowLeft"||a.key==="ArrowUp"?-1:0,g=f!==0?$[($.findIndex(E=>E.key===(b??N))+f+$.length)%$.length]:a.key==="Home"?$[0]:a.key==="End"?$.at(-1):void 0;g&&(a.preventDefault(),m.flip(g.key===N?null:g.key),V.current?.querySelector(`[data-option="${CSS.escape(g.key)}"]`)?.focus({preventScroll:!0}))},z=A.find(a=>a.key===b),yn=P?ce??(z?z.label:`${l.name} as it is now`):ce??"",Q=w==="choosing"&&A.length===0;return(0,k.jsxs)(k.Fragment,{children:[O&&P?(0,sn.createPortal)((0,k.jsx)(Rn,{options:A,shown:b,names:I,drew:cn,failed:pn,kind:y,filter:l.filter}),O):null,(0,k.jsx)(Ke,{phase:`options-${w}`,name:l.name,said:Q?`There are no other ways to show ${l.name} yet.`:yn,...P&&!Q?{scope:"Nothing changes until you keep one. Everyone in this app sees the one you keep."}:{},...pe?{note:pe}:{},...w==="choosing"&&z&&W?{keep:()=>void m.keep()}:{},...w==="kept"&&C.canUndo&&W?{undo:()=>void m.undo()}:{},...w!=="keeping"?{close:F}:{},children:w==="choosing"&&!Q?(0,k.jsx)("div",{ref:V,role:"radiogroup","aria-label":`Ways to show ${l.name}`,"data-testid":"display-options",onKeyDown:fn,style:jn,children:$.map(a=>{let f=a.key===(b??N);return(0,k.jsx)("button",{type:"button",role:"radio","aria-checked":f,tabIndex:f?0:-1,"data-testid":"display-option","data-option":a.key,onClick:()=>m.flip(a.key===N?null:a.key),style:f?Kn:an,children:a.label},a.key)})}):null})]})}var Ln={position:"relative",minWidth:"0",maxWidth:"100%",width:"100%",overflow:"clip"},Tn={boxSizing:"border-box",height:"min(72vh, 760px)",display:"grid",gridTemplateRows:"minmax(0, 1fr)",gridTemplateColumns:"minmax(0, 1fr)",overflow:"auto",maxWidth:"100%",borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)"},Hn={display:"grid",gridTemplateColumns:"minmax(0, 1fr)",maxWidth:"100%"},Nn={position:"absolute",top:0,left:0,right:0,visibility:"hidden",pointerEvents:"none"},Mn={display:"grid",gridTemplateRows:"minmax(0, 1fr)",gridTemplateColumns:"minmax(0, 1fr)",minWidth:0,minHeight:0},jn={display:"flex",flexWrap:"wrap",gap:6,marginTop:4},an={minHeight:34,padding:"0 12px",font:"inherit",borderRadius:8,cursor:"pointer",color:"var(--graview-ink)",background:"transparent",border:"1px solid var(--graview-edge)"},Kn={...an,fontWeight:600,border:"1px solid var(--graview-accent)",boxShadow:"inset 0 0 0 1px var(--graview-accent)"};export{rt as DisplaySwitch};
|
|
1
|
+
import{a as G,b as q}from"./chunk.SI5GGFQR.js";import{e as Ke}from"./chunk.XMBGT6UT.js";import"./chunk.NVPKYWMF.js";import{b as je}from"./chunk.YGGBGHZU.js";import"./chunk.PGT4ZQDG.js";import{a as Ne,c as K,d as Me}from"./chunk.FKSI5522.js";import{b as He}from"./chunk.L6BLZJ6K.js";import"./chunk.VNI6HZEF.js";import"./chunk.THLT6NVO.js";import"./chunk.HIIYDKFC.js";import"./chunk.GYP3EF6Z.js";import"./chunk.KMFH26SS.js";import"./chunk.YF5GCOSZ.js";import"./chunk.F2BZ4SC4.js";import"./chunk.WAPY4RCS.js";import"./chunk.JJSZLCNU.js";import"./chunk.JKX4J3KG.js";import"./chunk.JMXBMLKH.js";import"./chunk.PVAYYFT2.js";import"./chunk.HJCQ6I3S.js";import"./chunk.QNFX5VHW.js";import{e as Te}from"./chunk.UXW43HNW.js";import"./chunk.LG2BQ5LB.js";import"./chunk.L3ST2YKI.js";import"./chunk.7VCYVCYM.js";import"./chunk.MFNWHXGL.js";import"./chunk.DCIYOZYP.js";import{a as ee,b as Ie,c as ne,f as Pe,j as $e,l as Re}from"./chunk.IZKCTF2R.js";import"./chunk.G4JJXA63.js";import{a as xe}from"./chunk.TBY5IR7C.js";import"./chunk.JP33TNCH.js";import"./chunk.BIDL7GQD.js";import"./chunk.O5P6LXHF.js";import"./chunk.4VX7GPFS.js";import"./chunk.FQ2QUDZS.js";import"./chunk.BJUUSIQY.js";import"./chunk.VGQDPEB5.js";import"./chunk.WIVNFOQR.js";import"./chunk.ONVYKLRX.js";import"./chunk.XOZU4OFA.js";import"./chunk.53GQQETN.js";import"./chunk.Q5WEOX3Q.js";import"./chunk.7DCBIMOI.js";import"./chunk.GXK5PI7I.js";import"./chunk.DYPSFTRP.js";import"./chunk.WVUJXDXZ.js";import"./chunk.J7GH2CGV.js";import{a as Ae}from"./chunk.SMF5S4DQ.js";import"./chunk.XP4IVKKR.js";import"./chunk.R5YGW5ZX.js";import"./chunk.QMGBAKX6.js";import"./chunk.PS765ODQ.js";import"./chunk.MIE4TJRW.js";import{s as Ee}from"./chunk.DEBW4FH6.js";import"./chunk.RD2FSSLV.js";import"./chunk.OWHH7JDV.js";import"./chunk.T3RFZ66S.js";import"./chunk.TDWJU6GW.js";import"./chunk.P3Z4ZCL3.js";import"./chunk.45OLF6BK.js";import"./chunk.T6ISUVUP.js";import{G as Le}from"./chunk.GH6QX7JR.js";import{c as mn}from"./chunk.J4D4BIB4.js";import{D as ve,G as hn,_ as De,ia as Z,ka as Ce}from"./chunk.ASNVH2G4.js";import"./chunk.SDO3U72B.js";import{L as we,ea as ke,la as Y,ma as be,sa as Oe,va as Se}from"./chunk.ZDUKVXBI.js";import"./chunk.FQLNBIQ5.js";import{b as _}from"./chunk.AJZBJBMO.js";var u=_(hn(),1),sn=_(mn(),1);var ie=e=>e.lens==="blocks",te=(e,n)=>e.place===void 0&&e.filter!==void 0&&e.filter!==""&&ie(n),Fe=4,gn=/^\d{4}-\d{2}-\d{2}/,wn=e=>e.charAt(0).toUpperCase()+e.slice(1),We=(e,n)=>e.tryDefinition(n)?.fields?.shape??{};function kn(e,n){let t=We(e,n),r=Object.keys(t).filter(i=>{let d=Ae(t[i]);return d?.type==="enum"&&!d.multiple}),o=Te(e,n)?.field;return o&&r.includes(o)?[o,...r.filter(i=>i!==o)]:r}function bn(e,n,t){let r=d=>t.some(c=>typeof c[d]=="string"&&gn.test(c[d])),o=Me(e,n);if(o&&r(o.field))return{start:o.field,...o.end?{end:o.end}:{},...o.done?{done:o.done}:{}};let i=Object.keys(We(e,n)).find(d=>["date","datetime"].includes(K(e,n,d)??"")&&r(d));return i?{start:i}:void 0}function On(e){let{app:n,kind:t,nodes:r,today:o}=e,i=n.schema,d=i.tryDefinition(t),c=m=>Oe(d,m).toLowerCase(),s=m=>r.some(C=>C[m]!==void 0&&C[m]!==null&&C[m]!==""),h=kn(i,t).filter(s),p=[],l=h[0];l&&r.length<=Ne&&p.push({recipe:{lens:"columns",kind:t,column:l},label:`Board by ${c(l)}`,phrase:`a board by ${c(l)}`,shape:"board"});let y=bn(i,t,r);if(y){let m=o.slice(0,7),C=r.some(b=>typeof b[y.start]=="string"&&b[y.start].startsWith(m)),A={lens:"calendar",kind:t,start:y.start,...y.end?{end:y.end}:{},...y.done?{done:y.done}:{},range:"month"};p.push(C?{recipe:A,label:`Calendar by ${c(y.start)}`,phrase:`a calendar by ${c(y.start)}`,shape:"calendar"}:{recipe:{lens:"blocks",kind:t,as:"row",sort:{by:y.start}},label:`In order of ${c(y.start)}`,phrase:`a list in order of ${c(y.start)}`,shape:"order"})}let S=d?.fieldRoles??{},[v,I,D]=[S.start,S.end,S.column??S.day];v&&I&&D&&K(i,t,v)==="number"&&K(i,t,I)==="number"&&K(i,t,D)==="enum"&&s(v)&&s(D)&&p.push({recipe:{lens:"timeline",kind:t,start:v,end:I,column:D},label:`Timeline by ${c(D)}`,phrase:`a timeline by ${c(D)}`,shape:"timeline"});for(let[m,C]of Object.entries(d?.edges??{})){let A=Array.isArray(C?.to)?C.to.find(w=>w!==t&&i.tryDefinition(w)):void 0;if(!A||!e.linked||!r.some(w=>e.linked(w.id,m)))continue;let b=Se(i.tryDefinition(A),A);p.push({recipe:{lens:"coverage",kind:t,across:A,link:m},label:`Grid by ${b}`,phrase:`a grid by ${b}`,shape:"grid"});break}return p.push({recipe:{lens:"blocks",kind:t,as:"card"},label:"Cards",phrase:"cards",shape:"cards"}),l?p.push({recipe:{lens:"blocks",kind:t,as:"row",group:l},label:`Rows by ${c(l)}`,phrase:`rows by ${c(l)}`,shape:"rows"}):e.place!==void 0&&p.push({recipe:{lens:"blocks",kind:t,as:"row"},label:"Rows",phrase:"rows",shape:"rows"}),p}var L=e=>JSON.stringify([e.name??e.lens,e.bindings??{},e.options?.blocks??e.options?.range??null]);function _e(e){return e.name==="columns"?"board":e.name==="coverage"?"grid":e.name==="blocks"?e.options?.blocks?.some(n=>n.as==="card")?"cards":"rows":e.name}var T=e=>e.lenses??[],Ge=(e,n)=>e.on===n||e.on===void 0&&Object.prototype.hasOwnProperty.call(e.bindings??{},n),se=e=>e.app.pages?.lists?.[e.kind]?.opens;function qe(e,n){let t={lens:n.name,on:e.kind,...n.bindings?{bindings:n.bindings}:{},...n.options?{options:n.options}:{}};if(e.place!==void 0){let r=T(e.app).find(o=>o.title===e.place);return[{op:"add-lens",title:e.place,...t,replace:e.place,...r?.create===!1?{create:!1}:{}}]}return[{op:"add-lens",title:n.title,...t},{op:"set-lens-hidden",title:n.title,on:e.kind,hidden:!0},B(e,n.title)]}var B=(e,n)=>({op:"arrange-pages",opens:{[e.kind]:n}}),Be=(e,n)=>{if(e.place!==void 0)return;let t=L(n),r=JSON.stringify(n.options??{});return T(e.app).find(o=>o.hidden===!0&&Ge(o,e.kind)&&L(o)===t&&JSON.stringify(o.options??{})===r)};function oe(e,n){if(!e.compose||!e.document)return!1;try{return e.compose({document:e.document,edits:n}).ok}catch{return!1}}function Sn(e,n){let t=new Set(T(e).map(r=>r.title));if(!t.has(n))return n;for(let r=2;;r++)if(!t.has(`${n} ${r}`))return`${n} ${r}`}var Ue=e=>{let n=e.place===void 0?void 0:T(e.app).find(t=>t.title===e.place);return n!==void 0&&G(n,e.kind)};function Je(e){let n=e.place??se(e),t=n===void 0?void 0:T(e.app).find(r=>r.title===n);return t&&!G(t,e.kind)?L(t):void 0}function Ve(e,n,t){if(Ue(e))return;let r=Pe(n),o=L(r);if(o===Je(e))return;let i={...r,on:e.kind,title:Sn(e.app,r.title)},d=ne(e.app,i,e.sight);if(!d.ok||te(e,d.drawn))return;let c=Be(e,i);if(c&&c.title===se(e))return;let s=c?[B(e,c.title)]:qe(e,i);if(oe(e,s))return{...t,shape:_e(i),title:c?.title??i.title,drawing:o,drawn:d.drawn,edits:s}}function ze(e){if(e.nodes.length===0||Ue(e))return[];let n=Je(e),t=new Set(n?[n]:[]),r=[];if(e.place===void 0)for(let o of T(e.app)){if(o.title===void 0||o.hidden===!0||!Ge(o,e.kind)||o.title===se(e)||G(o,e.kind))continue;let i=ne({...e.app,lenses:T(e.app).filter(s=>s!==o)},{...o,on:e.kind},e.sight);if(!i.ok||te(e,i.drawn))continue;let d=[B(e,o.title)];if(!oe(e,d))continue;let c=L(o);t.add(c),r.push({key:`place:${o.title}`,label:o.title,phrase:`\u201C${o.title}\u201D`,shape:_e(o),from:"place",title:o.title,drawing:c,drawn:i.drawn,edits:d})}for(let o of On(e)){let i=$e(o.recipe,{app:e.app,...e.sight?{sight:e.sight}:{}});if(ee(i)||te(e,i.drawn))continue;let d=L(i.lens);if(t.has(d))continue;let c=Be(e,i.lens),s=c?[B(e,c.title)]:qe(e,i.lens);oe(e,s)&&(t.add(d),r.push({key:`${o.shape}:${d}`,label:o.label,phrase:o.phrase,shape:o.shape,from:"graview",title:c?.title??i.lens.title,drawing:d,drawn:i.drawn,edits:s}))}for(let o of e.offers??[]){let i=ae(e,o);!i||t.has(i.drawing)||(t.add(i.drawing),r.push(i))}return Cn(r,e.choices??[],e.kind)}var vn=e=>{let n=e;return typeof n?.id=="string"&&n.id!==""&&typeof n.label=="string"&&n.label!==""&&typeof n.lens=="object"&&n.lens!==null};function ae(e,n){if(vn(n))try{return Ve(e,n.lens,{key:`host:${n.id}`,label:n.label,phrase:ke(n.label),from:"host",hostId:n.id,...typeof n.weight=="number"?{weight:n.weight}:{}})}catch{return}}function Qe(e,n){try{let t=e?.offers?.(n);if(Array.isArray(t))return{now:t};if(typeof t?.then=="function")return{now:[],late:Promise.resolve(t).then(r=>Array.isArray(r)?r:[],()=>[])}}catch{}return{now:[]}}function Xe(e){try{let n=e?.chosen?.();return Array.isArray(n)?n.filter(Ze):[]}catch{return[]}}async function Ye(e,n){try{let t=await Re(`Whatever would make ${e.name.toLowerCase()} clearest to read`,{app:e.app,complete:n,...e.sight?{sight:e.sight}:{}});if(ee(t))return;let r=t.lens;return Ve(e,{lens:r.name,title:r.title,...r.bindings?{bindings:r.bindings}:{},...r.options?{options:r.options}:{}},{key:`model:${L(r)}`,label:wn(r.title),phrase:`\u201C${r.title}\u201D`,from:"model"})}catch{return}}function Dn(e,n,t){let r=o=>n.reduce((i,d)=>i+(d.key===o.key||d.shape===o.shape?d.kind===t?3:1:0),o.weight??0);return e.map((o,i)=>({option:o,at:i,score:r(o)})).sort((o,i)=>i.score-o.score||o.at-i.at).map(o=>o.option)}function Cn(e,n,t){let r=Dn(e,n,t),o=r.slice(0,Fe),i=r.find(d=>d.from==="host");return i&&!o.includes(i)&&(o[o.length-1]=i),o}var Ze=e=>{let n=e;return typeof n?.key=="string"&&typeof n.shape=="string"&&typeof n.kind=="string"},re=e=>`graview:display-choices:${e}`,An=40,en=new Map;function U(e){try{let n=JSON.parse(localStorage.getItem(re(e))??"null");if(Array.isArray(n))return n.filter(Ze)}catch{}return en.get(e)??[]}function nn(e,n){en.set(e,n);try{n.length===0?localStorage.removeItem(re(e)):localStorage.setItem(re(e),JSON.stringify(n))}catch{}}function En(e,n){nn(e,[...U(e),n].slice(-An))}function xn(e,n,t){nn(e,U(e).filter(r=>!(r.key===n&&r.at===t)))}function In(e,n){let t=`${n} shows as ${e.phrase}.`;return{said:t,add:[],drop:[],card:{said:t,adds:[],keeps:[],drops:[],breaking:[]},edits:e.edits}}function tn(e){let n=new Set,t={options:e.options,shown:null,phase:"choosing",canUndo:!1},r,o,i=[],d=s=>{t={...t,...s},n.forEach(h=>h())},c=s=>{if(o)try{e.onKept?.({kept:o,offered:i,undone:s})}catch{}};return{get:()=>t,subscribe(s){return n.add(s),()=>void n.delete(s)},flip(s){if(t.phase!=="choosing"||s===t.shown||s!==null&&!t.options.some(l=>l.key===s))return;let{said:h,...p}=t;t=p,d({shown:s})},join(s){if(t.phase!=="choosing")return;let h=s.filter(l=>!t.options.some(y=>y.key===l.key||y.drawing===l.drawing));if(h.length===0)return;let p=[...t.options,...h];for(let l=p.length-1;l>=0&&p.length>Fe;l--)p[l].from!=="host"&&p[l].from!=="model"&&p[l].key!==t.shown&&p.splice(l,1);d({options:p})},drop(s){t.options.some(h=>h.key===s)&&d({options:t.options.filter(h=>h.key!==s),shown:t.shown===s?null:t.shown})},async keep(){let s=t.options.find(p=>p.key===t.shown);if(!s||t.phase!=="choosing")return;d({phase:"keeping"});let h;try{h=await e.propose(In(s,e.name))}catch{return d({phase:"choosing",said:"It couldn't be kept."})}if(h==="declined")return d({phase:"choosing",said:"It wasn't kept."});typeof h=="object"&&(r=h.undo),i=t.options.map(p=>p.key),o={key:s.key,kind:e.kind??"",shape:s.shape,from:s.from,...s.hostId?{hostId:s.hostId}:{},at:new Date().toISOString()},e.appKey!==void 0&&En(e.appKey,o),c(!1),d({phase:"kept",said:`${e.name} now shows as ${s.phrase}.`,canUndo:r!==void 0,...typeof h=="object"&&h.note?{note:h.note}:{}})},async undo(){let s=r;if(t.phase!=="kept"||!s)return;r=void 0;try{await s()}catch{return r=s,d({said:"It couldn't be put back."})}o&&e.appKey!==void 0&&xn(e.appKey,o.key,o.at),c(!0);let{note:h,...p}=t;t=p,d({phase:"undone",said:`${e.name} is as it was.`,canUndo:!1})}}}function on(e,n,t){let r=e.tryDefinition(n);return t.slice(0,200).map(o=>be(r,o)).filter(o=>o.length>1)}var k=_(De(),1),de=new Map,Pn=e=>e?.querySelector("main")??e??null,J=e=>Pn(e.main?.isConnected?e.main:document.querySelector("[data-graview-page-main], main")??document.querySelector("[data-graview-face]"));function rn(e){let n=e.querySelector("[data-graview-page-title]"),t=n?.closest("header")??n?.parentElement??null;return t&&t!==e&&e.contains(t)?t:null}var M="data-graview-under-option",le="data-graview-option-wide",N="__now__",$n=(0,u.memo)(function({option:n,shown:t,names:r,nodes:o,drew:i,failed:d}){let c=(0,u.useRef)(null),s=(0,u.useRef)(null);(0,u.useLayoutEffect)(()=>{s.current&&(s.current.inert=!0)},[]),(0,u.useLayoutEffect)(()=>{let l=()=>{let S=(c.current?.textContent??"").toLowerCase();return r.some(v=>S.includes(v.toLowerCase()))};if(l())return i(n.key);let y=[100,400,1500].map((S,v,I)=>setTimeout(()=>{l()?i(n.key):v===I.length-1&&d(n.key)},S));return()=>y.forEach(clearTimeout)},[n.key]);let h=(0,u.useMemo)(()=>He(n.drawn),[n.drawn]),p=ie(n.drawn);return(0,k.jsx)("div",{ref:c,"data-testid":"display-option-pane","data-display-option":n.key,"data-shown":t?"":void 0,style:{...p?Hn:Tn,...t?{}:Nn},children:(0,k.jsx)("div",{ref:s,style:p?void 0:Mn,children:(0,k.jsx)(Ee,{kind:n.drawn.kinds[0]??"",view:n.title,children:(0,k.jsx)(h,{nodes:o,label:n.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1})})})})});function Rn({options:e,shown:n,names:t,drew:r,failed:o,kind:i,filter:d}){let{store:c}=Z();Ce();let s=c.schema.tryDefinition(i),h=c.graph.nodesOfKind(i).filter(y=>Y(s,y)),p=d?new Set(c.violations().flatMap(y=>y.nodeIds)):void 0,l=q(c.schema,c.graph,i,h,d,p);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("style",{children:`[${M}]{display:none !important}[${le}]{max-width:1160px !important}`}),e.map(y=>(0,k.jsx)($n,{option:y,shown:y.key===n,names:t,nodes:l,drew:r,failed:o},y.key))]})}function rt({ask:e,close:n}){let t=Z(),{ai:r,app:o,brand:i,composeChange:d,displayOptions:c,onProposeChange:s,principal:h,store:p}=t,l=e.part,y=l.kind,S=Le(i,p.schema),v=()=>p.graph.nodesOfKind(y).filter(a=>Y(p.schema.tryDefinition(y),a)),[I]=(0,u.useState)(()=>on(p.schema,y,q(p.schema,p.graph,y,v(),l.filter,l.filter?new Set(p.violations().flatMap(a=>a.nodeIds)):void 0))),[D]=(0,u.useState)(()=>{let a=de.get(e.at);if(a)return a;let f={...o,schema:p.schema},g={app:f,document:je(o??{}),compose:d,kind:y,name:l.name,nodes:v(),today:p.today()??we(),sight:Ie(f,h),linked:(x,H)=>p.graph.outEdges(x).some(R=>R.kind===H),...l.slot==="place"?{place:l.name}:{},...l.filter?{filter:l.filter}:{}},E=[...U(S),...Xe(c)],un={kind:y,name:l.name,...l.slot==="place"?{place:l.name}:{}},me=Qe(c,un),X=tn({options:ze({...g,choices:E,offers:me.now}),name:l.name,kind:y,appKey:S,propose:x=>s(x),...c?.onChoice?{onKept:c.onChoice}:{}});if(me.late?.then(x=>X.join(x.flatMap(H=>ae(g,H)??[]))),ve(r)){let x=r.thinking,H=x?R=>x.think({prompt:R.prompt,system:R.system??"",state:{},catalog:[]}):r.complete;H&&Ye(g,H).then(R=>R?X.join([R]):void 0)}let ge={flips:X,opened:!1};return de.set(e.at,ge),ge}),{flips:m}=D,C=(0,u.useSyncExternalStore)(m.subscribe,m.get,m.get),{options:A,shown:b,phase:w,said:ce,note:pe}=C,P=w==="choosing"||w==="keeping",[dn,ln]=(0,u.useState)(()=>new Set),cn=(0,u.useMemo)(()=>a=>ln(f=>f.has(a)?f:new Set([...f,a])),[]),pn=(0,u.useMemo)(()=>a=>m.drop(a),[m]),j=A.filter(a=>dn.has(a.key));(0,u.useEffect)(()=>{D.opened||w!=="choosing"||j.length===0||(D.opened=!0,m.flip(j[0].key))},[D,m,w,j]);let[O,fe]=(0,u.useState)(null);(0,u.useLayoutEffect)(()=>{if(!P)return;let a=J(l);if(!a)return;let f=document.createElement("div");f.setAttribute("data-testid","display-options-stage"),Object.assign(f.style,Ln);let g=rn(a);return g?.parentElement?g.parentElement.insertBefore(f,g.nextSibling):a.insertBefore(f,a.firstChild),fe(f),()=>{f.remove(),fe(null)}},[P]),(0,u.useLayoutEffect)(()=>{let a=O?J(l):null;if(!a)return;let f=b===null;if(O.style.position=f?"absolute":"relative",O.style.height=f?"0":"auto",O.style.visibility=f?"hidden":"visible",O.setAttribute("data-display-shown",b??N),!f){a.setAttribute(le,"");for(let g=O;g!==a&&g.parentElement;g=g.parentElement)for(let E of g.parentElement.children)E!==g&&E!==rn(a)&&E.localName!=="style"&&E.setAttribute(M,"")}return()=>{a.removeAttribute(le);for(let g of a.querySelectorAll(`[${M}]`))g.removeAttribute(M)}});let ye=()=>{de.delete(e.at),n()},F=()=>{let a=J(l);for(let g of a?.querySelectorAll(`[${M}]`)??[])g.removeAttribute(M);O&&(O.style.display="none");let f=e.returnTo?.isConnected?e.returnTo:document.querySelector("[data-graview-page-title], main h1");f&&!f.hasAttribute("tabindex")&&!f.matches("a[href], button, input, select, textarea")&&f.setAttribute("tabindex","-1"),f?.focus?.({preventScroll:!0}),ye()};(0,u.useEffect)(()=>{if(!P||!O)return;let a=location.pathname,f=()=>J(l)?.querySelector("[data-graview-page-title]")?.textContent??null,g=f(),E=setInterval(()=>{m.get().phase!=="keeping"&&(location.pathname!==a||!O.isConnected||f()!==g)&&ye()},250);return()=>clearInterval(E)},[P,O]);let ue=(0,u.useRef)(F);ue.current=F,(0,u.useEffect)(()=>{let a=f=>{f.key!=="Escape"||m.get().phase==="keeping"||document.querySelector("[data-graview-popover]:not([data-better-bar]):not([hidden]), [data-testid='context-menu']")||(f.preventDefault(),ue.current())};return document.addEventListener("keydown",a,!0),()=>document.removeEventListener("keydown",a,!0)},[m]);let W=xe(p,h);(0,u.useEffect)(()=>{!W&&w==="choosing"&&F()},[W,w]);let V=(0,u.useRef)(null),he=(0,u.useRef)(!1);(0,u.useEffect)(()=>{w!=="choosing"||b===null||he.current||(he.current=!0,V.current?.querySelector('[role="radio"][aria-checked="true"]')?.focus({preventScroll:!0}))},[w,j.length,b]);let $=[{key:N,label:"As it is now"},...j],fn=a=>{let f=a.key==="ArrowRight"||a.key==="ArrowDown"?1:a.key==="ArrowLeft"||a.key==="ArrowUp"?-1:0,g=f!==0?$[($.findIndex(E=>E.key===(b??N))+f+$.length)%$.length]:a.key==="Home"?$[0]:a.key==="End"?$.at(-1):void 0;g&&(a.preventDefault(),m.flip(g.key===N?null:g.key),V.current?.querySelector(`[data-option="${CSS.escape(g.key)}"]`)?.focus({preventScroll:!0}))},z=A.find(a=>a.key===b),yn=P?ce??(z?z.label:`${l.name} as it is now`):ce??"",Q=w==="choosing"&&A.length===0;return(0,k.jsxs)(k.Fragment,{children:[O&&P?(0,sn.createPortal)((0,k.jsx)(Rn,{options:A,shown:b,names:I,drew:cn,failed:pn,kind:y,filter:l.filter}),O):null,(0,k.jsx)(Ke,{phase:`options-${w}`,name:l.name,said:Q?`There are no other ways to show ${l.name} yet.`:yn,...P&&!Q?{scope:"Nothing changes until you keep one. Everyone in this app sees the one you keep."}:{},...pe?{note:pe}:{},...w==="choosing"&&z&&W?{keep:()=>void m.keep()}:{},...w==="kept"&&C.canUndo&&W?{undo:()=>void m.undo()}:{},...w!=="keeping"?{close:F}:{},children:w==="choosing"&&!Q?(0,k.jsx)("div",{ref:V,role:"radiogroup","aria-label":`Ways to show ${l.name}`,"data-testid":"display-options",onKeyDown:fn,style:jn,children:$.map(a=>{let f=a.key===(b??N);return(0,k.jsx)("button",{type:"button",role:"radio","aria-checked":f,tabIndex:f?0:-1,"data-testid":"display-option","data-option":a.key,onClick:()=>m.flip(a.key===N?null:a.key),style:f?Kn:an,children:a.label},a.key)})}):null})]})}var Ln={position:"relative",minWidth:"0",maxWidth:"100%",width:"100%",overflow:"clip"},Tn={boxSizing:"border-box",height:"min(72vh, 760px)",display:"grid",gridTemplateRows:"minmax(0, 1fr)",gridTemplateColumns:"minmax(0, 1fr)",overflow:"auto",maxWidth:"100%",borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)"},Hn={display:"grid",gridTemplateColumns:"minmax(0, 1fr)",maxWidth:"100%"},Nn={position:"absolute",top:0,left:0,right:0,visibility:"hidden",pointerEvents:"none"},Mn={display:"grid",gridTemplateRows:"minmax(0, 1fr)",gridTemplateColumns:"minmax(0, 1fr)",minWidth:0,minHeight:0},jn={display:"flex",flexWrap:"wrap",gap:6,marginTop:4},an={minHeight:34,padding:"0 12px",font:"inherit",borderRadius:8,cursor:"pointer",color:"var(--graview-ink)",background:"transparent",border:"1px solid var(--graview-edge)"},Kn={...an,fontWeight:600,border:"1px solid var(--graview-accent)",boxShadow:"inset 0 0 0 1px var(--graview-accent)"};export{rt as DisplaySwitch};
|
|
@@ -0,0 +1,25 @@
|
|
|
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 ot}from"./chunk.SDO3U72B.js";import{De as Ho,Fe as nt,Gd as ko,Ge as Gt,Id as Ao,N as vo,Od as Ro,Pa as bo,Ta as Wt,Ud as To,Va as xo,Xc as jt,ie as Co,pb as Po,se as Mo,te as Oo,zd as Eo,ze as Vo}from"./chunk.ZDUKVXBI.js";import{a as tt,b as I}from"./chunk.AJZBJBMO.js";var Jo=tt(v=>{"use strict";var Yt=Symbol.for("react.transitional.element"),Ri=Symbol.for("react.portal"),Ti=Symbol.for("react.fragment"),Ci=Symbol.for("react.strict_mode"),Mi=Symbol.for("react.profiler"),Oi=Symbol.for("react.consumer"),Vi=Symbol.for("react.context"),Hi=Symbol.for("react.forward_ref"),Ii=Symbol.for("react.suspense"),Li=Symbol.for("react.memo"),zo=Symbol.for("react.lazy"),_i=Symbol.for("react.activity"),Fo=Symbol.iterator;function Di(e){return e===null||typeof e!="object"?null:(e=Fo&&e[Fo]||e["@@iterator"],typeof e=="function"?e:null)}var $o={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Uo=Object.assign,Yo={};function Pe(e,t,n){this.props=e,this.context=t,this.refs=Yo,this.updater=n||$o}Pe.prototype.isReactComponent={};Pe.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Pe.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Zo(){}Zo.prototype=Pe.prototype;function Zt(e,t,n){this.props=e,this.context=t,this.refs=Yo,this.updater=n||$o}var Xt=Zt.prototype=new Zo;Xt.constructor=Zt;Uo(Xt,Pe.prototype);Xt.isPureReactComponent=!0;var Bo=Array.isArray;function Ut(){}var V={H:null,A:null,T:null,S:null},Xo=Object.prototype.hasOwnProperty;function Jt(e,t,n){var o=n.ref;return{$$typeof:Yt,type:e,key:t,ref:o!==void 0?o:null,props:n}}function Ni(e,t){return Jt(e.type,t,e.props)}function Qt(e){return typeof e=="object"&&e!==null&&e.$$typeof===Yt}function Wi(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Ko=/\/+/g;function $t(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Wi(""+e.key):t.toString(36)}function ji(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(Ut,Ut):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function xe(e,t,n,o,r){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(i){case"bigint":case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case Yt:case Ri:a=!0;break;case zo:return a=e._init,xe(a(e._payload),t,n,o,r)}}if(a)return r=r(e),a=o===""?"."+$t(e,0):o,Bo(r)?(n="",a!=null&&(n=a.replace(Ko,"$&/")+"/"),xe(r,t,n,"",function(c){return c})):r!=null&&(Qt(r)&&(r=Ni(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(Ko,"$&/")+"/")+a)),t.push(r)),1;a=0;var s=o===""?".":o+":";if(Bo(e))for(var l=0;l<e.length;l++)o=e[l],i=s+$t(o,l),a+=xe(o,t,n,i,r);else if(l=Di(e),typeof l=="function")for(e=l.call(e),l=0;!(o=e.next()).done;)o=o.value,i=s+$t(o,l++),a+=xe(o,t,n,i,r);else if(i==="object"){if(typeof e.then=="function")return xe(ji(e),t,n,o,r);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return a}function ct(e,t,n){if(e==null)return e;var o=[],r=0;return xe(e,o,"","",function(i){return t.call(n,i,r++)}),o}function Gi(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var qo=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Fi={map:ct,forEach:function(e,t,n){ct(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ct(e,function(){t++}),t},toArray:function(e){return ct(e,function(t){return t})||[]},only:function(e){if(!Qt(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};v.Activity=_i;v.Children=Fi;v.Component=Pe;v.Fragment=Ti;v.Profiler=Mi;v.PureComponent=Zt;v.StrictMode=Ci;v.Suspense=Ii;v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=V;v.__COMPILER_RUNTIME={__proto__:null,c:function(e){return V.H.useMemoCache(e)}};v.cache=function(e){return function(){return e.apply(null,arguments)}};v.cacheSignal=function(){return null};v.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var o=Uo({},e.props),r=e.key;if(t!=null)for(i in t.key!==void 0&&(r=""+t.key),t)!Xo.call(t,i)||i==="key"||i==="__self"||i==="__source"||i==="ref"&&t.ref===void 0||(o[i]=t[i]);var i=arguments.length-2;if(i===1)o.children=n;else if(1<i){for(var a=Array(i),s=0;s<i;s++)a[s]=arguments[s+2];o.children=a}return Jt(e.type,r,o)};v.createContext=function(e){return e={$$typeof:Vi,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:Oi,_context:e},e};v.createElement=function(e,t,n){var o,r={},i=null;if(t!=null)for(o in t.key!==void 0&&(i=""+t.key),t)Xo.call(t,o)&&o!=="key"&&o!=="__self"&&o!=="__source"&&(r[o]=t[o]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var s=Array(a),l=0;l<a;l++)s[l]=arguments[l+2];r.children=s}if(e&&e.defaultProps)for(o in a=e.defaultProps,a)r[o]===void 0&&(r[o]=a[o]);return Jt(e,i,r)};v.createRef=function(){return{current:null}};v.forwardRef=function(e){return{$$typeof:Hi,render:e}};v.isValidElement=Qt;v.lazy=function(e){return{$$typeof:zo,_payload:{_status:-1,_result:e},_init:Gi}};v.memo=function(e,t){return{$$typeof:Li,type:e,compare:t===void 0?null:t}};v.startTransition=function(e){var t=V.T,n={};V.T=n;try{var o=e(),r=V.S;r!==null&&r(n,o),typeof o=="object"&&o!==null&&typeof o.then=="function"&&o.then(Ut,qo)}catch(i){qo(i)}finally{t!==null&&n.types!==null&&(t.types=n.types),V.T=t}};v.unstable_useCacheRefresh=function(){return V.H.useCacheRefresh()};v.use=function(e){return V.H.use(e)};v.useActionState=function(e,t,n){return V.H.useActionState(e,t,n)};v.useCallback=function(e,t){return V.H.useCallback(e,t)};v.useContext=function(e){return V.H.useContext(e)};v.useDebugValue=function(){};v.useDeferredValue=function(e,t){return V.H.useDeferredValue(e,t)};v.useEffect=function(e,t){return V.H.useEffect(e,t)};v.useEffectEvent=function(e){return V.H.useEffectEvent(e)};v.useId=function(){return V.H.useId()};v.useImperativeHandle=function(e,t,n){return V.H.useImperativeHandle(e,t,n)};v.useInsertionEffect=function(e,t){return V.H.useInsertionEffect(e,t)};v.useLayoutEffect=function(e,t){return V.H.useLayoutEffect(e,t)};v.useMemo=function(e,t){return V.H.useMemo(e,t)};v.useOptimistic=function(e,t){return V.H.useOptimistic(e,t)};v.useReducer=function(e,t,n){return V.H.useReducer(e,t,n)};v.useRef=function(e){return V.H.useRef(e)};v.useState=function(e){return V.H.useState(e)};v.useSyncExternalStore=function(e,t,n){return V.H.useSyncExternalStore(e,t,n)};v.useTransition=function(){return V.H.useTransition()};v.version="19.2.8"});var W=tt((Ts,Qo)=>{"use strict";Qo.exports=Jo()});var ur=tt(gt=>{"use strict";var na=Symbol.for("react.transitional.element"),oa=Symbol.for("react.fragment");function dr(e,t,n){var o=null;if(n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),"key"in t){n={};for(var r in t)r!=="key"&&(n[r]=t[r])}else n=t;return t=n.ref,{$$typeof:na,type:e,key:o,ref:t!==void 0?t:null,props:n}}gt.Fragment=oa;gt.jsx=dr;gt.jsxs=dr});var Ne=tt((Ws,cr)=>{"use strict";cr.exports=ur()});var ve={focusId:null,relation:null,expanded:[],pins:{}},rt=e=>{let t=Number(e);return Number.isFinite(t)?t:null};function J(e){let t=new URLSearchParams;e.focusId&&t.set("focus",e.focusId),e.relation&&t.set("relation",e.relation),e.overview&&t.set("overview","1"),e.zoom&&t.set("zoom","1"),e.past&&t.set("past","1"),e.shown&&e.shown.length>0&&t.set("show",[...e.shown].sort().join(",")),e.selection!==void 0&&e.selection.length>0&&t.set("sel",[...e.selection].sort().join(",")),e.expanded.length>0&&t.set("expand",[...e.expanded].sort().join(","));for(let o of Object.keys(e.pins).sort()){let r=e.pins[o];t.set(`pin.${o}`,`${it(r.x)},${it(r.y)}`)}e.pan&&(e.pan.x!==0||e.pan.y!==0)&&t.set("pan",`${it(e.pan.x)},${it(e.pan.y)}`);for(let o of Object.keys(e.within??{}).sort()){let r=e.within[o];r.length>0&&t.set(`in.${o}`,r)}e.q&&e.q.trim().length>0&&t.set("q",e.q);let n=t.toString();return n?`#${n}`:"#"}function bi(e){return e&&e.startsWith("agg:")?`aggregate:${e.slice(4)}`:e}function at(e){let t=e.includes("#")?e.slice(e.indexOf("#")+1):e,n=new URLSearchParams(t),o=Object.create(null);for(let[y,g]of n){if(!y.startsWith("pin."))continue;let[m,x]=g.split(","),R=m===void 0?null:rt(m),p=x===void 0?null:rt(x);R===null||p===null||(o[y.slice(4)]={x:R,y:p})}let r=Object.create(null);for(let[y,g]of n)!y.startsWith("in.")||g.length===0||(r[y.slice(3)]=g);let i=n.get("view");i&&i.length>0&&r.view===void 0&&(r.view=i);let a=n.get("pan")?.split(",")??[],s=a[0]===void 0?null:rt(a[0]),l=a[1]===void 0?null:rt(a[1]),c=(n.get("sel")??"").split(",").filter(y=>y.length>0).sort(),u=n.get("overview")==="1";return{...c.length>0?{selection:c}:{},...u?{overview:!0}:{},...n.get("zoom")==="1"?{zoom:!0}:{},...n.get("past")==="1"?{past:!0}:{},...n.get("show")?{shown:[...new Set(n.get("show").split(",").filter(Boolean))].sort()}:{},...s!==null&&l!==null?{pan:{x:s,y:l}}:{},...Object.keys(r).length>0?{within:r}:{},...n.get("q")?.trim()?{q:n.get("q")}:{},focusId:bi(n.get("focus")),relation:n.get("relation"),expanded:(n.get("expand")??"").split(",").filter(y=>y.length>0&&(u||!y.startsWith("kind:"))).sort(),pins:o}}function cs(e){let t=at(e);return J(t)==="#"?{...t,overview:!0}:t}function fs(e){let t=J(e);return t==="#overview=1"?"":t}function it(e){return Math.round(e*100)/100}function Lo(e,t){return J(e)===J(t)}var Io="edge:";function _o(e){if(!e.startsWith(Io))return null;let t=e.slice(Io.length).split(":");if(t.length!==3)return null;let[n,o,r]=t;if(!n||!o||!r)return null;try{return{kind:decodeURIComponent(n),from:decodeURIComponent(o),to:decodeURIComponent(r)}}catch{return null}}function Ft(e){let{pan:t,...n}=e;return{...n,pins:{}}}function Y(e,t){if(t===e.focusId)return{...e,focusId:t};let n=Ft(e);return{...n.within?.q!==void 0?ie(n,"q",null):n,focusId:t}}function Do(e,t){return{...e,relation:t}}function ie(e,t,n){let o={...e.within??{}};if(n===null?delete o[t]:o[t]=n,Object.keys(o).length===0){let{within:r,...i}=e;return i}return{...e,within:o}}function fe(e,t){if(t!==e.overview&&(e=Ft(e)),!t){let n=e.expanded.filter(o=>!o.startsWith("kind:"));return{...e,overview:!1,expanded:n}}return{...e,overview:t}}function st(e,t){if(t.length===0){let{selection:n,...o}=e;return o}return{...e,selection:[...t]}}function _e(e,t){if(t!==(e.zoom===!0)&&(e=Ft(e)),!t){let{zoom:n,...o}=e;return o}return{...e,zoom:!0}}function lt(e,t){let n=new Set(e.expanded);return n.has(t)?n.delete(t):n.add(t),{...e,expanded:[...n].sort()}}var ut="aggregate:",dt="kind:";function Bt(e){return`${dt}${e}`}function be(e){return e.startsWith(dt)?e.slice(dt.length):null}var gs="kinds:beyond";function xi(e){let t=be(e);return t?[t]:pe(e)}function ae(...e){return`${ut}${[...e].sort().join("+")}`}function No(e){return e.startsWith(ut)}function pe(e){return!No(e)||e.includes("|")?[]:e.slice(ut.length).split("+").filter(Boolean)}function Wo(e,t,n={}){let o=be(t);if(o!==null&&e.overview&&n.ownPicture!==!0)return lt(e,t);let r=o!==null?ae(o):t;if(e.zoom&&e.focusId===r&&!(o!==null&&n.carry))return _e(e,!1);if(o!==null&&n.carry){let i=fe({...Y(e,r),relation:null},!1);return ie(_e(i,!0),"q",n.carry)}return _e({...Y(e,r),relation:null},!0)}function Pi(e,t,n){return ie(fe(Y(e,ae(t)),!1),"view",n)}function ms(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var jo="aggregate:";function Kt(e){return e.startsWith(jo)&&e.includes("|")}var qt=e=>e?.off===!0,Ei=e=>e!==void 0&&!qt(e)&&(e.fast!==void 0||e.thinking!==void 0||e.answer!==void 0||e.decide!==void 0||e.complete!==void 0||e.turn!==void 0),Go=e=>e!==void 0&&!qt(e)&&(e.fast!==void 0||e.decide!==void 0),ki=e=>e?.suggestOnOpen!==!1&&Go(e),Ai=e=>e?.hoverChips===!0&&Go(e);var zt={};var er=I(W(),1),Bi={turns:[],outcomes:new Map,busy:!1,pending:null,draft:null,draftNote:null},tr=e=>`graview:seat:${e}`;function Ki(e){if(!e)return{};try{let t=sessionStorage.getItem(e);if(!t)return{};let n=JSON.parse(t);return{...Array.isArray(n.turns)?{turns:n.turns}:{},...Array.isArray(n.outcomes)?{outcomes:new Map(n.outcomes)}:{},...n.draft?.drawn?{draft:n.draft}:{}}}catch{return{}}}function qi(e,t){if(e)try{sessionStorage.setItem(e,JSON.stringify({turns:t.turns.slice(-40),outcomes:[...t.outcomes],draft:t.draft}))}catch{}}function en(e){let t=e===null?null:tr(e),n={...Bi,...Ki(t)},o=new Set,r=(i,a=!0)=>{n=i,a&&qi(t,n);for(let s of[...o])s()};return{get:()=>n,subscribe(i){return o.add(i),()=>void o.delete(i)},setTurns:i=>r({...n,turns:i(n.turns)}),settle:(i,a)=>r({...n,outcomes:new Map(n.outcomes).set(i,a)}),setBusy:i=>r({...n,busy:i},!1),ask:i=>r({...n,pending:i.trim()||null}),takePending(){let i=n.pending;return i!==null&&r({...n,pending:null},!1),i},setDraft:(i,a=null)=>r({...n,draft:i,draftNote:a})}}function zi(e){return(0,er.useSyncExternalStore)(e.subscribe,e.get,e.get)}var or=I(W(),1),$i={entries:[],ghost:null,loaded:!1};function nr(e,t){let n=new Map(e.map(o=>[o.id,o]));for(let o of t)n.set(o.id,{...n.get(o.id),...o});return[...n.values()].sort((o,r)=>o.at<r.at?1:o.at>r.at?-1:0)}function tn(e){let t=$i,n=new Set,o=r=>{t=r;for(let i of[...n])i()};return{get:()=>t,subscribe:r=>(n.add(r),()=>n.delete(r)),record:r=>{o({...t,entries:nr(t.entries,[r])}),Promise.resolve(e()?.keep?.(r)).catch(i=>{console.warn("The host did not keep an AI interaction:",i)})},setGhost:r=>o({...t,ghost:r}),load:()=>{if(t.loaded)return;o({...t,loaded:!0});let r=e()?.load;r&&Promise.resolve(r()).then(i=>o({...t,entries:nr(t.entries,i)})).catch(i=>{console.warn("The host's AI interactions could not be read:",i)})}}}function Ui(e){return(0,or.useSyncExternalStore)(e.subscribe,e.get,e.get)}function rr(e){return e?.closest?.("[data-graview-pick]")?.getAttribute("data-graview-pick")??null}function Os(e,t,n,o){for(let r=e;r&&r!==t?.parentElement;r=r.parentElement){if(typeof r.querySelectorAll!="function")continue;let i=[...new Set([...r.querySelectorAll("[data-graview-pick]")].map(s=>s.getAttribute("data-graview-pick")??"").filter(s=>s!==""&&s!==o))];if(i.length===0)continue;let a=i[0];return i.slice(1).every(s=>n(a,s))?a:null}return null}var se=I(W(),1),ft=(0,se.createContext)(void 0),Yi=()=>(0,se.useContext)(ft),pt=(0,se.createContext)(void 0),Zi=()=>(0,se.useContext)(pt),yt=(0,se.createContext)(void 0),Xi=()=>(0,se.useContext)(yt);var P=I(W(),1),De=(0,P.createContext)(null);function ar(){return(0,P.useContext)(De)}function Ji(e,t){let n=ar(),o=(0,P.useMemo)(()=>n?n.live.seenBy(t):e,[n,e,t]),r=(0,P.useRef)(0),i=(0,P.useCallback)(a=>o.subscribe(()=>{r.current+=1,a()}),[o]);return(0,P.useSyncExternalStore)(i,()=>r.current,()=>0),o}function Qi(){let e=new Set,t=null,n=!1,o=!1;return{show(r){if(o)return!1;let i={focus:r?.focus===!0};if(e.size===0)return n||(t=i),!1;for(let a of[...e])a(i);return!0},listen(r){if(o)return()=>{};if(e.add(r),t){let i=t;t=null,r(i)}return()=>void e.delete(r)},settle(){n=!0,setTimeout(()=>{e.size===0&&(t=null)},0)},unsettle(){n=!1},forget(){t=null,n=!1},close(){o=!0,t=null,e.clear()}}}var ea=(0,P.createContext)(null),sr=ot(()=>(__graviewPreload(import.meta.url,["./chunk.YFVJUHAK.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.FC6AF6CC.js")));function nn(e){let[,t]=(0,P.useReducer)(o=>o+1,0),n=e.publishing?.mode==="on-publish"&&!ko();return(0,P.useEffect)(()=>{n&&sr().then(t,()=>{})},[n]),!n}var ir,ta=400;function on(e,t,n){let o=(0,P.useContext)(De),r=o!==null&&o.owns(e,t),[i,a]=(0,P.useState)(null),[s,l]=(0,P.useState)(ir);(0,P.useEffect)(()=>{if(s||r||i===null)return;let H=!0;return sr().then(q=>{ir=q,H&&l(q)},()=>{}),()=>{H=!1}},[s,r,i]);let[c,u]=(0,P.useState)(0),[y,g]=(0,P.useMemo)(()=>r||i===null||!s?[]:[i>=e.log.length?void 0:s.askArchived(e,i,n)??s.askDeclaration(n,i),s.keptOf(e,n)],[r,e,i,n,s,c]),m=y&&"waiting"in y?y.waiting:void 0,x=y&&"seq"in y?y:null,[R,p]=(0,P.useState)(void 0);(0,P.useEffect)(()=>{if(!m)return;let H=!0,q=setTimeout(()=>H&&p(m),ta);return m.then(()=>H&&u(Z=>Z+1)),()=>{H=!1,clearTimeout(q)}},[m]);let h=m!==void 0&&R!==m||x!==null,w=(0,P.useMemo)(()=>{if(r||i===null||i>=e.log.length||!s||h)return null;try{let H=s.pastAt(e,i,n);return{seq:i,at:H.past?.at,store:H}}catch{return null}},[r,e,i,n,s,h,c]),k=(0,P.useRef)(null),E=h?k.current:w;(0,P.useEffect)(()=>{k.current=E},[E]);let[K,j]=(0,P.useState)(!1),G=(0,P.useCallback)((H,q)=>{a(H===null?null:H>=e.log.length?Number.POSITIVE_INFINITY:H),j(H!==null&&q?.focus===!0)},[e]),T=(0,P.useCallback)(()=>j(!1),[]),F=(0,P.useCallback)((H,q)=>[e,E?.store].some(Z=>Z!==void 0&&(Z===H||Z.seenBy(q)===H)),[e,E]),L=i!==null,_=(0,P.useMemo)(()=>({past:E,open:L,show:G,focusWanted:K,focused:T,live:e,host:n,owns:F,archive:x,kept:g}),[E,L,G,K,T,e,n,F,x,g]);return r?o:_}var lr=I(W(),1),rn=(0,lr.createContext)(null);var fr=e=>`graview:setting:${e}`;function pr(){return localStorage}function yr(e,t){try{let n=(t??pr()).getItem(fr(e.name));if(n!==null&&e.options.some(o=>o.value===n))return n}catch{}return e.initial}function gr(e,t,n){try{(n??pr()).setItem(fr(e.name),t)}catch{}}function mr(e,t){if(typeof document>"u")return;let n=document.documentElement;if(e.honored==="root-font-size"){n.style.fontSize=t===e.initial?"":t;return}let o=`graview${e.name.replace(/-([a-z0-9])/g,(r,i)=>i.toUpperCase()).replace(/^[a-z]/,r=>r.toUpperCase())}`;t===e.initial?delete n.dataset[o]:n.dataset[o]=t}var A=I(W(),1);function an(e){return nt(e)}var ra=12,ia=4;function aa(e,t,n){let o=an(t);return e.get(o)??{participant:o,who:t.id??t.kind,at:null,mode:"docked",since:n,trail:[]}}var mt=(e,t)=>t===null||e[e.length-1]===t?e:[...e,t].slice(-ra);function hr(e,t){let n=e.filter(r=>r.length>0);if(n.length===0)return null;if(n.length<=ia)return n[0];let o=new Set(n.map(r=>t(r)).filter(r=>r!==void 0));return o.size===1?Bt([...o][0]):n[0]}function sn(e,t,n){let o=new Map(e);if(t.type==="rest"){for(let[a,s]of e)s.mode!=="asking"&&s.mode!=="docked"&&t.at-s.since>=t.holdMs&&o.set(a,{...s,mode:"docked",at:null,trail:[],say:void 0,confidence:void 0});return o}if(t.author.kind!=="agent")return o;let r=aa(e,t.author,t.at),i=a=>o.set(r.participant,{...r,...a,since:t.at});switch(t.type){case"read":{let a=hr(t.ids,n);return i({at:a,mode:"reading",trail:mt(r.trail,a)}),o}case"about-to-write":case"write":{let a=hr(t.ids,n);return i({at:a,mode:"writing",trail:mt(r.trail,a),say:void 0,confidence:void 0}),o}case"refused":return i({at:t.where,mode:"refused",say:t.say,confidence:void 0,trail:mt(r.trail,t.where)}),o;case"asking":return i({at:t.where??r.at,mode:"asking",say:t.say,...t.confidence!==void 0?{confidence:t.confidence}:{confidence:void 0},trail:mt(r.trail,t.where)}),o;case"said":return i({say:t.say,...t.confidence!==void 0?{confidence:t.confidence}:{confidence:void 0},...t.caption?{caption:t.caption}:{}}),o;case"over":return i({over:t.over}),o;case"home":return i({at:null,mode:"docked",trail:[],say:void 0,confidence:void 0,over:null}),o;default:return o}}var wr="graview:session";function vr(e){let t=()=>typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID().slice(0,8):Math.random().toString(36).slice(2,10);try{let n=e??sessionStorage,o=n.getItem(wr);if(o)return o;let r=t();return n.setItem(wr,r),r}catch{return t()}}var ln={name:"share-where",title:"Where you are",description:"Whether the others here see which stop you are on.",honored:"root-attribute",options:[{value:"shared",label:"Shown"},{value:"private",label:"Hidden"}],initial:"shared"},dn={name:"share-over",title:"What you point at",description:"Whether the others see the thing under your pointer, outlined in your color.",honored:"root-attribute",options:[{value:"private",label:"Kept to yourself"},{value:"shared",label:"Outlined for others"}],initial:"private"},br=[ln,dn],Sr=800;function xr(e){let{channel:t,store:n,view:o,principal:r,session:i,robots:a,seatWho:s,settingValues:l,setView:c,ttlMs:u=Ho,people:y,seats:g}=e,[m,x]=(0,A.useState)(()=>new Map),[R,p]=(0,A.useState)(null),[h,w]=(0,A.useState)(null),[k,E]=(0,A.useState)(null),K=typeof r.id=="string"&&r.id.length>0,j=K&&(l[ln.name]??ln.initial)==="shared",G=j&&(l[dn.name]??dn.initial)==="shared",T=an({kind:r.kind,...r.id?{id:r.id}:{},session:i}),F=K?Po(r,{graph:n.graph,schema:n.schema,...g?{seats:g}:{},...y?{people:y}:{}}):"",L=s?a.get(`agent:${s}:${i}`):void 0,_=(0,A.useMemo)(()=>!t||!j?null:{participant:T,kind:r.kind,name:F,...r.onBehalfOf?.id?{onBehalfOf:r.onBehalfOf.id,...r.onBehalfOf.name?{onBehalfOfName:r.onBehalfOf.name}:{}}:{},hue:jt(r.id??"nobody"),stop:k??J(o),...G?{over:R}:{},...L?{robot:{at:L.at,mode:L.mode}}:{},at:new Date().toISOString()},[t,j,G,T,F,r.id,r.kind,r.onBehalfOf?.id,r.onBehalfOf?.name,o,k,R,L?.at,L?.mode]),H=(0,A.useRef)(null),q=b=>b&&t?.here({...b,caret:H.current??void 0,at:new Date().toISOString()}),Z=(0,A.useCallback)(b=>{H.current=b,q(_)},[t,_]);(0,A.useEffect)(()=>{if(!_)return;q(_);let b=setInterval(()=>q(_),Sr);return()=>clearInterval(b)},[t,_]),(0,A.useEffect)(()=>t?t.onWho(D=>x(Gt(new Map,D,Date.now(),u))):void 0,[t,u]);let me=m.size>0;(0,A.useEffect)(()=>{if(!me)return;let b=setInterval(()=>{x(D=>{let de=Gt(D,[],Date.now(),u);return de.size===D.size?D:de})},Math.max(250,Math.min(1e3,u/4)));return()=>clearInterval(b)},[me,u]),(0,A.useEffect)(()=>{if(!t||typeof window>"u")return;let b=()=>t.leave();return window.addEventListener("pagehide",b),()=>window.removeEventListener("pagehide",b)},[t]),(0,A.useEffect)(()=>{if(!G||typeof document>"u")return;let b=null,D=de=>{let $=rr(de.target);$!==b&&(b=$,p($))};return document.addEventListener("pointermove",D,{passive:!0}),()=>document.removeEventListener("pointermove",D)},[G]);let he=(0,A.useRef)(null),ne=h?m.get(h)??null:null,Be=(0,A.useCallback)(b=>{he.current=null,w(b)},[]);(0,A.useEffect)(()=>{if(h){if(!ne){w(null);return}ne.stop!==he.current?.stop&&(he.current={stop:ne.stop,at:Date.now()},c(at(ne.stop)))}},[h,ne,c]),(0,A.useEffect)(()=>{let b=he.current;!h||b===null||Date.now()-b.at<400||Lo(o,at(b.stop))||w(null)},[o,h]),(0,A.useEffect)(()=>{if(!h||typeof document>"u")return;let b=D=>{D.key==="Escape"&&w(null)};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[h]);let[oe,Ke]=(0,A.useState)(null),Te=(0,A.useRef)(J(o));Te.current=k??J(o);let qe=(0,A.useCallback)(b=>Ke(D=>(b===null&&D&&t?.alsoHere?.({...D,at:new Date().toISOString(),until:new Date().toISOString()}),b===null?null:{hue:jt("graview"),...b,stop:Te.current,at:new Date().toISOString()})),[t]);(0,A.useEffect)(()=>{if(!oe||!t?.alsoHere)return;let b=()=>t.alsoHere?.({...oe,at:new Date().toISOString()});b();let D=setInterval(b,Sr);return()=>clearInterval(D)},[oe,t]);let ze=(0,A.useMemo)(()=>{if(!oe)return m;let b=new Map(m);return b.set(oe.participant,{...oe,at:new Date().toISOString()}),b},[m,oe]),$e=_!==null,Ue=(0,A.useMemo)(()=>$e?{participant:T,name:F}:null,[$e,T,F]);return(0,A.useMemo)(()=>({who:ze,aiHere:qe,sharing:Ue,following:ne,follow:Be,sayWhere:E,sayCaret:Z}),[ze,qe,Ue,ne,Be,Z])}var Q=I(W(),1);function Pr(e){return nt(e.author)}function sa(e,t){return e.length>1?"co-edited":t==="rule"?"rule":t==="agent"?"autonomous":"directed"}function Er(e,t,n,o,r){let i=new Map;for(let[l,c]of e)o-c.at<r&&i.set(l,c);let a=new Set(n.flatMap(l=>l.nodeIds)),s=(l,c,u)=>{let y=i.get(l),g=y?.participants.includes(Pr(c))?y.participants:[...y?.participants??[],Pr(c)];i.set(l,{at:o,manner:sa(g,c.author.kind),intent:c.intent,wrote:(y?.wrote??!1)||(u.wrote??!1),read:(y?.read??!1)||(u.read??!1),broke:(y?.broke??!1)||a.has(l),participants:g})};for(let l of t){for(let c of l.writes)s(c,l,{wrote:!0});for(let c of l.reads)l.writes.includes(c)||s(c,l,{read:!0})}for(let l of n)for(let c of l.nodeIds){let u=i.get(c);i.set(c,{at:o,manner:u?.manner??"rule",intent:u?.intent??l.message,wrote:u?.wrote??!1,read:u?.read??!1,broke:!0,participants:u?.participants??["rule::"]})}return i}var la=2600;function kr(e,t=la){let[n,o]=(0,Q.useState)(()=>new Map),r=(0,Q.useRef)(n);r.current=n;let i=(0,Q.useRef)(null),a=(0,Q.useCallback)(l=>{r.current=l,o(l),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{r.current=new Map,o(new Map)},t)},[t]);(0,Q.useEffect)(()=>{let l=e.violations(),c=e.subscribe((u,y)=>{let g=e.violations(),m=To(e.allInvariants(),l,g).introduces;l=g,a(Er(r.current,y,m.map(x=>({nodeIds:x.nodeIds,message:x.message})),Date.now(),t))});return()=>{c(),i.current&&clearTimeout(i.current)}},[e,t,a]);let s=(0,Q.useCallback)(l=>{l.reads.length!==0&&a(Er(r.current,[da(l)],[],Date.now(),t))},[t,a]);return{activity:n,noteAttention:s}}function da(e){return{id:`attention:${e.intent}`,seq:-1,batch:"attention",author:e.author,intent:e.intent,mutation:null,primitives:[],reads:e.reads,writes:[],at:new Date().toISOString()}}var d=I(W(),1);function Ar(){let e=null,t=new Set,n=new Set,o=r=>{for(let i of n)i(r)};return{subscribe(r){return t.add(r),t.size===1&&o(!0),()=>{t.delete(r),t.size===0&&(e=null,o(!1))}},snapshot:()=>e,set(r){if(!(e===r||e&&r&&e.x===r.x&&e.y===r.y)){e=r;for(let i of t)i()}},get listeners(){return t.size},onActive(r){return n.add(r),()=>void n.delete(r)}}}var ht=I(W(),1),ua=e=>e.definitions.some(t=>bo(t).size>0);function Rr(e,t,n){let[o,r]=(0,ht.useState)(void 0),i=(n.roles??[]).join("\0"),a=n.onBehalfOf?JSON.stringify(n.onBehalfOf):"";return(0,ht.useEffect)(()=>{if(!t||!ua(e.schema)){r(void 0);return}let s=!0,l=!1,c=e.graph,u=()=>{l||(l=!0,queueMicrotask(()=>{l=!1,s&&e.reread()}))},y=xo(t,{kind:n.kind,...n.id===void 0?{}:{id:n.id},...n.roles?{roles:n.roles}:{},...n.onBehalfOf?{onBehalfOf:n.onBehalfOf}:{}},u);return Wt(c,y.read),r(y),e.reread(),()=>{s=!1,Wt(c,void 0)}},[e,t,n.kind,n.id,i,a]),o}function Tr(){let e=!1,t=new Set;return{moving:()=>e,set(n){if(n!==e){e=n;for(let o of t)o()}},subscribe(n){return t.add(n),()=>t.delete(n)}}}var ee=I(Ne(),1),ca="graview:place-menu",We=(0,d.createContext)(null),Vr=(0,d.createContext)("scene");function fa({mode:e,children:t}){return(0,ee.jsx)(Vr.Provider,{value:e,children:t})}function pa(){return(0,d.useContext)(Vr)}var Hr={kind:"human"},ya=[],ga=[],ma=[],un=[];function Ir(e,t){let n=(0,d.useId)();(0,d.useEffect)(()=>{if(!globalThis.__graviewWatch)return;let o=t??Hr,r=()=>Ro(e,o,n);r();let i,a=e.subscribe(()=>{clearTimeout(i),i=setTimeout(r,250)});return()=>{clearTimeout(i),a(),globalThis.__graviewWatch?.unseen?.({words:[],from:n,gone:!0})}},[e,t,n])}var ha=()=>{try{return typeof location<"u"&&new URLSearchParams(location.search).get("as")==="published"?"published":void 0}catch{return}},wa={off:!0};function Sa({store:e,views:t,initialView:n,scheme:o="dark",initialSelection:r,principal:i,as:a,seats:s=ya,onSeat:l,people:c=ga,memory:u,presenceTtlMs:y,app:g,settings:m=g?.settings??ma,presence:x,typing:R,brand:p,locale:h,timeZone:w,onKeepLens:k,onProposeChange:E,composeChange:K,onDraftChange:j,displayOptions:G,providers:T,ai:F,files:L,viewerState:_,assetsAt:H,resolveApp:q,history:Z,linkedRecords:me,menuSections:he,keptViews:ne,onExport:Be,subscriptions:oe,dismissals:Ke,whileAway:Te,notifications:qe,onNotificationsSeen:ze,workflowRuns:$e,signIn:Ue,view:b,onViewChange:D,children:de}){let $=(0,d.useContext)(We),Rn=he??$?.menuSections,Tn=Ue??$?.signIn,Rt=$e??$?.workflowRuns,Tt=ne??$?.keptViews,Ct=Be??$?.onExport,Mt=qe??$?.notifications,Ot=ze??$?.onNotificationsSeen,[si,li]=(0,d.useState)(null),we=si??i??s[0]?.principal??Hr,Ye=on(e,we,Z),Cn=Ye.past&&Ye.live===e?Ye.past.store:e,Vt=a??ha(),Ht=!nn(e),N=(0,d.useMemo)(()=>Ht?e:Cn.seenBy(we,Vt?{as:Vt}:void 0),[Ht,e,Cn,we,Vt]);Ir(e,we);let[ue]=(0,d.useState)(()=>vr(u)),[Mn,di]=(0,d.useState)(!1),On=(0,d.useCallback)(()=>di(!0),[]),ce=(0,d.useMemo)(()=>x?[...m,...br]:m,[m,x]),[It]=(0,d.useState)(()=>n??yn(t,e.schema)),[ui,Vn]=(0,d.useState)(()=>st(It??ve,r??It?.selection??[])),Ce=(0,d.useRef)(It??ve).current,[Hn,ci]=(0,d.useState)(null),[In,fi]=(0,d.useState)(null),z=(0,d.useContext)(We),[Ln]=(0,d.useState)(()=>z?.seatTalk??en(p?.name??e.schema.kinds.join(","))),Lt=F??z?.ai??zt,Ze=(0,d.useMemo)(()=>Lt.off?wa:Lt,[Lt]),_n=(0,d.useRef)(Ze.interactions);_n.current=Ze.interactions;let[Dn]=(0,d.useState)(()=>z?.aiDesk??tn(()=>_n.current)),[pi]=(0,d.useState)(()=>z?.subscriptions??Ao()),Nn=oe??z?.subscriptions??pi,_t=k??z?.onKeepLens,Wn=E??z?.onProposeChange,jn=K??z?.composeChange,Gn=j??z?.onDraftChange,Fn=G??z?.displayOptions,Xe=g??z?.app,Je=h??z?.locale,yi=p?.locale??Xe?.brand?.locale,Qe=w??z?.timeZone;vo({reader:Je,app:yi,readerTimeZone:Qe,appTimeZone:p?.timeZone??Xe?.brand?.timeZone});let Bn=(0,d.useRef)(null),Kn=(0,d.useCallback)(f=>{Bn.current=f},[]),qn=(0,d.useCallback)(f=>Bn.current?.whereIs(f)??null,[]),[zn]=(0,d.useState)(()=>Ar()),[$n]=(0,d.useState)(()=>Tr()),[Dt,gi]=(0,d.useState)(null),[Me,Un]=(0,d.useState)(()=>new Map),Oe=(0,d.useRef)(Me);Oe.current=Me;let Ve=(0,d.useRef)(null),Nt=(0,d.useCallback)(f=>N.graph.getNode(f)?.kind,[N]),re=(0,d.useCallback)(f=>{let S=sn(Oe.current,f,Nt);Oe.current=S,Un(S),Ve.current&&clearTimeout(Ve.current),[...S.values()].some(O=>O.mode!=="docked"&&O.mode!=="asking")&&(Ve.current=setTimeout(()=>{let O=sn(Oe.current,{type:"rest",at:Date.now(),holdMs:pn},Nt);Oe.current=O,Un(O)},pn+20))},[Nt]),Yn=(0,d.useCallback)(f=>re({...f,at:f.at??Date.now()}),[re]),Zn=(0,d.useCallback)(f=>{gi(f),f&&re({type:"home",author:{kind:"agent",id:f,session:ue},at:Date.now()})},[re,ue]);(0,d.useEffect)(()=>N.subscribe((f,S)=>{for(let C of S)C.author.kind==="agent"&&re({type:"write",author:C.author,ids:C.writes,at:Date.now()})}),[N,re]),(0,d.useEffect)(()=>()=>{Ve.current&&clearTimeout(Ve.current)},[]);let X=(0,d.useMemo)(()=>({...we,session:ue}),[we,ue]),Xn=Rr(N,me,X),Jn=(0,d.useCallback)(f=>{li(f),l?.(f)},[l]),[He,mi]=(0,d.useState)(()=>Object.fromEntries(ce.map(f=>[f.name,yr(f,u)])));(0,d.useEffect)(()=>{for(let f of ce)mr(f,He[f.name]??f.initial)},[ce,He]);let Qn=(0,d.useCallback)((f,S)=>{let C=ce.find(O=>O.name===f);!C||!C.options.some(O=>O.value===S)||(gr(C,S,u),mi(O=>({...O,[f]:S})))},[ce,u]),[eo,hi]=(0,d.useState)(null),{activity:to,noteAttention:no}=kr(N),oo=(0,d.useCallback)(f=>{no(f),re({type:"read",author:f.author,ids:f.reads,at:Date.now()})},[no,re]),Se=(0,d.useCallback)(f=>{if(be(f)!==null||pe(f).length>0||Kt(f))return!0;let S=_o(f);return S?N.graph.allEdges().some(C=>C.kind===S.kind&&C.from===S.from&&C.to===S.to):N.graph.getNode(f)!==void 0},[N]),ro=(0,d.useCallback)(f=>{let S=f.selection??un,C=S.filter(Se),O=C.length===S.length?f:st(f,C);return O.focusId!==null&&!Se(O.focusId)&&(O=Y(O,null)),O},[Se]),Ie=(0,d.useCallback)(f=>{let S=ro(f),C=Or(N,X,S.shown);if(S.focusId!==null&&C.size>0){let O=pe(S.focusId),So=N.graph.getNode(S.focusId);(O.length>0?O.every(vi=>C.has(vi)):So?C.has(So.kind):!1)&&(S={...S,focusId:null})}if(!S.overview&&S.focusId===null){let O=Ce.focusId!==null&&!Se(Ce.focusId)?yn(t,e.schema)??{...ve,overview:!0}:Ce;O.focusId!==null&&Se(O.focusId)?S={...S,focusId:O.focusId}:O.overview===!0&&(S={...S,overview:!0})}return S},[ro,Se,N,Ce,X,t,e.schema]),U=Ie(b??ui),io=(0,d.useMemo)(()=>Or(N,X,U.shown),[N,X,U.shown]),ao=(0,d.useMemo)(()=>[...N.modules.administered.entries()].map(([f,S])=>{let C=N.mayAdminister(f,X);return{name:f,...S.description?{description:S.description}:{},kinds:S.kinds??[],canShow:C,shown:C&&(U.shown??[]).includes(f)}}),[N,X,U.shown]),Le=(0,d.useCallback)(f=>{let S=C=>Ie(typeof f=="function"?f(C):f);if(b!==void 0){D?.(S(b));return}D&&D(S(U)),Vn(C=>S(C))},[U,D,b,Ie]);(0,d.useEffect)(()=>{b===void 0&&Vn(f=>{let S=Ie(f);return S===f?f:S})},[U,b,Ie]);let so=U.selection??un,lo=(0,d.useCallback)(f=>{Le(S=>st(S,typeof f=="function"?f(S.selection??un):f))},[Le]),{who:et,aiHere:uo,following:co,follow:fo,sayWhere:wi,sayCaret:po,sharing:yo}=xr({channel:x,store:N,view:U,principal:X,session:ue,robots:Me,seatWho:Dt,settingValues:He,setView:Le,seats:s,people:c,...y!==void 0?{ttlMs:y}:{}}),Si=(0,d.useMemo)(()=>({store:N,scheme:o,views:t,view:U,setView:Le,homeView:Ce,selection:so,setSelection:lo,menuAt:Hn,setMenuAt:ci,whereIs:qn,pointer:zn,motion:$n,registerScene:Kn,robots:Me,noteSeat:Yn,seatWho:Dt,registerSeatWho:Zn,actsDoor:In,registerActsDoor:fi,seatTalk:Ln,aiDesk:Dn,...u?{memory:u}:{},who:et,aiHere:uo,following:co,follow:fo,sayWhere:wi,sharing:yo,session:ue,ai:Ze,resolveApp:q,linkedRecords:me,menuSections:Rn,...Tt?{keptViews:Tt}:{},...Ct?{onExport:Ct}:{},subscriptions:Nn,dismissals:Ke,whileAway:Te,...Mt?{notifications:Mt}:{},...Ot?{onNotificationsSeen:Ot}:{},...Rt?{workflowRuns:Rt}:{},signIn:Tn,linkedReads:Xn,movedByHand:Mn,noteMoved:On,emphasis:eo,setEmphasis:hi,activity:to,noteAttention:oo,principal:X,seats:s,people:c,takeSeat:Jn,settings:ce,settingValues:He,chooseSetting:Qn,hiddenKinds:io,administered:ao,...T?{providers:T}:{},...p?{brand:p}:{},..._t?{onKeepLens:_t}:{},...Wn?{onProposeChange:Wn}:{},...jn?{composeChange:jn}:{},...Gn?{onDraftChange:Gn}:{},...Fn?{displayOptions:Fn}:{},app:Xe,...Je?{locale:Je}:{},...Qe?{timeZone:Qe}:{}}),[N,o,t,U,Le,so,lo,Hn,qn,zn,$n,Kn,Me,Yn,Dt,Zn,In,Ln,Dn,u,et,uo,co,fo,yo,ue,Ze,q,me,Rn,Tt,Ct,Nn,Ke,Te,Mt,Ot,Rt,Tn,Xn,Mn,On,eo,to,oo,X,s,c,Jn,ce,He,Qn,io,ao,T,p,_t,Xe,Je,Qe]),go=(0,d.useMemo)(()=>R?{typing:R,sayCaret:po,who:et}:null,[R,po,et]),mo=H?(0,ee.jsx)(pt.Provider,{value:H,children:de}):de,ho=L?(0,ee.jsx)(ft.Provider,{value:L,children:mo}):mo,wo=_?(0,ee.jsx)(yt.Provider,{value:_,children:ho}):ho;return(0,ee.jsx)(We.Provider,{value:Si,children:(0,ee.jsx)(De.Provider,{value:Ye,children:(0,ee.jsx)(Ea,{children:Ht?null:go?(0,ee.jsx)(rn.Provider,{value:go,children:wo}):wo})})})}var Lr=(0,d.createContext)(null),cn,fn=new Set,va=e=>(fn.add(e),()=>void fn.delete(e)),Cr=()=>cn;function ba(e){if(!cn){cn=e;for(let t of[...fn])t()}}var xa=300;function Pa(e){let t=0;return async(n,o)=>{let r=++t;return await new Promise(i=>setTimeout(i,xa)),r===t?e(n,o):[]}}function Ea({children:e}){let{store:t,view:n,views:o,principal:r,hiddenKinds:i,selection:a,ai:s}=le(),l=wt(),c=n.q,u=n.focusId,y=!!(c&&c.trim().length>0),g=(0,d.useSyncExternalStore)(va,Cr,Cr),m=(0,d.useMemo)(()=>y&&g?{flagged:new Set(t.violations().flatMap(k=>k.nodeIds)),touched:g.touchWeights(t.log.all())}:null,[t,l,y,g]),x=u?t.graph.getNode(u)?.kind??be(u)??(pe(u).length===1?pe(u)[0]:void 0):void 0,R=(0,d.useMemo)(()=>s.near&&Pa(s.near),[s.near]),p=(0,d.useMemo)(()=>!c||!m||!g?null:g.search(t,c,{...x?{inKind:x}:{},principal:r,places:o.places(),kinds:t.schema.kinds.filter(k=>!i.has(k)),from:[...a,...u&&t.graph.has(u)?[u]:[]],flagged:m.flagged,touched:m.touched,limit:200,rank:R}),[t,c,r,o,i,a,u,x,m,R]),[h,w]=(0,d.useState)();return(0,d.useEffect)(()=>void p?.later?.then(k=>w([p,k])),[p]),(0,ee.jsx)(Lr.Provider,{value:h?.[0]===p?h[1]:p,children:e})}var Mr=new WeakMap;function ml(e){let t=Mr.get(e);return t||Mr.set(e,t=new Set(e.matched)),t}function ka(){return(0,d.useContext)(Lr)}function le(){let e=(0,d.useContext)(We);if(!e)throw new Error("useGraview must be used inside a <GraviewProvider>.");return e}function gn(){return(0,d.useContext)(We)??null}function wt(){let{store:e}=le(),t=(0,d.useRef)(null),n=(0,d.useRef)(null),o=(0,d.useCallback)(()=>(n.current!==e&&(n.current=e,t.current=null),t.current??=e.graph.allNodes(),t.current),[e]),r=(0,d.useCallback)(i=>e.subscribe(()=>{t.current=null,i()}),[e]);return(0,d.useSyncExternalStore)(r,o,o)}function Aa(e){let{store:t}=le(),n=(0,d.useCallback)(r=>t.subscribe(r),[t]),o=(0,d.useCallback)(()=>e===null?void 0:t.graph.getNode(e),[t,e]);return(0,d.useSyncExternalStore)(n,o,o)}function Or(e,t,n){let o=new Set(e.modules.disabledKinds);for(let r of e.kindsKeptFrom(t))o.add(r);for(let[r,i]of e.modules.administered)if(!(e.mayAdminister(r,t)&&(n??[]).includes(r)))for(let a of i.kinds??[])o.add(a);return o}var pn=2600;var _r=new WeakSet,Ra=e=>_r.has(e),Ta=e=>void _r.add(e);function yn(e,t){let n=Vo(e.arrangement?.()?.first,t,e.places());if(!(!n||n.to==="home"))return n.to==="place"?{...ve,focusId:ae(n.place.kind),within:{view:n.place.as}}:{...ve,focusId:ae(n.kind)}}var ye=I(W(),1);var mn=I(W(),1),Ca=(0,mn.createContext)(null),hn=(0,mn.createContext)(null);var Dr=(0,ye.createContext)(null);function Ma(){let e=(0,ye.useContext)(Dr),t=gn(),n=(0,ye.useContext)(hn),o=(i,a,s)=>t?.setView(l=>ie(ie(fe(Y(l,ae(i)),!1),"view",a),"filter",s?.filter??null)),r=()=>t?.setView(i=>ie(fe(i,!0),"view",null));return(0,ye.useMemo)(()=>e??{record:i=>{t&&(t.setView(a=>Y(fe(a,!1),i)),t.setSelection([i]))},place:(i,a)=>{if(i===Oo)return r();if(i===Mo)return n?n.open("/"):r();let s=t?.views.places().find(l=>l.as===i);s&&o(s.kind,s.as,a)},list:(i,a)=>o(i,null,a)},[e,t,n])}var Nr=I(W(),1),Oa=(0,Nr.createContext)(!1);var St=Symbol.for("graview.default-view");function Wr(e){return Object.defineProperty(e,St,{value:!0,enumerable:!1}),e}function jr(e){return typeof e=="function"&&e[St]===!0}var vt=Symbol.for("graview.replaces-page");function Gr(e){return Object.defineProperty(e,vt,{value:!0,enumerable:!1}),e}function Fr(e){return typeof e=="function"&&e[vt]===!0}var je=Symbol.for("graview.bleeds");function Br(e,t=!0){return Object.defineProperty(e,je,{value:t,enumerable:!1,configurable:!0}),e}function Kr(e){let t=typeof e=="function"?e[je]:void 0;return t===!0||t==="full"}function qr(e){return typeof e=="function"&&e[je]==="full"}var bt=Symbol.for("graview.previews");function zr(e,t={}){return Object.defineProperty(e,bt,{value:t,enumerable:!1}),e}function $r(e){return typeof e=="function"?e[bt]:void 0}function Va(e){return Co(e)}function Ha(e,t){if(t===e)return e;for(let r of t.registrations())e.register(r.kind,r,r.view,r);let n=t.arrangement?.();n&&e.arrange?.(n);let o=t.homes?.()??[];if(o.length>0)for(let r of o)e.home?.(r.view,r.name!==void 0?{name:r.name}:void 0);else{let r=t.homeView?.();r&&e.home?.(r)}return e}var M=I(W(),1),te=I(Ne(),1),wn=new Set,xt=0;function Sn(e){return()=>{xt+=1;let t=e();return t.then(()=>void(xt-=1),()=>void(xt-=1)),t}}var Ia=()=>xt,Et=(0,M.createContext)(null);function La(){return{waiting:new Map,at:0}}function _a(e){for(let[t,n]of e.waiting)n<e.at&&e.waiting.delete(t);e.at+=1}var Da=e=>e?.waiting.size??0;function Zr(e,t){e?.waiting.set(t,e.at)}function Xr(e){let t=(0,M.useContext)(Et);(0,M.useLayoutEffect)(()=>{t?.waiting.delete(e)},[t,e])}function Na(e){let t={},n=!1,o=new Set,r=(0,M.lazy)(Sn(()=>e().then(a=>{n=!0;let s=a.default;function l(c){return Xr(t),(0,M.createElement)(s,c)}return{default:l}},a=>{for(let s of o)s.waiting.delete(t);throw a})));function i(a){let s=(0,M.useContext)(Et);return!n&&s&&(o.add(s),Zr(s,t)),(0,M.createElement)(r,a)}return i}var Jr=!1,Qr=!1,Pt=new Set;function Wa(){Jr=!0}function ja(){Qr=!0;for(let e of[...Pt])e();Pt.clear()}var ei=()=>Qr||!Jr;function Ga(e){return ei()?(e(),()=>{}):(Pt.add(e),()=>void Pt.delete(e))}var Ur=!1;function vn(){for(let e of[...wn])e()}function Fa(){Ur||typeof window>"u"||(Ur=!0,window.addEventListener("online",vn))}function bn(e){let t,n=!1,o=!1,r,i=0,a=new Set,s=()=>{i+=1;for(let g of[...a])g()},l=g=>(a.add(g),()=>void a.delete(g)),c=()=>i,u=()=>void y().catch(()=>{});function y(){if(n)return Promise.resolve(t);if(r)return r;let g=e().then(m=>(t=m,n=!0,o=!1,r=void 0,wn.delete(u),s(),m),m=>{throw r=void 0,o=!0,wn.add(u),Fa(),s(),m});return g.catch(()=>{}),r=g,g}return{load:y,prefetch:u,get current(){return t},get failed(){return o},part(g,m={}){let x=m.what??"This part",R={};function p(k){(0,M.useSyncExternalStore)(l,c,c),Xr(R);let E=(0,M.useRef)(null),K=(0,M.useRef)(null),j=(0,M.useRef)(!1);return(0,M.useEffect)(()=>{o&&r===void 0&&u()},[]),n&&typeof document<"u"&&E.current!==null&&document.activeElement===E.current&&(j.current=!0),(0,M.useLayoutEffect)(()=>{if(!(!n||!j.current)){j.current=!1;for(let G=K.current?.nextElementSibling??null;G!==null;G=G.nextElementSibling){let T=G.matches(Yr)?G:G.querySelector(Yr);if(T instanceof HTMLElement){T.focus();return}}}}),n?(0,te.jsxs)(te.Fragment,{children:[j.current?(0,te.jsx)("span",{ref:K,hidden:!0}):null,g(t,k)]}):m.quiet?null:(0,te.jsx)(Ba,{what:x,button:E,...m.as?{as:m.as}:{}})}let h=(0,M.lazy)(Sn(()=>y().then(()=>({default:p}),()=>({default:p}))));function w(k){let E=(0,M.useContext)(Et),[K]=(0,M.useState)(()=>n||o);return!n&&!o&&Zr(E,R),(0,M.createElement)(K?p:h,k)}return w}}}var Yr="button,a[href],input,select,textarea,[tabindex]:not([tabindex='-1'])";function Ba({what:e,button:t,as:n="p"}){let r=typeof navigator<"u"&&navigator.onLine===!1?`${e} will load when you're back online.`:`${e} didn't load.`;return(0,te.jsxs)(n,{"data-testid":"lazy-part-missing",style:{margin:0,fontSize:"0.875rem",color:"var(--graview-ink-muted)"},children:[(0,te.jsx)("span",{role:"status",children:r})," ",(0,te.jsx)("button",{ref:t,type:"button","data-testid":"lazy-part-retry",onClick:vn,style:{font:"inherit",fontWeight:600,color:"var(--graview-ink)",background:"none",border:"1px solid var(--graview-edge)",borderRadius:6,padding:"2px 10px"},children:"Try again"})]})}var ke=I(W(),1);function Ka(){let{selection:e,setSelection:t}=le();return(0,ke.useMemo)(()=>({selection:e,set:n=>t(n),clear:()=>t([]),toggle:n=>t(o=>o.includes(n)?o.filter(r=>r!==n):[...o,n]),isSelected:n=>e.includes(n)}),[e,t])}function qa(){let{store:e}=le(),t=wt();return(0,ke.useMemo)(()=>za(e),[e,t])}var ti=new WeakMap;function za(e){let t=ti.get(e);if(!t){let n={violations:null};e.subscribe(()=>{n.violations=null}),ti.set(e,n),t=n}return t.violations??=e.violations(),t.violations}function $a(){let{view:e,setView:t}=le();return(0,ke.useMemo)(()=>({view:e,url:J(e),focus:n=>t(o=>Y(o,n)),show:n=>t(o=>Do(o,n)),toggle:n=>t(o=>lt(o,n)),go:n=>t(n)}),[e,t])}var Ee={at:0,depth:0,listeners:new Set,tell(){for(let e of this.listeners)e()}};typeof window<"u"&&window.addEventListener("popstate",e=>{let t=e.state;Ee.at=typeof t?.graview=="number"?t.graview:0,Ee.at>Ee.depth&&(Ee.depth=Ee.at),Ee.tell()});var B=I(W(),1),Pn={profile:{trigger:"profile-button",pane:"profile",opens:"press",focus:"into",drawn:["shell","embed"]},places:{trigger:"app-places-open",pane:"app-places",opens:"press",focus:"into",drawn:["embed"]},here:{trigger:"here-open",pane:"here-list",opens:"press",focus:"into",drawn:["shell","embed","pages"]},"app-menu":{trigger:"app-menu-open",pane:"app-menu",opens:"press",focus:"into",drawn:["shell","embed","pages"]},inbox:{trigger:"inbox-button",pane:"inbox",opens:"press",focus:"into",drawn:["shell","embed","pages"]},share:{trigger:"app-share-open",pane:"app-share",opens:"press",focus:"into",drawn:["embed"]},"host-actions":{trigger:"host-bar-actions-open",pane:"host-bar-actions",opens:"press",focus:"into",drawn:["shell","embed"]},activity:{trigger:"activity-button",pane:"activity",opens:"press",focus:"into",drawn:["studio"]},find:{trigger:"find-box",pane:"find-strip",opens:"typing",focus:"stays",drawn:["shell"]},districts:{trigger:"beyond-more",pane:"beyond-list",opens:"press",focus:"into",drawn:["shell","embed"]},acts:{trigger:null,pane:"context-menu",opens:"context-menu",focus:"into",drawn:["shell","embed","pages"]},arrange:{trigger:"arrange-add",pane:"arrange-list",opens:"press",focus:"into",drawn:["pages"]},"studio-ask":{trigger:"studio-agent",pane:"studio-agent-panel",opens:"press",focus:"into",drawn:["studio"]}},Ua={position:"fixed",inset:"auto",margin:0,zIndex:Eo("popover"),boxSizing:"border-box"},kt=6,ge=8,Ya=e=>typeof e.showPopover=="function";function Ge(e){try{return e.matches(":popover-open")}catch{return!1}}function Za(e){if(typeof e=="function"){let o=e();return o?{left:o.x,right:o.x,top:o.y,bottom:o.y}:null}let t=e.current;if(!t||!t.isConnected)return null;let n=t.getBoundingClientRect();return{left:n.left,right:n.right,top:n.top,bottom:n.bottom}}function At(e,t,n={}){let o=Za(t);if(!o)return;let r={width:document.documentElement.clientWidth||innerWidth,height:innerHeight},i=e.dataset.graviewDesignedHeight??=e.style.maxHeight;e.style.maxHeight=i;let a=e.getBoundingClientRect(),s=r.height-o.bottom-kt-ge,l=o.top-kt-ge,c=a.height<=s||s>=l,u=Math.max(96,Math.floor(c?s:l)),y=Math.min(a.height,u);a.height>u&&(e.style.maxHeight=i?`min(${i}, ${u}px)`:`${u}px`);let g=a.width,m=n.align==="start"?o.left:o.right-g,x=typeof t=="function"?null:t.current?.closest("[data-graview-embed]")?.getBoundingClientRect();x&&g<=x.right-x.left&&(m<x.left?m=o.left+g<=x.right?o.left:x.left:m+g>x.right&&(m=o.right-g>=x.left?o.right-g:x.right-g));let R=g>=r.width-2*ge?Math.max(0,(r.width-g)/2):Math.max(ge,Math.min(m,r.width-ge-g)),p=Math.round(c?o.bottom+kt:Math.max(ge,o.top-kt-y));e.style.left=`${Math.round(R)}px`,e.style.top=`${p}px`;let h=e.getBoundingClientRect();if(Ge(e)&&(Math.abs(h.left-Math.round(R))>2||Math.abs(h.top-p)>2)){let w=e.style.position;e.style.position=w==="absolute"?"fixed":"absolute",e.offsetWidth,e.style.position=w}}function ni(e,t,n,o={}){let r=o.align??"end";(0,B.useLayoutEffect)(()=>{let i=e.current;if(!t||!i)return;if(Ya(i)&&!Ge(i))try{i.showPopover(),Ja()}catch{}let a=0,s=u=>{u?.target instanceof Node&&i.contains(u.target)||(cancelAnimationFrame(a),a=requestAnimationFrame(()=>At(i,n,{align:r})))};At(i,n,{align:r});let l=()=>{let u=i.style.top;cancelAnimationFrame(a),a=requestAnimationFrame(()=>{At(i,n,{align:r});let y=Number.parseFloat(u);typeof n=="function"&&Number.isFinite(y)&&y+i.getBoundingClientRect().height<=innerHeight-ge&&(i.style.top=u)})};addEventListener("resize",s),addEventListener("scroll",s,!0);let c=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>l());return c?.observe(i),()=>{if(cancelAnimationFrame(a),removeEventListener("resize",s),removeEventListener("scroll",s,!0),c?.disconnect(),i.isConnected&&Ge(i))try{i.hidePopover()}catch{}}},[t,e,r])}var En=new Set;function Xa(e){return En.add(e),()=>En.delete(e)}function Ja(){for(let e of En)if(!(!e.isConnected||!Ge(e)))try{e.hidePopover(),e.showPopover()}catch{}}var Ae=null,Qa='button:not([disabled]), [href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])';function es(e){for(let t of e.querySelectorAll(Qa))if(t.closest("[hidden]")===null&&!t.hasAttribute("data-graview-not-first")&&getComputedStyle(t).visibility!=="hidden")return t;return e}var xn=()=>{let e=document.activeElement;return e===null||e===document.body};function ts(e,t={}){let{at:n,returnTo:o,onOpenChange:r}=t,i=t.popover!==!1,[a,s]=(0,B.useState)(!1),l=t.open??a,c=(0,B.useRef)(null),u=(0,B.useRef)(null),y=(0,B.useCallback)(w=>{c.current=w},[]),g=(0,B.useCallback)(w=>{u.current=w},[]),m=`graview-popover-${(0,B.useId)().replace(/:/g,"")}`,x=(0,B.useRef)({onOpenChange:r,returnTo:o,controlled:t.open!==void 0});x.current={onOpenChange:r,returnTo:o,controlled:t.open!==void 0};let R=(0,B.useCallback)(w=>{x.current.controlled||s(w),x.current.onOpenChange?.(w)},[]),p=(0,B.useCallback)(()=>{(document.querySelector(`[aria-controls="${m}"]`)??c.current??x.current.returnTo?.()??null)?.focus({preventScroll:!0})},[m]),h=(0,B.useCallback)(w=>{let k=u.current,E=typeof document>"u"?null:document.activeElement,K=E===null||E===document.body||k!==null&&k.contains(E);R(!1),!(!w||!K)&&(p(),requestAnimationFrame(()=>{xn()&&p()}))},[R,p]);return ni(u,i&&l,n??c,t.align?{align:t.align}:{}),(0,B.useEffect)(()=>{if(!i||!l)return;let w={name:e,close:()=>h(!1)};if(Ae&&Ae.close!==w.close&&Ae.close(),Ae=w,Pn[e].focus==="into"){let T=u.current;T&&!T.contains(document.activeElement)&&es(T).focus({preventScroll:!0})}let k=T=>{T.key==="Escape"&&h(!0)},E=T=>{let F=T.target;if(!(F instanceof Node))return;let L=u.current;if(L?.contains(F)||c.current?.contains(F))return;let _=F instanceof Element?F.closest('[role="dialog"], [role="alertdialog"]'):null;_&&!(L&&_.contains(L))||(h(!1),Pn[e].focus==="into"&&requestAnimationFrame(()=>{(xn()||L!==null&&L.contains(document.activeElement))&&p()}))},K=null,j=null,G=T=>{let F=T.target;if(!(F instanceof Element))return;let L=u.current,_=F.closest('[role="dialog"], [role="alertdialog"]');!_||L&&(L.contains(_)||_.contains(L))||(K=_,h(!1))};return document.addEventListener("keydown",k),document.addEventListener("pointerdown",E,!0),document.addEventListener("focusin",G),()=>{document.removeEventListener("keydown",k),document.removeEventListener("pointerdown",E,!0),document.removeEventListener("focusin",G);let T=K;T&&typeof MutationObserver<"u"&&(j?.disconnect(),j=new MutationObserver(()=>{T.isConnected||(j?.disconnect(),requestAnimationFrame(()=>{(xn()||document.activeElement.closest("[hidden]")!==null)&&p()}))}),j.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>j?.disconnect(),10*6e4)),Ae?.close===w.close&&(Ae=null)}},[i,l,e,h,p]),{open:l,setOpen:w=>w?R(!0):h(!0),toggle:()=>l?h(!0):R(!0),trigger:{ref:y,"aria-expanded":l,"aria-controls":m,"data-graview-popover-trigger":e},pane:{ref:g,id:m,popover:"manual",tabIndex:-1,"data-graview-popover":e,"data-graview-overlay":""}}}var Re=I(W(),1);var ns=bn(ot(()=>(__graviewPreload(import.meta.url,["./chunk.ASNVH2G4.js","./chunk.SDO3U72B.js","./chunk.ZDUKVXBI.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.TQF5XCUS.js"))));function os(e,t,n){let o,r=!1,i=()=>{let{hidden:s,removed:l}=t.current();o||r||s.length+l.length===0||(o=()=>{},ns.load().then(c=>{r||(o=c.watchTidied(e,t,n))},String))};i();let a=t.onChange?.(i);return()=>{r=!0,a?.(),o?.()}}function rs(e,t){let[n,o]=(0,Re.useState)();return(0,Re.useEffect)(()=>t?os(e,t,r=>o([e,r])):void 0,[e,t]),n?.[0]===e?n[1]:e}var oi=I(W(),1),is=(0,oi.createContext)(!1);var ri=I(W(),1),as=(0,ri.createContext)(null);var ii=I(W(),1),kn='button:not([disabled]), a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])',An=e=>e instanceof HTMLElement&&(e.matches(kn)||e.hasAttribute("tabindex")),Fe=e=>typeof e.checkVisibility=="function"?e.checkVisibility():e.getClientRects().length>0;function ss(e,t){let n=l=>l.replace(/["\\]/g,"\\$&"),o=t.getAttribute("data-testid"),r=t.getAttribute("data-graview-pick"),i=t.getAttribute("aria-label"),a=o?`[data-testid="${n(o)}"]`:r?`[data-graview-pick="${n(r)}"]`:i?`${t.tagName.toLowerCase()}[aria-label="${n(i)}"]`:null;if(!a)return null;let s=e.querySelector(a);return s&&An(s)&&Fe(s)?s:null}var ls=e=>e.isConnected&&An(e)&&!e.matches(":disabled")&&e instanceof HTMLElement&&Fe(e);function ai(e,t){let n=t?ss(e,t):null;if(n)return n;let o=e.querySelector("[data-graview-view][tabindex]");if(o&&Fe(o))return o;for(let r of e.querySelectorAll(kn))if(Fe(r))return r;return An(e)&&Fe(e)?e:null}function ds(e){(0,ii.useEffect)(()=>{let t=e.current;if(!t||typeof MutationObserver>"u")return;let n=[],o=p=>{let h=p.target;if(h instanceof Element){n=[];for(let w=h;w&&w!==t.parentElement;w=w.parentElement)n.push(w)}},r=!1,i=!1,a=t.ownerDocument,s=()=>!i&&a.defaultView!==null,l=(p,h)=>void setTimeout(()=>s()&&h(),p),c=p=>void requestAnimationFrame(()=>s()&&p()),u=p=>{if(r=!1,i)return;let h=a.activeElement;if(!(!(h===null||h===a.body||h===a.documentElement)||n.length===0)){if(ls(n[0])){p&&n[0]instanceof HTMLElement&&n[0].focus({preventScroll:!0});return}for(let k of n.slice(1)){if(!k.isConnected)continue;let E=ai(k,n[0]);if(E){E.focus({preventScroll:!0}),n=[];return}}}},y=(p,h=Date.now()+2500)=>{l(100,()=>{u(p);let w=a.activeElement;(w===null||w===a.body||w===a.documentElement)&&n.length>0&&Date.now()<h&&y(p,h)})},g=()=>{r||n.length===0||(r=!0,l(60,()=>c(()=>{u(!1),y(!1)})))},m=p=>{if(!(p instanceof KeyboardEvent&&!["Enter"," ","Escape"].includes(p.key))){if(!(p instanceof KeyboardEvent)){let h=p.target instanceof Element?p.target.closest(kn):null,w=a.activeElement,k=w===null||w===a.body||w===a.documentElement;if(h&&k&&t.contains(h)){n=[];for(let E=h;E&&E!==t.parentElement;E=E.parentElement)n.push(E);l(150,()=>c(()=>{u(!1),y(!1)}));return}}!(p instanceof KeyboardEvent)&&!(p.target instanceof Node&&n[0]?.contains(p.target))||l(150,()=>c(()=>{u(!0),y(!0)}))}},x=new MutationObserver(()=>{n.length>0&&!n[0].isConnected&&g()}),R=p=>{p.relatedTarget===null&&g()};return t.addEventListener("focusin",o),t.addEventListener("focusout",R),t.addEventListener("click",m),t.addEventListener("keydown",m),x.observe(t,{childList:!0,subtree:!0}),()=>{i=!0,t.removeEventListener("focusin",o),t.removeEventListener("focusout",R),t.removeEventListener("click",m),t.removeEventListener("keydown",m),x.disconnect()}},[e])}export{ve as a,J as b,at as c,cs as d,fs as e,Lo as f,Io as g,_o as h,Ft as i,Y as j,Do as k,ie as l,fe as m,st as n,_e as o,lt as p,ut as q,Bt as r,be as s,gs as t,xi as u,ae as v,No as w,pe as x,Wo as y,Pi as z,ms as A,jo as B,Kt as C,Ei as D,ki as E,Ai as F,W as G,en as H,zi as I,Ui as J,rr as K,Os as L,ft as M,Yi as N,pt as O,Zi as P,yt as Q,Xi as R,De as S,ar as T,Ji as U,Qi as V,ea as W,nn as X,on as Y,rn as Z,Ne as _,ca as $,We as aa,fa as ba,pa as ca,Ir as da,Sa as ea,ba as fa,ml as ga,ka as ha,le as ia,gn as ja,wt as ka,Aa as la,Ra as ma,Ta as na,yn as oa,Ca as pa,hn as qa,Dr as ra,Ma as sa,Oa as ta,Wr as ua,jr as va,Gr as wa,Fr as xa,Br as ya,Kr as za,qr as Aa,zr as Ba,$r as Ca,Va as Da,Ha as Ea,Sn as Fa,Ia as Ga,Et as Ha,La as Ia,_a as Ja,Da as Ka,Na as La,Wa as Ma,ja as Na,ei as Oa,Ga as Pa,bn as Qa,rs as Ra,is as Sa,as as Ta,Ka as Ua,qa as Va,$a as Wa,Ee as Xa,ds as Ya,Ua as Za,Ge as _a,ni as $a,Xa as ab,ts as bb};
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
react/cjs/react.production.js:
|
|
5
|
+
(**
|
|
6
|
+
* @license React
|
|
7
|
+
* react.production.js
|
|
8
|
+
*
|
|
9
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the MIT license found in the
|
|
12
|
+
* LICENSE file in the root directory of this source tree.
|
|
13
|
+
*)
|
|
14
|
+
|
|
15
|
+
react/cjs/react-jsx-runtime.production.js:
|
|
16
|
+
(**
|
|
17
|
+
* @license React
|
|
18
|
+
* react-jsx-runtime.production.js
|
|
19
|
+
*
|
|
20
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
21
|
+
*
|
|
22
|
+
* This source code is licensed under the MIT license found in the
|
|
23
|
+
* LICENSE file in the root directory of this source tree.
|
|
24
|
+
*)
|
|
25
|
+
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{G as T}from"./chunk.
|
|
1
|
+
import{G as T}from"./chunk.ASNVH2G4.js";import{b as g}from"./chunk.AJZBJBMO.js";var s=g(T(),1),m="data-graview-roving",E="data-graview-roving-item",L={ArrowDown:{column:1,both:1},ArrowUp:{column:-1,both:-1},ArrowRight:{column:0,both:1},ArrowLeft:{column:0,both:-1}},w=e=>e instanceof HTMLElement&&(e.isContentEditable||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e instanceof HTMLInputElement&&!["button","checkbox","radio","submit"].includes(e.type));function p(e){return[...e.querySelectorAll(`[${E}]`)].filter(c=>c.closest(`[${m}]`)===e&&!c.disabled&&c.getAttribute("aria-hidden")!=="true")}var M=e=>(e.textContent?.trim()||e.getAttribute("aria-label")||"").toLowerCase();function H({flow:e="column",letters:c=!1}={}){let a=(0,s.useRef)(null),i=(0,s.useRef)(null),f=(0,s.useCallback)(()=>{let t=a.current;if(!t)return;let n=p(t);if(n.length===0)return;let o=typeof document>"u"?null:document.activeElement,u=n.find(r=>r===o)??(i.current&&n.includes(i.current)?i.current:n[0]);for(let r of n){let l=r===u?"0":"-1";r.getAttribute("tabindex")!==l&&r.setAttribute("tabindex",l)}},[]);(0,s.useLayoutEffect)(f);let d=t=>{t&&(i.current=t,t.focus(),f())};return{ref:a,[m]:c?"letters":"",onFocus:t=>{let n=t.target.closest?.(`[${E}]`);n&&n.closest(`[${m}]`)===a.current&&i.current!==n&&(i.current=n,f())},onKeyDown:t=>{let n=a.current;if(!n||t.metaKey||t.ctrlKey||t.altKey||w(t.target))return;let o=p(n),u=o.findIndex(l=>l===t.target||l.contains(t.target));if(u<0)return;let r=L[t.key]?.[e];if(r){t.preventDefault(),t.stopPropagation(),d(o[Math.max(0,Math.min(o.length-1,u+r))]);return}if(t.key==="Home"||t.key==="End"){t.preventDefault(),t.stopPropagation(),d(t.key==="Home"?o[0]:o[o.length-1]);return}if(c&&t.key.length===1&&t.key.trim()!==""){let l=t.key.toLowerCase(),y=[...o.slice(u+1),...o.slice(0,u+1)].find(b=>M(b).startsWith(l));if(!y)return;t.preventDefault(),t.stopPropagation(),d(y)}}}}export{E as a,H as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as Y,b as F,c as j,d as G}from"./chunk.A4TBVXHQ.js";import"./chunk.7QGDWAHH.js";import"./chunk.YC2IDHQX.js";import"./chunk.GH6QX7JR.js";import"./chunk.J4D4BIB4.js";import{G as V,T as K,U as D,_,ja as B}from"./chunk.ASNVH2G4.js";import"./chunk.SDO3U72B.js";import{W as L,zd as q}from"./chunk.ZDUKVXBI.js";import"./chunk.FQLNBIQ5.js";import{b as $}from"./chunk.AJZBJBMO.js";var s=$(V(),1);var a=$(_(),1),Z={kind:"human"},ee=[1,2,4,8],te=900,M={you:"You",person:"A person",agent:"An agent",app:"The app"},U={you:"var(--graview-accent)",person:"var(--graview-ink-muted)",agent:"var(--graview-activity, var(--graview-good))",app:"var(--graview-edge-bright)"};function ae(n,t,i){return[...new Set([...i,t,...n.map(r=>r.seq)])].sort((r,l)=>r-l)}function ne(n,t){let i=n.withheld===!0;return{seq:n.seq+1,from:n.seq,at:n.at,batch:n.batch,maker:i?"person":Y(n.author,t),author:i?void 0:n.author,said:n.batchIntent??n.intent,declaration:!1,withheld:i}}function re(n,t){let i=0;for(let r=0;r<n.length;r++)n[r]<=t&&(i=r);return i}function ie(n,t,i){let r=j(n,t);if(r.length===0)return null;let l=n.canUndo(r);if(!l.ok)return null;let f=new Set(n.permittedMutations(i).map(u=>u.name));return l.ops.every(u=>u.mutation!==null&&f.has(u.mutation.name))?r:null}function ce({face:n}){let t=K(),i=B(),r=i?.principal??Z,l=D(t.live,r),f=l.log.length,u=(0,s.useMemo)(()=>F(l,{me:r,...t.host?.declarations?{declarations:t.host.declarations}:{}}),[l,r,t.host,f]),c=l.log.horizon,S=c>0&&t.host?.archived!==void 0,v=t.kept,O=(0,s.useMemo)(()=>S?v?.stops??Array.from({length:c},(e,p)=>p):[],[S,v,c]),g=(0,s.useMemo)(()=>ae(u,c,O),[u,c,O]),h=t.archive,d=h?.seq??t.past?.seq??f,w=t.host?.kept&&(h?.behindKept||v!==void 0&&(d<=v.through||v.from>0&&d<=v.from))?t.host.kept:void 0,b=re(g,d),m=g.length-1,W=d<c&&t.past?.seq===d?t.past.store.log.all().at(-1):void 0,x=W?ne(W,r):d<c?void 0:[...u].reverse().find(e=>e.seq<=d&&e.seq>(g[b-1]??-1))??[...u].reverse().find(e=>e.seq<=d),[k,R]=(0,s.useState)(!1),[T,X]=(0,s.useState)(1),[N,C]=(0,s.useState)(null);(0,s.useEffect)(()=>{if(!k)return;if(b>=m){R(!1);return}let e=setTimeout(()=>t.show(g[b+1]),te/T);return()=>clearTimeout(e)},[k,b,m,T,g,t]);let I=(0,s.useMemo)(()=>t.past&&!h&&d>=c?ie(l,d,r):null,[t.past,h,l,d,c,r,f]),z=e=>G(e,{graph:l.graph,schema:l.schema,...i?.seats?{seats:i.seats}:{},...i?.people?{people:i.people}:{}}),y=t.past?t.past.at?L(t.past.at,i?.locale):"the start":null,E=h?h.refused?"The archive could not be read":h.behindKept?"Nothing this far back is kept":"Reading the older changes from the archive\u2026":x?`${z(x)==="you"?"You":z(x)}: ${x.said}`:f===0&&c===0?"No changes yet":"Nothing had happened yet",H=(0,s.useRef)(null);(0,s.useEffect)(()=>{if(!t.focusWanted)return;t.focused?.();let e=document.activeElement,p=A.current?.closest("[data-graview-embed]")??document.body,o=e?.closest('[data-testid="app-menu-open"], [data-testid="app-menu"]');(e===null||e===document.body||o&&p.contains(o))&&H.current?.focus({preventScroll:!0})},[t.focusWanted,t]);let A=(0,s.useRef)(null);(0,s.useLayoutEffect)(()=>{let e=A.current,p=e?.parentElement;if(n!=="scene"||!e||!p)return;let o=()=>p.style.setProperty("--graview-sheet",`${Math.ceil(e.getBoundingClientRect().height)+24}px`);o();let P=typeof ResizeObserver>"u"?null:new ResizeObserver(o);return P?.observe(e),()=>{P?.disconnect(),p.style.removeProperty("--graview-sheet")}},[n]);let J=n==="scene"?{position:"absolute",left:"50%",bottom:12,transform:"translateX(-50%)",width:"min(720px, calc(100% - 32px))",zIndex:q("rail")}:{position:"sticky",top:0,zIndex:q("rail"),margin:"0 auto 12px",maxWidth:960,width:"100%"};return(0,a.jsxs)("section",{ref:A,"aria-label":"Timeline","data-testid":"timeline","data-graview-past":t.past?String(t.past.seq):"now","data-graview-offstage":"",style:{...J,boxSizing:"border-box",display:"grid",gap:8,padding:"10px 12px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",color:"var(--graview-ink)",fontSize:"0.8125rem"},children:[(0,a.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"baseline",gap:"4px 12px"},children:[(0,a.jsx)("strong",{"data-testid":"as-of",role:"status",style:{fontWeight:600},children:h?"Archived changes":y?`As of ${y}`:"Now"}),(0,a.jsx)("span",{"data-testid":"timeline-caption",style:{color:"var(--graview-ink-muted)",minWidth:0,overflowWrap:"anywhere"},children:E}),y?(0,a.jsx)("span",{style:{color:"var(--graview-ink-faint)"},"data-testid":"past-read-only",children:"Nothing changes while you look back."}):null]}),(0,a.jsxs)("div",{style:{position:"relative",height:22},"aria-hidden":"true",children:[S?(0,a.jsx)("span",{"data-testid":"timeline-archived",title:"Changes read from the archive as you scrub back",style:{position:"absolute",left:0,bottom:0,height:6,width:`${m===0?0:g.indexOf(c)/m*100}%`,borderRadius:2,background:"var(--graview-edge)"}}):null,g.slice(1).map((e,p)=>{let o=[...u].reverse().find(Q=>Q.seq===e);if(!o)return null;let P=m===0?0:(p+1)/m*100;return(0,a.jsx)("span",{"data-graview-tick":e,"data-maker":o.maker,...o.declaration?{"data-declaration":""}:{},title:`${M[o.maker]}: ${o.said}`,style:{position:"absolute",left:`calc(${P}% - 1px)`,bottom:0,width:o.declaration?4:2,height:o.declaration?22:12,borderRadius:2,background:o.declaration?"var(--graview-ink)":U[o.maker],opacity:e<=d?1:.45}},`${e}:${o.batch??"declaration"}`)})]}),(0,a.jsx)("input",{ref:H,type:"range","data-testid":"scrubber","aria-label":"Moment",min:0,max:m,step:1,value:b,"aria-valuetext":y?`As of ${y}. ${E}`:`Now. ${E}`,onChange:e=>{R(!1),t.show(g[Number(e.currentTarget.value)]??f)},style:{width:"100%",margin:0,accentColor:"var(--graview-accent)"}}),(0,a.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:8},children:[(0,a.jsx)("button",{type:"button","data-testid":"play","aria-pressed":k,onClick:()=>{!k&&b>=m&&t.show(g[0]),R(!k)},style:{minHeight:28,minWidth:64},children:k?"Pause":"Play"}),(0,a.jsxs)("label",{style:{display:"inline-flex",alignItems:"center",gap:6,color:"var(--graview-ink-muted)"},children:["Speed",(0,a.jsx)("select",{"data-testid":"speed",value:T,onChange:e=>X(Number(e.currentTarget.value)),style:{minHeight:28},children:ee.map(e=>(0,a.jsxs)("option",{value:e,children:[e,"\xD7"]},e))})]}),(0,a.jsx)("span",{"aria-hidden":"true",style:{display:"inline-flex",gap:10,color:"var(--graview-ink-faint)",flexWrap:"wrap"},children:Object.keys(M).filter(e=>u.some(p=>p.maker===e)).map(e=>(0,a.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[(0,a.jsx)("span",{style:{width:8,height:8,borderRadius:2,background:U[e]}}),M[e]]},e))}),(0,a.jsxs)("span",{style:{marginLeft:"auto",display:"inline-flex",gap:8},children:[I?(0,a.jsx)("button",{type:"button","data-testid":"restore-here",title:"Take back every change since, as one change you can undo",onClick:()=>{C(null);try{l.undo([...I],{author:r,intent:y?`Restore to ${y}`:"Restore"}),t.show(null)}catch(e){C(e instanceof Error?e.message:String(e))}},style:{minHeight:28},children:"Restore to here"}):null,(0,a.jsx)("button",{type:"button","data-testid":"back-to-now",onClick:()=>t.show(null),style:{minHeight:28},children:"Back to now"})]})]}),N?(0,a.jsx)("span",{role:"alert","data-testid":"restore-refused",style:{color:"var(--graview-warn)"},children:N}):null,h?.refused?(0,a.jsx)("span",{role:"alert","data-testid":"archive-refused",style:{color:"var(--graview-warn)"},children:h.refused}):null,w?(0,a.jsxs)("span",{"data-testid":"timeline-kept",style:{color:"var(--graview-ink-faint)"},children:[w.sentence,w.action?(0,a.jsxs)(a.Fragment,{children:[" ",(0,a.jsx)("a",{"data-testid":"timeline-kept-action",href:w.action.href,style:{color:"var(--graview-ink-muted)"},children:w.action.label})]}):null]}):null,c>0&&!S?(0,a.jsx)("span",{"data-testid":"timeline-horizon",style:{color:"var(--graview-ink-faint)"},children:"The changes before the timeline's start were archived."}):null]})}export{ce as Timeline};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk.WVUJXDXZ.js";import{b as P}from"./chunk.
|
|
1
|
+
import"./chunk.WVUJXDXZ.js";import{b as P}from"./chunk.J7GH2CGV.js";import"./chunk.SMF5S4DQ.js";import"./chunk.XP4IVKKR.js";import"./chunk.R5YGW5ZX.js";import"./chunk.QMGBAKX6.js";import"./chunk.PS765ODQ.js";import"./chunk.45OLF6BK.js";import"./chunk.T6ISUVUP.js";import{Aa as T,Ba as E,Ca as L,ya as M}from"./chunk.ZDUKVXBI.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";function G(r,l,i){let g=r.getAttribute("data-record")??"",m=r.getAttribute("data-field")??"",c=Number(r.getAttribute("data-index")??"0"),e=[...l?.node?[l.node]:[],...l?.nodes??[]].find(p=>p.id===g);if(!g||!e)return{why:g?`names a record it was not shown ("${g.slice(0,80)}")`:"names no record (data-record)"};let h=m&&Object.hasOwn(e,m)?e[m]:void 0,f=(Array.isArray(h)?h:[h]).filter(M),o=Number.isInteger(c)&&c>=0?f[c]:void 0,v=e.label?`"${e.label}"`:"a record";return m?o?(i==="video"?!E(o):!E(o)&&!T(o))?{why:`names "${o.name}" on ${v}, which is not ${i==="video"?"a video":"a picture or a video"}`}:{file:o,on:e}:{why:f.length===0?`names "${m}" on ${v}, which holds no file it was shown`:`names file ${r.getAttribute("data-index")} of "${m}" on ${v}, which holds ${f.length}`}:{why:`names no field of ${v} (data-field)`}}var C=r=>`${r.caption?.trim()||r.name}, ${L(r)}`;function N(r,l,i,g,m,c={}){let e=r.createElement("video");e.setAttribute("data-graview-video",""),e.setAttribute("playsinline",""),e.setAttribute("aria-label",C(i)),c.autoplay?(e.setAttribute("data-graview-video-autoplay",""),e.setAttribute("muted",""),e.muted=!0,e.setAttribute("loop",""),e.setAttribute("preload",c.still?"metadata":"auto"),c.still?e.setAttribute("data-graview-video-still",""):e.setAttribute("autoplay","")):(e.setAttribute("controls",""),e.setAttribute("preload","metadata"));let h=i.poster?g(i.poster):void 0;h&&e.setAttribute("poster",h),i.width&&i.height?(e.setAttribute("width",String(i.width)),e.setAttribute("height",String(i.height)),e.style.aspectRatio=`${i.width} / ${i.height}`):e.style.aspectRatio="16 / 9",c.cover?(e.setAttribute("data-graview-video-cover",""),e.style.cssText+=";display:block;width:100%;height:100%;max-height:none;aspect-ratio:auto;object-fit:cover;background:#000"):e.style.cssText+=";display:block;width:100%;height:auto;max-height:80vh;background:#000;border-radius:var(--graview-radius, 8px)";let f=i.captions?g(i.captions):void 0;if(f){let o=r.createElement("track");o.setAttribute("kind","captions"),o.setAttribute("src",f),o.setAttribute("srclang","en"),o.setAttribute("label","Captions"),o.setAttribute("default",""),e.appendChild(o)}return i.duration===void 0&&e.addEventListener("loadedmetadata",()=>Number.isFinite(e.duration)&&e.duration>0&&e.setAttribute("aria-label",C({...i,duration:e.duration}))),e.setAttribute("src",m),l.appendChild(e),e}function S(r,l){let i=r.document,g=new Set,m=t=>{g.has(t)||(g.add(t),l.onProblem?.(t))},c=t=>{let a=l.file?l.file(t):t;if(a!==void 0)try{let s=new r.URL(a,i.baseURI);return s.origin===r.location.origin&&/^https?:$/.test(s.protocol)?a:void 0}catch{return}},e=new WeakMap,h=typeof r.matchMedia=="function"?r.matchMedia("(prefers-reduced-motion: reduce)"):void 0,f=new Set,o=(t,a)=>{a?(t.removeAttribute("autoplay"),t.setAttribute("data-graview-video-still",""),t.pause()):(t.removeAttribute("data-graview-video-still"),t.setAttribute("autoplay",""),t.setAttribute("preload","auto"),t.play?.()?.catch?.(()=>{}))},v=()=>{for(let t of f)t.isConnected?o(t,h?.matches===!0):f.delete(t)};h?.addEventListener?.("change",v);let p,k=t=>{if(typeof t.close=="function")return t.close();t.removeAttribute("open"),t.dispatchEvent(new r.Event("close"))},w=(t,a)=>m(`The ${t} in the view ${l.view} was not drawn: it ${a}.`);return{refresh(t){let a=l.shown();for(let s of Array.from(t.querySelectorAll("graview-video"))){let d=s.shadowRoot??s.attachShadow({mode:"open"});if(!l.pictures){e.delete(s),d.replaceChildren(),w("video",`asks for no pictures: a view places a record's video where its manifest says "pictures": true`);continue}let u=G(s,a,"video"),n={autoplay:s.hasAttribute("autoplay"),cover:s.hasAttribute("cover"),still:h?.matches===!0},b="file"in u?JSON.stringify([u.file,n.autoplay,n.cover]):"";if(e.get(s)===b&&d.childNodes.length>0)continue;if(e.set(s,b),d.replaceChildren(),"why"in u){w("video",u.why);continue}let A=c(u.file.href);if(!A){w("video",`names "${u.file.name}", which this host does not say it serves on this page`);continue}let $=i.createElement("style");$.textContent=":host { display: block; min-width: 0; }",d.appendChild($);let y=N(i,d,u.file,c,A,n);n.autoplay&&f.add(y)}},open(t){if(!l.pictures)return w("full-screen viewer",`asks for no pictures: a view opens a record's picture or video full screen where its manifest says "pictures": true`),!1;let a=G(t,l.shown(),"any");if("why"in a)return w("full-screen viewer",a.why),!1;let s=c(a.file.href);if(!s)return w("full-screen viewer",`names "${a.file.name}", which this host does not say it serves on this page`),!1;p&&k(p);let d=a.file,u=d.caption?.trim()||d.name,n=i.createElement("dialog");n.setAttribute("data-graview-lightbox",""),n.setAttribute("aria-label",E(d)?C(d):u),n.style.cssText="padding:0;border:0;border-radius:var(--graview-radius, 8px);max-width:min(96vw, 1600px);max-height:94vh;background:var(--graview-panel, Canvas);color:var(--graview-ink, CanvasText)";let b=i.createElement("figure");if(b.style.cssText="margin:0;display:grid;gap:8px;padding:10px",E(d))N(i,b,d,c,s);else{let x=i.createElement("img");x.setAttribute("src",s),x.setAttribute("alt",u),x.style.cssText="max-width:100%;max-height:80vh;object-fit:contain;display:block;margin:0 auto",b.appendChild(x)}let A=i.createElement("figcaption");A.style.cssText="display:flex;gap:12px;align-items:center;justify-content:space-between";let $=i.createElement("span");$.textContent=E(d)&&d.duration!==void 0?`${u} \xB7 ${P(d.duration)}`:u;let y=i.createElement("button");return y.type="button",y.textContent="Close",y.addEventListener("click",()=>k(n)),A.append($,y),b.appendChild(A),n.appendChild(b),n.addEventListener("click",x=>x.target===n&&k(n)),n.addEventListener("close",()=>{n.remove(),p===n&&(p=void 0),t.focus?.()}),i.body.appendChild(n),p=n,typeof n.showModal=="function"?n.showModal():n.setAttribute("open",""),y.focus(),!0},dispose(){p&&k(p),p?.remove(),p=void 0,h?.removeEventListener?.("change",v),f.clear()}}}export{S as createGuestMedia,G as namedFile};
|
|
@@ -1,4 +1,4 @@
|
|
|
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 Qe,b as Xe,c as Je,d as rt,e as it,h as Ze,i as ea,k as aa,n as ta,o as ra,p as ia}from"./chunk.
|
|
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 Qe,b as Xe,c as Je,d as rt,e as it,h as Ze,i as ea,k as aa,n as ta,o as ra,p as ia}from"./chunk.IZUAZ6EV.js";import{c as je}from"./chunk.THLT6NVO.js";import{g as Ja,h as et,i as at}from"./chunk.HIIYDKFC.js";import"./chunk.YF5GCOSZ.js";import{b as Ya,c as ja,d as Ye,e as Qa}from"./chunk.WAPY4RCS.js";import"./chunk.JMXBMLKH.js";import{m as Ee,q as _a,r as Ua,s as Va}from"./chunk.PVAYYFT2.js";import{a as Za}from"./chunk.HJCQ6I3S.js";import{b as Xa}from"./chunk.QNFX5VHW.js";import"./chunk.UXW43HNW.js";import{c as Ka}from"./chunk.VE4AQFLW.js";import"./chunk.LPWANRBL.js";import{b as _e,d as Ue,e as Ve}from"./chunk.3BE4SHZD.js";import"./chunk.U5P23GO7.js";import"./chunk.SNDFIJVX.js";import{b as Ge}from"./chunk.2TTKQAWQ.js";import"./chunk.CJHCUHVN.js";import"./chunk.MFNWHXGL.js";import"./chunk.DCIYOZYP.js";import"./chunk.A4TBVXHQ.js";import"./chunk.7QGDWAHH.js";import"./chunk.YC2IDHQX.js";import"./chunk.JP33TNCH.js";import"./chunk.BIDL7GQD.js";import"./chunk.O5P6LXHF.js";import"./chunk.VGQDPEB5.js";import"./chunk.WIVNFOQR.js";import{i as tt}from"./chunk.HCHGKI64.js";import"./chunk.65SI77M7.js";import"./chunk.Q5WEOX3Q.js";import"./chunk.7DCBIMOI.js";import"./chunk.GXK5PI7I.js";import"./chunk.DYPSFTRP.js";import"./chunk.XP4IVKKR.js";import"./chunk.R5YGW5ZX.js";import"./chunk.QMGBAKX6.js";import"./chunk.PS765ODQ.js";import"./chunk.MIE4TJRW.js";import{c as Ba,d as Da,e as ue,p as Wa}from"./chunk.DEBW4FH6.js";import"./chunk.RD2FSSLV.js";import"./chunk.OWHH7JDV.js";import"./chunk.T3RFZ66S.js";import"./chunk.TDWJU6GW.js";import"./chunk.P3Z4ZCL3.js";import"./chunk.45OLF6BK.js";import"./chunk.T6ISUVUP.js";import{L as Ga,e as Ha,f as Oa,m as qe,q as Fa,x as qa}from"./chunk.GH6QX7JR.js";import{b as Ta,c as Ct}from"./chunk.J4D4BIB4.js";import{G as _,Qa as Ae,Va as Pa,Wa as U,Za as Na,_ as A,bb as Ia,fa as za,ha as Ma,i as Ke,ia as T,j as Se,ka as Ce,m as ee,n as $e,o as Fe,r as ge,ta as La,x as Ea,y as ve,z as Ra}from"./chunk.ASNVH2G4.js";import{a as ie}from"./chunk.SDO3U72B.js";import{Xc as Aa,Z as re,oa as $a,pa as ke,qa as G,va as Ca,xd as H,zd as B}from"./chunk.ZDUKVXBI.js";import"./chunk.FQLNBIQ5.js";import{b as f}from"./chunk.AJZBJBMO.js";function At(e){return`
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
.graview-altitude-control {
|
|
@@ -1136,6 +1136,6 @@ var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=gl
|
|
|
1136
1136
|
}
|
|
1137
1137
|
[data-graview-connector][data-graview-activity] {
|
|
1138
1138
|
animation: graview-relation 1200ms cubic-bezier(0.22, 1, 0.36, 1);
|
|
1139
|
-
}`}function na(e="dark",o={}){let d=At(e);return o.scope===void 0?d:Ta(d,o.scope)}var I=f(_(),1);var V=f(A(),1),Et=Ae(ie(()=>(__graviewPreload(import.meta.url,["./chunk.RJ7VSWTA.js","./chunk.P43LPXXJ.js","./chunk.JCKIJSW7.js","./chunk.SDO3U72B.js","./chunk.6L6RUOSF.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.ZY3NAJDM.js")))).part(e=>(0,V.jsx)(e.MapKey,{}),{quiet:!0});function oa(){let{store:e}=T(),{view:o}=U(),d=Ce(),s=(0,I.useMemo)(()=>e.graph.allEdges().length>0,[e,d]),[n,m]=(0,I.useState)(!1),v=(0,I.useId)(),g=(0,I.useRef)(null),y=(0,I.useRef)(null);(0,I.useEffect)(()=>{if(!n)return;let b=k=>{let w=k.target;w&&(y.current?.contains(w)||g.current?.contains(w))||m(!1)};return document.addEventListener("pointerdown",b,!0),()=>document.removeEventListener("pointerdown",b,!0)},[n]);let[S,c]=(0,I.useState)(null);return(0,I.useEffect)(()=>{let b=g.current?.parentElement?.parentElement?.querySelector('[data-testid="overview"]');if(!b||typeof ResizeObserver>"u")return;let k=()=>c(Math.ceil(b.getBoundingClientRect().width));k();let w=new ResizeObserver(k);return w.observe(b),()=>w.disconnect()},[s]),s?(0,V.jsxs)("div",{style:{display:"contents"},onKeyDown:b=>{b.key!=="Escape"||!n||(b.preventDefault(),b.stopPropagation(),m(!1),g.current?.focus({preventScroll:!0}))},children:[(0,V.jsx)("button",{ref:g,type:"button","data-testid":"lines-key",className:"graview-lines-key","data-graview-up-row":o.overview?void 0:"","aria-expanded":n,"aria-controls":v,title:"What the lines mean",onClick:()=>m(b=>!b),style:{position:"absolute",top:60,right:"calc(14px + var(--graview-dock, 0px))",zIndex:B("overview"),height:30,padding:"0 11px",borderRadius:8,borderColor:"transparent",fontSize:"0.8125rem",color:n?"var(--graview-accent)":"var(--graview-ink-muted)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)",...S!==null?{"--graview-up-room":`${S}px`}:{}},children:"Key"}),n?(0,V.jsxs)("div",{ref:y,id:v,"data-testid":"lines-key-pane",className:"graview-lines-key-pane","data-graview-up-row":o.overview?void 0:"","data-graview-offstage":"",style:{position:"absolute",top:98,right:"calc(14px + var(--graview-dock, 0px))",zIndex:B("rail"),width:it,maxHeight:"calc(100cqh - 120px)",overflowY:"auto",boxSizing:"border-box",padding:"8px 8px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:[o.overview?(0,V.jsx)(Et,{}):null,(0,V.jsx)(rt,{inside:!0,widthOf:Za})]}):null]}):null}var Te=f(_(),1),Re=f(A(),1);function nt(e){return e.lens!==null?{what:"lens",kind:e.lens}:e.records.length===1&&e.districts.length===0?{what:"record",id:e.records[0]}:e.districts.length===1&&e.records.length===0?{what:"district",kind:e.districts[0]}:null}var Rt=Ae(ie(()=>(__graviewPreload(import.meta.url,["./chunk.JLNTE5CH.js","./chunk.7THS3DLZ.js","./chunk.4QMAYVPU.js","./chunk.ZONRIOIA.js","./chunk.NXHEOHRR.js","./chunk.HJCQ6I3S.js","./chunk.DJGZOPAS.js","./chunk.GFOZVQBQ.js","./chunk.67S2UWBT.js","./chunk.7PWLRRUS.js","./chunk.NH3VXTGX.js","./chunk.6IMRCKB4.js","./chunk.PQTXM4VY.js","./chunk.BIDL7GQD.js","./chunk.7KX36ENH.js","./chunk.QDDDKEBH.js","./chunk.QKRQPUCE.js","./chunk.Q5WEOX3Q.js","./chunk.4O64QV2Y.js","./chunk.OYMN3IFX.js","./chunk.UQZ2P6KD.js","./chunk.WVUJXDXZ.js","./chunk.NI4OPHTL.js","./chunk.U5KJQFAP.js","./chunk.FOHZPYUV.js","./chunk.IXYG65TM.js","./chunk.W6L2VAJG.js","./chunk.N3MXLORL.js","./chunk.MIE4TJRW.js","./chunk.3CLTABGP.js","./chunk.RD2FSSLV.js","./chunk.CVN2XFMF.js","./chunk.6TBQV3NO.js","./chunk.MT252WP4.js","./chunk.VVIQSFM4.js","./chunk.TQ3MNB6K.js","./chunk.VGYG2IBZ.js","./chunk.RJ7VSWTA.js","./chunk.P43LPXXJ.js","./chunk.JCKIJSW7.js","./chunk.SDO3U72B.js","./chunk.6L6RUOSF.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.ZLQIGZXO.js")))),Tt=Rt.part((e,o)=>(0,Re.jsx)(e.MapPanelFor,{showing:o.showing}),{what:"This panel",quiet:!0});function sa(){let{store:e,view:o,selection:d,hiddenKinds:s,seatTalk:n}=T();Ce();let m=(0,Te.useSyncExternalStore)(n.subscribe,()=>n.get().draft!==null,()=>!1);if(!o.overview||m)return null;let v=nt(Xa(d,{...o,beside:!0},g=>e.graph.getNode(g)?.kind));return!v||v.what!=="record"&&(s.has(v.kind)||!e.schema.kinds.includes(v.kind))?null:(0,Re.jsx)(Te.Suspense,{fallback:null,children:(0,Re.jsx)(Tt,{showing:v})})}var zt=f(_(),1);var D=f(A(),1);function da(){let{view:e,go:o}=U(),{store:d,views:s,hiddenKinds:n}=T(),m=e.overview??!1,v=s.places().map(k=>k.kind).filter(k=>!n.has(k)),g=Ga(e,d.schema.kinds,v),y=()=>{o(Se(ee(e,!1),g))},S=(()=>{if(!g)return null;let k=Ea(g)[0],w=e.within?.view,R=(w?s.places().find(P=>P.as===w):void 0)??(k?s.places().filter(P=>P.kind===k).at(-1):void 0);return R?R.title:k?G(d.schema,k):d.graph.getNode(g)?.label??null})(),c=m?"Close the map":"Up",b=m&&S?`Close the map, down to ${S}`:c;return(0,D.jsxs)("button",{type:"button","data-testid":"overview",className:"graview-altitude-control","aria-pressed":m,"aria-label":b,title:m?b:"Up \u2014 everything, from above",onClick:()=>m?y():o(ee(e,!0)),style:{position:"absolute",top:14,right:"calc(14px + var(--graview-dock, 0px))",zIndex:B("overview"),display:"inline-flex",alignItems:"center",justifyContent:"center",gap:7,height:38,padding:"0 13px 0 11px",borderRadius:8,borderColor:"transparent",fontSize:"0.875rem",whiteSpace:"nowrap",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)","--graview-altitude":m?1:0,...m?{color:"var(--graview-accent)"}:{}},children:[(0,D.jsxs)("svg",{className:"graview-altitude-mark",width:"16",height:"16",viewBox:"0 0 12 12","aria-hidden":"true",children:[(0,D.jsx)("ellipse",{className:"graview-altitude-mark-ring",cx:"6",cy:"6.6",rx:"5",ry:"2.6",fill:"none",stroke:"currentColor",strokeWidth:"0.9"}),(0,D.jsx)("circle",{className:"graview-altitude-mark-apex",cx:"6",cy:"4",r:"1.5",fill:"currentColor"}),(0,D.jsx)("circle",{className:"graview-altitude-mark-wing","data-side":"left",cx:"1.6",cy:"7.4",r:"1.2",fill:"currentColor"}),(0,D.jsx)("circle",{className:"graview-altitude-mark-wing","data-side":"right",cx:"10.4",cy:"7.4",r:"1.2",fill:"currentColor"})]}),(0,D.jsx)("span",{className:"graview-altitude-label",children:c})]})}var la=f(A(),1);function ca(){let{administered:e}=T(),{view:o,go:d}=U(),s=e.filter(n=>n.canShow);return s.length===0?null:(0,la.jsx)("div",{role:"group","aria-label":"Administered","data-testid":"administered",style:{display:"flex",gap:6},children:s.map(n=>(0,la.jsx)("button",{type:"button","aria-pressed":n.shown,"data-testid":`show-${n.name}`,title:n.shown?`Hide the ${n.name}'s own districts again`:n.description??`Show the ${n.name}'s own districts beside the domain`,onClick:()=>d(Ya(o,n.name,!n.shown)),style:{padding:"3px 11px",borderRadius:999,fontSize:"0.875rem",borderWidth:1,borderStyle:"solid",borderColor:n.shown?"var(--graview-accent)":"var(--graview-edge)",color:n.shown?"var(--graview-accent)":"var(--graview-ink-muted)",background:n.shown?"var(--graview-panel)":"transparent"},children:n.shown?`Hide the ${n.name}`:`Show the ${n.name}`},n.name))})}var u=f(_(),1);var t=f(A(),1);za({search:Ua,touchWeights:_a});var ne=e=>e!==void 0&&"act"in e,ze=e=>e!==void 0&&"hit"in e&&e.hit.about==="node"?e:void 0,Mt=e=>e.about==="rule"?"rule:":e.about==="act"?"act:":e.kind;function Lt(e){let o=()=>typeof window>"u"||window.innerWidth>=qt,[d,s]=(0,u.useState)(o);return(0,u.useEffect)(()=>{let n=()=>s(o());return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),d&&!e}function lt({compact:e=!1}){let{store:o,view:d,setView:s,principal:n,setMenuAt:m,brand:v,aiDesk:g,selection:y}=T(),S=Oa(g),c=Ma(),b=Pa(),k=Wa().marks.flag,w=Lt(e),R=(0,u.useRef)(null),P=(0,u.useRef)(null),z=(0,u.useRef)(null),W=(0,u.useId)(),[Le,N]=(0,u.useState)(!1),[K,oe]=(0,u.useState)(null),[ht,fe]=(0,u.useState)(null),[Pe,he]=(0,u.useState)([]),M=d.q??"";(0,u.useEffect)(()=>{let a=r=>{if(r.defaultPrevented)return;let i=r.key.toLowerCase()==="k"&&(r.metaKey||r.ctrlKey)&&!r.altKey&&!r.shiftKey,l=r.key==="/"&&!r.metaKey&&!r.ctrlKey&&!r.altKey;if(!i&&!l)return;let p=R.current;if(!p)return;let h=p.closest("[data-graview-embed]"),C=r.target,J=C===document.body||C===document.documentElement||C===window;if(h&&!(i&&J||C instanceof Node&&h.contains(C)))return;let Z=document.activeElement,pe=Z instanceof HTMLInputElement||Z instanceof HTMLTextAreaElement||Z instanceof HTMLSelectElement||Z instanceof HTMLElement&&Z.isContentEditable;l&&pe||(r.preventDefault(),p.getClientRects().length===0&&p.closest("[data-graview-app-bar]")?.querySelector('[data-testid="app-find-open"]')?.click(),p.focus({preventScroll:!0}),p.select(),N(!0))};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[]);let Ne=(0,u.useMemo)(()=>{let a=new Map;for(let[i,l]of(c?.hits??[]).entries()){if(l.about==="act")continue;let p=Mt(l),h=a.get(p)??[];h.push({id:`${W}-${i}`,hit:l}),a.set(p,h)}let r=[...a.values()].filter(i=>i.some(l=>l.hit.about==="node")).length>1;return[...a.entries()].map(([i,l])=>{let p=0,h=l.filter(pe=>pe.hit.about!=="node"||!r||++p<=Wt),C=h.filter(pe=>pe.hit.about==="node").length,J=i.endsWith(":")?l.length:c?.byKind[i]??C,Z=!i.endsWith(":")&&C>0&&J>C?{id:`${W}-all-${i}`,all:i,count:J}:null;return{key:i,rows:h,count:J,more:Z}})},[c,W]),ae=S&&M.trim()?{id:`${W}-ask`,ask:M.trim()}:null,$=(0,u.useMemo)(()=>[...Ne.flatMap(a=>a.more?[...a.rows,a.more]:a.rows),...ae?[ae]:[]],[Ne,ae?.ask]),fa=(c?.hits??[]).filter(a=>a.about==="node").length,be=c?.words??M,Ie=(0,u.useMemo)(()=>Ee(be).split(" ").filter(Boolean),[be]),F=(0,u.useCallback)(a=>a.hit.about==="node"?Va(o,a.hit.id,be,{principal:n,limit:Kt}).map((r,i)=>({id:`${a.id}-act-${i}`,act:r,of:a.id})):[],[o,be,n]),He=$.find(a=>a.id===K),q=$.find(a=>a.id===ht)??He??$[0],se=(0,u.useMemo)(()=>w&&ze(q)?F(q):[],[w,q?.id,F]),xe=(0,u.useMemo)(()=>w?new Map:new Map(Pe.flatMap(a=>{let r=ze($.find(i=>i.id===a));return r?[[a,F(r)]]:[]})),[w,Pe,$,F]),bt=(0,u.useMemo)(()=>w?new Set:new Set($.flatMap(a=>ze(a)&&F(a).length>0?[a.id]:[])),[w,$,F]),Oe=(0,u.useMemo)(()=>w?se:[...xe.values()].flat(),[w,se,xe]),L=He??Oe.find(a=>a.id===K)??$[0];(0,u.useEffect)(()=>{oe(null),fe(null),he([])},[M]);let de=(0,u.useRef)(null);(0,u.useEffect)(()=>{let a=de.current;if(!a)return;de.current=null;let r=0,i=()=>{let l=document.querySelector(`[data-graview-view="aggregate:${CSS.escape(a)}"]`),p=document.activeElement;if(!(!p||p===document.body||p===document.documentElement||p===R.current||p===z.current||p===l))return;let C=[...l?.querySelectorAll('[role="group"][aria-label="Arrange"] :is(button, input)')??[]].find(J=>J.checkVisibility?.()??!0);if(C)return C.focus({preventScroll:!0});l&&l.tabIndex>=0&&p!==l&&l.focus({preventScroll:!0}),++r<240?requestAnimationFrame(i):document.activeElement===z.current&&z.current?.blur()};requestAnimationFrame(i)},[d]);let Be=(a,r)=>{let i=document.querySelector(`[data-graview-view="aggregate:${CSS.escape(a)}"]`);if(i&&i.tabIndex>=0)return i.focus({preventScroll:!0});let l=z.current;if(!l)return R.current?.blur();l.setAttribute("aria-label",r),l.focus({preventScroll:!0})},ha=(0,u.useRef)({x:Number.NaN,y:Number.NaN,moved:!1});(0,u.useEffect)(()=>{let a=r=>{let i=ha.current;i.moved=r.clientX!==i.x||r.clientY!==i.y,i.x=r.clientX,i.y=r.clientY};return window.addEventListener("mousemove",a,{capture:!0,passive:!0}),()=>window.removeEventListener("mousemove",a,{capture:!0})},[]);let le=(0,u.useRef)(void 0);(0,u.useEffect)(()=>()=>clearTimeout(le.current),[]);let te=a=>{a&&(clearTimeout(le.current),oe(a.id),ne(a)||fe(a.id))},ba=a=>{if(!ha.current.moved)return;let r=a.target.closest?.('[role="option"]')?.id;if(!r||r===K)return;let i=$.find(l=>l.id===r)??Oe.find(l=>l.id===r);i&&(oe(i.id),!ne(i)&&(clearTimeout(le.current),le.current=setTimeout(()=>fe(i.id),Ft)))},xt=()=>{clearTimeout(le.current),q&&!ne(L)&&oe(q.id)},yt=a=>he(r=>r.includes(a.id)?r.filter(i=>i!==a.id):[...r,a.id]),xa=a=>{let r=P.current,i=r?.querySelector('[role="option"]')?.getBoundingClientRect().height??0,l=r?.clientHeight??0;return Math.min(a,i>0&&l>0?Math.max(1,Math.floor(l/i)-1):Bt)};(0,u.useEffect)(()=>{K&&document.getElementById(K)?.scrollIntoView?.({block:"nearest"})},[K]);let De=a=>{if(!a)return;if("ask"in a){Ha(g,{pointed:{...y[0]!==void 0?{on:y[0]}:{},about:y},asked:a.ask}),s(i=>Ye(i)),N(!1);return}if("all"in a)return s(i=>ve(ee(i,!1),ge(a.all),{ownPicture:!0,...i.q?{carry:i.q}:{}})),de.current=a.all,N(!1),Be(a.all,`Opening ${G(o.schema,a.all)} matching \u201C${M.trim()}\u201D\u2026`);if(ne(a)){let i=a.act.subject;s(p=>$e(p,[i]));let l=R.current?.getBoundingClientRect();m({x:l?.left??0,y:(l?.bottom??0)+6,on:i}),N(!1),R.current?.blur();return}let r=a.hit;switch(r.about){case"node":s(i=>$e(Se(ee(i,!1),r.id),[r.id]));break;case"kind":return s(i=>ve(ee(i,!1),ge(r.kind),{ownPicture:!0})),de.current=r.kind,N(!1),Be(r.kind,`Opening ${r.label}\u2026`);case"place":return s(i=>Ra(i,r.kind,r.as)),de.current=r.kind,N(!1),Be(r.kind,`Opening ${r.title}\u2026`);case"rule":{let i=b.filter(l=>l.invariant===r.name).flatMap(l=>l.nodeIds);s(l=>$e(l,[...new Set(i)]));break}case"act":break}N(!1),R.current?.blur()},kt=c?Ot(c.byKind,c.hits,o.schema):"",ce=Le&&M.trim().length>0,St=(0,u.useCallback)(()=>{let a=R.current?.closest("[data-graview-app-bar]")?.getBoundingClientRect();if(a)return{x:a.right,y:a.bottom-Vt};let r=R.current?.getBoundingClientRect();return r?{x:r.right,y:r.bottom}:null},[]),ya=Ia("find",{open:ce,onOpenChange:a=>{a||N(!1)},...e?{at:St}:{}}),ye=$.every(a=>"ask"in a),ka=a=>ne(a)?Oe.filter(r=>r.of===a.of):[],$t=a=>{let r=ne(L)&&K!==null,i=r?$.find(p=>p.id===L.of):K!==null?He:void 0,l=i?$.indexOf(i):-1;if(a.key==="ArrowDown"){if(a.preventDefault(),N(!0),r){let p=ka(L),h=p.indexOf(L)+1;if(h<p.length)return te(p[h]);if(w)return}te($[Math.min($.length-1,l+1)])}else if(a.key==="ArrowUp"){if(a.preventDefault(),r){let p=ka(L),h=p.indexOf(L)-1;return te(h>=0?p[h]:i)}te($[Math.max(0,l-1)])}else if((a.key==="PageDown"||a.key==="PageUp")&&$.length>0){a.preventDefault(),N(!0);let p=a.key==="PageDown"?xa($.length):-xa($.length);te($[Math.min($.length-1,Math.max(0,(l<0?-1:l)+p))])}else if(a.key==="ArrowRight"&&!r&&ze(L)){let p=L,h=w?p.id===q?.id?se:F(p):xe.get(p.id)??F(p);if(h.length===0)return;a.preventDefault(),!w&&!Pe.includes(p.id)&&he(C=>[...C,p.id]),fe(p.id),oe(h[0].id)}else if(a.key==="ArrowLeft"&&r){a.preventDefault();let p=L.of;w||he(h=>h.filter(C=>C!==p)),te($.find(h=>h.id===p))}else a.key==="Enter"?(a.preventDefault(),De(L)):a.key==="Escape"&&(a.preventDefault(),M?s(p=>Ye(p)):R.current?.blur())},We=(a,r,i={},l={})=>{let p=a.id===L?.id;return(0,t.jsx)("div",{id:a.id,role:"option","aria-selected":p,onClick:()=>De(a),style:{...er,...p?ar:null,...i},...l,children:r},a.id)},Sa=(a,r)=>{let i=a.id===L?.id;return(0,t.jsx)("div",{id:a.id,role:"option","aria-selected":i,"data-testid":"find-act","data-about":"act",onClick:()=>De(a),style:{...r?nr:pt,...i?or:null,...a.act.destructive?{color:"var(--graview-warn)"}:null},children:a.act.title},a.id)};return(0,t.jsxs)("div",{style:{position:"relative",minWidth:0,flex:"1 1 auto"},"data-testid":"find",children:[(0,t.jsx)("input",{ref:a=>{R.current=a,ya.trigger.ref(a)},"data-graview-popover-trigger":"find",type:"search",role:"combobox","aria-label":"Find anything","aria-expanded":ce,"aria-controls":W,"aria-autocomplete":"list",...ce&&L?{"aria-activedescendant":L.id}:{},"data-testid":"find-box",placeholder:"Find\u2026","aria-keyshortcuts":"/ Meta+K Control+K",value:M,onChange:a=>{let r=a.target.value;N(!0),s(i=>ja(i,r.length>0?r:null))},onFocus:()=>N(!0),onBlur:()=>N(!1),onKeyDown:$t,style:{width:"100%",boxSizing:"border-box",minWidth:0,height:30,padding:"0 var(--graview-bar-find-end, 10px) 0 10px",font:"inherit",fontSize:"0.875rem",color:"var(--graview-ink)",background:"var(--graview-panel)",border:`1px solid ${M?"var(--graview-accent)":"var(--graview-edge)"}`,borderRadius:8}}),(0,t.jsx)("span",{role:"status","aria-live":"polite",style:qe,"data-testid":"find-count",children:M.trim()?kt:""}),(0,t.jsx)("span",{ref:z,tabIndex:-1,role:"status",style:qe,"data-testid":"find-landing"}),(0,t.jsxs)("div",{...ya.pane,id:W,role:"listbox","aria-label":M?`What \u201C${M}\u201D finds`:"What the words find","data-testid":"find-strip","data-graview-find":w?"panel":"narrow",hidden:!ce,onMouseDown:a=>a.preventDefault(),style:{..._t,...e?Yt:w&&!ye?Ut:null,...ce?{display:"flex"}:null},children:[(0,t.jsxs)("div",{style:{...jt,gridTemplateColumns:w&&!ye?`minmax(0, 1fr) ${Gt}`:"minmax(0, 1fr)"},children:[(0,t.jsxs)("div",{ref:P,role:"presentation","data-testid":"find-list",onMouseMove:ba,style:Qt,children:[ye?(0,t.jsxs)("p",{role:"presentation",style:{margin:0,padding:"10px 12px",color:"var(--graview-ink-muted)",fontSize:"0.875rem"},"data-testid":"find-nothing",children:["Nothing here is called \u201C",c?.words||M,"\u201D."]}):Ne.map(a=>(0,t.jsxs)("div",{role:"group","aria-label":st(a.key,o.schema),children:[(0,t.jsxs)("div",{role:"presentation",style:pa,children:[a.key!=="rule:"&&a.key!=="act:"?(0,t.jsx)(ct,{kind:a.key,accents:v?.accents}):null,(0,t.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:st(a.key,o.schema)}),(0,t.jsx)("span",{"aria-hidden":"true",style:Zt,"data-testid":"find-group-count",children:re(a.count)})]}),a.rows.map(r=>{let i=r.hit,l=i.about==="node"?i:null,p=!w&&l!==null&&bt.has(r.id),h=xe.get(r.id);return(0,t.jsxs)(u.Fragment,{children:[We(r,(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Nt,{hit:i,flag:k,words:l?.near&&l.why.matched?[...Ie,Ee(l.why.matched)]:Ie}),p?(0,t.jsx)("span",{"aria-hidden":"true","data-testid":"find-acts-open","data-open":h?"":void 0,title:h?"Put its actions away":"Actions",onClick:C=>{C.stopPropagation(),yt(r)},style:{...dr,...h?lr:null},children:(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"3.5",cy:"8",r:"1.4",fill:"currentColor"}),(0,t.jsx)("circle",{cx:"8",cy:"8",r:"1.4",fill:"currentColor"}),(0,t.jsx)("circle",{cx:"12.5",cy:"8",r:"1.4",fill:"currentColor"})]})}):null]}),p?{paddingRight:48}:{},{"data-testid":"find-hit","data-about":i.about,...l?.near?{"data-near":""}:{},title:Ht(i)}),h?(0,t.jsx)("div",{role:"group","aria-label":`What can be done about ${l?.label??"it"}`,style:sr,children:h.map(C=>Sa(C,!0))}):null]},r.id)}),a.more?We(a.more,(0,t.jsxs)("span",{style:Q,children:["All ",re(a.more.count)," ",ke(o.schema,a.more.all).toLowerCase()," matching \u201C",M.trim(),"\u201D"]}),tr,{"data-testid":"find-all","data-about":"all"}):null]},a.key)),ae?We(ae,(0,t.jsxs)("span",{style:Q,children:["Tell Graview: ",(0,t.jsxs)("span",{style:{fontWeight:600},children:["\u2018",ae.ask,"\u2019"]})]}),{borderTop:"1px solid var(--graview-edge)",marginTop:4},{"data-testid":"find-ask"}):null,fa>Dt?(0,t.jsxs)("p",{role:"presentation",style:dt,"data-testid":"find-more-words",children:[re(fa)," found: another word of the name narrows them."]}):null,c&&c.searched.past===!1&&c.searched.kinds.some(a=>o.schema.tryDefinition(a)?.lifecycle)?(0,t.jsx)("p",{role:"presentation",style:dt,children:"Current ones; add is:any for the past."}):null]}),w&&!ye&&q?(0,t.jsxs)("div",{role:"group","aria-label":"The one lit","data-testid":"find-panel",onMouseEnter:xt,onMouseMove:ba,style:Xt,children:[(0,t.jsx)(Pt,{row:q,schema:o.schema,accents:v?.accents,marking:Ie,q:M.trim(),flag:k}),se.length>0?(0,t.jsxs)("div",{role:"group","aria-label":"Actions",style:{display:"grid",gap:4},children:[(0,t.jsx)("div",{role:"presentation",style:{...pa,padding:"10px 0 4px"},children:"Actions"}),se.map(a=>Sa(a,!1))]}):null]}):null]}),e?null:(0,t.jsxs)("div",{"aria-hidden":"true",style:cr,"data-testid":"find-keys",children:[(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{style:me,children:"\u2191"}),(0,t.jsx)("kbd",{style:me,children:"\u2193"})," move"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{style:me,children:"\u21B5"})," open"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{style:me,children:"\u2192"})," actions"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{style:me,children:"esc"})," close"]})]})]})]})}function Pt({row:e,schema:o,accents:d,marking:s,q:n,flag:m}){let v=null,g="",y,S=null;if("ask"in e)g="Tell Graview",y=`\u2018${e.ask}\u2019`,S=(0,t.jsx)("p",{style:Y,children:"Says it to Graview about what is selected; the answer comes on a card beside it."});else if("all"in e)v=e.all,g=G(o,e.all),y=`All ${re(e.count)} matching \u201C${n}\u201D`,S=(0,t.jsxs)("p",{style:Y,children:["Opens the ",ke(o,e.all).toLowerCase(),", narrowed by these words."]});else{let c=e.hit;switch(c.about){case"node":{v=c.kind,g=ot(Ca(o.tryDefinition(c.kind),c.kind)),y=(0,t.jsxs)(t.Fragment,{children:[c.flagged?(0,t.jsxs)("span",{style:{color:"var(--graview-warn)"},children:[m," "]}):null,(0,t.jsx)(j,{text:c.label,words:s})]});let b=[c.apart,c.current?null:"past",c.archived?"set aside":null].filter(Boolean).join(" \xB7 ");S=(0,t.jsxs)(t.Fragment,{children:[b?(0,t.jsx)("p",{style:Y,children:ot(b)}):null,c.near?(0,t.jsxs)("p",{style:Y,children:["Near \u201C",c.why.asked,"\u201D",c.why.field!=="label"?` \u2014 ${c.why.reading.toLowerCase()}: ${c.why.fragment}`:""]}):c.why.field!=="label"?(0,t.jsxs)("p",{style:Y,children:[(0,t.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:c.why.reading}),(0,t.jsx)("br",{}),(0,t.jsx)(j,{text:c.why.fragment,words:s})]}):null]});break}case"kind":v=c.kind,g="Kind",y=c.label,S=(0,t.jsxs)("p",{style:Y,children:["Goes into the ",c.label.toLowerCase(),", all of them",c.count>0?`; ${re(c.count)} match these words`:"","."]});break;case"place":v=c.kind,g="Place",y=c.title,S=(0,t.jsxs)("p",{style:Y,children:["A picture of the ",ke(o,c.kind).toLowerCase(),"."]});break;case"rule":g="Rule",y=c.label,S=(0,t.jsx)("p",{style:Y,children:"Selects what it flags."});break;case"act":g="Act",y=c.title;break}}return(0,t.jsxs)("div",{role:"presentation","data-testid":"find-said",style:{display:"grid",gap:6},children:[(0,t.jsxs)("div",{style:{...pa,padding:0},children:[v?(0,t.jsx)(ct,{kind:v,accents:d}):null,g]}),(0,t.jsx)("div",{style:Jt,children:y}),S]})}function Nt({hit:e,flag:o,words:d}){switch(e.about){case"node":return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{style:rr,children:[e.flagged?(0,t.jsxs)("span",{style:{color:"var(--graview-warn)"},children:[o," "]}):null,(0,t.jsx)(j,{text:e.label,words:d}),e.apart?(0,t.jsxs)("span",{style:we,children:[" \xB7 ",e.apart]}):null,e.current?null:(0,t.jsx)("span",{style:we,children:" \xB7 past"})]}),e.near?(0,t.jsxs)("span",{style:{...Q,...we},"data-testid":"find-near",children:["Near \u201C",e.why.asked,"\u201D",e.why.field!=="label"?` \u2014 ${e.why.reading.toLowerCase()}: `:"",e.why.field!=="label"?(0,t.jsx)(j,{text:e.why.fragment,words:d}):null]}):e.why.field!=="label"?(0,t.jsxs)("span",{style:{...Q,...we},children:[e.why.reading.toLowerCase(),": ",(0,t.jsx)(j,{text:e.why.fragment,words:d})]}):null]});case"kind":return(0,t.jsxs)("span",{style:Q,children:[(0,t.jsx)(j,{text:e.label,words:d}),(0,t.jsxs)("span",{style:we,children:[" \xB7 ",e.count," match"]})]});case"place":return(0,t.jsxs)("span",{style:Q,children:["Go to ",(0,t.jsx)(j,{text:e.title,words:d})]});case"rule":return(0,t.jsxs)("span",{style:Q,children:["The rule \u201C",(0,t.jsx)(j,{text:e.label,words:d}),"\u201D"]});case"act":return(0,t.jsx)("span",{style:Q,children:e.title})}}function It(e,o){if(o.length===0)return[{text:e}];let d=[],s=0;for(let n of e.matchAll(/[\p{L}\p{N}]+/gu)){let m=n[0],v=Ee(m).replace(/ /g,""),g=o.filter(c=>v.startsWith(c)).sort((c,b)=>b.length-c.length)[0];if(!g)continue;let y=v.length===m.length?g.length:m.length,S=n.index??0;S>s&&d.push({text:e.slice(s,S)}),d.push({text:m.slice(0,y),marked:!0}),s=S+y}return s<e.length&&d.push({text:e.slice(s)}),d}function j({text:e,words:o}){return(0,t.jsx)(t.Fragment,{children:It(e,o).map((d,s)=>d.marked?(0,t.jsx)("mark",{style:ir,children:d.text},s):(0,t.jsx)(u.Fragment,{children:d.text},s))})}function Ht(e){if(e.about!=="node")return"";let o=e.near?`Near \u201C${e.why.asked}\u201D`:e.why.field!=="label"?`${e.why.reading}: ${e.why.fragment}`:"";return o?`${e.label}
|
|
1140
|
-
${o}`:e.label}var ot=e=>e&&e[0].toUpperCase()+e.slice(1);function ct({kind:e,accents:o}){let d=Math.round(Aa(e,o));return(0,t.jsx)("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:2,flex:"0 0 auto",background:`hsl(${d} 55% 52%)`}})}function st(e,o){return e==="rule:"?"Rules":e==="act:"?"Acts":G(o,e)}function Ot(e,o,d){let s=Object.entries(e).map(([v,g])=>$a(d,v,g)),n=o.filter(v=>v.about==="kind"||v.about==="place"||v.about==="rule").length;n>0&&s.push(`${n} ${n===1?"place or rule":"places and rules"}`);let m=o.filter(v=>v.about==="node"&&v.near).length;return s.length===0?"Nothing found":`${s.join(", ")} found${m>0?`, ${m} of them near`:""}`}var Bt=10,Dt=12,Wt=5,Kt=6,Ft=140,qt=760,Gt="15.5rem",_t={...Na,flexDirection:"column",width:"min(26rem, calc(100vw - 24px))",maxHeight:"min(64vh, 30rem)",overflow:"hidden",boxSizing:"border-box",background:"linear-gradient(var(--graview-panel), var(--graview-panel)) var(--graview-ground, var(--graview-panel))",borderTop:"1px solid var(--graview-edge)",borderRight:"1px solid var(--graview-edge)",borderBottom:"1px solid var(--graview-edge)",borderLeft:"1px solid var(--graview-edge)",borderRadius:10,boxShadow:"0 10px 28px rgb(0 0 0 / 0.18)",padding:0},Ut={width:"min(42rem, calc(100vw - 24px))"},Vt=6,Yt={width:"var(--graview-bar-width, 100vw)",maxHeight:"55vh",borderRadius:0,borderLeft:"none",borderRight:"none"},jt={display:"grid",gridTemplateRows:"minmax(0, 1fr)",flex:"1 1 auto",minHeight:0},Qt={overflowY:"auto",overflowX:"hidden",minHeight:0,padding:"4px 0",overscrollBehavior:"contain"},Xt={overflowY:"auto",minHeight:0,padding:"12px 14px",borderLeft:"1px solid var(--graview-edge)",background:"var(--graview-panel-muted)",display:"flex",flexDirection:"column",gap:4},Jt={fontWeight:600,fontSize:"0.9375rem",lineHeight:1.35,color:"var(--graview-ink)",overflowWrap:"anywhere"},Y={margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)",overflowWrap:"anywhere"},pa={display:"flex",alignItems:"center",gap:6,padding:"10px 12px 4px",fontSize:"0.6875rem",fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--graview-ink-muted)"},Zt={marginLeft:"auto",fontWeight:400,letterSpacing:0,fontVariantNumeric:"tabular-nums",color:"var(--graview-ink-faint)"},er={position:"relative",display:"grid",gap:1,minHeight:34,padding:"5px 12px",alignContent:"center",cursor:"pointer",fontSize:"0.875rem",lineHeight:1.35,color:"var(--graview-ink)",minWidth:0},ar={background:"color-mix(in srgb, var(--graview-accent) 12%, var(--graview-panel))",boxShadow:"inset 3px 0 0 var(--graview-accent)"},tr={color:"var(--graview-accent)",fontSize:"0.8125rem",minHeight:30},Q={display:"block",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},rr={display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:2,minWidth:0,overflow:"hidden",overflowWrap:"anywhere",fontWeight:600},we={color:"var(--graview-ink-muted)",fontSize:"0.8125rem",fontWeight:400},ir={background:"color-mix(in srgb, var(--graview-accent) 24%, transparent)",color:"inherit",borderRadius:2,padding:0,boxShadow:"0 1px 0 color-mix(in srgb, var(--graview-accent) 70%, transparent)"},pt={display:"flex",alignItems:"center",minHeight:32,padding:"4px 10px",boxSizing:"border-box",borderWidth:1,borderStyle:"solid",borderColor:"var(--graview-edge)",borderRadius:6,background:"var(--graview-panel)",color:"var(--graview-ink)",fontSize:"0.8125rem",lineHeight:1.3,cursor:"pointer",overflowWrap:"anywhere"},nr={...pt,minHeight:32,margin:"0 12px 4px 24px"},or={borderColor:"var(--graview-accent)",boxShadow:"inset 0 0 0 1px var(--graview-accent)",background:"color-mix(in srgb, var(--graview-accent) 12%, var(--graview-panel))"},sr={display:"grid",padding:"2px 0 6px"},dr={position:"absolute",top:"50%",right:6,transform:"translateY(-50%)",width:36,height:32,display:"grid",placeItems:"center",borderRadius:6,color:"var(--graview-ink-muted)",borderWidth:1,borderStyle:"solid",borderColor:"transparent"},lr={color:"var(--graview-accent)",borderColor:"var(--graview-edge)",background:"var(--graview-panel)"},dt={margin:0,padding:"6px 12px 4px",color:"var(--graview-ink-faint)",fontSize:"0.75rem"},cr={display:"flex",flexWrap:"wrap",gap:"4px 14px",padding:"7px 12px",borderTop:"1px solid var(--graview-edge)",color:"var(--graview-ink-faint)",fontSize:"0.75rem",flex:"0 0 auto"},me={display:"inline-block",minWidth:16,padding:"0 4px",marginRight:3,border:"1px solid var(--graview-edge)",borderRadius:4,font:"inherit",fontSize:"0.6875rem",lineHeight:"16px",textAlign:"center",color:"var(--graview-ink-muted)",background:"var(--graview-panel)"};var Me=f(_(),1),ga=f(Ct(),1);var vt=f(A(),1);function gt(){let{following:e,follow:o}=T();return e?(0,vt.jsxs)("button",{type:"button","data-testid":"following-who",onClick:()=>o(null),title:"Press, or Escape, to stop following",style:{display:"inline-flex",alignItems:"center",gap:6,minHeight:24,padding:"2px 9px",borderRadius:999,border:"1px solid var(--graview-accent)",background:"transparent",color:"var(--graview-accent)",fontSize:"0.875rem",whiteSpace:"nowrap"},children:["following ",e.name]}):null}var ut=f(_(),1);var E=f(A(),1);function wt({home:e,homeLabel:o,children:d,onPicture:s=!1}){let{view:n,focus:m,show:v,go:g}=U(),{store:y}=T(),{movedByHand:S}=T(),c=S&&(n.pan!==void 0||Object.keys(n.pins).length>0),b=n.focusId&&n.focusId!==e?y.graph.getNode(n.focusId):void 0,k=z=>G(y.schema,z),w={display:"inline-flex",alignItems:"center",gap:6,minHeight:26,padding:"2px 6px",fontSize:"0.8125rem",borderRadius:6,border:"1px solid transparent",boxShadow:"none",background:"transparent",color:"var(--graview-ink-muted)",whiteSpace:"nowrap"},R=o!==void 0&&b!==void 0,P=[];if(b&&!s&&P.push({key:"focused",node:(0,E.jsxs)("button",{type:"button","data-testid":"focused",onClick:()=>g(Fe({...n,focusId:e},!1)),title:Ge(y,b.id),style:{...w,maxWidth:"min(14rem, 15vw)"},children:[(0,E.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:Ge(y,b.id)}),(0,E.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),n.past&&P.push({key:"past",node:(0,E.jsxs)("button",{type:"button","data-testid":"past",onClick:()=>g(Qa(n,!1)),title:"Back to now \u2014 retired things leave the picture again",style:w,children:["the past",(0,E.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),n.zoom&&P.push({key:"zoomed",node:(0,E.jsxs)("button",{type:"button","data-testid":"zoomed",onClick:()=>g(Fe(n,!1)),title:"Zoom back out",style:w,children:["zoomed in",(0,E.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),c&&P.push({key:"moved",node:(0,E.jsx)("button",{type:"button","data-testid":"moved",onClick:()=>g(Ke(n)),title:"Put the camera and everything you dragged back where the layout wanted them",style:w,children:"Reset view"})}),n.relation){let z=n.relation;P.push({key:"raised",node:(0,E.jsxs)("span",{style:{display:"inline-flex",alignItems:"center"},children:[(0,E.jsxs)("button",{type:"button","data-testid":"raised-into",onClick:()=>g(ve(n,ge(z),{ownPicture:!0})),title:`Go into the ${k(z).toLowerCase()}`,"aria-label":`Go into the ${k(z).toLowerCase()}`,style:{...w,color:"var(--graview-ink)"},children:[k(z),(0,E.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\u2198"})]}),(0,E.jsx)("button",{type:"button","data-testid":"raised",onClick:()=>v(null),title:`Stop showing ${k(z).toLowerCase()}`,"aria-label":`Stop showing ${k(z).toLowerCase()}`,style:{...w,minWidth:26,justifyContent:"center"},children:(0,E.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})})]})})}return s&&!R&&P.length===0&&d===void 0?null:(0,E.jsxs)("nav",{"aria-label":"View","data-testid":"trail",style:{display:"flex",alignItems:"center",gap:8,fontSize:"0.875rem",minWidth:0,...s?{pointerEvents:"auto",padding:"4px 6px",borderRadius:8,background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)",overflow:"hidden"}:{}},children:[R?(0,E.jsx)("button",{type:"button",onClick:()=>m(e),style:{border:"none",background:"none",padding:"3px 0",minHeight:24,whiteSpace:"nowrap",color:"var(--graview-ink-muted)"},children:o}):null,P.map(({key:z,node:W},Le)=>(0,E.jsxs)(ut.Fragment,{children:[R||Le>0?(0,E.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:"\u203A"}):null,W]},z)),d]})}var O=f(A(),1);function va(){let[e,o]=(0,Me.useState)([]),d=(0,Me.useCallback)(s=>{o(n=>{let m=s.phase!=="running"&&n[0]?.name===s.name&&n[0]?.at===s.at;return[s,...m?n.slice(1):n].slice(0,12)})},[]);return[e,d]}function ua({find:e,calls:o,seat:d,remembers:s=!1}){return e?(0,O.jsxs)(O.Fragment,{children:[(0,ga.createPortal)((0,O.jsx)(lt,{compact:e.compact}),e.slot),e.own?(0,ga.createPortal)((0,O.jsx)(Ka,{calls:o,remembers:s,...d!==void 0?{seat:d}:{}}),e.own):null]}):null}function wa({home:e=null}){return(0,O.jsxs)("div",{"data-graview-scene-trail":"",style:{position:"absolute",top:14,left:14,maxWidth:"calc(100% - 150px - var(--graview-dock, 0px))",zIndex:B("overview"),display:"flex",alignItems:"center",gap:6,minWidth:0,pointerEvents:"none"},children:[(0,O.jsx)(wt,{home:e,onPicture:!0}),(0,O.jsx)("span",{style:{pointerEvents:"auto"},children:(0,O.jsx)(gt,{})})]})}var X=f(_(),1);var mt=f(A(),1),pr=ie(()=>(__graviewPreload(import.meta.url,["./chunk.Q355UPFG.js","./chunk.
|
|
1139
|
+
}`}function na(e="dark",o={}){let d=At(e);return o.scope===void 0?d:Ta(d,o.scope)}var I=f(_(),1);var V=f(A(),1),Et=Ae(ie(()=>(__graviewPreload(import.meta.url,["./chunk.GH6QX7JR.js","./chunk.J4D4BIB4.js","./chunk.ASNVH2G4.js","./chunk.SDO3U72B.js","./chunk.ZDUKVXBI.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.47QWCVZD.js")))).part(e=>(0,V.jsx)(e.MapKey,{}),{quiet:!0});function oa(){let{store:e}=T(),{view:o}=U(),d=Ce(),s=(0,I.useMemo)(()=>e.graph.allEdges().length>0,[e,d]),[n,m]=(0,I.useState)(!1),v=(0,I.useId)(),g=(0,I.useRef)(null),y=(0,I.useRef)(null);(0,I.useEffect)(()=>{if(!n)return;let b=k=>{let w=k.target;w&&(y.current?.contains(w)||g.current?.contains(w))||m(!1)};return document.addEventListener("pointerdown",b,!0),()=>document.removeEventListener("pointerdown",b,!0)},[n]);let[S,c]=(0,I.useState)(null);return(0,I.useEffect)(()=>{let b=g.current?.parentElement?.parentElement?.querySelector('[data-testid="overview"]');if(!b||typeof ResizeObserver>"u")return;let k=()=>c(Math.ceil(b.getBoundingClientRect().width));k();let w=new ResizeObserver(k);return w.observe(b),()=>w.disconnect()},[s]),s?(0,V.jsxs)("div",{style:{display:"contents"},onKeyDown:b=>{b.key!=="Escape"||!n||(b.preventDefault(),b.stopPropagation(),m(!1),g.current?.focus({preventScroll:!0}))},children:[(0,V.jsx)("button",{ref:g,type:"button","data-testid":"lines-key",className:"graview-lines-key","data-graview-up-row":o.overview?void 0:"","aria-expanded":n,"aria-controls":v,title:"What the lines mean",onClick:()=>m(b=>!b),style:{position:"absolute",top:60,right:"calc(14px + var(--graview-dock, 0px))",zIndex:B("overview"),height:30,padding:"0 11px",borderRadius:8,borderColor:"transparent",fontSize:"0.8125rem",color:n?"var(--graview-accent)":"var(--graview-ink-muted)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)",...S!==null?{"--graview-up-room":`${S}px`}:{}},children:"Key"}),n?(0,V.jsxs)("div",{ref:y,id:v,"data-testid":"lines-key-pane",className:"graview-lines-key-pane","data-graview-up-row":o.overview?void 0:"","data-graview-offstage":"",style:{position:"absolute",top:98,right:"calc(14px + var(--graview-dock, 0px))",zIndex:B("rail"),width:it,maxHeight:"calc(100cqh - 120px)",overflowY:"auto",boxSizing:"border-box",padding:"8px 8px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:[o.overview?(0,V.jsx)(Et,{}):null,(0,V.jsx)(rt,{inside:!0,widthOf:Za})]}):null]}):null}var Te=f(_(),1),Re=f(A(),1);function nt(e){return e.lens!==null?{what:"lens",kind:e.lens}:e.records.length===1&&e.districts.length===0?{what:"record",id:e.records[0]}:e.districts.length===1&&e.records.length===0?{what:"district",kind:e.districts[0]}:null}var Rt=Ae(ie(()=>(__graviewPreload(import.meta.url,["./chunk.HIIYDKFC.js","./chunk.F2BZ4SC4.js","./chunk.WAPY4RCS.js","./chunk.JMXBMLKH.js","./chunk.PVAYYFT2.js","./chunk.HJCQ6I3S.js","./chunk.QNFX5VHW.js","./chunk.UXW43HNW.js","./chunk.L3ST2YKI.js","./chunk.7VCYVCYM.js","./chunk.MFNWHXGL.js","./chunk.DCIYOZYP.js","./chunk.JP33TNCH.js","./chunk.BIDL7GQD.js","./chunk.O5P6LXHF.js","./chunk.VGQDPEB5.js","./chunk.WIVNFOQR.js","./chunk.Q5WEOX3Q.js","./chunk.7DCBIMOI.js","./chunk.GXK5PI7I.js","./chunk.DYPSFTRP.js","./chunk.WVUJXDXZ.js","./chunk.J7GH2CGV.js","./chunk.SMF5S4DQ.js","./chunk.XP4IVKKR.js","./chunk.R5YGW5ZX.js","./chunk.QMGBAKX6.js","./chunk.PS765ODQ.js","./chunk.MIE4TJRW.js","./chunk.DEBW4FH6.js","./chunk.RD2FSSLV.js","./chunk.OWHH7JDV.js","./chunk.T3RFZ66S.js","./chunk.TDWJU6GW.js","./chunk.P3Z4ZCL3.js","./chunk.45OLF6BK.js","./chunk.T6ISUVUP.js","./chunk.GH6QX7JR.js","./chunk.J4D4BIB4.js","./chunk.ASNVH2G4.js","./chunk.SDO3U72B.js","./chunk.ZDUKVXBI.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.EHCMBAZO.js")))),Tt=Rt.part((e,o)=>(0,Re.jsx)(e.MapPanelFor,{showing:o.showing}),{what:"This panel",quiet:!0});function sa(){let{store:e,view:o,selection:d,hiddenKinds:s,seatTalk:n}=T();Ce();let m=(0,Te.useSyncExternalStore)(n.subscribe,()=>n.get().draft!==null,()=>!1);if(!o.overview||m)return null;let v=nt(Xa(d,{...o,beside:!0},g=>e.graph.getNode(g)?.kind));return!v||v.what!=="record"&&(s.has(v.kind)||!e.schema.kinds.includes(v.kind))?null:(0,Re.jsx)(Te.Suspense,{fallback:null,children:(0,Re.jsx)(Tt,{showing:v})})}var zt=f(_(),1);var D=f(A(),1);function da(){let{view:e,go:o}=U(),{store:d,views:s,hiddenKinds:n}=T(),m=e.overview??!1,v=s.places().map(k=>k.kind).filter(k=>!n.has(k)),g=Ga(e,d.schema.kinds,v),y=()=>{o(Se(ee(e,!1),g))},S=(()=>{if(!g)return null;let k=Ea(g)[0],w=e.within?.view,R=(w?s.places().find(P=>P.as===w):void 0)??(k?s.places().filter(P=>P.kind===k).at(-1):void 0);return R?R.title:k?G(d.schema,k):d.graph.getNode(g)?.label??null})(),c=m?"Close the map":"Up",b=m&&S?`Close the map, down to ${S}`:c;return(0,D.jsxs)("button",{type:"button","data-testid":"overview",className:"graview-altitude-control","aria-pressed":m,"aria-label":b,title:m?b:"Up \u2014 everything, from above",onClick:()=>m?y():o(ee(e,!0)),style:{position:"absolute",top:14,right:"calc(14px + var(--graview-dock, 0px))",zIndex:B("overview"),display:"inline-flex",alignItems:"center",justifyContent:"center",gap:7,height:38,padding:"0 13px 0 11px",borderRadius:8,borderColor:"transparent",fontSize:"0.875rem",whiteSpace:"nowrap",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)","--graview-altitude":m?1:0,...m?{color:"var(--graview-accent)"}:{}},children:[(0,D.jsxs)("svg",{className:"graview-altitude-mark",width:"16",height:"16",viewBox:"0 0 12 12","aria-hidden":"true",children:[(0,D.jsx)("ellipse",{className:"graview-altitude-mark-ring",cx:"6",cy:"6.6",rx:"5",ry:"2.6",fill:"none",stroke:"currentColor",strokeWidth:"0.9"}),(0,D.jsx)("circle",{className:"graview-altitude-mark-apex",cx:"6",cy:"4",r:"1.5",fill:"currentColor"}),(0,D.jsx)("circle",{className:"graview-altitude-mark-wing","data-side":"left",cx:"1.6",cy:"7.4",r:"1.2",fill:"currentColor"}),(0,D.jsx)("circle",{className:"graview-altitude-mark-wing","data-side":"right",cx:"10.4",cy:"7.4",r:"1.2",fill:"currentColor"})]}),(0,D.jsx)("span",{className:"graview-altitude-label",children:c})]})}var la=f(A(),1);function ca(){let{administered:e}=T(),{view:o,go:d}=U(),s=e.filter(n=>n.canShow);return s.length===0?null:(0,la.jsx)("div",{role:"group","aria-label":"Administered","data-testid":"administered",style:{display:"flex",gap:6},children:s.map(n=>(0,la.jsx)("button",{type:"button","aria-pressed":n.shown,"data-testid":`show-${n.name}`,title:n.shown?`Hide the ${n.name}'s own districts again`:n.description??`Show the ${n.name}'s own districts beside the domain`,onClick:()=>d(Ya(o,n.name,!n.shown)),style:{padding:"3px 11px",borderRadius:999,fontSize:"0.875rem",borderWidth:1,borderStyle:"solid",borderColor:n.shown?"var(--graview-accent)":"var(--graview-edge)",color:n.shown?"var(--graview-accent)":"var(--graview-ink-muted)",background:n.shown?"var(--graview-panel)":"transparent"},children:n.shown?`Hide the ${n.name}`:`Show the ${n.name}`},n.name))})}var u=f(_(),1);var t=f(A(),1);za({search:Ua,touchWeights:_a});var ne=e=>e!==void 0&&"act"in e,ze=e=>e!==void 0&&"hit"in e&&e.hit.about==="node"?e:void 0,Mt=e=>e.about==="rule"?"rule:":e.about==="act"?"act:":e.kind;function Lt(e){let o=()=>typeof window>"u"||window.innerWidth>=qt,[d,s]=(0,u.useState)(o);return(0,u.useEffect)(()=>{let n=()=>s(o());return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),d&&!e}function lt({compact:e=!1}){let{store:o,view:d,setView:s,principal:n,setMenuAt:m,brand:v,aiDesk:g,selection:y}=T(),S=Oa(g),c=Ma(),b=Pa(),k=Wa().marks.flag,w=Lt(e),R=(0,u.useRef)(null),P=(0,u.useRef)(null),z=(0,u.useRef)(null),W=(0,u.useId)(),[Le,N]=(0,u.useState)(!1),[K,oe]=(0,u.useState)(null),[ht,fe]=(0,u.useState)(null),[Pe,he]=(0,u.useState)([]),M=d.q??"";(0,u.useEffect)(()=>{let a=r=>{if(r.defaultPrevented)return;let i=r.key.toLowerCase()==="k"&&(r.metaKey||r.ctrlKey)&&!r.altKey&&!r.shiftKey,l=r.key==="/"&&!r.metaKey&&!r.ctrlKey&&!r.altKey;if(!i&&!l)return;let p=R.current;if(!p)return;let h=p.closest("[data-graview-embed]"),C=r.target,J=C===document.body||C===document.documentElement||C===window;if(h&&!(i&&J||C instanceof Node&&h.contains(C)))return;let Z=document.activeElement,pe=Z instanceof HTMLInputElement||Z instanceof HTMLTextAreaElement||Z instanceof HTMLSelectElement||Z instanceof HTMLElement&&Z.isContentEditable;l&&pe||(r.preventDefault(),p.getClientRects().length===0&&p.closest("[data-graview-app-bar]")?.querySelector('[data-testid="app-find-open"]')?.click(),p.focus({preventScroll:!0}),p.select(),N(!0))};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[]);let Ne=(0,u.useMemo)(()=>{let a=new Map;for(let[i,l]of(c?.hits??[]).entries()){if(l.about==="act")continue;let p=Mt(l),h=a.get(p)??[];h.push({id:`${W}-${i}`,hit:l}),a.set(p,h)}let r=[...a.values()].filter(i=>i.some(l=>l.hit.about==="node")).length>1;return[...a.entries()].map(([i,l])=>{let p=0,h=l.filter(pe=>pe.hit.about!=="node"||!r||++p<=Wt),C=h.filter(pe=>pe.hit.about==="node").length,J=i.endsWith(":")?l.length:c?.byKind[i]??C,Z=!i.endsWith(":")&&C>0&&J>C?{id:`${W}-all-${i}`,all:i,count:J}:null;return{key:i,rows:h,count:J,more:Z}})},[c,W]),ae=S&&M.trim()?{id:`${W}-ask`,ask:M.trim()}:null,$=(0,u.useMemo)(()=>[...Ne.flatMap(a=>a.more?[...a.rows,a.more]:a.rows),...ae?[ae]:[]],[Ne,ae?.ask]),fa=(c?.hits??[]).filter(a=>a.about==="node").length,be=c?.words??M,Ie=(0,u.useMemo)(()=>Ee(be).split(" ").filter(Boolean),[be]),F=(0,u.useCallback)(a=>a.hit.about==="node"?Va(o,a.hit.id,be,{principal:n,limit:Kt}).map((r,i)=>({id:`${a.id}-act-${i}`,act:r,of:a.id})):[],[o,be,n]),He=$.find(a=>a.id===K),q=$.find(a=>a.id===ht)??He??$[0],se=(0,u.useMemo)(()=>w&&ze(q)?F(q):[],[w,q?.id,F]),xe=(0,u.useMemo)(()=>w?new Map:new Map(Pe.flatMap(a=>{let r=ze($.find(i=>i.id===a));return r?[[a,F(r)]]:[]})),[w,Pe,$,F]),bt=(0,u.useMemo)(()=>w?new Set:new Set($.flatMap(a=>ze(a)&&F(a).length>0?[a.id]:[])),[w,$,F]),Oe=(0,u.useMemo)(()=>w?se:[...xe.values()].flat(),[w,se,xe]),L=He??Oe.find(a=>a.id===K)??$[0];(0,u.useEffect)(()=>{oe(null),fe(null),he([])},[M]);let de=(0,u.useRef)(null);(0,u.useEffect)(()=>{let a=de.current;if(!a)return;de.current=null;let r=0,i=()=>{let l=document.querySelector(`[data-graview-view="aggregate:${CSS.escape(a)}"]`),p=document.activeElement;if(!(!p||p===document.body||p===document.documentElement||p===R.current||p===z.current||p===l))return;let C=[...l?.querySelectorAll('[role="group"][aria-label="Arrange"] :is(button, input)')??[]].find(J=>J.checkVisibility?.()??!0);if(C)return C.focus({preventScroll:!0});l&&l.tabIndex>=0&&p!==l&&l.focus({preventScroll:!0}),++r<240?requestAnimationFrame(i):document.activeElement===z.current&&z.current?.blur()};requestAnimationFrame(i)},[d]);let Be=(a,r)=>{let i=document.querySelector(`[data-graview-view="aggregate:${CSS.escape(a)}"]`);if(i&&i.tabIndex>=0)return i.focus({preventScroll:!0});let l=z.current;if(!l)return R.current?.blur();l.setAttribute("aria-label",r),l.focus({preventScroll:!0})},ha=(0,u.useRef)({x:Number.NaN,y:Number.NaN,moved:!1});(0,u.useEffect)(()=>{let a=r=>{let i=ha.current;i.moved=r.clientX!==i.x||r.clientY!==i.y,i.x=r.clientX,i.y=r.clientY};return window.addEventListener("mousemove",a,{capture:!0,passive:!0}),()=>window.removeEventListener("mousemove",a,{capture:!0})},[]);let le=(0,u.useRef)(void 0);(0,u.useEffect)(()=>()=>clearTimeout(le.current),[]);let te=a=>{a&&(clearTimeout(le.current),oe(a.id),ne(a)||fe(a.id))},ba=a=>{if(!ha.current.moved)return;let r=a.target.closest?.('[role="option"]')?.id;if(!r||r===K)return;let i=$.find(l=>l.id===r)??Oe.find(l=>l.id===r);i&&(oe(i.id),!ne(i)&&(clearTimeout(le.current),le.current=setTimeout(()=>fe(i.id),Ft)))},xt=()=>{clearTimeout(le.current),q&&!ne(L)&&oe(q.id)},yt=a=>he(r=>r.includes(a.id)?r.filter(i=>i!==a.id):[...r,a.id]),xa=a=>{let r=P.current,i=r?.querySelector('[role="option"]')?.getBoundingClientRect().height??0,l=r?.clientHeight??0;return Math.min(a,i>0&&l>0?Math.max(1,Math.floor(l/i)-1):Bt)};(0,u.useEffect)(()=>{K&&document.getElementById(K)?.scrollIntoView?.({block:"nearest"})},[K]);let De=a=>{if(!a)return;if("ask"in a){Ha(g,{pointed:{...y[0]!==void 0?{on:y[0]}:{},about:y},asked:a.ask}),s(i=>Ye(i)),N(!1);return}if("all"in a)return s(i=>ve(ee(i,!1),ge(a.all),{ownPicture:!0,...i.q?{carry:i.q}:{}})),de.current=a.all,N(!1),Be(a.all,`Opening ${G(o.schema,a.all)} matching \u201C${M.trim()}\u201D\u2026`);if(ne(a)){let i=a.act.subject;s(p=>$e(p,[i]));let l=R.current?.getBoundingClientRect();m({x:l?.left??0,y:(l?.bottom??0)+6,on:i}),N(!1),R.current?.blur();return}let r=a.hit;switch(r.about){case"node":s(i=>$e(Se(ee(i,!1),r.id),[r.id]));break;case"kind":return s(i=>ve(ee(i,!1),ge(r.kind),{ownPicture:!0})),de.current=r.kind,N(!1),Be(r.kind,`Opening ${r.label}\u2026`);case"place":return s(i=>Ra(i,r.kind,r.as)),de.current=r.kind,N(!1),Be(r.kind,`Opening ${r.title}\u2026`);case"rule":{let i=b.filter(l=>l.invariant===r.name).flatMap(l=>l.nodeIds);s(l=>$e(l,[...new Set(i)]));break}case"act":break}N(!1),R.current?.blur()},kt=c?Ot(c.byKind,c.hits,o.schema):"",ce=Le&&M.trim().length>0,St=(0,u.useCallback)(()=>{let a=R.current?.closest("[data-graview-app-bar]")?.getBoundingClientRect();if(a)return{x:a.right,y:a.bottom-Vt};let r=R.current?.getBoundingClientRect();return r?{x:r.right,y:r.bottom}:null},[]),ya=Ia("find",{open:ce,onOpenChange:a=>{a||N(!1)},...e?{at:St}:{}}),ye=$.every(a=>"ask"in a),ka=a=>ne(a)?Oe.filter(r=>r.of===a.of):[],$t=a=>{let r=ne(L)&&K!==null,i=r?$.find(p=>p.id===L.of):K!==null?He:void 0,l=i?$.indexOf(i):-1;if(a.key==="ArrowDown"){if(a.preventDefault(),N(!0),r){let p=ka(L),h=p.indexOf(L)+1;if(h<p.length)return te(p[h]);if(w)return}te($[Math.min($.length-1,l+1)])}else if(a.key==="ArrowUp"){if(a.preventDefault(),r){let p=ka(L),h=p.indexOf(L)-1;return te(h>=0?p[h]:i)}te($[Math.max(0,l-1)])}else if((a.key==="PageDown"||a.key==="PageUp")&&$.length>0){a.preventDefault(),N(!0);let p=a.key==="PageDown"?xa($.length):-xa($.length);te($[Math.min($.length-1,Math.max(0,(l<0?-1:l)+p))])}else if(a.key==="ArrowRight"&&!r&&ze(L)){let p=L,h=w?p.id===q?.id?se:F(p):xe.get(p.id)??F(p);if(h.length===0)return;a.preventDefault(),!w&&!Pe.includes(p.id)&&he(C=>[...C,p.id]),fe(p.id),oe(h[0].id)}else if(a.key==="ArrowLeft"&&r){a.preventDefault();let p=L.of;w||he(h=>h.filter(C=>C!==p)),te($.find(h=>h.id===p))}else a.key==="Enter"?(a.preventDefault(),De(L)):a.key==="Escape"&&(a.preventDefault(),M?s(p=>Ye(p)):R.current?.blur())},We=(a,r,i={},l={})=>{let p=a.id===L?.id;return(0,t.jsx)("div",{id:a.id,role:"option","aria-selected":p,onClick:()=>De(a),style:{...er,...p?ar:null,...i},...l,children:r},a.id)},Sa=(a,r)=>{let i=a.id===L?.id;return(0,t.jsx)("div",{id:a.id,role:"option","aria-selected":i,"data-testid":"find-act","data-about":"act",onClick:()=>De(a),style:{...r?nr:pt,...i?or:null,...a.act.destructive?{color:"var(--graview-warn)"}:null},children:a.act.title},a.id)};return(0,t.jsxs)("div",{style:{position:"relative",minWidth:0,flex:"1 1 auto"},"data-testid":"find",children:[(0,t.jsx)("input",{ref:a=>{R.current=a,ya.trigger.ref(a)},"data-graview-popover-trigger":"find",type:"search",role:"combobox","aria-label":"Find anything","aria-expanded":ce,"aria-controls":W,"aria-autocomplete":"list",...ce&&L?{"aria-activedescendant":L.id}:{},"data-testid":"find-box",placeholder:"Find\u2026","aria-keyshortcuts":"/ Meta+K Control+K",value:M,onChange:a=>{let r=a.target.value;N(!0),s(i=>ja(i,r.length>0?r:null))},onFocus:()=>N(!0),onBlur:()=>N(!1),onKeyDown:$t,style:{width:"100%",boxSizing:"border-box",minWidth:0,height:30,padding:"0 var(--graview-bar-find-end, 10px) 0 10px",font:"inherit",fontSize:"0.875rem",color:"var(--graview-ink)",background:"var(--graview-panel)",border:`1px solid ${M?"var(--graview-accent)":"var(--graview-edge)"}`,borderRadius:8}}),(0,t.jsx)("span",{role:"status","aria-live":"polite",style:qe,"data-testid":"find-count",children:M.trim()?kt:""}),(0,t.jsx)("span",{ref:z,tabIndex:-1,role:"status",style:qe,"data-testid":"find-landing"}),(0,t.jsxs)("div",{...ya.pane,id:W,role:"listbox","aria-label":M?`What \u201C${M}\u201D finds`:"What the words find","data-testid":"find-strip","data-graview-find":w?"panel":"narrow",hidden:!ce,onMouseDown:a=>a.preventDefault(),style:{..._t,...e?Yt:w&&!ye?Ut:null,...ce?{display:"flex"}:null},children:[(0,t.jsxs)("div",{style:{...jt,gridTemplateColumns:w&&!ye?`minmax(0, 1fr) ${Gt}`:"minmax(0, 1fr)"},children:[(0,t.jsxs)("div",{ref:P,role:"presentation","data-testid":"find-list",onMouseMove:ba,style:Qt,children:[ye?(0,t.jsxs)("p",{role:"presentation",style:{margin:0,padding:"10px 12px",color:"var(--graview-ink-muted)",fontSize:"0.875rem"},"data-testid":"find-nothing",children:["Nothing here is called \u201C",c?.words||M,"\u201D."]}):Ne.map(a=>(0,t.jsxs)("div",{role:"group","aria-label":st(a.key,o.schema),children:[(0,t.jsxs)("div",{role:"presentation",style:pa,children:[a.key!=="rule:"&&a.key!=="act:"?(0,t.jsx)(ct,{kind:a.key,accents:v?.accents}):null,(0,t.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:st(a.key,o.schema)}),(0,t.jsx)("span",{"aria-hidden":"true",style:Zt,"data-testid":"find-group-count",children:re(a.count)})]}),a.rows.map(r=>{let i=r.hit,l=i.about==="node"?i:null,p=!w&&l!==null&&bt.has(r.id),h=xe.get(r.id);return(0,t.jsxs)(u.Fragment,{children:[We(r,(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Nt,{hit:i,flag:k,words:l?.near&&l.why.matched?[...Ie,Ee(l.why.matched)]:Ie}),p?(0,t.jsx)("span",{"aria-hidden":"true","data-testid":"find-acts-open","data-open":h?"":void 0,title:h?"Put its actions away":"Actions",onClick:C=>{C.stopPropagation(),yt(r)},style:{...dr,...h?lr:null},children:(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"3.5",cy:"8",r:"1.4",fill:"currentColor"}),(0,t.jsx)("circle",{cx:"8",cy:"8",r:"1.4",fill:"currentColor"}),(0,t.jsx)("circle",{cx:"12.5",cy:"8",r:"1.4",fill:"currentColor"})]})}):null]}),p?{paddingRight:48}:{},{"data-testid":"find-hit","data-about":i.about,...l?.near?{"data-near":""}:{},title:Ht(i)}),h?(0,t.jsx)("div",{role:"group","aria-label":`What can be done about ${l?.label??"it"}`,style:sr,children:h.map(C=>Sa(C,!0))}):null]},r.id)}),a.more?We(a.more,(0,t.jsxs)("span",{style:Q,children:["All ",re(a.more.count)," ",ke(o.schema,a.more.all).toLowerCase()," matching \u201C",M.trim(),"\u201D"]}),tr,{"data-testid":"find-all","data-about":"all"}):null]},a.key)),ae?We(ae,(0,t.jsxs)("span",{style:Q,children:["Tell Graview: ",(0,t.jsxs)("span",{style:{fontWeight:600},children:["\u2018",ae.ask,"\u2019"]})]}),{borderTop:"1px solid var(--graview-edge)",marginTop:4},{"data-testid":"find-ask"}):null,fa>Dt?(0,t.jsxs)("p",{role:"presentation",style:dt,"data-testid":"find-more-words",children:[re(fa)," found: another word of the name narrows them."]}):null,c&&c.searched.past===!1&&c.searched.kinds.some(a=>o.schema.tryDefinition(a)?.lifecycle)?(0,t.jsx)("p",{role:"presentation",style:dt,children:"Current ones; add is:any for the past."}):null]}),w&&!ye&&q?(0,t.jsxs)("div",{role:"group","aria-label":"The one lit","data-testid":"find-panel",onMouseEnter:xt,onMouseMove:ba,style:Xt,children:[(0,t.jsx)(Pt,{row:q,schema:o.schema,accents:v?.accents,marking:Ie,q:M.trim(),flag:k}),se.length>0?(0,t.jsxs)("div",{role:"group","aria-label":"Actions",style:{display:"grid",gap:4},children:[(0,t.jsx)("div",{role:"presentation",style:{...pa,padding:"10px 0 4px"},children:"Actions"}),se.map(a=>Sa(a,!1))]}):null]}):null]}),e?null:(0,t.jsxs)("div",{"aria-hidden":"true",style:cr,"data-testid":"find-keys",children:[(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{style:me,children:"\u2191"}),(0,t.jsx)("kbd",{style:me,children:"\u2193"})," move"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{style:me,children:"\u21B5"})," open"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{style:me,children:"\u2192"})," actions"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{style:me,children:"esc"})," close"]})]})]})]})}function Pt({row:e,schema:o,accents:d,marking:s,q:n,flag:m}){let v=null,g="",y,S=null;if("ask"in e)g="Tell Graview",y=`\u2018${e.ask}\u2019`,S=(0,t.jsx)("p",{style:Y,children:"Says it to Graview about what is selected; the answer comes on a card beside it."});else if("all"in e)v=e.all,g=G(o,e.all),y=`All ${re(e.count)} matching \u201C${n}\u201D`,S=(0,t.jsxs)("p",{style:Y,children:["Opens the ",ke(o,e.all).toLowerCase(),", narrowed by these words."]});else{let c=e.hit;switch(c.about){case"node":{v=c.kind,g=ot(Ca(o.tryDefinition(c.kind),c.kind)),y=(0,t.jsxs)(t.Fragment,{children:[c.flagged?(0,t.jsxs)("span",{style:{color:"var(--graview-warn)"},children:[m," "]}):null,(0,t.jsx)(j,{text:c.label,words:s})]});let b=[c.apart,c.current?null:"past",c.archived?"set aside":null].filter(Boolean).join(" \xB7 ");S=(0,t.jsxs)(t.Fragment,{children:[b?(0,t.jsx)("p",{style:Y,children:ot(b)}):null,c.near?(0,t.jsxs)("p",{style:Y,children:["Near \u201C",c.why.asked,"\u201D",c.why.field!=="label"?` \u2014 ${c.why.reading.toLowerCase()}: ${c.why.fragment}`:""]}):c.why.field!=="label"?(0,t.jsxs)("p",{style:Y,children:[(0,t.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:c.why.reading}),(0,t.jsx)("br",{}),(0,t.jsx)(j,{text:c.why.fragment,words:s})]}):null]});break}case"kind":v=c.kind,g="Kind",y=c.label,S=(0,t.jsxs)("p",{style:Y,children:["Goes into the ",c.label.toLowerCase(),", all of them",c.count>0?`; ${re(c.count)} match these words`:"","."]});break;case"place":v=c.kind,g="Place",y=c.title,S=(0,t.jsxs)("p",{style:Y,children:["A picture of the ",ke(o,c.kind).toLowerCase(),"."]});break;case"rule":g="Rule",y=c.label,S=(0,t.jsx)("p",{style:Y,children:"Selects what it flags."});break;case"act":g="Act",y=c.title;break}}return(0,t.jsxs)("div",{role:"presentation","data-testid":"find-said",style:{display:"grid",gap:6},children:[(0,t.jsxs)("div",{style:{...pa,padding:0},children:[v?(0,t.jsx)(ct,{kind:v,accents:d}):null,g]}),(0,t.jsx)("div",{style:Jt,children:y}),S]})}function Nt({hit:e,flag:o,words:d}){switch(e.about){case"node":return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{style:rr,children:[e.flagged?(0,t.jsxs)("span",{style:{color:"var(--graview-warn)"},children:[o," "]}):null,(0,t.jsx)(j,{text:e.label,words:d}),e.apart?(0,t.jsxs)("span",{style:we,children:[" \xB7 ",e.apart]}):null,e.current?null:(0,t.jsx)("span",{style:we,children:" \xB7 past"})]}),e.near?(0,t.jsxs)("span",{style:{...Q,...we},"data-testid":"find-near",children:["Near \u201C",e.why.asked,"\u201D",e.why.field!=="label"?` \u2014 ${e.why.reading.toLowerCase()}: `:"",e.why.field!=="label"?(0,t.jsx)(j,{text:e.why.fragment,words:d}):null]}):e.why.field!=="label"?(0,t.jsxs)("span",{style:{...Q,...we},children:[e.why.reading.toLowerCase(),": ",(0,t.jsx)(j,{text:e.why.fragment,words:d})]}):null]});case"kind":return(0,t.jsxs)("span",{style:Q,children:[(0,t.jsx)(j,{text:e.label,words:d}),(0,t.jsxs)("span",{style:we,children:[" \xB7 ",e.count," match"]})]});case"place":return(0,t.jsxs)("span",{style:Q,children:["Go to ",(0,t.jsx)(j,{text:e.title,words:d})]});case"rule":return(0,t.jsxs)("span",{style:Q,children:["The rule \u201C",(0,t.jsx)(j,{text:e.label,words:d}),"\u201D"]});case"act":return(0,t.jsx)("span",{style:Q,children:e.title})}}function It(e,o){if(o.length===0)return[{text:e}];let d=[],s=0;for(let n of e.matchAll(/[\p{L}\p{N}]+/gu)){let m=n[0],v=Ee(m).replace(/ /g,""),g=o.filter(c=>v.startsWith(c)).sort((c,b)=>b.length-c.length)[0];if(!g)continue;let y=v.length===m.length?g.length:m.length,S=n.index??0;S>s&&d.push({text:e.slice(s,S)}),d.push({text:m.slice(0,y),marked:!0}),s=S+y}return s<e.length&&d.push({text:e.slice(s)}),d}function j({text:e,words:o}){return(0,t.jsx)(t.Fragment,{children:It(e,o).map((d,s)=>d.marked?(0,t.jsx)("mark",{style:ir,children:d.text},s):(0,t.jsx)(u.Fragment,{children:d.text},s))})}function Ht(e){if(e.about!=="node")return"";let o=e.near?`Near \u201C${e.why.asked}\u201D`:e.why.field!=="label"?`${e.why.reading}: ${e.why.fragment}`:"";return o?`${e.label}
|
|
1140
|
+
${o}`:e.label}var ot=e=>e&&e[0].toUpperCase()+e.slice(1);function ct({kind:e,accents:o}){let d=Math.round(Aa(e,o));return(0,t.jsx)("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:2,flex:"0 0 auto",background:`hsl(${d} 55% 52%)`}})}function st(e,o){return e==="rule:"?"Rules":e==="act:"?"Acts":G(o,e)}function Ot(e,o,d){let s=Object.entries(e).map(([v,g])=>$a(d,v,g)),n=o.filter(v=>v.about==="kind"||v.about==="place"||v.about==="rule").length;n>0&&s.push(`${n} ${n===1?"place or rule":"places and rules"}`);let m=o.filter(v=>v.about==="node"&&v.near).length;return s.length===0?"Nothing found":`${s.join(", ")} found${m>0?`, ${m} of them near`:""}`}var Bt=10,Dt=12,Wt=5,Kt=6,Ft=140,qt=760,Gt="15.5rem",_t={...Na,flexDirection:"column",width:"min(26rem, calc(100vw - 24px))",maxHeight:"min(64vh, 30rem)",overflow:"hidden",boxSizing:"border-box",background:"linear-gradient(var(--graview-panel), var(--graview-panel)) var(--graview-ground, var(--graview-panel))",borderTop:"1px solid var(--graview-edge)",borderRight:"1px solid var(--graview-edge)",borderBottom:"1px solid var(--graview-edge)",borderLeft:"1px solid var(--graview-edge)",borderRadius:10,boxShadow:"0 10px 28px rgb(0 0 0 / 0.18)",padding:0},Ut={width:"min(42rem, calc(100vw - 24px))"},Vt=6,Yt={width:"var(--graview-bar-width, 100vw)",maxHeight:"55vh",borderRadius:0,borderLeft:"none",borderRight:"none"},jt={display:"grid",gridTemplateRows:"minmax(0, 1fr)",flex:"1 1 auto",minHeight:0},Qt={overflowY:"auto",overflowX:"hidden",minHeight:0,padding:"4px 0",overscrollBehavior:"contain"},Xt={overflowY:"auto",minHeight:0,padding:"12px 14px",borderLeft:"1px solid var(--graview-edge)",background:"var(--graview-panel-muted)",display:"flex",flexDirection:"column",gap:4},Jt={fontWeight:600,fontSize:"0.9375rem",lineHeight:1.35,color:"var(--graview-ink)",overflowWrap:"anywhere"},Y={margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)",overflowWrap:"anywhere"},pa={display:"flex",alignItems:"center",gap:6,padding:"10px 12px 4px",fontSize:"0.6875rem",fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--graview-ink-muted)"},Zt={marginLeft:"auto",fontWeight:400,letterSpacing:0,fontVariantNumeric:"tabular-nums",color:"var(--graview-ink-faint)"},er={position:"relative",display:"grid",gap:1,minHeight:34,padding:"5px 12px",alignContent:"center",cursor:"pointer",fontSize:"0.875rem",lineHeight:1.35,color:"var(--graview-ink)",minWidth:0},ar={background:"color-mix(in srgb, var(--graview-accent) 12%, var(--graview-panel))",boxShadow:"inset 3px 0 0 var(--graview-accent)"},tr={color:"var(--graview-accent)",fontSize:"0.8125rem",minHeight:30},Q={display:"block",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},rr={display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:2,minWidth:0,overflow:"hidden",overflowWrap:"anywhere",fontWeight:600},we={color:"var(--graview-ink-muted)",fontSize:"0.8125rem",fontWeight:400},ir={background:"color-mix(in srgb, var(--graview-accent) 24%, transparent)",color:"inherit",borderRadius:2,padding:0,boxShadow:"0 1px 0 color-mix(in srgb, var(--graview-accent) 70%, transparent)"},pt={display:"flex",alignItems:"center",minHeight:32,padding:"4px 10px",boxSizing:"border-box",borderWidth:1,borderStyle:"solid",borderColor:"var(--graview-edge)",borderRadius:6,background:"var(--graview-panel)",color:"var(--graview-ink)",fontSize:"0.8125rem",lineHeight:1.3,cursor:"pointer",overflowWrap:"anywhere"},nr={...pt,minHeight:32,margin:"0 12px 4px 24px"},or={borderColor:"var(--graview-accent)",boxShadow:"inset 0 0 0 1px var(--graview-accent)",background:"color-mix(in srgb, var(--graview-accent) 12%, var(--graview-panel))"},sr={display:"grid",padding:"2px 0 6px"},dr={position:"absolute",top:"50%",right:6,transform:"translateY(-50%)",width:36,height:32,display:"grid",placeItems:"center",borderRadius:6,color:"var(--graview-ink-muted)",borderWidth:1,borderStyle:"solid",borderColor:"transparent"},lr={color:"var(--graview-accent)",borderColor:"var(--graview-edge)",background:"var(--graview-panel)"},dt={margin:0,padding:"6px 12px 4px",color:"var(--graview-ink-faint)",fontSize:"0.75rem"},cr={display:"flex",flexWrap:"wrap",gap:"4px 14px",padding:"7px 12px",borderTop:"1px solid var(--graview-edge)",color:"var(--graview-ink-faint)",fontSize:"0.75rem",flex:"0 0 auto"},me={display:"inline-block",minWidth:16,padding:"0 4px",marginRight:3,border:"1px solid var(--graview-edge)",borderRadius:4,font:"inherit",fontSize:"0.6875rem",lineHeight:"16px",textAlign:"center",color:"var(--graview-ink-muted)",background:"var(--graview-panel)"};var Me=f(_(),1),ga=f(Ct(),1);var vt=f(A(),1);function gt(){let{following:e,follow:o}=T();return e?(0,vt.jsxs)("button",{type:"button","data-testid":"following-who",onClick:()=>o(null),title:"Press, or Escape, to stop following",style:{display:"inline-flex",alignItems:"center",gap:6,minHeight:24,padding:"2px 9px",borderRadius:999,border:"1px solid var(--graview-accent)",background:"transparent",color:"var(--graview-accent)",fontSize:"0.875rem",whiteSpace:"nowrap"},children:["following ",e.name]}):null}var ut=f(_(),1);var E=f(A(),1);function wt({home:e,homeLabel:o,children:d,onPicture:s=!1}){let{view:n,focus:m,show:v,go:g}=U(),{store:y}=T(),{movedByHand:S}=T(),c=S&&(n.pan!==void 0||Object.keys(n.pins).length>0),b=n.focusId&&n.focusId!==e?y.graph.getNode(n.focusId):void 0,k=z=>G(y.schema,z),w={display:"inline-flex",alignItems:"center",gap:6,minHeight:26,padding:"2px 6px",fontSize:"0.8125rem",borderRadius:6,border:"1px solid transparent",boxShadow:"none",background:"transparent",color:"var(--graview-ink-muted)",whiteSpace:"nowrap"},R=o!==void 0&&b!==void 0,P=[];if(b&&!s&&P.push({key:"focused",node:(0,E.jsxs)("button",{type:"button","data-testid":"focused",onClick:()=>g(Fe({...n,focusId:e},!1)),title:Ge(y,b.id),style:{...w,maxWidth:"min(14rem, 15vw)"},children:[(0,E.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:Ge(y,b.id)}),(0,E.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),n.past&&P.push({key:"past",node:(0,E.jsxs)("button",{type:"button","data-testid":"past",onClick:()=>g(Qa(n,!1)),title:"Back to now \u2014 retired things leave the picture again",style:w,children:["the past",(0,E.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),n.zoom&&P.push({key:"zoomed",node:(0,E.jsxs)("button",{type:"button","data-testid":"zoomed",onClick:()=>g(Fe(n,!1)),title:"Zoom back out",style:w,children:["zoomed in",(0,E.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),c&&P.push({key:"moved",node:(0,E.jsx)("button",{type:"button","data-testid":"moved",onClick:()=>g(Ke(n)),title:"Put the camera and everything you dragged back where the layout wanted them",style:w,children:"Reset view"})}),n.relation){let z=n.relation;P.push({key:"raised",node:(0,E.jsxs)("span",{style:{display:"inline-flex",alignItems:"center"},children:[(0,E.jsxs)("button",{type:"button","data-testid":"raised-into",onClick:()=>g(ve(n,ge(z),{ownPicture:!0})),title:`Go into the ${k(z).toLowerCase()}`,"aria-label":`Go into the ${k(z).toLowerCase()}`,style:{...w,color:"var(--graview-ink)"},children:[k(z),(0,E.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\u2198"})]}),(0,E.jsx)("button",{type:"button","data-testid":"raised",onClick:()=>v(null),title:`Stop showing ${k(z).toLowerCase()}`,"aria-label":`Stop showing ${k(z).toLowerCase()}`,style:{...w,minWidth:26,justifyContent:"center"},children:(0,E.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})})]})})}return s&&!R&&P.length===0&&d===void 0?null:(0,E.jsxs)("nav",{"aria-label":"View","data-testid":"trail",style:{display:"flex",alignItems:"center",gap:8,fontSize:"0.875rem",minWidth:0,...s?{pointerEvents:"auto",padding:"4px 6px",borderRadius:8,background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)",overflow:"hidden"}:{}},children:[R?(0,E.jsx)("button",{type:"button",onClick:()=>m(e),style:{border:"none",background:"none",padding:"3px 0",minHeight:24,whiteSpace:"nowrap",color:"var(--graview-ink-muted)"},children:o}):null,P.map(({key:z,node:W},Le)=>(0,E.jsxs)(ut.Fragment,{children:[R||Le>0?(0,E.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:"\u203A"}):null,W]},z)),d]})}var O=f(A(),1);function va(){let[e,o]=(0,Me.useState)([]),d=(0,Me.useCallback)(s=>{o(n=>{let m=s.phase!=="running"&&n[0]?.name===s.name&&n[0]?.at===s.at;return[s,...m?n.slice(1):n].slice(0,12)})},[]);return[e,d]}function ua({find:e,calls:o,seat:d,remembers:s=!1}){return e?(0,O.jsxs)(O.Fragment,{children:[(0,ga.createPortal)((0,O.jsx)(lt,{compact:e.compact}),e.slot),e.own?(0,ga.createPortal)((0,O.jsx)(Ka,{calls:o,remembers:s,...d!==void 0?{seat:d}:{}}),e.own):null]}):null}function wa({home:e=null}){return(0,O.jsxs)("div",{"data-graview-scene-trail":"",style:{position:"absolute",top:14,left:14,maxWidth:"calc(100% - 150px - var(--graview-dock, 0px))",zIndex:B("overview"),display:"flex",alignItems:"center",gap:6,minWidth:0,pointerEvents:"none"},children:[(0,O.jsx)(wt,{home:e,onPicture:!0}),(0,O.jsx)("span",{style:{pointerEvents:"auto"},children:(0,O.jsx)(gt,{})})]})}var X=f(_(),1);var mt=f(A(),1),pr=ie(()=>(__graviewPreload(import.meta.url,["./chunk.Q355UPFG.js","./chunk.GH6QX7JR.js","./chunk.J4D4BIB4.js","./chunk.ASNVH2G4.js","./chunk.SDO3U72B.js","./chunk.ZDUKVXBI.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.HQRPOGTS.js")));function ma(){let{store:e,principal:o}=T(),d=(0,X.useContext)(Fa),s=(0,X.useRef)(null),n=(0,X.useRef)(!1);return(0,X.useEffect)(()=>()=>void(n.current=!0),[]),(0,X.useEffect)(()=>{let m=e.batches().length,v=pr().then(g=>g.sceneWay(e,o,d,m,s.current),()=>{});return()=>void v.then(g=>g?.(n.current))},[e,o,d]),(0,mt.jsx)("span",{ref:s,hidden:!0})}var ft=f(_(),1);var x=f(A(),1);function _i({address:e=!1,auto:o,quickAsk:d=!0,scheme:s,scope:n}){let m=(0,ft.useMemo)(()=>`${ia({scope:`.${n}`})}
|
|
1141
1141
|
${na(s,{scope:`.${n}`})}`,[s,n]),v=qa(),[g]=va();return(0,x.jsx)(La.Provider,{value:!0,children:(0,x.jsxs)("div",{"data-embed-content":"",style:{position:"relative",flex:o?`0 0 ${tt}px`:"1 1 auto",minHeight:0,containerType:"size"},children:[(0,x.jsx)("style",{children:m}),e?(0,x.jsx)(at,{}):null,(0,x.jsx)(et,{}),(0,x.jsx)(wa,{}),(0,x.jsx)(da,{}),(0,x.jsx)(oa,{}),(0,x.jsxs)(Ja,{children:[(0,x.jsx)(Xe,{}),(0,x.jsx)(Je,{face:"scene",on:d}),(0,x.jsx)(sa,{}),(0,x.jsx)(Ue,{children:(0,x.jsx)(je,{children:(0,x.jsx)(Ze,{children:(0,x.jsx)(aa,{children:(0,x.jsx)(ta,{children:(0,x.jsx)(Qe,{placement:"menu"})})})})})}),(0,x.jsx)(Ve,{}),(0,x.jsx)(ra,{}),(0,x.jsx)(ea,{}),(0,x.jsx)(ua,{find:v,calls:g}),(0,x.jsx)(ma,{}),(0,x.jsx)(_e,{face:"scene"})]})]})})}function Ui(){return(0,x.jsx)(ca,{})}export{_i as SceneFace,Ui as SceneKeeping};
|