@ai-matrx/associations 0.14.84 → 0.14.86

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.
@@ -243,6 +243,7 @@ var ENTITY_TYPE_TOKENS = [
243
243
  "ai_usage_hourly_watermark",
244
244
  "analysis_result",
245
245
  "anon_form",
246
+ "anon_form_password",
246
247
  "anon_form_visit",
247
248
  "anon_function_birth_grandfather",
248
249
  "anon_hit",
@@ -310,6 +311,7 @@ var ENTITY_TYPE_TOKENS = [
310
311
  "billing_customer",
311
312
  "billing_external_call_vendor",
312
313
  "billing_free_period_grant",
314
+ "billing_free_use_counter",
313
315
  "billing_hard_cost_reconciliation",
314
316
  "billing_held_run",
315
317
  "billing_org_payment_account",
@@ -460,6 +462,7 @@ var ENTITY_TYPE_TOKENS = [
460
462
  "content_ir_kind_example",
461
463
  "content_ir_kind_instance",
462
464
  "content_ir_kind_surface",
465
+ "content_ir_render_inspection",
463
466
  "content_lane",
464
467
  "context_access_log",
465
468
  "context_item",
@@ -529,6 +532,8 @@ var ENTITY_TYPE_TOKENS = [
529
532
  "definer_grant_baseline",
530
533
  "deprecated_relation",
531
534
  "derive_run",
535
+ "desktop_app_account",
536
+ "desktop_app_instance",
532
537
  "desktop_app_profile",
533
538
  "dev_login_audit",
534
539
  "device_handoff",
@@ -783,6 +788,7 @@ var ENTITY_TYPE_TOKENS = [
783
788
  "iam_org_domain_route",
784
789
  "iam_read_lane_v2_rollout",
785
790
  "iam_record_seat_change",
791
+ "iam_sign_in_event",
786
792
  "idempotency",
787
793
  "industry",
788
794
  "industry_curator",
@@ -921,12 +927,14 @@ var ENTITY_TYPE_TOKENS = [
921
927
  "ops_test_replay_cache",
922
928
  "org_admin_audit",
923
929
  "org_change_policy",
930
+ "org_chart_publication",
924
931
  "org_context_ledger",
925
932
  "org_industries",
926
933
  "org_member_control",
927
934
  "org_module_config",
928
935
  "org_move_txn",
929
936
  "org_plan",
937
+ "org_sweep_list",
930
938
  "organization",
931
939
  "organization_preferences",
932
940
  "organization_visibility_version",
@@ -1295,6 +1303,8 @@ var ENTITY_TYPE_TOKENS = [
1295
1303
  "user",
1296
1304
  "user_achievement",
1297
1305
  "user_acquisition_facts",
1306
+ "user_acquisition_facts_stored",
1307
+ "user_acquisition_facts_stored_watermark",
1298
1308
  "user_active_context",
1299
1309
  "user_analysis_preference",
1300
1310
  "user_email_preference",
@@ -1469,6 +1479,7 @@ var ASSOCIATION_PAIRS = /* @__PURE__ */ new Set([
1469
1479
  "assessment>tag",
1470
1480
  "board>category",
1471
1481
  "board>tag",
1482
+ "board>web_brand",
1472
1483
  "calendar_event>conversation",
1473
1484
  "calendar_event>party",
1474
1485
  "canvas_item>tag",
@@ -1981,6 +1992,7 @@ var ASSOCIATION_PAIRS = /* @__PURE__ */ new Set([
1981
1992
  "record>content_ir_kind_example",
1982
1993
  "record>content_ir_kind_instance",
1983
1994
  "record>content_ir_kind_surface",
1995
+ "record>content_ir_render_inspection",
1984
1996
  "record>context_access_log",
1985
1997
  "record>context_item",
1986
1998
  "record>context_item_suggestion",
@@ -2040,6 +2052,8 @@ var ASSOCIATION_PAIRS = /* @__PURE__ */ new Set([
2040
2052
  "record>definer_class_exemption",
2041
2053
  "record>definer_grant_baseline",
2042
2054
  "record>derive_run",
2055
+ "record>desktop_app_account",
2056
+ "record>desktop_app_instance",
2043
2057
  "record>desktop_app_profile",
2044
2058
  "record>dev_login_audit",
2045
2059
  "record>device_handoff",
@@ -2277,6 +2291,7 @@ var ASSOCIATION_PAIRS = /* @__PURE__ */ new Set([
2277
2291
  "record>iam_org_domain",
2278
2292
  "record>iam_org_domain_route",
2279
2293
  "record>iam_record_seat_change",
2294
+ "record>iam_sign_in_event",
2280
2295
  "record>industry",
2281
2296
  "record>ingest_runs",
2282
2297
  "record>integration_connection",
@@ -2404,6 +2419,7 @@ var ASSOCIATION_PAIRS = /* @__PURE__ */ new Set([
2404
2419
  "record>ops_test_replay_cache",
2405
2420
  "record>org_admin_audit",
2406
2421
  "record>org_change_policy",
2422
+ "record>org_chart_publication",
2407
2423
  "record>org_context_ledger",
2408
2424
  "record>org_industries",
2409
2425
  "record>org_member_control",
@@ -2929,6 +2945,7 @@ var ASSOCIATION_PAIRS = /* @__PURE__ */ new Set([
2929
2945
  "war_room>scope",
2930
2946
  "war_room>scope_type",
2931
2947
  "war_room>tag",
2948
+ "web_brand_choice>category",
2932
2949
  "web_brand_choice>web_brand_choice",
2933
2950
  "web_brand_choice>web_brand_offering",
2934
2951
  "web_brand_choice>web_brand_testimony",
@@ -3935,96 +3952,23 @@ var import_react_dom = require("react-dom");
3935
3952
  var import_design_system2 = require("@ai-matrx/design-system");
3936
3953
 
3937
3954
  // src/react/icons.tsx
3938
- var import_jsx_runtime4 = require("react/jsx-runtime");
3939
- function base(props) {
3940
- return {
3941
- xmlns: "http://www.w3.org/2000/svg",
3942
- width: 24,
3943
- height: 24,
3944
- viewBox: "0 0 24 24",
3945
- fill: "none",
3946
- stroke: "currentColor",
3947
- strokeWidth: 2,
3948
- strokeLinecap: "round",
3949
- strokeLinejoin: "round",
3950
- "aria-hidden": true,
3951
- ...props
3952
- };
3953
- }
3954
- function SpinnerIcon(props) {
3955
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("svg", { ...base(props), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) });
3956
- }
3957
- function Link2Icon(props) {
3958
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { ...base(props), children: [
3959
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M9 17H7A5 5 0 0 1 7 7h2" }),
3960
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M15 7h2a5 5 0 1 1 0 10h-2" }),
3961
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("line", { x1: "8", x2: "16", y1: "12", y2: "12" })
3962
- ] });
3963
- }
3964
- function RefreshIcon(props) {
3965
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { ...base(props), children: [
3966
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" }),
3967
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M21 3v5h-5" }),
3968
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" }),
3969
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M8 16H3v5" })
3970
- ] });
3971
- }
3972
- function UploadIcon(props) {
3973
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { ...base(props), children: [
3974
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
3975
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("polyline", { points: "17 8 12 3 7 8" }),
3976
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("line", { x1: "12", x2: "12", y1: "3", y2: "15" })
3977
- ] });
3978
- }
3979
- function FolderOpenIcon(props) {
3980
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("svg", { ...base(props), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2" }) });
3981
- }
3982
- function CornerDownRightIcon(props) {
3983
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { ...base(props), children: [
3984
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("polyline", { points: "15 10 20 15 15 20" }),
3985
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M4 4v7a4 4 0 0 0 4 4h12" })
3986
- ] });
3987
- }
3988
- function TagIcon(props) {
3989
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { ...base(props), children: [
3990
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z" }),
3991
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("circle", { cx: "7.5", cy: "7.5", r: ".5", fill: "currentColor" })
3992
- ] });
3993
- }
3994
- function DefaultEntityIcon(props) {
3995
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { ...base(props), children: [
3996
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z" }),
3997
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "m7 16.5-4.74-2.85" }),
3998
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "m7 16.5 5-3" }),
3999
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M7 16.5v5.17" }),
4000
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z" }),
4001
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "m17 16.5-5-3" }),
4002
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "m17 16.5 4.74-2.85" }),
4003
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M17 16.5v5.17" }),
4004
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z" }),
4005
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M12 8 7.26 5.15" }),
4006
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "m12 8 4.74-2.85" }),
4007
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M12 13.5V8" })
4008
- ] });
4009
- }
4010
- function RestoreIcon(props) {
4011
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { ...base(props), children: [
4012
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M4 14h6v6" }),
4013
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M20 10h-6V4" }),
4014
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M14 10l7-7" }),
4015
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M3 21l7-7" })
4016
- ] });
4017
- }
4018
- function GripResizeIcon(props) {
4019
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { ...base(props), children: [
4020
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M21 15 15 21" }),
4021
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M21 20 20 21" })
4022
- ] });
4023
- }
3955
+ var import_icons = require("@ai-matrx/design-system/icons");
3956
+ var sized = (Glyph) => (0, import_icons.withGlyphDefaults)(Glyph, { width: 24, height: 24 });
3957
+ var SpinnerIcon = sized(import_icons.Loader2Icon);
3958
+ var Link2Icon = sized(import_icons.Link2Icon);
3959
+ var RefreshIcon = sized(import_icons.RefreshCwIcon);
3960
+ var UploadIcon = sized(import_icons.UploadIcon);
3961
+ var FolderOpenIcon = sized(import_icons.FolderOpenIcon);
3962
+ var FileTextIcon = sized(import_icons.FileTextIcon);
3963
+ var CornerDownRightIcon = sized(import_icons.CornerDownRightIcon);
3964
+ var TagIcon = sized(import_icons.TagIcon);
3965
+ var DefaultEntityIcon = sized(import_icons.BoxesIcon);
3966
+ var RestoreIcon = sized(import_icons.RestoreIcon);
3967
+ var GripResizeIcon = sized(import_icons.GripResizeIcon);
4024
3968
 
4025
3969
  // src/react/components/DefaultWindowShell.tsx
4026
- var import_icons2 = require("@ai-matrx/design-system/icons");
4027
- var import_jsx_runtime5 = require("react/jsx-runtime");
3970
+ var import_icons3 = require("@ai-matrx/design-system/icons");
3971
+ var import_jsx_runtime4 = require("react/jsx-runtime");
4028
3972
  var DEFAULT_WIDTH = 440;
4029
3973
  var DEFAULT_HEIGHT = 580;
4030
3974
  var MIN_WIDTH = 330;
@@ -4108,7 +4052,7 @@ function DefaultWindowShell({
4108
4052
  height: rect.height
4109
4053
  };
4110
4054
  return (0, import_react_dom.createPortal)(
4111
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_design_system2.FloatingLayer, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
4055
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_design_system2.FloatingLayer, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
4112
4056
  "div",
4113
4057
  {
4114
4058
  ref: setPanelRef,
@@ -4125,7 +4069,7 @@ function DefaultWindowShell({
4125
4069
  className
4126
4070
  ),
4127
4071
  children: [
4128
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
4072
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
4129
4073
  "header",
4130
4074
  {
4131
4075
  onPointerDown: drag.onPointerDown,
@@ -4137,51 +4081,51 @@ function DefaultWindowShell({
4137
4081
  isMobile ? "" : "cursor-move touch-none"
4138
4082
  ),
4139
4083
  children: [
4140
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
4084
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
4141
4085
  "span",
4142
4086
  {
4143
4087
  id: labelId,
4144
4088
  className: "flex min-w-0 items-center gap-1.5 text-sm font-medium text-foreground",
4145
4089
  children: [
4146
4090
  icon,
4147
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "truncate", children: title })
4091
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "truncate", children: title })
4148
4092
  ]
4149
4093
  }
4150
4094
  ),
4151
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "flex shrink-0 items-center gap-0.5", children: [
4152
- isMobile ? null : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
4095
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "flex shrink-0 items-center gap-0.5", children: [
4096
+ isMobile ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4153
4097
  "button",
4154
4098
  {
4155
4099
  type: "button",
4156
4100
  onClick: () => setMaximized((v) => !v),
4157
4101
  "aria-label": maximized ? "Restore window" : "Maximize window",
4158
4102
  className: "flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
4159
- children: maximized ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(RestoreIcon, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_icons2.Maximize2Icon, { className: "h-3.5 w-3.5" })
4103
+ children: maximized ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RestoreIcon, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_icons3.Maximize2Icon, { className: "h-3.5 w-3.5" })
4160
4104
  }
4161
4105
  ),
4162
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
4106
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4163
4107
  "button",
4164
4108
  {
4165
4109
  type: "button",
4166
4110
  onClick: onClose,
4167
4111
  "aria-label": "Close",
4168
4112
  className: "flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
4169
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_icons2.XIcon, { className: "h-3.5 w-3.5" })
4113
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_icons3.XIcon, { className: "h-3.5 w-3.5" })
4170
4114
  }
4171
4115
  )
4172
4116
  ] })
4173
4117
  ]
4174
4118
  }
4175
4119
  ),
4176
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "min-h-0 flex-1 overflow-hidden", children }),
4177
- isMobile || maximized ? null : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
4120
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "min-h-0 flex-1 overflow-hidden", children }),
4121
+ isMobile || maximized ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4178
4122
  "button",
4179
4123
  {
4180
4124
  type: "button",
4181
4125
  "aria-label": "Resize window",
4182
4126
  onPointerDown: drag.resizeHandle("se"),
4183
4127
  className: "absolute bottom-0 right-0 flex h-4 w-4 cursor-nwse-resize touch-none items-center justify-center text-muted-foreground/60 hover:text-foreground",
4184
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(GripResizeIcon, { className: "h-3 w-3" })
4128
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(GripResizeIcon, { className: "h-3 w-3" })
4185
4129
  }
4186
4130
  )
4187
4131
  ]
@@ -4192,7 +4136,7 @@ function DefaultWindowShell({
4192
4136
  }
4193
4137
 
4194
4138
  // src/react/components/AssociationWindow.tsx
4195
- var import_jsx_runtime6 = require("react/jsx-runtime");
4139
+ var import_jsx_runtime5 = require("react/jsx-runtime");
4196
4140
  function AssociationWindow({
4197
4141
  open,
4198
4142
  onClose,
@@ -4205,16 +4149,16 @@ function AssociationWindow({
4205
4149
  const instanceId = (0, import_react13.useId)();
4206
4150
  const { windowShell } = useAssociationsUiPorts();
4207
4151
  if (!open) return null;
4208
- const body = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex h-full min-h-0 flex-col gap-2 p-3", children: [
4209
- subtitle ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "shrink-0 text-xs text-muted-foreground", children: subtitle }) : null,
4152
+ const body = /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex h-full min-h-0 flex-col gap-2 p-3", children: [
4153
+ subtitle ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "shrink-0 text-xs text-muted-foreground", children: subtitle }) : null,
4210
4154
  children
4211
4155
  ] });
4212
4156
  const windowId = `association:${scopeId}:${instanceId}`;
4213
4157
  if (windowShell) {
4214
4158
  const HostWindow = windowShell.Window;
4215
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(HostWindow, { id: windowId, title, onClose, children: body });
4159
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(HostWindow, { id: windowId, title, onClose, children: body });
4216
4160
  }
