@origintrail-official/dkg-node-ui 10.0.16 → 10.0.17

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.
Files changed (55) hide show
  1. package/dist/chain-cursor-stores.d.ts +48 -0
  2. package/dist/chain-cursor-stores.d.ts.map +1 -1
  3. package/dist/chain-cursor-stores.js +145 -0
  4. package/dist/chain-cursor-stores.js.map +1 -1
  5. package/dist/chain-event-log-store.d.ts +84 -0
  6. package/dist/chain-event-log-store.d.ts.map +1 -0
  7. package/dist/chain-event-log-store.js +289 -0
  8. package/dist/chain-event-log-store.js.map +1 -0
  9. package/dist/db.d.ts +16 -58
  10. package/dist/db.d.ts.map +1 -1
  11. package/dist/db.js +125 -144
  12. package/dist/db.js.map +1 -1
  13. package/dist/index.d.ts +3 -1
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +3 -1
  16. package/dist/index.js.map +1 -1
  17. package/dist/protocol-outbox-store.d.ts +67 -0
  18. package/dist/protocol-outbox-store.d.ts.map +1 -0
  19. package/dist/protocol-outbox-store.js +199 -0
  20. package/dist/protocol-outbox-store.js.map +1 -0
  21. package/dist-ui/assets/{3d-force-graph-bUKbeTGZ.js → 3d-force-graph-DGF2sXeK.js} +1 -1
  22. package/dist-ui/assets/ActivityFeed-DNatshHL.js +99 -0
  23. package/dist-ui/assets/{AgentHub-4c4sH_Jd.js → AgentHub-lOm96XuE.js} +1 -1
  24. package/dist-ui/assets/{AgentProfilePage-ClhUeZxy.js → AgentProfilePage-BRtazufK.js} +1 -1
  25. package/dist-ui/assets/ApproveWalletsModal-BMtRgndO.js +3 -0
  26. package/dist-ui/assets/{ContextGraphPrimitives-Bwc2i7EX.js → ContextGraphPrimitives-CBc6kvmp.js} +1 -1
  27. package/dist-ui/assets/ConvictionDetailView-DOTYSm7p.js +2 -0
  28. package/dist-ui/assets/{MemoryLayerView-DxL2MjyA.js → MemoryLayerView-DDFI2ngR.js} +2 -2
  29. package/dist-ui/assets/{MemoryStackView-BLhA3bn0.js → MemoryStackView-Bol2eMyq.js} +1 -1
  30. package/dist-ui/assets/{Network-BNhbBzOD.js → Network-B49IxpAj.js} +1 -1
  31. package/dist-ui/assets/{OnChainProvenanceCard-DKyfVEjF.js → OnChainProvenanceCard-BpUoHg4b.js} +1 -1
  32. package/dist-ui/assets/{Operations-mCPe0E-j.js → Operations-BCQ545Yk.js} +1 -1
  33. package/dist-ui/assets/{ProjectView-jrGPu5ON.js → ProjectView-BaQQSy8L.js} +20 -20
  34. package/dist-ui/assets/PublishingConviction-B5nWRsUP.js +2 -0
  35. package/dist-ui/assets/Settings-DeZKX_Ry.js +1 -0
  36. package/dist-ui/assets/browserWalletTransaction-B6wyaMOV.js +55 -0
  37. package/dist-ui/assets/ccip-B_vQl40F.js +1 -0
  38. package/dist-ui/assets/{index-VYV5TH6q.css → index-BLQUVvVz.css} +1 -1
  39. package/dist-ui/assets/index-CT-LdpBE.js +1175 -0
  40. package/dist-ui/assets/{index-UvxrSkC_.js → index-DHd3qhAk.js} +3 -3
  41. package/dist-ui/assets/{jsonld-32FQRO67-Dl6_9Lk9.js → jsonld-32FQRO67-BYu8pE-5.js} +2 -2
  42. package/dist-ui/assets/{jsonld-Dj4KMENF.js → jsonld-Crm5iwcE.js} +1 -1
  43. package/dist-ui/assets/{renderer-3d-2EVDZII7-DfnhcMkF.js → renderer-3d-2EVDZII7-C2z5aUgo.js} +2 -2
  44. package/dist-ui/assets/{shikiHighlighter-ByXDJnWi.js → shikiHighlighter-DW1fRfBU.js} +1 -1
  45. package/dist-ui/assets/{useEntityOnChainReceipt-BRK_O_sb.js → useEntityOnChainReceipt-0Ub24t6e.js} +1 -1
  46. package/dist-ui/assets/{useProjectActivity-OdoQs9mK.js → useProjectActivity-CLza3psq.js} +1 -1
  47. package/dist-ui/index.html +2 -2
  48. package/package.json +3 -3
  49. package/dist-ui/assets/ActivityFeed-CC5S_gk9.js +0 -100
  50. package/dist-ui/assets/ApproveWalletsModal-CBKp6zQB.js +0 -57
  51. package/dist-ui/assets/ConvictionDetailView-a3v7xwcm.js +0 -2
  52. package/dist-ui/assets/PublishingConviction-BGi128uo.js +0 -2
  53. package/dist-ui/assets/Settings-D1oxLo1Y.js +0 -1
  54. package/dist-ui/assets/ccip-WHHgwjp-.js +0 -1
  55. package/dist-ui/assets/index-RLb1kuzE.js +0 -1174
