@burdenoff/microfe-vibecontrols 2026.608.2 → 2026.608.4

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.
@@ -116,9 +116,9 @@ function m({ changeset: e }) {
116
116
  })]
117
117
  });
118
118
  }
119
- function h({ log: n, onClose: i }) {
120
- let { t: a } = r(), o = (e, t) => {
121
- let n = a(e);
119
+ function h({ log: n, onClose: i, footer: a }) {
120
+ let { t: o } = r(), s = (e, t) => {
121
+ let n = o(e);
122
122
  return n === e ? t : n;
123
123
  };
124
124
  return t(() => {
@@ -130,7 +130,7 @@ function h({ log: n, onClose: i }) {
130
130
  className: "fixed inset-0 z-[1000] flex justify-end bg-bg-overlay/40",
131
131
  children: [/* @__PURE__ */ u("button", {
132
132
  type: "button",
133
- "aria-label": o("audit.closeDetailOverlay", "Close audit log detail"),
133
+ "aria-label": s("audit.closeDetailOverlay", "Close audit log detail"),
134
134
  className: "absolute inset-0 cursor-default",
135
135
  onClick: i
136
136
  }), /* @__PURE__ */ d("aside", {
@@ -158,7 +158,7 @@ function h({ log: n, onClose: i }) {
158
158
  })
159
159
  ] }), /* @__PURE__ */ u("button", {
160
160
  type: "button",
161
- "aria-label": o("audit.closeDetail", "Close audit log detail"),
161
+ "aria-label": s("audit.closeDetail", "Close audit log detail"),
162
162
  onClick: i,
163
163
  className: "flex size-10 items-center justify-center rounded hover:bg-bg-secondary",
164
164
  children: /* @__PURE__ */ u(l, { size: 16 })
@@ -299,7 +299,11 @@ function h({ log: n, onClose: i }) {
299
299
  /* @__PURE__ */ u(f, {
300
300
  data: n.metadata,
301
301
  label: "Metadata"
302
- })
302
+ }),
303
+ a ? /* @__PURE__ */ u("div", {
304
+ className: "pt-2",
305
+ children: a
306
+ }) : null
303
307
  ]
304
308
  })]
305
309
  })]