4217
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4161
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
4218
4162
  DefaultWindowShell,
4219
4163
  {
4220
4164
  id: windowId,
@@ -4229,28 +4173,28 @@ function AssociationWindow({
4229
4173
  // src/react/components/AssociationPicker.tsx
4230
4174
  var import_react14 = require("react");
4231
4175
  var import_design_system3 = require("@ai-matrx/design-system");
4232
- var import_icons4 = require("@ai-matrx/design-system/icons");
4233
- var import_jsx_runtime7 = require("react/jsx-runtime");
4176
+ var import_icons5 = require("@ai-matrx/design-system/icons");
4177
+ var import_jsx_runtime6 = require("react/jsx-runtime");
4234
4178
  function AssociationPicker(props) {
4235
4179
  const store = useAssociationsStore();
4236
4180
  const { pickerOverrides } = useAssociationsUiPorts();
4237
4181
  const info = store.registry.getEntityInfo(props.token);
4238
4182
  const Icon = info.Icon ?? DefaultEntityIcon;
4239
4183
  const Override = pickerOverrides?.[props.token];
4240
- if (Override) return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Override, { ...props });
4184
+ if (Override) return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Override, { ...props });
4241
4185
  const title = `Add ${info.labelPlural}`;
4242
4186
  const subtitle = props.filing ? `File ${props.containerLabel ?? "this"} under a ${info.label.toLowerCase()}` : props.containerLabel ? `Attach to ${props.containerLabel}` : "Click an item to attach or detach it";
4243
4187
  if (!props.open) return null;
4244
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
4188
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4245
4189
  AssociationWindow,
4246
4190
  {
4247
4191
  open: props.open,
4248
4192
  onClose: () => props.onOpenChange(false),
4249
4193
  scopeId: `picker:${props.token}`,
4250
4194
  title,
4251
- icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { className: "size-3.5 text-primary" }),
4195
+ icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { className: "size-3.5 text-primary" }),
4252
4196
  subtitle,
4253
- children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
4197
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4254
4198
  AssociationCandidateBody,
4255
4199
  {
4256
4200
  token: props.token,
@@ -4275,7 +4219,7 @@ function AssociationCandidateBody({
4275
4219
  onClose
4276
4220
  }) {
4277
4221
  void onClose;
4278
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
4222
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4279
4223
  EntityCandidateList,
4280
4224
  {
4281
4225
  token,
@@ -4335,10 +4279,10 @@ function EntityCandidateList({
4335
4279
  setBusyId(null);
4336
4280
  }
4337
4281
  };
4338
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
4339
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "relative mb-2", children: [
4340
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_icons4.SearchIcon, { className: "absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" }),
4341
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
4282
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
4283
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "relative mb-2", children: [
4284
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_icons5.SearchIcon, { className: "absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" }),
4285
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4342
4286
  import_design_system3.Input,
4343
4287
  {
4344
4288
  autoFocus: true,
@@ -4350,8 +4294,8 @@ function EntityCandidateList({
4350
4294
  }
4351
4295
  )
4352
4296
  ] }),
4353
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex-1 min-h-0 overflow-y-auto -mx-1 px-1", children: [
4354
- !search.trim() && !error && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
4297
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex-1 min-h-0 overflow-y-auto -mx-1 px-1", children: [
4298
+ !search.trim() && !error && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4355
4299
  SearchFailureNotice,
4356
4300
  {
4357
4301
  error: null,
@@ -4361,13 +4305,13 @@ function EntityCandidateList({
4361
4305
  className: "mb-1"
4362
4306
  }
4363
4307
  ),
4364
- (loading || recentsLoading) && visibleCount === 0 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(ListMessage, { children: [
4365
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SpinnerIcon, { className: "h-4 w-4 animate-spin" }),
4308
+ (loading || recentsLoading) && visibleCount === 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(ListMessage, { children: [
4309
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SpinnerIcon, { className: "h-4 w-4 animate-spin" }),
4366
4310
  "Loading\u2026"
4367
- ] }) : error ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-[12px] text-destructive", children: [
4368
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "font-medium", children: "Couldn\u2019t load items" }),
4369
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "opacity-80", children: error }),
4370
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
4311
+ ] }) : error ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-[12px] text-destructive", children: [
4312
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "font-medium", children: "Couldn\u2019t load items" }),
4313
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "opacity-80", children: error }),
4314
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4371
4315
  "button",
4372
4316
  {
4373
4317
  type: "button",
@@ -4376,32 +4320,32 @@ function EntityCandidateList({
4376
4320
  children: "Retry"
4377
4321
  }
4378
4322
  )
4379
- ] }) : visibleCount === 0 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ListMessage, { children: canCreate ? `Nothing to attach yet \u2014 create a new ${info.label.toLowerCase()} below.` : "Nothing to attach." }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "space-y-2", children: [
4380
- visibleRecents.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
4323
+ ] }) : visibleCount === 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ListMessage, { children: canCreate ? `Nothing to attach yet \u2014 create a new ${info.label.toLowerCase()} below.` : "Nothing to attach." }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "space-y-2", children: [
4324
+ visibleRecents.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4381
4325
  CandidateSection,
4382
4326
  {
4383
4327
  label: "Recent",
4384
4328
  candidates: visibleRecents,
4385
4329
  attachedIds,
4386
4330
  busyId,
4387
- icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
4331
+ icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
4388
4332
  onToggle: toggle
4389
4333
  }
4390
4334
  ),
4391
- ordinaryCandidates.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
4335
+ ordinaryCandidates.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4392
4336
  CandidateSection,
4393
4337
  {
4394
4338
  label: visibleRecents.length > 0 ? `All ${info.labelPlural}` : null,
4395
4339
  candidates: ordinaryCandidates,
4396
4340
  attachedIds,
4397
4341
  busyId,
4398
- icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
4342
+ icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
4399
4343
  onToggle: toggle
4400
4344
  }
4401
4345
  )
4402
4346
  ] })
4403
4347
  ] }),
4404
- canCreate && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
4348
+ canCreate && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4405
4349
  CreateAndAttachFooter,
4406
4350
  {
4407
4351
  token,
@@ -4421,12 +4365,12 @@ function CandidateSection({
4421
4365
  icon,
4422
4366
  onToggle
4423
4367
  }) {
4424
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("section", { className: "space-y-0.5", children: [
4425
- label && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "px-1 text-[10px] font-medium uppercase tracking-wider text-muted-foreground/60", children: label }),
4426
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("ul", { className: "space-y-0.5", children: candidates.map((candidate) => {
4368
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("section", { className: "space-y-0.5", children: [
4369
+ label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "px-1 text-[10px] font-medium uppercase tracking-wider text-muted-foreground/60", children: label }),
4370
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("ul", { className: "space-y-0.5", children: candidates.map((candidate) => {
4427
4371
  const attached = attachedIds.has(candidate.id);
4428
4372
  const busy = busyId === candidate.id;
4429
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
4373
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
4430
4374
  "button",
4431
4375
  {
4432
4376
  type: "button",
@@ -4439,15 +4383,15 @@ function CandidateSection({
4439
4383
  ),
4440
4384
  children: [
4441
4385
  icon,
4442
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "flex-1 min-w-0 truncate text-foreground", children: candidate.title }),
4443
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
4386
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "flex-1 min-w-0 truncate text-foreground", children: candidate.title }),
4387
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4444
4388
  "span",
4445
4389
  {
4446
4390
  className: (0, import_design_system3.cn)(
4447
4391
  "flex h-5 w-5 items-center justify-center rounded-full shrink-0",
4448
4392
  attached ? "bg-primary text-primary-foreground" : "border border-border text-muted-foreground group-hover:border-primary/60"
4449
4393
  ),
4450
- children: busy ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SpinnerIcon, { className: "h-3 w-3 animate-spin" }) : attached ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_icons4.CheckIcon, { className: "h-3 w-3" }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_icons4.PlusIcon, { className: "h-3 w-3" })
4394
+ children: busy ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SpinnerIcon, { className: "h-3 w-3 animate-spin" }) : attached ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_icons5.CheckIcon, { className: "h-3 w-3" }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_icons5.PlusIcon, { className: "h-3 w-3" })
4451
4395
  }
4452
4396
  )
4453
4397
  ]
@@ -4503,7 +4447,7 @@ function CreateAndAttachFooter({
4503
4447
  }
4504
4448
  };
4505
4449
  if (!editing) {
4506
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
4450
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
4507
4451
  "button",
4508
4452
  {
4509
4453
  type: "button",
@@ -4513,10 +4457,10 @@ function CreateAndAttachFooter({
4513
4457
  },
4514
4458
  className: "mt-2 flex min-h-11 w-full shrink-0 items-center justify-center gap-1.5 rounded-md border border-dashed border-border px-3 py-2 text-sm text-muted-foreground transition-colors hover:border-primary/60 hover:text-foreground md:min-h-0",
4515
4459
  children: [
4516
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_icons4.PlusIcon, { className: "h-4 w-4" }),
4460
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_icons5.PlusIcon, { className: "h-4 w-4" }),
4517
4461
  "New ",
4518
4462
  info.label,
4519
- seed ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "max-w-40 truncate text-muted-foreground/70", children: [
4463
+ seed ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "max-w-40 truncate text-muted-foreground/70", children: [
4520
4464
  "\u201C",
4521
4465
  seed,
4522
4466
  "\u201D"
@@ -4525,8 +4469,8 @@ function CreateAndAttachFooter({
4525
4469
  }
4526
4470
  );
4527
4471
  }
4528
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "mt-2 flex shrink-0 items-center gap-1.5", children: [
4529
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
4472
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "mt-2 flex shrink-0 items-center gap-1.5", children: [
4473
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4530
4474
  import_design_system3.Input,
4531
4475
  {
4532
4476
  autoFocus: true,
@@ -4545,17 +4489,17 @@ function CreateAndAttachFooter({
4545
4489
  style: { fontSize: 16 }
4546
4490
  }
4547
4491
  ),
4548
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
4492
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4549
4493
  "button",
4550
4494
  {
4551
4495
  type: "button",
4552
4496
  disabled: busy || !name.trim(),
4553
4497
  onClick: () => void submit(),
4554
4498
  className: "flex h-11 items-center gap-1 rounded-md bg-primary px-2.5 text-sm font-medium text-primary-foreground transition-opacity disabled:opacity-50 md:h-8",
4555
- children: busy ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SpinnerIcon, { className: "h-3.5 w-3.5 animate-spin" }) : "Create"
4499
+ children: busy ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SpinnerIcon, { className: "h-3.5 w-3.5 animate-spin" }) : "Create"
4556
4500
  }
4557
4501
  ),
4558
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
4502
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4559
4503
  "button",
4560
4504
  {
4561
4505
  type: "button",
@@ -4566,35 +4510,35 @@ function CreateAndAttachFooter({
4566
4510
  },
4567
4511
  title: "Cancel",
4568
4512
  className: "flex h-11 w-11 items-center justify-center rounded-md border border-border text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50 md:h-8 md:w-8",
4569
- children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_icons4.XIcon, { className: "h-4 w-4" })
4513
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_icons5.XIcon, { className: "h-4 w-4" })
4570
4514
  }
4571
4515
  )
4572
4516
  ] });
4573
4517
  }
4574
4518
  function ListMessage({ children }) {
4575
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex items-center justify-center gap-2 py-8 text-[13px] text-muted-foreground", children });
4519
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "flex items-center justify-center gap-2 py-8 text-[13px] text-muted-foreground", children });
4576
4520
  }
4577
4521
 
4578
4522
  // src/react/components/UniversalAssociationPicker.tsx
4579
4523
  var import_react15 = require("react");
4580
4524
  var import_design_system5 = require("@ai-matrx/design-system");
4581
- var import_icons7 = require("@ai-matrx/design-system/icons");
4525
+ var import_icons8 = require("@ai-matrx/design-system/icons");
4582
4526
 
4583
4527
  // src/react/components/entityDoors.tsx
4584
4528
  var import_design_system4 = require("@ai-matrx/design-system");
4585
- var import_icons5 = require("@ai-matrx/design-system/icons");
4529
+ var import_icons6 = require("@ai-matrx/design-system/icons");
4586
4530
  var import_outbound_react = require("@ai-matrx/kit/outbound-react");
4587
- var import_jsx_runtime8 = require("react/jsx-runtime");
4531
+ var import_jsx_runtime7 = require("react/jsx-runtime");
4588
4532
  function DoorRef(props) {
4589
4533
  const { onOpen, ...refProps } = props;
4590
4534
  const { entityDoors } = useAssociationsUiPorts();
4591
4535
  const store = useAssociationsStore();
4592
4536
  const HostRef = entityDoors?.EntityRef;
4593
- if (HostRef) return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(HostRef, { ...refProps });
4537
+ if (HostRef) return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(HostRef, { ...refProps });
4594
4538
  const name = refProps.name ?? null;
4595
4539
  const href = store.registry.tryGetEntityInfo(refProps.token)?.hrefFor?.(refProps.id) ?? null;
4596
4540
  if (onOpen) {
4597
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
4541
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
4598
4542
  "button",
4599
4543
  {
4600
4544
  type: "button",
@@ -4608,7 +4552,7 @@ function DoorRef(props) {
4608
4552
  );
4609
4553
  }
4610
4554
  if (href) {
4611
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
4555
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
4612
4556
  "a",
4613
4557
  {
4614
4558
  href,
@@ -4619,19 +4563,19 @@ function DoorRef(props) {
4619
4563
  refProps.className
4620
4564
  ),
4621
4565
  children: [
4622
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "min-w-0 truncate", children: name }),
4623
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_icons5.ExternalLinkIcon, { className: "h-3 w-3 shrink-0 opacity-0 transition-opacity group-hover:opacity-60" })
4566
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "min-w-0 truncate", children: name }),
4567
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_icons6.ExternalLinkIcon, { className: "h-3 w-3 shrink-0 opacity-0 transition-opacity group-hover:opacity-60" })
4624
4568
  ]
4625
4569
  }
4626
4570
  );
4627
4571
  }
4628
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: (0, import_design_system4.cn)("min-w-0 truncate", refProps.className), children: name });
4572
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: (0, import_design_system4.cn)("min-w-0 truncate", refProps.className), children: name });
4629
4573
  }
4630
4574
  function UnresolvedRef({ token, id }) {
4631
4575
  const { entityDoors } = useAssociationsUiPorts();
4632
4576
  const HostUnresolved = entityDoors?.UnresolvedRef;
4633
- if (HostUnresolved) return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(HostUnresolved, { token, id });
4634
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
4577
+ if (HostUnresolved) return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(HostUnresolved, { token, id });
4578
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
4635
4579
  "span",
4636
4580
  {
4637
4581
  className: "inline-flex items-center rounded border border-border/60 bg-muted/40 px-1.5 py-0.5 text-[11px] text-muted-foreground",
@@ -4644,11 +4588,11 @@ function DoorControlsSlot(props) {
4644
4588
  const { entityDoors } = useAssociationsUiPorts();
4645
4589
  const store = useAssociationsStore();
4646
4590
  const HostControls = entityDoors?.DoorControls;
4647
- if (HostControls) return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(HostControls, { ...props });
4591
+ if (HostControls) return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(HostControls, { ...props });
4648
4592
  const href = store.registry.tryGetEntityInfo(props.token)?.hrefFor?.(props.id) ?? null;
4649
4593
  if (!href) return null;
4650
4594
  const label = props.name ? `Open ${props.name}` : `Open this ${props.token}`;
4651
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
4595
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
4652
4596
  import_outbound_react.OutboundLink,
4653
4597
  {
4654
4598
  href,
@@ -4658,13 +4602,13 @@ function DoorControlsSlot(props) {
4658
4602
  "inline-flex h-5 w-5 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
4659
4603
  props.className
4660
4604
  ),
4661
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_icons5.ExternalLinkIcon, { className: "h-3 w-3" })
4605
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_icons6.ExternalLinkIcon, { className: "h-3 w-3" })
4662
4606
  }
4663
4607
  );
