graview 0.1.46 → 0.1.48
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.OHSJQYJN.js → chunk.2GLJH253.js} +1 -1
- package/dist/preview/{chunk.UR3XYOQ6.js → chunk.2QNGGF55.js} +1 -1
- package/dist/preview/{chunk.XSNAG4JT.js → chunk.2UIUMG23.js} +3 -3
- package/dist/preview/{chunk.R4OU7O6C.js → chunk.2VTMTW7K.js} +1 -1
- package/dist/preview/chunk.37CJSWLL.js +1 -0
- package/dist/preview/{chunk.RZXPBOGT.js → chunk.3BAHAK6W.js} +1 -1
- package/dist/preview/{chunk.RTI3FEDD.js → chunk.3RP3N2JP.js} +1 -1
- package/dist/preview/{chunk.IJABD7SI.js → chunk.3UD7GG5B.js} +1 -1
- package/dist/preview/{chunk.BFKV4GKP.js → chunk.44G5A53D.js} +1 -1
- package/dist/preview/chunk.4GQA3AJU.js +1 -0
- package/dist/preview/{chunk.F5PBK4TF.js → chunk.4KX53HCV.js} +2 -2
- package/dist/preview/chunk.4TJOS4C7.js +5 -0
- package/dist/preview/{chunk.EPUBSKKL.js → chunk.4VW6THJF.js} +1 -1
- package/dist/preview/{chunk.3OSGN463.js → chunk.5IM645XQ.js} +1 -1
- package/dist/preview/{chunk.NGIPVTTE.js → chunk.5IPH2SCE.js} +1 -1
- package/dist/preview/{chunk.TBQOSI4J.js → chunk.5Y3Q7ONN.js} +1 -1
- package/dist/preview/chunk.664PBQAQ.js +1 -0
- package/dist/preview/chunk.6TKILWRM.js +1 -0
- package/dist/preview/{chunk.JLEC3USG.js → chunk.6VAFNCR4.js} +1 -1
- package/dist/preview/chunk.72OZLWJL.js +1 -0
- package/dist/preview/chunk.72W6S746.js +1 -0
- package/dist/preview/{chunk.VDVJCLGS.js → chunk.76W2FXEC.js} +1 -1
- package/dist/preview/{chunk.64WM4IBI.js → chunk.7FRPNQU4.js} +1 -1
- package/dist/preview/chunk.7LL7OSBY.js +6 -0
- package/dist/preview/chunk.7QZYFLBS.js +1 -0
- package/dist/preview/{chunk.6RY6OSE6.js → chunk.7VT3TRHR.js} +1 -1
- package/dist/preview/chunk.B2IIEVBF.js +21 -0
- package/dist/preview/{chunk.5ESCD57M.js → chunk.BDHKWVNX.js} +1 -1
- package/dist/preview/{chunk.X25KXCWI.js → chunk.CH5ROV7N.js} +1 -1
- package/dist/preview/{chunk.EAJB2PJZ.js → chunk.CJ23XTSW.js} +1 -1
- package/dist/preview/{chunk.VAFSSSSI.js → chunk.D5ETRTAF.js} +1 -1
- package/dist/preview/{chunk.6OPI4WWO.js → chunk.DAUC2DFY.js} +1 -1
- package/dist/preview/{chunk.63JLXGYX.js → chunk.DFK2NA6L.js} +1 -1
- package/dist/preview/chunk.DHAK6PPX.js +3 -0
- package/dist/preview/{chunk.NMIXBH37.js → chunk.DOBQ4LO4.js} +1 -1
- package/dist/preview/{chunk.H7KCWCB4.js → chunk.DPHTUTOS.js} +1 -1
- package/dist/preview/chunk.DQ7M3LFV.js +1 -0
- package/dist/preview/{chunk.Y5ARSVH4.js → chunk.DUWYF7BO.js} +1 -1
- package/dist/preview/{chunk.3MMLRSRC.js → chunk.DWPU56S5.js} +1 -1
- package/dist/preview/{chunk.WBHM5I3I.js → chunk.E5GM2SMO.js} +1 -1
- package/dist/preview/{chunk.UOXFALRL.js → chunk.EMQ5POGB.js} +1 -1
- package/dist/preview/{chunk.TOZJZXWQ.js → chunk.ENPCLMP2.js} +1 -1
- package/dist/preview/{chunk.XXEYRHRG.js → chunk.ETR6AV47.js} +1 -1
- package/dist/preview/chunk.EXEZBZGW.js +1 -0
- package/dist/preview/{chunk.O24DD2VF.js → chunk.EZJNUFNQ.js} +1 -1
- package/dist/preview/{chunk.S5MQVPLF.js → chunk.FOP5RBGF.js} +1 -1
- package/dist/preview/chunk.FPYL6REZ.js +1 -0
- package/dist/preview/chunk.FQYOTK34.js +1 -0
- package/dist/preview/chunk.G446PWV6.js +1 -0
- package/dist/preview/chunk.G7WDMUDV.js +1 -0
- package/dist/preview/{chunk.NIVTK2W5.js → chunk.GACKGEUY.js} +1 -1
- package/dist/preview/chunk.GH2SWMCW.js +1 -0
- package/dist/preview/chunk.GNBN3BK7.js +1 -0
- package/dist/preview/{chunk.4KNEBLB7.js → chunk.GT3F6FQ6.js} +1 -1
- package/dist/preview/chunk.GTPC6JOW.js +2 -0
- package/dist/preview/{chunk.DEUTHHGI.js → chunk.GUMJEVVP.js} +1 -1
- package/dist/preview/chunk.GVNYPFIM.js +1 -0
- package/dist/preview/{chunk.I3GP5JW7.js → chunk.HC5N3CT2.js} +1 -1
- package/dist/preview/{chunk.RNBPDB37.js → chunk.HDE2MGGU.js} +1 -1
- package/dist/preview/{chunk.6YD2DLIC.js → chunk.HG4DDNPG.js} +1 -1
- package/dist/preview/{chunk.A5VGTO3E.js → chunk.HKA5T7DL.js} +1 -1
- package/dist/preview/{chunk.55D33E5A.js → chunk.I5TOMBIF.js} +1 -1
- package/dist/preview/{chunk.JF3GD4H5.js → chunk.I7QIHN66.js} +1 -1
- package/dist/preview/chunk.ILZYRJDS.js +1 -0
- package/dist/preview/{chunk.LETJC5TD.js → chunk.IRHSTUZM.js} +1 -1
- package/dist/preview/{chunk.JLYNMAME.js → chunk.J2V76Z6G.js} +1 -1
- package/dist/preview/{chunk.3VFYSXMQ.js → chunk.J6ANRF6E.js} +1 -1
- package/dist/preview/chunk.KA44WNB4.js +25 -0
- package/dist/preview/chunk.KTFUVR4V.js +2 -0
- package/dist/preview/{chunk.BNPQUI3F.js → chunk.KVEDIBXS.js} +1 -1
- package/dist/preview/chunk.KVJFY7N5.js +2 -0
- package/dist/preview/{chunk.SS27NH5O.js → chunk.KW65F4WA.js} +1 -1
- package/dist/preview/chunk.LGSFGNWE.js +1 -0
- package/dist/preview/{chunk.UVNVDLV5.js → chunk.LNON6P7K.js} +1 -1
- package/dist/preview/{chunk.R2AG4NHQ.js → chunk.LPD74WBI.js} +1 -1
- package/dist/preview/chunk.LXCJVZF3.js +1 -0
- package/dist/preview/{chunk.Q7RQC3F7.js → chunk.MAFFUPCR.js} +1 -1
- package/dist/preview/chunk.MTXEURFE.js +1 -0
- package/dist/preview/{chunk.PLWVLW22.js → chunk.MVRG75ZD.js} +1 -1
- package/dist/preview/{chunk.GEPNIMXW.js → chunk.MVSV7T6E.js} +1 -1
- package/dist/preview/{chunk.W45NKVSV.js → chunk.MZLWLIKR.js} +1 -1
- package/dist/preview/chunk.N4M54YK6.js +1 -0
- package/dist/preview/{chunk.KSXB4LDF.js → chunk.NB6WN4DO.js} +1 -1
- package/dist/preview/{chunk.UHX4WTM7.js → chunk.NFDLCUCC.js} +1 -1
- package/dist/preview/{chunk.AGIO2GRV.js → chunk.NLBIX7LH.js} +1 -1
- package/dist/preview/{chunk.VC3BX2ZF.js → chunk.NQZ73QV7.js} +1 -1
- package/dist/preview/chunk.NR5ODXMO.js +1 -0
- package/dist/preview/{chunk.M5GJHVWZ.js → chunk.NTLHEHOM.js} +1 -1
- package/dist/preview/{chunk.TFVFJFXC.js → chunk.NWT5FPEK.js} +3 -3
- package/dist/preview/chunk.NX7IIZLO.js +1 -0
- package/dist/preview/{chunk.UKAPFIPJ.js → chunk.O45VO36H.js} +1 -1
- package/dist/preview/{chunk.LUNATPAB.js → chunk.OAIWGWGU.js} +2 -2
- package/dist/preview/{chunk.PC6PID5X.js → chunk.ODRL5OWR.js} +1 -1
- package/dist/preview/{chunk.L2PI7V4R.js → chunk.OFRGDJYX.js} +1 -1
- package/dist/preview/chunk.OVO6L5IP.js +88 -0
- package/dist/preview/{chunk.LKN734RR.js → chunk.OZGETOTK.js} +1 -1
- package/dist/preview/{chunk.4HYJHGI4.js → chunk.P6FQAILU.js} +1 -1
- package/dist/preview/chunk.PCEYZQAW.js +1 -0
- package/dist/preview/{chunk.ONEYVLC2.js → chunk.PMJUGHW4.js} +1 -1
- package/dist/preview/{chunk.RNEJYIQ7.js → chunk.PPRSGM64.js} +1 -1
- package/dist/preview/chunk.PQVUQVRL.js +1 -0
- package/dist/preview/{chunk.LVEFQLGQ.js → chunk.PTXLOFQW.js} +1 -1
- package/dist/preview/{chunk.VBPK6ARF.js → chunk.PVEPU6EA.js} +1 -1
- package/dist/preview/chunk.QGE6YKSU.js +1 -0
- package/dist/preview/{chunk.Z6TMIAAB.js → chunk.QII2C5OV.js} +1 -1
- package/dist/preview/chunk.QO7MDWID.js +1 -0
- package/dist/preview/{chunk.S6WHA4CW.js → chunk.QPICKSSM.js} +1 -1
- package/dist/preview/{chunk.KRGM25HF.js → chunk.QQCDCRR2.js} +1 -1
- package/dist/preview/chunk.QQTRAY5W.js +1 -0
- package/dist/preview/{chunk.SL2FZ54V.js → chunk.RLXKDXPB.js} +1 -1
- package/dist/preview/{chunk.6MADC6DM.js → chunk.RQBEQYB2.js} +1 -1
- package/dist/preview/chunk.SA34Y3X5.js +2 -0
- package/dist/preview/chunk.SAHNXAV3.js +1 -0
- package/dist/preview/{chunk.UNCS63AM.js → chunk.SFAAM4KE.js} +1 -1
- package/dist/preview/{chunk.N7VNEUJR.js → chunk.SKJJBLXF.js} +1 -1
- package/dist/preview/chunk.SUPWMV2F.js +1 -0
- package/dist/preview/{chunk.ITYQUSZI.js → chunk.TBRJOKIK.js} +1 -1
- package/dist/preview/{chunk.JLIUUFK2.js → chunk.TKMQROXF.js} +1 -1
- package/dist/preview/chunk.TMDI7KRS.js +18 -0
- package/dist/preview/chunk.TPG6IY4M.js +1 -0
- package/dist/preview/{chunk.PKUDIWIF.js → chunk.UGJSMNVO.js} +1 -1
- package/dist/preview/{chunk.6QYJ2K6K.js → chunk.UJRBOUGC.js} +1 -1
- package/dist/preview/chunk.V2GSBYDK.js +4 -0
- package/dist/preview/chunk.V3N34DSU.js +1 -0
- package/dist/preview/{chunk.JT3IZIU5.js → chunk.V4BCB7N2.js} +1 -1
- package/dist/preview/{chunk.6SOUQNXR.js → chunk.VQAQQW4Q.js} +1 -1
- package/dist/preview/{chunk.CICGAEBW.js → chunk.W72TTRLX.js} +2 -2
- package/dist/preview/chunk.X5G7FOPY.js +12 -0
- package/dist/preview/{chunk.IKX4VDTW.js → chunk.X7JMJSLU.js} +1 -1
- package/dist/preview/{chunk.WP5W44Y4.js → chunk.X7N3JUO4.js} +2 -2
- package/dist/preview/chunk.XOZU4OFA.js +1 -0
- package/dist/preview/{chunk.JBW3DI7E.js → chunk.XTMOFRHL.js} +1 -1
- package/dist/preview/{chunk.WQONZBA3.js → chunk.Y4MQGEUS.js} +2 -2
- package/dist/preview/{chunk.BCWPV4WR.js → chunk.YDL5BSTG.js} +1 -1
- package/dist/preview/chunk.YEVA72L2.js +1 -0
- package/dist/preview/chunk.YLWON7X3.js +1 -0
- package/dist/preview/chunk.YUH43J2K.js +1 -0
- package/dist/preview/{chunk.Z5IGHCZX.js → chunk.YVOABA2U.js} +1 -1
- package/dist/preview/{chunk.5R2R364Q.js → chunk.Z4UM4CMT.js} +1 -1
- package/dist/preview/{chunk.DQOCBKC3.js → chunk.ZH4NWRWB.js} +1 -1
- package/dist/preview/chunk.ZXZNAG35.js +1 -0
- package/dist/preview/index.html +50 -49
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.2JJYGYT2.js +0 -1
- package/dist/preview/chunk.4OGOTHRD.js +0 -1
- package/dist/preview/chunk.4RJZVTW7.js +0 -6
- package/dist/preview/chunk.4Y6VGQVQ.js +0 -1
- package/dist/preview/chunk.5K6KX3UC.js +0 -1
- package/dist/preview/chunk.6BDM2XRX.js +0 -1
- package/dist/preview/chunk.6UIW664O.js +0 -6
- package/dist/preview/chunk.6WA6ASQB.js +0 -1
- package/dist/preview/chunk.AQQZY6OY.js +0 -3
- package/dist/preview/chunk.AS4CQBOQ.js +0 -5
- package/dist/preview/chunk.ATDU5Y7V.js +0 -1
- package/dist/preview/chunk.AYA7SYIU.js +0 -1
- package/dist/preview/chunk.BAMPYMUE.js +0 -88
- package/dist/preview/chunk.DX357TZ3.js +0 -2
- package/dist/preview/chunk.F37DHXA2.js +0 -1
- package/dist/preview/chunk.FGR7KCI6.js +0 -1
- package/dist/preview/chunk.FO5BOBYV.js +0 -1
- package/dist/preview/chunk.FVOJCVRX.js +0 -1
- package/dist/preview/chunk.FXTBMW3S.js +0 -1
- package/dist/preview/chunk.GVY5UQTJ.js +0 -1
- package/dist/preview/chunk.HBD7FBZS.js +0 -1
- package/dist/preview/chunk.HDRD33II.js +0 -1
- package/dist/preview/chunk.HZCA3UWJ.js +0 -1
- package/dist/preview/chunk.IW7YFPGG.js +0 -1
- package/dist/preview/chunk.JHIUG25Q.js +0 -1
- package/dist/preview/chunk.JNIGZEOF.js +0 -1
- package/dist/preview/chunk.JQLR6KO2.js +0 -1
- package/dist/preview/chunk.KWQ7QOHD.js +0 -2
- package/dist/preview/chunk.LKVXSC5O.js +0 -2
- package/dist/preview/chunk.MWONSI3P.js +0 -1
- package/dist/preview/chunk.NITU5H4J.js +0 -1
- package/dist/preview/chunk.NWA7Q6CI.js +0 -1
- package/dist/preview/chunk.P4O5DGLN.js +0 -1
- package/dist/preview/chunk.QGVLJTZS.js +0 -1
- package/dist/preview/chunk.T7O6K3IN.js +0 -1
- package/dist/preview/chunk.UPQZU7UO.js +0 -21
- package/dist/preview/chunk.URO2EGY7.js +0 -1
- package/dist/preview/chunk.V3QUTJR2.js +0 -2
- package/dist/preview/chunk.V5Z2OED6.js +0 -1
- package/dist/preview/chunk.VW2VCPJX.js +0 -1
- package/dist/preview/chunk.WAB7UDHU.js +0 -1
- package/dist/preview/chunk.WM2LWHTJ.js +0 -1
- package/dist/preview/chunk.WO3DDFFY.js +0 -1
- package/dist/preview/chunk.WSTBCWW7.js +0 -4
- package/dist/preview/chunk.X233NILF.js +0 -1
- package/dist/preview/chunk.XWAMQPUM.js +0 -25
- package/dist/preview/chunk.XXDBZQNY.js +0 -18
- package/dist/preview/chunk.ZIEHF67C.js +0 -1
- package/dist/preview/chunk.ZTIF23VF.js +0 -1
|
@@ -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 Ke}from"./chunk.SDO3U72B.js";import{Ga as jn,Ic as Bn,J as Nn,Ka as St,Lc as qn,Ma as Wn,Qc as zn,Xa as Gn,ac as Fn,dd as $n,td as Un,xc as Kn,yd as Fe,zd as wt}from"./chunk.4TJOS4C7.js";import{a as Ge,b as _}from"./chunk.AJZBJBMO.js";var yo=Ge(w=>{"use strict";var Rt=Symbol.for("react.transitional.element"),Nr=Symbol.for("react.portal"),jr=Symbol.for("react.fragment"),Wr=Symbol.for("react.strict_mode"),Gr=Symbol.for("react.profiler"),Fr=Symbol.for("react.consumer"),Kr=Symbol.for("react.context"),Br=Symbol.for("react.forward_ref"),qr=Symbol.for("react.suspense"),zr=Symbol.for("react.memo"),so=Symbol.for("react.lazy"),$r=Symbol.for("react.activity"),oo=Symbol.iterator;function Ur(e){return e===null||typeof e!="object"?null:(e=oo&&e[oo]||e["@@iterator"],typeof e=="function"?e:null)}var lo={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},uo=Object.assign,co={};function ge(e,t,n){this.props=e,this.context=t,this.refs=co,this.updater=n||lo}ge.prototype.isReactComponent={};ge.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")};ge.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function fo(){}fo.prototype=ge.prototype;function Tt(e,t,n){this.props=e,this.context=t,this.refs=co,this.updater=n||lo}var Mt=Tt.prototype=new fo;Mt.constructor=Tt;uo(Mt,ge.prototype);Mt.isPureReactComponent=!0;var ro=Array.isArray;function kt(){}var O={H:null,A:null,T:null,S:null},po=Object.prototype.hasOwnProperty;function Ot(e,t,n){var o=n.ref;return{$$typeof:Rt,type:e,key:t,ref:o!==void 0?o:null,props:n}}function Yr(e,t){return Ot(e.type,t,e.props)}function Vt(e){return typeof e=="object"&&e!==null&&e.$$typeof===Rt}function Zr(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var io=/\/+/g;function At(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Zr(""+e.key):t.toString(36)}function Xr(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(kt,kt):(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 me(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 Rt:case Nr:a=!0;break;case so:return a=e._init,me(a(e._payload),t,n,o,r)}}if(a)return r=r(e),a=o===""?"."+At(e,0):o,ro(r)?(n="",a!=null&&(n=a.replace(io,"$&/")+"/"),me(r,t,n,"",function(u){return u})):r!=null&&(Vt(r)&&(r=Yr(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(io,"$&/")+"/")+a)),t.push(r)),1;a=0;var l=o===""?".":o+":";if(ro(e))for(var s=0;s<e.length;s++)o=e[s],i=l+At(o,s),a+=me(o,t,n,i,r);else if(s=Ur(e),typeof s=="function")for(e=s.call(e),s=0;!(o=e.next()).done;)o=o.value,i=l+At(o,s++),a+=me(o,t,n,i,r);else if(i==="object"){if(typeof e.then=="function")return me(Xr(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 Xe(e,t,n){if(e==null)return e;var o=[],r=0;return me(e,o,"","",function(i){return t.call(n,i,r++)}),o}function Jr(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 ao=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)},Qr={map:Xe,forEach:function(e,t,n){Xe(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Xe(e,function(){t++}),t},toArray:function(e){return Xe(e,function(t){return t})||[]},only:function(e){if(!Vt(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};w.Activity=$r;w.Children=Qr;w.Component=ge;w.Fragment=jr;w.Profiler=Gr;w.PureComponent=Tt;w.StrictMode=Wr;w.Suspense=qr;w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O;w.__COMPILER_RUNTIME={__proto__:null,c:function(e){return O.H.useMemoCache(e)}};w.cache=function(e){return function(){return e.apply(null,arguments)}};w.cacheSignal=function(){return null};w.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)!po.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),l=0;l<i;l++)a[l]=arguments[l+2];o.children=a}return Ot(e.type,r,o)};w.createContext=function(e){return e={$$typeof:Kr,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:Fr,_context:e},e};w.createElement=function(e,t,n){var o,r={},i=null;if(t!=null)for(o in t.key!==void 0&&(i=""+t.key),t)po.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 l=Array(a),s=0;s<a;s++)l[s]=arguments[s+2];r.children=l}if(e&&e.defaultProps)for(o in a=e.defaultProps,a)r[o]===void 0&&(r[o]=a[o]);return Ot(e,i,r)};w.createRef=function(){return{current:null}};w.forwardRef=function(e){return{$$typeof:Br,render:e}};w.isValidElement=Vt;w.lazy=function(e){return{$$typeof:so,_payload:{_status:-1,_result:e},_init:Jr}};w.memo=function(e,t){return{$$typeof:zr,type:e,compare:t===void 0?null:t}};w.startTransition=function(e){var t=O.T,n={};O.T=n;try{var o=e(),r=O.S;r!==null&&r(n,o),typeof o=="object"&&o!==null&&typeof o.then=="function"&&o.then(kt,ao)}catch(i){ao(i)}finally{t!==null&&n.types!==null&&(t.types=n.types),O.T=t}};w.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()};w.use=function(e){return O.H.use(e)};w.useActionState=function(e,t,n){return O.H.useActionState(e,t,n)};w.useCallback=function(e,t){return O.H.useCallback(e,t)};w.useContext=function(e){return O.H.useContext(e)};w.useDebugValue=function(){};w.useDeferredValue=function(e,t){return O.H.useDeferredValue(e,t)};w.useEffect=function(e,t){return O.H.useEffect(e,t)};w.useEffectEvent=function(e){return O.H.useEffectEvent(e)};w.useId=function(){return O.H.useId()};w.useImperativeHandle=function(e,t,n){return O.H.useImperativeHandle(e,t,n)};w.useInsertionEffect=function(e,t){return O.H.useInsertionEffect(e,t)};w.useLayoutEffect=function(e,t){return O.H.useLayoutEffect(e,t)};w.useMemo=function(e,t){return O.H.useMemo(e,t)};w.useOptimistic=function(e,t){return O.H.useOptimistic(e,t)};w.useReducer=function(e,t,n){return O.H.useReducer(e,t,n)};w.useRef=function(e){return O.H.useRef(e)};w.useState=function(e){return O.H.useState(e)};w.useSyncExternalStore=function(e,t,n){return O.H.useSyncExternalStore(e,t,n)};w.useTransition=function(){return O.H.useTransition()};w.version="19.2.8"});var j=Ge((Na,mo)=>{"use strict";mo.exports=yo()});var Po=Ge(et=>{"use strict";var ui=Symbol.for("react.transitional.element"),ci=Symbol.for("react.fragment");function Eo(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:ui,type:e,key:o,ref:t!==void 0?t:null,props:n}}et.Fragment=ci;et.jsx=Eo;et.jsxs=Eo});var Ie=Ge((za,Ao)=>{"use strict";Ao.exports=Po()});var fe={focusId:null,relation:null,expanded:[],pins:{}},Be=e=>{let t=Number(e);return Number.isFinite(t)?t:null};function te(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}`,`${qe(r.x)},${qe(r.y)}`)}e.pan&&(e.pan.x!==0||e.pan.y!==0)&&t.set("pan",`${qe(e.pan.x)},${qe(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 Cr(e){return e&&e.startsWith("agg:")?`aggregate:${e.slice(4)}`:e}function ze(e){let t=e.includes("#")?e.slice(e.indexOf("#")+1):e,n=new URLSearchParams(t),o=Object.create(null);for(let[m,p]of n){if(!m.startsWith("pin."))continue;let[g,v]=p.split(","),T=g===void 0?null:Be(g),y=v===void 0?null:Be(v);T===null||y===null||(o[m.slice(4)]={x:T,y})}let r=Object.create(null);for(let[m,p]of n)!m.startsWith("in.")||p.length===0||(r[m.slice(3)]=p);let i=n.get("view");i&&i.length>0&&r.view===void 0&&(r.view=i);let a=n.get("pan")?.split(",")??[],l=a[0]===void 0?null:Be(a[0]),s=a[1]===void 0?null:Be(a[1]),u=(n.get("sel")??"").split(",").filter(m=>m.length>0).sort(),f=n.get("overview")==="1";return{...u.length>0?{selection:u}:{},...f?{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()}:{},...l!==null&&s!==null?{pan:{x:l,y:s}}:{},...Object.keys(r).length>0?{within:r}:{},...n.get("q")?.trim()?{q:n.get("q")}:{},focusId:Cr(n.get("focus")),relation:n.get("relation"),expanded:(n.get("expand")??"").split(",").filter(m=>m.length>0&&(f||!m.startsWith("kind:"))).sort(),pins:o}}function ba(e){let t=ze(e);return te(t)==="#"?{...t,overview:!0}:t}function xa(e){let t=te(e);return t==="#overview=1"?"":t}function qe(e){return Math.round(e*100)/100}function Zn(e,t){return te(e)===te(t)}var Yn="edge:";function Xn(e){if(!e.startsWith(Yn))return null;let t=e.slice(Yn.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 vt(e){let{pan:t,...n}=e;return{...n,pins:{}}}function q(e,t){if(t===e.focusId)return{...e,focusId:t};let n=vt(e);return{...n.within?.q!==void 0?ae(n,"q",null):n,focusId:t}}function Jn(e,t){return{...e,relation:t}}function ae(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 pe(e,t){if(t!==e.overview&&(e=vt(e)),!t){let n=e.expanded.filter(o=>!o.startsWith("kind:"));return{...e,overview:!1,expanded:n}}return{...e,overview:t}}function $e(e,t){if(t.length===0){let{selection:n,...o}=e;return o}return{...e,selection:[...t]}}function Ve(e,t){if(t!==(e.zoom===!0)&&(e=vt(e)),!t){let{zoom:n,...o}=e;return o}return{...e,zoom:!0}}function Ue(e,t){let n=new Set(e.expanded);return n.has(t)?n.delete(t):n.add(t),{...e,expanded:[...n].sort()}}var Ze="aggregate:",Ye="kind:";function bt(e){return`${Ye}${e}`}function ye(e){return e.startsWith(Ye)?e.slice(Ye.length):null}var Aa="kinds:beyond";function Ir(e){let t=ye(e);return t?[t]:se(e)}function ne(...e){return`${Ze}${[...e].sort().join("+")}`}function Qn(e){return e.startsWith(Ze)}function se(e){return!Qn(e)||e.includes("|")?[]:e.slice(Ze.length).split("+").filter(Boolean)}function eo(e,t,n={}){let o=ye(t);if(o!==null&&e.overview&&n.ownPicture!==!0)return Ue(e,t);let r=o!==null?ne(o):t;if(e.zoom&&e.focusId===r&&!(o!==null&&n.carry))return Ve(e,!1);if(o!==null&&n.carry){let i=pe({...q(e,r),relation:null},!1);return ae(Ve(i,!0),"q",n.carry)}return Ve({...q(e,r),relation:null},!0)}function _r(e,t,n){return ae(pe(q(e,ne(t)),!1),"view",n)}function ka(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var to="aggregate:";function xt(e){return e.startsWith(to)&&e.includes("|")}var Et=e=>e?.off===!0,Lr=e=>e!==void 0&&!Et(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),no=e=>e!==void 0&&!Et(e)&&(e.fast!==void 0||e.decide!==void 0),Hr=e=>e?.suggestOnOpen!==!1&&no(e),Dr=e=>e?.hoverChips===!0&&no(e);var Pt={};var go=_(j(),1),ei={turns:[],outcomes:new Map,busy:!1,pending:null,draft:null,draftNote:null},ho=e=>`graview:seat:${e}`;function ti(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 ni(e,t){if(e)try{sessionStorage.setItem(e,JSON.stringify({turns:t.turns.slice(-40),outcomes:[...t.outcomes],draft:t.draft}))}catch{}}function Ct(e){let t=e===null?null:ho(e),n={...ei,...ti(t)},o=new Set,r=(i,a=!0)=>{n=i,a&&ni(t,n);for(let l of[...o])l()};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 oi(e){return(0,go.useSyncExternalStore)(e.subscribe,e.get,e.get)}var wo=_(j(),1),ri={entries:[],ghost:null,loaded:!1};function So(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 It(e){let t=ri,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:So(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:So(t.entries,i)})).catch(i=>{console.warn("The host's AI interactions could not be read:",i)})}}}function ii(e){return(0,wo.useSyncExternalStore)(e.subscribe,e.get,e.get)}function vo(e){return e?.closest?.("[data-graview-pick]")?.getAttribute("data-graview-pick")??null}var Je=_(j(),1),Qe=(0,Je.createContext)(void 0),ai=()=>(0,Je.useContext)(Qe);var A=_(j(),1),Ce=(0,A.createContext)(null);function xo(){return(0,A.useContext)(Ce)}function si(e,t){let n=xo(),o=(0,A.useMemo)(()=>n?n.live.seenBy(t):e,[n,e,t]),r=(0,A.useRef)(0),i=(0,A.useCallback)(a=>o.subscribe(()=>{r.current+=1,a()}),[o]);return(0,A.useSyncExternalStore)(i,()=>r.current,()=>0),o}var li=Ke(()=>(__graviewPreload(import.meta.url,["./chunk.TI4OSTQV.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.E2AJ7U5Z.js"))),bo,di=400;function _t(e,t,n){let o=(0,A.useContext)(Ce),r=o!==null&&o.owns(e,t),[i,a]=(0,A.useState)(null),[l,s]=(0,A.useState)(bo);(0,A.useEffect)(()=>{if(l||r||i===null)return;let x=!0;return li().then(C=>{bo=C,x&&s(C)},()=>{}),()=>{x=!1}},[l,r,i]);let[u,f]=(0,A.useState)(0),m=(0,A.useMemo)(()=>r||i===null||i>=e.log.length||!l?void 0:l.askArchived(e,i,n)??l.askDeclaration(n,i),[r,e,i,n,l,u]),p=m&&"waiting"in m?m.waiting:void 0,g=m&&"seq"in m?m:null,[v,T]=(0,A.useState)(void 0);(0,A.useEffect)(()=>{if(!p)return;let x=!0,C=setTimeout(()=>x&&T(p),di);return p.then(()=>x&&f(V=>V+1)),()=>{x=!1,clearTimeout(C)}},[p]);let y=p!==void 0&&v!==p||g!==null,b=(0,A.useMemo)(()=>{if(r||i===null||i>=e.log.length||!l||y)return null;try{let x=l.pastAt(e,i,n);return{seq:i,at:x.past?.at,store:x}}catch{return null}},[r,e,i,n,l,y,u]),h=(0,A.useRef)(null),E=y?h.current:b;(0,A.useEffect)(()=>{h.current=E},[E]);let P=(0,A.useCallback)(x=>a(x===null?null:x>=e.log.length?Number.POSITIVE_INFINITY:x),[e]),W=(0,A.useCallback)((x,C)=>[e,E?.store].some(V=>V!==void 0&&(V===x||V.seenBy(C)===x)),[e,E]),N=i!==null,H=(0,A.useMemo)(()=>({past:E,open:N,show:P,live:e,host:n,owns:W,archive:g}),[E,N,P,e,n,W,g]);return r?o:H}var ko=e=>`graview:setting:${e}`;function Ro(){return localStorage}function To(e,t){try{let n=(t??Ro()).getItem(ko(e.name));if(n!==null&&e.options.some(o=>o.value===n))return n}catch{}return e.initial}function Mo(e,t,n){try{(n??Ro()).setItem(ko(e.name),t)}catch{}}function Oo(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 L=_(j(),1);function Lt(e){return Fe(e)}var fi=12,pi=4;function yi(e,t,n){let o=Lt(t);return e.get(o)??{participant:o,who:t.id??t.kind,at:null,mode:"docked",since:n,trail:[]}}var tt=(e,t)=>t===null||e[e.length-1]===t?e:[...e,t].slice(-fi);function Vo(e,t){let n=e.filter(r=>r.length>0);if(n.length===0)return null;if(n.length<=pi)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 Ht(e,t,n){let o=new Map(e);if(t.type==="rest"){for(let[a,l]of e)l.mode!=="asking"&&l.mode!=="docked"&&t.at-l.since>=t.holdMs&&o.set(a,{...l,mode:"docked",at:null,trail:[],say:void 0,confidence:void 0});return o}if(t.author.kind!=="agent")return o;let r=yi(e,t.author,t.at),i=a=>o.set(r.participant,{...r,...a,since:t.at});switch(t.type){case"read":{let a=Vo(t.ids,n);return i({at:a,mode:"reading",trail:tt(r.trail,a)}),o}case"about-to-write":case"write":{let a=Vo(t.ids,n);return i({at:a,mode:"writing",trail:tt(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:tt(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:tt(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 Co="graview:session";function Io(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(Co);if(o)return o;let r=t();return n.setItem(Co,r),r}catch{return t()}}var Dt={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"},Nt={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"},_o=[Dt,Nt],gi=800;function Lo(e){let{channel:t,store:n,view:o,principal:r,session:i,robots:a,seatWho:l,settingValues:s,setView:u,ttlMs:f=1e4,people:m,seats:p}=e,[g,v]=(0,L.useState)(()=>new Map),[T,y]=(0,L.useState)(null),[b,h]=(0,L.useState)(null),[E,P]=(0,L.useState)(null),W=typeof r.id=="string"&&r.id.length>0,N=W&&(s[Dt.name]??Dt.initial)==="shared",H=N&&(s[Nt.name]??Nt.initial)==="shared",x=Lt({kind:r.kind,...r.id?{id:r.id}:{},session:i}),C=W?Gn(r,{graph:n.graph,schema:n.schema,...p?{seats:p}:{},...m?{people:m}:{}}):"",V=l?a.get(`agent:${l}:${i}`):void 0,F=(0,L.useMemo)(()=>!t||!N?null:{participant:x,kind:r.kind,name:C,...r.onBehalfOf?.id?{onBehalfOf:r.onBehalfOf.id,...r.onBehalfOf.name?{onBehalfOfName:r.onBehalfOf.name}:{}}:{},hue:Fn(r.id??"nobody"),stop:E??te(o),...H?{over:T}:{},...V?{robot:{at:V.at,mode:V.mode}}:{},at:new Date().toISOString()},[t,N,H,x,C,r.id,r.kind,r.onBehalfOf?.id,r.onBehalfOf?.name,o,E,T,V?.at,V?.mode]);(0,L.useEffect)(()=>{if(!t||!F)return;t.here(F);let I=setInterval(()=>t.here({...F,at:new Date().toISOString()}),gi);return()=>clearInterval(I)},[t,F]),(0,L.useEffect)(()=>t?t.onWho(K=>v(wt(new Map,K,Date.now(),f))):void 0,[t,f]);let Z=g.size>0;(0,L.useEffect)(()=>{if(!Z)return;let I=setInterval(()=>{v(K=>{let Q=wt(K,[],Date.now(),f);return Q.size===K.size?K:Q})},Math.max(250,Math.min(1e3,f/4)));return()=>clearInterval(I)},[Z,f]),(0,L.useEffect)(()=>{if(!t||typeof window>"u")return;let I=()=>t.leave();return window.addEventListener("pagehide",I),()=>window.removeEventListener("pagehide",I)},[t]),(0,L.useEffect)(()=>{if(!H||typeof document>"u")return;let I=null,K=Q=>{let Ee=vo(Q.target);Ee!==I&&(I=Ee,y(Ee))};return document.addEventListener("pointermove",K,{passive:!0}),()=>document.removeEventListener("pointermove",K)},[H]);let X=(0,L.useRef)(null),z=b?g.get(b)??null:null,de=(0,L.useCallback)(I=>{X.current=null,h(I)},[]);return(0,L.useEffect)(()=>{if(b){if(!z){h(null);return}z.stop!==X.current?.stop&&(X.current={stop:z.stop,at:Date.now()},u(ze(z.stop)))}},[b,z,u]),(0,L.useEffect)(()=>{let I=X.current;!b||I===null||Date.now()-I.at<400||Zn(o,ze(I.stop))||h(null)},[o,b]),(0,L.useEffect)(()=>{if(!b||typeof document>"u")return;let I=K=>{K.key==="Escape"&&h(null)};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[b]),(0,L.useMemo)(()=>({who:g,sharing:F?{participant:x,name:C}:null,following:z,follow:de,sayWhere:P}),[g,F,x,C,z,de])}var U=_(j(),1);function Ho(e){return Fe(e.author)}function hi(e,t){return e.length>1?"co-edited":t==="rule"?"rule":t==="agent"?"autonomous":"directed"}function Do(e,t,n,o,r){let i=new Map;for(let[s,u]of e)o-u.at<r&&i.set(s,u);let a=new Set(n.flatMap(s=>s.nodeIds)),l=(s,u,f)=>{let m=i.get(s),p=m?.participants.includes(Ho(u))?m.participants:[...m?.participants??[],Ho(u)];i.set(s,{at:o,manner:hi(p,u.author.kind),intent:u.intent,wrote:(m?.wrote??!1)||(f.wrote??!1),read:(m?.read??!1)||(f.read??!1),broke:(m?.broke??!1)||a.has(s),participants:p})};for(let s of t){for(let u of s.writes)l(u,s,{wrote:!0});for(let u of s.reads)s.writes.includes(u)||l(u,s,{read:!0})}for(let s of n)for(let u of s.nodeIds){let f=i.get(u);i.set(u,{at:o,manner:f?.manner??"rule",intent:f?.intent??s.message,wrote:f?.wrote??!1,read:f?.read??!1,broke:!0,participants:f?.participants??["rule::"]})}return i}var Si=2600;function No(e,t=Si){let[n,o]=(0,U.useState)(()=>new Map),r=(0,U.useRef)(n);r.current=n;let i=(0,U.useRef)(null),a=(0,U.useCallback)(s=>{r.current=s,o(s),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{r.current=new Map,o(new Map)},t)},[t]);(0,U.useEffect)(()=>{let s=e.violations(),u=e.subscribe((f,m)=>{let p=e.violations(),g=zn(e.allInvariants(),s,p).introduces;s=p,a(Do(r.current,m,g.map(v=>({nodeIds:v.nodeIds,message:v.message})),Date.now(),t))});return()=>{u(),i.current&&clearTimeout(i.current)}},[e,t,a]);let l=(0,U.useCallback)(s=>{s.reads.length!==0&&a(Do(r.current,[wi(s)],[],Date.now(),t))},[t,a]);return{activity:n,noteAttention:l}}function wi(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=_(j(),1);function jo(){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 nt=_(j(),1),vi=e=>e.definitions.some(t=>jn(t).size>0);function Wo(e,t,n){let[o,r]=(0,nt.useState)(void 0),i=(n.roles??[]).join("\0");return(0,nt.useEffect)(()=>{if(!t||!vi(e.schema)){r(void 0);return}let a=!0,l=!1,s=e.graph,u=()=>{l||(l=!0,queueMicrotask(()=>{l=!1,a&&e.reread()}))},f=Wn(t,{kind:n.kind,...n.id===void 0?{}:{id:n.id},...n.roles?{roles:n.roles}:{}},u);return St(s,f.read),r(f),e.reread(),()=>{a=!1,St(s,void 0)}},[e,t,n.kind,n.id,i]),o}function Go(){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 le=_(Ie(),1),bi="graview:place-menu",_e=(0,d.createContext)(null),qo=(0,d.createContext)("scene");function xi({mode:e,children:t}){return(0,le.jsx)(qo.Provider,{value:e,children:t})}function Ei(){return(0,d.useContext)(qo)}var zo={kind:"human"},Pi=[],Ai=[],ki=[],jt=[];function $o(e,t){let n=(0,d.useId)();(0,d.useEffect)(()=>{if(!globalThis.__graviewWatch)return;let o=t??zo,r=()=>qn(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 Ri={off:!0};function Ti({store:e,views:t,initialView:n,scheme:o="dark",initialSelection:r,principal:i,seats:a=Pi,onSeat:l,people:s=Ai,memory:u,presenceTtlMs:f,app:m,settings:p=m?.settings??ki,presence:g,brand:v,locale:T,timeZone:y,onKeepLens:b,providers:h,ai:E,files:P,resolveApp:W,history:N,linkedRecords:H,menuSections:x,keptViews:C,subscriptions:V,signIn:F,view:Z,onViewChange:X,children:z}){let de=(0,d.useContext)(_e),I=x??de?.menuSections,K=F??de?.signIn,Q=C??de?.keptViews,[Ee,wr]=(0,d.useState)(null),ue=Ee??i??a[0]?.principal??zo,He=_t(e,ue,N),nn=He.past&&He.live===e?He.past.store:e,D=(0,d.useMemo)(()=>nn.seenBy(ue),[nn,ue]);$o(e,ue);let[re]=(0,d.useState)(()=>Io(u)),[on,vr]=(0,d.useState)(!1),rn=(0,d.useCallback)(()=>vr(!0),[]),ie=(0,d.useMemo)(()=>g?[...p,..._o]:p,[p,g]),[pt]=(0,d.useState)(()=>n??Kt(t,e.schema)),[br,an]=(0,d.useState)(()=>$e(pt??fe,r??pt?.selection??[])),Pe=(0,d.useRef)(pt??fe).current,[sn,xr]=(0,d.useState)(null),[ln,Er]=(0,d.useState)(null),J=(0,d.useContext)(_e),[dn]=(0,d.useState)(()=>J?.seatTalk??Ct(v?.name??e.schema.kinds.join(","))),yt=E??J?.ai??Pt,De=(0,d.useMemo)(()=>yt.off?Ri:yt,[yt]),un=(0,d.useRef)(De.interactions);un.current=De.interactions;let[cn]=(0,d.useState)(()=>J?.aiDesk??It(()=>un.current)),[Pr]=(0,d.useState)(()=>J?.subscriptions??Bn()),fn=V??J?.subscriptions??Pr,mt=b??J?.onKeepLens,Ne=m??J?.app,je=T??J?.locale,Ar=v?.locale??Ne?.brand?.locale,We=y??J?.timeZone;Nn({reader:je,app:Ar,readerTimeZone:We,appTimeZone:v?.timeZone??Ne?.brand?.timeZone});let pn=(0,d.useRef)(null),yn=(0,d.useCallback)(c=>{pn.current=c},[]),mn=(0,d.useCallback)(c=>pn.current?.whereIs(c)??null,[]),[gn]=(0,d.useState)(()=>jo()),[hn]=(0,d.useState)(()=>Go()),[gt,kr]=(0,d.useState)(null),[Ae,Sn]=(0,d.useState)(()=>new Map),ke=(0,d.useRef)(Ae);ke.current=Ae;let Re=(0,d.useRef)(null),ht=(0,d.useCallback)(c=>D.graph.getNode(c)?.kind,[D]),ee=(0,d.useCallback)(c=>{let S=Ht(ke.current,c,ht);ke.current=S,Sn(S),Re.current&&clearTimeout(Re.current),[...S.values()].some(M=>M.mode!=="docked"&&M.mode!=="asking")&&(Re.current=setTimeout(()=>{let M=Ht(ke.current,{type:"rest",at:Date.now(),holdMs:Ft},ht);ke.current=M,Sn(M)},Ft+20))},[ht]),wn=(0,d.useCallback)(c=>ee({...c,at:c.at??Date.now()}),[ee]),vn=(0,d.useCallback)(c=>{kr(c),c&&ee({type:"home",author:{kind:"agent",id:c,session:re},at:Date.now()})},[ee,re]);(0,d.useEffect)(()=>D.subscribe((c,S)=>{for(let k of S)k.author.kind==="agent"&&ee({type:"write",author:k.author,ids:k.writes,at:Date.now()})}),[D,ee]),(0,d.useEffect)(()=>()=>{Re.current&&clearTimeout(Re.current)},[]);let $=(0,d.useMemo)(()=>({...ue,session:re}),[ue,re]),bn=Wo(D,H,$),xn=(0,d.useCallback)(c=>{wr(c),l?.(c)},[l]),[Te,Rr]=(0,d.useState)(()=>Object.fromEntries(ie.map(c=>[c.name,To(c,u)])));(0,d.useEffect)(()=>{for(let c of ie)Oo(c,Te[c.name]??c.initial)},[ie,Te]);let En=(0,d.useCallback)((c,S)=>{let k=ie.find(M=>M.name===c);!k||!k.options.some(M=>M.value===S)||(Mo(k,S,u),Rr(M=>({...M,[c]:S})))},[ie,u]),[Pn,Tr]=(0,d.useState)(null),{activity:An,noteAttention:kn}=No(D),Rn=(0,d.useCallback)(c=>{kn(c),ee({type:"read",author:c.author,ids:c.reads,at:Date.now()})},[kn,ee]),ce=(0,d.useCallback)(c=>{if(ye(c)!==null||se(c).length>0||xt(c))return!0;let S=Xn(c);return S?D.graph.allEdges().some(k=>k.kind===S.kind&&k.from===S.from&&k.to===S.to):D.graph.getNode(c)!==void 0},[D]),Tn=(0,d.useCallback)(c=>{let S=c.selection??jt,k=S.filter(ce),M=k.length===S.length?c:$e(c,k);return M.focusId!==null&&!ce(M.focusId)&&(M=q(M,null)),M},[ce]),Me=(0,d.useCallback)(c=>{let S=Tn(c),k=Bo(D,$,S.shown);if(S.focusId!==null&&k.size>0){let M=se(S.focusId),Dn=D.graph.getNode(S.focusId);(M.length>0?M.every(Vr=>k.has(Vr)):Dn?k.has(Dn.kind):!1)&&(S={...S,focusId:null})}if(!S.overview&&S.focusId===null){let M=Pe.focusId!==null&&!ce(Pe.focusId)?Kt(t,e.schema)??{...fe,overview:!0}:Pe;M.focusId!==null&&ce(M.focusId)?S={...S,focusId:M.focusId}:M.overview===!0&&(S={...S,overview:!0})}return S},[Tn,ce,D,Pe,$,t,e.schema]),B=Me(Z??br),Mn=(0,d.useMemo)(()=>Bo(D,$,B.shown),[D,$,B.shown]),On=(0,d.useMemo)(()=>[...D.modules.administered.entries()].map(([c,S])=>{let k=D.mayAdminister(c,$);return{name:c,...S.description?{description:S.description}:{},kinds:S.kinds??[],canShow:k,shown:k&&(B.shown??[]).includes(c)}}),[D,$,B.shown]),Oe=(0,d.useCallback)(c=>{let S=k=>Me(typeof c=="function"?c(k):c);if(Z!==void 0){X?.(S(Z));return}X&&X(S(B)),an(k=>S(k))},[B,X,Z,Me]);(0,d.useEffect)(()=>{Z===void 0&&an(c=>{let S=Me(c);return S===c?c:S})},[B,Z,Me]);let Vn=B.selection??jt,Cn=(0,d.useCallback)(c=>{Oe(S=>$e(S,typeof c=="function"?c(S.selection??jt):c))},[Oe]),{who:In,following:_n,follow:Ln,sayWhere:Mr,sharing:Hn}=Lo({channel:g,store:D,view:B,principal:$,session:re,robots:Ae,seatWho:gt,settingValues:Te,setView:Oe,seats:a,people:s,...f!==void 0?{ttlMs:f}:{}}),Or=(0,d.useMemo)(()=>({store:D,scheme:o,views:t,view:B,setView:Oe,homeView:Pe,selection:Vn,setSelection:Cn,menuAt:sn,setMenuAt:xr,whereIs:mn,pointer:gn,motion:hn,registerScene:yn,robots:Ae,noteSeat:wn,seatWho:gt,registerSeatWho:vn,actsDoor:ln,registerActsDoor:Er,seatTalk:dn,aiDesk:cn,...u?{memory:u}:{},who:In,following:_n,follow:Ln,sayWhere:Mr,sharing:Hn,session:re,ai:De,resolveApp:W,linkedRecords:H,menuSections:I,...Q?{keptViews:Q}:{},subscriptions:fn,signIn:K,linkedReads:bn,movedByHand:on,noteMoved:rn,emphasis:Pn,setEmphasis:Tr,activity:An,noteAttention:Rn,principal:$,seats:a,people:s,takeSeat:xn,settings:ie,settingValues:Te,chooseSetting:En,hiddenKinds:Mn,administered:On,...h?{providers:h}:{},...v?{brand:v}:{},...mt?{onKeepLens:mt}:{},app:Ne,...je?{locale:je}:{},...We?{timeZone:We}:{}}),[D,o,t,B,Oe,Vn,Cn,sn,mn,gn,hn,yn,Ae,wn,gt,vn,ln,dn,cn,u,In,_n,Ln,Hn,re,De,W,H,I,Q,fn,K,bn,on,rn,Pn,An,Rn,$,a,s,xn,ie,Te,En,Mn,On,h,v,mt,Ne,je,We]);return(0,le.jsx)(_e.Provider,{value:Or,children:(0,le.jsx)(Ce.Provider,{value:He,children:(0,le.jsx)(Ii,{children:P?(0,le.jsx)(Qe.Provider,{value:P,children:z}):z})})})}var Uo=(0,d.createContext)(null),Wt,Gt=new Set,Mi=e=>(Gt.add(e),()=>void Gt.delete(e)),Fo=()=>Wt;function Oi(e){if(!Wt){Wt=e;for(let t of[...Gt])t()}}var Vi=300;function Ci(e){let t=0;return async(n,o)=>{let r=++t;return await new Promise(i=>setTimeout(i,Vi)),r===t?e(n,o):[]}}function Ii({children:e}){let{store:t,view:n,views:o,principal:r,hiddenKinds:i,selection:a,ai:l}=oe(),s=ot(),u=n.q,f=n.focusId,m=!!(u&&u.trim().length>0),p=(0,d.useSyncExternalStore)(Mi,Fo,Fo),g=(0,d.useMemo)(()=>m&&p?{flagged:new Set(t.violations().flatMap(E=>E.nodeIds)),touched:p.touchWeights(t.log.all())}:null,[t,s,m,p]),v=f?t.graph.getNode(f)?.kind??ye(f)??(se(f).length===1?se(f)[0]:void 0):void 0,T=(0,d.useMemo)(()=>l.near&&Ci(l.near),[l.near]),y=(0,d.useMemo)(()=>!u||!g||!p?null:p.search(t,u,{...v?{inKind:v}:{},principal:r,places:o.places(),kinds:t.schema.kinds.filter(E=>!i.has(E)),from:[...a,...f&&t.graph.has(f)?[f]:[]],flagged:g.flagged,touched:g.touched,limit:200,rank:T}),[t,u,r,o,i,a,f,v,g,T]),[b,h]=(0,d.useState)();return(0,d.useEffect)(()=>void y?.later?.then(E=>h([y,E])),[y]),(0,le.jsx)(Uo.Provider,{value:b?.[0]===y?b[1]:y,children:e})}var Ko=new WeakMap;function xs(e){let t=Ko.get(e);return t||Ko.set(e,t=new Set(e.matched)),t}function _i(){return(0,d.useContext)(Uo)}function oe(){let e=(0,d.useContext)(_e);if(!e)throw new Error("useGraview must be used inside a <GraviewProvider>.");return e}function Bt(){return(0,d.useContext)(_e)??null}function ot(){let{store:e}=oe(),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 Li(e){let{store:t}=oe(),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 Bo(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 Ft=2600;var Yo=new WeakSet,Hi=e=>Yo.has(e),Di=e=>void Yo.add(e);function Kt(e,t){let n=Un(e.arrangement?.()?.first,t,e.places());if(!(!n||n.to==="home"))return n.to==="place"?{...fe,focusId:ne(n.place.kind),within:{view:n.place.as}}:{...fe,focusId:ne(n.kind)}}var Zo=_(j(),1),Ni=(0,Zo.createContext)(!1);var rt=Symbol.for("graview.default-view");function Xo(e){return Object.defineProperty(e,rt,{value:!0,enumerable:!1}),e}function Jo(e){return typeof e=="function"&&e[rt]===!0}var it=Symbol.for("graview.replaces-page");function Qo(e){return Object.defineProperty(e,it,{value:!0,enumerable:!1}),e}function er(e){return typeof e=="function"&&e[it]===!0}var at=Symbol.for("graview.bleeds");function tr(e){return Object.defineProperty(e,at,{value:!0,enumerable:!1}),e}function nr(e){return typeof e=="function"&&e[at]===!0}var st=Symbol.for("graview.previews");function or(e,t={}){return Object.defineProperty(e,st,{value:t,enumerable:!1}),e}function rr(e){return typeof e=="function"?e[st]:void 0}function ji(e){return $n(e)}function Wi(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.homeView?.();return o&&e.home?.(o),e}var R=_(j(),1),Y=_(Ie(),1),qt=new Set,lt=0;function zt(e){return()=>{lt+=1;let t=e();return t.then(()=>void(lt-=1),()=>void(lt-=1)),t}}var Gi=()=>lt,ut=(0,R.createContext)(null);function Fi(){return{waiting:new Map,at:0}}function Ki(e){for(let[t,n]of e.waiting)n<e.at&&e.waiting.delete(t);e.at+=1}var Bi=e=>e?.waiting.size??0;function sr(e,t){e?.waiting.set(t,e.at)}function lr(e){let t=(0,R.useContext)(ut);(0,R.useLayoutEffect)(()=>{t?.waiting.delete(e)},[t,e])}function qi(e){let t={},n=!1,o=new Set,r=(0,R.lazy)(zt(()=>e().then(a=>{n=!0;let l=a.default;function s(u){return lr(t),(0,R.createElement)(l,u)}return{default:s}},a=>{for(let l of o)l.waiting.delete(t);throw a})));function i(a){let l=(0,R.useContext)(ut);return!n&&l&&(o.add(l),sr(l,t)),(0,R.createElement)(r,a)}return i}var dr=!1,ur=!1,dt=new Set;function zi(){dr=!0}function $i(){ur=!0;for(let e of[...dt])e();dt.clear()}var cr=()=>ur||!dr;function Ui(e){return cr()?(e(),()=>{}):(dt.add(e),()=>void dt.delete(e))}var ir=!1;function $t(){for(let e of[...qt])e()}function Yi(){ir||typeof window>"u"||(ir=!0,window.addEventListener("online",$t))}function Ut(e){let t,n=!1,o=!1,r,i=0,a=new Set,l=()=>{i+=1;for(let p of[...a])p()},s=p=>(a.add(p),()=>void a.delete(p)),u=()=>i,f=()=>void m().catch(()=>{});function m(){if(n)return Promise.resolve(t);if(r)return r;let p=e().then(g=>(t=g,n=!0,o=!1,r=void 0,qt.delete(f),l(),g),g=>{throw r=void 0,o=!0,qt.add(f),Yi(),l(),g});return p.catch(()=>{}),r=p,p}return{load:m,prefetch:f,get current(){return t},get failed(){return o},part(p,g={}){let v=g.what??"This part",T={};function y(E){(0,R.useSyncExternalStore)(s,u,u),lr(T);let P=(0,R.useRef)(null),W=(0,R.useRef)(null),N=(0,R.useRef)(!1);return(0,R.useEffect)(()=>{o&&r===void 0&&f()},[]),n&&typeof document<"u"&&P.current!==null&&document.activeElement===P.current&&(N.current=!0),(0,R.useLayoutEffect)(()=>{if(!(!n||!N.current)){N.current=!1;for(let H=W.current?.nextElementSibling??null;H!==null;H=H.nextElementSibling){let x=H.matches(ar)?H:H.querySelector(ar);if(x instanceof HTMLElement){x.focus();return}}}}),n?(0,Y.jsxs)(Y.Fragment,{children:[N.current?(0,Y.jsx)("span",{ref:W,hidden:!0}):null,p(t,E)]}):g.quiet?null:(0,Y.jsx)(Zi,{what:v,button:P,...g.as?{as:g.as}:{}})}let b=(0,R.lazy)(zt(()=>m().then(()=>({default:y}),()=>({default:y}))));function h(E){let P=(0,R.useContext)(ut),[W]=(0,R.useState)(()=>n||o);return!n&&!o&&sr(P,T),(0,R.createElement)(W?y:b,E)}return h}}}var ar="button,a[href],input,select,textarea,[tabindex]:not([tabindex='-1'])";function Zi({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,Y.jsxs)(n,{"data-testid":"lazy-part-missing",style:{margin:0,fontSize:"0.875rem",color:"var(--graview-ink-muted)"},children:[(0,Y.jsx)("span",{role:"status",children:r})," ",(0,Y.jsx)("button",{ref:t,type:"button","data-testid":"lazy-part-retry",onClick:$t,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 Se=_(j(),1);function Xi(){let{selection:e,setSelection:t}=oe();return(0,Se.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 Ji(){let{store:e}=oe(),t=ot();return(0,Se.useMemo)(()=>Qi(e),[e,t])}var fr=new WeakMap;function Qi(e){let t=fr.get(e);if(!t){let n={violations:null};e.subscribe(()=>{n.violations=null}),fr.set(e,n),t=n}return t.violations??=e.violations(),t.violations}function ea(){let{view:e,setView:t}=oe();return(0,Se.useMemo)(()=>({view:e,url:te(e),focus:n=>t(o=>q(o,n)),show:n=>t(o=>Jn(o,n)),toggle:n=>t(o=>Ue(o,n)),go:n=>t(n)}),[e,t])}var he={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;he.at=typeof t?.graview=="number"?t.graview:0,he.at>he.depth&&(he.depth=he.at),he.tell()});var G=_(j(),1),Zt={profile:{trigger:"profile-button",pane:"profile",opens:"press",focus:"into",drawn:["shell","embed"]},problems:{trigger:"standing",pane:"problems",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"]},suggested:{trigger:"suggested-button",pane:"suggested",opens:"press",focus:"into",drawn:["shell","embed","pages"]},activity:{trigger:"activity-button",pane:"activity",opens:"press",focus:"into",drawn:["shell","embed","pages"]},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"]}},ta={position:"fixed",inset:"auto",margin:0,zIndex:Kn("popover"),boxSizing:"border-box"},ct=6,we=8,na=e=>typeof e.showPopover=="function";function ft(e){try{return e.matches(":popover-open")}catch{return!1}}function oa(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 Xt(e,t,n={}){let o=oa(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(),l=r.height-o.bottom-ct-we,s=o.top-ct-we,u=a.height<=l||l>=s,f=Math.max(96,Math.floor(u?l:s)),m=Math.min(a.height,f);a.height>f&&(e.style.maxHeight=i?`min(${i}, ${f}px)`:`${f}px`);let p=a.width,g=n.align==="start"?o.left:o.right-p,v=typeof t=="function"?null:t.current?.closest("[data-graview-embed]")?.getBoundingClientRect();v&&p<=v.right-v.left&&(g<v.left?g=o.left+p<=v.right?o.left:v.left:g+p>v.right&&(g=o.right-p>=v.left?o.right-p:v.right-p));let T=p>=r.width-2*we?Math.max(0,(r.width-p)/2):Math.max(we,Math.min(g,r.width-we-p)),y=u?o.bottom+ct:Math.max(we,o.top-ct-m);e.style.left=`${Math.round(T)}px`,e.style.top=`${Math.round(y)}px`}function pr(e,t,n,o={}){let r=o.align??"end";(0,G.useLayoutEffect)(()=>{let i=e.current;if(!t||!i)return;if(na(i)&&!ft(i))try{i.showPopover(),ia()}catch{}let a=0,l=u=>{u?.target instanceof Node&&i.contains(u.target)||(cancelAnimationFrame(a),a=requestAnimationFrame(()=>Xt(i,n,{align:r})))};Xt(i,n,{align:r}),addEventListener("resize",l),addEventListener("scroll",l,!0);let s=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>l());return s?.observe(i),()=>{if(cancelAnimationFrame(a),removeEventListener("resize",l),removeEventListener("scroll",l,!0),s?.disconnect(),i.isConnected&&ft(i))try{i.hidePopover()}catch{}}},[t,e,r])}var Jt=new Set;function ra(e){return Jt.add(e),()=>Jt.delete(e)}function ia(){for(let e of Jt)if(!(!e.isConnected||!ft(e)))try{e.hidePopover(),e.showPopover()}catch{}}var ve=null,aa='button:not([disabled]), [href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])';function sa(e){for(let t of e.querySelectorAll(aa))if(t.closest("[hidden]")===null&&getComputedStyle(t).visibility!=="hidden")return t;return e}var Yt=()=>{let e=document.activeElement;return e===null||e===document.body};function la(e,t={}){let{at:n,returnTo:o,onOpenChange:r}=t,i=t.popover!==!1,[a,l]=(0,G.useState)(!1),s=t.open??a,u=(0,G.useRef)(null),f=(0,G.useRef)(null),m=(0,G.useCallback)(h=>{u.current=h},[]),p=(0,G.useCallback)(h=>{f.current=h},[]),g=`graview-popover-${(0,G.useId)().replace(/:/g,"")}`,v=(0,G.useRef)({onOpenChange:r,returnTo:o,controlled:t.open!==void 0});v.current={onOpenChange:r,returnTo:o,controlled:t.open!==void 0};let T=(0,G.useCallback)(h=>{v.current.controlled||l(h),v.current.onOpenChange?.(h)},[]),y=(0,G.useCallback)(()=>{(document.querySelector(`[aria-controls="${g}"]`)??u.current??v.current.returnTo?.()??null)?.focus({preventScroll:!0})},[g]),b=(0,G.useCallback)(h=>{let E=f.current,P=typeof document>"u"?null:document.activeElement,W=P===null||P===document.body||E!==null&&E.contains(P);T(!1),!(!h||!W)&&(y(),requestAnimationFrame(()=>{Yt()&&y()}))},[T,y]);return pr(f,i&&s,n??u,t.align?{align:t.align}:{}),(0,G.useEffect)(()=>{if(!i||!s)return;let h={name:e,close:()=>b(!1)};if(ve&&ve.close!==h.close&&ve.close(),ve=h,Zt[e].focus==="into"){let x=f.current;x&&!x.contains(document.activeElement)&&sa(x).focus({preventScroll:!0})}let E=x=>{x.key==="Escape"&&b(!0)},P=x=>{let C=x.target;if(!(C instanceof Node))return;let V=f.current;if(V?.contains(C)||u.current?.contains(C))return;let F=C instanceof Element?C.closest('[role="dialog"], [role="alertdialog"]'):null;F&&!(V&&F.contains(V))||(b(!1),Zt[e].focus==="into"&&requestAnimationFrame(()=>{(Yt()||V!==null&&V.contains(document.activeElement))&&y()}))},W=null,N=null,H=x=>{let C=x.target;if(!(C instanceof Element))return;let V=f.current,F=C.closest('[role="dialog"], [role="alertdialog"]');!F||V&&(V.contains(F)||F.contains(V))||(W=F,b(!1))};return document.addEventListener("keydown",E),document.addEventListener("pointerdown",P,!0),document.addEventListener("focusin",H),()=>{document.removeEventListener("keydown",E),document.removeEventListener("pointerdown",P,!0),document.removeEventListener("focusin",H);let x=W;x&&typeof MutationObserver<"u"&&(N?.disconnect(),N=new MutationObserver(()=>{x.isConnected||(N?.disconnect(),requestAnimationFrame(()=>{(Yt()||document.activeElement.closest("[hidden]")!==null)&&y()}))}),N.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>N?.disconnect(),10*6e4)),ve?.close===h.close&&(ve=null)}},[i,s,e,b,y]),{open:s,setOpen:h=>h?T(!0):b(!0),toggle:()=>s?b(!0):T(!0),trigger:{ref:m,"aria-expanded":s,"aria-controls":g,"data-graview-popover-trigger":e},pane:{ref:p,id:g,popover:"manual",tabIndex:-1,"data-graview-popover":e,"data-graview-overlay":""}}}var be=_(j(),1);var yr=(0,be.createContext)(null);function da(){let e=(0,be.useContext)(yr),t=Bt(),n=(o,r,i)=>t?.setView(a=>ae(ae(pe(q(a,ne(o)),!1),"view",r),"filter",i?.filter??null));return(0,be.useMemo)(()=>e??{record:o=>{t&&(t.setView(r=>q(pe(r,!1),o)),t.setSelection([o]))},place:(o,r)=>{let i=t?.views.places().find(a=>a.as===o);i&&n(i.kind,i.as,r)},list:(o,r)=>n(o,null,r)},[e,t])}var xe=_(j(),1);var ua=Ut(Ke(()=>(__graviewPreload(import.meta.url,["./chunk.KA44WNB4.js","./chunk.SDO3U72B.js","./chunk.4TJOS4C7.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.P6FQAILU.js"))));function ca(e,t,n){let o,r=!1,i=()=>{let{hidden:l,removed:s}=t.current();o||r||l.length+s.length===0||(o=()=>{},ua.load().then(u=>{r||(o=u.watchTidied(e,t,n))},String))};i();let a=t.onChange?.(i);return()=>{r=!0,a?.(),o?.()}}function fa(e,t){let[n,o]=(0,xe.useState)();return(0,xe.useEffect)(()=>t?ca(e,t,r=>o([e,r])):void 0,[e,t]),n?.[0]===e?n[1]:e}var mr=_(j(),1),pa=(0,mr.createContext)(!1);var Qt=_(j(),1),ya=(0,Qt.createContext)(null),ma=(0,Qt.createContext)(null);var gr=_(j(),1),ga=(0,gr.createContext)(null);var hr=_(j(),1),en='button:not([disabled]), a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])',tn=e=>e instanceof HTMLElement&&(e.matches(en)||e.hasAttribute("tabindex")),Le=e=>typeof e.checkVisibility=="function"?e.checkVisibility():e.getClientRects().length>0;function ha(e,t){let n=s=>s.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 l=e.querySelector(a);return l&&tn(l)&&Le(l)?l:null}var Sa=e=>e.isConnected&&tn(e)&&!e.matches(":disabled")&&e instanceof HTMLElement&&Le(e);function Sr(e,t){let n=t?ha(e,t):null;if(n)return n;let o=e.querySelector("[data-graview-view][tabindex]");if(o&&Le(o))return o;for(let r of e.querySelectorAll(en))if(Le(r))return r;return tn(e)&&Le(e)?e:null}function wa(e){(0,hr.useEffect)(()=>{let t=e.current;if(!t||typeof MutationObserver>"u")return;let n=[],o=y=>{let b=y.target;if(b instanceof Element){n=[];for(let h=b;h&&h!==t.parentElement;h=h.parentElement)n.push(h)}},r=!1,i=!1,a=t.ownerDocument,l=()=>!i&&a.defaultView!==null,s=(y,b)=>void setTimeout(()=>l()&&b(),y),u=y=>void requestAnimationFrame(()=>l()&&y()),f=y=>{if(r=!1,i)return;let b=a.activeElement;if(!(!(b===null||b===a.body||b===a.documentElement)||n.length===0)){if(Sa(n[0])){y&&n[0]instanceof HTMLElement&&n[0].focus({preventScroll:!0});return}for(let E of n.slice(1)){if(!E.isConnected)continue;let P=Sr(E,n[0]);if(P){P.focus({preventScroll:!0}),n=[];return}}}},m=(y,b=Date.now()+2500)=>{s(100,()=>{f(y);let h=a.activeElement;(h===null||h===a.body||h===a.documentElement)&&n.length>0&&Date.now()<b&&m(y,b)})},p=()=>{r||n.length===0||(r=!0,s(60,()=>u(()=>{f(!1),m(!1)})))},g=y=>{if(!(y instanceof KeyboardEvent&&!["Enter"," ","Escape"].includes(y.key))){if(!(y instanceof KeyboardEvent)){let b=y.target instanceof Element?y.target.closest(en):null,h=a.activeElement,E=h===null||h===a.body||h===a.documentElement;if(b&&E&&t.contains(b)){n=[];for(let P=b;P&&P!==t.parentElement;P=P.parentElement)n.push(P);s(150,()=>u(()=>{f(!1),m(!1)}));return}}!(y instanceof KeyboardEvent)&&!(y.target instanceof Node&&n[0]?.contains(y.target))||s(150,()=>u(()=>{f(!0),m(!0)}))}},v=new MutationObserver(()=>{n.length>0&&!n[0].isConnected&&p()}),T=y=>{y.relatedTarget===null&&p()};return t.addEventListener("focusin",o),t.addEventListener("focusout",T),t.addEventListener("click",g),t.addEventListener("keydown",g),v.observe(t,{childList:!0,subtree:!0}),()=>{i=!0,t.removeEventListener("focusin",o),t.removeEventListener("focusout",T),t.removeEventListener("click",g),t.removeEventListener("keydown",g),v.disconnect()}},[e])}export{fe as a,te as b,ze as c,ba as d,xa as e,Zn as f,Yn as g,Xn as h,vt as i,q as j,Jn as k,ae as l,pe as m,$e as n,Ve as o,Ue as p,Ze as q,bt as r,ye as s,Aa as t,Ir as u,ne as v,Qn as w,se as x,eo as y,_r as z,ka as A,to as B,xt as C,Lr as D,Hr as E,Dr as F,j as G,Ct as H,oi as I,ii as J,vo as K,Qe as L,ai as M,Ce as N,xo as O,si as P,_t as Q,Ie as R,bi as S,xi as T,Ei as U,$o as V,Ti as W,Oi as X,xs as Y,_i as Z,oe as _,Bt as $,ot as aa,Li as ba,Hi as ca,Di as da,Kt as ea,yr as fa,da as ga,Ni as ha,Xo as ia,Jo as ja,Qo as ka,er as la,tr as ma,nr as na,or as oa,rr as pa,ji as qa,Wi as ra,zt as sa,Gi as ta,ut as ua,Fi as va,Ki as wa,Bi as xa,qi as ya,zi as za,$i as Aa,cr as Ba,Ui as Ca,Ut as Da,fa as Ea,pa as Fa,ya as Ga,ma as Ha,ga as Ia,Xi as Ja,Ji as Ka,ea as La,he as Ma,wa as Na,ta as Oa,ft as Pa,pr as Qa,ra as Ra,la as Sa};
|
|
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
|
+
*/
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Da as Q,Eb as I,F,G as B,I as L,La as X,Lb as en,O,R as j,S as J,T as U,U as K,Wa as v,Ya as nn,_ as P,aa as Z,la as z}from"./chunk.4TJOS4C7.js";var un=1e4,g=class{constructor(s){this.nodes=s}},rn=Symbol.for("@graview/core:far-record"),fn=e=>typeof e=="object"&&e!==null&&e[rn]===!0;function cn(e){let s={...e.fields,id:`@${e.address}/${e.kind}:${e.id}`,kind:`@${e.address}/${e.kind}`,label:e.label};return Object.defineProperty(s,rn,{value:!0}),s}function Nn(e){let s=`the linked record in ${e.ref.address}`;return e.reason==="denied"?`${s} is not one this viewer may open`:`${s} has not been read`}var pn="",f=class extends Error{constructor(c,l){super(c);this.sentence=c;this.at=l}},W=class extends f{},V=e=>e!==null&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof g)&&typeof e.id=="string",tn=e=>{let s=new Set;return new g(e.filter(c=>!s.has(c.id)&&s.add(c.id)))},w=e=>e===null?"nothing":e instanceof g?"a set of records":Array.isArray(e)?"a list":V(e)?"a record":typeof e=="string"?"a word":typeof e;function on(e,s){let c=s.budget??un,l=(n,a)=>{if(c-=n,c<0)throw new W("this rule looks at too much of the graph to judge in one go",a)},u=s.today??L(),b=s.now??new Date().toISOString(),k=new Map,N=new Set,A=s.bindings,H=(n,a,t,o)=>{let d=`${n?.id}\0${a}`;if(k.has(d))return k.get(d);if(N.has(d))throw new f(`"${a}"${n?` of ${z(n.kind)}`:""} depends on itself`,o);N.add(d);let r=A;A=void 0;try{let i=$(t,n);return k.set(d,i),i}finally{A=r,N.delete(d)}},E=(n,a,t)=>{l(1,t);let o=s.kinds.get(n.kind),d=o?.computed?.get(a);if(d)return H(n,a,d,t);let r=o?.linked?.get(a);if(r){let y=Q(Object.hasOwn(n,a)?n[a]:void 0,r);l(y.length,t);let m=s.linked??X(s.graph),h=y.flatMap(x=>{let C=m?m(x):{unread:!0};return"record"in C?[cn(C.record)]:(s.onUnread?.({relation:a,ref:x,reason:"denied"in C?"denied":"unread"}),[])});return r.cardinality==="one"?h[0]??null:new g(h)}let i=Object.hasOwn(n,a);if(o?.fields.has(a)||i){let y=i?v(n,a,u):void 0;return y===void 0?null:y}let p=o?.edges.get(a);if(p){let y=s.graph.out(n.id,a);return l(y.length,t),p==="one"?y[0]??null:new g(y)}if(a==="id")return n.id;if(fn(n))return null;throw new f(`${z(n.kind)} has no field or relation called "${a}"`,t)},S=(n,a,t)=>{if(n instanceof g)return n;if(n===null)return new g([]);if(V(n))return new g([n]);throw new f(`${t}(\u2026) needs a set of records, and was given ${w(n)}`,a)},G=(n,a,t)=>{if(n===null)return null;if(typeof n=="string")return n;if(typeof n=="number"||typeof n=="boolean")return String(n);throw new f(`${t}(\u2026) needs a word, and was given ${w(n)}`,a)},_=(n,a,t)=>{let o=G(n,a,t);if(o===null)return null;let d=Date.parse(o.length===10?`${o}T00:00:00Z`:o);if(Number.isNaN(d))throw new f(`${t}(\u2026) needs a date, and "${o}" is not one`,a);return d},M=(n,a)=>V(n)&&V(a)?n.id===a.id:V(n)&&typeof a=="string"?n.id===a:typeof n=="string"&&V(a)?n===a.id:Array.isArray(n)&&Array.isArray(a)?n.length===a.length&&n.every((t,o)=>M(t,a[o])):n===a,R=(n,a,t)=>{if(n===null)return!1;if(typeof n=="boolean")return n;throw new f(`${t} must be true or false, and was ${w(n)}`,a)},T=(n,a)=>$(a,n);function $(n,a){switch(l(1,n.at),n.t){case"lit":return n.value;case"list":return n.items.map(t=>$(t,a));case"ident":{let t=A&&Object.hasOwn(A,n.name)?A[n.name]:void 0;if(t!==void 0)return t;if(a)return E(a,n.name,n.at);throw new f(`"${n.name}" means nothing in a rule over the whole graph`,n.at)}case"member":{let t=$(n.object,a);if(t===null)return null;if(V(t))return E(t,n.name,n.at);throw new f(`".${n.name}" needs a record before it, and was given ${w(t)}`,n.at)}case"unary":{let t=$(n.operand,a);if(n.op==="!")return!R(t,n.at,"what follows not");if(t===null)return null;if(typeof t!="number")throw new f(`"-" needs a number, and was given ${w(t)}`,n.at);return-t}case"where":{let t=S($(n.set,a),n.at,"where");return l(t.nodes.length,n.at),new g(t.nodes.filter(o=>R(T(o,n.filter),n.at,"a where condition")))}case"binary":return dn(n,a);case"call":return ln(n,a)}}function dn(n,a){if(n.op==="&&")return R($(n.left,a),n.at,"each side of and")&&R($(n.right,a),n.at,"each side of and");if(n.op==="||")return R($(n.left,a),n.at,"each side of or")||R($(n.right,a),n.at,"each side of or");let t=$(n.left,a),o=$(n.right,a);if(n.op==="&"||n.op==="|"||n.op==="-"&&(t instanceof g||o instanceof g)){let d=S(t,n.at,n.op).nodes,r=S(o,n.at,n.op).nodes;l(d.length+r.length,n.at);let i=new Set(r.map(p=>p.id));return tn(n.op==="|"?[...d,...r]:d.filter(p=>i.has(p.id)===(n.op==="&")))}switch(n.op){case"==":return M(t,o);case"!=":return!M(t,o);case"in":{if(o===null)return!1;if(o instanceof g)return o.nodes.some(d=>M(t,d));if(Array.isArray(o))return o.some(d=>M(t,d));if(typeof o=="string"&&typeof t=="string")return o.includes(t);throw new f(`"in" needs a list or a set on its right, and was given ${w(o)}`,n.at)}case"<":case"<=":case">":case">=":{if(t===null||o===null)return!1;if(!(typeof t=="number"&&typeof o=="number"||typeof t=="string"&&typeof o=="string"))throw new f(`cannot compare ${w(t)} with ${w(o)}`,n.at);return n.op==="<"?t<o:n.op==="<="?t<=o:n.op===">"?t>o:t>=o}default:{if(t===null||o===null)return null;if(n.op==="+"&&(typeof t=="string"||typeof o=="string")){let d=`${G(t,n.at,"+")}${G(o,n.at,"+")}`;if(d.length>1e4)throw new f("that makes a word too long",n.at);return d}if(typeof t!="number"||typeof o!="number")throw new f(`"${n.op}" needs numbers, and was given ${w(t)} and ${w(o)}`,n.at);return(n.op==="/"||n.op==="%")&&o===0?null:n.op==="+"?t+o:n.op==="-"?t-o:n.op==="*"?t*o:n.op==="/"?t/o:t%o}}}function ln(n,a){let t=(r,i=r)=>{if(n.args.length<r||n.args.length>i)throw new f(`${n.fn}(\u2026) takes ${r===i?r:`${r} to ${i}`} argument${i===1?"":"s"}`,n.at)},o=r=>$(n.args[r],a),d=r=>{let i=o(r);if(typeof i!="string")throw new f(`${n.fn}(\u2026) needs a quoted name, like ${n.fn}('name')`,n.at);return i};switch(n.fn){case"out":case"in":{t(1,2);let r=(y,m)=>n.fn==="out"?s.graph.out(y,m):s.graph.in(y,m);if(n.args.length===2){let y=S(o(0),n.at,n.fn).nodes,m=d(1);return tn(y.flatMap(h=>{let x=r(h.id,m);return l(x.length+1,n.at),x}))}let i=d(0);if(!a)throw new f(`${n.fn}('${i}') needs a record to start from`,n.at);let p=r(a.id,i);return l(p.length,n.at),new g(p)}case"all":{t(1,2);let r=s.graph.nodesOfKind(d(0),{archived:n.args.length===2?o(1):!1});return l(r.length,n.at),new g(r)}case"archived":return t(0,1),nn(n.args.length===1?o(0):a);case"count":return t(1),S(o(0),n.at,"count").nodes.length;case"exists":return t(1),S(o(0),n.at,"exists").nodes.length>0;case"every":case"some":{t(2);let r=S(o(0),n.at,n.fn);l(r.nodes.length,n.at);let i=p=>R(T(p,n.args[1]),n.at,`the condition in ${n.fn}(\u2026)`);return n.fn==="every"?r.nodes.every(i):r.nodes.some(i)}case"sum":case"min":case"max":{t(2);let r=S(o(0),n.at,n.fn);l(r.nodes.length,n.at);let i=n.args[1],p=i.t==="lit"&&typeof i.value=="string"?i.value:void 0,y=i.t==="ident"?`'${i.name}'`:p!==void 0?`'${p}'`:"\u2026",m=r.nodes.map(h=>i.t==="ident"?E(h,i.name,n.at):p!==void 0?E(h,p,n.at):T(h,i)).filter(h=>{if(h===null)return!1;if(typeof h!="number")throw new f(`${n.fn}(\u2026, ${y}) needs a number for each member, and found ${w(h)}`,n.at);return!0});return n.fn==="sum"?m.reduce((h,x)=>h+x,0):m.length===0?null:n.fn==="min"?Math.min(...m):Math.max(...m)}case"fact":{t(1);let r=d(0),i=s.kinds.get(pn)?.computed?.get(r);if(!i)throw new f(`no fact is called "${r}"`,n.at);return H(null,r,i,n.at)}case"first":return t(1),S(o(0),n.at,"first").nodes[0]??null;case"sort":{t(2,3);let r=S(o(0),n.at,"sort"),i=n.args.length===3?o(2):"asc";if(i!=="asc"&&i!=="desc")throw new f("sort(\u2026) goes 'asc' or 'desc'",n.at);let p=r.nodes.length;l(p+p*Math.ceil(Math.log2(p+1)),n.at);let y=r.nodes.map((h,x)=>({node:h,i:x,key:T(h,n.args[1])})),m=i==="desc"?-1:1;return y.sort((h,x)=>Y(h.key,x.key,m,n.at)||h.i-x.i),new g(y.map(h=>h.node))}case"either":{if(n.args.length<1)throw new f("either(\u2026) takes at least one argument",n.at);for(let r=0;r<n.args.length;r++){let i=o(r);if(i!==null&&!(i instanceof g&&i.nodes.length===0))return i}return null}case"present":{t(1);let r=o(0);return r===null||r===""?!1:Array.isArray(r)?r.length>0:r instanceof g?r.nodes.length>0:!0}case"len":{t(1);let r=o(0);if(r===null)return 0;if(typeof r=="string"||Array.isArray(r))return r.length;if(r instanceof g)return r.nodes.length;throw new f(`len(\u2026) needs a word or a list, and was given ${w(r)}`,n.at)}case"contains":case"startsWith":{t(2);let r=o(0),i=o(1);if(r===null||i===null)return!1;if(n.fn==="contains"&&Array.isArray(r))return r.some(m=>M(m,i));let p=G(r,n.at,n.fn),y=G(i,n.at,n.fn);return n.fn==="contains"?p.toLowerCase().includes(y.toLowerCase()):p.startsWith(y)}case"lower":{t(1);let r=G(o(0),n.at,"lower");return r===null?null:r.toLowerCase()}case"today":return t(0),u;case"now":return t(0),b;case"date":{t(1);let r=_(o(0),n.at,"date");return r===null?null:new Date(r).toISOString().slice(0,10)}case"days":case"hours":{t(2);let r=_(o(0),n.at,n.fn),i=_(o(1),n.at,n.fn);if(r===null||i===null)return null;let p=(i-r)/(n.fn==="days"?864e5:36e5);return n.fn==="days"?Math.round(p):p}case"if":return t(3),R(o(0),n.at,"the condition in if(\u2026)")?o(1):o(2);default:throw new f(`"${n.fn}" is not a function the rule language knows`,n.at)}}function Y(n,a,t,o){if(n===null||a===null)return n===a?0:n===null?1:-1;if(Array.isArray(n)&&Array.isArray(a)){for(let r=0;r<Math.max(n.length,a.length);r++){let i=Y(n[r]??null,a[r]??null,t,o);if(i!==0)return i}return 0}let d=r=>typeof r=="number"||typeof r=="string"||typeof r=="boolean"?typeof r:w(r);if(d(n)!==d(a)||typeof n=="object"||typeof a=="object")throw new f(`sort(\u2026) cannot put ${w(n)} and ${w(a)} in order`,o);return typeof n=="string"?t*(n<a?-1:n>a?1:0):t*(Number(n)-Number(a))}return $(e,s.subject)}var Rn=["out","in","all","count","exists","every","some","sum","min","max","present","len","contains","startsWith","lower","today","now","date","days","hours","if","first","sort","either","fact","archived"];var Gn=(e,s,c,l)=>({severity:"error",code:e,path:s,message:c,...l?{fix:l}:{}}),Mn=(e,s,c,l)=>({severity:"warning",code:e,path:s,message:c,...l?{fix:l}:{}}),On=e=>e.some(s=>s.severity==="error");function En(e){return e.map(s=>`${s.severity==="error"?"\u2717":s.severity==="warning"?"!":"\xB7"} ${s.path||"(document)"}: ${s.message}${s.fix?` \u2014 ${s.fix}`:""}`).join(`
|
|
2
|
+
`)}var jn=["money","percent","date","time","datetime","relative","upper","lower","count","words","and","plural","excerpt"],gn={getNode:()=>{},allNodes:()=>[],allEdges:()=>[],nodesOfKind:()=>[],edgesOfKind:()=>[],out:()=>[],in:()=>[],neighbors:()=>[],has:()=>!1};function Un(e,s,c,l=[],u,b=D){return q(e,s,c,l,u,b)}var yn=(e,s)=>e.capital?P(s):s,hn=new Set(["words","plural","relative"]);function Kn(e,s){let c=e[0];return!c||c.text!==void 0||!c.format||!hn.has(c.format)?s:/^[a-z][a-z'’-]*(?=\s|$|[,.;:!?])/.test(s)?P(s):s}function mn(e){return e?s=>{let c=e.tryDefinition(s.kind)?.label;return c?c(s):D(s)}:D}var an=["zero","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen"],sn=["","","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"];function wn(e,s){return!Number.isInteger(e)||e<0||e>99?K(e,s):e<20?an[e]:e%10===0?sn[e/10]:`${sn[Math.floor(e/10)]}-${an[e%10]}`}function $n(e){return/[^aeiou]y$/i.test(e)?`${e.slice(0,-1)}ies`:/(s|x|z|ch|sh)$/i.test(e)?`${e}es`:`${e}s`}var D=e=>String(e.name??e.title??e.label??e.id);function q(e,s,c,l=[],u,b=D){if(s==="plural"){let k=e instanceof g?e.nodes.length:Array.isArray(e)?e.length:typeof e=="number"?e:null;return k===null||l[0]===void 0?"\u2014":k===1?l[0]:l[1]??$n(l[0])}if(e===null)return"\u2014";if(e instanceof g)return s==="count"?String(e.nodes.length):s==="and"?Z(e.nodes.map(b)):e.nodes.map(b).join(", ");if(Array.isArray(e)){if(s==="count")return String(e.length);let k=e.map(N=>q(N,void 0,c,[],u,b));return s==="and"?Z(k):k.join(", ")}if(typeof e=="object")return b(e);switch(s){case"words":return typeof e=="number"?wn(e,u?.locale):String(e);case"money":return typeof e=="number"?I(e,u):String(e);case"percent":return typeof e=="number"?K(e,u?.locale,{style:"percent",maximumFractionDigits:0}):String(e);case"upper":return String(e).toUpperCase();case"lower":return String(e).toLowerCase();case"excerpt":return en(String(e),Number(l[0])||void 0);case"date":return O(U(String(e),u?.timeZone)??String(e).slice(0,10),u?.locale);case"time":return typeof e=="string"&&F.test(e)?O(e,u?.locale):J(String(e),u?.locale,u?.timeZone);case"datetime":return typeof e=="string"&&F.test(e)?O(e,u?.locale):j(String(e),u?.locale,u?.timeZone);case"relative":{let k=U(String(e),u?.timeZone),N=k===void 0?Date.parse(String(e)):Date.parse(`${k}T00:00:00Z`);if(Number.isNaN(N))return String(e);let A=Math.round((N-Date.parse(`${c}T00:00:00Z`))/864e5);return A===0?"today":A===1?"tomorrow":A===-1?"yesterday":A>0?`in ${A} days`:`${-A} days ago`}default:return typeof e=="string"&&F.test(e)?O(e,u?.locale):typeof e=="string"&&B.test(e)?j(e,u?.locale,u?.timeZone):String(e)}}function Pn(e,s){let c=s.today??L(),l=s.name??mn(s.graph?.schema);return e.map(u=>{if(u.text!==void 0)return u.text;try{let b=on(u.expr,{graph:s.graph??gn,subject:s.node,kinds:s.kinds,today:c,budget:s.budget??500,...s.bindings?{bindings:s.bindings}:{}});return yn(u,q(b,u.format,c,u.formatArgs,s.money,l))}catch(b){if(b instanceof f)return"\u2014";throw b}}).join("")}export{g as a,Nn as b,pn as c,f as d,W as e,on as f,Rn as g,Gn as h,Mn as i,On as j,En as k,jn as l,gn as m,Un as n,yn as o,Kn as p,mn as q,Pn as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as u}from"./chunk.
|
|
1
|
+
import{c as u}from"./chunk.DPHTUTOS.js";import{ga as l}from"./chunk.4TJOS4C7.js";function a(e,n){let s=new Map;for(let o of e){let t=n(o.from),i=n(o.to);if(t===void 0||i===void 0)continue;let d=`${o.kind}|${t}|${i}`,r=s.get(d);r||s.set(d,r={edge:o.kind,from:t,to:i,links:0,froms:new Set,tos:new Set}),r.links+=1,r.froms.add(o.from),r.tos.add(o.to)}return[...s.entries()].sort(([o],[t])=>o<t?-1:o>t?1:0).map(([o,t])=>({key:o,edge:t.edge,from:t.from,to:t.to,links:t.links,fromCount:t.froms.size,toCount:t.tos.size}))}function m(e,n,s){let o=[],t=[];for(let d of e){let r=f(d);if(r!==null){o.includes(r)||o.push(r);continue}s(d)!==void 0&&t.push(d)}let i=n.overview&&n.focusId!==null?f(n.focusId):null;return n.beside&&n.overview&&i===null&&n.focusId!==null&&t.length===0&&o.length===0&&s(n.focusId)!==void 0&&t.push(n.focusId),{districts:o,records:t,lens:i}}function f(e){return e.startsWith("kind:")?e.slice(5)||null:e.startsWith("aggregate:")&&!e.includes("|")&&e.slice(10)||null}function y(e,n){let s=u(e,n.from,n.edge,"out"),o=n.from===n.to?" of their own":"";return`${l(e,n.from,n.fromCount)} \u2192 ${l(e,n.to,n.toCount)}${o}, ${s}`}export{a,m as b,f as c,y as d};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as le,b as I,d as ue,g as ye,h as me,i as pe}from"./chunk.DPHTUTOS.js";import{$ as q,C as T,Da as re,Db as v,F as Z,Fa as ie,Fb as ce,G as O,Gb as C,H as B,I as V,Na as W,O as x,R as X,Ra as se,S as Y,Ta as de,Va as ae,W as j,Y as H,da as M,fa as L,ka as _,ma as J,sa as Q,ta as ee,ua as ne,va as te,xb as fe,ya as oe}from"./chunk.4TJOS4C7.js";var $e=t=>`${t}${t%100>=11&&t%100<=13?"th":["th","st","nd","rd"][t%10]??"th"}`,Re={day:"day",week:"week",month:"month",year:"year"},F=t=>t.length<2?t[0]??"":`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`;function xe(t,e,n){let o=e.interval??1,i=Re[e.every],s=t.slice(0,10),l=o===1?`Every ${i}`:o===2?`Every other ${i}`:`Every ${o} ${i}s`,d;if(e.every==="week"){let y=(e.on?.length?e.on:[W[new Date(`${s}T00:00:00Z`).getUTCDay()]]).map(r=>H(W.indexOf(r),"long",n));d=o===1?`Every ${F(y)}`:o===2?`Every other ${F(y)}`:`${l} on ${F(y)}`}else if(e.every==="month"){let y=(e.on?.length?e.on:[+s.slice(8,10)]).map(r=>r===-1?"the last day":`the ${$e(Number(r))}`);d=`${l} on ${F(y)}`}else e.every==="year"?d=`${l} on ${j(s,n)}`:d=l;return O.test(t)&&(d+=` at ${Y(t,n)}`),e.until&&(d+=`, until ${x(e.until,n)}`),e.count&&(d+=`, ${e.count===1?"once":`${e.count} times`}`),d}function ge(t,e,n={}){if(!de(e)||typeof t!="string")return;let o=n.today??V(),i=ae(t,e,o),s=xe(t,e,n.locale),l=i.slice(0,4)===o.slice(0,4)?j(i.slice(0,10),n.locale):x(i.slice(0,10),n.locale);return i.slice(0,10)<o?`${s}, last ${l}`:`${s}, next ${l}`}function on(t,e){let n=new Map,o=new Map;for(let i of t){let s=M(e(i.kind),i).trim().toLowerCase();o.set(s,[...o.get(s)??[],i])}for(let i of o.values()){if(i.length<2)continue;let s=new Map;for(let l of i)s.set(l.kind,[...s.get(l.kind)??[],l]);for(let[l,d]of s){if(d.length===1){n.set(d[0].id,J(e(l),l));continue}let y=d.map(f=>new Map(Se(f,e(f.kind)).map(m=>[m.key,m.alone]))),r=[...new Set(y.flatMap(f=>[...f.keys()]))],u=f=>y.every(m=>!/\d/.test(m.get(f)??"")),h=[...r.filter(u),...r.filter(f=>!u(f))],b=(f,m)=>m.map(p=>y[f].get(p)??"").filter(Boolean).join(" \xB7 "),S=f=>new Set(d.map((m,p)=>b(p,f))).size===d.length&&d.every((m,p)=>b(p,f)!==""),c=h.find(f=>S([f])),a=c?void 0:h.flatMap((f,m)=>h.slice(m+1).map(p=>[f,p])).find(f=>S(f));d.forEach((f,m)=>{if(c||a)return void n.set(f.id,b(m,c?[c]:a));let p=h.find($=>{let w=y[m].get($);return w!==void 0&&w!==""&&y.every((R,k)=>k===m||R.get($)!==w)});n.set(f.id,p?y[m].get(p):`${m+1} of ${d.length}`)})}}return n}function rn(t,e){return t?.describe?t.describe(e):`${e.kind} ${M(t,e)}`}var _e=new Set(["id","kind","label"]);function ve(t,e){if(e.length===0)return!1;let n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`(^|[\\s\xB7,(/])${n}($|[\\s\xB7,)/])`).test(t)}function Se(t,e,n={}){let o=e?.display,i=new Set([..._e,...o?.hide??[]]);typeof t.label=="string"&&e?.label&&!M(e,t).includes(t.label)&&i.delete("label");let s=(n.said??[]).filter(c=>!!c),l=s.filter(c=>c.endsWith("\u2026")).map(c=>c.replace(/…$/,"").trim()).filter(c=>c.length>12),d=[],y=e?.fields?.shape,r=e?.fieldRoles,u=n.glance?o?.glance??[r?.who,r?.when].filter(c=>!!c):he(o?.page),h=n.glance&&o?.glance!==void 0,S=[...new Set(h?u:[...u,...Ne(e),...Object.keys(t)])].filter(c=>Object.hasOwn(t,c)).map(c=>[c,t[c]]);for(let[c,a]of S){if(i.has(c)||a===void 0||a===null)continue;let f=o?.format?.[c],m=f?[]:ne(a);if(m[0]&&n.glance)continue;let p=e?.fields?.shape?.[c],$=!f&&typeof a=="string"&&oe(p)?a:void 0,w=!f&&typeof a=="string"&&le(p);if($&&n.glance)continue;let R=f?void 0:ie(p),k=R?{relation:R,refs:re(a,R)}:void 0;if(k&&(n.glance||k.refs.length===0)||!m[0]&&typeof a=="object"&&(!Array.isArray(a)||a.some(g=>typeof g=="object"&&g!==null))&&f===void 0)continue;let U=typeof a=="string"&&!f?ge(a,t[`${c}Repeat`],{locale:n.locale}):void 0,N=m[0]?m.map(g=>`${g.caption?`${g.name} \u2014 ${g.caption}`:g.name}${Q(g)?` (${ee(g)})`:""}`).join(", "):Array.isArray(a)?a.join(", "):typeof a=="boolean"?a?"Yes":"No":String(a),E=f?void 0:ye(e,c),G=pe(E,a),K=!f&&!E&&typeof a=="number"?v(e?.fields?.shape?.[c]):void 0,z=k?k.refs.length>1?`${k.refs.length} linked records`:"linked record":f?f(a):K?ce(a,K):me(E,a,n.locale)??(Array.isArray(a)||typeof a=="boolean"?N:typeof a=="string"&&U!==void 0?U:typeof a=="string"&&Z.test(a)?x(a,n.locale):typeof a=="string"&&O.test(a)?X(a,n.locale,n.timeZone):typeof a=="string"&&Fe(e,c)?I(e,c,a):N),P=typeof a=="string"&&Te(e,c,z),A=(n.glance||n.excerpt)&&!f&&(P||w)?ue(z,{markdown:w}):z;if(s.includes(A)||l.some(g=>A.startsWith(g))||n.glance&&(typeof a=="string"||typeof a=="number")&&s.some(g=>ve(g,A)))continue;let D=_(e,c),Ae=typeof a=="number"?`${D} ${A}`:typeof a=="boolean"&&!f?`${D}: ${A.toLowerCase()}`:A;if(d.push({key:c,label:D,value:A,stored:N,alone:Ae,long:P,...w?{markdown:!0}:{},...m[0]?{files:m}:{},...$?{app:$}:{},...k?{linked:k}:{},...G?{href:G}:{},...se(y?.[`${c}Repeat`])?{repeats:!0}:{}}),n.limit!==void 0&&d.length>=n.limit)break}return Oe(d,e)}function Oe(t,e){let n=new Map;for(let o of t){let i=Me(e,o.key);i&&n.set(o.key,new Set(i.map(s=>I(e,o.key,s).toLowerCase())))}return n.size<2?t:t.map(o=>{let i=n.get(o.key);return i!==void 0&&[...n].some(([l,d])=>l!==o.key&&[...i].some(y=>d.has(y)))?{...o,alone:`${o.label}: ${o.value.toLowerCase()}`}:o})}function Me(t,e){let n=t?.fields?.shape?.[e];for(let o=0;o<6&&n?._zod?.def?.innerType!==void 0;o++)n=n._zod.def.innerType;return n?._zod?.def?.type==="enum"&&n._zod.def.entries?Object.values(n._zod.def.entries).map(String):void 0}function Fe(t,e){let n=t?.fields?.shape?.[e];for(let o=0;o<6&&n?._zod?.def?.innerType!==void 0;o++)n=n._zod.def.innerType;return n?._zod?.def?.type==="enum"}function Ne(t){let e=t?.fields?.shape;return[...Object.keys(e??{}),...Object.keys(t?.computed??{})]}function he(t){return[...t?.fields??[],...(t?.groups??[]).flatMap(e=>e.fields)]}var Ee=500,ze=160;function De(t){let e=t;for(let n=0;n<6&&e?._zod?.def?.innerType!==void 0;n++)e=e._zod.def.innerType;return e?._zod?.def?.type==="string"?e._zod.def:void 0}function Te(t,e,n){return De(t?.fields?.shape?.[e])?.checks?.some(i=>i._zod?.def?.check==="max_length"&&(i._zod.def.maximum??0)>Ee)?!0:typeof n=="string"&&(n.includes(`
|
|
2
|
+
`)||n.length>ze)}function sn(t,e){let n=t?.display?.page,o=n?.groups??[],i=new Map(e.map(r=>[r.key,r])),s=new Set(he(n)),l=r=>r.flatMap(u=>i.has(u)?[i.get(u)]:[]),d=e.filter(r=>!s.has(r.key));return[{fields:[...l(n?.fields??[]),...o.length>0?[]:d]},...o.map(r=>({title:r.title,fields:l(r.fields)})),...o.length>0?[{title:"Details",fields:d}]:[]].filter(r=>r.fields.length>0)}function je(t,e,n){let o=[...e?.creates??[],...e?.subject&&e.subject.kinds!=="*"?e.subject.kinds:[]];for(let i of o){let s=t.tryDefinition(i),l=s?.fields?.shape??{};if(!s||!(n in l))continue;let d=s.display?.format?.[n];return{label:s.display?.labels?.[n]??_(s,n),option:r=>d?d(r):L(r)}}return{label:_(void 0,n),option:i=>L(i)}}function cn(t,e,n){if(n instanceof fe){let o=e.find(s=>s.name===n.mutation);return`Not yet: ${n.issues.map(s=>{let l=s.path.length>0?je(t,o,String(s.path[0])).label:void 0;return l?`${l} \u2014 ${q(s.message)}`:s.message}).join("; ")}.`}return n instanceof Error?n.message:String(n)}var Le=t=>/^[A-Z]{3}$/.test(t??"");function ke(t){let{format:e,unit:n,currency:o,locale:i}=t,s=Le(n),l=e==="money"||!e&&s,d=l?s?n:o:void 0;return{...l?{format:"money"}:e?{format:e}:{},...n&&!(l&&s)?{unit:n}:{},...d?{currency:d}:{},...i?{locale:i}:{}}}function yn(t){switch(t.format){case"money":return t.currency?`An amount of money in ${t.currency}: a plain number, 1250.5 for 1,250.50 ${t.currency}.`:"An amount of money, in no named currency: a plain number.";case"percent":return"A fraction said as a percent: 0.15 is 15%.";default:return t.unit?`A number of ${t.unit}.`:"A number."}}function be(t){let e=T(t)?.innerType;return e===void 0?t:be(e)}var We={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Ce=t=>(t?._zod?.def?.checks??[]).map(e=>e._zod?.def).filter(e=>e!==void 0);function we(t){let e=be(t),n=T(e),o=n?.type,i=Ce(e);if(o==="enum")return{type:"choice",options:Object.keys(n?.entries??{})};let s=te(e);if(s)return s==="image"?{type:"file",image:!0}:s==="video"?{type:"file",video:!0}:{type:"file"};if(o==="boolean")return{type:"boolean"};if(o==="array"){let l=we(n?.element);return l.type==="unknown"?{type:"unknown"}:{type:"several",of:l}}if(o==="number"){let l,d,y;for(let r of i){r.check==="multiple_of"&&typeof r.value=="number"?y=r.value:r.check==="number_format"&&(r.format==="safeint"||r.format==="int32"||r.format==="uint32")&&(y??=1);let u=r.check==="number_format"&&r.format?We[r.format]:void 0,h=u?u[0]:r.check==="greater_than"&&r.inclusive&&typeof r.value=="number"?r.value:void 0,b=u?u[1]:r.check==="less_than"&&r.inclusive&&typeof r.value=="number"?r.value:void 0;h!==void 0&&(l=l===void 0?h:Math.max(l,h)),b!==void 0&&(d=d===void 0?b:Math.min(d,b))}return{type:"number",...l===void 0?{}:{min:l},...d===void 0?{}:{max:d},...y===void 0?{}:{step:y},...C(e)==="duration"?{duration:!0}:{},...v(t)?{amount:ke(v(t))}:{}}}if(o==="string"){if(i.some(u=>u.fn===B||u.format==="datetime")||n?.format==="datetime")return{type:"date",time:!0,instant:!0};let d=[n?.pattern,...i.map(u=>u.pattern)].filter(u=>u instanceof RegExp).map(u=>u.source);if(d.some(u=>u.includes("\\d{4}")))return d.some(u=>u.includes("\\d{2}:\\d{2}"))?{type:"date",time:!0}:{type:"date"};let y=i.some(u=>u.check==="max_length"&&typeof u.maximum=="number"&&u.maximum>500),r=C(e);return y?{type:"text",long:!0}:r==="phone"||r==="place"?{type:"text",holds:r}:{type:"text"}}return{type:"unknown"}}function An(t,e){let n=t?.shape;return!n||!(e in n)?{type:"unknown"}:we(n[e])}export{xe as a,on as b,rn as c,Se as d,sn as e,ke as f,yn as g,be as h,we as i,An as j,je as k,cn as l};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as y}from"./chunk.
|
|
1
|
+
import{b as y}from"./chunk.DHAK6PPX.js";import"./chunk.2UIUMG23.js";import{G as w,R as c}from"./chunk.KA44WNB4.js";import"./chunk.SDO3U72B.js";import"./chunk.4TJOS4C7.js";import"./chunk.2AZTW66C.js";import{b as l}from"./chunk.AJZBJBMO.js";var r=l(w(),1);var t=l(c(),1);function x({field:d,label:p,value:m,markdown:b,onSave:n,onCancel:u}){let[a,v]=(0,r.useState)(m),[i,h]=(0,r.useState)(!1),o=(0,r.useRef)(null);return(0,r.useEffect)(()=>o.current?.focus(),[i]),(0,r.useLayoutEffect)(()=>{let e=o.current;if(!e||i||typeof CSS<"u"&&CSS.supports?.("field-sizing","content"))return;let f=()=>{e.style.height="auto";let g=getComputedStyle(e);e.style.height=`${e.scrollHeight+parseFloat(g.borderTopWidth)+parseFloat(g.borderBottomWidth)}px`};f();let S=requestAnimationFrame(f);return()=>cancelAnimationFrame(S)},[a,i]),(0,t.jsxs)("form",{style:{display:"grid",gap:8,minWidth:0},onSubmit:e=>{e.preventDefault(),n(a,!1)},children:[i?(0,t.jsx)("div",{"data-graview-preview":d,"aria-label":`${p}, as it will read`,role:"region",style:C,children:(0,t.jsx)(y,{text:a,markdown:!0})}):(0,t.jsx)("textarea",{ref:o,"aria-label":p,"data-graview-field":d,value:a,rows:3,onChange:e=>v(e.target.value),onKeyDown:e=>{e.key==="Escape"?(e.preventDefault(),u()):e.key==="Enter"&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),n(a,!1))},onBlur:e=>{e.relatedTarget instanceof Node&&e.currentTarget.form?.contains(e.relatedTarget)||n(a,!0)},style:E}),(0,t.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:8},children:[(0,t.jsx)("button",{type:"submit",style:s,children:"Save"}),(0,t.jsx)("button",{type:"button",onClick:u,style:s,children:"Cancel"}),b?(0,t.jsx)("button",{type:"button","aria-pressed":i,onClick:()=>h(!i),style:s,children:i?"Write":"Preview"}):null,(0,t.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:"Ctrl or \u2318 Enter saves \xB7 Esc puts it back"})]})]})}var C={minHeight:"7.5em",padding:"8px 10px",border:"1px dashed var(--graview-edge-bright)",borderRadius:6,lineHeight:1.6,minWidth:0},s={font:"inherit",fontSize:"0.8125rem",minHeight:28,padding:"2px 12px"},E={font:"inherit",lineHeight:1.5,width:"100%",boxSizing:"border-box",minHeight:"7.5em",padding:"8px 10px",resize:"vertical",fieldSizing:"content",color:"var(--graview-ink)",background:"var(--graview-panel, transparent)",border:"1px solid var(--graview-edge-bright)",borderRadius:6};export{x as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk.76W2FXEC.js";import"./chunk.LPD74WBI.js";import"./chunk.2UIUMG23.js";import"./chunk.KA44WNB4.js";import"./chunk.SDO3U72B.js";import"./chunk.4TJOS4C7.js";import"./chunk.2AZTW66C.js";import"./chunk.AJZBJBMO.js";export{a as ActivityFilter,b as InteractionRow};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as k,d as x,e as H}from"./chunk.
|
|
1
|
+
import{c as k,d as x,e as H}from"./chunk.7FRPNQU4.js";import{b as A}from"./chunk.BDHKWVNX.js";import"./chunk.ZH4NWRWB.js";import{d as E}from"./chunk.GUMJEVVP.js";import"./chunk.SAHNXAV3.js";import{a as b}from"./chunk.UT6642FC.js";import"./chunk.TI4OSTQV.js";import"./chunk.N4M54YK6.js";import"./chunk.KVJFY7N5.js";import"./chunk.DPHTUTOS.js";import{m as S}from"./chunk.2UIUMG23.js";import{G as L,Oa as v,R as h,Sa as w,_ as p,aa as f}from"./chunk.KA44WNB4.js";import"./chunk.SDO3U72B.js";import{Xa as m}from"./chunk.4TJOS4C7.js";import"./chunk.2AZTW66C.js";import{b as g}from"./chunk.AJZBJBMO.js";var l=g(L(),1);var e=g(h(),1);function I(){let{store:t,principal:r}=p(),a=f(),i=(0,l.useMemo)(()=>k(t,r),[t,r,a]),n=w("suggested");return i.length===0?null:(0,e.jsxs)("div",{style:{position:"relative"},children:[(0,e.jsxs)("button",{type:"button","data-testid":"suggested-button",...n.trigger,onClick:n.toggle,title:"What tidying suggests, waiting for you",style:{display:"inline-flex",alignItems:"center",gap:6,minHeight:30,padding:"0 8px",borderRadius:8,border:"1px solid transparent",background:"transparent",boxShadow:"none",fontSize:"0.875rem",whiteSpace:"nowrap",color:"var(--graview-ink-muted)"},children:[i.length,(0,e.jsxs)("svg",{className:"graview-activity-mark",width:"15",height:"15",viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",style:{display:"var(--graview-activity-mark, none)"},children:[(0,e.jsx)("path",{d:"M3 4.5 H13 M3 8 H10 M3 11.5 H8",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),(0,e.jsx)("circle",{cx:"12.25",cy:"11.5",r:"1.6",fill:"none",stroke:"currentColor",strokeWidth:"1.3"})]}),(0,e.jsx)("span",{className:"graview-activity-word",children:" Suggested"})]}),n.open?(0,e.jsxs)("section",{...n.pane,"aria-label":"Suggested","data-testid":"suggested","data-graview-offstage":"",style:{...v,width:320,maxHeight:"min(52cqh, 460px)",overflow:"auto",display:"flex",flexDirection:"column",gap:9,padding:12,borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:[(0,e.jsx)("h2",{style:{...S,margin:0},children:"Suggested"}),(0,e.jsx)("p",{style:{margin:0,fontSize:"0.75rem",lineHeight:1.45,color:"var(--graview-ink-faint)"},children:"Not made yet: each waits for you."}),(0,e.jsx)("ol",{"data-testid":"suggestions",style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10,fontSize:"0.8125rem"},children:i.map(s=>(0,e.jsx)(O,{suggestion:s,...i.length===1?{settled:()=>{n.setOpen(!1),document.querySelector('[data-testid="activity-button"]')?.focus()}}:{}},s.id))})]}):null]})}function O({suggestion:t,settled:r}){let{store:a,principal:i,seats:n,people:s}=p(),[c,u]=(0,l.useState)(null),T=m(t.author,{graph:a.graph,schema:a.schema,seats:n,people:s}),y=o=>{u(null);try{o==="accept"?x(a,t.id,{author:i}):H(a,t.id,{author:i}),r?.()}catch(d){u(d instanceof Error?d.message:String(d))}};return(0,e.jsxs)("li",{"data-testid":"suggestion","data-suggestion":t.id,style:{display:"grid",gap:5,lineHeight:1.45},children:[(0,e.jsxs)("span",{children:[(0,e.jsx)("strong",{style:{fontWeight:600},children:T})," ",(0,e.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:"suggests"})," ",t.intent]}),t.lineage?(0,e.jsx)("span",{"data-graview-lineage":"",style:{color:"var(--graview-ink-faint)"},children:b(t.lineage)}):null,t.about.length>0?(0,e.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:t.about.slice(0,4).map(o=>(0,e.jsx)(E,{label:A(a,o),pickId:o},o))}):null,(0,e.jsxs)("div",{style:{display:"flex",gap:6},children:[(0,e.jsx)("button",{type:"button","data-testid":"suggestion-accept",onClick:()=>y("accept"),style:{minHeight:24,padding:"1px 10px",fontSize:"0.75rem"},children:"Accept"}),(0,e.jsx)("button",{type:"button","data-testid":"suggestion-decline",onClick:()=>y("decline"),style:{minHeight:24,padding:"1px 10px",fontSize:"0.75rem"},children:"Decline"})]}),c?(0,e.jsx)("span",{"data-testid":"suggestion-refused",role:"alert",style:{fontSize:"0.75rem",color:"var(--graview-warn)"},children:c}):null]})}export{I as SuggestedTray};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{G as g,P as y,_ as m,ga as d}from"./chunk.
|
|
1
|
+
import{G as g,P as y,_ as m,ga as d}from"./chunk.KA44WNB4.js";import{b as S}from"./chunk.AJZBJBMO.js";var v=S(g(),1);function k(){let{store:w,principal:a,ai:n,aiDesk:r,seatTalk:i,views:p,app:t,brand:l,view:A,selection:s}=m(),e=y(w,a),c=d(),o=A.within?.view;return(0,v.useMemo)(()=>({store:e,principal:a,ai:n,desk:r,seatTalk:i,goTo:c,places:[...p.places()],app:t??{name:l?.name??"app",schema:e.schema,...e.policy?{policy:e.policy}:{}},...o?{place:o}:{},selection:s}),[e,a,n,r,i,c,p,t,l,o,s])}export{k as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as P,c as m,d as k}from"./chunk.I5TOMBIF.js";import"./chunk.QQTRAY5W.js";import"./chunk.DOBQ4LO4.js";import{b as v,c as w,d as S,e as x,f as M}from"./chunk.G446PWV6.js";import"./chunk.4TJOS4C7.js";import"./chunk.2AZTW66C.js";import"./chunk.AJZBJBMO.js";var O=new Set(["input","select","textarea"]),g=r=>r.namespaceURI==="http://www.w3.org/1999/xhtml"&&O.has(r.localName),N=r=>r.localName==="select"||r.type==="checkbox"||r.type==="radio",E=r=>r.type==="checkbox"||r.type==="radio"?!r.checked:r.localName!=="select"&&r.value==="";function h(r){return r.type==="checkbox"||r.type==="radio"?`checked:${r.checked}`:r.localName==="select"&&r.multiple?`selected:${[...r.selectedOptions].map(n=>n.value).join("\0")}`:`value:${r.value}`}function F(r=n=>n.isTrusted){let n=new WeakMap,d=new WeakSet,o=new WeakMap,i={heard(e,t){if(!(!g(t)||!r(e))&&(e.type==="input"||e.type==="change"&&N(t))&&((N(t)||E(t))&&d.delete(t),E(t)&&o.delete(t),n.set(t,h(t)),t.type==="radio"&&t.name)){let c=t.getRootNode();for(let u of c.querySelectorAll?.('input[type="radio"]')??[])u.name===t.name&&n.set(u,h(u))}},filled(e){n.delete(e),o.delete(e),g(e)&&!E(e)?d.add(e):d.delete(e)},press(e,t,c){if(!r(e))return;let u=t.closest("[data-act]");if(!u||!w(u))return;let l=e.type==="keydown"?e.key:void 0;if(!(e.type!=="click"&&!((l==="Enter"||l===" ")&&t===u&&!v(u))))return i.collect(u,c)},collect(e,t){if(!e.hasAttribute("data-act")||!t.contains(e))return;let c=e.closest("[data-record]"),u=e.closest("fieldset, [role='group']")??t,l=[];for(let a of u.querySelectorAll("input[name], select[name], textarea[name]")){let s=a,f=!d.has(s)&&n.get(s)===h(s);if(s.type==="radio"){if(!s.checked)continue;l.push({name:s.name,value:s.value,typed:f,empty:!1,chosen:!0});continue}if(s.localName==="select"){l.push({name:s.name,value:s.value,typed:f,empty:s.value===""&&!f,chosen:!0});continue}if(s.type==="checkbox"){l.push({name:s.name,value:s.checked,typed:f,empty:!s.checked&&!d.has(s)&&!f});continue}let R=(s.type==="number"||s.type==="range")&&s.value!==""&&Number.isFinite(s.valueAsNumber)?s.valueAsNumber:s.value,A=f?o.get(s):void 0;l.push({name:s.name,value:R,typed:f,empty:s.value===""&&!f,...A?{from:A}:{}})}return{as:e.getAttribute("data-act")??"",...c&&t.contains(c)?{record:c.getAttribute("data-record")}:{},fields:l}},prefilled(e,t){d.delete(e),o.set(e,t),n.set(e,h(e))}};return i}var b=new WeakMap,L=(r,n)=>{n.tab&&r.removeAttribute("tabindex"),n.role&&r.getAttribute("role")==="button"&&r.removeAttribute("role"),r.removeAttribute("data-graview-press"),b.delete(r)};function W(r){for(let n of r.querySelectorAll("[data-act], [data-graview-press], [role], [aria-pressed], [aria-expanded]")){let d=b.get(n),o=w(n)&&!v(n)&&!g(n),i=!o&&S(n,d?.role?null:n.getAttribute("role"));if(d&&(d.bound!==o||!(o||i))&&L(n,d),(o||i)&&!b.has(n)){let e=!x(n),t=o&&M(n);e&&n.setAttribute("tabindex","0"),t&&n.setAttribute("role","button"),n.setAttribute("data-graview-press",""),b.set(n,{tab:e,role:t,bound:o})}}}var y=new WeakSet;function V(r){for(let n of r.querySelectorAll("svg")){let d=n.hasAttribute("role")||n.hasAttribute("aria-label")||n.hasAttribute("aria-labelledby")||[...n.children].some(e=>e.localName==="title"),o=n.hasAttribute("tabindex")||n.hasAttribute("data-graview-link")||n.hasAttribute("data-graview-press")||n.querySelector("[tabindex], [data-graview-link], [data-graview-press], a")!==null,i=!d&&!o;i&&!y.has(n)&&!n.hasAttribute("aria-hidden")?(n.setAttribute("aria-hidden","true"),y.add(n)):!i&&y.has(n)&&(n.removeAttribute("aria-hidden"),y.delete(n))}}var j=1e3;function I(r){let n=r.getAttribute("data-debounce")?.trim(),d=n?Number(n):Number.NaN;return Number.isFinite(d)?Math.min(1e4,Math.max(250,Math.round(d))):j}function B(r){let n=r.trusted??(e=>e.isTrusted),d=r.timers??{set:(e,t)=>setTimeout(e,t),clear:e=>clearTimeout(e)},o=new Map,i=(e,t)=>{let c=o.get(e);c&&d.clear(c.handle),o.delete(e);let u=r.reader.collect(e,t);u&&r.save(u,e)};return{heard(e,t,c){if(!g(t)||!n(e)||!t.hasAttribute("data-act"))return;let u=t.getAttribute("data-save");if(e.type==="input"&&u==="input"){let l=o.get(t);l&&d.clear(l.handle),o.set(t,{root:c,handle:d.set(()=>i(t,c),I(t))})}else e.type==="change"&&(u==="change"||u==="input"&&o.has(t))&&i(t,c)},flush(){for(let[e,{root:t}]of[...o])i(e,t)},get waiting(){return o.size}}}var H=new Set(["text","search","email","url","tel","number"]);function D(r,n,d,o){for(let i of r.querySelectorAll("input[data-prefill], textarea[data-prefill]")){let e=i;if(d.has(e))continue;let t=e.getAttribute("data-prefill")??"";if(t===""||e.getAttribute("name")!==t||e.localName==="input"&&!H.has(e.type))continue;if(e.value!==""){d.add(e);continue}let u=[...(e.closest("fieldset, [role='group']")??r).querySelectorAll("[data-act]")],l=e.closest("[data-record]"),a=new Set(u.map(p=>p.closest("[data-record]")?.getAttribute("data-record")).filter(p=>typeof p=="string")),s=l&&r.contains(l)?l.getAttribute("data-record"):a.size===1?[...a][0]:void 0;if(!s)continue;let f=o({record:s,field:t,acts:u.map(p=>p.getAttribute("data-act")??"")});if(f!==void 0){if(e.value=f,d.add(e),e.value!==f){e.value="";continue}n.prefilled(e,{record:s,field:t,value:f})}}}function _(r,n,d,o){let i=k(n,o.as);if(!i)return m("undeclared",`This view may not ask for \u201C${o.as}\u201D: its manifest does not name it.`);let e=r.allMutations().find(a=>a.name===i.act);if(!e)return m("unknown-act","There is no act by that name here.");let t={};if(o.record!==void 0){let a=i.record??e.subject?.arg;if(!a)return m("unbound",`\u201C${o.as}\u201D is not done to a record.`);if(!d.has(o.record))return m("unbound","That press is bound to a record this view was not shown.");t[a]=o.record}for(let[a,s]of Object.entries(i.constants??{})){if(a in t)return m("malformed",`\u201C${a}\u201D is both the bound record and a constant.`);t[a]=s}let c=e.input?.shape??{},u=new Set(Object.keys(c)),l=new Set;for(let a of o.fields)if(!(!u.has(a.name)||a.name in t)){if(l.has(a.name))return m("malformed",`Two fields here are called \u201C${a.name}\u201D.`);if(l.add(a.name),a.typed&&a.chosen){let s=P(c[a.name])?.find(f=>String(f)===String(a.value));if(s!==void 0)t[a.name]=s;else if(typeof a.value=="string"&&d.has(a.value))t[a.name]=a.value;else return m("untyped",`\u201C${a.name}\u201D was a choice among the view's own words, not one this app declares, so it was not sent.`)}else{if(a.typed&&a.from&&!(o.record===a.from.record&&a.name===a.from.field&&T(r,i,a.from.record,a.from.field)))return m("untyped",`\u201C${a.name}\u201D was filled in from a record for an act that writes it back there, not for this one, so it was not sent.`);if(a.typed&&a.from&&String(a.value)===a.from.value)t[a.name]=r.graph.getNode(a.from.record)?.[a.name]??a.value;else if(a.typed)t[a.name]=a.value;else if(!a.empty)return m("untyped",`\u201C${a.name}\u201D was filled in by the view, not typed by you, so it was not sent.`)}}return{ok:!0,name:i.act,args:t}}function T(r,n,d,o){let i=r.allMutations().find(u=>u.name===n.act),e=i?.subject;if(!i||!e||(n.record??e.arg)!==e.arg||o===e.arg||Object.hasOwn(n.constants??{},o)||!Object.hasOwn(i.input.shape??{},o)||Object.keys(i.writesOther??{}).length>0)return!1;let t=r.graph.getNode(d)?.kind,c=t===void 0?void 0:r.schema.tryDefinition(t);return!c||e.kinds!=="*"&&!e.kinds.includes(t)||!Object.hasOwn(c.fields.shape??{},o)?!1:i.writes?.includes(o)??!1}function C(r,n,d,o,i){if(!o.has(i.record))return;let e=r.seenBy(n).graph.getNode(i.record);if(!e||!i.acts.some(u=>{let l=k(d,u);if(!l||!T(r,l,i.record,i.field))return!1;let a=r.allMutations().find(s=>s.name===l.act).subject;return r.permits({name:l.act,args:{[a.arg]:i.record}},n).ok}))return;let c=e[i.field];return typeof c=="string"?c:typeof c=="number"&&Number.isFinite(c)?String(c):void 0}export{j as SAVE_DEBOUNCE_MS,F as createPressReader,B as createSaver,D as fillPrefills,_ as judgePress,W as markPresses,C as prefillOf,V as quietPictures,I as saveDebounceOf,T as writesBack};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Bc as E,Cc as G,Dc as F,Fc as J,Gc as W,lb as k,pb as O,qb as P,sb as h,tb as j}from"./chunk.4TJOS4C7.js";var I=(o,a)=>{let t=o.kindOf(a);return t===void 0?void 0:o.kept?.({id:a,kind:t})};function w(o,a){return o.flatMap(t=>{if(t.op!=="patch-node")return[t];let i=I(a,t.id);if(!i||!Object.keys(t.after).some(i))return[t];let c=r=>Object.fromEntries(Object.entries(r).filter(([f])=>!i(f))),s=c(t.after);return Object.keys(s).length===0?[]:[{op:"patch-node",id:t.id,before:c(t.before),after:s}]})}function _(o,a,t){if(!F(o,a))return t;let i=J(o,a),c=r=>o.graph.getNode(r)!==void 0||E(o.log).kindOf(r)!==void 0,s={...t};if(t.diff){let r=t.diff,f=G(o.log),l=o.log.length??o.log.all().length,u=t.ops?.[0]?.seq??l,x=k(a).id,y=(e,n)=>d=>f.writerAt(e,d,n),m=(e,n)=>i.shows(e.id)?i.servedWith(e,n):void 0,b=(e,n)=>e.flatMap(d=>m(d,n(d.id))??[]),S=e=>i.shows(e.from)&&i.shows(e.to)&&!h(e,i.sees),v=(e,n)=>t.ops?y(e,l):d=>n===void 0||n.includes(d)?x:f.writerAt(e,d,l),M=r.changedNodes.flatMap(e=>{let n=m(e.before,y(e.before.id,u)),d=m(e.after,v(e.after.id,e.fields));return n&&d?[{before:n,after:d,fields:e.fields.filter(p=>p in n||p in d)}]:[]}),D=new Set(r.changedNodes.map(e=>e.after.id)),g=new Map;for(let e of t.ops?.flatMap(n=>n.primitives)??t.primitives??[])e.op!=="patch-node"||D.has(e.id)||g.set(e.id,[...g.get(e.id)??[],...Object.keys(e.after)]);let B=[...g].flatMap(([e,n])=>{let d=o.graph.getNode(e);if(!d)return[];let p=m(d,y(e,u)),N=m(d,v(e,n));return p&&N&&JSON.stringify(p)!==JSON.stringify(N)?[{before:p,after:N,fields:n}]:[]});s.diff={addedNodes:b(r.addedNodes,e=>v(e)),removedNodes:b(r.removedNodes,e=>y(e,u)),changedNodes:[...M,...B],addedEdges:r.addedEdges.filter(S),removedEdges:r.removedEdges.filter(S),touched:[...r.touched.filter(i.shows),...[...g.keys()].filter(e=>i.shows(e)&&!r.touched.includes(e))]}}if(t.ops&&(s.ops=j(t.ops,i)),t.primitives){let r=s.ops;s.primitives=r?r.flatMap(f=>f.primitives):i.timeline?O(t.primitives,i.timeline,{served:(f,l)=>i.servedWith(f,l),edgeClean:f=>!h(f,i.sees),sees:i.sees},k(a).id):j([{id:"",seq:0,batch:"",author:{kind:"system"},intent:"",mutation:null,primitives:t.primitives,reads:[],writes:[],at:""}],i)[0].primitives}return i.kept&&s.primitives&&(s.primitives=w(s.primitives,i)),t.reads&&(s.reads=t.reads.filter(r=>i.shows(r)&&c(r))),t.writes&&(s.writes=t.writes.filter(i.shows)),t.intent!==void 0&&h(t.intent,i.sees)&&(s.intent=P),t.violationsAfter&&Object.assign(s,A?A(o,W(o,a),!!t.ops,s.primitives??[]):{introduces:[],resolves:[],violationsAfter:[]}),s}var A,z=o=>void(A=o);export{_ as a,z as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{c as $e,d as Pe,e as De}from"./chunk.7FRPNQU4.js";import{q as Ee}from"./chunk.NR5ODXMO.js";import{a as Je}from"./chunk.O45VO36H.js";import{d as Y}from"./chunk.SUPWMV2F.js";import{a as I}from"./chunk.MAFFUPCR.js";import{f as Me,g as Z,i as Ne}from"./chunk.KVJFY7N5.js";import{a as be}from"./chunk.DPHTUTOS.js";import{Ab as Ae,Ba as G,Da as me,Db as Oe,Fa as he,Ga as K,Gb as Re,Jb as B,K as fe,Mc as Te,Na as ye,Nc as _e,Oa as ge,Oc as xe,Ra as we,Xa as W,_a as ke,a as ue,ea as U,wb as Se,ya as pe,zb as ve}from"./chunk.4TJOS4C7.js";var E=(n,t,e)=>{(n[t]===void 0||e>n[t])&&(n[t]=e)},z=(n,t,e)=>{(n[t]===void 0||e<n[t])&&(n[t]=e)},X=(n,t)=>{n.format=t,t.includes("int")&&(n.isInt=!0)},ze=(n,t)=>{n.mime=n.mime?n.mime.filter(e=>t.includes(e)):[...t]},Ie=(n,t)=>{n.multipleOf??=[],n.multipleOf.includes(t)||n.multipleOf.push(t)},je=(n,t)=>(n.patterns??=new Set).add(t),nt={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function j(n){let t={},{def:e,bag:r}=n._zod,i=n._zod.traits.has("$ZodCheck")?[n,...e.checks??[]]:e.checks??[];for(let o of i){let a=o._zod.def;switch(a.check){case"greater_than":E(t,a.inclusive?"minimum":"exclusiveMinimum",a.value);break;case"less_than":z(t,a.inclusive?"maximum":"exclusiveMaximum",a.value);break;case"multiple_of":Ie(t,a.value);break;case"number_format":{X(t,a.format);let d=nt[a.format];d&&(E(t,"minimum",d[0]),z(t,"maximum",d[1]));break}case"bigint_format":X(t,a.format);break;case"min_length":case"min_size":E(t,"minimum",a.minimum);break;case"max_length":case"max_size":z(t,"maximum",a.maximum);break;case"length_equals":E(t,"minimum",a.length),z(t,"maximum",a.length);break;case"size_equals":E(t,"minimum",a.size),z(t,"maximum",a.size);break;case"string_format":X(t,a.format),a.pattern&&je(t,a.pattern),(a.format==="base64"||a.format==="base64url")&&(t.contentEncoding=a.format),(a.local||a.precision===-1)&&(t.laxFormat=!0);break;case"mime_type":ze(t,a.mime);break}}r.minimum!==void 0&&E(t,"minimum",r.minimum),r.exclusiveMinimum!==void 0&&E(t,"exclusiveMinimum",r.exclusiveMinimum),r.maximum!==void 0&&z(t,"maximum",r.maximum),r.exclusiveMaximum!==void 0&&z(t,"exclusiveMaximum",r.exclusiveMaximum),r.multipleOf!==void 0&&Ie(t,r.multipleOf),r.format!==void 0&&(t.format??=r.format,r.format.includes("int")&&(t.isInt=!0)),r.mime&&ze(t,r.mime);for(let o of r.patterns??[])je(t,o);return t}var it={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""};function L(n){let t=n._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?L(t.out):t.type==="catch"?L(t.innerType):n._zod.optin}var rt=new Set(["promise","optional","nonoptional","nullable","readonly","default","prefault","catch"]);function _(n,t=new Set){if(t.has(n))return!1;t.add(n);let e=n._zod.def,r=e.type;return r==="transform"?!0:r==="array"?_(e.element,t):r==="set"?_(e.valueType,t):r==="lazy"?_(e.getter(),t):rt.has(r)?_(e.innerType,t):r==="intersection"?_(e.left,t)||_(e.right,t):r==="record"||r==="map"?_(e.keyType,t)||_(e.valueType,t):r==="pipe"?n._zod.traits.has("$ZodCodec")||_(e.in,t)||_(e.out,t):r==="object"?Object.values(e.shape).some(i=>_(i,t)):r==="union"?e.options.some(i=>_(i,t)):r==="tuple"?e.items.some(i=>_(i,t))||(e.rest?_(e.rest,t):!1):!1}function ot(n){let t=Object.values(n).filter(e=>typeof e=="number");return Object.entries(n).filter(([e])=>t.indexOf(+e)===-1).map(([,e])=>e)}function Fe(n){let t=n.anyOf;if(!Array.isArray(t)||t.length===0||n.type!==void 0)return;let e=[];for(let r of t){if(!r||typeof r!="object")return;Fe(r);let i=Object.keys(r);if(i.length!==1||i[0]!=="type")return;for(let o of[r.type].flat()){if(typeof o!="string")return;e.includes(o)||e.push(o)}}delete n.anyOf,n.type=e.length===1?e[0]:e}var qe=new Set(["type","properties","required","additionalProperties"]),He=n=>{let t=n.additionalProperties;return t&&typeof t=="object"&&Object.keys(t).length?t:null},Le=(n,t)=>JSON.stringify(n)===JSON.stringify(t);function Q(n){for(let i of n){if(typeof i!="object"||i.type!=="object")return null;for(let o in i)if(!qe.has(o))return null}let t={},e=new Set;for(let i of n){for(let o in i.properties){if(Object.prototype.hasOwnProperty.call(t,o))continue;let a=[];for(let d of n){let s=d.properties?.[o]??He(d);s&&!a.some(g=>Le(g,s))&&a.push(s)}t[o]=a.length===1?a[0]:Q(a)??{allOf:a}}for(let o of i.required??[])e.add(o)}let r={type:"object",properties:t};if(e.size&&(r.required=[...e]),n.every(i=>i.additionalProperties===!1))r.additionalProperties=!1;else{let i=[];for(let o of n){let a=He(o);a&&!i.some(d=>Le(d,a))&&i.push(a)}i.length===1?r.additionalProperties=i[0]:i.length>1&&(r.additionalProperties={allOf:i})}return r}function at(n){let t=n.allOf;if(!Array.isArray(t)||t.length<2)return;for(let i of qe)if(i in n)return;let e=t.filter(i=>Array.isArray(i.oneOf)||Array.isArray(i.anyOf)),r;if(!e.length)r=Q(t);else{let i=e[0],o=Array.isArray(i.oneOf)?"oneOf":"anyOf";if(Object.keys(i).length!==1)return;let a=t.filter(s=>s!==i),d=i[o].map(s=>Q([...a,s]));if(d.some(s=>!s))return;r={[o]:d}}r&&(delete n.allOf,Object.assign(n,r))}function We(n){let t=n;for(let b of["anyOf","oneOf"]){let T=t[b];if(!Array.isArray(T))continue;let O=T.map(We);O.some((v,p)=>v!==T[p])&&(t={...t,[b]:O})}let e=[t.type].flat(),r=!e.includes("string")&&e.some(b=>b==="number"||b==="integer"),i=t.enum??(t.const!==void 0?[t.const]:void 0);if(!r&&!i?.some(b=>typeof b=="number"))return t;let{minimum:o,maximum:a,exclusiveMinimum:d,exclusiveMaximum:s,multipleOf:g,format:c,id:w,...h}=t;return h.enum?h.enum=h.enum.map(b=>typeof b=="number"?String(b):b):typeof h.const=="number"&&(h.const=String(h.const)),r&&(h.type="string",i||(h.pattern=e.includes("number")?"^-?\\d+(?:\\.\\d+)?$":"^-?\\d+$")),h}var C=class{constructor(t,e){this.override=t;this.refs=e}done=new Map;path=[];cyclic=new Map;write(t,e=!1){let r=this.refs.get(t);if(r!==void 0&&!e)return{$ref:r};if(this.path.includes(t))return this.cyclic.has(t)||this.cyclic.set(t,""),{};let i=this.done.get(t);if(i)return i;this.path.push(t);try{let o=this.written(t);return this.done.set(t,o),o}finally{this.path.pop()}}written(t){let e={},r,i=t._zod.toJSONSchema?.();i?Object.assign(e,i):r=this.process(t,e);let o=ue.get(t);if(o)for(let d of Object.keys(o))e[d]=o[d];_(t)&&(delete e.examples,delete e.default),"_prefault"in e&&(e.default??=e._prefault,delete e._prefault);let a=e;if(r){let d=this.write(r);a={...e};for(let s of Object.keys(d))s in e||(a[s]=d[s])}return this.override({zodSchema:t,jsonSchema:a}),Fe(a),t._zod.def.type==="intersection"&&at(a),a}process(t,e){let r=t._zod.def;switch(r.type){case"string":{e.type="string";let{minimum:i,maximum:o,format:a,patterns:d,contentEncoding:s,laxFormat:g}=j(t);if(typeof i=="number"&&(e.minLength=i),typeof o=="number"&&(e.maxLength=o),a&&(e.format=it[a]??a,(e.format===""||a==="time"||g)&&delete e.format),s&&(e.contentEncoding=s),d&&d.size>0){let c=[...d];c.length===1?e.pattern=c[0].source:e.allOf=c.map(w=>({pattern:w.source}))}return}case"number":{let{minimum:i,maximum:o,multipleOf:a,exclusiveMinimum:d,exclusiveMaximum:s,isInt:g}=j(t);if(e.type=g?"integer":"number",typeof d=="number"&&d>=(i??Number.NEGATIVE_INFINITY)?e.exclusiveMinimum=d:typeof i=="number"&&(e.minimum=i),typeof s=="number"&&s<=(o??Number.POSITIVE_INFINITY)?e.exclusiveMaximum=s:typeof o=="number"&&(e.maximum=o),a){let[c,...w]=new Set(a.filter(h=>Number.isFinite(h)&&h!==0).map(Math.abs));c!==void 0&&(e.multipleOf=c),w.length&&(e.allOf=[...e.allOf??[],...w.map(h=>({multipleOf:h}))])}return}case"boolean":case"success":e.type="boolean";return;case"null":e.type="null";return;case"never":e.not={};return;case"enum":{let i=ot(r.entries);i.length===0?e.not={}:(i.every(o=>typeof o=="number")&&(e.type="number"),i.every(o=>typeof o=="string")&&(e.type="string"),e.enum=i);return}case"literal":{let i=r.values.filter(o=>o!==void 0).map(o=>typeof o=="bigint"?Number(o):o);if(r.values.length===0)e.not={};else if(i.length===1)e.type=i[0]===null?"null":typeof i[0],e.const=i[0];else if(i.length>1){for(let o of["number","string","boolean"])i.every(a=>typeof a===o)&&(e.type=o);i.every(o=>o===null)&&(e.type="null"),e.enum=i}return}case"template_literal":e.type="string",e.pattern=t._zod.pattern.source;return;case"file":{e.type="string",e.format="binary",e.contentEncoding="binary";let{minimum:i,maximum:o,mime:a}=j(t);i!==void 0&&(e.minLength=i),o!==void 0&&(e.maxLength=o),a&&(a.length===0?e.not={}:a.length===1?e.contentMediaType=a[0]:e.anyOf=a.map(d=>({contentMediaType:d})));return}case"array":{let{minimum:i,maximum:o}=j(t);typeof i=="number"&&(e.minItems=i),typeof o=="number"&&(e.maxItems=o),e.type="array",e.items=this.write(r.element);return}case"object":{let i=r.shape;e.type="object";let o={};e.properties=o;for(let d in i)Object.defineProperty(o,d,{value:this.write(i[d]),writable:!0,enumerable:!0,configurable:!0});let a=Object.keys(i).filter(d=>L(i[d])===void 0);a.length>0&&(e.required=a),r.catchall?._zod.def.type==="never"?e.additionalProperties=!1:r.catchall&&(e.additionalProperties=this.write(r.catchall));return}case"union":e[r.inclusive===!1?"oneOf":"anyOf"]=r.options.map(i=>this.write(i));return;case"intersection":{let i=d=>"allOf"in d&&Object.keys(d).length===1,o=this.write(r.left),a=this.write(r.right);e.allOf=[...i(o)?o.allOf:[o],...i(a)?a.allOf:[a]];return}case"tuple":{let i=r.items;e.type="array",e.prefixItems=i.map(s=>this.write(s)),r.rest?e.items=this.write(r.rest):e.items=!1;let o=i.length;for(;o>0&&L(i[o-1])!==void 0;)o-=1;o>0&&(e.minItems=o),r.rest||(e.maxItems=i.length);let{minimum:a,maximum:d}=j(t);typeof a=="number"&&(e.minItems=a),typeof d=="number"&&(e.maxItems=d);return}case"record":{let i=r.keyType;e.type="object";let o=j(i).patterns;if(r.mode==="loose"&&o&&o.size>0){let d=this.write(r.valueType),s={};for(let g of o)s[g.source]=d;e.patternProperties=s}else e.propertyNames=We(this.write(i)),e.additionalProperties=this.write(r.valueType);let a=i._zod.values;if(a&&!r.partial&&L(r.valueType)===void 0){let d=[...a].filter(s=>typeof s=="string"||typeof s=="number");d.length>0&&(e.required=d.map(String))}return}case"nullable":e.anyOf=[this.write(r.innerType),{type:"null"}];return;case"default":case"prefault":{let i=r.defaultValue,o,a=!1,d=JSON.stringify(i,(s,g)=>typeof g=="bigint"?(a=!0,null):g);return!a&&d!==void 0&&(o=JSON.parse(d)),a||(e[r.type==="default"?"default":"_prefault"]=o),r.innerType}case"catch":{try{e.default=r.catchValue(void 0)}catch{}return r.innerType}case"readonly":return e.readOnly=!0,r.innerType;case"pipe":return r.in._zod.traits.has("$ZodTransform")?r.out:r.in;case"lazy":return t._zod.innerType;case"optional":case"nonoptional":case"promise":return r.innerType;default:return}}};function Be(n,t=()=>{}){let e=n,r=new C(t,new Map),i=r.write(e,!0);if(r.cyclic.size>0){let o=new Map,a=0,d=[];for(let g of r.cyclic.keys())if(g===e)o.set(g,"#");else{let c=`__schema${a++}`;o.set(g,`#/$defs/${c}`),d.push([g,c])}r=new C(t,o),i=r.write(e,!0);let s={};for(let[g,c]of d)s[c]=r.write(g,!0);d.length>0&&(i={...i,$defs:s})}return JSON.parse(JSON.stringify({$schema:"https://json-schema.org/draft/2020-12/schema",...i}))}function Ce(n){return Be(n,ct)}var st={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string"},dt={phone:"A phone number as it is written, like +1 555 123 4567 or 020 7946 0958 ext. 12.",place:"An address or a place's name, as a person would search a map for it.",duration:"A length of time in whole minutes: 90 is 1 h 30 min."};function ct(n){pe(n.zodSchema)&&(n.jsonSchema["x-graview-app-link"]=!0);let t=he(n.zodSchema);if(t&&(n.jsonSchema.type==="string"||n.jsonSchema.type==="array")){n.jsonSchema["x-graview-linked"]={address:t.address,kinds:[...t.kinds],cardinality:t.cardinality};let s=t.kinds.join(" or "),g=`${t.cardinality==="many"?"Records":"A record"}: a ${s} in the app ${t.address}, as "${t.kinds[0]}:<id>" \u2014 an id found there with find_linked. Linking never changes that app.`,c=n.jsonSchema.description;typeof c=="string"&&c.includes(g)||(n.jsonSchema.description=`${typeof c=="string"&&c?`${c.replace(/\.?$/,".")} `:""}${g}`)}if(we(n.zodSchema)&&(n.jsonSchema["x-graview-repeat"]=!0,!n.jsonSchema.type&&!n.jsonSchema.anyOf&&!n.jsonSchema.oneOf&&Object.assign(n.jsonSchema,lt())),be(n.zodSchema)){n.jsonSchema.contentMediaType="text/markdown";let s=n.jsonSchema.description;typeof s=="string"&&s.endsWith("Written in Markdown.")||(n.jsonSchema.description=`${typeof s=="string"&&s?`${s.replace(/\.?$/,".")} `:""}Written in Markdown.`)}let e=Re(n.zodSchema);if(e){let s=n.jsonSchema;s["x-graview-type"]=e,e==="duration"&&(s["x-graview-unit"]="minutes"),s.description??=dt[e]}let r=Oe(n.zodSchema,!1);if(r){let s=Me(r);n.jsonSchema["x-graview-format"]=s.format??"unit",s.currency&&(n.jsonSchema["x-graview-currency"]=s.currency),s.unit&&s.format!=="money"&&(n.jsonSchema["x-graview-unit"]=s.unit);let g=n.jsonSchema.description;n.jsonSchema.description=typeof g=="string"&&g.length>0?`${g} ${Z(s)}`:Z(s)}let i=n.zodSchema._zod?.def;if(!i||i.type!=="string"||typeof i.format!="string"||i.format==="regex")return;let o=n.jsonSchema,a=(i.checks??[]).map(s=>s._zod?.def).filter(s=>s?.format==="regex"&&s.pattern instanceof RegExp).map(s=>s.pattern.source);delete o.pattern;let d=o.allOf;Array.isArray(d)&&d.every(s=>typeof s=="object"&&s!==null&&Object.keys(s).length===1&&"pattern"in s)&&delete o.allOf,o.format=st[i.format]??i.format,a.length===1?o.pattern=a[0]:a.length>1&&(o.allOf=a.map(s=>({pattern:s})))}function ee(n){let t=B(n.input),e=Ce(n.input),r=e.properties??{};if(ve(n)){let i=n.creates.join(" | ");r.id={type:"string",minLength:1,description:`Optional: the id for the ${i} this makes. Refused if the graph already has it; left out, one is minted from the label.`},e.properties=r}Ae(n)&&(e.additionalProperties=!1);for(let i of t){let o=r[i.name];if(!o)continue;let a=i.kinds.includes("*")?"any node kind":i.kinds.join(" | ");o.description=[o.description,`Id of a node (${a}).`].filter(Boolean).join(" ")}return{name:n.name,...n.title===void 0?{}:{title:n.title},description:n.description??n.title??n.name,inputSchema:e,nodeRefs:t}}function lt(){let n={type:"string",pattern:"^\\d{4}-\\d{2}-\\d{2}$"},t=(e,r)=>({type:"integer",minimum:e,maximum:r});return{type:"object",description:'How the date beside it repeats; the date is the first occurrence. "on" is weekdays for "week", days of the month (-1 the last) for "month".',properties:{every:{type:"string",enum:[...ge]},interval:t(1,99),on:{type:"array",minItems:1,maxItems:31,items:{anyOf:[{type:"string",enum:[...ye]},t(-1,31)]}},until:n,count:t(1,1e3),except:{type:"array",maxItems:500,items:n},continues:{type:"string",maxLength:200}},required:["every"],additionalProperties:!1}}function Ve(n){let t=new Set;for(let e=n;e;e=e.onBehalfOf)e.id!==void 0&&t.add(`${e.kind}:${e.id}`);return t}function V(n,t){let e=Ve(t),r=c=>{if(c.kind==="rule")return!1;let w=Ve(c);if(w.size===0)return!1;for(let h of w)if(e.has(h))return!1;return!0},i,o=()=>{if(i)return i;i=new Map;for(let c of n.log.live()){if(c.undoes!==void 0)continue;let w=r(c.author)?c.author:void 0;for(let h of c.primitives){h.op==="remove-node"&&i.delete(h.node.id);let b=h.op==="add-node"?h.node.id:h.op==="patch-node"?h.id:void 0;if(b===void 0)continue;let T=h.op==="add-node"?Object.keys(h.node):Object.keys(h.after),O=i.get(b);(h.op==="add-node"||!O)&&i.set(b,O=new Map);for(let v of T)v==="id"||v==="kind"||(w?O.set(v,w):O.delete(v))}}return i},a=n.schema,d=new Map,s=(c,w)=>{let h=`${c}\0${w}`,b=d.get(h);if(b===void 0){let T=a.tryDefinition(c)?.fields?.shape;b=T!==void 0&&w in T&&Ne(T[w]).type==="text",d.set(h,b)}return b},g=c=>n.graph.getNode(c)?.kind;return{prose:s,say:c=>W(c,{graph:n.graph,schema:a}),fieldBy(c,w){let h=g(c);if(!(h===void 0||!s(h,w)))return o().get(c)?.get(w)},recordBy(c){let w=g(c),h=o().get(c);if(w===void 0||!h)return;let b;for(let[T,O]of h)s(w,T)&&(b=O);return b}}}var te=(n,t,e)=>({untrusted:!0,authoredBy:e.say(t),text:n}),ut="the host's ranker";function Ue(n,t){return{...n,hits:n.hits.map(e=>{if(e.about!=="node")return e;e.why.by==="meaning"&&e.why.matched!==void 0&&(e={...e,why:{...e.why,matched:{untrusted:!0,authoredBy:ut,text:e.why.matched}}});let r=t.recordBy(e.id);if(!r)return e;let i=t.prose(e.kind,e.why.field)?t.fieldBy(e.id,e.why.field):r;return{...e,label:te(e.label,r,t),...e.apart!==void 0?{apart:te(e.apart,r,t)}:{},why:i?{...e.why,fragment:te(e.why.fragment,i,t)}:e.why}})}}var ne=(n,t,e)=>({title:n,readOnlyHint:t,destructiveHint:!1,idempotentHint:e,openWorldHint:!1}),ft={name:"subscribe",title:"Notify me when something happens",description:`Subscribe the person you act for to be told when something happens in this app \u2014 their host delivers it (an email, a push). on is one of: "act" (an act runs; give act, its declared name, and/or record), "created" (a record of kind is added), "changed" (a record of kind, or the one record, changes), "reaches" (a record of kind, or the one record, comes to satisfy condition, an expression in the app's rule language such as done == true or amount > 100). They are told only of changes someone else made, unless alsoMine is true, and only of records they may see. Returns the subscription and its sentence. Changes nothing in the app.`,inputSchema:{type:"object",properties:{on:{type:"string",enum:["act","created","changed","reaches"],description:"What to be told of."},act:{type:"string",description:"An act's declared name, for on: act."},kind:{type:"string",description:"A kind, for created, changed and reaches."},record:{type:"string",description:"One record, by id or name: for act, changed and reaches."},condition:{type:"string",description:"For reaches: what the record should come to satisfy, in the rule language (done == true)."},alsoMine:{type:"boolean",description:"Also when the person themselves made the change; false when unsaid."}},required:["on"],additionalProperties:!1},mutating:!1,annotations:ne("Notify me when something happens",!1,!1)},pt={name:"unsubscribe",title:"Stop notifying me",description:"Take away one of the person's subscriptions, by the id list_subscriptions or subscribe answered. Changes nothing in the app.",inputSchema:{type:"object",properties:{id:{type:"string",description:"The subscription's id."}},required:["id"],additionalProperties:!1},mutating:!1,annotations:ne("Stop notifying me",!1,!0)},mt={name:"list_subscriptions",title:"What I am notified of",description:`List what the person you act for is told of in this app: each subscription's id and its sentence ("When someone else adds a task").`,inputSchema:{type:"object",properties:{},additionalProperties:!1},mutating:!1,annotations:ne("What I am notified of",!0,!0)},ie=[ft,pt,mt];var q=n=>{let t;return()=>t??=n().catch(e=>{throw t=void 0,e})},ht=q(()=>(__graviewPreload(import.meta.url,["./chunk.GTPC6JOW.js","./chunk.NQZ73QV7.js","./chunk.SUPWMV2F.js","./chunk.TPG6IY4M.js","./chunk.NFDLCUCC.js","./chunk.X7JMJSLU.js","./chunk.PPRSGM64.js","./chunk.5Y3Q7ONN.js","./chunk.KTFUVR4V.js","./chunk.KVJFY7N5.js","./chunk.DPHTUTOS.js","./chunk.4TJOS4C7.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.FQYOTK34.js"))),yt=()=>(__graviewPreload(import.meta.url,["./chunk.MAFFUPCR.js","./chunk.PPRSGM64.js","./chunk.5Y3Q7ONN.js","./chunk.KTFUVR4V.js","./chunk.4TJOS4C7.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.PQVUQVRL.js")).catch(()=>{}),gt=async()=>{(await yt())?.judgeWithLines()},F=q(()=>(__graviewPreload(import.meta.url,["./chunk.WVUJXDXZ.js","./chunk.TPG6IY4M.js","./chunk.NFDLCUCC.js","./chunk.X7JMJSLU.js","./chunk.PPRSGM64.js","./chunk.5Y3Q7ONN.js","./chunk.KTFUVR4V.js","./chunk.DPHTUTOS.js","./chunk.4TJOS4C7.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.ODRL5OWR.js"))),wt=q(()=>(__graviewPreload(import.meta.url,["./chunk.7LL7OSBY.js","./chunk.G4JJXA63.js","./chunk.E5GM2SMO.js","./chunk.NQZ73QV7.js","./chunk.NX7IIZLO.js","./chunk.XOZU4OFA.js","./chunk.SUPWMV2F.js","./chunk.Q5WEOX3Q.js","./chunk.4GQA3AJU.js","./chunk.HG4DDNPG.js","./chunk.MAFFUPCR.js","./chunk.WVUJXDXZ.js","./chunk.TPG6IY4M.js","./chunk.NFDLCUCC.js","./chunk.X7JMJSLU.js","./chunk.PPRSGM64.js","./chunk.5Y3Q7ONN.js","./chunk.KTFUVR4V.js","./chunk.N4M54YK6.js","./chunk.KVJFY7N5.js","./chunk.DPHTUTOS.js","./chunk.4TJOS4C7.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.ZXZNAG35.js"))),bt=q(()=>(__graviewPreload(import.meta.url,["./chunk.DAUC2DFY.js","./chunk.GTPC6JOW.js","./chunk.NQZ73QV7.js","./chunk.O45VO36H.js","./chunk.UT6642FC.js","./chunk.SUPWMV2F.js","./chunk.TPG6IY4M.js","./chunk.NFDLCUCC.js","./chunk.X7JMJSLU.js","./chunk.PPRSGM64.js","./chunk.5Y3Q7ONN.js","./chunk.KTFUVR4V.js","./chunk.N4M54YK6.js","./chunk.KVJFY7N5.js","./chunk.DPHTUTOS.js","./chunk.4TJOS4C7.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.V3N34DSU.js"))),kt=q(()=>(__graviewPreload(import.meta.url,["./chunk.QII2C5OV.js","./chunk.PPRSGM64.js","./chunk.5Y3Q7ONN.js","./chunk.KTFUVR4V.js","./chunk.4TJOS4C7.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.DFK2NA6L.js"))),St=n=>n.definitions.some(t=>K(t).size>0),Ge=n=>({value:G(n),label:n.label,...n.describe?{describe:n.describe}:{},...n.card?{card:n.card}:{},fields:n.fields,...n.app?{app:n.app}:{}});async function vt(n,t,e,r){let i=String(e.relation??""),[o,a]=i.includes(".")?i.split(".",2):[void 0,i],d=n.schema.definitions.flatMap(v=>[...K(v)].map(([p,f])=>({kind:v.kind,name:p,relation:f}))),s=d.filter(v=>v.name===a&&(o===void 0||v.kind===o));if(s.length!==1){let v=d.map(p=>`${p.kind}.${p.name}`).join(", ")||"none";return{ok:!1,error:`${s.length===0?`No relation to another app is called "${i}"`:`"${i}" names a relation of several kinds`}. The relations to other apps are: ${v}.`}}let{kind:g,name:c,relation:w}=s[0];if(!r)return{ok:!1,error:`This seat cannot read ${w.address}: its host reads no other app's records. Nothing was changed.`};let h={kind:t.kind,...t.id===void 0?{}:{id:t.id},...t.roles?{roles:t.roles}:{}},b=typeof e.of=="string"?e.of:void 0;if(b!==void 0){let v=n.graph.getNode(b);if(!v||v.kind!==g)return{ok:!1,error:`No ${g} "${b}".`};let p=me(v[c],w),f=await Promise.all(p.map(k=>Promise.resolve().then(()=>r.resolve(k,h)).catch(()=>null)));return{ok:!0,data:{relation:`${g}.${c}`,app:w.address,records:f.map((k,S)=>k===null?{value:G(p[S]),missing:!0}:"denied"in k?{denied:!0,said:"linked record (no access)"}:Ge(k))},reads:[b]}}let T=typeof e.limit=="number"&&e.limit>0?Math.min(e.limit,20):20,O=await Promise.resolve().then(()=>r.find({address:w.address,kinds:w.kinds,query:String(e.query??""),limit:T},h)).catch(()=>[]);return Array.isArray(O)?{ok:!0,data:{relation:`${g}.${c}`,app:w.address,records:O.map(Ge),link:`edit-${g} with ${c} set to a record's value`}}:{ok:!0,data:{relation:`${g}.${c}`,app:w.address,denied:!0,said:"linked record (no access)"}}}var M=n=>({title:n,readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}),Ke={description:'Which records: false (the default) the live ones, true only the archived ones, "all" both. An archived record is set aside, not gone: unarchive-<kind> brings it back.',anyOf:[{type:"boolean"},{type:"string",enum:["all"]}]},re={type:"number",description:"Where the page starts; 0 when unsaid."},se=[{name:"search_graph",title:"Find by name",description:"Find things by name: records whose name or readable fields carry the words, and the kinds, places and rules the words name \u2014 each with why it matched. Reach for this before get_graph when you know what something is called. Words match the start of words, case and accents aside; key:value tokens narrow as a list's filter does (done:false, is:any for past records, kind:<kind>). Pass subject (a node id) to get the acts you may run on it as hits too. When few records match exactly, records with a near word follow \u2014 a typo, another form of the word, a meaning \u2014 each with near: true and why.matched, the record's own word that answered.",inputSchema:{type:"object",properties:{query:{type:"string",description:"Words, with optional key:value conditions."},limit:{type:"number",description:"Most hits to return; at most 20."},subject:{type:"string",description:"A node id whose acts to include."},archived:Ke},required:["query"],additionalProperties:!1},mutating:!1,annotations:M("Find by name")},{name:"get_graph",title:"Read the graph",description:"Read the graph, 25 nodes a page: their fields, the edges out of them, and how many more. Start here when you need the shape of the domain rather than one thing in it.",inputSchema:{type:"object",properties:{offset:re,archived:Ke},additionalProperties:!1},mutating:!1,annotations:M("Read the graph")},{name:"get_node",title:"Read one node",description:"Read one node: its fields, its links (id, kind and label, 20 each way a page), the violations that implicate it, and its computed values: read-only fields worked out from what you can see, which no act sets. Use this to check a thing before you change it.",inputSchema:{type:"object",properties:{id:{type:"string",description:"A node's id, or its name."},offset:re},required:["id"],additionalProperties:!1},mutating:!1,annotations:M("Read one node")},{name:"get_violations",title:"List the problems",description:"List the invariant violations the graph currently has, 20 a page, with the repairs that would resolve each one. Read this before proposing work: a rule that is already broken is more urgent than anything you could add.",inputSchema:{type:"object",properties:{offset:re,context:{type:"object",description:"Evaluation context, e.g. { weekStart }."}},additionalProperties:!1},mutating:!1,annotations:M("List the problems")},{name:"get_affordances",title:"Ask what can be done",description:"Ask what can legally be done with a selection, ranked. Prefer these over composing a mutation by hand: they are derived from the schema, the invariants and the shape of the graph, so they cannot name an action that does not exist.",inputSchema:{type:"object",properties:{selection:{type:"array",items:{type:"string"},description:"Node ids."},context:{type:"object"}},required:["selection"],additionalProperties:!1},mutating:!1,annotations:M("Ask what can be done")},{name:"describe_place",title:"Say what a place shows",description:`Say what one place of the app shows you, as a person in your seat would see it: its headings, its figures as drawn, its lists with each record's title and what its card or row says, the headings a list is grouped under, what an empty list says, the forms it offers (each field in the order asked, its label, whether it must be answered, what it takes and its choices), and any block that could not be worked out. Pass a place's slug ("home", a lens's address like "the-offers", a kind's like "offers"), a record's id, or a visitor form's "forms/<name>", and width 390 for a phone. Use it after a change to check what somebody now sees, instead of guessing.`,inputSchema:{type:"object",properties:{place:{type:"string",description:`"home", a place's slug, a record's id, or "forms/<name>" for a visitor form.`},width:{type:"number",description:"The screen's width in CSS pixels; 390 is a phone, 1440 when unsaid."}},required:["place"],additionalProperties:!1},mutating:!1,annotations:M("Say what a place shows")},{name:"preview_mutation",title:"Try an act without applying it",description:"Try a mutation without applying it: get back the diff it would produce and any invariant it would break. Do this when you are unsure, rather than applying and undoing.",inputSchema:{type:"object",properties:{mutation:{type:"string"},args:{type:"object"}},required:["mutation","args"],additionalProperties:!1},mutating:!1,annotations:M("Try an act without applying it")},{name:"undo_batch",title:"Undo a batch",description:"Undo one batch of operations. Fails, naming the blocking operation, when a later operation read what it wrote.",inputSchema:{type:"object",properties:{batch:{type:"string"},include:{type:"array",items:{type:"string"}}},required:["batch"],additionalProperties:!1},mutating:!0,annotations:{title:"Undo a batch",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!1}},{name:"list_suggestions",title:"List what is suggested",description:"List the suggestions waiting for a person: changes the app's own actor proposed and did not make, each with its id, what it would do, who suggested it, what it was based on and how sure (0 to 1). Nothing changes until one is accepted (accept_suggestion) or declined (decline_suggestion); a declined one is never suggested again.",inputSchema:{type:"object",properties:{},additionalProperties:!1},mutating:!1,annotations:M("List what is suggested")},{name:"accept_suggestion",title:"Accept a suggestion",description:"Make a waiting suggestion's change, as this seat, carrying what it was based on. Returns the batch (undo_batch takes it back).",inputSchema:{type:"object",properties:{suggestion:{type:"string",description:"The suggestion's id, from list_suggestions."}},required:["suggestion"],additionalProperties:!1},mutating:!0,annotations:{title:"Accept a suggestion",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1}},{name:"decline_suggestion",title:"Decline a suggestion",description:"Decline a waiting suggestion: nothing changes, the decline is kept in the log, and the same change is never suggested or made by the app's own actor again.",inputSchema:{type:"object",properties:{suggestion:{type:"string",description:"The suggestion's id, from list_suggestions."}},required:["suggestion"],additionalProperties:!1},mutating:!0,annotations:{title:"Decline a suggestion",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}}],Ye={name:"act_on_several",title:"Do one act to several records",description:`Run one act on several records at once, as one change with one undo. act is the act (its tool name or its declared name), records the records it runs on (ids or names; each goes in the act's subject), args what every call shares ("Set stage to Declined" is args { stage: "declined" }). Each record is judged on its own: one this seat may not change is named with why, and the rest still apply. Returns the batch (undo_batch takes it all back), the records changed, those already so, and those refused.`,inputSchema:{type:"object",properties:{act:{type:"string",description:"The act to run on each record."},records:{type:"array",items:{type:"string"},minItems:1,maxItems:200,description:"Ids or names of the records."},args:{type:"object",description:"Arguments every call shares, besides the record."}},required:["act","records"],additionalProperties:!1},mutating:!0,annotations:{title:"Do one act to several records",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!1}},de={type:"object",description:"A lens, as draft_view returns one.",properties:{title:{type:"string"},lens:{type:"string"},on:{type:"string"},bindings:{type:"object"},options:{type:"object"}},required:["title","lens","on"]},ce={name:"draft_view",title:"Draw a view",description:'Draw a view of the data from words ("a board of tasks by status", "who covers what") as a lens the app could keep; or check a lens you wrote (lens); or change the one on screen (current, with ask: "only this month"). Returns the lens and its add-lens edit, or one sentence saying why not. Writes nothing.',inputSchema:{type:"object",properties:{ask:{type:"string",description:"What to see, in words."},lens:de,current:de},additionalProperties:!1},mutating:!1,annotations:M("Draw a view")},Xe={name:"keep_lens",title:"Keep a view as a lens",description:"Keep a lens draft_view drew as one of the app's places: checked again, then written as the add-lens edit. Returns the remove-lens edit that takes it back.",inputSchema:{...de,additionalProperties:!1},mutating:!0,annotations:{title:"Keep a view as a lens",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}},Qe={name:"find_linked",title:"Find a record in another app",description:`A relation may go to a kind in another app (describe_app lists them under "Linked from other apps"). With relation and words, list the records there this seat may link \u2014 each with the value to link it by ("house:h1"), its name and its describe line. With of (a record id here), read the records that record links, as this seat may see them there. Linking one is the record's edit (edit-<kind>) with the relation set to the value. Another app this seat may not open answers denied, and nothing of it. Writes nothing; never changes the other app.`,inputSchema:{type:"object",properties:{relation:{type:"string",description:"The relation, by name (forHouse) or as <kind>.<relation> (scenario.forHouse)."},query:{type:"string",description:"Words to find by, in the other app's names; empty for the first few."},of:{type:"string",description:"A record here whose linked records to read, instead of finding."},limit:{type:"number",description:"Most records to return; at most 20."}},required:["relation"],additionalProperties:!1},mutating:!1,annotations:M("Find a record in another app")};function At(n,t){return n===void 0?[]:n==="keep"&&!t?[ce,Xe]:[ce]}var Ot="An argument that names a record takes its id or its name.",et=[...se.map(n=>n.name),Ye.name,ce.name,Xe.name,Qe.name,...ie.map(n=>n.name)],tt=64;function N(n){let{line:t,...e}=n;return e}function Ze(n){return{...n,...n.introduces?{introduces:n.introduces.map(N)}:{},...n.resolves?{resolves:n.resolves.map(N)}:{},...n.violationsAfter?{violationsAfter:n.violationsAfter.map(N)}:{}}}function Rt(n){let t=n.normalize("NFKD").replace(/\p{M}/gu,"").replace(/[^A-Za-z0-9_-]/g,"_");return t.length===0&&(t="act"),/^[A-Za-z_]/.test(t)||(t=`act_${t}`),t.slice(0,tt)}function Tt(n){let t=new Set(et),e=new Map;for(let r of n){let i=Rt(r),o=i;for(let a=2;t.has(o);a+=1)o=`${i.slice(0,tt-`_${a}`.length)}_${a}`;t.add(o),e.set(r,o)}return e}function _t(n,t){if(t.size===0)return n;let e=Object.fromEntries(Object.entries(n.properties??{}).filter(([i])=>!t.has(i))),r=(n.required??[]).filter(i=>!t.has(i));return{...n,properties:e,...n.required?{required:r}:{}}}function xt(n,t,e){let r=ee(n),i=U(n),o=r.nodeRefs.length>0?`${r.description}${/[.!?]$/.test(r.description)?"":"."} ${Ot}`:r.description;return{name:t,title:i,description:o,inputSchema:_t(r.inputSchema,e),mutating:!0,annotations:{title:i,readOnlyHint:!1,destructiveHint:n.destructive===!0||(n.severs?.length??0)>0,idempotentHint:n.idempotent===!0,openWorldHint:!1},act:n.name}}function le(n){if(n===null||typeof n!="object")return JSON.stringify(n)??"null";if(Array.isArray(n))return`[${n.map(le).join(",")}]`;let t=n;return`{${Object.keys(t).filter(e=>t[e]!==void 0).sort().map(e=>`${JSON.stringify(e)}:${le(t[e])}`).join(",")}}`}function Mt(n){return`sha256:${Te(le(n))}`}function Nt(n,t,e,r,i,o=!1,a=!1){let d=Tt(n.map(c=>c.name)),s=[...At(r,e),...o?[Qe]:[],...a?ie:[]];return{definitions:e?[...se.filter(c=>!c.mutating),...s]:[...se,Ye,...s,...n.filter(c=>t.has(c.name)).map(c=>xt(c,d.get(c.name),i(c)))],names:d}}function mn(n,t={}){let e=t.author??{kind:"agent"},r=n.allMutations(),i=new Set(n.permittedMutations(e).map(p=>p.name)),{definitions:o,names:a}=Nt(r,i,t.readOnly===!0,t.drafts?t.drafts.keep?"keep":"draw":void 0,p=>Y(n.schema,n.policy,e,p),St(n.schema),t.subscriptions!==void 0),d=Mt(o),s={app:t.app?.brand?.locale,appTimeZone:t.app?.brand?.timeZone},g=p=>fe(s,p),c=p=>{if(!et.includes(p)){for(let[f,k]of a)if(k===p)return f;return a.has(p)?p:_e(p,a.keys())}},w=p=>{let f=xe(p,a.keys());return f?` Did you mean "${f}"?`:""},h=p=>{let f=o.find(S=>S.name===p)??o.find(S=>S.act===p);if(f)return f;let k=c(p);return k===void 0?void 0:o.find(S=>S.act===k)},b=(p,f)=>{let k=r.find(l=>l.name===p);if(!k)return{args:f,resolved:[]};let S={...f},u=[];for(let l of B(k.input)){let m=S[l.name];if(typeof m!="string"||m.trim()==="")continue;let y=n.resolveRef(l,m,e);if(!y.ok){let A=y.reason==="none"?` Nothing was changed. Use search_graph to look it up, then pass its id as ${l.name}.`:" Nothing was changed.";return{ok:!1,error:`${y.message}${A}`,argument:l.name,candidates:y.candidates}}y.by!=="id"&&(S[l.name]=y.id,u.push({argument:l.name,given:m,id:y.id,label:y.label}))}return{args:S,resolved:u}},T=async(p,f)=>{try{await gt();let k=h(p);if(!k){let u=c(p);if(u){let l=n.permits({name:u,args:f},e);if(!l.ok)return{ok:!1,error:l.refusal.message,reason:"forbidden"}}return{ok:!1,error:`Unknown tool "${p}".${w(p)} Available: ${o.map(l=>l.name).join(", ")}`}}if(k.mutating&&t.readOnly)return{ok:!1,error:`"${p}" changes the graph, and this seat is read-only.`,reason:"forbidden"};if(k.act!==void 0){let u=b(k.act,f);if("ok"in u)return u;let l=k.act,m=g(()=>I(n,e,n.apply({name:l,args:u.args},{...t.author?{author:t.author}:{},...oe(t.via)})));return{ok:!0,data:{batch:m.batch,intent:m.intent,introduces:m.introduces.map(N),resolves:m.resolves.map(N),...u.resolved.length>0?{resolved:u.resolved}:{}},diff:m.diff}}let S=n.seenBy(e);switch(k.name){case"search_graph":{let u=typeof t.places=="function"?t.places():t.places,l=typeof f.subject=="string"?f.subject:void 0,m=Ee(S,String(f.query??""),{principal:e,rank:t.near,archived:ke(f.archived),limit:typeof f.limit=="number"&&f.limit>0?Math.min(f.limit,20):20,...u?{places:u}:{},...l?{subject:l,from:[l]}:{}}),y=m.later?await m.later:m;return{ok:!0,data:(await F()).searchRead(y,Ue(y,V(S,e))),reads:y.hits.flatMap(A=>A.about==="node"?[A.id]:[])}}case"get_graph":return{ok:!0,...(await F()).graphRead(S,V(S,e),f)};case"get_node":{let u=String(f.id??""),l=u,m;if(!S.graph.getNode(u)){let A=u.trim()===""?void 0:n.resolveRef({name:"id",kinds:["*"]},u,e);if(A?.ok)l=A.id,m={argument:"id",given:u,id:l,label:A.label};else return A?.reason==="ambiguous"?{ok:!1,error:A.message,argument:"id",candidates:A.candidates}:{ok:!1,error:`No node "${u}".`}}let y=(await F()).nodeRead(S,V(S,e),l,f);return{ok:!0,data:m?{...y.data,resolved:[m]}:y.data,reads:y.reads}}case"describe_place":{let u=t.app??{name:"",schema:n.schema},l=typeof f.width=="number"&&Number.isFinite(f.width)&&f.width>0?f.width:1440,{describePlace:m}=await ht(),y=m(n,e,String(f.place??""),{app:u,width:l});if(!y.ok)return{ok:!1,error:`${y.error} The places are: ${y.places.join(", ")}.`};let A=new Set,$=H=>{for(let D of H)for(let x of D.groups??[])for(let P of x.items)A.add(P.id),$(P.parts)};return $(y.description.parts),{ok:!0,data:y.description,reads:[...A]}}case"find_linked":return vt(S,e,f,t.linked);case"draft_view":case"keep_lens":{let u=t.app??{name:"",schema:n.schema};return(await wt()).runDraftTool(k.name,f,{app:u,principal:e,...t.drafts?{drafts:t.drafts}:{}})}case"get_violations":{let u=S.violations(f.context);return{ok:!0,...(await F()).violationsRead(u,f)}}case"get_affordances":{let u=f.selection??[];return{ok:!0,data:Je(S,u,{...typeof t.derive=="function"?t.derive():t.derive,...t.author?{principal:t.author}:{},...f.context?{context:f.context}:{}}),reads:u.filter(m=>S.graph.has(m))}}case"preview_mutation":{let u=String(f.mutation),l=c(u)??u,m=b(l,f.args??{});if("ok"in m)return m;let y=n.missingFor({name:l,args:m.args},e);if(y)return{ok:!1,error:y.message,reason:"missing"};let A=I(n,e,n.preview({name:l,args:m.args},void 0,{author:e})),$=Ze(A);return{ok:!0,data:m.resolved.length>0?{...$,resolved:m.resolved}:$}}case"act_on_several":{let u=String(f.act??""),l=c(u)??u,m=r.find(R=>R.name===l);if(!m||!i.has(l)){let R=m?n.permits({name:l,args:{}},e):void 0;return R&&!R.ok?{ok:!1,error:R.refusal.message,reason:"forbidden"}:{ok:!1,error:`There is no act "${u}" this seat may run.${w(u)} Nothing was changed.`,reason:"invalid"}}let y=m.subject;if(!y)return{ok:!1,error:`"${U(m)}" does not act on a record, so it cannot be run on several. Nothing was changed.`,reason:"invalid"};let A=Array.isArray(f.records)?f.records.filter(R=>typeof R=="string"&&R.trim()!==""):[];if(A.length===0)return{ok:!1,error:"Name at least one record. Nothing was changed.",reason:"invalid"};let $=[],H=[];for(let R of A.slice(0,200)){let J=n.resolveRef({name:y.arg,kinds:y.kinds},R,e);if(!J.ok)return{ok:!1,error:`${J.message} Nothing was changed.`,argument:"records",candidates:J.candidates};$.push(J.id),J.by!=="id"&&H.push({argument:"records",given:R,id:J.id,label:J.label})}let D=b(l,{...f.args??{}});if("ok"in D)return D;let x=(await bt()).actOnSeveral(n,{mutation:l,subject:y.arg,args:D.args},$,{author:e,...oe(t.via)}),P=x.result?I(n,e,x.result):void 0;return{ok:!0,data:{...x.batch?{batch:x.batch,intent:x.intent}:{},applied:x.applied,unchanged:x.unchanged,refused:x.refused.map(R=>({record:R.id,label:R.label,error:R.message,reason:R.reason})),...x.allOrNothing?{keptNone:!0}:{},...P?{introduces:P.introduces.map(N),resolves:P.resolves.map(N)}:{},...H.length>0||D.resolved.length>0?{resolved:[...H,...D.resolved]}:{}},...P?{diff:P.diff}:{}}}case"subscribe":case"unsubscribe":case"list_subscriptions":{let u=await(await kt()).runSubscriptionTool(k.name,f,{store:n,principal:t.subscriber??e,app:t.app?.name??"app",subscriptions:t.subscriptions});return u.ok?{ok:!0,data:u.data}:{ok:!1,error:u.error}}case"list_suggestions":{let u=$e(n,e).map(l=>{let m=W(l.author,{graph:S.graph,schema:n.schema});return{id:l.id,intent:l.intent,by:m,at:l.at,about:l.about,...l.lineage?{basis:{untrusted:!0,authoredBy:m,text:l.lineage.basis},...l.lineage.confidence!==void 0?{confidence:l.lineage.confidence}:{}}:{}}});return{ok:!0,data:{suggestions:u},reads:[...new Set(u.flatMap(l=>l.about))]}}case"accept_suggestion":case"decline_suggestion":{let u=String(f.suggestion??""),l={author:e,...oe(t.via)},m=k.name==="accept_suggestion"?Pe(n,u,l):De(n,u,l),y=I(n,e,m);return{ok:!0,data:{batch:y.batch,intent:y.intent,introduces:y.introduces.map(N),resolves:y.resolves.map(N)},diff:y.diff}}case"undo_batch":{let u=String(f.batch),l=f.include??[],m=S.canUndo([u,...l]);if(!m.ok)return{ok:!1,error:m.message};let y=I(n,e,n.undo([u,...l],{...t.author?{author:t.author}:{}}));return{ok:!0,data:Ze(y),diff:y.diff}}default:return{ok:!1,error:`Unknown tool "${p}".`}}}catch(k){let{reason:S,wouldNeed:u}=Se(k);return{ok:!1,error:k instanceof Error?k.message:String(k),reason:S,...u?{wouldNeed:u}:{}}}},O=new Set,v=p=>{for(let f of O)f(p)};return{definitions:o,hash:d,...t.author?{author:t.author}:{},onDiff(p){return n.subscribe(p)},onCall(p){return O.add(p),()=>O.delete(p)},async call(p,f){let k=h(p)?.mutating??!1,S={name:p,args:f,mutating:k,at:new Date().toISOString()};v({...S,phase:"running"});let u=m=>(v(m.ok?{...S,phase:"ok",...!k&&m.reads?{reads:m.reads}:{}}:{...S,phase:"failed",error:m.error}),m),l=await T(p,f);return u(l.ok&&!k?{...l,data:(await F()).withinReadChars(p,l.data)}:l)}}}function oe(n){let t=typeof n=="function"?n():n;return t?{via:t}:{}}export{le as a,mn as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as O,b}from"./chunk.
|
|
1
|
+
import{a as O,b}from"./chunk.QII2C5OV.js";import"./chunk.PPRSGM64.js";import"./chunk.5Y3Q7ONN.js";import"./chunk.KTFUVR4V.js";import"./chunk.2UIUMG23.js";import{G as z,R as M,_ as S}from"./chunk.KA44WNB4.js";import"./chunk.SDO3U72B.js";import{Hc as A}from"./chunk.4TJOS4C7.js";import"./chunk.2AZTW66C.js";import{b as v}from"./chunk.AJZBJBMO.js";var o=v(z(),1);var t=v(M(),1);function G(i){for(let d of i)for(let[r,s]of Object.entries(d))if(s===!1)return`${r} == true`;return""}var w={margin:0,fontSize:"0.8125rem",color:"var(--graview-ink-muted)"};function j({ask:i,close:d}){let{store:r,principal:s,subscriptions:h,app:f}=S(),c=(0,o.useRef)(null),p=(0,o.useId)(),[n,u]=(0,o.useState)(0),[l,y]=(0,o.useState)(!0),[m,P]=(0,o.useState)(()=>{let e=i.choices.find(g=>g.on==="reaches");if(!e)return"";let a=e.record!==void 0?r.graph.getNode(e.record):void 0;return G(a?[a]:r.graph.nodesOfKind(e.kind).slice(0,5))}),[C,x]=(0,o.useState)(null),[W,k]=(0,o.useState)(!1);(0,o.useEffect)(()=>{let e=c.current;e&&!e.open&&e.showModal()},[]);let T=()=>{let e=i.returnTo;d(),requestAnimationFrame(()=>{e?.isConnected?e.focus():document.querySelector("[data-graview-page-title], main h1, [data-testid='activity-button']")?.focus()})},N=e=>e.on==="reaches"?{...e,condition:m}:e,E=e=>b(r,{when:N(e),alsoMine:!l}),L=async()=>{let e=N(i.choices[n]),a=O(r,e);if(a){x(a);return}k(!0);try{await h.add({who:A(s),app:f?.name??"app",when:e,...l?{}:{alsoMine:!0}}),T()}catch(g){k(!1),x(g instanceof Error?g.message:String(g))}};return(0,t.jsx)("dialog",{ref:c,"aria-labelledby":p,"data-testid":"notify-sheet",onClose:T,onClick:e=>{e.target===e.currentTarget&&e.currentTarget.close()},style:{width:"min(92vw, 420px)",padding:0,border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)",color:"var(--graview-ink)",boxShadow:"var(--graview-lift-high)"},children:(0,t.jsxs)("form",{method:"dialog",onSubmit:e=>{e.preventDefault(),L()},style:{display:"grid",gap:12,padding:18},children:[(0,t.jsx)("h2",{id:p,style:{margin:0,fontSize:"1.0625rem"},children:"Notify me"}),(0,t.jsxs)("fieldset",{style:{margin:0,padding:0,border:0,display:"grid",gap:6},children:[(0,t.jsx)("legend",{style:{...w,marginBottom:6},children:"Tell me"}),i.choices.map((e,a)=>(0,t.jsxs)("label",{style:{display:"flex",gap:8,alignItems:"baseline",cursor:"pointer"},children:[(0,t.jsx)("input",{type:"radio",name:`${p}-when`,checked:n===a,onChange:()=>u(a),"data-notify-choice":e.on}),(0,t.jsx)("span",{children:e.on==="reaches"?`When ${e.record!==void 0?"it":"one"} reaches a condition`:E(e)})]},a))]}),i.choices[n]?.on==="reaches"?(0,t.jsxs)("label",{style:{display:"grid",gap:4},children:[(0,t.jsx)("span",{style:w,children:"The condition, in the app's own words (done == true, amount > 100)"}),(0,t.jsx)("input",{value:m,onChange:e=>P(e.target.value),"data-testid":"notify-condition",autoComplete:"off",spellCheck:!1})]}):null,(0,t.jsxs)("label",{style:{display:"flex",gap:8,alignItems:"center"},children:[(0,t.jsx)("input",{type:"checkbox",checked:l,onChange:e=>y(e.target.checked),"data-testid":"notify-others-only"}),"Only when someone else does it"]}),(0,t.jsxs)("p",{style:w,"data-testid":"notify-said",children:[E(i.choices[n]),"."]}),C?(0,t.jsx)("p",{role:"alert",style:{margin:0,color:"var(--graview-danger, var(--graview-ink))"},children:C}):null,(0,t.jsxs)("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[(0,t.jsx)("button",{type:"button",onClick:()=>c.current?.close(),children:"Cancel"}),(0,t.jsx)("button",{type:"submit",autoFocus:!0,disabled:W,"data-testid":"notify-keep",style:{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"},children:"Notify me"})]})]})})}function B({style:i}){let{store:d,principal:r,subscriptions:s,app:h}=S(),f=(r.onBehalfOf??r).id,[c,p]=(0,o.useState)([]);return(0,o.useEffect)(()=>{if(f===void 0)return;let n=!0,u=()=>void Promise.resolve(s.list(f)).then(y=>n&&p(y.filter(m=>m.app===(h?.name??"app"))),()=>n&&p([]));u();let l=s.onChange?.(u);return()=>{n=!1,l?.()}},[s,f,h]),c.length===0?null:(0,t.jsxs)("section",{"aria-label":"What you are told of","data-testid":"notified",style:{display:"grid",gap:6,...i},children:[(0,t.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:"You are told"}),(0,t.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:4},children:c.map(n=>(0,t.jsxs)("li",{style:{display:"flex",gap:8,alignItems:"baseline",justifyContent:"space-between"},"data-subscription":n.id,children:[(0,t.jsx)("span",{style:{fontSize:"0.8125rem"},children:b(d,n)}),(0,t.jsx)("button",{type:"button","data-testid":"notify-stop","aria-label":`Stop: ${b(d,n)}`,onClick:u=>{let l=u.currentTarget.closest("li"),y=(l?.nextElementSibling??l?.previousElementSibling)?.querySelector("button");Promise.resolve(s.remove(n.id)).then(()=>(y??document.querySelector("[data-testid='activity-button']"))?.focus())},style:{padding:"1px 8px",fontSize:"0.8125rem"},children:"Stop"})]},n.id))})]})}export{B as NotifiedList,j as NotifySheet};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as a,c as b,d as c,e as d,f as e,g as f,h as g}from"./chunk.
|
|
1
|
+
import{b as a,c as b,d as c,e as d,f as e,g as f,h as g}from"./chunk.6TKILWRM.js";import"./chunk.PXQVXBNG.js";import"./chunk.G446PWV6.js";import"./chunk.4TJOS4C7.js";import"./chunk.2AZTW66C.js";import"./chunk.AJZBJBMO.js";export{g as createLinks,f as judgeDestination,e as listsOf,c as nowhere,a as placesSaid,b as quoted,d as whereOfWords};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{b as z}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{b as z}from"./chunk.2VTMTW7K.js";import{a as U,b as V,d as b,e as B,f as C,g as W}from"./chunk.GVNYPFIM.js";import{a as J,b as h,d as A}from"./chunk.DOBQ4LO4.js";import{a as p,b as T,c as S,e as _}from"./chunk.BBLIT7S7.js";import{a as R}from"./chunk.SDO3U72B.js";import"./chunk.4TJOS4C7.js";import"./chunk.2AZTW66C.js";import"./chunk.AJZBJBMO.js";var Q=R(()=>(__graviewPreload(import.meta.url,["./chunk.AJZBJBMO.js"]),import("./chunk.SHNYYBNW.js")));function te(d,e){let f=d.ownerDocument,u=f.defaultView,t=f.createElement("iframe");t.setAttribute("sandbox",T),t.setAttribute("referrerpolicy","no-referrer"),t.setAttribute("allow",""),t.setAttribute("title",e.title??e.view),t.setAttribute("data-guest-view",e.view),t.setAttribute("aria-busy","true"),t.style.border="0",t.style.width="100%",t.style.display="block",t.src=e.url;let a={applied:0,refused:0,dropped:0},P=h(e.limits),i,y,o={applied:0,refused:0,dropped:0},v=()=>{if(!i)return;let r=i.stats;a.applied+=r.applied-o.applied,a.refused+=r.refused-o.refused,a.dropped+=r.dropped-o.dropped,o={...r}},O=W(u,()=>l(),"data"),g=()=>C(()=>e.theme?.()??b(d),e.brand,O),L="",l=()=>{i&&(L=JSON.stringify(g()),i.push())},k=B(f,()=>{i&&JSON.stringify(g())!==L&&l()}),n,w=!1,D=e.pictures?z(Q,({createGuestPictures:r})=>{n=r(u,{as:"data",view:`"${e.title??e.view}"`,pictures:e.pictures,...e.limits?{limits:e.limits}:{},...e.file?{file:e.file}:{},moved:()=>{i?.push(),G&&E()}}),w&&x()}):()=>{},G=!1,c,N=()=>{!G||n?.waiting()||(clearTimeout(c),t.removeAttribute("data-guest-view-failed"),t.removeAttribute("aria-busy"),t.setAttribute("data-guest-view-drawn",""))},E=()=>{clearTimeout(c),c=setTimeout(N,250)},F=setTimeout(()=>{i||(t.removeAttribute("aria-busy"),t.setAttribute("data-guest-view-failed","silent"))},e.limits?.readyMs??8e3),H=()=>{v(),i?.dispose(),y?.close(),i=void 0,y=void 0,o={applied:0,refused:0,dropped:0}},M=r=>{if(!(r.source===null||r.source!==t.contentWindow)){if(r.origin!==S||!P.message()){a.dropped+=1;return}if(!_(r.data)||r.data.protocol!==1){a.dropped+=1;return}if(e.pictures&&!n){w=!0;return}x()}},x=()=>{w=!1,H();let r=U(),m=new MessageChannel;y=m.port1;let I=A({store:e.store,principal:e.principal,view:e.view,nonce:r,send:s=>m.port1.postMessage(s),...e.input?{input:e.input}:{},...e.reads?{reads:e.reads}:{},...n?{hand:n.hand}:{},theme:g,...e.places?{places:()=>[...new Set(e.places().map(s=>s.as))],placesShown:e.places}:{},...e.onNavigatePlace?{onNavigatePlace:e.onNavigatePlace}:{},...e.onNavigate?{onNavigate:e.onNavigate}:{},...e.onArrive?{onArrive:e.onArrive}:e.goTo?{onArrive:s=>V(e.goTo(),s)}:{},...e.onLost?{onLost:e.onLost}:{},onSize:s=>{e.onSize?e.onSize(s):t.style.height=`${s}px`,N()},...e.limits?{limits:e.limits}:{},limiter:P});i=I,m.port1.onmessage=s=>{I.receive(s.data),v()};let j={graview:"host-hello",protocol:1,nonce:r,view:e.view};t.contentWindow.postMessage(j,"*",[m.port2]),l(),G=!0,E()};return u.addEventListener("message",M),d.appendChild(t),d.removeAttribute("aria-busy"),{iframe:t,update:l,get stats(){return v(),a},dispose(){H(),clearTimeout(F),clearTimeout(c),k(),O.dispose(),D(),n?.dispose(),u.removeEventListener("message",M),t.remove()}}}export{p as GUEST_PROTOCOL,T as GUEST_SANDBOX,S as OPAQUE_ORIGIN,A as createGuestHost,h as createGuestLimiter,te as mountGuestView,J as readAcross,b as readTheme};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{E as b,L as w,M as N,N as T,P as O,Q as S,U as m}from"./chunk.4TJOS4C7.js";var x=864e5,j=/^(\d{4})-(\d{2})-(\d{2})/,p=e=>String(e).padStart(2,"0"),D=e=>new Date(e).toISOString().slice(0,10),a=e=>Date.UTC(+e.slice(0,4),+e.slice(5,7)-1,+e.slice(8,10)),g=(e,t)=>D(a(e)+t*x),W=e=>new Date(a(e)).getUTCDay();function c(e,t,r){if(!(t>=1&&t<=12&&r>=1&&r<=31))return;let i=`${String(e).padStart(4,"0")}-${p(t)}-${p(r)}`;return D(a(i))===i?i:void 0}function F(e=new Date){let t=N();return t?O(e.getTime(),t):{day:`${e.getFullYear()}-${p(e.getMonth()+1)}-${p(e.getDate())}`,minutes:e.getHours()*60+e.getMinutes()}}var h=e=>/T\d\d:\d\d(:[\d.]+)?(Z|[+-]\d\d:?\d\d)$/.test(e);function l(e){if(typeof e!="string")return;if(h(e)){let i=new Date(e);return Number.isNaN(i.getTime())?void 0:F(i)}let t=/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2}))?/.exec(e);if(!t||!c(Number(t[1]),Number(t[2]),Number(t[3])))return;let r=e.slice(0,10);return t[4]===void 0?{day:r}:{day:r,minutes:Number(t[4])*60+Number(t[5])}}function A(e,t){if(!t.time)return e.day;let r=e.minutes??9*60;if(!t.instant)return`${e.day}T${p(Math.floor(r/60))}:${p(r%60)}`;let i=N(),[,n,o,d]=j.exec(e.day);return(i?new Date(S(e.day,r,i)):new Date(Number(n),Number(o)-1,Number(d),Math.floor(r/60),r%60)).toISOString().replace(/\.\d{3}Z$/,"Z")}function z(e,t=new Date){let r=T(),i=r;try{i=new Intl.DateTimeFormat(e??b,{timeZoneName:"short",timeZone:r}).formatToParts(t).find(n=>n.type==="timeZoneName")?.value??r}catch{i=r}return{zone:r,short:i}}function L(e,t,r,i){let n=l(t);if(!n)return r;let o=e===void 0?void 0:l(e),d=r===void 0?void 0:l(r),u=s=>a(s.day)+(s.minutes??0)*6e4,f=(s,$)=>{let y=u(s)+$;return{day:D(y),...i.time?{minutes:Math.round(y%x/6e4)}:{}}};return o&&d?A(f(d,u(n)-u(o)),i):d&&u(d)>=u(n)?r:i.time?A(f(n,36e5),i):r}var Y=/^(start|starts|startsAt|startsOn|startAt|begins|from|opens|checkIn)$/i,B=/^(end|ends|endsAt|endsOn|endAt|until|to|finish|finishes|closes|through|checkOut)$/i;function P(e,t={}){let r=(t.start&&e.includes(t.start)?t.start:void 0)??e.find(n=>Y.test(n)),i=(t.end&&e.includes(t.end)?t.end:void 0)??e.find(n=>n!==r&&B.test(n));return r&&i?{start:r,end:i}:void 0}var Z=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],H=["sun","mon","tue","wed","thu","fri","sat"],I="(jan(?:uary)?|feb(?:ruary)?|mar(?:ch)?|apr(?:il)?|may|june?|july?|aug(?:ust)?|sept?(?:ember)?|oct(?:ober)?|nov(?:ember)?|dec(?:ember)?)",E="(sun(?:day)?|mon(?:day)?|tue(?:s|sday)?|wed(?:nesday)?|thu(?:r|rs|rsday)?|fri(?:day)?|sat(?:urday)?)",C=e=>Z.indexOf(e.slice(0,3))+1,M=e=>e===void 0?void 0:e.length===2?2e3+Number(e):Number(e);function U(e){try{let t=new Intl.DateTimeFormat(e,{month:"numeric",day:"numeric"}).formatToParts(0).map(r=>r.type);return t.indexOf("month")<t.indexOf("day")}catch{return!0}}function v(e){let t=(n,o)=>({minutes:o,rest:`${e.slice(0,n.index)} ${e.slice(n.index+n[0].length)}`}),r=/\b(noon|midday)\b/.exec(e);if(r)return t(r,12*60);if(r=/\bmidnight\b/.exec(e),r)return t(r,0);if(r=/\b(\d{1,2})(?::(\d{2}))?\s*([ap])\.?m?\.?(?=\s|$)/.exec(e),r){let n=Number(r[1]),o=Number(r[2]??0);return n<1||n>12||o>59?{rest:e,bad:!0}:t(r,(n%12+(r[3]==="p"?12:0))*60+o)}if(r=/\b(\d{1,2}):(\d{2})\b/.exec(e),r){let n=Number(r[1]),o=Number(r[2]);return n>23||o>59?{rest:e,bad:!0}:t(r,n*60+o)}if(r=/\bat\s+(\d{1,2})\b/.exec(e),r){let n=Number(r[1]);return n>23?{rest:e,bad:!0}:t(r,(n>=1&&n<=7?n+12:n)*60)}let i=/\b(morning|afternoon|evening|tonight)\b/.exec(e);return i?{minutes:{morning:9,afternoon:15,evening:18,tonight:20}[i[1]]*60,rest:i[1]==="tonight"?`${e.slice(0,i.index)} today ${e.slice(i.index+i[0].length)}`:`${e.slice(0,i.index)} ${e.slice(i.index+i[0].length)}`}:{rest:e}}function K(e,t,r){let i=e.replace(/\b(on|at|the|of|this)\b/g," ").replace(/\s+/g," ").trim();if(i==="")return null;if(i==="today"||i==="now")return t;if(i==="tomorrow"||i==="tmrw"||i==="tmr")return g(t,1);if(i==="yesterday")return g(t,-1);if(i==="next week")return g(t,7);let n=/^in (\d{1,3}) (day|days|week|weeks)$/.exec(i);if(n)return g(t,Number(n[1])*(n[2].startsWith("week")?7:1));if(n=new RegExp(`^(next )?${E}$`).exec(i),n){let s=(H.indexOf(n[2].slice(0,3))-W(t)+7)%7;return g(t,n[1]&&s===0?7:s)}if(n=/^(\d{4})-(\d{1,2})-(\d{1,2})$/.exec(i),n)return c(Number(n[1]),Number(n[2]),Number(n[3]));let o=i.replace(new RegExp(`^${E} `),"");n=new RegExp(`^(\\d{1,2})(?:st|nd|rd|th)? ${I}(?: (\\d{4}))?$`).exec(o);let d=n?{date:n[1],month:n[2],year:n[3]}:void 0;n=new RegExp(`^${I} (\\d{1,2})(?:st|nd|rd|th)?(?: (\\d{4}))?$`).exec(o);let u=d??(n?{date:n[2],month:n[1],year:n[3]}:void 0);if(u)return R(t,M(u.year),C(u.month),Number(u.date));if(n=/^(\d{1,2})[/.-](\d{1,2})(?:[/.-](\d{2}|\d{4}))?$/.exec(o),n){let[f,s]=[Number(n[1]),Number(n[2])],[$,y]=U(r)?[f,s]:[s,f];return R(t,M(n[3]),$,y)}}function R(e,t,r,i){if(t!==void 0)return c(t,r,i);let n=Number(e.slice(0,4)),o=c(n,r,i);return o===void 0?c(n+1,r,i):a(e)-a(o)>183*x?c(n+1,r,i):o}function q(e,t){let r=e.trim();if(h(r)){let u=l(r);if(u)return t.time?u:{day:u.day}}let i=e.toLowerCase().replace(/,/g," ").replace(/(\d{4}-\d{2}-\d{2})t(\d\d:\d\d)(:\d\d(\.\d+)?)?/,"$1 $2").replace(/\s+/g," ").trim();if(i==="")return;let n=v(i);if(n.bad)return;let o=K(n.rest,t.today,t.locale??b);if(o===void 0||o===null&&n.minutes===void 0)return;let d=o??t.base?.day??t.today;return t.time?{day:d,minutes:n.minutes??t.base?.minutes??9*60}:{day:d}}function G(e){if(e===void 0||e==="web"||e.startsWith("ai:")||e.startsWith("app:"))return;if(e==="api")return"via the API";if(e==="cli")return"via the command line";let[t,...r]=e.split(":"),i=r.join(":");return(t==="mcp"||t==="view")&&i?`via ${i}`:t==="mcp"?"via an agent's tools":`via ${e}`}var _=e=>{if(!e.currency)return{before:!0};try{let t=w(e.locale),r=new Intl.NumberFormat(t,{style:"currency",currency:e.currency}).formatToParts(1),i=r.findIndex(d=>d.type==="currency"),n=r.findIndex(d=>d.type==="integer"),o;try{o=new Intl.DisplayNames([t],{type:"currency"}).of(e.currency)}catch{}return{...i>=0?{symbol:r[i].value}:{},before:i<n,...o?{name:o}:{}}}catch{return{symbol:e.currency,before:!0}}};function J(e){let t=e.locale;if(e.format==="money"){let{symbol:r,before:i,name:n}=_(e),o=m(1250,t,{minimumFractionDigits:2,maximumFractionDigits:2});return{...r?i?{prefix:r}:{suffix:r}:{},placeholder:o,hint:n?`in ${n}`:e.currency?`in ${e.currency}`:"an amount of money"}}return e.format==="percent"?{suffix:"%",placeholder:m(15,t),hint:"as a percent"}:{...e.unit?{suffix:e.unit}:{},placeholder:"",hint:e.unit?`in ${e.unit}`:"a number"}}function Q(e,t){return e===void 0||!Number.isFinite(e)?"":t.format==="money"?m(e,t.locale,Number.isInteger(e)?{maximumFractionDigits:0}:{minimumFractionDigits:2,maximumFractionDigits:2}):t.format==="percent"?m(e*100,t.locale,{maximumFractionDigits:4}):m(e,t.locale,{maximumFractionDigits:6})}function V(e){try{let t=new Intl.NumberFormat(w(e)).formatToParts(12345.6);return{group:t.find(r=>r.type==="group")?.value??",",decimal:t.find(r=>r.type==="decimal")?.value??"."}}catch{return{group:",",decimal:"."}}}function X(e,t){let{group:r,decimal:i}=V(t),n=e.replace(/[\s ']/g,"").replace(/[−–]/g,"-");if(i!=="."&&!n.includes(i)&&/^-?\d+\.\d{1,2}$/.test(n))return Number(n);if(r&&(n=n.split(r).join("")),i!=="."&&(n=n.replace(i,".")),!/^-?(\d+\.?\d*|\.\d+)$/.test(n))return;let o=Number(n);return Number.isFinite(o)?o:void 0}function k(e,t){let r=e.trim();if(r==="")return;let i=t?.format==="money"&&t.currency?_(t).symbol:void 0,n=r;i&&(n=n.split(i).join("")),t?.currency&&(n=n.replace(new RegExp(t.currency,"gi"),"")),n=n.replace(/^[$€£¥₹]|[$€£¥₹]$/g,""),/%\s*$/.test(n)&&(n=n.replace(/%\s*$/,"")),t?.unit&&t.format!=="money"&&(n=n.replace(new RegExp(`\\s*${t.unit.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*$`),""));let d=X(n,t?.locale);if(d!==void 0)return t?.format==="percent"?d/100:d}export{G as a,J as b,Q as c,k as d,F as e,h as f,l as g,A as h,z as i,L as j,P as k,q as l};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var o=new Set(["tell","me","about","what","how","show","describe","the","a","an","and","please"])
|
|
1
|
+
var o=new Set(["tell","me","about","what","how","show","describe","the","a","an","and","please"]),k=new Set([...o,"where","is","are","was","find","any","anything","something","things","called","named","which","who","of","for","with","to","in","on","i","my","do","does","have","has","can","you","it","that","this","there","we","our","got","be"]);function S(t){return t.flatMap(e=>{let n=e.repairs.find(s=>!s.missing?.length);return n?[{mutation:n.mutation,args:{...n.args},why:e.message}]:[]})}export{S as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as g}from"./chunk.
|
|
1
|
+
import{a as g}from"./chunk.DPHTUTOS.js";import{D as m,Gb as w,H as y,va as a,ya as k}from"./chunk.4TJOS4C7.js";var d=i=>i?._zod?.def,h=/^\^\\d\{4\}-\\d\{2\}-\\d\{2\}\$$/;function b(i){let t=d(i),p=!0,f;for(let e=0;t&&e<4;e++){if(t.type==="optional"||t.type==="nullable")p=!1;else if(t.type==="default")p=!1,f=t.defaultValue;else break;t=d(t.innerType)}if(!t)return{why:"it is not a zod field"};let u=m(i),r={...p?{required:!0}:{},...f!==void 0?{default:f}:{},...u?{description:u}:{}},s=(t.checks??[]).map(e=>d(e)),c=a(i);if(c)return{spec:{type:c,...r}};if(k(i))return{spec:{type:"app-link",...r}};if(g(i))return{spec:{type:"text",format:"markdown",...r}};let l=w(i);if(l)return{spec:{type:l,...r}};switch(t.type){case"string":{let e=t.format;return e==="email"?{spec:{type:"email",...r}}:e==="url"?{spec:{type:"url",...r}}:e==="date"?{spec:{type:"date",...r}}:e==="datetime"||s.some(n=>n?.fn===y)?{spec:{type:"datetime",...r}}:s.some(n=>n?.format==="regex"&&h.test(String(n?.pattern?.source??"")))?{spec:{type:"date",...r}}:{spec:{type:"string",...r}}}case"number":{let e={};for(let n of s){let o=n?.value;typeof o=="number"&&(n?.check==="greater_than"&&n.inclusive?e.min=Math.max(e.min??o,o):n?.check==="less_than"&&n.inclusive?e.max=Math.min(e.max??o,o):n?.check==="multiple_of"&&(e.step=o))}return{spec:{type:s.some(n=>n?.format==="safeint"||n?.format==="int")?"integer":"number",...e,...r}}}case"boolean":return{spec:{type:"boolean",...r}};case"enum":{let e=Object.keys(t.entries??{});return e.length>0?{spec:{type:"enum",options:e,...r}}:{why:"it is an enum with no options"}}case"array":{let e=d(t.element),n=a(t.element)??(e?.type==="number"?"number":e?.type==="string"?"string":void 0);return n?{spec:{type:"list",of:n,...r}}:{why:`it is a list of ${String(e?.type??"something")}, and a document lists words, numbers, dates, images, videos or files`}}default:return{why:`it is a ${String(t.type)}, which a document has no field type for`}}}function L(i){let t=b(i);return"spec"in t?t.spec:void 0}export{L as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{wc as e}from"./chunk.4TJOS4C7.js";var i=`
|
|
2
2
|
.graview-spec{display:flex;flex-direction:column;gap:6px;min-width:0;color:var(--graview-ink)}
|
|
3
3
|
|
|
4
4
|
.graview-spec-row{flex-direction:row;flex-wrap:wrap;align-items:center;gap:4px 10px;box-sizing:border-box;max-width:100%;padding:5px 10px;border:1px solid var(--graview-edge);border-radius:var(--graview-radius-sm,8px);background:var(--graview-panel);font-size:.875rem}
|