@origintrail-official/dkg-node-ui 10.0.23 → 10.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist-ui/assets/{3d-force-graph-DbVwxMKf.js → 3d-force-graph-DvzZZzFn.js} +1 -1
- package/dist-ui/assets/{ActivityFeed-Bfg6fmQQ.js → ActivityFeed-B5QxV1dk.js} +2 -2
- package/dist-ui/assets/{AgentHub-DyF5Pa70.js → AgentHub-BO9jGbJl.js} +1 -1
- package/dist-ui/assets/{AgentProfilePage-BPrSuKjV.js → AgentProfilePage-DJJTn1WD.js} +1 -1
- package/dist-ui/assets/{ApproveWalletsModal-Dd_tHLRP.js → ApproveWalletsModal-C2Tu29tB.js} +3 -3
- package/dist-ui/assets/{ContextGraphPrimitives-BXormriD.js → ContextGraphPrimitives-BqlTIZHy.js} +1 -1
- package/dist-ui/assets/{ConvictionDetailView-BsPTd17P.js → ConvictionDetailView-J-DAKHtP.js} +2 -2
- package/dist-ui/assets/MemoryLayerView-BOxI-_TF.js +2 -0
- package/dist-ui/assets/{MemoryStackView-BbUJ2uiM.js → MemoryStackView-BTyZZKNm.js} +1 -1
- package/dist-ui/assets/{Network-BKvJttOu.js → Network-DV9K48MH.js} +1 -1
- package/dist-ui/assets/{OnChainProvenanceCard-BV9-G1cT.js → OnChainProvenanceCard-jxk66g53.js} +1 -1
- package/dist-ui/assets/{Operations-LAhUQsnj.js → Operations-CNB1BMYg.js} +1 -1
- package/dist-ui/assets/{ProjectView-0zCSblAV.js → ProjectView-BP4vNSXI.js} +30 -30
- package/dist-ui/assets/{PublishingConviction-CF6352oT.js → PublishingConviction-DbP1i3v0.js} +2 -2
- package/dist-ui/assets/{Settings-runaZqPv.js → Settings-I6g3MQCV.js} +1 -1
- package/dist-ui/assets/{browserWalletTransaction-CBgx0i4w.js → browserWalletTransaction-CXv612Pn.js} +3 -3
- package/dist-ui/assets/{ccip-BM07w5uU.js → ccip-DY93ay8e.js} +1 -1
- package/dist-ui/assets/index-CIt7zWgM.css +1 -0
- package/dist-ui/assets/{index-CfVUpsfM.js → index-CumB6j2m.js} +3 -3
- package/dist-ui/assets/index-DW3dBcQk.js +1175 -0
- package/dist-ui/assets/{jsonld-32FQRO67-DBZOBQji.js → jsonld-32FQRO67-DKLfQ_nD.js} +2 -2
- package/dist-ui/assets/{jsonld-DOX7dKpf.js → jsonld-BgpgXlDQ.js} +1 -1
- package/dist-ui/assets/{renderer-3d-2EVDZII7-CVCpAmwB.js → renderer-3d-2EVDZII7-BCmzI8Ii.js} +2 -2
- package/dist-ui/assets/{shikiHighlighter-CzU2U2Tx.js → shikiHighlighter-BXl6qMQO.js} +4 -4
- package/dist-ui/assets/{useEntityOnChainReceipt-BvWQ6qdT.js → useEntityOnChainReceipt-CUGQNIsP.js} +1 -1
- package/dist-ui/assets/{useProjectActivity-Cxr4QGX1.js → useProjectActivity-BOgGdtS7.js} +1 -1
- package/dist-ui/index.html +2 -2
- package/package.json +4 -4
- package/dist-ui/assets/MemoryLayerView-CloJeM33.js +0 -2
- package/dist-ui/assets/index-MQh8C4aJ.js +0 -1175
- package/dist-ui/assets/index-xKO-U_eV.css +0 -1
package/README.md
CHANGED
|
@@ -49,3 +49,7 @@ pnpm build
|
|
|
49
49
|
- `@origintrail-official/dkg-core` - configuration types, event bus integration
|
|
50
50
|
- `@origintrail-official/dkg-node-store` - the daemon's protocol persistence stores (outbox, sync checkpoints, changelog cursors, KA numbers, chain log and cursors). They used to live here; this package re-exports them unchanged (from its entry point, from `dist/db.js`, and from the former `dist/chain-event-log-store.js`, `dist/chain-cursor-stores.js` and `dist/protocol-outbox-store.js` paths, which are deprecated forwarding modules: first-party code imports node-store directly) and `DashboardDB` still opens `node-ui.db` and owns the schema and every migration
|
|
51
51
|
- `@origintrail-official/dkg-graph-viz` - interactive RDF graph visualization component
|
|
52
|
+
|
|
53
|
+
### Unavailable node
|
|
54
|
+
|
|
55
|
+
If both initial status probes fail or time out, the dashboard shows a connection recovery screen and hides operational panels, including node health, balances, graphs and integration readiness. Fallback fixtures are never shown as live state. Check the daemon and use **Retry connection** to reload; detection remains latched for the current page. A `401` response still opens the existing API token prompt rather than declaring the node unavailable.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{v as Po,c8 as Lh,aG as Qe,cD as _n,cX as ce,br as bl,cY as V,aM as St,o as si,aO as kt,ct as _l,r as Dt,aQ as Uh,n as Yi,ax as cm,ae as Oh,K as Ih,l as kh,F as dm,bv as hm,ay as Gh,u as fm,cJ as pm,db as z,af as it,cm as xl,ba as cs,bo as Vh,co as Tl,dd as $h,dc as Oe,d6 as k,s as Ge,cd as Ss,aA as vt,bD as It,cZ as ze,a7 as gm,a6 as mm,B as ot,a5 as hs,T as xn,cW as Or,c_ as uo,cI as Zt,t as Ns,bt as ym,S as zh,c9 as bm,cv as vl,i as Wh,ag as _m,aw as xm,aE as Tm,cc as vm,C as Sm,A as Nm,d as Rm,b3 as wm,p as Ws,cO as ht,cr as js,cV as ds,al as st,cS as Ve,a3 as rt,e as jh,ca as Fo,cb as Do,P as Tn,Q as vn,c5 as Jt,c6 as Lo,b_ as Uo,b$ as qh,cT as Hh,cU as Xh,cQ as Sn,cR as Sl,cP as Nl,a0 as Oo,a4 as Kh,R as nn,bq as Hr,j as Em,bs as Am,aP as On,J as qs,a as pn,d3 as Un,bw as Js,d2 as Cm,_ as Rl,$ as wl,E as yu,W as lo,cn as ae,aL as ri,bn as El,aH as dc,bB as Io,d1 as Xr,d5 as Mm,d8 as co,aY as ko,q as Kr,ce as Go,aB as fs,aC as bu,b1 as Yr,b2 as Yh,b0 as xt,be as Qh,a8 as ho,aa as er,X as Zh,as as ii,aq as Al,f as Jh,b4 as ef,aF as hc,b8 as tr,d7 as Bm,cg as tf,cB as nf,bj as sf,bk as rf,bl as of,bm as af,U as uf,V as lf,cy as cf,cx as df,cz as hf,bi as ff,I as Pm,G as Fm,H as Dm,aI as pf,b7 as Nn,a_ as ks,cC as Gs,c as Vs,bb as gn,bf as gf,a9 as mf,ab as yf,Y as bf,at as _f,ar as xf,g as Tf,b5 as vf,bE as Cl,c4 as Qi,bX as Zi,bY as Ji,bZ as eo,c3 as fc,c2 as pc,bW as gc,bV as mc,c0 as _u,c1 as xu,bU as Tu,bx as vu,ci as Su,bC as fo,cl as Nu,bL as Ru,bM as wu,bN as Eu,bO as Au,bP as Cu,bQ as Mu,bR as Bu,bS as Pu,bG as Fu,bH as Du,bI as Lu,bF as Uu,bJ as Ou,bK as Iu,bT as ku,bA as Gu,ck as Vu,bz as po,cj as $u,M as Sf,aT as Lm,aV as Um,aU as Om,aW as Im,aS as km,aR as Gm,az as Vm,bu as $m,cw as zm,cq as Wm,by as jm,D as Vo,cF as Ml,cK as qm,cM as Hm,cL as Xm,a2 as go,bg as Km,ad as Ym,ac as Qm,Z as Zm,au as Jm,av as ey,h as ty,b6 as ny,O as sy,ai as ry,N as iy,ah as oy,ao as ay,cf as uy,d4 as ly,ap as cy,aN as dy,aX as hy,ch as Nf,a1 as Rf,b as fy,aZ as py,a$ as gy,aJ as mo,bd as wf,aK as Ef,m as Af,w as my,k as yy,x as by,cs as _y,bp as xy,y as yo,z as bo,cE as ia,b9 as oa,bc as Ty,bh as vy,aj as Sy,ak as Ny,L as Ry,cA as Bl,aD as wy,an as Ey,am as Ay,d9 as Cy,cu as yc,c7 as My,cp as bc,cN as By,c$ as Py,cH as Cf,cG as Fy,d0 as Dy}from"./three.module-BXIk8GZS.js";import{
|
|
1
|
+
import{v as Po,c8 as Lh,aG as Qe,cD as _n,cX as ce,br as bl,cY as V,aM as St,o as si,aO as kt,ct as _l,r as Dt,aQ as Uh,n as Yi,ax as cm,ae as Oh,K as Ih,l as kh,F as dm,bv as hm,ay as Gh,u as fm,cJ as pm,db as z,af as it,cm as xl,ba as cs,bo as Vh,co as Tl,dd as $h,dc as Oe,d6 as k,s as Ge,cd as Ss,aA as vt,bD as It,cZ as ze,a7 as gm,a6 as mm,B as ot,a5 as hs,T as xn,cW as Or,c_ as uo,cI as Zt,t as Ns,bt as ym,S as zh,c9 as bm,cv as vl,i as Wh,ag as _m,aw as xm,aE as Tm,cc as vm,C as Sm,A as Nm,d as Rm,b3 as wm,p as Ws,cO as ht,cr as js,cV as ds,al as st,cS as Ve,a3 as rt,e as jh,ca as Fo,cb as Do,P as Tn,Q as vn,c5 as Jt,c6 as Lo,b_ as Uo,b$ as qh,cT as Hh,cU as Xh,cQ as Sn,cR as Sl,cP as Nl,a0 as Oo,a4 as Kh,R as nn,bq as Hr,j as Em,bs as Am,aP as On,J as qs,a as pn,d3 as Un,bw as Js,d2 as Cm,_ as Rl,$ as wl,E as yu,W as lo,cn as ae,aL as ri,bn as El,aH as dc,bB as Io,d1 as Xr,d5 as Mm,d8 as co,aY as ko,q as Kr,ce as Go,aB as fs,aC as bu,b1 as Yr,b2 as Yh,b0 as xt,be as Qh,a8 as ho,aa as er,X as Zh,as as ii,aq as Al,f as Jh,b4 as ef,aF as hc,b8 as tr,d7 as Bm,cg as tf,cB as nf,bj as sf,bk as rf,bl as of,bm as af,U as uf,V as lf,cy as cf,cx as df,cz as hf,bi as ff,I as Pm,G as Fm,H as Dm,aI as pf,b7 as Nn,a_ as ks,cC as Gs,c as Vs,bb as gn,bf as gf,a9 as mf,ab as yf,Y as bf,at as _f,ar as xf,g as Tf,b5 as vf,bE as Cl,c4 as Qi,bX as Zi,bY as Ji,bZ as eo,c3 as fc,c2 as pc,bW as gc,bV as mc,c0 as _u,c1 as xu,bU as Tu,bx as vu,ci as Su,bC as fo,cl as Nu,bL as Ru,bM as wu,bN as Eu,bO as Au,bP as Cu,bQ as Mu,bR as Bu,bS as Pu,bG as Fu,bH as Du,bI as Lu,bF as Uu,bJ as Ou,bK as Iu,bT as ku,bA as Gu,ck as Vu,bz as po,cj as $u,M as Sf,aT as Lm,aV as Um,aU as Om,aW as Im,aS as km,aR as Gm,az as Vm,bu as $m,cw as zm,cq as Wm,by as jm,D as Vo,cF as Ml,cK as qm,cM as Hm,cL as Xm,a2 as go,bg as Km,ad as Ym,ac as Qm,Z as Zm,au as Jm,av as ey,h as ty,b6 as ny,O as sy,ai as ry,N as iy,ah as oy,ao as ay,cf as uy,d4 as ly,ap as cy,aN as dy,aX as hy,ch as Nf,a1 as Rf,b as fy,aZ as py,a$ as gy,aJ as mo,bd as wf,aK as Ef,m as Af,w as my,k as yy,x as by,cs as _y,bp as xy,y as yo,z as bo,cE as ia,b9 as oa,bc as Ty,bh as vy,aj as Sy,ak as Ny,L as Ry,cA as Bl,aD as wy,an as Ey,am as Ay,d9 as Cy,cu as yc,c7 as My,cp as bc,cN as By,c$ as Py,cH as Cf,cG as Fy,d0 as Dy}from"./three.module-BXIk8GZS.js";import{aA as Ly}from"./index-DW3dBcQk.js";import{i as fe,s as Uy,e as Pl,c as Oy,d as Iy,a as ky,b as Gy,f as Vy,t as Mf,g as $y,G as zy,T as _c,E as xc}from"./index-CumB6j2m.js";import{o as Wy,h as jy,m as qy}from"./string-DtUow4KV.js";const Hs=new bl,mn=new ce,Bf=new V,aa=new ce,to=new ce,_o=new V,zu=new V,Pf=new St,Ff=new V,Df=new V;let nt=null,qt=null;const yn=[],$n={NONE:-1,PAN:0,ROTATE:1};class Hy extends Po{constructor(e,t,n=null){super(t,n),this.objects=e,this.recursive=!0,this.transformGroup=!1,this.rotateSpeed=1,this.raycaster=new Lh,this.mouseButtons={LEFT:Qe.PAN,MIDDLE:Qe.PAN,RIGHT:Qe.ROTATE},this.touches={ONE:_n.PAN},this._onPointerMove=Xy.bind(this),this._onPointerDown=Ky.bind(this),this._onPointerCancel=Yy.bind(this),this._onContextMenu=Qy.bind(this),n!==null&&this.connect(n)}connect(e){super.connect(e),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointerup",this._onPointerCancel),this.domElement.addEventListener("pointerleave",this._onPointerCancel),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointerup",this._onPointerCancel),this.domElement.removeEventListener("pointerleave",this._onPointerCancel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.domElement.style.touchAction="",this.domElement.style.cursor=""}dispose(){this.disconnect()}_updatePointer(e){const t=this.domElement.getBoundingClientRect();mn.x=(e.clientX-t.left)/t.width*2-1,mn.y=-(e.clientY-t.top)/t.height*2+1}_updateState(e){let t;if(e.pointerType==="touch")t=this.touches.ONE;else switch(e.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=null}switch(t){case Qe.PAN:case _n.PAN:this.state=$n.PAN;break;case Qe.ROTATE:case _n.ROTATE:this.state=$n.ROTATE;break;default:this.state=$n.NONE}}}function Xy(i){const e=this.object,t=this.domElement,n=this.raycaster;if(this.enabled!==!1){if(this._updatePointer(i),n.setFromCamera(mn,e),nt)this.state===$n.PAN?n.ray.intersectPlane(Hs,_o)&&(nt.position.copy(_o.sub(Bf).applyMatrix4(Pf)),this.dispatchEvent({type:"drag",object:nt})):this.state===$n.ROTATE&&(aa.subVectors(mn,to).multiplyScalar(this.rotateSpeed),nt.rotateOnWorldAxis(Ff,aa.x),nt.rotateOnWorldAxis(Df.normalize(),-aa.y),this.dispatchEvent({type:"drag",object:nt})),to.copy(mn);else if(i.pointerType==="mouse"||i.pointerType==="pen")if(yn.length=0,n.setFromCamera(mn,e),n.intersectObjects(this.objects,this.recursive,yn),yn.length>0){const s=yn[0].object;Hs.setFromNormalAndCoplanarPoint(e.getWorldDirection(Hs.normal),zu.setFromMatrixPosition(s.matrixWorld)),qt!==s&&qt!==null&&(this.dispatchEvent({type:"hoveroff",object:qt}),t.style.cursor="auto",qt=null),qt!==s&&(this.dispatchEvent({type:"hoveron",object:s}),t.style.cursor="pointer",qt=s)}else qt!==null&&(this.dispatchEvent({type:"hoveroff",object:qt}),t.style.cursor="auto",qt=null);to.copy(mn)}}function Ky(i){const e=this.object,t=this.domElement,n=this.raycaster;this.enabled!==!1&&(this._updatePointer(i),this._updateState(i),yn.length=0,n.setFromCamera(mn,e),n.intersectObjects(this.objects,this.recursive,yn),yn.length>0&&(this.transformGroup===!0?nt=Lf(yn[0].object):nt=yn[0].object,Hs.setFromNormalAndCoplanarPoint(e.getWorldDirection(Hs.normal),zu.setFromMatrixPosition(nt.matrixWorld)),n.ray.intersectPlane(Hs,_o)&&(this.state===$n.PAN?(Pf.copy(nt.parent.matrixWorld).invert(),Bf.copy(_o).sub(zu.setFromMatrixPosition(nt.matrixWorld)),t.style.cursor="move",this.dispatchEvent({type:"dragstart",object:nt})):this.state===$n.ROTATE&&(Ff.set(0,1,0).applyQuaternion(e.quaternion).normalize(),Df.set(1,0,0).applyQuaternion(e.quaternion).normalize(),t.style.cursor="move",this.dispatchEvent({type:"dragstart",object:nt})))),to.copy(mn))}function Yy(){this.enabled!==!1&&(nt&&(this.dispatchEvent({type:"dragend",object:nt}),nt=null),this.domElement.style.cursor=qt?"pointer":"auto",this.state=$n.NONE)}function Qy(i){this.enabled!==!1&&i.preventDefault()}function Lf(i,e=null){return i.isGroup&&(e=i),i.parent===null?e:Lf(i.parent,e)}function Zy(i){eb(i);const e=Jy(i);return i.on=e.on,i.off=e.off,i.fire=e.fire,i}function Jy(i){let e=Object.create(null);return{on:function(t,n,s){if(typeof n!="function")throw new Error("callback is expected to be a function");let r=e[t];return r||(r=e[t]=[]),r.push({callback:n,ctx:s}),i},off:function(t,n){if(typeof t>"u")return e=Object.create(null),i;if(e[t])if(typeof n!="function")delete e[t];else{const o=e[t];for(let a=0;a<o.length;++a)o[a].callback===n&&o.splice(a,1)}return i},fire:function(t){const n=e[t];if(!n)return i;let s;arguments.length>1&&(s=Array.prototype.slice.call(arguments,1));for(let r=0;r<n.length;++r){const o=n[r];o.callback.apply(o.ctx,s)}return i}}}function eb(i){if(!i)throw new Error("Eventify cannot use falsy object as events subject");const e=["on","fire","off"];for(let t=0;t<e.length;++t)if(i.hasOwnProperty(e[t]))throw new Error("Subject cannot be eventified, since it already has property '"+e[t]+"'")}function tb(i){if(i=i||{},"uniqueLinkId"in i&&(console.warn("ngraph.graph: Starting from version 0.14 `uniqueLinkId` is deprecated.\nUse `multigraph` option instead\n",`
|
|
2
2
|
`,`Note: there is also change in default behavior: From now on each graph
|
|
3
3
|
is considered to be not a multigraph by default (each edge is unique).`),i.multigraph=i.uniqueLinkId),i.multigraph===void 0&&(i.multigraph=!1),typeof Map!="function")throw new Error("ngraph.graph requires `Map` to be defined. Please polyfill it before using ngraph");var e=new Map,t=new Map,n={},s=0,r=i.multigraph?S:T,o=[],a=F,u=F,l=F,c=F,d={version:20,addNode:g,addLink:_,removeLink:P,removeNode:y,getNode:m,getNodeCount:N,getLinkCount:R,getEdgeCount:R,getLinksCount:R,getNodesCount:N,getLinks:v,forEachNode:ve,forEachLinkedNode:se,forEachLink:re,beginUpdate:l,endUpdate:c,clear:ee,hasLink:L,hasNode:m,getLink:L,getLinkById:j};return Zy(d),h(),d;function h(){var I=d.on;d.on=H;function H(){return d.beginUpdate=l=G,d.endUpdate=c=Q,a=f,u=p,d.on=I,I.apply(d,arguments)}}function f(I,H){o.push({link:I,changeType:H})}function p(I,H){o.push({node:I,changeType:H})}function g(I,H){if(I===void 0)throw new Error("Invalid node identifier");l();var le=m(I);return le?(le.data=H,u(le,"update")):(le=new nb(I,H),u(le,"add")),e.set(I,le),c(),le}function m(I){return e.get(I)}function y(I){var H=m(I);if(!H)return!1;l();var le=H.links;return le&&(le.forEach(D),H.links=null),e.delete(I),u(H,"remove"),c(),!0}function _(I,H,le){l();var Ce=m(I)||g(I),B=m(H)||g(H),U=r(I,H,le),K=t.has(U.id);return t.set(U.id,U),Tc(Ce,U),I!==H&&Tc(B,U),a(U,K?"update":"add"),c(),U}function T(I,H,le){var Ce=hi(I,H),B=t.get(Ce);return B?(B.data=le,B):new vc(I,H,le,Ce)}function S(I,H,le){var Ce=hi(I,H),B=n.hasOwnProperty(Ce);if(B||L(I,H)){B||(n[Ce]=0);var U="@"+ ++n[Ce];Ce=hi(I+U,H+U)}return new vc(I,H,le,Ce)}function N(){return e.size}function R(){return t.size}function v(I){var H=m(I);return H?H.links:null}function P(I,H){return H!==void 0&&(I=L(I,H)),D(I)}function D(I){if(!I||!t.get(I.id))return!1;l(),t.delete(I.id);var H=m(I.fromId),le=m(I.toId);return H&&H.links.delete(I),le&&le.links.delete(I),a(I,"remove"),c(),!0}function L(I,H){if(!(I===void 0||H===void 0))return t.get(hi(I,H))}function j(I){if(I!==void 0)return t.get(I)}function ee(){l(),ve(function(I){y(I.id)}),c()}function re(I){if(typeof I=="function")for(var H=t.values(),le=H.next();!le.done;){if(I(le.value))return!0;le=H.next()}}function se(I,H,le){var Ce=m(I);if(Ce&&Ce.links&&typeof H=="function")return le?oe(Ce.links,I,H):Z(Ce.links,I,H)}function Z(I,H,le){for(var Ce,B=I.values(),U=B.next();!U.done;){var K=U.value,me=K.fromId===H?K.toId:K.fromId;if(Ce=le(e.get(me),K),Ce)return!0;U=B.next()}}function oe(I,H,le){for(var Ce,B=I.values(),U=B.next();!U.done;){var K=U.value;if(K.fromId===H&&(Ce=le(e.get(K.toId),K),Ce))return!0;U=B.next()}}function F(){}function G(){s+=1}function Q(){s-=1,s===0&&o.length>0&&(d.fire("changed",o),o.length=0)}function ve(I){if(typeof I!="function")throw new Error("Function is expected to iterate over graph nodes. You passed "+I);for(var H=e.values(),le=H.next();!le.done;){if(I(le.value))return!0;le=H.next()}}}function nb(i,e){this.id=i,this.links=null,this.data=e}function Tc(i,e){i.links?i.links.add(e):i.links=new Set([e])}function vc(i,e,t,n){this.fromId=i,this.toId=e,this.data=t,this.id=n}function hi(i,e){return i.toString()+"👉 "+e.toString()}var fi={exports:{}},Cs={exports:{}},ua,Sc;function Uf(){return Sc||(Sc=1,ua=function(e){return e===0?"x":e===1?"y":e===2?"z":"c"+(e+1)}),ua}var la,Nc;function ar(){if(Nc)return la;Nc=1;const i=Uf();return la=function(t){return n;function n(s,r){let o=r&&r.indent||0,a=r&&r.join!==void 0?r.join:`
|
|
4
4
|
`,u=Array(o+1).join(" "),l=[];for(let c=0;c<t;++c){let d=i(c),h=c===0?"":u;l.push(h+s.replace(/{var}/g,d))}return l.join(a)}},la}var Rc;function sb(){if(Rc)return Cs.exports;Rc=1;const i=ar();Cs.exports=e,Cs.exports.generateCreateBodyFunctionBody=t,Cs.exports.getVectorCode=s,Cs.exports.getBodyCode=n;function e(r,o){let a=t(r,o),{Body:u}=new Function(a)();return u}function t(r,o){return`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Ke=Object.defineProperty;var Je=(e,t,r)=>t in e?Ke(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var w=(e,t,r)=>Je(e,typeof t!="symbol"?t+"":t,r);import{aL as et,bm as ke,ba as tt,bd as f,R as Z,O as Oe,be as rt,aO as d}from"./index-MQh8C4aJ.js";import{u as at,b as nt,r as st}from"./useProjectActivity-Cxr4QGX1.js";function ot(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function le(e,t,r=""){const o=ot(e),a=e==null?void 0:e.length;if(!o||t!==void 0){const i=r&&`"${r}" `,s="",u=o?`length=${a}`:`type=${typeof e}`,p=i+"expected Uint8Array"+s+", got "+u;throw o?new RangeError(p):new TypeError(p)}return e}function be(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function it(e,t){le(e,void 0,"digestInto() output");const r=t.outputLen;if(e.length<r)throw new RangeError('"digestInto() output" expected to be of length >='+r)}function ce(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function se(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function C(e,t){return e<<32-t|e>>>t}const ct=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",lt=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function ut(e){if(le(e),ct)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=lt[e[r]];return t}function pt(e){if(typeof e!="string")throw new TypeError("string expected");return new Uint8Array(new TextEncoder().encode(e))}function dt(e,t={}){const r=(a,n)=>e(n).update(a).digest(),o=e(void 0);return r.outputLen=o.outputLen,r.blockLen=o.blockLen,r.canXOF=o.canXOF,r.create=a=>e(a),Object.assign(r,t),Object.freeze(r)}const ft=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function ht(e,t,r){return e&t^~e&r}function mt(e,t,r){return e&t^e&r^t&r}class gt{constructor(t,r,o,a){w(this,"blockLen");w(this,"outputLen");w(this,"canXOF",!1);w(this,"padOffset");w(this,"isLE");w(this,"buffer");w(this,"view");w(this,"finished",!1);w(this,"length",0);w(this,"pos",0);w(this,"destroyed",!1);this.blockLen=t,this.outputLen=r,this.padOffset=o,this.isLE=a,this.buffer=new Uint8Array(t),this.view=se(this.buffer)}update(t){be(this),le(t);const{view:r,buffer:o,blockLen:a}=this,n=t.length;for(let i=0;i<n;){const s=Math.min(a-this.pos,n-i);if(s===a){const u=se(t);for(;a<=n-i;i+=a)this.process(u,i);continue}o.set(t.subarray(i,i+s),this.pos),this.pos+=s,i+=s,this.pos===a&&(this.process(r,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){be(this),it(t,this),this.finished=!0;const{buffer:r,view:o,blockLen:a,isLE:n}=this;let{pos:i}=this;r[i++]=128,ce(this.buffer.subarray(i)),this.padOffset>a-i&&(this.process(o,0),i=0);for(let l=i;l<a;l++)r[l]=0;o.setBigUint64(a-8,BigInt(this.length*8),n),this.process(o,0);const s=se(t),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen must be aligned to 32bit");const p=u/4,h=this.get();if(p>h.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;l<p;l++)s.setUint32(4*l,h[l],n)}digest(){const{buffer:t,outputLen:r}=this;this.digestInto(t);const o=t.slice(0,r);return this.destroy(),o}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:r,buffer:o,length:a,finished:n,destroyed:i,pos:s}=this;return t.destroyed=i,t.finished=n,t.length=a,t.pos=s,a%r&&t.buffer.set(o),t}clone(){return this._cloneInto()}}const $=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),bt=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),I=new Uint32Array(64);class yt extends gt{constructor(t){super(64,t,8,!1)}get(){const{A:t,B:r,C:o,D:a,E:n,F:i,G:s,H:u}=this;return[t,r,o,a,n,i,s,u]}set(t,r,o,a,n,i,s,u){this.A=t|0,this.B=r|0,this.C=o|0,this.D=a|0,this.E=n|0,this.F=i|0,this.G=s|0,this.H=u|0}process(t,r){for(let l=0;l<16;l++,r+=4)I[l]=t.getUint32(r,!1);for(let l=16;l<64;l++){const b=I[l-15],g=I[l-2],S=C(b,7)^C(b,18)^b>>>3,v=C(g,17)^C(g,19)^g>>>10;I[l]=v+I[l-7]+S+I[l-16]|0}let{A:o,B:a,C:n,D:i,E:s,F:u,G:p,H:h}=this;for(let l=0;l<64;l++){const b=C(s,6)^C(s,11)^C(s,25),g=h+b+ht(s,u,p)+bt[l]+I[l]|0,v=(C(o,2)^C(o,13)^C(o,22))+mt(o,a,n)|0;h=p,p=u,u=s,s=i+g|0,i=n,n=a,a=o,o=g+v|0}o=o+this.A|0,a=a+this.B|0,n=n+this.C|0,i=i+this.D|0,s=s+this.E|0,u=u+this.F|0,p=p+this.G|0,h=h+this.H|0,this.set(o,a,n,i,s,u,p,h)}roundClean(){ce(I)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),ce(this.buffer)}}class wt extends yt{constructor(){super(32);w(this,"A",$[0]|0);w(this,"B",$[1]|0);w(this,"C",$[2]|0);w(this,"D",$[3]|0);w(this,"E",$[4]|0);w(this,"F",$[5]|0);w(this,"G",$[6]|0);w(this,"H",$[7]|0)}}const vt=dt(()=>new wt,ft(1));var A;(function(e){e.WorkingMemory="WM",e.SharedWorkingMemory="SWM",e.VerifiableMemory="VM"})(A||(A={}));function oe(e){switch(e){case A.WorkingMemory:return"_working_memory";case A.SharedWorkingMemory:return"_shared_memory";case A.VerifiableMemory:return"_verifiable_memory"}}var ye;(function(e){e[e.SelfAttested=0]="SelfAttested",e[e.Endorsed=1]="Endorsed",e[e.PartiallyVerified=2]="PartiallyVerified",e[e.ConsensusVerified=3]="ConsensusVerified"})(ye||(ye={}));var we;(function(e){e.CREATE="CREATE",e.UPDATE="UPDATE"})(we||(we={}));A.WorkingMemory,A.SharedWorkingMemory,A.VerifiableMemory,A.VerifiableMemory;A.WorkingMemory,A.SharedWorkingMemory,A.SharedWorkingMemory,A.VerifiableMemory;const At=["working-memory","shared-working-memory","verifiable-memory"],St=(1n<<72n)-1n;St.toString();oe(A.WorkingMemory),A.WorkingMemory,oe(A.SharedWorkingMemory),A.SharedWorkingMemory,oe(A.VerifiableMemory),A.VerifiableMemory;function Le(e,t){return`did:dkg:context-graph:${e}/${t}`}function $e(e){return!e||e.length===0?{valid:!1,reason:"Sub-graph name cannot be empty"}:e.startsWith("_")?{valid:!1,reason:'Sub-graph names starting with "_" are reserved for protocol graphs'}:e.includes("/")?{valid:!1,reason:'Sub-graph names cannot contain "/"'}:/[<>"{}|^`\\\s]/.test(e)?{valid:!1,reason:"Sub-graph name contains characters unsafe for IRIs"}:e==="context"||e==="assertion"||e==="draft"?{valid:!1,reason:`"${e}" is a reserved path segment`}:{valid:!0}}const Et=["string","integer","number","boolean","iri"],xt=/^[A-Za-z][A-Za-z0-9_]*$/,Ct=/^[+-]?\d+$/,Nt=/^[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:[eE][+-]?\d+)?$/;function F(e){if(e==null||e==="")return[];if(!Array.isArray(e))throw new Error("Query parameters must be an array.");const t=new Set;return e.map((r,o)=>{if(!r||typeof r!="object"||Array.isArray(r))throw new Error(`Query parameter at index ${o} must be an object.`);const a=r,n=typeof a.name=="string"?a.name.trim():"";if(!xt.test(n))throw new Error(`Query parameter at index ${o} has an invalid name: ${n||"<empty>"}.`);if(t.has(n))throw new Error(`Duplicate query parameter: ${n}.`);t.add(n);const i=a.type;if(typeof i!="string"||!Et.includes(i))throw new Error(`Query parameter ${n} has an unsupported type: ${String(i)}.`);const s={name:n,type:i};typeof a.label=="string"&&a.label.trim()&&(s.label=a.label.trim()),typeof a.description=="string"&&a.description.trim()&&(s.description=a.description.trim());let u;if(a.required!==void 0){if(typeof a.required!="boolean")throw new Error(`Query parameter ${n} required must be a boolean.`);u=a.required}const p=a.defaultValue!==void 0;if(p){if(!je(a.defaultValue))throw new Error(`Query parameter ${n} has an invalid defaultValue.`);Te(s,a.defaultValue),s.defaultValue=a.defaultValue}if(u===!0&&p)throw new Error(`Required query parameter ${n} cannot declare a defaultValue.`);if(u===!1&&!p)throw new Error(`Optional query parameter ${n} must declare a defaultValue.`);return s})}function hr(e){return e.defaultValue===void 0}function Pt(e){return JSON.stringify(F(e))}function Rt(e){const t=[];for(const r of _e(e))t.includes(r.name)||t.push(r.name);return t}function Ie(e,t){const r=F(t),o=new Set(r.map(n=>n.name)),a=new Set(Rt(e));for(const n of a)if(!o.has(n))throw new Error(`SPARQL template uses undeclared query parameter: ${n}.`);for(const n of r)if(!a.has(n.name))throw new Error(`Query parameter ${n.name} is not used by the SPARQL template.`)}function kt(e,t,r){const o=F(t);Ie(e,o);const a=new Set(o.map(p=>p.name));for(const p of Object.keys(r))if(!a.has(p))throw new Error(`Unknown query parameter: ${p}.`);const n=new Map;for(const p of o){const h=r[p.name],l=ve(h)?p.defaultValue:h;if(ve(l))throw new Error(`Missing required query parameter: ${p.name}.`);if(!je(l))throw new Error(`Query parameter ${p.name} must be a string, number, or boolean.`);n.set(p.name,Te(p,l))}const i=_e(e);let s="",u=0;for(const p of i)s+=e.slice(u,p.start),s+=n.get(p.name),u=p.end;return s+e.slice(u)}function Te(e,t){switch(e.type){case"string":return ke(String(t));case"integer":{const r=String(t).trim();if(!Ct.test(r))throw new Error(`Query parameter ${e.name} must be an integer.`);return r}case"number":{const r=String(t).trim();if(!Nt.test(r))throw new Error(`Query parameter ${e.name} must be a number.`);return r}case"boolean":{if(t===!0||t==="true")return"true";if(t===!1||t==="false")return"false";throw new Error(`Query parameter ${e.name} must be true or false.`)}case"iri":{const r=String(t).trim();if(!et(r))throw new Error(`Query parameter ${e.name} must be a safe absolute IRI.`);return`<${r}>`}}}function je(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function ve(e){return e==null}function _e(e){const t=[...e.matchAll(/\{\{([A-Za-z][A-Za-z0-9_]*)\}\}/g)],r=e.replace(/\{\{([A-Za-z][A-Za-z0-9_]*)\}\}/g,n=>"0".repeat(n.length)),o=tt(r);if(o.status!=="valid")throw new Error("SPARQL template contains invalid lexical syntax.");const a=[];for(const n of t){const i=n.index;if(o.masked[i]===" ")continue;const s=i+n[0].length,u=e[i-1],p=e[s];if(u&&/[A-Za-z0-9_?:.%~-]/.test(u)||p&&/[A-Za-z0-9_?:.%~-]/.test(p))throw new Error(`Query parameter ${n[1]} must occupy a complete SPARQL term position.`);a.push({name:n[1],start:i,end:s})}return a}const Ot=2,ue="__context_graph",mr="ui-saved-queries",gr="Saved queries",E="http://dkg.io/ontology/profile/",Ae="http://schema.org/",Se="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",Lt="http://www.w3.org/2001/XMLSchema#integer";class k extends Error{constructor(r="Incompatible query-catalog daemon contract. Upgrade the daemon and retry."){super(r);w(this,"code","QUERY_CATALOG_CONTRACT_INCOMPATIBLE");this.name="QueryCatalogContractError"}}function $t(e,t){if(t===ue)return`did:dkg:context-graph:${e}`;const r=$e(t);if(!r.valid)throw new Error(`Invalid query-catalog subgraph "${t}": ${r.reason}`);return Le(e,t)}function It(e,t){const r=`did:dkg:context-graph:${e}`;if(t===r)return ue;const o=`${r}/`;if(!t.startsWith(o))throw new Error(`Query-catalog scope graph <${t}> is outside context graph "${e}".`);const a=t.slice(o.length),n=$e(a);if(!n.valid)throw new Error(`Invalid query-catalog scope graph <${t}>: ${n.reason}`);if(Le(e,a)!==t)throw new Error(`Query-catalog scope graph <${t}> is not a canonical subgraph IRI.`);return a}function br(e,t={}){return{sparql:kt(e.sparql,e.parameters,t),...e.view?{view:e.view}:{},...e.subGraph&&e.subGraph!==ue?{subGraphName:e.subGraph}:{}}}function Tt(e){return At.includes(e)?e:void 0}function jt(e){if(!e||typeof e!="object"||Array.isArray(e))throw new k;const t=e,r=t.capabilities;if(t.schemaVersion!==Ot||(r==null?void 0:r.canonicalItems)!==!0||(r==null?void 0:r.queryParameters)!==!0||(r==null?void 0:r.executionView)!==!0||(r==null?void 0:r.graphScopeIri)!==!0||!Array.isArray(t.items))throw new k;return t.items.map((o,a)=>{if(!o||typeof o!="object"||Array.isArray(o))throw new k(`Invalid query-catalog item at index ${a}.`);const n=o,i=["queryIri","catalogIri","slug","name","sparql","catalogSlug","catalogName","subGraph","scopeGraph"];for(const l of i)if(typeof n[l]!="string")throw new k(`Invalid query-catalog item ${a}: ${l} must be a string.`);if(typeof n.rank!="number"||!Number.isFinite(n.rank)||typeof n.catalogRank!="number"||!Number.isFinite(n.catalogRank))throw new k(`Invalid query-catalog item ${a}: ranks must be finite numbers.`);const s=n.view===void 0?void 0:Tt(String(n.view));if(n.view!==void 0&&s===void 0)throw new k(`Invalid query-catalog item ${a}: unsupported execution view.`);const u=n.scopeGraph,p=typeof t.contextGraphId=="string"?t.contextGraphId:void 0;if(!p)throw new k("Invalid query-catalog response: contextGraphId must be a string.");let h;try{h=It(p,u)}catch(l){throw new k(`Invalid query-catalog item ${a}: ${l instanceof Error?l.message:String(l)}`)}if(h!==n.subGraph)throw new k(`Invalid query-catalog item ${a}: scopeGraph and subGraph do not match.`);return{queryIri:n.queryIri,catalogIri:n.catalogIri,slug:n.slug,name:n.name,...typeof n.description=="string"?{description:n.description}:{},sparql:n.sparql,...typeof n.resultColumn=="string"?{resultColumn:n.resultColumn}:{},rank:n.rank,catalogSlug:n.catalogSlug,catalogName:n.catalogName,...typeof n.catalogDescription=="string"?{catalogDescription:n.catalogDescription}:{},catalogRank:n.catalogRank,subGraph:n.subGraph,scopeGraph:u,parameters:F(n.parameters),...s?{view:s}:{}}})}function _t(e){const t=new Map;for(const r of e){const o=`${r.subGraph}|${r.catalogSlug}`,a=t.get(o);if(a){if(a.name!==r.catalogName||a.description!==r.catalogDescription||a.rank!==r.catalogRank)throw new Error(`Query catalog ${r.catalogSlug} has conflicting metadata.`);a.queries.push(r);continue}t.set(o,{slug:r.catalogSlug,subGraph:r.subGraph,name:r.catalogName,description:r.catalogDescription,rank:r.catalogRank,queries:[r]})}return[...t.values()].map(r=>({...r,queries:[...r.queries].sort((o,a)=>o.rank-a.rank||o.name.localeCompare(a.name))})).sort((r,o)=>r.subGraph.localeCompare(o.subGraph)||r.rank-o.rank||r.name.localeCompare(o.name))}function Mt(e){return e.trim().toLowerCase().normalize("NFKD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48)||"saved-query"}function Ee(e,t,r){return`urn:dkg:profile:${encodeURIComponent(e)}:${t}:${encodeURIComponent(r)}`}function Gt(e){return ut(vt(pt(e)))}function N(e){return JSON.stringify(e)}function xe(e){return`"${e}"^^<${Lt}>`}function yr(e){const t=F(e.parameters),r=JSON.stringify({subGraph:e.subGraph,catalogSlug:e.catalogSlug,name:e.name,description:e.description,sparql:e.sparql,resultColumn:e.resultColumn,rank:e.rank,parameters:t,view:e.view}),o=`${Mt(e.name)}-${Gt(r)}`,a=Ee(e.contextGraphId,"catalog",e.catalogSlug),n=Ee(e.contextGraphId,"query",o),i=$t(e.contextGraphId,e.subGraph);Ie(e.sparql,t);const s=[{subject:a,predicate:Se,object:`${E}QueryCatalog`,graph:""},{subject:a,predicate:`${E}scopeGraph`,object:i,graph:""},{subject:a,predicate:`${E}forSubGraph`,object:N(e.subGraph),graph:""},{subject:a,predicate:`${E}displayName`,object:N(e.catalogName),graph:""},{subject:a,predicate:`${E}rank`,object:xe(e.catalogRank),graph:""},{subject:n,predicate:Se,object:`${E}SavedQuery`,graph:""},{subject:n,predicate:`${E}scopeGraph`,object:i,graph:""},{subject:n,predicate:`${E}forSubGraph`,object:N(e.subGraph),graph:""},{subject:n,predicate:`${E}inCatalog`,object:a,graph:""},{subject:n,predicate:`${E}displayName`,object:N(e.name),graph:""},{subject:n,predicate:`${E}sparqlQuery`,object:N(e.sparql),graph:""},{subject:n,predicate:`${E}rank`,object:xe(e.rank),graph:""}];return e.catalogDescription&&s.push({subject:a,predicate:`${Ae}description`,object:N(e.catalogDescription),graph:""}),e.description&&s.push({subject:n,predicate:`${Ae}description`,object:N(e.description),graph:""}),e.resultColumn&&s.push({subject:n,predicate:`${E}resultColumn`,object:N(e.resultColumn),graph:""}),t.length>0&&s.push({subject:n,predicate:`${E}queryParameters`,object:N(Pt(t)),graph:""}),e.view&&s.push({subject:n,predicate:`${E}executionView`,object:N(e.view),graph:""}),{savedQuery:{queryIri:n,catalogIri:a,slug:o,name:e.name,description:e.description,sparql:e.sparql,resultColumn:e.resultColumn,rank:e.rank,catalogSlug:e.catalogSlug,catalogName:e.catalogName,catalogDescription:e.catalogDescription,catalogRank:e.catalogRank,subGraph:e.subGraph,scopeGraph:i,parameters:t,view:e.view,queryUri:n,catalogUri:a},quads:s}}const Ut=new Set(["meta"]),Me="__root__";function wr(e){return!Ut.has(e.name)}function G(e){const t=`did:dkg:context-graph:${e}/meta`;return`FILTER(strstarts(str(?g), ${ke(t)}))`}async function H(e,t){var o;const r=await Oe(e,{contextGraphId:t});return((o=r==null?void 0:r.result)==null?void 0:o.bindings)??[]}async function Qt(e){const t=await rt(e);return jt(t)}const P={displayName:"Project",primaryColor:"#a855f7",accentColor:"#22c55e"},Ce=e=>({slug:e,displayName:e,icon:"•",color:"#64748b",rank:99}),qt={slug:Me,displayName:"Root",description:"Entities not in any subgraph (Context Graph root)",icon:"⊘",rank:99},Ne=e=>({typeIri:e,label:e.split(/[/#]/).pop()||e,color:"#64748b"}),B="http://dkg.io/ontology/profile/";function Ge(e){if(e==null)return"";if(typeof e=="string")return e;if(typeof e=="object"&&"value"in e){const t=e.value;return t==null?"":String(t)}return String(e)}function m(e){const t=Ge(e);if(!t)return"";const r=t.match(/^"((?:[^"\\]|\\.)*)"(?:@[\w-]+|\^\^<[^>]+>)?$/);return r?r[1].replace(/\\"/g,'"').replace(/\\n/g,`
|
|
1
|
+
var Ke=Object.defineProperty;var Je=(e,t,r)=>t in e?Ke(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var w=(e,t,r)=>Je(e,typeof t!="symbol"?t+"":t,r);import{aM as et,bn as ke,bb as tt,be as f,R as Z,O as Oe,bf as rt,aP as d}from"./index-DW3dBcQk.js";import{u as at,b as nt,r as st}from"./useProjectActivity-BOgGdtS7.js";function ot(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function le(e,t,r=""){const o=ot(e),a=e==null?void 0:e.length;if(!o||t!==void 0){const i=r&&`"${r}" `,s="",u=o?`length=${a}`:`type=${typeof e}`,p=i+"expected Uint8Array"+s+", got "+u;throw o?new RangeError(p):new TypeError(p)}return e}function be(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function it(e,t){le(e,void 0,"digestInto() output");const r=t.outputLen;if(e.length<r)throw new RangeError('"digestInto() output" expected to be of length >='+r)}function ce(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function se(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function C(e,t){return e<<32-t|e>>>t}const ct=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",lt=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function ut(e){if(le(e),ct)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=lt[e[r]];return t}function pt(e){if(typeof e!="string")throw new TypeError("string expected");return new Uint8Array(new TextEncoder().encode(e))}function dt(e,t={}){const r=(a,n)=>e(n).update(a).digest(),o=e(void 0);return r.outputLen=o.outputLen,r.blockLen=o.blockLen,r.canXOF=o.canXOF,r.create=a=>e(a),Object.assign(r,t),Object.freeze(r)}const ft=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function ht(e,t,r){return e&t^~e&r}function mt(e,t,r){return e&t^e&r^t&r}class gt{constructor(t,r,o,a){w(this,"blockLen");w(this,"outputLen");w(this,"canXOF",!1);w(this,"padOffset");w(this,"isLE");w(this,"buffer");w(this,"view");w(this,"finished",!1);w(this,"length",0);w(this,"pos",0);w(this,"destroyed",!1);this.blockLen=t,this.outputLen=r,this.padOffset=o,this.isLE=a,this.buffer=new Uint8Array(t),this.view=se(this.buffer)}update(t){be(this),le(t);const{view:r,buffer:o,blockLen:a}=this,n=t.length;for(let i=0;i<n;){const s=Math.min(a-this.pos,n-i);if(s===a){const u=se(t);for(;a<=n-i;i+=a)this.process(u,i);continue}o.set(t.subarray(i,i+s),this.pos),this.pos+=s,i+=s,this.pos===a&&(this.process(r,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){be(this),it(t,this),this.finished=!0;const{buffer:r,view:o,blockLen:a,isLE:n}=this;let{pos:i}=this;r[i++]=128,ce(this.buffer.subarray(i)),this.padOffset>a-i&&(this.process(o,0),i=0);for(let l=i;l<a;l++)r[l]=0;o.setBigUint64(a-8,BigInt(this.length*8),n),this.process(o,0);const s=se(t),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen must be aligned to 32bit");const p=u/4,h=this.get();if(p>h.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;l<p;l++)s.setUint32(4*l,h[l],n)}digest(){const{buffer:t,outputLen:r}=this;this.digestInto(t);const o=t.slice(0,r);return this.destroy(),o}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:r,buffer:o,length:a,finished:n,destroyed:i,pos:s}=this;return t.destroyed=i,t.finished=n,t.length=a,t.pos=s,a%r&&t.buffer.set(o),t}clone(){return this._cloneInto()}}const I=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),bt=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),L=new Uint32Array(64);class yt extends gt{constructor(t){super(64,t,8,!1)}get(){const{A:t,B:r,C:o,D:a,E:n,F:i,G:s,H:u}=this;return[t,r,o,a,n,i,s,u]}set(t,r,o,a,n,i,s,u){this.A=t|0,this.B=r|0,this.C=o|0,this.D=a|0,this.E=n|0,this.F=i|0,this.G=s|0,this.H=u|0}process(t,r){for(let l=0;l<16;l++,r+=4)L[l]=t.getUint32(r,!1);for(let l=16;l<64;l++){const b=L[l-15],g=L[l-2],S=C(b,7)^C(b,18)^b>>>3,v=C(g,17)^C(g,19)^g>>>10;L[l]=v+L[l-7]+S+L[l-16]|0}let{A:o,B:a,C:n,D:i,E:s,F:u,G:p,H:h}=this;for(let l=0;l<64;l++){const b=C(s,6)^C(s,11)^C(s,25),g=h+b+ht(s,u,p)+bt[l]+L[l]|0,v=(C(o,2)^C(o,13)^C(o,22))+mt(o,a,n)|0;h=p,p=u,u=s,s=i+g|0,i=n,n=a,a=o,o=g+v|0}o=o+this.A|0,a=a+this.B|0,n=n+this.C|0,i=i+this.D|0,s=s+this.E|0,u=u+this.F|0,p=p+this.G|0,h=h+this.H|0,this.set(o,a,n,i,s,u,p,h)}roundClean(){ce(L)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),ce(this.buffer)}}class wt extends yt{constructor(){super(32);w(this,"A",I[0]|0);w(this,"B",I[1]|0);w(this,"C",I[2]|0);w(this,"D",I[3]|0);w(this,"E",I[4]|0);w(this,"F",I[5]|0);w(this,"G",I[6]|0);w(this,"H",I[7]|0)}}const vt=dt(()=>new wt,ft(1));var A;(function(e){e.WorkingMemory="WM",e.SharedWorkingMemory="SWM",e.VerifiableMemory="VM"})(A||(A={}));function oe(e){switch(e){case A.WorkingMemory:return"_working_memory";case A.SharedWorkingMemory:return"_shared_memory";case A.VerifiableMemory:return"_verifiable_memory"}}var ye;(function(e){e[e.SelfAttested=0]="SelfAttested",e[e.Endorsed=1]="Endorsed",e[e.PartiallyVerified=2]="PartiallyVerified",e[e.ConsensusVerified=3]="ConsensusVerified"})(ye||(ye={}));var we;(function(e){e.CREATE="CREATE",e.UPDATE="UPDATE"})(we||(we={}));A.WorkingMemory,A.SharedWorkingMemory,A.VerifiableMemory,A.VerifiableMemory;A.WorkingMemory,A.SharedWorkingMemory,A.SharedWorkingMemory,A.VerifiableMemory;const At=["working-memory","shared-working-memory","verifiable-memory"],St=(1n<<72n)-1n;St.toString();oe(A.WorkingMemory),A.WorkingMemory,oe(A.SharedWorkingMemory),A.SharedWorkingMemory,oe(A.VerifiableMemory),A.VerifiableMemory;function $e(e,t){return`did:dkg:context-graph:${e}/${t}`}function Ie(e){return!e||e.length===0?{valid:!1,reason:"Sub-graph name cannot be empty"}:e.startsWith("_")?{valid:!1,reason:'Sub-graph names starting with "_" are reserved for protocol graphs'}:e.includes("/")?{valid:!1,reason:'Sub-graph names cannot contain "/"'}:/[<>"{}|^`\\\s]/.test(e)?{valid:!1,reason:"Sub-graph name contains characters unsafe for IRIs"}:e==="context"||e==="assertion"||e==="draft"?{valid:!1,reason:`"${e}" is a reserved path segment`}:{valid:!0}}const Et=["string","integer","number","boolean","iri"],xt=/^[A-Za-z][A-Za-z0-9_]*$/,Ct=/^[+-]?\d+$/,Nt=/^[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:[eE][+-]?\d+)?$/;function F(e){if(e==null||e==="")return[];if(!Array.isArray(e))throw new Error("Query parameters must be an array.");const t=new Set;return e.map((r,o)=>{if(!r||typeof r!="object"||Array.isArray(r))throw new Error(`Query parameter at index ${o} must be an object.`);const a=r,n=typeof a.name=="string"?a.name.trim():"";if(!xt.test(n))throw new Error(`Query parameter at index ${o} has an invalid name: ${n||"<empty>"}.`);if(t.has(n))throw new Error(`Duplicate query parameter: ${n}.`);t.add(n);const i=a.type;if(typeof i!="string"||!Et.includes(i))throw new Error(`Query parameter ${n} has an unsupported type: ${String(i)}.`);const s={name:n,type:i};typeof a.label=="string"&&a.label.trim()&&(s.label=a.label.trim()),typeof a.description=="string"&&a.description.trim()&&(s.description=a.description.trim());let u;if(a.required!==void 0){if(typeof a.required!="boolean")throw new Error(`Query parameter ${n} required must be a boolean.`);u=a.required}const p=a.defaultValue!==void 0;if(p){if(!je(a.defaultValue))throw new Error(`Query parameter ${n} has an invalid defaultValue.`);Te(s,a.defaultValue),s.defaultValue=a.defaultValue}if(u===!0&&p)throw new Error(`Required query parameter ${n} cannot declare a defaultValue.`);if(u===!1&&!p)throw new Error(`Optional query parameter ${n} must declare a defaultValue.`);return s})}function hr(e){return e.defaultValue===void 0}function Pt(e){return JSON.stringify(F(e))}function Rt(e){const t=[];for(const r of _e(e))t.includes(r.name)||t.push(r.name);return t}function Le(e,t){const r=F(t),o=new Set(r.map(n=>n.name)),a=new Set(Rt(e));for(const n of a)if(!o.has(n))throw new Error(`SPARQL template uses undeclared query parameter: ${n}.`);for(const n of r)if(!a.has(n.name))throw new Error(`Query parameter ${n.name} is not used by the SPARQL template.`)}function kt(e,t,r){const o=F(t);Le(e,o);const a=new Set(o.map(p=>p.name));for(const p of Object.keys(r))if(!a.has(p))throw new Error(`Unknown query parameter: ${p}.`);const n=new Map;for(const p of o){const h=r[p.name],l=ve(h)?p.defaultValue:h;if(ve(l))throw new Error(`Missing required query parameter: ${p.name}.`);if(!je(l))throw new Error(`Query parameter ${p.name} must be a string, number, or boolean.`);n.set(p.name,Te(p,l))}const i=_e(e);let s="",u=0;for(const p of i)s+=e.slice(u,p.start),s+=n.get(p.name),u=p.end;return s+e.slice(u)}function Te(e,t){switch(e.type){case"string":return ke(String(t));case"integer":{const r=String(t).trim();if(!Ct.test(r))throw new Error(`Query parameter ${e.name} must be an integer.`);return r}case"number":{const r=String(t).trim();if(!Nt.test(r))throw new Error(`Query parameter ${e.name} must be a number.`);return r}case"boolean":{if(t===!0||t==="true")return"true";if(t===!1||t==="false")return"false";throw new Error(`Query parameter ${e.name} must be true or false.`)}case"iri":{const r=String(t).trim();if(!et(r))throw new Error(`Query parameter ${e.name} must be a safe absolute IRI.`);return`<${r}>`}}}function je(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function ve(e){return e==null}function _e(e){const t=[...e.matchAll(/\{\{([A-Za-z][A-Za-z0-9_]*)\}\}/g)],r=e.replace(/\{\{([A-Za-z][A-Za-z0-9_]*)\}\}/g,n=>"0".repeat(n.length)),o=tt(r);if(o.status!=="valid")throw new Error("SPARQL template contains invalid lexical syntax.");const a=[];for(const n of t){const i=n.index;if(o.masked[i]===" ")continue;const s=i+n[0].length,u=e[i-1],p=e[s];if(u&&/[A-Za-z0-9_?:.%~-]/.test(u)||p&&/[A-Za-z0-9_?:.%~-]/.test(p))throw new Error(`Query parameter ${n[1]} must occupy a complete SPARQL term position.`);a.push({name:n[1],start:i,end:s})}return a}const Ot=2,ue="__context_graph",mr="ui-saved-queries",gr="Saved queries",E="http://dkg.io/ontology/profile/",Ae="http://schema.org/",Se="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",$t="http://www.w3.org/2001/XMLSchema#integer";class k extends Error{constructor(r="Incompatible query-catalog daemon contract. Upgrade the daemon and retry."){super(r);w(this,"code","QUERY_CATALOG_CONTRACT_INCOMPATIBLE");this.name="QueryCatalogContractError"}}function It(e,t){if(t===ue)return`did:dkg:context-graph:${e}`;const r=Ie(t);if(!r.valid)throw new Error(`Invalid query-catalog subgraph "${t}": ${r.reason}`);return $e(e,t)}function Lt(e,t){const r=`did:dkg:context-graph:${e}`;if(t===r)return ue;const o=`${r}/`;if(!t.startsWith(o))throw new Error(`Query-catalog scope graph <${t}> is outside context graph "${e}".`);const a=t.slice(o.length),n=Ie(a);if(!n.valid)throw new Error(`Invalid query-catalog scope graph <${t}>: ${n.reason}`);if($e(e,a)!==t)throw new Error(`Query-catalog scope graph <${t}> is not a canonical subgraph IRI.`);return a}function br(e,t={}){return{sparql:kt(e.sparql,e.parameters,t),...e.view?{view:e.view}:{},...e.subGraph&&e.subGraph!==ue?{subGraphName:e.subGraph}:{}}}function Tt(e){return At.includes(e)?e:void 0}function jt(e){if(!e||typeof e!="object"||Array.isArray(e))throw new k;const t=e,r=t.capabilities;if(t.schemaVersion!==Ot||(r==null?void 0:r.canonicalItems)!==!0||(r==null?void 0:r.queryParameters)!==!0||(r==null?void 0:r.executionView)!==!0||(r==null?void 0:r.graphScopeIri)!==!0||!Array.isArray(t.items))throw new k;return t.items.map((o,a)=>{if(!o||typeof o!="object"||Array.isArray(o))throw new k(`Invalid query-catalog item at index ${a}.`);const n=o,i=["queryIri","catalogIri","slug","name","sparql","catalogSlug","catalogName","subGraph","scopeGraph"];for(const l of i)if(typeof n[l]!="string")throw new k(`Invalid query-catalog item ${a}: ${l} must be a string.`);if(typeof n.rank!="number"||!Number.isFinite(n.rank)||typeof n.catalogRank!="number"||!Number.isFinite(n.catalogRank))throw new k(`Invalid query-catalog item ${a}: ranks must be finite numbers.`);const s=n.view===void 0?void 0:Tt(String(n.view));if(n.view!==void 0&&s===void 0)throw new k(`Invalid query-catalog item ${a}: unsupported execution view.`);const u=n.scopeGraph,p=typeof t.contextGraphId=="string"?t.contextGraphId:void 0;if(!p)throw new k("Invalid query-catalog response: contextGraphId must be a string.");let h;try{h=Lt(p,u)}catch(l){throw new k(`Invalid query-catalog item ${a}: ${l instanceof Error?l.message:String(l)}`)}if(h!==n.subGraph)throw new k(`Invalid query-catalog item ${a}: scopeGraph and subGraph do not match.`);return{queryIri:n.queryIri,catalogIri:n.catalogIri,slug:n.slug,name:n.name,...typeof n.description=="string"?{description:n.description}:{},sparql:n.sparql,...typeof n.resultColumn=="string"?{resultColumn:n.resultColumn}:{},rank:n.rank,catalogSlug:n.catalogSlug,catalogName:n.catalogName,...typeof n.catalogDescription=="string"?{catalogDescription:n.catalogDescription}:{},catalogRank:n.catalogRank,subGraph:n.subGraph,scopeGraph:u,parameters:F(n.parameters),...s?{view:s}:{}}})}function _t(e){const t=new Map;for(const r of e){const o=`${r.subGraph}|${r.catalogSlug}`,a=t.get(o);if(a){if(a.name!==r.catalogName||a.description!==r.catalogDescription||a.rank!==r.catalogRank)throw new Error(`Query catalog ${r.catalogSlug} has conflicting metadata.`);a.queries.push(r);continue}t.set(o,{slug:r.catalogSlug,subGraph:r.subGraph,name:r.catalogName,description:r.catalogDescription,rank:r.catalogRank,queries:[r]})}return[...t.values()].map(r=>({...r,queries:[...r.queries].sort((o,a)=>o.rank-a.rank||o.name.localeCompare(a.name))})).sort((r,o)=>r.subGraph.localeCompare(o.subGraph)||r.rank-o.rank||r.name.localeCompare(o.name))}function Mt(e){return e.trim().toLowerCase().normalize("NFKD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48)||"saved-query"}function Ee(e,t,r){return`urn:dkg:profile:${encodeURIComponent(e)}:${t}:${encodeURIComponent(r)}`}function Gt(e){return ut(vt(pt(e)))}function N(e){return JSON.stringify(e)}function xe(e){return`"${e}"^^<${$t}>`}function yr(e){const t=F(e.parameters),r=JSON.stringify({subGraph:e.subGraph,catalogSlug:e.catalogSlug,name:e.name,description:e.description,sparql:e.sparql,resultColumn:e.resultColumn,rank:e.rank,parameters:t,view:e.view}),o=`${Mt(e.name)}-${Gt(r)}`,a=Ee(e.contextGraphId,"catalog",e.catalogSlug),n=Ee(e.contextGraphId,"query",o),i=It(e.contextGraphId,e.subGraph);Le(e.sparql,t);const s=[{subject:a,predicate:Se,object:`${E}QueryCatalog`,graph:""},{subject:a,predicate:`${E}scopeGraph`,object:i,graph:""},{subject:a,predicate:`${E}forSubGraph`,object:N(e.subGraph),graph:""},{subject:a,predicate:`${E}displayName`,object:N(e.catalogName),graph:""},{subject:a,predicate:`${E}rank`,object:xe(e.catalogRank),graph:""},{subject:n,predicate:Se,object:`${E}SavedQuery`,graph:""},{subject:n,predicate:`${E}scopeGraph`,object:i,graph:""},{subject:n,predicate:`${E}forSubGraph`,object:N(e.subGraph),graph:""},{subject:n,predicate:`${E}inCatalog`,object:a,graph:""},{subject:n,predicate:`${E}displayName`,object:N(e.name),graph:""},{subject:n,predicate:`${E}sparqlQuery`,object:N(e.sparql),graph:""},{subject:n,predicate:`${E}rank`,object:xe(e.rank),graph:""}];return e.catalogDescription&&s.push({subject:a,predicate:`${Ae}description`,object:N(e.catalogDescription),graph:""}),e.description&&s.push({subject:n,predicate:`${Ae}description`,object:N(e.description),graph:""}),e.resultColumn&&s.push({subject:n,predicate:`${E}resultColumn`,object:N(e.resultColumn),graph:""}),t.length>0&&s.push({subject:n,predicate:`${E}queryParameters`,object:N(Pt(t)),graph:""}),e.view&&s.push({subject:n,predicate:`${E}executionView`,object:N(e.view),graph:""}),{savedQuery:{queryIri:n,catalogIri:a,slug:o,name:e.name,description:e.description,sparql:e.sparql,resultColumn:e.resultColumn,rank:e.rank,catalogSlug:e.catalogSlug,catalogName:e.catalogName,catalogDescription:e.catalogDescription,catalogRank:e.catalogRank,subGraph:e.subGraph,scopeGraph:i,parameters:t,view:e.view,queryUri:n,catalogUri:a},quads:s}}const Ut=new Set(["meta"]),Me="__root__";function wr(e){return!Ut.has(e.name)}function G(e){const t=`did:dkg:context-graph:${e}/meta`;return`FILTER(strstarts(str(?g), ${ke(t)}))`}async function H(e,t){var o;const r=await Oe(e,{contextGraphId:t});return((o=r==null?void 0:r.result)==null?void 0:o.bindings)??[]}async function Qt(e){const t=await rt(e);return jt(t)}const P={displayName:"Project",primaryColor:"#a855f7",accentColor:"#22c55e"},Ce=e=>({slug:e,displayName:e,icon:"•",color:"#64748b",rank:99}),qt={slug:Me,displayName:"Root",description:"Entities not in any subgraph (Context Graph root)",icon:"⊘",rank:99},Ne=e=>({typeIri:e,label:e.split(/[/#]/).pop()||e,color:"#64748b"}),B="http://dkg.io/ontology/profile/";function Ge(e){if(e==null)return"";if(typeof e=="string")return e;if(typeof e=="object"&&"value"in e){const t=e.value;return t==null?"":String(t)}return String(e)}function m(e){const t=Ge(e);if(!t)return"";const r=t.match(/^"((?:[^"\\]|\\.)*)"(?:@[\w-]+|\^\^<[^>]+>)?$/);return r?r[1].replace(/\\"/g,'"').replace(/\\n/g,`
|
|
2
2
|
`).replace(/\\\\/g,"\\"):t}function Ht(e){const t=m(e),r=parseInt(t,10);return Number.isFinite(r)?r:0}function Ft(e){return`PREFIX prof: <${B}>
|
|
3
3
|
PREFIX schema: <http://schema.org/>
|
|
4
4
|
SELECT ?profile ?name ?description ?primary ?accent
|
|
@@ -74,7 +74,7 @@ WHERE {
|
|
|
74
74
|
}
|
|
75
75
|
${G(e)}
|
|
76
76
|
}
|
|
77
|
-
GROUP BY ?view ?name ?description ?nodeSize`}function T(e){const t=Ge(e);if(!t)return"";const r=t.trim();return r.startsWith("<")&&r.endsWith(">")?r.slice(1,-1):r}function vr(e){const[t,r]=f.useState(!0),[o,a]=f.useState(),[n,i]=f.useState(P.displayName),[s,u]=f.useState(),[p,h]=f.useState(P.primaryColor),[l,b]=f.useState(P.accentColor),[g,S]=f.useState([]),[v,O]=f.useState([]),[U,V]=f.useState([]),[pe,D]=f.useState([]),[W,Q]=f.useState([]),[z,j]=f.useState([]),M=f.useRef(new Map),K=f.useRef(new Map),J=f.useRef(new Map),ee=f.useRef(new Map),te=f.useRef(new Map),re=f.useRef(new Map)
|
|
77
|
+
GROUP BY ?view ?name ?description ?nodeSize`}function T(e){const t=Ge(e);if(!t)return"";const r=t.trim();return r.startsWith("<")&&r.endsWith(">")?r.slice(1,-1):r}function vr(e){const[t,r]=f.useState(!0),[o,a]=f.useState(),[n,i]=f.useState(P.displayName),[s,u]=f.useState(),[p,h]=f.useState(P.primaryColor),[l,b]=f.useState(P.accentColor),[g,S]=f.useState([]),[v,O]=f.useState([]),[U,V]=f.useState([]),[pe,D]=f.useState([]),[W,Q]=f.useState([]),[z,j]=f.useState([]),M=f.useRef(new Map),K=f.useRef(new Map),J=f.useRef(new Map),ee=f.useRef(new Map),te=f.useRef(new Map),re=f.useRef(new Map),$=f.useRef();f.useEffect(()=>{if($.current=void 0,i(e??P.displayName),u(void 0),h(P.primaryColor),b(P.accentColor),S([]),O([]),V([]),D([]),Q([]),j([]),M.current=new Map,K.current=new Map,J.current=new Map,ee.current=new Map,te.current=new Map,re.current=new Map,a(void 0),!e){r(!1);return}let y=!1;return(async()=>{r(!0);try{const[_,We,ze,Xe,Ye,ae]=await Promise.all([H(Ft(e),e).catch(()=>[]),H(Bt(e),e).catch(()=>[]),H(Wt(e),e).catch(()=>[]),H(zt(e),e).catch(()=>[]),H(Vt(e),e).catch(()=>[]),Qt(e).then(c=>({rows:c,error:void 0})).catch(c=>({rows:[],error:c instanceof Error?c.message:String(c)}))]);if(y)return;const de=e;if(_[0]){const c=_[0];i(m(c.name)||de),u(m(c.description)||void 0),h(m(c.primary)||P.primaryColor),b(m(c.accent)||P.accentColor)}else i(de),u(void 0),h(P.primaryColor),b(P.accentColor);const fe=We.map(c=>({slug:m(c.slug),displayName:m(c.displayName)||m(c.slug),description:m(c.description)||void 0,icon:m(c.icon)||void 0,color:m(c.color)||void 0,rank:Ht(c.rank)||99,timelinePredicate:T(c.timelinePredicate)||void 0,sourceAssertion:m(c.sourceAssertion)||void 0})).filter(c=>c.slug).sort((c,x)=>c.rank-x.rank);S(fe),K.current=new Map(fe.map(c=>[c.slug,c]));const he=ze.map(c=>({typeIri:T(c.type),label:m(c.label)||void 0,icon:m(c.icon)||void 0,color:m(c.color)||void 0,detailHint:m(c.detailHint)||void 0,promoteLabel:m(c.promoteLabel)||void 0,promoteHint:m(c.promoteHint)||void 0,publishLabel:m(c.publishLabel)||void 0,publishHint:m(c.publishHint)||void 0})).filter(c=>c.typeIri);O(he),M.current=new Map(he.map(c=>[c.typeIri,c]));const me=Xe.map(c=>{const x=T(c.view),Y=x.split(":view:").pop()??x;return{slug:Y,name:m(c.name)||Y,description:m(c.description)||void 0,nodeSize:m(c.nodeSize)||void 0,includeTypes:m(c.includeTypes).split("|").map(q=>T(q.trim())).filter(Boolean),emphasizePredicates:m(c.emphasizePredicates).split("|").map(q=>T(q.trim())).filter(Boolean)}});V(me),J.current=new Map(me.map(c=>[c.slug,c]));const ge=Ye.map(c=>{const x=T(c.chip),Y=x.split(":chip:").pop()??x,q=m(c.values).split("|").map(Ze=>m(Ze.trim())).filter(Boolean);return{slug:Y,subGraph:m(c.subGraph),typeIri:T(c.type),predicate:T(c.predicate),label:m(c.label)||"Filter",values:q}}).filter(c=>c.subGraph&&c.predicate&&c.values.length>0);D(ge);const ne=new Map;for(const c of ge){const x=ne.get(c.subGraph)??[];x.push(c),ne.set(c.subGraph,x)}ee.current=ne;const X=Dt(ae.rows);Q(X.queryCatalogs),j(X.savedQueries),te.current=X.catalogsBySubGraph,re.current=X.queriesBySubGraph,$.current=e,ae.error&&a(ae.error)}catch(_){y||a((_==null?void 0:_.message)??String(_))}finally{y||r(!1)}})(),()=>{y=!0}},[e]);const qe=f.useCallback(y=>y===Me?qt:$.current!==e?Ce(y):K.current.get(y)??Ce(y),[e]),He=f.useCallback(y=>$.current===e?M.current.get(y)??Ne(y):Ne(y),[e]),Fe=f.useCallback(y=>$.current===e?J.current.get(y):void 0,[e]),Be=f.useCallback(y=>$.current===e?ee.current.get(y)??[]:[],[e]),Ve=f.useCallback(y=>$.current===e?te.current.get(y)??[]:[],[e]),De=f.useCallback(y=>$.current===e?re.current.get(y)??[]:[],[e]);return{contextGraphId:e??"",displayName:n,description:s,primaryColor:p,accentColor:l,subGraphs:g,typeBindings:v,views:U,filterChips:pe,queryCatalogs:W,savedQueries:z,loading:t,error:o,forSubGraph:qe,forType:He,view:Fe,chipsFor:Be,savedQueryCatalogsFor:Ve,savedQueriesFor:De}}const Xt=Z.createContext(null);function Yt(){return f.useContext(Xt)}const Zt="http://dkg.io/ontology/agent/";function Kt(e){return`PREFIX ag: <${Zt}>
|
|
78
78
|
PREFIX schema: <http://schema.org/>
|
|
79
79
|
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
|
80
80
|
SELECT ?a ?kind ?name ?label ?fw ?op ?wallet ?peerId ?avatar ?reputation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{aP as e,j as t}from"./index-DW3dBcQk.js";function n(){return e.jsxs("div",{className:"page-section",style:{display:"flex",flexDirection:"column",height:"100%",padding:0},children:[e.jsxs("div",{style:{marginBottom:20},children:[e.jsx("h1",{className:"page-title",style:{marginBottom:0},children:"Agent Hub"}),e.jsx("p",{style:{fontSize:12,color:"var(--text-muted)",marginTop:4},children:"Bring your own agent into the node. OpenClaw chat, network peers, and integrated-agent session history live here."})]}),e.jsx("div",{style:{flex:1,minHeight:0,border:"1px solid var(--border)",borderRadius:12,overflow:"hidden",background:"var(--bg)"},children:e.jsx(t,{})})]})}export{n as AgentHubPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{be as x,aP as e,bF as w,bN as P,bM as A,R as b}from"./index-DW3dBcQk.js";import{f as C,h as T,a as N,A as R,g as E,u as M,P as $,b as D}from"./ActivityFeed-B5QxV1dk.js";import"./useProjectActivity-BOgGdtS7.js";const F="http://www.w3.org/ns/prov#wasAttributedTo",k=[{iri:"http://dkg.io/ontology/decisions/Decision",label:"Decisions"},{iri:"http://dkg.io/ontology/tasks/Task",label:"Tasks"},{iri:"http://dkg.io/ontology/github/PullRequest",label:"Pull Requests"},{iri:"http://dkg.io/ontology/github/Issue",label:"Issues"},{iri:"http://dkg.io/ontology/github/Commit",label:"Commits"}],S=({agentUri:a,entityList:d,onSelectEntity:u,onOpenAgent:r,onBack:j})=>{const o=C(),c=T(),s=(o==null?void 0:o.get(a))??null,p=x.useMemo(()=>{const t=new Map;for(const l of d){if(!l.connections.some(f=>f.predicate===F&&f.targetUri===a))continue;const n=k.find(f=>l.types.includes(f.iri));if(!n)continue;const y=t.get(n.iri)??[];y.push(l),t.set(n.iri,y)}return t},[d,a]),g=x.useMemo(()=>{let t=0;for(const l of p.values())t+=l.length;return t},[p]),m=s!=null&&s.operatorUri?(o==null?void 0:o.get(s.operatorUri))??null:null,[v,h]=x.useState(null);return e.jsxs("div",{className:"v10-agent-profile",children:[e.jsxs("div",{className:"v10-agent-profile-header",children:[e.jsx("button",{type:"button",className:"v10-ka-back",onClick:j,children:"← Back"}),e.jsxs("div",{className:"v10-agent-profile-head",children:[e.jsx(N,{agent:s??void 0,fallbackUri:a,size:"lg",showOperator:!0}),(s==null?void 0:s.reputation)&&e.jsx("div",{className:"v10-agent-profile-reputation",children:s.reputation})]}),e.jsxs("div",{className:"v10-agent-profile-meta",children:[(s==null?void 0:s.walletAddress)&&e.jsxs("div",{className:"v10-agent-profile-meta-row",children:[e.jsx("span",{className:"v10-agent-profile-meta-lbl",children:"Wallet"}),e.jsxs("span",{className:"v10-agent-profile-meta-val mono v10-agent-profile-wallet",title:s.walletAddress,children:[s.walletAddress,e.jsx("button",{type:"button",className:"v10-agent-profile-copy",onClick:t=>{var l;t.stopPropagation(),(l=navigator.clipboard)==null||l.writeText(s.walletAddress).catch(()=>{})},title:"Copy wallet address",children:"⎘"})]})]}),e.jsxs("div",{className:"v10-agent-profile-meta-row",children:[e.jsx("span",{className:"v10-agent-profile-meta-lbl",children:"URI"}),e.jsx("span",{className:"v10-agent-profile-meta-val mono",children:a})]}),(s==null?void 0:s.peerId)&&e.jsxs("div",{className:"v10-agent-profile-meta-row",children:[e.jsx("span",{className:"v10-agent-profile-meta-lbl",children:"Peer ID"}),e.jsx("span",{className:"v10-agent-profile-meta-val mono",children:s.peerId})]}),m&&e.jsxs("div",{className:"v10-agent-profile-meta-row",children:[e.jsx("span",{className:"v10-agent-profile-meta-lbl",children:"Driven by"}),e.jsx("span",{className:"v10-agent-profile-meta-val",children:e.jsx(N,{agent:m,size:"sm",onOpenAgent:r})})]}),(s==null?void 0:s.framework)&&e.jsxs("div",{className:"v10-agent-profile-meta-row",children:[e.jsx("span",{className:"v10-agent-profile-meta-lbl",children:"Framework"}),e.jsx("span",{className:"v10-agent-profile-meta-val mono",children:s.framework})]})]})]}),e.jsxs("div",{className:"v10-agent-profile-stats",children:[e.jsxs("button",{type:"button",className:`v10-agent-profile-stat${v===null?" active":""}`,onClick:()=>h(null),children:[e.jsx("span",{className:"v10-agent-profile-stat-val",children:g}),e.jsx("span",{className:"v10-agent-profile-stat-lbl",children:"All activity"})]}),k.map(t=>{const l=p.get(t.iri)??[];if(l.length===0)return null;const i=c==null?void 0:c.forType(t.iri),n=(i==null?void 0:i.color)??"#a855f7";return e.jsxs("button",{type:"button",className:`v10-agent-profile-stat${v===t.iri?" active":""}`,style:{"--stat-color":n},onClick:()=>h(t.iri),children:[e.jsx("span",{className:"v10-agent-profile-stat-val",children:l.length}),e.jsx("span",{className:"v10-agent-profile-stat-lbl",children:i!=null&&i.label?i.label:t.label})]},t.iri)})]}),e.jsx(R,{entities:d,agentUri:a,typeIri:v??void 0,onSelectEntity:u,onOpenAgent:r,title:e.jsxs(e.Fragment,{children:["All activity",s&&e.jsxs("span",{className:"v10-agent-profile-feed-sub",children:[" · authored by ",s.name]})]}),emptyHint:g===0?`${(s==null?void 0:s.name)??a} hasn't authored anything in this project yet.`:"No entries match the current filter."})]})},V=({contextGraphId:a,agentUri:d})=>{const u=E(a),r=M(a),j=w(a),{openTab:o,closeTab:c,activeTabId:s}=P(),{setActiveProject:p}=A(),g=b.useCallback(t=>{p(a),o({id:`project:${a}`,label:u.displayName||a.slice(0,16),closable:!0}),window.dispatchEvent(new CustomEvent("v10:open-entity",{detail:{contextGraphId:a,entityUri:t}}))},[a,o,u.displayName,p]),m=b.useCallback(t=>{var n;const l=t.startsWith("urn:dkg:agent:")?t.slice(14):t,i=((n=r.get(t))==null?void 0:n.name)??l;o({id:`agent:${a}|${l}`,label:`@ ${i}`,closable:!0})},[a,r,o]),v=b.useCallback(()=>{s&&c(s)},[s,c]),h=b.useMemo(()=>({...r,openAgent:m}),[r,m]);return e.jsx($.Provider,{value:u,children:e.jsx(D.Provider,{value:h,children:e.jsx(S,{agentUri:d,entityList:j.entityList,onSelectEntity:g,onOpenAgent:m,onBack:v})})})};export{V as AgentProfilePage};
|