4664
4608
  }
4665
4609
 
4666
4610
  // src/react/components/UniversalAssociationPicker.tsx
4667
- var import_jsx_runtime9 = require("react/jsx-runtime");
4611
+ var import_jsx_runtime8 = require("react/jsx-runtime");
4668
4612
  function attachedKey(token, id) {
4669
4613
  return `${token}:${id}`;
4670
4614
  }
@@ -4719,10 +4663,10 @@ function UniversalAssociationPicker(props) {
4719
4663
  groups.set(r.token, list);
4720
4664
  }
4721
4665
  const BrowseOverride = browseToken ? pickerOverrides?.[browseToken] : void 0;
4722
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: (0, import_design_system5.cn)("flex min-h-0 flex-1 flex-col gap-2", className), children: [
4723
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "relative", children: [
4724
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_icons7.SearchIcon, { className: "absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
4725
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4666
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: (0, import_design_system5.cn)("flex min-h-0 flex-1 flex-col gap-2", className), children: [
4667
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "relative", children: [
4668
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_icons8.SearchIcon, { className: "absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
4669
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
4726
4670
  import_design_system5.Input,
4727
4671
  {
4728
4672
  autoFocus: true,
@@ -4736,9 +4680,9 @@ function UniversalAssociationPicker(props) {
4736
4680
  style: { fontSize: 16 }
4737
4681
  }
4738
4682
  ),
4739
- loading && browseToken === null && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SpinnerIcon, { className: "absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 animate-spin text-muted-foreground" })
4683
+ loading && browseToken === null && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SpinnerIcon, { className: "absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 animate-spin text-muted-foreground" })
4740
4684
  ] }),
4741
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4685
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
4742
4686
  "div",
4743
4687
  {
4744
4688
  role: "group",
@@ -4748,7 +4692,7 @@ function UniversalAssociationPicker(props) {
4748
4692
  const info = store.registry.getEntityInfo(t);
4749
4693
  const ChipIcon = info.Icon ?? DefaultEntityIcon;
4750
4694
  const active = browseToken === t;
4751
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
4695
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
4752
4696
  "button",
4753
4697
  {
4754
4698
  type: "button",
@@ -4759,7 +4703,7 @@ function UniversalAssociationPicker(props) {
4759
4703
  active ? "border-primary/50 bg-primary/10 text-foreground" : "border-border text-muted-foreground hover:text-foreground hover:bg-accent"
4760
4704
  ),
4761
4705
  children: [
4762
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ChipIcon, { className: "h-3 w-3" }),
4706
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ChipIcon, { className: "h-3 w-3" }),
4763
4707
  info.labelPlural
4764
4708
  ]
4765
4709
  },
@@ -4772,17 +4716,17 @@ function UniversalAssociationPicker(props) {
4772
4716
  // The token's canonical host picker (e.g. the stored-files browser)
4773
4717
  // owns per-token browsing when registered — never a plain list twin.
4774
4718
  // It opens in its own window; this body says where it went.
4775
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
4719
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
4776
4720
  "div",
4777
4721
  {
4778
4722
  role: "region",
4779
4723
  "aria-label": `${store.registry.getEntityInfo(browseToken).labelPlural} window`,
4780
4724
  className: "flex flex-1 flex-col items-center justify-center gap-3 px-4 py-8 text-center",
4781
4725
  children: [
4782
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-sm text-foreground", children: overrideOpen ? `The ${store.registry.getEntityInfo(browseToken).labelPlural.toLowerCase()} window is open.` : `The ${store.registry.getEntityInfo(browseToken).labelPlural.toLowerCase()} window is closed.` }),
4783
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "max-w-xs text-[12px] text-muted-foreground", children: overrideOpen ? "Check items there to attach them; uncheck to detach. Changes save as you go." : "Reopen it to pick more, or go back to search everything." }),
4784
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-wrap items-center justify-center gap-2", children: [
4785
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
4726
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-sm text-foreground", children: overrideOpen ? `The ${store.registry.getEntityInfo(browseToken).labelPlural.toLowerCase()} window is open.` : `The ${store.registry.getEntityInfo(browseToken).labelPlural.toLowerCase()} window is closed.` }),
4727
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "max-w-xs text-[12px] text-muted-foreground", children: overrideOpen ? "Check items there to attach them; uncheck to detach. Changes save as you go." : "Reopen it to pick more, or go back to search everything." }),
4728
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-wrap items-center justify-center gap-2", children: [
4729
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
4786
4730
  import_design_system5.Button,
4787
4731
  {
4788
4732
  type: "button",
@@ -4793,12 +4737,12 @@ function UniversalAssociationPicker(props) {
4793
4737
  setOverrideMount((n) => n + 1);
4794
4738
  },
4795
4739
  children: [
4796
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_icons7.Maximize2Icon, { className: "mr-1.5 h-3.5 w-3.5" }),
4740
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_icons8.Maximize2Icon, { className: "mr-1.5 h-3.5 w-3.5" }),
4797
4741
  overrideOpen ? "Bring window to front" : "Reopen window"
4798
4742
  ]
4799
4743
  }
4800
4744
  ),
4801
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4745
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
4802
4746
  import_design_system5.Button,
4803
4747
  {
4804
4748
  type: "button",
@@ -4809,7 +4753,7 @@ function UniversalAssociationPicker(props) {
4809
4753
  }
4810
4754
  )
4811
4755
  ] }),
4812
- overrideOpen && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4756
+ overrideOpen && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
4813
4757
  BrowseOverride,
4814
4758
  {
4815
4759
  open: true,
@@ -4829,7 +4773,7 @@ function UniversalAssociationPicker(props) {
4829
4773
  ]
4830
4774
  }
4831
4775
  )
4832
- ) : browseToken ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex min-h-0 flex-1 flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4776
+ ) : browseToken ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex min-h-0 flex-1 flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
4833
4777
  AssociationCandidateBody,
4834
4778
  {
4835
4779
  token: browseToken,
@@ -4842,13 +4786,13 @@ function UniversalAssociationPicker(props) {
4842
4786
  onAttach: (id, title) => onAttach(browseToken, id, title),
4843
4787
  onDetach: (id) => onDetach(browseToken, id)
4844
4788
  }
4845
- ) }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4789
+ ) }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
4846
4790
  "div",