@@ -0,0 +1,199 @@
1
+ import { validateProtocolOutboxPageBudget, } from '@origintrail-official/dkg-core';
2
+ const OUTBOX_METADATA_COLUMNS = `peer_id AS peer, protocol, message_id AS messageId,
3
+ length(payload) AS payloadBytes, attempts, first_failure_at AS firstFailureAt,
4
+ last_attempt_at AS lastAttemptAt, next_attempt_at AS nextAttemptAt,
5
+ coalesce(last_error, '') AS lastError`;
6
+ export class SqliteProtocolOutboxStore {
7
+ db;
8
+ maxAgeMs = 24 * 60 * 60 * 1000;
9
+ backoffFor = (_attempts) => 5_000;
10
+ constructor(dashboard, options = {}) {
11
+ this.db = dashboard.db;
12
+ this.configurePolicy(options);
13
+ }
14
+ configurePolicy(options = {}) {
15
+ this.maxAgeMs = options.maxAgeMs ?? this.maxAgeMs;
16
+ this.backoffFor = options.backoffFor ?? this.backoffFor;
17
+ }
18
+ enqueue(peer, protocol, messageId, payload, error, now) {
19
+ const existing = this.db.prepare('SELECT attempts FROM protocol_outbox WHERE peer_id = ? AND protocol = ? AND message_id = ?').get(peer, protocol, messageId);
20
+ if (existing) {
21
+ return SqliteProtocolOutboxStore.rowToEntry(this.advanceRetryEntry(peer, protocol, messageId, existing.attempts + 1, error, now));
22
+ }
23
+ const attempts = 1;
24
+ const nextAttemptAt = now + this.backoffFor(attempts);
25
+ const blob = Buffer.from(payload);
26
+ this.db
27
+ .prepare(`INSERT INTO protocol_outbox
28
+ (peer_id, protocol, message_id, payload, attempts,
29
+ first_failure_at, last_attempt_at, next_attempt_at, last_error)
30
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`)
31
+ .run(peer, protocol, messageId, blob, attempts, now, now, nextAttemptAt, error);
32
+ return {
33
+ peer,
34
+ protocol,
35
+ messageId,
36
+ payload: new Uint8Array(blob),
37
+ attempts,
38
+ firstFailureAt: now,
39
+ lastAttemptAt: now,
40
+ nextAttemptAt,
41
+ lastError: error,
42
+ };
43
+ }
44
+ markDelivered(peer, protocol, messageId) {
45
+ const result = this.db
46
+ .prepare(`DELETE FROM protocol_outbox
47
+ WHERE peer_id = ? AND protocol = ? AND message_id = ?`)
48
+ .run(peer, protocol, messageId);
49
+ return result.changes > 0;
50
+ }
51
+ hasEntry(peer, protocol, messageId) {
52
+ const row = this.db
53
+ .prepare(`SELECT 1 FROM protocol_outbox
54
+ WHERE peer_id = ? AND protocol = ? AND message_id = ? LIMIT 1`)
55
+ .get(peer, protocol, messageId);
56
+ return row !== undefined;
57
+ }
58
+ hasPendingFor(peer) {
59
+ return this.db.prepare('SELECT 1 FROM protocol_outbox WHERE peer_id = ? LIMIT 1').get(peer) !== undefined;
60
+ }
61
+ pendingFor(peer) {
62
+ const rows = this.db
63
+ .prepare(`SELECT * FROM protocol_outbox
64
+ WHERE peer_id = ?
65
+ ORDER BY first_failure_at ASC, protocol ASC, message_id ASC`)
66
+ .all(peer);
67
+ return rows.map(SqliteProtocolOutboxStore.rowToEntry);
68
+ }
69
+ due(now) {
70
+ const rows = this.db
71
+ .prepare(`SELECT * FROM protocol_outbox
72
+ WHERE next_attempt_at <= ?
73
+ ORDER BY next_attempt_at ASC, first_failure_at ASC,
74
+ peer_id ASC, protocol ASC, message_id ASC`)
75
+ .all(now);
76
+ return rows.map(SqliteProtocolOutboxStore.rowToEntry);
77
+ }
78
+ duePage(now, limit) {
79
+ if (!Number.isSafeInteger(limit) || limit < 0)
80
+ throw new RangeError('Outbox duePage limit must be a non-negative safe integer');
81
+ const rows = this.db
82
+ .prepare(`SELECT * FROM protocol_outbox
83
+ WHERE next_attempt_at <= ?
84
+ ORDER BY next_attempt_at ASC, first_failure_at ASC,
85
+ peer_id ASC, protocol ASC, message_id ASC
86
+ LIMIT ?`)
87
+ .all(now, limit);
88
+ return rows.map(SqliteProtocolOutboxStore.rowToEntry);
89
+ }
90
+ readDuePage(now, budget) {
91
+ validateProtocolOutboxPageBudget(budget);
92
+ // SQLite length(BLOB) reads its size without returning the BLOB to JS.
93
+ // Select metadata first, then load only the admitted prefix. The read
94
+ // transaction keeps both queries on one snapshot without a durable lease:
95
+ // the daemon has one Messenger owner and never deletes rows on selection.
96
+ return this.db.transaction(() => {
97
+ const candidates = this.db.prepare(`SELECT ${OUTBOX_METADATA_COLUMNS} FROM protocol_outbox
98
+ WHERE next_attempt_at <= ? AND length(payload) <= ?
99
+ ORDER BY next_attempt_at, first_failure_at, peer_id, protocol, message_id
100
+ LIMIT ?`).all(now, budget.maxPayloadBytes, budget.maxEntries);
101
+ let selectedCount = 0;
102
+ let payloadBytes = 0;
103
+ let byteBudgetExhausted = false;
104
+ for (const candidate of candidates) {
105
+ if (payloadBytes + candidate.payloadBytes > budget.maxPayloadBytes) {
106
+ byteBudgetExhausted = true;
107
+ break;
108
+ }
109
+ selectedCount++;
110
+ payloadBytes += candidate.payloadBytes;
111
+ }
112
+ // Carry exact admitted identities and order into one payload query.
113
+ // JSON binds the bounded key list with one parameter regardless of size;
114
+ // eligibility and ordering policy belong only to the metadata pass.
115
+ const admittedKeys = candidates.slice(0, selectedCount)
116
+ .map(entry => [entry.peer, entry.protocol, entry.messageId]);
117
+ const rows = this.db.prepare(`SELECT CAST(admitted.key AS INTEGER) AS admitted_order, queued.* FROM json_each(?) AS admitted
118
+ JOIN protocol_outbox AS queued
119
+ ON queued.peer_id = json_extract(admitted.value, '$[0]')
120
+ AND queued.protocol = json_extract(admitted.value, '$[1]')
121
+ AND queued.message_id = json_extract(admitted.value, '$[2]')`).all(JSON.stringify(admittedKeys));
122
+ // Sort bounded row references here. A SQL ORDER BY on queued.* would
123
+ // copy the admitted BLOBs into SQLite's temporary sorter as well.
124
+ rows.sort((a, b) => a.admitted_order - b.admitted_order);
125
+ const entries = rows.map(SqliteProtocolOutboxStore.rowToEntry);
126
+ const { skippedOversizedEntries } = this.db.prepare('SELECT count(*) AS skippedOversizedEntries FROM protocol_outbox WHERE next_attempt_at <= ? AND length(payload) > ?').get(now, budget.maxPayloadBytes);
127
+ return { entries, skippedOversizedEntries, byteBudgetExhausted };
128
+ })();
129
+ }
130
+ listMetadata(peer) {
131
+ const statement = this.db.prepare(`SELECT ${OUTBOX_METADATA_COLUMNS} FROM protocol_outbox
132
+ ${peer === undefined ? '' : 'WHERE peer_id = ?'}
133
+ ORDER BY first_failure_at, peer_id, protocol, message_id`);
134
+ return (peer === undefined ? statement.all() : statement.all(peer));
135
+ }
136
+ dropExpiredMetadata(now) {
137
+ return this.db.prepare(`DELETE FROM protocol_outbox WHERE first_failure_at < ? RETURNING ${OUTBOX_METADATA_COLUMNS}`).all(now - this.maxAgeMs);
138
+ }
139
+ recordRetryFailure(peer, protocol, messageId, error, now) {
140
+ return this.db.transaction(() => {
141
+ const current = this.db.prepare('SELECT attempts FROM protocol_outbox WHERE peer_id = ? AND protocol = ? AND message_id = ?').get(peer, protocol, messageId);
142
+ if (!current)
143
+ return undefined;
144
+ return this.advanceRetryMetadata(peer, protocol, messageId, current.attempts + 1, error, now);
145
+ }).immediate();
146
+ }
147
+ advanceRetryMetadata(peer, protocol, messageId, attempts, error, now) {
148
+ return this.db.prepare(`UPDATE protocol_outbox SET attempts = ?, last_attempt_at = ?, next_attempt_at = ?, last_error = ?
149
+ WHERE peer_id = ? AND protocol = ? AND message_id = ? RETURNING ${OUTBOX_METADATA_COLUMNS}`).get(attempts, now, now + this.backoffFor(attempts), error, peer, protocol, messageId);
150
+ }
151
+ advanceRetryEntry(peer, protocol, messageId, attempts, error, now) {
152
+ return this.db.prepare(`UPDATE protocol_outbox SET attempts = ?, last_attempt_at = ?, next_attempt_at = ?, last_error = ?
153
+ WHERE peer_id = ? AND protocol = ? AND message_id = ? RETURNING *`).get(attempts, now, now + this.backoffFor(attempts), error, peer, protocol, messageId);
154
+ }
155
+ queueStats(now, maxPayloadBytes) {
156
+ return this.db.prepare(`SELECT count(*) AS queuedEntries, coalesce(sum(length(payload)), 0) AS queuedBytes,
157
+ coalesce(max(CASE WHEN next_attempt_at <= ? THEN ? - next_attempt_at END), 0) AS oldestDueAgeMs,
158
+ count(CASE WHEN next_attempt_at <= ? AND length(payload) > ? THEN 1 END) AS oversizedDueEntries
159
+ FROM protocol_outbox`).get(now, now, now, maxPayloadBytes);
160
+ }
161
+ dropExpired(now) {
162
+ return this.db.prepare('DELETE FROM protocol_outbox WHERE first_failure_at < ? RETURNING *').all(now - this.maxAgeMs)
163
+ .map(SqliteProtocolOutboxStore.rowToEntry);
164
+ }
165
+ size() {
166
+ const row = this.db.prepare(`SELECT COUNT(*) as c FROM protocol_outbox`).get();
167
+ return row.c;
168
+ }
169
+ list() {
170
+ const rows = this.db
171
+ .prepare(`SELECT * FROM protocol_outbox ORDER BY first_failure_at ASC`)
172
+ .all();
173
+ return rows.map(SqliteProtocolOutboxStore.rowToEntry);
174
+ }
175
+ getEntry(peer, protocol, messageId) {
176
+ const row = this.db
177
+ .prepare(`SELECT * FROM protocol_outbox WHERE peer_id = ? AND protocol = ? AND message_id = ?`)
178
+ .get(peer, protocol, messageId);
179
+ if (!row)
180
+ return undefined;
181
+ return SqliteProtocolOutboxStore.rowToEntry(row);
182
+ }
183
+ static rowToEntry(row) {
184
+ return {
185
+ peer: row.peer_id,
186
+ protocol: row.protocol,
187
+ messageId: row.message_id,
188
+ // better-sqlite3 already owns a fresh Buffer. A view retains that backing
189
+ // allocation without a second full-payload copy; writes cannot affect SQL.
190
+ payload: new Uint8Array(row.payload.buffer, row.payload.byteOffset, row.payload.byteLength),
191
+ attempts: row.attempts,
192
+ firstFailureAt: row.first_failure_at,
193
+ lastAttemptAt: row.last_attempt_at,
194
+ nextAttemptAt: row.next_attempt_at,
195
+ lastError: row.last_error ?? '',
196
+ };
197
+ }
198
+ }
199
+ //# sourceMappingURL=protocol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ChB,OAAO,CACN,qFAAqF,CACtF;aACA,GAAG,CAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,CAEnB,CAAC;QACd,IAAI,CAAC,GAAG;YAAE,OAAO,SAAS,CAAC;QAC3B,OAAO,yBAAyB,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACnD,CAAC;IAEO,MAAM,CAAC,UAAU,CAAC,GAAoB;QAC5C,OAAO;YACL,IAAI,EAAE,GAAG,CAAC,OAAO;YACjB,QAAQ,EAAE,GAAG,CAAC,QAAQ;YACtB,SAAS,EAAE,GAAG,CAAC,UAAU;YACzB,0EAA0E;YAC1E,2EAA2E;YAC3E,OAAO,EAAE,IAAI,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC;YAC3F,QAAQ,EAAE,GAAG,CAAC,QAAQ;YACtB,cAAc,EAAE,GAAG,CAAC,gBAAgB;YACpC,aAAa,EAAE,GAAG,CAAC,eAAe;YAClC,aAAa,EAAE,GAAG,CAAC,eAAe;YAClC,SAAS,EAAE,GAAG,CAAC,UAAU,IAAI,EAAE;SAChC,CAAC;IACJ,CAAC;CACF"}
@@ -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{ay as Ly}from"./index-RLb1kuzE.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-UvxrSkC_.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",`
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{az as Ly}from"./index-CT-LdpBE.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-DHd3qhAk.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`
@@ -0,0 +1,99 @@
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,bl as ke,b9 as tt,bc as f,R as Z,O as Oe,bd as rt,aO as d}from"./index-CT-LdpBE.js";import{u as at,b as nt,r as st}from"./useProjectActivity-CLza3psq.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,`
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
+ PREFIX schema: <http://schema.org/>
4
+ SELECT ?profile ?name ?description ?primary ?accent
5
+ WHERE {
6
+ GRAPH ?g {
7
+ ?profile a prof:Profile .
8
+ OPTIONAL { ?profile prof:displayName ?name }
9
+ OPTIONAL { ?profile schema:description ?description }
10
+ OPTIONAL { ?profile prof:primaryColor ?primary }
11
+ OPTIONAL { ?profile prof:accentColor ?accent }
12
+ }
13
+ ${G(e)}
14
+ } LIMIT 1`}function Bt(e){return`PREFIX prof: <${B}>
15
+ PREFIX schema: <http://schema.org/>
16
+ SELECT ?slug ?displayName ?description ?icon ?color ?rank ?timelinePredicate ?sourceAssertion
17
+ WHERE {
18
+ GRAPH ?g {
19
+ ?b a prof:SubGraphBinding ;
20
+ prof:forSubGraph ?slug .
21
+ OPTIONAL { ?b prof:displayName ?displayName }
22
+ OPTIONAL { ?b schema:description ?description }
23
+ OPTIONAL { ?b prof:icon ?icon }
24
+ OPTIONAL { ?b prof:color ?color }
25
+ OPTIONAL { ?b prof:rank ?rank }
26
+ OPTIONAL { ?b prof:timelinePredicate ?timelinePredicate }
27
+ OPTIONAL { ?b prof:sourceAssertion ?sourceAssertion }
28
+ }
29
+ ${G(e)}
30
+ }`}function Vt(e){return`PREFIX prof: <${B}>
31
+ SELECT ?chip ?subGraph ?type ?predicate ?label
32
+ (GROUP_CONCAT(DISTINCT ?v; separator="|") AS ?values)
33
+ WHERE {
34
+ GRAPH ?g {
35
+ ?chip a prof:FilterChip ;
36
+ prof:forSubGraph ?subGraph ;
37
+ prof:forType ?type ;
38
+ prof:onPredicate ?predicate ;
39
+ prof:chipValue ?v .
40
+ OPTIONAL { ?chip prof:label ?label }
41
+ }
42
+ ${G(e)}
43
+ }
44
+ GROUP BY ?chip ?subGraph ?type ?predicate ?label`}function Dt(e){const t=e.map(s=>s.catalogIri?s:{...s,catalogSlug:`default:${s.subGraph}`}),r=t.map(s=>({slug:s.slug,subGraph:s.subGraph,catalogSlug:s.catalogSlug,catalogName:s.catalogName,catalogDescription:s.catalogDescription,catalogRank:s.catalogRank,name:s.name,description:s.description,sparql:s.sparql,resultColumn:s.resultColumn??"",rank:s.rank,view:s.view,parameters:s.parameters})),o=new Map(t.map((s,u)=>[s.queryIri,r[u]])),a=_t(t).map(s=>({slug:s.slug,subGraph:s.subGraph,name:s.name,description:s.description,rank:s.rank,queries:s.queries.map(u=>o.get(u.queryIri)).filter(u=>!!u)})),n=new Map,i=new Map;for(const s of a){const u=n.get(s.subGraph)??[];u.push(s),n.set(s.subGraph,u);const p=i.get(s.subGraph)??[];p.push(...s.queries),i.set(s.subGraph,p)}return{queryCatalogs:a,savedQueries:r,catalogsBySubGraph:n,queriesBySubGraph:i}}function Wt(e){return`PREFIX prof: <${B}>
45
+ SELECT ?type ?label ?icon ?color ?detailHint
46
+ ?promoteLabel ?promoteHint ?publishLabel ?publishHint
47
+ WHERE {
48
+ GRAPH ?g {
49
+ ?b a prof:EntityTypeBinding ;
50
+ prof:forType ?type .
51
+ OPTIONAL { ?b prof:label ?label }
52
+ OPTIONAL { ?b prof:icon ?icon }
53
+ OPTIONAL { ?b prof:color ?color }
54
+ OPTIONAL { ?b prof:detailHint ?detailHint }
55
+ OPTIONAL { ?b prof:promoteLabel ?promoteLabel }
56
+ OPTIONAL { ?b prof:promoteHint ?promoteHint }
57
+ OPTIONAL { ?b prof:publishLabel ?publishLabel }
58
+ OPTIONAL { ?b prof:publishHint ?publishHint }
59
+ }
60
+ ${G(e)}
61
+ }`}function zt(e){return`PREFIX prof: <${B}>
62
+ PREFIX schema: <http://schema.org/>
63
+ SELECT ?view ?name ?description ?nodeSize
64
+ (GROUP_CONCAT(DISTINCT ?incType; separator="|") AS ?includeTypes)
65
+ (GROUP_CONCAT(DISTINCT ?empPred; separator="|") AS ?emphasizePredicates)
66
+ WHERE {
67
+ GRAPH ?g {
68
+ ?view a prof:ViewConfig .
69
+ OPTIONAL { ?view prof:displayName ?name }
70
+ OPTIONAL { ?view schema:description ?description }
71
+ OPTIONAL { ?view prof:nodeSize ?nodeSize }
72
+ OPTIONAL { ?view prof:includeType ?incType }
73
+ OPTIONAL { ?view prof:emphasizePredicate ?empPred }
74
+ }
75
+ ${G(e)}
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),L=f.useRef();f.useEffect(()=>{if(L.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,L.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:L.current!==e?Ce(y):K.current.get(y)??Ce(y),[e]),He=f.useCallback(y=>L.current===e?M.current.get(y)??Ne(y):Ne(y),[e]),Fe=f.useCallback(y=>L.current===e?J.current.get(y):void 0,[e]),Be=f.useCallback(y=>L.current===e?ee.current.get(y)??[]:[],[e]),Ve=f.useCallback(y=>L.current===e?te.current.get(y)??[]:[],[e]),De=f.useCallback(y=>L.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
+ PREFIX schema: <http://schema.org/>
79
+ PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
80
+ SELECT ?a ?kind ?name ?label ?fw ?op ?wallet ?peerId ?avatar ?reputation
81
+ WHERE {
82
+ GRAPH ?g {
83
+ ?a a ag:Agent .
84
+ OPTIONAL { ?a a ag:HumanAgent . BIND("human" AS ?kind) }
85
+ OPTIONAL { ?a a ag:AIAgent . BIND("ai" AS ?kindAi) }
86
+ OPTIONAL { ?a schema:name ?name }
87
+ OPTIONAL { ?a rdfs:label ?label }
88
+ OPTIONAL { ?a ag:framework ?fw }
89
+ OPTIONAL { ?a ag:operator ?op }
90
+ OPTIONAL { ?a ag:walletAddress ?wallet }
91
+ OPTIONAL { ?a ag:peerId ?peerId }
92
+ OPTIONAL { ?a ag:avatar ?avatar }
93
+ OPTIONAL { ?a ag:reputation ?reputation }
94
+ }
95
+ ${G(e)}
96
+ }`}function Ue(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 R(e){const t=Ue(e);if(!t)return"";const r=t.match(/^"((?:[^"\\]|\\.)*)"(?:@[\w-]+|\^\^<[^>]+>)?$/);return r?r[1].replace(/\\"/g,'"').replace(/\\n/g,`
97
+ `).replace(/\\\\/g,"\\"):t}function Pe(e){const t=Ue(e);if(!t)return"";const r=t.trim();return r.startsWith("<")&&r.endsWith(">")?r.slice(1,-1):r}function Jt(e){let t=0;for(let a=0;a<e.length;a++)t=t*31+e.charCodeAt(a)|0;return`hsl(${((t%360+360)%360+25)%360}, 55%, 58%)`}function er(e){const t=new Map;for(const r of e){const o=Pe(r.a);if(!o)continue;const a=t.get(o),n=R(r.kindAi)==="ai"||R(r.kind)==="ai"?"ai":R(r.kind)==="human"?"human":(a==null?void 0:a.kind)??"ai",i={uri:o,name:R(r.name)||R(r.label)||o.split(":").pop()||o,kind:n,framework:R(r.fw)||(a==null?void 0:a.framework),operatorUri:Pe(r.op)||(a==null?void 0:a.operatorUri),walletAddress:R(r.wallet)||(a==null?void 0:a.walletAddress),peerId:R(r.peerId)||(a==null?void 0:a.peerId),avatar:R(r.avatar)||(a==null?void 0:a.avatar),reputation:R(r.reputation)||(a==null?void 0:a.reputation),color:Jt(o)};i.kind==="human"&&!i.framework&&(i.framework="human"),t.set(o,i)}for(const r of t.values())if(r.operatorUri){const o=t.get(r.operatorUri);o&&(r.operatorName=o.name)}return t}function Ar(e){const[t,r]=f.useState(()=>new Map),[o,a]=f.useState(!0),[n,i]=f.useState(),s=f.useRef(new Map);f.useEffect(()=>{if(!e){a(!1);return}let l=!1;return(async()=>{var b;a(!0),i(void 0);try{const g=await Oe(Kt(e),{contextGraphId:e});if(l)return;const S=((b=g==null?void 0:g.result)==null?void 0:b.bindings)??[],v=er(S);r(v),s.current=v}catch(g){l||i((g==null?void 0:g.message)??String(g))}finally{l||a(!1)}})(),()=>{l=!0}},[e]);const u=f.useCallback(l=>s.current.get(l),[]),p=Z.useMemo(()=>[...t.values()].sort((l,b)=>l.name.localeCompare(b.name)),[t]),h=f.useCallback(l=>{},[]);return{agents:t,list:p,loading:o,error:n,get:u,openAgent:h}}const tr=Z.createContext(null);function Qe(){return f.useContext(tr)}const Re={"claude-code":"⦿",openclaw:"◈",hermes:"⬡",gemini:"✧",human:"👤"};function rr(e,t){return e&&Re[e]?Re[e]:t==="human"?"👤":"◉"}function ar(e){const t=e.trim();if(!t)return"?";const r=t.split(/[\s_-]+/).filter(Boolean);return r.length===1?r[0].slice(0,2).toUpperCase():(r[0][0]+(r[1][0]??"")).toUpperCase()}function nr(e){const t=e.trim();return t.length<=11?t:`${t.slice(0,6)}…${t.slice(-4)}`}const sr=({agent:e,fallbackUri:t,size:r="sm",showOperator:o=!1,onOpenAgent:a,className:n=""})=>{const i=Qe();if(!e&&!t)return null;const s=a??(i==null?void 0:i.openAgent),u=(e==null?void 0:e.uri)??t,p=(e==null?void 0:e.name)??(t?nr(t.split(":").pop()??t):"unknown"),h=(e==null?void 0:e.kind)??"ai",l=e==null?void 0:e.framework,b=rr(l,h),g=(e==null?void 0:e.color)??"hsl(0, 0%, 55%)",S=[p,l?`framework: ${l}`:null,e!=null&&e.operatorName?`operator: ${e.operatorName}`:null,e!=null&&e.walletAddress?`wallet: ${e.walletAddress}`:null,e!=null&&e.peerId?`peer: ${e.peerId.slice(0,20)}…`:null,e!=null&&e.reputation?`— ${e.reputation}`:null,u].filter(Boolean).join(`
98
+ `),v=s?()=>s(u):void 0,O=!!v;return d.jsxs("span",{className:`v10-agent-chip v10-agent-chip-${r}${O?" interactive":""} ${n}`,style:{"--agent-color":g},onClick:v?U=>{U.stopPropagation(),v()}:void 0,title:S,role:O?"button":void 0,tabIndex:O?0:void 0,children:[d.jsxs("span",{className:"v10-agent-chip-avatar",style:{background:g},children:[d.jsx("span",{className:"v10-agent-chip-initials",children:ar(p)}),d.jsx("span",{className:"v10-agent-chip-glyph",title:l??h,children:b})]}),d.jsxs("span",{className:"v10-agent-chip-body",children:[d.jsx("span",{className:"v10-agent-chip-name",children:p}),r==="lg"&&((e==null?void 0:e.operatorName)||l)&&d.jsxs("span",{className:"v10-agent-chip-sub",children:[l&&h==="ai"&&d.jsx("span",{className:"v10-agent-chip-fw",children:l}),(e==null?void 0:e.operatorName)&&h==="ai"&&d.jsxs(d.Fragment,{children:[l&&d.jsx("span",{className:"v10-agent-chip-sep",children:"·"}),d.jsxs("span",{className:"v10-agent-chip-op",children:["driven by ",e.operatorName]})]}),h==="human"&&d.jsx("span",{className:"v10-agent-chip-fw",children:"human"})]}),r==="md"&&o&&(e==null?void 0:e.operatorName)&&h==="ai"&&d.jsx("span",{className:"v10-agent-chip-sub",children:d.jsxs("span",{className:"v10-agent-chip-op",children:["· ",e.operatorName]})})]})]})},ie={working:"#64748b",shared:"#f59e0b",verified:"#22c55e"},or={working:"◇",shared:"◈",verified:"◉"},ir=200,Sr=({entities:e,agentUri:t,typeIri:r,subGraph:o,limit:a,includeUndated:n=!0,swmEvents:i,lifecycleEvents:s,lifecycleError:u,title:p,onSelectEntity:h,onOpenAgent:l,emptyHint:b,className:g=""})=>{const{items:S,hasMore:v}=at(e,{agentUri:t,typeIri:r,subGraph:o,limit:a,includeUndated:n,swmEvents:i,lifecycleEvents:s}),O=Z.useMemo(()=>nt(S),[S]),U=Qe(),V=Yt(),D=v?`${a??ir}+`:String(S.length),W=u!=null&&S.length===0,Q=p?d.jsxs("div",{className:"v10-activity-feed-title",children:[d.jsx("span",{className:"v10-activity-feed-title-label",children:p}),d.jsx("span",{className:"v10-activity-feed-title-count","data-state":W?"error":void 0,children:W?"—":D})]}):null,z=u?d.jsx("div",{className:"v10-activity-feed-error",role:"status","aria-live":"polite",title:u,children:"Couldn't load recent activity."}):null;return S.length===0?d.jsxs("div",{className:`v10-activity-feed v10-activity-feed-empty ${g}`,children:[Q,z??d.jsx("div",{className:"v10-activity-feed-empty-hint",children:b??"No activity with a timestamp yet."})]}):d.jsxs("div",{className:`v10-activity-feed ${g}`,children:[Q,z,O.map(j=>d.jsxs("div",{className:"v10-activity-feed-bucket",children:[d.jsxs("div",{className:"v10-activity-feed-bucket-head",children:[d.jsx("span",{className:"v10-activity-feed-bucket-label",children:j.label}),d.jsx("span",{className:"v10-activity-feed-bucket-count",children:j.items.length})]}),d.jsx("div",{className:"v10-activity-feed-items",children:j.items.map(M=>d.jsx(cr,{item:M,agents:U,profile:V,onSelectEntity:h,onOpenAgent:l},M.id))})]},j.key))]})};function cr({item:e,agents:t,profile:r,onSelectEntity:o,onOpenAgent:a}){const n=e.authorUri?t==null?void 0:t.get(e.authorUri):null,i=e.event==="typed",s=i&&e.kindUri?r==null?void 0:r.forType(e.kindUri):null,u=e.event==="added"?"Added":e.event==="promoted"?e.entityCount!=null&&e.entityCount>0?`Promoted to SWM · ${e.entityCount} ${e.entityCount===1?"entity":"entities"}`:"Promoted to SWM":e.event==="published"?"Published to VM":(s==null?void 0:s.label)??(e.kindUri?e.kindUri.split(/[#/]/).pop():null)??"Entity",p=e.event==="added"?"+":e.event==="promoted"?"⇡":e.event==="published"?"◉":(s==null?void 0:s.icon)??"◆",h=e.event==="promoted"?ie.shared:e.event==="published"?ie.verified:e.event==="added"?"#64748b":(s==null?void 0:s.color)??"#a855f7",l=ie[e.layer],b=i?lr(e.entity):null,g=(()=>{const v=[];return e.event!=="typed"&&v.push(u),v.push(e.entity.label),e.at&&v.push(e.at.toISOString()),v.join(`
99
+ `)})(),S=d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"v10-activity-feed-layer",style:{color:l},title:`${e.layer} memory`,children:or[e.layer]}),d.jsxs("span",{className:"v10-activity-feed-type",style:{"--type-color":h},children:[d.jsx("span",{className:"v10-activity-feed-type-icon",children:p}),d.jsx("span",{className:"v10-activity-feed-type-label",children:u})]}),d.jsx("span",{className:"v10-activity-feed-title-text",children:e.entity.label}),b&&d.jsx("span",{className:`v10-activity-feed-status status-${ur(b)}`,children:b}),(n||e.authorUri)&&d.jsx("span",{className:"v10-activity-feed-author",children:d.jsx(sr,{agent:n??void 0,fallbackUri:e.authorUri??void 0,size:"sm",onOpenAgent:a})}),d.jsx("span",{className:"v10-activity-feed-time",title:e.at?e.at.toLocaleString():"no timestamp",children:st(e.at)})]});return e.clickable?d.jsx("button",{type:"button",className:"v10-activity-feed-row",onClick:()=>o(e.entity.uri),title:g,children:S}):d.jsx("div",{className:"v10-activity-feed-row v10-activity-feed-row-static",title:g,"aria-disabled":"true",children:S})}function lr(e){var r;const t=["http://dkg.io/ontology/decisions/status","http://dkg.io/ontology/tasks/status","http://dkg.io/ontology/github/state"];for(const o of t){const a=(r=e.properties.get(o))==null?void 0:r[0];if(a)return a}return null}function ur(e){switch(e){case"accepted":case"done":case"merged":return"good";case"proposed":case"in_progress":case"open":return"warn";case"rejected":case"superseded":case"blocked":case"cancelled":return"bad";default:return"neutral"}}export{Sr as A,ue as C,Xt as P,Me as R,gr as U,sr as a,tr as b,mr as c,yr as d,wr as e,Qe as f,vr as g,Yt as h,hr as i,br as p,Mt as q,Ar as u};
@@ -1 +1 @@
1
- import{aN as e,j as t}from"./index-RLb1kuzE.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
+ import{aO as e,j as t}from"./index-CT-LdpBE.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{ba as x,aN as e,bB as w,bJ as P,bI as A,R as b}from"./index-RLb1kuzE.js";import{f as C,h as T,a as N,A as R,g as E,u as $,P as B,b as D}from"./ActivityFeed-CC5S_gk9.js";import"./useProjectActivity-OdoQs9mK.js";const M="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===M&&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=$(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(B.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};
1
+ import{bc as x,aO as e,bD as w,bL as P,bK as A,R as b}from"./index-CT-LdpBE.js";import{f as C,h as T,a as N,A as R,g as E,u as D,P as $,b as M}from"./ActivityFeed-DNatshHL.js";import"./useProjectActivity-CLza3psq.js";const S="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"}],B=({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===S&&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=D(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(M.Provider,{value:h,children:e.jsx(B,{agentUri:d,entityList:j.entityList,onSelectEntity:g,onOpenAgent:m,onBack:v})})})};export{V as AgentProfilePage};