@rubytech/create-realagent 1.0.663 → 1.0.664

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.
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-CCUSwZB_.js","assets/preload-helper-qlgyTAkD.js","assets/dist-CrzV1W3-.js","assets/chunk-DD-I1_y5.js","assets/chunk-U2HBQHQK-BZnA7c4T.js","assets/src-Bo15iQ7w.js","assets/chunk-5PVQY5BW-RhIfPCRB.js","assets/chunk-ICPOFSXX-Di63NBur.js","assets/_baseFor-Dn4GSmI6.js","assets/isEmpty-h-wRi_o9.js","assets/chunk-336JU56O-BpATJiGl.js","assets/chunk-5FUZZQ4R-BoTfWHuW.js","assets/chunk-X2U36JSP-DpQ2OA_c.js","assets/chunk-ZZ45TVLE-DBSm41oP.js","assets/rough.esm-NLRoWnq-.js","assets/chunk-ENJZ2VHE-CNHjq5xK.js","assets/line-DlKKhwkO.js","assets/path-7vUsG-o2.js","assets/array-DJN9YAVf.js","assets/chunk-BSJP7CBP-CTsYuARh.js","assets/chunk-426QAEUC-Wz6Bpsil.js","assets/chunk-XPW4576I-BccP1mlQ.js"])))=>i.map(i=>d[i]);
2
- import{o as e,r as t,t as n}from"./chunk-DD-I1_y5.js";import{n as r,o as i,r as a,t as o}from"./jsx-runtime-ImbU973I.js";import{t as s}from"./preload-helper-qlgyTAkD.js";var c=a(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),l=a(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),u=a(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),d=a(`file-code`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),f=a(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),p=a(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),m=a(`mic`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]),h=a(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),g=a(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),_=a(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),v=a(`square-check-big`,[[`path`,{d:`M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344`,key:`2acyp4`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),y=a(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),b=e(i(),1);async function x(e){if(navigator.clipboard)try{return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();let n=document.execCommand(`copy`);return document.body.removeChild(t),n}catch{return!1}}function S(){let[e,t]=(0,b.useState)(!1),[n,r]=(0,b.useState)(new Set),[i,a]=(0,b.useState)(!1),o=(0,b.useRef)(null);(0,b.useEffect)(()=>()=>{o.current!==null&&clearTimeout(o.current)},[]);let s=(0,b.useCallback)(()=>{t(!0),r(new Set)},[]),c=(0,b.useCallback)(()=>{t(!1),r(new Set)},[]),l=(0,b.useCallback)(e=>{r(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),u=(0,b.useCallback)(()=>{o.current!==null&&(clearTimeout(o.current),o.current=null)},[]),d=(0,b.useCallback)(e=>({onPointerDown:()=>{o.current=setTimeout(()=>{t(!0),r(new Set([e])),o.current=null},500)},onPointerUp:u,onPointerLeave:u,onPointerCancel:u}),[u]),f=(0,b.useCallback)(e=>{a(e?`copied`:`failed`),setTimeout(()=>a(!1),1500)},[]);return{selectionMode:e,selectedItems:n,copyToast:i,longPressProps:d,enterSelection:s,exitSelection:c,toggleSelectItem:l,copySelected:(0,b.useCallback)(async(e,t)=>{let r=[...n].sort(t).map(t=>e(t)).filter(Boolean);r.length>0&&f(await x(r.join(`
2
+ import{o as e,r as t,t as n}from"./chunk-DD-I1_y5.js";import{n as r,o as i,r as a,t as o}from"./jsx-runtime-BZgdWJ0Y.js";import{t as s}from"./preload-helper-qlgyTAkD.js";var c=a(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),l=a(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),u=a(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),d=a(`file-code`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),f=a(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),p=a(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),m=a(`mic`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]),h=a(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),g=a(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),_=a(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),v=a(`square-check-big`,[[`path`,{d:`M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344`,key:`2acyp4`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),y=a(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),b=e(i(),1);async function x(e){if(navigator.clipboard)try{return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();let n=document.execCommand(`copy`);return document.body.removeChild(t),n}catch{return!1}}function S(){let[e,t]=(0,b.useState)(!1),[n,r]=(0,b.useState)(new Set),[i,a]=(0,b.useState)(!1),o=(0,b.useRef)(null);(0,b.useEffect)(()=>()=>{o.current!==null&&clearTimeout(o.current)},[]);let s=(0,b.useCallback)(()=>{t(!0),r(new Set)},[]),c=(0,b.useCallback)(()=>{t(!1),r(new Set)},[]),l=(0,b.useCallback)(e=>{r(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),u=(0,b.useCallback)(()=>{o.current!==null&&(clearTimeout(o.current),o.current=null)},[]),d=(0,b.useCallback)(e=>({onPointerDown:()=>{o.current=setTimeout(()=>{t(!0),r(new Set([e])),o.current=null},500)},onPointerUp:u,onPointerLeave:u,onPointerCancel:u}),[u]),f=(0,b.useCallback)(e=>{a(e?`copied`:`failed`),setTimeout(()=>a(!1),1500)},[]);return{selectionMode:e,selectedItems:n,copyToast:i,longPressProps:d,enterSelection:s,exitSelection:c,toggleSelectItem:l,copySelected:(0,b.useCallback)(async(e,t)=>{let r=[...n].sort(t).map(t=>e(t)).filter(Boolean);r.length>0&&f(await x(r.join(`
3
3
 
4
4
  ---
5
5
 
@@ -1 +1 @@
1
- import{r as e}from"./jsx-runtime-ImbU973I.js";var t=e(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),n=e(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);export{t as n,n as t};
1
+ import{r as e}from"./jsx-runtime-BZgdWJ0Y.js";var t=e(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),n=e(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);export{t as n,n as t};
@@ -5,13 +5,13 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>Data — Maxy</title>
7
7
  <link rel="icon" href="/favicon.ico">
8
- <script type="module" crossorigin src="/assets/data-C-WE3FGr.js"></script>
8
+ <script type="module" crossorigin src="/assets/data-DQcIUUZW.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="/assets/chunk-DD-I1_y5.js">
10
- <link rel="modulepreload" crossorigin href="/assets/jsx-runtime-ImbU973I.js">
11
- <link rel="modulepreload" crossorigin href="/assets/share-2-MZ4MqbjS.js">
12
- <link rel="modulepreload" crossorigin href="/assets/file-lmzx24EO.js">
13
- <link rel="modulepreload" crossorigin href="/assets/house-ClhI06TA.js">
14
- <link rel="stylesheet" crossorigin href="/assets/jsx-runtime-CLCFnMYD.css">
10
+ <link rel="modulepreload" crossorigin href="/assets/jsx-runtime-BZgdWJ0Y.js">
11
+ <link rel="modulepreload" crossorigin href="/assets/share-2-CVCJTVW7.js">
12
+ <link rel="modulepreload" crossorigin href="/assets/file-BhFSdU7V.js">
13
+ <link rel="modulepreload" crossorigin href="/assets/house-CA7LcTyb.js">
14
+ <link rel="stylesheet" crossorigin href="/assets/jsx-runtime-CH3XaSdT.css">
15
15
  </head>
16
16
  <body>
17
17
  <div id="root"></div>
@@ -5,13 +5,13 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>Graph — Maxy</title>
7
7
  <link rel="icon" href="/favicon.ico">
8
- <script type="module" crossorigin src="/assets/graph-DkjvCb8B.js"></script>
8
+ <script type="module" crossorigin src="/assets/graph-DSUSNmfO.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="/assets/chunk-DD-I1_y5.js">
10
- <link rel="modulepreload" crossorigin href="/assets/jsx-runtime-ImbU973I.js">
11
- <link rel="modulepreload" crossorigin href="/assets/share-2-MZ4MqbjS.js">
12
- <link rel="modulepreload" crossorigin href="/assets/house-ClhI06TA.js">
13
- <link rel="modulepreload" crossorigin href="/assets/x-CLhtM_Mh.js">
14
- <link rel="stylesheet" crossorigin href="/assets/jsx-runtime-CLCFnMYD.css">
10
+ <link rel="modulepreload" crossorigin href="/assets/jsx-runtime-BZgdWJ0Y.js">
11
+ <link rel="modulepreload" crossorigin href="/assets/share-2-CVCJTVW7.js">
12
+ <link rel="modulepreload" crossorigin href="/assets/house-CA7LcTyb.js">
13
+ <link rel="modulepreload" crossorigin href="/assets/x-Dnw-ie9I.js">
14
+ <link rel="stylesheet" crossorigin href="/assets/jsx-runtime-CH3XaSdT.css">
15
15
  </head>
16
16
  <body>
17
17
  <div id="root"></div>
@@ -5,15 +5,15 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>Real Agent</title>
7
7
  <link rel="icon" href="/favicon.ico">
8
- <script type="module" crossorigin src="/assets/admin-C9qoVb2l.js"></script>
8
+ <script type="module" crossorigin src="/assets/admin-Bo3NKS_u.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="/assets/chunk-DD-I1_y5.js">
10
- <link rel="modulepreload" crossorigin href="/assets/jsx-runtime-ImbU973I.js">
10
+ <link rel="modulepreload" crossorigin href="/assets/jsx-runtime-BZgdWJ0Y.js">
11
11
  <link rel="modulepreload" crossorigin href="/assets/preload-helper-qlgyTAkD.js">
12
- <link rel="modulepreload" crossorigin href="/assets/useVoiceRecorder-Cm0G51D_.js">
13
- <link rel="modulepreload" crossorigin href="/assets/share-2-MZ4MqbjS.js">
14
- <link rel="modulepreload" crossorigin href="/assets/file-lmzx24EO.js">
15
- <link rel="modulepreload" crossorigin href="/assets/x-CLhtM_Mh.js">
16
- <link rel="stylesheet" crossorigin href="/assets/jsx-runtime-CLCFnMYD.css">
12
+ <link rel="modulepreload" crossorigin href="/assets/useVoiceRecorder-DwMKR9su.js">
13
+ <link rel="modulepreload" crossorigin href="/assets/share-2-CVCJTVW7.js">
14
+ <link rel="modulepreload" crossorigin href="/assets/file-BhFSdU7V.js">
15
+ <link rel="modulepreload" crossorigin href="/assets/x-Dnw-ie9I.js">
16
+ <link rel="stylesheet" crossorigin href="/assets/jsx-runtime-CH3XaSdT.css">
17
17
  <link rel="stylesheet" crossorigin href="/assets/admin-kHJ-D0s7.css">
18
18
  <link rel="stylesheet" href="/brand-defaults.css">
19
19
  </head>
@@ -5,12 +5,12 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>Real Agent</title>
7
7
  <link rel="icon" href="/favicon.ico">
8
- <script type="module" crossorigin src="/assets/public-Dz33-dIE.js"></script>
8
+ <script type="module" crossorigin src="/assets/public-C7sPrAvE.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="/assets/chunk-DD-I1_y5.js">
10
- <link rel="modulepreload" crossorigin href="/assets/jsx-runtime-ImbU973I.js">
10
+ <link rel="modulepreload" crossorigin href="/assets/jsx-runtime-BZgdWJ0Y.js">
11
11
  <link rel="modulepreload" crossorigin href="/assets/preload-helper-qlgyTAkD.js">
12
- <link rel="modulepreload" crossorigin href="/assets/useVoiceRecorder-Cm0G51D_.js">
13
- <link rel="stylesheet" crossorigin href="/assets/jsx-runtime-CLCFnMYD.css">
12
+ <link rel="modulepreload" crossorigin href="/assets/useVoiceRecorder-DwMKR9su.js">
13
+ <link rel="stylesheet" crossorigin href="/assets/jsx-runtime-CH3XaSdT.css">
14
14
  <link rel="stylesheet" href="/brand-defaults.css">
15
15
  </head>
16
16
  <body>
@@ -5212,9 +5212,11 @@ async function persistToolCall(record) {
5212
5212
  await session.close();
5213
5213
  }
5214
5214
  }
5215
+ var SUMMARY_MAX_LEN = 200;
5215
5216
  async function persistMessage(conversationId, role, content, accountId, tokens, createdAt, sender) {
5216
5217
  if (!content) return null;
5217
5218
  const messageId = randomUUID();
5219
+ const summary = role === "user" ? content.slice(0, SUMMARY_MAX_LEN).trim() : "";
5218
5220
  let embedding = null;
5219
5221
  try {
5220
5222
  embedding = await embed(content);
@@ -5223,8 +5225,17 @@ async function persistMessage(conversationId, role, content, accountId, tokens,
5223
5225
  }
5224
5226
  const session = getSession();
5225
5227
  try {
5226
- await session.run(
5227
- `CREATE (m:Message {
5228
+ const result = await session.run(
5229
+ `MATCH (c:Conversation {conversationId: $conversationId})
5230
+ OPTIONAL MATCH (tail:Message)-[:PART_OF]->(c)
5231
+ WHERE NOT (tail)-[:NEXT]->(:Message)
5232
+ // Capture whether THIS write's guard will fire. Read c.summary
5233
+ // before the SET so the boolean reflects the pre-state, not the
5234
+ // post-state \u2014 a false positive otherwise when a new user message
5235
+ // happens to equal an already-set summary (verbatim retry, short
5236
+ // catchphrase) and fooled a post-state equality check.
5237
+ WITH c, tail, (c.summary IS NULL AND $role = 'user' AND $summary <> '') AS summarySetThisWrite
5238
+ CREATE (m:Message {
5228
5239
  messageId: $messageId,
5229
5240
  conversationId: $conversationId,
5230
5241
  accountId: $accountId,
@@ -5238,16 +5249,24 @@ async function persistMessage(conversationId, role, content, accountId, tokens,
5238
5249
  ${tokens?.cacheReadTokens != null ? ", cacheReadTokens: $cacheReadTokens" : ""}
5239
5250
  ${tokens?.cacheCreationTokens != null ? ", cacheCreationTokens: $cacheCreationTokens" : ""}
5240
5251
  })
5241
- WITH m
5242
- MATCH (c:Conversation {conversationId: $conversationId})
5243
5252
  SET c.updatedAt = datetime()
5244
- CREATE (m)-[:PART_OF]->(c)`,
5253
+ CREATE (m)-[:PART_OF]->(c)
5254
+ FOREACH (prev IN CASE WHEN tail IS NULL THEN [] ELSE [tail] END |
5255
+ CREATE (prev)-[:NEXT]->(m)
5256
+ )
5257
+ FOREACH (_ IN CASE WHEN summarySetThisWrite THEN [1] ELSE [] END |
5258
+ SET c.summary = $summary
5259
+ )
5260
+ RETURN tail.messageId AS prevMessageId,
5261
+ summarySetThisWrite,
5262
+ size([(m2:Message)-[:PART_OF]->(c) | m2]) AS chainLen`,
5245
5263
  {
5246
5264
  messageId,
5247
5265
  conversationId,
5248
5266
  accountId,
5249
5267
  role,
5250
5268
  content,
5269
+ summary,
5251
5270
  ...createdAt ? { createdAt } : {},
5252
5271
  ...embedding ? { embedding } : {},
5253
5272
  ...sender ? { senderVisitorId: sender.visitorId, senderName: sender.displayName } : {},
@@ -5257,6 +5276,19 @@ async function persistMessage(conversationId, role, content, accountId, tokens,
5257
5276
  ...tokens?.cacheCreationTokens != null ? { cacheCreationTokens: neo4j.int(tokens.cacheCreationTokens) } : {}
5258
5277
  }
5259
5278
  );
5279
+ if (result.records.length === 0) {
5280
+ console.error(`[persist] Neo4j write skipped \u2014 conversation not found: ${conversationId.slice(0, 8)}\u2026`);
5281
+ return null;
5282
+ }
5283
+ const record = result.records[0];
5284
+ const prevMessageId = record.get("prevMessageId") ?? null;
5285
+ const summarySetThisWrite = record.get("summarySetThisWrite") === true;
5286
+ const chainLenRaw = record.get("chainLen");
5287
+ const chainLen = typeof chainLenRaw === "bigint" ? Number(chainLenRaw) : typeof chainLenRaw?.toNumber === "function" ? chainLenRaw.toNumber() : Number(chainLenRaw ?? 0);
5288
+ console.error(`[neo4j-store] append-message conversationId=${conversationId.slice(0, 8)}\u2026 messageId=${messageId.slice(0, 8)}\u2026 prev=${prevMessageId ? prevMessageId.slice(0, 8) + "\u2026" : "null"} chainLen=${chainLen}`);
5289
+ if (summarySetThisWrite) {
5290
+ console.error(`[neo4j-store] conversation-summary-set conversationId=${conversationId.slice(0, 8)}\u2026 len=${summary.length}`);
5291
+ }
5260
5292
  console.error(`[persist] ${(/* @__PURE__ */ new Date()).toISOString()} conversationId=${conversationId.slice(0, 8)}\u2026 role=${role} len=${content.length}${sender ? ` sender=${sender.displayName}` : ""}`);
5261
5293
  return messageId;
5262
5294
  } catch (err) {
@@ -18461,7 +18493,16 @@ app9.post("/", async (c) => {
18461
18493
  return c.text("Invalid JSON", 400);
18462
18494
  }
18463
18495
  const kindRaw = typeof body.kind === "string" ? body.kind : "unknown";
18464
- const allowedKinds = /* @__PURE__ */ new Set(["uncaught", "unhandled-rejection", "subresource", "test", "unknown"]);
18496
+ const allowedKinds = /* @__PURE__ */ new Set([
18497
+ "uncaught",
18498
+ "unhandled-rejection",
18499
+ "subresource",
18500
+ "test",
18501
+ "unknown",
18502
+ "graph-labels-in-graph",
18503
+ "graph-default-view",
18504
+ "graph-neighbourhood-pivot"
18505
+ ]);
18465
18506
  const kind = allowedKinds.has(kindRaw) ? kindRaw : "unknown";
18466
18507
  const msg = truncate2(body.msg, MAX_MSG_LEN);
18467
18508
  const url = truncate2(body.url, MAX_URL_LEN);
@@ -18550,6 +18591,41 @@ async function createAdminSession(accountId, thinkingView, userId, userName) {
18550
18591
  };
18551
18592
  }
18552
18593
  var app10 = new Hono2();
18594
+ app10.get("/", async (c) => {
18595
+ const sessionKey = c.req.query("session_key");
18596
+ if (!sessionKey || !validateSession(sessionKey, "admin")) {
18597
+ return c.json({ error: "Invalid or expired admin session" }, 401);
18598
+ }
18599
+ const accountId = getAccountIdForSession(sessionKey);
18600
+ if (!accountId) {
18601
+ return c.json({ error: "Session has no account binding" }, 401);
18602
+ }
18603
+ const account = resolveAccount();
18604
+ const thinkingView = account?.config.thinkingView ?? "default";
18605
+ let onboardingComplete = true;
18606
+ try {
18607
+ const step = await loadOnboardingStep(accountId);
18608
+ onboardingComplete = step === null || step >= 8;
18609
+ } catch (err) {
18610
+ console.error(`[session] restore onboarding query failed: ${err instanceof Error ? err.message : String(err)}`);
18611
+ }
18612
+ let businessName;
18613
+ try {
18614
+ const branding = await fetchBranding(accountId);
18615
+ businessName = branding?.name || void 0;
18616
+ } catch {
18617
+ }
18618
+ return c.json({
18619
+ session_key: sessionKey,
18620
+ agent_id: "admin",
18621
+ userId: getUserIdForSession(sessionKey),
18622
+ userName: getUserNameForSession(sessionKey),
18623
+ thinkingView,
18624
+ onboardingComplete,
18625
+ businessName,
18626
+ conversationId: getConversationIdForSession(sessionKey) ?? null
18627
+ });
18628
+ });
18553
18629
  app10.post("/", async (c) => {
18554
18630
  let body;
18555
18631
  try {
@@ -20893,7 +20969,13 @@ var GRAPH_LABEL_COLOURS = {
20893
20969
  OnboardingState: "#8B5CF6",
20894
20970
  // Email
20895
20971
  Email: "#65A30D",
20896
- EmailAccount: "#84CC16"
20972
+ EmailAccount: "#84CC16",
20973
+ // Review signals (Task 626 — previously written by review-detector but
20974
+ // unregistered here, producing an `unknown label` 400 whenever the
20975
+ // filter popover advertised the label. Registry reconciled so every
20976
+ // label written anywhere in the codebase has a colour + a 200 from
20977
+ // graph-subgraph default mode).
20978
+ ReviewAlert: "#DC2626"
20897
20979
  };
20898
20980
  var ALL_GRAPH_LABELS = Object.freeze(
20899
20981
  Object.keys(GRAPH_LABEL_COLOURS)
@@ -20901,6 +20983,9 @@ var ALL_GRAPH_LABELS = Object.freeze(
20901
20983
  var HIDDEN_BY_DEFAULT_LABELS = Object.freeze(
20902
20984
  /* @__PURE__ */ new Set(["Chunk", "GraphPreference"])
20903
20985
  );
20986
+ var FILTER_EXCLUDED_LABELS = Object.freeze(
20987
+ /* @__PURE__ */ new Set(["ToolCall", "WorkflowRun", "WorkflowStep", "ReviewAlert"])
20988
+ );
20904
20989
  function isKnownLabel(label) {
20905
20990
  return Object.prototype.hasOwnProperty.call(GRAPH_LABEL_COLOURS, label);
20906
20991
  }
@@ -21311,16 +21396,22 @@ app29.get("/", requireAdminSession, async (c) => {
21311
21396
  const started = Date.now();
21312
21397
  const session = getSession();
21313
21398
  try {
21314
- const hidden = [...HIDDEN_BY_DEFAULT_LABELS];
21399
+ const excluded = [...HIDDEN_BY_DEFAULT_LABELS, ...FILTER_EXCLUDED_LABELS];
21315
21400
  const result = await session.executeRead(async (tx) => {
21316
- return await tx.run(LABELS_IN_GRAPH_CYPHER, { accountId, hidden });
21401
+ return await tx.run(LABELS_IN_GRAPH_CYPHER, { accountId, excluded });
21402
+ });
21403
+ const labels = result.records.map((r) => ({
21404
+ label: String(r.get("label")),
21405
+ nodeCount: toNumber(r.get("nodeCount")),
21406
+ relDegree: toNumber(r.get("relDegree"))
21407
+ })).filter((row) => row.nodeCount > 0).sort((a, b) => {
21408
+ if (b.relDegree !== a.relDegree) return b.relDegree - a.relDegree;
21409
+ return a.label.localeCompare(b.label);
21317
21410
  });
21318
- const record = result.records[0];
21319
- const rawLabels = record?.get("labels") ?? [];
21320
- const labels = [...new Set(rawLabels)].sort();
21321
21411
  const elapsed = Date.now() - started;
21412
+ const summary = labels.map((l) => `${l.label}:${l.nodeCount}:${l.relDegree}`).join(",");
21322
21413
  console.error(
21323
- `[graph-page] labels-in-graph account=${accountId} labels=${labels.join(",")} ms=${elapsed}`
21414
+ `[graph-page] labels-in-graph account=${accountId} labels=${summary} ms=${elapsed}`
21324
21415
  );
21325
21416
  return c.json({ labels });
21326
21417
  } catch (err) {
@@ -21337,15 +21428,20 @@ app29.get("/", requireAdminSession, async (c) => {
21337
21428
  }
21338
21429
  }
21339
21430
  });
21431
+ function toNumber(v) {
21432
+ if (typeof v === "bigint") return Number(v);
21433
+ if (typeof v === "number") return v;
21434
+ return Number(v ?? 0);
21435
+ }
21340
21436
  var LABELS_IN_GRAPH_CYPHER = `
21341
21437
  MATCH (n)
21342
21438
  WHERE n.accountId = $accountId
21343
21439
  AND NOT n:Trashed
21344
21440
  AND n.deletedAt IS NULL
21345
- UNWIND labels(n) AS lbl
21346
- WITH DISTINCT lbl
21347
- WHERE NOT lbl IN $hidden
21348
- RETURN collect(lbl) AS labels
21441
+ WITH n, [l IN labels(n) WHERE NOT l IN $excluded] AS keptLabels
21442
+ UNWIND keptLabels AS label
21443
+ WITH label, count(DISTINCT n) AS nodeCount, sum(size([(n)--() | 1])) AS relDegree
21444
+ RETURN label, nodeCount, relDegree
21349
21445
  `;
21350
21446
  var graph_labels_in_graph_default = app29;
21351
21447
 
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-DD-I1_y5.js";import{i as t,n,o as r,r as i,t as a}from"./jsx-runtime-ImbU973I.js";import{a as o,i as s,n as c,o as l,r as u,t as d}from"./share-2-MZ4MqbjS.js";import{n as f,t as p}from"./file-lmzx24EO.js";import{t as m}from"./house-ClhI06TA.js";var h=i(`circle-arrow-up`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 12-4-4-4 4`,key:`177agl`}],[`path`,{d:`M12 16V8`,key:`1sbj14`}]]),g=i(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),_=i(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),v=t(),y=e(r(),1),b=a();function x(){let[e,t]=(0,y.useState)(null),[n,r]=(0,y.useState)(!1);return(0,y.useEffect)(()=>{try{t(sessionStorage.getItem(`maxy-admin-session-key`))}catch{t(null)}r(!0)},[]),n?e?(0,b.jsxs)(`div`,{className:`data-page`,children:[(0,b.jsxs)(`header`,{className:`data-header`,children:[(0,b.jsxs)(`h1`,{className:`data-title`,children:[(0,b.jsx)(l,{size:18}),` Data`]}),(0,b.jsx)(S,{})]}),(0,b.jsxs)(`main`,{className:`data-main`,children:[(0,b.jsx)(C,{sessionKey:e}),(0,b.jsx)(O,{sessionKey:e})]})]}):(0,b.jsxs)(`div`,{className:`data-page`,children:[(0,b.jsx)(`header`,{className:`data-header`,children:(0,b.jsxs)(`h1`,{className:`data-title`,children:[(0,b.jsx)(l,{size:18}),` Data`]})}),(0,b.jsxs)(`div`,{className:`data-empty`,children:[(0,b.jsx)(`p`,{children:`You are not signed in.`}),(0,b.jsxs)(`p`,{children:[`Open the `,(0,b.jsx)(`a`,{href:`/`,className:`data-link`,children:`main admin page`}),` and log in, then return here.`]})]})]}):(0,b.jsx)(`div`,{className:`data-page`,children:(0,b.jsxs)(`div`,{className:`data-loading`,children:[(0,b.jsx)(o,{size:18,className:`spin`}),` Loading…`]})})}function S(){let[e,t]=(0,y.useState)(!1),n=(0,y.useRef)(null);(0,y.useEffect)(()=>{if(!e)return;let r=e=>{n.current&&(n.current.contains(e.target)||t(!1))},i=e=>{e.key===`Escape`&&t(!1)};return document.addEventListener(`mousedown`,r),document.addEventListener(`keydown`,i),()=>{document.removeEventListener(`mousedown`,r),document.removeEventListener(`keydown`,i)}},[e]);let r=(0,y.useCallback)(()=>{try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},[]);return(0,b.jsxs)(`div`,{className:`chat-burger-wrap`,ref:n,children:[(0,b.jsx)(`button`,{type:`button`,className:`chat-burger`,onClick:()=>t(e=>!e),"aria-label":`Menu`,"aria-haspopup":`true`,"aria-expanded":e,children:(0,b.jsx)(u,{size:20})}),e&&(0,b.jsxs)(`div`,{className:`chat-menu`,children:[(0,b.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,onClick:()=>{t(!1),window.location.href=`/`},children:[(0,b.jsx)(m,{size:14}),` Chat`]}),(0,b.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,onClick:()=>{t(!1),window.location.href=`/graph`},children:[(0,b.jsx)(d,{size:14}),` Graph`]}),(0,b.jsx)(`div`,{className:`chat-menu-divider`}),(0,b.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,onClick:()=>{t(!1),r()},children:[(0,b.jsx)(s,{size:14}),` Log out`]})]})]})}function C({sessionKey:e}){let[t,n]=(0,y.useState)(``),[r,i]=(0,y.useState)(``),[a,s]=(0,y.useState)(null),[l,u]=(0,y.useState)(!1),[d,f]=(0,y.useState)(null);return(0,y.useEffect)(()=>{let e=t.trim();if(!e){i(``),s(null);return}let n=setTimeout(()=>i(e),300);return()=>clearTimeout(n)},[t]),(0,y.useEffect)(()=>{if(!r)return;let t=!1;u(!0),f(null);let n=`/api/admin/graph-search?session_key=${encodeURIComponent(e)}&q=${encodeURIComponent(r)}&limit=20`;return fetch(n).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}).then(e=>{t||s(e.results)}).catch(e=>{t||f(e instanceof Error?e.message:String(e))}).finally(()=>{t||u(!1)}),()=>{t=!0}},[r,e]),(0,b.jsxs)(`section`,{className:`data-panel`,children:[(0,b.jsx)(`h2`,{className:`data-panel-title`,children:`Search`}),(0,b.jsx)(`p`,{className:`data-panel-subtitle`,children:`Find anything in your knowledge base by keyword.`}),(0,b.jsxs)(`div`,{className:`data-search-input`,children:[(0,b.jsx)(c,{size:14}),(0,b.jsx)(`input`,{type:`text`,placeholder:`Search your knowledge…`,value:t,onChange:e=>n(e.target.value),autoFocus:!0,autoComplete:`off`,spellCheck:!1}),l&&(0,b.jsx)(o,{size:14,className:`spin`})]}),d&&(0,b.jsxs)(`div`,{className:`data-error`,children:[`Search failed: `,d]}),a&&!l&&(0,b.jsxs)(`div`,{className:`data-results-meta`,children:[a.length,` result`,a.length===1?``:`s`]}),a&&a.length===0&&!l&&(0,b.jsx)(`div`,{className:`data-empty-results`,children:`No matches. Try a different keyword.`}),a&&a.length>0&&(0,b.jsx)(`ul`,{className:`data-results`,children:a.map(e=>(0,b.jsx)(w,{hit:e},e.nodeId))})]})}function w({hit:e}){let t=E(e.properties),n=D(e.properties),r=T(e.labels),[i,a]=(0,y.useState)(!1),o=n&&n.length>280,s=i||!o?n:n?.slice(0,280)+`…`;return(0,b.jsxs)(`li`,{className:`data-result`,children:[r&&(0,b.jsx)(`div`,{className:`data-result-header`,children:(0,b.jsx)(`span`,{className:`data-result-labels`,children:r})}),t&&(0,b.jsx)(`div`,{className:`data-result-title`,children:t}),n&&(0,b.jsx)(`pre`,{className:`data-result-body`,children:s}),o&&(0,b.jsx)(`button`,{type:`button`,className:`data-result-toggle`,onClick:()=>a(e=>!e),children:i?`Show less`:`Show more`})]})}function T(e){if(e.length===0)return null;let t=e[0].replace(/([a-z])([A-Z])/g,`$1 $2`);return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}function E(e){for(let t of[`title`,`name`,`summary`,`headline`]){let n=e[t];if(typeof n==`string`&&n.length>0)return n.length>140?n.slice(0,140)+`…`:n}return null}function D(e){for(let t of[`content`,`summary`,`body`,`description`,`text`]){let n=e[t];if(typeof n==`string`&&n.length>0)return n}return null}function O({sessionKey:e}){let[t,r]=(0,y.useState)(`.`),[i,a]=(0,y.useState)(null),[s,c]=(0,y.useState)([]),[l,u]=(0,y.useState)(!1),[d,m]=(0,y.useState)(null),[v,x]=(0,y.useState)(!1),[S,C]=(0,y.useState)(null),[w,T]=(0,y.useState)(null),[E,D]=(0,y.useState)(null),[O,j]=(0,y.useState)(null),M=(0,y.useRef)(null),[N,P]=(0,y.useState)(0);(0,y.useEffect)(()=>{let n=!1;u(!0),m(null);let r=`/api/admin/files?session_key=${encodeURIComponent(e)}&path=${encodeURIComponent(t===`.`?``:t)}`;return fetch(r).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}).then(e=>{n||(a(e.entries),c(e.displayPath??[]))}).catch(e=>{n||(a([]),c([]),m(e instanceof Error?e.message:String(e)))}).finally(()=>{n||u(!1)}),()=>{n=!0}},[e,t,N]);let F=(0,y.useCallback)(e=>{r(e)},[]),I=(0,y.useCallback)(()=>{if(t===`.`||t===``)return;let e=t.split(`/`).filter(Boolean);e.pop(),r(e.length===0?`.`:e.join(`/`))},[t]),L=(0,y.useCallback)(n=>{let r=t===`.`?n.name:`${t}/${n.name}`,i=`/api/admin/files/download?session_key=${encodeURIComponent(e)}&path=${encodeURIComponent(r)}`,a=document.createElement(`a`);a.href=i,a.rel=`noopener noreferrer`,document.body.appendChild(a),a.click(),a.remove()},[t,e]),R=(0,y.useCallback)(()=>{M.current?.click()},[]),z=(0,y.useCallback)(e=>{T(null),j(e.name)},[]),B=(0,y.useCallback)(()=>{j(null)},[]),V=(0,y.useCallback)(async n=>{let r=t===`.`?n.name:`${t}/${n.name}`;T(null),j(null),D(n.name);try{let t=`/api/admin/files?session_key=${encodeURIComponent(e)}&path=${encodeURIComponent(r)}`,n=await fetch(t,{method:`DELETE`}),i=await n.json().catch(()=>({error:`HTTP ${n.status}`}));if(!n.ok)throw Error(i.error??`HTTP ${n.status}`);P(e=>e+1)}catch(e){T(e instanceof Error?e.message:String(e))}finally{D(null)}},[t,e]);(0,y.useEffect)(()=>{if(!O)return;let e=e=>{e.key===`Escape`&&j(null)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[O]);let H=(0,y.useCallback)(async t=>{C(null),x(!0);try{let n=new FormData;n.append(`session_key`,e),n.append(`file`,t);let i=await fetch(`/api/admin/files/upload`,{method:`POST`,body:n}),a=await i.json().catch(()=>({error:`HTTP ${i.status}`}));if(!i.ok)throw Error(a.error??`HTTP ${i.status}`);r(a.path.split(`/`).slice(0,-1).join(`/`)||`.`),P(e=>e+1)}catch(e){C(e instanceof Error?e.message:String(e))}finally{x(!1),M.current&&(M.current.value=``)}},[e]);return(0,b.jsxs)(`section`,{className:`data-panel`,children:[(0,b.jsxs)(`div`,{className:`data-panel-heading`,children:[(0,b.jsx)(`h2`,{className:`data-panel-title`,children:`Files`}),(0,b.jsxs)(`div`,{className:`data-file-actions`,children:[(0,b.jsxs)(`button`,{type:`button`,className:`data-btn`,onClick:R,disabled:v,children:[v?(0,b.jsx)(o,{size:14,className:`spin`}):(0,b.jsx)(_,{size:14}),` Upload`]}),(0,b.jsx)(`input`,{type:`file`,ref:M,hidden:!0,onChange:e=>{let t=e.target.files?.[0];t&&H(t)}})]})]}),(0,b.jsxs)(`p`,{className:`data-panel-subtitle`,children:[`Everything under your install's `,(0,b.jsx)(`code`,{children:`data/`}),` directory. Click a folder to open it, a file to download it. Uploads go to `,(0,b.jsx)(`code`,{children:`data/uploads/`}),`.`]}),(0,b.jsxs)(`div`,{className:`data-breadcrumbs`,children:[(0,b.jsx)(`button`,{type:`button`,className:`data-crumb`,onClick:()=>F(`.`),children:`data`}),s.map((e,t)=>{let n=s.slice(0,t+1).map(e=>e.name).join(`/`);return(0,b.jsxs)(`span`,{className:`data-crumb-wrap`,children:[(0,b.jsx)(`span`,{className:`data-crumb-sep`,children:`/`}),(0,b.jsx)(`button`,{type:`button`,className:`data-crumb`,onClick:()=>F(n),title:e.name,children:e.displayName??e.name})]},n)}),t!==`.`&&(0,b.jsxs)(`button`,{type:`button`,className:`data-btn data-btn-ghost data-up-btn`,onClick:I,children:[(0,b.jsx)(h,{size:14}),` Up`]})]}),S&&(0,b.jsxs)(`div`,{className:`data-error`,children:[`Upload failed: `,S]}),w&&(0,b.jsxs)(`div`,{className:`data-error`,children:[`Delete failed: `,w]}),d&&(0,b.jsx)(`div`,{className:`data-error`,children:d}),l&&(0,b.jsxs)(`div`,{className:`data-loading`,children:[(0,b.jsx)(o,{size:14,className:`spin`}),` Loading…`]}),!l&&i&&i.length===0&&!d&&(0,b.jsx)(`div`,{className:`data-empty-results`,children:`Empty directory.`}),!l&&i&&i.length>0&&(0,b.jsx)(`ul`,{className:`data-entries`,children:i.map(e=>{let r=e.displayName??e.name,i=E===e.name,a=O===e.name;return(0,b.jsx)(`li`,{className:`data-entry`,children:e.kind===`directory`?(0,b.jsxs)(`button`,{type:`button`,className:`data-entry-btn`,onClick:()=>F(t===`.`?e.name:`${t}/${e.name}`),children:[(0,b.jsx)(g,{size:14}),(0,b.jsx)(`span`,{className:`data-entry-name`,title:e.name,children:r})]}):e.kind===`file`?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`button`,{type:`button`,className:`data-entry-btn`,onClick:()=>L(e),title:`Download ${r}`,disabled:a,children:[(0,b.jsx)(p,{size:14}),(0,b.jsx)(`span`,{className:`data-entry-name`,title:e.name,children:r}),(0,b.jsxs)(`span`,{className:`data-entry-meta`,title:`Modified ${A(e.modifiedAt)}`,children:[k(e.sizeBytes),` · `,A(e.modifiedAt)]}),(0,b.jsx)(f,{size:12,className:`data-entry-download-icon`})]}),a?(0,b.jsxs)(`div`,{className:`data-entry-confirm`,role:`group`,"aria-label":`Confirm delete ${r}`,children:[(0,b.jsx)(`span`,{className:`data-entry-confirm-label`,children:`Delete?`}),(0,b.jsx)(`button`,{type:`button`,className:`data-entry-confirm-yes`,onClick:()=>V(e),autoFocus:!0,children:`Yes`}),(0,b.jsx)(`button`,{type:`button`,className:`data-entry-confirm-no`,onClick:B,children:`No`})]}):(0,b.jsx)(`button`,{type:`button`,className:`data-entry-delete`,onClick:()=>z(e),disabled:i,title:`Delete ${r}`,"aria-label":`Delete ${r}`,children:i?(0,b.jsx)(o,{size:14,className:`spin`}):(0,b.jsx)(n,{size:14})})]}):(0,b.jsxs)(`div`,{className:`data-entry-btn data-entry-disabled`,children:[(0,b.jsx)(p,{size:14}),(0,b.jsx)(`span`,{className:`data-entry-name`,children:r}),(0,b.jsx)(`span`,{className:`data-entry-meta`,children:`special`})]})},e.name)})})]})}function k(e){return e==null?``:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/1024/1024).toFixed(1)} MB`:`${(e/1024/1024/1024).toFixed(1)} GB`}function A(e){try{let t=new Date(e);if(isNaN(t.getTime()))return`—`;let n=typeof navigator<`u`?navigator.languages&&navigator.languages.length>0?[...navigator.languages]:[navigator.language]:void 0;return t.toLocaleString(n,{dateStyle:`medium`,timeStyle:`short`})}catch{return`—`}}(0,v.createRoot)(document.getElementById(`root`)).render((0,b.jsx)(x,{}));