4847
4791
  {
4848
4792
  role: "region",
4849
4793
  "aria-label": "Association search results",
4850
4794
  className: "-mx-1 min-h-24 flex-1 overflow-y-auto overscroll-contain px-1",
4851
- children: error ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4795
+ children: error ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
4852
4796
  SearchFailureNotice,
4853
4797
  {
4854
4798
  error,
@@ -4856,8 +4800,8 @@ function UniversalAssociationPicker(props) {
4856
4800
  operation: "Search to attach",
4857
4801
  origin: "associations/UniversalAssociationPicker"
4858
4802
  }
4859
- ) : results.length === 0 && failures.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "py-6 text-center text-[12px] text-muted-foreground", children: loading ? "Searching\u2026" : query.trim() ? "No matches \u2014 narrow with a type chip to browse." : "Nothing to attach yet. Type to search, or pick a type to browse." }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-2", children: [
4860
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4803
+ ) : results.length === 0 && failures.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "py-6 text-center text-[12px] text-muted-foreground", children: loading ? "Searching\u2026" : query.trim() ? "No matches \u2014 narrow with a type chip to browse." : "Nothing to attach yet. Type to search, or pick a type to browse." }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "space-y-2", children: [
4804
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
4861
4805
  SearchFailureNotice,
4862
4806
  {
4863
4807
  error: null,
@@ -4866,20 +4810,20 @@ function UniversalAssociationPicker(props) {
4866
4810
  origin: "associations/UniversalAssociationPicker"
4867
4811
  }
4868
4812
  ),
4869
- source !== "search" && results.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "px-1 text-[10px] font-medium uppercase tracking-wider text-muted-foreground/60", children: source === "recents" ? "Recent" : "Browse" }),
4813
+ source !== "search" && results.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "px-1 text-[10px] font-medium uppercase tracking-wider text-muted-foreground/60", children: source === "recents" ? "Recent" : "Browse" }),
4870
4814
  [...groups.entries()].map(([token, items]) => {
4871
4815
  const info = store.registry.getEntityInfo(token);
4872
4816
  const GroupIcon = info.Icon ?? DefaultEntityIcon;
4873
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-0.5", children: [
4874
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("p", { className: "flex items-center gap-1 px-1 text-[10px] font-medium uppercase tracking-wider text-muted-foreground/70", children: [
4875
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(GroupIcon, { className: "h-3 w-3" }),
4817
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "space-y-0.5", children: [
4818
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("p", { className: "flex items-center gap-1 px-1 text-[10px] font-medium uppercase tracking-wider text-muted-foreground/70", children: [
4819
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GroupIcon, { className: "h-3 w-3" }),
4876
4820
  info.labelPlural
4877
4821
  ] }),
4878
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("ul", { className: "space-y-0.5", children: items.map((c) => {
4822
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("ul", { className: "space-y-0.5", children: items.map((c) => {
4879
4823
  const key = attachedKey(c.token, c.id);
4880
4824
  const attached = attachedKeys.has(key);
4881
4825
  const busy = busyKey === key;
4882
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
4826
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
4883
4827
  "li",
4884
4828
  {
4885
4829
  className: (0, import_design_system5.cn)(
@@ -4888,7 +4832,7 @@ function UniversalAssociationPicker(props) {
4888
4832
  attached && "bg-accent/40"
4889
4833
  ),
4890
4834
  children: [
4891
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
4835
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
4892
4836
  "button",
4893
4837
  {
4894
4838
  type: "button",
@@ -4900,21 +4844,21 @@ function UniversalAssociationPicker(props) {
4900
4844
  "disabled:opacity-50"
4901
4845
  ),
4902
4846
  children: [
4903
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "min-w-0 flex-1 truncate text-foreground", children: c.title }),
4904
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4847
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "min-w-0 flex-1 truncate text-foreground", children: c.title }),
4848
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
4905
4849
  "span",
4906
4850
  {
4907
4851
  className: (0, import_design_system5.cn)(
4908
4852
  "flex h-5 w-5 shrink-0 items-center justify-center rounded-full",
4909
4853
  attached ? "bg-primary text-primary-foreground" : "border border-border text-muted-foreground group-hover:border-primary/60"
4910
4854
  ),
4911
- children: busy ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SpinnerIcon, { className: "h-3 w-3 animate-spin" }) : attached ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_icons7.CheckIcon, { className: "h-3 w-3" }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_icons7.PlusIcon, { className: "h-3 w-3" })
4855
+ children: busy ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SpinnerIcon, { className: "h-3 w-3 animate-spin" }) : attached ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_icons8.CheckIcon, { className: "h-3 w-3" }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_icons8.PlusIcon, { className: "h-3 w-3" })
4912
4856
  }
4913
4857
  )
4914
4858
  ]
4915
4859
  }
4916
4860
  ),
4917
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4861
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
4918
4862
  DoorControlsSlot,
4919
4863
  {
4920
4864
  token: c.token,
@@ -4938,8 +4882,8 @@ function UniversalAssociationPicker(props) {
4938
4882
  // src/react/components/AttachedItemsSheet.tsx
4939
4883
  var import_react16 = require("react");
4940
4884
  var import_design_system6 = require("@ai-matrx/design-system");
4941
- var import_icons9 = require("@ai-matrx/design-system/icons");
4942
- var import_jsx_runtime10 = require("react/jsx-runtime");
4885
+ var import_icons10 = require("@ai-matrx/design-system/icons");
4886
+ var import_jsx_runtime9 = require("react/jsx-runtime");
4943
4887
  function metadataIsPinned(metadata) {
4944
4888
  return metadata !== null && typeof metadata === "object" && !Array.isArray(metadata) && Reflect.get(metadata, "pinned") === true;
4945
4889
  }
@@ -4950,9 +4894,9 @@ function AttachedItemsSheet(props) {
4950
4894
  const title = info.labelPlural;
4951
4895
  const containerName = props.container?.label ?? props.containerLabel;
4952
4896
  const filing = props.container?.direction === "outgoing";
4953
- const subtitle = props.container ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "inline-flex min-w-0 max-w-full items-center gap-1", children: [
4897
+ const subtitle = props.container ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "inline-flex min-w-0 max-w-full items-center gap-1", children: [
4954
4898
  filing ? "What this is filed under:" : "Attached to",
4955
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4899
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4956
4900
  DoorRef,
4957
4901
  {
4958
4902
  token: props.container.type,
@@ -4963,16 +4907,16 @@ function AttachedItemsSheet(props) {
4963
4907
  )
4964
4908
  ] }) : props.containerLabel ? `Attached to ${props.containerLabel}` : "Attached items";
4965
4909
  if (!props.open) return null;
4966
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4910
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4967
4911
  AssociationWindow,
4968
4912
  {
4969
4913
  open: props.open,
4970
4914
  onClose: () => props.onOpenChange(false),
4971
4915
  scopeId: `attached:${props.token}`,
4972
4916
  title,
4973
- icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Icon, { className: "size-3.5 text-primary" }),
4917
+ icon: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon, { className: "size-3.5 text-primary" }),
4974
4918
  subtitle,
4975
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4919
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4976
4920
  AttachedItemsBody,
4977
4921
  {
4978
4922
  token: props.token,
@@ -5061,31 +5005,31 @@ function AttachedItemsBody({
5061
5005
  setBusyId(null);
5062
5006
  }
5063
5007
  };
5064
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
5065
- titleError ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "mb-2 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-[12px] text-destructive", children: [
5008
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
5009
+ titleError ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "mb-2 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-[12px] text-destructive", children: [
5066
5010
  "Showing names recorded at attach time \u2014 they may be out of date.",
5067
5011
  " ",
5068
5012
  titleError
5069
5013
  ] }) : null,
5070
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex-1 min-h-0 overflow-y-auto -mx-1 px-1", children: links.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex items-center justify-center py-8 text-[13px] text-muted-foreground", children: "Nothing attached yet." }) : titles === null ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center justify-center gap-2 py-8 text-[13px] text-muted-foreground", children: [
5071
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SpinnerIcon, { className: "h-4 w-4 animate-spin" }),
5014
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex-1 min-h-0 overflow-y-auto -mx-1 px-1", children: links.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex items-center justify-center py-8 text-[13px] text-muted-foreground", children: "Nothing attached yet." }) : titles === null ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center justify-center gap-2 py-8 text-[13px] text-muted-foreground", children: [
5015
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SpinnerIcon, { className: "h-4 w-4 animate-spin" }),
5072
5016
  "Loading\u2026"
5073
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("ul", { className: "space-y-0.5", children: links.map((link) => {
5017
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("ul", { className: "space-y-0.5", children: links.map((link) => {
5074
5018
  const resolved = titles.get(link.resourceId);
5075
5019
  const missing = !titles.has(link.resourceId);
5076
5020
  const name = resolved ?? link.label ?? (missing ? null : "Untitled");
5077
5021
  const busy = busyId === link.resourceId;
5078
5022
  const pinned = metadataIsPinned(link.metadata);
5079
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
5023
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
5080
5024
  "li",
5081
5025
  {
5082
5026
  className: "group/entity-ref group flex items-center gap-2 rounded-md px-2.5 py-2 text-sm transition-colors hover:bg-accent",
5083
5027
  children: [
5084
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Icon, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
5085
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "flex-1 min-w-0 truncate", children: name === null ? (
5028
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
5029
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "flex-1 min-w-0 truncate", children: name === null ? (
5086
5030
  // The X beside the row stays the one-click detach.
5087
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(UnresolvedRef, { token, id: link.resourceId })
5088
- ) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
5031
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(UnresolvedRef, { token, id: link.resourceId })
5032
+ ) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
5089
5033
  DoorRef,
5090
5034
  {
5091
5035
  token,
@@ -5095,7 +5039,7 @@ function AttachedItemsBody({
5095
5039
  className: "text-foreground"
5096
5040
  }
5097
5041
  ) }),
5098
- onSetPinned ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
5042
+ onSetPinned ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
5099
5043
  "button",
5100
5044
  {
5101
5045
  type: "button",
@@ -5107,8 +5051,8 @@ function AttachedItemsBody({
5107
5051
  "flex h-6 w-6 shrink-0 items-center justify-center rounded-md transition-colors hover:bg-accent hover:text-foreground disabled:opacity-50",
5108
5052
  pinned ? "text-primary" : "text-muted-foreground"
5109
5053
  ),
5110
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
5111
- import_icons9.PinIcon,
5054
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
5055
+ import_icons10.PinIcon,
5112
5056
  {
5113
5057
  className: (0, import_design_system6.cn)(
5114
5058
  "h-3.5 w-3.5",
@@ -5118,7 +5062,7 @@ function AttachedItemsBody({
5118
5062
  )
5119
5063
  }
5120
5064
  ) : null,
5121
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
5065
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
5122
5066
  "button",
5123
5067
  {
5124
5068
  type: "button",
@@ -5129,7 +5073,7 @@ function AttachedItemsBody({
5129
5073
  "flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors",
5130
5074
  "hover:bg-destructive/10 hover:text-destructive disabled:opacity-50"
5131
5075
  ),
5132
- children: busy ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SpinnerIcon, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_icons9.XIcon, { className: "h-3.5 w-3.5" })
5076
+ children: busy ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SpinnerIcon, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_icons10.XIcon, { className: "h-3.5 w-3.5" })
5133
5077
  }
5134
5078
  )
5135
5079
  ]
@@ -5137,14 +5081,14 @@ function AttachedItemsBody({
5137
5081
  link.edgeId
5138
5082
  );
5139
5083
  }) }) }),
5140
- onAdd ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
5084
+ onAdd ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
5141
5085
  "button",
5142
5086
  {
5143
5087
  type: "button",
5144
5088
  onClick: onAdd,
5145
5089
  className: "mt-2 flex w-full items-center justify-center gap-1.5 rounded-md border border-border px-3 py-2 text-sm text-muted-foreground transition-colors hover:border-primary/60 hover:text-foreground",
5146
5090
  children: [
5147
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_icons9.PlusIcon, { className: "h-4 w-4" }),
5091
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_icons10.PlusIcon, { className: "h-4 w-4" }),
5148
5092
  "Attach ",
5149
5093
  info.labelPlural.toLowerCase()
5150
5094
  ]
@@ -5206,8 +5150,8 @@ function getContentRoleMeta(role) {
5206
5150
  }
5207
5151
 
5208
5152
  // src/react/components/AssociationCard.tsx
5209
- var import_icons11 = require("@ai-matrx/design-system/icons");
5210
- var import_jsx_runtime11 = require("react/jsx-runtime");
5153
+ var import_icons12 = require("@ai-matrx/design-system/icons");
5154
+ var import_jsx_runtime10 = require("react/jsx-runtime");
5211
5155
  function AssociationCard({
5212
5156
  token,
5213
5157
  container: containerProp,
@@ -5246,7 +5190,7 @@ function AssociationCard({
5246
5190
  const canDrillIn = count > 0;
5247
5191
  const countWord = filing ? "filed under" : "attached";
5248
5192
  const drillTitle = canDrillIn ? `View the ${info.labelPlural.toLowerCase()} attached to ${container.label ?? "this"}` : void 0;
5249
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
5193
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
5250
5194
  look !== "tiles" ? (
5251
5195
  // ONE-LINE LOOKS (opt-in, off by default): small icon, UPPERCASE name,
5252
5196
  // count, then the "+".
@@ -5258,7 +5202,7 @@ function AssociationCard({
5258
5202
  // so the tap target's own 44px box centers the 28px circle with
5259
5203
  // 8px on every side. Never pass a layout class to a tap button —
5260
5204
  // its className lands on the ICON (the 2026-09-27 crooked "+").
5261
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
5205
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
5262
5206
  "div",
5263
5207
  {
5264
5208
  "data-association-card": token,
@@ -5269,7 +5213,7 @@ function AssociationCard({
5269
5213
  className
5270
5214
  ),
5271
5215
  children: [
5272
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
5216
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
5273
5217
  "button",
5274
5218
  {
5275
5219
  type: "button",
@@ -5282,13 +5226,13 @@ function AssociationCard({
5282
5226
  canDrillIn ? "cursor-pointer hover:text-foreground" : "cursor-default"
5283
5227
  ),
5284
5228
  children: [
5285
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Icon, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
5286
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "min-w-0 truncate text-xs font-semibold uppercase tracking-wider text-foreground", children: info.labelPlural }),
5287
- loading ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SpinnerIcon, { className: "h-3 w-3 animate-spin text-muted-foreground" }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "text-xs tabular-nums text-muted-foreground", children: count })
5229
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Icon, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
5230
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "min-w-0 truncate text-xs font-semibold uppercase tracking-wider text-foreground", children: info.labelPlural }),
5231
+ loading ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SpinnerIcon, { className: "h-3 w-3 animate-spin text-muted-foreground" }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-xs tabular-nums text-muted-foreground", children: count })
5288
5232
  ]
5289
5233
  }
5290
5234
  ),
5291
- canAttach && (look === "compact" ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
5235
+ canAttach && (look === "compact" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
5292
5236
  import_buttons.PlusTapButton,
5293
5237
  {
5294
5238
  variant: "outline",
@@ -5296,7 +5240,7 @@ function AssociationCard({
5296
5240
  tooltip: false,
5297
5241
  onClick: () => setOpen(true)
5298
5242
  }
5299
- ) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
5243
+ ) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
5300
5244
  "button",
5301
5245
  {
5302
5246
  type: "button",
@@ -5304,13 +5248,13 @@ function AssociationCard({
5304
5248
  "aria-label": `Attach ${info.labelPlural.toLowerCase()}`,
5305
5249
  title: `Attach ${info.labelPlural.toLowerCase()}`,
5306
5250
  className: "flex h-11 w-11 shrink-0 items-center justify-center rounded-md border border-border text-muted-foreground transition-colors hover:border-primary/60 hover:text-foreground lg:h-7 lg:w-7",
5307
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_icons11.PlusIcon, { className: "h-4 w-4" })
5251
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_icons12.PlusIcon, { className: "h-4 w-4" })
5308
5252
  }
5309
5253
  ))
5310
5254
  ]
5311
5255
  }
5312
5256
  )
5313
- ) : /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
5257
+ ) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
5314
5258
  "div",
5315
5259
  {
5316
5260
  "data-association-card": token,
@@ -5320,7 +5264,7 @@ function AssociationCard({
5320
5264
  className
5321
5265
  ),
5322
5266
  children: [
5323
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
5267
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
5324
5268
  "span",
5325
5269
  {
5326
5270
  className: (0, import_design_system7.cn)(
@@ -5329,7 +5273,7 @@ function AssociationCard({
5329
5273
  )
5330
5274
  }
5331
5275
  ),
5332
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
5276
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
5333
5277
  "button",
5334
5278
  {
5335
5279
  type: "button",
@@ -5341,7 +5285,7 @@ function AssociationCard({
5341
5285
  canDrillIn ? "cursor-pointer" : "cursor-default"
5342
5286
  ),
5343
5287
  children: [
5344
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
5288
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
5345
5289
  "span",
5346
5290
  {
5347
5291
  className: (0, import_design_system7.cn)(
@@ -5349,20 +5293,20 @@ function AssociationCard({
5349
5293
  role.accentBg,
5350
5294
  role.accentText
5351
5295
  ),
5352
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Icon, { className: "h-4 w-4" })
5296
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Icon, { className: "h-4 w-4" })
5353
5297
  }
5354
5298
  ),
5355
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "min-w-0 flex-1", children: [
5356
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "block truncate text-sm font-medium text-foreground", children: info.labelPlural }),
5357
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "block text-xs text-muted-foreground tabular-nums", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "inline-flex items-center gap-1", children: [
5358
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SpinnerIcon, { className: "h-3 w-3 animate-spin" }),
5299
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "min-w-0 flex-1", children: [
5300
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "block truncate text-sm font-medium text-foreground", children: info.labelPlural }),
5301
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "block text-xs text-muted-foreground tabular-nums", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "inline-flex items-center gap-1", children: [
5302
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SpinnerIcon, { className: "h-3 w-3 animate-spin" }),
5359
5303
  "Loading\u2026"
5360
5304
  ] }) : `${count} ${countWord}` })
5361
5305
  ] })
5362
5306
  ]
5363
5307
  }
5364
5308
  ),
5365
- canAttach && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
5309
+ canAttach && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
5366
5310
  "button",
5367
5311
  {
5368
5312
  type: "button",
@@ -5370,13 +5314,13 @@ function AssociationCard({
5370
5314
  "aria-label": `Attach ${info.labelPlural.toLowerCase()}`,
5371
5315
  title: `Attach ${info.labelPlural.toLowerCase()}`,
5372
5316
  className: "mr-2 flex h-11 w-11 shrink-0 items-center justify-center rounded-md border border-border text-muted-foreground transition-colors hover:border-primary/60 hover:text-foreground lg:mr-3 lg:h-7 lg:w-7",
5373
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_icons11.PlusIcon, { className: "h-4 w-4" })
5317
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_icons12.PlusIcon, { className: "h-4 w-4" })
5374
5318
  }
5375
5319
  )
5376
5320
  ]
5377
5321
  }
5378
5322
  ),
5379
- listOpen && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
5323
+ listOpen && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
5380
5324
  AttachedItemsSheet,
5381
5325
  {
5382
5326
  open: listOpen,
@@ -5395,7 +5339,7 @@ function AssociationCard({
5395
5339
  onSetPinned: (resourceId, pinned, role2) => setPinned(token, resourceId, pinned, role2 ?? void 0)
5396
5340
  }
5397
5341
  ),
5398
- canAttach && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
5342
+ canAttach && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
5399
5343
  AssociationPicker,
5400
5344
  {
5401
5345
  open,
@@ -5414,7 +5358,7 @@ function AssociationCard({
5414
5358
 
5415
5359
  // src/react/components/AssociationCardGrid.tsx
5416
5360
  var import_design_system8 = require("@ai-matrx/design-system");
5417
- var import_jsx_runtime12 = require("react/jsx-runtime");
5361
+ var import_jsx_runtime11 = require("react/jsx-runtime");
5418
5362
  var SIMPLE_GROUP_LABEL = "mb-1 text-xs font-medium uppercase tracking-wider text-muted-foreground";
5419
5363
  var SIMPLE_TILE_ROW = "flex flex-wrap gap-2 [&>*]:min-w-[16rem] [&>*]:flex-1";
5420
5364
  var TILE_GRID = "grid grid-cols-1 gap-2 @md:grid-cols-2 @3xl:grid-cols-3";
@@ -5423,11 +5367,11 @@ function GroupHeader({
5423
5367
  title,
5424
5368
  dotClassName
5425
5369
  }) {
5426
- if (look !== "tiles") return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h3", { className: SIMPLE_GROUP_LABEL, children: title });
5427
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "mb-2.5 flex items-baseline gap-3 pl-1.5", children: dotClassName ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center gap-2", children: [
5428
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: (0, import_design_system8.cn)("h-2.5 w-2.5 rounded-full", dotClassName) }),
5429
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h3", { className: "text-sm font-semibold text-foreground", children: title })
5430
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h3", { className: "text-sm font-semibold text-foreground", children: title }) });
5370
+ if (look !== "tiles") return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h3", { className: SIMPLE_GROUP_LABEL, children: title });
5371
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "mb-2.5 flex items-baseline gap-3 pl-1.5", children: dotClassName ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center gap-2", children: [
5372
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: (0, import_design_system8.cn)("h-2.5 w-2.5 rounded-full", dotClassName) }),
5373
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h3", { className: "text-sm font-semibold text-foreground", children: title })
5374
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h3", { className: "text-sm font-semibold text-foreground", children: title }) });
5431
5375
  }
5432
5376
  function AssociationCardGrid({
5433
5377
  tokens,
@@ -5440,13 +5384,13 @@ function AssociationCardGrid({
5440
5384
  const excluded = new Set(excludeTokens ?? []);
5441
5385
  const filing = primary?.direction === "outgoing";
5442
5386
  const links = useContainerLinks(containerLinksArgs(primary));
5443
- const base2 = tokens ?? store.registry.curatedTokens();
5387
+ const base = tokens ?? store.registry.curatedTokens();
5444
5388
  const withPresent = filing ? [
5445
- ...base2,
5389
+ ...base,
5446
5390
  ...links.presentTokens.filter(
5447
- (t) => isEntityTypeToken(t) && !base2.includes(t)
5391
+ (t) => isEntityTypeToken(t) && !base.includes(t)
5448
5392
  )
5449
- ] : base2;
5393
+ ] : base;
5450
5394
  const list = withPresent.filter(
5451
5395
  (token) => !excluded.has(token) && (!filing || isAssociationTargetType(token))
5452
5396
  );
@@ -5456,7 +5400,7 @@ function AssociationCardGrid({
5456
5400
  return !role || !roleIds.has(role);
5457
5401
  }) : [];
5458
5402
  const rowClass = look !== "tiles" ? SIMPLE_TILE_ROW : TILE_GRID;
5459
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
5403
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
5460
5404
  "div",
5461
5405
  {
5462
5406
  "data-association-grid-look": look,
@@ -5467,8 +5411,8 @@ function AssociationCardGrid({
5467
5411
  (token) => store.registry.getEntityInfo(token).contentRole === role.id
5468
5412
  );
5469
5413
  if (inRole.length === 0) return null;
5470
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("section", { children: [
5471
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5414
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("section", { children: [
5415
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
5472
5416
  GroupHeader,
5473
5417
  {
5474
5418
  look,
@@ -5476,18 +5420,18 @@ function AssociationCardGrid({
5476
5420
  dotClassName: role.accentBar
5477
5421
  }
5478
5422
  ),
5479
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: rowClass, children: inRole.map((token) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(AssociationCard, { token, look }, token)) })
5423
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: rowClass, children: inRole.map((token) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(AssociationCard, { token, look }, token)) })
5480
5424
  ] }, role.id);
5481
5425
  }),
5482
- roleless.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("section", { children: [
5483
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5426
+ roleless.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("section", { children: [
5427
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
5484
5428
  GroupHeader,
5485
5429
  {
5486
5430
  look,
5487
5431
  title: "Filed under"
5488
5432
  }
5489
5433
  ),
5490
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: rowClass, children: roleless.map((token) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(AssociationCard, { token, look }, token)) })
5434
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: rowClass, children: roleless.map((token) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(AssociationCard, { token, look }, token)) })
5491
5435
  ] })
5492
5436
  ]