@@ -1 +1 @@
1
- {"version":3,"file":"AuditLogDetail.js","names":[],"sources":["../../../src/components/audit/AuditLogDetail.tsx"],"sourcesContent":["import { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { useEffect, useState } from 'react';\nimport { X, ChevronDown, ChevronRight, Copy, Check, Terminal } from 'lucide-react';\nimport type { VibeAuditLogDetailFragment } from '@/generated/wspace-operations';\nimport { StatusBadge } from '@/components/shared';\n\ninterface AuditLogDetailProps {\n log: VibeAuditLogDetailFragment;\n onClose: () => void;\n}\n\nfunction JsonViewer({ data, label }: { data: unknown; label: string }) {\n const [expanded, setExpanded] = useState(false);\n if (!data) return null;\n\n return (\n <div className=\"border border-border-primary rounded-lg overflow-hidden\">\n <button\n type=\"button\"\n onClick={() => setExpanded(!expanded)}\n className=\"w-full flex items-center gap-2 px-3 py-2 text-sm font-medium bg-bg-secondary/50 hover:bg-bg-secondary\"\n >\n {expanded ? <ChevronDown size={14} /> : <ChevronRight size={14} />}\n {label}\n </button>\n {expanded && (\n <pre className=\"px-3 py-2 text-xs overflow-auto max-h-64 bg-bg-sunken\">\n {JSON.stringify(data, null, 2)}\n </pre>\n )}\n </div>\n );\n}\n\nfunction CommandBlock({\n command,\n output,\n exitCode,\n}: {\n command?: string | null;\n output?: string | null;\n exitCode?: number | null;\n}) {\n const [copied, setCopied] = useState(false);\n if (!command && !output) return null;\n\n const handleCopy = () => {\n if (command) {\n navigator.clipboard.writeText(command);\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n }\n };\n\n return (\n <div className=\"border border-border-primary rounded-lg overflow-hidden\">\n <div className=\"flex items-center justify-between px-3 py-2 bg-bg-secondary/50\">\n <span className=\"flex items-center gap-2 text-sm font-medium\">\n <Terminal size={14} />\n Command Execution\n {exitCode !== null && exitCode !== undefined && (\n <span\n className={`px-1.5 py-0.5 rounded text-xs ${exitCode === 0 ? 'bg-status-success-bg text-status-success-text' : 'bg-status-error-bg text-status-error-text'}`}\n >\n exit {exitCode}\n </span>\n )}\n </span>\n {command && (\n <button\n type=\"button\"\n onClick={handleCopy}\n className=\"p-1 rounded hover:bg-bg-secondary text-text-secondary\"\n title=\"Copy command\"\n >\n {copied ? <Check size={14} /> : <Copy size={14} />}\n </button>\n )}\n </div>\n {command && (\n <div className=\"px-3 py-2 bg-bg-sunken text-text-secondary font-mono text-xs\">\n <span className=\"text-status-success-text\">$</span> {command}\n </div>\n )}\n {output && (\n <pre className=\"px-3 py-2 text-xs bg-bg-sunken text-text-tertiary font-mono overflow-auto max-h-48\">\n {output}\n </pre>\n )}\n </div>\n );\n}\n\nfunction ChangesetViewer({ changeset }: { changeset: Record<string, unknown> | null | undefined }) {\n const [expanded, setExpanded] = useState(false);\n if (!changeset || typeof changeset !== 'object') return null;\n\n const changes = Object.entries(changeset as Record<string, { from: unknown; to: unknown }>);\n if (changes.length === 0) return null;\n\n return (\n <div className=\"border border-border-primary rounded-lg overflow-hidden\">\n <button\n type=\"button\"\n onClick={() => setExpanded(!expanded)}\n className=\"w-full flex items-center gap-2 px-3 py-2 text-sm font-medium bg-bg-secondary/50 hover:bg-bg-secondary\"\n >\n {expanded ? <ChevronDown size={14} /> : <ChevronRight size={14} />}\n Changes ({changes.length} field{changes.length !== 1 ? 's' : ''})\n </button>\n {expanded && (\n <div className=\"px-3 py-2 space-y-2\">\n {changes.map(([field, change]) => (\n <div key={field} className=\"text-xs\">\n <span className=\"font-medium text-text-primary\">{field}</span>\n <div className=\"ml-4 mt-1 space-y-0.5\">\n <div className=\"flex items-center gap-2\">\n <span className=\"text-status-error-text font-mono\">-</span>\n <span className=\"text-status-error-text\">\n {JSON.stringify((change as { from: unknown }).from)}\n </span>\n </div>\n <div className=\"flex items-center gap-2\">\n <span className=\"text-status-success-text font-mono\">+</span>\n <span className=\"text-status-success-text\">\n {JSON.stringify((change as { to: unknown }).to)}\n </span>\n </div>\n </div>\n </div>\n ))}\n </div>\n )}\n </div>\n );\n}\n\nexport function AuditLogDetail({ log, onClose }: AuditLogDetailProps) {\n const { t } = useI18n();\n const tr = (key: string, fallback: string) => {\n const v = t(key);\n return v === key ? fallback : v;\n };\n\n useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n onClose();\n }\n };\n\n window.addEventListener('keydown', handleKeyDown);\n return () => window.removeEventListener('keydown', handleKeyDown);\n }, [onClose]);\n\n return (\n <div className=\"fixed inset-0 z-[1000] flex justify-end bg-bg-overlay/40\">\n <button\n type=\"button\"\n aria-label={tr('audit.closeDetailOverlay', 'Close audit log detail')}\n className=\"absolute inset-0 cursor-default\"\n onClick={onClose}\n />\n <aside className=\"relative flex h-full w-full max-w-[480px] flex-col border-l border-border-default bg-bg-surface shadow-xl\">\n {/* Header */}\n <div className=\"flex items-center justify-between px-4 py-3 border-b border-border-default\">\n <div>\n <h3 className=\"text-sm font-semibold\">{log.action.replace(/_/g, ' ')}</h3>\n <p className=\"text-xs text-text-secondary\">\n {log.resourceType.replace(/_/g, ' ')}\n {log.resourceName ? ` · ${log.resourceName}` : ''}\n </p>\n <details className=\"mt-1\">\n <summary className=\"cursor-pointer text-[10px] uppercase tracking-wider text-text-secondary hover:text-text-primary\">\n Event ID\n </summary>\n <span className=\"mt-1 block break-all font-mono text-[11px] text-text-secondary\">\n {log.id}\n </span>\n </details>\n </div>\n <button\n type=\"button\"\n aria-label={tr('audit.closeDetail', 'Close audit log detail')}\n onClick={onClose}\n className=\"flex size-10 items-center justify-center rounded hover:bg-bg-secondary\"\n >\n <X size={16} />\n </button>\n </div>\n\n {/* Content */}\n <div className=\"flex-1 overflow-y-auto p-4 space-y-4\">\n {/* Summary */}\n <div className=\"grid grid-cols-2 gap-3 text-sm\">\n <div>\n <span className=\"text-text-secondary text-xs\">Action</span>\n <div className=\"font-medium\">{log.action}</div>\n </div>\n <div>\n <span className=\"text-text-secondary text-xs\">Status</span>\n <div>\n <StatusBadge status={log.status} size=\"sm\" />\n </div>\n </div>\n <div>\n <span className=\"text-text-secondary text-xs\">Resource Type</span>\n <div className=\"font-medium\">{log.resourceType.replace(/_/g, ' ')}</div>\n </div>\n <div>\n <span className=\"text-text-secondary text-xs\">Resource ID</span>\n <div className=\"font-mono text-xs truncate\">{log.resourceId || '-'}</div>\n </div>\n <div className=\"col-span-2\">\n <span className=\"text-text-secondary text-xs\">Resource Name</span>\n <div>{log.resourceName || '-'}</div>\n </div>\n <div className=\"col-span-2\">\n <span className=\"text-text-secondary text-xs\">Description</span>\n <div className=\"text-text-secondary\">{log.description || '-'}</div>\n </div>\n <div className=\"col-span-2\">\n <span className=\"text-text-secondary text-xs\">Actor</span>\n <div className=\"flex items-center gap-2\">\n <span className=\"capitalize\">\n {(log.actorType || 'unknown').toLowerCase().replace(/_/g, ' ')}\n </span>\n <details className=\"text-xs text-text-secondary\">\n <summary className=\"cursor-pointer hover:text-text-primary\">ID</summary>\n <span className=\"ml-2 break-all font-mono text-[11px]\">{log.actorId}</span>\n </details>\n </div>\n </div>\n <div>\n <span className=\"text-text-secondary text-xs\">Timestamp</span>\n <div className=\"text-xs\">{new Date(log.createdAt).toLocaleString()}</div>\n </div>\n <div>\n <span className=\"text-text-secondary text-xs\">IP Address</span>\n <div className=\"font-mono text-xs\">{log.ipAddress || '-'}</div>\n </div>\n {log.expiresAt && (\n <div className=\"col-span-2\">\n <span className=\"text-text-secondary text-xs\">Expires At</span>\n <div className=\"text-xs text-status-warning-text\">\n {new Date(log.expiresAt).toLocaleString()}\n </div>\n </div>\n )}\n {log.errorMessage && (\n <div className=\"col-span-2\">\n <span className=\"text-text-secondary text-xs\">Error</span>\n <div className=\"text-status-error-text text-xs\">{log.errorMessage}</div>\n </div>\n )}\n {log.deleteReason && (\n <div className=\"col-span-2\">\n <span className=\"text-text-secondary text-xs\">Delete Reason</span>\n <div className=\"text-xs\">{log.deleteReason}</div>\n </div>\n )}\n </div>\n\n {/* Command execution */}\n <CommandBlock command={log.command} output={log.output} exitCode={log.exitCode} />\n\n {/* Changeset */}\n <ChangesetViewer changeset={log.changeset as Record<string, unknown> | null} />\n\n {/* State snapshots */}\n <JsonViewer data={log.previousState} label=\"Previous State\" />\n <JsonViewer data={log.newState} label=\"New State\" />\n <J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"sourcesContent":["import { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { useEffect, useState, type ReactNode } from 'react';\nimport { X, ChevronDown, ChevronRight, Copy, Check, Terminal } from 'lucide-react';\nimport type { VibeAuditLogDetailFragment } from '@/generated/wspace-operations';\nimport { StatusBadge } from '@/components/shared';\n\ninterface AuditLogDetailProps {\n log: VibeAuditLogDetailFragment;\n onClose: () => void;\n /** Optional action node rendered at the bottom of the panel (e.g. drill-down). */\n footer?: ReactNode;\n}\n\nfunction JsonViewer({ data, label }: { data: unknown; label: string }) {\n const [expanded, setExpanded] = useState(false);\n if (!data) return null;\n\n return (\n <div className=\"border border-border-primary rounded-lg overflow-hidden\">\n <button\n type=\"button\"\n onClick={() => setExpanded(!expanded)}\n className=\"w-full flex items-center gap-2 px-3 py-2 text-sm font-medium bg-bg-secondary/50 hover:bg-bg-secondary\"\n >\n {expanded ? <ChevronDown size={14} /> : <ChevronRight size={14} />}\n {label}\n </button>\n {expanded && (\n <pre className=\"px-3 py-2 text-xs overflow-auto max-h-64 bg-bg-sunken\">\n {JSON.stringify(data, null, 2)}\n </pre>\n )}\n </div>\n );\n}\n\nfunction CommandBlock({\n command,\n output,\n exitCode,\n}: {\n command?: string | null;\n output?: string | null;\n exitCode?: number | null;\n}) {\n const [copied, setCopied] = useState(false);\n if (!command && !output) return null;\n\n const handleCopy = () => {\n if (command) {\n navigator.clipboard.writeText(command);\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n }\n };\n\n return (\n <div className=\"border border-border-primary rounded-lg overflow-hidden\">\n <div className=\"flex items-center justify-between px-3 py-2 bg-bg-secondary/50\">\n <span className=\"flex items-center gap-2 text-sm font-medium\">\n <Terminal size={14} />\n Command Execution\n {exitCode !== null && exitCode !== undefined && (\n <span\n className={`px-1.5 py-0.5 rounded text-xs ${exitCode === 0 ? 'bg-status-success-bg text-status-success-text' : 'bg-status-error-bg text-status-error-text'}`}\n >\n exit {exitCode}\n </span>\n )}\n </span>\n {command && (\n <button\n type=\"button\"\n onClick={handleCopy}\n className=\"p-1 rounded hover:bg-bg-secondary text-text-secondary\"\n title=\"Copy command\"\n >\n {copied ? <Check size={14} /> : <Copy size={14} />}\n </button>\n )}\n </div>\n {command && (\n <div className=\"px-3 py-2 bg-bg-sunken text-text-secondary font-mono text-xs\">\n <span className=\"text-status-success-text\">$</span> {command}\n </div>\n )}\n {output && (\n <pre className=\"px-3 py-2 text-xs bg-bg-sunken text-text-tertiary font-mono overflow-auto max-h-48\">\n {output}\n </pre>\n )}\n </div>\n );\n}\n\nfunction ChangesetViewer({ changeset }: { changeset: Record<string, unknown> | null | undefined }) {\n const [expanded, setExpanded] = useState(false);\n if (!changeset || typeof changeset !== 'object') return null;\n\n const changes = Object.entries(changeset as Record<string, { from: unknown; to: unknown }>);\n if (changes.length === 0) return null;\n\n return (\n <div className=\"border border-border-primary rounded-lg overflow-hidden\">\n <button\n type=\"button\"\n onClick={() => setExpanded(!expanded)}\n className=\"w-full flex items-center gap-2 px-3 py-2 text-sm font-medium bg-bg-secondary/50 hover:bg-bg-secondary\"\n >\n {expanded ? <ChevronDown size={14} /> : <ChevronRight size={14} />}\n Changes ({changes.length} field{changes.length !== 1 ? 's' : ''})\n </button>\n {expanded && (\n <div className=\"px-3 py-2 space-y-2\">\n {changes.map(([field, change]) => (\n <div key={field} className=\"text-xs\">\n <span className=\"font-medium text-text-primary\">{field}</span>\n <div className=\"ml-4 mt-1 space-y-0.5\">\n <div className=\"flex items-center gap-2\">\n <span className=\"text-status-error-text font-mono\">-</span>\n <span className=\"text-status-error-text\">\n {JSON.stringify((change as { from: unknown }).from)}\n </span>\n </div>\n <div className=\"flex items-center gap-2\">\n <span className=\"text-status-success-text font-mono\">+</span>\n <span className=\"text-status-success-text\">\n {JSON.stringify((change as { to: unknown }).to)}\n </span>\n </div>\n </div>\n </div>\n ))}\n </div>\n )}\n </div>\n );\n}\n\nexport function AuditLogDetail({ log, onClose, footer }: AuditLogDetailProps) {\n const { t } = useI18n();\n const tr = (key: string, fallback: string) => {\n const v = t(key);\n return v === key ? fallback : v;\n };\n\n useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n onClose();\n }\n };\n\n window.addEventListener('keydown', handleKeyDown);\n return () => window.removeEventListener('keydown', handleKeyDown);\n }, [onClose]);\n\n return (\n <div className=\"fixed inset-0 z-[1000] flex justify-end bg-bg-overlay/40\">\n <button\n type=\"button\"\n aria-label={tr('audit.closeDetailOverlay', 'Close audit log detail')}\n className=\"absolute inset-0 cursor-default\"\n onClick={onClose}\n />\n <aside className=\"relative flex h-full w-full max-w-[480px] flex-col border-l border-border-default bg-bg-surface shadow-xl\">\n {/* Header */}\n <div className=\"flex items-center justify-between px-4 py-3 border-b border-border-default\">\n <div>\n <h3 className=\"text-sm font-semibold\">{log.action.replace(/_/g, ' ')}</h3>\n <p className=\"text-xs text-text-secondary\">\n {log.resourceType.replace(/_/g, ' ')}\n {log.resourceName ? ` · ${log.resourceName}` : ''}\n </p>\n <details className=\"mt-1\">\n <summary className=\"cursor-pointer text-[10px] uppercase tracking-wider text-text-secondary hover:text-text-primary\">\n Event ID\n </summary>\n <span className=\"mt-1 block break-all font-mono text-[11px] text-text-secondary\">\n {log.id}\n </span>\n </details>\n </div>\n <button\n type=\"button\"\n aria-label={tr('audit.closeDetail', 'Close audit log detail')}\n onClick={onClose}\n className=\"flex size-10 items-center justify-center rounded hover:bg-bg-secondary\"\n >\n <X size={16} />\n </button>\n </div>\n\n {/* Content */}\n <div className=\"flex-1 overflow-y-auto p-4 space-y-4\">\n {/* Summary */}\n <div className=\"grid grid-cols-2 gap-3 text-sm\">\n <div>\n <span className=\"text-text-secondary text-xs\">Action</span>\n <div className=\"font-medium\">{log.action}</div>\n </div>\n <div>\n <span className=\"text-text-secondary text-xs\">Status</span>\n <div>\n <StatusBadge status={log.status} size=\"sm\" />\n </div>\n </div>\n <div>\n <span className=\"text-text-secondary text-xs\">Resource Type</span>\n <div className=\"font-medium\">{log.resourceType.replace(/_/g, ' ')}</div>\n </div>\n <div>\n <span className=\"text-text-secondary text-xs\">Resource ID</span>\n <div className=\"font-mono text-xs truncate\">{log.resourceId || '-'}</div>\n </div>\n <div className=\"col-span-2\">\n <span className=\"text-text-secondary text-xs\">Resource Name</span>\n <div>{log.resourceName || '-'}</div>\n </div>\n <div className=\"col-span-2\">\n <span className=\"text-text-secondary text-xs\">Description</span>\n <div className=\"text-text-secondary\">{log.description || '-'}</div>\n </div>\n <div className=\"col-span-2\">\n <span className=\"text-text-secondary text-xs\">Actor</span>\n <div className=\"flex items-center gap-2\">\n <span className=\"capitalize\">\n {(log.actorType || 'unknown').toLowerCase().replace(/_/g, ' ')}\n </span>\n <details className=\"text-xs text-text-secondary\">\n <summary className=\"cursor-pointer hover:text-text-primary\">ID</summary>\n <span className=\"ml-2 break-all font-mono text-[11px]\">{log.actorId}</span>\n </details>\n </div>\n </div>\n <div>\n <span className=\"text-text-secondary text-xs\">Timestamp</span>\n <div className=\"text-xs\">{new Date(log.createdAt).toLocaleString()}</div>\n </div>\n <div>\n <span className=\"text-text-secondary text-xs\">IP Address</span>\n <div className=\"font-mono text-xs\">{log.ipAddress || '-'}</div>\n </div>\n {log.expiresAt && (\n <div className=\"col-span-2\">\n <span className=\"text-text-secondary text-xs\">Expires At</span>\n <div className=\"text-xs text-status-warning-text\">\n {new Date(log.expiresAt).toLocaleString()}\n </div>\n </div>\n )}\n {log.errorMessage && (\n <div className=\"col-span-2\">\n <span className=\"text-text-secondary text-xs\">Error</span>\n <div className=\"text-status-error-text text-xs\">{log.errorMessage}</div>\n </div>\n )}\n {log.deleteReason && (\n <div className=\"col-span-2\">\n <span className=\"text-text-secondary text-xs\">Delete Reason</span>\n <div className=\"text-xs\">{log.deleteReason}</div>\n </div>\n )}\n </div>\n\n {/* Command execution */}\n <CommandBlock command={log.command} output={log.output} exitCode={log.exitCode} />\n\n {/* Changeset */}\n <ChangesetViewer changeset={log.changeset as Record<string, unknown> | null} />\n\n {/* State snapshots */}\n <JsonViewer data={log.previousState} label=\"Previous State\" />\n <JsonViewer data={log.newState} label=\"New State\" />\n <JsonViewer data={log.metadata} label=\"Metadata\" />\n\n {footer ? <div className=\"pt-2\">{footer}</div> : null}\n </div>\n </aside>\n </div>\n );\n}\n"],"mappings":";;;;;;;AAaA,SAAS,EAAW,EAAE,SAAM,YAA2C;CACrE,IAAM,CAAC,GAAU,KAAe,EAAS,GAAM;AAG/C,QAFK,IAGH,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,UAAD;GACE,MAAK;GACL,eAAe,EAAY,CAAC,EAAS;GACrC,WAAU;aAHZ,CAKc,EAAX,IAAY,IAA4B,GAA7B,EAAa,MAAM,IAAM,CAA6B,EACjE,EACM;MACR,KACC,kBAAC,OAAD;GAAK,WAAU;aACZ,KAAK,UAAU,GAAM,MAAM,EAAE;GAC1B,CAAA,CAEJ;MAjBU;;AAqBpB,SAAS,EAAa,EACpB,YACA,WACA,eAKC;CACD,IAAM,CAAC,GAAQ,KAAa,EAAS,GAAM;AAW3C,QAVI,CAAC,KAAW,CAAC,IAAe,OAW9B,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,QAAD;KAAM,WAAU;eAAhB;MACE,kBAAC,GAAD,EAAU,MAAM,IAAM,CAAA;;MAErB,KAAa,QACZ,kBAAC,QAAD;OACE,WAAW,iCAAiC,MAAa,IAAI,kDAAkD;iBADjH,CAEC,SACO,EACD;;MAEJ;QACN,KACC,kBAAC,UAAD;KACE,MAAK;KACL,eAzBe;AACvB,MAAI,MACF,UAAU,UAAU,UAAU,EAAQ,EACtC,EAAU,GAAK,EACf,iBAAiB,EAAU,GAAM,EAAE,IAAK;;KAsBlC,WAAU;KACV,OAAM;eAEI,EAAT,IAAU,IAAsB,GAAvB,EAAO,MAAM,IAAM,CAAqB;KAC3C,CAAA,CAEP;;GACL,KACC,kBAAC,OAAD;IAAK,WAA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AY,MAAM,EAAI;MAAU,OAAM;MAAa,CAAA;KAElD,IAAS,kBAAC,OAAD;MAAK,WAAU;gBAAQ;MAAa,CAAA,GAAG;KAC7C;MACA;KACJ"}
@@ -27,12 +27,12 @@ import { useFeatureFlag as De } from "@burdenoff/fe-libs/shared/feature-flags";
27
27
  import { AccessDenied as Oe, PermissionButton as ke } from "@burdenoff/fe-libs/shared/components";
28
28
  import { MotionItem as Ae, MotionList as je } from "@burdenoff/fe-libs/shared/motion";
29
29
  //#region src/components/notes/NotesTabPanel.tsx
30
- function h({ context: h, vibeId: g, agentVibes: _ = [] }) {
31
- let { t: Me } = he(), Ne = Ce(), v = we(), { hasPermission: y, isLoading: b, permissions: Pe } = Te(), x = y(c.NOTE_LIST), Fe = y(c.NOTE_CREATE), Ie = De(l.note.featureFlag, l.note.defaultEnabled), Le = y(l.note.permission), Re = Ie && Le, [S, C] = d(null), [w, ze] = d(""), [T, Be] = d("all"), [E, Ve] = d("all"), [D, O] = d("all"), [k, He] = d(!1), [A, j] = d("grid"), [Ue, M] = d(!1), [We, N] = d(null), [Ge, P] = d(!1), F = (e) => {
32
- v.cache.evict({
30
+ function h({ context: h, vibeId: g, sessionId: _, agentVibes: v = [] }) {
31
+ let { t: Me } = he(), Ne = Ce(), y = we(), { hasPermission: b, isLoading: x, permissions: Pe } = Te(), S = b(c.NOTE_LIST), Fe = b(c.NOTE_CREATE), Ie = De(l.note.featureFlag, l.note.defaultEnabled), Le = b(l.note.permission), Re = Ie && Le, [C, w] = d(null), [T, ze] = d(""), [E, Be] = d("all"), [D, Ve] = d("all"), [O, k] = d("all"), [A, He] = d(!1), [j, M] = d("grid"), [Ue, N] = d(!1), [We, P] = d(null), [Ge, F] = d(!1), I = (e) => {
32
+ y.cache.evict({
33
33
  id: "ROOT_QUERY",
34
34
  fieldName: "notes"
35
- }), v.cache.gc(), e();
35
+ }), y.cache.gc(), e();
36
36
  }, [Ke] = ee({
37
37
  refetchQueries: [e],
38
38
  awaitRefetchQueries: !0
@@ -48,36 +48,41 @@ function h({ context: h, vibeId: g, agentVibes: _ = [] }) {
48
48
  }), [Xe] = ie({
49
49
  refetchQueries: [e],
50
50
  awaitRefetchQueries: !0
51
- }), [I] = te({
51
+ }), [L] = te({
52
52
  refetchQueries: [e],
53
53
  awaitRefetchQueries: !0
54
54
  }), [Ze] = ne({
55
55
  refetchQueries: [e],
56
56
  awaitRefetchQueries: !0
57
- }), L = b || !x, { data: R } = t({ skip: L }), { data: z, loading: B, error: V, refetch: H } = i({
57
+ }), R = x || !S, { data: z } = t({ skip: R }), { data: B, loading: V, error: H, refetch: U } = i({
58
58
  variables: {
59
59
  filter: u(() => {
60
- let e = D === "all" ? void 0 : D;
61
- return h === "vibe" && g ? {
60
+ let e = O === "all" ? void 0 : O;
61
+ return h === "session" && _ ? {
62
+ sessionId: _,
63
+ isPinned: A ? !0 : void 0,
64
+ visibility: e
65
+ } : h === "vibe" && g ? {
62
66
  vibeId: g,
63
- isPinned: k ? !0 : void 0,
67
+ isPinned: A ? !0 : void 0,
64
68
  visibility: e
65
69
  } : {
66
- vibeId: T === "none" ? null : T === "all" ? void 0 : T,
67
- isPinned: k ? !0 : void 0,
70
+ vibeId: E === "none" ? null : E === "all" ? void 0 : E,
71
+ isPinned: A ? !0 : void 0,
68
72
  visibility: e
69
73
  };
70
74
  }, [
71
75
  h,
72
76
  g,
73
- T,
74
- k,
75
- D
77
+ _,
78
+ E,
79
+ A,
80
+ O
76
81
  ]),
77
82
  pagination: { limit: 50 }
78
83
  },
79
84
  fetchPolicy: "cache-and-network",
80
- skip: L
85
+ skip: R
81
86
  }), Qe = u(() => h === "agent" ? [
82
87
  {
83
88
  value: "all",
@@ -87,15 +92,15 @@ function h({ context: h, vibeId: g, agentVibes: _ = [] }) {
87
92
  value: "none",
88
93
  label: "No Vibe (General)"
89
94
  },
90
- ..._.map((e) => ({
95
+ ...v.map((e) => ({
91
96
  value: e.id,
92
97
  label: e.name
93
98
  }))
94
- ] : [], [h, _]), U = u(() => {
95
- let e = R?.availableNoteTags ?? [];
99
+ ] : [], [h, v]), W = u(() => {
100
+ let e = z?.availableNoteTags ?? [];
96
101
  return new Map(e.map((e) => [e.id, e]));
97
- }, [R?.availableNoteTags]), W = u(() => {
98
- let e = (z?.notes?.items ?? []).map((e) => ({
102
+ }, [z?.availableNoteTags]), G = u(() => {
103
+ let e = (B?.notes?.items ?? []).map((e) => ({
99
104
  id: e.id,
100
105
  workspaceId: e.workspaceId,
101
106
  vibeId: e.vibeId || null,
@@ -108,11 +113,11 @@ function h({ context: h, vibeId: g, agentVibes: _ = [] }) {
108
113
  label: e.tag.label,
109
114
  key: e.tag.key,
110
115
  color: e.tag.color
111
- } : U.has(e.tagId) ? {
116
+ } : W.has(e.tagId) ? {
112
117
  id: e.tagId,
113
- label: U.get(e.tagId).label,
114
- key: U.get(e.tagId).key,
115
- color: U.get(e.tagId).color ?? null
118
+ label: W.get(e.tagId).label,
119
+ key: W.get(e.tagId).key,
120
+ color: W.get(e.tagId).color ?? null
116
121
  } : void 0;
117
122
  return {
118
123
  id: e.id,
@@ -136,51 +141,51 @@ function h({ context: h, vibeId: g, agentVibes: _ = [] }) {
136
141
  name: e.vibe.name
137
142
  } : void 0
138
143
  }));
139
- if (h === "agent" && _.length > 0) {
140
- let t = new Set(_.map((e) => e.id));
144
+ if (h === "agent" && v.length > 0) {
145
+ let t = new Set(v.map((e) => e.id));
141
146
  return e.filter((e) => e.vibeId && t.has(e.vibeId));
142
147
  }
143
148
  return e;
144
149
  }, [
145
- z?.notes?.items,
150
+ B?.notes?.items,
146
151
  h,
147
- _,
148
- U
152
+ v,
153
+ W
149
154
  ]), $e = u(() => [{
150
155
  value: "all",
151
156
  label: "All Tags"
152
- }, ...(R?.availableNoteTags ?? []).map((e) => ({
157
+ }, ...(z?.availableNoteTags ?? []).map((e) => ({
153
158
  value: e.id,
154
159
  label: e.label
155
- }))], [R?.availableNoteTags]), G = u(() => W.filter((e) => {
156
- if (w) {
157
- let t = w.toLowerCase();
160
+ }))], [z?.availableNoteTags]), K = u(() => G.filter((e) => {
161
+ if (T) {
162
+ let t = T.toLowerCase();
158
163
  if (!(e.title.toLowerCase().includes(t) || e.content.toLowerCase().includes(t) || e.tagAssignments?.some((e) => e.tag?.label?.toLowerCase().includes(t)))) return !1;
159
164
  }
160
- return !(E !== "all" && !e.tagAssignments?.some((e) => e.tagId === E));
165
+ return !(D !== "all" && !e.tagAssignments?.some((e) => e.tagId === D));
161
166
  }), [
162
- W,
163
- w,
164
- E
165
- ]), K = u(() => [...G].sort((e, t) => e.isPinned && !t.isPinned ? -1 : !e.isPinned && t.isPinned ? 1 : new Date(t.updatedAt).getTime() - new Date(e.updatedAt).getTime()), [G]), q = (e) => {
166
- N(e), M(!0);
167
- }, J = () => {
168
- N(null), M(!0);
169
- }, Y = async (e) => {
167
+ G,
168
+ T,
169
+ D
170
+ ]), q = u(() => [...K].sort((e, t) => e.isPinned && !t.isPinned ? -1 : !e.isPinned && t.isPinned ? 1 : new Date(t.updatedAt).getTime() - new Date(e.updatedAt).getTime()), [K]), J = (e) => {
171
+ P(e), N(!0);
172
+ }, Y = () => {
173
+ P(null), N(!0);
174
+ }, X = async (e) => {
170
175
  try {
171
- e.isPinned ? await qe({ variables: { id: e.id } }) : await Ke({ variables: { id: e.id } }), F(H);
176
+ e.isPinned ? await qe({ variables: { id: e.id } }) : await Ke({ variables: { id: e.id } }), I(U);
172
177
  } catch (e) {
173
178
  console.error("Failed to toggle pin for note:", e);
174
179
  }
175
- }, X = async (e) => {
180
+ }, et = async (e) => {
176
181
  try {
177
- await Je({ variables: { id: e.id } }), F(H);
182
+ await Je({ variables: { id: e.id } }), I(U);
178
183
  } catch (e) {
179
184
  console.error("Failed to delete note:", e);
180
185
  }
181
- }, et = async (e) => {
186
+ }, tt = async (e) => {
182
187
  let t = () => {
183
- M(!1), N(null), oe(), P(!0);
188
+ N(!1), P(null), oe(), F(!0);
184
189
  };
185
190
  try {
186
191
  let n, r = h === "vibe" ? g : e.vibeId;
@@ -210,6 +215,7 @@ function h({ context: h, vibeId: g, agentVibes: _ = [] }) {
210
215
  title: e.title || "",
211
216
  content: e.content || "",
212
217
  vibeId: r,
218
+ sessionId: h === "session" ? _ : void 0,
213
219
  visibility: e.visibility ? e.visibility : o.Workspace
214
220
  } } });
215
221
  } catch (e) {
@@ -221,42 +227,42 @@ function h({ context: h, vibeId: g, agentVibes: _ = [] }) {
221
227
  }
222
228
  n = i.data?.createNote?.id;
223
229
  }
224
- n && e.selectedTagIds && e.selectedTagIds.length > 0 ? await I({ variables: { input: {
230
+ n && e.selectedTagIds && e.selectedTagIds.length > 0 ? await L({ variables: { input: {
225
231
  noteId: n,
226
232
  tagIds: e.selectedTagIds
227
- } } }) : n && e.selectedTagIds?.length === 0 && e.id && await I({ variables: { input: {
233
+ } } }) : n && e.selectedTagIds?.length === 0 && e.id && await L({ variables: { input: {
228
234
  noteId: n,
229
235
  tagIds: []
230
- } } }), M(!1), F(H);
236
+ } } }), N(!1), I(U);
231
237
  } catch (e) {
232
238
  console.error("Failed to save note:", e);
233
239
  }
234
- }, tt = async (e) => {
240
+ }, nt = async (e) => {
235
241
  let t = e.visibility === "PRIVATE" ? o.Workspace : o.Private;
236
242
  try {
237
243
  await Ze({ variables: {
238
244
  id: e.id,
239
245
  visibility: t
240
- } }), F(H);
246
+ } }), I(U);
241
247
  } catch (e) {
242
248
  console.error("Failed to toggle note visibility:", e);
243
249
  }
244
- }, Z = Re ? (e) => C(e) : void 0, Q = {
245
- total: W.length,
246
- pinned: W.filter((e) => e.isPinned).length
247
- }, nt = u(() => h === "vibe" ? [] : _, [h, _]);
248
- if (!b && Pe && !x) return /* @__PURE__ */ p(Oe, {
250
+ }, Z = Re ? (e) => w(e) : void 0, Q = {
251
+ total: G.length,
252
+ pinned: G.filter((e) => e.isPinned).length
253
+ }, rt = u(() => h === "vibe" ? [] : v, [h, v]);
254
+ if (!x && Pe && !S) return /* @__PURE__ */ p(Oe, {
249
255
  title: "Access Denied",
250
256
  description: "You don't have permission to view notes.",
251
257
  details: "Required permission: note:list"
252
258
  });
253
- if (B && W.length === 0) return /* @__PURE__ */ p(se, { message: "Loading notes..." });
254
- if (V && W.length === 0) return /* @__PURE__ */ p(ce, {
259
+ if (V && G.length === 0) return /* @__PURE__ */ p(se, { message: "Loading notes..." });
260
+ if (H && G.length === 0) return /* @__PURE__ */ p(ce, {
255
261
  title: "Failed to load notes",
256
- message: V.message,
257
- onRetry: () => H()
262
+ message: H.message,
263
+ onRetry: () => U()
258
264
  });
259
- let $ = w || h === "agent" && T !== "all" || E !== "all" || k;
265
+ let $ = T || h === "agent" && E !== "all" || D !== "all" || A;
260
266
  return /* @__PURE__ */ m("div", {
261
267
  className: "space-y-4",
262
268
  children: [
@@ -279,16 +285,16 @@ function h({ context: h, vibeId: g, agentVibes: _ = [] }) {
279
285
  className: "flex items-center gap-2",
280
286
  children: [/* @__PURE__ */ p("button", {
281
287
  type: "button",
282
- onClick: () => H(),
283
- disabled: B,
288
+ onClick: () => U(),
289
+ disabled: V,
284
290
  className: "flex items-center gap-2 px-3 py-2 text-text-secondary hover:bg-bg-sunken rounded-md transition-colors disabled:opacity-50",
285
291
  title: "Refresh notes",
286
- children: /* @__PURE__ */ p(Se, { className: `size-4 ${B ? "animate-spin" : ""}` })
292
+ children: /* @__PURE__ */ p(Se, { className: `size-4 ${V ? "animate-spin" : ""}` })
287
293
  }), /* @__PURE__ */ p(ke, {
288
294
  permission: c.NOTE_CREATE,
289
295
  children: /* @__PURE__ */ m("button", {
290
296
  type: "button",
291
- onClick: J,
297
+ onClick: Y,
292
298
  className: "flex items-center gap-2 px-4 py-2 bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bg-hover transition-colors",
293
299
  children: [/* @__PURE__ */ p(f, { className: "size-4" }), "New Note"]
294
300
  })
@@ -300,7 +306,7 @@ function h({ context: h, vibeId: g, agentVibes: _ = [] }) {
300
306
  children: [/* @__PURE__ */ m("div", {
301
307
  className: "flex items-center gap-2",
302
308
  children: [/* @__PURE__ */ p(ue, {
303
- value: w,
309
+ value: T,
304
310
  onChange: ze,
305
311
  placeholder: "Search notes...",
306
312
  className: "flex-1 sm:w-64 sm:flex-none"
@@ -308,14 +314,14 @@ function h({ context: h, vibeId: g, agentVibes: _ = [] }) {
308
314
  className: "flex items-center gap-1 bg-bg-sunken rounded-md p-1 flex-shrink-0",
309
315
  children: [/* @__PURE__ */ p("button", {
310
316
  type: "button",
311
- onClick: () => j("grid"),
312
- className: `p-1.5 sm:p-2 rounded ${A === "grid" ? "bg-bg-surface shadow-sm" : "hover:bg-bg-surface/50"}`,
317
+ onClick: () => M("grid"),
318
+ className: `p-1.5 sm:p-2 rounded ${j === "grid" ? "bg-bg-surface shadow-sm" : "hover:bg-bg-surface/50"}`,
313
319
  title: "Grid view",
314
320
  children: /* @__PURE__ */ p(ve, { className: "size-4 text-text-secondary" })
315
321
  }), /* @__PURE__ */ p("button", {
316
322
  type: "button",
317
- onClick: () => j("list"),
318
- className: `p-1.5 sm:p-2 rounded ${A === "list" ? "bg-bg-surface shadow-sm" : "hover:bg-bg-surface/50"}`,
323
+ onClick: () => M("list"),
324
+ className: `p-1.5 sm:p-2 rounded ${j === "list" ? "bg-bg-surface shadow-sm" : "hover:bg-bg-surface/50"}`,
319
325
  title: "List view",
320
326
  children: /* @__PURE__ */ p(ye, { className: "size-4 text-text-secondary" })
321
327
  })]
@@ -325,13 +331,13 @@ function h({ context: h, vibeId: g, agentVibes: _ = [] }) {
325
331
  children: [
326
332
  h === "agent" && /* @__PURE__ */ p(s, {
327
333
  label: "Vibe",
328
- value: T,
334
+ value: E,
329
335
  options: Qe,
330
336
  onChange: Be
331
337
  }),
332
338
  /* @__PURE__ */ p(s, {
333
339
  label: "Tag",
334
- value: E,
340
+ value: D,
335
341
  options: $e,
336
342
  onChange: Ve
337
343
  }),
@@ -340,20 +346,20 @@ function h({ context: h, vibeId: g, agentVibes: _ = [] }) {
340
346
  children: [
341
347
  /* @__PURE__ */ p("button", {
342
348
  type: "button",
343
- onClick: () => O("all"),
344
- className: `px-2.5 py-1 text-xs rounded transition-colors ${D === "all" ? "bg-bg-surface text-text-primary shadow-sm" : "text-text-muted hover:text-text-secondary"}`,
349
+ onClick: () => k("all"),
350
+ className: `px-2.5 py-1 text-xs rounded transition-colors ${O === "all" ? "bg-bg-surface text-text-primary shadow-sm" : "text-text-muted hover:text-text-secondary"}`,
345
351
  children: "All"
346
352
  }),
347
353
  /* @__PURE__ */ m("button", {
348
354
  type: "button",
349
- onClick: () => O("WORKSPACE"),
350
- className: `flex items-center gap-1 px-2.5 py-1 text-xs rounded transition-colors ${D === "WORKSPACE" ? "bg-bg-surface text-text-primary shadow-sm" : "text-text-muted hover:text-text-secondary"}`,
355
+ onClick: () => k("WORKSPACE"),
356
+ className: `flex items-center gap-1 px-2.5 py-1 text-xs rounded transition-colors ${O === "WORKSPACE" ? "bg-bg-surface text-text-primary shadow-sm" : "text-text-muted hover:text-text-secondary"}`,
351
357
  children: [/* @__PURE__ */ p(_e, { className: "size-3" }), "Shared"]
352
358
  }),
353
359
  /* @__PURE__ */ m("button", {
354
360
  type: "button",
355
- onClick: () => O("PRIVATE"),
356
- className: `flex items-center gap-1 px-2.5 py-1 text-xs rounded transition-colors ${D === "PRIVATE" ? "bg-bg-surface text-text-primary shadow-sm" : "text-text-muted hover:text-text-secondary"}`,
361
+ onClick: () => k("PRIVATE"),
362
+ className: `flex items-center gap-1 px-2.5 py-1 text-xs rounded transition-colors ${O === "PRIVATE" ? "bg-bg-surface text-text-primary shadow-sm" : "text-text-muted hover:text-text-secondary"}`,
357
363
  children: [/* @__PURE__ */ p(be, { className: "size-3" }), "Private"]
358
364
  })
359
365
  ]
@@ -365,8 +371,8 @@ function h({ context: h, vibeId: g, agentVibes: _ = [] }) {
365
371
  className: "flex items-center gap-2",
366
372
  children: /* @__PURE__ */ m("button", {
367
373
  type: "button",
368
- onClick: () => He(!k),
369
- className: `flex items-center gap-2 px-3 py-1.5 text-sm rounded-full transition-colors ${k ? "bg-status-warning-bg text-status-warning-text" : "bg-bg-sunken text-text-secondary hover:bg-bg-sunken/80"}`,
374
+ onClick: () => He(!A),
375
+ className: `flex items-center gap-2 px-3 py-1.5 text-sm rounded-full transition-colors ${A ? "bg-status-warning-bg text-status-warning-text" : "bg-bg-sunken text-text-secondary hover:bg-bg-sunken/80"}`,
370
376
  children: [
371
377
  /* @__PURE__ */ p(xe, { className: "size-3" }),
372
378
  "Pinned (",
@@ -379,11 +385,11 @@ function h({ context: h, vibeId: g, agentVibes: _ = [] }) {
379
385
  className: "text-sm text-text-secondary",
380
386
  children: [
381
387
  "Showing ",
382
- K.length,
388
+ q.length,
383
389
  " of ",
384
- W.length,
390
+ G.length,
385
391
  " notes",
386
- B && /* @__PURE__ */ p("span", {
392
+ V && /* @__PURE__ */ p("span", {
387
393
  className: "ml-2 text-text-muted",
388
394
  children: "(refreshing…)"
389
395
  })
@@ -391,27 +397,27 @@ function h({ context: h, vibeId: g, agentVibes: _ = [] }) {
391
397
  }) : null,
392
398
  /* @__PURE__ */ p(Ee, {
393
399
  mode: "wait",
394
- children: K.length > 0 ? A === "grid" ? /* @__PURE__ */ p(je, {
400
+ children: q.length > 0 ? j === "grid" ? /* @__PURE__ */ p(je, {
395
401
  stagger: .04,
396
402
  className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",
397
- children: K.map((e) => /* @__PURE__ */ p(Ae, { children: /* @__PURE__ */ p(fe, {
403
+ children: q.map((e) => /* @__PURE__ */ p(Ae, { children: /* @__PURE__ */ p(fe, {
398
404
  note: e,
399
- onOpen: q,
400
- onEdit: q,
401
- onPin: Y,
402
- onUnpin: Y,
403
- onDelete: X,
404
- onShare: tt,
405
+ onOpen: J,
406
+ onEdit: J,
407
+ onPin: X,
408
+ onUnpin: X,
409
+ onDelete: et,
410
+ onShare: nt,
405
411
  onShareAccess: Z
406
412
  }) }, e.id))
407
413
  }, "grid") : /* @__PURE__ */ p(pe, {
408
- notes: K,
409
- onOpen: q,
410
- onEdit: q,
411
- onPin: Y,
412
- onUnpin: Y,
413
- onDelete: X,
414
- onShare: tt,
414
+ notes: q,
415
+ onOpen: J,
416
+ onEdit: J,
417
+ onPin: X,
418
+ onUnpin: X,
419
+ onDelete: et,
420
+ onShare: nt,
415
421
  onShareAccess: Z
416
422
  }, "list") : /* @__PURE__ */ p(le, {
417
423
  icon: /* @__PURE__ */ p(ge, { className: "size-8 text-text-secondary" }),
@@ -419,7 +425,7 @@ function h({ context: h, vibeId: g, agentVibes: _ = [] }) {
419
425
  description: $ ? "Try adjusting your search or filters" : "Create your first note to start documenting your work",
420
426
  action: !$ && Fe ? /* @__PURE__ */ m("button", {
421
427
  type: "button",
422
- onClick: J,
428
+ onClick: Y,
423
429
  className: "flex items-center gap-2 px-4 py-2 bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bg-hover transition-colors",
424
430
  children: [/* @__PURE__ */ p(f, { className: "size-4" }), "New Note"]
425
431
  }) : void 0
@@ -427,30 +433,30 @@ function h({ context: h, vibeId: g, agentVibes: _ = [] }) {
427
433
  }),
428
434
  Ue && /* @__PURE__ */ p(me, {
429
435
  note: We || void 0,
430
- vibeOptions: nt,
436
+ vibeOptions: rt,
431
437
  defaultVibeId: h === "vibe" ? g : void 0,
432
438
  hideVibeSelect: h === "vibe",
433
- onSubmit: et,
434
- onCancel: () => M(!1)
439
+ onSubmit: tt,
440
+ onCancel: () => N(!1)
435
441
  }),
436
442
  /* @__PURE__ */ p(ae, {
437
443
  isOpen: Ge,
438
- onClose: () => P(!1),
444
+ onClose: () => F(!1),
439
445
  onConfirm: () => {
440
- P(!1), Ne("/billing/plans");
446
+ F(!1), Ne("/billing/plans");
441
447
  },
442
448
  title: "Note Quota Reached",
443
449
  message: "You've used all available note quota on your current plan. Upgrade your plan to create or update more notes."
444
450
  }),
445
- S && /* @__PURE__ */ p(de, {
451
+ C && /* @__PURE__ */ p(de, {
446
452
  note: {
447
- id: S.id,
448
- title: S.title,
449
- vibeId: S.vibeId
453
+ id: C.id,
454
+ title: C.title,
455
+ vibeId: C.vibeId
450
456
  },
451
- open: !!S,
457
+ open: !!C,
452
458
  onOpenChange: (e) => {
453
- e || C(null);
459
+ e || w(null);
454
460
  }
455
461
  })
456
462
  ]