5493
5437
  }
@@ -5497,9 +5441,9 @@ function AssociationCardGrid({
5497
5441
  // src/react/components/AssociationList.tsx
5498
5442
  var import_react18 = require("react");
5499
5443
  var import_design_system9 = require("@ai-matrx/design-system");
5500
- var import_icons13 = require("@ai-matrx/design-system/icons");
5444
+ var import_icons14 = require("@ai-matrx/design-system/icons");
5501
5445
  var import_outbound = require("@ai-matrx/kit/outbound");
5502
- var import_jsx_runtime13 = require("react/jsx-runtime");
5446
+ var import_jsx_runtime12 = require("react/jsx-runtime");
5503
5447
  function metadataIsPinned2(metadata) {
5504
5448
  return metadata !== null && typeof metadata === "object" && !Array.isArray(metadata) && Reflect.get(metadata, "pinned") === true;
5505
5449
  }
@@ -5610,15 +5554,15 @@ function AssociationList(props) {
5610
5554
  const grouped = groupRows(store, visibleRows);
5611
5555
  const isLoading = adapter.status === "loading" || adapter.status === "idle";
5612
5556
  const attachableTokens = tokenFilter ?? store.registry.listableTokens();
5613
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: (0, import_design_system9.cn)("flex flex-col gap-2 text-foreground", props.className), children: [
5614
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: (0, import_design_system9.cn)("flex items-center gap-2 px-1", props.title === null ? "justify-end" : "justify-between"), children: [
5615
- props.title === null ? null : /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("h3", { className: "flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: [
5616
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Link2Icon, { className: "h-3.5 w-3.5" }),
5557
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: (0, import_design_system9.cn)("flex flex-col gap-2 text-foreground", props.className), children: [
5558
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: (0, import_design_system9.cn)("flex items-center gap-2 px-1", props.title === null ? "justify-end" : "justify-between"), children: [
5559
+ props.title === null ? null : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("h3", { className: "flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: [
5560
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Link2Icon, { className: "h-3.5 w-3.5" }),
5617
5561
  props.title ?? "Resources",
5618
- visibleRows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "rounded bg-muted px-1 text-[10px] font-medium text-muted-foreground", children: visibleRows.length })
5562
+ visibleRows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "rounded bg-muted px-1 text-[10px] font-medium text-muted-foreground", children: visibleRows.length })
5619
5563
  ] }),
5620
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center gap-1.5", children: [
5621
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
5564
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center gap-1.5", children: [
5565
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
5622
5566
  "button",
5623
5567
  {
5624
5568
  type: "button",
@@ -5628,19 +5572,19 @@ function AssociationList(props) {
5628
5572
  showUniversal ? "bg-accent text-foreground" : "text-muted-foreground hover:bg-accent hover:text-foreground"
5629
5573
  ),
5630
5574
  children: [
5631
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_icons13.PlusIcon, { className: "h-3 w-3" }),
5575
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_icons14.PlusIcon, { className: "h-3 w-3" }),
5632
5576
  "Add"
5633
5577
  ]
5634
5578
  }
5635
5579
  ),
5636
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
5580
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5637
5581
  "button",
5638
5582
  {
5639
5583
  type: "button",
5640
5584
  onClick: () => void adapter.reload(),
5641
5585
  title: "Refresh",
5642
5586
  className: "text-muted-foreground/60 transition-colors hover:text-foreground",
5643
- children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
5587
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5644
5588
  RefreshIcon,
5645
5589
  {
5646
5590
  className: (0, import_design_system9.cn)(
@@ -5653,7 +5597,7 @@ function AssociationList(props) {
5653
5597
  )
5654
5598
  ] })
5655
5599
  ] }),
5656
- showUniversal && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "rounded-md border border-border/60 bg-muted/30 p-2 max-h-80 flex flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
5600
+ showUniversal && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "rounded-md border border-border/60 bg-muted/30 p-2 max-h-80 flex flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5657
5601
  UniversalAssociationPicker,
5658
5602
  {
5659
5603
  tokens: attachableTokens,
@@ -5663,9 +5607,9 @@ function AssociationList(props) {
5663
5607
  onDetach: (token, id) => adapter.detach(token, id)
5664
5608
  }
5665
5609
  ) }),
5666
- adapter.status === "error" && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center justify-between gap-2 rounded-md border border-destructive/40 bg-destructive/10 px-2.5 py-2", children: [
5667
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "truncate text-[11px] text-destructive", children: adapter.error || "Failed to load resources" }),
5668
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
5610
+ adapter.status === "error" && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center justify-between gap-2 rounded-md border border-destructive/40 bg-destructive/10 px-2.5 py-2", children: [
5611
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "truncate text-[11px] text-destructive", children: adapter.error || "Failed to load resources" }),
5612
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5669
5613
  "button",
5670
5614
  {
5671
5615
  type: "button",
@@ -5675,17 +5619,17 @@ function AssociationList(props) {
5675
5619
  }
5676
5620
  )
5677
5621
  ] }),
5678
- adapter.status !== "error" && isLoading && visibleRows.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "space-y-1.5 px-1", children: [
5679
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system9.Skeleton, { className: "h-3 w-20" }),
5680
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system9.Skeleton, { className: "h-7 w-full rounded-md" }),
5681
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system9.Skeleton, { className: "h-7 w-3/4 rounded-md" })
5622
+ adapter.status !== "error" && isLoading && visibleRows.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "space-y-1.5 px-1", children: [
5623
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_design_system9.Skeleton, { className: "h-3 w-20" }),
5624
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_design_system9.Skeleton, { className: "h-7 w-full rounded-md" }),
5625
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_design_system9.Skeleton, { className: "h-7 w-3/4 rounded-md" })
5682
5626
  ] }),
5683
- adapter.status === "ready" && visibleRows.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "px-1 py-1 text-[11px] text-muted-foreground", children: "Nothing attached yet \u2014 use Add to link anything." }),
5684
- visibleRows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "space-y-2.5", children: grouped.map(({ role, tokens: tokenGroups }) => {
5627
+ adapter.status === "ready" && visibleRows.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "px-1 py-1 text-[11px] text-muted-foreground", children: "Nothing attached yet \u2014 use Add to link anything." }),
5628
+ visibleRows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "space-y-2.5", children: grouped.map(({ role, tokens: tokenGroups }) => {
5685
5629
  const roleMeta = getContentRoleMeta(role);
5686
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "space-y-1.5", children: [
5687
- variant === "full" && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center gap-1.5 px-1", children: [
5688
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
5630
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "space-y-1.5", children: [
5631
+ variant === "full" && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center gap-1.5 px-1", children: [
5632
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5689
5633
  "span",
5690
5634
  {
5691
5635
  className: (0, import_design_system9.cn)(
@@ -5694,7 +5638,7 @@ function AssociationList(props) {
5694
5638
  )
5695
5639
  }
5696
5640
  ),
5697
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
5641
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5698
5642
  "p",
5699
5643
  {
5700
5644
  className: (0, import_design_system9.cn)(
@@ -5707,28 +5651,28 @@ function AssociationList(props) {
5707
5651
  ] }),
5708
5652
  tokenGroups.map(({ info, token, rows: tokenRows }) => {
5709
5653
  const TokenIcon = info?.Icon ?? null;
5710
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "space-y-0.5", children: [
5711
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center justify-between gap-1 px-1", children: [
5712
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { className: "flex items-center gap-1 text-[10px] font-medium text-muted-foreground/80", children: [
5713
- TokenIcon ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(TokenIcon, { className: "h-3 w-3" }) : null,
5654
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "space-y-0.5", children: [
5655
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center justify-between gap-1 px-1", children: [
5656
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { className: "flex items-center gap-1 text-[10px] font-medium text-muted-foreground/80", children: [
5657
+ TokenIcon ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(TokenIcon, { className: "h-3 w-3" }) : null,
5714
5658
  info?.labelPlural ?? titleize(token),
5715
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-muted-foreground/50", children: tokenRows.length })
5659
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text-muted-foreground/50", children: tokenRows.length })
5716
5660
  ] }),
5717
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center gap-1", children: [
5661
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center gap-1", children: [
5718
5662
  props.renderSectionActions && info ? props.renderSectionActions(info.token) : null,
5719
- info?.canListCandidates && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
5663
+ info?.canListCandidates && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5720
5664
  "button",
5721
5665
  {
5722
5666
  type: "button",
5723
5667
  onClick: () => setPickerToken(info.token),
5724
5668
  title: `Add ${info.labelPlural}`,
5725
5669
  className: "rounded p-0.5 text-muted-foreground/60 transition-colors hover:bg-accent hover:text-foreground",
5726
- children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_icons13.PlusIcon, { className: "h-3 w-3" })
5670
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_icons14.PlusIcon, { className: "h-3 w-3" })
5727
5671
  }
5728
5672
  )
5729
5673
  ] })
5730
5674
  ] }),
5731
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("ul", { className: "space-y-0.5", children: tokenRows.map((row) => {
5675
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("ul", { className: "space-y-0.5", children: tokenRows.map((row) => {
5732
5676
  const busy = removingKeys.has(row.key);
5733
5677
  const custom = props.renderRow?.(row, {
5734
5678
  title: titleFor({
@@ -5741,9 +5685,9 @@ function AssociationList(props) {
5741
5685
  onOpen: () => openRow(row)
5742
5686
  });
5743
5687
  if (custom != null) {
5744
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("li", { children: custom }, row.key);
5688
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("li", { children: custom }, row.key);
5745
5689
  }
5746
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
5690
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
5747
5691
  "div",
5748
5692
  {
5749
5693
  className: (0, import_design_system9.cn)(
@@ -5755,7 +5699,7 @@ function AssociationList(props) {
5755
5699
  token: row.token,
5756
5700
  id: row.resourceId,
5757
5701
  label: row.label
5758
- }) ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "min-w-0 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(UnresolvedRef, { token: row.token, id: row.resourceId }) }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
5702
+ }) ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "min-w-0 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(UnresolvedRef, { token: row.token, id: row.resourceId }) }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5759
5703
  DoorRef,
5760
5704
  {
5761
5705
  token: row.token,
@@ -5771,9 +5715,9 @@ function AssociationList(props) {
5771
5715
  className: "min-w-0 flex-1 text-foreground"
5772
5716
  }
5773
5717
  ),
5774
- row.originRefs && row.originRefs.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "flex shrink-0 items-center gap-1 text-[10px] text-muted-foreground/60", children: [
5718
+ row.originRefs && row.originRefs.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "flex shrink-0 items-center gap-1 text-[10px] text-muted-foreground/60", children: [
5775
5719
  "via",
5776
- row.originRefs.map((origin) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
5720
+ row.originRefs.map((origin) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5777
5721
  DoorRef,
5778
5722
  {
5779
5723
  token: origin.token,
@@ -5785,8 +5729,8 @@ function AssociationList(props) {
5785
5729
  },
5786
5730
  `${origin.token}:${origin.id}`
5787
5731
  ))
5788
- ] }) : row.originNote ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "shrink-0 text-[10px] text-muted-foreground/60", children: row.originNote }) : null,
5789
- adapter.setPinned && info && row.removable && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
5732
+ ] }) : row.originNote ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "shrink-0 text-[10px] text-muted-foreground/60", children: row.originNote }) : null,
5733
+ adapter.setPinned && info && row.removable && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5790
5734
  "button",
5791
5735
  {
5792
5736
  type: "button",
@@ -5798,8 +5742,8 @@ function AssociationList(props) {
5798
5742
  "shrink-0 rounded p-0.5 transition-colors hover:!text-foreground",
5799
5743
  row.pinned ? "text-primary" : "text-muted-foreground/0 group-hover:text-muted-foreground"
5800
5744
  ),
5801
- children: pinningKeys.has(row.key) ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SpinnerIcon, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
5802
- import_icons13.PinIcon,
5745
+ children: pinningKeys.has(row.key) ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SpinnerIcon, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5746
+ import_icons14.PinIcon,
5803
5747
  {
5804
5748
  className: (0, import_design_system9.cn)(
5805
5749
  "h-3 w-3",
@@ -5809,7 +5753,7 @@ function AssociationList(props) {
5809
5753
  )
5810
5754
  }
5811
5755
  ),
5812
- row.removable && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
5756
+ row.removable && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5813
5757
  "button",
5814
5758
  {
5815
5759
  type: "button",
@@ -5818,7 +5762,7 @@ function AssociationList(props) {
5818
5762
  title: "Detach",
5819
5763
  "aria-label": "Detach",
5820
5764
  className: "shrink-0 rounded p-0.5 text-muted-foreground/0 transition-colors group-hover:text-muted-foreground hover:!text-destructive disabled:opacity-50",
5821
- children: busy ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SpinnerIcon, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_icons13.XIcon, { className: "h-3 w-3" })
5765
+ children: busy ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SpinnerIcon, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_icons14.XIcon, { className: "h-3 w-3" })
5822
5766
  }
5823
5767
  )
5824
5768
  ]
@@ -5829,7 +5773,7 @@ function AssociationList(props) {
5829
5773
  })
5830
5774
  ] }, role);
5831
5775
  }) }),
5832
- pickerToken && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
5776
+ pickerToken && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5833
5777
  AssociationPicker,
5834
5778
  {
5835
5779
  open: true,
@@ -5887,9 +5831,9 @@ function titleize(token) {
5887
5831
  // src/react/components/AssociationCaptureToolbar.tsx
5888
5832
  var import_react19 = require("react");
5889
5833
  var import_design_system10 = require("@ai-matrx/design-system");
5890
- var import_icons15 = require("@ai-matrx/design-system/icons");
5834
+ var import_icons16 = require("@ai-matrx/design-system/icons");
5891
5835
  var import_outbound2 = require("@ai-matrx/kit/outbound");
5892
- var import_jsx_runtime14 = require("react/jsx-runtime");
5836
+ var import_jsx_runtime13 = require("react/jsx-runtime");
5893
5837
  function AssociationCaptureToolbar({
5894
5838
  attach,
5895
5839
  uploadFolderPath,
@@ -6122,7 +6066,7 @@ function AssociationCaptureToolbar({
6122
6066
  }
6123
6067
  };
6124
6068
  const anyBuiltIn = actions.upload || actions.addFile || actions.newDocument;
6125
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
6069
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
6126
6070
  "div",
6127
6071
  {
6128
6072
  className: (0, import_design_system10.cn)(
@@ -6143,11 +6087,11 @@ function AssociationCaptureToolbar({
6143
6087
  },
6144
6088
  onDrop: handleDrop,
6145
6089
  children: [
6146
- isDragOver ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "pointer-events-none absolute inset-0 z-10 grid place-items-center bg-background/70", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "flex items-center gap-2 rounded-md border border-primary/40 bg-card px-3 py-1.5 text-xs font-medium text-foreground", children: [
6147
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(UploadIcon, { className: "size-3.5 text-primary" }),
6090
+ isDragOver ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "pointer-events-none absolute inset-0 z-10 grid place-items-center bg-background/70", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "flex items-center gap-2 rounded-md border border-primary/40 bg-card px-3 py-1.5 text-xs font-medium text-foreground", children: [
6091
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(UploadIcon, { className: "size-3.5 text-primary" }),
6148
6092
  "Drop to upload & attach"
6149
6093
  ] }) }) : null,
6150
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
6094
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6151
6095
  "input",
6152
6096
  {
6153
6097
  ref: fileInputRef,
@@ -6157,8 +6101,8 @@ function AssociationCaptureToolbar({
6157
6101
  onChange: handleFilesSelected
6158
6102
  }
6159
6103
  ),
6160
- showToolbar && (anyBuiltIn || extraActions) ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex flex-wrap items-center gap-0.5 border-b border-border/60 px-1.5 py-1", children: namingDoc ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex flex-1 items-center gap-1.5 py-0.5", children: [
6161
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
6104
+ showToolbar && (anyBuiltIn || extraActions) ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "flex flex-wrap items-center gap-0.5 border-b border-border/60 px-1.5 py-1", children: namingDoc ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-1 items-center gap-1.5 py-0.5", children: [
6105
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6162
6106
  import_design_system10.Input,
6163
6107
  {
6164
6108
  autoFocus: true,
@@ -6177,17 +6121,17 @@ function AssociationCaptureToolbar({
6177
6121
  style: { fontSize: 16 }
6178
6122
  }
6179
6123
  ),
6180
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
6124
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6181
6125
  "button",
6182
6126
  {
6183
6127
  type: "button",
6184
6128
  disabled: creatingDoc || !docName.trim(),
6185
6129
  onClick: () => void handleCreateDoc(),
6186
6130
  className: "flex h-7 items-center rounded-md bg-primary px-2 text-[11px] font-medium text-primary-foreground disabled:opacity-50",
6187
- children: creatingDoc ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SpinnerIcon, { className: "size-3.5 animate-spin" }) : "Create"
6131
+ children: creatingDoc ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SpinnerIcon, { className: "size-3.5 animate-spin" }) : "Create"
6188
6132
  }
6189
6133
  ),
6190
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
6134
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6191
6135
  "button",
6192
6136
  {
6193
6137
  type: "button",
@@ -6200,8 +6144,8 @@ function AssociationCaptureToolbar({
6200
6144
  children: "Cancel"
6201
6145
  }
6202
6146
  )
6203
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
6204
- actions.upload ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
6147
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
6148
+ actions.upload ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6205
6149
  CaptureToolbarAction,
6206
6150
  {
6207
6151
  icon: isUploading ? SpinnerIcon : UploadIcon,
@@ -6211,7 +6155,7 @@ function AssociationCaptureToolbar({
6211
6155
  disabled: isPicking || isUploading
6212
6156
  }
6213
6157
  ) : null,
6214
- actions.addFile ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
6158
+ actions.addFile ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6215
6159
  CaptureToolbarAction,
6216
6160
  {
6217
6161
  icon: isPicking ? SpinnerIcon : FolderOpenIcon,
@@ -6221,11 +6165,11 @@ function AssociationCaptureToolbar({
6221
6165
  disabled: isPicking || isUploading
6222
6166
  }
6223
6167
  ) : null,
6224
- (actions.upload || actions.addFile) && actions.newDocument ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "mx-1 h-4 w-px bg-border" }) : null,
6225
- actions.newDocument ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
6168
+ (actions.upload || actions.addFile) && actions.newDocument ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "mx-1 h-4 w-px bg-border" }) : null,
6169
+ actions.newDocument ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6226
6170
  CaptureToolbarAction,
6227
6171
  {
6228
- icon: creatingDoc ? SpinnerIcon : import_icons15.PlusIcon,
6172
+ icon: creatingDoc ? SpinnerIcon : import_icons16.PlusIcon,
6229
6173
  spinning: creatingDoc,
6230
6174
  label: "New document",
6231
6175
  onClick: () => setNamingDoc(true),
@@ -6246,7 +6190,7 @@ function CaptureToolbarAction({
6246
6190
  disabled,
6247
6191
  spinning
6248
6192
  }) {
6249
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
6193
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
6250
6194
  import_design_system10.Button,
6251
6195
  {
6252
6196
  type: "button",
@@ -6256,7 +6200,7 @@ function CaptureToolbarAction({
6256
6200
  disabled,
6257
6201
  className: "h-7 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground",
6258
6202
  children: [
6259
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Icon, { className: (0, import_design_system10.cn)("size-3.5", spinning && "animate-spin") }),
6203
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Icon, { className: (0, import_design_system10.cn)("size-3.5", spinning && "animate-spin") }),
6260
6204
  label
6261
6205
  ]
6262
6206
  }
@@ -6265,7 +6209,7 @@ function CaptureToolbarAction({
6265
6209
 
6266
6210
  // src/react/lazyPorts.tsx
6267
6211
  var import_react20 = require("react");
6268
- var import_jsx_runtime15 = require("react/jsx-runtime");
6212
+ var import_jsx_runtime14 = require("react/jsx-runtime");
6269
6213
  function lazyComponent(load) {
6270
6214
  return (0, import_react20.lazy)(async () => {
6271
6215
  const loaded = await load();
@@ -6275,14 +6219,14 @@ function lazyComponent(load) {
6275
6219
  function lazyWindowShell(load) {
6276
6220
  const Loaded = lazyComponent(load);
6277
6221
  return function LazyWindowShell(props) {
6278
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react20.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Loaded, { ...props }) });
6222
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react20.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Loaded, { ...props }) });
6279
6223
  };
6280
6224
  }
6281
6225
  function lazyPickerOverride(load) {
6282
6226
  const Loaded = lazyComponent(load);
6283
6227
  return function LazyPickerOverride(props) {
6284
6228
  if (!props.open) return null;
6285
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react20.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Loaded, { ...props }) });
6229
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react20.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Loaded, { ...props }) });
6286
6230
  };
6287
6231
  }
6288
6232
 
@@ -6396,8 +6340,8 @@ function useAssociationPickerBridge(props, options = {}) {
6396
6340
  // src/react/components/AssociationEntitySelect.tsx
6397
6341
  var import_react22 = require("react");
6398
6342
  var import_design_system11 = require("@ai-matrx/design-system");
6399
- var import_icons17 = require("@ai-matrx/design-system/icons");
6400
- var import_jsx_runtime16 = require("react/jsx-runtime");
6343
+ var import_icons18 = require("@ai-matrx/design-system/icons");
6344
+ var import_jsx_runtime15 = require("react/jsx-runtime");
6401
6345
  function AssociationEntitySelect({
6402
6346
  token,
6403
6347
  adapter,
@@ -6438,7 +6382,7 @@ function AssociationEntitySelect({
6438
6382
  if (id) close();
6439
6383
  else notifier.error(`Couldn't create the ${entityLabel}`);
6440
6384
  };
6441
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
6385
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
6442
6386
  "div",
6443
6387
  {
6444
6388
  className: (0, import_design_system11.cn)(
@@ -6446,7 +6390,7 @@ function AssociationEntitySelect({
6446
6390
  className
6447
6391
  ),
6448
6392
  children: [
6449
- showIcon ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6393
+ showIcon ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6450
6394
  InfoIcon,
6451
6395
  {
6452
6396
  className: (0, import_design_system11.cn)(
@@ -6456,7 +6400,7 @@ function AssociationEntitySelect({
6456
6400
  "aria-hidden": true
6457
6401
  }
6458
6402
  ) : null,
6459
- active ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6403
+ active ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6460
6404
  import_design_system11.EditableLabel,
6461
6405
  {
6462
6406
  value: active.title,
@@ -6475,8 +6419,8 @@ function AssociationEntitySelect({
6475
6419
  inputClassName: "text-xs font-medium"
6476
6420
  }
6477
6421
  ) : null,
6478
- active ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DoorControlsSlot, { token, id: active.id, name: active.title }) : null,
6479
- !active ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6422
+ active ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DoorControlsSlot, { token, id: active.id, name: active.title }) : null,
6423
+ !active ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6480
6424
  "span",
6481
6425
  {
6482
6426
  className: (0, import_design_system11.cn)(
@@ -6486,13 +6430,13 @@ function AssociationEntitySelect({
6486
6430
  children: adapter.loading ? "\u2026" : emptyLabel ?? info.labelPlural
6487
6431
  }
6488
6432
  ) : null,
6489
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
6433
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
6490
6434
  import_design_system11.Popover,
6491
6435
  {
6492
6436
  open,
6493
6437
  onOpenChange: (next) => next ? setOpen(true) : close(),
6494
6438
  children: [
6495
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
6439
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system11.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
6496
6440
  "button",
6497
6441
  {
6498
6442
  type: "button",
@@ -6500,17 +6444,17 @@ function AssociationEntitySelect({
6500
6444
  title: `Switch or add ${info.labelPlural.toLowerCase()}`,
6501
6445
  "aria-label": `Switch or add ${info.labelPlural.toLowerCase()}`,
6502
6446
  children: [
6503
- items.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "tabular-nums", children: [
6447
+ items.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "tabular-nums", children: [
6504
6448
  activeIndex >= 0 ? activeIndex + 1 : "\u2014",
6505
6449
  "/",
6506
6450
  items.length
6507
6451
  ] }) : null,
6508
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_icons17.ChevronDownIcon, { className: "size-3 opacity-60" })
6452
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons18.ChevronDownIcon, { className: "size-3 opacity-60" })
6509
6453
  ]
6510
6454
  }
6511
6455
  ) }),
6512
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.PopoverContent, { sizing: "content", className: "p-0", align, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Command, { children: [
6513
- items.length > 5 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6456
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system11.PopoverContent, { sizing: "content", className: "p-0", align, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_design_system11.Command, { children: [
6457
+ items.length > 5 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6514
6458
  import_design_system11.CommandInput,
6515
6459
  {
6516
6460
  value: query,
@@ -6518,9 +6462,9 @@ function AssociationEntitySelect({
6518
6462
  placeholder: `Search ${info.labelPlural.toLowerCase()}\u2026`
6519
6463
  }
6520
6464
  ) : null,
6521
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.CommandList, { children: [
6522
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.CommandEmpty, { children: "No match." }),
6523
- items.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.CommandGroup, { children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
6465
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_design_system11.CommandList, { children: [
6466
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system11.CommandEmpty, { children: "No match." }),
6467
+ items.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system11.CommandGroup, { children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
6524
6468
  import_design_system11.CommandItem,
6525
6469
  {
6526
6470
  value: `${item.title} ${item.id}`,
@@ -6531,8 +6475,8 @@ function AssociationEntitySelect({
6531
6475
  },
6532
6476
  className: "group/entity-ref group gap-2",
6533
6477
  children: [
6534
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6535
- import_icons17.CheckIcon,
6478
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6479
+ import_icons18.CheckIcon,
6536
6480
  {
6537
6481
  className: (0, import_design_system11.cn)(
6538
6482
  "size-3.5 shrink-0",
@@ -6540,8 +6484,8 @@ function AssociationEntitySelect({
6540
6484
  )
6541
6485
  }
6542
6486
  ),
6543
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "min-w-0 flex-1 truncate", children: item.title }),
6544
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6487
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "min-w-0 flex-1 truncate", children: item.title }),
6488
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6545
6489
  "span",
6546
6490
  {
6547
6491
  className: "inline-flex shrink-0 items-center",
@@ -6549,7 +6493,7 @@ function AssociationEntitySelect({
6549
6493
  e.preventDefault();
6550
6494
  e.stopPropagation();
6551
6495
  },
6552
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6496
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6553
6497
  DoorControlsSlot,
6554
6498
  {
6555
6499
  token,
@@ -6559,7 +6503,7 @@ function AssociationEntitySelect({
6559
6503
  )
6560
6504
  }
6561
6505
  ),
6562
- adapter.detach && item.id !== activeId ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6506
+ adapter.detach && item.id !== activeId ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6563
6507
  "button",
6564
6508
  {
6565
6509
  type: "button",
@@ -6574,7 +6518,7 @@ function AssociationEntitySelect({
6574
6518
  className: "grid size-5 shrink-0 place-items-center rounded text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-destructive group-hover:opacity-100",
6575
6519
  title: `Remove this ${entityLabel} from here (does not delete it)`,
6576
6520
  "aria-label": `Remove ${item.title}`,
6577
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_icons17.XIcon, { className: "size-3" })
6521
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons18.XIcon, { className: "size-3" })
6578
6522
  }
6579
6523
  ) : null
6580
6524
  ]
@@ -6582,9 +6526,9 @@ function AssociationEntitySelect({
6582
6526
  item.id
6583
6527
  )) }) : null
6584
6528
  ] }),
6585
- createSlot !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "border-t border-border p-1", children: typeof createSlot === "function" ? createSlot(close) : createSlot }) : null,
6586
- createSlot === void 0 && adapter.createAndAttach ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "border-t border-border p-1", children: creating ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center gap-1 px-1 py-0.5", children: [
6587
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6529
+ createSlot !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "border-t border-border p-1", children: typeof createSlot === "function" ? createSlot(close) : createSlot }) : null,
6530
+ createSlot === void 0 && adapter.createAndAttach ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "border-t border-border p-1", children: creating ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-center gap-1 px-1 py-0.5", children: [
6531
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6588
6532
  "input",
6589
6533
  {
6590
6534
  autoFocus: true,
@@ -6608,17 +6552,17 @@ function AssociationEntitySelect({
6608
6552
  "aria-label": `New ${entityLabel} name`
6609
6553
  }
6610
6554
  ),
6611
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6555
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6612
6556
  "button",
6613
6557
  {
6614
6558
  type: "button",
6615
6559
  disabled: busy || !draftName.trim(),
6616
6560
  onClick: () => void create(draftName),
6617
6561
  className: "inline-flex h-6 shrink-0 items-center rounded-md px-1.5 text-[10px] font-medium text-primary transition-colors hover:bg-accent disabled:opacity-50",
6618
- children: busy ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SpinnerIcon, { className: "size-3 animate-spin" }) : "Create"
6562
+ children: busy ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SpinnerIcon, { className: "size-3 animate-spin" }) : "Create"
6619
6563
  }
6620
6564
  )
6621
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
6565
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
6622
6566
  "button",
6623
6567
  {
6624
6568
  type: "button",
@@ -6629,7 +6573,7 @@ function AssociationEntitySelect({
6629
6573
  },
6630
6574
  className: "flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
6631
6575
  children: [
6632
- busy ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SpinnerIcon, { className: "size-3.5 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_icons17.PlusIcon, { className: "size-3.5" }),
6576
+ busy ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SpinnerIcon, { className: "size-3.5 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons18.PlusIcon, { className: "size-3.5" }),
6633
6577
  query.trim() ? `Create "${query.trim()}"` : `New ${info.label}`
6634
6578
  ]
6635
6579
  }
@@ -6712,7 +6656,7 @@ function buildCategoryHierarchy(categories) {
6712
6656
  }
6713
6657
 
6714
6658
  // src/react/components/CategorySelect.tsx
6715
- var import_jsx_runtime17 = require("react/jsx-runtime");
6659
+ var import_jsx_runtime16 = require("react/jsx-runtime");
6716
6660
  var NONE = "__none__";
6717
6661
  var ROOT_PARENT = "__root__";
6718
6662
  function plural(noun) {
@@ -6748,9 +6692,9 @@ function CategorySelect({
6748
6692
  // The type-ahead matches the parent's name too, so someone who knows
6749
6693
  // the branch but not the leaf still finds it.
6750
6694
  keywords: parent ? parent.name : "",
6751
- render: depth === 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "font-medium", children: category.name }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "flex items-center gap-1.5 pl-3 text-muted-foreground", children: [
6752
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CornerDownRightIcon, { className: "h-3.5 w-3.5 shrink-0" }),
6753
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-foreground", children: category.name })
6695
+ render: depth === 0 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "font-medium", children: category.name }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "flex items-center gap-1.5 pl-3 text-muted-foreground", children: [
6696
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CornerDownRightIcon, { className: "h-3.5 w-3.5 shrink-0" }),
6697
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-foreground", children: category.name })
6754
6698
  ] })
6755
6699
  })) : categories.map((category) => ({
6756
6700
  value: category.id,
@@ -6797,8 +6741,8 @@ function CategorySelect({
6797
6741
  );
6798
6742
  return result.id;
6799
6743
  };
6800
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { children: [
6801
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6744
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { children: [
6745
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6802
6746
  import_design_system12.CreatablePicker,
6803
6747
  {
6804
6748
  value: value ?? (allowNone ? NONE : null),
@@ -6814,18 +6758,18 @@ function CategorySelect({
6814
6758
  emptyLabel: `No ${noun} matches that.`,
6815
6759
  ...allowCreate ? { onCreate: create } : {},
6816
6760
  ...allowCreate && hierarchy.hasHierarchy ? {
6817
- createExtra: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_design_system12.Select, { value: createParentId, onValueChange: setCreateParentId, children: [
6818
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6761
+ createExtra: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system12.Select, { value: createParentId, onValueChange: setCreateParentId, children: [
6762
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6819
6763
  import_design_system12.SelectTrigger,
6820
6764
  {
6821
6765
  className: "h-7 text-xs",
6822
6766
  "aria-label": `Put the new ${noun} under`,
6823
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system12.SelectValue, {})
6767
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system12.SelectValue, {})
6824
6768
  }
6825
6769
  ),
6826
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_design_system12.SelectContent, { children: [
6827
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system12.SelectItem, { value: ROOT_PARENT, className: "text-xs", children: "Top level" }),
6828
- hierarchy.items.filter((item) => item.depth === 0).map((item) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
6770
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system12.SelectContent, { children: [
6771
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system12.SelectItem, { value: ROOT_PARENT, className: "text-xs", children: "Top level" }),
6772
+ hierarchy.items.filter((item) => item.depth === 0).map((item) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
6829
6773
  import_design_system12.SelectItem,
6830
6774
  {
6831
6775
  value: item.category.id,
@@ -6845,21 +6789,21 @@ function CategorySelect({
6845
6789
  selected === null && value !== null ? (
6846
6790
  // A stored id whose row this reader cannot see is not "nothing chosen":
6847
6791
  // saying so beats a blank box that looks like an unsaved field.
6848
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("p", { className: "mt-1 text-xs text-muted-foreground", children: [
6792
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("p", { className: "mt-1 text-xs text-muted-foreground", children: [
6849
6793
  "This ",
6850
6794
  noun,
6851
6795
  " is no longer available to you."
6852
6796
  ] })
6853
6797
  ) : null,
6854
- error ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "mt-1 text-xs text-destructive", children: error }) : null
6798
+ error ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "mt-1 text-xs text-destructive", children: error }) : null
6855
6799
  ] });
6856
6800
  }
6857
6801
 
6858
6802
  // src/react/components/CategoryTagPicker.tsx
6859
6803
  var import_react24 = require("react");
6860
6804
  var import_design_system13 = require("@ai-matrx/design-system");
6861
- var import_icons20 = require("@ai-matrx/design-system/icons");
6862
- var import_jsx_runtime18 = require("react/jsx-runtime");
6805
+ var import_icons21 = require("@ai-matrx/design-system/icons");
6806
+ var import_jsx_runtime17 = require("react/jsx-runtime");
6863
6807
  var ROOT_PARENT2 = "__root__";
6864
6808
  function CategoryTagPicker({
6865
6809
  entityType,
@@ -6983,44 +6927,44 @@ function CategoryTagPicker({
6983
6927
  const exactMatch = categories.some(
6984
6928
  (c) => c.name.toLowerCase() === search.trim().toLowerCase()
6985
6929
  );
6986
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex flex-wrap items-center gap-1.5", children: [
6987
- selected.map((c) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
6930
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex flex-wrap items-center gap-1.5", children: [
6931
+ selected.map((c) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
6988
6932
  import_design_system13.Badge,
6989
6933
  {
6990
6934
  variant: "secondary",
6991
6935
  className: "gap-1 pr-1 text-xs font-medium",
6992
6936
  children: [
6993
6937
  showHierarchy ? hierarchyById.get(c.id)?.displayName ?? c.name : c.name,
6994
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6938
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6995
6939
  "button",
6996
6940
  {
6997
6941
  type: "button",
6998
6942
  onClick: () => void toggle(c.id),
6999
6943
  className: "ml-0.5 rounded-full p-0.5 hover:bg-muted-foreground/20",
7000
6944
  "aria-label": `Remove ${c.name}`,
7001
- children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_icons20.XIcon, { className: "h-2.5 w-2.5" })
6945
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_icons21.XIcon, { className: "h-2.5 w-2.5" })
7002
6946
  }
7003
6947
  )
7004
6948
  ]
7005
6949
  },
7006
6950
  c.id
7007
6951
  )),
7008
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_design_system13.Popover, { open, onOpenChange: setOpen, children: [
7009
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system13.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
6952
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_design_system13.Popover, { open, onOpenChange: setOpen, children: [
6953
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system13.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
7010
6954
  import_design_system13.Button,
7011
6955
  {
7012
6956
  variant: "outline",
7013
6957
  size: "sm",
7014
6958
  className: "h-7 gap-1 px-2 text-xs",
7015
6959
  children: [
7016
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Icon, { className: "h-3.5 w-3.5" }),
6960
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon, { className: "h-3.5 w-3.5" }),
7017
6961
  selected.length === 0 ? addLabel : "Edit",
7018
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system13.SelectChevron, { size: "sm" })
6962
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system13.SelectChevron, { size: "sm" })
7019
6963
  ]
7020
6964
  }
7021
6965
  ) }),
7022
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system13.PopoverContent, { sizing: "content", className: "p-0", align: "start", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_design_system13.Command, { shouldFilter: false, children: [
7023
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6966
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system13.PopoverContent, { sizing: "content", className: "p-0", align: "start", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_design_system13.Command, { shouldFilter: false, children: [
6967
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
7024
6968
  import_design_system13.CommandInput,
7025
6969
  {
7026
6970
  placeholder: allowCreate ? "Search or create..." : "Search...",
@@ -7028,9 +6972,9 @@ function CategoryTagPicker({
7028
6972
  onValueChange: setSearch
7029
6973
  }
7030
6974
  ),
7031
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_design_system13.CommandList, { children: [
7032
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system13.CommandEmpty, { className: "px-2 py-3 text-xs text-muted-foreground", children: search.trim() ? "No match." : emptyText }),
7033
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system13.CommandGroup, { children: showHierarchy ? filteredHierarchy.map(({ category, depth, parent }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
6975
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_design_system13.CommandList, { children: [
6976
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system13.CommandEmpty, { className: "px-2 py-3 text-xs text-muted-foreground", children: search.trim() ? "No match." : emptyText }),
6977
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system13.CommandGroup, { children: showHierarchy ? filteredHierarchy.map(({ category, depth, parent }) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
7034
6978
  import_design_system13.CommandItem,
7035
6979
  {
7036
6980
  value: category.id,
@@ -7038,8 +6982,8 @@ function CategoryTagPicker({
7038
6982
  onSelect: () => void toggle(category.id),
7039
6983
  className: (0, import_design_system13.cn)("text-xs", depth === 1 && "pl-6"),
7040
6984
  children: [
7041
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
7042
- import_icons20.CheckIcon,
6985
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6986
+ import_icons21.CheckIcon,
7043
6987
  {
7044
6988
  className: (0, import_design_system13.cn)(
7045
6989
  "mr-2 h-3.5 w-3.5",
@@ -7047,20 +6991,20 @@ function CategoryTagPicker({
7047
6991
  )
7048
6992
  }
7049
6993
  ),
7050
- depth === 1 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CornerDownRightIcon, { className: "mr-1.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }) : null,
7051
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: (0, import_design_system13.cn)(depth === 0 && "font-medium"), children: category.name })
6994
+ depth === 1 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CornerDownRightIcon, { className: "mr-1.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }) : null,
6995
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: (0, import_design_system13.cn)(depth === 0 && "font-medium"), children: category.name })
7052
6996
  ]
7053
6997
  },
7054
6998
  category.id
7055
- )) : filtered.map((c) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
6999
+ )) : filtered.map((c) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
7056
7000
  import_design_system13.CommandItem,
7057
7001
  {
7058
7002
  value: c.id,
7059
7003
  onSelect: () => void toggle(c.id),
7060
7004
  className: "text-xs",
7061
7005
  children: [
7062
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
7063
- import_icons20.CheckIcon,
7006
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
7007
+ import_icons21.CheckIcon,
7064
7008
  {
7065
7009
  className: (0, import_design_system13.cn)(
7066
7010
  "mr-2 h-3.5 w-3.5",
@@ -7073,25 +7017,25 @@ function CategoryTagPicker({
7073
7017
  },
7074
7018
  c.id
7075
7019
  )) }),
7076
- allowCreate && search.trim() && !exactMatch ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_design_system13.CommandGroup, { children: [
7077
- showHierarchy ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "space-y-1.5 px-2 pb-2", children: [
7078
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-[11px] font-medium text-muted-foreground", children: "Place in" }),
7079
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
7020
+ allowCreate && search.trim() && !exactMatch ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_design_system13.CommandGroup, { children: [
7021
+ showHierarchy ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "space-y-1.5 px-2 pb-2", children: [
7022
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-[11px] font-medium text-muted-foreground", children: "Place in" }),
7023
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
7080
7024
  import_design_system13.Select,
7081
7025
  {
7082
7026
  value: createParentId,
7083
7027
  onValueChange: setCreateParentId,
7084
7028
  children: [
7085
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system13.SelectTrigger, { size: "sm", className: "bg-background", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system13.SelectValue, {}) }),
7086
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_design_system13.SelectContent, { children: [
7087
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system13.SelectItem, { value: ROOT_PARENT2, children: "Top level" }),
7088
- hierarchy.roots.map((root) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system13.SelectItem, { value: root.id, children: root.name }, root.id))
7029
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system13.SelectTrigger, { size: "sm", className: "bg-background", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system13.SelectValue, {}) }),
7030
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_design_system13.SelectContent, { children: [
7031
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system13.SelectItem, { value: ROOT_PARENT2, children: "Top level" }),
7032
+ hierarchy.roots.map((root) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system13.SelectItem, { value: root.id, children: root.name }, root.id))
7089
7033
  ] })
7090
7034
  ]
7091
7035
  }
7092
7036
  )
7093
7037
  ] }) : null,
7094
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
7038
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
7095
7039
  import_design_system13.CommandItem,
7096
7040
  {
7097
7041
  value: `__create__${search}`,
@@ -7099,7 +7043,7 @@ function CategoryTagPicker({
7099
7043
  disabled: creating,
7100
7044
  className: "text-xs text-primary",
7101
7045
  children: [
7102
- creating ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SpinnerIcon, { className: "mr-2 h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Icon, { className: "mr-2 h-3.5 w-3.5" }),
7046
+ creating ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SpinnerIcon, { className: "mr-2 h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon, { className: "mr-2 h-3.5 w-3.5" }),
7103
7047
  "Create \u201C",
7104
7048
  search.trim(),
7105
7049
  "\u201D"
@@ -7126,20 +7070,20 @@ function partKeyOf(comment) {
7126
7070
  // src/react/components/CommentBody.tsx
7127
7071
  var import_react25 = require("react");
7128
7072
  var import_design_system14 = require("@ai-matrx/design-system");
7129
- var import_jsx_runtime19 = require("react/jsx-runtime");
7073
+ var import_jsx_runtime18 = require("react/jsx-runtime");
7130
7074
  var INLINE = /(\*\*[^*\n]+\*\*|`[^`\n]+`|\*[^*\n]+\*)/g;
7131
7075
  function renderInline(text) {
7132
7076
  return text.split(INLINE).map((part, i) => {
7133
7077
  if (part.length > 4 && part.startsWith("**") && part.endsWith("**")) {
7134
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: part.slice(2, -2) }, i);
7078
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("strong", { children: part.slice(2, -2) }, i);
7135
7079
  }
7136
7080
  if (part.length > 2 && part.startsWith("`") && part.endsWith("`")) {
7137
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("code", { className: "rounded bg-muted px-1 text-[0.9em]", children: part.slice(1, -1) }, i);
7081
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("code", { className: "rounded bg-muted px-1 text-[0.9em]", children: part.slice(1, -1) }, i);
7138
7082
  }
7139
7083
  if (part.length > 2 && part.startsWith("*") && part.endsWith("*")) {
7140
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("em", { children: part.slice(1, -1) }, i);
7084
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("em", { children: part.slice(1, -1) }, i);
7141
7085
  }
7142
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react25.Fragment, { children: part }, i);
7086
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react25.Fragment, { children: part }, i);
7143
7087
  });
7144
7088
  }
7145
7089
  var BULLET = /^\s*[-*]\s+(.*)$/;
@@ -7150,14 +7094,14 @@ function renderBlocks(lines, keyPrefix) {
7150
7094
  const flushBullets = () => {
7151
7095
  if (!bullets.length) return;
7152
7096
  out.push(
7153
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("ul", { className: "list-disc pl-5", children: bullets.map((b, i) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("li", { children: renderInline(b) }, i)) }, `${keyPrefix}-u${out.length}`)
7097
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("ul", { className: "list-disc pl-5", children: bullets.map((b, i) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("li", { children: renderInline(b) }, i)) }, `${keyPrefix}-u${out.length}`)
7154
7098
  );
7155
7099
  bullets = [];
7156
7100
  };
7157
7101
  const flushPara = () => {
7158
7102
  if (!para.length) return;
7159
7103
  out.push(
7160
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "whitespace-pre-wrap", children: renderInline(para.join("\n")) }, `${keyPrefix}-p${out.length}`)
7104
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "whitespace-pre-wrap", children: renderInline(para.join("\n")) }, `${keyPrefix}-p${out.length}`)
7161
7105
  );
7162
7106
  para = [];
7163
7107
  };
@@ -7191,20 +7135,20 @@ function renderCommentMarkdown(body) {
7191
7135
  }
7192
7136
  return runs.map((run, i) => {
7193
7137
  const blocks = renderBlocks(run.lines, `r${i}`);
7194
- return run.quoted ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7138
+ return run.quoted ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
7195
7139
  "blockquote",
7196
7140
  {
7197
7141
  className: "border-l-2 border-border pl-2 text-muted-foreground",
7198
7142
  children: blocks
7199
7143
  },
7200
7144
  i
7201
- ) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react25.Fragment, { children: blocks }, i);
7145
+ ) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react25.Fragment, { children: blocks }, i);
7202
7146
  });
7203
7147
  }
7204
7148
  function CommentBody({ body, className }) {
7205
7149
  const { commentBody: HostBody } = useAssociationsUiPorts();
7206
- if (HostBody) return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(HostBody, { body, className });
7207
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7150
+ if (HostBody) return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(HostBody, { body, className });
7151
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
7208
7152
  "div",
7209
7153
  {
7210
7154
  "data-comment-body": true,
@@ -7216,7 +7160,7 @@ function CommentBody({ body, className }) {
7216
7160
 
7217
7161
  // src/react/components/CommentThread.tsx
7218
7162
  var import_format = require("@ai-matrx/kit/format");
7219
- var import_jsx_runtime20 = require("react/jsx-runtime");
7163
+ var import_jsx_runtime19 = require("react/jsx-runtime");
7220
7164
  var AUTHOR_DOOR_TOKEN = "user";
7221
7165
  var SYSTEM_AUTHOR_NAME = "AI Matrx";
7222
7166
  function resolveAuthor(comment, authorDisplay) {
@@ -7231,24 +7175,24 @@ function resolveAuthor(comment, authorDisplay) {
7231
7175
  isAgent: true
7232
7176
  };
7233
7177
  }
7234
- const base2 = {
7178
+ const base = {
7235
7179
  userId: comment.createdBy,
7236
7180
  email: comment.author.email,
7237
7181
  displayName: comment.author.displayName,
7238
7182
  avatarUrl: comment.author.avatarUrl
7239
7183
  };
7240
- const enriched = authorDisplay ? authorDisplay(base2) : null;
7241
- const name = enriched?.displayName ?? base2.displayName ?? base2.email ?? "Unknown user";
7184
+ const enriched = authorDisplay ? authorDisplay(base) : null;
7185
+ const name = enriched?.displayName ?? base.displayName ?? base.email ?? "Unknown user";
7242
7186
  return {
7243
7187
  name,
7244
- avatarUrl: enriched?.avatarUrl !== void 0 && enriched?.avatarUrl !== null ? enriched.avatarUrl : base2.avatarUrl,
7188
+ avatarUrl: enriched?.avatarUrl !== void 0 && enriched?.avatarUrl !== null ? enriched.avatarUrl : base.avatarUrl,
7245
7189
  userId: comment.createdBy,
7246
7190
  isAgent: false
7247
7191
  };
7248
7192
  }
7249
7193
  function AuthorAvatar({ author }) {
7250
7194
  if (author.avatarUrl) {
7251
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
7195
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7252
7196
  "img",
7253
7197
  {
7254
7198
  src: author.avatarUrl,
@@ -7257,7 +7201,7 @@ function AuthorAvatar({ author }) {
7257
7201
  }
7258
7202
  );
7259
7203
  }
7260
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
7204
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7261
7205
  "span",
7262
7206
  {
7263
7207
  "aria-hidden": true,
@@ -7272,7 +7216,7 @@ function AuthorName({
7272
7216
  }) {
7273
7217
  const DoorRef2 = entityDoors?.EntityRef;
7274
7218
  if (DoorRef2 && author.userId) {
7275
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
7219
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7276
7220
  DoorRef2,
7277
7221
  {
7278
7222
  token: AUTHOR_DOOR_TOKEN,
@@ -7283,7 +7227,7 @@ function AuthorName({
7283
7227
  }
7284
7228
  );
7285
7229
  }
7286
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-sm font-medium text-foreground", children: author.name });
7230
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-sm font-medium text-foreground", children: author.name });
7287
7231
  }
7288
7232
  function CommentComposer({
7289
7233
  onSubmit,
@@ -7314,8 +7258,8 @@ function CommentComposer({
7314
7258
  }
7315
7259
  setBody("");
7316
7260
  }
7317
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("form", { onSubmit: submit, className: "flex flex-col gap-1.5", children: [
7318
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
7261
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("form", { onSubmit: submit, className: "flex flex-col gap-1.5", children: [
7262
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7319
7263
  "textarea",
7320
7264
  {
7321
7265
  value: body,
@@ -7330,7 +7274,7 @@ function CommentComposer({
7330
7274
  className: "w-full resize-y rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
7331
7275
  }
7332
7276
  ),
7333
- error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
7277
+ error && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7334
7278
  import_design_system15.ErrorBox,
7335
7279
  {
7336
7280
  className: "text-xs text-destructive",
@@ -7340,10 +7284,10 @@ function CommentComposer({
7340
7284
  origin: "associations/CommentThread"
7341
7285
  }
7342
7286
  ),
7343
- error && signIn && isSignedOutMessage(error) && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SignInAgain, { onClick: signIn }),
7344
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center gap-2", children: [
7345
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_design_system15.Button, { type: "submit", size: "sm", disabled: !body.trim() || submitting, children: [
7346
- submitting && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SpinnerIcon, { className: "mr-1 h-3 w-3 animate-spin" }),
7287
+ error && signIn && isSignedOutMessage(error) && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SignInAgain, { onClick: signIn }),
7288
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center gap-2", children: [
7289
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_design_system15.Button, { type: "submit", size: "sm", disabled: !body.trim() || submitting, children: [
7290
+ submitting && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SpinnerIcon, { className: "mr-1 h-3 w-3 animate-spin" }),
7347
7291
  submitLabel
7348
7292
  ] }),
7349
7293
  trailing
@@ -7385,7 +7329,7 @@ function CommentItem({
7385
7329
  notifier.error(res.error ?? "Could not delete the comment");
7386
7330
  }
7387
7331
  }
7388
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
7332
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
7389
7333
  "div",
7390
7334
  {
7391
7335
  "data-comment-id": comment.id,
@@ -7394,15 +7338,15 @@ function CommentItem({
7394
7338
  depth > 0 && "border-l border-border pl-3"
7395
7339
  ),
7396
7340
  children: [
7397
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center gap-2", children: [
7398
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AuthorAvatar, { author }),
7399
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AuthorName, { author, entityDoors }),
7400
- author.isAgent && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "rounded bg-muted px-1 py-0.5 text-[10px] font-medium uppercase tracking-wide text-muted-foreground", children: "Agent" }),
7401
- showPart && partLabel && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "truncate text-xs text-muted-foreground", title: partLabel, children: [
7341
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center gap-2", children: [
7342
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(AuthorAvatar, { author }),
7343
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(AuthorName, { author, entityDoors }),
7344
+ author.isAgent && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "rounded bg-muted px-1 py-0.5 text-[10px] font-medium uppercase tracking-wide text-muted-foreground", children: "Agent" }),
7345
+ showPart && partLabel && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: "truncate text-xs text-muted-foreground", title: partLabel, children: [
7402
7346
  "on ",
7403
7347
  partLabel
7404
7348
  ] }),
7405
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
7349
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7406
7350
  "span",
7407
7351
  {
7408
7352
  className: "text-xs text-muted-foreground",
@@ -7413,7 +7357,7 @@ function CommentItem({
7413
7357
  })
7414
7358
  }
7415
7359
  ),
7416
- edited && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
7360
+ edited && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7417
7361
  "span",
7418
7362
  {
7419
7363
  className: "text-xs text-muted-foreground",
@@ -7422,7 +7366,7 @@ function CommentItem({
7422
7366
  }
7423
7367
  )
7424
7368
  ] }),
7425
- editing ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "pl-8", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
7369
+ editing ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "pl-8", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7426
7370
  CommentComposer,
7427
7371
  {
7428
7372
  initialValue: comment.body,
@@ -7434,7 +7378,7 @@ function CommentItem({
7434
7378
  if (res.ok) setEditing(false);
7435
7379
  return res;
7436
7380
  },
7437
- trailing: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
7381
+ trailing: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7438
7382
  import_design_system15.Button,
7439
7383
  {
7440
7384
  type: "button",
@@ -7445,10 +7389,10 @@ function CommentItem({
7445
7389
  }
7446
7390
  )
7447
7391
  }
7448
- ) }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CommentBody, { body: comment.body, className: "pl-8" }),
7449
- !editing && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex items-center gap-1 pl-7", children: confirmingDelete ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
7450
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-xs text-destructive", children: "Deletes this comment for everyone." }),
7451
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
7392
+ ) }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CommentBody, { body: comment.body, className: "pl-8" }),
7393
+ !editing && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "flex items-center gap-1 pl-7", children: confirmingDelete ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
7394
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-xs text-destructive", children: "Deletes this comment for everyone." }),
7395
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
7452
7396
  import_design_system15.Button,
7453
7397
  {
7454
7398
  type: "button",
@@ -7457,12 +7401,12 @@ function CommentItem({
7457
7401
  disabled: deleting,
7458
7402
  onClick: () => void confirmDelete(),
7459
7403
  children: [
7460
- deleting && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SpinnerIcon, { className: "mr-1 h-3 w-3 animate-spin" }),
7404
+ deleting && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SpinnerIcon, { className: "mr-1 h-3 w-3 animate-spin" }),
7461
7405
  "Delete"
7462
7406
  ]
7463
7407
  }
7464
7408
  ),
7465
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
7409
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7466
7410
  import_design_system15.Button,
7467
7411
  {
7468
7412
  type: "button",
@@ -7473,8 +7417,8 @@ function CommentItem({
7473
7417
  children: "Cancel"
7474
7418
  }
7475
7419
  )
7476
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
7477
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
7420
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
7421
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7478
7422
  "button",
7479
7423
  {
7480
7424
  type: "button",
@@ -7483,8 +7427,8 @@ function CommentItem({
7483
7427
  children: "Reply"
7484
7428
  }
7485
7429
  ),
7486
- isOwn && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
7487
- canEdit && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
7430
+ isOwn && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
7431
+ canEdit && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7488
7432
  "button",
7489
7433
  {
7490
7434
  type: "button",
@@ -7493,7 +7437,7 @@ function CommentItem({
7493
7437
  children: "Edit"
7494
7438
  }
7495
7439
  ),
7496
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
7440
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7497
7441
  "button",
7498
7442
  {
7499
7443
  type: "button",
@@ -7504,9 +7448,9 @@ function CommentItem({
7504
7448
  )
7505
7449
  ] })
7506
7450
  ] }) }),
7507
- replying && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-start gap-2 pl-8 pt-1", children: [
7508
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CornerDownRightIcon, { className: "mt-2 h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
7509
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
7451
+ replying && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-start gap-2 pl-8 pt-1", children: [
7452
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CornerDownRightIcon, { className: "mt-2 h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
7453
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7510
7454
  CommentComposer,
7511
7455
  {
7512
7456
  submitLabel: "Reply",
@@ -7523,7 +7467,7 @@ function CommentItem({
7523
7467
  }
7524
7468
  return res;
7525
7469
  },
7526
- trailing: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
7470
+ trailing: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7527
7471
  import_design_system15.Button,
7528
7472
  {
7529
7473
  type: "button",
@@ -7536,7 +7480,7 @@ function CommentItem({
7536
7480
  }
7537
7481
  ) })
7538
7482
  ] }),
7539
- replies.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex flex-col gap-3 pl-8 pt-1", children: replies.map((reply) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
7483
+ replies.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "flex flex-col gap-3 pl-8 pt-1", children: replies.map((reply) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7540
7484
  CommentItem,
7541
7485
  {
7542
7486
  comment: reply,
@@ -7592,11 +7536,11 @@ function CommentThread({
7592
7536
  const roots = part ? tree.roots.filter((c) => partKeyOf(c) === part.key) : tree.roots;
7593
7537
  const shownCount = part ? countThread(roots, childrenOf) : thread.comments.length;
7594
7538
  const loading = (thread.status === "loading" || thread.status === "idle") && thread.comments.length === 0;
7595
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("section", { className: (0, import_design_system15.cn)("flex flex-col gap-3", className), children: [
7596
- showHeader && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("header", { className: "flex items-center gap-2", children: [
7597
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h3", { className: "text-sm font-semibold text-foreground", children: "Comments" }),
7598
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-xs text-muted-foreground tabular-nums", children: shownCount }),
7599
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
7539
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("section", { className: (0, import_design_system15.cn)("flex flex-col gap-3", className), children: [
7540
+ showHeader && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("header", { className: "flex items-center gap-2", children: [
7541
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("h3", { className: "text-sm font-semibold text-foreground", children: "Comments" }),
7542
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-xs text-muted-foreground tabular-nums", children: shownCount }),
7543
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7600
7544
  "button",
7601
7545
  {
7602
7546
  type: "button",
@@ -7604,11 +7548,11 @@ function CommentThread({
7604
7548
  "aria-label": "Refresh comments",
7605
7549
  title: "Refresh comments",
7606
7550
  className: "ml-auto flex h-6 w-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
7607
- children: thread.status === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SpinnerIcon, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(RefreshIcon, { className: "h-3.5 w-3.5" })
7551
+ children: thread.status === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SpinnerIcon, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(RefreshIcon, { className: "h-3.5 w-3.5" })
7608
7552
  }
7609
7553
  )
7610
7554
  ] }),
7611
- thread.error && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
7555
+ thread.error && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
7612
7556
  import_design_system15.ErrorBox,
7613
7557
  {
7614
7558
  as: "div",
@@ -7617,9 +7561,9 @@ function CommentThread({
7617
7561
  operation: "Load comments",
7618
7562
  origin: "associations/CommentThread",
7619
7563
  children: [
7620
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "min-w-0 flex-1", children: thread.error }),
7621
- signInPort && isSignedOutMessage(thread.error) && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SignInAgain, { onClick: signInPort }),
7622
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
7564
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "min-w-0 flex-1", children: thread.error }),
7565
+ signInPort && isSignedOutMessage(thread.error) && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SignInAgain, { onClick: signInPort }),
7566
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7623
7567
  import_design_system15.Button,
7624
7568
  {
7625
7569
  type: "button",
@@ -7633,10 +7577,10 @@ function CommentThread({
7633
7577
  ]
7634
7578
  }
7635
7579
  ),
7636
- loading ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col gap-3", "aria-hidden": true, "data-testid": "comments-loading", children: [
7637
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_design_system15.Skeleton, { className: "h-12 w-full" }),
7638
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_design_system15.Skeleton, { className: "h-12 w-4/5" })
7639
- ] }) : roots.length === 0 && !thread.error ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-sm text-muted-foreground", children: "No comments yet." }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex flex-col gap-4", children: roots.map((comment) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
7580
+ loading ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex flex-col gap-3", "aria-hidden": true, "data-testid": "comments-loading", children: [
7581
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_design_system15.Skeleton, { className: "h-12 w-full" }),
7582
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_design_system15.Skeleton, { className: "h-12 w-4/5" })
7583
+ ] }) : roots.length === 0 && !thread.error ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-sm text-muted-foreground", children: "No comments yet." }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "flex flex-col gap-4", children: roots.map((comment) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7640
7584
  CommentItem,
7641
7585
  {
7642
7586
  comment,
@@ -7649,7 +7593,7 @@ function CommentThread({
7649
7593
  },
7650
7594
  comment.id
7651
7595
  )) }),
7652
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
7596
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7653
7597
  CommentComposer,
7654
7598
  {
7655
7599
  onSubmit: async (body) => {
@@ -7663,6 +7607,6 @@ function CommentThread({
7663
7607
  ] });
7664
7608
  }
7665
7609
  function SignInAgain({ onClick }) {
7666
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_design_system15.Button, { type: "button", size: "sm", variant: "outline", onClick, children: "Sign in" });
7610
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_design_system15.Button, { type: "button", size: "sm", variant: "outline", onClick, children: "Sign in" });
7667
7611
  }
7668
7612
  //# sourceMappingURL=index.cjs.map